From 68eb8f2160815b459c81f5751042cf1ef9c60fc4 Mon Sep 17 00:00:00 2001 From: Timur <35872220+bornova@users.noreply.github.com> Date: Mon, 24 Jun 2024 23:54:32 +0000 Subject: [PATCH] Build v5.2.0 --- build/css/dark.css | 2 +- build/css/light.css | 2 +- build/css/numara.css | 2 +- build/js/numara.js | 114 ++++++++++++++++++++--------------------- build/js/numara.js.map | 6 +-- 5 files changed, 63 insertions(+), 63 deletions(-) diff --git a/build/css/dark.css b/build/css/dark.css index 26790d8..d7f8fa8 100644 --- a/build/css/dark.css +++ b/build/css/dark.css @@ -1,3 +1,3 @@ -/* Numara Calculator 5.1.3 */ +/* Numara Calculator 5.2.0 */ html,body{background-color:#1f1f1f}::-webkit-scrollbar,::-webkit-scrollbar-track,::-webkit-scrollbar-corner{background-color:transparent}::-webkit-scrollbar-thumb{background-color:#333}::-webkit-scrollbar-thumb:hover{background-color:#444}.header-win-title,.header-mac-title{color:#e6e6e6}.min-btn-win:hover,.max-btn-win:hover,.unmax-btn-win:hover{background-color:#333}.min-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTAiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA0LjM5OVY1LjVIMFY0LjM5OWgxMXoiIC8+PC9zdmc+)}.max-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSAwdjExSDBWMGgxMXpNOS44OTkgMS4xMDFIMS4xVjkuOWg4LjhWMS4xeiIgLz48L3N2Zz4=)}.unmax-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA4Ljc5OEg4Ljc5OFYxMUgwVjIuMjAyaDIuMjAyVjBIMTF2OC43OTh6bS0zLjI5OC01LjVoLTYuNnY2LjZoNi42di02LjZ6TTkuOSAxLjFIMy4yOTh2MS4xMDFoNS41djUuNWgxLjF2LTYuNnoiIC8+PC9zdmc+)}.close-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik02LjI3OSA1LjVMMTEgMTAuMjIxbC0uNzc5Ljc3OUw1LjUgNi4yNzkuNzc5IDExIDAgMTAuMjIxIDQuNzIxIDUuNSAwIC43NzkuNzc5IDAgNS41IDQuNzIxIDEwLjIyMSAwIDExIC43NzkgNi4yNzkgNS41eiIgLz48L3N2Zz4=)}.lineNo{color:#616161}.activeLine>div{color:#bebebe}.input{color:#e6e6e6}.ruler{border-bottom:1px solid #303030}.errTitle,.lineError,.lineError:hover,.lineError>div,.lineNoError>div{color:#d41111}.msgBox{color:#58a1c5}.divider:before{background-color:#3b3b3b!important}.divider:hover:before{background-color:#405062!important}.output{color:#1eb5f0}.output>span::selection{background-color:#151515fa!important}.answer:hover{background:#0a0a0a}.action,.noAction,.noAction:hover{color:#7b9dc5}.actionDivider{border-right:1px solid #3b3b3b}.pageName{color:#627d9c}.pageListHeader{border-bottom:1px solid #181818}.pageListItem{border-bottom:1px solid #181818;background-color:#222;color:#e6e6e6}.pageListItem:hover,.activePage{background-color:#333}.drop-parent-icon,.pageListSort{color:#7b9dc5}.drop-parent-icon:hover,.pageListSort:hover{color:#0f6ecd}.uk-dropdown{background:#000;color:inherit}.deletePageButton{color:#e6e6e6}.deletePageButton:hover{color:#d41111}.deleteAllPagesButton:hover{color:#d41111!important}.renamePageButton:hover,.dupPageButton:hover,.sortListItem:hover{color:#2196f3}.sortListDivider{border-top-color:#444!important}.dialog-about-title{color:#e6e6e6}.dialog-about-links{border-top:1px solid #333333}.dialog-about-updateStatus{color:#999}#dialog-settings h3{color:#a0d3ff}#dialog-settings .settingMod,#dialog-settings .settingModToggle{color:#dd9359}.precision,.expLower,.expUpper{border:1px solid #333333;color:#e6e6e6}.subSwitchIcon{color:#bbb}.textBox{border:1px solid #666666;color:#eaeaea}.slider:before{background-color:#222}.lastUpdated{color:#999}.origin{stroke:#f9f9f9}text{fill:#e6e6e6}line{opacity:.5}.domain{stroke:#333;opacity:1}.syntaxError{color:#d41111}.uk-modal{background-color:#000c}.uk-modal-dialog{background-color:#1f1f1f}.uk-modal-body{color:#e6e6e6}.uk-modal-title{color:#b2cfdd}.uk-select:not([multiple]):not([size]){border-color:#333;background-color:#1f1f1f;color:#e6e6e6}.uk-select:not([multiple]):not([size]) option{color:#e6e6e6}.uk-button-default{border-color:#333;background-color:#333}.uk-button-default:focus,.uk-button-default:hover{border-color:#393e44;background-color:#333}.uk-button-danger,.uk-button-danger:focus{border-color:#333;background-color:#333;color:#f0506e}.uk-button-danger:hover{border-color:#bd2e2e4d;background-color:#444;color:#ff7373}.uk-button-danger:active{background-color:#444}.uk-button-danger:disabled{border-color:#333}.uk-button-danger:disabled:hover{border-color:#333;background-color:transparent;color:#999}.uk-tab>*>a{color:#666}.uk-tab>*>a:hover{color:#777}.uk-tab>.uk-active>a{color:#b2cfdd}.uk-notification-message{border:1px solid #333333;background-color:#252525}.uk-notification-message-primary{color:#2196f3}.uk-tooltip{background-color:#000}.uk-offcanvas-bar{border-right:1px solid #181818}.uk-offcanvas-bar a{color:#7b9dc5}.uk-offcanvas-bar a:hover{color:#0f6ecd}.cm-s-numara{color:#e6e6e6!important}.cm-s-numara .CodeMirror-cursor{border-left:1px solid #e6e6e6!important}.cm-s-numara .CodeMirror-selected{background:#193552!important}.cm-s-numara .CodeMirror-linenumber,.cm-s-numara .CodeMirror-scrollbar-filler,.cm-s-numara .CodeMirror-gutter-filler{background-color:#1f1f1f!important}.cm-s-numara .CodeMirror-dialog-top{border-color:#666;background-color:#1f1f1f!important;color:#e6e6e6!important}.cm-s-numara button{color:#e6e6e6!important}.cm-s-numara .CodeMirror-matchingbracket{color:#999!important}.CodeMirror-hints{border-color:#222!important;background-color:#333!important}.CodeMirror-hint:hover{background-color:#222!important}li.CodeMirror-hint-active{background-color:#069!important;color:#f9f9f9!important}.cm-currency{color:#009688!important}.cm-constant{color:#eaa1f6!important}.cm-unit,.cm-udu{color:#4d87c9!important}.cm-scope{color:#be6317!important}.cm-lineNo{color:#e06c75!important}.cm-number{color:#e6e6e6!important}.cm-operator{color:#bbb!important}.cm-comment{color:#5a5a5a!important}.cm-function,.cm-udf{color:#cb82f5!important}.cm-text{color:#e6e6e6!important}.cm-variable{color:#96b4c4!important}.cm-excel{color:#3cc383!important}.CodeMirror-linenumber{color:#666}.CodeMirror.cm-s-material-darker{border:1px solid #666666} diff --git a/build/css/light.css b/build/css/light.css index 29f55b5..e2a743c 100644 --- a/build/css/light.css +++ b/build/css/light.css @@ -1,3 +1,3 @@ -/* Numara Calculator 5.1.3 */ +/* Numara Calculator 5.2.0 */ html,body{background-color:#fff;color:#444}::-webkit-scrollbar,::-webkit-scrollbar-track,::-webkit-scrollbar-corner{background-color:transparent}::-webkit-scrollbar-thumb{background-color:#eaeaea}::-webkit-scrollbar-thumb:hover{background-color:#dadada}.header-win-title,.header-mac-title{color:#384859}.min-btn-win:hover,.max-btn-win:hover,.unmax-btn-win:hover{background-color:#eee}.min-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTAiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA0LjM5OVY1LjVIMFY0LjM5OWgxMXoiIC8+PC9zdmc+)}.max-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSAwdjExSDBWMGgxMXpNOS44OTkgMS4xMDFIMS4xVjkuOWg4LjhWMS4xeiIgLz48L3N2Zz4=)}.unmax-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMSA4Ljc5OEg4Ljc5OFYxMUgwVjIuMjAyaDIuMjAyVjBIMTF2OC43OTh6bS0zLjI5OC01LjVoLTYuNnY2LjZoNi42di02LjZ6TTkuOSAxLjFIMy4yOTh2MS4xMDFoNS41djUuNWgxLjF2LTYuNnoiIC8+PC9zdmc+)}.close-btn-win{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYig2OCwgNjgsIDY4KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik02LjI3OSA1LjVMMTEgMTAuMjIxbC0uNzc5Ljc3OUw1LjUgNi4yNzkuNzc5IDExIDAgMTAuMjIxIDQuNzIxIDUuNSAwIC43NzkuNzc5IDAgNS41IDQuNzIxIDEwLjIyMSAwIDExIC43NzkgNi4yNzkgNS41eiIgLz48L3N2Zz4=)}.lineNo{color:#c8c8c8}.activeLine>div{color:#7a7a7a}.input{color:#444}.ruler{border-bottom:1px solid #f1f1f1}.errTitle,.lineError,.lineError:hover,.lineError>div,.lineNoError>div,.syntaxError{color:#b10e0e}.msgBox{color:#069}.divider:before{background-color:#eaeaea!important}.divider:hover:before{background-color:#b7d5e6!important}.output{color:#17586b}.output>span::selection{background-color:#e7f3fffa!important;color:inherit}.answer:hover{background:#f5f5f5}.action,.noAction,.noAction:hover{color:#607d8b}.actionDivider{border-right:1px solid #eaeaea}.pageName{color:#687e89}.pageListHeader,.pageListItem{border-bottom:1px solid #eaeaea}.pageListItem:hover{background-color:#f9f9f9}.activePage{background-color:#f5f5f5}.drop-parent-icon,.pageListSort{color:#607d8b}.drop-parent-icon:hover,.pageListSort:hover{color:#4682b4}.deletePageButton{color:#666}.deletePageButton:hover{color:#b10e0e}.deleteAllPagesButton:hover{color:#b10e0e!important}.renamePageButton:hover,.dupPageButton:hover,.sortListItem:hover{color:#005cc5}.sortListDivider{border-top-color:#eaeaea!important}.dialog-about-title{color:#162e44}.dialog-about-links{border-top:1px solid #eaeaea}.dialog-about-updateStatus{color:#666}#dialog-settings h3{color:#1d3f5c}#dialog-settings .settingMod,#dialog-settings .settingModToggle{color:#dd9359}.precision,.expLower,.expUpper{border:1px solid #e5e5e5;color:#333}.subSwitchIcon{color:#999}.textBox{color:#666}.slider:before{background-color:#fff}.slider.round:before{background-color:#fff}.lastUpdated{color:#999}text{fill:#444}.uk-modal{background-color:#0009}.uk-button-default{border-color:#e7eff7}.uk-button-default:focus,.uk-button-default:hover{border-color:#c9dcef}.uk-button-danger,.uk-button-danger:focus{border-color:#e5e5e5;background-color:#f5f5f5;color:#bd2e2ee6}.uk-button-danger:hover{border-color:#bd2e2e4d;background-color:#f5f5f5;color:#bd2e2ee6}.uk-button-danger:active{background-color:#eee}.uk-button-danger:disabled:hover{border-color:#e5e5e5;background-color:transparent;color:#999}.uk-select{color:#444}.uk-notification-message{border:1px solid #efefef}.uk-notification-message-primary{color:#2196f3}.uk-tooltip{background-color:#eaeaea;color:#000}.uk-offcanvas-bar{border-right:1px solid #eaeaea;background:#fff;color:#333}.uk-offcanvas-bar a{color:#607d8b}.uk-offcanvas-bar a:hover{color:#0f6ecd}.uk-offcanvas-bar .uk-close{color:#333}.uk-offcanvas-bar .uk-close:hover{color:#4682b4}.CodeMirror-linenumber{color:#ccc}.cm-s-numara .CodeMirror-selected{background:#c9e0f7!important}.cm-s-numara .CodeMirror-linenumber,.cm-s-numara .CodeMirror-scrollbar-filler,.cm-s-numara .CodeMirror-gutter-filler,.cm-s-numara .CodeMirror-dialog-top{background-color:#fff!important}.cm-s-numara .CodeMirror-matchingbracket{color:#999!important}.CodeMirror-hint:hover{background-color:#eaeaea!important;color:#162e44!important}li.CodeMirror-hint-active{background-color:#367ea1;color:#fff!important}.cm-currency{color:#009688!important}.cm-constant{color:#9c27b0!important}.cm-unit,.cm-udu{color:#005cc5!important}.cm-scope{color:#be6317!important}.cm-lineNo{color:#e06c75!important}.cm-number{color:#333!important}.cm-operator{color:#888!important}.cm-comment{color:#bebebe!important}.cm-function,.cm-udf{color:#6f42c1!important}.cm-text{color:#333!important}.cm-variable{color:#57707c!important}.cm-excel{color:#197b43!important}.dialog-udfu .CodeMirror{border:1px solid #eaeaea!important}.cm-s-default{border:1px solid #eaeaea} diff --git a/build/css/numara.css b/build/css/numara.css index ba27274..5d850eb 100644 --- a/build/css/numara.css +++ b/build/css/numara.css @@ -1,4 +1,4 @@ -/* Numara Calculator 5.1.3 */ +/* Numara Calculator 5.2.0 */ html{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-size:16px;font-weight:400;line-height:1.5;-webkit-text-size-adjust:100%;background:#fff;color:#666}body{margin:0}.uk-link,a{color:#1e87f0;text-decoration:none;cursor:pointer}.uk-link-toggle:hover .uk-link,.uk-link:hover,a:hover{color:#0f6ecd;text-decoration:underline}abbr[title]{text-decoration:underline dotted;-webkit-text-decoration-style:dotted}b,strong{font-weight:bolder}:not(pre)>code,:not(pre)>kbd,:not(pre)>samp{font-family:Consolas,monaco,monospace;font-size:.875rem;color:#f0506e;white-space:nowrap;padding:2px 6px;background:#f8f8f8}em{color:#f0506e}ins{background:#ffd;color:#666;text-decoration:none}mark{background:#ffd;color:#666}q{font-style:italic}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}audio,canvas,iframe,img,svg,video{vertical-align:middle}canvas,img,svg,video{max-width:100%;height:auto;box-sizing:border-box}img:not([src]){visibility:hidden;min-width:1px}iframe{border:0}address,dl,fieldset,figure,ol,p,pre,ul{margin:0 0 20px}*+address,*+dl,*+fieldset,*+figure,*+ol,*+p,*+pre,*+ul{margin-top:20px}.uk-h1,.uk-h2,.uk-h3,.uk-h4,.uk-h5,.uk-h6,.uk-heading-2xlarge,.uk-heading-3xlarge,.uk-heading-large,.uk-heading-medium,.uk-heading-small,.uk-heading-xlarge,h1,h2,h3,h4,h5,h6{margin:0 0 20px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-weight:400;color:#333;text-transform:none}*+.uk-h1,*+.uk-h2,*+.uk-h3,*+.uk-h4,*+.uk-h5,*+.uk-h6,*+.uk-heading-2xlarge,*+.uk-heading-3xlarge,*+.uk-heading-large,*+.uk-heading-medium,*+.uk-heading-small,*+.uk-heading-xlarge,*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:40px}.uk-h1,h1{font-size:2.23125rem;line-height:1.2}.uk-h2,h2{font-size:1.7rem;line-height:1.3}.uk-h3,h3{font-size:1.5rem;line-height:1.4}.uk-h4,h4{font-size:1.25rem;line-height:1.4}.uk-h5,h5{font-size:16px;line-height:1.4}.uk-h6,h6{font-size:.875rem;line-height:1.4}@media (min-width:960px){.uk-h1,h1{font-size:2.625rem}.uk-h2,h2{font-size:2rem}}ol,ul{padding-left:30px}ol>li>ol,ol>li>ul,ul>li>ol,ul>li>ul{margin:0}dt{font-weight:700}dd{margin-left:0}.uk-hr,hr{overflow:visible;text-align:inherit;margin:0 0 20px;border:0;border-top:1px solid #e5e5e5}*+.uk-hr,*+hr{margin-top:20px}address{font-style:normal}blockquote{margin:0 0 20px;font-size:1.25rem;line-height:1.5;font-style:italic;color:#333}*+blockquote{margin-top:20px}blockquote p:last-of-type{margin-bottom:0}blockquote footer{margin-top:10px;font-size:.875rem;line-height:1.5;color:#666}blockquote footer:before{content:"\2014 "}pre{font:.875rem/1.5 Consolas,monaco,monospace;color:#666;-moz-tab-size:4;tab-size:4;overflow:auto;padding:10px;border:1px solid #e5e5e5;border-radius:3px;background:#fff}pre code{font-family:Consolas,monaco,monospace}:focus{outline:0}:focus-visible{outline:2px dotted #333}::selection{background:#39f;color:#fff;text-shadow:none}details,main{display:block}summary{display:list-item}template{display:none}:root{--uk-breakpoint-s:640px;--uk-breakpoint-m:960px;--uk-breakpoint-l:1200px;--uk-breakpoint-xl:1600px}.uk-link-muted a,.uk-link-toggle .uk-link-muted,a.uk-link-muted{color:#999}.uk-link-muted a:hover,.uk-link-toggle:hover .uk-link-muted,a.uk-link-muted:hover{color:#666}.uk-link-text a,.uk-link-toggle .uk-link-text,a.uk-link-text{color:inherit}.uk-link-text a:hover,.uk-link-toggle:hover .uk-link-text,a.uk-link-text:hover{color:#999}.uk-link-heading a,.uk-link-toggle .uk-link-heading,a.uk-link-heading{color:inherit}.uk-link-heading a:hover,.uk-link-toggle:hover .uk-link-heading,a.uk-link-heading:hover{color:#1e87f0;text-decoration:none}.uk-link-reset a,a.uk-link-reset,.uk-link-toggle{color:inherit!important;text-decoration:none!important}.uk-heading-small{font-size:2.6rem;line-height:1.2}.uk-heading-medium{font-size:2.8875rem;line-height:1.1}.uk-heading-large{font-size:3.4rem;line-height:1.1}.uk-heading-xlarge{font-size:4rem;line-height:1}.uk-heading-2xlarge{font-size:6rem;line-height:1}.uk-heading-3xlarge{font-size:8rem;line-height:1}@media (min-width:960px){.uk-heading-small{font-size:3.25rem}.uk-heading-medium{font-size:3.5rem}.uk-heading-large{font-size:4rem}.uk-heading-xlarge{font-size:6rem}.uk-heading-2xlarge{font-size:8rem}.uk-heading-3xlarge{font-size:11rem}}@media (min-width:1200px){.uk-heading-medium{font-size:4rem}.uk-heading-large{font-size:6rem}.uk-heading-xlarge{font-size:8rem}.uk-heading-2xlarge{font-size:11rem}.uk-heading-3xlarge{font-size:15rem}}.uk-heading-divider{padding-bottom:calc(5px + .1em);border-bottom:calc(.2px + .05em) solid #e5e5e5}.uk-heading-bullet{position:relative}.uk-heading-bullet:before{content:"";display:inline-block;position:relative;top:-.1em;vertical-align:middle;height:calc(4px + .7em);margin-right:calc(5px + .2em);border-left:calc(5px + .1em) solid #e5e5e5}.uk-heading-line{overflow:hidden}.uk-heading-line>*{display:inline-block;position:relative}.uk-heading-line>:after,.uk-heading-line>:before{content:"";position:absolute;top:calc(50% - ((.2px + .05em)/2));width:2000px;border-bottom:calc(.2px + .05em) solid #e5e5e5}.uk-heading-line>:before{right:100%;margin-right:calc(5px + .3em)}.uk-heading-line>:after{left:100%;margin-left:calc(5px + .3em)}[class*=uk-divider]{border:none;margin-bottom:20px}*+[class*=uk-divider]{margin-top:20px}.uk-divider-icon{position:relative;height:20px;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22none%22%20stroke%3D%22%23e5e5e5%22%20stroke-width%3D%222%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%227%22%20%2F%3E%0A%3C%2Fsvg%3E%0A);background-repeat:no-repeat;background-position:50% 50%}.uk-divider-icon:after,.uk-divider-icon:before{content:"";position:absolute;top:50%;max-width:calc(50% - 25px);border-bottom:1px solid #e5e5e5}.uk-divider-icon:before{right:calc(50% + 25px);width:100%}.uk-divider-icon:after{left:calc(50% + 25px);width:100%}.uk-divider-small{line-height:0}.uk-divider-small:after{content:"";display:inline-block;width:100px;max-width:100%;border-top:1px solid #e5e5e5;vertical-align:top}.uk-divider-vertical{width:max-content;height:100px;margin-left:auto;margin-right:auto;border-left:1px solid #e5e5e5}.uk-list{padding:0;list-style:none}.uk-list>*{break-inside:avoid-column}.uk-list>*>:last-child{margin-bottom:0}.uk-list>*>ul,.uk-list>:nth-child(n+2){margin-top:10px}.uk-list-circle>*,.uk-list-decimal>*,.uk-list-disc>*,.uk-list-hyphen>*,.uk-list-square>*{padding-left:30px}.uk-list-decimal{counter-reset:decimal}.uk-list-decimal>*{counter-increment:decimal}.uk-list-circle>:before,.uk-list-decimal>:before,.uk-list-disc>:before,.uk-list-hyphen>:before,.uk-list-square>:before{content:"";position:relative;left:-30px;width:30px;height:1.5em;margin-bottom:-1.5em;display:list-item;list-style-position:inside;text-align:right}.uk-list-disc>:before{list-style-type:disc}.uk-list-circle>:before{list-style-type:circle}.uk-list-square>:before{list-style-type:square}.uk-list-decimal>:before{content:counter(decimal,decimal) "\200a.\a0"}.uk-list-hyphen>:before{content:"\2013\a0\a0"}.uk-list-muted>:before{color:#999!important}.uk-list-emphasis>:before{color:#333!important}.uk-list-primary>:before{color:#1e87f0!important}.uk-list-secondary>:before{color:#222!important}.uk-list-bullet>*{padding-left:30px}.uk-list-bullet>:before{content:"";display:list-item;position:relative;left:-30px;width:30px;height:1.5em;margin-bottom:-1.5em;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%226%22%20height%3D%226%22%20viewBox%3D%220%200%206%206%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23666%22%20cx%3D%223%22%20cy%3D%223%22%20r%3D%223%22%20%2F%3E%0A%3C%2Fsvg%3E);background-repeat:no-repeat;background-position:50% 50%}.uk-list-divider>:nth-child(n+2){margin-top:10px;padding-top:10px;border-top:1px solid #e5e5e5}.uk-list-striped>*{padding:10px}.uk-list-striped>:nth-of-type(odd){border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5}.uk-list-striped>:nth-of-type(odd){background:#f8f8f8}.uk-list-striped>:nth-child(n+2){margin-top:0}.uk-list-large>*>ul,.uk-list-large>:nth-child(n+2){margin-top:20px}.uk-list-collapse>*>ul,.uk-list-collapse>:nth-child(n+2){margin-top:0}.uk-list-large.uk-list-divider>:nth-child(n+2){margin-top:20px;padding-top:20px}.uk-list-collapse.uk-list-divider>:nth-child(n+2){margin-top:0;padding-top:0}.uk-list-large.uk-list-striped>*{padding:20px 10px}.uk-list-collapse.uk-list-striped>*{padding-top:0;padding-bottom:0}.uk-list-collapse.uk-list-striped>:nth-child(n+2),.uk-list-large.uk-list-striped>:nth-child(n+2){margin-top:0}.uk-description-list>dt{color:#333;font-size:.875rem;font-weight:400;text-transform:uppercase}.uk-description-list>dt:nth-child(n+2){margin-top:20px}.uk-description-list-divider>dt:nth-child(n+2){margin-top:20px;padding-top:20px;border-top:1px solid #e5e5e5}.uk-table{border-collapse:collapse;border-spacing:0;width:100%;margin-bottom:20px}*+.uk-table{margin-top:20px}.uk-table th{padding:16px 12px;text-align:left;vertical-align:bottom;font-size:.875rem;font-weight:400;color:#999;text-transform:uppercase}.uk-table td{padding:16px 12px;vertical-align:top}.uk-table td>:last-child{margin-bottom:0}.uk-table tfoot{font-size:.875rem}.uk-table caption{font-size:.875rem;text-align:left;color:#999}.uk-table-middle,.uk-table-middle td{vertical-align:middle!important}.uk-table-divider>:first-child>tr:not(:first-child),.uk-table-divider>:not(:first-child)>tr,.uk-table-divider>tr:not(:first-child){border-top:1px solid #e5e5e5}.uk-table-striped tbody tr:nth-of-type(odd),.uk-table-striped>tr:nth-of-type(odd){background:#f8f8f8;border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5}.uk-table-hover tbody tr:hover,.uk-table-hover>tr:hover{background:#ffd}.uk-table tbody tr.uk-active,.uk-table>tr.uk-active{background:#ffd}.uk-table-small td,.uk-table-small th{padding:10px 12px}.uk-table-large td,.uk-table-large th{padding:22px 12px}.uk-table-justify td:first-child,.uk-table-justify th:first-child{padding-left:0}.uk-table-justify td:last-child,.uk-table-justify th:last-child{padding-right:0}.uk-table-shrink{width:1px}.uk-table-expand{min-width:150px}.uk-table-link{padding:0!important}.uk-table-link>a{display:block;padding:16px 12px}.uk-table-small .uk-table-link>a{padding:10px 12px}@media (max-width:959px){.uk-table-responsive,.uk-table-responsive tbody,.uk-table-responsive td,.uk-table-responsive th,.uk-table-responsive tr{display:block}.uk-table-responsive thead{display:none}.uk-table-responsive td,.uk-table-responsive th{width:auto!important;max-width:none!important;min-width:0!important;overflow:visible!important;white-space:normal!important}.uk-table-responsive .uk-table-link:not(:first-child)>a,.uk-table-responsive td:not(:first-child):not(.uk-table-link),.uk-table-responsive th:not(:first-child):not(.uk-table-link){padding-top:5px!important}.uk-table-responsive .uk-table-link:not(:last-child)>a,.uk-table-responsive td:not(:last-child):not(.uk-table-link),.uk-table-responsive th:not(:last-child):not(.uk-table-link){padding-bottom:5px!important}.uk-table-justify.uk-table-responsive td,.uk-table-justify.uk-table-responsive th{padding-left:0;padding-right:0}}.uk-table tbody tr{transition:background-color .1s linear}.uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-table-striped>tr:nth-of-type(2n):last-child{border-bottom:1px solid #e5e5e5}.uk-icon{margin:0;border:none;border-radius:0;overflow:visible;font:inherit;color:inherit;text-transform:none;padding:0;background-color:transparent;display:inline-block;fill:currentcolor;line-height:0}button.uk-icon:not(:disabled){cursor:pointer}.uk-icon::-moz-focus-inner{border:0;padding:0}.uk-icon:not(.uk-preserve) [fill*="#"]:not(.uk-preserve){fill:currentcolor}.uk-icon:not(.uk-preserve) [stroke*="#"]:not(.uk-preserve){stroke:currentcolor}.uk-icon>*{transform:translate(0)}.uk-icon-image{width:20px;height:20px;background-position:50% 50%;background-repeat:no-repeat;background-size:contain;vertical-align:middle;object-fit:scale-down;max-width:none}.uk-icon-link{color:#999;text-decoration:none!important}.uk-icon-link:hover{color:#666}.uk-active>.uk-icon-link,.uk-icon-link:active{color:#595959}.uk-icon-button{box-sizing:border-box;width:36px;height:36px;border-radius:500px;background:#f8f8f8;color:#999;vertical-align:middle;display:inline-flex;justify-content:center;align-items:center;transition:.1s ease-in-out;transition-property:color,background-color}.uk-icon-button:hover{background-color:#ebebeb;color:#666}.uk-active>.uk-icon-button,.uk-icon-button:active{background-color:#dfdfdf;color:#666}.uk-range{-webkit-appearance:none;box-sizing:border-box;margin:0;vertical-align:middle;max-width:100%;width:100%;background:0 0}.uk-range:focus{outline:0}.uk-range::-moz-focus-outer{border:none}.uk-range:not(:disabled)::-webkit-slider-thumb{cursor:pointer}.uk-range:not(:disabled)::-moz-range-thumb{cursor:pointer}.uk-range::-webkit-slider-runnable-track{height:3px;background:#ebebeb;border-radius:500px}.uk-range:active::-webkit-slider-runnable-track,.uk-range:focus::-webkit-slider-runnable-track{background:#dedede}.uk-range::-moz-range-track{height:3px;background:#ebebeb;border-radius:500px}.uk-range:focus::-moz-range-track{background:#dedede}.uk-range::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-7px;height:15px;width:15px;border-radius:500px;background:#fff;border:1px solid #ccc}.uk-range::-moz-range-thumb{border:none;height:15px;width:15px;margin-top:-7px;border-radius:500px;background:#fff;border:1px solid #ccc}.uk-checkbox,.uk-input,.uk-radio,.uk-select,.uk-textarea{box-sizing:border-box;margin:0;border-radius:0;font:inherit}.uk-input{overflow:visible}.uk-select{text-transform:none}.uk-select optgroup{font:inherit;font-weight:700}.uk-textarea{overflow:auto}.uk-input[type=search]::-webkit-search-cancel-button,.uk-input[type=search]::-webkit-search-decoration{-webkit-appearance:none}.uk-input[type=number]::-webkit-inner-spin-button,.uk-input[type=number]::-webkit-outer-spin-button{height:auto}.uk-input::-moz-placeholder,.uk-textarea::-moz-placeholder{opacity:1}.uk-checkbox:not(:disabled),.uk-radio:not(:disabled){cursor:pointer}.uk-fieldset{border:none;margin:0;padding:0;min-width:0}.uk-input,.uk-textarea{-webkit-appearance:none}.uk-input,.uk-select,.uk-textarea{max-width:100%;width:100%;border:0 none;padding:0 10px;background:#fff;color:#666;border:1px solid #e5e5e5;transition:.2s ease-in-out;transition-property:color,background-color,border}.uk-input,.uk-select:not([multiple]):not([size]){height:40px;vertical-align:middle;display:inline-block}.uk-input:not(input),.uk-select:not(select){line-height:38px}.uk-select[multiple],.uk-select[size],.uk-textarea{padding-top:6px;padding-bottom:6px;vertical-align:top}.uk-select[multiple],.uk-select[size]{resize:vertical}.uk-input:focus,.uk-select:focus,.uk-textarea:focus{outline:0;background-color:#fff;color:#666;border-color:#1e87f0}.uk-input:disabled,.uk-select:disabled,.uk-textarea:disabled{background-color:#f8f8f8;color:#999;border-color:#e5e5e5}.uk-input::placeholder{color:#999}.uk-textarea::placeholder{color:#999}.uk-form-small{font-size:.875rem}.uk-form-small:not(textarea):not([multiple]):not([size]){height:30px;padding-left:8px;padding-right:8px}[multiple].uk-form-small,[size].uk-form-small,textarea.uk-form-small{padding:5px 8px}.uk-form-small:not(select):not(input):not(textarea){line-height:28px}.uk-form-large{font-size:1.25rem}.uk-form-large:not(textarea):not([multiple]):not([size]){height:55px;padding-left:12px;padding-right:12px}[multiple].uk-form-large,[size].uk-form-large,textarea.uk-form-large{padding:7px 12px}.uk-form-large:not(select):not(input):not(textarea){line-height:53px}.uk-form-danger,.uk-form-danger:focus{color:#f0506e;border-color:#f0506e}.uk-form-success,.uk-form-success:focus{color:#32d296;border-color:#32d296}.uk-form-blank{background:0 0;border-color:transparent}.uk-form-blank:focus{border-color:#e5e5e5;border-style:solid}input.uk-form-width-xsmall{width:50px}select.uk-form-width-xsmall{width:75px}.uk-form-width-small{width:130px}.uk-form-width-medium{width:200px}.uk-form-width-large{width:500px}.uk-select:not([multiple]):not([size]){-webkit-appearance:none;-moz-appearance:none;padding-right:20px;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%201%209%206%2015%206%22%20%2F%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%2013%209%208%2015%208%22%20%2F%3E%0A%3C%2Fsvg%3E%0A);background-repeat:no-repeat;background-position:100% 50%}.uk-select:not([multiple]):not([size]) option{color:#666}.uk-select:not([multiple]):not([size]):disabled{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23999%22%20points%3D%2212%201%209%206%2015%206%22%20%2F%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23999%22%20points%3D%2212%2013%209%208%2015%208%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-input[list]{padding-right:20px;background-repeat:no-repeat;background-position:100% 50%}.uk-input[list]:focus,.uk-input[list]:hover{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%2012%208%206%2016%206%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-input[list]::-webkit-calendar-picker-indicator{display:none!important}.uk-checkbox,.uk-radio{display:inline-block;height:16px;width:16px;overflow:hidden;margin-top:-4px;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;border:1px solid #ccc;transition:.2s ease-in-out;transition-property:background-color,border}.uk-radio{border-radius:50%}.uk-checkbox:focus,.uk-radio:focus{background-color:#0000;outline:0;border-color:#1e87f0}.uk-checkbox:checked,.uk-checkbox:indeterminate,.uk-radio:checked{background-color:#1e87f0;border-color:transparent}.uk-checkbox:checked:focus,.uk-checkbox:indeterminate:focus,.uk-radio:checked:focus{background-color:#0e6dcd}.uk-radio:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23fff%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-checkbox:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23fff%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-checkbox:indeterminate{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23fff%22%20x%3D%223%22%20y%3D%228%22%20width%3D%2210%22%20height%3D%221%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-checkbox:disabled,.uk-radio:disabled{background-color:#f8f8f8;border-color:#e5e5e5}.uk-radio:disabled:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23999%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-checkbox:disabled:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23999%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-checkbox:disabled:indeterminate{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23999%22%20x%3D%223%22%20y%3D%228%22%20width%3D%2210%22%20height%3D%221%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-legend{width:100%;color:inherit;padding:0;font-size:1.5rem;line-height:1.4}.uk-form-custom{display:inline-block;position:relative;max-width:100%;vertical-align:middle}.uk-form-custom input[type=file],.uk-form-custom select{position:absolute;top:0;z-index:1;width:100%;height:100%;left:0;-webkit-appearance:none;opacity:0;cursor:pointer}.uk-form-custom input[type=file]{font-size:500px;overflow:hidden}.uk-form-label{color:#333;font-size:.875rem}.uk-form-stacked .uk-form-label{display:block;margin-bottom:5px}@media (max-width:959px){.uk-form-horizontal .uk-form-label{display:block;margin-bottom:5px}}@media (min-width:960px){.uk-form-horizontal .uk-form-label{width:200px;margin-top:7px;float:left}.uk-form-horizontal .uk-form-controls{margin-left:215px}.uk-form-horizontal .uk-form-controls-text{padding-top:7px}}.uk-form-icon{position:absolute;top:0;bottom:0;left:0;width:40px;display:inline-flex;justify-content:center;align-items:center;color:#999}.uk-form-icon:hover{color:#666}.uk-form-icon:not(a):not(button):not(input){pointer-events:none}.uk-form-icon:not(.uk-form-icon-flip)~.uk-input{padding-left:40px!important}.uk-form-icon-flip{right:0;left:auto}.uk-form-icon-flip~.uk-input{padding-right:40px!important}.uk-button{margin:0;border:none;overflow:visible;font:inherit;color:inherit;text-transform:none;-webkit-appearance:none;border-radius:0;display:inline-block;box-sizing:border-box;padding:0 30px;vertical-align:middle;font-size:.875rem;line-height:38px;text-align:center;text-decoration:none;text-transform:uppercase;transition:.1s ease-in-out;transition-property:color,background-color,border-color}.uk-button:not(:disabled){cursor:pointer}.uk-button::-moz-focus-inner{border:0;padding:0}.uk-button:hover{text-decoration:none}.uk-button-default{background-color:transparent;color:#333;border:1px solid #e5e5e5}.uk-button-default:hover{background-color:transparent;color:#333;border-color:#b2b2b2}.uk-button-default.uk-active,.uk-button-default:active{background-color:transparent;color:#333;border-color:#999}.uk-button-primary{background-color:#1e87f0;color:#fff;border:1px solid transparent}.uk-button-primary:hover{background-color:#0f7ae5;color:#fff}.uk-button-primary.uk-active,.uk-button-primary:active{background-color:#0e6dcd;color:#fff}.uk-button-secondary{background-color:#222;color:#fff;border:1px solid transparent}.uk-button-secondary:hover{background-color:#151515;color:#fff}.uk-button-secondary.uk-active,.uk-button-secondary:active{background-color:#080808;color:#fff}.uk-button-danger{background-color:#f0506e;color:#fff;border:1px solid transparent}.uk-button-danger:hover{background-color:#ee395b;color:#fff}.uk-button-danger.uk-active,.uk-button-danger:active{background-color:#ec2147;color:#fff}.uk-button-danger:disabled,.uk-button-default:disabled,.uk-button-primary:disabled,.uk-button-secondary:disabled{background-color:transparent;color:#999;border-color:#e5e5e5}.uk-button-small{padding:0 15px;line-height:28px;font-size:.875rem}.uk-button-large{padding:0 40px;line-height:53px;font-size:.875rem}.uk-button-text{padding:0;line-height:1.5;background:0 0;color:#333;position:relative}.uk-button-text:before{content:"";position:absolute;bottom:0;left:0;right:100%;border-bottom:1px solid currentColor;transition:right .3s ease-out}.uk-button-text:hover{color:#333}.uk-button-text:hover:before{right:0}.uk-button-text:disabled{color:#999}.uk-button-text:disabled:before{display:none}.uk-button-link{padding:0;line-height:1.5;background:0 0;color:#333}.uk-button-link:hover{color:#999;text-decoration:none}.uk-button-link:disabled{color:#999;text-decoration:none}.uk-button-group{display:inline-flex;vertical-align:middle;position:relative}.uk-button-group>.uk-button:nth-child(n+2),.uk-button-group>div:nth-child(n+2) .uk-button{margin-left:-1px}.uk-button-group .uk-button.uk-active,.uk-button-group .uk-button:active,.uk-button-group .uk-button:focus,.uk-button-group .uk-button:hover{position:relative;z-index:1}.uk-progress{vertical-align:baseline;display:block;width:100%;border:0;background-color:#f8f8f8;margin-bottom:20px;height:15px;border-radius:500px;overflow:hidden}*+.uk-progress{margin-top:20px}.uk-progress::-webkit-progress-bar{background-color:transparent}.uk-progress::-webkit-progress-value{background-color:#1e87f0;transition:width .6s ease}.uk-progress::-moz-progress-bar{background-color:#1e87f0;transition:width .6s ease}.uk-section{display:flow-root;box-sizing:border-box;padding-top:40px;padding-bottom:40px}@media (min-width:960px){.uk-section{padding-top:70px;padding-bottom:70px}}.uk-section>:last-child{margin-bottom:0}.uk-section-xsmall{padding-top:20px;padding-bottom:20px}.uk-section-small{padding-top:40px;padding-bottom:40px}.uk-section-large{padding-top:70px;padding-bottom:70px}@media (min-width:960px){.uk-section-large{padding-top:140px;padding-bottom:140px}}.uk-section-xlarge{padding-top:140px;padding-bottom:140px}@media (min-width:960px){.uk-section-xlarge{padding-top:210px;padding-bottom:210px}}.uk-section-default{--uk-inverse:dark;background:#fff}.uk-section-muted{--uk-inverse:dark;background:#f8f8f8}.uk-section-primary{--uk-inverse:light;background:#1e87f0}.uk-section-secondary{--uk-inverse:light;background:#222}.uk-container{display:flow-root;box-sizing:content-box;max-width:1200px;margin-left:auto;margin-right:auto;padding-left:15px;padding-right:15px}@media (min-width:640px){.uk-container{padding-left:30px;padding-right:30px}}@media (min-width:960px){.uk-container{padding-left:40px;padding-right:40px}}.uk-container>:last-child{margin-bottom:0}.uk-container .uk-container{padding-left:0;padding-right:0}.uk-container-xsmall{max-width:750px}.uk-container-small{max-width:900px}.uk-container-large{max-width:1400px}.uk-container-xlarge{max-width:1600px}.uk-container-expand{max-width:none}.uk-container-expand-left{margin-left:0}.uk-container-expand-right{margin-right:0}@media (min-width:640px){.uk-container-expand-left.uk-container-xsmall,.uk-container-expand-right.uk-container-xsmall{max-width:calc(50% + 345px)}.uk-container-expand-left.uk-container-small,.uk-container-expand-right.uk-container-small{max-width:calc(50% + 420px)}}@media (min-width:960px){.uk-container-expand-left,.uk-container-expand-right{max-width:calc(50% + 560px)}.uk-container-expand-left.uk-container-xsmall,.uk-container-expand-right.uk-container-xsmall{max-width:calc(50% + 335px)}.uk-container-expand-left.uk-container-small,.uk-container-expand-right.uk-container-small{max-width:calc(50% + 410px)}.uk-container-expand-left.uk-container-large,.uk-container-expand-right.uk-container-large{max-width:calc(50% + 660px)}.uk-container-expand-left.uk-container-xlarge,.uk-container-expand-right.uk-container-xlarge{max-width:calc(50% + 760px)}}.uk-container-item-padding-remove-left,.uk-container-item-padding-remove-right{width:calc(100% + 15px)}.uk-container-item-padding-remove-left{margin-left:-15px}.uk-container-item-padding-remove-right{margin-right:-15px}@media (min-width:640px){.uk-container-item-padding-remove-left,.uk-container-item-padding-remove-right{width:calc(100% + 30px)}.uk-container-item-padding-remove-left{margin-left:-30px}.uk-container-item-padding-remove-right{margin-right:-30px}}@media (min-width:960px){.uk-container-item-padding-remove-left,.uk-container-item-padding-remove-right{width:calc(100% + 40px)}.uk-container-item-padding-remove-left{margin-left:-40px}.uk-container-item-padding-remove-right{margin-right:-40px}}.uk-tile{display:flow-root;position:relative;box-sizing:border-box;padding:40px 15px}@media (min-width:640px){.uk-tile{padding-left:30px;padding-right:30px}}@media (min-width:960px){.uk-tile{padding:70px 40px}}.uk-tile>:last-child{margin-bottom:0}.uk-tile-xsmall{padding-top:20px;padding-bottom:20px}.uk-tile-small{padding-top:40px;padding-bottom:40px}.uk-tile-large{padding-top:70px;padding-bottom:70px}@media (min-width:960px){.uk-tile-large{padding-top:140px;padding-bottom:140px}}.uk-tile-xlarge{padding-top:140px;padding-bottom:140px}@media (min-width:960px){.uk-tile-xlarge{padding-top:210px;padding-bottom:210px}}.uk-tile-default{--uk-inverse:dark;background-color:#fff}.uk-tile-muted{--uk-inverse:dark;background-color:#f8f8f8}.uk-tile-primary{--uk-inverse:light;background-color:#1e87f0}.uk-tile-secondary{--uk-inverse:light;background-color:#222}.uk-card{position:relative;box-sizing:border-box;transition:box-shadow .1s ease-in-out}.uk-card-body{display:flow-root;padding:30px}.uk-card-header,.uk-card-footer{display:flow-root;padding:15px 30px}@media (min-width:1200px){.uk-card-body{padding:40px}.uk-card-header,.uk-card-footer{padding:20px 40px}}.uk-card-body>:last-child,.uk-card-footer>:last-child,.uk-card-header>:last-child{margin-bottom:0}.uk-card-title{font-size:1.5rem;line-height:1.4}.uk-card-badge{position:absolute;top:15px;right:15px;z-index:1;height:22px;padding:0 10px;background:#1e87f0;color:#fff;font-size:.875rem;display:flex;justify-content:center;align-items:center;line-height:0;border-radius:2px;text-transform:uppercase}.uk-card-badge:first-child+*{margin-top:0}.uk-card-hover:not(.uk-card-default):not(.uk-card-primary):not(.uk-card-secondary):hover{background-color:#fff;box-shadow:0 14px 25px #00000029}.uk-card-default{--uk-inverse:dark;background-color:#fff;color:#666;box-shadow:0 5px 15px #00000014}.uk-card-default .uk-card-title{color:#333}.uk-card-default.uk-card-hover:hover{background-color:#fff;box-shadow:0 14px 25px #00000029}.uk-card-default .uk-card-header{border-bottom:1px solid #e5e5e5}.uk-card-default .uk-card-footer{border-top:1px solid #e5e5e5}.uk-card-primary{--uk-inverse:light;background-color:#1e87f0;color:#fff;box-shadow:0 5px 15px #00000014}.uk-card-primary .uk-card-title{color:#fff}.uk-card-primary.uk-card-hover:hover{background-color:#1e87f0;box-shadow:0 14px 25px #00000029}.uk-card-secondary{--uk-inverse:light;background-color:#222;color:#fff;box-shadow:0 5px 15px #00000014}.uk-card-secondary .uk-card-title{color:#fff}.uk-card-secondary.uk-card-hover:hover{background-color:#222;box-shadow:0 14px 25px #00000029}.uk-card-small .uk-card-body,.uk-card-small.uk-card-body{padding:20px}.uk-card-small .uk-card-header,.uk-card-small .uk-card-footer{padding:13px 20px}@media (min-width:1200px){.uk-card-large .uk-card-body,.uk-card-large.uk-card-body{padding:70px}.uk-card-large .uk-card-header,.uk-card-large .uk-card-footer{padding:35px 70px}}.uk-card-body>.uk-nav-default{margin-left:-30px;margin-right:-30px}.uk-card-body>.uk-nav-default:only-child{margin-top:-15px;margin-bottom:-15px}.uk-card-body>.uk-nav-default .uk-nav-divider,.uk-card-body>.uk-nav-default .uk-nav-header,.uk-card-body>.uk-nav-default>li>a{padding-left:30px;padding-right:30px}.uk-card-body>.uk-nav-default .uk-nav-sub{padding-left:45px}@media (min-width:1200px){.uk-card-body>.uk-nav-default{margin-left:-40px;margin-right:-40px}.uk-card-body>.uk-nav-default:only-child{margin-top:-25px;margin-bottom:-25px}.uk-card-body>.uk-nav-default .uk-nav-divider,.uk-card-body>.uk-nav-default .uk-nav-header,.uk-card-body>.uk-nav-default>li>a{padding-left:40px;padding-right:40px}.uk-card-body>.uk-nav-default .uk-nav-sub{padding-left:55px}}.uk-card-small>.uk-nav-default{margin-left:-20px;margin-right:-20px}.uk-card-small>.uk-nav-default:only-child{margin-top:-5px;margin-bottom:-5px}.uk-card-small>.uk-nav-default .uk-nav-divider,.uk-card-small>.uk-nav-default .uk-nav-header,.uk-card-small>.uk-nav-default>li>a{padding-left:20px;padding-right:20px}.uk-card-small>.uk-nav-default .uk-nav-sub{padding-left:35px}@media (min-width:1200px){.uk-card-large>.uk-nav-default{margin:0}.uk-card-large>.uk-nav-default:only-child{margin:0}.uk-card-large>.uk-nav-default .uk-nav-divider,.uk-card-large>.uk-nav-default .uk-nav-header,.uk-card-large>.uk-nav-default>li>a{padding-left:0;padding-right:0}.uk-card-large>.uk-nav-default .uk-nav-sub{padding-left:15px}}.uk-close{color:#999;transition:.1s ease-in-out;transition-property:color,opacity}.uk-close:hover{color:#666}.uk-spinner>*{animation:uk-spinner-rotate 1.4s linear infinite}@keyframes uk-spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(270deg)}}.uk-spinner>*>*{stroke-dasharray:88px;stroke-dashoffset:0;transform-origin:center;animation:uk-spinner-dash 1.4s ease-in-out infinite;stroke-width:1;stroke-linecap:round}@keyframes uk-spinner-dash{0%{stroke-dashoffset:88px}50%{stroke-dashoffset:22px;transform:rotate(135deg)}to{stroke-dashoffset:88px;transform:rotate(450deg)}}.uk-totop{padding:5px;color:#999;transition:color .1s ease-in-out}.uk-totop:hover{color:#666}.uk-totop:active{color:#333}.uk-marker{padding:5px;background:#222;color:#fff;border-radius:500px}.uk-marker:hover{color:#fff}.uk-alert{position:relative;margin-bottom:20px;padding:15px 29px 15px 15px;background:#f8f8f8;color:#666}*+.uk-alert{margin-top:20px}.uk-alert>:last-child{margin-bottom:0}.uk-alert-close{position:absolute;top:20px;right:15px;color:inherit;opacity:.4}.uk-alert-close:first-child+*{margin-top:0}.uk-alert-close:hover{color:inherit;opacity:.8}.uk-alert-primary{background:#d8eafc;color:#1e87f0}.uk-alert-success{background:#edfbf6;color:#32d296}.uk-alert-warning{background:#fff6ee;color:#faa05a}.uk-alert-danger{background:#fef4f6;color:#f0506e}.uk-alert h1,.uk-alert h2,.uk-alert h3,.uk-alert h4,.uk-alert h5,.uk-alert h6{color:inherit}.uk-alert a:not([class]){color:inherit;text-decoration:underline}.uk-alert a:not([class]):hover{color:inherit;text-decoration:underline}.uk-placeholder{margin-bottom:20px;padding:30px;background:0 0;border:1px dashed #e5e5e5}*+.uk-placeholder{margin-top:20px}.uk-placeholder>:last-child{margin-bottom:0}.uk-badge{box-sizing:border-box;min-width:18px;height:18px;padding:0 5px;border-radius:500px;vertical-align:middle;background:#1e87f0;color:#fff!important;font-size:11px;display:inline-flex;justify-content:center;align-items:center;line-height:0}.uk-badge:hover{text-decoration:none}.uk-label{display:inline-block;padding:0 10px;background:#1e87f0;line-height:1.5;font-size:.875rem;color:#fff;vertical-align:middle;white-space:nowrap;border-radius:2px;text-transform:uppercase}.uk-label-success{background-color:#32d296;color:#fff}.uk-label-warning{background-color:#faa05a;color:#fff}.uk-label-danger{background-color:#f0506e;color:#fff}.uk-overlay{padding:30px}.uk-overlay>:last-child{margin-bottom:0}.uk-overlay-default{--uk-inverse:dark;background:#fffc}.uk-overlay-primary{--uk-inverse:light;background:#222c}.uk-article{display:flow-root}.uk-article>:last-child{margin-bottom:0}.uk-article+.uk-article{margin-top:70px}.uk-article-title{font-size:2.23125rem;line-height:1.2}@media (min-width:960px){.uk-article-title{font-size:2.625rem}}.uk-article-meta{font-size:.875rem;line-height:1.4;color:#999}.uk-article-meta a{color:#999}.uk-article-meta a:hover{color:#666;text-decoration:none}.uk-comment-body{display:flow-root;overflow-wrap:break-word;word-wrap:break-word}.uk-comment-header{display:flow-root;margin-bottom:20px}.uk-comment-body>:last-child,.uk-comment-header>:last-child{margin-bottom:0}.uk-comment-title{font-size:1.25rem;line-height:1.4}.uk-comment-meta{font-size:.875rem;line-height:1.4;color:#999}.uk-comment-list{padding:0;list-style:none}.uk-comment-list>:nth-child(n+2){margin-top:70px}.uk-comment-list .uk-comment~ul{margin:70px 0 0;padding-left:30px;list-style:none}@media (min-width:960px){.uk-comment-list .uk-comment~ul{padding-left:100px}}.uk-comment-list .uk-comment~ul>:nth-child(n+2){margin-top:70px}.uk-comment-primary{padding:30px;background-color:#f8f8f8}.uk-search{display:inline-block;position:relative;max-width:100%;margin:0}.uk-search-input::-webkit-search-cancel-button,.uk-search-input::-webkit-search-decoration{-webkit-appearance:none}.uk-search-input::-moz-placeholder{opacity:1}.uk-search-input{box-sizing:border-box;margin:0;border-radius:0;font:inherit;overflow:visible;-webkit-appearance:none;vertical-align:middle;width:100%;border:none;color:#666}.uk-search-input:focus{outline:0}.uk-search-input::placeholder{color:#999}.uk-search .uk-search-icon{position:absolute;top:0;bottom:0;left:0;display:inline-flex;justify-content:center;align-items:center;color:#999}.uk-search .uk-search-icon:hover{color:#999}.uk-search .uk-search-icon:not(a):not(button):not(input){pointer-events:none}.uk-search .uk-search-icon-flip{right:0;left:auto}.uk-search-default{width:240px}.uk-search-default .uk-search-input{height:40px;padding-left:10px;padding-right:10px;background:0 0;border:1px solid #e5e5e5}.uk-search-default .uk-search-input:focus{background-color:#0000;border-color:#1e87f0}.uk-search-default .uk-search-icon{width:40px}.uk-search-default:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:40px}.uk-search-default:has(.uk-search-icon-flip) .uk-search-input{padding-right:40px}.uk-search-navbar{width:240px}.uk-search-navbar .uk-search-input{height:40px;padding-left:10px;padding-right:10px;background:#fff;border:1px solid #e5e5e5}.uk-search-navbar .uk-search-input:focus{background-color:#fff;border-color:#1e87f0}.uk-search-navbar .uk-search-icon{width:40px}.uk-search-navbar:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:40px}.uk-search-navbar:has(.uk-search-icon-flip) .uk-search-input{padding-right:40px}.uk-search-medium{width:400px}.uk-search-medium .uk-search-input{height:40px;background:0 0;font-size:1.5rem}.uk-search-medium .uk-search-icon{width:24px}.uk-search-medium:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:34px}.uk-search-medium:has(.uk-search-icon-flip) .uk-search-input{padding-right:34px}.uk-search-large{width:500px}.uk-search-large .uk-search-input{height:80px;background:0 0;font-size:2.625rem}.uk-search-large .uk-search-icon{width:40px}.uk-search-large:has(.uk-search-icon:not(.uk-search-icon-flip)) .uk-search-input{padding-left:60px}.uk-search-large:has(.uk-search-icon-flip) .uk-search-input{padding-right:60px}.uk-search-toggle{color:#999}.uk-search-toggle:hover{color:#666}.uk-accordion{padding:0;list-style:none}.uk-accordion>:nth-child(n+2){margin-top:20px}.uk-accordion-title{display:block;font-size:1.25rem;line-height:1.4;color:#333;overflow:hidden}.uk-accordion-title:before{content:"";width:1.4em;height:1.4em;margin-left:10px;float:right;background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20width%3D%221%22%20height%3D%2213%22%20x%3D%226%22%20y%3D%220%22%20%2F%3E%0A%3C%2Fsvg%3E);background-repeat:no-repeat;background-position:50% 50%}.uk-open>.uk-accordion-title:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-accordion-title:hover{color:#666;text-decoration:none}.uk-accordion-content{display:flow-root;margin-top:20px}.uk-accordion-content>:last-child{margin-bottom:0}.uk-drop{display:none;position:absolute;z-index:1020;--uk-position-offset:20px;--uk-position-viewport-offset:15px;box-sizing:border-box;width:300px}.uk-drop.uk-open{display:block}.uk-drop-stack .uk-drop-grid>*{width:100%!important}.uk-drop-parent-icon{margin-left:.25em;transition:transform .3s ease-out}[aria-expanded=true]>.uk-drop-parent-icon{transform:rotateX(180deg)}.uk-dropbar{--uk-position-offset:0;--uk-position-shift-offset:0;--uk-position-viewport-offset:0;--uk-inverse:dark;width:auto;padding:25px 15px;background:#fff;color:#666}.uk-dropbar>:last-child{margin-bottom:0}@media (min-width:640px){.uk-dropbar{padding-left:30px;padding-right:30px}}@media (min-width:960px){.uk-dropbar{padding-left:40px;padding-right:40px}}.uk-dropbar :focus-visible{outline-color:#333!important}.uk-dropbar-large{padding-top:40px;padding-bottom:40px}.uk-dropbar-top{box-shadow:0 12px 7px -6px #0000000d}.uk-dropbar-bottom{box-shadow:0 -12px 7px -6px #0000000d}.uk-dropbar-left{box-shadow:12px 0 7px -6px #0000000d}.uk-dropbar-right{box-shadow:-12px 0 7px -6px #0000000d}.uk-dropnav-dropbar{position:absolute;z-index:980;padding:0;left:0;right:0}.uk-modal{display:none;position:fixed;inset:0;z-index:1010;overflow-y:auto;padding:15px;background:#0009;opacity:0;transition:opacity .15s linear}@media (min-width:640px){.uk-modal{padding:50px 30px}}@media (min-width:960px){.uk-modal{padding-left:40px;padding-right:40px}}.uk-modal.uk-open{opacity:1}.uk-modal-page{overflow:hidden}.uk-modal-dialog{position:relative;box-sizing:border-box;margin:0 auto;width:600px;max-width:100%!important;background:#fff;opacity:0;transform:translateY(-100px);transition:.3s linear;transition-property:opacity,transform}.uk-open>.uk-modal-dialog{opacity:1;transform:translateY(0)}.uk-modal-container .uk-modal-dialog{width:1200px}.uk-modal-full{padding:0;background:0 0}.uk-modal-full .uk-modal-dialog{margin:0;width:100%;max-width:100%;transform:translateY(0)}.uk-modal-body{display:flow-root;padding:20px}.uk-modal-header{display:flow-root;padding:10px 20px;background:#fff;border-bottom:1px solid #e5e5e5}.uk-modal-footer{display:flow-root;padding:10px 20px;background:#fff;border-top:1px solid #e5e5e5}@media (min-width:640px){.uk-modal-body{padding:30px}.uk-modal-header,.uk-modal-footer{padding:15px 30px}}.uk-modal-body>:last-child,.uk-modal-footer>:last-child,.uk-modal-header>:last-child{margin-bottom:0}.uk-modal-title{font-size:2rem;line-height:1.3}[class*=uk-modal-close-]{position:absolute;z-index:1010;top:10px;right:10px;padding:5px}[class*=uk-modal-close-]:first-child+*{margin-top:0}.uk-modal-close-outside{top:0;right:-5px;transform:translateY(-100%);color:#fff}.uk-modal-close-outside:hover{color:#fff}@media (min-width:960px){.uk-modal-close-outside{right:0;transform:translate(100%,-100%)}}.uk-modal-close-full{top:0;right:0;padding:10px;background:#fff}@media (min-width:960px){.uk-modal-close-full{padding:20px}}.uk-slideshow{-webkit-tap-highlight-color:transparent}.uk-slideshow-items{position:relative;z-index:0;margin:0;padding:0;list-style:none;overflow:hidden;-webkit-touch-callout:none;touch-action:pan-y}.uk-slideshow-items>*{position:absolute;inset:0;overflow:hidden;will-change:transform,opacity}.uk-slideshow-items>:not(.uk-active){display:none}.uk-slider{-webkit-tap-highlight-color:transparent}.uk-slider-container{overflow:hidden;overflow:clip}.uk-slider-container-offset{margin:-11px -25px -39px;padding:11px 25px 39px}.uk-slider-items{will-change:transform;position:relative;touch-action:pan-y}.uk-slider-items:not(.uk-grid){display:flex;margin:0;padding:0;list-style:none;-webkit-touch-callout:none}.uk-slider-items.uk-grid{flex-wrap:nowrap}.uk-slider-items>*{flex:none!important;box-sizing:border-box;max-width:100%;position:relative}.uk-sticky{position:relative;z-index:980;box-sizing:border-box}.uk-sticky-fixed{margin:0!important;-webkit-backface-visibility:hidden;backface-visibility:hidden}.uk-sticky[class*=uk-animation-],.uk-sticky.uk-animation-reverse{animation-duration:.2s}.uk-sticky-placeholder{pointer-events:none}.uk-offcanvas{display:none;position:fixed;top:0;bottom:0;left:0;z-index:1000}.uk-offcanvas-flip .uk-offcanvas{right:0;left:auto}.uk-offcanvas-bar{--uk-inverse:light;position:absolute;top:0;bottom:0;left:-270px;box-sizing:border-box;width:270px;padding:20px;background:#222;overflow-y:auto}@media (min-width:640px){.uk-offcanvas-bar{left:-350px;width:350px;padding:30px}}.uk-offcanvas-flip .uk-offcanvas-bar{left:auto;right:-270px}@media (min-width:640px){.uk-offcanvas-flip .uk-offcanvas-bar{right:-350px}}.uk-open>.uk-offcanvas-bar{left:0}.uk-offcanvas-flip .uk-open>.uk-offcanvas-bar{left:auto;right:0}.uk-offcanvas-bar-animation{transition:left .3s ease-out}.uk-offcanvas-flip .uk-offcanvas-bar-animation{transition-property:right}.uk-offcanvas-reveal{position:absolute;top:0;bottom:0;left:0;width:0;overflow:hidden;transition:width .3s ease-out}.uk-offcanvas-reveal .uk-offcanvas-bar{left:0}.uk-offcanvas-flip .uk-offcanvas-reveal .uk-offcanvas-bar{left:auto;right:0}.uk-open>.uk-offcanvas-reveal{width:270px}@media (min-width:640px){.uk-open>.uk-offcanvas-reveal{width:350px}}.uk-offcanvas-flip .uk-offcanvas-reveal{right:0;left:auto}.uk-offcanvas-close{position:absolute;z-index:1000;top:5px;right:5px;padding:5px}@media (min-width:640px){.uk-offcanvas-close{top:10px;right:10px}}.uk-offcanvas-close:first-child+*{margin-top:0}.uk-offcanvas-overlay{width:100vw;touch-action:none}.uk-offcanvas-overlay:before{content:"";position:absolute;inset:0;background:#0000001a;opacity:0;transition:opacity .15s linear}.uk-offcanvas-overlay.uk-open:before{opacity:1}.uk-offcanvas-container,.uk-offcanvas-page{overflow-x:hidden;overflow-x:clip}.uk-offcanvas-container{position:relative;left:0;transition:left .3s ease-out;box-sizing:border-box;width:100%}:not(.uk-offcanvas-flip).uk-offcanvas-container-animation{left:270px}.uk-offcanvas-flip.uk-offcanvas-container-animation{left:-270px}@media (min-width:640px){:not(.uk-offcanvas-flip).uk-offcanvas-container-animation{left:350px}.uk-offcanvas-flip.uk-offcanvas-container-animation{left:-350px}}.uk-switcher{margin:0;padding:0;list-style:none}.uk-switcher>:not(.uk-active){display:none}.uk-switcher>*>:last-child{margin-bottom:0}.uk-leader{overflow:hidden}.uk-leader-fill:after{display:inline-block;margin-left:15px;width:0;content:attr(data-fill);white-space:nowrap}.uk-leader-fill.uk-leader-hide:after{display:none}:root{--uk-leader-fill-content:.}.uk-notification{position:fixed;top:10px;left:10px;z-index:1040;box-sizing:border-box;width:350px}.uk-notification-bottom-right,.uk-notification-top-right{left:auto;right:10px}.uk-notification-bottom-center,.uk-notification-top-center{left:50%;margin-left:-175px}.uk-notification-bottom-center,.uk-notification-bottom-left,.uk-notification-bottom-right{top:auto;bottom:10px}@media (max-width:639px){.uk-notification{left:10px;right:10px;width:auto;margin:0}}.uk-notification-message{position:relative;padding:15px;background:#f8f8f8;color:#666;font-size:1.25rem;line-height:1.4;cursor:pointer}*+.uk-notification-message{margin-top:10px}.uk-notification-close{display:none;position:absolute;top:20px;right:15px}.uk-notification-message:hover .uk-notification-close{display:block}.uk-notification-message-primary{color:#1e87f0}.uk-notification-message-success{color:#32d296}.uk-notification-message-warning{color:#faa05a}.uk-notification-message-danger{color:#f0506e}.uk-tooltip{display:none;position:absolute;z-index:1030;--uk-position-offset:10px;--uk-position-viewport-offset:10;top:0;box-sizing:border-box;max-width:200px;padding:3px 6px;background:#666;border-radius:2px;color:#fff;font-size:12px}.uk-tooltip.uk-active{display:block}.uk-sortable{position:relative}.uk-sortable>:last-child{margin-bottom:0}.uk-sortable-drag{position:fixed!important;z-index:1050!important;pointer-events:none}.uk-sortable-placeholder{opacity:0;pointer-events:none}.uk-sortable-empty{min-height:50px}.uk-sortable-handle:hover{cursor:move}.uk-countdown-number{font-variant-numeric:tabular-nums;font-size:2rem;line-height:.8}@media (min-width:640px){.uk-countdown-number{font-size:4rem}}@media (min-width:960px){.uk-countdown-number{font-size:6rem}}.uk-countdown-separator{font-size:1rem;line-height:1.6}@media (min-width:640px){.uk-countdown-separator{font-size:2rem}}@media (min-width:960px){.uk-countdown-separator{font-size:3rem}}.uk-thumbnav{display:flex;flex-wrap:wrap;padding:0;list-style:none;margin:0 0 0 -15px}.uk-thumbnav>*{padding-left:15px}.uk-thumbnav>*>*{display:inline-block;position:relative}.uk-thumbnav>*>:after{content:"";position:absolute;inset:0;background-image:linear-gradient(180deg,#fff0,#fff6);transition:opacity .1s ease-in-out}.uk-thumbnav>*>:hover:after{opacity:0}.uk-thumbnav>.uk-active>:after{opacity:0}.uk-thumbnav-vertical{flex-direction:column;margin-left:0;margin-top:-15px}.uk-thumbnav-vertical>*{padding-left:0;padding-top:15px}.uk-iconnav{display:flex;flex-wrap:wrap;padding:0;list-style:none;margin:0 0 0 -10px}.uk-iconnav>*{padding-left:10px}.uk-iconnav>*>a{display:flex;align-items:center;column-gap:.25em;line-height:0;color:#999;text-decoration:none;font-size:.875rem;transition:.1s ease-in-out;transition-property:color,background-color}.uk-iconnav>*>a:hover{color:#666}.uk-iconnav>.uk-active>a{color:#666}.uk-iconnav-vertical{flex-direction:column;margin-left:0;margin-top:-10px}.uk-iconnav-vertical>*{padding-left:0;padding-top:10px}.uk-grid{display:flex;flex-wrap:wrap;margin:0;padding:0;list-style:none}.uk-grid>*{margin:0}.uk-grid>*>:last-child{margin-bottom:0}.uk-grid{margin-left:-30px}.uk-grid>*{padding-left:30px}*+.uk-grid-margin,.uk-grid+.uk-grid,.uk-grid>.uk-grid-margin{margin-top:30px}@media (min-width:1200px){.uk-grid{margin-left:-40px}.uk-grid>*{padding-left:40px}*+.uk-grid-margin,.uk-grid+.uk-grid,.uk-grid>.uk-grid-margin{margin-top:40px}}.uk-grid-column-small,.uk-grid-small{margin-left:-15px}.uk-grid-column-small>*,.uk-grid-small>*{padding-left:15px}*+.uk-grid-margin-small,.uk-grid+.uk-grid-row-small,.uk-grid+.uk-grid-small,.uk-grid-row-small>.uk-grid-margin,.uk-grid-small>.uk-grid-margin{margin-top:15px}.uk-grid-column-medium,.uk-grid-medium{margin-left:-30px}.uk-grid-column-medium>*,.uk-grid-medium>*{padding-left:30px}*+.uk-grid-margin-medium,.uk-grid+.uk-grid-medium,.uk-grid+.uk-grid-row-medium,.uk-grid-medium>.uk-grid-margin,.uk-grid-row-medium>.uk-grid-margin{margin-top:30px}.uk-grid-column-large,.uk-grid-large{margin-left:-40px}.uk-grid-column-large>*,.uk-grid-large>*{padding-left:40px}*+.uk-grid-margin-large,.uk-grid+.uk-grid-large,.uk-grid+.uk-grid-row-large,.uk-grid-large>.uk-grid-margin,.uk-grid-row-large>.uk-grid-margin{margin-top:40px}@media (min-width:1200px){.uk-grid-column-large,.uk-grid-large{margin-left:-70px}.uk-grid-column-large>*,.uk-grid-large>*{padding-left:70px}*+.uk-grid-margin-large,.uk-grid+.uk-grid-large,.uk-grid+.uk-grid-row-large,.uk-grid-large>.uk-grid-margin,.uk-grid-row-large>.uk-grid-margin{margin-top:70px}}.uk-grid-collapse,.uk-grid-column-collapse{margin-left:0}.uk-grid-collapse>*,.uk-grid-column-collapse>*{padding-left:0}.uk-grid+.uk-grid-collapse,.uk-grid+.uk-grid-row-collapse,.uk-grid-collapse>.uk-grid-margin,.uk-grid-row-collapse>.uk-grid-margin{margin-top:0}.uk-grid-divider>*{position:relative}.uk-grid-divider>:not(.uk-first-column):before{content:"";position:absolute;top:0;bottom:0;border-left:1px solid #e5e5e5}.uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{content:"";position:absolute;left:0;right:0;border-top:1px solid #e5e5e5}.uk-grid-divider{margin-left:-60px}.uk-grid-divider>*{padding-left:60px}.uk-grid-divider>:not(.uk-first-column):before{left:30px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin{margin-top:60px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{top:-30px;left:60px}@media (min-width:1200px){.uk-grid-divider{margin-left:-80px}.uk-grid-divider>*{padding-left:80px}.uk-grid-divider>:not(.uk-first-column):before{left:40px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin{margin-top:80px}.uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{top:-40px;left:80px}}.uk-grid-divider.uk-grid-column-small,.uk-grid-divider.uk-grid-small{margin-left:-30px}.uk-grid-divider.uk-grid-column-small>*,.uk-grid-divider.uk-grid-small>*{padding-left:30px}.uk-grid-divider.uk-grid-column-small>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-small>:not(.uk-first-column):before{left:15px}.uk-grid-divider.uk-grid-row-small.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-small.uk-grid-stack>.uk-grid-margin{margin-top:30px}.uk-grid-divider.uk-grid-small.uk-grid-stack>.uk-grid-margin:before{top:-15px;left:30px}.uk-grid-divider.uk-grid-row-small.uk-grid-stack>.uk-grid-margin:before{top:-15px}.uk-grid-divider.uk-grid-column-small.uk-grid-stack>.uk-grid-margin:before{left:30px}.uk-grid-divider.uk-grid-column-medium,.uk-grid-divider.uk-grid-medium{margin-left:-60px}.uk-grid-divider.uk-grid-column-medium>*,.uk-grid-divider.uk-grid-medium>*{padding-left:60px}.uk-grid-divider.uk-grid-column-medium>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-medium>:not(.uk-first-column):before{left:30px}.uk-grid-divider.uk-grid-medium.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-row-medium.uk-grid-stack>.uk-grid-margin{margin-top:60px}.uk-grid-divider.uk-grid-medium.uk-grid-stack>.uk-grid-margin:before{top:-30px;left:60px}.uk-grid-divider.uk-grid-row-medium.uk-grid-stack>.uk-grid-margin:before{top:-30px}.uk-grid-divider.uk-grid-column-medium.uk-grid-stack>.uk-grid-margin:before{left:60px}.uk-grid-divider.uk-grid-column-large,.uk-grid-divider.uk-grid-large{margin-left:-80px}.uk-grid-divider.uk-grid-column-large>*,.uk-grid-divider.uk-grid-large>*{padding-left:80px}.uk-grid-divider.uk-grid-column-large>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-large>:not(.uk-first-column):before{left:40px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin{margin-top:80px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin:before{top:-40px;left:80px}.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin:before{top:-40px}.uk-grid-divider.uk-grid-column-large.uk-grid-stack>.uk-grid-margin:before{left:80px}@media (min-width:1200px){.uk-grid-divider.uk-grid-column-large,.uk-grid-divider.uk-grid-large{margin-left:-140px}.uk-grid-divider.uk-grid-column-large>*,.uk-grid-divider.uk-grid-large>*{padding-left:140px}.uk-grid-divider.uk-grid-column-large>:not(.uk-first-column):before,.uk-grid-divider.uk-grid-large>:not(.uk-first-column):before{left:70px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin,.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin{margin-top:140px}.uk-grid-divider.uk-grid-large.uk-grid-stack>.uk-grid-margin:before{top:-70px;left:140px}.uk-grid-divider.uk-grid-row-large.uk-grid-stack>.uk-grid-margin:before{top:-70px}.uk-grid-divider.uk-grid-column-large.uk-grid-stack>.uk-grid-margin:before{left:140px}}.uk-grid-item-match,.uk-grid-match>*{display:flex;flex-wrap:wrap}.uk-grid-item-match>:not([class*=uk-width]),.uk-grid-match>*>:not([class*=uk-width]){box-sizing:border-box;width:100%;flex:auto}.uk-nav,.uk-nav ul{margin:0;padding:0;list-style:none}.uk-nav li>a{display:flex;align-items:center;column-gap:.25em;text-decoration:none}.uk-nav>li>a{padding:5px 0}ul.uk-nav-sub{padding:5px 0 5px 15px}.uk-nav-sub ul{padding-left:15px}.uk-nav-sub a{padding:2px 0}.uk-nav-parent-icon{margin-left:auto;transition:transform .3s ease-out}.uk-nav>li.uk-open>a .uk-nav-parent-icon{transform:rotateX(180deg)}.uk-nav-header{padding:5px 0;text-transform:uppercase;font-size:.875rem}.uk-nav-header:not(:first-child){margin-top:20px}.uk-nav .uk-nav-divider{margin:5px 0}.uk-nav-default{font-size:.875rem;line-height:1.5}.uk-nav-default>li>a{color:#999}.uk-nav-default>li>a:hover{color:#666}.uk-nav-default>li.uk-active>a{color:#333}.uk-nav-default .uk-nav-subtitle{font-size:12px}.uk-nav-default .uk-nav-header{color:#333}.uk-nav-default .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-nav-default .uk-nav-sub{font-size:.875rem;line-height:1.5}.uk-nav-default .uk-nav-sub a{color:#999}.uk-nav-default .uk-nav-sub a:hover{color:#666}.uk-nav-default .uk-nav-sub li.uk-active>a{color:#333}.uk-nav-primary{font-size:1.5rem;line-height:1.5}.uk-nav-primary>li>a{color:#999}.uk-nav-primary>li>a:hover{color:#666}.uk-nav-primary>li.uk-active>a{color:#333}.uk-nav-primary .uk-nav-subtitle{font-size:1.25rem}.uk-nav-primary .uk-nav-header{color:#333}.uk-nav-primary .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-nav-primary .uk-nav-sub{font-size:1.25rem;line-height:1.5}.uk-nav-primary .uk-nav-sub a{color:#999}.uk-nav-primary .uk-nav-sub a:hover{color:#666}.uk-nav-primary .uk-nav-sub li.uk-active>a{color:#333}.uk-nav-secondary{font-size:16px;line-height:1.5}.uk-nav-secondary>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider){margin-top:0}.uk-nav-secondary>li>a{color:#333;padding:10px}.uk-nav-secondary>li>a:hover{color:#333;background-color:#f8f8f8}.uk-nav-secondary>li.uk-active>a{color:#333;background-color:#f8f8f8}.uk-nav-secondary .uk-nav-subtitle{font-size:.875rem;color:#999}.uk-nav-secondary>li>a:hover .uk-nav-subtitle{color:#666}.uk-nav-secondary>li.uk-active>a .uk-nav-subtitle{color:#333}.uk-nav-secondary .uk-nav-header{color:#333}.uk-nav-secondary .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-nav-secondary .uk-nav-sub{font-size:.875rem;line-height:1.5}.uk-nav-secondary .uk-nav-sub a{color:#999}.uk-nav-secondary .uk-nav-sub a:hover{color:#666}.uk-nav-secondary .uk-nav-sub li.uk-active>a{color:#333}.uk-nav-medium{font-size:2.8875rem;line-height:1}.uk-nav-large{font-size:3.4rem;line-height:1}.uk-nav-xlarge{font-size:4rem;line-height:1}@media (min-width:960px){.uk-nav-medium{font-size:3.5rem}.uk-nav-large{font-size:4rem}.uk-nav-xlarge{font-size:6rem}}@media (min-width:1200px){.uk-nav-medium{font-size:4rem}.uk-nav-large{font-size:6rem}.uk-nav-xlarge{font-size:8rem}}.uk-nav-center{text-align:center}.uk-nav-center li>a{justify-content:center}.uk-nav-center .uk-nav-sub,.uk-nav-center .uk-nav-sub ul{padding-left:0}.uk-nav-center .uk-nav-parent-icon{margin-left:.25em}.uk-nav.uk-nav-divider>:not(.uk-nav-header,.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider){margin-top:5px;padding-top:5px;border-top:1px solid #e5e5e5}.uk-navbar{display:flex;position:relative}.uk-navbar-container:not(.uk-navbar-transparent){background:#f8f8f8}.uk-navbar-left,.uk-navbar-right,[class*=uk-navbar-center]{display:flex;gap:15px;align-items:center}.uk-navbar-right{margin-left:auto}.uk-navbar-center:only-child{margin-left:auto;margin-right:auto;position:relative}.uk-navbar-center:not(:only-child){position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:max-content;box-sizing:border-box;z-index:990}.uk-navbar-center-left,.uk-navbar-center-right{position:absolute;top:0}.uk-navbar-center-left{right:calc(100% + 15px)}.uk-navbar-center-right{left:calc(100% + 15px)}[class*=uk-navbar-center-]{width:max-content;box-sizing:border-box}.uk-navbar-nav{display:flex;gap:15px;margin:0;padding:0;list-style:none}.uk-navbar-center:only-child,.uk-navbar-left,.uk-navbar-right{flex-wrap:wrap}.uk-navbar-item,.uk-navbar-nav>li>a,.uk-navbar-toggle{display:flex;justify-content:center;align-items:center;column-gap:.25em;box-sizing:border-box;min-height:80px;font-size:.875rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";text-decoration:none}.uk-navbar-nav>li>a{padding:0;color:#999;text-transform:uppercase;transition:.1s ease-in-out;transition-property:color,background-color}.uk-navbar-nav>li:hover>a,.uk-navbar-nav>li>a[aria-expanded=true]{color:#666}.uk-navbar-nav>li>a:active{color:#333}.uk-navbar-nav>li.uk-active>a{color:#333}.uk-navbar-parent-icon{margin-left:4px;transition:transform .3s ease-out}.uk-navbar-nav>li>a[aria-expanded=true] .uk-navbar-parent-icon{transform:rotateX(180deg)}.uk-navbar-item{padding:0;color:#666}.uk-navbar-item>:last-child{margin-bottom:0}.uk-navbar-toggle{padding:0;color:#999}.uk-navbar-toggle:hover,.uk-navbar-toggle[aria-expanded=true]{color:#666;text-decoration:none}.uk-navbar-subtitle{font-size:.875rem}.uk-navbar-justify .uk-navbar-item,.uk-navbar-justify .uk-navbar-left,.uk-navbar-justify .uk-navbar-nav,.uk-navbar-justify .uk-navbar-nav>li,.uk-navbar-justify .uk-navbar-right,.uk-navbar-justify .uk-navbar-toggle{flex-grow:1}.uk-navbar-dropdown{--uk-position-offset:15px;--uk-position-shift-offset:0;--uk-position-viewport-offset:15px;--uk-inverse:dark;width:200px;padding:25px;background:#fff;color:#666;box-shadow:0 5px 12px #00000026}.uk-navbar-dropdown>:last-child{margin-bottom:0}.uk-navbar-dropdown :focus-visible{outline-color:#333!important}.uk-navbar-dropdown .uk-drop-grid{margin-left:-30px}.uk-navbar-dropdown .uk-drop-grid>*{padding-left:30px}.uk-navbar-dropdown .uk-drop-grid>.uk-grid-margin{margin-top:30px}.uk-navbar-dropdown-width-2:not(.uk-drop-stack){width:400px}.uk-navbar-dropdown-width-3:not(.uk-drop-stack){width:600px}.uk-navbar-dropdown-width-4:not(.uk-drop-stack){width:800px}.uk-navbar-dropdown-width-5:not(.uk-drop-stack){width:1000px}.uk-navbar-dropdown-large{--uk-position-shift-offset:0;padding:40px}.uk-navbar-dropdown-dropbar{width:auto;background:0 0;padding:25px 0;--uk-position-offset:0;--uk-position-shift-offset:0;--uk-position-viewport-offset:15px;box-shadow:none}@media (min-width:640px){.uk-navbar-dropdown-dropbar{--uk-position-viewport-offset:30px}}@media (min-width:960px){.uk-navbar-dropdown-dropbar{--uk-position-viewport-offset:40px}}.uk-navbar-dropdown-dropbar-large{--uk-position-shift-offset:0;padding-top:40px;padding-bottom:40px}.uk-navbar-dropdown-nav{font-size:.875rem}.uk-navbar-dropdown-nav>li>a{color:#999}.uk-navbar-dropdown-nav>li>a:hover{color:#666}.uk-navbar-dropdown-nav>li.uk-active>a{color:#333}.uk-navbar-dropdown-nav .uk-nav-subtitle{font-size:12px}.uk-navbar-dropdown-nav .uk-nav-header{color:#333}.uk-navbar-dropdown-nav .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-navbar-dropdown-nav .uk-nav-sub a{color:#999}.uk-navbar-dropdown-nav .uk-nav-sub a:hover{color:#666}.uk-navbar-dropdown-nav .uk-nav-sub li.uk-active>a{color:#333}.uk-navbar-container{transition:.1s ease-in-out;transition-property:background-color}@media (min-width:960px){.uk-navbar-left,.uk-navbar-right,[class*=uk-navbar-center]{gap:30px}.uk-navbar-center-left{right:calc(100% + 30px)}.uk-navbar-center-right{left:calc(100% + 30px)}}@media (min-width:960px){.uk-navbar-nav{gap:30px}}.uk-subnav{display:flex;flex-wrap:wrap;align-items:center;margin-left:-20px;padding:0;list-style:none}.uk-subnav>*{flex:none;padding-left:20px;position:relative}.uk-subnav>*>:first-child{display:flex;align-items:center;column-gap:.25em;color:#999;font-size:.875rem;text-transform:uppercase;transition:.1s ease-in-out;transition-property:color,background-color}.uk-subnav>*>a:hover{color:#666;text-decoration:none}.uk-subnav>.uk-active>a{color:#333}.uk-subnav-divider{margin-left:-41px}.uk-subnav-divider>*{display:flex;align-items:center}.uk-subnav-divider>:before{content:"";height:1.5em;margin-left:0;margin-right:20px;border-left:1px solid transparent}.uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before{border-left-color:#e5e5e5}.uk-subnav-pill>*>:first-child{padding:5px 10px;background:0 0;color:#999}.uk-subnav-pill>*>a:hover{background-color:#f8f8f8;color:#666}.uk-subnav-pill>*>a:active{background-color:#f8f8f8;color:#666}.uk-subnav-pill>.uk-active>a{background-color:#1e87f0;color:#fff}.uk-subnav>.uk-disabled>a{color:#999}.uk-breadcrumb{padding:0;list-style:none}.uk-breadcrumb>*{display:contents}.uk-breadcrumb>*>*{font-size:.875rem;color:#999}.uk-breadcrumb>*>:hover{color:#666;text-decoration:none}.uk-breadcrumb>:last-child>a:not([href]),.uk-breadcrumb>:last-child>span{color:#666}.uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before{content:"/";display:inline-block;margin:0 20px 0 16px;font-size:.875rem;color:#999}.uk-pagination{display:flex;flex-wrap:wrap;align-items:center;margin-left:0;padding:0;list-style:none}.uk-pagination>*{flex:none;padding-left:0;position:relative}.uk-pagination>*>*{display:flex;align-items:center;column-gap:.25em;padding:5px 10px;color:#999;transition:color .1s ease-in-out}.uk-pagination>*>:hover{color:#666;text-decoration:none}.uk-pagination>.uk-active>*{color:#666}.uk-pagination>.uk-disabled>*{color:#999}.uk-tab{display:flex;flex-wrap:wrap;margin-left:-20px;padding:0;list-style:none;position:relative}.uk-tab:before{content:"";position:absolute;bottom:0;left:20px;right:0;border-bottom:1px solid #e5e5e5}.uk-tab>*{flex:none;padding-left:20px;position:relative}.uk-tab>*>a{display:flex;align-items:center;column-gap:.25em;justify-content:center;padding:5px 10px;color:#999;border-bottom:1px solid transparent;font-size:.875rem;text-transform:uppercase;transition:color .1s ease-in-out}.uk-tab>*>a:hover{color:#666;text-decoration:none}.uk-tab>.uk-active>a{color:#333;border-color:#1e87f0}.uk-tab>.uk-disabled>a{color:#999}.uk-tab-bottom:before{top:0;bottom:auto}.uk-tab-bottom>*>a{border-top:1px solid transparent;border-bottom:none}.uk-tab-left,.uk-tab-right{flex-direction:column;margin-left:0}.uk-tab-left>*,.uk-tab-right>*{padding-left:0}.uk-tab-left:before{inset:0 0 0 auto;border-left:1px solid #e5e5e5;border-bottom:none}.uk-tab-right:before{inset:0 auto 0 0;border-left:1px solid #e5e5e5;border-bottom:none}.uk-tab-left>*>a{justify-content:left;border-right:1px solid transparent;border-bottom:none}.uk-tab-right>*>a{justify-content:left;border-left:1px solid transparent;border-bottom:none}.uk-tab .uk-dropdown{margin-left:30px}.uk-slidenav{padding:5px 10px;color:#66666680;transition:color .1s ease-in-out}.uk-slidenav:hover{color:#666666e6}.uk-slidenav:active{color:#66666680}.uk-slidenav-large{padding:10px}.uk-slidenav-container{display:flex}.uk-dotnav{display:flex;flex-wrap:wrap;padding:0;list-style:none;margin:0 0 0 -12px}.uk-dotnav>*{flex:none;padding-left:12px}.uk-dotnav>*>*{display:block;box-sizing:border-box;width:10px;height:10px;border-radius:50%;background:0 0;text-indent:100%;overflow:hidden;white-space:nowrap;border:1px solid rgba(102,102,102,.4);transition:.2s ease-in-out;transition-property:background-color,border-color}.uk-dotnav>*>:hover{background-color:#6669;border-color:transparent}.uk-dotnav>*>:active{background-color:#6663;border-color:transparent}.uk-dotnav>.uk-active>*{background-color:#6669;border-color:transparent}.uk-dotnav-vertical{flex-direction:column;margin-left:0;margin-top:-12px}.uk-dotnav-vertical>*{padding-left:0;padding-top:12px}.uk-dropdown{--uk-position-offset:10px;--uk-position-viewport-offset:15px;--uk-inverse:dark;width:auto;min-width:200px;padding:25px;background:#fff;color:#666;box-shadow:0 5px 12px #00000026}.uk-dropdown>:last-child{margin-bottom:0}.uk-dropdown :focus-visible{outline-color:#333!important}.uk-dropdown-large{padding:40px}.uk-dropdown-dropbar{width:auto;background:0 0;padding:5px 0 25px;--uk-position-viewport-offset:15px;box-shadow:none}@media (min-width:640px){.uk-dropdown-dropbar{--uk-position-viewport-offset:30px}}@media (min-width:960px){.uk-dropdown-dropbar{--uk-position-viewport-offset:40px}}.uk-dropdown-dropbar-large{padding-top:40px;padding-bottom:40px}.uk-dropdown-nav{font-size:.875rem}.uk-dropdown-nav>li>a{color:#999}.uk-dropdown-nav>li.uk-active>a,.uk-dropdown-nav>li>a:hover{color:#666}.uk-dropdown-nav .uk-nav-subtitle{font-size:12px}.uk-dropdown-nav .uk-nav-header{color:#333}.uk-dropdown-nav .uk-nav-divider{border-top:1px solid #e5e5e5}.uk-dropdown-nav .uk-nav-sub a{color:#999}.uk-dropdown-nav .uk-nav-sub a:hover,.uk-dropdown-nav .uk-nav-sub li.uk-active>a{color:#666}.uk-lightbox{display:none;position:fixed;inset:0;z-index:1010;background:#000;opacity:0;transition:opacity .15s linear;touch-action:pinch-zoom}.uk-lightbox.uk-open{display:block;opacity:1}.uk-lightbox :focus-visible{outline-color:#ffffffb3}.uk-lightbox-page{overflow:hidden}.uk-lightbox-items>*{position:absolute;inset:0;display:none;justify-content:center;align-items:center;color:#ffffffb3;will-change:transform,opacity}.uk-lightbox-items>*>*{max-width:100vw;max-height:100vh}.uk-lightbox-items>*>:not(iframe){width:auto;height:auto}.uk-lightbox-items>.uk-active{display:flex}.uk-lightbox-toolbar{padding:10px;background:#0000004d;color:#ffffffb3}.uk-lightbox-toolbar>*{color:#ffffffb3}.uk-lightbox-toolbar-icon{padding:5px;color:#ffffffb3}.uk-lightbox-toolbar-icon:hover{color:#fff}.uk-lightbox-button{box-sizing:border-box;width:50px;height:50px;background:#0000004d;color:#ffffffb3;display:inline-flex;justify-content:center;align-items:center}.uk-lightbox-button:hover{color:#fff}.uk-lightbox-caption:empty{display:none}.uk-lightbox-iframe{width:80%;height:80%}[class*=uk-animation-]{animation:.5s ease-out both}.uk-animation-fade{animation-name:uk-fade;animation-duration:.8s;animation-timing-function:linear}.uk-animation-scale-up{animation-name:uk-fade,uk-scale-up}.uk-animation-scale-down{animation-name:uk-fade,uk-scale-down}.uk-animation-slide-top{animation-name:uk-fade,uk-slide-top}.uk-animation-slide-bottom{animation-name:uk-fade,uk-slide-bottom}.uk-animation-slide-left{animation-name:uk-fade,uk-slide-left}.uk-animation-slide-right{animation-name:uk-fade,uk-slide-right}.uk-animation-slide-top-small{animation-name:uk-fade,uk-slide-top-small}.uk-animation-slide-bottom-small{animation-name:uk-fade,uk-slide-bottom-small}.uk-animation-slide-left-small{animation-name:uk-fade,uk-slide-left-small}.uk-animation-slide-right-small{animation-name:uk-fade,uk-slide-right-small}.uk-animation-slide-top-medium{animation-name:uk-fade,uk-slide-top-medium}.uk-animation-slide-bottom-medium{animation-name:uk-fade,uk-slide-bottom-medium}.uk-animation-slide-left-medium{animation-name:uk-fade,uk-slide-left-medium}.uk-animation-slide-right-medium{animation-name:uk-fade,uk-slide-right-medium}.uk-animation-kenburns{animation-name:uk-kenburns;animation-duration:15s}.uk-animation-shake{animation-name:uk-shake}.uk-animation-stroke{animation-name:uk-stroke;animation-duration:2s;stroke-dasharray:var(--uk-animation-stroke)}.uk-animation-reverse{animation-direction:reverse;animation-timing-function:ease-in}.uk-animation-fast{animation-duration:.1s}.uk-animation-toggle:not(:hover):not(:focus) [class*=uk-animation-]{animation-name:none}@keyframes uk-fade{0%{opacity:0}to{opacity:1}}@keyframes uk-scale-up{0%{transform:scale(.9)}to{transform:scale(1)}}@keyframes uk-scale-down{0%{transform:scale(1.1)}to{transform:scale(1)}}@keyframes uk-slide-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes uk-slide-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes uk-slide-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes uk-slide-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes uk-slide-top-small{0%{transform:translateY(-10px)}to{transform:translateY(0)}}@keyframes uk-slide-bottom-small{0%{transform:translateY(10px)}to{transform:translateY(0)}}@keyframes uk-slide-left-small{0%{transform:translate(-10px)}to{transform:translate(0)}}@keyframes uk-slide-right-small{0%{transform:translate(10px)}to{transform:translate(0)}}@keyframes uk-slide-top-medium{0%{transform:translateY(-50px)}to{transform:translateY(0)}}@keyframes uk-slide-bottom-medium{0%{transform:translateY(50px)}to{transform:translateY(0)}}@keyframes uk-slide-left-medium{0%{transform:translate(-50px)}to{transform:translate(0)}}@keyframes uk-slide-right-medium{0%{transform:translate(50px)}to{transform:translate(0)}}@keyframes uk-kenburns{0%{transform:scale(1)}to{transform:scale(1.2)}}@keyframes uk-shake{0%,to{transform:translate(0)}10%{transform:translate(-9px)}20%{transform:translate(8px)}30%{transform:translate(-7px)}40%{transform:translate(6px)}50%{transform:translate(-5px)}60%{transform:translate(4px)}70%{transform:translate(-3px)}80%{transform:translate(2px)}90%{transform:translate(-1px)}}@keyframes uk-stroke{0%{stroke-dashoffset:var(--uk-animation-stroke)}to{stroke-dashoffset:0}}[class*=uk-child-width]>*{box-sizing:border-box;width:100%}.uk-child-width-1-2>*{width:50%}.uk-child-width-1-3>*{width:calc(100% / 3)}.uk-child-width-1-4>*{width:25%}.uk-child-width-1-5>*{width:20%}.uk-child-width-1-6>*{width:calc(100% / 6)}.uk-child-width-auto>*{width:auto}.uk-child-width-expand>:not([class*=uk-width]){flex:1;min-width:1px}@media (min-width:640px){.uk-child-width-1-1\@s>*{width:100%}.uk-child-width-1-2\@s>*{width:50%}.uk-child-width-1-3\@s>*{width:calc(100% / 3)}.uk-child-width-1-4\@s>*{width:25%}.uk-child-width-1-5\@s>*{width:20%}.uk-child-width-1-6\@s>*{width:calc(100% / 6)}.uk-child-width-auto\@s>*{width:auto}.uk-child-width-expand\@s>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@s>:not([class*=uk-width]),.uk-child-width-1-2\@s>:not([class*=uk-width]),.uk-child-width-1-3\@s>:not([class*=uk-width]),.uk-child-width-1-4\@s>:not([class*=uk-width]),.uk-child-width-1-5\@s>:not([class*=uk-width]),.uk-child-width-1-6\@s>:not([class*=uk-width]),.uk-child-width-auto\@s>:not([class*=uk-width]){flex:initial}}@media (min-width:960px){.uk-child-width-1-1\@m>*{width:100%}.uk-child-width-1-2\@m>*{width:50%}.uk-child-width-1-3\@m>*{width:calc(100% / 3)}.uk-child-width-1-4\@m>*{width:25%}.uk-child-width-1-5\@m>*{width:20%}.uk-child-width-1-6\@m>*{width:calc(100% / 6)}.uk-child-width-auto\@m>*{width:auto}.uk-child-width-expand\@m>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@m>:not([class*=uk-width]),.uk-child-width-1-2\@m>:not([class*=uk-width]),.uk-child-width-1-3\@m>:not([class*=uk-width]),.uk-child-width-1-4\@m>:not([class*=uk-width]),.uk-child-width-1-5\@m>:not([class*=uk-width]),.uk-child-width-1-6\@m>:not([class*=uk-width]),.uk-child-width-auto\@m>:not([class*=uk-width]){flex:initial}}@media (min-width:1200px){.uk-child-width-1-1\@l>*{width:100%}.uk-child-width-1-2\@l>*{width:50%}.uk-child-width-1-3\@l>*{width:calc(100% / 3)}.uk-child-width-1-4\@l>*{width:25%}.uk-child-width-1-5\@l>*{width:20%}.uk-child-width-1-6\@l>*{width:calc(100% / 6)}.uk-child-width-auto\@l>*{width:auto}.uk-child-width-expand\@l>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@l>:not([class*=uk-width]),.uk-child-width-1-2\@l>:not([class*=uk-width]),.uk-child-width-1-3\@l>:not([class*=uk-width]),.uk-child-width-1-4\@l>:not([class*=uk-width]),.uk-child-width-1-5\@l>:not([class*=uk-width]),.uk-child-width-1-6\@l>:not([class*=uk-width]),.uk-child-width-auto\@l>:not([class*=uk-width]){flex:initial}}@media (min-width:1600px){.uk-child-width-1-1\@xl>*{width:100%}.uk-child-width-1-2\@xl>*{width:50%}.uk-child-width-1-3\@xl>*{width:calc(100% / 3)}.uk-child-width-1-4\@xl>*{width:25%}.uk-child-width-1-5\@xl>*{width:20%}.uk-child-width-1-6\@xl>*{width:calc(100% / 6)}.uk-child-width-auto\@xl>*{width:auto}.uk-child-width-expand\@xl>:not([class*=uk-width]){flex:1;min-width:1px}.uk-child-width-1-1\@xl>:not([class*=uk-width]),.uk-child-width-1-2\@xl>:not([class*=uk-width]),.uk-child-width-1-3\@xl>:not([class*=uk-width]),.uk-child-width-1-4\@xl>:not([class*=uk-width]),.uk-child-width-1-5\@xl>:not([class*=uk-width]),.uk-child-width-1-6\@xl>:not([class*=uk-width]),.uk-child-width-auto\@xl>:not([class*=uk-width]){flex:initial}}[class*=uk-width]{box-sizing:border-box;width:100%;max-width:100%}.uk-width-1-2{width:50%}.uk-width-1-3{width:calc(100% / 3)}.uk-width-2-3{width:calc(200% / 3)}.uk-width-1-4{width:25%}.uk-width-3-4{width:75%}.uk-width-1-5{width:20%}.uk-width-2-5{width:40%}.uk-width-3-5{width:60%}.uk-width-4-5{width:80%}.uk-width-1-6{width:calc(100% / 6)}.uk-width-5-6{width:calc(500% / 6)}.uk-width-small{width:150px}.uk-width-medium{width:300px}.uk-width-large{width:450px}.uk-width-xlarge{width:600px}.uk-width-2xlarge{width:750px}.uk-width-auto{width:auto}.uk-width-expand{flex:1;min-width:1px}@media (min-width:640px){.uk-width-1-1\@s{width:100%}.uk-width-1-2\@s{width:50%}.uk-width-1-3\@s{width:calc(100% / 3)}.uk-width-2-3\@s{width:calc(200% / 3)}.uk-width-1-4\@s{width:25%}.uk-width-3-4\@s{width:75%}.uk-width-1-5\@s{width:20%}.uk-width-2-5\@s{width:40%}.uk-width-3-5\@s{width:60%}.uk-width-4-5\@s{width:80%}.uk-width-1-6\@s{width:calc(100% / 6)}.uk-width-5-6\@s{width:calc(500% / 6)}.uk-width-small\@s{width:150px}.uk-width-medium\@s{width:300px}.uk-width-large\@s{width:450px}.uk-width-xlarge\@s{width:600px}.uk-width-2xlarge\@s{width:750px}.uk-width-auto\@s{width:auto}.uk-width-expand\@s{flex:1;min-width:1px}.uk-width-1-1\@s,.uk-width-1-2\@s,.uk-width-1-3\@s,.uk-width-1-4\@s,.uk-width-1-5\@s,.uk-width-1-6\@s,.uk-width-2-3\@s,.uk-width-2-5\@s,.uk-width-2xlarge\@s,.uk-width-3-4\@s,.uk-width-3-5\@s,.uk-width-4-5\@s,.uk-width-5-6\@s,.uk-width-auto\@s,.uk-width-large\@s,.uk-width-medium\@s,.uk-width-small\@s,.uk-width-xlarge\@s{flex:initial}}@media (min-width:960px){.uk-width-1-1\@m{width:100%}.uk-width-1-2\@m{width:50%}.uk-width-1-3\@m{width:calc(100% / 3)}.uk-width-2-3\@m{width:calc(200% / 3)}.uk-width-1-4\@m{width:25%}.uk-width-3-4\@m{width:75%}.uk-width-1-5\@m{width:20%}.uk-width-2-5\@m{width:40%}.uk-width-3-5\@m{width:60%}.uk-width-4-5\@m{width:80%}.uk-width-1-6\@m{width:calc(100% / 6)}.uk-width-5-6\@m{width:calc(500% / 6)}.uk-width-small\@m{width:150px}.uk-width-medium\@m{width:300px}.uk-width-large\@m{width:450px}.uk-width-xlarge\@m{width:600px}.uk-width-2xlarge\@m{width:750px}.uk-width-auto\@m{width:auto}.uk-width-expand\@m{flex:1;min-width:1px}.uk-width-1-1\@m,.uk-width-1-2\@m,.uk-width-1-3\@m,.uk-width-1-4\@m,.uk-width-1-5\@m,.uk-width-1-6\@m,.uk-width-2-3\@m,.uk-width-2-5\@m,.uk-width-2xlarge\@m,.uk-width-3-4\@m,.uk-width-3-5\@m,.uk-width-4-5\@m,.uk-width-5-6\@m,.uk-width-auto\@m,.uk-width-large\@m,.uk-width-medium\@m,.uk-width-small\@m,.uk-width-xlarge\@m{flex:initial}}@media (min-width:1200px){.uk-width-1-1\@l{width:100%}.uk-width-1-2\@l{width:50%}.uk-width-1-3\@l{width:calc(100% / 3)}.uk-width-2-3\@l{width:calc(200% / 3)}.uk-width-1-4\@l{width:25%}.uk-width-3-4\@l{width:75%}.uk-width-1-5\@l{width:20%}.uk-width-2-5\@l{width:40%}.uk-width-3-5\@l{width:60%}.uk-width-4-5\@l{width:80%}.uk-width-1-6\@l{width:calc(100% / 6)}.uk-width-5-6\@l{width:calc(500% / 6)}.uk-width-small\@l{width:150px}.uk-width-medium\@l{width:300px}.uk-width-large\@l{width:450px}.uk-width-xlarge\@l{width:600px}.uk-width-2xlarge\@l{width:750px}.uk-width-auto\@l{width:auto}.uk-width-expand\@l{flex:1;min-width:1px}.uk-width-1-1\@l,.uk-width-1-2\@l,.uk-width-1-3\@l,.uk-width-1-4\@l,.uk-width-1-5\@l,.uk-width-1-6\@l,.uk-width-2-3\@l,.uk-width-2-5\@l,.uk-width-2xlarge\@l,.uk-width-3-4\@l,.uk-width-3-5\@l,.uk-width-4-5\@l,.uk-width-5-6\@l,.uk-width-auto\@l,.uk-width-large\@l,.uk-width-medium\@l,.uk-width-small\@l,.uk-width-xlarge\@l{flex:initial}}@media (min-width:1600px){.uk-width-1-1\@xl{width:100%}.uk-width-1-2\@xl{width:50%}.uk-width-1-3\@xl{width:calc(100% / 3)}.uk-width-2-3\@xl{width:calc(200% / 3)}.uk-width-1-4\@xl{width:25%}.uk-width-3-4\@xl{width:75%}.uk-width-1-5\@xl{width:20%}.uk-width-2-5\@xl{width:40%}.uk-width-3-5\@xl{width:60%}.uk-width-4-5\@xl{width:80%}.uk-width-1-6\@xl{width:calc(100% / 6)}.uk-width-5-6\@xl{width:calc(500% / 6)}.uk-width-small\@xl{width:150px}.uk-width-medium\@xl{width:300px}.uk-width-large\@xl{width:450px}.uk-width-xlarge\@xl{width:600px}.uk-width-2xlarge\@xl{width:750px}.uk-width-auto\@xl{width:auto}.uk-width-expand\@xl{flex:1;min-width:1px}.uk-width-1-1\@xl,.uk-width-1-2\@xl,.uk-width-1-3\@xl,.uk-width-1-4\@xl,.uk-width-1-5\@xl,.uk-width-1-6\@xl,.uk-width-2-3\@xl,.uk-width-2-5\@xl,.uk-width-2xlarge\@xl,.uk-width-3-4\@xl,.uk-width-3-5\@xl,.uk-width-4-5\@xl,.uk-width-5-6\@xl,.uk-width-auto\@xl,.uk-width-large\@xl,.uk-width-medium\@xl,.uk-width-small\@xl,.uk-width-xlarge\@xl{flex:initial}}.uk-width-max-content{width:max-content}.uk-width-min-content{width:min-content}[class*=uk-height]{box-sizing:border-box}.uk-height-1-1{height:100%}.uk-height-viewport{min-height:100vh}.uk-height-viewport-2{min-height:200vh}.uk-height-viewport-3{min-height:300vh}.uk-height-viewport-4{min-height:400vh}.uk-height-small{height:150px}.uk-height-medium{height:300px}.uk-height-large{height:450px}.uk-height-max-small{max-height:150px}.uk-height-max-medium{max-height:300px}.uk-height-max-large{max-height:450px}.uk-text-lead{font-size:1.5rem;line-height:1.5;color:#333}.uk-text-meta{font-size:.875rem;line-height:1.4;color:#999}.uk-text-meta>a{color:#999}.uk-text-meta>a:hover{color:#666;text-decoration:none}.uk-text-small{font-size:.875rem;line-height:1.5}.uk-text-large{font-size:1.5rem;line-height:1.5}.uk-text-default{font-size:16px;line-height:1.5}.uk-text-light{font-weight:300}.uk-text-normal{font-weight:400}.uk-text-bold{font-weight:700}.uk-text-lighter{font-weight:lighter}.uk-text-bolder{font-weight:bolder}.uk-text-italic{font-style:italic}.uk-text-capitalize{text-transform:capitalize!important}.uk-text-uppercase{text-transform:uppercase!important}.uk-text-lowercase{text-transform:lowercase!important}.uk-text-decoration-none{text-decoration:none!important}.uk-text-muted{color:#999!important}.uk-text-emphasis{color:#333!important}.uk-text-primary{color:#1e87f0!important}.uk-text-secondary{color:#222!important}.uk-text-success{color:#32d296!important}.uk-text-warning{color:#faa05a!important}.uk-text-danger{color:#f0506e!important}.uk-text-background{-webkit-background-clip:text;color:transparent!important;display:inline-block;background-color:#1e87f0;background-image:linear-gradient(90deg,#1e87f0 0,#411ef0)}.uk-text-left{text-align:left!important}.uk-text-right{text-align:right!important}.uk-text-center{text-align:center!important}.uk-text-justify{text-align:justify!important}@media (min-width:640px){.uk-text-left\@s{text-align:left!important}.uk-text-right\@s{text-align:right!important}.uk-text-center\@s{text-align:center!important}}@media (min-width:960px){.uk-text-left\@m{text-align:left!important}.uk-text-right\@m{text-align:right!important}.uk-text-center\@m{text-align:center!important}}@media (min-width:1200px){.uk-text-left\@l{text-align:left!important}.uk-text-right\@l{text-align:right!important}.uk-text-center\@l{text-align:center!important}}@media (min-width:1600px){.uk-text-left\@xl{text-align:left!important}.uk-text-right\@xl{text-align:right!important}.uk-text-center\@xl{text-align:center!important}}.uk-text-top{vertical-align:top!important}.uk-text-middle{vertical-align:middle!important}.uk-text-bottom{vertical-align:bottom!important}.uk-text-baseline{vertical-align:baseline!important}.uk-text-nowrap{white-space:nowrap}.uk-text-truncate{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}td.uk-text-truncate,th.uk-text-truncate{max-width:0}.uk-text-break{overflow-wrap:break-word}td.uk-text-break,th.uk-text-break{word-break:break-word}[class*=uk-column-]{column-gap:30px}@media (min-width:1200px){[class*=uk-column-]{column-gap:40px}}[class*=uk-column-] img{transform:translateZ(0)}.uk-column-divider{column-rule:1px solid #e5e5e5;column-gap:60px}@media (min-width:1200px){.uk-column-divider{column-gap:80px}}.uk-column-1-2{column-count:2}.uk-column-1-3{column-count:3}.uk-column-1-4{column-count:4}.uk-column-1-5{column-count:5}.uk-column-1-6{column-count:6}@media (min-width:640px){.uk-column-1-2\@s{column-count:2}.uk-column-1-3\@s{column-count:3}.uk-column-1-4\@s{column-count:4}.uk-column-1-5\@s{column-count:5}.uk-column-1-6\@s{column-count:6}}@media (min-width:960px){.uk-column-1-2\@m{column-count:2}.uk-column-1-3\@m{column-count:3}.uk-column-1-4\@m{column-count:4}.uk-column-1-5\@m{column-count:5}.uk-column-1-6\@m{column-count:6}}@media (min-width:1200px){.uk-column-1-2\@l{column-count:2}.uk-column-1-3\@l{column-count:3}.uk-column-1-4\@l{column-count:4}.uk-column-1-5\@l{column-count:5}.uk-column-1-6\@l{column-count:6}}@media (min-width:1600px){.uk-column-1-2\@xl{column-count:2}.uk-column-1-3\@xl{column-count:3}.uk-column-1-4\@xl{column-count:4}.uk-column-1-5\@xl{column-count:5}.uk-column-1-6\@xl{column-count:6}}.uk-column-span{column-span:all}[data-uk-cover]:where(canvas,iframe,svg),[uk-cover]:where(canvas,iframe,svg){max-width:none;position:absolute;left:50%;top:50%;--uk-position-translate-x:-50%;--uk-position-translate-y:-50%;transform:translate(var(--uk-position-translate-x),var(--uk-position-translate-y))}iframe[data-uk-cover],iframe[uk-cover]{pointer-events:none}[data-uk-cover]:where(img,video),[uk-cover]:where(img,video){position:absolute;top:0;left:0;width:100%;height:100%;box-sizing:border-box;object-fit:cover;object-position:center}.uk-cover-container{overflow:hidden;position:relative}.uk-background-default{background-color:#fff}.uk-background-muted{background-color:#f8f8f8}.uk-background-primary{background-color:#1e87f0}.uk-background-secondary{background-color:#222}.uk-background-contain,.uk-background-cover,.uk-background-height-1-1,.uk-background-width-1-1{background-position:50% 50%;background-repeat:no-repeat}.uk-background-cover{background-size:cover}.uk-background-contain{background-size:contain}.uk-background-width-1-1{background-size:100%}.uk-background-height-1-1{background-size:auto 100%}.uk-background-top-left{background-position:0 0}.uk-background-top-center{background-position:50% 0}.uk-background-top-right{background-position:100% 0}.uk-background-center-left{background-position:0 50%}.uk-background-center-center{background-position:50% 50%}.uk-background-center-right{background-position:100% 50%}.uk-background-bottom-left{background-position:0 100%}.uk-background-bottom-center{background-position:50% 100%}.uk-background-bottom-right{background-position:100% 100%}.uk-background-norepeat{background-repeat:no-repeat}.uk-background-fixed{background-attachment:fixed;backface-visibility:hidden}@media (pointer:coarse){.uk-background-fixed{background-attachment:scroll}}@media (max-width:639px){.uk-background-image\@s{background-image:none!important}}@media (max-width:959px){.uk-background-image\@m{background-image:none!important}}@media (max-width:1199px){.uk-background-image\@l{background-image:none!important}}@media (max-width:1599px){.uk-background-image\@xl{background-image:none!important}}.uk-background-blend-multiply{background-blend-mode:multiply}.uk-background-blend-screen{background-blend-mode:screen}.uk-background-blend-overlay{background-blend-mode:overlay}.uk-background-blend-darken{background-blend-mode:darken}.uk-background-blend-lighten{background-blend-mode:lighten}.uk-background-blend-color-dodge{background-blend-mode:color-dodge}.uk-background-blend-color-burn{background-blend-mode:color-burn}.uk-background-blend-hard-light{background-blend-mode:hard-light}.uk-background-blend-soft-light{background-blend-mode:soft-light}.uk-background-blend-difference{background-blend-mode:difference}.uk-background-blend-exclusion{background-blend-mode:exclusion}.uk-background-blend-hue{background-blend-mode:hue}.uk-background-blend-saturation{background-blend-mode:saturation}.uk-background-blend-color{background-blend-mode:color}.uk-background-blend-luminosity{background-blend-mode:luminosity}[class*=uk-align]{display:block;margin-bottom:30px}*+[class*=uk-align]{margin-top:30px}.uk-align-center{margin-left:auto;margin-right:auto}.uk-align-left{margin-top:0;margin-right:30px;float:left}.uk-align-right{margin-top:0;margin-left:30px;float:right}@media (min-width:640px){.uk-align-left\@s{margin-top:0;margin-right:30px;float:left}.uk-align-right\@s{margin-top:0;margin-left:30px;float:right}}@media (min-width:960px){.uk-align-left\@m{margin-top:0;margin-right:30px;float:left}.uk-align-right\@m{margin-top:0;margin-left:30px;float:right}}@media (min-width:1200px){.uk-align-left\@l{margin-top:0;float:left}.uk-align-right\@l{margin-top:0;float:right}.uk-align-left,.uk-align-left\@l,.uk-align-left\@m,.uk-align-left\@s{margin-right:40px}.uk-align-right,.uk-align-right\@l,.uk-align-right\@m,.uk-align-right\@s{margin-left:40px}}@media (min-width:1600px){.uk-align-left\@xl{margin-top:0;margin-right:40px;float:left}.uk-align-right\@xl{margin-top:0;margin-left:40px;float:right}}.uk-svg,.uk-svg:not(.uk-preserve) [fill*="#"]:not(.uk-preserve){fill:currentcolor}.uk-svg:not(.uk-preserve) [stroke*="#"]:not(.uk-preserve){stroke:currentcolor}.uk-svg{transform:translate(0)}.uk-panel{display:flow-root;position:relative;box-sizing:border-box}.uk-panel>:last-child{margin-bottom:0}.uk-panel-scrollable{height:170px;padding:10px;border:1px solid #e5e5e5;overflow:auto;resize:both}.uk-clearfix:before{content:"";display:table-cell}.uk-clearfix:after{content:"";display:table;clear:both}.uk-float-left{float:left}.uk-float-right{float:right}[class*=uk-float-]{max-width:100%}.uk-overflow-hidden{overflow:hidden}.uk-overflow-auto{overflow:auto}.uk-overflow-auto>:last-child{margin-bottom:0}.uk-box-sizing-content{box-sizing:content-box}.uk-box-sizing-border{box-sizing:border-box}.uk-resize{resize:both}.uk-resize-horizontal{resize:horizontal}.uk-resize-vertical{resize:vertical}.uk-display-block{display:block!important}.uk-display-inline{display:inline!important}.uk-display-inline-block{display:inline-block!important}[class*=uk-inline]{display:inline-block;position:relative;max-width:100%;vertical-align:middle;-webkit-backface-visibility:hidden}.uk-inline-clip{overflow:hidden}.uk-preserve-width,.uk-preserve-width canvas,.uk-preserve-width img,.uk-preserve-width svg,.uk-preserve-width video{max-width:none}.uk-responsive-height,.uk-responsive-width{box-sizing:border-box}.uk-responsive-width{max-width:100%!important;height:auto}.uk-responsive-height{max-height:100%;width:auto;max-width:none}[data-uk-responsive],[uk-responsive]{max-width:100%}.uk-object-cover{object-fit:cover}.uk-object-contain{object-fit:contain}.uk-object-fill{object-fit:fill}.uk-object-none{object-fit:none}.uk-object-scale-down{object-fit:scale-down}.uk-object-top-left{object-position:0 0}.uk-object-top-center{object-position:50% 0}.uk-object-top-right{object-position:100% 0}.uk-object-center-left{object-position:0 50%}.uk-object-center-center{object-position:50% 50%}.uk-object-center-right{object-position:100% 50%}.uk-object-bottom-left{object-position:0 100%}.uk-object-bottom-center{object-position:50% 100%}.uk-object-bottom-right{object-position:100% 100%}.uk-border-circle{border-radius:50%}.uk-border-pill{border-radius:500px}.uk-border-rounded{border-radius:5px}.uk-inline-clip[class*=uk-border-]{-webkit-transform:translateZ(0)}.uk-box-shadow-small{box-shadow:0 2px 8px #00000014}.uk-box-shadow-medium{box-shadow:0 5px 15px #00000014}.uk-box-shadow-large{box-shadow:0 14px 25px #00000029}.uk-box-shadow-xlarge{box-shadow:0 28px 50px #00000029}[class*=uk-box-shadow-hover]{transition:box-shadow .1s ease-in-out}.uk-box-shadow-hover-small:hover{box-shadow:0 2px 8px #00000014}.uk-box-shadow-hover-medium:hover{box-shadow:0 5px 15px #00000014}.uk-box-shadow-hover-large:hover{box-shadow:0 14px 25px #00000029}.uk-box-shadow-hover-xlarge:hover{box-shadow:0 28px 50px #00000029}@supports (filter:blur(0)){.uk-box-shadow-bottom{display:inline-block;position:relative;z-index:0;max-width:100%;vertical-align:middle}.uk-box-shadow-bottom:after{content:"";position:absolute;bottom:-30px;left:0;right:0;z-index:-1;height:30px;border-radius:100%;background:#444;filter:blur(20px);will-change:filter}}.uk-dropcap:first-letter,.uk-dropcap>p:first-of-type:first-letter{display:block;margin-right:10px;float:left;font-size:4.5em;line-height:1;margin-bottom:-2px}@-moz-document url-prefix(){.uk-dropcap:first-letter,.uk-dropcap>p:first-of-type:first-letter{margin-top:1.1%}}.uk-logo{font-size:1.5rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";color:#333;text-decoration:none}:where(.uk-logo){display:inline-block;vertical-align:middle}.uk-logo:hover{color:#333;text-decoration:none}.uk-logo :where(img,svg,video){display:block}.uk-logo-inverse{display:none}.uk-disabled{pointer-events:none}.uk-drag,.uk-drag *{cursor:move}.uk-drag iframe{pointer-events:none}.uk-dragover{box-shadow:0 0 20px #6464644d}.uk-blend-multiply{mix-blend-mode:multiply}.uk-blend-screen{mix-blend-mode:screen}.uk-blend-overlay{mix-blend-mode:overlay}.uk-blend-darken{mix-blend-mode:darken}.uk-blend-lighten{mix-blend-mode:lighten}.uk-blend-color-dodge{mix-blend-mode:color-dodge}.uk-blend-color-burn{mix-blend-mode:color-burn}.uk-blend-hard-light{mix-blend-mode:hard-light}.uk-blend-soft-light{mix-blend-mode:soft-light}.uk-blend-difference{mix-blend-mode:difference}.uk-blend-exclusion{mix-blend-mode:exclusion}.uk-blend-hue{mix-blend-mode:hue}.uk-blend-saturation{mix-blend-mode:saturation}.uk-blend-color{mix-blend-mode:color}.uk-blend-luminosity{mix-blend-mode:luminosity}.uk-transform-center{transform:translate(-50%,-50%)}.uk-transform-origin-top-left{transform-origin:0 0}.uk-transform-origin-top-center{transform-origin:50% 0}.uk-transform-origin-top-right{transform-origin:100% 0}.uk-transform-origin-center-left{transform-origin:0 50%}.uk-transform-origin-center-right{transform-origin:100% 50%}.uk-transform-origin-bottom-left{transform-origin:0 100%}.uk-transform-origin-bottom-center{transform-origin:50% 100%}.uk-transform-origin-bottom-right{transform-origin:100% 100%}.uk-flex{display:flex}.uk-flex-inline{display:inline-flex}.uk-flex-left{justify-content:flex-start}.uk-flex-center{justify-content:center}.uk-flex-right{justify-content:flex-end}.uk-flex-between{justify-content:space-between}.uk-flex-around{justify-content:space-around}@media (min-width:640px){.uk-flex-left\@s{justify-content:flex-start}.uk-flex-center\@s{justify-content:center}.uk-flex-right\@s{justify-content:flex-end}.uk-flex-between\@s{justify-content:space-between}.uk-flex-around\@s{justify-content:space-around}}@media (min-width:960px){.uk-flex-left\@m{justify-content:flex-start}.uk-flex-center\@m{justify-content:center}.uk-flex-right\@m{justify-content:flex-end}.uk-flex-between\@m{justify-content:space-between}.uk-flex-around\@m{justify-content:space-around}}@media (min-width:1200px){.uk-flex-left\@l{justify-content:flex-start}.uk-flex-center\@l{justify-content:center}.uk-flex-right\@l{justify-content:flex-end}.uk-flex-between\@l{justify-content:space-between}.uk-flex-around\@l{justify-content:space-around}}@media (min-width:1600px){.uk-flex-left\@xl{justify-content:flex-start}.uk-flex-center\@xl{justify-content:center}.uk-flex-right\@xl{justify-content:flex-end}.uk-flex-between\@xl{justify-content:space-between}.uk-flex-around\@xl{justify-content:space-around}}.uk-flex-stretch{align-items:stretch}.uk-flex-top{align-items:flex-start}.uk-flex-middle{align-items:center}.uk-flex-bottom{align-items:flex-end}@media (min-width:640px){.uk-flex-stretch\@s{align-items:stretch}.uk-flex-top\@s{align-items:flex-start}.uk-flex-middle\@s{align-items:center}.uk-flex-bottom\@s{align-items:flex-end}}@media (min-width:960px){.uk-flex-stretch\@m{align-items:stretch}.uk-flex-top\@m{align-items:flex-start}.uk-flex-middle\@m{align-items:center}.uk-flex-bottom\@m{align-items:flex-end}}@media (min-width:1200px){.uk-flex-stretch\@l{align-items:stretch}.uk-flex-top\@l{align-items:flex-start}.uk-flex-middle\@l{align-items:center}.uk-flex-bottom\@l{align-items:flex-end}}@media (min-width:1600px){.uk-flex-stretch\@xl{align-items:stretch}.uk-flex-top\@xl{align-items:flex-start}.uk-flex-middle\@xl{align-items:center}.uk-flex-bottom\@xl{align-items:flex-end}}.uk-flex-row{flex-direction:row}.uk-flex-row-reverse{flex-direction:row-reverse}.uk-flex-column{flex-direction:column}.uk-flex-column-reverse{flex-direction:column-reverse}@media (min-width:640px){.uk-flex-row\@s{flex-direction:row}.uk-flex-column\@s{flex-direction:column}}@media (min-width:960px){.uk-flex-row\@m{flex-direction:row}.uk-flex-column\@m{flex-direction:column}}@media (min-width:1200px){.uk-flex-row\@l{flex-direction:row}.uk-flex-column\@l{flex-direction:column}}@media (min-width:1600px){.uk-flex-row\@xl{flex-direction:row}.uk-flex-column\@xl{flex-direction:column}}.uk-flex-nowrap{flex-wrap:nowrap}.uk-flex-wrap{flex-wrap:wrap}.uk-flex-wrap-reverse{flex-wrap:wrap-reverse}.uk-flex-wrap-stretch{align-content:stretch}.uk-flex-wrap-top{align-content:flex-start}.uk-flex-wrap-middle{align-content:center}.uk-flex-wrap-bottom{align-content:flex-end}.uk-flex-wrap-between{align-content:space-between}.uk-flex-wrap-around{align-content:space-around}.uk-flex-first{order:-1}.uk-flex-last{order:99}@media (min-width:640px){.uk-flex-first\@s{order:-1}.uk-flex-last\@s{order:99}}@media (min-width:960px){.uk-flex-first\@m{order:-1}.uk-flex-last\@m{order:99}}@media (min-width:1200px){.uk-flex-first\@l{order:-1}.uk-flex-last\@l{order:99}}@media (min-width:1600px){.uk-flex-first\@xl{order:-1}.uk-flex-last\@xl{order:99}}.uk-flex-initial{flex:initial}.uk-flex-none{flex:none}.uk-flex-auto{flex:auto}.uk-flex-1{flex:1}@media (min-width:640px){.uk-flex-initial\@s{flex:initial}.uk-flex-none\@s{flex:none}.uk-flex-1\@s{flex:1}}@media (min-width:960px){.uk-flex-initial\@m{flex:initial}.uk-flex-none\@m{flex:none}.uk-flex-1\@m{flex:1}}@media (min-width:1200px){.uk-flex-initial\@l{flex:initial}.uk-flex-none\@l{flex:none}.uk-flex-1\@l{flex:1}}@media (min-width:1600px){.uk-flex-initial\@xl{flex:initial}.uk-flex-none\@xl{flex:none}.uk-flex-1\@xl{flex:1}}.uk-margin{margin-bottom:20px}*+.uk-margin{margin-top:20px!important}.uk-margin-top{margin-top:20px!important}.uk-margin-bottom{margin-bottom:20px!important}.uk-margin-left{margin-left:20px!important}.uk-margin-right{margin-right:20px!important}.uk-margin-small{margin-bottom:10px}*+.uk-margin-small{margin-top:10px!important}.uk-margin-small-top{margin-top:10px!important}.uk-margin-small-bottom{margin-bottom:10px!important}.uk-margin-small-left{margin-left:10px!important}.uk-margin-small-right{margin-right:10px!important}.uk-margin-medium{margin-bottom:40px}*+.uk-margin-medium{margin-top:40px!important}.uk-margin-medium-top{margin-top:40px!important}.uk-margin-medium-bottom{margin-bottom:40px!important}.uk-margin-medium-left{margin-left:40px!important}.uk-margin-medium-right{margin-right:40px!important}.uk-margin-large{margin-bottom:40px}*+.uk-margin-large{margin-top:40px!important}.uk-margin-large-top{margin-top:40px!important}.uk-margin-large-bottom{margin-bottom:40px!important}.uk-margin-large-left{margin-left:40px!important}.uk-margin-large-right{margin-right:40px!important}@media (min-width:1200px){.uk-margin-large{margin-bottom:70px}*+.uk-margin-large{margin-top:70px!important}.uk-margin-large-top{margin-top:70px!important}.uk-margin-large-bottom{margin-bottom:70px!important}.uk-margin-large-left{margin-left:70px!important}.uk-margin-large-right{margin-right:70px!important}}.uk-margin-xlarge{margin-bottom:70px}*+.uk-margin-xlarge{margin-top:70px!important}.uk-margin-xlarge-top{margin-top:70px!important}.uk-margin-xlarge-bottom{margin-bottom:70px!important}.uk-margin-xlarge-left{margin-left:70px!important}.uk-margin-xlarge-right{margin-right:70px!important}@media (min-width:1200px){.uk-margin-xlarge{margin-bottom:140px}*+.uk-margin-xlarge{margin-top:140px!important}.uk-margin-xlarge-top{margin-top:140px!important}.uk-margin-xlarge-bottom{margin-bottom:140px!important}.uk-margin-xlarge-left{margin-left:140px!important}.uk-margin-xlarge-right{margin-right:140px!important}}.uk-margin-auto{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-top{margin-top:auto!important}.uk-margin-auto-bottom{margin-bottom:auto!important}.uk-margin-auto-left{margin-left:auto!important}.uk-margin-auto-right{margin-right:auto!important}.uk-margin-auto-vertical{margin-top:auto!important;margin-bottom:auto!important}@media (min-width:640px){.uk-margin-auto\@s{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@s{margin-left:auto!important}.uk-margin-auto-right\@s{margin-right:auto!important}}@media (min-width:960px){.uk-margin-auto\@m{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@m{margin-left:auto!important}.uk-margin-auto-right\@m{margin-right:auto!important}}@media (min-width:1200px){.uk-margin-auto\@l{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@l{margin-left:auto!important}.uk-margin-auto-right\@l{margin-right:auto!important}}@media (min-width:1600px){.uk-margin-auto\@xl{margin-left:auto!important;margin-right:auto!important}.uk-margin-auto-left\@xl{margin-left:auto!important}.uk-margin-auto-right\@xl{margin-right:auto!important}}.uk-margin-remove{margin:0!important}.uk-margin-remove-top{margin-top:0!important}.uk-margin-remove-bottom{margin-bottom:0!important}.uk-margin-remove-left{margin-left:0!important}.uk-margin-remove-right{margin-right:0!important}.uk-margin-remove-vertical{margin-top:0!important;margin-bottom:0!important}.uk-margin-remove-adjacent+*,.uk-margin-remove-first-child>:first-child{margin-top:0!important}.uk-margin-remove-last-child>:last-child{margin-bottom:0!important}@media (min-width:640px){.uk-margin-remove-left\@s{margin-left:0!important}.uk-margin-remove-right\@s{margin-right:0!important}}@media (min-width:960px){.uk-margin-remove-left\@m{margin-left:0!important}.uk-margin-remove-right\@m{margin-right:0!important}}@media (min-width:1200px){.uk-margin-remove-left\@l{margin-left:0!important}.uk-margin-remove-right\@l{margin-right:0!important}}@media (min-width:1600px){.uk-margin-remove-left\@xl{margin-left:0!important}.uk-margin-remove-right\@xl{margin-right:0!important}}.uk-padding{padding:30px}@media (min-width:1200px){.uk-padding{padding:40px}}.uk-padding-small{padding:15px}.uk-padding-large{padding:40px}@media (min-width:1200px){.uk-padding-large{padding:70px}}.uk-padding-remove{padding:0!important}.uk-padding-remove-top{padding-top:0!important}.uk-padding-remove-bottom{padding-bottom:0!important}.uk-padding-remove-left{padding-left:0!important}.uk-padding-remove-right{padding-right:0!important}.uk-padding-remove-vertical{padding-top:0!important;padding-bottom:0!important}.uk-padding-remove-horizontal{padding-left:0!important;padding-right:0!important}:root{--uk-position-margin-offset:0px}[class*=uk-position-bottom],[class*=uk-position-center],[class*=uk-position-left],[class*=uk-position-right],[class*=uk-position-top]{position:absolute!important;max-width:calc(100% - (var(--uk-position-margin-offset) * 2));box-sizing:border-box}.uk-position-top{top:0;left:0;right:0}.uk-position-bottom{bottom:0;left:0;right:0}.uk-position-left{top:0;bottom:0;left:0}.uk-position-right{top:0;bottom:0;right:0}.uk-position-top-left{top:0;left:0}.uk-position-top-right{top:0;right:0}.uk-position-bottom-left{bottom:0;left:0}.uk-position-bottom-right{bottom:0;right:0}.uk-position-center{top:calc(50% - var(--uk-position-margin-offset));left:calc(50% - var(--uk-position-margin-offset));--uk-position-translate-x:-50%;--uk-position-translate-y:-50%;transform:translate(var(--uk-position-translate-x),var(--uk-position-translate-y));width:max-content}.uk-position-center-vertical,[class*=uk-position-center-left],[class*=uk-position-center-right]{top:calc(50% - var(--uk-position-margin-offset));--uk-position-translate-y:-50%;transform:translateY(var(--uk-position-translate-y))}.uk-position-center-left{left:0}.uk-position-center-right{right:0}.uk-position-center-vertical{left:0;right:0}.uk-position-center-left-out{right:100%;width:max-content}.uk-position-center-right-out{left:100%;width:max-content}.uk-position-bottom-center,.uk-position-center-horizontal,.uk-position-top-center{left:calc(50% - var(--uk-position-margin-offset));--uk-position-translate-x:-50%;transform:translate(var(--uk-position-translate-x));width:max-content}.uk-position-top-center{top:0}.uk-position-bottom-center{bottom:0}.uk-position-center-horizontal{top:0;bottom:0}.uk-position-cover{position:absolute;inset:0}.uk-position-small{margin:15px;--uk-position-margin-offset:15px}.uk-position-medium,.uk-position-large{margin:30px;--uk-position-margin-offset:30px}@media (min-width:1200px){.uk-position-large{margin:50px;--uk-position-margin-offset:50px}}.uk-position-relative{position:relative!important}.uk-position-absolute{position:absolute!important}.uk-position-fixed{position:fixed!important}.uk-position-sticky{position:sticky!important}.uk-position-z-index{z-index:1}.uk-position-z-index-zero{z-index:0}.uk-position-z-index-negative{z-index:-1}.uk-position-z-index-high{z-index:990}:where(.uk-transition-fade),:where([class*=uk-transition-scale]),:where([class*=uk-transition-slide]){--uk-position-translate-x:0;--uk-position-translate-y:0}.uk-transition-fade,[class*=uk-transition-scale],[class*=uk-transition-slide]{--uk-translate-x:0;--uk-translate-y:0;--uk-scale-x:1;--uk-scale-y:1;transform:translate(var(--uk-position-translate-x),var(--uk-position-translate-y)) translate(var(--uk-translate-x),var(--uk-translate-y)) scale(var(--uk-scale-x),var(--uk-scale-y));transition:.3s ease-out;transition-property:opacity,transform,filter;opacity:0}.uk-transition-active.uk-active .uk-transition-fade,.uk-transition-toggle .uk-transition-fade:focus-within,.uk-transition-toggle:focus .uk-transition-fade,.uk-transition-toggle:hover .uk-transition-fade{opacity:1}[class*=uk-transition-scale]{-webkit-backface-visibility:hidden}.uk-transition-scale-up{--uk-scale-x:1;--uk-scale-y:1}.uk-transition-scale-down{--uk-scale-x:1.03;--uk-scale-y:1.03}.uk-transition-active.uk-active .uk-transition-scale-up,.uk-transition-toggle .uk-transition-scale-up:focus-within,.uk-transition-toggle:focus .uk-transition-scale-up,.uk-transition-toggle:hover .uk-transition-scale-up{--uk-scale-x:1.03;--uk-scale-y:1.03;opacity:1}.uk-transition-active.uk-active .uk-transition-scale-down,.uk-transition-toggle .uk-transition-scale-down:focus-within,.uk-transition-toggle:focus .uk-transition-scale-down,.uk-transition-toggle:hover .uk-transition-scale-down{--uk-scale-x:1;--uk-scale-y:1;opacity:1}.uk-transition-slide-top{--uk-translate-y:-100%}.uk-transition-slide-bottom{--uk-translate-y:100%}.uk-transition-slide-left{--uk-translate-x:-100%}.uk-transition-slide-right{--uk-translate-x:100%}.uk-transition-slide-top-small{--uk-translate-y: -10px }.uk-transition-slide-bottom-small{--uk-translate-y:10px}.uk-transition-slide-left-small{--uk-translate-x: -10px }.uk-transition-slide-right-small{--uk-translate-x:10px}.uk-transition-slide-top-medium{--uk-translate-y: -50px }.uk-transition-slide-bottom-medium{--uk-translate-y:50px}.uk-transition-slide-left-medium{--uk-translate-x: -50px }.uk-transition-slide-right-medium{--uk-translate-x:50px}.uk-transition-active.uk-active [class*=uk-transition-slide],.uk-transition-toggle [class*=uk-transition-slide]:focus-within,.uk-transition-toggle:focus [class*=uk-transition-slide],.uk-transition-toggle:hover [class*=uk-transition-slide]{--uk-translate-x:0;--uk-translate-y:0;opacity:1}.uk-transition-opaque{opacity:1}.uk-transition-slow{transition-duration:.7s}.uk-transition-disable,.uk-transition-disable *{transition:none!important}.uk-hidden,[hidden]{display:none!important}@media (min-width:640px){.uk-hidden\@s{display:none!important}}@media (min-width:960px){.uk-hidden\@m{display:none!important}}@media (min-width:1200px){.uk-hidden\@l{display:none!important}}@media (min-width:1600px){.uk-hidden\@xl{display:none!important}}@media (max-width:639px){.uk-visible\@s{display:none!important}}@media (max-width:959px){.uk-visible\@m{display:none!important}}@media (max-width:1199px){.uk-visible\@l{display:none!important}}@media (max-width:1599px){.uk-visible\@xl{display:none!important}}.uk-invisible{visibility:hidden!important}.uk-hidden-visually:not(:focus):not(:active):not(:focus-within),.uk-visible-toggle:not(:hover):not(:focus) .uk-hidden-hover:not(:focus-within){position:absolute!important;width:1px!important;height:1px!important;padding:0!important;border:0!important;margin:0!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}.uk-visible-toggle:not(:hover):not(:focus) .uk-invisible-hover:not(:focus-within){opacity:0!important}@media (hover:none){.uk-hidden-touch{display:none!important}}@media (hover){.uk-hidden-notouch{display:none!important}}.uk-card-primary.uk-card-body,.uk-card-primary>:not([class*=uk-card-media]),.uk-card-secondary.uk-card-body,.uk-card-secondary>:not([class*=uk-card-media]),.uk-light,.uk-offcanvas-bar,.uk-overlay-primary,.uk-section-primary:not(.uk-preserve-color),.uk-section-secondary:not(.uk-preserve-color),.uk-tile-primary:not(.uk-preserve-color),.uk-tile-secondary:not(.uk-preserve-color){color:#ffffffb3}.uk-card-primary.uk-card-body .uk-link,.uk-card-primary.uk-card-body a,.uk-card-primary>:not([class*=uk-card-media]) .uk-link,.uk-card-primary>:not([class*=uk-card-media]) a,.uk-card-secondary.uk-card-body .uk-link,.uk-card-secondary.uk-card-body a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link,.uk-card-secondary>:not([class*=uk-card-media]) a,.uk-light .uk-link,.uk-light a,.uk-offcanvas-bar .uk-link,.uk-offcanvas-bar a,.uk-overlay-primary .uk-link,.uk-overlay-primary a,.uk-section-primary:not(.uk-preserve-color) .uk-link,.uk-section-primary:not(.uk-preserve-color) a,.uk-section-secondary:not(.uk-preserve-color) .uk-link,.uk-section-secondary:not(.uk-preserve-color) a,.uk-tile-primary:not(.uk-preserve-color) .uk-link,.uk-tile-primary:not(.uk-preserve-color) a,.uk-tile-secondary:not(.uk-preserve-color) .uk-link,.uk-tile-secondary:not(.uk-preserve-color) a{color:#fff}.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link,.uk-card-primary.uk-card-body .uk-link:hover,.uk-card-primary.uk-card-body a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-link:hover,.uk-card-primary>:not([class*=uk-card-media]) a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link,.uk-card-secondary.uk-card-body .uk-link:hover,.uk-card-secondary.uk-card-body a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link:hover,.uk-card-secondary>:not([class*=uk-card-media]) a:hover,.uk-light .uk-link-toggle:hover .uk-link,.uk-light .uk-link:hover,.uk-light a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link,.uk-offcanvas-bar .uk-link:hover,.uk-offcanvas-bar a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link,.uk-overlay-primary .uk-link:hover,.uk-overlay-primary a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-section-primary:not(.uk-preserve-color) .uk-link:hover,.uk-section-primary:not(.uk-preserve-color) a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-section-secondary:not(.uk-preserve-color) .uk-link:hover,.uk-section-secondary:not(.uk-preserve-color) a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-tile-primary:not(.uk-preserve-color) .uk-link:hover,.uk-tile-primary:not(.uk-preserve-color) a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-link:hover,.uk-tile-secondary:not(.uk-preserve-color) a:hover{color:#fff}.uk-card-primary.uk-card-body :not(pre)>code,.uk-card-primary.uk-card-body :not(pre)>kbd,.uk-card-primary.uk-card-body :not(pre)>samp,.uk-card-primary>:not([class*=uk-card-media]) :not(pre)>code,.uk-card-primary>:not([class*=uk-card-media]) :not(pre)>kbd,.uk-card-primary>:not([class*=uk-card-media]) :not(pre)>samp,.uk-card-secondary.uk-card-body :not(pre)>code,.uk-card-secondary.uk-card-body :not(pre)>kbd,.uk-card-secondary.uk-card-body :not(pre)>samp,.uk-card-secondary>:not([class*=uk-card-media]) :not(pre)>code,.uk-card-secondary>:not([class*=uk-card-media]) :not(pre)>kbd,.uk-card-secondary>:not([class*=uk-card-media]) :not(pre)>samp,.uk-light :not(pre)>code,.uk-light :not(pre)>kbd,.uk-light :not(pre)>samp,.uk-offcanvas-bar :not(pre)>code,.uk-offcanvas-bar :not(pre)>kbd,.uk-offcanvas-bar :not(pre)>samp,.uk-overlay-primary :not(pre)>code,.uk-overlay-primary :not(pre)>kbd,.uk-overlay-primary :not(pre)>samp,.uk-section-primary:not(.uk-preserve-color) :not(pre)>code,.uk-section-primary:not(.uk-preserve-color) :not(pre)>kbd,.uk-section-primary:not(.uk-preserve-color) :not(pre)>samp,.uk-section-secondary:not(.uk-preserve-color) :not(pre)>code,.uk-section-secondary:not(.uk-preserve-color) :not(pre)>kbd,.uk-section-secondary:not(.uk-preserve-color) :not(pre)>samp,.uk-tile-primary:not(.uk-preserve-color) :not(pre)>code,.uk-tile-primary:not(.uk-preserve-color) :not(pre)>kbd,.uk-tile-primary:not(.uk-preserve-color) :not(pre)>samp,.uk-tile-secondary:not(.uk-preserve-color) :not(pre)>code,.uk-tile-secondary:not(.uk-preserve-color) :not(pre)>kbd,.uk-tile-secondary:not(.uk-preserve-color) :not(pre)>samp{color:#ffffffb3;background-color:#ffffff1a}.uk-card-primary.uk-card-body em,.uk-card-primary>:not([class*=uk-card-media]) em,.uk-card-secondary.uk-card-body em,.uk-card-secondary>:not([class*=uk-card-media]) em,.uk-light em,.uk-offcanvas-bar em,.uk-overlay-primary em,.uk-section-primary:not(.uk-preserve-color) em,.uk-section-secondary:not(.uk-preserve-color) em,.uk-tile-primary:not(.uk-preserve-color) em,.uk-tile-secondary:not(.uk-preserve-color) em{color:#fff}.uk-card-primary.uk-card-body .uk-h1,.uk-card-primary.uk-card-body .uk-h2,.uk-card-primary.uk-card-body .uk-h3,.uk-card-primary.uk-card-body .uk-h4,.uk-card-primary.uk-card-body .uk-h5,.uk-card-primary.uk-card-body .uk-h6,.uk-card-primary.uk-card-body .uk-heading-2xlarge,.uk-card-primary.uk-card-body .uk-heading-3xlarge,.uk-card-primary.uk-card-body .uk-heading-large,.uk-card-primary.uk-card-body .uk-heading-medium,.uk-card-primary.uk-card-body .uk-heading-small,.uk-card-primary.uk-card-body .uk-heading-xlarge,.uk-card-primary.uk-card-body h1,.uk-card-primary.uk-card-body h2,.uk-card-primary.uk-card-body h3,.uk-card-primary.uk-card-body h4,.uk-card-primary.uk-card-body h5,.uk-card-primary.uk-card-body h6,.uk-card-primary>:not([class*=uk-card-media]) .uk-h1,.uk-card-primary>:not([class*=uk-card-media]) .uk-h2,.uk-card-primary>:not([class*=uk-card-media]) .uk-h3,.uk-card-primary>:not([class*=uk-card-media]) .uk-h4,.uk-card-primary>:not([class*=uk-card-media]) .uk-h5,.uk-card-primary>:not([class*=uk-card-media]) .uk-h6,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-2xlarge,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-3xlarge,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-large,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-medium,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-small,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-xlarge,.uk-card-primary>:not([class*=uk-card-media]) h1,.uk-card-primary>:not([class*=uk-card-media]) h2,.uk-card-primary>:not([class*=uk-card-media]) h3,.uk-card-primary>:not([class*=uk-card-media]) h4,.uk-card-primary>:not([class*=uk-card-media]) h5,.uk-card-primary>:not([class*=uk-card-media]) h6,.uk-card-secondary.uk-card-body .uk-h1,.uk-card-secondary.uk-card-body .uk-h2,.uk-card-secondary.uk-card-body .uk-h3,.uk-card-secondary.uk-card-body .uk-h4,.uk-card-secondary.uk-card-body .uk-h5,.uk-card-secondary.uk-card-body .uk-h6,.uk-card-secondary.uk-card-body .uk-heading-2xlarge,.uk-card-secondary.uk-card-body .uk-heading-3xlarge,.uk-card-secondary.uk-card-body .uk-heading-large,.uk-card-secondary.uk-card-body .uk-heading-medium,.uk-card-secondary.uk-card-body .uk-heading-small,.uk-card-secondary.uk-card-body .uk-heading-xlarge,.uk-card-secondary.uk-card-body h1,.uk-card-secondary.uk-card-body h2,.uk-card-secondary.uk-card-body h3,.uk-card-secondary.uk-card-body h4,.uk-card-secondary.uk-card-body h5,.uk-card-secondary.uk-card-body h6,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h1,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h2,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h3,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h4,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h5,.uk-card-secondary>:not([class*=uk-card-media]) .uk-h6,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-2xlarge,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-3xlarge,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-large,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-medium,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-small,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-xlarge,.uk-card-secondary>:not([class*=uk-card-media]) h1,.uk-card-secondary>:not([class*=uk-card-media]) h2,.uk-card-secondary>:not([class*=uk-card-media]) h3,.uk-card-secondary>:not([class*=uk-card-media]) h4,.uk-card-secondary>:not([class*=uk-card-media]) h5,.uk-card-secondary>:not([class*=uk-card-media]) h6,.uk-light .uk-h1,.uk-light .uk-h2,.uk-light .uk-h3,.uk-light .uk-h4,.uk-light .uk-h5,.uk-light .uk-h6,.uk-light .uk-heading-2xlarge,.uk-light .uk-heading-3xlarge,.uk-light .uk-heading-large,.uk-light .uk-heading-medium,.uk-light .uk-heading-small,.uk-light .uk-heading-xlarge,.uk-light h1,.uk-light h2,.uk-light h3,.uk-light h4,.uk-light h5,.uk-light h6,.uk-offcanvas-bar .uk-h1,.uk-offcanvas-bar .uk-h2,.uk-offcanvas-bar .uk-h3,.uk-offcanvas-bar .uk-h4,.uk-offcanvas-bar .uk-h5,.uk-offcanvas-bar .uk-h6,.uk-offcanvas-bar .uk-heading-2xlarge,.uk-offcanvas-bar .uk-heading-3xlarge,.uk-offcanvas-bar .uk-heading-large,.uk-offcanvas-bar .uk-heading-medium,.uk-offcanvas-bar .uk-heading-small,.uk-offcanvas-bar .uk-heading-xlarge,.uk-offcanvas-bar h1,.uk-offcanvas-bar h2,.uk-offcanvas-bar h3,.uk-offcanvas-bar h4,.uk-offcanvas-bar h5,.uk-offcanvas-bar h6,.uk-overlay-primary .uk-h1,.uk-overlay-primary .uk-h2,.uk-overlay-primary .uk-h3,.uk-overlay-primary .uk-h4,.uk-overlay-primary .uk-h5,.uk-overlay-primary .uk-h6,.uk-overlay-primary .uk-heading-2xlarge,.uk-overlay-primary .uk-heading-3xlarge,.uk-overlay-primary .uk-heading-large,.uk-overlay-primary .uk-heading-medium,.uk-overlay-primary .uk-heading-small,.uk-overlay-primary .uk-heading-xlarge,.uk-overlay-primary h1,.uk-overlay-primary h2,.uk-overlay-primary h3,.uk-overlay-primary h4,.uk-overlay-primary h5,.uk-overlay-primary h6,.uk-section-primary:not(.uk-preserve-color) .uk-h1,.uk-section-primary:not(.uk-preserve-color) .uk-h2,.uk-section-primary:not(.uk-preserve-color) .uk-h3,.uk-section-primary:not(.uk-preserve-color) .uk-h4,.uk-section-primary:not(.uk-preserve-color) .uk-h5,.uk-section-primary:not(.uk-preserve-color) .uk-h6,.uk-section-primary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-section-primary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-section-primary:not(.uk-preserve-color) .uk-heading-large,.uk-section-primary:not(.uk-preserve-color) .uk-heading-medium,.uk-section-primary:not(.uk-preserve-color) .uk-heading-small,.uk-section-primary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-section-primary:not(.uk-preserve-color) h1,.uk-section-primary:not(.uk-preserve-color) h2,.uk-section-primary:not(.uk-preserve-color) h3,.uk-section-primary:not(.uk-preserve-color) h4,.uk-section-primary:not(.uk-preserve-color) h5,.uk-section-primary:not(.uk-preserve-color) h6,.uk-section-secondary:not(.uk-preserve-color) .uk-h1,.uk-section-secondary:not(.uk-preserve-color) .uk-h2,.uk-section-secondary:not(.uk-preserve-color) .uk-h3,.uk-section-secondary:not(.uk-preserve-color) .uk-h4,.uk-section-secondary:not(.uk-preserve-color) .uk-h5,.uk-section-secondary:not(.uk-preserve-color) .uk-h6,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-large,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-medium,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-small,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-section-secondary:not(.uk-preserve-color) h1,.uk-section-secondary:not(.uk-preserve-color) h2,.uk-section-secondary:not(.uk-preserve-color) h3,.uk-section-secondary:not(.uk-preserve-color) h4,.uk-section-secondary:not(.uk-preserve-color) h5,.uk-section-secondary:not(.uk-preserve-color) h6,.uk-tile-primary:not(.uk-preserve-color) .uk-h1,.uk-tile-primary:not(.uk-preserve-color) .uk-h2,.uk-tile-primary:not(.uk-preserve-color) .uk-h3,.uk-tile-primary:not(.uk-preserve-color) .uk-h4,.uk-tile-primary:not(.uk-preserve-color) .uk-h5,.uk-tile-primary:not(.uk-preserve-color) .uk-h6,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-large,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-medium,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-small,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-tile-primary:not(.uk-preserve-color) h1,.uk-tile-primary:not(.uk-preserve-color) h2,.uk-tile-primary:not(.uk-preserve-color) h3,.uk-tile-primary:not(.uk-preserve-color) h4,.uk-tile-primary:not(.uk-preserve-color) h5,.uk-tile-primary:not(.uk-preserve-color) h6,.uk-tile-secondary:not(.uk-preserve-color) .uk-h1,.uk-tile-secondary:not(.uk-preserve-color) .uk-h2,.uk-tile-secondary:not(.uk-preserve-color) .uk-h3,.uk-tile-secondary:not(.uk-preserve-color) .uk-h4,.uk-tile-secondary:not(.uk-preserve-color) .uk-h5,.uk-tile-secondary:not(.uk-preserve-color) .uk-h6,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-2xlarge,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-3xlarge,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-large,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-medium,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-small,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-xlarge,.uk-tile-secondary:not(.uk-preserve-color) h1,.uk-tile-secondary:not(.uk-preserve-color) h2,.uk-tile-secondary:not(.uk-preserve-color) h3,.uk-tile-secondary:not(.uk-preserve-color) h4,.uk-tile-secondary:not(.uk-preserve-color) h5,.uk-tile-secondary:not(.uk-preserve-color) h6{color:#fff}.uk-card-primary.uk-card-body blockquote,.uk-card-primary>:not([class*=uk-card-media]) blockquote,.uk-card-secondary.uk-card-body blockquote,.uk-card-secondary>:not([class*=uk-card-media]) blockquote,.uk-light blockquote,.uk-offcanvas-bar blockquote,.uk-overlay-primary blockquote,.uk-section-primary:not(.uk-preserve-color) blockquote,.uk-section-secondary:not(.uk-preserve-color) blockquote,.uk-tile-primary:not(.uk-preserve-color) blockquote,.uk-tile-secondary:not(.uk-preserve-color) blockquote{color:#fff}.uk-card-primary.uk-card-body blockquote footer,.uk-card-primary>:not([class*=uk-card-media]) blockquote footer,.uk-card-secondary.uk-card-body blockquote footer,.uk-card-secondary>:not([class*=uk-card-media]) blockquote footer,.uk-light blockquote footer,.uk-offcanvas-bar blockquote footer,.uk-overlay-primary blockquote footer,.uk-section-primary:not(.uk-preserve-color) blockquote footer,.uk-section-secondary:not(.uk-preserve-color) blockquote footer,.uk-tile-primary:not(.uk-preserve-color) blockquote footer,.uk-tile-secondary:not(.uk-preserve-color) blockquote footer{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-hr,.uk-card-primary.uk-card-body hr,.uk-card-primary>:not([class*=uk-card-media]) .uk-hr,.uk-card-primary>:not([class*=uk-card-media]) hr,.uk-card-secondary.uk-card-body .uk-hr,.uk-card-secondary.uk-card-body hr,.uk-card-secondary>:not([class*=uk-card-media]) .uk-hr,.uk-card-secondary>:not([class*=uk-card-media]) hr,.uk-light .uk-hr,.uk-light hr,.uk-offcanvas-bar .uk-hr,.uk-offcanvas-bar hr,.uk-overlay-primary .uk-hr,.uk-overlay-primary hr,.uk-section-primary:not(.uk-preserve-color) .uk-hr,.uk-section-primary:not(.uk-preserve-color) hr,.uk-section-secondary:not(.uk-preserve-color) .uk-hr,.uk-section-secondary:not(.uk-preserve-color) hr,.uk-tile-primary:not(.uk-preserve-color) .uk-hr,.uk-tile-primary:not(.uk-preserve-color) hr,.uk-tile-secondary:not(.uk-preserve-color) .uk-hr,.uk-tile-secondary:not(.uk-preserve-color) hr{border-top-color:#fff3}.uk-card-primary.uk-card-body :focus-visible,.uk-card-primary>:not([class*=uk-card-media]) :focus-visible,.uk-card-secondary.uk-card-body :focus-visible,.uk-card-secondary>:not([class*=uk-card-media]) :focus-visible,.uk-light :focus-visible,.uk-offcanvas-bar :focus-visible,.uk-overlay-primary :focus-visible,.uk-section-primary:not(.uk-preserve-color) :focus-visible,.uk-section-secondary:not(.uk-preserve-color) :focus-visible,.uk-tile-primary:not(.uk-preserve-color) :focus-visible,.uk-tile-secondary:not(.uk-preserve-color) :focus-visible{outline-color:#fff}.uk-card-primary.uk-card-body .uk-link-muted a,.uk-card-primary.uk-card-body a.uk-link-muted,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-muted a,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-muted,.uk-card-secondary.uk-card-body .uk-link-muted a,.uk-card-secondary.uk-card-body a.uk-link-muted,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-muted a,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-muted,.uk-light .uk-link-muted a,.uk-light a.uk-link-muted,.uk-offcanvas-bar .uk-link-muted a,.uk-offcanvas-bar a.uk-link-muted,.uk-overlay-primary .uk-link-muted a,.uk-overlay-primary a.uk-link-muted,.uk-section-primary:not(.uk-preserve-color) .uk-link-muted a,.uk-section-primary:not(.uk-preserve-color) a.uk-link-muted,.uk-section-secondary:not(.uk-preserve-color) .uk-link-muted a,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-muted,.uk-tile-primary:not(.uk-preserve-color) .uk-link-muted a,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-muted,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-muted a,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-muted{color:#ffffff80}.uk-card-primary.uk-card-body .uk-link-muted a:hover,.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link-muted,.uk-card-primary.uk-card-body a.uk-link-muted:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-muted a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-muted,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-muted:hover,.uk-card-secondary.uk-card-body .uk-link-muted a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link-muted,.uk-card-secondary.uk-card-body a.uk-link-muted:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-muted a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-muted,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-muted:hover,.uk-light .uk-link-muted a:hover,.uk-light .uk-link-toggle:hover .uk-link-muted,.uk-light a.uk-link-muted:hover,.uk-offcanvas-bar .uk-link-muted a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link-muted,.uk-offcanvas-bar a.uk-link-muted:hover,.uk-overlay-primary .uk-link-muted a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link-muted,.uk-overlay-primary a.uk-link-muted:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-section-primary:not(.uk-preserve-color) a.uk-link-muted:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-muted:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-muted:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-muted a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-muted,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-muted:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-link-text a:hover,.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link-text,.uk-card-primary.uk-card-body a.uk-link-text:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-text a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-text,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-text:hover,.uk-card-secondary.uk-card-body .uk-link-text a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link-text,.uk-card-secondary.uk-card-body a.uk-link-text:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-text a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-text,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-text:hover,.uk-light .uk-link-text a:hover,.uk-light .uk-link-toggle:hover .uk-link-text,.uk-light a.uk-link-text:hover,.uk-offcanvas-bar .uk-link-text a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link-text,.uk-offcanvas-bar a.uk-link-text:hover,.uk-overlay-primary .uk-link-text a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link-text,.uk-overlay-primary a.uk-link-text:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-section-primary:not(.uk-preserve-color) a.uk-link-text:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-text:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-text:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-text a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-text,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-text:hover{color:#ffffff80}.uk-card-primary.uk-card-body .uk-link-heading a:hover,.uk-card-primary.uk-card-body .uk-link-toggle:hover .uk-link-heading,.uk-card-primary.uk-card-body a.uk-link-heading:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-heading a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-heading,.uk-card-primary>:not([class*=uk-card-media]) a.uk-link-heading:hover,.uk-card-secondary.uk-card-body .uk-link-heading a:hover,.uk-card-secondary.uk-card-body .uk-link-toggle:hover .uk-link-heading,.uk-card-secondary.uk-card-body a.uk-link-heading:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-heading a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-link-toggle:hover .uk-link-heading,.uk-card-secondary>:not([class*=uk-card-media]) a.uk-link-heading:hover,.uk-light .uk-link-heading a:hover,.uk-light .uk-link-toggle:hover .uk-link-heading,.uk-light a.uk-link-heading:hover,.uk-offcanvas-bar .uk-link-heading a:hover,.uk-offcanvas-bar .uk-link-toggle:hover .uk-link-heading,.uk-offcanvas-bar a.uk-link-heading:hover,.uk-overlay-primary .uk-link-heading a:hover,.uk-overlay-primary .uk-link-toggle:hover .uk-link-heading,.uk-overlay-primary a.uk-link-heading:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-section-primary:not(.uk-preserve-color) a.uk-link-heading:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-section-secondary:not(.uk-preserve-color) a.uk-link-heading:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-tile-primary:not(.uk-preserve-color) a.uk-link-heading:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-heading a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-link-toggle:hover .uk-link-heading,.uk-tile-secondary:not(.uk-preserve-color) a.uk-link-heading:hover{color:#fff}.uk-card-primary.uk-card-body .uk-heading-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-divider,.uk-card-secondary.uk-card-body .uk-heading-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-divider,.uk-light .uk-heading-divider,.uk-offcanvas-bar .uk-heading-divider,.uk-overlay-primary .uk-heading-divider,.uk-section-primary:not(.uk-preserve-color) .uk-heading-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-divider{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-heading-bullet:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-bullet:before,.uk-card-secondary.uk-card-body .uk-heading-bullet:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-bullet:before,.uk-light .uk-heading-bullet:before,.uk-offcanvas-bar .uk-heading-bullet:before,.uk-overlay-primary .uk-heading-bullet:before,.uk-section-primary:not(.uk-preserve-color) .uk-heading-bullet:before,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-bullet:before,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-bullet:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-bullet:before{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-heading-line>:after,.uk-card-primary.uk-card-body .uk-heading-line>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-line>:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-heading-line>:before,.uk-card-secondary.uk-card-body .uk-heading-line>:after,.uk-card-secondary.uk-card-body .uk-heading-line>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-line>:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-heading-line>:before,.uk-light .uk-heading-line>:after,.uk-light .uk-heading-line>:before,.uk-offcanvas-bar .uk-heading-line>:after,.uk-offcanvas-bar .uk-heading-line>:before,.uk-overlay-primary .uk-heading-line>:after,.uk-overlay-primary .uk-heading-line>:before,.uk-section-primary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-section-primary:not(.uk-preserve-color) .uk-heading-line>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-section-secondary:not(.uk-preserve-color) .uk-heading-line>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-tile-primary:not(.uk-preserve-color) .uk-heading-line>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-line>:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-heading-line>:before{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-divider-icon,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-icon,.uk-card-secondary.uk-card-body .uk-divider-icon,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-icon,.uk-light .uk-divider-icon,.uk-offcanvas-bar .uk-divider-icon,.uk-overlay-primary .uk-divider-icon,.uk-section-primary:not(.uk-preserve-color) .uk-divider-icon,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-icon,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-icon,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-icon{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22none%22%20stroke%3D%22rgba%28255,%20255,%20255,%200.2%29%22%20stroke-width%3D%222%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%227%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-divider-icon:after,.uk-card-primary.uk-card-body .uk-divider-icon:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-icon:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-icon:before,.uk-card-secondary.uk-card-body .uk-divider-icon:after,.uk-card-secondary.uk-card-body .uk-divider-icon:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-icon:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-icon:before,.uk-light .uk-divider-icon:after,.uk-light .uk-divider-icon:before,.uk-offcanvas-bar .uk-divider-icon:after,.uk-offcanvas-bar .uk-divider-icon:before,.uk-overlay-primary .uk-divider-icon:after,.uk-overlay-primary .uk-divider-icon:before,.uk-section-primary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-section-primary:not(.uk-preserve-color) .uk-divider-icon:before,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-icon:before,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-icon:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-icon:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-icon:before{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-divider-small:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-small:after,.uk-card-secondary.uk-card-body .uk-divider-small:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-small:after,.uk-light .uk-divider-small:after,.uk-offcanvas-bar .uk-divider-small:after,.uk-overlay-primary .uk-divider-small:after,.uk-section-primary:not(.uk-preserve-color) .uk-divider-small:after,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-small:after,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-small:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-small:after{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-divider-vertical,.uk-card-primary>:not([class*=uk-card-media]) .uk-divider-vertical,.uk-card-secondary.uk-card-body .uk-divider-vertical,.uk-card-secondary>:not([class*=uk-card-media]) .uk-divider-vertical,.uk-light .uk-divider-vertical,.uk-offcanvas-bar .uk-divider-vertical,.uk-overlay-primary .uk-divider-vertical,.uk-section-primary:not(.uk-preserve-color) .uk-divider-vertical,.uk-section-secondary:not(.uk-preserve-color) .uk-divider-vertical,.uk-tile-primary:not(.uk-preserve-color) .uk-divider-vertical,.uk-tile-secondary:not(.uk-preserve-color) .uk-divider-vertical{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-list-muted>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-muted>:before,.uk-card-secondary.uk-card-body .uk-list-muted>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-muted>:before,.uk-light .uk-list-muted>:before,.uk-offcanvas-bar .uk-list-muted>:before,.uk-overlay-primary .uk-list-muted>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-muted>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-muted>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-muted>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-muted>:before{color:#ffffff80!important}.uk-card-primary.uk-card-body .uk-list-emphasis>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-emphasis>:before,.uk-card-secondary.uk-card-body .uk-list-emphasis>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-emphasis>:before,.uk-light .uk-list-emphasis>:before,.uk-offcanvas-bar .uk-list-emphasis>:before,.uk-overlay-primary .uk-list-emphasis>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-emphasis>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-emphasis>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-emphasis>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-emphasis>:before{color:#fff!important}.uk-card-primary.uk-card-body .uk-list-primary>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-primary>:before,.uk-card-secondary.uk-card-body .uk-list-primary>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-primary>:before,.uk-light .uk-list-primary>:before,.uk-offcanvas-bar .uk-list-primary>:before,.uk-overlay-primary .uk-list-primary>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-primary>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-primary>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-primary>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-primary>:before{color:#fff!important}.uk-card-primary.uk-card-body .uk-list-secondary>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-secondary>:before,.uk-card-secondary.uk-card-body .uk-list-secondary>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-secondary>:before,.uk-light .uk-list-secondary>:before,.uk-offcanvas-bar .uk-list-secondary>:before,.uk-overlay-primary .uk-list-secondary>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-secondary>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-secondary>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-secondary>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-secondary>:before{color:#fff!important}.uk-card-primary.uk-card-body .uk-list-bullet>:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-list-bullet>:before,.uk-card-secondary.uk-card-body .uk-list-bullet>:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-bullet>:before,.uk-light .uk-list-bullet>:before,.uk-offcanvas-bar .uk-list-bullet>:before,.uk-overlay-primary .uk-list-bullet>:before,.uk-section-primary:not(.uk-preserve-color) .uk-list-bullet>:before,.uk-section-secondary:not(.uk-preserve-color) .uk-list-bullet>:before,.uk-tile-primary:not(.uk-preserve-color) .uk-list-bullet>:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-list-bullet>:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%226%22%20height%3D%226%22%20viewBox%3D%220%200%206%206%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20cx%3D%223%22%20cy%3D%223%22%20r%3D%223%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-list-divider>:nth-child(n+2),.uk-card-primary>:not([class*=uk-card-media]) .uk-list-divider>:nth-child(n+2),.uk-card-secondary.uk-card-body .uk-list-divider>:nth-child(n+2),.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-divider>:nth-child(n+2),.uk-light .uk-list-divider>:nth-child(n+2),.uk-offcanvas-bar .uk-list-divider>:nth-child(n+2),.uk-overlay-primary .uk-list-divider>:nth-child(n+2),.uk-section-primary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2),.uk-section-secondary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2),.uk-tile-primary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2),.uk-tile-secondary:not(.uk-preserve-color) .uk-list-divider>:nth-child(n+2){border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-light .uk-list-striped>:nth-of-type(odd),.uk-offcanvas-bar .uk-list-striped>:nth-of-type(odd),.uk-overlay-primary .uk-list-striped>:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd){border-top-color:#fff3;border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-list-striped>:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-list-striped>:nth-of-type(odd),.uk-light .uk-list-striped>:nth-of-type(odd),.uk-offcanvas-bar .uk-list-striped>:nth-of-type(odd),.uk-overlay-primary .uk-list-striped>:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-list-striped>:nth-of-type(odd){background-color:#ffffff1a}.uk-card-primary.uk-card-body .uk-table th,.uk-card-primary>:not([class*=uk-card-media]) .uk-table th,.uk-card-secondary.uk-card-body .uk-table th,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table th,.uk-light .uk-table th,.uk-offcanvas-bar .uk-table th,.uk-overlay-primary .uk-table th,.uk-section-primary:not(.uk-preserve-color) .uk-table th,.uk-section-secondary:not(.uk-preserve-color) .uk-table th,.uk-tile-primary:not(.uk-preserve-color) .uk-table th,.uk-tile-secondary:not(.uk-preserve-color) .uk-table th{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-table caption,.uk-card-primary>:not([class*=uk-card-media]) .uk-table caption,.uk-card-secondary.uk-card-body .uk-table caption,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table caption,.uk-light .uk-table caption,.uk-offcanvas-bar .uk-table caption,.uk-overlay-primary .uk-table caption,.uk-section-primary:not(.uk-preserve-color) .uk-table caption,.uk-section-secondary:not(.uk-preserve-color) .uk-table caption,.uk-tile-primary:not(.uk-preserve-color) .uk-table caption,.uk-tile-secondary:not(.uk-preserve-color) .uk-table caption{color:#ffffff80}.uk-card-primary.uk-card-body .uk-table tbody tr.uk-active,.uk-card-primary.uk-card-body .uk-table>tr.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-table tbody tr.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-table>tr.uk-active,.uk-card-secondary.uk-card-body .uk-table tbody tr.uk-active,.uk-card-secondary.uk-card-body .uk-table>tr.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table tbody tr.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table>tr.uk-active,.uk-light .uk-table tbody tr.uk-active,.uk-light .uk-table>tr.uk-active,.uk-offcanvas-bar .uk-table tbody tr.uk-active,.uk-offcanvas-bar .uk-table>tr.uk-active,.uk-overlay-primary .uk-table tbody tr.uk-active,.uk-overlay-primary .uk-table>tr.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-table>tr.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-table>tr.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-table>tr.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-table tbody tr.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-table>tr.uk-active{background:#ffffff14}.uk-card-primary.uk-card-body .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-primary.uk-card-body .uk-table-divider>:not(:first-child)>tr,.uk-card-primary.uk-card-body .uk-table-divider>tr:not(:first-child),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-divider>:not(:first-child)>tr,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-divider>tr:not(:first-child),.uk-card-secondary.uk-card-body .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-secondary.uk-card-body .uk-table-divider>:not(:first-child)>tr,.uk-card-secondary.uk-card-body .uk-table-divider>tr:not(:first-child),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-divider>:first-child>tr:not(:first-child),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-divider>:not(:first-child)>tr,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-divider>tr:not(:first-child),.uk-light .uk-table-divider>:first-child>tr:not(:first-child),.uk-light .uk-table-divider>:not(:first-child)>tr,.uk-light .uk-table-divider>tr:not(:first-child),.uk-offcanvas-bar .uk-table-divider>:first-child>tr:not(:first-child),.uk-offcanvas-bar .uk-table-divider>:not(:first-child)>tr,.uk-offcanvas-bar .uk-table-divider>tr:not(:first-child),.uk-overlay-primary .uk-table-divider>:first-child>tr:not(:first-child),.uk-overlay-primary .uk-table-divider>:not(:first-child)>tr,.uk-overlay-primary .uk-table-divider>tr:not(:first-child),.uk-section-primary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-section-primary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-section-primary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child),.uk-section-secondary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-section-secondary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-section-secondary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child),.uk-tile-primary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-tile-primary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-tile-primary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-divider>:first-child>tr:not(:first-child),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-divider>:not(:first-child)>tr,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-divider>tr:not(:first-child){border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-primary.uk-card-body .uk-table-striped>tr:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-secondary.uk-card-body .uk-table-striped>tr:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(odd),.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(odd),.uk-light .uk-table-striped tbody tr:nth-of-type(odd),.uk-light .uk-table-striped>tr:nth-of-type(odd),.uk-offcanvas-bar .uk-table-striped tbody tr:nth-of-type(odd),.uk-offcanvas-bar .uk-table-striped>tr:nth-of-type(odd),.uk-overlay-primary .uk-table-striped tbody tr:nth-of-type(odd),.uk-overlay-primary .uk-table-striped>tr:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-section-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(odd),.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(odd){background:#ffffff1a;border-top-color:#fff3;border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-table-hover tbody tr:hover,.uk-card-primary.uk-card-body .uk-table-hover>tr:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-hover tbody tr:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-hover>tr:hover,.uk-card-secondary.uk-card-body .uk-table-hover tbody tr:hover,.uk-card-secondary.uk-card-body .uk-table-hover>tr:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-hover tbody tr:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-hover>tr:hover,.uk-light .uk-table-hover tbody tr:hover,.uk-light .uk-table-hover>tr:hover,.uk-offcanvas-bar .uk-table-hover tbody tr:hover,.uk-offcanvas-bar .uk-table-hover>tr:hover,.uk-overlay-primary .uk-table-hover tbody tr:hover,.uk-overlay-primary .uk-table-hover>tr:hover,.uk-section-primary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-section-primary:not(.uk-preserve-color) .uk-table-hover>tr:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-table-hover>tr:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-table-hover>tr:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-hover tbody tr:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-hover>tr:hover{background:#ffffff14}.uk-card-primary.uk-card-body .uk-icon-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-link,.uk-card-secondary.uk-card-body .uk-icon-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-link,.uk-light .uk-icon-link,.uk-offcanvas-bar .uk-icon-link,.uk-overlay-primary .uk-icon-link,.uk-section-primary:not(.uk-preserve-color) .uk-icon-link,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-link,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-link{color:#ffffff80}.uk-card-primary.uk-card-body .uk-icon-link:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-link:hover,.uk-card-secondary.uk-card-body .uk-icon-link:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-link:hover,.uk-light .uk-icon-link:hover,.uk-offcanvas-bar .uk-icon-link:hover,.uk-overlay-primary .uk-icon-link:hover,.uk-section-primary:not(.uk-preserve-color) .uk-icon-link:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-link:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-link:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-link:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-active>.uk-icon-link,.uk-card-primary.uk-card-body .uk-icon-link:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-active>.uk-icon-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-link:active,.uk-card-secondary.uk-card-body .uk-active>.uk-icon-link,.uk-card-secondary.uk-card-body .uk-icon-link:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-active>.uk-icon-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-link:active,.uk-light .uk-active>.uk-icon-link,.uk-light .uk-icon-link:active,.uk-offcanvas-bar .uk-active>.uk-icon-link,.uk-offcanvas-bar .uk-icon-link:active,.uk-overlay-primary .uk-active>.uk-icon-link,.uk-overlay-primary .uk-icon-link:active,.uk-section-primary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-section-primary:not(.uk-preserve-color) .uk-icon-link:active,.uk-section-secondary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-link:active,.uk-tile-primary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-link:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-active>.uk-icon-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-link:active{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-icon-button,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-button,.uk-card-secondary.uk-card-body .uk-icon-button,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-button,.uk-light .uk-icon-button,.uk-offcanvas-bar .uk-icon-button,.uk-overlay-primary .uk-icon-button,.uk-section-primary:not(.uk-preserve-color) .uk-icon-button,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-button,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-button,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-button{background-color:#ffffff1a;color:#ffffff80}.uk-card-primary.uk-card-body .uk-icon-button:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-button:hover,.uk-card-secondary.uk-card-body .uk-icon-button:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-button:hover,.uk-light .uk-icon-button:hover,.uk-offcanvas-bar .uk-icon-button:hover,.uk-overlay-primary .uk-icon-button:hover,.uk-section-primary:not(.uk-preserve-color) .uk-icon-button:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-button:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-button:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-button:hover{background-color:#ffffff26;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-icon-button:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-icon-button:active,.uk-card-secondary.uk-card-body .uk-icon-button:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-icon-button:active,.uk-light .uk-icon-button:active,.uk-offcanvas-bar .uk-icon-button:active,.uk-overlay-primary .uk-icon-button:active,.uk-section-primary:not(.uk-preserve-color) .uk-icon-button:active,.uk-section-secondary:not(.uk-preserve-color) .uk-icon-button:active,.uk-tile-primary:not(.uk-preserve-color) .uk-icon-button:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-icon-button:active{background-color:#fff3;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-input,.uk-card-primary.uk-card-body .uk-select,.uk-card-primary.uk-card-body .uk-textarea,.uk-card-primary>:not([class*=uk-card-media]) .uk-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-select,.uk-card-primary>:not([class*=uk-card-media]) .uk-textarea,.uk-card-secondary.uk-card-body .uk-input,.uk-card-secondary.uk-card-body .uk-select,.uk-card-secondary.uk-card-body .uk-textarea,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-select,.uk-card-secondary>:not([class*=uk-card-media]) .uk-textarea,.uk-light .uk-input,.uk-light .uk-select,.uk-light .uk-textarea,.uk-offcanvas-bar .uk-input,.uk-offcanvas-bar .uk-select,.uk-offcanvas-bar .uk-textarea,.uk-overlay-primary .uk-input,.uk-overlay-primary .uk-select,.uk-overlay-primary .uk-textarea,.uk-section-primary:not(.uk-preserve-color) .uk-input,.uk-section-primary:not(.uk-preserve-color) .uk-select,.uk-section-primary:not(.uk-preserve-color) .uk-textarea,.uk-section-secondary:not(.uk-preserve-color) .uk-input,.uk-section-secondary:not(.uk-preserve-color) .uk-select,.uk-section-secondary:not(.uk-preserve-color) .uk-textarea,.uk-tile-primary:not(.uk-preserve-color) .uk-input,.uk-tile-primary:not(.uk-preserve-color) .uk-select,.uk-tile-primary:not(.uk-preserve-color) .uk-textarea,.uk-tile-secondary:not(.uk-preserve-color) .uk-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-select,.uk-tile-secondary:not(.uk-preserve-color) .uk-textarea{background-color:#ffffff1a;color:#ffffffb3;background-clip:padding-box;border-color:#fff3}.uk-card-primary.uk-card-body .uk-input:focus,.uk-card-primary.uk-card-body .uk-select:focus,.uk-card-primary.uk-card-body .uk-textarea:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-input:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-select:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-textarea:focus,.uk-card-secondary.uk-card-body .uk-input:focus,.uk-card-secondary.uk-card-body .uk-select:focus,.uk-card-secondary.uk-card-body .uk-textarea:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-select:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-textarea:focus,.uk-light .uk-input:focus,.uk-light .uk-select:focus,.uk-light .uk-textarea:focus,.uk-offcanvas-bar .uk-input:focus,.uk-offcanvas-bar .uk-select:focus,.uk-offcanvas-bar .uk-textarea:focus,.uk-overlay-primary .uk-input:focus,.uk-overlay-primary .uk-select:focus,.uk-overlay-primary .uk-textarea:focus,.uk-section-primary:not(.uk-preserve-color) .uk-input:focus,.uk-section-primary:not(.uk-preserve-color) .uk-select:focus,.uk-section-primary:not(.uk-preserve-color) .uk-textarea:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-input:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-select:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-textarea:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-input:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-select:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-textarea:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-input:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-select:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-textarea:focus{background-color:#ffffff26;color:#ffffffb3;border-color:#ffffffb3}.uk-card-primary.uk-card-body .uk-input::placeholder,.uk-card-primary>:not([class*=uk-card-media]) .uk-input::placeholder,.uk-card-secondary.uk-card-body .uk-input::placeholder,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input::placeholder,.uk-light .uk-input::placeholder,.uk-offcanvas-bar .uk-input::placeholder,.uk-overlay-primary .uk-input::placeholder,.uk-section-primary:not(.uk-preserve-color) .uk-input::placeholder,.uk-section-secondary:not(.uk-preserve-color) .uk-input::placeholder,.uk-tile-primary:not(.uk-preserve-color) .uk-input::placeholder,.uk-tile-secondary:not(.uk-preserve-color) .uk-input::placeholder{color:#ffffff80}.uk-card-primary.uk-card-body .uk-textarea::placeholder,.uk-card-primary>:not([class*=uk-card-media]) .uk-textarea::placeholder,.uk-card-secondary.uk-card-body .uk-textarea::placeholder,.uk-card-secondary>:not([class*=uk-card-media]) .uk-textarea::placeholder,.uk-light .uk-textarea::placeholder,.uk-offcanvas-bar .uk-textarea::placeholder,.uk-overlay-primary .uk-textarea::placeholder,.uk-section-primary:not(.uk-preserve-color) .uk-textarea::placeholder,.uk-section-secondary:not(.uk-preserve-color) .uk-textarea::placeholder,.uk-tile-primary:not(.uk-preserve-color) .uk-textarea::placeholder,.uk-tile-secondary:not(.uk-preserve-color) .uk-textarea::placeholder{color:#ffffff80}.uk-card-primary.uk-card-body .uk-select:not([multiple]):not([size]),.uk-card-primary>:not([class*=uk-card-media]) .uk-select:not([multiple]):not([size]),.uk-card-secondary.uk-card-body .uk-select:not([multiple]):not([size]),.uk-card-secondary>:not([class*=uk-card-media]) .uk-select:not([multiple]):not([size]),.uk-light .uk-select:not([multiple]):not([size]),.uk-offcanvas-bar .uk-select:not([multiple]):not([size]),.uk-overlay-primary .uk-select:not([multiple]):not([size]),.uk-section-primary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]),.uk-section-secondary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]),.uk-tile-primary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]),.uk-tile-secondary:not(.uk-preserve-color) .uk-select:not([multiple]):not([size]){background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20points%3D%2212%201%209%206%2015%206%22%20%2F%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20points%3D%2212%2013%209%208%2015%208%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-input[list]:focus,.uk-card-primary.uk-card-body .uk-input[list]:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-input[list]:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-input[list]:hover,.uk-card-secondary.uk-card-body .uk-input[list]:focus,.uk-card-secondary.uk-card-body .uk-input[list]:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input[list]:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-input[list]:hover,.uk-light .uk-input[list]:focus,.uk-light .uk-input[list]:hover,.uk-offcanvas-bar .uk-input[list]:focus,.uk-offcanvas-bar .uk-input[list]:hover,.uk-overlay-primary .uk-input[list]:focus,.uk-overlay-primary .uk-input[list]:hover,.uk-section-primary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-section-primary:not(.uk-preserve-color) .uk-input[list]:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-input[list]:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-input[list]:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-input[list]:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-input[list]:hover{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20points%3D%2212%2012%208%206%2016%206%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-checkbox,.uk-card-primary.uk-card-body .uk-radio,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio,.uk-card-secondary.uk-card-body .uk-checkbox,.uk-card-secondary.uk-card-body .uk-radio,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio,.uk-light .uk-checkbox,.uk-light .uk-radio,.uk-offcanvas-bar .uk-checkbox,.uk-offcanvas-bar .uk-radio,.uk-overlay-primary .uk-checkbox,.uk-overlay-primary .uk-radio,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox,.uk-section-primary:not(.uk-preserve-color) .uk-radio,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox,.uk-section-secondary:not(.uk-preserve-color) .uk-radio,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox,.uk-tile-primary:not(.uk-preserve-color) .uk-radio,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio{background-color:#ffffff1a;border-color:#fff3}.uk-card-primary.uk-card-body .uk-checkbox:focus,.uk-card-primary.uk-card-body .uk-radio:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:focus,.uk-card-secondary.uk-card-body .uk-checkbox:focus,.uk-card-secondary.uk-card-body .uk-radio:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:focus,.uk-light .uk-checkbox:focus,.uk-light .uk-radio:focus,.uk-offcanvas-bar .uk-checkbox:focus,.uk-offcanvas-bar .uk-radio:focus,.uk-overlay-primary .uk-checkbox:focus,.uk-overlay-primary .uk-radio:focus,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-section-primary:not(.uk-preserve-color) .uk-radio:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:focus{background-color:#ffffff26;border-color:#ffffffb3}.uk-card-primary.uk-card-body .uk-checkbox:checked,.uk-card-primary.uk-card-body .uk-checkbox:indeterminate,.uk-card-primary.uk-card-body .uk-radio:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-card-secondary.uk-card-body .uk-checkbox:checked,.uk-card-secondary.uk-card-body .uk-checkbox:indeterminate,.uk-card-secondary.uk-card-body .uk-radio:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-light .uk-checkbox:checked,.uk-light .uk-checkbox:indeterminate,.uk-light .uk-radio:checked,.uk-offcanvas-bar .uk-checkbox:checked,.uk-offcanvas-bar .uk-checkbox:indeterminate,.uk-offcanvas-bar .uk-radio:checked,.uk-overlay-primary .uk-checkbox:checked,.uk-overlay-primary .uk-checkbox:indeterminate,.uk-overlay-primary .uk-radio:checked,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-section-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:checked{background-color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-checkbox:checked:focus,.uk-card-primary.uk-card-body .uk-checkbox:indeterminate:focus,.uk-card-primary.uk-card-body .uk-radio:checked:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:checked:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:checked:focus,.uk-card-secondary.uk-card-body .uk-checkbox:checked:focus,.uk-card-secondary.uk-card-body .uk-checkbox:indeterminate:focus,.uk-card-secondary.uk-card-body .uk-radio:checked:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:checked:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:checked:focus,.uk-light .uk-checkbox:checked:focus,.uk-light .uk-checkbox:indeterminate:focus,.uk-light .uk-radio:checked:focus,.uk-offcanvas-bar .uk-checkbox:checked:focus,.uk-offcanvas-bar .uk-checkbox:indeterminate:focus,.uk-offcanvas-bar .uk-radio:checked:focus,.uk-overlay-primary .uk-checkbox:checked:focus,.uk-overlay-primary .uk-checkbox:indeterminate:focus,.uk-overlay-primary .uk-radio:checked:focus,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-section-primary:not(.uk-preserve-color) .uk-radio:checked:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:checked:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:checked:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:checked:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:checked:focus{background-color:#fff}.uk-card-primary.uk-card-body .uk-radio:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-card-secondary.uk-card-body .uk-radio:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-radio:checked,.uk-light .uk-radio:checked,.uk-offcanvas-bar .uk-radio:checked,.uk-overlay-primary .uk-radio:checked,.uk-section-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-radio:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-radio:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23666%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-checkbox:checked,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-card-secondary.uk-card-body .uk-checkbox:checked,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:checked,.uk-light .uk-checkbox:checked,.uk-offcanvas-bar .uk-checkbox:checked,.uk-overlay-primary .uk-checkbox:checked,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:checked,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:checked{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A)}.uk-card-primary.uk-card-body .uk-checkbox:indeterminate,.uk-card-primary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-card-secondary.uk-card-body .uk-checkbox:indeterminate,.uk-card-secondary>:not([class*=uk-card-media]) .uk-checkbox:indeterminate,.uk-light .uk-checkbox:indeterminate,.uk-offcanvas-bar .uk-checkbox:indeterminate,.uk-overlay-primary .uk-checkbox:indeterminate,.uk-section-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-section-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-primary:not(.uk-preserve-color) .uk-checkbox:indeterminate,.uk-tile-secondary:not(.uk-preserve-color) .uk-checkbox:indeterminate{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22%23666%22%20x%3D%223%22%20y%3D%228%22%20width%3D%2210%22%20height%3D%221%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-form-label,.uk-card-primary>:not([class*=uk-card-media]) .uk-form-label,.uk-card-secondary.uk-card-body .uk-form-label,.uk-card-secondary>:not([class*=uk-card-media]) .uk-form-label,.uk-light .uk-form-label,.uk-offcanvas-bar .uk-form-label,.uk-overlay-primary .uk-form-label,.uk-section-primary:not(.uk-preserve-color) .uk-form-label,.uk-section-secondary:not(.uk-preserve-color) .uk-form-label,.uk-tile-primary:not(.uk-preserve-color) .uk-form-label,.uk-tile-secondary:not(.uk-preserve-color) .uk-form-label{color:#fff}.uk-card-primary.uk-card-body .uk-form-icon,.uk-card-primary>:not([class*=uk-card-media]) .uk-form-icon,.uk-card-secondary.uk-card-body .uk-form-icon,.uk-card-secondary>:not([class*=uk-card-media]) .uk-form-icon,.uk-light .uk-form-icon,.uk-offcanvas-bar .uk-form-icon,.uk-overlay-primary .uk-form-icon,.uk-section-primary:not(.uk-preserve-color) .uk-form-icon,.uk-section-secondary:not(.uk-preserve-color) .uk-form-icon,.uk-tile-primary:not(.uk-preserve-color) .uk-form-icon,.uk-tile-secondary:not(.uk-preserve-color) .uk-form-icon{color:#ffffff80}.uk-card-primary.uk-card-body .uk-form-icon:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-form-icon:hover,.uk-card-secondary.uk-card-body .uk-form-icon:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-form-icon:hover,.uk-light .uk-form-icon:hover,.uk-offcanvas-bar .uk-form-icon:hover,.uk-overlay-primary .uk-form-icon:hover,.uk-section-primary:not(.uk-preserve-color) .uk-form-icon:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-form-icon:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-form-icon:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-form-icon:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-button-default,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default,.uk-card-secondary.uk-card-body .uk-button-default,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default,.uk-light .uk-button-default,.uk-offcanvas-bar .uk-button-default,.uk-overlay-primary .uk-button-default,.uk-section-primary:not(.uk-preserve-color) .uk-button-default,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default{background-color:transparent;color:#fff;border-color:#ffffffb3}.uk-card-primary.uk-card-body .uk-button-default:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default:hover,.uk-card-secondary.uk-card-body .uk-button-default:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default:hover,.uk-light .uk-button-default:hover,.uk-offcanvas-bar .uk-button-default:hover,.uk-overlay-primary .uk-button-default:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-default:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default:hover{background-color:transparent;color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-button-default.uk-active,.uk-card-primary.uk-card-body .uk-button-default:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-default:active,.uk-card-secondary.uk-card-body .uk-button-default.uk-active,.uk-card-secondary.uk-card-body .uk-button-default:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-default:active,.uk-light .uk-button-default.uk-active,.uk-light .uk-button-default:active,.uk-offcanvas-bar .uk-button-default.uk-active,.uk-offcanvas-bar .uk-button-default:active,.uk-overlay-primary .uk-button-default.uk-active,.uk-overlay-primary .uk-button-default:active,.uk-section-primary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-button-default:active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-default:active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-default:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-default:active{background-color:transparent;color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-button-primary,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary,.uk-card-secondary.uk-card-body .uk-button-primary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary,.uk-light .uk-button-primary,.uk-offcanvas-bar .uk-button-primary,.uk-overlay-primary .uk-button-primary,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-button-primary:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary:hover,.uk-card-secondary.uk-card-body .uk-button-primary:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary:hover,.uk-light .uk-button-primary:hover,.uk-offcanvas-bar .uk-button-primary:hover,.uk-overlay-primary .uk-button-primary:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary:hover{background-color:#f2f2f2;color:#666}.uk-card-primary.uk-card-body .uk-button-primary.uk-active,.uk-card-primary.uk-card-body .uk-button-primary:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-primary:active,.uk-card-secondary.uk-card-body .uk-button-primary.uk-active,.uk-card-secondary.uk-card-body .uk-button-primary:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-primary:active,.uk-light .uk-button-primary.uk-active,.uk-light .uk-button-primary:active,.uk-offcanvas-bar .uk-button-primary.uk-active,.uk-offcanvas-bar .uk-button-primary:active,.uk-overlay-primary .uk-button-primary.uk-active,.uk-overlay-primary .uk-button-primary:active,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-button-primary:active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-primary:active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-primary:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-primary:active{background-color:#e6e6e6;color:#666}.uk-card-primary.uk-card-body .uk-button-secondary,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary,.uk-card-secondary.uk-card-body .uk-button-secondary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary,.uk-light .uk-button-secondary,.uk-offcanvas-bar .uk-button-secondary,.uk-overlay-primary .uk-button-secondary,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-button-secondary:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary:hover,.uk-card-secondary.uk-card-body .uk-button-secondary:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary:hover,.uk-light .uk-button-secondary:hover,.uk-offcanvas-bar .uk-button-secondary:hover,.uk-overlay-primary .uk-button-secondary:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary:hover{background-color:#f2f2f2;color:#666}.uk-card-primary.uk-card-body .uk-button-secondary.uk-active,.uk-card-primary.uk-card-body .uk-button-secondary:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary.uk-active,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-secondary:active,.uk-card-secondary.uk-card-body .uk-button-secondary.uk-active,.uk-card-secondary.uk-card-body .uk-button-secondary:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary.uk-active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-secondary:active,.uk-light .uk-button-secondary.uk-active,.uk-light .uk-button-secondary:active,.uk-offcanvas-bar .uk-button-secondary.uk-active,.uk-offcanvas-bar .uk-button-secondary:active,.uk-overlay-primary .uk-button-secondary.uk-active,.uk-overlay-primary .uk-button-secondary:active,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-section-primary:not(.uk-preserve-color) .uk-button-secondary:active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-section-secondary:not(.uk-preserve-color) .uk-button-secondary:active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-tile-primary:not(.uk-preserve-color) .uk-button-secondary:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary.uk-active,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-secondary:active{background-color:#e6e6e6;color:#666}.uk-card-primary.uk-card-body .uk-button-text,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text,.uk-card-secondary.uk-card-body .uk-button-text,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text,.uk-light .uk-button-text,.uk-offcanvas-bar .uk-button-text,.uk-overlay-primary .uk-button-text,.uk-section-primary:not(.uk-preserve-color) .uk-button-text,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text{color:#fff}.uk-card-primary.uk-card-body .uk-button-text:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text:before,.uk-card-secondary.uk-card-body .uk-button-text:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text:before,.uk-light .uk-button-text:before,.uk-offcanvas-bar .uk-button-text:before,.uk-overlay-primary .uk-button-text:before,.uk-section-primary:not(.uk-preserve-color) .uk-button-text:before,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text:before,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text:before{border-bottom-color:#fff}.uk-card-primary.uk-card-body .uk-button-text:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text:hover,.uk-card-secondary.uk-card-body .uk-button-text:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text:hover,.uk-light .uk-button-text:hover,.uk-offcanvas-bar .uk-button-text:hover,.uk-overlay-primary .uk-button-text:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-text:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text:hover{color:#fff}.uk-card-primary.uk-card-body .uk-button-text:disabled,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-text:disabled,.uk-card-secondary.uk-card-body .uk-button-text:disabled,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-text:disabled,.uk-light .uk-button-text:disabled,.uk-offcanvas-bar .uk-button-text:disabled,.uk-overlay-primary .uk-button-text:disabled,.uk-section-primary:not(.uk-preserve-color) .uk-button-text:disabled,.uk-section-secondary:not(.uk-preserve-color) .uk-button-text:disabled,.uk-tile-primary:not(.uk-preserve-color) .uk-button-text:disabled,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-text:disabled{color:#ffffff80}.uk-card-primary.uk-card-body .uk-button-link,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-link,.uk-card-secondary.uk-card-body .uk-button-link,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-link,.uk-light .uk-button-link,.uk-offcanvas-bar .uk-button-link,.uk-overlay-primary .uk-button-link,.uk-section-primary:not(.uk-preserve-color) .uk-button-link,.uk-section-secondary:not(.uk-preserve-color) .uk-button-link,.uk-tile-primary:not(.uk-preserve-color) .uk-button-link,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-link{color:#fff}.uk-card-primary.uk-card-body .uk-button-link:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-button-link:hover,.uk-card-secondary.uk-card-body .uk-button-link:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-button-link:hover,.uk-light .uk-button-link:hover,.uk-offcanvas-bar .uk-button-link:hover,.uk-overlay-primary .uk-button-link:hover,.uk-section-primary:not(.uk-preserve-color) .uk-button-link:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-button-link:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-button-link:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-button-link:hover{color:#ffffff80}.uk-card-primary.uk-card-body.uk-card-badge,.uk-card-primary>:not([class*=uk-card-media]).uk-card-badge,.uk-card-secondary.uk-card-body.uk-card-badge,.uk-card-secondary>:not([class*=uk-card-media]).uk-card-badge,.uk-light.uk-card-badge,.uk-offcanvas-bar.uk-card-badge,.uk-overlay-primary.uk-card-badge,.uk-section-primary:not(.uk-preserve-color).uk-card-badge,.uk-section-secondary:not(.uk-preserve-color).uk-card-badge,.uk-tile-primary:not(.uk-preserve-color).uk-card-badge,.uk-tile-secondary:not(.uk-preserve-color).uk-card-badge{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-close,.uk-card-primary>:not([class*=uk-card-media]) .uk-close,.uk-card-secondary.uk-card-body .uk-close,.uk-card-secondary>:not([class*=uk-card-media]) .uk-close,.uk-light .uk-close,.uk-offcanvas-bar .uk-close,.uk-overlay-primary .uk-close,.uk-section-primary:not(.uk-preserve-color) .uk-close,.uk-section-secondary:not(.uk-preserve-color) .uk-close,.uk-tile-primary:not(.uk-preserve-color) .uk-close,.uk-tile-secondary:not(.uk-preserve-color) .uk-close{color:#ffffff80}.uk-card-primary.uk-card-body .uk-close:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-close:hover,.uk-card-secondary.uk-card-body .uk-close:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-close:hover,.uk-light .uk-close:hover,.uk-offcanvas-bar .uk-close:hover,.uk-overlay-primary .uk-close:hover,.uk-section-primary:not(.uk-preserve-color) .uk-close:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-close:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-close:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-close:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-totop,.uk-card-primary>:not([class*=uk-card-media]) .uk-totop,.uk-card-secondary.uk-card-body .uk-totop,.uk-card-secondary>:not([class*=uk-card-media]) .uk-totop,.uk-light .uk-totop,.uk-offcanvas-bar .uk-totop,.uk-overlay-primary .uk-totop,.uk-section-primary:not(.uk-preserve-color) .uk-totop,.uk-section-secondary:not(.uk-preserve-color) .uk-totop,.uk-tile-primary:not(.uk-preserve-color) .uk-totop,.uk-tile-secondary:not(.uk-preserve-color) .uk-totop{color:#ffffff80}.uk-card-primary.uk-card-body .uk-totop:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-totop:hover,.uk-card-secondary.uk-card-body .uk-totop:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-totop:hover,.uk-light .uk-totop:hover,.uk-offcanvas-bar .uk-totop:hover,.uk-overlay-primary .uk-totop:hover,.uk-section-primary:not(.uk-preserve-color) .uk-totop:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-totop:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-totop:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-totop:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-totop:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-totop:active,.uk-card-secondary.uk-card-body .uk-totop:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-totop:active,.uk-light .uk-totop:active,.uk-offcanvas-bar .uk-totop:active,.uk-overlay-primary .uk-totop:active,.uk-section-primary:not(.uk-preserve-color) .uk-totop:active,.uk-section-secondary:not(.uk-preserve-color) .uk-totop:active,.uk-tile-primary:not(.uk-preserve-color) .uk-totop:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-totop:active{color:#fff}.uk-card-primary.uk-card-body .uk-marker,.uk-card-primary>:not([class*=uk-card-media]) .uk-marker,.uk-card-secondary.uk-card-body .uk-marker,.uk-card-secondary>:not([class*=uk-card-media]) .uk-marker,.uk-light .uk-marker,.uk-offcanvas-bar .uk-marker,.uk-overlay-primary .uk-marker,.uk-section-primary:not(.uk-preserve-color) .uk-marker,.uk-section-secondary:not(.uk-preserve-color) .uk-marker,.uk-tile-primary:not(.uk-preserve-color) .uk-marker,.uk-tile-secondary:not(.uk-preserve-color) .uk-marker{background:#f8f8f8;color:#666}.uk-card-primary.uk-card-body .uk-marker:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-marker:hover,.uk-card-secondary.uk-card-body .uk-marker:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-marker:hover,.uk-light .uk-marker:hover,.uk-offcanvas-bar .uk-marker:hover,.uk-overlay-primary .uk-marker:hover,.uk-section-primary:not(.uk-preserve-color) .uk-marker:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-marker:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-marker:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-marker:hover{color:#666}.uk-card-primary.uk-card-body .uk-badge,.uk-card-primary>:not([class*=uk-card-media]) .uk-badge,.uk-card-secondary.uk-card-body .uk-badge,.uk-card-secondary>:not([class*=uk-card-media]) .uk-badge,.uk-light .uk-badge,.uk-offcanvas-bar .uk-badge,.uk-overlay-primary .uk-badge,.uk-section-primary:not(.uk-preserve-color) .uk-badge,.uk-section-secondary:not(.uk-preserve-color) .uk-badge,.uk-tile-primary:not(.uk-preserve-color) .uk-badge,.uk-tile-secondary:not(.uk-preserve-color) .uk-badge{background-color:#fff;color:#666!important}.uk-card-primary.uk-card-body .uk-label,.uk-card-primary>:not([class*=uk-card-media]) .uk-label,.uk-card-secondary.uk-card-body .uk-label,.uk-card-secondary>:not([class*=uk-card-media]) .uk-label,.uk-light .uk-label,.uk-offcanvas-bar .uk-label,.uk-overlay-primary .uk-label,.uk-section-primary:not(.uk-preserve-color) .uk-label,.uk-section-secondary:not(.uk-preserve-color) .uk-label,.uk-tile-primary:not(.uk-preserve-color) .uk-label,.uk-tile-secondary:not(.uk-preserve-color) .uk-label{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-article-meta,.uk-card-primary>:not([class*=uk-card-media]) .uk-article-meta,.uk-card-secondary.uk-card-body .uk-article-meta,.uk-card-secondary>:not([class*=uk-card-media]) .uk-article-meta,.uk-light .uk-article-meta,.uk-offcanvas-bar .uk-article-meta,.uk-overlay-primary .uk-article-meta,.uk-section-primary:not(.uk-preserve-color) .uk-article-meta,.uk-section-secondary:not(.uk-preserve-color) .uk-article-meta,.uk-tile-primary:not(.uk-preserve-color) .uk-article-meta,.uk-tile-secondary:not(.uk-preserve-color) .uk-article-meta{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-input,.uk-light .uk-search-input,.uk-offcanvas-bar .uk-search-input,.uk-overlay-primary .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-input{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-search-input::placeholder,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-input::placeholder,.uk-card-secondary.uk-card-body .uk-search-input::placeholder,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-input::placeholder,.uk-light .uk-search-input::placeholder,.uk-offcanvas-bar .uk-search-input::placeholder,.uk-overlay-primary .uk-search-input::placeholder,.uk-section-primary:not(.uk-preserve-color) .uk-search-input::placeholder,.uk-section-secondary:not(.uk-preserve-color) .uk-search-input::placeholder,.uk-tile-primary:not(.uk-preserve-color) .uk-search-input::placeholder,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-input::placeholder{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search .uk-search-icon,.uk-card-primary>:not([class*=uk-card-media]) .uk-search .uk-search-icon,.uk-card-secondary.uk-card-body .uk-search .uk-search-icon,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search .uk-search-icon,.uk-light .uk-search .uk-search-icon,.uk-offcanvas-bar .uk-search .uk-search-icon,.uk-overlay-primary .uk-search .uk-search-icon,.uk-section-primary:not(.uk-preserve-color) .uk-search .uk-search-icon,.uk-section-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon,.uk-tile-primary:not(.uk-preserve-color) .uk-search .uk-search-icon,.uk-tile-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search .uk-search-icon:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-search .uk-search-icon:hover,.uk-card-secondary.uk-card-body .uk-search .uk-search-icon:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search .uk-search-icon:hover,.uk-light .uk-search .uk-search-icon:hover,.uk-offcanvas-bar .uk-search .uk-search-icon:hover,.uk-overlay-primary .uk-search .uk-search-icon:hover,.uk-section-primary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-search .uk-search-icon:hover{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search-default .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-default .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input,.uk-light .uk-search-default .uk-search-input,.uk-offcanvas-bar .uk-search-default .uk-search-input,.uk-overlay-primary .uk-search-default .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input{background-color:transparent;border-color:#fff3}.uk-card-primary.uk-card-body .uk-search-default .uk-search-input:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input:focus,.uk-card-secondary.uk-card-body .uk-search-default .uk-search-input:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-default .uk-search-input:focus,.uk-light .uk-search-default .uk-search-input:focus,.uk-offcanvas-bar .uk-search-default .uk-search-input:focus,.uk-overlay-primary .uk-search-default .uk-search-input:focus,.uk-section-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-default .uk-search-input:focus{background-color:#0000000d}.uk-card-primary.uk-card-body .uk-search-navbar .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-navbar .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input,.uk-light .uk-search-navbar .uk-search-input,.uk-offcanvas-bar .uk-search-navbar .uk-search-input,.uk-overlay-primary .uk-search-navbar .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input{background-color:transparent;border-color:#fff3}.uk-card-primary.uk-card-body .uk-search-navbar .uk-search-input:focus,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input:focus,.uk-card-secondary.uk-card-body .uk-search-navbar .uk-search-input:focus,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-navbar .uk-search-input:focus,.uk-light .uk-search-navbar .uk-search-input:focus,.uk-offcanvas-bar .uk-search-navbar .uk-search-input:focus,.uk-overlay-primary .uk-search-navbar .uk-search-input:focus,.uk-section-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus,.uk-section-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus,.uk-tile-primary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-navbar .uk-search-input:focus{background-color:#0000000d}.uk-card-primary.uk-card-body .uk-search-medium .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-medium .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-medium .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-medium .uk-search-input,.uk-light .uk-search-medium .uk-search-input,.uk-offcanvas-bar .uk-search-medium .uk-search-input,.uk-overlay-primary .uk-search-medium .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-medium .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-medium .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-medium .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-medium .uk-search-input{background-color:transparent}.uk-card-primary.uk-card-body .uk-search-large .uk-search-input,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-large .uk-search-input,.uk-card-secondary.uk-card-body .uk-search-large .uk-search-input,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-large .uk-search-input,.uk-light .uk-search-large .uk-search-input,.uk-offcanvas-bar .uk-search-large .uk-search-input,.uk-overlay-primary .uk-search-large .uk-search-input,.uk-section-primary:not(.uk-preserve-color) .uk-search-large .uk-search-input,.uk-section-secondary:not(.uk-preserve-color) .uk-search-large .uk-search-input,.uk-tile-primary:not(.uk-preserve-color) .uk-search-large .uk-search-input,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-large .uk-search-input{background-color:transparent}.uk-card-primary.uk-card-body .uk-search-toggle,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-toggle,.uk-card-secondary.uk-card-body .uk-search-toggle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-toggle,.uk-light .uk-search-toggle,.uk-offcanvas-bar .uk-search-toggle,.uk-overlay-primary .uk-search-toggle,.uk-section-primary:not(.uk-preserve-color) .uk-search-toggle,.uk-section-secondary:not(.uk-preserve-color) .uk-search-toggle,.uk-tile-primary:not(.uk-preserve-color) .uk-search-toggle,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-toggle{color:#ffffff80}.uk-card-primary.uk-card-body .uk-search-toggle:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-search-toggle:hover,.uk-card-secondary.uk-card-body .uk-search-toggle:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-search-toggle:hover,.uk-light .uk-search-toggle:hover,.uk-offcanvas-bar .uk-search-toggle:hover,.uk-overlay-primary .uk-search-toggle:hover,.uk-section-primary:not(.uk-preserve-color) .uk-search-toggle:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-search-toggle:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-search-toggle:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-search-toggle:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-accordion-title,.uk-card-primary>:not([class*=uk-card-media]) .uk-accordion-title,.uk-card-secondary.uk-card-body .uk-accordion-title,.uk-card-secondary>:not([class*=uk-card-media]) .uk-accordion-title,.uk-light .uk-accordion-title,.uk-offcanvas-bar .uk-accordion-title,.uk-overlay-primary .uk-accordion-title,.uk-section-primary:not(.uk-preserve-color) .uk-accordion-title,.uk-section-secondary:not(.uk-preserve-color) .uk-accordion-title,.uk-tile-primary:not(.uk-preserve-color) .uk-accordion-title,.uk-tile-secondary:not(.uk-preserve-color) .uk-accordion-title{color:#fff}.uk-card-primary.uk-card-body .uk-accordion-title:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-accordion-title:hover,.uk-card-secondary.uk-card-body .uk-accordion-title:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-accordion-title:hover,.uk-light .uk-accordion-title:hover,.uk-offcanvas-bar .uk-accordion-title:hover,.uk-overlay-primary .uk-accordion-title:hover,.uk-section-primary:not(.uk-preserve-color) .uk-accordion-title:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-accordion-title:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-accordion-title:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-accordion-title:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-thumbnav>*>:after,.uk-card-primary>:not([class*=uk-card-media]) .uk-thumbnav>*>:after,.uk-card-secondary.uk-card-body .uk-thumbnav>*>:after,.uk-card-secondary>:not([class*=uk-card-media]) .uk-thumbnav>*>:after,.uk-light .uk-thumbnav>*>:after,.uk-offcanvas-bar .uk-thumbnav>*>:after,.uk-overlay-primary .uk-thumbnav>*>:after,.uk-section-primary:not(.uk-preserve-color) .uk-thumbnav>*>:after,.uk-section-secondary:not(.uk-preserve-color) .uk-thumbnav>*>:after,.uk-tile-primary:not(.uk-preserve-color) .uk-thumbnav>*>:after,.uk-tile-secondary:not(.uk-preserve-color) .uk-thumbnav>*>:after{background-image:linear-gradient(180deg,#0000,#0006)}.uk-card-primary.uk-card-body .uk-iconnav>*>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-iconnav>*>a,.uk-card-secondary.uk-card-body .uk-iconnav>*>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-iconnav>*>a,.uk-light .uk-iconnav>*>a,.uk-offcanvas-bar .uk-iconnav>*>a,.uk-overlay-primary .uk-iconnav>*>a,.uk-section-primary:not(.uk-preserve-color) .uk-iconnav>*>a,.uk-section-secondary:not(.uk-preserve-color) .uk-iconnav>*>a,.uk-tile-primary:not(.uk-preserve-color) .uk-iconnav>*>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-iconnav>*>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-iconnav>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-iconnav>*>a:hover,.uk-card-secondary.uk-card-body .uk-iconnav>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-iconnav>*>a:hover,.uk-light .uk-iconnav>*>a:hover,.uk-offcanvas-bar .uk-iconnav>*>a:hover,.uk-overlay-primary .uk-iconnav>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-iconnav>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-iconnav>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-iconnav>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-iconnav>*>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-iconnav>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-iconnav>.uk-active>a,.uk-card-secondary.uk-card-body .uk-iconnav>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-iconnav>.uk-active>a,.uk-light .uk-iconnav>.uk-active>a,.uk-offcanvas-bar .uk-iconnav>.uk-active>a,.uk-overlay-primary .uk-iconnav>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-iconnav>.uk-active>a{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-grid-divider>:not(.uk-first-column):before,.uk-card-primary>:not([class*=uk-card-media]) .uk-grid-divider>:not(.uk-first-column):before,.uk-card-secondary.uk-card-body .uk-grid-divider>:not(.uk-first-column):before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-grid-divider>:not(.uk-first-column):before,.uk-light .uk-grid-divider>:not(.uk-first-column):before,.uk-offcanvas-bar .uk-grid-divider>:not(.uk-first-column):before,.uk-overlay-primary .uk-grid-divider>:not(.uk-first-column):before,.uk-section-primary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before,.uk-section-secondary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before,.uk-tile-primary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before,.uk-tile-secondary:not(.uk-preserve-color) .uk-grid-divider>:not(.uk-first-column):before{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-card-secondary.uk-card-body .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-light .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-offcanvas-bar .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-overlay-primary .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-section-primary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-section-secondary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-tile-primary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-grid-divider.uk-grid-stack>.uk-grid-margin:before{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-default>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default>li>a,.uk-card-secondary.uk-card-body .uk-nav-default>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default>li>a,.uk-light .uk-nav-default>li>a,.uk-offcanvas-bar .uk-nav-default>li>a,.uk-overlay-primary .uk-nav-default>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default>li>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-default>li>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default>li>a:hover,.uk-card-secondary.uk-card-body .uk-nav-default>li>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default>li>a:hover,.uk-light .uk-nav-default>li>a:hover,.uk-offcanvas-bar .uk-nav-default>li>a:hover,.uk-overlay-primary .uk-nav-default>li>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default>li>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default>li>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default>li>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default>li>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-default>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-default>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default>li.uk-active>a,.uk-light .uk-nav-default>li.uk-active>a,.uk-offcanvas-bar .uk-nav-default>li.uk-active>a,.uk-overlay-primary .uk-nav-default>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default>li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-header,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-header,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-header,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-header,.uk-light .uk-nav-default .uk-nav-header,.uk-offcanvas-bar .uk-nav-default .uk-nav-header,.uk-overlay-primary .uk-nav-default .uk-nav-header,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-header{color:#fff}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-divider,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-divider,.uk-light .uk-nav-default .uk-nav-divider,.uk-offcanvas-bar .uk-nav-default .uk-nav-divider,.uk-overlay-primary .uk-nav-default .uk-nav-divider,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-divider{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-sub a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-sub a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a,.uk-light .uk-nav-default .uk-nav-sub a,.uk-offcanvas-bar .uk-nav-default .uk-nav-sub a,.uk-overlay-primary .uk-nav-default .uk-nav-sub a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-sub a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a:hover,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-sub a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub a:hover,.uk-light .uk-nav-default .uk-nav-sub a:hover,.uk-offcanvas-bar .uk-nav-default .uk-nav-sub a:hover,.uk-overlay-primary .uk-nav-default .uk-nav-sub a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-light .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-offcanvas-bar .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-overlay-primary .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-default .uk-nav-sub li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-primary>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary>li>a,.uk-card-secondary.uk-card-body .uk-nav-primary>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary>li>a,.uk-light .uk-nav-primary>li>a,.uk-offcanvas-bar .uk-nav-primary>li>a,.uk-overlay-primary .uk-nav-primary>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-primary>li>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary>li>a:hover,.uk-card-secondary.uk-card-body .uk-nav-primary>li>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary>li>a:hover,.uk-light .uk-nav-primary>li>a:hover,.uk-offcanvas-bar .uk-nav-primary>li>a:hover,.uk-overlay-primary .uk-nav-primary>li>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary>li>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-primary>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-primary>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary>li.uk-active>a,.uk-light .uk-nav-primary>li.uk-active>a,.uk-offcanvas-bar .uk-nav-primary>li.uk-active>a,.uk-overlay-primary .uk-nav-primary>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary>li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-header,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-header,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-header,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-header,.uk-light .uk-nav-primary .uk-nav-header,.uk-offcanvas-bar .uk-nav-primary .uk-nav-header,.uk-overlay-primary .uk-nav-primary .uk-nav-header,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-header{color:#fff}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-divider,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-divider,.uk-light .uk-nav-primary .uk-nav-divider,.uk-offcanvas-bar .uk-nav-primary .uk-nav-divider,.uk-overlay-primary .uk-nav-primary .uk-nav-divider,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-divider{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-sub a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-sub a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a,.uk-light .uk-nav-primary .uk-nav-sub a,.uk-offcanvas-bar .uk-nav-primary .uk-nav-sub a,.uk-overlay-primary .uk-nav-primary .uk-nav-sub a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-sub a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a:hover,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-sub a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub a:hover,.uk-light .uk-nav-primary .uk-nav-sub a:hover,.uk-offcanvas-bar .uk-nav-primary .uk-nav-sub a:hover,.uk-overlay-primary .uk-nav-primary .uk-nav-sub a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-light .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-offcanvas-bar .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-overlay-primary .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-primary .uk-nav-sub li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a,.uk-card-secondary.uk-card-body .uk-nav-secondary>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a,.uk-light .uk-nav-secondary>li>a,.uk-offcanvas-bar .uk-nav-secondary>li>a,.uk-overlay-primary .uk-nav-secondary>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary>li>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover,.uk-card-secondary.uk-card-body .uk-nav-secondary>li>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover,.uk-light .uk-nav-secondary>li>a:hover,.uk-offcanvas-bar .uk-nav-secondary>li>a:hover,.uk-overlay-primary .uk-nav-secondary>li>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover{color:#fff;background-color:#ffffff1a}.uk-card-primary.uk-card-body .uk-nav-secondary>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-secondary>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a,.uk-light .uk-nav-secondary>li.uk-active>a,.uk-offcanvas-bar .uk-nav-secondary>li.uk-active>a,.uk-overlay-primary .uk-nav-secondary>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a{color:#fff;background-color:#ffffff1a}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-subtitle,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-subtitle,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-subtitle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-subtitle,.uk-light .uk-nav-secondary .uk-nav-subtitle,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-subtitle,.uk-overlay-primary .uk-nav-secondary .uk-nav-subtitle,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-subtitle{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-card-secondary.uk-card-body .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-light .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-offcanvas-bar .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-overlay-primary .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li>a:hover .uk-nav-subtitle{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-card-secondary.uk-card-body .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-light .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-offcanvas-bar .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-overlay-primary .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary>li.uk-active>a .uk-nav-subtitle{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-header,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-header,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-header,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-header,.uk-light .uk-nav-secondary .uk-nav-header,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-header,.uk-overlay-primary .uk-nav-secondary .uk-nav-header,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-header{color:#fff}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-divider,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-divider,.uk-light .uk-nav-secondary .uk-nav-divider,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-divider,.uk-overlay-primary .uk-nav-secondary .uk-nav-divider,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-divider{border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-sub a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-sub a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a,.uk-light .uk-nav-secondary .uk-nav-sub a,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-sub a,.uk-overlay-primary .uk-nav-secondary .uk-nav-sub a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-sub a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a:hover,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-sub a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub a:hover,.uk-light .uk-nav-secondary .uk-nav-sub a:hover,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-sub a:hover,.uk-overlay-primary .uk-nav-secondary .uk-nav-sub a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-card-secondary.uk-card-body .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-light .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-offcanvas-bar .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-overlay-primary .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-nav-secondary .uk-nav-sub li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-card-primary>:not([class*=uk-card-media]) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-card-secondary.uk-card-body .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-card-secondary>:not([class*=uk-card-media]) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-light .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-offcanvas-bar .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-overlay-primary .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-section-primary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-section-secondary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-tile-primary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider),.uk-tile-secondary:not(.uk-preserve-color) .uk-nav.uk-nav-divider>:not(.uk-nav-divider)+:not(.uk-nav-header,.uk-nav-divider){border-top-color:#fff3}.uk-card-primary.uk-card-body .uk-navbar-nav>li>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a,.uk-card-secondary.uk-card-body .uk-navbar-nav>li>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a,.uk-light .uk-navbar-nav>li>a,.uk-offcanvas-bar .uk-navbar-nav>li>a,.uk-overlay-primary .uk-navbar-nav>li>a,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-navbar-nav>li:hover>a,.uk-card-primary.uk-card-body .uk-navbar-nav>li>a[aria-expanded=true],.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li:hover>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a[aria-expanded=true],.uk-card-secondary.uk-card-body .uk-navbar-nav>li:hover>a,.uk-card-secondary.uk-card-body .uk-navbar-nav>li>a[aria-expanded=true],.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li:hover>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a[aria-expanded=true],.uk-light .uk-navbar-nav>li:hover>a,.uk-light .uk-navbar-nav>li>a[aria-expanded=true],.uk-offcanvas-bar .uk-navbar-nav>li:hover>a,.uk-offcanvas-bar .uk-navbar-nav>li>a[aria-expanded=true],.uk-overlay-primary .uk-navbar-nav>li:hover>a,.uk-overlay-primary .uk-navbar-nav>li>a[aria-expanded=true],.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true],.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true],.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true],.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li:hover>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a[aria-expanded=true]{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-navbar-nav>li>a:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a:active,.uk-card-secondary.uk-card-body .uk-navbar-nav>li>a:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li>a:active,.uk-light .uk-navbar-nav>li>a:active,.uk-offcanvas-bar .uk-navbar-nav>li>a:active,.uk-overlay-primary .uk-navbar-nav>li>a:active,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li>a:active{color:#fff}.uk-card-primary.uk-card-body .uk-navbar-nav>li.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-nav>li.uk-active>a,.uk-card-secondary.uk-card-body .uk-navbar-nav>li.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-nav>li.uk-active>a,.uk-light .uk-navbar-nav>li.uk-active>a,.uk-offcanvas-bar .uk-navbar-nav>li.uk-active>a,.uk-overlay-primary .uk-navbar-nav>li.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-nav>li.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-navbar-item,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-item,.uk-card-secondary.uk-card-body .uk-navbar-item,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-item,.uk-light .uk-navbar-item,.uk-offcanvas-bar .uk-navbar-item,.uk-overlay-primary .uk-navbar-item,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-item,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-item,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-item,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-item{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-navbar-toggle,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-toggle,.uk-card-secondary.uk-card-body .uk-navbar-toggle,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-toggle,.uk-light .uk-navbar-toggle,.uk-offcanvas-bar .uk-navbar-toggle,.uk-overlay-primary .uk-navbar-toggle,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-toggle,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-toggle,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-toggle,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-toggle{color:#ffffff80}.uk-card-primary.uk-card-body .uk-navbar-toggle:hover,.uk-card-primary.uk-card-body .uk-navbar-toggle[aria-expanded=true],.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-toggle:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-navbar-toggle[aria-expanded=true],.uk-card-secondary.uk-card-body .uk-navbar-toggle:hover,.uk-card-secondary.uk-card-body .uk-navbar-toggle[aria-expanded=true],.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-toggle:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-navbar-toggle[aria-expanded=true],.uk-light .uk-navbar-toggle:hover,.uk-light .uk-navbar-toggle[aria-expanded=true],.uk-offcanvas-bar .uk-navbar-toggle:hover,.uk-offcanvas-bar .uk-navbar-toggle[aria-expanded=true],.uk-overlay-primary .uk-navbar-toggle:hover,.uk-overlay-primary .uk-navbar-toggle[aria-expanded=true],.uk-section-primary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-section-primary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true],.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true],.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true],.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-toggle:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-navbar-toggle[aria-expanded=true]{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav>*>:first-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>*>:first-child,.uk-card-secondary.uk-card-body .uk-subnav>*>:first-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>*>:first-child,.uk-light .uk-subnav>*>:first-child,.uk-offcanvas-bar .uk-subnav>*>:first-child,.uk-overlay-primary .uk-subnav>*>:first-child,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>*>:first-child,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>*>:first-child,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>*>:first-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>*>:first-child{color:#ffffff80}.uk-card-primary.uk-card-body .uk-subnav>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>*>a:hover,.uk-card-secondary.uk-card-body .uk-subnav>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>*>a:hover,.uk-light .uk-subnav>*>a:hover,.uk-offcanvas-bar .uk-subnav>*>a:hover,.uk-overlay-primary .uk-subnav>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>*>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>.uk-active>a,.uk-card-secondary.uk-card-body .uk-subnav>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>.uk-active>a,.uk-light .uk-subnav>.uk-active>a,.uk-offcanvas-bar .uk-subnav>.uk-active>a,.uk-overlay-primary .uk-subnav>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>.uk-active>a{color:#fff}.uk-card-primary.uk-card-body .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary.uk-card-body .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-light .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-offcanvas-bar .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-overlay-primary .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-divider>:nth-child(n+2):not(.uk-first-column):before{border-left-color:#fff3}.uk-card-primary.uk-card-body .uk-subnav-pill>*>:first-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>*>:first-child,.uk-card-secondary.uk-card-body .uk-subnav-pill>*>:first-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>*>:first-child,.uk-light .uk-subnav-pill>*>:first-child,.uk-offcanvas-bar .uk-subnav-pill>*>:first-child,.uk-overlay-primary .uk-subnav-pill>*>:first-child,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>:first-child{background-color:transparent;color:#ffffff80}.uk-card-primary.uk-card-body .uk-subnav-pill>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:hover,.uk-card-secondary.uk-card-body .uk-subnav-pill>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:hover,.uk-light .uk-subnav-pill>*>a:hover,.uk-offcanvas-bar .uk-subnav-pill>*>a:hover,.uk-overlay-primary .uk-subnav-pill>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:hover{background-color:#ffffff1a;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav-pill>*>a:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:active,.uk-card-secondary.uk-card-body .uk-subnav-pill>*>a:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>*>a:active,.uk-light .uk-subnav-pill>*>a:active,.uk-offcanvas-bar .uk-subnav-pill>*>a:active,.uk-overlay-primary .uk-subnav-pill>*>a:active,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>*>a:active{background-color:#ffffff1a;color:#ffffffb3}.uk-card-primary.uk-card-body .uk-subnav-pill>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav-pill>.uk-active>a,.uk-card-secondary.uk-card-body .uk-subnav-pill>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav-pill>.uk-active>a,.uk-light .uk-subnav-pill>.uk-active>a,.uk-offcanvas-bar .uk-subnav-pill>.uk-active>a,.uk-overlay-primary .uk-subnav-pill>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav-pill>.uk-active>a{background-color:#fff;color:#666}.uk-card-primary.uk-card-body .uk-subnav>.uk-disabled>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-subnav>.uk-disabled>a,.uk-card-secondary.uk-card-body .uk-subnav>.uk-disabled>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-subnav>.uk-disabled>a,.uk-light .uk-subnav>.uk-disabled>a,.uk-offcanvas-bar .uk-subnav>.uk-disabled>a,.uk-overlay-primary .uk-subnav>.uk-disabled>a,.uk-section-primary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a,.uk-section-secondary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a,.uk-tile-primary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-subnav>.uk-disabled>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-breadcrumb>*>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>*>*,.uk-card-secondary.uk-card-body .uk-breadcrumb>*>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>*>*,.uk-light .uk-breadcrumb>*>*,.uk-offcanvas-bar .uk-breadcrumb>*>*,.uk-overlay-primary .uk-breadcrumb>*>*,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>*>*,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>*,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>*>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>*{color:#ffffff80}.uk-card-primary.uk-card-body .uk-breadcrumb>*>:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>*>:hover,.uk-card-secondary.uk-card-body .uk-breadcrumb>*>:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>*>:hover,.uk-light .uk-breadcrumb>*>:hover,.uk-offcanvas-bar .uk-breadcrumb>*>:hover,.uk-overlay-primary .uk-breadcrumb>*>:hover,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>*>:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-breadcrumb>:last-child>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>:last-child>*,.uk-card-secondary.uk-card-body .uk-breadcrumb>:last-child>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>:last-child>*,.uk-light .uk-breadcrumb>:last-child>*,.uk-offcanvas-bar .uk-breadcrumb>:last-child>*,.uk-overlay-primary .uk-breadcrumb>:last-child>*,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>:last-child>*{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-card-primary>:not([class*=uk-card-media]) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary.uk-card-body .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-light .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-offcanvas-bar .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-overlay-primary .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-section-primary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-section-secondary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-primary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before,.uk-tile-secondary:not(.uk-preserve-color) .uk-breadcrumb>:nth-child(n+2):not(.uk-first-column):before{color:#ffffff80}.uk-card-primary.uk-card-body .uk-pagination>*>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>*>*,.uk-card-secondary.uk-card-body .uk-pagination>*>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>*>*,.uk-light .uk-pagination>*>*,.uk-offcanvas-bar .uk-pagination>*>*,.uk-overlay-primary .uk-pagination>*>*,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>*>*,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>*>*,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>*>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>*>*{color:#ffffff80}.uk-card-primary.uk-card-body .uk-pagination>*>:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>*>:hover,.uk-card-secondary.uk-card-body .uk-pagination>*>:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>*>:hover,.uk-light .uk-pagination>*>:hover,.uk-offcanvas-bar .uk-pagination>*>:hover,.uk-overlay-primary .uk-pagination>*>:hover,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>*>:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>*>:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>*>:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>*>:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-pagination>.uk-active>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>.uk-active>*,.uk-card-secondary.uk-card-body .uk-pagination>.uk-active>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>.uk-active>*,.uk-light .uk-pagination>.uk-active>*,.uk-offcanvas-bar .uk-pagination>.uk-active>*,.uk-overlay-primary .uk-pagination>.uk-active>*,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>.uk-active>*,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>.uk-active>*,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>.uk-active>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>.uk-active>*{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-pagination>.uk-disabled>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-pagination>.uk-disabled>*,.uk-card-secondary.uk-card-body .uk-pagination>.uk-disabled>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-pagination>.uk-disabled>*,.uk-light .uk-pagination>.uk-disabled>*,.uk-offcanvas-bar .uk-pagination>.uk-disabled>*,.uk-overlay-primary .uk-pagination>.uk-disabled>*,.uk-section-primary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*,.uk-section-secondary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*,.uk-tile-primary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-pagination>.uk-disabled>*{color:#ffffff80}.uk-card-primary.uk-card-body .uk-tab:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab:before,.uk-card-secondary.uk-card-body .uk-tab:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab:before,.uk-light .uk-tab:before,.uk-offcanvas-bar .uk-tab:before,.uk-overlay-primary .uk-tab:before,.uk-section-primary:not(.uk-preserve-color) .uk-tab:before,.uk-section-secondary:not(.uk-preserve-color) .uk-tab:before,.uk-tile-primary:not(.uk-preserve-color) .uk-tab:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab:before{border-color:#fff3}.uk-card-primary.uk-card-body .uk-tab>*>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>*>a,.uk-card-secondary.uk-card-body .uk-tab>*>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>*>a,.uk-light .uk-tab>*>a,.uk-offcanvas-bar .uk-tab>*>a,.uk-overlay-primary .uk-tab>*>a,.uk-section-primary:not(.uk-preserve-color) .uk-tab>*>a,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>*>a,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>*>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>*>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-tab>*>a:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>*>a:hover,.uk-card-secondary.uk-card-body .uk-tab>*>a:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>*>a:hover,.uk-light .uk-tab>*>a:hover,.uk-offcanvas-bar .uk-tab>*>a:hover,.uk-overlay-primary .uk-tab>*>a:hover,.uk-section-primary:not(.uk-preserve-color) .uk-tab>*>a:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>*>a:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>*>a:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>*>a:hover{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-tab>.uk-active>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>.uk-active>a,.uk-card-secondary.uk-card-body .uk-tab>.uk-active>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>.uk-active>a,.uk-light .uk-tab>.uk-active>a,.uk-offcanvas-bar .uk-tab>.uk-active>a,.uk-overlay-primary .uk-tab>.uk-active>a,.uk-section-primary:not(.uk-preserve-color) .uk-tab>.uk-active>a,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>.uk-active>a,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>.uk-active>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>.uk-active>a{color:#fff;border-color:#fff}.uk-card-primary.uk-card-body .uk-tab>.uk-disabled>a,.uk-card-primary>:not([class*=uk-card-media]) .uk-tab>.uk-disabled>a,.uk-card-secondary.uk-card-body .uk-tab>.uk-disabled>a,.uk-card-secondary>:not([class*=uk-card-media]) .uk-tab>.uk-disabled>a,.uk-light .uk-tab>.uk-disabled>a,.uk-offcanvas-bar .uk-tab>.uk-disabled>a,.uk-overlay-primary .uk-tab>.uk-disabled>a,.uk-section-primary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a,.uk-section-secondary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a,.uk-tile-primary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a,.uk-tile-secondary:not(.uk-preserve-color) .uk-tab>.uk-disabled>a{color:#ffffff80}.uk-card-primary.uk-card-body .uk-slidenav,.uk-card-primary>:not([class*=uk-card-media]) .uk-slidenav,.uk-card-secondary.uk-card-body .uk-slidenav,.uk-card-secondary>:not([class*=uk-card-media]) .uk-slidenav,.uk-light .uk-slidenav,.uk-offcanvas-bar .uk-slidenav,.uk-overlay-primary .uk-slidenav,.uk-section-primary:not(.uk-preserve-color) .uk-slidenav,.uk-section-secondary:not(.uk-preserve-color) .uk-slidenav,.uk-tile-primary:not(.uk-preserve-color) .uk-slidenav,.uk-tile-secondary:not(.uk-preserve-color) .uk-slidenav{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-slidenav:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-slidenav:hover,.uk-card-secondary.uk-card-body .uk-slidenav:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-slidenav:hover,.uk-light .uk-slidenav:hover,.uk-offcanvas-bar .uk-slidenav:hover,.uk-overlay-primary .uk-slidenav:hover,.uk-section-primary:not(.uk-preserve-color) .uk-slidenav:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-slidenav:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-slidenav:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-slidenav:hover{color:#fffffff2}.uk-card-primary.uk-card-body .uk-slidenav:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-slidenav:active,.uk-card-secondary.uk-card-body .uk-slidenav:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-slidenav:active,.uk-light .uk-slidenav:active,.uk-offcanvas-bar .uk-slidenav:active,.uk-overlay-primary .uk-slidenav:active,.uk-section-primary:not(.uk-preserve-color) .uk-slidenav:active,.uk-section-secondary:not(.uk-preserve-color) .uk-slidenav:active,.uk-tile-primary:not(.uk-preserve-color) .uk-slidenav:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-slidenav:active{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-dotnav>*>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>*>*,.uk-card-secondary.uk-card-body .uk-dotnav>*>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>*>*,.uk-light .uk-dotnav>*>*,.uk-offcanvas-bar .uk-dotnav>*>*,.uk-overlay-primary .uk-dotnav>*>*,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>*>*,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>*>*,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>*>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>*>*{background-color:transparent;border-color:#ffffffe6}.uk-card-primary.uk-card-body .uk-dotnav>*>:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>*>:hover,.uk-card-secondary.uk-card-body .uk-dotnav>*>:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>*>:hover,.uk-light .uk-dotnav>*>:hover,.uk-offcanvas-bar .uk-dotnav>*>:hover,.uk-overlay-primary .uk-dotnav>*>:hover,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>*>:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>*>:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>*>:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>*>:hover{background-color:#ffffffe6;border-color:transparent}.uk-card-primary.uk-card-body .uk-dotnav>*>:active,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>*>:active,.uk-card-secondary.uk-card-body .uk-dotnav>*>:active,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>*>:active,.uk-light .uk-dotnav>*>:active,.uk-offcanvas-bar .uk-dotnav>*>:active,.uk-overlay-primary .uk-dotnav>*>:active,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>*>:active,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>*>:active,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>*>:active,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>*>:active{background-color:#ffffff80;border-color:transparent}.uk-card-primary.uk-card-body .uk-dotnav>.uk-active>*,.uk-card-primary>:not([class*=uk-card-media]) .uk-dotnav>.uk-active>*,.uk-card-secondary.uk-card-body .uk-dotnav>.uk-active>*,.uk-card-secondary>:not([class*=uk-card-media]) .uk-dotnav>.uk-active>*,.uk-light .uk-dotnav>.uk-active>*,.uk-offcanvas-bar .uk-dotnav>.uk-active>*,.uk-overlay-primary .uk-dotnav>.uk-active>*,.uk-section-primary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*,.uk-section-secondary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*,.uk-tile-primary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*,.uk-tile-secondary:not(.uk-preserve-color) .uk-dotnav>.uk-active>*{background-color:#ffffffe6;border-color:transparent}.uk-card-primary.uk-card-body .uk-text-lead,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-lead,.uk-card-secondary.uk-card-body .uk-text-lead,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-lead,.uk-light .uk-text-lead,.uk-offcanvas-bar .uk-text-lead,.uk-overlay-primary .uk-text-lead,.uk-section-primary:not(.uk-preserve-color) .uk-text-lead,.uk-section-secondary:not(.uk-preserve-color) .uk-text-lead,.uk-tile-primary:not(.uk-preserve-color) .uk-text-lead,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-lead{color:#ffffffb3}.uk-card-primary.uk-card-body .uk-text-meta,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-meta,.uk-card-secondary.uk-card-body .uk-text-meta,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-meta,.uk-light .uk-text-meta,.uk-offcanvas-bar .uk-text-meta,.uk-overlay-primary .uk-text-meta,.uk-section-primary:not(.uk-preserve-color) .uk-text-meta,.uk-section-secondary:not(.uk-preserve-color) .uk-text-meta,.uk-tile-primary:not(.uk-preserve-color) .uk-text-meta,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-meta{color:#ffffff80}.uk-card-primary.uk-card-body .uk-text-muted,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-muted,.uk-card-secondary.uk-card-body .uk-text-muted,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-muted,.uk-light .uk-text-muted,.uk-offcanvas-bar .uk-text-muted,.uk-overlay-primary .uk-text-muted,.uk-section-primary:not(.uk-preserve-color) .uk-text-muted,.uk-section-secondary:not(.uk-preserve-color) .uk-text-muted,.uk-tile-primary:not(.uk-preserve-color) .uk-text-muted,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-muted{color:#ffffff80!important}.uk-card-primary.uk-card-body .uk-text-emphasis,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-emphasis,.uk-card-secondary.uk-card-body .uk-text-emphasis,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-emphasis,.uk-light .uk-text-emphasis,.uk-offcanvas-bar .uk-text-emphasis,.uk-overlay-primary .uk-text-emphasis,.uk-section-primary:not(.uk-preserve-color) .uk-text-emphasis,.uk-section-secondary:not(.uk-preserve-color) .uk-text-emphasis,.uk-tile-primary:not(.uk-preserve-color) .uk-text-emphasis,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-emphasis{color:#fff!important}.uk-card-primary.uk-card-body .uk-text-primary,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-primary,.uk-card-secondary.uk-card-body .uk-text-primary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-primary,.uk-light .uk-text-primary,.uk-offcanvas-bar .uk-text-primary,.uk-overlay-primary .uk-text-primary,.uk-section-primary:not(.uk-preserve-color) .uk-text-primary,.uk-section-secondary:not(.uk-preserve-color) .uk-text-primary,.uk-tile-primary:not(.uk-preserve-color) .uk-text-primary,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-primary{color:#fff!important}.uk-card-primary.uk-card-body .uk-text-secondary,.uk-card-primary>:not([class*=uk-card-media]) .uk-text-secondary,.uk-card-secondary.uk-card-body .uk-text-secondary,.uk-card-secondary>:not([class*=uk-card-media]) .uk-text-secondary,.uk-light .uk-text-secondary,.uk-offcanvas-bar .uk-text-secondary,.uk-overlay-primary .uk-text-secondary,.uk-section-primary:not(.uk-preserve-color) .uk-text-secondary,.uk-section-secondary:not(.uk-preserve-color) .uk-text-secondary,.uk-tile-primary:not(.uk-preserve-color) .uk-text-secondary,.uk-tile-secondary:not(.uk-preserve-color) .uk-text-secondary{color:#fff!important}.uk-card-primary.uk-card-body .uk-column-divider,.uk-card-primary>:not([class*=uk-card-media]) .uk-column-divider,.uk-card-secondary.uk-card-body .uk-column-divider,.uk-card-secondary>:not([class*=uk-card-media]) .uk-column-divider,.uk-light .uk-column-divider,.uk-offcanvas-bar .uk-column-divider,.uk-overlay-primary .uk-column-divider,.uk-section-primary:not(.uk-preserve-color) .uk-column-divider,.uk-section-secondary:not(.uk-preserve-color) .uk-column-divider,.uk-tile-primary:not(.uk-preserve-color) .uk-column-divider,.uk-tile-secondary:not(.uk-preserve-color) .uk-column-divider{column-rule-color:#fff3}.uk-card-primary.uk-card-body .uk-logo,.uk-card-primary>:not([class*=uk-card-media]) .uk-logo,.uk-card-secondary.uk-card-body .uk-logo,.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo,.uk-light .uk-logo,.uk-offcanvas-bar .uk-logo,.uk-overlay-primary .uk-logo,.uk-section-primary:not(.uk-preserve-color) .uk-logo,.uk-section-secondary:not(.uk-preserve-color) .uk-logo,.uk-tile-primary:not(.uk-preserve-color) .uk-logo,.uk-tile-secondary:not(.uk-preserve-color) .uk-logo{color:#fff}.uk-card-primary.uk-card-body .uk-logo:hover,.uk-card-primary>:not([class*=uk-card-media]) .uk-logo:hover,.uk-card-secondary.uk-card-body .uk-logo:hover,.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo:hover,.uk-light .uk-logo:hover,.uk-offcanvas-bar .uk-logo:hover,.uk-overlay-primary .uk-logo:hover,.uk-section-primary:not(.uk-preserve-color) .uk-logo:hover,.uk-section-secondary:not(.uk-preserve-color) .uk-logo:hover,.uk-tile-primary:not(.uk-preserve-color) .uk-logo:hover,.uk-tile-secondary:not(.uk-preserve-color) .uk-logo:hover{color:#fff}.uk-card-primary.uk-card-body .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-card-primary>:not([class*=uk-card-media]) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-card-secondary.uk-card-body .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-light .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-offcanvas-bar .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-overlay-primary .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-section-primary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-section-secondary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-tile-primary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse),.uk-tile-secondary:not(.uk-preserve-color) .uk-logo:has(.uk-logo-inverse)>:not(picture:has(.uk-logo-inverse)):not(.uk-logo-inverse){display:none}.uk-card-primary.uk-card-body .uk-logo-inverse,.uk-card-primary>:not([class*=uk-card-media]) .uk-logo-inverse,.uk-card-secondary.uk-card-body .uk-logo-inverse,.uk-card-secondary>:not([class*=uk-card-media]) .uk-logo-inverse,.uk-light .uk-logo-inverse,.uk-offcanvas-bar .uk-logo-inverse,.uk-overlay-primary .uk-logo-inverse,.uk-section-primary:not(.uk-preserve-color) .uk-logo-inverse,.uk-section-secondary:not(.uk-preserve-color) .uk-logo-inverse,.uk-tile-primary:not(.uk-preserve-color) .uk-logo-inverse,.uk-tile-secondary:not(.uk-preserve-color) .uk-logo-inverse{display:block}.uk-card-primary.uk-card-body .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-primary.uk-card-body .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-primary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-card-secondary.uk-card-body .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-secondary.uk-card-body .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-card-secondary>:not([class*=uk-card-media]) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-light .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-light .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-offcanvas-bar .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-offcanvas-bar .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-overlay-primary .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-overlay-primary .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-section-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-section-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-section-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-tile-primary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped tbody tr:nth-of-type(2n):last-child,.uk-tile-secondary:not(.uk-preserve-color) .uk-table-striped>tr:nth-of-type(2n):last-child{border-bottom-color:#fff3}.uk-card-primary.uk-card-body .uk-accordion-title:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-accordion-title:before,.uk-card-secondary.uk-card-body .uk-accordion-title:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-accordion-title:before,.uk-light .uk-accordion-title:before,.uk-offcanvas-bar .uk-accordion-title:before,.uk-overlay-primary .uk-accordion-title:before,.uk-section-primary:not(.uk-preserve-color) .uk-accordion-title:before,.uk-section-secondary:not(.uk-preserve-color) .uk-accordion-title:before,.uk-tile-primary:not(.uk-preserve-color) .uk-accordion-title:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-accordion-title:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%20%20%20%20%3Crect%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20width%3D%221%22%20height%3D%2213%22%20x%3D%226%22%20y%3D%220%22%20%2F%3E%0A%3C%2Fsvg%3E)}.uk-card-primary.uk-card-body .uk-open>.uk-accordion-title:before,.uk-card-primary>:not([class*=uk-card-media]) .uk-open>.uk-accordion-title:before,.uk-card-secondary.uk-card-body .uk-open>.uk-accordion-title:before,.uk-card-secondary>:not([class*=uk-card-media]) .uk-open>.uk-accordion-title:before,.uk-light .uk-open>.uk-accordion-title:before,.uk-offcanvas-bar .uk-open>.uk-accordion-title:before,.uk-overlay-primary .uk-open>.uk-accordion-title:before,.uk-section-primary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before,.uk-section-secondary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before,.uk-tile-primary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before,.uk-tile-secondary:not(.uk-preserve-color) .uk-open>.uk-accordion-title:before{background-image:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Crect%20fill%3D%22rgba%28255,%20255,%20255,%200.7%29%22%20width%3D%2213%22%20height%3D%221%22%20x%3D%220%22%20y%3D%226%22%20%2F%3E%0A%3C%2Fsvg%3E)}*{--uk-inverse:initial}.uk-card-primary.uk-card-body,.uk-card-primary>:not([class*=uk-card-media]),.uk-card-secondary.uk-card-body,.uk-card-secondary>:not([class*=uk-card-media]),.uk-light,.uk-offcanvas-bar,.uk-overlay-primary,.uk-section-primary:not(.uk-preserve-color),.uk-section-secondary:not(.uk-preserve-color),.uk-tile-primary:not(.uk-preserve-color),.uk-tile-secondary:not(.uk-preserve-color){--uk-inverse:light}.uk-card-default.uk-card-body,.uk-card-default>:not([class*=uk-card-media]),.uk-dark,.uk-dropbar,.uk-dropdown,.uk-navbar-container:not(.uk-navbar-transparent),.uk-navbar-dropdown,.uk-overlay-default,.uk-section-default:not(.uk-preserve-color),.uk-section-muted:not(.uk-preserve-color),.uk-tile-default:not(.uk-preserve-color),.uk-tile-muted:not(.uk-preserve-color){--uk-inverse:dark}.uk-inverse-light{--uk-inverse:light!important}.uk-inverse-dark{--uk-inverse:dark!important}@media print{*,:after,:before{background:0 0!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;inset:-50px 0 0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:#ff96004d}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;inset:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:none;background:transparent;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px #0003;border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto;box-sizing:border-box}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}.cm-s-material-darker.CodeMirror{background-color:#212121;color:#eff}.cm-s-material-darker .CodeMirror-gutters{background:#212121;color:#545454;border:none}.cm-s-material-darker .CodeMirror-guttermarker,.cm-s-material-darker .CodeMirror-guttermarker-subtle,.cm-s-material-darker .CodeMirror-linenumber{color:#545454}.cm-s-material-darker .CodeMirror-cursor{border-left:1px solid #FFCC00}.cm-s-material-darker div.CodeMirror-selected,.cm-s-material-darker.CodeMirror-focused div.CodeMirror-selected{background:#61616133}.cm-s-material-darker .CodeMirror-line::selection,.cm-s-material-darker .CodeMirror-line>span::selection,.cm-s-material-darker .CodeMirror-line>span>span::selection{background:#80cbc433}.cm-s-material-darker .CodeMirror-line::-moz-selection,.cm-s-material-darker .CodeMirror-line>span::-moz-selection,.cm-s-material-darker .CodeMirror-line>span>span::-moz-selection{background:#80cbc433}.cm-s-material-darker .CodeMirror-activeline-background{background:#00000080}.cm-s-material-darker .cm-keyword{color:#c792ea}.cm-s-material-darker .cm-operator{color:#89ddff}.cm-s-material-darker .cm-variable-2{color:#eff}.cm-s-material-darker .cm-variable-3,.cm-s-material-darker .cm-type{color:#f07178}.cm-s-material-darker .cm-builtin{color:#ffcb6b}.cm-s-material-darker .cm-atom{color:#f78c6c}.cm-s-material-darker .cm-number{color:#ff5370}.cm-s-material-darker .cm-def{color:#82aaff}.cm-s-material-darker .cm-string{color:#c3e88d}.cm-s-material-darker .cm-string-2{color:#f07178}.cm-s-material-darker .cm-comment{color:#545454}.cm-s-material-darker .cm-variable{color:#f07178}.cm-s-material-darker .cm-tag{color:#ff5370}.cm-s-material-darker .cm-meta{color:#ffcb6b}.cm-s-material-darker .cm-attribute,.cm-s-material-darker .cm-property{color:#c792ea}.cm-s-material-darker .cm-qualifier,.cm-s-material-darker .cm-variable-3,.cm-s-material-darker .cm-type{color:#decb6b}.cm-s-material-darker .cm-error{color:#fff;background-color:#ff5370}.cm-s-material-darker .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}*{-webkit-backface-visibility:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;backface-visibility:hidden;margin:0;outline:none;border:none;background:none;padding:0;resize:none;user-select:none}html,body{height:100%;font-size:12px;font-family:Open Sans,sans-serif}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{border-radius:8px}h2{margin:0 0 15px}input{font-size:inherit;font-family:inherit}input[type=range]::-webkit-slider-runnable-track{margin-top:2px;border:none;border-radius:3px;background-color:#999;width:300px;height:1px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-7px;border:none;border-radius:50%;background-color:#1e87f0;width:14px;height:14px}input[type=range]:focus::-webkit-slider-runnable-track{background-color:#999}pre{font:inherit!important}textarea{box-sizing:border-box;width:100%;tab-size:2}text{font-size:.9rem}.wrapper{position:fixed;inset:0}.header-win{-webkit-app-region:drag!important;display:none;position:fixed;top:5px;right:0;left:0;height:30px}.header-win-title{float:left;margin:5px 0 0 15px;font-weight:700;font-size:1.1em;font-family:Numara}.winButtons{position:fixed;top:0;right:0}.unmax{display:none}.min-btn-win,.max-btn-win,.unmax-btn-win,.close-btn-win{-webkit-app-region:no-drag;float:right;background-position:center;background-size:11px 11px;background-repeat:no-repeat;width:46px;height:30px}.close-btn-win:hover{background-image:url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIgMTIiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc2hhcGUtcmVuZGVyaW5nPSJjcmlzcEVkZ2VzIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik02LjI3OSA1LjVMMTEgMTAuMjIxbC0uNzc5Ljc3OUw1LjUgNi4yNzkuNzc5IDExIDAgMTAuMjIxIDQuNzIxIDUuNSAwIC43NzkuNzc5IDAgNS41IDQuNzIxIDEwLjIyMSAwIDExIC43NzkgNi4yNzkgNS41eiIgLz48L3N2Zz4=);background-color:#e11}.header-mac{-webkit-app-region:drag!important;display:none;position:fixed;top:0;right:0;left:0;height:40px}.header-mac-title{padding-top:10px;font-size:1.1em;font-family:Numara;text-align:center}.panel{display:flex;position:fixed;inset:50px 8px 42px 20px;align-content:flex-start}.input{width:60%;min-width:120px}.inputArea{-webkit-user-select:text;user-select:text}.inputArea::-webkit-scrollbar{width:0px;height:8px}.divider{flex:0 0 auto;cursor:ew-resize;margin:0 8px;width:5px;height:calc(100% - 8px)}.divider:before{display:block;margin:0 auto;width:1px;height:100%;content:""}.output{flex:1;padding:0;min-width:120px;font-weight:400;white-space:nowrap}.inputArea,.output{display:block;height:100%;overflow:scroll}.output>div{-webkit-user-select:text;display:block;width:100%;height:27px;user-select:text}.panelFont{font-family:Roboto Mono,monospace}.answer{-webkit-user-select:text;cursor:default;margin:0 8px 0 0;border-radius:5px;padding:2px 5px;height:27px;user-select:text}.lineError,.plotButton{margin:0 12px 0 5px}.lineError:hover{text-decoration:underline}.errMsg{word-break:break-word}.noRuler{border-bottom:1px solid transparent}.gutterBlock{position:fixed;bottom:50px;left:0;z-index:5;height:8px}.actions{position:fixed;right:10px;bottom:10px;left:10px;height:25px}.action,.noAction{cursor:pointer}.noAction,.action[disabled=true]{opacity:.4;cursor:default;pointer-events:none}.actionDivider{margin:2px 5px 0;height:20px}.leftActions a,.centerActions a,.rightActions a{margin:0 5px}.leftActions a:hover,.sidePanelActions a:hover{text-decoration:none}.newPageButton svg,.newPageButtonSP svg{width:16px!important;height:16px!important}.pageName{position:relative;top:2px;opacity:.9;width:calc(100vw - 300px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.leftActions a svg,.centerActions a svg,.rightActions a svg,.sidePanelActions a svg{width:14px;height:14px;pointer-events:none;color:inherit!important}.notificationDot{display:none;position:fixed;right:10px;bottom:18px}.notificationDot>svg{fill:#1e87f0;stroke:#1e87f0;width:5px;height:5px}.uk-offcanvas-bar{padding:0;width:240px}.sidePanelActions{margin:15px 10px 11px}.closeSidePanelButton{-webkit-app-region:no-drag!important}.closeSidePanelButton svg{width:18px;height:18px}.uk-offcanvas-close{-webkit-app-region:no-drag;top:9px;right:8px}.uk-offcanvas-close svg{width:11px;height:11px}.uk-offcanvas-close svg line{stroke-width:1.5}.uk-dropdown{padding:0;min-width:auto}.pageListHeader{height:40px}.pageList{overflow-x:hidden;overflow-y:auto}.pageListSort{-webkit-app-region:no-drag;cursor:pointer;margin:10px}.pageListSort svg{width:14px;height:14px}.sortListItem{-webkit-app-region:no-drag;cursor:pointer;padding:5px 10px}.sortListDivider{margin:5px 10px}.pageListItem{display:flex;position:relative;cursor:pointer}.pageListItem>div:first-child{padding:3px 0 3px 10px}.pageListItemTitle{padding:5px 5px 2px;width:180px;overflow:hidden;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.drop-parent-icon svg{width:16px;height:16px}.renamePageButton,.dupPageButton,.deletePageButton,.sortListItem{cursor:pointer;padding:5px 10px}.dialogs{display:none}.dialog-buttons{display:flex;align-items:center;margin-top:15px}.dialog-open-body{margin-right:-5px}.dialog-open-date{padding:0 5px 5px;color:#999;font-size:.9rem}.dialog-confirm{z-index:10010}.infoOK{margin-left:-20px!important}#dialog-settings .uk-width-medium{width:385px}.dialog-settings-body{margin-right:-8px;padding-right:10px;height:calc(100vh - 185px);max-height:600px;overflow:scroll}#dialog-settings .uk-overflow-auto{padding-right:10px}#dialog-settings h3{margin:25px 0 12px;font-weight:500;font-size:1rem}#dialog-settings h3:first-of-type{margin:0 0 12px}#dialog-settings .settingMod,#dialog-settings .settingModToggle{display:none;position:absolute;cursor:pointer;margin-top:-3px;margin-left:-20px;color:#dd9359}#dialog-settings .settingMod>svg,#dialog-settings .settingModToggle>svg{width:24px}#dialog-settings .range .settingMod{margin-left:-54px}.set1{padding-top:1px}.set3{padding-top:2px}.precision,.expLower,.expUpper{background-color:transparent;padding:1px 0 0;width:25px;text-align:center}.warn-icon{display:none;vertical-align:middle;margin-left:3px}.warn-icon svg{stroke:#faa05a;margin-top:-4px;width:14px;height:14px;pointer-events:none}.lastUpdated{display:inline-block;vertical-align:middle;margin-right:3px;font-size:.9rem}.updateRatesLink{margin-left:6px}.dialog-about{text-align:center}.dialog-about-header{display:inline-block;margin:0 auto;font-weight:600}.dialog-about-header img{width:128px}.dialog-about-title{vertical-align:middle;margin-left:5px}.dialog-about p{clear:both;margin-top:5px}.dialog-about-links{display:flex;flex:auto}.dialog-about-links>div{width:100%;line-height:30px}.dialog-about-appVersion{display:block;margin-bottom:8px;text-align:center}.versionCtnr>div{margin:8px 3px 3px;text-align:center}.dialog-about-updateStatus{display:block;text-align:center}.notificationLink{margin-left:8px;color:#56b6c2}.restartButton{display:none;margin-top:10px;text-transform:capitalize}.dialog-about-copyright{display:block;margin:15px 0}.resetButtons svg{width:14px;pointer-events:none}.resetButton{float:left;color:#c95d71}.defSettingsButton{float:left;margin-left:10px;color:#dd9359}.resetSizeButton{float:left;margin-left:10px}.msg{opacity:0;transition:visibility .3s linear,opacity .3s linear}.pr-lh{line-height:22px}.pdt-lh{line-height:20px}.padTop1{padding-top:1px}.textBox{box-sizing:border-box;border:1px solid #cccccc;padding:5px;width:100%}.textBox::placeholder{color:#949ca099}.function-plot{height:calc(100vh - 180px)!important;max-height:800px}.top-right-legend{fill:#4682b4}.switch{display:inline-block;position:relative;margin-top:1px;width:28px;height:16px}.switch:disabled{opacity:.5}.switch input{opacity:0;width:0;height:0}.switchText{display:inline-block;vertical-align:text-bottom;margin:0 12px 0 2px;line-height:17px}.subSwitchIcon{margin:-5px 5px 0 0;width:14px}.plotTitle{margin:0 0 5px}.plotSwitches{margin:0}.slider{-webkit-transition:.2s;position:absolute;inset:0;transition:.2s;cursor:pointer;background-color:#ccc}.slider:before{-webkit-transition:.2s;position:absolute;bottom:2px;left:2px;transition:.2s;width:12px;height:12px;content:""}.slider.round{border-radius:16px}.slider.round:before{border-radius:50%}input:checked+.slider{background-color:#1e87f0}input:checked+.slider:before{-webkit-transform:translateX(12px);transform:translate(12px)}.scrollTop{display:none;position:fixed;right:2px;bottom:35px;cursor:pointer;width:10px}:focus:not([tabindex^="-"]),:focus-visible{outline:none}.uk-offcanvas-bar-animation{transition:left .2s ease-out}.uk-modal{padding:0 30px!important}.uk-modal-full{padding-right:20px;padding-left:20px}.uk-modal-dialog{transition:0s linear;border-radius:3px}.uk-modal-body{padding:12px 15px}.uk-modal-title,.errTitle{font-weight:600;font-size:1rem}.uk-modal-footer{padding:15px}.uk-grid{margin-left:-30px!important}.uk-grid>*{padding-left:30px!important}.uk-grid+.uk-grid{margin-top:10px}.uk-grid-small{margin:0 25px 0 0}.uk-select{transition:0s ease-in-out}.uk-select:not([multiple]):not([size]){margin-top:1px;border-width:0 0 1px 0;height:auto}.uk-switcher{margin:0!important}.uk-tab{margin:0 -20px}.uk-tab>*{padding-left:0}.uk-tab>*:first-child{padding-left:20px}.uk-tab:before{border:none}.uk-tab>*>a{display:inline-block;margin-right:0;padding:0 15px 5px;font-weight:600;font-size:1rem;text-transform:none}.uk-button{transition:0s ease-in-out;margin-left:3px;border-radius:3px;padding:0 10px;line-height:28px}.uk-button:enabled:active{transform:scale(.98)}.uk-button-default,.uk-button-default:hover{cursor:pointer;color:inherit}.uk-input{height:24px}.uk-label{font-size:1rem}.uk-width-small{width:280px}.uk-width-medium{width:350px}#dialog-settings>.uk-width-medium{width:420px}.uk-width-large{width:600px}.uk-width-xlarge{width:800px}.uk-width-2xlarge{width:1200px}.uk-overflow-auto{min-height:175px;max-height:calc(100vh - 250px)}.uk-range{padding-top:2px;min-height:1.6em}.uk-tooltip{z-index:1000000;max-width:50vw!important;word-break:break-word}.uk-tooltip>*{width:100%!important}.uk-notification{margin-top:30px;margin-bottom:30px}.uk-notification-top-left,.uk-notification-bottom-left{left:25px}.uk-notification-top-right,.uk-notification-bottom-right{right:25px}.uk-notification-message{padding:8px 35px 8px 10px;font-size:1rem}.uk-notification-close{display:block;top:11px;right:10px}.uk-notification-close svg{width:10px;height:10px}@media (max-width: 639px){.uk-notification{right:25px;left:25px}}@media (min-width: 640px){.uk-notification{width:590px}.uk-notification-bottom-center,.uk-notification-top-center{margin-left:-295px}}.cm-s-numara{background:none!important;height:100%!important;font-family:Roboto Mono!important}.cm-s-numara .CodeMirror-gutters{border:none!important;background:none!important}.cm-s-numara .CodeMirror-lines{padding:0!important}.cm-s-numara .CodeMirror-vscrollbar{display:none!important}.cm-s-numara .CodeMirror-hscrollbar,.cm-s-numara .CodeMirror-gutter-filler{display:block!important;width:auto;height:8px!important}.cm-s-numara .CodeMirror-hscrollbar{right:8px!important}.cm-s-numara .CodeMirror-linenumber{padding:0 10px 0 0!important}.cm-s-numara .CodeMirror-sizer{padding-right:0!important;padding-bottom:8px!important}.cm-s-numara .CodeMirror-search-hint{display:none!important}.cm-s-numara .CodeMirror-dialog input{font-family:inherit!important}.cm-s-numara button{color:#1e87f0!important;font-size:inherit!important}.cm-s-numara button:hover{cursor:pointer!important;color:#5286b9!important;font-size:inherit!important}.cm-searching{background-color:#fffa5280!important}.cm-s-numara .CodeMirror-search-label{font-size:1rem!important}#dialog-udfu .CodeMirror{padding:5px;height:calc(100vh - 220px);max-height:800px;font-size:1.1em}.CodeMirror-hints{font-family:Roboto Mono,monospace}.printArea{display:none}@media print{.wrapper,.uk-open,.uk-tooltip{display:none!important}.printArea{display:block}.printTitle{padding-bottom:10px;font-size:1.1em;font-family:Numara;text-align:center}.printPagele{border-collapse:collapse;width:100%;font-family:Roboto Mono,monospace}.printPagele tr td{vertical-align:top;padding-top:3px;padding-bottom:3px}.printLineNumCol{width:1px;color:#ccc!important}.printAnswerLeft{border-left:1px solid #eaeaea}.printAnswerRight{text-align:right}.printPagele tr td:nth-child(1){padding-right:10px}.printPagele tr td:last-child{padding-left:10px}.printRulers tr td{border-bottom:1px solid #eaeaea}.scrollTop{display:none!important}}@page{margin:15mm auto} /*! Bundled license information: diff --git a/build/js/numara.js b/build/js/numara.js index ca76335..8251ffd 100644 --- a/build/js/numara.js +++ b/build/js/numara.js @@ -1,77 +1,77 @@ /** * Numara Calculator - * Version 5.1.3 + * Version 5.2.0 * Copyright ©️ 2024 Timur Atalay * * Licence : MIT - https://github.com/bornova/numara-calculator/blob/master/LICENSE * GitHub : https://github.com/bornova/numara-calculator * Website : https://numara.io */ -(()=>{var $te=Object.create;var qy=Object.defineProperty;var Wte=Object.getOwnPropertyDescriptor;var Vte=Object.getOwnPropertyNames;var Gte=Object.getPrototypeOf,Yte=Object.prototype.hasOwnProperty;var Te=(e,t)=>()=>(e&&(t=e(e=0)),t);var vt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qa=(e,t)=>{for(var r in t)qy(e,r,{get:t[r],enumerable:!0})},bO=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Vte(t))!Yte.call(e,i)&&i!==r&&qy(e,i,{get:()=>t[i],enumerable:!(n=Wte(t,i))||n.enumerable});return e};var rn=(e,t,r)=>(r=e!=null?$te(Gte(e)):{},bO(t||!e||!e.__esModule?qy(r,"default",{value:e,enumerable:!0}):r,e)),Cn=e=>bO(qy({},"__esModule",{value:!0}),e);var g=Te(()=>{});function Zte(e,t){this.fun=e,this.array=t}function DO(e){var t=Math.floor((Date.now()-np.now())*.001),r=np.now()*.001,n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n=n-e[0],i=i-e[1],i<0&&(n--,i+=wE)),[n,i]}var kSe,np,xE,wE,NO=Te(()=>{g();y();v();Zte.prototype.run=function(){this.fun.apply(null,this.array)};kSe={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},np={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};np.now===void 0&&(xE=Date.now(),np.timing&&np.timing.navigationStart&&(xE=np.timing.navigationStart),np.now=()=>Date.now()-xE);wE=1e9;DO.bigint=function(e){var t=DO(e);return typeof BigInt>"u"?t[0]*wE+t[1]:BigInt(t[0]*wE)+BigInt(t[1])}});var v=Te(()=>{NO()});function Xte(){if(EO)return Wg;EO=!0,Wg.byteLength=l,Wg.toByteArray=s,Wg.fromByteArray=h;for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var w=x.indexOf("=");w===-1&&(w=b);var A=w===b?0:4-w%4;return[w,A]}function l(x){var b=u(x),w=b[0],A=b[1];return(w+A)*3/4-A}function a(x,b,w){return(b+w)*3/4-w}function s(x){var b,w=u(x),A=w[0],E=w[1],O=new r(a(x,A,E)),M=0,I=E>0?A-4:A,F;for(F=0;F>16&255,O[M++]=b>>8&255,O[M++]=b&255;return E===2&&(b=t[x.charCodeAt(F)]<<2|t[x.charCodeAt(F+1)]>>4,O[M++]=b&255),E===1&&(b=t[x.charCodeAt(F)]<<10|t[x.charCodeAt(F+1)]<<4|t[x.charCodeAt(F+2)]>>2,O[M++]=b>>8&255,O[M++]=b&255),O}function f(x){return e[x>>18&63]+e[x>>12&63]+e[x>>6&63]+e[x&63]}function p(x,b,w){for(var A,E=[],O=b;OI?I:M+O));return A===1?(b=x[w-1],E.push(e[b>>2]+e[b<<4&63]+"==")):A===2&&(b=(x[w-2]<<8)+x[w-1],E.push(e[b>>10]+e[b>>4&63]+e[b<<2&63]+"=")),E.join("")}return Wg}function Kte(){if(SO)return zy;SO=!0;return zy.read=function(e,t,r,n,i){var o,u,l=i*8-n-1,a=(1<>1,f=-7,p=r?i-1:0,h=r?-1:1,x=e[t+p];for(p+=h,o=x&(1<<-f)-1,x>>=-f,f+=l;f>0;o=o*256+e[t+p],p+=h,f-=8);for(u=o&(1<<-f)-1,o>>=-f,f+=n;f>0;u=u*256+e[t+p],p+=h,f-=8);if(o===0)o=1-s;else{if(o===a)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-s}return(x?-1:1)*u*Math.pow(2,o-n)},zy.write=function(e,t,r,n,i,o){var u,l,a,s=o*8-i-1,f=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=n?0:o-1,b=n?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,u=f):(u=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-u))<1&&(u--,a*=2),u+p>=1?t+=h/a:t+=h*Math.pow(2,1-p),t*a>=2&&(u++,a/=2),u+p>=f?(l=0,u=f):u+p>=1?(l=(t*a-1)*Math.pow(2,i),u=u+p):(l=t*Math.pow(2,p-1)*Math.pow(2,i),u=0));i>=8;e[r+x]=l&255,x+=b,l/=256,i-=8);for(u=u<0;e[r+x]=u&255,x+=b,u/=256,s-=8);e[r+x-b]|=w*128},zy}function Jte(){if(AO)return ip;AO=!0;let e=Xte(),t=Kte(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ip.Buffer=u,ip.SlowBuffer=E,ip.INSPECT_MAX_BYTES=50;let n=2147483647;ip.kMaxLength=n,u.TYPED_ARRAY_SUPPORT=i(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let fe=new Uint8Array(1),J={foo:function(){return 42}};return Object.setPrototypeOf(J,Uint8Array.prototype),Object.setPrototypeOf(fe,J),fe.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function o(fe){if(fe>n)throw new RangeError('The value "'+fe+'" is invalid for option "size"');let J=new Uint8Array(fe);return Object.setPrototypeOf(J,u.prototype),J}function u(fe,J,j){if(typeof fe=="number"){if(typeof J=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(fe)}return l(fe,J,j)}u.poolSize=8192;function l(fe,J,j){if(typeof fe=="string")return p(fe,J);if(ArrayBuffer.isView(fe))return x(fe);if(fe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe);if(Ke(fe,ArrayBuffer)||fe&&Ke(fe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ke(fe,SharedArrayBuffer)||fe&&Ke(fe.buffer,SharedArrayBuffer)))return b(fe,J,j);if(typeof fe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ne=fe.valueOf&&fe.valueOf();if(ne!=null&&ne!==fe)return u.from(ne,J,j);let me=w(fe);if(me)return me;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof fe[Symbol.toPrimitive]=="function")return u.from(fe[Symbol.toPrimitive]("string"),J,j);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe)}u.from=function(fe,J,j){return l(fe,J,j)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function a(fe){if(typeof fe!="number")throw new TypeError('"size" argument must be of type number');if(fe<0)throw new RangeError('The value "'+fe+'" is invalid for option "size"')}function s(fe,J,j){return a(fe),fe<=0?o(fe):J!==void 0?typeof j=="string"?o(fe).fill(J,j):o(fe).fill(J):o(fe)}u.alloc=function(fe,J,j){return s(fe,J,j)};function f(fe){return a(fe),o(fe<0?0:A(fe)|0)}u.allocUnsafe=function(fe){return f(fe)},u.allocUnsafeSlow=function(fe){return f(fe)};function p(fe,J){if((typeof J!="string"||J==="")&&(J="utf8"),!u.isEncoding(J))throw new TypeError("Unknown encoding: "+J);let j=O(fe,J)|0,ne=o(j),me=ne.write(fe,J);return me!==j&&(ne=ne.slice(0,me)),ne}function h(fe){let J=fe.length<0?0:A(fe.length)|0,j=o(J);for(let ne=0;ne=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return fe|0}function E(fe){return+fe!=fe&&(fe=0),u.alloc(+fe)}u.isBuffer=function(J){return J!=null&&J._isBuffer===!0&&J!==u.prototype},u.compare=function(J,j){if(Ke(J,Uint8Array)&&(J=u.from(J,J.offset,J.byteLength)),Ke(j,Uint8Array)&&(j=u.from(j,j.offset,j.byteLength)),!u.isBuffer(J)||!u.isBuffer(j))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(J===j)return 0;let ne=J.length,me=j.length;for(let xe=0,_e=Math.min(ne,me);xe<_e;++xe)if(J[xe]!==j[xe]){ne=J[xe],me=j[xe];break}return neme.length?(u.isBuffer(_e)||(_e=u.from(_e)),_e.copy(me,xe)):Uint8Array.prototype.set.call(me,_e,xe);else if(u.isBuffer(_e))_e.copy(me,xe);else throw new TypeError('"list" argument must be an Array of Buffers');xe+=_e.length}return me};function O(fe,J){if(u.isBuffer(fe))return fe.length;if(ArrayBuffer.isView(fe)||Ke(fe,ArrayBuffer))return fe.byteLength;if(typeof fe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof fe);let j=fe.length,ne=arguments.length>2&&arguments[2]===!0;if(!ne&&j===0)return 0;let me=!1;for(;;)switch(J){case"ascii":case"latin1":case"binary":return j;case"utf8":case"utf-8":return be(fe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j*2;case"hex":return j>>>1;case"base64":return Re(fe).length;default:if(me)return ne?-1:be(fe).length;J=(""+J).toLowerCase(),me=!0}}u.byteLength=O;function M(fe,J,j){let ne=!1;if((J===void 0||J<0)&&(J=0),J>this.length||((j===void 0||j>this.length)&&(j=this.length),j<=0)||(j>>>=0,J>>>=0,j<=J))return"";for(fe||(fe="utf8");;)switch(fe){case"hex":return le(this,J,j);case"utf8":case"utf-8":return W(this,J,j);case"ascii":return Y(this,J,j);case"latin1":case"binary":return Z(this,J,j);case"base64":return V(this,J,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,J,j);default:if(ne)throw new TypeError("Unknown encoding: "+fe);fe=(fe+"").toLowerCase(),ne=!0}}u.prototype._isBuffer=!0;function I(fe,J,j){let ne=fe[J];fe[J]=fe[j],fe[j]=ne}u.prototype.swap16=function(){let J=this.length;if(J%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let j=0;jj&&(J+=" ... "),""},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(J,j,ne,me,xe){if(Ke(J,Uint8Array)&&(J=u.from(J,J.offset,J.byteLength)),!u.isBuffer(J))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof J);if(j===void 0&&(j=0),ne===void 0&&(ne=J?J.length:0),me===void 0&&(me=0),xe===void 0&&(xe=this.length),j<0||ne>J.length||me<0||xe>this.length)throw new RangeError("out of range index");if(me>=xe&&j>=ne)return 0;if(me>=xe)return-1;if(j>=ne)return 1;if(j>>>=0,ne>>>=0,me>>>=0,xe>>>=0,this===J)return 0;let _e=xe-me,Je=ne-j,nt=Math.min(_e,Je),Xe=this.slice(me,xe),pt=J.slice(j,ne);for(let X=0;X2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),j=+j,ot(j)&&(j=me?0:fe.length-1),j<0&&(j=fe.length+j),j>=fe.length){if(me)return-1;j=fe.length-1}else if(j<0)if(me)j=0;else return-1;if(typeof J=="string"&&(J=u.from(J,ne)),u.isBuffer(J))return J.length===0?-1:C(fe,J,j,ne,me);if(typeof J=="number")return J=J&255,typeof Uint8Array.prototype.indexOf=="function"?me?Uint8Array.prototype.indexOf.call(fe,J,j):Uint8Array.prototype.lastIndexOf.call(fe,J,j):C(fe,[J],j,ne,me);throw new TypeError("val must be string, number or Buffer")}function C(fe,J,j,ne,me){let xe=1,_e=fe.length,Je=J.length;if(ne!==void 0&&(ne=String(ne).toLowerCase(),ne==="ucs2"||ne==="ucs-2"||ne==="utf16le"||ne==="utf-16le")){if(fe.length<2||J.length<2)return-1;xe=2,_e/=2,Je/=2,j/=2}function nt(pt,X){return xe===1?pt[X]:pt.readUInt16BE(X*xe)}let Xe;if(me){let pt=-1;for(Xe=j;Xe<_e;Xe++)if(nt(fe,Xe)===nt(J,pt===-1?0:Xe-pt)){if(pt===-1&&(pt=Xe),Xe-pt+1===Je)return pt*xe}else pt!==-1&&(Xe-=Xe-pt),pt=-1}else for(j+Je>_e&&(j=_e-Je),Xe=j;Xe>=0;Xe--){let pt=!0;for(let X=0;Xme&&(ne=me)):ne=me;let xe=J.length;ne>xe/2&&(ne=xe/2);let _e;for(_e=0;_e>>0,isFinite(ne)?(ne=ne>>>0,me===void 0&&(me="utf8")):(me=ne,ne=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let xe=this.length-j;if((ne===void 0||ne>xe)&&(ne=xe),J.length>0&&(ne<0||j<0)||j>this.length)throw new RangeError("Attempt to write outside buffer bounds");me||(me="utf8");let _e=!1;for(;;)switch(me){case"hex":return P(this,J,j,ne);case"utf8":case"utf-8":return R(this,J,j,ne);case"ascii":case"latin1":case"binary":return q(this,J,j,ne);case"base64":return U(this,J,j,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,J,j,ne);default:if(_e)throw new TypeError("Unknown encoding: "+me);me=(""+me).toLowerCase(),_e=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function V(fe,J,j){return J===0&&j===fe.length?e.fromByteArray(fe):e.fromByteArray(fe.slice(J,j))}function W(fe,J,j){j=Math.min(fe.length,j);let ne=[],me=J;for(;me239?4:xe>223?3:xe>191?2:1;if(me+Je<=j){let nt,Xe,pt,X;switch(Je){case 1:xe<128&&(_e=xe);break;case 2:nt=fe[me+1],(nt&192)===128&&(X=(xe&31)<<6|nt&63,X>127&&(_e=X));break;case 3:nt=fe[me+1],Xe=fe[me+2],(nt&192)===128&&(Xe&192)===128&&(X=(xe&15)<<12|(nt&63)<<6|Xe&63,X>2047&&(X<55296||X>57343)&&(_e=X));break;case 4:nt=fe[me+1],Xe=fe[me+2],pt=fe[me+3],(nt&192)===128&&(Xe&192)===128&&(pt&192)===128&&(X=(xe&15)<<18|(nt&63)<<12|(Xe&63)<<6|pt&63,X>65535&&X<1114112&&(_e=X))}}_e===null?(_e=65533,Je=1):_e>65535&&(_e-=65536,ne.push(_e>>>10&1023|55296),_e=56320|_e&1023),ne.push(_e),me+=Je}return ie(ne)}let ee=4096;function ie(fe){let J=fe.length;if(J<=ee)return String.fromCharCode.apply(String,fe);let j="",ne=0;for(;nene)&&(j=ne);let me="";for(let xe=J;xene&&(J=ne),j<0?(j+=ne,j<0&&(j=0)):j>ne&&(j=ne),jj)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(J,j,ne){J=J>>>0,j=j>>>0,ne||he(J,j,this.length);let me=this[J],xe=1,_e=0;for(;++_e>>0,j=j>>>0,ne||he(J,j,this.length);let me=this[J+--j],xe=1;for(;j>0&&(xe*=256);)me+=this[J+--j]*xe;return me},u.prototype.readUint8=u.prototype.readUInt8=function(J,j){return J=J>>>0,j||he(J,1,this.length),this[J]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(J,j){return J=J>>>0,j||he(J,2,this.length),this[J]|this[J+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(J,j){return J=J>>>0,j||he(J,2,this.length),this[J]<<8|this[J+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(J,j){return J=J>>>0,j||he(J,4,this.length),(this[J]|this[J+1]<<8|this[J+2]<<16)+this[J+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(J,j){return J=J>>>0,j||he(J,4,this.length),this[J]*16777216+(this[J+1]<<16|this[J+2]<<8|this[J+3])},u.prototype.readBigUInt64LE=ut(function(J){J=J>>>0,Le(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let me=j+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24,xe=this[++J]+this[++J]*2**8+this[++J]*2**16+ne*2**24;return BigInt(me)+(BigInt(xe)<>>0,Le(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let me=j*2**24+this[++J]*2**16+this[++J]*2**8+this[++J],xe=this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+ne;return(BigInt(me)<>>0,j=j>>>0,ne||he(J,j,this.length);let me=this[J],xe=1,_e=0;for(;++_e=xe&&(me-=Math.pow(2,8*j)),me},u.prototype.readIntBE=function(J,j,ne){J=J>>>0,j=j>>>0,ne||he(J,j,this.length);let me=j,xe=1,_e=this[J+--me];for(;me>0&&(xe*=256);)_e+=this[J+--me]*xe;return xe*=128,_e>=xe&&(_e-=Math.pow(2,8*j)),_e},u.prototype.readInt8=function(J,j){return J=J>>>0,j||he(J,1,this.length),this[J]&128?(255-this[J]+1)*-1:this[J]},u.prototype.readInt16LE=function(J,j){J=J>>>0,j||he(J,2,this.length);let ne=this[J]|this[J+1]<<8;return ne&32768?ne|4294901760:ne},u.prototype.readInt16BE=function(J,j){J=J>>>0,j||he(J,2,this.length);let ne=this[J+1]|this[J]<<8;return ne&32768?ne|4294901760:ne},u.prototype.readInt32LE=function(J,j){return J=J>>>0,j||he(J,4,this.length),this[J]|this[J+1]<<8|this[J+2]<<16|this[J+3]<<24},u.prototype.readInt32BE=function(J,j){return J=J>>>0,j||he(J,4,this.length),this[J]<<24|this[J+1]<<16|this[J+2]<<8|this[J+3]},u.prototype.readBigInt64LE=ut(function(J){J=J>>>0,Le(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let me=this[J+4]+this[J+5]*2**8+this[J+6]*2**16+(ne<<24);return(BigInt(me)<>>0,Le(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let me=(j<<24)+this[++J]*2**16+this[++J]*2**8+this[++J];return(BigInt(me)<>>0,j||he(J,4,this.length),t.read(this,J,!0,23,4)},u.prototype.readFloatBE=function(J,j){return J=J>>>0,j||he(J,4,this.length),t.read(this,J,!1,23,4)},u.prototype.readDoubleLE=function(J,j){return J=J>>>0,j||he(J,8,this.length),t.read(this,J,!0,52,8)},u.prototype.readDoubleBE=function(J,j){return J=J>>>0,j||he(J,8,this.length),t.read(this,J,!1,52,8)};function De(fe,J,j,ne,me,xe){if(!u.isBuffer(fe))throw new TypeError('"buffer" argument must be a Buffer instance');if(J>me||Jfe.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(J,j,ne,me){if(J=+J,j=j>>>0,ne=ne>>>0,!me){let Je=Math.pow(2,8*ne)-1;De(this,J,j,ne,Je,0)}let xe=1,_e=0;for(this[j]=J&255;++_e>>0,ne=ne>>>0,!me){let Je=Math.pow(2,8*ne)-1;De(this,J,j,ne,Je,0)}let xe=ne-1,_e=1;for(this[j+xe]=J&255;--xe>=0&&(_e*=256);)this[j+xe]=J/_e&255;return j+ne},u.prototype.writeUint8=u.prototype.writeUInt8=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,1,255,0),this[j]=J&255,j+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,2,65535,0),this[j]=J&255,this[j+1]=J>>>8,j+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,2,65535,0),this[j]=J>>>8,this[j+1]=J&255,j+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,4,4294967295,0),this[j+3]=J>>>24,this[j+2]=J>>>16,this[j+1]=J>>>8,this[j]=J&255,j+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,4,4294967295,0),this[j]=J>>>24,this[j+1]=J>>>16,this[j+2]=J>>>8,this[j+3]=J&255,j+4};function we(fe,J,j,ne,me){We(J,ne,me,fe,j,7);let xe=Number(J&BigInt(4294967295));fe[j++]=xe,xe=xe>>8,fe[j++]=xe,xe=xe>>8,fe[j++]=xe,xe=xe>>8,fe[j++]=xe;let _e=Number(J>>BigInt(32)&BigInt(4294967295));return fe[j++]=_e,_e=_e>>8,fe[j++]=_e,_e=_e>>8,fe[j++]=_e,_e=_e>>8,fe[j++]=_e,j}function ce(fe,J,j,ne,me){We(J,ne,me,fe,j,7);let xe=Number(J&BigInt(4294967295));fe[j+7]=xe,xe=xe>>8,fe[j+6]=xe,xe=xe>>8,fe[j+5]=xe,xe=xe>>8,fe[j+4]=xe;let _e=Number(J>>BigInt(32)&BigInt(4294967295));return fe[j+3]=_e,_e=_e>>8,fe[j+2]=_e,_e=_e>>8,fe[j+1]=_e,_e=_e>>8,fe[j]=_e,j+8}u.prototype.writeBigUInt64LE=ut(function(J,j=0){return we(this,J,j,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=ut(function(J,j=0){return ce(this,J,j,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(J,j,ne,me){if(J=+J,j=j>>>0,!me){let nt=Math.pow(2,8*ne-1);De(this,J,j,ne,nt-1,-nt)}let xe=0,_e=1,Je=0;for(this[j]=J&255;++xe>0)-Je&255;return j+ne},u.prototype.writeIntBE=function(J,j,ne,me){if(J=+J,j=j>>>0,!me){let nt=Math.pow(2,8*ne-1);De(this,J,j,ne,nt-1,-nt)}let xe=ne-1,_e=1,Je=0;for(this[j+xe]=J&255;--xe>=0&&(_e*=256);)J<0&&Je===0&&this[j+xe+1]!==0&&(Je=1),this[j+xe]=(J/_e>>0)-Je&255;return j+ne},u.prototype.writeInt8=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,1,127,-128),J<0&&(J=255+J+1),this[j]=J&255,j+1},u.prototype.writeInt16LE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,2,32767,-32768),this[j]=J&255,this[j+1]=J>>>8,j+2},u.prototype.writeInt16BE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,2,32767,-32768),this[j]=J>>>8,this[j+1]=J&255,j+2},u.prototype.writeInt32LE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,4,2147483647,-2147483648),this[j]=J&255,this[j+1]=J>>>8,this[j+2]=J>>>16,this[j+3]=J>>>24,j+4},u.prototype.writeInt32BE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,4,2147483647,-2147483648),J<0&&(J=4294967295+J+1),this[j]=J>>>24,this[j+1]=J>>>16,this[j+2]=J>>>8,this[j+3]=J&255,j+4},u.prototype.writeBigInt64LE=ut(function(J,j=0){return we(this,J,j,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=ut(function(J,j=0){return ce(this,J,j,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ee(fe,J,j,ne,me,xe){if(j+ne>fe.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("Index out of range")}function Pe(fe,J,j,ne,me){return J=+J,j=j>>>0,me||Ee(fe,J,j,4),t.write(fe,J,j,ne,23,4),j+4}u.prototype.writeFloatLE=function(J,j,ne){return Pe(this,J,j,!0,ne)},u.prototype.writeFloatBE=function(J,j,ne){return Pe(this,J,j,!1,ne)};function Ce(fe,J,j,ne,me){return J=+J,j=j>>>0,me||Ee(fe,J,j,8),t.write(fe,J,j,ne,52,8),j+8}u.prototype.writeDoubleLE=function(J,j,ne){return Ce(this,J,j,!0,ne)},u.prototype.writeDoubleBE=function(J,j,ne){return Ce(this,J,j,!1,ne)},u.prototype.copy=function(J,j,ne,me){if(!u.isBuffer(J))throw new TypeError("argument should be a Buffer");if(ne||(ne=0),!me&&me!==0&&(me=this.length),j>=J.length&&(j=J.length),j||(j=0),me>0&&me=this.length)throw new RangeError("Index out of range");if(me<0)throw new RangeError("sourceEnd out of bounds");me>this.length&&(me=this.length),J.length-j>>0,ne=ne===void 0?this.length:ne>>>0,J||(J=0);let xe;if(typeof J=="number")for(xe=j;xe2**32?me=Se(String(j)):typeof j=="bigint"&&(me=String(j),(j>BigInt(2)**BigInt(32)||j<-(BigInt(2)**BigInt(32)))&&(me=Se(me)),me+="n"),ne+=` It must be ${J}. Received ${me}`,ne},RangeError);function Se(fe){let J="",j=fe.length,ne=fe[0]==="-"?1:0;for(;j>=ne+4;j-=3)J=`_${fe.slice(j-3,j)}${J}`;return`${fe.slice(0,j)}${J}`}function ze(fe,J,j){Le(J,"offset"),(fe[J]===void 0||fe[J+j]===void 0)&<(J,fe.length-(j+1))}function We(fe,J,j,ne,me,xe){if(fe>j||fe3?J===0||J===BigInt(0)?Je=`>= 0${_e} and < 2${_e} ** ${(xe+1)*8}${_e}`:Je=`>= -(2${_e} ** ${(xe+1)*8-1}${_e}) and < 2 ** ${(xe+1)*8-1}${_e}`:Je=`>= ${J}${_e} and <= ${j}${_e}`,new Oe.ERR_OUT_OF_RANGE("value",Je,fe)}ze(ne,me,xe)}function Le(fe,J){if(typeof fe!="number")throw new Oe.ERR_INVALID_ARG_TYPE(J,"number",fe)}function lt(fe,J,j){throw Math.floor(fe)!==fe?(Le(fe,j),new Oe.ERR_OUT_OF_RANGE(j||"offset","an integer",fe)):J<0?new Oe.ERR_BUFFER_OUT_OF_BOUNDS:new Oe.ERR_OUT_OF_RANGE(j||"offset",`>= ${j?1:0} and <= ${J}`,fe)}let ct=/[^+/0-9A-Za-z-_]/g;function de(fe){if(fe=fe.split("=")[0],fe=fe.trim().replace(ct,""),fe.length<2)return"";for(;fe.length%4!==0;)fe=fe+"=";return fe}function be(fe,J){J=J||1/0;let j,ne=fe.length,me=null,xe=[];for(let _e=0;_e55295&&j<57344){if(!me){if(j>56319){(J-=3)>-1&&xe.push(239,191,189);continue}else if(_e+1===ne){(J-=3)>-1&&xe.push(239,191,189);continue}me=j;continue}if(j<56320){(J-=3)>-1&&xe.push(239,191,189),me=j;continue}j=(me-55296<<10|j-56320)+65536}else me&&(J-=3)>-1&&xe.push(239,191,189);if(me=null,j<128){if((J-=1)<0)break;xe.push(j)}else if(j<2048){if((J-=2)<0)break;xe.push(j>>6|192,j&63|128)}else if(j<65536){if((J-=3)<0)break;xe.push(j>>12|224,j>>6&63|128,j&63|128)}else if(j<1114112){if((J-=4)<0)break;xe.push(j>>18|240,j>>12&63|128,j>>6&63|128,j&63|128)}else throw new Error("Invalid code point")}return xe}function Ue(fe){let J=[];for(let j=0;j>8,me=j%256,xe.push(me),xe.push(ne);return xe}function Re(fe){return e.toByteArray(de(fe))}function Be(fe,J,j,ne){let me;for(me=0;me=J.length||me>=fe.length);++me)J[me+j]=fe[me];return me}function Ke(fe,J){return fe instanceof J||fe!=null&&fe.constructor!=null&&fe.constructor.name!=null&&fe.constructor.name===J.name}function ot(fe){return fe!==fe}let Qe=function(){let fe="0123456789abcdef",J=new Array(256);for(let j=0;j<16;++j){let ne=j*16;for(let me=0;me<16;++me)J[ne+me]=fe[j]+fe[me]}return J}();function ut(fe){return typeof BigInt>"u"?Pt:fe}function Pt(){throw new Error("BigInt not supported")}return ip}var Wg,EO,zy,SO,ip,AO,op,k,zSe,USe,CO=Te(()=>{g();y();v();Wg={},EO=!1;zy={},SO=!1;ip={},AO=!1;op=Jte();op.Buffer;op.SlowBuffer;op.INSPECT_MAX_BYTES;op.kMaxLength;k=op.Buffer,zSe=op.INSPECT_MAX_BYTES,USe=op.kMaxLength});var y=Te(()=>{CO()});var Vm=vt((bE,DE)=>{g();y();v();(function(e,t){typeof bE=="object"&&typeof DE<"u"?DE.exports=t():typeof define=="function"&&define.amd?define("uikit",t):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkit=t())})(bE,function(){"use strict";let{hasOwnProperty:e,toString:t}=Object.prototype;function r(m,D){return e.call(m,D)}let n=/\B([A-Z])/g,i=be(m=>m.replace(n,"-$1").toLowerCase()),o=/-(\w)/g,u=be(m=>(m.charAt(0).toLowerCase()+m.slice(1)).replace(o,(D,_)=>_.toUpperCase())),l=be(m=>m.charAt(0).toUpperCase()+m.slice(1));function a(m,D){var _;return(_=m?.startsWith)==null?void 0:_.call(m,D)}function s(m,D){var _;return(_=m?.endsWith)==null?void 0:_.call(m,D)}function f(m,D){var _;return(_=m?.includes)==null?void 0:_.call(m,D)}function p(m,D){var _;return(_=m?.findIndex)==null?void 0:_.call(m,D)}let{isArray:h,from:x}=Array,{assign:b}=Object;function w(m){return typeof m=="function"}function A(m){return m!==null&&typeof m=="object"}function E(m){return t.call(m)==="[object Object]"}function O(m){return A(m)&&m===m.window}function M(m){return C(m)===9}function I(m){return C(m)>=1}function F(m){return C(m)===1}function C(m){return!O(m)&&A(m)&&m.nodeType}function P(m){return typeof m=="boolean"}function R(m){return typeof m=="string"}function q(m){return typeof m=="number"}function U(m){return q(m)||R(m)&&!isNaN(m-parseFloat(m))}function H(m){return!(h(m)?m.length:A(m)&&Object.keys(m).length)}function V(m){return m===void 0}function W(m){return P(m)?m:m==="true"||m==="1"||m===""?!0:m==="false"||m==="0"?!1:m}function ee(m){let D=Number(m);return isNaN(D)?!1:D}function ie(m){return parseFloat(m)||0}function Y(m){return m&&Z(m)[0]}function Z(m){return I(m)?[m]:Array.from(m||[]).filter(I)}function le(m){if(O(m))return m;m=Y(m);let D=M(m)?m:m?.ownerDocument;return D?.defaultView||window}function re(m,D){return m===D||A(m)&&A(D)&&Object.keys(m).length===Object.keys(D).length&&we(m,(_,$)=>_===D[$])}function he(m,D,_){return m.replace(new RegExp(`${D}|${_}`,"g"),$=>$===D?_:D)}function De(m){return m[m.length-1]}function we(m,D){for(let _ in m)if(D(m[_],_)===!1)return!1;return!0}function ce(m,D){return m.slice().sort(({[D]:_=0},{[D]:$=0})=>_>$?1:$>_?-1:0)}function Ee(m,D){return m.reduce((_,$)=>_+ie(w(D)?D($):$[D]),0)}function Pe(m,D){let _=new Set;return m.filter(({[D]:$})=>_.has($)?!1:_.add($))}function Ce(m,D){return D.reduce((_,$)=>({..._,[$]:m[$]}),{})}function Oe(m,D=0,_=1){return Math.min(Math.max(ee(m)||0,D),_)}function He(){}function Se(...m){return[["bottom","top"],["right","left"]].every(([D,_])=>Math.min(...m.map(({[D]:$})=>$))-Math.max(...m.map(({[_]:$})=>$))>0)}function ze(m,D){return m.x<=D.right&&m.x>=D.left&&m.y<=D.bottom&&m.y>=D.top}function We(m,D,_){let $=D==="width"?"height":"width";return{[$]:m[D]?Math.round(_*m[$]/m[D]):m[$],[D]:_}}function Le(m,D){m={...m};for(let _ in m)m=m[_]>D[_]?We(m,_,D[_]):m;return m}function lt(m,D){m=Le(m,D);for(let _ in m)m=m[_]D[_]||(D[_]=m(_,...$))}function Ue(m,...D){for(let _ of Z(m)){let $=ot(D).filter(Q=>!Be(_,Q));$.length&&_.classList.add(...$)}}function ge(m,...D){for(let _ of Z(m)){let $=ot(D).filter(Q=>Be(_,Q));$.length&&_.classList.remove(...$)}}function Re(m,D,_){_=ot(_),D=ot(D).filter($=>!f(_,$)),ge(m,D),Ue(m,_)}function Be(m,D){return[D]=ot(D),Z(m).some(_=>_.classList.contains(D))}function Ke(m,D,_){let $=ot(D);V(_)||(_=!!_);for(let Q of Z(m))for(let ae of $)Q.classList.toggle(ae,_)}function ot(m){return m?h(m)?m.map(ot).flat():String(m).split(" ").filter(Boolean):[]}function Qe(m,D,_){var $;if(A(D)){for(let Q in D)Qe(m,Q,D[Q]);return}if(V(_))return($=Y(m))==null?void 0:$.getAttribute(D);for(let Q of Z(m))w(_)&&(_=_.call(Q,Qe(Q,D))),_===null?Pt(Q,D):Q.setAttribute(D,_)}function ut(m,D){return Z(m).some(_=>_.hasAttribute(D))}function Pt(m,D){Z(m).forEach(_=>_.removeAttribute(D))}function fe(m,D){for(let _ of[D,`data-${D}`])if(ut(m,_))return Qe(m,_)}let J=typeof window<"u",j=J&&document.dir==="rtl",ne=J&&"ontouchstart"in window,me=J&&window.PointerEvent,xe=me?"pointerdown":ne?"touchstart":"mousedown",_e=me?"pointermove":ne?"touchmove":"mousemove",Je=me?"pointerup":ne?"touchend":"mouseup",nt=me?"pointerenter":ne?"":"mouseenter",Xe=me?"pointerleave":ne?"":"mouseleave",pt=me?"pointercancel":"touchcancel",X={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};function ye(m){return Z(m).some(D=>X[D.tagName.toLowerCase()])}let Ye=J&&Element.prototype.checkVisibility||function(){return this.offsetWidth||this.offsetHeight||this.getClientRects().length};function je(m){return Z(m).some(D=>Ye.call(D))}let wt="input,select,textarea,button";function Bt(m){return Z(m).some(D=>rr(D,wt))}let fr=`${wt},a[href],[tabindex]`;function Gr(m){return rr(m,fr)}function Gt(m){var D;return(D=Y(m))==null?void 0:D.parentElement}function xi(m,D){return Z(m).filter(_=>rr(_,D))}function rr(m,D){return Z(m).some(_=>_.matches(D))}function ao(m,D){let _=[];for(;m=Gt(m);)(!D||rr(m,D))&&_.push(m);return _}function Sr(m,D){m=Y(m);let _=m?x(m.children):[];return D?xi(_,D):_}function _n(m,D){return D?Z(m).indexOf(Y(D)):Sr(Gt(m)).indexOf(m)}function _a(m){return m=Y(m),m&&["origin","pathname","search"].every(D=>m[D]===location[D])}function ka(m){if(_a(m)){let{hash:D,ownerDocument:_}=Y(m),$=decodeURIComponent(D).slice(1);return _.getElementById($)||_.getElementsByName($)[0]}}function Hn(m,D){return qo(m,na(m,D))}function ra(m,D){return ni(m,na(m,D))}function qo(m,D){return Y(uo(m,Y(D),"querySelector"))}function ni(m,D){return Z(uo(m,Y(D),"querySelectorAll"))}function na(m,D=document){return R(m)&&hs(m).isContextSelector||M(D)?D:D.ownerDocument}let Ul=/([!>+~-])(?=\s+[!>+~-]|\s*$)/g,Eo=/.*?[^\\](?![^(]*\))(?:,|$)/g,fc=/\s*,$/,hs=be(m=>{var D;m=m.replace(Ul,"$1 *");let _=!1,$=[];for(let Q of(D=m.match(Eo))!=null?D:[])Q=Q.replace(fc,"").trim(),_||(_=["!","+","~","-",">"].includes(Q[0])),$.push(Q);return{selector:$.join(","),selectors:$,isContextSelector:_}}),so=be(m=>{m=m.slice(1).trim();let D=m.indexOf(" ");return~D?[m.slice(0,D),m.slice(D+1)]:[m,""]});function uo(m,D=document,_){if(!m||!R(m))return m;let $=hs(m);if(!$.isContextSelector)return ia(D,_,$.selector);m="";let Q=$.selectors.length===1;for(let ae of $.selectors){let pe,Ne=D;if(ae[0]==="!"&&([pe,ae]=so(ae),Ne=D.parentElement.closest(pe),!ae&&Q)||Ne&&ae[0]==="-"&&([pe,ae]=so(ae),Ne=Ne.previousElementSibling,Ne=rr(Ne,pe)?Ne:null,!ae&&Q))return Ne;if(Ne){if(Q)return ae[0]==="~"||ae[0]==="+"?(ae=`:scope > :nth-child(${_n(Ne)+1}) ${ae}`,Ne=Ne.parentElement):ae[0]===">"&&(ae=`:scope ${ae}`),ia(Ne,_,ae);m+=`${m?",":""}${nu(Ne)} ${ae}`}}return M(D)||(D=D.ownerDocument),ia(D,_,m)}function ia(m,D,_){try{return m[D](_)}catch{return null}}function nu(m){let D=[];for(;m.parentNode;){let _=Qe(m,"id");if(_){D.unshift(`#${Ba(_)}`);break}else{let{tagName:$}=m;$!=="HTML"&&($+=`:nth-child(${_n(m)+1})`),D.unshift($),m=m.parentNode}}return D.join(" > ")}function Ba(m){return R(m)?CSS.escape(m):""}function jt(...m){let[D,_,$,Q,ae=!1]=Qr(m);Q.length>1&&(Q=oa(Q)),ae?.self&&(Q=$u(Q)),$&&(Q=zt($,Q));for(let pe of _)for(let Ne of D)Ne.addEventListener(pe,Q,ae);return()=>Gi(D,_,Q,ae)}function Gi(...m){let[D,_,,$,Q=!1]=Qr(m);for(let ae of _)for(let pe of D)pe.removeEventListener(ae,$,Q)}function Or(...m){let[D,_,$,Q,ae=!1,pe]=Qr(m),Ne=jt(D,_,$,Fe=>{let et=!pe||pe(Fe);et&&(Ne(),Q(Fe,et))},ae);return Ne}function qt(m,D,_){return Me(m).every($=>$.dispatchEvent(So(D,!0,!0,_)))}function So(m,D=!0,_=!1,$){return R(m)&&(m=new CustomEvent(m,{bubbles:D,cancelable:_,detail:$})),m}function Qr(m){return m[0]=Me(m[0]),R(m[1])&&(m[1]=m[1].split(" ")),w(m[2])&&m.splice(2,0,!1),m}function zt(m,D){return _=>{let $=m[0]===">"?ni(m,_.currentTarget).reverse().find(Q=>Q.contains(_.target)):_.target.closest(m);$&&(_.current=$,D.call(this,_),delete _.current)}}function oa(m){return D=>h(D.detail)?m(D,...D.detail):m(D)}function $u(m){return function(D){if(D.target===D.currentTarget||D.target===D.current)return m.call(null,D)}}function $n(m){return m&&"addEventListener"in m}function ue(m){return $n(m)?m:Y(m)}function Me(m){return h(m)?m.map(ue).filter(Boolean):R(m)?ni(m):$n(m)?[m]:Z(m)}function st(m){return m.pointerType==="touch"||!!m.touches}function dt(m){var D,_;let{clientX:$,clientY:Q}=((D=m.touches)==null?void 0:D[0])||((_=m.changedTouches)==null?void 0:_[0])||m;return{x:$,y:Q}}let rt={"animation-iteration-count":!0,"column-count":!0,"fill-opacity":!0,"flex-grow":!0,"flex-shrink":!0,"font-weight":!0,"line-height":!0,opacity:!0,order:!0,orphans:!0,"stroke-dasharray":!0,"stroke-dashoffset":!0,widows:!0,"z-index":!0,zoom:!0};function ke(m,D,_,$){let Q=Z(m);for(let ae of Q)if(R(D)){if(D=Mr(D),V(_))return getComputedStyle(ae).getPropertyValue(D);ae.style.setProperty(D,U(_)&&!rt[D]?`${_}px`:_||q(_)?_:"",$)}else if(h(D)){let pe={};for(let Ne of D)pe[Ne]=ke(ae,Ne);return pe}else if(A(D))for(let pe in D)ke(ae,pe,D[pe],_);return Q[0]}let Mr=be(m=>{if(a(m,"--"))return m;m=i(m);let{style:D}=document.documentElement;if(m in D)return m;for(let _ of["webkit","moz"]){let $=`-${_}-${m}`;if($ in D)return $}}),kn="uk-transition",wi="transitionend",iu="transitioncanceled";function w1(m,D,_=400,$="linear"){return _=Math.round(_),Promise.all(Z(m).map(Q=>new Promise((ae,pe)=>{for(let Fe in D)ke(Q,Fe);let Ne=setTimeout(()=>qt(Q,wi),_);Or(Q,[wi,iu],({type:Fe})=>{clearTimeout(Ne),ge(Q,kn),ke(Q,{transitionProperty:"",transitionDuration:"",transitionTimingFunction:""}),Fe===iu?pe():ae(Q)},{self:!0}),Ue(Q,kn),ke(Q,{transitionProperty:Object.keys(D).map(Mr).join(","),transitionDuration:`${_}ms`,transitionTimingFunction:$,...D})})))}let Tt={start:w1,async stop(m){qt(m,wi),await Promise.resolve()},async cancel(m){qt(m,iu),await Promise.resolve()},inProgress(m){return Be(m,kn)}},cc="uk-animation",Wd="animationend",Wu="animationcanceled";function aa(m,D,_=200,$,Q){return Promise.all(Z(m).map(ae=>new Promise((pe,Ne)=>{Be(ae,cc)&&qt(ae,Wu);let Fe=[D,cc,`${cc}-${Q?"leave":"enter"}`,$&&`uk-transform-origin-${$}`,Q&&`${cc}-reverse`],et=setTimeout(()=>qt(ae,Wd),_);Or(ae,[Wd,Wu],({type:it})=>{clearTimeout(et),it===Wu?Ne():pe(ae),ke(ae,"animationDuration",""),ge(ae,Fe)},{self:!0}),ke(ae,"animationDuration",`${_}ms`),Ue(ae,Fe)})))}let ds={in:aa,out(m,D,_,$){return aa(m,D,_,$,!0)},inProgress(m){return Be(m,cc)},cancel(m){qt(m,Wu)}};function b1(m){if(document.readyState!=="loading"){m();return}Or(document,"DOMContentLoaded",m)}function jr(m,...D){return D.some(_=>{var $;return(($=m?.tagName)==null?void 0:$.toLowerCase())===_.toLowerCase()})}function sm(m){return m=vr(m),m.innerHTML="",m}function gs(m,D){return V(D)?vr(m).innerHTML:En(sm(m),D)}let Vd=hc("prepend"),En=hc("append"),pc=hc("before"),mc=hc("after");function hc(m){return function(D,_){var $;let Q=Z(R(_)?Vu(_):_);return($=vr(D))==null||$[m](...Q),dc(Q)}}function Ao(m){Z(m).forEach(D=>D.remove())}function um(m,D){for(D=Y(pc(m,D));D.firstElementChild;)D=D.firstElementChild;return En(D,m),D}function lm(m,D){return Z(Z(m).map(_=>_.hasChildNodes()?um(x(_.childNodes),D):En(_,D)))}function Co(m){Z(m).map(Gt).filter((D,_,$)=>$.indexOf(D)===_).forEach(D=>D.replaceWith(...D.childNodes))}let vN=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;function Vu(m){let D=vN.exec(m);if(D)return document.createElement(D[1]);let _=document.createElement("template");return _.innerHTML=m.trim(),dc(_.content.childNodes)}function dc(m){return m.length>1?m:m[0]}function zo(m,D){if(F(m))for(D(m),m=m.firstElementChild;m;){let _=m.nextElementSibling;zo(m,D),m=_}}function vr(m,D){return D1(m)?Y(Vu(m)):qo(m,D)}function tn(m,D){return D1(m)?Z(Vu(m)):ni(m,D)}function D1(m){return R(m)&&a(m.trim(),"<")}let Gu={width:["left","right"],height:["top","bottom"]};function Ht(m){let D=F(m)?Y(m).getBoundingClientRect():{height:Yi(m),width:Yu(m),top:0,left:0};return{height:D.height,width:D.width,top:D.top,left:D.left,bottom:D.top+D.height,right:D.left+D.width}}function Dr(m,D){D&&ke(m,{left:0,top:0});let _=Ht(m);if(m){let{scrollY:$,scrollX:Q}=le(m),ae={height:$,width:Q};for(let pe in Gu)for(let Ne of Gu[pe])_[Ne]+=ae[pe]}if(!D)return _;for(let $ of["left","top"])ke(m,$,D[$]-_[$])}function Gd(m){let{top:D,left:_}=Dr(m),{ownerDocument:{body:$,documentElement:Q},offsetParent:ae}=Y(m),pe=ae||Q;for(;pe&&(pe===$||pe===Q)&&ke(pe,"position")==="static";)pe=pe.parentNode;if(F(pe)){let Ne=Dr(pe);D-=Ne.top+ie(ke(pe,"borderTopWidth")),_-=Ne.left+ie(ke(pe,"borderLeftWidth"))}return{top:D-ie(ke(m,"marginTop")),left:_-ie(ke(m,"marginLeft"))}}function Hl(m){m=Y(m);let D=[m.offsetTop,m.offsetLeft];for(;m=m.offsetParent;)if(D[0]+=m.offsetTop+ie(ke(m,"borderTopWidth")),D[1]+=m.offsetLeft+ie(ke(m,"borderLeftWidth")),ke(m,"position")==="fixed"){let _=le(m);return D[0]+=_.scrollY,D[1]+=_.scrollX,D}return D}let Yi=gc("height"),Yu=gc("width");function gc(m){let D=l(m);return(_,$)=>{if(V($)){if(O(_))return _[`inner${D}`];if(M(_)){let Q=_.documentElement;return Math.max(Q[`offset${D}`],Q[`scroll${D}`])}return _=Y(_),$=ke(_,m),$=$==="auto"?_[`offset${D}`]:ie($)||0,$-ou(_,m)}else return ke(_,m,!$&&$!==0?"":+$+ou(_,m)+"px")}}function ou(m,D,_="border-box"){return ke(m,"boxSizing")===_?Ee(Gu[D].map(l),$=>ie(ke(m,`padding${$}`))+ie(ke(m,`border${$}Width`))):0}function vc(m){for(let D in Gu)for(let _ in Gu[D])if(Gu[D][_]===m)return Gu[D][1-_];return m}function ii(m,D="width",_=window,$=!1){return R(m)?Ee(yN(m),Q=>{let ae=sa(Q);return ae?xN(ae==="vh"?E1():ae==="vw"?Yu(le(_)):$?_[`offset${l(D)}`]:Ht(_)[D],Q):Q}):ie(m)}let fm=/-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g,yN=be(m=>m.toString().replace(/\s/g,"").match(fm)||[]),N1=/(?:v[hw]|%)$/,sa=be(m=>(m.match(N1)||[])[0]);function xN(m,D){return m*ie(D)/100}let yc,au;function E1(){return yc||(au||(au=vr("
"),ke(au,{height:"100vh",position:"fixed"}),jt(window,"resize",()=>yc=null)),En(document.body,au),yc=au.clientHeight,Ao(au),yc)}let Zi={read:cm,write:Yd,clear:Wl,flush:S1},$l=[],Uo=[];function cm(m){return $l.push(m),Xd(),m}function Yd(m){return Uo.push(m),Xd(),m}function Wl(m){Kd($l,m),Kd(Uo,m)}let Zd=!1;function S1(){A1($l),A1(Uo.splice(0)),Zd=!1,($l.length||Uo.length)&&Xd()}function Xd(){Zd||(Zd=!0,queueMicrotask(S1))}function A1(m){let D;for(;D=m.shift();)try{D()}catch(_){console.error(_)}}function Kd(m,D){let _=m.indexOf(D);return~_&&m.splice(_,1)}class Jd{init(){this.positions=[];let D;this.unbind=jt(document,"mousemove",_=>D=dt(_)),this.interval=setInterval(()=>{D&&(this.positions.push(D),this.positions.length>5&&this.positions.shift())},50)}cancel(){var D;(D=this.unbind)==null||D.call(this),clearInterval(this.interval)}movesTo(D){if(!this.positions||this.positions.length<2)return!1;let _=Ht(D),{left:$,right:Q,top:ae,bottom:pe}=_,[Ne]=this.positions,Fe=De(this.positions),et=[Ne,Fe];return ze(Fe,_)?!1:[[{x:$,y:ae},{x:Q,y:pe}],[{x:$,y:pe},{x:Q,y:ae}]].some(ht=>{let Ot=wN(et,ht);return Ot&&ze(Ot,_)})}}function wN([{x:m,y:D},{x:_,y:$}],[{x:Q,y:ae},{x:pe,y:Ne}]){let Fe=(Ne-ae)*(_-m)-(pe-Q)*($-D);if(Fe===0)return!1;let et=((pe-Q)*(D-ae)-(Ne-ae)*(m-Q))/Fe;return et<0?!1:{x:m+et*(_-m),y:D+et*($-D)}}function C1(m,D,_={},{intersecting:$=!0}={}){let Q=new IntersectionObserver($?(ae,pe)=>{ae.some(Ne=>Ne.isIntersecting)&&D(ae,pe)}:D,_);for(let ae of Z(m))Q.observe(ae);return Q}let bN=J&&window.ResizeObserver;function xc(m,D,_={box:"border-box"}){if(bN)return jd(ResizeObserver,m,D,_);let $=[jt(window,"load resize",D),jt(document,"loadedmetadata load",D,!0)];return{disconnect:()=>$.map(Q=>Q())}}function pm(m){return{disconnect:jt([window,window.visualViewport],"resize",m)}}function Qd(m,D,_){return jd(MutationObserver,m,D,_)}function jd(m,D,_,$){let Q=new m(_);for(let ae of Z(D))Q.observe(ae,$);return Q}function Vl(m){su(m)&&hm(m,{func:"playVideo",method:"play"}),mm(m)&&m.play()}function vs(m){su(m)&&hm(m,{func:"pauseVideo",method:"pause"}),mm(m)&&m.pause()}function M1(m){su(m)&&hm(m,{func:"mute",method:"setVolume",value:0}),mm(m)&&(m.muted=!0)}function T1(m){return mm(m)||su(m)}function mm(m){return jr(m,"video")}function su(m){return jr(m,"iframe")&&(Wn(m)||O1(m))}function Wn(m){return!!m.src.match(/\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\/.*/)}function O1(m){return!!m.src.match(/vimeo\.com\/video\/.*/)}async function hm(m,D){await DN(m),Gl(m,D)}function Gl(m,D){m.contentWindow.postMessage(JSON.stringify({event:"command",...D}),"*")}let eg="_ukPlayer",I1=0;function DN(m){if(m[eg])return m[eg];let D=Wn(m),_=O1(m),$=++I1,Q;return m[eg]=new Promise(ae=>{D&&Or(m,"load",()=>{let pe=()=>Gl(m,{event:"listening",id:$});Q=setInterval(pe,100),pe()}),Or(window,"message",ae,!1,({data:pe})=>{try{return pe=JSON.parse(pe),D&&pe?.id===$&&pe.event==="onReady"||_&&Number(pe?.player_id)===$}catch{}}),m.src=`${m.src}${f(m.src,"?")?"&":"?"}${D?"enablejsapi=1":`api=1&player_id=${$}`}`}).then(()=>clearInterval(Q))}function tg(m,D=0,_=0){return je(m)?Se(...uu(m).map($=>{let{top:Q,left:ae,bottom:pe,right:Ne}=Mo($);return{top:Q-D,left:ae-_,bottom:pe+D,right:Ne+_}}).concat(Dr(m))):!1}function rg(m,{offset:D=0}={}){let _=je(m)?Zu(m,!1,["hidden"]):[];return _.reduce((pe,Ne,Fe)=>{let{scrollTop:et,scrollHeight:it,offsetHeight:ht}=Ne,Ot=Mo(Ne),Ut=it-Ot.height,{height:lr,top:Ar}=_[Fe-1]?Mo(_[Fe-1]):Dr(m),Rr=Math.ceil(Ar-Ot.top-D+et);return D>0&&htUt?(D-=Rr-Ut,Rr=Ut):Rr<0&&(D-=Rr,Rr=0),()=>$(Ne,Rr-et,m,Ut).then(pe)},()=>Promise.resolve())();function $(pe,Ne,Fe,et){return new Promise(it=>{let ht=pe.scrollTop,Ot=Q(Math.abs(Ne)),Ut=Date.now(),lr=wc(pe)===pe,Ar=Dr(Fe).top+(lr?0:ht),Rr=0,xu=15;(function $m(){let Wm=ae(Oe((Date.now()-Ut)/Ot)),wu=0;_[0]===pe&&ht+Neke(pe,"position")==="fixed");return~ae&&(Q=Q.slice(ae)),[$].concat(Q.filter(pe=>ke(pe,"overflow").split(" ").some(Ne=>f(["auto","scroll",..._],Ne))&&(!D||pe.scrollHeight>Mo(pe).height))).reverse()}function ys(...m){return Zu(...m)[0]}function uu(m){return Zu(m,!1,["hidden","clip"])}function Mo(m){let D=le(m),_=m===wc(m)?D:m;if(O(_)&&D.visualViewport){let{height:Q,width:ae,scale:pe,pageTop:Ne,pageLeft:Fe}=D.visualViewport;return Q=Math.round(Q*pe),ae=Math.round(ae*pe),{height:Q,width:ae,top:Ne,left:Fe,bottom:Ne+Q,right:Fe+ae}}let $=Dr(_);if(ke(_,"display")==="inline")return $;for(let[Q,ae,pe,Ne]of[["width","x","left","right"],["height","y","top","bottom"]]){O(_)?_=_.document:$[pe]+=ie(ke(_,`border-${pe}-width`));let Fe=$[Q]%1;$[Q]=$[ae]=_[`client${l(Q)}`]-(Fe?Fe<.5?-Fe:1-Fe:0),$[Ne]=$[Q]+$[pe]}return $}function Xu(m){let{left:D,width:_,top:$}=Ht(m);for(let Q of $?[0,$]:[0]){let ae;for(let pe of le(m).document.elementsFromPoint(D+_/2,Q))!pe.contains(m)&&!Be(pe,"uk-togglable-leave")&&(Yl(pe,"fixed")&&La(ao(m).reverse().find(Ne=>!Ne.contains(pe)&&!Yl(Ne,"static")))=Ot[it])continue;Ut=_1(m,D,_,Fe)[it]-$[it];let Ar=F1(m,D[Fe],ae,Fe);if(!To(ng($,Ut,Fe),Ar,Fe)){if(To($,Ar,Fe))continue;if(_.recursion)return!1;let Rr=k1(m,D,_);if(Rr&&To(Rr,Ar,1-Fe))return Rr;continue}}else if(pe[Fe]==="shift"){let lr=Dr(D[Fe]),{offset:Ar}=_;Ut=Oe(Oe($[it],Ot[it],Ot[ht]-$[et]),lr[it]-$[et]+Ar[Fe],lr[ht]-Ar[Fe])-$[it]}Ne=ng(Ne,Ut,Fe)}return Ne}function gm(m,D,_){let{attach:$,offset:Q}={attach:{element:["left","top"],target:["left","top"],..._.attach},offset:[0,0],..._},ae=Dr(m);for(let[pe,[Ne,,Fe,et]]of Object.entries(lo)){let it=$.target[pe]===$.element[pe]?Mo(D[pe]):Dr(D[pe]);ae=ng(ae,it[Fe]-ae[Fe]+ig($.target[pe],et,it[Ne])-ig($.element[pe],et,ae[Ne])+ +Q[pe],pe)}return ae}function ng(m,D,_){let[,$,Q,ae]=lo[_],pe={...m};return pe[Q]=m[$]=m[Q]+D,pe[ae]+=D,pe}function ig(m,D,_){return m==="center"?_/2:m===D?_:0}function NN(m,D,_,$,Q){let ae=Ku(...vm(m,D).map(Mo));return _&&(ae[lo[Q][2]]+=_,ae[lo[Q][3]]-=_),$&&(ae=Ku(ae,Dr(h($)?$[Q]:$))),ae}function F1(m,D,_,$){let[Q,ae,pe,Ne]=lo[$],[Fe]=vm(m,D),et=Mo(Fe);return["auto","scroll"].includes(ke(Fe,`overflow-${ae}`))&&(et[pe]-=Fe[`scroll${l(pe)}`],et[Ne]=et[pe]+Fe[`scroll${l(Q)}`]),et[pe]+=_,et[Ne]-=_,et}function vm(m,D){return uu(D).filter(_=>_.contains(m))}function Ku(...m){let D={};for(let _ of m)for(let[,,$,Q]of lo)D[$]=Math.max(D[$]||0,_[$]),D[Q]=Math.min(...[D[Q],_[Q]].filter(Boolean));return D}function To(m,D,_){let[,,$,Q]=lo[_];return m[$]>=D[$]&&m[Q]<=D[Q]}function _1(m,D,{offset:_,attach:$},Q){return gm(m,D,{attach:{element:B1($.element,Q),target:B1($.target,Q)},offset:EN(_,Q)})}function k1(m,D,_){return lu(m,D,{..._,attach:{element:_.attach.element.map(L1).reverse(),target:_.attach.target.map(L1).reverse()},offset:_.offset.reverse(),placement:_.placement.reverse(),recursion:!0})}function B1(m,D){let _=[...m],$=lo[D].indexOf(m[D]);return~$&&(_[D]=lo[D][1-$%2+2]),_}function L1(m){for(let D=0;Ddocument,handler(){document.hidden?this.stop():this.start()}},methods:{start(){this.stop(),this.update(),this.timer||(qt(this.$el,"countdownstart"),this.timer=setInterval(this.update,1e3))},stop(){this.timer&&(clearInterval(this.timer),qt(this.$el,"countdownstop"),this.timer=null)},update(){let m=q1(this.date);m.total||(this.stop(),this.end||(qt(this.$el,"countdownend"),this.end=!0));for(let D of bc){let _=vr(this.clsWrapper.replace("%unit%",D),this.$el);if(!_)continue;let $=Math.trunc(m[D]).toString().padStart(2,"0");_.textContent!==$&&($=$.split(""),$.length!==_.children.length&&gs(_,$.map(()=>"").join("")),$.forEach((Q,ae)=>_.children[ae].textContent=Q))}}}};function q1(m){let D=Math.max(0,m-Date.now())/1e3;return{total:D,seconds:D%60,minutes:D/60%60,hours:D/60/60%24,days:D/60/60/24}}let Bn={};Bn.events=Bn.watch=Bn.observe=Bn.created=Bn.beforeConnect=Bn.connected=Bn.beforeDisconnect=Bn.disconnected=Bn.destroy=ym,Bn.args=function(m,D){return D!==!1&&ym(D||m)},Bn.update=function(m,D){return ce(ym(m,w(D)?{read:D}:D),"order")},Bn.props=function(m,D){if(h(D)){let _={};for(let $ of D)_[$]=String;D=_}return Bn.methods(m,D)},Bn.computed=Bn.methods=function(m,D){return D?m?{...m,...D}:D:m},Bn.i18n=Bn.data=function(m,D,_){return _?Dc(m,D,_):D?m?function($){return Dc(m,D,$)}:D:m};function Dc(m,D,_){return Bn.computed(w(m)?m.call(_,_):m,w(D)?D.call(_,_):D)}function ym(m,D){return m=m&&!h(m)?[m]:m,D?m?m.concat(D):h(D)?D:[D]:m}function xm(m,D){return V(D)?m:D}function Ki(m,D,_){let $={};if(w(D)&&(D=D.options),D.extends&&(m=Ki(m,D.extends,_)),D.mixins)for(let ae of D.mixins)m=Ki(m,ae,_);for(let ae in m)Q(ae);for(let ae in D)r(m,ae)||Q(ae);function Q(ae){$[ae]=(Bn[ae]||xm)(m[ae],D[ae],_)}return $}function Ju(m,D=[]){try{return m?a(m,"{")?JSON.parse(m):D.length&&!f(m,":")?{[D[0]]:m}:m.split(";").reduce((_,$)=>{let[Q,ae]=$.split(/:(.*)/);return Q&&!V(ae)&&(_[Q.trim()]=ae.trim()),_},{}):{}}catch{return{}}}function Nc(m,D){return m===Boolean?W(D):m===Number?ee(D):m==="list"?z1(D):m===Object&&R(D)?Ju(D):m?m(D):D}let og=/,(?![^(]*\))/;function z1(m){return h(m)?m:R(m)?m.split(og).map(D=>U(D)?ee(D):W(D.trim())):[m]}function U1(m){m._data={},m._updates=[...m.$options.update||[]]}function ag(m,D){m._updates.unshift(D)}function SN(m){m._data=null}function Ec(m,D="update"){m._connected&&m._updates.length&&(m._queued||(m._queued=new Set,Zi.read(()=>{m._connected&&AN(m,m._queued),m._queued=null})),m._queued.add(D.type||D))}function AN(m,D){for(let{read:_,write:$,events:Q=[]}of m._updates){if(!D.has("update")&&!Q.some(pe=>D.has(pe)))continue;let ae;_&&(ae=_.call(m,m._data,D),ae&&E(ae)&&b(m._data,ae)),$&&ae!==!1&&Zi.write(()=>{m._connected&&$.call(m,m._data,D)})}}function li(m){return fa(xc,m,"resize")}function la(m){return fa(C1,m)}function xs(m){return fa(Qd,m)}function Zl(m={}){return la({handler:function(D,_){let{targets:$=this.$el,preload:Q=5}=m;for(let ae of Z(w($)?$(this):$))tn('[loading="lazy"]',ae).slice(0,Q-1).forEach(pe=>Pt(pe,"loading"));for(let ae of D.filter(({isIntersecting:pe})=>pe).map(({target:pe})=>pe))_.unobserve(ae)},...m})}function Sc(m){return fa((D,_)=>pm(_),m,"resize")}function Xl(m){return fa((D,_)=>({disconnect:jt(Ji(D),"scroll",_,{passive:!0})}),m,"scroll")}function wm(m){return{observe(D,_){return{observe:He,unobserve:He,disconnect:jt(D,xe,_,{passive:!0})}},handler(D){if(!st(D))return;let _=dt(D),$="tagName"in D.target?D.target:Gt(D.target);Or(document,`${Je} ${pt} scroll`,Q=>{let{x:ae,y:pe}=dt(Q);(Q.type!=="scroll"&&$&&ae&&Math.abs(_.x-ae)>100||pe&&Math.abs(_.y-pe)>100)&&setTimeout(()=>{qt($,"swipe"),qt($,`swipe${Qu(_.x,_.y,ae,pe)}`)})})},...m}}function fa(m,D,_){return{observe:m,handler(){Ec(this,_)},...D}}function Qu(m,D,_,$){return Math.abs(m-_)>=Math.abs(D-$)?m-_>0?"Left":"Right":D-$>0?"Up":"Down"}function Ji(m){return Z(m).map(D=>{let{ownerDocument:_}=D,$=ys(D,!0);return $===_.scrollingElement?_:$})}var ws={props:{margin:String,firstColumn:Boolean},data:{margin:"uk-margin-small-top",firstColumn:"uk-first-column"},observe:[xs({options:{childList:!0}}),xs({options:{attributes:!0,attributeFilter:["style"]},target:({$el:m})=>[m,...Sr(m)]}),li({target:({$el:m})=>[m,...Sr(m)]})],update:{read(){return{rows:Pa(Sr(this.$el))}},write({rows:m}){for(let D of m)for(let _ of D)Ke(_,this.margin,m[0]!==D),Ke(_,this.firstColumn,D[j?D.length-1:0]===_)},events:["resize"]}};function Pa(m){let D=[[]],_=m.some(($,Q)=>Q&&m[Q-1].offsetParent!==$.offsetParent);for(let $ of m){if(!je($))continue;let Q=Kl($,_);for(let ae=D.length-1;ae>=0;ae--){let pe=D[ae];if(!pe[0]){pe.push($);break}let Ne=Kl(pe[0],_);if(Q.top>=Ne.bottom-1&&Q.top!==Ne.top){D.push([$]);break}if(Q.bottom-1>Ne.top||Q.top===Ne.top){let Fe=pe.length-1;for(;Fe>=0;Fe--){let et=Kl(pe[Fe],_);if(Q.left>=et.left)break}pe.splice(Fe+1,0,$);break}if(ae===0){D.unshift([$]);break}}}return D}function Kl(m,D=!1){let{offsetTop:_,offsetLeft:$,offsetHeight:Q,offsetWidth:ae}=m;return D&&([_,$]=Hl(m)),{top:_,left:$,bottom:_+Q,right:$+ae}}async function CN(m,D,_){await Jl();let $=Sr(D),Q=$.map(Ut=>sg(Ut,!0)),ae={...ke(D,["height","padding"]),display:"block"},pe=$.concat(D);await Promise.all(pe.map(Tt.cancel)),ke(pe,"transitionProperty","none"),await m(),$=$.concat(Sr(D).filter(Ut=>!f($,Ut))),await Promise.resolve(),ke(pe,"transitionProperty","");let Ne=Qe(D,"style"),Fe=ke(D,["height","padding"]),[et,it]=Ac(D,$,Q),ht=$.map(Ut=>({style:Qe(Ut,"style")}));$.forEach((Ut,lr)=>it[lr]&&ke(Ut,it[lr])),ke(D,ae),qt(D,"scroll"),await Jl();let Ot=$.map((Ut,lr)=>Gt(Ut)===D&&Tt.start(Ut,et[lr],_,"ease")).concat(Tt.start(D,Fe,_,"ease"));try{await Promise.all(Ot),$.forEach((Ut,lr)=>{Qe(Ut,ht[lr]),Gt(Ut)===D&&ke(Ut,"display",et[lr].opacity===0?"none":"")}),Qe(D,"style",Ne)}catch{Qe($,"style",""),H1(D,ae)}}function sg(m,D){let _=ke(m,"zIndex");return je(m)?{display:"",opacity:D?ke(m,"opacity"):"0",pointerEvents:"none",position:"absolute",zIndex:_==="auto"?_n(m):_,...bm(m)}:!1}function Ac(m,D,_){let $=D.map((ae,pe)=>Gt(ae)&&pe in _?_[pe]?je(ae)?bm(ae):{opacity:0}:{opacity:je(ae)?1:0}:!1),Q=$.map((ae,pe)=>{let Ne=Gt(D[pe])===m&&(_[pe]||sg(D[pe]));if(!Ne)return!1;if(!ae)delete Ne.opacity;else if(!("opacity"in ae)){let{opacity:Fe}=Ne;Fe%1?ae.opacity=1:delete Ne.opacity}return Ne});return[$,Q]}function H1(m,D){for(let _ in D)ke(m,_,"")}function bm(m){let{height:D,width:_}=Ht(m);return{height:D,width:_,transform:"",...Gd(m),...ke(m,["marginTop","marginLeft"])}}function Jl(){return new Promise(m=>requestAnimationFrame(m))}let ug="uk-transition-leave",Cc="uk-transition-enter";function lg(m,D,_,$=0){let Q=Ql(D,!0),ae={opacity:1},pe={opacity:0},Ne=it=>()=>Q===Ql(D)?it():Promise.reject(),Fe=Ne(async()=>{Ue(D,ug),await Promise.all(ju(D).map((it,ht)=>new Promise(Ot=>setTimeout(()=>Tt.start(it,pe,_/2,"ease").then(Ot),ht*$)))),ge(D,ug)}),et=Ne(async()=>{let it=Yi(D);Ue(D,Cc),m(),ke(Sr(D),{opacity:0}),await Jl();let ht=Sr(D),Ot=Yi(D);ke(D,"alignContent","flex-start"),Yi(D,it);let Ut=ju(D);ke(ht,pe);let lr=Ut.map(async(Ar,Rr)=>{await Nm(Rr*$),await Tt.start(Ar,ae,_/2,"ease")});it!==Ot&&lr.push(Tt.start(D,{height:Ot},_/2+Ut.length*$,"ease")),await Promise.all(lr).then(()=>{ge(D,Cc),Q===Ql(D)&&(ke(D,{height:"",alignContent:""}),ke(ht,{opacity:""}),delete D.dataset.transition)})});return Be(D,ug)?Dm(D).then(et):Be(D,Cc)?Dm(D).then(Fe).then(et):Fe().then(et)}function Ql(m,D){return D&&(m.dataset.transition=1+Ql(m)),ee(m.dataset.transition)||0}function Dm(m){return Promise.all(Sr(m).filter(Tt.inProgress).map(D=>new Promise(_=>Or(D,"transitionend transitioncanceled",_))))}function ju(m){return Pa(Sr(m)).flat().filter(je)}function Nm(m){return new Promise(D=>setTimeout(D,m))}var fg={props:{duration:Number,animation:Boolean},data:{duration:150,animation:"slide"},methods:{animate(m,D=this.$el){let _=this.animation;return(_==="fade"?lg:_==="delayed-fade"?(...Q)=>lg(...Q,40):_?CN:()=>(m(),Promise.resolve()))(m,D,this.duration).catch(He)}}};let Ir={TAB:9,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};var MN={mixins:[fg],args:"target",props:{target:String,selActive:Boolean},data:{target:"",selActive:!1,attrItem:"uk-filter-control",cls:"uk-active",duration:250},computed:{children:({target:m},D)=>tn(`${m} > *`,D),toggles:({attrItem:m},D)=>tn(`[${m}],[data-${m}]`,D)},watch:{toggles(m){this.updateState();let D=tn(this.selActive,this.$el);for(let _ of m){this.selActive!==!1&&Ke(_,this.cls,f(D,_));let $=ON(_);jr($,"a")&&Qe($,"role","button")}},children(m,D){D&&this.updateState()}},events:{name:"click keydown",delegate:({attrItem:m})=>`[${m}],[data-${m}]`,handler(m){m.type==="keydown"&&m.keyCode!==Ir.SPACE||m.target.closest("a,button")&&(m.preventDefault(),this.apply(m.current))}},methods:{apply(m){let D=this.getState(),_=Em(m,this.attrItem,this.getState());TN(D,_)||this.setState(_)},getState(){return this.toggles.filter(m=>Be(m,this.cls)).reduce((m,D)=>Em(D,this.attrItem,m),{filter:{"":""},sort:[]})},async setState(m,D=!0){m={filter:{"":""},sort:[],...m},qt(this.$el,"beforeFilter",[this,m]);for(let _ of this.toggles)Ke(_,this.cls,jl(_,this.attrItem,m));await Promise.all(tn(this.target,this.$el).map(_=>{let $=()=>cg(m,_,Sr(_));return D?this.animate($,_):$()})),qt(this.$el,"afterFilter",[this])},updateState(){Zi.write(()=>this.setState(this.getState(),!1))}}};function $1(m,D){return Ju(fe(m,D),["filter"])}function TN(m,D){return["filter","sort"].every(_=>re(m[_],D[_]))}function cg(m,D,_){let $=Object.values(m.filter).join("");for(let pe of _)ke(pe,"display",$&&!rr(pe,$)?"none":"");let[Q,ae]=m.sort;if(Q){let pe=Mc(_,Q,ae);re(pe,_)||En(D,pe)}}function Em(m,D,_){let{filter:$,group:Q,sort:ae,order:pe="asc"}=$1(m,D);return($||V(ae))&&(Q?$?(delete _.filter[""],_.filter[Q]=$):(delete _.filter[Q],(H(_.filter)||""in _.filter)&&(_.filter={"":$||""})):_.filter={"":$||""}),V(ae)||(_.sort=[ae,pe]),_}function jl(m,D,{filter:_={"":""},sort:[$,Q]}){let{filter:ae="",group:pe="",sort:Ne,order:Fe="asc"}=$1(m,D);return V(Ne)?pe in _&&ae===_[pe]||!ae&&pe&&!(pe in _)&&!_[""]:$===Ne&&Q===Fe}function Mc(m,D,_){return[...m].sort(($,Q)=>fe($,D).localeCompare(fe(Q,D),void 0,{numeric:!0})*(_==="asc"||-1))}function ON(m){return vr("a,button",m)||m}let ef;function pg(m){let D=jt(m,"touchstart",$=>{if($.targetTouches.length!==1||rr($.target,'input[type="range"'))return;let Q=dt($).y,ae=jt(m,"touchmove",pe=>{let Ne=dt(pe).y;Ne!==Q&&(Q=Ne,Zu(pe.target).some(Fe=>{if(!m.contains(Fe))return!1;let{scrollHeight:et,clientHeight:it}=Fe;return it{ef=!1,D(),ke(_,{overflowY:"",touchAction:"",paddingRight:""})}}var bs={props:{container:Boolean},data:{container:!0},computed:{container({container:m}){return m===!0&&this.$container||m&&vr(m)}}},fu={props:{cls:Boolean,animation:"list",duration:Number,velocity:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,velocity:.2,origin:!1,transition:"ease",clsEnter:"uk-togglable-enter",clsLeave:"uk-togglable-leave"},computed:{hasAnimation:({animation:m})=>!!m[0],hasTransition:({animation:m})=>["slide","reveal"].some(D=>a(m[0],D))},methods:{async toggleElement(m,D,_){try{return await Promise.all(Z(m).map($=>{let Q=P(D)?D:!this.isToggled($);if(!qt($,`before${Q?"show":"hide"}`,[this]))return Promise.reject();let ae=(w(_)?_:_===!1||!this.hasAnimation?el:this.hasTransition?Tc:tl)($,Q,this),pe=Q?this.clsEnter:this.clsLeave;Ue($,pe),qt($,Q?"show":"hide",[this]);let Ne=()=>{ge($,pe),qt($,Q?"shown":"hidden",[this])};return ae?ae.then(Ne,()=>(ge($,pe),Promise.reject())):Ne()})),!0}catch{return!1}},isToggled(m=this.$el){return m=Y(m),Be(m,this.clsEnter)?!0:Be(m,this.clsLeave)?!1:this.cls?Be(m,this.cls.split(" ")[0]):je(m)},_toggle(m,D){if(!m)return;D=!!D;let _;this.cls?(_=f(this.cls," ")||D!==Be(m,this.cls),_&&Ke(m,this.cls,f(this.cls," ")?void 0:D)):(_=D===m.hidden,_&&(m.hidden=!D)),tn("[autofocus]",m).some($=>je($)?$.focus()||!0:$.blur()),_&&qt(m,"toggled",[D,this])}}};function el(m,D,{_toggle:_}){return ds.cancel(m),Tt.cancel(m),_(m,D)}async function Tc(m,D,{animation:_,duration:$,velocity:Q,transition:ae,_toggle:pe}){var Ne;let[Fe="reveal",et="top"]=((Ne=_[0])==null?void 0:Ne.split("-"))||[],it=[["left","right"],["top","bottom"]],ht=it[f(it[0],et)?0:1],Ot=ht[1]===et,lr=["width","height"][it.indexOf(ht)],Ar=`margin-${ht[0]}`,Rr=`margin-${et}`,xu=Ht(m)[lr],$m=Tt.inProgress(m);await Tt.cancel(m),D&&pe(m,!0);let Wm=Object.fromEntries(["padding","border","width","height","minWidth","minHeight","overflowY","overflowX",Ar,Rr].map(wO=>[wO,m.style[wO]])),wu=Ht(m),yE=ie(ke(m,Ar)),vO=ie(ke(m,Rr)),rp=wu[lr]+vO;!$m&&!D&&(xu+=vO);let[Ry]=lm(m,"
");ke(Ry,{boxSizing:"border-box",height:wu.height,width:wu.width,...ke(m,["overflow","padding","borderTop","borderRight","borderBottom","borderLeft","borderImage",Rr])}),ke(m,{padding:0,border:0,minWidth:0,minHeight:0,[Rr]:0,width:wu.width,height:wu.height,overflow:"hidden",[lr]:xu});let yO=xu/rp;$=(Q*rp+$)*(D?1-yO:yO);let xO={[lr]:D?rp:0};Ot&&(ke(m,Ar,rp-xu+yE),xO[Ar]=D?yE:rp+yE),!Ot^Fe==="reveal"&&(ke(Ry,Ar,-rp+xu),Tt.start(Ry,{[Ar]:D?0:-rp},$,ae));try{await Tt.start(m,xO,$,ae)}finally{ke(m,Wm),Co(Ry.firstChild),D||pe(m,!1)}}function tl(m,D,_){let{animation:$,duration:Q,_toggle:ae}=_;return D?(ae(m,!0),ds.in(m,$[0],Q,_.origin)):ds.out(m,$[1]||$[0],Q,_.origin).then(()=>ae(m,!1))}let fi=[];var cu={mixins:[Xi,bs,fu],props:{selPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean,role:String},data:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1,role:"dialog"},computed:{panel:({selPanel:m},D)=>vr(m,D),transitionElement(){return this.panel},bgClose({bgClose:m}){return m&&this.panel}},connected(){Qe(this.panel||this.$el,"role",this.role),this.overlay&&Qe(this.panel||this.$el,"aria-modal",!0)},beforeDisconnect(){f(fi,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate:({selClose:m})=>`${m},a[href*="#"]`,handler(m){let{current:D,defaultPrevented:_}=m,{hash:$}=D;!_&&$&&_a(D)&&!this.$el.contains(vr($))?this.hide():rr(D,this.selClose)&&(m.preventDefault(),this.hide())}},{name:"toggle",self:!0,handler(m){m.defaultPrevented||(m.preventDefault(),this.isToggled()===f(fi,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(m){if(f(fi,this))return!1;!this.stack&&fi.length?(Promise.all(fi.map(D=>D.hide())).then(this.show),m.preventDefault()):fi.push(this)}},{name:"show",self:!0,handler(){this.stack&&ke(this.$el,"zIndex",ie(ke(this.$el,"zIndex"))+fi.length);let m=[this.overlay&&V1(this),this.overlay&&pg(this.$el),this.bgClose&&IN(this),this.escClose&&rl(this)];Or(this.$el,"hidden",()=>m.forEach(D=>D&&D()),{self:!0}),Ue(document.documentElement,this.clsPage)}},{name:"shown",self:!0,handler(){Gr(this.$el)||Qe(this.$el,"tabindex","-1"),rr(this.$el,":focus-within")||this.$el.focus()}},{name:"hidden",self:!0,handler(){f(fi,this)&&fi.splice(fi.indexOf(this),1),ke(this.$el,"zIndex",""),fi.some(m=>m.clsPage===this.clsPage)||ge(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&Gt(this.$el)!==this.container?(En(this.container,this.$el),new Promise(m=>requestAnimationFrame(()=>this.show().then(m)))):this.toggleElement(this.$el,!0,mg)},hide(){return this.toggleElement(this.$el,!1,mg)}}};function mg(m,D,{transitionElement:_,_toggle:$}){return new Promise((Q,ae)=>Or(m,"show hide",()=>{var pe;(pe=m._reject)==null||pe.call(m),m._reject=ae,$(m,D);let Ne=Or(_,"transitionstart",()=>{Or(_,"transitionend transitioncancel",Q,{self:!0}),clearTimeout(Fe)},{self:!0}),Fe=setTimeout(()=>{Ne(),Q()},W1(ke(_,"transitionDuration")))})).then(()=>delete m._reject)}function W1(m){return m?s(m,"ms")?ie(m):ie(m)*1e3:0}function V1(m){return jt(document,"focusin",D=>{De(fi)===m&&!m.$el.contains(D.target)&&m.$el.focus()})}function IN(m){return jt(document,xe,({target:D})=>{De(fi)!==m||m.overlay&&!m.$el.contains(D)||m.panel.contains(D)||Or(document,`${Je} ${pt} scroll`,({defaultPrevented:_,type:$,target:Q})=>{!_&&$===Je&&D===Q&&m.hide()},!0)})}function rl(m){return jt(document,"keydown",D=>{D.keyCode===27&&De(fi)===m&&m.hide()})}var Ds={slide:{show(m){return[{transform:Sn(m*-100)},{transform:Sn()}]},percent(m){return Oc(m)},translate(m,D){return[{transform:Sn(D*-100*m)},{transform:Sn(D*100*(1-m))}]}}};function Oc(m){return Math.abs(new DOMMatrix(ke(m,"transform")).m41/m.offsetWidth)}function Sn(m=0,D="%"){return m+=m?D:"",`translate3d(${m}, 0, 0)`}function tf(m){return`scale3d(${m}, ${m}, 1)`}function FN(m,D,_,{animation:$,easing:Q}){let{percent:ae,translate:pe,show:Ne=He}=$,Fe=Ne(_),{promise:et,resolve:it}=G1();return{dir:_,show(ht,Ot=0,Ut){let lr=Ut?"linear":Q;return ht-=Math.round(ht*Oe(Ot,-1,1)),this.translate(Ot),nl(D,"itemin",{percent:Ot,duration:ht,timing:lr,dir:_}),nl(m,"itemout",{percent:1-Ot,duration:ht,timing:lr,dir:_}),Promise.all([Tt.start(D,Fe[1],ht,lr),Tt.start(m,Fe[0],ht,lr)]).then(()=>{this.reset(),it()},He),et},cancel(){return Tt.cancel([D,m])},reset(){for(let ht in Fe[0])ke([D,m],ht,"")},async forward(ht,Ot=this.percent()){return await this.cancel(),this.show(ht,Ot,!0)},translate(ht){this.reset();let Ot=pe(ht,_);ke(D,Ot[1]),ke(m,Ot[0]),nl(D,"itemtranslatein",{percent:ht,dir:_}),nl(m,"itemtranslateout",{percent:1-ht,dir:_})},percent(){return ae(m||D,D,_)},getDistance(){return m?.offsetWidth}}}function nl(m,D,_){qt(m,So(D,!1,!1,_))}function G1(){let m;return{promise:new Promise(D=>m=D),resolve:m}}var bi={props:{i18n:Object},data:{i18n:null},methods:{t(m,...D){var _,$,Q;let ae=0;return((Q=((_=this.i18n)==null?void 0:_[m])||(($=this.$options.i18n)==null?void 0:$[m]))==null?void 0:Q.replace(/%s/g,()=>D[ae++]||""))||""}}},oi={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){Qe(this.list,"aria-live",this.autoplay?"off":"polite"),this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){Qe(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el:()=>document,filter:({autoplay:m})=>m,handler(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay(){this.stopAutoplay(),this.interval=setInterval(()=>{this.stack.length||this.draggable&&rr(this.$el,":focus-within")&&!rr(this.$el,":focus")||this.pauseOnHover&&rr(this.$el,":hover")||this.show("next")},this.autoplayInterval)},stopAutoplay(){clearInterval(this.interval)}}};let Vn={passive:!1,capture:!0},Gn={passive:!0,capture:!0},Ic="touchstart mousedown",hg="touchmove mousemove",Fc="touchend touchcancel mouseup click input scroll",Y1=m=>m.preventDefault();var _N={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(let m of["start","move","end"]){let D=this[m];this[m]=_=>{let $=dt(_).x*(j?-1:1);this.prevPos=$===this.pos?this.prevPos:this.pos,this.pos=$,D(_)}}},events:[{name:Ic,passive:!0,delegate:({selList:m})=>`${m} > *`,handler(m){!this.draggable||this.parallax||!st(m)&&dg(m.target)||m.target.closest(wt)||m.button>0||this.length<2||this.start(m)}},{name:"dragstart",handler(m){m.preventDefault()}},{name:hg,el:({list:m})=>m,handler:He,...Vn}],methods:{start(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,jt(document,hg,this.move,Vn),jt(document,Fc,this.end,Gn),ke(this.list,"userSelect","none")},move(m){let D=this.pos-this.drag;if(D===0||this.prevPos===this.pos||!this.dragging&&Math.abs(D)pe;)this.drag-=pe*this.dir,$=ae,Q-=pe,ae=this.getIndex($+this.dir),pe=Z1.call(this,$,ae);this.percent=Q/pe;let Ne=_[$],Fe=_[ae],et=this.index!==ae,it=$===ae,ht;for(let Ot of[this.index,this.prevIndex])f([ae,$],Ot)||(qt(_[Ot],"itemhidden",[this]),it&&(ht=!0,this.prevIndex=$));(this.index===$&&this.prevIndex!==$||ht)&&qt(_[this.index],"itemshown",[this]),et&&(this.prevIndex=$,this.index=ae,it||(qt(Ne,"beforeitemhide",[this]),qt(Ne,"itemhide",[this])),qt(Fe,"beforeitemshow",[this]),qt(Fe,"itemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),Ne,!it&&Fe)},end(){if(Gi(document,hg,this.move,Vn),Gi(document,Fc,this.end,Gn),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{let m=(j?this.dir*(j?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=m?this.index:this.prevIndex,m&&(this.percent=1-this.percent),this.show(this.dir>0&&!m||this.dir<0&&m?"next":"previous",!0)}setTimeout(()=>Gi(this.list,"click",Y1,Vn)),ke(this.list,{userSelect:""}),this.drag=this.percent=null}}};function Z1(m,D){return this._getTransitioner(m,m!==D&&D).getDistance()||this.slides[m].offsetWidth}function dg(m){return ke(m,"userSelect")!=="none"&&x(m.childNodes).some(D=>D.nodeType===3&&D.textContent.trim())}function X1(m){m._watches=[];for(let D of m.$options.watch||[])for(let[_,$]of Object.entries(D))Sm(m,$,_);m._initial=!0}function Sm(m,D,_){m._watches.push({name:_,...E(D)?D:{handler:D}})}function kN(m,D){for(let{name:_,handler:$,immediate:Q=!0}of m._watches)(m._initial&&Q||r(D,_)&&!re(D[_],m[_]))&&$.call(m,m[_],D[_]);m._initial=!1}function gg(m){let{computed:D}=m.$options;if(m._computed={},D)for(let _ in D)vg(m,_,D[_])}let Am={subtree:!0,childList:!0};function vg(m,D,_){m._hasComputed=!0,Object.defineProperty(m,D,{enumerable:!0,get(){let{_computed:$,$props:Q,$el:ae}=m;if(!r($,D)&&($[D]=(_.get||_).call(m,Q,ae),_.observe&&m._computedObserver)){let pe=_.observe.call(m,Q);m._computedObserver.observe(["~","+","-"].includes(pe[0])?ae.parentElement:ae.getRootNode(),Am)}return $[D]},set($){let{_computed:Q}=m;Q[D]=_.set?_.set.call(m,$):$,V(Q[D])&&delete Q[D]}})}function K1(m){m._hasComputed&&(ag(m,{read:()=>kN(m,xg(m)),events:["resize","computed"]}),m._computedObserver=Qd(m.$el,()=>Ec(m,"computed"),Am))}function yg(m){var D;(D=m._computedObserver)==null||D.disconnect(),delete m._computedObserver,xg(m)}function xg(m){let D={...m._computed};return m._computed={},D}function _c(m){m._events=[];for(let D of m.$options.events||[])if(r(D,"handler"))kc(m,D);else for(let _ in D)kc(m,D[_],_)}function BN(m){m._events.forEach(D=>D()),delete m._events}function kc(m,D,_){let{name:$,el:Q,handler:ae,capture:pe,passive:Ne,delegate:Fe,filter:et,self:it}=E(D)?D:{name:_,handler:D};Q=w(Q)?Q.call(m,m):Q||m.$el,!(!Q||h(Q)&&!Q.length||et&&!et.call(m,m))&&m._events.push(jt(Q,$,Fe?R(Fe)?Fe:Fe.call(m,m):null,R(ae)?m[ae]:ae.bind(m),{passive:Ne,capture:pe,self:it}))}function Ns(m){m._observers=[];for(let D of m.$options.observe||[])J1(m,D)}function wg(m,...D){m._observers.push(...D)}function LN(m){for(let D of m._observers)D.disconnect()}function J1(m,D){let{observe:_,target:$=m.$el,handler:Q,options:ae,filter:pe,args:Ne}=D;if(pe&&!pe.call(m,m))return;let Fe=`_observe${m._observers.length}`;w($)&&!r(m,Fe)&&vg(m,Fe,()=>{let ht=$.call(m,m);return h(ht)?Z(ht):ht}),Q=R(Q)?m[Q]:Q.bind(m),w(ae)&&(ae=ae.call(m,m));let et=r(m,Fe)?m[Fe]:$,it=_(et,Q,ae,Ne);w($)&&h(m[Fe])&&Sm(m,{handler:Oo(it,ae),immediate:!1},Fe),wg(m,it)}function Oo(m,D){return(_,$)=>{for(let Q of $)f(_,Q)||(m.unobserve?m.unobserve(Q):m.observe&&m.disconnect());for(let Q of _)(!f($,Q)||!m.unobserve)&&m.observe(Q,D)}}function Br(m){let{$options:D,$props:_}=m,$=Ho(D);b(_,$);let{computed:Q,methods:ae}=D;for(let pe in _)pe in $&&(!Q||!r(Q,pe))&&(!ae||!r(ae,pe))&&(m[pe]=_[pe])}function Ho(m){let D={},{args:_=[],props:$={},el:Q,id:ae}=m;if(!$)return D;for(let Ne in $){let Fe=i(Ne),et=fe(Q,Fe);V(et)||(et=$[Ne]===Boolean&&et===""?!0:Nc($[Ne],et),!(Fe==="target"&&a(et,"_"))&&(D[Ne]=et))}let pe=Ju(fe(Q,ae),_);for(let Ne in pe){let Fe=u(Ne);V($[Fe])||(D[Fe]=Nc($[Fe],pe[Ne]))}return D}let pu=be((m,D)=>{let _=Object.keys(D),$=_.concat(m).map(Q=>[i(Q),`data-${i(Q)}`]).flat();return{attributes:_,filter:$}});function mu(m){let{$options:D,$props:_}=m,{id:$,props:Q,el:ae}=D;if(!Q)return;let{attributes:pe,filter:Ne}=pu($,Q),Fe=new MutationObserver(et=>{let it=Ho(D);et.some(({attributeName:ht})=>{let Ot=ht.replace("data-","");return(Ot===$?pe:[u(Ot),u(ht)]).some(Ut=>!V(it[Ut])&&it[Ut]!==_[Ut])})&&m.$reset()});Fe.observe(ae,{attributes:!0,attributeFilter:Ne}),wg(m,Fe)}function il(m,D){var _;(_=m.$options[D])==null||_.forEach($=>$.call(m))}function Bc(m){m._connected||(Br(m),il(m,"beforeConnect"),m._connected=!0,_c(m),U1(m),X1(m),Ns(m),mu(m),K1(m),il(m,"connected"),Ec(m))}function Cm(m){m._connected&&(il(m,"beforeDisconnect"),BN(m),SN(m),LN(m),yg(m),il(m,"disconnected"),m._connected=!1)}let PN=0;function Mm(m,D={}){D.data=bg(D,m.constructor.options),m.$options=Ki(m.constructor.options,D,m),m.$props={},m._uid=PN++,Lc(m),Q1(m),gg(m),il(m,"created"),D.el&&m.$mount(D.el)}function Lc(m){let{data:D={}}=m.$options;for(let _ in D)m.$props[_]=m[_]=D[_]}function Q1(m){let{methods:D}=m.$options;if(D)for(let _ in D)m[_]=D[_].bind(m)}function bg({data:m={}},{args:D=[],props:_={}}){h(m)&&(m=m.slice(0,D.length).reduce(($,Q,ae)=>(E(Q)?b($,Q):$[D[ae]]=Q,$),{}));for(let $ in m)V(m[$])?delete m[$]:_[$]&&(m[$]=Nc(_[$],m[$]));return m}let Yn=function(m){Mm(this,m)};Yn.util=P1,Yn.options={},Yn.version="3.21.5";let j1="uk-",hu="__uikit__",rf={};function Pc(m,D){var _,$;let Q=j1+i(m);if(!D)return rf[Q].options||(rf[Q]=Yn.extend(rf[Q])),rf[Q];m=u(m),Yn[m]=(pe,Ne)=>ol(m,pe,Ne);let ae=(_=D.options)!=null?_:{...D};return ae.id=Q,ae.name=m,($=ae.install)==null||$.call(ae,Yn,ae,m),Yn._initialized&&!ae.functional&&requestAnimationFrame(()=>ol(m,`[${Q}],[data-${Q}]`)),rf[Q]=ae}function ol(m,D,_,...$){let Q=Pc(m);return Q.options.functional?new Q({data:E(D)?D:[D,_,...$]}):D?ni(D).map(ae)[0]:ae();function ae(pe){let Ne=Tm(pe,m);if(Ne)if(_)Ne.$destroy();else return Ne;return new Q({el:pe,data:_})}}function nf(m){return m?.[hu]||{}}function Tm(m,D){return nf(m)[D]}function ey(m,D){m[hu]||(m[hu]={}),m[hu][D.$options.name]=D}function RN(m,D){var _;(_=m[hu])==null||delete _[D.$options.name],H(m[hu])&&delete m[hu]}function qN(m){m.component=Pc,m.getComponents=nf,m.getComponent=Tm,m.update=Rc,m.use=function(_){if(!_.installed)return _.call(null,this),_.installed=!0,this},m.mixin=function(_,$){$=(R($)?this.component($):$)||this,$.options=Ki($.options,_)},m.extend=function(_){_||(_={});let $=this,Q=function(pe){Mm(this,pe)};return Q.prototype=Object.create($.prototype),Q.prototype.constructor=Q,Q.options=Ki($.options,_),Q.super=$,Q.extend=$.extend,Q};let D;Object.defineProperty(m,"container",{get(){return D||document.body},set(_){D=vr(_)}})}function Rc(m,D){m=m?Y(m):document.body;for(let _ of ao(m).reverse())Dg(_,D);zo(m,_=>Dg(_,D))}function Dg(m,D){let _=nf(m);for(let $ in _)Ec(_[$],D)}function zN(m){m.prototype.$mount=function(D){let _=this;ey(D,_),_.$options.el=D,document.contains(D)&&Bc(_)},m.prototype.$destroy=function(D=!1){let _=this,{el:$}=_.$options;$&&Cm(_),il(_,"destroy"),RN($,_),D&&Ao(_.$el)},m.prototype.$create=ol,m.prototype.$emit=function(D){Ec(this,D)},m.prototype.$update=function(D=this.$el,_){Rc(D,_)},m.prototype.$reset=function(){Cm(this),Bc(this)},m.prototype.$getComponent=Tm,Object.defineProperties(m.prototype,{$el:{get(){return this.$options.el}},$container:Object.getOwnPropertyDescriptor(m,"container")})}let UN=1;function du(m,D=null){return D?.id||`${m.$options.id}-${UN++}`}var of={i18n:{next:"Next slide",previous:"Previous slide",slideX:"Slide %s",slideLabel:"%s of %s",role:"String"},data:{selNav:!1,role:"region"},computed:{nav:({selNav:m},D)=>vr(m,D),navChildren(){return Sr(this.nav)},selNavItem:({attrItem:m})=>`[${m}],[data-${m}]`,navItems(m,D){return tn(this.selNavItem,D)}},watch:{nav(m,D){Qe(m,"role","tablist"),this.padNavitems(),D&&this.$emit()},list(m){jr(m,"ul")&&Qe(m,"role","presentation")},navChildren(m){Qe(m,"role","presentation"),this.padNavitems(),this.updateNav()},navItems(m){for(let D of m){let _=fe(D,this.attrItem),$=vr("a,button",D)||D,Q,ae=null;if(U(_)){let pe=ee(_),Ne=this.slides[pe];Ne&&(Ne.id||(Ne.id=du(this,Ne)),ae=Ne.id),Q=this.t("slideX",ie(_)+1),Qe($,"role","tab")}else this.list&&(this.list.id||(this.list.id=du(this,this.list)),ae=this.list.id),Q=this.t(_);Qe($,{"aria-controls":ae,"aria-label":Qe($,"aria-label")||Q})}},slides(m){m.forEach((D,_)=>Qe(D,{role:this.nav?"tabpanel":"group","aria-label":this.t("slideLabel",_+1,this.length),"aria-roledescription":this.nav?null:"slide"})),this.padNavitems()}},connected(){Qe(this.$el,{role:this.role,"aria-roledescription":"carousel"})},update:[{write(){this.navItems.concat(this.nav).forEach(m=>m&&(m.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]}],events:[{name:"click keydown",delegate:({selNavItem:m})=>m,filter:({parallax:m})=>!m,handler(m){m.target.closest("a,button")&&(m.type==="click"||m.keyCode===Ir.SPACE)&&(m.preventDefault(),this.show(fe(m.current,this.attrItem)))}},{name:"itemshow",handler:"updateNav"},{name:"keydown",delegate:({selNavItem:m})=>m,filter:({parallax:m})=>!m,handler(m){let{current:D,keyCode:_}=m,$=fe(D,this.attrItem);if(!U($))return;let Q=_===Ir.HOME?0:_===Ir.END?"last":_===Ir.LEFT?"previous":_===Ir.RIGHT?"next":-1;~Q&&(m.preventDefault(),this.show(Q))}}],methods:{updateNav(){let m=this.getValidIndex();for(let D of this.navItems){let _=fe(D,this.attrItem),$=vr("a,button",D)||D;if(U(_)){let ae=ee(_)===m;Ke(D,this.clsActive,ae),Ke($,"uk-disabled",this.parallax),Qe($,{"aria-selected":ae,tabindex:ae&&!this.parallax?null:-1}),ae&&$&&rr(Gt(D),":focus-within")&&$.focus()}else Ke(D,"uk-invisible",this.finite&&(_==="previous"&&m===0||_==="next"&&m>=this.maxIndex))}},padNavitems(){if(!this.nav)return;let m=[];for(let D=0;D$.matches(`[${_}]`))||vr(`
  • `)}re(m,this.navChildren)||gs(this.nav,m)}}};let Ng="cubic-bezier(0.25, 0.46, 0.45, 0.94)",Om="cubic-bezier(0.165, 0.84, 0.44, 1)";var Eg={mixins:[oi,_N,of,bi],props:{clsActivated:String,easing:String,index:Number,finite:Boolean,velocity:Number},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:"",clsEnter:"uk-slide-enter",clsLeave:"uk-slide-leave",clsSlideActive:"uk-slide-active",Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){ge(this.slides,this.clsActive)},computed:{duration:({velocity:m},D)=>Ag(D.offsetWidth/m),list:({selList:m},D)=>vr(m,D),maxIndex(){return this.length-1},slides(){return Sr(this.list)},length(){return this.slides.length}},watch:{slides(m,D){D&&this.$emit()}},events:{itemshow({target:m}){Ue(m,this.clsEnter,this.clsSlideActive)},itemshown({target:m}){ge(m,this.clsEnter)},itemhide({target:m}){Ue(m,this.clsLeave)},itemhidden({target:m}){ge(m,this.clsLeave,this.clsSlideActive)}},methods:{show(m,D=!1){var _;if(this.dragging||!this.length||this.parallax)return;let{stack:$}=this,Q=D?0:$.length,ae=()=>{$.splice(Q,1),$.length&&this.show($.shift(),!0)};if($[D?"unshift":"push"](m),!D&&$.length>1){$.length===2&&((_=this._transitioner)==null||_.forward(Math.min(this.duration,200)));return}let pe=this.getIndex(this.index),Ne=Be(this.slides,this.clsActive)&&this.slides[pe],Fe=this.getIndex(m,this.index),et=this.slides[Fe];if(Ne===et){ae();return}if(this.dir=Sg(m,pe),this.prevIndex=pe,this.index=Fe,Ne&&!qt(Ne,"beforeitemhide",[this])||!qt(et,"beforeitemshow",[this,Ne])){this.index=this.prevIndex,ae();return}let it=this._show(Ne,et,D).then(()=>{Ne&&qt(Ne,"itemhidden",[this]),qt(et,"itemshown",[this]),$.shift(),this._transitioner=null,$.length&&requestAnimationFrame(()=>$.length&&this.show($.shift(),!0))});return Ne&&qt(Ne,"itemhide",[this]),qt(et,"itemshow",[this]),it},getIndex(m=this.index,D=this.index){return Oe(de(m,this.slides,D,this.finite),0,Math.max(0,this.maxIndex))},getValidIndex(m=this.index,D=this.prevIndex){return this.getIndex(m,D)},async _show(m,D,_){if(this._transitioner=this._getTransitioner(m,D,this.dir,{easing:_?D.offsetWidth<600?Ng:Om:this.easing,...this.transitionOptions}),!_&&!m){this._translate(1);return}let{length:$}=this.stack;return this._transitioner[$>1?"forward":"show"]($>1?Math.min(this.duration,75+75/($-1)):this.duration,this.percent)},_translate(m,D=this.prevIndex,_=this.index){let $=this._getTransitioner(D===_?!1:D,_);return $.translate(m),$},_getTransitioner(m=this.prevIndex,D=this.index,_=this.dir||1,$=this.transitionOptions){return new this.Transitioner(q(m)?this.slides[m]:m,q(D)?this.slides[D]:D,_*(j?-1:1),$)}}};function Sg(m,D){return m==="next"?1:m==="previous"||m({preload:1,videoAutoplay:!1,delayControls:3e3,items:[],cls:"uk-open",clsPage:"uk-lightbox-page",selList:".uk-lightbox-items",attrItem:"uk-lightbox-item",selClose:".uk-close-large",selCaption:".uk-lightbox-caption",pauseOnHover:!1,velocity:2,Animations:Cg,template:'
    '}),created(){let m=vr(this.template),D=vr(this.selList,m);this.items.forEach(()=>En(D,"
    "));let _=vr("[uk-close]",m),$=this.t("close");_&&$&&(_.dataset.i18n=JSON.stringify({label:$})),this.$mount(En(this.container,m))},events:[{name:`${_e} ${xe} keydown`,handler:"showControls"},{name:"click",self:!0,delegate:({selList:m})=>`${m} > *`,handler(m){m.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler:"showControls"},{name:"hide",self:!0,handler(){this.hideControls(),ge(this.slides,this.clsActive),Tt.stop(this.slides)}},{name:"hidden",self:!0,handler(){this.$destroy(!0)}},{name:"keyup",el:()=>document,handler({keyCode:m}){if(!this.isToggled(this.$el)||!this.draggable)return;let D=-1;m===Ir.LEFT?D="previous":m===Ir.RIGHT?D="next":m===Ir.HOME?D=0:m===Ir.END&&(D="last"),~D&&this.show(D)}},{name:"beforeitemshow",handler(m){this.isToggled()||(this.draggable=!1,m.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=Cg.scale,ge(m.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){gs(vr(this.selCaption,this.$el),this.getItem().caption||"");for(let m=-this.preload;m<=this.preload;m++)this.loadItem(this.index+m)}},{name:"itemshown",handler(){this.draggable=this.$props.draggable}},{name:"itemload",async handler(m,D){let{source:_,type:$,alt:Q="",poster:ae,attrs:pe={}}=D;if(this.setItem(D,""),!_)return;let Ne,Fe={allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":`${this.videoAutoplay}`};if($==="image"||_.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i)){let et=gu("img",{src:_,alt:Q,...pe});jt(et,"load",()=>this.setItem(D,et)),jt(et,"error",()=>this.setError(D))}else if($==="video"||_.match(/\.(mp4|webm|ogv)($|\?)/i)){let et=gu("video",{src:_,poster:ae,controls:"",playsinline:"","uk-video":`${this.videoAutoplay}`,...pe});jt(et,"loadedmetadata",()=>this.setItem(D,et)),jt(et,"error",()=>this.setError(D))}else if($==="iframe"||_.match(/\.(html|php)($|\?)/i))this.setItem(D,gu("iframe",{src:_,allowfullscreen:"",class:"uk-lightbox-iframe",...pe}));else if(Ne=_.match(/\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(D,gu("iframe",{src:`https://www.youtube${Ne[1]||""}.com/embed/${Ne[2]}${Ne[3]?`?${Ne[3]}`:""}`,width:1920,height:1080,...Fe,...pe}));else if(Ne=_.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{let{height:et,width:it}=await(await fetch(`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(_)}`,{credentials:"omit"})).json();this.setItem(D,gu("iframe",{src:`https://player.vimeo.com/video/${Ne[1]}${Ne[2]?`?${Ne[2]}`:""}`,width:it,height:et,...Fe,...pe}))}catch{this.setError(D)}}}],methods:{loadItem(m=this.index){let D=this.getItem(m);this.getSlide(D).childElementCount||qt(this.$el,"itemload",[D])},getItem(m=this.index){return this.items[de(m,this.slides)]},setItem(m,D){qt(this.$el,"itemloaded",[this,gs(this.getSlide(m),D)])},getSlide(m){return this.slides[this.items.indexOf(m)]},setError(m){this.setItem(m,'')},showControls(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),Ue(this.$el,"uk-active","uk-transition-active")},hideControls(){ge(this.$el,"uk-active","uk-transition-active")}}};function gu(m,D){let _=Vu(`<${m}>`);return Qe(_,D),_}var ry={install:ny,props:{toggle:String},data:{toggle:"a"},computed:{toggles:({toggle:m},D)=>tn(m,D)},watch:{toggles(m){this.hide();for(let D of m)jr(D,"a")&&Qe(D,"role","button")}},disconnected(){this.hide()},events:{name:"click",delegate:({toggle:m})=>`${m}:not(.uk-disabled)`,handler(m){m.defaultPrevented||(m.preventDefault(),this.show(m.current))}},methods:{show(m){let D=Pe(this.toggles.map(Mg),"source");if(F(m)){let{source:_}=Mg(m);m=p(D,({source:$})=>_===$)}return this.panel=this.panel||this.$create("lightboxPanel",{...this.$props,items:D}),jt(this.panel.$el,"hidden",()=>this.panel=null),this.panel.show(m)},hide(){var m;return(m=this.panel)==null?void 0:m.hide()}}};function ny(m,D){m.lightboxPanel||m.component("lightboxPanel",ci),b(D.props,m.component("lightboxPanel").options.props)}function Mg(m){let D={};for(let _ of["href","caption","type","poster","alt","attrs"])D[_==="href"?"source":_]=fe(m,_);return D.attrs=Ju(D.attrs),D}var af={mixins:[bs],functional:!0,args:["message","status"],data:{message:"",status:"",timeout:5e3,group:"",pos:"top-center",clsContainer:"uk-notification",clsClose:"uk-notification-close",clsMsg:"uk-notification-message"},install:Im,computed:{marginProp:({pos:m})=>`margin-${m.match(/[a-z]+(?=-)/)[0]}`,startProps(){return{opacity:0,[this.marginProp]:-this.$el.offsetHeight}}},created(){let m=`${this.clsContainer}-${this.pos}`,D=`data-${this.clsContainer}-container`,_=vr(`.${m}[${D}]`,this.container)||En(this.container,`
    `);this.$mount(En(_,``))},async connected(){let m=ie(ke(this.$el,this.marginProp));await Tt.start(ke(this.$el,this.startProps),{opacity:1,[this.marginProp]:m}),this.timeout&&(this.timer=setTimeout(this.close,this.timeout))},events:{click(m){m.target.closest('a[href="#"],a[href=""]')&&m.preventDefault(),this.close()},[nt](){this.timer&&clearTimeout(this.timer)},[Xe](){this.timeout&&(this.timer=setTimeout(this.close,this.timeout))}},methods:{async close(m){let D=_=>{let $=Gt(_);qt(_,"close",[this]),Ao(_),$?.hasChildNodes()||Ao($)};this.timer&&clearTimeout(this.timer),m||await Tt.start(this.$el,this.startProps),D(this.$el)}}};function Im(m){m.notification.closeAll=function(D,_){zo(document.body,$=>{let Q=m.getComponent($,"notification");Q&&(!D||D===Q.group)&&Q.close(_)})}}var qc={props:{media:Boolean},data:{media:!1},connected(){let m=iy(this.media,this.$el);if(this.matchMedia=!0,m){this.mediaObj=window.matchMedia(m);let D=()=>{this.matchMedia=this.mediaObj.matches,qt(this.$el,So("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=jt(this.mediaObj,"change",()=>{D(),this.$emit("resize")}),D()}},disconnected(){var m;(m=this.offMediaObj)==null||m.call(this)}};function iy(m,D){if(R(m)){if(a(m,"@"))m=ie(ke(D,`--uk-breakpoint-${m.slice(1)}`));else if(isNaN(m))return m}return m&&U(m)?`(min-width: ${m}px)`:""}function Tg(m){return je(m)?Math.ceil(Math.max(0,...tn("[stroke]",m).map(D=>D.getTotalLength()))):0}let Es={x:Uc,y:Uc,rotate:Uc,scale:Uc,color:al,backgroundColor:al,borderColor:al,blur:$o,hue:$o,fopacity:$o,grayscale:$o,invert:$o,saturate:$o,sepia:$o,opacity:oy,stroke:ay,bgx:Ig,bgy:Ig},{keys:Og}=Object;var zc={mixins:[qc],props:sy(Og(Es),"list"),data:sy(Og(Es),void 0),computed:{props(m,D){let _={};for(let Q in m)Q in Es&&!V(m[Q])&&(_[Q]=m[Q].slice());let $={};for(let Q in _)$[Q]=Es[Q](Q,D,_[Q],_);return $}},events:{load(){this.$emit()}},methods:{reset(){for(let m in this.getCss(0))ke(this.$el,m,"")},getCss(m){let D={};for(let _ in this.props)this.props[_](D,Oe(m));return D.willChange=Object.keys(D).map(Mr).join(","),D}}};function Uc(m,D,_){let $=Wc(_)||{x:"px",y:"px",rotate:"deg"}[m]||"",Q;return m==="x"||m==="y"?(m=`translate${l(m)}`,Q=ae=>ie(ie(ae).toFixed($==="px"?0:6))):m==="scale"&&($="",Q=ae=>{var pe;return Wc([ae])?ii(ae,"width",D,!0)/D[`offset${(pe=ae.endsWith)!=null&&pe.call(ae,"vh")?"Height":"Width"}`]:ie(ae)}),_.length===1&&_.unshift(m==="scale"?1:0),_=Io(_,Q),(ae,pe)=>{ae.transform=`${ae.transform||""} ${m}(${Ss(_,pe)}${$})`}}function al(m,D,_){return _.length===1&&_.unshift(Vc(D,m,"")),_=Io(_,$=>HN(D,$)),($,Q)=>{let[ae,pe,Ne]=sl(_,Q),Fe=ae.map((et,it)=>(et+=Ne*(pe[it]-et),it===3?ie(et):parseInt(et,10))).join(",");$[m]=`rgba(${Fe})`}}function HN(m,D){return Vc(m,"color",D).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(ie)}function $o(m,D,_){_.length===1&&_.unshift(0);let $=Wc(_)||{blur:"px",hue:"deg"}[m]||"%";return m={fopacity:"opacity",hue:"hue-rotate"}[m]||m,_=Io(_),(Q,ae)=>{let pe=Ss(_,ae);Q.filter=`${Q.filter||""} ${m}(${pe+$})`}}function oy(m,D,_){return _.length===1&&_.unshift(Vc(D,m,"")),_=Io(_),($,Q)=>{$[m]=Ss(_,Q)}}function ay(m,D,_){_.length===1&&_.unshift(0);let $=Wc(_),Q=Tg(D);return _=Io(_.reverse(),ae=>(ae=ie(ae),$==="%"?ae*Q/100:ae)),_.some(([ae])=>ae)?(ke(D,"strokeDasharray",Q),(ae,pe)=>{ae.strokeDashoffset=Ss(_,pe)}):He}function Ig(m,D,_,$){_.length===1&&_.unshift(0);let Q=m==="bgy"?"height":"width";$[m]=Io(_,Ne=>ii(Ne,Q,D));let ae=["bgx","bgy"].filter(Ne=>Ne in $);if(ae.length===2&&m==="bgx")return He;if(Vc(D,"backgroundSize","")==="cover")return Hc(m,D,_,$);let pe={};for(let Ne of ae)pe[Ne]=sf(D,Ne);return uf(ae,pe,$)}function Hc(m,D,_,$){let Q=$N(D);if(!Q.width)return He;let ae={width:D.offsetWidth,height:D.offsetHeight},pe=["bgx","bgy"].filter(it=>it in $),Ne={};for(let it of pe){let ht=$[it].map(([Rr])=>Rr),Ot=Math.min(...ht),Ut=Math.max(...ht),lr=ht.indexOf(Ot){et(it,ht),it.backgroundSize=`${Fe.width}px ${Fe.height}px`,it.backgroundRepeat="no-repeat"}}function sf(m,D){return Vc(m,`background-position-${D.slice(-1)}`,"")}function uf(m,D,_){return function($,Q){for(let ae of m){let pe=Ss(_[ae],Q);$[`background-position-${ae.slice(-1)}`]=`calc(${D[ae]} + ${pe}px)`}}}let lf={},$c={};function $N(m){let D=ke(m,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if($c[D])return $c[D];let _=new Image;return D&&(_.src=D,!_.naturalWidth&&!lf[D])?(Or(_,"error load",()=>{$c[D]=Fm(_),qt(m,So("load",!1))}),lf[D]=!0,Fm(_)):$c[D]=Fm(_)}function Fm(m){return{width:m.naturalWidth,height:m.naturalHeight}}function Io(m,D=ie){let _=[],{length:$}=m,Q=0;for(let ae=0;ae<$;ae++){let[pe,Ne]=R(m[ae])?m[ae].trim().split(/ (?![^(]*\))/):[m[ae]];if(pe=D(pe),Ne=Ne?ie(Ne)/100:null,ae===0?Ne===null?Ne=0:Ne&&_.push([pe,0]):ae===$-1&&(Ne===null?Ne=1:Ne!==1&&(_.push([pe,Ne]),Ne=1)),_.push([pe,Ne]),Ne===null)Q++;else if(Q){let Fe=_[ae-Q-1][1],et=(Ne-Fe)/(Q+1);for(let it=Q;it>0;it--)_[ae-it][1]=Fe+et*(Q-it+1);Q=0}}return _}function sl(m,D){let _=p(m.slice(1),([,$])=>D<=$)+1;return[m[_-1][0],m[_][0],(D-m[_-1][1])/(m[_][1]-m[_-1][1])]}function Ss(m,D){let[_,$,Q]=sl(m,D);return _+Math.abs(_-$)*Q*(_<$?1:-1)}let WN=/^-?\d+(?:\.\d+)?(\S+)?/;function Wc(m,D){var _;for(let $ of m){let Q=(_=$.match)==null?void 0:_.call($,WN);if(Q)return Q[1]}return D}function Vc(m,D,_){let $=m.style[D],Q=ke(ke(m,D,_),D);return m.style[D]=$,Q}function sy(m,D){return m.reduce((_,$)=>(_[$]=D,_),{})}function uy(m,D){return D>=0?Math.pow(m,D+1):1-Math.pow(1-m,1-D)}var Qi={mixins:[zc],props:{target:String,viewport:Number,easing:Number,start:String,end:String},data:{target:!1,viewport:1,easing:1,start:0,end:0},computed:{target:({target:m},D)=>Fg(m&&Hn(m,D)||D),start({start:m}){return ii(m,"height",this.target,!0)},end({end:m,viewport:D}){return ii(m||(D=(1-D)*100)&&`${D}vh+${D}%`,"height",this.target,!0)}},observe:[Sc(),Xl({target:({target:m})=>m}),li({target:({$el:m,target:D})=>[m,D,ys(D,!0)]})],update:{read({percent:m},D){if(D.has("scroll")||(m=!1),!je(this.$el))return!1;if(!this.matchMedia)return;let _=m;return m=uy(dm(this.target,this.start,this.end),this.easing),{percent:m,style:_===m?!1:this.getCss(m)}},write({style:m}){if(!this.matchMedia){this.reset();return}m&&ke(this.$el,m)},events:["scroll","resize"]}};function Fg(m){return m?"offsetTop"in m?m:Fg(Gt(m)):document.documentElement}var ly={props:{parallax:Boolean,parallaxTarget:Boolean,parallaxStart:String,parallaxEnd:String,parallaxEasing:Number},data:{parallax:!1,parallaxTarget:!1,parallaxStart:0,parallaxEnd:0,parallaxEasing:0},observe:[li({target:({$el:m,parallaxTarget:D})=>[m,D],filter:({parallax:m})=>m}),Xl({filter:({parallax:m})=>m})],computed:{parallaxTarget({parallaxTarget:m},D){return m&&Hn(m,D)||this.list}},update:{read(){if(!this.parallax)return!1;let m=this.parallaxTarget;if(!m)return!1;let D=ii(this.parallaxStart,"height",m,!0),_=ii(this.parallaxEnd,"height",m,!0),$=uy(dm(m,D,_),this.parallaxEasing);return{parallax:this.getIndexAt($)}},write({parallax:m}){let[D,_]=m,$=this.getValidIndex(D+Math.ceil(_)),Q=this.slides[D],ae=this.slides[$],{triggerShow:pe,triggerShown:Ne,triggerHide:Fe,triggerHidden:et}=VN(this);if(~this.prevIndex)for(let ht of new Set([this.index,this.prevIndex]))f([$,D],ht)||(Fe(this.slides[ht]),et(this.slides[ht]));let it=this.prevIndex!==D||this.index!==$;this.dir=1,this.prevIndex=D,this.index=$,Q!==ae&&Fe(Q),pe(ae),it&&Ne(Q),this._translate(Q===ae?1:_,Q,ae)},events:["scroll","resize"]},methods:{getIndexAt(m){let D=m*(this.length-1);return[Math.floor(D),D%1]}}};function VN(m){let{clsSlideActive:D,clsEnter:_,clsLeave:$}=m;return{triggerShow:Q,triggerShown:ae,triggerHide:pe,triggerHidden:Ne};function Q(Fe){Be(Fe,$)&&(pe(Fe),Ne(Fe)),Be(Fe,D)||(qt(Fe,"beforeitemshow",[m]),qt(Fe,"itemshow",[m]))}function ae(Fe){Be(Fe,_)&&qt(Fe,"itemshown",[m])}function pe(Fe){Be(Fe,D)||Q(Fe),Be(Fe,_)&&ae(Fe),Be(Fe,$)||(qt(Fe,"beforeitemhide",[m]),qt(Fe,"itemhide",[m]))}function Ne(Fe){Be(Fe,$)&&qt(Fe,"itemhidden",[m])}}var fy={update:{write(){if(this.stack.length||this.dragging||this.parallax)return;let m=this.getValidIndex();!~this.prevIndex||this.index!==m?this.show(m):this._translate(1)},events:["resize"]}},_g={observe:Zl({target:({slides:m})=>m,targets:m=>m.getAdjacentSlides()}),methods:{getAdjacentSlides(){return[1,-1].map(m=>this.slides[this.getIndex(this.index+m)])}}};function cy(m,D,_,{center:$,easing:Q,list:ae}){let pe=m?ff(m,ae,$):ff(D,ae,$)+Ht(D).width*_,Ne=D?ff(D,ae,$):pe+Ht(m).width*_*(j?-1:1),{promise:Fe,resolve:et}=G1();return{dir:_,show(it,ht=0,Ot){let Ut=Ot?"linear":Q;return it-=Math.round(it*Oe(ht,-1,1)),ke(ae,"transitionProperty","none"),this.translate(ht),ke(ae,"transitionProperty",""),ht=m?ht:Oe(ht,0,1),nl(this.getItemIn(),"itemin",{percent:ht,duration:it,timing:Ut,dir:_}),m&&nl(this.getItemIn(!0),"itemout",{percent:1-ht,duration:it,timing:Ut,dir:_}),Tt.start(ae,{transform:Sn(-Ne*(j?-1:1),"px")},it,Ut).then(et,He),Fe},cancel(){return Tt.cancel(ae)},reset(){ke(ae,"transform","")},async forward(it,ht=this.percent()){return await this.cancel(),this.show(it,ht,!0)},translate(it){if(it===this.percent())return;let ht=this.getDistance()*_*(j?-1:1);ke(ae,"transform",Sn(Oe(-Ne+(ht-ht*it),-cf(ae),Ht(ae).width)*(j?-1:1),"px"));let Ot=this.getActives(),Ut=this.getItemIn(),lr=this.getItemIn(!0);it=m?Oe(it,-1,1):0;for(let Ar of Sr(ae)){let Rr=f(Ot,Ar),xu=Ar===Ut,$m=Ar===lr,Wm=xu||!$m&&(Rr||_*(j?-1:1)===-1^ca(Ar,ae)>ca(m||D));nl(Ar,`itemtranslate${Wm?"in":"out"}`,{dir:_,percent:$m?1-it:xu?it:Rr?1:0})}},percent(){return Math.abs((new DOMMatrix(ke(ae,"transform")).m41*(j?-1:1)+pe)/(Ne-pe))},getDistance(){return Math.abs(Ne-pe)},getItemIn(it=!1){let ht=this.getActives(),Ot=pf(ae,ff(D||m,ae,$));if(it){let Ut=ht;ht=Ot,Ot=Ut}return Ot[p(Ot,Ut=>!f(ht,Ut))]},getActives(){return pf(ae,ff(m||D,ae,$))}}}function ff(m,D,_){let $=ca(m,D);return _?$-GN(m,D):Math.min($,py(D))}function py(m){return Math.max(0,cf(m)-Ht(m).width)}function cf(m,D){return Ee(Sr(m).slice(0,D),_=>Ht(_).width)}function GN(m,D){return Ht(D).width/2-Ht(m).width/2}function ca(m,D){return m&&(Gd(m).left+(j?Ht(m).width-Ht(D).width:0))*(j?-1:1)||0}function pf(m,D){D-=1;let _=Ht(m).width,$=D+_+2;return Sr(m).filter(Q=>{let ae=ca(Q,m),pe=ae+Math.min(Ht(Q).width,_);return ae>=D&&pe<=$})}var _m={mixins:[Xi,Eg,fy,ly,_g],props:{center:Boolean,sets:Boolean,active:String},data:{center:!1,sets:!1,attrItem:"uk-slider-item",selList:".uk-slider-items",selNav:".uk-slider-nav",clsContainer:"uk-slider-container",active:"all",Transitioner:cy},computed:{finite({finite:m}){return m||Gc(this.list,this.center)},maxIndex(){if(!this.finite||this.center&&!this.sets)return this.length-1;if(this.center)return De(this.sets);let m=0,D=py(this.list),_=p(this.slides,$=>{if(m>=D)return!0;m+=Ht($).width});return~_?_:this.length-1},sets({sets:m}){if(!m||this.parallax)return;let D=0,_=[],$=Ht(this.list).width;for(let Q=0;Q$&&(D=0),this.center?D<$/2&&D+ae+Ht(this.slides[de(Q+1,this.slides)]).width/2>$/2&&(_.push(Q),D=$/2-ae/2):D===0&&_.push(Math.min(Q,this.maxIndex)),D+=ae}if(_.length)return _},transitionOptions(){return{center:this.center,list:this.list}},slides(){return Sr(this.list).filter(je)}},connected(){Ke(this.$el,this.clsContainer,!vr(`.${this.clsContainer}`,this.$el))},observe:li({target:({slides:m,$el:D})=>[D,...m]}),update:{write(){for(let m of this.navItems){let D=ee(fe(m,this.attrItem));D!==!1&&(m.hidden=!this.maxIndex||D>this.maxIndex||this.sets&&!f(this.sets,D))}this.reorder(),this.parallax||this._translate(1),this.updateActiveClasses()},events:["resize"]},events:{beforeitemshow(m){!this.dragging&&this.sets&&this.stack.length<2&&!f(this.sets,this.index)&&(this.index=this.getValidIndex());let D=Math.abs(this.index-this.prevIndex+(this.dir>0&&this.indexthis.prevIndex?(this.maxIndex+1)*this.dir:0));if(!this.dragging&&D>1){for(let Q=0;Q0?"next":"previous");m.preventDefault();return}let _=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex,$=cf(this.list)/this.length;this.duration=Ag($/this.velocity)*(Ht(this.slides[_]).width/$),this.reorder()},itemshow(){~this.prevIndex&&Ue(this._getTransitioner().getItemIn(),this.clsActive),this.updateActiveClasses(this.prevIndex)},itemshown(){this.updateActiveClasses()}},methods:{reorder(){if(this.finite){ke(this.slides,"order","");return}let m=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((Q,ae)=>ke(Q,"order",this.dir>0&&ae=this.index?-1:"")),!this.center||!this.length)return;let D=this.slides[m],_=Ht(this.list).width/2-Ht(D).width/2,$=0;for(;_>0;){let Q=this.getIndex(--$+m,m),ae=this.slides[Q];ke(ae,"order",Q>m?-2:-1),_-=Ht(ae).width}},updateActiveClasses(m=this.index){let D=this._getTransitioner(m).getActives();this.active!=="all"&&(D=[this.slides[this.getValidIndex(m)]]);let _=[this.clsActive,!this.sets||f(this.sets,ie(this.index))?this.clsActivated:""];for(let $ of this.slides){let Q=f(D,$);Ke($,_,Q),Qe($,"aria-hidden",!Q);for(let ae of tn(fr,$))r(ae,"_tabindex")||(ae._tabindex=Qe(ae,"tabindex")),Qe(ae,"tabindex",Q?ae._tabindex:-1)}},getValidIndex(m=this.index,D=this.prevIndex){if(m=this.getIndex(m,D),!this.sets)return m;let _;do{if(f(this.sets,m))return m;_=m,m=this.getIndex(m+this.dir,D)}while(m!==_);return m},getAdjacentSlides(){let{width:m}=Ht(this.list),D=-m,_=m*2,$=Ht(this.slides[this.index]).width,Q=this.center?m/2-$/2:0,ae=new Set;for(let pe of[-1,1]){let Ne=Q+(pe>0?$:0),Fe=0;do{let et=this.slides[this.getIndex(this.index+pe+Fe++*pe)];Ne+=Ht(et).width*pe,ae.add(et)}while(this.length>Fe&&Ne>D&&Ne<_)}return Array.from(ae)},getIndexAt(m){let D=-1,_=this.center?cf(this.list)-(Ht(this.slides[0]).width/2+Ht(De(this.slides)).width/2):cf(this.list,this.maxIndex),$=m*_,Q=0;do{let ae=Ht(this.slides[++D]).width,pe=this.center?ae/2+Ht(this.slides[D+1]).width/2:ae;Q=$/pe%1,$-=pe}while($>=0&&DEe($.filter(it=>!Fe.has(it)),it=>Ht(it).width))return!0}return!1}function As(m){return Math.max(0,...Sr(m).map(D=>Ht(D).width))}var my={mixins:[zc],beforeConnect(){this.item=this.$el.closest(`.${this.$options.id.replace("parallax","items")} > *`)},disconnected(){this.item=null},events:[{name:"itemin itemout",self:!0,el:({item:m})=>m,handler({type:m,detail:{percent:D,duration:_,timing:$,dir:Q}}){Zi.read(()=>{if(!this.matchMedia)return;let ae=this.getCss(ul(m,Q,D)),pe=this.getCss(hy(m)?.5:Q>0?1:0);Zi.write(()=>{ke(this.$el,ae),Tt.start(this.$el,pe,_,$).catch(He)})})}},{name:"transitioncanceled transitionend",self:!0,el:({item:m})=>m,handler(){Tt.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el:({item:m})=>m,handler({type:m,detail:{percent:D,dir:_}}){Zi.read(()=>{if(!this.matchMedia){this.reset();return}let $=this.getCss(ul(m,_,D));Zi.write(()=>ke(this.$el,$))})}}]};function hy(m){return s(m,"in")}function ul(m,D,_){return _/=2,hy(m)^D<0?_:1-_}var dy={...Ds,fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(m){return 1-ke(m,"opacity")},translate(m){return[{opacity:1-m,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:tf(1+.5),zIndex:0},{zIndex:-1}]},percent(m){return 1-ke(m,"opacity")},translate(m){return[{opacity:1-m,transform:tf(1+.5*m),zIndex:0},{zIndex:-1}]}},pull:{show(m){return m<0?[{transform:Sn(30),zIndex:-1},{transform:Sn(),zIndex:0}]:[{transform:Sn(-100),zIndex:0},{transform:Sn(),zIndex:-1}]},percent(m,D,_){return _<0?1-Oc(D):Oc(m)},translate(m,D){return D<0?[{transform:Sn(30*m),zIndex:-1},{transform:Sn(-100*(1-m)),zIndex:0}]:[{transform:Sn(-m*100),zIndex:0},{transform:Sn(30*(1-m)),zIndex:-1}]}},push:{show(m){return m<0?[{transform:Sn(100),zIndex:0},{transform:Sn(),zIndex:-1}]:[{transform:Sn(-30),zIndex:-1},{transform:Sn(),zIndex:0}]},percent(m,D,_){return _>0?1-Oc(D):Oc(m)},translate(m,D){return D<0?[{transform:Sn(m*100),zIndex:0},{transform:Sn(-30*(1-m)),zIndex:-1}]:[{transform:Sn(-30*m),zIndex:-1},{transform:Sn(100*(1-m)),zIndex:0}]}}},gy={mixins:[Xi,ty,fy,ly,_g],props:{ratio:String,minHeight:String,maxHeight:String},data:{ratio:"16:9",minHeight:void 0,maxHeight:void 0,selList:".uk-slideshow-items",attrItem:"uk-slideshow-item",selNav:".uk-slideshow-nav",Animations:dy},watch:{list(m){ke(m,{aspectRatio:this.ratio?this.ratio.replace(":","/"):void 0,minHeight:this.minHeight,maxHeight:this.maxHeight,minWidth:"100%",maxWidth:"100%"})}},methods:{getAdjacentSlides(){return[1,-1].map(m=>this.slides[this.getIndex(this.index+m)])}}},vy={mixins:[Xi,fg],props:{group:String,threshold:Number,clsItem:String,clsPlaceholder:String,clsDrag:String,clsDragState:String,clsBase:String,clsNoDrag:String,clsEmpty:String,clsCustom:String,handle:String},data:{group:!1,threshold:5,clsItem:"uk-sortable-item",clsPlaceholder:"uk-sortable-placeholder",clsDrag:"uk-sortable-drag",clsDragState:"uk-drag",clsBase:"uk-sortable",clsNoDrag:"uk-sortable-nodrag",clsEmpty:"uk-sortable-empty",clsCustom:"",handle:!1,pos:{}},events:{name:xe,passive:!1,handler:"init"},computed:{target:(m,D)=>(D.tBodies||[D])[0],items(){return Sr(this.target)},isEmpty(){return!this.items.length},handles({handle:m},D){return m?tn(m,D):this.items}},watch:{isEmpty(m){Ke(this.target,this.clsEmpty,m)},handles(m,D){ke(D,{touchAction:"",userSelect:""}),ke(m,{touchAction:"none",userSelect:"none"})}},update:{write(m){if(!this.drag||!Gt(this.placeholder))return;let{pos:{x:D,y:_},origin:{offsetTop:$,offsetLeft:Q},placeholder:ae}=this;ke(this.drag,{top:_-$,left:D-Q});let pe=this.getSortable(document.elementFromPoint(D,_));if(!pe)return;let{items:Ne}=pe;if(Ne.some(Tt.inProgress))return;let Fe=Lg(Ne,{x:D,y:_});if(Ne.length&&(!Fe||Fe===ae))return;let et=this.getSortable(ae),it=YN(pe.target,Fe,ae,D,_,pe===et&&m.moved!==Fe);it!==!1&&(it&&ae===it||(pe!==et?(et.remove(ae),m.moved=Fe):delete m.moved,pe.insert(ae,it),this.touched.add(pe)))},events:["move"]},methods:{init(m){let{target:D,button:_,defaultPrevented:$}=m,[Q]=this.items.filter(ae=>ae.contains(D));!Q||$||_>0||Bt(D)||D.closest(`.${this.clsNoDrag}`)||this.handle&&!D.closest(this.handle)||(m.preventDefault(),this.pos=dt(m),this.touched=new Set([this]),this.placeholder=Q,this.origin={target:D,index:_n(Q),...this.pos},jt(document,_e,this.move),jt(document,Je,this.end),this.threshold||this.start(m))},start(m){this.drag=Bg(this.$container,this.placeholder);let{left:D,top:_}=Ht(this.placeholder);b(this.origin,{offsetLeft:this.pos.x-D,offsetTop:this.pos.y-_}),Ue(this.drag,this.clsDrag,this.clsCustom),Ue(this.placeholder,this.clsPlaceholder),Ue(this.items,this.clsItem),Ue(document.documentElement,this.clsDragState),qt(this.$el,"start",[this,this.placeholder]),mf(this.pos),this.move(m)},move:ZN(function(m){b(this.pos,dt(m)),!this.drag&&(Math.abs(this.pos.x-this.origin.x)>this.threshold||Math.abs(this.pos.y-this.origin.y)>this.threshold)&&this.start(m),this.$emit("move")}),end(){if(Gi(document,_e,this.move),Gi(document,Je,this.end),!this.drag)return;kg();let m=this.getSortable(this.placeholder);this===m?this.origin.index!==_n(this.placeholder)&&qt(this.$el,"moved",[this,this.placeholder]):(qt(m.$el,"added",[m,this.placeholder]),qt(this.$el,"removed",[this,this.placeholder])),qt(this.$el,"stop",[this,this.placeholder]),Ao(this.drag),this.drag=null;for(let{clsPlaceholder:D,clsItem:_}of this.touched)for(let $ of this.touched)ge($.items,D,_);this.touched=null,ge(document.documentElement,this.clsDragState)},insert(m,D){Ue(this.items,this.clsItem),D&&D.previousElementSibling!==m?this.animate(()=>pc(D,m)):!D&&this.target.lastElementChild!==m&&this.animate(()=>En(this.target,m))},remove(m){this.target.contains(m)&&this.animate(()=>Ao(m))},getSortable(m){do{let D=this.$getComponent(m,"sortable");if(D&&(D===this||this.group!==!1&&D.group===this.group))return D}while(m=Gt(m))}}};let Yc;function mf(m){let D=Date.now();Yc=setInterval(()=>{let{x:_,y:$}=m;$+=document.scrollingElement.scrollTop;let Q=(Date.now()-D)*.3;D=Date.now(),Zu(document.elementFromPoint(_,m.y)).reverse().some(ae=>{let{scrollTop:pe,scrollHeight:Ne}=ae,{top:Fe,bottom:et,height:it}=Mo(ae);if(Fe<$&&Fe+35>$)pe-=Q;else if(et>$&&et-35<$)pe+=Q;else return;if(pe>0&&pe"),En(_,D.cloneNode(!0).children);for(let $ of D.getAttributeNames())Qe(_,$,D.getAttribute($))}else _=D.cloneNode(!0);return En(m,_),ke(_,"margin","0","important"),ke(_,{boxSizing:"border-box",width:D.offsetWidth,height:D.offsetHeight,padding:ke(D,"padding")}),Yi(_.firstElementChild,Yi(D.firstElementChild)),_}function Lg(m,D){return m[p(m,_=>ze(D,Ht(_)))]}function YN(m,D,_,$,Q,ae){if(!Sr(m).length)return;let pe=Ht(D);if(!ae)return Zc(m,_)||Qpe[Ot]-Ut?!1:D}function Zc(m,D){let _=Sr(m).length===1;_&&En(m,D);let $=Sr(m),Q=$.some((ae,pe)=>{let Ne=Ht(ae);return $.slice(pe+1).some(Fe=>{let et=Ht(Fe);return!Pg([Ne.left,Ne.right],[et.left,et.right])})});return _&&Ao(D),Q}function Pg(m,D){return m[1]>D[0]&&D[1]>m[0]}function ZN(m){let D;return function(..._){D||(D=!0,m.call(this,..._),requestAnimationFrame(()=>D=!1))}}var Rg={props:{pos:String,offset:Boolean,flip:Boolean,shift:Boolean,inset:Boolean},data:{pos:`bottom-${j?"right":"left"}`,offset:!1,flip:!0,shift:!0,inset:!1},connected(){this.pos=this.$props.pos.split("-").concat("center").slice(0,2),[this.dir,this.align]=this.pos,this.axis=f(["top","bottom"],this.dir)?"y":"x"},methods:{positionAt(m,D,_){let $=[this.getPositionOffset(m),this.getShiftOffset(m)],Q=[this.flip&&"flip",this.shift&&"shift"],ae={element:[this.inset?this.dir:vc(this.dir),this.align],target:[this.dir,this.align]};if(this.axis==="y"){for(let Fe in ae)ae[Fe].reverse();$.reverse(),Q.reverse()}let pe=km(m),Ne=Ht(m);ke(m,{top:-Ne.height,left:-Ne.width}),ua(m,D,{attach:ae,offset:$,boundary:_,placement:Q,viewportOffset:this.getViewportOffset(m)}),pe()},getPositionOffset(m=this.$el){return ii(this.offset===!1?ke(m,"--uk-position-offset"):this.offset,this.axis==="x"?"width":"height",m)*(f(["left","top"],this.dir)?-1:1)*(this.inset?-1:1)},getShiftOffset(m=this.$el){return this.align==="center"?0:ii(ke(m,"--uk-position-shift-offset"),this.axis==="y"?"width":"height",m)*(f(["left","top"],this.align)?1:-1)},getViewportOffset(m){return ii(ke(m,"--uk-position-viewport-offset"))}}};function km(m){let D=ys(m),{scrollTop:_}=D;return()=>{_!==D.scrollTop&&(D.scrollTop=_)}}var XN={mixins:[bs,fu,Rg],data:{pos:"top",animation:["uk-animation-scale-up"],duration:100,cls:"uk-active"},connected(){KN(this.$el)},disconnected(){this.hide()},methods:{show(){if(this.isToggled(this.tooltip||null))return;let{delay:m=0,title:D}=yy(this.$options);if(!D)return;let _=Qe(this.$el,"title"),$=jt(this.$el,["blur",Xe],ae=>!st(ae)&&this.hide());this.reset=()=>{Qe(this.$el,{title:_,"aria-describedby":null}),$()};let Q=du(this);Qe(this.$el,{title:null,"aria-describedby":Q}),clearTimeout(this.showTimer),this.showTimer=setTimeout(()=>this._show(D,Q),m)},async hide(){var m;rr(this.$el,"input:focus")||(clearTimeout(this.showTimer),this.isToggled(this.tooltip||null)&&await this.toggleElement(this.tooltip,!1,!1),(m=this.reset)==null||m.call(this),Ao(this.tooltip),this.tooltip=null)},async _show(m,D){this.tooltip=En(this.container,``),jt(this.tooltip,"toggled",(_,$)=>{if(!$)return;let Q=()=>this.positionAt(this.tooltip,this.$el);Q();let[ae,pe]=Xc(this.tooltip,this.$el,this.pos);this.origin=this.axis==="y"?`${vc(ae)}-${pe}`:`${pe}-${vc(ae)}`;let Ne=[Or(document,`keydown ${xe}`,this.hide,!1,Fe=>Fe.type===xe&&!this.$el.contains(Fe.target)||Fe.type==="keydown"&&Fe.keyCode===Ir.ESC),jt([document,...uu(this.$el)],"scroll",Q,{passive:!0})];Or(this.tooltip,"hide",()=>Ne.forEach(Fe=>Fe()),{self:!0})}),await this.toggleElement(this.tooltip,!0)||this.hide()}},events:{[`focus ${nt} ${xe}`](m){(!st(m)||m.type===xe)&&this.show()}}};function KN(m){Gr(m)||Qe(m,"tabindex","0")}function Xc(m,D,[_,$]){let Q=Dr(m),ae=Dr(D),pe=[["left","right"],["top","bottom"]];for(let Fe of pe){if(Q[Fe[0]]>=ae[Fe[1]]){_=Fe[1];break}if(Q[Fe[1]]<=ae[Fe[0]]){_=Fe[0];break}}return $=(f(pe[0],_)?pe[1]:pe[0]).find(Fe=>Q[Fe]===ae[Fe])||"center",[_,$]}function yy(m){let{el:D,id:_,data:$}=m;return["delay","title"].reduce((Q,ae)=>({[ae]:fe(D,ae),...Q}),{...Ju(fe(D,_),["title"]),...$})}var xy={mixins:[bi],i18n:{invalidMime:"Invalid File Type: %s",invalidName:"Invalid File Name: %s",invalidSize:"Invalid File Size: %s Kilobytes Max"},props:{allow:String,clsDragover:String,concurrent:Number,maxSize:Number,method:String,mime:String,multiple:Boolean,name:String,params:Object,type:String,url:String},data:{allow:!1,clsDragover:"uk-dragover",concurrent:1,maxSize:0,method:"POST",mime:!1,multiple:!1,name:"files[]",params:{},type:"",url:"",abort:He,beforeAll:He,beforeSend:He,complete:He,completeAll:He,error:He,fail:He,load:He,loadEnd:He,loadStart:He,progress:He},events:{change(m){rr(m.target,'input[type="file"]')&&(m.preventDefault(),m.target.files&&this.upload(m.target.files),m.target.value="")},drop(m){Kc(m);let D=m.dataTransfer;D?.files&&(ge(this.$el,this.clsDragover),this.upload(D.files))},dragenter(m){Kc(m)},dragover(m){Kc(m),Ue(this.$el,this.clsDragover)},dragleave(m){Kc(m),ge(this.$el,this.clsDragover)}},methods:{async upload(m){if(m=x(m),!m.length)return;qt(this.$el,"upload",[m]);for(let $ of m){if(this.maxSize&&this.maxSize*1e3<$.size){this.fail(this.t("invalidSize",this.maxSize));return}if(this.allow&&!wy(this.allow,$.name)){this.fail(this.t("invalidName",this.allow));return}if(this.mime&&!wy(this.mime,$.type)){this.fail(this.t("invalidMime",this.mime));return}}this.multiple||(m=m.slice(0,1)),this.beforeAll(this,m);let D=qg(m,this.concurrent),_=async $=>{let Q=new FormData;$.forEach(ae=>Q.append(this.name,ae));for(let ae in this.params)Q.append(ae,this.params[ae]);try{let ae=await JN(this.url,{data:Q,method:this.method,responseType:this.type,beforeSend:pe=>{let{xhr:Ne}=pe;jt(Ne.upload,"progress",this.progress);for(let Fe of["loadStart","load","loadEnd","abort"])jt(Ne,Fe.toLowerCase(),this[Fe]);return this.beforeSend(pe)}});this.complete(ae),D.length?await _(D.shift()):this.completeAll(ae)}catch(ae){this.error(ae)}};await _(D.shift())}}};function wy(m,D){return D.match(new RegExp(`^${m.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")}$`,"i"))}function qg(m,D){let _=[];for(let $=0;${let{xhr:Q}=D;for(let ae in D)if(ae in Q)try{Q[ae]=D[ae]}catch{}Q.open(D.method.toUpperCase(),m);for(let ae in D.headers)Q.setRequestHeader(ae,D.headers[ae]);jt(Q,"load",()=>{Q.status===0||Q.status>=200&&Q.status<300||Q.status===304?_(Q):$(b(Error(Q.statusText),{xhr:Q,status:Q.status}))}),jt(Q,"error",()=>$(b(Error("Network Error"),{xhr:Q}))),jt(Q,"timeout",()=>$(b(Error("Network Timeout"),{xhr:Q}))),Q.send(D.data)})}var Dy=Object.freeze({__proto__:null,Countdown:R1,Filter:MN,Lightbox:ry,LightboxPanel:ci,Notification:af,Parallax:Qi,Slider:_m,SliderParallax:my,Slideshow:gy,SlideshowParallax:my,Sortable:vy,Tooltip:XN,Upload:xy});function QN(m){J&&window.MutationObserver&&(document.body?requestAnimationFrame(()=>Bm(m)):new MutationObserver((D,_)=>{document.body&&(Bm(m),_.disconnect())}).observe(document.documentElement,{childList:!0}))}function Bm(m){qt(document,"uikit:init",m),document.body&&zo(document.body,Ny),new MutationObserver(D=>D.forEach(Jc)).observe(document,{subtree:!0,childList:!0}),new MutationObserver(D=>D.forEach(Qc)).observe(document,{subtree:!0,attributes:!0}),m._initialized=!0}function Jc({addedNodes:m,removedNodes:D}){for(let _ of m)zo(_,Ny);for(let _ of D)zo(_,Ey)}function Qc({target:m,attributeName:D}){var _;let $=Sy(D);$&&(ut(m,D)?ol($,m):(_=Tm(m,$))==null||_.$destroy())}function Ny(m){let D=nf(m);for(let _ in D)Bc(D[_]);for(let _ of m.getAttributeNames()){let $=Sy(_);$&&ol($,m)}}function Ey(m){let D=nf(m);for(let _ in D)Cm(D[_])}function Sy(m){a(m,"data-")&&(m=m.slice(5));let D=rf[m];return D&&(D.options||D).name}qN(Yn),zN(Yn);var Ay={mixins:[Xi,fu],props:{animation:Boolean,targets:String,active:null,collapsible:Boolean,multiple:Boolean,toggle:String,content:String,offset:Number},data:{targets:"> *",active:!1,animation:!0,collapsible:!0,multiple:!1,clsOpen:"uk-open",toggle:"> .uk-accordion-title",content:"> .uk-accordion-content",offset:0},computed:{items:({targets:m},D)=>tn(m,D),toggles({toggle:m}){return this.items.map(D=>vr(m,D))},contents({content:m}){return this.items.map(D=>{var _;return((_=D._wrapper)==null?void 0:_.firstElementChild)||vr(m,D)})}},watch:{items(m,D){if(D||Be(m,this.clsOpen))return;let _=this.active!==!1&&m[Number(this.active)]||!this.collapsible&&m[0];_&&this.toggle(_,!1)},toggles(){this.$emit()},contents(m){for(let D of m){let _=Be(this.items.find($=>$.contains(D)),this.clsOpen);Lm(D,!_)}this.$emit()}},observe:Zl(),events:[{name:"click keydown",delegate:({targets:m,$props:D})=>`${m} ${D.toggle}`,async handler(m){var D;m.type==="keydown"&&m.keyCode!==Ir.SPACE||(m.preventDefault(),(D=this._off)==null||D.call(this),this._off=Cy(m.target),await this.toggle(_n(this.toggles,m.current)),this._off())}},{name:"shown hidden",self:!0,delegate:({targets:m})=>m,handler(){this.$emit()}}],update(){let m=xi(this.items,`.${this.clsOpen}`);for(let D in this.items){let _=this.toggles[D],$=this.contents[D];if(!_||!$)continue;_.id=du(this,_),$.id=du(this,$);let Q=f(m,this.items[D]);Qe(_,{role:jr(_,"a")?"button":null,"aria-controls":$.id,"aria-expanded":Q,"aria-disabled":!this.collapsible&&m.length<2&&Q}),Qe($,{role:"region","aria-labelledby":_.id}),jr($,"ul")&&Qe(Sr($),"role","presentation")}},methods:{toggle(m,D){m=this.items[de(m,this.items)];let _=[m],$=xi(this.items,`.${this.clsOpen}`);if(!this.multiple&&!f($,_[0])&&(_=_.concat($)),!(!this.collapsible&&$.length<2&&f($,m)))return Promise.all(_.map(Q=>this.toggleElement(Q,!f($,Q),(ae,pe)=>{if(Ke(ae,this.clsOpen,pe),D===!1||!this.animation){Lm(vr(this.content,ae),!pe);return}return jN(ae,pe,this)})))}}};function Lm(m,D){m&&(m.hidden=D)}async function jN(m,D,{content:_,duration:$,velocity:Q,transition:ae}){var pe;_=((pe=m._wrapper)==null?void 0:pe.firstElementChild)||vr(_,m),m._wrapper||(m._wrapper=um(_,"
    "));let Ne=m._wrapper;ke(Ne,"overflow","hidden");let Fe=ie(ke(Ne,"height"));await Tt.cancel(Ne),Lm(_,!1);let et=Ee(["marginTop","marginBottom"],ht=>ke(_,ht))+Ht(_).height,it=Fe/et;$=(Q*et+$)*(D?1-it:it),ke(Ne,"height",Fe),await Tt.start(Ne,{height:D?et:0},$,ae),Co(_),delete m._wrapper,D||Lm(_,!0)}function Cy(m){let D=ys(m,!0),_;return function $(){_=requestAnimationFrame(()=>{let{top:Q}=Ht(m);Q<0&&(D.scrollTop+=Q),$()})}(),()=>requestAnimationFrame(()=>cancelAnimationFrame(_))}var eE={mixins:[Xi,fu],args:"animation",props:{animation:Boolean,close:String},data:{animation:!0,selClose:".uk-alert-close",duration:150},events:{name:"click",delegate:({selClose:m})=>m,handler(m){m.preventDefault(),this.close()}},methods:{async close(){await this.toggleElement(this.$el,!1,tE),this.$destroy(!0)}}};function tE(m,D,{duration:_,transition:$,velocity:Q}){let ae=ie(ke(m,"height"));return ke(m,"height",ae),Tt.start(m,{height:0,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0,borderTop:0,borderBottom:0,opacity:0},Q*ae+_,$)}var zg={args:"autoplay",props:{automute:Boolean,autoplay:Boolean},data:{automute:!1,autoplay:!0},beforeConnect(){this.autoplay==="inview"&&!ut(this.$el,"preload")&&(this.$el.preload="none"),jr(this.$el,"iframe")&&!ut(this.$el,"allow")&&(this.$el.allow="autoplay"),this.autoplay==="hover"&&(jr(this.$el,"video")?this.$el.tabindex=0:this.autoplay=!0),this.automute&&M1(this.$el)},events:[{name:`${nt} focusin`,filter:({autoplay:m})=>f(m,"hover"),handler(m){!st(m)||!Ug(this.$el)?Vl(this.$el):vs(this.$el)}},{name:`${Xe} focusout`,filter:({autoplay:m})=>f(m,"hover"),handler(m){st(m)||vs(this.$el)}}],observe:[la({filter:({$el:m,autoplay:D})=>D&&D!=="hover"&&T1(m),handler([{isIntersecting:m}]){document.fullscreenElement||(m?Vl(this.$el):vs(this.$el))},args:{intersecting:!1},options:({$el:m,autoplay:D})=>({root:D==="inview"?null:Gt(m)})})]};function Ug(m){return!m.paused&&!m.ended}var My={mixins:[zg],props:{width:Number,height:Number},data:{automute:!0},created(){this.useObjectFit=jr(this.$el,"img","video")},observe:li({target:({$el:m})=>Ty(m)||Gt(m),filter:({useObjectFit:m})=>!m}),update:{read(){if(this.useObjectFit)return!1;let{ratio:m,cover:D}=ct,{$el:_,width:$,height:Q}=this,ae={width:$,height:Q};if(!$||!Q){let et={width:_.naturalWidth||_.videoWidth||_.clientWidth,height:_.naturalHeight||_.videoHeight||_.clientHeight};$?ae=m(et,"width",$):Q?ae=m(et,"height",Q):ae=et}let{offsetHeight:pe,offsetWidth:Ne}=Ty(_)||Gt(_),Fe=D(ae,{width:Ne,height:pe});return!Fe.width||!Fe.height?!1:Fe},write({height:m,width:D}){ke(this.$el,{height:m,width:D})},events:["resize"]}};function Ty(m){for(;m=Gt(m);)if(ke(m,"position")!=="static")return m}let pi;var ll={mixins:[bs,Rg,fu],args:"pos",props:{mode:"list",toggle:Boolean,boundary:Boolean,boundaryX:Boolean,boundaryY:Boolean,target:Boolean,targetX:Boolean,targetY:Boolean,stretch:Boolean,delayShow:Number,delayHide:Number,autoUpdate:Boolean,clsDrop:String,animateOut:Boolean,bgScroll:Boolean,closeOnScroll:Boolean},data:{mode:["click","hover"],toggle:"- *",boundary:!1,boundaryX:!1,boundaryY:!1,target:!1,targetX:!1,targetY:!1,stretch:!1,delayShow:0,delayHide:800,autoUpdate:!0,clsDrop:!1,animateOut:!1,bgScroll:!0,animation:["uk-animation-fade"],cls:"uk-open",container:!1,closeOnScroll:!1},computed:{boundary({boundary:m,boundaryX:D,boundaryY:_},$){return[Hn(D||m,$)||window,Hn(_||m,$)||window]},target({target:m,targetX:D,targetY:_},$){return D||(D=m||this.targetEl),_||(_=m||this.targetEl),[D===!0?window:Hn(D,$),_===!0?window:Hn(_,$)]}},created(){this.tracker=new Jd},beforeConnect(){this.clsDrop=this.$props.clsDrop||this.$options.id},connected(){Ue(this.$el,"uk-drop",this.clsDrop),this.toggle&&!this.targetEl&&(this.targetEl=Pm(this)),this._style=Ce(this.$el.style,["width","height"])},disconnected(){this.isActive()&&(this.hide(!1),pi=null),ke(this.$el,this._style)},events:[{name:"click",delegate:()=>".uk-drop-close",handler(m){m.preventDefault(),this.hide(!1)}},{name:"click",delegate:()=>'a[href*="#"]',handler({defaultPrevented:m,current:D}){let{hash:_}=D;!m&&_&&_a(D)&&!this.$el.contains(vr(_))&&this.hide(!1)}},{name:"beforescroll",handler(){this.hide(!1)}},{name:"toggle",self:!0,handler(m,D){m.preventDefault(),this.isToggled()?this.hide(!1):this.show(D?.$el,!1)}},{name:"toggleshow",self:!0,handler(m,D){m.preventDefault(),this.show(D?.$el)}},{name:"togglehide",self:!0,handler(m){m.preventDefault(),rr(this.$el,":focus,:hover")||this.hide()}},{name:`${nt} focusin`,filter:({mode:m})=>f(m,"hover"),handler(m){st(m)||this.clearTimers()}},{name:`${Xe} focusout`,filter:({mode:m})=>f(m,"hover"),handler(m){!st(m)&&m.relatedTarget&&this.hide()}},{name:"toggled",self:!0,handler(m,D){D&&(this.clearTimers(),this.position())}},{name:"show",self:!0,handler(){pi=this,this.tracker.init(),Qe(this.targetEl,"aria-expanded",!0);let m=[rE(this),nE(this),iE(this),this.autoUpdate&&Iy(this),this.closeOnScroll&&ln(this)];Or(this.$el,"hide",()=>m.forEach(D=>D&&D()),{self:!0}),this.bgScroll||Or(this.$el,"hidden",pg(this.$el),{self:!0})}},{name:"beforehide",self:!0,handler:"clearTimers"},{name:"hide",handler({target:m}){if(this.$el!==m){pi=pi===null&&this.$el.contains(m)&&this.isToggled()?this:pi;return}pi=this.isActive()?null:pi,this.tracker.cancel(),Qe(this.targetEl,"aria-expanded",null)}}],update:{write(){this.isToggled()&&!Be(this.$el,this.clsEnter)&&this.position()}},methods:{show(m=this.targetEl,D=!0){if(this.isToggled()&&m&&this.targetEl&&m!==this.targetEl&&this.hide(!1,!1),this.targetEl=m,this.clearTimers(),!this.isActive()){if(pi){if(D&&pi.isDelaying()){this.showTimer=setTimeout(()=>rr(m,":hover")&&this.show(),10);return}let _;for(;pi&&_!==pi&&!pi.$el.contains(this.$el);)_=pi,pi.hide(!1,!1)}this.container&&Gt(this.$el)!==this.container&&En(this.container,this.$el),this.showTimer=setTimeout(()=>this.toggleElement(this.$el,!0),D&&this.delayShow||0)}},hide(m=!0,D=!0){let _=()=>this.toggleElement(this.$el,!1,this.animateOut&&D);this.clearTimers(),this.isDelayedHide=m,m&&this.isDelaying()?this.hideTimer=setTimeout(this.hide,50):m&&this.delayHide?this.hideTimer=setTimeout(_,this.delayHide):_()},clearTimers(){clearTimeout(this.showTimer),clearTimeout(this.hideTimer),this.showTimer=null,this.hideTimer=null},isActive(){return pi===this},isDelaying(){return[this.$el,...tn(".uk-drop",this.$el)].some(m=>this.tracker.movesTo(m))},position(){ge(this.$el,"uk-drop-stack"),ke(this.$el,this._style),this.$el.hidden=!0;let m=this.target.map(Q=>Oy(this.$el,Q)),D=this.getViewportOffset(this.$el),_=[[0,["x","width","left","right"]],[1,["y","height","top","bottom"]]];for(let[Q,[ae,pe]]of _)this.axis!==ae&&f([ae,!0],this.stretch)&&ke(this.$el,{[pe]:Math.min(Dr(this.boundary[Q])[pe],m[Q][pe]-2*D),[`overflow-${ae}`]:"auto"});let $=m[0].width-2*D;this.$el.hidden=!1,ke(this.$el,"maxWidth",""),this.$el.offsetWidth>$&&Ue(this.$el,"uk-drop-stack"),ke(this.$el,"maxWidth",$),this.positionAt(this.$el,this.target,this.boundary);for(let[Q,[ae,pe,Ne,Fe]]of _)if(this.axis===ae&&f([ae,!0],this.stretch)){let et=Math.abs(this.getPositionOffset()),it=Dr(this.target[Q]),ht=Dr(this.$el);ke(this.$el,{[pe]:(it[Ne]>ht[Ne]?it[this.inset?Fe:Ne]-Math.max(Dr(this.boundary[Q])[Ne],m[Q][Ne]+D):Math.min(Dr(this.boundary[Q])[Fe],m[Q][Fe]-D)-it[this.inset?Ne:Fe])-et,[`overflow-${ae}`]:"auto"}),this.positionAt(this.$el,this.target,this.boundary)}}}};function Oy(m,D){return Mo(uu(D).find(_=>_.contains(m)))}function Pm(m){let{$el:D}=m.$create("toggle",Hn(m.toggle,m.$el),{target:m.$el,mode:m.mode});return Qe(D,"aria-haspopup",!0),D}function rE(m){let D=()=>m.$emit(),_=[pm(D),xc(uu(m.$el).concat(m.target),D)];return()=>_.map($=>$.disconnect())}function Iy(m,D=()=>m.$emit()){return jt([document,...uu(m.$el)],"scroll",D,{passive:!0})}function nE(m){return jt(document,"keydown",D=>{D.keyCode===Ir.ESC&&m.hide(!1)})}function ln(m){return Iy(m,()=>m.hide(!1))}function iE(m){return jt(document,xe,({target:D})=>{m.$el.contains(D)||Or(document,`${Je} ${pt} scroll`,({defaultPrevented:_,type:$,target:Q})=>{var ae;!_&&$===Je&&D===Q&&!((ae=m.targetEl)!=null&&ae.contains(D))&&m.hide(!1)},!0)})}var Rm={mixins:[Xi,bs],props:{align:String,clsDrop:String,boundary:Boolean,dropbar:Boolean,dropbarAnchor:Boolean,duration:Number,mode:Boolean,offset:Boolean,stretch:Boolean,delayShow:Boolean,delayHide:Boolean,target:Boolean,targetX:Boolean,targetY:Boolean,animation:Boolean,animateOut:Boolean,closeOnScroll:Boolean},data:{align:j?"right":"left",clsDrop:"uk-dropdown",clsDropbar:"uk-dropnav-dropbar",boundary:!0,dropbar:!1,dropbarAnchor:!1,duration:200,container:!1,selNavItem:"> li > a, > ul > li > a"},computed:{dropbarAnchor:({dropbarAnchor:m},D)=>Hn(m,D)||D,dropbar({dropbar:m}){return m?(m=this._dropbar||Hn(m,this.$el)||vr(`+ .${this.clsDropbar}`,this.$el),m||(this._dropbar=vr("
    "))):null},dropContainer(m,D){return this.container||D},dropdowns({clsDrop:m},D){var _;let $=tn(`.${m}`,D);if(this.dropContainer!==D)for(let Q of tn(`.${m}`,this.dropContainer)){let ae=(_=this.getDropdown(Q))==null?void 0:_.targetEl;!f($,Q)&&ae&&this.$el.contains(ae)&&$.push(Q)}return $},items({selNavItem:m},D){return tn(m,D)}},watch:{dropbar(m){Ue(m,"uk-dropbar","uk-dropbar-top",this.clsDropbar,`uk-${this.$options.name}-dropbar`)},dropdowns(){this.initializeDropdowns()}},connected(){this.initializeDropdowns()},disconnected(){Ao(this._dropbar),delete this._dropbar},events:[{name:"mouseover focusin",delegate:({selNavItem:m})=>m,handler({current:m}){let D=this.getActive();D&&f(D.mode,"hover")&&D.targetEl&&!m.contains(D.targetEl)&&!D.isDelaying()&&D.hide(!1)}},{name:"keydown",self:!0,delegate:({selNavItem:m})=>m,handler(m){var D;let{current:_,keyCode:$}=m,Q=this.getActive();$===Ir.DOWN&&Q?.targetEl===_&&(m.preventDefault(),(D=vr(fr,Q.$el))==null||D.focus()),hf(m,this.items,Q)}},{name:"keydown",el:({dropContainer:m})=>m,delegate:({clsDrop:m})=>`.${m}`,handler(m){var D;let{current:_,keyCode:$,target:Q}=m;if(Bt(Q)||!f(this.dropdowns,_))return;let ae=this.getActive(),pe=-1;if($===Ir.HOME?pe=0:$===Ir.END?pe="last":$===Ir.UP?pe="previous":$===Ir.DOWN?pe="next":$===Ir.ESC&&((D=ae.targetEl)==null||D.focus()),~pe){m.preventDefault();let Ne=tn(fr,_);Ne[de(pe,Ne,p(Ne,Fe=>rr(Fe,":focus")))].focus()}hf(m,this.items,ae)}},{name:"mouseleave",el:({dropbar:m})=>m,filter:({dropbar:m})=>m,handler(){let m=this.getActive();m&&f(m.mode,"hover")&&!this.dropdowns.some(D=>rr(D,":hover"))&&m.hide()}},{name:"beforeshow",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){this.isDropbarDrop(m)&&(this.dropbar.previousElementSibling!==this.dropbarAnchor&&mc(this.dropbarAnchor,this.dropbar),Ue(m,`${this.clsDrop}-dropbar`))}},{name:"show",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){if(!this.isDropbarDrop(m))return;let D=this.getDropdown(m),_=()=>{let $=Math.max(...ao(m,`.${this.clsDrop}`).concat(m).map(Q=>Dr(Q).bottom));Dr(this.dropbar,{left:Dr(this.dropbar).left,top:this.getDropbarOffset(D.getPositionOffset())}),this.transitionTo($-Dr(this.dropbar).top+ie(ke(m,"marginBottom")),m)};this._observer=xc([D.$el,...D.target],_),_()}},{name:"beforehide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler(m){let D=this.getActive();rr(this.dropbar,":hover")&&D.$el===m.target&&this.isDropbarDrop(D.$el)&&f(D.mode,"hover")&&D.isDelayedHide&&!this.items.some(_=>D.targetEl!==_&&rr(_,":focus"))&&m.preventDefault()}},{name:"hide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){var D;if(!this.isDropbarDrop(m))return;(D=this._observer)==null||D.disconnect();let _=this.getActive();(!_||_.$el===m)&&this.transitionTo(0)}}],methods:{getActive(){var m;return f(this.dropdowns,(m=pi)==null?void 0:m.$el)&&pi},async transitionTo(m,D){let{dropbar:_}=this,$=Yi(_);if(D=$0&&ke(D,"transitionDelay",`${Q/m*this.duration}ms`)}ke(D,"clipPath",`polygon(0 0,100% 0,100% ${$}px,0 ${$}px)`),Yi(_,$),await Promise.all([Tt.start(_,{height:m},this.duration),Tt.start(D,{clipPath:`polygon(0 0,100% 0,100% ${m}px,0 ${m}px)`},this.duration).finally(()=>ke(D,{clipPath:"",transitionDelay:""}))]).catch(He)},getDropdown(m){return this.$getComponent(m,"drop")||this.$getComponent(m,"dropdown")},isDropbarDrop(m){return f(this.dropdowns,m)&&Be(m,this.clsDrop)},getDropbarOffset(m){let{$el:D,target:_,targetY:$}=this,{top:Q,height:ae}=Dr(Hn($||_||D,D));return Q+ae+m},initializeDropdowns(){this.$create("drop",this.dropdowns.filter(m=>!this.getDropdown(m)),{...this.$props,flip:!1,shift:!0,pos:`bottom-${this.align}`,boundary:this.boundary===!0?this.$el:this.boundary})}}};function hf(m,D,_){var $,Q,ae;let{current:pe,keyCode:Ne}=m,Fe=-1;Ne===Ir.HOME?Fe=0:Ne===Ir.END?Fe="last":Ne===Ir.LEFT?Fe="previous":Ne===Ir.RIGHT?Fe="next":Ne===Ir.TAB&&(($=_.targetEl)==null||$.focus(),(Q=_.hide)==null||Q.call(_,!1)),~Fe&&(m.preventDefault(),(ae=_.hide)==null||ae.call(_,!1),D[de(Fe,D,D.indexOf(_.targetEl||pe))].focus())}var pa={mixins:[Xi],args:"target",props:{target:Boolean},data:{target:!1},computed:{input:(m,D)=>vr(wt,D),state(){return this.input.nextElementSibling},target({target:m},D){return m&&(m===!0&&Gt(this.input)===D&&this.input.nextElementSibling||vr(m,D))}},update(){var m;let{target:D,input:_}=this;if(!D)return;let $,Q=Bt(D)?"value":"textContent",ae=D[Q],pe=(m=_.files)!=null&&m[0]?_.files[0].name:rr(_,"select")&&($=tn("option",_).filter(Ne=>Ne.selected)[0])?$.textContent:_.value;ae!==pe&&(D[Q]=pe)},events:[{name:"change",handler(){this.$emit()}},{name:"reset",el:({$el:m})=>m.closest("form"),handler(){this.$emit()}}]},qm={extends:ws,mixins:[Xi],name:"grid",props:{masonry:Boolean,parallax:String,parallaxStart:String,parallaxEnd:String,parallaxJustify:Boolean},data:{margin:"uk-grid-margin",clsStack:"uk-grid-stack",masonry:!1,parallax:0,parallaxStart:0,parallaxEnd:0,parallaxJustify:!1},connected(){this.masonry&&Ue(this.$el,"uk-flex-top","uk-flex-wrap-top")},observe:Xl({filter:({parallax:m,parallaxJustify:D})=>m||D}),update:[{write({rows:m}){Ke(this.$el,this.clsStack,!m.some(D=>D.length>1))},events:["resize"]},{read(m){let{rows:D}=m,{masonry:_,parallax:$,parallaxJustify:Q,margin:ae}=this;if($=Math.max(0,ii($)),!(_||$||Q)||zm(D)||D[0].some((lr,Ar)=>D.some(Rr=>Rr[Ar]&&Rr[Ar].offsetWidth!==lr.offsetWidth)))return m.translates=m.scrollColumns=!1;let pe=_y(D,ae),Ne,Fe;_?[Ne,Fe]=Fy(D,pe,_==="next"):Ne=ky(D);let et=Ne.map(lr=>Ee(lr,"offsetHeight")+pe*(lr.length-1)),it=Math.max(0,...et),ht,Ot,Ut;return($||Q)&&(ht=et.map((lr,Ar)=>Q?it-lr+$:$/(Ar%2||8)),Q||($=Math.max(...et.map((lr,Ar)=>lr+ht[Ar]-it))),Ot=ii(this.parallaxStart,"height",this.$el,!0),Ut=ii(this.parallaxEnd,"height",this.$el,!0)),{columns:Ne,translates:Fe,scrollColumns:ht,parallaxStart:Ot,parallaxEnd:Ut,padding:$,height:Fe?it:""}},write({height:m,padding:D}){ke(this.$el,"paddingBottom",D||""),m!==!1&&ke(this.$el,"height",m)},events:["resize"]},{read({rows:m,scrollColumns:D,parallaxStart:_,parallaxEnd:$}){return{scrolled:D&&!zm(m)?dm(this.$el,_,$):!1}},write({columns:m,scrolled:D,scrollColumns:_,translates:$}){!D&&!$||m.forEach((Q,ae)=>Q.forEach((pe,Ne)=>{let[Fe,et]=$&&$[ae][Ne]||[0,0];D&&(et+=D*_[ae]),ke(pe,"transform",`translate(${Fe}px, ${et}px)`)}))},events:["scroll","resize"]}]};function zm(m){return m.flat().some(D=>ke(D,"position")==="absolute")}function Fy(m,D,_){let $=[],Q=[],ae=Array(m[0].length).fill(0),pe=0;for(let Ne of m){j&&(Ne=Ne.reverse());let Fe=0;for(let et in Ne){let{offsetWidth:it,offsetHeight:ht}=Ne[et],Ot=_?et:ae.indexOf(Math.min(...ae));jc($,Ot,Ne[et]),jc(Q,Ot,[(Ot-et)*it*(j?-1:1),ae[Ot]-pe]),ae[Ot]+=ht+D,Fe=Math.max(Fe,ht)}pe+=Fe+D}return[$,Q]}function _y(m,D){let _=m.flat().find($=>Be($,D));return ie(_?ke(_,"marginTop"):ke(m[0][0],"paddingLeft"))}function ky(m){let D=[];for(let _ of m)for(let $ in _)jc(D,$,_[$]);return D}function jc(m,D,_){m[D]||(m[D]=[]),m[D].push(_)}var By={args:"target",props:{target:String,row:Boolean},data:{target:"> *",row:!0},computed:{elements:({target:m},D)=>tn(m,D)},observe:li({target:({$el:m,elements:D})=>D.reduce((_,$)=>_.concat($,...$.children),[m])}),events:{name:"loadingdone",el:()=>document.fonts,handler(){this.$emit("resize")}},update:{read(){return{rows:(this.row?Pa(this.elements):[this.elements]).map(oE)}},write({rows:m}){for(let{heights:D,elements:_}of m)_.forEach(($,Q)=>ke($,"minHeight",D[Q]))},events:["resize"]}};function oE(m){if(m.length<2)return{heights:[""],elements:m};let D=m.map(Hg),_=Math.max(...D);return{heights:m.map(($,Q)=>D[Q].toFixed(2)===_.toFixed(2)?"":_),elements:m}}function Hg(m){let D=Ce(m.style,["display","minHeight"]);je(m)||ke(m,"display","block","important"),ke(m,"minHeight","");let _=Ht(m).height-ou(m,"height","content-box");return ke(m,D),_}var Ly={args:"target",props:{target:String},data:{target:""},computed:{target:{get:({target:m},D)=>Hn(m,D),observe:({target:m})=>m}},observe:li({target:({target:m})=>m}),update:{read(){return this.target?{height:this.target.offsetHeight}:!1},write({height:m}){ke(this.$el,{minHeight:m})},events:["resize"]}},zr={props:{expand:Boolean,offsetTop:Boolean,offsetBottom:Boolean,minHeight:Number},data:{expand:!1,offsetTop:!1,offsetBottom:!1,minHeight:0},observe:[Sc({filter:({expand:m})=>m}),li({target:({$el:m})=>Zu(m)})],update:{read(){if(!je(this.$el))return!1;let m="",D=ou(this.$el,"height","content-box"),{body:_,scrollingElement:$}=document,Q=ys(this.$el),{height:ae}=Mo(Q===_?$:Q),pe=$===Q||_===Q;if(m=`calc(${pe?"100vh":`${ae}px`}`,this.expand){let Ne=Ht(Q).height-Ht(this.$el).height;m+=` - ${Ne}px`}else{if(this.offsetTop)if(pe){let Ne=this.offsetTop===!0?this.$el:Hn(this.offsetTop,this.$el),{top:Fe}=Dr(Ne);m+=Fe>0&&Fe{if(!this._connected)return;let D=Ae(m,this.$el);return this.svgEl&&D!==this.svgEl&&Ao(this.svgEl),Ze.call(this,D,m),this.svgEl=D},He)},disconnected(){this.svg.then(m=>{this._connected||(ye(this.$el)&&(this.$el.hidden=!1),Ao(m),this.svgEl=null)}),this.svg=null},methods:{async getSvg(){}}};function Ae(m,D){if(ye(D)||jr(D,"canvas")){D.hidden=!0;let $=D.nextElementSibling;return Ie(m,$)?$:mc(D,m)}let _=D.lastElementChild;return Ie(m,_)?_:En(D,m)}function Ie(m,D){return jr(m,"svg")&&jr(D,"svg")&&m.innerHTML===D.innerHTML}function Ze(m,D){let _=["width","height"],$=_.map(ae=>this[ae]);$.some(ae=>ae)||($=_.map(ae=>Qe(D,ae)));let Q=Qe(D,"viewBox");Q&&!$.some(ae=>ae)&&($=Q.split(" ").slice(2)),$.forEach((ae,pe)=>Qe(m,_[pe],ie(ae)*this.ratio||null))}var $e={mixins:[se],args:"src",props:{src:String,icon:String,attributes:"list",strokeAnimation:Boolean},data:{strokeAnimation:!1},observe:[xs({async handler(){let m=await this.svg;m&&at.call(this,m)},options:{attributes:!0,attributeFilter:["id","class","style"]}})],async connected(){f(this.src,"#")&&([this.src,this.icon]=this.src.split("#"));let m=await this.svg;m&&(at.call(this,m),this.strokeAnimation&&Dt(m))},methods:{async getSvg(){return jr(this.$el,"img")&&!this.$el.complete&&this.$el.loading==="lazy"&&await new Promise(m=>Or(this.$el,"load",m)),xt(await mt(this.src),this.icon)||Promise.reject("SVG not found.")}}};function at(m){let{$el:D}=this;Ue(m,Qe(D,"class"),"uk-svg");for(let _=0;_m?a(m,"data:")?decodeURIComponent(m.split(",")[1]):(await fetch(m)).text():Promise.reject());function xt(m,D){return D&&f(m,"/g,At=be(function(m){let D={};bt.lastIndex=0;let _;for(;_=bt.exec(m);)D[_[3]]=``;return D});function Dt(m){let D=Tg(m);D&&ke(m,"--uk-animation-stroke",D)}function It(m){let D=document.createElement("template");return D.innerHTML=m,D.content.firstElementChild}let Yt={spinner:te,totop:oe,marker:sE,"close-icon":Py,"close-large":aE,"drop-parent-icon":df,"nav-parent-icon":uE,"nav-parent-icon-large":Um,"navbar-parent-icon":An,"navbar-toggle-icon":lE,"overlay-icon":fE,"pagination-next":cE,"pagination-previous":Hm,"search-icon":c,"search-medium":S,"search-large":d,"search-toggle-icon":c,"slidenav-next":T,"slidenav-next-large":N,"slidenav-previous":G,"slidenav-previous-large":z},Vt={install:gf,mixins:[se],args:"icon",props:{icon:String},isIcon:!0,beforeConnect(){Ue(this.$el,"uk-icon")},methods:{async getSvg(){let m=Di(this.icon);if(!m)throw"Icon not found.";return m}}},sr={args:!1,extends:Vt,data:m=>({icon:i(m.constructor.options.name)}),beforeConnect(){Ue(this.$el,this.$options.id)}},Yr={extends:sr,beforeConnect(){let m=this.$props.icon;this.icon=this.$el.closest(".uk-nav-primary")?`${m}-large`:m}},ai={extends:sr,mixins:[bi],i18n:{toggle:"Open Search",submit:"Submit Search"},beforeConnect(){let m=Be(this.$el,"uk-search-toggle")||Be(this.$el,"uk-navbar-toggle");if(this.icon=m?"search-toggle-icon":Be(this.$el,"uk-search-icon")&&this.$el.closest(".uk-search-large")?"search-large":this.$el.closest(".uk-search-medium")?"search-medium":this.$props.icon,!ut(this.$el,"aria-label"))if(m){let D=this.t("toggle");Qe(this.$el,"aria-label",D)}else{let D=this.$el.closest("a,button");if(D){let _=this.t("submit");Qe(D,"aria-label",_)}}}},dn={extends:sr,beforeConnect(){Qe(this.$el,"role","status")},methods:{async getSvg(){let m=await Vt.methods.getSvg.call(this);return this.ratio!==1&&ke(vr("circle",m),"strokeWidth",1/this.ratio),m}}},Zn={extends:sr,mixins:[bi],beforeConnect(){let m=this.$el.closest("a,button");Qe(m,"role",this.role!==null&&jr(m,"a")?"button":this.role);let D=this.t("label");D&&!ut(m,"aria-label")&&Qe(m,"aria-label",D)}},_i={extends:Zn,beforeConnect(){Ue(this.$el,"uk-slidenav");let m=this.$props.icon;this.icon=Be(this.$el,"uk-slidenav-large")?`${m}-large`:m}},Ln={extends:Zn,i18n:{label:"Open menu"}},ji={extends:Zn,i18n:{label:"Close"},beforeConnect(){this.icon=`close-${Be(this.$el,"uk-close-large")?"large":"icon"}`}},mi={extends:Zn,i18n:{label:"Open"}},Xn={extends:Zn,i18n:{label:"Back to top"}},Pn={extends:Zn,i18n:{label:"Next page"},data:{role:null}},vn={extends:Zn,i18n:{label:"Previous page"},data:{role:null}},hi={};function gf(m){m.icon.add=(D,_)=>{let $=R(D)?{[D]:_}:D;we($,(Q,ae)=>{Yt[ae]=Q,delete hi[ae]}),m._initialized&&zo(document.body,Q=>we(m.getComponents(Q),ae=>{ae.$options.isIcon&&ae.icon in $&&ae.$reset()}))}}let vu={twitter:"x"};function Di(m){return m=vu[m]||m,Yt[m]?(hi[m]||(hi[m]=It(Yt[Ra(m)]||Yt[m])),hi[m].cloneNode(!0)):null}function Ra(m){return j?he(he(m,"left","right"),"previous","next"):m}var si={args:"dataSrc",props:{dataSrc:String,sources:String,margin:String,target:String,loading:String},data:{dataSrc:"",sources:!1,margin:"50%",target:!1,loading:"lazy"},connected(){this.loading!=="lazy"?this.load():tp(this.$el)&&(this.$el.loading="lazy",ep(this.$el))},disconnected(){this.img&&(this.img.onload=""),delete this.img},observe:la({handler(m,D){this.load(),D.disconnect()},options:({margin:m})=>({rootMargin:m}),filter:({loading:m})=>m==="lazy",target:({$el:m,$props:D})=>D.target?[m,...ra(D.target,m)]:m}),methods:{load(){if(this.img)return this.img;let m=tp(this.$el)?this.$el:fl(this.$el,this.dataSrc,this.sources);return Pt(m,"loading"),ep(this.$el,m.currentSrc),this.img=m}}};function ep(m,D){if(tp(m)){let _=Gt(m);(jr(_,"picture")?Sr(_):[m]).forEach(Q=>yu(Q,Q))}else D&&!f(m.style.backgroundImage,D)&&(ke(m,"backgroundImage",`url(${Ba(D)})`),qt(m,So("load",!1)))}let Cs=["data-src","data-srcset","sizes"];function yu(m,D){for(let _ of Cs){let $=fe(m,_);$&&Qe(D,_.replace(/^(data-)+/,""),$)}}function fl(m,D,_){let $=new Image;return ki($,_),yu(m,$),$.onload=()=>{ep(m,$.currentSrc)},Qe($,"src",D),$}function ki(m,D){if(D=vf(D),D.length){let _=Vu("");for(let $ of D){let Q=Vu("");Qe(Q,$),En(_,Q)}En(_,m)}}function vf(m){if(!m)return[];if(a(m,"["))try{m=JSON.parse(m)}catch{m=[]}else m=Ju(m);return h(m)||(m=[m]),m.filter(D=>!H(D))}function tp(m){return jr(m,"img")}var xte={props:{target:String,selActive:String},data:{target:!1,selActive:!1},computed:{target:({target:m},D)=>m?tn(m,D):D},observe:[la({handler(m){this.isIntersecting=m.some(({isIntersecting:D})=>D),this.$emit()},target:({target:m})=>m,args:{intersecting:!1}}),xs({target:({target:m})=>m,options:{attributes:!0,attributeFilter:["class"],attributeOldValue:!0}}),{target:({target:m})=>m,observe:(m,D)=>{let _=xc([...Z(m),document.documentElement],D),$=[jt(document,"scroll itemshown itemhidden",D,{passive:!0,capture:!0}),jt(document,"show hide transitionstart",Q=>(D(),_.observe(Q.target))),jt(document,"shown hidden transitionend transitioncancel",Q=>(D(),_.unobserve(Q.target)))];return{observe:_.observe.bind(_),unobserve:_.unobserve.bind(_),disconnect(){_.disconnect(),$.map(Q=>Q())}}},handler(){this.$emit()}}],update:{read(){if(!this.isIntersecting)return!1;for(let m of Z(this.target)){let D=!this.selActive||rr(m,this.selActive)?wte(m):"";D!==!1&&Re(m,"uk-light uk-dark",D)}}}};function wte(m){let D=Ht(m),_=Ht(window);if(!Se(D,_))return!1;let{left:$,top:Q,height:ae,width:pe}=D,Ne;for(let Fe of[.25,.5,.75]){let et=m.ownerDocument.elementsFromPoint(Math.max(0,Math.min($+pe*Fe,_.width-1)),Math.max(0,Math.min(Q+ae/2,_.height-1)));for(let it of et){if(m.contains(it)||!bte(it)||it.closest('[class*="-leave"]')&&et.some(Ot=>it!==Ot&&rr(Ot,'[class*="-enter"]')))continue;let ht=ke(it,"--uk-inverse");if(ht){if(ht===Ne)return`uk-${ht}`;Ne=ht;break}}}return Ne?`uk-${Ne}`:""}function bte(m){if(ke(m,"visibility")!=="visible")return!1;for(;m;){if(ke(m,"opacity")==="0")return!1;m=Gt(m)}return!0}var Dte={mixins:[Xi,qc],props:{fill:String},data:{fill:"",clsWrapper:"uk-leader-fill",clsHide:"uk-leader-hide",attrFill:"data-fill"},computed:{fill:({fill:m},D)=>m||ke(D,"--uk-leader-fill-content")},connected(){[this.wrapper]=lm(this.$el,``)},disconnected(){Co(this.wrapper.childNodes)},observe:li(),update:{read(){return{width:Math.trunc(this.$el.offsetWidth/2),fill:this.fill,hide:!this.matchMedia}},write({width:m,fill:D,hide:_}){Ke(this.wrapper,this.clsHide,_),Qe(this.wrapper,this.attrFill,new Array(m).join(D))},events:["resize"]}},Nte={install:Ete,mixins:[cu],data:{clsPage:"uk-modal-page",selPanel:".uk-modal-dialog",selClose:".uk-modal-close, .uk-modal-close-default, .uk-modal-close-outside, .uk-modal-close-full"},events:[{name:"fullscreenchange webkitendfullscreen",capture:!0,handler(m){jr(m.target,"video")&&this.isToggled()&&!document.fullscreenElement&&this.hide()}},{name:"show",self:!0,handler(){Be(this.panel,"uk-margin-auto-vertical")?Ue(this.$el,"uk-flex"):ke(this.$el,"display","block"),Yi(this.$el)}},{name:"hidden",self:!0,handler(){ke(this.$el,"display",""),ge(this.$el,"uk-flex")}}]};function Ete({modal:m}){m.dialog=function(_,$){let Q=m(vr(`
    ${_}
    `),{stack:!0,role:"alertdialog",...$});return Q.show(),jt(Q.$el,"hidden",async()=>{await Promise.resolve(),Q.$destroy(!0)},{self:!0}),Q},m.alert=function(_,$){return D(({i18n:Q})=>`
    ${R(_)?_:gs(_)}
    `,$)},m.confirm=function(_,$){return D(({i18n:Q})=>`
    ${R(_)?_:gs(_)}
    `,$,()=>Promise.reject())},m.prompt=function(_,$,Q){let ae=D(({i18n:Fe})=>`
    `,Q,()=>null,()=>Ne.value),{$el:pe}=ae.dialog,Ne=vr("input",pe);return Ne.value=$||"",jt(pe,"show",()=>Ne.select()),ae},m.i18n={ok:"Ok",cancel:"Cancel"};function D(_,$,Q=He,ae=He){$={bgClose:!1,escClose:!0,...$,i18n:{...m.i18n,...$?.i18n}};let pe=m.dialog(_($),$);return b(new Promise(Ne=>{let Fe=jt(pe.$el,"hide",()=>Ne(Q()));jt(pe.$el,"submit","form",et=>{et.preventDefault(),Ne(ae(pe)),Fe(),pe.hide()})}),{dialog:pe})}}var Ste={extends:Ay,data:{targets:"> .uk-parent",toggle:"> a",content:"> ul"}};let pE="uk-navbar-transparent";var Ate={extends:Rm,props:{dropbarTransparentMode:Boolean},data:{clsDrop:"uk-navbar-dropdown",selNavItem:".uk-navbar-nav > li > a,a.uk-navbar-item,button.uk-navbar-item,.uk-navbar-item a,.uk-navbar-item button,.uk-navbar-toggle",dropbarTransparentMode:!1},computed:{navbarContainer:(m,D)=>D.closest(".uk-navbar-container")},watch:{items(){let m=Be(this.$el,"uk-navbar-justify"),D=tn(".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right",this.$el);for(let _ of D){let $=m?tn(".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle",_).length:"";ke(_,"flexGrow",$)}}},events:[{name:"show",el:({dropContainer:m})=>m,handler({target:m}){this.getTransparentMode(m)==="remove"&&Be(this.navbarContainer,pE)&&(ge(this.navbarContainer,pE),this._transparent=!0)}},{name:"hide",el:({dropContainer:m})=>m,async handler(){await Cte(),!this.getActive()&&this._transparent&&(Ue(this.navbarContainer,pE),this._transparent=null)}}],methods:{getTransparentMode(m){if(!this.navbarContainer)return;if(this.dropbar&&this.isDropbarDrop(m))return this.dropbarTransparentMode;let D=this.getDropdown(m);if(D&&Be(m,"uk-dropbar"))return D.inset?"behind":"remove"},getDropbarOffset(m){let{top:D,height:_}=Dr(this.navbarContainer);return D+(this.dropbarTransparentMode==="behind"?0:_+m)}}};function Cte(){return new Promise(m=>setTimeout(m))}var Mte={mixins:[cu],args:"mode",props:{mode:String,flip:Boolean,overlay:Boolean,swiping:Boolean},data:{mode:"slide",flip:!1,overlay:!1,clsPage:"uk-offcanvas-page",clsContainer:"uk-offcanvas-container",selPanel:".uk-offcanvas-bar",clsFlip:"uk-offcanvas-flip",clsContainerAnimation:"uk-offcanvas-container-animation",clsSidebarAnimation:"uk-offcanvas-bar-animation",clsMode:"uk-offcanvas",clsOverlay:"uk-offcanvas-overlay",selClose:".uk-offcanvas-close",container:!1,swiping:!0},computed:{clsFlip:({flip:m,clsFlip:D})=>m?D:"",clsOverlay:({overlay:m,clsOverlay:D})=>m?D:"",clsMode:({mode:m,clsMode:D})=>`${D}-${m}`,clsSidebarAnimation:({mode:m,clsSidebarAnimation:D})=>m==="none"||m==="reveal"?"":D,clsContainerAnimation:({mode:m,clsContainerAnimation:D})=>m!=="push"&&m!=="reveal"?"":D,transitionElement({mode:m}){return m==="reveal"?Gt(this.panel):this.panel}},observe:wm({filter:({swiping:m})=>m}),update:{read(){this.isToggled()&&!je(this.$el)&&this.hide()},events:["resize"]},events:[{name:"touchmove",self:!0,passive:!1,filter:({overlay:m})=>m,handler(m){m.cancelable&&m.preventDefault()}},{name:"show",self:!0,handler(){this.mode==="reveal"&&!Be(Gt(this.panel),this.clsMode)&&(um(this.panel,"
    "),Ue(Gt(this.panel),this.clsMode));let{body:m,scrollingElement:D}=document;Ue(m,this.clsContainer,this.clsFlip),ke(m,"touch-action","pan-y pinch-zoom"),ke(this.$el,"display","block"),ke(this.panel,"maxWidth",D.clientWidth),Ue(this.$el,this.clsOverlay),Ue(this.panel,this.clsSidebarAnimation,this.mode==="reveal"?"":this.clsMode),Yi(m),Ue(m,this.clsContainerAnimation),this.clsContainerAnimation&&Tte()}},{name:"hide",self:!0,handler(){ge(document.body,this.clsContainerAnimation),ke(document.body,"touch-action","")}},{name:"hidden",self:!0,handler(){this.clsContainerAnimation&&Ote(),this.mode==="reveal"&&Co(this.panel),ge(this.panel,this.clsSidebarAnimation,this.clsMode),ge(this.$el,this.clsOverlay),ke(this.$el,"display",""),ke(this.panel,"maxWidth",""),ge(document.body,this.clsContainer,this.clsFlip)}},{name:"swipeLeft swipeRight",handler(m){this.isToggled()&&s(m.type,"Left")^this.flip&&this.hide()}}]};function Tte(){pO().content+=",user-scalable=0"}function Ote(){let m=pO();m.content=m.content.replace(/,user-scalable=0$/,"")}function pO(){return vr('meta[name="viewport"]',document.head)||En(document.head,'')}var Ite={mixins:[Xi],props:{selContainer:String,selContent:String,minHeight:Number},data:{selContainer:".uk-modal",selContent:".uk-modal-dialog",minHeight:150},computed:{container:({selContainer:m},D)=>D.closest(m),content:({selContent:m},D)=>D.closest(m)},observe:li({target:({container:m,content:D})=>[m,D]}),update:{read(){return!this.content||!this.container||!je(this.$el)?!1:{max:Math.max(this.minHeight,Yi(this.container)-(Ht(this.content).height-Yi(this.$el)))}},write({max:m}){ke(this.$el,{minHeight:this.minHeight,maxHeight:m})},events:["resize"]}},Fte={props:["width","height"],connected(){Ue(this.$el,"uk-responsive-width"),ke(this.$el,"aspectRatio",`${this.width}/${this.height}`)}},_te={props:{offset:Number},data:{offset:0},connected(){kte(this)},disconnected(){Bte(this)},methods:{async scrollTo(m){m=m&&vr(m)||document.body,qt(this.$el,"beforescroll",[this,m])&&(await rg(m,{offset:this.offset}),qt(this.$el,"scrolled",[this,m]))}}};let $g=new Set;function kte(m){$g.size||jt(document,"click",mO),$g.add(m)}function Bte(m){$g.delete(m),$g.size||Gi(document,"click",mO)}function mO(m){if(!m.defaultPrevented)for(let D of $g)D.$el.contains(m.target)&&_a(D.$el)&&(m.preventDefault(),window.location.href!==D.$el.href&&window.history.pushState({},"",D.$el.href),D.scrollTo(ka(D.$el)))}let mE="uk-scrollspy-inview";var Lte={args:"cls",props:{cls:String,target:String,hidden:Boolean,margin:String,repeat:Boolean,delay:Number},data:()=>({cls:"",target:!1,hidden:!0,margin:"-1px",repeat:!1,delay:0}),computed:{elements:({target:m},D)=>m?tn(m,D):[D]},watch:{elements(m){this.hidden&&ke(xi(m,`:not(.${mE})`),"opacity",0)}},connected(){this.elementData=new Map},disconnected(){for(let[m,D]of this.elementData.entries())ge(m,mE,D?.cls||"");delete this.elementData},observe:la({target:({elements:m})=>m,handler(m){let D=this.elementData;for(let{target:_,isIntersecting:$}of m){D.has(_)||D.set(_,{cls:fe(_,"uk-scrollspy-class")||this.cls});let Q=D.get(_);!this.repeat&&Q.show||(Q.show=$)}this.$emit()},options:({margin:m})=>({rootMargin:m}),args:{intersecting:!1}}),update:[{write(m){for(let[D,_]of this.elementData.entries())_.show&&!_.inview&&!_.queued?(_.queued=!0,m.promise=(m.promise||Promise.resolve()).then(()=>new Promise($=>setTimeout($,this.delay))).then(()=>{this.toggle(D,!0),setTimeout(()=>{_.queued=!1,this.$emit()},300)})):!_.show&&_.inview&&!_.queued&&this.repeat&&this.toggle(D,!1)}}],methods:{toggle(m,D){var _,$;let Q=(_=this.elementData)==null?void 0:_.get(m);if(!Q)return;($=Q.off)==null||$.call(Q),ke(m,"opacity",!D&&this.hidden?0:""),Ke(m,mE,D),Ke(m,Q.cls);let ae;if(ae=Q.cls.match(/\buk-animation-[\w-]+/g)){let pe=()=>ge(m,ae);D?Q.off=Or(m,"animationcancel animationend",pe,{self:!0}):pe()}qt(m,D?"inview":"outview"),Q.inview=D}}},Pte={props:{cls:String,closest:Boolean,scroll:Boolean,target:String,offset:Number},data:{cls:"uk-active",closest:!1,scroll:!1,target:"a[href]",offset:0},computed:{links:({target:m},D)=>tn(m,D).filter(_=>_a(_)),elements({closest:m}){return this.links.map(D=>D.closest(m||"*"))}},watch:{links(m){this.scroll&&this.$create("scroll",m,{offset:this.offset})}},observe:[la(),Xl()],update:[{read(){let m=this.links.map(Fe=>ka(Fe)||Fe.ownerDocument),{length:D}=m;if(!D||!je(this.$el))return!1;let _=ys(m,!0),{scrollTop:$,scrollHeight:Q}=_,ae=Mo(_),pe=Q-ae.height,Ne=!1;if($>=pe)Ne=D-1;else{let Fe=this.offset+Ht(Xu()).height+ae.height*.1;for(let et=0;et0);et++)Ne=+et}return{active:Ne}},write({active:m}){let D=m!==!1&&!Be(this.elements[m],this.cls);this.links.forEach(_=>_.blur());for(let _=0;_m&&vr(m,D)||D},connected(){this.start=hO(this.start||this.top),this.end=hO(this.end||this.bottom),this.placeholder=vr("+ .uk-sticky-placeholder",this.$el)||vr('
    '),this.isFixed=!1,this.setActive(!1)},beforeDisconnect(){this.isFixed&&(this.hide(),ge(this.target,this.clsInactive)),dO(this.$el),Ao(this.placeholder),this.placeholder=null},observe:[Sc(),Xl({target:()=>document.scrollingElement}),li({target:({$el:m})=>[m,Gt(m),document.scrollingElement],handler(m){this.$emit(this._data.resized&&m.some(({target:D})=>D===Gt(this.$el))?"update":"resize"),this._data.resized=!0}})],events:[{name:"load hashchange popstate",el:()=>window,filter:({targetOffset:m})=>m!==!1,handler(){let{scrollingElement:m}=document;!location.hash||m.scrollTop===0||setTimeout(()=>{let D=Dr(vr(location.hash)),_=Dr(this.$el);this.isFixed&&Se(D,_)&&(m.scrollTop=Math.ceil(D.top-_.height-ii(this.targetOffset,"height",this.placeholder)-ii(this.offset,"height",this.placeholder)))})}}],update:[{read({height:m,width:D,margin:_,sticky:$},Q){if(this.inactive=!this.matchMedia||!je(this.$el)||!this.$el.offsetHeight,this.inactive)return;let ae=this.isFixed&&Q.has("update");ae&&(gE(this.target),this.hide()),this.active||({height:m,width:D}=Ht(this.$el),_=ke(this.$el,"margin")),ae&&this.show();let pe=ii("100vh","height"),Ne=Yi(window),Fe=Math.max(0,document.scrollingElement.scrollHeight-pe),et=this.position;this.overflowFlip&&m>pe&&(et=et==="top"?"bottom":"top");let it=this.isFixed?this.placeholder:this.$el,ht=ii(this.offset,"height",$?this.$el:it);et==="bottom"&&(mDr(Ot).top+(Fe?Math.min(Ne,pe):Ne),offsetParentTop:Dr(Ot.offsetParent).top,overflowScroll:Oe($+Oe(it,Q,ae)-Oe(m,Q,ae),0,_)}},write(m,D){let _=D.has("scroll"),{initTimestamp:$=0,dir:Q,prevDir:ae,scroll:pe,prevScroll:Ne=0,top:Fe,start:et,below:it}=m;if(pe<0||pe===Ne&&_||this.showOnUp&&!_&&!this.isFixed)return;let ht=Date.now();if((ht-$>300||Q!==ae)&&(m.initScroll=pe,m.initTimestamp=ht),!(this.showOnUp&&!this.isFixed&&Math.abs(m.initScroll-pe)<=30&&Math.abs(Ne-pe)<=10))if(this.inactive||pepe&&(ds.cancel(this.$el),this.hide());return}if(this.animation&&it){if(Be(this.$el,"uk-animation-leave"))return;ds.out(this.$el,this.animation).then(()=>this.hide(),He)}else this.hide()}else this.isFixed?this.update():this.animation&&it?(this.show(),ds.in(this.$el,this.animation).catch(He)):(gE(this.target),this.show())},events:["resize","resizeViewport","scroll"]}],methods:{show(){this.isFixed=!0,this.update(),this.placeholder.hidden=!1},hide(){let{offset:m,sticky:D}=this._data;this.setActive(!1),ge(this.$el,this.clsFixed,this.clsBelow),D?ke(this.$el,"top",m):ke(this.$el,{position:"",top:"",width:"",marginTop:""}),this.placeholder.hidden=!0,this.isFixed=!1},update(){let{width:m,scroll:D=0,overflow:_,overflowScroll:$=0,start:Q,end:ae,offset:pe,offsetParentTop:Ne,sticky:Fe,below:et}=this._data,it=Q!==0||D>Q;if(!Fe){let ht="fixed";D>ae&&(pe+=ae-Ne+$-_,ht="absolute"),ke(this.$el,{position:ht,width:m,marginTop:0},"important")}ke(this.$el,"top",pe-$),this.setActive(it),Ke(this.$el,this.clsBelow,et),Ue(this.$el,this.clsFixed)},setActive(m){let D=this.active;this.active=m,m?(Re(this.target,this.clsInactive,this.clsActive),D!==m&&qt(this.$el,"active")):(Re(this.target,this.clsActive,this.clsInactive),D!==m&&(gE(this.target),qt(this.$el,"inactive")))}}};function hE(m,D,_,$){if(!m)return 0;if(U(m)||R(m)&&m.match(/^-?\d/))return _+ii(m,"height",D,!0);{let Q=m===!0?Gt(D):Hn(m,D);return Dr(Q).bottom-($&&Q?.contains(D)?ie(ke(Q,"paddingBottom")):0)}}function hO(m){return m==="true"?!0:m==="false"?!1:m}function dO(m){ke(m,{position:"",top:"",marginTop:"",width:""})}let dE="uk-transition-disable";function gE(m){Be(m,dE)||(Ue(m,dE),requestAnimationFrame(()=>ge(m,dE)))}let vE=".uk-disabled *, .uk-disabled, [disabled]";var gO={mixins:[fu],args:"connect",props:{connect:String,toggle:String,itemNav:String,active:Number,followFocus:Boolean,swiping:Boolean},data:{connect:"~.uk-switcher",toggle:"> * > :first-child",itemNav:!1,active:0,cls:"uk-active",attrItem:"uk-switcher-item",selVertical:".uk-nav",followFocus:!1,swiping:!0},computed:{connects:{get:({connect:m},D)=>ra(m,D),observe:({connect:m})=>m},connectChildren(){return this.connects.map(m=>Sr(m)).flat()},toggles:({toggle:m},D)=>tn(m,D),children(m,D){return Sr(D).filter(_=>this.toggles.some($=>_.contains($)))}},watch:{connects(m){this.swiping&&ke(m,"touchAction","pan-y pinch-zoom"),this.$emit()},connectChildren(){let m=Math.max(0,this.index());for(let D of this.connects)Sr(D).forEach((_,$)=>Ke(_,this.cls,$===m));this.$emit()},toggles(m){this.$emit();let D=this.index();this.show(~D?D:m[this.active]||m[0])}},connected(){Qe(this.$el,"role","tablist")},observe:[Zl({targets:({connectChildren:m})=>m}),wm({target:({connects:m})=>m,filter:({swiping:m})=>m})],events:[{name:"click keydown",delegate:({toggle:m})=>m,handler(m){!rr(m.current,vE)&&(m.type==="click"||m.keyCode===Ir.SPACE)&&(m.preventDefault(),this.show(m.current))}},{name:"keydown",delegate:({toggle:m})=>m,handler(m){let{current:D,keyCode:_}=m,$=rr(this.$el,this.selVertical),Q=_===Ir.HOME?0:_===Ir.END?"last":_===Ir.LEFT&&!$||_===Ir.UP&&$?"previous":_===Ir.RIGHT&&!$||_===Ir.DOWN&&$?"next":-1;if(~Q){m.preventDefault();let ae=this.toggles.filter(Ne=>!rr(Ne,vE)),pe=ae[de(Q,ae,ae.indexOf(D))];pe.focus(),this.followFocus&&this.show(pe)}}},{name:"click",el:({$el:m,connects:D,itemNav:_})=>D.concat(_?ra(_,m):[]),delegate:({attrItem:m})=>`[${m}],[data-${m}]`,handler(m){m.target.closest("a,button")&&(m.preventDefault(),this.show(fe(m.current,this.attrItem)))}},{name:"swipeRight swipeLeft",filter:({swiping:m})=>m,el:({connects:m})=>m,handler({type:m}){this.show(s(m,"Left")?"next":"previous")}}],update(){var m;for(let D of this.connects)jr(D,"ul")&&Qe(D,"role","presentation");Qe(Sr(this.$el),"role","presentation");for(let D in this.toggles){let _=this.toggles[D],$=(m=this.connects[0])==null?void 0:m.children[D];Qe(_,"role","tab"),$&&(_.id=du(this,_),$.id=du(this,$),Qe(_,"aria-controls",$.id),Qe($,{role:"tabpanel","aria-labelledby":_.id}))}Qe(this.$el,"aria-orientation",rr(this.$el,this.selVertical)?"vertical":null)},methods:{index(){return p(this.children,m=>Be(m,this.cls))},show(m){let D=this.toggles.filter(pe=>!rr(pe,vE)),_=this.index(),$=de(!I(m)||f(D,m)?m:0,D,de(this.toggles[_],D)),Q=de(D[$],this.toggles);this.children.forEach((pe,Ne)=>{Ke(pe,this.cls,Q===Ne),Qe(this.toggles[Ne],{"aria-selected":Q===Ne,tabindex:Q===Ne?null:-1})});let ae=_>=0&&_!==$;this.connects.forEach(async({children:pe})=>{let Ne=x(pe).filter((Fe,et)=>et!==Q&&Be(Fe,this.cls));await this.toggleElement(Ne,!1,ae)&&await this.toggleElement(pe[Q],!0,ae)})}}},qte={mixins:[Xi],extends:gO,props:{media:Boolean},data:{media:960,attrItem:"uk-tab-item",selVertical:".uk-tab-left,.uk-tab-right"},connected(){let m=Be(this.$el,"uk-tab-left")?"uk-tab-left":Be(this.$el,"uk-tab-right")?"uk-tab-right":!1;m&&this.$create("toggle",this.$el,{cls:m,mode:"media",media:this.media})}};let zte=32;var Ute={mixins:[qc,fu],args:"target",props:{href:String,target:null,mode:"list",queued:Boolean},data:{href:!1,target:!1,mode:"click",queued:!0},computed:{target:{get:({target:m},D)=>(m=ra(m||D.hash,D),m.length?m:[D]),observe:({target:m})=>m}},connected(){f(this.mode,"media")||(Gr(this.$el)||Qe(this.$el,"tabindex","0"),!this.cls&&jr(this.$el,"a")&&Qe(this.$el,"role","button"))},observe:Zl({targets:({target:m})=>m}),events:[{name:xe,filter:({mode:m})=>f(m,"hover"),handler(m){this._preventClick=null,!(!st(m)||P(this._showState)||this.$el.disabled)&&(qt(this.$el,"focus"),Or(document,xe,()=>qt(this.$el,"blur"),!0,D=>!this.$el.contains(D.target)),f(this.mode,"click")&&(this._preventClick=!0))}},{name:`mouseenter mouseleave ${nt} ${Xe} focus blur`,filter:({mode:m})=>f(m,"hover"),handler(m){if(st(m)||this.$el.disabled)return;let D=f(["mouseenter",nt,"focus"],m.type),_=this.isToggled(this.target);if(!D&&(!P(this._showState)||m.type!=="blur"&&rr(this.$el,":focus")||m.type==="blur"&&rr(this.$el,":hover"))){_===this._showState&&(this._showState=null);return}D&&P(this._showState)&&_!==this._showState||(this._showState=D?_:null,this.toggle(`toggle${D?"show":"hide"}`))}},{name:"keydown",filter:({$el:m,mode:D})=>f(D,"click")&&!jr(m,"input"),handler(m){m.keyCode===zte&&(m.preventDefault(),this.$el.click())}},{name:"click",filter:({mode:m})=>["click","hover"].some(D=>f(m,D)),handler(m){let D;(this._preventClick||m.target.closest('a[href="#"], a[href=""]')||(D=m.target.closest("a[href]"))&&(!this.isToggled(this.target)||D.hash&&rr(this.target,D.hash)))&&m.preventDefault(),!this._preventClick&&f(this.mode,"click")&&this.toggle()}},{name:"mediachange",filter:({mode:m})=>f(m,"media"),el:({target:m})=>m,handler(m,D){D.matches^this.isToggled(this.target)&&this.toggle()}}],methods:{async toggle(m){if(!qt(this.target,m||"toggle",[this]))return;if(ut(this.$el,"aria-expanded")&&Qe(this.$el,"aria-expanded",!this.isToggled(this.target)),!this.queued)return this.toggleElement(this.target);let D=this.target.filter($=>Be($,this.clsLeave));if(D.length){for(let $ of this.target){let Q=f(D,$);this.toggleElement($,Q,Q)}return}let _=this.target.filter(this.isToggled);await this.toggleElement(_,!1)&&await this.toggleElement(this.target.filter($=>!f(_,$)),!0)}}},Hte=Object.freeze({__proto__:null,Accordion:Ay,Alert:eE,Close:ji,Cover:My,Drop:ll,DropParentIcon:sr,Dropdown:ll,Dropnav:Rm,FormCustom:pa,Grid:qm,HeightMatch:By,HeightPlaceholder:Ly,HeightViewport:zr,Icon:Vt,Img:si,Inverse:xte,Leader:Dte,Margin:ws,Marker:mi,Modal:Nte,Nav:Ste,NavParentIcon:Yr,Navbar:Ate,NavbarParentIcon:sr,NavbarToggleIcon:Ln,Offcanvas:Mte,OverflowAuto:Ite,OverlayIcon:sr,PaginationNext:Pn,PaginationPrevious:vn,Responsive:Fte,Scroll:_te,Scrollspy:Lte,ScrollspyNav:Pte,SearchIcon:ai,SlidenavNext:_i,SlidenavPrevious:_i,Spinner:dn,Sticky:Rte,Svg:$e,Switcher:gO,Tab:qte,Toggle:Ute,Totop:Xn,Video:zg});return we(Hte,(m,D)=>Yn.component(D,m)),QN(Yn),we(Dy,(m,D)=>Yn.component(D,m)),Yn})});var Dx=vt((lS,fS)=>{g();y();v();(function(e,t){typeof lS=="object"&&typeof fS<"u"?fS.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=t())})(lS,function(){"use strict";function e(){return!0}function t(){return!1}function r(){}let n="Argument is not a typed-function.";function i(){function u(ne){return typeof ne=="object"&&ne!==null&&ne.constructor===Object}let l=[{name:"number",test:function(ne){return typeof ne=="number"}},{name:"string",test:function(ne){return typeof ne=="string"}},{name:"boolean",test:function(ne){return typeof ne=="boolean"}},{name:"Function",test:function(ne){return typeof ne=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(ne){return ne instanceof Date}},{name:"RegExp",test:function(ne){return ne instanceof RegExp}},{name:"Object",test:u},{name:"null",test:function(ne){return ne===null}},{name:"undefined",test:function(ne){return ne===void 0}}],a={name:"any",test:e,isAny:!0},s,f,p=0,h={createCount:0};function x(ne){let me=s.get(ne);if(me)return me;let xe='Unknown type "'+ne+'"',_e=ne.toLowerCase(),Je;for(Je of f)if(Je.toLowerCase()===_e){xe+='. Did you mean "'+Je+'" ?';break}throw new TypeError(xe)}function b(ne){let me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",xe=me?x(me).index:f.length,_e=[];for(let nt=0;nt{let _e=s.get(xe);return!_e.isAny&&_e.test(ne)});return me.length?me:["any"]}function O(ne){return ne&&typeof ne=="function"&&"_typedFunctionData"in ne}function M(ne,me,xe){if(!O(ne))throw new TypeError(n);let _e=xe&&xe.exact,Je=Array.isArray(me)?me.join(","):me,nt=U(Je),Xe=C(nt);if(!_e||Xe in ne.signatures){let Ye=ne._typedFunctionData.signatureMap.get(Xe);if(Ye)return Ye}let pt=nt.length,X;if(_e){X=[];let Ye;for(Ye in ne.signatures)X.push(ne._typedFunctionData.signatureMap.get(Ye))}else X=ne._typedFunctionData.signatures;for(let Ye=0;Ye!Gr.has(Gt.name)))continue}wt.push(Bt)}}if(X=wt,X.length===0)break}let ye;for(ye of X)if(ye.params.length<=pt)return ye;throw new TypeError("Signature not found (signature: "+(ne.name||"unnamed")+"("+C(nt,", ")+"))")}function I(ne,me,xe){return M(ne,me,xe).implementation}function F(ne,me){let xe=x(me);if(xe.test(ne))return ne;let _e=xe.conversionsTo;if(_e.length===0)throw new Error("There are no conversions to "+me+" defined.");for(let Je=0;Je<_e.length;Je++)if(x(_e[Je].from).test(ne))return _e[Je].convert(ne);throw new Error("Cannot convert "+ne+" to "+me)}function C(ne){let me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return ne.map(xe=>xe.name).join(me)}function P(ne){let me=ne.indexOf("...")===0,_e=(me?ne.length>3?ne.slice(3):"any":ne).split("|").map(pt=>x(pt.trim())),Je=!1,nt=me?"...":"";return{types:_e.map(function(pt){return Je=pt.isAny||Je,nt+=pt.name+"|",{name:pt.name,typeIndex:pt.index,test:pt.test,isAny:pt.isAny,conversion:null,conversionIndex:-1}}),name:nt.slice(0,-1),hasAny:Je,hasConversion:!1,restParam:me}}function R(ne){let me=ne.types.map(Xe=>Xe.name),xe=ce(me),_e=ne.hasAny,Je=ne.name,nt=xe.map(function(Xe){let pt=x(Xe.from);return _e=pt.isAny||_e,Je+="|"+Xe.from,{name:Xe.from,typeIndex:pt.index,test:pt.test,isAny:pt.isAny,conversion:Xe,conversionIndex:Xe.index}});return{types:ne.types.concat(nt),name:Je,hasAny:_e,hasConversion:nt.length>0,restParam:ne.restParam}}function q(ne){return ne.typeSet||(ne.typeSet=new Set,ne.types.forEach(me=>ne.typeSet.add(me.name))),ne.typeSet}function U(ne){let me=[];if(typeof ne!="string")throw new TypeError("Signatures must be strings");let xe=ne.trim();if(xe==="")return me;let _e=xe.split(",");for(let Je=0;Je<_e.length;++Je){let nt=P(_e[Je].trim());if(nt.restParam&&Je!==_e.length-1)throw new SyntaxError('Unexpected rest parameter "'+_e[Je]+'": only allowed for the last parameter');if(nt.types.length===0)return null;me.push(nt)}return me}function H(ne){let me=de(ne);return me?me.restParam:!1}function V(ne){if(!ne||ne.types.length===0)return e;if(ne.types.length===1)return x(ne.types[0].name).test;if(ne.types.length===2){let me=x(ne.types[0].name).test,xe=x(ne.types[1].name).test;return function(Je){return me(Je)||xe(Je)}}else{let me=ne.types.map(function(xe){return x(xe.name).test});return function(_e){for(let Je=0;Je=Je+1}}else return ne.length===0?function(nt){return nt.length===0}:ne.length===1?(xe=V(ne[0]),function(nt){return xe(nt[0])&&nt.length===1}):ne.length===2?(xe=V(ne[0]),_e=V(ne[1]),function(nt){return xe(nt[0])&&_e(nt[1])&&nt.length===2}):(me=ne.map(V),function(nt){for(let Xe=0;Xe{let Je=ie(_e.params,me),nt;for(nt of Je)xe.add(nt)}),xe.has("any")?["any"]:Array.from(xe)}function le(ne,me,xe){let _e,Je,nt=ne||"unnamed",Xe=xe,pt;for(pt=0;pt{let Bt=ee(wt.params,pt),fr=V(Bt);(pt0){let wt=E(me[pt]);return _e=new TypeError("Unexpected type of argument in function "+nt+" (expected: "+Je.join(" or ")+", actual: "+wt.join(" | ")+", index: "+pt+")"),_e.data={category:"wrongType",fn:nt,index:pt,actual:wt,expected:Je},_e}}else Xe=je}let X=Xe.map(function(je){return H(je.params)?1/0:je.params.length});if(me.lengthye)return _e=new TypeError("Too many arguments in function "+nt+" (expected: "+ye+", actual: "+me.length+")"),_e.data={category:"tooManyArgs",fn:nt,index:me.length,expectedLength:ye},_e;let Ye=[];for(let je=0;je0)return 1;let _e=he(ne)-he(me);return _e<0?-1:_e>0?1:0}function we(ne,me){let xe=ne.params,_e=me.params,Je=de(xe),nt=de(_e),Xe=H(xe),pt=H(_e);if(Xe&&Je.hasAny){if(!pt||!nt.hasAny)return 1}else if(pt&&nt.hasAny)return-1;let X=0,ye=0,Ye;for(Ye of xe)Ye.hasAny&&++X,Ye.hasConversion&&++ye;let je=0,wt=0;for(Ye of _e)Ye.hasAny&&++je,Ye.hasConversion&&++wt;if(X!==je)return X-je;if(Xe&&Je.hasConversion){if(!pt||!nt.hasConversion)return 1}else if(pt&&nt.hasConversion)return-1;if(ye!==wt)return ye-wt;if(Xe){if(!pt)return 1}else if(pt)return-1;let Bt=(xe.length-_e.length)*(Xe?-1:1);if(Bt!==0)return Bt;let fr=[],Gr=0;for(let xi=0;xi1&&me.sort((Je,nt)=>Je.index-nt.index);let xe=me[0].conversionsTo;if(ne.length===1)return xe;xe=xe.concat([]);let _e=new Set(ne);for(let Je=1;JeJe.hasConversion)){let Je=H(ne),nt=ne.map(Pe);xe=function(){let pt=[],X=Je?arguments.length-1:arguments.length;for(let ye=0;yeX.name).join("|"),hasAny:pt.some(X=>X.isAny),hasConversion:!1,restParam:!0}),Xe.push(nt)}else Xe=nt.types.map(function(pt){return{types:[pt],name:pt.name,hasAny:pt.isAny,hasConversion:pt.conversion,restParam:!1}});return ge(Xe,function(pt){return me(xe,_e+1,Je.concat([pt]))})}else return[Je]}return me(ne,0,[])}function Oe(ne,me){let xe=Math.max(ne.length,me.length);for(let pt=0;pt=_e:Xe?_e>=Je:_e===Je}function He(ne){return ne.map(me=>Qe(me)?Ke(me.referToSelf.callback):ot(me)?Be(me.referTo.references,me.referTo.callback):me)}function Se(ne,me,xe){let _e=[],Je;for(Je of ne){let nt=xe[Je];if(typeof nt!="number")throw new TypeError('No definition for referenced signature "'+Je+'"');if(nt=me[nt],typeof nt!="function")return!1;_e.push(nt)}return _e}function ze(ne,me,xe){let _e=He(ne),Je=new Array(_e.length).fill(!1),nt=!0;for(;nt;){nt=!1;let Xe=!0;for(let pt=0;pt<_e.length;++pt){if(Je[pt])continue;let X=_e[pt];if(Qe(X))_e[pt]=X.referToSelf.callback(xe),_e[pt].referToSelf=X.referToSelf,Je[pt]=!0,Xe=!1;else if(ot(X)){let ye=Se(X.referTo.references,_e,me);ye?(_e[pt]=X.referTo.callback.apply(this,ye),_e[pt].referTo=X.referTo,Je[pt]=!0,Xe=!1):nt=!0}}if(Xe&&nt)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return _e}function We(ne){let me=/\bthis(\(|\.signatures\b)/;Object.keys(ne).forEach(xe=>{let _e=ne[xe];if(me.test(_e.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function Le(ne,me){if(h.createCount++,Object.keys(me).length===0)throw new SyntaxError("No signatures provided");h.warnAgainstDeprecatedThis&&We(me);let xe=[],_e=[],Je={},nt=[],Xe;for(Xe in me){if(!Object.prototype.hasOwnProperty.call(me,Xe))continue;let ue=U(Xe);if(!ue)continue;xe.forEach(function(rt){if(Oe(rt,ue))throw new TypeError('Conflicting signatures "'+C(rt)+'" and "'+C(ue)+'".')}),xe.push(ue);let Me=_e.length;_e.push(me[Xe]);let st=ue.map(R),dt;for(dt of Ce(st)){let rt=C(dt);nt.push({params:dt,name:rt,fn:Me}),dt.every(ke=>!ke.hasConversion)&&(Je[rt]=Me)}}nt.sort(we);let pt=ze(_e,Je,$n),X;for(X in Je)Object.prototype.hasOwnProperty.call(Je,X)&&(Je[X]=pt[Je[X]]);let ye=[],Ye=new Map;for(X of nt)Ye.has(X.name)||(X.fn=pt[X.fn],ye.push(X),Ye.set(X.name,X));let je=ye[0]&&ye[0].params.length<=2&&!H(ye[0].params),wt=ye[1]&&ye[1].params.length<=2&&!H(ye[1].params),Bt=ye[2]&&ye[2].params.length<=2&&!H(ye[2].params),fr=ye[3]&&ye[3].params.length<=2&&!H(ye[3].params),Gr=ye[4]&&ye[4].params.length<=2&&!H(ye[4].params),Gt=ye[5]&&ye[5].params.length<=2&&!H(ye[5].params),xi=je&&wt&&Bt&&fr&&Gr&≫for(let ue=0;ueue.test),oa=ye.map(ue=>ue.implementation),$u=function(){for(let Me=So;MeC(U(xe))),me=de(arguments);if(typeof me!="function")throw new TypeError("Callback function expected as last argument");return Be(ne,me)}function Be(ne,me){return{referTo:{references:ne,callback:me}}}function Ke(ne){if(typeof ne!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:ne}}}function ot(ne){return ne&&typeof ne.referTo=="object"&&Array.isArray(ne.referTo.references)&&typeof ne.referTo.callback=="function"}function Qe(ne){return ne&&typeof ne.referToSelf=="object"&&typeof ne.referToSelf.callback=="function"}function ut(ne,me){if(!ne)return me;if(me&&me!==ne){let xe=new Error("Function names do not match (expected: "+ne+", actual: "+me+")");throw xe.data={actual:me,expected:ne},xe}return ne}function Pt(ne){let me;for(let xe in ne)Object.prototype.hasOwnProperty.call(ne,xe)&&(O(ne[xe])||typeof ne[xe].signature=="string")&&(me=ut(me,ne[xe].name));return me}function fe(ne,me){let xe;for(xe in me)if(Object.prototype.hasOwnProperty.call(me,xe)){if(xe in ne&&me[xe]!==ne[xe]){let _e=new Error('Signature "'+xe+'" is defined twice');throw _e.data={signature:xe,sourceFunction:me[xe],destFunction:ne[xe]},_e}ne[xe]=me[xe]}}let J=h;h=function(ne){let me=typeof ne=="string",xe=me?1:0,_e=me?ne:"",Je={};for(let nt=xe;nt1&&arguments[1]!==void 0?arguments[1]:{override:!1};j(ne);let xe=x(ne.to),_e=xe.conversionsTo.find(Je=>Je.from===ne.from);if(_e)if(me&&me.override)h.removeConversion({from:_e.from,to:ne.to,convert:_e.convert});else throw new Error('There is already a conversion from "'+ne.from+'" to "'+xe.name+'"');xe.conversionsTo.push({from:ne.from,convert:ne.convert,index:p++})},h.addConversions=function(ne,me){ne.forEach(xe=>h.addConversion(xe,me))},h.removeConversion=function(ne){j(ne);let me=x(ne.to),xe=Ue(me.conversionsTo,Je=>Je.from===ne.from);if(!xe)throw new Error("Attempt to remove nonexistent conversion from "+ne.from+" to "+ne.to);if(xe.convert!==ne.convert)throw new Error("Conversion to remove does not match existing conversion");let _e=me.conversionsTo.indexOf(xe);me.conversionsTo.splice(_e,1)},h.resolve=function(ne,me){if(!O(ne))throw new TypeError(n);let xe=ne._typedFunctionData.signatures;for(let _e=0;_e{g();y();v();(function(e){"use strict";var t=Math.cosh||function(s){return Math.abs(s)<1e-9?1-s:(Math.exp(s)+Math.exp(-s))*.5},r=Math.sinh||function(s){return Math.abs(s)<1e-9?s:(Math.exp(s)-Math.exp(-s))*.5},n=function(s){var f=Math.PI/4;if(-f>s||s>f)return Math.cos(s)-1;var p=s*s;return p*(p*(p*(p*(p*(p*(p*(p/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},i=function(s,f){var p=Math.abs(s),h=Math.abs(f);return p<3e3&&h<3e3?Math.sqrt(p*p+h*h):(p0&&o();break;case"number":p.im=0,p.re=s;break;default:o()}return isNaN(p.re)||isNaN(p.im),p};function a(s,f){if(!(this instanceof a))return new a(s,f);var p=l(s,f);this.re=p.re,this.im=p.im}a.prototype={re:0,im:0,sign:function(){var s=this.abs();return new a(this.re/s,this.im/s)},add:function(s,f){var p=new a(s,f);return this.isInfinite()&&p.isInfinite()?a.NAN:this.isInfinite()||p.isInfinite()?a.INFINITY:new a(this.re+p.re,this.im+p.im)},sub:function(s,f){var p=new a(s,f);return this.isInfinite()&&p.isInfinite()?a.NAN:this.isInfinite()||p.isInfinite()?a.INFINITY:new a(this.re-p.re,this.im-p.im)},mul:function(s,f){var p=new a(s,f);return this.isInfinite()&&p.isZero()||this.isZero()&&p.isInfinite()?a.NAN:this.isInfinite()||p.isInfinite()?a.INFINITY:p.im===0&&this.im===0?new a(this.re*p.re,0):new a(this.re*p.re-this.im*p.im,this.re*p.im+this.im*p.re)},div:function(s,f){var p=new a(s,f);if(this.isZero()&&p.isZero()||this.isInfinite()&&p.isInfinite())return a.NAN;if(this.isInfinite()||p.isZero())return a.INFINITY;if(this.isZero()||p.isInfinite())return a.ZERO;s=this.re,f=this.im;var h=p.re,x=p.im,b,w;return x===0?new a(s/h,f/h):Math.abs(h)0)return new a(Math.pow(s,p.re),0);if(s===0)switch((p.re%4+4)%4){case 0:return new a(Math.pow(f,p.re),0);case 1:return new a(0,Math.pow(f,p.re));case 2:return new a(-Math.pow(f,p.re),0);case 3:return new a(0,-Math.pow(f,p.re))}}if(s===0&&f===0&&p.re>0&&p.im>=0)return a.ZERO;var h=Math.atan2(f,s),x=u(s,f);return s=Math.exp(p.re*x-p.im*h),f=p.im*x+p.re*h,new a(s*Math.cos(f),s*Math.sin(f))},sqrt:function(){var s=this.re,f=this.im,p=this.abs(),h,x;if(s>=0){if(f===0)return new a(Math.sqrt(s),0);h=.5*Math.sqrt(2*(p+s))}else h=Math.abs(f)/Math.sqrt(2*(p-s));return s<=0?x=.5*Math.sqrt(2*(p-s)):x=Math.abs(f)/Math.sqrt(2*(p+s)),new a(h,f<0?-x:x)},exp:function(){var s=Math.exp(this.re);return this.im,new a(s*Math.cos(this.im),s*Math.sin(this.im))},expm1:function(){var s=this.re,f=this.im;return new a(Math.expm1(s)*Math.cos(f)+n(f),Math.exp(s)*Math.sin(f))},log:function(){var s=this.re,f=this.im;return f===0&&s>0,new a(u(s,f),Math.atan2(f,s))},abs:function(){return i(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var s=this.re,f=this.im;return new a(Math.sin(s)*t(f),Math.cos(s)*r(f))},cos:function(){var s=this.re,f=this.im;return new a(Math.cos(s)*t(f),-Math.sin(s)*r(f))},tan:function(){var s=2*this.re,f=2*this.im,p=Math.cos(s)+t(f);return new a(Math.sin(s)/p,r(f)/p)},cot:function(){var s=2*this.re,f=2*this.im,p=Math.cos(s)-t(f);return new a(-Math.sin(s)/p,r(f)/p)},sec:function(){var s=this.re,f=this.im,p=.5*t(2*f)+.5*Math.cos(2*s);return new a(Math.cos(s)*t(f)/p,Math.sin(s)*r(f)/p)},csc:function(){var s=this.re,f=this.im,p=.5*t(2*f)-.5*Math.cos(2*s);return new a(Math.sin(s)*t(f)/p,-Math.cos(s)*r(f)/p)},asin:function(){var s=this.re,f=this.im,p=new a(f*f-s*s+1,-2*s*f).sqrt(),h=new a(p.re-f,p.im+s).log();return new a(h.im,-h.re)},acos:function(){var s=this.re,f=this.im,p=new a(f*f-s*s+1,-2*s*f).sqrt(),h=new a(p.re-f,p.im+s).log();return new a(Math.PI/2-h.im,h.re)},atan:function(){var s=this.re,f=this.im;if(s===0){if(f===1)return new a(0,1/0);if(f===-1)return new a(0,-1/0)}var p=s*s+(1-f)*(1-f),h=new a((1-f*f-s*s)/p,-2*s/p).log();return new a(-.5*h.im,.5*h.re)},acot:function(){var s=this.re,f=this.im;if(f===0)return new a(Math.atan2(1,s),0);var p=s*s+f*f;return p!==0?new a(s/p,-f/p).atan():new a(s!==0?s/0:0,f!==0?-f/0:0).atan()},asec:function(){var s=this.re,f=this.im;if(s===0&&f===0)return new a(0,1/0);var p=s*s+f*f;return p!==0?new a(s/p,-f/p).acos():new a(s!==0?s/0:0,f!==0?-f/0:0).acos()},acsc:function(){var s=this.re,f=this.im;if(s===0&&f===0)return new a(Math.PI/2,1/0);var p=s*s+f*f;return p!==0?new a(s/p,-f/p).asin():new a(s!==0?s/0:0,f!==0?-f/0:0).asin()},sinh:function(){var s=this.re,f=this.im;return new a(r(s)*Math.cos(f),t(s)*Math.sin(f))},cosh:function(){var s=this.re,f=this.im;return new a(t(s)*Math.cos(f),r(s)*Math.sin(f))},tanh:function(){var s=2*this.re,f=2*this.im,p=t(s)+Math.cos(f);return new a(r(s)/p,Math.sin(f)/p)},coth:function(){var s=2*this.re,f=2*this.im,p=t(s)-Math.cos(f);return new a(r(s)/p,-Math.sin(f)/p)},csch:function(){var s=this.re,f=this.im,p=Math.cos(2*f)-t(2*s);return new a(-2*r(s)*Math.cos(f)/p,2*t(s)*Math.sin(f)/p)},sech:function(){var s=this.re,f=this.im,p=Math.cos(2*f)+t(2*s);return new a(2*t(s)*Math.cos(f)/p,-2*r(s)*Math.sin(f)/p)},asinh:function(){var s=this.im;this.im=-this.re,this.re=s;var f=this.asin();return this.re=-this.im,this.im=s,s=f.re,f.re=-f.im,f.im=s,f},acosh:function(){var s=this.acos();if(s.im<=0){var f=s.re;s.re=-s.im,s.im=f}else{var f=s.im;s.im=-s.re,s.re=f}return s},atanh:function(){var s=this.re,f=this.im,p=s>1&&f===0,h=1-s,x=1+s,b=h*h+f*f,w=b!==0?new a((x*h-f*f)/b,(f*h+x*f)/b):new a(s!==-1?s/0:0,f!==0?f/0:0),A=w.re;return w.re=u(w.re,w.im)/2,w.im=Math.atan2(w.im,A)/2,p&&(w.im=-w.im),w},acoth:function(){var s=this.re,f=this.im;if(s===0&&f===0)return new a(0,Math.PI/2);var p=s*s+f*f;return p!==0?new a(s/p,-f/p).atanh():new a(s!==0?s/0:0,f!==0?-f/0:0).atanh()},acsch:function(){var s=this.re,f=this.im;if(f===0)return new a(s!==0?Math.log(s+Math.sqrt(s*s+1)):1/0,0);var p=s*s+f*f;return p!==0?new a(s/p,-f/p).asinh():new a(s!==0?s/0:0,f!==0?-f/0:0).asinh()},asech:function(){var s=this.re,f=this.im;if(this.isZero())return a.INFINITY;var p=s*s+f*f;return p!==0?new a(s/p,-f/p).acosh():new a(s!==0?s/0:0,f!==0?-f/0:0).acosh()},inverse:function(){if(this.isZero())return a.INFINITY;if(this.isInfinite())return a.ZERO;var s=this.re,f=this.im,p=s*s+f*f;return new a(s/p,-f/p)},conjugate:function(){return new a(this.re,-this.im)},neg:function(){return new a(-this.re,-this.im)},ceil:function(s){return s=Math.pow(10,s||0),new a(Math.ceil(this.re*s)/s,Math.ceil(this.im*s)/s)},floor:function(s){return s=Math.pow(10,s||0),new a(Math.floor(this.re*s)/s,Math.floor(this.im*s)/s)},round:function(s){return s=Math.pow(10,s||0),new a(Math.round(this.re*s)/s,Math.round(this.im*s)/s)},equals:function(s,f){var p=new a(s,f);return Math.abs(p.re-this.re)<=a.EPSILON&&Math.abs(p.im-this.im)<=a.EPSILON},clone:function(){return new a(this.re,this.im)},toString:function(){var s=this.re,f=this.im,p="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(s){g();y();v();uB.exports=function e(t,r){"use strict";var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,o=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=/^0x[0-9a-f]+$/i,l=/^0/,a=function(M){return e.insensitive&&(""+M).toLowerCase()||""+M},s=a(t).replace(i,"")||"",f=a(r).replace(i,"")||"",p=s.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=f.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),x=parseInt(s.match(u),16)||p.length!==1&&s.match(o)&&Date.parse(s),b=parseInt(f.match(u),16)||x&&f.match(o)&&Date.parse(f)||null,w,A;if(b){if(xb)return 1}for(var E=0,O=Math.max(p.length,h.length);EA)return 1}return 0}});var S6=vt((ert,E6)=>{"use strict";g();y();v();var IA=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},r=t.preserveFormatting,n=r===void 0?!1:r,i=t.escapeMapFn,o=i===void 0?bfe:i,u=String(e),l="",a=o(IA({},xfe),n?IA({},wfe):{}),s=Object.keys(a),f=function(){var h=!1;s.forEach(function(x,b){h||u.length>=x.length&&u.slice(0,x.length)===x&&(l+=a[s[b]],u=u.slice(x.length,u.length),h=!0)}),h||(l+=u.slice(0,1),u=u.slice(1,u.length))};u;)f();return l}});var Xq=vt((Zq,qA)=>{g();y();v();(function(e,t,r){function n(l){var a=this,s=u();a.next=function(){var f=2091639*a.s0+a.c*23283064365386963e-26;return a.s0=a.s1,a.s1=a.s2,a.s2=f-(a.c=f|0)},a.c=1,a.s0=s(" "),a.s1=s(" "),a.s2=s(" "),a.s0-=s(l),a.s0<0&&(a.s0+=1),a.s1-=s(l),a.s1<0&&(a.s1+=1),a.s2-=s(l),a.s2<0&&(a.s2+=1),s=null}function i(l,a){return a.c=l.c,a.s0=l.s0,a.s1=l.s1,a.s2=l.s2,a}function o(l,a){var s=new n(l),f=a&&a.state,p=s.next;return p.int32=function(){return s.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,f&&(typeof f=="object"&&i(f,s),p.state=function(){return i(s,{})}),p}function u(){var l=4022871197,a=function(s){s=String(s);for(var f=0;f>>0,p-=l,p*=l,l=p>>>0,p-=l,l+=p*4294967296}return(l>>>0)*23283064365386963e-26};return a}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(Zq,typeof qA=="object"&&qA,typeof define=="function"&&define)});var Jq=vt((Kq,zA)=>{g();y();v();(function(e,t,r){function n(u){var l=this,a="";l.x=0,l.y=0,l.z=0,l.w=0,l.next=function(){var f=l.x^l.x<<11;return l.x=l.y,l.y=l.z,l.z=l.w,l.w^=l.w>>>19^f^f>>>8},u===(u|0)?l.x=u:a+=u;for(var s=0;s>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,x=(p+h)/(1<<21);while(x===0);return x},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(Kq,typeof zA=="object"&&zA,typeof define=="function"&&define)});var jq=vt((Qq,UA)=>{g();y();v();(function(e,t,r){function n(u){var l=this,a="";l.next=function(){var f=l.x^l.x>>>2;return l.x=l.y,l.y=l.z,l.z=l.w,l.w=l.v,(l.d=l.d+362437|0)+(l.v=l.v^l.v<<4^(f^f<<1))|0},l.x=0,l.y=0,l.z=0,l.w=0,l.v=0,u===(u|0)?l.x=u:a+=u;for(var s=0;s>>4),l.next()}function i(u,l){return l.x=u.x,l.y=u.y,l.z=u.z,l.w=u.w,l.v=u.v,l.d=u.d,l}function o(u,l){var a=new n(u),s=l&&l.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,x=(p+h)/(1<<21);while(x===0);return x},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(Qq,typeof UA=="object"&&UA,typeof define=="function"&&define)});var tz=vt((ez,HA)=>{g();y();v();(function(e,t,r){function n(u){var l=this;l.next=function(){var s=l.x,f=l.i,p,h,x;return p=s[f],p^=p>>>7,h=p^p<<24,p=s[f+1&7],h^=p^p>>>10,p=s[f+3&7],h^=p^p>>>3,p=s[f+4&7],h^=p^p<<7,p=s[f+7&7],p=p^p<<13,h^=p^p<<9,s[f]=h,l.i=f+1&7,h};function a(s,f){var p,h,x=[];if(f===(f|0))h=x[0]=f;else for(f=""+f,p=0;p0;--p)s.next()}a(l,u)}function i(u,l){return l.x=u.x.slice(),l.i=u.i,l}function o(u,l){u==null&&(u=+new Date);var a=new n(u),s=l&&l.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,x=(p+h)/(1<<21);while(x===0);return x},f.int32=a.next,f.quick=f,s&&(s.x&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(ez,typeof HA=="object"&&HA,typeof define=="function"&&define)});var nz=vt((rz,$A)=>{g();y();v();(function(e,t,r){function n(u){var l=this;l.next=function(){var s=l.w,f=l.X,p=l.i,h,x;return l.w=s=s+1640531527|0,x=f[p+34&127],h=f[p=p+1&127],x^=x<<13,h^=h<<17,x^=x>>>15,h^=h>>>12,x=f[p]=x^h,l.i=p,x+(s^s>>>16)|0};function a(s,f){var p,h,x,b,w,A=[],E=128;for(f===(f|0)?(h=f,f=null):(f=f+"\0",h=0,E=Math.max(E,f.length)),x=0,b=-32;b>>15,h^=h<<4,h^=h>>>13,b>=0&&(w=w+1640531527|0,p=A[b&127]^=h+w,x=p==0?x+1:0);for(x>=128&&(A[(f&&f.length||0)&127]=-1),x=127,b=4*128;b>0;--b)h=A[x+34&127],p=A[x=x+1&127],h^=h<<13,p^=p<<17,h^=h>>>15,p^=p>>>12,A[x]=h^p;s.w=w,s.X=A,s.i=x}a(l,u)}function i(u,l){return l.i=u.i,l.w=u.w,l.X=u.X.slice(),l}function o(u,l){u==null&&(u=+new Date);var a=new n(u),s=l&&l.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,x=(p+h)/(1<<21);while(x===0);return x},f.int32=a.next,f.quick=f,s&&(s.X&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(rz,typeof $A=="object"&&$A,typeof define=="function"&&define)});var oz=vt((iz,WA)=>{g();y();v();(function(e,t,r){function n(u){var l=this,a="";l.next=function(){var f=l.b,p=l.c,h=l.d,x=l.a;return f=f<<25^f>>>7^p,p=p-h|0,h=h<<24^h>>>8^x,x=x-f|0,l.b=f=f<<20^f>>>12^p,l.c=p=p-h|0,l.d=h<<16^p>>>16^x,l.a=x-f|0},l.a=0,l.b=0,l.c=-1640531527,l.d=1367130551,u===Math.floor(u)?(l.a=u/4294967296|0,l.b=u|0):a+=u;for(var s=0;s>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,x=(p+h)/(1<<21);while(x===0);return x},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(iz,typeof WA=="object"&&WA,typeof define=="function"&&define)});var az={};qa(az,{default:()=>Rce});var Rce,sz=Te(()=>{g();y();v();Rce={}});var lz=vt((uz,eb)=>{g();y();v();(function(e,t,r){var n=256,i=6,o=52,u="random",l=r.pow(n,i),a=r.pow(2,o),s=a*2,f=n-1,p;function h(M,I,F){var C=[];I=I==!0?{entropy:!0}:I||{};var P=A(w(I.entropy?[M,O(t)]:M??E(),3),C),R=new x(C),q=function(){for(var U=R.g(i),H=l,V=0;U=s;)U/=2,H/=2,V>>>=1;return(U+V)/H};return q.int32=function(){return R.g(4)|0},q.quick=function(){return R.g(4)/4294967296},q.double=q,A(O(R.S),t),(I.pass||F||function(U,H,V,W){return W&&(W.S&&b(W,R),U.state=function(){return b(R,{})}),V?(r[u]=U,H):U})(q,P,"global"in I?I.global:this==r,I.state)}function x(M){var I,F=M.length,C=this,P=0,R=C.i=C.j=0,q=C.S=[];for(F||(M=[F++]);P{g();y();v();var qce=Xq(),zce=Jq(),Uce=jq(),Hce=tz(),$ce=nz(),Wce=oz(),bp=lz();bp.alea=qce;bp.xor128=zce;bp.xorwow=Uce;bp.xorshift7=Hce;bp.xor4096=$ce;bp.tychei=Wce;fz.exports=bp});var qH=vt((i9t,JA)=>{g();y();v();function KA(){}KA.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){var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;for(n;n{g();y();v();(function(e,t){typeof QA=="object"?WH.exports=t():typeof define=="function"&&define.amd?define(t):e.jStat=t()})(QA,function(){var e=function(t,r){var n=Array.prototype.concat,i=Array.prototype.slice,o=Object.prototype.toString;function u(A,E){var O=A>E?A:E;return t.pow(10,17-~~(t.log(O>0?O:-O)*t.LOG10E))}var l=Array.isArray||function(E){return o.call(E)==="[object Array]"};function a(A){return o.call(A)==="[object Function]"}function s(A){return typeof A=="number"?A-A===0:!1}function f(A){return n.apply([],A)}function p(){return new p._init(arguments)}p.fn=p.prototype,p._init=function(E){if(l(E[0]))if(l(E[0][0])){a(E[1])&&(E[0]=p.map(E[0],E[1]));for(var O=0;O=0;O--,I++)M[I]=[E[I][O]];return M},p.transpose=function(E){var O=[],M,I,F,C,P;for(l(E[0])||(E=[E]),I=E.length,F=E[0].length,P=0;P0&&(P[I][0]=E[I][0]),R=1;RO&&M>0)return[];if(M>0)for(F=E;FO;F+=M)I.push(F);return I},p.slice=function(){function A(O,M,I,F){var C,P=[],R=O.length;if(M===r&&I===r&&F===r)return p.copy(O);if(M=M||0,I=I||O.length,M=M>=0?M:R+M,I=I>=0?I:R+I,F=F||1,M===I||F===0)return[];if(MI&&F>0)return[];if(F>0)for(C=M;CI;C+=F)P.push(O[C]);return P}function E(O,M){var I,F;if(M=M||{},s(M.row)){if(s(M.col))return O[M.row][M.col];var C=p.rowa(O,M.row);return I=M.col||{},A(C,I.start,I.end,I.step)}if(s(M.col)){var P=p.cola(O,M.col);return F=M.row||{},A(P,F.start,F.end,F.step)}F=M.row||{},I=M.col||{};var R=A(O,F.start,F.end,F.step);return R.map(function(q){return A(q,I.start,I.end,I.step)})}return E}(),p.sliceAssign=function(E,O,M){var I,F;if(s(O.row)){if(s(O.col))return E[O.row][O.col]=M;O.col=O.col||{},O.col.start=O.col.start||0,O.col.end=O.col.end||E[0].length,O.col.step=O.col.step||1,I=p.arange(O.col.start,t.min(E.length,O.col.end),O.col.step);var C=O.row;return I.forEach(function(R,q){E[C][R]=M[q]}),E}if(s(O.col)){O.row=O.row||{},O.row.start=O.row.start||0,O.row.end=O.row.end||E.length,O.row.step=O.row.step||1,F=p.arange(O.row.start,t.min(E[0].length,O.row.end),O.row.step);var P=O.col;return F.forEach(function(R,q){E[R][P]=M[q]}),E}return M[0].length===r&&(M=[M]),O.row.start=O.row.start||0,O.row.end=O.row.end||E.length,O.row.step=O.row.step||1,O.col.start=O.col.start||0,O.col.end=O.col.end||E[0].length,O.col.step=O.col.step||1,F=p.arange(O.row.start,t.min(E.length,O.row.end),O.row.step),I=p.arange(O.col.start,t.min(E[0].length,O.col.end),O.col.step),F.forEach(function(R,q){I.forEach(function(U,H){E[R][U]=M[q][H]})}),E},p.diagonal=function(E){var O=p.zeros(E.length,E.length);return E.forEach(function(M,I){O[I][I]=M}),O},p.copy=function(E){return E.map(function(O){return s(O)?O:O.map(function(M){return M})})};var w=p.prototype;return w.length=0,w.push=Array.prototype.push,w.sort=Array.prototype.sort,w.splice=Array.prototype.splice,w.slice=Array.prototype.slice,w.toArray=function(){return this.length>1?i.call(this):i.call(this)[0]},w.map=function(E,O){return p(p.map(this,E,O))},w.cumreduce=function(E,O){return p(p.cumreduce(this,E,O))},w.alter=function(E){return p.alter(this,E),this},function(A){for(var E=0;E=0;)s+=a[f];return s},t.sumsqrd=function(a){for(var s=0,f=a.length;--f>=0;)s+=a[f]*a[f];return s},t.sumsqerr=function(a){for(var s=t.mean(a),f=0,p=a.length,h;--p>=0;)h=a[p]-s,f+=h*h;return f},t.sumrow=function(a){for(var s=0,f=a.length;--f>=0;)s+=a[f];return s},t.product=function(a){for(var s=1,f=a.length;--f>=0;)s*=a[f];return s},t.min=function(a){for(var s=a[0],f=0;++fs&&(s=a[f]);return s},t.unique=function(a){for(var s={},f=[],p=0;ph?(b=[f[w]],h=p,x=0):p===h&&(b.push(f[w]),x++),p=1);return x===0?b[0]:b},t.range=function(a){return t.max(a)-t.min(a)},t.variance=function(a,s){return t.sumsqerr(a)/(a.length-(s?1:0))},t.pooledvariance=function(a){var s=a.reduce(function(p,h){return p+t.sumsqerr(h)},0),f=a.reduce(function(p,h){return p+h.length},0);return s/(f-a.length)},t.deviation=function(l){for(var a=t.mean(l),s=l.length,f=new Array(s),p=0;p=0;p--)f.push(r.abs(a[p]-s));return t.mean(f)},t.meddev=function(a){for(var s=t.median(a),f=[],p=a.length-1;p>=0;p--)f.push(r.abs(a[p]-s));return t.median(f)},t.coeffvar=function(a){return t.stdev(a)/t.mean(a)},t.quartiles=function(a){var s=a.length,f=a.slice().sort(i);return[f[r.round(s/4)-1],f[r.round(s/2)-1],f[r.round(s*3/4)-1]]},t.quantiles=function(a,s,f,p){var h=a.slice().sort(i),x=[s.length],b=a.length,w,A,E,O,M,I;for(typeof f>"u"&&(f=3/8),typeof p>"u"&&(p=3/8),w=0;w1){for(b=f===!0?this:this.transpose();x1){for(s!=="sumrow"&&(b=f===!0?this:this.transpose());x1){for(h=h.transpose();p=0;f--)s*=u,s+=h[f];if(a=s/o+.5*r.log(l)+(o-.5)*r.log(o)-o,i<=7)for(f=1;f<=p;f++)a-=r.log(o-1),o-=1;return a},t.gammafn=function(i){var o=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],u=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],l=!1,a=0,s=0,f=0,p=i,h,x,b,w;if(i>171.6243769536076)return 1/0;if(p<=0)if(w=p%1+36e-17,w)l=(p&1?-1:1)*r.PI/r.sin(r.PI*w),p=1-p;else return 1/0;for(b=p,p<1?x=p++:x=(p-=a=(p|0)-1)-1,h=0;h<8;++h)f=(f+o[h])*x,s=s*x+u[h];if(w=f/s+1,bp)for(h=0;h=1?i:1/i)*8.5+i*.4+17),A;if(o<0||i<=0)return NaN;if(o170||o>170?r.exp(t.combinationln(i,o)):t.factorial(i)/t.factorial(o)/t.factorial(i-o)},t.combinationln=function(i,o){return t.factorialln(i)-t.factorialln(o)-t.factorialln(i-o)},t.permutation=function(i,o){return t.factorial(i)/t.factorial(i-o)},t.betafn=function(i,o){if(!(i<=0||o<=0))return i+o>170?r.exp(t.betaln(i,o)):t.gammafn(i)*t.gammafn(o)/t.gammafn(i+o)},t.betaln=function(i,o){return t.gammaln(i)+t.gammaln(o)-t.gammaln(i+o)},t.betacf=function(i,o,u){var l=1e-30,a=1,s=o+u,f=o+1,p=o-1,h=1,x=1-s*i/f,b,w,A,E;for(r.abs(x)=1)return r.max(100,o+100*r.sqrt(o));if(i<=0)return 0;for(o>1?(w=r.log(l),A=r.exp(l*(w-1)-s),b=i<.5?i:1-i,h=r.sqrt(-2*r.log(b)),f=(2.30753+h*.27061)/(1+h*(.99229+h*.04481))-h,i<.5&&(f=-f),f=r.max(.001,o*r.pow(1-1/(9*o)-f/(3*r.sqrt(o)),3))):(h=1-o*(.253+o*.12),i1?h=A*r.exp(-(f-l)+l*(r.log(f)-w)):h=r.exp(-f+l*r.log(f)-s),x=p/h,f-=h=x/(1-.5*r.min(1,x*((o-1)/f-1))),f<=0&&(f=.5*(f+h)),r.abs(h)0;u--)h=a,a=p*a-s+o[u],s=h;return x=f*r.exp(-i*i+.5*(o[0]+p*a)-s),l?x-1:1-x},t.erfc=function(i){return 1-t.erf(i)},t.erfcinv=function(i){var o=0,u,l,a,s;if(i>=2)return-100;if(i<=0)return 100;for(s=i<1?i:2-i,a=r.sqrt(-2*r.log(s/2)),u=-.70711*((2.30753+a*.27061)/(1+a*(.99229+a*.04481))-a);o<2;o++)l=t.erfc(u)-s,u+=l/(1.1283791670955126*r.exp(-u*u)-u*l);return i<1?u:-u},t.ibetainv=function(i,o,u){var l=1e-8,a=o-1,s=u-1,f=0,p,h,x,b,w,A,E,O,M,I,F;if(i<=0)return 0;if(i>=1)return 1;for(o>=1&&u>=1?(x=i<.5?i:1-i,b=r.sqrt(-2*r.log(x)),E=(2.30753+b*.27061)/(1+b*(.99229+b*.04481))-b,i<.5&&(E=-E),O=(E*E-3)/6,M=2/(1/(2*o-1)+1/(2*u-1)),I=E*r.sqrt(O+M)/M-(1/(2*u-1)-1/(2*o-1))*(O+5/6-2/(3*M)),E=o/(o+u*r.exp(2*I))):(p=r.log(o/(o+u)),h=r.log(u/(o+u)),b=r.exp(o*p)/o,w=r.exp(u*h)/u,I=b+w,i=1&&(E=.5*(E+b+1)),r.abs(b)0)break}return E},t.ibeta=function(i,o,u){var l=i===0||i===1?0:r.exp(t.gammaln(o+u)-t.gammaln(o)-t.gammaln(u)+o*r.log(i)+u*r.log(1-i));return i<0||i>1?!1:i<(o+1)/(o+u+2)?l*t.betacf(i,o,u)/o:1-l*t.betacf(1-i,u,o)/u},t.randn=function(i,o){var u,l,a,s,f;if(o||(o=i),i)return t.create(i,o,function(){return t.randn()});do u=t._random_fn(),l=1.7156*(t._random_fn()-.5),a=u-.449871,s=r.abs(l)+.386595,f=a*a+s*(.196*s-.25472*a);while(f>.27597&&(f>.27846||l*l>-4*r.log(u)*u*u));return l/u},t.randg=function(i,o,u){var l=i,a,s,f,p,h,x;if(u||(u=o),i||(i=1),o)return x=t.zeros(o,u),x.alter(function(){return t.randg(i)}),x;i<1&&(i+=1),a=i-1/3,s=1/r.sqrt(9*a);do{do h=t.randn(),p=1+s*h;while(p<=0);p=p*p*p,f=t._random_fn()}while(f>1-.331*r.pow(h,4)&&r.log(f)>.5*h*h+a*(1-p+r.log(p)));if(i==l)return a*p;do f=t._random_fn();while(f===0);return r.pow(f,1/l)*a*p},function(n){for(var i=0;i1||a<0?0:s==1&&f==1?1:s<512&&f<512?r.pow(a,s-1)*r.pow(1-a,f-1)/t.betafn(s,f):r.exp((s-1)*r.log(a)+(f-1)*r.log(1-a)-t.betaln(s,f))},cdf:function(a,s,f){return a>1||a<0?(a>1)*1:t.ibeta(a,s,f)},inv:function(a,s,f){return t.ibetainv(a,s,f)},mean:function(a,s){return a/(a+s)},median:function(a,s){return t.ibetainv(.5,a,s)},mode:function(a,s){return(a-1)/(a+s-2)},sample:function(a,s){var f=t.randg(a);return f/(f+t.randg(s))},variance:function(a,s){return a*s/(r.pow(a+s,2)*(a+s+1))}}),t.extend(t.centralF,{pdf:function(a,s,f){var p,h,x;return a<0?0:s<=2?a===0&&s<2?1/0:a===0&&s===2?1:1/t.betafn(s/2,f/2)*r.pow(s/f,s/2)*r.pow(a,s/2-1)*r.pow(1+s/f*a,-(s+f)/2):(p=s*a/(f+a*s),h=f/(f+a*s),x=s*h/2,x*t.binomial.pdf((s-2)/2,(s+f-2)/2,p))},cdf:function(a,s,f){return a<0?0:t.ibeta(s*a/(s*a+f),s/2,f/2)},inv:function(a,s,f){return f/(s*(1/t.ibetainv(a,s/2,f/2)-1))},mean:function(a,s){return s>2?s/(s-2):void 0},mode:function(a,s){return a>2?s*(a-2)/(a*(s+2)):void 0},sample:function(a,s){var f=t.randg(a/2)*2,p=t.randg(s/2)*2;return f/a/(p/s)},variance:function(a,s){if(!(s<=4))return 2*s*s*(a+s-2)/(a*(s-2)*(s-2)*(s-4))}}),t.extend(t.cauchy,{pdf:function(a,s,f){return f<0?0:f/(r.pow(a-s,2)+r.pow(f,2))/r.PI},cdf:function(a,s,f){return r.atan((a-s)/f)/r.PI+.5},inv:function(l,a,s){return a+s*r.tan(r.PI*(l-.5))},median:function(a){return a},mode:function(a){return a},sample:function(a,s){return t.randn()*r.sqrt(1/(2*t.randg(.5)))*s+a}}),t.extend(t.chisquare,{pdf:function(a,s){return a<0?0:a===0&&s===2?.5:r.exp((s/2-1)*r.log(a)-a/2-s/2*r.log(2)-t.gammaln(s/2))},cdf:function(a,s){return a<0?0:t.lowRegGamma(s/2,a/2)},inv:function(l,a){return 2*t.gammapinv(l,.5*a)},mean:function(l){return l},median:function(a){return a*r.pow(1-2/(9*a),3)},mode:function(a){return a-2>0?a-2:0},sample:function(a){return t.randg(a/2)*2},variance:function(a){return 2*a}}),t.extend(t.exponential,{pdf:function(a,s){return a<0?0:s*r.exp(-s*a)},cdf:function(a,s){return a<0?0:1-r.exp(-s*a)},inv:function(l,a){return-r.log(1-l)/a},mean:function(l){return 1/l},median:function(l){return 1/l*r.log(2)},mode:function(){return 0},sample:function(a){return-1/a*r.log(t._random_fn())},variance:function(l){return r.pow(l,-2)}}),t.extend(t.gamma,{pdf:function(a,s,f){return a<0?0:a===0&&s===1?1/f:r.exp((s-1)*r.log(a)-a/f-t.gammaln(s)-s*r.log(f))},cdf:function(a,s,f){return a<0?0:t.lowRegGamma(s,a/f)},inv:function(l,a,s){return t.gammapinv(l,a)*s},mean:function(l,a){return l*a},mode:function(a,s){if(a>1)return(a-1)*s},sample:function(a,s){return t.randg(a)*s},variance:function(a,s){return a*s*s}}),t.extend(t.invgamma,{pdf:function(a,s,f){return a<=0?0:r.exp(-(s+1)*r.log(a)-f/a-t.gammaln(s)+s*r.log(f))},cdf:function(a,s,f){return a<=0?0:1-t.lowRegGamma(s,f/a)},inv:function(l,a,s){return s/t.gammapinv(1-l,a)},mean:function(l,a){return l>1?a/(l-1):void 0},mode:function(a,s){return s/(a+1)},sample:function(a,s){return s/t.randg(a)},variance:function(a,s){if(!(a<=2))return s*s/((a-1)*(a-1)*(a-2))}}),t.extend(t.kumaraswamy,{pdf:function(a,s,f){return a===0&&s===1?f:a===1&&f===1?s:r.exp(r.log(s)+r.log(f)+(s-1)*r.log(a)+(f-1)*r.log(1-r.pow(a,s)))},cdf:function(a,s,f){return a<0?0:a>1?1:1-r.pow(1-r.pow(a,s),f)},inv:function(a,s,f){return r.pow(1-r.pow(1-a,1/f),1/s)},mean:function(l,a){return a*t.gammafn(1+1/l)*t.gammafn(a)/t.gammafn(1+1/l+a)},median:function(a,s){return r.pow(1-r.pow(2,-1/s),1/a)},mode:function(a,s){if(a>=1&&s>=1&&a!==1&&s!==1)return r.pow((a-1)/(a*s-1),1/a)},variance:function(){throw new Error("variance not yet implemented")}}),t.extend(t.lognormal,{pdf:function(a,s,f){return a<=0?0:r.exp(-r.log(a)-.5*r.log(2*r.PI)-r.log(f)-r.pow(r.log(a)-s,2)/(2*f*f))},cdf:function(a,s,f){return a<0?0:.5+.5*t.erf((r.log(a)-s)/r.sqrt(2*f*f))},inv:function(l,a,s){return r.exp(-1.4142135623730951*s*t.erfcinv(2*l)+a)},mean:function(a,s){return r.exp(a+s*s/2)},median:function(a){return r.exp(a)},mode:function(a,s){return r.exp(a-s*s)},sample:function(a,s){return r.exp(t.randn()*s+a)},variance:function(a,s){return(r.exp(s*s)-1)*r.exp(2*a+s*s)}}),t.extend(t.noncentralt,{pdf:function(a,s,f){var p=1e-14;return r.abs(f)p||w>p;)A=w,O>0&&(M*=f*f/(2*O),I*=f*f/(2*(O+1/2))),w=M*t.beta.cdf(E,O+.5,s/2)+I*t.beta.cdf(E,O+1,s/2),b+=.5*w,O++;return x?1-b:b}}),t.extend(t.normal,{pdf:function(a,s,f){return r.exp(-.5*r.log(2*r.PI)-r.log(f)-r.pow(a-s,2)/(2*f*f))},cdf:function(a,s,f){return .5*(1+t.erf((a-s)/r.sqrt(2*f*f)))},inv:function(l,a,s){return-1.4142135623730951*s*t.erfcinv(2*l)+a},mean:function(l){return l},median:function(a){return a},mode:function(l){return l},sample:function(a,s){return t.randn()*s+a},variance:function(l,a){return a*a}}),t.extend(t.pareto,{pdf:function(a,s,f){return a1e100?1e100:s,1/(r.sqrt(s)*t.betafn(.5,s/2))*r.pow(1+a*a/s,-((s+1)/2))},cdf:function(a,s){var f=s/2;return t.ibeta((a+r.sqrt(a*a+s))/(2*r.sqrt(a*a+s)),f,f)},inv:function(l,a){var s=t.ibetainv(2*r.min(l,1-l),.5*a,.5);return s=r.sqrt(a*(1-s)/s),l>.5?s:-s},mean:function(a){return a>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(a){return t.randn()*r.sqrt(a/(2*t.randg(a/2)))},variance:function(a){return a>2?a/(a-2):a>1?1/0:void 0}}),t.extend(t.weibull,{pdf:function(a,s,f){return a<0||s<0||f<0?0:f/s*r.pow(a/s,f-1)*r.exp(-r.pow(a/s,f))},cdf:function(a,s,f){return a<0?0:1-r.exp(-r.pow(a/s,f))},inv:function(l,a,s){return a*r.pow(-r.log(1-l),1/s)},mean:function(l,a){return l*t.gammafn(1+1/a)},median:function(a,s){return a*r.pow(r.log(2),1/s)},mode:function(a,s){return s<=1?0:a*r.pow((s-1)/s,1/s)},sample:function(a,s){return a*r.pow(-r.log(t._random_fn()),1/s)},variance:function(a,s){return a*a*t.gammafn(1+2/s)-r.pow(t.weibull.mean(a,s),2)}}),t.extend(t.uniform,{pdf:function(a,s,f){return af?0:1/(f-s)},cdf:function(a,s,f){return af;)A=x,E=-(a+w)*(a+s+w)*l/(a+2*w)/(a+2*w+1),p=x+E*p,h=b+E*h,w=w+1,E=w*(s-w)*l/(a+2*w-1)/(a+2*w),x=p+E*x,b=h+E*b,p=p/b,h=h/b,x=x/b,b=1;return x/a}t.extend(t.binomial,{pdf:function(a,s,f){return f===0||f===1?s*f===a?1:0:t.combination(s,a)*r.pow(f,a)*r.pow(1-f,s-a)},cdf:function(a,s,f){var p,h=1e-10;if(a<0)return 0;if(a>=s)return 1;if(f<0||f>1||s<=0)return NaN;a=r.floor(a);var x=f,b=a+1,w=s-a,A=b+w,E=r.exp(t.gammaln(A)-t.gammaln(w)-t.gammaln(b)+b*r.log(x)+w*r.log(1-x));return x<(b+1)/(A+2)?p=E*n(x,b,w,h):p=1-E*n(1-x,w,b,h),r.round((1-p)*(1/h))/(1/h)}}),t.extend(t.negbin,{pdf:function(a,s,f){return a!==a>>>0?!1:a<0?0:t.combination(a+s-1,s-1)*r.pow(1-f,a)*r.pow(f,s)},cdf:function(a,s,f){var p=0,h=0;if(a<0)return 0;for(;h<=a;h++)p+=t.negbin.pdf(h,s,f);return p}}),t.extend(t.hypgeom,{pdf:function(a,s,f,p){if(a!==a|0)return!1;if(a<0||ap||a>f)return 0;if(f*2>s)return p*2>s?t.hypgeom.pdf(s-f-p+a,s,s-f,s-p):t.hypgeom.pdf(p-a,s,s-f,p);if(p*2>s)return t.hypgeom.pdf(f-a,s,f,s-p);if(f1&&x=p||a>=f)return 1;if(f*2>s)return p*2>s?t.hypgeom.cdf(s-f-p+a,s,s-f,s-p):1-t.hypgeom.cdf(p-a-1,s,s-f,p);if(p*2>s)return 1-t.hypgeom.cdf(f-a-1,s,f,s-p);if(f1&&bp);return f-1},sampleLarge:function(a){var s=a,f,p,h,x,b,w,A,E,O,M;for(x=r.sqrt(s),b=r.log(s),A=.931+2.53*x,w=-.059+.02483*A,E=1.1239+1.1328/(A-3.4),O=.9277-3.6224/(A-2);;){if(p=r.random()-.5,h=r.random(),M=.5-r.abs(p),f=r.floor((2*w/M+A)*p+s+.43),M>=.07&&h<=O)return f;if(!(f<0||M<.013&&h>M)&&r.log(h)+r.log(E)-r.log(w/(M*M)+A)<=-s+f*b-t.loggam(f+1))return f}},sample:function(a){return a<10?this.sampleSmall(a):this.sampleLarge(a)}}),t.extend(t.triangular,{pdf:function(a,s,f,p){return f<=s||pf?NaN:af?0:af?NaN:a<=s?0:a>=f?1:a<=p?r.pow(a-s,2)/((f-s)*(p-s)):1-r.pow(f-a,2)/((f-s)*(f-p))},inv:function(a,s,f,p){return f<=s||pf?NaN:a<=(p-s)/(f-s)?s+(f-s)*r.sqrt(a*((p-s)/(f-s))):s+(f-s)*(1-r.sqrt((1-a)*(1-(p-s)/(f-s))))},mean:function(a,s,f){return(a+s+f)/3},median:function(a,s,f){if(f<=(a+s)/2)return s-r.sqrt((s-a)*(s-f))/r.sqrt(2);if(f>(a+s)/2)return a+r.sqrt((s-a)*(f-a))/r.sqrt(2)},mode:function(a,s,f){return f},sample:function(a,s,f){var p=t._random_fn();return p<(f-a)/(s-a)?a+r.sqrt(p*(s-a)*(f-a)):s-r.sqrt((1-p)*(s-a)*(s-f))},variance:function(a,s,f){return(a*a+s*s+f*f-a*s-a*f-s*f)/18}}),t.extend(t.arcsine,{pdf:function(a,s,f){return f<=s?NaN:a<=s||a>=f?0:2/r.PI*r.pow(r.pow(f-s,2)-r.pow(2*a-s-f,2),-.5)},cdf:function(a,s,f){return a=w)return 1;var C=2*t.normal.cdf(F,0,1,1,0)-1;C>=r.exp(x/s)?C=r.pow(C,s):C=0;var P;l>A?P=E:P=O;for(var R=F,q=(w-F)/P,U=R+q,H=0,V=s-1,W=1;W<=P;W++){for(var ee=0,ie=.5*(U+R),Y=.5*(U-R),Z=1;Z<=f;Z++){var le,re;pb)break;var ce=2*t.normal.cdf(De,0,1,1,0),Ee=2*t.normal.cdf(De,l,1,1,0),Pe=ce*.5-Ee*.5;Pe>=r.exp(h/V)&&(Pe=I[le-1]*r.exp(-(.5*we))*r.pow(Pe,V),ee+=Pe)}ee*=2*Y*s/r.sqrt(2*r.PI),H+=ee,R=U,U+=q}return C+=H,C<=r.exp(h/a)?0:(C=r.pow(C,a),C>=1?1:C)}function u(l,a,s){var f=.322232421088,p=.099348462606,h=-1,x=.588581570495,b=-.342242088547,w=.531103462366,A=-.204231210125,E=.10353775285,O=-453642210148e-16,M=.0038560700634,I=.8832,F=.2368,C=1.214,P=1.208,R=1.4142,q=120,U=.5-.5*l,H=r.sqrt(r.log(1/(U*U))),V=H+((((H*O+A)*H+b)*H+h)*H+f)/((((H*M+E)*H+w)*H+x)*H+p);sI)return o(a,p,h);var H=f*.5,V=H*r.log(f)-f*r.log(2)-t.gammaln(H),W=H-1,ee=f*.25,ie;f<=E?ie=F:f<=O?ie=C:f<=M?ie=P:ie=R,V+=r.log(ie);for(var Y=0,Z=1;Z<=50;Z++){for(var le=0,re=(2*Z-1)*ie,he=1;he<=x;he++){var De,we;b=w){b=1&&le<=A)break;Y+=le}if(le>A)throw new Error("tukey.cdf failed to converge");return Y>1&&(Y=1),Y},inv:function(l,a,s){var f=1,p=a,h=1e-4,x=50;if(s<2||f<1||p<2)return NaN;if(l<0||l>1)return NaN;if(l===0)return 0;if(l===1)return 1/0;var b=u(l,p,s),w=t.tukey.cdf(b,a,s)-l,A;w>0?A=r.max(0,b-1):A=b+1;for(var E=t.tukey.cdf(A,a,s)-l,O,M=1;Ms&&(f[p-1][h-1]=l[p][h])}var x=s%2?-1:1;a+=u(f)*l[0][s]*x}return a},gauss_elimination:function(l,a){var s=0,f=0,p=l.length,h=l[0].length,x=1,b=0,w=[],A,E,O,M;for(l=t.aug(l,a),A=l[0].length,s=0;s=0;s--){for(b=0,f=s+1;f<=p-1;f++)b=b+w[f]*l[s][f];w[s]=(l[s][A-1]-b)/l[s][s]}return w},gauss_jordan:function(l,a){var s=t.aug(l,a),f=s.length,p=s[0].length,h=0,x,b,w;for(b=0;br.abs(s[A][b])&&(A=w);var E=s[b];for(s[b]=s[A],s[A]=E,w=b+1;w=0;b--){for(h=s[b][b],w=0;wb-1;x--)s[w][x]-=s[b][x]*s[w][b]/h;for(s[b][b]/=h,x=f;xh?(b[p][h]=l[p][h],w[p][h]=A[p][h]=0):pf;)E=I,I=t.add(t.multiply(M,E),O),p++;return I},gauss_seidel:function(l,a,s,f){for(var p=0,h=l.length,x=[],b=[],w=[],A,E,O,M,I;pA?(x[p][A]=l[p][A],b[p][A]=w[p][A]=0):pf;)E=I,I=t.add(t.multiply(M,E),O),p=p+1;return I},SOR:function(l,a,s,f,p){for(var h=0,x=l.length,b=[],w=[],A=[],E,O,M,I,F;hE?(b[h][E]=l[h][E],w[h][E]=A[h][E]=0):hf;)O=F,F=t.add(t.multiply(I,O),M),h++;return F},householder:function(l){for(var a=l.length,s=l[0].length,f=0,p=[],h=[],x,b,w,A,E;f0?-1:1,x=E*r.sqrt(x),b=r.sqrt((x*x-l[f+1][f]*x)/2),p=t.zeros(a,1),p[f+1][0]=(l[f+1][f]-x)/(2*b),w=f+2;w0?r.PI/4:-r.PI/4:O=r.atan(2*l[w][A]/(l[w][w]-l[A][A]))/2,M=t.identity(s,s),M[w][w]=r.cos(O),M[w][A]=-r.sin(O),M[A][w]=r.sin(O),M[A][A]=r.cos(O),f=t.multiply(f,M),h=t.multiply(t.multiply(t.inv(M),l),M),l=h,a=0,x=1;x.001&&(a=1)}for(x=0;x=h;)A=p(l,s+f),E=p(l,s),b[x]=(a[A]-2*a[E]+a[2*E-A])/(f*f),f/=2,x++;for(M=b.length,O=1;M!=1;){for(I=0;Is);h++);return h-=1,a[h]+(s-l[h])*O[h]+t.sq(s-l[h])*A[h]+(s-l[h])*t.sq(s-l[h])*M[h]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(l){var a=l.length,s=l[0].length,f=0,p,h,x=[],b=[],w=[],A=[],E=[],O=[],M=[],I=[],F=[],C=[];for(f=0;f2?(s=t.zscore(a[0],a[1],a[2]),a[3]===1?t.normal.cdf(-r.abs(s),0,1):t.normal.cdf(-r.abs(s),0,1)*2):(s=a[0],a[1]===1?t.normal.cdf(-r.abs(s),0,1):t.normal.cdf(-r.abs(s),0,1)*2)}}),t.extend(t.fn,{zscore:function(a,s){return(a-this.mean())/this.stdev(s)},ztest:function(a,s,f){var p=r.abs(this.zscore(a,f));return s===1?t.normal.cdf(-p,0,1):t.normal.cdf(-p,0,1)*2}}),t.extend({tscore:function(){var a=n.call(arguments);return a.length===4?(a[0]-a[1])/(a[2]/r.sqrt(a[3])):(a[0]-t.mean(a[1]))/(t.stdev(a[1],!0)/r.sqrt(a[1].length))},ttest:function(){var a=n.call(arguments),s;return a.length===5?(s=r.abs(t.tscore(a[0],a[1],a[2],a[3])),a[4]===1?t.studentt.cdf(-s,a[3]-1):t.studentt.cdf(-s,a[3]-1)*2):i(a[1])?(s=r.abs(a[0]),a[2]==1?t.studentt.cdf(-s,a[1]-1):t.studentt.cdf(-s,a[1]-1)*2):(s=r.abs(t.tscore(a[0],a[1])),a[2]==1?t.studentt.cdf(-s,a[1].length-1):t.studentt.cdf(-s,a[1].length-1)*2)}}),t.extend(t.fn,{tscore:function(a){return(a-this.mean())/(this.stdev(!0)/r.sqrt(this.cols()))},ttest:function(a,s){return s===1?1-t.studentt.cdf(r.abs(this.tscore(a)),this.cols()-1):t.studentt.cdf(-r.abs(this.tscore(a)),this.cols()-1)*2}}),t.extend({anovafscore:function(){var a=n.call(arguments),s,f,p,h,x,b,w,A;if(a.length===1){for(x=new Array(a[0].length),w=0;w1||s>1||l<=0||s<=0)throw new Error("Proportions should be greater than 0 and less than 1");var p=(l*a+s*f)/(a+f),h=r.sqrt(p*(1-p)*(1/a+1/f));return(l-s)/h}t.extend(t.fn,{oneSidedDifferenceOfProportions:function(a,s,f,p){var h=u(a,s,f,p);return t.ztest(h,1)},twoSidedDifferenceOfProportions:function(a,s,f,p){var h=u(a,s,f,p);return t.ztest(h,2)}})}(e,Math),e.models=function(){function t(u){var l=u[0].length,a=e.arange(l).map(function(s){var f=e.arange(l).filter(function(p){return p!==s});return r(e.col(u,s).map(function(p){return p[0]}),e.col(u,f))});return a}function r(u,l){var a=u.length,s=l[0].length-1,f=a-s-1,p=e.lstsq(l,u),h=e.multiply(l,p.map(function(M){return[M]})).map(function(M){return M[0]}),x=e.subtract(u,h),b=e.mean(u),w=e.sum(h.map(function(M){return Math.pow(M-b,2)})),A=e.sum(u.map(function(M,I){return Math.pow(M-h[I],2)})),E=w+A,O=w/E;return{exog:l,endog:u,nobs:a,df_model:s,df_resid:f,coef:p,predict:h,resid:x,ybar:b,SST:E,SSE:w,SSR:A,R2:O}}function n(u){var l=t(u.exog),a=Math.sqrt(u.SSR/u.df_resid),s=l.map(function(b){var w=b.SST,A=b.R2;return a/Math.sqrt(w*(1-A))}),f=u.coef.map(function(b,w){return(b-0)/s[w]}),p=f.map(function(b){var w=e.studentt.cdf(b,u.df_resid);return(w>.5?1-w:w)*2}),h=e.studentt.inv(.975,u.df_resid),x=u.coef.map(function(b,w){var A=h*s[w];return[b-A,b+A]});return{se:s,t:f,p,sigmaHat:a,interval95:x}}function i(u){var l=u.R2/u.df_model/((1-u.R2)/u.df_resid),a=function(f,p,h){return e.beta.cdf(f/(h/p+f),p/2,h/2)},s=1-a(l,u.df_model,u.df_resid);return{F_statistic:l,pvalue:s}}function o(u,l){var a=r(u,l),s=n(a),f=i(a),p=1-(1-a.R2)*((a.nobs-1)/a.df_resid);return a.t=s,a.f=f,a.adjust_R2=p,a}return{ols:o}}(),e.extend({buildxmatrix:function(){for(var r=new Array(arguments.length),n=0;n1){for(l=[],i=0;i{g();y();v();var GH;(function(e){typeof DO_NOT_EXPORT_BESSEL>"u"?typeof jA=="object"?e(jA):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(GH={}):e(GH={})})(function(e){e.version="1.0.2";var t=Math;function r(s,f){for(var p=0,h=0;pC)P=n(F,C,b(F),M(F),-1);else{for(var R=2*t.floor((C+t.floor(t.sqrt(40*C)))/2),q=!1,U=0,H=0,V=1,W=0,ee=2/F,ie=R;ie>0;ie--)W=ie*ee*V-U,U=V,V=W,t.abs(V)>1e10&&(V*=1e-10,U*=1e-10,P*=1e-10,H*=1e-10),q&&(H+=V),q=!q,ie==C&&(P=U);H=2*H-V,P/=H}return P}}(),u=function(){var s=.636619772,f=[-2957821389,7062834065,-5123598036e-1,1087988129e-2,-86327.92757,228.4622733].reverse(),p=[40076544269,7452499648e-1,7189466438e-3,47447.2647,226.1030244,1].reverse(),h=[1,-.001098628627,2734510407e-14,-2073370639e-15,2093887211e-16].reverse(),x=[-.01562499995,.0001430488765,-6911147651e-15,7621095161e-16,-934945152e-16].reverse();function b(I){var F=0,C=0,P=0,R=I*I,q=I-.785398164;return I<8?(C=r(f,R),P=r(p,R),F=C/P+s*o(I,0)*t.log(I)):(R=64/R,C=r(h,R),P=r(x,R),F=t.sqrt(s/I)*(t.sin(q)*C+t.cos(q)*P*8/I)),F}var w=[-4900604943e3,127527439e4,-51534381390,7349264551e-1,-4237922726e-3,8511.937935].reverse(),A=[249958057e5,424441966400,3733650367,2245904002e-2,102042.605,354.9632885,1].reverse(),E=[1,.00183105,-3516396496e-14,2457520174e-15,-240337019e-15].reverse(),O=[.04687499995,-.0002002690873,8449199096e-15,-88228987e-14,105787412e-15].reverse();function M(I){var F=0,C=0,P=0,R=I*I,q=I-2.356194491;return I<8?(C=I*r(w,R),P=r(A,R),F=C/P+s*(o(I,1)*t.log(I)-1/I)):(R=64/R,C=r(E,R),P=r(O,R),F=t.sqrt(s/I)*(t.sin(q)*C+t.cos(q)*P*8/I)),F}return i(b,M,"BESSELY",1,-1)}(),l=function(){var s=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),f=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse();function p(w){return w<=3.75?r(s,w*w/(3.75*3.75)):t.exp(t.abs(w))/t.sqrt(t.abs(w))*r(f,3.75/t.abs(w))}var h=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),x=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse();function b(w){return w<3.75?w*r(h,w*w/(3.75*3.75)):(w<0?-1:1)*t.exp(t.abs(w))/t.sqrt(t.abs(w))*r(x,3.75/t.abs(w))}return function w(A,E){if(E=Math.round(E),E===0)return p(A);if(E===1)return b(A);if(E<0)return NaN;if(t.abs(A)===0)return 0;if(A==1/0)return 1/0;var O=0,M,I=2/t.abs(A),F=0,C=1,P=0,R=2*t.round((E+t.round(t.sqrt(40*E)))/2);for(M=R;M>0;M--)P=M*I*C+F,F=C,C=P,t.abs(C)>1e10&&(C*=1e-10,F*=1e-10,O*=1e-10),M==E&&(O=F);return O*=w(A,0)/C,A<0&&E%2?-O:O}}(),a=function(){var s=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),f=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse();function p(w){return w<=2?-t.log(w/2)*l(w,0)+r(s,w*w/4):t.exp(-w)/t.sqrt(w)*r(f,2/w)}var h=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),x=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();function b(w){return w<=2?t.log(w/2)*l(w,1)+1/w*r(h,w*w/4):t.exp(-w)/t.sqrt(w)*r(x,2/w)}return i(p,b,"BESSELK",2,1)}();e.besselj=o,e.bessely=u,e.besseli=l,e.besselk=a})});var Hs=vt((FC,_C)=>{g();y();v();(function(e,t){typeof FC=="object"&&typeof _C<"u"?_C.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.CodeMirror=t())})(FC,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),u=n||i||o,l=u&&(n?document.documentMode||6:+(o||i)[1]),a=!o&&/WebKit\//.test(e),s=a&&/Qt\/\d+\.\d+/.test(e),f=!o&&/Chrome\/(\d+)/.exec(e),p=f&&+f[1],h=/Opera\//.test(e),x=/Apple Computer/.test(navigator.vendor),b=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),w=/PhantomJS/.test(e),A=x&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),E=/Android/.test(e),O=A||E||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),M=A||/Mac/.test(t),I=/\bCrOS\b/.test(e),F=/win/i.test(t),C=h&&e.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(h=!1,a=!0);var P=M&&(s||h&&(C==null||C<12.11)),R=r||u&&l>=9;function q(c){return new RegExp("(^|\\s)"+c+"(?:$|\\s)\\s*")}var U=function(c,d){var S=c.className,N=q(d).exec(S);if(N){var T=S.slice(N.index+N[0].length);c.className=S.slice(0,N.index)+(T?N[1]+T:"")}};function H(c){for(var d=c.childNodes.length;d>0;--d)c.removeChild(c.firstChild);return c}function V(c,d){return H(c).appendChild(d)}function W(c,d,S,N){var T=document.createElement(c);if(S&&(T.className=S),N&&(T.style.cssText=N),typeof d=="string")T.appendChild(document.createTextNode(d));else if(d)for(var z=0;z=d)return G+(d-z);G+=te-z,G+=S-G%S,z=te+1}}var He=function(){this.id=null,this.f=null,this.time=0,this.handler=Pe(this.onTimeout,this)};He.prototype.onTimeout=function(c){c.id=0,c.time<=+new Date?c.f():setTimeout(c.handler,c.time-+new Date)},He.prototype.set=function(c,d){this.f=d;var S=+new Date+c;(!this.id||S=d)return N+Math.min(G,d-T);if(T+=z-N,T+=S-T%S,N=z+1,T>=d)return N}}var be=[""];function Ue(c){for(;be.length<=c;)be.push(ge(be)+" ");return be[c]}function ge(c){return c[c.length-1]}function Re(c,d){for(var S=[],N=0;N"\x80"&&(c.toUpperCase()!=c.toLowerCase()||Qe.test(c))}function Pt(c,d){return d?d.source.indexOf("\\w")>-1&&ut(c)?!0:d.test(c):ut(c)}function fe(c){for(var d in c)if(c.hasOwnProperty(d)&&c[d])return!1;return!0}var J=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function j(c){return c.charCodeAt(0)>=768&&J.test(c)}function ne(c,d,S){for(;(S<0?d>0:dS?-1:1;;){if(d==S)return d;var T=(d+S)/2,z=N<0?Math.ceil(T):Math.floor(T);if(z==d)return c(z)?d:S;c(z)?S=z:d=z+N}}function xe(c,d,S,N){if(!c)return N(d,S,"ltr",0);for(var T=!1,z=0;zd||d==S&&G.to==d)&&(N(Math.max(G.from,d),Math.min(G.to,S),G.level==1?"rtl":"ltr",z),T=!0)}T||N(d,S,"ltr")}var _e=null;function Je(c,d,S){var N;_e=null;for(var T=0;Td)return T;z.to==d&&(z.from!=z.to&&S=="before"?N=T:_e=T),z.from==d&&(z.from!=z.to&&S!="before"?N=T:_e=T)}return N??_e}var nt=function(){var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function S(se){return se<=247?c.charAt(se):1424<=se&&se<=1524?"R":1536<=se&&se<=1785?d.charAt(se-1536):1774<=se&&se<=2220?"r":8192<=se&&se<=8203?"w":se==8204?"b":"L"}var N=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,T=/[stwN]/,z=/[LRr]/,G=/[Lb1n]/,te=/[1n]/;function oe(se,Ae,Ie){this.level=se,this.from=Ae,this.to=Ie}return function(se,Ae){var Ie=Ae=="ltr"?"L":"R";if(se.length==0||Ae=="ltr"&&!N.test(se))return!1;for(var Ze=se.length,$e=[],at=0;at-1&&(N[d]=T.slice(0,z).concat(T.slice(z+1)))}}}function je(c,d){var S=ye(c,d);if(S.length)for(var N=Array.prototype.slice.call(arguments,2),T=0;T0}function Gr(c){c.prototype.on=function(d,S){X(this,d,S)},c.prototype.off=function(d,S){Ye(this,d,S)}}function Gt(c){c.preventDefault?c.preventDefault():c.returnValue=!1}function xi(c){c.stopPropagation?c.stopPropagation():c.cancelBubble=!0}function rr(c){return c.defaultPrevented!=null?c.defaultPrevented:c.returnValue==!1}function ao(c){Gt(c),xi(c)}function Sr(c){return c.target||c.srcElement}function _n(c){var d=c.which;return d==null&&(c.button&1?d=1:c.button&2?d=3:c.button&4&&(d=2)),M&&c.ctrlKey&&d==1&&(d=3),d}var _a=function(){if(u&&l<9)return!1;var c=W("div");return"draggable"in c||"dragDrop"in c}(),ka;function Hn(c){if(ka==null){var d=W("span","\u200B");V(c,W("span",[d,document.createTextNode("x")])),c.firstChild.offsetHeight!=0&&(ka=d.offsetWidth<=1&&d.offsetHeight>2&&!(u&&l<8))}var S=ka?W("span","\u200B"):W("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return S.setAttribute("cm-text",""),S}var ra;function qo(c){if(ra!=null)return ra;var d=V(c,document.createTextNode("A\u062EA")),S=ie(d,0,1).getBoundingClientRect(),N=ie(d,1,2).getBoundingClientRect();return H(c),!S||S.left==S.right?!1:ra=N.right-S.right<3}var ni=` +(()=>{var Hte=Object.create;var qx=Object.defineProperty;var $te=Object.getOwnPropertyDescriptor;var Wte=Object.getOwnPropertyNames;var Vte=Object.getPrototypeOf,Gte=Object.prototype.hasOwnProperty;var Te=(e,t)=>()=>(e&&(t=e(e=0)),t);var vt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qa=(e,t)=>{for(var r in t)qx(e,r,{get:t[r],enumerable:!0})},bO=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Wte(t))!Gte.call(e,i)&&i!==r&&qx(e,i,{get:()=>t[i],enumerable:!(n=$te(t,i))||n.enumerable});return e};var ln=(e,t,r)=>(r=e!=null?Hte(Vte(e)):{},bO(t||!e||!e.__esModule?qx(r,"default",{value:e,enumerable:!0}):r,e)),Cn=e=>bO(qx({},"__esModule",{value:!0}),e);var g=Te(()=>{});function Yte(e,t){this.fun=e,this.array=t}function DO(e){var t=Math.floor((Date.now()-np.now())*.001),r=np.now()*.001,n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n=n-e[0],i=i-e[1],i<0&&(n--,i+=wS)),[n,i]}var _Ee,np,yS,wS,NO=Te(()=>{g();x();v();Yte.prototype.run=function(){this.fun.apply(null,this.array)};_Ee={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},np={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};np.now===void 0&&(yS=Date.now(),np.timing&&np.timing.navigationStart&&(yS=np.timing.navigationStart),np.now=()=>Date.now()-yS);wS=1e9;DO.bigint=function(e){var t=DO(e);return typeof BigInt>"u"?t[0]*wS+t[1]:BigInt(t[0]*wS)+BigInt(t[1])}});var v=Te(()=>{NO()});function Zte(){if(SO)return $g;SO=!0,$g.byteLength=l,$g.toByteArray=s,$g.fromByteArray=h;for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var w=y.indexOf("=");w===-1&&(w=b);var A=w===b?0:4-w%4;return[w,A]}function l(y){var b=u(y),w=b[0],A=b[1];return(w+A)*3/4-A}function a(y,b,w){return(b+w)*3/4-w}function s(y){var b,w=u(y),A=w[0],S=w[1],O=new r(a(y,A,S)),M=0,I=S>0?A-4:A,F;for(F=0;F>16&255,O[M++]=b>>8&255,O[M++]=b&255;return S===2&&(b=t[y.charCodeAt(F)]<<2|t[y.charCodeAt(F+1)]>>4,O[M++]=b&255),S===1&&(b=t[y.charCodeAt(F)]<<10|t[y.charCodeAt(F+1)]<<4|t[y.charCodeAt(F+2)]>>2,O[M++]=b>>8&255,O[M++]=b&255),O}function f(y){return e[y>>18&63]+e[y>>12&63]+e[y>>6&63]+e[y&63]}function p(y,b,w){for(var A,S=[],O=b;OI?I:M+O));return A===1?(b=y[w-1],S.push(e[b>>2]+e[b<<4&63]+"==")):A===2&&(b=(y[w-2]<<8)+y[w-1],S.push(e[b>>10]+e[b>>4&63]+e[b<<2&63]+"=")),S.join("")}return $g}function Xte(){if(EO)return zx;EO=!0;return zx.read=function(e,t,r,n,i){var o,u,l=i*8-n-1,a=(1<>1,f=-7,p=r?i-1:0,h=r?-1:1,y=e[t+p];for(p+=h,o=y&(1<<-f)-1,y>>=-f,f+=l;f>0;o=o*256+e[t+p],p+=h,f-=8);for(u=o&(1<<-f)-1,o>>=-f,f+=n;f>0;u=u*256+e[t+p],p+=h,f-=8);if(o===0)o=1-s;else{if(o===a)return u?NaN:(y?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-s}return(y?-1:1)*u*Math.pow(2,o-n)},zx.write=function(e,t,r,n,i,o){var u,l,a,s=o*8-i-1,f=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:o-1,b=n?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,u=f):(u=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-u))<1&&(u--,a*=2),u+p>=1?t+=h/a:t+=h*Math.pow(2,1-p),t*a>=2&&(u++,a/=2),u+p>=f?(l=0,u=f):u+p>=1?(l=(t*a-1)*Math.pow(2,i),u=u+p):(l=t*Math.pow(2,p-1)*Math.pow(2,i),u=0));i>=8;e[r+y]=l&255,y+=b,l/=256,i-=8);for(u=u<0;e[r+y]=u&255,y+=b,u/=256,s-=8);e[r+y-b]|=w*128},zx}function Kte(){if(AO)return ip;AO=!0;let e=Zte(),t=Xte(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ip.Buffer=u,ip.SlowBuffer=S,ip.INSPECT_MAX_BYTES=50;let n=2147483647;ip.kMaxLength=n,u.TYPED_ARRAY_SUPPORT=i(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let fe=new Uint8Array(1),J={foo:function(){return 42}};return Object.setPrototypeOf(J,Uint8Array.prototype),Object.setPrototypeOf(fe,J),fe.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function o(fe){if(fe>n)throw new RangeError('The value "'+fe+'" is invalid for option "size"');let J=new Uint8Array(fe);return Object.setPrototypeOf(J,u.prototype),J}function u(fe,J,j){if(typeof fe=="number"){if(typeof J=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(fe)}return l(fe,J,j)}u.poolSize=8192;function l(fe,J,j){if(typeof fe=="string")return p(fe,J);if(ArrayBuffer.isView(fe))return y(fe);if(fe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe);if(Ke(fe,ArrayBuffer)||fe&&Ke(fe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ke(fe,SharedArrayBuffer)||fe&&Ke(fe.buffer,SharedArrayBuffer)))return b(fe,J,j);if(typeof fe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ne=fe.valueOf&&fe.valueOf();if(ne!=null&&ne!==fe)return u.from(ne,J,j);let me=w(fe);if(me)return me;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof fe[Symbol.toPrimitive]=="function")return u.from(fe[Symbol.toPrimitive]("string"),J,j);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe)}u.from=function(fe,J,j){return l(fe,J,j)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function a(fe){if(typeof fe!="number")throw new TypeError('"size" argument must be of type number');if(fe<0)throw new RangeError('The value "'+fe+'" is invalid for option "size"')}function s(fe,J,j){return a(fe),fe<=0?o(fe):J!==void 0?typeof j=="string"?o(fe).fill(J,j):o(fe).fill(J):o(fe)}u.alloc=function(fe,J,j){return s(fe,J,j)};function f(fe){return a(fe),o(fe<0?0:A(fe)|0)}u.allocUnsafe=function(fe){return f(fe)},u.allocUnsafeSlow=function(fe){return f(fe)};function p(fe,J){if((typeof J!="string"||J==="")&&(J="utf8"),!u.isEncoding(J))throw new TypeError("Unknown encoding: "+J);let j=O(fe,J)|0,ne=o(j),me=ne.write(fe,J);return me!==j&&(ne=ne.slice(0,me)),ne}function h(fe){let J=fe.length<0?0:A(fe.length)|0,j=o(J);for(let ne=0;ne=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return fe|0}function S(fe){return+fe!=fe&&(fe=0),u.alloc(+fe)}u.isBuffer=function(J){return J!=null&&J._isBuffer===!0&&J!==u.prototype},u.compare=function(J,j){if(Ke(J,Uint8Array)&&(J=u.from(J,J.offset,J.byteLength)),Ke(j,Uint8Array)&&(j=u.from(j,j.offset,j.byteLength)),!u.isBuffer(J)||!u.isBuffer(j))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(J===j)return 0;let ne=J.length,me=j.length;for(let ye=0,_e=Math.min(ne,me);ye<_e;++ye)if(J[ye]!==j[ye]){ne=J[ye],me=j[ye];break}return neme.length?(u.isBuffer(_e)||(_e=u.from(_e)),_e.copy(me,ye)):Uint8Array.prototype.set.call(me,_e,ye);else if(u.isBuffer(_e))_e.copy(me,ye);else throw new TypeError('"list" argument must be an Array of Buffers');ye+=_e.length}return me};function O(fe,J){if(u.isBuffer(fe))return fe.length;if(ArrayBuffer.isView(fe)||Ke(fe,ArrayBuffer))return fe.byteLength;if(typeof fe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof fe);let j=fe.length,ne=arguments.length>2&&arguments[2]===!0;if(!ne&&j===0)return 0;let me=!1;for(;;)switch(J){case"ascii":case"latin1":case"binary":return j;case"utf8":case"utf-8":return be(fe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j*2;case"hex":return j>>>1;case"base64":return Re(fe).length;default:if(me)return ne?-1:be(fe).length;J=(""+J).toLowerCase(),me=!0}}u.byteLength=O;function M(fe,J,j){let ne=!1;if((J===void 0||J<0)&&(J=0),J>this.length||((j===void 0||j>this.length)&&(j=this.length),j<=0)||(j>>>=0,J>>>=0,j<=J))return"";for(fe||(fe="utf8");;)switch(fe){case"hex":return le(this,J,j);case"utf8":case"utf-8":return W(this,J,j);case"ascii":return Y(this,J,j);case"latin1":case"binary":return Z(this,J,j);case"base64":return V(this,J,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,J,j);default:if(ne)throw new TypeError("Unknown encoding: "+fe);fe=(fe+"").toLowerCase(),ne=!0}}u.prototype._isBuffer=!0;function I(fe,J,j){let ne=fe[J];fe[J]=fe[j],fe[j]=ne}u.prototype.swap16=function(){let J=this.length;if(J%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let j=0;jj&&(J+=" ... "),""},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(J,j,ne,me,ye){if(Ke(J,Uint8Array)&&(J=u.from(J,J.offset,J.byteLength)),!u.isBuffer(J))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof J);if(j===void 0&&(j=0),ne===void 0&&(ne=J?J.length:0),me===void 0&&(me=0),ye===void 0&&(ye=this.length),j<0||ne>J.length||me<0||ye>this.length)throw new RangeError("out of range index");if(me>=ye&&j>=ne)return 0;if(me>=ye)return-1;if(j>=ne)return 1;if(j>>>=0,ne>>>=0,me>>>=0,ye>>>=0,this===J)return 0;let _e=ye-me,Je=ne-j,nt=Math.min(_e,Je),Xe=this.slice(me,ye),pt=J.slice(j,ne);for(let X=0;X2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),j=+j,ot(j)&&(j=me?0:fe.length-1),j<0&&(j=fe.length+j),j>=fe.length){if(me)return-1;j=fe.length-1}else if(j<0)if(me)j=0;else return-1;if(typeof J=="string"&&(J=u.from(J,ne)),u.isBuffer(J))return J.length===0?-1:C(fe,J,j,ne,me);if(typeof J=="number")return J=J&255,typeof Uint8Array.prototype.indexOf=="function"?me?Uint8Array.prototype.indexOf.call(fe,J,j):Uint8Array.prototype.lastIndexOf.call(fe,J,j):C(fe,[J],j,ne,me);throw new TypeError("val must be string, number or Buffer")}function C(fe,J,j,ne,me){let ye=1,_e=fe.length,Je=J.length;if(ne!==void 0&&(ne=String(ne).toLowerCase(),ne==="ucs2"||ne==="ucs-2"||ne==="utf16le"||ne==="utf-16le")){if(fe.length<2||J.length<2)return-1;ye=2,_e/=2,Je/=2,j/=2}function nt(pt,X){return ye===1?pt[X]:pt.readUInt16BE(X*ye)}let Xe;if(me){let pt=-1;for(Xe=j;Xe<_e;Xe++)if(nt(fe,Xe)===nt(J,pt===-1?0:Xe-pt)){if(pt===-1&&(pt=Xe),Xe-pt+1===Je)return pt*ye}else pt!==-1&&(Xe-=Xe-pt),pt=-1}else for(j+Je>_e&&(j=_e-Je),Xe=j;Xe>=0;Xe--){let pt=!0;for(let X=0;Xme&&(ne=me)):ne=me;let ye=J.length;ne>ye/2&&(ne=ye/2);let _e;for(_e=0;_e>>0,isFinite(ne)?(ne=ne>>>0,me===void 0&&(me="utf8")):(me=ne,ne=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let ye=this.length-j;if((ne===void 0||ne>ye)&&(ne=ye),J.length>0&&(ne<0||j<0)||j>this.length)throw new RangeError("Attempt to write outside buffer bounds");me||(me="utf8");let _e=!1;for(;;)switch(me){case"hex":return P(this,J,j,ne);case"utf8":case"utf-8":return R(this,J,j,ne);case"ascii":case"latin1":case"binary":return q(this,J,j,ne);case"base64":return U(this,J,j,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,J,j,ne);default:if(_e)throw new TypeError("Unknown encoding: "+me);me=(""+me).toLowerCase(),_e=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function V(fe,J,j){return J===0&&j===fe.length?e.fromByteArray(fe):e.fromByteArray(fe.slice(J,j))}function W(fe,J,j){j=Math.min(fe.length,j);let ne=[],me=J;for(;me239?4:ye>223?3:ye>191?2:1;if(me+Je<=j){let nt,Xe,pt,X;switch(Je){case 1:ye<128&&(_e=ye);break;case 2:nt=fe[me+1],(nt&192)===128&&(X=(ye&31)<<6|nt&63,X>127&&(_e=X));break;case 3:nt=fe[me+1],Xe=fe[me+2],(nt&192)===128&&(Xe&192)===128&&(X=(ye&15)<<12|(nt&63)<<6|Xe&63,X>2047&&(X<55296||X>57343)&&(_e=X));break;case 4:nt=fe[me+1],Xe=fe[me+2],pt=fe[me+3],(nt&192)===128&&(Xe&192)===128&&(pt&192)===128&&(X=(ye&15)<<18|(nt&63)<<12|(Xe&63)<<6|pt&63,X>65535&&X<1114112&&(_e=X))}}_e===null?(_e=65533,Je=1):_e>65535&&(_e-=65536,ne.push(_e>>>10&1023|55296),_e=56320|_e&1023),ne.push(_e),me+=Je}return ie(ne)}let ee=4096;function ie(fe){let J=fe.length;if(J<=ee)return String.fromCharCode.apply(String,fe);let j="",ne=0;for(;nene)&&(j=ne);let me="";for(let ye=J;yene&&(J=ne),j<0?(j+=ne,j<0&&(j=0)):j>ne&&(j=ne),jj)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(J,j,ne){J=J>>>0,j=j>>>0,ne||he(J,j,this.length);let me=this[J],ye=1,_e=0;for(;++_e>>0,j=j>>>0,ne||he(J,j,this.length);let me=this[J+--j],ye=1;for(;j>0&&(ye*=256);)me+=this[J+--j]*ye;return me},u.prototype.readUint8=u.prototype.readUInt8=function(J,j){return J=J>>>0,j||he(J,1,this.length),this[J]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(J,j){return J=J>>>0,j||he(J,2,this.length),this[J]|this[J+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(J,j){return J=J>>>0,j||he(J,2,this.length),this[J]<<8|this[J+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(J,j){return J=J>>>0,j||he(J,4,this.length),(this[J]|this[J+1]<<8|this[J+2]<<16)+this[J+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(J,j){return J=J>>>0,j||he(J,4,this.length),this[J]*16777216+(this[J+1]<<16|this[J+2]<<8|this[J+3])},u.prototype.readBigUInt64LE=ut(function(J){J=J>>>0,Le(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let me=j+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24,ye=this[++J]+this[++J]*2**8+this[++J]*2**16+ne*2**24;return BigInt(me)+(BigInt(ye)<>>0,Le(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let me=j*2**24+this[++J]*2**16+this[++J]*2**8+this[++J],ye=this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+ne;return(BigInt(me)<>>0,j=j>>>0,ne||he(J,j,this.length);let me=this[J],ye=1,_e=0;for(;++_e=ye&&(me-=Math.pow(2,8*j)),me},u.prototype.readIntBE=function(J,j,ne){J=J>>>0,j=j>>>0,ne||he(J,j,this.length);let me=j,ye=1,_e=this[J+--me];for(;me>0&&(ye*=256);)_e+=this[J+--me]*ye;return ye*=128,_e>=ye&&(_e-=Math.pow(2,8*j)),_e},u.prototype.readInt8=function(J,j){return J=J>>>0,j||he(J,1,this.length),this[J]&128?(255-this[J]+1)*-1:this[J]},u.prototype.readInt16LE=function(J,j){J=J>>>0,j||he(J,2,this.length);let ne=this[J]|this[J+1]<<8;return ne&32768?ne|4294901760:ne},u.prototype.readInt16BE=function(J,j){J=J>>>0,j||he(J,2,this.length);let ne=this[J+1]|this[J]<<8;return ne&32768?ne|4294901760:ne},u.prototype.readInt32LE=function(J,j){return J=J>>>0,j||he(J,4,this.length),this[J]|this[J+1]<<8|this[J+2]<<16|this[J+3]<<24},u.prototype.readInt32BE=function(J,j){return J=J>>>0,j||he(J,4,this.length),this[J]<<24|this[J+1]<<16|this[J+2]<<8|this[J+3]},u.prototype.readBigInt64LE=ut(function(J){J=J>>>0,Le(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let me=this[J+4]+this[J+5]*2**8+this[J+6]*2**16+(ne<<24);return(BigInt(me)<>>0,Le(J,"offset");let j=this[J],ne=this[J+7];(j===void 0||ne===void 0)&<(J,this.length-8);let me=(j<<24)+this[++J]*2**16+this[++J]*2**8+this[++J];return(BigInt(me)<>>0,j||he(J,4,this.length),t.read(this,J,!0,23,4)},u.prototype.readFloatBE=function(J,j){return J=J>>>0,j||he(J,4,this.length),t.read(this,J,!1,23,4)},u.prototype.readDoubleLE=function(J,j){return J=J>>>0,j||he(J,8,this.length),t.read(this,J,!0,52,8)},u.prototype.readDoubleBE=function(J,j){return J=J>>>0,j||he(J,8,this.length),t.read(this,J,!1,52,8)};function De(fe,J,j,ne,me,ye){if(!u.isBuffer(fe))throw new TypeError('"buffer" argument must be a Buffer instance');if(J>me||Jfe.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(J,j,ne,me){if(J=+J,j=j>>>0,ne=ne>>>0,!me){let Je=Math.pow(2,8*ne)-1;De(this,J,j,ne,Je,0)}let ye=1,_e=0;for(this[j]=J&255;++_e>>0,ne=ne>>>0,!me){let Je=Math.pow(2,8*ne)-1;De(this,J,j,ne,Je,0)}let ye=ne-1,_e=1;for(this[j+ye]=J&255;--ye>=0&&(_e*=256);)this[j+ye]=J/_e&255;return j+ne},u.prototype.writeUint8=u.prototype.writeUInt8=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,1,255,0),this[j]=J&255,j+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,2,65535,0),this[j]=J&255,this[j+1]=J>>>8,j+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,2,65535,0),this[j]=J>>>8,this[j+1]=J&255,j+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,4,4294967295,0),this[j+3]=J>>>24,this[j+2]=J>>>16,this[j+1]=J>>>8,this[j]=J&255,j+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,4,4294967295,0),this[j]=J>>>24,this[j+1]=J>>>16,this[j+2]=J>>>8,this[j+3]=J&255,j+4};function we(fe,J,j,ne,me){We(J,ne,me,fe,j,7);let ye=Number(J&BigInt(4294967295));fe[j++]=ye,ye=ye>>8,fe[j++]=ye,ye=ye>>8,fe[j++]=ye,ye=ye>>8,fe[j++]=ye;let _e=Number(J>>BigInt(32)&BigInt(4294967295));return fe[j++]=_e,_e=_e>>8,fe[j++]=_e,_e=_e>>8,fe[j++]=_e,_e=_e>>8,fe[j++]=_e,j}function ce(fe,J,j,ne,me){We(J,ne,me,fe,j,7);let ye=Number(J&BigInt(4294967295));fe[j+7]=ye,ye=ye>>8,fe[j+6]=ye,ye=ye>>8,fe[j+5]=ye,ye=ye>>8,fe[j+4]=ye;let _e=Number(J>>BigInt(32)&BigInt(4294967295));return fe[j+3]=_e,_e=_e>>8,fe[j+2]=_e,_e=_e>>8,fe[j+1]=_e,_e=_e>>8,fe[j]=_e,j+8}u.prototype.writeBigUInt64LE=ut(function(J,j=0){return we(this,J,j,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=ut(function(J,j=0){return ce(this,J,j,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(J,j,ne,me){if(J=+J,j=j>>>0,!me){let nt=Math.pow(2,8*ne-1);De(this,J,j,ne,nt-1,-nt)}let ye=0,_e=1,Je=0;for(this[j]=J&255;++ye>0)-Je&255;return j+ne},u.prototype.writeIntBE=function(J,j,ne,me){if(J=+J,j=j>>>0,!me){let nt=Math.pow(2,8*ne-1);De(this,J,j,ne,nt-1,-nt)}let ye=ne-1,_e=1,Je=0;for(this[j+ye]=J&255;--ye>=0&&(_e*=256);)J<0&&Je===0&&this[j+ye+1]!==0&&(Je=1),this[j+ye]=(J/_e>>0)-Je&255;return j+ne},u.prototype.writeInt8=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,1,127,-128),J<0&&(J=255+J+1),this[j]=J&255,j+1},u.prototype.writeInt16LE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,2,32767,-32768),this[j]=J&255,this[j+1]=J>>>8,j+2},u.prototype.writeInt16BE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,2,32767,-32768),this[j]=J>>>8,this[j+1]=J&255,j+2},u.prototype.writeInt32LE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,4,2147483647,-2147483648),this[j]=J&255,this[j+1]=J>>>8,this[j+2]=J>>>16,this[j+3]=J>>>24,j+4},u.prototype.writeInt32BE=function(J,j,ne){return J=+J,j=j>>>0,ne||De(this,J,j,4,2147483647,-2147483648),J<0&&(J=4294967295+J+1),this[j]=J>>>24,this[j+1]=J>>>16,this[j+2]=J>>>8,this[j+3]=J&255,j+4},u.prototype.writeBigInt64LE=ut(function(J,j=0){return we(this,J,j,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=ut(function(J,j=0){return ce(this,J,j,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Se(fe,J,j,ne,me,ye){if(j+ne>fe.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("Index out of range")}function Pe(fe,J,j,ne,me){return J=+J,j=j>>>0,me||Se(fe,J,j,4),t.write(fe,J,j,ne,23,4),j+4}u.prototype.writeFloatLE=function(J,j,ne){return Pe(this,J,j,!0,ne)},u.prototype.writeFloatBE=function(J,j,ne){return Pe(this,J,j,!1,ne)};function Ce(fe,J,j,ne,me){return J=+J,j=j>>>0,me||Se(fe,J,j,8),t.write(fe,J,j,ne,52,8),j+8}u.prototype.writeDoubleLE=function(J,j,ne){return Ce(this,J,j,!0,ne)},u.prototype.writeDoubleBE=function(J,j,ne){return Ce(this,J,j,!1,ne)},u.prototype.copy=function(J,j,ne,me){if(!u.isBuffer(J))throw new TypeError("argument should be a Buffer");if(ne||(ne=0),!me&&me!==0&&(me=this.length),j>=J.length&&(j=J.length),j||(j=0),me>0&&me=this.length)throw new RangeError("Index out of range");if(me<0)throw new RangeError("sourceEnd out of bounds");me>this.length&&(me=this.length),J.length-j>>0,ne=ne===void 0?this.length:ne>>>0,J||(J=0);let ye;if(typeof J=="number")for(ye=j;ye2**32?me=Ee(String(j)):typeof j=="bigint"&&(me=String(j),(j>BigInt(2)**BigInt(32)||j<-(BigInt(2)**BigInt(32)))&&(me=Ee(me)),me+="n"),ne+=` It must be ${J}. Received ${me}`,ne},RangeError);function Ee(fe){let J="",j=fe.length,ne=fe[0]==="-"?1:0;for(;j>=ne+4;j-=3)J=`_${fe.slice(j-3,j)}${J}`;return`${fe.slice(0,j)}${J}`}function ze(fe,J,j){Le(J,"offset"),(fe[J]===void 0||fe[J+j]===void 0)&<(J,fe.length-(j+1))}function We(fe,J,j,ne,me,ye){if(fe>j||fe3?J===0||J===BigInt(0)?Je=`>= 0${_e} and < 2${_e} ** ${(ye+1)*8}${_e}`:Je=`>= -(2${_e} ** ${(ye+1)*8-1}${_e}) and < 2 ** ${(ye+1)*8-1}${_e}`:Je=`>= ${J}${_e} and <= ${j}${_e}`,new Oe.ERR_OUT_OF_RANGE("value",Je,fe)}ze(ne,me,ye)}function Le(fe,J){if(typeof fe!="number")throw new Oe.ERR_INVALID_ARG_TYPE(J,"number",fe)}function lt(fe,J,j){throw Math.floor(fe)!==fe?(Le(fe,j),new Oe.ERR_OUT_OF_RANGE(j||"offset","an integer",fe)):J<0?new Oe.ERR_BUFFER_OUT_OF_BOUNDS:new Oe.ERR_OUT_OF_RANGE(j||"offset",`>= ${j?1:0} and <= ${J}`,fe)}let ct=/[^+/0-9A-Za-z-_]/g;function de(fe){if(fe=fe.split("=")[0],fe=fe.trim().replace(ct,""),fe.length<2)return"";for(;fe.length%4!==0;)fe=fe+"=";return fe}function be(fe,J){J=J||1/0;let j,ne=fe.length,me=null,ye=[];for(let _e=0;_e55295&&j<57344){if(!me){if(j>56319){(J-=3)>-1&&ye.push(239,191,189);continue}else if(_e+1===ne){(J-=3)>-1&&ye.push(239,191,189);continue}me=j;continue}if(j<56320){(J-=3)>-1&&ye.push(239,191,189),me=j;continue}j=(me-55296<<10|j-56320)+65536}else me&&(J-=3)>-1&&ye.push(239,191,189);if(me=null,j<128){if((J-=1)<0)break;ye.push(j)}else if(j<2048){if((J-=2)<0)break;ye.push(j>>6|192,j&63|128)}else if(j<65536){if((J-=3)<0)break;ye.push(j>>12|224,j>>6&63|128,j&63|128)}else if(j<1114112){if((J-=4)<0)break;ye.push(j>>18|240,j>>12&63|128,j>>6&63|128,j&63|128)}else throw new Error("Invalid code point")}return ye}function Ue(fe){let J=[];for(let j=0;j>8,me=j%256,ye.push(me),ye.push(ne);return ye}function Re(fe){return e.toByteArray(de(fe))}function Be(fe,J,j,ne){let me;for(me=0;me=J.length||me>=fe.length);++me)J[me+j]=fe[me];return me}function Ke(fe,J){return fe instanceof J||fe!=null&&fe.constructor!=null&&fe.constructor.name!=null&&fe.constructor.name===J.name}function ot(fe){return fe!==fe}let Qe=function(){let fe="0123456789abcdef",J=new Array(256);for(let j=0;j<16;++j){let ne=j*16;for(let me=0;me<16;++me)J[ne+me]=fe[j]+fe[me]}return J}();function ut(fe){return typeof BigInt>"u"?Pt:fe}function Pt(){throw new Error("BigInt not supported")}return ip}var $g,SO,zx,EO,ip,AO,op,k,qEe,zEe,CO=Te(()=>{g();x();v();$g={},SO=!1;zx={},EO=!1;ip={},AO=!1;op=Kte();op.Buffer;op.SlowBuffer;op.INSPECT_MAX_BYTES;op.kMaxLength;k=op.Buffer,qEe=op.INSPECT_MAX_BYTES,zEe=op.kMaxLength});var x=Te(()=>{CO()});var Wg=vt((bS,DS)=>{g();x();v();(function(e,t){typeof bS=="object"&&typeof DS<"u"?DS.exports=t():typeof define=="function"&&define.amd?define("uikit",t):(e=typeof globalThis<"u"?globalThis:e||self,e.UIkit=t())})(bS,function(){"use strict";let{hasOwnProperty:e,toString:t}=Object.prototype;function r(m,D){return e.call(m,D)}let n=/\B([A-Z])/g,i=be(m=>m.replace(n,"-$1").toLowerCase()),o=/-(\w)/g,u=be(m=>(m.charAt(0).toLowerCase()+m.slice(1)).replace(o,(D,_)=>_.toUpperCase())),l=be(m=>m.charAt(0).toUpperCase()+m.slice(1));function a(m,D){var _;return(_=m?.startsWith)==null?void 0:_.call(m,D)}function s(m,D){var _;return(_=m?.endsWith)==null?void 0:_.call(m,D)}function f(m,D){var _;return(_=m?.includes)==null?void 0:_.call(m,D)}function p(m,D){var _;return(_=m?.findIndex)==null?void 0:_.call(m,D)}let{isArray:h,from:y}=Array,{assign:b}=Object;function w(m){return typeof m=="function"}function A(m){return m!==null&&typeof m=="object"}function S(m){return t.call(m)==="[object Object]"}function O(m){return A(m)&&m===m.window}function M(m){return C(m)===9}function I(m){return C(m)>=1}function F(m){return C(m)===1}function C(m){return!O(m)&&A(m)&&m.nodeType}function P(m){return typeof m=="boolean"}function R(m){return typeof m=="string"}function q(m){return typeof m=="number"}function U(m){return q(m)||R(m)&&!isNaN(m-parseFloat(m))}function H(m){return!(h(m)?m.length:A(m)&&Object.keys(m).length)}function V(m){return m===void 0}function W(m){return P(m)?m:m==="true"||m==="1"||m===""?!0:m==="false"||m==="0"?!1:m}function ee(m){let D=Number(m);return isNaN(D)?!1:D}function ie(m){return parseFloat(m)||0}function Y(m){return m&&Z(m)[0]}function Z(m){return I(m)?[m]:Array.from(m||[]).filter(I)}function le(m){if(O(m))return m;m=Y(m);let D=M(m)?m:m?.ownerDocument;return D?.defaultView||window}function re(m,D){return m===D||A(m)&&A(D)&&Object.keys(m).length===Object.keys(D).length&&we(m,(_,$)=>_===D[$])}function he(m,D,_){return m.replace(new RegExp(`${D}|${_}`,"g"),$=>$===D?_:D)}function De(m){return m[m.length-1]}function we(m,D){for(let _ in m)if(D(m[_],_)===!1)return!1;return!0}function ce(m,D){return m.slice().sort(({[D]:_=0},{[D]:$=0})=>_>$?1:$>_?-1:0)}function Se(m,D){return m.reduce((_,$)=>_+ie(w(D)?D($):$[D]),0)}function Pe(m,D){let _=new Set;return m.filter(({[D]:$})=>_.has($)?!1:_.add($))}function Ce(m,D){return D.reduce((_,$)=>({..._,[$]:m[$]}),{})}function Oe(m,D=0,_=1){return Math.min(Math.max(ee(m)||0,D),_)}function He(){}function Ee(...m){return[["bottom","top"],["right","left"]].every(([D,_])=>Math.min(...m.map(({[D]:$})=>$))-Math.max(...m.map(({[_]:$})=>$))>0)}function ze(m,D){return m.x<=D.right&&m.x>=D.left&&m.y<=D.bottom&&m.y>=D.top}function We(m,D,_){let $=D==="width"?"height":"width";return{[$]:m[D]?Math.round(_*m[$]/m[D]):m[$],[D]:_}}function Le(m,D){m={...m};for(let _ in m)m=m[_]>D[_]?We(m,_,D[_]):m;return m}function lt(m,D){m=Le(m,D);for(let _ in m)m=m[_]D[_]||(D[_]=m(_,...$))}function Ue(m,...D){for(let _ of Z(m)){let $=ot(D).filter(Q=>!Be(_,Q));$.length&&_.classList.add(...$)}}function ge(m,...D){for(let _ of Z(m)){let $=ot(D).filter(Q=>Be(_,Q));$.length&&_.classList.remove(...$)}}function Re(m,D,_){_=ot(_),D=ot(D).filter($=>!f(_,$)),ge(m,D),Ue(m,_)}function Be(m,D){return[D]=ot(D),Z(m).some(_=>_.classList.contains(D))}function Ke(m,D,_){let $=ot(D);V(_)||(_=!!_);for(let Q of Z(m))for(let ae of $)Q.classList.toggle(ae,_)}function ot(m){return m?h(m)?m.map(ot).flat():String(m).split(" ").filter(Boolean):[]}function Qe(m,D,_){var $;if(A(D)){for(let Q in D)Qe(m,Q,D[Q]);return}if(V(_))return($=Y(m))==null?void 0:$.getAttribute(D);for(let Q of Z(m))w(_)&&(_=_.call(Q,Qe(Q,D))),_===null?Pt(Q,D):Q.setAttribute(D,_)}function ut(m,D){return Z(m).some(_=>_.hasAttribute(D))}function Pt(m,D){Z(m).forEach(_=>_.removeAttribute(D))}function fe(m,D){for(let _ of[D,`data-${D}`])if(ut(m,_))return Qe(m,_)}let J=typeof window<"u",j=J&&document.dir==="rtl",ne=J&&"ontouchstart"in window,me=J&&window.PointerEvent,ye=me?"pointerdown":ne?"touchstart":"mousedown",_e=me?"pointermove":ne?"touchmove":"mousemove",Je=me?"pointerup":ne?"touchend":"mouseup",nt=me?"pointerenter":ne?"":"mouseenter",Xe=me?"pointerleave":ne?"":"mouseleave",pt=me?"pointercancel":"touchcancel",X={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};function xe(m){return Z(m).some(D=>X[D.tagName.toLowerCase()])}let Ye=J&&Element.prototype.checkVisibility||function(){return this.offsetWidth||this.offsetHeight||this.getClientRects().length};function je(m){return Z(m).some(D=>Ye.call(D))}let wt="input,select,textarea,button";function Bt(m){return Z(m).some(D=>rr(D,wt))}let fr=`${wt},a[href],[tabindex]`;function Gr(m){return rr(m,fr)}function Gt(m){var D;return(D=Y(m))==null?void 0:D.parentElement}function yi(m,D){return Z(m).filter(_=>rr(_,D))}function rr(m,D){return Z(m).some(_=>_.matches(D))}function ao(m,D){let _=[];for(;m=Gt(m);)(!D||rr(m,D))&&_.push(m);return _}function Er(m,D){m=Y(m);let _=m?y(m.children):[];return D?yi(_,D):_}function _n(m,D){return D?Z(m).indexOf(Y(D)):Er(Gt(m)).indexOf(m)}function _a(m){return m=Y(m),m&&["origin","pathname","search"].every(D=>m[D]===location[D])}function ka(m){if(_a(m)){let{hash:D,ownerDocument:_}=Y(m),$=decodeURIComponent(D).slice(1);return _.getElementById($)||_.getElementsByName($)[0]}}function Hn(m,D){return qo(m,na(m,D))}function ra(m,D){return ni(m,na(m,D))}function qo(m,D){return Y(uo(m,Y(D),"querySelector"))}function ni(m,D){return Z(uo(m,Y(D),"querySelectorAll"))}function na(m,D=document){return R(m)&&ms(m).isContextSelector||M(D)?D:D.ownerDocument}let Hl=/([!>+~-])(?=\s+[!>+~-]|\s*$)/g,So=/.*?[^\\](?![^(]*\))(?:,|$)/g,fc=/\s*,$/,ms=be(m=>{var D;m=m.replace(Hl,"$1 *");let _=!1,$=[];for(let Q of(D=m.match(So))!=null?D:[])Q=Q.replace(fc,"").trim(),_||(_=["!","+","~","-",">"].includes(Q[0])),$.push(Q);return{selector:$.join(","),selectors:$,isContextSelector:_}}),so=be(m=>{m=m.slice(1).trim();let D=m.indexOf(" ");return~D?[m.slice(0,D),m.slice(D+1)]:[m,""]});function uo(m,D=document,_){if(!m||!R(m))return m;let $=ms(m);if(!$.isContextSelector)return ia(D,_,$.selector);m="";let Q=$.selectors.length===1;for(let ae of $.selectors){let pe,Ne=D;if(ae[0]==="!"&&([pe,ae]=so(ae),Ne=D.parentElement.closest(pe),!ae&&Q)||Ne&&ae[0]==="-"&&([pe,ae]=so(ae),Ne=Ne.previousElementSibling,Ne=rr(Ne,pe)?Ne:null,!ae&&Q))return Ne;if(Ne){if(Q)return ae[0]==="~"||ae[0]==="+"?(ae=`:scope > :nth-child(${_n(Ne)+1}) ${ae}`,Ne=Ne.parentElement):ae[0]===">"&&(ae=`:scope ${ae}`),ia(Ne,_,ae);m+=`${m?",":""}${ru(Ne)} ${ae}`}}return M(D)||(D=D.ownerDocument),ia(D,_,m)}function ia(m,D,_){try{return m[D](_)}catch{return null}}function ru(m){let D=[];for(;m.parentNode;){let _=Qe(m,"id");if(_){D.unshift(`#${Ba(_)}`);break}else{let{tagName:$}=m;$!=="HTML"&&($+=`:nth-child(${_n(m)+1})`),D.unshift($),m=m.parentNode}}return D.join(" > ")}function Ba(m){return R(m)?CSS.escape(m):""}function jt(...m){let[D,_,$,Q,ae=!1]=Qr(m);Q.length>1&&(Q=oa(Q)),ae?.self&&(Q=$u(Q)),$&&(Q=zt($,Q));for(let pe of _)for(let Ne of D)Ne.addEventListener(pe,Q,ae);return()=>Gi(D,_,Q,ae)}function Gi(...m){let[D,_,,$,Q=!1]=Qr(m);for(let ae of _)for(let pe of D)pe.removeEventListener(ae,$,Q)}function Or(...m){let[D,_,$,Q,ae=!1,pe]=Qr(m),Ne=jt(D,_,$,Fe=>{let et=!pe||pe(Fe);et&&(Ne(),Q(Fe,et))},ae);return Ne}function qt(m,D,_){return Me(m).every($=>$.dispatchEvent(Eo(D,!0,!0,_)))}function Eo(m,D=!0,_=!1,$){return R(m)&&(m=new CustomEvent(m,{bubbles:D,cancelable:_,detail:$})),m}function Qr(m){return m[0]=Me(m[0]),R(m[1])&&(m[1]=m[1].split(" ")),w(m[2])&&m.splice(2,0,!1),m}function zt(m,D){return _=>{let $=m[0]===">"?ni(m,_.currentTarget).reverse().find(Q=>Q.contains(_.target)):_.target.closest(m);$&&(_.current=$,D.call(this,_),delete _.current)}}function oa(m){return D=>h(D.detail)?m(D,...D.detail):m(D)}function $u(m){return function(D){if(D.target===D.currentTarget||D.target===D.current)return m.call(null,D)}}function $n(m){return m&&"addEventListener"in m}function ue(m){return $n(m)?m:Y(m)}function Me(m){return h(m)?m.map(ue).filter(Boolean):R(m)?ni(m):$n(m)?[m]:Z(m)}function st(m){return m.pointerType==="touch"||!!m.touches}function dt(m){var D,_;let{clientX:$,clientY:Q}=((D=m.touches)==null?void 0:D[0])||((_=m.changedTouches)==null?void 0:_[0])||m;return{x:$,y:Q}}let rt={"animation-iteration-count":!0,"column-count":!0,"fill-opacity":!0,"flex-grow":!0,"flex-shrink":!0,"font-weight":!0,"line-height":!0,opacity:!0,order:!0,orphans:!0,"stroke-dasharray":!0,"stroke-dashoffset":!0,widows:!0,"z-index":!0,zoom:!0};function ke(m,D,_,$){let Q=Z(m);for(let ae of Q)if(R(D)){if(D=Mr(D),V(_))return getComputedStyle(ae).getPropertyValue(D);ae.style.setProperty(D,U(_)&&!rt[D]?`${_}px`:_||q(_)?_:"",$)}else if(h(D)){let pe={};for(let Ne of D)pe[Ne]=ke(ae,Ne);return pe}else if(A(D))for(let pe in D)ke(ae,pe,D[pe],_);return Q[0]}let Mr=be(m=>{if(a(m,"--"))return m;m=i(m);let{style:D}=document.documentElement;if(m in D)return m;for(let _ of["webkit","moz"]){let $=`-${_}-${m}`;if($ in D)return $}}),kn="uk-transition",wi="transitionend",nu="transitioncanceled";function w1(m,D,_=400,$="linear"){return _=Math.round(_),Promise.all(Z(m).map(Q=>new Promise((ae,pe)=>{for(let Fe in D)ke(Q,Fe);let Ne=setTimeout(()=>qt(Q,wi),_);Or(Q,[wi,nu],({type:Fe})=>{clearTimeout(Ne),ge(Q,kn),ke(Q,{transitionProperty:"",transitionDuration:"",transitionTimingFunction:""}),Fe===nu?pe():ae(Q)},{self:!0}),Ue(Q,kn),ke(Q,{transitionProperty:Object.keys(D).map(Mr).join(","),transitionDuration:`${_}ms`,transitionTimingFunction:$,...D})})))}let Tt={start:w1,async stop(m){qt(m,wi),await Promise.resolve()},async cancel(m){qt(m,nu),await Promise.resolve()},inProgress(m){return Be(m,kn)}},cc="uk-animation",$d="animationend",Wu="animationcanceled";function aa(m,D,_=200,$,Q){return Promise.all(Z(m).map(ae=>new Promise((pe,Ne)=>{Be(ae,cc)&&qt(ae,Wu);let Fe=[D,cc,`${cc}-${Q?"leave":"enter"}`,$&&`uk-transform-origin-${$}`,Q&&`${cc}-reverse`],et=setTimeout(()=>qt(ae,$d),_);Or(ae,[$d,Wu],({type:it})=>{clearTimeout(et),it===Wu?Ne():pe(ae),ke(ae,"animationDuration",""),ge(ae,Fe)},{self:!0}),ke(ae,"animationDuration",`${_}ms`),Ue(ae,Fe)})))}let hs={in:aa,out(m,D,_,$){return aa(m,D,_,$,!0)},inProgress(m){return Be(m,cc)},cancel(m){qt(m,Wu)}};function b1(m){if(document.readyState!=="loading"){m();return}Or(document,"DOMContentLoaded",m)}function jr(m,...D){return D.some(_=>{var $;return(($=m?.tagName)==null?void 0:$.toLowerCase())===_.toLowerCase()})}function sm(m){return m=vr(m),m.innerHTML="",m}function ds(m,D){return V(D)?vr(m).innerHTML:Sn(sm(m),D)}let Wd=hc("prepend"),Sn=hc("append"),pc=hc("before"),mc=hc("after");function hc(m){return function(D,_){var $;let Q=Z(R(_)?Vu(_):_);return($=vr(D))==null||$[m](...Q),dc(Q)}}function Ao(m){Z(m).forEach(D=>D.remove())}function um(m,D){for(D=Y(pc(m,D));D.firstElementChild;)D=D.firstElementChild;return Sn(D,m),D}function lm(m,D){return Z(Z(m).map(_=>_.hasChildNodes()?um(y(_.childNodes),D):Sn(_,D)))}function Co(m){Z(m).map(Gt).filter((D,_,$)=>$.indexOf(D)===_).forEach(D=>D.replaceWith(...D.childNodes))}let vN=/^<(\w+)\s*\/?>(?:<\/\1>)?$/;function Vu(m){let D=vN.exec(m);if(D)return document.createElement(D[1]);let _=document.createElement("template");return _.innerHTML=m.trim(),dc(_.content.childNodes)}function dc(m){return m.length>1?m:m[0]}function zo(m,D){if(F(m))for(D(m),m=m.firstElementChild;m;){let _=m.nextElementSibling;zo(m,D),m=_}}function vr(m,D){return D1(m)?Y(Vu(m)):qo(m,D)}function tn(m,D){return D1(m)?Z(Vu(m)):ni(m,D)}function D1(m){return R(m)&&a(m.trim(),"<")}let Gu={width:["left","right"],height:["top","bottom"]};function Ht(m){let D=F(m)?Y(m).getBoundingClientRect():{height:Yi(m),width:Yu(m),top:0,left:0};return{height:D.height,width:D.width,top:D.top,left:D.left,bottom:D.top+D.height,right:D.left+D.width}}function Dr(m,D){D&&ke(m,{left:0,top:0});let _=Ht(m);if(m){let{scrollY:$,scrollX:Q}=le(m),ae={height:$,width:Q};for(let pe in Gu)for(let Ne of Gu[pe])_[Ne]+=ae[pe]}if(!D)return _;for(let $ of["left","top"])ke(m,$,D[$]-_[$])}function Vd(m){let{top:D,left:_}=Dr(m),{ownerDocument:{body:$,documentElement:Q},offsetParent:ae}=Y(m),pe=ae||Q;for(;pe&&(pe===$||pe===Q)&&ke(pe,"position")==="static";)pe=pe.parentNode;if(F(pe)){let Ne=Dr(pe);D-=Ne.top+ie(ke(pe,"borderTopWidth")),_-=Ne.left+ie(ke(pe,"borderLeftWidth"))}return{top:D-ie(ke(m,"marginTop")),left:_-ie(ke(m,"marginLeft"))}}function $l(m){m=Y(m);let D=[m.offsetTop,m.offsetLeft];for(;m=m.offsetParent;)if(D[0]+=m.offsetTop+ie(ke(m,"borderTopWidth")),D[1]+=m.offsetLeft+ie(ke(m,"borderLeftWidth")),ke(m,"position")==="fixed"){let _=le(m);return D[0]+=_.scrollY,D[1]+=_.scrollX,D}return D}let Yi=gc("height"),Yu=gc("width");function gc(m){let D=l(m);return(_,$)=>{if(V($)){if(O(_))return _[`inner${D}`];if(M(_)){let Q=_.documentElement;return Math.max(Q[`offset${D}`],Q[`scroll${D}`])}return _=Y(_),$=ke(_,m),$=$==="auto"?_[`offset${D}`]:ie($)||0,$-iu(_,m)}else return ke(_,m,!$&&$!==0?"":+$+iu(_,m)+"px")}}function iu(m,D,_="border-box"){return ke(m,"boxSizing")===_?Se(Gu[D].map(l),$=>ie(ke(m,`padding${$}`))+ie(ke(m,`border${$}Width`))):0}function vc(m){for(let D in Gu)for(let _ in Gu[D])if(Gu[D][_]===m)return Gu[D][1-_];return m}function ii(m,D="width",_=window,$=!1){return R(m)?Se(xN(m),Q=>{let ae=sa(Q);return ae?yN(ae==="vh"?S1():ae==="vw"?Yu(le(_)):$?_[`offset${l(D)}`]:Ht(_)[D],Q):Q}):ie(m)}let fm=/-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g,xN=be(m=>m.toString().replace(/\s/g,"").match(fm)||[]),N1=/(?:v[hw]|%)$/,sa=be(m=>(m.match(N1)||[])[0]);function yN(m,D){return m*ie(D)/100}let xc,ou;function S1(){return xc||(ou||(ou=vr("
    "),ke(ou,{height:"100vh",position:"fixed"}),jt(window,"resize",()=>xc=null)),Sn(document.body,ou),xc=ou.clientHeight,Ao(ou),xc)}let Zi={read:cm,write:Gd,clear:Vl,flush:E1},Wl=[],Uo=[];function cm(m){return Wl.push(m),Zd(),m}function Gd(m){return Uo.push(m),Zd(),m}function Vl(m){Xd(Wl,m),Xd(Uo,m)}let Yd=!1;function E1(){A1(Wl),A1(Uo.splice(0)),Yd=!1,(Wl.length||Uo.length)&&Zd()}function Zd(){Yd||(Yd=!0,queueMicrotask(E1))}function A1(m){let D;for(;D=m.shift();)try{D()}catch(_){console.error(_)}}function Xd(m,D){let _=m.indexOf(D);return~_&&m.splice(_,1)}class Kd{init(){this.positions=[];let D;this.unbind=jt(document,"mousemove",_=>D=dt(_)),this.interval=setInterval(()=>{D&&(this.positions.push(D),this.positions.length>5&&this.positions.shift())},50)}cancel(){var D;(D=this.unbind)==null||D.call(this),clearInterval(this.interval)}movesTo(D){if(!this.positions||this.positions.length<2)return!1;let _=Ht(D),{left:$,right:Q,top:ae,bottom:pe}=_,[Ne]=this.positions,Fe=De(this.positions),et=[Ne,Fe];return ze(Fe,_)?!1:[[{x:$,y:ae},{x:Q,y:pe}],[{x:$,y:pe},{x:Q,y:ae}]].some(ht=>{let Ot=wN(et,ht);return Ot&&ze(Ot,_)})}}function wN([{x:m,y:D},{x:_,y:$}],[{x:Q,y:ae},{x:pe,y:Ne}]){let Fe=(Ne-ae)*(_-m)-(pe-Q)*($-D);if(Fe===0)return!1;let et=((pe-Q)*(D-ae)-(Ne-ae)*(m-Q))/Fe;return et<0?!1:{x:m+et*(_-m),y:D+et*($-D)}}function C1(m,D,_={},{intersecting:$=!0}={}){let Q=new IntersectionObserver($?(ae,pe)=>{ae.some(Ne=>Ne.isIntersecting)&&D(ae,pe)}:D,_);for(let ae of Z(m))Q.observe(ae);return Q}let bN=J&&window.ResizeObserver;function yc(m,D,_={box:"border-box"}){if(bN)return Qd(ResizeObserver,m,D,_);let $=[jt(window,"load resize",D),jt(document,"loadedmetadata load",D,!0)];return{disconnect:()=>$.map(Q=>Q())}}function pm(m){return{disconnect:jt([window,window.visualViewport],"resize",m)}}function Jd(m,D,_){return Qd(MutationObserver,m,D,_)}function Qd(m,D,_,$){let Q=new m(_);for(let ae of Z(D))Q.observe(ae,$);return Q}function Gl(m){au(m)&&hm(m,{func:"playVideo",method:"play"}),mm(m)&&m.play()}function gs(m){au(m)&&hm(m,{func:"pauseVideo",method:"pause"}),mm(m)&&m.pause()}function M1(m){au(m)&&hm(m,{func:"mute",method:"setVolume",value:0}),mm(m)&&(m.muted=!0)}function T1(m){return mm(m)||au(m)}function mm(m){return jr(m,"video")}function au(m){return jr(m,"iframe")&&(Wn(m)||O1(m))}function Wn(m){return!!m.src.match(/\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\/.*/)}function O1(m){return!!m.src.match(/vimeo\.com\/video\/.*/)}async function hm(m,D){await DN(m),Yl(m,D)}function Yl(m,D){m.contentWindow.postMessage(JSON.stringify({event:"command",...D}),"*")}let jd="_ukPlayer",I1=0;function DN(m){if(m[jd])return m[jd];let D=Wn(m),_=O1(m),$=++I1,Q;return m[jd]=new Promise(ae=>{D&&Or(m,"load",()=>{let pe=()=>Yl(m,{event:"listening",id:$});Q=setInterval(pe,100),pe()}),Or(window,"message",ae,!1,({data:pe})=>{try{return pe=JSON.parse(pe),D&&pe?.id===$&&pe.event==="onReady"||_&&Number(pe?.player_id)===$}catch{}}),m.src=`${m.src}${f(m.src,"?")?"&":"?"}${D?"enablejsapi=1":`api=1&player_id=${$}`}`}).then(()=>clearInterval(Q))}function eg(m,D=0,_=0){return je(m)?Ee(...su(m).map($=>{let{top:Q,left:ae,bottom:pe,right:Ne}=Mo($);return{top:Q-D,left:ae-_,bottom:pe+D,right:Ne+_}}).concat(Dr(m))):!1}function tg(m,{offset:D=0}={}){let _=je(m)?Zu(m,!1,["hidden"]):[];return _.reduce((pe,Ne,Fe)=>{let{scrollTop:et,scrollHeight:it,offsetHeight:ht}=Ne,Ot=Mo(Ne),Ut=it-Ot.height,{height:lr,top:Ar}=_[Fe-1]?Mo(_[Fe-1]):Dr(m),Rr=Math.ceil(Ar-Ot.top-D+et);return D>0&&htUt?(D-=Rr-Ut,Rr=Ut):Rr<0&&(D-=Rr,Rr=0),()=>$(Ne,Rr-et,m,Ut).then(pe)},()=>Promise.resolve())();function $(pe,Ne,Fe,et){return new Promise(it=>{let ht=pe.scrollTop,Ot=Q(Math.abs(Ne)),Ut=Date.now(),lr=wc(pe)===pe,Ar=Dr(Fe).top+(lr?0:ht),Rr=0,xu=15;(function $m(){let Wm=ae(Oe((Date.now()-Ut)/Ot)),yu=0;_[0]===pe&&ht+Neke(pe,"position")==="fixed");return~ae&&(Q=Q.slice(ae)),[$].concat(Q.filter(pe=>ke(pe,"overflow").split(" ").some(Ne=>f(["auto","scroll",..._],Ne))&&(!D||pe.scrollHeight>Mo(pe).height))).reverse()}function vs(...m){return Zu(...m)[0]}function su(m){return Zu(m,!1,["hidden","clip"])}function Mo(m){let D=le(m),_=m===wc(m)?D:m;if(O(_)&&D.visualViewport){let{height:Q,width:ae,scale:pe,pageTop:Ne,pageLeft:Fe}=D.visualViewport;return Q=Math.round(Q*pe),ae=Math.round(ae*pe),{height:Q,width:ae,top:Ne,left:Fe,bottom:Ne+Q,right:Fe+ae}}let $=Dr(_);if(ke(_,"display")==="inline")return $;for(let[Q,ae,pe,Ne]of[["width","x","left","right"],["height","y","top","bottom"]]){O(_)?_=_.document:$[pe]+=ie(ke(_,`border-${pe}-width`));let Fe=$[Q]%1;$[Q]=$[ae]=_[`client${l(Q)}`]-(Fe?Fe<.5?-Fe:1-Fe:0),$[Ne]=$[Q]+$[pe]}return $}function Xu(m){let{left:D,width:_,top:$}=Ht(m);for(let Q of $?[0,$]:[0]){let ae;for(let pe of le(m).document.elementsFromPoint(D+_/2,Q))!pe.contains(m)&&!Be(pe,"uk-togglable-leave")&&(Zl(pe,"fixed")&&La(ao(m).reverse().find(Ne=>!Ne.contains(pe)&&!Zl(Ne,"static")))=Ot[it])continue;Ut=_1(m,D,_,Fe)[it]-$[it];let Ar=F1(m,D[Fe],ae,Fe);if(!To(rg($,Ut,Fe),Ar,Fe)){if(To($,Ar,Fe))continue;if(_.recursion)return!1;let Rr=k1(m,D,_);if(Rr&&To(Rr,Ar,1-Fe))return Rr;continue}}else if(pe[Fe]==="shift"){let lr=Dr(D[Fe]),{offset:Ar}=_;Ut=Oe(Oe($[it],Ot[it],Ot[ht]-$[et]),lr[it]-$[et]+Ar[Fe],lr[ht]-Ar[Fe])-$[it]}Ne=rg(Ne,Ut,Fe)}return Ne}function gm(m,D,_){let{attach:$,offset:Q}={attach:{element:["left","top"],target:["left","top"],..._.attach},offset:[0,0],..._},ae=Dr(m);for(let[pe,[Ne,,Fe,et]]of Object.entries(lo)){let it=$.target[pe]===$.element[pe]?Mo(D[pe]):Dr(D[pe]);ae=rg(ae,it[Fe]-ae[Fe]+ng($.target[pe],et,it[Ne])-ng($.element[pe],et,ae[Ne])+ +Q[pe],pe)}return ae}function rg(m,D,_){let[,$,Q,ae]=lo[_],pe={...m};return pe[Q]=m[$]=m[Q]+D,pe[ae]+=D,pe}function ng(m,D,_){return m==="center"?_/2:m===D?_:0}function NN(m,D,_,$,Q){let ae=Ku(...vm(m,D).map(Mo));return _&&(ae[lo[Q][2]]+=_,ae[lo[Q][3]]-=_),$&&(ae=Ku(ae,Dr(h($)?$[Q]:$))),ae}function F1(m,D,_,$){let[Q,ae,pe,Ne]=lo[$],[Fe]=vm(m,D),et=Mo(Fe);return["auto","scroll"].includes(ke(Fe,`overflow-${ae}`))&&(et[pe]-=Fe[`scroll${l(pe)}`],et[Ne]=et[pe]+Fe[`scroll${l(Q)}`]),et[pe]+=_,et[Ne]-=_,et}function vm(m,D){return su(D).filter(_=>_.contains(m))}function Ku(...m){let D={};for(let _ of m)for(let[,,$,Q]of lo)D[$]=Math.max(D[$]||0,_[$]),D[Q]=Math.min(...[D[Q],_[Q]].filter(Boolean));return D}function To(m,D,_){let[,,$,Q]=lo[_];return m[$]>=D[$]&&m[Q]<=D[Q]}function _1(m,D,{offset:_,attach:$},Q){return gm(m,D,{attach:{element:B1($.element,Q),target:B1($.target,Q)},offset:SN(_,Q)})}function k1(m,D,_){return uu(m,D,{..._,attach:{element:_.attach.element.map(L1).reverse(),target:_.attach.target.map(L1).reverse()},offset:_.offset.reverse(),placement:_.placement.reverse(),recursion:!0})}function B1(m,D){let _=[...m],$=lo[D].indexOf(m[D]);return~$&&(_[D]=lo[D][1-$%2+2]),_}function L1(m){for(let D=0;Ddocument,handler(){document.hidden?this.stop():this.start()}},methods:{start(){this.stop(),this.update(),this.timer||(qt(this.$el,"countdownstart"),this.timer=setInterval(this.update,1e3))},stop(){this.timer&&(clearInterval(this.timer),qt(this.$el,"countdownstop"),this.timer=null)},update(){let m=q1(this.date);m.total||(this.stop(),this.end||(qt(this.$el,"countdownend"),this.end=!0));for(let D of bc){let _=vr(this.clsWrapper.replace("%unit%",D),this.$el);if(!_)continue;let $=Math.trunc(m[D]).toString().padStart(2,"0");_.textContent!==$&&($=$.split(""),$.length!==_.children.length&&ds(_,$.map(()=>"").join("")),$.forEach((Q,ae)=>_.children[ae].textContent=Q))}}}};function q1(m){let D=Math.max(0,m-Date.now())/1e3;return{total:D,seconds:D%60,minutes:D/60%60,hours:D/60/60%24,days:D/60/60/24}}let Bn={};Bn.events=Bn.watch=Bn.observe=Bn.created=Bn.beforeConnect=Bn.connected=Bn.beforeDisconnect=Bn.disconnected=Bn.destroy=xm,Bn.args=function(m,D){return D!==!1&&xm(D||m)},Bn.update=function(m,D){return ce(xm(m,w(D)?{read:D}:D),"order")},Bn.props=function(m,D){if(h(D)){let _={};for(let $ of D)_[$]=String;D=_}return Bn.methods(m,D)},Bn.computed=Bn.methods=function(m,D){return D?m?{...m,...D}:D:m},Bn.i18n=Bn.data=function(m,D,_){return _?Dc(m,D,_):D?m?function($){return Dc(m,D,$)}:D:m};function Dc(m,D,_){return Bn.computed(w(m)?m.call(_,_):m,w(D)?D.call(_,_):D)}function xm(m,D){return m=m&&!h(m)?[m]:m,D?m?m.concat(D):h(D)?D:[D]:m}function ym(m,D){return V(D)?m:D}function Ki(m,D,_){let $={};if(w(D)&&(D=D.options),D.extends&&(m=Ki(m,D.extends,_)),D.mixins)for(let ae of D.mixins)m=Ki(m,ae,_);for(let ae in m)Q(ae);for(let ae in D)r(m,ae)||Q(ae);function Q(ae){$[ae]=(Bn[ae]||ym)(m[ae],D[ae],_)}return $}function Ju(m,D=[]){try{return m?a(m,"{")?JSON.parse(m):D.length&&!f(m,":")?{[D[0]]:m}:m.split(";").reduce((_,$)=>{let[Q,ae]=$.split(/:(.*)/);return Q&&!V(ae)&&(_[Q.trim()]=ae.trim()),_},{}):{}}catch{return{}}}function Nc(m,D){return m===Boolean?W(D):m===Number?ee(D):m==="list"?z1(D):m===Object&&R(D)?Ju(D):m?m(D):D}let ig=/,(?![^(]*\))/;function z1(m){return h(m)?m:R(m)?m.split(ig).map(D=>U(D)?ee(D):W(D.trim())):[m]}function U1(m){m._data={},m._updates=[...m.$options.update||[]]}function og(m,D){m._updates.unshift(D)}function EN(m){m._data=null}function Sc(m,D="update"){m._connected&&m._updates.length&&(m._queued||(m._queued=new Set,Zi.read(()=>{m._connected&&AN(m,m._queued),m._queued=null})),m._queued.add(D.type||D))}function AN(m,D){for(let{read:_,write:$,events:Q=[]}of m._updates){if(!D.has("update")&&!Q.some(pe=>D.has(pe)))continue;let ae;_&&(ae=_.call(m,m._data,D),ae&&S(ae)&&b(m._data,ae)),$&&ae!==!1&&Zi.write(()=>{m._connected&&$.call(m,m._data,D)})}}function li(m){return fa(yc,m,"resize")}function la(m){return fa(C1,m)}function xs(m){return fa(Jd,m)}function Xl(m={}){return la({handler:function(D,_){let{targets:$=this.$el,preload:Q=5}=m;for(let ae of Z(w($)?$(this):$))tn('[loading="lazy"]',ae).slice(0,Q-1).forEach(pe=>Pt(pe,"loading"));for(let ae of D.filter(({isIntersecting:pe})=>pe).map(({target:pe})=>pe))_.unobserve(ae)},...m})}function Ec(m){return fa((D,_)=>pm(_),m,"resize")}function Kl(m){return fa((D,_)=>({disconnect:jt(Ji(D),"scroll",_,{passive:!0})}),m,"scroll")}function wm(m){return{observe(D,_){return{observe:He,unobserve:He,disconnect:jt(D,ye,_,{passive:!0})}},handler(D){if(!st(D))return;let _=dt(D),$="tagName"in D.target?D.target:Gt(D.target);Or(document,`${Je} ${pt} scroll`,Q=>{let{x:ae,y:pe}=dt(Q);(Q.type!=="scroll"&&$&&ae&&Math.abs(_.x-ae)>100||pe&&Math.abs(_.y-pe)>100)&&setTimeout(()=>{qt($,"swipe"),qt($,`swipe${Qu(_.x,_.y,ae,pe)}`)})})},...m}}function fa(m,D,_){return{observe:m,handler(){Sc(this,_)},...D}}function Qu(m,D,_,$){return Math.abs(m-_)>=Math.abs(D-$)?m-_>0?"Left":"Right":D-$>0?"Up":"Down"}function Ji(m){return Z(m).map(D=>{let{ownerDocument:_}=D,$=vs(D,!0);return $===_.scrollingElement?_:$})}var ys={props:{margin:String,firstColumn:Boolean},data:{margin:"uk-margin-small-top",firstColumn:"uk-first-column"},observe:[xs({options:{childList:!0}}),xs({options:{attributes:!0,attributeFilter:["style"]},target:({$el:m})=>[m,...Er(m)]}),li({target:({$el:m})=>[m,...Er(m)]})],update:{read(){return{rows:Pa(Er(this.$el))}},write({rows:m}){for(let D of m)for(let _ of D)Ke(_,this.margin,m[0]!==D),Ke(_,this.firstColumn,D[j?D.length-1:0]===_)},events:["resize"]}};function Pa(m){let D=[[]],_=m.some(($,Q)=>Q&&m[Q-1].offsetParent!==$.offsetParent);for(let $ of m){if(!je($))continue;let Q=Jl($,_);for(let ae=D.length-1;ae>=0;ae--){let pe=D[ae];if(!pe[0]){pe.push($);break}let Ne=Jl(pe[0],_);if(Q.top>=Ne.bottom-1&&Q.top!==Ne.top){D.push([$]);break}if(Q.bottom-1>Ne.top||Q.top===Ne.top){let Fe=pe.length-1;for(;Fe>=0;Fe--){let et=Jl(pe[Fe],_);if(Q.left>=et.left)break}pe.splice(Fe+1,0,$);break}if(ae===0){D.unshift([$]);break}}}return D}function Jl(m,D=!1){let{offsetTop:_,offsetLeft:$,offsetHeight:Q,offsetWidth:ae}=m;return D&&([_,$]=$l(m)),{top:_,left:$,bottom:_+Q,right:$+ae}}async function CN(m,D,_){await Ql();let $=Er(D),Q=$.map(Ut=>ag(Ut,!0)),ae={...ke(D,["height","padding"]),display:"block"},pe=$.concat(D);await Promise.all(pe.map(Tt.cancel)),ke(pe,"transitionProperty","none"),await m(),$=$.concat(Er(D).filter(Ut=>!f($,Ut))),await Promise.resolve(),ke(pe,"transitionProperty","");let Ne=Qe(D,"style"),Fe=ke(D,["height","padding"]),[et,it]=Ac(D,$,Q),ht=$.map(Ut=>({style:Qe(Ut,"style")}));$.forEach((Ut,lr)=>it[lr]&&ke(Ut,it[lr])),ke(D,ae),qt(D,"scroll"),await Ql();let Ot=$.map((Ut,lr)=>Gt(Ut)===D&&Tt.start(Ut,et[lr],_,"ease")).concat(Tt.start(D,Fe,_,"ease"));try{await Promise.all(Ot),$.forEach((Ut,lr)=>{Qe(Ut,ht[lr]),Gt(Ut)===D&&ke(Ut,"display",et[lr].opacity===0?"none":"")}),Qe(D,"style",Ne)}catch{Qe($,"style",""),H1(D,ae)}}function ag(m,D){let _=ke(m,"zIndex");return je(m)?{display:"",opacity:D?ke(m,"opacity"):"0",pointerEvents:"none",position:"absolute",zIndex:_==="auto"?_n(m):_,...bm(m)}:!1}function Ac(m,D,_){let $=D.map((ae,pe)=>Gt(ae)&&pe in _?_[pe]?je(ae)?bm(ae):{opacity:0}:{opacity:je(ae)?1:0}:!1),Q=$.map((ae,pe)=>{let Ne=Gt(D[pe])===m&&(_[pe]||ag(D[pe]));if(!Ne)return!1;if(!ae)delete Ne.opacity;else if(!("opacity"in ae)){let{opacity:Fe}=Ne;Fe%1?ae.opacity=1:delete Ne.opacity}return Ne});return[$,Q]}function H1(m,D){for(let _ in D)ke(m,_,"")}function bm(m){let{height:D,width:_}=Ht(m);return{height:D,width:_,transform:"",...Vd(m),...ke(m,["marginTop","marginLeft"])}}function Ql(){return new Promise(m=>requestAnimationFrame(m))}let sg="uk-transition-leave",Cc="uk-transition-enter";function ug(m,D,_,$=0){let Q=jl(D,!0),ae={opacity:1},pe={opacity:0},Ne=it=>()=>Q===jl(D)?it():Promise.reject(),Fe=Ne(async()=>{Ue(D,sg),await Promise.all(ju(D).map((it,ht)=>new Promise(Ot=>setTimeout(()=>Tt.start(it,pe,_/2,"ease").then(Ot),ht*$)))),ge(D,sg)}),et=Ne(async()=>{let it=Yi(D);Ue(D,Cc),m(),ke(Er(D),{opacity:0}),await Ql();let ht=Er(D),Ot=Yi(D);ke(D,"alignContent","flex-start"),Yi(D,it);let Ut=ju(D);ke(ht,pe);let lr=Ut.map(async(Ar,Rr)=>{await Nm(Rr*$),await Tt.start(Ar,ae,_/2,"ease")});it!==Ot&&lr.push(Tt.start(D,{height:Ot},_/2+Ut.length*$,"ease")),await Promise.all(lr).then(()=>{ge(D,Cc),Q===jl(D)&&(ke(D,{height:"",alignContent:""}),ke(ht,{opacity:""}),delete D.dataset.transition)})});return Be(D,sg)?Dm(D).then(et):Be(D,Cc)?Dm(D).then(Fe).then(et):Fe().then(et)}function jl(m,D){return D&&(m.dataset.transition=1+jl(m)),ee(m.dataset.transition)||0}function Dm(m){return Promise.all(Er(m).filter(Tt.inProgress).map(D=>new Promise(_=>Or(D,"transitionend transitioncanceled",_))))}function ju(m){return Pa(Er(m)).flat().filter(je)}function Nm(m){return new Promise(D=>setTimeout(D,m))}var lg={props:{duration:Number,animation:Boolean},data:{duration:150,animation:"slide"},methods:{animate(m,D=this.$el){let _=this.animation;return(_==="fade"?ug:_==="delayed-fade"?(...Q)=>ug(...Q,40):_?CN:()=>(m(),Promise.resolve()))(m,D,this.duration).catch(He)}}};let Ir={TAB:9,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};var MN={mixins:[lg],args:"target",props:{target:String,selActive:Boolean},data:{target:"",selActive:!1,attrItem:"uk-filter-control",cls:"uk-active",duration:250},computed:{children:({target:m},D)=>tn(`${m} > *`,D),toggles:({attrItem:m},D)=>tn(`[${m}],[data-${m}]`,D)},watch:{toggles(m){this.updateState();let D=tn(this.selActive,this.$el);for(let _ of m){this.selActive!==!1&&Ke(_,this.cls,f(D,_));let $=ON(_);jr($,"a")&&Qe($,"role","button")}},children(m,D){D&&this.updateState()}},events:{name:"click keydown",delegate:({attrItem:m})=>`[${m}],[data-${m}]`,handler(m){m.type==="keydown"&&m.keyCode!==Ir.SPACE||m.target.closest("a,button")&&(m.preventDefault(),this.apply(m.current))}},methods:{apply(m){let D=this.getState(),_=Sm(m,this.attrItem,this.getState());TN(D,_)||this.setState(_)},getState(){return this.toggles.filter(m=>Be(m,this.cls)).reduce((m,D)=>Sm(D,this.attrItem,m),{filter:{"":""},sort:[]})},async setState(m,D=!0){m={filter:{"":""},sort:[],...m},qt(this.$el,"beforeFilter",[this,m]);for(let _ of this.toggles)Ke(_,this.cls,ef(_,this.attrItem,m));await Promise.all(tn(this.target,this.$el).map(_=>{let $=()=>fg(m,_,Er(_));return D?this.animate($,_):$()})),qt(this.$el,"afterFilter",[this])},updateState(){Zi.write(()=>this.setState(this.getState(),!1))}}};function $1(m,D){return Ju(fe(m,D),["filter"])}function TN(m,D){return["filter","sort"].every(_=>re(m[_],D[_]))}function fg(m,D,_){let $=Object.values(m.filter).join("");for(let pe of _)ke(pe,"display",$&&!rr(pe,$)?"none":"");let[Q,ae]=m.sort;if(Q){let pe=Mc(_,Q,ae);re(pe,_)||Sn(D,pe)}}function Sm(m,D,_){let{filter:$,group:Q,sort:ae,order:pe="asc"}=$1(m,D);return($||V(ae))&&(Q?$?(delete _.filter[""],_.filter[Q]=$):(delete _.filter[Q],(H(_.filter)||""in _.filter)&&(_.filter={"":$||""})):_.filter={"":$||""}),V(ae)||(_.sort=[ae,pe]),_}function ef(m,D,{filter:_={"":""},sort:[$,Q]}){let{filter:ae="",group:pe="",sort:Ne,order:Fe="asc"}=$1(m,D);return V(Ne)?pe in _&&ae===_[pe]||!ae&&pe&&!(pe in _)&&!_[""]:$===Ne&&Q===Fe}function Mc(m,D,_){return[...m].sort(($,Q)=>fe($,D).localeCompare(fe(Q,D),void 0,{numeric:!0})*(_==="asc"||-1))}function ON(m){return vr("a,button",m)||m}let tf;function cg(m){let D=jt(m,"touchstart",$=>{if($.targetTouches.length!==1||rr($.target,'input[type="range"'))return;let Q=dt($).y,ae=jt(m,"touchmove",pe=>{let Ne=dt(pe).y;Ne!==Q&&(Q=Ne,Zu(pe.target).some(Fe=>{if(!m.contains(Fe))return!1;let{scrollHeight:et,clientHeight:it}=Fe;return it{tf=!1,D(),ke(_,{overflowY:"",touchAction:"",paddingRight:""})}}var ws={props:{container:Boolean},data:{container:!0},computed:{container({container:m}){return m===!0&&this.$container||m&&vr(m)}}},lu={props:{cls:Boolean,animation:"list",duration:Number,velocity:Number,origin:String,transition:String},data:{cls:!1,animation:[!1],duration:200,velocity:.2,origin:!1,transition:"ease",clsEnter:"uk-togglable-enter",clsLeave:"uk-togglable-leave"},computed:{hasAnimation:({animation:m})=>!!m[0],hasTransition:({animation:m})=>["slide","reveal"].some(D=>a(m[0],D))},methods:{async toggleElement(m,D,_){try{return await Promise.all(Z(m).map($=>{let Q=P(D)?D:!this.isToggled($);if(!qt($,`before${Q?"show":"hide"}`,[this]))return Promise.reject();let ae=(w(_)?_:_===!1||!this.hasAnimation?el:this.hasTransition?Tc:tl)($,Q,this),pe=Q?this.clsEnter:this.clsLeave;Ue($,pe),qt($,Q?"show":"hide",[this]);let Ne=()=>{ge($,pe),qt($,Q?"shown":"hidden",[this])};return ae?ae.then(Ne,()=>(ge($,pe),Promise.reject())):Ne()})),!0}catch{return!1}},isToggled(m=this.$el){return m=Y(m),Be(m,this.clsEnter)?!0:Be(m,this.clsLeave)?!1:this.cls?Be(m,this.cls.split(" ")[0]):je(m)},_toggle(m,D){if(!m)return;D=!!D;let _;this.cls?(_=f(this.cls," ")||D!==Be(m,this.cls),_&&Ke(m,this.cls,f(this.cls," ")?void 0:D)):(_=D===m.hidden,_&&(m.hidden=!D)),tn("[autofocus]",m).some($=>je($)?$.focus()||!0:$.blur()),_&&qt(m,"toggled",[D,this])}}};function el(m,D,{_toggle:_}){return hs.cancel(m),Tt.cancel(m),_(m,D)}async function Tc(m,D,{animation:_,duration:$,velocity:Q,transition:ae,_toggle:pe}){var Ne;let[Fe="reveal",et="top"]=((Ne=_[0])==null?void 0:Ne.split("-"))||[],it=[["left","right"],["top","bottom"]],ht=it[f(it[0],et)?0:1],Ot=ht[1]===et,lr=["width","height"][it.indexOf(ht)],Ar=`margin-${ht[0]}`,Rr=`margin-${et}`,xu=Ht(m)[lr],$m=Tt.inProgress(m);await Tt.cancel(m),D&&pe(m,!0);let Wm=Object.fromEntries(["padding","border","width","height","minWidth","minHeight","overflowY","overflowX",Ar,Rr].map(wO=>[wO,m.style[wO]])),yu=Ht(m),xS=ie(ke(m,Ar)),vO=ie(ke(m,Rr)),rp=yu[lr]+vO;!$m&&!D&&(xu+=vO);let[Rx]=lm(m,"
    ");ke(Rx,{boxSizing:"border-box",height:yu.height,width:yu.width,...ke(m,["overflow","padding","borderTop","borderRight","borderBottom","borderLeft","borderImage",Rr])}),ke(m,{padding:0,border:0,minWidth:0,minHeight:0,[Rr]:0,width:yu.width,height:yu.height,overflow:"hidden",[lr]:xu});let xO=xu/rp;$=(Q*rp+$)*(D?1-xO:xO);let yO={[lr]:D?rp:0};Ot&&(ke(m,Ar,rp-xu+xS),yO[Ar]=D?xS:rp+xS),!Ot^Fe==="reveal"&&(ke(Rx,Ar,-rp+xu),Tt.start(Rx,{[Ar]:D?0:-rp},$,ae));try{await Tt.start(m,yO,$,ae)}finally{ke(m,Wm),Co(Rx.firstChild),D||pe(m,!1)}}function tl(m,D,_){let{animation:$,duration:Q,_toggle:ae}=_;return D?(ae(m,!0),hs.in(m,$[0],Q,_.origin)):hs.out(m,$[1]||$[0],Q,_.origin).then(()=>ae(m,!1))}let fi=[];var fu={mixins:[Xi,ws,lu],props:{selPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean,role:String},data:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1,role:"dialog"},computed:{panel:({selPanel:m},D)=>vr(m,D),transitionElement(){return this.panel},bgClose({bgClose:m}){return m&&this.panel}},connected(){Qe(this.panel||this.$el,"role",this.role),this.overlay&&Qe(this.panel||this.$el,"aria-modal",!0)},beforeDisconnect(){f(fi,this)&&this.toggleElement(this.$el,!1,!1)},events:[{name:"click",delegate:({selClose:m})=>`${m},a[href*="#"]`,handler(m){let{current:D,defaultPrevented:_}=m,{hash:$}=D;!_&&$&&_a(D)&&!this.$el.contains(vr($))?this.hide():rr(D,this.selClose)&&(m.preventDefault(),this.hide())}},{name:"toggle",self:!0,handler(m){m.defaultPrevented||(m.preventDefault(),this.isToggled()===f(fi,this)&&this.toggle())}},{name:"beforeshow",self:!0,handler(m){if(f(fi,this))return!1;!this.stack&&fi.length?(Promise.all(fi.map(D=>D.hide())).then(this.show),m.preventDefault()):fi.push(this)}},{name:"show",self:!0,handler(){this.stack&&ke(this.$el,"zIndex",ie(ke(this.$el,"zIndex"))+fi.length);let m=[this.overlay&&V1(this),this.overlay&&cg(this.$el),this.bgClose&&IN(this),this.escClose&&rl(this)];Or(this.$el,"hidden",()=>m.forEach(D=>D&&D()),{self:!0}),Ue(document.documentElement,this.clsPage)}},{name:"shown",self:!0,handler(){Gr(this.$el)||Qe(this.$el,"tabindex","-1"),rr(this.$el,":focus-within")||this.$el.focus()}},{name:"hidden",self:!0,handler(){f(fi,this)&&fi.splice(fi.indexOf(this),1),ke(this.$el,"zIndex",""),fi.some(m=>m.clsPage===this.clsPage)||ge(document.documentElement,this.clsPage)}}],methods:{toggle(){return this.isToggled()?this.hide():this.show()},show(){return this.container&&Gt(this.$el)!==this.container?(Sn(this.container,this.$el),new Promise(m=>requestAnimationFrame(()=>this.show().then(m)))):this.toggleElement(this.$el,!0,pg)},hide(){return this.toggleElement(this.$el,!1,pg)}}};function pg(m,D,{transitionElement:_,_toggle:$}){return new Promise((Q,ae)=>Or(m,"show hide",()=>{var pe;(pe=m._reject)==null||pe.call(m),m._reject=ae,$(m,D);let Ne=Or(_,"transitionstart",()=>{Or(_,"transitionend transitioncancel",Q,{self:!0}),clearTimeout(Fe)},{self:!0}),Fe=setTimeout(()=>{Ne(),Q()},W1(ke(_,"transitionDuration")))})).then(()=>delete m._reject)}function W1(m){return m?s(m,"ms")?ie(m):ie(m)*1e3:0}function V1(m){return jt(document,"focusin",D=>{De(fi)===m&&!m.$el.contains(D.target)&&m.$el.focus()})}function IN(m){return jt(document,ye,({target:D})=>{De(fi)!==m||m.overlay&&!m.$el.contains(D)||m.panel.contains(D)||Or(document,`${Je} ${pt} scroll`,({defaultPrevented:_,type:$,target:Q})=>{!_&&$===Je&&D===Q&&m.hide()},!0)})}function rl(m){return jt(document,"keydown",D=>{D.keyCode===27&&De(fi)===m&&m.hide()})}var bs={slide:{show(m){return[{transform:En(m*-100)},{transform:En()}]},percent(m){return Oc(m)},translate(m,D){return[{transform:En(D*-100*m)},{transform:En(D*100*(1-m))}]}}};function Oc(m){return Math.abs(new DOMMatrix(ke(m,"transform")).m41/m.offsetWidth)}function En(m=0,D="%"){return m+=m?D:"",`translate3d(${m}, 0, 0)`}function rf(m){return`scale3d(${m}, ${m}, 1)`}function FN(m,D,_,{animation:$,easing:Q}){let{percent:ae,translate:pe,show:Ne=He}=$,Fe=Ne(_),{promise:et,resolve:it}=G1();return{dir:_,show(ht,Ot=0,Ut){let lr=Ut?"linear":Q;return ht-=Math.round(ht*Oe(Ot,-1,1)),this.translate(Ot),nl(D,"itemin",{percent:Ot,duration:ht,timing:lr,dir:_}),nl(m,"itemout",{percent:1-Ot,duration:ht,timing:lr,dir:_}),Promise.all([Tt.start(D,Fe[1],ht,lr),Tt.start(m,Fe[0],ht,lr)]).then(()=>{this.reset(),it()},He),et},cancel(){return Tt.cancel([D,m])},reset(){for(let ht in Fe[0])ke([D,m],ht,"")},async forward(ht,Ot=this.percent()){return await this.cancel(),this.show(ht,Ot,!0)},translate(ht){this.reset();let Ot=pe(ht,_);ke(D,Ot[1]),ke(m,Ot[0]),nl(D,"itemtranslatein",{percent:ht,dir:_}),nl(m,"itemtranslateout",{percent:1-ht,dir:_})},percent(){return ae(m||D,D,_)},getDistance(){return m?.offsetWidth}}}function nl(m,D,_){qt(m,Eo(D,!1,!1,_))}function G1(){let m;return{promise:new Promise(D=>m=D),resolve:m}}var bi={props:{i18n:Object},data:{i18n:null},methods:{t(m,...D){var _,$,Q;let ae=0;return((Q=((_=this.i18n)==null?void 0:_[m])||(($=this.$options.i18n)==null?void 0:$[m]))==null?void 0:Q.replace(/%s/g,()=>D[ae++]||""))||""}}},oi={props:{autoplay:Boolean,autoplayInterval:Number,pauseOnHover:Boolean},data:{autoplay:!1,autoplayInterval:7e3,pauseOnHover:!0},connected(){Qe(this.list,"aria-live",this.autoplay?"off":"polite"),this.autoplay&&this.startAutoplay()},disconnected(){this.stopAutoplay()},update(){Qe(this.slides,"tabindex","-1")},events:[{name:"visibilitychange",el:()=>document,filter:({autoplay:m})=>m,handler(){document.hidden?this.stopAutoplay():this.startAutoplay()}}],methods:{startAutoplay(){this.stopAutoplay(),this.interval=setInterval(()=>{this.stack.length||this.draggable&&rr(this.$el,":focus-within")&&!rr(this.$el,":focus")||this.pauseOnHover&&rr(this.$el,":hover")||this.show("next")},this.autoplayInterval)},stopAutoplay(){clearInterval(this.interval)}}};let Vn={passive:!1,capture:!0},Gn={passive:!0,capture:!0},Ic="touchstart mousedown",mg="touchmove mousemove",Fc="touchend touchcancel mouseup click input scroll",Y1=m=>m.preventDefault();var _N={props:{draggable:Boolean},data:{draggable:!0,threshold:10},created(){for(let m of["start","move","end"]){let D=this[m];this[m]=_=>{let $=dt(_).x*(j?-1:1);this.prevPos=$===this.pos?this.prevPos:this.pos,this.pos=$,D(_)}}},events:[{name:Ic,passive:!0,delegate:({selList:m})=>`${m} > *`,handler(m){!this.draggable||this.parallax||!st(m)&&hg(m.target)||m.target.closest(wt)||m.button>0||this.length<2||this.start(m)}},{name:"dragstart",handler(m){m.preventDefault()}},{name:mg,el:({list:m})=>m,handler:He,...Vn}],methods:{start(){this.drag=this.pos,this._transitioner?(this.percent=this._transitioner.percent(),this.drag+=this._transitioner.getDistance()*this.percent*this.dir,this._transitioner.cancel(),this._transitioner.translate(this.percent),this.dragging=!0,this.stack=[]):this.prevIndex=this.index,jt(document,mg,this.move,Vn),jt(document,Fc,this.end,Gn),ke(this.list,"userSelect","none")},move(m){let D=this.pos-this.drag;if(D===0||this.prevPos===this.pos||!this.dragging&&Math.abs(D)pe;)this.drag-=pe*this.dir,$=ae,Q-=pe,ae=this.getIndex($+this.dir),pe=Z1.call(this,$,ae);this.percent=Q/pe;let Ne=_[$],Fe=_[ae],et=this.index!==ae,it=$===ae,ht;for(let Ot of[this.index,this.prevIndex])f([ae,$],Ot)||(qt(_[Ot],"itemhidden",[this]),it&&(ht=!0,this.prevIndex=$));(this.index===$&&this.prevIndex!==$||ht)&&qt(_[this.index],"itemshown",[this]),et&&(this.prevIndex=$,this.index=ae,it||(qt(Ne,"beforeitemhide",[this]),qt(Ne,"itemhide",[this])),qt(Fe,"beforeitemshow",[this]),qt(Fe,"itemshow",[this])),this._transitioner=this._translate(Math.abs(this.percent),Ne,!it&&Fe)},end(){if(Gi(document,mg,this.move,Vn),Gi(document,Fc,this.end,Gn),this.dragging)if(this.dragging=null,this.index===this.prevIndex)this.percent=1-this.percent,this.dir*=-1,this._show(!1,this.index,!0),this._transitioner=null;else{let m=(j?this.dir*(j?1:-1):this.dir)<0==this.prevPos>this.pos;this.index=m?this.index:this.prevIndex,m&&(this.percent=1-this.percent),this.show(this.dir>0&&!m||this.dir<0&&m?"next":"previous",!0)}setTimeout(()=>Gi(this.list,"click",Y1,Vn)),ke(this.list,{userSelect:""}),this.drag=this.percent=null}}};function Z1(m,D){return this._getTransitioner(m,m!==D&&D).getDistance()||this.slides[m].offsetWidth}function hg(m){return ke(m,"userSelect")!=="none"&&y(m.childNodes).some(D=>D.nodeType===3&&D.textContent.trim())}function X1(m){m._watches=[];for(let D of m.$options.watch||[])for(let[_,$]of Object.entries(D))Em(m,$,_);m._initial=!0}function Em(m,D,_){m._watches.push({name:_,...S(D)?D:{handler:D}})}function kN(m,D){for(let{name:_,handler:$,immediate:Q=!0}of m._watches)(m._initial&&Q||r(D,_)&&!re(D[_],m[_]))&&$.call(m,m[_],D[_]);m._initial=!1}function dg(m){let{computed:D}=m.$options;if(m._computed={},D)for(let _ in D)gg(m,_,D[_])}let Am={subtree:!0,childList:!0};function gg(m,D,_){m._hasComputed=!0,Object.defineProperty(m,D,{enumerable:!0,get(){let{_computed:$,$props:Q,$el:ae}=m;if(!r($,D)&&($[D]=(_.get||_).call(m,Q,ae),_.observe&&m._computedObserver)){let pe=_.observe.call(m,Q);m._computedObserver.observe(["~","+","-"].includes(pe[0])?ae.parentElement:ae.getRootNode(),Am)}return $[D]},set($){let{_computed:Q}=m;Q[D]=_.set?_.set.call(m,$):$,V(Q[D])&&delete Q[D]}})}function K1(m){m._hasComputed&&(og(m,{read:()=>kN(m,xg(m)),events:["resize","computed"]}),m._computedObserver=Jd(m.$el,()=>Sc(m,"computed"),Am))}function vg(m){var D;(D=m._computedObserver)==null||D.disconnect(),delete m._computedObserver,xg(m)}function xg(m){let D={...m._computed};return m._computed={},D}function _c(m){m._events=[];for(let D of m.$options.events||[])if(r(D,"handler"))kc(m,D);else for(let _ in D)kc(m,D[_],_)}function BN(m){m._events.forEach(D=>D()),delete m._events}function kc(m,D,_){let{name:$,el:Q,handler:ae,capture:pe,passive:Ne,delegate:Fe,filter:et,self:it}=S(D)?D:{name:_,handler:D};Q=w(Q)?Q.call(m,m):Q||m.$el,!(!Q||h(Q)&&!Q.length||et&&!et.call(m,m))&&m._events.push(jt(Q,$,Fe?R(Fe)?Fe:Fe.call(m,m):null,R(ae)?m[ae]:ae.bind(m),{passive:Ne,capture:pe,self:it}))}function Ds(m){m._observers=[];for(let D of m.$options.observe||[])J1(m,D)}function yg(m,...D){m._observers.push(...D)}function LN(m){for(let D of m._observers)D.disconnect()}function J1(m,D){let{observe:_,target:$=m.$el,handler:Q,options:ae,filter:pe,args:Ne}=D;if(pe&&!pe.call(m,m))return;let Fe=`_observe${m._observers.length}`;w($)&&!r(m,Fe)&&gg(m,Fe,()=>{let ht=$.call(m,m);return h(ht)?Z(ht):ht}),Q=R(Q)?m[Q]:Q.bind(m),w(ae)&&(ae=ae.call(m,m));let et=r(m,Fe)?m[Fe]:$,it=_(et,Q,ae,Ne);w($)&&h(m[Fe])&&Em(m,{handler:Oo(it,ae),immediate:!1},Fe),yg(m,it)}function Oo(m,D){return(_,$)=>{for(let Q of $)f(_,Q)||(m.unobserve?m.unobserve(Q):m.observe&&m.disconnect());for(let Q of _)(!f($,Q)||!m.unobserve)&&m.observe(Q,D)}}function Br(m){let{$options:D,$props:_}=m,$=Ho(D);b(_,$);let{computed:Q,methods:ae}=D;for(let pe in _)pe in $&&(!Q||!r(Q,pe))&&(!ae||!r(ae,pe))&&(m[pe]=_[pe])}function Ho(m){let D={},{args:_=[],props:$={},el:Q,id:ae}=m;if(!$)return D;for(let Ne in $){let Fe=i(Ne),et=fe(Q,Fe);V(et)||(et=$[Ne]===Boolean&&et===""?!0:Nc($[Ne],et),!(Fe==="target"&&a(et,"_"))&&(D[Ne]=et))}let pe=Ju(fe(Q,ae),_);for(let Ne in pe){let Fe=u(Ne);V($[Fe])||(D[Fe]=Nc($[Fe],pe[Ne]))}return D}let cu=be((m,D)=>{let _=Object.keys(D),$=_.concat(m).map(Q=>[i(Q),`data-${i(Q)}`]).flat();return{attributes:_,filter:$}});function pu(m){let{$options:D,$props:_}=m,{id:$,props:Q,el:ae}=D;if(!Q)return;let{attributes:pe,filter:Ne}=cu($,Q),Fe=new MutationObserver(et=>{let it=Ho(D);et.some(({attributeName:ht})=>{let Ot=ht.replace("data-","");return(Ot===$?pe:[u(Ot),u(ht)]).some(Ut=>!V(it[Ut])&&it[Ut]!==_[Ut])})&&m.$reset()});Fe.observe(ae,{attributes:!0,attributeFilter:Ne}),yg(m,Fe)}function il(m,D){var _;(_=m.$options[D])==null||_.forEach($=>$.call(m))}function Bc(m){m._connected||(Br(m),il(m,"beforeConnect"),m._connected=!0,_c(m),U1(m),X1(m),Ds(m),pu(m),K1(m),il(m,"connected"),Sc(m))}function Cm(m){m._connected&&(il(m,"beforeDisconnect"),BN(m),EN(m),LN(m),vg(m),il(m,"disconnected"),m._connected=!1)}let PN=0;function Mm(m,D={}){D.data=wg(D,m.constructor.options),m.$options=Ki(m.constructor.options,D,m),m.$props={},m._uid=PN++,Lc(m),Q1(m),dg(m),il(m,"created"),D.el&&m.$mount(D.el)}function Lc(m){let{data:D={}}=m.$options;for(let _ in D)m.$props[_]=m[_]=D[_]}function Q1(m){let{methods:D}=m.$options;if(D)for(let _ in D)m[_]=D[_].bind(m)}function wg({data:m={}},{args:D=[],props:_={}}){h(m)&&(m=m.slice(0,D.length).reduce(($,Q,ae)=>(S(Q)?b($,Q):$[D[ae]]=Q,$),{}));for(let $ in m)V(m[$])?delete m[$]:_[$]&&(m[$]=Nc(_[$],m[$]));return m}let Yn=function(m){Mm(this,m)};Yn.util=P1,Yn.options={},Yn.version="3.21.5";let j1="uk-",mu="__uikit__",nf={};function Pc(m,D){var _,$;let Q=j1+i(m);if(!D)return nf[Q].options||(nf[Q]=Yn.extend(nf[Q])),nf[Q];m=u(m),Yn[m]=(pe,Ne)=>ol(m,pe,Ne);let ae=(_=D.options)!=null?_:{...D};return ae.id=Q,ae.name=m,($=ae.install)==null||$.call(ae,Yn,ae,m),Yn._initialized&&!ae.functional&&requestAnimationFrame(()=>ol(m,`[${Q}],[data-${Q}]`)),nf[Q]=ae}function ol(m,D,_,...$){let Q=Pc(m);return Q.options.functional?new Q({data:S(D)?D:[D,_,...$]}):D?ni(D).map(ae)[0]:ae();function ae(pe){let Ne=Tm(pe,m);if(Ne)if(_)Ne.$destroy();else return Ne;return new Q({el:pe,data:_})}}function of(m){return m?.[mu]||{}}function Tm(m,D){return of(m)[D]}function ex(m,D){m[mu]||(m[mu]={}),m[mu][D.$options.name]=D}function RN(m,D){var _;(_=m[mu])==null||delete _[D.$options.name],H(m[mu])&&delete m[mu]}function qN(m){m.component=Pc,m.getComponents=of,m.getComponent=Tm,m.update=Rc,m.use=function(_){if(!_.installed)return _.call(null,this),_.installed=!0,this},m.mixin=function(_,$){$=(R($)?this.component($):$)||this,$.options=Ki($.options,_)},m.extend=function(_){_||(_={});let $=this,Q=function(pe){Mm(this,pe)};return Q.prototype=Object.create($.prototype),Q.prototype.constructor=Q,Q.options=Ki($.options,_),Q.super=$,Q.extend=$.extend,Q};let D;Object.defineProperty(m,"container",{get(){return D||document.body},set(_){D=vr(_)}})}function Rc(m,D){m=m?Y(m):document.body;for(let _ of ao(m).reverse())bg(_,D);zo(m,_=>bg(_,D))}function bg(m,D){let _=of(m);for(let $ in _)Sc(_[$],D)}function zN(m){m.prototype.$mount=function(D){let _=this;ex(D,_),_.$options.el=D,document.contains(D)&&Bc(_)},m.prototype.$destroy=function(D=!1){let _=this,{el:$}=_.$options;$&&Cm(_),il(_,"destroy"),RN($,_),D&&Ao(_.$el)},m.prototype.$create=ol,m.prototype.$emit=function(D){Sc(this,D)},m.prototype.$update=function(D=this.$el,_){Rc(D,_)},m.prototype.$reset=function(){Cm(this),Bc(this)},m.prototype.$getComponent=Tm,Object.defineProperties(m.prototype,{$el:{get(){return this.$options.el}},$container:Object.getOwnPropertyDescriptor(m,"container")})}let UN=1;function hu(m,D=null){return D?.id||`${m.$options.id}-${UN++}`}var af={i18n:{next:"Next slide",previous:"Previous slide",slideX:"Slide %s",slideLabel:"%s of %s",role:"String"},data:{selNav:!1,role:"region"},computed:{nav:({selNav:m},D)=>vr(m,D),navChildren(){return Er(this.nav)},selNavItem:({attrItem:m})=>`[${m}],[data-${m}]`,navItems(m,D){return tn(this.selNavItem,D)}},watch:{nav(m,D){Qe(m,"role","tablist"),this.padNavitems(),D&&this.$emit()},list(m){jr(m,"ul")&&Qe(m,"role","presentation")},navChildren(m){Qe(m,"role","presentation"),this.padNavitems(),this.updateNav()},navItems(m){for(let D of m){let _=fe(D,this.attrItem),$=vr("a,button",D)||D,Q,ae=null;if(U(_)){let pe=ee(_),Ne=this.slides[pe];Ne&&(Ne.id||(Ne.id=hu(this,Ne)),ae=Ne.id),Q=this.t("slideX",ie(_)+1),Qe($,"role","tab")}else this.list&&(this.list.id||(this.list.id=hu(this,this.list)),ae=this.list.id),Q=this.t(_);Qe($,{"aria-controls":ae,"aria-label":Qe($,"aria-label")||Q})}},slides(m){m.forEach((D,_)=>Qe(D,{role:this.nav?"tabpanel":"group","aria-label":this.t("slideLabel",_+1,this.length),"aria-roledescription":this.nav?null:"slide"})),this.padNavitems()}},connected(){Qe(this.$el,{role:this.role,"aria-roledescription":"carousel"})},update:[{write(){this.navItems.concat(this.nav).forEach(m=>m&&(m.hidden=!this.maxIndex)),this.updateNav()},events:["resize"]}],events:[{name:"click keydown",delegate:({selNavItem:m})=>m,filter:({parallax:m})=>!m,handler(m){m.target.closest("a,button")&&(m.type==="click"||m.keyCode===Ir.SPACE)&&(m.preventDefault(),this.show(fe(m.current,this.attrItem)))}},{name:"itemshow",handler:"updateNav"},{name:"keydown",delegate:({selNavItem:m})=>m,filter:({parallax:m})=>!m,handler(m){let{current:D,keyCode:_}=m,$=fe(D,this.attrItem);if(!U($))return;let Q=_===Ir.HOME?0:_===Ir.END?"last":_===Ir.LEFT?"previous":_===Ir.RIGHT?"next":-1;~Q&&(m.preventDefault(),this.show(Q))}}],methods:{updateNav(){let m=this.getValidIndex();for(let D of this.navItems){let _=fe(D,this.attrItem),$=vr("a,button",D)||D;if(U(_)){let ae=ee(_)===m;Ke(D,this.clsActive,ae),Ke($,"uk-disabled",this.parallax),Qe($,{"aria-selected":ae,tabindex:ae&&!this.parallax?null:-1}),ae&&$&&rr(Gt(D),":focus-within")&&$.focus()}else Ke(D,"uk-invisible",this.finite&&(_==="previous"&&m===0||_==="next"&&m>=this.maxIndex))}},padNavitems(){if(!this.nav)return;let m=[];for(let D=0;D$.matches(`[${_}]`))||vr(`
  • `)}re(m,this.navChildren)||ds(this.nav,m)}}};let Dg="cubic-bezier(0.25, 0.46, 0.45, 0.94)",Om="cubic-bezier(0.165, 0.84, 0.44, 1)";var Ng={mixins:[oi,_N,af,bi],props:{clsActivated:String,easing:String,index:Number,finite:Boolean,velocity:Number},data:()=>({easing:"ease",finite:!1,velocity:1,index:0,prevIndex:-1,stack:[],percent:0,clsActive:"uk-active",clsActivated:"",clsEnter:"uk-slide-enter",clsLeave:"uk-slide-leave",clsSlideActive:"uk-slide-active",Transitioner:!1,transitionOptions:{}}),connected(){this.prevIndex=-1,this.index=this.getValidIndex(this.$props.index),this.stack=[]},disconnected(){ge(this.slides,this.clsActive)},computed:{duration:({velocity:m},D)=>Eg(D.offsetWidth/m),list:({selList:m},D)=>vr(m,D),maxIndex(){return this.length-1},slides(){return Er(this.list)},length(){return this.slides.length}},watch:{slides(m,D){D&&this.$emit()}},events:{itemshow({target:m}){Ue(m,this.clsEnter,this.clsSlideActive)},itemshown({target:m}){ge(m,this.clsEnter)},itemhide({target:m}){Ue(m,this.clsLeave)},itemhidden({target:m}){ge(m,this.clsLeave,this.clsSlideActive)}},methods:{show(m,D=!1){var _;if(this.dragging||!this.length||this.parallax)return;let{stack:$}=this,Q=D?0:$.length,ae=()=>{$.splice(Q,1),$.length&&this.show($.shift(),!0)};if($[D?"unshift":"push"](m),!D&&$.length>1){$.length===2&&((_=this._transitioner)==null||_.forward(Math.min(this.duration,200)));return}let pe=this.getIndex(this.index),Ne=Be(this.slides,this.clsActive)&&this.slides[pe],Fe=this.getIndex(m,this.index),et=this.slides[Fe];if(Ne===et){ae();return}if(this.dir=Sg(m,pe),this.prevIndex=pe,this.index=Fe,Ne&&!qt(Ne,"beforeitemhide",[this])||!qt(et,"beforeitemshow",[this,Ne])){this.index=this.prevIndex,ae();return}let it=this._show(Ne,et,D).then(()=>{Ne&&qt(Ne,"itemhidden",[this]),qt(et,"itemshown",[this]),$.shift(),this._transitioner=null,$.length&&requestAnimationFrame(()=>$.length&&this.show($.shift(),!0))});return Ne&&qt(Ne,"itemhide",[this]),qt(et,"itemshow",[this]),it},getIndex(m=this.index,D=this.index){return Oe(de(m,this.slides,D,this.finite),0,Math.max(0,this.maxIndex))},getValidIndex(m=this.index,D=this.prevIndex){return this.getIndex(m,D)},async _show(m,D,_){if(this._transitioner=this._getTransitioner(m,D,this.dir,{easing:_?D.offsetWidth<600?Dg:Om:this.easing,...this.transitionOptions}),!_&&!m){this._translate(1);return}let{length:$}=this.stack;return this._transitioner[$>1?"forward":"show"]($>1?Math.min(this.duration,75+75/($-1)):this.duration,this.percent)},_translate(m,D=this.prevIndex,_=this.index){let $=this._getTransitioner(D===_?!1:D,_);return $.translate(m),$},_getTransitioner(m=this.prevIndex,D=this.index,_=this.dir||1,$=this.transitionOptions){return new this.Transitioner(q(m)?this.slides[m]:m,q(D)?this.slides[D]:D,_*(j?-1:1),$)}}};function Sg(m,D){return m==="next"?1:m==="previous"||m({preload:1,videoAutoplay:!1,delayControls:3e3,items:[],cls:"uk-open",clsPage:"uk-lightbox-page",selList:".uk-lightbox-items",attrItem:"uk-lightbox-item",selClose:".uk-close-large",selCaption:".uk-lightbox-caption",pauseOnHover:!1,velocity:2,Animations:Ag,template:'
    '}),created(){let m=vr(this.template),D=vr(this.selList,m);this.items.forEach(()=>Sn(D,"
    "));let _=vr("[uk-close]",m),$=this.t("close");_&&$&&(_.dataset.i18n=JSON.stringify({label:$})),this.$mount(Sn(this.container,m))},events:[{name:`${_e} ${ye} keydown`,handler:"showControls"},{name:"click",self:!0,delegate:({selList:m})=>`${m} > *`,handler(m){m.defaultPrevented||this.hide()}},{name:"shown",self:!0,handler:"showControls"},{name:"hide",self:!0,handler(){this.hideControls(),ge(this.slides,this.clsActive),Tt.stop(this.slides)}},{name:"hidden",self:!0,handler(){this.$destroy(!0)}},{name:"keyup",el:()=>document,handler({keyCode:m}){if(!this.isToggled(this.$el)||!this.draggable)return;let D=-1;m===Ir.LEFT?D="previous":m===Ir.RIGHT?D="next":m===Ir.HOME?D=0:m===Ir.END&&(D="last"),~D&&this.show(D)}},{name:"beforeitemshow",handler(m){this.isToggled()||(this.draggable=!1,m.preventDefault(),this.toggleElement(this.$el,!0,!1),this.animation=Ag.scale,ge(m.target,this.clsActive),this.stack.splice(1,0,this.index))}},{name:"itemshow",handler(){ds(vr(this.selCaption,this.$el),this.getItem().caption||"");for(let m=-this.preload;m<=this.preload;m++)this.loadItem(this.index+m)}},{name:"itemshown",handler(){this.draggable=this.$props.draggable}},{name:"itemload",async handler(m,D){let{source:_,type:$,alt:Q="",poster:ae,attrs:pe={}}=D;if(this.setItem(D,""),!_)return;let Ne,Fe={allowfullscreen:"",style:"max-width: 100%; box-sizing: border-box;","uk-responsive":"","uk-video":`${this.videoAutoplay}`};if($==="image"||_.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i)){let et=du("img",{src:_,alt:Q,...pe});jt(et,"load",()=>this.setItem(D,et)),jt(et,"error",()=>this.setError(D))}else if($==="video"||_.match(/\.(mp4|webm|ogv)($|\?)/i)){let et=du("video",{src:_,poster:ae,controls:"",playsinline:"","uk-video":`${this.videoAutoplay}`,...pe});jt(et,"loadedmetadata",()=>this.setItem(D,et)),jt(et,"error",()=>this.setError(D))}else if($==="iframe"||_.match(/\.(html|php)($|\?)/i))this.setItem(D,du("iframe",{src:_,allowfullscreen:"",class:"uk-lightbox-iframe",...pe}));else if(Ne=_.match(/\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))this.setItem(D,du("iframe",{src:`https://www.youtube${Ne[1]||""}.com/embed/${Ne[2]}${Ne[3]?`?${Ne[3]}`:""}`,width:1920,height:1080,...Fe,...pe}));else if(Ne=_.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))try{let{height:et,width:it}=await(await fetch(`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(_)}`,{credentials:"omit"})).json();this.setItem(D,du("iframe",{src:`https://player.vimeo.com/video/${Ne[1]}${Ne[2]?`?${Ne[2]}`:""}`,width:it,height:et,...Fe,...pe}))}catch{this.setError(D)}}}],methods:{loadItem(m=this.index){let D=this.getItem(m);this.getSlide(D).childElementCount||qt(this.$el,"itemload",[D])},getItem(m=this.index){return this.items[de(m,this.slides)]},setItem(m,D){qt(this.$el,"itemloaded",[this,ds(this.getSlide(m),D)])},getSlide(m){return this.slides[this.items.indexOf(m)]},setError(m){this.setItem(m,'')},showControls(){clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout(this.hideControls,this.delayControls),Ue(this.$el,"uk-active","uk-transition-active")},hideControls(){ge(this.$el,"uk-active","uk-transition-active")}}};function du(m,D){let _=Vu(`<${m}>`);return Qe(_,D),_}var rx={install:nx,props:{toggle:String},data:{toggle:"a"},computed:{toggles:({toggle:m},D)=>tn(m,D)},watch:{toggles(m){this.hide();for(let D of m)jr(D,"a")&&Qe(D,"role","button")}},disconnected(){this.hide()},events:{name:"click",delegate:({toggle:m})=>`${m}:not(.uk-disabled)`,handler(m){m.defaultPrevented||(m.preventDefault(),this.show(m.current))}},methods:{show(m){let D=Pe(this.toggles.map(Cg),"source");if(F(m)){let{source:_}=Cg(m);m=p(D,({source:$})=>_===$)}return this.panel=this.panel||this.$create("lightboxPanel",{...this.$props,items:D}),jt(this.panel.$el,"hidden",()=>this.panel=null),this.panel.show(m)},hide(){var m;return(m=this.panel)==null?void 0:m.hide()}}};function nx(m,D){m.lightboxPanel||m.component("lightboxPanel",ci),b(D.props,m.component("lightboxPanel").options.props)}function Cg(m){let D={};for(let _ of["href","caption","type","poster","alt","attrs"])D[_==="href"?"source":_]=fe(m,_);return D.attrs=Ju(D.attrs),D}var sf={mixins:[ws],functional:!0,args:["message","status"],data:{message:"",status:"",timeout:5e3,group:"",pos:"top-center",clsContainer:"uk-notification",clsClose:"uk-notification-close",clsMsg:"uk-notification-message"},install:Im,computed:{marginProp:({pos:m})=>`margin-${m.match(/[a-z]+(?=-)/)[0]}`,startProps(){return{opacity:0,[this.marginProp]:-this.$el.offsetHeight}}},created(){let m=`${this.clsContainer}-${this.pos}`,D=`data-${this.clsContainer}-container`,_=vr(`.${m}[${D}]`,this.container)||Sn(this.container,`
    `);this.$mount(Sn(_,``))},async connected(){let m=ie(ke(this.$el,this.marginProp));await Tt.start(ke(this.$el,this.startProps),{opacity:1,[this.marginProp]:m}),this.timeout&&(this.timer=setTimeout(this.close,this.timeout))},events:{click(m){m.target.closest('a[href="#"],a[href=""]')&&m.preventDefault(),this.close()},[nt](){this.timer&&clearTimeout(this.timer)},[Xe](){this.timeout&&(this.timer=setTimeout(this.close,this.timeout))}},methods:{async close(m){let D=_=>{let $=Gt(_);qt(_,"close",[this]),Ao(_),$?.hasChildNodes()||Ao($)};this.timer&&clearTimeout(this.timer),m||await Tt.start(this.$el,this.startProps),D(this.$el)}}};function Im(m){m.notification.closeAll=function(D,_){zo(document.body,$=>{let Q=m.getComponent($,"notification");Q&&(!D||D===Q.group)&&Q.close(_)})}}var qc={props:{media:Boolean},data:{media:!1},connected(){let m=ix(this.media,this.$el);if(this.matchMedia=!0,m){this.mediaObj=window.matchMedia(m);let D=()=>{this.matchMedia=this.mediaObj.matches,qt(this.$el,Eo("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=jt(this.mediaObj,"change",()=>{D(),this.$emit("resize")}),D()}},disconnected(){var m;(m=this.offMediaObj)==null||m.call(this)}};function ix(m,D){if(R(m)){if(a(m,"@"))m=ie(ke(D,`--uk-breakpoint-${m.slice(1)}`));else if(isNaN(m))return m}return m&&U(m)?`(min-width: ${m}px)`:""}function Mg(m){return je(m)?Math.ceil(Math.max(0,...tn("[stroke]",m).map(D=>D.getTotalLength()))):0}let Ns={x:Uc,y:Uc,rotate:Uc,scale:Uc,color:al,backgroundColor:al,borderColor:al,blur:$o,hue:$o,fopacity:$o,grayscale:$o,invert:$o,saturate:$o,sepia:$o,opacity:ox,stroke:ax,bgx:Og,bgy:Og},{keys:Tg}=Object;var zc={mixins:[qc],props:sx(Tg(Ns),"list"),data:sx(Tg(Ns),void 0),computed:{props(m,D){let _={};for(let Q in m)Q in Ns&&!V(m[Q])&&(_[Q]=m[Q].slice());let $={};for(let Q in _)$[Q]=Ns[Q](Q,D,_[Q],_);return $}},events:{load(){this.$emit()}},methods:{reset(){for(let m in this.getCss(0))ke(this.$el,m,"")},getCss(m){let D={};for(let _ in this.props)this.props[_](D,Oe(m));return D.willChange=Object.keys(D).map(Mr).join(","),D}}};function Uc(m,D,_){let $=Wc(_)||{x:"px",y:"px",rotate:"deg"}[m]||"",Q;return m==="x"||m==="y"?(m=`translate${l(m)}`,Q=ae=>ie(ie(ae).toFixed($==="px"?0:6))):m==="scale"&&($="",Q=ae=>{var pe;return Wc([ae])?ii(ae,"width",D,!0)/D[`offset${(pe=ae.endsWith)!=null&&pe.call(ae,"vh")?"Height":"Width"}`]:ie(ae)}),_.length===1&&_.unshift(m==="scale"?1:0),_=Io(_,Q),(ae,pe)=>{ae.transform=`${ae.transform||""} ${m}(${Ss(_,pe)}${$})`}}function al(m,D,_){return _.length===1&&_.unshift(Vc(D,m,"")),_=Io(_,$=>HN(D,$)),($,Q)=>{let[ae,pe,Ne]=sl(_,Q),Fe=ae.map((et,it)=>(et+=Ne*(pe[it]-et),it===3?ie(et):parseInt(et,10))).join(",");$[m]=`rgba(${Fe})`}}function HN(m,D){return Vc(m,"color",D).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(ie)}function $o(m,D,_){_.length===1&&_.unshift(0);let $=Wc(_)||{blur:"px",hue:"deg"}[m]||"%";return m={fopacity:"opacity",hue:"hue-rotate"}[m]||m,_=Io(_),(Q,ae)=>{let pe=Ss(_,ae);Q.filter=`${Q.filter||""} ${m}(${pe+$})`}}function ox(m,D,_){return _.length===1&&_.unshift(Vc(D,m,"")),_=Io(_),($,Q)=>{$[m]=Ss(_,Q)}}function ax(m,D,_){_.length===1&&_.unshift(0);let $=Wc(_),Q=Mg(D);return _=Io(_.reverse(),ae=>(ae=ie(ae),$==="%"?ae*Q/100:ae)),_.some(([ae])=>ae)?(ke(D,"strokeDasharray",Q),(ae,pe)=>{ae.strokeDashoffset=Ss(_,pe)}):He}function Og(m,D,_,$){_.length===1&&_.unshift(0);let Q=m==="bgy"?"height":"width";$[m]=Io(_,Ne=>ii(Ne,Q,D));let ae=["bgx","bgy"].filter(Ne=>Ne in $);if(ae.length===2&&m==="bgx")return He;if(Vc(D,"backgroundSize","")==="cover")return Hc(m,D,_,$);let pe={};for(let Ne of ae)pe[Ne]=uf(D,Ne);return lf(ae,pe,$)}function Hc(m,D,_,$){let Q=$N(D);if(!Q.width)return He;let ae={width:D.offsetWidth,height:D.offsetHeight},pe=["bgx","bgy"].filter(it=>it in $),Ne={};for(let it of pe){let ht=$[it].map(([Rr])=>Rr),Ot=Math.min(...ht),Ut=Math.max(...ht),lr=ht.indexOf(Ot){et(it,ht),it.backgroundSize=`${Fe.width}px ${Fe.height}px`,it.backgroundRepeat="no-repeat"}}function uf(m,D){return Vc(m,`background-position-${D.slice(-1)}`,"")}function lf(m,D,_){return function($,Q){for(let ae of m){let pe=Ss(_[ae],Q);$[`background-position-${ae.slice(-1)}`]=`calc(${D[ae]} + ${pe}px)`}}}let ff={},$c={};function $N(m){let D=ke(m,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if($c[D])return $c[D];let _=new Image;return D&&(_.src=D,!_.naturalWidth&&!ff[D])?(Or(_,"error load",()=>{$c[D]=Fm(_),qt(m,Eo("load",!1))}),ff[D]=!0,Fm(_)):$c[D]=Fm(_)}function Fm(m){return{width:m.naturalWidth,height:m.naturalHeight}}function Io(m,D=ie){let _=[],{length:$}=m,Q=0;for(let ae=0;ae<$;ae++){let[pe,Ne]=R(m[ae])?m[ae].trim().split(/ (?![^(]*\))/):[m[ae]];if(pe=D(pe),Ne=Ne?ie(Ne)/100:null,ae===0?Ne===null?Ne=0:Ne&&_.push([pe,0]):ae===$-1&&(Ne===null?Ne=1:Ne!==1&&(_.push([pe,Ne]),Ne=1)),_.push([pe,Ne]),Ne===null)Q++;else if(Q){let Fe=_[ae-Q-1][1],et=(Ne-Fe)/(Q+1);for(let it=Q;it>0;it--)_[ae-it][1]=Fe+et*(Q-it+1);Q=0}}return _}function sl(m,D){let _=p(m.slice(1),([,$])=>D<=$)+1;return[m[_-1][0],m[_][0],(D-m[_-1][1])/(m[_][1]-m[_-1][1])]}function Ss(m,D){let[_,$,Q]=sl(m,D);return _+Math.abs(_-$)*Q*(_<$?1:-1)}let WN=/^-?\d+(?:\.\d+)?(\S+)?/;function Wc(m,D){var _;for(let $ of m){let Q=(_=$.match)==null?void 0:_.call($,WN);if(Q)return Q[1]}return D}function Vc(m,D,_){let $=m.style[D],Q=ke(ke(m,D,_),D);return m.style[D]=$,Q}function sx(m,D){return m.reduce((_,$)=>(_[$]=D,_),{})}function ux(m,D){return D>=0?Math.pow(m,D+1):1-Math.pow(1-m,1-D)}var Qi={mixins:[zc],props:{target:String,viewport:Number,easing:Number,start:String,end:String},data:{target:!1,viewport:1,easing:1,start:0,end:0},computed:{target:({target:m},D)=>Ig(m&&Hn(m,D)||D),start({start:m}){return ii(m,"height",this.target,!0)},end({end:m,viewport:D}){return ii(m||(D=(1-D)*100)&&`${D}vh+${D}%`,"height",this.target,!0)}},observe:[Ec(),Kl({target:({target:m})=>m}),li({target:({$el:m,target:D})=>[m,D,vs(D,!0)]})],update:{read({percent:m},D){if(D.has("scroll")||(m=!1),!je(this.$el))return!1;if(!this.matchMedia)return;let _=m;return m=ux(dm(this.target,this.start,this.end),this.easing),{percent:m,style:_===m?!1:this.getCss(m)}},write({style:m}){if(!this.matchMedia){this.reset();return}m&&ke(this.$el,m)},events:["scroll","resize"]}};function Ig(m){return m?"offsetTop"in m?m:Ig(Gt(m)):document.documentElement}var lx={props:{parallax:Boolean,parallaxTarget:Boolean,parallaxStart:String,parallaxEnd:String,parallaxEasing:Number},data:{parallax:!1,parallaxTarget:!1,parallaxStart:0,parallaxEnd:0,parallaxEasing:0},observe:[li({target:({$el:m,parallaxTarget:D})=>[m,D],filter:({parallax:m})=>m}),Kl({filter:({parallax:m})=>m})],computed:{parallaxTarget({parallaxTarget:m},D){return m&&Hn(m,D)||this.list}},update:{read(){if(!this.parallax)return!1;let m=this.parallaxTarget;if(!m)return!1;let D=ii(this.parallaxStart,"height",m,!0),_=ii(this.parallaxEnd,"height",m,!0),$=ux(dm(m,D,_),this.parallaxEasing);return{parallax:this.getIndexAt($)}},write({parallax:m}){let[D,_]=m,$=this.getValidIndex(D+Math.ceil(_)),Q=this.slides[D],ae=this.slides[$],{triggerShow:pe,triggerShown:Ne,triggerHide:Fe,triggerHidden:et}=VN(this);if(~this.prevIndex)for(let ht of new Set([this.index,this.prevIndex]))f([$,D],ht)||(Fe(this.slides[ht]),et(this.slides[ht]));let it=this.prevIndex!==D||this.index!==$;this.dir=1,this.prevIndex=D,this.index=$,Q!==ae&&Fe(Q),pe(ae),it&&Ne(Q),this._translate(Q===ae?1:_,Q,ae)},events:["scroll","resize"]},methods:{getIndexAt(m){let D=m*(this.length-1);return[Math.floor(D),D%1]}}};function VN(m){let{clsSlideActive:D,clsEnter:_,clsLeave:$}=m;return{triggerShow:Q,triggerShown:ae,triggerHide:pe,triggerHidden:Ne};function Q(Fe){Be(Fe,$)&&(pe(Fe),Ne(Fe)),Be(Fe,D)||(qt(Fe,"beforeitemshow",[m]),qt(Fe,"itemshow",[m]))}function ae(Fe){Be(Fe,_)&&qt(Fe,"itemshown",[m])}function pe(Fe){Be(Fe,D)||Q(Fe),Be(Fe,_)&&ae(Fe),Be(Fe,$)||(qt(Fe,"beforeitemhide",[m]),qt(Fe,"itemhide",[m]))}function Ne(Fe){Be(Fe,$)&&qt(Fe,"itemhidden",[m])}}var fx={update:{write(){if(this.stack.length||this.dragging||this.parallax)return;let m=this.getValidIndex();!~this.prevIndex||this.index!==m?this.show(m):this._translate(1)},events:["resize"]}},Fg={observe:Xl({target:({slides:m})=>m,targets:m=>m.getAdjacentSlides()}),methods:{getAdjacentSlides(){return[1,-1].map(m=>this.slides[this.getIndex(this.index+m)])}}};function cx(m,D,_,{center:$,easing:Q,list:ae}){let pe=m?cf(m,ae,$):cf(D,ae,$)+Ht(D).width*_,Ne=D?cf(D,ae,$):pe+Ht(m).width*_*(j?-1:1),{promise:Fe,resolve:et}=G1();return{dir:_,show(it,ht=0,Ot){let Ut=Ot?"linear":Q;return it-=Math.round(it*Oe(ht,-1,1)),ke(ae,"transitionProperty","none"),this.translate(ht),ke(ae,"transitionProperty",""),ht=m?ht:Oe(ht,0,1),nl(this.getItemIn(),"itemin",{percent:ht,duration:it,timing:Ut,dir:_}),m&&nl(this.getItemIn(!0),"itemout",{percent:1-ht,duration:it,timing:Ut,dir:_}),Tt.start(ae,{transform:En(-Ne*(j?-1:1),"px")},it,Ut).then(et,He),Fe},cancel(){return Tt.cancel(ae)},reset(){ke(ae,"transform","")},async forward(it,ht=this.percent()){return await this.cancel(),this.show(it,ht,!0)},translate(it){if(it===this.percent())return;let ht=this.getDistance()*_*(j?-1:1);ke(ae,"transform",En(Oe(-Ne+(ht-ht*it),-pf(ae),Ht(ae).width)*(j?-1:1),"px"));let Ot=this.getActives(),Ut=this.getItemIn(),lr=this.getItemIn(!0);it=m?Oe(it,-1,1):0;for(let Ar of Er(ae)){let Rr=f(Ot,Ar),xu=Ar===Ut,$m=Ar===lr,Wm=xu||!$m&&(Rr||_*(j?-1:1)===-1^ca(Ar,ae)>ca(m||D));nl(Ar,`itemtranslate${Wm?"in":"out"}`,{dir:_,percent:$m?1-it:xu?it:Rr?1:0})}},percent(){return Math.abs((new DOMMatrix(ke(ae,"transform")).m41*(j?-1:1)+pe)/(Ne-pe))},getDistance(){return Math.abs(Ne-pe)},getItemIn(it=!1){let ht=this.getActives(),Ot=mf(ae,cf(D||m,ae,$));if(it){let Ut=ht;ht=Ot,Ot=Ut}return Ot[p(Ot,Ut=>!f(ht,Ut))]},getActives(){return mf(ae,cf(m||D,ae,$))}}}function cf(m,D,_){let $=ca(m,D);return _?$-GN(m,D):Math.min($,px(D))}function px(m){return Math.max(0,pf(m)-Ht(m).width)}function pf(m,D){return Se(Er(m).slice(0,D),_=>Ht(_).width)}function GN(m,D){return Ht(D).width/2-Ht(m).width/2}function ca(m,D){return m&&(Vd(m).left+(j?Ht(m).width-Ht(D).width:0))*(j?-1:1)||0}function mf(m,D){D-=1;let _=Ht(m).width,$=D+_+2;return Er(m).filter(Q=>{let ae=ca(Q,m),pe=ae+Math.min(Ht(Q).width,_);return ae>=D&&pe<=$})}var _m={mixins:[Xi,Ng,fx,lx,Fg],props:{center:Boolean,sets:Boolean,active:String},data:{center:!1,sets:!1,attrItem:"uk-slider-item",selList:".uk-slider-items",selNav:".uk-slider-nav",clsContainer:"uk-slider-container",active:"all",Transitioner:cx},computed:{finite({finite:m}){return m||Gc(this.list,this.center)},maxIndex(){if(!this.finite||this.center&&!this.sets)return this.length-1;if(this.center)return De(this.sets);let m=0,D=px(this.list),_=p(this.slides,$=>{if(m>=D)return!0;m+=Ht($).width});return~_?_:this.length-1},sets({sets:m}){if(!m||this.parallax)return;let D=0,_=[],$=Ht(this.list).width;for(let Q=0;Q$&&(D=0),this.center?D<$/2&&D+ae+Ht(this.slides[de(Q+1,this.slides)]).width/2>$/2&&(_.push(Q),D=$/2-ae/2):D===0&&_.push(Math.min(Q,this.maxIndex)),D+=ae}if(_.length)return _},transitionOptions(){return{center:this.center,list:this.list}},slides(){return Er(this.list).filter(je)}},connected(){Ke(this.$el,this.clsContainer,!vr(`.${this.clsContainer}`,this.$el))},observe:li({target:({slides:m,$el:D})=>[D,...m]}),update:{write(){for(let m of this.navItems){let D=ee(fe(m,this.attrItem));D!==!1&&(m.hidden=!this.maxIndex||D>this.maxIndex||this.sets&&!f(this.sets,D))}this.reorder(),this.parallax||this._translate(1),this.updateActiveClasses()},events:["resize"]},events:{beforeitemshow(m){!this.dragging&&this.sets&&this.stack.length<2&&!f(this.sets,this.index)&&(this.index=this.getValidIndex());let D=Math.abs(this.index-this.prevIndex+(this.dir>0&&this.indexthis.prevIndex?(this.maxIndex+1)*this.dir:0));if(!this.dragging&&D>1){for(let Q=0;Q0?"next":"previous");m.preventDefault();return}let _=this.dir<0||!this.slides[this.prevIndex]?this.index:this.prevIndex,$=pf(this.list)/this.length;this.duration=Eg($/this.velocity)*(Ht(this.slides[_]).width/$),this.reorder()},itemshow(){~this.prevIndex&&Ue(this._getTransitioner().getItemIn(),this.clsActive),this.updateActiveClasses(this.prevIndex)},itemshown(){this.updateActiveClasses()}},methods:{reorder(){if(this.finite){ke(this.slides,"order","");return}let m=this.dir>0&&this.slides[this.prevIndex]?this.prevIndex:this.index;if(this.slides.forEach((Q,ae)=>ke(Q,"order",this.dir>0&&ae=this.index?-1:"")),!this.center||!this.length)return;let D=this.slides[m],_=Ht(this.list).width/2-Ht(D).width/2,$=0;for(;_>0;){let Q=this.getIndex(--$+m,m),ae=this.slides[Q];ke(ae,"order",Q>m?-2:-1),_-=Ht(ae).width}},updateActiveClasses(m=this.index){let D=this._getTransitioner(m).getActives();this.active!=="all"&&(D=[this.slides[this.getValidIndex(m)]]);let _=[this.clsActive,!this.sets||f(this.sets,ie(this.index))?this.clsActivated:""];for(let $ of this.slides){let Q=f(D,$);Ke($,_,Q),Qe($,"aria-hidden",!Q);for(let ae of tn(fr,$))r(ae,"_tabindex")||(ae._tabindex=Qe(ae,"tabindex")),Qe(ae,"tabindex",Q?ae._tabindex:-1)}},getValidIndex(m=this.index,D=this.prevIndex){if(m=this.getIndex(m,D),!this.sets)return m;let _;do{if(f(this.sets,m))return m;_=m,m=this.getIndex(m+this.dir,D)}while(m!==_);return m},getAdjacentSlides(){let{width:m}=Ht(this.list),D=-m,_=m*2,$=Ht(this.slides[this.index]).width,Q=this.center?m/2-$/2:0,ae=new Set;for(let pe of[-1,1]){let Ne=Q+(pe>0?$:0),Fe=0;do{let et=this.slides[this.getIndex(this.index+pe+Fe++*pe)];Ne+=Ht(et).width*pe,ae.add(et)}while(this.length>Fe&&Ne>D&&Ne<_)}return Array.from(ae)},getIndexAt(m){let D=-1,_=this.center?pf(this.list)-(Ht(this.slides[0]).width/2+Ht(De(this.slides)).width/2):pf(this.list,this.maxIndex),$=m*_,Q=0;do{let ae=Ht(this.slides[++D]).width,pe=this.center?ae/2+Ht(this.slides[D+1]).width/2:ae;Q=$/pe%1,$-=pe}while($>=0&&DSe($.filter(it=>!Fe.has(it)),it=>Ht(it).width))return!0}return!1}function Es(m){return Math.max(0,...Er(m).map(D=>Ht(D).width))}var mx={mixins:[zc],beforeConnect(){this.item=this.$el.closest(`.${this.$options.id.replace("parallax","items")} > *`)},disconnected(){this.item=null},events:[{name:"itemin itemout",self:!0,el:({item:m})=>m,handler({type:m,detail:{percent:D,duration:_,timing:$,dir:Q}}){Zi.read(()=>{if(!this.matchMedia)return;let ae=this.getCss(ul(m,Q,D)),pe=this.getCss(hx(m)?.5:Q>0?1:0);Zi.write(()=>{ke(this.$el,ae),Tt.start(this.$el,pe,_,$).catch(He)})})}},{name:"transitioncanceled transitionend",self:!0,el:({item:m})=>m,handler(){Tt.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el:({item:m})=>m,handler({type:m,detail:{percent:D,dir:_}}){Zi.read(()=>{if(!this.matchMedia){this.reset();return}let $=this.getCss(ul(m,_,D));Zi.write(()=>ke(this.$el,$))})}}]};function hx(m){return s(m,"in")}function ul(m,D,_){return _/=2,hx(m)^D<0?_:1-_}var dx={...bs,fade:{show(){return[{opacity:0,zIndex:0},{zIndex:-1}]},percent(m){return 1-ke(m,"opacity")},translate(m){return[{opacity:1-m,zIndex:0},{zIndex:-1}]}},scale:{show(){return[{opacity:0,transform:rf(1+.5),zIndex:0},{zIndex:-1}]},percent(m){return 1-ke(m,"opacity")},translate(m){return[{opacity:1-m,transform:rf(1+.5*m),zIndex:0},{zIndex:-1}]}},pull:{show(m){return m<0?[{transform:En(30),zIndex:-1},{transform:En(),zIndex:0}]:[{transform:En(-100),zIndex:0},{transform:En(),zIndex:-1}]},percent(m,D,_){return _<0?1-Oc(D):Oc(m)},translate(m,D){return D<0?[{transform:En(30*m),zIndex:-1},{transform:En(-100*(1-m)),zIndex:0}]:[{transform:En(-m*100),zIndex:0},{transform:En(30*(1-m)),zIndex:-1}]}},push:{show(m){return m<0?[{transform:En(100),zIndex:0},{transform:En(),zIndex:-1}]:[{transform:En(-30),zIndex:-1},{transform:En(),zIndex:0}]},percent(m,D,_){return _>0?1-Oc(D):Oc(m)},translate(m,D){return D<0?[{transform:En(m*100),zIndex:0},{transform:En(-30*(1-m)),zIndex:-1}]:[{transform:En(-30*m),zIndex:-1},{transform:En(100*(1-m)),zIndex:0}]}}},gx={mixins:[Xi,tx,fx,lx,Fg],props:{ratio:String,minHeight:String,maxHeight:String},data:{ratio:"16:9",minHeight:void 0,maxHeight:void 0,selList:".uk-slideshow-items",attrItem:"uk-slideshow-item",selNav:".uk-slideshow-nav",Animations:dx},watch:{list(m){ke(m,{aspectRatio:this.ratio?this.ratio.replace(":","/"):void 0,minHeight:this.minHeight,maxHeight:this.maxHeight,minWidth:"100%",maxWidth:"100%"})}},methods:{getAdjacentSlides(){return[1,-1].map(m=>this.slides[this.getIndex(this.index+m)])}}},vx={mixins:[Xi,lg],props:{group:String,threshold:Number,clsItem:String,clsPlaceholder:String,clsDrag:String,clsDragState:String,clsBase:String,clsNoDrag:String,clsEmpty:String,clsCustom:String,handle:String},data:{group:!1,threshold:5,clsItem:"uk-sortable-item",clsPlaceholder:"uk-sortable-placeholder",clsDrag:"uk-sortable-drag",clsDragState:"uk-drag",clsBase:"uk-sortable",clsNoDrag:"uk-sortable-nodrag",clsEmpty:"uk-sortable-empty",clsCustom:"",handle:!1,pos:{}},events:{name:ye,passive:!1,handler:"init"},computed:{target:(m,D)=>(D.tBodies||[D])[0],items(){return Er(this.target)},isEmpty(){return!this.items.length},handles({handle:m},D){return m?tn(m,D):this.items}},watch:{isEmpty(m){Ke(this.target,this.clsEmpty,m)},handles(m,D){ke(D,{touchAction:"",userSelect:""}),ke(m,{touchAction:"none",userSelect:"none"})}},update:{write(m){if(!this.drag||!Gt(this.placeholder))return;let{pos:{x:D,y:_},origin:{offsetTop:$,offsetLeft:Q},placeholder:ae}=this;ke(this.drag,{top:_-$,left:D-Q});let pe=this.getSortable(document.elementFromPoint(D,_));if(!pe)return;let{items:Ne}=pe;if(Ne.some(Tt.inProgress))return;let Fe=Bg(Ne,{x:D,y:_});if(Ne.length&&(!Fe||Fe===ae))return;let et=this.getSortable(ae),it=YN(pe.target,Fe,ae,D,_,pe===et&&m.moved!==Fe);it!==!1&&(it&&ae===it||(pe!==et?(et.remove(ae),m.moved=Fe):delete m.moved,pe.insert(ae,it),this.touched.add(pe)))},events:["move"]},methods:{init(m){let{target:D,button:_,defaultPrevented:$}=m,[Q]=this.items.filter(ae=>ae.contains(D));!Q||$||_>0||Bt(D)||D.closest(`.${this.clsNoDrag}`)||this.handle&&!D.closest(this.handle)||(m.preventDefault(),this.pos=dt(m),this.touched=new Set([this]),this.placeholder=Q,this.origin={target:D,index:_n(Q),...this.pos},jt(document,_e,this.move),jt(document,Je,this.end),this.threshold||this.start(m))},start(m){this.drag=kg(this.$container,this.placeholder);let{left:D,top:_}=Ht(this.placeholder);b(this.origin,{offsetLeft:this.pos.x-D,offsetTop:this.pos.y-_}),Ue(this.drag,this.clsDrag,this.clsCustom),Ue(this.placeholder,this.clsPlaceholder),Ue(this.items,this.clsItem),Ue(document.documentElement,this.clsDragState),qt(this.$el,"start",[this,this.placeholder]),hf(this.pos),this.move(m)},move:ZN(function(m){b(this.pos,dt(m)),!this.drag&&(Math.abs(this.pos.x-this.origin.x)>this.threshold||Math.abs(this.pos.y-this.origin.y)>this.threshold)&&this.start(m),this.$emit("move")}),end(){if(Gi(document,_e,this.move),Gi(document,Je,this.end),!this.drag)return;_g();let m=this.getSortable(this.placeholder);this===m?this.origin.index!==_n(this.placeholder)&&qt(this.$el,"moved",[this,this.placeholder]):(qt(m.$el,"added",[m,this.placeholder]),qt(this.$el,"removed",[this,this.placeholder])),qt(this.$el,"stop",[this,this.placeholder]),Ao(this.drag),this.drag=null;for(let{clsPlaceholder:D,clsItem:_}of this.touched)for(let $ of this.touched)ge($.items,D,_);this.touched=null,ge(document.documentElement,this.clsDragState)},insert(m,D){Ue(this.items,this.clsItem),D&&D.previousElementSibling!==m?this.animate(()=>pc(D,m)):!D&&this.target.lastElementChild!==m&&this.animate(()=>Sn(this.target,m))},remove(m){this.target.contains(m)&&this.animate(()=>Ao(m))},getSortable(m){do{let D=this.$getComponent(m,"sortable");if(D&&(D===this||this.group!==!1&&D.group===this.group))return D}while(m=Gt(m))}}};let Yc;function hf(m){let D=Date.now();Yc=setInterval(()=>{let{x:_,y:$}=m;$+=document.scrollingElement.scrollTop;let Q=(Date.now()-D)*.3;D=Date.now(),Zu(document.elementFromPoint(_,m.y)).reverse().some(ae=>{let{scrollTop:pe,scrollHeight:Ne}=ae,{top:Fe,bottom:et,height:it}=Mo(ae);if(Fe<$&&Fe+35>$)pe-=Q;else if(et>$&&et-35<$)pe+=Q;else return;if(pe>0&&pe"),Sn(_,D.cloneNode(!0).children);for(let $ of D.getAttributeNames())Qe(_,$,D.getAttribute($))}else _=D.cloneNode(!0);return Sn(m,_),ke(_,"margin","0","important"),ke(_,{boxSizing:"border-box",width:D.offsetWidth,height:D.offsetHeight,padding:ke(D,"padding")}),Yi(_.firstElementChild,Yi(D.firstElementChild)),_}function Bg(m,D){return m[p(m,_=>ze(D,Ht(_)))]}function YN(m,D,_,$,Q,ae){if(!Er(m).length)return;let pe=Ht(D);if(!ae)return Zc(m,_)||Qpe[Ot]-Ut?!1:D}function Zc(m,D){let _=Er(m).length===1;_&&Sn(m,D);let $=Er(m),Q=$.some((ae,pe)=>{let Ne=Ht(ae);return $.slice(pe+1).some(Fe=>{let et=Ht(Fe);return!Lg([Ne.left,Ne.right],[et.left,et.right])})});return _&&Ao(D),Q}function Lg(m,D){return m[1]>D[0]&&D[1]>m[0]}function ZN(m){let D;return function(..._){D||(D=!0,m.call(this,..._),requestAnimationFrame(()=>D=!1))}}var Pg={props:{pos:String,offset:Boolean,flip:Boolean,shift:Boolean,inset:Boolean},data:{pos:`bottom-${j?"right":"left"}`,offset:!1,flip:!0,shift:!0,inset:!1},connected(){this.pos=this.$props.pos.split("-").concat("center").slice(0,2),[this.dir,this.align]=this.pos,this.axis=f(["top","bottom"],this.dir)?"y":"x"},methods:{positionAt(m,D,_){let $=[this.getPositionOffset(m),this.getShiftOffset(m)],Q=[this.flip&&"flip",this.shift&&"shift"],ae={element:[this.inset?this.dir:vc(this.dir),this.align],target:[this.dir,this.align]};if(this.axis==="y"){for(let Fe in ae)ae[Fe].reverse();$.reverse(),Q.reverse()}let pe=km(m),Ne=Ht(m);ke(m,{top:-Ne.height,left:-Ne.width}),ua(m,D,{attach:ae,offset:$,boundary:_,placement:Q,viewportOffset:this.getViewportOffset(m)}),pe()},getPositionOffset(m=this.$el){return ii(this.offset===!1?ke(m,"--uk-position-offset"):this.offset,this.axis==="x"?"width":"height",m)*(f(["left","top"],this.dir)?-1:1)*(this.inset?-1:1)},getShiftOffset(m=this.$el){return this.align==="center"?0:ii(ke(m,"--uk-position-shift-offset"),this.axis==="y"?"width":"height",m)*(f(["left","top"],this.align)?1:-1)},getViewportOffset(m){return ii(ke(m,"--uk-position-viewport-offset"))}}};function km(m){let D=vs(m),{scrollTop:_}=D;return()=>{_!==D.scrollTop&&(D.scrollTop=_)}}var XN={mixins:[ws,lu,Pg],data:{pos:"top",animation:["uk-animation-scale-up"],duration:100,cls:"uk-active"},connected(){KN(this.$el)},disconnected(){this.hide()},methods:{show(){if(this.isToggled(this.tooltip||null))return;let{delay:m=0,title:D}=xx(this.$options);if(!D)return;let _=Qe(this.$el,"title"),$=jt(this.$el,["blur",Xe],ae=>!st(ae)&&this.hide());this.reset=()=>{Qe(this.$el,{title:_,"aria-describedby":null}),$()};let Q=hu(this);Qe(this.$el,{title:null,"aria-describedby":Q}),clearTimeout(this.showTimer),this.showTimer=setTimeout(()=>this._show(D,Q),m)},async hide(){var m;rr(this.$el,"input:focus")||(clearTimeout(this.showTimer),this.isToggled(this.tooltip||null)&&await this.toggleElement(this.tooltip,!1,!1),(m=this.reset)==null||m.call(this),Ao(this.tooltip),this.tooltip=null)},async _show(m,D){this.tooltip=Sn(this.container,``),jt(this.tooltip,"toggled",(_,$)=>{if(!$)return;let Q=()=>this.positionAt(this.tooltip,this.$el);Q();let[ae,pe]=Xc(this.tooltip,this.$el,this.pos);this.origin=this.axis==="y"?`${vc(ae)}-${pe}`:`${pe}-${vc(ae)}`;let Ne=[Or(document,`keydown ${ye}`,this.hide,!1,Fe=>Fe.type===ye&&!this.$el.contains(Fe.target)||Fe.type==="keydown"&&Fe.keyCode===Ir.ESC),jt([document,...su(this.$el)],"scroll",Q,{passive:!0})];Or(this.tooltip,"hide",()=>Ne.forEach(Fe=>Fe()),{self:!0})}),await this.toggleElement(this.tooltip,!0)||this.hide()}},events:{[`focus ${nt} ${ye}`](m){(!st(m)||m.type===ye)&&this.show()}}};function KN(m){Gr(m)||Qe(m,"tabindex","0")}function Xc(m,D,[_,$]){let Q=Dr(m),ae=Dr(D),pe=[["left","right"],["top","bottom"]];for(let Fe of pe){if(Q[Fe[0]]>=ae[Fe[1]]){_=Fe[1];break}if(Q[Fe[1]]<=ae[Fe[0]]){_=Fe[0];break}}return $=(f(pe[0],_)?pe[1]:pe[0]).find(Fe=>Q[Fe]===ae[Fe])||"center",[_,$]}function xx(m){let{el:D,id:_,data:$}=m;return["delay","title"].reduce((Q,ae)=>({[ae]:fe(D,ae),...Q}),{...Ju(fe(D,_),["title"]),...$})}var yx={mixins:[bi],i18n:{invalidMime:"Invalid File Type: %s",invalidName:"Invalid File Name: %s",invalidSize:"Invalid File Size: %s Kilobytes Max"},props:{allow:String,clsDragover:String,concurrent:Number,maxSize:Number,method:String,mime:String,multiple:Boolean,name:String,params:Object,type:String,url:String},data:{allow:!1,clsDragover:"uk-dragover",concurrent:1,maxSize:0,method:"POST",mime:!1,multiple:!1,name:"files[]",params:{},type:"",url:"",abort:He,beforeAll:He,beforeSend:He,complete:He,completeAll:He,error:He,fail:He,load:He,loadEnd:He,loadStart:He,progress:He},events:{change(m){rr(m.target,'input[type="file"]')&&(m.preventDefault(),m.target.files&&this.upload(m.target.files),m.target.value="")},drop(m){Kc(m);let D=m.dataTransfer;D?.files&&(ge(this.$el,this.clsDragover),this.upload(D.files))},dragenter(m){Kc(m)},dragover(m){Kc(m),Ue(this.$el,this.clsDragover)},dragleave(m){Kc(m),ge(this.$el,this.clsDragover)}},methods:{async upload(m){if(m=y(m),!m.length)return;qt(this.$el,"upload",[m]);for(let $ of m){if(this.maxSize&&this.maxSize*1e3<$.size){this.fail(this.t("invalidSize",this.maxSize));return}if(this.allow&&!wx(this.allow,$.name)){this.fail(this.t("invalidName",this.allow));return}if(this.mime&&!wx(this.mime,$.type)){this.fail(this.t("invalidMime",this.mime));return}}this.multiple||(m=m.slice(0,1)),this.beforeAll(this,m);let D=Rg(m,this.concurrent),_=async $=>{let Q=new FormData;$.forEach(ae=>Q.append(this.name,ae));for(let ae in this.params)Q.append(ae,this.params[ae]);try{let ae=await JN(this.url,{data:Q,method:this.method,responseType:this.type,beforeSend:pe=>{let{xhr:Ne}=pe;jt(Ne.upload,"progress",this.progress);for(let Fe of["loadStart","load","loadEnd","abort"])jt(Ne,Fe.toLowerCase(),this[Fe]);return this.beforeSend(pe)}});this.complete(ae),D.length?await _(D.shift()):this.completeAll(ae)}catch(ae){this.error(ae)}};await _(D.shift())}}};function wx(m,D){return D.match(new RegExp(`^${m.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")}$`,"i"))}function Rg(m,D){let _=[];for(let $=0;${let{xhr:Q}=D;for(let ae in D)if(ae in Q)try{Q[ae]=D[ae]}catch{}Q.open(D.method.toUpperCase(),m);for(let ae in D.headers)Q.setRequestHeader(ae,D.headers[ae]);jt(Q,"load",()=>{Q.status===0||Q.status>=200&&Q.status<300||Q.status===304?_(Q):$(b(Error(Q.statusText),{xhr:Q,status:Q.status}))}),jt(Q,"error",()=>$(b(Error("Network Error"),{xhr:Q}))),jt(Q,"timeout",()=>$(b(Error("Network Timeout"),{xhr:Q}))),Q.send(D.data)})}var Dx=Object.freeze({__proto__:null,Countdown:R1,Filter:MN,Lightbox:rx,LightboxPanel:ci,Notification:sf,Parallax:Qi,Slider:_m,SliderParallax:mx,Slideshow:gx,SlideshowParallax:mx,Sortable:vx,Tooltip:XN,Upload:yx});function QN(m){J&&window.MutationObserver&&(document.body?requestAnimationFrame(()=>Bm(m)):new MutationObserver((D,_)=>{document.body&&(Bm(m),_.disconnect())}).observe(document.documentElement,{childList:!0}))}function Bm(m){qt(document,"uikit:init",m),document.body&&zo(document.body,Nx),new MutationObserver(D=>D.forEach(Jc)).observe(document,{subtree:!0,childList:!0}),new MutationObserver(D=>D.forEach(Qc)).observe(document,{subtree:!0,attributes:!0}),m._initialized=!0}function Jc({addedNodes:m,removedNodes:D}){for(let _ of m)zo(_,Nx);for(let _ of D)zo(_,Sx)}function Qc({target:m,attributeName:D}){var _;let $=Ex(D);$&&(ut(m,D)?ol($,m):(_=Tm(m,$))==null||_.$destroy())}function Nx(m){let D=of(m);for(let _ in D)Bc(D[_]);for(let _ of m.getAttributeNames()){let $=Ex(_);$&&ol($,m)}}function Sx(m){let D=of(m);for(let _ in D)Cm(D[_])}function Ex(m){a(m,"data-")&&(m=m.slice(5));let D=nf[m];return D&&(D.options||D).name}qN(Yn),zN(Yn);var Ax={mixins:[Xi,lu],props:{animation:Boolean,targets:String,active:null,collapsible:Boolean,multiple:Boolean,toggle:String,content:String,offset:Number},data:{targets:"> *",active:!1,animation:!0,collapsible:!0,multiple:!1,clsOpen:"uk-open",toggle:"> .uk-accordion-title",content:"> .uk-accordion-content",offset:0},computed:{items:({targets:m},D)=>tn(m,D),toggles({toggle:m}){return this.items.map(D=>vr(m,D))},contents({content:m}){return this.items.map(D=>{var _;return((_=D._wrapper)==null?void 0:_.firstElementChild)||vr(m,D)})}},watch:{items(m,D){if(D||Be(m,this.clsOpen))return;let _=this.active!==!1&&m[Number(this.active)]||!this.collapsible&&m[0];_&&this.toggle(_,!1)},toggles(){this.$emit()},contents(m){for(let D of m){let _=Be(this.items.find($=>$.contains(D)),this.clsOpen);Lm(D,!_)}this.$emit()}},observe:Xl(),events:[{name:"click keydown",delegate:({targets:m,$props:D})=>`${m} ${D.toggle}`,async handler(m){var D;m.type==="keydown"&&m.keyCode!==Ir.SPACE||(m.preventDefault(),(D=this._off)==null||D.call(this),this._off=Cx(m.target),await this.toggle(_n(this.toggles,m.current)),this._off())}},{name:"shown hidden",self:!0,delegate:({targets:m})=>m,handler(){this.$emit()}}],update(){let m=yi(this.items,`.${this.clsOpen}`);for(let D in this.items){let _=this.toggles[D],$=this.contents[D];if(!_||!$)continue;_.id=hu(this,_),$.id=hu(this,$);let Q=f(m,this.items[D]);Qe(_,{role:jr(_,"a")?"button":null,"aria-controls":$.id,"aria-expanded":Q,"aria-disabled":!this.collapsible&&m.length<2&&Q}),Qe($,{role:"region","aria-labelledby":_.id}),jr($,"ul")&&Qe(Er($),"role","presentation")}},methods:{toggle(m,D){m=this.items[de(m,this.items)];let _=[m],$=yi(this.items,`.${this.clsOpen}`);if(!this.multiple&&!f($,_[0])&&(_=_.concat($)),!(!this.collapsible&&$.length<2&&f($,m)))return Promise.all(_.map(Q=>this.toggleElement(Q,!f($,Q),(ae,pe)=>{if(Ke(ae,this.clsOpen,pe),D===!1||!this.animation){Lm(vr(this.content,ae),!pe);return}return jN(ae,pe,this)})))}}};function Lm(m,D){m&&(m.hidden=D)}async function jN(m,D,{content:_,duration:$,velocity:Q,transition:ae}){var pe;_=((pe=m._wrapper)==null?void 0:pe.firstElementChild)||vr(_,m),m._wrapper||(m._wrapper=um(_,"
    "));let Ne=m._wrapper;ke(Ne,"overflow","hidden");let Fe=ie(ke(Ne,"height"));await Tt.cancel(Ne),Lm(_,!1);let et=Se(["marginTop","marginBottom"],ht=>ke(_,ht))+Ht(_).height,it=Fe/et;$=(Q*et+$)*(D?1-it:it),ke(Ne,"height",Fe),await Tt.start(Ne,{height:D?et:0},$,ae),Co(_),delete m._wrapper,D||Lm(_,!0)}function Cx(m){let D=vs(m,!0),_;return function $(){_=requestAnimationFrame(()=>{let{top:Q}=Ht(m);Q<0&&(D.scrollTop+=Q),$()})}(),()=>requestAnimationFrame(()=>cancelAnimationFrame(_))}var eS={mixins:[Xi,lu],args:"animation",props:{animation:Boolean,close:String},data:{animation:!0,selClose:".uk-alert-close",duration:150},events:{name:"click",delegate:({selClose:m})=>m,handler(m){m.preventDefault(),this.close()}},methods:{async close(){await this.toggleElement(this.$el,!1,tS),this.$destroy(!0)}}};function tS(m,D,{duration:_,transition:$,velocity:Q}){let ae=ie(ke(m,"height"));return ke(m,"height",ae),Tt.start(m,{height:0,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0,borderTop:0,borderBottom:0,opacity:0},Q*ae+_,$)}var qg={args:"autoplay",props:{automute:Boolean,autoplay:Boolean},data:{automute:!1,autoplay:!0},beforeConnect(){this.autoplay==="inview"&&!ut(this.$el,"preload")&&(this.$el.preload="none"),jr(this.$el,"iframe")&&!ut(this.$el,"allow")&&(this.$el.allow="autoplay"),this.autoplay==="hover"&&(jr(this.$el,"video")?this.$el.tabindex=0:this.autoplay=!0),this.automute&&M1(this.$el)},events:[{name:`${nt} focusin`,filter:({autoplay:m})=>f(m,"hover"),handler(m){!st(m)||!zg(this.$el)?Gl(this.$el):gs(this.$el)}},{name:`${Xe} focusout`,filter:({autoplay:m})=>f(m,"hover"),handler(m){st(m)||gs(this.$el)}}],observe:[la({filter:({$el:m,autoplay:D})=>D&&D!=="hover"&&T1(m),handler([{isIntersecting:m}]){document.fullscreenElement||(m?Gl(this.$el):gs(this.$el))},args:{intersecting:!1},options:({$el:m,autoplay:D})=>({root:D==="inview"?null:Gt(m)})})]};function zg(m){return!m.paused&&!m.ended}var Mx={mixins:[qg],props:{width:Number,height:Number},data:{automute:!0},created(){this.useObjectFit=jr(this.$el,"img","video")},observe:li({target:({$el:m})=>Tx(m)||Gt(m),filter:({useObjectFit:m})=>!m}),update:{read(){if(this.useObjectFit)return!1;let{ratio:m,cover:D}=ct,{$el:_,width:$,height:Q}=this,ae={width:$,height:Q};if(!$||!Q){let et={width:_.naturalWidth||_.videoWidth||_.clientWidth,height:_.naturalHeight||_.videoHeight||_.clientHeight};$?ae=m(et,"width",$):Q?ae=m(et,"height",Q):ae=et}let{offsetHeight:pe,offsetWidth:Ne}=Tx(_)||Gt(_),Fe=D(ae,{width:Ne,height:pe});return!Fe.width||!Fe.height?!1:Fe},write({height:m,width:D}){ke(this.$el,{height:m,width:D})},events:["resize"]}};function Tx(m){for(;m=Gt(m);)if(ke(m,"position")!=="static")return m}let pi;var ll={mixins:[ws,Pg,lu],args:"pos",props:{mode:"list",toggle:Boolean,boundary:Boolean,boundaryX:Boolean,boundaryY:Boolean,target:Boolean,targetX:Boolean,targetY:Boolean,stretch:Boolean,delayShow:Number,delayHide:Number,autoUpdate:Boolean,clsDrop:String,animateOut:Boolean,bgScroll:Boolean,closeOnScroll:Boolean},data:{mode:["click","hover"],toggle:"- *",boundary:!1,boundaryX:!1,boundaryY:!1,target:!1,targetX:!1,targetY:!1,stretch:!1,delayShow:0,delayHide:800,autoUpdate:!0,clsDrop:!1,animateOut:!1,bgScroll:!0,animation:["uk-animation-fade"],cls:"uk-open",container:!1,closeOnScroll:!1},computed:{boundary({boundary:m,boundaryX:D,boundaryY:_},$){return[Hn(D||m,$)||window,Hn(_||m,$)||window]},target({target:m,targetX:D,targetY:_},$){return D||(D=m||this.targetEl),_||(_=m||this.targetEl),[D===!0?window:Hn(D,$),_===!0?window:Hn(_,$)]}},created(){this.tracker=new Kd},beforeConnect(){this.clsDrop=this.$props.clsDrop||this.$options.id},connected(){Ue(this.$el,"uk-drop",this.clsDrop),this.toggle&&!this.targetEl&&(this.targetEl=Pm(this)),this._style=Ce(this.$el.style,["width","height"])},disconnected(){this.isActive()&&(this.hide(!1),pi=null),ke(this.$el,this._style)},events:[{name:"click",delegate:()=>".uk-drop-close",handler(m){m.preventDefault(),this.hide(!1)}},{name:"click",delegate:()=>'a[href*="#"]',handler({defaultPrevented:m,current:D}){let{hash:_}=D;!m&&_&&_a(D)&&!this.$el.contains(vr(_))&&this.hide(!1)}},{name:"beforescroll",handler(){this.hide(!1)}},{name:"toggle",self:!0,handler(m,D){m.preventDefault(),this.isToggled()?this.hide(!1):this.show(D?.$el,!1)}},{name:"toggleshow",self:!0,handler(m,D){m.preventDefault(),this.show(D?.$el)}},{name:"togglehide",self:!0,handler(m){m.preventDefault(),rr(this.$el,":focus,:hover")||this.hide()}},{name:`${nt} focusin`,filter:({mode:m})=>f(m,"hover"),handler(m){st(m)||this.clearTimers()}},{name:`${Xe} focusout`,filter:({mode:m})=>f(m,"hover"),handler(m){!st(m)&&m.relatedTarget&&this.hide()}},{name:"toggled",self:!0,handler(m,D){D&&(this.clearTimers(),this.position())}},{name:"show",self:!0,handler(){pi=this,this.tracker.init(),Qe(this.targetEl,"aria-expanded",!0);let m=[rS(this),nS(this),iS(this),this.autoUpdate&&Ix(this),this.closeOnScroll&&un(this)];Or(this.$el,"hide",()=>m.forEach(D=>D&&D()),{self:!0}),this.bgScroll||Or(this.$el,"hidden",cg(this.$el),{self:!0})}},{name:"beforehide",self:!0,handler:"clearTimers"},{name:"hide",handler({target:m}){if(this.$el!==m){pi=pi===null&&this.$el.contains(m)&&this.isToggled()?this:pi;return}pi=this.isActive()?null:pi,this.tracker.cancel(),Qe(this.targetEl,"aria-expanded",null)}}],update:{write(){this.isToggled()&&!Be(this.$el,this.clsEnter)&&this.position()}},methods:{show(m=this.targetEl,D=!0){if(this.isToggled()&&m&&this.targetEl&&m!==this.targetEl&&this.hide(!1,!1),this.targetEl=m,this.clearTimers(),!this.isActive()){if(pi){if(D&&pi.isDelaying()){this.showTimer=setTimeout(()=>rr(m,":hover")&&this.show(),10);return}let _;for(;pi&&_!==pi&&!pi.$el.contains(this.$el);)_=pi,pi.hide(!1,!1)}this.container&&Gt(this.$el)!==this.container&&Sn(this.container,this.$el),this.showTimer=setTimeout(()=>this.toggleElement(this.$el,!0),D&&this.delayShow||0)}},hide(m=!0,D=!0){let _=()=>this.toggleElement(this.$el,!1,this.animateOut&&D);this.clearTimers(),this.isDelayedHide=m,m&&this.isDelaying()?this.hideTimer=setTimeout(this.hide,50):m&&this.delayHide?this.hideTimer=setTimeout(_,this.delayHide):_()},clearTimers(){clearTimeout(this.showTimer),clearTimeout(this.hideTimer),this.showTimer=null,this.hideTimer=null},isActive(){return pi===this},isDelaying(){return[this.$el,...tn(".uk-drop",this.$el)].some(m=>this.tracker.movesTo(m))},position(){ge(this.$el,"uk-drop-stack"),ke(this.$el,this._style),this.$el.hidden=!0;let m=this.target.map(Q=>Ox(this.$el,Q)),D=this.getViewportOffset(this.$el),_=[[0,["x","width","left","right"]],[1,["y","height","top","bottom"]]];for(let[Q,[ae,pe]]of _)this.axis!==ae&&f([ae,!0],this.stretch)&&ke(this.$el,{[pe]:Math.min(Dr(this.boundary[Q])[pe],m[Q][pe]-2*D),[`overflow-${ae}`]:"auto"});let $=m[0].width-2*D;this.$el.hidden=!1,ke(this.$el,"maxWidth",""),this.$el.offsetWidth>$&&Ue(this.$el,"uk-drop-stack"),ke(this.$el,"maxWidth",$),this.positionAt(this.$el,this.target,this.boundary);for(let[Q,[ae,pe,Ne,Fe]]of _)if(this.axis===ae&&f([ae,!0],this.stretch)){let et=Math.abs(this.getPositionOffset()),it=Dr(this.target[Q]),ht=Dr(this.$el);ke(this.$el,{[pe]:(it[Ne]>ht[Ne]?it[this.inset?Fe:Ne]-Math.max(Dr(this.boundary[Q])[Ne],m[Q][Ne]+D):Math.min(Dr(this.boundary[Q])[Fe],m[Q][Fe]-D)-it[this.inset?Ne:Fe])-et,[`overflow-${ae}`]:"auto"}),this.positionAt(this.$el,this.target,this.boundary)}}}};function Ox(m,D){return Mo(su(D).find(_=>_.contains(m)))}function Pm(m){let{$el:D}=m.$create("toggle",Hn(m.toggle,m.$el),{target:m.$el,mode:m.mode});return Qe(D,"aria-haspopup",!0),D}function rS(m){let D=()=>m.$emit(),_=[pm(D),yc(su(m.$el).concat(m.target),D)];return()=>_.map($=>$.disconnect())}function Ix(m,D=()=>m.$emit()){return jt([document,...su(m.$el)],"scroll",D,{passive:!0})}function nS(m){return jt(document,"keydown",D=>{D.keyCode===Ir.ESC&&m.hide(!1)})}function un(m){return Ix(m,()=>m.hide(!1))}function iS(m){return jt(document,ye,({target:D})=>{m.$el.contains(D)||Or(document,`${Je} ${pt} scroll`,({defaultPrevented:_,type:$,target:Q})=>{var ae;!_&&$===Je&&D===Q&&!((ae=m.targetEl)!=null&&ae.contains(D))&&m.hide(!1)},!0)})}var Rm={mixins:[Xi,ws],props:{align:String,clsDrop:String,boundary:Boolean,dropbar:Boolean,dropbarAnchor:Boolean,duration:Number,mode:Boolean,offset:Boolean,stretch:Boolean,delayShow:Boolean,delayHide:Boolean,target:Boolean,targetX:Boolean,targetY:Boolean,animation:Boolean,animateOut:Boolean,closeOnScroll:Boolean},data:{align:j?"right":"left",clsDrop:"uk-dropdown",clsDropbar:"uk-dropnav-dropbar",boundary:!0,dropbar:!1,dropbarAnchor:!1,duration:200,container:!1,selNavItem:"> li > a, > ul > li > a"},computed:{dropbarAnchor:({dropbarAnchor:m},D)=>Hn(m,D)||D,dropbar({dropbar:m}){return m?(m=this._dropbar||Hn(m,this.$el)||vr(`+ .${this.clsDropbar}`,this.$el),m||(this._dropbar=vr("
    "))):null},dropContainer(m,D){return this.container||D},dropdowns({clsDrop:m},D){var _;let $=tn(`.${m}`,D);if(this.dropContainer!==D)for(let Q of tn(`.${m}`,this.dropContainer)){let ae=(_=this.getDropdown(Q))==null?void 0:_.targetEl;!f($,Q)&&ae&&this.$el.contains(ae)&&$.push(Q)}return $},items({selNavItem:m},D){return tn(m,D)}},watch:{dropbar(m){Ue(m,"uk-dropbar","uk-dropbar-top",this.clsDropbar,`uk-${this.$options.name}-dropbar`)},dropdowns(){this.initializeDropdowns()}},connected(){this.initializeDropdowns()},disconnected(){Ao(this._dropbar),delete this._dropbar},events:[{name:"mouseover focusin",delegate:({selNavItem:m})=>m,handler({current:m}){let D=this.getActive();D&&f(D.mode,"hover")&&D.targetEl&&!m.contains(D.targetEl)&&!D.isDelaying()&&D.hide(!1)}},{name:"keydown",self:!0,delegate:({selNavItem:m})=>m,handler(m){var D;let{current:_,keyCode:$}=m,Q=this.getActive();$===Ir.DOWN&&Q?.targetEl===_&&(m.preventDefault(),(D=vr(fr,Q.$el))==null||D.focus()),df(m,this.items,Q)}},{name:"keydown",el:({dropContainer:m})=>m,delegate:({clsDrop:m})=>`.${m}`,handler(m){var D;let{current:_,keyCode:$,target:Q}=m;if(Bt(Q)||!f(this.dropdowns,_))return;let ae=this.getActive(),pe=-1;if($===Ir.HOME?pe=0:$===Ir.END?pe="last":$===Ir.UP?pe="previous":$===Ir.DOWN?pe="next":$===Ir.ESC&&((D=ae.targetEl)==null||D.focus()),~pe){m.preventDefault();let Ne=tn(fr,_);Ne[de(pe,Ne,p(Ne,Fe=>rr(Fe,":focus")))].focus()}df(m,this.items,ae)}},{name:"mouseleave",el:({dropbar:m})=>m,filter:({dropbar:m})=>m,handler(){let m=this.getActive();m&&f(m.mode,"hover")&&!this.dropdowns.some(D=>rr(D,":hover"))&&m.hide()}},{name:"beforeshow",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){this.isDropbarDrop(m)&&(this.dropbar.previousElementSibling!==this.dropbarAnchor&&mc(this.dropbarAnchor,this.dropbar),Ue(m,`${this.clsDrop}-dropbar`))}},{name:"show",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){if(!this.isDropbarDrop(m))return;let D=this.getDropdown(m),_=()=>{let $=Math.max(...ao(m,`.${this.clsDrop}`).concat(m).map(Q=>Dr(Q).bottom));Dr(this.dropbar,{left:Dr(this.dropbar).left,top:this.getDropbarOffset(D.getPositionOffset())}),this.transitionTo($-Dr(this.dropbar).top+ie(ke(m,"marginBottom")),m)};this._observer=yc([D.$el,...D.target],_),_()}},{name:"beforehide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler(m){let D=this.getActive();rr(this.dropbar,":hover")&&D.$el===m.target&&this.isDropbarDrop(D.$el)&&f(D.mode,"hover")&&D.isDelayedHide&&!this.items.some(_=>D.targetEl!==_&&rr(_,":focus"))&&m.preventDefault()}},{name:"hide",el:({dropContainer:m})=>m,filter:({dropbar:m})=>m,handler({target:m}){var D;if(!this.isDropbarDrop(m))return;(D=this._observer)==null||D.disconnect();let _=this.getActive();(!_||_.$el===m)&&this.transitionTo(0)}}],methods:{getActive(){var m;return f(this.dropdowns,(m=pi)==null?void 0:m.$el)&&pi},async transitionTo(m,D){let{dropbar:_}=this,$=Yi(_);if(D=$0&&ke(D,"transitionDelay",`${Q/m*this.duration}ms`)}ke(D,"clipPath",`polygon(0 0,100% 0,100% ${$}px,0 ${$}px)`),Yi(_,$),await Promise.all([Tt.start(_,{height:m},this.duration),Tt.start(D,{clipPath:`polygon(0 0,100% 0,100% ${m}px,0 ${m}px)`},this.duration).finally(()=>ke(D,{clipPath:"",transitionDelay:""}))]).catch(He)},getDropdown(m){return this.$getComponent(m,"drop")||this.$getComponent(m,"dropdown")},isDropbarDrop(m){return f(this.dropdowns,m)&&Be(m,this.clsDrop)},getDropbarOffset(m){let{$el:D,target:_,targetY:$}=this,{top:Q,height:ae}=Dr(Hn($||_||D,D));return Q+ae+m},initializeDropdowns(){this.$create("drop",this.dropdowns.filter(m=>!this.getDropdown(m)),{...this.$props,flip:!1,shift:!0,pos:`bottom-${this.align}`,boundary:this.boundary===!0?this.$el:this.boundary})}}};function df(m,D,_){var $,Q,ae;let{current:pe,keyCode:Ne}=m,Fe=-1;Ne===Ir.HOME?Fe=0:Ne===Ir.END?Fe="last":Ne===Ir.LEFT?Fe="previous":Ne===Ir.RIGHT?Fe="next":Ne===Ir.TAB&&(($=_.targetEl)==null||$.focus(),(Q=_.hide)==null||Q.call(_,!1)),~Fe&&(m.preventDefault(),(ae=_.hide)==null||ae.call(_,!1),D[de(Fe,D,D.indexOf(_.targetEl||pe))].focus())}var pa={mixins:[Xi],args:"target",props:{target:Boolean},data:{target:!1},computed:{input:(m,D)=>vr(wt,D),state(){return this.input.nextElementSibling},target({target:m},D){return m&&(m===!0&&Gt(this.input)===D&&this.input.nextElementSibling||vr(m,D))}},update(){var m;let{target:D,input:_}=this;if(!D)return;let $,Q=Bt(D)?"value":"textContent",ae=D[Q],pe=(m=_.files)!=null&&m[0]?_.files[0].name:rr(_,"select")&&($=tn("option",_).filter(Ne=>Ne.selected)[0])?$.textContent:_.value;ae!==pe&&(D[Q]=pe)},events:[{name:"change",handler(){this.$emit()}},{name:"reset",el:({$el:m})=>m.closest("form"),handler(){this.$emit()}}]},qm={extends:ys,mixins:[Xi],name:"grid",props:{masonry:Boolean,parallax:String,parallaxStart:String,parallaxEnd:String,parallaxJustify:Boolean},data:{margin:"uk-grid-margin",clsStack:"uk-grid-stack",masonry:!1,parallax:0,parallaxStart:0,parallaxEnd:0,parallaxJustify:!1},connected(){this.masonry&&Ue(this.$el,"uk-flex-top","uk-flex-wrap-top")},observe:Kl({filter:({parallax:m,parallaxJustify:D})=>m||D}),update:[{write({rows:m}){Ke(this.$el,this.clsStack,!m.some(D=>D.length>1))},events:["resize"]},{read(m){let{rows:D}=m,{masonry:_,parallax:$,parallaxJustify:Q,margin:ae}=this;if($=Math.max(0,ii($)),!(_||$||Q)||zm(D)||D[0].some((lr,Ar)=>D.some(Rr=>Rr[Ar]&&Rr[Ar].offsetWidth!==lr.offsetWidth)))return m.translates=m.scrollColumns=!1;let pe=_x(D,ae),Ne,Fe;_?[Ne,Fe]=Fx(D,pe,_==="next"):Ne=kx(D);let et=Ne.map(lr=>Se(lr,"offsetHeight")+pe*(lr.length-1)),it=Math.max(0,...et),ht,Ot,Ut;return($||Q)&&(ht=et.map((lr,Ar)=>Q?it-lr+$:$/(Ar%2||8)),Q||($=Math.max(...et.map((lr,Ar)=>lr+ht[Ar]-it))),Ot=ii(this.parallaxStart,"height",this.$el,!0),Ut=ii(this.parallaxEnd,"height",this.$el,!0)),{columns:Ne,translates:Fe,scrollColumns:ht,parallaxStart:Ot,parallaxEnd:Ut,padding:$,height:Fe?it:""}},write({height:m,padding:D}){ke(this.$el,"paddingBottom",D||""),m!==!1&&ke(this.$el,"height",m)},events:["resize"]},{read({rows:m,scrollColumns:D,parallaxStart:_,parallaxEnd:$}){return{scrolled:D&&!zm(m)?dm(this.$el,_,$):!1}},write({columns:m,scrolled:D,scrollColumns:_,translates:$}){!D&&!$||m.forEach((Q,ae)=>Q.forEach((pe,Ne)=>{let[Fe,et]=$&&$[ae][Ne]||[0,0];D&&(et+=D*_[ae]),ke(pe,"transform",`translate(${Fe}px, ${et}px)`)}))},events:["scroll","resize"]}]};function zm(m){return m.flat().some(D=>ke(D,"position")==="absolute")}function Fx(m,D,_){let $=[],Q=[],ae=Array(m[0].length).fill(0),pe=0;for(let Ne of m){j&&(Ne=Ne.reverse());let Fe=0;for(let et in Ne){let{offsetWidth:it,offsetHeight:ht}=Ne[et],Ot=_?et:ae.indexOf(Math.min(...ae));jc($,Ot,Ne[et]),jc(Q,Ot,[(Ot-et)*it*(j?-1:1),ae[Ot]-pe]),ae[Ot]+=ht+D,Fe=Math.max(Fe,ht)}pe+=Fe+D}return[$,Q]}function _x(m,D){let _=m.flat().find($=>Be($,D));return ie(_?ke(_,"marginTop"):ke(m[0][0],"paddingLeft"))}function kx(m){let D=[];for(let _ of m)for(let $ in _)jc(D,$,_[$]);return D}function jc(m,D,_){m[D]||(m[D]=[]),m[D].push(_)}var Bx={args:"target",props:{target:String,row:Boolean},data:{target:"> *",row:!0},computed:{elements:({target:m},D)=>tn(m,D)},observe:li({target:({$el:m,elements:D})=>D.reduce((_,$)=>_.concat($,...$.children),[m])}),events:{name:"loadingdone",el:()=>document.fonts,handler(){this.$emit("resize")}},update:{read(){return{rows:(this.row?Pa(this.elements):[this.elements]).map(oS)}},write({rows:m}){for(let{heights:D,elements:_}of m)_.forEach(($,Q)=>ke($,"minHeight",D[Q]))},events:["resize"]}};function oS(m){if(m.length<2)return{heights:[""],elements:m};let D=m.map(Ug),_=Math.max(...D);return{heights:m.map(($,Q)=>D[Q].toFixed(2)===_.toFixed(2)?"":_),elements:m}}function Ug(m){let D=Ce(m.style,["display","minHeight"]);je(m)||ke(m,"display","block","important"),ke(m,"minHeight","");let _=Ht(m).height-iu(m,"height","content-box");return ke(m,D),_}var Lx={args:"target",props:{target:String},data:{target:""},computed:{target:{get:({target:m},D)=>Hn(m,D),observe:({target:m})=>m}},observe:li({target:({target:m})=>m}),update:{read(){return this.target?{height:this.target.offsetHeight}:!1},write({height:m}){ke(this.$el,{minHeight:m})},events:["resize"]}},zr={props:{expand:Boolean,offsetTop:Boolean,offsetBottom:Boolean,minHeight:Number},data:{expand:!1,offsetTop:!1,offsetBottom:!1,minHeight:0},observe:[Ec({filter:({expand:m})=>m}),li({target:({$el:m})=>Zu(m)})],update:{read(){if(!je(this.$el))return!1;let m="",D=iu(this.$el,"height","content-box"),{body:_,scrollingElement:$}=document,Q=vs(this.$el),{height:ae}=Mo(Q===_?$:Q),pe=$===Q||_===Q;if(m=`calc(${pe?"100vh":`${ae}px`}`,this.expand){let Ne=Ht(Q).height-Ht(this.$el).height;m+=` - ${Ne}px`}else{if(this.offsetTop)if(pe){let Ne=this.offsetTop===!0?this.$el:Hn(this.offsetTop,this.$el),{top:Fe}=Dr(Ne);m+=Fe>0&&Fe{if(!this._connected)return;let D=Ae(m,this.$el);return this.svgEl&&D!==this.svgEl&&Ao(this.svgEl),Ze.call(this,D,m),this.svgEl=D},He)},disconnected(){this.svg.then(m=>{this._connected||(xe(this.$el)&&(this.$el.hidden=!1),Ao(m),this.svgEl=null)}),this.svg=null},methods:{async getSvg(){}}};function Ae(m,D){if(xe(D)||jr(D,"canvas")){D.hidden=!0;let $=D.nextElementSibling;return Ie(m,$)?$:mc(D,m)}let _=D.lastElementChild;return Ie(m,_)?_:Sn(D,m)}function Ie(m,D){return jr(m,"svg")&&jr(D,"svg")&&m.innerHTML===D.innerHTML}function Ze(m,D){let _=["width","height"],$=_.map(ae=>this[ae]);$.some(ae=>ae)||($=_.map(ae=>Qe(D,ae)));let Q=Qe(D,"viewBox");Q&&!$.some(ae=>ae)&&($=Q.split(" ").slice(2)),$.forEach((ae,pe)=>Qe(m,_[pe],ie(ae)*this.ratio||null))}var $e={mixins:[se],args:"src",props:{src:String,icon:String,attributes:"list",strokeAnimation:Boolean},data:{strokeAnimation:!1},observe:[xs({async handler(){let m=await this.svg;m&&at.call(this,m)},options:{attributes:!0,attributeFilter:["id","class","style"]}})],async connected(){f(this.src,"#")&&([this.src,this.icon]=this.src.split("#"));let m=await this.svg;m&&(at.call(this,m),this.strokeAnimation&&Dt(m))},methods:{async getSvg(){return jr(this.$el,"img")&&!this.$el.complete&&this.$el.loading==="lazy"&&await new Promise(m=>Or(this.$el,"load",m)),yt(await mt(this.src),this.icon)||Promise.reject("SVG not found.")}}};function at(m){let{$el:D}=this;Ue(m,Qe(D,"class"),"uk-svg");for(let _=0;_m?a(m,"data:")?decodeURIComponent(m.split(",")[1]):(await fetch(m)).text():Promise.reject());function yt(m,D){return D&&f(m,"/g,At=be(function(m){let D={};bt.lastIndex=0;let _;for(;_=bt.exec(m);)D[_[3]]=``;return D});function Dt(m){let D=Mg(m);D&&ke(m,"--uk-animation-stroke",D)}function It(m){let D=document.createElement("template");return D.innerHTML=m,D.content.firstElementChild}let Yt={spinner:te,totop:oe,marker:sS,"close-icon":Px,"close-large":aS,"drop-parent-icon":gf,"nav-parent-icon":uS,"nav-parent-icon-large":Um,"navbar-parent-icon":An,"navbar-toggle-icon":lS,"overlay-icon":fS,"pagination-next":cS,"pagination-previous":Hm,"search-icon":c,"search-medium":E,"search-large":d,"search-toggle-icon":c,"slidenav-next":T,"slidenav-next-large":N,"slidenav-previous":G,"slidenav-previous-large":z},Vt={install:vf,mixins:[se],args:"icon",props:{icon:String},isIcon:!0,beforeConnect(){Ue(this.$el,"uk-icon")},methods:{async getSvg(){let m=Di(this.icon);if(!m)throw"Icon not found.";return m}}},sr={args:!1,extends:Vt,data:m=>({icon:i(m.constructor.options.name)}),beforeConnect(){Ue(this.$el,this.$options.id)}},Yr={extends:sr,beforeConnect(){let m=this.$props.icon;this.icon=this.$el.closest(".uk-nav-primary")?`${m}-large`:m}},ai={extends:sr,mixins:[bi],i18n:{toggle:"Open Search",submit:"Submit Search"},beforeConnect(){let m=Be(this.$el,"uk-search-toggle")||Be(this.$el,"uk-navbar-toggle");if(this.icon=m?"search-toggle-icon":Be(this.$el,"uk-search-icon")&&this.$el.closest(".uk-search-large")?"search-large":this.$el.closest(".uk-search-medium")?"search-medium":this.$props.icon,!ut(this.$el,"aria-label"))if(m){let D=this.t("toggle");Qe(this.$el,"aria-label",D)}else{let D=this.$el.closest("a,button");if(D){let _=this.t("submit");Qe(D,"aria-label",_)}}}},dn={extends:sr,beforeConnect(){Qe(this.$el,"role","status")},methods:{async getSvg(){let m=await Vt.methods.getSvg.call(this);return this.ratio!==1&&ke(vr("circle",m),"strokeWidth",1/this.ratio),m}}},Zn={extends:sr,mixins:[bi],beforeConnect(){let m=this.$el.closest("a,button");Qe(m,"role",this.role!==null&&jr(m,"a")?"button":this.role);let D=this.t("label");D&&!ut(m,"aria-label")&&Qe(m,"aria-label",D)}},_i={extends:Zn,beforeConnect(){Ue(this.$el,"uk-slidenav");let m=this.$props.icon;this.icon=Be(this.$el,"uk-slidenav-large")?`${m}-large`:m}},Ln={extends:Zn,i18n:{label:"Open menu"}},ji={extends:Zn,i18n:{label:"Close"},beforeConnect(){this.icon=`close-${Be(this.$el,"uk-close-large")?"large":"icon"}`}},mi={extends:Zn,i18n:{label:"Open"}},Xn={extends:Zn,i18n:{label:"Back to top"}},Pn={extends:Zn,i18n:{label:"Next page"},data:{role:null}},vn={extends:Zn,i18n:{label:"Previous page"},data:{role:null}},hi={};function vf(m){m.icon.add=(D,_)=>{let $=R(D)?{[D]:_}:D;we($,(Q,ae)=>{Yt[ae]=Q,delete hi[ae]}),m._initialized&&zo(document.body,Q=>we(m.getComponents(Q),ae=>{ae.$options.isIcon&&ae.icon in $&&ae.$reset()}))}}let gu={twitter:"x"};function Di(m){return m=gu[m]||m,Yt[m]?(hi[m]||(hi[m]=It(Yt[Ra(m)]||Yt[m])),hi[m].cloneNode(!0)):null}function Ra(m){return j?he(he(m,"left","right"),"previous","next"):m}var si={args:"dataSrc",props:{dataSrc:String,sources:String,margin:String,target:String,loading:String},data:{dataSrc:"",sources:!1,margin:"50%",target:!1,loading:"lazy"},connected(){this.loading!=="lazy"?this.load():tp(this.$el)&&(this.$el.loading="lazy",ep(this.$el))},disconnected(){this.img&&(this.img.onload=""),delete this.img},observe:la({handler(m,D){this.load(),D.disconnect()},options:({margin:m})=>({rootMargin:m}),filter:({loading:m})=>m==="lazy",target:({$el:m,$props:D})=>D.target?[m,...ra(D.target,m)]:m}),methods:{load(){if(this.img)return this.img;let m=tp(this.$el)?this.$el:fl(this.$el,this.dataSrc,this.sources);return Pt(m,"loading"),ep(this.$el,m.currentSrc),this.img=m}}};function ep(m,D){if(tp(m)){let _=Gt(m);(jr(_,"picture")?Er(_):[m]).forEach(Q=>vu(Q,Q))}else D&&!f(m.style.backgroundImage,D)&&(ke(m,"backgroundImage",`url(${Ba(D)})`),qt(m,Eo("load",!1)))}let As=["data-src","data-srcset","sizes"];function vu(m,D){for(let _ of As){let $=fe(m,_);$&&Qe(D,_.replace(/^(data-)+/,""),$)}}function fl(m,D,_){let $=new Image;return ki($,_),vu(m,$),$.onload=()=>{ep(m,$.currentSrc)},Qe($,"src",D),$}function ki(m,D){if(D=xf(D),D.length){let _=Vu("");for(let $ of D){let Q=Vu("");Qe(Q,$),Sn(_,Q)}Sn(_,m)}}function xf(m){if(!m)return[];if(a(m,"["))try{m=JSON.parse(m)}catch{m=[]}else m=Ju(m);return h(m)||(m=[m]),m.filter(D=>!H(D))}function tp(m){return jr(m,"img")}var xte={props:{target:String,selActive:String},data:{target:!1,selActive:!1},computed:{target:({target:m},D)=>m?tn(m,D):D},observe:[la({handler(m){this.isIntersecting=m.some(({isIntersecting:D})=>D),this.$emit()},target:({target:m})=>m,args:{intersecting:!1}}),xs({target:({target:m})=>m,options:{attributes:!0,attributeFilter:["class"],attributeOldValue:!0}}),{target:({target:m})=>m,observe:(m,D)=>{let _=yc([...Z(m),document.documentElement],D),$=[jt(document,"scroll itemshown itemhidden",D,{passive:!0,capture:!0}),jt(document,"show hide transitionstart",Q=>(D(),_.observe(Q.target))),jt(document,"shown hidden transitionend transitioncancel",Q=>(D(),_.unobserve(Q.target)))];return{observe:_.observe.bind(_),unobserve:_.unobserve.bind(_),disconnect(){_.disconnect(),$.map(Q=>Q())}}},handler(){this.$emit()}}],update:{read(){if(!this.isIntersecting)return!1;for(let m of Z(this.target)){let D=!this.selActive||rr(m,this.selActive)?yte(m):"";D!==!1&&Re(m,"uk-light uk-dark",D)}}}};function yte(m){let D=Ht(m),_=Ht(window);if(!Ee(D,_))return!1;let{left:$,top:Q,height:ae,width:pe}=D,Ne;for(let Fe of[.25,.5,.75]){let et=m.ownerDocument.elementsFromPoint(Math.max(0,Math.min($+pe*Fe,_.width-1)),Math.max(0,Math.min(Q+ae/2,_.height-1)));for(let it of et){if(m.contains(it)||!wte(it)||it.closest('[class*="-leave"]')&&et.some(Ot=>it!==Ot&&rr(Ot,'[class*="-enter"]')))continue;let ht=ke(it,"--uk-inverse");if(ht){if(ht===Ne)return`uk-${ht}`;Ne=ht;break}}}return Ne?`uk-${Ne}`:""}function wte(m){if(ke(m,"visibility")!=="visible")return!1;for(;m;){if(ke(m,"opacity")==="0")return!1;m=Gt(m)}return!0}var bte={mixins:[Xi,qc],props:{fill:String},data:{fill:"",clsWrapper:"uk-leader-fill",clsHide:"uk-leader-hide",attrFill:"data-fill"},computed:{fill:({fill:m},D)=>m||ke(D,"--uk-leader-fill-content")},connected(){[this.wrapper]=lm(this.$el,``)},disconnected(){Co(this.wrapper.childNodes)},observe:li(),update:{read(){return{width:Math.trunc(this.$el.offsetWidth/2),fill:this.fill,hide:!this.matchMedia}},write({width:m,fill:D,hide:_}){Ke(this.wrapper,this.clsHide,_),Qe(this.wrapper,this.attrFill,new Array(m).join(D))},events:["resize"]}},Dte={install:Nte,mixins:[fu],data:{clsPage:"uk-modal-page",selPanel:".uk-modal-dialog",selClose:".uk-modal-close, .uk-modal-close-default, .uk-modal-close-outside, .uk-modal-close-full"},events:[{name:"fullscreenchange webkitendfullscreen",capture:!0,handler(m){jr(m.target,"video")&&this.isToggled()&&!document.fullscreenElement&&this.hide()}},{name:"show",self:!0,handler(){Be(this.panel,"uk-margin-auto-vertical")?Ue(this.$el,"uk-flex"):ke(this.$el,"display","block"),Yi(this.$el)}},{name:"hidden",self:!0,handler(){ke(this.$el,"display",""),ge(this.$el,"uk-flex")}}]};function Nte({modal:m}){m.dialog=function(_,$){let Q=m(vr(`
    ${_}
    `),{stack:!0,role:"alertdialog",...$});return Q.show(),jt(Q.$el,"hidden",async()=>{await Promise.resolve(),Q.$destroy(!0)},{self:!0}),Q},m.alert=function(_,$){return D(({i18n:Q})=>`
    ${R(_)?_:ds(_)}
    `,$)},m.confirm=function(_,$){return D(({i18n:Q})=>`
    ${R(_)?_:ds(_)}
    `,$,()=>Promise.reject())},m.prompt=function(_,$,Q){let ae=D(({i18n:Fe})=>`
    `,Q,()=>null,()=>Ne.value),{$el:pe}=ae.dialog,Ne=vr("input",pe);return Ne.value=$||"",jt(pe,"show",()=>Ne.select()),ae},m.i18n={ok:"Ok",cancel:"Cancel"};function D(_,$,Q=He,ae=He){$={bgClose:!1,escClose:!0,...$,i18n:{...m.i18n,...$?.i18n}};let pe=m.dialog(_($),$);return b(new Promise(Ne=>{let Fe=jt(pe.$el,"hide",()=>Ne(Q()));jt(pe.$el,"submit","form",et=>{et.preventDefault(),Ne(ae(pe)),Fe(),pe.hide()})}),{dialog:pe})}}var Ste={extends:Ax,data:{targets:"> .uk-parent",toggle:"> a",content:"> ul"}};let pS="uk-navbar-transparent";var Ete={extends:Rm,props:{dropbarTransparentMode:Boolean},data:{clsDrop:"uk-navbar-dropdown",selNavItem:".uk-navbar-nav > li > a,a.uk-navbar-item,button.uk-navbar-item,.uk-navbar-item a,.uk-navbar-item button,.uk-navbar-toggle",dropbarTransparentMode:!1},computed:{navbarContainer:(m,D)=>D.closest(".uk-navbar-container")},watch:{items(){let m=Be(this.$el,"uk-navbar-justify"),D=tn(".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right",this.$el);for(let _ of D){let $=m?tn(".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle",_).length:"";ke(_,"flexGrow",$)}}},events:[{name:"show",el:({dropContainer:m})=>m,handler({target:m}){this.getTransparentMode(m)==="remove"&&Be(this.navbarContainer,pS)&&(ge(this.navbarContainer,pS),this._transparent=!0)}},{name:"hide",el:({dropContainer:m})=>m,async handler(){await Ate(),!this.getActive()&&this._transparent&&(Ue(this.navbarContainer,pS),this._transparent=null)}}],methods:{getTransparentMode(m){if(!this.navbarContainer)return;if(this.dropbar&&this.isDropbarDrop(m))return this.dropbarTransparentMode;let D=this.getDropdown(m);if(D&&Be(m,"uk-dropbar"))return D.inset?"behind":"remove"},getDropbarOffset(m){let{top:D,height:_}=Dr(this.navbarContainer);return D+(this.dropbarTransparentMode==="behind"?0:_+m)}}};function Ate(){return new Promise(m=>setTimeout(m))}var Cte={mixins:[fu],args:"mode",props:{mode:String,flip:Boolean,overlay:Boolean,swiping:Boolean},data:{mode:"slide",flip:!1,overlay:!1,clsPage:"uk-offcanvas-page",clsContainer:"uk-offcanvas-container",selPanel:".uk-offcanvas-bar",clsFlip:"uk-offcanvas-flip",clsContainerAnimation:"uk-offcanvas-container-animation",clsSidebarAnimation:"uk-offcanvas-bar-animation",clsMode:"uk-offcanvas",clsOverlay:"uk-offcanvas-overlay",selClose:".uk-offcanvas-close",container:!1,swiping:!0},computed:{clsFlip:({flip:m,clsFlip:D})=>m?D:"",clsOverlay:({overlay:m,clsOverlay:D})=>m?D:"",clsMode:({mode:m,clsMode:D})=>`${D}-${m}`,clsSidebarAnimation:({mode:m,clsSidebarAnimation:D})=>m==="none"||m==="reveal"?"":D,clsContainerAnimation:({mode:m,clsContainerAnimation:D})=>m!=="push"&&m!=="reveal"?"":D,transitionElement({mode:m}){return m==="reveal"?Gt(this.panel):this.panel}},observe:wm({filter:({swiping:m})=>m}),update:{read(){this.isToggled()&&!je(this.$el)&&this.hide()},events:["resize"]},events:[{name:"touchmove",self:!0,passive:!1,filter:({overlay:m})=>m,handler(m){m.cancelable&&m.preventDefault()}},{name:"show",self:!0,handler(){this.mode==="reveal"&&!Be(Gt(this.panel),this.clsMode)&&(um(this.panel,"
    "),Ue(Gt(this.panel),this.clsMode));let{body:m,scrollingElement:D}=document;Ue(m,this.clsContainer,this.clsFlip),ke(m,"touch-action","pan-y pinch-zoom"),ke(this.$el,"display","block"),ke(this.panel,"maxWidth",D.clientWidth),Ue(this.$el,this.clsOverlay),Ue(this.panel,this.clsSidebarAnimation,this.mode==="reveal"?"":this.clsMode),Yi(m),Ue(m,this.clsContainerAnimation),this.clsContainerAnimation&&Mte()}},{name:"hide",self:!0,handler(){ge(document.body,this.clsContainerAnimation),ke(document.body,"touch-action","")}},{name:"hidden",self:!0,handler(){this.clsContainerAnimation&&Tte(),this.mode==="reveal"&&Co(this.panel),ge(this.panel,this.clsSidebarAnimation,this.clsMode),ge(this.$el,this.clsOverlay),ke(this.$el,"display",""),ke(this.panel,"maxWidth",""),ge(document.body,this.clsContainer,this.clsFlip)}},{name:"swipeLeft swipeRight",handler(m){this.isToggled()&&s(m.type,"Left")^this.flip&&this.hide()}}]};function Mte(){pO().content+=",user-scalable=0"}function Tte(){let m=pO();m.content=m.content.replace(/,user-scalable=0$/,"")}function pO(){return vr('meta[name="viewport"]',document.head)||Sn(document.head,'')}var Ote={mixins:[Xi],props:{selContainer:String,selContent:String,minHeight:Number},data:{selContainer:".uk-modal",selContent:".uk-modal-dialog",minHeight:150},computed:{container:({selContainer:m},D)=>D.closest(m),content:({selContent:m},D)=>D.closest(m)},observe:li({target:({container:m,content:D})=>[m,D]}),update:{read(){return!this.content||!this.container||!je(this.$el)?!1:{max:Math.max(this.minHeight,Yi(this.container)-(Ht(this.content).height-Yi(this.$el)))}},write({max:m}){ke(this.$el,{minHeight:this.minHeight,maxHeight:m})},events:["resize"]}},Ite={props:["width","height"],connected(){Ue(this.$el,"uk-responsive-width"),ke(this.$el,"aspectRatio",`${this.width}/${this.height}`)}},Fte={props:{offset:Number},data:{offset:0},connected(){_te(this)},disconnected(){kte(this)},methods:{async scrollTo(m){m=m&&vr(m)||document.body,qt(this.$el,"beforescroll",[this,m])&&(await tg(m,{offset:this.offset}),qt(this.$el,"scrolled",[this,m]))}}};let Hg=new Set;function _te(m){Hg.size||jt(document,"click",mO),Hg.add(m)}function kte(m){Hg.delete(m),Hg.size||Gi(document,"click",mO)}function mO(m){if(!m.defaultPrevented)for(let D of Hg)D.$el.contains(m.target)&&_a(D.$el)&&(m.preventDefault(),window.location.href!==D.$el.href&&window.history.pushState({},"",D.$el.href),D.scrollTo(ka(D.$el)))}let mS="uk-scrollspy-inview";var Bte={args:"cls",props:{cls:String,target:String,hidden:Boolean,margin:String,repeat:Boolean,delay:Number},data:()=>({cls:"",target:!1,hidden:!0,margin:"-1px",repeat:!1,delay:0}),computed:{elements:({target:m},D)=>m?tn(m,D):[D]},watch:{elements(m){this.hidden&&ke(yi(m,`:not(.${mS})`),"opacity",0)}},connected(){this.elementData=new Map},disconnected(){for(let[m,D]of this.elementData.entries())ge(m,mS,D?.cls||"");delete this.elementData},observe:la({target:({elements:m})=>m,handler(m){let D=this.elementData;for(let{target:_,isIntersecting:$}of m){D.has(_)||D.set(_,{cls:fe(_,"uk-scrollspy-class")||this.cls});let Q=D.get(_);!this.repeat&&Q.show||(Q.show=$)}this.$emit()},options:({margin:m})=>({rootMargin:m}),args:{intersecting:!1}}),update:[{write(m){for(let[D,_]of this.elementData.entries())_.show&&!_.inview&&!_.queued?(_.queued=!0,m.promise=(m.promise||Promise.resolve()).then(()=>new Promise($=>setTimeout($,this.delay))).then(()=>{this.toggle(D,!0),setTimeout(()=>{_.queued=!1,this.$emit()},300)})):!_.show&&_.inview&&!_.queued&&this.repeat&&this.toggle(D,!1)}}],methods:{toggle(m,D){var _,$;let Q=(_=this.elementData)==null?void 0:_.get(m);if(!Q)return;($=Q.off)==null||$.call(Q),ke(m,"opacity",!D&&this.hidden?0:""),Ke(m,mS,D),Ke(m,Q.cls);let ae;if(ae=Q.cls.match(/\buk-animation-[\w-]+/g)){let pe=()=>ge(m,ae);D?Q.off=Or(m,"animationcancel animationend",pe,{self:!0}):pe()}qt(m,D?"inview":"outview"),Q.inview=D}}},Lte={props:{cls:String,closest:Boolean,scroll:Boolean,target:String,offset:Number},data:{cls:"uk-active",closest:!1,scroll:!1,target:"a[href]",offset:0},computed:{links:({target:m},D)=>tn(m,D).filter(_=>_a(_)),elements({closest:m}){return this.links.map(D=>D.closest(m||"*"))}},watch:{links(m){this.scroll&&this.$create("scroll",m,{offset:this.offset})}},observe:[la(),Kl()],update:[{read(){let m=this.links.map(Fe=>ka(Fe)||Fe.ownerDocument),{length:D}=m;if(!D||!je(this.$el))return!1;let _=vs(m,!0),{scrollTop:$,scrollHeight:Q}=_,ae=Mo(_),pe=Q-ae.height,Ne=!1;if($>=pe)Ne=D-1;else{let Fe=this.offset+Ht(Xu()).height+ae.height*.1;for(let et=0;et0);et++)Ne=+et}return{active:Ne}},write({active:m}){let D=m!==!1&&!Be(this.elements[m],this.cls);this.links.forEach(_=>_.blur());for(let _=0;_m&&vr(m,D)||D},connected(){this.start=hO(this.start||this.top),this.end=hO(this.end||this.bottom),this.placeholder=vr("+ .uk-sticky-placeholder",this.$el)||vr('
    '),this.isFixed=!1,this.setActive(!1)},beforeDisconnect(){this.isFixed&&(this.hide(),ge(this.target,this.clsInactive)),dO(this.$el),Ao(this.placeholder),this.placeholder=null},observe:[Ec(),Kl({target:()=>document.scrollingElement}),li({target:({$el:m})=>[m,Gt(m),document.scrollingElement],handler(m){this.$emit(this._data.resized&&m.some(({target:D})=>D===Gt(this.$el))?"update":"resize"),this._data.resized=!0}})],events:[{name:"load hashchange popstate",el:()=>window,filter:({targetOffset:m})=>m!==!1,handler(){let{scrollingElement:m}=document;!location.hash||m.scrollTop===0||setTimeout(()=>{let D=Dr(vr(location.hash)),_=Dr(this.$el);this.isFixed&&Ee(D,_)&&(m.scrollTop=Math.ceil(D.top-_.height-ii(this.targetOffset,"height",this.placeholder)-ii(this.offset,"height",this.placeholder)))})}}],update:[{read({height:m,width:D,margin:_,sticky:$},Q){if(this.inactive=!this.matchMedia||!je(this.$el)||!this.$el.offsetHeight,this.inactive)return;let ae=this.isFixed&&Q.has("update");ae&&(gS(this.target),this.hide()),this.active||({height:m,width:D}=Ht(this.$el),_=ke(this.$el,"margin")),ae&&this.show();let pe=ii("100vh","height"),Ne=Yi(window),Fe=Math.max(0,document.scrollingElement.scrollHeight-pe),et=this.position;this.overflowFlip&&m>pe&&(et=et==="top"?"bottom":"top");let it=this.isFixed?this.placeholder:this.$el,ht=ii(this.offset,"height",$?this.$el:it);et==="bottom"&&(mDr(Ot).top+(Fe?Math.min(Ne,pe):Ne),offsetParentTop:Dr(Ot.offsetParent).top,overflowScroll:Oe($+Oe(it,Q,ae)-Oe(m,Q,ae),0,_)}},write(m,D){let _=D.has("scroll"),{initTimestamp:$=0,dir:Q,prevDir:ae,scroll:pe,prevScroll:Ne=0,top:Fe,start:et,below:it}=m;if(pe<0||pe===Ne&&_||this.showOnUp&&!_&&!this.isFixed)return;let ht=Date.now();if((ht-$>300||Q!==ae)&&(m.initScroll=pe,m.initTimestamp=ht),!(this.showOnUp&&!this.isFixed&&Math.abs(m.initScroll-pe)<=30&&Math.abs(Ne-pe)<=10))if(this.inactive||pepe&&(hs.cancel(this.$el),this.hide());return}if(this.animation&&it){if(Be(this.$el,"uk-animation-leave"))return;hs.out(this.$el,this.animation).then(()=>this.hide(),He)}else this.hide()}else this.isFixed?this.update():this.animation&&it?(this.show(),hs.in(this.$el,this.animation).catch(He)):(gS(this.target),this.show())},events:["resize","resizeViewport","scroll"]}],methods:{show(){this.isFixed=!0,this.update(),this.placeholder.hidden=!1},hide(){let{offset:m,sticky:D}=this._data;this.setActive(!1),ge(this.$el,this.clsFixed,this.clsBelow),D?ke(this.$el,"top",m):ke(this.$el,{position:"",top:"",width:"",marginTop:""}),this.placeholder.hidden=!0,this.isFixed=!1},update(){let{width:m,scroll:D=0,overflow:_,overflowScroll:$=0,start:Q,end:ae,offset:pe,offsetParentTop:Ne,sticky:Fe,below:et}=this._data,it=Q!==0||D>Q;if(!Fe){let ht="fixed";D>ae&&(pe+=ae-Ne+$-_,ht="absolute"),ke(this.$el,{position:ht,width:m,marginTop:0},"important")}ke(this.$el,"top",pe-$),this.setActive(it),Ke(this.$el,this.clsBelow,et),Ue(this.$el,this.clsFixed)},setActive(m){let D=this.active;this.active=m,m?(Re(this.target,this.clsInactive,this.clsActive),D!==m&&qt(this.$el,"active")):(Re(this.target,this.clsActive,this.clsInactive),D!==m&&(gS(this.target),qt(this.$el,"inactive")))}}};function hS(m,D,_,$){if(!m)return 0;if(U(m)||R(m)&&m.match(/^-?\d/))return _+ii(m,"height",D,!0);{let Q=m===!0?Gt(D):Hn(m,D);return Dr(Q).bottom-($&&Q?.contains(D)?ie(ke(Q,"paddingBottom")):0)}}function hO(m){return m==="true"?!0:m==="false"?!1:m}function dO(m){ke(m,{position:"",top:"",marginTop:"",width:""})}let dS="uk-transition-disable";function gS(m){Be(m,dS)||(Ue(m,dS),requestAnimationFrame(()=>ge(m,dS)))}let vS=".uk-disabled *, .uk-disabled, [disabled]";var gO={mixins:[lu],args:"connect",props:{connect:String,toggle:String,itemNav:String,active:Number,followFocus:Boolean,swiping:Boolean},data:{connect:"~.uk-switcher",toggle:"> * > :first-child",itemNav:!1,active:0,cls:"uk-active",attrItem:"uk-switcher-item",selVertical:".uk-nav",followFocus:!1,swiping:!0},computed:{connects:{get:({connect:m},D)=>ra(m,D),observe:({connect:m})=>m},connectChildren(){return this.connects.map(m=>Er(m)).flat()},toggles:({toggle:m},D)=>tn(m,D),children(m,D){return Er(D).filter(_=>this.toggles.some($=>_.contains($)))}},watch:{connects(m){this.swiping&&ke(m,"touchAction","pan-y pinch-zoom"),this.$emit()},connectChildren(){let m=Math.max(0,this.index());for(let D of this.connects)Er(D).forEach((_,$)=>Ke(_,this.cls,$===m));this.$emit()},toggles(m){this.$emit();let D=this.index();this.show(~D?D:m[this.active]||m[0])}},connected(){Qe(this.$el,"role","tablist")},observe:[Xl({targets:({connectChildren:m})=>m}),wm({target:({connects:m})=>m,filter:({swiping:m})=>m})],events:[{name:"click keydown",delegate:({toggle:m})=>m,handler(m){!rr(m.current,vS)&&(m.type==="click"||m.keyCode===Ir.SPACE)&&(m.preventDefault(),this.show(m.current))}},{name:"keydown",delegate:({toggle:m})=>m,handler(m){let{current:D,keyCode:_}=m,$=rr(this.$el,this.selVertical),Q=_===Ir.HOME?0:_===Ir.END?"last":_===Ir.LEFT&&!$||_===Ir.UP&&$?"previous":_===Ir.RIGHT&&!$||_===Ir.DOWN&&$?"next":-1;if(~Q){m.preventDefault();let ae=this.toggles.filter(Ne=>!rr(Ne,vS)),pe=ae[de(Q,ae,ae.indexOf(D))];pe.focus(),this.followFocus&&this.show(pe)}}},{name:"click",el:({$el:m,connects:D,itemNav:_})=>D.concat(_?ra(_,m):[]),delegate:({attrItem:m})=>`[${m}],[data-${m}]`,handler(m){m.target.closest("a,button")&&(m.preventDefault(),this.show(fe(m.current,this.attrItem)))}},{name:"swipeRight swipeLeft",filter:({swiping:m})=>m,el:({connects:m})=>m,handler({type:m}){this.show(s(m,"Left")?"next":"previous")}}],update(){var m;for(let D of this.connects)jr(D,"ul")&&Qe(D,"role","presentation");Qe(Er(this.$el),"role","presentation");for(let D in this.toggles){let _=this.toggles[D],$=(m=this.connects[0])==null?void 0:m.children[D];Qe(_,"role","tab"),$&&(_.id=hu(this,_),$.id=hu(this,$),Qe(_,"aria-controls",$.id),Qe($,{role:"tabpanel","aria-labelledby":_.id}))}Qe(this.$el,"aria-orientation",rr(this.$el,this.selVertical)?"vertical":null)},methods:{index(){return p(this.children,m=>Be(m,this.cls))},show(m){let D=this.toggles.filter(pe=>!rr(pe,vS)),_=this.index(),$=de(!I(m)||f(D,m)?m:0,D,de(this.toggles[_],D)),Q=de(D[$],this.toggles);this.children.forEach((pe,Ne)=>{Ke(pe,this.cls,Q===Ne),Qe(this.toggles[Ne],{"aria-selected":Q===Ne,tabindex:Q===Ne?null:-1})});let ae=_>=0&&_!==$;this.connects.forEach(async({children:pe})=>{let Ne=y(pe).filter((Fe,et)=>et!==Q&&Be(Fe,this.cls));await this.toggleElement(Ne,!1,ae)&&await this.toggleElement(pe[Q],!0,ae)})}}},Rte={mixins:[Xi],extends:gO,props:{media:Boolean},data:{media:960,attrItem:"uk-tab-item",selVertical:".uk-tab-left,.uk-tab-right"},connected(){let m=Be(this.$el,"uk-tab-left")?"uk-tab-left":Be(this.$el,"uk-tab-right")?"uk-tab-right":!1;m&&this.$create("toggle",this.$el,{cls:m,mode:"media",media:this.media})}};let qte=32;var zte={mixins:[qc,lu],args:"target",props:{href:String,target:null,mode:"list",queued:Boolean},data:{href:!1,target:!1,mode:"click",queued:!0},computed:{target:{get:({target:m},D)=>(m=ra(m||D.hash,D),m.length?m:[D]),observe:({target:m})=>m}},connected(){f(this.mode,"media")||(Gr(this.$el)||Qe(this.$el,"tabindex","0"),!this.cls&&jr(this.$el,"a")&&Qe(this.$el,"role","button"))},observe:Xl({targets:({target:m})=>m}),events:[{name:ye,filter:({mode:m})=>f(m,"hover"),handler(m){this._preventClick=null,!(!st(m)||P(this._showState)||this.$el.disabled)&&(qt(this.$el,"focus"),Or(document,ye,()=>qt(this.$el,"blur"),!0,D=>!this.$el.contains(D.target)),f(this.mode,"click")&&(this._preventClick=!0))}},{name:`mouseenter mouseleave ${nt} ${Xe} focus blur`,filter:({mode:m})=>f(m,"hover"),handler(m){if(st(m)||this.$el.disabled)return;let D=f(["mouseenter",nt,"focus"],m.type),_=this.isToggled(this.target);if(!D&&(!P(this._showState)||m.type!=="blur"&&rr(this.$el,":focus")||m.type==="blur"&&rr(this.$el,":hover"))){_===this._showState&&(this._showState=null);return}D&&P(this._showState)&&_!==this._showState||(this._showState=D?_:null,this.toggle(`toggle${D?"show":"hide"}`))}},{name:"keydown",filter:({$el:m,mode:D})=>f(D,"click")&&!jr(m,"input"),handler(m){m.keyCode===qte&&(m.preventDefault(),this.$el.click())}},{name:"click",filter:({mode:m})=>["click","hover"].some(D=>f(m,D)),handler(m){let D;(this._preventClick||m.target.closest('a[href="#"], a[href=""]')||(D=m.target.closest("a[href]"))&&(!this.isToggled(this.target)||D.hash&&rr(this.target,D.hash)))&&m.preventDefault(),!this._preventClick&&f(this.mode,"click")&&this.toggle()}},{name:"mediachange",filter:({mode:m})=>f(m,"media"),el:({target:m})=>m,handler(m,D){D.matches^this.isToggled(this.target)&&this.toggle()}}],methods:{async toggle(m){if(!qt(this.target,m||"toggle",[this]))return;if(ut(this.$el,"aria-expanded")&&Qe(this.$el,"aria-expanded",!this.isToggled(this.target)),!this.queued)return this.toggleElement(this.target);let D=this.target.filter($=>Be($,this.clsLeave));if(D.length){for(let $ of this.target){let Q=f(D,$);this.toggleElement($,Q,Q)}return}let _=this.target.filter(this.isToggled);await this.toggleElement(_,!1)&&await this.toggleElement(this.target.filter($=>!f(_,$)),!0)}}},Ute=Object.freeze({__proto__:null,Accordion:Ax,Alert:eS,Close:ji,Cover:Mx,Drop:ll,DropParentIcon:sr,Dropdown:ll,Dropnav:Rm,FormCustom:pa,Grid:qm,HeightMatch:Bx,HeightPlaceholder:Lx,HeightViewport:zr,Icon:Vt,Img:si,Inverse:xte,Leader:bte,Margin:ys,Marker:mi,Modal:Dte,Nav:Ste,NavParentIcon:Yr,Navbar:Ete,NavbarParentIcon:sr,NavbarToggleIcon:Ln,Offcanvas:Cte,OverflowAuto:Ote,OverlayIcon:sr,PaginationNext:Pn,PaginationPrevious:vn,Responsive:Ite,Scroll:Fte,Scrollspy:Bte,ScrollspyNav:Lte,SearchIcon:ai,SlidenavNext:_i,SlidenavPrevious:_i,Spinner:dn,Sticky:Pte,Svg:$e,Switcher:gO,Tab:Rte,Toggle:zte,Totop:Xn,Video:qg});return we(Ute,(m,D)=>Yn.component(D,m)),QN(Yn),we(Dx,(m,D)=>Yn.component(D,m)),Yn})});var Dy=vt((lE,fE)=>{g();x();v();(function(e,t){typeof lE=="object"&&typeof fE<"u"?fE.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=t())})(lE,function(){"use strict";function e(){return!0}function t(){return!1}function r(){}let n="Argument is not a typed-function.";function i(){function u(ne){return typeof ne=="object"&&ne!==null&&ne.constructor===Object}let l=[{name:"number",test:function(ne){return typeof ne=="number"}},{name:"string",test:function(ne){return typeof ne=="string"}},{name:"boolean",test:function(ne){return typeof ne=="boolean"}},{name:"Function",test:function(ne){return typeof ne=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(ne){return ne instanceof Date}},{name:"RegExp",test:function(ne){return ne instanceof RegExp}},{name:"Object",test:u},{name:"null",test:function(ne){return ne===null}},{name:"undefined",test:function(ne){return ne===void 0}}],a={name:"any",test:e,isAny:!0},s,f,p=0,h={createCount:0};function y(ne){let me=s.get(ne);if(me)return me;let ye='Unknown type "'+ne+'"',_e=ne.toLowerCase(),Je;for(Je of f)if(Je.toLowerCase()===_e){ye+='. Did you mean "'+Je+'" ?';break}throw new TypeError(ye)}function b(ne){let me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",ye=me?y(me).index:f.length,_e=[];for(let nt=0;nt{let _e=s.get(ye);return!_e.isAny&&_e.test(ne)});return me.length?me:["any"]}function O(ne){return ne&&typeof ne=="function"&&"_typedFunctionData"in ne}function M(ne,me,ye){if(!O(ne))throw new TypeError(n);let _e=ye&&ye.exact,Je=Array.isArray(me)?me.join(","):me,nt=U(Je),Xe=C(nt);if(!_e||Xe in ne.signatures){let Ye=ne._typedFunctionData.signatureMap.get(Xe);if(Ye)return Ye}let pt=nt.length,X;if(_e){X=[];let Ye;for(Ye in ne.signatures)X.push(ne._typedFunctionData.signatureMap.get(Ye))}else X=ne._typedFunctionData.signatures;for(let Ye=0;Ye!Gr.has(Gt.name)))continue}wt.push(Bt)}}if(X=wt,X.length===0)break}let xe;for(xe of X)if(xe.params.length<=pt)return xe;throw new TypeError("Signature not found (signature: "+(ne.name||"unnamed")+"("+C(nt,", ")+"))")}function I(ne,me,ye){return M(ne,me,ye).implementation}function F(ne,me){let ye=y(me);if(ye.test(ne))return ne;let _e=ye.conversionsTo;if(_e.length===0)throw new Error("There are no conversions to "+me+" defined.");for(let Je=0;Je<_e.length;Je++)if(y(_e[Je].from).test(ne))return _e[Je].convert(ne);throw new Error("Cannot convert "+ne+" to "+me)}function C(ne){let me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return ne.map(ye=>ye.name).join(me)}function P(ne){let me=ne.indexOf("...")===0,_e=(me?ne.length>3?ne.slice(3):"any":ne).split("|").map(pt=>y(pt.trim())),Je=!1,nt=me?"...":"";return{types:_e.map(function(pt){return Je=pt.isAny||Je,nt+=pt.name+"|",{name:pt.name,typeIndex:pt.index,test:pt.test,isAny:pt.isAny,conversion:null,conversionIndex:-1}}),name:nt.slice(0,-1),hasAny:Je,hasConversion:!1,restParam:me}}function R(ne){let me=ne.types.map(Xe=>Xe.name),ye=ce(me),_e=ne.hasAny,Je=ne.name,nt=ye.map(function(Xe){let pt=y(Xe.from);return _e=pt.isAny||_e,Je+="|"+Xe.from,{name:Xe.from,typeIndex:pt.index,test:pt.test,isAny:pt.isAny,conversion:Xe,conversionIndex:Xe.index}});return{types:ne.types.concat(nt),name:Je,hasAny:_e,hasConversion:nt.length>0,restParam:ne.restParam}}function q(ne){return ne.typeSet||(ne.typeSet=new Set,ne.types.forEach(me=>ne.typeSet.add(me.name))),ne.typeSet}function U(ne){let me=[];if(typeof ne!="string")throw new TypeError("Signatures must be strings");let ye=ne.trim();if(ye==="")return me;let _e=ye.split(",");for(let Je=0;Je<_e.length;++Je){let nt=P(_e[Je].trim());if(nt.restParam&&Je!==_e.length-1)throw new SyntaxError('Unexpected rest parameter "'+_e[Je]+'": only allowed for the last parameter');if(nt.types.length===0)return null;me.push(nt)}return me}function H(ne){let me=de(ne);return me?me.restParam:!1}function V(ne){if(!ne||ne.types.length===0)return e;if(ne.types.length===1)return y(ne.types[0].name).test;if(ne.types.length===2){let me=y(ne.types[0].name).test,ye=y(ne.types[1].name).test;return function(Je){return me(Je)||ye(Je)}}else{let me=ne.types.map(function(ye){return y(ye.name).test});return function(_e){for(let Je=0;Je=Je+1}}else return ne.length===0?function(nt){return nt.length===0}:ne.length===1?(ye=V(ne[0]),function(nt){return ye(nt[0])&&nt.length===1}):ne.length===2?(ye=V(ne[0]),_e=V(ne[1]),function(nt){return ye(nt[0])&&_e(nt[1])&&nt.length===2}):(me=ne.map(V),function(nt){for(let Xe=0;Xe{let Je=ie(_e.params,me),nt;for(nt of Je)ye.add(nt)}),ye.has("any")?["any"]:Array.from(ye)}function le(ne,me,ye){let _e,Je,nt=ne||"unnamed",Xe=ye,pt;for(pt=0;pt{let Bt=ee(wt.params,pt),fr=V(Bt);(pt0){let wt=S(me[pt]);return _e=new TypeError("Unexpected type of argument in function "+nt+" (expected: "+Je.join(" or ")+", actual: "+wt.join(" | ")+", index: "+pt+")"),_e.data={category:"wrongType",fn:nt,index:pt,actual:wt,expected:Je},_e}}else Xe=je}let X=Xe.map(function(je){return H(je.params)?1/0:je.params.length});if(me.lengthxe)return _e=new TypeError("Too many arguments in function "+nt+" (expected: "+xe+", actual: "+me.length+")"),_e.data={category:"tooManyArgs",fn:nt,index:me.length,expectedLength:xe},_e;let Ye=[];for(let je=0;je0)return 1;let _e=he(ne)-he(me);return _e<0?-1:_e>0?1:0}function we(ne,me){let ye=ne.params,_e=me.params,Je=de(ye),nt=de(_e),Xe=H(ye),pt=H(_e);if(Xe&&Je.hasAny){if(!pt||!nt.hasAny)return 1}else if(pt&&nt.hasAny)return-1;let X=0,xe=0,Ye;for(Ye of ye)Ye.hasAny&&++X,Ye.hasConversion&&++xe;let je=0,wt=0;for(Ye of _e)Ye.hasAny&&++je,Ye.hasConversion&&++wt;if(X!==je)return X-je;if(Xe&&Je.hasConversion){if(!pt||!nt.hasConversion)return 1}else if(pt&&nt.hasConversion)return-1;if(xe!==wt)return xe-wt;if(Xe){if(!pt)return 1}else if(pt)return-1;let Bt=(ye.length-_e.length)*(Xe?-1:1);if(Bt!==0)return Bt;let fr=[],Gr=0;for(let yi=0;yi1&&me.sort((Je,nt)=>Je.index-nt.index);let ye=me[0].conversionsTo;if(ne.length===1)return ye;ye=ye.concat([]);let _e=new Set(ne);for(let Je=1;JeJe.hasConversion)){let Je=H(ne),nt=ne.map(Pe);ye=function(){let pt=[],X=Je?arguments.length-1:arguments.length;for(let xe=0;xeX.name).join("|"),hasAny:pt.some(X=>X.isAny),hasConversion:!1,restParam:!0}),Xe.push(nt)}else Xe=nt.types.map(function(pt){return{types:[pt],name:pt.name,hasAny:pt.isAny,hasConversion:pt.conversion,restParam:!1}});return ge(Xe,function(pt){return me(ye,_e+1,Je.concat([pt]))})}else return[Je]}return me(ne,0,[])}function Oe(ne,me){let ye=Math.max(ne.length,me.length);for(let pt=0;pt=_e:Xe?_e>=Je:_e===Je}function He(ne){return ne.map(me=>Qe(me)?Ke(me.referToSelf.callback):ot(me)?Be(me.referTo.references,me.referTo.callback):me)}function Ee(ne,me,ye){let _e=[],Je;for(Je of ne){let nt=ye[Je];if(typeof nt!="number")throw new TypeError('No definition for referenced signature "'+Je+'"');if(nt=me[nt],typeof nt!="function")return!1;_e.push(nt)}return _e}function ze(ne,me,ye){let _e=He(ne),Je=new Array(_e.length).fill(!1),nt=!0;for(;nt;){nt=!1;let Xe=!0;for(let pt=0;pt<_e.length;++pt){if(Je[pt])continue;let X=_e[pt];if(Qe(X))_e[pt]=X.referToSelf.callback(ye),_e[pt].referToSelf=X.referToSelf,Je[pt]=!0,Xe=!1;else if(ot(X)){let xe=Ee(X.referTo.references,_e,me);xe?(_e[pt]=X.referTo.callback.apply(this,xe),_e[pt].referTo=X.referTo,Je[pt]=!0,Xe=!1):nt=!0}}if(Xe&&nt)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return _e}function We(ne){let me=/\bthis(\(|\.signatures\b)/;Object.keys(ne).forEach(ye=>{let _e=ne[ye];if(me.test(_e.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function Le(ne,me){if(h.createCount++,Object.keys(me).length===0)throw new SyntaxError("No signatures provided");h.warnAgainstDeprecatedThis&&We(me);let ye=[],_e=[],Je={},nt=[],Xe;for(Xe in me){if(!Object.prototype.hasOwnProperty.call(me,Xe))continue;let ue=U(Xe);if(!ue)continue;ye.forEach(function(rt){if(Oe(rt,ue))throw new TypeError('Conflicting signatures "'+C(rt)+'" and "'+C(ue)+'".')}),ye.push(ue);let Me=_e.length;_e.push(me[Xe]);let st=ue.map(R),dt;for(dt of Ce(st)){let rt=C(dt);nt.push({params:dt,name:rt,fn:Me}),dt.every(ke=>!ke.hasConversion)&&(Je[rt]=Me)}}nt.sort(we);let pt=ze(_e,Je,$n),X;for(X in Je)Object.prototype.hasOwnProperty.call(Je,X)&&(Je[X]=pt[Je[X]]);let xe=[],Ye=new Map;for(X of nt)Ye.has(X.name)||(X.fn=pt[X.fn],xe.push(X),Ye.set(X.name,X));let je=xe[0]&&xe[0].params.length<=2&&!H(xe[0].params),wt=xe[1]&&xe[1].params.length<=2&&!H(xe[1].params),Bt=xe[2]&&xe[2].params.length<=2&&!H(xe[2].params),fr=xe[3]&&xe[3].params.length<=2&&!H(xe[3].params),Gr=xe[4]&&xe[4].params.length<=2&&!H(xe[4].params),Gt=xe[5]&&xe[5].params.length<=2&&!H(xe[5].params),yi=je&&wt&&Bt&&fr&&Gr&≫for(let ue=0;ueue.test),oa=xe.map(ue=>ue.implementation),$u=function(){for(let Me=Eo;MeC(U(ye))),me=de(arguments);if(typeof me!="function")throw new TypeError("Callback function expected as last argument");return Be(ne,me)}function Be(ne,me){return{referTo:{references:ne,callback:me}}}function Ke(ne){if(typeof ne!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:ne}}}function ot(ne){return ne&&typeof ne.referTo=="object"&&Array.isArray(ne.referTo.references)&&typeof ne.referTo.callback=="function"}function Qe(ne){return ne&&typeof ne.referToSelf=="object"&&typeof ne.referToSelf.callback=="function"}function ut(ne,me){if(!ne)return me;if(me&&me!==ne){let ye=new Error("Function names do not match (expected: "+ne+", actual: "+me+")");throw ye.data={actual:me,expected:ne},ye}return ne}function Pt(ne){let me;for(let ye in ne)Object.prototype.hasOwnProperty.call(ne,ye)&&(O(ne[ye])||typeof ne[ye].signature=="string")&&(me=ut(me,ne[ye].name));return me}function fe(ne,me){let ye;for(ye in me)if(Object.prototype.hasOwnProperty.call(me,ye)){if(ye in ne&&me[ye]!==ne[ye]){let _e=new Error('Signature "'+ye+'" is defined twice');throw _e.data={signature:ye,sourceFunction:me[ye],destFunction:ne[ye]},_e}ne[ye]=me[ye]}}let J=h;h=function(ne){let me=typeof ne=="string",ye=me?1:0,_e=me?ne:"",Je={};for(let nt=ye;nt1&&arguments[1]!==void 0?arguments[1]:{override:!1};j(ne);let ye=y(ne.to),_e=ye.conversionsTo.find(Je=>Je.from===ne.from);if(_e)if(me&&me.override)h.removeConversion({from:_e.from,to:ne.to,convert:_e.convert});else throw new Error('There is already a conversion from "'+ne.from+'" to "'+ye.name+'"');ye.conversionsTo.push({from:ne.from,convert:ne.convert,index:p++})},h.addConversions=function(ne,me){ne.forEach(ye=>h.addConversion(ye,me))},h.removeConversion=function(ne){j(ne);let me=y(ne.to),ye=Ue(me.conversionsTo,Je=>Je.from===ne.from);if(!ye)throw new Error("Attempt to remove nonexistent conversion from "+ne.from+" to "+ne.to);if(ye.convert!==ne.convert)throw new Error("Conversion to remove does not match existing conversion");let _e=me.conversionsTo.indexOf(ye);me.conversionsTo.splice(_e,1)},h.resolve=function(ne,me){if(!O(ne))throw new TypeError(n);let ye=ne._typedFunctionData.signatures;for(let _e=0;_e{g();x();v();(function(e){"use strict";var t=Math.cosh||function(s){return Math.abs(s)<1e-9?1-s:(Math.exp(s)+Math.exp(-s))*.5},r=Math.sinh||function(s){return Math.abs(s)<1e-9?s:(Math.exp(s)-Math.exp(-s))*.5},n=function(s){var f=Math.PI/4;if(-f>s||s>f)return Math.cos(s)-1;var p=s*s;return p*(p*(p*(p*(p*(p*(p*(p/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},i=function(s,f){var p=Math.abs(s),h=Math.abs(f);return p<3e3&&h<3e3?Math.sqrt(p*p+h*h):(p0&&o();break;case"number":p.im=0,p.re=s;break;default:o()}return isNaN(p.re)||isNaN(p.im),p};function a(s,f){if(!(this instanceof a))return new a(s,f);var p=l(s,f);this.re=p.re,this.im=p.im}a.prototype={re:0,im:0,sign:function(){var s=this.abs();return new a(this.re/s,this.im/s)},add:function(s,f){var p=new a(s,f);return this.isInfinite()&&p.isInfinite()?a.NAN:this.isInfinite()||p.isInfinite()?a.INFINITY:new a(this.re+p.re,this.im+p.im)},sub:function(s,f){var p=new a(s,f);return this.isInfinite()&&p.isInfinite()?a.NAN:this.isInfinite()||p.isInfinite()?a.INFINITY:new a(this.re-p.re,this.im-p.im)},mul:function(s,f){var p=new a(s,f);return this.isInfinite()&&p.isZero()||this.isZero()&&p.isInfinite()?a.NAN:this.isInfinite()||p.isInfinite()?a.INFINITY:p.im===0&&this.im===0?new a(this.re*p.re,0):new a(this.re*p.re-this.im*p.im,this.re*p.im+this.im*p.re)},div:function(s,f){var p=new a(s,f);if(this.isZero()&&p.isZero()||this.isInfinite()&&p.isInfinite())return a.NAN;if(this.isInfinite()||p.isZero())return a.INFINITY;if(this.isZero()||p.isInfinite())return a.ZERO;s=this.re,f=this.im;var h=p.re,y=p.im,b,w;return y===0?new a(s/h,f/h):Math.abs(h)0)return new a(Math.pow(s,p.re),0);if(s===0)switch((p.re%4+4)%4){case 0:return new a(Math.pow(f,p.re),0);case 1:return new a(0,Math.pow(f,p.re));case 2:return new a(-Math.pow(f,p.re),0);case 3:return new a(0,-Math.pow(f,p.re))}}if(s===0&&f===0&&p.re>0&&p.im>=0)return a.ZERO;var h=Math.atan2(f,s),y=u(s,f);return s=Math.exp(p.re*y-p.im*h),f=p.im*y+p.re*h,new a(s*Math.cos(f),s*Math.sin(f))},sqrt:function(){var s=this.re,f=this.im,p=this.abs(),h,y;if(s>=0){if(f===0)return new a(Math.sqrt(s),0);h=.5*Math.sqrt(2*(p+s))}else h=Math.abs(f)/Math.sqrt(2*(p-s));return s<=0?y=.5*Math.sqrt(2*(p-s)):y=Math.abs(f)/Math.sqrt(2*(p+s)),new a(h,f<0?-y:y)},exp:function(){var s=Math.exp(this.re);return this.im,new a(s*Math.cos(this.im),s*Math.sin(this.im))},expm1:function(){var s=this.re,f=this.im;return new a(Math.expm1(s)*Math.cos(f)+n(f),Math.exp(s)*Math.sin(f))},log:function(){var s=this.re,f=this.im;return f===0&&s>0,new a(u(s,f),Math.atan2(f,s))},abs:function(){return i(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var s=this.re,f=this.im;return new a(Math.sin(s)*t(f),Math.cos(s)*r(f))},cos:function(){var s=this.re,f=this.im;return new a(Math.cos(s)*t(f),-Math.sin(s)*r(f))},tan:function(){var s=2*this.re,f=2*this.im,p=Math.cos(s)+t(f);return new a(Math.sin(s)/p,r(f)/p)},cot:function(){var s=2*this.re,f=2*this.im,p=Math.cos(s)-t(f);return new a(-Math.sin(s)/p,r(f)/p)},sec:function(){var s=this.re,f=this.im,p=.5*t(2*f)+.5*Math.cos(2*s);return new a(Math.cos(s)*t(f)/p,Math.sin(s)*r(f)/p)},csc:function(){var s=this.re,f=this.im,p=.5*t(2*f)-.5*Math.cos(2*s);return new a(Math.sin(s)*t(f)/p,-Math.cos(s)*r(f)/p)},asin:function(){var s=this.re,f=this.im,p=new a(f*f-s*s+1,-2*s*f).sqrt(),h=new a(p.re-f,p.im+s).log();return new a(h.im,-h.re)},acos:function(){var s=this.re,f=this.im,p=new a(f*f-s*s+1,-2*s*f).sqrt(),h=new a(p.re-f,p.im+s).log();return new a(Math.PI/2-h.im,h.re)},atan:function(){var s=this.re,f=this.im;if(s===0){if(f===1)return new a(0,1/0);if(f===-1)return new a(0,-1/0)}var p=s*s+(1-f)*(1-f),h=new a((1-f*f-s*s)/p,-2*s/p).log();return new a(-.5*h.im,.5*h.re)},acot:function(){var s=this.re,f=this.im;if(f===0)return new a(Math.atan2(1,s),0);var p=s*s+f*f;return p!==0?new a(s/p,-f/p).atan():new a(s!==0?s/0:0,f!==0?-f/0:0).atan()},asec:function(){var s=this.re,f=this.im;if(s===0&&f===0)return new a(0,1/0);var p=s*s+f*f;return p!==0?new a(s/p,-f/p).acos():new a(s!==0?s/0:0,f!==0?-f/0:0).acos()},acsc:function(){var s=this.re,f=this.im;if(s===0&&f===0)return new a(Math.PI/2,1/0);var p=s*s+f*f;return p!==0?new a(s/p,-f/p).asin():new a(s!==0?s/0:0,f!==0?-f/0:0).asin()},sinh:function(){var s=this.re,f=this.im;return new a(r(s)*Math.cos(f),t(s)*Math.sin(f))},cosh:function(){var s=this.re,f=this.im;return new a(t(s)*Math.cos(f),r(s)*Math.sin(f))},tanh:function(){var s=2*this.re,f=2*this.im,p=t(s)+Math.cos(f);return new a(r(s)/p,Math.sin(f)/p)},coth:function(){var s=2*this.re,f=2*this.im,p=t(s)-Math.cos(f);return new a(r(s)/p,-Math.sin(f)/p)},csch:function(){var s=this.re,f=this.im,p=Math.cos(2*f)-t(2*s);return new a(-2*r(s)*Math.cos(f)/p,2*t(s)*Math.sin(f)/p)},sech:function(){var s=this.re,f=this.im,p=Math.cos(2*f)+t(2*s);return new a(2*t(s)*Math.cos(f)/p,-2*r(s)*Math.sin(f)/p)},asinh:function(){var s=this.im;this.im=-this.re,this.re=s;var f=this.asin();return this.re=-this.im,this.im=s,s=f.re,f.re=-f.im,f.im=s,f},acosh:function(){var s=this.acos();if(s.im<=0){var f=s.re;s.re=-s.im,s.im=f}else{var f=s.im;s.im=-s.re,s.re=f}return s},atanh:function(){var s=this.re,f=this.im,p=s>1&&f===0,h=1-s,y=1+s,b=h*h+f*f,w=b!==0?new a((y*h-f*f)/b,(f*h+y*f)/b):new a(s!==-1?s/0:0,f!==0?f/0:0),A=w.re;return w.re=u(w.re,w.im)/2,w.im=Math.atan2(w.im,A)/2,p&&(w.im=-w.im),w},acoth:function(){var s=this.re,f=this.im;if(s===0&&f===0)return new a(0,Math.PI/2);var p=s*s+f*f;return p!==0?new a(s/p,-f/p).atanh():new a(s!==0?s/0:0,f!==0?-f/0:0).atanh()},acsch:function(){var s=this.re,f=this.im;if(f===0)return new a(s!==0?Math.log(s+Math.sqrt(s*s+1)):1/0,0);var p=s*s+f*f;return p!==0?new a(s/p,-f/p).asinh():new a(s!==0?s/0:0,f!==0?-f/0:0).asinh()},asech:function(){var s=this.re,f=this.im;if(this.isZero())return a.INFINITY;var p=s*s+f*f;return p!==0?new a(s/p,-f/p).acosh():new a(s!==0?s/0:0,f!==0?-f/0:0).acosh()},inverse:function(){if(this.isZero())return a.INFINITY;if(this.isInfinite())return a.ZERO;var s=this.re,f=this.im,p=s*s+f*f;return new a(s/p,-f/p)},conjugate:function(){return new a(this.re,-this.im)},neg:function(){return new a(-this.re,-this.im)},ceil:function(s){return s=Math.pow(10,s||0),new a(Math.ceil(this.re*s)/s,Math.ceil(this.im*s)/s)},floor:function(s){return s=Math.pow(10,s||0),new a(Math.floor(this.re*s)/s,Math.floor(this.im*s)/s)},round:function(s){return s=Math.pow(10,s||0),new a(Math.round(this.re*s)/s,Math.round(this.im*s)/s)},equals:function(s,f){var p=new a(s,f);return Math.abs(p.re-this.re)<=a.EPSILON&&Math.abs(p.im-this.im)<=a.EPSILON},clone:function(){return new a(this.re,this.im)},toString:function(){var s=this.re,f=this.im,p="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(s){g();x();v();uB.exports=function e(t,r){"use strict";var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,o=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=/^0x[0-9a-f]+$/i,l=/^0/,a=function(M){return e.insensitive&&(""+M).toLowerCase()||""+M},s=a(t).replace(i,"")||"",f=a(r).replace(i,"")||"",p=s.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=f.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),y=parseInt(s.match(u),16)||p.length!==1&&s.match(o)&&Date.parse(s),b=parseInt(f.match(u),16)||y&&f.match(o)&&Date.parse(f)||null,w,A;if(b){if(yb)return 1}for(var S=0,O=Math.max(p.length,h.length);SA)return 1}return 0}});var E6=vt((jtt,S6)=>{"use strict";g();x();v();var IA=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},r=t.preserveFormatting,n=r===void 0?!1:r,i=t.escapeMapFn,o=i===void 0?wfe:i,u=String(e),l="",a=o(IA({},xfe),n?IA({},yfe):{}),s=Object.keys(a),f=function(){var h=!1;s.forEach(function(y,b){h||u.length>=y.length&&u.slice(0,y.length)===y&&(l+=a[s[b]],u=u.slice(y.length,u.length),h=!0)}),h||(l+=u.slice(0,1),u=u.slice(1,u.length))};u;)f();return l}});var Xq=vt((Zq,qA)=>{g();x();v();(function(e,t,r){function n(l){var a=this,s=u();a.next=function(){var f=2091639*a.s0+a.c*23283064365386963e-26;return a.s0=a.s1,a.s1=a.s2,a.s2=f-(a.c=f|0)},a.c=1,a.s0=s(" "),a.s1=s(" "),a.s2=s(" "),a.s0-=s(l),a.s0<0&&(a.s0+=1),a.s1-=s(l),a.s1<0&&(a.s1+=1),a.s2-=s(l),a.s2<0&&(a.s2+=1),s=null}function i(l,a){return a.c=l.c,a.s0=l.s0,a.s1=l.s1,a.s2=l.s2,a}function o(l,a){var s=new n(l),f=a&&a.state,p=s.next;return p.int32=function(){return s.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,f&&(typeof f=="object"&&i(f,s),p.state=function(){return i(s,{})}),p}function u(){var l=4022871197,a=function(s){s=String(s);for(var f=0;f>>0,p-=l,p*=l,l=p>>>0,p-=l,l+=p*4294967296}return(l>>>0)*23283064365386963e-26};return a}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(Zq,typeof qA=="object"&&qA,typeof define=="function"&&define)});var Jq=vt((Kq,zA)=>{g();x();v();(function(e,t,r){function n(u){var l=this,a="";l.x=0,l.y=0,l.z=0,l.w=0,l.next=function(){var f=l.x^l.x<<11;return l.x=l.y,l.y=l.z,l.z=l.w,l.w^=l.w>>>19^f^f>>>8},u===(u|0)?l.x=u:a+=u;for(var s=0;s>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,y=(p+h)/(1<<21);while(y===0);return y},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(Kq,typeof zA=="object"&&zA,typeof define=="function"&&define)});var jq=vt((Qq,UA)=>{g();x();v();(function(e,t,r){function n(u){var l=this,a="";l.next=function(){var f=l.x^l.x>>>2;return l.x=l.y,l.y=l.z,l.z=l.w,l.w=l.v,(l.d=l.d+362437|0)+(l.v=l.v^l.v<<4^(f^f<<1))|0},l.x=0,l.y=0,l.z=0,l.w=0,l.v=0,u===(u|0)?l.x=u:a+=u;for(var s=0;s>>4),l.next()}function i(u,l){return l.x=u.x,l.y=u.y,l.z=u.z,l.w=u.w,l.v=u.v,l.d=u.d,l}function o(u,l){var a=new n(u),s=l&&l.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,y=(p+h)/(1<<21);while(y===0);return y},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(Qq,typeof UA=="object"&&UA,typeof define=="function"&&define)});var tz=vt((ez,HA)=>{g();x();v();(function(e,t,r){function n(u){var l=this;l.next=function(){var s=l.x,f=l.i,p,h,y;return p=s[f],p^=p>>>7,h=p^p<<24,p=s[f+1&7],h^=p^p>>>10,p=s[f+3&7],h^=p^p>>>3,p=s[f+4&7],h^=p^p<<7,p=s[f+7&7],p=p^p<<13,h^=p^p<<9,s[f]=h,l.i=f+1&7,h};function a(s,f){var p,h,y=[];if(f===(f|0))h=y[0]=f;else for(f=""+f,p=0;p0;--p)s.next()}a(l,u)}function i(u,l){return l.x=u.x.slice(),l.i=u.i,l}function o(u,l){u==null&&(u=+new Date);var a=new n(u),s=l&&l.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,y=(p+h)/(1<<21);while(y===0);return y},f.int32=a.next,f.quick=f,s&&(s.x&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(ez,typeof HA=="object"&&HA,typeof define=="function"&&define)});var nz=vt((rz,$A)=>{g();x();v();(function(e,t,r){function n(u){var l=this;l.next=function(){var s=l.w,f=l.X,p=l.i,h,y;return l.w=s=s+1640531527|0,y=f[p+34&127],h=f[p=p+1&127],y^=y<<13,h^=h<<17,y^=y>>>15,h^=h>>>12,y=f[p]=y^h,l.i=p,y+(s^s>>>16)|0};function a(s,f){var p,h,y,b,w,A=[],S=128;for(f===(f|0)?(h=f,f=null):(f=f+"\0",h=0,S=Math.max(S,f.length)),y=0,b=-32;b>>15,h^=h<<4,h^=h>>>13,b>=0&&(w=w+1640531527|0,p=A[b&127]^=h+w,y=p==0?y+1:0);for(y>=128&&(A[(f&&f.length||0)&127]=-1),y=127,b=4*128;b>0;--b)h=A[y+34&127],p=A[y=y+1&127],h^=h<<13,p^=p<<17,h^=h>>>15,p^=p>>>12,A[y]=h^p;s.w=w,s.X=A,s.i=y}a(l,u)}function i(u,l){return l.i=u.i,l.w=u.w,l.X=u.X.slice(),l}function o(u,l){u==null&&(u=+new Date);var a=new n(u),s=l&&l.state,f=function(){return(a.next()>>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,y=(p+h)/(1<<21);while(y===0);return y},f.int32=a.next,f.quick=f,s&&(s.X&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(rz,typeof $A=="object"&&$A,typeof define=="function"&&define)});var oz=vt((iz,WA)=>{g();x();v();(function(e,t,r){function n(u){var l=this,a="";l.next=function(){var f=l.b,p=l.c,h=l.d,y=l.a;return f=f<<25^f>>>7^p,p=p-h|0,h=h<<24^h>>>8^y,y=y-f|0,l.b=f=f<<20^f>>>12^p,l.c=p=p-h|0,l.d=h<<16^p>>>16^y,l.a=y-f|0},l.a=0,l.b=0,l.c=-1640531527,l.d=1367130551,u===Math.floor(u)?(l.a=u/4294967296|0,l.b=u|0):a+=u;for(var s=0;s>>0)/4294967296};return f.double=function(){do var p=a.next()>>>11,h=(a.next()>>>0)/4294967296,y=(p+h)/(1<<21);while(y===0);return y},f.int32=a.next,f.quick=f,s&&(typeof s=="object"&&i(s,a),f.state=function(){return i(a,{})}),f}t&&t.exports?t.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(iz,typeof WA=="object"&&WA,typeof define=="function"&&define)});var az={};qa(az,{default:()=>Pce});var Pce,sz=Te(()=>{g();x();v();Pce={}});var lz=vt((uz,eb)=>{g();x();v();(function(e,t,r){var n=256,i=6,o=52,u="random",l=r.pow(n,i),a=r.pow(2,o),s=a*2,f=n-1,p;function h(M,I,F){var C=[];I=I==!0?{entropy:!0}:I||{};var P=A(w(I.entropy?[M,O(t)]:M??S(),3),C),R=new y(C),q=function(){for(var U=R.g(i),H=l,V=0;U=s;)U/=2,H/=2,V>>>=1;return(U+V)/H};return q.int32=function(){return R.g(4)|0},q.quick=function(){return R.g(4)/4294967296},q.double=q,A(O(R.S),t),(I.pass||F||function(U,H,V,W){return W&&(W.S&&b(W,R),U.state=function(){return b(R,{})}),V?(r[u]=U,H):U})(q,P,"global"in I?I.global:this==r,I.state)}function y(M){var I,F=M.length,C=this,P=0,R=C.i=C.j=0,q=C.S=[];for(F||(M=[F++]);P{g();x();v();var Rce=Xq(),qce=Jq(),zce=jq(),Uce=tz(),Hce=nz(),$ce=oz(),bp=lz();bp.alea=Rce;bp.xor128=qce;bp.xorwow=zce;bp.xorshift7=Uce;bp.xor4096=Hce;bp.tychei=$ce;fz.exports=bp});var qH=vt((n9t,JA)=>{g();x();v();function KA(){}KA.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){var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;for(n;n{g();x();v();(function(e,t){typeof QA=="object"?WH.exports=t():typeof define=="function"&&define.amd?define(t):e.jStat=t()})(QA,function(){var e=function(t,r){var n=Array.prototype.concat,i=Array.prototype.slice,o=Object.prototype.toString;function u(A,S){var O=A>S?A:S;return t.pow(10,17-~~(t.log(O>0?O:-O)*t.LOG10E))}var l=Array.isArray||function(S){return o.call(S)==="[object Array]"};function a(A){return o.call(A)==="[object Function]"}function s(A){return typeof A=="number"?A-A===0:!1}function f(A){return n.apply([],A)}function p(){return new p._init(arguments)}p.fn=p.prototype,p._init=function(S){if(l(S[0]))if(l(S[0][0])){a(S[1])&&(S[0]=p.map(S[0],S[1]));for(var O=0;O=0;O--,I++)M[I]=[S[I][O]];return M},p.transpose=function(S){var O=[],M,I,F,C,P;for(l(S[0])||(S=[S]),I=S.length,F=S[0].length,P=0;P0&&(P[I][0]=S[I][0]),R=1;RO&&M>0)return[];if(M>0)for(F=S;FO;F+=M)I.push(F);return I},p.slice=function(){function A(O,M,I,F){var C,P=[],R=O.length;if(M===r&&I===r&&F===r)return p.copy(O);if(M=M||0,I=I||O.length,M=M>=0?M:R+M,I=I>=0?I:R+I,F=F||1,M===I||F===0)return[];if(MI&&F>0)return[];if(F>0)for(C=M;CI;C+=F)P.push(O[C]);return P}function S(O,M){var I,F;if(M=M||{},s(M.row)){if(s(M.col))return O[M.row][M.col];var C=p.rowa(O,M.row);return I=M.col||{},A(C,I.start,I.end,I.step)}if(s(M.col)){var P=p.cola(O,M.col);return F=M.row||{},A(P,F.start,F.end,F.step)}F=M.row||{},I=M.col||{};var R=A(O,F.start,F.end,F.step);return R.map(function(q){return A(q,I.start,I.end,I.step)})}return S}(),p.sliceAssign=function(S,O,M){var I,F;if(s(O.row)){if(s(O.col))return S[O.row][O.col]=M;O.col=O.col||{},O.col.start=O.col.start||0,O.col.end=O.col.end||S[0].length,O.col.step=O.col.step||1,I=p.arange(O.col.start,t.min(S.length,O.col.end),O.col.step);var C=O.row;return I.forEach(function(R,q){S[C][R]=M[q]}),S}if(s(O.col)){O.row=O.row||{},O.row.start=O.row.start||0,O.row.end=O.row.end||S.length,O.row.step=O.row.step||1,F=p.arange(O.row.start,t.min(S[0].length,O.row.end),O.row.step);var P=O.col;return F.forEach(function(R,q){S[R][P]=M[q]}),S}return M[0].length===r&&(M=[M]),O.row.start=O.row.start||0,O.row.end=O.row.end||S.length,O.row.step=O.row.step||1,O.col.start=O.col.start||0,O.col.end=O.col.end||S[0].length,O.col.step=O.col.step||1,F=p.arange(O.row.start,t.min(S.length,O.row.end),O.row.step),I=p.arange(O.col.start,t.min(S[0].length,O.col.end),O.col.step),F.forEach(function(R,q){I.forEach(function(U,H){S[R][U]=M[q][H]})}),S},p.diagonal=function(S){var O=p.zeros(S.length,S.length);return S.forEach(function(M,I){O[I][I]=M}),O},p.copy=function(S){return S.map(function(O){return s(O)?O:O.map(function(M){return M})})};var w=p.prototype;return w.length=0,w.push=Array.prototype.push,w.sort=Array.prototype.sort,w.splice=Array.prototype.splice,w.slice=Array.prototype.slice,w.toArray=function(){return this.length>1?i.call(this):i.call(this)[0]},w.map=function(S,O){return p(p.map(this,S,O))},w.cumreduce=function(S,O){return p(p.cumreduce(this,S,O))},w.alter=function(S){return p.alter(this,S),this},function(A){for(var S=0;S=0;)s+=a[f];return s},t.sumsqrd=function(a){for(var s=0,f=a.length;--f>=0;)s+=a[f]*a[f];return s},t.sumsqerr=function(a){for(var s=t.mean(a),f=0,p=a.length,h;--p>=0;)h=a[p]-s,f+=h*h;return f},t.sumrow=function(a){for(var s=0,f=a.length;--f>=0;)s+=a[f];return s},t.product=function(a){for(var s=1,f=a.length;--f>=0;)s*=a[f];return s},t.min=function(a){for(var s=a[0],f=0;++fs&&(s=a[f]);return s},t.unique=function(a){for(var s={},f=[],p=0;ph?(b=[f[w]],h=p,y=0):p===h&&(b.push(f[w]),y++),p=1);return y===0?b[0]:b},t.range=function(a){return t.max(a)-t.min(a)},t.variance=function(a,s){return t.sumsqerr(a)/(a.length-(s?1:0))},t.pooledvariance=function(a){var s=a.reduce(function(p,h){return p+t.sumsqerr(h)},0),f=a.reduce(function(p,h){return p+h.length},0);return s/(f-a.length)},t.deviation=function(l){for(var a=t.mean(l),s=l.length,f=new Array(s),p=0;p=0;p--)f.push(r.abs(a[p]-s));return t.mean(f)},t.meddev=function(a){for(var s=t.median(a),f=[],p=a.length-1;p>=0;p--)f.push(r.abs(a[p]-s));return t.median(f)},t.coeffvar=function(a){return t.stdev(a)/t.mean(a)},t.quartiles=function(a){var s=a.length,f=a.slice().sort(i);return[f[r.round(s/4)-1],f[r.round(s/2)-1],f[r.round(s*3/4)-1]]},t.quantiles=function(a,s,f,p){var h=a.slice().sort(i),y=[s.length],b=a.length,w,A,S,O,M,I;for(typeof f>"u"&&(f=3/8),typeof p>"u"&&(p=3/8),w=0;w1){for(b=f===!0?this:this.transpose();y1){for(s!=="sumrow"&&(b=f===!0?this:this.transpose());y1){for(h=h.transpose();p=0;f--)s*=u,s+=h[f];if(a=s/o+.5*r.log(l)+(o-.5)*r.log(o)-o,i<=7)for(f=1;f<=p;f++)a-=r.log(o-1),o-=1;return a},t.gammafn=function(i){var o=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],u=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],l=!1,a=0,s=0,f=0,p=i,h,y,b,w;if(i>171.6243769536076)return 1/0;if(p<=0)if(w=p%1+36e-17,w)l=(p&1?-1:1)*r.PI/r.sin(r.PI*w),p=1-p;else return 1/0;for(b=p,p<1?y=p++:y=(p-=a=(p|0)-1)-1,h=0;h<8;++h)f=(f+o[h])*y,s=s*y+u[h];if(w=f/s+1,bp)for(h=0;h=1?i:1/i)*8.5+i*.4+17),A;if(o<0||i<=0)return NaN;if(o170||o>170?r.exp(t.combinationln(i,o)):t.factorial(i)/t.factorial(o)/t.factorial(i-o)},t.combinationln=function(i,o){return t.factorialln(i)-t.factorialln(o)-t.factorialln(i-o)},t.permutation=function(i,o){return t.factorial(i)/t.factorial(i-o)},t.betafn=function(i,o){if(!(i<=0||o<=0))return i+o>170?r.exp(t.betaln(i,o)):t.gammafn(i)*t.gammafn(o)/t.gammafn(i+o)},t.betaln=function(i,o){return t.gammaln(i)+t.gammaln(o)-t.gammaln(i+o)},t.betacf=function(i,o,u){var l=1e-30,a=1,s=o+u,f=o+1,p=o-1,h=1,y=1-s*i/f,b,w,A,S;for(r.abs(y)=1)return r.max(100,o+100*r.sqrt(o));if(i<=0)return 0;for(o>1?(w=r.log(l),A=r.exp(l*(w-1)-s),b=i<.5?i:1-i,h=r.sqrt(-2*r.log(b)),f=(2.30753+h*.27061)/(1+h*(.99229+h*.04481))-h,i<.5&&(f=-f),f=r.max(.001,o*r.pow(1-1/(9*o)-f/(3*r.sqrt(o)),3))):(h=1-o*(.253+o*.12),i1?h=A*r.exp(-(f-l)+l*(r.log(f)-w)):h=r.exp(-f+l*r.log(f)-s),y=p/h,f-=h=y/(1-.5*r.min(1,y*((o-1)/f-1))),f<=0&&(f=.5*(f+h)),r.abs(h)0;u--)h=a,a=p*a-s+o[u],s=h;return y=f*r.exp(-i*i+.5*(o[0]+p*a)-s),l?y-1:1-y},t.erfc=function(i){return 1-t.erf(i)},t.erfcinv=function(i){var o=0,u,l,a,s;if(i>=2)return-100;if(i<=0)return 100;for(s=i<1?i:2-i,a=r.sqrt(-2*r.log(s/2)),u=-.70711*((2.30753+a*.27061)/(1+a*(.99229+a*.04481))-a);o<2;o++)l=t.erfc(u)-s,u+=l/(1.1283791670955126*r.exp(-u*u)-u*l);return i<1?u:-u},t.ibetainv=function(i,o,u){var l=1e-8,a=o-1,s=u-1,f=0,p,h,y,b,w,A,S,O,M,I,F;if(i<=0)return 0;if(i>=1)return 1;for(o>=1&&u>=1?(y=i<.5?i:1-i,b=r.sqrt(-2*r.log(y)),S=(2.30753+b*.27061)/(1+b*(.99229+b*.04481))-b,i<.5&&(S=-S),O=(S*S-3)/6,M=2/(1/(2*o-1)+1/(2*u-1)),I=S*r.sqrt(O+M)/M-(1/(2*u-1)-1/(2*o-1))*(O+5/6-2/(3*M)),S=o/(o+u*r.exp(2*I))):(p=r.log(o/(o+u)),h=r.log(u/(o+u)),b=r.exp(o*p)/o,w=r.exp(u*h)/u,I=b+w,i=1&&(S=.5*(S+b+1)),r.abs(b)0)break}return S},t.ibeta=function(i,o,u){var l=i===0||i===1?0:r.exp(t.gammaln(o+u)-t.gammaln(o)-t.gammaln(u)+o*r.log(i)+u*r.log(1-i));return i<0||i>1?!1:i<(o+1)/(o+u+2)?l*t.betacf(i,o,u)/o:1-l*t.betacf(1-i,u,o)/u},t.randn=function(i,o){var u,l,a,s,f;if(o||(o=i),i)return t.create(i,o,function(){return t.randn()});do u=t._random_fn(),l=1.7156*(t._random_fn()-.5),a=u-.449871,s=r.abs(l)+.386595,f=a*a+s*(.196*s-.25472*a);while(f>.27597&&(f>.27846||l*l>-4*r.log(u)*u*u));return l/u},t.randg=function(i,o,u){var l=i,a,s,f,p,h,y;if(u||(u=o),i||(i=1),o)return y=t.zeros(o,u),y.alter(function(){return t.randg(i)}),y;i<1&&(i+=1),a=i-1/3,s=1/r.sqrt(9*a);do{do h=t.randn(),p=1+s*h;while(p<=0);p=p*p*p,f=t._random_fn()}while(f>1-.331*r.pow(h,4)&&r.log(f)>.5*h*h+a*(1-p+r.log(p)));if(i==l)return a*p;do f=t._random_fn();while(f===0);return r.pow(f,1/l)*a*p},function(n){for(var i=0;i1||a<0?0:s==1&&f==1?1:s<512&&f<512?r.pow(a,s-1)*r.pow(1-a,f-1)/t.betafn(s,f):r.exp((s-1)*r.log(a)+(f-1)*r.log(1-a)-t.betaln(s,f))},cdf:function(a,s,f){return a>1||a<0?(a>1)*1:t.ibeta(a,s,f)},inv:function(a,s,f){return t.ibetainv(a,s,f)},mean:function(a,s){return a/(a+s)},median:function(a,s){return t.ibetainv(.5,a,s)},mode:function(a,s){return(a-1)/(a+s-2)},sample:function(a,s){var f=t.randg(a);return f/(f+t.randg(s))},variance:function(a,s){return a*s/(r.pow(a+s,2)*(a+s+1))}}),t.extend(t.centralF,{pdf:function(a,s,f){var p,h,y;return a<0?0:s<=2?a===0&&s<2?1/0:a===0&&s===2?1:1/t.betafn(s/2,f/2)*r.pow(s/f,s/2)*r.pow(a,s/2-1)*r.pow(1+s/f*a,-(s+f)/2):(p=s*a/(f+a*s),h=f/(f+a*s),y=s*h/2,y*t.binomial.pdf((s-2)/2,(s+f-2)/2,p))},cdf:function(a,s,f){return a<0?0:t.ibeta(s*a/(s*a+f),s/2,f/2)},inv:function(a,s,f){return f/(s*(1/t.ibetainv(a,s/2,f/2)-1))},mean:function(a,s){return s>2?s/(s-2):void 0},mode:function(a,s){return a>2?s*(a-2)/(a*(s+2)):void 0},sample:function(a,s){var f=t.randg(a/2)*2,p=t.randg(s/2)*2;return f/a/(p/s)},variance:function(a,s){if(!(s<=4))return 2*s*s*(a+s-2)/(a*(s-2)*(s-2)*(s-4))}}),t.extend(t.cauchy,{pdf:function(a,s,f){return f<0?0:f/(r.pow(a-s,2)+r.pow(f,2))/r.PI},cdf:function(a,s,f){return r.atan((a-s)/f)/r.PI+.5},inv:function(l,a,s){return a+s*r.tan(r.PI*(l-.5))},median:function(a){return a},mode:function(a){return a},sample:function(a,s){return t.randn()*r.sqrt(1/(2*t.randg(.5)))*s+a}}),t.extend(t.chisquare,{pdf:function(a,s){return a<0?0:a===0&&s===2?.5:r.exp((s/2-1)*r.log(a)-a/2-s/2*r.log(2)-t.gammaln(s/2))},cdf:function(a,s){return a<0?0:t.lowRegGamma(s/2,a/2)},inv:function(l,a){return 2*t.gammapinv(l,.5*a)},mean:function(l){return l},median:function(a){return a*r.pow(1-2/(9*a),3)},mode:function(a){return a-2>0?a-2:0},sample:function(a){return t.randg(a/2)*2},variance:function(a){return 2*a}}),t.extend(t.exponential,{pdf:function(a,s){return a<0?0:s*r.exp(-s*a)},cdf:function(a,s){return a<0?0:1-r.exp(-s*a)},inv:function(l,a){return-r.log(1-l)/a},mean:function(l){return 1/l},median:function(l){return 1/l*r.log(2)},mode:function(){return 0},sample:function(a){return-1/a*r.log(t._random_fn())},variance:function(l){return r.pow(l,-2)}}),t.extend(t.gamma,{pdf:function(a,s,f){return a<0?0:a===0&&s===1?1/f:r.exp((s-1)*r.log(a)-a/f-t.gammaln(s)-s*r.log(f))},cdf:function(a,s,f){return a<0?0:t.lowRegGamma(s,a/f)},inv:function(l,a,s){return t.gammapinv(l,a)*s},mean:function(l,a){return l*a},mode:function(a,s){if(a>1)return(a-1)*s},sample:function(a,s){return t.randg(a)*s},variance:function(a,s){return a*s*s}}),t.extend(t.invgamma,{pdf:function(a,s,f){return a<=0?0:r.exp(-(s+1)*r.log(a)-f/a-t.gammaln(s)+s*r.log(f))},cdf:function(a,s,f){return a<=0?0:1-t.lowRegGamma(s,f/a)},inv:function(l,a,s){return s/t.gammapinv(1-l,a)},mean:function(l,a){return l>1?a/(l-1):void 0},mode:function(a,s){return s/(a+1)},sample:function(a,s){return s/t.randg(a)},variance:function(a,s){if(!(a<=2))return s*s/((a-1)*(a-1)*(a-2))}}),t.extend(t.kumaraswamy,{pdf:function(a,s,f){return a===0&&s===1?f:a===1&&f===1?s:r.exp(r.log(s)+r.log(f)+(s-1)*r.log(a)+(f-1)*r.log(1-r.pow(a,s)))},cdf:function(a,s,f){return a<0?0:a>1?1:1-r.pow(1-r.pow(a,s),f)},inv:function(a,s,f){return r.pow(1-r.pow(1-a,1/f),1/s)},mean:function(l,a){return a*t.gammafn(1+1/l)*t.gammafn(a)/t.gammafn(1+1/l+a)},median:function(a,s){return r.pow(1-r.pow(2,-1/s),1/a)},mode:function(a,s){if(a>=1&&s>=1&&a!==1&&s!==1)return r.pow((a-1)/(a*s-1),1/a)},variance:function(){throw new Error("variance not yet implemented")}}),t.extend(t.lognormal,{pdf:function(a,s,f){return a<=0?0:r.exp(-r.log(a)-.5*r.log(2*r.PI)-r.log(f)-r.pow(r.log(a)-s,2)/(2*f*f))},cdf:function(a,s,f){return a<0?0:.5+.5*t.erf((r.log(a)-s)/r.sqrt(2*f*f))},inv:function(l,a,s){return r.exp(-1.4142135623730951*s*t.erfcinv(2*l)+a)},mean:function(a,s){return r.exp(a+s*s/2)},median:function(a){return r.exp(a)},mode:function(a,s){return r.exp(a-s*s)},sample:function(a,s){return r.exp(t.randn()*s+a)},variance:function(a,s){return(r.exp(s*s)-1)*r.exp(2*a+s*s)}}),t.extend(t.noncentralt,{pdf:function(a,s,f){var p=1e-14;return r.abs(f)p||w>p;)A=w,O>0&&(M*=f*f/(2*O),I*=f*f/(2*(O+1/2))),w=M*t.beta.cdf(S,O+.5,s/2)+I*t.beta.cdf(S,O+1,s/2),b+=.5*w,O++;return y?1-b:b}}),t.extend(t.normal,{pdf:function(a,s,f){return r.exp(-.5*r.log(2*r.PI)-r.log(f)-r.pow(a-s,2)/(2*f*f))},cdf:function(a,s,f){return .5*(1+t.erf((a-s)/r.sqrt(2*f*f)))},inv:function(l,a,s){return-1.4142135623730951*s*t.erfcinv(2*l)+a},mean:function(l){return l},median:function(a){return a},mode:function(l){return l},sample:function(a,s){return t.randn()*s+a},variance:function(l,a){return a*a}}),t.extend(t.pareto,{pdf:function(a,s,f){return a1e100?1e100:s,1/(r.sqrt(s)*t.betafn(.5,s/2))*r.pow(1+a*a/s,-((s+1)/2))},cdf:function(a,s){var f=s/2;return t.ibeta((a+r.sqrt(a*a+s))/(2*r.sqrt(a*a+s)),f,f)},inv:function(l,a){var s=t.ibetainv(2*r.min(l,1-l),.5*a,.5);return s=r.sqrt(a*(1-s)/s),l>.5?s:-s},mean:function(a){return a>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(a){return t.randn()*r.sqrt(a/(2*t.randg(a/2)))},variance:function(a){return a>2?a/(a-2):a>1?1/0:void 0}}),t.extend(t.weibull,{pdf:function(a,s,f){return a<0||s<0||f<0?0:f/s*r.pow(a/s,f-1)*r.exp(-r.pow(a/s,f))},cdf:function(a,s,f){return a<0?0:1-r.exp(-r.pow(a/s,f))},inv:function(l,a,s){return a*r.pow(-r.log(1-l),1/s)},mean:function(l,a){return l*t.gammafn(1+1/a)},median:function(a,s){return a*r.pow(r.log(2),1/s)},mode:function(a,s){return s<=1?0:a*r.pow((s-1)/s,1/s)},sample:function(a,s){return a*r.pow(-r.log(t._random_fn()),1/s)},variance:function(a,s){return a*a*t.gammafn(1+2/s)-r.pow(t.weibull.mean(a,s),2)}}),t.extend(t.uniform,{pdf:function(a,s,f){return af?0:1/(f-s)},cdf:function(a,s,f){return af;)A=y,S=-(a+w)*(a+s+w)*l/(a+2*w)/(a+2*w+1),p=y+S*p,h=b+S*h,w=w+1,S=w*(s-w)*l/(a+2*w-1)/(a+2*w),y=p+S*y,b=h+S*b,p=p/b,h=h/b,y=y/b,b=1;return y/a}t.extend(t.binomial,{pdf:function(a,s,f){return f===0||f===1?s*f===a?1:0:t.combination(s,a)*r.pow(f,a)*r.pow(1-f,s-a)},cdf:function(a,s,f){var p,h=1e-10;if(a<0)return 0;if(a>=s)return 1;if(f<0||f>1||s<=0)return NaN;a=r.floor(a);var y=f,b=a+1,w=s-a,A=b+w,S=r.exp(t.gammaln(A)-t.gammaln(w)-t.gammaln(b)+b*r.log(y)+w*r.log(1-y));return y<(b+1)/(A+2)?p=S*n(y,b,w,h):p=1-S*n(1-y,w,b,h),r.round((1-p)*(1/h))/(1/h)}}),t.extend(t.negbin,{pdf:function(a,s,f){return a!==a>>>0?!1:a<0?0:t.combination(a+s-1,s-1)*r.pow(1-f,a)*r.pow(f,s)},cdf:function(a,s,f){var p=0,h=0;if(a<0)return 0;for(;h<=a;h++)p+=t.negbin.pdf(h,s,f);return p}}),t.extend(t.hypgeom,{pdf:function(a,s,f,p){if(a!==a|0)return!1;if(a<0||ap||a>f)return 0;if(f*2>s)return p*2>s?t.hypgeom.pdf(s-f-p+a,s,s-f,s-p):t.hypgeom.pdf(p-a,s,s-f,p);if(p*2>s)return t.hypgeom.pdf(f-a,s,f,s-p);if(f1&&y=p||a>=f)return 1;if(f*2>s)return p*2>s?t.hypgeom.cdf(s-f-p+a,s,s-f,s-p):1-t.hypgeom.cdf(p-a-1,s,s-f,p);if(p*2>s)return 1-t.hypgeom.cdf(f-a-1,s,f,s-p);if(f1&&bp);return f-1},sampleLarge:function(a){var s=a,f,p,h,y,b,w,A,S,O,M;for(y=r.sqrt(s),b=r.log(s),A=.931+2.53*y,w=-.059+.02483*A,S=1.1239+1.1328/(A-3.4),O=.9277-3.6224/(A-2);;){if(p=r.random()-.5,h=r.random(),M=.5-r.abs(p),f=r.floor((2*w/M+A)*p+s+.43),M>=.07&&h<=O)return f;if(!(f<0||M<.013&&h>M)&&r.log(h)+r.log(S)-r.log(w/(M*M)+A)<=-s+f*b-t.loggam(f+1))return f}},sample:function(a){return a<10?this.sampleSmall(a):this.sampleLarge(a)}}),t.extend(t.triangular,{pdf:function(a,s,f,p){return f<=s||pf?NaN:af?0:af?NaN:a<=s?0:a>=f?1:a<=p?r.pow(a-s,2)/((f-s)*(p-s)):1-r.pow(f-a,2)/((f-s)*(f-p))},inv:function(a,s,f,p){return f<=s||pf?NaN:a<=(p-s)/(f-s)?s+(f-s)*r.sqrt(a*((p-s)/(f-s))):s+(f-s)*(1-r.sqrt((1-a)*(1-(p-s)/(f-s))))},mean:function(a,s,f){return(a+s+f)/3},median:function(a,s,f){if(f<=(a+s)/2)return s-r.sqrt((s-a)*(s-f))/r.sqrt(2);if(f>(a+s)/2)return a+r.sqrt((s-a)*(f-a))/r.sqrt(2)},mode:function(a,s,f){return f},sample:function(a,s,f){var p=t._random_fn();return p<(f-a)/(s-a)?a+r.sqrt(p*(s-a)*(f-a)):s-r.sqrt((1-p)*(s-a)*(s-f))},variance:function(a,s,f){return(a*a+s*s+f*f-a*s-a*f-s*f)/18}}),t.extend(t.arcsine,{pdf:function(a,s,f){return f<=s?NaN:a<=s||a>=f?0:2/r.PI*r.pow(r.pow(f-s,2)-r.pow(2*a-s-f,2),-.5)},cdf:function(a,s,f){return a=w)return 1;var C=2*t.normal.cdf(F,0,1,1,0)-1;C>=r.exp(y/s)?C=r.pow(C,s):C=0;var P;l>A?P=S:P=O;for(var R=F,q=(w-F)/P,U=R+q,H=0,V=s-1,W=1;W<=P;W++){for(var ee=0,ie=.5*(U+R),Y=.5*(U-R),Z=1;Z<=f;Z++){var le,re;pb)break;var ce=2*t.normal.cdf(De,0,1,1,0),Se=2*t.normal.cdf(De,l,1,1,0),Pe=ce*.5-Se*.5;Pe>=r.exp(h/V)&&(Pe=I[le-1]*r.exp(-(.5*we))*r.pow(Pe,V),ee+=Pe)}ee*=2*Y*s/r.sqrt(2*r.PI),H+=ee,R=U,U+=q}return C+=H,C<=r.exp(h/a)?0:(C=r.pow(C,a),C>=1?1:C)}function u(l,a,s){var f=.322232421088,p=.099348462606,h=-1,y=.588581570495,b=-.342242088547,w=.531103462366,A=-.204231210125,S=.10353775285,O=-453642210148e-16,M=.0038560700634,I=.8832,F=.2368,C=1.214,P=1.208,R=1.4142,q=120,U=.5-.5*l,H=r.sqrt(r.log(1/(U*U))),V=H+((((H*O+A)*H+b)*H+h)*H+f)/((((H*M+S)*H+w)*H+y)*H+p);sI)return o(a,p,h);var H=f*.5,V=H*r.log(f)-f*r.log(2)-t.gammaln(H),W=H-1,ee=f*.25,ie;f<=S?ie=F:f<=O?ie=C:f<=M?ie=P:ie=R,V+=r.log(ie);for(var Y=0,Z=1;Z<=50;Z++){for(var le=0,re=(2*Z-1)*ie,he=1;he<=y;he++){var De,we;b=w){b=1&&le<=A)break;Y+=le}if(le>A)throw new Error("tukey.cdf failed to converge");return Y>1&&(Y=1),Y},inv:function(l,a,s){var f=1,p=a,h=1e-4,y=50;if(s<2||f<1||p<2)return NaN;if(l<0||l>1)return NaN;if(l===0)return 0;if(l===1)return 1/0;var b=u(l,p,s),w=t.tukey.cdf(b,a,s)-l,A;w>0?A=r.max(0,b-1):A=b+1;for(var S=t.tukey.cdf(A,a,s)-l,O,M=1;Ms&&(f[p-1][h-1]=l[p][h])}var y=s%2?-1:1;a+=u(f)*l[0][s]*y}return a},gauss_elimination:function(l,a){var s=0,f=0,p=l.length,h=l[0].length,y=1,b=0,w=[],A,S,O,M;for(l=t.aug(l,a),A=l[0].length,s=0;s=0;s--){for(b=0,f=s+1;f<=p-1;f++)b=b+w[f]*l[s][f];w[s]=(l[s][A-1]-b)/l[s][s]}return w},gauss_jordan:function(l,a){var s=t.aug(l,a),f=s.length,p=s[0].length,h=0,y,b,w;for(b=0;br.abs(s[A][b])&&(A=w);var S=s[b];for(s[b]=s[A],s[A]=S,w=b+1;w=0;b--){for(h=s[b][b],w=0;wb-1;y--)s[w][y]-=s[b][y]*s[w][b]/h;for(s[b][b]/=h,y=f;yh?(b[p][h]=l[p][h],w[p][h]=A[p][h]=0):pf;)S=I,I=t.add(t.multiply(M,S),O),p++;return I},gauss_seidel:function(l,a,s,f){for(var p=0,h=l.length,y=[],b=[],w=[],A,S,O,M,I;pA?(y[p][A]=l[p][A],b[p][A]=w[p][A]=0):pf;)S=I,I=t.add(t.multiply(M,S),O),p=p+1;return I},SOR:function(l,a,s,f,p){for(var h=0,y=l.length,b=[],w=[],A=[],S,O,M,I,F;hS?(b[h][S]=l[h][S],w[h][S]=A[h][S]=0):hf;)O=F,F=t.add(t.multiply(I,O),M),h++;return F},householder:function(l){for(var a=l.length,s=l[0].length,f=0,p=[],h=[],y,b,w,A,S;f0?-1:1,y=S*r.sqrt(y),b=r.sqrt((y*y-l[f+1][f]*y)/2),p=t.zeros(a,1),p[f+1][0]=(l[f+1][f]-y)/(2*b),w=f+2;w0?r.PI/4:-r.PI/4:O=r.atan(2*l[w][A]/(l[w][w]-l[A][A]))/2,M=t.identity(s,s),M[w][w]=r.cos(O),M[w][A]=-r.sin(O),M[A][w]=r.sin(O),M[A][A]=r.cos(O),f=t.multiply(f,M),h=t.multiply(t.multiply(t.inv(M),l),M),l=h,a=0,y=1;y.001&&(a=1)}for(y=0;y=h;)A=p(l,s+f),S=p(l,s),b[y]=(a[A]-2*a[S]+a[2*S-A])/(f*f),f/=2,y++;for(M=b.length,O=1;M!=1;){for(I=0;Is);h++);return h-=1,a[h]+(s-l[h])*O[h]+t.sq(s-l[h])*A[h]+(s-l[h])*t.sq(s-l[h])*M[h]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(l){var a=l.length,s=l[0].length,f=0,p,h,y=[],b=[],w=[],A=[],S=[],O=[],M=[],I=[],F=[],C=[];for(f=0;f2?(s=t.zscore(a[0],a[1],a[2]),a[3]===1?t.normal.cdf(-r.abs(s),0,1):t.normal.cdf(-r.abs(s),0,1)*2):(s=a[0],a[1]===1?t.normal.cdf(-r.abs(s),0,1):t.normal.cdf(-r.abs(s),0,1)*2)}}),t.extend(t.fn,{zscore:function(a,s){return(a-this.mean())/this.stdev(s)},ztest:function(a,s,f){var p=r.abs(this.zscore(a,f));return s===1?t.normal.cdf(-p,0,1):t.normal.cdf(-p,0,1)*2}}),t.extend({tscore:function(){var a=n.call(arguments);return a.length===4?(a[0]-a[1])/(a[2]/r.sqrt(a[3])):(a[0]-t.mean(a[1]))/(t.stdev(a[1],!0)/r.sqrt(a[1].length))},ttest:function(){var a=n.call(arguments),s;return a.length===5?(s=r.abs(t.tscore(a[0],a[1],a[2],a[3])),a[4]===1?t.studentt.cdf(-s,a[3]-1):t.studentt.cdf(-s,a[3]-1)*2):i(a[1])?(s=r.abs(a[0]),a[2]==1?t.studentt.cdf(-s,a[1]-1):t.studentt.cdf(-s,a[1]-1)*2):(s=r.abs(t.tscore(a[0],a[1])),a[2]==1?t.studentt.cdf(-s,a[1].length-1):t.studentt.cdf(-s,a[1].length-1)*2)}}),t.extend(t.fn,{tscore:function(a){return(a-this.mean())/(this.stdev(!0)/r.sqrt(this.cols()))},ttest:function(a,s){return s===1?1-t.studentt.cdf(r.abs(this.tscore(a)),this.cols()-1):t.studentt.cdf(-r.abs(this.tscore(a)),this.cols()-1)*2}}),t.extend({anovafscore:function(){var a=n.call(arguments),s,f,p,h,y,b,w,A;if(a.length===1){for(y=new Array(a[0].length),w=0;w1||s>1||l<=0||s<=0)throw new Error("Proportions should be greater than 0 and less than 1");var p=(l*a+s*f)/(a+f),h=r.sqrt(p*(1-p)*(1/a+1/f));return(l-s)/h}t.extend(t.fn,{oneSidedDifferenceOfProportions:function(a,s,f,p){var h=u(a,s,f,p);return t.ztest(h,1)},twoSidedDifferenceOfProportions:function(a,s,f,p){var h=u(a,s,f,p);return t.ztest(h,2)}})}(e,Math),e.models=function(){function t(u){var l=u[0].length,a=e.arange(l).map(function(s){var f=e.arange(l).filter(function(p){return p!==s});return r(e.col(u,s).map(function(p){return p[0]}),e.col(u,f))});return a}function r(u,l){var a=u.length,s=l[0].length-1,f=a-s-1,p=e.lstsq(l,u),h=e.multiply(l,p.map(function(M){return[M]})).map(function(M){return M[0]}),y=e.subtract(u,h),b=e.mean(u),w=e.sum(h.map(function(M){return Math.pow(M-b,2)})),A=e.sum(u.map(function(M,I){return Math.pow(M-h[I],2)})),S=w+A,O=w/S;return{exog:l,endog:u,nobs:a,df_model:s,df_resid:f,coef:p,predict:h,resid:y,ybar:b,SST:S,SSE:w,SSR:A,R2:O}}function n(u){var l=t(u.exog),a=Math.sqrt(u.SSR/u.df_resid),s=l.map(function(b){var w=b.SST,A=b.R2;return a/Math.sqrt(w*(1-A))}),f=u.coef.map(function(b,w){return(b-0)/s[w]}),p=f.map(function(b){var w=e.studentt.cdf(b,u.df_resid);return(w>.5?1-w:w)*2}),h=e.studentt.inv(.975,u.df_resid),y=u.coef.map(function(b,w){var A=h*s[w];return[b-A,b+A]});return{se:s,t:f,p,sigmaHat:a,interval95:y}}function i(u){var l=u.R2/u.df_model/((1-u.R2)/u.df_resid),a=function(f,p,h){return e.beta.cdf(f/(h/p+f),p/2,h/2)},s=1-a(l,u.df_model,u.df_resid);return{F_statistic:l,pvalue:s}}function o(u,l){var a=r(u,l),s=n(a),f=i(a),p=1-(1-a.R2)*((a.nobs-1)/a.df_resid);return a.t=s,a.f=f,a.adjust_R2=p,a}return{ols:o}}(),e.extend({buildxmatrix:function(){for(var r=new Array(arguments.length),n=0;n1){for(l=[],i=0;i{g();x();v();var GH;(function(e){typeof DO_NOT_EXPORT_BESSEL>"u"?typeof jA=="object"?e(jA):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(GH={}):e(GH={})})(function(e){e.version="1.0.2";var t=Math;function r(s,f){for(var p=0,h=0;pC)P=n(F,C,b(F),M(F),-1);else{for(var R=2*t.floor((C+t.floor(t.sqrt(40*C)))/2),q=!1,U=0,H=0,V=1,W=0,ee=2/F,ie=R;ie>0;ie--)W=ie*ee*V-U,U=V,V=W,t.abs(V)>1e10&&(V*=1e-10,U*=1e-10,P*=1e-10,H*=1e-10),q&&(H+=V),q=!q,ie==C&&(P=U);H=2*H-V,P/=H}return P}}(),u=function(){var s=.636619772,f=[-2957821389,7062834065,-5123598036e-1,1087988129e-2,-86327.92757,228.4622733].reverse(),p=[40076544269,7452499648e-1,7189466438e-3,47447.2647,226.1030244,1].reverse(),h=[1,-.001098628627,2734510407e-14,-2073370639e-15,2093887211e-16].reverse(),y=[-.01562499995,.0001430488765,-6911147651e-15,7621095161e-16,-934945152e-16].reverse();function b(I){var F=0,C=0,P=0,R=I*I,q=I-.785398164;return I<8?(C=r(f,R),P=r(p,R),F=C/P+s*o(I,0)*t.log(I)):(R=64/R,C=r(h,R),P=r(y,R),F=t.sqrt(s/I)*(t.sin(q)*C+t.cos(q)*P*8/I)),F}var w=[-4900604943e3,127527439e4,-51534381390,7349264551e-1,-4237922726e-3,8511.937935].reverse(),A=[249958057e5,424441966400,3733650367,2245904002e-2,102042.605,354.9632885,1].reverse(),S=[1,.00183105,-3516396496e-14,2457520174e-15,-240337019e-15].reverse(),O=[.04687499995,-.0002002690873,8449199096e-15,-88228987e-14,105787412e-15].reverse();function M(I){var F=0,C=0,P=0,R=I*I,q=I-2.356194491;return I<8?(C=I*r(w,R),P=r(A,R),F=C/P+s*(o(I,1)*t.log(I)-1/I)):(R=64/R,C=r(S,R),P=r(O,R),F=t.sqrt(s/I)*(t.sin(q)*C+t.cos(q)*P*8/I)),F}return i(b,M,"BESSELY",1,-1)}(),l=function(){var s=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),f=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse();function p(w){return w<=3.75?r(s,w*w/(3.75*3.75)):t.exp(t.abs(w))/t.sqrt(t.abs(w))*r(f,3.75/t.abs(w))}var h=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),y=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse();function b(w){return w<3.75?w*r(h,w*w/(3.75*3.75)):(w<0?-1:1)*t.exp(t.abs(w))/t.sqrt(t.abs(w))*r(y,3.75/t.abs(w))}return function w(A,S){if(S=Math.round(S),S===0)return p(A);if(S===1)return b(A);if(S<0)return NaN;if(t.abs(A)===0)return 0;if(A==1/0)return 1/0;var O=0,M,I=2/t.abs(A),F=0,C=1,P=0,R=2*t.round((S+t.round(t.sqrt(40*S)))/2);for(M=R;M>0;M--)P=M*I*C+F,F=C,C=P,t.abs(C)>1e10&&(C*=1e-10,F*=1e-10,O*=1e-10),M==S&&(O=F);return O*=w(A,0)/C,A<0&&S%2?-O:O}}(),a=function(){var s=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),f=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse();function p(w){return w<=2?-t.log(w/2)*l(w,0)+r(s,w*w/4):t.exp(-w)/t.sqrt(w)*r(f,2/w)}var h=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),y=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();function b(w){return w<=2?t.log(w/2)*l(w,1)+1/w*r(h,w*w/4):t.exp(-w)/t.sqrt(w)*r(y,2/w)}return i(p,b,"BESSELK",2,1)}();e.besselj=o,e.bessely=u,e.besseli=l,e.besselk=a})});var Us=vt((FC,_C)=>{g();x();v();(function(e,t){typeof FC=="object"&&typeof _C<"u"?_C.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.CodeMirror=t())})(FC,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),u=n||i||o,l=u&&(n?document.documentMode||6:+(o||i)[1]),a=!o&&/WebKit\//.test(e),s=a&&/Qt\/\d+\.\d+/.test(e),f=!o&&/Chrome\/(\d+)/.exec(e),p=f&&+f[1],h=/Opera\//.test(e),y=/Apple Computer/.test(navigator.vendor),b=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),w=/PhantomJS/.test(e),A=y&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),S=/Android/.test(e),O=A||S||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),M=A||/Mac/.test(t),I=/\bCrOS\b/.test(e),F=/win/i.test(t),C=h&&e.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(h=!1,a=!0);var P=M&&(s||h&&(C==null||C<12.11)),R=r||u&&l>=9;function q(c){return new RegExp("(^|\\s)"+c+"(?:$|\\s)\\s*")}var U=function(c,d){var E=c.className,N=q(d).exec(E);if(N){var T=E.slice(N.index+N[0].length);c.className=E.slice(0,N.index)+(T?N[1]+T:"")}};function H(c){for(var d=c.childNodes.length;d>0;--d)c.removeChild(c.firstChild);return c}function V(c,d){return H(c).appendChild(d)}function W(c,d,E,N){var T=document.createElement(c);if(E&&(T.className=E),N&&(T.style.cssText=N),typeof d=="string")T.appendChild(document.createTextNode(d));else if(d)for(var z=0;z=d)return G+(d-z);G+=te-z,G+=E-G%E,z=te+1}}var He=function(){this.id=null,this.f=null,this.time=0,this.handler=Pe(this.onTimeout,this)};He.prototype.onTimeout=function(c){c.id=0,c.time<=+new Date?c.f():setTimeout(c.handler,c.time-+new Date)},He.prototype.set=function(c,d){this.f=d;var E=+new Date+c;(!this.id||E=d)return N+Math.min(G,d-T);if(T+=z-N,T+=E-T%E,N=z+1,T>=d)return N}}var be=[""];function Ue(c){for(;be.length<=c;)be.push(ge(be)+" ");return be[c]}function ge(c){return c[c.length-1]}function Re(c,d){for(var E=[],N=0;N"\x80"&&(c.toUpperCase()!=c.toLowerCase()||Qe.test(c))}function Pt(c,d){return d?d.source.indexOf("\\w")>-1&&ut(c)?!0:d.test(c):ut(c)}function fe(c){for(var d in c)if(c.hasOwnProperty(d)&&c[d])return!1;return!0}var J=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function j(c){return c.charCodeAt(0)>=768&&J.test(c)}function ne(c,d,E){for(;(E<0?d>0:dE?-1:1;;){if(d==E)return d;var T=(d+E)/2,z=N<0?Math.ceil(T):Math.floor(T);if(z==d)return c(z)?d:E;c(z)?E=z:d=z+N}}function ye(c,d,E,N){if(!c)return N(d,E,"ltr",0);for(var T=!1,z=0;zd||d==E&&G.to==d)&&(N(Math.max(G.from,d),Math.min(G.to,E),G.level==1?"rtl":"ltr",z),T=!0)}T||N(d,E,"ltr")}var _e=null;function Je(c,d,E){var N;_e=null;for(var T=0;Td)return T;z.to==d&&(z.from!=z.to&&E=="before"?N=T:_e=T),z.from==d&&(z.from!=z.to&&E!="before"?N=T:_e=T)}return N??_e}var nt=function(){var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function E(se){return se<=247?c.charAt(se):1424<=se&&se<=1524?"R":1536<=se&&se<=1785?d.charAt(se-1536):1774<=se&&se<=2220?"r":8192<=se&&se<=8203?"w":se==8204?"b":"L"}var N=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,T=/[stwN]/,z=/[LRr]/,G=/[Lb1n]/,te=/[1n]/;function oe(se,Ae,Ie){this.level=se,this.from=Ae,this.to=Ie}return function(se,Ae){var Ie=Ae=="ltr"?"L":"R";if(se.length==0||Ae=="ltr"&&!N.test(se))return!1;for(var Ze=se.length,$e=[],at=0;at-1&&(N[d]=T.slice(0,z).concat(T.slice(z+1)))}}}function je(c,d){var E=xe(c,d);if(E.length)for(var N=Array.prototype.slice.call(arguments,2),T=0;T0}function Gr(c){c.prototype.on=function(d,E){X(this,d,E)},c.prototype.off=function(d,E){Ye(this,d,E)}}function Gt(c){c.preventDefault?c.preventDefault():c.returnValue=!1}function yi(c){c.stopPropagation?c.stopPropagation():c.cancelBubble=!0}function rr(c){return c.defaultPrevented!=null?c.defaultPrevented:c.returnValue==!1}function ao(c){Gt(c),yi(c)}function Er(c){return c.target||c.srcElement}function _n(c){var d=c.which;return d==null&&(c.button&1?d=1:c.button&2?d=3:c.button&4&&(d=2)),M&&c.ctrlKey&&d==1&&(d=3),d}var _a=function(){if(u&&l<9)return!1;var c=W("div");return"draggable"in c||"dragDrop"in c}(),ka;function Hn(c){if(ka==null){var d=W("span","\u200B");V(c,W("span",[d,document.createTextNode("x")])),c.firstChild.offsetHeight!=0&&(ka=d.offsetWidth<=1&&d.offsetHeight>2&&!(u&&l<8))}var E=ka?W("span","\u200B"):W("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return E.setAttribute("cm-text",""),E}var ra;function qo(c){if(ra!=null)return ra;var d=V(c,document.createTextNode("A\u062EA")),E=ie(d,0,1).getBoundingClientRect(),N=ie(d,1,2).getBoundingClientRect();return H(c),!E||E.left==E.right?!1:ra=N.right-E.right<3}var ni=` -b`.split(/\n/).length!=3?function(c){for(var d=0,S=[],N=c.length;d<=N;){var T=c.indexOf(` -`,d);T==-1&&(T=c.length);var z=c.slice(d,c.charAt(T-1)=="\r"?T-1:T),G=z.indexOf("\r");G!=-1?(S.push(z.slice(0,G)),d+=G+1):(S.push(z),d=T+1)}return S}:function(c){return c.split(/\r\n?|\n/)},na=window.getSelection?function(c){try{return c.selectionStart!=c.selectionEnd}catch{return!1}}:function(c){var d;try{d=c.ownerDocument.selection.createRange()}catch{}return!d||d.parentElement()!=c?!1:d.compareEndPoints("StartToEnd",d)!=0},Ul=function(){var c=W("div");return"oncopy"in c?!0:(c.setAttribute("oncopy","return;"),typeof c.oncopy=="function")}(),Eo=null;function fc(c){if(Eo!=null)return Eo;var d=V(c,W("span","x")),S=d.getBoundingClientRect(),N=ie(d,0,1).getBoundingClientRect();return Eo=Math.abs(S.left-N.left)>1}var hs={},so={};function uo(c,d){arguments.length>2&&(d.dependencies=Array.prototype.slice.call(arguments,2)),hs[c]=d}function ia(c,d){so[c]=d}function nu(c){if(typeof c=="string"&&so.hasOwnProperty(c))c=so[c];else if(c&&typeof c.name=="string"&&so.hasOwnProperty(c.name)){var d=so[c.name];typeof d=="string"&&(d={name:d}),c=ot(d,c),c.name=d.name}else{if(typeof c=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(c))return nu("application/xml");if(typeof c=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(c))return nu("application/json")}return typeof c=="string"?{name:c}:c||{name:"null"}}function Ba(c,d){d=nu(d);var S=hs[d.name];if(!S)return Ba(c,"text/plain");var N=S(c,d);if(jt.hasOwnProperty(d.name)){var T=jt[d.name];for(var z in T)T.hasOwnProperty(z)&&(N.hasOwnProperty(z)&&(N["_"+z]=N[z]),N[z]=T[z])}if(N.name=d.name,d.helperType&&(N.helperType=d.helperType),d.modeProps)for(var G in d.modeProps)N[G]=d.modeProps[G];return N}var jt={};function Gi(c,d){var S=jt.hasOwnProperty(c)?jt[c]:jt[c]={};Ce(d,S)}function Or(c,d){if(d===!0)return d;if(c.copyState)return c.copyState(d);var S={};for(var N in d){var T=d[N];T instanceof Array&&(T=T.concat([])),S[N]=T}return S}function qt(c,d){for(var S;c.innerMode&&(S=c.innerMode(d),!(!S||S.mode==c));)d=S.state,c=S.mode;return S||{mode:c,state:d}}function So(c,d,S){return c.startState?c.startState(d,S):!0}var Qr=function(c,d,S){this.pos=this.start=0,this.string=c,this.tabSize=d||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=S};Qr.prototype.eol=function(){return this.pos>=this.string.length},Qr.prototype.sol=function(){return this.pos==this.lineStart},Qr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qr.prototype.next=function(){if(this.posd},Qr.prototype.eatSpace=function(){for(var c=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>c},Qr.prototype.skipToEnd=function(){this.pos=this.string.length},Qr.prototype.skipTo=function(c){var d=this.string.indexOf(c,this.pos);if(d>-1)return this.pos=d,!0},Qr.prototype.backUp=function(c){this.pos-=c},Qr.prototype.column=function(){return this.lastColumnPos0?null:(z&&d!==!1&&(this.pos+=z[0].length),z)}},Qr.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qr.prototype.hideFirstChars=function(c,d){this.lineStart+=c;try{return d()}finally{this.lineStart-=c}},Qr.prototype.lookAhead=function(c){var d=this.lineOracle;return d&&d.lookAhead(c)},Qr.prototype.baseToken=function(){var c=this.lineOracle;return c&&c.baseToken(this.pos)};function zt(c,d){if(d-=c.first,d<0||d>=c.size)throw new Error("There is no line "+(d+c.first)+" in the document.");for(var S=c;!S.lines;)for(var N=0;;++N){var T=S.children[N],z=T.chunkSize();if(d=c.first&&dS?rt(S,zt(c,S).text.length):cc(d,zt(c,d.line).text.length)}function cc(c,d){var S=c.ch;return S==null||S>d?rt(c.line,d):S<0?rt(c.line,0):c}function Wd(c,d){for(var S=[],N=0;Nthis.maxLookAhead&&(this.maxLookAhead=c),d},aa.prototype.baseToken=function(c){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=c;)this.baseTokenPos+=2;var d=this.baseTokens[this.baseTokenPos+1];return{type:d&&d.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-c}},aa.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},aa.fromSaved=function(c,d,S){return d instanceof Wu?new aa(c,Or(c.mode,d.state),S,d.lookAhead):new aa(c,Or(c.mode,d),S)},aa.prototype.save=function(c){var d=c!==!1?Or(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Wu(d,this.maxLookAhead):d};function ds(c,d,S,N){var T=[c.state.modeGen],z={};hc(c,d.text,c.doc.mode,S,function(se,Ae){return T.push(se,Ae)},z,N);for(var G=S.state,te=function(se){S.baseTokens=T;var Ae=c.state.overlays[se],Ie=1,Ze=0;S.state=!0,hc(c,d.text,Ae.mode,S,function($e,at){for(var mt=Ie;Ze<$e;){var xt=T[Ie];xt>$e&&T.splice(Ie,1,$e,T[Ie+1],xt),Ie+=2,Ze=Math.min($e,xt)}if(at)if(Ae.opaque)T.splice(mt,Ie-mt,$e,"overlay "+at),Ie=mt+2;else for(;mtc.options.maxHighlightLength&&Or(c.doc.mode,N.state),z=ds(c,d,N);T&&(N.state=T),d.stateAfter=N.save(!T),d.styles=z.styles,z.classes?d.styleClasses=z.classes:d.styleClasses&&(d.styleClasses=null),S===c.doc.highlightFrontier&&(c.doc.modeFrontier=Math.max(c.doc.modeFrontier,++c.doc.highlightFrontier))}return d.styles}function jr(c,d,S){var N=c.doc,T=c.display;if(!N.mode.startState)return new aa(N,!0,d);var z=Ao(c,d,S),G=z>N.first&&zt(N,z-1).stateAfter,te=G?aa.fromSaved(N,G,z):new aa(N,So(N.mode),z);return N.iter(z,d,function(oe){sm(c,oe.text,te);var se=te.line;oe.stateAfter=se==d-1||se%5==0||se>=T.viewFrom&&sed.start)return z}throw new Error("Mode "+c.name+" failed to advance stream.")}var En=function(c,d,S){this.start=c.start,this.end=c.pos,this.string=c.current(),this.type=d||null,this.state=S};function pc(c,d,S,N){var T=c.doc,z=T.mode,G;d=Tt(T,d);var te=zt(T,d.line),oe=jr(c,d.line,S),se=new Qr(te.text,c.options.tabSize,oe),Ae;for(N&&(Ae=[]);(N||se.posc.options.maxHighlightLength?(te=!1,G&&sm(c,d,N,Ae.pos),Ae.pos=d.length,Ie=null):Ie=mc(Vd(S,Ae,N.state,Ze),z),Ze){var $e=Ze[0].name;$e&&(Ie="m-"+(Ie?$e+" "+Ie:$e))}if(!te||se!=Ie){for(;oeG;--te){if(te<=z.first)return z.first;var oe=zt(z,te-1),se=oe.stateAfter;if(se&&(!S||te+(se instanceof Wu?se.lookAhead:0)<=z.modeFrontier))return te;var Ae=Oe(oe.text,null,c.options.tabSize);(T==null||N>Ae)&&(T=te-1,N=Ae)}return T}function um(c,d){if(c.modeFrontier=Math.min(c.modeFrontier,d),!(c.highlightFrontierS;N--){var T=zt(c,N).stateAfter;if(T&&(!(T instanceof Wu)||N+T.lookAhead=d:z.to>d);(N||(N=[])).push(new dc(G,z.from,oe?null:z.to))}}return N}function Gu(c,d,S){var N;if(c)for(var T=0;T=d:z.to>d);if(te||z.from==d&&G.type=="bookmark"&&(!S||z.marker.insertLeft)){var oe=z.from==null||(G.inclusiveLeft?z.from<=d:z.from0&&te)for(var It=0;It0)){var Ae=[oe,1],Ie=ke(se.from,te.from),Ze=ke(se.to,te.to);(Ie<0||!G.inclusiveLeft&&!Ie)&&Ae.push({from:se.from,to:te.from}),(Ze>0||!G.inclusiveRight&&!Ze)&&Ae.push({from:te.to,to:se.to}),T.splice.apply(T,Ae),oe+=Ae.length-3}}return T}function Hl(c){var d=c.markedSpans;if(d){for(var S=0;Sd)&&(!N||ou(N,z.marker)<0)&&(N=z.marker)}return N}function N1(c,d,S,N,T){var z=zt(c,d),G=Co&&z.markedSpans;if(G)for(var te=0;te=0&&Ie<=0||Ae<=0&&Ie>=0)&&(Ae<=0&&(oe.marker.inclusiveRight&&T.inclusiveLeft?ke(se.to,S)>=0:ke(se.to,S)>0)||Ae>=0&&(oe.marker.inclusiveRight&&T.inclusiveLeft?ke(se.from,N)<=0:ke(se.from,N)<0)))return!0}}}function sa(c){for(var d;d=ii(c);)c=d.find(-1,!0).line;return c}function xN(c){for(var d;d=fm(c);)c=d.find(1,!0).line;return c}function yc(c){for(var d,S;d=fm(c);)c=d.find(1,!0).line,(S||(S=[])).push(c);return S}function au(c,d){var S=zt(c,d),N=sa(S);return S==N?d:ue(N)}function E1(c,d){if(d>c.lastLine())return d;var S=zt(c,d),N;if(!Zi(c,S))return d;for(;N=fm(S);)S=N.find(1,!0).line;return ue(S)+1}function Zi(c,d){var S=Co&&d.markedSpans;if(S){for(var N=void 0,T=0;Td.maxLineLength&&(d.maxLineLength=T,d.maxLine=N)})}var Wl=function(c,d,S){this.text=c,Yi(this,d),this.height=S?S(this):1};Wl.prototype.lineNo=function(){return ue(this)},Gr(Wl);function Zd(c,d,S,N){c.text=d,c.stateAfter&&(c.stateAfter=null),c.styles&&(c.styles=null),c.order!=null&&(c.order=null),Hl(c),Yi(c,S);var T=N?N(c):1;T!=c.height&&$n(c,T)}function S1(c){c.parent=null,Hl(c)}var Xd={},A1={};function Kd(c,d){if(!c||/^\s*$/.test(c))return null;var S=d.addModeClass?A1:Xd;return S[c]||(S[c]=c.replace(/\S+/g,"cm-$&"))}function Jd(c,d){var S=ee("span",null,null,a?"padding-right: .1px":null),N={pre:ee("pre",[S],"CodeMirror-line"),content:S,col:0,pos:0,cm:c,trailingSpace:!1,splitSpaces:c.getOption("lineWrapping")};d.measure={};for(var T=0;T<=(d.rest?d.rest.length:0);T++){var z=T?d.rest[T-1]:d.line,G=void 0;N.pos=0,N.addToken=C1,qo(c.display.measure)&&(G=Xe(z,c.doc.direction))&&(N.addToken=xc(N.addToken,G)),N.map=[];var te=d!=c.display.externalMeasured&&ue(z);Qd(z,N,b1(c,z,te)),z.styleClasses&&(z.styleClasses.bgClass&&(N.bgClass=re(z.styleClasses.bgClass,N.bgClass||"")),z.styleClasses.textClass&&(N.textClass=re(z.styleClasses.textClass,N.textClass||""))),N.map.length==0&&N.map.push(0,0,N.content.appendChild(Hn(c.display.measure))),T==0?(d.measure.map=N.map,d.measure.cache={}):((d.measure.maps||(d.measure.maps=[])).push(N.map),(d.measure.caches||(d.measure.caches=[])).push({}))}if(a){var oe=N.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(N.content.className="cm-tab-wrap-hack")}return je(c,"renderLine",c,d.line,N.pre),N.pre.className&&(N.textClass=re(N.pre.className,N.textClass||"")),N}function wN(c){var d=W("span","\u2022","cm-invalidchar");return d.title="\\u"+c.charCodeAt(0).toString(16),d.setAttribute("aria-label",d.title),d}function C1(c,d,S,N,T,z,G){if(d){var te=c.splitSpaces?bN(d,c.trailingSpace):d,oe=c.cm.state.specialChars,se=!1,Ae;if(!oe.test(d))c.col+=d.length,Ae=document.createTextNode(te),c.map.push(c.pos,c.pos+d.length,Ae),u&&l<9&&(se=!0),c.pos+=d.length;else{Ae=document.createDocumentFragment();for(var Ie=0;;){oe.lastIndex=Ie;var Ze=oe.exec(d),$e=Ze?Ze.index-Ie:d.length-Ie;if($e){var at=document.createTextNode(te.slice(Ie,Ie+$e));u&&l<9?Ae.appendChild(W("span",[at])):Ae.appendChild(at),c.map.push(c.pos,c.pos+$e,at),c.col+=$e,c.pos+=$e}if(!Ze)break;Ie+=$e+1;var mt=void 0;if(Ze[0]==" "){var xt=c.cm.options.tabSize,bt=xt-c.col%xt;mt=Ae.appendChild(W("span",Ue(bt),"cm-tab")),mt.setAttribute("role","presentation"),mt.setAttribute("cm-text"," "),c.col+=bt}else Ze[0]=="\r"||Ze[0]==` -`?(mt=Ae.appendChild(W("span",Ze[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),mt.setAttribute("cm-text",Ze[0]),c.col+=1):(mt=c.cm.options.specialCharPlaceholder(Ze[0]),mt.setAttribute("cm-text",Ze[0]),u&&l<9?Ae.appendChild(W("span",[mt])):Ae.appendChild(mt),c.col+=1);c.map.push(c.pos,c.pos+1,mt),c.pos++}}if(c.trailingSpace=te.charCodeAt(d.length-1)==32,S||N||T||se||z||G){var At=S||"";N&&(At+=N),T&&(At+=T);var Dt=W("span",[Ae],At,z);if(G)for(var It in G)G.hasOwnProperty(It)&&It!="style"&&It!="class"&&Dt.setAttribute(It,G[It]);return c.content.appendChild(Dt)}c.content.appendChild(Ae)}}function bN(c,d){if(c.length>1&&!/ /.test(c))return c;for(var S=d,N="",T=0;Tse&&Ie.from<=se));Ze++);if(Ie.to>=Ae)return c(S,N,T,z,G,te,oe);c(S,N.slice(0,Ie.to-se),T,z,null,te,oe),z=null,N=N.slice(Ie.to-se),se=Ie.to}}}function pm(c,d,S,N){var T=!N&&S.widgetNode;T&&c.map.push(c.pos,c.pos+d,T),!N&&c.cm.display.input.needsContentAttribute&&(T||(T=c.content.appendChild(document.createElement("span"))),T.setAttribute("cm-marker",S.id)),T&&(c.cm.display.input.setUneditable(T),c.content.appendChild(T)),c.pos+=d,c.trailingSpace=!1}function Qd(c,d,S){var N=c.markedSpans,T=c.text,z=0;if(!N){for(var G=1;Goe||sr.collapsed&&Vt.to==oe&&Vt.from==oe)){if(Vt.to!=null&&Vt.to!=oe&&$e>Vt.to&&($e=Vt.to,mt=""),sr.className&&(at+=" "+sr.className),sr.css&&(Ze=(Ze?Ze+";":"")+sr.css),sr.startStyle&&Vt.from==oe&&(xt+=" "+sr.startStyle),sr.endStyle&&Vt.to==$e&&(It||(It=[])).push(sr.endStyle,Vt.to),sr.title&&((At||(At={})).title=sr.title),sr.attributes)for(var Yr in sr.attributes)(At||(At={}))[Yr]=sr.attributes[Yr];sr.collapsed&&(!bt||ou(bt.marker,sr)<0)&&(bt=Vt)}else Vt.from>oe&&$e>Vt.from&&($e=Vt.from)}if(It)for(var ai=0;ai=te)break;for(var Zn=Math.min(te,$e);;){if(Ae){var _i=oe+Ae.length;if(!bt){var Ln=_i>Zn?Ae.slice(0,Zn-oe):Ae;d.addToken(d,Ln,Ie?Ie+at:at,xt,oe+Ln.length==$e?mt:"",Ze,At)}if(_i>=Zn){Ae=Ae.slice(Zn-oe),oe=Zn;break}oe=_i,xt=""}Ae=T.slice(z,z=S[se++]),Ie=Kd(S[se++],d.cm.options)}}}function jd(c,d,S){this.line=d,this.rest=yc(d),this.size=this.rest?ue(ge(this.rest))-S+1:1,this.node=this.text=null,this.hidden=Zi(c,d)}function Vl(c,d,S){for(var N=[],T,z=d;z2&&z.push((oe.bottom+se.top)/2-S.top)}}z.push(S.bottom-S.top)}}function ig(c,d,S){if(c.line==d)return{map:c.measure.map,cache:c.measure.cache};if(c.rest){for(var N=0;NS)return{map:c.measure.maps[T],cache:c.measure.caches[T],before:!0}}}function NN(c,d){d=sa(d);var S=ue(d),N=c.display.externalMeasured=new jd(c.doc,d,S);N.lineN=S;var T=N.built=Jd(c,N);return N.text=T.pre,V(c.display.lineMeasure,T.pre),N}function F1(c,d,S,N){return To(c,Ku(c,d),S,N)}function vm(c,d){if(d>=c.display.viewFrom&&d=S.lineN&&dd)&&(z=oe-te,T=z-1,d>=oe&&(G="right")),T!=null){if(N=c[se+2],te==oe&&S==(N.insertLeft?"left":"right")&&(G=S),S=="left"&&T==0)for(;se&&c[se-2]==c[se-3]&&c[se-1].insertLeft;)N=c[(se-=3)+2],G="left";if(S=="right"&&T==oe-te)for(;se=0&&(S=c[T]).left==S.right;T--);return S}function L1(c,d,S,N){var T=k1(d.map,S,N),z=T.node,G=T.start,te=T.end,oe=T.collapse,se;if(z.nodeType==3){for(var Ae=0;Ae<4;Ae++){for(;G&&j(d.line.text.charAt(T.coverStart+G));)--G;for(;T.coverStart+te0&&(oe=N="right");var Ie;c.options.lineWrapping&&(Ie=z.getClientRects()).length>1?se=Ie[N=="right"?Ie.length-1:0]:se=z.getBoundingClientRect()}if(u&&l<9&&!G&&(!se||!se.left&&!se.right)){var Ze=z.parentNode.getClientRects()[0];Ze?se={left:Ze.left,right:Ze.left+xs(c.display),top:Ze.top,bottom:Ze.bottom}:se=_1}for(var $e=se.top-d.rect.top,at=se.bottom-d.rect.top,mt=($e+at)/2,xt=d.view.measure.heights,bt=0;bt=N.text.length?(oe=N.text.length,se="before"):oe<=0&&(oe=0,se="after"),!te)return G(se=="before"?oe-1:oe,se=="before");function Ae(at,mt,xt){var bt=te[mt],At=bt.level==1;return G(xt?at-1:at,At!=xt)}var Ie=Je(te,oe,se),Ze=_e,$e=Ae(oe,Ie,se=="before");return Ze!=null&&($e.other=Ae(oe,Ze,se!="before")),$e}function Ju(c,d){var S=0;d=Tt(c.doc,d),c.options.lineWrapping||(S=xs(c.display)*d.ch);var N=zt(c.doc,d.line),T=Uo(N)+Yl(c.display);return{left:S,right:S,top:T,bottom:T+N.height}}function Nc(c,d,S,N,T){var z=rt(c,d,S);return z.xRel=T,N&&(z.outside=N),z}function og(c,d,S){var N=c.doc;if(S+=c.display.viewOffset,S<0)return Nc(N.first,0,null,-1,-1);var T=Me(N,S),z=N.first+N.size-1;if(T>z)return Nc(N.first+N.size-1,zt(N,z).text.length,null,1,1);d<0&&(d=0);for(var G=zt(N,T);;){var te=SN(c,G,T,d,S),oe=yN(G,te.ch+(te.xRel>0||te.outside>0?1:0));if(!oe)return te;var se=oe.find(1);if(se.line==T)return se;G=zt(N,T=se.line)}}function z1(c,d,S,N){N-=Bn(d);var T=d.text.length,z=me(function(G){return To(c,S,G-1).bottom<=N},T,0);return T=me(function(G){return To(c,S,G).top>N},z,T),{begin:z,end:T}}function U1(c,d,S,N){S||(S=Ku(c,d));var T=Dc(c,d,To(c,S,N),"line").top;return z1(c,d,S,T)}function ag(c,d,S,N){return c.bottom<=S?!1:c.top>S?!0:(N?c.left:c.right)>d}function SN(c,d,S,N,T){T-=Uo(d);var z=Ku(c,d),G=Bn(d),te=0,oe=d.text.length,se=!0,Ae=Xe(d,c.doc.direction);if(Ae){var Ie=(c.options.lineWrapping?AN:Ec)(c,d,S,z,Ae,N,T);se=Ie.level!=1,te=se?Ie.from:Ie.to-1,oe=se?Ie.to:Ie.from-1}var Ze=null,$e=null,at=me(function(Yt){var Vt=To(c,z,Yt);return Vt.top+=G,Vt.bottom+=G,ag(Vt,N,T,!1)?(Vt.top<=T&&Vt.left<=N&&(Ze=Yt,$e=Vt),!0):!1},te,oe),mt,xt,bt=!1;if($e){var At=N-$e.left<$e.right-N,Dt=At==se;at=Ze+(Dt?0:1),xt=Dt?"after":"before",mt=At?$e.left:$e.right}else{!se&&(at==oe||at==te)&&at++,xt=at==0?"after":at==d.text.length?"before":To(c,z,at-(se?1:0)).bottom+G<=T==se?"after":"before";var It=Ki(c,rt(S,at,xt),"line",d,z);mt=It.left,bt=T=It.bottom?1:0}return at=ne(d.text,at,1),Nc(S,at,xt,bt,N-mt)}function Ec(c,d,S,N,T,z,G){var te=me(function(Ie){var Ze=T[Ie],$e=Ze.level!=1;return ag(Ki(c,rt(S,$e?Ze.to:Ze.from,$e?"before":"after"),"line",d,N),z,G,!0)},0,T.length-1),oe=T[te];if(te>0){var se=oe.level!=1,Ae=Ki(c,rt(S,se?oe.from:oe.to,se?"after":"before"),"line",d,N);ag(Ae,z,G,!0)&&Ae.top>G&&(oe=T[te-1])}return oe}function AN(c,d,S,N,T,z,G){var te=z1(c,d,N,G),oe=te.begin,se=te.end;/\s/.test(d.text.charAt(se-1))&&se--;for(var Ae=null,Ie=null,Ze=0;Ze=se||$e.to<=oe)){var at=$e.level!=1,mt=To(c,N,at?Math.min(se,$e.to)-1:Math.max(oe,$e.from)).right,xt=mtxt)&&(Ae=$e,Ie=xt)}}return Ae||(Ae=T[T.length-1]),Ae.fromse&&(Ae={from:Ae.from,to:se,level:Ae.level}),Ae}var li;function la(c){if(c.cachedTextHeight!=null)return c.cachedTextHeight;if(li==null){li=W("pre",null,"CodeMirror-line-like");for(var d=0;d<49;++d)li.appendChild(document.createTextNode("x")),li.appendChild(W("br"));li.appendChild(document.createTextNode("x"))}V(c.measure,li);var S=li.offsetHeight/50;return S>3&&(c.cachedTextHeight=S),H(c.measure),S||1}function xs(c){if(c.cachedCharWidth!=null)return c.cachedCharWidth;var d=W("span","xxxxxxxxxx"),S=W("pre",[d],"CodeMirror-line-like");V(c.measure,S);var N=d.getBoundingClientRect(),T=(N.right-N.left)/10;return T>2&&(c.cachedCharWidth=T),T||10}function Zl(c){for(var d=c.display,S={},N={},T=d.gutters.clientLeft,z=d.gutters.firstChild,G=0;z;z=z.nextSibling,++G){var te=c.display.gutterSpecs[G].className;S[te]=z.offsetLeft+z.clientLeft+T,N[te]=z.clientWidth}return{fixedPos:Sc(d),gutterTotalWidth:d.gutters.offsetWidth,gutterLeft:S,gutterWidth:N,wrapperWidth:d.wrapper.clientWidth}}function Sc(c){return c.scroller.getBoundingClientRect().left-c.sizer.getBoundingClientRect().left}function Xl(c){var d=la(c.display),S=c.options.lineWrapping,N=S&&Math.max(5,c.display.scroller.clientWidth/xs(c.display)-3);return function(T){if(Zi(c.doc,T))return 0;var z=0;if(T.widgets)for(var G=0;G0&&(se=zt(c.doc,oe.line).text).length==oe.ch){var Ae=Oe(se,se.length,c.options.tabSize)-se.length;oe=rt(oe.line,Math.max(0,Math.round((z-lo(c.display).left)/xs(c.display))-Ae))}return oe}function Qu(c,d){if(d>=c.display.viewTo||(d-=c.display.viewFrom,d<0))return null;for(var S=c.display.view,N=0;Nd)&&(T.updateLineNumbers=d),c.curOp.viewChanged=!0,d>=T.viewTo)Co&&au(c.doc,d)T.viewFrom?Pa(c):(T.viewFrom+=N,T.viewTo+=N);else if(d<=T.viewFrom&&S>=T.viewTo)Pa(c);else if(d<=T.viewFrom){var z=Kl(c,S,S+N,1);z?(T.view=T.view.slice(z.index),T.viewFrom=z.lineN,T.viewTo+=N):Pa(c)}else if(S>=T.viewTo){var G=Kl(c,d,d,-1);G?(T.view=T.view.slice(0,G.index),T.viewTo=G.lineN):Pa(c)}else{var te=Kl(c,d,d,-1),oe=Kl(c,S,S+N,1);te&&oe?(T.view=T.view.slice(0,te.index).concat(Vl(c,te.lineN,oe.lineN)).concat(T.view.slice(oe.index)),T.viewTo+=N):Pa(c)}var se=T.externalMeasured;se&&(S=T.lineN&&d=N.viewTo)){var z=N.view[Qu(c,d)];if(z.node!=null){var G=z.changes||(z.changes=[]);Se(G,S)==-1&&G.push(S)}}}function Pa(c){c.display.viewFrom=c.display.viewTo=c.doc.first,c.display.view=[],c.display.viewOffset=0}function Kl(c,d,S,N){var T=Qu(c,d),z,G=c.display.view;if(!Co||S==c.doc.first+c.doc.size)return{index:T,lineN:S};for(var te=c.display.viewFrom,oe=0;oe0){if(T==G.length-1)return null;z=te+G[T].size-d,T++}else z=te-d;d+=z,S+=z}for(;au(c.doc,S)!=S;){if(T==(N<0?0:G.length-1))return null;S+=N*G[T-(N<0?1:0)].size,T+=N}return{index:T,lineN:S}}function CN(c,d,S){var N=c.display,T=N.view;T.length==0||d>=N.viewTo||S<=N.viewFrom?(N.view=Vl(c,d,S),N.viewFrom=d):(N.viewFrom>d?N.view=Vl(c,d,N.viewFrom).concat(N.view):N.viewFromS&&(N.view=N.view.slice(0,Qu(c,S)))),N.viewTo=S}function sg(c){for(var d=c.display.view,S=0,N=0;N=c.display.viewTo||oe.to().line0?G:c.defaultCharWidth())+"px"}if(N.other){var te=S.appendChild(W("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));te.style.display="",te.style.left=N.other.left+"px",te.style.top=N.other.top+"px",te.style.height=(N.other.bottom-N.other.top)*.85+"px"}}function Jl(c,d){return c.top-d.top||c.left-d.left}function ug(c,d,S){var N=c.display,T=c.doc,z=document.createDocumentFragment(),G=lo(c.display),te=G.left,oe=Math.max(N.sizerWidth,lu(c)-N.sizer.offsetLeft)-G.right,se=T.direction=="ltr";function Ae(Dt,It,Yt,Vt){It<0&&(It=0),It=Math.round(It),Vt=Math.round(Vt),z.appendChild(W("div",null,"CodeMirror-selected","position: absolute; left: "+Dt+`px; +b`.split(/\n/).length!=3?function(c){for(var d=0,E=[],N=c.length;d<=N;){var T=c.indexOf(` +`,d);T==-1&&(T=c.length);var z=c.slice(d,c.charAt(T-1)=="\r"?T-1:T),G=z.indexOf("\r");G!=-1?(E.push(z.slice(0,G)),d+=G+1):(E.push(z),d=T+1)}return E}:function(c){return c.split(/\r\n?|\n/)},na=window.getSelection?function(c){try{return c.selectionStart!=c.selectionEnd}catch{return!1}}:function(c){var d;try{d=c.ownerDocument.selection.createRange()}catch{}return!d||d.parentElement()!=c?!1:d.compareEndPoints("StartToEnd",d)!=0},Hl=function(){var c=W("div");return"oncopy"in c?!0:(c.setAttribute("oncopy","return;"),typeof c.oncopy=="function")}(),So=null;function fc(c){if(So!=null)return So;var d=V(c,W("span","x")),E=d.getBoundingClientRect(),N=ie(d,0,1).getBoundingClientRect();return So=Math.abs(E.left-N.left)>1}var ms={},so={};function uo(c,d){arguments.length>2&&(d.dependencies=Array.prototype.slice.call(arguments,2)),ms[c]=d}function ia(c,d){so[c]=d}function ru(c){if(typeof c=="string"&&so.hasOwnProperty(c))c=so[c];else if(c&&typeof c.name=="string"&&so.hasOwnProperty(c.name)){var d=so[c.name];typeof d=="string"&&(d={name:d}),c=ot(d,c),c.name=d.name}else{if(typeof c=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(c))return ru("application/xml");if(typeof c=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(c))return ru("application/json")}return typeof c=="string"?{name:c}:c||{name:"null"}}function Ba(c,d){d=ru(d);var E=ms[d.name];if(!E)return Ba(c,"text/plain");var N=E(c,d);if(jt.hasOwnProperty(d.name)){var T=jt[d.name];for(var z in T)T.hasOwnProperty(z)&&(N.hasOwnProperty(z)&&(N["_"+z]=N[z]),N[z]=T[z])}if(N.name=d.name,d.helperType&&(N.helperType=d.helperType),d.modeProps)for(var G in d.modeProps)N[G]=d.modeProps[G];return N}var jt={};function Gi(c,d){var E=jt.hasOwnProperty(c)?jt[c]:jt[c]={};Ce(d,E)}function Or(c,d){if(d===!0)return d;if(c.copyState)return c.copyState(d);var E={};for(var N in d){var T=d[N];T instanceof Array&&(T=T.concat([])),E[N]=T}return E}function qt(c,d){for(var E;c.innerMode&&(E=c.innerMode(d),!(!E||E.mode==c));)d=E.state,c=E.mode;return E||{mode:c,state:d}}function Eo(c,d,E){return c.startState?c.startState(d,E):!0}var Qr=function(c,d,E){this.pos=this.start=0,this.string=c,this.tabSize=d||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=E};Qr.prototype.eol=function(){return this.pos>=this.string.length},Qr.prototype.sol=function(){return this.pos==this.lineStart},Qr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qr.prototype.next=function(){if(this.posd},Qr.prototype.eatSpace=function(){for(var c=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>c},Qr.prototype.skipToEnd=function(){this.pos=this.string.length},Qr.prototype.skipTo=function(c){var d=this.string.indexOf(c,this.pos);if(d>-1)return this.pos=d,!0},Qr.prototype.backUp=function(c){this.pos-=c},Qr.prototype.column=function(){return this.lastColumnPos0?null:(z&&d!==!1&&(this.pos+=z[0].length),z)}},Qr.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qr.prototype.hideFirstChars=function(c,d){this.lineStart+=c;try{return d()}finally{this.lineStart-=c}},Qr.prototype.lookAhead=function(c){var d=this.lineOracle;return d&&d.lookAhead(c)},Qr.prototype.baseToken=function(){var c=this.lineOracle;return c&&c.baseToken(this.pos)};function zt(c,d){if(d-=c.first,d<0||d>=c.size)throw new Error("There is no line "+(d+c.first)+" in the document.");for(var E=c;!E.lines;)for(var N=0;;++N){var T=E.children[N],z=T.chunkSize();if(d=c.first&&dE?rt(E,zt(c,E).text.length):cc(d,zt(c,d.line).text.length)}function cc(c,d){var E=c.ch;return E==null||E>d?rt(c.line,d):E<0?rt(c.line,0):c}function $d(c,d){for(var E=[],N=0;Nthis.maxLookAhead&&(this.maxLookAhead=c),d},aa.prototype.baseToken=function(c){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=c;)this.baseTokenPos+=2;var d=this.baseTokens[this.baseTokenPos+1];return{type:d&&d.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-c}},aa.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},aa.fromSaved=function(c,d,E){return d instanceof Wu?new aa(c,Or(c.mode,d.state),E,d.lookAhead):new aa(c,Or(c.mode,d),E)},aa.prototype.save=function(c){var d=c!==!1?Or(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Wu(d,this.maxLookAhead):d};function hs(c,d,E,N){var T=[c.state.modeGen],z={};hc(c,d.text,c.doc.mode,E,function(se,Ae){return T.push(se,Ae)},z,N);for(var G=E.state,te=function(se){E.baseTokens=T;var Ae=c.state.overlays[se],Ie=1,Ze=0;E.state=!0,hc(c,d.text,Ae.mode,E,function($e,at){for(var mt=Ie;Ze<$e;){var yt=T[Ie];yt>$e&&T.splice(Ie,1,$e,T[Ie+1],yt),Ie+=2,Ze=Math.min($e,yt)}if(at)if(Ae.opaque)T.splice(mt,Ie-mt,$e,"overlay "+at),Ie=mt+2;else for(;mtc.options.maxHighlightLength&&Or(c.doc.mode,N.state),z=hs(c,d,N);T&&(N.state=T),d.stateAfter=N.save(!T),d.styles=z.styles,z.classes?d.styleClasses=z.classes:d.styleClasses&&(d.styleClasses=null),E===c.doc.highlightFrontier&&(c.doc.modeFrontier=Math.max(c.doc.modeFrontier,++c.doc.highlightFrontier))}return d.styles}function jr(c,d,E){var N=c.doc,T=c.display;if(!N.mode.startState)return new aa(N,!0,d);var z=Ao(c,d,E),G=z>N.first&&zt(N,z-1).stateAfter,te=G?aa.fromSaved(N,G,z):new aa(N,Eo(N.mode),z);return N.iter(z,d,function(oe){sm(c,oe.text,te);var se=te.line;oe.stateAfter=se==d-1||se%5==0||se>=T.viewFrom&&sed.start)return z}throw new Error("Mode "+c.name+" failed to advance stream.")}var Sn=function(c,d,E){this.start=c.start,this.end=c.pos,this.string=c.current(),this.type=d||null,this.state=E};function pc(c,d,E,N){var T=c.doc,z=T.mode,G;d=Tt(T,d);var te=zt(T,d.line),oe=jr(c,d.line,E),se=new Qr(te.text,c.options.tabSize,oe),Ae;for(N&&(Ae=[]);(N||se.posc.options.maxHighlightLength?(te=!1,G&&sm(c,d,N,Ae.pos),Ae.pos=d.length,Ie=null):Ie=mc(Wd(E,Ae,N.state,Ze),z),Ze){var $e=Ze[0].name;$e&&(Ie="m-"+(Ie?$e+" "+Ie:$e))}if(!te||se!=Ie){for(;oeG;--te){if(te<=z.first)return z.first;var oe=zt(z,te-1),se=oe.stateAfter;if(se&&(!E||te+(se instanceof Wu?se.lookAhead:0)<=z.modeFrontier))return te;var Ae=Oe(oe.text,null,c.options.tabSize);(T==null||N>Ae)&&(T=te-1,N=Ae)}return T}function um(c,d){if(c.modeFrontier=Math.min(c.modeFrontier,d),!(c.highlightFrontierE;N--){var T=zt(c,N).stateAfter;if(T&&(!(T instanceof Wu)||N+T.lookAhead=d:z.to>d);(N||(N=[])).push(new dc(G,z.from,oe?null:z.to))}}return N}function Gu(c,d,E){var N;if(c)for(var T=0;T=d:z.to>d);if(te||z.from==d&&G.type=="bookmark"&&(!E||z.marker.insertLeft)){var oe=z.from==null||(G.inclusiveLeft?z.from<=d:z.from0&&te)for(var It=0;It0)){var Ae=[oe,1],Ie=ke(se.from,te.from),Ze=ke(se.to,te.to);(Ie<0||!G.inclusiveLeft&&!Ie)&&Ae.push({from:se.from,to:te.from}),(Ze>0||!G.inclusiveRight&&!Ze)&&Ae.push({from:te.to,to:se.to}),T.splice.apply(T,Ae),oe+=Ae.length-3}}return T}function $l(c){var d=c.markedSpans;if(d){for(var E=0;Ed)&&(!N||iu(N,z.marker)<0)&&(N=z.marker)}return N}function N1(c,d,E,N,T){var z=zt(c,d),G=Co&&z.markedSpans;if(G)for(var te=0;te=0&&Ie<=0||Ae<=0&&Ie>=0)&&(Ae<=0&&(oe.marker.inclusiveRight&&T.inclusiveLeft?ke(se.to,E)>=0:ke(se.to,E)>0)||Ae>=0&&(oe.marker.inclusiveRight&&T.inclusiveLeft?ke(se.from,N)<=0:ke(se.from,N)<0)))return!0}}}function sa(c){for(var d;d=ii(c);)c=d.find(-1,!0).line;return c}function yN(c){for(var d;d=fm(c);)c=d.find(1,!0).line;return c}function xc(c){for(var d,E;d=fm(c);)c=d.find(1,!0).line,(E||(E=[])).push(c);return E}function ou(c,d){var E=zt(c,d),N=sa(E);return E==N?d:ue(N)}function S1(c,d){if(d>c.lastLine())return d;var E=zt(c,d),N;if(!Zi(c,E))return d;for(;N=fm(E);)E=N.find(1,!0).line;return ue(E)+1}function Zi(c,d){var E=Co&&d.markedSpans;if(E){for(var N=void 0,T=0;Td.maxLineLength&&(d.maxLineLength=T,d.maxLine=N)})}var Vl=function(c,d,E){this.text=c,Yi(this,d),this.height=E?E(this):1};Vl.prototype.lineNo=function(){return ue(this)},Gr(Vl);function Yd(c,d,E,N){c.text=d,c.stateAfter&&(c.stateAfter=null),c.styles&&(c.styles=null),c.order!=null&&(c.order=null),$l(c),Yi(c,E);var T=N?N(c):1;T!=c.height&&$n(c,T)}function E1(c){c.parent=null,$l(c)}var Zd={},A1={};function Xd(c,d){if(!c||/^\s*$/.test(c))return null;var E=d.addModeClass?A1:Zd;return E[c]||(E[c]=c.replace(/\S+/g,"cm-$&"))}function Kd(c,d){var E=ee("span",null,null,a?"padding-right: .1px":null),N={pre:ee("pre",[E],"CodeMirror-line"),content:E,col:0,pos:0,cm:c,trailingSpace:!1,splitSpaces:c.getOption("lineWrapping")};d.measure={};for(var T=0;T<=(d.rest?d.rest.length:0);T++){var z=T?d.rest[T-1]:d.line,G=void 0;N.pos=0,N.addToken=C1,qo(c.display.measure)&&(G=Xe(z,c.doc.direction))&&(N.addToken=yc(N.addToken,G)),N.map=[];var te=d!=c.display.externalMeasured&&ue(z);Jd(z,N,b1(c,z,te)),z.styleClasses&&(z.styleClasses.bgClass&&(N.bgClass=re(z.styleClasses.bgClass,N.bgClass||"")),z.styleClasses.textClass&&(N.textClass=re(z.styleClasses.textClass,N.textClass||""))),N.map.length==0&&N.map.push(0,0,N.content.appendChild(Hn(c.display.measure))),T==0?(d.measure.map=N.map,d.measure.cache={}):((d.measure.maps||(d.measure.maps=[])).push(N.map),(d.measure.caches||(d.measure.caches=[])).push({}))}if(a){var oe=N.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(N.content.className="cm-tab-wrap-hack")}return je(c,"renderLine",c,d.line,N.pre),N.pre.className&&(N.textClass=re(N.pre.className,N.textClass||"")),N}function wN(c){var d=W("span","\u2022","cm-invalidchar");return d.title="\\u"+c.charCodeAt(0).toString(16),d.setAttribute("aria-label",d.title),d}function C1(c,d,E,N,T,z,G){if(d){var te=c.splitSpaces?bN(d,c.trailingSpace):d,oe=c.cm.state.specialChars,se=!1,Ae;if(!oe.test(d))c.col+=d.length,Ae=document.createTextNode(te),c.map.push(c.pos,c.pos+d.length,Ae),u&&l<9&&(se=!0),c.pos+=d.length;else{Ae=document.createDocumentFragment();for(var Ie=0;;){oe.lastIndex=Ie;var Ze=oe.exec(d),$e=Ze?Ze.index-Ie:d.length-Ie;if($e){var at=document.createTextNode(te.slice(Ie,Ie+$e));u&&l<9?Ae.appendChild(W("span",[at])):Ae.appendChild(at),c.map.push(c.pos,c.pos+$e,at),c.col+=$e,c.pos+=$e}if(!Ze)break;Ie+=$e+1;var mt=void 0;if(Ze[0]==" "){var yt=c.cm.options.tabSize,bt=yt-c.col%yt;mt=Ae.appendChild(W("span",Ue(bt),"cm-tab")),mt.setAttribute("role","presentation"),mt.setAttribute("cm-text"," "),c.col+=bt}else Ze[0]=="\r"||Ze[0]==` +`?(mt=Ae.appendChild(W("span",Ze[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),mt.setAttribute("cm-text",Ze[0]),c.col+=1):(mt=c.cm.options.specialCharPlaceholder(Ze[0]),mt.setAttribute("cm-text",Ze[0]),u&&l<9?Ae.appendChild(W("span",[mt])):Ae.appendChild(mt),c.col+=1);c.map.push(c.pos,c.pos+1,mt),c.pos++}}if(c.trailingSpace=te.charCodeAt(d.length-1)==32,E||N||T||se||z||G){var At=E||"";N&&(At+=N),T&&(At+=T);var Dt=W("span",[Ae],At,z);if(G)for(var It in G)G.hasOwnProperty(It)&&It!="style"&&It!="class"&&Dt.setAttribute(It,G[It]);return c.content.appendChild(Dt)}c.content.appendChild(Ae)}}function bN(c,d){if(c.length>1&&!/ /.test(c))return c;for(var E=d,N="",T=0;Tse&&Ie.from<=se));Ze++);if(Ie.to>=Ae)return c(E,N,T,z,G,te,oe);c(E,N.slice(0,Ie.to-se),T,z,null,te,oe),z=null,N=N.slice(Ie.to-se),se=Ie.to}}}function pm(c,d,E,N){var T=!N&&E.widgetNode;T&&c.map.push(c.pos,c.pos+d,T),!N&&c.cm.display.input.needsContentAttribute&&(T||(T=c.content.appendChild(document.createElement("span"))),T.setAttribute("cm-marker",E.id)),T&&(c.cm.display.input.setUneditable(T),c.content.appendChild(T)),c.pos+=d,c.trailingSpace=!1}function Jd(c,d,E){var N=c.markedSpans,T=c.text,z=0;if(!N){for(var G=1;Goe||sr.collapsed&&Vt.to==oe&&Vt.from==oe)){if(Vt.to!=null&&Vt.to!=oe&&$e>Vt.to&&($e=Vt.to,mt=""),sr.className&&(at+=" "+sr.className),sr.css&&(Ze=(Ze?Ze+";":"")+sr.css),sr.startStyle&&Vt.from==oe&&(yt+=" "+sr.startStyle),sr.endStyle&&Vt.to==$e&&(It||(It=[])).push(sr.endStyle,Vt.to),sr.title&&((At||(At={})).title=sr.title),sr.attributes)for(var Yr in sr.attributes)(At||(At={}))[Yr]=sr.attributes[Yr];sr.collapsed&&(!bt||iu(bt.marker,sr)<0)&&(bt=Vt)}else Vt.from>oe&&$e>Vt.from&&($e=Vt.from)}if(It)for(var ai=0;ai=te)break;for(var Zn=Math.min(te,$e);;){if(Ae){var _i=oe+Ae.length;if(!bt){var Ln=_i>Zn?Ae.slice(0,Zn-oe):Ae;d.addToken(d,Ln,Ie?Ie+at:at,yt,oe+Ln.length==$e?mt:"",Ze,At)}if(_i>=Zn){Ae=Ae.slice(Zn-oe),oe=Zn;break}oe=_i,yt=""}Ae=T.slice(z,z=E[se++]),Ie=Xd(E[se++],d.cm.options)}}}function Qd(c,d,E){this.line=d,this.rest=xc(d),this.size=this.rest?ue(ge(this.rest))-E+1:1,this.node=this.text=null,this.hidden=Zi(c,d)}function Gl(c,d,E){for(var N=[],T,z=d;z2&&z.push((oe.bottom+se.top)/2-E.top)}}z.push(E.bottom-E.top)}}function ng(c,d,E){if(c.line==d)return{map:c.measure.map,cache:c.measure.cache};if(c.rest){for(var N=0;NE)return{map:c.measure.maps[T],cache:c.measure.caches[T],before:!0}}}function NN(c,d){d=sa(d);var E=ue(d),N=c.display.externalMeasured=new Qd(c.doc,d,E);N.lineN=E;var T=N.built=Kd(c,N);return N.text=T.pre,V(c.display.lineMeasure,T.pre),N}function F1(c,d,E,N){return To(c,Ku(c,d),E,N)}function vm(c,d){if(d>=c.display.viewFrom&&d=E.lineN&&dd)&&(z=oe-te,T=z-1,d>=oe&&(G="right")),T!=null){if(N=c[se+2],te==oe&&E==(N.insertLeft?"left":"right")&&(G=E),E=="left"&&T==0)for(;se&&c[se-2]==c[se-3]&&c[se-1].insertLeft;)N=c[(se-=3)+2],G="left";if(E=="right"&&T==oe-te)for(;se=0&&(E=c[T]).left==E.right;T--);return E}function L1(c,d,E,N){var T=k1(d.map,E,N),z=T.node,G=T.start,te=T.end,oe=T.collapse,se;if(z.nodeType==3){for(var Ae=0;Ae<4;Ae++){for(;G&&j(d.line.text.charAt(T.coverStart+G));)--G;for(;T.coverStart+te0&&(oe=N="right");var Ie;c.options.lineWrapping&&(Ie=z.getClientRects()).length>1?se=Ie[N=="right"?Ie.length-1:0]:se=z.getBoundingClientRect()}if(u&&l<9&&!G&&(!se||!se.left&&!se.right)){var Ze=z.parentNode.getClientRects()[0];Ze?se={left:Ze.left,right:Ze.left+xs(c.display),top:Ze.top,bottom:Ze.bottom}:se=_1}for(var $e=se.top-d.rect.top,at=se.bottom-d.rect.top,mt=($e+at)/2,yt=d.view.measure.heights,bt=0;bt=N.text.length?(oe=N.text.length,se="before"):oe<=0&&(oe=0,se="after"),!te)return G(se=="before"?oe-1:oe,se=="before");function Ae(at,mt,yt){var bt=te[mt],At=bt.level==1;return G(yt?at-1:at,At!=yt)}var Ie=Je(te,oe,se),Ze=_e,$e=Ae(oe,Ie,se=="before");return Ze!=null&&($e.other=Ae(oe,Ze,se!="before")),$e}function Ju(c,d){var E=0;d=Tt(c.doc,d),c.options.lineWrapping||(E=xs(c.display)*d.ch);var N=zt(c.doc,d.line),T=Uo(N)+Zl(c.display);return{left:E,right:E,top:T,bottom:T+N.height}}function Nc(c,d,E,N,T){var z=rt(c,d,E);return z.xRel=T,N&&(z.outside=N),z}function ig(c,d,E){var N=c.doc;if(E+=c.display.viewOffset,E<0)return Nc(N.first,0,null,-1,-1);var T=Me(N,E),z=N.first+N.size-1;if(T>z)return Nc(N.first+N.size-1,zt(N,z).text.length,null,1,1);d<0&&(d=0);for(var G=zt(N,T);;){var te=EN(c,G,T,d,E),oe=xN(G,te.ch+(te.xRel>0||te.outside>0?1:0));if(!oe)return te;var se=oe.find(1);if(se.line==T)return se;G=zt(N,T=se.line)}}function z1(c,d,E,N){N-=Bn(d);var T=d.text.length,z=me(function(G){return To(c,E,G-1).bottom<=N},T,0);return T=me(function(G){return To(c,E,G).top>N},z,T),{begin:z,end:T}}function U1(c,d,E,N){E||(E=Ku(c,d));var T=Dc(c,d,To(c,E,N),"line").top;return z1(c,d,E,T)}function og(c,d,E,N){return c.bottom<=E?!1:c.top>E?!0:(N?c.left:c.right)>d}function EN(c,d,E,N,T){T-=Uo(d);var z=Ku(c,d),G=Bn(d),te=0,oe=d.text.length,se=!0,Ae=Xe(d,c.doc.direction);if(Ae){var Ie=(c.options.lineWrapping?AN:Sc)(c,d,E,z,Ae,N,T);se=Ie.level!=1,te=se?Ie.from:Ie.to-1,oe=se?Ie.to:Ie.from-1}var Ze=null,$e=null,at=me(function(Yt){var Vt=To(c,z,Yt);return Vt.top+=G,Vt.bottom+=G,og(Vt,N,T,!1)?(Vt.top<=T&&Vt.left<=N&&(Ze=Yt,$e=Vt),!0):!1},te,oe),mt,yt,bt=!1;if($e){var At=N-$e.left<$e.right-N,Dt=At==se;at=Ze+(Dt?0:1),yt=Dt?"after":"before",mt=At?$e.left:$e.right}else{!se&&(at==oe||at==te)&&at++,yt=at==0?"after":at==d.text.length?"before":To(c,z,at-(se?1:0)).bottom+G<=T==se?"after":"before";var It=Ki(c,rt(E,at,yt),"line",d,z);mt=It.left,bt=T=It.bottom?1:0}return at=ne(d.text,at,1),Nc(E,at,yt,bt,N-mt)}function Sc(c,d,E,N,T,z,G){var te=me(function(Ie){var Ze=T[Ie],$e=Ze.level!=1;return og(Ki(c,rt(E,$e?Ze.to:Ze.from,$e?"before":"after"),"line",d,N),z,G,!0)},0,T.length-1),oe=T[te];if(te>0){var se=oe.level!=1,Ae=Ki(c,rt(E,se?oe.from:oe.to,se?"after":"before"),"line",d,N);og(Ae,z,G,!0)&&Ae.top>G&&(oe=T[te-1])}return oe}function AN(c,d,E,N,T,z,G){var te=z1(c,d,N,G),oe=te.begin,se=te.end;/\s/.test(d.text.charAt(se-1))&&se--;for(var Ae=null,Ie=null,Ze=0;Ze=se||$e.to<=oe)){var at=$e.level!=1,mt=To(c,N,at?Math.min(se,$e.to)-1:Math.max(oe,$e.from)).right,yt=mtyt)&&(Ae=$e,Ie=yt)}}return Ae||(Ae=T[T.length-1]),Ae.fromse&&(Ae={from:Ae.from,to:se,level:Ae.level}),Ae}var li;function la(c){if(c.cachedTextHeight!=null)return c.cachedTextHeight;if(li==null){li=W("pre",null,"CodeMirror-line-like");for(var d=0;d<49;++d)li.appendChild(document.createTextNode("x")),li.appendChild(W("br"));li.appendChild(document.createTextNode("x"))}V(c.measure,li);var E=li.offsetHeight/50;return E>3&&(c.cachedTextHeight=E),H(c.measure),E||1}function xs(c){if(c.cachedCharWidth!=null)return c.cachedCharWidth;var d=W("span","xxxxxxxxxx"),E=W("pre",[d],"CodeMirror-line-like");V(c.measure,E);var N=d.getBoundingClientRect(),T=(N.right-N.left)/10;return T>2&&(c.cachedCharWidth=T),T||10}function Xl(c){for(var d=c.display,E={},N={},T=d.gutters.clientLeft,z=d.gutters.firstChild,G=0;z;z=z.nextSibling,++G){var te=c.display.gutterSpecs[G].className;E[te]=z.offsetLeft+z.clientLeft+T,N[te]=z.clientWidth}return{fixedPos:Ec(d),gutterTotalWidth:d.gutters.offsetWidth,gutterLeft:E,gutterWidth:N,wrapperWidth:d.wrapper.clientWidth}}function Ec(c){return c.scroller.getBoundingClientRect().left-c.sizer.getBoundingClientRect().left}function Kl(c){var d=la(c.display),E=c.options.lineWrapping,N=E&&Math.max(5,c.display.scroller.clientWidth/xs(c.display)-3);return function(T){if(Zi(c.doc,T))return 0;var z=0;if(T.widgets)for(var G=0;G0&&(se=zt(c.doc,oe.line).text).length==oe.ch){var Ae=Oe(se,se.length,c.options.tabSize)-se.length;oe=rt(oe.line,Math.max(0,Math.round((z-lo(c.display).left)/xs(c.display))-Ae))}return oe}function Qu(c,d){if(d>=c.display.viewTo||(d-=c.display.viewFrom,d<0))return null;for(var E=c.display.view,N=0;Nd)&&(T.updateLineNumbers=d),c.curOp.viewChanged=!0,d>=T.viewTo)Co&&ou(c.doc,d)T.viewFrom?Pa(c):(T.viewFrom+=N,T.viewTo+=N);else if(d<=T.viewFrom&&E>=T.viewTo)Pa(c);else if(d<=T.viewFrom){var z=Jl(c,E,E+N,1);z?(T.view=T.view.slice(z.index),T.viewFrom=z.lineN,T.viewTo+=N):Pa(c)}else if(E>=T.viewTo){var G=Jl(c,d,d,-1);G?(T.view=T.view.slice(0,G.index),T.viewTo=G.lineN):Pa(c)}else{var te=Jl(c,d,d,-1),oe=Jl(c,E,E+N,1);te&&oe?(T.view=T.view.slice(0,te.index).concat(Gl(c,te.lineN,oe.lineN)).concat(T.view.slice(oe.index)),T.viewTo+=N):Pa(c)}var se=T.externalMeasured;se&&(E=T.lineN&&d=N.viewTo)){var z=N.view[Qu(c,d)];if(z.node!=null){var G=z.changes||(z.changes=[]);Ee(G,E)==-1&&G.push(E)}}}function Pa(c){c.display.viewFrom=c.display.viewTo=c.doc.first,c.display.view=[],c.display.viewOffset=0}function Jl(c,d,E,N){var T=Qu(c,d),z,G=c.display.view;if(!Co||E==c.doc.first+c.doc.size)return{index:T,lineN:E};for(var te=c.display.viewFrom,oe=0;oe0){if(T==G.length-1)return null;z=te+G[T].size-d,T++}else z=te-d;d+=z,E+=z}for(;ou(c.doc,E)!=E;){if(T==(N<0?0:G.length-1))return null;E+=N*G[T-(N<0?1:0)].size,T+=N}return{index:T,lineN:E}}function CN(c,d,E){var N=c.display,T=N.view;T.length==0||d>=N.viewTo||E<=N.viewFrom?(N.view=Gl(c,d,E),N.viewFrom=d):(N.viewFrom>d?N.view=Gl(c,d,N.viewFrom).concat(N.view):N.viewFromE&&(N.view=N.view.slice(0,Qu(c,E)))),N.viewTo=E}function ag(c){for(var d=c.display.view,E=0,N=0;N=c.display.viewTo||oe.to().line0?G:c.defaultCharWidth())+"px"}if(N.other){var te=E.appendChild(W("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));te.style.display="",te.style.left=N.other.left+"px",te.style.top=N.other.top+"px",te.style.height=(N.other.bottom-N.other.top)*.85+"px"}}function Ql(c,d){return c.top-d.top||c.left-d.left}function sg(c,d,E){var N=c.display,T=c.doc,z=document.createDocumentFragment(),G=lo(c.display),te=G.left,oe=Math.max(N.sizerWidth,uu(c)-N.sizer.offsetLeft)-G.right,se=T.direction=="ltr";function Ae(Dt,It,Yt,Vt){It<0&&(It=0),It=Math.round(It),Vt=Math.round(Vt),z.appendChild(W("div",null,"CodeMirror-selected","position: absolute; left: "+Dt+`px; top: `+It+"px; width: "+(Yt??oe-Dt)+`px; - height: `+(Vt-It)+"px"))}function Ie(Dt,It,Yt){var Vt=zt(T,Dt),sr=Vt.text.length,Yr,ai;function dn(Ln,ji){return xm(c,rt(Dt,Ln),"div",Vt,ji)}function Zn(Ln,ji,mi){var Xn=U1(c,Vt,null,Ln),Pn=ji=="ltr"==(mi=="after")?"left":"right",vn=mi=="after"?Xn.begin:Xn.end-(/\s/.test(Vt.text.charAt(Xn.end-1))?2:1);return dn(vn,Pn)[Pn]}var _i=Xe(Vt,T.direction);return xe(_i,It||0,Yt??sr,function(Ln,ji,mi,Xn){var Pn=mi=="ltr",vn=dn(Ln,Pn?"left":"right"),hi=dn(ji-1,Pn?"right":"left"),gf=It==null&&Ln==0,vu=Yt==null&&ji==sr,Di=Xn==0,Ra=!_i||Xn==_i.length-1;if(hi.top-vn.top<=3){var si=(se?gf:vu)&&Di,ep=(se?vu:gf)&&Ra,Cs=si?te:(Pn?vn:hi).left,yu=ep?oe:(Pn?hi:vn).right;Ae(Cs,vn.top,yu-Cs,vn.bottom)}else{var fl,ki,vf,tp;Pn?(fl=se&&gf&&Di?te:vn.left,ki=se?oe:Zn(Ln,mi,"before"),vf=se?te:Zn(ji,mi,"after"),tp=se&&vu&&Ra?oe:hi.right):(fl=se?Zn(Ln,mi,"before"):te,ki=!se&&gf&&Di?oe:vn.right,vf=!se&&vu&&Ra?te:hi.left,tp=se?Zn(ji,mi,"after"):oe),Ae(fl,vn.top,ki-fl,vn.bottom),vn.bottom0?d.blinker=setInterval(function(){c.hasFocus()||ju(c),d.cursorDiv.style.visibility=(S=!S)?"":"hidden"},c.options.cursorBlinkRate):c.options.cursorBlinkRate<0&&(d.cursorDiv.style.visibility="hidden")}}function lg(c){c.hasFocus()||(c.display.input.focus(),c.state.focused||Dm(c))}function Ql(c){c.state.delayingBlurEvent=!0,setTimeout(function(){c.state.delayingBlurEvent&&(c.state.delayingBlurEvent=!1,c.state.focused&&ju(c))},100)}function Dm(c,d){c.state.delayingBlurEvent&&!c.state.draggingText&&(c.state.delayingBlurEvent=!1),c.options.readOnly!="nocursor"&&(c.state.focused||(je(c,"focus",c,d),c.state.focused=!0,le(c.display.wrapper,"CodeMirror-focused"),!c.curOp&&c.display.selForContextMenu!=c.doc.sel&&(c.display.input.reset(),a&&setTimeout(function(){return c.display.input.reset(!0)},20)),c.display.input.receivedFocus()),Cc(c))}function ju(c,d){c.state.delayingBlurEvent||(c.state.focused&&(je(c,"blur",c,d),c.state.focused=!1,U(c.display.wrapper,"CodeMirror-focused")),clearInterval(c.display.blinker),setTimeout(function(){c.state.focused||(c.display.shift=!1)},150))}function Nm(c){for(var d=c.display,S=d.lineDiv.offsetTop,N=Math.max(0,d.scroller.getBoundingClientRect().top),T=d.lineDiv.getBoundingClientRect().top,z=0,G=0;G.005||$e<-.005)&&(Tc.display.sizerWidth){var mt=Math.ceil(Ae/xs(c.display));mt>c.display.maxLineLength&&(c.display.maxLineLength=mt,c.display.maxLine=te.line,c.display.maxLineChanged=!0)}}}Math.abs(z)>2&&(d.scroller.scrollTop+=z)}function fg(c){if(c.widgets)for(var d=0;d=G&&(z=Me(d,Uo(zt(d,oe))-c.wrapper.clientHeight),G=oe)}return{from:z,to:Math.max(G,z+1)}}function MN(c,d){if(!wt(c,"scrollCursorIntoView")){var S=c.display,N=S.sizer.getBoundingClientRect(),T=null,z=S.wrapper.ownerDocument;if(d.top+N.top<0?T=!0:d.bottom+N.top>(z.defaultView.innerHeight||z.documentElement.clientHeight)&&(T=!1),T!=null&&!w){var G=W("div","\u200B",null,`position: absolute; - top: `+(d.top-S.viewOffset-Yl(c.display))+`px; - height: `+(d.bottom-d.top+ua(c)+S.barHeight)+`px; - left: `+d.left+"px; width: "+Math.max(2,d.right-d.left)+"px;");c.display.lineSpace.appendChild(G),G.scrollIntoView(T),c.display.lineSpace.removeChild(G)}}}function $1(c,d,S,N){N==null&&(N=0);var T;!c.options.lineWrapping&&d==S&&(S=d.sticky=="before"?rt(d.line,d.ch+1,"before"):d,d=d.ch?rt(d.line,d.sticky=="before"?d.ch-1:d.ch,"after"):d);for(var z=0;z<5;z++){var G=!1,te=Ki(c,d),oe=!S||S==d?te:Ki(c,S);T={left:Math.min(te.left,oe.left),top:Math.min(te.top,oe.top)-N,right:Math.max(te.left,oe.left),bottom:Math.max(te.bottom,oe.bottom)+N};var se=cg(c,T),Ae=c.doc.scrollTop,Ie=c.doc.scrollLeft;if(se.scrollTop!=null&&(bs(c,se.scrollTop),Math.abs(c.doc.scrollTop-Ae)>1&&(G=!0)),se.scrollLeft!=null&&(el(c,se.scrollLeft),Math.abs(c.doc.scrollLeft-Ie)>1&&(G=!0)),!G)break}return T}function TN(c,d){var S=cg(c,d);S.scrollTop!=null&&bs(c,S.scrollTop),S.scrollLeft!=null&&el(c,S.scrollLeft)}function cg(c,d){var S=c.display,N=la(c.display);d.top<0&&(d.top=0);var T=c.curOp&&c.curOp.scrollTop!=null?c.curOp.scrollTop:S.scroller.scrollTop,z=gm(c),G={};d.bottom-d.top>z&&(d.bottom=d.top+z);var te=c.doc.height+wc(S),oe=d.topte-N;if(d.topT+z){var Ae=Math.min(d.top,(se?te:d.bottom)-z);Ae!=T&&(G.scrollTop=Ae)}var Ie=c.options.fixedGutter?0:S.gutters.offsetWidth,Ze=c.curOp&&c.curOp.scrollLeft!=null?c.curOp.scrollLeft:S.scroller.scrollLeft-Ie,$e=lu(c)-S.gutters.offsetWidth,at=d.right-d.left>$e;return at&&(d.right=d.left+$e),d.left<10?G.scrollLeft=0:d.left$e+Ze-3&&(G.scrollLeft=d.right+(at?0:10)-$e),G}function Em(c,d){d!=null&&(ef(c),c.curOp.scrollTop=(c.curOp.scrollTop==null?c.doc.scrollTop:c.curOp.scrollTop)+d)}function jl(c){ef(c);var d=c.getCursor();c.curOp.scrollToPos={from:d,to:d,margin:c.options.cursorScrollMargin}}function Mc(c,d,S){(d!=null||S!=null)&&ef(c),d!=null&&(c.curOp.scrollLeft=d),S!=null&&(c.curOp.scrollTop=S)}function ON(c,d){ef(c),c.curOp.scrollToPos=d}function ef(c){var d=c.curOp.scrollToPos;if(d){c.curOp.scrollToPos=null;var S=Ju(c,d.from),N=Ju(c,d.to);pg(c,S,N,d.margin)}}function pg(c,d,S,N){var T=cg(c,{left:Math.min(d.left,S.left),top:Math.min(d.top,S.top)-N,right:Math.max(d.right,S.right),bottom:Math.max(d.bottom,S.bottom)+N});Mc(c,T.scrollLeft,T.scrollTop)}function bs(c,d){Math.abs(c.doc.scrollTop-d)<2||(r||Sm(c,{top:d}),fu(c,d,!0),r&&Sm(c),Ic(c,100))}function fu(c,d,S){d=Math.max(0,Math.min(c.display.scroller.scrollHeight-c.display.scroller.clientHeight,d)),!(c.display.scroller.scrollTop==d&&!S)&&(c.doc.scrollTop=d,c.display.scrollbars.setScrollTop(d),c.display.scroller.scrollTop!=d&&(c.display.scroller.scrollTop=d))}function el(c,d,S,N){d=Math.max(0,Math.min(d,c.display.scroller.scrollWidth-c.display.scroller.clientWidth)),!((S?d==c.doc.scrollLeft:Math.abs(c.doc.scrollLeft-d)<2)&&!N)&&(c.doc.scrollLeft=d,vg(c),c.display.scroller.scrollLeft!=d&&(c.display.scroller.scrollLeft=d),c.display.scrollbars.setScrollLeft(d))}function Tc(c){var d=c.display,S=d.gutters.offsetWidth,N=Math.round(c.doc.height+wc(c.display));return{clientHeight:d.scroller.clientHeight,viewHeight:d.wrapper.clientHeight,scrollWidth:d.scroller.scrollWidth,clientWidth:d.scroller.clientWidth,viewWidth:d.wrapper.clientWidth,barLeft:c.options.fixedGutter?S:0,docHeight:N,scrollHeight:N+ua(c)+d.barHeight,nativeBarWidth:d.nativeBarWidth,gutterWidth:S}}var tl=function(c,d,S){this.cm=S;var N=this.vert=W("div",[W("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),T=this.horiz=W("div",[W("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");N.tabIndex=T.tabIndex=-1,c(N),c(T),X(N,"scroll",function(){N.clientHeight&&d(N.scrollTop,"vertical")}),X(T,"scroll",function(){T.clientWidth&&d(T.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,u&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};tl.prototype.update=function(c){var d=c.scrollWidth>c.clientWidth+1,S=c.scrollHeight>c.clientHeight+1,N=c.nativeBarWidth;if(S){this.vert.style.display="block",this.vert.style.bottom=d?N+"px":"0";var T=c.viewHeight-(d?N:0);this.vert.firstChild.style.height=Math.max(0,c.scrollHeight-c.clientHeight+T)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(d){this.horiz.style.display="block",this.horiz.style.right=S?N+"px":"0",this.horiz.style.left=c.barLeft+"px";var z=c.viewWidth-c.barLeft-(S?N:0);this.horiz.firstChild.style.width=Math.max(0,c.scrollWidth-c.clientWidth+z)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&c.clientHeight>0&&(N==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:S?N:0,bottom:d?N:0}},tl.prototype.setScrollLeft=function(c){this.horiz.scrollLeft!=c&&(this.horiz.scrollLeft=c),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},tl.prototype.setScrollTop=function(c){this.vert.scrollTop!=c&&(this.vert.scrollTop=c),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},tl.prototype.zeroWidthHack=function(){var c=M&&!b?"12px":"18px";this.horiz.style.height=this.vert.style.width=c,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new He,this.disableVert=new He},tl.prototype.enableZeroWidthBar=function(c,d,S){c.style.visibility="";function N(){var T=c.getBoundingClientRect(),z=S=="vert"?document.elementFromPoint(T.right-1,(T.top+T.bottom)/2):document.elementFromPoint((T.right+T.left)/2,T.bottom-1);z!=c?c.style.visibility="hidden":d.set(1e3,N)}d.set(1e3,N)},tl.prototype.clear=function(){var c=this.horiz.parentNode;c.removeChild(this.horiz),c.removeChild(this.vert)};var fi=function(){};fi.prototype.update=function(){return{bottom:0,right:0}},fi.prototype.setScrollLeft=function(){},fi.prototype.setScrollTop=function(){},fi.prototype.clear=function(){};function cu(c,d){d||(d=Tc(c));var S=c.display.barWidth,N=c.display.barHeight;mg(c,d);for(var T=0;T<4&&S!=c.display.barWidth||N!=c.display.barHeight;T++)S!=c.display.barWidth&&c.options.lineWrapping&&Nm(c),mg(c,Tc(c)),S=c.display.barWidth,N=c.display.barHeight}function mg(c,d){var S=c.display,N=S.scrollbars.update(d);S.sizer.style.paddingRight=(S.barWidth=N.right)+"px",S.sizer.style.paddingBottom=(S.barHeight=N.bottom)+"px",S.heightForcer.style.borderBottom=N.bottom+"px solid transparent",N.right&&N.bottom?(S.scrollbarFiller.style.display="block",S.scrollbarFiller.style.height=N.bottom+"px",S.scrollbarFiller.style.width=N.right+"px"):S.scrollbarFiller.style.display="",N.bottom&&c.options.coverGutterNextToScrollbar&&c.options.fixedGutter?(S.gutterFiller.style.display="block",S.gutterFiller.style.height=N.bottom+"px",S.gutterFiller.style.width=d.gutterWidth+"px"):S.gutterFiller.style.display=""}var W1={native:tl,null:fi};function V1(c){c.display.scrollbars&&(c.display.scrollbars.clear(),c.display.scrollbars.addClass&&U(c.display.wrapper,c.display.scrollbars.addClass)),c.display.scrollbars=new W1[c.options.scrollbarStyle](function(d){c.display.wrapper.insertBefore(d,c.display.scrollbarFiller),X(d,"mousedown",function(){c.state.focused&&setTimeout(function(){return c.display.input.focus()},0)}),d.setAttribute("cm-not-content","true")},function(d,S){S=="horizontal"?el(c,d):bs(c,d)},c),c.display.scrollbars.addClass&&le(c.display.wrapper,c.display.scrollbars.addClass)}var IN=0;function rl(c){c.curOp={cm:c,viewChanged:!1,startHeight:c.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++IN,markArrays:null},M1(c.curOp)}function Ds(c){var d=c.curOp;d&&mm(d,function(S){for(var N=0;N=S.viewTo)||S.maxLineChanged&&d.options.lineWrapping,c.update=c.mustUpdate&&new Fc(d,c.mustUpdate&&{top:c.scrollTop,ensure:c.scrollToPos},c.forceUpdate)}function tf(c){c.updatedDisplay=c.mustUpdate&&dg(c.cm,c.update)}function FN(c){var d=c.cm,S=d.display;c.updatedDisplay&&Nm(d),c.barMeasure=Tc(d),S.maxLineChanged&&!d.options.lineWrapping&&(c.adjustWidthTo=F1(d,S.maxLine,S.maxLine.text.length).left+3,d.display.sizerWidth=c.adjustWidthTo,c.barMeasure.scrollWidth=Math.max(S.scroller.clientWidth,S.sizer.offsetLeft+c.adjustWidthTo+ua(d)+d.display.barWidth),c.maxScrollLeft=Math.max(0,S.sizer.offsetLeft+c.adjustWidthTo-lu(d))),(c.updatedDisplay||c.selectionChanged)&&(c.preparedSelection=S.input.prepareSelection())}function nl(c){var d=c.cm;c.adjustWidthTo!=null&&(d.display.sizer.style.minWidth=c.adjustWidthTo+"px",c.maxScrollLeft=c.display.viewTo)){var S=+new Date+c.options.workTime,N=jr(c,d.highlightFrontier),T=[];d.iter(N.line,Math.min(d.first+d.size,c.display.viewTo+500),function(z){if(N.line>=c.display.viewFrom){var G=z.styles,te=z.text.length>c.options.maxHighlightLength?Or(d.mode,N.state):null,oe=ds(c,z,N,!0);te&&(N.state=te),z.styles=oe.styles;var se=z.styleClasses,Ae=oe.classes;Ae?z.styleClasses=Ae:se&&(z.styleClasses=null);for(var Ie=!G||G.length!=z.styles.length||se!=Ae&&(!se||!Ae||se.bgClass!=Ae.bgClass||se.textClass!=Ae.textClass),Ze=0;!Ie&&ZeS)return Ic(c,c.options.workDelay),!0}),d.highlightFrontier=N.line,d.modeFrontier=Math.max(d.modeFrontier,N.line),T.length&&bi(c,function(){for(var z=0;z=S.viewFrom&&d.visible.to<=S.viewTo&&(S.updateLineNumbers==null||S.updateLineNumbers>=S.viewTo)&&S.renderedView==S.view&&sg(c)==0)return!1;K1(c)&&(Pa(c),d.dims=Zl(c));var T=N.first+N.size,z=Math.max(d.visible.from-c.options.viewportMargin,N.first),G=Math.min(T,d.visible.to+c.options.viewportMargin);S.viewFromG&&S.viewTo-G<20&&(G=Math.min(T,S.viewTo)),Co&&(z=au(c.doc,z),G=E1(c.doc,G));var te=z!=S.viewFrom||G!=S.viewTo||S.lastWrapHeight!=d.wrapperHeight||S.lastWrapWidth!=d.wrapperWidth;CN(c,z,G),S.viewOffset=Uo(zt(c.doc,S.viewFrom)),c.display.mover.style.top=S.viewOffset+"px";var oe=sg(c);if(!te&&oe==0&&!d.force&&S.renderedView==S.view&&(S.updateLineNumbers==null||S.updateLineNumbers>=S.viewTo))return!1;var se=_N(c);return oe>4&&(S.lineDiv.style.display="none"),kN(c,S.updateLineNumbers,d.dims),oe>4&&(S.lineDiv.style.display=""),S.renderedView=S.view,Z1(se),H(S.cursorDiv),H(S.selectionDiv),S.gutters.style.height=S.sizer.style.minHeight=0,te&&(S.lastWrapHeight=d.wrapperHeight,S.lastWrapWidth=d.wrapperWidth,Ic(c,400)),S.updateLineNumbers=null,!0}function X1(c,d){for(var S=d.viewport,N=!0;;N=!1){if(!N||!c.options.lineWrapping||d.oldDisplayWidth==lu(c)){if(S&&S.top!=null&&(S={top:Math.min(c.doc.height+wc(c.display)-gm(c),S.top)}),d.visible=Ir(c.display,c.doc,S),d.visible.from>=c.display.viewFrom&&d.visible.to<=c.display.viewTo)break}else N&&(d.visible=Ir(c.display,c.doc,S));if(!dg(c,d))break;Nm(c);var T=Tc(c);Ac(c),cu(c,T),Am(c,T),d.force=!1}d.signal(c,"update",c),(c.display.viewFrom!=c.display.reportedViewFrom||c.display.viewTo!=c.display.reportedViewTo)&&(d.signal(c,"viewportChange",c,c.display.viewFrom,c.display.viewTo),c.display.reportedViewFrom=c.display.viewFrom,c.display.reportedViewTo=c.display.viewTo)}function Sm(c,d){var S=new Fc(c,d);if(dg(c,S)){Nm(c),X1(c,S);var N=Tc(c);Ac(c),cu(c,N),Am(c,N),S.finish()}}function kN(c,d,S){var N=c.display,T=c.options.lineNumbers,z=N.lineDiv,G=z.firstChild;function te(at){var mt=at.nextSibling;return a&&M&&c.display.currentWheelTarget==at?at.style.display="none":at.parentNode.removeChild(at),mt}for(var oe=N.view,se=N.viewFrom,Ae=0;Ae-1&&($e=!1),hm(c,Ie,se,S)),$e&&(H(Ie.lineNumber),Ie.lineNumber.appendChild(document.createTextNode(dt(c.options,se)))),G=Ie.node.nextSibling}se+=Ie.size}for(;G;)G=te(G)}function gg(c){var d=c.gutters.offsetWidth;c.sizer.style.marginLeft=d+"px",Wn(c,"gutterChanged",c)}function Am(c,d){c.display.sizer.style.minHeight=d.docHeight+"px",c.display.heightForcer.style.top=d.docHeight+"px",c.display.gutters.style.height=d.docHeight+c.display.barHeight+ua(c)+"px"}function vg(c){var d=c.display,S=d.view;if(!(!d.alignWidgets&&(!d.gutters.firstChild||!c.options.fixedGutter))){for(var N=Sc(d)-d.scroller.scrollLeft+c.doc.scrollLeft,T=d.gutters.offsetWidth,z=N+"px",G=0;G=105&&(T.wrapper.style.clipPath="inset(0px)"),T.wrapper.setAttribute("translate","no"),u&&l<8&&(T.gutters.style.zIndex=-1,T.scroller.style.paddingRight=0),!a&&!(r&&O)&&(T.scroller.draggable=!0),c&&(c.appendChild?c.appendChild(T.wrapper):c(T.wrapper)),T.viewFrom=T.viewTo=d.first,T.reportedViewFrom=T.reportedViewTo=d.first,T.view=[],T.renderedView=null,T.externalMeasured=null,T.viewOffset=0,T.lastWrapHeight=T.lastWrapWidth=0,T.updateLineNumbers=null,T.nativeBarWidth=T.barHeight=T.barWidth=0,T.scrollbarsClipped=!1,T.lineNumWidth=T.lineNumInnerWidth=T.lineNumChars=null,T.alignWidgets=!1,T.cachedCharWidth=T.cachedTextHeight=T.cachedPaddingH=null,T.maxLine=null,T.maxLineLength=0,T.maxLineChanged=!1,T.wheelDX=T.wheelDY=T.wheelStartX=T.wheelStartY=null,T.shift=!1,T.selForContextMenu=null,T.activeTouch=null,T.gutterSpecs=yg(N.gutters,N.lineNumbers),xg(T),S.init(T)}var kc=0,Ns=null;u?Ns=-.53:r?Ns=15:f?Ns=-.7:x&&(Ns=-1/3);function wg(c){var d=c.wheelDeltaX,S=c.wheelDeltaY;return d==null&&c.detail&&c.axis==c.HORIZONTAL_AXIS&&(d=c.detail),S==null&&c.detail&&c.axis==c.VERTICAL_AXIS?S=c.detail:S==null&&(S=c.wheelDelta),{x:d,y:S}}function LN(c){var d=wg(c);return d.x*=Ns,d.y*=Ns,d}function J1(c,d){f&&p==102&&(c.display.chromeScrollHack==null?c.display.sizer.style.pointerEvents="none":clearTimeout(c.display.chromeScrollHack),c.display.chromeScrollHack=setTimeout(function(){c.display.chromeScrollHack=null,c.display.sizer.style.pointerEvents=""},100));var S=wg(d),N=S.x,T=S.y,z=Ns;d.deltaMode===0&&(N=d.deltaX,T=d.deltaY,z=1);var G=c.display,te=G.scroller,oe=te.scrollWidth>te.clientWidth,se=te.scrollHeight>te.clientHeight;if(N&&oe||T&&se){if(T&&M&&a){e:for(var Ae=d.target,Ie=G.view;Ae!=te;Ae=Ae.parentNode)for(var Ze=0;Ze=0&&ke(c,N.to())<=0)return S}return-1};var Br=function(c,d){this.anchor=c,this.head=d};Br.prototype.from=function(){return iu(this.anchor,this.head)},Br.prototype.to=function(){return wi(this.anchor,this.head)},Br.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ho(c,d,S){var N=c&&c.options.selectionsMayTouch,T=d[S];d.sort(function(Ze,$e){return ke(Ze.from(),$e.from())}),S=Se(d,T);for(var z=1;z0:oe>=0){var se=iu(te.from(),G.from()),Ae=wi(te.to(),G.to()),Ie=te.empty()?G.from()==G.head:te.from()==te.head;z<=S&&--S,d.splice(--z,2,new Br(Ie?Ae:se,Ie?se:Ae))}}return new Oo(d,S)}function pu(c,d){return new Oo([new Br(c,d||c)],0)}function mu(c){return c.text?rt(c.from.line+c.text.length-1,ge(c.text).length+(c.text.length==1?c.from.ch:0)):c.to}function il(c,d){if(ke(c,d.from)<0)return c;if(ke(c,d.to)<=0)return mu(d);var S=c.line+d.text.length-(d.to.line-d.from.line)-1,N=c.ch;return c.line==d.to.line&&(N+=mu(d).ch-d.to.ch),rt(S,N)}function Bc(c,d){for(var S=[],N=0;N1&&c.remove(te.line+1,at-1),c.insert(te.line+1,bt)}Wn(c,"change",c,d)}function Yn(c,d,S){function N(T,z,G){if(T.linked)for(var te=0;te1&&!c.done[c.done.length-2].ranges)return c.done.pop(),ge(c.done)}function ey(c,d,S,N){var T=c.history;T.undone.length=0;var z=+new Date,G,te;if((T.lastOp==N||T.lastOrigin==d.origin&&d.origin&&(d.origin.charAt(0)=="+"&&T.lastModTime>z-(c.cm?c.cm.options.historyEventDelay:500)||d.origin.charAt(0)=="*"))&&(G=Tm(T,T.lastOp==N)))te=ge(G.changes),ke(d.from,d.to)==0&&ke(d.from,te.to)==0?te.to=mu(d):G.changes.push(ol(c,d));else{var oe=ge(T.done);for((!oe||!oe.ranges)&&Rc(c.sel,T.done),G={changes:[ol(c,d)],generation:T.generation},T.done.push(G);T.done.length>T.undoDepth;)T.done.shift(),T.done[0].ranges||T.done.shift()}T.done.push(S),T.generation=++T.maxGeneration,T.lastModTime=T.lastSelTime=z,T.lastOp=T.lastSelOp=N,T.lastOrigin=T.lastSelOrigin=d.origin,te||je(c,"historyAdded")}function RN(c,d,S,N){var T=d.charAt(0);return T=="*"||T=="+"&&S.ranges.length==N.ranges.length&&S.somethingSelected()==N.somethingSelected()&&new Date-c.history.lastSelTime<=(c.cm?c.cm.options.historyEventDelay:500)}function qN(c,d,S,N){var T=c.history,z=N&&N.origin;S==T.lastSelOp||z&&T.lastSelOrigin==z&&(T.lastModTime==T.lastSelTime&&T.lastOrigin==z||RN(c,z,ge(T.done),d))?T.done[T.done.length-1]=d:Rc(d,T.done),T.lastSelTime=+new Date,T.lastSelOrigin=z,T.lastSelOp=S,N&&N.clearRedo!==!1&&nf(T.undone)}function Rc(c,d){var S=ge(d);S&&S.ranges&&S.equals(c)||d.push(c)}function Dg(c,d,S,N){var T=d["spans_"+c.id],z=0;c.iter(Math.max(c.first,S),Math.min(c.first+c.size,N),function(G){G.markedSpans&&((T||(T=d["spans_"+c.id]={}))[z]=G.markedSpans),++z})}function zN(c){if(!c)return null;for(var d,S=0;S-1&&(ge(te)[Ie]=se[Ie],delete se[Ie])}}return N}function Ng(c,d,S,N){if(N){var T=c.anchor;if(S){var z=ke(d,T)<0;z!=ke(S,T)<0?(T=d,d=S):z!=ke(d,S)<0&&(d=S)}return new Br(T,d)}else return new Br(S||d,d)}function Om(c,d,S,N,T){T==null&&(T=c.cm&&(c.cm.display.shift||c.extend)),ci(c,new Oo([Ng(c.sel.primary(),d,S,T)],0),N)}function Eg(c,d,S){for(var N=[],T=c.cm&&(c.cm.display.shift||c.extend),z=0;z=d.ch:te.to>d.ch))){if(T&&(je(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(z.markedSpans){--G;continue}else break;if(!oe.atomic)continue;if(S){var Ie=oe.find(N<0?1:-1),Ze=void 0;if((N<0?Ae:se)&&(Ie=qc(c,Ie,-N,Ie&&Ie.line==d.line?z:null)),Ie&&Ie.line==d.line&&(Ze=ke(Ie,S))&&(N<0?Ze<0:Ze>0))return af(c,Ie,d,N,T)}var $e=oe.find(N<0?-1:1);return(N<0?se:Ae)&&($e=qc(c,$e,N,$e.line==d.line?z:null)),$e?af(c,$e,d,N,T):null}}return d}function Im(c,d,S,N,T){var z=N||1,G=af(c,d,S,z,T)||!T&&af(c,d,S,z,!0)||af(c,d,S,-z,T)||!T&&af(c,d,S,-z,!0);return G||(c.cantEdit=!0,rt(c.first,0))}function qc(c,d,S,N){return S<0&&d.ch==0?d.line>c.first?Tt(c,rt(d.line-1)):null:S>0&&d.ch==(N||zt(c,d.line)).text.length?d.line=0;--T)Og(c,{from:N[T].from,to:N[T].to,text:T?[""]:d.text,origin:d.origin});else Og(c,d)}}function Og(c,d){if(!(d.text.length==1&&d.text[0]==""&&ke(d.from,d.to)==0)){var S=Bc(c,d);ey(c,d,S,c.cm?c.cm.curOp.id:NaN),al(c,d,S,Ht(c,d));var N=[];Yn(c,function(T,z){!z&&Se(N,T.history)==-1&&(Ig(T.history,d),N.push(T.history)),al(T,d,null,Ht(T,d))})}}function zc(c,d,S){var N=c.cm&&c.cm.state.suppressEdits;if(!(N&&!S)){for(var T=c.history,z,G=c.sel,te=d=="undo"?T.done:T.undone,oe=d=="undo"?T.undone:T.done,se=0;se=0;--$e){var at=Ze($e);if(at)return at.v}}}}function Uc(c,d){if(d!=0&&(c.first+=d,c.sel=new Oo(Re(c.sel.ranges,function(T){return new Br(rt(T.anchor.line+d,T.anchor.ch),rt(T.head.line+d,T.head.ch))}),c.sel.primIndex),c.cm)){Ji(c.cm,c.first,c.first-d,d);for(var S=c.cm.display,N=S.viewFrom;Nc.lastLine())){if(d.from.linez&&(d={from:d.from,to:rt(z,zt(c,z).text.length),text:[d.text[0]],origin:d.origin}),d.removed=oa(c,d.from,d.to),S||(S=Bc(c,d)),c.cm?HN(c.cm,d,N):bg(c,d,N),gu(c,S,Le),c.cantEdit&&Im(c,rt(c.firstLine(),0))&&(c.cantEdit=!1)}}function HN(c,d,S){var N=c.doc,T=c.display,z=d.from,G=d.to,te=!1,oe=z.line;c.options.lineWrapping||(oe=ue(sa(zt(N,z.line))),N.iter(oe,G.line+1,function($e){if($e==T.maxLine)return te=!0,!0})),N.sel.contains(d.from,d.to)>-1&&Bt(c),bg(N,d,S,Xl(c)),c.options.lineWrapping||(N.iter(oe,z.line+d.text.length,function($e){var at=cm($e);at>T.maxLineLength&&(T.maxLine=$e,T.maxLineLength=at,T.maxLineChanged=!0,te=!1)}),te&&(c.curOp.updateMaxLine=!0)),um(N,z.line),Ic(c,400);var se=d.text.length-(G.line-z.line)-1;d.full?Ji(c):z.line==G.line&&d.text.length==1&&!Q1(c.doc,d)?ws(c,z.line,"text"):Ji(c,z.line,G.line+1,se);var Ae=fr(c,"changes"),Ie=fr(c,"change");if(Ie||Ae){var Ze={from:z,to:G,text:d.text,removed:d.removed,origin:d.origin};Ie&&Wn(c,"change",c,Ze),Ae&&(c.curOp.changeObjs||(c.curOp.changeObjs=[])).push(Ze)}c.display.selForContextMenu=null}function $o(c,d,S,N,T){var z;N||(N=S),ke(N,S)<0&&(z=[N,S],S=z[0],N=z[1]),typeof d=="string"&&(d=c.splitLines(d)),Es(c,{from:S,to:N,text:d,origin:T})}function oy(c,d,S,N){S1||!(this.children[0]instanceof sf))){var te=[];this.collapse(te),this.children=[new sf(te)],this.children[0].parent=this}},collapse:function(c){for(var d=0;d50){for(var G=T.lines.length%25+25,te=G;te10);c.parent.maybeSpill()}},iterN:function(c,d,S){for(var N=0;Nc.display.maxLineLength&&(c.display.maxLine=se,c.display.maxLineLength=Ae,c.display.maxLineChanged=!0)}N!=null&&c&&this.collapsed&&Ji(c,N,T+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,c&&ny(c.doc)),c&&Wn(c,"markerCleared",c,this,N,T),d&&Ds(c),this.parent&&this.parent.clear()}},Io.prototype.find=function(c,d){c==null&&this.type=="bookmark"&&(c=1);for(var S,N,T=0;T0||G==0&&z.clearWhenEmpty!==!1)return z;if(z.replacedWith&&(z.collapsed=!0,z.widgetNode=ee("span",[z.replacedWith],"CodeMirror-widget"),N.handleMouseEvents||z.widgetNode.setAttribute("cm-ignore-events","true"),N.insertLeft&&(z.widgetNode.insertLeft=!0)),z.collapsed){if(N1(c,d.line,d,S,z)||d.line!=S.line&&N1(c,S.line,d,S,z))throw new Error("Inserting collapsed marker partially overlapping an existing one");Vu()}z.addToHistory&&ey(c,{from:d,to:S,origin:"markText"},c.sel,NaN);var te=d.line,oe=c.cm,se;if(c.iter(te,S.line+1,function(Ie){oe&&z.collapsed&&!oe.options.lineWrapping&&sa(Ie)==oe.display.maxLine&&(se=!0),z.collapsed&&te!=d.line&&$n(Ie,0),tn(Ie,new dc(z,te==d.line?d.ch:null,te==S.line?S.ch:null),c.cm&&c.cm.curOp),++te}),z.collapsed&&c.iter(d.line,S.line+1,function(Ie){Zi(c,Ie)&&$n(Ie,0)}),z.clearOnEnter&&X(z,"beforeCursorEnter",function(){return z.clear()}),z.readOnly&&(vN(),(c.history.done.length||c.history.undone.length)&&c.clearHistory()),z.collapsed&&(z.id=++Fm,z.atomic=!0),oe){if(se&&(oe.curOp.updateMaxLine=!0),z.collapsed)Ji(oe,d.line,S.line+1);else if(z.className||z.startStyle||z.endStyle||z.css||z.attributes||z.title)for(var Ae=d.line;Ae<=S.line;Ae++)ws(oe,Ae,"text");z.atomic&&ny(oe.doc),Wn(oe,"markerAdded",oe,z)}return z}var Ss=function(c,d){this.markers=c,this.primary=d;for(var S=0;S=0;oe--)Es(this,N[oe]);te?Cg(this,te):this.cm&&jl(this.cm)}),undo:Gn(function(){zc(this,"undo")}),redo:Gn(function(){zc(this,"redo")}),undoSelection:Gn(function(){zc(this,"undo",!0)}),redoSelection:Gn(function(){zc(this,"redo",!0)}),setExtending:function(c){this.extend=c},getExtending:function(){return this.extend},historySize:function(){for(var c=this.history,d=0,S=0,N=0;N=c.ch)&&d.push(T.marker.parent||T.marker)}return d},findMarks:function(c,d,S){c=Tt(this,c),d=Tt(this,d);var N=[],T=c.line;return this.iter(c.line,d.line+1,function(z){var G=z.markedSpans;if(G)for(var te=0;te=oe.to||oe.from==null&&T!=c.line||oe.from!=null&&T==d.line&&oe.from>=d.ch)&&(!S||S(oe.marker))&&N.push(oe.marker.parent||oe.marker)}++T}),N},getAllMarks:function(){var c=[];return this.iter(function(d){var S=d.markedSpans;if(S)for(var N=0;Nc)return d=c,!0;c-=z,++S}),Tt(this,rt(S,d))},indexFromPos:function(c){c=Tt(this,c);var d=c.ch;if(c.lined&&(d=c.from),c.to!=null&&c.to-1){d.state.draggingText(c),setTimeout(function(){return d.display.input.focus()},20);return}try{var Ae=c.dataTransfer.getData("Text");if(Ae){var Ie;if(d.state.draggingText&&!d.state.draggingText.copy&&(Ie=d.listSelections()),gu(d.doc,pu(S,S)),Ie)for(var Ze=0;Ze=0;te--)$o(c.doc,"",N[te].from,N[te].to,"+delete");jl(c)})}function kg(c,d,S){var N=ne(c.text,d+S,S);return N<0||N>c.text.length?null:N}function Bg(c,d,S){var N=kg(c,d.ch,S);return N==null?null:new rt(d.line,N,S<0?"after":"before")}function Lg(c,d,S,N,T){if(c){d.doc.direction=="rtl"&&(T=-T);var z=Xe(S,d.doc.direction);if(z){var G=T<0?ge(z):z[0],te=T<0==(G.level==1),oe=te?"after":"before",se;if(G.level>0||d.doc.direction=="rtl"){var Ae=Ku(d,S);se=T<0?S.text.length-1:0;var Ie=To(d,Ae,se).top;se=me(function(Ze){return To(d,Ae,Ze).top==Ie},T<0==(G.level==1)?G.from:G.to-1,se),oe=="before"&&(se=kg(S,se,1))}else se=T<0?G.to:G.from;return new rt(N,se,oe)}}return new rt(N,T<0?S.text.length:0,T<0?"before":"after")}function YN(c,d,S,N){var T=Xe(d,c.doc.direction);if(!T)return Bg(d,S,N);S.ch>=d.text.length?(S.ch=d.text.length,S.sticky="before"):S.ch<=0&&(S.ch=0,S.sticky="after");var z=Je(T,S.ch,S.sticky),G=T[z];if(c.doc.direction=="ltr"&&G.level%2==0&&(N>0?G.to>S.ch:G.from=G.from&&Ze>=Ae.begin)){var $e=Ie?"before":"after";return new rt(S.line,Ze,$e)}}var at=function(bt,At,Dt){for(var It=function(Yr,ai){return ai?new rt(S.line,te(Yr,1),"before"):new rt(S.line,Yr,"after")};bt>=0&&bt0==(Yt.level!=1),sr=Vt?Dt.begin:te(Dt.end,-1);if(Yt.from<=sr&&sr0?Ae.end:te(Ae.begin,-1);return xt!=null&&!(N>0&&xt==d.text.length)&&(mt=at(N>0?0:T.length-1,N,se(xt)),mt)?mt:null}var Zc={selectAll:iy,singleSelection:function(c){return c.setSelection(c.getCursor("anchor"),c.getCursor("head"),Le)},killLine:function(c){return mf(c,function(d){if(d.empty()){var S=zt(c.doc,d.head.line).text.length;return d.head.ch==S&&d.head.line0)T=new rt(T.line,T.ch+1),c.replaceRange(z.charAt(T.ch-1)+z.charAt(T.ch-2),rt(T.line,T.ch-2),T,"+transpose");else if(T.line>c.doc.first){var G=zt(c.doc,T.line-1).text;G&&(T=new rt(T.line,1),c.replaceRange(z.charAt(0)+c.doc.lineSeparator()+G.charAt(G.length-1),rt(T.line-1,G.length-1),T,"+transpose"))}}S.push(new Br(T,T))}c.setSelections(S)})},newlineAndIndent:function(c){return bi(c,function(){for(var d=c.listSelections(),S=d.length-1;S>=0;S--)c.replaceRange(c.doc.lineSeparator(),d[S].anchor,d[S].head,"+input");d=c.listSelections();for(var N=0;Nc&&ke(d,this.pos)==0&&S==this.button};var Jc,Qc;function Ny(c,d){var S=+new Date;return Qc&&Qc.compare(S,c,d)?(Jc=Qc=null,"triple"):Jc&&Jc.compare(S,c,d)?(Qc=new Bm(S,c,d),Jc=null,"double"):(Jc=new Bm(S,c,d),Qc=null,"single")}function Ey(c){var d=this,S=d.display;if(!(wt(d,c)||S.activeTouch&&S.input.supportsTouch())){if(S.input.ensurePolled(),S.shift=c.shiftKey,La(S,c)){a||(S.scroller.draggable=!1,setTimeout(function(){return S.scroller.draggable=!0},100));return}if(!Ug(d,c)){var N=fa(d,c),T=_n(c),z=N?Ny(N,T):"single";Ee(d).focus(),T==1&&d.state.selectingText&&d.state.selectingText(c),!(N&&Sy(d,T,N,z,c))&&(T==1?N?Lm(d,N,z,c):Sr(c)==S.scroller&&Gt(c):T==2?(N&&Om(d.doc,N),setTimeout(function(){return S.input.focus()},20)):T==3&&(R?d.display.input.onContextMenu(c):Ql(d)))}}}function Sy(c,d,S,N,T){var z="Click";return N=="double"?z="Double"+z:N=="triple"&&(z="Triple"+z),z=(d==1?"Left":d==2?"Middle":"Right")+z,Xc(c,gy(z,T),T,function(G){if(typeof G=="string"&&(G=Zc[G]),!G)return!1;var te=!1;try{c.isReadOnly()&&(c.state.suppressEdits=!0),te=G(c,S)!=We}finally{c.state.suppressEdits=!1}return te})}function Ay(c,d,S){var N=c.getOption("configureMouse"),T=N?N(c,d,S):{};if(T.unit==null){var z=I?S.shiftKey&&S.metaKey:S.altKey;T.unit=z?"rectangle":d=="single"?"char":d=="double"?"word":"line"}return(T.extend==null||c.doc.extend)&&(T.extend=c.doc.extend||S.shiftKey),T.addNew==null&&(T.addNew=M?S.metaKey:S.ctrlKey),T.moveOnDrag==null&&(T.moveOnDrag=!(M?S.altKey:S.ctrlKey)),T}function Lm(c,d,S,N){u?setTimeout(Pe(lg,c),0):c.curOp.focus=Z(we(c));var T=Ay(c,S,N),z=c.doc.sel,G;c.options.dragDrop&&_a&&!c.isReadOnly()&&S=="single"&&(G=z.contains(d))>-1&&(ke((G=z.ranges[G]).from(),d)<0||d.xRel>0)&&(ke(G.to(),d)>0||d.xRel<0)?jN(c,N,d,T):eE(c,N,d,T)}function jN(c,d,S,N){var T=c.display,z=!1,G=oi(c,function(se){a&&(T.scroller.draggable=!1),c.state.draggingText=!1,c.state.delayingBlurEvent&&(c.hasFocus()?c.state.delayingBlurEvent=!1:Ql(c)),Ye(T.wrapper.ownerDocument,"mouseup",G),Ye(T.wrapper.ownerDocument,"mousemove",te),Ye(T.scroller,"dragstart",oe),Ye(T.scroller,"drop",G),z||(Gt(se),N.addNew||Om(c.doc,S,null,null,N.extend),a&&!x||u&&l==9?setTimeout(function(){T.wrapper.ownerDocument.body.focus({preventScroll:!0}),T.input.focus()},20):T.input.focus())}),te=function(se){z=z||Math.abs(d.clientX-se.clientX)+Math.abs(d.clientY-se.clientY)>=10},oe=function(){return z=!0};a&&(T.scroller.draggable=!0),c.state.draggingText=G,G.copy=!N.moveOnDrag,X(T.wrapper.ownerDocument,"mouseup",G),X(T.wrapper.ownerDocument,"mousemove",te),X(T.scroller,"dragstart",oe),X(T.scroller,"drop",G),c.state.delayingBlurEvent=!0,setTimeout(function(){return T.input.focus()},20),T.scroller.dragDrop&&T.scroller.dragDrop()}function Cy(c,d,S){if(S=="char")return new Br(d,d);if(S=="word")return c.findWordAt(d);if(S=="line")return new Br(rt(d.line,0),Tt(c.doc,rt(d.line+1,0)));var N=S(c,d);return new Br(N.from,N.to)}function eE(c,d,S,N){u&&Ql(c);var T=c.display,z=c.doc;Gt(d);var G,te,oe=z.sel,se=oe.ranges;if(N.addNew&&!N.extend?(te=z.sel.contains(S),te>-1?G=se[te]:G=new Br(S,S)):(G=z.sel.primary(),te=z.sel.primIndex),N.unit=="rectangle")N.addNew||(G=new Br(S,S)),S=fa(c,d,!0,!0),te=-1;else{var Ae=Cy(c,S,N.unit);N.extend?G=Ng(G,Ae.anchor,Ae.head,N.extend):G=Ae}N.addNew?te==-1?(te=se.length,ci(z,Ho(c,se.concat([G]),te),{scroll:!1,origin:"*mouse"})):se.length>1&&se[te].empty()&&N.unit=="char"&&!N.extend?(ci(z,Ho(c,se.slice(0,te).concat(se.slice(te+1)),0),{scroll:!1,origin:"*mouse"}),oe=z.sel):Sg(z,te,G,lt):(te=0,ci(z,new Oo([G],0),lt),oe=z.sel);var Ie=S;function Ze(Dt){if(ke(Ie,Dt)!=0)if(Ie=Dt,N.unit=="rectangle"){for(var It=[],Yt=c.options.tabSize,Vt=Oe(zt(z,S.line).text,S.ch,Yt),sr=Oe(zt(z,Dt.line).text,Dt.ch,Yt),Yr=Math.min(Vt,sr),ai=Math.max(Vt,sr),dn=Math.min(S.line,Dt.line),Zn=Math.min(c.lastLine(),Math.max(S.line,Dt.line));dn<=Zn;dn++){var _i=zt(z,dn).text,Ln=de(_i,Yr,Yt);Yr==ai?It.push(new Br(rt(dn,Ln),rt(dn,Ln))):_i.length>Ln&&It.push(new Br(rt(dn,Ln),rt(dn,de(_i,ai,Yt))))}It.length||It.push(new Br(S,S)),ci(z,Ho(c,oe.ranges.slice(0,te).concat(It),te),{origin:"*mouse",scroll:!1}),c.scrollIntoView(Dt)}else{var ji=G,mi=Cy(c,Dt,N.unit),Xn=ji.anchor,Pn;ke(mi.anchor,Xn)>0?(Pn=mi.head,Xn=iu(ji.from(),mi.anchor)):(Pn=mi.anchor,Xn=wi(ji.to(),mi.head));var vn=oe.ranges.slice(0);vn[te]=tE(c,new Br(Tt(z,Xn),Pn)),ci(z,Ho(c,vn,te),lt)}}var $e=T.wrapper.getBoundingClientRect(),at=0;function mt(Dt){var It=++at,Yt=fa(c,Dt,!0,N.unit=="rectangle");if(Yt)if(ke(Yt,Ie)!=0){c.curOp.focus=Z(we(c)),Ze(Yt);var Vt=Ir(T,z);(Yt.line>=Vt.to||Yt.line$e.bottom?20:0;sr&&setTimeout(oi(c,function(){at==It&&(T.scroller.scrollTop+=sr,mt(Dt))}),50)}}function xt(Dt){c.state.selectingText=!1,at=1/0,Dt&&(Gt(Dt),T.input.focus()),Ye(T.wrapper.ownerDocument,"mousemove",bt),Ye(T.wrapper.ownerDocument,"mouseup",At),z.history.lastSelOrigin=null}var bt=oi(c,function(Dt){Dt.buttons===0||!_n(Dt)?xt(Dt):mt(Dt)}),At=oi(c,xt);c.state.selectingText=At,X(T.wrapper.ownerDocument,"mousemove",bt),X(T.wrapper.ownerDocument,"mouseup",At)}function tE(c,d){var S=d.anchor,N=d.head,T=zt(c.doc,S.line);if(ke(S,N)==0&&S.sticky==N.sticky)return d;var z=Xe(T);if(!z)return d;var G=Je(z,S.ch,S.sticky),te=z[G];if(te.from!=S.ch&&te.to!=S.ch)return d;var oe=G+(te.from==S.ch==(te.level!=1)?0:1);if(oe==0||oe==z.length)return d;var se;if(N.line!=S.line)se=(N.line-S.line)*(c.doc.direction=="ltr"?1:-1)>0;else{var Ae=Je(z,N.ch,N.sticky),Ie=Ae-G||(N.ch-S.ch)*(te.level==1?-1:1);Ae==oe-1||Ae==oe?se=Ie<0:se=Ie>0}var Ze=z[oe+(se?-1:0)],$e=se==(Ze.level==1),at=$e?Ze.from:Ze.to,mt=$e?"after":"before";return S.ch==at&&S.sticky==mt?d:new Br(new rt(S.line,at,mt),N)}function zg(c,d,S,N){var T,z;if(d.touches)T=d.touches[0].clientX,z=d.touches[0].clientY;else try{T=d.clientX,z=d.clientY}catch{return!1}if(T>=Math.floor(c.display.gutters.getBoundingClientRect().right))return!1;N&&Gt(d);var G=c.display,te=G.lineDiv.getBoundingClientRect();if(z>te.bottom||!fr(c,S))return rr(d);z-=te.top-G.viewOffset;for(var oe=0;oe=T){var Ae=Me(c.doc,z),Ie=c.display.gutterSpecs[oe];return je(c,S,c,Ae,Ie.className,d),rr(d)}}}function Ug(c,d){return zg(c,d,"gutterClick",!0)}function My(c,d){La(c.display,d)||Ty(c,d)||wt(c,d,"contextmenu")||R||c.display.input.onContextMenu(d)}function Ty(c,d){return fr(c,"gutterContextMenu")?zg(c,d,"gutterContextMenu",!1):!1}function pi(c){c.display.wrapper.className=c.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+c.options.theme.replace(/(^|\s)\s*/g," cm-s-"),bc(c)}var ll={toString:function(){return"CodeMirror.Init"}},Oy={},Pm={};function rE(c){var d=c.optionHandlers;function S(N,T,z,G){c.defaults[N]=T,z&&(d[N]=G?function(te,oe,se){se!=ll&&z(te,oe,se)}:z)}c.defineOption=S,c.Init=ll,S("value","",function(N,T){return N.setValue(T)},!0),S("mode",null,function(N,T){N.doc.modeOption=T,Mm(N)},!0),S("indentUnit",2,Mm,!0),S("indentWithTabs",!1),S("smartIndent",!0),S("tabSize",4,function(N){Lc(N),bc(N),Ji(N)},!0),S("lineSeparator",null,function(N,T){if(N.doc.lineSep=T,!!T){var z=[],G=N.doc.first;N.doc.iter(function(oe){for(var se=0;;){var Ae=oe.text.indexOf(T,se);if(Ae==-1)break;se=Ae+T.length,z.push(rt(G,Ae))}G++});for(var te=z.length-1;te>=0;te--)$o(N.doc,T,z[te],rt(z[te].line,z[te].ch+T.length))}}),S("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(N,T,z){N.state.specialChars=new RegExp(T.source+(T.test(" ")?"":"| "),"g"),z!=ll&&N.refresh()}),S("specialCharPlaceholder",wN,function(N){return N.refresh()},!0),S("electricChars",!0),S("inputStyle",O?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),S("spellcheck",!1,function(N,T){return N.getInputField().spellcheck=T},!0),S("autocorrect",!1,function(N,T){return N.getInputField().autocorrect=T},!0),S("autocapitalize",!1,function(N,T){return N.getInputField().autocapitalize=T},!0),S("rtlMoveVisually",!F),S("wholeLineUpdateBefore",!0),S("theme","default",function(N){pi(N),_c(N)},!0),S("keyMap","default",function(N,T,z){var G=Yc(T),te=z!=ll&&Yc(z);te&&te.detach&&te.detach(N,G),G.attach&&G.attach(N,te||null)}),S("extraKeys",null),S("configureMouse",null),S("lineWrapping",!1,nE,!0),S("gutters",[],function(N,T){N.display.gutterSpecs=yg(T,N.options.lineNumbers),_c(N)},!0),S("fixedGutter",!0,function(N,T){N.display.gutters.style.left=T?Sc(N.display)+"px":"0",N.refresh()},!0),S("coverGutterNextToScrollbar",!1,function(N){return cu(N)},!0),S("scrollbarStyle","native",function(N){V1(N),cu(N),N.display.scrollbars.setScrollTop(N.doc.scrollTop),N.display.scrollbars.setScrollLeft(N.doc.scrollLeft)},!0),S("lineNumbers",!1,function(N,T){N.display.gutterSpecs=yg(N.options.gutters,T),_c(N)},!0),S("firstLineNumber",1,_c,!0),S("lineNumberFormatter",function(N){return N},_c,!0),S("showCursorWhenSelecting",!1,Ac,!0),S("resetSelectionOnContextMenu",!0),S("lineWiseCopyCut",!0),S("pasteLinesPerSelection",!0),S("selectionsMayTouch",!1),S("readOnly",!1,function(N,T){T=="nocursor"&&(ju(N),N.display.input.blur()),N.display.input.readOnlyChanged(T)}),S("screenReaderLabel",null,function(N,T){T=T===""?null:T,N.display.input.screenReaderLabelChanged(T)}),S("disableInput",!1,function(N,T){T||N.display.input.reset()},!0),S("dragDrop",!0,Iy),S("allowDropFileTypes",null),S("cursorBlinkRate",530),S("cursorScrollMargin",0),S("cursorHeight",1,Ac,!0),S("singleCursorHeightPerLine",!0,Ac,!0),S("workTime",100),S("workDelay",100),S("flattenSpans",!0,Lc,!0),S("addModeClass",!1,Lc,!0),S("pollInterval",100),S("undoDepth",200,function(N,T){return N.doc.history.undoDepth=T}),S("historyEventDelay",1250),S("viewportMargin",10,function(N){return N.refresh()},!0),S("maxHighlightLength",1e4,Lc,!0),S("moveInputWithCursor",!0,function(N,T){T||N.display.input.resetPosition()}),S("tabindex",null,function(N,T){return N.display.input.getField().tabIndex=T||""}),S("autofocus",null),S("direction","ltr",function(N,T){return N.doc.setDirection(T)},!0),S("phrases",null)}function Iy(c,d,S){var N=S&&S!=ll;if(!d!=!N){var T=c.display.dragFunctions,z=d?X:Ye;z(c.display.scroller,"dragstart",T.start),z(c.display.scroller,"dragenter",T.enter),z(c.display.scroller,"dragover",T.over),z(c.display.scroller,"dragleave",T.leave),z(c.display.scroller,"drop",T.drop)}}function nE(c){c.options.lineWrapping?(le(c.display.wrapper,"CodeMirror-wrap"),c.display.sizer.style.minWidth="",c.display.sizerWidth=null):(U(c.display.wrapper,"CodeMirror-wrap"),Yd(c)),wm(c),Ji(c),bc(c),setTimeout(function(){return cu(c)},100)}function ln(c,d){var S=this;if(!(this instanceof ln))return new ln(c,d);this.options=d=d?Ce(d):{},Ce(Oy,d,!1);var N=d.value;typeof N=="string"?N=new Qi(N,d.mode,null,d.lineSeparator,d.direction):d.mode&&(N.modeOption=d.mode),this.doc=N;var T=new ln.inputStyles[d.inputStyle](this),z=this.display=new BN(c,N,T,d);z.wrapper.CodeMirror=this,pi(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),V1(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new He,keySeq:null,specialChars:null},d.autofocus&&!O&&z.input.focus(),u&&l<11&&setTimeout(function(){return S.display.input.reset(!0)},20),iE(this),py(),rl(this),this.curOp.forceUpdate=!0,j1(this,N),d.autofocus&&!O||this.hasFocus()?setTimeout(function(){S.hasFocus()&&!S.state.focused&&Dm(S)},20):ju(this);for(var G in Pm)Pm.hasOwnProperty(G)&&Pm[G](this,d[G],ll);K1(this),d.finishInit&&d.finishInit(this);for(var te=0;te20*20}X(d.scroller,"touchstart",function(oe){if(!wt(c,oe)&&!z(oe)&&!Ug(c,oe)){d.input.ensurePolled(),clearTimeout(S);var se=+new Date;d.activeTouch={start:se,moved:!1,prev:se-N.end<=300?N:null},oe.touches.length==1&&(d.activeTouch.left=oe.touches[0].pageX,d.activeTouch.top=oe.touches[0].pageY)}}),X(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)}),X(d.scroller,"touchend",function(oe){var se=d.activeTouch;if(se&&!La(d,oe)&&se.left!=null&&!se.moved&&new Date-se.start<300){var Ae=c.coordsChar(d.activeTouch,"page"),Ie;!se.prev||G(se,se.prev)?Ie=new Br(Ae,Ae):!se.prev.prev||G(se,se.prev.prev)?Ie=c.findWordAt(Ae):Ie=new Br(rt(Ae.line,0),Tt(c.doc,rt(Ae.line+1,0))),c.setSelection(Ie.anchor,Ie.head),c.focus(),Gt(oe)}T()}),X(d.scroller,"touchcancel",T),X(d.scroller,"scroll",function(){d.scroller.clientHeight&&(bs(c,d.scroller.scrollTop),el(c,d.scroller.scrollLeft,!0),je(c,"scroll",c))}),X(d.scroller,"mousewheel",function(oe){return J1(c,oe)}),X(d.scroller,"DOMMouseScroll",function(oe){return J1(c,oe)}),X(d.wrapper,"scroll",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0}),d.dragFunctions={enter:function(oe){wt(c,oe)||ao(oe)},over:function(oe){wt(c,oe)||(fy(c,oe),ao(oe))},start:function(oe){return VN(c,oe)},drop:oi(c,ly),leave:function(oe){wt(c,oe)||_g(c)}};var te=d.input.getField();X(te,"keyup",function(oe){return by.call(c,oe)}),X(te,"keydown",oi(c,Kc)),X(te,"keypress",oi(c,Dy)),X(te,"focus",function(oe){return Dm(c,oe)}),X(te,"blur",function(oe){return ju(c,oe)})}var Rm=[];ln.defineInitHook=function(c){return Rm.push(c)};function hf(c,d,S,N){var T=c.doc,z;S==null&&(S="add"),S=="smart"&&(T.mode.indent?z=jr(c,d).state:S="prev");var G=c.options.tabSize,te=zt(T,d),oe=Oe(te.text,null,G);te.stateAfter&&(te.stateAfter=null);var se=te.text.match(/^\s*/)[0],Ae;if(!N&&!/\S/.test(te.text))Ae=0,S="not";else if(S=="smart"&&(Ae=T.mode.indent(z,te.text.slice(se.length),te.text),Ae==We||Ae>150)){if(!N)return;S="prev"}S=="prev"?d>T.first?Ae=Oe(zt(T,d-1).text,null,G):Ae=0:S=="add"?Ae=oe+c.options.indentUnit:S=="subtract"?Ae=oe-c.options.indentUnit:typeof S=="number"&&(Ae=oe+S),Ae=Math.max(0,Ae);var Ie="",Ze=0;if(c.options.indentWithTabs)for(var $e=Math.floor(Ae/G);$e;--$e)Ze+=G,Ie+=" ";if(ZeG,oe=ni(d),se=null;if(te&&N.ranges.length>1)if(pa&&pa.text.join(` -`)==d){if(N.ranges.length%pa.text.length==0){se=[];for(var Ae=0;Ae=0;Ze--){var $e=N.ranges[Ze],at=$e.from(),mt=$e.to();$e.empty()&&(S&&S>0?at=rt(at.line,at.ch-S):c.state.overwrite&&!te?mt=rt(mt.line,Math.min(zt(z,mt.line).text.length,mt.ch+ge(oe).length)):te&&pa&&pa.lineWise&&pa.text.join(` + height: `+(Vt-It)+"px"))}function Ie(Dt,It,Yt){var Vt=zt(T,Dt),sr=Vt.text.length,Yr,ai;function dn(Ln,ji){return ym(c,rt(Dt,Ln),"div",Vt,ji)}function Zn(Ln,ji,mi){var Xn=U1(c,Vt,null,Ln),Pn=ji=="ltr"==(mi=="after")?"left":"right",vn=mi=="after"?Xn.begin:Xn.end-(/\s/.test(Vt.text.charAt(Xn.end-1))?2:1);return dn(vn,Pn)[Pn]}var _i=Xe(Vt,T.direction);return ye(_i,It||0,Yt??sr,function(Ln,ji,mi,Xn){var Pn=mi=="ltr",vn=dn(Ln,Pn?"left":"right"),hi=dn(ji-1,Pn?"right":"left"),vf=It==null&&Ln==0,gu=Yt==null&&ji==sr,Di=Xn==0,Ra=!_i||Xn==_i.length-1;if(hi.top-vn.top<=3){var si=(se?vf:gu)&&Di,ep=(se?gu:vf)&&Ra,As=si?te:(Pn?vn:hi).left,vu=ep?oe:(Pn?hi:vn).right;Ae(As,vn.top,vu-As,vn.bottom)}else{var fl,ki,xf,tp;Pn?(fl=se&&vf&&Di?te:vn.left,ki=se?oe:Zn(Ln,mi,"before"),xf=se?te:Zn(ji,mi,"after"),tp=se&&gu&&Ra?oe:hi.right):(fl=se?Zn(Ln,mi,"before"):te,ki=!se&&vf&&Di?oe:vn.right,xf=!se&&gu&&Ra?te:hi.left,tp=se?Zn(ji,mi,"after"):oe),Ae(fl,vn.top,ki-fl,vn.bottom),vn.bottom0?d.blinker=setInterval(function(){c.hasFocus()||ju(c),d.cursorDiv.style.visibility=(E=!E)?"":"hidden"},c.options.cursorBlinkRate):c.options.cursorBlinkRate<0&&(d.cursorDiv.style.visibility="hidden")}}function ug(c){c.hasFocus()||(c.display.input.focus(),c.state.focused||Dm(c))}function jl(c){c.state.delayingBlurEvent=!0,setTimeout(function(){c.state.delayingBlurEvent&&(c.state.delayingBlurEvent=!1,c.state.focused&&ju(c))},100)}function Dm(c,d){c.state.delayingBlurEvent&&!c.state.draggingText&&(c.state.delayingBlurEvent=!1),c.options.readOnly!="nocursor"&&(c.state.focused||(je(c,"focus",c,d),c.state.focused=!0,le(c.display.wrapper,"CodeMirror-focused"),!c.curOp&&c.display.selForContextMenu!=c.doc.sel&&(c.display.input.reset(),a&&setTimeout(function(){return c.display.input.reset(!0)},20)),c.display.input.receivedFocus()),Cc(c))}function ju(c,d){c.state.delayingBlurEvent||(c.state.focused&&(je(c,"blur",c,d),c.state.focused=!1,U(c.display.wrapper,"CodeMirror-focused")),clearInterval(c.display.blinker),setTimeout(function(){c.state.focused||(c.display.shift=!1)},150))}function Nm(c){for(var d=c.display,E=d.lineDiv.offsetTop,N=Math.max(0,d.scroller.getBoundingClientRect().top),T=d.lineDiv.getBoundingClientRect().top,z=0,G=0;G.005||$e<-.005)&&(Tc.display.sizerWidth){var mt=Math.ceil(Ae/xs(c.display));mt>c.display.maxLineLength&&(c.display.maxLineLength=mt,c.display.maxLine=te.line,c.display.maxLineChanged=!0)}}}Math.abs(z)>2&&(d.scroller.scrollTop+=z)}function lg(c){if(c.widgets)for(var d=0;d=G&&(z=Me(d,Uo(zt(d,oe))-c.wrapper.clientHeight),G=oe)}return{from:z,to:Math.max(G,z+1)}}function MN(c,d){if(!wt(c,"scrollCursorIntoView")){var E=c.display,N=E.sizer.getBoundingClientRect(),T=null,z=E.wrapper.ownerDocument;if(d.top+N.top<0?T=!0:d.bottom+N.top>(z.defaultView.innerHeight||z.documentElement.clientHeight)&&(T=!1),T!=null&&!w){var G=W("div","\u200B",null,`position: absolute; + top: `+(d.top-E.viewOffset-Zl(c.display))+`px; + height: `+(d.bottom-d.top+ua(c)+E.barHeight)+`px; + left: `+d.left+"px; width: "+Math.max(2,d.right-d.left)+"px;");c.display.lineSpace.appendChild(G),G.scrollIntoView(T),c.display.lineSpace.removeChild(G)}}}function $1(c,d,E,N){N==null&&(N=0);var T;!c.options.lineWrapping&&d==E&&(E=d.sticky=="before"?rt(d.line,d.ch+1,"before"):d,d=d.ch?rt(d.line,d.sticky=="before"?d.ch-1:d.ch,"after"):d);for(var z=0;z<5;z++){var G=!1,te=Ki(c,d),oe=!E||E==d?te:Ki(c,E);T={left:Math.min(te.left,oe.left),top:Math.min(te.top,oe.top)-N,right:Math.max(te.left,oe.left),bottom:Math.max(te.bottom,oe.bottom)+N};var se=fg(c,T),Ae=c.doc.scrollTop,Ie=c.doc.scrollLeft;if(se.scrollTop!=null&&(ws(c,se.scrollTop),Math.abs(c.doc.scrollTop-Ae)>1&&(G=!0)),se.scrollLeft!=null&&(el(c,se.scrollLeft),Math.abs(c.doc.scrollLeft-Ie)>1&&(G=!0)),!G)break}return T}function TN(c,d){var E=fg(c,d);E.scrollTop!=null&&ws(c,E.scrollTop),E.scrollLeft!=null&&el(c,E.scrollLeft)}function fg(c,d){var E=c.display,N=la(c.display);d.top<0&&(d.top=0);var T=c.curOp&&c.curOp.scrollTop!=null?c.curOp.scrollTop:E.scroller.scrollTop,z=gm(c),G={};d.bottom-d.top>z&&(d.bottom=d.top+z);var te=c.doc.height+wc(E),oe=d.topte-N;if(d.topT+z){var Ae=Math.min(d.top,(se?te:d.bottom)-z);Ae!=T&&(G.scrollTop=Ae)}var Ie=c.options.fixedGutter?0:E.gutters.offsetWidth,Ze=c.curOp&&c.curOp.scrollLeft!=null?c.curOp.scrollLeft:E.scroller.scrollLeft-Ie,$e=uu(c)-E.gutters.offsetWidth,at=d.right-d.left>$e;return at&&(d.right=d.left+$e),d.left<10?G.scrollLeft=0:d.left$e+Ze-3&&(G.scrollLeft=d.right+(at?0:10)-$e),G}function Sm(c,d){d!=null&&(tf(c),c.curOp.scrollTop=(c.curOp.scrollTop==null?c.doc.scrollTop:c.curOp.scrollTop)+d)}function ef(c){tf(c);var d=c.getCursor();c.curOp.scrollToPos={from:d,to:d,margin:c.options.cursorScrollMargin}}function Mc(c,d,E){(d!=null||E!=null)&&tf(c),d!=null&&(c.curOp.scrollLeft=d),E!=null&&(c.curOp.scrollTop=E)}function ON(c,d){tf(c),c.curOp.scrollToPos=d}function tf(c){var d=c.curOp.scrollToPos;if(d){c.curOp.scrollToPos=null;var E=Ju(c,d.from),N=Ju(c,d.to);cg(c,E,N,d.margin)}}function cg(c,d,E,N){var T=fg(c,{left:Math.min(d.left,E.left),top:Math.min(d.top,E.top)-N,right:Math.max(d.right,E.right),bottom:Math.max(d.bottom,E.bottom)+N});Mc(c,T.scrollLeft,T.scrollTop)}function ws(c,d){Math.abs(c.doc.scrollTop-d)<2||(r||Em(c,{top:d}),lu(c,d,!0),r&&Em(c),Ic(c,100))}function lu(c,d,E){d=Math.max(0,Math.min(c.display.scroller.scrollHeight-c.display.scroller.clientHeight,d)),!(c.display.scroller.scrollTop==d&&!E)&&(c.doc.scrollTop=d,c.display.scrollbars.setScrollTop(d),c.display.scroller.scrollTop!=d&&(c.display.scroller.scrollTop=d))}function el(c,d,E,N){d=Math.max(0,Math.min(d,c.display.scroller.scrollWidth-c.display.scroller.clientWidth)),!((E?d==c.doc.scrollLeft:Math.abs(c.doc.scrollLeft-d)<2)&&!N)&&(c.doc.scrollLeft=d,gg(c),c.display.scroller.scrollLeft!=d&&(c.display.scroller.scrollLeft=d),c.display.scrollbars.setScrollLeft(d))}function Tc(c){var d=c.display,E=d.gutters.offsetWidth,N=Math.round(c.doc.height+wc(c.display));return{clientHeight:d.scroller.clientHeight,viewHeight:d.wrapper.clientHeight,scrollWidth:d.scroller.scrollWidth,clientWidth:d.scroller.clientWidth,viewWidth:d.wrapper.clientWidth,barLeft:c.options.fixedGutter?E:0,docHeight:N,scrollHeight:N+ua(c)+d.barHeight,nativeBarWidth:d.nativeBarWidth,gutterWidth:E}}var tl=function(c,d,E){this.cm=E;var N=this.vert=W("div",[W("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),T=this.horiz=W("div",[W("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");N.tabIndex=T.tabIndex=-1,c(N),c(T),X(N,"scroll",function(){N.clientHeight&&d(N.scrollTop,"vertical")}),X(T,"scroll",function(){T.clientWidth&&d(T.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,u&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};tl.prototype.update=function(c){var d=c.scrollWidth>c.clientWidth+1,E=c.scrollHeight>c.clientHeight+1,N=c.nativeBarWidth;if(E){this.vert.style.display="block",this.vert.style.bottom=d?N+"px":"0";var T=c.viewHeight-(d?N:0);this.vert.firstChild.style.height=Math.max(0,c.scrollHeight-c.clientHeight+T)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(d){this.horiz.style.display="block",this.horiz.style.right=E?N+"px":"0",this.horiz.style.left=c.barLeft+"px";var z=c.viewWidth-c.barLeft-(E?N:0);this.horiz.firstChild.style.width=Math.max(0,c.scrollWidth-c.clientWidth+z)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&c.clientHeight>0&&(N==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:E?N:0,bottom:d?N:0}},tl.prototype.setScrollLeft=function(c){this.horiz.scrollLeft!=c&&(this.horiz.scrollLeft=c),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},tl.prototype.setScrollTop=function(c){this.vert.scrollTop!=c&&(this.vert.scrollTop=c),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},tl.prototype.zeroWidthHack=function(){var c=M&&!b?"12px":"18px";this.horiz.style.height=this.vert.style.width=c,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new He,this.disableVert=new He},tl.prototype.enableZeroWidthBar=function(c,d,E){c.style.visibility="";function N(){var T=c.getBoundingClientRect(),z=E=="vert"?document.elementFromPoint(T.right-1,(T.top+T.bottom)/2):document.elementFromPoint((T.right+T.left)/2,T.bottom-1);z!=c?c.style.visibility="hidden":d.set(1e3,N)}d.set(1e3,N)},tl.prototype.clear=function(){var c=this.horiz.parentNode;c.removeChild(this.horiz),c.removeChild(this.vert)};var fi=function(){};fi.prototype.update=function(){return{bottom:0,right:0}},fi.prototype.setScrollLeft=function(){},fi.prototype.setScrollTop=function(){},fi.prototype.clear=function(){};function fu(c,d){d||(d=Tc(c));var E=c.display.barWidth,N=c.display.barHeight;pg(c,d);for(var T=0;T<4&&E!=c.display.barWidth||N!=c.display.barHeight;T++)E!=c.display.barWidth&&c.options.lineWrapping&&Nm(c),pg(c,Tc(c)),E=c.display.barWidth,N=c.display.barHeight}function pg(c,d){var E=c.display,N=E.scrollbars.update(d);E.sizer.style.paddingRight=(E.barWidth=N.right)+"px",E.sizer.style.paddingBottom=(E.barHeight=N.bottom)+"px",E.heightForcer.style.borderBottom=N.bottom+"px solid transparent",N.right&&N.bottom?(E.scrollbarFiller.style.display="block",E.scrollbarFiller.style.height=N.bottom+"px",E.scrollbarFiller.style.width=N.right+"px"):E.scrollbarFiller.style.display="",N.bottom&&c.options.coverGutterNextToScrollbar&&c.options.fixedGutter?(E.gutterFiller.style.display="block",E.gutterFiller.style.height=N.bottom+"px",E.gutterFiller.style.width=d.gutterWidth+"px"):E.gutterFiller.style.display=""}var W1={native:tl,null:fi};function V1(c){c.display.scrollbars&&(c.display.scrollbars.clear(),c.display.scrollbars.addClass&&U(c.display.wrapper,c.display.scrollbars.addClass)),c.display.scrollbars=new W1[c.options.scrollbarStyle](function(d){c.display.wrapper.insertBefore(d,c.display.scrollbarFiller),X(d,"mousedown",function(){c.state.focused&&setTimeout(function(){return c.display.input.focus()},0)}),d.setAttribute("cm-not-content","true")},function(d,E){E=="horizontal"?el(c,d):ws(c,d)},c),c.display.scrollbars.addClass&&le(c.display.wrapper,c.display.scrollbars.addClass)}var IN=0;function rl(c){c.curOp={cm:c,viewChanged:!1,startHeight:c.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++IN,markArrays:null},M1(c.curOp)}function bs(c){var d=c.curOp;d&&mm(d,function(E){for(var N=0;N=E.viewTo)||E.maxLineChanged&&d.options.lineWrapping,c.update=c.mustUpdate&&new Fc(d,c.mustUpdate&&{top:c.scrollTop,ensure:c.scrollToPos},c.forceUpdate)}function rf(c){c.updatedDisplay=c.mustUpdate&&hg(c.cm,c.update)}function FN(c){var d=c.cm,E=d.display;c.updatedDisplay&&Nm(d),c.barMeasure=Tc(d),E.maxLineChanged&&!d.options.lineWrapping&&(c.adjustWidthTo=F1(d,E.maxLine,E.maxLine.text.length).left+3,d.display.sizerWidth=c.adjustWidthTo,c.barMeasure.scrollWidth=Math.max(E.scroller.clientWidth,E.sizer.offsetLeft+c.adjustWidthTo+ua(d)+d.display.barWidth),c.maxScrollLeft=Math.max(0,E.sizer.offsetLeft+c.adjustWidthTo-uu(d))),(c.updatedDisplay||c.selectionChanged)&&(c.preparedSelection=E.input.prepareSelection())}function nl(c){var d=c.cm;c.adjustWidthTo!=null&&(d.display.sizer.style.minWidth=c.adjustWidthTo+"px",c.maxScrollLeft=c.display.viewTo)){var E=+new Date+c.options.workTime,N=jr(c,d.highlightFrontier),T=[];d.iter(N.line,Math.min(d.first+d.size,c.display.viewTo+500),function(z){if(N.line>=c.display.viewFrom){var G=z.styles,te=z.text.length>c.options.maxHighlightLength?Or(d.mode,N.state):null,oe=hs(c,z,N,!0);te&&(N.state=te),z.styles=oe.styles;var se=z.styleClasses,Ae=oe.classes;Ae?z.styleClasses=Ae:se&&(z.styleClasses=null);for(var Ie=!G||G.length!=z.styles.length||se!=Ae&&(!se||!Ae||se.bgClass!=Ae.bgClass||se.textClass!=Ae.textClass),Ze=0;!Ie&&ZeE)return Ic(c,c.options.workDelay),!0}),d.highlightFrontier=N.line,d.modeFrontier=Math.max(d.modeFrontier,N.line),T.length&&bi(c,function(){for(var z=0;z=E.viewFrom&&d.visible.to<=E.viewTo&&(E.updateLineNumbers==null||E.updateLineNumbers>=E.viewTo)&&E.renderedView==E.view&&ag(c)==0)return!1;K1(c)&&(Pa(c),d.dims=Xl(c));var T=N.first+N.size,z=Math.max(d.visible.from-c.options.viewportMargin,N.first),G=Math.min(T,d.visible.to+c.options.viewportMargin);E.viewFromG&&E.viewTo-G<20&&(G=Math.min(T,E.viewTo)),Co&&(z=ou(c.doc,z),G=S1(c.doc,G));var te=z!=E.viewFrom||G!=E.viewTo||E.lastWrapHeight!=d.wrapperHeight||E.lastWrapWidth!=d.wrapperWidth;CN(c,z,G),E.viewOffset=Uo(zt(c.doc,E.viewFrom)),c.display.mover.style.top=E.viewOffset+"px";var oe=ag(c);if(!te&&oe==0&&!d.force&&E.renderedView==E.view&&(E.updateLineNumbers==null||E.updateLineNumbers>=E.viewTo))return!1;var se=_N(c);return oe>4&&(E.lineDiv.style.display="none"),kN(c,E.updateLineNumbers,d.dims),oe>4&&(E.lineDiv.style.display=""),E.renderedView=E.view,Z1(se),H(E.cursorDiv),H(E.selectionDiv),E.gutters.style.height=E.sizer.style.minHeight=0,te&&(E.lastWrapHeight=d.wrapperHeight,E.lastWrapWidth=d.wrapperWidth,Ic(c,400)),E.updateLineNumbers=null,!0}function X1(c,d){for(var E=d.viewport,N=!0;;N=!1){if(!N||!c.options.lineWrapping||d.oldDisplayWidth==uu(c)){if(E&&E.top!=null&&(E={top:Math.min(c.doc.height+wc(c.display)-gm(c),E.top)}),d.visible=Ir(c.display,c.doc,E),d.visible.from>=c.display.viewFrom&&d.visible.to<=c.display.viewTo)break}else N&&(d.visible=Ir(c.display,c.doc,E));if(!hg(c,d))break;Nm(c);var T=Tc(c);Ac(c),fu(c,T),Am(c,T),d.force=!1}d.signal(c,"update",c),(c.display.viewFrom!=c.display.reportedViewFrom||c.display.viewTo!=c.display.reportedViewTo)&&(d.signal(c,"viewportChange",c,c.display.viewFrom,c.display.viewTo),c.display.reportedViewFrom=c.display.viewFrom,c.display.reportedViewTo=c.display.viewTo)}function Em(c,d){var E=new Fc(c,d);if(hg(c,E)){Nm(c),X1(c,E);var N=Tc(c);Ac(c),fu(c,N),Am(c,N),E.finish()}}function kN(c,d,E){var N=c.display,T=c.options.lineNumbers,z=N.lineDiv,G=z.firstChild;function te(at){var mt=at.nextSibling;return a&&M&&c.display.currentWheelTarget==at?at.style.display="none":at.parentNode.removeChild(at),mt}for(var oe=N.view,se=N.viewFrom,Ae=0;Ae-1&&($e=!1),hm(c,Ie,se,E)),$e&&(H(Ie.lineNumber),Ie.lineNumber.appendChild(document.createTextNode(dt(c.options,se)))),G=Ie.node.nextSibling}se+=Ie.size}for(;G;)G=te(G)}function dg(c){var d=c.gutters.offsetWidth;c.sizer.style.marginLeft=d+"px",Wn(c,"gutterChanged",c)}function Am(c,d){c.display.sizer.style.minHeight=d.docHeight+"px",c.display.heightForcer.style.top=d.docHeight+"px",c.display.gutters.style.height=d.docHeight+c.display.barHeight+ua(c)+"px"}function gg(c){var d=c.display,E=d.view;if(!(!d.alignWidgets&&(!d.gutters.firstChild||!c.options.fixedGutter))){for(var N=Ec(d)-d.scroller.scrollLeft+c.doc.scrollLeft,T=d.gutters.offsetWidth,z=N+"px",G=0;G=105&&(T.wrapper.style.clipPath="inset(0px)"),T.wrapper.setAttribute("translate","no"),u&&l<8&&(T.gutters.style.zIndex=-1,T.scroller.style.paddingRight=0),!a&&!(r&&O)&&(T.scroller.draggable=!0),c&&(c.appendChild?c.appendChild(T.wrapper):c(T.wrapper)),T.viewFrom=T.viewTo=d.first,T.reportedViewFrom=T.reportedViewTo=d.first,T.view=[],T.renderedView=null,T.externalMeasured=null,T.viewOffset=0,T.lastWrapHeight=T.lastWrapWidth=0,T.updateLineNumbers=null,T.nativeBarWidth=T.barHeight=T.barWidth=0,T.scrollbarsClipped=!1,T.lineNumWidth=T.lineNumInnerWidth=T.lineNumChars=null,T.alignWidgets=!1,T.cachedCharWidth=T.cachedTextHeight=T.cachedPaddingH=null,T.maxLine=null,T.maxLineLength=0,T.maxLineChanged=!1,T.wheelDX=T.wheelDY=T.wheelStartX=T.wheelStartY=null,T.shift=!1,T.selForContextMenu=null,T.activeTouch=null,T.gutterSpecs=vg(N.gutters,N.lineNumbers),xg(T),E.init(T)}var kc=0,Ds=null;u?Ds=-.53:r?Ds=15:f?Ds=-.7:y&&(Ds=-1/3);function yg(c){var d=c.wheelDeltaX,E=c.wheelDeltaY;return d==null&&c.detail&&c.axis==c.HORIZONTAL_AXIS&&(d=c.detail),E==null&&c.detail&&c.axis==c.VERTICAL_AXIS?E=c.detail:E==null&&(E=c.wheelDelta),{x:d,y:E}}function LN(c){var d=yg(c);return d.x*=Ds,d.y*=Ds,d}function J1(c,d){f&&p==102&&(c.display.chromeScrollHack==null?c.display.sizer.style.pointerEvents="none":clearTimeout(c.display.chromeScrollHack),c.display.chromeScrollHack=setTimeout(function(){c.display.chromeScrollHack=null,c.display.sizer.style.pointerEvents=""},100));var E=yg(d),N=E.x,T=E.y,z=Ds;d.deltaMode===0&&(N=d.deltaX,T=d.deltaY,z=1);var G=c.display,te=G.scroller,oe=te.scrollWidth>te.clientWidth,se=te.scrollHeight>te.clientHeight;if(N&&oe||T&&se){if(T&&M&&a){e:for(var Ae=d.target,Ie=G.view;Ae!=te;Ae=Ae.parentNode)for(var Ze=0;Ze=0&&ke(c,N.to())<=0)return E}return-1};var Br=function(c,d){this.anchor=c,this.head=d};Br.prototype.from=function(){return nu(this.anchor,this.head)},Br.prototype.to=function(){return wi(this.anchor,this.head)},Br.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ho(c,d,E){var N=c&&c.options.selectionsMayTouch,T=d[E];d.sort(function(Ze,$e){return ke(Ze.from(),$e.from())}),E=Ee(d,T);for(var z=1;z0:oe>=0){var se=nu(te.from(),G.from()),Ae=wi(te.to(),G.to()),Ie=te.empty()?G.from()==G.head:te.from()==te.head;z<=E&&--E,d.splice(--z,2,new Br(Ie?Ae:se,Ie?se:Ae))}}return new Oo(d,E)}function cu(c,d){return new Oo([new Br(c,d||c)],0)}function pu(c){return c.text?rt(c.from.line+c.text.length-1,ge(c.text).length+(c.text.length==1?c.from.ch:0)):c.to}function il(c,d){if(ke(c,d.from)<0)return c;if(ke(c,d.to)<=0)return pu(d);var E=c.line+d.text.length-(d.to.line-d.from.line)-1,N=c.ch;return c.line==d.to.line&&(N+=pu(d).ch-d.to.ch),rt(E,N)}function Bc(c,d){for(var E=[],N=0;N1&&c.remove(te.line+1,at-1),c.insert(te.line+1,bt)}Wn(c,"change",c,d)}function Yn(c,d,E){function N(T,z,G){if(T.linked)for(var te=0;te1&&!c.done[c.done.length-2].ranges)return c.done.pop(),ge(c.done)}function ex(c,d,E,N){var T=c.history;T.undone.length=0;var z=+new Date,G,te;if((T.lastOp==N||T.lastOrigin==d.origin&&d.origin&&(d.origin.charAt(0)=="+"&&T.lastModTime>z-(c.cm?c.cm.options.historyEventDelay:500)||d.origin.charAt(0)=="*"))&&(G=Tm(T,T.lastOp==N)))te=ge(G.changes),ke(d.from,d.to)==0&&ke(d.from,te.to)==0?te.to=pu(d):G.changes.push(ol(c,d));else{var oe=ge(T.done);for((!oe||!oe.ranges)&&Rc(c.sel,T.done),G={changes:[ol(c,d)],generation:T.generation},T.done.push(G);T.done.length>T.undoDepth;)T.done.shift(),T.done[0].ranges||T.done.shift()}T.done.push(E),T.generation=++T.maxGeneration,T.lastModTime=T.lastSelTime=z,T.lastOp=T.lastSelOp=N,T.lastOrigin=T.lastSelOrigin=d.origin,te||je(c,"historyAdded")}function RN(c,d,E,N){var T=d.charAt(0);return T=="*"||T=="+"&&E.ranges.length==N.ranges.length&&E.somethingSelected()==N.somethingSelected()&&new Date-c.history.lastSelTime<=(c.cm?c.cm.options.historyEventDelay:500)}function qN(c,d,E,N){var T=c.history,z=N&&N.origin;E==T.lastSelOp||z&&T.lastSelOrigin==z&&(T.lastModTime==T.lastSelTime&&T.lastOrigin==z||RN(c,z,ge(T.done),d))?T.done[T.done.length-1]=d:Rc(d,T.done),T.lastSelTime=+new Date,T.lastSelOrigin=z,T.lastSelOp=E,N&&N.clearRedo!==!1&&of(T.undone)}function Rc(c,d){var E=ge(d);E&&E.ranges&&E.equals(c)||d.push(c)}function bg(c,d,E,N){var T=d["spans_"+c.id],z=0;c.iter(Math.max(c.first,E),Math.min(c.first+c.size,N),function(G){G.markedSpans&&((T||(T=d["spans_"+c.id]={}))[z]=G.markedSpans),++z})}function zN(c){if(!c)return null;for(var d,E=0;E-1&&(ge(te)[Ie]=se[Ie],delete se[Ie])}}return N}function Dg(c,d,E,N){if(N){var T=c.anchor;if(E){var z=ke(d,T)<0;z!=ke(E,T)<0?(T=d,d=E):z!=ke(d,E)<0&&(d=E)}return new Br(T,d)}else return new Br(E||d,d)}function Om(c,d,E,N,T){T==null&&(T=c.cm&&(c.cm.display.shift||c.extend)),ci(c,new Oo([Dg(c.sel.primary(),d,E,T)],0),N)}function Ng(c,d,E){for(var N=[],T=c.cm&&(c.cm.display.shift||c.extend),z=0;z=d.ch:te.to>d.ch))){if(T&&(je(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(z.markedSpans){--G;continue}else break;if(!oe.atomic)continue;if(E){var Ie=oe.find(N<0?1:-1),Ze=void 0;if((N<0?Ae:se)&&(Ie=qc(c,Ie,-N,Ie&&Ie.line==d.line?z:null)),Ie&&Ie.line==d.line&&(Ze=ke(Ie,E))&&(N<0?Ze<0:Ze>0))return sf(c,Ie,d,N,T)}var $e=oe.find(N<0?-1:1);return(N<0?se:Ae)&&($e=qc(c,$e,N,$e.line==d.line?z:null)),$e?sf(c,$e,d,N,T):null}}return d}function Im(c,d,E,N,T){var z=N||1,G=sf(c,d,E,z,T)||!T&&sf(c,d,E,z,!0)||sf(c,d,E,-z,T)||!T&&sf(c,d,E,-z,!0);return G||(c.cantEdit=!0,rt(c.first,0))}function qc(c,d,E,N){return E<0&&d.ch==0?d.line>c.first?Tt(c,rt(d.line-1)):null:E>0&&d.ch==(N||zt(c,d.line)).text.length?d.line=0;--T)Tg(c,{from:N[T].from,to:N[T].to,text:T?[""]:d.text,origin:d.origin});else Tg(c,d)}}function Tg(c,d){if(!(d.text.length==1&&d.text[0]==""&&ke(d.from,d.to)==0)){var E=Bc(c,d);ex(c,d,E,c.cm?c.cm.curOp.id:NaN),al(c,d,E,Ht(c,d));var N=[];Yn(c,function(T,z){!z&&Ee(N,T.history)==-1&&(Og(T.history,d),N.push(T.history)),al(T,d,null,Ht(T,d))})}}function zc(c,d,E){var N=c.cm&&c.cm.state.suppressEdits;if(!(N&&!E)){for(var T=c.history,z,G=c.sel,te=d=="undo"?T.done:T.undone,oe=d=="undo"?T.undone:T.done,se=0;se=0;--$e){var at=Ze($e);if(at)return at.v}}}}function Uc(c,d){if(d!=0&&(c.first+=d,c.sel=new Oo(Re(c.sel.ranges,function(T){return new Br(rt(T.anchor.line+d,T.anchor.ch),rt(T.head.line+d,T.head.ch))}),c.sel.primIndex),c.cm)){Ji(c.cm,c.first,c.first-d,d);for(var E=c.cm.display,N=E.viewFrom;Nc.lastLine())){if(d.from.linez&&(d={from:d.from,to:rt(z,zt(c,z).text.length),text:[d.text[0]],origin:d.origin}),d.removed=oa(c,d.from,d.to),E||(E=Bc(c,d)),c.cm?HN(c.cm,d,N):wg(c,d,N),du(c,E,Le),c.cantEdit&&Im(c,rt(c.firstLine(),0))&&(c.cantEdit=!1)}}function HN(c,d,E){var N=c.doc,T=c.display,z=d.from,G=d.to,te=!1,oe=z.line;c.options.lineWrapping||(oe=ue(sa(zt(N,z.line))),N.iter(oe,G.line+1,function($e){if($e==T.maxLine)return te=!0,!0})),N.sel.contains(d.from,d.to)>-1&&Bt(c),wg(N,d,E,Kl(c)),c.options.lineWrapping||(N.iter(oe,z.line+d.text.length,function($e){var at=cm($e);at>T.maxLineLength&&(T.maxLine=$e,T.maxLineLength=at,T.maxLineChanged=!0,te=!1)}),te&&(c.curOp.updateMaxLine=!0)),um(N,z.line),Ic(c,400);var se=d.text.length-(G.line-z.line)-1;d.full?Ji(c):z.line==G.line&&d.text.length==1&&!Q1(c.doc,d)?ys(c,z.line,"text"):Ji(c,z.line,G.line+1,se);var Ae=fr(c,"changes"),Ie=fr(c,"change");if(Ie||Ae){var Ze={from:z,to:G,text:d.text,removed:d.removed,origin:d.origin};Ie&&Wn(c,"change",c,Ze),Ae&&(c.curOp.changeObjs||(c.curOp.changeObjs=[])).push(Ze)}c.display.selForContextMenu=null}function $o(c,d,E,N,T){var z;N||(N=E),ke(N,E)<0&&(z=[N,E],E=z[0],N=z[1]),typeof d=="string"&&(d=c.splitLines(d)),Ns(c,{from:E,to:N,text:d,origin:T})}function ox(c,d,E,N){E1||!(this.children[0]instanceof uf))){var te=[];this.collapse(te),this.children=[new uf(te)],this.children[0].parent=this}},collapse:function(c){for(var d=0;d50){for(var G=T.lines.length%25+25,te=G;te10);c.parent.maybeSpill()}},iterN:function(c,d,E){for(var N=0;Nc.display.maxLineLength&&(c.display.maxLine=se,c.display.maxLineLength=Ae,c.display.maxLineChanged=!0)}N!=null&&c&&this.collapsed&&Ji(c,N,T+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,c&&nx(c.doc)),c&&Wn(c,"markerCleared",c,this,N,T),d&&bs(c),this.parent&&this.parent.clear()}},Io.prototype.find=function(c,d){c==null&&this.type=="bookmark"&&(c=1);for(var E,N,T=0;T0||G==0&&z.clearWhenEmpty!==!1)return z;if(z.replacedWith&&(z.collapsed=!0,z.widgetNode=ee("span",[z.replacedWith],"CodeMirror-widget"),N.handleMouseEvents||z.widgetNode.setAttribute("cm-ignore-events","true"),N.insertLeft&&(z.widgetNode.insertLeft=!0)),z.collapsed){if(N1(c,d.line,d,E,z)||d.line!=E.line&&N1(c,E.line,d,E,z))throw new Error("Inserting collapsed marker partially overlapping an existing one");Vu()}z.addToHistory&&ex(c,{from:d,to:E,origin:"markText"},c.sel,NaN);var te=d.line,oe=c.cm,se;if(c.iter(te,E.line+1,function(Ie){oe&&z.collapsed&&!oe.options.lineWrapping&&sa(Ie)==oe.display.maxLine&&(se=!0),z.collapsed&&te!=d.line&&$n(Ie,0),tn(Ie,new dc(z,te==d.line?d.ch:null,te==E.line?E.ch:null),c.cm&&c.cm.curOp),++te}),z.collapsed&&c.iter(d.line,E.line+1,function(Ie){Zi(c,Ie)&&$n(Ie,0)}),z.clearOnEnter&&X(z,"beforeCursorEnter",function(){return z.clear()}),z.readOnly&&(vN(),(c.history.done.length||c.history.undone.length)&&c.clearHistory()),z.collapsed&&(z.id=++Fm,z.atomic=!0),oe){if(se&&(oe.curOp.updateMaxLine=!0),z.collapsed)Ji(oe,d.line,E.line+1);else if(z.className||z.startStyle||z.endStyle||z.css||z.attributes||z.title)for(var Ae=d.line;Ae<=E.line;Ae++)ys(oe,Ae,"text");z.atomic&&nx(oe.doc),Wn(oe,"markerAdded",oe,z)}return z}var Ss=function(c,d){this.markers=c,this.primary=d;for(var E=0;E=0;oe--)Ns(this,N[oe]);te?Ag(this,te):this.cm&&ef(this.cm)}),undo:Gn(function(){zc(this,"undo")}),redo:Gn(function(){zc(this,"redo")}),undoSelection:Gn(function(){zc(this,"undo",!0)}),redoSelection:Gn(function(){zc(this,"redo",!0)}),setExtending:function(c){this.extend=c},getExtending:function(){return this.extend},historySize:function(){for(var c=this.history,d=0,E=0,N=0;N=c.ch)&&d.push(T.marker.parent||T.marker)}return d},findMarks:function(c,d,E){c=Tt(this,c),d=Tt(this,d);var N=[],T=c.line;return this.iter(c.line,d.line+1,function(z){var G=z.markedSpans;if(G)for(var te=0;te=oe.to||oe.from==null&&T!=c.line||oe.from!=null&&T==d.line&&oe.from>=d.ch)&&(!E||E(oe.marker))&&N.push(oe.marker.parent||oe.marker)}++T}),N},getAllMarks:function(){var c=[];return this.iter(function(d){var E=d.markedSpans;if(E)for(var N=0;Nc)return d=c,!0;c-=z,++E}),Tt(this,rt(E,d))},indexFromPos:function(c){c=Tt(this,c);var d=c.ch;if(c.lined&&(d=c.from),c.to!=null&&c.to-1){d.state.draggingText(c),setTimeout(function(){return d.display.input.focus()},20);return}try{var Ae=c.dataTransfer.getData("Text");if(Ae){var Ie;if(d.state.draggingText&&!d.state.draggingText.copy&&(Ie=d.listSelections()),du(d.doc,cu(E,E)),Ie)for(var Ze=0;Ze=0;te--)$o(c.doc,"",N[te].from,N[te].to,"+delete");ef(c)})}function _g(c,d,E){var N=ne(c.text,d+E,E);return N<0||N>c.text.length?null:N}function kg(c,d,E){var N=_g(c,d.ch,E);return N==null?null:new rt(d.line,N,E<0?"after":"before")}function Bg(c,d,E,N,T){if(c){d.doc.direction=="rtl"&&(T=-T);var z=Xe(E,d.doc.direction);if(z){var G=T<0?ge(z):z[0],te=T<0==(G.level==1),oe=te?"after":"before",se;if(G.level>0||d.doc.direction=="rtl"){var Ae=Ku(d,E);se=T<0?E.text.length-1:0;var Ie=To(d,Ae,se).top;se=me(function(Ze){return To(d,Ae,Ze).top==Ie},T<0==(G.level==1)?G.from:G.to-1,se),oe=="before"&&(se=_g(E,se,1))}else se=T<0?G.to:G.from;return new rt(N,se,oe)}}return new rt(N,T<0?E.text.length:0,T<0?"before":"after")}function YN(c,d,E,N){var T=Xe(d,c.doc.direction);if(!T)return kg(d,E,N);E.ch>=d.text.length?(E.ch=d.text.length,E.sticky="before"):E.ch<=0&&(E.ch=0,E.sticky="after");var z=Je(T,E.ch,E.sticky),G=T[z];if(c.doc.direction=="ltr"&&G.level%2==0&&(N>0?G.to>E.ch:G.from=G.from&&Ze>=Ae.begin)){var $e=Ie?"before":"after";return new rt(E.line,Ze,$e)}}var at=function(bt,At,Dt){for(var It=function(Yr,ai){return ai?new rt(E.line,te(Yr,1),"before"):new rt(E.line,Yr,"after")};bt>=0&&bt0==(Yt.level!=1),sr=Vt?Dt.begin:te(Dt.end,-1);if(Yt.from<=sr&&sr0?Ae.end:te(Ae.begin,-1);return yt!=null&&!(N>0&&yt==d.text.length)&&(mt=at(N>0?0:T.length-1,N,se(yt)),mt)?mt:null}var Zc={selectAll:ix,singleSelection:function(c){return c.setSelection(c.getCursor("anchor"),c.getCursor("head"),Le)},killLine:function(c){return hf(c,function(d){if(d.empty()){var E=zt(c.doc,d.head.line).text.length;return d.head.ch==E&&d.head.line0)T=new rt(T.line,T.ch+1),c.replaceRange(z.charAt(T.ch-1)+z.charAt(T.ch-2),rt(T.line,T.ch-2),T,"+transpose");else if(T.line>c.doc.first){var G=zt(c.doc,T.line-1).text;G&&(T=new rt(T.line,1),c.replaceRange(z.charAt(0)+c.doc.lineSeparator()+G.charAt(G.length-1),rt(T.line-1,G.length-1),T,"+transpose"))}}E.push(new Br(T,T))}c.setSelections(E)})},newlineAndIndent:function(c){return bi(c,function(){for(var d=c.listSelections(),E=d.length-1;E>=0;E--)c.replaceRange(c.doc.lineSeparator(),d[E].anchor,d[E].head,"+input");d=c.listSelections();for(var N=0;Nc&&ke(d,this.pos)==0&&E==this.button};var Jc,Qc;function Nx(c,d){var E=+new Date;return Qc&&Qc.compare(E,c,d)?(Jc=Qc=null,"triple"):Jc&&Jc.compare(E,c,d)?(Qc=new Bm(E,c,d),Jc=null,"double"):(Jc=new Bm(E,c,d),Qc=null,"single")}function Sx(c){var d=this,E=d.display;if(!(wt(d,c)||E.activeTouch&&E.input.supportsTouch())){if(E.input.ensurePolled(),E.shift=c.shiftKey,La(E,c)){a||(E.scroller.draggable=!1,setTimeout(function(){return E.scroller.draggable=!0},100));return}if(!zg(d,c)){var N=fa(d,c),T=_n(c),z=N?Nx(N,T):"single";Se(d).focus(),T==1&&d.state.selectingText&&d.state.selectingText(c),!(N&&Ex(d,T,N,z,c))&&(T==1?N?Lm(d,N,z,c):Er(c)==E.scroller&&Gt(c):T==2?(N&&Om(d.doc,N),setTimeout(function(){return E.input.focus()},20)):T==3&&(R?d.display.input.onContextMenu(c):jl(d)))}}}function Ex(c,d,E,N,T){var z="Click";return N=="double"?z="Double"+z:N=="triple"&&(z="Triple"+z),z=(d==1?"Left":d==2?"Middle":"Right")+z,Xc(c,gx(z,T),T,function(G){if(typeof G=="string"&&(G=Zc[G]),!G)return!1;var te=!1;try{c.isReadOnly()&&(c.state.suppressEdits=!0),te=G(c,E)!=We}finally{c.state.suppressEdits=!1}return te})}function Ax(c,d,E){var N=c.getOption("configureMouse"),T=N?N(c,d,E):{};if(T.unit==null){var z=I?E.shiftKey&&E.metaKey:E.altKey;T.unit=z?"rectangle":d=="single"?"char":d=="double"?"word":"line"}return(T.extend==null||c.doc.extend)&&(T.extend=c.doc.extend||E.shiftKey),T.addNew==null&&(T.addNew=M?E.metaKey:E.ctrlKey),T.moveOnDrag==null&&(T.moveOnDrag=!(M?E.altKey:E.ctrlKey)),T}function Lm(c,d,E,N){u?setTimeout(Pe(ug,c),0):c.curOp.focus=Z(we(c));var T=Ax(c,E,N),z=c.doc.sel,G;c.options.dragDrop&&_a&&!c.isReadOnly()&&E=="single"&&(G=z.contains(d))>-1&&(ke((G=z.ranges[G]).from(),d)<0||d.xRel>0)&&(ke(G.to(),d)>0||d.xRel<0)?jN(c,N,d,T):eS(c,N,d,T)}function jN(c,d,E,N){var T=c.display,z=!1,G=oi(c,function(se){a&&(T.scroller.draggable=!1),c.state.draggingText=!1,c.state.delayingBlurEvent&&(c.hasFocus()?c.state.delayingBlurEvent=!1:jl(c)),Ye(T.wrapper.ownerDocument,"mouseup",G),Ye(T.wrapper.ownerDocument,"mousemove",te),Ye(T.scroller,"dragstart",oe),Ye(T.scroller,"drop",G),z||(Gt(se),N.addNew||Om(c.doc,E,null,null,N.extend),a&&!y||u&&l==9?setTimeout(function(){T.wrapper.ownerDocument.body.focus({preventScroll:!0}),T.input.focus()},20):T.input.focus())}),te=function(se){z=z||Math.abs(d.clientX-se.clientX)+Math.abs(d.clientY-se.clientY)>=10},oe=function(){return z=!0};a&&(T.scroller.draggable=!0),c.state.draggingText=G,G.copy=!N.moveOnDrag,X(T.wrapper.ownerDocument,"mouseup",G),X(T.wrapper.ownerDocument,"mousemove",te),X(T.scroller,"dragstart",oe),X(T.scroller,"drop",G),c.state.delayingBlurEvent=!0,setTimeout(function(){return T.input.focus()},20),T.scroller.dragDrop&&T.scroller.dragDrop()}function Cx(c,d,E){if(E=="char")return new Br(d,d);if(E=="word")return c.findWordAt(d);if(E=="line")return new Br(rt(d.line,0),Tt(c.doc,rt(d.line+1,0)));var N=E(c,d);return new Br(N.from,N.to)}function eS(c,d,E,N){u&&jl(c);var T=c.display,z=c.doc;Gt(d);var G,te,oe=z.sel,se=oe.ranges;if(N.addNew&&!N.extend?(te=z.sel.contains(E),te>-1?G=se[te]:G=new Br(E,E)):(G=z.sel.primary(),te=z.sel.primIndex),N.unit=="rectangle")N.addNew||(G=new Br(E,E)),E=fa(c,d,!0,!0),te=-1;else{var Ae=Cx(c,E,N.unit);N.extend?G=Dg(G,Ae.anchor,Ae.head,N.extend):G=Ae}N.addNew?te==-1?(te=se.length,ci(z,Ho(c,se.concat([G]),te),{scroll:!1,origin:"*mouse"})):se.length>1&&se[te].empty()&&N.unit=="char"&&!N.extend?(ci(z,Ho(c,se.slice(0,te).concat(se.slice(te+1)),0),{scroll:!1,origin:"*mouse"}),oe=z.sel):Sg(z,te,G,lt):(te=0,ci(z,new Oo([G],0),lt),oe=z.sel);var Ie=E;function Ze(Dt){if(ke(Ie,Dt)!=0)if(Ie=Dt,N.unit=="rectangle"){for(var It=[],Yt=c.options.tabSize,Vt=Oe(zt(z,E.line).text,E.ch,Yt),sr=Oe(zt(z,Dt.line).text,Dt.ch,Yt),Yr=Math.min(Vt,sr),ai=Math.max(Vt,sr),dn=Math.min(E.line,Dt.line),Zn=Math.min(c.lastLine(),Math.max(E.line,Dt.line));dn<=Zn;dn++){var _i=zt(z,dn).text,Ln=de(_i,Yr,Yt);Yr==ai?It.push(new Br(rt(dn,Ln),rt(dn,Ln))):_i.length>Ln&&It.push(new Br(rt(dn,Ln),rt(dn,de(_i,ai,Yt))))}It.length||It.push(new Br(E,E)),ci(z,Ho(c,oe.ranges.slice(0,te).concat(It),te),{origin:"*mouse",scroll:!1}),c.scrollIntoView(Dt)}else{var ji=G,mi=Cx(c,Dt,N.unit),Xn=ji.anchor,Pn;ke(mi.anchor,Xn)>0?(Pn=mi.head,Xn=nu(ji.from(),mi.anchor)):(Pn=mi.anchor,Xn=wi(ji.to(),mi.head));var vn=oe.ranges.slice(0);vn[te]=tS(c,new Br(Tt(z,Xn),Pn)),ci(z,Ho(c,vn,te),lt)}}var $e=T.wrapper.getBoundingClientRect(),at=0;function mt(Dt){var It=++at,Yt=fa(c,Dt,!0,N.unit=="rectangle");if(Yt)if(ke(Yt,Ie)!=0){c.curOp.focus=Z(we(c)),Ze(Yt);var Vt=Ir(T,z);(Yt.line>=Vt.to||Yt.line$e.bottom?20:0;sr&&setTimeout(oi(c,function(){at==It&&(T.scroller.scrollTop+=sr,mt(Dt))}),50)}}function yt(Dt){c.state.selectingText=!1,at=1/0,Dt&&(Gt(Dt),T.input.focus()),Ye(T.wrapper.ownerDocument,"mousemove",bt),Ye(T.wrapper.ownerDocument,"mouseup",At),z.history.lastSelOrigin=null}var bt=oi(c,function(Dt){Dt.buttons===0||!_n(Dt)?yt(Dt):mt(Dt)}),At=oi(c,yt);c.state.selectingText=At,X(T.wrapper.ownerDocument,"mousemove",bt),X(T.wrapper.ownerDocument,"mouseup",At)}function tS(c,d){var E=d.anchor,N=d.head,T=zt(c.doc,E.line);if(ke(E,N)==0&&E.sticky==N.sticky)return d;var z=Xe(T);if(!z)return d;var G=Je(z,E.ch,E.sticky),te=z[G];if(te.from!=E.ch&&te.to!=E.ch)return d;var oe=G+(te.from==E.ch==(te.level!=1)?0:1);if(oe==0||oe==z.length)return d;var se;if(N.line!=E.line)se=(N.line-E.line)*(c.doc.direction=="ltr"?1:-1)>0;else{var Ae=Je(z,N.ch,N.sticky),Ie=Ae-G||(N.ch-E.ch)*(te.level==1?-1:1);Ae==oe-1||Ae==oe?se=Ie<0:se=Ie>0}var Ze=z[oe+(se?-1:0)],$e=se==(Ze.level==1),at=$e?Ze.from:Ze.to,mt=$e?"after":"before";return E.ch==at&&E.sticky==mt?d:new Br(new rt(E.line,at,mt),N)}function qg(c,d,E,N){var T,z;if(d.touches)T=d.touches[0].clientX,z=d.touches[0].clientY;else try{T=d.clientX,z=d.clientY}catch{return!1}if(T>=Math.floor(c.display.gutters.getBoundingClientRect().right))return!1;N&&Gt(d);var G=c.display,te=G.lineDiv.getBoundingClientRect();if(z>te.bottom||!fr(c,E))return rr(d);z-=te.top-G.viewOffset;for(var oe=0;oe=T){var Ae=Me(c.doc,z),Ie=c.display.gutterSpecs[oe];return je(c,E,c,Ae,Ie.className,d),rr(d)}}}function zg(c,d){return qg(c,d,"gutterClick",!0)}function Mx(c,d){La(c.display,d)||Tx(c,d)||wt(c,d,"contextmenu")||R||c.display.input.onContextMenu(d)}function Tx(c,d){return fr(c,"gutterContextMenu")?qg(c,d,"gutterContextMenu",!1):!1}function pi(c){c.display.wrapper.className=c.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+c.options.theme.replace(/(^|\s)\s*/g," cm-s-"),bc(c)}var ll={toString:function(){return"CodeMirror.Init"}},Ox={},Pm={};function rS(c){var d=c.optionHandlers;function E(N,T,z,G){c.defaults[N]=T,z&&(d[N]=G?function(te,oe,se){se!=ll&&z(te,oe,se)}:z)}c.defineOption=E,c.Init=ll,E("value","",function(N,T){return N.setValue(T)},!0),E("mode",null,function(N,T){N.doc.modeOption=T,Mm(N)},!0),E("indentUnit",2,Mm,!0),E("indentWithTabs",!1),E("smartIndent",!0),E("tabSize",4,function(N){Lc(N),bc(N),Ji(N)},!0),E("lineSeparator",null,function(N,T){if(N.doc.lineSep=T,!!T){var z=[],G=N.doc.first;N.doc.iter(function(oe){for(var se=0;;){var Ae=oe.text.indexOf(T,se);if(Ae==-1)break;se=Ae+T.length,z.push(rt(G,Ae))}G++});for(var te=z.length-1;te>=0;te--)$o(N.doc,T,z[te],rt(z[te].line,z[te].ch+T.length))}}),E("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(N,T,z){N.state.specialChars=new RegExp(T.source+(T.test(" ")?"":"| "),"g"),z!=ll&&N.refresh()}),E("specialCharPlaceholder",wN,function(N){return N.refresh()},!0),E("electricChars",!0),E("inputStyle",O?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),E("spellcheck",!1,function(N,T){return N.getInputField().spellcheck=T},!0),E("autocorrect",!1,function(N,T){return N.getInputField().autocorrect=T},!0),E("autocapitalize",!1,function(N,T){return N.getInputField().autocapitalize=T},!0),E("rtlMoveVisually",!F),E("wholeLineUpdateBefore",!0),E("theme","default",function(N){pi(N),_c(N)},!0),E("keyMap","default",function(N,T,z){var G=Yc(T),te=z!=ll&&Yc(z);te&&te.detach&&te.detach(N,G),G.attach&&G.attach(N,te||null)}),E("extraKeys",null),E("configureMouse",null),E("lineWrapping",!1,nS,!0),E("gutters",[],function(N,T){N.display.gutterSpecs=vg(T,N.options.lineNumbers),_c(N)},!0),E("fixedGutter",!0,function(N,T){N.display.gutters.style.left=T?Ec(N.display)+"px":"0",N.refresh()},!0),E("coverGutterNextToScrollbar",!1,function(N){return fu(N)},!0),E("scrollbarStyle","native",function(N){V1(N),fu(N),N.display.scrollbars.setScrollTop(N.doc.scrollTop),N.display.scrollbars.setScrollLeft(N.doc.scrollLeft)},!0),E("lineNumbers",!1,function(N,T){N.display.gutterSpecs=vg(N.options.gutters,T),_c(N)},!0),E("firstLineNumber",1,_c,!0),E("lineNumberFormatter",function(N){return N},_c,!0),E("showCursorWhenSelecting",!1,Ac,!0),E("resetSelectionOnContextMenu",!0),E("lineWiseCopyCut",!0),E("pasteLinesPerSelection",!0),E("selectionsMayTouch",!1),E("readOnly",!1,function(N,T){T=="nocursor"&&(ju(N),N.display.input.blur()),N.display.input.readOnlyChanged(T)}),E("screenReaderLabel",null,function(N,T){T=T===""?null:T,N.display.input.screenReaderLabelChanged(T)}),E("disableInput",!1,function(N,T){T||N.display.input.reset()},!0),E("dragDrop",!0,Ix),E("allowDropFileTypes",null),E("cursorBlinkRate",530),E("cursorScrollMargin",0),E("cursorHeight",1,Ac,!0),E("singleCursorHeightPerLine",!0,Ac,!0),E("workTime",100),E("workDelay",100),E("flattenSpans",!0,Lc,!0),E("addModeClass",!1,Lc,!0),E("pollInterval",100),E("undoDepth",200,function(N,T){return N.doc.history.undoDepth=T}),E("historyEventDelay",1250),E("viewportMargin",10,function(N){return N.refresh()},!0),E("maxHighlightLength",1e4,Lc,!0),E("moveInputWithCursor",!0,function(N,T){T||N.display.input.resetPosition()}),E("tabindex",null,function(N,T){return N.display.input.getField().tabIndex=T||""}),E("autofocus",null),E("direction","ltr",function(N,T){return N.doc.setDirection(T)},!0),E("phrases",null)}function Ix(c,d,E){var N=E&&E!=ll;if(!d!=!N){var T=c.display.dragFunctions,z=d?X:Ye;z(c.display.scroller,"dragstart",T.start),z(c.display.scroller,"dragenter",T.enter),z(c.display.scroller,"dragover",T.over),z(c.display.scroller,"dragleave",T.leave),z(c.display.scroller,"drop",T.drop)}}function nS(c){c.options.lineWrapping?(le(c.display.wrapper,"CodeMirror-wrap"),c.display.sizer.style.minWidth="",c.display.sizerWidth=null):(U(c.display.wrapper,"CodeMirror-wrap"),Gd(c)),wm(c),Ji(c),bc(c),setTimeout(function(){return fu(c)},100)}function un(c,d){var E=this;if(!(this instanceof un))return new un(c,d);this.options=d=d?Ce(d):{},Ce(Ox,d,!1);var N=d.value;typeof N=="string"?N=new Qi(N,d.mode,null,d.lineSeparator,d.direction):d.mode&&(N.modeOption=d.mode),this.doc=N;var T=new un.inputStyles[d.inputStyle](this),z=this.display=new BN(c,N,T,d);z.wrapper.CodeMirror=this,pi(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),V1(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new He,keySeq:null,specialChars:null},d.autofocus&&!O&&z.input.focus(),u&&l<11&&setTimeout(function(){return E.display.input.reset(!0)},20),iS(this),px(),rl(this),this.curOp.forceUpdate=!0,j1(this,N),d.autofocus&&!O||this.hasFocus()?setTimeout(function(){E.hasFocus()&&!E.state.focused&&Dm(E)},20):ju(this);for(var G in Pm)Pm.hasOwnProperty(G)&&Pm[G](this,d[G],ll);K1(this),d.finishInit&&d.finishInit(this);for(var te=0;te20*20}X(d.scroller,"touchstart",function(oe){if(!wt(c,oe)&&!z(oe)&&!zg(c,oe)){d.input.ensurePolled(),clearTimeout(E);var se=+new Date;d.activeTouch={start:se,moved:!1,prev:se-N.end<=300?N:null},oe.touches.length==1&&(d.activeTouch.left=oe.touches[0].pageX,d.activeTouch.top=oe.touches[0].pageY)}}),X(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)}),X(d.scroller,"touchend",function(oe){var se=d.activeTouch;if(se&&!La(d,oe)&&se.left!=null&&!se.moved&&new Date-se.start<300){var Ae=c.coordsChar(d.activeTouch,"page"),Ie;!se.prev||G(se,se.prev)?Ie=new Br(Ae,Ae):!se.prev.prev||G(se,se.prev.prev)?Ie=c.findWordAt(Ae):Ie=new Br(rt(Ae.line,0),Tt(c.doc,rt(Ae.line+1,0))),c.setSelection(Ie.anchor,Ie.head),c.focus(),Gt(oe)}T()}),X(d.scroller,"touchcancel",T),X(d.scroller,"scroll",function(){d.scroller.clientHeight&&(ws(c,d.scroller.scrollTop),el(c,d.scroller.scrollLeft,!0),je(c,"scroll",c))}),X(d.scroller,"mousewheel",function(oe){return J1(c,oe)}),X(d.scroller,"DOMMouseScroll",function(oe){return J1(c,oe)}),X(d.wrapper,"scroll",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0}),d.dragFunctions={enter:function(oe){wt(c,oe)||ao(oe)},over:function(oe){wt(c,oe)||(fx(c,oe),ao(oe))},start:function(oe){return VN(c,oe)},drop:oi(c,lx),leave:function(oe){wt(c,oe)||Fg(c)}};var te=d.input.getField();X(te,"keyup",function(oe){return bx.call(c,oe)}),X(te,"keydown",oi(c,Kc)),X(te,"keypress",oi(c,Dx)),X(te,"focus",function(oe){return Dm(c,oe)}),X(te,"blur",function(oe){return ju(c,oe)})}var Rm=[];un.defineInitHook=function(c){return Rm.push(c)};function df(c,d,E,N){var T=c.doc,z;E==null&&(E="add"),E=="smart"&&(T.mode.indent?z=jr(c,d).state:E="prev");var G=c.options.tabSize,te=zt(T,d),oe=Oe(te.text,null,G);te.stateAfter&&(te.stateAfter=null);var se=te.text.match(/^\s*/)[0],Ae;if(!N&&!/\S/.test(te.text))Ae=0,E="not";else if(E=="smart"&&(Ae=T.mode.indent(z,te.text.slice(se.length),te.text),Ae==We||Ae>150)){if(!N)return;E="prev"}E=="prev"?d>T.first?Ae=Oe(zt(T,d-1).text,null,G):Ae=0:E=="add"?Ae=oe+c.options.indentUnit:E=="subtract"?Ae=oe-c.options.indentUnit:typeof E=="number"&&(Ae=oe+E),Ae=Math.max(0,Ae);var Ie="",Ze=0;if(c.options.indentWithTabs)for(var $e=Math.floor(Ae/G);$e;--$e)Ze+=G,Ie+=" ";if(ZeG,oe=ni(d),se=null;if(te&&N.ranges.length>1)if(pa&&pa.text.join(` +`)==d){if(N.ranges.length%pa.text.length==0){se=[];for(var Ae=0;Ae=0;Ze--){var $e=N.ranges[Ze],at=$e.from(),mt=$e.to();$e.empty()&&(E&&E>0?at=rt(at.line,at.ch-E):c.state.overwrite&&!te?mt=rt(mt.line,Math.min(zt(z,mt.line).text.length,mt.ch+ge(oe).length)):te&&pa&&pa.lineWise&&pa.text.join(` `)==oe.join(` -`)&&(at=mt=rt(at.line,0)));var xt={from:at,to:mt,text:se?se[Ze%se.length]:oe,origin:T||(te?"paste":c.state.cutIncoming>G?"cut":"+input")};Es(c.doc,xt),Wn(c,"inputRead",c,xt)}d&&!te&&_y(c,d),jl(c),c.curOp.updateInput<2&&(c.curOp.updateInput=Ie),c.curOp.typing=!0,c.state.pasteIncoming=c.state.cutIncoming=-1}function Fy(c,d){var S=c.clipboardData&&c.clipboardData.getData("Text");if(S)return c.preventDefault(),!d.isReadOnly()&&!d.options.disableInput&&d.hasFocus()&&bi(d,function(){return zm(d,S,0,null,"paste")}),!0}function _y(c,d){if(!(!c.options.electricChars||!c.options.smartIndent))for(var S=c.doc.sel,N=S.ranges.length-1;N>=0;N--){var T=S.ranges[N];if(!(T.head.ch>100||N&&S.ranges[N-1].head.line==T.head.line)){var z=c.getModeAt(T.head),G=!1;if(z.electricChars){for(var te=0;te-1){G=hf(c,T.head.line,"smart");break}}else z.electricInput&&z.electricInput.test(zt(c.doc,T.head.line).text.slice(0,T.head.ch))&&(G=hf(c,T.head.line,"smart"));G&&Wn(c,"electricInput",c,T.head.line)}}}function ky(c){for(var d=[],S=[],N=0;Nz&&(hf(this,te.head.line,N,!0),z=te.head.line,G==this.doc.sel.primIndex&&jl(this));else{var oe=te.from(),se=te.to(),Ae=Math.max(z,oe.line);z=Math.min(this.lastLine(),se.line-(se.ch?0:1))+1;for(var Ie=Ae;Ie0&&Sg(this.doc,G,new Br(oe,Ze[G].to()),Le)}}}),getTokenAt:function(N,T){return pc(this,N,T)},getLineTokens:function(N,T){return pc(this,rt(N),T,!0)},getTokenTypeAt:function(N){N=Tt(this.doc,N);var T=b1(this,zt(this.doc,N.line)),z=0,G=(T.length-1)/2,te=N.ch,oe;if(te==0)oe=T[2];else for(;;){var se=z+G>>1;if((se?T[se*2-1]:0)>=te)G=se;else if(T[se*2+1]oe&&(N=oe,G=!0),te=zt(this.doc,N)}else te=N;return Dc(this,te,{top:0,left:0},T||"page",z||G).top+(G?this.doc.height-Uo(te):0)},defaultTextHeight:function(){return la(this.display)},defaultCharWidth:function(){return xs(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(N,T,z,G,te){var oe=this.display;N=Ki(this,Tt(this.doc,N));var se=N.bottom,Ae=N.left;if(T.style.position="absolute",T.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(T),oe.sizer.appendChild(T),G=="over")se=N.top;else if(G=="above"||G=="near"){var Ie=Math.max(oe.wrapper.clientHeight,this.doc.height),Ze=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(G=="above"||N.bottom+T.offsetHeight>Ie)&&N.top>T.offsetHeight?se=N.top-T.offsetHeight:N.bottom+T.offsetHeight<=Ie&&(se=N.bottom),Ae+T.offsetWidth>Ze&&(Ae=Ze-T.offsetWidth)}T.style.top=se+"px",T.style.left=T.style.right="",te=="right"?(Ae=oe.sizer.clientWidth-T.offsetWidth,T.style.right="0px"):(te=="left"?Ae=0:te=="middle"&&(Ae=(oe.sizer.clientWidth-T.offsetWidth)/2),T.style.left=Ae+"px"),z&&TN(this,{left:Ae,top:se,right:Ae+T.offsetWidth,bottom:se+T.offsetHeight})},triggerOnKeyDown:Vn(Kc),triggerOnKeyPress:Vn(Dy),triggerOnKeyUp:by,triggerOnMouseDown:Vn(Ey),execCommand:function(N){if(Zc.hasOwnProperty(N))return Zc[N].call(null,this)},triggerElectric:Vn(function(N){_y(this,N)}),findPosH:function(N,T,z,G){var te=1;T<0&&(te=-1,T=-T);for(var oe=Tt(this.doc,N),se=0;se0&&Ae(z.charAt(G-1));)--G;for(;te.5||this.options.lineWrapping)&&wm(this),je(this,"refresh",this)}),swapDoc:Vn(function(N){var T=this.doc;return T.cm=null,this.state.selectingText&&this.state.selectingText(),j1(this,N),bc(this),this.display.input.reset(),Mc(this,N.scrollLeft,N.scrollTop),this.curOp.forceScroll=!0,Wn(this,"swapDoc",this,T),T}),phrase:function(N){var T=this.options.phrases;return T&&Object.prototype.hasOwnProperty.call(T,N)?T[N]:N},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Gr(c),c.registerHelper=function(N,T,z){S.hasOwnProperty(N)||(S[N]=c[N]={_global:[]}),S[N][T]=z},c.registerGlobalHelper=function(N,T,z,G){c.registerHelper(N,T,G),S[N]._global.push({pred:z,val:G})}}function Hg(c,d,S,N,T){var z=d,G=S,te=zt(c,d.line),oe=T&&c.direction=="rtl"?-S:S;function se(){var At=d.line+oe;return At=c.first+c.size?!1:(d=new rt(At,d.ch,d.sticky),te=zt(c,At))}function Ae(At){var Dt;if(N=="codepoint"){var It=te.text.charCodeAt(d.ch+(S>0?0:-1));if(isNaN(It))Dt=null;else{var Yt=S>0?It>=55296&&It<56320:It>=56320&&It<57343;Dt=new rt(d.line,Math.max(0,Math.min(te.text.length,d.ch+S*(Yt?2:1))),-S)}}else T?Dt=YN(c.cm,te,d,S):Dt=Bg(te,d,S);if(Dt==null)if(!At&&se())d=Lg(T,c.cm,te,d.line,oe);else return!1;else d=Dt;return!0}if(N=="char"||N=="codepoint")Ae();else if(N=="column")Ae(!0);else if(N=="word"||N=="group")for(var Ie=null,Ze=N=="group",$e=c.cm&&c.cm.getHelper(d,"wordChars"),at=!0;!(S<0&&!Ae(!at));at=!1){var mt=te.text.charAt(d.ch)||` -`,xt=Pt(mt,$e)?"w":Ze&&mt==` -`?"n":!Ze||/\s/.test(mt)?null:"p";if(Ze&&!at&&!xt&&(xt="s"),Ie&&Ie!=xt){S<0&&(S=1,Ae(),d.sticky="after");break}if(xt&&(Ie=xt),S>0&&!Ae(!at))break}var bt=Im(c,d,z,G,!0);return Mr(z,bt)&&(bt.hitSide=!0),bt}function Ly(c,d,S,N){var T=c.doc,z=d.left,G;if(N=="page"){var te=Math.min(c.display.wrapper.clientHeight,Ee(c).innerHeight||T(c).documentElement.clientHeight),oe=Math.max(te-.5*la(c.display),3);G=(S>0?d.bottom:d.top)+S*oe}else N=="line"&&(G=S>0?d.bottom+3:d.top-3);for(var se;se=og(c,z,G),!!se.outside;){if(S<0?G<=0:G>=T.height){se.hitSide=!0;break}G+=S*5}return se}var zr=function(c){this.cm=c,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new He,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};zr.prototype.init=function(c){var d=this,S=this,N=S.cm,T=S.div=c.lineDiv;T.contentEditable=!0,jc(T,N.options.spellcheck,N.options.autocorrect,N.options.autocapitalize);function z(te){for(var oe=te.target;oe;oe=oe.parentNode){if(oe==T)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}X(T,"paste",function(te){!z(te)||wt(N,te)||Fy(te,N)||l<=11&&setTimeout(oi(N,function(){return d.updateFromDOM()}),20)}),X(T,"compositionstart",function(te){d.composing={data:te.data,done:!1}}),X(T,"compositionupdate",function(te){d.composing||(d.composing={data:te.data,done:!1})}),X(T,"compositionend",function(te){d.composing&&(te.data!=d.composing.data&&d.readFromDOMSoon(),d.composing.done=!0)}),X(T,"touchstart",function(){return S.forceCompositionEnd()}),X(T,"input",function(){d.composing||d.readFromDOMSoon()});function G(te){if(!(!z(te)||wt(N,te))){if(N.somethingSelected())qm({lineWise:!1,text:N.getSelections()}),te.type=="cut"&&N.replaceSelection("",null,"cut");else if(N.options.lineWiseCopyCut){var oe=ky(N);qm({lineWise:!0,text:oe.text}),te.type=="cut"&&N.operation(function(){N.setSelections(oe.ranges,0,Le),N.replaceSelection("",null,"cut")})}else return;if(te.clipboardData){te.clipboardData.clearData();var se=pa.text.join(` -`);if(te.clipboardData.setData("Text",se),te.clipboardData.getData("Text")==se){te.preventDefault();return}}var Ae=By(),Ie=Ae.firstChild;jc(Ie),N.display.lineSpace.insertBefore(Ae,N.display.lineSpace.firstChild),Ie.value=pa.text.join(` -`);var Ze=Z(ce(T));he(Ie),setTimeout(function(){N.display.lineSpace.removeChild(Ae),Ze.focus(),Ze==T&&S.showPrimarySelection()},50)}}X(T,"copy",G),X(T,"cut",G)},zr.prototype.screenReaderLabelChanged=function(c){c?this.div.setAttribute("aria-label",c):this.div.removeAttribute("aria-label")},zr.prototype.prepareSelection=function(){var c=H1(this.cm,!1);return c.focus=Z(ce(this.div))==this.div,c},zr.prototype.showSelection=function(c,d){!c||!this.cm.display.view.length||((c.focus||d)&&this.showPrimarySelection(),this.showMultipleSelections(c))},zr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zr.prototype.showPrimarySelection=function(){var c=this.getSelection(),d=this.cm,S=d.doc.sel.primary(),N=S.from(),T=S.to();if(d.display.viewTo==d.display.viewFrom||N.line>=d.display.viewTo||T.line=d.display.viewFrom&&Py(d,N)||{node:te[0].measure.map[2],offset:0},se=T.linec.firstLine()&&(N=rt(N.line-1,zt(c.doc,N.line-1).length)),T.ch==zt(c.doc,T.line).text.length&&T.lined.viewTo-1)return!1;var z,G,te;N.line==d.viewFrom||(z=Qu(c,N.line))==0?(G=ue(d.view[0].line),te=d.view[0].node):(G=ue(d.view[z].line),te=d.view[z-1].node.nextSibling);var oe=Qu(c,T.line),se,Ae;if(oe==d.view.length-1?(se=d.viewTo-1,Ae=d.lineDiv.lastChild):(se=ue(d.view[oe+1].line)-1,Ae=d.view[oe+1].node.previousSibling),!te)return!1;for(var Ie=c.doc.splitLines(sE(c,te,Ae,G,se)),Ze=oa(c.doc,rt(G,0),rt(se,zt(c.doc,se).text.length));Ie.length>1&&Ze.length>1;)if(ge(Ie)==ge(Ze))Ie.pop(),Ze.pop(),se--;else if(Ie[0]==Ze[0])Ie.shift(),Ze.shift(),G++;else break;for(var $e=0,at=0,mt=Ie[0],xt=Ze[0],bt=Math.min(mt.length,xt.length);$eN.ch&&At.charCodeAt(At.length-at-1)==Dt.charCodeAt(Dt.length-at-1);)$e--,at++;Ie[Ie.length-1]=At.slice(0,At.length-at).replace(/^\u200b+/,""),Ie[0]=Ie[0].slice($e).replace(/\u200b+$/,"");var Yt=rt(G,$e),Vt=rt(se,Ze.length?ge(Ze).length-at:0);if(Ie.length>1||Ie[0]||ke(Yt,Vt))return $o(c.doc,Ie,Yt,Vt,"+input"),!0},zr.prototype.ensurePolled=function(){this.forceCompositionEnd()},zr.prototype.reset=function(){this.forceCompositionEnd()},zr.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},zr.prototype.readFromDOMSoon=function(){var c=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(c.readDOMTimeout=null,c.composing)if(c.composing.done)c.composing=null;else return;c.updateFromDOM()},80))},zr.prototype.updateFromDOM=function(){var c=this;(this.cm.isReadOnly()||!this.pollContent())&&bi(this.cm,function(){return Ji(c.cm)})},zr.prototype.setUneditable=function(c){c.contentEditable="false"},zr.prototype.onKeyPress=function(c){c.charCode==0||this.composing||(c.preventDefault(),this.cm.isReadOnly()||oi(this.cm,zm)(this.cm,String.fromCharCode(c.charCode==null?c.keyCode:c.charCode),0))},zr.prototype.readOnlyChanged=function(c){this.div.contentEditable=String(c!="nocursor")},zr.prototype.onContextMenu=function(){},zr.prototype.resetPosition=function(){},zr.prototype.needsContentAttribute=!0;function Py(c,d){var S=vm(c,d.line);if(!S||S.hidden)return null;var N=zt(c.doc,d.line),T=ig(S,N,d.line),z=Xe(N,c.doc.direction),G="left";if(z){var te=Je(z,d.ch);G=te%2?"right":"left"}var oe=k1(T.map,d.ch,G);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function aE(c){for(var d=c;d;d=d.parentNode)if(/CodeMirror-gutter-wrapper/.test(d.className))return!0;return!1}function df(c,d){return d&&(c.bad=!0),c}function sE(c,d,S,N,T){var z="",G=!1,te=c.doc.lineSeparator(),oe=!1;function se($e){return function(at){return at.id==$e}}function Ae(){G&&(z+=te,oe&&(z+=te),G=oe=!1)}function Ie($e){$e&&(Ae(),z+=$e)}function Ze($e){if($e.nodeType==1){var at=$e.getAttribute("cm-text");if(at){Ie(at);return}var mt=$e.getAttribute("cm-marker"),xt;if(mt){var bt=c.findMarks(rt(N,0),rt(T+1,0),se(+mt));bt.length&&(xt=bt[0].find(0))&&Ie(oa(c.doc,xt.from,xt.to).join(te));return}if($e.getAttribute("contenteditable")=="false")return;var At=/^(pre|div|p|li|table|br)$/i.test($e.nodeName);if(!/^br$/i.test($e.nodeName)&&$e.textContent.length==0)return;At&&Ae();for(var Dt=0;Dt<$e.childNodes.length;Dt++)Ze($e.childNodes[Dt]);/^(pre|p)$/i.test($e.nodeName)&&(oe=!0),At&&(G=!0)}else $e.nodeType==3&&Ie($e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Ze(d),d!=S;)d=d.nextSibling,oe=!1;return z}function Um(c,d,S){var N;if(d==c.display.lineDiv){if(N=c.display.lineDiv.childNodes[S],!N)return df(c.clipPos(rt(c.display.viewTo-1)),!0);d=null,S=0}else for(N=d;;N=N.parentNode){if(!N||N==c.display.lineDiv)return null;if(N.parentNode&&N.parentNode==c.display.lineDiv)break}for(var T=0;T=9&&d.hasSelection&&(d.hasSelection=null),S.poll()}),X(T,"paste",function(G){wt(N,G)||Fy(G,N)||(N.state.pasteIncoming=+new Date,S.fastPoll())});function z(G){if(!wt(N,G)){if(N.somethingSelected())qm({lineWise:!1,text:N.getSelections()});else if(N.options.lineWiseCopyCut){var te=ky(N);qm({lineWise:!0,text:te.text}),G.type=="cut"?N.setSelections(te.ranges,null,Le):(S.prevInput="",T.value=te.text.join(` -`),he(T))}else return;G.type=="cut"&&(N.state.cutIncoming=+new Date)}}X(T,"cut",z),X(T,"copy",z),X(c.scroller,"paste",function(G){if(!(La(c,G)||wt(N,G))){if(!T.dispatchEvent){N.state.pasteIncoming=+new Date,S.focus();return}var te=new Event("paste");te.clipboardData=G.clipboardData,T.dispatchEvent(te)}}),X(c.lineSpace,"selectstart",function(G){La(c,G)||Gt(G)}),X(T,"compositionstart",function(){var G=N.getCursor("from");S.composing&&S.composing.range.clear(),S.composing={start:G,range:N.markText(G,N.getCursor("to"),{className:"CodeMirror-composing"})}}),X(T,"compositionend",function(){S.composing&&(S.poll(),S.composing.range.clear(),S.composing=null)})},An.prototype.createField=function(c){this.wrapper=By(),this.textarea=this.wrapper.firstChild;var d=this.cm.options;jc(this.textarea,d.spellcheck,d.autocorrect,d.autocapitalize)},An.prototype.screenReaderLabelChanged=function(c){c?this.textarea.setAttribute("aria-label",c):this.textarea.removeAttribute("aria-label")},An.prototype.prepareSelection=function(){var c=this.cm,d=c.display,S=c.doc,N=H1(c);if(c.options.moveInputWithCursor){var T=Ki(c,S.sel.primary().head,"div"),z=d.wrapper.getBoundingClientRect(),G=d.lineDiv.getBoundingClientRect();N.teTop=Math.max(0,Math.min(d.wrapper.clientHeight-10,T.top+G.top-z.top)),N.teLeft=Math.max(0,Math.min(d.wrapper.clientWidth-10,T.left+G.left-z.left))}return N},An.prototype.showSelection=function(c){var d=this.cm,S=d.display;V(S.cursorDiv,c.cursors),V(S.selectionDiv,c.selection),c.teTop!=null&&(this.wrapper.style.top=c.teTop+"px",this.wrapper.style.left=c.teLeft+"px")},An.prototype.reset=function(c){if(!(this.contextMenuPending||this.composing&&c)){var d=this.cm;if(this.resetting=!0,d.somethingSelected()){this.prevInput="";var S=d.getSelection();this.textarea.value=S,d.state.focused&&he(this.textarea),u&&l>=9&&(this.hasSelection=S)}else c||(this.prevInput=this.textarea.value="",u&&l>=9&&(this.hasSelection=null));this.resetting=!1}},An.prototype.getField=function(){return this.textarea},An.prototype.supportsTouch=function(){return!1},An.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!O||Z(ce(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},An.prototype.blur=function(){this.textarea.blur()},An.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},An.prototype.receivedFocus=function(){this.slowPoll()},An.prototype.slowPoll=function(){var c=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){c.poll(),c.cm.state.focused&&c.slowPoll()})},An.prototype.fastPoll=function(){var c=!1,d=this;d.pollingFast=!0;function S(){var N=d.poll();!N&&!c?(c=!0,d.polling.set(60,S)):(d.pollingFast=!1,d.slowPoll())}d.polling.set(20,S)},An.prototype.poll=function(){var c=this,d=this.cm,S=this.textarea,N=this.prevInput;if(this.contextMenuPending||this.resetting||!d.state.focused||na(S)&&!N&&!this.composing||d.isReadOnly()||d.options.disableInput||d.state.keySeq)return!1;var T=S.value;if(T==N&&!d.somethingSelected())return!1;if(u&&l>=9&&this.hasSelection===T||M&&/[\uf700-\uf7ff]/.test(T))return d.display.input.reset(),!1;if(d.doc.sel==d.display.selForContextMenu){var z=T.charCodeAt(0);if(z==8203&&!N&&(N="\u200B"),z==8666)return this.reset(),this.cm.execCommand("undo")}for(var G=0,te=Math.min(N.length,T.length);G1e3||T.indexOf(` -`)>-1?S.value=c.prevInput="":c.prevInput=T,c.composing&&(c.composing.range.clear(),c.composing.range=d.markText(c.composing.start,d.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},An.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},An.prototype.onKeyPress=function(){u&&l>=9&&(this.hasSelection=null),this.fastPoll()},An.prototype.onContextMenu=function(c){var d=this,S=d.cm,N=S.display,T=d.textarea;d.contextMenuPending&&d.contextMenuPending();var z=fa(S,c),G=N.scroller.scrollTop;if(!z||h)return;var te=S.options.resetSelectionOnContextMenu;te&&S.doc.sel.contains(z)==-1&&oi(S,ci)(S.doc,pu(z),Le);var oe=T.style.cssText,se=d.wrapper.style.cssText,Ae=d.wrapper.offsetParent.getBoundingClientRect();d.wrapper.style.cssText="position: static",T.style.cssText=`position: absolute; width: 30px; height: 30px; +`)&&(at=mt=rt(at.line,0)));var yt={from:at,to:mt,text:se?se[Ze%se.length]:oe,origin:T||(te?"paste":c.state.cutIncoming>G?"cut":"+input")};Ns(c.doc,yt),Wn(c,"inputRead",c,yt)}d&&!te&&_x(c,d),ef(c),c.curOp.updateInput<2&&(c.curOp.updateInput=Ie),c.curOp.typing=!0,c.state.pasteIncoming=c.state.cutIncoming=-1}function Fx(c,d){var E=c.clipboardData&&c.clipboardData.getData("Text");if(E)return c.preventDefault(),!d.isReadOnly()&&!d.options.disableInput&&d.hasFocus()&&bi(d,function(){return zm(d,E,0,null,"paste")}),!0}function _x(c,d){if(!(!c.options.electricChars||!c.options.smartIndent))for(var E=c.doc.sel,N=E.ranges.length-1;N>=0;N--){var T=E.ranges[N];if(!(T.head.ch>100||N&&E.ranges[N-1].head.line==T.head.line)){var z=c.getModeAt(T.head),G=!1;if(z.electricChars){for(var te=0;te-1){G=df(c,T.head.line,"smart");break}}else z.electricInput&&z.electricInput.test(zt(c.doc,T.head.line).text.slice(0,T.head.ch))&&(G=df(c,T.head.line,"smart"));G&&Wn(c,"electricInput",c,T.head.line)}}}function kx(c){for(var d=[],E=[],N=0;Nz&&(df(this,te.head.line,N,!0),z=te.head.line,G==this.doc.sel.primIndex&&ef(this));else{var oe=te.from(),se=te.to(),Ae=Math.max(z,oe.line);z=Math.min(this.lastLine(),se.line-(se.ch?0:1))+1;for(var Ie=Ae;Ie0&&Sg(this.doc,G,new Br(oe,Ze[G].to()),Le)}}}),getTokenAt:function(N,T){return pc(this,N,T)},getLineTokens:function(N,T){return pc(this,rt(N),T,!0)},getTokenTypeAt:function(N){N=Tt(this.doc,N);var T=b1(this,zt(this.doc,N.line)),z=0,G=(T.length-1)/2,te=N.ch,oe;if(te==0)oe=T[2];else for(;;){var se=z+G>>1;if((se?T[se*2-1]:0)>=te)G=se;else if(T[se*2+1]oe&&(N=oe,G=!0),te=zt(this.doc,N)}else te=N;return Dc(this,te,{top:0,left:0},T||"page",z||G).top+(G?this.doc.height-Uo(te):0)},defaultTextHeight:function(){return la(this.display)},defaultCharWidth:function(){return xs(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(N,T,z,G,te){var oe=this.display;N=Ki(this,Tt(this.doc,N));var se=N.bottom,Ae=N.left;if(T.style.position="absolute",T.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(T),oe.sizer.appendChild(T),G=="over")se=N.top;else if(G=="above"||G=="near"){var Ie=Math.max(oe.wrapper.clientHeight,this.doc.height),Ze=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(G=="above"||N.bottom+T.offsetHeight>Ie)&&N.top>T.offsetHeight?se=N.top-T.offsetHeight:N.bottom+T.offsetHeight<=Ie&&(se=N.bottom),Ae+T.offsetWidth>Ze&&(Ae=Ze-T.offsetWidth)}T.style.top=se+"px",T.style.left=T.style.right="",te=="right"?(Ae=oe.sizer.clientWidth-T.offsetWidth,T.style.right="0px"):(te=="left"?Ae=0:te=="middle"&&(Ae=(oe.sizer.clientWidth-T.offsetWidth)/2),T.style.left=Ae+"px"),z&&TN(this,{left:Ae,top:se,right:Ae+T.offsetWidth,bottom:se+T.offsetHeight})},triggerOnKeyDown:Vn(Kc),triggerOnKeyPress:Vn(Dx),triggerOnKeyUp:bx,triggerOnMouseDown:Vn(Sx),execCommand:function(N){if(Zc.hasOwnProperty(N))return Zc[N].call(null,this)},triggerElectric:Vn(function(N){_x(this,N)}),findPosH:function(N,T,z,G){var te=1;T<0&&(te=-1,T=-T);for(var oe=Tt(this.doc,N),se=0;se0&&Ae(z.charAt(G-1));)--G;for(;te.5||this.options.lineWrapping)&&wm(this),je(this,"refresh",this)}),swapDoc:Vn(function(N){var T=this.doc;return T.cm=null,this.state.selectingText&&this.state.selectingText(),j1(this,N),bc(this),this.display.input.reset(),Mc(this,N.scrollLeft,N.scrollTop),this.curOp.forceScroll=!0,Wn(this,"swapDoc",this,T),T}),phrase:function(N){var T=this.options.phrases;return T&&Object.prototype.hasOwnProperty.call(T,N)?T[N]:N},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Gr(c),c.registerHelper=function(N,T,z){E.hasOwnProperty(N)||(E[N]=c[N]={_global:[]}),E[N][T]=z},c.registerGlobalHelper=function(N,T,z,G){c.registerHelper(N,T,G),E[N]._global.push({pred:z,val:G})}}function Ug(c,d,E,N,T){var z=d,G=E,te=zt(c,d.line),oe=T&&c.direction=="rtl"?-E:E;function se(){var At=d.line+oe;return At=c.first+c.size?!1:(d=new rt(At,d.ch,d.sticky),te=zt(c,At))}function Ae(At){var Dt;if(N=="codepoint"){var It=te.text.charCodeAt(d.ch+(E>0?0:-1));if(isNaN(It))Dt=null;else{var Yt=E>0?It>=55296&&It<56320:It>=56320&&It<57343;Dt=new rt(d.line,Math.max(0,Math.min(te.text.length,d.ch+E*(Yt?2:1))),-E)}}else T?Dt=YN(c.cm,te,d,E):Dt=kg(te,d,E);if(Dt==null)if(!At&&se())d=Bg(T,c.cm,te,d.line,oe);else return!1;else d=Dt;return!0}if(N=="char"||N=="codepoint")Ae();else if(N=="column")Ae(!0);else if(N=="word"||N=="group")for(var Ie=null,Ze=N=="group",$e=c.cm&&c.cm.getHelper(d,"wordChars"),at=!0;!(E<0&&!Ae(!at));at=!1){var mt=te.text.charAt(d.ch)||` +`,yt=Pt(mt,$e)?"w":Ze&&mt==` +`?"n":!Ze||/\s/.test(mt)?null:"p";if(Ze&&!at&&!yt&&(yt="s"),Ie&&Ie!=yt){E<0&&(E=1,Ae(),d.sticky="after");break}if(yt&&(Ie=yt),E>0&&!Ae(!at))break}var bt=Im(c,d,z,G,!0);return Mr(z,bt)&&(bt.hitSide=!0),bt}function Lx(c,d,E,N){var T=c.doc,z=d.left,G;if(N=="page"){var te=Math.min(c.display.wrapper.clientHeight,Se(c).innerHeight||T(c).documentElement.clientHeight),oe=Math.max(te-.5*la(c.display),3);G=(E>0?d.bottom:d.top)+E*oe}else N=="line"&&(G=E>0?d.bottom+3:d.top-3);for(var se;se=ig(c,z,G),!!se.outside;){if(E<0?G<=0:G>=T.height){se.hitSide=!0;break}G+=E*5}return se}var zr=function(c){this.cm=c,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new He,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};zr.prototype.init=function(c){var d=this,E=this,N=E.cm,T=E.div=c.lineDiv;T.contentEditable=!0,jc(T,N.options.spellcheck,N.options.autocorrect,N.options.autocapitalize);function z(te){for(var oe=te.target;oe;oe=oe.parentNode){if(oe==T)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}X(T,"paste",function(te){!z(te)||wt(N,te)||Fx(te,N)||l<=11&&setTimeout(oi(N,function(){return d.updateFromDOM()}),20)}),X(T,"compositionstart",function(te){d.composing={data:te.data,done:!1}}),X(T,"compositionupdate",function(te){d.composing||(d.composing={data:te.data,done:!1})}),X(T,"compositionend",function(te){d.composing&&(te.data!=d.composing.data&&d.readFromDOMSoon(),d.composing.done=!0)}),X(T,"touchstart",function(){return E.forceCompositionEnd()}),X(T,"input",function(){d.composing||d.readFromDOMSoon()});function G(te){if(!(!z(te)||wt(N,te))){if(N.somethingSelected())qm({lineWise:!1,text:N.getSelections()}),te.type=="cut"&&N.replaceSelection("",null,"cut");else if(N.options.lineWiseCopyCut){var oe=kx(N);qm({lineWise:!0,text:oe.text}),te.type=="cut"&&N.operation(function(){N.setSelections(oe.ranges,0,Le),N.replaceSelection("",null,"cut")})}else return;if(te.clipboardData){te.clipboardData.clearData();var se=pa.text.join(` +`);if(te.clipboardData.setData("Text",se),te.clipboardData.getData("Text")==se){te.preventDefault();return}}var Ae=Bx(),Ie=Ae.firstChild;jc(Ie),N.display.lineSpace.insertBefore(Ae,N.display.lineSpace.firstChild),Ie.value=pa.text.join(` +`);var Ze=Z(ce(T));he(Ie),setTimeout(function(){N.display.lineSpace.removeChild(Ae),Ze.focus(),Ze==T&&E.showPrimarySelection()},50)}}X(T,"copy",G),X(T,"cut",G)},zr.prototype.screenReaderLabelChanged=function(c){c?this.div.setAttribute("aria-label",c):this.div.removeAttribute("aria-label")},zr.prototype.prepareSelection=function(){var c=H1(this.cm,!1);return c.focus=Z(ce(this.div))==this.div,c},zr.prototype.showSelection=function(c,d){!c||!this.cm.display.view.length||((c.focus||d)&&this.showPrimarySelection(),this.showMultipleSelections(c))},zr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zr.prototype.showPrimarySelection=function(){var c=this.getSelection(),d=this.cm,E=d.doc.sel.primary(),N=E.from(),T=E.to();if(d.display.viewTo==d.display.viewFrom||N.line>=d.display.viewTo||T.line=d.display.viewFrom&&Px(d,N)||{node:te[0].measure.map[2],offset:0},se=T.linec.firstLine()&&(N=rt(N.line-1,zt(c.doc,N.line-1).length)),T.ch==zt(c.doc,T.line).text.length&&T.lined.viewTo-1)return!1;var z,G,te;N.line==d.viewFrom||(z=Qu(c,N.line))==0?(G=ue(d.view[0].line),te=d.view[0].node):(G=ue(d.view[z].line),te=d.view[z-1].node.nextSibling);var oe=Qu(c,T.line),se,Ae;if(oe==d.view.length-1?(se=d.viewTo-1,Ae=d.lineDiv.lastChild):(se=ue(d.view[oe+1].line)-1,Ae=d.view[oe+1].node.previousSibling),!te)return!1;for(var Ie=c.doc.splitLines(sS(c,te,Ae,G,se)),Ze=oa(c.doc,rt(G,0),rt(se,zt(c.doc,se).text.length));Ie.length>1&&Ze.length>1;)if(ge(Ie)==ge(Ze))Ie.pop(),Ze.pop(),se--;else if(Ie[0]==Ze[0])Ie.shift(),Ze.shift(),G++;else break;for(var $e=0,at=0,mt=Ie[0],yt=Ze[0],bt=Math.min(mt.length,yt.length);$eN.ch&&At.charCodeAt(At.length-at-1)==Dt.charCodeAt(Dt.length-at-1);)$e--,at++;Ie[Ie.length-1]=At.slice(0,At.length-at).replace(/^\u200b+/,""),Ie[0]=Ie[0].slice($e).replace(/\u200b+$/,"");var Yt=rt(G,$e),Vt=rt(se,Ze.length?ge(Ze).length-at:0);if(Ie.length>1||Ie[0]||ke(Yt,Vt))return $o(c.doc,Ie,Yt,Vt,"+input"),!0},zr.prototype.ensurePolled=function(){this.forceCompositionEnd()},zr.prototype.reset=function(){this.forceCompositionEnd()},zr.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},zr.prototype.readFromDOMSoon=function(){var c=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(c.readDOMTimeout=null,c.composing)if(c.composing.done)c.composing=null;else return;c.updateFromDOM()},80))},zr.prototype.updateFromDOM=function(){var c=this;(this.cm.isReadOnly()||!this.pollContent())&&bi(this.cm,function(){return Ji(c.cm)})},zr.prototype.setUneditable=function(c){c.contentEditable="false"},zr.prototype.onKeyPress=function(c){c.charCode==0||this.composing||(c.preventDefault(),this.cm.isReadOnly()||oi(this.cm,zm)(this.cm,String.fromCharCode(c.charCode==null?c.keyCode:c.charCode),0))},zr.prototype.readOnlyChanged=function(c){this.div.contentEditable=String(c!="nocursor")},zr.prototype.onContextMenu=function(){},zr.prototype.resetPosition=function(){},zr.prototype.needsContentAttribute=!0;function Px(c,d){var E=vm(c,d.line);if(!E||E.hidden)return null;var N=zt(c.doc,d.line),T=ng(E,N,d.line),z=Xe(N,c.doc.direction),G="left";if(z){var te=Je(z,d.ch);G=te%2?"right":"left"}var oe=k1(T.map,d.ch,G);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function aS(c){for(var d=c;d;d=d.parentNode)if(/CodeMirror-gutter-wrapper/.test(d.className))return!0;return!1}function gf(c,d){return d&&(c.bad=!0),c}function sS(c,d,E,N,T){var z="",G=!1,te=c.doc.lineSeparator(),oe=!1;function se($e){return function(at){return at.id==$e}}function Ae(){G&&(z+=te,oe&&(z+=te),G=oe=!1)}function Ie($e){$e&&(Ae(),z+=$e)}function Ze($e){if($e.nodeType==1){var at=$e.getAttribute("cm-text");if(at){Ie(at);return}var mt=$e.getAttribute("cm-marker"),yt;if(mt){var bt=c.findMarks(rt(N,0),rt(T+1,0),se(+mt));bt.length&&(yt=bt[0].find(0))&&Ie(oa(c.doc,yt.from,yt.to).join(te));return}if($e.getAttribute("contenteditable")=="false")return;var At=/^(pre|div|p|li|table|br)$/i.test($e.nodeName);if(!/^br$/i.test($e.nodeName)&&$e.textContent.length==0)return;At&&Ae();for(var Dt=0;Dt<$e.childNodes.length;Dt++)Ze($e.childNodes[Dt]);/^(pre|p)$/i.test($e.nodeName)&&(oe=!0),At&&(G=!0)}else $e.nodeType==3&&Ie($e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Ze(d),d!=E;)d=d.nextSibling,oe=!1;return z}function Um(c,d,E){var N;if(d==c.display.lineDiv){if(N=c.display.lineDiv.childNodes[E],!N)return gf(c.clipPos(rt(c.display.viewTo-1)),!0);d=null,E=0}else for(N=d;;N=N.parentNode){if(!N||N==c.display.lineDiv)return null;if(N.parentNode&&N.parentNode==c.display.lineDiv)break}for(var T=0;T=9&&d.hasSelection&&(d.hasSelection=null),E.poll()}),X(T,"paste",function(G){wt(N,G)||Fx(G,N)||(N.state.pasteIncoming=+new Date,E.fastPoll())});function z(G){if(!wt(N,G)){if(N.somethingSelected())qm({lineWise:!1,text:N.getSelections()});else if(N.options.lineWiseCopyCut){var te=kx(N);qm({lineWise:!0,text:te.text}),G.type=="cut"?N.setSelections(te.ranges,null,Le):(E.prevInput="",T.value=te.text.join(` +`),he(T))}else return;G.type=="cut"&&(N.state.cutIncoming=+new Date)}}X(T,"cut",z),X(T,"copy",z),X(c.scroller,"paste",function(G){if(!(La(c,G)||wt(N,G))){if(!T.dispatchEvent){N.state.pasteIncoming=+new Date,E.focus();return}var te=new Event("paste");te.clipboardData=G.clipboardData,T.dispatchEvent(te)}}),X(c.lineSpace,"selectstart",function(G){La(c,G)||Gt(G)}),X(T,"compositionstart",function(){var G=N.getCursor("from");E.composing&&E.composing.range.clear(),E.composing={start:G,range:N.markText(G,N.getCursor("to"),{className:"CodeMirror-composing"})}}),X(T,"compositionend",function(){E.composing&&(E.poll(),E.composing.range.clear(),E.composing=null)})},An.prototype.createField=function(c){this.wrapper=Bx(),this.textarea=this.wrapper.firstChild;var d=this.cm.options;jc(this.textarea,d.spellcheck,d.autocorrect,d.autocapitalize)},An.prototype.screenReaderLabelChanged=function(c){c?this.textarea.setAttribute("aria-label",c):this.textarea.removeAttribute("aria-label")},An.prototype.prepareSelection=function(){var c=this.cm,d=c.display,E=c.doc,N=H1(c);if(c.options.moveInputWithCursor){var T=Ki(c,E.sel.primary().head,"div"),z=d.wrapper.getBoundingClientRect(),G=d.lineDiv.getBoundingClientRect();N.teTop=Math.max(0,Math.min(d.wrapper.clientHeight-10,T.top+G.top-z.top)),N.teLeft=Math.max(0,Math.min(d.wrapper.clientWidth-10,T.left+G.left-z.left))}return N},An.prototype.showSelection=function(c){var d=this.cm,E=d.display;V(E.cursorDiv,c.cursors),V(E.selectionDiv,c.selection),c.teTop!=null&&(this.wrapper.style.top=c.teTop+"px",this.wrapper.style.left=c.teLeft+"px")},An.prototype.reset=function(c){if(!(this.contextMenuPending||this.composing&&c)){var d=this.cm;if(this.resetting=!0,d.somethingSelected()){this.prevInput="";var E=d.getSelection();this.textarea.value=E,d.state.focused&&he(this.textarea),u&&l>=9&&(this.hasSelection=E)}else c||(this.prevInput=this.textarea.value="",u&&l>=9&&(this.hasSelection=null));this.resetting=!1}},An.prototype.getField=function(){return this.textarea},An.prototype.supportsTouch=function(){return!1},An.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!O||Z(ce(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},An.prototype.blur=function(){this.textarea.blur()},An.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},An.prototype.receivedFocus=function(){this.slowPoll()},An.prototype.slowPoll=function(){var c=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){c.poll(),c.cm.state.focused&&c.slowPoll()})},An.prototype.fastPoll=function(){var c=!1,d=this;d.pollingFast=!0;function E(){var N=d.poll();!N&&!c?(c=!0,d.polling.set(60,E)):(d.pollingFast=!1,d.slowPoll())}d.polling.set(20,E)},An.prototype.poll=function(){var c=this,d=this.cm,E=this.textarea,N=this.prevInput;if(this.contextMenuPending||this.resetting||!d.state.focused||na(E)&&!N&&!this.composing||d.isReadOnly()||d.options.disableInput||d.state.keySeq)return!1;var T=E.value;if(T==N&&!d.somethingSelected())return!1;if(u&&l>=9&&this.hasSelection===T||M&&/[\uf700-\uf7ff]/.test(T))return d.display.input.reset(),!1;if(d.doc.sel==d.display.selForContextMenu){var z=T.charCodeAt(0);if(z==8203&&!N&&(N="\u200B"),z==8666)return this.reset(),this.cm.execCommand("undo")}for(var G=0,te=Math.min(N.length,T.length);G1e3||T.indexOf(` +`)>-1?E.value=c.prevInput="":c.prevInput=T,c.composing&&(c.composing.range.clear(),c.composing.range=d.markText(c.composing.start,d.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},An.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},An.prototype.onKeyPress=function(){u&&l>=9&&(this.hasSelection=null),this.fastPoll()},An.prototype.onContextMenu=function(c){var d=this,E=d.cm,N=E.display,T=d.textarea;d.contextMenuPending&&d.contextMenuPending();var z=fa(E,c),G=N.scroller.scrollTop;if(!z||h)return;var te=E.options.resetSelectionOnContextMenu;te&&E.doc.sel.contains(z)==-1&&oi(E,ci)(E.doc,cu(z),Le);var oe=T.style.cssText,se=d.wrapper.style.cssText,Ae=d.wrapper.offsetParent.getBoundingClientRect();d.wrapper.style.cssText="position: static",T.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(c.clientY-Ae.top-5)+"px; left: "+(c.clientX-Ae.left-5)+`px; z-index: 1000; background: `+(u?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ie;a&&(Ie=T.ownerDocument.defaultView.scrollY),N.input.focus(),a&&T.ownerDocument.defaultView.scrollTo(null,Ie),N.input.reset(),S.somethingSelected()||(T.value=d.prevInput=" "),d.contextMenuPending=$e,N.selForContextMenu=S.doc.sel,clearTimeout(N.detectingSelectAll);function Ze(){if(T.selectionStart!=null){var mt=S.somethingSelected(),xt="\u200B"+(mt?T.value:"");T.value="\u21DA",T.value=xt,d.prevInput=mt?"":"\u200B",T.selectionStart=1,T.selectionEnd=xt.length,N.selForContextMenu=S.doc.sel}}function $e(){if(d.contextMenuPending==$e&&(d.contextMenuPending=!1,d.wrapper.style.cssText=se,T.style.cssText=oe,u&&l<9&&N.scrollbars.setScrollTop(N.scroller.scrollTop=G),T.selectionStart!=null)){(!u||u&&l<9)&&Ze();var mt=0,xt=function(){N.selForContextMenu==S.doc.sel&&T.selectionStart==0&&T.selectionEnd>0&&d.prevInput=="\u200B"?oi(S,iy)(S):mt++<10?N.detectingSelectAll=setTimeout(xt,500):(N.selForContextMenu=null,N.input.reset())};N.detectingSelectAll=setTimeout(xt,200)}}if(u&&l>=9&&Ze(),R){ao(c);var at=function(){Ye(window,"mouseup",at),setTimeout($e,20)};X(window,"mouseup",at)}else setTimeout($e,50)},An.prototype.readOnlyChanged=function(c){c||this.reset(),this.textarea.disabled=c=="nocursor",this.textarea.readOnly=!!c},An.prototype.setUneditable=function(){},An.prototype.needsContentAttribute=!1;function lE(c,d){if(d=d?Ce(d):{},d.value=c.value,!d.tabindex&&c.tabIndex&&(d.tabindex=c.tabIndex),!d.placeholder&&c.placeholder&&(d.placeholder=c.placeholder),d.autofocus==null){var S=Z(ce(c));d.autofocus=S==c||c.getAttribute("autofocus")!=null&&S==document.body}function N(){c.value=te.getValue()}var T;if(c.form&&(X(c.form,"submit",N),!d.leaveSubmitMethodAlone)){var z=c.form;T=z.submit;try{var G=z.submit=function(){N(),z.submit=T,z.submit(),z.submit=G}}catch{}}d.finishInit=function(oe){oe.save=N,oe.getTextArea=function(){return c},oe.toTextArea=function(){oe.toTextArea=isNaN,N(),c.parentNode.removeChild(oe.getWrapperElement()),c.style.display="",c.form&&(Ye(c.form,"submit",N),!d.leaveSubmitMethodAlone&&typeof c.form.submit=="function"&&(c.form.submit=T))}},c.style.display="none";var te=ln(function(oe){return c.parentNode.insertBefore(oe,c.nextSibling)},d);return te}function fE(c){c.off=Ye,c.on=X,c.wheelEventPixels=LN,c.Doc=Qi,c.splitLines=ni,c.countColumn=Oe,c.findColumn=de,c.isWordChar=ut,c.Pass=We,c.signal=je,c.Line=Wl,c.changeEnd=mu,c.scrollbarModel=W1,c.Pos=rt,c.cmpPos=ke,c.modes=hs,c.mimeModes=so,c.resolveMode=nu,c.getMode=Ba,c.modeExtensions=jt,c.extendMode=Gi,c.copyState=Or,c.startState=So,c.innerMode=qt,c.commands=Zc,c.keyMap=As,c.keyName=vy,c.isModifierKey=dy,c.lookupKey=ul,c.normalizeKeyMap=hy,c.StringStream=Qr,c.SharedTextMarker=Ss,c.TextMarker=Io,c.LineWidget=lf,c.e_preventDefault=Gt,c.e_stopPropagation=xi,c.e_stop=ao,c.addClass=le,c.contains=Y,c.rmClass=U,c.keyNames=ca}rE(ln),oE(ln);var cE="iter insert remove copy getEditor constructor".split(" ");for(var Hm in Qi.prototype)Qi.prototype.hasOwnProperty(Hm)&&Se(cE,Hm)<0&&(ln.prototype[Hm]=function(c){return function(){return c.apply(this.doc,arguments)}}(Qi.prototype[Hm]));return Gr(Qi),ln.inputStyles={textarea:An,contenteditable:zr},ln.defineMode=function(c){!ln.defaults.mode&&c!="null"&&(ln.defaults.mode=c),uo.apply(this,arguments)},ln.defineMIME=ia,ln.defineMode("null",function(){return{token:function(c){return c.skipToEnd()}}}),ln.defineMIME("text/plain","null"),ln.defineExtension=function(c,d){ln.prototype[c]=d},ln.defineDocExtension=function(c,d){Qi.prototype[c]=d},ln.fromTextArea=lE,fE(ln),ln.version="5.65.16",ln})});var T$=vt((C$,M$)=>{g();y();v();(function(e){typeof C$=="object"&&typeof M$=="object"?e(Hs()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";e.defineMode("javascript",function(t,r){var n=t.indentUnit,i=r.statementIndent,o=r.jsonld,u=r.json||o,l=r.trackScope!==!1,a=r.typescript,s=r.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function ue(kn){return{type:kn,style:"keyword"}}var Me=ue("keyword a"),st=ue("keyword b"),dt=ue("keyword c"),rt=ue("keyword d"),ke=ue("operator"),Mr={type:"atom",style:"atom"};return{if:ue("if"),while:Me,with:Me,else:st,do:st,try:st,finally:st,return:rt,break:rt,continue:rt,new:ue("new"),delete:dt,void:dt,throw:dt,debugger:ue("debugger"),var:ue("var"),const:ue("var"),let:ue("var"),function:ue("function"),catch:ue("catch"),for:ue("for"),switch:ue("switch"),case:ue("case"),default:ue("default"),in:ke,typeof:ke,instanceof:ke,true:Mr,false:Mr,null:Mr,undefined:Mr,NaN:Mr,Infinity:Mr,this:ue("this"),class:ue("class"),super:ue("atom"),yield:dt,export:ue("export"),import:ue("import"),extends:dt,await:dt}}(),p=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function x(ue){for(var Me=!1,st,dt=!1;(st=ue.next())!=null;){if(!Me){if(st=="/"&&!dt)return;st=="["?dt=!0:dt&&st=="]"&&(dt=!1)}Me=!Me&&st=="\\"}}var b,w;function A(ue,Me,st){return b=ue,w=st,Me}function E(ue,Me){var st=ue.next();if(st=='"'||st=="'")return Me.tokenize=O(st),Me.tokenize(ue,Me);if(st=="."&&ue.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return A("number","number");if(st=="."&&ue.match(".."))return A("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(st))return A(st);if(st=="="&&ue.eat(">"))return A("=>","operator");if(st=="0"&&ue.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return A("number","number");if(/\d/.test(st))return ue.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),A("number","number");if(st=="/")return ue.eat("*")?(Me.tokenize=M,M(ue,Me)):ue.eat("/")?(ue.skipToEnd(),A("comment","comment")):$n(ue,Me,1)?(x(ue),ue.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),A("regexp","string-2")):(ue.eat("="),A("operator","operator",ue.current()));if(st=="`")return Me.tokenize=I,I(ue,Me);if(st=="#"&&ue.peek()=="!")return ue.skipToEnd(),A("meta","meta");if(st=="#"&&ue.eatWhile(s))return A("variable","property");if(st=="<"&&ue.match("!--")||st=="-"&&ue.match("->")&&!/\S/.test(ue.string.slice(0,ue.start)))return ue.skipToEnd(),A("comment","comment");if(p.test(st))return(st!=">"||!Me.lexical||Me.lexical.type!=">")&&(ue.eat("=")?(st=="!"||st=="=")&&ue.eat("="):/[<>*+\-|&?]/.test(st)&&(ue.eat(st),st==">"&&ue.eat(st))),st=="?"&&ue.eat(".")?A("."):A("operator","operator",ue.current());if(s.test(st)){ue.eatWhile(s);var dt=ue.current();if(Me.lastType!="."){if(f.propertyIsEnumerable(dt)){var rt=f[dt];return A(rt.type,rt.style,dt)}if(dt=="async"&&ue.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return A("async","keyword",dt)}return A("variable","variable",dt)}}function O(ue){return function(Me,st){var dt=!1,rt;if(o&&Me.peek()=="@"&&Me.match(h))return st.tokenize=E,A("jsonld-keyword","meta");for(;(rt=Me.next())!=null&&!(rt==ue&&!dt);)dt=!dt&&rt=="\\";return dt||(st.tokenize=E),A("string","string")}}function M(ue,Me){for(var st=!1,dt;dt=ue.next();){if(dt=="/"&&st){Me.tokenize=E;break}st=dt=="*"}return A("comment","comment")}function I(ue,Me){for(var st=!1,dt;(dt=ue.next())!=null;){if(!st&&(dt=="`"||dt=="$"&&ue.eat("{"))){Me.tokenize=E;break}st=!st&&dt=="\\"}return A("quasi","string-2",ue.current())}var F="([{}])";function C(ue,Me){Me.fatArrowAt&&(Me.fatArrowAt=null);var st=ue.string.indexOf("=>",ue.start);if(!(st<0)){if(a){var dt=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(ue.string.slice(ue.start,st));dt&&(st=dt.index)}for(var rt=0,ke=!1,Mr=st-1;Mr>=0;--Mr){var kn=ue.string.charAt(Mr),wi=F.indexOf(kn);if(wi>=0&&wi<3){if(!rt){++Mr;break}if(--rt==0){kn=="("&&(ke=!0);break}}else if(wi>=3&&wi<6)++rt;else if(s.test(kn))ke=!0;else if(/["'\/`]/.test(kn))for(;;--Mr){if(Mr==0)return;var iu=ue.string.charAt(Mr-1);if(iu==kn&&ue.string.charAt(Mr-2)!="\\"){Mr--;break}}else if(ke&&!rt){++Mr;break}}ke&&!rt&&(Me.fatArrowAt=Mr)}}var P={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function R(ue,Me,st,dt,rt,ke){this.indented=ue,this.column=Me,this.type=st,this.prev=rt,this.info=ke,dt!=null&&(this.align=dt)}function q(ue,Me){if(!l)return!1;for(var st=ue.localVars;st;st=st.next)if(st.name==Me)return!0;for(var dt=ue.context;dt;dt=dt.prev)for(var st=dt.vars;st;st=st.next)if(st.name==Me)return!0}function U(ue,Me,st,dt,rt){var ke=ue.cc;for(H.state=ue,H.stream=rt,H.marked=null,H.cc=ke,H.style=Me,ue.lexical.hasOwnProperty("align")||(ue.lexical.align=!0);;){var Mr=ke.length?ke.pop():u?Se:Oe;if(Mr(st,dt)){for(;ke.length&&ke[ke.length-1].lex;)ke.pop()();return H.marked?H.marked:st=="variable"&&q(ue,dt)?"variable-2":Me}}}var H={state:null,column:null,marked:null,cc:null};function V(){for(var ue=arguments.length-1;ue>=0;ue--)H.cc.push(arguments[ue])}function W(){return V.apply(null,arguments),!0}function ee(ue,Me){for(var st=Me;st;st=st.next)if(st.name==ue)return!0;return!1}function ie(ue){var Me=H.state;if(H.marked="def",!!l){if(Me.context){if(Me.lexical.info=="var"&&Me.context&&Me.context.block){var st=Y(ue,Me.context);if(st!=null){Me.context=st;return}}else if(!ee(ue,Me.localVars)){Me.localVars=new re(ue,Me.localVars);return}}r.globalVars&&!ee(ue,Me.globalVars)&&(Me.globalVars=new re(ue,Me.globalVars))}}function Y(ue,Me){if(Me)if(Me.block){var st=Y(ue,Me.prev);return st?st==Me.prev?Me:new le(st,Me.vars,!0):null}else return ee(ue,Me.vars)?Me:new le(Me.prev,new re(ue,Me.vars),!1);else return null}function Z(ue){return ue=="public"||ue=="private"||ue=="protected"||ue=="abstract"||ue=="readonly"}function le(ue,Me,st){this.prev=ue,this.vars=Me,this.block=st}function re(ue,Me){this.name=ue,this.next=Me}var he=new re("this",new re("arguments",null));function De(){H.state.context=new le(H.state.context,H.state.localVars,!1),H.state.localVars=he}function we(){H.state.context=new le(H.state.context,H.state.localVars,!0),H.state.localVars=null}De.lex=we.lex=!0;function ce(){H.state.localVars=H.state.context.vars,H.state.context=H.state.context.prev}ce.lex=!0;function Ee(ue,Me){var st=function(){var dt=H.state,rt=dt.indented;if(dt.lexical.type=="stat")rt=dt.lexical.indented;else for(var ke=dt.lexical;ke&&ke.type==")"&&ke.align;ke=ke.prev)rt=ke.indented;dt.lexical=new R(rt,H.stream.column(),ue,null,dt.lexical,Me)};return st.lex=!0,st}function Pe(){var ue=H.state;ue.lexical.prev&&(ue.lexical.type==")"&&(ue.indented=ue.lexical.indented),ue.lexical=ue.lexical.prev)}Pe.lex=!0;function Ce(ue){function Me(st){return st==ue?W():ue==";"||st=="}"||st==")"||st=="]"?V():W(Me)}return Me}function Oe(ue,Me){return ue=="var"?W(Ee("vardef",Me),xi,Ce(";"),Pe):ue=="keyword a"?W(Ee("form"),We,Oe,Pe):ue=="keyword b"?W(Ee("form"),Oe,Pe):ue=="keyword d"?H.stream.match(/^\s*$/,!1)?W():W(Ee("stat"),lt,Ce(";"),Pe):ue=="debugger"?W(Ce(";")):ue=="{"?W(Ee("}"),we,me,Pe,ce):ue==";"?W():ue=="if"?(H.state.lexical.info=="else"&&H.state.cc[H.state.cc.length-1]==Pe&&H.state.cc.pop()(),W(Ee("form"),We,Oe,Pe,ka)):ue=="function"?W(ni):ue=="for"?W(Ee("form"),we,Hn,Oe,ce,Pe):ue=="class"||a&&Me=="interface"?(H.marked="keyword",W(Ee("form",ue=="class"?ue:Me),hs,Pe)):ue=="variable"?a&&Me=="declare"?(H.marked="keyword",W(Oe)):a&&(Me=="module"||Me=="enum"||Me=="type")&&H.stream.match(/^\s*\w/,!1)?(H.marked="keyword",Me=="enum"?W(zt):Me=="type"?W(Ul,Ce("operator"),Xe,Ce(";")):W(Ee("form"),rr,Ce("{"),Ee("}"),me,Pe,Pe)):a&&Me=="namespace"?(H.marked="keyword",W(Ee("form"),Se,Oe,Pe)):a&&Me=="abstract"?(H.marked="keyword",W(Oe)):W(Ee("stat"),Qe):ue=="switch"?W(Ee("form"),We,Ce("{"),Ee("}","switch"),we,me,Pe,Pe,ce):ue=="case"?W(Se,Ce(":")):ue=="default"?W(Ce(":")):ue=="catch"?W(Ee("form"),De,He,Oe,Pe,ce):ue=="export"?W(Ee("stat"),nu,Pe):ue=="import"?W(Ee("stat"),jt,Pe):ue=="async"?W(Oe):Me=="@"?W(Se,Oe):V(Ee("stat"),Se,Ce(";"),Pe)}function He(ue){if(ue=="(")return W(Eo,Ce(")"))}function Se(ue,Me){return Le(ue,Me,!1)}function ze(ue,Me){return Le(ue,Me,!0)}function We(ue){return ue!="("?V():W(Ee(")"),lt,Ce(")"),Pe)}function Le(ue,Me,st){if(H.state.fatArrowAt==H.stream.start){var dt=st?Re:ge;if(ue=="(")return W(De,Ee(")"),j(Eo,")"),Pe,Ce("=>"),dt,ce);if(ue=="variable")return V(De,rr,Ce("=>"),dt,ce)}var rt=st?de:ct;return P.hasOwnProperty(ue)?W(rt):ue=="function"?W(ni,rt):ue=="class"||a&&Me=="interface"?(H.marked="keyword",W(Ee("form"),fc,Pe)):ue=="keyword c"||ue=="async"?W(st?ze:Se):ue=="("?W(Ee(")"),lt,Ce(")"),Pe,rt):ue=="operator"||ue=="spread"?W(st?ze:Se):ue=="["?W(Ee("]"),Qr,Pe,rt):ue=="{"?ne(Pt,"}",null,rt):ue=="quasi"?V(be,rt):ue=="new"?W(Be(st)):W()}function lt(ue){return ue.match(/[;\}\)\],]/)?V():V(Se)}function ct(ue,Me){return ue==","?W(lt):de(ue,Me,!1)}function de(ue,Me,st){var dt=st==!1?ct:de,rt=st==!1?Se:ze;if(ue=="=>")return W(De,st?Re:ge,ce);if(ue=="operator")return/\+\+|--/.test(Me)||a&&Me=="!"?W(dt):a&&Me=="<"&&H.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?W(Ee(">"),j(Xe,">"),Pe,dt):Me=="?"?W(Se,Ce(":"),rt):W(rt);if(ue=="quasi")return V(be,dt);if(ue!=";"){if(ue=="(")return ne(ze,")","call",dt);if(ue==".")return W(ut,dt);if(ue=="[")return W(Ee("]"),lt,Ce("]"),Pe,dt);if(a&&Me=="as")return H.marked="keyword",W(Xe,dt);if(ue=="regexp")return H.state.lastType=H.marked="operator",H.stream.backUp(H.stream.pos-H.stream.start-1),W(rt)}}function be(ue,Me){return ue!="quasi"?V():Me.slice(Me.length-2)!="${"?W(be):W(lt,Ue)}function Ue(ue){if(ue=="}")return H.marked="string-2",H.state.tokenize=I,W(be)}function ge(ue){return C(H.stream,H.state),V(ue=="{"?Oe:Se)}function Re(ue){return C(H.stream,H.state),V(ue=="{"?Oe:ze)}function Be(ue){return function(Me){return Me=="."?W(ue?ot:Ke):Me=="variable"&&a?W(fr,ue?de:ct):V(ue?ze:Se)}}function Ke(ue,Me){if(Me=="target")return H.marked="keyword",W(ct)}function ot(ue,Me){if(Me=="target")return H.marked="keyword",W(de)}function Qe(ue){return ue==":"?W(Pe,Oe):V(ct,Ce(";"),Pe)}function ut(ue){if(ue=="variable")return H.marked="property",W()}function Pt(ue,Me){if(ue=="async")return H.marked="property",W(Pt);if(ue=="variable"||H.style=="keyword"){if(H.marked="property",Me=="get"||Me=="set")return W(fe);var st;return a&&H.state.fatArrowAt==H.stream.start&&(st=H.stream.match(/^\s*:\s*/,!1))&&(H.state.fatArrowAt=H.stream.pos+st[0].length),W(J)}else{if(ue=="number"||ue=="string")return H.marked=o?"property":H.style+" property",W(J);if(ue=="jsonld-keyword")return W(J);if(a&&Z(Me))return H.marked="keyword",W(Pt);if(ue=="[")return W(Se,xe,Ce("]"),J);if(ue=="spread")return W(ze,J);if(Me=="*")return H.marked="keyword",W(Pt);if(ue==":")return V(J)}}function fe(ue){return ue!="variable"?V(J):(H.marked="property",W(ni))}function J(ue){if(ue==":")return W(ze);if(ue=="(")return V(ni)}function j(ue,Me,st){function dt(rt,ke){if(st?st.indexOf(rt)>-1:rt==","){var Mr=H.state.lexical;return Mr.info=="call"&&(Mr.pos=(Mr.pos||0)+1),W(function(kn,wi){return kn==Me||wi==Me?V():V(ue)},dt)}return rt==Me||ke==Me?W():st&&st.indexOf(";")>-1?V(ue):W(Ce(Me))}return function(rt,ke){return rt==Me||ke==Me?W():V(ue,dt)}}function ne(ue,Me,st){for(var dt=3;dt"),Xe);if(ue=="quasi")return V(Ye,Bt)}function pt(ue){if(ue=="=>")return W(Xe)}function X(ue){return ue.match(/[\}\)\]]/)?W():ue==","||ue==";"?W(X):V(ye,X)}function ye(ue,Me){if(ue=="variable"||H.style=="keyword")return H.marked="property",W(ye);if(Me=="?"||ue=="number"||ue=="string")return W(ye);if(ue==":")return W(Xe);if(ue=="[")return W(Ce("variable"),_e,Ce("]"),ye);if(ue=="(")return V(na,ye);if(!ue.match(/[;\}\)\],]/))return W()}function Ye(ue,Me){return ue!="quasi"?V():Me.slice(Me.length-2)!="${"?W(Ye):W(Xe,je)}function je(ue){if(ue=="}")return H.marked="string-2",H.state.tokenize=I,W(Ye)}function wt(ue,Me){return ue=="variable"&&H.stream.match(/^\s*[?:]/,!1)||Me=="?"?W(wt):ue==":"?W(Xe):ue=="spread"?W(wt):V(Xe)}function Bt(ue,Me){if(Me=="<")return W(Ee(">"),j(Xe,">"),Pe,Bt);if(Me=="|"||ue=="."||Me=="&")return W(Xe);if(ue=="[")return W(Xe,Ce("]"),Bt);if(Me=="extends"||Me=="implements")return H.marked="keyword",W(Xe);if(Me=="?")return W(Xe,Ce(":"),Xe)}function fr(ue,Me){if(Me=="<")return W(Ee(">"),j(Xe,">"),Pe,Bt)}function Gr(){return V(Xe,Gt)}function Gt(ue,Me){if(Me=="=")return W(Xe)}function xi(ue,Me){return Me=="enum"?(H.marked="keyword",W(zt)):V(rr,xe,_n,_a)}function rr(ue,Me){if(a&&Z(Me))return H.marked="keyword",W(rr);if(ue=="variable")return ie(Me),W();if(ue=="spread")return W(rr);if(ue=="[")return ne(Sr,"]");if(ue=="{")return ne(ao,"}")}function ao(ue,Me){return ue=="variable"&&!H.stream.match(/^\s*:/,!1)?(ie(Me),W(_n)):(ue=="variable"&&(H.marked="property"),ue=="spread"?W(rr):ue=="}"?V():ue=="["?W(Se,Ce("]"),Ce(":"),ao):W(Ce(":"),rr,_n))}function Sr(){return V(rr,_n)}function _n(ue,Me){if(Me=="=")return W(ze)}function _a(ue){if(ue==",")return W(xi)}function ka(ue,Me){if(ue=="keyword b"&&Me=="else")return W(Ee("form","else"),Oe,Pe)}function Hn(ue,Me){if(Me=="await")return W(Hn);if(ue=="(")return W(Ee(")"),ra,Pe)}function ra(ue){return ue=="var"?W(xi,qo):ue=="variable"?W(qo):V(qo)}function qo(ue,Me){return ue==")"?W():ue==";"?W(qo):Me=="in"||Me=="of"?(H.marked="keyword",W(Se,qo)):V(Se,qo)}function ni(ue,Me){if(Me=="*")return H.marked="keyword",W(ni);if(ue=="variable")return ie(Me),W(ni);if(ue=="(")return W(De,Ee(")"),j(Eo,")"),Pe,Je,Oe,ce);if(a&&Me=="<")return W(Ee(">"),j(Gr,">"),Pe,ni)}function na(ue,Me){if(Me=="*")return H.marked="keyword",W(na);if(ue=="variable")return ie(Me),W(na);if(ue=="(")return W(De,Ee(")"),j(Eo,")"),Pe,Je,ce);if(a&&Me=="<")return W(Ee(">"),j(Gr,">"),Pe,na)}function Ul(ue,Me){if(ue=="keyword"||ue=="variable")return H.marked="type",W(Ul);if(Me=="<")return W(Ee(">"),j(Gr,">"),Pe)}function Eo(ue,Me){return Me=="@"&&W(Se,Eo),ue=="spread"?W(Eo):a&&Z(Me)?(H.marked="keyword",W(Eo)):a&&ue=="this"?W(xe,_n):V(rr,xe,_n)}function fc(ue,Me){return ue=="variable"?hs(ue,Me):so(ue,Me)}function hs(ue,Me){if(ue=="variable")return ie(Me),W(so)}function so(ue,Me){if(Me=="<")return W(Ee(">"),j(Gr,">"),Pe,so);if(Me=="extends"||Me=="implements"||a&&ue==",")return Me=="implements"&&(H.marked="keyword"),W(a?Xe:Se,so);if(ue=="{")return W(Ee("}"),uo,Pe)}function uo(ue,Me){if(ue=="async"||ue=="variable"&&(Me=="static"||Me=="get"||Me=="set"||a&&Z(Me))&&H.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return H.marked="keyword",W(uo);if(ue=="variable"||H.style=="keyword")return H.marked="property",W(ia,uo);if(ue=="number"||ue=="string")return W(ia,uo);if(ue=="[")return W(Se,xe,Ce("]"),ia,uo);if(Me=="*")return H.marked="keyword",W(uo);if(a&&ue=="(")return V(na,uo);if(ue==";"||ue==",")return W(uo);if(ue=="}")return W();if(Me=="@")return W(Se,uo)}function ia(ue,Me){if(Me=="!"||Me=="?")return W(ia);if(ue==":")return W(Xe,_n);if(Me=="=")return W(ze);var st=H.state.lexical.prev,dt=st&&st.info=="interface";return V(dt?na:ni)}function nu(ue,Me){return Me=="*"?(H.marked="keyword",W(So,Ce(";"))):Me=="default"?(H.marked="keyword",W(Se,Ce(";"))):ue=="{"?W(j(Ba,"}"),So,Ce(";")):V(Oe)}function Ba(ue,Me){if(Me=="as")return H.marked="keyword",W(Ce("variable"));if(ue=="variable")return V(ze,Ba)}function jt(ue){return ue=="string"?W():ue=="("?V(Se):ue=="."?V(ct):V(Gi,Or,So)}function Gi(ue,Me){return ue=="{"?ne(Gi,"}"):(ue=="variable"&&ie(Me),Me=="*"&&(H.marked="keyword"),W(qt))}function Or(ue){if(ue==",")return W(Gi,Or)}function qt(ue,Me){if(Me=="as")return H.marked="keyword",W(Gi)}function So(ue,Me){if(Me=="from")return H.marked="keyword",W(Se)}function Qr(ue){return ue=="]"?W():V(j(ze,"]"))}function zt(){return V(Ee("form"),rr,Ce("{"),Ee("}"),j(oa,"}"),Pe,Pe)}function oa(){return V(rr,_n)}function $u(ue,Me){return ue.lastType=="operator"||ue.lastType==","||p.test(Me.charAt(0))||/[,.]/.test(Me.charAt(0))}function $n(ue,Me,st){return Me.tokenize==E&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Me.lastType)||Me.lastType=="quasi"&&/\{\s*$/.test(ue.string.slice(0,ue.pos-(st||0)))}return{startState:function(ue){var Me={tokenize:E,lastType:"sof",cc:[],lexical:new R((ue||0)-n,0,"block",!1),localVars:r.localVars,context:r.localVars&&new le(null,null,!1),indented:ue||0};return r.globalVars&&typeof r.globalVars=="object"&&(Me.globalVars=r.globalVars),Me},token:function(ue,Me){if(ue.sol()&&(Me.lexical.hasOwnProperty("align")||(Me.lexical.align=!1),Me.indented=ue.indentation(),C(ue,Me)),Me.tokenize!=M&&ue.eatSpace())return null;var st=Me.tokenize(ue,Me);return b=="comment"?st:(Me.lastType=b=="operator"&&(w=="++"||w=="--")?"incdec":b,U(Me,st,b,w,ue))},indent:function(ue,Me){if(ue.tokenize==M||ue.tokenize==I)return e.Pass;if(ue.tokenize!=E)return 0;var st=Me&&Me.charAt(0),dt=ue.lexical,rt;if(!/^\s*else\b/.test(Me))for(var ke=ue.cc.length-1;ke>=0;--ke){var Mr=ue.cc[ke];if(Mr==Pe)dt=dt.prev;else if(Mr!=ka&&Mr!=ce)break}for(;(dt.type=="stat"||dt.type=="form")&&(st=="}"||(rt=ue.cc[ue.cc.length-1])&&(rt==ct||rt==de)&&!/^[,\.=+\-*:?[\(]/.test(Me));)dt=dt.prev;i&&dt.type==")"&&dt.prev.type=="stat"&&(dt=dt.prev);var kn=dt.type,wi=st==kn;return kn=="vardef"?dt.indented+(ue.lastType=="operator"||ue.lastType==","?dt.info.length+1:0):kn=="form"&&st=="{"?dt.indented:kn=="form"?dt.indented+n:kn=="stat"?dt.indented+($u(ue,Me)?i||n:0):dt.info=="switch"&&!wi&&r.doubleIndentSwitch!=!1?dt.indented+(/^(?:case|default)\b/.test(Me)?n:2*n):dt.align?dt.column+(wi?0:1):dt.indented+(wi?0:n)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:u?null:"/*",blockCommentEnd:u?null:"*/",blockCommentContinue:u?null:" * ",lineComment:u?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:u?"json":"javascript",jsonldMode:o,jsonMode:u,expressionAllowed:$n,skipExpression:function(ue){U(ue,"atom","atom","true",new e.StringStream("",2,null))}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})});var Db=vt((O$,I$)=>{g();y();v();(function(e){typeof O$=="object"&&typeof I$=="object"?e(Hs()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){function t(n,i,o){var u=n.getWrapperElement(),l;return l=u.appendChild(document.createElement("div")),o?l.className="CodeMirror-dialog CodeMirror-dialog-bottom":l.className="CodeMirror-dialog CodeMirror-dialog-top",typeof i=="string"?l.innerHTML=i:l.appendChild(i),e.addClass(u,"dialog-opened"),l}function r(n,i){n.state.currentNotificationClose&&n.state.currentNotificationClose(),n.state.currentNotificationClose=i}e.defineExtension("openDialog",function(n,i,o){o||(o={}),r(this,null);var u=t(this,n,o.bottom),l=!1,a=this;function s(h){if(typeof h=="string")f.value=h;else{if(l)return;l=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),a.focus(),o.onClose&&o.onClose(u)}}var f=u.getElementsByTagName("input")[0],p;return f?(f.focus(),o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&e.on(f,"input",function(h){o.onInput(h,f.value,s)}),o.onKeyUp&&e.on(f,"keyup",function(h){o.onKeyUp(h,f.value,s)}),e.on(f,"keydown",function(h){o&&o.onKeyDown&&o.onKeyDown(h,f.value,s)||((h.keyCode==27||o.closeOnEnter!==!1&&h.keyCode==13)&&(f.blur(),e.e_stop(h),s()),h.keyCode==13&&i(f.value,h))}),o.closeOnBlur!==!1&&e.on(u,"focusout",function(h){h.relatedTarget!==null&&s()})):(p=u.getElementsByTagName("button")[0])&&(e.on(p,"click",function(){s(),a.focus()}),o.closeOnBlur!==!1&&e.on(p,"blur",s),p.focus()),s}),e.defineExtension("openConfirm",function(n,i,o){r(this,null);var u=t(this,n,o&&o.bottom),l=u.getElementsByTagName("button"),a=!1,s=this,f=1;function p(){a||(a=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),s.focus())}l[0].focus();for(var h=0;h{g();y();v();(function(e){typeof F$=="object"&&typeof _$=="object"?e(Hs()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){e.defineOption("placeholder","",function(l,a,s){var f=s&&s!=e.Init;if(a&&!f)l.on("blur",i),l.on("change",o),l.on("swapDoc",o),e.on(l.getInputField(),"compositionupdate",l.state.placeholderCompose=function(){n(l)}),o(l);else if(!a&&f){l.off("blur",i),l.off("change",o),l.off("swapDoc",o),e.off(l.getInputField(),"compositionupdate",l.state.placeholderCompose),t(l);var p=l.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}a&&!l.hasFocus()&&i(l)});function t(l){l.state.placeholder&&(l.state.placeholder.parentNode.removeChild(l.state.placeholder),l.state.placeholder=null)}function r(l){t(l);var a=l.state.placeholder=document.createElement("pre");a.style.cssText="height: 0; overflow: visible",a.style.direction=l.getOption("direction"),a.className="CodeMirror-placeholder CodeMirror-line-like";var s=l.getOption("placeholder");typeof s=="string"&&(s=document.createTextNode(s)),a.appendChild(s),l.display.lineSpace.insertBefore(a,l.display.lineSpace.firstChild)}function n(l){setTimeout(function(){var a=!1;if(l.lineCount()==1){var s=l.getInputField();a=s.nodeName=="TEXTAREA"?!l.getLine(0).length:!/[^\u200b]/.test(s.querySelector(".CodeMirror-line").textContent)}a?r(l):t(l)},20)}function i(l){u(l)&&r(l)}function o(l){var a=l.getWrapperElement(),s=u(l);a.className=a.className.replace(" CodeMirror-empty","")+(s?" CodeMirror-empty":""),s?r(l):t(l)}function u(l){return l.lineCount()===1&&l.getLine(0)===""}})});var P$=vt((B$,L$)=>{g();y();v();(function(e){typeof B$=="object"&&typeof L$=="object"?e(Hs()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){var t={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},r=e.Pos;e.defineOption("autoCloseBrackets",!1,function(w,A,E){E&&E!=e.Init&&(w.removeKeyMap(i),w.state.closeBrackets=null),A&&(o(n(A,"pairs")),w.state.closeBrackets=A,w.addKeyMap(i))});function n(w,A){return A=="pairs"&&typeof w=="string"?w:typeof w=="object"&&w[A]!=null?w[A]:t[A]}var i={Backspace:a,Enter:s};function o(w){for(var A=0;A=0;M--){var F=O[M].head;w.replaceRange("",r(F.line,F.ch-1),r(F.line,F.ch+1),"+delete")}}function s(w){var A=l(w),E=A&&n(A,"explode");if(!E||w.getOption("disableInput"))return e.Pass;for(var O=w.listSelections(),M=0;M0?{line:F.head.line,ch:F.head.ch+A}:{line:F.head.line-1};E.push({anchor:C,head:C})}w.setSelections(E,M)}function p(w){var A=e.cmpPos(w.anchor,w.head)>0;return{anchor:new r(w.anchor.line,w.anchor.ch+(A?-1:1)),head:new r(w.head.line,w.head.ch+(A?1:-1))}}function h(w,A){var E=l(w);if(!E||w.getOption("disableInput"))return e.Pass;var O=n(E,"pairs"),M=O.indexOf(A);if(M==-1)return e.Pass;for(var I=n(E,"closeBefore"),F=n(E,"triples"),C=O.charAt(M+1)==A,P=w.listSelections(),R=M%2==0,q,U=0;U=0&&w.getRange(V,r(V.line,V.ch+3))==A+A+A?W="skipThree":W="skip";else if(C&&V.ch>1&&F.indexOf(A)>=0&&w.getRange(r(V.line,V.ch-2),V)==A+A){if(V.ch>2&&/\bstring/.test(w.getTokenTypeAt(r(V.line,V.ch-2))))return e.Pass;W="addFour"}else if(C){var ie=V.ch==0?" ":w.getRange(r(V.line,V.ch-1),V);if(!e.isWordChar(ee)&&ie!=A&&!e.isWordChar(ie))W="both";else return e.Pass}else if(R&&(ee.length===0||/\s/.test(ee)||I.indexOf(ee)>-1))W="both";else return e.Pass;if(!q)q=W;else if(q!=W)return e.Pass}var Y=M%2?O.charAt(M-1):A,Z=M%2?A:O.charAt(M+1);w.operation(function(){if(q=="skip")f(w,1);else if(q=="skipThree")f(w,3);else if(q=="surround"){for(var le=w.getSelections(),re=0;re{g();y();v();(function(e){typeof R$=="object"&&typeof q$=="object"?e(Hs()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),r=e.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(f){return f&&f.bracketRegex||/[(){}[\]]/}function o(f,p,h){var x=f.getLineHandle(p.line),b=p.ch-1,w=h&&h.afterCursor;w==null&&(w=/(^| )cm-fat-cursor($| )/.test(f.getWrapperElement().className));var A=i(h),E=!w&&b>=0&&A.test(x.text.charAt(b))&&n[x.text.charAt(b)]||A.test(x.text.charAt(b+1))&&n[x.text.charAt(++b)];if(!E)return null;var O=E.charAt(1)==">"?1:-1;if(h&&h.strict&&O>0!=(b==p.ch))return null;var M=f.getTokenTypeAt(r(p.line,b+1)),I=u(f,r(p.line,b+(O>0?1:0)),O,M,h);return I==null?null:{from:r(p.line,b),to:I&&I.pos,match:I&&I.ch==E.charAt(0),forward:O>0}}function u(f,p,h,x,b){for(var w=b&&b.maxScanLineLength||1e4,A=b&&b.maxScanLines||1e3,E=[],O=i(b),M=h>0?Math.min(p.line+A,f.lastLine()+1):Math.max(f.firstLine()-1,p.line-A),I=p.line;I!=M;I+=h){var F=f.getLine(I);if(F){var C=h>0?0:F.length-1,P=h>0?F.length:-1;if(!(F.length>w))for(I==p.line&&(C=p.ch-(h<0?1:0));C!=P;C+=h){var R=F.charAt(C);if(O.test(R)&&(x===void 0||(f.getTokenTypeAt(r(I,C+1))||"")==(x||""))){var q=n[R];if(q&&q.charAt(1)==">"==h>0)E.push(R);else if(E.length)E.pop();else return{pos:r(I,C),ch:R}}}}}return I-h==(h>0?f.lastLine():f.firstLine())?!1:null}function l(f,p,h){for(var x=f.state.matchBrackets.maxHighlightLineLength||1e3,b=h&&h.highlightNonMatching,w=[],A=f.listSelections(),E=0;E{g();y();v();(function(e){typeof U$=="object"&&typeof H$=="object"?e(Hs()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";var t="CodeMirror-hint",r="CodeMirror-hint-active";e.showHint=function(w,A,E){if(!A)return w.showHint(E);E&&E.async&&(A.async=!0);var O={hint:A};if(E)for(var M in E)O[M]=E[M];return w.showHint(O)},e.defineExtension("showHint",function(w){w=u(this,this.getCursor("start"),w);var A=this.listSelections();if(!(A.length>1)){if(this.somethingSelected()){if(!w.hint.supportsSelection)return;for(var E=0;EF.clientHeight+1:!1,Oe;setTimeout(function(){Oe=O.getScrollInfo()});var He=Pe.bottom-Ee;if(He>0){var Se=Pe.bottom-Pe.top,ze=Pe.top-(W.bottom-W.top)-2;Ee-Pe.topze&&(F.style.height=(Se=ze)+"px"),F.style.top=(ie=W.top-Se)+le+"px",Y=!1):F.style.height=Ee-Pe.top-2+"px"}var We=Pe.right-ce;if(Ce&&(We+=O.display.nativeBarWidth),We>0&&(Pe.right-Pe.left>ce&&(F.style.width=ce-5+"px",We-=Pe.right-Pe.left-ce),F.style.left=(ee=Math.max(W.left-We-Z,0))+"px"),Ce)for(var Le=F.firstChild;Le;Le=Le.nextSibling)Le.style.paddingRight=O.display.nativeBarWidth+"px";if(O.addKeyMap(this.keyMap=a(w,{moveFocus:function(de,be){E.changeActive(E.selectedHint+de,be)},setFocus:function(de){E.changeActive(de)},menuSize:function(){return E.screenAmount()},length:P.length,close:function(){w.close()},pick:function(){E.pick()},data:A})),w.options.closeOnUnfocus){var lt;O.on("blur",this.onBlur=function(){lt=setTimeout(function(){w.close()},100)}),O.on("focus",this.onFocus=function(){clearTimeout(lt)})}O.on("scroll",this.onScroll=function(){var de=O.getScrollInfo(),be=O.getWrapperElement().getBoundingClientRect();Oe||(Oe=O.getScrollInfo());var Ue=ie+Oe.top-de.top,ge=Ue-(I.pageYOffset||(M.documentElement||M.body).scrollTop);if(Y||(ge+=F.offsetHeight),ge<=be.top||ge>=be.bottom)return w.close();F.style.top=Ue+"px",F.style.left=ee+Oe.left-de.left+"px"}),e.on(F,"dblclick",function(de){var be=s(F,de.target||de.srcElement);be&&be.hintId!=null&&(E.changeActive(be.hintId),E.pick())}),e.on(F,"click",function(de){var be=s(F,de.target||de.srcElement);be&&be.hintId!=null&&(E.changeActive(be.hintId),w.options.completeOnSingleClick&&E.pick())}),e.on(F,"mousedown",function(){setTimeout(function(){O.focus()},20)});var ct=this.getSelectedHintRange();return(ct.from!==0||ct.to!==0)&&this.scrollToActive(),e.signal(A,"select",P[this.selectedHint],F.childNodes[this.selectedHint]),!0}f.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var w=this.completion.cm.getInputField();w.removeAttribute("aria-activedescendant"),w.removeAttribute("aria-owns");var A=this.completion.cm;this.completion.options.closeOnUnfocus&&(A.off("blur",this.onBlur),A.off("focus",this.onFocus)),A.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var w=this;this.keyMap={Enter:function(){w.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(w,A){if(w>=this.data.list.length?w=A?this.data.list.length-1:0:w<0&&(w=A?0:this.data.list.length-1),this.selectedHint!=w){var E=this.hints.childNodes[this.selectedHint];E&&(E.className=E.className.replace(" "+r,""),E.removeAttribute("aria-selected")),E=this.hints.childNodes[this.selectedHint=w],E.className+=" "+r,E.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",E.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],E)}},scrollToActive:function(){var w=this.getSelectedHintRange(),A=this.hints.childNodes[w.from],E=this.hints.childNodes[w.to],O=this.hints.firstChild;A.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=E.offsetTop+E.offsetHeight-this.hints.clientHeight+O.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var w=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-w),to:Math.min(this.data.list.length-1,this.selectedHint+w)}}};function p(w,A){if(!w.somethingSelected())return A;for(var E=[],O=0;O0?F(U):R(q+1)})}R(0)};return M.async=!0,M.supportsSelection=!0,M}else return(O=w.getHelper(w.getCursor(),"hintWords"))?function(I){return e.hint.fromList(I,{words:O})}:e.hint.anyword?function(I,F){return e.hint.anyword(I,F)}:function(){}}e.registerHelper("hint","auto",{resolve:x}),e.registerHelper("hint","fromList",function(w,A){var E=w.getCursor(),O=w.getTokenAt(E),M,I=e.Pos(E.line,O.start),F=E;O.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)})});var G$=vt((W$,V$)=>{g();y();v();(function(e){typeof W$=="object"&&typeof V$=="object"?e(Hs(),Db()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)})(function(e){"use strict";e.defineOption("search",{bottom:!1});function t(i,o,u,l,a){i.openDialog?i.openDialog(o,a,{value:l,selectValueOnOpen:!0,bottom:i.options.search.bottom}):a(prompt(u,l))}function r(i){return i.phrase("Jump to line:")+' '+i.phrase("(Use line:column or scroll% syntax)")+""}function n(i,o){var u=Number(o);return/^[-+]/.test(o)?i.getCursor().line+u:u-1}e.commands.jumpToLine=function(i){var o=i.getCursor();t(i,r(i),i.phrase("Jump to line:"),o.line+1+":"+o.ch,function(u){if(u){var l;if(l=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(u))i.setCursor(n(i,l[1]),Number(l[2]));else if(l=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(u)){var a=Math.round(i.lineCount()*Number(l[1])/100);/^[-+]/.test(l[1])&&(a=o.line+a+1),i.setCursor(a-1,o.ch)}else(l=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(u))&&i.setCursor(n(i,l[1]),o.ch)}})},e.keyMap.default["Alt-G"]="jumpToLine"})});var kC=vt((Y$,Z$)=>{g();y();v();(function(e){typeof Y$=="object"&&typeof Z$=="object"?e(Hs()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";var t=e.Pos;function r(A){var E=A.flags;return E??(A.ignoreCase?"i":"")+(A.global?"g":"")+(A.multiline?"m":"")}function n(A,E){for(var O=r(A),M=O,I=0;IC);P++){var R=A.getLine(F++);M=M==null?R:M+` -`+R}I=I*2,E.lastIndex=O.ch;var q=E.exec(M);if(q){var U=M.slice(0,q.index).split(` + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ie;a&&(Ie=T.ownerDocument.defaultView.scrollY),N.input.focus(),a&&T.ownerDocument.defaultView.scrollTo(null,Ie),N.input.reset(),E.somethingSelected()||(T.value=d.prevInput=" "),d.contextMenuPending=$e,N.selForContextMenu=E.doc.sel,clearTimeout(N.detectingSelectAll);function Ze(){if(T.selectionStart!=null){var mt=E.somethingSelected(),yt="\u200B"+(mt?T.value:"");T.value="\u21DA",T.value=yt,d.prevInput=mt?"":"\u200B",T.selectionStart=1,T.selectionEnd=yt.length,N.selForContextMenu=E.doc.sel}}function $e(){if(d.contextMenuPending==$e&&(d.contextMenuPending=!1,d.wrapper.style.cssText=se,T.style.cssText=oe,u&&l<9&&N.scrollbars.setScrollTop(N.scroller.scrollTop=G),T.selectionStart!=null)){(!u||u&&l<9)&&Ze();var mt=0,yt=function(){N.selForContextMenu==E.doc.sel&&T.selectionStart==0&&T.selectionEnd>0&&d.prevInput=="\u200B"?oi(E,ix)(E):mt++<10?N.detectingSelectAll=setTimeout(yt,500):(N.selForContextMenu=null,N.input.reset())};N.detectingSelectAll=setTimeout(yt,200)}}if(u&&l>=9&&Ze(),R){ao(c);var at=function(){Ye(window,"mouseup",at),setTimeout($e,20)};X(window,"mouseup",at)}else setTimeout($e,50)},An.prototype.readOnlyChanged=function(c){c||this.reset(),this.textarea.disabled=c=="nocursor",this.textarea.readOnly=!!c},An.prototype.setUneditable=function(){},An.prototype.needsContentAttribute=!1;function lS(c,d){if(d=d?Ce(d):{},d.value=c.value,!d.tabindex&&c.tabIndex&&(d.tabindex=c.tabIndex),!d.placeholder&&c.placeholder&&(d.placeholder=c.placeholder),d.autofocus==null){var E=Z(ce(c));d.autofocus=E==c||c.getAttribute("autofocus")!=null&&E==document.body}function N(){c.value=te.getValue()}var T;if(c.form&&(X(c.form,"submit",N),!d.leaveSubmitMethodAlone)){var z=c.form;T=z.submit;try{var G=z.submit=function(){N(),z.submit=T,z.submit(),z.submit=G}}catch{}}d.finishInit=function(oe){oe.save=N,oe.getTextArea=function(){return c},oe.toTextArea=function(){oe.toTextArea=isNaN,N(),c.parentNode.removeChild(oe.getWrapperElement()),c.style.display="",c.form&&(Ye(c.form,"submit",N),!d.leaveSubmitMethodAlone&&typeof c.form.submit=="function"&&(c.form.submit=T))}},c.style.display="none";var te=un(function(oe){return c.parentNode.insertBefore(oe,c.nextSibling)},d);return te}function fS(c){c.off=Ye,c.on=X,c.wheelEventPixels=LN,c.Doc=Qi,c.splitLines=ni,c.countColumn=Oe,c.findColumn=de,c.isWordChar=ut,c.Pass=We,c.signal=je,c.Line=Vl,c.changeEnd=pu,c.scrollbarModel=W1,c.Pos=rt,c.cmpPos=ke,c.modes=ms,c.mimeModes=so,c.resolveMode=ru,c.getMode=Ba,c.modeExtensions=jt,c.extendMode=Gi,c.copyState=Or,c.startState=Eo,c.innerMode=qt,c.commands=Zc,c.keyMap=Es,c.keyName=vx,c.isModifierKey=dx,c.lookupKey=ul,c.normalizeKeyMap=hx,c.StringStream=Qr,c.SharedTextMarker=Ss,c.TextMarker=Io,c.LineWidget=ff,c.e_preventDefault=Gt,c.e_stopPropagation=yi,c.e_stop=ao,c.addClass=le,c.contains=Y,c.rmClass=U,c.keyNames=ca}rS(un),oS(un);var cS="iter insert remove copy getEditor constructor".split(" ");for(var Hm in Qi.prototype)Qi.prototype.hasOwnProperty(Hm)&&Ee(cS,Hm)<0&&(un.prototype[Hm]=function(c){return function(){return c.apply(this.doc,arguments)}}(Qi.prototype[Hm]));return Gr(Qi),un.inputStyles={textarea:An,contenteditable:zr},un.defineMode=function(c){!un.defaults.mode&&c!="null"&&(un.defaults.mode=c),uo.apply(this,arguments)},un.defineMIME=ia,un.defineMode("null",function(){return{token:function(c){return c.skipToEnd()}}}),un.defineMIME("text/plain","null"),un.defineExtension=function(c,d){un.prototype[c]=d},un.defineDocExtension=function(c,d){Qi.prototype[c]=d},un.fromTextArea=lS,fS(un),un.version="5.65.16",un})});var T$=vt((C$,M$)=>{g();x();v();(function(e){typeof C$=="object"&&typeof M$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";e.defineMode("javascript",function(t,r){var n=t.indentUnit,i=r.statementIndent,o=r.jsonld,u=r.json||o,l=r.trackScope!==!1,a=r.typescript,s=r.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function ue(kn){return{type:kn,style:"keyword"}}var Me=ue("keyword a"),st=ue("keyword b"),dt=ue("keyword c"),rt=ue("keyword d"),ke=ue("operator"),Mr={type:"atom",style:"atom"};return{if:ue("if"),while:Me,with:Me,else:st,do:st,try:st,finally:st,return:rt,break:rt,continue:rt,new:ue("new"),delete:dt,void:dt,throw:dt,debugger:ue("debugger"),var:ue("var"),const:ue("var"),let:ue("var"),function:ue("function"),catch:ue("catch"),for:ue("for"),switch:ue("switch"),case:ue("case"),default:ue("default"),in:ke,typeof:ke,instanceof:ke,true:Mr,false:Mr,null:Mr,undefined:Mr,NaN:Mr,Infinity:Mr,this:ue("this"),class:ue("class"),super:ue("atom"),yield:dt,export:ue("export"),import:ue("import"),extends:dt,await:dt}}(),p=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function y(ue){for(var Me=!1,st,dt=!1;(st=ue.next())!=null;){if(!Me){if(st=="/"&&!dt)return;st=="["?dt=!0:dt&&st=="]"&&(dt=!1)}Me=!Me&&st=="\\"}}var b,w;function A(ue,Me,st){return b=ue,w=st,Me}function S(ue,Me){var st=ue.next();if(st=='"'||st=="'")return Me.tokenize=O(st),Me.tokenize(ue,Me);if(st=="."&&ue.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return A("number","number");if(st=="."&&ue.match(".."))return A("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(st))return A(st);if(st=="="&&ue.eat(">"))return A("=>","operator");if(st=="0"&&ue.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return A("number","number");if(/\d/.test(st))return ue.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),A("number","number");if(st=="/")return ue.eat("*")?(Me.tokenize=M,M(ue,Me)):ue.eat("/")?(ue.skipToEnd(),A("comment","comment")):$n(ue,Me,1)?(y(ue),ue.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),A("regexp","string-2")):(ue.eat("="),A("operator","operator",ue.current()));if(st=="`")return Me.tokenize=I,I(ue,Me);if(st=="#"&&ue.peek()=="!")return ue.skipToEnd(),A("meta","meta");if(st=="#"&&ue.eatWhile(s))return A("variable","property");if(st=="<"&&ue.match("!--")||st=="-"&&ue.match("->")&&!/\S/.test(ue.string.slice(0,ue.start)))return ue.skipToEnd(),A("comment","comment");if(p.test(st))return(st!=">"||!Me.lexical||Me.lexical.type!=">")&&(ue.eat("=")?(st=="!"||st=="=")&&ue.eat("="):/[<>*+\-|&?]/.test(st)&&(ue.eat(st),st==">"&&ue.eat(st))),st=="?"&&ue.eat(".")?A("."):A("operator","operator",ue.current());if(s.test(st)){ue.eatWhile(s);var dt=ue.current();if(Me.lastType!="."){if(f.propertyIsEnumerable(dt)){var rt=f[dt];return A(rt.type,rt.style,dt)}if(dt=="async"&&ue.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return A("async","keyword",dt)}return A("variable","variable",dt)}}function O(ue){return function(Me,st){var dt=!1,rt;if(o&&Me.peek()=="@"&&Me.match(h))return st.tokenize=S,A("jsonld-keyword","meta");for(;(rt=Me.next())!=null&&!(rt==ue&&!dt);)dt=!dt&&rt=="\\";return dt||(st.tokenize=S),A("string","string")}}function M(ue,Me){for(var st=!1,dt;dt=ue.next();){if(dt=="/"&&st){Me.tokenize=S;break}st=dt=="*"}return A("comment","comment")}function I(ue,Me){for(var st=!1,dt;(dt=ue.next())!=null;){if(!st&&(dt=="`"||dt=="$"&&ue.eat("{"))){Me.tokenize=S;break}st=!st&&dt=="\\"}return A("quasi","string-2",ue.current())}var F="([{}])";function C(ue,Me){Me.fatArrowAt&&(Me.fatArrowAt=null);var st=ue.string.indexOf("=>",ue.start);if(!(st<0)){if(a){var dt=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(ue.string.slice(ue.start,st));dt&&(st=dt.index)}for(var rt=0,ke=!1,Mr=st-1;Mr>=0;--Mr){var kn=ue.string.charAt(Mr),wi=F.indexOf(kn);if(wi>=0&&wi<3){if(!rt){++Mr;break}if(--rt==0){kn=="("&&(ke=!0);break}}else if(wi>=3&&wi<6)++rt;else if(s.test(kn))ke=!0;else if(/["'\/`]/.test(kn))for(;;--Mr){if(Mr==0)return;var nu=ue.string.charAt(Mr-1);if(nu==kn&&ue.string.charAt(Mr-2)!="\\"){Mr--;break}}else if(ke&&!rt){++Mr;break}}ke&&!rt&&(Me.fatArrowAt=Mr)}}var P={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function R(ue,Me,st,dt,rt,ke){this.indented=ue,this.column=Me,this.type=st,this.prev=rt,this.info=ke,dt!=null&&(this.align=dt)}function q(ue,Me){if(!l)return!1;for(var st=ue.localVars;st;st=st.next)if(st.name==Me)return!0;for(var dt=ue.context;dt;dt=dt.prev)for(var st=dt.vars;st;st=st.next)if(st.name==Me)return!0}function U(ue,Me,st,dt,rt){var ke=ue.cc;for(H.state=ue,H.stream=rt,H.marked=null,H.cc=ke,H.style=Me,ue.lexical.hasOwnProperty("align")||(ue.lexical.align=!0);;){var Mr=ke.length?ke.pop():u?Ee:Oe;if(Mr(st,dt)){for(;ke.length&&ke[ke.length-1].lex;)ke.pop()();return H.marked?H.marked:st=="variable"&&q(ue,dt)?"variable-2":Me}}}var H={state:null,column:null,marked:null,cc:null};function V(){for(var ue=arguments.length-1;ue>=0;ue--)H.cc.push(arguments[ue])}function W(){return V.apply(null,arguments),!0}function ee(ue,Me){for(var st=Me;st;st=st.next)if(st.name==ue)return!0;return!1}function ie(ue){var Me=H.state;if(H.marked="def",!!l){if(Me.context){if(Me.lexical.info=="var"&&Me.context&&Me.context.block){var st=Y(ue,Me.context);if(st!=null){Me.context=st;return}}else if(!ee(ue,Me.localVars)){Me.localVars=new re(ue,Me.localVars);return}}r.globalVars&&!ee(ue,Me.globalVars)&&(Me.globalVars=new re(ue,Me.globalVars))}}function Y(ue,Me){if(Me)if(Me.block){var st=Y(ue,Me.prev);return st?st==Me.prev?Me:new le(st,Me.vars,!0):null}else return ee(ue,Me.vars)?Me:new le(Me.prev,new re(ue,Me.vars),!1);else return null}function Z(ue){return ue=="public"||ue=="private"||ue=="protected"||ue=="abstract"||ue=="readonly"}function le(ue,Me,st){this.prev=ue,this.vars=Me,this.block=st}function re(ue,Me){this.name=ue,this.next=Me}var he=new re("this",new re("arguments",null));function De(){H.state.context=new le(H.state.context,H.state.localVars,!1),H.state.localVars=he}function we(){H.state.context=new le(H.state.context,H.state.localVars,!0),H.state.localVars=null}De.lex=we.lex=!0;function ce(){H.state.localVars=H.state.context.vars,H.state.context=H.state.context.prev}ce.lex=!0;function Se(ue,Me){var st=function(){var dt=H.state,rt=dt.indented;if(dt.lexical.type=="stat")rt=dt.lexical.indented;else for(var ke=dt.lexical;ke&&ke.type==")"&&ke.align;ke=ke.prev)rt=ke.indented;dt.lexical=new R(rt,H.stream.column(),ue,null,dt.lexical,Me)};return st.lex=!0,st}function Pe(){var ue=H.state;ue.lexical.prev&&(ue.lexical.type==")"&&(ue.indented=ue.lexical.indented),ue.lexical=ue.lexical.prev)}Pe.lex=!0;function Ce(ue){function Me(st){return st==ue?W():ue==";"||st=="}"||st==")"||st=="]"?V():W(Me)}return Me}function Oe(ue,Me){return ue=="var"?W(Se("vardef",Me),yi,Ce(";"),Pe):ue=="keyword a"?W(Se("form"),We,Oe,Pe):ue=="keyword b"?W(Se("form"),Oe,Pe):ue=="keyword d"?H.stream.match(/^\s*$/,!1)?W():W(Se("stat"),lt,Ce(";"),Pe):ue=="debugger"?W(Ce(";")):ue=="{"?W(Se("}"),we,me,Pe,ce):ue==";"?W():ue=="if"?(H.state.lexical.info=="else"&&H.state.cc[H.state.cc.length-1]==Pe&&H.state.cc.pop()(),W(Se("form"),We,Oe,Pe,ka)):ue=="function"?W(ni):ue=="for"?W(Se("form"),we,Hn,Oe,ce,Pe):ue=="class"||a&&Me=="interface"?(H.marked="keyword",W(Se("form",ue=="class"?ue:Me),ms,Pe)):ue=="variable"?a&&Me=="declare"?(H.marked="keyword",W(Oe)):a&&(Me=="module"||Me=="enum"||Me=="type")&&H.stream.match(/^\s*\w/,!1)?(H.marked="keyword",Me=="enum"?W(zt):Me=="type"?W(Hl,Ce("operator"),Xe,Ce(";")):W(Se("form"),rr,Ce("{"),Se("}"),me,Pe,Pe)):a&&Me=="namespace"?(H.marked="keyword",W(Se("form"),Ee,Oe,Pe)):a&&Me=="abstract"?(H.marked="keyword",W(Oe)):W(Se("stat"),Qe):ue=="switch"?W(Se("form"),We,Ce("{"),Se("}","switch"),we,me,Pe,Pe,ce):ue=="case"?W(Ee,Ce(":")):ue=="default"?W(Ce(":")):ue=="catch"?W(Se("form"),De,He,Oe,Pe,ce):ue=="export"?W(Se("stat"),ru,Pe):ue=="import"?W(Se("stat"),jt,Pe):ue=="async"?W(Oe):Me=="@"?W(Ee,Oe):V(Se("stat"),Ee,Ce(";"),Pe)}function He(ue){if(ue=="(")return W(So,Ce(")"))}function Ee(ue,Me){return Le(ue,Me,!1)}function ze(ue,Me){return Le(ue,Me,!0)}function We(ue){return ue!="("?V():W(Se(")"),lt,Ce(")"),Pe)}function Le(ue,Me,st){if(H.state.fatArrowAt==H.stream.start){var dt=st?Re:ge;if(ue=="(")return W(De,Se(")"),j(So,")"),Pe,Ce("=>"),dt,ce);if(ue=="variable")return V(De,rr,Ce("=>"),dt,ce)}var rt=st?de:ct;return P.hasOwnProperty(ue)?W(rt):ue=="function"?W(ni,rt):ue=="class"||a&&Me=="interface"?(H.marked="keyword",W(Se("form"),fc,Pe)):ue=="keyword c"||ue=="async"?W(st?ze:Ee):ue=="("?W(Se(")"),lt,Ce(")"),Pe,rt):ue=="operator"||ue=="spread"?W(st?ze:Ee):ue=="["?W(Se("]"),Qr,Pe,rt):ue=="{"?ne(Pt,"}",null,rt):ue=="quasi"?V(be,rt):ue=="new"?W(Be(st)):W()}function lt(ue){return ue.match(/[;\}\)\],]/)?V():V(Ee)}function ct(ue,Me){return ue==","?W(lt):de(ue,Me,!1)}function de(ue,Me,st){var dt=st==!1?ct:de,rt=st==!1?Ee:ze;if(ue=="=>")return W(De,st?Re:ge,ce);if(ue=="operator")return/\+\+|--/.test(Me)||a&&Me=="!"?W(dt):a&&Me=="<"&&H.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?W(Se(">"),j(Xe,">"),Pe,dt):Me=="?"?W(Ee,Ce(":"),rt):W(rt);if(ue=="quasi")return V(be,dt);if(ue!=";"){if(ue=="(")return ne(ze,")","call",dt);if(ue==".")return W(ut,dt);if(ue=="[")return W(Se("]"),lt,Ce("]"),Pe,dt);if(a&&Me=="as")return H.marked="keyword",W(Xe,dt);if(ue=="regexp")return H.state.lastType=H.marked="operator",H.stream.backUp(H.stream.pos-H.stream.start-1),W(rt)}}function be(ue,Me){return ue!="quasi"?V():Me.slice(Me.length-2)!="${"?W(be):W(lt,Ue)}function Ue(ue){if(ue=="}")return H.marked="string-2",H.state.tokenize=I,W(be)}function ge(ue){return C(H.stream,H.state),V(ue=="{"?Oe:Ee)}function Re(ue){return C(H.stream,H.state),V(ue=="{"?Oe:ze)}function Be(ue){return function(Me){return Me=="."?W(ue?ot:Ke):Me=="variable"&&a?W(fr,ue?de:ct):V(ue?ze:Ee)}}function Ke(ue,Me){if(Me=="target")return H.marked="keyword",W(ct)}function ot(ue,Me){if(Me=="target")return H.marked="keyword",W(de)}function Qe(ue){return ue==":"?W(Pe,Oe):V(ct,Ce(";"),Pe)}function ut(ue){if(ue=="variable")return H.marked="property",W()}function Pt(ue,Me){if(ue=="async")return H.marked="property",W(Pt);if(ue=="variable"||H.style=="keyword"){if(H.marked="property",Me=="get"||Me=="set")return W(fe);var st;return a&&H.state.fatArrowAt==H.stream.start&&(st=H.stream.match(/^\s*:\s*/,!1))&&(H.state.fatArrowAt=H.stream.pos+st[0].length),W(J)}else{if(ue=="number"||ue=="string")return H.marked=o?"property":H.style+" property",W(J);if(ue=="jsonld-keyword")return W(J);if(a&&Z(Me))return H.marked="keyword",W(Pt);if(ue=="[")return W(Ee,ye,Ce("]"),J);if(ue=="spread")return W(ze,J);if(Me=="*")return H.marked="keyword",W(Pt);if(ue==":")return V(J)}}function fe(ue){return ue!="variable"?V(J):(H.marked="property",W(ni))}function J(ue){if(ue==":")return W(ze);if(ue=="(")return V(ni)}function j(ue,Me,st){function dt(rt,ke){if(st?st.indexOf(rt)>-1:rt==","){var Mr=H.state.lexical;return Mr.info=="call"&&(Mr.pos=(Mr.pos||0)+1),W(function(kn,wi){return kn==Me||wi==Me?V():V(ue)},dt)}return rt==Me||ke==Me?W():st&&st.indexOf(";")>-1?V(ue):W(Ce(Me))}return function(rt,ke){return rt==Me||ke==Me?W():V(ue,dt)}}function ne(ue,Me,st){for(var dt=3;dt"),Xe);if(ue=="quasi")return V(Ye,Bt)}function pt(ue){if(ue=="=>")return W(Xe)}function X(ue){return ue.match(/[\}\)\]]/)?W():ue==","||ue==";"?W(X):V(xe,X)}function xe(ue,Me){if(ue=="variable"||H.style=="keyword")return H.marked="property",W(xe);if(Me=="?"||ue=="number"||ue=="string")return W(xe);if(ue==":")return W(Xe);if(ue=="[")return W(Ce("variable"),_e,Ce("]"),xe);if(ue=="(")return V(na,xe);if(!ue.match(/[;\}\)\],]/))return W()}function Ye(ue,Me){return ue!="quasi"?V():Me.slice(Me.length-2)!="${"?W(Ye):W(Xe,je)}function je(ue){if(ue=="}")return H.marked="string-2",H.state.tokenize=I,W(Ye)}function wt(ue,Me){return ue=="variable"&&H.stream.match(/^\s*[?:]/,!1)||Me=="?"?W(wt):ue==":"?W(Xe):ue=="spread"?W(wt):V(Xe)}function Bt(ue,Me){if(Me=="<")return W(Se(">"),j(Xe,">"),Pe,Bt);if(Me=="|"||ue=="."||Me=="&")return W(Xe);if(ue=="[")return W(Xe,Ce("]"),Bt);if(Me=="extends"||Me=="implements")return H.marked="keyword",W(Xe);if(Me=="?")return W(Xe,Ce(":"),Xe)}function fr(ue,Me){if(Me=="<")return W(Se(">"),j(Xe,">"),Pe,Bt)}function Gr(){return V(Xe,Gt)}function Gt(ue,Me){if(Me=="=")return W(Xe)}function yi(ue,Me){return Me=="enum"?(H.marked="keyword",W(zt)):V(rr,ye,_n,_a)}function rr(ue,Me){if(a&&Z(Me))return H.marked="keyword",W(rr);if(ue=="variable")return ie(Me),W();if(ue=="spread")return W(rr);if(ue=="[")return ne(Er,"]");if(ue=="{")return ne(ao,"}")}function ao(ue,Me){return ue=="variable"&&!H.stream.match(/^\s*:/,!1)?(ie(Me),W(_n)):(ue=="variable"&&(H.marked="property"),ue=="spread"?W(rr):ue=="}"?V():ue=="["?W(Ee,Ce("]"),Ce(":"),ao):W(Ce(":"),rr,_n))}function Er(){return V(rr,_n)}function _n(ue,Me){if(Me=="=")return W(ze)}function _a(ue){if(ue==",")return W(yi)}function ka(ue,Me){if(ue=="keyword b"&&Me=="else")return W(Se("form","else"),Oe,Pe)}function Hn(ue,Me){if(Me=="await")return W(Hn);if(ue=="(")return W(Se(")"),ra,Pe)}function ra(ue){return ue=="var"?W(yi,qo):ue=="variable"?W(qo):V(qo)}function qo(ue,Me){return ue==")"?W():ue==";"?W(qo):Me=="in"||Me=="of"?(H.marked="keyword",W(Ee,qo)):V(Ee,qo)}function ni(ue,Me){if(Me=="*")return H.marked="keyword",W(ni);if(ue=="variable")return ie(Me),W(ni);if(ue=="(")return W(De,Se(")"),j(So,")"),Pe,Je,Oe,ce);if(a&&Me=="<")return W(Se(">"),j(Gr,">"),Pe,ni)}function na(ue,Me){if(Me=="*")return H.marked="keyword",W(na);if(ue=="variable")return ie(Me),W(na);if(ue=="(")return W(De,Se(")"),j(So,")"),Pe,Je,ce);if(a&&Me=="<")return W(Se(">"),j(Gr,">"),Pe,na)}function Hl(ue,Me){if(ue=="keyword"||ue=="variable")return H.marked="type",W(Hl);if(Me=="<")return W(Se(">"),j(Gr,">"),Pe)}function So(ue,Me){return Me=="@"&&W(Ee,So),ue=="spread"?W(So):a&&Z(Me)?(H.marked="keyword",W(So)):a&&ue=="this"?W(ye,_n):V(rr,ye,_n)}function fc(ue,Me){return ue=="variable"?ms(ue,Me):so(ue,Me)}function ms(ue,Me){if(ue=="variable")return ie(Me),W(so)}function so(ue,Me){if(Me=="<")return W(Se(">"),j(Gr,">"),Pe,so);if(Me=="extends"||Me=="implements"||a&&ue==",")return Me=="implements"&&(H.marked="keyword"),W(a?Xe:Ee,so);if(ue=="{")return W(Se("}"),uo,Pe)}function uo(ue,Me){if(ue=="async"||ue=="variable"&&(Me=="static"||Me=="get"||Me=="set"||a&&Z(Me))&&H.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return H.marked="keyword",W(uo);if(ue=="variable"||H.style=="keyword")return H.marked="property",W(ia,uo);if(ue=="number"||ue=="string")return W(ia,uo);if(ue=="[")return W(Ee,ye,Ce("]"),ia,uo);if(Me=="*")return H.marked="keyword",W(uo);if(a&&ue=="(")return V(na,uo);if(ue==";"||ue==",")return W(uo);if(ue=="}")return W();if(Me=="@")return W(Ee,uo)}function ia(ue,Me){if(Me=="!"||Me=="?")return W(ia);if(ue==":")return W(Xe,_n);if(Me=="=")return W(ze);var st=H.state.lexical.prev,dt=st&&st.info=="interface";return V(dt?na:ni)}function ru(ue,Me){return Me=="*"?(H.marked="keyword",W(Eo,Ce(";"))):Me=="default"?(H.marked="keyword",W(Ee,Ce(";"))):ue=="{"?W(j(Ba,"}"),Eo,Ce(";")):V(Oe)}function Ba(ue,Me){if(Me=="as")return H.marked="keyword",W(Ce("variable"));if(ue=="variable")return V(ze,Ba)}function jt(ue){return ue=="string"?W():ue=="("?V(Ee):ue=="."?V(ct):V(Gi,Or,Eo)}function Gi(ue,Me){return ue=="{"?ne(Gi,"}"):(ue=="variable"&&ie(Me),Me=="*"&&(H.marked="keyword"),W(qt))}function Or(ue){if(ue==",")return W(Gi,Or)}function qt(ue,Me){if(Me=="as")return H.marked="keyword",W(Gi)}function Eo(ue,Me){if(Me=="from")return H.marked="keyword",W(Ee)}function Qr(ue){return ue=="]"?W():V(j(ze,"]"))}function zt(){return V(Se("form"),rr,Ce("{"),Se("}"),j(oa,"}"),Pe,Pe)}function oa(){return V(rr,_n)}function $u(ue,Me){return ue.lastType=="operator"||ue.lastType==","||p.test(Me.charAt(0))||/[,.]/.test(Me.charAt(0))}function $n(ue,Me,st){return Me.tokenize==S&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Me.lastType)||Me.lastType=="quasi"&&/\{\s*$/.test(ue.string.slice(0,ue.pos-(st||0)))}return{startState:function(ue){var Me={tokenize:S,lastType:"sof",cc:[],lexical:new R((ue||0)-n,0,"block",!1),localVars:r.localVars,context:r.localVars&&new le(null,null,!1),indented:ue||0};return r.globalVars&&typeof r.globalVars=="object"&&(Me.globalVars=r.globalVars),Me},token:function(ue,Me){if(ue.sol()&&(Me.lexical.hasOwnProperty("align")||(Me.lexical.align=!1),Me.indented=ue.indentation(),C(ue,Me)),Me.tokenize!=M&&ue.eatSpace())return null;var st=Me.tokenize(ue,Me);return b=="comment"?st:(Me.lastType=b=="operator"&&(w=="++"||w=="--")?"incdec":b,U(Me,st,b,w,ue))},indent:function(ue,Me){if(ue.tokenize==M||ue.tokenize==I)return e.Pass;if(ue.tokenize!=S)return 0;var st=Me&&Me.charAt(0),dt=ue.lexical,rt;if(!/^\s*else\b/.test(Me))for(var ke=ue.cc.length-1;ke>=0;--ke){var Mr=ue.cc[ke];if(Mr==Pe)dt=dt.prev;else if(Mr!=ka&&Mr!=ce)break}for(;(dt.type=="stat"||dt.type=="form")&&(st=="}"||(rt=ue.cc[ue.cc.length-1])&&(rt==ct||rt==de)&&!/^[,\.=+\-*:?[\(]/.test(Me));)dt=dt.prev;i&&dt.type==")"&&dt.prev.type=="stat"&&(dt=dt.prev);var kn=dt.type,wi=st==kn;return kn=="vardef"?dt.indented+(ue.lastType=="operator"||ue.lastType==","?dt.info.length+1:0):kn=="form"&&st=="{"?dt.indented:kn=="form"?dt.indented+n:kn=="stat"?dt.indented+($u(ue,Me)?i||n:0):dt.info=="switch"&&!wi&&r.doubleIndentSwitch!=!1?dt.indented+(/^(?:case|default)\b/.test(Me)?n:2*n):dt.align?dt.column+(wi?0:1):dt.indented+(wi?0:n)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:u?null:"/*",blockCommentEnd:u?null:"*/",blockCommentContinue:u?null:" * ",lineComment:u?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:u?"json":"javascript",jsonldMode:o,jsonMode:u,expressionAllowed:$n,skipExpression:function(ue){U(ue,"atom","atom","true",new e.StringStream("",2,null))}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})});var Db=vt((O$,I$)=>{g();x();v();(function(e){typeof O$=="object"&&typeof I$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){function t(n,i,o){var u=n.getWrapperElement(),l;return l=u.appendChild(document.createElement("div")),o?l.className="CodeMirror-dialog CodeMirror-dialog-bottom":l.className="CodeMirror-dialog CodeMirror-dialog-top",typeof i=="string"?l.innerHTML=i:l.appendChild(i),e.addClass(u,"dialog-opened"),l}function r(n,i){n.state.currentNotificationClose&&n.state.currentNotificationClose(),n.state.currentNotificationClose=i}e.defineExtension("openDialog",function(n,i,o){o||(o={}),r(this,null);var u=t(this,n,o.bottom),l=!1,a=this;function s(h){if(typeof h=="string")f.value=h;else{if(l)return;l=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),a.focus(),o.onClose&&o.onClose(u)}}var f=u.getElementsByTagName("input")[0],p;return f?(f.focus(),o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&e.on(f,"input",function(h){o.onInput(h,f.value,s)}),o.onKeyUp&&e.on(f,"keyup",function(h){o.onKeyUp(h,f.value,s)}),e.on(f,"keydown",function(h){o&&o.onKeyDown&&o.onKeyDown(h,f.value,s)||((h.keyCode==27||o.closeOnEnter!==!1&&h.keyCode==13)&&(f.blur(),e.e_stop(h),s()),h.keyCode==13&&i(f.value,h))}),o.closeOnBlur!==!1&&e.on(u,"focusout",function(h){h.relatedTarget!==null&&s()})):(p=u.getElementsByTagName("button")[0])&&(e.on(p,"click",function(){s(),a.focus()}),o.closeOnBlur!==!1&&e.on(p,"blur",s),p.focus()),s}),e.defineExtension("openConfirm",function(n,i,o){r(this,null);var u=t(this,n,o&&o.bottom),l=u.getElementsByTagName("button"),a=!1,s=this,f=1;function p(){a||(a=!0,e.rmClass(u.parentNode,"dialog-opened"),u.parentNode.removeChild(u),s.focus())}l[0].focus();for(var h=0;h{g();x();v();(function(e){typeof F$=="object"&&typeof _$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){e.defineOption("placeholder","",function(l,a,s){var f=s&&s!=e.Init;if(a&&!f)l.on("blur",i),l.on("change",o),l.on("swapDoc",o),e.on(l.getInputField(),"compositionupdate",l.state.placeholderCompose=function(){n(l)}),o(l);else if(!a&&f){l.off("blur",i),l.off("change",o),l.off("swapDoc",o),e.off(l.getInputField(),"compositionupdate",l.state.placeholderCompose),t(l);var p=l.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}a&&!l.hasFocus()&&i(l)});function t(l){l.state.placeholder&&(l.state.placeholder.parentNode.removeChild(l.state.placeholder),l.state.placeholder=null)}function r(l){t(l);var a=l.state.placeholder=document.createElement("pre");a.style.cssText="height: 0; overflow: visible",a.style.direction=l.getOption("direction"),a.className="CodeMirror-placeholder CodeMirror-line-like";var s=l.getOption("placeholder");typeof s=="string"&&(s=document.createTextNode(s)),a.appendChild(s),l.display.lineSpace.insertBefore(a,l.display.lineSpace.firstChild)}function n(l){setTimeout(function(){var a=!1;if(l.lineCount()==1){var s=l.getInputField();a=s.nodeName=="TEXTAREA"?!l.getLine(0).length:!/[^\u200b]/.test(s.querySelector(".CodeMirror-line").textContent)}a?r(l):t(l)},20)}function i(l){u(l)&&r(l)}function o(l){var a=l.getWrapperElement(),s=u(l);a.className=a.className.replace(" CodeMirror-empty","")+(s?" CodeMirror-empty":""),s?r(l):t(l)}function u(l){return l.lineCount()===1&&l.getLine(0)===""}})});var P$=vt((B$,L$)=>{g();x();v();(function(e){typeof B$=="object"&&typeof L$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){var t={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},r=e.Pos;e.defineOption("autoCloseBrackets",!1,function(w,A,S){S&&S!=e.Init&&(w.removeKeyMap(i),w.state.closeBrackets=null),A&&(o(n(A,"pairs")),w.state.closeBrackets=A,w.addKeyMap(i))});function n(w,A){return A=="pairs"&&typeof w=="string"?w:typeof w=="object"&&w[A]!=null?w[A]:t[A]}var i={Backspace:a,Enter:s};function o(w){for(var A=0;A=0;M--){var F=O[M].head;w.replaceRange("",r(F.line,F.ch-1),r(F.line,F.ch+1),"+delete")}}function s(w){var A=l(w),S=A&&n(A,"explode");if(!S||w.getOption("disableInput"))return e.Pass;for(var O=w.listSelections(),M=0;M0?{line:F.head.line,ch:F.head.ch+A}:{line:F.head.line-1};S.push({anchor:C,head:C})}w.setSelections(S,M)}function p(w){var A=e.cmpPos(w.anchor,w.head)>0;return{anchor:new r(w.anchor.line,w.anchor.ch+(A?-1:1)),head:new r(w.head.line,w.head.ch+(A?1:-1))}}function h(w,A){var S=l(w);if(!S||w.getOption("disableInput"))return e.Pass;var O=n(S,"pairs"),M=O.indexOf(A);if(M==-1)return e.Pass;for(var I=n(S,"closeBefore"),F=n(S,"triples"),C=O.charAt(M+1)==A,P=w.listSelections(),R=M%2==0,q,U=0;U=0&&w.getRange(V,r(V.line,V.ch+3))==A+A+A?W="skipThree":W="skip";else if(C&&V.ch>1&&F.indexOf(A)>=0&&w.getRange(r(V.line,V.ch-2),V)==A+A){if(V.ch>2&&/\bstring/.test(w.getTokenTypeAt(r(V.line,V.ch-2))))return e.Pass;W="addFour"}else if(C){var ie=V.ch==0?" ":w.getRange(r(V.line,V.ch-1),V);if(!e.isWordChar(ee)&&ie!=A&&!e.isWordChar(ie))W="both";else return e.Pass}else if(R&&(ee.length===0||/\s/.test(ee)||I.indexOf(ee)>-1))W="both";else return e.Pass;if(!q)q=W;else if(q!=W)return e.Pass}var Y=M%2?O.charAt(M-1):A,Z=M%2?A:O.charAt(M+1);w.operation(function(){if(q=="skip")f(w,1);else if(q=="skipThree")f(w,3);else if(q=="surround"){for(var le=w.getSelections(),re=0;re{g();x();v();(function(e){typeof R$=="object"&&typeof q$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),r=e.Pos,n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(f){return f&&f.bracketRegex||/[(){}[\]]/}function o(f,p,h){var y=f.getLineHandle(p.line),b=p.ch-1,w=h&&h.afterCursor;w==null&&(w=/(^| )cm-fat-cursor($| )/.test(f.getWrapperElement().className));var A=i(h),S=!w&&b>=0&&A.test(y.text.charAt(b))&&n[y.text.charAt(b)]||A.test(y.text.charAt(b+1))&&n[y.text.charAt(++b)];if(!S)return null;var O=S.charAt(1)==">"?1:-1;if(h&&h.strict&&O>0!=(b==p.ch))return null;var M=f.getTokenTypeAt(r(p.line,b+1)),I=u(f,r(p.line,b+(O>0?1:0)),O,M,h);return I==null?null:{from:r(p.line,b),to:I&&I.pos,match:I&&I.ch==S.charAt(0),forward:O>0}}function u(f,p,h,y,b){for(var w=b&&b.maxScanLineLength||1e4,A=b&&b.maxScanLines||1e3,S=[],O=i(b),M=h>0?Math.min(p.line+A,f.lastLine()+1):Math.max(f.firstLine()-1,p.line-A),I=p.line;I!=M;I+=h){var F=f.getLine(I);if(F){var C=h>0?0:F.length-1,P=h>0?F.length:-1;if(!(F.length>w))for(I==p.line&&(C=p.ch-(h<0?1:0));C!=P;C+=h){var R=F.charAt(C);if(O.test(R)&&(y===void 0||(f.getTokenTypeAt(r(I,C+1))||"")==(y||""))){var q=n[R];if(q&&q.charAt(1)==">"==h>0)S.push(R);else if(S.length)S.pop();else return{pos:r(I,C),ch:R}}}}}return I-h==(h>0?f.lastLine():f.firstLine())?!1:null}function l(f,p,h){for(var y=f.state.matchBrackets.maxHighlightLineLength||1e3,b=h&&h.highlightNonMatching,w=[],A=f.listSelections(),S=0;S{g();x();v();(function(e){typeof U$=="object"&&typeof H$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";var t="CodeMirror-hint",r="CodeMirror-hint-active";e.showHint=function(w,A,S){if(!A)return w.showHint(S);S&&S.async&&(A.async=!0);var O={hint:A};if(S)for(var M in S)O[M]=S[M];return w.showHint(O)},e.defineExtension("showHint",function(w){w=u(this,this.getCursor("start"),w);var A=this.listSelections();if(!(A.length>1)){if(this.somethingSelected()){if(!w.hint.supportsSelection)return;for(var S=0;SF.clientHeight+1:!1,Oe;setTimeout(function(){Oe=O.getScrollInfo()});var He=Pe.bottom-Se;if(He>0){var Ee=Pe.bottom-Pe.top,ze=Pe.top-(W.bottom-W.top)-2;Se-Pe.topze&&(F.style.height=(Ee=ze)+"px"),F.style.top=(ie=W.top-Ee)+le+"px",Y=!1):F.style.height=Se-Pe.top-2+"px"}var We=Pe.right-ce;if(Ce&&(We+=O.display.nativeBarWidth),We>0&&(Pe.right-Pe.left>ce&&(F.style.width=ce-5+"px",We-=Pe.right-Pe.left-ce),F.style.left=(ee=Math.max(W.left-We-Z,0))+"px"),Ce)for(var Le=F.firstChild;Le;Le=Le.nextSibling)Le.style.paddingRight=O.display.nativeBarWidth+"px";if(O.addKeyMap(this.keyMap=a(w,{moveFocus:function(de,be){S.changeActive(S.selectedHint+de,be)},setFocus:function(de){S.changeActive(de)},menuSize:function(){return S.screenAmount()},length:P.length,close:function(){w.close()},pick:function(){S.pick()},data:A})),w.options.closeOnUnfocus){var lt;O.on("blur",this.onBlur=function(){lt=setTimeout(function(){w.close()},100)}),O.on("focus",this.onFocus=function(){clearTimeout(lt)})}O.on("scroll",this.onScroll=function(){var de=O.getScrollInfo(),be=O.getWrapperElement().getBoundingClientRect();Oe||(Oe=O.getScrollInfo());var Ue=ie+Oe.top-de.top,ge=Ue-(I.pageYOffset||(M.documentElement||M.body).scrollTop);if(Y||(ge+=F.offsetHeight),ge<=be.top||ge>=be.bottom)return w.close();F.style.top=Ue+"px",F.style.left=ee+Oe.left-de.left+"px"}),e.on(F,"dblclick",function(de){var be=s(F,de.target||de.srcElement);be&&be.hintId!=null&&(S.changeActive(be.hintId),S.pick())}),e.on(F,"click",function(de){var be=s(F,de.target||de.srcElement);be&&be.hintId!=null&&(S.changeActive(be.hintId),w.options.completeOnSingleClick&&S.pick())}),e.on(F,"mousedown",function(){setTimeout(function(){O.focus()},20)});var ct=this.getSelectedHintRange();return(ct.from!==0||ct.to!==0)&&this.scrollToActive(),e.signal(A,"select",P[this.selectedHint],F.childNodes[this.selectedHint]),!0}f.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var w=this.completion.cm.getInputField();w.removeAttribute("aria-activedescendant"),w.removeAttribute("aria-owns");var A=this.completion.cm;this.completion.options.closeOnUnfocus&&(A.off("blur",this.onBlur),A.off("focus",this.onFocus)),A.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var w=this;this.keyMap={Enter:function(){w.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(w,A){if(w>=this.data.list.length?w=A?this.data.list.length-1:0:w<0&&(w=A?0:this.data.list.length-1),this.selectedHint!=w){var S=this.hints.childNodes[this.selectedHint];S&&(S.className=S.className.replace(" "+r,""),S.removeAttribute("aria-selected")),S=this.hints.childNodes[this.selectedHint=w],S.className+=" "+r,S.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",S.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],S)}},scrollToActive:function(){var w=this.getSelectedHintRange(),A=this.hints.childNodes[w.from],S=this.hints.childNodes[w.to],O=this.hints.firstChild;A.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=S.offsetTop+S.offsetHeight-this.hints.clientHeight+O.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var w=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-w),to:Math.min(this.data.list.length-1,this.selectedHint+w)}}};function p(w,A){if(!w.somethingSelected())return A;for(var S=[],O=0;O0?F(U):R(q+1)})}R(0)};return M.async=!0,M.supportsSelection=!0,M}else return(O=w.getHelper(w.getCursor(),"hintWords"))?function(I){return e.hint.fromList(I,{words:O})}:e.hint.anyword?function(I,F){return e.hint.anyword(I,F)}:function(){}}e.registerHelper("hint","auto",{resolve:y}),e.registerHelper("hint","fromList",function(w,A){var S=w.getCursor(),O=w.getTokenAt(S),M,I=e.Pos(S.line,O.start),F=S;O.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)})});var G$=vt((W$,V$)=>{g();x();v();(function(e){typeof W$=="object"&&typeof V$=="object"?e(Us(),Db()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)})(function(e){"use strict";e.defineOption("search",{bottom:!1});function t(i,o,u,l,a){i.openDialog?i.openDialog(o,a,{value:l,selectValueOnOpen:!0,bottom:i.options.search.bottom}):a(prompt(u,l))}function r(i){return i.phrase("Jump to line:")+' '+i.phrase("(Use line:column or scroll% syntax)")+""}function n(i,o){var u=Number(o);return/^[-+]/.test(o)?i.getCursor().line+u:u-1}e.commands.jumpToLine=function(i){var o=i.getCursor();t(i,r(i),i.phrase("Jump to line:"),o.line+1+":"+o.ch,function(u){if(u){var l;if(l=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(u))i.setCursor(n(i,l[1]),Number(l[2]));else if(l=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(u)){var a=Math.round(i.lineCount()*Number(l[1])/100);/^[-+]/.test(l[1])&&(a=o.line+a+1),i.setCursor(a-1,o.ch)}else(l=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(u))&&i.setCursor(n(i,l[1]),o.ch)}})},e.keyMap.default["Alt-G"]="jumpToLine"})});var kC=vt((Y$,Z$)=>{g();x();v();(function(e){typeof Y$=="object"&&typeof Z$=="object"?e(Us()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";var t=e.Pos;function r(A){var S=A.flags;return S??(A.ignoreCase?"i":"")+(A.global?"g":"")+(A.multiline?"m":"")}function n(A,S){for(var O=r(A),M=O,I=0;IC);P++){var R=A.getLine(F++);M=M==null?R:M+` +`+R}I=I*2,S.lastIndex=O.ch;var q=S.exec(M);if(q){var U=M.slice(0,q.index).split(` `),H=q[0].split(` -`),V=O.line+U.length-1,W=U[U.length-1].length;return{from:t(V,W),to:t(V+H.length-1,H.length==1?W+H[0].length:H[H.length-1].length),match:q}}}}function l(A,E,O){for(var M,I=0;I<=A.length;){E.lastIndex=I;var F=E.exec(A);if(!F)break;var C=F.index+F[0].length;if(C>A.length-O)break;(!M||C>M.index+M[0].length)&&(M=F),I=F.index+1}return M}function a(A,E,O){E=n(E,"g");for(var M=O.line,I=O.ch,F=A.firstLine();M>=F;M--,I=-1){var C=A.getLine(M),P=l(C,E,I<0?0:C.length-I);if(P)return{from:t(M,P.index),to:t(M,P.index+P[0].length),match:P}}}function s(A,E,O){if(!i(E))return a(A,E,O);E=n(E,"gm");for(var M,I=1,F=A.getLine(O.line).length-O.ch,C=O.line,P=A.firstLine();C>=P;){for(var R=0;R=P;R++){var q=A.getLine(C--);M=M==null?q:q+` -`+M}I*=2;var U=l(M,E,F);if(U){var H=M.slice(0,U.index).split(` +`),V=O.line+U.length-1,W=U[U.length-1].length;return{from:t(V,W),to:t(V+H.length-1,H.length==1?W+H[0].length:H[H.length-1].length),match:q}}}}function l(A,S,O){for(var M,I=0;I<=A.length;){S.lastIndex=I;var F=S.exec(A);if(!F)break;var C=F.index+F[0].length;if(C>A.length-O)break;(!M||C>M.index+M[0].length)&&(M=F),I=F.index+1}return M}function a(A,S,O){S=n(S,"g");for(var M=O.line,I=O.ch,F=A.firstLine();M>=F;M--,I=-1){var C=A.getLine(M),P=l(C,S,I<0?0:C.length-I);if(P)return{from:t(M,P.index),to:t(M,P.index+P[0].length),match:P}}}function s(A,S,O){if(!i(S))return a(A,S,O);S=n(S,"gm");for(var M,I=1,F=A.getLine(O.line).length-O.ch,C=O.line,P=A.firstLine();C>=P;){for(var R=0;R=P;R++){var q=A.getLine(C--);M=M==null?q:q+` +`+M}I*=2;var U=l(M,S,F);if(U){var H=M.slice(0,U.index).split(` `),V=U[0].split(` -`),W=C+H.length,ee=H[H.length-1].length;return{from:t(W,ee),to:t(W+V.length-1,V.length==1?ee+V[0].length:V[V.length-1].length),match:U}}}}var f,p;String.prototype.normalize?(f=function(A){return A.normalize("NFD").toLowerCase()},p=function(A){return A.normalize("NFD")}):(f=function(A){return A.toLowerCase()},p=function(A){return A});function h(A,E,O,M){if(A.length==E.length)return O;for(var I=0,F=O+Math.max(0,A.length-E.length);;){if(I==F)return I;var C=I+F>>1,P=M(A.slice(0,C)).length;if(P==O)return C;P>O?F=C:I=C+1}}function x(A,E,O,M){if(!E.length)return null;var I=M?f:p,F=I(E).split(/\r|\n\r?/);e:for(var C=O.line,P=O.ch,R=A.lastLine()+1-F.length;C<=R;C++,P=0){var q=A.getLine(C).slice(P),U=I(q);if(F.length==1){var H=U.indexOf(F[0]);if(H==-1)continue e;var O=h(q,U,H,I)+P;return{from:t(C,h(q,U,H,I)+P),to:t(C,h(q,U,H+F[0].length,I)+P)}}else{var V=U.length-F[0].length;if(U.slice(V)!=F[0])continue e;for(var W=1;W=R;C--,P=-1){var q=A.getLine(C);P>-1&&(q=q.slice(0,P));var U=I(q);if(F.length==1){var H=U.lastIndexOf(F[0]);if(H==-1)continue e;return{from:t(C,h(q,U,H,I)),to:t(C,h(q,U,H+F[0].length,I))}}else{var V=F[F.length-1];if(U.slice(0,V.length)!=V)continue e;for(var W=1,O=C-F.length+1;W(this.doc.getLine(E.line)||"").length&&(E.ch=0,E.line++)),e.cmpPos(E,this.doc.clipPos(E))!=0))return this.atOccurrence=!1;var O=this.matches(A,E);if(this.afterEmptyMatch=O&&e.cmpPos(O.from,O.to)==0,O)return this.pos=O,this.atOccurrence=!0,this.pos.match||!0;var M=t(A?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:M,to:M},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(A,E){if(this.atOccurrence){var O=e.splitLines(A);this.doc.replaceRange(O,this.pos.from,this.pos.to,E),this.pos.to=t(this.pos.from.line+O.length-1,O[O.length-1].length+(O.length==1?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(A,E,O){return new w(this.doc,A,E,O)}),e.defineDocExtension("getSearchCursor",function(A,E,O){return new w(this,A,E,O)}),e.defineExtension("selectMatches",function(A,E){for(var O=[],M=this.getSearchCursor(A,this.getCursor("from"),E);M.findNext()&&!(e.cmpPos(M.to(),this.getCursor("to"))>0);)O.push({anchor:M.from(),head:M.to()});O.length&&this.setSelections(O,0)})})});var J$=vt((X$,K$)=>{g();y();v();(function(e){typeof X$=="object"&&typeof K$=="object"?e(Hs(),kC(),Db()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)})(function(e){"use strict";e.defineOption("search",{bottom:!1});function t(C,P){return typeof C=="string"?C=new RegExp(C.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),P?"gi":"g"):C.global||(C=new RegExp(C.source,C.ignoreCase?"gi":"g")),{token:function(R){C.lastIndex=R.pos;var q=C.exec(R.string);if(q&&q.index==R.pos)return R.pos+=q[0].length||1,"searching";q?R.pos=q.index:R.skipToEnd()}}}function r(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(C){return C.state.search||(C.state.search=new r)}function i(C){return typeof C=="string"&&C==C.toLowerCase()}function o(C,P,R){return C.getSearchCursor(P,R,{caseFold:i(P),multiline:!0})}function u(C,P,R,q,U){C.openDialog(P,q,{value:R,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){b(C)},onKeyDown:U,bottom:C.options.search.bottom})}function l(C,P,R,q,U){C.openDialog?C.openDialog(P,U,{value:q,selectValueOnOpen:!0,bottom:C.options.search.bottom}):U(prompt(R,q))}function a(C,P,R,q){C.openConfirm?C.openConfirm(P,q):confirm(R)&&q[0]()}function s(C){return C.replace(/\\([nrt\\])/g,function(P,R){return R=="n"?` -`:R=="r"?"\r":R=="t"?" ":R=="\\"?"\\":P})}function f(C){var P=C.match(/^\/(.*)\/([a-z]*)$/);if(P)try{C=new RegExp(P[1],P[2].indexOf("i")==-1?"":"i")}catch{}else C=s(C);return(typeof C=="string"?C=="":C.test(""))&&(C=/x^/),C}function p(C,P,R){P.queryText=R,P.query=f(R),C.removeOverlay(P.overlay,i(P.query)),P.overlay=t(P.query,i(P.query)),C.addOverlay(P.overlay),C.showMatchesOnScrollbar&&(P.annotate&&(P.annotate.clear(),P.annotate=null),P.annotate=C.showMatchesOnScrollbar(P.query,i(P.query)))}function h(C,P,R,q){var U=n(C);if(U.query)return x(C,P);var H=C.getSelection()||U.lastQuery;if(H instanceof RegExp&&H.source=="x^"&&(H=null),R&&C.openDialog){var V=null,W=function(ee,ie){e.e_stop(ie),ee&&(ee!=U.queryText&&(p(C,U,ee),U.posFrom=U.posTo=C.getCursor()),V&&(V.style.opacity=1),x(C,ie.shiftKey,function(Y,Z){var le;Z.line<3&&document.querySelector&&(le=C.display.wrapper.querySelector(".CodeMirror-dialog"))&&le.getBoundingClientRect().bottom-4>C.cursorCoords(Z,"window").top&&((V=le).style.opacity=.4)}))};u(C,A(C),H,W,function(ee,ie){var Y=e.keyName(ee),Z=C.getOption("extraKeys"),le=Z&&Z[Y]||e.keyMap[C.getOption("keyMap")][Y];le=="findNext"||le=="findPrev"||le=="findPersistentNext"||le=="findPersistentPrev"?(e.e_stop(ee),p(C,n(C),ie),C.execCommand(le)):(le=="find"||le=="findPersistent")&&(e.e_stop(ee),W(ie,ee))}),q&&H&&(p(C,U,H),x(C,P))}else l(C,A(C),"Search for:",H,function(ee){ee&&!U.query&&C.operation(function(){p(C,U,ee),U.posFrom=U.posTo=C.getCursor(),x(C,P)})})}function x(C,P,R){C.operation(function(){var q=n(C),U=o(C,q.query,P?q.posFrom:q.posTo);!U.find(P)&&(U=o(C,q.query,P?e.Pos(C.lastLine()):e.Pos(C.firstLine(),0)),!U.find(P))||(C.setSelection(U.from(),U.to()),C.scrollIntoView({from:U.from(),to:U.to()},20),q.posFrom=U.from(),q.posTo=U.to(),R&&R(U.from(),U.to()))})}function b(C){C.operation(function(){var P=n(C);P.lastQuery=P.query,P.query&&(P.query=P.queryText=null,C.removeOverlay(P.overlay),P.annotate&&(P.annotate.clear(),P.annotate=null))})}function w(C,P){var R=C?document.createElement(C):document.createDocumentFragment();for(var q in P)R[q]=P[q];for(var U=2;U{g();y();v();typeof window<"u"&&function(e,t){try{e.querySelector(":scope body")}catch{["querySelector","querySelectorAll"].forEach(function(n){let i=t[n];t[n]=function(o){if(/(^|,)\s*:scope/.test(o)){let u=this.id;this.id="ID_"+Date.now(),o=o.replace(/((^|,)\s*):scope/g,"$1#"+this.id);let l=e[n](o);return this.id=u,l}else return i.call(this,o)}})}}(window.document,Element.prototype)});function ur(e){return function(){return e}}var Hf=Te(()=>{g();y();v()});function uW(e){return e>1?0:e<-1?Ws:Math.acos(e)}function nM(e){return e>=1?Wv:e<=-1?-Wv:Math.asin(e)}var rM,ro,$s,sW,Ou,wo,Er,Ui,Ws,Wv,es,no=Te(()=>{g();y();v();rM=Math.abs,ro=Math.atan2,$s=Math.cos,sW=Math.max,Ou=Math.min,wo=Math.sin,Er=Math.sqrt,Ui=1e-12,Ws=Math.PI,Wv=Ws/2,es=2*Ws});function lW(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return lW;let r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;i{g();y();v();iM=Math.PI,oM=2*iM,Op=1e-6,cye=oM-Op;Ip=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?lW:pye(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,o,u){this._append`C${+t},${+r},${+n},${+i},${this._x1=+o},${this._y1=+u}`}arcTo(t,r,n,i,o){if(t=+t,r=+r,n=+n,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let u=this._x1,l=this._y1,a=n-t,s=i-r,f=u-t,p=l-r,h=f*f+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Op)if(!(Math.abs(p*a-s*f)>Op)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let x=n-u,b=i-l,w=a*a+s*s,A=x*x+b*b,E=Math.sqrt(w),O=Math.sqrt(h),M=o*Math.tan((iM-Math.acos((w+h-A)/(2*E*O)))/2),I=M/O,F=M/E;Math.abs(I-1)>Op&&this._append`L${t+I*f},${r+I*p}`,this._append`A${o},${o},0,0,${+(p*x>f*b)},${this._x1=t+F*a},${this._y1=r+F*s}`}}arc(t,r,n,i,o,u){if(t=+t,r=+r,n=+n,u=!!u,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),a=n*Math.sin(i),s=t+l,f=r+a,p=1^u,h=u?i-o:o-i;this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>Op||Math.abs(this._y1-f)>Op)&&this._append`L${s},${f}`,n&&(h<0&&(h=h%oM+oM),h>cye?this._append`A${n},${n},0,1,${p},${t-l},${r-a}A${n},${n},0,1,${p},${this._x1=s},${this._y1=f}`:h>Op&&this._append`A${n},${n},0,${+(h>=iM)},${p},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};fW.prototype=Ip.prototype});var pW=Te(()=>{g();y();v();cW()});function Iu(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{let n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Ip(t)}var Vh=Te(()=>{g();y();v();pW()});function mye(e){return e.innerRadius}function hye(e){return e.outerRadius}function dye(e){return e.startAngle}function gye(e){return e.endAngle}function vye(e){return e&&e.padAngle}function yye(e,t,r,n,i,o,u,l){var a=r-e,s=n-t,f=u-i,p=l-o,h=p*a-f*s;if(!(h*hee*ee+ie*ie&&(R=U,q=H),{cx:R,cy:q,x01:-f,y01:-p,x11:R*(i/F-1),y11:q*(i/F-1)}}function mW(){var e=mye,t=hye,r=ur(0),n=null,i=dye,o=gye,u=vye,l=null,a=Iu(s);function s(){var f,p,h=+e.apply(this,arguments),x=+t.apply(this,arguments),b=i.apply(this,arguments)-Wv,w=o.apply(this,arguments)-Wv,A=rM(w-b),E=w>b;if(l||(l=f=a()),xUi))l.moveTo(0,0);else if(A>es-Ui)l.moveTo(x*$s(b),x*wo(b)),l.arc(0,0,x,b,w,!E),h>Ui&&(l.moveTo(h*$s(w),h*wo(w)),l.arc(0,0,h,w,b,E));else{var O=b,M=w,I=b,F=w,C=A,P=A,R=u.apply(this,arguments)/2,q=R>Ui&&(n?+n.apply(this,arguments):Er(h*h+x*x)),U=Ou(rM(x-h)/2,+r.apply(this,arguments)),H=U,V=U,W,ee;if(q>Ui){var ie=nM(q/h*wo(R)),Y=nM(q/x*wo(R));(C-=ie*2)>Ui?(ie*=E?1:-1,I+=ie,F-=ie):(C=0,I=F=(b+w)/2),(P-=Y*2)>Ui?(Y*=E?1:-1,O+=Y,M-=Y):(P=0,O=M=(b+w)/2)}var Z=x*$s(O),le=x*wo(O),re=h*$s(F),he=h*wo(F);if(U>Ui){var De=x*$s(M),we=x*wo(M),ce=h*$s(I),Ee=h*wo(I),Pe;if(AUi?V>Ui?(W=Fb(ce,Ee,Z,le,x,V,E),ee=Fb(De,we,re,he,x,V,E),l.moveTo(W.cx+W.x01,W.cy+W.y01),VUi)||!(C>Ui)?l.lineTo(re,he):H>Ui?(W=Fb(re,he,De,we,h,-H,E),ee=Fb(Z,le,ce,Ee,h,-H,E),l.lineTo(W.cx+W.x01,W.cy+W.y01),H{g();y();v();Hf();no();Vh()});function $f(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}var dW,Gh=Te(()=>{g();y();v();dW=Array.prototype.slice});function gW(e){this._context=e}function Wf(e){return new gW(e)}var Vv=Te(()=>{g();y();v();gW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}}});function Yh(e){return e[0]}function Zh(e){return e[1]}var _b=Te(()=>{g();y();v()});function Xh(e,t){var r=ur(!0),n=null,i=Wf,o=null,u=Iu(l);e=typeof e=="function"?e:e===void 0?Yh:ur(e),t=typeof t=="function"?t:t===void 0?Zh:ur(t);function l(a){var s,f=(a=$f(a)).length,p,h=!1,x;for(n==null&&(o=i(x=u())),s=0;s<=f;++s)!(s{g();y();v();Gh();Hf();Vv();Vh();_b()});function Bb(e,t,r){var n=null,i=ur(!0),o=null,u=Wf,l=null,a=Iu(s);e=typeof e=="function"?e:e===void 0?Yh:ur(+e),t=typeof t=="function"?t:t===void 0?ur(0):ur(+t),r=typeof r=="function"?r:r===void 0?Zh:ur(+r);function s(p){var h,x,b,w=(p=$f(p)).length,A,E=!1,O,M=new Array(w),I=new Array(w);for(o==null&&(l=u(O=a())),h=0;h<=w;++h){if(!(h=x;--b)l.point(M[b],I[b]);l.lineEnd(),l.areaEnd()}E&&(M[h]=+e(A,h,p),I[h]=+t(A,h,p),l.point(n?+n(A,h,p):M[h],r?+r(A,h,p):I[h]))}if(O)return l=null,O+""||null}function f(){return Xh().defined(i).curve(u).context(o)}return s.x=function(p){return arguments.length?(e=typeof p=="function"?p:ur(+p),n=null,s):e},s.x0=function(p){return arguments.length?(e=typeof p=="function"?p:ur(+p),s):e},s.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:ur(+p),s):n},s.y=function(p){return arguments.length?(t=typeof p=="function"?p:ur(+p),r=null,s):t},s.y0=function(p){return arguments.length?(t=typeof p=="function"?p:ur(+p),s):t},s.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:ur(+p),s):r},s.lineX0=s.lineY0=function(){return f().x(e).y(t)},s.lineY1=function(){return f().x(e).y(r)},s.lineX1=function(){return f().x(n).y(t)},s.defined=function(p){return arguments.length?(i=typeof p=="function"?p:ur(!!p),s):i},s.curve=function(p){return arguments.length?(u=p,o!=null&&(l=u(o)),s):u},s.context=function(p){return arguments.length?(p==null?o=l=null:l=u(o=p),s):o},s}var aM=Te(()=>{g();y();v();Gh();Hf();Vv();kb();Vh();_b()});function vW(e,t){return te?1:t>=e?0:NaN}var yW=Te(()=>{g();y();v()});function xW(e){return e}var wW=Te(()=>{g();y();v()});function bW(){var e=xW,t=vW,r=null,n=ur(0),i=ur(es),o=ur(0);function u(l){var a,s=(l=$f(l)).length,f,p,h=0,x=new Array(s),b=new Array(s),w=+n.apply(this,arguments),A=Math.min(es,Math.max(-es,i.apply(this,arguments)-w)),E,O=Math.min(Math.abs(A)/s,o.apply(this,arguments)),M=O*(A<0?-1:1),I;for(a=0;a0&&(h+=I);for(t!=null?x.sort(function(F,C){return t(b[F],b[C])}):r!=null&&x.sort(function(F,C){return r(l[F],l[C])}),a=0,p=h?(A-s*M)/h:0;a0?I*p:0)+M,b[f]={data:l[f],index:a,value:I,startAngle:w,endAngle:E,padAngle:O};return b}return u.value=function(l){return arguments.length?(e=typeof l=="function"?l:ur(+l),u):e},u.sortValues=function(l){return arguments.length?(t=l,r=null,u):t},u.sort=function(l){return arguments.length?(r=l,t=null,u):r},u.startAngle=function(l){return arguments.length?(n=typeof l=="function"?l:ur(+l),u):n},u.endAngle=function(l){return arguments.length?(i=typeof l=="function"?l:ur(+l),u):i},u.padAngle=function(l){return arguments.length?(o=typeof l=="function"?l:ur(+l),u):o},u}var DW=Te(()=>{g();y();v();Gh();Hf();yW();wW();no()});function NW(e){this._curve=e}function Kh(e){function t(r){return new NW(e(r))}return t._curve=e,t}var Lb,sM=Te(()=>{g();y();v();Vv();Lb=Kh(Wf);NW.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}}});function Jh(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(r){return arguments.length?t(Kh(r)):t()._curve},e}function uM(){return Jh(Xh().curve(Lb))}var lM=Te(()=>{g();y();v();sM();kb()});function fM(){var e=Bb().curve(Lb),t=e.curve,r=e.lineX0,n=e.lineX1,i=e.lineY0,o=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return Jh(r())},delete e.lineX0,e.lineEndAngle=function(){return Jh(n())},delete e.lineX1,e.lineInnerRadius=function(){return Jh(i())},delete e.lineY0,e.lineOuterRadius=function(){return Jh(o())},delete e.lineY1,e.curve=function(u){return arguments.length?t(Kh(u)):t()._curve},e}var EW=Te(()=>{g();y();v();sM();aM();lM()});function Fp(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}var cM=Te(()=>{g();y();v()});function Rb(e){return new Pb(e,!0)}function qb(e){return new Pb(e,!1)}function SW(e){return new pM(e)}var Pb,pM,mM=Te(()=>{g();y();v();cM();Pb=class{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}},pM=class{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,r){if(t=+t,r=+r,this._point===0)this._point=1;else{let n=Fp(this._x0,this._y0),i=Fp(this._x0,this._y0=(this._y0+r)/2),o=Fp(t,this._y0),u=Fp(t,r);this._context.moveTo(...n),this._context.bezierCurveTo(...i,...o,...u)}this._x0=t,this._y0=r}}});function xye(e){return e.source}function wye(e){return e.target}function Gv(e){let t=xye,r=wye,n=Yh,i=Zh,o=null,u=null,l=Iu(a);function a(){let s,f=dW.call(arguments),p=t.apply(this,f),h=r.apply(this,f);if(o==null&&(u=e(s=l())),u.lineStart(),f[0]=p,u.point(+n.apply(this,f),+i.apply(this,f)),f[0]=h,u.point(+n.apply(this,f),+i.apply(this,f)),u.lineEnd(),s)return u=null,s+""||null}return a.source=function(s){return arguments.length?(t=s,a):t},a.target=function(s){return arguments.length?(r=s,a):r},a.x=function(s){return arguments.length?(n=typeof s=="function"?s:ur(+s),a):n},a.y=function(s){return arguments.length?(i=typeof s=="function"?s:ur(+s),a):i},a.context=function(s){return arguments.length?(s==null?o=u=null:u=e(o=s),a):o},a}function AW(){return Gv(Rb)}function CW(){return Gv(qb)}function MW(){let e=Gv(SW);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}var TW=Te(()=>{g();y();v();Gh();Hf();mM();Vh();_b()});var bye,zb,hM=Te(()=>{g();y();v();no();bye=Er(3),zb={draw(e,t){let r=Er(t+Ou(t/28,.75))*.59436,n=r/2,i=n*bye;e.moveTo(0,r),e.lineTo(0,-r),e.moveTo(-i,-n),e.lineTo(i,n),e.moveTo(-i,n),e.lineTo(i,-n)}}});var Qh,dM=Te(()=>{g();y();v();no();Qh={draw(e,t){let r=Er(t/Ws);e.moveTo(r,0),e.arc(0,0,r,0,es)}}});var Ub,gM=Te(()=>{g();y();v();no();Ub={draw(e,t){let r=Er(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}}});var OW,Dye,Hb,vM=Te(()=>{g();y();v();no();OW=Er(1/3),Dye=OW*2,Hb={draw(e,t){let r=Er(t/Dye),n=r*OW;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}}});var $b,yM=Te(()=>{g();y();v();no();$b={draw(e,t){let r=Er(t)*.62625;e.moveTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.lineTo(-r,0),e.closePath()}}});var Wb,xM=Te(()=>{g();y();v();no();Wb={draw(e,t){let r=Er(t-Ou(t/7,2))*.87559;e.moveTo(-r,0),e.lineTo(r,0),e.moveTo(0,r),e.lineTo(0,-r)}}});var Vb,wM=Te(()=>{g();y();v();no();Vb={draw(e,t){let r=Er(t),n=-r/2;e.rect(n,n,r,r)}}});var Gb,bM=Te(()=>{g();y();v();no();Gb={draw(e,t){let r=Er(t)*.4431;e.moveTo(r,r),e.lineTo(r,-r),e.lineTo(-r,-r),e.lineTo(-r,r),e.closePath()}}});var Nye,IW,Eye,Sye,Yb,DM=Te(()=>{g();y();v();no();Nye=.8908130915292852,IW=wo(Ws/10)/wo(7*Ws/10),Eye=wo(es/10)*IW,Sye=-$s(es/10)*IW,Yb={draw(e,t){let r=Er(t*Nye),n=Eye*r,i=Sye*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){let u=es*o/5,l=$s(u),a=wo(u);e.lineTo(a*r,-l*r),e.lineTo(l*n-a*i,a*n+l*i)}e.closePath()}}});var NM,Zb,EM=Te(()=>{g();y();v();no();NM=Er(3),Zb={draw(e,t){let r=-Er(t/(NM*3));e.moveTo(0,r*2),e.lineTo(-NM*r,-r),e.lineTo(NM*r,-r),e.closePath()}}});var Aye,Xb,SM=Te(()=>{g();y();v();no();Aye=Er(3),Xb={draw(e,t){let r=Er(t)*.6824,n=r/2,i=r*Aye/2;e.moveTo(0,-r),e.lineTo(i,n),e.lineTo(-i,n),e.closePath()}}});var ts,rs,AM,Cye,Kb,CM=Te(()=>{g();y();v();no();ts=-.5,rs=Er(3)/2,AM=1/Er(12),Cye=(AM/2+1)*3,Kb={draw(e,t){let r=Er(t/Cye),n=r/2,i=r*AM,o=n,u=r*AM+r,l=-o,a=u;e.moveTo(n,i),e.lineTo(o,u),e.lineTo(l,a),e.lineTo(ts*n-rs*i,rs*n+ts*i),e.lineTo(ts*o-rs*u,rs*o+ts*u),e.lineTo(ts*l-rs*a,rs*l+ts*a),e.lineTo(ts*n+rs*i,ts*i-rs*n),e.lineTo(ts*o+rs*u,ts*u-rs*o),e.lineTo(ts*l+rs*a,ts*a-rs*l),e.closePath()}}});var Yv,MM=Te(()=>{g();y();v();no();Yv={draw(e,t){let r=Er(t-Ou(t/6,1.7))*.6189;e.moveTo(-r,-r),e.lineTo(r,r),e.moveTo(-r,r),e.lineTo(r,-r)}}});function OM(e,t){let r=null,n=Iu(i);e=typeof e=="function"?e:ur(e||Qh),t=typeof t=="function"?t:ur(t===void 0?64:+t);function i(){let o;if(r||(r=o=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),o)return r=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:ur(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:ur(+o),i):t},i.context=function(o){return arguments.length?(r=o??null,i):r},i}var TM,FW,_W=Te(()=>{g();y();v();Hf();Vh();hM();dM();gM();vM();yM();xM();wM();bM();DM();EM();SM();CM();MM();TM=[Qh,Ub,Hb,Vb,Yb,Zb,Kb],FW=[Qh,Wb,Yv,Xb,zb,Gb,$b]});function ns(){}var Zv=Te(()=>{g();y();v()});function jh(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Xv(e){this._context=e}function kW(e){return new Xv(e)}var Kv=Te(()=>{g();y();v();Xv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:jh(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:jh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function BW(e){this._context=e}function LW(e){return new BW(e)}var PW=Te(()=>{g();y();v();Zv();Kv();BW.prototype={areaStart:ns,areaEnd:ns,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:jh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function RW(e){this._context=e}function qW(e){return new RW(e)}var zW=Te(()=>{g();y();v();Kv();RW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:jh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function UW(e,t){this._basis=new Xv(e),this._beta=t}var HW,$W=Te(()=>{g();y();v();Kv();UW.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],o=e[r]-n,u=t[r]-i,l=-1,a;++l<=r;)a=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(n+a*o),this._beta*t[l]+(1-this._beta)*(i+a*u));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};HW=function e(t){function r(n){return t===1?new Xv(n):new UW(n,t)}return r.beta=function(n){return e(+n)},r}(.85)});function ed(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Jb(e,t){this._context=e,this._k=(1-t)/6}var WW,Jv=Te(()=>{g();y();v();Jb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ed(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ed(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};WW=function e(t){function r(n){return new Jb(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function Qb(e,t){this._context=e,this._k=(1-t)/6}var VW,IM=Te(()=>{g();y();v();Zv();Jv();Qb.prototype={areaStart:ns,areaEnd:ns,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ed(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};VW=function e(t){function r(n){return new Qb(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function jb(e,t){this._context=e,this._k=(1-t)/6}var GW,FM=Te(()=>{g();y();v();Jv();jb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ed(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};GW=function e(t){function r(n){return new jb(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function Qv(e,t,r){var n=e._x1,i=e._y1,o=e._x2,u=e._y2;if(e._l01_a>Ui){var l=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,a=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*l-e._x0*e._l12_2a+e._x2*e._l01_2a)/a,i=(i*l-e._y0*e._l12_2a+e._y2*e._l01_2a)/a}if(e._l23_a>Ui){var s=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,f=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*s+e._x1*e._l23_2a-t*e._l12_2a)/f,u=(u*s+e._y1*e._l23_2a-r*e._l12_2a)/f}e._context.bezierCurveTo(n,i,o,u,e._x2,e._y2)}function YW(e,t){this._context=e,this._alpha=t}var ZW,e2=Te(()=>{g();y();v();no();Jv();YW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Qv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};ZW=function e(t){function r(n){return t?new YW(n,t):new Jb(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function XW(e,t){this._context=e,this._alpha=t}var KW,JW=Te(()=>{g();y();v();IM();Zv();e2();XW.prototype={areaStart:ns,areaEnd:ns,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Qv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};KW=function e(t){function r(n){return t?new XW(n,t):new Qb(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function QW(e,t){this._context=e,this._alpha=t}var jW,eV=Te(()=>{g();y();v();FM();e2();QW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Qv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};jW=function e(t){function r(n){return t?new QW(n,t):new jb(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function tV(e){this._context=e}function rV(e){return new tV(e)}var nV=Te(()=>{g();y();v();Zv();tV.prototype={areaStart:ns,areaEnd:ns,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}}});function iV(e){return e<0?-1:1}function oV(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),u=(r-e._y1)/(i||n<0&&-0),l=(o*i+u*n)/(n+i);return(iV(o)+iV(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(l))||0}function aV(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function _M(e,t,r){var n=e._x0,i=e._y0,o=e._x1,u=e._y1,l=(o-n)/3;e._context.bezierCurveTo(n+l,i+l*t,o-l,u-l*r,o,u)}function t2(e){this._context=e}function sV(e){this._context=new uV(e)}function uV(e){this._context=e}function lV(e){return new t2(e)}function fV(e){return new sV(e)}var cV=Te(()=>{g();y();v();t2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:_M(this,this._t0,aV(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,_M(this,aV(this,r=oV(this,e,t)),r);break;default:_M(this,this._t0,r=oV(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};(sV.prototype=Object.create(t2.prototype)).point=function(e,t){t2.prototype.point.call(this,t,e)};uV.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}}});function mV(e){this._context=e}function pV(e){var t,r=e.length-1,n,i=new Array(r),o=new Array(r),u=new Array(r);for(i[0]=0,o[0]=2,u[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(u[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t{g();y();v();mV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=pV(e),i=pV(t),o=0,u=1;u{g();y();v();r2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}}});function Vs(e,t){if((u=e.length)>1)for(var r=1,n,i,o=e[t[0]],u,l=o.length;r{g();y();v()});function Gs(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}var rd=Te(()=>{g();y();v()});function Mye(e,t){return e[t]}function Tye(e){let t=[];return t.key=e,t}function wV(){var e=ur([]),t=Gs,r=Vs,n=Mye;function i(o){var u=Array.from(e.apply(this,arguments),Tye),l,a=u.length,s=-1,f;for(let p of o)for(l=0,++s;l{g();y();v();Gh();Hf();td();rd()});function DV(e,t){if((n=e.length)>0){for(var r,n,i=0,o=e[0].length,u;i{g();y();v();td()});function EV(e,t){if((a=e.length)>0)for(var r,n=0,i,o,u,l,a,s=e[t[0]].length;n0?(i[0]=u,i[1]=u+=o):o<0?(i[1]=l,i[0]=l+=o):(i[0]=0,i[1]=o)}var SV=Te(()=>{g();y();v()});function AV(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,o=n.length;r{g();y();v();td()});function MV(e,t){if(!(!((u=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,u;n{g();y();v();td()});function n2(e){var t=e.map(Oye);return Gs(e).sort(function(r,n){return t[r]-t[n]})}function Oye(e){for(var t=-1,r=0,n=e.length,i,o=-1/0;++to&&(o=i,r=t);return r}var kM=Te(()=>{g();y();v();rd()});function i2(e){var t=e.map(BM);return Gs(e).sort(function(r,n){return t[r]-t[n]})}function BM(e){for(var t=0,r=-1,n=e.length,i;++r{g();y();v();rd()});function OV(e){return i2(e).reverse()}var IV=Te(()=>{g();y();v();o2()});function FV(e){var t=e.length,r,n,i=e.map(BM),o=n2(e),u=0,l=0,a=[],s=[];for(r=0;r{g();y();v();kM();o2()});function kV(e){return Gs(e).reverse()}var BV=Te(()=>{g();y();v();rd()});var jv={};qa(jv,{arc:()=>mW,area:()=>Bb,areaRadial:()=>fM,curveBasis:()=>kW,curveBasisClosed:()=>LW,curveBasisOpen:()=>qW,curveBumpX:()=>Rb,curveBumpY:()=>qb,curveBundle:()=>HW,curveCardinal:()=>WW,curveCardinalClosed:()=>VW,curveCardinalOpen:()=>GW,curveCatmullRom:()=>ZW,curveCatmullRomClosed:()=>KW,curveCatmullRomOpen:()=>jW,curveLinear:()=>Wf,curveLinearClosed:()=>rV,curveMonotoneX:()=>lV,curveMonotoneY:()=>fV,curveNatural:()=>hV,curveStep:()=>gV,curveStepAfter:()=>yV,curveStepBefore:()=>vV,line:()=>Xh,lineRadial:()=>uM,link:()=>Gv,linkHorizontal:()=>AW,linkRadial:()=>MW,linkVertical:()=>CW,pie:()=>bW,pointRadial:()=>Fp,radialArea:()=>fM,radialLine:()=>uM,stack:()=>wV,stackOffsetDiverging:()=>EV,stackOffsetExpand:()=>DV,stackOffsetNone:()=>Vs,stackOffsetSilhouette:()=>AV,stackOffsetWiggle:()=>MV,stackOrderAppearance:()=>n2,stackOrderAscending:()=>i2,stackOrderDescending:()=>OV,stackOrderInsideOut:()=>FV,stackOrderNone:()=>Gs,stackOrderReverse:()=>kV,symbol:()=>OM,symbolAsterisk:()=>zb,symbolCircle:()=>Qh,symbolCross:()=>Ub,symbolDiamond:()=>Hb,symbolDiamond2:()=>$b,symbolPlus:()=>Wb,symbolSquare:()=>Vb,symbolSquare2:()=>Gb,symbolStar:()=>Yb,symbolTimes:()=>Yv,symbolTriangle:()=>Zb,symbolTriangle2:()=>Xb,symbolWye:()=>Kb,symbolX:()=>Yv,symbols:()=>TM,symbolsFill:()=>TM,symbolsStroke:()=>FW});var e0=Te(()=>{g();y();v();hW();aM();kb();DW();EW();lM();cM();TW();_W();hM();dM();gM();vM();yM();xM();wM();bM();DM();EM();SM();CM();MM();PW();zW();Kv();mM();$W();IM();FM();Jv();JW();eV();e2();nV();Vv();cV();dV();xV();bV();NV();SV();td();CV();TV();kM();o2();IV();_V();rd();BV()});function LV(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function _p(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}var t0=Te(()=>{g();y();v()});function Fu(e){return e=_p(Math.abs(e)),e?e[1]:NaN}var r0=Te(()=>{g();y();v();t0()});function PV(e,t){return function(r,n){for(var i=r.length,o=[],u=0,l=e[0],a=0;i>0&&l>0&&(a+l+1>n&&(l=Math.max(1,n-a)),o.push(r.substring(i-=l,i+l)),!((a+=l+1)>n));)l=e[u=(u+1)%e.length];return o.reverse().join(t)}}var RV=Te(()=>{g();y();v()});function qV(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var zV=Te(()=>{g();y();v()});function Ys(e){if(!(t=Iye.exec(e)))throw new Error("invalid format: "+e);var t;return new n0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function n0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}var Iye,LM=Te(()=>{g();y();v();Iye=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;Ys.prototype=n0.prototype;n0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type}});function UV(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var HV=Te(()=>{g();y();v()});function $V(e,t){var r=_p(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(PM=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,u=n.length;return o===u?n:o>u?n+new Array(o-u+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+_p(e,Math.max(0,t+o-1))[0]}var PM,RM=Te(()=>{g();y();v();t0()});function qM(e,t){var r=_p(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var WV=Te(()=>{g();y();v();t0()});var zM,VV=Te(()=>{g();y();v();t0();RM();WV();zM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:LV,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>qM(e*100,t),r:qM,s:$V,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)}});function UM(e){return e}var GV=Te(()=>{g();y();v()});function a2(e){var t=e.grouping===void 0||e.thousands===void 0?UM:PV(YV.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?UM:qV(YV.call(e.numerals,String)),u=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"\u2212":e.minus+"",a=e.nan===void 0?"NaN":e.nan+"";function s(p){p=Ys(p);var h=p.fill,x=p.align,b=p.sign,w=p.symbol,A=p.zero,E=p.width,O=p.comma,M=p.precision,I=p.trim,F=p.type;F==="n"?(O=!0,F="g"):zM[F]||(M===void 0&&(M=12),I=!0,F="g"),(A||h==="0"&&x==="=")&&(A=!0,h="0",x="=");var C=w==="$"?r:w==="#"&&/[boxX]/.test(F)?"0"+F.toLowerCase():"",P=w==="$"?n:/[%p]/.test(F)?u:"",R=zM[F],q=/[defgprs%]/.test(F);M=M===void 0?6:/[gprs]/.test(F)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function U(H){var V=C,W=P,ee,ie,Y;if(F==="c")W=R(H)+W,H="";else{H=+H;var Z=H<0||1/H<0;if(H=isNaN(H)?a:R(Math.abs(H),M),I&&(H=UV(H)),Z&&+H==0&&b!=="+"&&(Z=!1),V=(Z?b==="("?b:l:b==="-"||b==="("?"":b)+V,W=(F==="s"?ZV[8+PM/3]:"")+W+(Z&&b==="("?")":""),q){for(ee=-1,ie=H.length;++eeY||Y>57){W=(Y===46?i+H.slice(ee+1):H.slice(ee))+W,H=H.slice(0,ee);break}}}O&&!A&&(H=t(H,1/0));var le=V.length+H.length+W.length,re=le>1)+V+H+W+re.slice(le);break;default:H=re+V+H+W;break}return o(H)}return U.toString=function(){return p+""},U}function f(p,h){var x=s((p=Ys(p),p.type="f",p)),b=Math.max(-8,Math.min(8,Math.floor(Fu(h)/3)))*3,w=Math.pow(10,-b),A=ZV[8+b/3];return function(E){return x(w*E)+A}}return{format:s,formatPrefix:f}}var YV,ZV,HM=Te(()=>{g();y();v();r0();RV();zV();LM();HV();VV();RM();GV();YV=Array.prototype.map,ZV=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"]});function u2(e){return s2=a2(e),kp=s2.format,i0=s2.formatPrefix,s2}var s2,kp,i0,XV=Te(()=>{g();y();v();HM();u2({thousands:",",grouping:[3],currency:["$",""]})});function l2(e){return Math.max(0,-Fu(Math.abs(e)))}var KV=Te(()=>{g();y();v();r0()});function f2(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Fu(t)/3)))*3-Fu(Math.abs(e)))}var JV=Te(()=>{g();y();v();r0()});function c2(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Fu(t)-Fu(e))+1}var QV=Te(()=>{g();y();v();r0()});var jV={};qa(jV,{FormatSpecifier:()=>n0,format:()=>kp,formatDefaultLocale:()=>u2,formatLocale:()=>a2,formatPrefix:()=>i0,formatSpecifier:()=>Ys,precisionFixed:()=>l2,precisionPrefix:()=>f2,precisionRound:()=>c2});var p2=Te(()=>{g();y();v();XV();HM();LM();KV();JV();QV()});function ko(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}var o0=Te(()=>{g();y();v()});function $M(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}var eG=Te(()=>{g();y();v()});function Bp(e){let t,r,n;e.length!==2?(t=ko,r=(l,a)=>ko(e(l),a),n=(l,a)=>e(l)-a):(t=e===ko||e===$M?e:Fye,r=e,n=e);function i(l,a,s=0,f=l.length){if(s>>1;r(l[p],a)<0?s=p+1:f=p}while(s>>1;r(l[p],a)<=0?s=p+1:f=p}while(ss&&n(l[p-1],a)>-n(l[p],a)?p-1:p}return{left:i,center:u,right:o}}function Fye(){return 0}var WM=Te(()=>{g();y();v();o0();eG()});function a0(e){return e===null?NaN:+e}function*tG(e,t){if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let n of e)(n=t(n,++r,e))!=null&&(n=+n)>=n&&(yield n)}}var VM=Te(()=>{g();y();v()});var rG,nG,_ye,kye,Zs,iG=Te(()=>{g();y();v();o0();WM();VM();rG=Bp(ko),nG=rG.right,_ye=rG.left,kye=Bp(a0).center,Zs=nG});function oG({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):r}function Bye({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Lye({_intern:e,_key:t},r){let n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Pye(e){return e!==null&&typeof e=="object"?e.valueOf():e}var nd,aG=Te(()=>{g();y();v();nd=class extends Map{constructor(t,r=Pye){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(let[n,i]of t)this.set(n,i)}get(t){return super.get(oG(this,t))}has(t){return super.has(oG(this,t))}set(t,r){return super.set(Bye(this,t),r)}delete(t){return super.delete(Lye(this,t))}}});function sG(e=ko){if(e===ko)return GM;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{let n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function GM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var uG=Te(()=>{g();y();v();o0()});function m2(e,t,r){let n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),u=o>=Rye?10:o>=qye?5:o>=zye?2:1,l,a,s;return i<0?(s=Math.pow(10,-i)/u,l=Math.round(e*s),a=Math.round(t*s),l/st&&--a,s=-s):(s=Math.pow(10,i)*u,l=Math.round(e/s),a=Math.round(t/s),l*st&&--a),a0))return[];if(e===t)return[e];let n=t=i))return[];let l=o-i+1,a=new Array(l);if(n)if(u<0)for(let s=0;s{g();y();v();Rye=Math.sqrt(50),qye=Math.sqrt(10),zye=Math.sqrt(2)});function h2(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r=i)&&(r=i)}return r}var fG=Te(()=>{g();y();v()});function d2(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var cG=Te(()=>{g();y();v()});function g2(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?GM:sG(i);n>r;){if(n-r>600){let a=n-r+1,s=t-r+1,f=Math.log(a),p=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*p*(a-p)/a)*(s-a/2<0?-1:1),x=Math.max(r,Math.floor(t-s*p/a+h)),b=Math.min(n,Math.floor(t+(a-s)*p/a+h));g2(e,t,x,b,i)}let o=e[t],u=r,l=n;for(u0(e,r,t),i(e[n],o)>0&&u0(e,r,n);u0;)--l}i(e[r],o)===0?u0(e,r,l):(++l,u0(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function u0(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}var pG=Te(()=>{g();y();v();uG()});function v2(e,t,r){if(e=Float64Array.from(tG(e,r)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return d2(e);if(t>=1)return h2(e);var n,i=(n-1)*t,o=Math.floor(i),u=h2(g2(e,o).subarray(0,o+1)),l=d2(e.subarray(o+1));return u+(l-u)*(i-o)}}function YM(e,t,r=a0){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),u=+r(e[o],o,e),l=+r(e[o+1],o+1,e);return u+(l-u)*(i-o)}}var mG=Te(()=>{g();y();v();fG();cG();pG();VM()});function y2(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n{g();y();v()});var is=Te(()=>{g();y();v();iG();o0();WM();mG();hG();lG();aG()});function On(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function os(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}var bo=Te(()=>{g();y();v()});function od(){var e=new nd,t=[],r=[],n=x2;function i(o){let u=e.get(o);if(u===void 0){if(n!==x2)return n;e.set(o,u=t.push(o)-1)}return r[u%r.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new nd;for(let u of o)e.has(u)||e.set(u,t.push(u)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return od(t,r).unknown(n)},On.apply(i,arguments),i}var x2,ZM=Te(()=>{g();y();v();is();bo();x2=Symbol("implicit")});function l0(){var e=od().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,o,u,l=!1,a=0,s=0,f=.5;delete e.unknown;function p(){var h=t().length,x=i{g();y();v();is();bo();ZM()});function Cl(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Vf(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}var w2=Te(()=>{g();y();v()});function ku(){}function xG(){return this.rgb().formatHex()}function Zye(){return this.rgb().formatHex8()}function Xye(){return AG(this).formatHsl()}function wG(){return this.rgb().formatRgb()}function as(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Uye.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?bG(t):r===3?new vi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?b2(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?b2(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Hye.exec(e))?new vi(t[1],t[2],t[3],1):(t=$ye.exec(e))?new vi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Wye.exec(e))?b2(t[1],t[2],t[3],t[4]):(t=Vye.exec(e))?b2(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Gye.exec(e))?EG(t[1],t[2]/100,t[3]/100,1):(t=Yye.exec(e))?EG(t[1],t[2]/100,t[3]/100,t[4]):yG.hasOwnProperty(e)?bG(yG[e]):e==="transparent"?new vi(NaN,NaN,NaN,0):null}function bG(e){return new vi(e>>16&255,e>>8&255,e&255,1)}function b2(e,t,r,n){return n<=0&&(e=t=r=NaN),new vi(e,t,r,n)}function c0(e){return e instanceof ku||(e=as(e)),e?(e=e.rgb(),new vi(e.r,e.g,e.b,e.opacity)):new vi}function zp(e,t,r,n){return arguments.length===1?c0(e):new vi(e,t,r,n??1)}function vi(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function DG(){return`#${Pp(this.r)}${Pp(this.g)}${Pp(this.b)}`}function Kye(){return`#${Pp(this.r)}${Pp(this.g)}${Pp(this.b)}${Pp((isNaN(this.opacity)?1:this.opacity)*255)}`}function NG(){let e=N2(this.opacity);return`${e===1?"rgb(":"rgba("}${Rp(this.r)}, ${Rp(this.g)}, ${Rp(this.b)}${e===1?")":`, ${e})`}`}function N2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rp(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pp(e){return e=Rp(e),(e<16?"0":"")+e.toString(16)}function EG(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Xs(e,t,r,n)}function AG(e){if(e instanceof Xs)return new Xs(e.h,e.s,e.l,e.opacity);if(e instanceof ku||(e=as(e)),!e)return new Xs;if(e instanceof Xs)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),u=NaN,l=o-i,a=(o+i)/2;return l?(t===o?u=(r-n)/l+(r0&&a<1?0:u,new Xs(u,l,a,e.opacity)}function sd(e,t,r,n){return arguments.length===1?AG(e):new Xs(e,t,r,n??1)}function Xs(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function SG(e){return e=(e||0)%360,e<0?e+360:e}function D2(e){return Math.max(0,Math.min(1,e||0))}function XM(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var Gf,qp,ad,f0,_u,Uye,Hye,$ye,Wye,Vye,Gye,Yye,yG,E2=Te(()=>{g();y();v();w2();Gf=.7,qp=1/Gf,ad="\\s*([+-]?\\d+)\\s*",f0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_u="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Uye=/^#([0-9a-f]{3,8})$/,Hye=new RegExp(`^rgb\\(${ad},${ad},${ad}\\)$`),$ye=new RegExp(`^rgb\\(${_u},${_u},${_u}\\)$`),Wye=new RegExp(`^rgba\\(${ad},${ad},${ad},${f0}\\)$`),Vye=new RegExp(`^rgba\\(${_u},${_u},${_u},${f0}\\)$`),Gye=new RegExp(`^hsl\\(${f0},${_u},${_u}\\)$`),Yye=new RegExp(`^hsla\\(${f0},${_u},${_u},${f0}\\)$`),yG={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Cl(ku,as,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xG,formatHex:xG,formatHex8:Zye,formatHsl:Xye,formatRgb:wG,toString:wG});Cl(vi,zp,Vf(ku,{brighter(e){return e=e==null?qp:Math.pow(qp,e),new vi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Gf:Math.pow(Gf,e),new vi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new vi(Rp(this.r),Rp(this.g),Rp(this.b),N2(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:DG,formatHex:DG,formatHex8:Kye,formatRgb:NG,toString:NG}));Cl(Xs,sd,Vf(ku,{brighter(e){return e=e==null?qp:Math.pow(qp,e),new Xs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Gf:Math.pow(Gf,e),new Xs(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new vi(XM(e>=240?e-240:e+120,i,n),XM(e,i,n),XM(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Xs(SG(this.h),D2(this.s),D2(this.l),N2(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=N2(this.opacity);return`${e===1?"hsl(":"hsla("}${SG(this.h)}, ${D2(this.s)*100}%, ${D2(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var S2,A2,KM=Te(()=>{g();y();v();S2=Math.PI/180,A2=180/Math.PI});function FG(e){if(e instanceof Ks)return new Ks(e.l,e.a,e.b,e.opacity);if(e instanceof Bu)return LG(e);e instanceof vi||(e=c0(e));var t=eT(e.r),r=eT(e.g),n=eT(e.b),i=JM((.2225045*t+.7168786*r+.0606169*n)/MG),o,u;return t===r&&r===n?o=u=i:(o=JM((.4360747*t+.3850649*r+.1430804*n)/CG),u=JM((.0139322*t+.0971045*r+.7141733*n)/TG)),new Ks(116*i-16,500*(o-i),200*(i-u),e.opacity)}function _G(e,t){return new Ks(e,0,0,t??1)}function Up(e,t,r,n){return arguments.length===1?FG(e):new Ks(e,t,r,n??1)}function Ks(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function JM(e){return e>Jye?Math.pow(e,1/3):e/IG+OG}function QM(e){return e>ud?e*e*e:IG*(e-OG)}function jM(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function eT(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function kG(e){if(e instanceof Bu)return new Bu(e.h,e.c,e.l,e.opacity);if(e instanceof Ks||(e=FG(e)),e.a===0&&e.b===0)return new Bu(NaN,0{g();y();v();w2();E2();KM();C2=18,CG=.96422,MG=1,TG=.82521,OG=4/29,ud=6/29,IG=3*ud*ud,Jye=ud*ud*ud;Cl(Ks,Up,Vf(ku,{brighter(e){return new Ks(this.l+C2*(e??1),this.a,this.b,this.opacity)},darker(e){return new Ks(this.l-C2*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=CG*QM(t),e=MG*QM(e),r=TG*QM(r),new vi(jM(3.1338561*t-1.6168667*e-.4906146*r),jM(-.9787684*t+1.9161415*e+.033454*r),jM(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));Cl(Bu,ld,Vf(ku,{brighter(e){return new Bu(this.h,this.c,this.l+C2*(e??1),this.opacity)},darker(e){return new Bu(this.h,this.c,this.l-C2*(e??1),this.opacity)},rgb(){return LG(this).rgb()}}))});function Qye(e){if(e instanceof Hp)return new Hp(e.h,e.s,e.l,e.opacity);e instanceof vi||(e=c0(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(zG*n+RG*t-qG*r)/(zG+RG-qG),o=n-i,u=(p0*(r-i)-rT*o)/M2,l=Math.sqrt(u*u+o*o)/(p0*i*(1-i)),a=l?Math.atan2(u,o)*A2-120:NaN;return new Hp(a<0?a+360:a,l,i,e.opacity)}function $p(e,t,r,n){return arguments.length===1?Qye(e):new Hp(e,t,r,n??1)}function Hp(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}var UG,tT,rT,M2,p0,RG,qG,zG,HG=Te(()=>{g();y();v();w2();E2();KM();UG=-.14861,tT=1.78277,rT=-.29227,M2=-.90649,p0=1.97294,RG=p0*M2,qG=p0*tT,zG=tT*rT-M2*UG;Cl(Hp,$p,Vf(ku,{brighter(e){return e=e==null?qp:Math.pow(qp,e),new Hp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Gf:Math.pow(Gf,e),new Hp(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*S2,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new vi(255*(t+r*(UG*n+tT*i)),255*(t+r*(rT*n+M2*i)),255*(t+r*(p0*n)),this.opacity)}}))});var T2={};qa(T2,{color:()=>as,cubehelix:()=>$p,gray:()=>_G,hcl:()=>ld,hsl:()=>sd,lab:()=>Up,lch:()=>BG,rgb:()=>zp});var Js=Te(()=>{g();y();v();E2();PG();HG()});function nT(e,t,r,n,i){var o=e*e,u=o*e;return((1-3*e+3*o-u)*t+(4-6*o+3*u)*r+(1+3*e+3*o-3*u)*n+u*i)/6}function O2(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],o=e[n+1],u=n>0?e[n-1]:2*i-o,l=n{g();y();v()});function F2(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],o=e[n%t],u=e[(n+1)%t],l=e[(n+2)%t];return nT((r-n/t)*t,i,o,u,l)}}var iT=Te(()=>{g();y();v();I2()});var fd,oT=Te(()=>{g();y();v();fd=e=>()=>e});function $G(e,t){return function(r){return e+r*t}}function jye(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Yf(e,t){var r=t-e;return r?$G(e,r>180||r<-180?r-360*Math.round(r/360):r):fd(isNaN(e)?t:e)}function WG(e){return(e=+e)==1?In:function(t,r){return r-t?jye(t,r,e):fd(isNaN(t)?r:t)}}function In(e,t){var r=t-e;return r?$G(e,r):fd(isNaN(e)?t:e)}var Wp=Te(()=>{g();y();v();oT()});function VG(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),o=new Array(r),u,l;for(u=0;u{g();y();v();Js();I2();iT();Wp();Zf=function e(t){var r=WG(t);function n(i,o){var u=r((i=zp(i)).r,(o=zp(o)).r),l=r(i.g,o.g),a=r(i.b,o.b),s=In(i.opacity,o.opacity);return function(f){return i.r=u(f),i.g=l(f),i.b=a(f),i.opacity=s(f),i+""}}return n.gamma=e,n}(1);GG=VG(O2),YG=VG(F2)});function cd(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;i{g();y();v()});function ZG(e,t){return(_2(t)?cd:sT)(e,t)}function sT(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),o=new Array(r),u;for(u=0;u{g();y();v();m0();k2()});function B2(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var lT=Te(()=>{g();y();v()});function Hi(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var h0=Te(()=>{g();y();v()});function L2(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Jo(e[i],t[i]):n[i]=t[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var fT=Te(()=>{g();y();v();m0()});function exe(e){return function(){return e}}function txe(e){return function(t){return e(t)+""}}function pd(e,t){var r=pT.lastIndex=cT.lastIndex=0,n,i,o,u=-1,l=[],a=[];for(e=e+"",t=t+"";(n=pT.exec(e))&&(i=cT.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),l[u]?l[u]+=o:l[++u]=o),(n=n[0])===(i=i[0])?l[u]?l[u]+=i:l[++u]=i:(l[++u]=null,a.push({i:u,x:Hi(n,i)})),r=cT.lastIndex;return r{g();y();v();h0();pT=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cT=new RegExp(pT.source,"g")});function Jo(e,t){var r=typeof t,n;return t==null||r==="boolean"?fd(t):(r==="number"?Hi:r==="string"?(n=as(t))?(t=n,Zf):pd:t instanceof as?Zf:t instanceof Date?B2:_2(t)?cd:Array.isArray(t)?sT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?L2:Hi)(e,t)}var m0=Te(()=>{g();y();v();Js();aT();uT();lT();h0();fT();mT();oT();k2()});function XG(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}}var KG=Te(()=>{g();y();v()});function JG(e,t){var r=Yf(+e,+t);return function(n){var i=r(n);return i-360*Math.floor(i/360)}}var QG=Te(()=>{g();y();v();Wp()});function Xf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var jG=Te(()=>{g();y();v()});function hT(e,t,r,n,i,o){var u,l,a;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(a=e*r+t*n)&&(r-=e*a,n-=t*a),(l=Math.sqrt(r*r+n*n))&&(r/=l,n/=l,a/=l),e*n{g();y();v();eY=180/Math.PI,P2={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function rY(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?P2:hT(t.a,t.b,t.c,t.d,t.e,t.f)}function nY(e){return e==null?P2:(R2||(R2=document.createElementNS("http://www.w3.org/2000/svg","g")),R2.setAttribute("transform",e),(e=R2.transform.baseVal.consolidate())?(e=e.matrix,hT(e.a,e.b,e.c,e.d,e.e,e.f)):P2)}var R2,iY=Te(()=>{g();y();v();tY()});function oY(e,t,r,n){function i(s){return s.length?s.pop()+" ":""}function o(s,f,p,h,x,b){if(s!==p||f!==h){var w=x.push("translate(",null,t,null,r);b.push({i:w-4,x:Hi(s,p)},{i:w-2,x:Hi(f,h)})}else(p||h)&&x.push("translate("+p+t+h+r)}function u(s,f,p,h){s!==f?(s-f>180?f+=360:f-s>180&&(s+=360),h.push({i:p.push(i(p)+"rotate(",null,n)-2,x:Hi(s,f)})):f&&p.push(i(p)+"rotate("+f+n)}function l(s,f,p,h){s!==f?h.push({i:p.push(i(p)+"skewX(",null,n)-2,x:Hi(s,f)}):f&&p.push(i(p)+"skewX("+f+n)}function a(s,f,p,h,x,b){if(s!==p||f!==h){var w=x.push(i(x)+"scale(",null,",",null,")");b.push({i:w-4,x:Hi(s,p)},{i:w-2,x:Hi(f,h)})}else(p!==1||h!==1)&&x.push(i(x)+"scale("+p+","+h+")")}return function(s,f){var p=[],h=[];return s=e(s),f=e(f),o(s.translateX,s.translateY,f.translateX,f.translateY,p,h),u(s.rotate,f.rotate,p,h),l(s.skewX,f.skewX,p,h),a(s.scaleX,s.scaleY,f.scaleX,f.scaleY,p,h),s=f=null,function(x){for(var b=-1,w=h.length,A;++b{g();y();v();h0();iY();q2=oY(rY,"px, ","px)","deg)"),z2=oY(nY,", ",")",")")});function sY(e){return((e=Math.exp(e))+1/e)/2}function nxe(e){return((e=Math.exp(e))-1/e)/2}function ixe(e){return((e=Math.exp(2*e))-1)/(e+1)}var rxe,U2,uY=Te(()=>{g();y();v();rxe=1e-12;U2=function e(t,r,n){function i(o,u){var l=o[0],a=o[1],s=o[2],f=u[0],p=u[1],h=u[2],x=f-l,b=p-a,w=x*x+b*b,A,E;if(w{g();y();v();Js();Wp();fY=lY(Yf),cY=lY(In)});function dT(e,t){var r=In((e=Up(e)).l,(t=Up(t)).l),n=In(e.a,t.a),i=In(e.b,t.b),o=In(e.opacity,t.opacity);return function(u){return e.l=r(u),e.a=n(u),e.b=i(u),e.opacity=o(u),e+""}}var mY=Te(()=>{g();y();v();Js();Wp()});function hY(e){return function(t,r){var n=e((t=ld(t)).h,(r=ld(r)).h),i=In(t.c,r.c),o=In(t.l,r.l),u=In(t.opacity,r.opacity);return function(l){return t.h=n(l),t.c=i(l),t.l=o(l),t.opacity=u(l),t+""}}}var dY,gY,vY=Te(()=>{g();y();v();Js();Wp();dY=hY(Yf),gY=hY(In)});function yY(e){return function t(r){r=+r;function n(i,o){var u=e((i=$p(i)).h,(o=$p(o)).h),l=In(i.s,o.s),a=In(i.l,o.l),s=In(i.opacity,o.opacity);return function(f){return i.h=u(f),i.s=l(f),i.l=a(Math.pow(f,r)),i.opacity=s(f),i+""}}return n.gamma=t,n}(1)}var xY,wY,bY=Te(()=>{g();y();v();Js();Wp();xY=yY(Yf),wY=yY(In)});function d0(e,t){t===void 0&&(t=e,e=Jo);for(var r=0,n=t.length-1,i=t[0],o=new Array(n<0?0:n);r{g();y();v();m0()});function NY(e,t){for(var r=new Array(t),n=0;n{g();y();v()});var SY={};qa(SY,{interpolate:()=>Jo,interpolateArray:()=>ZG,interpolateBasis:()=>O2,interpolateBasisClosed:()=>F2,interpolateCubehelix:()=>xY,interpolateCubehelixLong:()=>wY,interpolateDate:()=>B2,interpolateDiscrete:()=>XG,interpolateHcl:()=>dY,interpolateHclLong:()=>gY,interpolateHsl:()=>fY,interpolateHslLong:()=>cY,interpolateHue:()=>JG,interpolateLab:()=>dT,interpolateNumber:()=>Hi,interpolateNumberArray:()=>cd,interpolateObject:()=>L2,interpolateRgb:()=>Zf,interpolateRgbBasis:()=>GG,interpolateRgbBasisClosed:()=>YG,interpolateRound:()=>Xf,interpolateString:()=>pd,interpolateTransformCss:()=>q2,interpolateTransformSvg:()=>z2,interpolateZoom:()=>U2,piecewise:()=>d0,quantize:()=>NY});var Ml=Te(()=>{g();y();v();m0();uT();I2();iT();lT();KG();QG();h0();k2();fT();jG();mT();aY();uY();aT();pY();mY();vY();bY();DY();EY()});function gT(e){return function(){return e}}var AY=Te(()=>{g();y();v()});function Kf(e){return+e}var H2=Te(()=>{g();y();v()});function Ti(e){return e}function vT(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:gT(isNaN(t)?NaN:.5)}function oxe(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function axe(e,t,r){var n=e[0],i=e[1],o=t[0],u=t[1];return i2?sxe:axe,a=s=null,p}function p(h){return h==null||isNaN(h=+h)?o:(a||(a=l(e.map(n),t,r)))(n(u(h)))}return p.invert=function(h){return u(i((s||(s=l(t,e.map(n),Hi)))(h)))},p.domain=function(h){return arguments.length?(e=Array.from(h,Kf),f()):e.slice()},p.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},p.rangeRound=function(h){return t=Array.from(h),r=Xf,f()},p.clamp=function(h){return arguments.length?(u=h?!0:Ti,f()):u!==Ti},p.interpolate=function(h){return arguments.length?(r=h,f()):r},p.unknown=function(h){return arguments.length?(o=h,p):o},function(h,x){return n=h,i=x,f()}}function Gp(){return Vp()(Ti,Ti)}var CY,Pu=Te(()=>{g();y();v();is();Ml();AY();H2();CY=[0,1]});function g0(e,t,r,n){var i=id(e,t,r),o;switch(n=Ys(n??",f"),n.type){case"s":{var u=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=f2(i,u))&&(n.precision=o),i0(n,u)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=c2(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=l2(i))&&(n.precision=o-(n.type==="%")*2);break}}return kp(n)}var yT=Te(()=>{g();y();v();is();p2()});function Bo(e){var t=e.domain;return e.ticks=function(r){var n=t();return Lp(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return g0(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,u=n[i],l=n[o],a,s,f=10;for(l0;){if(s=s0(u,l,r),s===a)return n[i]=u,n[o]=l,t(n);if(s>0)u=Math.floor(u/s)*s,l=Math.ceil(l/s)*s;else if(s<0)u=Math.ceil(u*s)/s,l=Math.floor(l*s)/s;else break;a=s}return e},e}function $2(){var e=Gp();return e.copy=function(){return Lu(e,$2())},On.apply(e,arguments),Bo(e)}var Tl=Te(()=>{g();y();v();is();Pu();bo();yT()});function W2(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Kf),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return W2(e).unknown(t)},e=arguments.length?Array.from(e,Kf):[0,1],Bo(r)}var MY=Te(()=>{g();y();v();Tl();H2()});function v0(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],u;return o{g();y();v()});function TY(e){return Math.log(e)}function OY(e){return Math.exp(e)}function uxe(e){return-Math.log(-e)}function lxe(e){return-Math.exp(-e)}function fxe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function cxe(e){return e===10?fxe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function pxe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function IY(e){return(t,r)=>-e(-t,r)}function y0(e){let t=e(TY,OY),r=t.domain,n=10,i,o;function u(){return i=pxe(n),o=cxe(n),r()[0]<0?(i=IY(i),o=IY(o),e(uxe,lxe)):e(TY,OY),t}return t.base=function(l){return arguments.length?(n=+l,u()):n},t.domain=function(l){return arguments.length?(r(l),u()):r()},t.ticks=l=>{let a=r(),s=a[0],f=a[a.length-1],p=f0){for(;h<=x;++h)for(b=1;bf)break;E.push(w)}}else for(;h<=x;++h)for(b=n-1;b>=1;--b)if(w=h>0?b/o(-h):b*o(h),!(wf)break;E.push(w)}E.length*2{if(l==null&&(l=10),a==null&&(a=n===10?"s":","),typeof a!="function"&&(!(n%1)&&(a=Ys(a)).precision==null&&(a.trim=!0),a=kp(a)),l===1/0)return a;let s=Math.max(1,n*l/t.ticks().length);return f=>{let p=f/o(Math.round(i(f)));return p*nr(v0(r(),{floor:l=>o(Math.floor(i(l))),ceil:l=>o(Math.ceil(i(l)))})),t}function V2(){let e=y0(Vp()).domain([1,10]);return e.copy=()=>Lu(e,V2()).base(e.base()),On.apply(e,arguments),e}var G2=Te(()=>{g();y();v();is();p2();xT();Pu();bo()});function FY(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function _Y(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function x0(e){var t=1,r=e(FY(t),_Y(t));return r.constant=function(n){return arguments.length?e(FY(t=+n),_Y(t)):t},Bo(r)}function Y2(){var e=x0(Vp());return e.copy=function(){return Lu(e,Y2()).constant(e.constant())},On.apply(e,arguments)}var Z2=Te(()=>{g();y();v();Tl();Pu();bo()});function kY(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function mxe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function hxe(e){return e<0?-e*e:e*e}function w0(e){var t=e(Ti,Ti),r=1;function n(){return r===1?e(Ti,Ti):r===.5?e(mxe,hxe):e(kY(r),kY(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Bo(t)}function b0(){var e=w0(Vp());return e.copy=function(){return Lu(e,b0()).exponent(e.exponent())},On.apply(e,arguments),e}function BY(){return b0.apply(null,arguments).exponent(.5)}var X2=Te(()=>{g();y();v();Tl();Pu();bo()});function LY(e){return Math.sign(e)*e*e}function dxe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function K2(){var e=Gp(),t=[0,1],r=!1,n;function i(o){var u=dxe(e(o));return isNaN(u)?n:r?Math.round(u):u}return i.invert=function(o){return e.invert(LY(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Kf)).map(LY)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return K2(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},On.apply(i,arguments),Bo(i)}var PY=Te(()=>{g();y();v();Pu();bo();Tl();H2()});function J2(){var e=[],t=[],r=[],n;function i(){var u=0,l=Math.max(1,t.length);for(r=new Array(l-1);++u0?r[l-1]:e[0],l{g();y();v();is();bo()});function Q2(){var e=0,t=1,r=1,n=[.5],i=[0,1],o;function u(a){return a!=null&&a<=a?i[Zs(n,a,0,r)]:o}function l(){var a=-1;for(n=new Array(r);++a=r?[n[r-1],t]:[n[s-1],n[s]]},u.unknown=function(a){return arguments.length&&(o=a),u},u.thresholds=function(){return n.slice()},u.copy=function(){return Q2().domain([e,t]).range(i).unknown(o)},On.apply(Bo(u),arguments)}var qY=Te(()=>{g();y();v();is();Tl();bo()});function j2(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[Zs(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var u=t.indexOf(o);return[e[u-1],e[u]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return j2().domain(e).range(t).unknown(r)},On.apply(i,arguments)}var zY=Te(()=>{g();y();v();is();bo()});function pn(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{let u=i(o),l=i.ceil(o);return o-u(t(o=new Date(+o),u==null?1:Math.floor(u)),o),i.range=(o,u,l)=>{let a=[];if(o=i.ceil(o),l=l==null?1:Math.floor(l),!(o0))return a;let s;do a.push(s=new Date(+o)),t(o,l),e(o);while(spn(u=>{if(u>=u)for(;e(u),!o(u);)u.setTime(u-1)},(u,l)=>{if(u>=u)if(l<0)for(;++l<=0;)for(;t(u,-1),!o(u););else for(;--l>=0;)for(;t(u,1),!o(u););}),r&&(i.count=(o,u)=>(wT.setTime(+o),bT.setTime(+u),e(wT),e(bT),Math.floor(r(wT,bT))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?u=>n(u)%o===0:u=>i.count(0,u)%o===0):i)),i}var wT,bT,Ol=Te(()=>{g();y();v();wT=new Date,bT=new Date});var D0,Xnr,UY=Te(()=>{g();y();v();Ol();D0=pn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);D0.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?pn(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):D0);Xnr=D0.range});var ss,HY,DT=Te(()=>{g();y();v();Ol();ss=pn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),HY=ss.range});var md,gxe,hd,vxe,NT=Te(()=>{g();y();v();Ol();md=pn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),gxe=md.range,hd=pn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),vxe=hd.range});var dd,yxe,gd,xxe,ET=Te(()=>{g();y();v();Ol();dd=pn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3-e.getMinutes()*6e4)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getHours()),yxe=dd.range,gd=pn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),xxe=gd.range});var Il,wxe,Xp,bxe,eD,Dxe,ST=Te(()=>{g();y();v();Ol();Il=pn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1),wxe=Il.range,Xp=pn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),bxe=Xp.range,eD=pn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),Dxe=eD.range});function Kp(e){return pn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}function Jp(e){return pn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/6048e5)}var Fl,vd,WY,VY,Jf,GY,YY,ZY,Nxe,Exe,Sxe,Axe,Cxe,Mxe,_l,yd,XY,KY,Qf,JY,QY,jY,Txe,Oxe,Ixe,Fxe,_xe,kxe,AT=Te(()=>{g();y();v();Ol();Fl=Kp(0),vd=Kp(1),WY=Kp(2),VY=Kp(3),Jf=Kp(4),GY=Kp(5),YY=Kp(6),ZY=Fl.range,Nxe=vd.range,Exe=WY.range,Sxe=VY.range,Axe=Jf.range,Cxe=GY.range,Mxe=YY.range;_l=Jp(0),yd=Jp(1),XY=Jp(2),KY=Jp(3),Qf=Jp(4),JY=Jp(5),QY=Jp(6),jY=_l.range,Txe=yd.range,Oxe=XY.range,Ixe=KY.range,Fxe=Qf.range,_xe=JY.range,kxe=QY.range});var xd,Bxe,wd,Lxe,CT=Te(()=>{g();y();v();Ol();xd=pn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),Bxe=xd.range,wd=pn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),Lxe=wd.range});var Aa,Pxe,Ca,Rxe,MT=Te(()=>{g();y();v();Ol();Aa=pn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Aa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Pxe=Aa.range,Ca=pn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ca.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Rxe=Ca.range});function tZ(e,t,r,n,i,o){let u=[[ss,1,1e3],[ss,5,5*1e3],[ss,15,15*1e3],[ss,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function l(s,f,p){let h=fA).right(u,h);if(x===u.length)return e.every(id(s/31536e6,f/31536e6,p));if(x===0)return D0.every(Math.max(id(s,f,p),1));let[b,w]=u[h/u[x-1][2]{g();y();v();is();UY();DT();NT();ET();ST();AT();CT();MT();[TT,OT]=tZ(Ca,wd,_l,eD,gd,hd),[IT,FT]=tZ(Aa,xd,Fl,Il,dd,md)});var tD=Te(()=>{g();y();v();DT();NT();ET();ST();AT();CT();MT();rZ()});function _T(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function kT(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function E0(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function BT(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,o=e.days,u=e.shortDays,l=e.months,a=e.shortMonths,s=S0(i),f=A0(i),p=S0(o),h=A0(o),x=S0(u),b=A0(u),w=S0(l),A=A0(l),E=S0(a),O=A0(a),M={a:Z,A:le,b:re,B:he,c:null,d:uZ,e:uZ,f:uwe,g:ywe,G:wwe,H:owe,I:awe,j:swe,L:mZ,m:lwe,M:fwe,p:De,q:we,Q:cZ,s:pZ,S:cwe,u:pwe,U:mwe,V:hwe,w:dwe,W:gwe,x:null,X:null,y:vwe,Y:xwe,Z:bwe,"%":fZ},I={a:ce,A:Ee,b:Pe,B:Ce,c:null,d:lZ,e:lZ,f:Swe,g:Bwe,G:Pwe,H:Dwe,I:Nwe,j:Ewe,L:dZ,m:Awe,M:Cwe,p:Oe,q:He,Q:cZ,s:pZ,S:Mwe,u:Twe,U:Owe,V:Iwe,w:Fwe,W:_we,x:null,X:null,y:kwe,Y:Lwe,Z:Rwe,"%":fZ},F={a:U,A:H,b:V,B:W,c:ee,d:aZ,e:aZ,f:twe,g:oZ,G:iZ,H:sZ,I:sZ,j:Jxe,L:ewe,m:Kxe,M:Qxe,p:q,q:Xxe,Q:nwe,s:iwe,S:jxe,u:Wxe,U:Vxe,V:Gxe,w:$xe,W:Yxe,x:ie,X:Y,y:oZ,Y:iZ,Z:Zxe,"%":rwe};M.x=C(r,M),M.X=C(n,M),M.c=C(t,M),I.x=C(r,I),I.X=C(n,I),I.c=C(t,I);function C(Se,ze){return function(We){var Le=[],lt=-1,ct=0,de=Se.length,be,Ue,ge;for(We instanceof Date||(We=new Date(+We));++lt53)return null;"w"in Le||(Le.w=1),"Z"in Le?(ct=kT(E0(Le.y,0,1)),de=ct.getUTCDay(),ct=de>4||de===0?yd.ceil(ct):yd(ct),ct=Xp.offset(ct,(Le.V-1)*7),Le.y=ct.getUTCFullYear(),Le.m=ct.getUTCMonth(),Le.d=ct.getUTCDate()+(Le.w+6)%7):(ct=_T(E0(Le.y,0,1)),de=ct.getDay(),ct=de>4||de===0?vd.ceil(ct):vd(ct),ct=Il.offset(ct,(Le.V-1)*7),Le.y=ct.getFullYear(),Le.m=ct.getMonth(),Le.d=ct.getDate()+(Le.w+6)%7)}else("W"in Le||"U"in Le)&&("w"in Le||(Le.w="u"in Le?Le.u%7:"W"in Le?1:0),de="Z"in Le?kT(E0(Le.y,0,1)).getUTCDay():_T(E0(Le.y,0,1)).getDay(),Le.m=0,Le.d="W"in Le?(Le.w+6)%7+Le.W*7-(de+5)%7:Le.w+Le.U*7-(de+6)%7);return"Z"in Le?(Le.H+=Le.Z/100|0,Le.M+=Le.Z%100,kT(Le)):_T(Le)}}function R(Se,ze,We,Le){for(var lt=0,ct=ze.length,de=We.length,be,Ue;lt=de)return-1;if(be=ze.charCodeAt(lt++),be===37){if(be=ze.charAt(lt++),Ue=F[be in nZ?ze.charAt(lt++):be],!Ue||(Le=Ue(Se,We,Le))<0)return-1}else if(be!=We.charCodeAt(Le++))return-1}return Le}function q(Se,ze,We){var Le=s.exec(ze.slice(We));return Le?(Se.p=f.get(Le[0].toLowerCase()),We+Le[0].length):-1}function U(Se,ze,We){var Le=x.exec(ze.slice(We));return Le?(Se.w=b.get(Le[0].toLowerCase()),We+Le[0].length):-1}function H(Se,ze,We){var Le=p.exec(ze.slice(We));return Le?(Se.w=h.get(Le[0].toLowerCase()),We+Le[0].length):-1}function V(Se,ze,We){var Le=E.exec(ze.slice(We));return Le?(Se.m=O.get(Le[0].toLowerCase()),We+Le[0].length):-1}function W(Se,ze,We){var Le=w.exec(ze.slice(We));return Le?(Se.m=A.get(Le[0].toLowerCase()),We+Le[0].length):-1}function ee(Se,ze,We){return R(Se,t,ze,We)}function ie(Se,ze,We){return R(Se,r,ze,We)}function Y(Se,ze,We){return R(Se,n,ze,We)}function Z(Se){return u[Se.getDay()]}function le(Se){return o[Se.getDay()]}function re(Se){return a[Se.getMonth()]}function he(Se){return l[Se.getMonth()]}function De(Se){return i[+(Se.getHours()>=12)]}function we(Se){return 1+~~(Se.getMonth()/3)}function ce(Se){return u[Se.getUTCDay()]}function Ee(Se){return o[Se.getUTCDay()]}function Pe(Se){return a[Se.getUTCMonth()]}function Ce(Se){return l[Se.getUTCMonth()]}function Oe(Se){return i[+(Se.getUTCHours()>=12)]}function He(Se){return 1+~~(Se.getUTCMonth()/3)}return{format:function(Se){var ze=C(Se+="",M);return ze.toString=function(){return Se},ze},parse:function(Se){var ze=P(Se+="",!1);return ze.toString=function(){return Se},ze},utcFormat:function(Se){var ze=C(Se+="",I);return ze.toString=function(){return Se},ze},utcParse:function(Se){var ze=P(Se+="",!0);return ze.toString=function(){return Se},ze}}}function Ur(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function $xe(e,t,r){var n=$i.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Wxe(e,t,r){var n=$i.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Vxe(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Gxe(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Yxe(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function iZ(e,t,r){var n=$i.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function oZ(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Zxe(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Xxe(e,t,r){var n=$i.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Kxe(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function aZ(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Jxe(e,t,r){var n=$i.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function sZ(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Qxe(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function jxe(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function ewe(e,t,r){var n=$i.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function twe(e,t,r){var n=$i.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function rwe(e,t,r){var n=zxe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function nwe(e,t,r){var n=$i.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function iwe(e,t,r){var n=$i.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function uZ(e,t){return Ur(e.getDate(),t,2)}function owe(e,t){return Ur(e.getHours(),t,2)}function awe(e,t){return Ur(e.getHours()%12||12,t,2)}function swe(e,t){return Ur(1+Il.count(Aa(e),e),t,3)}function mZ(e,t){return Ur(e.getMilliseconds(),t,3)}function uwe(e,t){return mZ(e,t)+"000"}function lwe(e,t){return Ur(e.getMonth()+1,t,2)}function fwe(e,t){return Ur(e.getMinutes(),t,2)}function cwe(e,t){return Ur(e.getSeconds(),t,2)}function pwe(e){var t=e.getDay();return t===0?7:t}function mwe(e,t){return Ur(Fl.count(Aa(e)-1,e),t,2)}function hZ(e){var t=e.getDay();return t>=4||t===0?Jf(e):Jf.ceil(e)}function hwe(e,t){return e=hZ(e),Ur(Jf.count(Aa(e),e)+(Aa(e).getDay()===4),t,2)}function dwe(e){return e.getDay()}function gwe(e,t){return Ur(vd.count(Aa(e)-1,e),t,2)}function vwe(e,t){return Ur(e.getFullYear()%100,t,2)}function ywe(e,t){return e=hZ(e),Ur(e.getFullYear()%100,t,2)}function xwe(e,t){return Ur(e.getFullYear()%1e4,t,4)}function wwe(e,t){var r=e.getDay();return e=r>=4||r===0?Jf(e):Jf.ceil(e),Ur(e.getFullYear()%1e4,t,4)}function bwe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ur(t/60|0,"0",2)+Ur(t%60,"0",2)}function lZ(e,t){return Ur(e.getUTCDate(),t,2)}function Dwe(e,t){return Ur(e.getUTCHours(),t,2)}function Nwe(e,t){return Ur(e.getUTCHours()%12||12,t,2)}function Ewe(e,t){return Ur(1+Xp.count(Ca(e),e),t,3)}function dZ(e,t){return Ur(e.getUTCMilliseconds(),t,3)}function Swe(e,t){return dZ(e,t)+"000"}function Awe(e,t){return Ur(e.getUTCMonth()+1,t,2)}function Cwe(e,t){return Ur(e.getUTCMinutes(),t,2)}function Mwe(e,t){return Ur(e.getUTCSeconds(),t,2)}function Twe(e){var t=e.getUTCDay();return t===0?7:t}function Owe(e,t){return Ur(_l.count(Ca(e)-1,e),t,2)}function gZ(e){var t=e.getUTCDay();return t>=4||t===0?Qf(e):Qf.ceil(e)}function Iwe(e,t){return e=gZ(e),Ur(Qf.count(Ca(e),e)+(Ca(e).getUTCDay()===4),t,2)}function Fwe(e){return e.getUTCDay()}function _we(e,t){return Ur(yd.count(Ca(e)-1,e),t,2)}function kwe(e,t){return Ur(e.getUTCFullYear()%100,t,2)}function Bwe(e,t){return e=gZ(e),Ur(e.getUTCFullYear()%100,t,2)}function Lwe(e,t){return Ur(e.getUTCFullYear()%1e4,t,4)}function Pwe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Qf(e):Qf.ceil(e),Ur(e.getUTCFullYear()%1e4,t,4)}function Rwe(){return"+0000"}function fZ(){return"%"}function cZ(e){return+e}function pZ(e){return Math.floor(+e/1e3)}var nZ,$i,zxe,Uxe,vZ=Te(()=>{g();y();v();tD();nZ={"-":"",_:" ",0:"0"},$i=/^\s*\d+/,zxe=/^%/,Uxe=/[\\^$*+?|[\]().{}]/g});function LT(e){return bd=BT(e),rD=bd.format,yZ=bd.parse,nD=bd.utcFormat,xZ=bd.utcParse,bd}var bd,rD,yZ,nD,xZ,wZ=Te(()=>{g();y();v();vZ();LT({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})});var PT=Te(()=>{g();y();v();wZ()});function qwe(e){return new Date(e)}function zwe(e){return e instanceof Date?+e:+new Date(+e)}function iD(e,t,r,n,i,o,u,l,a,s){var f=Gp(),p=f.invert,h=f.domain,x=s(".%L"),b=s(":%S"),w=s("%I:%M"),A=s("%I %p"),E=s("%a %d"),O=s("%b %d"),M=s("%B"),I=s("%Y");function F(C){return(a(C){g();y();v();tD();PT();Pu();bo();xT()});function zT(){return On.apply(iD(TT,OT,Ca,wd,_l,Xp,gd,hd,ss,nD).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}var bZ=Te(()=>{g();y();v();tD();PT();qT();bo()});function oD(){var e=0,t=1,r,n,i,o,u=Ti,l=!1,a;function s(p){return p==null||isNaN(p=+p)?a:u(i===0?.5:(p=(o(p)-r)*i,l?Math.max(0,Math.min(1,p)):p))}s.domain=function(p){return arguments.length?([e,t]=p,r=o(e=+e),n=o(t=+t),i=r===n?0:1/(n-r),s):[e,t]},s.clamp=function(p){return arguments.length?(l=!!p,s):l},s.interpolator=function(p){return arguments.length?(u=p,s):u};function f(p){return function(h){var x,b;return arguments.length?([x,b]=h,u=p(x,b),s):[u(0),u(1)]}}return s.range=f(Jo),s.rangeRound=f(Xf),s.unknown=function(p){return arguments.length?(a=p,s):a},function(p){return o=p,r=p(e),n=p(t),i=r===n?0:1/(n-r),s}}function kl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function aD(){var e=Bo(oD()(Ti));return e.copy=function(){return kl(e,aD())},os.apply(e,arguments)}function UT(){var e=y0(oD()).domain([1,10]);return e.copy=function(){return kl(e,UT()).base(e.base())},os.apply(e,arguments)}function HT(){var e=x0(oD());return e.copy=function(){return kl(e,HT()).constant(e.constant())},os.apply(e,arguments)}function sD(){var e=w0(oD());return e.copy=function(){return kl(e,sD()).exponent(e.exponent())},os.apply(e,arguments)}function DZ(){return sD.apply(null,arguments).exponent(.5)}var $T=Te(()=>{g();y();v();Ml();Pu();bo();Tl();G2();Z2();X2()});function uD(){var e=[],t=Ti;function r(n){if(n!=null&&!isNaN(n=+n))return t((Zs(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(ko),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>v2(e,o/n))},r.copy=function(){return uD(t).domain(e)},os.apply(r,arguments)}var NZ=Te(()=>{g();y();v();is();Pu();bo()});function lD(){var e=0,t=.5,r=1,n=1,i,o,u,l,a,s=Ti,f,p=!1,h;function x(w){return isNaN(w=+w)?h:(w=.5+((w=+f(w))-o)*(n*w{g();y();v();Ml();Pu();bo();Tl();G2();$T();Z2();X2()});var AZ={};qa(AZ,{scaleBand:()=>l0,scaleDiverging:()=>fD,scaleDivergingLog:()=>WT,scaleDivergingPow:()=>cD,scaleDivergingSqrt:()=>EZ,scaleDivergingSymlog:()=>VT,scaleIdentity:()=>W2,scaleImplicit:()=>x2,scaleLinear:()=>$2,scaleLog:()=>V2,scaleOrdinal:()=>od,scalePoint:()=>gG,scalePow:()=>b0,scaleQuantile:()=>J2,scaleQuantize:()=>Q2,scaleRadial:()=>K2,scaleSequential:()=>aD,scaleSequentialLog:()=>UT,scaleSequentialPow:()=>sD,scaleSequentialQuantile:()=>uD,scaleSequentialSqrt:()=>DZ,scaleSequentialSymlog:()=>HT,scaleSqrt:()=>BY,scaleSymlog:()=>Y2,scaleThreshold:()=>j2,scaleTime:()=>RT,scaleUtc:()=>zT,tickFormat:()=>g0});var CZ=Te(()=>{g();y();v();vG();MY();Tl();G2();Z2();ZM();X2();PY();RY();qY();zY();qT();bZ();$T();NZ();SZ();yT()});function MZ(e){return e}var TZ=Te(()=>{g();y();v()});function Uwe(e){return"translate("+e+",0)"}function Hwe(e){return"translate(0,"+e+")"}function $we(e){return t=>+e(t)}function Wwe(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),r=>+e(r)+t}function Vwe(){return!this.__axis}function hD(e,t){var r=[],n=null,i=null,o=6,u=6,l=3,a=typeof window<"u"&&window.devicePixelRatio>1?0:.5,s=e===pD||e===C0?-1:1,f=e===C0||e===mD?"x":"y",p=e===pD||e===GT?Uwe:Hwe;function h(x){var b=n??(t.ticks?t.ticks.apply(t,r):t.domain()),w=i??(t.tickFormat?t.tickFormat.apply(t,r):MZ),A=Math.max(o,0)+l,E=t.range(),O=+E[0]+a,M=+E[E.length-1]+a,I=(t.bandwidth?Wwe:$we)(t.copy(),a),F=x.selection?x.selection():x,C=F.selectAll(".domain").data([null]),P=F.selectAll(".tick").data(b,t).order(),R=P.exit(),q=P.enter().append("g").attr("class","tick"),U=P.select("line"),H=P.select("text");C=C.merge(C.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),P=P.merge(q),U=U.merge(q.append("line").attr("stroke","currentColor").attr(f+"2",s*o)),H=H.merge(q.append("text").attr("fill","currentColor").attr(f,s*A).attr("dy",e===pD?"0em":e===GT?"0.71em":"0.32em")),x!==F&&(C=C.transition(x),P=P.transition(x),U=U.transition(x),H=H.transition(x),R=R.transition(x).attr("opacity",OZ).attr("transform",function(V){return isFinite(V=I(V))?p(V+a):this.getAttribute("transform")}),q.attr("opacity",OZ).attr("transform",function(V){var W=this.parentNode.__axis;return p((W&&isFinite(W=W(V))?W:I(V))+a)})),R.remove(),C.attr("d",e===C0||e===mD?u?"M"+s*u+","+O+"H"+a+"V"+M+"H"+s*u:"M"+a+","+O+"V"+M:u?"M"+O+","+s*u+"V"+a+"H"+M+"V"+s*u:"M"+O+","+a+"H"+M),P.attr("opacity",1).attr("transform",function(V){return p(I(V)+a)}),U.attr(f+"2",s*o),H.attr(f,s*A).text(w),F.filter(Vwe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===mD?"start":e===C0?"end":"middle"),F.each(function(){this.__axis=I})}return h.scale=function(x){return arguments.length?(t=x,h):t},h.ticks=function(){return r=Array.from(arguments),h},h.tickArguments=function(x){return arguments.length?(r=x==null?[]:Array.from(x),h):r.slice()},h.tickValues=function(x){return arguments.length?(n=x==null?null:Array.from(x),h):n&&n.slice()},h.tickFormat=function(x){return arguments.length?(i=x,h):i},h.tickSize=function(x){return arguments.length?(o=u=+x,h):o},h.tickSizeInner=function(x){return arguments.length?(o=+x,h):o},h.tickSizeOuter=function(x){return arguments.length?(u=+x,h):u},h.tickPadding=function(x){return arguments.length?(l=+x,h):l},h.offset=function(x){return arguments.length?(a=+x,h):a},h}function IZ(e){return hD(pD,e)}function FZ(e){return hD(mD,e)}function _Z(e){return hD(GT,e)}function kZ(e){return hD(C0,e)}var pD,mD,GT,C0,OZ,BZ=Te(()=>{g();y();v();TZ();pD=1,mD=2,GT=3,C0=4,OZ=1e-6});var LZ={};qa(LZ,{axisBottom:()=>_Z,axisLeft:()=>kZ,axisRight:()=>FZ,axisTop:()=>IZ});var PZ=Te(()=>{g();y();v();BZ()});function qZ(){for(var e=0,t=arguments.length,r={},n;e=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}function Zwe(e,t){for(var r=0,n=e.length,i;r{g();y();v();Gwe={value:()=>{}};dD.prototype=qZ.prototype={constructor:dD,on:function(e,t){var r=this._,n=Ywe(e+"",r),i,o=-1,u=n.length;if(arguments.length<2){for(;++o0)for(var r=new Array(i),n=0,i,o;n{g();y();v();zZ()});var gD,T0,vD=Te(()=>{g();y();v();gD="http://www.w3.org/1999/xhtml",T0={svg:"http://www.w3.org/2000/svg",xhtml:gD,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function qu(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),T0.hasOwnProperty(t)?{space:T0[t],local:e}:e}var yD=Te(()=>{g();y();v();vD()});function Xwe(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===gD&&t.documentElement.namespaceURI===gD?t.createElement(e):t.createElementNS(r,e)}}function Kwe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jf(e){var t=qu(e);return(t.local?Kwe:Xwe)(t)}var O0=Te(()=>{g();y();v();yD();vD()});function Jwe(){}function ec(e){return e==null?Jwe:function(){return this.querySelector(e)}}var xD=Te(()=>{g();y();v()});function UZ(e){typeof e!="function"&&(e=ec(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{g();y();v();us();xD()});function I0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var ZT=Te(()=>{g();y();v()});function Qwe(){return[]}function Dd(e){return e==null?Qwe:function(){return this.querySelectorAll(e)}}var XT=Te(()=>{g();y();v()});function jwe(e){return function(){return I0(e.apply(this,arguments))}}function $Z(e){typeof e=="function"?e=jwe(e):e=Dd(e);for(var t=this._groups,r=t.length,n=[],i=[],o=0;o{g();y();v();us();ZT();XT()});function Nd(e){return function(){return this.matches(e)}}function wD(e){return function(t){return t.matches(e)}}var F0=Te(()=>{g();y();v()});function tbe(e){return function(){return ebe.call(this.children,e)}}function rbe(){return this.firstElementChild}function VZ(e){return this.select(e==null?rbe:tbe(typeof e=="function"?e:wD(e)))}var ebe,GZ=Te(()=>{g();y();v();F0();ebe=Array.prototype.find});function ibe(){return Array.from(this.children)}function obe(e){return function(){return nbe.call(this.children,e)}}function YZ(e){return this.selectAll(e==null?ibe:obe(typeof e=="function"?e:wD(e)))}var nbe,ZZ=Te(()=>{g();y();v();F0();nbe=Array.prototype.filter});function XZ(e){typeof e!="function"&&(e=Nd(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{g();y();v();us();F0()});function bD(e){return new Array(e.length)}var KT=Te(()=>{g();y();v()});function JZ(){return new bn(this._enter||this._groups.map(bD),this._parents)}function _0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}var JT=Te(()=>{g();y();v();KT();us();_0.prototype={constructor:_0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}}});function QZ(e){return function(){return e}}var jZ=Te(()=>{g();y();v()});function abe(e,t,r,n,i,o){for(var u=0,l,a=t.length,s=o.length;u=M&&(M=O+1);!(F=A[M])&&++M{g();y();v();us();JT();jZ()});function rX(){return new bn(this._exit||this._groups.map(bD),this._parents)}var nX=Te(()=>{g();y();v();KT();us()});function iX(e,t,r){var n=this.enter(),i=this,o=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?o.remove():r(o),n&&i?n.merge(i).order():i}var oX=Te(()=>{g();y();v()});function aX(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,o=n.length,u=Math.min(i,o),l=new Array(i),a=0;a{g();y();v();us()});function uX(){for(var e=this._groups,t=-1,r=e.length;++t=0;)(u=n[i])&&(o&&u.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(u,o),o=u);return this}var lX=Te(()=>{g();y();v()});function fX(e){e||(e=fbe);function t(p,h){return p&&h?e(p.__data__,h.__data__):!p-!h}for(var r=this._groups,n=r.length,i=new Array(n),o=0;ot?1:e>=t?0:NaN}var cX=Te(()=>{g();y();v();us()});function pX(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}var mX=Te(()=>{g();y();v()});function hX(){return Array.from(this)}var dX=Te(()=>{g();y();v()});function gX(){for(var e=this._groups,t=0,r=e.length;t{g();y();v()});function yX(){let e=0;for(let t of this)++e;return e}var xX=Te(()=>{g();y();v()});function wX(){return!this.node()}var bX=Te(()=>{g();y();v()});function DX(e){for(var t=this._groups,r=0,n=t.length;r{g();y();v()});function cbe(e){return function(){this.removeAttribute(e)}}function pbe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mbe(e,t){return function(){this.setAttribute(e,t)}}function hbe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function dbe(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function gbe(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function EX(e,t){var r=qu(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?pbe:cbe:typeof t=="function"?r.local?gbe:dbe:r.local?hbe:mbe)(r,t))}var SX=Te(()=>{g();y();v();yD()});function Ed(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var DD=Te(()=>{g();y();v()});function vbe(e){return function(){this.style.removeProperty(e)}}function ybe(e,t,r){return function(){this.style.setProperty(e,t,r)}}function xbe(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function AX(e,t,r){return arguments.length>1?this.each((t==null?vbe:typeof t=="function"?xbe:ybe)(e,t,r??"")):Bl(this.node(),e)}function Bl(e,t){return e.style.getPropertyValue(t)||Ed(e).getComputedStyle(e,null).getPropertyValue(t)}var QT=Te(()=>{g();y();v();DD()});function wbe(e){return function(){delete this[e]}}function bbe(e,t){return function(){this[e]=t}}function Dbe(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function CX(e,t){return arguments.length>1?this.each((t==null?wbe:typeof t=="function"?Dbe:bbe)(e,t)):this.node()[e]}var MX=Te(()=>{g();y();v()});function TX(e){return e.trim().split(/^|\s+/)}function jT(e){return e.classList||new OX(e)}function OX(e){this._node=e,this._names=TX(e.getAttribute("class")||"")}function IX(e,t){for(var r=jT(e),n=-1,i=t.length;++n{g();y();v();OX.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}}});function Abe(){this.textContent=""}function Cbe(e){return function(){this.textContent=e}}function Mbe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function BX(e){return arguments.length?this.each(e==null?Abe:(typeof e=="function"?Mbe:Cbe)(e)):this.node().textContent}var LX=Te(()=>{g();y();v()});function Tbe(){this.innerHTML=""}function Obe(e){return function(){this.innerHTML=e}}function Ibe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function PX(e){return arguments.length?this.each(e==null?Tbe:(typeof e=="function"?Ibe:Obe)(e)):this.node().innerHTML}var RX=Te(()=>{g();y();v()});function Fbe(){this.nextSibling&&this.parentNode.appendChild(this)}function qX(){return this.each(Fbe)}var zX=Te(()=>{g();y();v()});function _be(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UX(){return this.each(_be)}var HX=Te(()=>{g();y();v()});function $X(e){var t=typeof e=="function"?e:jf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}var WX=Te(()=>{g();y();v();O0()});function kbe(){return null}function VX(e,t){var r=typeof e=="function"?e:jf(e),n=t==null?kbe:typeof t=="function"?t:ec(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var GX=Te(()=>{g();y();v();O0();xD()});function Bbe(){var e=this.parentNode;e&&e.removeChild(this)}function YX(){return this.each(Bbe)}var ZX=Te(()=>{g();y();v()});function Lbe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pbe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function XX(e){return this.select(e?Pbe:Lbe)}var KX=Te(()=>{g();y();v()});function JX(e){return arguments.length?this.property("__data__",e):this.node().__data__}var QX=Te(()=>{g();y();v()});function Rbe(e){return function(t){e.call(this,t,this.__data__)}}function qbe(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function zbe(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,o;r{g();y();v()});function tK(e,t,r){var n=Ed(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Hbe(e,t){return function(){return tK(this,e,t)}}function $be(e,t){return function(){return tK(this,e,t.apply(this,arguments))}}function rK(e,t){return this.each((typeof t=="function"?$be:Hbe)(e,t))}var nK=Te(()=>{g();y();v();DD()});function*iK(){for(var e=this._groups,t=0,r=e.length;t{g();y();v()});function bn(e,t){this._groups=e,this._parents=t}function aK(){return new bn([[document.documentElement]],k0)}function Wbe(){return this}var k0,zu,us=Te(()=>{g();y();v();HZ();WZ();GZ();ZZ();KZ();tX();JT();nX();oX();sX();lX();cX();mX();dX();vX();xX();bX();NX();SX();QT();MX();kX();LX();RX();zX();HX();WX();GX();ZX();KX();QX();eK();nK();oK();k0=[null];bn.prototype=aK.prototype={constructor:bn,select:UZ,selectAll:$Z,selectChild:VZ,selectChildren:YZ,filter:XZ,data:eX,enter:JZ,exit:rX,join:iX,merge:aX,selection:Wbe,order:uX,sort:fX,call:pX,nodes:hX,node:gX,size:yX,empty:wX,each:DX,attr:EX,style:AX,property:CX,classed:_X,text:BX,html:PX,raise:qX,lower:UX,append:$X,insert:VX,remove:YX,clone:XX,datum:JX,on:jX,dispatch:rK,[Symbol.iterator]:iK};zu=aK});function Ma(e){return typeof e=="string"?new bn([[document.querySelector(e)]],[document.documentElement]):new bn([[e]],k0)}var e3=Te(()=>{g();y();v();us()});function sK(e){return Ma(jf(e).call(document.documentElement))}var uK=Te(()=>{g();y();v();O0();e3()});function ND(){return new t3}function t3(){this._="@"+(++Vbe).toString(36)}var Vbe,lK=Te(()=>{g();y();v();Vbe=0;t3.prototype=ND.prototype={constructor:t3,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}}});function ED(e){let t;for(;t=e.sourceEvent;)e=t;return e}var r3=Te(()=>{g();y();v()});function ls(e,t){if(e=ED(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var n3=Te(()=>{g();y();v();r3()});function fK(e,t){return e.target&&(e=ED(e),t===void 0&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,r=>ls(r,t))}var cK=Te(()=>{g();y();v();n3();r3()});function pK(e){return typeof e=="string"?new bn([document.querySelectorAll(e)],[document.documentElement]):new bn([I0(e)],k0)}var mK=Te(()=>{g();y();v();ZT();us()});var Qs={};qa(Qs,{create:()=>sK,creator:()=>jf,local:()=>ND,matcher:()=>Nd,namespace:()=>qu,namespaces:()=>T0,pointer:()=>ls,pointers:()=>fK,select:()=>Ma,selectAll:()=>pK,selection:()=>zu,selector:()=>ec,selectorAll:()=>Dd,style:()=>Bl,window:()=>Ed});var ti=Te(()=>{g();y();v();uK();O0();lK();F0();yD();vD();n3();cK();e3();mK();us();xD();XT();QT();DD()});function AD(e){e.preventDefault(),e.stopImmediatePropagation()}var SD,hK=Te(()=>{g();y();v();SD={capture:!0,passive:!1}});function i3(e){var t=e.document.documentElement,r=Ma(e).on("dragstart.drag",AD,SD);"onselectstart"in t?r.on("selectstart.drag",AD,SD):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function o3(e,t){var r=e.document.documentElement,n=Ma(e).on("dragstart.drag",null);t&&(n.on("click.drag",AD,SD),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}var dK=Te(()=>{g();y();v();ti();hK()});var gK=Te(()=>{g();y();v();dK()});function z0(){return Qp||(xK(Gbe),Qp=R0.now()+TD)}function Gbe(){Qp=0}function q0(){this._call=this._time=this._next=null}function OD(e,t,r){var n=new q0;return n.restart(e,t,r),n}function wK(){z0(),++Sd;for(var e=CD,t;e;)(t=Qp-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Sd}function vK(){Qp=(MD=R0.now())+TD,Sd=L0=0;try{wK()}finally{Sd=0,Zbe(),Qp=0}}function Ybe(){var e=R0.now(),t=e-MD;t>yK&&(TD-=t,MD=e)}function Zbe(){for(var e,t=CD,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:CD=r);P0=e,a3(n)}function a3(e){if(!Sd){L0&&(L0=clearTimeout(L0));var t=e-Qp;t>24?(e<1/0&&(L0=setTimeout(vK,e-R0.now()-TD)),B0&&(B0=clearInterval(B0))):(B0||(MD=R0.now(),B0=setInterval(Ybe,yK)),Sd=1,xK(vK))}}var Sd,L0,B0,yK,CD,P0,MD,Qp,TD,R0,xK,s3=Te(()=>{g();y();v();Sd=0,L0=0,B0=0,yK=1e3,MD=0,Qp=0,TD=0,R0=typeof performance=="object"&&performance.now?performance:Date,xK=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};q0.prototype=OD.prototype={constructor:q0,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?z0():+r)+(t==null?0:+t),!this._next&&P0!==this&&(P0?P0._next=this:CD=this,P0=this),this._call=e,this._time=r,a3()},stop:function(){this._call&&(this._call=null,this._time=1/0,a3())}}});function ID(e,t,r){var n=new q0;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var bK=Te(()=>{g();y();v();s3()});var u3=Te(()=>{g();y();v();s3();bK()});function tc(e,t,r,n,i,o){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;Jbe(e,r,{name:t,index:n,group:i,on:Xbe,tween:Kbe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:EK})}function H0(e,t){var r=Oi(e,t);if(r.state>EK)throw new Error("too late; already scheduled");return r}function io(e,t){var r=Oi(e,t);if(r.state>FD)throw new Error("too late; already running");return r}function Oi(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Jbe(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=OD(o,0,r.time);function o(s){r.state=DK,r.timer.restart(u,r.delay,r.time),r.delay<=s&&u(s-r.delay)}function u(s){var f,p,h,x;if(r.state!==DK)return a();for(f in n)if(x=n[f],x.name===r.name){if(x.state===FD)return ID(u);x.state===NK?(x.state=U0,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete n[f]):+f{g();y();v();YT();u3();Xbe=M0("start","end","cancel","interrupt"),Kbe=[],EK=0,DK=1,_D=2,FD=3,NK=4,kD=5,U0=6});function jp(e,t){var r=e.__transition,n,i,o=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((n=r[u]).name!==t){o=!1;continue}i=n.state>_D&&n.state{g();y();v();Qo()});function SK(e){return this.each(function(){jp(this,e)})}var AK=Te(()=>{g();y();v();l3()});function Qbe(e,t){var r,n;return function(){var i=io(this,e),o=i.tween;if(o!==r){n=r=o;for(var u=0,l=n.length;u{g();y();v();Qo()});function BD(e,t){var r;return(typeof t=="number"?Hi:t instanceof as?Zf:(r=as(t))?(t=r,Zf):pd)(e,t)}var f3=Te(()=>{g();y();v();Js();Ml()});function e2e(e){return function(){this.removeAttribute(e)}}function t2e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function r2e(e,t,r){var n,i=r+"",o;return function(){var u=this.getAttribute(e);return u===i?null:u===n?o:o=t(n=u,r)}}function n2e(e,t,r){var n,i=r+"",o;return function(){var u=this.getAttributeNS(e.space,e.local);return u===i?null:u===n?o:o=t(n=u,r)}}function i2e(e,t,r){var n,i,o;return function(){var u,l=r(this),a;return l==null?void this.removeAttribute(e):(u=this.getAttribute(e),a=l+"",u===a?null:u===n&&a===i?o:(i=a,o=t(n=u,l)))}}function o2e(e,t,r){var n,i,o;return function(){var u,l=r(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),a=l+"",u===a?null:u===n&&a===i?o:(i=a,o=t(n=u,l)))}}function MK(e,t){var r=qu(e),n=r==="transform"?z2:BD;return this.attrTween(e,typeof t=="function"?(r.local?o2e:i2e)(r,n,Ad(this,"attr."+e,t)):t==null?(r.local?t2e:e2e)(r):(r.local?n2e:r2e)(r,n,t))}var TK=Te(()=>{g();y();v();Ml();ti();$0();f3()});function a2e(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function s2e(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function u2e(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&s2e(e,o)),r}return i._value=t,i}function l2e(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&a2e(e,o)),r}return i._value=t,i}function OK(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=qu(e);return this.tween(r,(n.local?u2e:l2e)(n,t))}var IK=Te(()=>{g();y();v();ti()});function f2e(e,t){return function(){H0(this,e).delay=+t.apply(this,arguments)}}function c2e(e,t){return t=+t,function(){H0(this,e).delay=t}}function FK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?f2e:c2e)(t,e)):Oi(this.node(),t).delay}var _K=Te(()=>{g();y();v();Qo()});function p2e(e,t){return function(){io(this,e).duration=+t.apply(this,arguments)}}function m2e(e,t){return t=+t,function(){io(this,e).duration=t}}function kK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?p2e:m2e)(t,e)):Oi(this.node(),t).duration}var BK=Te(()=>{g();y();v();Qo()});function h2e(e,t){if(typeof t!="function")throw new Error;return function(){io(this,e).ease=t}}function LK(e){var t=this._id;return arguments.length?this.each(h2e(t,e)):Oi(this.node(),t).ease}var PK=Te(()=>{g();y();v();Qo()});function d2e(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;io(this,e).ease=r}}function RK(e){if(typeof e!="function")throw new Error;return this.each(d2e(this._id,e))}var qK=Te(()=>{g();y();v();Qo()});function zK(e){typeof e!="function"&&(e=Nd(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{g();y();v();ti();em()});function HK(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,o=Math.min(n,i),u=new Array(n),l=0;l{g();y();v();em()});function g2e(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function v2e(e,t,r){var n,i,o=g2e(t)?H0:io;return function(){var u=o(this,e),l=u.on;l!==n&&(i=(n=l).copy()).on(t,r),u.on=i}}function WK(e,t){var r=this._id;return arguments.length<2?Oi(this.node(),r).on.on(e):this.each(v2e(r,e,t))}var VK=Te(()=>{g();y();v();Qo()});function y2e(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function GK(){return this.on("end.remove",y2e(this._id))}var YK=Te(()=>{g();y();v()});function ZK(e){var t=this._name,r=this._id;typeof e!="function"&&(e=ec(e));for(var n=this._groups,i=n.length,o=new Array(i),u=0;u{g();y();v();ti();em();Qo()});function KK(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Dd(e));for(var n=this._groups,i=n.length,o=[],u=[],l=0;l{g();y();v();ti();em();Qo()});function QK(){return new x2e(this._groups,this._parents)}var x2e,jK=Te(()=>{g();y();v();ti();x2e=zu.prototype.constructor});function w2e(e,t){var r,n,i;return function(){var o=Bl(this,e),u=(this.style.removeProperty(e),Bl(this,e));return o===u?null:o===r&&u===n?i:i=t(r=o,n=u)}}function eJ(e){return function(){this.style.removeProperty(e)}}function b2e(e,t,r){var n,i=r+"",o;return function(){var u=Bl(this,e);return u===i?null:u===n?o:o=t(n=u,r)}}function D2e(e,t,r){var n,i,o;return function(){var u=Bl(this,e),l=r(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Bl(this,e))),u===a?null:u===n&&a===i?o:(i=a,o=t(n=u,l))}}function N2e(e,t){var r,n,i,o="style."+t,u="end."+o,l;return function(){var a=io(this,e),s=a.on,f=a.value[o]==null?l||(l=eJ(t)):void 0;(s!==r||i!==f)&&(n=(r=s).copy()).on(u,i=f),a.on=n}}function tJ(e,t,r){var n=(e+="")=="transform"?q2:BD;return t==null?this.styleTween(e,w2e(e,n)).on("end.style."+e,eJ(e)):typeof t=="function"?this.styleTween(e,D2e(e,n,Ad(this,"style."+e,t))).each(N2e(this._id,e)):this.styleTween(e,b2e(e,n,t),r).on("end.style."+e,null)}var rJ=Te(()=>{g();y();v();Ml();ti();Qo();$0();f3()});function E2e(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function S2e(e,t,r){var n,i;function o(){var u=t.apply(this,arguments);return u!==i&&(n=(i=u)&&E2e(e,u,r)),n}return o._value=t,o}function nJ(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,S2e(e,t,r??""))}var iJ=Te(()=>{g();y();v()});function A2e(e){return function(){this.textContent=e}}function C2e(e){return function(){var t=e(this);this.textContent=t??""}}function oJ(e){return this.tween("text",typeof e=="function"?C2e(Ad(this,"text",e)):A2e(e==null?"":e+""))}var aJ=Te(()=>{g();y();v();$0()});function M2e(e){return function(t){this.textContent=e.call(this,t)}}function T2e(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&M2e(i)),t}return n._value=e,n}function sJ(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,T2e(e))}var uJ=Te(()=>{g();y();v()});function lJ(){for(var e=this._name,t=this._id,r=LD(),n=this._groups,i=n.length,o=0;o{g();y();v();em();Qo()});function cJ(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(o,u){var l={value:u},a={value:function(){--i===0&&o()}};r.each(function(){var s=io(this,n),f=s.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),s.on=t}),i===0&&o()})}var pJ=Te(()=>{g();y();v();Qo()});function Lo(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function mJ(e){return zu().transition(e)}function LD(){return++O2e}var O2e,Ll,em=Te(()=>{g();y();v();ti();TK();IK();_K();BK();PK();qK();UK();$K();VK();YK();XK();JK();jK();rJ();iJ();aJ();uJ();fJ();$0();pJ();O2e=0;Ll=zu.prototype;Lo.prototype=mJ.prototype={constructor:Lo,select:ZK,selectAll:KK,selectChild:Ll.selectChild,selectChildren:Ll.selectChildren,filter:zK,merge:HK,selection:QK,transition:lJ,call:Ll.call,nodes:Ll.nodes,node:Ll.node,size:Ll.size,empty:Ll.empty,each:Ll.each,on:WK,attr:MK,attrTween:OK,style:tJ,styleTween:nJ,text:oJ,textTween:sJ,remove:GK,tween:CK,delay:FK,duration:kK,ease:LK,easeVarying:RK,end:cJ,[Symbol.iterator]:Ll[Symbol.iterator]}});function PD(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var hJ=Te(()=>{g();y();v()});var dJ=Te(()=>{g();y();v();hJ()});function F2e(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function gJ(e){var t,r;e instanceof Lo?(t=e._id,e=e._name):(t=LD(),(r=I2e).time=z0(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,o=0;o{g();y();v();em();Qo();dJ();u3();I2e={time:null,delay:0,duration:250,ease:PD}});var yJ=Te(()=>{g();y();v();ti();AK();vJ();zu.prototype.interrupt=SK;zu.prototype.transition=gJ});var xJ=Te(()=>{g();y();v();yJ();l3()});var W0,wJ=Te(()=>{g();y();v();W0=e=>()=>e});function c3(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}var bJ=Te(()=>{g();y();v()});function fs(e,t,r){this.k=e,this.x=t,this.y=r}function RD(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Cd;return e.__zoom}var Cd,p3=Te(()=>{g();y();v();fs.prototype={constructor:fs,scale:function(e){return e===1?this:new fs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fs(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Cd=new fs(1,0,0);RD.prototype=fs.prototype});function qD(e){e.stopImmediatePropagation()}function Md(e){e.preventDefault(),e.stopImmediatePropagation()}var DJ=Te(()=>{g();y();v()});function _2e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function k2e(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function NJ(){return this.__zoom||Cd}function B2e(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function L2e(){return navigator.maxTouchPoints||"ontouchstart"in this}function P2e(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],o=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}function EJ(){var e=_2e,t=k2e,r=P2e,n=B2e,i=L2e,o=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],l=250,a=U2,s=M0("start","zoom","end"),f,p,h,x=500,b=150,w=0,A=10;function E(ee){ee.property("__zoom",NJ).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",U).filter(i).on("touchstart.zoom",H).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(ee,ie,Y,Z){var le=ee.selection?ee.selection():ee;le.property("__zoom",NJ),ee!==le?F(ee,ie,Y,Z):le.interrupt().each(function(){C(this,arguments).event(Z).start().zoom(null,typeof ie=="function"?ie.apply(this,arguments):ie).end()})},E.scaleBy=function(ee,ie,Y,Z){E.scaleTo(ee,function(){var le=this.__zoom.k,re=typeof ie=="function"?ie.apply(this,arguments):ie;return le*re},Y,Z)},E.scaleTo=function(ee,ie,Y,Z){E.transform(ee,function(){var le=t.apply(this,arguments),re=this.__zoom,he=Y==null?I(le):typeof Y=="function"?Y.apply(this,arguments):Y,De=re.invert(he),we=typeof ie=="function"?ie.apply(this,arguments):ie;return r(M(O(re,we),he,De),le,u)},Y,Z)},E.translateBy=function(ee,ie,Y,Z){E.transform(ee,function(){return r(this.__zoom.translate(typeof ie=="function"?ie.apply(this,arguments):ie,typeof Y=="function"?Y.apply(this,arguments):Y),t.apply(this,arguments),u)},null,Z)},E.translateTo=function(ee,ie,Y,Z,le){E.transform(ee,function(){var re=t.apply(this,arguments),he=this.__zoom,De=Z==null?I(re):typeof Z=="function"?Z.apply(this,arguments):Z;return r(Cd.translate(De[0],De[1]).scale(he.k).translate(typeof ie=="function"?-ie.apply(this,arguments):-ie,typeof Y=="function"?-Y.apply(this,arguments):-Y),re,u)},Z,le)};function O(ee,ie){return ie=Math.max(o[0],Math.min(o[1],ie)),ie===ee.k?ee:new fs(ie,ee.x,ee.y)}function M(ee,ie,Y){var Z=ie[0]-Y[0]*ee.k,le=ie[1]-Y[1]*ee.k;return Z===ee.x&&le===ee.y?ee:new fs(ee.k,Z,le)}function I(ee){return[(+ee[0][0]+ +ee[1][0])/2,(+ee[0][1]+ +ee[1][1])/2]}function F(ee,ie,Y,Z){ee.on("start.zoom",function(){C(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(Z).end()}).tween("zoom",function(){var le=this,re=arguments,he=C(le,re).event(Z),De=t.apply(le,re),we=Y==null?I(De):typeof Y=="function"?Y.apply(le,re):Y,ce=Math.max(De[1][0]-De[0][0],De[1][1]-De[0][1]),Ee=le.__zoom,Pe=typeof ie=="function"?ie.apply(le,re):ie,Ce=a(Ee.invert(we).concat(ce/Ee.k),Pe.invert(we).concat(ce/Pe.k));return function(Oe){if(Oe===1)Oe=Pe;else{var He=Ce(Oe),Se=ce/He[2];Oe=new fs(Se,we[0]-He[0]*Se,we[1]-He[1]*Se)}he.zoom(null,Oe)}})}function C(ee,ie,Y){return!Y&&ee.__zooming||new P(ee,ie)}function P(ee,ie){this.that=ee,this.args=ie,this.active=0,this.sourceEvent=null,this.extent=t.apply(ee,ie),this.taps=0}P.prototype={event:function(ee){return ee&&(this.sourceEvent=ee),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(ee,ie){return this.mouse&&ee!=="mouse"&&(this.mouse[1]=ie.invert(this.mouse[0])),this.touch0&&ee!=="touch"&&(this.touch0[1]=ie.invert(this.touch0[0])),this.touch1&&ee!=="touch"&&(this.touch1[1]=ie.invert(this.touch1[0])),this.that.__zoom=ie,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(ee){var ie=Ma(this.that).datum();s.call(ee,this.that,new c3(ee,{sourceEvent:this.sourceEvent,target:E,type:ee,transform:this.that.__zoom,dispatch:s}),ie)}};function R(ee,...ie){if(!e.apply(this,arguments))return;var Y=C(this,ie).event(ee),Z=this.__zoom,le=Math.max(o[0],Math.min(o[1],Z.k*Math.pow(2,n.apply(this,arguments)))),re=ls(ee);if(Y.wheel)(Y.mouse[0][0]!==re[0]||Y.mouse[0][1]!==re[1])&&(Y.mouse[1]=Z.invert(Y.mouse[0]=re)),clearTimeout(Y.wheel);else{if(Z.k===le)return;Y.mouse=[re,Z.invert(re)],jp(this),Y.start()}Md(ee),Y.wheel=setTimeout(he,b),Y.zoom("mouse",r(M(O(Z,le),Y.mouse[0],Y.mouse[1]),Y.extent,u));function he(){Y.wheel=null,Y.end()}}function q(ee,...ie){if(h||!e.apply(this,arguments))return;var Y=ee.currentTarget,Z=C(this,ie,!0).event(ee),le=Ma(ee.view).on("mousemove.zoom",we,!0).on("mouseup.zoom",ce,!0),re=ls(ee,Y),he=ee.clientX,De=ee.clientY;i3(ee.view),qD(ee),Z.mouse=[re,this.__zoom.invert(re)],jp(this),Z.start();function we(Ee){if(Md(Ee),!Z.moved){var Pe=Ee.clientX-he,Ce=Ee.clientY-De;Z.moved=Pe*Pe+Ce*Ce>w}Z.event(Ee).zoom("mouse",r(M(Z.that.__zoom,Z.mouse[0]=ls(Ee,Y),Z.mouse[1]),Z.extent,u))}function ce(Ee){le.on("mousemove.zoom mouseup.zoom",null),o3(Ee.view,Z.moved),Md(Ee),Z.event(Ee).end()}}function U(ee,...ie){if(e.apply(this,arguments)){var Y=this.__zoom,Z=ls(ee.changedTouches?ee.changedTouches[0]:ee,this),le=Y.invert(Z),re=Y.k*(ee.shiftKey?.5:2),he=r(M(O(Y,re),Z,le),t.apply(this,ie),u);Md(ee),l>0?Ma(this).transition().duration(l).call(F,he,Z,ee):Ma(this).call(E.transform,he,Z,ee)}}function H(ee,...ie){if(e.apply(this,arguments)){var Y=ee.touches,Z=Y.length,le=C(this,ie,ee.changedTouches.length===Z).event(ee),re,he,De,we;for(qD(ee),he=0;he{g();y();v();YT();gK();Ml();ti();xJ();wJ();bJ();p3();DJ()});var AJ={};qa(AJ,{ZoomTransform:()=>fs,zoom:()=>EJ,zoomIdentity:()=>Cd,zoomTransform:()=>RD});var CJ=Te(()=>{g();y();v();SJ();p3()});function an(){an.init.call(this)}function zD(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function PJ(e){return e._maxListeners===void 0?an.defaultMaxListeners:e._maxListeners}function IJ(e,t,r,n){var i,o,u,l;if(zD(r),(o=e._events)===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),u=o[t]),u===void 0)u=o[t]=r,++e._eventsCount;else if(typeof u=="function"?u=o[t]=n?[r,u]:[u,r]:n?u.unshift(r):u.push(r),(i=PJ(e))>0&&u.length>i&&!u.warned){u.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=u.length,l=a,console&&console.warn&&console.warn(l)}return e}function R2e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function FJ(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=R2e.bind(n);return i.listener=r,n.wrapFn=i,i}function _J(e,t,r){var n=e._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?function(o){for(var u=new Array(o.length),l=0;l{g();y();v();Td=typeof Reflect=="object"?Reflect:null,MJ=Td&&typeof Td.apply=="function"?Td.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};LJ=Td&&typeof Td.ownKeys=="function"?Td.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};TJ=Number.isNaN||function(e){return e!=e};BJ=an,an.EventEmitter=an,an.prototype._events=void 0,an.prototype._eventsCount=0,an.prototype._maxListeners=void 0;OJ=10;Object.defineProperty(an,"defaultMaxListeners",{enumerable:!0,get:function(){return OJ},set:function(e){if(typeof e!="number"||e<0||TJ(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");OJ=e}}),an.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},an.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||TJ(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},an.prototype.getMaxListeners=function(){return PJ(this)},an.prototype.emit=function(e){for(var t=[],r=1;r0&&(o=t[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw u.context=o,u}var l=i[e];if(l===void 0)return!1;if(typeof l=="function")MJ(l,this,t);else{var a=l.length,s=RJ(l,a);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){u=r[o].listener,i=o;break}if(i<0)return this;i===0?r.shift():function(l,a){for(;a+1=0;n--)this.removeListener(e,t[n]);return this},an.prototype.listeners=function(e){return _J(this,e,!0)},an.prototype.rawListeners=function(e){return _J(this,e,!1)},an.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):kJ.call(e,t)},an.prototype.listenerCount=kJ,an.prototype.eventNames=function(){return this._eventsCount>0?LJ(this._events):[]};jo=BJ;jo.EventEmitter;jo.defaultMaxListeners;jo.init;jo.listenerCount;jo.EventEmitter;jo.defaultMaxListeners;jo.init;jo.listenerCount});var qJ={};qa(qJ,{EventEmitter:()=>q2e,default:()=>jo,defaultMaxListeners:()=>z2e,init:()=>U2e,listenerCount:()=>H2e,on:()=>$2e,once:()=>W2e});var q2e,z2e,U2e,H2e,$2e,W2e,zJ=Te(()=>{g();y();v();m3();m3();jo.once=function(e,t){return new Promise((r,n)=>{function i(...u){o!==void 0&&e.removeListener("error",o),r(u)}let o;t!=="error"&&(o=u=>{e.removeListener(name,i),n(u)},e.once("error",o)),e.once(t,i)})};jo.on=function(e,t){let r=[],n=[],i=null,o=!1,u={async next(){let s=r.shift();if(s)return createIterResult(s,!1);if(i){let f=Promise.reject(i);return i=null,f}return o?createIterResult(void 0,!0):new Promise((f,p)=>n.push({resolve:f,reject:p}))},async return(){e.removeListener(t,l),e.removeListener("error",a),o=!0;for(let s of n)s.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(s){i=s,e.removeListener(t,l),e.removeListener("error",a)},[Symbol.asyncIterator](){return this}};return e.on(t,l),e.on("error",a),u;function l(...s){let f=n.shift();f?f.resolve(createIterResult(s,!1)):r.push(s)}function a(s){o=!0;let f=n.shift();f?f.reject(s):i=s,u.return()}};({EventEmitter:q2e,defaultMaxListeners:z2e,init:U2e,listenerCount:H2e,on:$2e,once:W2e}=jo)});var UJ=vt(h3=>{"use strict";g();y();v();Object.defineProperty(h3,"__esModule",{value:!0});var V2e=(e0(),Cn(jv)),G2e=(ti(),Cn(Qs));function Y2e(e){let t=e.owner.meta.xScale,r=e.owner.meta.yScale,n=(0,V2e.line)().x(function(i){return i[0]}).y(function(i){return i[1]});return function(i){i.each(function(){let u=(0,G2e.select)(this).selectAll("g.annotations").data(function(h){return h.annotations||[]}),l=u.enter().append("g").attr("class","annotations"),a=r.range(),s=t.range(),f=u.merge(l).selectAll("path").data(function(h){return"x"in h?[[[0,a[0]],[0,a[1]]]]:[[[s[0],0],[s[1],0]]]});f.enter().append("path").attr("stroke","#eee").attr("d",n),f.exit().remove();let p=u.merge(l).selectAll("text").data(function(h){return[{text:h.text||"",hasX:"x"in h}]});p.enter().append("text").attr("y",function(h){return h.hasX?3:0}).attr("x",function(h){return h.hasX?0:3}).attr("dy",function(h){return h.hasX?5:-5}).attr("text-anchor",function(h){return h.hasX?"end":""}).attr("transform",function(h){return h.hasX?"rotate(-90)":""}).text(function(h){return h.text}),p.exit().remove(),u.merge(l).attr("transform",function(h){return"x"in h?"translate("+t(h.x)+", 0)":"translate(0, "+r(h.y)+")"}),u.exit().remove()})}}h3.default=Y2e});var Od=vt(G0=>{"use strict";g();y();v();Object.defineProperty(G0,"__esModule",{value:!0});G0.registerGraphType=void 0;var Z2e=(Js(),Cn(T2)),V0={COLORS:["steelblue","red","#05b378","orange","#4040e8","yellow","brown","magenta","cyan"].map(function(e){return(0,Z2e.hsl)(e)}),DEFAULT_WIDTH:550,DEFAULT_HEIGHT:350,DEFAULT_ITERATIONS:null,TIP_X_EPS:1,MAX_ITERATIONS:0,graphTypes:{}};V0.MAX_ITERATIONS=V0.DEFAULT_WIDTH*10;function X2e(e,t){if(Object.hasOwn(V0.graphTypes,e))throw new Error(`registerGraphType: graphType ${e} is already registered.`);V0.graphTypes[e]=t}G0.registerGraphType=X2e;G0.default=V0});var Uu=vt(Y0=>{"use strict";g();y();v();var K2e=Y0&&Y0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Y0,"__esModule",{value:!0});var HJ=K2e(Od()),J2e={linspace:function(e,t,r){let n=(t-e)/(r-1);return Array.from({length:r},(i,o)=>e+n*o)},logspace:function(e,t,r){return this.linspace(e,t,r).map(n=>Math.pow(10,n))},isValidNumber:function(e){return typeof e=="number"&&!isNaN(e)},space:function(e,t,r){let n=t[0],i=t[1];return e.type==="log"?this.logspace(Math.log10(n),Math.log10(i),r):this.linspace(n,i,r)},getterSetter:function(e,t){let r=this;this[t]=function(n){return arguments.length?(e[t]=n,r):e[t]}},sgn:function(e){return e<0?-1:e>0?1:0},clamp:function(e,t,r){return er?r:e},color:function(e,t){let r=t%HJ.default.COLORS.length;return e.color||HJ.default.COLORS[r].hex()},infinity:function(){return 9007199254740991}};Y0.default=J2e});var d3=vt((Fvr,$J)=>{g();y();v();$J.exports={EOF:0,DELIMITER:1,NUMBER:2,STRING:3,SYMBOL:4}});var v3=vt((Lvr,VJ)=>{g();y();v();var tm=d3(),Q2e={n:` -`,f:"\f",r:"\r",t:" ",v:"\v","'":"'",'"':'"'},j2e={",":!0,"(":!0,")":!0,"[":!0,"]":!0,";":!0,"~":!0,"!":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0,"^":!0,"**":!0,"|":!0,"&":!0,"^|":!0,"=":!0,":":!0,"?":!0,"||":!0,"&&":!0,xor:!0,"==":!0,"!=":!0,"===":!0,"!==":!0,"<":!0,">":!0,">=":!0,"<=":!0,">>>":!0,"<<":!0,">>":!0};function Pl(e){return e>="0"&&e<="9"}function WJ(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"}function eDe(e){return e===" "||e==="\r"||e===" "||e===` -`||e==="\v"||e==="\xA0"}function g3(e){return j2e[e]}function tDe(e){return e==="'"||e==='"'}function rc(){}rc.prototype.throwError=function(e,t){t=typeof t>"u"?this.index:t;var r=new Error(e+" at index "+t);throw r.index=t,r.description=e,r};rc.prototype.lex=function(e){for(this.text=e,this.index=0,this.tokens=[];this.index=this.text.length))return this.text.charAt(this.index+e)};rc.prototype.consume=function(){var e=this.peek();return this.index+=1,e};rc.prototype.readNumber=function(){var e="";if(this.peek()===".")e+=this.consume(),Pl(this.peek())||this.throwError("number expected");else{for(;Pl(this.peek());)e+=this.consume();this.peek()==="."&&(e+=this.consume())}for(;Pl(this.peek());)e+=this.consume();if(this.peek()==="e"||this.peek()==="E")for(e+=this.consume(),Pl(this.peek())||this.peek()==="+"||this.peek()==="-"||this.throwError(),(this.peek()==="+"||this.peek()==="-")&&(e+=this.consume()),Pl(this.peek())||this.throwError("number expected");Pl(this.peek());)e+=this.consume();return e};rc.prototype.readIdentifier=function(){for(var e="";WJ(this.peek())||Pl(this.peek());)e+=this.consume();return e};rc.prototype.readString=function(){for(var e=this.consume(),t="",r;;){var n=this.consume();if(n||this.throwError("string is not closed"),r){if(n==="u"){var i=this.text.substring(this.index+1,this.index+5);i.match(/[\da-f]{4}/i)||this.throwError("invalid unicode escape"),this.index+=4,t+=String.fromCharCode(parseInt(i,16))}else{var o=Q2e[n];o?t+=o:t+=n}r=!1}else{if(n===e)break;n==="\\"?r=!0:t+=n}}return t};VJ.exports=rc});var js=vt((zvr,YJ)=>{g();y();v();function GJ(){}GJ.prototype.type="Node";YJ.exports=GJ});var x3=vt((Wvr,ZJ)=>{g();y();v();var rDe=js(),nDe={number:!0,string:!0,boolean:!0,undefined:!0,null:!0};function y3(e,t){if(!nDe[t])throw Error("unsupported type '"+t+"'");this.value=e,this.valueType=t}y3.prototype=Object.create(rDe.prototype);y3.prototype.type="ConstantNode";ZJ.exports=y3});var b3=vt((Zvr,XJ)=>{g();y();v();var iDe=js();function w3(e,t){this.op=e,this.args=t||[]}w3.prototype=Object.create(iDe.prototype);w3.prototype.type="OperatorNode";XJ.exports=w3});var N3=vt((Qvr,KJ)=>{g();y();v();var oDe=js();function D3(e,t){this.op=e,this.argument=t}D3.prototype=Object.create(oDe.prototype);D3.prototype.type="UnaryNode";KJ.exports=D3});var S3=vt((r0r,JJ)=>{g();y();v();var aDe=js();function E3(e){this.name=e}E3.prototype=Object.create(aDe.prototype);E3.prototype.type="SymbolNode";JJ.exports=E3});var C3=vt((a0r,QJ)=>{g();y();v();var sDe=js();function A3(e,t){this.name=e,this.args=t}A3.prototype=Object.create(sDe.prototype);A3.prototype.type="FunctionNode";QJ.exports=A3});var T3=vt((f0r,jJ)=>{g();y();v();var uDe=js();function M3(e){this.nodes=e}M3.prototype=Object.create(uDe.prototype);M3.prototype.type="ArrayNode";jJ.exports=M3});var I3=vt((h0r,eQ)=>{g();y();v();var lDe=js();function O3(e,t,r){this.condition=e,this.trueExpr=t,this.falseExpr=r}O3.prototype=Object.create(lDe.prototype);O3.prototype.type="ConditionalNode";eQ.exports=O3});var _3=vt((y0r,tQ)=>{g();y();v();var fDe=js();function F3(e,t){this.name=e,this.expr=t}F3.prototype=Object.create(fDe.prototype);F3.prototype.type="AssignmentNode";tQ.exports=F3});var B3=vt((D0r,rQ)=>{g();y();v();var cDe=js();function k3(e){this.blocks=e}k3.prototype=Object.create(cDe.prototype);k3.prototype.type="BlockNode";rQ.exports=k3});var oQ=vt((A0r,iQ)=>{g();y();v();var rm=d3(),pDe=v3(),L3=x3(),Ta=b3(),mDe=N3(),nQ=S3(),hDe=C3(),dDe=T3(),gDe=I3(),vDe=_3(),yDe=B3();function Vr(){this.lexer=new pDe,this.tokens=null}Vr.prototype.current=function(){return this.tokens[0]};Vr.prototype.next=function(){return this.tokens[1]};Vr.prototype.peek=function(){if(this.tokens.length){for(var e=this.tokens[0],t=0;t=","<=",">","<")){var t=this.consume(),r=this.shift();return new Ta(t.value,[e,r])}return e};Vr.prototype.shift=function(){var e=this.additive();if(this.peek(">>","<<",">>>")){var t=this.consume(),r=this.shift();return new Ta(t.value,[e,r])}return e};Vr.prototype.additive=function(){for(var e=this.multiplicative();this.peek("+","-");){var t=this.consume();e=new Ta(t.value,[e,this.multiplicative()])}return e};Vr.prototype.multiplicative=function(){for(var e,t,r=this.unary();this.peek("*","/","%");)e=this.consume(),r=new Ta(e.value,[r,this.unary()]);return this.current().type===rm.SYMBOL||this.peek("(")||!(r.type instanceof L3)&&this.current().type===rm.NUMBER?(t=this.multiplicative(),new Ta("*",[r,t])):r};Vr.prototype.unary=function(){if(this.peek("-","+","~")){var e=this.consume(),t=this.unary();return new mDe(e.value,t)}return this.pow()};Vr.prototype.pow=function(){var e=this.factorial();if(this.peek("^","**")){var t=this.consume(),r=this.unary();return new Ta(t.value,[e,r])}return e};Vr.prototype.factorial=function(){var e=this.symbol();if(this.peek("!")){var t=this.consume();return new Ta(t.value,[e])}return e};Vr.prototype.symbol=function(){var e=this.current();if(e.type===rm.SYMBOL){var t=this.consume(),r=this.functionCall(t);return r}return this.string()};Vr.prototype.functionCall=function(e){var t=e.value;if(this.peek("(")){this.consume();for(var r=[];!this.peek(")")&&!this.isEOF();)r.push(this.assignment()),this.peek(",")&&this.consume();return this.expect(")"),new hDe(t,r)}return new nQ(t)};Vr.prototype.string=function(){return this.current().type===rm.STRING?new L3(this.consume().value,"string"):this.array()};Vr.prototype.array=function(){if(this.peek("[")){this.consume();for(var e=[];!this.peek("]")&&!this.isEOF();)e.push(this.assignment()),this.peek(",")&&this.consume();return this.expect("]"),new dDe(e)}return this.number()};Vr.prototype.number=function(){var e=this.current();return e.type===rm.NUMBER?new L3(this.consume().value,"number"):this.parentheses()};Vr.prototype.parentheses=function(){var e=this.current();if(e.value==="("){this.consume();var t=this.assignment();return this.expect(")"),t}return this.end()};Vr.prototype.end=function(){var e=this.current();if(e.type!==rm.EOF)throw Error("unexpected end of expression")};iQ.exports=Vr});var sQ=vt((O0r,aQ)=>{g();y();v();aQ.exports={ArrayNode:T3(),AssignmentNode:_3(),BlockNode:B3(),ConditionalNode:I3(),ConstantNode:x3(),FunctionNode:C3(),Node:js(),OperatorNode:b3(),SymbolNode:S3(),UnaryNode:N3()}});var Z0=vt((k0r,UD)=>{"use strict";g();y();v();UD.exports.Lexer=v3();UD.exports.Parser=oQ();UD.exports.nodeTypes=sQ()});var X0=vt((R0r,dQ)=>{"use strict";g();y();v();var HD=Object.prototype.hasOwnProperty,hQ=Object.prototype.toString,uQ=Object.defineProperty,lQ=Object.getOwnPropertyDescriptor,fQ=function(t){return typeof Array.isArray=="function"?Array.isArray(t):hQ.call(t)==="[object Array]"},cQ=function(t){if(!t||hQ.call(t)!=="[object Object]")return!1;var r=HD.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&HD.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||HD.call(t,i)},pQ=function(t,r){uQ&&r.name==="__proto__"?uQ(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},mQ=function(t,r){if(r==="__proto__")if(HD.call(t,r)){if(lQ)return lQ(t,r).value}else return;return t[r]};dQ.exports=function e(){var t,r,n,i,o,u,l=arguments[0],a=1,s=arguments.length,f=!1;for(typeof l=="boolean"&&(f=l,l=arguments[1]||{},a=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});a{"use strict";g();y();v();gQ.exports=function(e){var t=this,r=[];this.rawify(this.options.rawArrayExpressionElements,function(){r=e.nodes.map(function(i){return t.next(i)})});var n="["+r.join(",")+"]";return this.options.raw?n:this.options.factory+"("+n+")"}});var xQ=vt((G0r,yQ)=>{"use strict";g();y();v();yQ.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var bQ=vt((K0r,wQ)=>{"use strict";g();y();v();wQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var NQ=vt((e1r,DQ)=>{"use strict";g();y();v();DQ.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var SQ=vt((i1r,P3)=>{"use strict";g();y();v();var xDe=Z0().nodeTypes.SymbolNode,EQ=function(e){return"$$mathCodegen.functionProxy("+this.next(new xDe(e.name))+', "'+e.name+'")'};P3.exports=function(e){var t=this,r=EQ.call(this,e),n=[];return this.rawify(this.options.rawCallExpressionElements,function(){n=e.args.map(function(i){return t.next(i)})}),r+"("+n.join(", ")+")"};P3.exports.functionProxy=EQ});var CQ=vt((u1r,AQ)=>{"use strict";g();y();v();AQ.exports={"+":"add","-":"sub","*":"mul","/":"div","^":"pow","%":"mod","!":"factorial","|":"bitwiseOR","^|":"bitwiseXOR","&":"bitwiseAND","||":"logicalOR",xor:"logicalXOR","&&":"logicalAND","<":"lessThan",">":"greaterThan","<=":"lessEqualThan",">=":"greaterEqualThan","===":"strictlyEqual","==":"equal","!==":"strictlyNotEqual","!=":"notEqual",">>":"shiftRight","<<":"shiftLeft",">>>":"unsignedRightShift"}});var TQ=vt((p1r,MQ)=>{"use strict";g();y();v();var wDe=CQ();MQ.exports=function(e){if(this.options.raw)return["("+this.next(e.args[0]),e.op,this.next(e.args[1])+")"].join(" ");var t=wDe[e.op];if(!t)throw TypeError("unidentified operator");return this.FunctionNode({name:t,args:e.args})}});var IQ=vt((g1r,OQ)=>{"use strict";g();y();v();OQ.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var _Q=vt((w1r,FQ)=>{"use strict";g();y();v();FQ.exports={"+":"positive","-":"negative","~":"oneComplement"}});var LQ=vt((E1r,BQ)=>{"use strict";g();y();v();var kQ=_Q();BQ.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in kQ))throw new SyntaxError(e.op+" not implemented");var t=kQ[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var qQ=vt((M1r,RQ)=>{"use strict";g();y();v();var PQ=X0(),bDe={ArrayNode:vQ(),AssignmentNode:xQ(),ConditionalNode:bQ(),ConstantNode:NQ(),FunctionNode:SQ(),OperatorNode:TQ(),SymbolNode:IQ(),UnaryNode:LQ()},$D=function(e,t){this.owner=e,this.options=PQ({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1},t)};PQ($D.prototype,bDe);$D.prototype.next=function(e){if(!(e.type in this))throw new TypeError("the node type "+e.type+" is not implemented");return this[e.type](e)};$D.prototype.rawify=function(e,t){var r=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=r)};RQ.exports=$D});var UQ=vt((F1r,zQ)=>{"use strict";g();y();v();var DDe=Z0().Parser,NDe=qQ(),EDe=X0();function WD(e,t){this.statements=[],this.defs=t||{},this.interpreter=new NDe(this,e)}WD.prototype.setDefs=function(e){return this.defs=EDe(this.defs,e),this};WD.prototype.compile=function(e){if(!e||!(typeof e=="object"||typeof e=="function"))throw TypeError("namespace must be an object");if(typeof e.factory!="function")throw TypeError("namespace.factory must be a function");this.defs.ns=e,this.defs.$$mathCodegen={getProperty:function(o,u,l){if(o in u)return u[o];if(o in l)return l[o];throw SyntaxError('symbol "'+o+'" is undefined')},functionProxy:function(o,u){if(typeof o!="function")throw SyntaxError('symbol "'+u+'" must be a function');return o}},this.defs.$$processScope=this.defs.$$processScope||function(){};var t=Object.keys(this.defs).map(function(o){return"var "+o+' = defs["'+o+'"]'});if(!this.statements.length)throw Error("there are no statements saved in this generator, make sure you parse an expression before compiling it");this.statements[this.statements.length-1]="return "+this.statements[this.statements.length-1];var r=this.statements.join(";"),n=t.join(` +`),W=C+H.length,ee=H[H.length-1].length;return{from:t(W,ee),to:t(W+V.length-1,V.length==1?ee+V[0].length:V[V.length-1].length),match:U}}}}var f,p;String.prototype.normalize?(f=function(A){return A.normalize("NFD").toLowerCase()},p=function(A){return A.normalize("NFD")}):(f=function(A){return A.toLowerCase()},p=function(A){return A});function h(A,S,O,M){if(A.length==S.length)return O;for(var I=0,F=O+Math.max(0,A.length-S.length);;){if(I==F)return I;var C=I+F>>1,P=M(A.slice(0,C)).length;if(P==O)return C;P>O?F=C:I=C+1}}function y(A,S,O,M){if(!S.length)return null;var I=M?f:p,F=I(S).split(/\r|\n\r?/);e:for(var C=O.line,P=O.ch,R=A.lastLine()+1-F.length;C<=R;C++,P=0){var q=A.getLine(C).slice(P),U=I(q);if(F.length==1){var H=U.indexOf(F[0]);if(H==-1)continue e;var O=h(q,U,H,I)+P;return{from:t(C,h(q,U,H,I)+P),to:t(C,h(q,U,H+F[0].length,I)+P)}}else{var V=U.length-F[0].length;if(U.slice(V)!=F[0])continue e;for(var W=1;W=R;C--,P=-1){var q=A.getLine(C);P>-1&&(q=q.slice(0,P));var U=I(q);if(F.length==1){var H=U.lastIndexOf(F[0]);if(H==-1)continue e;return{from:t(C,h(q,U,H,I)),to:t(C,h(q,U,H+F[0].length,I))}}else{var V=F[F.length-1];if(U.slice(0,V.length)!=V)continue e;for(var W=1,O=C-F.length+1;W(this.doc.getLine(S.line)||"").length&&(S.ch=0,S.line++)),e.cmpPos(S,this.doc.clipPos(S))!=0))return this.atOccurrence=!1;var O=this.matches(A,S);if(this.afterEmptyMatch=O&&e.cmpPos(O.from,O.to)==0,O)return this.pos=O,this.atOccurrence=!0,this.pos.match||!0;var M=t(A?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:M,to:M},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(A,S){if(this.atOccurrence){var O=e.splitLines(A);this.doc.replaceRange(O,this.pos.from,this.pos.to,S),this.pos.to=t(this.pos.from.line+O.length-1,O[O.length-1].length+(O.length==1?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(A,S,O){return new w(this.doc,A,S,O)}),e.defineDocExtension("getSearchCursor",function(A,S,O){return new w(this,A,S,O)}),e.defineExtension("selectMatches",function(A,S){for(var O=[],M=this.getSearchCursor(A,this.getCursor("from"),S);M.findNext()&&!(e.cmpPos(M.to(),this.getCursor("to"))>0);)O.push({anchor:M.from(),head:M.to()});O.length&&this.setSelections(O,0)})})});var J$=vt((X$,K$)=>{g();x();v();(function(e){typeof X$=="object"&&typeof K$=="object"?e(Us(),kC(),Db()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)})(function(e){"use strict";e.defineOption("search",{bottom:!1});function t(C,P){return typeof C=="string"?C=new RegExp(C.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),P?"gi":"g"):C.global||(C=new RegExp(C.source,C.ignoreCase?"gi":"g")),{token:function(R){C.lastIndex=R.pos;var q=C.exec(R.string);if(q&&q.index==R.pos)return R.pos+=q[0].length||1,"searching";q?R.pos=q.index:R.skipToEnd()}}}function r(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(C){return C.state.search||(C.state.search=new r)}function i(C){return typeof C=="string"&&C==C.toLowerCase()}function o(C,P,R){return C.getSearchCursor(P,R,{caseFold:i(P),multiline:!0})}function u(C,P,R,q,U){C.openDialog(P,q,{value:R,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){b(C)},onKeyDown:U,bottom:C.options.search.bottom})}function l(C,P,R,q,U){C.openDialog?C.openDialog(P,U,{value:q,selectValueOnOpen:!0,bottom:C.options.search.bottom}):U(prompt(R,q))}function a(C,P,R,q){C.openConfirm?C.openConfirm(P,q):confirm(R)&&q[0]()}function s(C){return C.replace(/\\([nrt\\])/g,function(P,R){return R=="n"?` +`:R=="r"?"\r":R=="t"?" ":R=="\\"?"\\":P})}function f(C){var P=C.match(/^\/(.*)\/([a-z]*)$/);if(P)try{C=new RegExp(P[1],P[2].indexOf("i")==-1?"":"i")}catch{}else C=s(C);return(typeof C=="string"?C=="":C.test(""))&&(C=/x^/),C}function p(C,P,R){P.queryText=R,P.query=f(R),C.removeOverlay(P.overlay,i(P.query)),P.overlay=t(P.query,i(P.query)),C.addOverlay(P.overlay),C.showMatchesOnScrollbar&&(P.annotate&&(P.annotate.clear(),P.annotate=null),P.annotate=C.showMatchesOnScrollbar(P.query,i(P.query)))}function h(C,P,R,q){var U=n(C);if(U.query)return y(C,P);var H=C.getSelection()||U.lastQuery;if(H instanceof RegExp&&H.source=="x^"&&(H=null),R&&C.openDialog){var V=null,W=function(ee,ie){e.e_stop(ie),ee&&(ee!=U.queryText&&(p(C,U,ee),U.posFrom=U.posTo=C.getCursor()),V&&(V.style.opacity=1),y(C,ie.shiftKey,function(Y,Z){var le;Z.line<3&&document.querySelector&&(le=C.display.wrapper.querySelector(".CodeMirror-dialog"))&&le.getBoundingClientRect().bottom-4>C.cursorCoords(Z,"window").top&&((V=le).style.opacity=.4)}))};u(C,A(C),H,W,function(ee,ie){var Y=e.keyName(ee),Z=C.getOption("extraKeys"),le=Z&&Z[Y]||e.keyMap[C.getOption("keyMap")][Y];le=="findNext"||le=="findPrev"||le=="findPersistentNext"||le=="findPersistentPrev"?(e.e_stop(ee),p(C,n(C),ie),C.execCommand(le)):(le=="find"||le=="findPersistent")&&(e.e_stop(ee),W(ie,ee))}),q&&H&&(p(C,U,H),y(C,P))}else l(C,A(C),"Search for:",H,function(ee){ee&&!U.query&&C.operation(function(){p(C,U,ee),U.posFrom=U.posTo=C.getCursor(),y(C,P)})})}function y(C,P,R){C.operation(function(){var q=n(C),U=o(C,q.query,P?q.posFrom:q.posTo);!U.find(P)&&(U=o(C,q.query,P?e.Pos(C.lastLine()):e.Pos(C.firstLine(),0)),!U.find(P))||(C.setSelection(U.from(),U.to()),C.scrollIntoView({from:U.from(),to:U.to()},20),q.posFrom=U.from(),q.posTo=U.to(),R&&R(U.from(),U.to()))})}function b(C){C.operation(function(){var P=n(C);P.lastQuery=P.query,P.query&&(P.query=P.queryText=null,C.removeOverlay(P.overlay),P.annotate&&(P.annotate.clear(),P.annotate=null))})}function w(C,P){var R=C?document.createElement(C):document.createDocumentFragment();for(var q in P)R[q]=P[q];for(var U=2;U{g();x();v();typeof window<"u"&&function(e,t){try{e.querySelector(":scope body")}catch{["querySelector","querySelectorAll"].forEach(function(n){let i=t[n];t[n]=function(o){if(/(^|,)\s*:scope/.test(o)){let u=this.id;this.id="ID_"+Date.now(),o=o.replace(/((^|,)\s*):scope/g,"$1#"+this.id);let l=e[n](o);return this.id=u,l}else return i.call(this,o)}})}}(window.document,Element.prototype)});function ur(e){return function(){return e}}var Hf=Te(()=>{g();x();v()});function uW(e){return e>1?0:e<-1?$s:Math.acos(e)}function nM(e){return e>=1?Wv:e<=-1?-Wv:Math.asin(e)}var rM,ro,Hs,sW,Ou,wo,Sr,Ui,$s,Wv,ja,no=Te(()=>{g();x();v();rM=Math.abs,ro=Math.atan2,Hs=Math.cos,sW=Math.max,Ou=Math.min,wo=Math.sin,Sr=Math.sqrt,Ui=1e-12,$s=Math.PI,Wv=$s/2,ja=2*$s});function lW(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return lW;let r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;i{g();x();v();iM=Math.PI,oM=2*iM,Op=1e-6,fxe=oM-Op;Ip=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?lW:cxe(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,o,u){this._append`C${+t},${+r},${+n},${+i},${this._x1=+o},${this._y1=+u}`}arcTo(t,r,n,i,o){if(t=+t,r=+r,n=+n,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let u=this._x1,l=this._y1,a=n-t,s=i-r,f=u-t,p=l-r,h=f*f+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Op)if(!(Math.abs(p*a-s*f)>Op)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let y=n-u,b=i-l,w=a*a+s*s,A=y*y+b*b,S=Math.sqrt(w),O=Math.sqrt(h),M=o*Math.tan((iM-Math.acos((w+h-A)/(2*S*O)))/2),I=M/O,F=M/S;Math.abs(I-1)>Op&&this._append`L${t+I*f},${r+I*p}`,this._append`A${o},${o},0,0,${+(p*y>f*b)},${this._x1=t+F*a},${this._y1=r+F*s}`}}arc(t,r,n,i,o,u){if(t=+t,r=+r,n=+n,u=!!u,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),a=n*Math.sin(i),s=t+l,f=r+a,p=1^u,h=u?i-o:o-i;this._x1===null?this._append`M${s},${f}`:(Math.abs(this._x1-s)>Op||Math.abs(this._y1-f)>Op)&&this._append`L${s},${f}`,n&&(h<0&&(h=h%oM+oM),h>fxe?this._append`A${n},${n},0,1,${p},${t-l},${r-a}A${n},${n},0,1,${p},${this._x1=s},${this._y1=f}`:h>Op&&this._append`A${n},${n},0,${+(h>=iM)},${p},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};fW.prototype=Ip.prototype});var pW=Te(()=>{g();x();v();cW()});function Iu(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{let n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Ip(t)}var Wh=Te(()=>{g();x();v();pW()});function pxe(e){return e.innerRadius}function mxe(e){return e.outerRadius}function hxe(e){return e.startAngle}function dxe(e){return e.endAngle}function gxe(e){return e&&e.padAngle}function vxe(e,t,r,n,i,o,u,l){var a=r-e,s=n-t,f=u-i,p=l-o,h=p*a-f*s;if(!(h*hee*ee+ie*ie&&(R=U,q=H),{cx:R,cy:q,x01:-f,y01:-p,x11:R*(i/F-1),y11:q*(i/F-1)}}function mW(){var e=pxe,t=mxe,r=ur(0),n=null,i=hxe,o=dxe,u=gxe,l=null,a=Iu(s);function s(){var f,p,h=+e.apply(this,arguments),y=+t.apply(this,arguments),b=i.apply(this,arguments)-Wv,w=o.apply(this,arguments)-Wv,A=rM(w-b),S=w>b;if(l||(l=f=a()),yUi))l.moveTo(0,0);else if(A>ja-Ui)l.moveTo(y*Hs(b),y*wo(b)),l.arc(0,0,y,b,w,!S),h>Ui&&(l.moveTo(h*Hs(w),h*wo(w)),l.arc(0,0,h,w,b,S));else{var O=b,M=w,I=b,F=w,C=A,P=A,R=u.apply(this,arguments)/2,q=R>Ui&&(n?+n.apply(this,arguments):Sr(h*h+y*y)),U=Ou(rM(y-h)/2,+r.apply(this,arguments)),H=U,V=U,W,ee;if(q>Ui){var ie=nM(q/h*wo(R)),Y=nM(q/y*wo(R));(C-=ie*2)>Ui?(ie*=S?1:-1,I+=ie,F-=ie):(C=0,I=F=(b+w)/2),(P-=Y*2)>Ui?(Y*=S?1:-1,O+=Y,M-=Y):(P=0,O=M=(b+w)/2)}var Z=y*Hs(O),le=y*wo(O),re=h*Hs(F),he=h*wo(F);if(U>Ui){var De=y*Hs(M),we=y*wo(M),ce=h*Hs(I),Se=h*wo(I),Pe;if(A<$s)if(Pe=vxe(Z,le,ce,Se,De,we,re,he)){var Ce=Z-Pe[0],Oe=le-Pe[1],He=De-Pe[0],Ee=we-Pe[1],ze=1/wo(uW((Ce*He+Oe*Ee)/(Sr(Ce*Ce+Oe*Oe)*Sr(He*He+Ee*Ee)))/2),We=Sr(Pe[0]*Pe[0]+Pe[1]*Pe[1]);H=Ou(U,(h-We)/(ze-1)),V=Ou(U,(y-We)/(ze+1))}else H=V=0}P>Ui?V>Ui?(W=Fb(ce,Se,Z,le,y,V,S),ee=Fb(De,we,re,he,y,V,S),l.moveTo(W.cx+W.x01,W.cy+W.y01),VUi)||!(C>Ui)?l.lineTo(re,he):H>Ui?(W=Fb(re,he,De,we,h,-H,S),ee=Fb(Z,le,ce,Se,h,-H,S),l.lineTo(W.cx+W.x01,W.cy+W.y01),H{g();x();v();Hf();no();Wh()});function $f(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}var dW,Vh=Te(()=>{g();x();v();dW=Array.prototype.slice});function gW(e){this._context=e}function Wf(e){return new gW(e)}var Vv=Te(()=>{g();x();v();gW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}}});function Gh(e){return e[0]}function Yh(e){return e[1]}var _b=Te(()=>{g();x();v()});function Zh(e,t){var r=ur(!0),n=null,i=Wf,o=null,u=Iu(l);e=typeof e=="function"?e:e===void 0?Gh:ur(e),t=typeof t=="function"?t:t===void 0?Yh:ur(t);function l(a){var s,f=(a=$f(a)).length,p,h=!1,y;for(n==null&&(o=i(y=u())),s=0;s<=f;++s)!(s{g();x();v();Vh();Hf();Vv();Wh();_b()});function Bb(e,t,r){var n=null,i=ur(!0),o=null,u=Wf,l=null,a=Iu(s);e=typeof e=="function"?e:e===void 0?Gh:ur(+e),t=typeof t=="function"?t:t===void 0?ur(0):ur(+t),r=typeof r=="function"?r:r===void 0?Yh:ur(+r);function s(p){var h,y,b,w=(p=$f(p)).length,A,S=!1,O,M=new Array(w),I=new Array(w);for(o==null&&(l=u(O=a())),h=0;h<=w;++h){if(!(h=y;--b)l.point(M[b],I[b]);l.lineEnd(),l.areaEnd()}S&&(M[h]=+e(A,h,p),I[h]=+t(A,h,p),l.point(n?+n(A,h,p):M[h],r?+r(A,h,p):I[h]))}if(O)return l=null,O+""||null}function f(){return Zh().defined(i).curve(u).context(o)}return s.x=function(p){return arguments.length?(e=typeof p=="function"?p:ur(+p),n=null,s):e},s.x0=function(p){return arguments.length?(e=typeof p=="function"?p:ur(+p),s):e},s.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:ur(+p),s):n},s.y=function(p){return arguments.length?(t=typeof p=="function"?p:ur(+p),r=null,s):t},s.y0=function(p){return arguments.length?(t=typeof p=="function"?p:ur(+p),s):t},s.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:ur(+p),s):r},s.lineX0=s.lineY0=function(){return f().x(e).y(t)},s.lineY1=function(){return f().x(e).y(r)},s.lineX1=function(){return f().x(n).y(t)},s.defined=function(p){return arguments.length?(i=typeof p=="function"?p:ur(!!p),s):i},s.curve=function(p){return arguments.length?(u=p,o!=null&&(l=u(o)),s):u},s.context=function(p){return arguments.length?(p==null?o=l=null:l=u(o=p),s):o},s}var aM=Te(()=>{g();x();v();Vh();Hf();Vv();kb();Wh();_b()});function vW(e,t){return te?1:t>=e?0:NaN}var xW=Te(()=>{g();x();v()});function yW(e){return e}var wW=Te(()=>{g();x();v()});function bW(){var e=yW,t=vW,r=null,n=ur(0),i=ur(ja),o=ur(0);function u(l){var a,s=(l=$f(l)).length,f,p,h=0,y=new Array(s),b=new Array(s),w=+n.apply(this,arguments),A=Math.min(ja,Math.max(-ja,i.apply(this,arguments)-w)),S,O=Math.min(Math.abs(A)/s,o.apply(this,arguments)),M=O*(A<0?-1:1),I;for(a=0;a0&&(h+=I);for(t!=null?y.sort(function(F,C){return t(b[F],b[C])}):r!=null&&y.sort(function(F,C){return r(l[F],l[C])}),a=0,p=h?(A-s*M)/h:0;a0?I*p:0)+M,b[f]={data:l[f],index:a,value:I,startAngle:w,endAngle:S,padAngle:O};return b}return u.value=function(l){return arguments.length?(e=typeof l=="function"?l:ur(+l),u):e},u.sortValues=function(l){return arguments.length?(t=l,r=null,u):t},u.sort=function(l){return arguments.length?(r=l,t=null,u):r},u.startAngle=function(l){return arguments.length?(n=typeof l=="function"?l:ur(+l),u):n},u.endAngle=function(l){return arguments.length?(i=typeof l=="function"?l:ur(+l),u):i},u.padAngle=function(l){return arguments.length?(o=typeof l=="function"?l:ur(+l),u):o},u}var DW=Te(()=>{g();x();v();Vh();Hf();xW();wW();no()});function NW(e){this._curve=e}function Xh(e){function t(r){return new NW(e(r))}return t._curve=e,t}var Lb,sM=Te(()=>{g();x();v();Vv();Lb=Xh(Wf);NW.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}}});function Kh(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(r){return arguments.length?t(Xh(r)):t()._curve},e}function uM(){return Kh(Zh().curve(Lb))}var lM=Te(()=>{g();x();v();sM();kb()});function fM(){var e=Bb().curve(Lb),t=e.curve,r=e.lineX0,n=e.lineX1,i=e.lineY0,o=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return Kh(r())},delete e.lineX0,e.lineEndAngle=function(){return Kh(n())},delete e.lineX1,e.lineInnerRadius=function(){return Kh(i())},delete e.lineY0,e.lineOuterRadius=function(){return Kh(o())},delete e.lineY1,e.curve=function(u){return arguments.length?t(Xh(u)):t()._curve},e}var SW=Te(()=>{g();x();v();sM();aM();lM()});function Fp(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}var cM=Te(()=>{g();x();v()});function Rb(e){return new Pb(e,!0)}function qb(e){return new Pb(e,!1)}function EW(e){return new pM(e)}var Pb,pM,mM=Te(()=>{g();x();v();cM();Pb=class{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}},pM=class{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,r){if(t=+t,r=+r,this._point===0)this._point=1;else{let n=Fp(this._x0,this._y0),i=Fp(this._x0,this._y0=(this._y0+r)/2),o=Fp(t,this._y0),u=Fp(t,r);this._context.moveTo(...n),this._context.bezierCurveTo(...i,...o,...u)}this._x0=t,this._y0=r}}});function xxe(e){return e.source}function yxe(e){return e.target}function Gv(e){let t=xxe,r=yxe,n=Gh,i=Yh,o=null,u=null,l=Iu(a);function a(){let s,f=dW.call(arguments),p=t.apply(this,f),h=r.apply(this,f);if(o==null&&(u=e(s=l())),u.lineStart(),f[0]=p,u.point(+n.apply(this,f),+i.apply(this,f)),f[0]=h,u.point(+n.apply(this,f),+i.apply(this,f)),u.lineEnd(),s)return u=null,s+""||null}return a.source=function(s){return arguments.length?(t=s,a):t},a.target=function(s){return arguments.length?(r=s,a):r},a.x=function(s){return arguments.length?(n=typeof s=="function"?s:ur(+s),a):n},a.y=function(s){return arguments.length?(i=typeof s=="function"?s:ur(+s),a):i},a.context=function(s){return arguments.length?(s==null?o=u=null:u=e(o=s),a):o},a}function AW(){return Gv(Rb)}function CW(){return Gv(qb)}function MW(){let e=Gv(EW);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}var TW=Te(()=>{g();x();v();Vh();Hf();mM();Wh();_b()});var wxe,zb,hM=Te(()=>{g();x();v();no();wxe=Sr(3),zb={draw(e,t){let r=Sr(t+Ou(t/28,.75))*.59436,n=r/2,i=n*wxe;e.moveTo(0,r),e.lineTo(0,-r),e.moveTo(-i,-n),e.lineTo(i,n),e.moveTo(-i,n),e.lineTo(i,-n)}}});var Jh,dM=Te(()=>{g();x();v();no();Jh={draw(e,t){let r=Sr(t/$s);e.moveTo(r,0),e.arc(0,0,r,0,ja)}}});var Ub,gM=Te(()=>{g();x();v();no();Ub={draw(e,t){let r=Sr(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}}});var OW,bxe,Hb,vM=Te(()=>{g();x();v();no();OW=Sr(1/3),bxe=OW*2,Hb={draw(e,t){let r=Sr(t/bxe),n=r*OW;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}}});var $b,xM=Te(()=>{g();x();v();no();$b={draw(e,t){let r=Sr(t)*.62625;e.moveTo(0,-r),e.lineTo(r,0),e.lineTo(0,r),e.lineTo(-r,0),e.closePath()}}});var Wb,yM=Te(()=>{g();x();v();no();Wb={draw(e,t){let r=Sr(t-Ou(t/7,2))*.87559;e.moveTo(-r,0),e.lineTo(r,0),e.moveTo(0,r),e.lineTo(0,-r)}}});var Vb,wM=Te(()=>{g();x();v();no();Vb={draw(e,t){let r=Sr(t),n=-r/2;e.rect(n,n,r,r)}}});var Gb,bM=Te(()=>{g();x();v();no();Gb={draw(e,t){let r=Sr(t)*.4431;e.moveTo(r,r),e.lineTo(r,-r),e.lineTo(-r,-r),e.lineTo(-r,r),e.closePath()}}});var Dxe,IW,Nxe,Sxe,Yb,DM=Te(()=>{g();x();v();no();Dxe=.8908130915292852,IW=wo($s/10)/wo(7*$s/10),Nxe=wo(ja/10)*IW,Sxe=-Hs(ja/10)*IW,Yb={draw(e,t){let r=Sr(t*Dxe),n=Nxe*r,i=Sxe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){let u=ja*o/5,l=Hs(u),a=wo(u);e.lineTo(a*r,-l*r),e.lineTo(l*n-a*i,a*n+l*i)}e.closePath()}}});var NM,Zb,SM=Te(()=>{g();x();v();no();NM=Sr(3),Zb={draw(e,t){let r=-Sr(t/(NM*3));e.moveTo(0,r*2),e.lineTo(-NM*r,-r),e.lineTo(NM*r,-r),e.closePath()}}});var Exe,Xb,EM=Te(()=>{g();x();v();no();Exe=Sr(3),Xb={draw(e,t){let r=Sr(t)*.6824,n=r/2,i=r*Exe/2;e.moveTo(0,-r),e.lineTo(i,n),e.lineTo(-i,n),e.closePath()}}});var es,ts,AM,Axe,Kb,CM=Te(()=>{g();x();v();no();es=-.5,ts=Sr(3)/2,AM=1/Sr(12),Axe=(AM/2+1)*3,Kb={draw(e,t){let r=Sr(t/Axe),n=r/2,i=r*AM,o=n,u=r*AM+r,l=-o,a=u;e.moveTo(n,i),e.lineTo(o,u),e.lineTo(l,a),e.lineTo(es*n-ts*i,ts*n+es*i),e.lineTo(es*o-ts*u,ts*o+es*u),e.lineTo(es*l-ts*a,ts*l+es*a),e.lineTo(es*n+ts*i,es*i-ts*n),e.lineTo(es*o+ts*u,es*u-ts*o),e.lineTo(es*l+ts*a,es*a-ts*l),e.closePath()}}});var Yv,MM=Te(()=>{g();x();v();no();Yv={draw(e,t){let r=Sr(t-Ou(t/6,1.7))*.6189;e.moveTo(-r,-r),e.lineTo(r,r),e.moveTo(-r,r),e.lineTo(r,-r)}}});function OM(e,t){let r=null,n=Iu(i);e=typeof e=="function"?e:ur(e||Jh),t=typeof t=="function"?t:ur(t===void 0?64:+t);function i(){let o;if(r||(r=o=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),o)return r=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:ur(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:ur(+o),i):t},i.context=function(o){return arguments.length?(r=o??null,i):r},i}var TM,FW,_W=Te(()=>{g();x();v();Hf();Wh();hM();dM();gM();vM();xM();yM();wM();bM();DM();SM();EM();CM();MM();TM=[Jh,Ub,Hb,Vb,Yb,Zb,Kb],FW=[Jh,Wb,Yv,Xb,zb,Gb,$b]});function rs(){}var Zv=Te(()=>{g();x();v()});function Qh(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Xv(e){this._context=e}function kW(e){return new Xv(e)}var Kv=Te(()=>{g();x();v();Xv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Qh(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Qh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function BW(e){this._context=e}function LW(e){return new BW(e)}var PW=Te(()=>{g();x();v();Zv();Kv();BW.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Qh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function RW(e){this._context=e}function qW(e){return new RW(e)}var zW=Te(()=>{g();x();v();Kv();RW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Qh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}});function UW(e,t){this._basis=new Xv(e),this._beta=t}var HW,$W=Te(()=>{g();x();v();Kv();UW.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],o=e[r]-n,u=t[r]-i,l=-1,a;++l<=r;)a=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(n+a*o),this._beta*t[l]+(1-this._beta)*(i+a*u));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};HW=function e(t){function r(n){return t===1?new Xv(n):new UW(n,t)}return r.beta=function(n){return e(+n)},r}(.85)});function jh(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Jb(e,t){this._context=e,this._k=(1-t)/6}var WW,Jv=Te(()=>{g();x();v();Jb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:jh(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:jh(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};WW=function e(t){function r(n){return new Jb(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function Qb(e,t){this._context=e,this._k=(1-t)/6}var VW,IM=Te(()=>{g();x();v();Zv();Jv();Qb.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:jh(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};VW=function e(t){function r(n){return new Qb(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function jb(e,t){this._context=e,this._k=(1-t)/6}var GW,FM=Te(()=>{g();x();v();Jv();jb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jh(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};GW=function e(t){function r(n){return new jb(n,t)}return r.tension=function(n){return e(+n)},r}(0)});function Qv(e,t,r){var n=e._x1,i=e._y1,o=e._x2,u=e._y2;if(e._l01_a>Ui){var l=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,a=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*l-e._x0*e._l12_2a+e._x2*e._l01_2a)/a,i=(i*l-e._y0*e._l12_2a+e._y2*e._l01_2a)/a}if(e._l23_a>Ui){var s=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,f=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*s+e._x1*e._l23_2a-t*e._l12_2a)/f,u=(u*s+e._y1*e._l23_2a-r*e._l12_2a)/f}e._context.bezierCurveTo(n,i,o,u,e._x2,e._y2)}function YW(e,t){this._context=e,this._alpha=t}var ZW,e2=Te(()=>{g();x();v();no();Jv();YW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Qv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};ZW=function e(t){function r(n){return t?new YW(n,t):new Jb(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function XW(e,t){this._context=e,this._alpha=t}var KW,JW=Te(()=>{g();x();v();IM();Zv();e2();XW.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Qv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};KW=function e(t){function r(n){return t?new XW(n,t):new Qb(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function QW(e,t){this._context=e,this._alpha=t}var jW,eV=Te(()=>{g();x();v();FM();e2();QW.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Qv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};jW=function e(t){function r(n){return t?new QW(n,t):new jb(n,0)}return r.alpha=function(n){return e(+n)},r}(.5)});function tV(e){this._context=e}function rV(e){return new tV(e)}var nV=Te(()=>{g();x();v();Zv();tV.prototype={areaStart:rs,areaEnd:rs,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}}});function iV(e){return e<0?-1:1}function oV(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),u=(r-e._y1)/(i||n<0&&-0),l=(o*i+u*n)/(n+i);return(iV(o)+iV(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(l))||0}function aV(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function _M(e,t,r){var n=e._x0,i=e._y0,o=e._x1,u=e._y1,l=(o-n)/3;e._context.bezierCurveTo(n+l,i+l*t,o-l,u-l*r,o,u)}function t2(e){this._context=e}function sV(e){this._context=new uV(e)}function uV(e){this._context=e}function lV(e){return new t2(e)}function fV(e){return new sV(e)}var cV=Te(()=>{g();x();v();t2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:_M(this,this._t0,aV(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,_M(this,aV(this,r=oV(this,e,t)),r);break;default:_M(this,this._t0,r=oV(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};(sV.prototype=Object.create(t2.prototype)).point=function(e,t){t2.prototype.point.call(this,t,e)};uV.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}}});function mV(e){this._context=e}function pV(e){var t,r=e.length-1,n,i=new Array(r),o=new Array(r),u=new Array(r);for(i[0]=0,o[0]=2,u[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(u[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t{g();x();v();mV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=pV(e),i=pV(t),o=0,u=1;u{g();x();v();r2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}}});function Ws(e,t){if((u=e.length)>1)for(var r=1,n,i,o=e[t[0]],u,l=o.length;r{g();x();v()});function Vs(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}var td=Te(()=>{g();x();v()});function Cxe(e,t){return e[t]}function Mxe(e){let t=[];return t.key=e,t}function wV(){var e=ur([]),t=Vs,r=Ws,n=Cxe;function i(o){var u=Array.from(e.apply(this,arguments),Mxe),l,a=u.length,s=-1,f;for(let p of o)for(l=0,++s;l{g();x();v();Vh();Hf();ed();td()});function DV(e,t){if((n=e.length)>0){for(var r,n,i=0,o=e[0].length,u;i{g();x();v();ed()});function SV(e,t){if((a=e.length)>0)for(var r,n=0,i,o,u,l,a,s=e[t[0]].length;n0?(i[0]=u,i[1]=u+=o):o<0?(i[1]=l,i[0]=l+=o):(i[0]=0,i[1]=o)}var EV=Te(()=>{g();x();v()});function AV(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,o=n.length;r{g();x();v();ed()});function MV(e,t){if(!(!((u=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,u;n{g();x();v();ed()});function n2(e){var t=e.map(Txe);return Vs(e).sort(function(r,n){return t[r]-t[n]})}function Txe(e){for(var t=-1,r=0,n=e.length,i,o=-1/0;++to&&(o=i,r=t);return r}var kM=Te(()=>{g();x();v();td()});function i2(e){var t=e.map(BM);return Vs(e).sort(function(r,n){return t[r]-t[n]})}function BM(e){for(var t=0,r=-1,n=e.length,i;++r{g();x();v();td()});function OV(e){return i2(e).reverse()}var IV=Te(()=>{g();x();v();o2()});function FV(e){var t=e.length,r,n,i=e.map(BM),o=n2(e),u=0,l=0,a=[],s=[];for(r=0;r{g();x();v();kM();o2()});function kV(e){return Vs(e).reverse()}var BV=Te(()=>{g();x();v();td()});var jv={};qa(jv,{arc:()=>mW,area:()=>Bb,areaRadial:()=>fM,curveBasis:()=>kW,curveBasisClosed:()=>LW,curveBasisOpen:()=>qW,curveBumpX:()=>Rb,curveBumpY:()=>qb,curveBundle:()=>HW,curveCardinal:()=>WW,curveCardinalClosed:()=>VW,curveCardinalOpen:()=>GW,curveCatmullRom:()=>ZW,curveCatmullRomClosed:()=>KW,curveCatmullRomOpen:()=>jW,curveLinear:()=>Wf,curveLinearClosed:()=>rV,curveMonotoneX:()=>lV,curveMonotoneY:()=>fV,curveNatural:()=>hV,curveStep:()=>gV,curveStepAfter:()=>xV,curveStepBefore:()=>vV,line:()=>Zh,lineRadial:()=>uM,link:()=>Gv,linkHorizontal:()=>AW,linkRadial:()=>MW,linkVertical:()=>CW,pie:()=>bW,pointRadial:()=>Fp,radialArea:()=>fM,radialLine:()=>uM,stack:()=>wV,stackOffsetDiverging:()=>SV,stackOffsetExpand:()=>DV,stackOffsetNone:()=>Ws,stackOffsetSilhouette:()=>AV,stackOffsetWiggle:()=>MV,stackOrderAppearance:()=>n2,stackOrderAscending:()=>i2,stackOrderDescending:()=>OV,stackOrderInsideOut:()=>FV,stackOrderNone:()=>Vs,stackOrderReverse:()=>kV,symbol:()=>OM,symbolAsterisk:()=>zb,symbolCircle:()=>Jh,symbolCross:()=>Ub,symbolDiamond:()=>Hb,symbolDiamond2:()=>$b,symbolPlus:()=>Wb,symbolSquare:()=>Vb,symbolSquare2:()=>Gb,symbolStar:()=>Yb,symbolTimes:()=>Yv,symbolTriangle:()=>Zb,symbolTriangle2:()=>Xb,symbolWye:()=>Kb,symbolX:()=>Yv,symbols:()=>TM,symbolsFill:()=>TM,symbolsStroke:()=>FW});var e0=Te(()=>{g();x();v();hW();aM();kb();DW();SW();lM();cM();TW();_W();hM();dM();gM();vM();xM();yM();wM();bM();DM();SM();EM();CM();MM();PW();zW();Kv();mM();$W();IM();FM();Jv();JW();eV();e2();nV();Vv();cV();dV();yV();bV();NV();EV();ed();CV();TV();kM();o2();IV();_V();td();BV()});function LV(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function _p(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}var t0=Te(()=>{g();x();v()});function Fu(e){return e=_p(Math.abs(e)),e?e[1]:NaN}var r0=Te(()=>{g();x();v();t0()});function PV(e,t){return function(r,n){for(var i=r.length,o=[],u=0,l=e[0],a=0;i>0&&l>0&&(a+l+1>n&&(l=Math.max(1,n-a)),o.push(r.substring(i-=l,i+l)),!((a+=l+1)>n));)l=e[u=(u+1)%e.length];return o.reverse().join(t)}}var RV=Te(()=>{g();x();v()});function qV(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var zV=Te(()=>{g();x();v()});function Gs(e){if(!(t=Oxe.exec(e)))throw new Error("invalid format: "+e);var t;return new n0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function n0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}var Oxe,LM=Te(()=>{g();x();v();Oxe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;Gs.prototype=n0.prototype;n0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type}});function UV(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var HV=Te(()=>{g();x();v()});function $V(e,t){var r=_p(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(PM=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,u=n.length;return o===u?n:o>u?n+new Array(o-u+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+_p(e,Math.max(0,t+o-1))[0]}var PM,RM=Te(()=>{g();x();v();t0()});function qM(e,t){var r=_p(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var WV=Te(()=>{g();x();v();t0()});var zM,VV=Te(()=>{g();x();v();t0();RM();WV();zM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:LV,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>qM(e*100,t),r:qM,s:$V,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)}});function UM(e){return e}var GV=Te(()=>{g();x();v()});function a2(e){var t=e.grouping===void 0||e.thousands===void 0?UM:PV(YV.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?UM:qV(YV.call(e.numerals,String)),u=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"\u2212":e.minus+"",a=e.nan===void 0?"NaN":e.nan+"";function s(p){p=Gs(p);var h=p.fill,y=p.align,b=p.sign,w=p.symbol,A=p.zero,S=p.width,O=p.comma,M=p.precision,I=p.trim,F=p.type;F==="n"?(O=!0,F="g"):zM[F]||(M===void 0&&(M=12),I=!0,F="g"),(A||h==="0"&&y==="=")&&(A=!0,h="0",y="=");var C=w==="$"?r:w==="#"&&/[boxX]/.test(F)?"0"+F.toLowerCase():"",P=w==="$"?n:/[%p]/.test(F)?u:"",R=zM[F],q=/[defgprs%]/.test(F);M=M===void 0?6:/[gprs]/.test(F)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function U(H){var V=C,W=P,ee,ie,Y;if(F==="c")W=R(H)+W,H="";else{H=+H;var Z=H<0||1/H<0;if(H=isNaN(H)?a:R(Math.abs(H),M),I&&(H=UV(H)),Z&&+H==0&&b!=="+"&&(Z=!1),V=(Z?b==="("?b:l:b==="-"||b==="("?"":b)+V,W=(F==="s"?ZV[8+PM/3]:"")+W+(Z&&b==="("?")":""),q){for(ee=-1,ie=H.length;++eeY||Y>57){W=(Y===46?i+H.slice(ee+1):H.slice(ee))+W,H=H.slice(0,ee);break}}}O&&!A&&(H=t(H,1/0));var le=V.length+H.length+W.length,re=le>1)+V+H+W+re.slice(le);break;default:H=re+V+H+W;break}return o(H)}return U.toString=function(){return p+""},U}function f(p,h){var y=s((p=Gs(p),p.type="f",p)),b=Math.max(-8,Math.min(8,Math.floor(Fu(h)/3)))*3,w=Math.pow(10,-b),A=ZV[8+b/3];return function(S){return y(w*S)+A}}return{format:s,formatPrefix:f}}var YV,ZV,HM=Te(()=>{g();x();v();r0();RV();zV();LM();HV();VV();RM();GV();YV=Array.prototype.map,ZV=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"]});function u2(e){return s2=a2(e),kp=s2.format,i0=s2.formatPrefix,s2}var s2,kp,i0,XV=Te(()=>{g();x();v();HM();u2({thousands:",",grouping:[3],currency:["$",""]})});function l2(e){return Math.max(0,-Fu(Math.abs(e)))}var KV=Te(()=>{g();x();v();r0()});function f2(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Fu(t)/3)))*3-Fu(Math.abs(e)))}var JV=Te(()=>{g();x();v();r0()});function c2(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Fu(t)-Fu(e))+1}var QV=Te(()=>{g();x();v();r0()});var jV={};qa(jV,{FormatSpecifier:()=>n0,format:()=>kp,formatDefaultLocale:()=>u2,formatLocale:()=>a2,formatPrefix:()=>i0,formatSpecifier:()=>Gs,precisionFixed:()=>l2,precisionPrefix:()=>f2,precisionRound:()=>c2});var p2=Te(()=>{g();x();v();XV();HM();LM();KV();JV();QV()});function ko(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}var o0=Te(()=>{g();x();v()});function $M(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}var eG=Te(()=>{g();x();v()});function Bp(e){let t,r,n;e.length!==2?(t=ko,r=(l,a)=>ko(e(l),a),n=(l,a)=>e(l)-a):(t=e===ko||e===$M?e:Ixe,r=e,n=e);function i(l,a,s=0,f=l.length){if(s>>1;r(l[p],a)<0?s=p+1:f=p}while(s>>1;r(l[p],a)<=0?s=p+1:f=p}while(ss&&n(l[p-1],a)>-n(l[p],a)?p-1:p}return{left:i,center:u,right:o}}function Ixe(){return 0}var WM=Te(()=>{g();x();v();o0();eG()});function a0(e){return e===null?NaN:+e}function*tG(e,t){if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let n of e)(n=t(n,++r,e))!=null&&(n=+n)>=n&&(yield n)}}var VM=Te(()=>{g();x();v()});var rG,nG,Fxe,_xe,Ys,iG=Te(()=>{g();x();v();o0();WM();VM();rG=Bp(ko),nG=rG.right,Fxe=rG.left,_xe=Bp(a0).center,Ys=nG});function oG({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):r}function kxe({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Bxe({_intern:e,_key:t},r){let n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Lxe(e){return e!==null&&typeof e=="object"?e.valueOf():e}var rd,aG=Te(()=>{g();x();v();rd=class extends Map{constructor(t,r=Lxe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(let[n,i]of t)this.set(n,i)}get(t){return super.get(oG(this,t))}has(t){return super.has(oG(this,t))}set(t,r){return super.set(kxe(this,t),r)}delete(t){return super.delete(Bxe(this,t))}}});function sG(e=ko){if(e===ko)return GM;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{let n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function GM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var uG=Te(()=>{g();x();v();o0()});function m2(e,t,r){let n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),u=o>=Pxe?10:o>=Rxe?5:o>=qxe?2:1,l,a,s;return i<0?(s=Math.pow(10,-i)/u,l=Math.round(e*s),a=Math.round(t*s),l/st&&--a,s=-s):(s=Math.pow(10,i)*u,l=Math.round(e/s),a=Math.round(t/s),l*st&&--a),a0))return[];if(e===t)return[e];let n=t=i))return[];let l=o-i+1,a=new Array(l);if(n)if(u<0)for(let s=0;s{g();x();v();Pxe=Math.sqrt(50),Rxe=Math.sqrt(10),qxe=Math.sqrt(2)});function h2(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r=i)&&(r=i)}return r}var fG=Te(()=>{g();x();v()});function d2(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var cG=Te(()=>{g();x();v()});function g2(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?GM:sG(i);n>r;){if(n-r>600){let a=n-r+1,s=t-r+1,f=Math.log(a),p=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*p*(a-p)/a)*(s-a/2<0?-1:1),y=Math.max(r,Math.floor(t-s*p/a+h)),b=Math.min(n,Math.floor(t+(a-s)*p/a+h));g2(e,t,y,b,i)}let o=e[t],u=r,l=n;for(u0(e,r,t),i(e[n],o)>0&&u0(e,r,n);u0;)--l}i(e[r],o)===0?u0(e,r,l):(++l,u0(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function u0(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}var pG=Te(()=>{g();x();v();uG()});function v2(e,t,r){if(e=Float64Array.from(tG(e,r)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return d2(e);if(t>=1)return h2(e);var n,i=(n-1)*t,o=Math.floor(i),u=h2(g2(e,o).subarray(0,o+1)),l=d2(e.subarray(o+1));return u+(l-u)*(i-o)}}function YM(e,t,r=a0){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),u=+r(e[o],o,e),l=+r(e[o+1],o+1,e);return u+(l-u)*(i-o)}}var mG=Te(()=>{g();x();v();fG();cG();pG();VM()});function x2(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n{g();x();v()});var ns=Te(()=>{g();x();v();iG();o0();WM();mG();hG();lG();aG()});function On(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function is(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}var bo=Te(()=>{g();x();v()});function id(){var e=new rd,t=[],r=[],n=y2;function i(o){let u=e.get(o);if(u===void 0){if(n!==y2)return n;e.set(o,u=t.push(o)-1)}return r[u%r.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new rd;for(let u of o)e.has(u)||e.set(u,t.push(u)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return id(t,r).unknown(n)},On.apply(i,arguments),i}var y2,ZM=Te(()=>{g();x();v();ns();bo();y2=Symbol("implicit")});function l0(){var e=id().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,o,u,l=!1,a=0,s=0,f=.5;delete e.unknown;function p(){var h=t().length,y=i{g();x();v();ns();bo();ZM()});function Ml(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Vf(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}var w2=Te(()=>{g();x();v()});function ku(){}function yG(){return this.rgb().formatHex()}function Yxe(){return this.rgb().formatHex8()}function Zxe(){return AG(this).formatHsl()}function wG(){return this.rgb().formatRgb()}function os(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=zxe.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?bG(t):r===3?new vi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?b2(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?b2(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Uxe.exec(e))?new vi(t[1],t[2],t[3],1):(t=Hxe.exec(e))?new vi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$xe.exec(e))?b2(t[1],t[2],t[3],t[4]):(t=Wxe.exec(e))?b2(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Vxe.exec(e))?SG(t[1],t[2]/100,t[3]/100,1):(t=Gxe.exec(e))?SG(t[1],t[2]/100,t[3]/100,t[4]):xG.hasOwnProperty(e)?bG(xG[e]):e==="transparent"?new vi(NaN,NaN,NaN,0):null}function bG(e){return new vi(e>>16&255,e>>8&255,e&255,1)}function b2(e,t,r,n){return n<=0&&(e=t=r=NaN),new vi(e,t,r,n)}function c0(e){return e instanceof ku||(e=os(e)),e?(e=e.rgb(),new vi(e.r,e.g,e.b,e.opacity)):new vi}function zp(e,t,r,n){return arguments.length===1?c0(e):new vi(e,t,r,n??1)}function vi(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function DG(){return`#${Pp(this.r)}${Pp(this.g)}${Pp(this.b)}`}function Xxe(){return`#${Pp(this.r)}${Pp(this.g)}${Pp(this.b)}${Pp((isNaN(this.opacity)?1:this.opacity)*255)}`}function NG(){let e=N2(this.opacity);return`${e===1?"rgb(":"rgba("}${Rp(this.r)}, ${Rp(this.g)}, ${Rp(this.b)}${e===1?")":`, ${e})`}`}function N2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rp(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pp(e){return e=Rp(e),(e<16?"0":"")+e.toString(16)}function SG(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Zs(e,t,r,n)}function AG(e){if(e instanceof Zs)return new Zs(e.h,e.s,e.l,e.opacity);if(e instanceof ku||(e=os(e)),!e)return new Zs;if(e instanceof Zs)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),u=NaN,l=o-i,a=(o+i)/2;return l?(t===o?u=(r-n)/l+(r0&&a<1?0:u,new Zs(u,l,a,e.opacity)}function ad(e,t,r,n){return arguments.length===1?AG(e):new Zs(e,t,r,n??1)}function Zs(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function EG(e){return e=(e||0)%360,e<0?e+360:e}function D2(e){return Math.max(0,Math.min(1,e||0))}function XM(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var Gf,qp,od,f0,_u,zxe,Uxe,Hxe,$xe,Wxe,Vxe,Gxe,xG,S2=Te(()=>{g();x();v();w2();Gf=.7,qp=1/Gf,od="\\s*([+-]?\\d+)\\s*",f0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_u="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zxe=/^#([0-9a-f]{3,8})$/,Uxe=new RegExp(`^rgb\\(${od},${od},${od}\\)$`),Hxe=new RegExp(`^rgb\\(${_u},${_u},${_u}\\)$`),$xe=new RegExp(`^rgba\\(${od},${od},${od},${f0}\\)$`),Wxe=new RegExp(`^rgba\\(${_u},${_u},${_u},${f0}\\)$`),Vxe=new RegExp(`^hsl\\(${f0},${_u},${_u}\\)$`),Gxe=new RegExp(`^hsla\\(${f0},${_u},${_u},${f0}\\)$`),xG={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ml(ku,os,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:yG,formatHex:yG,formatHex8:Yxe,formatHsl:Zxe,formatRgb:wG,toString:wG});Ml(vi,zp,Vf(ku,{brighter(e){return e=e==null?qp:Math.pow(qp,e),new vi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Gf:Math.pow(Gf,e),new vi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new vi(Rp(this.r),Rp(this.g),Rp(this.b),N2(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:DG,formatHex:DG,formatHex8:Xxe,formatRgb:NG,toString:NG}));Ml(Zs,ad,Vf(ku,{brighter(e){return e=e==null?qp:Math.pow(qp,e),new Zs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Gf:Math.pow(Gf,e),new Zs(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new vi(XM(e>=240?e-240:e+120,i,n),XM(e,i,n),XM(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Zs(EG(this.h),D2(this.s),D2(this.l),N2(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=N2(this.opacity);return`${e===1?"hsl(":"hsla("}${EG(this.h)}, ${D2(this.s)*100}%, ${D2(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var E2,A2,KM=Te(()=>{g();x();v();E2=Math.PI/180,A2=180/Math.PI});function FG(e){if(e instanceof Xs)return new Xs(e.l,e.a,e.b,e.opacity);if(e instanceof Bu)return LG(e);e instanceof vi||(e=c0(e));var t=eT(e.r),r=eT(e.g),n=eT(e.b),i=JM((.2225045*t+.7168786*r+.0606169*n)/MG),o,u;return t===r&&r===n?o=u=i:(o=JM((.4360747*t+.3850649*r+.1430804*n)/CG),u=JM((.0139322*t+.0971045*r+.7141733*n)/TG)),new Xs(116*i-16,500*(o-i),200*(i-u),e.opacity)}function _G(e,t){return new Xs(e,0,0,t??1)}function Up(e,t,r,n){return arguments.length===1?FG(e):new Xs(e,t,r,n??1)}function Xs(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function JM(e){return e>Kxe?Math.pow(e,1/3):e/IG+OG}function QM(e){return e>sd?e*e*e:IG*(e-OG)}function jM(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function eT(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function kG(e){if(e instanceof Bu)return new Bu(e.h,e.c,e.l,e.opacity);if(e instanceof Xs||(e=FG(e)),e.a===0&&e.b===0)return new Bu(NaN,0{g();x();v();w2();S2();KM();C2=18,CG=.96422,MG=1,TG=.82521,OG=4/29,sd=6/29,IG=3*sd*sd,Kxe=sd*sd*sd;Ml(Xs,Up,Vf(ku,{brighter(e){return new Xs(this.l+C2*(e??1),this.a,this.b,this.opacity)},darker(e){return new Xs(this.l-C2*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=CG*QM(t),e=MG*QM(e),r=TG*QM(r),new vi(jM(3.1338561*t-1.6168667*e-.4906146*r),jM(-.9787684*t+1.9161415*e+.033454*r),jM(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));Ml(Bu,ud,Vf(ku,{brighter(e){return new Bu(this.h,this.c,this.l+C2*(e??1),this.opacity)},darker(e){return new Bu(this.h,this.c,this.l-C2*(e??1),this.opacity)},rgb(){return LG(this).rgb()}}))});function Jxe(e){if(e instanceof Hp)return new Hp(e.h,e.s,e.l,e.opacity);e instanceof vi||(e=c0(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(zG*n+RG*t-qG*r)/(zG+RG-qG),o=n-i,u=(p0*(r-i)-rT*o)/M2,l=Math.sqrt(u*u+o*o)/(p0*i*(1-i)),a=l?Math.atan2(u,o)*A2-120:NaN;return new Hp(a<0?a+360:a,l,i,e.opacity)}function $p(e,t,r,n){return arguments.length===1?Jxe(e):new Hp(e,t,r,n??1)}function Hp(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}var UG,tT,rT,M2,p0,RG,qG,zG,HG=Te(()=>{g();x();v();w2();S2();KM();UG=-.14861,tT=1.78277,rT=-.29227,M2=-.90649,p0=1.97294,RG=p0*M2,qG=p0*tT,zG=tT*rT-M2*UG;Ml(Hp,$p,Vf(ku,{brighter(e){return e=e==null?qp:Math.pow(qp,e),new Hp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Gf:Math.pow(Gf,e),new Hp(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*E2,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new vi(255*(t+r*(UG*n+tT*i)),255*(t+r*(rT*n+M2*i)),255*(t+r*(p0*n)),this.opacity)}}))});var T2={};qa(T2,{color:()=>os,cubehelix:()=>$p,gray:()=>_G,hcl:()=>ud,hsl:()=>ad,lab:()=>Up,lch:()=>BG,rgb:()=>zp});var Ks=Te(()=>{g();x();v();S2();PG();HG()});function nT(e,t,r,n,i){var o=e*e,u=o*e;return((1-3*e+3*o-u)*t+(4-6*o+3*u)*r+(1+3*e+3*o-3*u)*n+u*i)/6}function O2(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],o=e[n+1],u=n>0?e[n-1]:2*i-o,l=n{g();x();v()});function F2(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],o=e[n%t],u=e[(n+1)%t],l=e[(n+2)%t];return nT((r-n/t)*t,i,o,u,l)}}var iT=Te(()=>{g();x();v();I2()});var ld,oT=Te(()=>{g();x();v();ld=e=>()=>e});function $G(e,t){return function(r){return e+r*t}}function Qxe(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Yf(e,t){var r=t-e;return r?$G(e,r>180||r<-180?r-360*Math.round(r/360):r):ld(isNaN(e)?t:e)}function WG(e){return(e=+e)==1?In:function(t,r){return r-t?Qxe(t,r,e):ld(isNaN(t)?r:t)}}function In(e,t){var r=t-e;return r?$G(e,r):ld(isNaN(e)?t:e)}var Wp=Te(()=>{g();x();v();oT()});function VG(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),o=new Array(r),u,l;for(u=0;u{g();x();v();Ks();I2();iT();Wp();Zf=function e(t){var r=WG(t);function n(i,o){var u=r((i=zp(i)).r,(o=zp(o)).r),l=r(i.g,o.g),a=r(i.b,o.b),s=In(i.opacity,o.opacity);return function(f){return i.r=u(f),i.g=l(f),i.b=a(f),i.opacity=s(f),i+""}}return n.gamma=e,n}(1);GG=VG(O2),YG=VG(F2)});function fd(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;i{g();x();v()});function ZG(e,t){return(_2(t)?fd:sT)(e,t)}function sT(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),o=new Array(r),u;for(u=0;u{g();x();v();m0();k2()});function B2(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var lT=Te(()=>{g();x();v()});function Hi(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var h0=Te(()=>{g();x();v()});function L2(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Jo(e[i],t[i]):n[i]=t[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var fT=Te(()=>{g();x();v();m0()});function jxe(e){return function(){return e}}function eye(e){return function(t){return e(t)+""}}function cd(e,t){var r=pT.lastIndex=cT.lastIndex=0,n,i,o,u=-1,l=[],a=[];for(e=e+"",t=t+"";(n=pT.exec(e))&&(i=cT.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),l[u]?l[u]+=o:l[++u]=o),(n=n[0])===(i=i[0])?l[u]?l[u]+=i:l[++u]=i:(l[++u]=null,a.push({i:u,x:Hi(n,i)})),r=cT.lastIndex;return r{g();x();v();h0();pT=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cT=new RegExp(pT.source,"g")});function Jo(e,t){var r=typeof t,n;return t==null||r==="boolean"?ld(t):(r==="number"?Hi:r==="string"?(n=os(t))?(t=n,Zf):cd:t instanceof os?Zf:t instanceof Date?B2:_2(t)?fd:Array.isArray(t)?sT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?L2:Hi)(e,t)}var m0=Te(()=>{g();x();v();Ks();aT();uT();lT();h0();fT();mT();oT();k2()});function XG(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}}var KG=Te(()=>{g();x();v()});function JG(e,t){var r=Yf(+e,+t);return function(n){var i=r(n);return i-360*Math.floor(i/360)}}var QG=Te(()=>{g();x();v();Wp()});function Xf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var jG=Te(()=>{g();x();v()});function hT(e,t,r,n,i,o){var u,l,a;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(a=e*r+t*n)&&(r-=e*a,n-=t*a),(l=Math.sqrt(r*r+n*n))&&(r/=l,n/=l,a/=l),e*n{g();x();v();eY=180/Math.PI,P2={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function rY(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?P2:hT(t.a,t.b,t.c,t.d,t.e,t.f)}function nY(e){return e==null?P2:(R2||(R2=document.createElementNS("http://www.w3.org/2000/svg","g")),R2.setAttribute("transform",e),(e=R2.transform.baseVal.consolidate())?(e=e.matrix,hT(e.a,e.b,e.c,e.d,e.e,e.f)):P2)}var R2,iY=Te(()=>{g();x();v();tY()});function oY(e,t,r,n){function i(s){return s.length?s.pop()+" ":""}function o(s,f,p,h,y,b){if(s!==p||f!==h){var w=y.push("translate(",null,t,null,r);b.push({i:w-4,x:Hi(s,p)},{i:w-2,x:Hi(f,h)})}else(p||h)&&y.push("translate("+p+t+h+r)}function u(s,f,p,h){s!==f?(s-f>180?f+=360:f-s>180&&(s+=360),h.push({i:p.push(i(p)+"rotate(",null,n)-2,x:Hi(s,f)})):f&&p.push(i(p)+"rotate("+f+n)}function l(s,f,p,h){s!==f?h.push({i:p.push(i(p)+"skewX(",null,n)-2,x:Hi(s,f)}):f&&p.push(i(p)+"skewX("+f+n)}function a(s,f,p,h,y,b){if(s!==p||f!==h){var w=y.push(i(y)+"scale(",null,",",null,")");b.push({i:w-4,x:Hi(s,p)},{i:w-2,x:Hi(f,h)})}else(p!==1||h!==1)&&y.push(i(y)+"scale("+p+","+h+")")}return function(s,f){var p=[],h=[];return s=e(s),f=e(f),o(s.translateX,s.translateY,f.translateX,f.translateY,p,h),u(s.rotate,f.rotate,p,h),l(s.skewX,f.skewX,p,h),a(s.scaleX,s.scaleY,f.scaleX,f.scaleY,p,h),s=f=null,function(y){for(var b=-1,w=h.length,A;++b{g();x();v();h0();iY();q2=oY(rY,"px, ","px)","deg)"),z2=oY(nY,", ",")",")")});function sY(e){return((e=Math.exp(e))+1/e)/2}function rye(e){return((e=Math.exp(e))-1/e)/2}function nye(e){return((e=Math.exp(2*e))-1)/(e+1)}var tye,U2,uY=Te(()=>{g();x();v();tye=1e-12;U2=function e(t,r,n){function i(o,u){var l=o[0],a=o[1],s=o[2],f=u[0],p=u[1],h=u[2],y=f-l,b=p-a,w=y*y+b*b,A,S;if(w{g();x();v();Ks();Wp();fY=lY(Yf),cY=lY(In)});function dT(e,t){var r=In((e=Up(e)).l,(t=Up(t)).l),n=In(e.a,t.a),i=In(e.b,t.b),o=In(e.opacity,t.opacity);return function(u){return e.l=r(u),e.a=n(u),e.b=i(u),e.opacity=o(u),e+""}}var mY=Te(()=>{g();x();v();Ks();Wp()});function hY(e){return function(t,r){var n=e((t=ud(t)).h,(r=ud(r)).h),i=In(t.c,r.c),o=In(t.l,r.l),u=In(t.opacity,r.opacity);return function(l){return t.h=n(l),t.c=i(l),t.l=o(l),t.opacity=u(l),t+""}}}var dY,gY,vY=Te(()=>{g();x();v();Ks();Wp();dY=hY(Yf),gY=hY(In)});function xY(e){return function t(r){r=+r;function n(i,o){var u=e((i=$p(i)).h,(o=$p(o)).h),l=In(i.s,o.s),a=In(i.l,o.l),s=In(i.opacity,o.opacity);return function(f){return i.h=u(f),i.s=l(f),i.l=a(Math.pow(f,r)),i.opacity=s(f),i+""}}return n.gamma=t,n}(1)}var yY,wY,bY=Te(()=>{g();x();v();Ks();Wp();yY=xY(Yf),wY=xY(In)});function d0(e,t){t===void 0&&(t=e,e=Jo);for(var r=0,n=t.length-1,i=t[0],o=new Array(n<0?0:n);r{g();x();v();m0()});function NY(e,t){for(var r=new Array(t),n=0;n{g();x();v()});var EY={};qa(EY,{interpolate:()=>Jo,interpolateArray:()=>ZG,interpolateBasis:()=>O2,interpolateBasisClosed:()=>F2,interpolateCubehelix:()=>yY,interpolateCubehelixLong:()=>wY,interpolateDate:()=>B2,interpolateDiscrete:()=>XG,interpolateHcl:()=>dY,interpolateHclLong:()=>gY,interpolateHsl:()=>fY,interpolateHslLong:()=>cY,interpolateHue:()=>JG,interpolateLab:()=>dT,interpolateNumber:()=>Hi,interpolateNumberArray:()=>fd,interpolateObject:()=>L2,interpolateRgb:()=>Zf,interpolateRgbBasis:()=>GG,interpolateRgbBasisClosed:()=>YG,interpolateRound:()=>Xf,interpolateString:()=>cd,interpolateTransformCss:()=>q2,interpolateTransformSvg:()=>z2,interpolateZoom:()=>U2,piecewise:()=>d0,quantize:()=>NY});var Tl=Te(()=>{g();x();v();m0();uT();I2();iT();lT();KG();QG();h0();k2();fT();jG();mT();aY();uY();aT();pY();mY();vY();bY();DY();SY()});function gT(e){return function(){return e}}var AY=Te(()=>{g();x();v()});function Kf(e){return+e}var H2=Te(()=>{g();x();v()});function Ti(e){return e}function vT(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:gT(isNaN(t)?NaN:.5)}function iye(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function oye(e,t,r){var n=e[0],i=e[1],o=t[0],u=t[1];return i2?aye:oye,a=s=null,p}function p(h){return h==null||isNaN(h=+h)?o:(a||(a=l(e.map(n),t,r)))(n(u(h)))}return p.invert=function(h){return u(i((s||(s=l(t,e.map(n),Hi)))(h)))},p.domain=function(h){return arguments.length?(e=Array.from(h,Kf),f()):e.slice()},p.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},p.rangeRound=function(h){return t=Array.from(h),r=Xf,f()},p.clamp=function(h){return arguments.length?(u=h?!0:Ti,f()):u!==Ti},p.interpolate=function(h){return arguments.length?(r=h,f()):r},p.unknown=function(h){return arguments.length?(o=h,p):o},function(h,y){return n=h,i=y,f()}}function Gp(){return Vp()(Ti,Ti)}var CY,Pu=Te(()=>{g();x();v();ns();Tl();AY();H2();CY=[0,1]});function g0(e,t,r,n){var i=nd(e,t,r),o;switch(n=Gs(n??",f"),n.type){case"s":{var u=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=f2(i,u))&&(n.precision=o),i0(n,u)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=c2(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=l2(i))&&(n.precision=o-(n.type==="%")*2);break}}return kp(n)}var xT=Te(()=>{g();x();v();ns();p2()});function Bo(e){var t=e.domain;return e.ticks=function(r){var n=t();return Lp(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return g0(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,u=n[i],l=n[o],a,s,f=10;for(l0;){if(s=s0(u,l,r),s===a)return n[i]=u,n[o]=l,t(n);if(s>0)u=Math.floor(u/s)*s,l=Math.ceil(l/s)*s;else if(s<0)u=Math.ceil(u*s)/s,l=Math.floor(l*s)/s;else break;a=s}return e},e}function $2(){var e=Gp();return e.copy=function(){return Lu(e,$2())},On.apply(e,arguments),Bo(e)}var Ol=Te(()=>{g();x();v();ns();Pu();bo();xT()});function W2(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Kf),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return W2(e).unknown(t)},e=arguments.length?Array.from(e,Kf):[0,1],Bo(r)}var MY=Te(()=>{g();x();v();Ol();H2()});function v0(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],u;return o{g();x();v()});function TY(e){return Math.log(e)}function OY(e){return Math.exp(e)}function sye(e){return-Math.log(-e)}function uye(e){return-Math.exp(-e)}function lye(e){return isFinite(e)?+("1e"+e):e<0?0:e}function fye(e){return e===10?lye:e===Math.E?Math.exp:t=>Math.pow(e,t)}function cye(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function IY(e){return(t,r)=>-e(-t,r)}function x0(e){let t=e(TY,OY),r=t.domain,n=10,i,o;function u(){return i=cye(n),o=fye(n),r()[0]<0?(i=IY(i),o=IY(o),e(sye,uye)):e(TY,OY),t}return t.base=function(l){return arguments.length?(n=+l,u()):n},t.domain=function(l){return arguments.length?(r(l),u()):r()},t.ticks=l=>{let a=r(),s=a[0],f=a[a.length-1],p=f0){for(;h<=y;++h)for(b=1;bf)break;S.push(w)}}else for(;h<=y;++h)for(b=n-1;b>=1;--b)if(w=h>0?b/o(-h):b*o(h),!(wf)break;S.push(w)}S.length*2{if(l==null&&(l=10),a==null&&(a=n===10?"s":","),typeof a!="function"&&(!(n%1)&&(a=Gs(a)).precision==null&&(a.trim=!0),a=kp(a)),l===1/0)return a;let s=Math.max(1,n*l/t.ticks().length);return f=>{let p=f/o(Math.round(i(f)));return p*nr(v0(r(),{floor:l=>o(Math.floor(i(l))),ceil:l=>o(Math.ceil(i(l)))})),t}function V2(){let e=x0(Vp()).domain([1,10]);return e.copy=()=>Lu(e,V2()).base(e.base()),On.apply(e,arguments),e}var G2=Te(()=>{g();x();v();ns();p2();yT();Pu();bo()});function FY(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function _Y(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function y0(e){var t=1,r=e(FY(t),_Y(t));return r.constant=function(n){return arguments.length?e(FY(t=+n),_Y(t)):t},Bo(r)}function Y2(){var e=y0(Vp());return e.copy=function(){return Lu(e,Y2()).constant(e.constant())},On.apply(e,arguments)}var Z2=Te(()=>{g();x();v();Ol();Pu();bo()});function kY(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function pye(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function mye(e){return e<0?-e*e:e*e}function w0(e){var t=e(Ti,Ti),r=1;function n(){return r===1?e(Ti,Ti):r===.5?e(pye,mye):e(kY(r),kY(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Bo(t)}function b0(){var e=w0(Vp());return e.copy=function(){return Lu(e,b0()).exponent(e.exponent())},On.apply(e,arguments),e}function BY(){return b0.apply(null,arguments).exponent(.5)}var X2=Te(()=>{g();x();v();Ol();Pu();bo()});function LY(e){return Math.sign(e)*e*e}function hye(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function K2(){var e=Gp(),t=[0,1],r=!1,n;function i(o){var u=hye(e(o));return isNaN(u)?n:r?Math.round(u):u}return i.invert=function(o){return e.invert(LY(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Kf)).map(LY)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return K2(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},On.apply(i,arguments),Bo(i)}var PY=Te(()=>{g();x();v();Pu();bo();Ol();H2()});function J2(){var e=[],t=[],r=[],n;function i(){var u=0,l=Math.max(1,t.length);for(r=new Array(l-1);++u0?r[l-1]:e[0],l{g();x();v();ns();bo()});function Q2(){var e=0,t=1,r=1,n=[.5],i=[0,1],o;function u(a){return a!=null&&a<=a?i[Ys(n,a,0,r)]:o}function l(){var a=-1;for(n=new Array(r);++a=r?[n[r-1],t]:[n[s-1],n[s]]},u.unknown=function(a){return arguments.length&&(o=a),u},u.thresholds=function(){return n.slice()},u.copy=function(){return Q2().domain([e,t]).range(i).unknown(o)},On.apply(Bo(u),arguments)}var qY=Te(()=>{g();x();v();ns();Ol();bo()});function j2(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[Ys(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var u=t.indexOf(o);return[e[u-1],e[u]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return j2().domain(e).range(t).unknown(r)},On.apply(i,arguments)}var zY=Te(()=>{g();x();v();ns();bo()});function pn(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{let u=i(o),l=i.ceil(o);return o-u(t(o=new Date(+o),u==null?1:Math.floor(u)),o),i.range=(o,u,l)=>{let a=[];if(o=i.ceil(o),l=l==null?1:Math.floor(l),!(o0))return a;let s;do a.push(s=new Date(+o)),t(o,l),e(o);while(spn(u=>{if(u>=u)for(;e(u),!o(u);)u.setTime(u-1)},(u,l)=>{if(u>=u)if(l<0)for(;++l<=0;)for(;t(u,-1),!o(u););else for(;--l>=0;)for(;t(u,1),!o(u););}),r&&(i.count=(o,u)=>(wT.setTime(+o),bT.setTime(+u),e(wT),e(bT),Math.floor(r(wT,bT))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?u=>n(u)%o===0:u=>i.count(0,u)%o===0):i)),i}var wT,bT,Il=Te(()=>{g();x();v();wT=new Date,bT=new Date});var D0,Xnr,UY=Te(()=>{g();x();v();Il();D0=pn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);D0.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?pn(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):D0);Xnr=D0.range});var as,HY,DT=Te(()=>{g();x();v();Il();as=pn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*1e3)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds()),HY=as.range});var pd,dye,md,gye,NT=Te(()=>{g();x();v();Il();pd=pn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getMinutes()),dye=pd.range,md=pn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*6e4)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes()),gye=md.range});var hd,vye,dd,xye,ST=Te(()=>{g();x();v();Il();hd=pn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3-e.getMinutes()*6e4)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getHours()),vye=hd.range,dd=pn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*36e5)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours()),xye=dd.range});var Fl,yye,Xp,wye,eD,bye,ET=Te(()=>{g();x();v();Il();Fl=pn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1),yye=Fl.range,Xp=pn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1),wye=Xp.range,eD=pn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)),bye=eD.range});function Kp(e){return pn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}function Jp(e){return pn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/6048e5)}var _l,gd,WY,VY,Jf,GY,YY,ZY,Dye,Nye,Sye,Eye,Aye,Cye,kl,vd,XY,KY,Qf,JY,QY,jY,Mye,Tye,Oye,Iye,Fye,_ye,AT=Te(()=>{g();x();v();Il();_l=Kp(0),gd=Kp(1),WY=Kp(2),VY=Kp(3),Jf=Kp(4),GY=Kp(5),YY=Kp(6),ZY=_l.range,Dye=gd.range,Nye=WY.range,Sye=VY.range,Eye=Jf.range,Aye=GY.range,Cye=YY.range;kl=Jp(0),vd=Jp(1),XY=Jp(2),KY=Jp(3),Qf=Jp(4),JY=Jp(5),QY=Jp(6),jY=kl.range,Mye=vd.range,Tye=XY.range,Oye=KY.range,Iye=Qf.range,Fye=JY.range,_ye=QY.range});var xd,kye,yd,Bye,CT=Te(()=>{g();x();v();Il();xd=pn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),kye=xd.range,yd=pn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),Bye=yd.range});var Aa,Lye,Ca,Pye,MT=Te(()=>{g();x();v();Il();Aa=pn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Aa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Lye=Aa.range,Ca=pn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ca.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Pye=Ca.range});function tZ(e,t,r,n,i,o){let u=[[as,1,1e3],[as,5,5*1e3],[as,15,15*1e3],[as,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function l(s,f,p){let h=fA).right(u,h);if(y===u.length)return e.every(nd(s/31536e6,f/31536e6,p));if(y===0)return D0.every(Math.max(nd(s,f,p),1));let[b,w]=u[h/u[y-1][2]{g();x();v();ns();UY();DT();NT();ST();ET();AT();CT();MT();[TT,OT]=tZ(Ca,yd,kl,eD,dd,md),[IT,FT]=tZ(Aa,xd,_l,Fl,hd,pd)});var tD=Te(()=>{g();x();v();DT();NT();ST();ET();AT();CT();MT();rZ()});function _T(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function kT(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function S0(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function BT(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,o=e.days,u=e.shortDays,l=e.months,a=e.shortMonths,s=E0(i),f=A0(i),p=E0(o),h=A0(o),y=E0(u),b=A0(u),w=E0(l),A=A0(l),S=E0(a),O=A0(a),M={a:Z,A:le,b:re,B:he,c:null,d:uZ,e:uZ,f:swe,g:vwe,G:ywe,H:iwe,I:owe,j:awe,L:mZ,m:uwe,M:lwe,p:De,q:we,Q:cZ,s:pZ,S:fwe,u:cwe,U:pwe,V:mwe,w:hwe,W:dwe,x:null,X:null,y:gwe,Y:xwe,Z:wwe,"%":fZ},I={a:ce,A:Se,b:Pe,B:Ce,c:null,d:lZ,e:lZ,f:Swe,g:kwe,G:Lwe,H:bwe,I:Dwe,j:Nwe,L:dZ,m:Ewe,M:Awe,p:Oe,q:He,Q:cZ,s:pZ,S:Cwe,u:Mwe,U:Twe,V:Owe,w:Iwe,W:Fwe,x:null,X:null,y:_we,Y:Bwe,Z:Pwe,"%":fZ},F={a:U,A:H,b:V,B:W,c:ee,d:aZ,e:aZ,f:ewe,g:oZ,G:iZ,H:sZ,I:sZ,j:Kye,L:jye,m:Xye,M:Jye,p:q,q:Zye,Q:rwe,s:nwe,S:Qye,u:$ye,U:Wye,V:Vye,w:Hye,W:Gye,x:ie,X:Y,y:oZ,Y:iZ,Z:Yye,"%":twe};M.x=C(r,M),M.X=C(n,M),M.c=C(t,M),I.x=C(r,I),I.X=C(n,I),I.c=C(t,I);function C(Ee,ze){return function(We){var Le=[],lt=-1,ct=0,de=Ee.length,be,Ue,ge;for(We instanceof Date||(We=new Date(+We));++lt53)return null;"w"in Le||(Le.w=1),"Z"in Le?(ct=kT(S0(Le.y,0,1)),de=ct.getUTCDay(),ct=de>4||de===0?vd.ceil(ct):vd(ct),ct=Xp.offset(ct,(Le.V-1)*7),Le.y=ct.getUTCFullYear(),Le.m=ct.getUTCMonth(),Le.d=ct.getUTCDate()+(Le.w+6)%7):(ct=_T(S0(Le.y,0,1)),de=ct.getDay(),ct=de>4||de===0?gd.ceil(ct):gd(ct),ct=Fl.offset(ct,(Le.V-1)*7),Le.y=ct.getFullYear(),Le.m=ct.getMonth(),Le.d=ct.getDate()+(Le.w+6)%7)}else("W"in Le||"U"in Le)&&("w"in Le||(Le.w="u"in Le?Le.u%7:"W"in Le?1:0),de="Z"in Le?kT(S0(Le.y,0,1)).getUTCDay():_T(S0(Le.y,0,1)).getDay(),Le.m=0,Le.d="W"in Le?(Le.w+6)%7+Le.W*7-(de+5)%7:Le.w+Le.U*7-(de+6)%7);return"Z"in Le?(Le.H+=Le.Z/100|0,Le.M+=Le.Z%100,kT(Le)):_T(Le)}}function R(Ee,ze,We,Le){for(var lt=0,ct=ze.length,de=We.length,be,Ue;lt=de)return-1;if(be=ze.charCodeAt(lt++),be===37){if(be=ze.charAt(lt++),Ue=F[be in nZ?ze.charAt(lt++):be],!Ue||(Le=Ue(Ee,We,Le))<0)return-1}else if(be!=We.charCodeAt(Le++))return-1}return Le}function q(Ee,ze,We){var Le=s.exec(ze.slice(We));return Le?(Ee.p=f.get(Le[0].toLowerCase()),We+Le[0].length):-1}function U(Ee,ze,We){var Le=y.exec(ze.slice(We));return Le?(Ee.w=b.get(Le[0].toLowerCase()),We+Le[0].length):-1}function H(Ee,ze,We){var Le=p.exec(ze.slice(We));return Le?(Ee.w=h.get(Le[0].toLowerCase()),We+Le[0].length):-1}function V(Ee,ze,We){var Le=S.exec(ze.slice(We));return Le?(Ee.m=O.get(Le[0].toLowerCase()),We+Le[0].length):-1}function W(Ee,ze,We){var Le=w.exec(ze.slice(We));return Le?(Ee.m=A.get(Le[0].toLowerCase()),We+Le[0].length):-1}function ee(Ee,ze,We){return R(Ee,t,ze,We)}function ie(Ee,ze,We){return R(Ee,r,ze,We)}function Y(Ee,ze,We){return R(Ee,n,ze,We)}function Z(Ee){return u[Ee.getDay()]}function le(Ee){return o[Ee.getDay()]}function re(Ee){return a[Ee.getMonth()]}function he(Ee){return l[Ee.getMonth()]}function De(Ee){return i[+(Ee.getHours()>=12)]}function we(Ee){return 1+~~(Ee.getMonth()/3)}function ce(Ee){return u[Ee.getUTCDay()]}function Se(Ee){return o[Ee.getUTCDay()]}function Pe(Ee){return a[Ee.getUTCMonth()]}function Ce(Ee){return l[Ee.getUTCMonth()]}function Oe(Ee){return i[+(Ee.getUTCHours()>=12)]}function He(Ee){return 1+~~(Ee.getUTCMonth()/3)}return{format:function(Ee){var ze=C(Ee+="",M);return ze.toString=function(){return Ee},ze},parse:function(Ee){var ze=P(Ee+="",!1);return ze.toString=function(){return Ee},ze},utcFormat:function(Ee){var ze=C(Ee+="",I);return ze.toString=function(){return Ee},ze},utcParse:function(Ee){var ze=P(Ee+="",!0);return ze.toString=function(){return Ee},ze}}}function Ur(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function Hye(e,t,r){var n=$i.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function $ye(e,t,r){var n=$i.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Wye(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Vye(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Gye(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function iZ(e,t,r){var n=$i.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function oZ(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Yye(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Zye(e,t,r){var n=$i.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Xye(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function aZ(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Kye(e,t,r){var n=$i.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function sZ(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Jye(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Qye(e,t,r){var n=$i.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function jye(e,t,r){var n=$i.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function ewe(e,t,r){var n=$i.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function twe(e,t,r){var n=qye.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function rwe(e,t,r){var n=$i.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function nwe(e,t,r){var n=$i.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function uZ(e,t){return Ur(e.getDate(),t,2)}function iwe(e,t){return Ur(e.getHours(),t,2)}function owe(e,t){return Ur(e.getHours()%12||12,t,2)}function awe(e,t){return Ur(1+Fl.count(Aa(e),e),t,3)}function mZ(e,t){return Ur(e.getMilliseconds(),t,3)}function swe(e,t){return mZ(e,t)+"000"}function uwe(e,t){return Ur(e.getMonth()+1,t,2)}function lwe(e,t){return Ur(e.getMinutes(),t,2)}function fwe(e,t){return Ur(e.getSeconds(),t,2)}function cwe(e){var t=e.getDay();return t===0?7:t}function pwe(e,t){return Ur(_l.count(Aa(e)-1,e),t,2)}function hZ(e){var t=e.getDay();return t>=4||t===0?Jf(e):Jf.ceil(e)}function mwe(e,t){return e=hZ(e),Ur(Jf.count(Aa(e),e)+(Aa(e).getDay()===4),t,2)}function hwe(e){return e.getDay()}function dwe(e,t){return Ur(gd.count(Aa(e)-1,e),t,2)}function gwe(e,t){return Ur(e.getFullYear()%100,t,2)}function vwe(e,t){return e=hZ(e),Ur(e.getFullYear()%100,t,2)}function xwe(e,t){return Ur(e.getFullYear()%1e4,t,4)}function ywe(e,t){var r=e.getDay();return e=r>=4||r===0?Jf(e):Jf.ceil(e),Ur(e.getFullYear()%1e4,t,4)}function wwe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ur(t/60|0,"0",2)+Ur(t%60,"0",2)}function lZ(e,t){return Ur(e.getUTCDate(),t,2)}function bwe(e,t){return Ur(e.getUTCHours(),t,2)}function Dwe(e,t){return Ur(e.getUTCHours()%12||12,t,2)}function Nwe(e,t){return Ur(1+Xp.count(Ca(e),e),t,3)}function dZ(e,t){return Ur(e.getUTCMilliseconds(),t,3)}function Swe(e,t){return dZ(e,t)+"000"}function Ewe(e,t){return Ur(e.getUTCMonth()+1,t,2)}function Awe(e,t){return Ur(e.getUTCMinutes(),t,2)}function Cwe(e,t){return Ur(e.getUTCSeconds(),t,2)}function Mwe(e){var t=e.getUTCDay();return t===0?7:t}function Twe(e,t){return Ur(kl.count(Ca(e)-1,e),t,2)}function gZ(e){var t=e.getUTCDay();return t>=4||t===0?Qf(e):Qf.ceil(e)}function Owe(e,t){return e=gZ(e),Ur(Qf.count(Ca(e),e)+(Ca(e).getUTCDay()===4),t,2)}function Iwe(e){return e.getUTCDay()}function Fwe(e,t){return Ur(vd.count(Ca(e)-1,e),t,2)}function _we(e,t){return Ur(e.getUTCFullYear()%100,t,2)}function kwe(e,t){return e=gZ(e),Ur(e.getUTCFullYear()%100,t,2)}function Bwe(e,t){return Ur(e.getUTCFullYear()%1e4,t,4)}function Lwe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Qf(e):Qf.ceil(e),Ur(e.getUTCFullYear()%1e4,t,4)}function Pwe(){return"+0000"}function fZ(){return"%"}function cZ(e){return+e}function pZ(e){return Math.floor(+e/1e3)}var nZ,$i,qye,zye,vZ=Te(()=>{g();x();v();tD();nZ={"-":"",_:" ",0:"0"},$i=/^\s*\d+/,qye=/^%/,zye=/[\\^$*+?|[\]().{}]/g});function LT(e){return wd=BT(e),rD=wd.format,xZ=wd.parse,nD=wd.utcFormat,yZ=wd.utcParse,wd}var wd,rD,xZ,nD,yZ,wZ=Te(()=>{g();x();v();vZ();LT({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})});var PT=Te(()=>{g();x();v();wZ()});function Rwe(e){return new Date(e)}function qwe(e){return e instanceof Date?+e:+new Date(+e)}function iD(e,t,r,n,i,o,u,l,a,s){var f=Gp(),p=f.invert,h=f.domain,y=s(".%L"),b=s(":%S"),w=s("%I:%M"),A=s("%I %p"),S=s("%a %d"),O=s("%b %d"),M=s("%B"),I=s("%Y");function F(C){return(a(C){g();x();v();tD();PT();Pu();bo();yT()});function zT(){return On.apply(iD(TT,OT,Ca,yd,kl,Xp,dd,md,as,nD).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}var bZ=Te(()=>{g();x();v();tD();PT();qT();bo()});function oD(){var e=0,t=1,r,n,i,o,u=Ti,l=!1,a;function s(p){return p==null||isNaN(p=+p)?a:u(i===0?.5:(p=(o(p)-r)*i,l?Math.max(0,Math.min(1,p)):p))}s.domain=function(p){return arguments.length?([e,t]=p,r=o(e=+e),n=o(t=+t),i=r===n?0:1/(n-r),s):[e,t]},s.clamp=function(p){return arguments.length?(l=!!p,s):l},s.interpolator=function(p){return arguments.length?(u=p,s):u};function f(p){return function(h){var y,b;return arguments.length?([y,b]=h,u=p(y,b),s):[u(0),u(1)]}}return s.range=f(Jo),s.rangeRound=f(Xf),s.unknown=function(p){return arguments.length?(a=p,s):a},function(p){return o=p,r=p(e),n=p(t),i=r===n?0:1/(n-r),s}}function Bl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function aD(){var e=Bo(oD()(Ti));return e.copy=function(){return Bl(e,aD())},is.apply(e,arguments)}function UT(){var e=x0(oD()).domain([1,10]);return e.copy=function(){return Bl(e,UT()).base(e.base())},is.apply(e,arguments)}function HT(){var e=y0(oD());return e.copy=function(){return Bl(e,HT()).constant(e.constant())},is.apply(e,arguments)}function sD(){var e=w0(oD());return e.copy=function(){return Bl(e,sD()).exponent(e.exponent())},is.apply(e,arguments)}function DZ(){return sD.apply(null,arguments).exponent(.5)}var $T=Te(()=>{g();x();v();Tl();Pu();bo();Ol();G2();Z2();X2()});function uD(){var e=[],t=Ti;function r(n){if(n!=null&&!isNaN(n=+n))return t((Ys(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(ko),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>v2(e,o/n))},r.copy=function(){return uD(t).domain(e)},is.apply(r,arguments)}var NZ=Te(()=>{g();x();v();ns();Pu();bo()});function lD(){var e=0,t=.5,r=1,n=1,i,o,u,l,a,s=Ti,f,p=!1,h;function y(w){return isNaN(w=+w)?h:(w=.5+((w=+f(w))-o)*(n*w{g();x();v();Tl();Pu();bo();Ol();G2();$T();Z2();X2()});var AZ={};qa(AZ,{scaleBand:()=>l0,scaleDiverging:()=>fD,scaleDivergingLog:()=>WT,scaleDivergingPow:()=>cD,scaleDivergingSqrt:()=>SZ,scaleDivergingSymlog:()=>VT,scaleIdentity:()=>W2,scaleImplicit:()=>y2,scaleLinear:()=>$2,scaleLog:()=>V2,scaleOrdinal:()=>id,scalePoint:()=>gG,scalePow:()=>b0,scaleQuantile:()=>J2,scaleQuantize:()=>Q2,scaleRadial:()=>K2,scaleSequential:()=>aD,scaleSequentialLog:()=>UT,scaleSequentialPow:()=>sD,scaleSequentialQuantile:()=>uD,scaleSequentialSqrt:()=>DZ,scaleSequentialSymlog:()=>HT,scaleSqrt:()=>BY,scaleSymlog:()=>Y2,scaleThreshold:()=>j2,scaleTime:()=>RT,scaleUtc:()=>zT,tickFormat:()=>g0});var CZ=Te(()=>{g();x();v();vG();MY();Ol();G2();Z2();ZM();X2();PY();RY();qY();zY();qT();bZ();$T();NZ();EZ();xT()});function MZ(e){return e}var TZ=Te(()=>{g();x();v()});function zwe(e){return"translate("+e+",0)"}function Uwe(e){return"translate(0,"+e+")"}function Hwe(e){return t=>+e(t)}function $we(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),r=>+e(r)+t}function Wwe(){return!this.__axis}function hD(e,t){var r=[],n=null,i=null,o=6,u=6,l=3,a=typeof window<"u"&&window.devicePixelRatio>1?0:.5,s=e===pD||e===C0?-1:1,f=e===C0||e===mD?"x":"y",p=e===pD||e===GT?zwe:Uwe;function h(y){var b=n??(t.ticks?t.ticks.apply(t,r):t.domain()),w=i??(t.tickFormat?t.tickFormat.apply(t,r):MZ),A=Math.max(o,0)+l,S=t.range(),O=+S[0]+a,M=+S[S.length-1]+a,I=(t.bandwidth?$we:Hwe)(t.copy(),a),F=y.selection?y.selection():y,C=F.selectAll(".domain").data([null]),P=F.selectAll(".tick").data(b,t).order(),R=P.exit(),q=P.enter().append("g").attr("class","tick"),U=P.select("line"),H=P.select("text");C=C.merge(C.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),P=P.merge(q),U=U.merge(q.append("line").attr("stroke","currentColor").attr(f+"2",s*o)),H=H.merge(q.append("text").attr("fill","currentColor").attr(f,s*A).attr("dy",e===pD?"0em":e===GT?"0.71em":"0.32em")),y!==F&&(C=C.transition(y),P=P.transition(y),U=U.transition(y),H=H.transition(y),R=R.transition(y).attr("opacity",OZ).attr("transform",function(V){return isFinite(V=I(V))?p(V+a):this.getAttribute("transform")}),q.attr("opacity",OZ).attr("transform",function(V){var W=this.parentNode.__axis;return p((W&&isFinite(W=W(V))?W:I(V))+a)})),R.remove(),C.attr("d",e===C0||e===mD?u?"M"+s*u+","+O+"H"+a+"V"+M+"H"+s*u:"M"+a+","+O+"V"+M:u?"M"+O+","+s*u+"V"+a+"H"+M+"V"+s*u:"M"+O+","+a+"H"+M),P.attr("opacity",1).attr("transform",function(V){return p(I(V)+a)}),U.attr(f+"2",s*o),H.attr(f,s*A).text(w),F.filter(Wwe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===mD?"start":e===C0?"end":"middle"),F.each(function(){this.__axis=I})}return h.scale=function(y){return arguments.length?(t=y,h):t},h.ticks=function(){return r=Array.from(arguments),h},h.tickArguments=function(y){return arguments.length?(r=y==null?[]:Array.from(y),h):r.slice()},h.tickValues=function(y){return arguments.length?(n=y==null?null:Array.from(y),h):n&&n.slice()},h.tickFormat=function(y){return arguments.length?(i=y,h):i},h.tickSize=function(y){return arguments.length?(o=u=+y,h):o},h.tickSizeInner=function(y){return arguments.length?(o=+y,h):o},h.tickSizeOuter=function(y){return arguments.length?(u=+y,h):u},h.tickPadding=function(y){return arguments.length?(l=+y,h):l},h.offset=function(y){return arguments.length?(a=+y,h):a},h}function IZ(e){return hD(pD,e)}function FZ(e){return hD(mD,e)}function _Z(e){return hD(GT,e)}function kZ(e){return hD(C0,e)}var pD,mD,GT,C0,OZ,BZ=Te(()=>{g();x();v();TZ();pD=1,mD=2,GT=3,C0=4,OZ=1e-6});var LZ={};qa(LZ,{axisBottom:()=>_Z,axisLeft:()=>kZ,axisRight:()=>FZ,axisTop:()=>IZ});var PZ=Te(()=>{g();x();v();BZ()});function qZ(){for(var e=0,t=arguments.length,r={},n;e=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}function Ywe(e,t){for(var r=0,n=e.length,i;r{g();x();v();Vwe={value:()=>{}};dD.prototype=qZ.prototype={constructor:dD,on:function(e,t){var r=this._,n=Gwe(e+"",r),i,o=-1,u=n.length;if(arguments.length<2){for(;++o0)for(var r=new Array(i),n=0,i,o;n{g();x();v();zZ()});var gD,T0,vD=Te(()=>{g();x();v();gD="http://www.w3.org/1999/xhtml",T0={svg:"http://www.w3.org/2000/svg",xhtml:gD,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function qu(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),T0.hasOwnProperty(t)?{space:T0[t],local:e}:e}var xD=Te(()=>{g();x();v();vD()});function Zwe(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===gD&&t.documentElement.namespaceURI===gD?t.createElement(e):t.createElementNS(r,e)}}function Xwe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jf(e){var t=qu(e);return(t.local?Xwe:Zwe)(t)}var O0=Te(()=>{g();x();v();xD();vD()});function Kwe(){}function ec(e){return e==null?Kwe:function(){return this.querySelector(e)}}var yD=Te(()=>{g();x();v()});function UZ(e){typeof e!="function"&&(e=ec(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{g();x();v();ss();yD()});function I0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var ZT=Te(()=>{g();x();v()});function Jwe(){return[]}function bd(e){return e==null?Jwe:function(){return this.querySelectorAll(e)}}var XT=Te(()=>{g();x();v()});function Qwe(e){return function(){return I0(e.apply(this,arguments))}}function $Z(e){typeof e=="function"?e=Qwe(e):e=bd(e);for(var t=this._groups,r=t.length,n=[],i=[],o=0;o{g();x();v();ss();ZT();XT()});function Dd(e){return function(){return this.matches(e)}}function wD(e){return function(t){return t.matches(e)}}var F0=Te(()=>{g();x();v()});function ebe(e){return function(){return jwe.call(this.children,e)}}function tbe(){return this.firstElementChild}function VZ(e){return this.select(e==null?tbe:ebe(typeof e=="function"?e:wD(e)))}var jwe,GZ=Te(()=>{g();x();v();F0();jwe=Array.prototype.find});function nbe(){return Array.from(this.children)}function ibe(e){return function(){return rbe.call(this.children,e)}}function YZ(e){return this.selectAll(e==null?nbe:ibe(typeof e=="function"?e:wD(e)))}var rbe,ZZ=Te(()=>{g();x();v();F0();rbe=Array.prototype.filter});function XZ(e){typeof e!="function"&&(e=Dd(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{g();x();v();ss();F0()});function bD(e){return new Array(e.length)}var KT=Te(()=>{g();x();v()});function JZ(){return new bn(this._enter||this._groups.map(bD),this._parents)}function _0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}var JT=Te(()=>{g();x();v();KT();ss();_0.prototype={constructor:_0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}}});function QZ(e){return function(){return e}}var jZ=Te(()=>{g();x();v()});function obe(e,t,r,n,i,o){for(var u=0,l,a=t.length,s=o.length;u=M&&(M=O+1);!(F=A[M])&&++M{g();x();v();ss();JT();jZ()});function rX(){return new bn(this._exit||this._groups.map(bD),this._parents)}var nX=Te(()=>{g();x();v();KT();ss()});function iX(e,t,r){var n=this.enter(),i=this,o=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?o.remove():r(o),n&&i?n.merge(i).order():i}var oX=Te(()=>{g();x();v()});function aX(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,o=n.length,u=Math.min(i,o),l=new Array(i),a=0;a{g();x();v();ss()});function uX(){for(var e=this._groups,t=-1,r=e.length;++t=0;)(u=n[i])&&(o&&u.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(u,o),o=u);return this}var lX=Te(()=>{g();x();v()});function fX(e){e||(e=lbe);function t(p,h){return p&&h?e(p.__data__,h.__data__):!p-!h}for(var r=this._groups,n=r.length,i=new Array(n),o=0;ot?1:e>=t?0:NaN}var cX=Te(()=>{g();x();v();ss()});function pX(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}var mX=Te(()=>{g();x();v()});function hX(){return Array.from(this)}var dX=Te(()=>{g();x();v()});function gX(){for(var e=this._groups,t=0,r=e.length;t{g();x();v()});function xX(){let e=0;for(let t of this)++e;return e}var yX=Te(()=>{g();x();v()});function wX(){return!this.node()}var bX=Te(()=>{g();x();v()});function DX(e){for(var t=this._groups,r=0,n=t.length;r{g();x();v()});function fbe(e){return function(){this.removeAttribute(e)}}function cbe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pbe(e,t){return function(){this.setAttribute(e,t)}}function mbe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function hbe(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function dbe(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function SX(e,t){var r=qu(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?cbe:fbe:typeof t=="function"?r.local?dbe:hbe:r.local?mbe:pbe)(r,t))}var EX=Te(()=>{g();x();v();xD()});function Nd(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var DD=Te(()=>{g();x();v()});function gbe(e){return function(){this.style.removeProperty(e)}}function vbe(e,t,r){return function(){this.style.setProperty(e,t,r)}}function xbe(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function AX(e,t,r){return arguments.length>1?this.each((t==null?gbe:typeof t=="function"?xbe:vbe)(e,t,r??"")):Ll(this.node(),e)}function Ll(e,t){return e.style.getPropertyValue(t)||Nd(e).getComputedStyle(e,null).getPropertyValue(t)}var QT=Te(()=>{g();x();v();DD()});function ybe(e){return function(){delete this[e]}}function wbe(e,t){return function(){this[e]=t}}function bbe(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function CX(e,t){return arguments.length>1?this.each((t==null?ybe:typeof t=="function"?bbe:wbe)(e,t)):this.node()[e]}var MX=Te(()=>{g();x();v()});function TX(e){return e.trim().split(/^|\s+/)}function jT(e){return e.classList||new OX(e)}function OX(e){this._node=e,this._names=TX(e.getAttribute("class")||"")}function IX(e,t){for(var r=jT(e),n=-1,i=t.length;++n{g();x();v();OX.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}}});function Ebe(){this.textContent=""}function Abe(e){return function(){this.textContent=e}}function Cbe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function BX(e){return arguments.length?this.each(e==null?Ebe:(typeof e=="function"?Cbe:Abe)(e)):this.node().textContent}var LX=Te(()=>{g();x();v()});function Mbe(){this.innerHTML=""}function Tbe(e){return function(){this.innerHTML=e}}function Obe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function PX(e){return arguments.length?this.each(e==null?Mbe:(typeof e=="function"?Obe:Tbe)(e)):this.node().innerHTML}var RX=Te(()=>{g();x();v()});function Ibe(){this.nextSibling&&this.parentNode.appendChild(this)}function qX(){return this.each(Ibe)}var zX=Te(()=>{g();x();v()});function Fbe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UX(){return this.each(Fbe)}var HX=Te(()=>{g();x();v()});function $X(e){var t=typeof e=="function"?e:jf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}var WX=Te(()=>{g();x();v();O0()});function _be(){return null}function VX(e,t){var r=typeof e=="function"?e:jf(e),n=t==null?_be:typeof t=="function"?t:ec(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var GX=Te(()=>{g();x();v();O0();yD()});function kbe(){var e=this.parentNode;e&&e.removeChild(this)}function YX(){return this.each(kbe)}var ZX=Te(()=>{g();x();v()});function Bbe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Lbe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function XX(e){return this.select(e?Lbe:Bbe)}var KX=Te(()=>{g();x();v()});function JX(e){return arguments.length?this.property("__data__",e):this.node().__data__}var QX=Te(()=>{g();x();v()});function Pbe(e){return function(t){e.call(this,t,this.__data__)}}function Rbe(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function qbe(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,o;r{g();x();v()});function tK(e,t,r){var n=Nd(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Ube(e,t){return function(){return tK(this,e,t)}}function Hbe(e,t){return function(){return tK(this,e,t.apply(this,arguments))}}function rK(e,t){return this.each((typeof t=="function"?Hbe:Ube)(e,t))}var nK=Te(()=>{g();x();v();DD()});function*iK(){for(var e=this._groups,t=0,r=e.length;t{g();x();v()});function bn(e,t){this._groups=e,this._parents=t}function aK(){return new bn([[document.documentElement]],k0)}function $be(){return this}var k0,zu,ss=Te(()=>{g();x();v();HZ();WZ();GZ();ZZ();KZ();tX();JT();nX();oX();sX();lX();cX();mX();dX();vX();yX();bX();NX();EX();QT();MX();kX();LX();RX();zX();HX();WX();GX();ZX();KX();QX();eK();nK();oK();k0=[null];bn.prototype=aK.prototype={constructor:bn,select:UZ,selectAll:$Z,selectChild:VZ,selectChildren:YZ,filter:XZ,data:eX,enter:JZ,exit:rX,join:iX,merge:aX,selection:$be,order:uX,sort:fX,call:pX,nodes:hX,node:gX,size:xX,empty:wX,each:DX,attr:SX,style:AX,property:CX,classed:_X,text:BX,html:PX,raise:qX,lower:UX,append:$X,insert:VX,remove:YX,clone:XX,datum:JX,on:jX,dispatch:rK,[Symbol.iterator]:iK};zu=aK});function Ma(e){return typeof e=="string"?new bn([[document.querySelector(e)]],[document.documentElement]):new bn([[e]],k0)}var e3=Te(()=>{g();x();v();ss()});function sK(e){return Ma(jf(e).call(document.documentElement))}var uK=Te(()=>{g();x();v();O0();e3()});function ND(){return new t3}function t3(){this._="@"+(++Wbe).toString(36)}var Wbe,lK=Te(()=>{g();x();v();Wbe=0;t3.prototype=ND.prototype={constructor:t3,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}}});function SD(e){let t;for(;t=e.sourceEvent;)e=t;return e}var r3=Te(()=>{g();x();v()});function us(e,t){if(e=SD(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var n3=Te(()=>{g();x();v();r3()});function fK(e,t){return e.target&&(e=SD(e),t===void 0&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,r=>us(r,t))}var cK=Te(()=>{g();x();v();n3();r3()});function pK(e){return typeof e=="string"?new bn([document.querySelectorAll(e)],[document.documentElement]):new bn([I0(e)],k0)}var mK=Te(()=>{g();x();v();ZT();ss()});var Js={};qa(Js,{create:()=>sK,creator:()=>jf,local:()=>ND,matcher:()=>Dd,namespace:()=>qu,namespaces:()=>T0,pointer:()=>us,pointers:()=>fK,select:()=>Ma,selectAll:()=>pK,selection:()=>zu,selector:()=>ec,selectorAll:()=>bd,style:()=>Ll,window:()=>Nd});var ti=Te(()=>{g();x();v();uK();O0();lK();F0();xD();vD();n3();cK();e3();mK();ss();yD();XT();QT();DD()});function AD(e){e.preventDefault(),e.stopImmediatePropagation()}var ED,hK=Te(()=>{g();x();v();ED={capture:!0,passive:!1}});function i3(e){var t=e.document.documentElement,r=Ma(e).on("dragstart.drag",AD,ED);"onselectstart"in t?r.on("selectstart.drag",AD,ED):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function o3(e,t){var r=e.document.documentElement,n=Ma(e).on("dragstart.drag",null);t&&(n.on("click.drag",AD,ED),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}var dK=Te(()=>{g();x();v();ti();hK()});var gK=Te(()=>{g();x();v();dK()});function z0(){return Qp||(yK(Vbe),Qp=R0.now()+TD)}function Vbe(){Qp=0}function q0(){this._call=this._time=this._next=null}function OD(e,t,r){var n=new q0;return n.restart(e,t,r),n}function wK(){z0(),++Sd;for(var e=CD,t;e;)(t=Qp-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Sd}function vK(){Qp=(MD=R0.now())+TD,Sd=L0=0;try{wK()}finally{Sd=0,Ybe(),Qp=0}}function Gbe(){var e=R0.now(),t=e-MD;t>xK&&(TD-=t,MD=e)}function Ybe(){for(var e,t=CD,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:CD=r);P0=e,a3(n)}function a3(e){if(!Sd){L0&&(L0=clearTimeout(L0));var t=e-Qp;t>24?(e<1/0&&(L0=setTimeout(vK,e-R0.now()-TD)),B0&&(B0=clearInterval(B0))):(B0||(MD=R0.now(),B0=setInterval(Gbe,xK)),Sd=1,yK(vK))}}var Sd,L0,B0,xK,CD,P0,MD,Qp,TD,R0,yK,s3=Te(()=>{g();x();v();Sd=0,L0=0,B0=0,xK=1e3,MD=0,Qp=0,TD=0,R0=typeof performance=="object"&&performance.now?performance:Date,yK=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};q0.prototype=OD.prototype={constructor:q0,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?z0():+r)+(t==null?0:+t),!this._next&&P0!==this&&(P0?P0._next=this:CD=this,P0=this),this._call=e,this._time=r,a3()},stop:function(){this._call&&(this._call=null,this._time=1/0,a3())}}});function ID(e,t,r){var n=new q0;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var bK=Te(()=>{g();x();v();s3()});var u3=Te(()=>{g();x();v();s3();bK()});function tc(e,t,r,n,i,o){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;Kbe(e,r,{name:t,index:n,group:i,on:Zbe,tween:Xbe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:SK})}function H0(e,t){var r=Oi(e,t);if(r.state>SK)throw new Error("too late; already scheduled");return r}function io(e,t){var r=Oi(e,t);if(r.state>FD)throw new Error("too late; already running");return r}function Oi(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Kbe(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=OD(o,0,r.time);function o(s){r.state=DK,r.timer.restart(u,r.delay,r.time),r.delay<=s&&u(s-r.delay)}function u(s){var f,p,h,y;if(r.state!==DK)return a();for(f in n)if(y=n[f],y.name===r.name){if(y.state===FD)return ID(u);y.state===NK?(y.state=U0,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete n[f]):+f{g();x();v();YT();u3();Zbe=M0("start","end","cancel","interrupt"),Xbe=[],SK=0,DK=1,_D=2,FD=3,NK=4,kD=5,U0=6});function jp(e,t){var r=e.__transition,n,i,o=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((n=r[u]).name!==t){o=!1;continue}i=n.state>_D&&n.state{g();x();v();Qo()});function EK(e){return this.each(function(){jp(this,e)})}var AK=Te(()=>{g();x();v();l3()});function Jbe(e,t){var r,n;return function(){var i=io(this,e),o=i.tween;if(o!==r){n=r=o;for(var u=0,l=n.length;u{g();x();v();Qo()});function BD(e,t){var r;return(typeof t=="number"?Hi:t instanceof os?Zf:(r=os(t))?(t=r,Zf):cd)(e,t)}var f3=Te(()=>{g();x();v();Ks();Tl()});function jbe(e){return function(){this.removeAttribute(e)}}function e2e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function t2e(e,t,r){var n,i=r+"",o;return function(){var u=this.getAttribute(e);return u===i?null:u===n?o:o=t(n=u,r)}}function r2e(e,t,r){var n,i=r+"",o;return function(){var u=this.getAttributeNS(e.space,e.local);return u===i?null:u===n?o:o=t(n=u,r)}}function n2e(e,t,r){var n,i,o;return function(){var u,l=r(this),a;return l==null?void this.removeAttribute(e):(u=this.getAttribute(e),a=l+"",u===a?null:u===n&&a===i?o:(i=a,o=t(n=u,l)))}}function i2e(e,t,r){var n,i,o;return function(){var u,l=r(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),a=l+"",u===a?null:u===n&&a===i?o:(i=a,o=t(n=u,l)))}}function MK(e,t){var r=qu(e),n=r==="transform"?z2:BD;return this.attrTween(e,typeof t=="function"?(r.local?i2e:n2e)(r,n,Ed(this,"attr."+e,t)):t==null?(r.local?e2e:jbe)(r):(r.local?r2e:t2e)(r,n,t))}var TK=Te(()=>{g();x();v();Tl();ti();$0();f3()});function o2e(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function a2e(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function s2e(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&a2e(e,o)),r}return i._value=t,i}function u2e(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&o2e(e,o)),r}return i._value=t,i}function OK(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=qu(e);return this.tween(r,(n.local?s2e:u2e)(n,t))}var IK=Te(()=>{g();x();v();ti()});function l2e(e,t){return function(){H0(this,e).delay=+t.apply(this,arguments)}}function f2e(e,t){return t=+t,function(){H0(this,e).delay=t}}function FK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?l2e:f2e)(t,e)):Oi(this.node(),t).delay}var _K=Te(()=>{g();x();v();Qo()});function c2e(e,t){return function(){io(this,e).duration=+t.apply(this,arguments)}}function p2e(e,t){return t=+t,function(){io(this,e).duration=t}}function kK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?c2e:p2e)(t,e)):Oi(this.node(),t).duration}var BK=Te(()=>{g();x();v();Qo()});function m2e(e,t){if(typeof t!="function")throw new Error;return function(){io(this,e).ease=t}}function LK(e){var t=this._id;return arguments.length?this.each(m2e(t,e)):Oi(this.node(),t).ease}var PK=Te(()=>{g();x();v();Qo()});function h2e(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;io(this,e).ease=r}}function RK(e){if(typeof e!="function")throw new Error;return this.each(h2e(this._id,e))}var qK=Te(()=>{g();x();v();Qo()});function zK(e){typeof e!="function"&&(e=Dd(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i{g();x();v();ti();em()});function HK(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,o=Math.min(n,i),u=new Array(n),l=0;l{g();x();v();em()});function d2e(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function g2e(e,t,r){var n,i,o=d2e(t)?H0:io;return function(){var u=o(this,e),l=u.on;l!==n&&(i=(n=l).copy()).on(t,r),u.on=i}}function WK(e,t){var r=this._id;return arguments.length<2?Oi(this.node(),r).on.on(e):this.each(g2e(r,e,t))}var VK=Te(()=>{g();x();v();Qo()});function v2e(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function GK(){return this.on("end.remove",v2e(this._id))}var YK=Te(()=>{g();x();v()});function ZK(e){var t=this._name,r=this._id;typeof e!="function"&&(e=ec(e));for(var n=this._groups,i=n.length,o=new Array(i),u=0;u{g();x();v();ti();em();Qo()});function KK(e){var t=this._name,r=this._id;typeof e!="function"&&(e=bd(e));for(var n=this._groups,i=n.length,o=[],u=[],l=0;l{g();x();v();ti();em();Qo()});function QK(){return new x2e(this._groups,this._parents)}var x2e,jK=Te(()=>{g();x();v();ti();x2e=zu.prototype.constructor});function y2e(e,t){var r,n,i;return function(){var o=Ll(this,e),u=(this.style.removeProperty(e),Ll(this,e));return o===u?null:o===r&&u===n?i:i=t(r=o,n=u)}}function eJ(e){return function(){this.style.removeProperty(e)}}function w2e(e,t,r){var n,i=r+"",o;return function(){var u=Ll(this,e);return u===i?null:u===n?o:o=t(n=u,r)}}function b2e(e,t,r){var n,i,o;return function(){var u=Ll(this,e),l=r(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Ll(this,e))),u===a?null:u===n&&a===i?o:(i=a,o=t(n=u,l))}}function D2e(e,t){var r,n,i,o="style."+t,u="end."+o,l;return function(){var a=io(this,e),s=a.on,f=a.value[o]==null?l||(l=eJ(t)):void 0;(s!==r||i!==f)&&(n=(r=s).copy()).on(u,i=f),a.on=n}}function tJ(e,t,r){var n=(e+="")=="transform"?q2:BD;return t==null?this.styleTween(e,y2e(e,n)).on("end.style."+e,eJ(e)):typeof t=="function"?this.styleTween(e,b2e(e,n,Ed(this,"style."+e,t))).each(D2e(this._id,e)):this.styleTween(e,w2e(e,n,t),r).on("end.style."+e,null)}var rJ=Te(()=>{g();x();v();Tl();ti();Qo();$0();f3()});function N2e(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function S2e(e,t,r){var n,i;function o(){var u=t.apply(this,arguments);return u!==i&&(n=(i=u)&&N2e(e,u,r)),n}return o._value=t,o}function nJ(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,S2e(e,t,r??""))}var iJ=Te(()=>{g();x();v()});function E2e(e){return function(){this.textContent=e}}function A2e(e){return function(){var t=e(this);this.textContent=t??""}}function oJ(e){return this.tween("text",typeof e=="function"?A2e(Ed(this,"text",e)):E2e(e==null?"":e+""))}var aJ=Te(()=>{g();x();v();$0()});function C2e(e){return function(t){this.textContent=e.call(this,t)}}function M2e(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&C2e(i)),t}return n._value=e,n}function sJ(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,M2e(e))}var uJ=Te(()=>{g();x();v()});function lJ(){for(var e=this._name,t=this._id,r=LD(),n=this._groups,i=n.length,o=0;o{g();x();v();em();Qo()});function cJ(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(o,u){var l={value:u},a={value:function(){--i===0&&o()}};r.each(function(){var s=io(this,n),f=s.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),s.on=t}),i===0&&o()})}var pJ=Te(()=>{g();x();v();Qo()});function Lo(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function mJ(e){return zu().transition(e)}function LD(){return++T2e}var T2e,Pl,em=Te(()=>{g();x();v();ti();TK();IK();_K();BK();PK();qK();UK();$K();VK();YK();XK();JK();jK();rJ();iJ();aJ();uJ();fJ();$0();pJ();T2e=0;Pl=zu.prototype;Lo.prototype=mJ.prototype={constructor:Lo,select:ZK,selectAll:KK,selectChild:Pl.selectChild,selectChildren:Pl.selectChildren,filter:zK,merge:HK,selection:QK,transition:lJ,call:Pl.call,nodes:Pl.nodes,node:Pl.node,size:Pl.size,empty:Pl.empty,each:Pl.each,on:WK,attr:MK,attrTween:OK,style:tJ,styleTween:nJ,text:oJ,textTween:sJ,remove:GK,tween:CK,delay:FK,duration:kK,ease:LK,easeVarying:RK,end:cJ,[Symbol.iterator]:Pl[Symbol.iterator]}});function PD(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var hJ=Te(()=>{g();x();v()});var dJ=Te(()=>{g();x();v();hJ()});function I2e(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function gJ(e){var t,r;e instanceof Lo?(t=e._id,e=e._name):(t=LD(),(r=O2e).time=z0(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,o=0;o{g();x();v();em();Qo();dJ();u3();O2e={time:null,delay:0,duration:250,ease:PD}});var xJ=Te(()=>{g();x();v();ti();AK();vJ();zu.prototype.interrupt=EK;zu.prototype.transition=gJ});var yJ=Te(()=>{g();x();v();xJ();l3()});var W0,wJ=Te(()=>{g();x();v();W0=e=>()=>e});function c3(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}var bJ=Te(()=>{g();x();v()});function ls(e,t,r){this.k=e,this.x=t,this.y=r}function RD(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ad;return e.__zoom}var Ad,p3=Te(()=>{g();x();v();ls.prototype={constructor:ls,scale:function(e){return e===1?this:new ls(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ls(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Ad=new ls(1,0,0);RD.prototype=ls.prototype});function qD(e){e.stopImmediatePropagation()}function Cd(e){e.preventDefault(),e.stopImmediatePropagation()}var DJ=Te(()=>{g();x();v()});function F2e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function _2e(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function NJ(){return this.__zoom||Ad}function k2e(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function B2e(){return navigator.maxTouchPoints||"ontouchstart"in this}function L2e(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],o=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}function SJ(){var e=F2e,t=_2e,r=L2e,n=k2e,i=B2e,o=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],l=250,a=U2,s=M0("start","zoom","end"),f,p,h,y=500,b=150,w=0,A=10;function S(ee){ee.property("__zoom",NJ).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",U).filter(i).on("touchstart.zoom",H).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(ee,ie,Y,Z){var le=ee.selection?ee.selection():ee;le.property("__zoom",NJ),ee!==le?F(ee,ie,Y,Z):le.interrupt().each(function(){C(this,arguments).event(Z).start().zoom(null,typeof ie=="function"?ie.apply(this,arguments):ie).end()})},S.scaleBy=function(ee,ie,Y,Z){S.scaleTo(ee,function(){var le=this.__zoom.k,re=typeof ie=="function"?ie.apply(this,arguments):ie;return le*re},Y,Z)},S.scaleTo=function(ee,ie,Y,Z){S.transform(ee,function(){var le=t.apply(this,arguments),re=this.__zoom,he=Y==null?I(le):typeof Y=="function"?Y.apply(this,arguments):Y,De=re.invert(he),we=typeof ie=="function"?ie.apply(this,arguments):ie;return r(M(O(re,we),he,De),le,u)},Y,Z)},S.translateBy=function(ee,ie,Y,Z){S.transform(ee,function(){return r(this.__zoom.translate(typeof ie=="function"?ie.apply(this,arguments):ie,typeof Y=="function"?Y.apply(this,arguments):Y),t.apply(this,arguments),u)},null,Z)},S.translateTo=function(ee,ie,Y,Z,le){S.transform(ee,function(){var re=t.apply(this,arguments),he=this.__zoom,De=Z==null?I(re):typeof Z=="function"?Z.apply(this,arguments):Z;return r(Ad.translate(De[0],De[1]).scale(he.k).translate(typeof ie=="function"?-ie.apply(this,arguments):-ie,typeof Y=="function"?-Y.apply(this,arguments):-Y),re,u)},Z,le)};function O(ee,ie){return ie=Math.max(o[0],Math.min(o[1],ie)),ie===ee.k?ee:new ls(ie,ee.x,ee.y)}function M(ee,ie,Y){var Z=ie[0]-Y[0]*ee.k,le=ie[1]-Y[1]*ee.k;return Z===ee.x&&le===ee.y?ee:new ls(ee.k,Z,le)}function I(ee){return[(+ee[0][0]+ +ee[1][0])/2,(+ee[0][1]+ +ee[1][1])/2]}function F(ee,ie,Y,Z){ee.on("start.zoom",function(){C(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(Z).end()}).tween("zoom",function(){var le=this,re=arguments,he=C(le,re).event(Z),De=t.apply(le,re),we=Y==null?I(De):typeof Y=="function"?Y.apply(le,re):Y,ce=Math.max(De[1][0]-De[0][0],De[1][1]-De[0][1]),Se=le.__zoom,Pe=typeof ie=="function"?ie.apply(le,re):ie,Ce=a(Se.invert(we).concat(ce/Se.k),Pe.invert(we).concat(ce/Pe.k));return function(Oe){if(Oe===1)Oe=Pe;else{var He=Ce(Oe),Ee=ce/He[2];Oe=new ls(Ee,we[0]-He[0]*Ee,we[1]-He[1]*Ee)}he.zoom(null,Oe)}})}function C(ee,ie,Y){return!Y&&ee.__zooming||new P(ee,ie)}function P(ee,ie){this.that=ee,this.args=ie,this.active=0,this.sourceEvent=null,this.extent=t.apply(ee,ie),this.taps=0}P.prototype={event:function(ee){return ee&&(this.sourceEvent=ee),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(ee,ie){return this.mouse&&ee!=="mouse"&&(this.mouse[1]=ie.invert(this.mouse[0])),this.touch0&&ee!=="touch"&&(this.touch0[1]=ie.invert(this.touch0[0])),this.touch1&&ee!=="touch"&&(this.touch1[1]=ie.invert(this.touch1[0])),this.that.__zoom=ie,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(ee){var ie=Ma(this.that).datum();s.call(ee,this.that,new c3(ee,{sourceEvent:this.sourceEvent,target:S,type:ee,transform:this.that.__zoom,dispatch:s}),ie)}};function R(ee,...ie){if(!e.apply(this,arguments))return;var Y=C(this,ie).event(ee),Z=this.__zoom,le=Math.max(o[0],Math.min(o[1],Z.k*Math.pow(2,n.apply(this,arguments)))),re=us(ee);if(Y.wheel)(Y.mouse[0][0]!==re[0]||Y.mouse[0][1]!==re[1])&&(Y.mouse[1]=Z.invert(Y.mouse[0]=re)),clearTimeout(Y.wheel);else{if(Z.k===le)return;Y.mouse=[re,Z.invert(re)],jp(this),Y.start()}Cd(ee),Y.wheel=setTimeout(he,b),Y.zoom("mouse",r(M(O(Z,le),Y.mouse[0],Y.mouse[1]),Y.extent,u));function he(){Y.wheel=null,Y.end()}}function q(ee,...ie){if(h||!e.apply(this,arguments))return;var Y=ee.currentTarget,Z=C(this,ie,!0).event(ee),le=Ma(ee.view).on("mousemove.zoom",we,!0).on("mouseup.zoom",ce,!0),re=us(ee,Y),he=ee.clientX,De=ee.clientY;i3(ee.view),qD(ee),Z.mouse=[re,this.__zoom.invert(re)],jp(this),Z.start();function we(Se){if(Cd(Se),!Z.moved){var Pe=Se.clientX-he,Ce=Se.clientY-De;Z.moved=Pe*Pe+Ce*Ce>w}Z.event(Se).zoom("mouse",r(M(Z.that.__zoom,Z.mouse[0]=us(Se,Y),Z.mouse[1]),Z.extent,u))}function ce(Se){le.on("mousemove.zoom mouseup.zoom",null),o3(Se.view,Z.moved),Cd(Se),Z.event(Se).end()}}function U(ee,...ie){if(e.apply(this,arguments)){var Y=this.__zoom,Z=us(ee.changedTouches?ee.changedTouches[0]:ee,this),le=Y.invert(Z),re=Y.k*(ee.shiftKey?.5:2),he=r(M(O(Y,re),Z,le),t.apply(this,ie),u);Cd(ee),l>0?Ma(this).transition().duration(l).call(F,he,Z,ee):Ma(this).call(S.transform,he,Z,ee)}}function H(ee,...ie){if(e.apply(this,arguments)){var Y=ee.touches,Z=Y.length,le=C(this,ie,ee.changedTouches.length===Z).event(ee),re,he,De,we;for(qD(ee),he=0;he{g();x();v();YT();gK();Tl();ti();yJ();wJ();bJ();p3();DJ()});var AJ={};qa(AJ,{ZoomTransform:()=>ls,zoom:()=>SJ,zoomIdentity:()=>Ad,zoomTransform:()=>RD});var CJ=Te(()=>{g();x();v();EJ();p3()});function on(){on.init.call(this)}function zD(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function PJ(e){return e._maxListeners===void 0?on.defaultMaxListeners:e._maxListeners}function IJ(e,t,r,n){var i,o,u,l;if(zD(r),(o=e._events)===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),u=o[t]),u===void 0)u=o[t]=r,++e._eventsCount;else if(typeof u=="function"?u=o[t]=n?[r,u]:[u,r]:n?u.unshift(r):u.push(r),(i=PJ(e))>0&&u.length>i&&!u.warned){u.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=u.length,l=a,console&&console.warn&&console.warn(l)}return e}function P2e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function FJ(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=P2e.bind(n);return i.listener=r,n.wrapFn=i,i}function _J(e,t,r){var n=e._events;if(n===void 0)return[];var i=n[t];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?function(o){for(var u=new Array(o.length),l=0;l{g();x();v();Md=typeof Reflect=="object"?Reflect:null,MJ=Md&&typeof Md.apply=="function"?Md.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};LJ=Md&&typeof Md.ownKeys=="function"?Md.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};TJ=Number.isNaN||function(e){return e!=e};BJ=on,on.EventEmitter=on,on.prototype._events=void 0,on.prototype._eventsCount=0,on.prototype._maxListeners=void 0;OJ=10;Object.defineProperty(on,"defaultMaxListeners",{enumerable:!0,get:function(){return OJ},set:function(e){if(typeof e!="number"||e<0||TJ(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");OJ=e}}),on.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},on.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||TJ(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},on.prototype.getMaxListeners=function(){return PJ(this)},on.prototype.emit=function(e){for(var t=[],r=1;r0&&(o=t[0]),o instanceof Error)throw o;var u=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw u.context=o,u}var l=i[e];if(l===void 0)return!1;if(typeof l=="function")MJ(l,this,t);else{var a=l.length,s=RJ(l,a);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){u=r[o].listener,i=o;break}if(i<0)return this;i===0?r.shift():function(l,a){for(;a+1=0;n--)this.removeListener(e,t[n]);return this},on.prototype.listeners=function(e){return _J(this,e,!0)},on.prototype.rawListeners=function(e){return _J(this,e,!1)},on.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):kJ.call(e,t)},on.prototype.listenerCount=kJ,on.prototype.eventNames=function(){return this._eventsCount>0?LJ(this._events):[]};jo=BJ;jo.EventEmitter;jo.defaultMaxListeners;jo.init;jo.listenerCount;jo.EventEmitter;jo.defaultMaxListeners;jo.init;jo.listenerCount});var qJ={};qa(qJ,{EventEmitter:()=>R2e,default:()=>jo,defaultMaxListeners:()=>q2e,init:()=>z2e,listenerCount:()=>U2e,on:()=>H2e,once:()=>$2e});var R2e,q2e,z2e,U2e,H2e,$2e,zJ=Te(()=>{g();x();v();m3();m3();jo.once=function(e,t){return new Promise((r,n)=>{function i(...u){o!==void 0&&e.removeListener("error",o),r(u)}let o;t!=="error"&&(o=u=>{e.removeListener(name,i),n(u)},e.once("error",o)),e.once(t,i)})};jo.on=function(e,t){let r=[],n=[],i=null,o=!1,u={async next(){let s=r.shift();if(s)return createIterResult(s,!1);if(i){let f=Promise.reject(i);return i=null,f}return o?createIterResult(void 0,!0):new Promise((f,p)=>n.push({resolve:f,reject:p}))},async return(){e.removeListener(t,l),e.removeListener("error",a),o=!0;for(let s of n)s.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(s){i=s,e.removeListener(t,l),e.removeListener("error",a)},[Symbol.asyncIterator](){return this}};return e.on(t,l),e.on("error",a),u;function l(...s){let f=n.shift();f?f.resolve(createIterResult(s,!1)):r.push(s)}function a(s){o=!0;let f=n.shift();f?f.reject(s):i=s,u.return()}};({EventEmitter:R2e,defaultMaxListeners:q2e,init:z2e,listenerCount:U2e,on:H2e,once:$2e}=jo)});var UJ=vt(h3=>{"use strict";g();x();v();Object.defineProperty(h3,"__esModule",{value:!0});var W2e=(e0(),Cn(jv)),V2e=(ti(),Cn(Js));function G2e(e){let t=e.owner.meta.xScale,r=e.owner.meta.yScale,n=(0,W2e.line)().x(function(i){return i[0]}).y(function(i){return i[1]});return function(i){i.each(function(){let u=(0,V2e.select)(this).selectAll("g.annotations").data(function(h){return h.annotations||[]}),l=u.enter().append("g").attr("class","annotations"),a=r.range(),s=t.range(),f=u.merge(l).selectAll("path").data(function(h){return"x"in h?[[[0,a[0]],[0,a[1]]]]:[[[s[0],0],[s[1],0]]]});f.enter().append("path").attr("stroke","#eee").attr("d",n),f.exit().remove();let p=u.merge(l).selectAll("text").data(function(h){return[{text:h.text||"",hasX:"x"in h}]});p.enter().append("text").attr("y",function(h){return h.hasX?3:0}).attr("x",function(h){return h.hasX?0:3}).attr("dy",function(h){return h.hasX?5:-5}).attr("text-anchor",function(h){return h.hasX?"end":""}).attr("transform",function(h){return h.hasX?"rotate(-90)":""}).text(function(h){return h.text}),p.exit().remove(),u.merge(l).attr("transform",function(h){return"x"in h?"translate("+t(h.x)+", 0)":"translate(0, "+r(h.y)+")"}),u.exit().remove()})}}h3.default=G2e});var Td=vt(G0=>{"use strict";g();x();v();Object.defineProperty(G0,"__esModule",{value:!0});G0.registerGraphType=void 0;var Y2e=(Ks(),Cn(T2)),V0={COLORS:["steelblue","red","#05b378","orange","#4040e8","yellow","brown","magenta","cyan"].map(function(e){return(0,Y2e.hsl)(e)}),DEFAULT_WIDTH:550,DEFAULT_HEIGHT:350,DEFAULT_ITERATIONS:null,TIP_X_EPS:1,MAX_ITERATIONS:0,graphTypes:{}};V0.MAX_ITERATIONS=V0.DEFAULT_WIDTH*10;function Z2e(e,t){if(Object.hasOwn(V0.graphTypes,e))throw new Error(`registerGraphType: graphType ${e} is already registered.`);V0.graphTypes[e]=t}G0.registerGraphType=Z2e;G0.default=V0});var Uu=vt(Y0=>{"use strict";g();x();v();var X2e=Y0&&Y0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Y0,"__esModule",{value:!0});var HJ=X2e(Td()),K2e={linspace:function(e,t,r){let n=(t-e)/(r-1);return Array.from({length:r},(i,o)=>e+n*o)},logspace:function(e,t,r){return this.linspace(e,t,r).map(n=>Math.pow(10,n))},isValidNumber:function(e){return typeof e=="number"&&!isNaN(e)},space:function(e,t,r){let n=t[0],i=t[1];return e.type==="log"?this.logspace(Math.log10(n),Math.log10(i),r):this.linspace(n,i,r)},getterSetter:function(e,t){let r=this;this[t]=function(n){return arguments.length?(e[t]=n,r):e[t]}},sgn:function(e){return e<0?-1:e>0?1:0},clamp:function(e,t,r){return er?r:e},color:function(e,t){let r=t%HJ.default.COLORS.length;return e.color||HJ.default.COLORS[r].hex()},infinity:function(){return 9007199254740991}};Y0.default=K2e});var d3=vt((Fvr,$J)=>{g();x();v();$J.exports={EOF:0,DELIMITER:1,NUMBER:2,STRING:3,SYMBOL:4}});var v3=vt((Lvr,VJ)=>{g();x();v();var tm=d3(),J2e={n:` +`,f:"\f",r:"\r",t:" ",v:"\v","'":"'",'"':'"'},Q2e={",":!0,"(":!0,")":!0,"[":!0,"]":!0,";":!0,"~":!0,"!":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0,"^":!0,"**":!0,"|":!0,"&":!0,"^|":!0,"=":!0,":":!0,"?":!0,"||":!0,"&&":!0,xor:!0,"==":!0,"!=":!0,"===":!0,"!==":!0,"<":!0,">":!0,">=":!0,"<=":!0,">>>":!0,"<<":!0,">>":!0};function Rl(e){return e>="0"&&e<="9"}function WJ(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"}function j2e(e){return e===" "||e==="\r"||e===" "||e===` +`||e==="\v"||e==="\xA0"}function g3(e){return Q2e[e]}function eDe(e){return e==="'"||e==='"'}function rc(){}rc.prototype.throwError=function(e,t){t=typeof t>"u"?this.index:t;var r=new Error(e+" at index "+t);throw r.index=t,r.description=e,r};rc.prototype.lex=function(e){for(this.text=e,this.index=0,this.tokens=[];this.index=this.text.length))return this.text.charAt(this.index+e)};rc.prototype.consume=function(){var e=this.peek();return this.index+=1,e};rc.prototype.readNumber=function(){var e="";if(this.peek()===".")e+=this.consume(),Rl(this.peek())||this.throwError("number expected");else{for(;Rl(this.peek());)e+=this.consume();this.peek()==="."&&(e+=this.consume())}for(;Rl(this.peek());)e+=this.consume();if(this.peek()==="e"||this.peek()==="E")for(e+=this.consume(),Rl(this.peek())||this.peek()==="+"||this.peek()==="-"||this.throwError(),(this.peek()==="+"||this.peek()==="-")&&(e+=this.consume()),Rl(this.peek())||this.throwError("number expected");Rl(this.peek());)e+=this.consume();return e};rc.prototype.readIdentifier=function(){for(var e="";WJ(this.peek())||Rl(this.peek());)e+=this.consume();return e};rc.prototype.readString=function(){for(var e=this.consume(),t="",r;;){var n=this.consume();if(n||this.throwError("string is not closed"),r){if(n==="u"){var i=this.text.substring(this.index+1,this.index+5);i.match(/[\da-f]{4}/i)||this.throwError("invalid unicode escape"),this.index+=4,t+=String.fromCharCode(parseInt(i,16))}else{var o=J2e[n];o?t+=o:t+=n}r=!1}else{if(n===e)break;n==="\\"?r=!0:t+=n}}return t};VJ.exports=rc});var Qs=vt((zvr,YJ)=>{g();x();v();function GJ(){}GJ.prototype.type="Node";YJ.exports=GJ});var y3=vt((Wvr,ZJ)=>{g();x();v();var tDe=Qs(),rDe={number:!0,string:!0,boolean:!0,undefined:!0,null:!0};function x3(e,t){if(!rDe[t])throw Error("unsupported type '"+t+"'");this.value=e,this.valueType=t}x3.prototype=Object.create(tDe.prototype);x3.prototype.type="ConstantNode";ZJ.exports=x3});var b3=vt((Zvr,XJ)=>{g();x();v();var nDe=Qs();function w3(e,t){this.op=e,this.args=t||[]}w3.prototype=Object.create(nDe.prototype);w3.prototype.type="OperatorNode";XJ.exports=w3});var N3=vt((Qvr,KJ)=>{g();x();v();var iDe=Qs();function D3(e,t){this.op=e,this.argument=t}D3.prototype=Object.create(iDe.prototype);D3.prototype.type="UnaryNode";KJ.exports=D3});var E3=vt((r0r,JJ)=>{g();x();v();var oDe=Qs();function S3(e){this.name=e}S3.prototype=Object.create(oDe.prototype);S3.prototype.type="SymbolNode";JJ.exports=S3});var C3=vt((a0r,QJ)=>{g();x();v();var aDe=Qs();function A3(e,t){this.name=e,this.args=t}A3.prototype=Object.create(aDe.prototype);A3.prototype.type="FunctionNode";QJ.exports=A3});var T3=vt((f0r,jJ)=>{g();x();v();var sDe=Qs();function M3(e){this.nodes=e}M3.prototype=Object.create(sDe.prototype);M3.prototype.type="ArrayNode";jJ.exports=M3});var I3=vt((h0r,eQ)=>{g();x();v();var uDe=Qs();function O3(e,t,r){this.condition=e,this.trueExpr=t,this.falseExpr=r}O3.prototype=Object.create(uDe.prototype);O3.prototype.type="ConditionalNode";eQ.exports=O3});var _3=vt((x0r,tQ)=>{g();x();v();var lDe=Qs();function F3(e,t){this.name=e,this.expr=t}F3.prototype=Object.create(lDe.prototype);F3.prototype.type="AssignmentNode";tQ.exports=F3});var B3=vt((D0r,rQ)=>{g();x();v();var fDe=Qs();function k3(e){this.blocks=e}k3.prototype=Object.create(fDe.prototype);k3.prototype.type="BlockNode";rQ.exports=k3});var oQ=vt((A0r,iQ)=>{g();x();v();var rm=d3(),cDe=v3(),L3=y3(),Ta=b3(),pDe=N3(),nQ=E3(),mDe=C3(),hDe=T3(),dDe=I3(),gDe=_3(),vDe=B3();function Vr(){this.lexer=new cDe,this.tokens=null}Vr.prototype.current=function(){return this.tokens[0]};Vr.prototype.next=function(){return this.tokens[1]};Vr.prototype.peek=function(){if(this.tokens.length){for(var e=this.tokens[0],t=0;t=","<=",">","<")){var t=this.consume(),r=this.shift();return new Ta(t.value,[e,r])}return e};Vr.prototype.shift=function(){var e=this.additive();if(this.peek(">>","<<",">>>")){var t=this.consume(),r=this.shift();return new Ta(t.value,[e,r])}return e};Vr.prototype.additive=function(){for(var e=this.multiplicative();this.peek("+","-");){var t=this.consume();e=new Ta(t.value,[e,this.multiplicative()])}return e};Vr.prototype.multiplicative=function(){for(var e,t,r=this.unary();this.peek("*","/","%");)e=this.consume(),r=new Ta(e.value,[r,this.unary()]);return this.current().type===rm.SYMBOL||this.peek("(")||!(r.type instanceof L3)&&this.current().type===rm.NUMBER?(t=this.multiplicative(),new Ta("*",[r,t])):r};Vr.prototype.unary=function(){if(this.peek("-","+","~")){var e=this.consume(),t=this.unary();return new pDe(e.value,t)}return this.pow()};Vr.prototype.pow=function(){var e=this.factorial();if(this.peek("^","**")){var t=this.consume(),r=this.unary();return new Ta(t.value,[e,r])}return e};Vr.prototype.factorial=function(){var e=this.symbol();if(this.peek("!")){var t=this.consume();return new Ta(t.value,[e])}return e};Vr.prototype.symbol=function(){var e=this.current();if(e.type===rm.SYMBOL){var t=this.consume(),r=this.functionCall(t);return r}return this.string()};Vr.prototype.functionCall=function(e){var t=e.value;if(this.peek("(")){this.consume();for(var r=[];!this.peek(")")&&!this.isEOF();)r.push(this.assignment()),this.peek(",")&&this.consume();return this.expect(")"),new mDe(t,r)}return new nQ(t)};Vr.prototype.string=function(){return this.current().type===rm.STRING?new L3(this.consume().value,"string"):this.array()};Vr.prototype.array=function(){if(this.peek("[")){this.consume();for(var e=[];!this.peek("]")&&!this.isEOF();)e.push(this.assignment()),this.peek(",")&&this.consume();return this.expect("]"),new hDe(e)}return this.number()};Vr.prototype.number=function(){var e=this.current();return e.type===rm.NUMBER?new L3(this.consume().value,"number"):this.parentheses()};Vr.prototype.parentheses=function(){var e=this.current();if(e.value==="("){this.consume();var t=this.assignment();return this.expect(")"),t}return this.end()};Vr.prototype.end=function(){var e=this.current();if(e.type!==rm.EOF)throw Error("unexpected end of expression")};iQ.exports=Vr});var sQ=vt((O0r,aQ)=>{g();x();v();aQ.exports={ArrayNode:T3(),AssignmentNode:_3(),BlockNode:B3(),ConditionalNode:I3(),ConstantNode:y3(),FunctionNode:C3(),Node:Qs(),OperatorNode:b3(),SymbolNode:E3(),UnaryNode:N3()}});var Z0=vt((k0r,UD)=>{"use strict";g();x();v();UD.exports.Lexer=v3();UD.exports.Parser=oQ();UD.exports.nodeTypes=sQ()});var X0=vt((R0r,dQ)=>{"use strict";g();x();v();var HD=Object.prototype.hasOwnProperty,hQ=Object.prototype.toString,uQ=Object.defineProperty,lQ=Object.getOwnPropertyDescriptor,fQ=function(t){return typeof Array.isArray=="function"?Array.isArray(t):hQ.call(t)==="[object Array]"},cQ=function(t){if(!t||hQ.call(t)!=="[object Object]")return!1;var r=HD.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&HD.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||HD.call(t,i)},pQ=function(t,r){uQ&&r.name==="__proto__"?uQ(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},mQ=function(t,r){if(r==="__proto__")if(HD.call(t,r)){if(lQ)return lQ(t,r).value}else return;return t[r]};dQ.exports=function e(){var t,r,n,i,o,u,l=arguments[0],a=1,s=arguments.length,f=!1;for(typeof l=="boolean"&&(f=l,l=arguments[1]||{},a=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});a{"use strict";g();x();v();gQ.exports=function(e){var t=this,r=[];this.rawify(this.options.rawArrayExpressionElements,function(){r=e.nodes.map(function(i){return t.next(i)})});var n="["+r.join(",")+"]";return this.options.raw?n:this.options.factory+"("+n+")"}});var yQ=vt((G0r,xQ)=>{"use strict";g();x();v();xQ.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var bQ=vt((K0r,wQ)=>{"use strict";g();x();v();wQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var NQ=vt((e1r,DQ)=>{"use strict";g();x();v();DQ.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var EQ=vt((i1r,P3)=>{"use strict";g();x();v();var xDe=Z0().nodeTypes.SymbolNode,SQ=function(e){return"$$mathCodegen.functionProxy("+this.next(new xDe(e.name))+', "'+e.name+'")'};P3.exports=function(e){var t=this,r=SQ.call(this,e),n=[];return this.rawify(this.options.rawCallExpressionElements,function(){n=e.args.map(function(i){return t.next(i)})}),r+"("+n.join(", ")+")"};P3.exports.functionProxy=SQ});var CQ=vt((u1r,AQ)=>{"use strict";g();x();v();AQ.exports={"+":"add","-":"sub","*":"mul","/":"div","^":"pow","%":"mod","!":"factorial","|":"bitwiseOR","^|":"bitwiseXOR","&":"bitwiseAND","||":"logicalOR",xor:"logicalXOR","&&":"logicalAND","<":"lessThan",">":"greaterThan","<=":"lessEqualThan",">=":"greaterEqualThan","===":"strictlyEqual","==":"equal","!==":"strictlyNotEqual","!=":"notEqual",">>":"shiftRight","<<":"shiftLeft",">>>":"unsignedRightShift"}});var TQ=vt((p1r,MQ)=>{"use strict";g();x();v();var yDe=CQ();MQ.exports=function(e){if(this.options.raw)return["("+this.next(e.args[0]),e.op,this.next(e.args[1])+")"].join(" ");var t=yDe[e.op];if(!t)throw TypeError("unidentified operator");return this.FunctionNode({name:t,args:e.args})}});var IQ=vt((g1r,OQ)=>{"use strict";g();x();v();OQ.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var _Q=vt((w1r,FQ)=>{"use strict";g();x();v();FQ.exports={"+":"positive","-":"negative","~":"oneComplement"}});var LQ=vt((S1r,BQ)=>{"use strict";g();x();v();var kQ=_Q();BQ.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in kQ))throw new SyntaxError(e.op+" not implemented");var t=kQ[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var qQ=vt((M1r,RQ)=>{"use strict";g();x();v();var PQ=X0(),wDe={ArrayNode:vQ(),AssignmentNode:yQ(),ConditionalNode:bQ(),ConstantNode:NQ(),FunctionNode:EQ(),OperatorNode:TQ(),SymbolNode:IQ(),UnaryNode:LQ()},$D=function(e,t){this.owner=e,this.options=PQ({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1},t)};PQ($D.prototype,wDe);$D.prototype.next=function(e){if(!(e.type in this))throw new TypeError("the node type "+e.type+" is not implemented");return this[e.type](e)};$D.prototype.rawify=function(e,t){var r=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=r)};RQ.exports=$D});var UQ=vt((F1r,zQ)=>{"use strict";g();x();v();var bDe=Z0().Parser,DDe=qQ(),NDe=X0();function WD(e,t){this.statements=[],this.defs=t||{},this.interpreter=new DDe(this,e)}WD.prototype.setDefs=function(e){return this.defs=NDe(this.defs,e),this};WD.prototype.compile=function(e){if(!e||!(typeof e=="object"||typeof e=="function"))throw TypeError("namespace must be an object");if(typeof e.factory!="function")throw TypeError("namespace.factory must be a function");this.defs.ns=e,this.defs.$$mathCodegen={getProperty:function(o,u,l){if(o in u)return u[o];if(o in l)return l[o];throw SyntaxError('symbol "'+o+'" is undefined')},functionProxy:function(o,u){if(typeof o!="function")throw SyntaxError('symbol "'+u+'" must be a function');return o}},this.defs.$$processScope=this.defs.$$processScope||function(){};var t=Object.keys(this.defs).map(function(o){return"var "+o+' = defs["'+o+'"]'});if(!this.statements.length)throw Error("there are no statements saved in this generator, make sure you parse an expression before compiling it");this.statements[this.statements.length-1]="return "+this.statements[this.statements.length-1];var r=this.statements.join(";"),n=t.join(` `)+` `+["return {"," eval: function (scope) {"," scope = scope || {}"," $$processScope(scope)"," "+r," },"," code: '"+r+"'","}"].join(` -`),i=new Function("defs",n);return i(this.defs)};WD.prototype.parse=function(e){var t=this,r=new DDe().parse(e);return this.statements=r.blocks.map(function(n){return t.interpreter.next(n)}),this};zQ.exports=WD});var $Q=vt((L1r,HQ)=>{"use strict";g();y();v();HQ.exports=UQ()});var VQ=vt((z1r,WQ)=>{"use strict";g();y();v();WQ.exports=function(){var e=Object.create(Math);return e.factory=function(t){if(typeof t!="number")throw new TypeError("built-in math factory only accepts numbers");return Number(t)},e.add=function(t,r){return t+r},e.sub=function(t,r){return t-r},e.mul=function(t,r){return t*r},e.div=function(t,r){return t/r},e.mod=function(t,r){return t%r},e.factorial=function(t){for(var r=1,n=2;n<=t;n+=1)r*=n;return r},e.nthRoot=function(t,r){var n=r<0;if(n&&(r=-r),r===0)throw new Error("Root must be non-zero");if(t<0&&Math.abs(r)%2!==1)throw new Error("Root must be odd when a is negative.");if(t===0)return 0;if(!isFinite(t))return n?0:t;var i=Math.pow(Math.abs(t),1/r);return i=t<0?-i:i,n?1/i:i},e.logicalOR=function(t,r){return t||r},e.logicalXOR=function(t,r){return t!=r},e.logicalAND=function(t,r){return t&&r},e.bitwiseOR=function(t,r){return t|r},e.bitwiseXOR=function(t,r){return t^r},e.bitwiseAND=function(t,r){return t&r},e.lessThan=function(t,r){return tr},e.greaterEqualThan=function(t,r){return t>=r},e.equal=function(t,r){return t==r},e.strictlyEqual=function(t,r){return t===r},e.notEqual=function(t,r){return t!=r},e.strictlyNotEqual=function(t,r){return t!==r},e.shiftRight=function(t,r){return t>>r},e.shiftLeft=function(t,r){return t<>>r},e.negative=function(t){return-t},e.positive=function(t){return t},e}});var GQ=vt((W1r,q3)=>{"use strict";g();y();v();var SDe=$Q(),R3=VQ()();function ADe(e){Object.keys(e).forEach(function(t){var r=e[t];e[t]=R3.factory(r)})}q3.exports=function(e){return new SDe().setDefs({$$processScope:ADe}).parse(e).compile(R3)};q3.exports.math=R3});var ZQ=vt((Z1r,YQ)=>{"use strict";g();y();v();YQ.exports=GQ()});var KQ=vt((Q1r,XQ)=>{"use strict";g();y();v();XQ.exports=function(e){var t=this,r=[];this.rawify(this.options.rawArrayExpressionElements,function(){r=e.nodes.map(function(i){return t.next(i)})});var n="["+r.join(",")+"]";return this.options.raw?n:this.options.factory+"("+n+")"}});var QQ=vt((ryr,JQ)=>{"use strict";g();y();v();JQ.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var ej=vt((ayr,jQ)=>{"use strict";g();y();v();jQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var rj=vt((fyr,tj)=>{"use strict";g();y();v();tj.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var ij=vt((hyr,z3)=>{"use strict";g();y();v();var CDe=Z0().nodeTypes.SymbolNode,nj=function(e){return"$$mathCodegen.functionProxy("+this.next(new CDe(e.name))+', "'+e.name+'")'};z3.exports=function(e){var t=this,r=nj.call(this,e),n=[];return this.rawify(this.options.rawCallExpressionElements,function(){n=e.args.map(function(i){return t.next(i)})}),r+"("+n.join(", ")+")"};z3.exports.functionProxy=nj});var aj=vt((yyr,oj)=>{"use strict";g();y();v();oj.exports={"+":"add","-":"sub","*":"mul","/":"div","^":"pow","%":"mod","!":"factorial","|":"bitwiseOR","^|":"bitwiseXOR","&":"bitwiseAND","||":"logicalOR",xor:"logicalXOR","&&":"logicalAND","<":"lessThan",">":"greaterThan","<=":"lessEqualThan",">=":"greaterEqualThan","===":"strictlyEqual","==":"equal","!==":"strictlyNotEqual","!=":"notEqual",">>":"shiftRight","<<":"shiftLeft",">>>":"unsignedRightShift"}});var uj=vt((Dyr,sj)=>{"use strict";g();y();v();var MDe=aj();sj.exports=function(e){if(this.options.raw)return["("+this.next(e.args[0]),e.op,this.next(e.args[1])+")"].join(" ");var t=MDe[e.op];if(!t)throw TypeError("unidentified operator");return this.FunctionNode({name:t,args:e.args})}});var fj=vt((Ayr,lj)=>{"use strict";g();y();v();lj.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var pj=vt((Oyr,cj)=>{"use strict";g();y();v();cj.exports={"+":"positive","-":"negative","~":"oneComplement"}});var dj=vt((kyr,hj)=>{"use strict";g();y();v();var mj=pj();hj.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in mj))throw new SyntaxError(e.op+" not implemented");var t=mj[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var yj=vt((Ryr,vj)=>{"use strict";g();y();v();var gj=X0(),TDe={ArrayNode:KQ(),AssignmentNode:QQ(),ConditionalNode:ej(),ConstantNode:rj(),FunctionNode:ij(),OperatorNode:uj(),SymbolNode:fj(),UnaryNode:dj()},VD=function(e,t){this.owner=e,this.options=gj({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1,applyFactoryToScope:!1},t)};gj(VD.prototype,TDe);VD.prototype.next=function(e){if(!(e.type in this))throw new TypeError("the node type "+e.type+" is not implemented");return this[e.type](e)};VD.prototype.rawify=function(e,t){var r=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=r)};vj.exports=VD});var wj=vt((Hyr,xj)=>{"use strict";g();y();v();var ODe=Z0().Parser,IDe=yj(),FDe=X0();function GD(e,t){this.statements=[],this.defs=t||{},this.interpreter=new IDe(this,e)}GD.prototype.setDefs=function(e){return this.defs=FDe(this.defs,e),this};GD.prototype.compile=function(e){var t=this;if(!e||!(typeof e=="object"||typeof e=="function"))throw TypeError("namespace must be an object");if(typeof e.factory!="function")throw TypeError("namespace.factory must be a function");this.defs.ns=e,this.defs.$$mathCodegen={getProperty:function(u,l,a){function s(f){return t.interpreter.options.applyFactoryToScope&&typeof f!="function"?a.factory(f):f}if(u in l)return s(l[u]);if(u in a)return s(a[u]);throw SyntaxError('symbol "'+u+'" is undefined')},functionProxy:function(u,l){if(typeof u!="function")throw SyntaxError('symbol "'+l+'" must be a function');return u}},this.defs.$$processScope=this.defs.$$processScope||function(){};var r=Object.keys(this.defs).map(function(u){return"var "+u+' = defs["'+u+'"]'});if(!this.statements.length)throw Error("there are no statements saved in this generator, make sure you parse an expression before compiling it");this.statements[this.statements.length-1]="return "+this.statements[this.statements.length-1];var n=this.statements.join(";"),i=r.join(` +`),i=new Function("defs",n);return i(this.defs)};WD.prototype.parse=function(e){var t=this,r=new bDe().parse(e);return this.statements=r.blocks.map(function(n){return t.interpreter.next(n)}),this};zQ.exports=WD});var $Q=vt((L1r,HQ)=>{"use strict";g();x();v();HQ.exports=UQ()});var VQ=vt((z1r,WQ)=>{"use strict";g();x();v();WQ.exports=function(){var e=Object.create(Math);return e.factory=function(t){if(typeof t!="number")throw new TypeError("built-in math factory only accepts numbers");return Number(t)},e.add=function(t,r){return t+r},e.sub=function(t,r){return t-r},e.mul=function(t,r){return t*r},e.div=function(t,r){return t/r},e.mod=function(t,r){return t%r},e.factorial=function(t){for(var r=1,n=2;n<=t;n+=1)r*=n;return r},e.nthRoot=function(t,r){var n=r<0;if(n&&(r=-r),r===0)throw new Error("Root must be non-zero");if(t<0&&Math.abs(r)%2!==1)throw new Error("Root must be odd when a is negative.");if(t===0)return 0;if(!isFinite(t))return n?0:t;var i=Math.pow(Math.abs(t),1/r);return i=t<0?-i:i,n?1/i:i},e.logicalOR=function(t,r){return t||r},e.logicalXOR=function(t,r){return t!=r},e.logicalAND=function(t,r){return t&&r},e.bitwiseOR=function(t,r){return t|r},e.bitwiseXOR=function(t,r){return t^r},e.bitwiseAND=function(t,r){return t&r},e.lessThan=function(t,r){return tr},e.greaterEqualThan=function(t,r){return t>=r},e.equal=function(t,r){return t==r},e.strictlyEqual=function(t,r){return t===r},e.notEqual=function(t,r){return t!=r},e.strictlyNotEqual=function(t,r){return t!==r},e.shiftRight=function(t,r){return t>>r},e.shiftLeft=function(t,r){return t<>>r},e.negative=function(t){return-t},e.positive=function(t){return t},e}});var GQ=vt((W1r,q3)=>{"use strict";g();x();v();var SDe=$Q(),R3=VQ()();function EDe(e){Object.keys(e).forEach(function(t){var r=e[t];e[t]=R3.factory(r)})}q3.exports=function(e){return new SDe().setDefs({$$processScope:EDe}).parse(e).compile(R3)};q3.exports.math=R3});var ZQ=vt((Z1r,YQ)=>{"use strict";g();x();v();YQ.exports=GQ()});var KQ=vt((Q1r,XQ)=>{"use strict";g();x();v();XQ.exports=function(e){var t=this,r=[];this.rawify(this.options.rawArrayExpressionElements,function(){r=e.nodes.map(function(i){return t.next(i)})});var n="["+r.join(",")+"]";return this.options.raw?n:this.options.factory+"("+n+")"}});var QQ=vt((rxr,JQ)=>{"use strict";g();x();v();JQ.exports=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)}});var ej=vt((axr,jQ)=>{"use strict";g();x();v();jQ.exports=function(e){var t="!!("+this.next(e.condition)+")",r=this.next(e.trueExpr),n=this.next(e.falseExpr);return"("+t+" ? ("+r+") : ("+n+") )"}});var rj=vt((fxr,tj)=>{"use strict";g();x();v();tj.exports=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"}});var ij=vt((hxr,z3)=>{"use strict";g();x();v();var ADe=Z0().nodeTypes.SymbolNode,nj=function(e){return"$$mathCodegen.functionProxy("+this.next(new ADe(e.name))+', "'+e.name+'")'};z3.exports=function(e){var t=this,r=nj.call(this,e),n=[];return this.rawify(this.options.rawCallExpressionElements,function(){n=e.args.map(function(i){return t.next(i)})}),r+"("+n.join(", ")+")"};z3.exports.functionProxy=nj});var aj=vt((xxr,oj)=>{"use strict";g();x();v();oj.exports={"+":"add","-":"sub","*":"mul","/":"div","^":"pow","%":"mod","!":"factorial","|":"bitwiseOR","^|":"bitwiseXOR","&":"bitwiseAND","||":"logicalOR",xor:"logicalXOR","&&":"logicalAND","<":"lessThan",">":"greaterThan","<=":"lessEqualThan",">=":"greaterEqualThan","===":"strictlyEqual","==":"equal","!==":"strictlyNotEqual","!=":"notEqual",">>":"shiftRight","<<":"shiftLeft",">>>":"unsignedRightShift"}});var uj=vt((Dxr,sj)=>{"use strict";g();x();v();var CDe=aj();sj.exports=function(e){if(this.options.raw)return["("+this.next(e.args[0]),e.op,this.next(e.args[1])+")"].join(" ");var t=CDe[e.op];if(!t)throw TypeError("unidentified operator");return this.FunctionNode({name:t,args:e.args})}});var fj=vt((Axr,lj)=>{"use strict";g();x();v();lj.exports=function(e){var t=e.name;return'$$mathCodegen.getProperty("'+t+'", scope, ns)'}});var pj=vt((Oxr,cj)=>{"use strict";g();x();v();cj.exports={"+":"positive","-":"negative","~":"oneComplement"}});var dj=vt((kxr,hj)=>{"use strict";g();x();v();var mj=pj();hj.exports=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in mj))throw new SyntaxError(e.op+" not implemented");var t=mj[e.op];return this.FunctionNode({name:t,args:[e.argument]})}});var xj=vt((Rxr,vj)=>{"use strict";g();x();v();var gj=X0(),MDe={ArrayNode:KQ(),AssignmentNode:QQ(),ConditionalNode:ej(),ConstantNode:rj(),FunctionNode:ij(),OperatorNode:uj(),SymbolNode:fj(),UnaryNode:dj()},VD=function(e,t){this.owner=e,this.options=gj({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1,applyFactoryToScope:!1},t)};gj(VD.prototype,MDe);VD.prototype.next=function(e){if(!(e.type in this))throw new TypeError("the node type "+e.type+" is not implemented");return this[e.type](e)};VD.prototype.rawify=function(e,t){var r=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=r)};vj.exports=VD});var wj=vt((Hxr,yj)=>{"use strict";g();x();v();var TDe=Z0().Parser,ODe=xj(),IDe=X0();function GD(e,t){this.statements=[],this.defs=t||{},this.interpreter=new ODe(this,e)}GD.prototype.setDefs=function(e){return this.defs=IDe(this.defs,e),this};GD.prototype.compile=function(e){var t=this;if(!e||!(typeof e=="object"||typeof e=="function"))throw TypeError("namespace must be an object");if(typeof e.factory!="function")throw TypeError("namespace.factory must be a function");this.defs.ns=e,this.defs.$$mathCodegen={getProperty:function(u,l,a){function s(f){return t.interpreter.options.applyFactoryToScope&&typeof f!="function"?a.factory(f):f}if(u in l)return s(l[u]);if(u in a)return s(a[u]);throw SyntaxError('symbol "'+u+'" is undefined')},functionProxy:function(u,l){if(typeof u!="function")throw SyntaxError('symbol "'+l+'" must be a function');return u}},this.defs.$$processScope=this.defs.$$processScope||function(){};var r=Object.keys(this.defs).map(function(u){return"var "+u+' = defs["'+u+'"]'});if(!this.statements.length)throw Error("there are no statements saved in this generator, make sure you parse an expression before compiling it");this.statements[this.statements.length-1]="return "+this.statements[this.statements.length-1];var n=this.statements.join(";"),i=r.join(` `)+` `+["return {"," eval: function (scope) {"," scope = scope || {}"," $$processScope(scope)"," "+n," },"," code: '"+n+"'","}"].join(` -`),o=new Function("defs",i);return o(this.defs)};GD.prototype.parse=function(e){var t=this,r=new ODe().parse(e);return this.statements=r.blocks.map(function(n){return t.interpreter.next(n)}),this};xj.exports=GD});var Dj=vt((Gyr,bj)=>{"use strict";g();y();v();bj.exports=wj()});var Hu=vt(Wi=>{"use strict";g();y();v();Object.defineProperty(Wi,"__esModule",{value:!0});Wi.intervalsOverlap=Wi.hasInterval=Wi.hasValue=Wi.zeroIn=Wi.isSingleton=Wi.isWhole=Wi.isEmpty=Wi.isInterval=void 0;function _De(e){return typeof e=="object"&&typeof e.lo=="number"&&typeof e.hi=="number"}Wi.isInterval=_De;function Id(e){return e.lo>e.hi}Wi.isEmpty=Id;function kDe(e){return e.lo===-1/0&&e.hi===1/0}Wi.isWhole=kDe;function BDe(e){return e.lo===e.hi}Wi.isSingleton=BDe;function LDe(e){return Nj(e,0)}Wi.zeroIn=LDe;function Nj(e,t){return Id(e)?!1:e.lo<=t&&t<=e.hi}Wi.hasValue=Nj;function PDe(e,t){return Id(e)?!0:!Id(t)&&t.lo<=e.lo&&e.hi<=t.hi}Wi.hasInterval=PDe;function RDe(e,t){return Id(e)||Id(t)?!1:e.lo<=t.lo&&t.lo<=e.hi||t.lo<=e.lo&&e.lo<=t.hi}Wi.intervalsOverlap=RDe});var Ej=vt((exr,ri)=>{g();y();v();var U3=!1;if(typeof Float64Array<"u")if(eu=new Float64Array(1),Po=new Uint32Array(eu.buffer),eu[0]=1,U3=!0,Po[1]===1072693248){let e=function(n,i){return Po[0]=n,Po[1]=i,eu[0]},t=function(n){return eu[0]=n,Po[0]},r=function(n){return eu[0]=n,Po[1]};qDe=e,zDe=t,UDe=r,ri.exports=function(i){return eu[0]=i,[Po[0],Po[1]]},ri.exports.pack=e,ri.exports.lo=t,ri.exports.hi=r}else if(Po[0]===1072693248){let e=function(n,i){return Po[1]=n,Po[0]=i,eu[0]},t=function(n){return eu[0]=n,Po[1]},r=function(n){return eu[0]=n,Po[0]};HDe=e,$De=t,WDe=r,ri.exports=function(i){return eu[0]=i,[Po[1],Po[0]]},ri.exports.pack=e,ri.exports.lo=t,ri.exports.hi=r}else U3=!1;var eu,Po,qDe,zDe,UDe,HDe,$De,WDe;if(!U3){let e=function(n,i){return tu.writeUInt32LE(n,0,!0),tu.writeUInt32LE(i,4,!0),tu.readDoubleLE(0,!0)},t=function(n){return tu.writeDoubleLE(n,0,!0),tu.readUInt32LE(0,!0)},r=function(n){return tu.writeDoubleLE(n,0,!0),tu.readUInt32LE(4,!0)};VDe=e,GDe=t,YDe=r,tu=new k(8),ri.exports=function(i){return tu.writeDoubleLE(i,0,!0),[tu.readUInt32LE(0,!0),tu.readUInt32LE(4,!0)]},ri.exports.pack=e,ri.exports.lo=t,ri.exports.hi=r}var tu,VDe,GDe,YDe;ri.exports.sign=function(e){return ri.exports.hi(e)>>>31};ri.exports.exponent=function(e){var t=ri.exports.hi(e);return(t<<1>>>21)-1023};ri.exports.fraction=function(e){var t=ri.exports.lo(e),r=ri.exports.hi(e),n=r&(1<<20)-1;return r&2146435072&&(n+=1<<20),[t,n]};ri.exports.denormalized=function(e){var t=ri.exports.hi(e);return!(t&2146435072)}});var Mj=vt((ixr,Cj)=>{"use strict";g();y();v();var H3=Ej(),Sj=Math.pow(2,-1074),Aj=-1>>>0;Cj.exports=ZDe;function ZDe(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(e===0)return t<0?-Sj:Sj;var r=H3.hi(e),n=H3.lo(e);return t>e==e>0?n===Aj?(r+=1,n=0):n+=1:n===0?(n=Aj,r-=1):n-=1,H3.pack(n,r)}});var Rl=vt(K0=>{"use strict";g();y();v();var XDe=K0&&K0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(K0,"__esModule",{value:!0});var Oj=XDe(Mj());function KDe(e){return e}function $3(e){return e===1/0?e:(0,Oj.default)(e,-1/0)}function W3(e){return e===-1/0?e:(0,Oj.default)(e,1/0)}function Tj(e){return e<0?Math.ceil(e):Math.floor(e)}var Fd={prev:$3,next:W3},wr={safePrev:$3,safeNext:W3,prev(e){return Fd.prev(e)},next(e){return Fd.next(e)},addLo(e,t){return wr.prev(e+t)},addHi(e,t){return wr.next(e+t)},subLo(e,t){return wr.prev(e-t)},subHi(e,t){return wr.next(e-t)},mulLo(e,t){return wr.prev(e*t)},mulHi(e,t){return wr.next(e*t)},divLo(e,t){return wr.prev(e/t)},divHi(e,t){return wr.next(e/t)},intLo(e){return Tj(wr.prev(e))},intHi(e){return Tj(wr.next(e))},logLo(e){return wr.prev(Math.log(e))},logHi(e){return wr.next(Math.log(e))},expLo(e){return wr.prev(Math.exp(e))},expHi(e){return wr.next(Math.exp(e))},sinLo(e){return wr.prev(Math.sin(e))},sinHi(e){return wr.next(Math.sin(e))},cosLo(e){return wr.prev(Math.cos(e))},cosHi(e){return wr.next(Math.cos(e))},tanLo(e){return wr.prev(Math.tan(e))},tanHi(e){return wr.next(Math.tan(e))},asinLo(e){return wr.prev(Math.asin(e))},asinHi(e){return wr.next(Math.asin(e))},acosLo(e){return wr.prev(Math.acos(e))},acosHi(e){return wr.next(Math.acos(e))},atanLo(e){return wr.prev(Math.atan(e))},atanHi(e){return wr.next(Math.atan(e))},sinhLo(e){return wr.prev(Math.sinh(e))},sinhHi(e){return wr.next(Math.sinh(e))},coshLo(e){return wr.prev(Math.cosh(e))},coshHi(e){return wr.next(Math.cosh(e))},tanhLo(e){return wr.prev(Math.tanh(e))},tanhHi(e){return wr.next(Math.tanh(e))},powLo(e,t){if(t%1!==0)return wr.prev(Math.pow(e,t));let r=(t&1)===1?e:1;for(t>>=1;t>0;)e=wr.mulLo(e,e),(t&1)===1&&(r=wr.mulLo(e,r)),t>>=1;return r},powHi(e,t){if(t%1!==0)return wr.next(Math.pow(e,t));let r=(t&1)===1?e:1;for(t>>=1;t>0;)e=wr.mulHi(e,e),(t&1)===1&&(r=wr.mulHi(e,r)),t>>=1;return r},sqrtLo(e){return wr.prev(Math.sqrt(e))},sqrtHi(e){return wr.next(Math.sqrt(e))},disable(){Fd.next=Fd.prev=KDe},enable(){Fd.next=W3,Fd.prev=$3}};K0.default=wr});var nc=vt(ea=>{"use strict";g();y();v();var JDe=ea&&ea.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),QDe=ea&&ea.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),jDe=ea&&ea.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&JDe(t,e,r);return QDe(t,e),t},eNe=ea&&ea.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ea,"__esModule",{value:!0});ea.Interval=ea._Interval=void 0;var YD=jDe(Hu()),_d=eNe(Rl()),ZD=class e{constructor(t,r){if(this.lo=0,this.hi=0,!(this instanceof e))return console.log("calling with new"),console.log(t,r),new e(t,r);if(typeof t<"u"&&typeof r<"u"){if(YD.isInterval(t)){if(!YD.isSingleton(t))throw new TypeError("Interval: interval `lo` must be a singleton");t=t.lo}if(YD.isInterval(r)){if(!YD.isSingleton(r))throw TypeError("Interval: interval `hi` must be a singleton");r=r.hi}}else{if(typeof t<"u")return Array.isArray(t)?new kd(t[0],t[1]):new kd(t,t);t=r=0}this.assign(t,r)}singleton(t){return this.set(t,t)}bounded(t,r){return this.set(_d.default.prev(t),_d.default.next(r))}boundedSingleton(t){return this.bounded(t,t)}set(t,r){return this.lo=t,this.hi=r,this}assign(t,r){if(typeof t!="number"||typeof r!="number")throw TypeError("Interval#assign: arguments must be numbers");return isNaN(t)||isNaN(r)||t>r?this.setEmpty():this.set(t,r)}setEmpty(){return this.set(Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY)}setWhole(){return this.set(Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY)}open(t,r){return this.assign(_d.default.safeNext(t),_d.default.safePrev(r))}halfOpenLeft(t,r){return this.assign(_d.default.safeNext(t),r)}halfOpenRight(t,r){return this.assign(t,_d.default.safePrev(r))}toArray(){return[this.lo,this.hi]}clone(){return new kd().set(this.lo,this.hi)}};ea._Interval=ZD;function tNe(e){function t(){for(var r=arguments.length,n=Array(r),i=0;i{"use strict";g();y();v();var rNe=Q0&&Q0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q0,"__esModule",{value:!0});var ic=nc(),Ij=rNe(Rl()),XD=(3373259426+273688/(1<<21))/(1<<30),KD=(3373259426+273689/(1<<21))/(1<<30),J0={PI_LOW:XD,PI_HIGH:KD,PI_HALF_LOW:XD/2,PI_HALF_HIGH:KD/2,PI_TWICE_LOW:XD*2,PI_TWICE_HIGH:KD*2,get E(){return new ic.Interval(Ij.default.prev(Math.E),Ij.default.next(Math.E))},get PI(){return new ic.Interval(XD,KD)},get PI_HALF(){return new ic.Interval(J0.PI_HALF_LOW,J0.PI_HALF_HIGH)},get PI_TWICE(){return new ic.Interval(J0.PI_TWICE_LOW,J0.PI_TWICE_HIGH)},get ZERO(){return new ic.Interval(0)},get ONE(){return new ic.Interval(1)},get WHOLE(){return new ic.Interval().setWhole()},get EMPTY(){return new ic.Interval().setEmpty()}};Q0.default=J0});var V3=vt(Hr=>{"use strict";g();y();v();var nNe=Hr&&Hr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),iNe=Hr&&Hr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),oNe=Hr&&Hr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&nNe(t,e,r);return iNe(t,e),t};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.geq=Hr.greaterEqualThan=Hr.leq=Hr.lessEqualThan=Hr.gt=Hr.greaterThan=Hr.lt=Hr.lessThan=Hr.notEqual=Hr.assertIncludes=Hr.almostEqual=Hr.equal=void 0;var ta=oNe(Hu());function aNe(e,t){return ta.isEmpty(e)?ta.isEmpty(t):!ta.isEmpty(t)&&e.lo===t.lo&&e.hi===t.hi}Hr.equal=aNe;var sNe=1e-7;function JD(e,t){if(!e)throw new Error(t||"assertion failed")}function Fj(e,t){if(!isFinite(e))return JD(e===t,`[Infinity] expected ${e} to be ${t}`);JD(Math.abs(e-t)t.hi}Hr.notEqual=lNe;function kj(e,t){return ta.isEmpty(e)||ta.isEmpty(t)?!1:e.hit.hi}Hr.greaterThan=Bj;Hr.gt=Bj;function Lj(e,t){return ta.isEmpty(e)||ta.isEmpty(t)?!1:e.hi<=t.lo}Hr.lessEqualThan=Lj;Hr.leq=Lj;function Pj(e,t){return ta.isEmpty(e)||ta.isEmpty(t)?!1:e.lo>=t.hi}Hr.greaterEqualThan=Pj;Hr.geq=Pj});var zj=vt(Vi=>{"use strict";g();y();v();var fNe=Vi&&Vi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),cNe=Vi&&Vi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),pNe=Vi&&Vi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&fNe(t,e,r);return cNe(t,e),t},Rj=Vi&&Vi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.zero=Vi.negative=Vi.positive=Vi.nonZero=void 0;var j0=nc(),Do=Rj(Rl()),qj=pNe(Hu()),G3=Rj(nm());function mNe(e,t){let r=e.lo,n=e.hi,i=t.lo,o=t.hi,u=new j0.Interval;return n<0?o<0?(u.lo=Do.default.divLo(n,i),u.hi=Do.default.divHi(r,o)):(u.lo=Do.default.divLo(r,i),u.hi=Do.default.divHi(n,o)):r<0?o<0?(u.lo=Do.default.divLo(n,o),u.hi=Do.default.divHi(r,o)):(u.lo=Do.default.divLo(r,i),u.hi=Do.default.divHi(n,i)):o<0?(u.lo=Do.default.divLo(n,o),u.hi=Do.default.divHi(r,i)):(u.lo=Do.default.divLo(r,o),u.hi=Do.default.divHi(n,i)),u}Vi.nonZero=mNe;function hNe(e,t){return e.lo===0&&e.hi===0?e:qj.zeroIn(e)?G3.default.WHOLE:e.hi<0?new j0.Interval(Number.NEGATIVE_INFINITY,Do.default.divHi(e.hi,t)):new j0.Interval(Do.default.divLo(e.lo,t),Number.POSITIVE_INFINITY)}Vi.positive=hNe;function dNe(e,t){return e.lo===0&&e.hi===0?e:qj.zeroIn(e)?G3.default.WHOLE:e.hi<0?new j0.Interval(Do.default.divLo(e.hi,t),Number.POSITIVE_INFINITY):new j0.Interval(Number.NEGATIVE_INFINITY,Do.default.divHi(e.lo,t))}Vi.negative=dNe;function gNe(e){return e.lo===0&&e.hi===0?e:G3.default.WHOLE}Vi.zero=gNe});var Bd=vt(sn=>{"use strict";g();y();v();var vNe=sn&&sn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),yNe=sn&&sn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Uj=sn&&sn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&vNe(t,e,r);return yNe(t,e),t},Hj=sn&&sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sn,"__esModule",{value:!0});sn.negative=sn.positive=sn.div=sn.divide=sn.mul=sn.multiply=sn.sub=sn.subtract=sn.add=void 0;var t1=nc(),Fn=Hj(Rl()),Y3=Hj(nm()),e1=Uj(Hu()),QD=Uj(zj());function xNe(e,t){return new t1.Interval(Fn.default.addLo(e.lo,t.lo),Fn.default.addHi(e.hi,t.hi))}sn.add=xNe;function $j(e,t){return new t1.Interval(Fn.default.subLo(e.lo,t.hi),Fn.default.subHi(e.hi,t.lo))}sn.subtract=$j;sn.sub=$j;function Wj(e,t){if(e1.isEmpty(e)||e1.isEmpty(t))return Y3.default.EMPTY;let r=e.lo,n=e.hi,i=t.lo,o=t.hi,u=new t1.Interval;return r<0?n>0?i<0?o>0?(u.lo=Math.min(Fn.default.mulLo(r,o),Fn.default.mulLo(n,i)),u.hi=Math.max(Fn.default.mulHi(r,i),Fn.default.mulHi(n,o))):(u.lo=Fn.default.mulLo(n,i),u.hi=Fn.default.mulHi(r,i)):o>0?(u.lo=Fn.default.mulLo(r,o),u.hi=Fn.default.mulHi(n,o)):(u.lo=0,u.hi=0):i<0?o>0?(u.lo=Fn.default.mulLo(r,o),u.hi=Fn.default.mulHi(r,i)):(u.lo=Fn.default.mulLo(n,o),u.hi=Fn.default.mulHi(r,i)):o>0?(u.lo=Fn.default.mulLo(r,o),u.hi=Fn.default.mulHi(n,i)):(u.lo=0,u.hi=0):n>0?i<0?o>0?(u.lo=Fn.default.mulLo(n,i),u.hi=Fn.default.mulHi(n,o)):(u.lo=Fn.default.mulLo(n,i),u.hi=Fn.default.mulHi(r,o)):o>0?(u.lo=Fn.default.mulLo(r,i),u.hi=Fn.default.mulHi(n,o)):(u.lo=0,u.hi=0):(u.lo=0,u.hi=0),u}sn.multiply=Wj;sn.mul=Wj;function Vj(e,t){return e1.isEmpty(e)||e1.isEmpty(t)?Y3.default.EMPTY:e1.zeroIn(t)?t.lo!==0?t.hi!==0?QD.zero(e):QD.negative(e,t.lo):t.hi!==0?QD.positive(e,t.hi):Y3.default.EMPTY:QD.nonZero(e,t)}sn.divide=Vj;sn.div=Vj;function wNe(e){return new t1.Interval(e.lo,e.hi)}sn.positive=wNe;function bNe(e){return new t1.Interval(-e.hi,-e.lo)}sn.negative=bNe});var jD=vt(yi=>{"use strict";g();y();v();var DNe=yi&&yi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),NNe=yi&&yi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Yj=yi&&yi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&DNe(t,e,r);return NNe(t,e),t},Zj=yi&&yi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yi,"__esModule",{value:!0});yi.nthRoot=yi.sqrt=yi.pow=yi.multiplicativeInverse=yi.fmod=void 0;var Oa=nc(),oo=Zj(Rl()),cs=Zj(nm()),oc=Yj(Hu()),Gj=Yj(Bd());function ENe(e,t){if(oc.isEmpty(e)||oc.isEmpty(t))return cs.default.EMPTY;let r=e.lo<0?t.lo:t.hi,n=e.lo/r;return n<0?n=Math.ceil(n):n=Math.floor(n),Gj.sub(e,Gj.mul(t,new Oa.Interval(n)))}yi.fmod=ENe;function Xj(e){return oc.isEmpty(e)?cs.default.EMPTY:oc.zeroIn(e)?e.lo!==0?e.hi!==0?cs.default.WHOLE:new Oa.Interval(Number.NEGATIVE_INFINITY,oo.default.divHi(1,e.lo)):e.hi!==0?new Oa.Interval(oo.default.divLo(1,e.hi),Number.POSITIVE_INFINITY):cs.default.EMPTY:new Oa.Interval(oo.default.divLo(1,e.hi),oo.default.divHi(1,e.lo))}yi.multiplicativeInverse=Xj;function Kj(e,t){if(oc.isEmpty(e))return cs.default.EMPTY;if(typeof t=="object"){if(!oc.isSingleton(t))return cs.default.EMPTY;t=t.lo}if(t===0)return e.lo===0&&e.hi===0?cs.default.EMPTY:cs.default.ONE;if(t<0)return Kj(Xj(e),-t);if(Number.isSafeInteger(t))if(e.hi<0){let r=oo.default.powLo(-e.hi,t),n=oo.default.powHi(-e.lo,t);return(t&1)===1?new Oa.Interval(-n,-r):new Oa.Interval(r,n)}else return e.lo<0?(t&1)===1?new Oa.Interval(-oo.default.powLo(-e.lo,t),oo.default.powHi(e.hi,t)):new Oa.Interval(0,oo.default.powHi(Math.max(-e.lo,e.hi),t)):new Oa.Interval(oo.default.powLo(e.lo,t),oo.default.powHi(e.hi,t));else return console.warn("power is not an integer, you should use nth-root instead, returning an empty interval"),cs.default.EMPTY}yi.pow=Kj;function SNe(e){return Jj(e,2)}yi.sqrt=SNe;function Jj(e,t){if(oc.isEmpty(e)||t<0)return cs.default.EMPTY;if(typeof t=="object"){if(!oc.isSingleton(t))return cs.default.EMPTY;t=t.lo}let r=1/t;if(e.hi<0){if(Number.isSafeInteger(t)&&(t&1)===1){let n=oo.default.powHi(-e.lo,r),i=oo.default.powLo(-e.hi,r);return new Oa.Interval(-n,-i)}return cs.default.EMPTY}else if(e.lo<0){let n=oo.default.powHi(e.hi,r);if(Number.isSafeInteger(t)&&(t&1)===1){let i=-oo.default.powHi(-e.lo,r);return new Oa.Interval(i,n)}return new Oa.Interval(0,n)}else return new Oa.Interval(oo.default.powLo(e.lo,r),oo.default.powHi(e.hi,r))}yi.nthRoot=Jj});var eN=vt(dr=>{"use strict";g();y();v();var ANe=dr&&dr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),CNe=dr&&dr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Qj=dr&&dr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&ANe(t,e,r);return CNe(t,e),t},jj=dr&&dr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dr,"__esModule",{value:!0});dr.clone=dr.min=dr.max=dr.abs=dr.wid=dr.width=dr.difference=dr.union=dr.intersection=dr.hull=dr.log2=dr.LOG_EXP_2=dr.log10=dr.LOG_EXP_10=dr.ln=dr.log=dr.exp=void 0;var Ia=nc(),r1=jj(Rl()),ps=jj(nm()),Ii=Qj(Hu()),Z3=Qj(Bd());function MNe(e){return Ii.isEmpty(e)?ps.default.EMPTY:new Ia.Interval(r1.default.expLo(e.lo),r1.default.expHi(e.hi))}dr.exp=MNe;function Ld(e){if(Ii.isEmpty(e))return ps.default.EMPTY;let t=e.lo<=0?Number.NEGATIVE_INFINITY:r1.default.logLo(e.lo);return new Ia.Interval(t,r1.default.logHi(e.hi))}dr.log=Ld;dr.ln=Ld;dr.LOG_EXP_10=Ld(new Ia.Interval(10,10));function TNe(e){return Ii.isEmpty(e)?ps.default.EMPTY:Z3.div(Ld(e),dr.LOG_EXP_10)}dr.log10=TNe;dr.LOG_EXP_2=Ld(new Ia.Interval(2,2));function ONe(e){return Ii.isEmpty(e)?ps.default.EMPTY:Z3.div(Ld(e),dr.LOG_EXP_2)}dr.log2=ONe;function INe(e,t){let r=Ii.isEmpty(e),n=Ii.isEmpty(t);return r&&n?ps.default.EMPTY:r?t.clone():n?e.clone():new Ia.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}dr.hull=INe;function FNe(e,t){if(Ii.isEmpty(e)||Ii.isEmpty(t))return ps.default.EMPTY;let r=Math.max(e.lo,t.lo),n=Math.min(e.hi,t.hi);return r<=n?new Ia.Interval(r,n):ps.default.EMPTY}dr.intersection=FNe;function _Ne(e,t){if(!Ii.intervalsOverlap(e,t))throw Error("Interval#union: intervals do not overlap");return new Ia.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}dr.union=_Ne;function kNe(e,t){if(Ii.isEmpty(e)||Ii.isWhole(t))return ps.default.EMPTY;if(Ii.intervalsOverlap(e,t)){if(e.lo=e.hi&&t.lo===-1/0?ps.default.EMPTY:t.lo<=e.lo?new Ia.Interval().halfOpenLeft(t.hi,e.hi):new Ia.Interval().halfOpenRight(e.lo,t.lo)}return e.clone()}dr.difference=kNe;function eee(e){return Ii.isEmpty(e)?0:r1.default.subHi(e.hi,e.lo)}dr.width=eee;dr.wid=eee;function BNe(e){return Ii.isEmpty(e)||Ii.isWhole(e)?ps.default.EMPTY:e.lo>=0?e.clone():e.hi<=0?Z3.negative(e):new Ia.Interval(0,Math.max(-e.lo,e.hi))}dr.abs=BNe;function LNe(e,t){let r=Ii.isEmpty(e),n=Ii.isEmpty(t);return r&&n?ps.default.EMPTY:r?t.clone():n?e.clone():new Ia.Interval(Math.max(e.lo,t.lo),Math.max(e.hi,t.hi))}dr.max=LNe;function PNe(e,t){let r=Ii.isEmpty(e),n=Ii.isEmpty(t);return r&&n?ps.default.EMPTY:r?t.clone():n?e.clone():new Ia.Interval(Math.min(e.lo,t.lo),Math.min(e.hi,t.hi))}dr.min=PNe;function RNe(e){return new Ia.Interval().set(e.lo,e.hi)}dr.clone=RNe});var J3=vt(un=>{"use strict";g();y();v();var qNe=un&&un.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),zNe=un&&un.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),rN=un&&un.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&qNe(t,e,r);return zNe(t,e),t},tee=un&&un.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(un,"__esModule",{value:!0});un.tanh=un.cosh=un.sinh=un.atan=un.acos=un.asin=un.tan=un.sin=un.cos=void 0;var Ro=nc(),Fi=tee(Rl()),Dn=tee(nm()),ql=rN(Hu()),tN=rN(Bd()),ree=rN(jD()),UNe=rN(eN());function X3(e){return!isFinite(e.lo)&&e.lo===e.hi}function nee(e){if(e.lo<0)if(e.lo===-1/0)e.lo=0,e.hi=1/0;else{let t=Math.ceil(-e.lo/Dn.default.PI_TWICE_LOW);e.lo+=Dn.default.PI_TWICE_LOW*t,e.hi+=Dn.default.PI_TWICE_LOW*t}return e}function K3(e){if(ql.isEmpty(e)||X3(e))return Dn.default.EMPTY;let t=new Ro.Interval().set(e.lo,e.hi);nee(t);let r=Dn.default.PI_TWICE,n=ree.fmod(t,r);if(UNe.width(n)>=r.lo)return new Ro.Interval(-1,1);if(n.lo>=Dn.default.PI_HIGH){let a=K3(tN.sub(n,Dn.default.PI));return tN.negative(a)}let i=n.lo,o=n.hi,u=Fi.default.cosLo(o),l=Fi.default.cosHi(i);return o<=Dn.default.PI_LOW?new Ro.Interval(u,l):o<=r.lo?new Ro.Interval(-1,Math.max(u,l)):new Ro.Interval(-1,1)}un.cos=K3;function HNe(e){return ql.isEmpty(e)||X3(e)?Dn.default.EMPTY:K3(tN.sub(e,Dn.default.PI_HALF))}un.sin=HNe;function $Ne(e){if(ql.isEmpty(e)||X3(e))return Dn.default.EMPTY;let t=new Ro.Interval().set(e.lo,e.hi);nee(t);let r=Dn.default.PI,n=ree.fmod(t,r);return n.lo>=Dn.default.PI_HALF_LOW&&(n=tN.sub(n,r)),n.lo<=-Dn.default.PI_HALF_LOW||n.hi>=Dn.default.PI_HALF_LOW?Dn.default.WHOLE:new Ro.Interval(Fi.default.tanLo(n.lo),Fi.default.tanHi(n.hi))}un.tan=$Ne;function WNe(e){if(ql.isEmpty(e)||e.hi<-1||e.lo>1)return Dn.default.EMPTY;let t=e.lo<=-1?-Dn.default.PI_HALF_HIGH:Fi.default.asinLo(e.lo),r=e.hi>=1?Dn.default.PI_HALF_HIGH:Fi.default.asinHi(e.hi);return new Ro.Interval(t,r)}un.asin=WNe;function VNe(e){if(ql.isEmpty(e)||e.hi<-1||e.lo>1)return Dn.default.EMPTY;let t=e.hi>=1?0:Fi.default.acosLo(e.hi),r=e.lo<=-1?Dn.default.PI_HIGH:Fi.default.acosHi(e.lo);return new Ro.Interval(t,r)}un.acos=VNe;function GNe(e){return ql.isEmpty(e)?Dn.default.EMPTY:new Ro.Interval(Fi.default.atanLo(e.lo),Fi.default.atanHi(e.hi))}un.atan=GNe;function YNe(e){return ql.isEmpty(e)?Dn.default.EMPTY:new Ro.Interval(Fi.default.sinhLo(e.lo),Fi.default.sinhHi(e.hi))}un.sinh=YNe;function ZNe(e){return ql.isEmpty(e)?Dn.default.EMPTY:e.hi<0?new Ro.Interval(Fi.default.coshLo(e.hi),Fi.default.coshHi(e.lo)):e.lo>=0?new Ro.Interval(Fi.default.coshLo(e.lo),Fi.default.coshHi(e.hi)):new Ro.Interval(1,Fi.default.coshHi(-e.lo>e.hi?e.lo:e.hi))}un.cosh=ZNe;function XNe(e){return ql.isEmpty(e)?Dn.default.EMPTY:new Ro.Interval(Fi.default.tanhLo(e.lo),Fi.default.tanhHi(e.hi))}un.tanh=XNe});var uee=vt(Nn=>{"use strict";g();y();v();var iee=Nn&&Nn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),KNe=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Pd=Nn&&Nn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&iee(t,e,r);return KNe(t,e),t},Rd=Nn&&Nn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&iee(t,e,r)},oee=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.constants=Nn.round=Nn.Interval=void 0;var aee=nc();Object.defineProperty(Nn,"Interval",{enumerable:!0,get:function(){return aee._Interval}});var Q3=oee(Rl());Nn.round=Q3.default;var see=oee(nm());Nn.constants=see.default;var JNe=Pd(V3()),QNe=Pd(Bd()),jNe=Pd(jD()),eEe=Pd(J3()),tEe=Pd(eN()),rEe=Pd(Hu()),nEe=Object.assign(aee.Interval,see.default,Q3.default,tEe,rEe,JNe,QNe,jNe,eEe,{round:Q3.default});Nn.default=nEe;Rd(V3(),Nn);Rd(Bd(),Nn);Rd(jD(),Nn);Rd(J3(),Nn);Rd(eN(),Nn);Rd(Hu(),Nn)});var fee=vt((Zxr,lee)=>{"use strict";g();y();v();lee.exports=function(e){e.mod=e.fmod,e.lessThan=e.lt,e.lessEqualThan=e.leq,e.greaterThan=e.gt,e.greaterEqualThan=e.geq,e.strictlyEqual=e.equal,e.strictlyNotEqual=e.notEqual,e.logicalAND=function(t,r){return t&&r},e.logicalXOR=function(t,r){return t^r},e.logicalOR=function(t,r){return t||r}}});var pee=vt((Qxr,cee)=>{"use strict";g();y();v();cee.exports=function(e){return{disableRounding:function(){e.round.disable()},enableRounding:function(){e.round.enable()}}}});var mee=vt((rwr,nN)=>{"use strict";g();y();v();var iEe=Dj(),qd=uee().default;fee()(qd);function oEe(e){Object.keys(e).forEach(function(t){let r=e[t];typeof r=="number"||Array.isArray(r)?e[t]=qd.factory(r):typeof r=="object"&&"lo"in r&&"hi"in r&&(e[t]=qd.factory(r.lo,r.hi))})}nN.exports=function(e){return new iEe().setDefs({$$processScope:oEe}).parse(e).compile(qd)};nN.exports.policies=pee()(qd);nN.exports.Interval=qd});var j3=vt((awr,hee)=>{"use strict";g();y();v();hee.exports=mee()});var sc=vt(ac=>{"use strict";g();y();v();var dee=ac&&ac.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ac,"__esModule",{value:!0});ac.interval=ac.builtIn=void 0;var aEe=dee(ZQ()),sEe=dee(j3()),gee={interval:sEe.default,builtIn:aEe.default};function uEe(){return typeof global=="object"&&"math"in global?global.math:typeof window=="object"&&"math"in window?window.math:null}var eO=uEe();eO&&(gee.builtIn=eO.compile);function vee(e){function t(o){if(typeof o=="string"){let u=gee[e](o);return eO&&e==="builtIn"?{eval:u.evaluate||u.eval}:u}else{if(typeof o=="function")return{eval:o};throw Error("expression must be a string or a function")}}function r(o,u){let l=o[u],a=e+"_Expression_"+u,s=e+"_Compiled_"+u;l!==o[a]&&(o[a]=l,o[s]=t(l))}function n(o,u){return o[e+"_Compiled_"+u]}function i(o,u,l){return r(o,u),n(o,u).eval(Object.assign({},o.scope||{},l))}return i}var lEe=vee("builtIn");ac.builtIn=lEe;var fEe=vee("interval");ac.interval=fEe});var bee=vt(n1=>{"use strict";g();y();v();var wee=n1&&n1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n1,"__esModule",{value:!0});var cEe=(e0(),Cn(jv)),pEe=(ti(),Cn(Qs)),im=wee(Uu()),yee=wee(Od()),xee=sc();function mEe(e){e=Object.assign({xLine:!1,yLine:!1,renderer:function(l,a){return"("+l.toFixed(3)+", "+a.toFixed(3)+")"},owner:null},e);let t=20,r=(0,cEe.line)().x(function(l){return l[0]}).y(function(l){return l[1]});function n(l,a){return l.append("path").datum(a).attr("stroke","grey").attr("stroke-dasharray","5,5").attr("opacity",.5).attr("d",r)}let i,o;function u(l){let a=l.selectAll("g.tip").data(function(f){return[f]}),s=a.enter().append("g").attr("class","tip").attr("clip-path","url(#function-plot-clip-"+e.owner.id+")");i=a.merge(s).selectAll("g.inner-tip").data(function(f){return[f]}),o=i.enter().append("g").attr("class","inner-tip").style("display","none").each(function(){let f=(0,pEe.select)(this);n(f,[[0,-e.owner.meta.height-t],[0,e.owner.meta.height+t]]).attr("class","tip-x-line").style("display","none"),n(f,[[-e.owner.meta.width-t,0],[e.owner.meta.width+t,0]]).attr("class","tip-y-line").style("display","none"),f.append("circle").attr("r",3),f.append("text").attr("transform","translate(5,-5)")}),i.merge(o).selectAll(".tip-x-line").style("display",e.xLine?null:"none"),i.merge(o).selectAll(".tip-y-line").style("display",e.yLine?null:"none")}return u.move=function(l){let a,s=1/0,f=-1,p,h,x=i.merge(o),b=e.owner.meta,w=x.datum().data,A=b.xScale,E=b.yScale,O=b.width,M=b.height,I=l.x,F=l.y;for(a=0;aC[0]-yee.default.TIP_X_EPS&&I{"use strict";g();y();v();var hEe=ru&&ru.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),dEe=ru&&ru.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),gEe=ru&&ru.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&hEe(t,e,r);return dEe(t,e),t},vEe=ru&&ru.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ru,"__esModule",{value:!0});var om=gEe(j3()),Dee=sc(),yEe=vEe(Uu());om.default.policies.disableRounding();function xEe(e){let t=yEe.default.space(e.xAxis,e.range,e.nSamples),r=e.xScale,n=e.yScale,i=n.domain()[0],o=n.domain()[1],u=[],l;for(l=0;ls[1].hi&&(a[1].hi=Math.max(o,a[1].hi),s[1].lo=Math.min(i,s[1].lo)),a[1].hi{"use strict";g();y();v();var NEe=a1&&a1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a1,"__esModule",{value:!0});var No=NEe(Uu()),o1=sc();function See(e,t,r,n,i){if(!i)return{asymptote:!0,d0:e,d1:t};let o=10,u=e[0],l=t[0],a=No.default.linspace(u,l,o),s,f;for(let p=0;p=2&&n!==x&&Math.abs(h/s)>1){let b=See(t[a-1],t[a],e,x,3);b.asymptote?(t[a-1][0]=b.d0[0],t[a-1][1]=No.default.clamp(b.d0[1],o,u),i.push(l),t[a][0]=b.d1[0],t[a][1]=No.default.clamp(b.d1[1],o,u),l=[t[a]]):l.push(t[a])}else l.push(t[a]);l.length>1&&(s=l[l.length-1][0]-l[l.length-2][0],n=x),++a}return l.length&&i.push(l),i}function SEe(e){let t=No.default.space(e.xAxis,e.range,e.nSamples),r=e.yScale.domain(),n=r[0]-No.default.infinity(),i=r[1]+No.default.infinity(),o=[];for(let l=0;l{"use strict";g();y();v();var tO=s1&&s1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s1,"__esModule",{value:!0});var Cee=tO(Od()),IEe=tO(Eee()),FEe=tO(Aee());function _Ee(e,t){let r=t.range||[-1/0,1/0],n=Math.max(e.domain()[0],r[0]),i=Math.min(e.domain()[1],r[1]);return[n,i]}function kEe(e,t){let r=_Ee(e.meta.xScale,t),n;if(t.sampler==="builtIn")n=FEe.default;else if(t.sampler==="interval")n=IEe.default;else throw new Error(`Invalid sampler function ${t.sampler}`);let i=t.nSamples||Math.min(Cee.default.MAX_ITERATIONS,Cee.default.DEFAULT_ITERATIONS||e.meta.width*2),o=n({d:t,range:r,xScale:e.meta.xScale,yScale:e.meta.yScale,xAxis:e.options.xAxis,yAxis:e.options.yAxis,nSamples:i});return e.emit("eval",o,t.index,t.isHelper),o}s1.default=kEe});var Oee=vt(u1=>{"use strict";g();y();v();var Tee=u1&&u1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u1,"__esModule",{value:!0});var Mee=(ti(),Cn(Qs)),rO=(e0(),Cn(jv)),oN=Tee(Uu()),BEe=Tee(iN());function LEe(e){function t(r){r.each(function(n){let i=t.el=(0,Mee.select)(this),o=n.index,u=(0,BEe.default)(e,n),l=oN.default.color(n,o),a=i.selectAll(":scope > path.line").data(u),s=e.meta.yScale.range(),f=s[0],p=s[1],h=f-p;f+=h*1e6,p-=h*1e6,n.skipBoundsCheck&&(f=oN.default.infinity(),p=-oN.default.infinity());function x(O){return oN.default.clamp(e.meta.yScale(O[1]),p,f)}let b=(0,rO.line)().curve(rO.curveLinear).x(function(O){return e.meta.xScale(O[0])}).y(x),w=(0,rO.area)().x(function(O){return e.meta.xScale(O[0])}).y0(e.meta.yScale(0)).y1(x),A=`line line-${o}`,E=a.enter().append("path").attr("class",A).attr("stroke-width",1).attr("stroke-linecap","round");a.merge(E).each(function(){let O=(0,Mee.select)(this),M;if(n.closed?(O.attr("fill",l),O.attr("fill-opacity",.3),M=w):(O.attr("fill","none"),M=b),O.attr("stroke",l).attr("marker-end",function(){return n.fnType==="vector"?"url(#"+e.markerId+")":null}).attr("d",M),n.attr)for(let I in n.attr){let F=n.attr[I];I==="class"&&(F=`${A} ${n.attr[I]}`),O.attr(I,F)}}),a.exit().remove()})}return t}u1.default=LEe});var Fee=vt(l1=>{"use strict";g();y();v();var Iee=l1&&l1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l1,"__esModule",{value:!0});var PEe=(ti(),Cn(Qs)),REe=Iee(iN()),qEe=Iee(Uu());function zEe(e){let t,r=e.meta.xScale,n=e.meta.yScale;function i(l,a,s,f){if(s>f){let x=s;s=f,f=x}let p=Math.min(a,f),h=Math.max(l,s);return h>p?[-t,0]:[h,p]}let o=function(l,a){let s="",f=n.range(),p=Math.min.apply(Math,f),h=Math.max.apply(Math,f);for(let x=0,b=l.length;x path.line").data(h);t=Math.max(h[0].scaledDx,1);let b=`line line-${f}`,w=x.enter().append("path").attr("class",b).attr("fill","none"),A=x.merge(w).attr("stroke-width",t).attr("stroke",qEe.default.color(a,f)).attr("opacity",p?.5:1).attr("d",function(E){return o(E,p)});if(a.attr)for(let E in a.attr){let O=a.attr[E];E==="class"&&(O=`${b} ${a.attr[E]}`),A.attr(E,O)}x.exit().remove()})}return u}l1.default=zEe});var kee=vt(f1=>{"use strict";g();y();v();var _ee=f1&&f1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(f1,"__esModule",{value:!0});var UEe=(ti(),Cn(Qs)),HEe=(Js(),Cn(T2)),$Ee=_ee(Uu()),WEe=_ee(iN());function VEe(e){let t=e.meta.xScale,r=e.meta.yScale;function n(i){i.each(function(o){let u,l,a=o.index,s=$Ee.default.color(o,a),f=(0,WEe.default)(e,o),p=[];for(u=0;u circle.scatter").data(p),x=`scatter scatter-${a}`,b=h.enter().append("circle").attr("class",x),w=h.merge(b).attr("fill",(0,HEe.hsl)(s.toString()).brighter(1.5).formatHex()).attr("stroke",s).attr("opacity",.7).attr("r",1).attr("cx",function(A){return t(A[0])}).attr("cy",function(A){return r(A[1])});if(o.attr)for(let A in o.attr){let E=o.attr[A];A==="class"&&(E=`${x} ${o.attr[A]}`),w.attr(A,E)}h.exit().remove()})}return n}f1.default=VEe});var Bee=vt(c1=>{"use strict";g();y();v();var GEe=c1&&c1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c1,"__esModule",{value:!0});var YEe=(ti(),Cn(Qs)),ZEe=(Js(),Cn(T2)),XEe=GEe(Uu());function KEe(e){let t=e.meta.xScale,r=e.meta.yScale;function n(i){i.each(function(o){o.sampler="builtIn",o.fnType="vector";let u=(0,YEe.select)(this).selectAll(":scope > text.fn-text").data([o.location]),l=u.enter().append("text").attr("class",`fn-text fn-text-${o.index}`),a=XEe.default.color(o,o.index),s=u.merge(l).attr("fill",(0,ZEe.hsl)(a.toString()).brighter(1.5).formatHex()).attr("x",f=>t(f[0])).attr("y",f=>r(f[1])).text(()=>o.text);if(o.attr)for(let f in o.attr)s.attr(f,o.attr[f]);u.exit().remove()})}return n}c1.default=KEe});var p1=vt(ms=>{"use strict";g();y();v();var aN=ms&&ms.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ms,"__esModule",{value:!0});ms.text=ms.scatter=ms.interval=ms.polyline=void 0;var JEe=aN(Oee());ms.polyline=JEe.default;var QEe=aN(Fee());ms.interval=QEe.default;var jEe=aN(kee());ms.scatter=jEe.default;var eSe=aN(Bee());ms.text=eSe.default});var sN=vt(nO=>{"use strict";g();y();v();Object.defineProperty(nO,"__esModule",{value:!0});function tSe(e){return"graphType"in e||(e.graphType="interval"),"sampler"in e||(e.sampler=e.graphType!=="interval"?"builtIn":"interval"),"fnType"in e||(e.fnType="linear"),e}nO.default=tSe});var Ree=vt(m1=>{"use strict";g();y();v();var Pee=m1&&m1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(m1,"__esModule",{value:!0});var rSe=(ti(),Cn(Qs)),nSe=p1(),Lee=sc(),iSe=Pee(sN()),oSe=Pee(Uu());function aSe(e){let t=(0,iSe.default)({isHelper:!0,skipTip:!0,skipBoundsCheck:!0,nSamples:2,graphType:"polyline"});function r(o){if(!o.derivative)return[];let u=typeof o.derivative.x0=="number"?o.derivative.x0:oSe.default.infinity();return t.index=o.index,t.scope={m:(0,Lee.builtIn)(o.derivative,"fn",{x:u}),x0:u,y0:(0,Lee.builtIn)(o,"fn",{x:u})},t.fn="m * (x - x0) + y0",[t]}function n(o){let u=this;o.derivative&&o.derivative.updateOnMouseMove&&!o.derivative.$$mouseListener&&(o.derivative.$$mouseListener=function({x:l}){o.derivative&&(o.derivative.x0=l),i(u)},e.on("tip:update",o.derivative.$$mouseListener))}let i=function(o){o.each(function(u){let l=(0,rSe.select)(this),a=r.call(o,u);n.call(o,u);let s=l.selectAll("g.derivative").data(a),f=s.enter().append("g").attr("class","derivative");s.merge(f).call((0,nSe.polyline)(e)),s.merge(f).selectAll("path").attr("opacity",.5),s.exit().remove()})};return i}m1.default=aSe});var Uee=vt(h1=>{"use strict";g();y();v();var zee=h1&&h1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(h1,"__esModule",{value:!0});var sSe=(ti(),Cn(Qs)),qee=sc(),uSe=zee(sN()),lSe=p1(),fSe=zee(Uu());function cSe(e){let t=(0,uSe.default)({isHelper:!0,skipTip:!0,skipBoundsCheck:!0,nSamples:2,graphType:"polyline"});function r(a){a.m=(a.y1-a.y0)/(a.x1-a.x0)}function n(a,s){if(!("x0"in s))throw Error("secant must have the property `x0` defined");s.scope=s.scope||{};let f=s.x0,p=typeof s.x1=="number"?s.x1:fSe.default.infinity();Object.assign(s.scope,{x0:f,x1:p,y0:(0,qee.builtIn)(a,"fn",{x:f}),y1:(0,qee.builtIn)(a,"fn",{x:p})}),r(s.scope)}function i(a,s){n(a,s),s.fn="m * (x - x0) + y0"}function o(a,s){let f=this;s.updateOnMouseMove&&!s.$$mouseListener&&(s.$$mouseListener=function({x:p}){s.x1=p,n(a,s),l(f)},e.on("tip:update",s.$$mouseListener))}function u(a){let s=this,f=[];a.secants=a.secants||[];for(let p=0;p{"use strict";g();y();v();var Hee=d1&&d1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d1,"__esModule",{value:!0});var pSe=(ti(),Cn(Qs)),mSe=Hee(Ree()),hSe=Hee(Uee());function dSe(e){function t(r){r.each(function(){let n=(0,pSe.select)(this);n.call((0,mSe.default)(e)),n.call((0,hSe.default)(e))})}return t}d1.default=dSe});var Yee=vt(zd=>{"use strict";g();y();v();var Ud=zd&&zd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zd,"__esModule",{value:!0});zd.Chart=void 0;var gSe=(e0(),Cn(jv)),vSe=(p2(),Cn(jV)),$ee=(CZ(),Cn(AZ)),Wee=(PZ(),Cn(LZ)),ySe=(CJ(),Cn(AJ)),uN=(ti(),Cn(Qs)),Vee=(Ml(),Cn(SY)),xSe=Ud((zJ(),Cn(qJ))),wSe=Ud(UJ()),bSe=Ud(bee()),DSe=Ud(iO()),NSe=Ud(sN()),lN=Ud(Od());function Gee(e){return e==="linear"?$ee.scaleLinear:$ee.scaleLog}var fN=class e extends xSe.default.EventEmitter{constructor(t){super();let r=Math.random(),n=String.fromCharCode(Math.floor(r*26)+97);this.options=t,this.id=n+r.toString(16).substr(2),this.options.id=this.id,this.markerId=this.id+"-marker",e.cache[this.id]=this,this.linkedGraphs=[this],this.meta={},this.setUpEventListeners()}build(){return this.internalVars(),this.drawGraphWrapper(),this}getDraggableNode(){return(0,uN.select)(this.options.target).select(".zoom-and-drag").node()}getEmitInstance(){let t=this,r=this.getDraggableNode();return r&&(t=r.instance),t}internalVars(){let t=this.meta.margin={left:40,right:20,top:20,bottom:20};this.options.title&&(this.meta.margin.top=40),this.meta.width=(this.options.width||lN.default.DEFAULT_WIDTH)-t.left-t.right,this.meta.height=(this.options.height||lN.default.DEFAULT_HEIGHT)-t.top-t.bottom,this.initializeAxes()}initializeAxes(){let t=this,r=(0,vSe.format)("~s");function n(l){return Math.abs(l)-Math.floor(Math.abs(l))>0?l.toString():r(l)}function i(l){let a=l[1]-l[0];return t.meta.height*a/t.meta.width}this.options.xAxis=this.options.xAxis||{},this.options.xAxis.type=this.options.xAxis.type||"linear",this.options.yAxis=this.options.yAxis||{},this.options.yAxis.type=this.options.yAxis.type||"linear";let o=this.meta.xDomain=function(l){if(l.domain)return l.domain;if(l.type==="linear")return[-12/2,12/2];if(l.type==="log")return[1,10];throw Error("axis type "+l.type+" unsupported")}(this.options.xAxis),u=this.meta.yDomain=function(l){if(l.domain)return l.domain;let a=i(o);if(l.type==="linear")return[-a/2,a/2];if(l.type==="log")return[1,10];throw Error("axis type "+l.type+" unsupported")}(this.options.yAxis);this.meta.xScale||(this.meta.xScale=Gee(this.options.xAxis.type)()),this.meta.xScale.domain(o).range(this.options.xAxis.invert?[this.meta.width,0]:[0,this.meta.width]),this.meta.yScale||(this.meta.yScale=Gee(this.options.yAxis.type)()),this.meta.yScale.domain(u).range(this.options.yAxis.invert?[0,this.meta.height]:[this.meta.height,0]),this.meta.xAxis||(this.meta.xAxis=(0,Wee.axisBottom)(this.meta.xScale)),this.meta.xAxis.tickSize(this.options.grid?-this.meta.height:0).tickFormat(n),this.meta.yAxis||(this.meta.yAxis=(0,Wee.axisLeft)(this.meta.yScale)),this.meta.yAxis.tickSize(this.options.grid?-this.meta.width:0).tickFormat(n),this.line=(0,gSe.line)().x(function(l){return t.meta.xScale(l[0])}).y(function(l){return t.meta.yScale(l[1])})}drawGraphWrapper(){let t=this.root=(0,uN.select)(this.options.target).selectAll("svg").data([this.options]);this.root.enter=t.enter().append("svg").attr("class","function-plot").attr("font-size",this.getFontSize()),t.merge(this.root.enter).attr("width",this.meta.width+this.meta.margin.left+this.meta.margin.right).attr("height",this.meta.height+this.meta.margin.top+this.meta.margin.bottom),this.buildTitle(),this.buildLegend(),this.buildCanvas(),this.buildClip(),this.buildAxis(),this.buildAxisLabel();let r=this.tip=(0,bSe.default)(Object.assign(this.options.tip||{},{owner:this}));this.canvas.merge(this.canvas.enter).call(r),this.setUpPlugins(),this.draw(),this.buildZoomHelper()}buildTitle(){let t=this.root.merge(this.root.enter).selectAll("text.title").data(function(n){return[n.title].filter(Boolean)});t.enter().append("text").merge(t).attr("class","title").attr("y",this.meta.margin.top/2).attr("x",this.meta.margin.left+this.meta.width/2).attr("font-size",25).attr("text-anchor","middle").attr("alignment-baseline","middle").text(this.options.title),t.exit().remove()}buildLegend(){this.root.enter.append("text").attr("class","top-right-legend").attr("text-anchor","end"),this.root.merge(this.root.enter).select(".top-right-legend").attr("y",this.meta.margin.top/2).attr("x",this.meta.width+this.meta.margin.left)}buildCanvas(){let t=this.canvas=this.root.merge(this.root.enter).selectAll(".canvas").data(function(r){return[r]});this.canvas.enter=t.enter().append("g").attr("class","canvas")}buildClip(){let t=this.id,r=this.canvas.enter.append("defs");r.append("clipPath").attr("id","function-plot-clip-"+t).append("rect").attr("class","clip static-clip"),this.canvas.merge(this.canvas.enter).selectAll(".clip").attr("width",this.meta.width).attr("height",this.meta.height),r.append("clipPath").append("marker").attr("id",this.markerId).attr("viewBox","0 -5 10 10").attr("refX",10).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("svg:path").attr("d","M0,-5L10,0L0,5L0,0").attr("stroke-width","0px").attr("fill-opacity",1).attr("fill","#777")}buildAxis(){let t=this.canvas.enter;t.append("g").attr("class","x axis"),t.append("g").attr("class","y axis"),this.canvas.merge(this.canvas.enter).select(".x.axis").attr("transform","translate(0,"+this.meta.height+")").call(this.meta.xAxis),this.canvas.merge(this.canvas.enter).select(".y.axis").call(this.meta.yAxis)}buildAxisLabel(){let t=this.canvas,r=t.merge(t.enter).selectAll("text.x.axis-label").data(function(u){return[u.xAxis.label].filter(Boolean)}),n=r.enter().append("text").attr("class","x axis-label").attr("text-anchor","end");r.merge(n).attr("x",this.meta.width).attr("y",this.meta.height-6).text(function(u){return u}),r.exit().remove();let i=t.merge(t.enter).selectAll("text.y.axis-label").data(function(u){return[u.yAxis.label].filter(Boolean)}),o=i.enter().append("text").attr("class","y axis-label").attr("y",6).attr("dy",".75em").attr("text-anchor","end").attr("transform","rotate(-90)");i.merge(o).text(function(u){return u}),i.exit().remove()}buildContent(){let t=this,r=this.canvas;r.merge(r.enter).attr("transform","translate("+this.meta.margin.left+","+this.meta.margin.top+")");let n=this.content=r.merge(r.enter).selectAll(":scope > g.content").data(function(l){return[l]}),i=n.enter().append("g").attr("clip-path","url(#function-plot-clip-"+this.id+")").attr("class","content");if(this.options.xAxis.type==="linear"){let l=n.merge(i).selectAll(":scope > path.y.origin").data([[[0,this.meta.yScale.domain()[0]],[0,this.meta.yScale.domain()[1]]]]),a=l.enter().append("path").attr("class","y origin").attr("stroke","black").attr("opacity",.2);l.merge(a).attr("d",this.line)}if(this.options.yAxis.type==="linear"){let l=n.merge(i).selectAll(":scope > path.x.origin").data([[[this.meta.xScale.domain()[0],0],[this.meta.xScale.domain()[1],0]]]),a=l.enter().append("path").attr("class","x origin").attr("stroke","black").attr("opacity",.2);l.merge(a).attr("d",this.line)}n.merge(i).call((0,wSe.default)({owner:t}));let o=n.merge(i).selectAll(":scope > g.graph").data(l=>l.data.map(NSe.default),l=>l.fn||l.r||l.x||l.text);o.exit().remove();let u=o.enter().append("g").attr("class","graph");o.merge(u).each(function(l,a){l.index=a;let s=(0,uN.select)(this);s.call(lN.default.graphTypes[l.graphType](t)),s.call((0,DSe.default)(t))})}buildZoomHelper(){let t=this;this.meta.zoomBehavior||(this.meta.zoomBehavior=(0,ySe.zoom)().on("zoom",function(n){t.getEmitInstance().emit("all:zoom",n)}),t.meta.zoomBehavior.xScale=t.meta.xScale.copy(),t.meta.zoomBehavior.yScale=t.meta.yScale.copy()),t.meta.zoomBehavior.xScale.range(t.meta.xScale.range()),t.meta.zoomBehavior.yScale.range(t.meta.yScale.range()),this.canvas.enter.append("rect").call(this.meta.zoomBehavior).attr("class","zoom-and-drag").style("fill","none").style("pointer-events","all").on("mouseover",function(r){t.getEmitInstance().emit("all:mouseover",r)}).on("mouseout",function(r){t.getEmitInstance().emit("all:mouseout",r)}).on("mousemove",function(r){t.getEmitInstance().emit("all:mousemove",r)}),this.draggable=this.canvas.merge(this.canvas.enter).select(".zoom-and-drag").call(r=>{r.node()&&(r.node().instance=t)}).attr("width",this.meta.width).attr("height",this.meta.height)}setUpPlugins(){let t=this.options.plugins||[],r=this;t.forEach(function(n){n(r)})}addLink(){for(let t=0;t{"use strict";g();y();v();Object.defineProperty(Zee,"__esModule",{value:!0})});var ete=vt(mn=>{"use strict";g();y();v();var Kee=mn&&mn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),ESe=mn&&mn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Jee=mn&&mn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Kee(t,e,r);return ESe(t,e),t},Qee=mn&&mn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Kee(t,e,r)};Object.defineProperty(mn,"__esModule",{value:!0});mn.GraphTypeScatter=mn.GraphTypePolyline=mn.GraphTypeInterval=mn.EvalInterval=mn.EvalBuiltIn=mn.registerGraphType=mn.Chart=void 0;aW();var oO=Yee();Object.defineProperty(mn,"Chart",{enumerable:!0,get:function(){return oO.Chart}});var Hd=Jee(Od());Object.defineProperty(mn,"registerGraphType",{enumerable:!0,get:function(){return Hd.registerGraphType}});var am=p1(),SSe=Jee(sc());(0,Hd.registerGraphType)("polyline",am.polyline);(0,Hd.registerGraphType)("interval",am.interval);(0,Hd.registerGraphType)("scatter",am.scatter);(0,Hd.registerGraphType)("text",am.text);function cN(e){e.data=e.data||[];let t=oO.Chart.cache[e.id];return t||(t=new oO.Chart(e)),t.build()}mn.default=cN;cN.globals=Hd.default;cN.$eval=SSe;cN.graphTypes={interval:am.interval,polyline:am.polyline,scatter:am.scatter};Qee(Xee(),mn);var jee=sc();Object.defineProperty(mn,"EvalBuiltIn",{enumerable:!0,get:function(){return jee.builtIn}});Object.defineProperty(mn,"EvalInterval",{enumerable:!0,get:function(){return jee.interval}});var aO=p1();Object.defineProperty(mn,"GraphTypeInterval",{enumerable:!0,get:function(){return aO.interval}});Object.defineProperty(mn,"GraphTypePolyline",{enumerable:!0,get:function(){return aO.polyline}});Object.defineProperty(mn,"GraphTypeScatter",{enumerable:!0,get:function(){return aO.scatter}});Qee(iO(),mn)});var nte=vt((sO,rte)=>{g();y();v();(function(e,t){var r=t(e);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return r});else if(typeof sO=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))rte.exports=r;else{var n=e.DeepDiff;r.noConflict=function(){return e.DeepDiff===r&&(e.DeepDiff=n),r},e.DeepDiff=r}})(sO,function(e){var t=["N","E","A","D"];function r(C,P){C.super_=P,C.prototype=Object.create(P.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}})}function n(C,P){Object.defineProperty(this,"kind",{value:C,enumerable:!0}),P&&P.length&&Object.defineProperty(this,"path",{value:P,enumerable:!0})}function i(C,P,R){i.super_.call(this,"E",C),Object.defineProperty(this,"lhs",{value:P,enumerable:!0}),Object.defineProperty(this,"rhs",{value:R,enumerable:!0})}r(i,n);function o(C,P){o.super_.call(this,"N",C),Object.defineProperty(this,"rhs",{value:P,enumerable:!0})}r(o,n);function u(C,P){u.super_.call(this,"D",C),Object.defineProperty(this,"lhs",{value:P,enumerable:!0})}r(u,n);function l(C,P,R){l.super_.call(this,"A",C),Object.defineProperty(this,"index",{value:P,enumerable:!0}),Object.defineProperty(this,"item",{value:R,enumerable:!0})}r(l,n);function a(C,P,R){var q=C.slice((R||P)+1||C.length);return C.length=P<0?C.length+P:P,C.push.apply(C,q),C}function s(C){var P=typeof C;return P!=="object"?P:C===Math?"math":C===null?"null":Array.isArray(C)?"array":Object.prototype.toString.call(C)==="[object Date]"?"date":typeof C.toString=="function"&&/^\/.*\//.test(C.toString())?"regexp":"object"}function f(C){var P=0;if(C.length===0)return P;for(var R=0;R0&&V[V.length-1].lhs&&Object.getOwnPropertyDescriptor(V[V.length-1].lhs,H),ce=Z!=="undefined"||V&&V.length>0&&V[V.length-1].rhs&&Object.getOwnPropertyDescriptor(V[V.length-1].rhs,H);if(!we&&ce)R.push(new o(ee,P));else if(!ce&&we)R.push(new u(ee,C));else if(s(C)!==s(P))R.push(new i(ee,C,P));else if(s(C)==="date"&&C-P!==0)R.push(new i(ee,C,P));else if(Y==="object"&&C!==null&&P!==null){for(le=V.length-1;le>-1;--le)if(V[le].lhs===C){De=!0;break}if(De)C!==P&&R.push(new i(ee,C,P));else{if(V.push({lhs:C,rhs:P}),Array.isArray(C)){for(W&&(C.sort(function(Ce,Oe){return p(Ce)-p(Oe)}),P.sort(function(Ce,Oe){return p(Ce)-p(Oe)})),le=P.length-1,re=C.length-1;le>re;)R.push(new l(ee,le,new o(void 0,P[le--])));for(;re>le;)R.push(new l(ee,re,new u(void 0,C[re--])));for(;le>=0;--le)h(C[le],P[le],R,q,ee,le,V,W)}else{var Ee=Object.keys(C),Pe=Object.keys(P);for(le=0;le=0?(h(C[he],P[he],R,q,ee,he,V,W),Pe[De]=null):h(C[he],void 0,R,q,ee,he,V,W);for(le=0;le"u"&&P&&~t.indexOf(P.kind)&&(R=P),C&&R&&R.kind){for(var q=C,U=-1,H=R.path?R.path.length-1:0;++U"u"&&(q[R.path[U]]=typeof R.path[U+1]<"u"&&typeof R.path[U+1]=="number"?[]:{}),q=q[R.path[U]];switch(R.kind){case"A":R.path&&typeof q[R.path[U]]>"u"&&(q[R.path[U]]=[]),E(R.path?q[R.path[U]]:q,R.index,R.item);break;case"D":delete q[R.path[U]];break;case"E":case"N":q[R.path[U]]=R.rhs;break}}}function M(C,P,R){if(R.path&&R.path.length){var q=C[P],U,H=R.path.length-1;for(U=0;U"u"&&(q[R.path[U]]={}),q=q[R.path[U]];switch(R.kind){case"A":M(q[R.path[U]],R.index,R.item);break;case"D":q[R.path[U]]=R.lhs;break;case"E":q[R.path[U]]=R.lhs;break;case"N":delete q[R.path[U]];break}}}function F(C,P,R){if(C&&P){var q=function(U){(!R||R(C,P,U))&&O(C,P,U)};x(C,P,q)}}return Object.defineProperties(w,{diff:{value:w,enumerable:!0},orderIndependentDiff:{value:A,enumerable:!0},observableDiff:{value:x,enumerable:!0},orderIndependentObservableDiff:{value:b,enumerable:!0},orderIndepHash:{value:p,enumerable:!0},applyDiff:{value:F,enumerable:!0},applyChange:{value:O,enumerable:!0},revertChange:{value:I,enumerable:!0},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:!0}}),w.DeepDiff=w,e&&(e.DeepDiff=w),w})});var mte=vt((l2r,hN)=>{g();y();v();(function(e,t,r){if(!e)return;for(var n={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},u={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,a=1;a<20;++a)n[111+a]="f"+a;for(a=0;a<=9;++a)n[a+96]=a.toString();function s(C,P,R){if(C.addEventListener){C.addEventListener(P,R,!1);return}C.attachEvent("on"+P,R)}function f(C){if(C.type=="keypress"){var P=String.fromCharCode(C.which);return C.shiftKey||(P=P.toLowerCase()),P}return n[C.which]?n[C.which]:i[C.which]?i[C.which]:String.fromCharCode(C.which).toLowerCase()}function p(C,P){return C.sort().join(",")===P.sort().join(",")}function h(C){var P=[];return C.shiftKey&&P.push("shift"),C.altKey&&P.push("alt"),C.ctrlKey&&P.push("ctrl"),C.metaKey&&P.push("meta"),P}function x(C){if(C.preventDefault){C.preventDefault();return}C.returnValue=!1}function b(C){if(C.stopPropagation){C.stopPropagation();return}C.cancelBubble=!0}function w(C){return C=="shift"||C=="ctrl"||C=="alt"||C=="meta"}function A(){if(!l){l={};for(var C in n)C>95&&C<112||n.hasOwnProperty(C)&&(l[n[C]]=C)}return l}function E(C,P,R){return R||(R=A()[C]?"keydown":"keypress"),R=="keypress"&&P.length&&(R="keydown"),R}function O(C){return C==="+"?["+"]:(C=C.replace(/\+{2}/g,"+plus"),C.split("+"))}function M(C,P){var R,q,U,H=[];for(R=O(C),U=0;U1){le(he,Pe,De,we);return}Ce=M(he,we),P._callbacks[Ce.key]=P._callbacks[Ce.key]||[],ee(Ce.key,Ce.modifiers,{type:Ce.action},ce,he,Ee),P._callbacks[Ce.key][ce?"unshift":"push"]({callback:De,modifiers:Ce.modifiers,action:Ce.action,seq:ce,level:Ee,combo:he})}P._bindMultiple=function(he,De,we){for(var ce=0;ce-1||I(P,R.target))return!1;if("composedPath"in C&&typeof C.composedPath=="function"){var q=C.composedPath()[0];q!==C.target&&(P=q)}return P.tagName=="INPUT"||P.tagName=="SELECT"||P.tagName=="TEXTAREA"||P.isContentEditable},F.prototype.handleKey=function(){var C=this;return C._handleKey.apply(C,arguments)},F.addKeycodes=function(C){for(var P in C)C.hasOwnProperty(P)&&(n[P]=C[P]);l=null},F.init=function(){var C=F(t);for(var P in C)P.charAt(0)!=="_"&&(F[P]=function(R){return function(){return C[R].apply(C,arguments)}}(P))},F.init(),e.Mousetrap=F,typeof hN<"u"&&hN.exports&&(hN.exports=F),typeof define=="function"&&define.amd&&define(function(){return F})})(typeof window<"u"?window:null,typeof window<"u"?document:null)});g();y();v();g();y();v();var Ve=e=>document.querySelector(e),Kn=e=>document.querySelectorAll(e),Xt={get:e=>JSON.parse(localStorage.getItem(e)),set:(e,t)=>{localStorage.setItem(e,JSON.stringify(t))}},Ge={activePlot:null,activePage:null,currencyRates:{},mathScope:{},plotFunction:null,refreshCM:!0,settings:null,udfList:[],uduList:[]};g();y();v();g();y();v();g();y();v();g();y();v();g();y();v();var Gm=rn(Vm(),1);function bu(e){Gm.default.modal(e,{bgClose:!1,stack:!0}).show()}function yf(e,t){Gm.default.util.on("#dialog-error","beforeshow",()=>{Ve("#errTitle").innerHTML=e,Ve("#errMsg").innerHTML=t}),bu("#dialog-error")}function Rn(e,t){Gm.default.notification({message:e,pos:Ge.settings.notifyLocation,status:t||"primary",timeout:+Ge.settings.notifyDuration})}function Ym(e,t){Ve("#confirmMsg").innerHTML=e,bu("#dialog-confirm");let r=n=>{t(),n.stopPropagation(),Gm.default.modal("#dialog-confirm").hide(),Ve("#confirm-yes").removeEventListener("click",r)};Ve("#confirm-yes").addEventListener("click",r),Gm.default.util.on("#dialog-confirm","hidden",()=>{Ve("#confirm-yes").removeEventListener("click",r)})}var MO=navigator.userAgent.toLowerCase().includes("mac"),Bi=navigator.userAgent.toLowerCase().includes("electron");function Uy(){let e=Ge.settings.locale==="system"?navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language:Ge.settings.locale;return 1.11.toLocaleString(e).match(/[,]/)}function Hy(){Ve("#resetSizeButton").style.display=Bi&&numara.isResized()&&!numara.isMaximized()?"block":"none"}function NE(){numara.isMaximized()?numara.unmaximize():numara.maximize()}function TO(){Bi&&(numara.checkUpdate(),numara.notifyUpdate(()=>{Rn('Updating Numara... View update status'),Ve("#notificationDot").style.display="block"}),numara.updateStatus((e,t)=>{t==="ready"?(Ve("#dialog-about-updateStatus").innerHTML="Restart Numara to finish updating.",Ve("#restartButton").style.display="inline-block",Ve("#dialog-about").classList.contains("uk-open")||Rn('Restart Numara to finish updating. Restart Now')):Ve("#dialog-about-updateStatus").innerHTML=t}))}g();y();v();g();y();v();g();y();v();g();y();v();var cl=class extends Error{},$y=class extends cl{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}},Wy=class extends cl{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}},Vy=class extends cl{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}},Ms=class extends cl{},Zm=class extends cl{constructor(t){super(`Invalid unit ${t}`)}},di=class extends cl{},Ts=class extends cl{constructor(){super("Zone is an abstract class")}};g();y();v();g();y();v();g();y();v();var _t="numeric",Os="short",ma="long",xf={year:_t,month:_t,day:_t},Vg={year:_t,month:Os,day:_t},EE={year:_t,month:Os,day:_t,weekday:Os},Gg={year:_t,month:ma,day:_t},Yg={year:_t,month:ma,day:_t,weekday:ma},Zg={hour:_t,minute:_t},Xg={hour:_t,minute:_t,second:_t},Kg={hour:_t,minute:_t,second:_t,timeZoneName:Os},Jg={hour:_t,minute:_t,second:_t,timeZoneName:ma},Qg={hour:_t,minute:_t,hourCycle:"h23"},jg={hour:_t,minute:_t,second:_t,hourCycle:"h23"},ev={hour:_t,minute:_t,second:_t,hourCycle:"h23",timeZoneName:Os},tv={hour:_t,minute:_t,second:_t,hourCycle:"h23",timeZoneName:ma},rv={year:_t,month:_t,day:_t,hour:_t,minute:_t},nv={year:_t,month:_t,day:_t,hour:_t,minute:_t,second:_t},iv={year:_t,month:Os,day:_t,hour:_t,minute:_t},ov={year:_t,month:Os,day:_t,hour:_t,minute:_t,second:_t},SE={year:_t,month:Os,day:_t,weekday:Os,hour:_t,minute:_t},av={year:_t,month:ma,day:_t,hour:_t,minute:_t,timeZoneName:Os},sv={year:_t,month:ma,day:_t,hour:_t,minute:_t,second:_t,timeZoneName:Os},uv={year:_t,month:ma,day:_t,weekday:ma,hour:_t,minute:_t,timeZoneName:ma},lv={year:_t,month:ma,day:_t,weekday:ma,hour:_t,minute:_t,second:_t,timeZoneName:ma};g();y();v();g();y();v();g();y();v();g();y();v();var Wo=class{get type(){throw new Ts}get name(){throw new Ts}get ianaName(){return this.name}get isUniversal(){throw new Ts}offsetName(t,r){throw new Ts}formatOffset(t,r){throw new Ts}offset(t){throw new Ts}equals(t){throw new Ts}get isValid(){throw new Ts}};var AE=null,wf=class e extends Wo{static get instance(){return AE===null&&(AE=new e),AE}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:r,locale:n}){return Yy(t,r,n)}formatOffset(t,r){return bf(this.offset(t),r)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}};g();y();v();var Xy={};function Qte(e){return Xy[e]||(Xy[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Xy[e]}var jte={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ere(e,t){let r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,i,o,u,l,a,s,f]=n;return[u,i,o,l,a,s,f]}function tre(e,t){let r=e.formatToParts(t),n=[];for(let i=0;i=0?b:1e3+b,(h-x)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}};g();y();v();var OO={};function rre(e,t={}){let r=JSON.stringify([e,t]),n=OO[r];return n||(n=new Intl.ListFormat(e,t),OO[r]=n),n}var CE={};function ME(e,t={}){let r=JSON.stringify([e,t]),n=CE[r];return n||(n=new Intl.DateTimeFormat(e,t),CE[r]=n),n}var TE={};function nre(e,t={}){let r=JSON.stringify([e,t]),n=TE[r];return n||(n=new Intl.NumberFormat(e,t),TE[r]=n),n}var OE={};function ire(e,t={}){let{base:r,...n}=t,i=JSON.stringify([e,n]),o=OE[i];return o||(o=new Intl.RelativeTimeFormat(e,t),OE[i]=o),o}var fv=null;function ore(){return fv||(fv=new Intl.DateTimeFormat().resolvedOptions().locale,fv)}var IO={};function are(e){let t=IO[e];if(!t){let r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,IO[e]=t}return t}function sre(e){let t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));let r=e.indexOf("-u-");if(r===-1)return[e];{let n,i;try{n=ME(e).resolvedOptions(),i=e}catch{let a=e.substring(0,r);n=ME(a).resolvedOptions(),i=a}let{numberingSystem:o,calendar:u}=n;return[i,o,u]}}function ure(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}function lre(e){let t=[];for(let r=1;r<=12;r++){let n=Nr.utc(2009,r,1);t.push(e(n))}return t}function fre(e){let t=[];for(let r=1;r<=7;r++){let n=Nr.utc(2016,11,13+r);t.push(e(n))}return t}function Ky(e,t,r,n){let i=e.listingMode();return i==="error"?null:i==="en"?r(t):n(t)}function cre(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}var IE=class{constructor(t,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:i,floor:o,...u}=n;if(!r||Object.keys(u).length>0){let l={useGrouping:!1,...n};n.padTo>0&&(l.minimumIntegerDigits=n.padTo),this.inf=nre(t,l)}}format(t){if(this.inf){let r=this.floor?Math.floor(t):t;return this.inf.format(r)}else{let r=this.floor?Math.floor(t):Km(t,3);return qn(r,this.padTo)}}},FE=class{constructor(t,r,n){this.opts=n,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let u=-1*(t.offset/60),l=u>=0?`Etc/GMT+${u}`:`Etc/GMT${u}`;t.offset!==0&&fo.create(l).valid?(i=l,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let o={...this.opts};o.timeZone=o.timeZone||i,this.dtf=ME(r,o)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(r=>{if(r.type==="timeZoneName"){let n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},_E=class{constructor(t,r,n){this.opts={style:"long",...n},!r&&Jy()&&(this.rtf=ire(t,n))}format(t,r){return this.rtf?this.rtf.format(t,r):FO(r,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,r){return this.rtf?this.rtf.formatToParts(t,r):[]}},pre={firstDay:1,minimalDays:4,weekend:[6,7]},Zr=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,r,n,i,o=!1){let u=t||$r.defaultLocale,l=u||(o?"en-US":ore()),a=r||$r.defaultNumberingSystem,s=n||$r.defaultOutputCalendar,f=cv(i)||$r.defaultWeekSettings;return new e(l,a,s,f,u)}static resetCache(){fv=null,CE={},TE={},OE={}}static fromObject({locale:t,numberingSystem:r,outputCalendar:n,weekSettings:i}={}){return e.create(t,r,n,i)}constructor(t,r,n,i,o){let[u,l,a]=sre(t);this.locale=u,this.numberingSystem=r||l||null,this.outputCalendar=n||a||null,this.weekSettings=i,this.intl=ure(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=cre(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&r?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,cv(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,r=!1){return Ky(this,t,kE,()=>{let n=r?{month:t,day:"numeric"}:{month:t},i=r?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=lre(o=>this.extract(o,n,"month"))),this.monthsCache[i][t]})}weekdays(t,r=!1){return Ky(this,t,BE,()=>{let n=r?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=r?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=fre(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return Ky(this,void 0,()=>LE,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Nr.utc(2016,11,13,9),Nr.utc(2016,11,13,19)].map(r=>this.extract(r,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Ky(this,t,PE,()=>{let r={era:t};return this.eraCache[t]||(this.eraCache[t]=[Nr.utc(-40,1,1),Nr.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[t]})}extract(t,r,n){let i=this.dtFormatter(t,r),o=i.formatToParts(),u=o.find(l=>l.type.toLowerCase()===n);return u?u.value:null}numberFormatter(t={}){return new IE(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,r={}){return new FE(t,this.intl,r)}relFormatter(t={}){return new _E(this.intl,this.isEnglish(),t)}listFormatter(t={}){return rre(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Qy()?are(this.locale):pre}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}};g();y();v();g();y();v();var qE=null,Li=class e extends Wo{static get utcInstance(){return qE===null&&(qE=new e(0)),qE}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let r=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new e(ap(r[1],r[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${bf(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${bf(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,r){return bf(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};g();y();v();var Jm=class extends Wo{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function Is(e,t){let r;if(ir(e)||e===null)return t;if(e instanceof Wo)return e;if(_O(e)){let n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?wf.instance:n==="utc"||n==="gmt"?Li.utcInstance:Li.parseSpecifier(n)||fo.create(e)}else return Du(e)?Li.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Jm(e)}var kO=()=>Date.now(),BO="system",LO=null,PO=null,RO=null,qO=60,zO,UO=null,$r=class{static get now(){return kO}static set now(t){kO=t}static set defaultZone(t){BO=t}static get defaultZone(){return Is(BO,wf.instance)}static get defaultLocale(){return LO}static set defaultLocale(t){LO=t}static get defaultNumberingSystem(){return PO}static set defaultNumberingSystem(t){PO=t}static get defaultOutputCalendar(){return RO}static set defaultOutputCalendar(t){RO=t}static get defaultWeekSettings(){return UO}static set defaultWeekSettings(t){UO=cv(t)}static get twoDigitCutoffYear(){return qO}static set twoDigitCutoffYear(t){qO=t%100}static get throwOnInvalid(){return zO}static set throwOnInvalid(t){zO=t}static resetCaches(){Zr.resetCache(),fo.resetCache()}};g();y();v();g();y();v();var Pi=class{constructor(t,r){this.reason=t,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var HO=[0,31,59,90,120,151,181,212,243,273,304,334],$O=[0,31,60,91,121,152,182,213,244,274,305,335];function za(e,t){return new Pi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function jy(e,t,r){let n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);let i=n.getUTCDay();return i===0?7:i}function WO(e,t,r){return r+(up(e)?$O:HO)[t-1]}function VO(e,t){let r=up(e)?$O:HO,n=r.findIndex(o=>osp(n,t,r)?(s=n+1,a=1):s=n,{weekYear:s,weekNumber:a,weekday:l,...hv(e)}}function zE(e,t=4,r=1){let{weekYear:n,weekNumber:i,weekday:o}=e,u=ex(jy(n,1,t),r),l=Df(n),a=i*7+o-u-7+t,s;a<1?(s=n-1,a+=Df(s)):a>l?(s=n+1,a-=Df(n)):s=n;let{month:f,day:p}=VO(s,a);return{year:s,month:f,day:p,...hv(e)}}function tx(e){let{year:t,month:r,day:n}=e,i=WO(t,r,n);return{year:t,ordinal:i,...hv(e)}}function UE(e){let{year:t,ordinal:r}=e,{month:n,day:i}=VO(t,r);return{year:t,month:n,day:i,...hv(e)}}function HE(e,t){if(!ir(e.localWeekday)||!ir(e.localWeekNumber)||!ir(e.localWeekYear)){if(!ir(e.weekday)||!ir(e.weekNumber)||!ir(e.weekYear))throw new Ms("Cannot mix locale-based week fields with ISO-based week fields");return ir(e.localWeekday)||(e.weekday=e.localWeekday),ir(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),ir(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function GO(e,t=4,r=1){let n=mv(e.weekYear),i=ha(e.weekNumber,1,sp(e.weekYear,t,r)),o=ha(e.weekday,1,7);return n?i?o?!1:za("weekday",e.weekday):za("week",e.weekNumber):za("weekYear",e.weekYear)}function YO(e){let t=mv(e.year),r=ha(e.ordinal,1,Df(e.year));return t?r?!1:za("ordinal",e.ordinal):za("year",e.year)}function $E(e){let t=mv(e.year),r=ha(e.month,1,12),n=ha(e.day,1,Qm(e.year,e.month));return t?r?n?!1:za("day",e.day):za("month",e.month):za("year",e.year)}function WE(e){let{hour:t,minute:r,second:n,millisecond:i}=e,o=ha(t,0,23)||t===24&&r===0&&n===0&&i===0,u=ha(r,0,59),l=ha(n,0,59),a=ha(i,0,999);return o?u?l?a?!1:za("millisecond",i):za("second",n):za("minute",r):za("hour",t)}function ir(e){return typeof e>"u"}function Du(e){return typeof e=="number"}function mv(e){return typeof e=="number"&&e%1===0}function _O(e){return typeof e=="string"}function XO(e){return Object.prototype.toString.call(e)==="[object Date]"}function Jy(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Qy(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function KO(e){return Array.isArray(e)?e:[e]}function VE(e,t,r){if(e.length!==0)return e.reduce((n,i)=>{let o=[t(i),i];return n&&r(n[0],o[0])===n[0]?n:o},null)[1]}function JO(e,t){return t.reduce((r,n)=>(r[n]=e[n],r),{})}function Nf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function cv(e){if(e==null)return null;if(typeof e!="object")throw new di("Week settings must be an object");if(!ha(e.firstDay,1,7)||!ha(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ha(t,1,7)))throw new di("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ha(e,t,r){return mv(e)&&e>=t&&e<=r}function mre(e,t){return e-t*Math.floor(e/t)}function qn(e,t=2){let r=e<0,n;return r?n="-"+(""+-e).padStart(t,"0"):n=(""+e).padStart(t,"0"),n}function pl(e){if(!(ir(e)||e===null||e===""))return parseInt(e,10)}function Ef(e){if(!(ir(e)||e===null||e===""))return parseFloat(e)}function dv(e){if(!(ir(e)||e===null||e==="")){let t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Km(e,t,r=!1){let n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function up(e){return e%4===0&&(e%100!==0||e%400===0)}function Df(e){return up(e)?366:365}function Qm(e,t){let r=mre(t-1,12)+1,n=e+(t-r)/12;return r===2?up(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function Xm(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function ZO(e,t,r){return-ex(jy(e,1,t),r)+t-1}function sp(e,t=4,r=1){let n=ZO(e,t,r),i=ZO(e+1,t,r);return(Df(e)-n+i)/7}function gv(e){return e>99?e:e>$r.twoDigitCutoffYear?1900+e:2e3+e}function Yy(e,t,r,n=null){let i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);let u={timeZoneName:t,...o},l=new Intl.DateTimeFormat(r,u).formatToParts(i).find(a=>a.type.toLowerCase()==="timezonename");return l?l.value:null}function ap(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);let n=parseInt(t,10)||0,i=r<0||Object.is(r,-0)?-n:n;return r*60+i}function GE(e){let t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new di(`Invalid unit value ${e}`);return t}function jm(e,t){let r={};for(let n in e)if(Nf(e,n)){let i=e[n];if(i==null)continue;r[t(n)]=GE(i)}return r}function bf(e,t){let r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${qn(r,2)}:${qn(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${qn(r,2)}${qn(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function hv(e){return JO(e,["hour","minute","second","millisecond"])}var hre=["January","February","March","April","May","June","July","August","September","October","November","December"],YE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dre=["J","F","M","A","M","J","J","A","S","O","N","D"];function kE(e){switch(e){case"narrow":return[...dre];case"short":return[...YE];case"long":return[...hre];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var ZE=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],XE=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],gre=["M","T","W","T","F","S","S"];function BE(e){switch(e){case"narrow":return[...gre];case"short":return[...XE];case"long":return[...ZE];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var LE=["AM","PM"],vre=["Before Christ","Anno Domini"],yre=["BC","AD"],xre=["B","A"];function PE(e){switch(e){case"narrow":return[...xre];case"short":return[...yre];case"long":return[...vre];default:return null}}function QO(e){return LE[e.hour<12?0:1]}function jO(e,t){return BE(t)[e.weekday-1]}function eI(e,t){return kE(t)[e.month-1]}function tI(e,t){return PE(t)[e.year<0?0:1]}function FO(e,t,r="always",n=!1){let i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(r==="auto"&&o){let p=e==="days";switch(t){case 1:return p?"tomorrow":`next ${i[e][0]}`;case-1:return p?"yesterday":`last ${i[e][0]}`;case 0:return p?"today":`this ${i[e][0]}`;default:}}let u=Object.is(t,-0)||t<0,l=Math.abs(t),a=l===1,s=i[e],f=n?a?s[1]:s[2]||s[1]:a?i[e][0]:e;return u?`${l} ${f} ago`:`in ${l} ${f}`}function rI(e,t){let r="";for(let n of e)n.literal?r+=n.val:r+=t(n.val);return r}var wre={D:xf,DD:Vg,DDD:Gg,DDDD:Yg,t:Zg,tt:Xg,ttt:Kg,tttt:Jg,T:Qg,TT:jg,TTT:ev,TTTT:tv,f:rv,ff:iv,fff:av,ffff:uv,F:nv,FF:ov,FFF:sv,FFFF:lv},Ri=class e{static create(t,r={}){return new e(t,r)}static parseFormat(t){let r=null,n="",i=!1,o=[];for(let u=0;u0&&o.push({literal:i||/^\s+$/.test(n),val:n}),r=null,n="",i=!i):i||l===r?n+=l:(n.length>0&&o.push({literal:/^\s+$/.test(n),val:n}),n=l,r=l)}return n.length>0&&o.push({literal:i||/^\s+$/.test(n),val:n}),o}static macroTokenToFormatOpts(t){return wre[t]}constructor(t,r){this.opts=r,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...r}).format()}dtFormatter(t,r={}){return this.loc.dtFormatter(t,{...this.opts,...r})}formatDateTime(t,r){return this.dtFormatter(t,r).format()}formatDateTimeParts(t,r){return this.dtFormatter(t,r).formatToParts()}formatInterval(t,r){return this.dtFormatter(t.start,r).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,r){return this.dtFormatter(t,r).resolvedOptions()}num(t,r=0){if(this.opts.forceSimple)return qn(t,r);let n={...this.opts};return r>0&&(n.padTo=r),this.loc.numberFormatter(n).format(t)}formatDateTimeFromString(t,r){let n=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(x,b)=>this.loc.extract(t,x,b),u=x=>t.isOffsetFixed&&t.offset===0&&x.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,x.format):"",l=()=>n?QO(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(x,b)=>n?eI(t,x):o(b?{month:x}:{month:x,day:"numeric"},"month"),s=(x,b)=>n?jO(t,x):o(b?{weekday:x}:{weekday:x,month:"long",day:"numeric"},"weekday"),f=x=>{let b=e.macroTokenToFormatOpts(x);return b?this.formatWithSystemDefault(t,b):x},p=x=>n?tI(t,x):o({era:x},"era"),h=x=>{switch(x){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return u({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return u({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return u({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return s("short",!0);case"cccc":return s("long",!0);case"ccccc":return s("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return s("short",!1);case"EEEE":return s("long",!1);case"EEEEE":return s("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return p("short");case"GG":return p("long");case"GGGGG":return p("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(x)}};return rI(e.parseFormat(r),h)}formatDurationFromString(t,r){let n=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=a=>s=>{let f=n(s);return f?this.num(a.get(f),s.length):s},o=e.parseFormat(r),u=o.reduce((a,{literal:s,val:f})=>s?a:a.concat(f),[]),l=t.shiftTo(...u.map(n).filter(a=>a));return rI(o,i(l))}};g();y();v();var iI=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function th(...e){let t=e.reduce((r,n)=>r+n.source,"");return RegExp(`^${t}$`)}function rh(...e){return t=>e.reduce(([r,n,i],o)=>{let[u,l,a]=o(t,i);return[{...r,...u},l||n,a]},[{},null,1]).slice(0,2)}function nh(e,...t){if(e==null)return[null,null];for(let[r,n]of t){let i=r.exec(e);if(i)return n(i)}return[null,null]}function oI(...e){return(t,r)=>{let n={},i;for(i=0;ix!==void 0&&(b||x&&f)?-x:x;return[{years:h(Ef(r)),months:h(Ef(n)),weeks:h(Ef(i)),days:h(Ef(o)),hours:h(Ef(u)),minutes:h(Ef(l)),seconds:h(Ef(a),a==="-0"),milliseconds:h(dv(s),p)}]}var _re={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function QE(e,t,r,n,i,o,u){let l={year:t.length===2?gv(pl(t)):pl(t),month:YE.indexOf(r)+1,day:pl(n),hour:pl(i),minute:pl(o)};return u&&(l.second=pl(u)),e&&(l.weekday=e.length>3?ZE.indexOf(e)+1:XE.indexOf(e)+1),l}var kre=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Bre(e){let[,t,r,n,i,o,u,l,a,s,f,p]=e,h=QE(t,i,n,r,o,u,l),x;return a?x=_re[a]:s?x=0:x=ap(f,p),[h,new Li(x)]}function Lre(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var Pre=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Rre=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,qre=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function nI(e){let[,t,r,n,i,o,u,l]=e;return[QE(t,i,n,r,o,u,l),Li.utcInstance]}function zre(e){let[,t,r,n,i,o,u,l]=e;return[QE(t,l,r,n,i,o,u),Li.utcInstance]}var Ure=th(Dre,JE),Hre=th(Nre,JE),$re=th(Ere,JE),Wre=th(sI),lI=rh(Tre,ih,vv,yv),Vre=rh(Sre,ih,vv,yv),Gre=rh(Are,ih,vv,yv),Yre=rh(ih,vv,yv);function fI(e){return nh(e,[Ure,lI],[Hre,Vre],[$re,Gre],[Wre,Yre])}function cI(e){return nh(Lre(e),[kre,Bre])}function pI(e){return nh(e,[Pre,nI],[Rre,nI],[qre,zre])}function mI(e){return nh(e,[Ire,Fre])}var Zre=rh(ih);function hI(e){return nh(e,[Ore,Zre])}var Xre=th(Cre,Mre),Kre=th(uI),Jre=rh(ih,vv,yv);function dI(e){return nh(e,[Xre,lI],[Kre,Jre])}var gI="Invalid Duration",yI={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Qre={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...yI},Ua=146097/400,oh=146097/4800,jre={years:{quarters:4,months:12,weeks:Ua/7,days:Ua,hours:Ua*24,minutes:Ua*24*60,seconds:Ua*24*60*60,milliseconds:Ua*24*60*60*1e3},quarters:{months:3,weeks:Ua/28,days:Ua/4,hours:Ua*24/4,minutes:Ua*24*60/4,seconds:Ua*24*60*60/4,milliseconds:Ua*24*60*60*1e3/4},months:{weeks:oh/7,days:oh,hours:oh*24,minutes:oh*24*60,seconds:oh*24*60*60,milliseconds:oh*24*60*60*1e3},...yI},lp=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ene=lp.slice(0).reverse();function Sf(e,t,r=!1){let n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new zn(n)}function xI(e,t){let r=t.milliseconds??0;for(let n of ene.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function vI(e,t){let r=xI(e,t)<0?-1:1;lp.reduceRight((n,i)=>{if(ir(t[i]))return n;if(n){let o=t[n]*r,u=e[i][n],l=Math.floor(o/u);t[i]+=l*r,t[n]-=l*u*r}return i},null),lp.reduce((n,i)=>{if(ir(t[i]))return n;if(n){let o=t[n]%1;t[n]-=o,t[i]+=o*e[n][i]}return i},null)}function tne(e){let t={};for(let[r,n]of Object.entries(e))n!==0&&(t[r]=n);return t}var zn=class e{constructor(t){let r=t.conversionAccuracy==="longterm"||!1,n=r?jre:Qre;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||Zr.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,r){return e.fromObject({milliseconds:t},r)}static fromObject(t,r={}){if(t==null||typeof t!="object")throw new di(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new e({values:jm(t,e.normalizeUnit),loc:Zr.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(t){if(Du(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t=="object")return e.fromObject(t);throw new di(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,r){let[n]=mI(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,r){let[n]=hI(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,r=null){if(!t)throw new di("need to specify a reason the Duration is invalid");let n=t instanceof Pi?t:new Pi(t,r);if($r.throwOnInvalid)throw new Vy(n);return new e({invalid:n})}static normalizeUnit(t){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!r)throw new Zm(t);return r}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,r={}){let n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Ri.create(this.loc,n).formatDurationFromString(this,t):gI}toHuman(t={}){if(!this.isValid)return gI;let r=lp.map(n=>{let i=this.values[n];return ir(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:n.slice(0,-1)}).format(i)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Km(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let r=this.toMillis();return r<0||r>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},Nr.fromMillis(r,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?xI(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t),n={};for(let i of lp)(Nf(r.values,i)||Nf(this.values,i))&&(n[i]=r.get(i)+this.get(i));return Sf(this,{values:n},!0)}minus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t);return this.plus(r.negate())}mapUnits(t){if(!this.isValid)return this;let r={};for(let n of Object.keys(this.values))r[n]=GE(t(this.values[n],n));return Sf(this,{values:r},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let r={...this.values,...jm(t,e.normalizeUnit)};return Sf(this,{values:r})}reconfigure({locale:t,numberingSystem:r,conversionAccuracy:n,matrix:i}={}){let u={loc:this.loc.clone({locale:t,numberingSystem:r}),matrix:i,conversionAccuracy:n};return Sf(this,u)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return vI(this.matrix,t),Sf(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=tne(this.normalize().shiftToAll().toObject());return Sf(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(u=>e.normalizeUnit(u));let r={},n={},i=this.toObject(),o;for(let u of lp)if(t.indexOf(u)>=0){o=u;let l=0;for(let s in n)l+=this.matrix[s][u]*n[s],n[s]=0;Du(i[u])&&(l+=i[u]);let a=Math.trunc(l);r[u]=a,n[u]=(l*1e3-a*1e3)/1e3}else Du(i[u])&&(n[u]=i[u]);for(let u in n)n[u]!==0&&(r[o]+=u===o?n[u]:n[u]/this.matrix[o][u]);return vI(this.matrix,r),Sf(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let r of Object.keys(this.values))t[r]=this.values[r]===0?0:-this.values[r];return Sf(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function r(n,i){return n===void 0||n===0?i===void 0||i===0:n===i}for(let n of lp)if(!r(this.values[n],t.values[n]))return!1;return!0}};g();y();v();var ah="Invalid Interval";function rne(e,t){return!e||!e.isValid?ml.invalid("missing or invalid start"):!t||!t.isValid?ml.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:r}={}){return this.isValid?e.fromDateTimes(t||this.s,r||this.e):this}splitAt(...t){if(!this.isValid)return[];let r=t.map(sh).filter(u=>this.contains(u)).sort((u,l)=>u.toMillis()-l.toMillis()),n=[],{s:i}=this,o=0;for(;i+this.e?this.e:u;n.push(e.fromDateTimes(i,l)),i=l,o+=1}return n}splitBy(t){let r=zn.fromDurationLike(t);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,i=1,o,u=[];for(;na*i));o=+l>+this.e?this.e:l,u.push(e.fromDateTimes(n,o)),n=o,i+=1}return u}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let r=this.s>t.s?this.s:t.s,n=this.e=n?null:e.fromDateTimes(r,n)}union(t){if(!this.isValid)return this;let r=this.st.e?this.e:t.e;return e.fromDateTimes(r,n)}static merge(t){let[r,n]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],u)=>o?o.overlaps(u)||o.abutsStart(u)?[i,o.union(u)]:[i.concat([o]),u]:[i,u],[[],null]);return n&&r.push(n),r}static xor(t){let r=null,n=0,i=[],o=t.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),u=Array.prototype.concat(...o),l=u.sort((a,s)=>a.time-s.time);for(let a of l)n+=a.type==="s"?1:-1,n===1?r=a.time:(r&&+r!=+a.time&&i.push(e.fromDateTimes(r,a.time)),r=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:ah}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=xf,r={}){return this.isValid?Ri.create(this.s.loc.clone(r),t).formatInterval(this):ah}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:ah}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ah}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:ah}toFormat(t,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${r}${this.e.toFormat(t)}`:ah}toDuration(t,r){return this.isValid?this.e.diff(this.s,t,r):zn.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}};g();y();v();var hl=class{static hasDST(t=$r.defaultZone){let r=Nr.now().setZone(t).set({month:12});return!t.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(t){return fo.isValidZone(t)}static normalizeZone(t){return Is(t,$r.defaultZone)}static getStartOfWeek({locale:t=null,locObj:r=null}={}){return(r||Zr.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:r=null}={}){return(r||Zr.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:r=null}={}){return(r||Zr.create(t)).getWeekendDays().slice()}static months(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Zr.create(r,n,o)).months(t)}static monthsFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Zr.create(r,n,o)).months(t,!0)}static weekdays(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Zr.create(r,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Zr.create(r,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Zr.create(t).meridiems()}static eras(t="short",{locale:r=null}={}){return Zr.create(r,null,"gregory").eras(t)}static features(){return{relative:Jy(),localeWeek:Qy()}}};g();y();v();function wI(e,t){let r=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(zn.fromMillis(n).as("days"))}function nne(e,t,r){let n=[["years",(a,s)=>s.year-a.year],["quarters",(a,s)=>s.quarter-a.quarter+(s.year-a.year)*4],["months",(a,s)=>s.month-a.month+(s.year-a.year)*12],["weeks",(a,s)=>{let f=wI(a,s);return(f-f%7)/7}],["days",wI]],i={},o=e,u,l;for(let[a,s]of n)r.indexOf(a)>=0&&(u=a,i[a]=s(e,t),l=o.plus(i),l>t?(i[a]--,e=o.plus(i),e>t&&(l=e,i[a]--,e=o.plus(i))):e=l);return[e,i,l,u]}function bI(e,t,r,n){let[i,o,u,l]=nne(e,t,r),a=t-i,s=r.filter(p=>["hours","minutes","seconds","milliseconds"].indexOf(p)>=0);s.length===0&&(u0?zn.fromMillis(a,n).shiftTo(...s).plus(f):f}g();y();v();g();y();v();var jE={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},DI={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ine=jE.hanidec.replace(/[\[|\]]/g,"").split("");function NI(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r=o&&n<=u&&(t+=n-o)}}return parseInt(t,10)}else return t}function Ha({numberingSystem:e},t=""){return new RegExp(`${jE[e||"latn"]}${t}`)}var one="missing Intl.DateTimeFormat.formatToParts support";function Wr(e,t=r=>r){return{regex:e,deser:([r])=>t(NI(r))}}var ane="\xA0",AI=`[ ${ane}]`,CI=new RegExp(AI,"g");function sne(e){return e.replace(/\./g,"\\.?").replace(CI,AI)}function EI(e){return e.replace(/\./g,"").replace(CI," ").toLowerCase()}function Fs(e,t){return e===null?null:{regex:RegExp(e.map(sne).join("|")),deser:([r])=>e.findIndex(n=>EI(r)===EI(n))+t}}function SI(e,t){return{regex:e,deser:([,r,n])=>ap(r,n),groups:t}}function rx(e){return{regex:e,deser:([t])=>t}}function une(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function lne(e,t){let r=Ha(t),n=Ha(t,"{2}"),i=Ha(t,"{3}"),o=Ha(t,"{4}"),u=Ha(t,"{6}"),l=Ha(t,"{1,2}"),a=Ha(t,"{1,3}"),s=Ha(t,"{1,6}"),f=Ha(t,"{1,9}"),p=Ha(t,"{2,4}"),h=Ha(t,"{4,6}"),x=A=>({regex:RegExp(une(A.val)),deser:([E])=>E,literal:!0}),w=(A=>{if(e.literal)return x(A);switch(A.val){case"G":return Fs(t.eras("short"),0);case"GG":return Fs(t.eras("long"),0);case"y":return Wr(s);case"yy":return Wr(p,gv);case"yyyy":return Wr(o);case"yyyyy":return Wr(h);case"yyyyyy":return Wr(u);case"M":return Wr(l);case"MM":return Wr(n);case"MMM":return Fs(t.months("short",!0),1);case"MMMM":return Fs(t.months("long",!0),1);case"L":return Wr(l);case"LL":return Wr(n);case"LLL":return Fs(t.months("short",!1),1);case"LLLL":return Fs(t.months("long",!1),1);case"d":return Wr(l);case"dd":return Wr(n);case"o":return Wr(a);case"ooo":return Wr(i);case"HH":return Wr(n);case"H":return Wr(l);case"hh":return Wr(n);case"h":return Wr(l);case"mm":return Wr(n);case"m":return Wr(l);case"q":return Wr(l);case"qq":return Wr(n);case"s":return Wr(l);case"ss":return Wr(n);case"S":return Wr(a);case"SSS":return Wr(i);case"u":return rx(f);case"uu":return rx(l);case"uuu":return Wr(r);case"a":return Fs(t.meridiems(),0);case"kkkk":return Wr(o);case"kk":return Wr(p,gv);case"W":return Wr(l);case"WW":return Wr(n);case"E":case"c":return Wr(r);case"EEE":return Fs(t.weekdays("short",!1),1);case"EEEE":return Fs(t.weekdays("long",!1),1);case"ccc":return Fs(t.weekdays("short",!0),1);case"cccc":return Fs(t.weekdays("long",!0),1);case"Z":case"ZZ":return SI(new RegExp(`([+-]${l.source})(?::(${n.source}))?`),2);case"ZZZ":return SI(new RegExp(`([+-]${l.source})(${n.source})?`),2);case"z":return rx(/[a-z_+-/]{1,256}?/i);case" ":return rx(/[^\S\n\r]/);default:return x(A)}})(e)||{invalidReason:one};return w.token=e,w}var fne={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function cne(e,t,r){let{type:n,value:i}=e;if(n==="literal"){let a=/^\s+$/.test(i);return{literal:!a,val:a?" ":i}}let o=t[n],u=n;n==="hour"&&(t.hour12!=null?u=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?u="hour12":u="hour24":u=r.hour12?"hour12":"hour24");let l=fne[u];if(typeof l=="object"&&(l=l[o]),l)return{literal:!1,val:l}}function pne(e){return[`^${e.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,e]}function mne(e,t,r){let n=e.match(t);if(n){let i={},o=1;for(let u in r)if(Nf(r,u)){let l=r[u],a=l.groups?l.groups+1:1;!l.literal&&l.token&&(i[l.token.val[0]]=l.deser(n.slice(o,o+a))),o+=a}return[n,i]}else return[n,{}]}function hne(e){let t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,n;return ir(e.z)||(r=fo.create(e.z)),ir(e.Z)||(r||(r=new Li(e.Z)),n=e.Z),ir(e.q)||(e.M=(e.q-1)*3+1),ir(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),ir(e.u)||(e.S=dv(e.u)),[Object.keys(e).reduce((o,u)=>{let l=t(u);return l&&(o[l]=e[u]),o},{}),r,n]}var eS=null;function dne(){return eS||(eS=Nr.fromMillis(1555555555555)),eS}function gne(e,t){if(e.literal)return e;let r=Ri.macroTokenToFormatOpts(e.val),n=nS(r,t);return n==null||n.includes(void 0)?e:n}function tS(e,t){return Array.prototype.concat(...e.map(r=>gne(r,t)))}function rS(e,t,r){let n=tS(Ri.parseFormat(r),e),i=n.map(u=>lne(u,e)),o=i.find(u=>u.invalidReason);if(o)return{input:t,tokens:n,invalidReason:o.invalidReason};{let[u,l]=pne(i),a=RegExp(u,"i"),[s,f]=mne(t,a,l),[p,h,x]=f?hne(f):[null,null,void 0];if(Nf(f,"a")&&Nf(f,"H"))throw new Ms("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:n,regex:a,rawMatches:s,matches:f,result:p,zone:h,specificOffset:x}}}function MI(e,t,r){let{result:n,zone:i,specificOffset:o,invalidReason:u}=rS(e,t,r);return[n,i,o,u]}function nS(e,t){if(!e)return null;let n=Ri.create(t,e).dtFormatter(dne()),i=n.formatToParts(),o=n.resolvedOptions();return i.map(u=>cne(u,e,o))}var iS="Invalid DateTime",TI=864e13;function nx(e){return new Pi("unsupported zone",`the zone "${e.name}" is not supported`)}function oS(e){return e.weekData===null&&(e.weekData=pv(e.c)),e.weekData}function aS(e){return e.localWeekData===null&&(e.localWeekData=pv(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function fp(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Nr({...r,...t,old:r})}function LI(e,t,r){let n=e-t*60*1e3,i=r.offset(n);if(t===i)return[n,t];n-=(i-t)*60*1e3;let o=r.offset(n);return i===o?[n,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function ix(e,t){e+=t*60*1e3;let r=new Date(e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function ax(e,t,r){return LI(Xm(e),t,r)}function OI(e,t){let r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:n,month:i,day:Math.min(e.c.day,Qm(n,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},u=zn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=Xm(o),[a,s]=LI(l,r,e.zone);return u!==0&&(a+=u,s=e.zone.offset(a)),{ts:a,o:s}}function xv(e,t,r,n,i,o){let{setZone:u,zone:l}=r;if(e&&Object.keys(e).length!==0||t){let a=t||l,s=Nr.fromObject(e,{...r,zone:a,specificOffset:o});return u?s:s.setZone(l)}else return Nr.invalid(new Pi("unparsable",`the input "${i}" can't be parsed as ${n}`))}function ox(e,t,r=!0){return e.isValid?Ri.create(Zr.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function sS(e,t){let r=e.c.year>9999||e.c.year<0,n="";return r&&e.c.year>=0&&(n+="+"),n+=qn(e.c.year,r?6:4),t?(n+="-",n+=qn(e.c.month),n+="-",n+=qn(e.c.day)):(n+=qn(e.c.month),n+=qn(e.c.day)),n}function II(e,t,r,n,i,o){let u=qn(e.c.hour);return t?(u+=":",u+=qn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(u+=":")):u+=qn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(u+=qn(e.c.second),(e.c.millisecond!==0||!n)&&(u+=".",u+=qn(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?u+="Z":e.o<0?(u+="-",u+=qn(Math.trunc(-e.o/60)),u+=":",u+=qn(Math.trunc(-e.o%60))):(u+="+",u+=qn(Math.trunc(e.o/60)),u+=":",u+=qn(Math.trunc(e.o%60)))),o&&(u+="["+e.zone.ianaName+"]"),u}var PI={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},vne={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},yne={ordinal:1,hour:0,minute:0,second:0,millisecond:0},RI=["year","month","day","hour","minute","second","millisecond"],xne=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],wne=["year","ordinal","hour","minute","second","millisecond"];function bne(e){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Zm(e);return t}function FI(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return bne(e)}}function _I(e,t){let r=Is(t.zone,$r.defaultZone),n=Zr.fromObject(t),i=$r.now(),o,u;if(ir(e.year))o=i;else{for(let s of RI)ir(e[s])&&(e[s]=PI[s]);let l=$E(e)||WE(e);if(l)return Nr.invalid(l);let a=r.offset(i);[o,u]=ax(e,a,r)}return new Nr({ts:o,zone:r,loc:n,o:u})}function kI(e,t,r){let n=ir(r.round)?!0:r.round,i=(u,l)=>(u=Km(u,n||r.calendary?0:2,!0),t.loc.clone(r).relFormatter(r).format(u,l)),o=u=>r.calendary?t.hasSame(e,u)?0:t.startOf(u).diff(e.startOf(u),u).get(u):t.diff(e,u).get(u);if(r.unit)return i(o(r.unit),r.unit);for(let u of r.units){let l=o(u);if(Math.abs(l)>=1)return i(l,u)}return i(e>t?-0:0,r.units[r.units.length-1])}function BI(e){let t={},r;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],r=Array.from(e).slice(0,e.length-1)):r=Array.from(e),[t,r]}var Nr=class e{constructor(t){let r=t.zone||$r.defaultZone,n=t.invalid||(Number.isNaN(t.ts)?new Pi("invalid input"):null)||(r.isValid?null:nx(r));this.ts=ir(t.ts)?$r.now():t.ts;let i=null,o=null;if(!n)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(r))[i,o]=[t.old.c,t.old.o];else{let l=r.offset(this.ts);i=ix(this.ts,l),n=Number.isNaN(i.year)?new Pi("invalid input"):null,i=n?null:i,o=n?null:l}this._zone=r,this.loc=t.loc||Zr.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[t,r]=BI(arguments),[n,i,o,u,l,a,s]=r;return _I({year:n,month:i,day:o,hour:u,minute:l,second:a,millisecond:s},t)}static utc(){let[t,r]=BI(arguments),[n,i,o,u,l,a,s]=r;return t.zone=Li.utcInstance,_I({year:n,month:i,day:o,hour:u,minute:l,second:a,millisecond:s},t)}static fromJSDate(t,r={}){let n=XO(t)?t.valueOf():NaN;if(Number.isNaN(n))return e.invalid("invalid input");let i=Is(r.zone,$r.defaultZone);return i.isValid?new e({ts:n,zone:i,loc:Zr.fromObject(r)}):e.invalid(nx(i))}static fromMillis(t,r={}){if(Du(t))return t<-TI||t>TI?e.invalid("Timestamp out of range"):new e({ts:t,zone:Is(r.zone,$r.defaultZone),loc:Zr.fromObject(r)});throw new di(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,r={}){if(Du(t))return new e({ts:t*1e3,zone:Is(r.zone,$r.defaultZone),loc:Zr.fromObject(r)});throw new di("fromSeconds requires a numerical input")}static fromObject(t,r={}){t=t||{};let n=Is(r.zone,$r.defaultZone);if(!n.isValid)return e.invalid(nx(n));let i=Zr.fromObject(r),o=jm(t,FI),{minDaysInFirstWeek:u,startOfWeek:l}=HE(o,i),a=$r.now(),s=ir(r.specificOffset)?n.offset(a):r.specificOffset,f=!ir(o.ordinal),p=!ir(o.year),h=!ir(o.month)||!ir(o.day),x=p||h,b=o.weekYear||o.weekNumber;if((x||f)&&b)throw new Ms("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&f)throw new Ms("Can't mix ordinal dates with month/day");let w=b||o.weekday&&!x,A,E,O=ix(a,s);w?(A=xne,E=vne,O=pv(O,u,l)):f?(A=wne,E=yne,O=tx(O)):(A=RI,E=PI);let M=!1;for(let U of A){let H=o[U];ir(H)?M?o[U]=E[U]:o[U]=O[U]:M=!0}let I=w?GO(o,u,l):f?YO(o):$E(o),F=I||WE(o);if(F)return e.invalid(F);let C=w?zE(o,u,l):f?UE(o):o,[P,R]=ax(C,s,n),q=new e({ts:P,zone:n,o:R,loc:i});return o.weekday&&x&&t.weekday!==q.weekday?e.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${q.toISO()}`):q}static fromISO(t,r={}){let[n,i]=fI(t);return xv(n,i,r,"ISO 8601",t)}static fromRFC2822(t,r={}){let[n,i]=cI(t);return xv(n,i,r,"RFC 2822",t)}static fromHTTP(t,r={}){let[n,i]=pI(t);return xv(n,i,r,"HTTP",r)}static fromFormat(t,r,n={}){if(ir(t)||ir(r))throw new di("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:o=null}=n,u=Zr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[l,a,s,f]=MI(u,t,r);return f?e.invalid(f):xv(l,a,n,`format ${r}`,t,s)}static fromString(t,r,n={}){return e.fromFormat(t,r,n)}static fromSQL(t,r={}){let[n,i]=dI(t);return xv(n,i,r,"SQL",t)}static invalid(t,r=null){if(!t)throw new di("need to specify a reason the DateTime is invalid");let n=t instanceof Pi?t:new Pi(t,r);if($r.throwOnInvalid)throw new $y(n);return new e({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,r={}){let n=nS(t,Zr.fromObject(r));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(t,r={}){return tS(Ri.parseFormat(t),Zr.fromObject(r)).map(i=>i.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?oS(this).weekYear:NaN}get weekNumber(){return this.isValid?oS(this).weekNumber:NaN}get weekday(){return this.isValid?oS(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?aS(this).weekday:NaN}get localWeekNumber(){return this.isValid?aS(this).weekNumber:NaN}get localWeekYear(){return this.isValid?aS(this).weekYear:NaN}get ordinal(){return this.isValid?tx(this.c).ordinal:NaN}get monthShort(){return this.isValid?hl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?hl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?hl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?hl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let t=864e5,r=6e4,n=Xm(this.c),i=this.zone.offset(n-t),o=this.zone.offset(n+t),u=this.zone.offset(n-i*r),l=this.zone.offset(n-o*r);if(u===l)return[this];let a=n-u*r,s=n-l*r,f=ix(a,u),p=ix(s,l);return f.hour===p.hour&&f.minute===p.minute&&f.second===p.second&&f.millisecond===p.millisecond?[fp(this,{ts:a}),fp(this,{ts:s})]:[this]}get isInLeapYear(){return up(this.year)}get daysInMonth(){return Qm(this.year,this.month)}get daysInYear(){return this.isValid?Df(this.year):NaN}get weeksInWeekYear(){return this.isValid?sp(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?sp(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){let{locale:r,numberingSystem:n,calendar:i}=Ri.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:i}}toUTC(t=0,r={}){return this.setZone(Li.instance(t),r)}toLocal(){return this.setZone($r.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(t=Is(t,$r.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(r||n){let o=t.offset(this.ts),u=this.toObject();[i]=ax(u,o,t)}return fp(this,{ts:i,zone:t})}else return e.invalid(nx(t))}reconfigure({locale:t,numberingSystem:r,outputCalendar:n}={}){let i=this.loc.clone({locale:t,numberingSystem:r,outputCalendar:n});return fp(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let r=jm(t,FI),{minDaysInFirstWeek:n,startOfWeek:i}=HE(r,this.loc),o=!ir(r.weekYear)||!ir(r.weekNumber)||!ir(r.weekday),u=!ir(r.ordinal),l=!ir(r.year),a=!ir(r.month)||!ir(r.day),s=l||a,f=r.weekYear||r.weekNumber;if((s||u)&&f)throw new Ms("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&u)throw new Ms("Can't mix ordinal dates with month/day");let p;o?p=zE({...pv(this.c,n,i),...r},n,i):ir(r.ordinal)?(p={...this.toObject(),...r},ir(r.day)&&(p.day=Math.min(Qm(p.year,p.month),p.day))):p=UE({...tx(this.c),...r});let[h,x]=ax(p,this.o,this.zone);return fp(this,{ts:h,o:x})}plus(t){if(!this.isValid)return this;let r=zn.fromDurationLike(t);return fp(this,OI(this,r))}minus(t){if(!this.isValid)return this;let r=zn.fromDurationLike(t).negate();return fp(this,OI(this,r))}startOf(t,{useLocaleWeeks:r=!1}={}){if(!this.isValid)return this;let n={},i=zn.normalizeUnit(t);switch(i){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break;case"milliseconds":break}if(i==="weeks")if(r){let o=this.loc.getStartOfWeek(),{weekday:u}=this;uthis.valueOf(),l=u?this:t,a=u?t:this,s=bI(l,a,o,i);return u?s.negate():s}diffNow(t="milliseconds",r={}){return this.diff(e.now(),t,r)}until(t){return this.isValid?ml.fromDateTimes(this,t):this}hasSame(t,r,n){if(!this.isValid)return!1;let i=t.valueOf(),o=this.setZone(t.zone,{keepLocalTime:!0});return o.startOf(r,n)<=i&&i<=o.endOf(r,n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let r=t.base||e.fromObject({},{zone:this.zone}),n=t.padding?thisr.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new di("max requires all arguments be DateTimes");return VE(t,r=>r.valueOf(),Math.max)}static fromFormatExplain(t,r,n={}){let{locale:i=null,numberingSystem:o=null}=n,u=Zr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return rS(u,t,r)}static fromStringExplain(t,r,n={}){return e.fromFormatExplain(t,r,n)}static get DATE_SHORT(){return xf}static get DATE_MED(){return Vg}static get DATE_MED_WITH_WEEKDAY(){return EE}static get DATE_FULL(){return Gg}static get DATE_HUGE(){return Yg}static get TIME_SIMPLE(){return Zg}static get TIME_WITH_SECONDS(){return Xg}static get TIME_WITH_SHORT_OFFSET(){return Kg}static get TIME_WITH_LONG_OFFSET(){return Jg}static get TIME_24_SIMPLE(){return Qg}static get TIME_24_WITH_SECONDS(){return jg}static get TIME_24_WITH_SHORT_OFFSET(){return ev}static get TIME_24_WITH_LONG_OFFSET(){return tv}static get DATETIME_SHORT(){return rv}static get DATETIME_SHORT_WITH_SECONDS(){return nv}static get DATETIME_MED(){return iv}static get DATETIME_MED_WITH_SECONDS(){return ov}static get DATETIME_MED_WITH_WEEKDAY(){return SE}static get DATETIME_FULL(){return av}static get DATETIME_FULL_WITH_SECONDS(){return sv}static get DATETIME_HUGE(){return uv}static get DATETIME_HUGE_WITH_SECONDS(){return lv}};function sh(e){if(Nr.isDateTime(e))return e;if(e&&e.valueOf&&Du(e.valueOf()))return Nr.fromJSDate(e);if(e&&typeof e=="object")return Nr.fromObject(e);throw new di(`Unknown datetime argument: ${e}, of type ${typeof e}`)}g();y();v();g();y();v();function Jn(){return Jn=Object.assign?Object.assign.bind():function(e){for(var t=1;t{Object.defineProperty(r,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),r}function VI(e,t,r){e[t]!==void 0&&!r.includes(e[t])&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map(n=>JSON.stringify(n)).join(", ")+".")}var ZA={};qa(ZA,{createAbs:()=>Y_,createAccessorNode:()=>v6,createAcos:()=>YB,createAcosh:()=>XB,createAcot:()=>JB,createAcoth:()=>jB,createAcsc:()=>tL,createAcsch:()=>nL,createAdd:()=>a6,createAddScalar:()=>K_,createAnd:()=>hw,createAndTransform:()=>BH,createApply:()=>Nh,createApplyTransform:()=>uH,createArg:()=>Jk,createArrayNode:()=>y6,createAsec:()=>oL,createAsech:()=>sL,createAsin:()=>lL,createAsinh:()=>fL,createAssignmentNode:()=>b6,createAtan:()=>cL,createAtan2:()=>mL,createAtanh:()=>dL,createAtomicMass:()=>UU,createAvogadro:()=>HU,createBellNumbers:()=>bz,createBigNumberClass:()=>TF,createBigint:()=>E_,createBignumber:()=>T_,createBin:()=>y5,createBitAnd:()=>tw,createBitAndTransform:()=>PH,createBitNot:()=>Gk,createBitOr:()=>rw,createBitOrTransform:()=>RH,createBitXor:()=>Xk,createBlockNode:()=>D6,createBohrMagneton:()=>bU,createBohrRadius:()=>CU,createBoltzmann:()=>$U,createBoolean:()=>M_,createCatalan:()=>Nz,createCbrt:()=>ek,createCeil:()=>tk,createChain:()=>Z7,createChainClass:()=>vP,createClassicalElectronRadius:()=>MU,createClone:()=>JF,createColumn:()=>ow,createColumnTransform:()=>lH,createCombinations:()=>Iq,createCombinationsWithRep:()=>kq,createCompare:()=>sB,createCompareNatural:()=>cB,createCompareText:()=>mB,createCompile:()=>H6,createComplex:()=>O_,createComplexClass:()=>FF,createComposition:()=>Sz,createConcat:()=>iw,createConcatTransform:()=>DH,createConditionalNode:()=>N6,createConductanceQuantum:()=>DU,createConj:()=>jk,createConstantNode:()=>T6,createCorr:()=>Mq,createCos:()=>vL,createCosh:()=>xL,createCot:()=>bL,createCoth:()=>NL,createCoulomb:()=>xU,createCount:()=>p4,createCreateUnit:()=>VB,createCross:()=>h4,createCsc:()=>SL,createCsch:()=>CL,createCtranspose:()=>J4,createCube:()=>nk,createCumSum:()=>Xw,createCumSumTransform:()=>OH,createDeepEqual:()=>DB,createDenseMatrixClass:()=>XF,createDerivative:()=>Pz,createDet:()=>K7,createDeuteronMass:()=>kU,createDiag:()=>g4,createDiff:()=>aw,createDiffTransform:()=>EH,createDistance:()=>gq,createDivide:()=>hq,createDivideScalar:()=>I5,createDot:()=>p6,createDotDivide:()=>V5,createDotMultiply:()=>Rk,createDotPow:()=>$5,createE:()=>eU,createEfimovFactor:()=>zU,createEigs:()=>nq,createElectricConstant:()=>vU,createElectronMass:()=>TU,createElementaryCharge:()=>wU,createEqual:()=>hB,createEqualScalar:()=>b_,createEqualText:()=>gB,createErf:()=>u5,createEvaluate:()=>W6,createExp:()=>ok,createExpm:()=>oq,createExpm1:()=>sk,createFactorial:()=>zq,createFalse:()=>Zz,createFaraday:()=>WU,createFermiCoupling:()=>OU,createFft:()=>t5,createFibonacciHeapClass:()=>_B,createFilter:()=>y4,createFilterTransform:()=>cH,createFineStructure:()=>IU,createFirstRadiation:()=>VU,createFix:()=>uk,createFlatten:()=>w4,createFloor:()=>Jx,createForEach:()=>D4,createForEachTransform:()=>pH,createFormat:()=>g5,createFraction:()=>I_,createFractionClass:()=>kF,createFreqz:()=>$z,createFunctionAssignmentNode:()=>O6,createFunctionNode:()=>R6,createGamma:()=>Lq,createGasConstant:()=>YU,createGcd:()=>hk,createGetMatrixDataType:()=>E4,createGravitationConstant:()=>mU,createGravity:()=>rH,createHartreeEnergy:()=>FU,createHasNumericValue:()=>c_,createHelp:()=>G7,createHelpClass:()=>gP,createHex:()=>D5,createHypot:()=>u6,createI:()=>uU,createIdentity:()=>A4,createIfft:()=>n5,createIm:()=>t4,createImmutableDenseMatrixClass:()=>OB,createIndex:()=>d6,createIndexClass:()=>FB,createIndexNode:()=>I6,createIndexTransform:()=>mH,createInfinity:()=>Kz,createIntersect:()=>vq,createInv:()=>Q7,createInverseConductanceQuantum:()=>NU,createInvmod:()=>Lk,createIsInteger:()=>jF,createIsNaN:()=>v_,createIsNegative:()=>s_,createIsNumeric:()=>l_,createIsPositive:()=>m_,createIsPrime:()=>M5,createIsZero:()=>d_,createKldivergence:()=>Hq,createKlitzing:()=>AU,createKron:()=>M4,createLN10:()=>nU,createLN2:()=>rU,createLOG10E:()=>oU,createLOG2E:()=>iU,createLarger:()=>xB,createLargerEq:()=>wB,createLcm:()=>gk,createLeafCount:()=>Cz,createLeftShift:()=>tB,createLgamma:()=>Rq,createLog:()=>P5,createLog10:()=>yk,createLog1p:()=>q5,createLog2:()=>wk,createLoschmidt:()=>GU,createLsolve:()=>Y5,createLsolveAll:()=>J5,createLup:()=>X6,createLusolve:()=>mP,createLyap:()=>mq,createMad:()=>Nq,createMagneticConstant:()=>gU,createMagneticFluxQuantum:()=>EU,createMap:()=>O4,createMapTransform:()=>dH,createMatrix:()=>__,createMatrixClass:()=>LF,createMatrixFromColumns:()=>q_,createMatrixFromFunction:()=>B_,createMatrixFromRows:()=>P_,createMax:()=>Dw,createMaxTransform:()=>gH,createMean:()=>Kw,createMeanTransform:()=>vH,createMedian:()=>bq,createMin:()=>Nw,createMinTransform:()=>yH,createMod:()=>Qx,createMode:()=>p5,createMolarMass:()=>eH,createMolarMassC12:()=>tH,createMolarPlanckConstant:()=>ZU,createMolarVolume:()=>XU,createMultinomial:()=>Wq,createMultiply:()=>Nk,createMultiplyScalar:()=>bk,createNaN:()=>Jz,createNeutronMass:()=>BU,createNode:()=>g6,createNorm:()=>f6,createNot:()=>o4,createNthRoot:()=>Sk,createNthRoots:()=>U5,createNuclearMagneton:()=>SU,createNull:()=>Xz,createNumber:()=>N_,createNumeric:()=>T5,createObjectNode:()=>F6,createOct:()=>w5,createOnes:()=>F4,createOperatorNode:()=>_6,createOr:()=>nw,createOrTransform:()=>LH,createParenthesisNode:()=>k6,createParse:()=>z6,createParser:()=>Y6,createParserClass:()=>V6,createPartitionSelect:()=>SB,createPermutations:()=>Yq,createPhi:()=>tU,createPi:()=>Qz,createPickRandom:()=>mz,createPinv:()=>eq,createPlanckCharge:()=>aH,createPlanckConstant:()=>hU,createPlanckLength:()=>nH,createPlanckMass:()=>iH,createPlanckTemperature:()=>sH,createPlanckTime:()=>oH,createPolynomialRoot:()=>dP,createPow:()=>_5,createPrint:()=>mw,createPrintTransform:()=>kH,createProd:()=>h5,createProtonMass:()=>_U,createQr:()=>J6,createQuantileSeq:()=>Qw,createQuantileSeqTransform:()=>MH,createQuantumOfCirculation:()=>LU,createRandom:()=>dz,createRandomInt:()=>vz,createRange:()=>lw,createRangeClass:()=>BF,createRangeNode:()=>B6,createRangeTransform:()=>xH,createRationalize:()=>qz,createRe:()=>n4,createReducedPlanckConstant:()=>dU,createRelationalNode:()=>L6,createReplacer:()=>Vz,createReshape:()=>B4,createResize:()=>L4,createResolve:()=>_z,createResultSet:()=>hF,createReviver:()=>Wz,createRightArithShift:()=>nB,createRightLogShift:()=>oB,createRotate:()=>R4,createRotationMatrix:()=>z4,createRound:()=>B5,createRow:()=>fw,createRowTransform:()=>wH,createRydberg:()=>PU,createSQRT1_2:()=>aU,createSQRT2:()=>sU,createSackurTetrode:()=>KU,createSchur:()=>cq,createSec:()=>TL,createSech:()=>IL,createSecondRadiation:()=>JU,createSetCartesian:()=>zL,createSetDifference:()=>HL,createSetDistinct:()=>WL,createSetIntersect:()=>GL,createSetIsSubset:()=>ZL,createSetMultiplicity:()=>KL,createSetPowerset:()=>QL,createSetSize:()=>e6,createSetSymDifference:()=>r6,createSetUnion:()=>i6,createSign:()=>Ck,createSimplify:()=>Tz,createSimplifyConstant:()=>Oz,createSimplifyCore:()=>Fz,createSin:()=>_L,createSinh:()=>BL,createSize:()=>$4,createSlu:()=>cP,createSmaller:()=>vB,createSmallerEq:()=>yB,createSolveODE:()=>s5,createSort:()=>CB,createSpaClass:()=>kB,createSparse:()=>$B,createSparseMatrixClass:()=>D_,createSpeedOfLight:()=>pU,createSplitUnit:()=>U_,createSqrt:()=>Mk,createSqrtm:()=>sq,createSquare:()=>Ok,createSqueeze:()=>V4,createStd:()=>jw,createStdTransform:()=>SH,createStefanBoltzmann:()=>QU,createStirlingS2:()=>xz,createString:()=>A_,createSubset:()=>cw,createSubsetTransform:()=>bH,createSubtract:()=>Fk,createSubtractScalar:()=>Q_,createSum:()=>Yw,createSumTransform:()=>CH,createSylvester:()=>lq,createSymbolNode:()=>P6,createSymbolicEqual:()=>Bz,createTan:()=>PL,createTanh:()=>RL,createTau:()=>jz,createThomsonCrossSection:()=>RU,createTo:()=>A5,createTrace:()=>m6,createTranspose:()=>X4,createTrue:()=>Yz,createTypeOf:()=>x_,createTyped:()=>mF,createUnaryMinus:()=>$_,createUnaryPlus:()=>V_,createUnequal:()=>NB,createUnitClass:()=>qB,createUnitFunction:()=>UB,createUppercaseE:()=>fU,createUppercasePi:()=>lU,createUsolve:()=>X5,createUsolveAll:()=>j5,createVacuumImpedance:()=>yU,createVariance:()=>Jw,createVarianceTransform:()=>FH,createVersion:()=>cU,createWeakMixingAngle:()=>qU,createWienDisplacement:()=>jU,createXgcd:()=>kk,createXor:()=>u4,createZeros:()=>j4,createZeta:()=>f5,createZpk2tf:()=>Uz});g();y();v();g();y();v();var gS=rn(Dx(),1);g();y();v();function Nt(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function Nne(e){return/^-?\d+$/.test(e)}function co(e,t){return t.number==="bigint"&&!Nne(e)?t.numberFallback:t.number}var Wa=Math.sign||function(e){return e>0?1:e<0?-1:0},XI=Math.log2||function(t){return Math.log(t)/Math.LN2},KI=Math.log10||function(t){return Math.log(t)/Math.LN10},Nx=Math.log1p||function(e){return Math.log(e+1)},JI=Math.cbrt||function(t){if(t===0)return t;var r=t<0,n;return r&&(t=-t),isFinite(t)?(n=Math.exp(Math.log(t)/3),n=(t/(n*n)+2*n)/3):n=t,r?-n:n},QI=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function cS(e,t,r){var n={2:"0b",8:"0o",16:"0x"},i=n[t],o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Nt(r))throw new Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!Nt(e))throw new Error("Value must be an integer");e<0&&(e=e+2**r),o="i".concat(r)}var u="";return e<0&&(e=-e,u="-"),"".concat(u).concat(i).concat(e.toString(t)).concat(o)}function ks(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:r,precision:n,wordSize:i}=pS(t);switch(r){case"fixed":return mS(e,n);case"exponential":return jI(e,n);case"engineering":return Ene(e,n);case"bin":return cS(e,2,i);case"oct":return cS(e,8,i);case"hex":return cS(e,16,i);case"auto":return Sne(e,n,t).replace(/((\.\d*?)(0+))($|e)/,function(){var o=arguments[2],u=arguments[4];return o!=="."?o+u:u});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function pS(e){var t="auto",r,n;if(e!==void 0)if($t(e))r=e;else if(kt(e))r=e.toNumber();else if(Eu(e))e.precision!==void 0&&(r=YI(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=YI(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:r,wordSize:n}}function ph(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),o=n.indexOf(".");i+=o!==-1?o-1:n.length-1;var u=n.replace(".","").replace(/^0*/,function(l){return i-=l.length,""}).replace(/0*$/,"").split("").map(function(l){return parseInt(l)});return u.length===0&&(u.push(0),i++),{sign:r,coefficients:u,exponent:i}}function Ene(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=ph(e),n=Ex(r,t),i=n.exponent,o=n.coefficients,u=i%3===0?i:i<0?i-3-i%3:i-i%3;if($t(t))for(;t>o.length||i-u+1>o.length;)o.push(0);else for(var l=Math.abs(i-u)-(o.length-1),a=0;a0;)f++,s--;var p=o.slice(f).join(""),h=$t(t)&&p.length||p.match(/[1-9]/)?"."+p:"",x=o.slice(0,f).join("")+h+"e"+(i>=0?"+":"")+u.toString();return n.sign+x}function mS(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=ph(e),n=typeof t=="number"?Ex(r,r.exponent+1+t):r,i=n.coefficients,o=n.exponent+1,u=o+(t||0);return i.length0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function Sne(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=ZI(r?.lowerExp,-3),i=ZI(r?.upperExp,5),o=ph(e),u=t?Ex(o,t):o;if(u.exponent=i)return jI(e,t);var l=u.coefficients,a=u.exponent;l.length0?a:0;return st){var i=n.splice(t,n.length-t);if(i[0]>=5){var o=t-1;for(n[o]++;n[o]===10;)n.pop(),o===0&&(n.unshift(0),r.exponent++,o++),o--,n[o]++}}return r}function ch(e){for(var t=[],r=0;r2&&arguments[2]!==void 0?arguments[2]:1e-8,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return isNaN(e)||isNaN(t)?!1:!isFinite(e)||!isFinite(t)?e===t:e===t?!0:Math.abs(e-t)<=Math.max(r*Math.max(Math.abs(e),Math.abs(t)),n)}var tF=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},rF=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},nF=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},Sx=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},iF=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},Ax=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function oF(e,t){var r=e>0?!0:e<0?!1:1/e===1/0,n=t>0?!0:t<0?!1:1/t===1/0;return r^n?-e:e}function YI(e,t){if($t(e))return e;if(kt(e))return e.toNumber();t()}function ZI(e,t){return $t(e)?e:kt(e)?e.toNumber():t}g();y();v();function K(e,t,r,n){function i(o){var u=HI(o,t.map(hS));return Ane(e,t,o),r(u)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function cp(e){return typeof e=="function"&&typeof e.fn=="string"&&Array.isArray(e.dependencies)}function Ane(e,t,r){var n=t.filter(o=>!Cne(o)).every(o=>r[o]!==void 0);if(!n){var i=t.filter(o=>r[o]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(o=>'"'.concat(o,'"')).join(", "),"."))}}function Cne(e){return e&&e[0]==="?"}function hS(e){return e&&e[0]==="?"?e.slice(1):e}g();y();v();g();y();v();function fn(e,t){if(lF(e)&&sF(e,t))return e[t];throw typeof e[t]=="function"&&Cx(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function Au(e,t,r){if(lF(e)&&sF(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function aF(e,t){return t in e}function sF(e,t){return!e||typeof e!="object"?!1:St(Mne,t)?!0:!(t in Object.prototype||t in Function.prototype)}function uF(e,t){if(!Cx(e,t))throw new Error('No access to method "'+t+'"');return e[t]}function Cx(e,t){return e==null||typeof e[t]!="function"||St(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:St(Tne,t)?!0:!(t in Object.prototype||t in Function.prototype)}function lF(e){return typeof e=="object"&&e&&e.constructor===Object}var Mne={length:!0,name:!0},Tne={toString:!0,valueOf:!0,toLocaleString:!0};var pp=class{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return fn(this.wrappedObject,t)}set(t,r){return Au(this.wrappedObject,t,r),this}has(t){return aF(this.wrappedObject,t)}entries(){return fF(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}},mh=class{constructor(t,r,n){this.a=t,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}get(t){return this.bKeys.has(t)?this.b.get(t):this.a.get(t)}set(t,r){return this.bKeys.has(t)?this.b.set(t,r):this.a.set(t,r),this}has(t){return this.b.has(t)||this.a.has(t)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return fF(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){return this.bKeys.has(t)?this.b.delete(t):this.a.delete(t)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}};function fF(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function Cf(){return new Map}function gl(e){if(!e)return Cf();if(dS(e))return e;if(Eu(e))return new pp(e);throw new Error("createMap can create maps from objects or Maps")}function cF(e){if(e instanceof pp)return e.wrappedObject;var t={};for(var r of e.keys()){var n=e.get(r);Au(t,r,n)}return t}function dS(e){return e?e instanceof Map||e instanceof pp||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var pF=function(){return pF=gS.default.create,gS.default},One=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],mF=K("typed",One,function(t){var{BigNumber:r,Complex:n,DenseMatrix:i,Fraction:o}=t,u=pF();return u.clear(),u.addTypes([{name:"number",test:$t},{name:"Complex",test:Ni},{name:"BigNumber",test:kt},{name:"bigint",test:ux},{name:"Fraction",test:da},{name:"Unit",test:ui},{name:"identifier",test:l=>gn&&/^(?:[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\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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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\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\u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-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\u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DE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[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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108E\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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\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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uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uD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uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(l)},{name:"string",test:gn},{name:"Chain",test:lh},{name:"Array",test:pr},{name:"Matrix",test:Et},{name:"DenseMatrix",test:dl},{name:"SparseMatrix",test:ga},{name:"Range",test:Af},{name:"Index",test:Nu},{name:"boolean",test:lx},{name:"ResultSet",test:fx},{name:"Help",test:uh},{name:"function",test:cx},{name:"Date",test:px},{name:"RegExp",test:mx},{name:"null",test:hx},{name:"undefined",test:dx},{name:"AccessorNode",test:Fo},{name:"ArrayNode",test:Ei},{name:"AssignmentNode",test:gx},{name:"BlockNode",test:vx},{name:"ConditionalNode",test:yx},{name:"ConstantNode",test:or},{name:"FunctionNode",test:eo},{name:"FunctionAssignmentNode",test:$a},{name:"IndexNode",test:Vo},{name:"Node",test:cr},{name:"ObjectNode",test:Su},{name:"OperatorNode",test:Xr},{name:"ParenthesisNode",test:Si},{name:"RangeNode",test:xx},{name:"RelationalNode",test:wx},{name:"SymbolNode",test:qr},{name:"Map",test:dS},{name:"Object",test:Eu}]),u.addConversions([{from:"number",to:"BigNumber",convert:function(a){if(r||Mx(a),eF(a)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+a+"). Use function bignumber(x) to convert to BigNumber.");return new r(a)}},{from:"number",to:"Complex",convert:function(a){return n||Tx(a),new n(a,0)}},{from:"BigNumber",to:"Complex",convert:function(a){return n||Tx(a),new n(a.toNumber(),0)}},{from:"bigint",to:"number",convert:function(a){if(a>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+a+")");return Number(a)}},{from:"bigint",to:"BigNumber",convert:function(a){return r||Mx(a),new r(a.toString())}},{from:"bigint",to:"Fraction",convert:function(a){return o||Ox(a),new o(a.toString())}},{from:"Fraction",to:"BigNumber",convert:function(a){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(a){return n||Tx(a),new n(a.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(a){o||Ox(a);var s=new o(a);if(s.valueOf()!==a)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+a+"). Use function fraction(x) to convert to Fraction.");return s}},{from:"string",to:"number",convert:function(a){var s=Number(a);if(isNaN(s))throw new Error('Cannot convert "'+a+'" to a number');return s}},{from:"string",to:"BigNumber",convert:function(a){r||Mx(a);try{return new r(a)}catch{throw new Error('Cannot convert "'+a+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(a){try{return BigInt(a)}catch{throw new Error('Cannot convert "'+a+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(a){o||Ox(a);try{return new o(a)}catch{throw new Error('Cannot convert "'+a+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(a){n||Tx(a);try{return new n(a)}catch{throw new Error('Cannot convert "'+a+'" to Complex')}}},{from:"boolean",to:"number",convert:function(a){return+a}},{from:"boolean",to:"BigNumber",convert:function(a){return r||Mx(a),new r(+a)}},{from:"boolean",to:"bigint",convert:function(a){return BigInt(+a)}},{from:"boolean",to:"Fraction",convert:function(a){return o||Ox(a),new o(+a)}},{from:"boolean",to:"string",convert:function(a){return String(a)}},{from:"Array",to:"Matrix",convert:function(a){return i||Ine(),new i(a)}},{from:"Matrix",to:"Array",convert:function(a){return a.valueOf()}}]),u.onMismatch=(l,a,s)=>{var f=u.createError(l,a,s);if(["wrongType","mismatch"].includes(f.data.category)&&a.length===1&&yn(a[0])&&s.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw p.data=f.data,p}throw f},u.onMismatch=(l,a,s)=>{var f=u.createError(l,a,s);if(["wrongType","mismatch"].includes(f.data.category)&&a.length===1&&yn(a[0])&&s.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw p.data=f.data,p}throw f},u});function Mx(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Tx(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Ine(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Ox(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}g();y();v();var Fne="ResultSet",_ne=[],hF=K(Fne,_ne,()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0});g();y();v();g();y();v();var hh=9e15,If=1e9,vS="0123456789abcdef",Fx="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",_x="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",yS={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-hh,maxE:hh,crypto:!1},yF,vl,mr=!0,Bx="[DecimalError] ",Of=Bx+"Invalid argument: ",xF=Bx+"Precision limit exceeded",wF=Bx+"crypto unavailable",bF="[object Decimal]",po=Math.floor,Ai=Math.pow,kne=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Bne=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Lne=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,DF=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ls=1e7,ar=7,Pne=9007199254740991,Rne=Fx.length-1,xS=_x.length-1,yt={toStringTag:bF};yt.absoluteValue=yt.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),er(e)};yt.ceil=function(){return er(new this.constructor(this),this.e+1,2)};yt.clampedTo=yt.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Of+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};yt.comparedTo=yt.cmp=function(e){var t,r,n,i,o=this,u=o.d,l=(e=new o.constructor(e)).d,a=o.s,s=e.s;if(!u||!l)return!a||!s?NaN:a!==s?a:u===l?0:!u^a<0?1:-1;if(!u[0]||!l[0])return u[0]?a:l[0]?-s:0;if(a!==s)return a;if(o.e!==e.e)return o.e>e.e^a<0?1:-1;for(n=u.length,i=l.length,t=0,r=nl[t]^a<0?1:-1;return n===i?0:n>i^a<0?1:-1};yt.cosine=yt.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+ar,n.rounding=1,r=qne(n,CF(n,r)),n.precision=e,n.rounding=t,er(vl==2||vl==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};yt.cubeRoot=yt.cbrt=function(){var e,t,r,n,i,o,u,l,a,s,f=this,p=f.constructor;if(!f.isFinite()||f.isZero())return new p(f);for(mr=!1,o=f.s*Ai(f.s*f,1/3),!o||Math.abs(o)==1/0?(r=to(f.d),e=f.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=Ai(r,1/3),e=po((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=f.s):n=new p(o.toString()),u=(e=p.precision)+3;;)if(l=n,a=l.times(l).times(l),s=a.plus(f),n=cn(s.plus(f).times(l),s.plus(a),u+2,1),to(l.d).slice(0,u)===(r=to(n.d)).slice(0,u))if(r=r.slice(u-3,u+1),r=="9999"||!i&&r=="4999"){if(!i&&(er(l,e+1,0),l.times(l).times(l).eq(f))){n=l;break}u+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(er(n,e+1,1),t=!n.times(n).times(n).eq(f));break}return mr=!0,er(n,e,p.rounding,t)};yt.decimalPlaces=yt.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-po(this.e/ar))*ar,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};yt.dividedBy=yt.div=function(e){return cn(this,new this.constructor(e))};yt.dividedToIntegerBy=yt.divToInt=function(e){var t=this,r=t.constructor;return er(cn(t,new r(e),0,1,1),r.precision,r.rounding)};yt.equals=yt.eq=function(e){return this.cmp(e)===0};yt.floor=function(){return er(new this.constructor(this),this.e+1,3)};yt.greaterThan=yt.gt=function(e){return this.cmp(e)>0};yt.greaterThanOrEqualTo=yt.gte=function(e){var t=this.cmp(e);return t==1||t===0};yt.hyperbolicCosine=yt.cosh=function(){var e,t,r,n,i,o=this,u=o.constructor,l=new u(1);if(!o.isFinite())return new u(o.s?1/0:NaN);if(o.isZero())return l;r=u.precision,n=u.rounding,u.precision=r+Math.max(o.e,o.sd())+4,u.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Px(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=dh(u,1,o.times(t),new u(1),!0);for(var a,s=e,f=new u(8);s--;)a=o.times(o),o=l.minus(a.times(f.minus(a.times(f))));return er(o,u.precision=r,u.rounding=n,!0)};yt.hyperbolicSine=yt.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=dh(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Px(5,e)),i=dh(o,2,i,i,!0);for(var u,l=new o(5),a=new o(16),s=new o(20);e--;)u=i.times(i),i=i.times(l.plus(u.times(a.times(u).plus(s))))}return o.precision=t,o.rounding=r,er(i,t,r,!0)};yt.hyperbolicTangent=yt.tanh=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+7,n.rounding=1,cn(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};yt.inverseCosine=yt.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?Bs(r,i,o):new r(0):new r(NaN):t.isZero()?Bs(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=Bs(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};yt.inverseHyperbolicCosine=yt.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,mr=!1,r=r.times(r).minus(1).sqrt().plus(r),mr=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};yt.inverseHyperbolicSine=yt.asinh=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+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,mr=!1,r=r.times(r).plus(1).sqrt().plus(r),mr=!0,n.precision=e,n.rounding=t,r.ln())};yt.inverseHyperbolicTangent=yt.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?er(new o(i),e,t,!0):(o.precision=r=n-i.e,i=cn(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};yt.inverseSine=yt.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=Bs(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};yt.inverseTangent=yt.atan=function(){var e,t,r,n,i,o,u,l,a,s=this,f=s.constructor,p=f.precision,h=f.rounding;if(s.isFinite()){if(s.isZero())return new f(s);if(s.abs().eq(1)&&p+4<=xS)return u=Bs(f,p+4,h).times(.25),u.s=s.s,u}else{if(!s.s)return new f(NaN);if(p+4<=xS)return u=Bs(f,p+4,h).times(.5),u.s=s.s,u}for(f.precision=l=p+10,f.rounding=1,r=Math.min(28,l/ar+2|0),e=r;e;--e)s=s.div(s.times(s).plus(1).sqrt().plus(1));for(mr=!1,t=Math.ceil(l/ar),n=1,a=s.times(s),u=new f(s),i=s;e!==-1;)if(i=i.times(a),o=u.minus(i.div(n+=2)),i=i.times(a),u=o.plus(i.div(n+=2)),u.d[t]!==void 0)for(e=t;u.d[e]===o.d[e]&&e--;);return r&&(u=u.times(2<this.d.length-2};yt.isNaN=function(){return!this.s};yt.isNegative=yt.isNeg=function(){return this.s<0};yt.isPositive=yt.isPos=function(){return this.s>0};yt.isZero=function(){return!!this.d&&this.d[0]===0};yt.lessThan=yt.lt=function(e){return this.cmp(e)<0};yt.lessThanOrEqualTo=yt.lte=function(e){return this.cmp(e)<1};yt.logarithm=yt.log=function(e){var t,r,n,i,o,u,l,a,s=this,f=s.constructor,p=f.precision,h=f.rounding,x=5;if(e==null)e=new f(10),t=!0;else{if(e=new f(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(r=s.d,s.s<0||!r||!r[0]||s.eq(1))return new f(r&&!r[0]?-1/0:s.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(mr=!1,l=p+x,u=Tf(s,l),n=t?kx(f,l+10):Tf(e,l),a=cn(u,n,l,1),bv(a.d,i=p,h))do if(l+=10,u=Tf(s,l),n=t?kx(f,l+10):Tf(e,l),a=cn(u,n,l,1),!o){+to(a.d).slice(i+1,i+15)+1==1e14&&(a=er(a,p+1,0));break}while(bv(a.d,i+=10,h));return mr=!0,er(a,p,h)};yt.minus=yt.sub=function(e){var t,r,n,i,o,u,l,a,s,f,p,h,x=this,b=x.constructor;if(e=new b(e),!x.d||!e.d)return!x.s||!e.s?e=new b(NaN):x.d?e.s=-e.s:e=new b(e.d||x.s!==e.s?x:NaN),e;if(x.s!=e.s)return e.s=-e.s,x.plus(e);if(s=x.d,h=e.d,l=b.precision,a=b.rounding,!s[0]||!h[0]){if(h[0])e.s=-e.s;else if(s[0])e=new b(x);else return new b(a===3?-0:0);return mr?er(e,l,a):e}if(r=po(e.e/ar),f=po(x.e/ar),s=s.slice(),o=f-r,o){for(p=o<0,p?(t=s,o=-o,u=h.length):(t=h,r=f,u=s.length),n=Math.max(Math.ceil(l/ar),u)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=s.length,u=h.length,p=n0;--n)s[u++]=0;for(n=h.length;n>o;){if(s[--n]u?o+1:u+1,i>u&&(i=u,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(u=s.length,i=f.length,u-i<0&&(i=u,r=f,f=s,s=r),t=0;i;)t=(s[--i]=s[i]+f[i]+t)/Ls|0,s[i]%=Ls;for(t&&(s.unshift(t),++n),u=s.length;s[--u]==0;)s.pop();return e.d=s,e.e=Lx(s,n),mr?er(e,l,a):e};yt.precision=yt.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Of+e);return r.d?(t=NF(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};yt.round=function(){var e=this,t=e.constructor;return er(new t(e),e.e+1,t.rounding)};yt.sine=yt.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())+ar,n.rounding=1,r=Une(n,CF(n,r)),n.precision=e,n.rounding=t,er(vl>2?r.neg():r,e,t,!0)):new n(NaN)};yt.squareRoot=yt.sqrt=function(){var e,t,r,n,i,o,u=this,l=u.d,a=u.e,s=u.s,f=u.constructor;if(s!==1||!l||!l[0])return new f(!s||s<0&&(!l||l[0])?NaN:l?u:1/0);for(mr=!1,s=Math.sqrt(+u),s==0||s==1/0?(t=to(l),(t.length+a)%2==0&&(t+="0"),s=Math.sqrt(t),a=po((a+1)/2)-(a<0||a%2),s==1/0?t="5e"+a:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+a),n=new f(t)):n=new f(s.toString()),r=(a=f.precision)+3;;)if(o=n,n=o.plus(cn(u,o,r+2,1)).times(.5),to(o.d).slice(0,r)===(t=to(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(er(o,a+1,0),o.times(o).eq(u))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(er(n,a+1,1),e=!n.times(n).eq(u));break}return mr=!0,er(n,a,f.rounding,e)};yt.tangent=yt.tan=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+10,n.rounding=1,r=r.sin(),r.s=1,r=cn(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,er(vl==2||vl==4?r.neg():r,e,t,!0)):new n(NaN)};yt.times=yt.mul=function(e){var t,r,n,i,o,u,l,a,s,f=this,p=f.constructor,h=f.d,x=(e=new p(e)).d;if(e.s*=f.s,!h||!h[0]||!x||!x[0])return new p(!e.s||h&&!h[0]&&!x||x&&!x[0]&&!h?NaN:!h||!x?e.s/0:e.s*0);for(r=po(f.e/ar)+po(e.e/ar),a=h.length,s=x.length,a=0;){for(t=0,i=a+n;i>n;)l=o[i]+x[n]*h[i-n-1]+t,o[i--]=l%Ls|0,t=l/Ls|0;o[i]=(o[i]+t)%Ls|0}for(;!o[--u];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Lx(o,r),mr?er(e,p.precision,p.rounding):e};yt.toBinary=function(e,t){return DS(this,2,e,t)};yt.toDecimalPlaces=yt.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Go(e,0,If),t===void 0?t=n.rounding:Go(t,0,8),er(r,e+r.e+1,t))};yt.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Cu(n,!0):(Go(e,0,If),t===void 0?t=i.rounding:Go(t,0,8),n=er(new i(n),e+1,t),r=Cu(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};yt.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Cu(i):(Go(e,0,If),t===void 0?t=o.rounding:Go(t,0,8),n=er(new o(i),e+i.e+1,t),r=Cu(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};yt.toFraction=function(e){var t,r,n,i,o,u,l,a,s,f,p,h,x=this,b=x.d,w=x.constructor;if(!b)return new w(x);if(s=r=new w(1),n=a=new w(0),t=new w(n),o=t.e=NF(b)-x.e-1,u=o%ar,t.d[0]=Ai(10,u<0?ar+u:u),e==null)e=o>0?t:s;else{if(l=new w(e),!l.isInt()||l.lt(s))throw Error(Of+l);e=l.gt(t)?o>0?t:s:l}for(mr=!1,l=new w(to(b)),f=w.precision,w.precision=o=b.length*ar*2;p=cn(l,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=s,s=a.plus(p.times(i)),a=i,i=t,t=l.minus(p.times(i)),l=i;return i=cn(e.minus(r),n,0,1,1),a=a.plus(i.times(s)),r=r.plus(i.times(n)),a.s=s.s=x.s,h=cn(s,n,o,1).minus(x).abs().cmp(cn(a,r,o,1).minus(x).abs())<1?[s,n]:[a,r],w.precision=f,mr=!0,h};yt.toHexadecimal=yt.toHex=function(e,t){return DS(this,16,e,t)};yt.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:Go(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(mr=!1,r=cn(r,e,0,t,1).times(e),mr=!0,er(r)):(e.s=r.s,r=e),r};yt.toNumber=function(){return+this};yt.toOctal=function(e,t){return DS(this,8,e,t)};yt.toPower=yt.pow=function(e){var t,r,n,i,o,u,l=this,a=l.constructor,s=+(e=new a(e));if(!l.d||!e.d||!l.d[0]||!e.d[0])return new a(Ai(+l,s));if(l=new a(l),l.eq(1))return l;if(n=a.precision,o=a.rounding,e.eq(1))return er(l,n,o);if(t=po(e.e/ar),t>=e.d.length-1&&(r=s<0?-s:s)<=Pne)return i=EF(a,l,r,n),e.s<0?new a(1).div(i):er(i,n,o);if(u=l.s,u<0){if(ta.maxE+1||t0?u/0:0):(mr=!1,a.rounding=l.s=1,r=Math.min(12,(t+"").length),i=wS(e.times(Tf(l,n+r)),n),i.d&&(i=er(i,n+5,1),bv(i.d,n,o)&&(t=n+10,i=er(wS(e.times(Tf(l,t+r)),t),t+5,1),+to(i.d).slice(n+1,n+15)+1==1e14&&(i=er(i,n+1,0)))),i.s=u,mr=!0,a.rounding=o,er(i,n,o))};yt.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Cu(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Go(e,1,If),t===void 0?t=i.rounding:Go(t,0,8),n=er(new i(n),e,t),r=Cu(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};yt.toSignificantDigits=yt.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Go(e,1,If),t===void 0?t=n.rounding:Go(t,0,8)),er(new n(r),e,t)};yt.toString=function(){var e=this,t=e.constructor,r=Cu(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};yt.truncated=yt.trunc=function(){return er(new this.constructor(this),this.e+1,1)};yt.valueOf=yt.toJSON=function(){var e=this,t=e.constructor,r=Cu(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function to(e){var t,r,n,i=e.length-1,o="",u=e[0];if(i>0){for(o+=u,t=1;tr)throw Error(Of+e)}function bv(e,t,r,n){var i,o,u,l;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=ar,i=0):(i=Math.ceil((t+1)/ar),t%=ar),o=Ai(10,ar-t),l=e[i]%o|0,n==null?t<3?(t==0?l=l/100|0:t==1&&(l=l/10|0),u=r<4&&l==99999||r>3&&l==49999||l==5e4||l==0):u=(r<4&&l+1==o||r>3&&l+1==o/2)&&(e[i+1]/o/100|0)==Ai(10,t-2)-1||(l==o/2||l==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?l=l/1e3|0:t==1?l=l/100|0:t==2&&(l=l/10|0),u=(n||r<4)&&l==9999||!n&&r>3&&l==4999):u=((n||r<4)&&l+1==o||!n&&r>3&&l+1==o/2)&&(e[i+1]/o/1e3|0)==Ai(10,t-3)-1,u}function Ix(e,t,r){for(var n,i=[0],o,u=0,l=e.length;ur-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function qne(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Px(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=dh(e,1,t.times(i),new e(1));for(var o=r;o--;){var u=t.times(t);t=u.times(u).minus(u).times(8).plus(1)}return e.precision-=r,t}var cn=function(){function e(n,i,o){var u,l=0,a=n.length;for(n=n.slice();a--;)u=n[a]*i+l,n[a]=u%o|0,l=u/o|0;return l&&n.unshift(l),n}function t(n,i,o,u){var l,a;if(o!=u)a=o>u?1:-1;else for(l=a=0;li[l]?1:-1;break}return a}function r(n,i,o,u){for(var l=0;o--;)n[o]-=l,l=n[o]1;)n.shift()}return function(n,i,o,u,l,a){var s,f,p,h,x,b,w,A,E,O,M,I,F,C,P,R,q,U,H,V,W=n.constructor,ee=n.s==i.s?1:-1,ie=n.d,Y=i.d;if(!ie||!ie[0]||!Y||!Y[0])return new W(!n.s||!i.s||(ie?Y&&ie[0]==Y[0]:!Y)?NaN:ie&&ie[0]==0||!Y?ee*0:ee/0);for(a?(x=1,f=n.e-i.e):(a=Ls,x=ar,f=po(n.e/x)-po(i.e/x)),H=Y.length,q=ie.length,E=new W(ee),O=E.d=[],p=0;Y[p]==(ie[p]||0);p++);if(Y[p]>(ie[p]||0)&&f--,o==null?(C=o=W.precision,u=W.rounding):l?C=o+(n.e-i.e)+1:C=o,C<0)O.push(1),b=!0;else{if(C=C/x+2|0,p=0,H==1){for(h=0,Y=Y[0],C++;(p1&&(Y=e(Y,h,a),ie=e(ie,h,a),H=Y.length,q=ie.length),R=H,M=ie.slice(0,H),I=M.length;I=a/2&&++U;do h=0,s=t(Y,M,H,I),s<0?(F=M[0],H!=I&&(F=F*a+(M[1]||0)),h=F/U|0,h>1?(h>=a&&(h=a-1),w=e(Y,h,a),A=w.length,I=M.length,s=t(w,M,A,I),s==1&&(h--,r(w,H=10;h/=10)p++;E.e=p+f*x-1,er(E,l?o+E.e+1:o,u,b)}return E}}();function er(e,t,r,n){var i,o,u,l,a,s,f,p,h,x=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,l=p[0];l>=10;l/=10)i++;if(o=t-i,o<0)o+=ar,u=t,f=p[h=0],a=f/Ai(10,i-u-1)%10|0;else if(h=Math.ceil((o+1)/ar),l=p.length,h>=l)if(n){for(;l++<=h;)p.push(0);f=a=0,i=1,o%=ar,u=o-ar+1}else break e;else{for(f=l=p[h],i=1;l>=10;l/=10)i++;o%=ar,u=o-ar+i,a=u<0?0:f/Ai(10,i-u-1)%10|0}if(n=n||t<0||p[h+1]!==void 0||(u<0?f:f%Ai(10,i-u-1)),s=r<4?(a||n)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||n||r==6&&(o>0?u>0?f/Ai(10,i-u):0:p[h-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,s?(t-=e.e+1,p[0]=Ai(10,(ar-t%ar)%ar),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=h,l=1,h--):(p.length=h+1,l=Ai(10,ar-o),p[h]=u>0?(f/Ai(10,i-u)%Ai(10,u)|0)*l:0),s)for(;;)if(h==0){for(o=1,u=p[0];u>=10;u/=10)o++;for(u=p[0]+=l,l=1;u>=10;u/=10)l++;o!=l&&(e.e++,p[0]==Ls&&(p[0]=1));break}else{if(p[h]+=l,p[h]!=Ls)break;p[h--]=0,l=1}for(o=p.length;p[--o]===0;)p.pop()}return mr&&(e.e>x.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Mf(n):u>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Mf(-i-1)+o,r&&(n=r-u)>0&&(o+=Mf(n))):i>=u?(o+=Mf(i+1-u),r&&(n=r-i-1)>0&&(o=o+"."+Mf(n))):((n=i+1)0&&(i+1===u&&(o+="."),o+=Mf(n))),o}function Lx(e,t){var r=e[0];for(t*=ar;r>=10;r/=10)t++;return t}function kx(e,t,r){if(t>Rne)throw mr=!0,r&&(e.precision=r),Error(xF);return er(new e(Fx),t,1,!0)}function Bs(e,t,r){if(t>xS)throw Error(xF);return er(new e(_x),t,r,!0)}function NF(e){var t=e.length-1,r=t*ar+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Mf(e){for(var t="";e--;)t+="0";return t}function EF(e,t,r,n){var i,o=new e(1),u=Math.ceil(n/ar+4);for(mr=!1;;){if(r%2&&(o=o.times(t),gF(o.d,u)&&(i=!0)),r=po(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),gF(t.d,u)}return mr=!0,o}function dF(e){return e.d[e.d.length-1]&1}function SF(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(mr=!1,a=b):a=t,l=new h(.03125);e.e>-2;)e=e.times(l),p+=5;for(n=Math.log(Ai(2,p))/Math.LN10*2+5|0,a+=n,r=o=u=new h(1),h.precision=a;;){if(o=er(o.times(e),a,1),r=r.times(++f),l=u.plus(cn(o,r,a,1)),to(l.d).slice(0,a)===to(u.d).slice(0,a)){for(i=p;i--;)u=er(u.times(u),a,1);if(t==null)if(s<3&&bv(u.d,a-n,x,s))h.precision=a+=10,r=o=l=new h(1),f=0,s++;else return er(u,h.precision=b,x,mr=!0);else return h.precision=b,u}u=l}}function Tf(e,t){var r,n,i,o,u,l,a,s,f,p,h,x=1,b=10,w=e,A=w.d,E=w.constructor,O=E.rounding,M=E.precision;if(w.s<0||!A||!A[0]||!w.e&&A[0]==1&&A.length==1)return new E(A&&!A[0]?-1/0:w.s!=1?NaN:A?0:w);if(t==null?(mr=!1,f=M):f=t,E.precision=f+=b,r=to(A),n=r.charAt(0),Math.abs(o=w.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)w=w.times(e),r=to(w.d),n=r.charAt(0),x++;o=w.e,n>1?(w=new E("0."+r),o++):w=new E(n+"."+r.slice(1))}else return s=kx(E,f+2,M).times(o+""),w=Tf(new E(n+"."+r.slice(1)),f-b).plus(s),E.precision=M,t==null?er(w,M,O,mr=!0):w;for(p=w,a=u=w=cn(w.minus(1),w.plus(1),f,1),h=er(w.times(w),f,1),i=3;;){if(u=er(u.times(h),f,1),s=a.plus(cn(u,new E(i),f,1)),to(s.d).slice(0,f)===to(a.d).slice(0,f))if(a=a.times(2),o!==0&&(a=a.plus(kx(E,f+2,M).times(o+""))),a=cn(a,new E(x),f,1),t==null)if(bv(a.d,f-b,O,l))E.precision=f+=b,s=u=w=cn(p.minus(1),p.plus(1),f,1),h=er(w.times(w),f,1),i=l=1;else return er(a,E.precision=M,O,mr=!0);else return E.precision=M,a;a=s,i+=2}}function AF(e){return String(e.s*e.s/0)}function bS(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%ar,r<0&&(n+=ar),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),DF.test(t))return bS(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Bne.test(t))r=16,t=t.toLowerCase();else if(kne.test(t))r=2;else if(Lne.test(t))r=8;else throw Error(Of+t);for(o=t.search(/p/i),o>0?(a=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),u=o>=0,n=e.constructor,u&&(t=t.replace(".",""),l=t.length,o=l-o,i=EF(n,new n(r),o,o*2)),s=Ix(t,r,Ls),f=s.length-1,o=f;s[o]===0;--o)s.pop();return o<0?new n(e.s*0):(e.e=Lx(s,f),e.d=s,mr=!1,u&&(e=cn(e,i,l*4)),a&&(e=e.times(Math.abs(a)<54?Ai(2,a):Dv.pow(2,a))),mr=!0,e)}function Une(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:dh(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Px(5,r)),t=dh(e,2,t,t);for(var i,o=new e(5),u=new e(16),l=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(u.times(i).minus(l))));return t}function dh(e,t,r,n,i){var o,u,l,a,s=1,f=e.precision,p=Math.ceil(f/ar);for(mr=!1,a=r.times(r),l=new e(n);;){if(u=cn(l.times(a),new e(t++*t++),f,1),l=i?n.plus(u):n.minus(u),n=cn(u.times(a),new e(t++*t++),f,1),u=l.plus(n),u.d[p]!==void 0){for(o=p;u.d[o]===l.d[o]&&o--;);if(o==-1)break}o=l,l=n,n=u,u=o,s++}return mr=!0,u.d.length=p+1,u}function Px(e,t){for(var r=e;--t;)r*=e;return r}function CF(e,t){var r,n=t.s<0,i=Bs(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return vl=n?4:1,t;if(r=t.divToInt(i),r.isZero())vl=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return vl=dF(r)?n?2:3:n?4:1,t;vl=dF(r)?n?1:4:n?3:2}return t.minus(i).abs()}function DS(e,t,r,n){var i,o,u,l,a,s,f,p,h,x=e.constructor,b=r!==void 0;if(b?(Go(r,1,If),n===void 0?n=x.rounding:Go(n,0,8)):(r=x.precision,n=x.rounding),!e.isFinite())f=AF(e);else{for(f=Cu(e),u=f.indexOf("."),b?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,u>=0&&(f=f.replace(".",""),h=new x(1),h.e=f.length-u,h.d=Ix(Cu(h),10,i),h.e=h.d.length),p=Ix(f,10,i),o=a=p.length;p[--a]==0;)p.pop();if(!p[0])f=b?"0p+0":"0";else{if(u<0?o--:(e=new x(e),e.d=p,e.e=o,e=cn(e,h,r,n,0,i),p=e.d,o=e.e,s=yF),u=p[r],l=i/2,s=s||p[r+1]!==void 0,s=n<4?(u!==void 0||s)&&(n===0||n===(e.s<0?3:2)):u>l||u===l&&(n===4||s||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,s)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(a=p.length;!p[a-1];--a);for(u=0,f="";u1)if(t==16||t==8){for(u=t==16?4:3,--a;a%u;a++)f+="0";for(p=Ix(f,i,t),a=p.length;!p[a-1];--a);for(u=1,f="1.";ua)for(o-=a;o--;)f+="0";else ot)return e.length=t,!0}function Hne(e){return new this(e).abs()}function $ne(e){return new this(e).acos()}function Wne(e){return new this(e).acosh()}function Vne(e,t){return new this(e).plus(t)}function Gne(e){return new this(e).asin()}function Yne(e){return new this(e).asinh()}function Zne(e){return new this(e).atan()}function Xne(e){return new this(e).atanh()}function Kne(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Bs(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Bs(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Bs(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(cn(e,t,o,1)),t=Bs(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(cn(e,t,o,1)),r}function Jne(e){return new this(e).cbrt()}function Qne(e){return er(e=new this(e),e.e+1,2)}function jne(e,t,r){return new this(e).clamp(t,r)}function eie(e){if(!e||typeof e!="object")throw Error(Bx+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,If,"rounding",0,8,"toExpNeg",-hh,0,"toExpPos",0,hh,"maxE",0,hh,"minE",-hh,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Of+r+": "+n);if(r="crypto",i&&(this[r]=yS[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(wF);else this[r]=!1;else throw Error(Of+r+": "+n);return this}function tie(e){return new this(e).cos()}function rie(e){return new this(e).cosh()}function MF(e){var t,r,n;function i(o){var u,l,a,s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,vF(o)){s.s=o.s,mr?!o.d||o.e>i.maxE?(s.e=NaN,s.d=null):o.e=10;l/=10)u++;mr?u>i.maxE?(s.e=NaN,s.d=null):u=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:l[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(l.push(i%1e7),o+=4);o=n/4}else throw Error(wF);else for(;o=10;i/=10)n++;n{var{on:t,config:r}=e,n=mp.clone({precision:r.precision,modulo:mp.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(i){return new n(i.value)},t&&t("config",function(i,o){i.precision!==o.precision&&n.config({precision:i.precision})}),n},{isClass:!0});g();y();v();var qi=rn(IF(),1);var Tie="Complex",Oie=[],FF=K(Tie,Oie,()=>(Object.defineProperty(qi.default,"name",{value:"Complex"}),qi.default.prototype.constructor=qi.default,qi.default.prototype.type="Complex",qi.default.prototype.isComplex=!0,qi.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},qi.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},qi.default.prototype.format=function(e){var t="",r=this.im,n=this.re,i=ks(this.re,e),o=ks(this.im,e),u=$t(e)?e:e?e.precision:null;if(u!==null){var l=Math.pow(10,-u);Math.abs(n/r)t.re?1:e.ret.im?1:e.im1&&(t[r]=(t[r]||0)+1):t[e]=(t[e]||0)+1,t}var va=function(e,t){var r=0,n=1,i=1,o=0,u=0,l=0,a=1,s=1,f=0,p=1,h=1,x=1,b=1e7,w;if(e!=null)if(t!==void 0){if(r=e,n=t,i=r*n,r%1!==0||n%1!==0)throw Bie()}else switch(typeof e){case"object":{if("d"in e&&"n"in e)r=e.n,n=e.d,"s"in e&&(r*=e.s);else if(0 in e)r=e[0],1 in e&&(n=e[1]);else throw Rx();i=r*n;break}case"number":{if(e<0&&(i=e,e=-e),e%1===0)r=e;else if(e>0){for(e>=1&&(s=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=s);p<=b&&x<=b;)if(w=(f+h)/(p+x),e===w){p+x<=b?(r=f+h,n=p+x):x>p?(r=h,n=x):(r=f,n=p);break}else e>w?(f+=h,p+=x):(h+=f,x+=p),p>b?(r=h,n=x):(r=f,n=p);r*=s}else(isNaN(e)||isNaN(t))&&(n=r=NaN);break}case"string":{if(p=e.match(/\d+|./g),p===null)throw Rx();if(p[f]==="-"?(i=-1,f++):p[f]==="+"&&f++,p.length===f+1?u=yl(p[f++],i):p[f+1]==="."||p[f]==="."?(p[f]!=="."&&(o=yl(p[f++],i)),f++,(f+1===p.length||p[f+1]==="("&&p[f+3]===")"||p[f+1]==="'"&&p[f+3]==="'")&&(u=yl(p[f],i),a=Math.pow(10,p[f].length),f++),(p[f]==="("&&p[f+2]===")"||p[f]==="'"&&p[f+2]==="'")&&(l=yl(p[f+1],i),s=Math.pow(10,p[f+1].length)-1,f+=3)):p[f+1]==="/"||p[f+1]===":"?(u=yl(p[f],i),a=yl(p[f+2],1),f+=3):p[f+3]==="/"&&p[f+1]===" "&&(o=yl(p[f],i),u=yl(p[f+2],i),a=yl(p[f+4],1),f+=5),p.length<=f){n=a*s,i=r=l+n*o+s*u;break}}default:throw Rx()}if(n===0)throw ES();Zt.s=i<0?-1:1,Zt.n=Math.abs(r),Zt.d=Math.abs(n)};function Fie(e,t,r){for(var n=1;t>0;e=e*e%r,t>>=1)t&1&&(n=n*e%r);return n}function _ie(e,t){for(;t%2===0;t/=2);for(;t%5===0;t/=5);if(t===1)return 0;for(var r=10%t,n=1;r!==1;n++)if(r=r*10%t,n>Iie)return 0;return n}function kie(e,t,r){for(var n=1,i=Fie(10,r,t),o=0;o<300;o++){if(n===i)return o;n=n*10%t,i=i*10%t}return 0}function gh(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function zi(e,t){if(va(e,t),this instanceof zi)e=gh(Zt.d,Zt.n),this.s=Zt.s,this.n=Zt.n/e,this.d=Zt.d/e;else return Un(Zt.s*Zt.n,Zt.d)}var ES=function(){return new Error("Division by Zero")},Rx=function(){return new Error("Invalid argument")},Bie=function(){return new Error("Parameters must be integer")};zi.prototype={s:1,n:0,d:1,abs:function(){return Un(this.n,this.d)},neg:function(){return Un(-this.s*this.n,this.d)},add:function(e,t){return va(e,t),Un(this.s*this.n*Zt.d+Zt.s*this.d*Zt.n,this.d*Zt.d)},sub:function(e,t){return va(e,t),Un(this.s*this.n*Zt.d-Zt.s*this.d*Zt.n,this.d*Zt.d)},mul:function(e,t){return va(e,t),Un(this.s*Zt.s*this.n*Zt.n,this.d*Zt.d)},div:function(e,t){return va(e,t),Un(this.s*Zt.s*this.n*Zt.d,this.d*Zt.n)},clone:function(){return Un(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new zi(NaN);if(e===void 0)return Un(this.s*this.n%this.d,1);if(va(e,t),Zt.n===0&&this.d===0)throw ES();return Un(this.s*(Zt.d*this.n)%(Zt.n*this.d),Zt.d*this.d)},gcd:function(e,t){return va(e,t),Un(gh(Zt.n,this.n)*gh(Zt.d,this.d),Zt.d*this.d)},lcm:function(e,t){return va(e,t),Zt.n===0&&this.n===0?Un(0,1):Un(Zt.n*this.n,gh(Zt.n,this.n)*gh(Zt.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new zi(NaN):Un(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new zi(NaN):Un(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new zi(NaN):Un(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return va(e,t),Un(this.s*Math.round(this.n*Zt.d/(this.d*Zt.n))*Zt.n,Zt.d)},inverse:function(){return Un(this.s*this.d,this.n)},pow:function(e,t){if(va(e,t),Zt.d===1)return Zt.s<0?Un(Math.pow(this.s*this.d,Zt.n),Math.pow(this.n,Zt.n)):Un(Math.pow(this.s*this.n,Zt.n),Math.pow(this.d,Zt.n));if(this.s<0)return null;var r=_F(this.n),n=_F(this.d),i=1,o=1;for(var u in r)if(u!=="1"){if(u==="0"){i=0;break}if(r[u]*=Zt.n,r[u]%Zt.d===0)r[u]/=Zt.d;else return null;i*=Math.pow(u,r[u])}for(var u in n)if(u!=="1"){if(n[u]*=Zt.n,n[u]%Zt.d===0)n[u]/=Zt.d;else return null;o*=Math.pow(u,n[u])}return Zt.s<0?Un(o,i):Un(i,o)},equals:function(e,t){return va(e,t),this.s*this.n*Zt.d===Zt.s*Zt.n*this.d},compare:function(e,t){va(e,t);var r=this.s*this.n*Zt.d-Zt.s*Zt.n*this.d;return(0=0;o--)i=i.inverse().add(r[o]);if(Math.abs(i.sub(t).valueOf())0&&(r+=t,r+=" ",n%=i),r+=n,r+="/",r+=i),r},toLatex:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),i===1?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,n%=i),r+="\\frac{",r+=n,r+="}{",r+=i,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(t)||isNaN(r))return n;do n.push(Math.floor(t/r)),e=t%r,t=r,r=e;while(t!==1);return n},toString:function(e){var t=this.n,r=this.d;if(isNaN(t)||isNaN(r))return"NaN";e=e||15;var n=_ie(t,r),i=kie(t,r,n),o=this.s<0?"-":"";if(o+=t/r|0,t%=r,t*=10,t&&(o+="."),n){for(var u=i;u--;)o+=t/r|0,t%=r,t*=10;o+="(";for(var u=n;u--;)o+=t/r|0,t%=r,t*=10;o+=")"}else for(var u=e;t&&u--;)o+=t/r|0,t%=r,t*=10;return o}};var Lie="Fraction",Pie=[],kF=K(Lie,Pie,()=>(Object.defineProperty(zi,"name",{value:"Fraction"}),zi.prototype.constructor=zi,zi.prototype.type="Fraction",zi.prototype.isFraction=!0,zi.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},zi.fromJSON=function(e){return new zi(e)},zi),{isClass:!0});g();y();v();var Rie="Range",qie=[],BF=K(Rie,qie,()=>{function e(t,r,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=t!=null,o=r!=null,u=n!=null;if(i){if(kt(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter start must be a number")}if(o){if(kt(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(u){if(kt(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(t):0,this.end=o?parseFloat(r):0,this.step=u?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if(typeof t!="string")return null;var r=t.split(":"),n=r.map(function(o){return parseFloat(o)}),i=n.some(function(o){return isNaN(o)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var t=0,r=this.start,n=this.step,i=this.end,o=i-r;return Wa(n)===Wa(o)?t=Math.ceil(o/n):o===0&&(t=0),isNaN(t)&&(t=0),[t]},e.prototype.min=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start:this.start+(t-1)*this.step},e.prototype.max=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start+(t-1)*this.step:this.start},e.prototype.forEach=function(t){var r=this.start,n=this.step,i=this.end,o=0;if(n>0)for(;ri;)t(r,[o],this),r+=n,o++},e.prototype.map=function(t){var r=[];return this.forEach(function(n,i,o){r[i[0]]=t(n,i,o)}),r},e.prototype.toArray=function(){var t=[];return this.forEach(function(r,n){t[n[0]]=r}),t},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(t){var r=ks(this.start,t);return this.step!==1&&(r+=":"+ks(this.step,t)),r+=":"+ks(this.end,t),r},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e},{isClass:!0});g();y();v();var zie="Matrix",Uie=[],LF=K(zie,Uie,()=>{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(t,r){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,r,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,r){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,r){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(t,r){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){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(t){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});g();y();v();g();y();v();g();y();v();g();y();v();function SS(e,t,r){var n=e.constructor,i=new n(2),o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Nt(r))throw new Error("size must be an integer");if(e.greaterThan(i.pow(r-1).sub(1))||e.lessThan(i.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(r))),o="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(o);case 8:return"".concat(e.toOctal()).concat(o);case 16:return"".concat(e.toHexadecimal()).concat(o);default:throw new Error("Base ".concat(t," not supported "))}}function qF(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:i}=pS(t);switch(r){case"fixed":return $ie(e,n);case"exponential":return PF(e,n);case"engineering":return Hie(e,n);case"bin":return SS(e,2,i);case"oct":return SS(e,8,i);case"hex":return SS(e,16,i);case"auto":{var o=RF(t?.lowerExp,-3),u=RF(t?.upperExp,5);if(e.isZero())return"0";var l,a=e.toSignificantDigits(n),s=a.e;return s>=o&&s=0?"+":"")+n.toString()}function PF(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function $ie(e,t){return e.toFixed(t)}function RF(e,t){return $t(e)?e:kt(e)?e.toNumber():t}function UF(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function Kt(e,t){var r=Wie(e,t);return t&&typeof t=="object"&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function Wie(e,t){if(typeof e=="number")return ks(e,t);if(kt(e))return qF(e,t);if(Vie(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return HF(e,t);if(gn(e))return hp(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var r=Object.keys(e).map(n=>hp(n)+": "+Kt(e[n],t));return"{"+r.join(", ")+"}"}return String(e)}function hp(e){for(var t=String(e),r="",n=0;n/g,">"),t}function HF(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;it?1:-1}g();y();v();function Jt(e,t,r){if(!(this instanceof Jt))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Jt.prototype=new RangeError;Jt.prototype.constructor=RangeError;Jt.prototype.name="DimensionError";Jt.prototype.isDimensionError=!0;g();y();v();function Mi(e,t,r){if(!(this instanceof Mi))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),this.min!==void 0&&this.index=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}Mi.prototype=new RangeError;Mi.prototype.constructor=RangeError;Mi.prototype.name="IndexError";Mi.prototype.isIndexError=!0;function Wt(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function $F(e,t,r){var n,i=e.length;if(i!==t[r])throw new Jt(i,t[r]);if(r")}function CS(e,t){var r=t.length===0;if(r){if(Array.isArray(e))throw new Jt(e.length,0)}else $F(e,t,0)}function Nv(e,t){var r=e.isMatrix?e._size:Wt(e),n=t._sourceSize;n.forEach((i,o)=>{if(i!==null&&i!==r[o])throw new Jt(i,r[o])})}function Lr(e,t){if(e!==void 0){if(!$t(e)||!Nt(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new Mi(e,t)}}function dp(e){for(var t=0;t=0,a=t%r===0;if(l)if(a)n[o]=-t/r;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);return n}function WF(e){return e.reduce((t,r)=>t*r,1)}function Gie(e,t){for(var r=e,n,i=t.length-1;i>0;i--){var o=t[i];n=[];for(var u=r.length/o,l=0;lt.test(r))}function MS(e,t){return Array.prototype.join.call(e,t)}function xl(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n1)return e.slice(1).reduce(function(r,n){return YF(r,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function Yie(){for(var e=arguments.length,t=new Array(e),r=0;rh.length),i=Math.max(...n),o=new Array(i).fill(null),u=0;uo[f]&&(o[f]=l[s])}for(var p=0;p1||e[i]>t[o])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[o]))}}function OS(e,t){var r=Wt(e);if(_s(r,t))return e;Av(r,t);var n=Yie(r,t),i=n.length,o=[...Array(i-r.length).fill(1),...r],u=Xie(e);r.length1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,t=t??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:ZF(r||Number.POSITIVE_INFINITY)});for(var i=[],o=0;o{var{Matrix:t}=e;function r(f,p){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(p&&!gn(p))throw new Error("Invalid datatype: "+p);if(Et(f))f.type==="DenseMatrix"?(this._data=Lt(f._data),this._size=Lt(f._size),this._datatype=p||f._datatype):(this._data=f.toArray(),this._size=f.size(),this._datatype=p||f._datatype);else if(f&&pr(f.data)&&pr(f.size))this._data=f.data,this._size=f.size,CS(this._data,this._size),this._datatype=p||f.datatype;else if(pr(f))this._data=s(f),this._size=Wt(this._data),CS(this._data,this._size),this._datatype=p;else{if(f)throw new TypeError("Unsupported type of data ("+gr(f)+")");this._data=[],this._size=[0],this._datatype=p}}r.prototype=new t,r.prototype.createDenseMatrix=function(f,p){return new r(f,p)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return _f(this._data,gr)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(f,p){return new r(f,p)},r.prototype.subset=function(f,p,h){switch(arguments.length){case 1:return n(this,f);case 2:case 3:return o(this,f,p,h);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(f){if(!pr(f))throw new TypeError("Array expected");if(f.length!==this._size.length)throw new Jt(f.length,this._size.length);for(var p=0;p");var M=p.max().map(function(C){return C+1});a(f,M,x);var I=b.length,F=0;u(f._data,p,h,I,F)}return f}function u(f,p,h,x,b){var w=b===x-1,A=p.dimension(b);w?A.forEach(function(E,O){Lr(E),f[E]=h[O[0]]}):A.forEach(function(E,O){Lr(E),u(f[E],p,h[O[0]],x,b+1)})}r.prototype.resize=function(f,p,h){if(!yn(f))throw new TypeError("Array or Matrix expected");var x=f.valueOf().map(w=>Array.isArray(w)&&w.length===1?w[0]:w),b=h?this.clone():this;return l(b,x,p)};function l(f,p,h){if(p.length===0){for(var x=f._data;pr(x);)x=x[0];return x}return f._size=p.slice(0),f._data=Ps(f._data,f._size,h),f}r.prototype.reshape=function(f,p){var h=p?this.clone():this;h._data=Ev(h._data,f);var x=h._size.reduce((b,w)=>b*w);return h._size=Sv(f,x),h};function a(f,p,h){for(var x=f._size.slice(0),b=!1;x.lengthx[w]&&(x[w]=p[w],b=!0);b&&l(f,x,h)}r.prototype.clone=function(){var f=new r({data:Lt(this._data),size:Lt(this._size),datatype:this._datatype});return f},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(f){var p=this,h=Hx(f),x=function A(E,O){return pr(E)?E.map(function(M,I){return A(M,O.concat(I))}):h===1?f(E):h===2?f(E,O):f(E,O,p)},b=x(this._data,[]),w=this._datatype!==void 0?_f(b,gr):void 0;return new r(b,w)},r.prototype.forEach=function(f){var p=this,h=function x(b,w){pr(b)?b.forEach(function(A,E){x(A,w.concat(E))}):f(b,w,p)};h(this._data,[])},r.prototype[Symbol.iterator]=function*(){var f=function*p(h,x){if(pr(h))for(var b=0;b[M[E]]);p.push(new r(O,f._datatype))},w=0;w0?f:0,h=f<0?-f:0,x=this._size[0],b=this._size[1],w=Math.min(x-h,b-p),A=[],E=0;E0?h:0,w=h<0?-h:0,A=f[0],E=f[1],O=Math.min(A-w,E-b),M;if(pr(p)){if(p.length!==O)throw new Error("Invalid value array length");M=function(R){return p[R]}}else if(Et(p)){var I=p.size();if(I.length!==1||I[0]!==O)throw new Error("Invalid matrix length");M=function(R){return p.get([R])}}else M=function(){return p};x||(x=kt(M(0))?M(0).mul(0):0);var F=[];if(f.length>0){F=Ps(F,f,x);for(var C=0;C{var{typed:t}=e;return t(KF,{any:Lt})});g();y();v();g();y();v();g();y();v();function $x(e){var t=e.length,r=e[0].length,n,i,o=[];for(i=0;i=n.length)throw new Mi(t,n.length);return Et(e)?e.create(Wx(e.valueOf(),t,r)):Wx(e,t,r)}function Wx(e,t,r){var n,i,o,u;if(t<=0)if(Array.isArray(e[0])){for(u=$x(e),i=[],n=0;n{var{typed:t}=e;return t(QF,{number:Nt,BigNumber:function(n){return n.isInt()},bigint:function(n){return!0},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();y();v();g();y();v();var Zo="number",wl="number, number";function FS(e){return Math.abs(e)}FS.signature=Zo;function _S(e,t){return e+t}_S.signature=wl;function kS(e,t){return e-t}kS.signature=wl;function BS(e,t){return e*t}BS.signature=wl;function eoe(e,t){return e/t}eoe.signature=wl;function LS(e){return-e}LS.signature=Zo;function PS(e){return e}PS.signature=Zo;function wh(e){return JI(e)}wh.signature=Zo;function RS(e){return e*e*e}RS.signature=Zo;function qS(e){return Math.exp(e)}qS.signature=Zo;function zS(e){return QI(e)}zS.signature=Zo;function toe(e,t){if(!Nt(e)||!Nt(t))throw new Error("Parameters in function gcd must be integer numbers");for(var r;t!==0;)r=e%t,e=t,t=r;return e<0?-e:e}toe.signature=wl;function US(e,t){if(!Nt(e)||!Nt(t))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||t===0)return 0;for(var r,n=e*t;t!==0;)r=t,t=e%r,e=r;return Math.abs(n/e)}US.signature=wl;function e_(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function HS(e){return KI(e)}HS.signature=Zo;function $S(e){return XI(e)}$S.signature=Zo;function roe(e){return Nx(e)}roe.signature=Zo;function noe(e,t){return t===0?e:e-t*Math.floor(e/t)}noe.signature=wl;function WS(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=t<0;if(r&&(t=-t),t===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function Vx(e){return Wa(e)}Vx.signature=Zo;function ioe(e){return Math.sqrt(e)}ioe.signature=Zo;function VS(e){return e*e}VS.signature=Zo;function GS(e,t){var r,n,i,o=0,u=1,l=1,a=0;if(!Nt(e)||!Nt(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,r=o,o=u-n*o,u=r,r=l,l=a-n*l,a=r,e=t,t=i;var s;return e<0?s=[-e,-u,-a]:s=[e,e?u:0,a],s}GS.signature=wl;function YS(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}YS.signature=wl;function bh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Nt(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(mS(e,t))}function ooe(e){return Math.abs(e)}ooe.signature=Zo;g();y();v();var aoe="number",Dh="number, number";function ZS(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitAnd");return e&t}ZS.signature=Dh;function XS(e){if(!Nt(e))throw new Error("Integer expected in function bitNot");return~e}XS.signature=aoe;function KS(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitOr");return e|t}KS.signature=Dh;function JS(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitXor");return e^t}JS.signature=Dh;function QS(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function leftShift");return e<>t}jS.signature=Dh;function eA(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}eA.signature=Dh;g();y();v();g();y();v();function ya(e,t){if(t>1;return ya(e,r)*ya(r+1,t)}function tA(e,t){if(!Nt(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Nt(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=t171?1/0:ya(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Cv(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,n=r*e,i=n*e,o=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*o)+5246819/(75246796800*o*e))}--e,t=vp[0];for(var u=1;u=1;n--)r+=o_[n]/(e+n);return oA+(e+.5)*Math.log(t)-t+Math.log(r)}Mv.signature="number";g();y();v();var Mn="number",foe="number, number";function coe(e){return Math.acos(e)}coe.signature=Mn;function aA(e){return tF(e)}aA.signature=Mn;function sA(e){return Math.atan(1/e)}sA.signature=Mn;function uA(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}uA.signature=Mn;function lA(e){return Math.asin(1/e)}lA.signature=Mn;function fA(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}fA.signature=Mn;function cA(e){return Math.acos(1/e)}cA.signature=Mn;function pA(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}pA.signature=Mn;function poe(e){return Math.asin(e)}poe.signature=Mn;function mA(e){return rF(e)}mA.signature=Mn;function moe(e){return Math.atan(e)}moe.signature=Mn;function hoe(e,t){return Math.atan2(e,t)}hoe.signature=foe;function hA(e){return nF(e)}hA.signature=Mn;function doe(e){return Math.cos(e)}doe.signature=Mn;function goe(e){return Sx(e)}goe.signature=Mn;function dA(e){return 1/Math.tan(e)}dA.signature=Mn;function gA(e){var t=Math.exp(2*e);return(t+1)/(t-1)}gA.signature=Mn;function vA(e){return 1/Math.sin(e)}vA.signature=Mn;function yA(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Wa(e)}yA.signature=Mn;function xA(e){return 1/Math.cos(e)}xA.signature=Mn;function wA(e){return 2/(Math.exp(e)+Math.exp(-e))}wA.signature=Mn;function voe(e){return Math.sin(e)}voe.signature=Mn;function bA(e){return iF(e)}bA.signature=Mn;function yoe(e){return Math.tan(e)}yoe.signature=Mn;function xoe(e){return Ax(e)}xoe.signature=Mn;g();y();v();var Tv="number";function woe(e){return Nt(e)}woe.signature=Tv;function DA(e){return e<0}DA.signature=Tv;function NA(e){return e>0}NA.signature=Tv;function boe(e){return e===0}boe.signature=Tv;function EA(e){return Number.isNaN(e)}EA.signature=Tv;g();y();v();function xn(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return e.isNaN()||t.isNaN()?!1:!e.isFinite()||!t.isFinite()?e.eq(t):e.eq(t)?!0:e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(r),n))}var a_="isNegative",Doe=["typed","config"],s_=K(a_,Doe,e=>{var{typed:t,config:r}=e;return t(a_,{number:n=>en(n,0,r.relTol,r.absTol)?!1:DA(n),BigNumber:n=>xn(n,new n.constructor(0),r.relTol,r.absTol)?!1:n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n<0n,Fraction:n=>n.s<0,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();y();v();var u_="isNumeric",Noe=["typed"],l_=K(u_,Noe,e=>{var{typed:t}=e;return t(u_,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();y();v();var f_="hasNumericValue",Eoe=["typed","isNumeric"],c_=K(f_,Eoe,e=>{var{typed:t,isNumeric:r}=e;return t(f_,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return r(i)}})});g();y();v();var p_="isPositive",Soe=["typed","config"],m_=K(p_,Soe,e=>{var{typed:t,config:r}=e;return t(p_,{number:n=>en(n,0,r.relTol,r.absTol)?!1:NA(n),BigNumber:n=>xn(n,new n.constructor(0),r.relTol,r.absTol)?!1:!n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n>0n,Fraction:n=>n.s>0&&n.n>0,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();y();v();var h_="isZero",Aoe=["typed","equalScalar"],d_=K(h_,Aoe,e=>{var{typed:t,equalScalar:r}=e;return t(h_,{"number | BigNumber | Complex | Fraction":n=>r(n,0),bigint:n=>n===0n,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();y();v();var g_="isNaN",Coe=["typed"],v_=K(g_,Coe,e=>{var{typed:t}=e;return t(g_,{number:EA,BigNumber:function(n){return n.isNaN()},bigint:function(n){return!1},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();y();v();var y_="typeOf",Moe=["typed"],x_=K(y_,Moe,e=>{var{typed:t}=e;return t(y_,{any:gr})});g();y();v();g();y();v();function w_(e,t,r,n){return en(e.re,t.re,r,n)&&en(e.im,t.im,r,n)}g();y();v();var Ga=K("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(r,[n.valueType(),i.valueType()])(n.value,i.value)})}});var Xx="equalScalar",Toe=["typed","config"],b_=K(Xx,Toe,e=>{var{typed:t,config:r}=e,n=Ga({typed:t});return t(Xx,{"boolean, boolean":function(o,u){return o===u},"number, number":function(o,u){return en(o,u,r.relTol,r.absTol)},"BigNumber, BigNumber":function(o,u){return o.eq(u)||xn(o,u,r.relTol,r.absTol)},"bigint, bigint":function(o,u){return o===u},"Fraction, Fraction":function(o,u){return o.equals(u)},"Complex, Complex":function(o,u){return w_(o,u,r.relTol,r.absTol)}},n)}),eke=K(Xx,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Xx,{"number, number":function(i,o){return en(i,o,r.relTol,r.absTol)}})});g();y();v();var Ooe="SparseMatrix",Ioe=["typed","equalScalar","Matrix"],D_=K(Ooe,Ioe,e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(w,A){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(A&&!gn(A))throw new Error("Invalid datatype: "+A);if(Et(w))o(this,w,A);else if(w&&pr(w.index)&&pr(w.ptr)&&pr(w.size))this._values=w.values,this._index=w.index,this._ptr=w.ptr,this._size=w.size,this._datatype=A||w.datatype;else if(pr(w))u(this,w,A);else{if(w)throw new TypeError("Unsupported type of data ("+gr(w)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=A}}function o(w,A,E){A.type==="SparseMatrix"?(w._values=A._values?Lt(A._values):void 0,w._index=Lt(A._index),w._ptr=Lt(A._ptr),w._size=Lt(A._size),w._datatype=E||A._datatype):u(w,A.valueOf(),E||A._datatype)}function u(w,A,E){w._values=[],w._index=[],w._ptr=[],w._datatype=E;var O=A.length,M=0,I=r,F=0;if(gn(E)&&(I=t.find(r,[E,E])||r,F=t.convert(0,E)),O>0){var C=0;do{w._ptr.push(w._index.length);for(var P=0;P");if(M.length===1){var R=A.dimension(0);R.forEach(function(H,V){Lr(H),w.set([H,0],E[V[0]],O)})}else{var q=A.dimension(0),U=A.dimension(1);q.forEach(function(H,V){Lr(H),U.forEach(function(W,ee){Lr(W),w.set([H,W],E[V[0]][ee[0]],O)})})}}return w}i.prototype.get=function(w){if(!pr(w))throw new TypeError("Array expected");if(w.length!==this._size.length)throw new Jt(w.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var A=w[0],E=w[1];Lr(A,this._size[0]),Lr(E,this._size[1]);var O=s(A,this._ptr[E],this._ptr[E+1],this._index);return OI-1||M>F-1)&&(h(this,Math.max(O+1,I),Math.max(M+1,F),E),I=this._size[0],F=this._size[1]),Lr(O,I),Lr(M,F);var R=s(O,this._ptr[M],this._ptr[M+1],this._index);return RArray.isArray(I)&&I.length===1?I[0]:I);if(O.length!==2)throw new Error("Only two dimensions matrix are supported");O.forEach(function(I){if(!$t(I)||!Nt(I)||I<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Kt(O)+")")});var M=E?this.clone():this;return h(M,O[0],O[1],A)};function h(w,A,E,O){var M=O||0,I=r,F=0;gn(w._datatype)&&(I=t.find(r,[w._datatype,w._datatype])||r,F=t.convert(0,w._datatype),M=t.convert(M,w._datatype));var C=!I(M,F),P=w._size[0],R=w._size[1],q,U,H;if(E>R){for(U=R;UP){if(C){var V=0;for(U=0;UA-1&&(w._values.splice(H,1),w._index.splice(H,1),ee++)}w._ptr[U]=w._values.length}return w._size[0]=A,w._size[1]=E,w}i.prototype.reshape=function(w,A){if(!pr(w))throw new TypeError("Array expected");if(w.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");w.forEach(function(re){if(!$t(re)||!Nt(re)||re<=-2||re===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Kt(w)+")")});var E=this._size[0]*this._size[1];w=Sv(w,E);var O=w[0]*w[1];if(E!==O)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var M=A?this.clone():this;if(this._size[0]===w[0]&&this._size[1]===w[1])return M;for(var I=[],F=0;F=A&&Y<=E&&H(w._values[ie],Y-A,V-O)}else{for(var Z={},le=W;le "+(this._values?Kt(this._values[P],w):"X")}return M},i.prototype.toString=function(){return Kt(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(w){if(w){if(kt(w)&&(w=w.toNumber()),!$t(w)||!Nt(w))throw new TypeError("The parameter k must be an integer number")}else w=0;var A=w>0?w:0,E=w<0?-w:0,O=this._size[0],M=this._size[1],I=Math.min(O-E,M-A),F=[],C=[],P=[];P[0]=0;for(var R=A;R0?E:0,P=E<0?-E:0,R=w[0],q=w[1],U=Math.min(R-P,q-C),H;if(pr(A)){if(A.length!==U)throw new Error("Invalid value array length");H=function(he){return A[he]}}else if(Et(A)){var V=A.size();if(V.length!==1||V[0]!==U)throw new Error("Invalid matrix length");H=function(he){return A.get([he])}}else H=function(){return A};for(var W=[],ee=[],ie=[],Y=0;Y=0&&Z=P||M[q]!==A)){var H=O?O[R]:void 0;M.splice(q,0,A),O&&O.splice(q,0,H),M.splice(q<=R?R+1:R,1),O&&O.splice(q<=R?R+1:R,1);continue}if(q=P||M[R]!==w)){var V=O?O[q]:void 0;M.splice(R,0,w),O&&O.splice(R,0,V),M.splice(R<=q?q+1:q,1),O&&O.splice(R<=q?q+1:q,1)}}},i},{isClass:!0});g();y();v();var Foe="number",_oe=["typed"];function koe(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var r={"0b":2,"0o":8,"0x":16}[t[1]],n=t[2],i=t[3];return{input:e,radix:r,integerPart:n,fractionalPart:i}}else return null}function Boe(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n{var{typed:t}=e,r=t("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var o=koe(i);if(o)return Boe(o);var u=0,l=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);l&&(u=Number(l[2]),i=l[1]);var a=Number(i);if(isNaN(a))throw new SyntaxError('String "'+i+'" is not a valid number');if(l){if(a>2**u-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));a>=2**(u-1)&&(a=a-2**u)}return a},BigNumber:function(i){return i.toNumber()},bigint:function(i){return Number(i)},Fraction:function(i){return i.valueOf()},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),null:function(i){return 0},"Unit, string | Unit":function(i,o){return i.toNumber(o)},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r});g();y();v();var Loe="bigint",Poe=["typed"],E_=K(Loe,Poe,e=>{var{typed:t}=e,r=t("bigint",{"":function(){return 0n},bigint:function(i){return i},number:function(i){return BigInt(i.toFixed())},BigNumber:function(i){return BigInt(i.round().toString())},Fraction:function(i){return BigInt(i.valueOf().toFixed())},"string | boolean":function(i){return BigInt(i)},null:function(i){return 0n},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))});return r.fromJSON=function(n){return BigInt(n.value)},r});g();y();v();var S_="string",Roe=["typed"],A_=K(S_,Roe,e=>{var{typed:t}=e;return t(S_,{"":function(){return""},number:ks,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r)),any:function(n){return String(n)}})});g();y();v();var C_="boolean",qoe=["typed"],M_=K(C_,qoe,e=>{var{typed:t}=e;return t(C_,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var i=n.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;var o=Number(n);if(n!==""&&!isNaN(o))return!!o;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();y();v();var zoe="bignumber",Uoe=["typed","BigNumber"],T_=K(zoe,Uoe,e=>{var{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(i){return new r(i+"")},string:function(i){var o=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(o){var u=o[2],l=r(o[1]),a=new r(2).pow(Number(u));if(l.gt(a.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var s=new r(2).pow(Number(u)-1);return l.gte(s)?l.sub(a):l}return new r(i)},BigNumber:function(i){return i},bigint:function(i){return new r(i.toString())},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),Fraction:function(i){return new r(i.n).div(i.d).times(i.s)},null:function(i){return new r(0)},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();y();v();var Hoe="complex",$oe=["typed","Complex"],O_=K(Hoe,$oe,e=>{var{typed:t,Complex:r}=e;return t("complex",{"":function(){return r.ZERO},number:function(i){return new r(i,0)},"number, number":function(i,o){return new r(i,o)},"BigNumber, BigNumber":function(i,o){return new r(i.toNumber(),o.toNumber())},Fraction:function(i){return new r(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return r(i)},null:function(i){return r(0)},Object:function(i){if("re"in i&&"im"in i)return new r(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new r(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();y();v();var Woe="fraction",Voe=["typed","Fraction"],I_=K(Woe,Voe,e=>{var{typed:t,Fraction:r}=e;return t("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new r(i)},string:function(i){return new r(i)},"number, number":function(i,o){return new r(i,o)},null:function(i){return new r(0)},BigNumber:function(i){return new r(i.toString())},bigint:function(i){return new r(i.toString())},Fraction:function(i){return i},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),Object:function(i){return new r(i)},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();y();v();var F_="matrix",Goe=["typed","Matrix","DenseMatrix","SparseMatrix"],__=K(F_,Goe,e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(F_,{"":function(){return o([])},string:function(l){return o([],l)},"string, string":function(l,a){return o([],l,a)},Array:function(l){return o(l)},Matrix:function(l){return o(l,l.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(u,l,a){if(l==="dense"||l==="default"||l===void 0)return new n(u,a);if(l==="sparse")return new i(u,a);throw new TypeError("Unknown matrix type "+JSON.stringify(l)+".")}});g();y();v();var k_="matrixFromFunction",Yoe=["typed","matrix","isZero"],B_=K(k_,Yoe,e=>{var{typed:t,matrix:r,isZero:n}=e;return t(k_,{"Array | Matrix, function, string, string":function(u,l,a,s){return i(u,l,a,s)},"Array | Matrix, function, string":function(u,l,a){return i(u,l,a)},"Matrix, function":function(u,l){return i(u,l,"dense")},"Array, function":function(u,l){return i(u,l,"dense").toArray()},"Array | Matrix, string, function":function(u,l,a){return i(u,a,l)},"Array | Matrix, string, string, function":function(u,l,a,s){return i(u,s,l,a)}});function i(o,u,l,a){var s;return a!==void 0?s=r(l,a):s=r(l),s.resize(o),s.forEach(function(f,p){var h=u(p);n(h)||s.set(p,h)}),s}});g();y();v();var L_="matrixFromRows",Zoe=["typed","matrix","flatten","size"],P_=K(L_,Zoe,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(L_,{"...Array":function(a){return o(a)},"...Matrix":function(a){return r(o(a.map(s=>s.toArray())))}});function o(l){if(l.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var a=u(l[0]),s=[];for(var f of l){var p=u(f);if(p!==a)throw new TypeError("The vectors had different length: "+(a|0)+" \u2260 "+(p|0));s.push(n(f))}return s}function u(l){var a=i(l);if(a.length===1)return a[0];if(a.length===2){if(a[0]===1)return a[1];if(a[1]===1)return a[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}});g();y();v();var R_="matrixFromColumns",Xoe=["typed","matrix","flatten","size"],q_=K(R_,Xoe,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(R_,{"...Array":function(a){return o(a)},"...Matrix":function(a){return r(o(a.map(s=>s.toArray())))}});function o(l){if(l.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var a=u(l[0]),s=[],f=0;f{var{typed:t}=e;return t(z_,{"Unit, Array":function(n,i){return n.splitUnit(i)}})});g();y();v();var H_="unaryMinus",Joe=["typed"],$_=K(H_,Joe,e=>{var{typed:t}=e;return t(H_,{number:LS,"Complex | BigNumber | Fraction":r=>r.neg(),bigint:r=>-r,Unit:t.referToSelf(r=>n=>{var i=n.clone();return i.value=t.find(r,i.valueType())(n.value),i}),"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r,!0))})});g();y();v();var W_="unaryPlus",Qoe=["typed","config","numeric"],V_=K(W_,Qoe,e=>{var{typed:t,config:r,numeric:n}=e;return t(W_,{number:PS,Complex:function(o){return o},BigNumber:function(o){return o},bigint:function(o){return o},Fraction:function(o){return o},Unit:function(o){return o.clone()},"Array | Matrix":t.referToSelf(i=>o=>Ct(o,i,!0)),boolean:function(o){return n(o?1:0,r.number)},string:function(o){return n(o,co(o,r))}})});g();y();v();var G_="abs",joe=["typed"],Y_=K(G_,joe,e=>{var{typed:t}=e;return t(G_,{number:FS,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),bigint:r=>r<0n?-r:r,"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r,!0))})});g();y();v();var Z_="apply",eae=["typed","isInteger"],Nh=K(Z_,eae,e=>{var{typed:t,isInteger:r}=e;return t(Z_,{"Array | Matrix, number | BigNumber, function":function(i,o,u){if(!r(o))throw new TypeError("Integer number expected for dimension");var l=Array.isArray(i)?Wt(i):i.size();if(o<0||o>=l.length)throw new Mi(o,l.length);return Et(i)?i.create(Kx(i.valueOf(),o,u)):Kx(i,o,u)}})});function Kx(e,t,r){var n,i,o;if(t<=0)if(Array.isArray(e[0])){for(o=tae(e),i=[],n=0;n{var{typed:t}=e;return t(X_,{"number, number":_S,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"bigint, bigint":function(n,i){return n+i},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(r,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})});g();y();v();var J_="subtractScalar",nae=["typed"],Q_=K(J_,nae,e=>{var{typed:t}=e;return t(J_,{"number, number":kS,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"bigint, bigint":function(n,i){return n-i},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(r,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})});g();y();v();var j_="cbrt",iae=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],ek=K(j_,iae,e=>{var{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:o,Complex:u,BigNumber:l,Fraction:a}=e;return r(j_,{number:wh,Complex:s,"Complex, boolean":s,BigNumber:function(h){return h.cbrt()},Unit:f});function s(p,h){var x=p.arg()/3,b=p.abs(),w=new u(wh(b),0).mul(new u(0,x).exp());if(h){var A=[w,new u(wh(b),0).mul(new u(0,x+Math.PI*2/3).exp()),new u(wh(b),0).mul(new u(0,x-Math.PI*2/3).exp())];return t.matrix==="Array"?A:o(A)}else return w}function f(p){if(p.value&&Ni(p.value)){var h=p.clone();return h.value=1,h=h.pow(1/3),h.value=s(p.value),h}else{var x=n(p.value);x&&(p.value=i(p.value));var b;kt(p.value)?b=new l(1).div(3):da(p.value)?b=new a(1,3):b=1/3;var w=p.pow(b);return x&&(w.value=i(w.value)),w}}});g();y();v();g();y();v();var oae="matAlgo11xS0s",aae=["typed","equalScalar"],Pr=K(oae,aae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u,l){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var x=p[0],b=p[1],w,A=r,E=0,O=u;typeof h=="string"&&(w=h,A=t.find(r,[w,w]),E=t.convert(0,w),o=t.convert(o,w),O=t.find(u,[w,w]));for(var M=[],I=[],F=[],C=0;C{var{typed:t,DenseMatrix:r}=e;return function(i,o,u,l){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var x=p[0],b=p[1],w,A=u;typeof h=="string"&&(w=h,o=t.convert(o,w),A=t.find(u,[w,w]));for(var E=[],O=[],M=[],I=0;I{var{typed:t}=e;return function(i,o,u,l){var a=i._data,s=i._size,f=i._datatype,p,h=u;typeof f=="string"&&(p=f,o=t.convert(o,p),h=t.find(u,[p,p]));var x=s.length>0?r(h,0,s,s[0],a,o,l):[];return i.createDenseMatrix({data:x,size:Lt(s),datatype:p})};function r(n,i,o,u,l,a,s){var f=[];if(i===o.length-1)for(var p=0;p{var{typed:t,config:r,round:n}=e;return t(SA,{number:function(o){return en(o,n(o),r.relTol,r.absTol)?n(o):Math.ceil(o)},"number, number":function(o,u){if(en(o,n(o,u),r.relTol,r.absTol))return n(o,u);var[l,a]="".concat(o,"e").split("e"),s=Math.ceil(Number("".concat(l,"e").concat(Number(a)+u)));return[l,a]="".concat(s,"e").split("e"),Number("".concat(l,"e").concat(Number(a)-u))}})}),tk=K(SA,cae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}=e,a=Pr({typed:t,equalScalar:o}),s=Cr({typed:t,DenseMatrix:l}),f=Qn({typed:t}),p=pae({typed:t,config:r,round:n});return t("ceil",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(x){return x.ceil()},"Complex, number":function(x,b){return x.ceil(b)},"Complex, BigNumber":function(x,b){return x.ceil(b.toNumber())},BigNumber:function(x){return xn(x,n(x),r.relTol,r.absTol)?n(x):x.ceil()},"BigNumber, BigNumber":function(x,b){return xn(x,n(x,b),r.relTol,r.absTol)?n(x,b):x.toDecimalPlaces(b.toNumber(),mp.ROUND_CEIL)},Fraction:function(x){return x.ceil()},"Fraction, number":function(x,b){return x.ceil(b)},"Fraction, BigNumber":function(x,b){return x.ceil(b.toNumber())},"Array | Matrix":t.referToSelf(h=>x=>Ct(x,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(x,b)=>Ct(x,w=>h(w,b),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(x,b)=>a(x,b,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(x,b)=>f(x,b,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(x,b)=>f(i(b),x,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(x,b)=>o(x,0)?u(b.size(),b.storage()):b.storage()==="dense"?f(b,x,h,!0):s(b,x,h,!0))})});g();y();v();var rk="cube",mae=["typed"],nk=K(rk,mae,e=>{var{typed:t}=e;return t(rk,{number:RS,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},bigint:function(n){return n*n*n},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})});g();y();v();var ik="exp",hae=["typed"],ok=K(ik,hae,e=>{var{typed:t}=e;return t(ik,{number:qS,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});g();y();v();var ak="expm1",dae=["typed","Complex"],sk=K(ak,dae,e=>{var{typed:t,Complex:r}=e;return t(ak,{number:zS,Complex:function(i){var o=Math.exp(i.re);return new r(o*Math.cos(i.im)-1,o*Math.sin(i.im))},BigNumber:function(i){return i.exp().minus(1)}})});g();y();v();var AA="fix",gae=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],vae=K(AA,["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t(AA,{number:function(o){return o>0?n(o):r(o)},"number, number":function(o,u){return o>0?n(o,u):r(o,u)}})}),uk=K(AA,gae,e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:o,equalScalar:u,zeros:l,DenseMatrix:a}=e,s=Cr({typed:t,DenseMatrix:a}),f=Qn({typed:t}),p=vae({typed:t,ceil:i,floor:o});return t("fix",{number:p.signatures.number,"number, number | BigNumber":p.signatures["number,number"],Complex:function(x){return new r(x.re>0?Math.floor(x.re):Math.ceil(x.re),x.im>0?Math.floor(x.im):Math.ceil(x.im))},"Complex, number":function(x,b){return new r(x.re>0?o(x.re,b):i(x.re,b),x.im>0?o(x.im,b):i(x.im,b))},"Complex, BigNumber":function(x,b){var w=b.toNumber();return new r(x.re>0?o(x.re,w):i(x.re,w),x.im>0?o(x.im,w):i(x.im,w))},BigNumber:function(x){return x.isNegative()?i(x):o(x)},"BigNumber, number | BigNumber":function(x,b){return x.isNegative()?i(x,b):o(x,b)},Fraction:function(x){return x.s<0?x.ceil():x.floor()},"Fraction, number | BigNumber":function(x,b){return x.s<0?i(x,b):o(x,b)},"Array | Matrix":t.referToSelf(h=>x=>Ct(x,h,!0)),"Array | Matrix, number | BigNumber":t.referToSelf(h=>(x,b)=>Ct(x,w=>h(w,b),!0)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(x,b)=>f(n(b),x,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(x,b)=>u(x,0)?l(b.size(),b.storage()):b.storage()==="dense"?f(b,x,h,!0):s(b,x,h,!0))})});g();y();v();var CA="floor",yae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],xae=K(CA,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(CA,{number:function(o){return en(o,n(o),r.relTol,r.absTol)?n(o):Math.floor(o)},"number, number":function(o,u){if(en(o,n(o,u),r.relTol,r.absTol))return n(o,u);var[l,a]="".concat(o,"e").split("e"),s=Math.floor(Number("".concat(l,"e").concat(Number(a)+u)));return[l,a]="".concat(s,"e").split("e"),Number("".concat(l,"e").concat(Number(a)-u))}})}),Jx=K(CA,yae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}=e,a=Pr({typed:t,equalScalar:o}),s=Cr({typed:t,DenseMatrix:l}),f=Qn({typed:t}),p=xae({typed:t,config:r,round:n});return t("floor",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(x){return x.floor()},"Complex, number":function(x,b){return x.floor(b)},"Complex, BigNumber":function(x,b){return x.floor(b.toNumber())},BigNumber:function(x){return xn(x,n(x),r.relTol,r.absTol)?n(x):x.floor()},"BigNumber, BigNumber":function(x,b){return xn(x,n(x,b),r.relTol,r.absTol)?n(x,b):x.toDecimalPlaces(b.toNumber(),mp.ROUND_FLOOR)},Fraction:function(x){return x.floor()},"Fraction, number":function(x,b){return x.floor(b)},"Fraction, BigNumber":function(x,b){return x.floor(b.toNumber())},"Array | Matrix":t.referToSelf(h=>x=>Ct(x,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(x,b)=>Ct(x,w=>h(w,b),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(x,b)=>a(x,b,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(x,b)=>f(x,b,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(x,b)=>f(i(b),x,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(x,b)=>o(x,0)?u(b.size(),b.storage()):b.storage()==="dense"?f(b,x,h,!0):s(b,x,h,!0))})});g();y();v();g();y();v();g();y();v();var wae="matAlgo02xDS0",bae=["typed","equalScalar"],jn=K(wae,bae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u,l){var a=i._data,s=i._size,f=i._datatype||i.getDataType(),p=o._values,h=o._index,x=o._ptr,b=o._size,w=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(s.length!==b.length)throw new Jt(s.length,b.length);if(s[0]!==b[0]||s[1]!==b[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+b+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var A=s[0],E=s[1],O,M=r,I=0,F=u;typeof f=="string"&&f===w&&f!=="mixed"&&(O=f,M=t.find(r,[O,O]),I=t.convert(0,O),F=t.find(u,[O,O]));for(var C=[],P=[],R=[],q=0;q{var{typed:t}=e;return function(n,i,o,u){var l=n._data,a=n._size,s=n._datatype||n.getDataType(),f=i._values,p=i._index,h=i._ptr,x=i._size,b=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==x.length)throw new Jt(a.length,x.length);if(a[0]!==x[0]||a[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+x+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var w=a[0],A=a[1],E,O=0,M=o;typeof s=="string"&&s===b&&s!=="mixed"&&(E=s,O=t.convert(0,E),M=t.find(o,[E,E]));for(var I=[],F=0;F{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,x=o._index,b=o._ptr,w=o._size,A=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Jt(f.length,w.length);if(f[0]!==w[0]||f[1]!==w[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+w+")");var E=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===A&&p!=="mixed"&&(M=p,I=t.find(r,[M,M]),F=t.convert(0,M),C=t.find(u,[M,M]));var P=l&&h?[]:void 0,R=[],q=[],U=P?[]:void 0,H=P?[]:void 0,V=[],W=[],ee,ie,Y,Z;for(ie=0;ie{var{typed:t}=e;return function(i,o,u){var l=i._data,a=i._size,s=i._datatype,f=o._data,p=o._size,h=o._datatype,x=[];if(a.length!==p.length)throw new Jt(a.length,p.length);for(var b=0;b0?r(A,0,x,x[0],l,f):[];return i.createDenseMatrix({data:E,size:x,datatype:w})};function r(n,i,o,u,l,a){var s=[];if(i===o.length-1)for(var f=0;f{var{concat:t}=e;return function(i,o){var u=Math.max(i._size.length,o._size.length);if(i._size.length===o._size.length&&i._size.every((b,w)=>b===o._size[w]))return[i,o];for(var l=r(i._size,u,0),a=r(o._size,u,0),s=[],f=0;f{var{typed:t,matrix:r,concat:n}=e,i=lk({typed:t}),o=Qn({typed:t}),u=fk({concat:n});return function(a){var s=a.elop,f=a.SD||a.DS,p;s?(p={"DenseMatrix, DenseMatrix":(w,A)=>i(...u(w,A),s),"Array, Array":(w,A)=>i(...u(r(w),r(A)),s).valueOf(),"Array, DenseMatrix":(w,A)=>i(...u(r(w),A),s),"DenseMatrix, Array":(w,A)=>i(...u(w,r(A)),s)},a.SS&&(p["SparseMatrix, SparseMatrix"]=(w,A)=>a.SS(...u(w,A),s,!1)),a.DS&&(p["DenseMatrix, SparseMatrix"]=(w,A)=>a.DS(...u(w,A),s,!1),p["Array, SparseMatrix"]=(w,A)=>a.DS(...u(r(w),A),s,!1)),f&&(p["SparseMatrix, DenseMatrix"]=(w,A)=>f(...u(A,w),s,!0),p["SparseMatrix, Array"]=(w,A)=>f(...u(r(A),w),s,!0))):(p={"DenseMatrix, DenseMatrix":t.referToSelf(w=>(A,E)=>i(...u(A,E),w)),"Array, Array":t.referToSelf(w=>(A,E)=>i(...u(r(A),r(E)),w).valueOf()),"Array, DenseMatrix":t.referToSelf(w=>(A,E)=>i(...u(r(A),E),w)),"DenseMatrix, Array":t.referToSelf(w=>(A,E)=>i(...u(A,r(E)),w))},a.SS&&(p["SparseMatrix, SparseMatrix"]=t.referToSelf(w=>(A,E)=>a.SS(...u(A,E),w,!1))),a.DS&&(p["DenseMatrix, SparseMatrix"]=t.referToSelf(w=>(A,E)=>a.DS(...u(A,E),w,!1)),p["Array, SparseMatrix"]=t.referToSelf(w=>(A,E)=>a.DS(...u(r(A),E),w,!1))),f&&(p["SparseMatrix, DenseMatrix"]=t.referToSelf(w=>(A,E)=>f(...u(E,A),w,!0)),p["SparseMatrix, Array"]=t.referToSelf(w=>(A,E)=>f(...u(r(E),A),w,!0))));var h=a.scalar||"any",x=a.Ds||a.Ss;x&&(s?(p["DenseMatrix,"+h]=(w,A)=>o(w,A,s,!1),p[h+", DenseMatrix"]=(w,A)=>o(A,w,s,!0),p["Array,"+h]=(w,A)=>o(r(w),A,s,!1).valueOf(),p[h+", Array"]=(w,A)=>o(r(A),w,s,!0).valueOf()):(p["DenseMatrix,"+h]=t.referToSelf(w=>(A,E)=>o(A,E,w,!1)),p[h+", DenseMatrix"]=t.referToSelf(w=>(A,E)=>o(E,A,w,!0)),p["Array,"+h]=t.referToSelf(w=>(A,E)=>o(r(A),E,w,!1).valueOf()),p[h+", Array"]=t.referToSelf(w=>(A,E)=>o(r(E),A,w,!0).valueOf())));var b=a.sS!==void 0?a.sS:a.Ss;return s?(a.Ss&&(p["SparseMatrix,"+h]=(w,A)=>a.Ss(w,A,s,!1)),b&&(p[h+", SparseMatrix"]=(w,A)=>b(A,w,s,!0))):(a.Ss&&(p["SparseMatrix,"+h]=t.referToSelf(w=>(A,E)=>a.Ss(A,E,w,!1))),b&&(p[h+", SparseMatrix"]=t.referToSelf(w=>(A,E)=>b(E,A,w,!0)))),s&&s.signatures&&bx(p,s.signatures),p}});var ck="mod",Fae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],Qx=K(ck,Fae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l,concat:a}=e,s=Jx({typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}),f=jn({typed:t,equalScalar:o}),p=Kr({typed:t}),h=Bf({typed:t,equalScalar:o}),x=Pr({typed:t,equalScalar:o}),b=Cr({typed:t,DenseMatrix:l}),w=tr({typed:t,matrix:i,concat:a});return t(ck,{"number, number":A,"BigNumber, BigNumber":function(O,M){return M.isZero()?O:O.sub(M.mul(s(O.div(M))))},"bigint, bigint":function(O,M){if(M===0n)return O;if(O<0){var I=O%M;return I===0n?I:I+M}return O%M},"Fraction, Fraction":function(O,M){return M.equals(0)?O:O.sub(M.mul(s(O.div(M))))}},w({SS:h,DS:p,SD:f,Ss:x,sS:b}));function A(E,O){return O===0?E:E-O*s(E/O)}});g();y();v();var _ae="matAlgo01xDSid",kae=["typed"],ho=K(_ae,kae,e=>{var{typed:t}=e;return function(n,i,o,u){var l=n._data,a=n._size,s=n._datatype||n.getDataType(),f=i._values,p=i._index,h=i._ptr,x=i._size,b=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==x.length)throw new Jt(a.length,x.length);if(a[0]!==x[0]||a[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+x+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var w=a[0],A=a[1],E=typeof s=="string"&&s!=="mixed"&&s===b?s:void 0,O=E?t.find(o,[E,E]):o,M,I,F=[];for(M=0;M{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,x=o._index,b=o._ptr,w=o._size,A=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Jt(f.length,w.length);if(f[0]!==w[0]||f[1]!==w[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+w+")");var E=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===A&&p!=="mixed"&&(M=p,I=t.find(r,[M,M]),F=t.convert(0,M),C=t.find(u,[M,M]));var P=l&&h?[]:void 0,R=[],q=[],U=l&&h?[]:void 0,H=l&&h?[]:void 0,V=[],W=[],ee,ie,Y,Z,le;for(ie=0;ie{var{typed:t,DenseMatrix:r}=e;return function(i,o,u,l){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var x=p[0],b=p[1],w,A=u;typeof h=="string"&&(w=h,o=t.convert(o,w),A=t.find(u,[w,w]));for(var E=[],O=[],M=[],I=0;IArray.isArray(t))}var hk=K(pk,qae,e=>{var{typed:t,matrix:r,config:n,round:i,equalScalar:o,zeros:u,BigNumber:l,DenseMatrix:a,concat:s}=e,f=Qx({typed:t,config:n,round:i,matrix:r,equalScalar:o,zeros:u,DenseMatrix:a,concat:s}),p=ho({typed:t}),h=Eh({typed:t,equalScalar:o}),x=Xo({typed:t,DenseMatrix:a}),b=tr({typed:t,matrix:r,concat:s});return t(pk,{"number, number":w,"BigNumber, BigNumber":A,"Fraction, Fraction":(E,O)=>E.gcd(O)},b({SS:h,DS:p,Ss:x}),{[zae]:t.referToSelf(E=>(O,M,I)=>{for(var F=E(O,M),C=0;CO=>{if(O.length===1&&Array.isArray(O[0])&&mk(O[0]))return E(...O[0]);if(mk(O))return E(...O);throw new xa("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(E=>O=>E(O.toArray()))});function w(E,O){if(!Nt(E)||!Nt(O))throw new Error("Parameters in function gcd must be integer numbers");for(var M;O!==0;)M=f(E,O),E=O,O=M;return E<0?-E:E}function A(E,O){if(!E.isInt()||!O.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var M=new l(0);!O.isZero();){var I=f(E,O);E=O,O=I}return E.lt(M)?E.neg():E}});g();y();v();g();y();v();var Uae="matAlgo06xS0S0",Hae=["typed","equalScalar"],Lf=K(Uae,Hae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,a=i._size,s=i._datatype||i._data===void 0?i._datatype:i.getDataType(),f=o._values,p=o._size,h=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(a.length!==p.length)throw new Jt(a.length,p.length);if(a[0]!==p[0]||a[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+p+")");var x=a[0],b=a[1],w,A=r,E=0,O=u;typeof s=="string"&&s===h&&s!=="mixed"&&(w=s,A=t.find(r,[w,w]),E=t.convert(0,w),O=t.find(u,[w,w]));for(var M=l&&f?[]:void 0,I=[],F=[],C=M?[]:void 0,P=[],R=[],q=0;q{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,o=jn({typed:t,equalScalar:n}),u=Lf({typed:t,equalScalar:n}),l=Pr({typed:t,equalScalar:n}),a=tr({typed:t,matrix:r,concat:i}),s="number | BigNumber | Fraction | Matrix | Array",f={};return f["".concat(s,", ").concat(s,", ...").concat(s)]=t.referToSelf(h=>(x,b,w)=>{for(var A=h(x,b),E=0;Eh.lcm(x)},a({SS:u,DS:o,Ss:l}),f);function p(h,x){if(!h.isInt()||!x.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(h.isZero())return h;if(x.isZero())return x;for(var b=h.times(x);!x.isZero();){var w=x;x=h.mod(w),h=w}return b.div(h).abs()}});g();y();v();var vk="log10",Wae=["typed","config","Complex"],yk=K(vk,Wae,e=>{var{typed:t,config:r,Complex:n}=e;return t(vk,{number:function(o){return o>=0||r.predictable?HS(o):new n(o,0).log().div(Math.LN10)},Complex:function(o){return new n(o).log().div(Math.LN10)},BigNumber:function(o){return!o.isNegative()||r.predictable?o.log():new n(o.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf(i=>o=>Ct(o,i))})});g();y();v();var xk="log2",Vae=["typed","config","Complex"],wk=K(xk,Vae,e=>{var{typed:t,config:r,Complex:n}=e;return t(xk,{number:function(u){return u>=0||r.predictable?$S(u):i(new n(u,0))},Complex:i,BigNumber:function(u){return!u.isNegative()||r.predictable?u.log(2):i(new n(u.toNumber(),0))},"Array | Matrix":t.referToSelf(o=>u=>Ct(u,o))});function i(o){var u=Math.sqrt(o.re*o.re+o.im*o.im);return new n(Math.log2?Math.log2(u):Math.log(u)/Math.LN2,Math.atan2(o.im,o.re)/Math.LN2)}});g();y();v();var Gae="multiplyScalar",Yae=["typed"],bk=K(Gae,Yae,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":BS,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"bigint, bigint":function(n,i){return n*i},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})});g();y();v();var Dk="multiply",Zae=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],Nk=K(Dk,Zae,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:o,dot:u}=e,l=Pr({typed:t,equalScalar:o}),a=Qn({typed:t});function s(F,C){switch(F.length){case 1:switch(C.length){case 1:if(F[0]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(F[0]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+F[0]+") must match Matrix rows ("+C[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+C.length+" dimensions)")}break;case 2:switch(C.length){case 1:if(F[1]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+F[1]+") must match Vector length ("+C[0]+")");break;case 2:if(F[1]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+F[1]+") must match Matrix B rows ("+C[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+C.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+F.length+" dimensions)")}}function f(F,C,P){if(P===0)throw new Error("Cannot multiply two empty vectors");return u(F,C)}function p(F,C){if(C.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return h(F,C)}function h(F,C){var P=F._data,R=F._size,q=F._datatype||F.getDataType(),U=C._data,H=C._size,V=C._datatype||C.getDataType(),W=R[0],ee=H[1],ie,Y=n,Z=i;q&&V&&q===V&&typeof q=="string"&&q!=="mixed"&&(ie=q,Y=t.find(n,[ie,ie]),Z=t.find(i,[ie,ie]));for(var le=[],re=0;reOe)for(var Se=0,ze=0;ze(C,P)=>{s(Wt(C),Wt(P));var R=F(r(C),r(P));return Et(R)?R.valueOf():R}),"Matrix, Matrix":function(C,P){var R=C.size(),q=P.size();return s(R,q),R.length===1?q.length===1?f(C,P,R[0]):p(C,P):q.length===1?x(C,P):b(C,P)},"Matrix, Array":t.referTo("Matrix,Matrix",F=>(C,P)=>F(C,r(P))),"Array, Matrix":t.referToSelf(F=>(C,P)=>F(r(C,P.storage()),P)),"SparseMatrix, any":function(C,P){return l(C,P,i,!1)},"DenseMatrix, any":function(C,P){return a(C,P,i,!1)},"any, SparseMatrix":function(C,P){return l(P,C,i,!0)},"any, DenseMatrix":function(C,P){return a(P,C,i,!0)},"Array, any":function(C,P){return a(r(C),P,i,!1).valueOf()},"any, Array":function(C,P){return a(r(P),C,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(F=>(C,P,R)=>{for(var q=F(C,P),U=0;U{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:o}=e,u=ho({typed:t}),l=jn({typed:t,equalScalar:n}),a=Lf({typed:t,equalScalar:n}),s=Pr({typed:t,equalScalar:n}),f=tr({typed:t,matrix:r,concat:o});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(Ek,{number:WS,"number, number":WS,BigNumber:x=>h(x,new i(2)),"BigNumber, BigNumber":h,Complex:p,"Complex, number":p,Array:t.referTo("DenseMatrix,number",x=>b=>x(r(b),2).valueOf()),DenseMatrix:t.referTo("DenseMatrix,number",x=>b=>x(b,2)),SparseMatrix:t.referTo("SparseMatrix,number",x=>b=>x(b,2)),"SparseMatrix, SparseMatrix":t.referToSelf(x=>(b,w)=>{if(w.density()===1)return a(b,w,x);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(x=>(b,w)=>{if(w.density()===1)return u(b,w,x,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",x=>(b,w)=>x(r(b),w)),"number | BigNumber, SparseMatrix":t.referToSelf(x=>(b,w)=>{if(w.density()===1)return s(w,b,x,!0);throw new Error("Root must be non-zero")})},f({scalar:"number | BigNumber",SD:l,Ss:s,sS:!1}));function h(x,b){var w=i.precision,A=i.clone({precision:w+2}),E=new i(0),O=new A(1),M=b.isNegative();if(M&&(b=b.neg()),b.isZero())throw new Error("Root must be non-zero");if(x.isNegative()&&!b.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(x.isZero())return M?new A(1/0):0;if(!x.isFinite())return M?E:x;var I=x.abs().pow(O.div(b));return I=x.isNeg()?I.neg():I,new i((M?O.div(I):I).toPrecision(w))}});g();y();v();var Ak="sign",Kae=["typed","BigNumber","Fraction","complex"],Ck=K(Ak,Kae,e=>{var{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(Ak,{number:Vx,Complex:function(u){return u.im===0?n(Vx(u.re)):u.sign()},BigNumber:function(u){return new r(u.cmp(0))},bigint:function(u){return u>0n?1n:u<0n?-1n:0n},Fraction:function(u){return new i(u.s,1)},"Array | Matrix":t.referToSelf(o=>u=>Ct(u,o,!0)),Unit:t.referToSelf(o=>u=>{if(!u._isDerived()&&u.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(o,u.valueType())(u.value)})})});g();y();v();var Jae="sqrt",Qae=["config","typed","Complex"],Mk=K(Jae,Qae,e=>{var{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(u){return u.sqrt()},BigNumber:function(u){return!u.isNegative()||t.predictable?u.sqrt():i(u.toNumber())},Unit:function(u){return u.pow(.5)}});function i(o){return isNaN(o)?NaN:o>=0||t.predictable?Math.sqrt(o):new n(o,0).sqrt()}});g();y();v();var Tk="square",jae=["typed"],Ok=K(Tk,jae,e=>{var{typed:t}=e;return t(Tk,{number:VS,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},bigint:function(n){return n*n},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})});g();y();v();var Ik="subtract",ese=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Fk=K(Ik,ese,e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:o,DenseMatrix:u,concat:l}=e,a=ho({typed:t}),s=Kr({typed:t}),f=Bf({typed:t,equalScalar:n}),p=Xo({typed:t,DenseMatrix:u}),h=Cr({typed:t,DenseMatrix:u}),x=tr({typed:t,matrix:r,concat:l});return t(Ik,{"any, any":i},x({elop:i,SS:f,DS:a,SD:s,Ss:h,sS:p}))});g();y();v();var _k="xgcd",tse=["typed","config","matrix","BigNumber"],kk=K(_k,tse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(_k,{"number, number":function(l,a){var s=GS(l,a);return r.matrix==="Array"?s:n(s)},"BigNumber, BigNumber":o});function o(u,l){var a,s,f,p=new i(0),h=new i(1),x=p,b=h,w=h,A=p;if(!u.isInt()||!l.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!l.isZero();)s=u.div(l).floor(),f=u.mod(l),a=x,x=b.minus(s.times(x)),b=a,a=w,w=A.minus(s.times(w)),A=a,u=l,l=f;var E;return u.lt(p)?E=[u.neg(),b.neg(),A.neg()]:E=[u,u.isZero()?0:b,A],r.matrix==="Array"?E:n(E)}});g();y();v();var Bk="invmod",rse=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Lk=K(Bk,rse,e=>{var{typed:t,config:r,BigNumber:n,xgcd:i,equal:o,smaller:u,mod:l,add:a,isInteger:s}=e;return t(Bk,{"number, number":f,"BigNumber, BigNumber":f});function f(p,h){if(!s(p)||!s(h))throw new Error("Parameters in function invmod must be integer numbers");if(p=l(p,h),o(h,0))throw new Error("Divisor must be non zero");var x=i(p,h);x=x.valueOf();var[b,w]=x;return o(b,n(1))?(w=l(w,h),u(w,n(0))&&(w=a(w,h)),w):NaN}});g();y();v();g();y();v();var nse="matAlgo09xS0Sf",ise=["typed","equalScalar"],jx=K(nse,ise,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,x=o._index,b=o._ptr,w=o._size,A=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Jt(f.length,w.length);if(f[0]!==w[0]||f[1]!==w[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+w+")");var E=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===A&&p!=="mixed"&&(M=p,I=t.find(r,[M,M]),F=t.convert(0,M),C=t.find(u,[M,M]));var P=l&&h?[]:void 0,R=[],q=[],U=P?[]:void 0,H=[],V,W,ee,ie,Y;for(W=0;W{var{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:o}=e,u=jn({typed:t,equalScalar:n}),l=jx({typed:t,equalScalar:n}),a=Pr({typed:t,equalScalar:n}),s=tr({typed:t,matrix:r,concat:o});return t(Pk,s({elop:i,SS:l,DS:u,Ss:a}))});g();y();v();g();y();v();function qk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var 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 TA(e,t,function(n,i){return n&i})}function Sh(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function zk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var 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()?!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:TA(e,t,function(i,o){return i|o})}function TA(e,t,r){var n=e.constructor,i,o,u=+(e.s<0),l=+(t.s<0);if(u){i=ew(Sh(e));for(var a=0;a0;)r(f[--x],p[--b])===w&&(A=A.plus(E)),E=E.times(O);for(;b>0;)r(h,p[--b])===w&&(A=A.plus(E)),E=E.times(O);return n.config({precision:M}),w===0&&(A.s=-A.s),A}function ew(e){for(var t=e.d,r=t[0]+"",n=1;n0)if(++l>s)for(l-=s;l--;)a+="0";else l1&&((f[x+1]===null||f[x+1]===void 0)&&(f[x+1]=0),f[x+1]+=f[x]>>1,f[x]&=1)}return f.reverse()}function Uk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var 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)?Sh(t):t.eq(n)?Sh(e):!e.isFinite()||!t.isFinite()?!e.isFinite()&&!t.isFinite()?n:new r(e.isNegative()===t.isNegative()?1/0:-1/0):TA(e,t,function(i,o){return i^o})}function Hk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:!e.isFinite()&&!t.isFinite()?new r(NaN):t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t))}function $k(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var 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())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}var Wk="bitAnd",ase=["typed","matrix","equalScalar","concat"],tw=K(Wk,ase,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,o=jn({typed:t,equalScalar:n}),u=Lf({typed:t,equalScalar:n}),l=Pr({typed:t,equalScalar:n}),a=tr({typed:t,matrix:r,concat:i});return t(Wk,{"number, number":ZS,"BigNumber, BigNumber":qk,"bigint, bigint":(s,f)=>s&f},a({SS:u,DS:o,Ss:l}))});g();y();v();var Vk="bitNot",sse=["typed"],Gk=K(Vk,sse,e=>{var{typed:t}=e;return t(Vk,{number:XS,BigNumber:Sh,bigint:r=>~r,"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();y();v();var Yk="bitOr",use=["typed","matrix","equalScalar","DenseMatrix","concat"],rw=K(Yk,use,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=ho({typed:t}),l=Eh({typed:t,equalScalar:n}),a=Xo({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:r,concat:o});return t(Yk,{"number, number":KS,"BigNumber, BigNumber":zk,"bigint, bigint":(f,p)=>f|p},s({SS:l,DS:u,Ss:a}))});g();y();v();g();y();v();var lse="matAlgo07xSSf",fse=["typed","DenseMatrix"],gi=K(lse,fse,e=>{var{typed:t,DenseMatrix:r}=e;return function(o,u,l){var a=o._size,s=o._datatype||o._data===void 0?o._datatype:o.getDataType(),f=u._size,p=u._datatype||u._data===void 0?u._datatype:u.getDataType();if(a.length!==f.length)throw new Jt(a.length,f.length);if(a[0]!==f[0]||a[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+f+")");var h=a[0],x=a[1],b,w=0,A=l;typeof s=="string"&&s===p&&s!=="mixed"&&(b=s,w=t.convert(0,b),A=t.find(l,[b,b]));var E,O,M=[];for(E=0;E{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Kr({typed:t}),u=gi({typed:t,DenseMatrix:n}),l=Cr({typed:t,DenseMatrix:n}),a=tr({typed:t,matrix:r,concat:i});return t(Zk,{"number, number":JS,"BigNumber, BigNumber":Uk,"bigint, bigint":(s,f)=>s^f},a({SS:u,DS:o,Ss:l}))});g();y();v();var Kk="arg",pse=["typed"],Jk=K(Kk,pse,e=>{var{typed:t}=e;return t(Kk,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();y();v();var Qk="conj",mse=["typed"],jk=K(Qk,mse,e=>{var{typed:t}=e;return t(Qk,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();y();v();var e4="im",hse=["typed"],t4=K(e4,hse,e=>{var{typed:t}=e;return t(e4,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();y();v();var r4="re",dse=["typed"],n4=K(r4,dse,e=>{var{typed:t}=e;return t(r4,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();y();v();var i4="not",gse=["typed"],o4=K(i4,gse,e=>{var{typed:t}=e;return t(i4,{"null | undefined":()=>!0,number:nA,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},bigint:r=>!r,Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();y();v();var a4="or",vse=["typed","matrix","equalScalar","DenseMatrix","concat"],nw=K(a4,vse,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=Bf({typed:t,equalScalar:n}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:r,concat:o});return t(a4,{"number, number":Gx,"Complex, Complex":function(p,h){return p.re!==0||p.im!==0||h.re!==0||h.im!==0},"BigNumber, BigNumber":function(p,h){return!p.isZero()&&!p.isNaN()||!h.isZero()&&!h.isNaN()},"bigint, bigint":Gx,"Unit, Unit":t.referToSelf(f=>(p,h)=>f(p.value||0,h.value||0))},s({SS:l,DS:u,Ss:a}))});g();y();v();var s4="xor",yse=["typed","matrix","DenseMatrix","concat"],u4=K(s4,yse,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Kr({typed:t}),u=gi({typed:t,DenseMatrix:n}),l=Cr({typed:t,DenseMatrix:n}),a=tr({typed:t,matrix:r,concat:i});return t(s4,{"number, number":Yx,"Complex, Complex":function(f,p){return(f.re!==0||f.im!==0)!=(p.re!==0||p.im!==0)},"bigint, bigint":Yx,"BigNumber, BigNumber":function(f,p){return(!f.isZero()&&!f.isNaN())!=(!p.isZero()&&!p.isNaN())},"Unit, Unit":t.referToSelf(s=>(f,p)=>s(f.value||0,p.value||0))},a({SS:u,DS:o,Ss:l}))});g();y();v();var l4="concat",xse=["typed","matrix","isInteger"],iw=K(l4,xse,e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(l4,{"...Array | Matrix | number | BigNumber":function(o){var u,l=o.length,a=-1,s,f=!1,p=[];for(u=0;u0&&a>s)throw new Mi(a,s+1)}else{var x=Lt(h).valueOf(),b=Wt(x);if(p[u]=x,s=a,a=b.length-1,u>0&&a!==s)throw new Jt(s+1,a+1)}}if(p.length===0)throw new SyntaxError("At least one matrix expected");for(var w=p.shift();p.length;)w=TS(w,p.shift(),a);return f?r(w):w},"...string":function(o){return o.join("")}})});g();y();v();var f4="column",wse=["typed","Index","matrix","range"],ow=K(f4,wse,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(f4,{"Matrix, number":o,"Array, number":function(l,a){return o(n(Lt(l)),a).valueOf()}});function o(u,l){if(u.size().length!==2)throw new Error("Only two dimensional matrix is supported");Lr(l,u.size()[1]);var a=i(0,u.size()[0]),s=new r(a,l),f=u.subset(s);return Et(f)?f:n([[f]])}});g();y();v();var c4="count",bse=["typed","size","prod"],p4=K(c4,bse,e=>{var{typed:t,size:r,prod:n}=e;return t(c4,{string:function(o){return o.length},"Matrix | Array":function(o){return n(r(o))}})});g();y();v();var m4="cross",Dse=["typed","matrix","subtract","multiply"],h4=K(m4,Dse,e=>{var{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(m4,{"Matrix, Matrix":function(l,a){return r(o(l.toArray(),a.toArray()))},"Matrix, Array":function(l,a){return r(o(l.toArray(),a))},"Array, Matrix":function(l,a){return r(o(l,a.toArray()))},"Array, Array":o});function o(u,l){var a=Math.max(Wt(u).length,Wt(l).length);u=vh(u),l=vh(l);var s=Wt(u),f=Wt(l);if(s.length!==1||f.length!==1||s[0]!==3||f[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+s.join(", ")+"], B = ["+f.join(", ")+"])");var p=[n(i(u[1],l[2]),i(u[2],l[1])),n(i(u[2],l[0]),i(u[0],l[2])),n(i(u[0],l[1]),i(u[1],l[0]))];return a>1?[p]:p}});g();y();v();var d4="diag",Nse=["typed","matrix","DenseMatrix","SparseMatrix"],g4=K(d4,Nse,e=>{var{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(d4,{Array:function(s){return o(s,0,Wt(s),null)},"Array, number":function(s,f){return o(s,f,Wt(s),null)},"Array, BigNumber":function(s,f){return o(s,f.toNumber(),Wt(s),null)},"Array, string":function(s,f){return o(s,0,Wt(s),f)},"Array, number, string":function(s,f,p){return o(s,f,Wt(s),p)},"Array, BigNumber, string":function(s,f,p){return o(s,f.toNumber(),Wt(s),p)},Matrix:function(s){return o(s,0,s.size(),s.storage())},"Matrix, number":function(s,f){return o(s,f,s.size(),s.storage())},"Matrix, BigNumber":function(s,f){return o(s,f.toNumber(),s.size(),s.storage())},"Matrix, string":function(s,f){return o(s,0,s.size(),f)},"Matrix, number, string":function(s,f,p){return o(s,f,s.size(),p)},"Matrix, BigNumber, string":function(s,f,p){return o(s,f.toNumber(),s.size(),p)}});function o(a,s,f,p){if(!Nt(s))throw new TypeError("Second parameter in function diag must be an integer");var h=s>0?s:0,x=s<0?-s:0;switch(f.length){case 1:return u(a,s,p,f[0],x,h);case 2:return l(a,s,p,f,x,h)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function u(a,s,f,p,h,x){var b=[p+h,p+x];if(f&&f!=="sparse"&&f!=="dense")throw new TypeError("Unknown matrix type ".concat(f,'"'));var w=f==="sparse"?i.diagonal(b,a,s):n.diagonal(b,a,s);return f!==null?w:w.valueOf()}function l(a,s,f,p,h,x){if(Et(a)){var b=a.diagonal(s);return f!==null?f!==b.storage()?r(b,f):b:b.valueOf()}for(var w=Math.min(p[0]-h,p[1]-x),A=[],E=0;E=2&&w.push("index: ".concat(gr(r))),x.length>=3&&w.push("array: ".concat(gr(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(w.join(", "),") at index ").concat(JSON.stringify(r)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(A.message))}}}var Ese="filter",Sse=["typed"],y4=K(Ese,Sse,e=>{var{typed:t}=e;return t("filter",{"Array, function":v4,"Matrix, function":function(n,i){return n.create(v4(n.toArray(),i))},"Array, RegExp":yh,"Matrix, RegExp":function(n,i){return n.create(yh(n.toArray(),i))}})});function v4(e,t){return Ux(e,function(r,n,i){return Ya(t,r,[n],i,"filter")})}g();y();v();var x4="flatten",Ase=["typed","matrix"],w4=K(x4,Ase,e=>{var{typed:t,matrix:r}=e;return t(x4,{Array:function(i){return nr(i)},Matrix:function(i){var o=nr(i.toArray());return r(o)}})});g();y();v();var b4="forEach",Cse=["typed"],D4=K(b4,Cse,e=>{var{typed:t}=e;return t(b4,{"Array, function":Mse,"Matrix, function":function(n,i){n.forEach(i)}})});function Mse(e,t){var r=function n(i,o){if(Array.isArray(i))Ff(i,function(u,l){n(u,o.concat(l))});else return Ya(t,i,o,e,"forEach")};r(e,[])}g();y();v();var N4="getMatrixDataType",Tse=["typed"],E4=K(N4,Tse,e=>{var{typed:t}=e;return t(N4,{Array:function(n){return _f(n,gr)},Matrix:function(n){return n.getDataType()}})});g();y();v();var S4="identity",Ose=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],A4=K(S4,Ose,e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:o,SparseMatrix:u}=e;return t(S4,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(f){return n(f)},"number | BigNumber":function(f){return a(f,f,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(f,p){return a(f,f,p)},"number | BigNumber, number | BigNumber":function(f,p){return a(f,p,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(f,p,h){return a(f,p,h)},Array:function(f){return l(f)},"Array, string":function(f,p){return l(f,p)},Matrix:function(f){return l(f.valueOf(),f.storage())},"Matrix, string":function(f,p){return l(f.valueOf(),p)}});function l(s,f){switch(s.length){case 0:return f?n(f):[];case 1:return a(s[0],s[0],f);case 2:return a(s[0],s[1],f);default:throw new Error("Vector containing two values expected")}}function a(s,f,p){var h=kt(s)||kt(f)?i:null;if(kt(s)&&(s=s.toNumber()),kt(f)&&(f=f.toNumber()),!Nt(s)||s<1)throw new Error("Parameters in function identity must be positive integers");if(!Nt(f)||f<1)throw new Error("Parameters in function identity must be positive integers");var x=h?new i(1):1,b=h?new h(0):0,w=[s,f];if(p){if(p==="sparse")return u.diagonal(w,x,0,b);if(p==="dense")return o.diagonal(w,x,0,b);throw new TypeError('Unknown matrix type "'.concat(p,'"'))}for(var A=Ps([],w,b),E=s{var{typed:t,matrix:r,multiplyScalar:n}=e;return t(C4,{"Matrix, Matrix":function(u,l){return r(i(u.toArray(),l.toArray()))},"Matrix, Array":function(u,l){return r(i(u.toArray(),l))},"Array, Matrix":function(u,l){return r(i(u,l.toArray()))},"Array, Array":i});function i(o,u){if(Wt(o).length===1&&(o=[o]),Wt(u).length===1&&(u=[u]),Wt(o).length>2||Wt(u).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(o.length)+", y = "+JSON.stringify(u.length)+")");var l=[],a=[];return o.map(function(s){return u.map(function(f){return a=[],l.push(a),s.map(function(p){return f.map(function(h){return a.push(n(p,h))})})})})&&l}});g();y();v();var T4="map",Fse=["typed"],O4=K(T4,Fse,e=>{var{typed:t}=e;return t(T4,{"Array, function":_se,"Matrix, function":function(n,i){return n.map(i)}})});function _se(e,t){var r=function n(i,o){return Array.isArray(i)?i.map(function(u,l){return n(u,o.concat(l))}):Ya(t,i,o,e,"map")};return r(e,[])}g();y();v();var I4="diff",kse=["typed","matrix","subtract","number"],aw=K(I4,kse,e=>{var{typed:t,matrix:r,subtract:n,number:i}=e;return t(I4,{"Array | Matrix":function(f){return Et(f)?r(u(f.toArray())):u(f)},"Array | Matrix, number":function(f,p){if(!Nt(p))throw new RangeError("Dimension must be a whole number");return Et(f)?r(o(f.toArray(),p)):o(f,p)},"Array, BigNumber":t.referTo("Array,number",s=>(f,p)=>s(f,i(p))),"Matrix, BigNumber":t.referTo("Matrix,number",s=>(f,p)=>s(f,i(p)))});function o(s,f){if(Et(s)&&(s=s.toArray()),!Array.isArray(s))throw RangeError("Array/Matrix does not have that many dimensions");if(f>0){var p=[];return s.forEach(h=>{p.push(o(h,f-1))}),p}else{if(f===0)return u(s);throw RangeError("Cannot have negative dimension")}}function u(s){for(var f=[],p=s.length,h=1;h{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t("ones",{"":function(){return r.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(s){var f=s[s.length-1];if(typeof f=="string"){var p=s.pop();return o(s,p)}else return r.matrix==="Array"?o(s):o(s,"default")},Array:o,Matrix:function(s){var f=s.storage();return o(s.valueOf(),f)},"Array | Matrix, string":function(s,f){return o(s.valueOf(),f)}});function o(a,s){var f=u(a),p=f?new i(1):1;if(l(a),s){var h=n(s);return a.length>0?h.resize(a,p):h}else{var x=[];return a.length>0?Ps(x,a,p):x}}function u(a){var s=!1;return a.forEach(function(f,p,h){kt(f)&&(s=!0,h[p]=f.toNumber())}),s}function l(a){a.forEach(function(s){if(typeof s!="number"||!Nt(s)||s<0)throw new Error("Parameters in function ones must be positive integers")})}});g();y();v();g();y();v();function Ah(){throw new Error('No "bignumber" implementation available')}function sw(){throw new Error('No "fraction" implementation available')}function uw(){throw new Error('No "matrix" implementation available')}var _4="range",Pse=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],lw=K(_4,Pse,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:u,larger:l,largerEq:a,add:s,isPositive:f}=e;return t(_4,{string:h,"string, boolean":h,"number, number":function(A,E){return p(x(A,E,1,!1))},"number, number, number":function(A,E,O){return p(x(A,E,O,!1))},"number, number, boolean":function(A,E,O){return p(x(A,E,1,O))},"number, number, number, boolean":function(A,E,O,M){return p(x(A,E,O,M))},"BigNumber, BigNumber":function(A,E){var O=A.constructor;return p(x(A,E,new O(1),!1))},"BigNumber, BigNumber, BigNumber":function(A,E,O){return p(x(A,E,O,!1))},"BigNumber, BigNumber, boolean":function(A,E,O){var M=A.constructor;return p(x(A,E,new M(1),O))},"BigNumber, BigNumber, BigNumber, boolean":function(A,E,O,M){return p(x(A,E,O,M))},"Unit, Unit, Unit":function(A,E,O){return p(x(A,E,O,!1))},"Unit, Unit, Unit, boolean":function(A,E,O,M){return p(x(A,E,O,M))}});function p(w){return r.matrix==="Matrix"?n?n(w):uw():w}function h(w,A){var E=b(w);if(!E)throw new SyntaxError('String "'+w+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&Ah(),p(x(i(E.start),i(E.end),i(E.step)),A)):p(x(E.start,E.end,E.step,A))}function x(w,A,E,O){for(var M=[],I=f(E)?O?u:o:O?a:l,F=w;I(F,A);)M.push(F),F=s(F,E);return M}function b(w){var A=w.split(":"),E=A.map(function(M){return Number(M)}),O=E.some(function(M){return isNaN(M)});if(O)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}}});g();y();v();var k4="reshape",Rse=["typed","isInteger","matrix"],B4=K(k4,Rse,e=>{var{typed:t,isInteger:r}=e;return t(k4,{"Matrix, Array":function(i,o){return i.reshape(o,!0)},"Array, Array":function(i,o){return o.forEach(function(u){if(!r(u))throw new TypeError("Invalid size for dimension: "+u)}),Ev(i,o)}})});g();y();v();var qse="resize",zse=["config","matrix"],L4=K(qse,zse,e=>{var{config:t,matrix:r}=e;return function(o,u,l){if(arguments.length!==2&&arguments.length!==3)throw new xa("resize",arguments.length,2,3);if(Et(u)&&(u=u.valueOf()),kt(u[0])&&(u=u.map(function(f){return kt(f)?f.toNumber():f})),Et(o))return o.resize(u,l,!0);if(typeof o=="string")return n(o,u,l);var a=Array.isArray(o)?!1:t.matrix!=="Array";if(u.length===0){for(;Array.isArray(o);)o=o[0];return Lt(o)}else{Array.isArray(o)||(o=[o]),o=Lt(o);var s=Ps(o,u,l);return a?r(s):s}};function n(i,o,u){if(u!==void 0){if(typeof u!="string"||u.length!==1)throw new TypeError("Single character expected as defaultValue")}else u=" ";if(o.length!==1)throw new Jt(o.length,1);var l=o[0];if(typeof l!="number"||!Nt(l))throw new TypeError("Invalid size, must contain positive integers (size: "+Kt(o)+")");if(i.length>l)return i.substring(0,l);if(i.length{var{typed:t,multiply:r,rotationMatrix:n}=e;return t(P4,{"Array , number | BigNumber | Complex | Unit":function(u,l){i(u,2);var a=r(n(l),u);return a.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(u,l){return i(u,2),r(n(l),u)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(u,l,a){i(u,3);var s=r(n(l,a),u);return s},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(u,l,a){return i(u,3),r(n(l,a),u)}});function i(o,u){var l=Array.isArray(o)?Wt(o):o.size();if(l.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(u));if(l.length===2&&l[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(u));if(l[0]!==u)throw new RangeError("Vector must be of dimensions 1x".concat(u))}});g();y();v();var q4="rotationMatrix",Hse=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],z4=K(q4,Hse,e=>{var{typed:t,config:r,multiplyScalar:n,addScalar:i,unaryMinus:o,norm:u,BigNumber:l,matrix:a,DenseMatrix:s,SparseMatrix:f,cos:p,sin:h}=e;return t(q4,{"":function(){return r.matrix==="Matrix"?a([]):[]},string:function(M){return a(M)},"number | BigNumber | Complex | Unit":function(M){return x(M,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(M,I){return x(M,I)},"number | BigNumber | Complex | Unit, Array":function(M,I){var F=a(I);return b(F),E(M,F,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(M,I){b(I);var F=I.storage()||(r.matrix==="Matrix"?"dense":void 0);return E(M,I,F)},"number | BigNumber | Complex | Unit, Array, string":function(M,I,F){var C=a(I);return b(C),E(M,C,F)},"number | BigNumber | Complex | Unit, Matrix, string":function(M,I,F){return b(I),E(M,I,F)}});function x(O,M){var I=kt(O),F=I?new l(-1):-1,C=p(O),P=h(O),R=[[C,n(F,P)],[P,C]];return A(R,M)}function b(O){var M=O.size();if(M.length<1||M[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function w(O){return O.reduce((M,I)=>n(M,I))}function A(O,M){if(M){if(M==="sparse")return new f(O);if(M==="dense")return new s(O);throw new TypeError('Unknown matrix type "'.concat(M,'"'))}return O}function E(O,M,I){var F=u(M);if(F===0)throw new RangeError("Rotation around zero vector");var C=kt(O)?l:null,P=C?new C(1):1,R=C?new C(-1):-1,q=C?new C(M.get([0])/F):M.get([0])/F,U=C?new C(M.get([1])/F):M.get([1])/F,H=C?new C(M.get([2])/F):M.get([2])/F,V=p(O),W=i(P,o(V)),ee=h(O),ie=i(V,w([q,q,W])),Y=i(w([q,U,W]),w([R,H,ee])),Z=i(w([q,H,W]),w([U,ee])),le=i(w([q,U,W]),w([H,ee])),re=i(V,w([U,U,W])),he=i(w([U,H,W]),w([R,q,ee])),De=i(w([q,H,W]),w([R,U,ee])),we=i(w([U,H,W]),w([q,ee])),ce=i(V,w([H,H,W])),Ee=[[ie,Y,Z],[le,re,he],[De,we,ce]];return A(Ee,I)}});g();y();v();var U4="row",$se=["typed","Index","matrix","range"],fw=K(U4,$se,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(U4,{"Matrix, number":o,"Array, number":function(l,a){return o(n(Lt(l)),a).valueOf()}});function o(u,l){if(u.size().length!==2)throw new Error("Only two dimensional matrix is supported");Lr(l,u.size()[0]);var a=i(0,u.size()[1]),s=new r(l,a),f=u.subset(s);return Et(f)?f:n([[f]])}});g();y();v();var H4="size",Wse=["typed","config","?matrix"],$4=K(H4,Wse,e=>{var{typed:t,config:r,matrix:n}=e;return t(H4,{Matrix:function(o){return o.create(o.size())},Array:Wt,string:function(o){return r.matrix==="Array"?[o.length]:n([o.length])},"number | Complex | BigNumber | Unit | boolean | null":function(o){return r.matrix==="Array"?[]:n?n([]):uw()}})});g();y();v();var W4="squeeze",Vse=["typed","matrix"],V4=K(W4,Vse,e=>{var{typed:t,matrix:r}=e;return t(W4,{Array:function(i){return vh(Lt(i))},Matrix:function(i){var o=vh(i.toArray());return Array.isArray(o)?r(o):o},any:function(i){return Lt(i)}})});g();y();v();var G4="subset",Gse=["typed","matrix","zeros","add"],cw=K(G4,Gse,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t(G4,{"Matrix, Index":function(l,a){return dp(a)?r():(Nv(l,a),l.subset(a))},"Array, Index":t.referTo("Matrix, Index",function(u){return function(l,a){var s=u(r(l),a);return a.isScalar()?s:s.valueOf()}}),"Object, Index":Zse,"string, Index":Yse,"Matrix, Index, any, any":function(l,a,s,f){return dp(a)?l:(Nv(l,a),l.clone().subset(a,o(s,a),f))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",function(u){return function(l,a,s,f){var p=u(r(l),a,s,f);return p.isMatrix?p.valueOf():p}}),"Array, Index, any":t.referTo("Matrix, Index, any, any",function(u){return function(l,a,s){return u(r(l),a,s,void 0).valueOf()}}),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",function(u){return function(l,a,s){return u(l,a,s,void 0)}}),"string, Index, string":Y4,"string, Index, string, string":Y4,"Object, Index, any":Xse});function o(u,l){if(typeof u=="string")throw new Error("can't boradcast a string");if(l._isScalar)return u;var a=l.size();if(a.every(s=>s>0))try{return i(u,n(a))}catch{return u}else return u}});function Yse(e,t){if(!Nu(t))throw new TypeError("Index expected");if(dp(t))return"";if(Nv(Array.from(e),t),t.size().length!==1)throw new Jt(t.size().length,1);var r=e.length;Lr(t.min()[0],r),Lr(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach(function(o){i+=e.charAt(o)}),i}function Y4(e,t,r,n){if(!t||t.isIndex!==!0)throw new TypeError("Index expected");if(dp(t))return e;if(Nv(Array.from(e),t),t.size().length!==1)throw new Jt(t.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0),o=i.size()[0];if(o!==r.length)throw new Jt(i.size()[0],r.length);var u=e.length;Lr(t.min()[0]),Lr(t.max()[0]);for(var l=[],a=0;au)for(var s=u-1,f=l.length;s{var{typed:t,matrix:r}=e;return t(Z4,{Array:u=>n(r(u)).valueOf(),Matrix:n,any:Lt});function n(u){var l=u.size(),a;switch(l.length){case 1:a=u.clone();break;case 2:{var s=l[0],f=l[1];if(f===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Kt(l)+")");switch(u.storage()){case"dense":a=i(u,s,f);break;case"sparse":a=o(u,s,f);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Kt(l)+")")}return a}function i(u,l,a){for(var s=u._data,f=[],p,h=0;h{var{typed:t,transpose:r,conj:n}=e;return t(K4,{any:function(o){return n(r(o))}})});g();y();v();var Q4="zeros",Qse=["typed","config","matrix","BigNumber"],j4=K(Q4,Qse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(Q4,{"":function(){return r.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(s){var f=s[s.length-1];if(typeof f=="string"){var p=s.pop();return o(s,p)}else return r.matrix==="Array"?o(s):o(s,"default")},Array:o,Matrix:function(s){var f=s.storage();return o(s.valueOf(),f)},"Array | Matrix, string":function(s,f){return o(s.valueOf(),f)}});function o(a,s){var f=u(a),p=f?new i(0):0;if(l(a),s){var h=n(s);return a.length>0?h.resize(a,p):h}else{var x=[];return a.length>0?Ps(x,a,p):x}}function u(a){var s=!1;return a.forEach(function(f,p,h){kt(f)&&(s=!0,h[p]=f.toNumber())}),s}function l(a){a.forEach(function(s){if(typeof s!="number"||!Nt(s)||s<0)throw new Error("Parameters in function zeros must be positive integers")})}});g();y();v();var e5="fft",jse=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],t5=K(e5,jse,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:o,exp:u,tau:l,i:a,dotDivide:s,conj:f,pow:p,ceil:h,log2:x}=e;return t(e5,{Array:b,Matrix:function(M){return M.create(b(M.toArray()))}});function b(O){var M=Wt(O);return M.length===1?E(O,M[0]):w(O.map(I=>b(I,M.slice(1))),0)}function w(O,M){var I=Wt(O);if(M!==0)return new Array(I[0]).fill(0).map((C,P)=>w(O[P],M-1));if(I.length===1)return E(O);function F(C){var P=Wt(C);return new Array(P[1]).fill(0).map((R,q)=>new Array(P[0]).fill(0).map((U,H)=>C[H][q]))}return F(w(F(O),1))}function A(O){for(var M=O.length,I=u(o(i(-1,i(a,l)),M)),F=[],C=1-M;Ci(O[Z],F[M-1+Z])),...new Array(P-M).fill(0)],q=[...new Array(M+M-1).fill(0).map((Y,Z)=>o(1,F[Z])),...new Array(P-(M+M-1)).fill(0)],U=E(R),H=E(q),V=new Array(P).fill(0).map((Y,Z)=>i(U[Z],H[Z])),W=s(f(b(f(V))),P),ee=[],ie=M-1;ieq%2===0),M/2),...E(O.filter((R,q)=>q%2===1),M/2)],F=0;F{var{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(r5,{"Array | Matrix":function(u){var l=Et(u)?u.size():Wt(u);return n(i(r(i(u))),l.reduce((a,s)=>a*s,1))}})});g();y();v();g();y();v();g();y();v();g();y();v();function yp(e){"@babel/helpers - typeof";return yp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yp(e)}g();y();v();function i5(e,t){if(yp(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function o5(e){var t=i5(e,"string");return yp(t)=="symbol"?t:t+""}function Fr(e,t,r){return(t=o5(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tue(e){for(var t=1;t{var{typed:t,add:r,subtract:n,multiply:i,divide:o,max:u,map:l,abs:a,isPositive:s,isNegative:f,larger:p,smaller:h,matrix:x,bignumber:b,unaryMinus:w}=e;function A(R){return function(q,U,H,V){var W=!(U.length===2&&(U.every(C)||U.every(ui)));if(W)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var ee=U[0],ie=U[1],Y=p(ie,ee),Z=V.firstStep;if(Z!==void 0&&!s(Z))throw new Error('"firstStep" must be positive');var le=V.maxStep;if(le!==void 0&&!s(le))throw new Error('"maxStep" must be positive');var re=V.minStep;if(re&&f(re))throw new Error('"minStep" must be positive or zero');var he=[ee,ie,Z,re,le].filter(Qe=>Qe!==void 0);if(!(he.every(C)||he.every(ui)))throw new Error('Inconsistent type of "t" dependant variables');for(var De=1,we=V.tol?V.tol:1e-4,ce=V.minDelta?V.minDelta:.2,Ee=V.maxDelta?V.maxDelta:5,Pe=V.maxIter?V.maxIter:1e4,Ce=[ee,ie,...H,le,re].some(kt),[Oe,He,Se,ze]=Ce?[b(R.a),b(R.c),b(R.b),b(R.bp)]:[R.a,R.c,R.b,R.bp],We=Z?Y?Z:w(Z):o(n(ie,ee),De),Le=[ee],lt=[H],ct=n(Se,ze),de=0,be=0,Ue=I(Y),ge=F(Y);Ue(Le[de],ie);){var Re=[];We=ge(Le[de],ie,We),Re.push(q(Le[de],lt[de]));for(var Be=1;Beui(Qe)?Qe.value:Qe)));Ke1/4&&(Le.push(r(Le[de],We)),lt.push(r(lt[de],i(We,Se,Re))),de++);var ot=.84*(we/Ke)**(1/5);if(h(ot,ce)?ot=ce:p(ot,Ee)&&(ot=Ee),ot=Ce?b(ot):ot,We=i(We,ot),le&&p(a(We),le)?We=Y?le:w(le):re&&h(a(We),re)&&(We=Y?re:w(re)),be++,be>Pe)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Le,y:lt}}}function E(R,q,U,H){var V=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],W=[null,1/2,3/4,1],ee=[2/9,1/3,4/9,0],ie=[7/24,1/4,1/3,1/8],Y={a:V,c:W,b:ee,bp:ie};return A(Y)(R,q,U,H)}function O(R,q,U,H){var V=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],W=[null,1/5,3/10,4/5,8/9,1,1],ee=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],ie=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],Y={a:V,c:W,b:ee,bp:ie};return A(Y)(R,q,U,H)}function M(R,q,U,H){var V=H.method?H.method:"RK45",W={RK23:E,RK45:O};if(V.toUpperCase()in W){var ee=tue({},H);return delete ee.method,W[V.toUpperCase()](R,q,U,ee)}else{var ie=Object.keys(W).map(Z=>'"'.concat(Z,'"')),Y="".concat(ie.slice(0,-1).join(", ")," and ").concat(ie.slice(-1));throw new Error('Unavailable method "'.concat(V,'". Available methods are ').concat(Y))}}function I(R){return R?h:p}function F(R){var q=R?p:h;return function(U,H,V){var W=r(U,V);return q(W,H)?n(H,U):V}}function C(R){return kt(R)||$t(R)}function P(R,q,U,H){var V=M(R,q.toArray(),U.toArray(),H);return{t:x(V.t),y:x(V.y)}}return t("solveODE",{"function, Array, Array, Object":M,"function, Matrix, Matrix, Object":P,"function, Array, Array":(R,q,U)=>M(R,q,U,{}),"function, Matrix, Matrix":(R,q,U)=>P(R,q,U,{}),"function, Array, number | BigNumber | Unit":(R,q,U)=>{var H=M(R,q,[U],{});return{t:H.t,y:H.y.map(V=>V[0])}},"function, Matrix, number | BigNumber | Unit":(R,q,U)=>{var H=M(R,q.toArray(),[U],{});return{t:x(H.t),y:x(H.y.map(V=>V[0]))}},"function, Array, number | BigNumber | Unit, Object":(R,q,U,H)=>{var V=M(R,q,[U],H);return{t:V.t,y:V.y.map(W=>W[0])}},"function, Matrix, number | BigNumber | Unit, Object":(R,q,U,H)=>{var V=M(R,q.toArray(),[U],H);return{t:x(V.t),y:x(V.y.map(W=>W[0]))}}})});g();y();v();var iue="erf",oue=["typed"],u5=K(iue,oue,e=>{var{typed:t}=e;return t("name",{number:function(u){var l=Math.abs(u);return l>=uue?Wa(u):l<=aue?Wa(u)*r(l):l<=4?Wa(u)*(1-n(l)):Wa(u)*(1-i(l))},"Array | Matrix":t.referToSelf(o=>u=>Ct(u,o))});function r(o){var u=o*o,l=bl[0][4]*u,a=u,s;for(s=0;s<3;s+=1)l=(l+bl[0][s])*u,a=(a+Ch[0][s])*u;return o*(l+bl[0][3])/(a+Ch[0][3])}function n(o){var u=bl[1][8]*o,l=o,a;for(a=0;a<7;a+=1)u=(u+bl[1][a])*o,l=(l+Ch[1][a])*o;var s=(u+bl[1][7])/(l+Ch[1][7]),f=parseInt(o*16)/16,p=(o-f)*(o+f);return Math.exp(-f*f)*Math.exp(-p)*s}function i(o){var u=1/(o*o),l=bl[2][5]*u,a=u,s;for(s=0;s<4;s+=1)l=(l+bl[2][s])*u,a=(a+Ch[2][s])*u;var f=u*(l+bl[2][4])/(a+Ch[2][4]);f=(sue-f)/o,u=parseInt(o*16)/16;var p=(o-u)*(o+u);return Math.exp(-u*u)*Math.exp(-p)*f}}),aue=.46875,sue=.5641895835477563,bl=[[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]],Ch=[[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]],uue=Math.pow(2,53);g();y();v();var l5="zeta",lue=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],f5=K(l5,lue,e=>{var{typed:t,config:r,multiply:n,pow:i,divide:o,factorial:u,equal:l,smallerEq:a,isNegative:s,gamma:f,sin:p,subtract:h,add:x,Complex:b,BigNumber:w,pi:A}=e;return t(l5,{number:C=>E(C,P=>P,()=>20),BigNumber:C=>E(C,P=>new w(P),()=>Math.abs(Math.log10(r.relTol))),Complex:O});function E(C,P,R){return l(C,0)?P(-.5):l(C,1)?P(NaN):isFinite(C)?M(C,P,R,q=>q):s(C)?P(NaN):P(1)}function O(C){return C.re===0&&C.im===0?new b(-.5):C.re===1?new b(NaN,NaN):C.re===1/0&&C.im===0?new b(1):C.im===1/0||C.re===-1/0?new b(NaN,NaN):M(C,P=>P,P=>Math.round(1.3*15+.9*Math.abs(P.im)),P=>P.re)}function M(C,P,R,q){var U=R(C);if(q(C)>-(U-1)/2)return F(C,P(U),P);var H=n(i(2,C),i(P(A),h(C,1)));return H=n(H,p(n(o(P(A),2),C))),H=n(H,f(h(1,C))),n(H,M(h(1,C),P,R,q))}function I(C,P){for(var R=C,q=C;a(q,P);q=x(q,1)){var U=o(n(u(x(P,h(q,1))),i(4,q)),n(u(h(P,q)),u(n(2,q))));R=x(R,U)}return n(P,R)}function F(C,P,R){for(var q=o(1,n(I(R(0),P),h(1,i(2,h(1,C))))),U=R(0),H=R(1);a(H,P);H=x(H,1))U=x(U,o(n((-1)**(H-1),I(H,P)),i(H,C)));return n(q,U)}});g();y();v();var c5="mode",fue=["typed","isNaN","isNumeric"],p5=K(c5,fue,e=>{var{typed:t,isNaN:r,isNumeric:n}=e;return t(c5,{"Array | Matrix":i,"...":function(u){return i(u)}});function i(o){o=nr(o.valueOf());var u=o.length;if(u===0)throw new Error("Cannot calculate mode of an empty array");for(var l={},a=[],s=0,f=0;fs&&(s=l[p],a=[p])}return a}});g();y();v();g();y();v();function Tn(e,t,r){var n;return String(e).includes("Unexpected type")?(n=arguments.length>2?" (type: "+gr(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).includes("complex numbers")?(n=arguments.length>2?" (type: "+gr(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var m5="prod",cue=["typed","config","multiplyScalar","numeric"],h5=K(m5,cue,e=>{var{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(m5,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(l,a){throw new Error("prod(A, dim) is not yet supported")},"...":function(l){return o(l)}});function o(u){var l;if(mo(u,function(a){try{l=l===void 0?a:n(l,a)}catch(s){throw Tn(s,"prod",a)}}),typeof l=="string"&&(l=i(l,co(l,r))),l===void 0)throw new Error("Cannot calculate prod of an empty array");return l}});g();y();v();var d5="format",pue=["typed"],g5=K(d5,pue,e=>{var{typed:t}=e;return t(d5,{any:Kt,"any, Object | function | number | BigNumber":Kt})});g();y();v();var v5="bin",mue=["typed","format"],y5=K(v5,mue,e=>{var{typed:t,format:r}=e;return t(v5,{"number | BigNumber":function(i){return r(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"bin",wordSize:o})}})});g();y();v();var x5="oct",hue=["typed","format"],w5=K(x5,hue,e=>{var{typed:t,format:r}=e;return t(x5,{"number | BigNumber":function(i){return r(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"oct",wordSize:o})}})});g();y();v();var b5="hex",due=["typed","format"],D5=K(b5,due,e=>{var{typed:t,format:r}=e;return t(b5,{"number | BigNumber":function(i){return r(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"hex",wordSize:o})}})});g();y();v();g();y();v();var pw=/\$([\w.]+)/g;var N5="print",gue=["typed"],mw=K(N5,gue,e=>{var{typed:t}=e;return t(N5,{"string, Object | Array":E5,"string, Object | Array, number | Object":E5})});function E5(e,t,r){return e.replace(pw,function(n,i){var o=i.split("."),u=t[o.shift()];for(u!==void 0&&u.isMatrix&&(u=u.toArray());o.length&&u!==void 0;){var l=o.shift();u=l?u[l]:u+"."}return u!==void 0?gn(u)?u:Kt(u,r):n})}g();y();v();var S5="to",vue=["typed","matrix","concat"],A5=K(S5,vue,e=>{var{typed:t,matrix:r,concat:n}=e,i=tr({typed:t,matrix:r,concat:n});return t(S5,{"Unit, Unit | string":(o,u)=>o.to(u)},i({Ds:!0}))});g();y();v();var C5="isPrime",yue=["typed"],M5=K(C5,yue,e=>{var{typed:t}=e;return t(C5,{number:function(n){if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0},bigint:function(n){if(n<=3n)return n>1n;if(n%2n===0n||n%3n===0n)return!1;for(var i=5n;i*i<=n;i+=6n)if(n%i===0n||n%(i+2n)===0n)return!1;return!0},BigNumber:function(n){if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var i=n.toNumber(),o=5;o*o<=i;o+=6)if(i%o===0||i%(o+2)===0)return!1;return!0}function u(O,M,I){for(var F=1;!M.eq(0);)M.mod(2).eq(0)?(M=M.div(2),O=O.mul(O).mod(I)):(M=M.sub(1),F=O.mul(F).mod(I));return F}var l=n.constructor.clone({precision:n.toFixed(0).length*2});n=new l(n);for(var a=0,s=n.sub(1);s.mod(2).eq(0);)s=s.div(2),a+=1;var f=null;if(n.lt("3317044064679887385961981"))f=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(O=>On=>Ct(n,r))})});g();y();v();var xue="numeric",wue=["number","?bignumber","?fraction"],T5=K(xue,wue,e=>{var{number:t,bignumber:r,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:u=>t(u),BigNumber:r?u=>r(u):Ah,bigint:u=>BigInt(u),Fraction:n?u=>n(u):sw};return function(l){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",s=arguments.length>2?arguments[2]:void 0;if(s!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var f=gr(l);if(!(f in i))throw new TypeError("Cannot convert "+l+' of type "'+f+'"; valid input types are '+Object.keys(i).join(", "));if(!(a in o))throw new TypeError("Cannot convert "+l+' to type "'+a+'"; valid output types are '+Object.keys(o).join(", "));return a===f?l:o[a](l)}});g();y();v();var O5="divideScalar",bue=["typed","numeric"],I5=K(O5,bue,e=>{var{typed:t,numeric:r}=e;return t(O5,{"number, number":function(i,o){return i/o},"Complex, Complex":function(i,o){return i.div(o)},"BigNumber, BigNumber":function(i,o){return i.div(o)},"bigint, bigint":function(i,o){return i/o},"Fraction, Fraction":function(i,o){return i.div(o)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})});g();y();v();var F5="pow",Due=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],_5=K(F5,Due,e=>{var{typed:t,config:r,identity:n,multiply:i,matrix:o,inv:u,number:l,fraction:a,Complex:s}=e;return t(F5,{"number, number":f,"Complex, Complex":function(b,w){return b.pow(w)},"BigNumber, BigNumber":function(b,w){return w.isInteger()||b>=0||r.predictable?b.pow(w):new s(b.toNumber(),0).pow(w.toNumber(),0)},"bigint, bigint":(x,b)=>x**b,"Fraction, Fraction":function(b,w){var A=b.pow(w);if(A!=null)return A;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return f(b.valueOf(),w.valueOf())},"Array, number":p,"Array, BigNumber":function(b,w){return p(b,w.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(b,w){return h(b,w.toNumber())},"Unit, number | BigNumber":function(b,w){return b.pow(w)}});function f(x,b){if(r.predictable&&!Nt(b)&&x<0)try{var w=a(b),A=l(w);if((b===A||Math.abs((b-A)/b)<1e-14)&&w.d%2===1)return(w.n%2===0?1:-1)*Math.pow(-x,b)}catch{}return r.predictable&&(x<-1&&b===1/0||x>-1&&x<0&&b===-1/0)?NaN:Nt(b)||x>=0||r.predictable?YS(x,b):x*x<1&&b===1/0||x*x>1&&b===-1/0?0:new s(x,0).pow(b,0)}function p(x,b){if(!Nt(b))throw new TypeError("For A^b, b must be an integer (value is "+b+")");var w=Wt(x);if(w.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+w.length+" dimensions)");if(w[0]!==w[1])throw new Error("For A^b, A must be square (size is "+w[0]+"x"+w[1]+")");if(b<0)try{return p(u(x),-b)}catch(O){throw O.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+b+")"):O}for(var A=n(w[0]).valueOf(),E=x;b>=1;)(b&1)===1&&(A=i(E,A)),b>>=1,E=i(E,E);return A}function h(x,b){return o(p(x.valueOf(),b))}});g();y();v();var Mh="Number of decimals in function round must be an integer",k5="round",Nue=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],B5=K(k5,Nue,e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:o,BigNumber:u,DenseMatrix:l}=e,a=Pr({typed:t,equalScalar:i}),s=Cr({typed:t,DenseMatrix:l}),f=Qn({typed:t});function p(h){return Math.abs(ph(h).exponent)}return t(k5,{number:function(x){var b=bh(x,p(r.relTol)),w=en(x,b,r.relTol,r.absTol)?b:x;return bh(w)},"number, number":function(x,b){var w=p(r.relTol);if(b>=w)return bh(x,b);var A=bh(x,w),E=en(x,A,r.relTol,r.absTol)?A:x;return bh(E,b)},"number, BigNumber":function(x,b){if(!b.isInteger())throw new TypeError(Mh);return new u(x).toDecimalPlaces(b.toNumber())},Complex:function(x){return x.round()},"Complex, number":function(x,b){if(b%1)throw new TypeError(Mh);return x.round(b)},"Complex, BigNumber":function(x,b){if(!b.isInteger())throw new TypeError(Mh);var w=b.toNumber();return x.round(w)},BigNumber:function(x){var b=new u(x).toDecimalPlaces(p(r.relTol)),w=xn(x,b,r.relTol,r.absTol)?b:x;return w.toDecimalPlaces(0)},"BigNumber, BigNumber":function(x,b){if(!b.isInteger())throw new TypeError(Mh);var w=p(r.relTol);if(b>=w)return x.toDecimalPlaces(b.toNumber());var A=x.toDecimalPlaces(w),E=xn(x,A,r.relTol,r.absTol)?A:x;return E.toDecimalPlaces(b.toNumber())},Fraction:function(x){return x.round()},"Fraction, number":function(x,b){if(b%1)throw new TypeError(Mh);return x.round(b)},"Fraction, BigNumber":function(x,b){if(!b.isInteger())throw new TypeError(Mh);return x.round(b.toNumber())},"Unit, number, Unit":t.referToSelf(h=>function(x,b,w){var A=x.toNumeric(w);return w.multiply(h(A,b))}),"Unit, BigNumber, Unit":t.referToSelf(h=>(x,b,w)=>h(x,b.toNumber(),w)),"Unit, Unit":t.referToSelf(h=>(x,b)=>h(x,0,b)),"Array | Matrix, number, Unit":t.referToSelf(h=>(x,b,w)=>Ct(x,A=>h(A,b,w),!0)),"Array | Matrix, BigNumber, Unit":t.referToSelf(h=>(x,b,w)=>h(x,b.toNumber(),w)),"Array | Matrix, Unit":t.referToSelf(h=>(x,b)=>h(x,0,b)),"Array | Matrix":t.referToSelf(h=>x=>Ct(x,h,!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(x,b)=>a(x,b,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(x,b)=>f(x,b,h,!1)),"Array, number | BigNumber":t.referToSelf(h=>(x,b)=>f(n(x),b,h,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(h=>(x,b)=>i(x,0)?o(b.size(),b.storage()):s(b,x,h,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(h=>(x,b)=>i(x,0)?o(b.size(),b.storage()):f(b,x,h,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(h=>(x,b)=>f(n(b),x,h,!0).valueOf())})});g();y();v();var L5="log",Eue=["config","typed","divideScalar","Complex"],P5=K(L5,Eue,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e;return t(L5,{number:function(u){return u>=0||r.predictable?e_(u):new i(u,0).log()},Complex:function(u){return u.log()},BigNumber:function(u){return!u.isNegative()||r.predictable?u.ln():new i(u.toNumber(),0).log()},"any, any":t.referToSelf(o=>(u,l)=>n(o(u),o(l)))})});g();y();v();var R5="log1p",Sue=["typed","config","divideScalar","log","Complex"],q5=K(R5,Sue,e=>{var{typed:t,config:r,divideScalar:n,log:i,Complex:o}=e;return t(R5,{number:function(a){return a>=-1||r.predictable?Nx(a):u(new o(a,0))},Complex:u,BigNumber:function(a){var s=a.plus(1);return!s.isNegative()||r.predictable?s.ln():u(new o(a.toNumber(),0))},"Array | Matrix":t.referToSelf(l=>a=>Ct(a,l)),"any, any":t.referToSelf(l=>(a,s)=>n(l(a),i(s)))});function u(l){var a=l.re+1;return new o(Math.log(Math.sqrt(a*a+l.im*l.im)),Math.atan2(l.im,a))}});g();y();v();var z5="nthRoots",Aue=["config","typed","divideScalar","Complex"],U5=K(z5,Aue,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e,o=[function(a){return new i(a,0)},function(a){return new i(0,a)},function(a){return new i(-a,0)},function(a){return new i(0,-a)}];function u(l,a){if(a<0)throw new Error("Root must be greater than zero");if(a===0)throw new Error("Root must be non-zero");if(a%1!==0)throw new Error("Root must be an integer");if(l===0||l.abs()===0)return[new i(0,0)];var s=typeof l=="number",f;(s||l.re===0||l.im===0)&&(s?f=2*+(l<0):l.im===0?f=2*+(l.re<0):f=2*+(l.im<0)+1);for(var p=l.arg(),h=l.abs(),x=[],b=Math.pow(h,1/a),w=0;w{var{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:o,concat:u}=e,l=Kr({typed:t}),a=gi({typed:t,DenseMatrix:o}),s=Pr({typed:t,equalScalar:r}),f=Cr({typed:t,DenseMatrix:o}),p=tr({typed:t,matrix:n,concat:u}),h={};for(var x in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,x)&&!x.includes("Matrix")&&!x.includes("Array")&&(h[x]=i.signatures[x]);var b=t(h);return t(H5,p({elop:b,SS:a,DS:l,Ss:s,sS:f}))});g();y();v();var W5="dotDivide",Mue=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],V5=K(W5,Mue,e=>{var{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:o,concat:u}=e,l=jn({typed:t,equalScalar:n}),a=Kr({typed:t}),s=gi({typed:t,DenseMatrix:o}),f=Pr({typed:t,equalScalar:n}),p=Cr({typed:t,DenseMatrix:o}),h=tr({typed:t,matrix:r,concat:u});return t(W5,h({elop:i,SS:s,DS:a,SD:l,Ss:f,sS:p}))});g();y();v();g();y();v();function Mu(e){var{DenseMatrix:t}=e;return function(n,i,o){var u=n.size();if(u.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Kt(u)+")");var l=u[0],a=u[1];if(l!==a)throw new RangeError("Matrix must be square (size: "+Kt(u)+")");var s=[];if(Et(i)){var f=i.size(),p=i._data;if(f.length===1){if(f[0]!==l)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var h=0;h{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=Mu({DenseMatrix:l});return t(G5,{"SparseMatrix, Array | Matrix":function(h,x){return f(h,x)},"DenseMatrix, Array | Matrix":function(h,x){return s(h,x)},"Array, Array | Matrix":function(h,x){var b=r(h),w=s(b,x);return w.valueOf()}});function s(p,h){h=a(p,h,!0);for(var x=h._data,b=p._size[0],w=p._size[1],A=[],E=p._data,O=0;OI&&(P.push(A[H]),R.push(V))}if(u(C,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var W=n(F,C),ee=0,ie=R.length;ee{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=Mu({DenseMatrix:l});return t(Z5,{"SparseMatrix, Array | Matrix":function(h,x){return f(h,x)},"DenseMatrix, Array | Matrix":function(h,x){return s(h,x)},"Array, Array | Matrix":function(h,x){var b=r(h),w=s(b,x);return w.valueOf()}});function s(p,h){h=a(p,h,!0);for(var x=h._data,b=p._size[0],w=p._size[1],A=[],E=p._data,O=w-1;O>=0;O--){var M=x[O][0]||0,I=void 0;if(u(M,0))I=0;else{var F=E[O][O];if(u(F,0))throw new Error("Linear system cannot be solved since matrix is singular");I=n(M,F);for(var C=O-1;C>=0;C--)x[C]=[o(x[C][0]||0,i(I,E[C][O]))]}A[O]=[I]}return new l({data:A,size:[b,1]})}function f(p,h){h=a(p,h,!0);for(var x=h._data,b=p._size[0],w=p._size[1],A=p._values,E=p._index,O=p._ptr,M=[],I=w-1;I>=0;I--){var F=x[I][0]||0;if(u(F,0))M[I]=[0];else{for(var C=0,P=[],R=[],q=O[I],U=O[I+1],H=U-1;H>=q;H--){var V=E[H];V===I?C=A[H]:V{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=Mu({DenseMatrix:l});return t(K5,{"SparseMatrix, Array | Matrix":function(h,x){return f(h,x)},"DenseMatrix, Array | Matrix":function(h,x){return s(h,x)},"Array, Array | Matrix":function(h,x){var b=r(h),w=s(b,x);return w.map(A=>A.valueOf())}});function s(p,h){for(var x=[a(p,h,!0)._data.map(R=>R[0])],b=p._data,w=p._size[0],A=p._size[1],E=0;Enew l({data:R.map(q=>[q]),size:[w,1]}))}function f(p,h){for(var x=[a(p,h,!0)._data.map(De=>De[0])],b=p._size[0],w=p._size[1],A=p._values,E=p._index,O=p._ptr,M=0;MM&&(P.push(A[V]),R.push(W))}if(u(H,0))if(u(C[M],0)){if(F===0){var Z=[...C];Z[M]=1;for(var le=0,re=R.length;lenew l({data:De.map(we=>[we]),size:[b,1]}))}});g();y();v();var Q5="usolveAll",Fue=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],j5=K(Q5,Fue,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=Mu({DenseMatrix:l});return t(Q5,{"SparseMatrix, Array | Matrix":function(h,x){return f(h,x)},"DenseMatrix, Array | Matrix":function(h,x){return s(h,x)},"Array, Array | Matrix":function(h,x){var b=r(h),w=s(b,x);return w.map(A=>A.valueOf())}});function s(p,h){for(var x=[a(p,h,!0)._data.map(R=>R[0])],b=p._data,w=p._size[0],A=p._size[1],E=A-1;E>=0;E--)for(var O=x.length,M=0;M=0;P--)C[P]=o(C[P],b[P][E]);x.push(C)}}else{if(M===0)return[];x.splice(M,1),M-=1,O-=1}else{I[E]=n(I[E],b[E][E]);for(var F=E-1;F>=0;F--)I[F]=o(I[F],i(I[E],b[F][E]))}}return x.map(R=>new l({data:R.map(q=>[q]),size:[w,1]}))}function f(p,h){for(var x=[a(p,h,!0)._data.map(De=>De[0])],b=p._size[0],w=p._size[1],A=p._values,E=p._index,O=p._ptr,M=w-1;M>=0;M--)for(var I=x.length,F=0;F=q;V--){var W=E[V];W===M?H=A[V]:Wnew l({data:De.map(we=>[we]),size:[b,1]}))}});g();y();v();g();y();v();var _ue="matAlgo08xS0Sid",kue=["typed","equalScalar"],Th=K(_ue,kue,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,x=o._index,b=o._ptr,w=o._size,A=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Jt(f.length,w.length);if(f[0]!==w[0]||f[1]!==w[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+w+")");if(!l||!h)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var E=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===A&&p!=="mixed"&&(M=p,I=t.find(r,[M,M]),F=t.convert(0,M),C=t.find(u,[M,M]));for(var P=[],R=[],q=[],U=[],H=[],V,W,ee,ie,Y=0;Y{var{typed:t,matrix:r}=e;return{"Array, number":t.referTo("DenseMatrix, number",n=>(i,o)=>n(r(i),o).valueOf()),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",n=>(i,o)=>n(r(i),o).valueOf()),"number, Array":t.referTo("number, DenseMatrix",n=>(i,o)=>n(i,r(o)).valueOf()),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",n=>(i,o)=>n(i,r(o)).valueOf())}});var eB="leftShift",Bue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],tB=K(eB,Bue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=ho({typed:t}),a=jn({typed:t,equalScalar:n}),s=Th({typed:t,equalScalar:n}),f=Xo({typed:t,DenseMatrix:o}),p=Pr({typed:t,equalScalar:n}),h=Qn({typed:t}),x=tr({typed:t,matrix:r,concat:u}),b=Oh({typed:t,matrix:r});return t(eB,{"number, number":QS,"BigNumber, BigNumber":Hk,"bigint, bigint":(w,A)=>w<(A,E)=>n(E,0)?A.clone():p(A,E,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(A,E)=>n(E,0)?A.clone():h(A,E,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(A,E)=>n(A,0)?i(E.size(),E.storage()):f(E,A,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(A,E)=>n(A,0)?i(E.size(),E.storage()):h(E,A,w,!0))},b,x({SS:s,DS:l,SD:a}))});g();y();v();var rB="rightArithShift",Lue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],nB=K(rB,Lue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=ho({typed:t}),a=jn({typed:t,equalScalar:n}),s=Th({typed:t,equalScalar:n}),f=Xo({typed:t,DenseMatrix:o}),p=Pr({typed:t,equalScalar:n}),h=Qn({typed:t}),x=tr({typed:t,matrix:r,concat:u}),b=Oh({typed:t,matrix:r});return t(rB,{"number, number":jS,"BigNumber, BigNumber":$k,"bigint, bigint":(w,A)=>w>>A,"SparseMatrix, number | BigNumber":t.referToSelf(w=>(A,E)=>n(E,0)?A.clone():p(A,E,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(A,E)=>n(E,0)?A.clone():h(A,E,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(A,E)=>n(A,0)?i(E.size(),E.storage()):f(E,A,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(A,E)=>n(A,0)?i(E.size(),E.storage()):h(E,A,w,!0))},b,x({SS:s,DS:l,SD:a}))});g();y();v();var iB="rightLogShift",Pue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],oB=K(iB,Pue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=ho({typed:t}),a=jn({typed:t,equalScalar:n}),s=Th({typed:t,equalScalar:n}),f=Xo({typed:t,DenseMatrix:o}),p=Pr({typed:t,equalScalar:n}),h=Qn({typed:t}),x=tr({typed:t,matrix:r,concat:u}),b=Oh({typed:t,matrix:r});return t(iB,{"number, number":eA,"SparseMatrix, number | BigNumber":t.referToSelf(w=>(A,E)=>n(E,0)?A.clone():p(A,E,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(A,E)=>n(E,0)?A.clone():h(A,E,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(A,E)=>n(A,0)?i(E.size(),E.storage()):f(E,A,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(A,E)=>n(A,0)?i(E.size(),E.storage()):h(E,A,w,!0))},b,x({SS:s,DS:l,SD:a}))});g();y();v();var aB="and",Rue=["typed","matrix","equalScalar","zeros","not","concat"],hw=K(aB,Rue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=jn({typed:t,equalScalar:n}),a=Lf({typed:t,equalScalar:n}),s=Pr({typed:t,equalScalar:n}),f=Qn({typed:t}),p=tr({typed:t,matrix:r,concat:u});return t(aB,{"number, number":Zx,"Complex, Complex":function(x,b){return(x.re!==0||x.im!==0)&&(b.re!==0||b.im!==0)},"BigNumber, BigNumber":function(x,b){return!x.isZero()&&!b.isZero()&&!x.isNaN()&&!b.isNaN()},"bigint, bigint":Zx,"Unit, Unit":t.referToSelf(h=>(x,b)=>h(x.value||0,b.value||0)),"SparseMatrix, any":t.referToSelf(h=>(x,b)=>o(b)?i(x.size(),x.storage()):s(x,b,h,!1)),"DenseMatrix, any":t.referToSelf(h=>(x,b)=>o(b)?i(x.size(),x.storage()):f(x,b,h,!1)),"any, SparseMatrix":t.referToSelf(h=>(x,b)=>o(x)?i(x.size(),x.storage()):s(b,x,h,!0)),"any, DenseMatrix":t.referToSelf(h=>(x,b)=>o(x)?i(x.size(),x.storage()):f(b,x,h,!0)),"Array, any":t.referToSelf(h=>(x,b)=>h(r(x),b).valueOf()),"any, Array":t.referToSelf(h=>(x,b)=>h(x,r(b)).valueOf())},p({SS:a,DS:l}))});g();y();v();var dw="compare",que=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],sB=K(dw,que,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:o,Fraction:u,DenseMatrix:l,concat:a}=e,s=Kr({typed:t}),f=Bf({typed:t,equalScalar:n}),p=Cr({typed:t,DenseMatrix:l}),h=tr({typed:t,matrix:i,concat:a}),x=Ga({typed:t});return t(dw,zue({typed:t,config:r}),{"boolean, boolean":function(w,A){return w===A?0:w>A?1:-1},"BigNumber, BigNumber":function(w,A){return xn(w,A,r.relTol,r.absTol)?new o(0):new o(w.cmp(A))},"bigint, bigint":function(w,A){return w===A?0n:w>A?1n:-1n},"Fraction, Fraction":function(w,A){return new u(w.compare(A))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},x,h({SS:f,DS:s,Ss:p}))}),zue=K(dw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(dw,{"number, number":function(i,o){return en(i,o,r.relTol,r.absTol)?0:i>o?1:-1}})});g();y();v();var xp=rn(lB(),1);var fB="compareNatural",Uue=["typed","compare"],cB=K(fB,Uue,e=>{var{typed:t,compare:r}=e,n=r.signatures["boolean,boolean"];return t(fB,{"any, any":i});function i(a,s){var f=gr(a),p=gr(s),h;if((f==="number"||f==="BigNumber"||f==="Fraction")&&(p==="number"||p==="BigNumber"||p==="Fraction"))return h=r(a,s),h.toString()!=="0"?h>0?1:-1:(0,xp.default)(f,p);var x=["Array","DenseMatrix","SparseMatrix"];if(x.includes(f)||x.includes(p))return h=o(i,a,s),h!==0?h:(0,xp.default)(f,p);if(f!==p)return(0,xp.default)(f,p);if(f==="Complex")return Hue(a,s);if(f==="Unit")return a.equalBase(s)?i(a.value,s.value):u(i,a.formatUnits(),s.formatUnits());if(f==="boolean")return n(a,s);if(f==="string")return(0,xp.default)(a,s);if(f==="Object")return l(i,a,s);if(f==="null"||f==="undefined")return 0;throw new TypeError('Unsupported type of value "'+f+'"')}function o(a,s,f){return ga(s)&&ga(f)?u(a,s.toJSON().values,f.toJSON().values):ga(s)?o(a,s.toArray(),f):ga(f)?o(a,s,f.toArray()):dl(s)?o(a,s.toJSON().data,f):dl(f)?o(a,s,f.toJSON().data):Array.isArray(s)?Array.isArray(f)?u(a,s,f):o(a,s,[f]):o(a,[s],f)}function u(a,s,f){for(var p=0,h=Math.min(s.length,f.length);pf.length?1:s.lengtht.re?1:e.ret.im?1:e.im{var{typed:t,matrix:r,concat:n}=e,i=tr({typed:t,matrix:r,concat:n});return t(pB,qx,i({elop:qx,Ds:!0}))});g();y();v();var gw="equal",Wue=["typed","matrix","equalScalar","DenseMatrix","concat"],hB=K(gw,Wue,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=gi({typed:t,DenseMatrix:i}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:r,concat:o});return t(gw,Vue({typed:t,equalScalar:n}),s({elop:n,SS:l,DS:u,Ss:a}))}),Vue=K(gw,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(gw,{"any, any":function(i,o){return i===null?o===null:o===null?i===null:i===void 0?o===void 0:o===void 0?i===void 0:r(i,o)}})});g();y();v();var dB="equalText",Gue=["typed","compareText","isZero"],gB=K(dB,Gue,e=>{var{typed:t,compareText:r,isZero:n}=e;return t(dB,{"any, any":function(o,u){return n(r(o,u))}})});g();y();v();var vw="smaller",Yue=["typed","config","matrix","DenseMatrix","concat"],vB=K(vw,Yue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=gi({typed:t,DenseMatrix:i}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:n,concat:o}),f=Ga({typed:t});return t(vw,Zue({typed:t,config:r}),{"boolean, boolean":(p,h)=>ppp.compare(h)===-1,"Complex, Complex":function(h,x){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:l,DS:u,Ss:a}))}),Zue=K(vw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(vw,{"number, number":function(i,o){return i{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=gi({typed:t,DenseMatrix:i}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:n,concat:o}),f=Ga({typed:t});return t(yw,Kue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p<=h,"BigNumber, BigNumber":function(h,x){return h.lte(x)||xn(h,x,r.relTol,r.absTol)},"bigint, bigint":(p,h)=>p<=h,"Fraction, Fraction":(p,h)=>p.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:l,DS:u,Ss:a}))}),Kue=K(yw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(yw,{"number, number":function(i,o){return i<=o||en(i,o,r.relTol,r.absTol)}})});g();y();v();var xw="larger",Jue=["typed","config","matrix","DenseMatrix","concat"],xB=K(xw,Jue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=gi({typed:t,DenseMatrix:i}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:n,concat:o}),f=Ga({typed:t});return t(xw,Que({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>h,"BigNumber, BigNumber":function(h,x){return h.gt(x)&&!xn(h,x,r.relTol,r.absTol)},"bigint, bigint":(p,h)=>p>h,"Fraction, Fraction":(p,h)=>p.compare(h)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:l,DS:u,Ss:a}))}),Que=K(xw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(xw,{"number, number":function(i,o){return i>o&&!en(i,o,r.relTol,r.absTol)}})});g();y();v();var ww="largerEq",jue=["typed","config","matrix","DenseMatrix","concat"],wB=K(ww,jue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=gi({typed:t,DenseMatrix:i}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:n,concat:o}),f=Ga({typed:t});return t(ww,ele({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>=h,"BigNumber, BigNumber":function(h,x){return h.gte(x)||xn(h,x,r.relTol,r.absTol)},"bigint, bigint":function(h,x){return h>=x},"Fraction, Fraction":(p,h)=>p.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:l,DS:u,Ss:a}))}),ele=K(ww,["typed","config"],e=>{var{typed:t,config:r}=e;return t(ww,{"number, number":function(i,o){return i>=o||en(i,o,r.relTol,r.absTol)}})});g();y();v();var bB="deepEqual",tle=["typed","equal"],DB=K(bB,tle,e=>{var{typed:t,equal:r}=e;return t(bB,{"any, any":function(o,u){return n(o.valueOf(),u.valueOf())}});function n(i,o){if(Array.isArray(i))if(Array.isArray(o)){var u=i.length;if(u!==o.length)return!1;for(var l=0;l{var{typed:t,config:r,equalScalar:n,matrix:i,DenseMatrix:o,concat:u}=e,l=Kr({typed:t}),a=gi({typed:t,DenseMatrix:o}),s=Cr({typed:t,DenseMatrix:o}),f=tr({typed:t,matrix:i,concat:u});return t(bw,nle({typed:t,equalScalar:n}),f({elop:p,SS:a,DS:l,Ss:s}));function p(h,x){return!n(h,x)}}),nle=K(bw,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(bw,{"any, any":function(i,o){return i===null?o!==null:o===null?i!==null:i===void 0?o!==void 0:o===void 0?i!==void 0:!r(i,o)}})});g();y();v();var EB="partitionSelect",ile=["typed","isNumeric","isNaN","compare"],SB=K(EB,ile,e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,o=i,u=(s,f)=>-i(s,f);return t(EB,{"Array | Matrix, number":function(f,p){return l(f,p,o)},"Array | Matrix, number, string":function(f,p,h){if(h==="asc")return l(f,p,o);if(h==="desc")return l(f,p,u);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":l});function l(s,f,p){if(!Nt(f)||f<0)throw new Error("k must be a non-negative integer");if(Et(s)){var h=s.size();if(h.length>1)throw new Error("Only one dimensional matrices supported");return a(s.valueOf(),f,p)}if(Array.isArray(s))return a(s,f,p)}function a(s,f,p){if(f>=s.length)throw new Error("k out of bounds");for(var h=0;h=0){var O=s[A];s[A]=s[w],s[w]=O,--A}else++w;p(s[w],E)>0&&--w,f<=w?b=w:x=w+1}return s[f]}});g();y();v();var AB="sort",ole=["typed","matrix","compare","compareNatural"],CB=K(AB,ole,e=>{var{typed:t,matrix:r,compare:n,compareNatural:i}=e,o=n,u=(f,p)=>-n(f,p);return t(AB,{Array:function(p){return a(p),p.sort(o)},Matrix:function(p){return s(p),r(p.toArray().sort(o),p.storage())},"Array, function":function(p,h){return a(p),p.sort(h)},"Matrix, function":function(p,h){return s(p),r(p.toArray().sort(h),p.storage())},"Array, string":function(p,h){return a(p),p.sort(l(h))},"Matrix, string":function(p,h){return s(p),r(p.toArray().sort(l(h)),p.storage())}});function l(f){if(f==="asc")return o;if(f==="desc")return u;if(f==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function a(f){if(Wt(f).length!==1)throw new Error("One dimensional array expected")}function s(f){if(f.size().length!==1)throw new Error("One dimensional matrix expected")}});g();y();v();var MB="max",ale=["typed","config","numeric","larger"],Dw=K(MB,ale,e=>{var{typed:t,config:r,numeric:n,larger:i}=e;return t(MB,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(a,s){return kf(a,s.valueOf(),o)},"...":function(a){if(Va(a))throw new TypeError("Scalar values expected in function max");return u(a)}});function o(l,a){try{return i(l,a)?l:a}catch(s){throw Tn(s,"max",a)}}function u(l){var a;if(mo(l,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Tn(f,"max",s)}}),a===void 0)throw new Error("Cannot calculate max of an empty array");return typeof a=="string"&&(a=n(a,co(a,r))),a}});g();y();v();var TB="min",sle=["typed","config","numeric","smaller"],Nw=K(TB,sle,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e;return t(TB,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(a,s){return kf(a,s.valueOf(),o)},"...":function(a){if(Va(a))throw new TypeError("Scalar values expected in function min");return u(a)}});function o(l,a){try{return i(l,a)?l:a}catch(s){throw Tn(s,"min",a)}}function u(l){var a;if(mo(l,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Tn(f,"min",s)}}),a===void 0)throw new Error("Cannot calculate min of an empty array");return typeof a=="string"&&(a=n(a,co(a,r))),a}});g();y();v();var ule="ImmutableDenseMatrix",lle=["smaller","DenseMatrix"],OB=K(ule,lle,e=>{var{smaller:t,DenseMatrix:r}=e;function n(i,o){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(o&&!gn(o))throw new Error("Invalid datatype: "+o);if(Et(i)||pr(i)){var u=new r(i,o);this._data=u._data,this._size=u._size,this._datatype=u._datatype,this._min=null,this._max=null}else if(i&&pr(i.data)&&pr(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+gr(i)+")");this._data=[],this._size=[0],this._datatype=o,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var o=r.prototype.subset.call(this,i);return Et(o)?new n({data:o._data,size:o._size,datatype:o._datatype}):o}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:Lt(this._data),size:Lt(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(o){(i===null||t(o,i))&&(i=o)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(o){(i===null||t(i,o))&&(i=o)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0});g();y();v();var fle="Index",cle=["ImmutableDenseMatrix","getMatrixDataType"],FB=K(fle,cle,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:r}=e;function n(o){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var u=0,l=arguments.length;u{r&&t.push(n)}),t}g();y();v();var ple="FibonacciHeap",mle=["smaller","larger"],_B=K(ple,mle,e=>{var{smaller:t,larger:r}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(f,p){var h={key:f,value:p,degree:0};if(this._minimum){var x=this._minimum;h.left=x,h.right=x.right,x.right=h,h.right.left=h,t(f,x.key)&&(this._minimum=h)}else h.left=h,h.right=h,this._minimum=h;return this._size++,h},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var f=this._minimum;if(f===null)return f;for(var p=this._minimum,h=f.degree,x=f.child;h>0;){var b=x.right;x.left.right=x.right,x.right.left=x.left,x.left=p,x.right=p.right,p.right=x,x.right.left=x,x.parent=null,x=b,h--}return f.left.right=f.right,f.right.left=f.left,f===f.right?p=null:(p=f.right,p=s(p,this._size)),this._size--,this._minimum=p,f},i.prototype.remove=function(f){this._minimum=o(this._minimum,f,-1),this.extractMinimum()};function o(f,p,h){p.key=h;var x=p.parent;return x&&t(p.key,x.key)&&(u(f,p,x),l(f,x)),t(p.key,f.key)&&(f=p),f}function u(f,p,h){p.left.right=p.right,p.right.left=p.left,h.degree--,h.child===p&&(h.child=p.right),h.degree===0&&(h.child=null),p.left=f,p.right=f.right,f.right=p,p.right.left=p,p.parent=null,p.mark=!1}function l(f,p){var h=p.parent;h&&(p.mark?(u(f,p,h),l(h)):p.mark=!0)}var a=function(p,h){p.left.right=p.right,p.right.left=p.left,p.parent=h,h.child?(p.left=h.child,p.right=h.child.right,h.child.right=p,p.right.left=p):(h.child=p,p.right=p,p.left=p),h.degree++,p.mark=!1};function s(f,p){var h=Math.floor(Math.log(p)*n)+1,x=new Array(h),b=0,w=f;if(w)for(b++,w=w.right;w!==f;)b++,w=w.right;for(var A;b>0;){for(var E=w.degree,O=w.right;A=x[E],!!A;){if(r(w.key,A.key)){var M=A;A=w,w=M}a(A,w),x[E]=null,E++}x[E]=w,w=O,b--}f=null;for(var I=0;I{var{addScalar:t,equalScalar:r,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(o,u){if(this._values[o])this._values[o].value=u;else{var l=this._heap.insert(o,u);this._values[o]=l}},i.prototype.get=function(o){var u=this._values[o];return u?u.value:0},i.prototype.accumulate=function(o,u){var l=this._values[o];l?l.value=t(l.value,u):(l=this._heap.insert(o,u),this._values[o]=l)},i.prototype.forEach=function(o,u,l){var a=this._heap,s=this._values,f=[],p=a.extractMinimum();for(p&&f.push(p);p&&p.key<=u;)p.key>=o&&(r(p.value,0)||l(p.key,p.value,this)),p=a.extractMinimum(),p&&f.push(p);for(var h=0;h{var{on:t,config:r,addScalar:n,subtractScalar:i,multiplyScalar:o,divideScalar:u,pow:l,abs:a,fix:s,round:f,equal:p,isNumeric:h,format:x,number:b,Complex:w,BigNumber:A,Fraction:E}=e,O=b;function M(de,be){if(!(this instanceof M))throw new Error("Constructor must be called with the new operator");if(!(de==null||h(de)||Ni(de)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,be===void 0)this.units=[],this.dimensions=le.map(ge=>0);else if(typeof be=="string"){var Ue=M.parse(be);this.units=Ue.units,this.dimensions=Ue.dimensions}else if(ui(be)&&be.value===null)this.fixPrefix=be.fixPrefix,this.skipAutomaticSimplification=be.skipAutomaticSimplification,this.dimensions=be.dimensions.slice(0),this.units=be.units.map(ge=>Jn({},ge));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(de)}Object.defineProperty(M,"name",{value:"Unit"}),M.prototype.constructor=M,M.prototype.type="Unit",M.prototype.isUnit=!0;var I,F,C;function P(){for(;C===" "||C===" ";)U()}function R(de){return de>="0"&&de<="9"||de==="."}function q(de){return de>="0"&&de<="9"}function U(){F++,C=I.charAt(F)}function H(de){F=de,C=I.charAt(F)}function V(){var de="",be=F;if(C==="+"?U():C==="-"&&(de+=C,U()),!R(C))return H(be),null;if(C==="."){if(de+=C,U(),!q(C))return H(be),null}else{for(;q(C);)de+=C,U();C==="."&&(de+=C,U())}for(;q(C);)de+=C,U();if(C==="E"||C==="e"){var Ue="",ge=F;if(Ue+=C,U(),(C==="+"||C==="-")&&(Ue+=C,U()),!q(C))return H(ge),de;for(de=de+Ue;q(C);)de+=C,U()}return de}function W(){for(var de="";q(C)||M.isValidAlpha(C);)de+=C,U();var be=de.charAt(0);return M.isValidAlpha(be)?de:null}function ee(de){return C===de?(U(),de):null}M.parse=function(de,be){if(be=be||{},I=de,F=-1,C="",typeof I!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var Ue=new M;Ue.units=[];var ge=1,Re=!1;U(),P();var Be=V(),Ke=null;if(Be){if(r.number==="BigNumber")Ke=new A(Be);else if(r.number==="Fraction")try{Ke=new E(Be)}catch{Ke=parseFloat(Be)}else Ke=parseFloat(Be);P(),ee("*")?(ge=1,Re=!0):ee("/")&&(ge=-1,Re=!0)}for(var ot=[],Qe=1;;){for(P();C==="(";)ot.push(ge),Qe*=ge,ge=1,U(),P();var ut=void 0;if(C){var Pt=C;if(ut=W(),ut===null)throw new SyntaxError('Unexpected "'+Pt+'" in "'+I+'" at index '+F.toString())}else break;var fe=ie(ut);if(fe===null)throw new SyntaxError('Unit "'+ut+'" not found.');var J=ge*Qe;if(P(),ee("^")){P();var j=V();if(j===null)throw new SyntaxError('In "'+de+'", "^" must be followed by a floating-point number');J*=j}Ue.units.push({unit:fe.unit,prefix:fe.prefix,power:J});for(var ne=0;ne1||Math.abs(this.units[0].power-1)>1e-15},M.prototype._normalize=function(de){if(de==null||this.units.length===0)return de;for(var be=de,Ue=M._getNumberConverter(gr(de)),ge=0;ge{if(St(ce,de)){var be=ce[de],Ue=be.prefixes[""];return{unit:be,prefix:Ue}}for(var ge in ce)if(St(ce,ge)&&UF(de,ge)){var Re=ce[ge],Be=de.length-ge.length,Ke=de.substring(0,Be),ot=St(Re.prefixes,Ke)?Re.prefixes[Ke]:void 0;if(ot!==void 0)return{unit:Re,prefix:ot}}return null},{hasher:de=>de[0],limit:100});M.isValuelessUnit=function(de){return ie(de)!==null},M.prototype.hasBase=function(de){if(typeof de=="string"&&(de=re[de]),!de)return!1;for(var be=0;be1e-12)return!1;return!0},M.prototype.equalBase=function(de){for(var be=0;be1e-12)return!1;return!0},M.prototype.equals=function(de){return this.equalBase(de)&&p(this.value,de.value)},M.prototype.multiply=function(de){for(var be=this.clone(),Ue=ui(de)?de:new M(de),ge=0;ge0?this.formatUnits():null,fixPrefix:this.fixPrefix}},M.fromJSON=function(de){var be,Ue=new M(de.value,(be=de.unit)!==null&&be!==void 0?be:void 0);return Ue.fixPrefix=de.fixPrefix||!1,Ue},M.prototype.valueOf=M.prototype.toString,M.prototype.simplify=function(){var de=this.clone(),be=[],Ue;for(var ge in Oe)if(St(Oe,ge)&&de.hasBase(re[ge])){Ue=ge;break}if(Ue==="NONE")de.units=[];else{var Re;if(Ue&&St(Oe,Ue)&&(Re=Oe[Ue]),Re)de.units=[{unit:Re.unit,prefix:Re.prefix,power:1}];else{for(var Be=!1,Ke=0;Ke1e-12&&(St(Oe,ot)?be.push({unit:Oe[ot].unit,prefix:Oe[ot].prefix,power:de.dimensions[Ke]||0}):Be=!0)}be.length1e-12)if(St(Ce.si,ge))be.push({unit:Ce.si[ge].unit,prefix:Ce.si[ge].prefix,power:de.dimensions[Ue]||0});else throw new Error("Cannot express custom unit "+ge+" in SI units")}return de.units=be,de.fixPrefix=!0,de.skipAutomaticSimplification=!0,this.value!==null?(de.value=null,this.to(de)):de},M.prototype.formatUnits=function(){for(var de="",be="",Ue=0,ge=0,Re=0;Re0?(Ue++,de+=" "+this.units[Re].prefix.name+this.units[Re].unit.name,Math.abs(this.units[Re].power-1)>1e-15&&(de+="^"+this.units[Re].power)):this.units[Re].power<0&&ge++;if(ge>0)for(var Be=0;Be0?(be+=" "+this.units[Be].prefix.name+this.units[Be].unit.name,Math.abs(this.units[Be].power+1)>1e-15&&(be+="^"+-this.units[Be].power)):(be+=" "+this.units[Be].prefix.name+this.units[Be].unit.name,be+="^"+this.units[Be].power));de=de.substr(1),be=be.substr(1),Ue>1&&ge>0&&(de="("+de+")"),ge>1&&Ue>0&&(be="("+be+")");var Ke=de;return Ue>0&&ge>0&&(Ke+=" / "),Ke+=be,Ke},M.prototype.format=function(de){var be=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),Ue=!1;typeof be.value<"u"&&be.value!==null&&Ni(be.value)&&(Ue=Math.abs(be.value.re)<1e-14);for(var ge in be.units)St(be.units,ge)&&be.units[ge].unit&&(be.units[ge].unit.name==="VA"&&Ue?be.units[ge].unit=ce.VAR:be.units[ge].unit.name==="VAR"&&!Ue&&(be.units[ge].unit=ce.VA));be.units.length===1&&!be.fixPrefix&&Math.abs(be.units[0].power-Math.round(be.units[0].power))<1e-14&&(be.units[0].prefix=be._bestPrefix());var Re=be._denormalize(be.value),Be=be.value!==null?x(Re,de||{}):"",Ke=be.formatUnits();return be.value&&Ni(be.value)&&(Be="("+Be+")"),Ke.length>0&&Be.length>0&&(Be+=" "),Be+=Ke,Be},M.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var de=this.value!==null?a(this.value):0,be=a(this.units[0].unit.value),Ue=this.units[0].prefix;if(de===0)return Ue;var ge=this.units[0].power,Re=Math.log(de/Math.pow(Ue.value*be,ge))/Math.LN10-1.2;if(Re>-2.200001&&Re<1.800001)return Ue;Re=Math.abs(Re);var Be=this.units[0].unit.prefixes;for(var Ke in Be)if(St(Be,Ke)){var ot=Be[Ke];if(ot.scientific){var Qe=Math.abs(Math.log(de/Math.pow(ot.value*be,ge))/Math.LN10-1.2);(Qe0)},ce={meter:{name:"meter",base:re.LENGTH,prefixes:Z.LONG,value:1,offset:0},inch:{name:"inch",base:re.LENGTH,prefixes:Z.NONE,value:.0254,offset:0},foot:{name:"foot",base:re.LENGTH,prefixes:Z.NONE,value:.3048,offset:0},yard:{name:"yard",base:re.LENGTH,prefixes:Z.NONE,value:.9144,offset:0},mile:{name:"mile",base:re.LENGTH,prefixes:Z.NONE,value:1609.344,offset:0},link:{name:"link",base:re.LENGTH,prefixes:Z.NONE,value:.201168,offset:0},rod:{name:"rod",base:re.LENGTH,prefixes:Z.NONE,value:5.0292,offset:0},chain:{name:"chain",base:re.LENGTH,prefixes:Z.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:re.LENGTH,prefixes:Z.NONE,value:1e-10,offset:0},m:{name:"m",base:re.LENGTH,prefixes:Z.SHORT,value:1,offset:0},in:{name:"in",base:re.LENGTH,prefixes:Z.NONE,value:.0254,offset:0},ft:{name:"ft",base:re.LENGTH,prefixes:Z.NONE,value:.3048,offset:0},yd:{name:"yd",base:re.LENGTH,prefixes:Z.NONE,value:.9144,offset:0},mi:{name:"mi",base:re.LENGTH,prefixes:Z.NONE,value:1609.344,offset:0},li:{name:"li",base:re.LENGTH,prefixes:Z.NONE,value:.201168,offset:0},rd:{name:"rd",base:re.LENGTH,prefixes:Z.NONE,value:5.02921,offset:0},ch:{name:"ch",base:re.LENGTH,prefixes:Z.NONE,value:20.1168,offset:0},mil:{name:"mil",base:re.LENGTH,prefixes:Z.NONE,value:254e-7,offset:0},m2:{name:"m2",base:re.SURFACE,prefixes:Z.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:re.SURFACE,prefixes:Z.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:re.SURFACE,prefixes:Z.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:re.SURFACE,prefixes:Z.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:re.SURFACE,prefixes:Z.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:re.SURFACE,prefixes:Z.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:re.SURFACE,prefixes:Z.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:re.SURFACE,prefixes:Z.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:re.SURFACE,prefixes:Z.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:re.SURFACE,prefixes:Z.NONE,value:1e4,offset:0},m3:{name:"m3",base:re.VOLUME,prefixes:Z.CUBIC,value:1,offset:0},L:{name:"L",base:re.VOLUME,prefixes:Z.SHORT,value:.001,offset:0},l:{name:"l",base:re.VOLUME,prefixes:Z.SHORT,value:.001,offset:0},litre:{name:"litre",base:re.VOLUME,prefixes:Z.LONG,value:.001,offset:0},cuin:{name:"cuin",base:re.VOLUME,prefixes:Z.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:re.VOLUME,prefixes:Z.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:re.VOLUME,prefixes:Z.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:re.VOLUME,prefixes:Z.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:re.VOLUME,prefixes:Z.NONE,value:15e-6,offset:0},drop:{name:"drop",base:re.VOLUME,prefixes:Z.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:re.VOLUME,prefixes:Z.NONE,value:5e-8,offset:0},minim:{name:"minim",base:re.VOLUME,prefixes:Z.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:re.VOLUME,prefixes:Z.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:re.VOLUME,prefixes:Z.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:re.VOLUME,prefixes:Z.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:re.VOLUME,prefixes:Z.NONE,value:1e-6,offset:0},cup:{name:"cup",base:re.VOLUME,prefixes:Z.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:re.VOLUME,prefixes:Z.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:re.VOLUME,prefixes:Z.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:re.VOLUME,prefixes:Z.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:re.VOLUME,prefixes:Z.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:re.VOLUME,prefixes:Z.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:re.VOLUME,prefixes:Z.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:re.VOLUME,prefixes:Z.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:re.VOLUME,prefixes:Z.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:re.VOLUME,prefixes:Z.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:re.VOLUME,prefixes:Z.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:re.VOLUME,prefixes:Z.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:re.VOLUME,prefixes:Z.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:re.VOLUME,prefixes:Z.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:re.VOLUME,prefixes:Z.NONE,value:.1173478,offset:0},obl:{name:"obl",base:re.VOLUME,prefixes:Z.NONE,value:.1589873,offset:0},g:{name:"g",base:re.MASS,prefixes:Z.SHORT,value:.001,offset:0},gram:{name:"gram",base:re.MASS,prefixes:Z.LONG,value:.001,offset:0},ton:{name:"ton",base:re.MASS,prefixes:Z.SHORT,value:907.18474,offset:0},t:{name:"t",base:re.MASS,prefixes:Z.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:re.MASS,prefixes:Z.LONG,value:1e3,offset:0},grain:{name:"grain",base:re.MASS,prefixes:Z.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:re.MASS,prefixes:Z.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:re.MASS,prefixes:Z.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:re.MASS,prefixes:Z.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:re.MASS,prefixes:Z.NONE,value:45.359237,offset:0},stick:{name:"stick",base:re.MASS,prefixes:Z.NONE,value:.115,offset:0},stone:{name:"stone",base:re.MASS,prefixes:Z.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:re.MASS,prefixes:Z.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:re.MASS,prefixes:Z.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:re.MASS,prefixes:Z.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:re.MASS,prefixes:Z.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:re.MASS,prefixes:Z.NONE,value:45.359237,offset:0},s:{name:"s",base:re.TIME,prefixes:Z.SHORT,value:1,offset:0},min:{name:"min",base:re.TIME,prefixes:Z.NONE,value:60,offset:0},h:{name:"h",base:re.TIME,prefixes:Z.NONE,value:3600,offset:0},second:{name:"second",base:re.TIME,prefixes:Z.LONG,value:1,offset:0},sec:{name:"sec",base:re.TIME,prefixes:Z.LONG,value:1,offset:0},minute:{name:"minute",base:re.TIME,prefixes:Z.NONE,value:60,offset:0},hour:{name:"hour",base:re.TIME,prefixes:Z.NONE,value:3600,offset:0},day:{name:"day",base:re.TIME,prefixes:Z.NONE,value:86400,offset:0},week:{name:"week",base:re.TIME,prefixes:Z.NONE,value:7*86400,offset:0},month:{name:"month",base:re.TIME,prefixes:Z.NONE,value:2629800,offset:0},year:{name:"year",base:re.TIME,prefixes:Z.NONE,value:31557600,offset:0},decade:{name:"decade",base:re.TIME,prefixes:Z.NONE,value:315576e3,offset:0},century:{name:"century",base:re.TIME,prefixes:Z.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:re.TIME,prefixes:Z.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:re.FREQUENCY,prefixes:Z.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:re.FREQUENCY,prefixes:Z.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:re.ANGLE,prefixes:Z.SHORT,value:1,offset:0},radian:{name:"radian",base:re.ANGLE,prefixes:Z.LONG,value:1,offset:0},deg:{name:"deg",base:re.ANGLE,prefixes:Z.SHORT,value:null,offset:0},degree:{name:"degree",base:re.ANGLE,prefixes:Z.LONG,value:null,offset:0},grad:{name:"grad",base:re.ANGLE,prefixes:Z.SHORT,value:null,offset:0},gradian:{name:"gradian",base:re.ANGLE,prefixes:Z.LONG,value:null,offset:0},cycle:{name:"cycle",base:re.ANGLE,prefixes:Z.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:re.ANGLE,prefixes:Z.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:re.ANGLE,prefixes:Z.NONE,value:null,offset:0},A:{name:"A",base:re.CURRENT,prefixes:Z.SHORT,value:1,offset:0},ampere:{name:"ampere",base:re.CURRENT,prefixes:Z.LONG,value:1,offset:0},K:{name:"K",base:re.TEMPERATURE,prefixes:Z.SHORT,value:1,offset:0},degC:{name:"degC",base:re.TEMPERATURE,prefixes:Z.SHORT,value:1,offset:273.15},degF:{name:"degF",base:re.TEMPERATURE,prefixes:Z.SHORT,value:new E(5,9),offset:459.67},degR:{name:"degR",base:re.TEMPERATURE,prefixes:Z.SHORT,value:new E(5,9),offset:0},kelvin:{name:"kelvin",base:re.TEMPERATURE,prefixes:Z.LONG,value:1,offset:0},celsius:{name:"celsius",base:re.TEMPERATURE,prefixes:Z.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:re.TEMPERATURE,prefixes:Z.LONG,value:new E(5,9),offset:459.67},rankine:{name:"rankine",base:re.TEMPERATURE,prefixes:Z.LONG,value:new E(5,9),offset:0},mol:{name:"mol",base:re.AMOUNT_OF_SUBSTANCE,prefixes:Z.SHORT,value:1,offset:0},mole:{name:"mole",base:re.AMOUNT_OF_SUBSTANCE,prefixes:Z.LONG,value:1,offset:0},cd:{name:"cd",base:re.LUMINOUS_INTENSITY,prefixes:Z.SHORT,value:1,offset:0},candela:{name:"candela",base:re.LUMINOUS_INTENSITY,prefixes:Z.LONG,value:1,offset:0},N:{name:"N",base:re.FORCE,prefixes:Z.SHORT,value:1,offset:0},newton:{name:"newton",base:re.FORCE,prefixes:Z.LONG,value:1,offset:0},dyn:{name:"dyn",base:re.FORCE,prefixes:Z.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:re.FORCE,prefixes:Z.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:re.FORCE,prefixes:Z.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:re.FORCE,prefixes:Z.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:re.FORCE,prefixes:Z.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:re.FORCE,prefixes:Z.NONE,value:9.80665,offset:0},J:{name:"J",base:re.ENERGY,prefixes:Z.SHORT,value:1,offset:0},joule:{name:"joule",base:re.ENERGY,prefixes:Z.LONG,value:1,offset:0},erg:{name:"erg",base:re.ENERGY,prefixes:Z.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:re.ENERGY,prefixes:Z.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:re.ENERGY,prefixes:Z.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:re.ENERGY,prefixes:Z.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:re.ENERGY,prefixes:Z.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:re.POWER,prefixes:Z.SHORT,value:1,offset:0},watt:{name:"watt",base:re.POWER,prefixes:Z.LONG,value:1,offset:0},hp:{name:"hp",base:re.POWER,prefixes:Z.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:re.POWER,prefixes:Z.SHORT,value:w.I,offset:0},VA:{name:"VA",base:re.POWER,prefixes:Z.SHORT,value:1,offset:0},Pa:{name:"Pa",base:re.PRESSURE,prefixes:Z.SHORT,value:1,offset:0},psi:{name:"psi",base:re.PRESSURE,prefixes:Z.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:re.PRESSURE,prefixes:Z.NONE,value:101325,offset:0},bar:{name:"bar",base:re.PRESSURE,prefixes:Z.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:re.PRESSURE,prefixes:Z.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:re.PRESSURE,prefixes:Z.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:re.PRESSURE,prefixes:Z.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:re.PRESSURE,prefixes:Z.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:re.ELECTRIC_CHARGE,prefixes:Z.LONG,value:1,offset:0},C:{name:"C",base:re.ELECTRIC_CHARGE,prefixes:Z.SHORT,value:1,offset:0},farad:{name:"farad",base:re.ELECTRIC_CAPACITANCE,prefixes:Z.LONG,value:1,offset:0},F:{name:"F",base:re.ELECTRIC_CAPACITANCE,prefixes:Z.SHORT,value:1,offset:0},volt:{name:"volt",base:re.ELECTRIC_POTENTIAL,prefixes:Z.LONG,value:1,offset:0},V:{name:"V",base:re.ELECTRIC_POTENTIAL,prefixes:Z.SHORT,value:1,offset:0},ohm:{name:"ohm",base:re.ELECTRIC_RESISTANCE,prefixes:Z.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:re.ELECTRIC_INDUCTANCE,prefixes:Z.LONG,value:1,offset:0},H:{name:"H",base:re.ELECTRIC_INDUCTANCE,prefixes:Z.SHORT,value:1,offset:0},siemens:{name:"siemens",base:re.ELECTRIC_CONDUCTANCE,prefixes:Z.LONG,value:1,offset:0},S:{name:"S",base:re.ELECTRIC_CONDUCTANCE,prefixes:Z.SHORT,value:1,offset:0},weber:{name:"weber",base:re.MAGNETIC_FLUX,prefixes:Z.LONG,value:1,offset:0},Wb:{name:"Wb",base:re.MAGNETIC_FLUX,prefixes:Z.SHORT,value:1,offset:0},tesla:{name:"tesla",base:re.MAGNETIC_FLUX_DENSITY,prefixes:Z.LONG,value:1,offset:0},T:{name:"T",base:re.MAGNETIC_FLUX_DENSITY,prefixes:Z.SHORT,value:1,offset:0},b:{name:"b",base:re.BIT,prefixes:Z.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:re.BIT,prefixes:Z.BINARY_LONG,value:1,offset:0},B:{name:"B",base:re.BIT,prefixes:Z.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:re.BIT,prefixes:Z.BINARY_LONG,value:8,offset:0}},Ee={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",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",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 Pe(de){if(de.number==="BigNumber"){var be=Iv(A);ce.rad.value=new A(1),ce.deg.value=be.div(180),ce.grad.value=be.div(200),ce.cycle.value=be.times(2),ce.arcsec.value=be.div(648e3),ce.arcmin.value=be.div(10800)}else ce.rad.value=1,ce.deg.value=Math.PI/180,ce.grad.value=Math.PI/200,ce.cycle.value=Math.PI*2,ce.arcsec.value=Math.PI/648e3,ce.arcmin.value=Math.PI/10800;ce.radian.value=ce.rad.value,ce.degree.value=ce.deg.value,ce.gradian.value=ce.grad.value}Pe(r),t&&t("config",function(de,be){de.number!==be.number&&Pe(de)});var Ce={si:{NONE:{unit:we,prefix:Z.NONE[""]},LENGTH:{unit:ce.m,prefix:Z.SHORT[""]},MASS:{unit:ce.g,prefix:Z.SHORT.k},TIME:{unit:ce.s,prefix:Z.SHORT[""]},CURRENT:{unit:ce.A,prefix:Z.SHORT[""]},TEMPERATURE:{unit:ce.K,prefix:Z.SHORT[""]},LUMINOUS_INTENSITY:{unit:ce.cd,prefix:Z.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:ce.mol,prefix:Z.SHORT[""]},ANGLE:{unit:ce.rad,prefix:Z.SHORT[""]},BIT:{unit:ce.bits,prefix:Z.SHORT[""]},FORCE:{unit:ce.N,prefix:Z.SHORT[""]},ENERGY:{unit:ce.J,prefix:Z.SHORT[""]},POWER:{unit:ce.W,prefix:Z.SHORT[""]},PRESSURE:{unit:ce.Pa,prefix:Z.SHORT[""]},ELECTRIC_CHARGE:{unit:ce.C,prefix:Z.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:ce.F,prefix:Z.SHORT[""]},ELECTRIC_POTENTIAL:{unit:ce.V,prefix:Z.SHORT[""]},ELECTRIC_RESISTANCE:{unit:ce.ohm,prefix:Z.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:ce.H,prefix:Z.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:ce.S,prefix:Z.SHORT[""]},MAGNETIC_FLUX:{unit:ce.Wb,prefix:Z.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:ce.T,prefix:Z.SHORT[""]},FREQUENCY:{unit:ce.Hz,prefix:Z.SHORT[""]}}};Ce.cgs=JSON.parse(JSON.stringify(Ce.si)),Ce.cgs.LENGTH={unit:ce.m,prefix:Z.SHORT.c},Ce.cgs.MASS={unit:ce.g,prefix:Z.SHORT[""]},Ce.cgs.FORCE={unit:ce.dyn,prefix:Z.SHORT[""]},Ce.cgs.ENERGY={unit:ce.erg,prefix:Z.NONE[""]},Ce.us=JSON.parse(JSON.stringify(Ce.si)),Ce.us.LENGTH={unit:ce.ft,prefix:Z.NONE[""]},Ce.us.MASS={unit:ce.lbm,prefix:Z.NONE[""]},Ce.us.TEMPERATURE={unit:ce.degF,prefix:Z.NONE[""]},Ce.us.FORCE={unit:ce.lbf,prefix:Z.NONE[""]},Ce.us.ENERGY={unit:ce.BTU,prefix:Z.BTU[""]},Ce.us.POWER={unit:ce.hp,prefix:Z.NONE[""]},Ce.us.PRESSURE={unit:ce.psi,prefix:Z.NONE[""]},Ce.auto=JSON.parse(JSON.stringify(Ce.si));var Oe=Ce.auto;M.setUnitSystem=function(de){if(St(Ce,de))Oe=Ce[de];else throw new Error("Unit system "+de+" does not exist. Choices are: "+Object.keys(Ce).join(", "))},M.getUnitSystem=function(){for(var de in Ce)if(St(Ce,de)&&Ce[de]===Oe)return de},M.typeConverters={BigNumber:function(be){return be!=null&&be.isFraction?new A(be.n).div(be.d).times(be.s):new A(be+"")},Fraction:function(be){return new E(be)},Complex:function(be){return be},number:function(be){return be!=null&&be.isFraction?b(be):be}},M.prototype._numberConverter=function(){var de=M.typeConverters[this.valueType()];if(de)return de;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},M._getNumberConverter=function(de){if(!M.typeConverters[de])throw new TypeError('Unsupported type "'+de+'"');return M.typeConverters[de]};for(var He in ce)if(St(ce,He)){var Se=ce[He];Se.dimensions=Se.base.dimensions}for(var ze in Ee)if(St(Ee,ze)){var We=ce[Ee[ze]],Le={};for(var lt in We)St(We,lt)&&(Le[lt]=We[lt]);Le.name=ze,ce[ze]=Le}M.isValidAlpha=function(be){return/^[a-zA-Z]$/.test(be)};function ct(de){for(var be=0;be0&&!(M.isValidAlpha(C)||q(C)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+de+'"')}}return M.createUnit=function(de,be){if(typeof de!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(be&&be.override){for(var Ue in de)if(St(de,Ue)&&M.deleteUnit(Ue),de[Ue].aliases)for(var ge=0;ge"u"||be===null)&&(be={}),typeof de!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(St(ce,de))throw new Error('Cannot create unit "'+de+'": a unit with that name already exists');ct(de);var Ue=null,ge=[],Re=0,Be,Ke,ot;if(be&&be.type==="Unit")Ue=be.clone();else if(typeof be=="string")be!==""&&(Be=be);else if(typeof be=="object")Be=be.definition,Ke=be.prefixes,Re=be.offset,ot=be.baseName,be.aliases&&(ge=be.aliases.valueOf());else throw new TypeError('Cannot create unit "'+de+'" from "'+be.toString()+'": expecting "string" or "Unit" or "Object"');if(ge){for(var Qe=0;Qe1e-12){me=!1;break}if(me){j=!0,ut.base=re[ne];break}}if(!j){ot=ot||de+"_STUFF";var _e={dimensions:Ue.dimensions.slice(0)};_e.key=ot,re[ot]=_e,Oe[ot]={unit:ut,prefix:Z.NONE[""]},ut.base=re[ot]}}else{if(ot=ot||de+"_STUFF",le.indexOf(ot)>=0)throw new Error('Cannot create new base unit "'+de+'": a base unit with that name already exists (and cannot be overridden)');le.push(ot);for(var Pt in re)St(re,Pt)&&(re[Pt].dimensions[le.length-1]=0);for(var fe={dimensions:[]},J=0;J{var{typed:t,Unit:r}=e;return t(zB,{Unit:function(i){return i.clone()},string:function(i){return r.isValuelessUnit(i)?new r(null,i):r.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,o){return new r(i,o)},"number | BigNumber | Fraction":function(i){return new r(i)},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();y();v();var HB="sparse",xle=["typed","SparseMatrix"],$B=K(HB,xle,e=>{var{typed:t,SparseMatrix:r}=e;return t(HB,{"":function(){return new r([])},string:function(i){return new r([],i)},"Array | Matrix":function(i){return new r(i)},"Array | Matrix, string":function(i,o){return new r(i,o)}})});g();y();v();var WB="createUnit",wle=["typed","Unit"],VB=K(WB,wle,e=>{var{typed:t,Unit:r}=e;return t(WB,{"Object, Object":function(i,o){return r.createUnit(i,o)},Object:function(i){return r.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,o,u){var l={};return l[i]=o,r.createUnit(l,u)},"string, Unit | string | Object":function(i,o){var u={};return u[i]=o,r.createUnit(u,{})},string:function(i){var o={};return o[i]={},r.createUnit(o,{})}})});g();y();v();var GB="acos",ble=["typed","config","Complex"],YB=K(GB,ble,e=>{var{typed:t,config:r,Complex:n}=e;return t(GB,{number:function(o){return o>=-1&&o<=1||r.predictable?Math.acos(o):new n(o,0).acos()},Complex:function(o){return o.acos()},BigNumber:function(o){return o.acos()}})});g();y();v();var ZB="acosh",Dle=["typed","config","Complex"],XB=K(ZB,Dle,e=>{var{typed:t,config:r,Complex:n}=e;return t(ZB,{number:function(o){return o>=1||r.predictable?aA(o):o<=-1?new n(Math.log(Math.sqrt(o*o-1)-o),Math.PI):new n(o,0).acosh()},Complex:function(o){return o.acosh()},BigNumber:function(o){return o.acosh()}})});g();y();v();var KB="acot",Nle=["typed","BigNumber"],JB=K(KB,Nle,e=>{var{typed:t,BigNumber:r}=e;return t(KB,{number:sA,Complex:function(i){return i.acot()},BigNumber:function(i){return new r(1).div(i).atan()}})});g();y();v();var QB="acoth",Ele=["typed","config","Complex","BigNumber"],jB=K(QB,Ele,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(QB,{number:function(u){return u>=1||u<=-1||r.predictable?uA(u):new n(u,0).acoth()},Complex:function(u){return u.acoth()},BigNumber:function(u){return new i(1).div(u).atanh()}})});g();y();v();var eL="acsc",Sle=["typed","config","Complex","BigNumber"],tL=K(eL,Sle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(eL,{number:function(u){return u<=-1||u>=1||r.predictable?lA(u):new n(u,0).acsc()},Complex:function(u){return u.acsc()},BigNumber:function(u){return new i(1).div(u).asin()}})});g();y();v();var rL="acsch",Ale=["typed","BigNumber"],nL=K(rL,Ale,e=>{var{typed:t,BigNumber:r}=e;return t(rL,{number:fA,Complex:function(i){return i.acsch()},BigNumber:function(i){return new r(1).div(i).asinh()}})});g();y();v();var iL="asec",Cle=["typed","config","Complex","BigNumber"],oL=K(iL,Cle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(iL,{number:function(u){return u<=-1||u>=1||r.predictable?cA(u):new n(u,0).asec()},Complex:function(u){return u.asec()},BigNumber:function(u){return new i(1).div(u).acos()}})});g();y();v();var aL="asech",Mle=["typed","config","Complex","BigNumber"],sL=K(aL,Mle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(aL,{number:function(u){if(u<=1&&u>=-1||r.predictable){var l=1/u;if(l>0||r.predictable)return pA(u);var a=Math.sqrt(l*l-1);return new n(Math.log(a-l),Math.PI)}return new n(u,0).asech()},Complex:function(u){return u.asech()},BigNumber:function(u){return new i(1).div(u).acosh()}})});g();y();v();var uL="asin",Tle=["typed","config","Complex"],lL=K(uL,Tle,e=>{var{typed:t,config:r,Complex:n}=e;return t(uL,{number:function(o){return o>=-1&&o<=1||r.predictable?Math.asin(o):new n(o,0).asin()},Complex:function(o){return o.asin()},BigNumber:function(o){return o.asin()}})});g();y();v();var Ole="asinh",Ile=["typed"],fL=K(Ole,Ile,e=>{var{typed:t}=e;return t("asinh",{number:mA,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});g();y();v();var Fle="atan",_le=["typed"],cL=K(Fle,_le,e=>{var{typed:t}=e;return t("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})});g();y();v();var pL="atan2",kle=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],mL=K(pL,kle,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:o,concat:u}=e,l=jn({typed:t,equalScalar:n}),a=Kr({typed:t}),s=jx({typed:t,equalScalar:n}),f=Pr({typed:t,equalScalar:n}),p=Cr({typed:t,DenseMatrix:o}),h=tr({typed:t,matrix:r,concat:u});return t(pL,{"number, number":Math.atan2,"BigNumber, BigNumber":(x,b)=>i.atan2(x,b)},h({scalar:"number | BigNumber",SS:s,DS:a,SD:l,Ss:f,sS:p}))});g();y();v();var hL="atanh",Ble=["typed","config","Complex"],dL=K(hL,Ble,e=>{var{typed:t,config:r,Complex:n}=e;return t(hL,{number:function(o){return o<=1&&o>=-1||r.predictable?hA(o):new n(o,0).atanh()},Complex:function(o){return o.atanh()},BigNumber:function(o){return o.atanh()}})});g();y();v();g();y();v();var Za=K("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(r=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(r,n.valueType())(n.value)})}});var gL="cos",Lle=["typed"],vL=K(gL,Lle,e=>{var{typed:t}=e,r=Za({typed:t});return t(gL,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)});g();y();v();var yL="cosh",Ple=["typed"],xL=K(yL,Ple,e=>{var{typed:t}=e;return t(yL,{number:Sx,"Complex | BigNumber":r=>r.cosh()})});g();y();v();var wL="cot",Rle=["typed","BigNumber"],bL=K(wL,Rle,e=>{var{typed:t,BigNumber:r}=e,n=Za({typed:t});return t(wL,{number:dA,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)});g();y();v();var DL="coth",qle=["typed","BigNumber"],NL=K(DL,qle,e=>{var{typed:t,BigNumber:r}=e;return t(DL,{number:gA,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})});g();y();v();var EL="csc",zle=["typed","BigNumber"],SL=K(EL,zle,e=>{var{typed:t,BigNumber:r}=e,n=Za({typed:t});return t(EL,{number:vA,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)});g();y();v();var AL="csch",Ule=["typed","BigNumber"],CL=K(AL,Ule,e=>{var{typed:t,BigNumber:r}=e;return t(AL,{number:yA,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})});g();y();v();var ML="sec",Hle=["typed","BigNumber"],TL=K(ML,Hle,e=>{var{typed:t,BigNumber:r}=e,n=Za({typed:t});return t(ML,{number:xA,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)});g();y();v();var OL="sech",$le=["typed","BigNumber"],IL=K(OL,$le,e=>{var{typed:t,BigNumber:r}=e;return t(OL,{number:wA,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})});g();y();v();var FL="sin",Wle=["typed"],_L=K(FL,Wle,e=>{var{typed:t}=e,r=Za({typed:t});return t(FL,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)});g();y();v();var kL="sinh",Vle=["typed"],BL=K(kL,Vle,e=>{var{typed:t}=e;return t(kL,{number:bA,"Complex | BigNumber":r=>r.sinh()})});g();y();v();var LL="tan",Gle=["typed"],PL=K(LL,Gle,e=>{var{typed:t}=e,r=Za({typed:t});return t(LL,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)});g();y();v();var Yle="tanh",Zle=["typed"],RL=K(Yle,Zle,e=>{var{typed:t}=e;return t("tanh",{number:Ax,"Complex | BigNumber":r=>r.tanh()})});g();y();v();var qL="setCartesian",Xle=["typed","size","subset","compareNatural","Index","DenseMatrix"],zL=K(qL,Xle,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t(qL,{"Array | Matrix, Array | Matrix":function(a,s){var f=[];if(n(r(a),new o(0))!==0&&n(r(s),new o(0))!==0){var p=nr(Array.isArray(a)?a:a.toArray()).sort(i),h=nr(Array.isArray(s)?s:s.toArray()).sort(i);f=[];for(var x=0;x{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t(UL,{"Array | Matrix, Array | Matrix":function(a,s){var f;if(n(r(a),new o(0))===0)f=[];else{if(n(r(s),new o(0))===0)return nr(a.toArray());var p=xl(nr(Array.isArray(a)?a:a.toArray()).sort(i)),h=xl(nr(Array.isArray(s)?s:s.toArray()).sort(i));f=[];for(var x,b=0;b{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t($L,{"Array | Matrix":function(a){var s;if(n(r(a),new o(0))===0)s=[];else{var f=nr(Array.isArray(a)?a:a.toArray()).sort(i);s=[],s.push(f[0]);for(var p=1;p{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t(VL,{"Array | Matrix, Array | Matrix":function(a,s){var f;if(n(r(a),new o(0))===0||n(r(s),new o(0))===0)f=[];else{var p=xl(nr(Array.isArray(a)?a:a.toArray()).sort(i)),h=xl(nr(Array.isArray(s)?s:s.toArray()).sort(i));f=[];for(var x=0;x{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(YL,{"Array | Matrix, Array | Matrix":function(l,a){if(n(r(l),new o(0))===0)return!0;if(n(r(a),new o(0))===0)return!1;for(var s=xl(nr(Array.isArray(l)?l:l.toArray()).sort(i)),f=xl(nr(Array.isArray(a)?a:a.toArray()).sort(i)),p,h=0;h{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(XL,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(l,a){if(n(r(a),new o(0))===0)return 0;for(var s=nr(Array.isArray(a)?a:a.toArray()),f=0,p=0;p{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(JL,{"Array | Matrix":function(s){if(n(r(s),new o(0))===0)return[];for(var f=nr(Array.isArray(s)?s:s.toArray()).sort(i),p=[],h=0;h.toString(2).length<=f.length;)p.push(u(f,h.toString(2).split("").reverse())),h++;return l(p)}});function u(a,s){for(var f=[],p=0;p0;f--)for(var p=0;pa[p+1].length&&(s=a[p],a[p]=a[p+1],a[p+1]=s);return a}});g();y();v();var jL="setSize",rfe=["typed","compareNatural"],e6=K(jL,rfe,e=>{var{typed:t,compareNatural:r}=e;return t(jL,{"Array | Matrix":function(i){return Array.isArray(i)?nr(i).length:nr(i.toArray()).length},"Array | Matrix, boolean":function(i,o){if(o===!1||i.length===0)return Array.isArray(i)?nr(i).length:nr(i.toArray()).length;for(var u=nr(Array.isArray(i)?i:i.toArray()).sort(r),l=1,a=1;a{var{typed:t,size:r,concat:n,subset:i,setDifference:o,Index:u}=e;return t(t6,{"Array | Matrix, Array | Matrix":function(a,s){if(i(r(a),new u(0))===0)return nr(s);if(i(r(s),new u(0))===0)return nr(a);var f=nr(a),p=nr(s);return n(o(f,p),o(p,f))}})});g();y();v();var n6="setUnion",ife=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],i6=K(n6,ife,e=>{var{typed:t,size:r,concat:n,subset:i,setIntersect:o,setSymDifference:u,Index:l}=e;return t(n6,{"Array | Matrix, Array | Matrix":function(s,f){if(i(r(s),new l(0))===0)return nr(f);if(i(r(f),new l(0))===0)return nr(s);var p=nr(s),h=nr(f);return n(u(p,h),o(p,h))}})});g();y();v();var o6="add",ofe=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],a6=K(o6,ofe,e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:o,SparseMatrix:u,concat:l}=e,a=ho({typed:t}),s=Eh({typed:t,equalScalar:i}),f=Xo({typed:t,DenseMatrix:o}),p=tr({typed:t,matrix:r,concat:l});return t(o6,{"any, any":n,"any, any, ...any":t.referToSelf(h=>(x,b,w)=>{for(var A=h(x,b),E=0;E{var{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:o,sqrt:u,smaller:l,isPositive:a}=e;return t(s6,{"... number | BigNumber":s,Array:s,Matrix:f=>s(nr(f.toArray()))});function s(f){for(var p=0,h=0,x=0;x{var{typed:t,abs:r,add:n,pow:i,conj:o,sqrt:u,multiply:l,equalScalar:a,larger:s,smaller:f,matrix:p,ctranspose:h,eigs:x}=e;return t(l6,{number:Math.abs,Complex:function(R){return R.abs()},BigNumber:function(R){return R.abs()},boolean:function(R){return Math.abs(R)},Array:function(R){return C(p(R),2)},Matrix:function(R){return C(R,2)},"Array, number | BigNumber | string":function(R,q){return C(p(R),q)},"Matrix, number | BigNumber | string":function(R,q){return C(R,q)}});function b(P){var R=0;return P.forEach(function(q){var U=r(q);s(U,R)&&(R=U)},!0),R}function w(P){var R;return P.forEach(function(q){var U=r(q);(!R||f(U,R))&&(R=U)},!0),R||0}function A(P,R){if(R===Number.POSITIVE_INFINITY||R==="inf")return b(P);if(R===Number.NEGATIVE_INFINITY||R==="-inf")return w(P);if(R==="fro")return C(P,2);if(typeof R=="number"&&!isNaN(R)){if(!a(R,0)){var q=0;return P.forEach(function(U){q=n(i(r(U),R),q)},!0),i(q,1/R)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function E(P){var R=0;return P.forEach(function(q,U){R=n(R,l(q,o(q)))}),r(u(R))}function O(P){var R=[],q=0;return P.forEach(function(U,H){var V=H[1],W=n(R[V]||0,r(U));s(W,q)&&(q=W),R[V]=W},!0),q}function M(P){var R=P.size();if(R[0]!==R[1])throw new RangeError("Invalid matrix dimensions");var q=h(P),U=l(q,P),H=x(U).values.toArray(),V=H[H.length-1];return r(u(V))}function I(P){var R=[],q=0;return P.forEach(function(U,H){var V=H[0],W=n(R[V]||0,r(U));s(W,q)&&(q=W),R[V]=W},!0),q}function F(P,R){if(R===1)return O(P);if(R===Number.POSITIVE_INFINITY||R==="inf")return I(P);if(R==="fro")return E(P);if(R===2)return M(P);throw new Error("Unsupported parameter value "+R)}function C(P,R){var q=P.size();if(q.length===1)return A(P,R);if(q.length===2){if(q[0]&&q[1])return F(P,R);throw new RangeError("Invalid matrix dimensions")}}});g();y();v();var c6="dot",ufe=["typed","addScalar","multiplyScalar","conj","size"],p6=K(c6,ufe,e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:o}=e;return t(c6,{"Array | DenseMatrix, Array | DenseMatrix":l,"SparseMatrix, SparseMatrix":a});function u(f,p){var h=s(f),x=s(p),b,w;if(h.length===1)b=h[0];else if(h.length===2&&h[1]===1)b=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(x.length===1)w=x[0];else if(x.length===2&&x[1]===1)w=x[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+x.join(", ")+")");if(b!==w)throw new RangeError("Vectors must have equal length ("+b+" != "+w+")");if(b===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return b}function l(f,p){var h=u(f,p),x=Et(f)?f._data:f,b=Et(f)?f._datatype||f.getDataType():void 0,w=Et(p)?p._data:p,A=Et(p)?p._datatype||p.getDataType():void 0,E=s(f).length===2,O=s(p).length===2,M=r,I=n;if(b&&A&&b===A&&typeof b=="string"&&b!=="mixed"){var F=b;M=t.find(r,[F,F]),I=t.find(n,[F,F])}if(!E&&!O){for(var C=I(i(x[0]),w[0]),P=1;PC){I++;continue}F===C&&(A=E(A,O(x[M],w[I])),M++,I++)}return A}function s(f){return Et(f)?f.size():o(f)}});g();y();v();var lfe="trace",ffe=["typed","matrix","add"],m6=K(lfe,ffe,e=>{var{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(l){return i(r(l))},SparseMatrix:o,DenseMatrix:i,any:Lt});function i(u){var l=u._size,a=u._data;switch(l.length){case 1:if(l[0]===1)return Lt(a[0]);throw new RangeError("Matrix must be square (size: "+Kt(l)+")");case 2:{var s=l[0],f=l[1];if(s===f){for(var p=0,h=0;h0)for(var b=0;bb)break}return x}throw new RangeError("Matrix must be square (size: "+Kt(f)+")")}});g();y();v();var h6="index",cfe=["typed","Index"],d6=K(h6,cfe,e=>{var{typed:t,Index:r}=e;return t(h6,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var o=i.map(function(l){return kt(l)?l.toNumber():pr(l)||Et(l)?l.map(function(a){return kt(a)?a.toNumber():a}):l}),u=new r;return r.apply(u,o),u}})});g();y();v();g();y();v();var Sw=new Set(["end"]);var pfe="Node",mfe=["mathWithTransform"],g6=K(pfe,mfe,e=>{var{mathWithTransform:t}=e;function r(i){for(var o of[...Sw])if(i.has(o))throw new Error('Scope contains an illegal symbol, "'+o+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(o){return this.compile().evaluate(o)}compile(){var o=this._compile(t,{}),u={},l=null;function a(s){var f=gl(s);return r(f),o(f,u,l)}return{evaluate:a}}_compile(o,u){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(o){throw new Error("Cannot run forEach on a Node interface")}map(o){throw new Error("Cannot run map on a Node interface")}_ifNode(o){if(!cr(o))throw new TypeError("Callback function must return a Node");return o}traverse(o){o(this,null,null);function u(l,a){l.forEach(function(s,f,p){a(s,f,p),u(s,a)})}u(this,o)}transform(o){function u(l,a,s){var f=o(l,a,s);return f!==l?f:l.map(u)}return u(this,null,null)}filter(o){var u=[];return this.traverse(function(l,a,s){o(l,a,s)&&u.push(l)}),u}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(o){return o.cloneDeep()})}equals(o){return o?this.type===o.type&&_s(this,o):!1}toString(o){var u=this._getCustomString(o);return typeof u<"u"?u:this._toString(o)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(o){var u=this._getCustomString(o);return typeof u<"u"?u:this._toHTML(o)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(o){var u=this._getCustomString(o);return typeof u<"u"?u:this._toTex(o)}_toTex(o){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(o){if(o&&typeof o=="object")switch(typeof o.handler){case"object":case"undefined":return;case"function":return o.handler(this,o);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});g();y();v();g();y();v();g();y();v();function Jr(e){return e&&e.isIndexError?new Mi(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function Aw(e){var{subset:t}=e;return function(n,i){try{if(Array.isArray(n))return t(n,i);if(n&&typeof n.subset=="function")return n.subset(i);if(typeof n=="string")return t(n,i);if(typeof n=="object"){if(!i.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return fn(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(o){throw Jr(o)}}}var Cw="AccessorNode",hfe=["subset","Node"],v6=K(Cw,hfe,e=>{var{subset:t,Node:r}=e,n=Aw({subset:t});function i(u){return!(Fo(u)||Ei(u)||or(u)||eo(u)||Su(u)||Si(u)||qr(u))}class o extends r{constructor(l,a){if(super(),!cr(l))throw new TypeError('Node expected for parameter "object"');if(!Vo(a))throw new TypeError('IndexNode expected for parameter "index"');this.object=l,this.index=a}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Cw}get isAccessorNode(){return!0}_compile(l,a){var s=this.object._compile(l,a),f=this.index._compile(l,a);if(this.index.isObjectProperty()){var p=this.index.getObjectProperty();return function(x,b,w){return fn(s(x,b,w),p)}}else return function(x,b,w){var A=s(x,b,w),E=f(x,b,A);return n(A,E)}}forEach(l){l(this.object,"object",this),l(this.index,"index",this)}map(l){return new o(this._ifNode(l(this.object,"object",this)),this._ifNode(l(this.index,"index",this)))}clone(){return new o(this.object,this.index)}_toString(l){var a=this.object.toString(l);return i(this.object)&&(a="("+a+")"),a+this.index.toString(l)}_toHTML(l){var a=this.object.toHTML(l);return i(this.object)&&(a='('+a+')'),a+this.index.toHTML(l)}_toTex(l){var a=this.object.toTex(l);return i(this.object)&&(a="\\left(' + object + '\\right)"),a+this.index.toTex(l)}toJSON(){return{mathjs:Cw,object:this.object,index:this.index}}static fromJSON(l){return new o(l.object,l.index)}}return Fr(o,"name",Cw),o},{isClass:!0,isNode:!0});g();y();v();var Mw="ArrayNode",dfe=["Node"],y6=K(Mw,dfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(cr))throw new TypeError("Array containing Nodes expected")}get type(){return Mw}get isArrayNode(){return!0}_compile(i,o){var u=Yo(this.items,function(s){return s._compile(i,o)}),l=i.config.matrix!=="Array";if(l){var a=i.matrix;return function(f,p,h){return a(Yo(u,function(x){return x(f,p,h)}))}}else return function(f,p,h){return Yo(u,function(x){return x(f,p,h)})}}forEach(i){for(var o=0;o['+o.join(',')+']'}_toTex(i){function o(u,l){var a=u.some(Ei)&&!u.every(Ei),s=l||a,f=s?"&":"\\\\",p=u.map(function(h){return h.items?o(h.items,!l):h.toTex(i)}).join(f);return a||!s||s&&!l?"\\begin{bmatrix}"+p+"\\end{bmatrix}":p}return o(this.items,!1)}}return Fr(r,"name",Mw),r},{isClass:!0,isNode:!0});g();y();v();g();y();v();function x6(e){var{subset:t,matrix:r}=e;return function(i,o,u){try{if(Array.isArray(i)){var l=r(i).subset(o,u).valueOf();return l.forEach((a,s)=>{i[s]=a}),i}else{if(i&&typeof i.subset=="function")return i.subset(o,u);if(typeof i=="string")return t(i,o,u);if(typeof i=="object"){if(!o.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return Au(i,o.getObjectProperty(),u),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(a){throw Jr(a)}}}g();y();v();var Xa=[{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:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Tw(e,t){if(!t||t!=="auto")return e;for(var r=e;Si(r);)r=r.content;return r}function _r(e,t,r,n){var i=e;t!=="keep"&&(i=e.getContent());for(var o=i.getIdentifier(),u=null,l=0;l{var{subset:t,matrix:r,Node:n}=e,i=Aw({subset:t}),o=x6({subset:t,matrix:r});function u(a,s,f){s||(s="keep");var p=_r(a,s,f),h=_r(a.value,s,f);return s==="all"||h!==null&&h<=p}class l extends n{constructor(s,f,p){if(super(),this.object=s,this.index=p?f:null,this.value=p||f,!qr(s)&&!Fo(s))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(qr(s)&&s.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Vo(this.index))throw new TypeError('IndexNode expected as "index"');if(!cr(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 Iw}get isAssignmentNode(){return!0}_compile(s,f){var p=this.object._compile(s,f),h=this.index?this.index._compile(s,f):null,x=this.value._compile(s,f),b=this.object.name;if(this.index)if(this.index.isObjectProperty()){var w=this.index.getObjectProperty();return function(I,F,C){var P=p(I,F,C),R=x(I,F,C);return Au(P,w,R),R}}else{if(qr(this.object))return function(I,F,C){var P=p(I,F,C),R=x(I,F,C),q=h(I,F,P);return I.set(b,o(P,q,R)),R};var A=this.object.object._compile(s,f);if(this.object.index.isObjectProperty()){var E=this.object.index.getObjectProperty();return function(I,F,C){var P=A(I,F,C),R=fn(P,E),q=h(I,F,R),U=x(I,F,C);return Au(P,E,o(R,q,U)),U}}else{var O=this.object.index._compile(s,f);return function(I,F,C){var P=A(I,F,C),R=O(I,F,P),q=i(P,R),U=h(I,F,q),H=x(I,F,C);return o(P,R,o(q,U,H)),H}}}else{if(!qr(this.object))throw new TypeError("SymbolNode expected as object");return function(I,F,C){var P=x(I,F,C);return I.set(b,P),P}}}forEach(s){s(this.object,"object",this),this.index&&s(this.index,"index",this),s(this.value,"value",this)}map(s){var f=this._ifNode(s(this.object,"object",this)),p=this.index?this._ifNode(s(this.index,"index",this)):null,h=this._ifNode(s(this.value,"value",this));return new l(f,p,h)}clone(){return new l(this.object,this.index,this.value)}_toString(s){var f=this.object.toString(s),p=this.index?this.index.toString(s):"",h=this.value.toString(s);return u(this,s&&s.parenthesis,s&&s.implicit)&&(h="("+h+")"),f+p+" = "+h}toJSON(){return{mathjs:Iw,object:this.object,index:this.index,value:this.value}}static fromJSON(s){return new l(s.object,s.index,s.value)}_toHTML(s){var f=this.object.toHTML(s),p=this.index?this.index.toHTML(s):"",h=this.value.toHTML(s);return u(this,s&&s.parenthesis,s&&s.implicit)&&(h='('+h+')'),f+p+'='+h}_toTex(s){var f=this.object.toTex(s),p=this.index?this.index.toTex(s):"",h=this.value.toTex(s);return u(this,s&&s.parenthesis,s&&s.implicit)&&(h="\\left(".concat(h,"\\right)")),f+p+"="+h}}return Fr(l,"name",Iw),l},{isClass:!0,isNode:!0});g();y();v();var Fw="BlockNode",vfe=["ResultSet","Node"],D6=K(Fw,vfe,e=>{var{ResultSet:t,Node:r}=e;class n extends r{constructor(o){if(super(),!Array.isArray(o))throw new Error("Array expected");this.blocks=o.map(function(u){var l=u&&u.node,a=u&&u.visible!==void 0?u.visible:!0;if(!cr(l))throw new TypeError('Property "node" must be a Node');if(typeof a!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:l,visible:a}})}get type(){return Fw}get isBlockNode(){return!0}_compile(o,u){var l=Yo(this.blocks,function(a){return{evaluate:a.node._compile(o,u),visible:a.visible}});return function(s,f,p){var h=[];return Ff(l,function(b){var w=b.evaluate(s,f,p);b.visible&&h.push(w)}),new t(h)}}forEach(o){for(var u=0;u{"use strict";g();x();v();bj.exports=wj()});var Hu=vt(Wi=>{"use strict";g();x();v();Object.defineProperty(Wi,"__esModule",{value:!0});Wi.intervalsOverlap=Wi.hasInterval=Wi.hasValue=Wi.zeroIn=Wi.isSingleton=Wi.isWhole=Wi.isEmpty=Wi.isInterval=void 0;function FDe(e){return typeof e=="object"&&typeof e.lo=="number"&&typeof e.hi=="number"}Wi.isInterval=FDe;function Od(e){return e.lo>e.hi}Wi.isEmpty=Od;function _De(e){return e.lo===-1/0&&e.hi===1/0}Wi.isWhole=_De;function kDe(e){return e.lo===e.hi}Wi.isSingleton=kDe;function BDe(e){return Nj(e,0)}Wi.zeroIn=BDe;function Nj(e,t){return Od(e)?!1:e.lo<=t&&t<=e.hi}Wi.hasValue=Nj;function LDe(e,t){return Od(e)?!0:!Od(t)&&t.lo<=e.lo&&e.hi<=t.hi}Wi.hasInterval=LDe;function PDe(e,t){return Od(e)||Od(t)?!1:e.lo<=t.lo&&t.lo<=e.hi||t.lo<=e.lo&&e.lo<=t.hi}Wi.intervalsOverlap=PDe});var Sj=vt((eyr,ri)=>{g();x();v();var U3=!1;if(typeof Float64Array<"u")if(js=new Float64Array(1),Po=new Uint32Array(js.buffer),js[0]=1,U3=!0,Po[1]===1072693248){let e=function(n,i){return Po[0]=n,Po[1]=i,js[0]},t=function(n){return js[0]=n,Po[0]},r=function(n){return js[0]=n,Po[1]};RDe=e,qDe=t,zDe=r,ri.exports=function(i){return js[0]=i,[Po[0],Po[1]]},ri.exports.pack=e,ri.exports.lo=t,ri.exports.hi=r}else if(Po[0]===1072693248){let e=function(n,i){return Po[1]=n,Po[0]=i,js[0]},t=function(n){return js[0]=n,Po[1]},r=function(n){return js[0]=n,Po[0]};UDe=e,HDe=t,$De=r,ri.exports=function(i){return js[0]=i,[Po[1],Po[0]]},ri.exports.pack=e,ri.exports.lo=t,ri.exports.hi=r}else U3=!1;var js,Po,RDe,qDe,zDe,UDe,HDe,$De;if(!U3){let e=function(n,i){return eu.writeUInt32LE(n,0,!0),eu.writeUInt32LE(i,4,!0),eu.readDoubleLE(0,!0)},t=function(n){return eu.writeDoubleLE(n,0,!0),eu.readUInt32LE(0,!0)},r=function(n){return eu.writeDoubleLE(n,0,!0),eu.readUInt32LE(4,!0)};WDe=e,VDe=t,GDe=r,eu=new k(8),ri.exports=function(i){return eu.writeDoubleLE(i,0,!0),[eu.readUInt32LE(0,!0),eu.readUInt32LE(4,!0)]},ri.exports.pack=e,ri.exports.lo=t,ri.exports.hi=r}var eu,WDe,VDe,GDe;ri.exports.sign=function(e){return ri.exports.hi(e)>>>31};ri.exports.exponent=function(e){var t=ri.exports.hi(e);return(t<<1>>>21)-1023};ri.exports.fraction=function(e){var t=ri.exports.lo(e),r=ri.exports.hi(e),n=r&(1<<20)-1;return r&2146435072&&(n+=1<<20),[t,n]};ri.exports.denormalized=function(e){var t=ri.exports.hi(e);return!(t&2146435072)}});var Mj=vt((iyr,Cj)=>{"use strict";g();x();v();var H3=Sj(),Ej=Math.pow(2,-1074),Aj=-1>>>0;Cj.exports=YDe;function YDe(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(e===0)return t<0?-Ej:Ej;var r=H3.hi(e),n=H3.lo(e);return t>e==e>0?n===Aj?(r+=1,n=0):n+=1:n===0?(n=Aj,r-=1):n-=1,H3.pack(n,r)}});var ql=vt(K0=>{"use strict";g();x();v();var ZDe=K0&&K0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(K0,"__esModule",{value:!0});var Oj=ZDe(Mj());function XDe(e){return e}function $3(e){return e===1/0?e:(0,Oj.default)(e,-1/0)}function W3(e){return e===-1/0?e:(0,Oj.default)(e,1/0)}function Tj(e){return e<0?Math.ceil(e):Math.floor(e)}var Id={prev:$3,next:W3},wr={safePrev:$3,safeNext:W3,prev(e){return Id.prev(e)},next(e){return Id.next(e)},addLo(e,t){return wr.prev(e+t)},addHi(e,t){return wr.next(e+t)},subLo(e,t){return wr.prev(e-t)},subHi(e,t){return wr.next(e-t)},mulLo(e,t){return wr.prev(e*t)},mulHi(e,t){return wr.next(e*t)},divLo(e,t){return wr.prev(e/t)},divHi(e,t){return wr.next(e/t)},intLo(e){return Tj(wr.prev(e))},intHi(e){return Tj(wr.next(e))},logLo(e){return wr.prev(Math.log(e))},logHi(e){return wr.next(Math.log(e))},expLo(e){return wr.prev(Math.exp(e))},expHi(e){return wr.next(Math.exp(e))},sinLo(e){return wr.prev(Math.sin(e))},sinHi(e){return wr.next(Math.sin(e))},cosLo(e){return wr.prev(Math.cos(e))},cosHi(e){return wr.next(Math.cos(e))},tanLo(e){return wr.prev(Math.tan(e))},tanHi(e){return wr.next(Math.tan(e))},asinLo(e){return wr.prev(Math.asin(e))},asinHi(e){return wr.next(Math.asin(e))},acosLo(e){return wr.prev(Math.acos(e))},acosHi(e){return wr.next(Math.acos(e))},atanLo(e){return wr.prev(Math.atan(e))},atanHi(e){return wr.next(Math.atan(e))},sinhLo(e){return wr.prev(Math.sinh(e))},sinhHi(e){return wr.next(Math.sinh(e))},coshLo(e){return wr.prev(Math.cosh(e))},coshHi(e){return wr.next(Math.cosh(e))},tanhLo(e){return wr.prev(Math.tanh(e))},tanhHi(e){return wr.next(Math.tanh(e))},powLo(e,t){if(t%1!==0)return wr.prev(Math.pow(e,t));let r=(t&1)===1?e:1;for(t>>=1;t>0;)e=wr.mulLo(e,e),(t&1)===1&&(r=wr.mulLo(e,r)),t>>=1;return r},powHi(e,t){if(t%1!==0)return wr.next(Math.pow(e,t));let r=(t&1)===1?e:1;for(t>>=1;t>0;)e=wr.mulHi(e,e),(t&1)===1&&(r=wr.mulHi(e,r)),t>>=1;return r},sqrtLo(e){return wr.prev(Math.sqrt(e))},sqrtHi(e){return wr.next(Math.sqrt(e))},disable(){Id.next=Id.prev=XDe},enable(){Id.next=W3,Id.prev=$3}};K0.default=wr});var nc=vt(ea=>{"use strict";g();x();v();var KDe=ea&&ea.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),JDe=ea&&ea.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),QDe=ea&&ea.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&KDe(t,e,r);return JDe(t,e),t},jDe=ea&&ea.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ea,"__esModule",{value:!0});ea.Interval=ea._Interval=void 0;var YD=QDe(Hu()),Fd=jDe(ql()),ZD=class e{constructor(t,r){if(this.lo=0,this.hi=0,!(this instanceof e))return console.log("calling with new"),console.log(t,r),new e(t,r);if(typeof t<"u"&&typeof r<"u"){if(YD.isInterval(t)){if(!YD.isSingleton(t))throw new TypeError("Interval: interval `lo` must be a singleton");t=t.lo}if(YD.isInterval(r)){if(!YD.isSingleton(r))throw TypeError("Interval: interval `hi` must be a singleton");r=r.hi}}else{if(typeof t<"u")return Array.isArray(t)?new _d(t[0],t[1]):new _d(t,t);t=r=0}this.assign(t,r)}singleton(t){return this.set(t,t)}bounded(t,r){return this.set(Fd.default.prev(t),Fd.default.next(r))}boundedSingleton(t){return this.bounded(t,t)}set(t,r){return this.lo=t,this.hi=r,this}assign(t,r){if(typeof t!="number"||typeof r!="number")throw TypeError("Interval#assign: arguments must be numbers");return isNaN(t)||isNaN(r)||t>r?this.setEmpty():this.set(t,r)}setEmpty(){return this.set(Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY)}setWhole(){return this.set(Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY)}open(t,r){return this.assign(Fd.default.safeNext(t),Fd.default.safePrev(r))}halfOpenLeft(t,r){return this.assign(Fd.default.safeNext(t),r)}halfOpenRight(t,r){return this.assign(t,Fd.default.safePrev(r))}toArray(){return[this.lo,this.hi]}clone(){return new _d().set(this.lo,this.hi)}};ea._Interval=ZD;function eNe(e){function t(){for(var r=arguments.length,n=Array(r),i=0;i{"use strict";g();x();v();var tNe=Q0&&Q0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Q0,"__esModule",{value:!0});var ic=nc(),Ij=tNe(ql()),XD=(3373259426+273688/(1<<21))/(1<<30),KD=(3373259426+273689/(1<<21))/(1<<30),J0={PI_LOW:XD,PI_HIGH:KD,PI_HALF_LOW:XD/2,PI_HALF_HIGH:KD/2,PI_TWICE_LOW:XD*2,PI_TWICE_HIGH:KD*2,get E(){return new ic.Interval(Ij.default.prev(Math.E),Ij.default.next(Math.E))},get PI(){return new ic.Interval(XD,KD)},get PI_HALF(){return new ic.Interval(J0.PI_HALF_LOW,J0.PI_HALF_HIGH)},get PI_TWICE(){return new ic.Interval(J0.PI_TWICE_LOW,J0.PI_TWICE_HIGH)},get ZERO(){return new ic.Interval(0)},get ONE(){return new ic.Interval(1)},get WHOLE(){return new ic.Interval().setWhole()},get EMPTY(){return new ic.Interval().setEmpty()}};Q0.default=J0});var V3=vt(Hr=>{"use strict";g();x();v();var rNe=Hr&&Hr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),nNe=Hr&&Hr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),iNe=Hr&&Hr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&rNe(t,e,r);return nNe(t,e),t};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.geq=Hr.greaterEqualThan=Hr.leq=Hr.lessEqualThan=Hr.gt=Hr.greaterThan=Hr.lt=Hr.lessThan=Hr.notEqual=Hr.assertIncludes=Hr.almostEqual=Hr.equal=void 0;var ta=iNe(Hu());function oNe(e,t){return ta.isEmpty(e)?ta.isEmpty(t):!ta.isEmpty(t)&&e.lo===t.lo&&e.hi===t.hi}Hr.equal=oNe;var aNe=1e-7;function JD(e,t){if(!e)throw new Error(t||"assertion failed")}function Fj(e,t){if(!isFinite(e))return JD(e===t,`[Infinity] expected ${e} to be ${t}`);JD(Math.abs(e-t)t.hi}Hr.notEqual=uNe;function kj(e,t){return ta.isEmpty(e)||ta.isEmpty(t)?!1:e.hit.hi}Hr.greaterThan=Bj;Hr.gt=Bj;function Lj(e,t){return ta.isEmpty(e)||ta.isEmpty(t)?!1:e.hi<=t.lo}Hr.lessEqualThan=Lj;Hr.leq=Lj;function Pj(e,t){return ta.isEmpty(e)||ta.isEmpty(t)?!1:e.lo>=t.hi}Hr.greaterEqualThan=Pj;Hr.geq=Pj});var zj=vt(Vi=>{"use strict";g();x();v();var lNe=Vi&&Vi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),fNe=Vi&&Vi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),cNe=Vi&&Vi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&lNe(t,e,r);return fNe(t,e),t},Rj=Vi&&Vi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.zero=Vi.negative=Vi.positive=Vi.nonZero=void 0;var j0=nc(),Do=Rj(ql()),qj=cNe(Hu()),G3=Rj(nm());function pNe(e,t){let r=e.lo,n=e.hi,i=t.lo,o=t.hi,u=new j0.Interval;return n<0?o<0?(u.lo=Do.default.divLo(n,i),u.hi=Do.default.divHi(r,o)):(u.lo=Do.default.divLo(r,i),u.hi=Do.default.divHi(n,o)):r<0?o<0?(u.lo=Do.default.divLo(n,o),u.hi=Do.default.divHi(r,o)):(u.lo=Do.default.divLo(r,i),u.hi=Do.default.divHi(n,i)):o<0?(u.lo=Do.default.divLo(n,o),u.hi=Do.default.divHi(r,i)):(u.lo=Do.default.divLo(r,o),u.hi=Do.default.divHi(n,i)),u}Vi.nonZero=pNe;function mNe(e,t){return e.lo===0&&e.hi===0?e:qj.zeroIn(e)?G3.default.WHOLE:e.hi<0?new j0.Interval(Number.NEGATIVE_INFINITY,Do.default.divHi(e.hi,t)):new j0.Interval(Do.default.divLo(e.lo,t),Number.POSITIVE_INFINITY)}Vi.positive=mNe;function hNe(e,t){return e.lo===0&&e.hi===0?e:qj.zeroIn(e)?G3.default.WHOLE:e.hi<0?new j0.Interval(Do.default.divLo(e.hi,t),Number.POSITIVE_INFINITY):new j0.Interval(Number.NEGATIVE_INFINITY,Do.default.divHi(e.lo,t))}Vi.negative=hNe;function dNe(e){return e.lo===0&&e.hi===0?e:G3.default.WHOLE}Vi.zero=dNe});var kd=vt(an=>{"use strict";g();x();v();var gNe=an&&an.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),vNe=an&&an.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Uj=an&&an.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&gNe(t,e,r);return vNe(t,e),t},Hj=an&&an.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(an,"__esModule",{value:!0});an.negative=an.positive=an.div=an.divide=an.mul=an.multiply=an.sub=an.subtract=an.add=void 0;var t1=nc(),Fn=Hj(ql()),Y3=Hj(nm()),e1=Uj(Hu()),QD=Uj(zj());function xNe(e,t){return new t1.Interval(Fn.default.addLo(e.lo,t.lo),Fn.default.addHi(e.hi,t.hi))}an.add=xNe;function $j(e,t){return new t1.Interval(Fn.default.subLo(e.lo,t.hi),Fn.default.subHi(e.hi,t.lo))}an.subtract=$j;an.sub=$j;function Wj(e,t){if(e1.isEmpty(e)||e1.isEmpty(t))return Y3.default.EMPTY;let r=e.lo,n=e.hi,i=t.lo,o=t.hi,u=new t1.Interval;return r<0?n>0?i<0?o>0?(u.lo=Math.min(Fn.default.mulLo(r,o),Fn.default.mulLo(n,i)),u.hi=Math.max(Fn.default.mulHi(r,i),Fn.default.mulHi(n,o))):(u.lo=Fn.default.mulLo(n,i),u.hi=Fn.default.mulHi(r,i)):o>0?(u.lo=Fn.default.mulLo(r,o),u.hi=Fn.default.mulHi(n,o)):(u.lo=0,u.hi=0):i<0?o>0?(u.lo=Fn.default.mulLo(r,o),u.hi=Fn.default.mulHi(r,i)):(u.lo=Fn.default.mulLo(n,o),u.hi=Fn.default.mulHi(r,i)):o>0?(u.lo=Fn.default.mulLo(r,o),u.hi=Fn.default.mulHi(n,i)):(u.lo=0,u.hi=0):n>0?i<0?o>0?(u.lo=Fn.default.mulLo(n,i),u.hi=Fn.default.mulHi(n,o)):(u.lo=Fn.default.mulLo(n,i),u.hi=Fn.default.mulHi(r,o)):o>0?(u.lo=Fn.default.mulLo(r,i),u.hi=Fn.default.mulHi(n,o)):(u.lo=0,u.hi=0):(u.lo=0,u.hi=0),u}an.multiply=Wj;an.mul=Wj;function Vj(e,t){return e1.isEmpty(e)||e1.isEmpty(t)?Y3.default.EMPTY:e1.zeroIn(t)?t.lo!==0?t.hi!==0?QD.zero(e):QD.negative(e,t.lo):t.hi!==0?QD.positive(e,t.hi):Y3.default.EMPTY:QD.nonZero(e,t)}an.divide=Vj;an.div=Vj;function yNe(e){return new t1.Interval(e.lo,e.hi)}an.positive=yNe;function wNe(e){return new t1.Interval(-e.hi,-e.lo)}an.negative=wNe});var jD=vt(xi=>{"use strict";g();x();v();var bNe=xi&&xi.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),DNe=xi&&xi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Yj=xi&&xi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&bNe(t,e,r);return DNe(t,e),t},Zj=xi&&xi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xi,"__esModule",{value:!0});xi.nthRoot=xi.sqrt=xi.pow=xi.multiplicativeInverse=xi.fmod=void 0;var Oa=nc(),oo=Zj(ql()),fs=Zj(nm()),oc=Yj(Hu()),Gj=Yj(kd());function NNe(e,t){if(oc.isEmpty(e)||oc.isEmpty(t))return fs.default.EMPTY;let r=e.lo<0?t.lo:t.hi,n=e.lo/r;return n<0?n=Math.ceil(n):n=Math.floor(n),Gj.sub(e,Gj.mul(t,new Oa.Interval(n)))}xi.fmod=NNe;function Xj(e){return oc.isEmpty(e)?fs.default.EMPTY:oc.zeroIn(e)?e.lo!==0?e.hi!==0?fs.default.WHOLE:new Oa.Interval(Number.NEGATIVE_INFINITY,oo.default.divHi(1,e.lo)):e.hi!==0?new Oa.Interval(oo.default.divLo(1,e.hi),Number.POSITIVE_INFINITY):fs.default.EMPTY:new Oa.Interval(oo.default.divLo(1,e.hi),oo.default.divHi(1,e.lo))}xi.multiplicativeInverse=Xj;function Kj(e,t){if(oc.isEmpty(e))return fs.default.EMPTY;if(typeof t=="object"){if(!oc.isSingleton(t))return fs.default.EMPTY;t=t.lo}if(t===0)return e.lo===0&&e.hi===0?fs.default.EMPTY:fs.default.ONE;if(t<0)return Kj(Xj(e),-t);if(Number.isSafeInteger(t))if(e.hi<0){let r=oo.default.powLo(-e.hi,t),n=oo.default.powHi(-e.lo,t);return(t&1)===1?new Oa.Interval(-n,-r):new Oa.Interval(r,n)}else return e.lo<0?(t&1)===1?new Oa.Interval(-oo.default.powLo(-e.lo,t),oo.default.powHi(e.hi,t)):new Oa.Interval(0,oo.default.powHi(Math.max(-e.lo,e.hi),t)):new Oa.Interval(oo.default.powLo(e.lo,t),oo.default.powHi(e.hi,t));else return console.warn("power is not an integer, you should use nth-root instead, returning an empty interval"),fs.default.EMPTY}xi.pow=Kj;function SNe(e){return Jj(e,2)}xi.sqrt=SNe;function Jj(e,t){if(oc.isEmpty(e)||t<0)return fs.default.EMPTY;if(typeof t=="object"){if(!oc.isSingleton(t))return fs.default.EMPTY;t=t.lo}let r=1/t;if(e.hi<0){if(Number.isSafeInteger(t)&&(t&1)===1){let n=oo.default.powHi(-e.lo,r),i=oo.default.powLo(-e.hi,r);return new Oa.Interval(-n,-i)}return fs.default.EMPTY}else if(e.lo<0){let n=oo.default.powHi(e.hi,r);if(Number.isSafeInteger(t)&&(t&1)===1){let i=-oo.default.powHi(-e.lo,r);return new Oa.Interval(i,n)}return new Oa.Interval(0,n)}else return new Oa.Interval(oo.default.powLo(e.lo,r),oo.default.powHi(e.hi,r))}xi.nthRoot=Jj});var eN=vt(dr=>{"use strict";g();x();v();var ENe=dr&&dr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),ANe=dr&&dr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Qj=dr&&dr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&ENe(t,e,r);return ANe(t,e),t},jj=dr&&dr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dr,"__esModule",{value:!0});dr.clone=dr.min=dr.max=dr.abs=dr.wid=dr.width=dr.difference=dr.union=dr.intersection=dr.hull=dr.log2=dr.LOG_EXP_2=dr.log10=dr.LOG_EXP_10=dr.ln=dr.log=dr.exp=void 0;var Ia=nc(),r1=jj(ql()),cs=jj(nm()),Ii=Qj(Hu()),Z3=Qj(kd());function CNe(e){return Ii.isEmpty(e)?cs.default.EMPTY:new Ia.Interval(r1.default.expLo(e.lo),r1.default.expHi(e.hi))}dr.exp=CNe;function Bd(e){if(Ii.isEmpty(e))return cs.default.EMPTY;let t=e.lo<=0?Number.NEGATIVE_INFINITY:r1.default.logLo(e.lo);return new Ia.Interval(t,r1.default.logHi(e.hi))}dr.log=Bd;dr.ln=Bd;dr.LOG_EXP_10=Bd(new Ia.Interval(10,10));function MNe(e){return Ii.isEmpty(e)?cs.default.EMPTY:Z3.div(Bd(e),dr.LOG_EXP_10)}dr.log10=MNe;dr.LOG_EXP_2=Bd(new Ia.Interval(2,2));function TNe(e){return Ii.isEmpty(e)?cs.default.EMPTY:Z3.div(Bd(e),dr.LOG_EXP_2)}dr.log2=TNe;function ONe(e,t){let r=Ii.isEmpty(e),n=Ii.isEmpty(t);return r&&n?cs.default.EMPTY:r?t.clone():n?e.clone():new Ia.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}dr.hull=ONe;function INe(e,t){if(Ii.isEmpty(e)||Ii.isEmpty(t))return cs.default.EMPTY;let r=Math.max(e.lo,t.lo),n=Math.min(e.hi,t.hi);return r<=n?new Ia.Interval(r,n):cs.default.EMPTY}dr.intersection=INe;function FNe(e,t){if(!Ii.intervalsOverlap(e,t))throw Error("Interval#union: intervals do not overlap");return new Ia.Interval(Math.min(e.lo,t.lo),Math.max(e.hi,t.hi))}dr.union=FNe;function _Ne(e,t){if(Ii.isEmpty(e)||Ii.isWhole(t))return cs.default.EMPTY;if(Ii.intervalsOverlap(e,t)){if(e.lo=e.hi&&t.lo===-1/0?cs.default.EMPTY:t.lo<=e.lo?new Ia.Interval().halfOpenLeft(t.hi,e.hi):new Ia.Interval().halfOpenRight(e.lo,t.lo)}return e.clone()}dr.difference=_Ne;function eee(e){return Ii.isEmpty(e)?0:r1.default.subHi(e.hi,e.lo)}dr.width=eee;dr.wid=eee;function kNe(e){return Ii.isEmpty(e)||Ii.isWhole(e)?cs.default.EMPTY:e.lo>=0?e.clone():e.hi<=0?Z3.negative(e):new Ia.Interval(0,Math.max(-e.lo,e.hi))}dr.abs=kNe;function BNe(e,t){let r=Ii.isEmpty(e),n=Ii.isEmpty(t);return r&&n?cs.default.EMPTY:r?t.clone():n?e.clone():new Ia.Interval(Math.max(e.lo,t.lo),Math.max(e.hi,t.hi))}dr.max=BNe;function LNe(e,t){let r=Ii.isEmpty(e),n=Ii.isEmpty(t);return r&&n?cs.default.EMPTY:r?t.clone():n?e.clone():new Ia.Interval(Math.min(e.lo,t.lo),Math.min(e.hi,t.hi))}dr.min=LNe;function PNe(e){return new Ia.Interval().set(e.lo,e.hi)}dr.clone=PNe});var J3=vt(sn=>{"use strict";g();x();v();var RNe=sn&&sn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),qNe=sn&&sn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),rN=sn&&sn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&RNe(t,e,r);return qNe(t,e),t},tee=sn&&sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sn,"__esModule",{value:!0});sn.tanh=sn.cosh=sn.sinh=sn.atan=sn.acos=sn.asin=sn.tan=sn.sin=sn.cos=void 0;var Ro=nc(),Fi=tee(ql()),Dn=tee(nm()),zl=rN(Hu()),tN=rN(kd()),ree=rN(jD()),zNe=rN(eN());function X3(e){return!isFinite(e.lo)&&e.lo===e.hi}function nee(e){if(e.lo<0)if(e.lo===-1/0)e.lo=0,e.hi=1/0;else{let t=Math.ceil(-e.lo/Dn.default.PI_TWICE_LOW);e.lo+=Dn.default.PI_TWICE_LOW*t,e.hi+=Dn.default.PI_TWICE_LOW*t}return e}function K3(e){if(zl.isEmpty(e)||X3(e))return Dn.default.EMPTY;let t=new Ro.Interval().set(e.lo,e.hi);nee(t);let r=Dn.default.PI_TWICE,n=ree.fmod(t,r);if(zNe.width(n)>=r.lo)return new Ro.Interval(-1,1);if(n.lo>=Dn.default.PI_HIGH){let a=K3(tN.sub(n,Dn.default.PI));return tN.negative(a)}let i=n.lo,o=n.hi,u=Fi.default.cosLo(o),l=Fi.default.cosHi(i);return o<=Dn.default.PI_LOW?new Ro.Interval(u,l):o<=r.lo?new Ro.Interval(-1,Math.max(u,l)):new Ro.Interval(-1,1)}sn.cos=K3;function UNe(e){return zl.isEmpty(e)||X3(e)?Dn.default.EMPTY:K3(tN.sub(e,Dn.default.PI_HALF))}sn.sin=UNe;function HNe(e){if(zl.isEmpty(e)||X3(e))return Dn.default.EMPTY;let t=new Ro.Interval().set(e.lo,e.hi);nee(t);let r=Dn.default.PI,n=ree.fmod(t,r);return n.lo>=Dn.default.PI_HALF_LOW&&(n=tN.sub(n,r)),n.lo<=-Dn.default.PI_HALF_LOW||n.hi>=Dn.default.PI_HALF_LOW?Dn.default.WHOLE:new Ro.Interval(Fi.default.tanLo(n.lo),Fi.default.tanHi(n.hi))}sn.tan=HNe;function $Ne(e){if(zl.isEmpty(e)||e.hi<-1||e.lo>1)return Dn.default.EMPTY;let t=e.lo<=-1?-Dn.default.PI_HALF_HIGH:Fi.default.asinLo(e.lo),r=e.hi>=1?Dn.default.PI_HALF_HIGH:Fi.default.asinHi(e.hi);return new Ro.Interval(t,r)}sn.asin=$Ne;function WNe(e){if(zl.isEmpty(e)||e.hi<-1||e.lo>1)return Dn.default.EMPTY;let t=e.hi>=1?0:Fi.default.acosLo(e.hi),r=e.lo<=-1?Dn.default.PI_HIGH:Fi.default.acosHi(e.lo);return new Ro.Interval(t,r)}sn.acos=WNe;function VNe(e){return zl.isEmpty(e)?Dn.default.EMPTY:new Ro.Interval(Fi.default.atanLo(e.lo),Fi.default.atanHi(e.hi))}sn.atan=VNe;function GNe(e){return zl.isEmpty(e)?Dn.default.EMPTY:new Ro.Interval(Fi.default.sinhLo(e.lo),Fi.default.sinhHi(e.hi))}sn.sinh=GNe;function YNe(e){return zl.isEmpty(e)?Dn.default.EMPTY:e.hi<0?new Ro.Interval(Fi.default.coshLo(e.hi),Fi.default.coshHi(e.lo)):e.lo>=0?new Ro.Interval(Fi.default.coshLo(e.lo),Fi.default.coshHi(e.hi)):new Ro.Interval(1,Fi.default.coshHi(-e.lo>e.hi?e.lo:e.hi))}sn.cosh=YNe;function ZNe(e){return zl.isEmpty(e)?Dn.default.EMPTY:new Ro.Interval(Fi.default.tanhLo(e.lo),Fi.default.tanhHi(e.hi))}sn.tanh=ZNe});var uee=vt(Nn=>{"use strict";g();x();v();var iee=Nn&&Nn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),XNe=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ld=Nn&&Nn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&iee(t,e,r);return XNe(t,e),t},Pd=Nn&&Nn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&iee(t,e,r)},oee=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.constants=Nn.round=Nn.Interval=void 0;var aee=nc();Object.defineProperty(Nn,"Interval",{enumerable:!0,get:function(){return aee._Interval}});var Q3=oee(ql());Nn.round=Q3.default;var see=oee(nm());Nn.constants=see.default;var KNe=Ld(V3()),JNe=Ld(kd()),QNe=Ld(jD()),jNe=Ld(J3()),eSe=Ld(eN()),tSe=Ld(Hu()),rSe=Object.assign(aee.Interval,see.default,Q3.default,eSe,tSe,KNe,JNe,QNe,jNe,{round:Q3.default});Nn.default=rSe;Pd(V3(),Nn);Pd(kd(),Nn);Pd(jD(),Nn);Pd(J3(),Nn);Pd(eN(),Nn);Pd(Hu(),Nn)});var fee=vt((Zyr,lee)=>{"use strict";g();x();v();lee.exports=function(e){e.mod=e.fmod,e.lessThan=e.lt,e.lessEqualThan=e.leq,e.greaterThan=e.gt,e.greaterEqualThan=e.geq,e.strictlyEqual=e.equal,e.strictlyNotEqual=e.notEqual,e.logicalAND=function(t,r){return t&&r},e.logicalXOR=function(t,r){return t^r},e.logicalOR=function(t,r){return t||r}}});var pee=vt((Qyr,cee)=>{"use strict";g();x();v();cee.exports=function(e){return{disableRounding:function(){e.round.disable()},enableRounding:function(){e.round.enable()}}}});var mee=vt((rwr,nN)=>{"use strict";g();x();v();var nSe=Dj(),Rd=uee().default;fee()(Rd);function iSe(e){Object.keys(e).forEach(function(t){let r=e[t];typeof r=="number"||Array.isArray(r)?e[t]=Rd.factory(r):typeof r=="object"&&"lo"in r&&"hi"in r&&(e[t]=Rd.factory(r.lo,r.hi))})}nN.exports=function(e){return new nSe().setDefs({$$processScope:iSe}).parse(e).compile(Rd)};nN.exports.policies=pee()(Rd);nN.exports.Interval=Rd});var j3=vt((awr,hee)=>{"use strict";g();x();v();hee.exports=mee()});var sc=vt(ac=>{"use strict";g();x();v();var dee=ac&&ac.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ac,"__esModule",{value:!0});ac.interval=ac.builtIn=void 0;var oSe=dee(ZQ()),aSe=dee(j3()),gee={interval:aSe.default,builtIn:oSe.default};function sSe(){return typeof global=="object"&&"math"in global?global.math:typeof window=="object"&&"math"in window?window.math:null}var eO=sSe();eO&&(gee.builtIn=eO.compile);function vee(e){function t(o){if(typeof o=="string"){let u=gee[e](o);return eO&&e==="builtIn"?{eval:u.evaluate||u.eval}:u}else{if(typeof o=="function")return{eval:o};throw Error("expression must be a string or a function")}}function r(o,u){let l=o[u],a=e+"_Expression_"+u,s=e+"_Compiled_"+u;l!==o[a]&&(o[a]=l,o[s]=t(l))}function n(o,u){return o[e+"_Compiled_"+u]}function i(o,u,l){return r(o,u),n(o,u).eval(Object.assign({},o.scope||{},l))}return i}var uSe=vee("builtIn");ac.builtIn=uSe;var lSe=vee("interval");ac.interval=lSe});var bee=vt(n1=>{"use strict";g();x();v();var wee=n1&&n1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n1,"__esModule",{value:!0});var fSe=(e0(),Cn(jv)),cSe=(ti(),Cn(Js)),im=wee(Uu()),xee=wee(Td()),yee=sc();function pSe(e){e=Object.assign({xLine:!1,yLine:!1,renderer:function(l,a){return"("+l.toFixed(3)+", "+a.toFixed(3)+")"},owner:null},e);let t=20,r=(0,fSe.line)().x(function(l){return l[0]}).y(function(l){return l[1]});function n(l,a){return l.append("path").datum(a).attr("stroke","grey").attr("stroke-dasharray","5,5").attr("opacity",.5).attr("d",r)}let i,o;function u(l){let a=l.selectAll("g.tip").data(function(f){return[f]}),s=a.enter().append("g").attr("class","tip").attr("clip-path","url(#function-plot-clip-"+e.owner.id+")");i=a.merge(s).selectAll("g.inner-tip").data(function(f){return[f]}),o=i.enter().append("g").attr("class","inner-tip").style("display","none").each(function(){let f=(0,cSe.select)(this);n(f,[[0,-e.owner.meta.height-t],[0,e.owner.meta.height+t]]).attr("class","tip-x-line").style("display","none"),n(f,[[-e.owner.meta.width-t,0],[e.owner.meta.width+t,0]]).attr("class","tip-y-line").style("display","none"),f.append("circle").attr("r",3),f.append("text").attr("transform","translate(5,-5)")}),i.merge(o).selectAll(".tip-x-line").style("display",e.xLine?null:"none"),i.merge(o).selectAll(".tip-y-line").style("display",e.yLine?null:"none")}return u.move=function(l){let a,s=1/0,f=-1,p,h,y=i.merge(o),b=e.owner.meta,w=y.datum().data,A=b.xScale,S=b.yScale,O=b.width,M=b.height,I=l.x,F=l.y;for(a=0;aC[0]-xee.default.TIP_X_EPS&&I{"use strict";g();x();v();var mSe=tu&&tu.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),hSe=tu&&tu.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),dSe=tu&&tu.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&mSe(t,e,r);return hSe(t,e),t},gSe=tu&&tu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tu,"__esModule",{value:!0});var om=dSe(j3()),Dee=sc(),vSe=gSe(Uu());om.default.policies.disableRounding();function xSe(e){let t=vSe.default.space(e.xAxis,e.range,e.nSamples),r=e.xScale,n=e.yScale,i=n.domain()[0],o=n.domain()[1],u=[],l;for(l=0;ls[1].hi&&(a[1].hi=Math.max(o,a[1].hi),s[1].lo=Math.min(i,s[1].lo)),a[1].hi{"use strict";g();x();v();var DSe=a1&&a1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a1,"__esModule",{value:!0});var No=DSe(Uu()),o1=sc();function Eee(e,t,r,n,i){if(!i)return{asymptote:!0,d0:e,d1:t};let o=10,u=e[0],l=t[0],a=No.default.linspace(u,l,o),s,f;for(let p=0;p=2&&n!==y&&Math.abs(h/s)>1){let b=Eee(t[a-1],t[a],e,y,3);b.asymptote?(t[a-1][0]=b.d0[0],t[a-1][1]=No.default.clamp(b.d0[1],o,u),i.push(l),t[a][0]=b.d1[0],t[a][1]=No.default.clamp(b.d1[1],o,u),l=[t[a]]):l.push(t[a])}else l.push(t[a]);l.length>1&&(s=l[l.length-1][0]-l[l.length-2][0],n=y),++a}return l.length&&i.push(l),i}function SSe(e){let t=No.default.space(e.xAxis,e.range,e.nSamples),r=e.yScale.domain(),n=r[0]-No.default.infinity(),i=r[1]+No.default.infinity(),o=[];for(let l=0;l{"use strict";g();x();v();var tO=s1&&s1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(s1,"__esModule",{value:!0});var Cee=tO(Td()),OSe=tO(See()),ISe=tO(Aee());function FSe(e,t){let r=t.range||[-1/0,1/0],n=Math.max(e.domain()[0],r[0]),i=Math.min(e.domain()[1],r[1]);return[n,i]}function _Se(e,t){let r=FSe(e.meta.xScale,t),n;if(t.sampler==="builtIn")n=ISe.default;else if(t.sampler==="interval")n=OSe.default;else throw new Error(`Invalid sampler function ${t.sampler}`);let i=t.nSamples||Math.min(Cee.default.MAX_ITERATIONS,Cee.default.DEFAULT_ITERATIONS||e.meta.width*2),o=n({d:t,range:r,xScale:e.meta.xScale,yScale:e.meta.yScale,xAxis:e.options.xAxis,yAxis:e.options.yAxis,nSamples:i});return e.emit("eval",o,t.index,t.isHelper),o}s1.default=_Se});var Oee=vt(u1=>{"use strict";g();x();v();var Tee=u1&&u1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u1,"__esModule",{value:!0});var Mee=(ti(),Cn(Js)),rO=(e0(),Cn(jv)),oN=Tee(Uu()),kSe=Tee(iN());function BSe(e){function t(r){r.each(function(n){let i=t.el=(0,Mee.select)(this),o=n.index,u=(0,kSe.default)(e,n),l=oN.default.color(n,o),a=i.selectAll(":scope > path.line").data(u),s=e.meta.yScale.range(),f=s[0],p=s[1],h=f-p;f+=h*1e6,p-=h*1e6,n.skipBoundsCheck&&(f=oN.default.infinity(),p=-oN.default.infinity());function y(O){return oN.default.clamp(e.meta.yScale(O[1]),p,f)}let b=(0,rO.line)().curve(rO.curveLinear).x(function(O){return e.meta.xScale(O[0])}).y(y),w=(0,rO.area)().x(function(O){return e.meta.xScale(O[0])}).y0(e.meta.yScale(0)).y1(y),A=`line line-${o}`,S=a.enter().append("path").attr("class",A).attr("stroke-width",1).attr("stroke-linecap","round");a.merge(S).each(function(){let O=(0,Mee.select)(this),M;if(n.closed?(O.attr("fill",l),O.attr("fill-opacity",.3),M=w):(O.attr("fill","none"),M=b),O.attr("stroke",l).attr("marker-end",function(){return n.fnType==="vector"?"url(#"+e.markerId+")":null}).attr("d",M),n.attr)for(let I in n.attr){let F=n.attr[I];I==="class"&&(F=`${A} ${n.attr[I]}`),O.attr(I,F)}}),a.exit().remove()})}return t}u1.default=BSe});var Fee=vt(l1=>{"use strict";g();x();v();var Iee=l1&&l1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(l1,"__esModule",{value:!0});var LSe=(ti(),Cn(Js)),PSe=Iee(iN()),RSe=Iee(Uu());function qSe(e){let t,r=e.meta.xScale,n=e.meta.yScale;function i(l,a,s,f){if(s>f){let y=s;s=f,f=y}let p=Math.min(a,f),h=Math.max(l,s);return h>p?[-t,0]:[h,p]}let o=function(l,a){let s="",f=n.range(),p=Math.min.apply(Math,f),h=Math.max.apply(Math,f);for(let y=0,b=l.length;y path.line").data(h);t=Math.max(h[0].scaledDx,1);let b=`line line-${f}`,w=y.enter().append("path").attr("class",b).attr("fill","none"),A=y.merge(w).attr("stroke-width",t).attr("stroke",RSe.default.color(a,f)).attr("opacity",p?.5:1).attr("d",function(S){return o(S,p)});if(a.attr)for(let S in a.attr){let O=a.attr[S];S==="class"&&(O=`${b} ${a.attr[S]}`),A.attr(S,O)}y.exit().remove()})}return u}l1.default=qSe});var kee=vt(f1=>{"use strict";g();x();v();var _ee=f1&&f1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(f1,"__esModule",{value:!0});var zSe=(ti(),Cn(Js)),USe=(Ks(),Cn(T2)),HSe=_ee(Uu()),$Se=_ee(iN());function WSe(e){let t=e.meta.xScale,r=e.meta.yScale;function n(i){i.each(function(o){let u,l,a=o.index,s=HSe.default.color(o,a),f=(0,$Se.default)(e,o),p=[];for(u=0;u circle.scatter").data(p),y=`scatter scatter-${a}`,b=h.enter().append("circle").attr("class",y),w=h.merge(b).attr("fill",(0,USe.hsl)(s.toString()).brighter(1.5).formatHex()).attr("stroke",s).attr("opacity",.7).attr("r",1).attr("cx",function(A){return t(A[0])}).attr("cy",function(A){return r(A[1])});if(o.attr)for(let A in o.attr){let S=o.attr[A];A==="class"&&(S=`${y} ${o.attr[A]}`),w.attr(A,S)}h.exit().remove()})}return n}f1.default=WSe});var Bee=vt(c1=>{"use strict";g();x();v();var VSe=c1&&c1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(c1,"__esModule",{value:!0});var GSe=(ti(),Cn(Js)),YSe=(Ks(),Cn(T2)),ZSe=VSe(Uu());function XSe(e){let t=e.meta.xScale,r=e.meta.yScale;function n(i){i.each(function(o){o.sampler="builtIn",o.fnType="vector";let u=(0,GSe.select)(this).selectAll(":scope > text.fn-text").data([o.location]),l=u.enter().append("text").attr("class",`fn-text fn-text-${o.index}`),a=ZSe.default.color(o,o.index),s=u.merge(l).attr("fill",(0,YSe.hsl)(a.toString()).brighter(1.5).formatHex()).attr("x",f=>t(f[0])).attr("y",f=>r(f[1])).text(()=>o.text);if(o.attr)for(let f in o.attr)s.attr(f,o.attr[f]);u.exit().remove()})}return n}c1.default=XSe});var p1=vt(ps=>{"use strict";g();x();v();var aN=ps&&ps.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ps,"__esModule",{value:!0});ps.text=ps.scatter=ps.interval=ps.polyline=void 0;var KSe=aN(Oee());ps.polyline=KSe.default;var JSe=aN(Fee());ps.interval=JSe.default;var QSe=aN(kee());ps.scatter=QSe.default;var jSe=aN(Bee());ps.text=jSe.default});var sN=vt(nO=>{"use strict";g();x();v();Object.defineProperty(nO,"__esModule",{value:!0});function eEe(e){return"graphType"in e||(e.graphType="interval"),"sampler"in e||(e.sampler=e.graphType!=="interval"?"builtIn":"interval"),"fnType"in e||(e.fnType="linear"),e}nO.default=eEe});var Ree=vt(m1=>{"use strict";g();x();v();var Pee=m1&&m1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(m1,"__esModule",{value:!0});var tEe=(ti(),Cn(Js)),rEe=p1(),Lee=sc(),nEe=Pee(sN()),iEe=Pee(Uu());function oEe(e){let t=(0,nEe.default)({isHelper:!0,skipTip:!0,skipBoundsCheck:!0,nSamples:2,graphType:"polyline"});function r(o){if(!o.derivative)return[];let u=typeof o.derivative.x0=="number"?o.derivative.x0:iEe.default.infinity();return t.index=o.index,t.scope={m:(0,Lee.builtIn)(o.derivative,"fn",{x:u}),x0:u,y0:(0,Lee.builtIn)(o,"fn",{x:u})},t.fn="m * (x - x0) + y0",[t]}function n(o){let u=this;o.derivative&&o.derivative.updateOnMouseMove&&!o.derivative.$$mouseListener&&(o.derivative.$$mouseListener=function({x:l}){o.derivative&&(o.derivative.x0=l),i(u)},e.on("tip:update",o.derivative.$$mouseListener))}let i=function(o){o.each(function(u){let l=(0,tEe.select)(this),a=r.call(o,u);n.call(o,u);let s=l.selectAll("g.derivative").data(a),f=s.enter().append("g").attr("class","derivative");s.merge(f).call((0,rEe.polyline)(e)),s.merge(f).selectAll("path").attr("opacity",.5),s.exit().remove()})};return i}m1.default=oEe});var Uee=vt(h1=>{"use strict";g();x();v();var zee=h1&&h1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(h1,"__esModule",{value:!0});var aEe=(ti(),Cn(Js)),qee=sc(),sEe=zee(sN()),uEe=p1(),lEe=zee(Uu());function fEe(e){let t=(0,sEe.default)({isHelper:!0,skipTip:!0,skipBoundsCheck:!0,nSamples:2,graphType:"polyline"});function r(a){a.m=(a.y1-a.y0)/(a.x1-a.x0)}function n(a,s){if(!("x0"in s))throw Error("secant must have the property `x0` defined");s.scope=s.scope||{};let f=s.x0,p=typeof s.x1=="number"?s.x1:lEe.default.infinity();Object.assign(s.scope,{x0:f,x1:p,y0:(0,qee.builtIn)(a,"fn",{x:f}),y1:(0,qee.builtIn)(a,"fn",{x:p})}),r(s.scope)}function i(a,s){n(a,s),s.fn="m * (x - x0) + y0"}function o(a,s){let f=this;s.updateOnMouseMove&&!s.$$mouseListener&&(s.$$mouseListener=function({x:p}){s.x1=p,n(a,s),l(f)},e.on("tip:update",s.$$mouseListener))}function u(a){let s=this,f=[];a.secants=a.secants||[];for(let p=0;p{"use strict";g();x();v();var Hee=d1&&d1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(d1,"__esModule",{value:!0});var cEe=(ti(),Cn(Js)),pEe=Hee(Ree()),mEe=Hee(Uee());function hEe(e){function t(r){r.each(function(){let n=(0,cEe.select)(this);n.call((0,pEe.default)(e)),n.call((0,mEe.default)(e))})}return t}d1.default=hEe});var Yee=vt(qd=>{"use strict";g();x();v();var zd=qd&&qd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qd,"__esModule",{value:!0});qd.Chart=void 0;var dEe=(e0(),Cn(jv)),gEe=(p2(),Cn(jV)),$ee=(CZ(),Cn(AZ)),Wee=(PZ(),Cn(LZ)),vEe=(CJ(),Cn(AJ)),uN=(ti(),Cn(Js)),Vee=(Tl(),Cn(EY)),xEe=zd((zJ(),Cn(qJ))),yEe=zd(UJ()),wEe=zd(bee()),bEe=zd(iO()),DEe=zd(sN()),lN=zd(Td());function Gee(e){return e==="linear"?$ee.scaleLinear:$ee.scaleLog}var fN=class e extends xEe.default.EventEmitter{constructor(t){super();let r=Math.random(),n=String.fromCharCode(Math.floor(r*26)+97);this.options=t,this.id=n+r.toString(16).substr(2),this.options.id=this.id,this.markerId=this.id+"-marker",e.cache[this.id]=this,this.linkedGraphs=[this],this.meta={},this.setUpEventListeners()}build(){return this.internalVars(),this.drawGraphWrapper(),this}getDraggableNode(){return(0,uN.select)(this.options.target).select(".zoom-and-drag").node()}getEmitInstance(){let t=this,r=this.getDraggableNode();return r&&(t=r.instance),t}internalVars(){let t=this.meta.margin={left:40,right:20,top:20,bottom:20};this.options.title&&(this.meta.margin.top=40),this.meta.width=(this.options.width||lN.default.DEFAULT_WIDTH)-t.left-t.right,this.meta.height=(this.options.height||lN.default.DEFAULT_HEIGHT)-t.top-t.bottom,this.initializeAxes()}initializeAxes(){let t=this,r=(0,gEe.format)("~s");function n(l){return Math.abs(l)-Math.floor(Math.abs(l))>0?l.toString():r(l)}function i(l){let a=l[1]-l[0];return t.meta.height*a/t.meta.width}this.options.xAxis=this.options.xAxis||{},this.options.xAxis.type=this.options.xAxis.type||"linear",this.options.yAxis=this.options.yAxis||{},this.options.yAxis.type=this.options.yAxis.type||"linear";let o=this.meta.xDomain=function(l){if(l.domain)return l.domain;if(l.type==="linear")return[-12/2,12/2];if(l.type==="log")return[1,10];throw Error("axis type "+l.type+" unsupported")}(this.options.xAxis),u=this.meta.yDomain=function(l){if(l.domain)return l.domain;let a=i(o);if(l.type==="linear")return[-a/2,a/2];if(l.type==="log")return[1,10];throw Error("axis type "+l.type+" unsupported")}(this.options.yAxis);this.meta.xScale||(this.meta.xScale=Gee(this.options.xAxis.type)()),this.meta.xScale.domain(o).range(this.options.xAxis.invert?[this.meta.width,0]:[0,this.meta.width]),this.meta.yScale||(this.meta.yScale=Gee(this.options.yAxis.type)()),this.meta.yScale.domain(u).range(this.options.yAxis.invert?[0,this.meta.height]:[this.meta.height,0]),this.meta.xAxis||(this.meta.xAxis=(0,Wee.axisBottom)(this.meta.xScale)),this.meta.xAxis.tickSize(this.options.grid?-this.meta.height:0).tickFormat(n),this.meta.yAxis||(this.meta.yAxis=(0,Wee.axisLeft)(this.meta.yScale)),this.meta.yAxis.tickSize(this.options.grid?-this.meta.width:0).tickFormat(n),this.line=(0,dEe.line)().x(function(l){return t.meta.xScale(l[0])}).y(function(l){return t.meta.yScale(l[1])})}drawGraphWrapper(){let t=this.root=(0,uN.select)(this.options.target).selectAll("svg").data([this.options]);this.root.enter=t.enter().append("svg").attr("class","function-plot").attr("font-size",this.getFontSize()),t.merge(this.root.enter).attr("width",this.meta.width+this.meta.margin.left+this.meta.margin.right).attr("height",this.meta.height+this.meta.margin.top+this.meta.margin.bottom),this.buildTitle(),this.buildLegend(),this.buildCanvas(),this.buildClip(),this.buildAxis(),this.buildAxisLabel();let r=this.tip=(0,wEe.default)(Object.assign(this.options.tip||{},{owner:this}));this.canvas.merge(this.canvas.enter).call(r),this.setUpPlugins(),this.draw(),this.buildZoomHelper()}buildTitle(){let t=this.root.merge(this.root.enter).selectAll("text.title").data(function(n){return[n.title].filter(Boolean)});t.enter().append("text").merge(t).attr("class","title").attr("y",this.meta.margin.top/2).attr("x",this.meta.margin.left+this.meta.width/2).attr("font-size",25).attr("text-anchor","middle").attr("alignment-baseline","middle").text(this.options.title),t.exit().remove()}buildLegend(){this.root.enter.append("text").attr("class","top-right-legend").attr("text-anchor","end"),this.root.merge(this.root.enter).select(".top-right-legend").attr("y",this.meta.margin.top/2).attr("x",this.meta.width+this.meta.margin.left)}buildCanvas(){let t=this.canvas=this.root.merge(this.root.enter).selectAll(".canvas").data(function(r){return[r]});this.canvas.enter=t.enter().append("g").attr("class","canvas")}buildClip(){let t=this.id,r=this.canvas.enter.append("defs");r.append("clipPath").attr("id","function-plot-clip-"+t).append("rect").attr("class","clip static-clip"),this.canvas.merge(this.canvas.enter).selectAll(".clip").attr("width",this.meta.width).attr("height",this.meta.height),r.append("clipPath").append("marker").attr("id",this.markerId).attr("viewBox","0 -5 10 10").attr("refX",10).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("svg:path").attr("d","M0,-5L10,0L0,5L0,0").attr("stroke-width","0px").attr("fill-opacity",1).attr("fill","#777")}buildAxis(){let t=this.canvas.enter;t.append("g").attr("class","x axis"),t.append("g").attr("class","y axis"),this.canvas.merge(this.canvas.enter).select(".x.axis").attr("transform","translate(0,"+this.meta.height+")").call(this.meta.xAxis),this.canvas.merge(this.canvas.enter).select(".y.axis").call(this.meta.yAxis)}buildAxisLabel(){let t=this.canvas,r=t.merge(t.enter).selectAll("text.x.axis-label").data(function(u){return[u.xAxis.label].filter(Boolean)}),n=r.enter().append("text").attr("class","x axis-label").attr("text-anchor","end");r.merge(n).attr("x",this.meta.width).attr("y",this.meta.height-6).text(function(u){return u}),r.exit().remove();let i=t.merge(t.enter).selectAll("text.y.axis-label").data(function(u){return[u.yAxis.label].filter(Boolean)}),o=i.enter().append("text").attr("class","y axis-label").attr("y",6).attr("dy",".75em").attr("text-anchor","end").attr("transform","rotate(-90)");i.merge(o).text(function(u){return u}),i.exit().remove()}buildContent(){let t=this,r=this.canvas;r.merge(r.enter).attr("transform","translate("+this.meta.margin.left+","+this.meta.margin.top+")");let n=this.content=r.merge(r.enter).selectAll(":scope > g.content").data(function(l){return[l]}),i=n.enter().append("g").attr("clip-path","url(#function-plot-clip-"+this.id+")").attr("class","content");if(this.options.xAxis.type==="linear"){let l=n.merge(i).selectAll(":scope > path.y.origin").data([[[0,this.meta.yScale.domain()[0]],[0,this.meta.yScale.domain()[1]]]]),a=l.enter().append("path").attr("class","y origin").attr("stroke","black").attr("opacity",.2);l.merge(a).attr("d",this.line)}if(this.options.yAxis.type==="linear"){let l=n.merge(i).selectAll(":scope > path.x.origin").data([[[this.meta.xScale.domain()[0],0],[this.meta.xScale.domain()[1],0]]]),a=l.enter().append("path").attr("class","x origin").attr("stroke","black").attr("opacity",.2);l.merge(a).attr("d",this.line)}n.merge(i).call((0,yEe.default)({owner:t}));let o=n.merge(i).selectAll(":scope > g.graph").data(l=>l.data.map(DEe.default),l=>l.fn||l.r||l.x||l.text);o.exit().remove();let u=o.enter().append("g").attr("class","graph");o.merge(u).each(function(l,a){l.index=a;let s=(0,uN.select)(this);s.call(lN.default.graphTypes[l.graphType](t)),s.call((0,bEe.default)(t))})}buildZoomHelper(){let t=this;this.meta.zoomBehavior||(this.meta.zoomBehavior=(0,vEe.zoom)().on("zoom",function(n){t.getEmitInstance().emit("all:zoom",n)}),t.meta.zoomBehavior.xScale=t.meta.xScale.copy(),t.meta.zoomBehavior.yScale=t.meta.yScale.copy()),t.meta.zoomBehavior.xScale.range(t.meta.xScale.range()),t.meta.zoomBehavior.yScale.range(t.meta.yScale.range()),this.canvas.enter.append("rect").call(this.meta.zoomBehavior).attr("class","zoom-and-drag").style("fill","none").style("pointer-events","all").on("mouseover",function(r){t.getEmitInstance().emit("all:mouseover",r)}).on("mouseout",function(r){t.getEmitInstance().emit("all:mouseout",r)}).on("mousemove",function(r){t.getEmitInstance().emit("all:mousemove",r)}),this.draggable=this.canvas.merge(this.canvas.enter).select(".zoom-and-drag").call(r=>{r.node()&&(r.node().instance=t)}).attr("width",this.meta.width).attr("height",this.meta.height)}setUpPlugins(){let t=this.options.plugins||[],r=this;t.forEach(function(n){n(r)})}addLink(){for(let t=0;tthis.meta.height?this.meta.height:l,r.select(".x.axis").attr("transform","translate(0,"+l+")"),r.selectAll(".x.axis path, .x.axis line").attr("transform","translate(0,"+(this.meta.height/2-l+this.meta.height/2)+")")}if(r.select(".y.axis").call(t.meta.yAxis),this.options.yAxis.position==="sticky"){let n=this.meta.xScale.domain()[0],i=this.meta.xScale.domain()[1],o=(i+n)/2,l=this.meta.width/(n-i)*o+this.meta.width/2;l=l<0?0:l,l=l>this.meta.width?this.meta.width:l,r.select(".y.axis").attr("transform","translate("+l+",0)"),r.selectAll(".y.axis path, .y.axis line").attr("transform","translate("+-l+",0)")}r.selectAll(".axis path, .axis line").attr("fill","none").attr("stroke","black").attr("shape-rendering","crispedges").attr("opacity",.1)}syncOptions(){this.options.xAxis.domain=this.meta.xScale.domain(),this.options.yAxis.domain=this.meta.yScale.domain()}getFontSize(){return Math.max(Math.max(this.meta.width,this.meta.height)/50,8)}draw(){let t=this;t.emit("before:draw"),t.syncOptions(),t.updateAxes(),t.buildContent(),t.emit("after:draw")}setUpEventListeners(){let t=this,r=this.getEmitInstance();r&&r.removeAllListeners();let n={mousemove:function(o){t.tip.move(o)},mouseover:function(){t.tip.show()},mouseout:function(){t.tip.hide()},zoom:function({transform:u}){if(t.options.disableZoom)return;let l=u.rescaleX(t.meta.zoomBehavior.xScale).interpolate(Vee.interpolateRound),a=u.rescaleY(t.meta.zoomBehavior.yScale).interpolate(Vee.interpolateRound);t.meta.xScale.domain(l.domain()).range(l.range()),t.meta.yScale.domain(a.domain()).range(a.range())},"tip:update":function({x:o,y:u,index:l}){let a=t.root.merge(t.root.enter).datum().data[l],s=a.title||"",f=a.renderer||function(h,y){return h.toFixed(3)+", "+y.toFixed(3)},p=[];s&&p.push(s),p.push(f(o,u)),t.root.select(".top-right-legend").attr("fill",lN.default.COLORS[l]).text(p.join(" "))}},i={mousemove:function(o){let u=(0,uN.pointer)(o,t.draggable.node()),l={x:t.meta.xScale.invert(u[0]),y:t.meta.yScale.invert(u[1])};t.linkedGraphs.forEach(function(a){a.emit("before:mousemove",l),a.emit("mousemove",l)})},zoom:function(o){t.linkedGraphs.forEach(function(u){u.draggable.node().__zoom=t.draggable.node().__zoom,u.emit("zoom",o),u.draw()}),t.emit("all:mousemove",o)}};Object.keys(n).forEach(function(o){!i[o]&&t.on("all:"+o,function(){let u=Array.prototype.slice.call(arguments);t.linkedGraphs.forEach(function(l){let a=u.slice();a.unshift(o),l.emit.apply(l,a)})}),t.on(o,n[o])}),Object.keys(i).forEach(function(o){t.on("all:"+o,i[o])})}};qd.Chart=fN;fN.cache={}});var Xee=vt(Zee=>{"use strict";g();x();v();Object.defineProperty(Zee,"__esModule",{value:!0})});var ete=vt(mn=>{"use strict";g();x();v();var Kee=mn&&mn.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),NEe=mn&&mn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Jee=mn&&mn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Kee(t,e,r);return NEe(t,e),t},Qee=mn&&mn.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Kee(t,e,r)};Object.defineProperty(mn,"__esModule",{value:!0});mn.GraphTypeScatter=mn.GraphTypePolyline=mn.GraphTypeInterval=mn.EvalInterval=mn.EvalBuiltIn=mn.registerGraphType=mn.Chart=void 0;aW();var oO=Yee();Object.defineProperty(mn,"Chart",{enumerable:!0,get:function(){return oO.Chart}});var Ud=Jee(Td());Object.defineProperty(mn,"registerGraphType",{enumerable:!0,get:function(){return Ud.registerGraphType}});var am=p1(),SEe=Jee(sc());(0,Ud.registerGraphType)("polyline",am.polyline);(0,Ud.registerGraphType)("interval",am.interval);(0,Ud.registerGraphType)("scatter",am.scatter);(0,Ud.registerGraphType)("text",am.text);function cN(e){e.data=e.data||[];let t=oO.Chart.cache[e.id];return t||(t=new oO.Chart(e)),t.build()}mn.default=cN;cN.globals=Ud.default;cN.$eval=SEe;cN.graphTypes={interval:am.interval,polyline:am.polyline,scatter:am.scatter};Qee(Xee(),mn);var jee=sc();Object.defineProperty(mn,"EvalBuiltIn",{enumerable:!0,get:function(){return jee.builtIn}});Object.defineProperty(mn,"EvalInterval",{enumerable:!0,get:function(){return jee.interval}});var aO=p1();Object.defineProperty(mn,"GraphTypeInterval",{enumerable:!0,get:function(){return aO.interval}});Object.defineProperty(mn,"GraphTypePolyline",{enumerable:!0,get:function(){return aO.polyline}});Object.defineProperty(mn,"GraphTypeScatter",{enumerable:!0,get:function(){return aO.scatter}});Qee(iO(),mn)});var nte=vt((sO,rte)=>{g();x();v();(function(e,t){var r=t(e);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return r});else if(typeof sO=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))rte.exports=r;else{var n=e.DeepDiff;r.noConflict=function(){return e.DeepDiff===r&&(e.DeepDiff=n),r},e.DeepDiff=r}})(sO,function(e){var t=["N","E","A","D"];function r(C,P){C.super_=P,C.prototype=Object.create(P.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}})}function n(C,P){Object.defineProperty(this,"kind",{value:C,enumerable:!0}),P&&P.length&&Object.defineProperty(this,"path",{value:P,enumerable:!0})}function i(C,P,R){i.super_.call(this,"E",C),Object.defineProperty(this,"lhs",{value:P,enumerable:!0}),Object.defineProperty(this,"rhs",{value:R,enumerable:!0})}r(i,n);function o(C,P){o.super_.call(this,"N",C),Object.defineProperty(this,"rhs",{value:P,enumerable:!0})}r(o,n);function u(C,P){u.super_.call(this,"D",C),Object.defineProperty(this,"lhs",{value:P,enumerable:!0})}r(u,n);function l(C,P,R){l.super_.call(this,"A",C),Object.defineProperty(this,"index",{value:P,enumerable:!0}),Object.defineProperty(this,"item",{value:R,enumerable:!0})}r(l,n);function a(C,P,R){var q=C.slice((R||P)+1||C.length);return C.length=P<0?C.length+P:P,C.push.apply(C,q),C}function s(C){var P=typeof C;return P!=="object"?P:C===Math?"math":C===null?"null":Array.isArray(C)?"array":Object.prototype.toString.call(C)==="[object Date]"?"date":typeof C.toString=="function"&&/^\/.*\//.test(C.toString())?"regexp":"object"}function f(C){var P=0;if(C.length===0)return P;for(var R=0;R0&&V[V.length-1].lhs&&Object.getOwnPropertyDescriptor(V[V.length-1].lhs,H),ce=Z!=="undefined"||V&&V.length>0&&V[V.length-1].rhs&&Object.getOwnPropertyDescriptor(V[V.length-1].rhs,H);if(!we&&ce)R.push(new o(ee,P));else if(!ce&&we)R.push(new u(ee,C));else if(s(C)!==s(P))R.push(new i(ee,C,P));else if(s(C)==="date"&&C-P!==0)R.push(new i(ee,C,P));else if(Y==="object"&&C!==null&&P!==null){for(le=V.length-1;le>-1;--le)if(V[le].lhs===C){De=!0;break}if(De)C!==P&&R.push(new i(ee,C,P));else{if(V.push({lhs:C,rhs:P}),Array.isArray(C)){for(W&&(C.sort(function(Ce,Oe){return p(Ce)-p(Oe)}),P.sort(function(Ce,Oe){return p(Ce)-p(Oe)})),le=P.length-1,re=C.length-1;le>re;)R.push(new l(ee,le,new o(void 0,P[le--])));for(;re>le;)R.push(new l(ee,re,new u(void 0,C[re--])));for(;le>=0;--le)h(C[le],P[le],R,q,ee,le,V,W)}else{var Se=Object.keys(C),Pe=Object.keys(P);for(le=0;le=0?(h(C[he],P[he],R,q,ee,he,V,W),Pe[De]=null):h(C[he],void 0,R,q,ee,he,V,W);for(le=0;le"u"&&P&&~t.indexOf(P.kind)&&(R=P),C&&R&&R.kind){for(var q=C,U=-1,H=R.path?R.path.length-1:0;++U"u"&&(q[R.path[U]]=typeof R.path[U+1]<"u"&&typeof R.path[U+1]=="number"?[]:{}),q=q[R.path[U]];switch(R.kind){case"A":R.path&&typeof q[R.path[U]]>"u"&&(q[R.path[U]]=[]),S(R.path?q[R.path[U]]:q,R.index,R.item);break;case"D":delete q[R.path[U]];break;case"E":case"N":q[R.path[U]]=R.rhs;break}}}function M(C,P,R){if(R.path&&R.path.length){var q=C[P],U,H=R.path.length-1;for(U=0;U"u"&&(q[R.path[U]]={}),q=q[R.path[U]];switch(R.kind){case"A":M(q[R.path[U]],R.index,R.item);break;case"D":q[R.path[U]]=R.lhs;break;case"E":q[R.path[U]]=R.lhs;break;case"N":delete q[R.path[U]];break}}}function F(C,P,R){if(C&&P){var q=function(U){(!R||R(C,P,U))&&O(C,P,U)};y(C,P,q)}}return Object.defineProperties(w,{diff:{value:w,enumerable:!0},orderIndependentDiff:{value:A,enumerable:!0},observableDiff:{value:y,enumerable:!0},orderIndependentObservableDiff:{value:b,enumerable:!0},orderIndepHash:{value:p,enumerable:!0},applyDiff:{value:F,enumerable:!0},applyChange:{value:O,enumerable:!0},revertChange:{value:I,enumerable:!0},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:!0}}),w.DeepDiff=w,e&&(e.DeepDiff=w),w})});var pte=vt((u2r,hN)=>{g();x();v();(function(e,t,r){if(!e)return;for(var n={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},u={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,a=1;a<20;++a)n[111+a]="f"+a;for(a=0;a<=9;++a)n[a+96]=a.toString();function s(C,P,R){if(C.addEventListener){C.addEventListener(P,R,!1);return}C.attachEvent("on"+P,R)}function f(C){if(C.type=="keypress"){var P=String.fromCharCode(C.which);return C.shiftKey||(P=P.toLowerCase()),P}return n[C.which]?n[C.which]:i[C.which]?i[C.which]:String.fromCharCode(C.which).toLowerCase()}function p(C,P){return C.sort().join(",")===P.sort().join(",")}function h(C){var P=[];return C.shiftKey&&P.push("shift"),C.altKey&&P.push("alt"),C.ctrlKey&&P.push("ctrl"),C.metaKey&&P.push("meta"),P}function y(C){if(C.preventDefault){C.preventDefault();return}C.returnValue=!1}function b(C){if(C.stopPropagation){C.stopPropagation();return}C.cancelBubble=!0}function w(C){return C=="shift"||C=="ctrl"||C=="alt"||C=="meta"}function A(){if(!l){l={};for(var C in n)C>95&&C<112||n.hasOwnProperty(C)&&(l[n[C]]=C)}return l}function S(C,P,R){return R||(R=A()[C]?"keydown":"keypress"),R=="keypress"&&P.length&&(R="keydown"),R}function O(C){return C==="+"?["+"]:(C=C.replace(/\+{2}/g,"+plus"),C.split("+"))}function M(C,P){var R,q,U,H=[];for(R=O(C),U=0;U1){le(he,Pe,De,we);return}Ce=M(he,we),P._callbacks[Ce.key]=P._callbacks[Ce.key]||[],ee(Ce.key,Ce.modifiers,{type:Ce.action},ce,he,Se),P._callbacks[Ce.key][ce?"unshift":"push"]({callback:De,modifiers:Ce.modifiers,action:Ce.action,seq:ce,level:Se,combo:he})}P._bindMultiple=function(he,De,we){for(var ce=0;ce-1||I(P,R.target))return!1;if("composedPath"in C&&typeof C.composedPath=="function"){var q=C.composedPath()[0];q!==C.target&&(P=q)}return P.tagName=="INPUT"||P.tagName=="SELECT"||P.tagName=="TEXTAREA"||P.isContentEditable},F.prototype.handleKey=function(){var C=this;return C._handleKey.apply(C,arguments)},F.addKeycodes=function(C){for(var P in C)C.hasOwnProperty(P)&&(n[P]=C[P]);l=null},F.init=function(){var C=F(t);for(var P in C)P.charAt(0)!=="_"&&(F[P]=function(R){return function(){return C[R].apply(C,arguments)}}(P))},F.init(),e.Mousetrap=F,typeof hN<"u"&&hN.exports&&(hN.exports=F),typeof define=="function"&&define.amd&&define(function(){return F})})(typeof window<"u"?window:null,typeof window<"u"?document:null)});g();x();v();g();x();v();var Ve=e=>document.querySelector(e),Kn=e=>document.querySelectorAll(e),Xt={get:e=>JSON.parse(localStorage.getItem(e)),set:(e,t)=>{localStorage.setItem(e,JSON.stringify(t))}},Ge={activePlot:null,activePage:null,currencyRates:{},mathScope:{},plotFunction:null,refreshCM:!0,settings:null,udfList:[],uduList:[]};g();x();v();g();x();v();g();x();v();g();x();v();g();x();v();var Vm=ln(Wg(),1);function wu(e){Vm.default.modal(e,{bgClose:!1,stack:!0}).show()}function cl(e,t){Vm.default.util.on("#dialog-error","beforeshow",()=>{Ve("#errTitle").innerHTML=e,Ve("#errMsg").innerHTML=t}),wu("#dialog-error")}function Rn(e,t){Vm.default.notification({message:e,pos:Ge.settings.notifyLocation,status:t||"primary",timeout:+Ge.settings.notifyDuration})}function Gm(e,t){Ve("#confirmMsg").innerHTML=e,wu("#dialog-confirm");let r=n=>{t(),n.stopPropagation(),Vm.default.modal("#dialog-confirm").hide(),Ve("#confirm-yes").removeEventListener("click",r)};Ve("#confirm-yes").addEventListener("click",r),Vm.default.util.on("#dialog-confirm","hidden",()=>{Ve("#confirm-yes").removeEventListener("click",r)})}var MO=navigator.userAgent.toLowerCase().includes("mac"),Bi=navigator.userAgent.toLowerCase().includes("electron");function Ux(){let e=Ge.settings.locale==="system"?navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language:Ge.settings.locale;return 1.11.toLocaleString(e).match(/[,]/)}function Hx(){Ve("#resetSizeButton").style.display=Bi&&numara.isResized()&&!numara.isMaximized()?"block":"none"}function NS(){numara.isMaximized()?numara.unmaximize():numara.maximize()}function TO(){Bi&&(numara.checkUpdate(),numara.notifyUpdate(()=>{Rn('Updating Numara... View update status'),Ve("#notificationDot").style.display="block"}),numara.updateStatus((e,t)=>{t==="ready"?(Ve("#dialog-about-updateStatus").innerHTML="Restart Numara to finish updating.",Ve("#restartButton").style.display="inline-block",Ve("#dialog-about").classList.contains("uk-open")||Rn('Restart Numara to finish updating. Restart Now')):Ve("#dialog-about-updateStatus").innerHTML=t}))}g();x();v();g();x();v();g();x();v();g();x();v();var pl=class extends Error{},$x=class extends pl{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}},Wx=class extends pl{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}},Vx=class extends pl{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}},Cs=class extends pl{},Ym=class extends pl{constructor(t){super(`Invalid unit ${t}`)}},di=class extends pl{},Ms=class extends pl{constructor(){super("Zone is an abstract class")}};g();x();v();g();x();v();g();x();v();var _t="numeric",Ts="short",ma="long",yf={year:_t,month:_t,day:_t},Vg={year:_t,month:Ts,day:_t},SS={year:_t,month:Ts,day:_t,weekday:Ts},Gg={year:_t,month:ma,day:_t},Yg={year:_t,month:ma,day:_t,weekday:ma},Zg={hour:_t,minute:_t},Xg={hour:_t,minute:_t,second:_t},Kg={hour:_t,minute:_t,second:_t,timeZoneName:Ts},Jg={hour:_t,minute:_t,second:_t,timeZoneName:ma},Qg={hour:_t,minute:_t,hourCycle:"h23"},jg={hour:_t,minute:_t,second:_t,hourCycle:"h23"},ev={hour:_t,minute:_t,second:_t,hourCycle:"h23",timeZoneName:Ts},tv={hour:_t,minute:_t,second:_t,hourCycle:"h23",timeZoneName:ma},rv={year:_t,month:_t,day:_t,hour:_t,minute:_t},nv={year:_t,month:_t,day:_t,hour:_t,minute:_t,second:_t},iv={year:_t,month:Ts,day:_t,hour:_t,minute:_t},ov={year:_t,month:Ts,day:_t,hour:_t,minute:_t,second:_t},ES={year:_t,month:Ts,day:_t,weekday:Ts,hour:_t,minute:_t},av={year:_t,month:ma,day:_t,hour:_t,minute:_t,timeZoneName:Ts},sv={year:_t,month:ma,day:_t,hour:_t,minute:_t,second:_t,timeZoneName:Ts},uv={year:_t,month:ma,day:_t,weekday:ma,hour:_t,minute:_t,timeZoneName:ma},lv={year:_t,month:ma,day:_t,weekday:ma,hour:_t,minute:_t,second:_t,timeZoneName:ma};g();x();v();g();x();v();g();x();v();g();x();v();var Wo=class{get type(){throw new Ms}get name(){throw new Ms}get ianaName(){return this.name}get isUniversal(){throw new Ms}offsetName(t,r){throw new Ms}formatOffset(t,r){throw new Ms}offset(t){throw new Ms}equals(t){throw new Ms}get isValid(){throw new Ms}};var AS=null,wf=class e extends Wo{static get instance(){return AS===null&&(AS=new e),AS}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:r,locale:n}){return Yx(t,r,n)}formatOffset(t,r){return bf(this.offset(t),r)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}};g();x();v();var Xx={};function Jte(e){return Xx[e]||(Xx[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Xx[e]}var Qte={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function jte(e,t){let r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,i,o,u,l,a,s,f]=n;return[u,i,o,l,a,s,f]}function ere(e,t){let r=e.formatToParts(t),n=[];for(let i=0;i=0?b:1e3+b,(h-y)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}};g();x();v();var OO={};function tre(e,t={}){let r=JSON.stringify([e,t]),n=OO[r];return n||(n=new Intl.ListFormat(e,t),OO[r]=n),n}var CS={};function MS(e,t={}){let r=JSON.stringify([e,t]),n=CS[r];return n||(n=new Intl.DateTimeFormat(e,t),CS[r]=n),n}var TS={};function rre(e,t={}){let r=JSON.stringify([e,t]),n=TS[r];return n||(n=new Intl.NumberFormat(e,t),TS[r]=n),n}var OS={};function nre(e,t={}){let{base:r,...n}=t,i=JSON.stringify([e,n]),o=OS[i];return o||(o=new Intl.RelativeTimeFormat(e,t),OS[i]=o),o}var fv=null;function ire(){return fv||(fv=new Intl.DateTimeFormat().resolvedOptions().locale,fv)}var IO={};function ore(e){let t=IO[e];if(!t){let r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,IO[e]=t}return t}function are(e){let t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));let r=e.indexOf("-u-");if(r===-1)return[e];{let n,i;try{n=MS(e).resolvedOptions(),i=e}catch{let a=e.substring(0,r);n=MS(a).resolvedOptions(),i=a}let{numberingSystem:o,calendar:u}=n;return[i,o,u]}}function sre(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}function ure(e){let t=[];for(let r=1;r<=12;r++){let n=Nr.utc(2009,r,1);t.push(e(n))}return t}function lre(e){let t=[];for(let r=1;r<=7;r++){let n=Nr.utc(2016,11,13+r);t.push(e(n))}return t}function Kx(e,t,r,n){let i=e.listingMode();return i==="error"?null:i==="en"?r(t):n(t)}function fre(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}var IS=class{constructor(t,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:i,floor:o,...u}=n;if(!r||Object.keys(u).length>0){let l={useGrouping:!1,...n};n.padTo>0&&(l.minimumIntegerDigits=n.padTo),this.inf=rre(t,l)}}format(t){if(this.inf){let r=this.floor?Math.floor(t):t;return this.inf.format(r)}else{let r=this.floor?Math.floor(t):Xm(t,3);return qn(r,this.padTo)}}},FS=class{constructor(t,r,n){this.opts=n,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let u=-1*(t.offset/60),l=u>=0?`Etc/GMT+${u}`:`Etc/GMT${u}`;t.offset!==0&&fo.create(l).valid?(i=l,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let o={...this.opts};o.timeZone=o.timeZone||i,this.dtf=MS(r,o)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(r=>{if(r.type==="timeZoneName"){let n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},_S=class{constructor(t,r,n){this.opts={style:"long",...n},!r&&Jx()&&(this.rtf=nre(t,n))}format(t,r){return this.rtf?this.rtf.format(t,r):FO(r,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,r){return this.rtf?this.rtf.formatToParts(t,r):[]}},cre={firstDay:1,minimalDays:4,weekend:[6,7]},Zr=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,r,n,i,o=!1){let u=t||$r.defaultLocale,l=u||(o?"en-US":ire()),a=r||$r.defaultNumberingSystem,s=n||$r.defaultOutputCalendar,f=cv(i)||$r.defaultWeekSettings;return new e(l,a,s,f,u)}static resetCache(){fv=null,CS={},TS={},OS={}}static fromObject({locale:t,numberingSystem:r,outputCalendar:n,weekSettings:i}={}){return e.create(t,r,n,i)}constructor(t,r,n,i,o){let[u,l,a]=are(t);this.locale=u,this.numberingSystem=r||l||null,this.outputCalendar=n||a||null,this.weekSettings=i,this.intl=sre(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=fre(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&r?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,cv(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,r=!1){return Kx(this,t,kS,()=>{let n=r?{month:t,day:"numeric"}:{month:t},i=r?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=ure(o=>this.extract(o,n,"month"))),this.monthsCache[i][t]})}weekdays(t,r=!1){return Kx(this,t,BS,()=>{let n=r?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=r?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=lre(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return Kx(this,void 0,()=>LS,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Nr.utc(2016,11,13,9),Nr.utc(2016,11,13,19)].map(r=>this.extract(r,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Kx(this,t,PS,()=>{let r={era:t};return this.eraCache[t]||(this.eraCache[t]=[Nr.utc(-40,1,1),Nr.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[t]})}extract(t,r,n){let i=this.dtFormatter(t,r),o=i.formatToParts(),u=o.find(l=>l.type.toLowerCase()===n);return u?u.value:null}numberFormatter(t={}){return new IS(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,r={}){return new FS(t,this.intl,r)}relFormatter(t={}){return new _S(this.intl,this.isEnglish(),t)}listFormatter(t={}){return tre(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Qx()?ore(this.locale):cre}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}};g();x();v();g();x();v();var qS=null,Li=class e extends Wo{static get utcInstance(){return qS===null&&(qS=new e(0)),qS}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let r=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new e(ap(r[1],r[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${bf(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${bf(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,r){return bf(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};g();x();v();var Km=class extends Wo{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function Os(e,t){let r;if(ir(e)||e===null)return t;if(e instanceof Wo)return e;if(_O(e)){let n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?wf.instance:n==="utc"||n==="gmt"?Li.utcInstance:Li.parseSpecifier(n)||fo.create(e)}else return bu(e)?Li.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Km(e)}var kO=()=>Date.now(),BO="system",LO=null,PO=null,RO=null,qO=60,zO,UO=null,$r=class{static get now(){return kO}static set now(t){kO=t}static set defaultZone(t){BO=t}static get defaultZone(){return Os(BO,wf.instance)}static get defaultLocale(){return LO}static set defaultLocale(t){LO=t}static get defaultNumberingSystem(){return PO}static set defaultNumberingSystem(t){PO=t}static get defaultOutputCalendar(){return RO}static set defaultOutputCalendar(t){RO=t}static get defaultWeekSettings(){return UO}static set defaultWeekSettings(t){UO=cv(t)}static get twoDigitCutoffYear(){return qO}static set twoDigitCutoffYear(t){qO=t%100}static get throwOnInvalid(){return zO}static set throwOnInvalid(t){zO=t}static resetCaches(){Zr.resetCache(),fo.resetCache()}};g();x();v();g();x();v();var Pi=class{constructor(t,r){this.reason=t,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var HO=[0,31,59,90,120,151,181,212,243,273,304,334],$O=[0,31,60,91,121,152,182,213,244,274,305,335];function za(e,t){return new Pi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function jx(e,t,r){let n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);let i=n.getUTCDay();return i===0?7:i}function WO(e,t,r){return r+(up(e)?$O:HO)[t-1]}function VO(e,t){let r=up(e)?$O:HO,n=r.findIndex(o=>osp(n,t,r)?(s=n+1,a=1):s=n,{weekYear:s,weekNumber:a,weekday:l,...hv(e)}}function zS(e,t=4,r=1){let{weekYear:n,weekNumber:i,weekday:o}=e,u=ey(jx(n,1,t),r),l=Df(n),a=i*7+o-u-7+t,s;a<1?(s=n-1,a+=Df(s)):a>l?(s=n+1,a-=Df(n)):s=n;let{month:f,day:p}=VO(s,a);return{year:s,month:f,day:p,...hv(e)}}function ty(e){let{year:t,month:r,day:n}=e,i=WO(t,r,n);return{year:t,ordinal:i,...hv(e)}}function US(e){let{year:t,ordinal:r}=e,{month:n,day:i}=VO(t,r);return{year:t,month:n,day:i,...hv(e)}}function HS(e,t){if(!ir(e.localWeekday)||!ir(e.localWeekNumber)||!ir(e.localWeekYear)){if(!ir(e.weekday)||!ir(e.weekNumber)||!ir(e.weekYear))throw new Cs("Cannot mix locale-based week fields with ISO-based week fields");return ir(e.localWeekday)||(e.weekday=e.localWeekday),ir(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),ir(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function GO(e,t=4,r=1){let n=mv(e.weekYear),i=ha(e.weekNumber,1,sp(e.weekYear,t,r)),o=ha(e.weekday,1,7);return n?i?o?!1:za("weekday",e.weekday):za("week",e.weekNumber):za("weekYear",e.weekYear)}function YO(e){let t=mv(e.year),r=ha(e.ordinal,1,Df(e.year));return t?r?!1:za("ordinal",e.ordinal):za("year",e.year)}function $S(e){let t=mv(e.year),r=ha(e.month,1,12),n=ha(e.day,1,Jm(e.year,e.month));return t?r?n?!1:za("day",e.day):za("month",e.month):za("year",e.year)}function WS(e){let{hour:t,minute:r,second:n,millisecond:i}=e,o=ha(t,0,23)||t===24&&r===0&&n===0&&i===0,u=ha(r,0,59),l=ha(n,0,59),a=ha(i,0,999);return o?u?l?a?!1:za("millisecond",i):za("second",n):za("minute",r):za("hour",t)}function ir(e){return typeof e>"u"}function bu(e){return typeof e=="number"}function mv(e){return typeof e=="number"&&e%1===0}function _O(e){return typeof e=="string"}function XO(e){return Object.prototype.toString.call(e)==="[object Date]"}function Jx(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Qx(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function KO(e){return Array.isArray(e)?e:[e]}function VS(e,t,r){if(e.length!==0)return e.reduce((n,i)=>{let o=[t(i),i];return n&&r(n[0],o[0])===n[0]?n:o},null)[1]}function JO(e,t){return t.reduce((r,n)=>(r[n]=e[n],r),{})}function Nf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function cv(e){if(e==null)return null;if(typeof e!="object")throw new di("Week settings must be an object");if(!ha(e.firstDay,1,7)||!ha(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ha(t,1,7)))throw new di("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ha(e,t,r){return mv(e)&&e>=t&&e<=r}function pre(e,t){return e-t*Math.floor(e/t)}function qn(e,t=2){let r=e<0,n;return r?n="-"+(""+-e).padStart(t,"0"):n=(""+e).padStart(t,"0"),n}function ml(e){if(!(ir(e)||e===null||e===""))return parseInt(e,10)}function Sf(e){if(!(ir(e)||e===null||e===""))return parseFloat(e)}function dv(e){if(!(ir(e)||e===null||e==="")){let t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Xm(e,t,r=!1){let n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function up(e){return e%4===0&&(e%100!==0||e%400===0)}function Df(e){return up(e)?366:365}function Jm(e,t){let r=pre(t-1,12)+1,n=e+(t-r)/12;return r===2?up(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function Zm(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function ZO(e,t,r){return-ey(jx(e,1,t),r)+t-1}function sp(e,t=4,r=1){let n=ZO(e,t,r),i=ZO(e+1,t,r);return(Df(e)-n+i)/7}function gv(e){return e>99?e:e>$r.twoDigitCutoffYear?1900+e:2e3+e}function Yx(e,t,r,n=null){let i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);let u={timeZoneName:t,...o},l=new Intl.DateTimeFormat(r,u).formatToParts(i).find(a=>a.type.toLowerCase()==="timezonename");return l?l.value:null}function ap(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);let n=parseInt(t,10)||0,i=r<0||Object.is(r,-0)?-n:n;return r*60+i}function GS(e){let t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new di(`Invalid unit value ${e}`);return t}function Qm(e,t){let r={};for(let n in e)if(Nf(e,n)){let i=e[n];if(i==null)continue;r[t(n)]=GS(i)}return r}function bf(e,t){let r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${qn(r,2)}:${qn(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${qn(r,2)}${qn(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function hv(e){return JO(e,["hour","minute","second","millisecond"])}var mre=["January","February","March","April","May","June","July","August","September","October","November","December"],YS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],hre=["J","F","M","A","M","J","J","A","S","O","N","D"];function kS(e){switch(e){case"narrow":return[...hre];case"short":return[...YS];case"long":return[...mre];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var ZS=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],XS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],dre=["M","T","W","T","F","S","S"];function BS(e){switch(e){case"narrow":return[...dre];case"short":return[...XS];case"long":return[...ZS];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var LS=["AM","PM"],gre=["Before Christ","Anno Domini"],vre=["BC","AD"],xre=["B","A"];function PS(e){switch(e){case"narrow":return[...xre];case"short":return[...vre];case"long":return[...gre];default:return null}}function QO(e){return LS[e.hour<12?0:1]}function jO(e,t){return BS(t)[e.weekday-1]}function eI(e,t){return kS(t)[e.month-1]}function tI(e,t){return PS(t)[e.year<0?0:1]}function FO(e,t,r="always",n=!1){let i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(r==="auto"&&o){let p=e==="days";switch(t){case 1:return p?"tomorrow":`next ${i[e][0]}`;case-1:return p?"yesterday":`last ${i[e][0]}`;case 0:return p?"today":`this ${i[e][0]}`;default:}}let u=Object.is(t,-0)||t<0,l=Math.abs(t),a=l===1,s=i[e],f=n?a?s[1]:s[2]||s[1]:a?i[e][0]:e;return u?`${l} ${f} ago`:`in ${l} ${f}`}function rI(e,t){let r="";for(let n of e)n.literal?r+=n.val:r+=t(n.val);return r}var yre={D:yf,DD:Vg,DDD:Gg,DDDD:Yg,t:Zg,tt:Xg,ttt:Kg,tttt:Jg,T:Qg,TT:jg,TTT:ev,TTTT:tv,f:rv,ff:iv,fff:av,ffff:uv,F:nv,FF:ov,FFF:sv,FFFF:lv},Ri=class e{static create(t,r={}){return new e(t,r)}static parseFormat(t){let r=null,n="",i=!1,o=[];for(let u=0;u0&&o.push({literal:i||/^\s+$/.test(n),val:n}),r=null,n="",i=!i):i||l===r?n+=l:(n.length>0&&o.push({literal:/^\s+$/.test(n),val:n}),n=l,r=l)}return n.length>0&&o.push({literal:i||/^\s+$/.test(n),val:n}),o}static macroTokenToFormatOpts(t){return yre[t]}constructor(t,r){this.opts=r,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...r}).format()}dtFormatter(t,r={}){return this.loc.dtFormatter(t,{...this.opts,...r})}formatDateTime(t,r){return this.dtFormatter(t,r).format()}formatDateTimeParts(t,r){return this.dtFormatter(t,r).formatToParts()}formatInterval(t,r){return this.dtFormatter(t.start,r).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,r){return this.dtFormatter(t,r).resolvedOptions()}num(t,r=0){if(this.opts.forceSimple)return qn(t,r);let n={...this.opts};return r>0&&(n.padTo=r),this.loc.numberFormatter(n).format(t)}formatDateTimeFromString(t,r){let n=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(y,b)=>this.loc.extract(t,y,b),u=y=>t.isOffsetFixed&&t.offset===0&&y.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,y.format):"",l=()=>n?QO(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(y,b)=>n?eI(t,y):o(b?{month:y}:{month:y,day:"numeric"},"month"),s=(y,b)=>n?jO(t,y):o(b?{weekday:y}:{weekday:y,month:"long",day:"numeric"},"weekday"),f=y=>{let b=e.macroTokenToFormatOpts(y);return b?this.formatWithSystemDefault(t,b):y},p=y=>n?tI(t,y):o({era:y},"era"),h=y=>{switch(y){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return u({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return u({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return u({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return s("short",!0);case"cccc":return s("long",!0);case"ccccc":return s("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return s("short",!1);case"EEEE":return s("long",!1);case"EEEEE":return s("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return p("short");case"GG":return p("long");case"GGGGG":return p("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(y)}};return rI(e.parseFormat(r),h)}formatDurationFromString(t,r){let n=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=a=>s=>{let f=n(s);return f?this.num(a.get(f),s.length):s},o=e.parseFormat(r),u=o.reduce((a,{literal:s,val:f})=>s?a:a.concat(f),[]),l=t.shiftTo(...u.map(n).filter(a=>a));return rI(o,i(l))}};g();x();v();var iI=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function eh(...e){let t=e.reduce((r,n)=>r+n.source,"");return RegExp(`^${t}$`)}function th(...e){return t=>e.reduce(([r,n,i],o)=>{let[u,l,a]=o(t,i);return[{...r,...u},l||n,a]},[{},null,1]).slice(0,2)}function rh(e,...t){if(e==null)return[null,null];for(let[r,n]of t){let i=r.exec(e);if(i)return n(i)}return[null,null]}function oI(...e){return(t,r)=>{let n={},i;for(i=0;iy!==void 0&&(b||y&&f)?-y:y;return[{years:h(Sf(r)),months:h(Sf(n)),weeks:h(Sf(i)),days:h(Sf(o)),hours:h(Sf(u)),minutes:h(Sf(l)),seconds:h(Sf(a),a==="-0"),milliseconds:h(dv(s),p)}]}var Fre={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function QS(e,t,r,n,i,o,u){let l={year:t.length===2?gv(ml(t)):ml(t),month:YS.indexOf(r)+1,day:ml(n),hour:ml(i),minute:ml(o)};return u&&(l.second=ml(u)),e&&(l.weekday=e.length>3?ZS.indexOf(e)+1:XS.indexOf(e)+1),l}var _re=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function kre(e){let[,t,r,n,i,o,u,l,a,s,f,p]=e,h=QS(t,i,n,r,o,u,l),y;return a?y=Fre[a]:s?y=0:y=ap(f,p),[h,new Li(y)]}function Bre(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var Lre=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Pre=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Rre=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function nI(e){let[,t,r,n,i,o,u,l]=e;return[QS(t,i,n,r,o,u,l),Li.utcInstance]}function qre(e){let[,t,r,n,i,o,u,l]=e;return[QS(t,l,r,n,i,o,u),Li.utcInstance]}var zre=eh(bre,JS),Ure=eh(Dre,JS),Hre=eh(Nre,JS),$re=eh(sI),lI=th(Mre,nh,vv,xv),Wre=th(Sre,nh,vv,xv),Vre=th(Ere,nh,vv,xv),Gre=th(nh,vv,xv);function fI(e){return rh(e,[zre,lI],[Ure,Wre],[Hre,Vre],[$re,Gre])}function cI(e){return rh(Bre(e),[_re,kre])}function pI(e){return rh(e,[Lre,nI],[Pre,nI],[Rre,qre])}function mI(e){return rh(e,[Ore,Ire])}var Yre=th(nh);function hI(e){return rh(e,[Tre,Yre])}var Zre=eh(Are,Cre),Xre=eh(uI),Kre=th(nh,vv,xv);function dI(e){return rh(e,[Zre,lI],[Xre,Kre])}var gI="Invalid Duration",xI={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Jre={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...xI},Ua=146097/400,ih=146097/4800,Qre={years:{quarters:4,months:12,weeks:Ua/7,days:Ua,hours:Ua*24,minutes:Ua*24*60,seconds:Ua*24*60*60,milliseconds:Ua*24*60*60*1e3},quarters:{months:3,weeks:Ua/28,days:Ua/4,hours:Ua*24/4,minutes:Ua*24*60/4,seconds:Ua*24*60*60/4,milliseconds:Ua*24*60*60*1e3/4},months:{weeks:ih/7,days:ih,hours:ih*24,minutes:ih*24*60,seconds:ih*24*60*60,milliseconds:ih*24*60*60*1e3},...xI},lp=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],jre=lp.slice(0).reverse();function Ef(e,t,r=!1){let n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new zn(n)}function yI(e,t){let r=t.milliseconds??0;for(let n of jre.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function vI(e,t){let r=yI(e,t)<0?-1:1;lp.reduceRight((n,i)=>{if(ir(t[i]))return n;if(n){let o=t[n]*r,u=e[i][n],l=Math.floor(o/u);t[i]+=l*r,t[n]-=l*u*r}return i},null),lp.reduce((n,i)=>{if(ir(t[i]))return n;if(n){let o=t[n]%1;t[n]-=o,t[i]+=o*e[n][i]}return i},null)}function ene(e){let t={};for(let[r,n]of Object.entries(e))n!==0&&(t[r]=n);return t}var zn=class e{constructor(t){let r=t.conversionAccuracy==="longterm"||!1,n=r?Qre:Jre;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||Zr.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,r){return e.fromObject({milliseconds:t},r)}static fromObject(t,r={}){if(t==null||typeof t!="object")throw new di(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new e({values:Qm(t,e.normalizeUnit),loc:Zr.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(t){if(bu(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t=="object")return e.fromObject(t);throw new di(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,r){let[n]=mI(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,r){let[n]=hI(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,r=null){if(!t)throw new di("need to specify a reason the Duration is invalid");let n=t instanceof Pi?t:new Pi(t,r);if($r.throwOnInvalid)throw new Vx(n);return new e({invalid:n})}static normalizeUnit(t){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!r)throw new Ym(t);return r}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,r={}){let n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Ri.create(this.loc,n).formatDurationFromString(this,t):gI}toHuman(t={}){if(!this.isValid)return gI;let r=lp.map(n=>{let i=this.values[n];return ir(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:n.slice(0,-1)}).format(i)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Xm(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let r=this.toMillis();return r<0||r>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},Nr.fromMillis(r,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?yI(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t),n={};for(let i of lp)(Nf(r.values,i)||Nf(this.values,i))&&(n[i]=r.get(i)+this.get(i));return Ef(this,{values:n},!0)}minus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t);return this.plus(r.negate())}mapUnits(t){if(!this.isValid)return this;let r={};for(let n of Object.keys(this.values))r[n]=GS(t(this.values[n],n));return Ef(this,{values:r},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let r={...this.values,...Qm(t,e.normalizeUnit)};return Ef(this,{values:r})}reconfigure({locale:t,numberingSystem:r,conversionAccuracy:n,matrix:i}={}){let u={loc:this.loc.clone({locale:t,numberingSystem:r}),matrix:i,conversionAccuracy:n};return Ef(this,u)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return vI(this.matrix,t),Ef(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=ene(this.normalize().shiftToAll().toObject());return Ef(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(u=>e.normalizeUnit(u));let r={},n={},i=this.toObject(),o;for(let u of lp)if(t.indexOf(u)>=0){o=u;let l=0;for(let s in n)l+=this.matrix[s][u]*n[s],n[s]=0;bu(i[u])&&(l+=i[u]);let a=Math.trunc(l);r[u]=a,n[u]=(l*1e3-a*1e3)/1e3}else bu(i[u])&&(n[u]=i[u]);for(let u in n)n[u]!==0&&(r[o]+=u===o?n[u]:n[u]/this.matrix[o][u]);return vI(this.matrix,r),Ef(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let r of Object.keys(this.values))t[r]=this.values[r]===0?0:-this.values[r];return Ef(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function r(n,i){return n===void 0||n===0?i===void 0||i===0:n===i}for(let n of lp)if(!r(this.values[n],t.values[n]))return!1;return!0}};g();x();v();var oh="Invalid Interval";function tne(e,t){return!e||!e.isValid?hl.invalid("missing or invalid start"):!t||!t.isValid?hl.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:r}={}){return this.isValid?e.fromDateTimes(t||this.s,r||this.e):this}splitAt(...t){if(!this.isValid)return[];let r=t.map(ah).filter(u=>this.contains(u)).sort((u,l)=>u.toMillis()-l.toMillis()),n=[],{s:i}=this,o=0;for(;i+this.e?this.e:u;n.push(e.fromDateTimes(i,l)),i=l,o+=1}return n}splitBy(t){let r=zn.fromDurationLike(t);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,i=1,o,u=[];for(;na*i));o=+l>+this.e?this.e:l,u.push(e.fromDateTimes(n,o)),n=o,i+=1}return u}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let r=this.s>t.s?this.s:t.s,n=this.e=n?null:e.fromDateTimes(r,n)}union(t){if(!this.isValid)return this;let r=this.st.e?this.e:t.e;return e.fromDateTimes(r,n)}static merge(t){let[r,n]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],u)=>o?o.overlaps(u)||o.abutsStart(u)?[i,o.union(u)]:[i.concat([o]),u]:[i,u],[[],null]);return n&&r.push(n),r}static xor(t){let r=null,n=0,i=[],o=t.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),u=Array.prototype.concat(...o),l=u.sort((a,s)=>a.time-s.time);for(let a of l)n+=a.type==="s"?1:-1,n===1?r=a.time:(r&&+r!=+a.time&&i.push(e.fromDateTimes(r,a.time)),r=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:oh}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=yf,r={}){return this.isValid?Ri.create(this.s.loc.clone(r),t).formatInterval(this):oh}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:oh}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:oh}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:oh}toFormat(t,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${r}${this.e.toFormat(t)}`:oh}toDuration(t,r){return this.isValid?this.e.diff(this.s,t,r):zn.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}};g();x();v();var dl=class{static hasDST(t=$r.defaultZone){let r=Nr.now().setZone(t).set({month:12});return!t.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(t){return fo.isValidZone(t)}static normalizeZone(t){return Os(t,$r.defaultZone)}static getStartOfWeek({locale:t=null,locObj:r=null}={}){return(r||Zr.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:r=null}={}){return(r||Zr.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:r=null}={}){return(r||Zr.create(t)).getWeekendDays().slice()}static months(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Zr.create(r,n,o)).months(t)}static monthsFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Zr.create(r,n,o)).months(t,!0)}static weekdays(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Zr.create(r,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||Zr.create(r,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Zr.create(t).meridiems()}static eras(t="short",{locale:r=null}={}){return Zr.create(r,null,"gregory").eras(t)}static features(){return{relative:Jx(),localeWeek:Qx()}}};g();x();v();function wI(e,t){let r=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(zn.fromMillis(n).as("days"))}function rne(e,t,r){let n=[["years",(a,s)=>s.year-a.year],["quarters",(a,s)=>s.quarter-a.quarter+(s.year-a.year)*4],["months",(a,s)=>s.month-a.month+(s.year-a.year)*12],["weeks",(a,s)=>{let f=wI(a,s);return(f-f%7)/7}],["days",wI]],i={},o=e,u,l;for(let[a,s]of n)r.indexOf(a)>=0&&(u=a,i[a]=s(e,t),l=o.plus(i),l>t?(i[a]--,e=o.plus(i),e>t&&(l=e,i[a]--,e=o.plus(i))):e=l);return[e,i,l,u]}function bI(e,t,r,n){let[i,o,u,l]=rne(e,t,r),a=t-i,s=r.filter(p=>["hours","minutes","seconds","milliseconds"].indexOf(p)>=0);s.length===0&&(u0?zn.fromMillis(a,n).shiftTo(...s).plus(f):f}g();x();v();g();x();v();var jS={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},DI={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},nne=jS.hanidec.replace(/[\[|\]]/g,"").split("");function NI(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r=o&&n<=u&&(t+=n-o)}}return parseInt(t,10)}else return t}function Ha({numberingSystem:e},t=""){return new RegExp(`${jS[e||"latn"]}${t}`)}var ine="missing Intl.DateTimeFormat.formatToParts support";function Wr(e,t=r=>r){return{regex:e,deser:([r])=>t(NI(r))}}var one="\xA0",AI=`[ ${one}]`,CI=new RegExp(AI,"g");function ane(e){return e.replace(/\./g,"\\.?").replace(CI,AI)}function SI(e){return e.replace(/\./g,"").replace(CI," ").toLowerCase()}function Is(e,t){return e===null?null:{regex:RegExp(e.map(ane).join("|")),deser:([r])=>e.findIndex(n=>SI(r)===SI(n))+t}}function EI(e,t){return{regex:e,deser:([,r,n])=>ap(r,n),groups:t}}function ry(e){return{regex:e,deser:([t])=>t}}function sne(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function une(e,t){let r=Ha(t),n=Ha(t,"{2}"),i=Ha(t,"{3}"),o=Ha(t,"{4}"),u=Ha(t,"{6}"),l=Ha(t,"{1,2}"),a=Ha(t,"{1,3}"),s=Ha(t,"{1,6}"),f=Ha(t,"{1,9}"),p=Ha(t,"{2,4}"),h=Ha(t,"{4,6}"),y=A=>({regex:RegExp(sne(A.val)),deser:([S])=>S,literal:!0}),w=(A=>{if(e.literal)return y(A);switch(A.val){case"G":return Is(t.eras("short"),0);case"GG":return Is(t.eras("long"),0);case"y":return Wr(s);case"yy":return Wr(p,gv);case"yyyy":return Wr(o);case"yyyyy":return Wr(h);case"yyyyyy":return Wr(u);case"M":return Wr(l);case"MM":return Wr(n);case"MMM":return Is(t.months("short",!0),1);case"MMMM":return Is(t.months("long",!0),1);case"L":return Wr(l);case"LL":return Wr(n);case"LLL":return Is(t.months("short",!1),1);case"LLLL":return Is(t.months("long",!1),1);case"d":return Wr(l);case"dd":return Wr(n);case"o":return Wr(a);case"ooo":return Wr(i);case"HH":return Wr(n);case"H":return Wr(l);case"hh":return Wr(n);case"h":return Wr(l);case"mm":return Wr(n);case"m":return Wr(l);case"q":return Wr(l);case"qq":return Wr(n);case"s":return Wr(l);case"ss":return Wr(n);case"S":return Wr(a);case"SSS":return Wr(i);case"u":return ry(f);case"uu":return ry(l);case"uuu":return Wr(r);case"a":return Is(t.meridiems(),0);case"kkkk":return Wr(o);case"kk":return Wr(p,gv);case"W":return Wr(l);case"WW":return Wr(n);case"E":case"c":return Wr(r);case"EEE":return Is(t.weekdays("short",!1),1);case"EEEE":return Is(t.weekdays("long",!1),1);case"ccc":return Is(t.weekdays("short",!0),1);case"cccc":return Is(t.weekdays("long",!0),1);case"Z":case"ZZ":return EI(new RegExp(`([+-]${l.source})(?::(${n.source}))?`),2);case"ZZZ":return EI(new RegExp(`([+-]${l.source})(${n.source})?`),2);case"z":return ry(/[a-z_+-/]{1,256}?/i);case" ":return ry(/[^\S\n\r]/);default:return y(A)}})(e)||{invalidReason:ine};return w.token=e,w}var lne={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function fne(e,t,r){let{type:n,value:i}=e;if(n==="literal"){let a=/^\s+$/.test(i);return{literal:!a,val:a?" ":i}}let o=t[n],u=n;n==="hour"&&(t.hour12!=null?u=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?u="hour12":u="hour24":u=r.hour12?"hour12":"hour24");let l=lne[u];if(typeof l=="object"&&(l=l[o]),l)return{literal:!1,val:l}}function cne(e){return[`^${e.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,e]}function pne(e,t,r){let n=e.match(t);if(n){let i={},o=1;for(let u in r)if(Nf(r,u)){let l=r[u],a=l.groups?l.groups+1:1;!l.literal&&l.token&&(i[l.token.val[0]]=l.deser(n.slice(o,o+a))),o+=a}return[n,i]}else return[n,{}]}function mne(e){let t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,n;return ir(e.z)||(r=fo.create(e.z)),ir(e.Z)||(r||(r=new Li(e.Z)),n=e.Z),ir(e.q)||(e.M=(e.q-1)*3+1),ir(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),ir(e.u)||(e.S=dv(e.u)),[Object.keys(e).reduce((o,u)=>{let l=t(u);return l&&(o[l]=e[u]),o},{}),r,n]}var eE=null;function hne(){return eE||(eE=Nr.fromMillis(1555555555555)),eE}function dne(e,t){if(e.literal)return e;let r=Ri.macroTokenToFormatOpts(e.val),n=nE(r,t);return n==null||n.includes(void 0)?e:n}function tE(e,t){return Array.prototype.concat(...e.map(r=>dne(r,t)))}function rE(e,t,r){let n=tE(Ri.parseFormat(r),e),i=n.map(u=>une(u,e)),o=i.find(u=>u.invalidReason);if(o)return{input:t,tokens:n,invalidReason:o.invalidReason};{let[u,l]=cne(i),a=RegExp(u,"i"),[s,f]=pne(t,a,l),[p,h,y]=f?mne(f):[null,null,void 0];if(Nf(f,"a")&&Nf(f,"H"))throw new Cs("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:n,regex:a,rawMatches:s,matches:f,result:p,zone:h,specificOffset:y}}}function MI(e,t,r){let{result:n,zone:i,specificOffset:o,invalidReason:u}=rE(e,t,r);return[n,i,o,u]}function nE(e,t){if(!e)return null;let n=Ri.create(t,e).dtFormatter(hne()),i=n.formatToParts(),o=n.resolvedOptions();return i.map(u=>fne(u,e,o))}var iE="Invalid DateTime",TI=864e13;function ny(e){return new Pi("unsupported zone",`the zone "${e.name}" is not supported`)}function oE(e){return e.weekData===null&&(e.weekData=pv(e.c)),e.weekData}function aE(e){return e.localWeekData===null&&(e.localWeekData=pv(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function fp(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Nr({...r,...t,old:r})}function LI(e,t,r){let n=e-t*60*1e3,i=r.offset(n);if(t===i)return[n,t];n-=(i-t)*60*1e3;let o=r.offset(n);return i===o?[n,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function iy(e,t){e+=t*60*1e3;let r=new Date(e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function ay(e,t,r){return LI(Zm(e),t,r)}function OI(e,t){let r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:n,month:i,day:Math.min(e.c.day,Jm(n,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},u=zn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=Zm(o),[a,s]=LI(l,r,e.zone);return u!==0&&(a+=u,s=e.zone.offset(a)),{ts:a,o:s}}function yv(e,t,r,n,i,o){let{setZone:u,zone:l}=r;if(e&&Object.keys(e).length!==0||t){let a=t||l,s=Nr.fromObject(e,{...r,zone:a,specificOffset:o});return u?s:s.setZone(l)}else return Nr.invalid(new Pi("unparsable",`the input "${i}" can't be parsed as ${n}`))}function oy(e,t,r=!0){return e.isValid?Ri.create(Zr.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function sE(e,t){let r=e.c.year>9999||e.c.year<0,n="";return r&&e.c.year>=0&&(n+="+"),n+=qn(e.c.year,r?6:4),t?(n+="-",n+=qn(e.c.month),n+="-",n+=qn(e.c.day)):(n+=qn(e.c.month),n+=qn(e.c.day)),n}function II(e,t,r,n,i,o){let u=qn(e.c.hour);return t?(u+=":",u+=qn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(u+=":")):u+=qn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(u+=qn(e.c.second),(e.c.millisecond!==0||!n)&&(u+=".",u+=qn(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?u+="Z":e.o<0?(u+="-",u+=qn(Math.trunc(-e.o/60)),u+=":",u+=qn(Math.trunc(-e.o%60))):(u+="+",u+=qn(Math.trunc(e.o/60)),u+=":",u+=qn(Math.trunc(e.o%60)))),o&&(u+="["+e.zone.ianaName+"]"),u}var PI={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},gne={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},vne={ordinal:1,hour:0,minute:0,second:0,millisecond:0},RI=["year","month","day","hour","minute","second","millisecond"],xne=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],yne=["year","ordinal","hour","minute","second","millisecond"];function wne(e){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Ym(e);return t}function FI(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return wne(e)}}function _I(e,t){let r=Os(t.zone,$r.defaultZone),n=Zr.fromObject(t),i=$r.now(),o,u;if(ir(e.year))o=i;else{for(let s of RI)ir(e[s])&&(e[s]=PI[s]);let l=$S(e)||WS(e);if(l)return Nr.invalid(l);let a=r.offset(i);[o,u]=ay(e,a,r)}return new Nr({ts:o,zone:r,loc:n,o:u})}function kI(e,t,r){let n=ir(r.round)?!0:r.round,i=(u,l)=>(u=Xm(u,n||r.calendary?0:2,!0),t.loc.clone(r).relFormatter(r).format(u,l)),o=u=>r.calendary?t.hasSame(e,u)?0:t.startOf(u).diff(e.startOf(u),u).get(u):t.diff(e,u).get(u);if(r.unit)return i(o(r.unit),r.unit);for(let u of r.units){let l=o(u);if(Math.abs(l)>=1)return i(l,u)}return i(e>t?-0:0,r.units[r.units.length-1])}function BI(e){let t={},r;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],r=Array.from(e).slice(0,e.length-1)):r=Array.from(e),[t,r]}var Nr=class e{constructor(t){let r=t.zone||$r.defaultZone,n=t.invalid||(Number.isNaN(t.ts)?new Pi("invalid input"):null)||(r.isValid?null:ny(r));this.ts=ir(t.ts)?$r.now():t.ts;let i=null,o=null;if(!n)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(r))[i,o]=[t.old.c,t.old.o];else{let l=r.offset(this.ts);i=iy(this.ts,l),n=Number.isNaN(i.year)?new Pi("invalid input"):null,i=n?null:i,o=n?null:l}this._zone=r,this.loc=t.loc||Zr.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[t,r]=BI(arguments),[n,i,o,u,l,a,s]=r;return _I({year:n,month:i,day:o,hour:u,minute:l,second:a,millisecond:s},t)}static utc(){let[t,r]=BI(arguments),[n,i,o,u,l,a,s]=r;return t.zone=Li.utcInstance,_I({year:n,month:i,day:o,hour:u,minute:l,second:a,millisecond:s},t)}static fromJSDate(t,r={}){let n=XO(t)?t.valueOf():NaN;if(Number.isNaN(n))return e.invalid("invalid input");let i=Os(r.zone,$r.defaultZone);return i.isValid?new e({ts:n,zone:i,loc:Zr.fromObject(r)}):e.invalid(ny(i))}static fromMillis(t,r={}){if(bu(t))return t<-TI||t>TI?e.invalid("Timestamp out of range"):new e({ts:t,zone:Os(r.zone,$r.defaultZone),loc:Zr.fromObject(r)});throw new di(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,r={}){if(bu(t))return new e({ts:t*1e3,zone:Os(r.zone,$r.defaultZone),loc:Zr.fromObject(r)});throw new di("fromSeconds requires a numerical input")}static fromObject(t,r={}){t=t||{};let n=Os(r.zone,$r.defaultZone);if(!n.isValid)return e.invalid(ny(n));let i=Zr.fromObject(r),o=Qm(t,FI),{minDaysInFirstWeek:u,startOfWeek:l}=HS(o,i),a=$r.now(),s=ir(r.specificOffset)?n.offset(a):r.specificOffset,f=!ir(o.ordinal),p=!ir(o.year),h=!ir(o.month)||!ir(o.day),y=p||h,b=o.weekYear||o.weekNumber;if((y||f)&&b)throw new Cs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&f)throw new Cs("Can't mix ordinal dates with month/day");let w=b||o.weekday&&!y,A,S,O=iy(a,s);w?(A=xne,S=gne,O=pv(O,u,l)):f?(A=yne,S=vne,O=ty(O)):(A=RI,S=PI);let M=!1;for(let U of A){let H=o[U];ir(H)?M?o[U]=S[U]:o[U]=O[U]:M=!0}let I=w?GO(o,u,l):f?YO(o):$S(o),F=I||WS(o);if(F)return e.invalid(F);let C=w?zS(o,u,l):f?US(o):o,[P,R]=ay(C,s,n),q=new e({ts:P,zone:n,o:R,loc:i});return o.weekday&&y&&t.weekday!==q.weekday?e.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${q.toISO()}`):q}static fromISO(t,r={}){let[n,i]=fI(t);return yv(n,i,r,"ISO 8601",t)}static fromRFC2822(t,r={}){let[n,i]=cI(t);return yv(n,i,r,"RFC 2822",t)}static fromHTTP(t,r={}){let[n,i]=pI(t);return yv(n,i,r,"HTTP",r)}static fromFormat(t,r,n={}){if(ir(t)||ir(r))throw new di("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:o=null}=n,u=Zr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[l,a,s,f]=MI(u,t,r);return f?e.invalid(f):yv(l,a,n,`format ${r}`,t,s)}static fromString(t,r,n={}){return e.fromFormat(t,r,n)}static fromSQL(t,r={}){let[n,i]=dI(t);return yv(n,i,r,"SQL",t)}static invalid(t,r=null){if(!t)throw new di("need to specify a reason the DateTime is invalid");let n=t instanceof Pi?t:new Pi(t,r);if($r.throwOnInvalid)throw new $x(n);return new e({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,r={}){let n=nE(t,Zr.fromObject(r));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(t,r={}){return tE(Ri.parseFormat(t),Zr.fromObject(r)).map(i=>i.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?oE(this).weekYear:NaN}get weekNumber(){return this.isValid?oE(this).weekNumber:NaN}get weekday(){return this.isValid?oE(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?aE(this).weekday:NaN}get localWeekNumber(){return this.isValid?aE(this).weekNumber:NaN}get localWeekYear(){return this.isValid?aE(this).weekYear:NaN}get ordinal(){return this.isValid?ty(this.c).ordinal:NaN}get monthShort(){return this.isValid?dl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?dl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?dl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?dl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let t=864e5,r=6e4,n=Zm(this.c),i=this.zone.offset(n-t),o=this.zone.offset(n+t),u=this.zone.offset(n-i*r),l=this.zone.offset(n-o*r);if(u===l)return[this];let a=n-u*r,s=n-l*r,f=iy(a,u),p=iy(s,l);return f.hour===p.hour&&f.minute===p.minute&&f.second===p.second&&f.millisecond===p.millisecond?[fp(this,{ts:a}),fp(this,{ts:s})]:[this]}get isInLeapYear(){return up(this.year)}get daysInMonth(){return Jm(this.year,this.month)}get daysInYear(){return this.isValid?Df(this.year):NaN}get weeksInWeekYear(){return this.isValid?sp(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?sp(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){let{locale:r,numberingSystem:n,calendar:i}=Ri.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:i}}toUTC(t=0,r={}){return this.setZone(Li.instance(t),r)}toLocal(){return this.setZone($r.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(t=Os(t,$r.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(r||n){let o=t.offset(this.ts),u=this.toObject();[i]=ay(u,o,t)}return fp(this,{ts:i,zone:t})}else return e.invalid(ny(t))}reconfigure({locale:t,numberingSystem:r,outputCalendar:n}={}){let i=this.loc.clone({locale:t,numberingSystem:r,outputCalendar:n});return fp(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let r=Qm(t,FI),{minDaysInFirstWeek:n,startOfWeek:i}=HS(r,this.loc),o=!ir(r.weekYear)||!ir(r.weekNumber)||!ir(r.weekday),u=!ir(r.ordinal),l=!ir(r.year),a=!ir(r.month)||!ir(r.day),s=l||a,f=r.weekYear||r.weekNumber;if((s||u)&&f)throw new Cs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&u)throw new Cs("Can't mix ordinal dates with month/day");let p;o?p=zS({...pv(this.c,n,i),...r},n,i):ir(r.ordinal)?(p={...this.toObject(),...r},ir(r.day)&&(p.day=Math.min(Jm(p.year,p.month),p.day))):p=US({...ty(this.c),...r});let[h,y]=ay(p,this.o,this.zone);return fp(this,{ts:h,o:y})}plus(t){if(!this.isValid)return this;let r=zn.fromDurationLike(t);return fp(this,OI(this,r))}minus(t){if(!this.isValid)return this;let r=zn.fromDurationLike(t).negate();return fp(this,OI(this,r))}startOf(t,{useLocaleWeeks:r=!1}={}){if(!this.isValid)return this;let n={},i=zn.normalizeUnit(t);switch(i){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break;case"milliseconds":break}if(i==="weeks")if(r){let o=this.loc.getStartOfWeek(),{weekday:u}=this;uthis.valueOf(),l=u?this:t,a=u?t:this,s=bI(l,a,o,i);return u?s.negate():s}diffNow(t="milliseconds",r={}){return this.diff(e.now(),t,r)}until(t){return this.isValid?hl.fromDateTimes(this,t):this}hasSame(t,r,n){if(!this.isValid)return!1;let i=t.valueOf(),o=this.setZone(t.zone,{keepLocalTime:!0});return o.startOf(r,n)<=i&&i<=o.endOf(r,n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let r=t.base||e.fromObject({},{zone:this.zone}),n=t.padding?thisr.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new di("max requires all arguments be DateTimes");return VS(t,r=>r.valueOf(),Math.max)}static fromFormatExplain(t,r,n={}){let{locale:i=null,numberingSystem:o=null}=n,u=Zr.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return rE(u,t,r)}static fromStringExplain(t,r,n={}){return e.fromFormatExplain(t,r,n)}static get DATE_SHORT(){return yf}static get DATE_MED(){return Vg}static get DATE_MED_WITH_WEEKDAY(){return SS}static get DATE_FULL(){return Gg}static get DATE_HUGE(){return Yg}static get TIME_SIMPLE(){return Zg}static get TIME_WITH_SECONDS(){return Xg}static get TIME_WITH_SHORT_OFFSET(){return Kg}static get TIME_WITH_LONG_OFFSET(){return Jg}static get TIME_24_SIMPLE(){return Qg}static get TIME_24_WITH_SECONDS(){return jg}static get TIME_24_WITH_SHORT_OFFSET(){return ev}static get TIME_24_WITH_LONG_OFFSET(){return tv}static get DATETIME_SHORT(){return rv}static get DATETIME_SHORT_WITH_SECONDS(){return nv}static get DATETIME_MED(){return iv}static get DATETIME_MED_WITH_SECONDS(){return ov}static get DATETIME_MED_WITH_WEEKDAY(){return ES}static get DATETIME_FULL(){return av}static get DATETIME_FULL_WITH_SECONDS(){return sv}static get DATETIME_HUGE(){return uv}static get DATETIME_HUGE_WITH_SECONDS(){return lv}};function ah(e){if(Nr.isDateTime(e))return e;if(e&&e.valueOf&&bu(e.valueOf()))return Nr.fromJSDate(e);if(e&&typeof e=="object")return Nr.fromObject(e);throw new di(`Unknown datetime argument: ${e}, of type ${typeof e}`)}g();x();v();g();x();v();function Jn(){return Jn=Object.assign?Object.assign.bind():function(e){for(var t=1;t{Object.defineProperty(r,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),r}function VI(e,t,r){e[t]!==void 0&&!r.includes(e[t])&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map(n=>JSON.stringify(n)).join(", ")+".")}var ZA={};qa(ZA,{createAbs:()=>Y_,createAccessorNode:()=>v6,createAcos:()=>YB,createAcosh:()=>XB,createAcot:()=>JB,createAcoth:()=>jB,createAcsc:()=>tL,createAcsch:()=>nL,createAdd:()=>a6,createAddScalar:()=>K_,createAnd:()=>hw,createAndTransform:()=>BH,createApply:()=>Dh,createApplyTransform:()=>uH,createArg:()=>Jk,createArrayNode:()=>x6,createAsec:()=>oL,createAsech:()=>sL,createAsin:()=>lL,createAsinh:()=>fL,createAssignmentNode:()=>b6,createAtan:()=>cL,createAtan2:()=>mL,createAtanh:()=>dL,createAtomicMass:()=>UU,createAvogadro:()=>HU,createBellNumbers:()=>bz,createBigNumberClass:()=>TF,createBigint:()=>S_,createBignumber:()=>T_,createBin:()=>x5,createBitAnd:()=>tw,createBitAndTransform:()=>PH,createBitNot:()=>Gk,createBitOr:()=>rw,createBitOrTransform:()=>RH,createBitXor:()=>Xk,createBlockNode:()=>D6,createBohrMagneton:()=>bU,createBohrRadius:()=>CU,createBoltzmann:()=>$U,createBoolean:()=>M_,createCatalan:()=>Nz,createCbrt:()=>ek,createCeil:()=>tk,createChain:()=>Z7,createChainClass:()=>vP,createClassicalElectronRadius:()=>MU,createClone:()=>JF,createColumn:()=>ow,createColumnTransform:()=>lH,createCombinations:()=>Iq,createCombinationsWithRep:()=>kq,createCompare:()=>sB,createCompareNatural:()=>cB,createCompareText:()=>mB,createCompile:()=>H6,createComplex:()=>O_,createComplexClass:()=>FF,createComposition:()=>Ez,createConcat:()=>iw,createConcatTransform:()=>DH,createConditionalNode:()=>N6,createConductanceQuantum:()=>DU,createConj:()=>jk,createConstantNode:()=>T6,createCorr:()=>Mq,createCos:()=>vL,createCosh:()=>yL,createCot:()=>bL,createCoth:()=>NL,createCoulomb:()=>yU,createCount:()=>p4,createCreateUnit:()=>VB,createCross:()=>h4,createCsc:()=>EL,createCsch:()=>CL,createCtranspose:()=>J4,createCube:()=>nk,createCumSum:()=>Xw,createCumSumTransform:()=>OH,createDeepEqual:()=>DB,createDenseMatrixClass:()=>XF,createDerivative:()=>Pz,createDet:()=>K7,createDeuteronMass:()=>kU,createDiag:()=>g4,createDiff:()=>aw,createDiffTransform:()=>SH,createDistance:()=>gq,createDivide:()=>hq,createDivideScalar:()=>I5,createDot:()=>p6,createDotDivide:()=>V5,createDotMultiply:()=>Rk,createDotPow:()=>$5,createE:()=>eU,createEfimovFactor:()=>zU,createEigs:()=>nq,createElectricConstant:()=>vU,createElectronMass:()=>TU,createElementaryCharge:()=>wU,createEqual:()=>hB,createEqualScalar:()=>b_,createEqualText:()=>gB,createErf:()=>u5,createEvaluate:()=>W6,createExp:()=>ok,createExpm:()=>oq,createExpm1:()=>sk,createFactorial:()=>zq,createFalse:()=>Zz,createFaraday:()=>WU,createFermiCoupling:()=>OU,createFft:()=>t5,createFibonacciHeapClass:()=>_B,createFilter:()=>x4,createFilterTransform:()=>cH,createFineStructure:()=>IU,createFirstRadiation:()=>VU,createFix:()=>uk,createFlatten:()=>w4,createFloor:()=>Jy,createForEach:()=>D4,createForEachTransform:()=>pH,createFormat:()=>g5,createFraction:()=>I_,createFractionClass:()=>kF,createFreqz:()=>$z,createFunctionAssignmentNode:()=>O6,createFunctionNode:()=>R6,createGamma:()=>Lq,createGasConstant:()=>YU,createGcd:()=>hk,createGetMatrixDataType:()=>S4,createGravitationConstant:()=>mU,createGravity:()=>rH,createHartreeEnergy:()=>FU,createHasNumericValue:()=>c_,createHelp:()=>G7,createHelpClass:()=>gP,createHex:()=>D5,createHypot:()=>u6,createI:()=>uU,createIdentity:()=>A4,createIfft:()=>n5,createIm:()=>t4,createImmutableDenseMatrixClass:()=>OB,createIndex:()=>d6,createIndexClass:()=>FB,createIndexNode:()=>I6,createIndexTransform:()=>mH,createInfinity:()=>Kz,createIntersect:()=>vq,createInv:()=>Q7,createInverseConductanceQuantum:()=>NU,createInvmod:()=>Lk,createIsInteger:()=>jF,createIsNaN:()=>v_,createIsNegative:()=>s_,createIsNumeric:()=>l_,createIsPositive:()=>m_,createIsPrime:()=>M5,createIsZero:()=>d_,createKldivergence:()=>Hq,createKlitzing:()=>AU,createKron:()=>M4,createLN10:()=>nU,createLN2:()=>rU,createLOG10E:()=>oU,createLOG2E:()=>iU,createLarger:()=>yB,createLargerEq:()=>wB,createLcm:()=>gk,createLeafCount:()=>Cz,createLeftShift:()=>tB,createLgamma:()=>Rq,createLog:()=>P5,createLog10:()=>xk,createLog1p:()=>q5,createLog2:()=>wk,createLoschmidt:()=>GU,createLsolve:()=>Y5,createLsolveAll:()=>J5,createLup:()=>X6,createLusolve:()=>mP,createLyap:()=>mq,createMad:()=>Nq,createMagneticConstant:()=>gU,createMagneticFluxQuantum:()=>SU,createMap:()=>O4,createMapTransform:()=>dH,createMatrix:()=>__,createMatrixClass:()=>LF,createMatrixFromColumns:()=>q_,createMatrixFromFunction:()=>B_,createMatrixFromRows:()=>P_,createMax:()=>Dw,createMaxTransform:()=>gH,createMean:()=>Kw,createMeanTransform:()=>vH,createMedian:()=>bq,createMin:()=>Nw,createMinTransform:()=>xH,createMod:()=>Qy,createMode:()=>p5,createMolarMass:()=>eH,createMolarMassC12:()=>tH,createMolarPlanckConstant:()=>ZU,createMolarVolume:()=>XU,createMultinomial:()=>Wq,createMultiply:()=>Nk,createMultiplyScalar:()=>bk,createNaN:()=>Jz,createNeutronMass:()=>BU,createNode:()=>g6,createNorm:()=>f6,createNot:()=>o4,createNthRoot:()=>Ek,createNthRoots:()=>U5,createNuclearMagneton:()=>EU,createNull:()=>Xz,createNumber:()=>N_,createNumeric:()=>T5,createObjectNode:()=>F6,createOct:()=>w5,createOnes:()=>F4,createOperatorNode:()=>_6,createOr:()=>nw,createOrTransform:()=>LH,createParenthesisNode:()=>k6,createParse:()=>z6,createParser:()=>Y6,createParserClass:()=>V6,createPartitionSelect:()=>EB,createPermutations:()=>Yq,createPhi:()=>tU,createPi:()=>Qz,createPickRandom:()=>mz,createPinv:()=>eq,createPlanckCharge:()=>aH,createPlanckConstant:()=>hU,createPlanckLength:()=>nH,createPlanckMass:()=>iH,createPlanckTemperature:()=>sH,createPlanckTime:()=>oH,createPolynomialRoot:()=>dP,createPow:()=>_5,createPrint:()=>mw,createPrintTransform:()=>kH,createProd:()=>h5,createProtonMass:()=>_U,createQr:()=>J6,createQuantileSeq:()=>Qw,createQuantileSeqTransform:()=>MH,createQuantumOfCirculation:()=>LU,createRandom:()=>dz,createRandomInt:()=>vz,createRange:()=>lw,createRangeClass:()=>BF,createRangeNode:()=>B6,createRangeTransform:()=>yH,createRationalize:()=>qz,createRe:()=>n4,createReducedPlanckConstant:()=>dU,createRelationalNode:()=>L6,createReplacer:()=>Vz,createReshape:()=>B4,createResize:()=>L4,createResolve:()=>_z,createResultSet:()=>hF,createReviver:()=>Wz,createRightArithShift:()=>nB,createRightLogShift:()=>oB,createRotate:()=>R4,createRotationMatrix:()=>z4,createRound:()=>B5,createRow:()=>fw,createRowTransform:()=>wH,createRydberg:()=>PU,createSQRT1_2:()=>aU,createSQRT2:()=>sU,createSackurTetrode:()=>KU,createSchur:()=>cq,createSec:()=>TL,createSech:()=>IL,createSecondRadiation:()=>JU,createSetCartesian:()=>zL,createSetDifference:()=>HL,createSetDistinct:()=>WL,createSetIntersect:()=>GL,createSetIsSubset:()=>ZL,createSetMultiplicity:()=>KL,createSetPowerset:()=>QL,createSetSize:()=>e6,createSetSymDifference:()=>r6,createSetUnion:()=>i6,createSign:()=>Ck,createSimplify:()=>Tz,createSimplifyConstant:()=>Oz,createSimplifyCore:()=>Fz,createSin:()=>_L,createSinh:()=>BL,createSize:()=>$4,createSlu:()=>cP,createSmaller:()=>vB,createSmallerEq:()=>xB,createSolveODE:()=>s5,createSort:()=>CB,createSpaClass:()=>kB,createSparse:()=>$B,createSparseMatrixClass:()=>D_,createSpeedOfLight:()=>pU,createSplitUnit:()=>U_,createSqrt:()=>Mk,createSqrtm:()=>sq,createSquare:()=>Ok,createSqueeze:()=>V4,createStd:()=>jw,createStdTransform:()=>EH,createStefanBoltzmann:()=>QU,createStirlingS2:()=>yz,createString:()=>A_,createSubset:()=>cw,createSubsetTransform:()=>bH,createSubtract:()=>Fk,createSubtractScalar:()=>Q_,createSum:()=>Yw,createSumTransform:()=>CH,createSylvester:()=>lq,createSymbolNode:()=>P6,createSymbolicEqual:()=>Bz,createTan:()=>PL,createTanh:()=>RL,createTau:()=>jz,createThomsonCrossSection:()=>RU,createTo:()=>A5,createTrace:()=>m6,createTranspose:()=>X4,createTrue:()=>Yz,createTypeOf:()=>y_,createTyped:()=>mF,createUnaryMinus:()=>$_,createUnaryPlus:()=>V_,createUnequal:()=>NB,createUnitClass:()=>qB,createUnitFunction:()=>UB,createUppercaseE:()=>fU,createUppercasePi:()=>lU,createUsolve:()=>X5,createUsolveAll:()=>j5,createVacuumImpedance:()=>xU,createVariance:()=>Jw,createVarianceTransform:()=>FH,createVersion:()=>cU,createWeakMixingAngle:()=>qU,createWienDisplacement:()=>jU,createXgcd:()=>kk,createXor:()=>u4,createZeros:()=>j4,createZeta:()=>f5,createZpk2tf:()=>Uz});g();x();v();g();x();v();var gE=ln(Dy(),1);g();x();v();function Nt(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function Dne(e){return/^-?\d+$/.test(e)}function co(e,t){return t.number==="bigint"&&!Dne(e)?t.numberFallback:t.number}var Wa=Math.sign||function(e){return e>0?1:e<0?-1:0},XI=Math.log2||function(t){return Math.log(t)/Math.LN2},KI=Math.log10||function(t){return Math.log(t)/Math.LN10},Ny=Math.log1p||function(e){return Math.log(e+1)},JI=Math.cbrt||function(t){if(t===0)return t;var r=t<0,n;return r&&(t=-t),isFinite(t)?(n=Math.exp(Math.log(t)/3),n=(t/(n*n)+2*n)/3):n=t,r?-n:n},QI=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function cE(e,t,r){var n={2:"0b",8:"0o",16:"0x"},i=n[t],o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Nt(r))throw new Error("size must be an integer");if(e>2**(r-1)-1||e<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!Nt(e))throw new Error("Value must be an integer");e<0&&(e=e+2**r),o="i".concat(r)}var u="";return e<0&&(e=-e,u="-"),"".concat(u).concat(i).concat(e.toString(t)).concat(o)}function _s(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:r,precision:n,wordSize:i}=pE(t);switch(r){case"fixed":return mE(e,n);case"exponential":return jI(e,n);case"engineering":return Nne(e,n);case"bin":return cE(e,2,i);case"oct":return cE(e,8,i);case"hex":return cE(e,16,i);case"auto":return Sne(e,n,t).replace(/((\.\d*?)(0+))($|e)/,function(){var o=arguments[2],u=arguments[4];return o!=="."?o+u:u});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function pE(e){var t="auto",r,n;if(e!==void 0)if($t(e))r=e;else if(kt(e))r=e.toNumber();else if(Nu(e))e.precision!==void 0&&(r=YI(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=YI(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(t=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:t,precision:r,wordSize:n}}function ch(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),o=n.indexOf(".");i+=o!==-1?o-1:n.length-1;var u=n.replace(".","").replace(/^0*/,function(l){return i-=l.length,""}).replace(/0*$/,"").split("").map(function(l){return parseInt(l)});return u.length===0&&(u.push(0),i++),{sign:r,coefficients:u,exponent:i}}function Nne(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=ch(e),n=Sy(r,t),i=n.exponent,o=n.coefficients,u=i%3===0?i:i<0?i-3-i%3:i-i%3;if($t(t))for(;t>o.length||i-u+1>o.length;)o.push(0);else for(var l=Math.abs(i-u)-(o.length-1),a=0;a0;)f++,s--;var p=o.slice(f).join(""),h=$t(t)&&p.length||p.match(/[1-9]/)?"."+p:"",y=o.slice(0,f).join("")+h+"e"+(i>=0?"+":"")+u.toString();return n.sign+y}function mE(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=ch(e),n=typeof t=="number"?Sy(r,r.exponent+1+t):r,i=n.coefficients,o=n.exponent+1,u=o+(t||0);return i.length0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function Sne(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=ZI(r?.lowerExp,-3),i=ZI(r?.upperExp,5),o=ch(e),u=t?Sy(o,t):o;if(u.exponent=i)return jI(e,t);var l=u.coefficients,a=u.exponent;l.length0?a:0;return st){var i=n.splice(t,n.length-t);if(i[0]>=5){var o=t-1;for(n[o]++;n[o]===10;)n.pop(),o===0&&(n.unshift(0),r.exponent++,o++),o--,n[o]++}}return r}function fh(e){for(var t=[],r=0;r2&&arguments[2]!==void 0?arguments[2]:1e-8,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return isNaN(e)||isNaN(t)?!1:!isFinite(e)||!isFinite(t)?e===t:e===t?!0:Math.abs(e-t)<=Math.max(r*Math.max(Math.abs(e),Math.abs(t)),n)}var tF=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},rF=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},nF=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},Ey=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},iF=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},Ay=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function oF(e,t){var r=e>0?!0:e<0?!1:1/e===1/0,n=t>0?!0:t<0?!1:1/t===1/0;return r^n?-e:e}function YI(e,t){if($t(e))return e;if(kt(e))return e.toNumber();t()}function ZI(e,t){return $t(e)?e:kt(e)?e.toNumber():t}g();x();v();function K(e,t,r,n){function i(o){var u=HI(o,t.map(hE));return Ene(e,t,o),r(u)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function cp(e){return typeof e=="function"&&typeof e.fn=="string"&&Array.isArray(e.dependencies)}function Ene(e,t,r){var n=t.filter(o=>!Ane(o)).every(o=>r[o]!==void 0);if(!n){var i=t.filter(o=>r[o]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(o=>'"'.concat(o,'"')).join(", "),"."))}}function Ane(e){return e&&e[0]==="?"}function hE(e){return e&&e[0]==="?"?e.slice(1):e}g();x();v();g();x();v();function fn(e,t){if(lF(e)&&sF(e,t))return e[t];throw typeof e[t]=="function"&&Cy(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function Eu(e,t,r){if(lF(e)&&sF(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function aF(e,t){return t in e}function sF(e,t){return!e||typeof e!="object"?!1:Et(Cne,t)?!0:!(t in Object.prototype||t in Function.prototype)}function uF(e,t){if(!Cy(e,t))throw new Error('No access to method "'+t+'"');return e[t]}function Cy(e,t){return e==null||typeof e[t]!="function"||Et(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:Et(Mne,t)?!0:!(t in Object.prototype||t in Function.prototype)}function lF(e){return typeof e=="object"&&e&&e.constructor===Object}var Cne={length:!0,name:!0},Mne={toString:!0,valueOf:!0,toLocaleString:!0};var pp=class{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return fn(this.wrappedObject,t)}set(t,r){return Eu(this.wrappedObject,t,r),this}has(t){return aF(this.wrappedObject,t)}entries(){return fF(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}},ph=class{constructor(t,r,n){this.a=t,this.b=r,this.bKeys=n,this[Symbol.iterator]=this.entries}get(t){return this.bKeys.has(t)?this.b.get(t):this.a.get(t)}set(t,r){return this.bKeys.has(t)?this.b.set(t,r):this.a.set(t,r),this}has(t){return this.b.has(t)||this.a.has(t)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return fF(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var r of this.keys())t(this.get(r),r,this)}delete(t){return this.bKeys.has(t)?this.b.delete(t):this.a.delete(t)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}};function fF(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function Cf(){return new Map}function vl(e){if(!e)return Cf();if(dE(e))return e;if(Nu(e))return new pp(e);throw new Error("createMap can create maps from objects or Maps")}function cF(e){if(e instanceof pp)return e.wrappedObject;var t={};for(var r of e.keys()){var n=e.get(r);Eu(t,r,n)}return t}function dE(e){return e?e instanceof Map||e instanceof pp||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var pF=function(){return pF=gE.default.create,gE.default},Tne=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],mF=K("typed",Tne,function(t){var{BigNumber:r,Complex:n,DenseMatrix:i,Fraction:o}=t,u=pF();return u.clear(),u.addTypes([{name:"number",test:$t},{name:"Complex",test:Ni},{name:"BigNumber",test:kt},{name:"bigint",test:uy},{name:"Fraction",test:da},{name:"Unit",test:ui},{name:"identifier",test:l=>gn&&/^(?:[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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\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-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C00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\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-\uFB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\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-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05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(l)},{name:"string",test:gn},{name:"Chain",test:uh},{name:"Array",test:pr},{name:"Matrix",test:St},{name:"DenseMatrix",test:gl},{name:"SparseMatrix",test:ga},{name:"Range",test:Af},{name:"Index",test:Du},{name:"boolean",test:ly},{name:"ResultSet",test:fy},{name:"Help",test:sh},{name:"function",test:cy},{name:"Date",test:py},{name:"RegExp",test:my},{name:"null",test:hy},{name:"undefined",test:dy},{name:"AccessorNode",test:Fo},{name:"ArrayNode",test:Si},{name:"AssignmentNode",test:gy},{name:"BlockNode",test:vy},{name:"ConditionalNode",test:xy},{name:"ConstantNode",test:or},{name:"FunctionNode",test:eo},{name:"FunctionAssignmentNode",test:$a},{name:"IndexNode",test:Vo},{name:"Node",test:cr},{name:"ObjectNode",test:Su},{name:"OperatorNode",test:Xr},{name:"ParenthesisNode",test:Ei},{name:"RangeNode",test:yy},{name:"RelationalNode",test:wy},{name:"SymbolNode",test:qr},{name:"Map",test:dE},{name:"Object",test:Nu}]),u.addConversions([{from:"number",to:"BigNumber",convert:function(a){if(r||My(a),eF(a)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+a+"). Use function bignumber(x) to convert to BigNumber.");return new r(a)}},{from:"number",to:"Complex",convert:function(a){return n||Ty(a),new n(a,0)}},{from:"BigNumber",to:"Complex",convert:function(a){return n||Ty(a),new n(a.toNumber(),0)}},{from:"bigint",to:"number",convert:function(a){if(a>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+a+")");return Number(a)}},{from:"bigint",to:"BigNumber",convert:function(a){return r||My(a),new r(a.toString())}},{from:"bigint",to:"Fraction",convert:function(a){return o||Oy(a),new o(a.toString())}},{from:"Fraction",to:"BigNumber",convert:function(a){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(a){return n||Ty(a),new n(a.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(a){o||Oy(a);var s=new o(a);if(s.valueOf()!==a)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+a+"). Use function fraction(x) to convert to Fraction.");return s}},{from:"string",to:"number",convert:function(a){var s=Number(a);if(isNaN(s))throw new Error('Cannot convert "'+a+'" to a number');return s}},{from:"string",to:"BigNumber",convert:function(a){r||My(a);try{return new r(a)}catch{throw new Error('Cannot convert "'+a+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(a){try{return BigInt(a)}catch{throw new Error('Cannot convert "'+a+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(a){o||Oy(a);try{return new o(a)}catch{throw new Error('Cannot convert "'+a+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(a){n||Ty(a);try{return new n(a)}catch{throw new Error('Cannot convert "'+a+'" to Complex')}}},{from:"boolean",to:"number",convert:function(a){return+a}},{from:"boolean",to:"BigNumber",convert:function(a){return r||My(a),new r(+a)}},{from:"boolean",to:"bigint",convert:function(a){return BigInt(+a)}},{from:"boolean",to:"Fraction",convert:function(a){return o||Oy(a),new o(+a)}},{from:"boolean",to:"string",convert:function(a){return String(a)}},{from:"Array",to:"Matrix",convert:function(a){return i||One(),new i(a)}},{from:"Matrix",to:"Array",convert:function(a){return a.valueOf()}}]),u.onMismatch=(l,a,s)=>{var f=u.createError(l,a,s);if(["wrongType","mismatch"].includes(f.data.category)&&a.length===1&&xn(a[0])&&s.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw p.data=f.data,p}throw f},u.onMismatch=(l,a,s)=>{var f=u.createError(l,a,s);if(["wrongType","mismatch"].includes(f.data.category)&&a.length===1&&xn(a[0])&&s.some(h=>!h.params.includes(","))){var p=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw p.data=f.data,p}throw f},u});function My(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Ty(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function One(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Oy(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}g();x();v();var Ine="ResultSet",Fne=[],hF=K(Ine,Fne,()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0});g();x();v();g();x();v();var mh=9e15,If=1e9,vE="0123456789abcdef",Fy="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",_y="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",xE={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-mh,maxE:mh,crypto:!1},xF,xl,mr=!0,By="[DecimalError] ",Of=By+"Invalid argument: ",yF=By+"Precision limit exceeded",wF=By+"crypto unavailable",bF="[object Decimal]",po=Math.floor,Ai=Math.pow,_ne=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,kne=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Bne=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,DF=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Bs=1e7,ar=7,Lne=9007199254740991,Pne=Fy.length-1,yE=_y.length-1,xt={toStringTag:bF};xt.absoluteValue=xt.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),er(e)};xt.ceil=function(){return er(new this.constructor(this),this.e+1,2)};xt.clampedTo=xt.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Of+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};xt.comparedTo=xt.cmp=function(e){var t,r,n,i,o=this,u=o.d,l=(e=new o.constructor(e)).d,a=o.s,s=e.s;if(!u||!l)return!a||!s?NaN:a!==s?a:u===l?0:!u^a<0?1:-1;if(!u[0]||!l[0])return u[0]?a:l[0]?-s:0;if(a!==s)return a;if(o.e!==e.e)return o.e>e.e^a<0?1:-1;for(n=u.length,i=l.length,t=0,r=nl[t]^a<0?1:-1;return n===i?0:n>i^a<0?1:-1};xt.cosine=xt.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+ar,n.rounding=1,r=Rne(n,CF(n,r)),n.precision=e,n.rounding=t,er(xl==2||xl==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};xt.cubeRoot=xt.cbrt=function(){var e,t,r,n,i,o,u,l,a,s,f=this,p=f.constructor;if(!f.isFinite()||f.isZero())return new p(f);for(mr=!1,o=f.s*Ai(f.s*f,1/3),!o||Math.abs(o)==1/0?(r=to(f.d),e=f.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=Ai(r,1/3),e=po((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=f.s):n=new p(o.toString()),u=(e=p.precision)+3;;)if(l=n,a=l.times(l).times(l),s=a.plus(f),n=cn(s.plus(f).times(l),s.plus(a),u+2,1),to(l.d).slice(0,u)===(r=to(n.d)).slice(0,u))if(r=r.slice(u-3,u+1),r=="9999"||!i&&r=="4999"){if(!i&&(er(l,e+1,0),l.times(l).times(l).eq(f))){n=l;break}u+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(er(n,e+1,1),t=!n.times(n).times(n).eq(f));break}return mr=!0,er(n,e,p.rounding,t)};xt.decimalPlaces=xt.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-po(this.e/ar))*ar,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};xt.dividedBy=xt.div=function(e){return cn(this,new this.constructor(e))};xt.dividedToIntegerBy=xt.divToInt=function(e){var t=this,r=t.constructor;return er(cn(t,new r(e),0,1,1),r.precision,r.rounding)};xt.equals=xt.eq=function(e){return this.cmp(e)===0};xt.floor=function(){return er(new this.constructor(this),this.e+1,3)};xt.greaterThan=xt.gt=function(e){return this.cmp(e)>0};xt.greaterThanOrEqualTo=xt.gte=function(e){var t=this.cmp(e);return t==1||t===0};xt.hyperbolicCosine=xt.cosh=function(){var e,t,r,n,i,o=this,u=o.constructor,l=new u(1);if(!o.isFinite())return new u(o.s?1/0:NaN);if(o.isZero())return l;r=u.precision,n=u.rounding,u.precision=r+Math.max(o.e,o.sd())+4,u.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Py(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=hh(u,1,o.times(t),new u(1),!0);for(var a,s=e,f=new u(8);s--;)a=o.times(o),o=l.minus(a.times(f.minus(a.times(f))));return er(o,u.precision=r,u.rounding=n,!0)};xt.hyperbolicSine=xt.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=hh(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Py(5,e)),i=hh(o,2,i,i,!0);for(var u,l=new o(5),a=new o(16),s=new o(20);e--;)u=i.times(i),i=i.times(l.plus(u.times(a.times(u).plus(s))))}return o.precision=t,o.rounding=r,er(i,t,r,!0)};xt.hyperbolicTangent=xt.tanh=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+7,n.rounding=1,cn(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};xt.inverseCosine=xt.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ks(r,i,o):new r(0):new r(NaN):t.isZero()?ks(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ks(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};xt.inverseHyperbolicCosine=xt.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,mr=!1,r=r.times(r).minus(1).sqrt().plus(r),mr=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};xt.inverseHyperbolicSine=xt.asinh=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+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,mr=!1,r=r.times(r).plus(1).sqrt().plus(r),mr=!0,n.precision=e,n.rounding=t,r.ln())};xt.inverseHyperbolicTangent=xt.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?er(new o(i),e,t,!0):(o.precision=r=n-i.e,i=cn(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};xt.inverseSine=xt.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ks(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};xt.inverseTangent=xt.atan=function(){var e,t,r,n,i,o,u,l,a,s=this,f=s.constructor,p=f.precision,h=f.rounding;if(s.isFinite()){if(s.isZero())return new f(s);if(s.abs().eq(1)&&p+4<=yE)return u=ks(f,p+4,h).times(.25),u.s=s.s,u}else{if(!s.s)return new f(NaN);if(p+4<=yE)return u=ks(f,p+4,h).times(.5),u.s=s.s,u}for(f.precision=l=p+10,f.rounding=1,r=Math.min(28,l/ar+2|0),e=r;e;--e)s=s.div(s.times(s).plus(1).sqrt().plus(1));for(mr=!1,t=Math.ceil(l/ar),n=1,a=s.times(s),u=new f(s),i=s;e!==-1;)if(i=i.times(a),o=u.minus(i.div(n+=2)),i=i.times(a),u=o.plus(i.div(n+=2)),u.d[t]!==void 0)for(e=t;u.d[e]===o.d[e]&&e--;);return r&&(u=u.times(2<this.d.length-2};xt.isNaN=function(){return!this.s};xt.isNegative=xt.isNeg=function(){return this.s<0};xt.isPositive=xt.isPos=function(){return this.s>0};xt.isZero=function(){return!!this.d&&this.d[0]===0};xt.lessThan=xt.lt=function(e){return this.cmp(e)<0};xt.lessThanOrEqualTo=xt.lte=function(e){return this.cmp(e)<1};xt.logarithm=xt.log=function(e){var t,r,n,i,o,u,l,a,s=this,f=s.constructor,p=f.precision,h=f.rounding,y=5;if(e==null)e=new f(10),t=!0;else{if(e=new f(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(r=s.d,s.s<0||!r||!r[0]||s.eq(1))return new f(r&&!r[0]?-1/0:s.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(mr=!1,l=p+y,u=Tf(s,l),n=t?ky(f,l+10):Tf(e,l),a=cn(u,n,l,1),bv(a.d,i=p,h))do if(l+=10,u=Tf(s,l),n=t?ky(f,l+10):Tf(e,l),a=cn(u,n,l,1),!o){+to(a.d).slice(i+1,i+15)+1==1e14&&(a=er(a,p+1,0));break}while(bv(a.d,i+=10,h));return mr=!0,er(a,p,h)};xt.minus=xt.sub=function(e){var t,r,n,i,o,u,l,a,s,f,p,h,y=this,b=y.constructor;if(e=new b(e),!y.d||!e.d)return!y.s||!e.s?e=new b(NaN):y.d?e.s=-e.s:e=new b(e.d||y.s!==e.s?y:NaN),e;if(y.s!=e.s)return e.s=-e.s,y.plus(e);if(s=y.d,h=e.d,l=b.precision,a=b.rounding,!s[0]||!h[0]){if(h[0])e.s=-e.s;else if(s[0])e=new b(y);else return new b(a===3?-0:0);return mr?er(e,l,a):e}if(r=po(e.e/ar),f=po(y.e/ar),s=s.slice(),o=f-r,o){for(p=o<0,p?(t=s,o=-o,u=h.length):(t=h,r=f,u=s.length),n=Math.max(Math.ceil(l/ar),u)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=s.length,u=h.length,p=n0;--n)s[u++]=0;for(n=h.length;n>o;){if(s[--n]u?o+1:u+1,i>u&&(i=u,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(u=s.length,i=f.length,u-i<0&&(i=u,r=f,f=s,s=r),t=0;i;)t=(s[--i]=s[i]+f[i]+t)/Bs|0,s[i]%=Bs;for(t&&(s.unshift(t),++n),u=s.length;s[--u]==0;)s.pop();return e.d=s,e.e=Ly(s,n),mr?er(e,l,a):e};xt.precision=xt.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Of+e);return r.d?(t=NF(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};xt.round=function(){var e=this,t=e.constructor;return er(new t(e),e.e+1,t.rounding)};xt.sine=xt.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())+ar,n.rounding=1,r=zne(n,CF(n,r)),n.precision=e,n.rounding=t,er(xl>2?r.neg():r,e,t,!0)):new n(NaN)};xt.squareRoot=xt.sqrt=function(){var e,t,r,n,i,o,u=this,l=u.d,a=u.e,s=u.s,f=u.constructor;if(s!==1||!l||!l[0])return new f(!s||s<0&&(!l||l[0])?NaN:l?u:1/0);for(mr=!1,s=Math.sqrt(+u),s==0||s==1/0?(t=to(l),(t.length+a)%2==0&&(t+="0"),s=Math.sqrt(t),a=po((a+1)/2)-(a<0||a%2),s==1/0?t="5e"+a:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+a),n=new f(t)):n=new f(s.toString()),r=(a=f.precision)+3;;)if(o=n,n=o.plus(cn(u,o,r+2,1)).times(.5),to(o.d).slice(0,r)===(t=to(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(er(o,a+1,0),o.times(o).eq(u))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(er(n,a+1,1),e=!n.times(n).eq(u));break}return mr=!0,er(n,a,f.rounding,e)};xt.tangent=xt.tan=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+10,n.rounding=1,r=r.sin(),r.s=1,r=cn(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,er(xl==2||xl==4?r.neg():r,e,t,!0)):new n(NaN)};xt.times=xt.mul=function(e){var t,r,n,i,o,u,l,a,s,f=this,p=f.constructor,h=f.d,y=(e=new p(e)).d;if(e.s*=f.s,!h||!h[0]||!y||!y[0])return new p(!e.s||h&&!h[0]&&!y||y&&!y[0]&&!h?NaN:!h||!y?e.s/0:e.s*0);for(r=po(f.e/ar)+po(e.e/ar),a=h.length,s=y.length,a=0;){for(t=0,i=a+n;i>n;)l=o[i]+y[n]*h[i-n-1]+t,o[i--]=l%Bs|0,t=l/Bs|0;o[i]=(o[i]+t)%Bs|0}for(;!o[--u];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Ly(o,r),mr?er(e,p.precision,p.rounding):e};xt.toBinary=function(e,t){return DE(this,2,e,t)};xt.toDecimalPlaces=xt.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Go(e,0,If),t===void 0?t=n.rounding:Go(t,0,8),er(r,e+r.e+1,t))};xt.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Au(n,!0):(Go(e,0,If),t===void 0?t=i.rounding:Go(t,0,8),n=er(new i(n),e+1,t),r=Au(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};xt.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Au(i):(Go(e,0,If),t===void 0?t=o.rounding:Go(t,0,8),n=er(new o(i),e+i.e+1,t),r=Au(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};xt.toFraction=function(e){var t,r,n,i,o,u,l,a,s,f,p,h,y=this,b=y.d,w=y.constructor;if(!b)return new w(y);if(s=r=new w(1),n=a=new w(0),t=new w(n),o=t.e=NF(b)-y.e-1,u=o%ar,t.d[0]=Ai(10,u<0?ar+u:u),e==null)e=o>0?t:s;else{if(l=new w(e),!l.isInt()||l.lt(s))throw Error(Of+l);e=l.gt(t)?o>0?t:s:l}for(mr=!1,l=new w(to(b)),f=w.precision,w.precision=o=b.length*ar*2;p=cn(l,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=s,s=a.plus(p.times(i)),a=i,i=t,t=l.minus(p.times(i)),l=i;return i=cn(e.minus(r),n,0,1,1),a=a.plus(i.times(s)),r=r.plus(i.times(n)),a.s=s.s=y.s,h=cn(s,n,o,1).minus(y).abs().cmp(cn(a,r,o,1).minus(y).abs())<1?[s,n]:[a,r],w.precision=f,mr=!0,h};xt.toHexadecimal=xt.toHex=function(e,t){return DE(this,16,e,t)};xt.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:Go(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(mr=!1,r=cn(r,e,0,t,1).times(e),mr=!0,er(r)):(e.s=r.s,r=e),r};xt.toNumber=function(){return+this};xt.toOctal=function(e,t){return DE(this,8,e,t)};xt.toPower=xt.pow=function(e){var t,r,n,i,o,u,l=this,a=l.constructor,s=+(e=new a(e));if(!l.d||!e.d||!l.d[0]||!e.d[0])return new a(Ai(+l,s));if(l=new a(l),l.eq(1))return l;if(n=a.precision,o=a.rounding,e.eq(1))return er(l,n,o);if(t=po(e.e/ar),t>=e.d.length-1&&(r=s<0?-s:s)<=Lne)return i=SF(a,l,r,n),e.s<0?new a(1).div(i):er(i,n,o);if(u=l.s,u<0){if(ta.maxE+1||t0?u/0:0):(mr=!1,a.rounding=l.s=1,r=Math.min(12,(t+"").length),i=wE(e.times(Tf(l,n+r)),n),i.d&&(i=er(i,n+5,1),bv(i.d,n,o)&&(t=n+10,i=er(wE(e.times(Tf(l,t+r)),t),t+5,1),+to(i.d).slice(n+1,n+15)+1==1e14&&(i=er(i,n+1,0)))),i.s=u,mr=!0,a.rounding=o,er(i,n,o))};xt.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Au(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Go(e,1,If),t===void 0?t=i.rounding:Go(t,0,8),n=er(new i(n),e,t),r=Au(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};xt.toSignificantDigits=xt.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Go(e,1,If),t===void 0?t=n.rounding:Go(t,0,8)),er(new n(r),e,t)};xt.toString=function(){var e=this,t=e.constructor,r=Au(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};xt.truncated=xt.trunc=function(){return er(new this.constructor(this),this.e+1,1)};xt.valueOf=xt.toJSON=function(){var e=this,t=e.constructor,r=Au(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function to(e){var t,r,n,i=e.length-1,o="",u=e[0];if(i>0){for(o+=u,t=1;tr)throw Error(Of+e)}function bv(e,t,r,n){var i,o,u,l;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=ar,i=0):(i=Math.ceil((t+1)/ar),t%=ar),o=Ai(10,ar-t),l=e[i]%o|0,n==null?t<3?(t==0?l=l/100|0:t==1&&(l=l/10|0),u=r<4&&l==99999||r>3&&l==49999||l==5e4||l==0):u=(r<4&&l+1==o||r>3&&l+1==o/2)&&(e[i+1]/o/100|0)==Ai(10,t-2)-1||(l==o/2||l==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?l=l/1e3|0:t==1?l=l/100|0:t==2&&(l=l/10|0),u=(n||r<4)&&l==9999||!n&&r>3&&l==4999):u=((n||r<4)&&l+1==o||!n&&r>3&&l+1==o/2)&&(e[i+1]/o/1e3|0)==Ai(10,t-3)-1,u}function Iy(e,t,r){for(var n,i=[0],o,u=0,l=e.length;ur-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Rne(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Py(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=hh(e,1,t.times(i),new e(1));for(var o=r;o--;){var u=t.times(t);t=u.times(u).minus(u).times(8).plus(1)}return e.precision-=r,t}var cn=function(){function e(n,i,o){var u,l=0,a=n.length;for(n=n.slice();a--;)u=n[a]*i+l,n[a]=u%o|0,l=u/o|0;return l&&n.unshift(l),n}function t(n,i,o,u){var l,a;if(o!=u)a=o>u?1:-1;else for(l=a=0;li[l]?1:-1;break}return a}function r(n,i,o,u){for(var l=0;o--;)n[o]-=l,l=n[o]1;)n.shift()}return function(n,i,o,u,l,a){var s,f,p,h,y,b,w,A,S,O,M,I,F,C,P,R,q,U,H,V,W=n.constructor,ee=n.s==i.s?1:-1,ie=n.d,Y=i.d;if(!ie||!ie[0]||!Y||!Y[0])return new W(!n.s||!i.s||(ie?Y&&ie[0]==Y[0]:!Y)?NaN:ie&&ie[0]==0||!Y?ee*0:ee/0);for(a?(y=1,f=n.e-i.e):(a=Bs,y=ar,f=po(n.e/y)-po(i.e/y)),H=Y.length,q=ie.length,S=new W(ee),O=S.d=[],p=0;Y[p]==(ie[p]||0);p++);if(Y[p]>(ie[p]||0)&&f--,o==null?(C=o=W.precision,u=W.rounding):l?C=o+(n.e-i.e)+1:C=o,C<0)O.push(1),b=!0;else{if(C=C/y+2|0,p=0,H==1){for(h=0,Y=Y[0],C++;(p1&&(Y=e(Y,h,a),ie=e(ie,h,a),H=Y.length,q=ie.length),R=H,M=ie.slice(0,H),I=M.length;I=a/2&&++U;do h=0,s=t(Y,M,H,I),s<0?(F=M[0],H!=I&&(F=F*a+(M[1]||0)),h=F/U|0,h>1?(h>=a&&(h=a-1),w=e(Y,h,a),A=w.length,I=M.length,s=t(w,M,A,I),s==1&&(h--,r(w,H=10;h/=10)p++;S.e=p+f*y-1,er(S,l?o+S.e+1:o,u,b)}return S}}();function er(e,t,r,n){var i,o,u,l,a,s,f,p,h,y=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,l=p[0];l>=10;l/=10)i++;if(o=t-i,o<0)o+=ar,u=t,f=p[h=0],a=f/Ai(10,i-u-1)%10|0;else if(h=Math.ceil((o+1)/ar),l=p.length,h>=l)if(n){for(;l++<=h;)p.push(0);f=a=0,i=1,o%=ar,u=o-ar+1}else break e;else{for(f=l=p[h],i=1;l>=10;l/=10)i++;o%=ar,u=o-ar+i,a=u<0?0:f/Ai(10,i-u-1)%10|0}if(n=n||t<0||p[h+1]!==void 0||(u<0?f:f%Ai(10,i-u-1)),s=r<4?(a||n)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||n||r==6&&(o>0?u>0?f/Ai(10,i-u):0:p[h-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,s?(t-=e.e+1,p[0]=Ai(10,(ar-t%ar)%ar),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=h,l=1,h--):(p.length=h+1,l=Ai(10,ar-o),p[h]=u>0?(f/Ai(10,i-u)%Ai(10,u)|0)*l:0),s)for(;;)if(h==0){for(o=1,u=p[0];u>=10;u/=10)o++;for(u=p[0]+=l,l=1;u>=10;u/=10)l++;o!=l&&(e.e++,p[0]==Bs&&(p[0]=1));break}else{if(p[h]+=l,p[h]!=Bs)break;p[h--]=0,l=1}for(o=p.length;p[--o]===0;)p.pop()}return mr&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Mf(n):u>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Mf(-i-1)+o,r&&(n=r-u)>0&&(o+=Mf(n))):i>=u?(o+=Mf(i+1-u),r&&(n=r-i-1)>0&&(o=o+"."+Mf(n))):((n=i+1)0&&(i+1===u&&(o+="."),o+=Mf(n))),o}function Ly(e,t){var r=e[0];for(t*=ar;r>=10;r/=10)t++;return t}function ky(e,t,r){if(t>Pne)throw mr=!0,r&&(e.precision=r),Error(yF);return er(new e(Fy),t,1,!0)}function ks(e,t,r){if(t>yE)throw Error(yF);return er(new e(_y),t,r,!0)}function NF(e){var t=e.length-1,r=t*ar+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Mf(e){for(var t="";e--;)t+="0";return t}function SF(e,t,r,n){var i,o=new e(1),u=Math.ceil(n/ar+4);for(mr=!1;;){if(r%2&&(o=o.times(t),gF(o.d,u)&&(i=!0)),r=po(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),gF(t.d,u)}return mr=!0,o}function dF(e){return e.d[e.d.length-1]&1}function EF(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(mr=!1,a=b):a=t,l=new h(.03125);e.e>-2;)e=e.times(l),p+=5;for(n=Math.log(Ai(2,p))/Math.LN10*2+5|0,a+=n,r=o=u=new h(1),h.precision=a;;){if(o=er(o.times(e),a,1),r=r.times(++f),l=u.plus(cn(o,r,a,1)),to(l.d).slice(0,a)===to(u.d).slice(0,a)){for(i=p;i--;)u=er(u.times(u),a,1);if(t==null)if(s<3&&bv(u.d,a-n,y,s))h.precision=a+=10,r=o=l=new h(1),f=0,s++;else return er(u,h.precision=b,y,mr=!0);else return h.precision=b,u}u=l}}function Tf(e,t){var r,n,i,o,u,l,a,s,f,p,h,y=1,b=10,w=e,A=w.d,S=w.constructor,O=S.rounding,M=S.precision;if(w.s<0||!A||!A[0]||!w.e&&A[0]==1&&A.length==1)return new S(A&&!A[0]?-1/0:w.s!=1?NaN:A?0:w);if(t==null?(mr=!1,f=M):f=t,S.precision=f+=b,r=to(A),n=r.charAt(0),Math.abs(o=w.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)w=w.times(e),r=to(w.d),n=r.charAt(0),y++;o=w.e,n>1?(w=new S("0."+r),o++):w=new S(n+"."+r.slice(1))}else return s=ky(S,f+2,M).times(o+""),w=Tf(new S(n+"."+r.slice(1)),f-b).plus(s),S.precision=M,t==null?er(w,M,O,mr=!0):w;for(p=w,a=u=w=cn(w.minus(1),w.plus(1),f,1),h=er(w.times(w),f,1),i=3;;){if(u=er(u.times(h),f,1),s=a.plus(cn(u,new S(i),f,1)),to(s.d).slice(0,f)===to(a.d).slice(0,f))if(a=a.times(2),o!==0&&(a=a.plus(ky(S,f+2,M).times(o+""))),a=cn(a,new S(y),f,1),t==null)if(bv(a.d,f-b,O,l))S.precision=f+=b,s=u=w=cn(p.minus(1),p.plus(1),f,1),h=er(w.times(w),f,1),i=l=1;else return er(a,S.precision=M,O,mr=!0);else return S.precision=M,a;a=s,i+=2}}function AF(e){return String(e.s*e.s/0)}function bE(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%ar,r<0&&(n+=ar),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),DF.test(t))return bE(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(kne.test(t))r=16,t=t.toLowerCase();else if(_ne.test(t))r=2;else if(Bne.test(t))r=8;else throw Error(Of+t);for(o=t.search(/p/i),o>0?(a=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),u=o>=0,n=e.constructor,u&&(t=t.replace(".",""),l=t.length,o=l-o,i=SF(n,new n(r),o,o*2)),s=Iy(t,r,Bs),f=s.length-1,o=f;s[o]===0;--o)s.pop();return o<0?new n(e.s*0):(e.e=Ly(s,f),e.d=s,mr=!1,u&&(e=cn(e,i,l*4)),a&&(e=e.times(Math.abs(a)<54?Ai(2,a):Dv.pow(2,a))),mr=!0,e)}function zne(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:hh(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Py(5,r)),t=hh(e,2,t,t);for(var i,o=new e(5),u=new e(16),l=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(u.times(i).minus(l))));return t}function hh(e,t,r,n,i){var o,u,l,a,s=1,f=e.precision,p=Math.ceil(f/ar);for(mr=!1,a=r.times(r),l=new e(n);;){if(u=cn(l.times(a),new e(t++*t++),f,1),l=i?n.plus(u):n.minus(u),n=cn(u.times(a),new e(t++*t++),f,1),u=l.plus(n),u.d[p]!==void 0){for(o=p;u.d[o]===l.d[o]&&o--;);if(o==-1)break}o=l,l=n,n=u,u=o,s++}return mr=!0,u.d.length=p+1,u}function Py(e,t){for(var r=e;--t;)r*=e;return r}function CF(e,t){var r,n=t.s<0,i=ks(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return xl=n?4:1,t;if(r=t.divToInt(i),r.isZero())xl=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return xl=dF(r)?n?2:3:n?4:1,t;xl=dF(r)?n?1:4:n?3:2}return t.minus(i).abs()}function DE(e,t,r,n){var i,o,u,l,a,s,f,p,h,y=e.constructor,b=r!==void 0;if(b?(Go(r,1,If),n===void 0?n=y.rounding:Go(n,0,8)):(r=y.precision,n=y.rounding),!e.isFinite())f=AF(e);else{for(f=Au(e),u=f.indexOf("."),b?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,u>=0&&(f=f.replace(".",""),h=new y(1),h.e=f.length-u,h.d=Iy(Au(h),10,i),h.e=h.d.length),p=Iy(f,10,i),o=a=p.length;p[--a]==0;)p.pop();if(!p[0])f=b?"0p+0":"0";else{if(u<0?o--:(e=new y(e),e.d=p,e.e=o,e=cn(e,h,r,n,0,i),p=e.d,o=e.e,s=xF),u=p[r],l=i/2,s=s||p[r+1]!==void 0,s=n<4?(u!==void 0||s)&&(n===0||n===(e.s<0?3:2)):u>l||u===l&&(n===4||s||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,s)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(a=p.length;!p[a-1];--a);for(u=0,f="";u1)if(t==16||t==8){for(u=t==16?4:3,--a;a%u;a++)f+="0";for(p=Iy(f,i,t),a=p.length;!p[a-1];--a);for(u=1,f="1.";ua)for(o-=a;o--;)f+="0";else ot)return e.length=t,!0}function Une(e){return new this(e).abs()}function Hne(e){return new this(e).acos()}function $ne(e){return new this(e).acosh()}function Wne(e,t){return new this(e).plus(t)}function Vne(e){return new this(e).asin()}function Gne(e){return new this(e).asinh()}function Yne(e){return new this(e).atan()}function Zne(e){return new this(e).atanh()}function Xne(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ks(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ks(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ks(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(cn(e,t,o,1)),t=ks(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(cn(e,t,o,1)),r}function Kne(e){return new this(e).cbrt()}function Jne(e){return er(e=new this(e),e.e+1,2)}function Qne(e,t,r){return new this(e).clamp(t,r)}function jne(e){if(!e||typeof e!="object")throw Error(By+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,If,"rounding",0,8,"toExpNeg",-mh,0,"toExpPos",0,mh,"maxE",0,mh,"minE",-mh,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Of+r+": "+n);if(r="crypto",i&&(this[r]=xE[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(wF);else this[r]=!1;else throw Error(Of+r+": "+n);return this}function eie(e){return new this(e).cos()}function tie(e){return new this(e).cosh()}function MF(e){var t,r,n;function i(o){var u,l,a,s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,vF(o)){s.s=o.s,mr?!o.d||o.e>i.maxE?(s.e=NaN,s.d=null):o.e=10;l/=10)u++;mr?u>i.maxE?(s.e=NaN,s.d=null):u=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:l[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(l.push(i%1e7),o+=4);o=n/4}else throw Error(wF);else for(;o=10;i/=10)n++;n{var{on:t,config:r}=e,n=mp.clone({precision:r.precision,modulo:mp.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(i){return new n(i.value)},t&&t("config",function(i,o){i.precision!==o.precision&&n.config({precision:i.precision})}),n},{isClass:!0});g();x();v();var qi=ln(IF(),1);var Mie="Complex",Tie=[],FF=K(Mie,Tie,()=>(Object.defineProperty(qi.default,"name",{value:"Complex"}),qi.default.prototype.constructor=qi.default,qi.default.prototype.type="Complex",qi.default.prototype.isComplex=!0,qi.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},qi.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},qi.default.prototype.format=function(e){var t="",r=this.im,n=this.re,i=_s(this.re,e),o=_s(this.im,e),u=$t(e)?e:e?e.precision:null;if(u!==null){var l=Math.pow(10,-u);Math.abs(n/r)t.re?1:e.ret.im?1:e.im1&&(t[r]=(t[r]||0)+1):t[e]=(t[e]||0)+1,t}var va=function(e,t){var r=0,n=1,i=1,o=0,u=0,l=0,a=1,s=1,f=0,p=1,h=1,y=1,b=1e7,w;if(e!=null)if(t!==void 0){if(r=e,n=t,i=r*n,r%1!==0||n%1!==0)throw kie()}else switch(typeof e){case"object":{if("d"in e&&"n"in e)r=e.n,n=e.d,"s"in e&&(r*=e.s);else if(0 in e)r=e[0],1 in e&&(n=e[1]);else throw Ry();i=r*n;break}case"number":{if(e<0&&(i=e,e=-e),e%1===0)r=e;else if(e>0){for(e>=1&&(s=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=s);p<=b&&y<=b;)if(w=(f+h)/(p+y),e===w){p+y<=b?(r=f+h,n=p+y):y>p?(r=h,n=y):(r=f,n=p);break}else e>w?(f+=h,p+=y):(h+=f,y+=p),p>b?(r=h,n=y):(r=f,n=p);r*=s}else(isNaN(e)||isNaN(t))&&(n=r=NaN);break}case"string":{if(p=e.match(/\d+|./g),p===null)throw Ry();if(p[f]==="-"?(i=-1,f++):p[f]==="+"&&f++,p.length===f+1?u=yl(p[f++],i):p[f+1]==="."||p[f]==="."?(p[f]!=="."&&(o=yl(p[f++],i)),f++,(f+1===p.length||p[f+1]==="("&&p[f+3]===")"||p[f+1]==="'"&&p[f+3]==="'")&&(u=yl(p[f],i),a=Math.pow(10,p[f].length),f++),(p[f]==="("&&p[f+2]===")"||p[f]==="'"&&p[f+2]==="'")&&(l=yl(p[f+1],i),s=Math.pow(10,p[f+1].length)-1,f+=3)):p[f+1]==="/"||p[f+1]===":"?(u=yl(p[f],i),a=yl(p[f+2],1),f+=3):p[f+3]==="/"&&p[f+1]===" "&&(o=yl(p[f],i),u=yl(p[f+2],i),a=yl(p[f+4],1),f+=5),p.length<=f){n=a*s,i=r=l+n*o+s*u;break}}default:throw Ry()}if(n===0)throw SE();Zt.s=i<0?-1:1,Zt.n=Math.abs(r),Zt.d=Math.abs(n)};function Iie(e,t,r){for(var n=1;t>0;e=e*e%r,t>>=1)t&1&&(n=n*e%r);return n}function Fie(e,t){for(;t%2===0;t/=2);for(;t%5===0;t/=5);if(t===1)return 0;for(var r=10%t,n=1;r!==1;n++)if(r=r*10%t,n>Oie)return 0;return n}function _ie(e,t,r){for(var n=1,i=Iie(10,r,t),o=0;o<300;o++){if(n===i)return o;n=n*10%t,i=i*10%t}return 0}function dh(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function zi(e,t){if(va(e,t),this instanceof zi)e=dh(Zt.d,Zt.n),this.s=Zt.s,this.n=Zt.n/e,this.d=Zt.d/e;else return Un(Zt.s*Zt.n,Zt.d)}var SE=function(){return new Error("Division by Zero")},Ry=function(){return new Error("Invalid argument")},kie=function(){return new Error("Parameters must be integer")};zi.prototype={s:1,n:0,d:1,abs:function(){return Un(this.n,this.d)},neg:function(){return Un(-this.s*this.n,this.d)},add:function(e,t){return va(e,t),Un(this.s*this.n*Zt.d+Zt.s*this.d*Zt.n,this.d*Zt.d)},sub:function(e,t){return va(e,t),Un(this.s*this.n*Zt.d-Zt.s*this.d*Zt.n,this.d*Zt.d)},mul:function(e,t){return va(e,t),Un(this.s*Zt.s*this.n*Zt.n,this.d*Zt.d)},div:function(e,t){return va(e,t),Un(this.s*Zt.s*this.n*Zt.d,this.d*Zt.n)},clone:function(){return Un(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new zi(NaN);if(e===void 0)return Un(this.s*this.n%this.d,1);if(va(e,t),Zt.n===0&&this.d===0)throw SE();return Un(this.s*(Zt.d*this.n)%(Zt.n*this.d),Zt.d*this.d)},gcd:function(e,t){return va(e,t),Un(dh(Zt.n,this.n)*dh(Zt.d,this.d),Zt.d*this.d)},lcm:function(e,t){return va(e,t),Zt.n===0&&this.n===0?Un(0,1):Un(Zt.n*this.n,dh(Zt.n,this.n)*dh(Zt.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new zi(NaN):Un(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new zi(NaN):Un(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new zi(NaN):Un(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return va(e,t),Un(this.s*Math.round(this.n*Zt.d/(this.d*Zt.n))*Zt.n,Zt.d)},inverse:function(){return Un(this.s*this.d,this.n)},pow:function(e,t){if(va(e,t),Zt.d===1)return Zt.s<0?Un(Math.pow(this.s*this.d,Zt.n),Math.pow(this.n,Zt.n)):Un(Math.pow(this.s*this.n,Zt.n),Math.pow(this.d,Zt.n));if(this.s<0)return null;var r=_F(this.n),n=_F(this.d),i=1,o=1;for(var u in r)if(u!=="1"){if(u==="0"){i=0;break}if(r[u]*=Zt.n,r[u]%Zt.d===0)r[u]/=Zt.d;else return null;i*=Math.pow(u,r[u])}for(var u in n)if(u!=="1"){if(n[u]*=Zt.n,n[u]%Zt.d===0)n[u]/=Zt.d;else return null;o*=Math.pow(u,n[u])}return Zt.s<0?Un(o,i):Un(i,o)},equals:function(e,t){return va(e,t),this.s*this.n*Zt.d===Zt.s*Zt.n*this.d},compare:function(e,t){va(e,t);var r=this.s*this.n*Zt.d-Zt.s*Zt.n*this.d;return(0=0;o--)i=i.inverse().add(r[o]);if(Math.abs(i.sub(t).valueOf())0&&(r+=t,r+=" ",n%=i),r+=n,r+="/",r+=i),r},toLatex:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),i===1?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,n%=i),r+="\\frac{",r+=n,r+="}{",r+=i,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(t)||isNaN(r))return n;do n.push(Math.floor(t/r)),e=t%r,t=r,r=e;while(t!==1);return n},toString:function(e){var t=this.n,r=this.d;if(isNaN(t)||isNaN(r))return"NaN";e=e||15;var n=Fie(t,r),i=_ie(t,r,n),o=this.s<0?"-":"";if(o+=t/r|0,t%=r,t*=10,t&&(o+="."),n){for(var u=i;u--;)o+=t/r|0,t%=r,t*=10;o+="(";for(var u=n;u--;)o+=t/r|0,t%=r,t*=10;o+=")"}else for(var u=e;t&&u--;)o+=t/r|0,t%=r,t*=10;return o}};var Bie="Fraction",Lie=[],kF=K(Bie,Lie,()=>(Object.defineProperty(zi,"name",{value:"Fraction"}),zi.prototype.constructor=zi,zi.prototype.type="Fraction",zi.prototype.isFraction=!0,zi.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},zi.fromJSON=function(e){return new zi(e)},zi),{isClass:!0});g();x();v();var Pie="Range",Rie=[],BF=K(Pie,Rie,()=>{function e(t,r,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=t!=null,o=r!=null,u=n!=null;if(i){if(kt(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter start must be a number")}if(o){if(kt(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter end must be a number")}if(u){if(kt(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(t):0,this.end=o?parseFloat(r):0,this.step=u?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if(typeof t!="string")return null;var r=t.split(":"),n=r.map(function(o){return parseFloat(o)}),i=n.some(function(o){return isNaN(o)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var t=0,r=this.start,n=this.step,i=this.end,o=i-r;return Wa(n)===Wa(o)?t=Math.ceil(o/n):o===0&&(t=0),isNaN(t)&&(t=0),[t]},e.prototype.min=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start:this.start+(t-1)*this.step},e.prototype.max=function(){var t=this.size()[0];if(t>0)return this.step>0?this.start+(t-1)*this.step:this.start},e.prototype.forEach=function(t){var r=this.start,n=this.step,i=this.end,o=0;if(n>0)for(;ri;)t(r,[o],this),r+=n,o++},e.prototype.map=function(t){var r=[];return this.forEach(function(n,i,o){r[i[0]]=t(n,i,o)}),r},e.prototype.toArray=function(){var t=[];return this.forEach(function(r,n){t[n[0]]=r}),t},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(t){var r=_s(this.start,t);return this.step!==1&&(r+=":"+_s(this.step,t)),r+=":"+_s(this.end,t),r},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e},{isClass:!0});g();x();v();var qie="Matrix",zie=[],LF=K(qie,zie,()=>{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(t,r){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,r,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,r,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,r){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,r){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(t,r){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){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(t){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});g();x();v();g();x();v();g();x();v();g();x();v();function EE(e,t,r){var n=e.constructor,i=new n(2),o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Nt(r))throw new Error("size must be an integer");if(e.greaterThan(i.pow(r-1).sub(1))||e.lessThan(i.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(r))),o="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(o);case 8:return"".concat(e.toOctal()).concat(o);case 16:return"".concat(e.toHexadecimal()).concat(o);default:throw new Error("Base ".concat(t," not supported "))}}function qF(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:i}=pE(t);switch(r){case"fixed":return Hie(e,n);case"exponential":return PF(e,n);case"engineering":return Uie(e,n);case"bin":return EE(e,2,i);case"oct":return EE(e,8,i);case"hex":return EE(e,16,i);case"auto":{var o=RF(t?.lowerExp,-3),u=RF(t?.upperExp,5);if(e.isZero())return"0";var l,a=e.toSignificantDigits(n),s=a.e;return s>=o&&s=0?"+":"")+n.toString()}function PF(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function Hie(e,t){return e.toFixed(t)}function RF(e,t){return $t(e)?e:kt(e)?e.toNumber():t}function UF(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function Kt(e,t){var r=$ie(e,t);return t&&typeof t=="object"&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function $ie(e,t){if(typeof e=="number")return _s(e,t);if(kt(e))return qF(e,t);if(Wie(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return HF(e,t);if(gn(e))return hp(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var r=Object.keys(e).map(n=>hp(n)+": "+Kt(e[n],t));return"{"+r.join(", ")+"}"}return String(e)}function hp(e){for(var t=String(e),r="",n=0;n/g,">"),t}function HF(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;it?1:-1}g();x();v();function Jt(e,t,r){if(!(this instanceof Jt))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}Jt.prototype=new RangeError;Jt.prototype.constructor=RangeError;Jt.prototype.name="DimensionError";Jt.prototype.isDimensionError=!0;g();x();v();function Mi(e,t,r){if(!(this instanceof Mi))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),this.min!==void 0&&this.index=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}Mi.prototype=new RangeError;Mi.prototype.constructor=RangeError;Mi.prototype.name="IndexError";Mi.prototype.isIndexError=!0;function Wt(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function $F(e,t,r){var n,i=e.length;if(i!==t[r])throw new Jt(i,t[r]);if(r")}function CE(e,t){var r=t.length===0;if(r){if(Array.isArray(e))throw new Jt(e.length,0)}else $F(e,t,0)}function Nv(e,t){var r=e.isMatrix?e._size:Wt(e),n=t._sourceSize;n.forEach((i,o)=>{if(i!==null&&i!==r[o])throw new Jt(i,r[o])})}function Lr(e,t){if(e!==void 0){if(!$t(e)||!Nt(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new Mi(e,t)}}function dp(e){for(var t=0;t=0,a=t%r===0;if(l)if(a)n[o]=-t/r;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);return n}function WF(e){return e.reduce((t,r)=>t*r,1)}function Vie(e,t){for(var r=e,n,i=t.length-1;i>0;i--){var o=t[i];n=[];for(var u=r.length/o,l=0;lt.test(r))}function ME(e,t){return Array.prototype.join.call(e,t)}function wl(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n1)return e.slice(1).reduce(function(r,n){return YF(r,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function Gie(){for(var e=arguments.length,t=new Array(e),r=0;rh.length),i=Math.max(...n),o=new Array(i).fill(null),u=0;uo[f]&&(o[f]=l[s])}for(var p=0;p1||e[i]>t[o])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[o]))}}function OE(e,t){var r=Wt(e);if(Fs(r,t))return e;Av(r,t);var n=Gie(r,t),i=n.length,o=[...Array(i-r.length).fill(1),...r],u=Zie(e);r.length1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,t=t??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:ZF(r||Number.POSITIVE_INFINITY)});for(var i=[],o=0;o{var{Matrix:t}=e;function r(f,p){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(p&&!gn(p))throw new Error("Invalid datatype: "+p);if(St(f))f.type==="DenseMatrix"?(this._data=Lt(f._data),this._size=Lt(f._size),this._datatype=p||f._datatype):(this._data=f.toArray(),this._size=f.size(),this._datatype=p||f._datatype);else if(f&&pr(f.data)&&pr(f.size))this._data=f.data,this._size=f.size,CE(this._data,this._size),this._datatype=p||f.datatype;else if(pr(f))this._data=s(f),this._size=Wt(this._data),CE(this._data,this._size),this._datatype=p;else{if(f)throw new TypeError("Unsupported type of data ("+gr(f)+")");this._data=[],this._size=[0],this._datatype=p}}r.prototype=new t,r.prototype.createDenseMatrix=function(f,p){return new r(f,p)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return _f(this._data,gr)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(f,p){return new r(f,p)},r.prototype.subset=function(f,p,h){switch(arguments.length){case 1:return n(this,f);case 2:case 3:return o(this,f,p,h);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(f){if(!pr(f))throw new TypeError("Array expected");if(f.length!==this._size.length)throw new Jt(f.length,this._size.length);for(var p=0;p");var M=p.max().map(function(C){return C+1});a(f,M,y);var I=b.length,F=0;u(f._data,p,h,I,F)}return f}function u(f,p,h,y,b){var w=b===y-1,A=p.dimension(b);w?A.forEach(function(S,O){Lr(S),f[S]=h[O[0]]}):A.forEach(function(S,O){Lr(S),u(f[S],p,h[O[0]],y,b+1)})}r.prototype.resize=function(f,p,h){if(!xn(f))throw new TypeError("Array or Matrix expected");var y=f.valueOf().map(w=>Array.isArray(w)&&w.length===1?w[0]:w),b=h?this.clone():this;return l(b,y,p)};function l(f,p,h){if(p.length===0){for(var y=f._data;pr(y);)y=y[0];return y}return f._size=p.slice(0),f._data=Ls(f._data,f._size,h),f}r.prototype.reshape=function(f,p){var h=p?this.clone():this;h._data=Sv(h._data,f);var y=h._size.reduce((b,w)=>b*w);return h._size=Ev(f,y),h};function a(f,p,h){for(var y=f._size.slice(0),b=!1;y.lengthy[w]&&(y[w]=p[w],b=!0);b&&l(f,y,h)}r.prototype.clone=function(){var f=new r({data:Lt(this._data),size:Lt(this._size),datatype:this._datatype});return f},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(f){var p=this,h=Hy(f),y=function A(S,O){return pr(S)?S.map(function(M,I){return A(M,O.concat(I))}):h===1?f(S):h===2?f(S,O):f(S,O,p)},b=y(this._data,[]),w=this._datatype!==void 0?_f(b,gr):void 0;return new r(b,w)},r.prototype.forEach=function(f){var p=this,h=function y(b,w){pr(b)?b.forEach(function(A,S){y(A,w.concat(S))}):f(b,w,p)};h(this._data,[])},r.prototype[Symbol.iterator]=function*(){var f=function*p(h,y){if(pr(h))for(var b=0;b[M[S]]);p.push(new r(O,f._datatype))},w=0;w0?f:0,h=f<0?-f:0,y=this._size[0],b=this._size[1],w=Math.min(y-h,b-p),A=[],S=0;S0?h:0,w=h<0?-h:0,A=f[0],S=f[1],O=Math.min(A-w,S-b),M;if(pr(p)){if(p.length!==O)throw new Error("Invalid value array length");M=function(R){return p[R]}}else if(St(p)){var I=p.size();if(I.length!==1||I[0]!==O)throw new Error("Invalid matrix length");M=function(R){return p.get([R])}}else M=function(){return p};y||(y=kt(M(0))?M(0).mul(0):0);var F=[];if(f.length>0){F=Ls(F,f,y);for(var C=0;C{var{typed:t}=e;return t(KF,{any:Lt})});g();x();v();g();x();v();g();x();v();function $y(e){var t=e.length,r=e[0].length,n,i,o=[];for(i=0;i=n.length)throw new Mi(t,n.length);return St(e)?e.create(Wy(e.valueOf(),t,r)):Wy(e,t,r)}function Wy(e,t,r){var n,i,o,u;if(t<=0)if(Array.isArray(e[0])){for(u=$y(e),i=[],n=0;n{var{typed:t}=e;return t(QF,{number:Nt,BigNumber:function(n){return n.isInt()},bigint:function(n){return!0},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();x();v();g();x();v();var Zo="number",bl="number, number";function FE(e){return Math.abs(e)}FE.signature=Zo;function _E(e,t){return e+t}_E.signature=bl;function kE(e,t){return e-t}kE.signature=bl;function BE(e,t){return e*t}BE.signature=bl;function jie(e,t){return e/t}jie.signature=bl;function LE(e){return-e}LE.signature=Zo;function PE(e){return e}PE.signature=Zo;function yh(e){return JI(e)}yh.signature=Zo;function RE(e){return e*e*e}RE.signature=Zo;function qE(e){return Math.exp(e)}qE.signature=Zo;function zE(e){return QI(e)}zE.signature=Zo;function eoe(e,t){if(!Nt(e)||!Nt(t))throw new Error("Parameters in function gcd must be integer numbers");for(var r;t!==0;)r=e%t,e=t,t=r;return e<0?-e:e}eoe.signature=bl;function UE(e,t){if(!Nt(e)||!Nt(t))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||t===0)return 0;for(var r,n=e*t;t!==0;)r=t,t=e%r,e=r;return Math.abs(n/e)}UE.signature=bl;function e_(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function HE(e){return KI(e)}HE.signature=Zo;function $E(e){return XI(e)}$E.signature=Zo;function toe(e){return Ny(e)}toe.signature=Zo;function roe(e,t){return t===0?e:e-t*Math.floor(e/t)}roe.signature=bl;function WE(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=t<0;if(r&&(t=-t),t===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function Vy(e){return Wa(e)}Vy.signature=Zo;function noe(e){return Math.sqrt(e)}noe.signature=Zo;function VE(e){return e*e}VE.signature=Zo;function GE(e,t){var r,n,i,o=0,u=1,l=1,a=0;if(!Nt(e)||!Nt(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,r=o,o=u-n*o,u=r,r=l,l=a-n*l,a=r,e=t,t=i;var s;return e<0?s=[-e,-u,-a]:s=[e,e?u:0,a],s}GE.signature=bl;function YE(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}YE.signature=bl;function wh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Nt(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(mE(e,t))}function ioe(e){return Math.abs(e)}ioe.signature=Zo;g();x();v();var ooe="number",bh="number, number";function ZE(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitAnd");return e&t}ZE.signature=bh;function XE(e){if(!Nt(e))throw new Error("Integer expected in function bitNot");return~e}XE.signature=ooe;function KE(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitOr");return e|t}KE.signature=bh;function JE(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function bitXor");return e^t}JE.signature=bh;function QE(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function leftShift");return e<>t}jE.signature=bh;function eA(e,t){if(!Nt(e)||!Nt(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}eA.signature=bh;g();x();v();g();x();v();function xa(e,t){if(t>1;return xa(e,r)*xa(r+1,t)}function tA(e,t){if(!Nt(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Nt(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=t171?1/0:xa(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Cv(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,n=r*e,i=n*e,o=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*o)+5246819/(75246796800*o*e))}--e,t=vp[0];for(var u=1;u=1;n--)r+=o_[n]/(e+n);return oA+(e+.5)*Math.log(t)-t+Math.log(r)}Mv.signature="number";g();x();v();var Mn="number",loe="number, number";function foe(e){return Math.acos(e)}foe.signature=Mn;function aA(e){return tF(e)}aA.signature=Mn;function sA(e){return Math.atan(1/e)}sA.signature=Mn;function uA(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}uA.signature=Mn;function lA(e){return Math.asin(1/e)}lA.signature=Mn;function fA(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}fA.signature=Mn;function cA(e){return Math.acos(1/e)}cA.signature=Mn;function pA(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}pA.signature=Mn;function coe(e){return Math.asin(e)}coe.signature=Mn;function mA(e){return rF(e)}mA.signature=Mn;function poe(e){return Math.atan(e)}poe.signature=Mn;function moe(e,t){return Math.atan2(e,t)}moe.signature=loe;function hA(e){return nF(e)}hA.signature=Mn;function hoe(e){return Math.cos(e)}hoe.signature=Mn;function doe(e){return Ey(e)}doe.signature=Mn;function dA(e){return 1/Math.tan(e)}dA.signature=Mn;function gA(e){var t=Math.exp(2*e);return(t+1)/(t-1)}gA.signature=Mn;function vA(e){return 1/Math.sin(e)}vA.signature=Mn;function xA(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Wa(e)}xA.signature=Mn;function yA(e){return 1/Math.cos(e)}yA.signature=Mn;function wA(e){return 2/(Math.exp(e)+Math.exp(-e))}wA.signature=Mn;function goe(e){return Math.sin(e)}goe.signature=Mn;function bA(e){return iF(e)}bA.signature=Mn;function voe(e){return Math.tan(e)}voe.signature=Mn;function xoe(e){return Ay(e)}xoe.signature=Mn;g();x();v();var Tv="number";function yoe(e){return Nt(e)}yoe.signature=Tv;function DA(e){return e<0}DA.signature=Tv;function NA(e){return e>0}NA.signature=Tv;function woe(e){return e===0}woe.signature=Tv;function SA(e){return Number.isNaN(e)}SA.signature=Tv;g();x();v();function yn(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return e.isNaN()||t.isNaN()?!1:!e.isFinite()||!t.isFinite()?e.eq(t):e.eq(t)?!0:e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(r),n))}var a_="isNegative",boe=["typed","config"],s_=K(a_,boe,e=>{var{typed:t,config:r}=e;return t(a_,{number:n=>en(n,0,r.relTol,r.absTol)?!1:DA(n),BigNumber:n=>yn(n,new n.constructor(0),r.relTol,r.absTol)?!1:n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n<0n,Fraction:n=>n.s<0,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();x();v();var u_="isNumeric",Doe=["typed"],l_=K(u_,Doe,e=>{var{typed:t}=e;return t(u_,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();x();v();var f_="hasNumericValue",Noe=["typed","isNumeric"],c_=K(f_,Noe,e=>{var{typed:t,isNumeric:r}=e;return t(f_,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return r(i)}})});g();x();v();var p_="isPositive",Soe=["typed","config"],m_=K(p_,Soe,e=>{var{typed:t,config:r}=e;return t(p_,{number:n=>en(n,0,r.relTol,r.absTol)?!1:NA(n),BigNumber:n=>yn(n,new n.constructor(0),r.relTol,r.absTol)?!1:!n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n>0n,Fraction:n=>n.s>0&&n.n>0,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();x();v();var h_="isZero",Eoe=["typed","equalScalar"],d_=K(h_,Eoe,e=>{var{typed:t,equalScalar:r}=e;return t(h_,{"number | BigNumber | Complex | Fraction":n=>r(n,0),bigint:n=>n===0n,Unit:t.referToSelf(n=>i=>t.find(n,i.valueType())(i.value)),"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();x();v();var g_="isNaN",Aoe=["typed"],v_=K(g_,Aoe,e=>{var{typed:t}=e;return t(g_,{number:SA,BigNumber:function(n){return n.isNaN()},bigint:function(n){return!1},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();x();v();var x_="typeOf",Coe=["typed"],y_=K(x_,Coe,e=>{var{typed:t}=e;return t(x_,{any:gr})});g();x();v();g();x();v();function w_(e,t,r,n){return en(e.re,t.re,r,n)&&en(e.im,t.im,r,n)}g();x();v();var Ga=K("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return t.find(r,[n.valueType(),i.valueType()])(n.value,i.value)})}});var Xy="equalScalar",Moe=["typed","config"],b_=K(Xy,Moe,e=>{var{typed:t,config:r}=e,n=Ga({typed:t});return t(Xy,{"boolean, boolean":function(o,u){return o===u},"number, number":function(o,u){return en(o,u,r.relTol,r.absTol)},"BigNumber, BigNumber":function(o,u){return o.eq(u)||yn(o,u,r.relTol,r.absTol)},"bigint, bigint":function(o,u){return o===u},"Fraction, Fraction":function(o,u){return o.equals(u)},"Complex, Complex":function(o,u){return w_(o,u,r.relTol,r.absTol)}},n)}),j_e=K(Xy,["typed","config"],e=>{var{typed:t,config:r}=e;return t(Xy,{"number, number":function(i,o){return en(i,o,r.relTol,r.absTol)}})});g();x();v();var Toe="SparseMatrix",Ooe=["typed","equalScalar","Matrix"],D_=K(Toe,Ooe,e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(w,A){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(A&&!gn(A))throw new Error("Invalid datatype: "+A);if(St(w))o(this,w,A);else if(w&&pr(w.index)&&pr(w.ptr)&&pr(w.size))this._values=w.values,this._index=w.index,this._ptr=w.ptr,this._size=w.size,this._datatype=A||w.datatype;else if(pr(w))u(this,w,A);else{if(w)throw new TypeError("Unsupported type of data ("+gr(w)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=A}}function o(w,A,S){A.type==="SparseMatrix"?(w._values=A._values?Lt(A._values):void 0,w._index=Lt(A._index),w._ptr=Lt(A._ptr),w._size=Lt(A._size),w._datatype=S||A._datatype):u(w,A.valueOf(),S||A._datatype)}function u(w,A,S){w._values=[],w._index=[],w._ptr=[],w._datatype=S;var O=A.length,M=0,I=r,F=0;if(gn(S)&&(I=t.find(r,[S,S])||r,F=t.convert(0,S)),O>0){var C=0;do{w._ptr.push(w._index.length);for(var P=0;P");if(M.length===1){var R=A.dimension(0);R.forEach(function(H,V){Lr(H),w.set([H,0],S[V[0]],O)})}else{var q=A.dimension(0),U=A.dimension(1);q.forEach(function(H,V){Lr(H),U.forEach(function(W,ee){Lr(W),w.set([H,W],S[V[0]][ee[0]],O)})})}}return w}i.prototype.get=function(w){if(!pr(w))throw new TypeError("Array expected");if(w.length!==this._size.length)throw new Jt(w.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var A=w[0],S=w[1];Lr(A,this._size[0]),Lr(S,this._size[1]);var O=s(A,this._ptr[S],this._ptr[S+1],this._index);return OI-1||M>F-1)&&(h(this,Math.max(O+1,I),Math.max(M+1,F),S),I=this._size[0],F=this._size[1]),Lr(O,I),Lr(M,F);var R=s(O,this._ptr[M],this._ptr[M+1],this._index);return RArray.isArray(I)&&I.length===1?I[0]:I);if(O.length!==2)throw new Error("Only two dimensions matrix are supported");O.forEach(function(I){if(!$t(I)||!Nt(I)||I<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Kt(O)+")")});var M=S?this.clone():this;return h(M,O[0],O[1],A)};function h(w,A,S,O){var M=O||0,I=r,F=0;gn(w._datatype)&&(I=t.find(r,[w._datatype,w._datatype])||r,F=t.convert(0,w._datatype),M=t.convert(M,w._datatype));var C=!I(M,F),P=w._size[0],R=w._size[1],q,U,H;if(S>R){for(U=R;UP){if(C){var V=0;for(U=0;UA-1&&(w._values.splice(H,1),w._index.splice(H,1),ee++)}w._ptr[U]=w._values.length}return w._size[0]=A,w._size[1]=S,w}i.prototype.reshape=function(w,A){if(!pr(w))throw new TypeError("Array expected");if(w.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");w.forEach(function(re){if(!$t(re)||!Nt(re)||re<=-2||re===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Kt(w)+")")});var S=this._size[0]*this._size[1];w=Ev(w,S);var O=w[0]*w[1];if(S!==O)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var M=A?this.clone():this;if(this._size[0]===w[0]&&this._size[1]===w[1])return M;for(var I=[],F=0;F=A&&Y<=S&&H(w._values[ie],Y-A,V-O)}else{for(var Z={},le=W;le "+(this._values?Kt(this._values[P],w):"X")}return M},i.prototype.toString=function(){return Kt(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(w){if(w){if(kt(w)&&(w=w.toNumber()),!$t(w)||!Nt(w))throw new TypeError("The parameter k must be an integer number")}else w=0;var A=w>0?w:0,S=w<0?-w:0,O=this._size[0],M=this._size[1],I=Math.min(O-S,M-A),F=[],C=[],P=[];P[0]=0;for(var R=A;R0?S:0,P=S<0?-S:0,R=w[0],q=w[1],U=Math.min(R-P,q-C),H;if(pr(A)){if(A.length!==U)throw new Error("Invalid value array length");H=function(he){return A[he]}}else if(St(A)){var V=A.size();if(V.length!==1||V[0]!==U)throw new Error("Invalid matrix length");H=function(he){return A.get([he])}}else H=function(){return A};for(var W=[],ee=[],ie=[],Y=0;Y=0&&Z=P||M[q]!==A)){var H=O?O[R]:void 0;M.splice(q,0,A),O&&O.splice(q,0,H),M.splice(q<=R?R+1:R,1),O&&O.splice(q<=R?R+1:R,1);continue}if(q=P||M[R]!==w)){var V=O?O[q]:void 0;M.splice(R,0,w),O&&O.splice(R,0,V),M.splice(R<=q?q+1:q,1),O&&O.splice(R<=q?q+1:q,1)}}},i},{isClass:!0});g();x();v();var Ioe="number",Foe=["typed"];function _oe(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var r={"0b":2,"0o":8,"0x":16}[t[1]],n=t[2],i=t[3];return{input:e,radix:r,integerPart:n,fractionalPart:i}}else return null}function koe(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n{var{typed:t}=e,r=t("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var o=_oe(i);if(o)return koe(o);var u=0,l=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);l&&(u=Number(l[2]),i=l[1]);var a=Number(i);if(isNaN(a))throw new SyntaxError('String "'+i+'" is not a valid number');if(l){if(a>2**u-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));a>=2**(u-1)&&(a=a-2**u)}return a},BigNumber:function(i){return i.toNumber()},bigint:function(i){return Number(i)},Fraction:function(i){return i.valueOf()},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),null:function(i){return 0},"Unit, string | Unit":function(i,o){return i.toNumber(o)},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r});g();x();v();var Boe="bigint",Loe=["typed"],S_=K(Boe,Loe,e=>{var{typed:t}=e,r=t("bigint",{"":function(){return 0n},bigint:function(i){return i},number:function(i){return BigInt(i.toFixed())},BigNumber:function(i){return BigInt(i.round().toString())},Fraction:function(i){return BigInt(i.valueOf().toFixed())},"string | boolean":function(i){return BigInt(i)},null:function(i){return 0n},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))});return r.fromJSON=function(n){return BigInt(n.value)},r});g();x();v();var E_="string",Poe=["typed"],A_=K(E_,Poe,e=>{var{typed:t}=e;return t(E_,{"":function(){return""},number:_s,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r)),any:function(n){return String(n)}})});g();x();v();var C_="boolean",Roe=["typed"],M_=K(C_,Roe,e=>{var{typed:t}=e;return t(C_,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var i=n.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;var o=Number(n);if(n!==""&&!isNaN(o))return!!o;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();x();v();var qoe="bignumber",zoe=["typed","BigNumber"],T_=K(qoe,zoe,e=>{var{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(i){return new r(i+"")},string:function(i){var o=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(o){var u=o[2],l=r(o[1]),a=new r(2).pow(Number(u));if(l.gt(a.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var s=new r(2).pow(Number(u)-1);return l.gte(s)?l.sub(a):l}return new r(i)},BigNumber:function(i){return i},bigint:function(i){return new r(i.toString())},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),Fraction:function(i){return new r(i.n).div(i.d).times(i.s)},null:function(i){return new r(0)},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();x();v();var Uoe="complex",Hoe=["typed","Complex"],O_=K(Uoe,Hoe,e=>{var{typed:t,Complex:r}=e;return t("complex",{"":function(){return r.ZERO},number:function(i){return new r(i,0)},"number, number":function(i,o){return new r(i,o)},"BigNumber, BigNumber":function(i,o){return new r(i.toNumber(),o.toNumber())},Fraction:function(i){return new r(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return r(i)},null:function(i){return r(0)},Object:function(i){if("re"in i&&"im"in i)return new r(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new r(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();x();v();var $oe="fraction",Woe=["typed","Fraction"],I_=K($oe,Woe,e=>{var{typed:t,Fraction:r}=e;return t("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new r(i)},string:function(i){return new r(i)},"number, number":function(i,o){return new r(i,o)},null:function(i){return new r(0)},BigNumber:function(i){return new r(i.toString())},bigint:function(i){return new r(i.toString())},Fraction:function(i){return i},Unit:t.referToSelf(n=>i=>{var o=i.clone();return o.value=n(i.value),o}),Object:function(i){return new r(i)},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();x();v();var F_="matrix",Voe=["typed","Matrix","DenseMatrix","SparseMatrix"],__=K(F_,Voe,e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(F_,{"":function(){return o([])},string:function(l){return o([],l)},"string, string":function(l,a){return o([],l,a)},Array:function(l){return o(l)},Matrix:function(l){return o(l,l.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(u,l,a){if(l==="dense"||l==="default"||l===void 0)return new n(u,a);if(l==="sparse")return new i(u,a);throw new TypeError("Unknown matrix type "+JSON.stringify(l)+".")}});g();x();v();var k_="matrixFromFunction",Goe=["typed","matrix","isZero"],B_=K(k_,Goe,e=>{var{typed:t,matrix:r,isZero:n}=e;return t(k_,{"Array | Matrix, function, string, string":function(u,l,a,s){return i(u,l,a,s)},"Array | Matrix, function, string":function(u,l,a){return i(u,l,a)},"Matrix, function":function(u,l){return i(u,l,"dense")},"Array, function":function(u,l){return i(u,l,"dense").toArray()},"Array | Matrix, string, function":function(u,l,a){return i(u,a,l)},"Array | Matrix, string, string, function":function(u,l,a,s){return i(u,s,l,a)}});function i(o,u,l,a){var s;return a!==void 0?s=r(l,a):s=r(l),s.resize(o),s.forEach(function(f,p){var h=u(p);n(h)||s.set(p,h)}),s}});g();x();v();var L_="matrixFromRows",Yoe=["typed","matrix","flatten","size"],P_=K(L_,Yoe,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(L_,{"...Array":function(a){return o(a)},"...Matrix":function(a){return r(o(a.map(s=>s.toArray())))}});function o(l){if(l.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var a=u(l[0]),s=[];for(var f of l){var p=u(f);if(p!==a)throw new TypeError("The vectors had different length: "+(a|0)+" \u2260 "+(p|0));s.push(n(f))}return s}function u(l){var a=i(l);if(a.length===1)return a[0];if(a.length===2){if(a[0]===1)return a[1];if(a[1]===1)return a[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}});g();x();v();var R_="matrixFromColumns",Zoe=["typed","matrix","flatten","size"],q_=K(R_,Zoe,e=>{var{typed:t,matrix:r,flatten:n,size:i}=e;return t(R_,{"...Array":function(a){return o(a)},"...Matrix":function(a){return r(o(a.map(s=>s.toArray())))}});function o(l){if(l.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var a=u(l[0]),s=[],f=0;f{var{typed:t}=e;return t(z_,{"Unit, Array":function(n,i){return n.splitUnit(i)}})});g();x();v();var H_="unaryMinus",Koe=["typed"],$_=K(H_,Koe,e=>{var{typed:t}=e;return t(H_,{number:LE,"Complex | BigNumber | Fraction":r=>r.neg(),bigint:r=>-r,Unit:t.referToSelf(r=>n=>{var i=n.clone();return i.value=t.find(r,i.valueType())(n.value),i}),"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r,!0))})});g();x();v();var W_="unaryPlus",Joe=["typed","config","numeric"],V_=K(W_,Joe,e=>{var{typed:t,config:r,numeric:n}=e;return t(W_,{number:PE,Complex:function(o){return o},BigNumber:function(o){return o},bigint:function(o){return o},Fraction:function(o){return o},Unit:function(o){return o.clone()},"Array | Matrix":t.referToSelf(i=>o=>Ct(o,i,!0)),boolean:function(o){return n(o?1:0,r.number)},string:function(o){return n(o,co(o,r))}})});g();x();v();var G_="abs",Qoe=["typed"],Y_=K(G_,Qoe,e=>{var{typed:t}=e;return t(G_,{number:FE,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),bigint:r=>r<0n?-r:r,"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r,!0))})});g();x();v();var Z_="apply",joe=["typed","isInteger"],Dh=K(Z_,joe,e=>{var{typed:t,isInteger:r}=e;return t(Z_,{"Array | Matrix, number | BigNumber, function":function(i,o,u){if(!r(o))throw new TypeError("Integer number expected for dimension");var l=Array.isArray(i)?Wt(i):i.size();if(o<0||o>=l.length)throw new Mi(o,l.length);return St(i)?i.create(Ky(i.valueOf(),o,u)):Ky(i,o,u)}})});function Ky(e,t,r){var n,i,o;if(t<=0)if(Array.isArray(e[0])){for(o=eae(e),i=[],n=0;n{var{typed:t}=e;return t(X_,{"number, number":_E,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"bigint, bigint":function(n,i){return n+i},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(r,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})});g();x();v();var J_="subtractScalar",rae=["typed"],Q_=K(J_,rae,e=>{var{typed:t}=e;return t(J_,{"number, number":kE,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"bigint, bigint":function(n,i){return n-i},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":t.referToSelf(r=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var o=n.clone();return o.value=t.find(r,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})});g();x();v();var j_="cbrt",nae=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],ek=K(j_,nae,e=>{var{config:t,typed:r,isNegative:n,unaryMinus:i,matrix:o,Complex:u,BigNumber:l,Fraction:a}=e;return r(j_,{number:yh,Complex:s,"Complex, boolean":s,BigNumber:function(h){return h.cbrt()},Unit:f});function s(p,h){var y=p.arg()/3,b=p.abs(),w=new u(yh(b),0).mul(new u(0,y).exp());if(h){var A=[w,new u(yh(b),0).mul(new u(0,y+Math.PI*2/3).exp()),new u(yh(b),0).mul(new u(0,y-Math.PI*2/3).exp())];return t.matrix==="Array"?A:o(A)}else return w}function f(p){if(p.value&&Ni(p.value)){var h=p.clone();return h.value=1,h=h.pow(1/3),h.value=s(p.value),h}else{var y=n(p.value);y&&(p.value=i(p.value));var b;kt(p.value)?b=new l(1).div(3):da(p.value)?b=new a(1,3):b=1/3;var w=p.pow(b);return y&&(w.value=i(w.value)),w}}});g();x();v();g();x();v();var iae="matAlgo11xS0s",oae=["typed","equalScalar"],Pr=K(iae,oae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u,l){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var y=p[0],b=p[1],w,A=r,S=0,O=u;typeof h=="string"&&(w=h,A=t.find(r,[w,w]),S=t.convert(0,w),o=t.convert(o,w),O=t.find(u,[w,w]));for(var M=[],I=[],F=[],C=0;C{var{typed:t,DenseMatrix:r}=e;return function(i,o,u,l){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var y=p[0],b=p[1],w,A=u;typeof h=="string"&&(w=h,o=t.convert(o,w),A=t.find(u,[w,w]));for(var S=[],O=[],M=[],I=0;I{var{typed:t}=e;return function(i,o,u,l){var a=i._data,s=i._size,f=i._datatype,p,h=u;typeof f=="string"&&(p=f,o=t.convert(o,p),h=t.find(u,[p,p]));var y=s.length>0?r(h,0,s,s[0],a,o,l):[];return i.createDenseMatrix({data:y,size:Lt(s),datatype:p})};function r(n,i,o,u,l,a,s){var f=[];if(i===o.length-1)for(var p=0;p{var{typed:t,config:r,round:n}=e;return t(EA,{number:function(o){return en(o,n(o),r.relTol,r.absTol)?n(o):Math.ceil(o)},"number, number":function(o,u){if(en(o,n(o,u),r.relTol,r.absTol))return n(o,u);var[l,a]="".concat(o,"e").split("e"),s=Math.ceil(Number("".concat(l,"e").concat(Number(a)+u)));return[l,a]="".concat(s,"e").split("e"),Number("".concat(l,"e").concat(Number(a)-u))}})}),tk=K(EA,fae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}=e,a=Pr({typed:t,equalScalar:o}),s=Cr({typed:t,DenseMatrix:l}),f=Qn({typed:t}),p=cae({typed:t,config:r,round:n});return t("ceil",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(y){return y.ceil()},"Complex, number":function(y,b){return y.ceil(b)},"Complex, BigNumber":function(y,b){return y.ceil(b.toNumber())},BigNumber:function(y){return yn(y,n(y),r.relTol,r.absTol)?n(y):y.ceil()},"BigNumber, BigNumber":function(y,b){return yn(y,n(y,b),r.relTol,r.absTol)?n(y,b):y.toDecimalPlaces(b.toNumber(),mp.ROUND_CEIL)},Fraction:function(y){return y.ceil()},"Fraction, number":function(y,b){return y.ceil(b)},"Fraction, BigNumber":function(y,b){return y.ceil(b.toNumber())},"Array | Matrix":t.referToSelf(h=>y=>Ct(y,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(y,b)=>Ct(y,w=>h(w,b),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(y,b)=>a(y,b,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(y,b)=>f(y,b,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(y,b)=>f(i(b),y,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(y,b)=>o(y,0)?u(b.size(),b.storage()):b.storage()==="dense"?f(b,y,h,!0):s(b,y,h,!0))})});g();x();v();var rk="cube",pae=["typed"],nk=K(rk,pae,e=>{var{typed:t}=e;return t(rk,{number:RE,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},bigint:function(n){return n*n*n},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})});g();x();v();var ik="exp",mae=["typed"],ok=K(ik,mae,e=>{var{typed:t}=e;return t(ik,{number:qE,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});g();x();v();var ak="expm1",hae=["typed","Complex"],sk=K(ak,hae,e=>{var{typed:t,Complex:r}=e;return t(ak,{number:zE,Complex:function(i){var o=Math.exp(i.re);return new r(o*Math.cos(i.im)-1,o*Math.sin(i.im))},BigNumber:function(i){return i.exp().minus(1)}})});g();x();v();var AA="fix",dae=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],gae=K(AA,["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t(AA,{number:function(o){return o>0?n(o):r(o)},"number, number":function(o,u){return o>0?n(o,u):r(o,u)}})}),uk=K(AA,dae,e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:o,equalScalar:u,zeros:l,DenseMatrix:a}=e,s=Cr({typed:t,DenseMatrix:a}),f=Qn({typed:t}),p=gae({typed:t,ceil:i,floor:o});return t("fix",{number:p.signatures.number,"number, number | BigNumber":p.signatures["number,number"],Complex:function(y){return new r(y.re>0?Math.floor(y.re):Math.ceil(y.re),y.im>0?Math.floor(y.im):Math.ceil(y.im))},"Complex, number":function(y,b){return new r(y.re>0?o(y.re,b):i(y.re,b),y.im>0?o(y.im,b):i(y.im,b))},"Complex, BigNumber":function(y,b){var w=b.toNumber();return new r(y.re>0?o(y.re,w):i(y.re,w),y.im>0?o(y.im,w):i(y.im,w))},BigNumber:function(y){return y.isNegative()?i(y):o(y)},"BigNumber, number | BigNumber":function(y,b){return y.isNegative()?i(y,b):o(y,b)},Fraction:function(y){return y.s<0?y.ceil():y.floor()},"Fraction, number | BigNumber":function(y,b){return y.s<0?i(y,b):o(y,b)},"Array | Matrix":t.referToSelf(h=>y=>Ct(y,h,!0)),"Array | Matrix, number | BigNumber":t.referToSelf(h=>(y,b)=>Ct(y,w=>h(w,b),!0)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(y,b)=>f(n(b),y,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(y,b)=>u(y,0)?l(b.size(),b.storage()):b.storage()==="dense"?f(b,y,h,!0):s(b,y,h,!0))})});g();x();v();var CA="floor",vae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],xae=K(CA,["typed","config","round"],e=>{var{typed:t,config:r,round:n}=e;return t(CA,{number:function(o){return en(o,n(o),r.relTol,r.absTol)?n(o):Math.floor(o)},"number, number":function(o,u){if(en(o,n(o,u),r.relTol,r.absTol))return n(o,u);var[l,a]="".concat(o,"e").split("e"),s=Math.floor(Number("".concat(l,"e").concat(Number(a)+u)));return[l,a]="".concat(s,"e").split("e"),Number("".concat(l,"e").concat(Number(a)-u))}})}),Jy=K(CA,vae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}=e,a=Pr({typed:t,equalScalar:o}),s=Cr({typed:t,DenseMatrix:l}),f=Qn({typed:t}),p=xae({typed:t,config:r,round:n});return t("floor",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(y){return y.floor()},"Complex, number":function(y,b){return y.floor(b)},"Complex, BigNumber":function(y,b){return y.floor(b.toNumber())},BigNumber:function(y){return yn(y,n(y),r.relTol,r.absTol)?n(y):y.floor()},"BigNumber, BigNumber":function(y,b){return yn(y,n(y,b),r.relTol,r.absTol)?n(y,b):y.toDecimalPlaces(b.toNumber(),mp.ROUND_FLOOR)},Fraction:function(y){return y.floor()},"Fraction, number":function(y,b){return y.floor(b)},"Fraction, BigNumber":function(y,b){return y.floor(b.toNumber())},"Array | Matrix":t.referToSelf(h=>y=>Ct(y,h,!0)),"Array, number | BigNumber":t.referToSelf(h=>(y,b)=>Ct(y,w=>h(w,b),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(y,b)=>a(y,b,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(y,b)=>f(y,b,h,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(h=>(y,b)=>f(i(b),y,h,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(h=>(y,b)=>o(y,0)?u(b.size(),b.storage()):b.storage()==="dense"?f(b,y,h,!0):s(b,y,h,!0))})});g();x();v();g();x();v();g();x();v();var yae="matAlgo02xDS0",wae=["typed","equalScalar"],jn=K(yae,wae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u,l){var a=i._data,s=i._size,f=i._datatype||i.getDataType(),p=o._values,h=o._index,y=o._ptr,b=o._size,w=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(s.length!==b.length)throw new Jt(s.length,b.length);if(s[0]!==b[0]||s[1]!==b[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+b+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var A=s[0],S=s[1],O,M=r,I=0,F=u;typeof f=="string"&&f===w&&f!=="mixed"&&(O=f,M=t.find(r,[O,O]),I=t.convert(0,O),F=t.find(u,[O,O]));for(var C=[],P=[],R=[],q=0;q{var{typed:t}=e;return function(n,i,o,u){var l=n._data,a=n._size,s=n._datatype||n.getDataType(),f=i._values,p=i._index,h=i._ptr,y=i._size,b=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==y.length)throw new Jt(a.length,y.length);if(a[0]!==y[0]||a[1]!==y[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+y+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var w=a[0],A=a[1],S,O=0,M=o;typeof s=="string"&&s===b&&s!=="mixed"&&(S=s,O=t.convert(0,S),M=t.find(o,[S,S]));for(var I=[],F=0;F{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,y=o._index,b=o._ptr,w=o._size,A=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Jt(f.length,w.length);if(f[0]!==w[0]||f[1]!==w[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+w+")");var S=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===A&&p!=="mixed"&&(M=p,I=t.find(r,[M,M]),F=t.convert(0,M),C=t.find(u,[M,M]));var P=l&&h?[]:void 0,R=[],q=[],U=P?[]:void 0,H=P?[]:void 0,V=[],W=[],ee,ie,Y,Z;for(ie=0;ie{var{typed:t}=e;return function(i,o,u){var l=i._data,a=i._size,s=i._datatype,f=o._data,p=o._size,h=o._datatype,y=[];if(a.length!==p.length)throw new Jt(a.length,p.length);for(var b=0;b0?r(A,0,y,y[0],l,f):[];return i.createDenseMatrix({data:S,size:y,datatype:w})};function r(n,i,o,u,l,a){var s=[];if(i===o.length-1)for(var f=0;f{var{concat:t}=e;return function(i,o){var u=Math.max(i._size.length,o._size.length);if(i._size.length===o._size.length&&i._size.every((b,w)=>b===o._size[w]))return[i,o];for(var l=r(i._size,u,0),a=r(o._size,u,0),s=[],f=0;f{var{typed:t,matrix:r,concat:n}=e,i=lk({typed:t}),o=Qn({typed:t}),u=fk({concat:n});return function(a){var s=a.elop,f=a.SD||a.DS,p;s?(p={"DenseMatrix, DenseMatrix":(w,A)=>i(...u(w,A),s),"Array, Array":(w,A)=>i(...u(r(w),r(A)),s).valueOf(),"Array, DenseMatrix":(w,A)=>i(...u(r(w),A),s),"DenseMatrix, Array":(w,A)=>i(...u(w,r(A)),s)},a.SS&&(p["SparseMatrix, SparseMatrix"]=(w,A)=>a.SS(...u(w,A),s,!1)),a.DS&&(p["DenseMatrix, SparseMatrix"]=(w,A)=>a.DS(...u(w,A),s,!1),p["Array, SparseMatrix"]=(w,A)=>a.DS(...u(r(w),A),s,!1)),f&&(p["SparseMatrix, DenseMatrix"]=(w,A)=>f(...u(A,w),s,!0),p["SparseMatrix, Array"]=(w,A)=>f(...u(r(A),w),s,!0))):(p={"DenseMatrix, DenseMatrix":t.referToSelf(w=>(A,S)=>i(...u(A,S),w)),"Array, Array":t.referToSelf(w=>(A,S)=>i(...u(r(A),r(S)),w).valueOf()),"Array, DenseMatrix":t.referToSelf(w=>(A,S)=>i(...u(r(A),S),w)),"DenseMatrix, Array":t.referToSelf(w=>(A,S)=>i(...u(A,r(S)),w))},a.SS&&(p["SparseMatrix, SparseMatrix"]=t.referToSelf(w=>(A,S)=>a.SS(...u(A,S),w,!1))),a.DS&&(p["DenseMatrix, SparseMatrix"]=t.referToSelf(w=>(A,S)=>a.DS(...u(A,S),w,!1)),p["Array, SparseMatrix"]=t.referToSelf(w=>(A,S)=>a.DS(...u(r(A),S),w,!1))),f&&(p["SparseMatrix, DenseMatrix"]=t.referToSelf(w=>(A,S)=>f(...u(S,A),w,!0)),p["SparseMatrix, Array"]=t.referToSelf(w=>(A,S)=>f(...u(r(S),A),w,!0))));var h=a.scalar||"any",y=a.Ds||a.Ss;y&&(s?(p["DenseMatrix,"+h]=(w,A)=>o(w,A,s,!1),p[h+", DenseMatrix"]=(w,A)=>o(A,w,s,!0),p["Array,"+h]=(w,A)=>o(r(w),A,s,!1).valueOf(),p[h+", Array"]=(w,A)=>o(r(A),w,s,!0).valueOf()):(p["DenseMatrix,"+h]=t.referToSelf(w=>(A,S)=>o(A,S,w,!1)),p[h+", DenseMatrix"]=t.referToSelf(w=>(A,S)=>o(S,A,w,!0)),p["Array,"+h]=t.referToSelf(w=>(A,S)=>o(r(A),S,w,!1).valueOf()),p[h+", Array"]=t.referToSelf(w=>(A,S)=>o(r(S),A,w,!0).valueOf())));var b=a.sS!==void 0?a.sS:a.Ss;return s?(a.Ss&&(p["SparseMatrix,"+h]=(w,A)=>a.Ss(w,A,s,!1)),b&&(p[h+", SparseMatrix"]=(w,A)=>b(A,w,s,!0))):(a.Ss&&(p["SparseMatrix,"+h]=t.referToSelf(w=>(A,S)=>a.Ss(A,S,w,!1))),b&&(p[h+", SparseMatrix"]=t.referToSelf(w=>(A,S)=>b(S,A,w,!0)))),s&&s.signatures&&by(p,s.signatures),p}});var ck="mod",Iae=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],Qy=K(ck,Iae,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l,concat:a}=e,s=Jy({typed:t,config:r,round:n,matrix:i,equalScalar:o,zeros:u,DenseMatrix:l}),f=jn({typed:t,equalScalar:o}),p=Kr({typed:t}),h=Bf({typed:t,equalScalar:o}),y=Pr({typed:t,equalScalar:o}),b=Cr({typed:t,DenseMatrix:l}),w=tr({typed:t,matrix:i,concat:a});return t(ck,{"number, number":A,"BigNumber, BigNumber":function(O,M){return M.isZero()?O:O.sub(M.mul(s(O.div(M))))},"bigint, bigint":function(O,M){if(M===0n)return O;if(O<0){var I=O%M;return I===0n?I:I+M}return O%M},"Fraction, Fraction":function(O,M){return M.equals(0)?O:O.sub(M.mul(s(O.div(M))))}},w({SS:h,DS:p,SD:f,Ss:y,sS:b}));function A(S,O){return O===0?S:S-O*s(S/O)}});g();x();v();var Fae="matAlgo01xDSid",_ae=["typed"],ho=K(Fae,_ae,e=>{var{typed:t}=e;return function(n,i,o,u){var l=n._data,a=n._size,s=n._datatype||n.getDataType(),f=i._values,p=i._index,h=i._ptr,y=i._size,b=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(a.length!==y.length)throw new Jt(a.length,y.length);if(a[0]!==y[0]||a[1]!==y[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+y+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var w=a[0],A=a[1],S=typeof s=="string"&&s!=="mixed"&&s===b?s:void 0,O=S?t.find(o,[S,S]):o,M,I,F=[];for(M=0;M{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,y=o._index,b=o._ptr,w=o._size,A=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Jt(f.length,w.length);if(f[0]!==w[0]||f[1]!==w[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+w+")");var S=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===A&&p!=="mixed"&&(M=p,I=t.find(r,[M,M]),F=t.convert(0,M),C=t.find(u,[M,M]));var P=l&&h?[]:void 0,R=[],q=[],U=l&&h?[]:void 0,H=l&&h?[]:void 0,V=[],W=[],ee,ie,Y,Z,le;for(ie=0;ie{var{typed:t,DenseMatrix:r}=e;return function(i,o,u,l){var a=i._values,s=i._index,f=i._ptr,p=i._size,h=i._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var y=p[0],b=p[1],w,A=u;typeof h=="string"&&(w=h,o=t.convert(o,w),A=t.find(u,[w,w]));for(var S=[],O=[],M=[],I=0;IArray.isArray(t))}var hk=K(pk,Rae,e=>{var{typed:t,matrix:r,config:n,round:i,equalScalar:o,zeros:u,BigNumber:l,DenseMatrix:a,concat:s}=e,f=Qy({typed:t,config:n,round:i,matrix:r,equalScalar:o,zeros:u,DenseMatrix:a,concat:s}),p=ho({typed:t}),h=Nh({typed:t,equalScalar:o}),y=Xo({typed:t,DenseMatrix:a}),b=tr({typed:t,matrix:r,concat:s});return t(pk,{"number, number":w,"BigNumber, BigNumber":A,"Fraction, Fraction":(S,O)=>S.gcd(O)},b({SS:h,DS:p,Ss:y}),{[qae]:t.referToSelf(S=>(O,M,I)=>{for(var F=S(O,M),C=0;CO=>{if(O.length===1&&Array.isArray(O[0])&&mk(O[0]))return S(...O[0]);if(mk(O))return S(...O);throw new ya("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(S=>O=>S(O.toArray()))});function w(S,O){if(!Nt(S)||!Nt(O))throw new Error("Parameters in function gcd must be integer numbers");for(var M;O!==0;)M=f(S,O),S=O,O=M;return S<0?-S:S}function A(S,O){if(!S.isInt()||!O.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var M=new l(0);!O.isZero();){var I=f(S,O);S=O,O=I}return S.lt(M)?S.neg():S}});g();x();v();g();x();v();var zae="matAlgo06xS0S0",Uae=["typed","equalScalar"],Lf=K(zae,Uae,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,a=i._size,s=i._datatype||i._data===void 0?i._datatype:i.getDataType(),f=o._values,p=o._size,h=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(a.length!==p.length)throw new Jt(a.length,p.length);if(a[0]!==p[0]||a[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+p+")");var y=a[0],b=a[1],w,A=r,S=0,O=u;typeof s=="string"&&s===h&&s!=="mixed"&&(w=s,A=t.find(r,[w,w]),S=t.convert(0,w),O=t.find(u,[w,w]));for(var M=l&&f?[]:void 0,I=[],F=[],C=M?[]:void 0,P=[],R=[],q=0;q{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,o=jn({typed:t,equalScalar:n}),u=Lf({typed:t,equalScalar:n}),l=Pr({typed:t,equalScalar:n}),a=tr({typed:t,matrix:r,concat:i}),s="number | BigNumber | Fraction | Matrix | Array",f={};return f["".concat(s,", ").concat(s,", ...").concat(s)]=t.referToSelf(h=>(y,b,w)=>{for(var A=h(y,b),S=0;Sh.lcm(y)},a({SS:u,DS:o,Ss:l}),f);function p(h,y){if(!h.isInt()||!y.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(h.isZero())return h;if(y.isZero())return y;for(var b=h.times(y);!y.isZero();){var w=y;y=h.mod(w),h=w}return b.div(h).abs()}});g();x();v();var vk="log10",$ae=["typed","config","Complex"],xk=K(vk,$ae,e=>{var{typed:t,config:r,Complex:n}=e;return t(vk,{number:function(o){return o>=0||r.predictable?HE(o):new n(o,0).log().div(Math.LN10)},Complex:function(o){return new n(o).log().div(Math.LN10)},BigNumber:function(o){return!o.isNegative()||r.predictable?o.log():new n(o.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf(i=>o=>Ct(o,i))})});g();x();v();var yk="log2",Wae=["typed","config","Complex"],wk=K(yk,Wae,e=>{var{typed:t,config:r,Complex:n}=e;return t(yk,{number:function(u){return u>=0||r.predictable?$E(u):i(new n(u,0))},Complex:i,BigNumber:function(u){return!u.isNegative()||r.predictable?u.log(2):i(new n(u.toNumber(),0))},"Array | Matrix":t.referToSelf(o=>u=>Ct(u,o))});function i(o){var u=Math.sqrt(o.re*o.re+o.im*o.im);return new n(Math.log2?Math.log2(u):Math.log(u)/Math.LN2,Math.atan2(o.im,o.re)/Math.LN2)}});g();x();v();var Vae="multiplyScalar",Gae=["typed"],bk=K(Vae,Gae,e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":BE,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"bigint, bigint":function(n,i){return n*i},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(r,n)=>n.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,n)=>r.multiply(n)})});g();x();v();var Dk="multiply",Yae=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],Nk=K(Dk,Yae,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:o,dot:u}=e,l=Pr({typed:t,equalScalar:o}),a=Qn({typed:t});function s(F,C){switch(F.length){case 1:switch(C.length){case 1:if(F[0]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(F[0]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+F[0]+") must match Matrix rows ("+C[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+C.length+" dimensions)")}break;case 2:switch(C.length){case 1:if(F[1]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+F[1]+") must match Vector length ("+C[0]+")");break;case 2:if(F[1]!==C[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+F[1]+") must match Matrix B rows ("+C[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+C.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+F.length+" dimensions)")}}function f(F,C,P){if(P===0)throw new Error("Cannot multiply two empty vectors");return u(F,C)}function p(F,C){if(C.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return h(F,C)}function h(F,C){var P=F._data,R=F._size,q=F._datatype||F.getDataType(),U=C._data,H=C._size,V=C._datatype||C.getDataType(),W=R[0],ee=H[1],ie,Y=n,Z=i;q&&V&&q===V&&typeof q=="string"&&q!=="mixed"&&(ie=q,Y=t.find(n,[ie,ie]),Z=t.find(i,[ie,ie]));for(var le=[],re=0;reOe)for(var Ee=0,ze=0;ze(C,P)=>{s(Wt(C),Wt(P));var R=F(r(C),r(P));return St(R)?R.valueOf():R}),"Matrix, Matrix":function(C,P){var R=C.size(),q=P.size();return s(R,q),R.length===1?q.length===1?f(C,P,R[0]):p(C,P):q.length===1?y(C,P):b(C,P)},"Matrix, Array":t.referTo("Matrix,Matrix",F=>(C,P)=>F(C,r(P))),"Array, Matrix":t.referToSelf(F=>(C,P)=>F(r(C,P.storage()),P)),"SparseMatrix, any":function(C,P){return l(C,P,i,!1)},"DenseMatrix, any":function(C,P){return a(C,P,i,!1)},"any, SparseMatrix":function(C,P){return l(P,C,i,!0)},"any, DenseMatrix":function(C,P){return a(P,C,i,!0)},"Array, any":function(C,P){return a(r(C),P,i,!1).valueOf()},"any, Array":function(C,P){return a(r(P),C,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(F=>(C,P,R)=>{for(var q=F(C,P),U=0;U{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,concat:o}=e,u=ho({typed:t}),l=jn({typed:t,equalScalar:n}),a=Lf({typed:t,equalScalar:n}),s=Pr({typed:t,equalScalar:n}),f=tr({typed:t,matrix:r,concat:o});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(Sk,{number:WE,"number, number":WE,BigNumber:y=>h(y,new i(2)),"BigNumber, BigNumber":h,Complex:p,"Complex, number":p,Array:t.referTo("DenseMatrix,number",y=>b=>y(r(b),2).valueOf()),DenseMatrix:t.referTo("DenseMatrix,number",y=>b=>y(b,2)),SparseMatrix:t.referTo("SparseMatrix,number",y=>b=>y(b,2)),"SparseMatrix, SparseMatrix":t.referToSelf(y=>(b,w)=>{if(w.density()===1)return a(b,w,y);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(y=>(b,w)=>{if(w.density()===1)return u(b,w,y,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",y=>(b,w)=>y(r(b),w)),"number | BigNumber, SparseMatrix":t.referToSelf(y=>(b,w)=>{if(w.density()===1)return s(w,b,y,!0);throw new Error("Root must be non-zero")})},f({scalar:"number | BigNumber",SD:l,Ss:s,sS:!1}));function h(y,b){var w=i.precision,A=i.clone({precision:w+2}),S=new i(0),O=new A(1),M=b.isNegative();if(M&&(b=b.neg()),b.isZero())throw new Error("Root must be non-zero");if(y.isNegative()&&!b.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(y.isZero())return M?new A(1/0):0;if(!y.isFinite())return M?S:y;var I=y.abs().pow(O.div(b));return I=y.isNeg()?I.neg():I,new i((M?O.div(I):I).toPrecision(w))}});g();x();v();var Ak="sign",Xae=["typed","BigNumber","Fraction","complex"],Ck=K(Ak,Xae,e=>{var{typed:t,BigNumber:r,complex:n,Fraction:i}=e;return t(Ak,{number:Vy,Complex:function(u){return u.im===0?n(Vy(u.re)):u.sign()},BigNumber:function(u){return new r(u.cmp(0))},bigint:function(u){return u>0n?1n:u<0n?-1n:0n},Fraction:function(u){return new i(u.s,1)},"Array | Matrix":t.referToSelf(o=>u=>Ct(u,o,!0)),Unit:t.referToSelf(o=>u=>{if(!u._isDerived()&&u.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return t.find(o,u.valueType())(u.value)})})});g();x();v();var Kae="sqrt",Jae=["config","typed","Complex"],Mk=K(Kae,Jae,e=>{var{config:t,typed:r,Complex:n}=e;return r("sqrt",{number:i,Complex:function(u){return u.sqrt()},BigNumber:function(u){return!u.isNegative()||t.predictable?u.sqrt():i(u.toNumber())},Unit:function(u){return u.pow(.5)}});function i(o){return isNaN(o)?NaN:o>=0||t.predictable?Math.sqrt(o):new n(o,0).sqrt()}});g();x();v();var Tk="square",Qae=["typed"],Ok=K(Tk,Qae,e=>{var{typed:t}=e;return t(Tk,{number:VE,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},bigint:function(n){return n*n},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})});g();x();v();var Ik="subtract",jae=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Fk=K(Ik,jae,e=>{var{typed:t,matrix:r,equalScalar:n,subtractScalar:i,unaryMinus:o,DenseMatrix:u,concat:l}=e,a=ho({typed:t}),s=Kr({typed:t}),f=Bf({typed:t,equalScalar:n}),p=Xo({typed:t,DenseMatrix:u}),h=Cr({typed:t,DenseMatrix:u}),y=tr({typed:t,matrix:r,concat:l});return t(Ik,{"any, any":i},y({elop:i,SS:f,DS:a,SD:s,Ss:h,sS:p}))});g();x();v();var _k="xgcd",ese=["typed","config","matrix","BigNumber"],kk=K(_k,ese,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(_k,{"number, number":function(l,a){var s=GE(l,a);return r.matrix==="Array"?s:n(s)},"BigNumber, BigNumber":o});function o(u,l){var a,s,f,p=new i(0),h=new i(1),y=p,b=h,w=h,A=p;if(!u.isInt()||!l.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!l.isZero();)s=u.div(l).floor(),f=u.mod(l),a=y,y=b.minus(s.times(y)),b=a,a=w,w=A.minus(s.times(w)),A=a,u=l,l=f;var S;return u.lt(p)?S=[u.neg(),b.neg(),A.neg()]:S=[u,u.isZero()?0:b,A],r.matrix==="Array"?S:n(S)}});g();x();v();var Bk="invmod",tse=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Lk=K(Bk,tse,e=>{var{typed:t,config:r,BigNumber:n,xgcd:i,equal:o,smaller:u,mod:l,add:a,isInteger:s}=e;return t(Bk,{"number, number":f,"BigNumber, BigNumber":f});function f(p,h){if(!s(p)||!s(h))throw new Error("Parameters in function invmod must be integer numbers");if(p=l(p,h),o(h,0))throw new Error("Divisor must be non zero");var y=i(p,h);y=y.valueOf();var[b,w]=y;return o(b,n(1))?(w=l(w,h),u(w,n(0))&&(w=a(w,h)),w):NaN}});g();x();v();g();x();v();var rse="matAlgo09xS0Sf",nse=["typed","equalScalar"],jy=K(rse,nse,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,y=o._index,b=o._ptr,w=o._size,A=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Jt(f.length,w.length);if(f[0]!==w[0]||f[1]!==w[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+w+")");var S=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===A&&p!=="mixed"&&(M=p,I=t.find(r,[M,M]),F=t.convert(0,M),C=t.find(u,[M,M]));var P=l&&h?[]:void 0,R=[],q=[],U=P?[]:void 0,H=[],V,W,ee,ie,Y;for(W=0;W{var{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:o}=e,u=jn({typed:t,equalScalar:n}),l=jy({typed:t,equalScalar:n}),a=Pr({typed:t,equalScalar:n}),s=tr({typed:t,matrix:r,concat:o});return t(Pk,s({elop:i,SS:l,DS:u,Ss:a}))});g();x();v();g();x();v();function qk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var 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 TA(e,t,function(n,i){return n&i})}function Sh(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function zk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var 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()?!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:TA(e,t,function(i,o){return i|o})}function TA(e,t,r){var n=e.constructor,i,o,u=+(e.s<0),l=+(t.s<0);if(u){i=ew(Sh(e));for(var a=0;a0;)r(f[--y],p[--b])===w&&(A=A.plus(S)),S=S.times(O);for(;b>0;)r(h,p[--b])===w&&(A=A.plus(S)),S=S.times(O);return n.config({precision:M}),w===0&&(A.s=-A.s),A}function ew(e){for(var t=e.d,r=t[0]+"",n=1;n0)if(++l>s)for(l-=s;l--;)a+="0";else l1&&((f[y+1]===null||f[y+1]===void 0)&&(f[y+1]=0),f[y+1]+=f[y]>>1,f[y]&=1)}return f.reverse()}function Uk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var 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)?Sh(t):t.eq(n)?Sh(e):!e.isFinite()||!t.isFinite()?!e.isFinite()&&!t.isFinite()?n:new r(e.isNegative()===t.isNegative()?1/0:-1/0):TA(e,t,function(i,o){return i^o})}function Hk(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:!e.isFinite()&&!t.isFinite()?new r(NaN):t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t))}function $k(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var 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())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}var Wk="bitAnd",ose=["typed","matrix","equalScalar","concat"],tw=K(Wk,ose,e=>{var{typed:t,matrix:r,equalScalar:n,concat:i}=e,o=jn({typed:t,equalScalar:n}),u=Lf({typed:t,equalScalar:n}),l=Pr({typed:t,equalScalar:n}),a=tr({typed:t,matrix:r,concat:i});return t(Wk,{"number, number":ZE,"BigNumber, BigNumber":qk,"bigint, bigint":(s,f)=>s&f},a({SS:u,DS:o,Ss:l}))});g();x();v();var Vk="bitNot",ase=["typed"],Gk=K(Vk,ase,e=>{var{typed:t}=e;return t(Vk,{number:XE,BigNumber:Sh,bigint:r=>~r,"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();x();v();var Yk="bitOr",sse=["typed","matrix","equalScalar","DenseMatrix","concat"],rw=K(Yk,sse,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=ho({typed:t}),l=Nh({typed:t,equalScalar:n}),a=Xo({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:r,concat:o});return t(Yk,{"number, number":KE,"BigNumber, BigNumber":zk,"bigint, bigint":(f,p)=>f|p},s({SS:l,DS:u,Ss:a}))});g();x();v();g();x();v();var use="matAlgo07xSSf",lse=["typed","DenseMatrix"],gi=K(use,lse,e=>{var{typed:t,DenseMatrix:r}=e;return function(o,u,l){var a=o._size,s=o._datatype||o._data===void 0?o._datatype:o.getDataType(),f=u._size,p=u._datatype||u._data===void 0?u._datatype:u.getDataType();if(a.length!==f.length)throw new Jt(a.length,f.length);if(a[0]!==f[0]||a[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+f+")");var h=a[0],y=a[1],b,w=0,A=l;typeof s=="string"&&s===p&&s!=="mixed"&&(b=s,w=t.convert(0,b),A=t.find(l,[b,b]));var S,O,M=[];for(S=0;S{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Kr({typed:t}),u=gi({typed:t,DenseMatrix:n}),l=Cr({typed:t,DenseMatrix:n}),a=tr({typed:t,matrix:r,concat:i});return t(Zk,{"number, number":JE,"BigNumber, BigNumber":Uk,"bigint, bigint":(s,f)=>s^f},a({SS:u,DS:o,Ss:l}))});g();x();v();var Kk="arg",cse=["typed"],Jk=K(Kk,cse,e=>{var{typed:t}=e;return t(Kk,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();x();v();var Qk="conj",pse=["typed"],jk=K(Qk,pse,e=>{var{typed:t}=e;return t(Qk,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();x();v();var e4="im",mse=["typed"],t4=K(e4,mse,e=>{var{typed:t}=e;return t(e4,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();x();v();var r4="re",hse=["typed"],n4=K(r4,hse,e=>{var{typed:t}=e;return t(r4,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();x();v();var i4="not",dse=["typed"],o4=K(i4,dse,e=>{var{typed:t}=e;return t(i4,{"null | undefined":()=>!0,number:nA,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},bigint:r=>!r,Unit:t.referToSelf(r=>n=>t.find(r,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(r=>n=>Ct(n,r))})});g();x();v();var a4="or",gse=["typed","matrix","equalScalar","DenseMatrix","concat"],nw=K(a4,gse,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=Bf({typed:t,equalScalar:n}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:r,concat:o});return t(a4,{"number, number":Gy,"Complex, Complex":function(p,h){return p.re!==0||p.im!==0||h.re!==0||h.im!==0},"BigNumber, BigNumber":function(p,h){return!p.isZero()&&!p.isNaN()||!h.isZero()&&!h.isNaN()},"bigint, bigint":Gy,"Unit, Unit":t.referToSelf(f=>(p,h)=>f(p.value||0,h.value||0))},s({SS:l,DS:u,Ss:a}))});g();x();v();var s4="xor",vse=["typed","matrix","DenseMatrix","concat"],u4=K(s4,vse,e=>{var{typed:t,matrix:r,DenseMatrix:n,concat:i}=e,o=Kr({typed:t}),u=gi({typed:t,DenseMatrix:n}),l=Cr({typed:t,DenseMatrix:n}),a=tr({typed:t,matrix:r,concat:i});return t(s4,{"number, number":Yy,"Complex, Complex":function(f,p){return(f.re!==0||f.im!==0)!=(p.re!==0||p.im!==0)},"bigint, bigint":Yy,"BigNumber, BigNumber":function(f,p){return(!f.isZero()&&!f.isNaN())!=(!p.isZero()&&!p.isNaN())},"Unit, Unit":t.referToSelf(s=>(f,p)=>s(f.value||0,p.value||0))},a({SS:u,DS:o,Ss:l}))});g();x();v();var l4="concat",xse=["typed","matrix","isInteger"],iw=K(l4,xse,e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(l4,{"...Array | Matrix | number | BigNumber":function(o){var u,l=o.length,a=-1,s,f=!1,p=[];for(u=0;u0&&a>s)throw new Mi(a,s+1)}else{var y=Lt(h).valueOf(),b=Wt(y);if(p[u]=y,s=a,a=b.length-1,u>0&&a!==s)throw new Jt(s+1,a+1)}}if(p.length===0)throw new SyntaxError("At least one matrix expected");for(var w=p.shift();p.length;)w=TE(w,p.shift(),a);return f?r(w):w},"...string":function(o){return o.join("")}})});g();x();v();var f4="column",yse=["typed","Index","matrix","range"],ow=K(f4,yse,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(f4,{"Matrix, number":o,"Array, number":function(l,a){return o(n(Lt(l)),a).valueOf()}});function o(u,l){if(u.size().length!==2)throw new Error("Only two dimensional matrix is supported");Lr(l,u.size()[1]);var a=i(0,u.size()[0]),s=new r(a,l),f=u.subset(s);return St(f)?f:n([[f]])}});g();x();v();var c4="count",wse=["typed","size","prod"],p4=K(c4,wse,e=>{var{typed:t,size:r,prod:n}=e;return t(c4,{string:function(o){return o.length},"Matrix | Array":function(o){return n(r(o))}})});g();x();v();var m4="cross",bse=["typed","matrix","subtract","multiply"],h4=K(m4,bse,e=>{var{typed:t,matrix:r,subtract:n,multiply:i}=e;return t(m4,{"Matrix, Matrix":function(l,a){return r(o(l.toArray(),a.toArray()))},"Matrix, Array":function(l,a){return r(o(l.toArray(),a))},"Array, Matrix":function(l,a){return r(o(l,a.toArray()))},"Array, Array":o});function o(u,l){var a=Math.max(Wt(u).length,Wt(l).length);u=gh(u),l=gh(l);var s=Wt(u),f=Wt(l);if(s.length!==1||f.length!==1||s[0]!==3||f[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+s.join(", ")+"], B = ["+f.join(", ")+"])");var p=[n(i(u[1],l[2]),i(u[2],l[1])),n(i(u[2],l[0]),i(u[0],l[2])),n(i(u[0],l[1]),i(u[1],l[0]))];return a>1?[p]:p}});g();x();v();var d4="diag",Dse=["typed","matrix","DenseMatrix","SparseMatrix"],g4=K(d4,Dse,e=>{var{typed:t,matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(d4,{Array:function(s){return o(s,0,Wt(s),null)},"Array, number":function(s,f){return o(s,f,Wt(s),null)},"Array, BigNumber":function(s,f){return o(s,f.toNumber(),Wt(s),null)},"Array, string":function(s,f){return o(s,0,Wt(s),f)},"Array, number, string":function(s,f,p){return o(s,f,Wt(s),p)},"Array, BigNumber, string":function(s,f,p){return o(s,f.toNumber(),Wt(s),p)},Matrix:function(s){return o(s,0,s.size(),s.storage())},"Matrix, number":function(s,f){return o(s,f,s.size(),s.storage())},"Matrix, BigNumber":function(s,f){return o(s,f.toNumber(),s.size(),s.storage())},"Matrix, string":function(s,f){return o(s,0,s.size(),f)},"Matrix, number, string":function(s,f,p){return o(s,f,s.size(),p)},"Matrix, BigNumber, string":function(s,f,p){return o(s,f.toNumber(),s.size(),p)}});function o(a,s,f,p){if(!Nt(s))throw new TypeError("Second parameter in function diag must be an integer");var h=s>0?s:0,y=s<0?-s:0;switch(f.length){case 1:return u(a,s,p,f[0],y,h);case 2:return l(a,s,p,f,y,h)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function u(a,s,f,p,h,y){var b=[p+h,p+y];if(f&&f!=="sparse"&&f!=="dense")throw new TypeError("Unknown matrix type ".concat(f,'"'));var w=f==="sparse"?i.diagonal(b,a,s):n.diagonal(b,a,s);return f!==null?w:w.valueOf()}function l(a,s,f,p,h,y){if(St(a)){var b=a.diagonal(s);return f!==null?f!==b.storage()?r(b,f):b:b.valueOf()}for(var w=Math.min(p[0]-h,p[1]-y),A=[],S=0;S=2&&w.push("index: ".concat(gr(r))),y.length>=3&&w.push("array: ".concat(gr(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(w.join(", "),") at index ").concat(JSON.stringify(r)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(A.message))}}}var Nse="filter",Sse=["typed"],x4=K(Nse,Sse,e=>{var{typed:t}=e;return t("filter",{"Array, function":v4,"Matrix, function":function(n,i){return n.create(v4(n.toArray(),i))},"Array, RegExp":vh,"Matrix, RegExp":function(n,i){return n.create(vh(n.toArray(),i))}})});function v4(e,t){return Uy(e,function(r,n,i){return Ya(t,r,[n],i,"filter")})}g();x();v();var y4="flatten",Ese=["typed","matrix"],w4=K(y4,Ese,e=>{var{typed:t,matrix:r}=e;return t(y4,{Array:function(i){return nr(i)},Matrix:function(i){var o=nr(i.toArray());return r(o)}})});g();x();v();var b4="forEach",Ase=["typed"],D4=K(b4,Ase,e=>{var{typed:t}=e;return t(b4,{"Array, function":Cse,"Matrix, function":function(n,i){n.forEach(i)}})});function Cse(e,t){var r=function n(i,o){if(Array.isArray(i))Ff(i,function(u,l){n(u,o.concat(l))});else return Ya(t,i,o,e,"forEach")};r(e,[])}g();x();v();var N4="getMatrixDataType",Mse=["typed"],S4=K(N4,Mse,e=>{var{typed:t}=e;return t(N4,{Array:function(n){return _f(n,gr)},Matrix:function(n){return n.getDataType()}})});g();x();v();var E4="identity",Tse=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],A4=K(E4,Tse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:o,SparseMatrix:u}=e;return t(E4,{"":function(){return r.matrix==="Matrix"?n([]):[]},string:function(f){return n(f)},"number | BigNumber":function(f){return a(f,f,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(f,p){return a(f,f,p)},"number | BigNumber, number | BigNumber":function(f,p){return a(f,p,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(f,p,h){return a(f,p,h)},Array:function(f){return l(f)},"Array, string":function(f,p){return l(f,p)},Matrix:function(f){return l(f.valueOf(),f.storage())},"Matrix, string":function(f,p){return l(f.valueOf(),p)}});function l(s,f){switch(s.length){case 0:return f?n(f):[];case 1:return a(s[0],s[0],f);case 2:return a(s[0],s[1],f);default:throw new Error("Vector containing two values expected")}}function a(s,f,p){var h=kt(s)||kt(f)?i:null;if(kt(s)&&(s=s.toNumber()),kt(f)&&(f=f.toNumber()),!Nt(s)||s<1)throw new Error("Parameters in function identity must be positive integers");if(!Nt(f)||f<1)throw new Error("Parameters in function identity must be positive integers");var y=h?new i(1):1,b=h?new h(0):0,w=[s,f];if(p){if(p==="sparse")return u.diagonal(w,y,0,b);if(p==="dense")return o.diagonal(w,y,0,b);throw new TypeError('Unknown matrix type "'.concat(p,'"'))}for(var A=Ls([],w,b),S=s{var{typed:t,matrix:r,multiplyScalar:n}=e;return t(C4,{"Matrix, Matrix":function(u,l){return r(i(u.toArray(),l.toArray()))},"Matrix, Array":function(u,l){return r(i(u.toArray(),l))},"Array, Matrix":function(u,l){return r(i(u,l.toArray()))},"Array, Array":i});function i(o,u){if(Wt(o).length===1&&(o=[o]),Wt(u).length===1&&(u=[u]),Wt(o).length>2||Wt(u).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(o.length)+", y = "+JSON.stringify(u.length)+")");var l=[],a=[];return o.map(function(s){return u.map(function(f){return a=[],l.push(a),s.map(function(p){return f.map(function(h){return a.push(n(p,h))})})})})&&l}});g();x();v();var T4="map",Ise=["typed"],O4=K(T4,Ise,e=>{var{typed:t}=e;return t(T4,{"Array, function":Fse,"Matrix, function":function(n,i){return n.map(i)}})});function Fse(e,t){var r=function n(i,o){return Array.isArray(i)?i.map(function(u,l){return n(u,o.concat(l))}):Ya(t,i,o,e,"map")};return r(e,[])}g();x();v();var I4="diff",_se=["typed","matrix","subtract","number"],aw=K(I4,_se,e=>{var{typed:t,matrix:r,subtract:n,number:i}=e;return t(I4,{"Array | Matrix":function(f){return St(f)?r(u(f.toArray())):u(f)},"Array | Matrix, number":function(f,p){if(!Nt(p))throw new RangeError("Dimension must be a whole number");return St(f)?r(o(f.toArray(),p)):o(f,p)},"Array, BigNumber":t.referTo("Array,number",s=>(f,p)=>s(f,i(p))),"Matrix, BigNumber":t.referTo("Matrix,number",s=>(f,p)=>s(f,i(p)))});function o(s,f){if(St(s)&&(s=s.toArray()),!Array.isArray(s))throw RangeError("Array/Matrix does not have that many dimensions");if(f>0){var p=[];return s.forEach(h=>{p.push(o(h,f-1))}),p}else{if(f===0)return u(s);throw RangeError("Cannot have negative dimension")}}function u(s){for(var f=[],p=s.length,h=1;h{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t("ones",{"":function(){return r.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(s){var f=s[s.length-1];if(typeof f=="string"){var p=s.pop();return o(s,p)}else return r.matrix==="Array"?o(s):o(s,"default")},Array:o,Matrix:function(s){var f=s.storage();return o(s.valueOf(),f)},"Array | Matrix, string":function(s,f){return o(s.valueOf(),f)}});function o(a,s){var f=u(a),p=f?new i(1):1;if(l(a),s){var h=n(s);return a.length>0?h.resize(a,p):h}else{var y=[];return a.length>0?Ls(y,a,p):y}}function u(a){var s=!1;return a.forEach(function(f,p,h){kt(f)&&(s=!0,h[p]=f.toNumber())}),s}function l(a){a.forEach(function(s){if(typeof s!="number"||!Nt(s)||s<0)throw new Error("Parameters in function ones must be positive integers")})}});g();x();v();g();x();v();function Eh(){throw new Error('No "bignumber" implementation available')}function sw(){throw new Error('No "fraction" implementation available')}function uw(){throw new Error('No "matrix" implementation available')}var _4="range",Lse=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],lw=K(_4,Lse,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:u,larger:l,largerEq:a,add:s,isPositive:f}=e;return t(_4,{string:h,"string, boolean":h,"number, number":function(A,S){return p(y(A,S,1,!1))},"number, number, number":function(A,S,O){return p(y(A,S,O,!1))},"number, number, boolean":function(A,S,O){return p(y(A,S,1,O))},"number, number, number, boolean":function(A,S,O,M){return p(y(A,S,O,M))},"BigNumber, BigNumber":function(A,S){var O=A.constructor;return p(y(A,S,new O(1),!1))},"BigNumber, BigNumber, BigNumber":function(A,S,O){return p(y(A,S,O,!1))},"BigNumber, BigNumber, boolean":function(A,S,O){var M=A.constructor;return p(y(A,S,new M(1),O))},"BigNumber, BigNumber, BigNumber, boolean":function(A,S,O,M){return p(y(A,S,O,M))},"Unit, Unit, Unit":function(A,S,O){return p(y(A,S,O,!1))},"Unit, Unit, Unit, boolean":function(A,S,O,M){return p(y(A,S,O,M))}});function p(w){return r.matrix==="Matrix"?n?n(w):uw():w}function h(w,A){var S=b(w);if(!S)throw new SyntaxError('String "'+w+'" is no valid range');return r.number==="BigNumber"?(i===void 0&&Eh(),p(y(i(S.start),i(S.end),i(S.step)),A)):p(y(S.start,S.end,S.step,A))}function y(w,A,S,O){for(var M=[],I=f(S)?O?u:o:O?a:l,F=w;I(F,A);)M.push(F),F=s(F,S);return M}function b(w){var A=w.split(":"),S=A.map(function(M){return Number(M)}),O=S.some(function(M){return isNaN(M)});if(O)return null;switch(S.length){case 2:return{start:S[0],end:S[1],step:1};case 3:return{start:S[0],end:S[2],step:S[1]};default:return null}}});g();x();v();var k4="reshape",Pse=["typed","isInteger","matrix"],B4=K(k4,Pse,e=>{var{typed:t,isInteger:r}=e;return t(k4,{"Matrix, Array":function(i,o){return i.reshape(o,!0)},"Array, Array":function(i,o){return o.forEach(function(u){if(!r(u))throw new TypeError("Invalid size for dimension: "+u)}),Sv(i,o)}})});g();x();v();var Rse="resize",qse=["config","matrix"],L4=K(Rse,qse,e=>{var{config:t,matrix:r}=e;return function(o,u,l){if(arguments.length!==2&&arguments.length!==3)throw new ya("resize",arguments.length,2,3);if(St(u)&&(u=u.valueOf()),kt(u[0])&&(u=u.map(function(f){return kt(f)?f.toNumber():f})),St(o))return o.resize(u,l,!0);if(typeof o=="string")return n(o,u,l);var a=Array.isArray(o)?!1:t.matrix!=="Array";if(u.length===0){for(;Array.isArray(o);)o=o[0];return Lt(o)}else{Array.isArray(o)||(o=[o]),o=Lt(o);var s=Ls(o,u,l);return a?r(s):s}};function n(i,o,u){if(u!==void 0){if(typeof u!="string"||u.length!==1)throw new TypeError("Single character expected as defaultValue")}else u=" ";if(o.length!==1)throw new Jt(o.length,1);var l=o[0];if(typeof l!="number"||!Nt(l))throw new TypeError("Invalid size, must contain positive integers (size: "+Kt(o)+")");if(i.length>l)return i.substring(0,l);if(i.length{var{typed:t,multiply:r,rotationMatrix:n}=e;return t(P4,{"Array , number | BigNumber | Complex | Unit":function(u,l){i(u,2);var a=r(n(l),u);return a.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(u,l){return i(u,2),r(n(l),u)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(u,l,a){i(u,3);var s=r(n(l,a),u);return s},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(u,l,a){return i(u,3),r(n(l,a),u)}});function i(o,u){var l=Array.isArray(o)?Wt(o):o.size();if(l.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(u));if(l.length===2&&l[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(u));if(l[0]!==u)throw new RangeError("Vector must be of dimensions 1x".concat(u))}});g();x();v();var q4="rotationMatrix",Use=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],z4=K(q4,Use,e=>{var{typed:t,config:r,multiplyScalar:n,addScalar:i,unaryMinus:o,norm:u,BigNumber:l,matrix:a,DenseMatrix:s,SparseMatrix:f,cos:p,sin:h}=e;return t(q4,{"":function(){return r.matrix==="Matrix"?a([]):[]},string:function(M){return a(M)},"number | BigNumber | Complex | Unit":function(M){return y(M,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(M,I){return y(M,I)},"number | BigNumber | Complex | Unit, Array":function(M,I){var F=a(I);return b(F),S(M,F,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(M,I){b(I);var F=I.storage()||(r.matrix==="Matrix"?"dense":void 0);return S(M,I,F)},"number | BigNumber | Complex | Unit, Array, string":function(M,I,F){var C=a(I);return b(C),S(M,C,F)},"number | BigNumber | Complex | Unit, Matrix, string":function(M,I,F){return b(I),S(M,I,F)}});function y(O,M){var I=kt(O),F=I?new l(-1):-1,C=p(O),P=h(O),R=[[C,n(F,P)],[P,C]];return A(R,M)}function b(O){var M=O.size();if(M.length<1||M[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function w(O){return O.reduce((M,I)=>n(M,I))}function A(O,M){if(M){if(M==="sparse")return new f(O);if(M==="dense")return new s(O);throw new TypeError('Unknown matrix type "'.concat(M,'"'))}return O}function S(O,M,I){var F=u(M);if(F===0)throw new RangeError("Rotation around zero vector");var C=kt(O)?l:null,P=C?new C(1):1,R=C?new C(-1):-1,q=C?new C(M.get([0])/F):M.get([0])/F,U=C?new C(M.get([1])/F):M.get([1])/F,H=C?new C(M.get([2])/F):M.get([2])/F,V=p(O),W=i(P,o(V)),ee=h(O),ie=i(V,w([q,q,W])),Y=i(w([q,U,W]),w([R,H,ee])),Z=i(w([q,H,W]),w([U,ee])),le=i(w([q,U,W]),w([H,ee])),re=i(V,w([U,U,W])),he=i(w([U,H,W]),w([R,q,ee])),De=i(w([q,H,W]),w([R,U,ee])),we=i(w([U,H,W]),w([q,ee])),ce=i(V,w([H,H,W])),Se=[[ie,Y,Z],[le,re,he],[De,we,ce]];return A(Se,I)}});g();x();v();var U4="row",Hse=["typed","Index","matrix","range"],fw=K(U4,Hse,e=>{var{typed:t,Index:r,matrix:n,range:i}=e;return t(U4,{"Matrix, number":o,"Array, number":function(l,a){return o(n(Lt(l)),a).valueOf()}});function o(u,l){if(u.size().length!==2)throw new Error("Only two dimensional matrix is supported");Lr(l,u.size()[0]);var a=i(0,u.size()[1]),s=new r(l,a),f=u.subset(s);return St(f)?f:n([[f]])}});g();x();v();var H4="size",$se=["typed","config","?matrix"],$4=K(H4,$se,e=>{var{typed:t,config:r,matrix:n}=e;return t(H4,{Matrix:function(o){return o.create(o.size())},Array:Wt,string:function(o){return r.matrix==="Array"?[o.length]:n([o.length])},"number | Complex | BigNumber | Unit | boolean | null":function(o){return r.matrix==="Array"?[]:n?n([]):uw()}})});g();x();v();var W4="squeeze",Wse=["typed","matrix"],V4=K(W4,Wse,e=>{var{typed:t,matrix:r}=e;return t(W4,{Array:function(i){return gh(Lt(i))},Matrix:function(i){var o=gh(i.toArray());return Array.isArray(o)?r(o):o},any:function(i){return Lt(i)}})});g();x();v();var G4="subset",Vse=["typed","matrix","zeros","add"],cw=K(G4,Vse,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t(G4,{"Matrix, Index":function(l,a){return dp(a)?r():(Nv(l,a),l.subset(a))},"Array, Index":t.referTo("Matrix, Index",function(u){return function(l,a){var s=u(r(l),a);return a.isScalar()?s:s.valueOf()}}),"Object, Index":Yse,"string, Index":Gse,"Matrix, Index, any, any":function(l,a,s,f){return dp(a)?l:(Nv(l,a),l.clone().subset(a,o(s,a),f))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",function(u){return function(l,a,s,f){var p=u(r(l),a,s,f);return p.isMatrix?p.valueOf():p}}),"Array, Index, any":t.referTo("Matrix, Index, any, any",function(u){return function(l,a,s){return u(r(l),a,s,void 0).valueOf()}}),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",function(u){return function(l,a,s){return u(l,a,s,void 0)}}),"string, Index, string":Y4,"string, Index, string, string":Y4,"Object, Index, any":Zse});function o(u,l){if(typeof u=="string")throw new Error("can't boradcast a string");if(l._isScalar)return u;var a=l.size();if(a.every(s=>s>0))try{return i(u,n(a))}catch{return u}else return u}});function Gse(e,t){if(!Du(t))throw new TypeError("Index expected");if(dp(t))return"";if(Nv(Array.from(e),t),t.size().length!==1)throw new Jt(t.size().length,1);var r=e.length;Lr(t.min()[0],r),Lr(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach(function(o){i+=e.charAt(o)}),i}function Y4(e,t,r,n){if(!t||t.isIndex!==!0)throw new TypeError("Index expected");if(dp(t))return e;if(Nv(Array.from(e),t),t.size().length!==1)throw new Jt(t.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0),o=i.size()[0];if(o!==r.length)throw new Jt(i.size()[0],r.length);var u=e.length;Lr(t.min()[0]),Lr(t.max()[0]);for(var l=[],a=0;au)for(var s=u-1,f=l.length;s{var{typed:t,matrix:r}=e;return t(Z4,{Array:u=>n(r(u)).valueOf(),Matrix:n,any:Lt});function n(u){var l=u.size(),a;switch(l.length){case 1:a=u.clone();break;case 2:{var s=l[0],f=l[1];if(f===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Kt(l)+")");switch(u.storage()){case"dense":a=i(u,s,f);break;case"sparse":a=o(u,s,f);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Kt(l)+")")}return a}function i(u,l,a){for(var s=u._data,f=[],p,h=0;h{var{typed:t,transpose:r,conj:n}=e;return t(K4,{any:function(o){return n(r(o))}})});g();x();v();var Q4="zeros",Jse=["typed","config","matrix","BigNumber"],j4=K(Q4,Jse,e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(Q4,{"":function(){return r.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(s){var f=s[s.length-1];if(typeof f=="string"){var p=s.pop();return o(s,p)}else return r.matrix==="Array"?o(s):o(s,"default")},Array:o,Matrix:function(s){var f=s.storage();return o(s.valueOf(),f)},"Array | Matrix, string":function(s,f){return o(s.valueOf(),f)}});function o(a,s){var f=u(a),p=f?new i(0):0;if(l(a),s){var h=n(s);return a.length>0?h.resize(a,p):h}else{var y=[];return a.length>0?Ls(y,a,p):y}}function u(a){var s=!1;return a.forEach(function(f,p,h){kt(f)&&(s=!0,h[p]=f.toNumber())}),s}function l(a){a.forEach(function(s){if(typeof s!="number"||!Nt(s)||s<0)throw new Error("Parameters in function zeros must be positive integers")})}});g();x();v();var e5="fft",Qse=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],t5=K(e5,Qse,e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,divideScalar:o,exp:u,tau:l,i:a,dotDivide:s,conj:f,pow:p,ceil:h,log2:y}=e;return t(e5,{Array:b,Matrix:function(M){return M.create(b(M.toArray()))}});function b(O){var M=Wt(O);return M.length===1?S(O,M[0]):w(O.map(I=>b(I,M.slice(1))),0)}function w(O,M){var I=Wt(O);if(M!==0)return new Array(I[0]).fill(0).map((C,P)=>w(O[P],M-1));if(I.length===1)return S(O);function F(C){var P=Wt(C);return new Array(P[1]).fill(0).map((R,q)=>new Array(P[0]).fill(0).map((U,H)=>C[H][q]))}return F(w(F(O),1))}function A(O){for(var M=O.length,I=u(o(i(-1,i(a,l)),M)),F=[],C=1-M;Ci(O[Z],F[M-1+Z])),...new Array(P-M).fill(0)],q=[...new Array(M+M-1).fill(0).map((Y,Z)=>o(1,F[Z])),...new Array(P-(M+M-1)).fill(0)],U=S(R),H=S(q),V=new Array(P).fill(0).map((Y,Z)=>i(U[Z],H[Z])),W=s(f(b(f(V))),P),ee=[],ie=M-1;ieq%2===0),M/2),...S(O.filter((R,q)=>q%2===1),M/2)],F=0;F{var{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(r5,{"Array | Matrix":function(u){var l=St(u)?u.size():Wt(u);return n(i(r(i(u))),l.reduce((a,s)=>a*s,1))}})});g();x();v();g();x();v();g();x();v();g();x();v();function xp(e){"@babel/helpers - typeof";return xp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xp(e)}g();x();v();function i5(e,t){if(xp(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function o5(e){var t=i5(e,"string");return xp(t)=="symbol"?t:t+""}function Fr(e,t,r){return(t=o5(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function eue(e){for(var t=1;t{var{typed:t,add:r,subtract:n,multiply:i,divide:o,max:u,map:l,abs:a,isPositive:s,isNegative:f,larger:p,smaller:h,matrix:y,bignumber:b,unaryMinus:w}=e;function A(R){return function(q,U,H,V){var W=!(U.length===2&&(U.every(C)||U.every(ui)));if(W)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var ee=U[0],ie=U[1],Y=p(ie,ee),Z=V.firstStep;if(Z!==void 0&&!s(Z))throw new Error('"firstStep" must be positive');var le=V.maxStep;if(le!==void 0&&!s(le))throw new Error('"maxStep" must be positive');var re=V.minStep;if(re&&f(re))throw new Error('"minStep" must be positive or zero');var he=[ee,ie,Z,re,le].filter(Qe=>Qe!==void 0);if(!(he.every(C)||he.every(ui)))throw new Error('Inconsistent type of "t" dependant variables');for(var De=1,we=V.tol?V.tol:1e-4,ce=V.minDelta?V.minDelta:.2,Se=V.maxDelta?V.maxDelta:5,Pe=V.maxIter?V.maxIter:1e4,Ce=[ee,ie,...H,le,re].some(kt),[Oe,He,Ee,ze]=Ce?[b(R.a),b(R.c),b(R.b),b(R.bp)]:[R.a,R.c,R.b,R.bp],We=Z?Y?Z:w(Z):o(n(ie,ee),De),Le=[ee],lt=[H],ct=n(Ee,ze),de=0,be=0,Ue=I(Y),ge=F(Y);Ue(Le[de],ie);){var Re=[];We=ge(Le[de],ie,We),Re.push(q(Le[de],lt[de]));for(var Be=1;Beui(Qe)?Qe.value:Qe)));Ke1/4&&(Le.push(r(Le[de],We)),lt.push(r(lt[de],i(We,Ee,Re))),de++);var ot=.84*(we/Ke)**(1/5);if(h(ot,ce)?ot=ce:p(ot,Se)&&(ot=Se),ot=Ce?b(ot):ot,We=i(We,ot),le&&p(a(We),le)?We=Y?le:w(le):re&&h(a(We),re)&&(We=Y?re:w(re)),be++,be>Pe)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Le,y:lt}}}function S(R,q,U,H){var V=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],W=[null,1/2,3/4,1],ee=[2/9,1/3,4/9,0],ie=[7/24,1/4,1/3,1/8],Y={a:V,c:W,b:ee,bp:ie};return A(Y)(R,q,U,H)}function O(R,q,U,H){var V=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],W=[null,1/5,3/10,4/5,8/9,1,1],ee=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],ie=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],Y={a:V,c:W,b:ee,bp:ie};return A(Y)(R,q,U,H)}function M(R,q,U,H){var V=H.method?H.method:"RK45",W={RK23:S,RK45:O};if(V.toUpperCase()in W){var ee=eue({},H);return delete ee.method,W[V.toUpperCase()](R,q,U,ee)}else{var ie=Object.keys(W).map(Z=>'"'.concat(Z,'"')),Y="".concat(ie.slice(0,-1).join(", ")," and ").concat(ie.slice(-1));throw new Error('Unavailable method "'.concat(V,'". Available methods are ').concat(Y))}}function I(R){return R?h:p}function F(R){var q=R?p:h;return function(U,H,V){var W=r(U,V);return q(W,H)?n(H,U):V}}function C(R){return kt(R)||$t(R)}function P(R,q,U,H){var V=M(R,q.toArray(),U.toArray(),H);return{t:y(V.t),y:y(V.y)}}return t("solveODE",{"function, Array, Array, Object":M,"function, Matrix, Matrix, Object":P,"function, Array, Array":(R,q,U)=>M(R,q,U,{}),"function, Matrix, Matrix":(R,q,U)=>P(R,q,U,{}),"function, Array, number | BigNumber | Unit":(R,q,U)=>{var H=M(R,q,[U],{});return{t:H.t,y:H.y.map(V=>V[0])}},"function, Matrix, number | BigNumber | Unit":(R,q,U)=>{var H=M(R,q.toArray(),[U],{});return{t:y(H.t),y:y(H.y.map(V=>V[0]))}},"function, Array, number | BigNumber | Unit, Object":(R,q,U,H)=>{var V=M(R,q,[U],H);return{t:V.t,y:V.y.map(W=>W[0])}},"function, Matrix, number | BigNumber | Unit, Object":(R,q,U,H)=>{var V=M(R,q.toArray(),[U],H);return{t:y(V.t),y:y(V.y.map(W=>W[0]))}}})});g();x();v();var nue="erf",iue=["typed"],u5=K(nue,iue,e=>{var{typed:t}=e;return t("name",{number:function(u){var l=Math.abs(u);return l>=sue?Wa(u):l<=oue?Wa(u)*r(l):l<=4?Wa(u)*(1-n(l)):Wa(u)*(1-i(l))},"Array | Matrix":t.referToSelf(o=>u=>Ct(u,o))});function r(o){var u=o*o,l=Dl[0][4]*u,a=u,s;for(s=0;s<3;s+=1)l=(l+Dl[0][s])*u,a=(a+Ah[0][s])*u;return o*(l+Dl[0][3])/(a+Ah[0][3])}function n(o){var u=Dl[1][8]*o,l=o,a;for(a=0;a<7;a+=1)u=(u+Dl[1][a])*o,l=(l+Ah[1][a])*o;var s=(u+Dl[1][7])/(l+Ah[1][7]),f=parseInt(o*16)/16,p=(o-f)*(o+f);return Math.exp(-f*f)*Math.exp(-p)*s}function i(o){var u=1/(o*o),l=Dl[2][5]*u,a=u,s;for(s=0;s<4;s+=1)l=(l+Dl[2][s])*u,a=(a+Ah[2][s])*u;var f=u*(l+Dl[2][4])/(a+Ah[2][4]);f=(aue-f)/o,u=parseInt(o*16)/16;var p=(o-u)*(o+u);return Math.exp(-u*u)*Math.exp(-p)*f}}),oue=.46875,aue=.5641895835477563,Dl=[[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]],Ah=[[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]],sue=Math.pow(2,53);g();x();v();var l5="zeta",uue=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],f5=K(l5,uue,e=>{var{typed:t,config:r,multiply:n,pow:i,divide:o,factorial:u,equal:l,smallerEq:a,isNegative:s,gamma:f,sin:p,subtract:h,add:y,Complex:b,BigNumber:w,pi:A}=e;return t(l5,{number:C=>S(C,P=>P,()=>20),BigNumber:C=>S(C,P=>new w(P),()=>Math.abs(Math.log10(r.relTol))),Complex:O});function S(C,P,R){return l(C,0)?P(-.5):l(C,1)?P(NaN):isFinite(C)?M(C,P,R,q=>q):s(C)?P(NaN):P(1)}function O(C){return C.re===0&&C.im===0?new b(-.5):C.re===1?new b(NaN,NaN):C.re===1/0&&C.im===0?new b(1):C.im===1/0||C.re===-1/0?new b(NaN,NaN):M(C,P=>P,P=>Math.round(1.3*15+.9*Math.abs(P.im)),P=>P.re)}function M(C,P,R,q){var U=R(C);if(q(C)>-(U-1)/2)return F(C,P(U),P);var H=n(i(2,C),i(P(A),h(C,1)));return H=n(H,p(n(o(P(A),2),C))),H=n(H,f(h(1,C))),n(H,M(h(1,C),P,R,q))}function I(C,P){for(var R=C,q=C;a(q,P);q=y(q,1)){var U=o(n(u(y(P,h(q,1))),i(4,q)),n(u(h(P,q)),u(n(2,q))));R=y(R,U)}return n(P,R)}function F(C,P,R){for(var q=o(1,n(I(R(0),P),h(1,i(2,h(1,C))))),U=R(0),H=R(1);a(H,P);H=y(H,1))U=y(U,o(n((-1)**(H-1),I(H,P)),i(H,C)));return n(q,U)}});g();x();v();var c5="mode",lue=["typed","isNaN","isNumeric"],p5=K(c5,lue,e=>{var{typed:t,isNaN:r,isNumeric:n}=e;return t(c5,{"Array | Matrix":i,"...":function(u){return i(u)}});function i(o){o=nr(o.valueOf());var u=o.length;if(u===0)throw new Error("Cannot calculate mode of an empty array");for(var l={},a=[],s=0,f=0;fs&&(s=l[p],a=[p])}return a}});g();x();v();g();x();v();function Tn(e,t,r){var n;return String(e).includes("Unexpected type")?(n=arguments.length>2?" (type: "+gr(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):String(e).includes("complex numbers")?(n=arguments.length>2?" (type: "+gr(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var m5="prod",fue=["typed","config","multiplyScalar","numeric"],h5=K(m5,fue,e=>{var{typed:t,config:r,multiplyScalar:n,numeric:i}=e;return t(m5,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(l,a){throw new Error("prod(A, dim) is not yet supported")},"...":function(l){return o(l)}});function o(u){var l;if(mo(u,function(a){try{l=l===void 0?a:n(l,a)}catch(s){throw Tn(s,"prod",a)}}),typeof l=="string"&&(l=i(l,co(l,r))),l===void 0)throw new Error("Cannot calculate prod of an empty array");return l}});g();x();v();var d5="format",cue=["typed"],g5=K(d5,cue,e=>{var{typed:t}=e;return t(d5,{any:Kt,"any, Object | function | number | BigNumber":Kt})});g();x();v();var v5="bin",pue=["typed","format"],x5=K(v5,pue,e=>{var{typed:t,format:r}=e;return t(v5,{"number | BigNumber":function(i){return r(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"bin",wordSize:o})}})});g();x();v();var y5="oct",mue=["typed","format"],w5=K(y5,mue,e=>{var{typed:t,format:r}=e;return t(y5,{"number | BigNumber":function(i){return r(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"oct",wordSize:o})}})});g();x();v();var b5="hex",hue=["typed","format"],D5=K(b5,hue,e=>{var{typed:t,format:r}=e;return t(b5,{"number | BigNumber":function(i){return r(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,o){return r(i,{notation:"hex",wordSize:o})}})});g();x();v();g();x();v();var pw=/\$([\w.]+)/g;var N5="print",due=["typed"],mw=K(N5,due,e=>{var{typed:t}=e;return t(N5,{"string, Object | Array":S5,"string, Object | Array, number | Object":S5})});function S5(e,t,r){return e.replace(pw,function(n,i){var o=i.split("."),u=t[o.shift()];for(u!==void 0&&u.isMatrix&&(u=u.toArray());o.length&&u!==void 0;){var l=o.shift();u=l?u[l]:u+"."}return u!==void 0?gn(u)?u:Kt(u,r):n})}g();x();v();var E5="to",gue=["typed","matrix","concat"],A5=K(E5,gue,e=>{var{typed:t,matrix:r,concat:n}=e,i=tr({typed:t,matrix:r,concat:n});return t(E5,{"Unit, Unit | string":(o,u)=>o.to(u)},i({Ds:!0}))});g();x();v();var C5="isPrime",vue=["typed"],M5=K(C5,vue,e=>{var{typed:t}=e;return t(C5,{number:function(n){if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0},bigint:function(n){if(n<=3n)return n>1n;if(n%2n===0n||n%3n===0n)return!1;for(var i=5n;i*i<=n;i+=6n)if(n%i===0n||n%(i+2n)===0n)return!1;return!0},BigNumber:function(n){if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var i=n.toNumber(),o=5;o*o<=i;o+=6)if(i%o===0||i%(o+2)===0)return!1;return!0}function u(O,M,I){for(var F=1;!M.eq(0);)M.mod(2).eq(0)?(M=M.div(2),O=O.mul(O).mod(I)):(M=M.sub(1),F=O.mul(F).mod(I));return F}var l=n.constructor.clone({precision:n.toFixed(0).length*2});n=new l(n);for(var a=0,s=n.sub(1);s.mod(2).eq(0);)s=s.div(2),a+=1;var f=null;if(n.lt("3317044064679887385961981"))f=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(O=>On=>Ct(n,r))})});g();x();v();var xue="numeric",yue=["number","?bignumber","?fraction"],T5=K(xue,yue,e=>{var{number:t,bignumber:r,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:u=>t(u),BigNumber:r?u=>r(u):Eh,bigint:u=>BigInt(u),Fraction:n?u=>n(u):sw};return function(l){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",s=arguments.length>2?arguments[2]:void 0;if(s!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var f=gr(l);if(!(f in i))throw new TypeError("Cannot convert "+l+' of type "'+f+'"; valid input types are '+Object.keys(i).join(", "));if(!(a in o))throw new TypeError("Cannot convert "+l+' to type "'+a+'"; valid output types are '+Object.keys(o).join(", "));return a===f?l:o[a](l)}});g();x();v();var O5="divideScalar",wue=["typed","numeric"],I5=K(O5,wue,e=>{var{typed:t,numeric:r}=e;return t(O5,{"number, number":function(i,o){return i/o},"Complex, Complex":function(i,o){return i.div(o)},"BigNumber, BigNumber":function(i,o){return i.div(o)},"bigint, bigint":function(i,o){return i/o},"Fraction, Fraction":function(i,o){return i.div(o)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})});g();x();v();var F5="pow",bue=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],_5=K(F5,bue,e=>{var{typed:t,config:r,identity:n,multiply:i,matrix:o,inv:u,number:l,fraction:a,Complex:s}=e;return t(F5,{"number, number":f,"Complex, Complex":function(b,w){return b.pow(w)},"BigNumber, BigNumber":function(b,w){return w.isInteger()||b>=0||r.predictable?b.pow(w):new s(b.toNumber(),0).pow(w.toNumber(),0)},"bigint, bigint":(y,b)=>y**b,"Fraction, Fraction":function(b,w){var A=b.pow(w);if(A!=null)return A;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return f(b.valueOf(),w.valueOf())},"Array, number":p,"Array, BigNumber":function(b,w){return p(b,w.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(b,w){return h(b,w.toNumber())},"Unit, number | BigNumber":function(b,w){return b.pow(w)}});function f(y,b){if(r.predictable&&!Nt(b)&&y<0)try{var w=a(b),A=l(w);if((b===A||Math.abs((b-A)/b)<1e-14)&&w.d%2===1)return(w.n%2===0?1:-1)*Math.pow(-y,b)}catch{}return r.predictable&&(y<-1&&b===1/0||y>-1&&y<0&&b===-1/0)?NaN:Nt(b)||y>=0||r.predictable?YE(y,b):y*y<1&&b===1/0||y*y>1&&b===-1/0?0:new s(y,0).pow(b,0)}function p(y,b){if(!Nt(b))throw new TypeError("For A^b, b must be an integer (value is "+b+")");var w=Wt(y);if(w.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+w.length+" dimensions)");if(w[0]!==w[1])throw new Error("For A^b, A must be square (size is "+w[0]+"x"+w[1]+")");if(b<0)try{return p(u(y),-b)}catch(O){throw O.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+b+")"):O}for(var A=n(w[0]).valueOf(),S=y;b>=1;)(b&1)===1&&(A=i(S,A)),b>>=1,S=i(S,S);return A}function h(y,b){return o(p(y.valueOf(),b))}});g();x();v();var Ch="Number of decimals in function round must be an integer",k5="round",Due=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],B5=K(k5,Due,e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:o,BigNumber:u,DenseMatrix:l}=e,a=Pr({typed:t,equalScalar:i}),s=Cr({typed:t,DenseMatrix:l}),f=Qn({typed:t});function p(h){return Math.abs(ch(h).exponent)}return t(k5,{number:function(y){var b=wh(y,p(r.relTol)),w=en(y,b,r.relTol,r.absTol)?b:y;return wh(w)},"number, number":function(y,b){var w=p(r.relTol);if(b>=w)return wh(y,b);var A=wh(y,w),S=en(y,A,r.relTol,r.absTol)?A:y;return wh(S,b)},"number, BigNumber":function(y,b){if(!b.isInteger())throw new TypeError(Ch);return new u(y).toDecimalPlaces(b.toNumber())},Complex:function(y){return y.round()},"Complex, number":function(y,b){if(b%1)throw new TypeError(Ch);return y.round(b)},"Complex, BigNumber":function(y,b){if(!b.isInteger())throw new TypeError(Ch);var w=b.toNumber();return y.round(w)},BigNumber:function(y){var b=new u(y).toDecimalPlaces(p(r.relTol)),w=yn(y,b,r.relTol,r.absTol)?b:y;return w.toDecimalPlaces(0)},"BigNumber, BigNumber":function(y,b){if(!b.isInteger())throw new TypeError(Ch);var w=p(r.relTol);if(b>=w)return y.toDecimalPlaces(b.toNumber());var A=y.toDecimalPlaces(w),S=yn(y,A,r.relTol,r.absTol)?A:y;return S.toDecimalPlaces(b.toNumber())},Fraction:function(y){return y.round()},"Fraction, number":function(y,b){if(b%1)throw new TypeError(Ch);return y.round(b)},"Fraction, BigNumber":function(y,b){if(!b.isInteger())throw new TypeError(Ch);return y.round(b.toNumber())},"Unit, number, Unit":t.referToSelf(h=>function(y,b,w){var A=y.toNumeric(w);return w.multiply(h(A,b))}),"Unit, BigNumber, Unit":t.referToSelf(h=>(y,b,w)=>h(y,b.toNumber(),w)),"Unit, Unit":t.referToSelf(h=>(y,b)=>h(y,0,b)),"Array | Matrix, number, Unit":t.referToSelf(h=>(y,b,w)=>Ct(y,A=>h(A,b,w),!0)),"Array | Matrix, BigNumber, Unit":t.referToSelf(h=>(y,b,w)=>h(y,b.toNumber(),w)),"Array | Matrix, Unit":t.referToSelf(h=>(y,b)=>h(y,0,b)),"Array | Matrix":t.referToSelf(h=>y=>Ct(y,h,!0)),"SparseMatrix, number | BigNumber":t.referToSelf(h=>(y,b)=>a(y,b,h,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(h=>(y,b)=>f(y,b,h,!1)),"Array, number | BigNumber":t.referToSelf(h=>(y,b)=>f(n(y),b,h,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(h=>(y,b)=>i(y,0)?o(b.size(),b.storage()):s(b,y,h,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(h=>(y,b)=>i(y,0)?o(b.size(),b.storage()):f(b,y,h,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(h=>(y,b)=>f(n(b),y,h,!0).valueOf())})});g();x();v();var L5="log",Nue=["config","typed","divideScalar","Complex"],P5=K(L5,Nue,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e;return t(L5,{number:function(u){return u>=0||r.predictable?e_(u):new i(u,0).log()},Complex:function(u){return u.log()},BigNumber:function(u){return!u.isNegative()||r.predictable?u.ln():new i(u.toNumber(),0).log()},"any, any":t.referToSelf(o=>(u,l)=>n(o(u),o(l)))})});g();x();v();var R5="log1p",Sue=["typed","config","divideScalar","log","Complex"],q5=K(R5,Sue,e=>{var{typed:t,config:r,divideScalar:n,log:i,Complex:o}=e;return t(R5,{number:function(a){return a>=-1||r.predictable?Ny(a):u(new o(a,0))},Complex:u,BigNumber:function(a){var s=a.plus(1);return!s.isNegative()||r.predictable?s.ln():u(new o(a.toNumber(),0))},"Array | Matrix":t.referToSelf(l=>a=>Ct(a,l)),"any, any":t.referToSelf(l=>(a,s)=>n(l(a),i(s)))});function u(l){var a=l.re+1;return new o(Math.log(Math.sqrt(a*a+l.im*l.im)),Math.atan2(l.im,a))}});g();x();v();var z5="nthRoots",Eue=["config","typed","divideScalar","Complex"],U5=K(z5,Eue,e=>{var{typed:t,config:r,divideScalar:n,Complex:i}=e,o=[function(a){return new i(a,0)},function(a){return new i(0,a)},function(a){return new i(-a,0)},function(a){return new i(0,-a)}];function u(l,a){if(a<0)throw new Error("Root must be greater than zero");if(a===0)throw new Error("Root must be non-zero");if(a%1!==0)throw new Error("Root must be an integer");if(l===0||l.abs()===0)return[new i(0,0)];var s=typeof l=="number",f;(s||l.re===0||l.im===0)&&(s?f=2*+(l<0):l.im===0?f=2*+(l.re<0):f=2*+(l.im<0)+1);for(var p=l.arg(),h=l.abs(),y=[],b=Math.pow(h,1/a),w=0;w{var{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:o,concat:u}=e,l=Kr({typed:t}),a=gi({typed:t,DenseMatrix:o}),s=Pr({typed:t,equalScalar:r}),f=Cr({typed:t,DenseMatrix:o}),p=tr({typed:t,matrix:n,concat:u}),h={};for(var y in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,y)&&!y.includes("Matrix")&&!y.includes("Array")&&(h[y]=i.signatures[y]);var b=t(h);return t(H5,p({elop:b,SS:a,DS:l,Ss:s,sS:f}))});g();x();v();var W5="dotDivide",Cue=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],V5=K(W5,Cue,e=>{var{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:o,concat:u}=e,l=jn({typed:t,equalScalar:n}),a=Kr({typed:t}),s=gi({typed:t,DenseMatrix:o}),f=Pr({typed:t,equalScalar:n}),p=Cr({typed:t,DenseMatrix:o}),h=tr({typed:t,matrix:r,concat:u});return t(W5,h({elop:i,SS:s,DS:a,SD:l,Ss:f,sS:p}))});g();x();v();g();x();v();function Cu(e){var{DenseMatrix:t}=e;return function(n,i,o){var u=n.size();if(u.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Kt(u)+")");var l=u[0],a=u[1];if(l!==a)throw new RangeError("Matrix must be square (size: "+Kt(u)+")");var s=[];if(St(i)){var f=i.size(),p=i._data;if(f.length===1){if(f[0]!==l)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var h=0;h{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=Cu({DenseMatrix:l});return t(G5,{"SparseMatrix, Array | Matrix":function(h,y){return f(h,y)},"DenseMatrix, Array | Matrix":function(h,y){return s(h,y)},"Array, Array | Matrix":function(h,y){var b=r(h),w=s(b,y);return w.valueOf()}});function s(p,h){h=a(p,h,!0);for(var y=h._data,b=p._size[0],w=p._size[1],A=[],S=p._data,O=0;OI&&(P.push(A[H]),R.push(V))}if(u(C,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var W=n(F,C),ee=0,ie=R.length;ee{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=Cu({DenseMatrix:l});return t(Z5,{"SparseMatrix, Array | Matrix":function(h,y){return f(h,y)},"DenseMatrix, Array | Matrix":function(h,y){return s(h,y)},"Array, Array | Matrix":function(h,y){var b=r(h),w=s(b,y);return w.valueOf()}});function s(p,h){h=a(p,h,!0);for(var y=h._data,b=p._size[0],w=p._size[1],A=[],S=p._data,O=w-1;O>=0;O--){var M=y[O][0]||0,I=void 0;if(u(M,0))I=0;else{var F=S[O][O];if(u(F,0))throw new Error("Linear system cannot be solved since matrix is singular");I=n(M,F);for(var C=O-1;C>=0;C--)y[C]=[o(y[C][0]||0,i(I,S[C][O]))]}A[O]=[I]}return new l({data:A,size:[b,1]})}function f(p,h){h=a(p,h,!0);for(var y=h._data,b=p._size[0],w=p._size[1],A=p._values,S=p._index,O=p._ptr,M=[],I=w-1;I>=0;I--){var F=y[I][0]||0;if(u(F,0))M[I]=[0];else{for(var C=0,P=[],R=[],q=O[I],U=O[I+1],H=U-1;H>=q;H--){var V=S[H];V===I?C=A[H]:V{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=Cu({DenseMatrix:l});return t(K5,{"SparseMatrix, Array | Matrix":function(h,y){return f(h,y)},"DenseMatrix, Array | Matrix":function(h,y){return s(h,y)},"Array, Array | Matrix":function(h,y){var b=r(h),w=s(b,y);return w.map(A=>A.valueOf())}});function s(p,h){for(var y=[a(p,h,!0)._data.map(R=>R[0])],b=p._data,w=p._size[0],A=p._size[1],S=0;Snew l({data:R.map(q=>[q]),size:[w,1]}))}function f(p,h){for(var y=[a(p,h,!0)._data.map(De=>De[0])],b=p._size[0],w=p._size[1],A=p._values,S=p._index,O=p._ptr,M=0;MM&&(P.push(A[V]),R.push(W))}if(u(H,0))if(u(C[M],0)){if(F===0){var Z=[...C];Z[M]=1;for(var le=0,re=R.length;lenew l({data:De.map(we=>[we]),size:[b,1]}))}});g();x();v();var Q5="usolveAll",Iue=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],j5=K(Q5,Iue,e=>{var{typed:t,matrix:r,divideScalar:n,multiplyScalar:i,subtractScalar:o,equalScalar:u,DenseMatrix:l}=e,a=Cu({DenseMatrix:l});return t(Q5,{"SparseMatrix, Array | Matrix":function(h,y){return f(h,y)},"DenseMatrix, Array | Matrix":function(h,y){return s(h,y)},"Array, Array | Matrix":function(h,y){var b=r(h),w=s(b,y);return w.map(A=>A.valueOf())}});function s(p,h){for(var y=[a(p,h,!0)._data.map(R=>R[0])],b=p._data,w=p._size[0],A=p._size[1],S=A-1;S>=0;S--)for(var O=y.length,M=0;M=0;P--)C[P]=o(C[P],b[P][S]);y.push(C)}}else{if(M===0)return[];y.splice(M,1),M-=1,O-=1}else{I[S]=n(I[S],b[S][S]);for(var F=S-1;F>=0;F--)I[F]=o(I[F],i(I[S],b[F][S]))}}return y.map(R=>new l({data:R.map(q=>[q]),size:[w,1]}))}function f(p,h){for(var y=[a(p,h,!0)._data.map(De=>De[0])],b=p._size[0],w=p._size[1],A=p._values,S=p._index,O=p._ptr,M=w-1;M>=0;M--)for(var I=y.length,F=0;F=q;V--){var W=S[V];W===M?H=A[V]:Wnew l({data:De.map(we=>[we]),size:[b,1]}))}});g();x();v();g();x();v();var Fue="matAlgo08xS0Sid",_ue=["typed","equalScalar"],Mh=K(Fue,_ue,e=>{var{typed:t,equalScalar:r}=e;return function(i,o,u){var l=i._values,a=i._index,s=i._ptr,f=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),h=o._values,y=o._index,b=o._ptr,w=o._size,A=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(f.length!==w.length)throw new Jt(f.length,w.length);if(f[0]!==w[0]||f[1]!==w[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+w+")");if(!l||!h)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var S=f[0],O=f[1],M,I=r,F=0,C=u;typeof p=="string"&&p===A&&p!=="mixed"&&(M=p,I=t.find(r,[M,M]),F=t.convert(0,M),C=t.find(u,[M,M]));for(var P=[],R=[],q=[],U=[],H=[],V,W,ee,ie,Y=0;Y{var{typed:t,matrix:r}=e;return{"Array, number":t.referTo("DenseMatrix, number",n=>(i,o)=>n(r(i),o).valueOf()),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",n=>(i,o)=>n(r(i),o).valueOf()),"number, Array":t.referTo("number, DenseMatrix",n=>(i,o)=>n(i,r(o)).valueOf()),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",n=>(i,o)=>n(i,r(o)).valueOf())}});var eB="leftShift",kue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],tB=K(eB,kue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=ho({typed:t}),a=jn({typed:t,equalScalar:n}),s=Mh({typed:t,equalScalar:n}),f=Xo({typed:t,DenseMatrix:o}),p=Pr({typed:t,equalScalar:n}),h=Qn({typed:t}),y=tr({typed:t,matrix:r,concat:u}),b=Th({typed:t,matrix:r});return t(eB,{"number, number":QE,"BigNumber, BigNumber":Hk,"bigint, bigint":(w,A)=>w<(A,S)=>n(S,0)?A.clone():p(A,S,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(A,S)=>n(S,0)?A.clone():h(A,S,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(A,S)=>n(A,0)?i(S.size(),S.storage()):f(S,A,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(A,S)=>n(A,0)?i(S.size(),S.storage()):h(S,A,w,!0))},b,y({SS:s,DS:l,SD:a}))});g();x();v();var rB="rightArithShift",Bue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],nB=K(rB,Bue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=ho({typed:t}),a=jn({typed:t,equalScalar:n}),s=Mh({typed:t,equalScalar:n}),f=Xo({typed:t,DenseMatrix:o}),p=Pr({typed:t,equalScalar:n}),h=Qn({typed:t}),y=tr({typed:t,matrix:r,concat:u}),b=Th({typed:t,matrix:r});return t(rB,{"number, number":jE,"BigNumber, BigNumber":$k,"bigint, bigint":(w,A)=>w>>A,"SparseMatrix, number | BigNumber":t.referToSelf(w=>(A,S)=>n(S,0)?A.clone():p(A,S,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(A,S)=>n(S,0)?A.clone():h(A,S,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(A,S)=>n(A,0)?i(S.size(),S.storage()):f(S,A,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(A,S)=>n(A,0)?i(S.size(),S.storage()):h(S,A,w,!0))},b,y({SS:s,DS:l,SD:a}))});g();x();v();var iB="rightLogShift",Lue=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],oB=K(iB,Lue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:o,concat:u}=e,l=ho({typed:t}),a=jn({typed:t,equalScalar:n}),s=Mh({typed:t,equalScalar:n}),f=Xo({typed:t,DenseMatrix:o}),p=Pr({typed:t,equalScalar:n}),h=Qn({typed:t}),y=tr({typed:t,matrix:r,concat:u}),b=Th({typed:t,matrix:r});return t(iB,{"number, number":eA,"SparseMatrix, number | BigNumber":t.referToSelf(w=>(A,S)=>n(S,0)?A.clone():p(A,S,w,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(w=>(A,S)=>n(S,0)?A.clone():h(A,S,w,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(w=>(A,S)=>n(A,0)?i(S.size(),S.storage()):f(S,A,w,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(w=>(A,S)=>n(A,0)?i(S.size(),S.storage()):h(S,A,w,!0))},b,y({SS:s,DS:l,SD:a}))});g();x();v();var aB="and",Pue=["typed","matrix","equalScalar","zeros","not","concat"],hw=K(aB,Pue,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=jn({typed:t,equalScalar:n}),a=Lf({typed:t,equalScalar:n}),s=Pr({typed:t,equalScalar:n}),f=Qn({typed:t}),p=tr({typed:t,matrix:r,concat:u});return t(aB,{"number, number":Zy,"Complex, Complex":function(y,b){return(y.re!==0||y.im!==0)&&(b.re!==0||b.im!==0)},"BigNumber, BigNumber":function(y,b){return!y.isZero()&&!b.isZero()&&!y.isNaN()&&!b.isNaN()},"bigint, bigint":Zy,"Unit, Unit":t.referToSelf(h=>(y,b)=>h(y.value||0,b.value||0)),"SparseMatrix, any":t.referToSelf(h=>(y,b)=>o(b)?i(y.size(),y.storage()):s(y,b,h,!1)),"DenseMatrix, any":t.referToSelf(h=>(y,b)=>o(b)?i(y.size(),y.storage()):f(y,b,h,!1)),"any, SparseMatrix":t.referToSelf(h=>(y,b)=>o(y)?i(y.size(),y.storage()):s(b,y,h,!0)),"any, DenseMatrix":t.referToSelf(h=>(y,b)=>o(y)?i(y.size(),y.storage()):f(b,y,h,!0)),"Array, any":t.referToSelf(h=>(y,b)=>h(r(y),b).valueOf()),"any, Array":t.referToSelf(h=>(y,b)=>h(y,r(b)).valueOf())},p({SS:a,DS:l}))});g();x();v();var dw="compare",Rue=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],sB=K(dw,Rue,e=>{var{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:o,Fraction:u,DenseMatrix:l,concat:a}=e,s=Kr({typed:t}),f=Bf({typed:t,equalScalar:n}),p=Cr({typed:t,DenseMatrix:l}),h=tr({typed:t,matrix:i,concat:a}),y=Ga({typed:t});return t(dw,que({typed:t,config:r}),{"boolean, boolean":function(w,A){return w===A?0:w>A?1:-1},"BigNumber, BigNumber":function(w,A){return yn(w,A,r.relTol,r.absTol)?new o(0):new o(w.cmp(A))},"bigint, bigint":function(w,A){return w===A?0n:w>A?1n:-1n},"Fraction, Fraction":function(w,A){return new u(w.compare(A))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},y,h({SS:f,DS:s,Ss:p}))}),que=K(dw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(dw,{"number, number":function(i,o){return en(i,o,r.relTol,r.absTol)?0:i>o?1:-1}})});g();x();v();var yp=ln(lB(),1);var fB="compareNatural",zue=["typed","compare"],cB=K(fB,zue,e=>{var{typed:t,compare:r}=e,n=r.signatures["boolean,boolean"];return t(fB,{"any, any":i});function i(a,s){var f=gr(a),p=gr(s),h;if((f==="number"||f==="BigNumber"||f==="Fraction")&&(p==="number"||p==="BigNumber"||p==="Fraction"))return h=r(a,s),h.toString()!=="0"?h>0?1:-1:(0,yp.default)(f,p);var y=["Array","DenseMatrix","SparseMatrix"];if(y.includes(f)||y.includes(p))return h=o(i,a,s),h!==0?h:(0,yp.default)(f,p);if(f!==p)return(0,yp.default)(f,p);if(f==="Complex")return Uue(a,s);if(f==="Unit")return a.equalBase(s)?i(a.value,s.value):u(i,a.formatUnits(),s.formatUnits());if(f==="boolean")return n(a,s);if(f==="string")return(0,yp.default)(a,s);if(f==="Object")return l(i,a,s);if(f==="null"||f==="undefined")return 0;throw new TypeError('Unsupported type of value "'+f+'"')}function o(a,s,f){return ga(s)&&ga(f)?u(a,s.toJSON().values,f.toJSON().values):ga(s)?o(a,s.toArray(),f):ga(f)?o(a,s,f.toArray()):gl(s)?o(a,s.toJSON().data,f):gl(f)?o(a,s,f.toJSON().data):Array.isArray(s)?Array.isArray(f)?u(a,s,f):o(a,s,[f]):o(a,[s],f)}function u(a,s,f){for(var p=0,h=Math.min(s.length,f.length);pf.length?1:s.lengtht.re?1:e.ret.im?1:e.im{var{typed:t,matrix:r,concat:n}=e,i=tr({typed:t,matrix:r,concat:n});return t(pB,qy,i({elop:qy,Ds:!0}))});g();x();v();var gw="equal",$ue=["typed","matrix","equalScalar","DenseMatrix","concat"],hB=K(gw,$ue,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=gi({typed:t,DenseMatrix:i}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:r,concat:o});return t(gw,Wue({typed:t,equalScalar:n}),s({elop:n,SS:l,DS:u,Ss:a}))}),Wue=K(gw,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(gw,{"any, any":function(i,o){return i===null?o===null:o===null?i===null:i===void 0?o===void 0:o===void 0?i===void 0:r(i,o)}})});g();x();v();var dB="equalText",Vue=["typed","compareText","isZero"],gB=K(dB,Vue,e=>{var{typed:t,compareText:r,isZero:n}=e;return t(dB,{"any, any":function(o,u){return n(r(o,u))}})});g();x();v();var vw="smaller",Gue=["typed","config","matrix","DenseMatrix","concat"],vB=K(vw,Gue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=gi({typed:t,DenseMatrix:i}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:n,concat:o}),f=Ga({typed:t});return t(vw,Yue({typed:t,config:r}),{"boolean, boolean":(p,h)=>ppp.compare(h)===-1,"Complex, Complex":function(h,y){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:l,DS:u,Ss:a}))}),Yue=K(vw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(vw,{"number, number":function(i,o){return i{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=gi({typed:t,DenseMatrix:i}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:n,concat:o}),f=Ga({typed:t});return t(xw,Xue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p<=h,"BigNumber, BigNumber":function(h,y){return h.lte(y)||yn(h,y,r.relTol,r.absTol)},"bigint, bigint":(p,h)=>p<=h,"Fraction, Fraction":(p,h)=>p.compare(h)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:l,DS:u,Ss:a}))}),Xue=K(xw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(xw,{"number, number":function(i,o){return i<=o||en(i,o,r.relTol,r.absTol)}})});g();x();v();var yw="larger",Kue=["typed","config","matrix","DenseMatrix","concat"],yB=K(yw,Kue,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=gi({typed:t,DenseMatrix:i}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:n,concat:o}),f=Ga({typed:t});return t(yw,Jue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>h,"BigNumber, BigNumber":function(h,y){return h.gt(y)&&!yn(h,y,r.relTol,r.absTol)},"bigint, bigint":(p,h)=>p>h,"Fraction, Fraction":(p,h)=>p.compare(h)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:l,DS:u,Ss:a}))}),Jue=K(yw,["typed","config"],e=>{var{typed:t,config:r}=e;return t(yw,{"number, number":function(i,o){return i>o&&!en(i,o,r.relTol,r.absTol)}})});g();x();v();var ww="largerEq",Que=["typed","config","matrix","DenseMatrix","concat"],wB=K(ww,Que,e=>{var{typed:t,config:r,matrix:n,DenseMatrix:i,concat:o}=e,u=Kr({typed:t}),l=gi({typed:t,DenseMatrix:i}),a=Cr({typed:t,DenseMatrix:i}),s=tr({typed:t,matrix:n,concat:o}),f=Ga({typed:t});return t(ww,jue({typed:t,config:r}),{"boolean, boolean":(p,h)=>p>=h,"BigNumber, BigNumber":function(h,y){return h.gte(y)||yn(h,y,r.relTol,r.absTol)},"bigint, bigint":function(h,y){return h>=y},"Fraction, Fraction":(p,h)=>p.compare(h)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,s({SS:l,DS:u,Ss:a}))}),jue=K(ww,["typed","config"],e=>{var{typed:t,config:r}=e;return t(ww,{"number, number":function(i,o){return i>=o||en(i,o,r.relTol,r.absTol)}})});g();x();v();var bB="deepEqual",ele=["typed","equal"],DB=K(bB,ele,e=>{var{typed:t,equal:r}=e;return t(bB,{"any, any":function(o,u){return n(o.valueOf(),u.valueOf())}});function n(i,o){if(Array.isArray(i))if(Array.isArray(o)){var u=i.length;if(u!==o.length)return!1;for(var l=0;l{var{typed:t,config:r,equalScalar:n,matrix:i,DenseMatrix:o,concat:u}=e,l=Kr({typed:t}),a=gi({typed:t,DenseMatrix:o}),s=Cr({typed:t,DenseMatrix:o}),f=tr({typed:t,matrix:i,concat:u});return t(bw,rle({typed:t,equalScalar:n}),f({elop:p,SS:a,DS:l,Ss:s}));function p(h,y){return!n(h,y)}}),rle=K(bw,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(bw,{"any, any":function(i,o){return i===null?o!==null:o===null?i!==null:i===void 0?o!==void 0:o===void 0?i!==void 0:!r(i,o)}})});g();x();v();var SB="partitionSelect",nle=["typed","isNumeric","isNaN","compare"],EB=K(SB,nle,e=>{var{typed:t,isNumeric:r,isNaN:n,compare:i}=e,o=i,u=(s,f)=>-i(s,f);return t(SB,{"Array | Matrix, number":function(f,p){return l(f,p,o)},"Array | Matrix, number, string":function(f,p,h){if(h==="asc")return l(f,p,o);if(h==="desc")return l(f,p,u);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":l});function l(s,f,p){if(!Nt(f)||f<0)throw new Error("k must be a non-negative integer");if(St(s)){var h=s.size();if(h.length>1)throw new Error("Only one dimensional matrices supported");return a(s.valueOf(),f,p)}if(Array.isArray(s))return a(s,f,p)}function a(s,f,p){if(f>=s.length)throw new Error("k out of bounds");for(var h=0;h=0){var O=s[A];s[A]=s[w],s[w]=O,--A}else++w;p(s[w],S)>0&&--w,f<=w?b=w:y=w+1}return s[f]}});g();x();v();var AB="sort",ile=["typed","matrix","compare","compareNatural"],CB=K(AB,ile,e=>{var{typed:t,matrix:r,compare:n,compareNatural:i}=e,o=n,u=(f,p)=>-n(f,p);return t(AB,{Array:function(p){return a(p),p.sort(o)},Matrix:function(p){return s(p),r(p.toArray().sort(o),p.storage())},"Array, function":function(p,h){return a(p),p.sort(h)},"Matrix, function":function(p,h){return s(p),r(p.toArray().sort(h),p.storage())},"Array, string":function(p,h){return a(p),p.sort(l(h))},"Matrix, string":function(p,h){return s(p),r(p.toArray().sort(l(h)),p.storage())}});function l(f){if(f==="asc")return o;if(f==="desc")return u;if(f==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function a(f){if(Wt(f).length!==1)throw new Error("One dimensional array expected")}function s(f){if(f.size().length!==1)throw new Error("One dimensional matrix expected")}});g();x();v();var MB="max",ole=["typed","config","numeric","larger"],Dw=K(MB,ole,e=>{var{typed:t,config:r,numeric:n,larger:i}=e;return t(MB,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(a,s){return kf(a,s.valueOf(),o)},"...":function(a){if(Va(a))throw new TypeError("Scalar values expected in function max");return u(a)}});function o(l,a){try{return i(l,a)?l:a}catch(s){throw Tn(s,"max",a)}}function u(l){var a;if(mo(l,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Tn(f,"max",s)}}),a===void 0)throw new Error("Cannot calculate max of an empty array");return typeof a=="string"&&(a=n(a,co(a,r))),a}});g();x();v();var TB="min",ale=["typed","config","numeric","smaller"],Nw=K(TB,ale,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e;return t(TB,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(a,s){return kf(a,s.valueOf(),o)},"...":function(a){if(Va(a))throw new TypeError("Scalar values expected in function min");return u(a)}});function o(l,a){try{return i(l,a)?l:a}catch(s){throw Tn(s,"min",a)}}function u(l){var a;if(mo(l,function(s){try{isNaN(s)&&typeof s=="number"?a=NaN:(a===void 0||i(s,a))&&(a=s)}catch(f){throw Tn(f,"min",s)}}),a===void 0)throw new Error("Cannot calculate min of an empty array");return typeof a=="string"&&(a=n(a,co(a,r))),a}});g();x();v();var sle="ImmutableDenseMatrix",ule=["smaller","DenseMatrix"],OB=K(sle,ule,e=>{var{smaller:t,DenseMatrix:r}=e;function n(i,o){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(o&&!gn(o))throw new Error("Invalid datatype: "+o);if(St(i)||pr(i)){var u=new r(i,o);this._data=u._data,this._size=u._size,this._datatype=u._datatype,this._min=null,this._max=null}else if(i&&pr(i.data)&&pr(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+gr(i)+")");this._data=[],this._size=[0],this._datatype=o,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var o=r.prototype.subset.call(this,i);return St(o)?new n({data:o._data,size:o._size,datatype:o._datatype}):o}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:Lt(this._data),size:Lt(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(o){(i===null||t(o,i))&&(i=o)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(o){(i===null||t(i,o))&&(i=o)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0});g();x();v();var lle="Index",fle=["ImmutableDenseMatrix","getMatrixDataType"],FB=K(lle,fle,e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:r}=e;function n(o){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var u=0,l=arguments.length;u{r&&t.push(n)}),t}g();x();v();var cle="FibonacciHeap",ple=["smaller","larger"],_B=K(cle,ple,e=>{var{smaller:t,larger:r}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(f,p){var h={key:f,value:p,degree:0};if(this._minimum){var y=this._minimum;h.left=y,h.right=y.right,y.right=h,h.right.left=h,t(f,y.key)&&(this._minimum=h)}else h.left=h,h.right=h,this._minimum=h;return this._size++,h},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var f=this._minimum;if(f===null)return f;for(var p=this._minimum,h=f.degree,y=f.child;h>0;){var b=y.right;y.left.right=y.right,y.right.left=y.left,y.left=p,y.right=p.right,p.right=y,y.right.left=y,y.parent=null,y=b,h--}return f.left.right=f.right,f.right.left=f.left,f===f.right?p=null:(p=f.right,p=s(p,this._size)),this._size--,this._minimum=p,f},i.prototype.remove=function(f){this._minimum=o(this._minimum,f,-1),this.extractMinimum()};function o(f,p,h){p.key=h;var y=p.parent;return y&&t(p.key,y.key)&&(u(f,p,y),l(f,y)),t(p.key,f.key)&&(f=p),f}function u(f,p,h){p.left.right=p.right,p.right.left=p.left,h.degree--,h.child===p&&(h.child=p.right),h.degree===0&&(h.child=null),p.left=f,p.right=f.right,f.right=p,p.right.left=p,p.parent=null,p.mark=!1}function l(f,p){var h=p.parent;h&&(p.mark?(u(f,p,h),l(h)):p.mark=!0)}var a=function(p,h){p.left.right=p.right,p.right.left=p.left,p.parent=h,h.child?(p.left=h.child,p.right=h.child.right,h.child.right=p,p.right.left=p):(h.child=p,p.right=p,p.left=p),h.degree++,p.mark=!1};function s(f,p){var h=Math.floor(Math.log(p)*n)+1,y=new Array(h),b=0,w=f;if(w)for(b++,w=w.right;w!==f;)b++,w=w.right;for(var A;b>0;){for(var S=w.degree,O=w.right;A=y[S],!!A;){if(r(w.key,A.key)){var M=A;A=w,w=M}a(A,w),y[S]=null,S++}y[S]=w,w=O,b--}f=null;for(var I=0;I{var{addScalar:t,equalScalar:r,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(o,u){if(this._values[o])this._values[o].value=u;else{var l=this._heap.insert(o,u);this._values[o]=l}},i.prototype.get=function(o){var u=this._values[o];return u?u.value:0},i.prototype.accumulate=function(o,u){var l=this._values[o];l?l.value=t(l.value,u):(l=this._heap.insert(o,u),this._values[o]=l)},i.prototype.forEach=function(o,u,l){var a=this._heap,s=this._values,f=[],p=a.extractMinimum();for(p&&f.push(p);p&&p.key<=u;)p.key>=o&&(r(p.value,0)||l(p.key,p.value,this)),p=a.extractMinimum(),p&&f.push(p);for(var h=0;h{var{on:t,config:r,addScalar:n,subtractScalar:i,multiplyScalar:o,divideScalar:u,pow:l,abs:a,fix:s,round:f,equal:p,isNumeric:h,format:y,number:b,Complex:w,BigNumber:A,Fraction:S}=e,O=b;function M(de,be){if(!(this instanceof M))throw new Error("Constructor must be called with the new operator");if(!(de==null||h(de)||Ni(de)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,be===void 0)this.units=[],this.dimensions=le.map(ge=>0);else if(typeof be=="string"){var Ue=M.parse(be);this.units=Ue.units,this.dimensions=Ue.dimensions}else if(ui(be)&&be.value===null)this.fixPrefix=be.fixPrefix,this.skipAutomaticSimplification=be.skipAutomaticSimplification,this.dimensions=be.dimensions.slice(0),this.units=be.units.map(ge=>Jn({},ge));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(de)}Object.defineProperty(M,"name",{value:"Unit"}),M.prototype.constructor=M,M.prototype.type="Unit",M.prototype.isUnit=!0;var I,F,C;function P(){for(;C===" "||C===" ";)U()}function R(de){return de>="0"&&de<="9"||de==="."}function q(de){return de>="0"&&de<="9"}function U(){F++,C=I.charAt(F)}function H(de){F=de,C=I.charAt(F)}function V(){var de="",be=F;if(C==="+"?U():C==="-"&&(de+=C,U()),!R(C))return H(be),null;if(C==="."){if(de+=C,U(),!q(C))return H(be),null}else{for(;q(C);)de+=C,U();C==="."&&(de+=C,U())}for(;q(C);)de+=C,U();if(C==="E"||C==="e"){var Ue="",ge=F;if(Ue+=C,U(),(C==="+"||C==="-")&&(Ue+=C,U()),!q(C))return H(ge),de;for(de=de+Ue;q(C);)de+=C,U()}return de}function W(){for(var de="";q(C)||M.isValidAlpha(C);)de+=C,U();var be=de.charAt(0);return M.isValidAlpha(be)?de:null}function ee(de){return C===de?(U(),de):null}M.parse=function(de,be){if(be=be||{},I=de,F=-1,C="",typeof I!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var Ue=new M;Ue.units=[];var ge=1,Re=!1;U(),P();var Be=V(),Ke=null;if(Be){if(r.number==="BigNumber")Ke=new A(Be);else if(r.number==="Fraction")try{Ke=new S(Be)}catch{Ke=parseFloat(Be)}else Ke=parseFloat(Be);P(),ee("*")?(ge=1,Re=!0):ee("/")&&(ge=-1,Re=!0)}for(var ot=[],Qe=1;;){for(P();C==="(";)ot.push(ge),Qe*=ge,ge=1,U(),P();var ut=void 0;if(C){var Pt=C;if(ut=W(),ut===null)throw new SyntaxError('Unexpected "'+Pt+'" in "'+I+'" at index '+F.toString())}else break;var fe=ie(ut);if(fe===null)throw new SyntaxError('Unit "'+ut+'" not found.');var J=ge*Qe;if(P(),ee("^")){P();var j=V();if(j===null)throw new SyntaxError('In "'+de+'", "^" must be followed by a floating-point number');J*=j}Ue.units.push({unit:fe.unit,prefix:fe.prefix,power:J});for(var ne=0;ne1||Math.abs(this.units[0].power-1)>1e-15},M.prototype._normalize=function(de){if(de==null||this.units.length===0)return de;for(var be=de,Ue=M._getNumberConverter(gr(de)),ge=0;ge{if(Et(ce,de)){var be=ce[de],Ue=be.prefixes[""];return{unit:be,prefix:Ue}}for(var ge in ce)if(Et(ce,ge)&&UF(de,ge)){var Re=ce[ge],Be=de.length-ge.length,Ke=de.substring(0,Be),ot=Et(Re.prefixes,Ke)?Re.prefixes[Ke]:void 0;if(ot!==void 0)return{unit:Re,prefix:ot}}return null},{hasher:de=>de[0],limit:100});M.isValuelessUnit=function(de){return ie(de)!==null},M.prototype.hasBase=function(de){if(typeof de=="string"&&(de=re[de]),!de)return!1;for(var be=0;be1e-12)return!1;return!0},M.prototype.equalBase=function(de){for(var be=0;be1e-12)return!1;return!0},M.prototype.equals=function(de){return this.equalBase(de)&&p(this.value,de.value)},M.prototype.multiply=function(de){for(var be=this.clone(),Ue=ui(de)?de:new M(de),ge=0;ge0?this.formatUnits():null,fixPrefix:this.fixPrefix}},M.fromJSON=function(de){var be,Ue=new M(de.value,(be=de.unit)!==null&&be!==void 0?be:void 0);return Ue.fixPrefix=de.fixPrefix||!1,Ue},M.prototype.valueOf=M.prototype.toString,M.prototype.simplify=function(){var de=this.clone(),be=[],Ue;for(var ge in Oe)if(Et(Oe,ge)&&de.hasBase(re[ge])){Ue=ge;break}if(Ue==="NONE")de.units=[];else{var Re;if(Ue&&Et(Oe,Ue)&&(Re=Oe[Ue]),Re)de.units=[{unit:Re.unit,prefix:Re.prefix,power:1}];else{for(var Be=!1,Ke=0;Ke1e-12&&(Et(Oe,ot)?be.push({unit:Oe[ot].unit,prefix:Oe[ot].prefix,power:de.dimensions[Ke]||0}):Be=!0)}be.length1e-12)if(Et(Ce.si,ge))be.push({unit:Ce.si[ge].unit,prefix:Ce.si[ge].prefix,power:de.dimensions[Ue]||0});else throw new Error("Cannot express custom unit "+ge+" in SI units")}return de.units=be,de.fixPrefix=!0,de.skipAutomaticSimplification=!0,this.value!==null?(de.value=null,this.to(de)):de},M.prototype.formatUnits=function(){for(var de="",be="",Ue=0,ge=0,Re=0;Re0?(Ue++,de+=" "+this.units[Re].prefix.name+this.units[Re].unit.name,Math.abs(this.units[Re].power-1)>1e-15&&(de+="^"+this.units[Re].power)):this.units[Re].power<0&&ge++;if(ge>0)for(var Be=0;Be0?(be+=" "+this.units[Be].prefix.name+this.units[Be].unit.name,Math.abs(this.units[Be].power+1)>1e-15&&(be+="^"+-this.units[Be].power)):(be+=" "+this.units[Be].prefix.name+this.units[Be].unit.name,be+="^"+this.units[Be].power));de=de.substr(1),be=be.substr(1),Ue>1&&ge>0&&(de="("+de+")"),ge>1&&Ue>0&&(be="("+be+")");var Ke=de;return Ue>0&&ge>0&&(Ke+=" / "),Ke+=be,Ke},M.prototype.format=function(de){var be=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),Ue=!1;typeof be.value<"u"&&be.value!==null&&Ni(be.value)&&(Ue=Math.abs(be.value.re)<1e-14);for(var ge in be.units)Et(be.units,ge)&&be.units[ge].unit&&(be.units[ge].unit.name==="VA"&&Ue?be.units[ge].unit=ce.VAR:be.units[ge].unit.name==="VAR"&&!Ue&&(be.units[ge].unit=ce.VA));be.units.length===1&&!be.fixPrefix&&Math.abs(be.units[0].power-Math.round(be.units[0].power))<1e-14&&(be.units[0].prefix=be._bestPrefix());var Re=be._denormalize(be.value),Be=be.value!==null?y(Re,de||{}):"",Ke=be.formatUnits();return be.value&&Ni(be.value)&&(Be="("+Be+")"),Ke.length>0&&Be.length>0&&(Be+=" "),Be+=Ke,Be},M.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var de=this.value!==null?a(this.value):0,be=a(this.units[0].unit.value),Ue=this.units[0].prefix;if(de===0)return Ue;var ge=this.units[0].power,Re=Math.log(de/Math.pow(Ue.value*be,ge))/Math.LN10-1.2;if(Re>-2.200001&&Re<1.800001)return Ue;Re=Math.abs(Re);var Be=this.units[0].unit.prefixes;for(var Ke in Be)if(Et(Be,Ke)){var ot=Be[Ke];if(ot.scientific){var Qe=Math.abs(Math.log(de/Math.pow(ot.value*be,ge))/Math.LN10-1.2);(Qe0)},ce={meter:{name:"meter",base:re.LENGTH,prefixes:Z.LONG,value:1,offset:0},inch:{name:"inch",base:re.LENGTH,prefixes:Z.NONE,value:.0254,offset:0},foot:{name:"foot",base:re.LENGTH,prefixes:Z.NONE,value:.3048,offset:0},yard:{name:"yard",base:re.LENGTH,prefixes:Z.NONE,value:.9144,offset:0},mile:{name:"mile",base:re.LENGTH,prefixes:Z.NONE,value:1609.344,offset:0},link:{name:"link",base:re.LENGTH,prefixes:Z.NONE,value:.201168,offset:0},rod:{name:"rod",base:re.LENGTH,prefixes:Z.NONE,value:5.0292,offset:0},chain:{name:"chain",base:re.LENGTH,prefixes:Z.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:re.LENGTH,prefixes:Z.NONE,value:1e-10,offset:0},m:{name:"m",base:re.LENGTH,prefixes:Z.SHORT,value:1,offset:0},in:{name:"in",base:re.LENGTH,prefixes:Z.NONE,value:.0254,offset:0},ft:{name:"ft",base:re.LENGTH,prefixes:Z.NONE,value:.3048,offset:0},yd:{name:"yd",base:re.LENGTH,prefixes:Z.NONE,value:.9144,offset:0},mi:{name:"mi",base:re.LENGTH,prefixes:Z.NONE,value:1609.344,offset:0},li:{name:"li",base:re.LENGTH,prefixes:Z.NONE,value:.201168,offset:0},rd:{name:"rd",base:re.LENGTH,prefixes:Z.NONE,value:5.02921,offset:0},ch:{name:"ch",base:re.LENGTH,prefixes:Z.NONE,value:20.1168,offset:0},mil:{name:"mil",base:re.LENGTH,prefixes:Z.NONE,value:254e-7,offset:0},m2:{name:"m2",base:re.SURFACE,prefixes:Z.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:re.SURFACE,prefixes:Z.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:re.SURFACE,prefixes:Z.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:re.SURFACE,prefixes:Z.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:re.SURFACE,prefixes:Z.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:re.SURFACE,prefixes:Z.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:re.SURFACE,prefixes:Z.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:re.SURFACE,prefixes:Z.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:re.SURFACE,prefixes:Z.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:re.SURFACE,prefixes:Z.NONE,value:1e4,offset:0},m3:{name:"m3",base:re.VOLUME,prefixes:Z.CUBIC,value:1,offset:0},L:{name:"L",base:re.VOLUME,prefixes:Z.SHORT,value:.001,offset:0},l:{name:"l",base:re.VOLUME,prefixes:Z.SHORT,value:.001,offset:0},litre:{name:"litre",base:re.VOLUME,prefixes:Z.LONG,value:.001,offset:0},cuin:{name:"cuin",base:re.VOLUME,prefixes:Z.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:re.VOLUME,prefixes:Z.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:re.VOLUME,prefixes:Z.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:re.VOLUME,prefixes:Z.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:re.VOLUME,prefixes:Z.NONE,value:15e-6,offset:0},drop:{name:"drop",base:re.VOLUME,prefixes:Z.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:re.VOLUME,prefixes:Z.NONE,value:5e-8,offset:0},minim:{name:"minim",base:re.VOLUME,prefixes:Z.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:re.VOLUME,prefixes:Z.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:re.VOLUME,prefixes:Z.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:re.VOLUME,prefixes:Z.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:re.VOLUME,prefixes:Z.NONE,value:1e-6,offset:0},cup:{name:"cup",base:re.VOLUME,prefixes:Z.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:re.VOLUME,prefixes:Z.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:re.VOLUME,prefixes:Z.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:re.VOLUME,prefixes:Z.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:re.VOLUME,prefixes:Z.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:re.VOLUME,prefixes:Z.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:re.VOLUME,prefixes:Z.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:re.VOLUME,prefixes:Z.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:re.VOLUME,prefixes:Z.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:re.VOLUME,prefixes:Z.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:re.VOLUME,prefixes:Z.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:re.VOLUME,prefixes:Z.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:re.VOLUME,prefixes:Z.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:re.VOLUME,prefixes:Z.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:re.VOLUME,prefixes:Z.NONE,value:.1173478,offset:0},obl:{name:"obl",base:re.VOLUME,prefixes:Z.NONE,value:.1589873,offset:0},g:{name:"g",base:re.MASS,prefixes:Z.SHORT,value:.001,offset:0},gram:{name:"gram",base:re.MASS,prefixes:Z.LONG,value:.001,offset:0},ton:{name:"ton",base:re.MASS,prefixes:Z.SHORT,value:907.18474,offset:0},t:{name:"t",base:re.MASS,prefixes:Z.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:re.MASS,prefixes:Z.LONG,value:1e3,offset:0},grain:{name:"grain",base:re.MASS,prefixes:Z.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:re.MASS,prefixes:Z.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:re.MASS,prefixes:Z.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:re.MASS,prefixes:Z.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:re.MASS,prefixes:Z.NONE,value:45.359237,offset:0},stick:{name:"stick",base:re.MASS,prefixes:Z.NONE,value:.115,offset:0},stone:{name:"stone",base:re.MASS,prefixes:Z.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:re.MASS,prefixes:Z.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:re.MASS,prefixes:Z.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:re.MASS,prefixes:Z.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:re.MASS,prefixes:Z.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:re.MASS,prefixes:Z.NONE,value:45.359237,offset:0},s:{name:"s",base:re.TIME,prefixes:Z.SHORT,value:1,offset:0},min:{name:"min",base:re.TIME,prefixes:Z.NONE,value:60,offset:0},h:{name:"h",base:re.TIME,prefixes:Z.NONE,value:3600,offset:0},second:{name:"second",base:re.TIME,prefixes:Z.LONG,value:1,offset:0},sec:{name:"sec",base:re.TIME,prefixes:Z.LONG,value:1,offset:0},minute:{name:"minute",base:re.TIME,prefixes:Z.NONE,value:60,offset:0},hour:{name:"hour",base:re.TIME,prefixes:Z.NONE,value:3600,offset:0},day:{name:"day",base:re.TIME,prefixes:Z.NONE,value:86400,offset:0},week:{name:"week",base:re.TIME,prefixes:Z.NONE,value:7*86400,offset:0},month:{name:"month",base:re.TIME,prefixes:Z.NONE,value:2629800,offset:0},year:{name:"year",base:re.TIME,prefixes:Z.NONE,value:31557600,offset:0},decade:{name:"decade",base:re.TIME,prefixes:Z.NONE,value:315576e3,offset:0},century:{name:"century",base:re.TIME,prefixes:Z.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:re.TIME,prefixes:Z.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:re.FREQUENCY,prefixes:Z.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:re.FREQUENCY,prefixes:Z.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:re.ANGLE,prefixes:Z.SHORT,value:1,offset:0},radian:{name:"radian",base:re.ANGLE,prefixes:Z.LONG,value:1,offset:0},deg:{name:"deg",base:re.ANGLE,prefixes:Z.SHORT,value:null,offset:0},degree:{name:"degree",base:re.ANGLE,prefixes:Z.LONG,value:null,offset:0},grad:{name:"grad",base:re.ANGLE,prefixes:Z.SHORT,value:null,offset:0},gradian:{name:"gradian",base:re.ANGLE,prefixes:Z.LONG,value:null,offset:0},cycle:{name:"cycle",base:re.ANGLE,prefixes:Z.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:re.ANGLE,prefixes:Z.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:re.ANGLE,prefixes:Z.NONE,value:null,offset:0},A:{name:"A",base:re.CURRENT,prefixes:Z.SHORT,value:1,offset:0},ampere:{name:"ampere",base:re.CURRENT,prefixes:Z.LONG,value:1,offset:0},K:{name:"K",base:re.TEMPERATURE,prefixes:Z.SHORT,value:1,offset:0},degC:{name:"degC",base:re.TEMPERATURE,prefixes:Z.SHORT,value:1,offset:273.15},degF:{name:"degF",base:re.TEMPERATURE,prefixes:Z.SHORT,value:new S(5,9),offset:459.67},degR:{name:"degR",base:re.TEMPERATURE,prefixes:Z.SHORT,value:new S(5,9),offset:0},kelvin:{name:"kelvin",base:re.TEMPERATURE,prefixes:Z.LONG,value:1,offset:0},celsius:{name:"celsius",base:re.TEMPERATURE,prefixes:Z.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:re.TEMPERATURE,prefixes:Z.LONG,value:new S(5,9),offset:459.67},rankine:{name:"rankine",base:re.TEMPERATURE,prefixes:Z.LONG,value:new S(5,9),offset:0},mol:{name:"mol",base:re.AMOUNT_OF_SUBSTANCE,prefixes:Z.SHORT,value:1,offset:0},mole:{name:"mole",base:re.AMOUNT_OF_SUBSTANCE,prefixes:Z.LONG,value:1,offset:0},cd:{name:"cd",base:re.LUMINOUS_INTENSITY,prefixes:Z.SHORT,value:1,offset:0},candela:{name:"candela",base:re.LUMINOUS_INTENSITY,prefixes:Z.LONG,value:1,offset:0},N:{name:"N",base:re.FORCE,prefixes:Z.SHORT,value:1,offset:0},newton:{name:"newton",base:re.FORCE,prefixes:Z.LONG,value:1,offset:0},dyn:{name:"dyn",base:re.FORCE,prefixes:Z.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:re.FORCE,prefixes:Z.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:re.FORCE,prefixes:Z.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:re.FORCE,prefixes:Z.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:re.FORCE,prefixes:Z.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:re.FORCE,prefixes:Z.NONE,value:9.80665,offset:0},J:{name:"J",base:re.ENERGY,prefixes:Z.SHORT,value:1,offset:0},joule:{name:"joule",base:re.ENERGY,prefixes:Z.LONG,value:1,offset:0},erg:{name:"erg",base:re.ENERGY,prefixes:Z.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:re.ENERGY,prefixes:Z.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:re.ENERGY,prefixes:Z.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:re.ENERGY,prefixes:Z.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:re.ENERGY,prefixes:Z.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:re.POWER,prefixes:Z.SHORT,value:1,offset:0},watt:{name:"watt",base:re.POWER,prefixes:Z.LONG,value:1,offset:0},hp:{name:"hp",base:re.POWER,prefixes:Z.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:re.POWER,prefixes:Z.SHORT,value:w.I,offset:0},VA:{name:"VA",base:re.POWER,prefixes:Z.SHORT,value:1,offset:0},Pa:{name:"Pa",base:re.PRESSURE,prefixes:Z.SHORT,value:1,offset:0},psi:{name:"psi",base:re.PRESSURE,prefixes:Z.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:re.PRESSURE,prefixes:Z.NONE,value:101325,offset:0},bar:{name:"bar",base:re.PRESSURE,prefixes:Z.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:re.PRESSURE,prefixes:Z.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:re.PRESSURE,prefixes:Z.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:re.PRESSURE,prefixes:Z.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:re.PRESSURE,prefixes:Z.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:re.ELECTRIC_CHARGE,prefixes:Z.LONG,value:1,offset:0},C:{name:"C",base:re.ELECTRIC_CHARGE,prefixes:Z.SHORT,value:1,offset:0},farad:{name:"farad",base:re.ELECTRIC_CAPACITANCE,prefixes:Z.LONG,value:1,offset:0},F:{name:"F",base:re.ELECTRIC_CAPACITANCE,prefixes:Z.SHORT,value:1,offset:0},volt:{name:"volt",base:re.ELECTRIC_POTENTIAL,prefixes:Z.LONG,value:1,offset:0},V:{name:"V",base:re.ELECTRIC_POTENTIAL,prefixes:Z.SHORT,value:1,offset:0},ohm:{name:"ohm",base:re.ELECTRIC_RESISTANCE,prefixes:Z.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:re.ELECTRIC_INDUCTANCE,prefixes:Z.LONG,value:1,offset:0},H:{name:"H",base:re.ELECTRIC_INDUCTANCE,prefixes:Z.SHORT,value:1,offset:0},siemens:{name:"siemens",base:re.ELECTRIC_CONDUCTANCE,prefixes:Z.LONG,value:1,offset:0},S:{name:"S",base:re.ELECTRIC_CONDUCTANCE,prefixes:Z.SHORT,value:1,offset:0},weber:{name:"weber",base:re.MAGNETIC_FLUX,prefixes:Z.LONG,value:1,offset:0},Wb:{name:"Wb",base:re.MAGNETIC_FLUX,prefixes:Z.SHORT,value:1,offset:0},tesla:{name:"tesla",base:re.MAGNETIC_FLUX_DENSITY,prefixes:Z.LONG,value:1,offset:0},T:{name:"T",base:re.MAGNETIC_FLUX_DENSITY,prefixes:Z.SHORT,value:1,offset:0},b:{name:"b",base:re.BIT,prefixes:Z.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:re.BIT,prefixes:Z.BINARY_LONG,value:1,offset:0},B:{name:"B",base:re.BIT,prefixes:Z.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:re.BIT,prefixes:Z.BINARY_LONG,value:8,offset:0}},Se={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",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",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 Pe(de){if(de.number==="BigNumber"){var be=Iv(A);ce.rad.value=new A(1),ce.deg.value=be.div(180),ce.grad.value=be.div(200),ce.cycle.value=be.times(2),ce.arcsec.value=be.div(648e3),ce.arcmin.value=be.div(10800)}else ce.rad.value=1,ce.deg.value=Math.PI/180,ce.grad.value=Math.PI/200,ce.cycle.value=Math.PI*2,ce.arcsec.value=Math.PI/648e3,ce.arcmin.value=Math.PI/10800;ce.radian.value=ce.rad.value,ce.degree.value=ce.deg.value,ce.gradian.value=ce.grad.value}Pe(r),t&&t("config",function(de,be){de.number!==be.number&&Pe(de)});var Ce={si:{NONE:{unit:we,prefix:Z.NONE[""]},LENGTH:{unit:ce.m,prefix:Z.SHORT[""]},MASS:{unit:ce.g,prefix:Z.SHORT.k},TIME:{unit:ce.s,prefix:Z.SHORT[""]},CURRENT:{unit:ce.A,prefix:Z.SHORT[""]},TEMPERATURE:{unit:ce.K,prefix:Z.SHORT[""]},LUMINOUS_INTENSITY:{unit:ce.cd,prefix:Z.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:ce.mol,prefix:Z.SHORT[""]},ANGLE:{unit:ce.rad,prefix:Z.SHORT[""]},BIT:{unit:ce.bits,prefix:Z.SHORT[""]},FORCE:{unit:ce.N,prefix:Z.SHORT[""]},ENERGY:{unit:ce.J,prefix:Z.SHORT[""]},POWER:{unit:ce.W,prefix:Z.SHORT[""]},PRESSURE:{unit:ce.Pa,prefix:Z.SHORT[""]},ELECTRIC_CHARGE:{unit:ce.C,prefix:Z.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:ce.F,prefix:Z.SHORT[""]},ELECTRIC_POTENTIAL:{unit:ce.V,prefix:Z.SHORT[""]},ELECTRIC_RESISTANCE:{unit:ce.ohm,prefix:Z.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:ce.H,prefix:Z.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:ce.S,prefix:Z.SHORT[""]},MAGNETIC_FLUX:{unit:ce.Wb,prefix:Z.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:ce.T,prefix:Z.SHORT[""]},FREQUENCY:{unit:ce.Hz,prefix:Z.SHORT[""]}}};Ce.cgs=JSON.parse(JSON.stringify(Ce.si)),Ce.cgs.LENGTH={unit:ce.m,prefix:Z.SHORT.c},Ce.cgs.MASS={unit:ce.g,prefix:Z.SHORT[""]},Ce.cgs.FORCE={unit:ce.dyn,prefix:Z.SHORT[""]},Ce.cgs.ENERGY={unit:ce.erg,prefix:Z.NONE[""]},Ce.us=JSON.parse(JSON.stringify(Ce.si)),Ce.us.LENGTH={unit:ce.ft,prefix:Z.NONE[""]},Ce.us.MASS={unit:ce.lbm,prefix:Z.NONE[""]},Ce.us.TEMPERATURE={unit:ce.degF,prefix:Z.NONE[""]},Ce.us.FORCE={unit:ce.lbf,prefix:Z.NONE[""]},Ce.us.ENERGY={unit:ce.BTU,prefix:Z.BTU[""]},Ce.us.POWER={unit:ce.hp,prefix:Z.NONE[""]},Ce.us.PRESSURE={unit:ce.psi,prefix:Z.NONE[""]},Ce.auto=JSON.parse(JSON.stringify(Ce.si));var Oe=Ce.auto;M.setUnitSystem=function(de){if(Et(Ce,de))Oe=Ce[de];else throw new Error("Unit system "+de+" does not exist. Choices are: "+Object.keys(Ce).join(", "))},M.getUnitSystem=function(){for(var de in Ce)if(Et(Ce,de)&&Ce[de]===Oe)return de},M.typeConverters={BigNumber:function(be){return be!=null&&be.isFraction?new A(be.n).div(be.d).times(be.s):new A(be+"")},Fraction:function(be){return new S(be)},Complex:function(be){return be},number:function(be){return be!=null&&be.isFraction?b(be):be}},M.prototype._numberConverter=function(){var de=M.typeConverters[this.valueType()];if(de)return de;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},M._getNumberConverter=function(de){if(!M.typeConverters[de])throw new TypeError('Unsupported type "'+de+'"');return M.typeConverters[de]};for(var He in ce)if(Et(ce,He)){var Ee=ce[He];Ee.dimensions=Ee.base.dimensions}for(var ze in Se)if(Et(Se,ze)){var We=ce[Se[ze]],Le={};for(var lt in We)Et(We,lt)&&(Le[lt]=We[lt]);Le.name=ze,ce[ze]=Le}M.isValidAlpha=function(be){return/^[a-zA-Z]$/.test(be)};function ct(de){for(var be=0;be0&&!(M.isValidAlpha(C)||q(C)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+de+'"')}}return M.createUnit=function(de,be){if(typeof de!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(be&&be.override){for(var Ue in de)if(Et(de,Ue)&&M.deleteUnit(Ue),de[Ue].aliases)for(var ge=0;ge"u"||be===null)&&(be={}),typeof de!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Et(ce,de))throw new Error('Cannot create unit "'+de+'": a unit with that name already exists');ct(de);var Ue=null,ge=[],Re=0,Be,Ke,ot;if(be&&be.type==="Unit")Ue=be.clone();else if(typeof be=="string")be!==""&&(Be=be);else if(typeof be=="object")Be=be.definition,Ke=be.prefixes,Re=be.offset,ot=be.baseName,be.aliases&&(ge=be.aliases.valueOf());else throw new TypeError('Cannot create unit "'+de+'" from "'+be.toString()+'": expecting "string" or "Unit" or "Object"');if(ge){for(var Qe=0;Qe1e-12){me=!1;break}if(me){j=!0,ut.base=re[ne];break}}if(!j){ot=ot||de+"_STUFF";var _e={dimensions:Ue.dimensions.slice(0)};_e.key=ot,re[ot]=_e,Oe[ot]={unit:ut,prefix:Z.NONE[""]},ut.base=re[ot]}}else{if(ot=ot||de+"_STUFF",le.indexOf(ot)>=0)throw new Error('Cannot create new base unit "'+de+'": a base unit with that name already exists (and cannot be overridden)');le.push(ot);for(var Pt in re)Et(re,Pt)&&(re[Pt].dimensions[le.length-1]=0);for(var fe={dimensions:[]},J=0;J{var{typed:t,Unit:r}=e;return t(zB,{Unit:function(i){return i.clone()},string:function(i){return r.isValuelessUnit(i)?new r(null,i):r.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,o){return new r(i,o)},"number | BigNumber | Fraction":function(i){return new r(i)},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();x();v();var HB="sparse",xle=["typed","SparseMatrix"],$B=K(HB,xle,e=>{var{typed:t,SparseMatrix:r}=e;return t(HB,{"":function(){return new r([])},string:function(i){return new r([],i)},"Array | Matrix":function(i){return new r(i)},"Array | Matrix, string":function(i,o){return new r(i,o)}})});g();x();v();var WB="createUnit",yle=["typed","Unit"],VB=K(WB,yle,e=>{var{typed:t,Unit:r}=e;return t(WB,{"Object, Object":function(i,o){return r.createUnit(i,o)},Object:function(i){return r.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,o,u){var l={};return l[i]=o,r.createUnit(l,u)},"string, Unit | string | Object":function(i,o){var u={};return u[i]=o,r.createUnit(u,{})},string:function(i){var o={};return o[i]={},r.createUnit(o,{})}})});g();x();v();var GB="acos",wle=["typed","config","Complex"],YB=K(GB,wle,e=>{var{typed:t,config:r,Complex:n}=e;return t(GB,{number:function(o){return o>=-1&&o<=1||r.predictable?Math.acos(o):new n(o,0).acos()},Complex:function(o){return o.acos()},BigNumber:function(o){return o.acos()}})});g();x();v();var ZB="acosh",ble=["typed","config","Complex"],XB=K(ZB,ble,e=>{var{typed:t,config:r,Complex:n}=e;return t(ZB,{number:function(o){return o>=1||r.predictable?aA(o):o<=-1?new n(Math.log(Math.sqrt(o*o-1)-o),Math.PI):new n(o,0).acosh()},Complex:function(o){return o.acosh()},BigNumber:function(o){return o.acosh()}})});g();x();v();var KB="acot",Dle=["typed","BigNumber"],JB=K(KB,Dle,e=>{var{typed:t,BigNumber:r}=e;return t(KB,{number:sA,Complex:function(i){return i.acot()},BigNumber:function(i){return new r(1).div(i).atan()}})});g();x();v();var QB="acoth",Nle=["typed","config","Complex","BigNumber"],jB=K(QB,Nle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(QB,{number:function(u){return u>=1||u<=-1||r.predictable?uA(u):new n(u,0).acoth()},Complex:function(u){return u.acoth()},BigNumber:function(u){return new i(1).div(u).atanh()}})});g();x();v();var eL="acsc",Sle=["typed","config","Complex","BigNumber"],tL=K(eL,Sle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(eL,{number:function(u){return u<=-1||u>=1||r.predictable?lA(u):new n(u,0).acsc()},Complex:function(u){return u.acsc()},BigNumber:function(u){return new i(1).div(u).asin()}})});g();x();v();var rL="acsch",Ele=["typed","BigNumber"],nL=K(rL,Ele,e=>{var{typed:t,BigNumber:r}=e;return t(rL,{number:fA,Complex:function(i){return i.acsch()},BigNumber:function(i){return new r(1).div(i).asinh()}})});g();x();v();var iL="asec",Ale=["typed","config","Complex","BigNumber"],oL=K(iL,Ale,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(iL,{number:function(u){return u<=-1||u>=1||r.predictable?cA(u):new n(u,0).asec()},Complex:function(u){return u.asec()},BigNumber:function(u){return new i(1).div(u).acos()}})});g();x();v();var aL="asech",Cle=["typed","config","Complex","BigNumber"],sL=K(aL,Cle,e=>{var{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(aL,{number:function(u){if(u<=1&&u>=-1||r.predictable){var l=1/u;if(l>0||r.predictable)return pA(u);var a=Math.sqrt(l*l-1);return new n(Math.log(a-l),Math.PI)}return new n(u,0).asech()},Complex:function(u){return u.asech()},BigNumber:function(u){return new i(1).div(u).acosh()}})});g();x();v();var uL="asin",Mle=["typed","config","Complex"],lL=K(uL,Mle,e=>{var{typed:t,config:r,Complex:n}=e;return t(uL,{number:function(o){return o>=-1&&o<=1||r.predictable?Math.asin(o):new n(o,0).asin()},Complex:function(o){return o.asin()},BigNumber:function(o){return o.asin()}})});g();x();v();var Tle="asinh",Ole=["typed"],fL=K(Tle,Ole,e=>{var{typed:t}=e;return t("asinh",{number:mA,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});g();x();v();var Ile="atan",Fle=["typed"],cL=K(Ile,Fle,e=>{var{typed:t}=e;return t("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})});g();x();v();var pL="atan2",_le=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],mL=K(pL,_le,e=>{var{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:o,concat:u}=e,l=jn({typed:t,equalScalar:n}),a=Kr({typed:t}),s=jy({typed:t,equalScalar:n}),f=Pr({typed:t,equalScalar:n}),p=Cr({typed:t,DenseMatrix:o}),h=tr({typed:t,matrix:r,concat:u});return t(pL,{"number, number":Math.atan2,"BigNumber, BigNumber":(y,b)=>i.atan2(y,b)},h({scalar:"number | BigNumber",SS:s,DS:a,SD:l,Ss:f,sS:p}))});g();x();v();var hL="atanh",kle=["typed","config","Complex"],dL=K(hL,kle,e=>{var{typed:t,config:r,Complex:n}=e;return t(hL,{number:function(o){return o<=1&&o>=-1||r.predictable?hA(o):new n(o,0).atanh()},Complex:function(o){return o.atanh()},BigNumber:function(o){return o.atanh()}})});g();x();v();g();x();v();var Za=K("trigUnit",["typed"],e=>{var{typed:t}=e;return{Unit:t.referToSelf(r=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(r,n.valueType())(n.value)})}});var gL="cos",Ble=["typed"],vL=K(gL,Ble,e=>{var{typed:t}=e,r=Za({typed:t});return t(gL,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},r)});g();x();v();var xL="cosh",Lle=["typed"],yL=K(xL,Lle,e=>{var{typed:t}=e;return t(xL,{number:Ey,"Complex | BigNumber":r=>r.cosh()})});g();x();v();var wL="cot",Ple=["typed","BigNumber"],bL=K(wL,Ple,e=>{var{typed:t,BigNumber:r}=e,n=Za({typed:t});return t(wL,{number:dA,Complex:i=>i.cot(),BigNumber:i=>new r(1).div(i.tan())},n)});g();x();v();var DL="coth",Rle=["typed","BigNumber"],NL=K(DL,Rle,e=>{var{typed:t,BigNumber:r}=e;return t(DL,{number:gA,Complex:n=>n.coth(),BigNumber:n=>new r(1).div(n.tanh())})});g();x();v();var SL="csc",qle=["typed","BigNumber"],EL=K(SL,qle,e=>{var{typed:t,BigNumber:r}=e,n=Za({typed:t});return t(SL,{number:vA,Complex:i=>i.csc(),BigNumber:i=>new r(1).div(i.sin())},n)});g();x();v();var AL="csch",zle=["typed","BigNumber"],CL=K(AL,zle,e=>{var{typed:t,BigNumber:r}=e;return t(AL,{number:xA,Complex:n=>n.csch(),BigNumber:n=>new r(1).div(n.sinh())})});g();x();v();var ML="sec",Ule=["typed","BigNumber"],TL=K(ML,Ule,e=>{var{typed:t,BigNumber:r}=e,n=Za({typed:t});return t(ML,{number:yA,Complex:i=>i.sec(),BigNumber:i=>new r(1).div(i.cos())},n)});g();x();v();var OL="sech",Hle=["typed","BigNumber"],IL=K(OL,Hle,e=>{var{typed:t,BigNumber:r}=e;return t(OL,{number:wA,Complex:n=>n.sech(),BigNumber:n=>new r(1).div(n.cosh())})});g();x();v();var FL="sin",$le=["typed"],_L=K(FL,$le,e=>{var{typed:t}=e,r=Za({typed:t});return t(FL,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},r)});g();x();v();var kL="sinh",Wle=["typed"],BL=K(kL,Wle,e=>{var{typed:t}=e;return t(kL,{number:bA,"Complex | BigNumber":r=>r.sinh()})});g();x();v();var LL="tan",Vle=["typed"],PL=K(LL,Vle,e=>{var{typed:t}=e,r=Za({typed:t});return t(LL,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},r)});g();x();v();var Gle="tanh",Yle=["typed"],RL=K(Gle,Yle,e=>{var{typed:t}=e;return t("tanh",{number:Ay,"Complex | BigNumber":r=>r.tanh()})});g();x();v();var qL="setCartesian",Zle=["typed","size","subset","compareNatural","Index","DenseMatrix"],zL=K(qL,Zle,e=>{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t(qL,{"Array | Matrix, Array | Matrix":function(a,s){var f=[];if(n(r(a),new o(0))!==0&&n(r(s),new o(0))!==0){var p=nr(Array.isArray(a)?a:a.toArray()).sort(i),h=nr(Array.isArray(s)?s:s.toArray()).sort(i);f=[];for(var y=0;y{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t(UL,{"Array | Matrix, Array | Matrix":function(a,s){var f;if(n(r(a),new o(0))===0)f=[];else{if(n(r(s),new o(0))===0)return nr(a.toArray());var p=wl(nr(Array.isArray(a)?a:a.toArray()).sort(i)),h=wl(nr(Array.isArray(s)?s:s.toArray()).sort(i));f=[];for(var y,b=0;b{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t($L,{"Array | Matrix":function(a){var s;if(n(r(a),new o(0))===0)s=[];else{var f=nr(Array.isArray(a)?a:a.toArray()).sort(i);s=[],s.push(f[0]);for(var p=1;p{var{typed:t,size:r,subset:n,compareNatural:i,Index:o,DenseMatrix:u}=e;return t(VL,{"Array | Matrix, Array | Matrix":function(a,s){var f;if(n(r(a),new o(0))===0||n(r(s),new o(0))===0)f=[];else{var p=wl(nr(Array.isArray(a)?a:a.toArray()).sort(i)),h=wl(nr(Array.isArray(s)?s:s.toArray()).sort(i));f=[];for(var y=0;y{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(YL,{"Array | Matrix, Array | Matrix":function(l,a){if(n(r(l),new o(0))===0)return!0;if(n(r(a),new o(0))===0)return!1;for(var s=wl(nr(Array.isArray(l)?l:l.toArray()).sort(i)),f=wl(nr(Array.isArray(a)?a:a.toArray()).sort(i)),p,h=0;h{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(XL,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(l,a){if(n(r(a),new o(0))===0)return 0;for(var s=nr(Array.isArray(a)?a:a.toArray()),f=0,p=0;p{var{typed:t,size:r,subset:n,compareNatural:i,Index:o}=e;return t(JL,{"Array | Matrix":function(s){if(n(r(s),new o(0))===0)return[];for(var f=nr(Array.isArray(s)?s:s.toArray()).sort(i),p=[],h=0;h.toString(2).length<=f.length;)p.push(u(f,h.toString(2).split("").reverse())),h++;return l(p)}});function u(a,s){for(var f=[],p=0;p0;f--)for(var p=0;pa[p+1].length&&(s=a[p],a[p]=a[p+1],a[p+1]=s);return a}});g();x();v();var jL="setSize",tfe=["typed","compareNatural"],e6=K(jL,tfe,e=>{var{typed:t,compareNatural:r}=e;return t(jL,{"Array | Matrix":function(i){return Array.isArray(i)?nr(i).length:nr(i.toArray()).length},"Array | Matrix, boolean":function(i,o){if(o===!1||i.length===0)return Array.isArray(i)?nr(i).length:nr(i.toArray()).length;for(var u=nr(Array.isArray(i)?i:i.toArray()).sort(r),l=1,a=1;a{var{typed:t,size:r,concat:n,subset:i,setDifference:o,Index:u}=e;return t(t6,{"Array | Matrix, Array | Matrix":function(a,s){if(i(r(a),new u(0))===0)return nr(s);if(i(r(s),new u(0))===0)return nr(a);var f=nr(a),p=nr(s);return n(o(f,p),o(p,f))}})});g();x();v();var n6="setUnion",nfe=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],i6=K(n6,nfe,e=>{var{typed:t,size:r,concat:n,subset:i,setIntersect:o,setSymDifference:u,Index:l}=e;return t(n6,{"Array | Matrix, Array | Matrix":function(s,f){if(i(r(s),new l(0))===0)return nr(f);if(i(r(f),new l(0))===0)return nr(s);var p=nr(s),h=nr(f);return n(u(p,h),o(p,h))}})});g();x();v();var o6="add",ife=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],a6=K(o6,ife,e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:o,SparseMatrix:u,concat:l}=e,a=ho({typed:t}),s=Nh({typed:t,equalScalar:i}),f=Xo({typed:t,DenseMatrix:o}),p=tr({typed:t,matrix:r,concat:l});return t(o6,{"any, any":n,"any, any, ...any":t.referToSelf(h=>(y,b,w)=>{for(var A=h(y,b),S=0;S{var{typed:t,abs:r,addScalar:n,divideScalar:i,multiplyScalar:o,sqrt:u,smaller:l,isPositive:a}=e;return t(s6,{"... number | BigNumber":s,Array:s,Matrix:f=>s(nr(f.toArray()))});function s(f){for(var p=0,h=0,y=0;y{var{typed:t,abs:r,add:n,pow:i,conj:o,sqrt:u,multiply:l,equalScalar:a,larger:s,smaller:f,matrix:p,ctranspose:h,eigs:y}=e;return t(l6,{number:Math.abs,Complex:function(R){return R.abs()},BigNumber:function(R){return R.abs()},boolean:function(R){return Math.abs(R)},Array:function(R){return C(p(R),2)},Matrix:function(R){return C(R,2)},"Array, number | BigNumber | string":function(R,q){return C(p(R),q)},"Matrix, number | BigNumber | string":function(R,q){return C(R,q)}});function b(P){var R=0;return P.forEach(function(q){var U=r(q);s(U,R)&&(R=U)},!0),R}function w(P){var R;return P.forEach(function(q){var U=r(q);(!R||f(U,R))&&(R=U)},!0),R||0}function A(P,R){if(R===Number.POSITIVE_INFINITY||R==="inf")return b(P);if(R===Number.NEGATIVE_INFINITY||R==="-inf")return w(P);if(R==="fro")return C(P,2);if(typeof R=="number"&&!isNaN(R)){if(!a(R,0)){var q=0;return P.forEach(function(U){q=n(i(r(U),R),q)},!0),i(q,1/R)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function S(P){var R=0;return P.forEach(function(q,U){R=n(R,l(q,o(q)))}),r(u(R))}function O(P){var R=[],q=0;return P.forEach(function(U,H){var V=H[1],W=n(R[V]||0,r(U));s(W,q)&&(q=W),R[V]=W},!0),q}function M(P){var R=P.size();if(R[0]!==R[1])throw new RangeError("Invalid matrix dimensions");var q=h(P),U=l(q,P),H=y(U).values.toArray(),V=H[H.length-1];return r(u(V))}function I(P){var R=[],q=0;return P.forEach(function(U,H){var V=H[0],W=n(R[V]||0,r(U));s(W,q)&&(q=W),R[V]=W},!0),q}function F(P,R){if(R===1)return O(P);if(R===Number.POSITIVE_INFINITY||R==="inf")return I(P);if(R==="fro")return S(P);if(R===2)return M(P);throw new Error("Unsupported parameter value "+R)}function C(P,R){var q=P.size();if(q.length===1)return A(P,R);if(q.length===2){if(q[0]&&q[1])return F(P,R);throw new RangeError("Invalid matrix dimensions")}}});g();x();v();var c6="dot",sfe=["typed","addScalar","multiplyScalar","conj","size"],p6=K(c6,sfe,e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:o}=e;return t(c6,{"Array | DenseMatrix, Array | DenseMatrix":l,"SparseMatrix, SparseMatrix":a});function u(f,p){var h=s(f),y=s(p),b,w;if(h.length===1)b=h[0];else if(h.length===2&&h[1]===1)b=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(y.length===1)w=y[0];else if(y.length===2&&y[1]===1)w=y[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+y.join(", ")+")");if(b!==w)throw new RangeError("Vectors must have equal length ("+b+" != "+w+")");if(b===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return b}function l(f,p){var h=u(f,p),y=St(f)?f._data:f,b=St(f)?f._datatype||f.getDataType():void 0,w=St(p)?p._data:p,A=St(p)?p._datatype||p.getDataType():void 0,S=s(f).length===2,O=s(p).length===2,M=r,I=n;if(b&&A&&b===A&&typeof b=="string"&&b!=="mixed"){var F=b;M=t.find(r,[F,F]),I=t.find(n,[F,F])}if(!S&&!O){for(var C=I(i(y[0]),w[0]),P=1;PC){I++;continue}F===C&&(A=S(A,O(y[M],w[I])),M++,I++)}return A}function s(f){return St(f)?f.size():o(f)}});g();x();v();var ufe="trace",lfe=["typed","matrix","add"],m6=K(ufe,lfe,e=>{var{typed:t,matrix:r,add:n}=e;return t("trace",{Array:function(l){return i(r(l))},SparseMatrix:o,DenseMatrix:i,any:Lt});function i(u){var l=u._size,a=u._data;switch(l.length){case 1:if(l[0]===1)return Lt(a[0]);throw new RangeError("Matrix must be square (size: "+Kt(l)+")");case 2:{var s=l[0],f=l[1];if(s===f){for(var p=0,h=0;h0)for(var b=0;bb)break}return y}throw new RangeError("Matrix must be square (size: "+Kt(f)+")")}});g();x();v();var h6="index",ffe=["typed","Index"],d6=K(h6,ffe,e=>{var{typed:t,Index:r}=e;return t(h6,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var o=i.map(function(l){return kt(l)?l.toNumber():pr(l)||St(l)?l.map(function(a){return kt(a)?a.toNumber():a}):l}),u=new r;return r.apply(u,o),u}})});g();x();v();g();x();v();var Ew=new Set(["end"]);var cfe="Node",pfe=["mathWithTransform"],g6=K(cfe,pfe,e=>{var{mathWithTransform:t}=e;function r(i){for(var o of[...Ew])if(i.has(o))throw new Error('Scope contains an illegal symbol, "'+o+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(o){return this.compile().evaluate(o)}compile(){var o=this._compile(t,{}),u={},l=null;function a(s){var f=vl(s);return r(f),o(f,u,l)}return{evaluate:a}}_compile(o,u){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(o){throw new Error("Cannot run forEach on a Node interface")}map(o){throw new Error("Cannot run map on a Node interface")}_ifNode(o){if(!cr(o))throw new TypeError("Callback function must return a Node");return o}traverse(o){o(this,null,null);function u(l,a){l.forEach(function(s,f,p){a(s,f,p),u(s,a)})}u(this,o)}transform(o){function u(l,a,s){var f=o(l,a,s);return f!==l?f:l.map(u)}return u(this,null,null)}filter(o){var u=[];return this.traverse(function(l,a,s){o(l,a,s)&&u.push(l)}),u}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(o){return o.cloneDeep()})}equals(o){return o?this.type===o.type&&Fs(this,o):!1}toString(o){var u=this._getCustomString(o);return typeof u<"u"?u:this._toString(o)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(o){var u=this._getCustomString(o);return typeof u<"u"?u:this._toHTML(o)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(o){var u=this._getCustomString(o);return typeof u<"u"?u:this._toTex(o)}_toTex(o){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(o){if(o&&typeof o=="object")switch(typeof o.handler){case"object":case"undefined":return;case"function":return o.handler(this,o);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});g();x();v();g();x();v();g();x();v();function Jr(e){return e&&e.isIndexError?new Mi(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function Aw(e){var{subset:t}=e;return function(n,i){try{if(Array.isArray(n))return t(n,i);if(n&&typeof n.subset=="function")return n.subset(i);if(typeof n=="string")return t(n,i);if(typeof n=="object"){if(!i.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return fn(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(o){throw Jr(o)}}}var Cw="AccessorNode",mfe=["subset","Node"],v6=K(Cw,mfe,e=>{var{subset:t,Node:r}=e,n=Aw({subset:t});function i(u){return!(Fo(u)||Si(u)||or(u)||eo(u)||Su(u)||Ei(u)||qr(u))}class o extends r{constructor(l,a){if(super(),!cr(l))throw new TypeError('Node expected for parameter "object"');if(!Vo(a))throw new TypeError('IndexNode expected for parameter "index"');this.object=l,this.index=a}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Cw}get isAccessorNode(){return!0}_compile(l,a){var s=this.object._compile(l,a),f=this.index._compile(l,a);if(this.index.isObjectProperty()){var p=this.index.getObjectProperty();return function(y,b,w){return fn(s(y,b,w),p)}}else return function(y,b,w){var A=s(y,b,w),S=f(y,b,A);return n(A,S)}}forEach(l){l(this.object,"object",this),l(this.index,"index",this)}map(l){return new o(this._ifNode(l(this.object,"object",this)),this._ifNode(l(this.index,"index",this)))}clone(){return new o(this.object,this.index)}_toString(l){var a=this.object.toString(l);return i(this.object)&&(a="("+a+")"),a+this.index.toString(l)}_toHTML(l){var a=this.object.toHTML(l);return i(this.object)&&(a='('+a+')'),a+this.index.toHTML(l)}_toTex(l){var a=this.object.toTex(l);return i(this.object)&&(a="\\left(' + object + '\\right)"),a+this.index.toTex(l)}toJSON(){return{mathjs:Cw,object:this.object,index:this.index}}static fromJSON(l){return new o(l.object,l.index)}}return Fr(o,"name",Cw),o},{isClass:!0,isNode:!0});g();x();v();var Mw="ArrayNode",hfe=["Node"],x6=K(Mw,hfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(cr))throw new TypeError("Array containing Nodes expected")}get type(){return Mw}get isArrayNode(){return!0}_compile(i,o){var u=Yo(this.items,function(s){return s._compile(i,o)}),l=i.config.matrix!=="Array";if(l){var a=i.matrix;return function(f,p,h){return a(Yo(u,function(y){return y(f,p,h)}))}}else return function(f,p,h){return Yo(u,function(y){return y(f,p,h)})}}forEach(i){for(var o=0;o['+o.join(',')+']'}_toTex(i){function o(u,l){var a=u.some(Si)&&!u.every(Si),s=l||a,f=s?"&":"\\\\",p=u.map(function(h){return h.items?o(h.items,!l):h.toTex(i)}).join(f);return a||!s||s&&!l?"\\begin{bmatrix}"+p+"\\end{bmatrix}":p}return o(this.items,!1)}}return Fr(r,"name",Mw),r},{isClass:!0,isNode:!0});g();x();v();g();x();v();function y6(e){var{subset:t,matrix:r}=e;return function(i,o,u){try{if(Array.isArray(i)){var l=r(i).subset(o,u).valueOf();return l.forEach((a,s)=>{i[s]=a}),i}else{if(i&&typeof i.subset=="function")return i.subset(o,u);if(typeof i=="string")return t(i,o,u);if(typeof i=="object"){if(!o.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return Eu(i,o.getObjectProperty(),u),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(a){throw Jr(a)}}}g();x();v();var Xa=[{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:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Tw(e,t){if(!t||t!=="auto")return e;for(var r=e;Ei(r);)r=r.content;return r}function _r(e,t,r,n){var i=e;t!=="keep"&&(i=e.getContent());for(var o=i.getIdentifier(),u=null,l=0;l{var{subset:t,matrix:r,Node:n}=e,i=Aw({subset:t}),o=y6({subset:t,matrix:r});function u(a,s,f){s||(s="keep");var p=_r(a,s,f),h=_r(a.value,s,f);return s==="all"||h!==null&&h<=p}class l extends n{constructor(s,f,p){if(super(),this.object=s,this.index=p?f:null,this.value=p||f,!qr(s)&&!Fo(s))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(qr(s)&&s.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Vo(this.index))throw new TypeError('IndexNode expected as "index"');if(!cr(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 Iw}get isAssignmentNode(){return!0}_compile(s,f){var p=this.object._compile(s,f),h=this.index?this.index._compile(s,f):null,y=this.value._compile(s,f),b=this.object.name;if(this.index)if(this.index.isObjectProperty()){var w=this.index.getObjectProperty();return function(I,F,C){var P=p(I,F,C),R=y(I,F,C);return Eu(P,w,R),R}}else{if(qr(this.object))return function(I,F,C){var P=p(I,F,C),R=y(I,F,C),q=h(I,F,P);return I.set(b,o(P,q,R)),R};var A=this.object.object._compile(s,f);if(this.object.index.isObjectProperty()){var S=this.object.index.getObjectProperty();return function(I,F,C){var P=A(I,F,C),R=fn(P,S),q=h(I,F,R),U=y(I,F,C);return Eu(P,S,o(R,q,U)),U}}else{var O=this.object.index._compile(s,f);return function(I,F,C){var P=A(I,F,C),R=O(I,F,P),q=i(P,R),U=h(I,F,q),H=y(I,F,C);return o(P,R,o(q,U,H)),H}}}else{if(!qr(this.object))throw new TypeError("SymbolNode expected as object");return function(I,F,C){var P=y(I,F,C);return I.set(b,P),P}}}forEach(s){s(this.object,"object",this),this.index&&s(this.index,"index",this),s(this.value,"value",this)}map(s){var f=this._ifNode(s(this.object,"object",this)),p=this.index?this._ifNode(s(this.index,"index",this)):null,h=this._ifNode(s(this.value,"value",this));return new l(f,p,h)}clone(){return new l(this.object,this.index,this.value)}_toString(s){var f=this.object.toString(s),p=this.index?this.index.toString(s):"",h=this.value.toString(s);return u(this,s&&s.parenthesis,s&&s.implicit)&&(h="("+h+")"),f+p+" = "+h}toJSON(){return{mathjs:Iw,object:this.object,index:this.index,value:this.value}}static fromJSON(s){return new l(s.object,s.index,s.value)}_toHTML(s){var f=this.object.toHTML(s),p=this.index?this.index.toHTML(s):"",h=this.value.toHTML(s);return u(this,s&&s.parenthesis,s&&s.implicit)&&(h='('+h+')'),f+p+'='+h}_toTex(s){var f=this.object.toTex(s),p=this.index?this.index.toTex(s):"",h=this.value.toTex(s);return u(this,s&&s.parenthesis,s&&s.implicit)&&(h="\\left(".concat(h,"\\right)")),f+p+"="+h}}return Fr(l,"name",Iw),l},{isClass:!0,isNode:!0});g();x();v();var Fw="BlockNode",gfe=["ResultSet","Node"],D6=K(Fw,gfe,e=>{var{ResultSet:t,Node:r}=e;class n extends r{constructor(o){if(super(),!Array.isArray(o))throw new Error("Array expected");this.blocks=o.map(function(u){var l=u&&u.node,a=u&&u.visible!==void 0?u.visible:!0;if(!cr(l))throw new TypeError('Property "node" must be a Node');if(typeof a!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:l,visible:a}})}get type(){return Fw}get isBlockNode(){return!0}_compile(o,u){var l=Yo(this.blocks,function(a){return{evaluate:a.node._compile(o,u),visible:a.visible}});return function(s,f,p){var h=[];return Ff(l,function(b){var w=b.evaluate(s,f,p);b.visible&&h.push(w)}),new t(h)}}forEach(o){for(var u=0;u;')}).join('
    ')}_toTex(o){return this.blocks.map(function(u){return u.node.toTex(o)+(u.visible?"":";")}).join(`\\;\\; -`)}}return Fr(n,"name",Fw),n},{isClass:!0,isNode:!0});g();y();v();var _w="ConditionalNode",yfe=["Node"],N6=K(_w,yfe,e=>{var{Node:t}=e;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(kt(i))return!i.isZero();if(Ni(i))return!!(i.re||i.im);if(ui(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+gr(i)+'"')}class n extends t{constructor(o,u,l){if(super(),!cr(o))throw new TypeError("Parameter condition must be a Node");if(!cr(u))throw new TypeError("Parameter trueExpr must be a Node");if(!cr(l))throw new TypeError("Parameter falseExpr must be a Node");this.condition=o,this.trueExpr=u,this.falseExpr=l}get type(){return _w}get isConditionalNode(){return!0}_compile(o,u){var l=this.condition._compile(o,u),a=this.trueExpr._compile(o,u),s=this.falseExpr._compile(o,u);return function(p,h,x){return r(l(p,h,x))?a(p,h,x):s(p,h,x)}}forEach(o){o(this.condition,"condition",this),o(this.trueExpr,"trueExpr",this),o(this.falseExpr,"falseExpr",this)}map(o){return new n(this._ifNode(o(this.condition,"condition",this)),this._ifNode(o(this.trueExpr,"trueExpr",this)),this._ifNode(o(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(o){var u=o&&o.parenthesis?o.parenthesis:"keep",l=_r(this,u,o&&o.implicit),a=this.condition.toString(o),s=_r(this.condition,u,o&&o.implicit);(u==="all"||this.condition.type==="OperatorNode"||s!==null&&s<=l)&&(a="("+a+")");var f=this.trueExpr.toString(o),p=_r(this.trueExpr,u,o&&o.implicit);(u==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=l)&&(f="("+f+")");var h=this.falseExpr.toString(o),x=_r(this.falseExpr,u,o&&o.implicit);return(u==="all"||this.falseExpr.type==="OperatorNode"||x!==null&&x<=l)&&(h="("+h+")"),a+" ? "+f+" : "+h}toJSON(){return{mathjs:_w,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(o){return new n(o.condition,o.trueExpr,o.falseExpr)}_toHTML(o){var u=o&&o.parenthesis?o.parenthesis:"keep",l=_r(this,u,o&&o.implicit),a=this.condition.toHTML(o),s=_r(this.condition,u,o&&o.implicit);(u==="all"||this.condition.type==="OperatorNode"||s!==null&&s<=l)&&(a='('+a+')');var f=this.trueExpr.toHTML(o),p=_r(this.trueExpr,u,o&&o.implicit);(u==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=l)&&(f='('+f+')');var h=this.falseExpr.toHTML(o),x=_r(this.falseExpr,u,o&&o.implicit);return(u==="all"||this.falseExpr.type==="OperatorNode"||x!==null&&x<=l)&&(h='('+h+')'),a+'?'+f+':'+h}_toTex(o){return"\\begin{cases} {"+this.trueExpr.toTex(o)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(o)+"}\\\\{"+this.falseExpr.toTex(o)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return Fr(n,"name",_w),n},{isClass:!0,isNode:!0});g();y();v();g();y();v();var C6=rn(S6(),1);var FA={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{?}"},Tr={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"},_A={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(Tr.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]}".concat(Tr.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(Tr.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(Tr.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(Tr.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},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]}".concat(Tr.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(Tr.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)".concat(Tr.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]}".concat(Tr.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(Tr.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(Tr.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(Tr.bitAnd,"${args[1]}\\right)")},bitNot:{1:Tr.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(Tr.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(Tr.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(Tr.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(Tr.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(Tr.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]}".concat(Tr.and,"${args[1]}\\right)")},not:{1:Tr.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(Tr.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(Tr.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(Tr.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]}}".concat(Tr.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(Tr.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(Tr.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(Tr.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(Tr.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(Tr.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(Tr.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(Tr.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(Tr.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]}".concat(Tr.to,"${args[1]}\\right)")},numeric:function(t,r){return t.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)+".concat(FA.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)"}},M6="\\mathrm{${name}}\\left(${args}\\right)",A6={deg:"^\\circ"};function kw(e){return(0,C6.default)(e,{preserveFormatting:!0})}function Bw(e,t){return t=typeof t>"u"?!1:t,t?St(A6,e)?A6[e]:"\\mathrm{"+kw(e)+"}":St(FA,e)?FA[e]:kw(e)}var Lw="ConstantNode",Dfe=["Node"],T6=K(Lw,Dfe,e=>{var{Node:t}=e;class r extends t{constructor(i){super(),this.value=i}get type(){return Lw}get isConstantNode(){return!0}_compile(i,o){var u=this.value;return function(){return u}}forEach(i){}map(i){return this.clone()}clone(){return new r(this.value)}_toString(i){return Kt(this.value,i)}_toHTML(i){var o=this._toString(i);switch(gr(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return''+o+"";case"string":return''+o+"";case"boolean":return''+o+"";case"null":return''+o+"";case"undefined":return''+o+"";default:return''+o+""}}toJSON(){return{mathjs:Lw,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var o=this._toString(i),u=gr(this.value);switch(u){case"string":return"\\mathtt{"+kw(o)+"}";case"number":case"BigNumber":{var l=u==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!l)return this.value.valueOf()<0?"-\\infty":"\\infty";var a=o.toLowerCase().indexOf("e");return a!==-1?o.substring(0,a)+"\\cdot10^{"+o.substring(a+1)+"}":o}case"bigint":return o.toString();case"Fraction":return this.value.toLatex();default:return o}}}return Fr(r,"name",Lw),r},{isClass:!0,isNode:!0});g();y();v();var Pw="FunctionAssignmentNode",Nfe=["typed","Node"],O6=K(Pw,Nfe,e=>{var{typed:t,Node:r}=e;function n(o,u,l){var a=_r(o,u,l),s=_r(o.expr,u,l);return u==="all"||s!==null&&s<=a}class i extends r{constructor(u,l,a){if(super(),typeof u!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(l))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!cr(a))throw new TypeError('Node expected for parameter "expr"');if(Sw.has(u))throw new Error('Illegal function name, "'+u+'" is a reserved keyword');var s=new Set;for(var f of l){var p=typeof f=="string"?f:f.name;if(s.has(p))throw new Error('Duplicate parameter name "'.concat(p,'"'));s.add(p)}this.name=u,this.params=l.map(function(h){return h&&h.name||h}),this.types=l.map(function(h){return h&&h.type||"any"}),this.expr=a}get type(){return Pw}get isFunctionAssignmentNode(){return!0}_compile(u,l){var a=Object.create(l);Ff(this.params,function(b){a[b]=!0});var s=this.expr._compile(u,a),f=this.name,p=this.params,h=MS(this.types,","),x=f+"("+MS(this.params,", ")+")";return function(w,A,E){var O={};O[h]=function(){for(var I=Object.create(A),F=0;F'+Ci(this.params[s])+"");var f=this.expr.toHTML(u);return n(this,l,u&&u.implicit)&&(f='('+f+')'),''+Ci(this.name)+'('+a.join(',')+')='+f}_toTex(u){var l=u&&u.parenthesis?u.parenthesis:"keep",a=this.expr.toTex(u);return n(this,l,u&&u.implicit)&&(a="\\left(".concat(a,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(Bw).join(",")+"\\right)="+a}}return Fr(i,"name",Pw),i},{isClass:!0,isNode:!0});g();y();v();var Rw="IndexNode",Efe=["Node","size"],I6=K(Rw,Efe,e=>{var{Node:t,size:r}=e;class n extends t{constructor(o,u){if(super(),this.dimensions=o,this.dotNotation=u||!1,!Array.isArray(o)||!o.every(cr))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 Rw}get isIndexNode(){return!0}_compile(o,u){var l=Yo(this.dimensions,function(s,f){var p=s.filter(b=>b.isSymbolNode&&b.name==="end").length>0;if(p){var h=Object.create(u);h.end=!0;var x=s._compile(o,h);return function(w,A,E){if(!Et(E)&&!pr(E)&&!gn(E))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+gr(E));var O=r(E).valueOf(),M=Object.create(A);return M.end=O[f],x(w,M,E)}}else return s._compile(o,u)}),a=fn(o,"index");return function(f,p,h){var x=Yo(l,function(b){return b(f,p,h)});return a(...x)}}forEach(o){for(var u=0;u.'+Ci(this.getObjectProperty())+"":'['+u.join(',')+']'}_toTex(o){var u=this.dimensions.map(function(l){return l.toTex(o)});return this.dotNotation?"."+this.getObjectProperty():"_{"+u.join(",")+"}"}}return Fr(n,"name",Rw),n},{isClass:!0,isNode:!0});g();y();v();var qw="ObjectNode",Sfe=["Node"],F6=K(qw,Sfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(o){return cr(i[o])})))throw new TypeError("Object containing Nodes expected")}get type(){return qw}get isObjectNode(){return!0}_compile(i,o){var u={};for(var l in this.properties)if(St(this.properties,l)){var a=hp(l),s=JSON.parse(a),f=fn(this.properties,l);u[s]=f._compile(i,o)}return function(h,x,b){var w={};for(var A in u)St(u,A)&&(w[A]=u[A](h,x,b));return w}}forEach(i){for(var o in this.properties)St(this.properties,o)&&i(this.properties[o],"properties["+hp(o)+"]",this)}map(i){var o={};for(var u in this.properties)St(this.properties,u)&&(o[u]=this._ifNode(i(this.properties[u],"properties["+hp(u)+"]",this)));return new r(o)}clone(){var i={};for(var o in this.properties)St(this.properties,o)&&(i[o]=this.properties[o]);return new r(i)}_toString(i){var o=[];for(var u in this.properties)St(this.properties,u)&&o.push(hp(u)+": "+this.properties[u].toString(i));return"{"+o.join(", ")+"}"}toJSON(){return{mathjs:qw,properties:this.properties}}static fromJSON(i){return new r(i.properties)}_toHTML(i){var o=[];for(var u in this.properties)St(this.properties,u)&&o.push(''+Ci(u)+':'+this.properties[u].toHTML(i));return'{'+o.join(',')+'}'}_toTex(i){var o=[];for(var u in this.properties)St(this.properties,u)&&o.push("\\mathbf{"+u+":} & "+this.properties[u].toTex(i)+"\\\\");var l="\\left\\{\\begin{array}{ll}"+o.join(` -`)+"\\end{array}\\right\\}";return l}}return Fr(r,"name",qw),r},{isClass:!0,isNode:!0});g();y();v();g();y();v();function wp(e,t){return new mh(e,new pp(t),new Set(Object.keys(t)))}var zw="OperatorNode",Afe=["Node"],_6=K(zw,Afe,e=>{var{Node:t}=e;function r(o,u){var l=o;if(u==="auto")for(;Si(l);)l=l.content;return or(l)?!0:Xr(l)?r(l.args[0],u):!1}function n(o,u,l,a,s){var f=_r(o,u,l),p=Ih(o,u);if(u==="all"||a.length>2&&o.getIdentifier()!=="OperatorNode:add"&&o.getIdentifier()!=="OperatorNode:multiply")return a.map(function(U){switch(U.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var h;switch(a.length){case 0:h=[];break;case 1:{var x=_r(a[0],u,l,o);if(s&&x!==null){var b,w;if(u==="keep"?(b=a[0].getIdentifier(),w=o.getIdentifier()):(b=a[0].getContent().getIdentifier(),w=o.getContent().getIdentifier()),Xa[f][w].latexLeftParens===!1){h=[!1];break}if(Xa[x][b].latexParens===!1){h=[!1];break}}if(x===null){h=[!1];break}if(x<=f){h=[!0];break}h=[!1]}break;case 2:{var A,E=_r(a[0],u,l,o),O=Ow(o,a[0],u);E===null?A=!1:E===f&&p==="right"&&!O||E=2&&o.getIdentifier()==="OperatorNode:multiply"&&o.implicit&&u!=="all"&&l==="hide")for(var q=1;q2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var A=s.map(function(E,O){return E=E.toString(u),f[O]&&(E="("+E+")"),E});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?A.join(" "):A.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:zw,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(u){return new i(u.op,u.fn,u.args,u.implicit,u.isPercentage)}_toHTML(u){var l=u&&u.parenthesis?u.parenthesis:"keep",a=u&&u.implicit?u.implicit:"hide",s=this.args,f=n(this,l,a,s,!1);if(s.length===1){var p=Ih(this,l),h=s[0].toHTML(u);return f[0]&&(h='('+h+')'),p==="right"?''+Ci(this.op)+""+h:h+''+Ci(this.op)+""}else if(s.length===2){var x=s[0].toHTML(u),b=s[1].toHTML(u);return f[0]&&(x='('+x+')'),f[1]&&(b='('+b+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?x+''+b:x+''+Ci(this.op)+""+b}else{var w=s.map(function(A,E){return A=A.toHTML(u),f[E]&&(A='('+A+')'),A});return s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?w.join(''):w.join(''+Ci(this.op)+""):''+Ci(this.fn)+'('+w.join(',')+')'}}_toTex(u){var l=u&&u.parenthesis?u.parenthesis:"keep",a=u&&u.implicit?u.implicit:"hide",s=this.args,f=n(this,l,a,s,!0),p=Tr[this.fn];if(p=typeof p>"u"?this.op:p,s.length===1){var h=Ih(this,l),x=s[0].toTex(u);return f[0]&&(x="\\left(".concat(x,"\\right)")),h==="right"?p+x:x+p}else if(s.length===2){var b=s[0],w=b.toTex(u);f[0]&&(w="\\left(".concat(w,"\\right)"));var A=s[1],E=A.toTex(u);f[1]&&(E="\\left(".concat(E,"\\right)"));var O;switch(l==="keep"?O=b.getIdentifier():O=b.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return p+"{"+w+"}{"+E+"}";case"OperatorNode:pow":switch(w="{"+w+"}",E="{"+E+"}",O){case"ConditionalNode":case"OperatorNode:divide":w="\\left(".concat(w,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&a==="hide")return w+"~"+E}return w+p+E}else if(s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var M=s.map(function(I,F){return I=I.toTex(u),f[F]&&(I="\\left(".concat(I,"\\right)")),I});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&a==="hide"?M.join("~"):M.join(p)}else return"\\mathrm{"+this.fn+"}\\left("+s.map(function(I){return I.toTex(u)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Fr(i,"name",zw),i},{isClass:!0,isNode:!0});g();y();v();var Uw="ParenthesisNode",Cfe=["Node"],k6=K(Uw,Cfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),!cr(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return Uw}get isParenthesisNode(){return!0}_compile(i,o){return this.content._compile(i,o)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var o=i(this.content,"content",this);return new r(o)}clone(){return new r(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:Uw,content:this.content}}static fromJSON(i){return new r(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'('+this.content.toHTML(i)+')':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\left(".concat(this.content.toTex(i),"\\right)"):this.content.toTex(i)}}return Fr(r,"name",Uw),r},{isClass:!0,isNode:!0});g();y();v();var Hw="RangeNode",Mfe=["Node"],B6=K(Hw,Mfe,e=>{var{Node:t}=e;function r(i,o,u){var l=_r(i,o,u),a={},s=_r(i.start,o,u);if(a.start=s!==null&&s<=l||o==="all",i.step){var f=_r(i.step,o,u);a.step=f!==null&&f<=l||o==="all"}var p=_r(i.end,o,u);return a.end=p!==null&&p<=l||o==="all",a}class n extends t{constructor(o,u,l){if(super(),!cr(o))throw new TypeError("Node expected");if(!cr(u))throw new TypeError("Node expected");if(l&&!cr(l))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=o,this.end=u,this.step=l||null}get type(){return Hw}get isRangeNode(){return!0}needsEnd(){var o=this.filter(function(u){return qr(u)&&u.name==="end"});return o.length>0}_compile(o,u){var l=o.range,a=this.start._compile(o,u),s=this.end._compile(o,u);if(this.step){var f=this.step._compile(o,u);return function(h,x,b){return l(a(h,x,b),s(h,x,b),f(h,x,b))}}else return function(h,x,b){return l(a(h,x,b),s(h,x,b))}}forEach(o){o(this.start,"start",this),o(this.end,"end",this),this.step&&o(this.step,"step",this)}map(o){return new n(this._ifNode(o(this.start,"start",this)),this._ifNode(o(this.end,"end",this)),this.step&&this._ifNode(o(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(o){var u=o&&o.parenthesis?o.parenthesis:"keep",l=r(this,u,o&&o.implicit),a,s=this.start.toString(o);if(l.start&&(s="("+s+")"),a=s,this.step){var f=this.step.toString(o);l.step&&(f="("+f+")"),a+=":"+f}var p=this.end.toString(o);return l.end&&(p="("+p+")"),a+=":"+p,a}toJSON(){return{mathjs:Hw,start:this.start,end:this.end,step:this.step}}static fromJSON(o){return new n(o.start,o.end,o.step)}_toHTML(o){var u=o&&o.parenthesis?o.parenthesis:"keep",l=r(this,u,o&&o.implicit),a,s=this.start.toHTML(o);if(l.start&&(s='('+s+')'),a=s,this.step){var f=this.step.toHTML(o);l.step&&(f='('+f+')'),a+=':'+f}var p=this.end.toHTML(o);return l.end&&(p='('+p+')'),a+=':'+p,a}_toTex(o){var u=o&&o.parenthesis?o.parenthesis:"keep",l=r(this,u,o&&o.implicit),a=this.start.toTex(o);if(l.start&&(a="\\left(".concat(a,"\\right)")),this.step){var s=this.step.toTex(o);l.step&&(s="\\left(".concat(s,"\\right)")),a+=":"+s}var f=this.end.toTex(o);return l.end&&(f="\\left(".concat(f,"\\right)")),a+=":"+f,a}}return Fr(n,"name",Hw),n},{isClass:!0,isNode:!0});g();y();v();var $w="RelationalNode",Tfe=["Node"],L6=K($w,Tfe,e=>{var{Node:t}=e,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends t{constructor(o,u){if(super(),!Array.isArray(o))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(u))throw new TypeError("Parameter params must be an array");if(o.length!==u.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=o,this.params=u}get type(){return $w}get isRelationalNode(){return!0}_compile(o,u){var l=this,a=this.params.map(s=>s._compile(o,u));return function(f,p,h){for(var x,b=a[0](f,p,h),w=0;wo(u,"params["+l+"]",this),this)}map(o){return new n(this.conditionals.slice(),this.params.map((u,l)=>this._ifNode(o(u,"params["+l+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(o){for(var u=o&&o.parenthesis?o.parenthesis:"keep",l=_r(this,u,o&&o.implicit),a=this.params.map(function(p,h){var x=_r(p,u,o&&o.implicit);return u==="all"||x!==null&&x<=l?"("+p.toString(o)+")":p.toString(o)}),s=a[0],f=0;f('+p.toHTML(o)+')':p.toHTML(o)}),s=a[0],f=0;f'+Ci(r[this.conditionals[f]])+""+a[f+1];return s}_toTex(o){for(var u=o&&o.parenthesis?o.parenthesis:"keep",l=_r(this,u,o&&o.implicit),a=this.params.map(function(p,h){var x=_r(p,u,o&&o.implicit);return u==="all"||x!==null&&x<=l?"\\left("+p.toTex(o)+"\right)":p.toTex(o)}),s=a[0],f=0;f{var{math:t,Unit:r,Node:n}=e;function i(u){return r?r.isValuelessUnit(u):!1}class o extends n{constructor(l){if(super(),typeof l!="string")throw new TypeError('String expected for parameter "name"');this.name=l}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(l,a){var s=this.name;if(a[s]===!0)return function(p,h,x){return fn(h,s)};if(s in l)return function(p,h,x){return p.has(s)?p.get(s):fn(l,s)};var f=i(s);return function(p,h,x){return p.has(s)?p.get(s):f?new r(null,s):o.onUndefinedSymbol(s)}}forEach(l){}map(l){return this.clone()}static onUndefinedSymbol(l){throw new Error("Undefined symbol "+l)}clone(){return new o(this.name)}_toString(l){return this.name}_toHTML(l){var a=Ci(this.name);return a==="true"||a==="false"?''+a+"":a==="i"?''+a+"":a==="Infinity"?''+a+"":a==="NaN"?''+a+"":a==="null"?''+a+"":a==="undefined"?''+a+"":''+a+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(l){return new o(l.name)}_toTex(l){var a=!1;typeof t[this.name]>"u"&&i(this.name)&&(a=!0);var s=Bw(this.name,a);return s[0]==="\\"?s:" "+s}}return o},{isClass:!0,isNode:!0});g();y();v();var Ww="FunctionNode",Ffe=["math","Node","SymbolNode"],R6=K(Ww,Ffe,e=>{var t,{math:r,Node:n,SymbolNode:i}=e,o=a=>Kt(a,{truncate:78});function u(a,s,f){for(var p="",h=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,x=0,b;(b=h.exec(a))!==null;)if(p+=a.substring(x,b.index),x=b.index,b[0]==="$$")p+="$",x++;else{x+=b[0].length;var w=s[b[1]];if(!w)throw new ReferenceError("Template: Property "+b[1]+" does not exist.");if(b[2]===void 0)switch(typeof w){case"string":p+=w;break;case"object":if(cr(w))p+=w.toTex(f);else if(Array.isArray(w))p+=w.map(function(A,E){if(cr(A))return A.toTex(f);throw new TypeError("Template: "+b[1]+"["+E+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+b[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+b[1]+" has to be a Node, String or array of Nodes")}else if(cr(w[b[2]]&&w[b[2]]))p+=w[b[2]].toTex(f);else throw new TypeError("Template: "+b[1]+"["+b[2]+"] is not a Node.")}return p+=a.slice(x),p}class l extends n{constructor(s,f){if(super(),typeof s=="string"&&(s=new i(s)),!cr(s))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(f)||!f.every(cr))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=s,this.args=f||[]}get name(){return this.fn.name||""}get type(){return Ww}get isFunctionNode(){return!0}_compile(s,f){var p=this.args.map(R=>R._compile(s,f));if(qr(this.fn)){var h=this.fn.name;if(f[h]){var E=this.args;return function(q,U,H){var V=fn(U,h);if(typeof V!="function")throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(o(V)));if(V.rawArgs)return V(E,s,wp(q,U));var W=p.map(ee=>ee(q,U,H));return V.apply(V,W)}}else{var x=h in s?fn(s,h):void 0,b=typeof x=="function"&&x.rawArgs===!0,w=R=>{var q;if(R.has(h))q=R.get(h);else if(h in s)q=fn(s,h);else return l.onUndefinedFunction(h);if(typeof q=="function")return q;throw new TypeError("'".concat(h,`' is not a function; its value is: +`)}}return Fr(n,"name",Fw),n},{isClass:!0,isNode:!0});g();x();v();var _w="ConditionalNode",vfe=["Node"],N6=K(_w,vfe,e=>{var{Node:t}=e;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(kt(i))return!i.isZero();if(Ni(i))return!!(i.re||i.im);if(ui(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+gr(i)+'"')}class n extends t{constructor(o,u,l){if(super(),!cr(o))throw new TypeError("Parameter condition must be a Node");if(!cr(u))throw new TypeError("Parameter trueExpr must be a Node");if(!cr(l))throw new TypeError("Parameter falseExpr must be a Node");this.condition=o,this.trueExpr=u,this.falseExpr=l}get type(){return _w}get isConditionalNode(){return!0}_compile(o,u){var l=this.condition._compile(o,u),a=this.trueExpr._compile(o,u),s=this.falseExpr._compile(o,u);return function(p,h,y){return r(l(p,h,y))?a(p,h,y):s(p,h,y)}}forEach(o){o(this.condition,"condition",this),o(this.trueExpr,"trueExpr",this),o(this.falseExpr,"falseExpr",this)}map(o){return new n(this._ifNode(o(this.condition,"condition",this)),this._ifNode(o(this.trueExpr,"trueExpr",this)),this._ifNode(o(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(o){var u=o&&o.parenthesis?o.parenthesis:"keep",l=_r(this,u,o&&o.implicit),a=this.condition.toString(o),s=_r(this.condition,u,o&&o.implicit);(u==="all"||this.condition.type==="OperatorNode"||s!==null&&s<=l)&&(a="("+a+")");var f=this.trueExpr.toString(o),p=_r(this.trueExpr,u,o&&o.implicit);(u==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=l)&&(f="("+f+")");var h=this.falseExpr.toString(o),y=_r(this.falseExpr,u,o&&o.implicit);return(u==="all"||this.falseExpr.type==="OperatorNode"||y!==null&&y<=l)&&(h="("+h+")"),a+" ? "+f+" : "+h}toJSON(){return{mathjs:_w,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(o){return new n(o.condition,o.trueExpr,o.falseExpr)}_toHTML(o){var u=o&&o.parenthesis?o.parenthesis:"keep",l=_r(this,u,o&&o.implicit),a=this.condition.toHTML(o),s=_r(this.condition,u,o&&o.implicit);(u==="all"||this.condition.type==="OperatorNode"||s!==null&&s<=l)&&(a='('+a+')');var f=this.trueExpr.toHTML(o),p=_r(this.trueExpr,u,o&&o.implicit);(u==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=l)&&(f='('+f+')');var h=this.falseExpr.toHTML(o),y=_r(this.falseExpr,u,o&&o.implicit);return(u==="all"||this.falseExpr.type==="OperatorNode"||y!==null&&y<=l)&&(h='('+h+')'),a+'?'+f+':'+h}_toTex(o){return"\\begin{cases} {"+this.trueExpr.toTex(o)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(o)+"}\\\\{"+this.falseExpr.toTex(o)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return Fr(n,"name",_w),n},{isClass:!0,isNode:!0});g();x();v();g();x();v();var C6=ln(E6(),1);var FA={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{?}"},Tr={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"},_A={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(Tr.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]}".concat(Tr.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(Tr.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(Tr.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(Tr.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},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]}".concat(Tr.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(Tr.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)".concat(Tr.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]}".concat(Tr.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(Tr.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(Tr.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(Tr.bitAnd,"${args[1]}\\right)")},bitNot:{1:Tr.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(Tr.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(Tr.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(Tr.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(Tr.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(Tr.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]}".concat(Tr.and,"${args[1]}\\right)")},not:{1:Tr.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(Tr.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(Tr.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(Tr.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]}}".concat(Tr.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(Tr.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(Tr.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(Tr.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(Tr.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(Tr.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(Tr.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(Tr.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(Tr.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]}".concat(Tr.to,"${args[1]}\\right)")},numeric:function(t,r){return t.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)+".concat(FA.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)"}},M6="\\mathrm{${name}}\\left(${args}\\right)",A6={deg:"^\\circ"};function kw(e){return(0,C6.default)(e,{preserveFormatting:!0})}function Bw(e,t){return t=typeof t>"u"?!1:t,t?Et(A6,e)?A6[e]:"\\mathrm{"+kw(e)+"}":Et(FA,e)?FA[e]:kw(e)}var Lw="ConstantNode",bfe=["Node"],T6=K(Lw,bfe,e=>{var{Node:t}=e;class r extends t{constructor(i){super(),this.value=i}get type(){return Lw}get isConstantNode(){return!0}_compile(i,o){var u=this.value;return function(){return u}}forEach(i){}map(i){return this.clone()}clone(){return new r(this.value)}_toString(i){return Kt(this.value,i)}_toHTML(i){var o=this._toString(i);switch(gr(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return''+o+"";case"string":return''+o+"";case"boolean":return''+o+"";case"null":return''+o+"";case"undefined":return''+o+"";default:return''+o+""}}toJSON(){return{mathjs:Lw,value:this.value}}static fromJSON(i){return new r(i.value)}_toTex(i){var o=this._toString(i),u=gr(this.value);switch(u){case"string":return"\\mathtt{"+kw(o)+"}";case"number":case"BigNumber":{var l=u==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!l)return this.value.valueOf()<0?"-\\infty":"\\infty";var a=o.toLowerCase().indexOf("e");return a!==-1?o.substring(0,a)+"\\cdot10^{"+o.substring(a+1)+"}":o}case"bigint":return o.toString();case"Fraction":return this.value.toLatex();default:return o}}}return Fr(r,"name",Lw),r},{isClass:!0,isNode:!0});g();x();v();var Pw="FunctionAssignmentNode",Dfe=["typed","Node"],O6=K(Pw,Dfe,e=>{var{typed:t,Node:r}=e;function n(o,u,l){var a=_r(o,u,l),s=_r(o.expr,u,l);return u==="all"||s!==null&&s<=a}class i extends r{constructor(u,l,a){if(super(),typeof u!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(l))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!cr(a))throw new TypeError('Node expected for parameter "expr"');if(Ew.has(u))throw new Error('Illegal function name, "'+u+'" is a reserved keyword');var s=new Set;for(var f of l){var p=typeof f=="string"?f:f.name;if(s.has(p))throw new Error('Duplicate parameter name "'.concat(p,'"'));s.add(p)}this.name=u,this.params=l.map(function(h){return h&&h.name||h}),this.types=l.map(function(h){return h&&h.type||"any"}),this.expr=a}get type(){return Pw}get isFunctionAssignmentNode(){return!0}_compile(u,l){var a=Object.create(l);Ff(this.params,function(b){a[b]=!0});var s=this.expr._compile(u,a),f=this.name,p=this.params,h=ME(this.types,","),y=f+"("+ME(this.params,", ")+")";return function(w,A,S){var O={};O[h]=function(){for(var I=Object.create(A),F=0;F'+Ci(this.params[s])+"");var f=this.expr.toHTML(u);return n(this,l,u&&u.implicit)&&(f='('+f+')'),''+Ci(this.name)+'('+a.join(',')+')='+f}_toTex(u){var l=u&&u.parenthesis?u.parenthesis:"keep",a=this.expr.toTex(u);return n(this,l,u&&u.implicit)&&(a="\\left(".concat(a,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(Bw).join(",")+"\\right)="+a}}return Fr(i,"name",Pw),i},{isClass:!0,isNode:!0});g();x();v();var Rw="IndexNode",Nfe=["Node","size"],I6=K(Rw,Nfe,e=>{var{Node:t,size:r}=e;class n extends t{constructor(o,u){if(super(),this.dimensions=o,this.dotNotation=u||!1,!Array.isArray(o)||!o.every(cr))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 Rw}get isIndexNode(){return!0}_compile(o,u){var l=Yo(this.dimensions,function(s,f){var p=s.filter(b=>b.isSymbolNode&&b.name==="end").length>0;if(p){var h=Object.create(u);h.end=!0;var y=s._compile(o,h);return function(w,A,S){if(!St(S)&&!pr(S)&&!gn(S))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+gr(S));var O=r(S).valueOf(),M=Object.create(A);return M.end=O[f],y(w,M,S)}}else return s._compile(o,u)}),a=fn(o,"index");return function(f,p,h){var y=Yo(l,function(b){return b(f,p,h)});return a(...y)}}forEach(o){for(var u=0;u.'+Ci(this.getObjectProperty())+"":'['+u.join(',')+']'}_toTex(o){var u=this.dimensions.map(function(l){return l.toTex(o)});return this.dotNotation?"."+this.getObjectProperty():"_{"+u.join(",")+"}"}}return Fr(n,"name",Rw),n},{isClass:!0,isNode:!0});g();x();v();var qw="ObjectNode",Sfe=["Node"],F6=K(qw,Sfe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(o){return cr(i[o])})))throw new TypeError("Object containing Nodes expected")}get type(){return qw}get isObjectNode(){return!0}_compile(i,o){var u={};for(var l in this.properties)if(Et(this.properties,l)){var a=hp(l),s=JSON.parse(a),f=fn(this.properties,l);u[s]=f._compile(i,o)}return function(h,y,b){var w={};for(var A in u)Et(u,A)&&(w[A]=u[A](h,y,b));return w}}forEach(i){for(var o in this.properties)Et(this.properties,o)&&i(this.properties[o],"properties["+hp(o)+"]",this)}map(i){var o={};for(var u in this.properties)Et(this.properties,u)&&(o[u]=this._ifNode(i(this.properties[u],"properties["+hp(u)+"]",this)));return new r(o)}clone(){var i={};for(var o in this.properties)Et(this.properties,o)&&(i[o]=this.properties[o]);return new r(i)}_toString(i){var o=[];for(var u in this.properties)Et(this.properties,u)&&o.push(hp(u)+": "+this.properties[u].toString(i));return"{"+o.join(", ")+"}"}toJSON(){return{mathjs:qw,properties:this.properties}}static fromJSON(i){return new r(i.properties)}_toHTML(i){var o=[];for(var u in this.properties)Et(this.properties,u)&&o.push(''+Ci(u)+':'+this.properties[u].toHTML(i));return'{'+o.join(',')+'}'}_toTex(i){var o=[];for(var u in this.properties)Et(this.properties,u)&&o.push("\\mathbf{"+u+":} & "+this.properties[u].toTex(i)+"\\\\");var l="\\left\\{\\begin{array}{ll}"+o.join(` +`)+"\\end{array}\\right\\}";return l}}return Fr(r,"name",qw),r},{isClass:!0,isNode:!0});g();x();v();g();x();v();function wp(e,t){return new ph(e,new pp(t),new Set(Object.keys(t)))}var zw="OperatorNode",Efe=["Node"],_6=K(zw,Efe,e=>{var{Node:t}=e;function r(o,u){var l=o;if(u==="auto")for(;Ei(l);)l=l.content;return or(l)?!0:Xr(l)?r(l.args[0],u):!1}function n(o,u,l,a,s){var f=_r(o,u,l),p=Oh(o,u);if(u==="all"||a.length>2&&o.getIdentifier()!=="OperatorNode:add"&&o.getIdentifier()!=="OperatorNode:multiply")return a.map(function(U){switch(U.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var h;switch(a.length){case 0:h=[];break;case 1:{var y=_r(a[0],u,l,o);if(s&&y!==null){var b,w;if(u==="keep"?(b=a[0].getIdentifier(),w=o.getIdentifier()):(b=a[0].getContent().getIdentifier(),w=o.getContent().getIdentifier()),Xa[f][w].latexLeftParens===!1){h=[!1];break}if(Xa[y][b].latexParens===!1){h=[!1];break}}if(y===null){h=[!1];break}if(y<=f){h=[!0];break}h=[!1]}break;case 2:{var A,S=_r(a[0],u,l,o),O=Ow(o,a[0],u);S===null?A=!1:S===f&&p==="right"&&!O||S=2&&o.getIdentifier()==="OperatorNode:multiply"&&o.implicit&&u!=="all"&&l==="hide")for(var q=1;q2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var A=s.map(function(S,O){return S=S.toString(u),f[O]&&(S="("+S+")"),S});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?A.join(" "):A.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:zw,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(u){return new i(u.op,u.fn,u.args,u.implicit,u.isPercentage)}_toHTML(u){var l=u&&u.parenthesis?u.parenthesis:"keep",a=u&&u.implicit?u.implicit:"hide",s=this.args,f=n(this,l,a,s,!1);if(s.length===1){var p=Oh(this,l),h=s[0].toHTML(u);return f[0]&&(h='('+h+')'),p==="right"?''+Ci(this.op)+""+h:h+''+Ci(this.op)+""}else if(s.length===2){var y=s[0].toHTML(u),b=s[1].toHTML(u);return f[0]&&(y='('+y+')'),f[1]&&(b='('+b+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?y+''+b:y+''+Ci(this.op)+""+b}else{var w=s.map(function(A,S){return A=A.toHTML(u),f[S]&&(A='('+A+')'),A});return s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&a==="hide"?w.join(''):w.join(''+Ci(this.op)+""):''+Ci(this.fn)+'('+w.join(',')+')'}}_toTex(u){var l=u&&u.parenthesis?u.parenthesis:"keep",a=u&&u.implicit?u.implicit:"hide",s=this.args,f=n(this,l,a,s,!0),p=Tr[this.fn];if(p=typeof p>"u"?this.op:p,s.length===1){var h=Oh(this,l),y=s[0].toTex(u);return f[0]&&(y="\\left(".concat(y,"\\right)")),h==="right"?p+y:y+p}else if(s.length===2){var b=s[0],w=b.toTex(u);f[0]&&(w="\\left(".concat(w,"\\right)"));var A=s[1],S=A.toTex(u);f[1]&&(S="\\left(".concat(S,"\\right)"));var O;switch(l==="keep"?O=b.getIdentifier():O=b.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return p+"{"+w+"}{"+S+"}";case"OperatorNode:pow":switch(w="{"+w+"}",S="{"+S+"}",O){case"ConditionalNode":case"OperatorNode:divide":w="\\left(".concat(w,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&a==="hide")return w+"~"+S}return w+p+S}else if(s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var M=s.map(function(I,F){return I=I.toTex(u),f[F]&&(I="\\left(".concat(I,"\\right)")),I});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&a==="hide"?M.join("~"):M.join(p)}else return"\\mathrm{"+this.fn+"}\\left("+s.map(function(I){return I.toTex(u)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Fr(i,"name",zw),i},{isClass:!0,isNode:!0});g();x();v();var Uw="ParenthesisNode",Afe=["Node"],k6=K(Uw,Afe,e=>{var{Node:t}=e;class r extends t{constructor(i){if(super(),!cr(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return Uw}get isParenthesisNode(){return!0}_compile(i,o){return this.content._compile(i,o)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var o=i(this.content,"content",this);return new r(o)}clone(){return new r(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:Uw,content:this.content}}static fromJSON(i){return new r(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'('+this.content.toHTML(i)+')':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\left(".concat(this.content.toTex(i),"\\right)"):this.content.toTex(i)}}return Fr(r,"name",Uw),r},{isClass:!0,isNode:!0});g();x();v();var Hw="RangeNode",Cfe=["Node"],B6=K(Hw,Cfe,e=>{var{Node:t}=e;function r(i,o,u){var l=_r(i,o,u),a={},s=_r(i.start,o,u);if(a.start=s!==null&&s<=l||o==="all",i.step){var f=_r(i.step,o,u);a.step=f!==null&&f<=l||o==="all"}var p=_r(i.end,o,u);return a.end=p!==null&&p<=l||o==="all",a}class n extends t{constructor(o,u,l){if(super(),!cr(o))throw new TypeError("Node expected");if(!cr(u))throw new TypeError("Node expected");if(l&&!cr(l))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=o,this.end=u,this.step=l||null}get type(){return Hw}get isRangeNode(){return!0}needsEnd(){var o=this.filter(function(u){return qr(u)&&u.name==="end"});return o.length>0}_compile(o,u){var l=o.range,a=this.start._compile(o,u),s=this.end._compile(o,u);if(this.step){var f=this.step._compile(o,u);return function(h,y,b){return l(a(h,y,b),s(h,y,b),f(h,y,b))}}else return function(h,y,b){return l(a(h,y,b),s(h,y,b))}}forEach(o){o(this.start,"start",this),o(this.end,"end",this),this.step&&o(this.step,"step",this)}map(o){return new n(this._ifNode(o(this.start,"start",this)),this._ifNode(o(this.end,"end",this)),this.step&&this._ifNode(o(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(o){var u=o&&o.parenthesis?o.parenthesis:"keep",l=r(this,u,o&&o.implicit),a,s=this.start.toString(o);if(l.start&&(s="("+s+")"),a=s,this.step){var f=this.step.toString(o);l.step&&(f="("+f+")"),a+=":"+f}var p=this.end.toString(o);return l.end&&(p="("+p+")"),a+=":"+p,a}toJSON(){return{mathjs:Hw,start:this.start,end:this.end,step:this.step}}static fromJSON(o){return new n(o.start,o.end,o.step)}_toHTML(o){var u=o&&o.parenthesis?o.parenthesis:"keep",l=r(this,u,o&&o.implicit),a,s=this.start.toHTML(o);if(l.start&&(s='('+s+')'),a=s,this.step){var f=this.step.toHTML(o);l.step&&(f='('+f+')'),a+=':'+f}var p=this.end.toHTML(o);return l.end&&(p='('+p+')'),a+=':'+p,a}_toTex(o){var u=o&&o.parenthesis?o.parenthesis:"keep",l=r(this,u,o&&o.implicit),a=this.start.toTex(o);if(l.start&&(a="\\left(".concat(a,"\\right)")),this.step){var s=this.step.toTex(o);l.step&&(s="\\left(".concat(s,"\\right)")),a+=":"+s}var f=this.end.toTex(o);return l.end&&(f="\\left(".concat(f,"\\right)")),a+=":"+f,a}}return Fr(n,"name",Hw),n},{isClass:!0,isNode:!0});g();x();v();var $w="RelationalNode",Mfe=["Node"],L6=K($w,Mfe,e=>{var{Node:t}=e,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends t{constructor(o,u){if(super(),!Array.isArray(o))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(u))throw new TypeError("Parameter params must be an array");if(o.length!==u.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=o,this.params=u}get type(){return $w}get isRelationalNode(){return!0}_compile(o,u){var l=this,a=this.params.map(s=>s._compile(o,u));return function(f,p,h){for(var y,b=a[0](f,p,h),w=0;wo(u,"params["+l+"]",this),this)}map(o){return new n(this.conditionals.slice(),this.params.map((u,l)=>this._ifNode(o(u,"params["+l+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(o){for(var u=o&&o.parenthesis?o.parenthesis:"keep",l=_r(this,u,o&&o.implicit),a=this.params.map(function(p,h){var y=_r(p,u,o&&o.implicit);return u==="all"||y!==null&&y<=l?"("+p.toString(o)+")":p.toString(o)}),s=a[0],f=0;f('+p.toHTML(o)+')':p.toHTML(o)}),s=a[0],f=0;f'+Ci(r[this.conditionals[f]])+""+a[f+1];return s}_toTex(o){for(var u=o&&o.parenthesis?o.parenthesis:"keep",l=_r(this,u,o&&o.implicit),a=this.params.map(function(p,h){var y=_r(p,u,o&&o.implicit);return u==="all"||y!==null&&y<=l?"\\left("+p.toTex(o)+"\right)":p.toTex(o)}),s=a[0],f=0;f{var{math:t,Unit:r,Node:n}=e;function i(u){return r?r.isValuelessUnit(u):!1}class o extends n{constructor(l){if(super(),typeof l!="string")throw new TypeError('String expected for parameter "name"');this.name=l}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(l,a){var s=this.name;if(a[s]===!0)return function(p,h,y){return fn(h,s)};if(s in l)return function(p,h,y){return p.has(s)?p.get(s):fn(l,s)};var f=i(s);return function(p,h,y){return p.has(s)?p.get(s):f?new r(null,s):o.onUndefinedSymbol(s)}}forEach(l){}map(l){return this.clone()}static onUndefinedSymbol(l){throw new Error("Undefined symbol "+l)}clone(){return new o(this.name)}_toString(l){return this.name}_toHTML(l){var a=Ci(this.name);return a==="true"||a==="false"?''+a+"":a==="i"?''+a+"":a==="Infinity"?''+a+"":a==="NaN"?''+a+"":a==="null"?''+a+"":a==="undefined"?''+a+"":''+a+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(l){return new o(l.name)}_toTex(l){var a=!1;typeof t[this.name]>"u"&&i(this.name)&&(a=!0);var s=Bw(this.name,a);return s[0]==="\\"?s:" "+s}}return o},{isClass:!0,isNode:!0});g();x();v();var Ww="FunctionNode",Ife=["math","Node","SymbolNode"],R6=K(Ww,Ife,e=>{var t,{math:r,Node:n,SymbolNode:i}=e,o=a=>Kt(a,{truncate:78});function u(a,s,f){for(var p="",h=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,y=0,b;(b=h.exec(a))!==null;)if(p+=a.substring(y,b.index),y=b.index,b[0]==="$$")p+="$",y++;else{y+=b[0].length;var w=s[b[1]];if(!w)throw new ReferenceError("Template: Property "+b[1]+" does not exist.");if(b[2]===void 0)switch(typeof w){case"string":p+=w;break;case"object":if(cr(w))p+=w.toTex(f);else if(Array.isArray(w))p+=w.map(function(A,S){if(cr(A))return A.toTex(f);throw new TypeError("Template: "+b[1]+"["+S+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+b[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+b[1]+" has to be a Node, String or array of Nodes")}else if(cr(w[b[2]]&&w[b[2]]))p+=w[b[2]].toTex(f);else throw new TypeError("Template: "+b[1]+"["+b[2]+"] is not a Node.")}return p+=a.slice(y),p}class l extends n{constructor(s,f){if(super(),typeof s=="string"&&(s=new i(s)),!cr(s))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(f)||!f.every(cr))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=s,this.args=f||[]}get name(){return this.fn.name||""}get type(){return Ww}get isFunctionNode(){return!0}_compile(s,f){var p=this.args.map(R=>R._compile(s,f));if(qr(this.fn)){var h=this.fn.name;if(f[h]){var S=this.args;return function(q,U,H){var V=fn(U,h);if(typeof V!="function")throw new TypeError("Argument '".concat(h,"' was not a function; received: ").concat(o(V)));if(V.rawArgs)return V(S,s,wp(q,U));var W=p.map(ee=>ee(q,U,H));return V.apply(V,W)}}else{var y=h in s?fn(s,h):void 0,b=typeof y=="function"&&y.rawArgs===!0,w=R=>{var q;if(R.has(h))q=R.get(h);else if(h in s)q=fn(s,h);else return l.onUndefinedFunction(h);if(typeof q=="function")return q;throw new TypeError("'".concat(h,`' is not a function; its value is: `).concat(o(q)))};if(b){var A=this.args;return function(q,U,H){var V=w(q);return V(A,s,wp(q,U))}}else switch(p.length){case 0:return function(q,U,H){var V=w(q);return V()};case 1:return function(q,U,H){var V=w(q),W=p[0];return V(W(q,U,H))};case 2:return function(q,U,H){var V=w(q),W=p[0],ee=p[1];return V(W(q,U,H),ee(q,U,H))};default:return function(q,U,H){var V=w(q),W=p.map(ee=>ee(q,U,H));return V(...W)}}}}else if(Fo(this.fn)&&Vo(this.fn.index)&&this.fn.index.isObjectProperty()){var O=this.fn.object._compile(s,f),M=this.fn.index.getObjectProperty(),I=this.args;return function(q,U,H){var V=O(q,U,H),W=uF(V,M);if(W!=null&&W.rawArgs)return W(I,s,wp(q,U));var ee=p.map(ie=>ie(q,U,H));return W.apply(V,ee)}}else{var F=this.fn.toString(),C=this.fn._compile(s,f),P=this.args;return function(q,U,H){var V=C(q,U,H);if(typeof V!="function")throw new TypeError("Expression '".concat(F,"' did not evaluate to a function; value is:")+` - `.concat(o(V)));if(V.rawArgs)return V(P,s,wp(q,U));var W=p.map(ee=>ee(q,U,H));return V.apply(V,W)}}}forEach(s){s(this.fn,"fn",this);for(var f=0;f'+Ci(this.fn)+'('+f.join(',')+')'}toTex(s){var f;return s&&typeof s.handler=="object"&&St(s.handler,this.name)&&(f=s.handler[this.name](this,s)),typeof f<"u"?f:super.toTex(s)}_toTex(s){var f=this.args.map(function(x){return x.toTex(s)}),p;_A[this.name]&&(p=_A[this.name]),r[this.name]&&(typeof r[this.name].toTex=="function"||typeof r[this.name].toTex=="object"||typeof r[this.name].toTex=="string")&&(p=r[this.name].toTex);var h;switch(typeof p){case"function":h=p(this,s);break;case"string":h=u(p,this,s);break;case"object":switch(typeof p[f.length]){case"function":h=p[f.length](this,s);break;case"string":h=u(p[f.length],this,s);break}}return typeof h<"u"?h:u(M6,this,s)}getIdentifier(){return this.type+":"+this.name}}return t=l,Fr(l,"name",Ww),Fr(l,"onUndefinedFunction",function(a){throw new Error("Undefined function "+a)}),Fr(l,"fromJSON",function(a){return new t(a.fn,a.args)}),l},{isClass:!0,isNode:!0});g();y();v();var q6="parse",_fe=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],z6=K(q6,_fe,e=>{var{typed:t,numeric:r,config:n,AccessorNode:i,ArrayNode:o,AssignmentNode:u,BlockNode:l,ConditionalNode:a,ConstantNode:s,FunctionAssignmentNode:f,FunctionNode:p,IndexNode:h,ObjectNode:x,OperatorNode:b,ParenthesisNode:w,RangeNode:A,RelationalNode:E,SymbolNode:O}=e,M=t(q6,{string:function(ye){return De(ye,{})},"Array | Matrix":function(ye){return I(ye,{})},"string, Object":function(ye,Ye){var je=Ye.nodes!==void 0?Ye.nodes:{};return De(ye,je)},"Array | Matrix, Object":I});function I(X){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ye=ye.nodes!==void 0?ye.nodes:{};return Ct(X,function(je){if(typeof je!="string")throw new TypeError("String expected");return De(je,Ye)})}var F={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},C={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},P={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},R={true:!0,false:!1,null:null,undefined:void 0},q=["NaN","Infinity"],U={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:` -`,r:"\r",t:" "};function H(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:F.NULL,nestingLevel:0,conditionalLevel:null}}function V(X,ye){return X.expression.substr(X.index,ye)}function W(X){return V(X,1)}function ee(X){X.index++}function ie(X){return X.expression.charAt(X.index-1)}function Y(X){return X.expression.charAt(X.index+1)}function Z(X){for(X.tokenType=F.NULL,X.token="",X.comment="";;){if(W(X)==="#")for(;W(X)!==` + `.concat(o(V)));if(V.rawArgs)return V(P,s,wp(q,U));var W=p.map(ee=>ee(q,U,H));return V.apply(V,W)}}}forEach(s){s(this.fn,"fn",this);for(var f=0;f'+Ci(this.fn)+'('+f.join(',')+')'}toTex(s){var f;return s&&typeof s.handler=="object"&&Et(s.handler,this.name)&&(f=s.handler[this.name](this,s)),typeof f<"u"?f:super.toTex(s)}_toTex(s){var f=this.args.map(function(y){return y.toTex(s)}),p;_A[this.name]&&(p=_A[this.name]),r[this.name]&&(typeof r[this.name].toTex=="function"||typeof r[this.name].toTex=="object"||typeof r[this.name].toTex=="string")&&(p=r[this.name].toTex);var h;switch(typeof p){case"function":h=p(this,s);break;case"string":h=u(p,this,s);break;case"object":switch(typeof p[f.length]){case"function":h=p[f.length](this,s);break;case"string":h=u(p[f.length],this,s);break}}return typeof h<"u"?h:u(M6,this,s)}getIdentifier(){return this.type+":"+this.name}}return t=l,Fr(l,"name",Ww),Fr(l,"onUndefinedFunction",function(a){throw new Error("Undefined function "+a)}),Fr(l,"fromJSON",function(a){return new t(a.fn,a.args)}),l},{isClass:!0,isNode:!0});g();x();v();var q6="parse",Ffe=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],z6=K(q6,Ffe,e=>{var{typed:t,numeric:r,config:n,AccessorNode:i,ArrayNode:o,AssignmentNode:u,BlockNode:l,ConditionalNode:a,ConstantNode:s,FunctionAssignmentNode:f,FunctionNode:p,IndexNode:h,ObjectNode:y,OperatorNode:b,ParenthesisNode:w,RangeNode:A,RelationalNode:S,SymbolNode:O}=e,M=t(q6,{string:function(xe){return De(xe,{})},"Array | Matrix":function(xe){return I(xe,{})},"string, Object":function(xe,Ye){var je=Ye.nodes!==void 0?Ye.nodes:{};return De(xe,je)},"Array | Matrix, Object":I});function I(X){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ye=xe.nodes!==void 0?xe.nodes:{};return Ct(X,function(je){if(typeof je!="string")throw new TypeError("String expected");return De(je,Ye)})}var F={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},C={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},P={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},R={true:!0,false:!1,null:null,undefined:void 0},q=["NaN","Infinity"],U={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:` +`,r:"\r",t:" "};function H(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:F.NULL,nestingLevel:0,conditionalLevel:null}}function V(X,xe){return X.expression.substr(X.index,xe)}function W(X){return V(X,1)}function ee(X){X.index++}function ie(X){return X.expression.charAt(X.index-1)}function Y(X){return X.expression.charAt(X.index+1)}function Z(X){for(X.tokenType=F.NULL,X.token="",X.comment="";;){if(W(X)==="#")for(;W(X)!==` `&&W(X)!=="";)X.comment+=W(X),ee(X);if(M.isWhitespace(W(X),X.nestingLevel))ee(X);else break}if(W(X)===""){X.tokenType=F.DELIMITER;return}if(W(X)===` -`&&!X.nestingLevel){X.tokenType=F.DELIMITER,X.token=W(X),ee(X);return}var ye=W(X),Ye=V(X,2),je=V(X,3);if(je.length===3&&C[je]){X.tokenType=F.DELIMITER,X.token=je,ee(X),ee(X),ee(X);return}if(Ye.length===2&&C[Ye]){X.tokenType=F.DELIMITER,X.token=Ye,ee(X),ee(X);return}if(C[ye]){X.tokenType=F.DELIMITER,X.token=ye,ee(X);return}if(M.isDigitDot(ye)){X.tokenType=F.NUMBER;var wt=V(X,2);if(wt==="0b"||wt==="0o"||wt==="0x"){for(X.token+=W(X),ee(X),X.token+=W(X),ee(X);M.isHexDigit(W(X));)X.token+=W(X),ee(X);if(W(X)===".")for(X.token+=".",ee(X);M.isHexDigit(W(X));)X.token+=W(X),ee(X);else if(W(X)==="i")for(X.token+="i",ee(X);M.isDigit(W(X));)X.token+=W(X),ee(X);return}if(W(X)==="."){if(X.token+=W(X),ee(X),!M.isDigit(W(X))){X.tokenType=F.DELIMITER;return}}else{for(;M.isDigit(W(X));)X.token+=W(X),ee(X);M.isDecimalMark(W(X),Y(X))&&(X.token+=W(X),ee(X))}for(;M.isDigit(W(X));)X.token+=W(X),ee(X);if(W(X)==="E"||W(X)==="e"){if(M.isDigit(Y(X))||Y(X)==="-"||Y(X)==="+"){if(X.token+=W(X),ee(X),(W(X)==="+"||W(X)==="-")&&(X.token+=W(X),ee(X)),!M.isDigit(W(X)))throw Xe(X,'Digit expected, got "'+W(X)+'"');for(;M.isDigit(W(X));)X.token+=W(X),ee(X);if(M.isDecimalMark(W(X),Y(X)))throw Xe(X,'Digit expected, got "'+W(X)+'"')}else if(Y(X)===".")throw ee(X),Xe(X,'Digit expected, got "'+W(X)+'"')}return}if(M.isAlpha(W(X),ie(X),Y(X))){for(;M.isAlpha(W(X),ie(X),Y(X))||M.isDigit(W(X));)X.token+=W(X),ee(X);St(P,X.token)?X.tokenType=F.DELIMITER:X.tokenType=F.SYMBOL;return}for(X.tokenType=F.UNKNOWN;W(X)!=="";)X.token+=W(X),ee(X);throw Xe(X,'Syntax error in part "'+X.token+'"')}function le(X){do Z(X);while(X.token===` -`)}function re(X){X.nestingLevel++}function he(X){X.nestingLevel--}M.isAlpha=function(ye,Ye,je){return M.isValidLatinOrGreek(ye)||M.isValidMathSymbol(ye,je)||M.isValidMathSymbol(Ye,ye)},M.isValidLatinOrGreek=function(ye){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(ye)},M.isValidMathSymbol=function(ye,Ye){return/^[\uD835]$/.test(ye)&&/^[\uDC00-\uDFFF]$/.test(Ye)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(Ye)},M.isWhitespace=function(ye,Ye){return ye===" "||ye===" "||ye===` -`&&Ye>0},M.isDecimalMark=function(ye,Ye){return ye==="."&&Ye!=="/"&&Ye!=="*"&&Ye!=="^"},M.isDigitDot=function(ye){return ye>="0"&&ye<="9"||ye==="."},M.isDigit=function(ye){return ye>="0"&&ye<="9"},M.isHexDigit=function(ye){return ye>="0"&&ye<="9"||ye>="a"&&ye<="f"||ye>="A"&&ye<="F"};function De(X,ye){var Ye=H();Jn(Ye,{expression:X,extraNodes:ye}),Z(Ye);var je=we(Ye);if(Ye.token!=="")throw Ye.tokenType===F.DELIMITER?pt(Ye,"Unexpected operator "+Ye.token):Xe(Ye,'Unexpected part "'+Ye.token+'"');return je}function we(X){var ye,Ye=[],je;for(X.token!==""&&X.token!==` -`&&X.token!==";"&&(ye=ce(X),X.comment&&(ye.comment=X.comment));X.token===` -`||X.token===";";)Ye.length===0&&ye&&(je=X.token!==";",Ye.push({node:ye,visible:je})),Z(X),X.token!==` -`&&X.token!==";"&&X.token!==""&&(ye=ce(X),X.comment&&(ye.comment=X.comment),je=X.token!==";",Ye.push({node:ye,visible:je}));return Ye.length>0?new l(Ye):(ye||(ye=new s(void 0),X.comment&&(ye.comment=X.comment)),ye)}function ce(X){var ye,Ye,je,wt,Bt=Ee(X);if(X.token==="="){if(qr(Bt))return ye=Bt.name,le(X),je=ce(X),new u(new O(ye),je);if(Fo(Bt))return le(X),je=ce(X),new u(Bt.object,Bt.index,je);if(eo(Bt)&&qr(Bt.fn)&&(wt=!0,Ye=[],ye=Bt.name,Bt.args.forEach(function(fr,Gr){qr(fr)?Ye[Gr]=fr.name:wt=!1}),wt))return le(X),je=ce(X),new f(ye,Ye,je);throw Xe(X,"Invalid left hand side of assignment operator =")}return Bt}function Ee(X){for(var ye=Pe(X);X.token==="?";){var Ye=X.conditionalLevel;X.conditionalLevel=X.nestingLevel,le(X);var je=ye,wt=ce(X);if(X.token!==":")throw Xe(X,"False part of conditional expression expected");X.conditionalLevel=null,le(X);var Bt=ce(X);ye=new a(je,wt,Bt),X.conditionalLevel=Ye}return ye}function Pe(X){for(var ye=Ce(X);X.token==="or";)le(X),ye=new b("or","or",[ye,Ce(X)]);return ye}function Ce(X){for(var ye=Oe(X);X.token==="xor";)le(X),ye=new b("xor","xor",[ye,Oe(X)]);return ye}function Oe(X){for(var ye=He(X);X.token==="and";)le(X),ye=new b("and","and",[ye,He(X)]);return ye}function He(X){for(var ye=Se(X);X.token==="|";)le(X),ye=new b("|","bitOr",[ye,Se(X)]);return ye}function Se(X){for(var ye=ze(X);X.token==="^|";)le(X),ye=new b("^|","bitXor",[ye,ze(X)]);return ye}function ze(X){for(var ye=We(X);X.token==="&";)le(X),ye=new b("&","bitAnd",[ye,We(X)]);return ye}function We(X){for(var ye=[Le(X)],Ye=[],je={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};St(je,X.token);){var wt={name:X.token,fn:je[X.token]};Ye.push(wt),le(X),ye.push(Le(X))}return ye.length===1?ye[0]:ye.length===2?new b(Ye[0].name,Ye[0].fn,ye):new E(Ye.map(Bt=>Bt.fn),ye)}function Le(X){var ye,Ye,je,wt;ye=lt(X);for(var Bt={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};St(Bt,X.token);)Ye=X.token,je=Bt[Ye],le(X),wt=[ye,lt(X)],ye=new b(Ye,je,wt);return ye}function lt(X){var ye,Ye,je,wt;ye=ct(X);for(var Bt={to:"to",in:"to"};St(Bt,X.token);)Ye=X.token,je=Bt[Ye],le(X),Ye==="in"&&X.token===""?ye=new b("*","multiply",[ye,new O("in")],!0):(wt=[ye,ct(X)],ye=new b(Ye,je,wt));return ye}function ct(X){var ye,Ye=[];if(X.token===":"?ye=new s(1):ye=de(X),X.token===":"&&X.conditionalLevel!==X.nestingLevel){for(Ye.push(ye);X.token===":"&&Ye.length<3;)le(X),X.token===")"||X.token==="]"||X.token===","||X.token===""?Ye.push(new O("end")):Ye.push(de(X));Ye.length===3?ye=new A(Ye[0],Ye[2],Ye[1]):ye=new A(Ye[0],Ye[1])}return ye}function de(X){var ye,Ye,je,wt;ye=be(X);for(var Bt={"+":"add","-":"subtract"};St(Bt,X.token);){Ye=X.token,je=Bt[Ye],le(X);var fr=be(X);fr.isPercentage?wt=[ye,new b("*","multiply",[ye,fr])]:wt=[ye,fr],ye=new b(Ye,je,wt)}return ye}function be(X){var ye,Ye,je,wt;ye=Ue(X),Ye=ye;for(var Bt={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};St(Bt,X.token);)je=X.token,wt=Bt[je],le(X),Ye=Ue(X),ye=new b(je,wt,[ye,Ye]);return ye}function Ue(X){var ye,Ye;for(ye=ge(X),Ye=ye;X.tokenType===F.SYMBOL||X.token==="in"&&or(ye)||X.tokenType===F.NUMBER&&!or(Ye)&&(!Xr(Ye)||Ye.op==="!")||X.token==="(";)Ye=ge(X),ye=new b("*","multiply",[ye,Ye],!0);return ye}function ge(X){for(var ye=Re(X),Ye=ye,je=[];X.token==="/"&&wv(Ye);)if(je.push(Jn({},X)),le(X),X.tokenType===F.NUMBER)if(je.push(Jn({},X)),le(X),X.tokenType===F.SYMBOL||X.token==="(")Jn(X,je.pop()),je.pop(),Ye=Re(X),ye=new b("/","divide",[ye,Ye]);else{je.pop(),Jn(X,je.pop());break}else{Jn(X,je.pop());break}return ye}function Re(X){var ye,Ye,je,wt;ye=Be(X);for(var Bt={"%":"mod",mod:"mod"};St(Bt,X.token);)Ye=X.token,je=Bt[Ye],le(X),Ye==="%"&&X.tokenType===F.DELIMITER&&X.token!=="("?ye=new b("/","divide",[ye,new s(100)],!1,!0):(wt=[ye,Be(X)],ye=new b(Ye,je,wt));return ye}function Be(X){var ye,Ye,je,wt={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return St(wt,X.token)?(je=wt[X.token],ye=X.token,le(X),Ye=[Be(X)],new b(ye,je,Ye)):Ke(X)}function Ke(X){var ye,Ye,je,wt;return ye=ot(X),(X.token==="^"||X.token===".^")&&(Ye=X.token,je=Ye==="^"?"pow":"dotPow",le(X),wt=[ye,Be(X)],ye=new b(Ye,je,wt)),ye}function ot(X){var ye,Ye,je,wt;ye=Qe(X);for(var Bt={"!":"factorial","'":"ctranspose"};St(Bt,X.token);)Ye=X.token,je=Bt[Ye],Z(X),wt=[ye],ye=new b(Ye,je,wt),ye=Pt(X,ye);return ye}function Qe(X){var ye=[];if(X.tokenType===F.SYMBOL&&St(X.extraNodes,X.token)){var Ye=X.extraNodes[X.token];if(Z(X),X.token==="("){if(ye=[],re(X),Z(X),X.token!==")")for(ye.push(ce(X));X.token===",";)Z(X),ye.push(ce(X));if(X.token!==")")throw Xe(X,"Parenthesis ) expected");he(X),Z(X)}return new Ye(ye)}return ut(X)}function ut(X){var ye,Ye;return X.tokenType===F.SYMBOL||X.tokenType===F.DELIMITER&&X.token in P?(Ye=X.token,Z(X),St(R,Ye)?ye=new s(R[Ye]):q.includes(Ye)?ye=new s(r(Ye,"number")):ye=new O(Ye),ye=Pt(X,ye),ye):fe(X)}function Pt(X,ye,Ye){for(var je;(X.token==="("||X.token==="["||X.token===".")&&(!Ye||Ye.includes(X.token));)if(je=[],X.token==="(")if(qr(ye)||Fo(ye)){if(re(X),Z(X),X.token!==")")for(je.push(ce(X));X.token===",";)Z(X),je.push(ce(X));if(X.token!==")")throw Xe(X,"Parenthesis ) expected");he(X),Z(X),ye=new p(ye,je)}else return ye;else if(X.token==="["){if(re(X),Z(X),X.token!=="]")for(je.push(ce(X));X.token===",";)Z(X),je.push(ce(X));if(X.token!=="]")throw Xe(X,"Parenthesis ] expected");he(X),Z(X),ye=new i(ye,new h(je))}else{Z(X);var wt=X.tokenType===F.SYMBOL||X.tokenType===F.DELIMITER&&X.token in P;if(!wt)throw Xe(X,"Property name expected after dot");je.push(new s(X.token)),Z(X);var Bt=!0;ye=new i(ye,new h(je,Bt))}return ye}function fe(X){var ye,Ye;return X.token==='"'||X.token==="'"?(Ye=J(X,X.token),ye=new s(Ye),ye=Pt(X,ye),ye):j(X)}function J(X,ye){for(var Ye="";W(X)!==""&&W(X)!==ye;)if(W(X)==="\\"){ee(X);var je=W(X),wt=U[je];if(wt!==void 0)Ye+=wt,X.index+=1;else if(je==="u"){var Bt=X.expression.slice(X.index+1,X.index+5);if(/^[0-9A-Fa-f]{4}$/.test(Bt))Ye+=String.fromCharCode(parseInt(Bt,16)),X.index+=5;else throw Xe(X,"Invalid unicode character \\u".concat(Bt))}else throw Xe(X,"Bad escape character \\".concat(je))}else Ye+=W(X),ee(X);if(Z(X),X.token!==ye)throw Xe(X,"End of string ".concat(ye," expected"));return Z(X),Ye}function j(X){var ye,Ye,je,wt;if(X.token==="["){if(re(X),Z(X),X.token!=="]"){var Bt=ne(X);if(X.token===";"){for(je=1,Ye=[Bt];X.token===";";)Z(X),X.token!=="]"&&(Ye[je]=ne(X),je++);if(X.token!=="]")throw Xe(X,"End of matrix ] expected");he(X),Z(X),wt=Ye[0].items.length;for(var fr=1;fr{var{typed:t,parse:r}=e;return t(U6,{string:function(i){return r(i).compile()},"Array | Matrix":function(i){return Ct(i,function(o){return r(o).compile()})}})});g();y();v();var $6="evaluate",Bfe=["typed","parse"],W6=K($6,Bfe,e=>{var{typed:t,parse:r}=e;return t($6,{string:function(i){var o=Cf();return r(i).compile().evaluate(o)},"string, Map | Object":function(i,o){return r(i).compile().evaluate(o)},"Array | Matrix":function(i){var o=Cf();return Ct(i,function(u){return r(u).compile().evaluate(o)})},"Array | Matrix, Map | Object":function(i,o){return Ct(i,function(u){return r(u).compile().evaluate(o)})}})});g();y();v();var Lfe="Parser",Pfe=["evaluate"],V6=K(Lfe,Pfe,e=>{var{evaluate:t}=e;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:Cf(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(n){return t(n,this.scope)},r.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},r.prototype.getAll=function(){return cF(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(n,i){return this.scope.set(n,i),i},r.prototype.remove=function(n){this.scope.delete(n)},r.prototype.clear=function(){this.scope.clear()},r},{isClass:!0});g();y();v();var G6="parser",Rfe=["typed","Parser"],Y6=K(G6,Rfe,e=>{var{typed:t,Parser:r}=e;return t(G6,{"":function(){return new r}})});g();y();v();var Z6="lup",qfe=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],X6=K(Z6,qfe,e=>{var{typed:t,matrix:r,abs:n,addScalar:i,divideScalar:o,multiplyScalar:u,subtractScalar:l,larger:a,equalScalar:s,unaryMinus:f,DenseMatrix:p,SparseMatrix:h,Spa:x}=e;return t(Z6,{DenseMatrix:function(E){return b(E)},SparseMatrix:function(E){return w(E)},Array:function(E){var O=r(E),M=b(O);return{L:M.L.valueOf(),U:M.U.valueOf(),p:M.p}}});function b(A){var E=A._size[0],O=A._size[1],M=Math.min(E,O),I=Lt(A._data),F=[],C=[E,M],P=[],R=[M,O],q,U,H,V=[];for(q=0;q0)for(q=0;q0},M.isDecimalMark=function(xe,Ye){return xe==="."&&Ye!=="/"&&Ye!=="*"&&Ye!=="^"},M.isDigitDot=function(xe){return xe>="0"&&xe<="9"||xe==="."},M.isDigit=function(xe){return xe>="0"&&xe<="9"},M.isHexDigit=function(xe){return xe>="0"&&xe<="9"||xe>="a"&&xe<="f"||xe>="A"&&xe<="F"};function De(X,xe){var Ye=H();Jn(Ye,{expression:X,extraNodes:xe}),Z(Ye);var je=we(Ye);if(Ye.token!=="")throw Ye.tokenType===F.DELIMITER?pt(Ye,"Unexpected operator "+Ye.token):Xe(Ye,'Unexpected part "'+Ye.token+'"');return je}function we(X){var xe,Ye=[],je;for(X.token!==""&&X.token!==` +`&&X.token!==";"&&(xe=ce(X),X.comment&&(xe.comment=X.comment));X.token===` +`||X.token===";";)Ye.length===0&&xe&&(je=X.token!==";",Ye.push({node:xe,visible:je})),Z(X),X.token!==` +`&&X.token!==";"&&X.token!==""&&(xe=ce(X),X.comment&&(xe.comment=X.comment),je=X.token!==";",Ye.push({node:xe,visible:je}));return Ye.length>0?new l(Ye):(xe||(xe=new s(void 0),X.comment&&(xe.comment=X.comment)),xe)}function ce(X){var xe,Ye,je,wt,Bt=Se(X);if(X.token==="="){if(qr(Bt))return xe=Bt.name,le(X),je=ce(X),new u(new O(xe),je);if(Fo(Bt))return le(X),je=ce(X),new u(Bt.object,Bt.index,je);if(eo(Bt)&&qr(Bt.fn)&&(wt=!0,Ye=[],xe=Bt.name,Bt.args.forEach(function(fr,Gr){qr(fr)?Ye[Gr]=fr.name:wt=!1}),wt))return le(X),je=ce(X),new f(xe,Ye,je);throw Xe(X,"Invalid left hand side of assignment operator =")}return Bt}function Se(X){for(var xe=Pe(X);X.token==="?";){var Ye=X.conditionalLevel;X.conditionalLevel=X.nestingLevel,le(X);var je=xe,wt=ce(X);if(X.token!==":")throw Xe(X,"False part of conditional expression expected");X.conditionalLevel=null,le(X);var Bt=ce(X);xe=new a(je,wt,Bt),X.conditionalLevel=Ye}return xe}function Pe(X){for(var xe=Ce(X);X.token==="or";)le(X),xe=new b("or","or",[xe,Ce(X)]);return xe}function Ce(X){for(var xe=Oe(X);X.token==="xor";)le(X),xe=new b("xor","xor",[xe,Oe(X)]);return xe}function Oe(X){for(var xe=He(X);X.token==="and";)le(X),xe=new b("and","and",[xe,He(X)]);return xe}function He(X){for(var xe=Ee(X);X.token==="|";)le(X),xe=new b("|","bitOr",[xe,Ee(X)]);return xe}function Ee(X){for(var xe=ze(X);X.token==="^|";)le(X),xe=new b("^|","bitXor",[xe,ze(X)]);return xe}function ze(X){for(var xe=We(X);X.token==="&";)le(X),xe=new b("&","bitAnd",[xe,We(X)]);return xe}function We(X){for(var xe=[Le(X)],Ye=[],je={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Et(je,X.token);){var wt={name:X.token,fn:je[X.token]};Ye.push(wt),le(X),xe.push(Le(X))}return xe.length===1?xe[0]:xe.length===2?new b(Ye[0].name,Ye[0].fn,xe):new S(Ye.map(Bt=>Bt.fn),xe)}function Le(X){var xe,Ye,je,wt;xe=lt(X);for(var Bt={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Et(Bt,X.token);)Ye=X.token,je=Bt[Ye],le(X),wt=[xe,lt(X)],xe=new b(Ye,je,wt);return xe}function lt(X){var xe,Ye,je,wt;xe=ct(X);for(var Bt={to:"to",in:"to"};Et(Bt,X.token);)Ye=X.token,je=Bt[Ye],le(X),Ye==="in"&&X.token===""?xe=new b("*","multiply",[xe,new O("in")],!0):(wt=[xe,ct(X)],xe=new b(Ye,je,wt));return xe}function ct(X){var xe,Ye=[];if(X.token===":"?xe=new s(1):xe=de(X),X.token===":"&&X.conditionalLevel!==X.nestingLevel){for(Ye.push(xe);X.token===":"&&Ye.length<3;)le(X),X.token===")"||X.token==="]"||X.token===","||X.token===""?Ye.push(new O("end")):Ye.push(de(X));Ye.length===3?xe=new A(Ye[0],Ye[2],Ye[1]):xe=new A(Ye[0],Ye[1])}return xe}function de(X){var xe,Ye,je,wt;xe=be(X);for(var Bt={"+":"add","-":"subtract"};Et(Bt,X.token);){Ye=X.token,je=Bt[Ye],le(X);var fr=be(X);fr.isPercentage?wt=[xe,new b("*","multiply",[xe,fr])]:wt=[xe,fr],xe=new b(Ye,je,wt)}return xe}function be(X){var xe,Ye,je,wt;xe=Ue(X),Ye=xe;for(var Bt={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};Et(Bt,X.token);)je=X.token,wt=Bt[je],le(X),Ye=Ue(X),xe=new b(je,wt,[xe,Ye]);return xe}function Ue(X){var xe,Ye;for(xe=ge(X),Ye=xe;X.tokenType===F.SYMBOL||X.token==="in"&&or(xe)||X.tokenType===F.NUMBER&&!or(Ye)&&(!Xr(Ye)||Ye.op==="!")||X.token==="(";)Ye=ge(X),xe=new b("*","multiply",[xe,Ye],!0);return xe}function ge(X){for(var xe=Re(X),Ye=xe,je=[];X.token==="/"&&wv(Ye);)if(je.push(Jn({},X)),le(X),X.tokenType===F.NUMBER)if(je.push(Jn({},X)),le(X),X.tokenType===F.SYMBOL||X.token==="(")Jn(X,je.pop()),je.pop(),Ye=Re(X),xe=new b("/","divide",[xe,Ye]);else{je.pop(),Jn(X,je.pop());break}else{Jn(X,je.pop());break}return xe}function Re(X){var xe,Ye,je,wt;xe=Be(X);for(var Bt={"%":"mod",mod:"mod"};Et(Bt,X.token);)Ye=X.token,je=Bt[Ye],le(X),Ye==="%"&&X.tokenType===F.DELIMITER&&X.token!=="("?xe=new b("/","divide",[xe,new s(100)],!1,!0):(wt=[xe,Be(X)],xe=new b(Ye,je,wt));return xe}function Be(X){var xe,Ye,je,wt={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Et(wt,X.token)?(je=wt[X.token],xe=X.token,le(X),Ye=[Be(X)],new b(xe,je,Ye)):Ke(X)}function Ke(X){var xe,Ye,je,wt;return xe=ot(X),(X.token==="^"||X.token===".^")&&(Ye=X.token,je=Ye==="^"?"pow":"dotPow",le(X),wt=[xe,Be(X)],xe=new b(Ye,je,wt)),xe}function ot(X){var xe,Ye,je,wt;xe=Qe(X);for(var Bt={"!":"factorial","'":"ctranspose"};Et(Bt,X.token);)Ye=X.token,je=Bt[Ye],Z(X),wt=[xe],xe=new b(Ye,je,wt),xe=Pt(X,xe);return xe}function Qe(X){var xe=[];if(X.tokenType===F.SYMBOL&&Et(X.extraNodes,X.token)){var Ye=X.extraNodes[X.token];if(Z(X),X.token==="("){if(xe=[],re(X),Z(X),X.token!==")")for(xe.push(ce(X));X.token===",";)Z(X),xe.push(ce(X));if(X.token!==")")throw Xe(X,"Parenthesis ) expected");he(X),Z(X)}return new Ye(xe)}return ut(X)}function ut(X){var xe,Ye;return X.tokenType===F.SYMBOL||X.tokenType===F.DELIMITER&&X.token in P?(Ye=X.token,Z(X),Et(R,Ye)?xe=new s(R[Ye]):q.includes(Ye)?xe=new s(r(Ye,"number")):xe=new O(Ye),xe=Pt(X,xe),xe):fe(X)}function Pt(X,xe,Ye){for(var je;(X.token==="("||X.token==="["||X.token===".")&&(!Ye||Ye.includes(X.token));)if(je=[],X.token==="(")if(qr(xe)||Fo(xe)){if(re(X),Z(X),X.token!==")")for(je.push(ce(X));X.token===",";)Z(X),je.push(ce(X));if(X.token!==")")throw Xe(X,"Parenthesis ) expected");he(X),Z(X),xe=new p(xe,je)}else return xe;else if(X.token==="["){if(re(X),Z(X),X.token!=="]")for(je.push(ce(X));X.token===",";)Z(X),je.push(ce(X));if(X.token!=="]")throw Xe(X,"Parenthesis ] expected");he(X),Z(X),xe=new i(xe,new h(je))}else{Z(X);var wt=X.tokenType===F.SYMBOL||X.tokenType===F.DELIMITER&&X.token in P;if(!wt)throw Xe(X,"Property name expected after dot");je.push(new s(X.token)),Z(X);var Bt=!0;xe=new i(xe,new h(je,Bt))}return xe}function fe(X){var xe,Ye;return X.token==='"'||X.token==="'"?(Ye=J(X,X.token),xe=new s(Ye),xe=Pt(X,xe),xe):j(X)}function J(X,xe){for(var Ye="";W(X)!==""&&W(X)!==xe;)if(W(X)==="\\"){ee(X);var je=W(X),wt=U[je];if(wt!==void 0)Ye+=wt,X.index+=1;else if(je==="u"){var Bt=X.expression.slice(X.index+1,X.index+5);if(/^[0-9A-Fa-f]{4}$/.test(Bt))Ye+=String.fromCharCode(parseInt(Bt,16)),X.index+=5;else throw Xe(X,"Invalid unicode character \\u".concat(Bt))}else throw Xe(X,"Bad escape character \\".concat(je))}else Ye+=W(X),ee(X);if(Z(X),X.token!==xe)throw Xe(X,"End of string ".concat(xe," expected"));return Z(X),Ye}function j(X){var xe,Ye,je,wt;if(X.token==="["){if(re(X),Z(X),X.token!=="]"){var Bt=ne(X);if(X.token===";"){for(je=1,Ye=[Bt];X.token===";";)Z(X),X.token!=="]"&&(Ye[je]=ne(X),je++);if(X.token!=="]")throw Xe(X,"End of matrix ] expected");he(X),Z(X),wt=Ye[0].items.length;for(var fr=1;fr{var{typed:t,parse:r}=e;return t(U6,{string:function(i){return r(i).compile()},"Array | Matrix":function(i){return Ct(i,function(o){return r(o).compile()})}})});g();x();v();var $6="evaluate",kfe=["typed","parse"],W6=K($6,kfe,e=>{var{typed:t,parse:r}=e;return t($6,{string:function(i){var o=Cf();return r(i).compile().evaluate(o)},"string, Map | Object":function(i,o){return r(i).compile().evaluate(o)},"Array | Matrix":function(i){var o=Cf();return Ct(i,function(u){return r(u).compile().evaluate(o)})},"Array | Matrix, Map | Object":function(i,o){return Ct(i,function(u){return r(u).compile().evaluate(o)})}})});g();x();v();var Bfe="Parser",Lfe=["evaluate"],V6=K(Bfe,Lfe,e=>{var{evaluate:t}=e;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:Cf(),writable:!1})}return r.prototype.type="Parser",r.prototype.isParser=!0,r.prototype.evaluate=function(n){return t(n,this.scope)},r.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},r.prototype.getAll=function(){return cF(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(n,i){return this.scope.set(n,i),i},r.prototype.remove=function(n){this.scope.delete(n)},r.prototype.clear=function(){this.scope.clear()},r},{isClass:!0});g();x();v();var G6="parser",Pfe=["typed","Parser"],Y6=K(G6,Pfe,e=>{var{typed:t,Parser:r}=e;return t(G6,{"":function(){return new r}})});g();x();v();var Z6="lup",Rfe=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],X6=K(Z6,Rfe,e=>{var{typed:t,matrix:r,abs:n,addScalar:i,divideScalar:o,multiplyScalar:u,subtractScalar:l,larger:a,equalScalar:s,unaryMinus:f,DenseMatrix:p,SparseMatrix:h,Spa:y}=e;return t(Z6,{DenseMatrix:function(S){return b(S)},SparseMatrix:function(S){return w(S)},Array:function(S){var O=r(S),M=b(O);return{L:M.L.valueOf(),U:M.U.valueOf(),p:M.p}}});function b(A){var S=A._size[0],O=A._size[1],M=Math.min(S,O),I=Lt(A._data),F=[],C=[S,M],P=[],R=[M,O],q,U,H,V=[];for(q=0;q0)for(q=0;q0&&ce.forEach(0,Y-1,function(Se,ze){h._forEachRow(Se,P,R,q,function(We,Le){We>Se&&ce.accumulate(We,f(u(Le,ze)))})});var Ce=Y,Oe=ce.get(Y),He=n(Oe);ce.forEach(Y+1,E-1,function(Se,ze){var We=n(ze);a(We,He)&&(Ce=Se,He=We,Oe=ze)}),Y!==Ce&&(h._swapRows(Y,Ce,U[1],P,R,q),h._swapRows(Y,Ce,ee[1],H,V,W),ce.swap(Y,Ce),he(Y,Ce)),ce.forEach(0,E-1,function(Se,ze){Se<=Y?(H.push(ze),V.push(Se)):(ze=o(ze,Oe),s(ze,0)||(P.push(ze),R.push(Se)))})};for(Y=0;Y0&&ce.forEach(0,Y-1,function(Ee,ze){h._forEachRow(Ee,P,R,q,function(We,Le){We>Ee&&ce.accumulate(We,f(u(Le,ze)))})});var Ce=Y,Oe=ce.get(Y),He=n(Oe);ce.forEach(Y+1,S-1,function(Ee,ze){var We=n(ze);a(We,He)&&(Ce=Ee,He=We,Oe=ze)}),Y!==Ce&&(h._swapRows(Y,Ce,U[1],P,R,q),h._swapRows(Y,Ce,ee[1],H,V,W),ce.swap(Y,Ce),he(Y,Ce)),ce.forEach(0,S-1,function(Ee,ze){Ee<=Y?(H.push(ze),V.push(Ee)):(ze=o(ze,Oe),s(ze,0)||(P.push(ze),R.push(Ee)))})};for(Y=0;Y{var{typed:t,matrix:r,zeros:n,identity:i,isZero:o,equal:u,sign:l,sqrt:a,conj:s,unaryMinus:f,addScalar:p,divideScalar:h,multiplyScalar:x,subtractScalar:b,complex:w}=e;return Jn(t(K6,{DenseMatrix:function(I){return E(I)},SparseMatrix:function(I){return O(I)},Array:function(I){var F=r(I),C=E(F);return{Q:C.Q.valueOf(),R:C.R.valueOf()}}}),{_denseQRimpl:A});function A(M){var I=M._size[0],F=M._size[1],C=i([I],"dense"),P=C._data,R=M.clone(),q=R._data,U,H,V,W=n([I],"");for(V=0;V0)for(var C=F[0][0].type==="Complex"?w(0):0,P=0;P=0;){var a=r[u+l],s=r[n+a];s===-1?(l--,o[t++]=a):(r[n+a]=r[i+s],++l,r[u+l]=s)}return t}function j6(e,t){if(!e)return null;var r=0,n,i=[],o=[],u=0,l=t,a=2*t;for(n=0;n=0;n--)e[n]!==-1&&(o[l+n]=o[u+e[n]],o[u+e[n]]=n);for(n=0;n{var{add:t,multiply:r,transpose:n}=e;return function(f,p){if(!p||f<=0||f>3)return null;var h=p._size,x=h[0],b=h[1],w=0,A=Math.max(16,10*Math.sqrt(b));A=Math.min(b-2,A);var E=i(f,p,x,b,A);tP(E,a,null);for(var O=E._index,M=E._ptr,I=M[b],F=[],C=[],P=0,R=b+1,q=2*(b+1),U=3*(b+1),H=4*(b+1),V=5*(b+1),W=6*(b+1),ee=7*(b+1),ie=F,Y=o(b,M,C,P,U,ie,q,ee,R,W,H,V),Z=u(b,M,C,V,H,W,A,R,U,ie,q),le=0,re,he,De,we,ce,Ee,Pe,Ce,Oe,He,Se,ze,We,Le,lt,ct;Zde?(Ee=De,Pe=ge,Ce=C[P+De]-de):(Ee=O[ge++],Pe=M[Ee],Ce=C[P+Ee]),ce=1;ce<=Ce;ce++)re=O[Pe++],!((Oe=C[R+re])<=0)&&(Ue+=Oe,C[R+re]=-Oe,O[Be++]=re,C[q+re]!==-1&&(ie[C[q+re]]=ie[re]),ie[re]!==-1?C[q+ie[re]]=C[q+re]:C[U+C[V+re]]=C[q+re]);Ee!==De&&(M[Ee]=Rs(De),C[W+Ee]=0)}for(de!==0&&(I=Be),C[V+De]=Ue,M[De]=Re,C[P+De]=Be-Re,C[H+De]=-2,Y=l(Y,w,C,W,b),He=Re;He=Y?C[W+Ee]-=Oe:C[W+Ee]!==0&&(C[W+Ee]=C[V+Ee]+Ke)}for(He=Re;He0?(ct+=ot,O[Le++]=Ee,lt+=Ee):(M[Ee]=Rs(De),C[W+Ee]=0)}C[H+re]=Le-ze+1;var Qe=Le,ut=ze+C[P+re];for(ge=We+1;ge=0))for(lt=ie[re],re=C[ee+lt],C[ee+lt]=-1;re!==-1&&C[q+re]!==-1;re=C[q+re],Y++){for(Ce=C[P+re],Se=C[H+re],ge=M[re]+1;ge<=M[re]+Ce-1;ge++)C[W+O[ge]]=Y;var fe=re;for(he=C[q+re];he!==-1;){var J=C[P+he]===Ce&&C[H+he]===Se;for(ge=M[he]+1;J&&ge<=M[he]+Ce-1;ge++)C[W+O[ge]]!==Y&&(J=0);J?(M[he]=Rs(re),C[R+re]+=C[R+he],C[R+he]=0,C[H+he]=-1,he=C[q+he],C[q+fe]=he):(fe=he,he=C[q+he])}}for(ge=Re,He=Re;He=0;he--)C[R+he]>0||(C[q+he]=C[U+M[he]],C[U+M[he]]=he);for(Ee=b;Ee>=0;Ee--)C[R+Ee]<=0||M[Ee]!==-1&&(C[q+Ee]=C[U+M[Ee]],C[U+M[Ee]]=Ee);for(De=0,re=0;re<=b;re++)M[re]===-1&&(De=Vw(re,De,C,U,q,F,W));return F.splice(F.length-1,1),F};function i(s,f,p,h,x){var b=n(f);if(s===1&&h===p)return t(f,b);if(s===2){for(var w=b._index,A=b._ptr,E=0,O=0;Ox))for(var I=A[O+1];Mw)p[A+F]=0,p[x+F]=-1,I++,f[F]=Rs(s),p[A+s]++;else{var P=p[E+C];P!==-1&&(O[P]=F),p[M+F]=p[E+C],p[E+C]=F}}return I}function l(s,f,p,h,x){if(s<2||s+f<0){for(var b=0;b{var{transpose:t}=e;return function(r,n,i,o){if(!r||!n||!i)return null;var u=r._size,l=u[0],a=u[1],s,f,p,h,x,b,w,A=4*a+(o?a+l+1:0),E=[],O=0,M=a,I=2*a,F=3*a,C=4*a,P=5*a+1;for(p=0;p=1&&R[f]++,V.jleaf===2&&R[V.q]--}n[f]!==-1&&(E[O+f]=n[f])}for(f=0;f{var{add:t,multiply:r,transpose:n}=e,i=rP({add:t,multiply:r,transpose:n}),o=iP({transpose:n});return function(a,s,f){var p=s._ptr,h=s._size,x=h[1],b,w={};if(w.q=i(a,s),a&&!w.q)return null;if(f){var A=a?Q6(s,null,w.q,0):s;w.parent=eP(A,1);var E=j6(w.parent,x);if(w.cp=o(A,w.parent,E,1),A&&w.parent&&w.cp&&u(A,w))for(w.unz=0,b=0;b=0;P--)for(q=s[P],U=s[P+1],R=q;R=0;C--)w[C]=-1,P=A[C],P!==-1&&(E[F+P]++===0&&(E[I+P]=C),E[O+C]=E[M+P],E[M+P]=C);for(a.lnz=0,a.m2=h,P=0;P=0;){e=n[h];var x=i?i[e]:e;Fv(u,e)||(Gw(u,e),n[a+h]=x<0?0:kA(u[x]));var b=1;for(f=n[a+h],p=x<0?0:kA(u[x+1]);f{var{divideScalar:t,multiply:r,subtract:n}=e;return function(o,u,l,a,s,f,p){var h=o._values,x=o._index,b=o._ptr,w=o._size,A=w[1],E=u._values,O=u._index,M=u._ptr,I,F,C,P,R=sP(o,u,l,a,f);for(I=R;I{var{abs:t,divideScalar:r,multiply:n,subtract:i,larger:o,largerEq:u,SparseMatrix:l}=e,a=uP({divideScalar:r,multiply:n,subtract:i});return function(f,p,h){if(!f)return null;var x=f._size,b=x[1],w,A=100,E=100;p&&(w=p.q,A=p.lnz||A,E=p.unz||E);var O=[],M=[],I=[],F=new l({values:O,index:M,ptr:I,size:[b,b]}),C=[],P=[],R=[],q=new l({values:C,index:P,ptr:R,size:[b,b]}),U=[],H,V,W=[],ee=[];for(H=0;H{var{typed:t,abs:r,add:n,multiply:i,transpose:o,divideScalar:u,subtract:l,larger:a,largerEq:s,SparseMatrix:f}=e,p=oP({add:n,multiply:i,transpose:o}),h=lP({abs:r,divideScalar:u,multiply:i,subtract:l,larger:a,largerEq:s,SparseMatrix:f});return t(fP,{"SparseMatrix, number, number":function(b,w,A){if(!Nt(w)||w<0||w>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(A<0||A>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var E=p(w,b,!1),O=h(b,E,A);return{L:O.L,U:O.U,p:O.pinv,q:E.q,toString:function(){return"L: "+this.L.toString()+` +P: `+this.p}}}});g();x();v();var K6="qr",qfe=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],J6=K(K6,qfe,e=>{var{typed:t,matrix:r,zeros:n,identity:i,isZero:o,equal:u,sign:l,sqrt:a,conj:s,unaryMinus:f,addScalar:p,divideScalar:h,multiplyScalar:y,subtractScalar:b,complex:w}=e;return Jn(t(K6,{DenseMatrix:function(I){return S(I)},SparseMatrix:function(I){return O(I)},Array:function(I){var F=r(I),C=S(F);return{Q:C.Q.valueOf(),R:C.R.valueOf()}}}),{_denseQRimpl:A});function A(M){var I=M._size[0],F=M._size[1],C=i([I],"dense"),P=C._data,R=M.clone(),q=R._data,U,H,V,W=n([I],"");for(V=0;V0)for(var C=F[0][0].type==="Complex"?w(0):0,P=0;P=0;){var a=r[u+l],s=r[n+a];s===-1?(l--,o[t++]=a):(r[n+a]=r[i+s],++l,r[u+l]=s)}return t}function j6(e,t){if(!e)return null;var r=0,n,i=[],o=[],u=0,l=t,a=2*t;for(n=0;n=0;n--)e[n]!==-1&&(o[l+n]=o[u+e[n]],o[u+e[n]]=n);for(n=0;n{var{add:t,multiply:r,transpose:n}=e;return function(f,p){if(!p||f<=0||f>3)return null;var h=p._size,y=h[0],b=h[1],w=0,A=Math.max(16,10*Math.sqrt(b));A=Math.min(b-2,A);var S=i(f,p,y,b,A);tP(S,a,null);for(var O=S._index,M=S._ptr,I=M[b],F=[],C=[],P=0,R=b+1,q=2*(b+1),U=3*(b+1),H=4*(b+1),V=5*(b+1),W=6*(b+1),ee=7*(b+1),ie=F,Y=o(b,M,C,P,U,ie,q,ee,R,W,H,V),Z=u(b,M,C,V,H,W,A,R,U,ie,q),le=0,re,he,De,we,ce,Se,Pe,Ce,Oe,He,Ee,ze,We,Le,lt,ct;Zde?(Se=De,Pe=ge,Ce=C[P+De]-de):(Se=O[ge++],Pe=M[Se],Ce=C[P+Se]),ce=1;ce<=Ce;ce++)re=O[Pe++],!((Oe=C[R+re])<=0)&&(Ue+=Oe,C[R+re]=-Oe,O[Be++]=re,C[q+re]!==-1&&(ie[C[q+re]]=ie[re]),ie[re]!==-1?C[q+ie[re]]=C[q+re]:C[U+C[V+re]]=C[q+re]);Se!==De&&(M[Se]=Ps(De),C[W+Se]=0)}for(de!==0&&(I=Be),C[V+De]=Ue,M[De]=Re,C[P+De]=Be-Re,C[H+De]=-2,Y=l(Y,w,C,W,b),He=Re;He=Y?C[W+Se]-=Oe:C[W+Se]!==0&&(C[W+Se]=C[V+Se]+Ke)}for(He=Re;He0?(ct+=ot,O[Le++]=Se,lt+=Se):(M[Se]=Ps(De),C[W+Se]=0)}C[H+re]=Le-ze+1;var Qe=Le,ut=ze+C[P+re];for(ge=We+1;ge=0))for(lt=ie[re],re=C[ee+lt],C[ee+lt]=-1;re!==-1&&C[q+re]!==-1;re=C[q+re],Y++){for(Ce=C[P+re],Ee=C[H+re],ge=M[re]+1;ge<=M[re]+Ce-1;ge++)C[W+O[ge]]=Y;var fe=re;for(he=C[q+re];he!==-1;){var J=C[P+he]===Ce&&C[H+he]===Ee;for(ge=M[he]+1;J&&ge<=M[he]+Ce-1;ge++)C[W+O[ge]]!==Y&&(J=0);J?(M[he]=Ps(re),C[R+re]+=C[R+he],C[R+he]=0,C[H+he]=-1,he=C[q+he],C[q+fe]=he):(fe=he,he=C[q+he])}}for(ge=Re,He=Re;He=0;he--)C[R+he]>0||(C[q+he]=C[U+M[he]],C[U+M[he]]=he);for(Se=b;Se>=0;Se--)C[R+Se]<=0||M[Se]!==-1&&(C[q+Se]=C[U+M[Se]],C[U+M[Se]]=Se);for(De=0,re=0;re<=b;re++)M[re]===-1&&(De=Vw(re,De,C,U,q,F,W));return F.splice(F.length-1,1),F};function i(s,f,p,h,y){var b=n(f);if(s===1&&h===p)return t(f,b);if(s===2){for(var w=b._index,A=b._ptr,S=0,O=0;Oy))for(var I=A[O+1];Mw)p[A+F]=0,p[y+F]=-1,I++,f[F]=Ps(s),p[A+s]++;else{var P=p[S+C];P!==-1&&(O[P]=F),p[M+F]=p[S+C],p[S+C]=F}}return I}function l(s,f,p,h,y){if(s<2||s+f<0){for(var b=0;b{var{transpose:t}=e;return function(r,n,i,o){if(!r||!n||!i)return null;var u=r._size,l=u[0],a=u[1],s,f,p,h,y,b,w,A=4*a+(o?a+l+1:0),S=[],O=0,M=a,I=2*a,F=3*a,C=4*a,P=5*a+1;for(p=0;p=1&&R[f]++,V.jleaf===2&&R[V.q]--}n[f]!==-1&&(S[O+f]=n[f])}for(f=0;f{var{add:t,multiply:r,transpose:n}=e,i=rP({add:t,multiply:r,transpose:n}),o=iP({transpose:n});return function(a,s,f){var p=s._ptr,h=s._size,y=h[1],b,w={};if(w.q=i(a,s),a&&!w.q)return null;if(f){var A=a?Q6(s,null,w.q,0):s;w.parent=eP(A,1);var S=j6(w.parent,y);if(w.cp=o(A,w.parent,S,1),A&&w.parent&&w.cp&&u(A,w))for(w.unz=0,b=0;b=0;P--)for(q=s[P],U=s[P+1],R=q;R=0;C--)w[C]=-1,P=A[C],P!==-1&&(S[F+P]++===0&&(S[I+P]=C),S[O+C]=S[M+P],S[M+P]=C);for(a.lnz=0,a.m2=h,P=0;P=0;){e=n[h];var y=i?i[e]:e;Fv(u,e)||(Gw(u,e),n[a+h]=y<0?0:kA(u[y]));var b=1;for(f=n[a+h],p=y<0?0:kA(u[y+1]);f{var{divideScalar:t,multiply:r,subtract:n}=e;return function(o,u,l,a,s,f,p){var h=o._values,y=o._index,b=o._ptr,w=o._size,A=w[1],S=u._values,O=u._index,M=u._ptr,I,F,C,P,R=sP(o,u,l,a,f);for(I=R;I{var{abs:t,divideScalar:r,multiply:n,subtract:i,larger:o,largerEq:u,SparseMatrix:l}=e,a=uP({divideScalar:r,multiply:n,subtract:i});return function(f,p,h){if(!f)return null;var y=f._size,b=y[1],w,A=100,S=100;p&&(w=p.q,A=p.lnz||A,S=p.unz||S);var O=[],M=[],I=[],F=new l({values:O,index:M,ptr:I,size:[b,b]}),C=[],P=[],R=[],q=new l({values:C,index:P,ptr:R,size:[b,b]}),U=[],H,V,W=[],ee=[];for(H=0;H{var{typed:t,abs:r,add:n,multiply:i,transpose:o,divideScalar:u,subtract:l,larger:a,largerEq:s,SparseMatrix:f}=e,p=oP({add:n,multiply:i,transpose:o}),h=lP({abs:r,divideScalar:u,multiply:i,subtract:l,larger:a,largerEq:s,SparseMatrix:f});return t(fP,{"SparseMatrix, number, number":function(b,w,A){if(!Nt(w)||w<0||w>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(A<0||A>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var S=p(w,b,!1),O=h(b,S,A);return{L:O.L,U:O.U,p:O.pinv,q:S.q,toString:function(){return"L: "+this.L.toString()+` U: `+this.U.toString()+` p: `+this.p.toString()+(this.q?` q: `+this.q.toString():"")+` -`}}}})});g();y();v();g();y();v();function BA(e,t){var r,n=t.length,i=[];if(e)for(r=0;r{var{typed:t,matrix:r,lup:n,slu:i,usolve:o,lsolve:u,DenseMatrix:l}=e,a=Mu({DenseMatrix:l});return t(pP,{"Array, Array | Matrix":function(h,x){h=r(h);var b=n(h),w=f(b.L,b.U,b.p,null,x);return w.valueOf()},"DenseMatrix, Array | Matrix":function(h,x){var b=n(h);return f(b.L,b.U,b.p,null,x)},"SparseMatrix, Array | Matrix":function(h,x){var b=n(h);return f(b.L,b.U,b.p,null,x)},"SparseMatrix, Array | Matrix, number, number":function(h,x,b,w){var A=i(h,b,w);return f(A.L,A.U,A.p,A.q,x)},"Object, Array | Matrix":function(h,x){return f(h.L,h.U,h.p,h.q,x)}});function s(p){if(Et(p))return p;if(pr(p))return r(p);throw new TypeError("Invalid Matrix LU decomposition")}function f(p,h,x,b,w){p=s(p),h=s(h),x&&(w=a(p,w,!0),w._data=BA(x,w._data));var A=u(p,w),E=o(h,A);return b&&(E._data=BA(b,E._data)),E}});g();y();v();var hP="polynomialRoot",jfe=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],dP=K(hP,jfe,e=>{var{typed:t,isZero:r,equalScalar:n,add:i,subtract:o,multiply:u,divide:l,sqrt:a,unaryMinus:s,cbrt:f,typeOf:p,im:h,re:x}=e;return t(hP,{"number|Complex, ...number|Complex":(b,w)=>{for(var A=[b,...w];A.length>0&&r(A[A.length-1]);)A.pop();if(A.length<2)throw new RangeError("Polynomial [".concat(b,", ").concat(w,"] must have a non-zero non-constant coefficient"));switch(A.length){case 2:return[s(l(A[0],A[1]))];case 3:{var[E,O,M]=A,I=u(2,M),F=u(O,O),C=u(4,M,E);if(n(F,C))return[l(s(O),I)];var P=a(o(F,C));return[l(o(P,O),I),l(o(s(P),O),I)]}case 4:{var[R,q,U,H]=A,V=s(u(3,H)),W=u(U,U),ee=u(3,H,q),ie=i(u(2,U,U,U),u(27,H,H,R)),Y=u(9,H,U,q);if(n(W,ee)&&n(ie,Y))return[l(U,V)];var Z=o(W,ee),le=o(ie,Y),re=i(u(18,H,U,q,R),u(U,U,q,q)),he=i(u(4,U,U,U,R),u(4,H,q,q,q),u(27,H,H,R,R));if(n(re,he))return[l(o(u(4,H,U,q),i(u(9,H,H,R),u(U,U,U))),u(H,Z)),l(o(u(9,H,R),u(U,q)),u(2,Z))];var De;n(W,ee)?De=le:De=l(i(le,a(o(u(le,le),u(4,Z,Z,Z)))),2);var we=!0,ce=f(De,we).toArray().map(Ee=>l(i(U,Ee,l(Z,Ee)),V));return ce.map(Ee=>p(Ee)==="Complex"&&n(x(Ee),x(Ee)+h(Ee))?x(Ee):Ee)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(A))}}})});g();y();v();var ece="Help",tce=["evaluate"],gP=K(ece,tce,e=>{var{evaluate:t}=e;function r(n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var n=this.doc||{},i=` +`}}}})});g();x();v();g();x();v();function BA(e,t){var r,n=t.length,i=[];if(e)for(r=0;r{var{typed:t,matrix:r,lup:n,slu:i,usolve:o,lsolve:u,DenseMatrix:l}=e,a=Cu({DenseMatrix:l});return t(pP,{"Array, Array | Matrix":function(h,y){h=r(h);var b=n(h),w=f(b.L,b.U,b.p,null,y);return w.valueOf()},"DenseMatrix, Array | Matrix":function(h,y){var b=n(h);return f(b.L,b.U,b.p,null,y)},"SparseMatrix, Array | Matrix":function(h,y){var b=n(h);return f(b.L,b.U,b.p,null,y)},"SparseMatrix, Array | Matrix, number, number":function(h,y,b,w){var A=i(h,b,w);return f(A.L,A.U,A.p,A.q,y)},"Object, Array | Matrix":function(h,y){return f(h.L,h.U,h.p,h.q,y)}});function s(p){if(St(p))return p;if(pr(p))return r(p);throw new TypeError("Invalid Matrix LU decomposition")}function f(p,h,y,b,w){p=s(p),h=s(h),y&&(w=a(p,w,!0),w._data=BA(y,w._data));var A=u(p,w),S=o(h,A);return b&&(S._data=BA(b,S._data)),S}});g();x();v();var hP="polynomialRoot",Qfe=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],dP=K(hP,Qfe,e=>{var{typed:t,isZero:r,equalScalar:n,add:i,subtract:o,multiply:u,divide:l,sqrt:a,unaryMinus:s,cbrt:f,typeOf:p,im:h,re:y}=e;return t(hP,{"number|Complex, ...number|Complex":(b,w)=>{for(var A=[b,...w];A.length>0&&r(A[A.length-1]);)A.pop();if(A.length<2)throw new RangeError("Polynomial [".concat(b,", ").concat(w,"] must have a non-zero non-constant coefficient"));switch(A.length){case 2:return[s(l(A[0],A[1]))];case 3:{var[S,O,M]=A,I=u(2,M),F=u(O,O),C=u(4,M,S);if(n(F,C))return[l(s(O),I)];var P=a(o(F,C));return[l(o(P,O),I),l(o(s(P),O),I)]}case 4:{var[R,q,U,H]=A,V=s(u(3,H)),W=u(U,U),ee=u(3,H,q),ie=i(u(2,U,U,U),u(27,H,H,R)),Y=u(9,H,U,q);if(n(W,ee)&&n(ie,Y))return[l(U,V)];var Z=o(W,ee),le=o(ie,Y),re=i(u(18,H,U,q,R),u(U,U,q,q)),he=i(u(4,U,U,U,R),u(4,H,q,q,q),u(27,H,H,R,R));if(n(re,he))return[l(o(u(4,H,U,q),i(u(9,H,H,R),u(U,U,U))),u(H,Z)),l(o(u(9,H,R),u(U,q)),u(2,Z))];var De;n(W,ee)?De=le:De=l(i(le,a(o(u(le,le),u(4,Z,Z,Z)))),2);var we=!0,ce=f(De,we).toArray().map(Se=>l(i(U,Se,l(Z,Se)),V));return ce.map(Se=>p(Se)==="Complex"&&n(y(Se),y(Se)+h(Se))?y(Se):Se)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(A))}}})});g();x();v();var jfe="Help",ece=["evaluate"],gP=K(jfe,ece,e=>{var{evaluate:t}=e;function r(n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var n=this.doc||{},i=` `;if(n.name&&(i+="Name: "+n.name+` `),n.category&&(i+="Category: "+n.category+` @@ -85,30 +85,30 @@ q: `+this.q.toString():"")+` `),n.examples){i+=`Examples: `;for(var o=!1,u=t("config()"),l={config:p=>(o=!0,t("config(newConfig)",{newConfig:p}))},a=0;ao!=="mathjs").forEach(o=>{i[o]=n[o]}),new r(i)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0});g();y();v();var rce="Chain",nce=["?on","math","typed"],vP=K(rce,nce,e=>{var{on:t,math:r,typed:n}=e;function i(s){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");lh(s)?this.value=s.value:this.value=s}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return Kt(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(s){return new i(s.value)};function o(s,f){typeof f=="function"&&(i.prototype[s]=l(f))}function u(s,f){fh(i.prototype,s,function(){var h=f();if(typeof h=="function")return l(h)})}function l(s){return function(){if(arguments.length===0)return new i(s(this.value));for(var f=[this.value],p=0;ps[b])};for(var h in s)p(h)}};var a={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",function(s,f,p){p||u(s,f)}),i},{isClass:!0});g();y();v();g();y();v();g();y();v();var LA={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"]};g();y();v();var yP={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};g();y();v();var xP={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:[]};g();y();v();var wP={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:[]};g();y();v();var bP={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};g();y();v();var DP={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};g();y();v();var NP={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:[]};g();y();v();var EP={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:[]};g();y();v();var SP={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};g();y();v();var AP={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};g();y();v();var CP={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:[]};g();y();v();var PA={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"]};g();y();v();var MP={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:[]};g();y();v();var TP={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};g();y();v();var OP={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"]};g();y();v();var IP={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};g();y();v();var FP={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};g();y();v();var _P={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"]};g();y();v();var kP={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"]};g();y();v();var BP={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"]};g();y();v();var LP={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"]};g();y();v();var PP={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"]};g();y();v();var RP={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"]};g();y();v();var qP={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"]};g();y();v();var zP={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"]};g();y();v();var UP={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"]};g();y();v();var HP={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"]};g();y();v();var $P={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"]};g();y();v();var WP={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"]};g();y();v();var VP={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"]};g();y();v();var GP={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:[]};g();y();v();var YP={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:[]};g();y();v();var ZP={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:[]};g();y();v();var XP={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"]};g();y();v();var KP={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"]};g();y();v();var JP={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"]};g();y();v();var QP={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"]};g();y();v();var jP={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"]};g();y();v();var e8={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"]};g();y();v();var t8={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"]};g();y();v();var r8={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"]};g();y();v();var n8={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"]};g();y();v();var i8={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"]};g();y();v();var o8={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"]};g();y();v();var a8={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"]};g();y();v();var s8={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"]};g();y();v();var u8={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"]};g();y();v();var l8={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"]};g();y();v();var f8={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"]};g();y();v();var c8={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"]};g();y();v();var p8={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};g();y();v();var m8={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"]};g();y();v();var h8={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"]};g();y();v();var d8={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],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)"],seealso:["floor","fix","round"]};g();y();v();var g8={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"]};g();y();v();var v8={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"]};g();y();v();var y8={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"]};g();y();v();var x8={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"]};g();y();v();var w8={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"]};g();y();v();var b8={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"]};g();y();v();var D8={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"]};g();y();v();var N8={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"]};g();y();v();var E8={name:"fix",category:"Arithmetic",syntax:["fix(x)"],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)"],seealso:["ceil","floor","round"]};g();y();v();var S8={name:"floor",category:"Arithmetic",syntax:["floor(x)"],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)"],seealso:["ceil","fix","round"]};g();y();v();var A8={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"]};g();y();v();var C8={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};g();y();v();var M8={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"]};g();y();v();var T8={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"]};g();y();v();var O8={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"]};g();y();v();var I8={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"]};g();y();v();var F8={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"]};g();y();v();var _8={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"]};g();y();v();var k8={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"]};g();y();v();var B8={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"]};g();y();v();var L8={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")']};g();y();v();var P8={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"]};g();y();v();var R8={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"]};g();y();v();var q8={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"]};g();y();v();var z8={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"]};g();y();v();var U8={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};g();y();v();var H8={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"]};g();y();v();var $8={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"]};g();y();v();var W8={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"]};g();y();v();var V8={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"]};g();y();v();var G8={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"]};g();y();v();var Y8={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"]};g();y();v();var Z8={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"]};g();y();v();var X8={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"]};g();y();v();var K8={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};g();y();v();var J8={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"]};g();y();v();var Q8={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"]};g();y();v();var j8={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"]};g();y();v();var eR={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"]};g();y();v();var tR={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"]};g();y();v();var rR={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"]};g();y();v();var nR={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"]};g();y();v();var iR={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"]};g();y();v();var oR={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"]};g();y();v();var aR={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"]};g();y();v();var sR={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"]};g();y();v();var uR={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"]};g();y();v();var lR={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"]};g();y();v();var fR={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"]};g();y();v();var cR={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"]};g();y();v();var pR={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"]};g();y();v();var mR={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:[]};g();y();v();var hR={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};g();y();v();var dR={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:[]};g();y();v();var gR={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:[]};g();y();v();var vR={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"]};g();y();v();var yR={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"]};g();y();v();var xR={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"]};g();y();v();var wR={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"]};g();y();v();var bR={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"]};g();y();v();var DR={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"]};g();y();v();var NR={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"]};g();y();v();var ER={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"]};g();y();v();var SR={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"]};g();y();v();var AR={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"]};g();y();v();var CR={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"]};g();y();v();var MR={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 indicant 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"]};g();y();v();var TR={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"]};g();y();v();var OR={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"]};g();y();v();var IR={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"]};g();y();v();var FR={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"]};g();y();v();var _R={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"]};g();y();v();var kR={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"]};g();y();v();var BR={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"]};g();y();v();var LR={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"]};g();y();v();var PR={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"]};g();y();v();var RR={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"]};g();y();v();var qR={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]};g();y();v();var zR={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"]};g();y();v();var UR={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"]};g();y();v();var HR={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"]};g();y();v();var $R={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"]};g();y();v();var WR={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"]};g();y();v();var VR={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"]};g();y();v();var GR={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"]};g();y();v();var YR={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"]};g();y();v();var ZR={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"]};g();y();v();var XR={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"]};g();y();v();var KR={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"]};g();y();v();var JR={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"]};g();y();v();var QR={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"]};g();y();v();var jR={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"]};g();y();v();var e9={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"]};g();y();v();var t9={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"]};g();y();v();var r9={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"]};g();y();v();var n9={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"]};g();y();v();var i9={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};g();y();v();var o9={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};g();y();v();var a9={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"]};g();y();v();var s9={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"]};g();y();v();var u9={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"]};g();y();v();var l9={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"]};g();y();v();var f9={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"]};g();y();v();var c9={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:[]};g();y();v();var p9={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"]};g();y();v();var m9={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"]};g();y();v();var h9={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"]};g();y();v();var d9={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"]};g();y();v();var g9={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"]};g();y();v();var v9={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"]};g();y();v();var y9={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"]};g();y();v();var x9={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"]};g();y();v();var w9={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"]};g();y();v();var b9={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"]};g();y();v();var D9={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"]};g();y();v();var N9={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.",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"]};g();y();v();var E9={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"]};g();y();v();var S9={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.",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"]};g();y();v();var A9={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"]};g();y();v();var C9={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"]};g();y();v();var M9={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"]};g();y();v();var T9={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"]};g();y();v();var O9={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"]};g();y();v();var I9={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"]};g();y();v();var F9={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"]};g();y();v();var _9={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"]};g();y();v();var k9={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"]};g();y();v();var B9={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"]};g();y();v();var L9={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"]};g();y();v();var P9={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"]};g();y();v();var R9={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:[]};g();y();v();var q9={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:[]};g();y();v();var z9={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:[]};g();y();v();var U9={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]};g();y();v();var H9={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"]};g();y();v();var $9={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",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"]};g();y();v();var W9={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"]};g();y();v();var V9={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"]};g();y();v();var G9={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",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"]};g();y();v();var Y9={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"]};g();y();v();var Z9={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"]};g();y();v();var X9={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 probablity are: Number, BigNumber. +`),i},r.prototype.toJSON=function(){var n=Lt(this.doc);return n.mathjs="Help",n},r.fromJSON=function(n){var i={};return Object.keys(n).filter(o=>o!=="mathjs").forEach(o=>{i[o]=n[o]}),new r(i)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0});g();x();v();var tce="Chain",rce=["?on","math","typed"],vP=K(tce,rce,e=>{var{on:t,math:r,typed:n}=e;function i(s){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");uh(s)?this.value=s.value:this.value=s}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return Kt(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(s){return new i(s.value)};function o(s,f){typeof f=="function"&&(i.prototype[s]=l(f))}function u(s,f){lh(i.prototype,s,function(){var h=f();if(typeof h=="function")return l(h)})}function l(s){return function(){if(arguments.length===0)return new i(s(this.value));for(var f=[this.value],p=0;ps[b])};for(var h in s)p(h)}};var a={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",function(s,f,p){p||u(s,f)}),i},{isClass:!0});g();x();v();g();x();v();g();x();v();var LA={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"]};g();x();v();var xP={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};g();x();v();var yP={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:[]};g();x();v();var wP={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:[]};g();x();v();var bP={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};g();x();v();var DP={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};g();x();v();var NP={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:[]};g();x();v();var SP={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:[]};g();x();v();var EP={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};g();x();v();var AP={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};g();x();v();var CP={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:[]};g();x();v();var PA={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"]};g();x();v();var MP={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:[]};g();x();v();var TP={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};g();x();v();var OP={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"]};g();x();v();var IP={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};g();x();v();var FP={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};g();x();v();var _P={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"]};g();x();v();var kP={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"]};g();x();v();var BP={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"]};g();x();v();var LP={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"]};g();x();v();var PP={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"]};g();x();v();var RP={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"]};g();x();v();var qP={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"]};g();x();v();var zP={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"]};g();x();v();var UP={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"]};g();x();v();var HP={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"]};g();x();v();var $P={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"]};g();x();v();var WP={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"]};g();x();v();var VP={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"]};g();x();v();var GP={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:[]};g();x();v();var YP={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:[]};g();x();v();var ZP={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:[]};g();x();v();var XP={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"]};g();x();v();var KP={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"]};g();x();v();var JP={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"]};g();x();v();var QP={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"]};g();x();v();var jP={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"]};g();x();v();var e8={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"]};g();x();v();var t8={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"]};g();x();v();var r8={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"]};g();x();v();var n8={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"]};g();x();v();var i8={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"]};g();x();v();var o8={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"]};g();x();v();var a8={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"]};g();x();v();var s8={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"]};g();x();v();var u8={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"]};g();x();v();var l8={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"]};g();x();v();var f8={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"]};g();x();v();var c8={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"]};g();x();v();var p8={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};g();x();v();var m8={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"]};g();x();v();var h8={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"]};g();x();v();var d8={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],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)"],seealso:["floor","fix","round"]};g();x();v();var g8={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"]};g();x();v();var v8={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"]};g();x();v();var x8={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"]};g();x();v();var y8={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"]};g();x();v();var w8={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"]};g();x();v();var b8={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"]};g();x();v();var D8={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"]};g();x();v();var N8={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"]};g();x();v();var S8={name:"fix",category:"Arithmetic",syntax:["fix(x)"],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)"],seealso:["ceil","floor","round"]};g();x();v();var E8={name:"floor",category:"Arithmetic",syntax:["floor(x)"],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)"],seealso:["ceil","fix","round"]};g();x();v();var A8={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"]};g();x();v();var C8={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};g();x();v();var M8={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"]};g();x();v();var T8={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"]};g();x();v();var O8={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"]};g();x();v();var I8={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"]};g();x();v();var F8={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"]};g();x();v();var _8={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"]};g();x();v();var k8={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"]};g();x();v();var B8={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"]};g();x();v();var L8={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")']};g();x();v();var P8={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"]};g();x();v();var R8={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"]};g();x();v();var q8={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"]};g();x();v();var z8={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"]};g();x();v();var U8={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};g();x();v();var H8={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"]};g();x();v();var $8={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"]};g();x();v();var W8={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"]};g();x();v();var V8={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"]};g();x();v();var G8={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"]};g();x();v();var Y8={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"]};g();x();v();var Z8={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"]};g();x();v();var X8={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"]};g();x();v();var K8={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};g();x();v();var J8={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"]};g();x();v();var Q8={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"]};g();x();v();var j8={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"]};g();x();v();var eR={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"]};g();x();v();var tR={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"]};g();x();v();var rR={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"]};g();x();v();var nR={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"]};g();x();v();var iR={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"]};g();x();v();var oR={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"]};g();x();v();var aR={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"]};g();x();v();var sR={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"]};g();x();v();var uR={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"]};g();x();v();var lR={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"]};g();x();v();var fR={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"]};g();x();v();var cR={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"]};g();x();v();var pR={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"]};g();x();v();var mR={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:[]};g();x();v();var hR={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};g();x();v();var dR={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:[]};g();x();v();var gR={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:[]};g();x();v();var vR={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"]};g();x();v();var xR={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"]};g();x();v();var yR={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"]};g();x();v();var wR={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"]};g();x();v();var bR={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"]};g();x();v();var DR={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"]};g();x();v();var NR={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"]};g();x();v();var SR={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"]};g();x();v();var ER={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"]};g();x();v();var AR={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"]};g();x();v();var CR={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"]};g();x();v();var MR={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 indicant 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"]};g();x();v();var TR={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"]};g();x();v();var OR={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"]};g();x();v();var IR={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"]};g();x();v();var FR={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"]};g();x();v();var _R={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"]};g();x();v();var kR={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"]};g();x();v();var BR={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"]};g();x();v();var LR={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"]};g();x();v();var PR={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"]};g();x();v();var RR={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"]};g();x();v();var qR={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]};g();x();v();var zR={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"]};g();x();v();var UR={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"]};g();x();v();var HR={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"]};g();x();v();var $R={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"]};g();x();v();var WR={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"]};g();x();v();var VR={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"]};g();x();v();var GR={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"]};g();x();v();var YR={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"]};g();x();v();var ZR={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"]};g();x();v();var XR={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"]};g();x();v();var KR={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"]};g();x();v();var JR={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"]};g();x();v();var QR={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"]};g();x();v();var jR={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"]};g();x();v();var e9={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"]};g();x();v();var t9={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"]};g();x();v();var r9={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"]};g();x();v();var n9={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"]};g();x();v();var i9={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};g();x();v();var o9={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};g();x();v();var a9={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"]};g();x();v();var s9={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"]};g();x();v();var u9={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"]};g();x();v();var l9={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"]};g();x();v();var f9={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"]};g();x();v();var c9={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:[]};g();x();v();var p9={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"]};g();x();v();var m9={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"]};g();x();v();var h9={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"]};g();x();v();var d9={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"]};g();x();v();var g9={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"]};g();x();v();var v9={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"]};g();x();v();var x9={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"]};g();x();v();var y9={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"]};g();x();v();var w9={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"]};g();x();v();var b9={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"]};g();x();v();var D9={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"]};g();x();v();var N9={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.",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"]};g();x();v();var S9={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"]};g();x();v();var E9={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.",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"]};g();x();v();var A9={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"]};g();x();v();var C9={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"]};g();x();v();var M9={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"]};g();x();v();var T9={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"]};g();x();v();var O9={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"]};g();x();v();var I9={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"]};g();x();v();var F9={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"]};g();x();v();var _9={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"]};g();x();v();var k9={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"]};g();x();v();var B9={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"]};g();x();v();var L9={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"]};g();x();v();var P9={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"]};g();x();v();var R9={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:[]};g();x();v();var q9={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:[]};g();x();v();var z9={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:[]};g();x();v();var U9={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]};g();x();v();var H9={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"]};g();x();v();var $9={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",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"]};g();x();v();var W9={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"]};g();x();v();var V9={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"]};g();x();v();var G9={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",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"]};g();x();v();var Y9={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"]};g();x();v();var Z9={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"]};g();x();v();var X9={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 probablity are: Number, BigNumber. -In 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"]};g();y();v();var K9={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"]};g();y();v();var J9={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"]};g();y();v();var Q9={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","sum","variance"]};g();y();v();var j9={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"]};g();y();v();var e7={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"]};g();y();v();var t7={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"]};g();y();v();var r7={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"]};g();y();v();var n7={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"]};g();y();v();var i7={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent 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"]};g();y();v();var o7={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"]};g();y();v();var a7={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};g();y();v();var s7={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"]};g();y();v();var u7={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};g();y();v();var l7={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"]};g();y();v();var f7={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"]};g();y();v();var c7={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"]};g();y();v();var p7={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"]};g();y();v();var m7={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"]};g();y();v();var h7={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"]};g();y();v();var d7={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};g();y();v();var g7={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"]};g();y();v();var v7={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"]};g();y();v();var y7={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"]};g();y();v();var x7={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"]};g();y();v();var w7={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"]};g();y();v();var b7={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"]};g();y();v();var D7={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"]};g();y();v();var N7={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};g();y();v();var E7={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"]};g();y();v();var S7={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"]};g();y();v();var A7={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:[]};g();y();v();var C7={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};g();y();v();var M7={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:[]};g();y();v();var T7={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"]};g();y();v();var O7={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"]};g();y();v();var I7={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};g();y();v();var F7={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"]};g();y();v();var _7={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"]};g();y();v();var k7={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"]};g();y();v();var B7={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"]};g();y();v();var L7={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"]};g();y();v();var P7={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"]};g();y();v();var R7={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"]};g();y();v();var q7={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"]};g();y();v();var z7={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};g();y();v();var U7={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"]};g();y();v();var H7={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"]};g();y();v();var $7={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"]};var W7={bignumber:_P,bigint:kP,boolean:BP,complex:LP,createUnit:PP,fraction:RP,index:qP,matrix:zP,number:UP,sparse:HP,splitUnit:$P,string:WP,unit:VP,e:LA,E:LA,false:yP,i:xP,Infinity:wP,LN2:DP,LN10:bP,LOG2E:EP,LOG10E:NP,NaN:SP,null:AP,pi:PA,PI:PA,phi:CP,SQRT1_2:MP,SQRT2:TP,tau:OP,true:IP,version:FP,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",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh 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:"Borh 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:XP,lsolve:JP,lsolveAll:QP,lup:jP,lusolve:e8,leafCount:KP,polynomialRoot:t8,resolve:i8,simplify:o8,simplifyConstant:a8,simplifyCore:s8,symbolicEqual:l8,rationalize:n8,slu:u8,usolve:f8,usolveAll:c8,qr:r8,abs:p8,add:m8,cbrt:h8,ceil:d8,cube:g8,divide:v8,dotDivide:y8,dotMultiply:x8,dotPow:w8,exp:b8,expm:D8,expm1:N8,fix:E8,floor:S8,gcd:A8,hypot:C8,lcm:T8,log:O8,log2:_8,log1p:F8,log10:I8,mod:k8,multiply:B8,norm:L8,nthRoot:P8,nthRoots:R8,pow:q8,round:z8,sign:U8,sqrt:H8,sqrtm:$8,square:Y8,subtract:Z8,unaryMinus:X8,unaryPlus:K8,xgcd:J8,invmod:M8,bitAnd:Q8,bitNot:j8,bitOr:eR,bitXor:tR,leftShift:rR,rightArithShift:nR,rightLogShift:iR,bellNumbers:oR,catalan:aR,composition:sR,stirlingS2:uR,config:GP,import:YP,typed:ZP,arg:lR,conj:fR,re:pR,im:cR,evaluate:mR,help:hR,distance:dR,intersect:gR,and:vR,not:yR,or:xR,xor:wR,concat:DR,count:NR,cross:ER,column:bR,ctranspose:SR,det:AR,diag:CR,diff:MR,dot:TR,getMatrixDataType:kR,identity:BR,filter:IR,flatten:FR,forEach:_R,inv:LR,pinv:PR,eigs:OR,kron:RR,matrixFromFunction:UR,matrixFromRows:HR,matrixFromColumns:zR,map:qR,ones:$R,partitionSelect:WR,range:VR,resize:YR,reshape:GR,rotate:ZR,rotationMatrix:XR,row:KR,size:JR,sort:QR,squeeze:jR,subset:e9,trace:t9,transpose:r9,zeros:n9,fft:i9,ifft:o9,sylvester:W8,schur:V8,lyap:G8,solveODE:$7,combinations:a9,combinationsWithRep:s9,factorial:u9,gamma:l9,kldivergence:c9,lgamma:f9,multinomial:p9,permutations:m9,pickRandom:h9,random:d9,randomInt:g9,compare:v9,compareNatural:y9,compareText:x9,deepEqual:w9,equal:b9,equalText:D9,larger:N9,largerEq:E9,smaller:S9,smallerEq:A9,unequal:C9,setCartesian:M9,setDifference:T9,setDistinct:O9,setIntersect:I9,setIsSubset:F9,setMultiplicity:_9,setPowerset:k9,setSize:B9,setSymDifference:L9,setUnion:P9,zpk2tf:R9,freqz:q9,erf:z9,zeta:U9,cumsum:J9,mad:H9,max:$9,mean:W9,median:V9,min:G9,mode:Y9,prod:Z9,quantileSeq:X9,std:K9,sum:Q9,variance:j9,corr:e7,acos:t7,acosh:r7,acot:n7,acoth:i7,acsc:o7,acsch:a7,asec:s7,asech:u7,asin:l7,asinh:f7,atan:c7,atanh:m7,atan2:p7,cos:h7,cosh:d7,cot:g7,coth:v7,csc:y7,csch:x7,sec:w7,sech:b7,sin:D7,sinh:N7,tan:E7,tanh:S7,to:A7,clone:M7,format:T7,bin:C7,oct:z7,hex:I7,isNaN:_7,isInteger:F7,isNegative:k7,isNumeric:B7,hasNumericValue:O7,isPositive:L7,isPrime:P7,isZero:R7,print:U7,typeOf:H7,numeric:q7};var V7="help",ice=["typed","mathWithTransform","Help"],G7=K(V7,ice,e=>{var{typed:t,mathWithTransform:r,Help:n}=e;return t(V7,{any:function(o){var u,l=o;if(typeof o!="string"){for(u in r)if(St(r,u)&&o===r[u]){l=u;break}}var a=fn(W7,l);if(!a){var s=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+s+'"')}return new n(a)}})});g();y();v();var Y7="chain",oce=["typed","Chain"],Z7=K(Y7,oce,e=>{var{typed:t,Chain:r}=e;return t(Y7,{"":function(){return new r},any:function(i){return new r(i)}})});g();y();v();var X7="det",ace=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],K7=K(X7,ace,e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:o,isZero:u,unaryMinus:l}=e;return t(X7,{any:function(f){return Lt(f)},"Array | Matrix":function(f){var p;switch(Et(f)?p=f.size():Array.isArray(f)?(f=r(f),p=f.size()):p=[],p.length){case 0:return Lt(f);case 1:if(p[0]===1)return Lt(f.valueOf()[0]);if(p[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Kt(p)+")");case 2:{var h=p[0],x=p[1];if(h===x)return a(f.clone().valueOf(),h,x);if(x===0)return 1;throw new RangeError("Matrix must be square (size: "+Kt(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Kt(p)+")")}}});function a(s,f,p){if(f===1)return Lt(s[0][0]);if(f===2)return n(i(s[0][0],s[1][1]),i(s[1][0],s[0][1]));for(var h=!1,x=new Array(f).fill(0).map((P,R)=>R),b=0;b{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:o,unaryMinus:u,det:l,identity:a,abs:s}=e;return t(J7,{"Array | Matrix":function(h){var x=Et(h)?h.size():Wt(h);switch(x.length){case 1:if(x[0]===1)return Et(h)?r([n(1,h.valueOf()[0])]):[n(1,h[0])];throw new RangeError("Matrix must be square (size: "+Kt(x)+")");case 2:{var b=x[0],w=x[1];if(b===w)return Et(h)?r(f(h.valueOf(),b,w),h.storage()):f(h,b,w);throw new RangeError("Matrix must be square (size: "+Kt(x)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Kt(x)+")")}},any:function(h){return n(1,h)}});function f(p,h,x){var b,w,A,E,O;if(h===1){if(E=p[0][0],E===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,E)]]}else if(h===2){var M=l(p);if(M===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(p[1][1],M),n(u(p[0][1]),M)],[n(u(p[1][0]),M),n(p[0][0],M)]]}else{var I=p.concat();for(b=0;bP&&(P=s(I[b][C]),R=b),b++;if(P===0)throw Error("Cannot calculate inverse, determinant is zero");b=R,b!==C&&(O=I[C],I[C]=I[b],I[b]=O,O=F[C],F[C]=F[b],F[b]=O);var q=I[C],U=F[C];for(b=0;b{var{typed:t,matrix:r,inv:n,deepEqual:i,equal:o,dotDivide:u,dot:l,ctranspose:a,divideScalar:s,multiply:f,add:p,Complex:h}=e;return t(j7,{"Array | Matrix":function(M){var I=Et(M)?M.size():Wt(M);switch(I.length){case 1:return E(M)?a(M):I[0]===1?n(M):u(a(M),l(M,M));case 2:{if(E(M))return a(M);var F=I[0],C=I[1];if(F===C)try{return n(M)}catch(P){if(!(P instanceof Error&&P.message.match(/Cannot calculate inverse, determinant is zero/)))throw P}return Et(M)?r(x(M.valueOf(),F,C),M.storage()):x(M,F,C)}default:throw new RangeError("Matrix must be two dimensional (size: "+Kt(I)+")")}},any:function(M){return o(M,0)?Lt(M):s(1,M)}});function x(O,M,I){var{C:F,F:C}=w(O,M,I),P=f(n(f(a(F),F)),a(F)),R=f(a(C),n(f(C,a(C))));return f(R,P)}function b(O,M,I){for(var F=Lt(O),C=0,P=0;PR.filter((U,H)=>H!A(l(F[q],F[q])));return{C,F:P}}function A(O){return o(p(O,h(1,1)),p(0,h(1,1)))}function E(O){return i(p(O,h(1,1)),p(f(O,0),h(1,1)))}});g();y();v();g();y();v();function tq(e){var{addScalar:t,subtract:r,flatten:n,multiply:i,multiplyScalar:o,divideScalar:u,sqrt:l,abs:a,bignumber:s,diag:f,size:p,reshape:h,inv:x,qr:b,usolve:w,usolveAll:A,equal:E,complex:O,larger:M,smaller:I,matrixFromColumns:F,dot:C}=e;function P(we,ce,Ee,Pe){var Ce=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,Oe=R(we,ce,Ee,Pe,Ce);q(we,ce,Ee,Pe,Ce,Oe);var{values:He,C:Se}=U(we,ce,Ee,Pe,Ce);if(Ce){var ze=H(we,ce,Se,Oe,He,Ee,Pe);return{values:He,eigenvectors:ze}}return{values:He}}function R(we,ce,Ee,Pe,Ce){var Oe=Pe==="BigNumber",He=Pe==="Complex",Se=Oe?s(0):0,ze=Oe?s(1):He?O(1):1,We=Oe?s(1):1,Le=Oe?s(10):2,lt=o(Le,Le),ct;Ce&&(ct=Array(ce).fill(ze));for(var de=!1;!de;){de=!0;for(var be=0;be1&&(de=f(Array(Le-1).fill(Se)))),Le-=1,ze.pop();for(var ot=0;ot2&&(de=f(Array(Le-2).fill(Se)))),Le-=2,ze.pop(),ze.pop();for(var ut=0;ut+r(a(J),a(j))),be>100){var Pt=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+We.join(", "));throw Pt.values=We,Pt.vectors=[],Pt}var fe=Ce?i(ct,ie(lt,ce)):void 0;return{values:We,C:fe}}function H(we,ce,Ee,Pe,Ce,Oe,He){var Se=x(Ee),ze=i(Se,we,Ee),We=He==="BigNumber",Le=He==="Complex",lt=We?s(0):Le?O(0):0,ct=We?s(1):Le?O(1):1,de=[],be=[];for(var Ue of Ce){var ge=Y(de,Ue,E);ge===-1?(de.push(Ue),be.push(1)):be[ge]+=1}for(var Re=[],Be=de.length,Ke=Array(ce).fill(lt),ot=f(Array(ce).fill(ct)),Qe=function(){var fe=de[ut],J=r(ze,i(fe,ot)),j=A(J,Ke);for(j.shift();j.lengthi(me,xe)),Re.push(...j.map(xe=>({value:fe,vector:n(xe)})))},ut=0;ut=5)return null;for(Se=0;;){var ze=w(we,He);if(I(he(re(He,[ze])),Pe))break;if(++Se>=10)return null;He=De(ze)}return He}function le(we,ce,Ee){var Pe=Ee==="BigNumber",Ce=Ee==="Complex",Oe=Array(we).fill(0).map(He=>2*Math.random()-1);return Pe&&(Oe=Oe.map(He=>s(He))),Ce&&(Oe=Oe.map(He=>O(He))),Oe=re(Oe,ce),De(Oe,Ee)}function re(we,ce){var Ee=p(we);for(var Pe of ce)Pe=h(Pe,Ee),we=r(we,i(u(C(Pe,we),C(Pe,Pe)),Pe));return we}function he(we){return a(l(C(we,we)))}function De(we,ce){var Ee=ce==="BigNumber",Pe=ce==="Complex",Ce=Ee?s(1):Pe?O(1):1;return i(u(Ce,he(we)),we)}return P}g();y();v();function rq(e){var{config:t,addScalar:r,subtract:n,abs:i,atan:o,cos:u,sin:l,multiplyScalar:a,inv:s,bignumber:f,multiply:p,add:h}=e;function x(q,U){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.relTol,V=arguments.length>3?arguments[3]:void 0,W=arguments.length>4?arguments[4]:void 0;if(V==="number")return b(q,H,W);if(V==="BigNumber")return w(q,H,W);throw TypeError("Unsupported data type: "+V)}function b(q,U,H){var V=q.length,W=Math.abs(U/V),ee,ie;if(H){ie=new Array(V);for(var Y=0;Y=Math.abs(W);){var le=Z[0][0],re=Z[0][1];ee=A(q[le][le],q[re][re],q[le][re]),q=F(q,ee,le,re),H&&(ie=O(ie,ee,le,re)),Z=C(q)}for(var he=Array(V).fill(0),De=0;De=i(W);){var le=Z[0][0],re=Z[0][1];ee=E(q[le][le],q[re][re],q[le][re]),q=I(q,ee,le,re),H&&(ie=M(ie,ee,le,re)),Z=P(q)}for(var he=Array(V).fill(0),De=0;De({value:W[ce],vector:we}));return{values:W,eigenvectors:De}}return x}var lce="eigs",fce=["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"],nq=K(lce,fce,e=>{var{config:t,typed:r,matrix:n,addScalar:i,subtract:o,equal:u,abs:l,atan:a,cos:s,sin:f,multiplyScalar:p,divideScalar:h,inv:x,bignumber:b,multiply:w,add:A,larger:E,column:O,flatten:M,number:I,complex:F,sqrt:C,diag:P,size:R,reshape:q,qr:U,usolve:H,usolveAll:V,im:W,re:ee,smaller:ie,matrixFromColumns:Y,dot:Z}=e,le=rq({config:t,addScalar:i,subtract:o,column:O,flatten:M,equal:u,abs:l,atan:a,cos:s,sin:f,multiplyScalar:p,inv:x,bignumber:b,complex:F,multiply:w,add:A}),re=tq({config:t,addScalar:i,subtract:o,multiply:w,multiplyScalar:p,flatten:M,divideScalar:h,sqrt:C,abs:l,bignumber:b,diag:P,size:R,reshape:q,qr:U,inv:x,usolve:H,usolveAll:V,equal:u,complex:F,larger:E,smaller:ie,matrixFromColumns:Y,dot:Z});return r("eigs",{Array:function(Oe){return he(n(Oe))},"Array, number|BigNumber":function(Oe,He){return he(n(Oe),{precision:He})},"Array, Object"(Ce,Oe){return he(n(Ce),Oe)},Matrix:function(Oe){return he(Oe,{matricize:!0})},"Matrix, number|BigNumber":function(Oe,He){return he(Oe,{precision:He,matricize:!0})},"Matrix, Object":function(Oe,He){var Se={matricize:!0};return Jn(Se,He),he(Oe,Se)}});function he(Ce){var Oe,He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Se="eigenvectors"in He?He.eigenvectors:!0,ze=(Oe=He.precision)!==null&&Oe!==void 0?Oe:t.relTol,We=De(Ce,ze,Se);return He.matricize&&(We.values=n(We.values),Se&&(We.eigenvectors=We.eigenvectors.map(Le=>{var{value:lt,vector:ct}=Le;return{value:lt,vector:n(ct)}}))),Se&&Object.defineProperty(We,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),We}function De(Ce,Oe,He){var Se=Ce.toArray(),ze=Ce.size();if(ze.length!==2||ze[0]!==ze[1])throw new RangeError("Matrix must be square (size: ".concat(Kt(ze),")"));var We=ze[0];if(ce(Se,We,Oe)&&(Ee(Se,We),we(Se,We,Oe))){var Le=Pe(Ce,Se,We);return le(Se,We,Oe,Le,He)}var lt=Pe(Ce,Se,We);return re(Se,We,Oe,lt,He)}function we(Ce,Oe,He){for(var Se=0;Se{var{typed:t,abs:r,add:n,identity:i,inv:o,multiply:u}=e;return t(iq,{Matrix:function(p){var h=p.size();if(h.length!==2||h[0]!==h[1])throw new RangeError("Matrix must be square (size: "+Kt(h)+")");for(var x=h[0],b=1e-15,w=l(p),A=a(w,b),E=A.q,O=A.j,M=u(p,Math.pow(2,-O)),I=i(x),F=i(x),C=1,P=M,R=-1,q=1;q<=E;q++)q>1&&(P=u(P,M),R=-R),C=C*(E-q+1)/((2*E-q+1)*q),I=n(I,u(C,P)),F=n(F,u(C*R,P));for(var U=u(o(F),I),H=0;H{var{typed:t,abs:r,add:n,multiply:i,map:o,sqrt:u,subtract:l,inv:a,size:s,max:f,identity:p}=e,h=1e3,x=1e-6;function b(w){var A,E=0,O=w,M=p(s(w));do{var I=O;if(O=i(.5,n(I,a(M))),M=i(.5,n(M,a(I))),A=f(r(l(O,I))),A>x&&++E>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(A>x);return O}return t(aq,{"Array | Matrix":function(A){var E=Et(A)?A.size():Wt(A);switch(E.length){case 1:if(E[0]===1)return o(A,u);throw new RangeError("Matrix must be square (size: "+Kt(E)+")");case 2:{var O=E[0],M=E[1];if(O===M)return b(A);throw new RangeError("Matrix must be square (size: "+Kt(E)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Kt(E)+")")}}})});g();y();v();var uq="sylvester",mce=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],lq=K(uq,mce,e=>{var{typed:t,schur:r,matrixFromColumns:n,matrix:i,multiply:o,range:u,concat:l,transpose:a,index:s,subset:f,add:p,subtract:h,identity:x,lusolve:b,abs:w}=e;return t(uq,{"Matrix, Matrix, Matrix":A,"Array, Matrix, Matrix":function(O,M,I){return A(i(O),M,I)},"Array, Array, Matrix":function(O,M,I){return A(i(O),i(M),I)},"Array, Matrix, Array":function(O,M,I){return A(i(O),M,i(I))},"Matrix, Array, Matrix":function(O,M,I){return A(O,i(M),I)},"Matrix, Array, Array":function(O,M,I){return A(O,i(M),i(I))},"Matrix, Matrix, Array":function(O,M,I){return A(O,M,i(I))},"Array, Array, Array":function(O,M,I){return A(i(O),i(M),i(I)).toArray()}});function A(E,O,M){for(var I=O.size()[0],F=E.size()[0],C=r(E),P=C.T,R=C.U,q=r(o(-1,O)),U=q.T,H=q.U,V=o(o(a(R),M),H),W=u(0,F),ee=[],ie=(Le,lt)=>l(Le,lt,1),Y=(Le,lt)=>l(Le,lt,0),Z=0;Z1e-5){for(var le=Y(f(V,s(W,Z)),f(V,s(W,Z+1))),re=0;re{var{typed:t,matrix:r,identity:n,multiply:i,qr:o,norm:u,subtract:l}=e;return t(fq,{Array:function(f){var p=a(r(f));return{U:p.U.valueOf(),T:p.T.valueOf()}},Matrix:function(f){return a(f)}});function a(s){var f=s.size()[0],p=s,h=n(f),x=0,b;do{b=p;var w=o(p),A=w.Q,E=w.R;if(p=i(E,A),h=i(h,A),x++>100)break}while(u(l(p,b))>1e-4);return{U:h,T:p}}});g();y();v();var pq="lyap",dce=["typed","matrix","sylvester","multiply","transpose"],mq=K(pq,dce,e=>{var{typed:t,matrix:r,sylvester:n,multiply:i,transpose:o}=e;return t(pq,{"Matrix, Matrix":function(l,a){return n(l,o(l),i(-1,a))},"Array, Matrix":function(l,a){return n(r(l),o(r(l)),i(-1,a))},"Matrix, Array":function(l,a){return n(l,o(r(l)),r(i(-1,a)))},"Array, Array":function(l,a){return n(r(l),o(r(l)),r(i(-1,a))).toArray()}})});g();y();v();var gce="divide",vce=["typed","matrix","multiply","equalScalar","divideScalar","inv"],hq=K(gce,vce,e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:o,inv:u}=e,l=Pr({typed:t,equalScalar:i}),a=Qn({typed:t});return t("divide",bx({"Array | Matrix, Array | Matrix":function(f,p){return n(f,u(p))},"DenseMatrix, any":function(f,p){return a(f,p,o,!1)},"SparseMatrix, any":function(f,p){return l(f,p,o,!1)},"Array, any":function(f,p){return a(r(f),p,o,!1).valueOf()},"any, Array | Matrix":function(f,p){return n(f,u(p))}},o.signatures))});g();y();v();var dq="distance",yce=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],gq=K(dq,yce,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,deepEqual:u,sqrt:l,abs:a}=e;return t(dq,{"Array, Array, Array":function(F,C,P){if(F.length===2&&C.length===2&&P.length===2){if(!f(F))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!f(P))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(u(C,P))throw new TypeError("LinePoint1 should not be same with LinePoint2");var R=n(P[1],C[1]),q=n(C[0],P[0]),U=n(i(P[0],C[1]),i(C[0],P[1]));return A(F[0],F[1],R,q,U)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(F,C,P){if(Object.keys(F).length===2&&Object.keys(C).length===2&&Object.keys(P).length===2){if(!f(F))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(C))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!f(P))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(u(b(C),b(P)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in F&&"pointY"in F&&"lineOnePtX"in C&&"lineOnePtY"in C&&"lineTwoPtX"in P&&"lineTwoPtY"in P){var R=n(P.lineTwoPtY,C.lineOnePtY),q=n(C.lineOnePtX,P.lineTwoPtX),U=n(i(P.lineTwoPtX,C.lineOnePtY),i(C.lineOnePtX,P.lineTwoPtY));return A(F.pointX,F.pointY,R,q,U)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(F,C){if(F.length===2&&C.length===3){if(!f(F))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return A(F[0],F[1],C[0],C[1],C[2])}else if(F.length===3&&C.length===6){if(!p(F))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!x(C))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return E(F[0],F[1],F[2],C[0],C[1],C[2],C[3],C[4],C[5])}else if(F.length===C.length&&F.length>0){if(!h(F))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!h(C))throw new TypeError("All values of an array should be numbers or BigNumbers");return O(F,C)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(F,C){if(Object.keys(F).length===2&&Object.keys(C).length===3){if(!f(F))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(C))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in F&&"pointY"in F&&"xCoeffLine"in C&&"yCoeffLine"in C&&"constant"in C)return A(F.pointX,F.pointY,C.xCoeffLine,C.yCoeffLine,C.constant);throw new TypeError("Key names do not match")}else if(Object.keys(F).length===3&&Object.keys(C).length===6){if(!p(F))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!x(C))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in F&&"pointY"in F&&"x0"in C&&"y0"in C&&"z0"in C&&"a"in C&&"b"in C&&"c"in C)return E(F.pointX,F.pointY,F.pointZ,C.x0,C.y0,C.z0,C.a,C.b,C.c);throw new TypeError("Key names do not match")}else if(Object.keys(F).length===2&&Object.keys(C).length===2){if(!f(F))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!f(C))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in F&&"pointOneY"in F&&"pointTwoX"in C&&"pointTwoY"in C)return O([F.pointOneX,F.pointOneY],[C.pointTwoX,C.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(F).length===3&&Object.keys(C).length===3){if(!p(F))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(C))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in F&&"pointOneY"in F&&"pointOneZ"in F&&"pointTwoX"in C&&"pointTwoY"in C&&"pointTwoZ"in C)return O([F.pointOneX,F.pointOneY,F.pointOneZ],[C.pointTwoX,C.pointTwoY,C.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(F){if(!w(F))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return M(F)}});function s(I){return typeof I=="number"||kt(I)}function f(I){return I.constructor!==Array&&(I=b(I)),s(I[0])&&s(I[1])}function p(I){return I.constructor!==Array&&(I=b(I)),s(I[0])&&s(I[1])&&s(I[2])}function h(I){return Array.isArray(I)||(I=b(I)),I.every(s)}function x(I){return I.constructor!==Array&&(I=b(I)),s(I[0])&&s(I[1])&&s(I[2])&&s(I[3])&&s(I[4])&&s(I[5])}function b(I){for(var F=Object.keys(I),C=[],P=0;PF.length!==2||!s(F[0])||!s(F[1])))return!1}else if(I[0].length===3&&s(I[0][0])&&s(I[0][1])&&s(I[0][2])){if(I.some(F=>F.length!==3||!s(F[0])||!s(F[1])||!s(F[2])))return!1}else return!1;return!0}function A(I,F,C,P,R){var q=a(r(r(i(C,I),i(P,F)),R)),U=l(r(i(C,C),i(P,P)));return o(q,U)}function E(I,F,C,P,R,q,U,H,V){var W=[n(i(n(R,F),V),i(n(q,C),H)),n(i(n(q,C),U),i(n(P,I),V)),n(i(n(P,I),H),i(n(R,F),U))];W=l(r(r(i(W[0],W[0]),i(W[1],W[1])),i(W[2],W[2])));var ee=l(r(r(i(U,U),i(H,H)),i(V,V)));return o(W,ee)}function O(I,F){for(var C=I.length,P=0,R=0,q=0;q{var{typed:t,config:r,abs:n,add:i,addScalar:o,matrix:u,multiply:l,multiplyScalar:a,divideScalar:s,subtract:f,smaller:p,equalScalar:h,flatten:x,isZero:b,isNumeric:w}=e;return t("intersect",{"Array, Array, Array":A,"Array, Array, Array, Array":E,"Matrix, Matrix, Matrix":function(H,V,W){var ee=A(H.valueOf(),V.valueOf(),W.valueOf());return ee===null?null:u(ee)},"Matrix, Matrix, Matrix, Matrix":function(H,V,W,ee){var ie=E(H.valueOf(),V.valueOf(),W.valueOf(),ee.valueOf());return ie===null?null:u(ie)}});function A(U,H,V){if(U=O(U),H=O(H),V=O(V),!I(U))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!I(H))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!F(V))throw new TypeError("Array with 4 numbers expected as third argument");return q(U[0],U[1],U[2],H[0],H[1],H[2],V[0],V[1],V[2],V[3])}function E(U,H,V,W){if(U=O(U),H=O(H),V=O(V),W=O(W),U.length===2){if(!M(U))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!M(H))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!M(V))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!M(W))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return C(U,H,V,W)}else if(U.length===3){if(!I(U))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!I(H))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!I(V))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!I(W))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return R(U[0],U[1],U[2],H[0],H[1],H[2],V[0],V[1],V[2],W[0],W[1],W[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function O(U){return U.length===1?U[0]:U.length>1&&Array.isArray(U[0])&&U.every(H=>Array.isArray(H)&&H.length===1)?x(U):U}function M(U){return U.length===2&&w(U[0])&&w(U[1])}function I(U){return U.length===3&&w(U[0])&&w(U[1])&&w(U[2])}function F(U){return U.length===4&&w(U[0])&&w(U[1])&&w(U[2])&&w(U[3])}function C(U,H,V,W){var ee=U,ie=V,Y=f(ee,H),Z=f(ie,W),le=f(a(Y[0],Z[1]),a(Z[0],Y[1]));if(b(le)||p(n(le),r.relTol))return null;var re=a(Z[0],ee[1]),he=a(Z[1],ee[0]),De=a(Z[0],ie[1]),we=a(Z[1],ie[0]),ce=s(o(f(f(re,he),De),we),le);return i(l(Y,ce),ee)}function P(U,H,V,W,ee,ie,Y,Z,le,re,he,De){var we=a(f(U,H),f(V,W)),ce=a(f(ee,ie),f(Y,Z)),Ee=a(f(le,re),f(he,De));return o(o(we,ce),Ee)}function R(U,H,V,W,ee,ie,Y,Z,le,re,he,De){var we=P(U,Y,re,Y,H,Z,he,Z,V,le,De,le),ce=P(re,Y,W,U,he,Z,ee,H,De,le,ie,V),Ee=P(U,Y,W,U,H,Z,ee,H,V,le,ie,V),Pe=P(re,Y,re,Y,he,Z,he,Z,De,le,De,le),Ce=P(W,U,W,U,ee,H,ee,H,ie,V,ie,V),Oe=f(a(we,ce),a(Ee,Pe)),He=f(a(Ce,Pe),a(ce,ce));if(b(He))return null;var Se=s(Oe,He),ze=s(o(we,a(Se,ce)),Pe),We=o(U,a(Se,f(W,U))),Le=o(H,a(Se,f(ee,H))),lt=o(V,a(Se,f(ie,V))),ct=o(Y,a(ze,f(re,Y))),de=o(Z,a(ze,f(he,Z))),be=o(le,a(ze,f(De,le)));return h(We,ct)&&h(Le,de)&&h(lt,be)?[We,Le,lt]:null}function q(U,H,V,W,ee,ie,Y,Z,le,re){var he=a(U,Y),De=a(W,Y),we=a(H,Z),ce=a(ee,Z),Ee=a(V,le),Pe=a(ie,le),Ce=f(f(f(re,he),we),Ee),Oe=f(f(f(o(o(De,ce),Pe),he),we),Ee),He=s(Ce,Oe),Se=o(U,a(He,f(W,U))),ze=o(H,a(He,f(ee,H))),We=o(V,a(He,f(ie,V)));return[Se,ze,We]}});g();y();v();var yq="sum",bce=["typed","config","add","numeric"],Yw=K(yq,bce,e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t(yq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":u,"...":function(a){if(Va(a))throw new TypeError("Scalar values expected in function sum");return o(a)}});function o(l){var a;return mo(l,function(s){try{a=a===void 0?s:n(a,s)}catch(f){throw Tn(f,"sum",s)}}),a===void 0&&(a=i(0,r.number)),typeof a=="string"&&(a=i(a,co(a,r))),a}function u(l,a){try{var s=kf(l,a,n);return s}catch(f){throw Tn(f,"sum")}}});g();y();v();var Zw="cumsum",Dce=["typed","add","unaryPlus"],Xw=K(Zw,Dce,e=>{var{typed:t,add:r,unaryPlus:n}=e;return t(Zw,{Array:i,Matrix:function(s){return s.create(i(s.valueOf()))},"Array, number | BigNumber":u,"Matrix, number | BigNumber":function(s,f){return s.create(u(s.valueOf(),f))},"...":function(s){if(Va(s))throw new TypeError("All values expected to be scalar in function cumsum");return i(s)}});function i(a){try{return o(a)}catch(s){throw Tn(s,Zw)}}function o(a){if(a.length===0)return[];for(var s=[n(a[0])],f=1;f=f.length)throw new Mi(s,f.length);try{return l(a,s)}catch(p){throw Tn(p,Zw)}}function l(a,s){var f,p,h;if(s<=0){var x=a[0][0];if(Array.isArray(x)){for(h=$x(a),p=[],f=0;f{var{typed:t,add:r,divide:n}=e;return t(xq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":i,"...":function(l){if(Va(l))throw new TypeError("Scalar values expected in function mean");return o(l)}});function i(u,l){try{var a=kf(u,l,r),s=Array.isArray(u)?Wt(u):u.size();return n(a,s[l])}catch(f){throw Tn(f,"mean")}}function o(u){var l,a=0;if(mo(u,function(s){try{l=l===void 0?s:r(l,s),a++}catch(f){throw Tn(f,"mean",s)}}),a===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,a)}});g();y();v();var wq="median",Ece=["typed","add","divide","compare","partitionSelect"],bq=K(wq,Ece,e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:o}=e;function u(s){try{s=nr(s.valueOf());var f=s.length;if(f===0)throw new Error("Cannot calculate median of an empty array");if(f%2===0){for(var p=f/2-1,h=o(s,p+1),x=s[p],b=0;b0&&(x=s[b]);return a(x,h)}else{var w=o(s,(f-1)/2);return l(w)}}catch(A){throw Tn(A,"median")}}var l=t({"number | BigNumber | Complex | Unit":function(f){return f}}),a=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(f,p){return n(r(f,p),2)}});return t(wq,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(f,p){throw new Error("median(A, dim) is not yet supported")},"...":function(f){if(Va(f))throw new TypeError("Scalar values expected in function median");return u(f)}})});g();y();v();var Dq="mad",Sce=["typed","abs","map","median","subtract"],Nq=K(Dq,Sce,e=>{var{typed:t,abs:r,map:n,median:i,subtract:o}=e;return t(Dq,{"Array | Matrix":u,"...":function(a){return u(a)}});function u(l){if(l=nr(l.valueOf()),l.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var a=i(l);return i(n(l,function(s){return r(o(s,a))}))}catch(s){throw s instanceof TypeError&&s.message.includes("median")?new TypeError(s.message.replace("median","mad")):Tn(s,"mad")}}});g();y();v();var RA="unbiased",Eq="variance",Ace=["typed","add","subtract","multiply","divide","apply","isNaN"],Jw=K(Eq,Ace,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l}=e;return t(Eq,{"Array | Matrix":function(p){return a(p,RA)},"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":function(p,h){return s(p,h,RA)},"Array | Matrix, number | BigNumber, string":s,"...":function(p){return a(p,RA)}});function a(f,p){var h,x=0;if(f.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(mo(f,function(A){try{h=h===void 0?A:r(h,A),x++}catch(E){throw Tn(E,"variance",A)}}),x===0)throw new Error("Cannot calculate variance of an empty array");var b=o(h,x);if(h=void 0,mo(f,function(A){var E=n(A,b);h=h===void 0?i(E,E):r(h,i(E,E))}),l(h))return h;switch(p){case"uncorrected":return o(h,x);case"biased":return o(h,x+1);case"unbiased":{var w=kt(h)?h.mul(0):0;return x===1?w:o(h,x-1)}default:throw new Error('Unknown normalization "'+p+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function s(f,p,h){try{if(f.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return u(f,p,x=>a(x,h))}catch(x){throw Tn(x,"variance")}}});g();y();v();var Sq="quantileSeq",Cce=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Qw=K(Sq,Cce,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:u,partitionSelect:l,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h}=e,x=Nh({typed:t,isInteger:s});return t(Sq,{"Array | Matrix, number | BigNumber":(O,M)=>w(O,M,!1),"Array | Matrix, number | BigNumber, number":(O,M,I)=>b(O,M,!1,I,w),"Array | Matrix, number | BigNumber, boolean":w,"Array | Matrix, number | BigNumber, boolean, number":(O,M,I,F)=>b(O,M,I,F,w),"Array | Matrix, Array | Matrix":(O,M)=>A(O,M,!1),"Array | Matrix, Array | Matrix, number":(O,M,I)=>b(O,M,!1,I,A),"Array | Matrix, Array | Matrix, boolean":A,"Array | Matrix, Array | Matrix, boolean, number":(O,M,I,F)=>b(O,M,I,F,A)});function b(O,M,I,F,C){return x(O,F,P=>C(P,M,I))}function w(O,M,I){var F,C=O.valueOf();if(f(M,0))throw new Error("N/prob must be non-negative");if(p(M,1))return $t(M)?E(C,M,I):r(E(C,M,I));if(h(M,1)){if(!s(M))throw new Error("N must be a positive integer");if(h(M,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var P=n(M,1);F=[];for(var R=0;f(R,M);R++){var q=o(R+1,P);F.push(E(C,q,I))}return $t(M)?F:r(F)}}function A(O,M,I){for(var F=O.valueOf(),C=M.valueOf(),P=[],R=0;R0&&(U=F[V])}return n(u(U,i(1,q)),u(H,q))}});g();y();v();var Aq="std",Mce=["typed","map","sqrt","variance"],jw=K(Aq,Mce,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t(Aq,{"Array | Matrix":o,"Array | Matrix, string":o,"Array | Matrix, number | BigNumber":o,"Array | Matrix, number | BigNumber, string":o,"...":function(l){return o(l)}});function o(u,l){if(u.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var a=i.apply(null,arguments);return yn(a)?r(a,n):n(a)}catch(s){throw s instanceof TypeError&&s.message.includes(" variance")?new TypeError(s.message.replace(" variance"," std")):s}}});g();y();v();var Cq="corr",Tce=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],Mq=K(Cq,Tce,e=>{var{typed:t,matrix:r,sqrt:n,sum:i,add:o,subtract:u,multiply:l,pow:a,divide:s}=e;return t(Cq,{"Array, Array":function(x,b){return f(x,b)},"Matrix, Matrix":function(x,b){var w=f(x.toArray(),b.toArray());return Array.isArray(w)?r(w):w}});function f(h,x){var b=[];if(Array.isArray(h[0])&&Array.isArray(x[0])){if(h.length!==x.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var w=0;wo(C,l(P,x[R])),0),O=i(h.map(C=>a(C,2))),M=i(x.map(C=>a(C,2))),I=u(l(b,E),l(w,A)),F=n(l(u(l(b,O),a(w,2)),u(l(b,M),a(A,2))));return s(I,F)}});g();y();v();var Tq="combinations",Oce=["typed"],Iq=K(Tq,Oce,e=>{var{typed:t}=e;return t(Tq,{"number, number":tA,"BigNumber, BigNumber":function(n,i){var o=n.constructor,u,l,a=n.minus(i),s=new o(1);if(!Oq(n)||!Oq(i))throw new TypeError("Positive integer value expected in function combinations");if(i.gt(n))throw new TypeError("k must be less than n in function combinations");if(u=s,i.lt(a))for(l=s;l.lte(a);l=l.plus(s))u=u.times(i.plus(l)).dividedBy(l);else for(l=s;l.lte(i);l=l.plus(s))u=u.times(a.plus(l)).dividedBy(l);return u}})});function Oq(e){return e.isInteger()&&e.gte(0)}g();y();v();var Fq="combinationsWithRep",Ice=["typed"],kq=K(Fq,Ice,e=>{var{typed:t}=e;return t(Fq,{"number, number":function(n,i){if(!Nt(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Nt(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(i{var{typed:t,config:r,multiplyScalar:n,pow:i,BigNumber:o,Complex:u}=e;function l(s){if(s.im===0)return Cv(s.re);if(s.re<.5){var f=new u(1-s.re,-s.im),p=new u(Math.PI*s.re,Math.PI*s.im);return new u(Math.PI).div(p.sin()).div(l(f))}s=new u(s.re-1,s.im);for(var h=new u(vp[0],0),x=1;x2;)h-=2,b+=h,x=x.times(b);return new o(x.toPrecision(o.precision))}});g();y();v();var Pq="lgamma",_ce=["Complex","typed"],Rq=K(Pq,_ce,e=>{var{Complex:t,typed:r}=e,n=7,i=7,o=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(Pq,{number:Mv,Complex:u,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function u(s){var f=6.283185307179586,p=1.1447298858494002,h=.1;if(s.isNaN())return new t(NaN,NaN);if(s.im===0)return new t(Mv(s.re),0);if(s.re>=n||Math.abs(s.im)>=i)return l(s);if(s.re<=h){var x=oF(f,s.im)*Math.floor(.5*s.re+.25),b=s.mul(Math.PI).sin().log(),w=u(new t(1-s.re,-s.im));return new t(p,x).sub(b).sub(w)}else return s.im>=0?a(s):a(s.conjugate()).conjugate()}function l(s){for(var f=s.sub(.5).mul(s.log()).sub(s).add(oA),p=new t(1,0).div(s),h=p.div(s),x=o[0],b=o[1],w=2*h.re,A=h.re*h.re+h.im*h.im,E=2;E<8;E++){var O=b;b=-A*x+o[E],x=w*x+O}var M=p.mul(h.mul(x).add(b));return f.add(M)}function a(s){var f=0,p=0,h=s;for(s=s.add(1);s.re<=n;){h=h.mul(s);var x=h.im<0?1:0;x!==0&&p===0&&f++,p=x,s=s.add(1)}return l(s).sub(h.log()).sub(new t(0,f*2*Math.PI*1))}});g();y();v();var qq="factorial",kce=["typed","gamma"],zq=K(qq,kce,e=>{var{typed:t,gamma:r}=e;return t(qq,{number:function(i){if(i<0)throw new Error("Value must be non-negative");return r(i+1)},BigNumber:function(i){if(i.isNegative())throw new Error("Value must be non-negative");return r(i.plus(1))},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();y();v();var Uq="kldivergence",Bce=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Hq=K(Uq,Bce,e=>{var{typed:t,matrix:r,divide:n,sum:i,multiply:o,map:u,dotDivide:l,log:a,isNumeric:s}=e;return t(Uq,{"Array, Array":function(h,x){return f(r(h),r(x))},"Matrix, Array":function(h,x){return f(h,r(x))},"Array, Matrix":function(h,x){return f(r(h),x)},"Matrix, Matrix":function(h,x){return f(h,x)}});function f(p,h){var x=h.size().length,b=p.size().length;if(x>1)throw new Error("first object must be one dimensional");if(b>1)throw new Error("second object must be one dimensional");if(x!==b)throw new Error("Length of two vectors must be equal");var w=i(p);if(w===0)throw new Error("Sum of elements in first object must be non zero");var A=i(h);if(A===0)throw new Error("Sum of elements in second object must be non zero");var E=n(p,i(p)),O=n(h,i(h)),M=i(o(E,u(l(E,O),I=>a(I))));return s(M)?M:Number.NaN}});g();y();v();var $q="multinomial",Lce=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Wq=K($q,Lce,e=>{var{typed:t,add:r,divide:n,multiply:i,factorial:o,isInteger:u,isPositive:l}=e;return t($q,{"Array | Matrix":function(s){var f=0,p=1;return mo(s,function(h){if(!u(h)||!l(h))throw new TypeError("Positive integer value expected in function multinomial");f=r(f,h),p=i(p,o(h))}),n(o(f),p)}})});g();y();v();var Vq="permutations",Pce=["typed","factorial"],Yq=K(Vq,Pce,e=>{var{typed:t,factorial:r}=e;return t(Vq,{"number | BigNumber":r,"number, number":function(i,o){if(!Nt(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(!Nt(o)||o<0)throw new TypeError("Positive integer value expected in function permutations");if(o>i)throw new TypeError("second argument k must be less than or equal to first argument n");return ya(i-o+1,i)},"BigNumber, BigNumber":function(i,o){var u,l;if(!Gq(i)||!Gq(o))throw new TypeError("Positive integer value expected in function permutations");if(o.gt(i))throw new TypeError("second argument k must be less than or equal to first argument n");var a=i.mul(0).add(1);for(u=a,l=i.minus(o).plus(1);l.lte(i);l=l.plus(1))u=u.times(l);return u}})});function Gq(e){return e.isInteger()&&e.gte(0)}g();y();v();g();y();v();var VA=rn(cz(),1),Vce=(0,VA.default)(Date.now());function Dl(e){var t;function r(i){t=i===null?Vce:(0,VA.default)(String(i))}r(e);function n(){return t()}return n}var pz="pickRandom",Gce=["typed","config","?on"],mz=K(pz,Gce,e=>{var{typed:t,config:r,on:n}=e,i=Dl(r.randomSeed);return n&&n("config",function(u,l){u.randomSeed!==l.randomSeed&&(i=Dl(u.randomSeed))}),t(pz,{"Array | Matrix":function(l){return o(l,{})},"Array | Matrix, Object":function(l,a){return o(l,a)},"Array | Matrix, number":function(l,a){return o(l,{number:a})},"Array | Matrix, Array | Matrix":function(l,a){return o(l,{weights:a})},"Array | Matrix, Array | Matrix, number":function(l,a,s){return o(l,{number:s,weights:a})},"Array | Matrix, number, Array | Matrix":function(l,a,s){return o(l,{number:a,weights:s})}});function o(u,l){var{number:a,weights:s,elementWise:f=!0}=l,p=typeof a>"u";p&&(a=1);var h=Et(u)?u.create:Et(s)?s.create:null;u=u.valueOf(),s&&(s=s.valueOf()),f===!0&&(u=nr(u),s=nr(s));var x=0;if(typeof s<"u"){if(s.length!==u.length)throw new Error("Weights must have the same length as possibles");for(var b=0,w=s.length;b"u")O=u[Math.floor(i()*A)];else for(var M=i()*x,I=0,F=u.length;I1)for(var n=0,i=e.shift();n{var{typed:t,config:r,on:n}=e,i=Dl(r.randomSeed);return n&&n("config",function(l,a){l.randomSeed!==a.randomSeed&&(i=Dl(l.randomSeed))}),t(hz,{"":()=>u(0,1),number:l=>u(0,l),"number, number":(l,a)=>u(l,a),"Array | Matrix":l=>o(l,0,1),"Array | Matrix, number":(l,a)=>o(l,0,a),"Array | Matrix, number, number":(l,a,s)=>o(l,a,s)});function o(l,a,s){var f=_v(l.valueOf(),()=>u(a,s));return Et(l)?l.create(f):f}function u(l,a){return l+i()*(a-l)}});g();y();v();var gz="randomInt",Zce=["typed","config","?on"],vz=K(gz,Zce,e=>{var{typed:t,config:r,on:n}=e,i=Dl(r.randomSeed);return n&&n("config",function(l,a){l.randomSeed!==a.randomSeed&&(i=Dl(l.randomSeed))}),t(gz,{"":()=>u(0,1),number:l=>u(0,l),"number, number":(l,a)=>u(l,a),"Array | Matrix":l=>o(l,0,1),"Array | Matrix, number":(l,a)=>o(l,0,a),"Array | Matrix, number, number":(l,a,s)=>o(l,a,s)});function o(l,a,s){var f=_v(l.valueOf(),()=>u(a,s));return Et(l)?l.create(f):f}function u(l,a){return Math.floor(l+i()*(a-l))}});g();y();v();var yz="stirlingS2",Xce=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],xz=K(yz,Xce,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,pow:u,factorial:l,combinations:a,isNegative:s,isInteger:f,number:p,bignumber:h,larger:x}=e,b=[],w=[];return t(yz,{"number | BigNumber, number | BigNumber":function(E,O){if(!f(E)||s(E)||!f(O)||s(O))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(x(O,E))throw new TypeError("k must be less than or equal to n in function stirlingS2");var M=!($t(E)&&$t(O)),I=M?w:b,F=M?h:p,C=p(E),P=p(O);if(I[C]&&I[C].length>P)return I[C][P];for(var R=0;R<=C;++R)if(I[R]||(I[R]=[F(R===0?1:0)]),R!==0)for(var q=I[R],U=I[R-1],H=q.length;H<=R&&H<=P;++H)H===R?q[H]=1:q[H]=r(i(F(H),U[H]),U[H-1]);return I[C][P]}})});g();y();v();var wz="bellNumbers",Kce=["typed","addScalar","isNegative","isInteger","stirlingS2"],bz=K(wz,Kce,e=>{var{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:o}=e;return t(wz,{"number | BigNumber":function(l){if(!i(l)||n(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var a=0,s=0;s<=l;s++)a=r(a,o(l,s));return a}})});g();y();v();var Dz="catalan",Jce=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],Nz=K(Dz,Jce,e=>{var{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:o,isNegative:u,isInteger:l}=e;return t(Dz,{"number | BigNumber":function(s){if(!l(s)||u(s))throw new TypeError("Non-negative integer value expected in function catalan");return n(o(i(s,2),s),r(s,1))}})});g();y();v();var Ez="composition",Qce=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],Sz=K(Ez,Qce,e=>{var{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:o,isInteger:u,larger:l}=e;return t(Ez,{"number | BigNumber, number | BigNumber":function(s,f){if(!u(s)||!i(s)||!u(f)||!i(f))throw new TypeError("Positive integer value expected in function composition");if(l(f,s))throw new TypeError("k must be less than or equal to n in function composition");return n(r(s,-1),r(f,-1))}})});g();y();v();var Az="leafCount",jce=["parse","typed"],Cz=K(Az,jce,e=>{var{parse:t,typed:r}=e;function n(i){var o=0;return i.forEach(u=>{o+=n(u)}),o||1}return r(Az,{Node:function(o){return n(o)}})});g();y();v();g();y();v();function GA(e){return or(e)||Xr(e)&&e.isUnary()&&or(e.args[0])}function kv(e){return!!(or(e)||(eo(e)||Xr(e))&&e.args.every(kv)||Si(e)&&kv(e.content))}g();y();v();function Mz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function YA(e){for(var t=1;t{var{FunctionNode:t,OperatorNode:r,SymbolNode:n}=e,i=!0,o=!1,u="defaultF",l={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:o,total:i,commutative:o,associative:o},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:o,total:i,commutative:o,associative:o},paren:{trivial:i,total:i,commutative:i,associative:o},defaultF:{trivial:o,total:i,commutative:o,associative:o}},a={divide:{total:o},log:{total:o}},s={subtract:{total:o},abs:{trivial:i},log:{total:i}};function f(M,I){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,C=u;if(typeof M=="string"?C=M:Xr(M)?C=M.fn.toString():eo(M)?C=M.name:Si(M)&&(C="paren"),St(F,C)){var P=F[C];if(St(P,I))return P[I];if(St(l,C))return l[C][I]}if(St(F,u)){var R=F[u];return St(R,I)?R[I]:l[u][I]}if(St(l,C)){var q=l[C];if(St(q,I))return q[I]}return l[u][I]}function p(M){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return f(M,"commutative",I)}function h(M){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return f(M,"associative",I)}function x(M,I){var F=YA({},M);for(var C in I)St(M,C)?F[C]=YA(YA({},I[C]),M[C]):F[C]=I[C];return F}function b(M,I){if(!M.args||M.args.length===0)return M;M.args=w(M,I);for(var F=0;F2&&h(M,I)){for(var R=M.args.pop();M.args.length>0;)R=F([M.args.pop(),R]);M.args=R.args}}}function E(M,I){if(!(!M.args||M.args.length===0)){for(var F=O(M),C=M.args.length,P=0;P2&&h(M,I)){for(var R=M.args.shift();M.args.length>0;)R=F([R,M.args.shift()]);M.args=R.args}}}function O(M){return Xr(M)?function(I){try{return new r(M.op,M.fn,I,M.implicit)}catch(F){return console.error(F),[]}}:function(I){return new t(new n(M.name),I)}}return{createMakeNodeFunction:O,hasProperty:f,isCommutative:p,isAssociative:h,mergeContext:x,flatten:b,allChildren:w,unflattenr:A,unflattenl:E,defaultContext:l,realContext:a,positiveContext:s}});var rpe="simplify",npe=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Tz=K(rpe,npe,e=>{var{config:t,typed:r,parse:n,add:i,subtract:o,multiply:u,divide:l,pow:a,isZero:s,equal:f,resolve:p,simplifyConstant:h,simplifyCore:x,fraction:b,bignumber:w,mathWithTransform:A,matrix:E,AccessorNode:O,ArrayNode:M,ConstantNode:I,FunctionNode:F,IndexNode:C,ObjectNode:P,OperatorNode:R,ParenthesisNode:q,SymbolNode:U}=e,{hasProperty:H,isCommutative:V,isAssociative:W,mergeContext:ee,flatten:ie,unflattenr:Y,unflattenl:Z,createMakeNodeFunction:le,defaultContext:re,realContext:he,positiveContext:De}=Fh({FunctionNode:F,OperatorNode:R,SymbolNode:U});r.addConversion({from:"Object",to:"Map",convert:gl});var we=r("simplify",{Node:Se,"Node, Map":(ge,Re)=>Se(ge,!1,Re),"Node, Map, Object":(ge,Re,Be)=>Se(ge,!1,Re,Be),"Node, Array":Se,"Node, Array, Map":Se,"Node, Array, Map, Object":Se});r.removeConversion({from:"Object",to:"Map",convert:gl}),we.defaultContext=re,we.realContext=he,we.positiveContext=De;function ce(ge){return ge.transform(function(Re,Be,Ke){return Si(Re)?ce(Re.content):Re})}var Ee={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};we.rules=[x,{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}}},h,{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}}},h,{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"}];function Pe(ge,Re){var Be={};if(ge.s){var Ke=ge.s.split("->");if(Ke.length===2)Be.l=Ke[0],Be.r=Ke[1];else throw SyntaxError("Could not parse rule: "+ge.s)}else Be.l=ge.l,Be.r=ge.r;Be.l=ce(n(Be.l)),Be.r=ce(n(Be.r));for(var ot of["imposeContext","repeat","assuming"])ot in ge&&(Be[ot]=ge[ot]);if(ge.evaluate&&(Be.evaluate=n(ge.evaluate)),W(Be.l,Re)){var Qe=!V(Be.l,Re),ut;Qe&&(ut=He());var Pt=le(Be.l),fe=He();Be.expanded={},Be.expanded.l=Pt([Be.l,fe]),ie(Be.expanded.l,Re),Y(Be.expanded.l,Re),Be.expanded.r=Pt([Be.r,fe]),Qe&&(Be.expandedNC1={},Be.expandedNC1.l=Pt([ut,Be.l]),Be.expandedNC1.r=Pt([ut,Be.r]),Be.expandedNC2={},Be.expandedNC2.l=Pt([ut,Be.expanded.l]),Be.expandedNC2.r=Pt([ut,Be.expanded.r]))}return Be}function Ce(ge,Re){for(var Be=[],Ke=0;Ke2&&arguments[2]!==void 0?arguments[2]:Cf(),Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ot=Ke.consoleDebug;Re=Ce(Re||we.rules,Ke.context);var Qe=p(ge,Be);Qe=ce(Qe);for(var ut={},Pt=Qe.toString({parenthesis:"all"});!ut[Pt];){ut[Pt]=!0,Oe=0;var fe=Pt;ot&&console.log("Working on: ",Pt);for(var J=0;J ").concat(Re[J].r.toString()))),ot){var ne=Qe.toString({parenthesis:"all"});ne!==fe&&(console.log("Applying",j,"produced",ne),fe=ne)}Z(Qe,Ke.context)}Pt=Qe.toString({parenthesis:"all"})}return Qe}function ze(ge,Re,Be){var Ke=ge;if(ge)for(var ot=0;ot1&&(fe=Qe(ge.args.slice(0,Pt))),ot=ge.args.slice(Pt),Ke=ot.length===1?ot[0]:Qe(ot),Be.push(Qe([fe,Ke]))}return Be}function lt(ge,Re){var Be={placeholders:{}};if(!ge.placeholders&&!Re.placeholders)return Be;if(ge.placeholders){if(!Re.placeholders)return ge}else return Re;for(var Ke in ge.placeholders)if(St(ge.placeholders,Ke)&&(Be.placeholders[Ke]=ge.placeholders[Ke],St(Re.placeholders,Ke)&&!Ue(ge.placeholders[Ke],Re.placeholders[Ke])))return null;for(var ot in Re.placeholders)St(Re.placeholders,ot)&&(Be.placeholders[ot]=Re.placeholders[ot]);return Be}function ct(ge,Re){var Be=[];if(ge.length===0||Re.length===0)return Be;for(var Ke,ot=0;ot2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var fe=be(ge.args[0],Re.args[1],Be);if(fe.length===0)return[];var J=be(ge.args[1],Re.args[0],Be);if(J.length===0)return[];Qe=[fe,J]}ot=de(Qe)}else if(Re.args.length>=2&&ge.args.length===2){for(var j=Le(Re,Be),ne=[],me=0;me2)throw Error("Unexpected non-binary associative function: "+ge.toString());return[]}}else if(ge instanceof U){if(ge.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(Ee[ge.name]){if(ge.name!==Re.name)return[]}else switch(ge.name[1]>="a"&&ge.name[1]<="z"?ge.name.substring(0,2):ge.name[0]){case"n":case"_p":ot[0].placeholders[ge.name]=Re;break;case"c":case"cl":if(or(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"v":if(!or(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"vl":if(qr(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"cd":if(GA(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"vd":if(!GA(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"ce":if(kv(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"ve":if(!kv(Re))ot[0].placeholders[ge.name]=Re;else return[];break;default:throw new Error("Invalid symbol in rule: "+ge.name)}}else if(ge instanceof I){if(!f(ge.value,Re.value))return[]}else return[];return ot}function Ue(ge,Re){if(ge instanceof I&&Re instanceof I){if(!f(ge.value,Re.value))return!1}else if(ge instanceof U&&Re instanceof U){if(ge.name!==Re.name)return!1}else if(ge instanceof R&&Re instanceof R||ge instanceof F&&Re instanceof F){if(ge instanceof R){if(ge.op!==Re.op||ge.fn!==Re.fn)return!1}else if(ge instanceof F&&ge.name!==Re.name)return!1;if(ge.args.length!==Re.args.length)return!1;for(var Be=0;Be{var{typed:t,config:r,mathWithTransform:n,matrix:i,fraction:o,bignumber:u,AccessorNode:l,ArrayNode:a,ConstantNode:s,FunctionNode:f,IndexNode:p,ObjectNode:h,OperatorNode:x,SymbolNode:b}=e,{isCommutative:w,isAssociative:A,allChildren:E,createMakeNodeFunction:O}=Fh({FunctionNode:f,OperatorNode:x,SymbolNode:b}),M=t("simplifyConstant",{Node:ie=>P(ee(ie,{})),"Node, Object":function(Y,Z){return P(ee(Y,Z))}});function I(ie){return da(ie)?ie.valueOf():ie instanceof Array?ie.map(I):Et(ie)?i(I(ie.valueOf())):ie}function F(ie,Y,Z){try{return n[ie].apply(null,Y)}catch{return Y=Y.map(I),q(n[ie].apply(null,Y),Z)}}var C=t({Fraction:H,number:function(Y){return Y<0?U(new s(-Y)):new s(Y)},BigNumber:function(Y){return Y<0?U(new s(-Y)):new s(Y)},bigint:function(Y){return Y<0n?U(new s(-Y)):new s(Y)},Complex:function(Y){throw new Error("Cannot convert Complex number to Node")},string:function(Y){return new s(Y)},Matrix:function(Y){return new a(Y.valueOf().map(Z=>C(Z)))}});function P(ie){return cr(ie)?ie:C(ie)}function R(ie,Y){var Z=Y&&Y.exactFractions!==!1;if(Z&&isFinite(ie)&&o){var le=o(ie),re=Y&&typeof Y.fractionsLimit=="number"?Y.fractionsLimit:1/0;if(le.valueOf()===ie&&le.n0;)if(or(le[0])&&typeof le[0].value!="string"){var re=q(le.shift().value,Z);Ei(ie)?ie=ie.items[re-1]:(ie=ie.valueOf()[re-1],ie instanceof Array&&(ie=i(ie)))}else if(le.length>1&&or(le[1])&&typeof le[1].value!="string"){var he=q(le[1].value,Z),De=[],we=Ei(ie)?ie.items:ie.valueOf();for(var ce of we)if(Ei(ce))De.push(ce.items[he-1]);else if(Et(ie))De.push(ce[he-1]);else break;if(De.length===we.length)Ei(ie)?ie=new a(De):ie=i(De),le.splice(1,1);else break}else break;return le.length===Y.dimensions.length?new l(P(ie),Y):le.length>0?(Y=new p(le),new l(P(ie),Y)):ie}if(Su(ie)&&Y.dimensions.length===1&&or(Y.dimensions[0])){var Ee=Y.dimensions[0].value;return Ee in ie.properties?ie.properties[Ee]:new s}return new l(P(ie),Y)}function W(ie,Y,Z,le){var re=Y.shift(),he=Y.reduce((De,we)=>{if(!cr(we)){var ce=De.pop();if(cr(ce))return[ce,we];try{return De.push(F(ie,[ce,we],le)),De}catch{De.push(ce)}}De.push(P(De.pop()));var Ee=De.length===1?De[0]:Z(De);return[Z([Ee,P(we)])]},[re]);return he.length===1?he[0]:Z([he[0],C(he[1])])}function ee(ie,Y){switch(ie.type){case"SymbolNode":return ie;case"ConstantNode":switch(typeof ie.value){case"number":return q(ie.value,Y);case"bigint":return q(ie.value,Y);case"string":return ie.value;default:if(!isNaN(ie.value))return q(ie.value,Y)}return ie;case"FunctionNode":if(n[ie.name]&&n[ie.name].rawArgs)return ie;{var Z=["add","multiply"];if(!Z.includes(ie.name)){var le=ie.args.map(We=>ee(We,Y));if(!le.some(cr))try{return F(ie.name,le,Y)}catch{}if(ie.name==="size"&&le.length===1&&Ei(le[0])){for(var re=[],he=le[0];Ei(he);)re.push(he.items.length),he=he.items[0];return i(re)}return new f(ie.name,le.map(P))}}case"OperatorNode":{var De=ie.fn.toString(),we,ce,Ee=O(ie);if(Xr(ie)&&ie.isUnary())we=[ee(ie.args[0],Y)],cr(we[0])?ce=Ee(we):ce=F(De,we,Y);else if(A(ie,Y.context))if(we=E(ie,Y.context),we=we.map(We=>ee(We,Y)),w(De,Y.context)){for(var Pe=[],Ce=[],Oe=0;Oe1?(ce=W(De,Pe,Ee,Y),Ce.unshift(ce),ce=W(De,Ce,Ee,Y)):ce=W(De,we,Ee,Y)}else ce=W(De,we,Ee,Y);else we=ie.args.map(We=>ee(We,Y)),ce=W(De,we,Ee,Y);return ce}case"ParenthesisNode":return ee(ie.content,Y);case"AccessorNode":return V(ee(ie.object,Y),ee(ie.index,Y),Y);case"ArrayNode":{var He=ie.items.map(We=>ee(We,Y));return He.some(cr)?new a(He.map(P)):i(He)}case"IndexNode":return new p(ie.dimensions.map(We=>M(We,Y)));case"ObjectNode":{var Se={};for(var ze in ie.properties)Se[ze]=M(ie.properties[ze],Y);return new h(Se)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(ie.type))}}return M});g();y();v();var Iz="simplifyCore",ape=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Fz=K(Iz,ape,e=>{var{typed:t,parse:r,equal:n,isZero:i,add:o,subtract:u,multiply:l,divide:a,pow:s,AccessorNode:f,ArrayNode:p,ConstantNode:h,FunctionNode:x,IndexNode:b,ObjectNode:w,OperatorNode:A,ParenthesisNode:E,SymbolNode:O}=e,M=new h(0),I=new h(1),F=new h(!0),C=new h(!1);function P(H){return Xr(H)&&["and","not","or"].includes(H.op)}var{hasProperty:R,isCommutative:q}=Fh({FunctionNode:x,OperatorNode:A,SymbolNode:O});function U(H){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=V?V.context:void 0;if(R(H,"trivial",W)){if(eo(H)&&H.args.length===1)return U(H.args[0],V);var ee=!1,ie=0;if(H.forEach(Ce=>{++ie,ie===1&&(ee=U(Ce,V))}),ie===1)return ee}var Y=H;if(eo(Y)){var Z=w6(Y.name);if(Z){if(Y.args.length>2&&R(Y,"associative",W))for(;Y.args.length>2;){var le=Y.args.pop(),re=Y.args.pop();Y.args.push(new A(Z,Y.name,[le,re]))}Y=new A(Z,Y.name,Y.args)}else return new x(U(Y.fn),Y.args.map(Ce=>U(Ce,V)))}if(Xr(Y)&&Y.isUnary()){var he=U(Y.args[0],V);if(Y.op==="~"&&Xr(he)&&he.isUnary()&&he.op==="~"||Y.op==="not"&&Xr(he)&&he.isUnary()&&he.op==="not"&&P(he.args[0]))return he.args[0];var De=!0;if(Y.op==="-"&&Xr(he)&&(he.isBinary()&&he.fn==="subtract"&&(Y=new A("-","subtract",[he.args[1],he.args[0]]),De=!1),he.isUnary()&&he.op==="-"))return he.args[0];if(De)return new A(Y.op,Y.fn,[he])}if(Xr(Y)&&Y.isBinary()){var we=U(Y.args[0],V),ce=U(Y.args[1],V);if(Y.op==="+"){if(or(we)&&i(we.value))return ce;if(or(ce)&&i(ce.value))return we;Xr(ce)&&ce.isUnary()&&ce.op==="-"&&(ce=ce.args[0],Y=new A("-","subtract",[we,ce]))}if(Y.op==="-")return Xr(ce)&&ce.isUnary()&&ce.op==="-"?U(new A("+","add",[we,ce.args[0]]),V):or(we)&&i(we.value)?U(new A("-","unaryMinus",[ce])):or(ce)&&i(ce.value)?we:new A(Y.op,Y.fn,[we,ce]);if(Y.op==="*"){if(or(we)){if(i(we.value))return M;if(n(we.value,1))return ce}if(or(ce)){if(i(ce.value))return M;if(n(ce.value,1))return we;if(q(Y,W))return new A(Y.op,Y.fn,[ce,we],Y.implicit)}return new A(Y.op,Y.fn,[we,ce],Y.implicit)}if(Y.op==="/")return or(we)&&i(we.value)?M:or(ce)&&n(ce.value,1)?we:new A(Y.op,Y.fn,[we,ce]);if(Y.op==="^"&&or(ce)){if(i(ce.value))return I;if(n(ce.value,1))return we}if(Y.op==="and"){if(or(we))if(we.value){if(P(ce))return ce;if(or(ce))return ce.value?F:C}else return C;if(or(ce))if(ce.value){if(P(we))return we}else return C}if(Y.op==="or"){if(or(we)){if(we.value)return F;if(P(ce))return ce}if(or(ce)){if(ce.value)return F;if(P(we))return we}}return new A(Y.op,Y.fn,[we,ce])}if(Xr(Y))return new A(Y.op,Y.fn,Y.args.map(Ce=>U(Ce,V)));if(Ei(Y))return new p(Y.items.map(Ce=>U(Ce,V)));if(Fo(Y))return new f(U(Y.object,V),U(Y.index,V));if(Vo(Y))return new b(Y.dimensions.map(Ce=>U(Ce,V)));if(Su(Y)){var Ee={};for(var Pe in Y.properties)Ee[Pe]=U(Y.properties[Pe],V);return new w(Ee)}return Y}return t(Iz,{Node:U,"Node,Object":U})});g();y();v();var spe="resolve",upe=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],_z=K(spe,upe,e=>{var{typed:t,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:o,ParenthesisNode:u}=e;function l(a,s){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!s)return a;if(qr(a)){if(f.has(a.name)){var p=Array.from(f).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(p,"}"))}var h=s.get(a.name);if(cr(h)){var x=new Set(f);return x.add(a.name),l(h,s,x)}else return typeof h=="number"?r(String(h)):h!==void 0?new n(h):a}else if(Xr(a)){var b=a.args.map(function(A){return l(A,s,f)});return new o(a.op,a.fn,b,a.implicit)}else{if(Si(a))return new u(l(a.content,s,f));if(eo(a)){var w=a.args.map(function(A){return l(A,s,f)});return new i(a.name,w)}}return a.map(A=>l(A,s,f))}return t("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(a,s)=>l(a,gl(s)),"Array | Matrix":t.referToSelf(a=>s=>s.map(f=>a(f))),"Array | Matrix, null | undefined":t.referToSelf(a=>s=>s.map(f=>a(f))),"Array, Object":t.referTo("Array,Map",a=>(s,f)=>a(s,gl(f))),"Matrix, Object":t.referTo("Matrix,Map",a=>(s,f)=>a(s,gl(f))),"Array | Matrix, Map":t.referToSelf(a=>(s,f)=>s.map(p=>a(p,f)))})});g();y();v();var kz="symbolicEqual",lpe=["parse","simplify","typed","OperatorNode"],Bz=K(kz,lpe,e=>{var{parse:t,simplify:r,typed:n,OperatorNode:i}=e;function o(u,l){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=new i("-","subtract",[u,l]),f=r(s,{},a);return or(f)&&!f.value}return n(kz,{"Node, Node":o,"Node, Node, Object":o})});g();y();v();var Lz="derivative",fpe=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],Pz=K(Lz,fpe,e=>{var{typed:t,config:r,parse:n,simplify:i,equal:o,isZero:u,numeric:l,ConstantNode:a,FunctionNode:s,OperatorNode:f,ParenthesisNode:p,SymbolNode:h}=e;function x(M,I){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},C={};A(C,M,I.name);var P=E(M,C);return F.simplify?i(P):P}t.addConversion({from:"identifier",to:"SymbolNode",convert:n});var b=t(Lz,{"Node, SymbolNode":x,"Node, SymbolNode, Object":x});t.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),b._simplify=!0,b.toTex=function(M){return w.apply(null,M.args)};var w=t("_derivTex",{"Node, SymbolNode":function(I,F){return or(I)&&gr(I.value)==="string"?w(n(I.value).toString(),F.toString(),1):w(I.toTex(),F.toString(),1)},"Node, ConstantNode":function(I,F){if(gr(F.value)==="string")return w(I,n(F.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(I,F,C){return w(I.toString(),F.name,C.value)},"string, string, number":function(I,F,C){var P;return C===1?P="{d\\over d"+F+"}":P="{d^{"+C+"}\\over d"+F+"^{"+C+"}}",P+"\\left[".concat(I,"\\right]")}}),A=t("constTag",{"Object, ConstantNode, string":function(I,F){return I[F]=!0,!0},"Object, SymbolNode, string":function(I,F,C){return F.name!==C?(I[F]=!0,!0):!1},"Object, ParenthesisNode, string":function(I,F,C){return A(I,F.content,C)},"Object, FunctionAssignmentNode, string":function(I,F,C){return F.params.includes(C)?A(I,F.expr,C):(I[F]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(I,F,C){if(F.args.length>0){for(var P=A(I,F.args[0],C),R=1;R0){var P=I.args.filter(function(ie){return F[ie]===void 0}),R=P.length===1?P[0]:new f("*","multiply",P),q=C.concat(E(R,F));return new f("*","multiply",q)}return new f("+","add",I.args.map(function(ie){return new f("*","multiply",I.args.map(function(Y){return Y===ie?E(Y,F):Y.clone()}))}))}if(I.op==="/"&&I.isBinary()){var U=I.args[0],H=I.args[1];return F[H]!==void 0?new f("/","divide",[E(U,F),H]):F[U]!==void 0?new f("*","multiply",[new f("-","unaryMinus",[U]),new f("/","divide",[E(H,F),new f("^","pow",[H.clone(),O(2)])])]):new f("/","divide",[new f("-","subtract",[new f("*","multiply",[E(U,F),H.clone()]),new f("*","multiply",[U.clone(),E(H,F)])]),new f("^","pow",[H.clone(),O(2)])])}if(I.op==="^"&&I.isBinary()){var V=I.args[0],W=I.args[1];if(F[V]!==void 0)return or(V)&&(u(V.value)||o(V.value,1))?O(0):new f("*","multiply",[I,new f("*","multiply",[new s("log",[V.clone()]),E(W.clone(),F)])]);if(F[W]!==void 0){if(or(W)){if(u(W.value))return O(0);if(o(W.value,1))return E(V,F)}var ee=new f("^","pow",[V.clone(),new f("-","subtract",[W,O(1)])]);return new f("*","multiply",[W.clone(),new f("*","multiply",[E(V,F),ee])])}return new f("*","multiply",[new f("^","pow",[V.clone(),W.clone()]),new f("+","add",[new f("*","multiply",[E(V,F),new f("/","divide",[W.clone(),V.clone()])]),new f("*","multiply",[E(W,F),new s("log",[V.clone()])])])])}throw new Error('Cannot process operator "'+I.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function O(M,I){return new a(l(M,I||co(String(M),r)))}return b});g();y();v();var Rz="rationalize",cpe=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],qz=K(Rz,cpe,e=>{var{config:t,typed:r,equal:n,isZero:i,add:o,subtract:u,multiply:l,divide:a,pow:s,parse:f,simplifyConstant:p,simplifyCore:h,simplify:x,fraction:b,bignumber:w,mathWithTransform:A,matrix:E,AccessorNode:O,ArrayNode:M,ConstantNode:I,FunctionNode:F,IndexNode:C,ObjectNode:P,OperatorNode:R,SymbolNode:q,ParenthesisNode:U}=e;function H(Y){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,re=W(),he=V(Y,Z,!0,re.firstRules),De=he.variables.length,we={exactFractions:!1},ce={exactFractions:!0};if(Y=he.expression,De>=1){Y=ee(Y);var Ee,Pe,Ce=!0,Oe=!1;Y=x(Y,re.firstRules,{},we);for(var He;Pe=Ce?re.distrDivRules:re.sucDivRules,Y=x(Y,Pe,{},ce),Ce=!Ce,He=Y.toString(),He!==Ee;)Oe=!0,Ee=He;Oe&&(Y=x(Y,re.firstRulesAgain,{},we)),Y=x(Y,re.finalRules,{},we)}var Se=[],ze={};return Y.type==="OperatorNode"&&Y.isBinary()&&Y.op==="/"?(De===1&&(Y.args[0]=ie(Y.args[0],Se),Y.args[1]=ie(Y.args[1])),le&&(ze.numerator=Y.args[0],ze.denominator=Y.args[1])):(De===1&&(Y=ie(Y,Se)),le&&(ze.numerator=Y,ze.denominator=null)),le?(ze.coefficients=Se,ze.variables=he.variables,ze.expression=Y,ze):Y}return r(Rz,{Node:H,"Node, boolean":(Y,Z)=>H(Y,{},Z),"Node, Object":H,"Node, Object, boolean":H});function V(Y,Z,le,re){var he=[],De=x(Y,re,Z,{exactFractions:!1});le=!!le;var we="+-*"+(le?"/":"");Ee(De);var ce={};return ce.expression=De,ce.variables=he,ce;function Ee(Pe){var Ce=Pe.type;if(Ce==="FunctionNode")throw new Error("There is an unsolved function call");if(Ce==="OperatorNode")if(Pe.op==="^"){if(Pe.args[1].type!=="ConstantNode"||!Nt(parseFloat(Pe.args[1].value)))throw new Error("There is a non-integer exponent");Ee(Pe.args[0])}else{if(!we.includes(Pe.op))throw new Error("Operator "+Pe.op+" invalid in polynomial expression");for(var Oe=0;Oe1;if(re==="OperatorNode"&&Y.isBinary()){var De=!1,we;if(Y.op==="^"&&(Y.args[0].type==="ParenthesisNode"||Y.args[0].type==="OperatorNode")&&Y.args[1].type==="ConstantNode"&&(we=parseFloat(Y.args[1].value),De=we>=2&&Nt(we)),De){if(we>2){var ce=Y.args[0],Ee=new R("^","pow",[Y.args[0].cloneDeep(),new I(we-1)]);Y=new R("*","multiply",[ce,Ee])}else Y=new R("*","multiply",[Y.args[0],Y.args[0].cloneDeep()]);he&&(le==="content"?Z.content=Y:Z.args[le]=Y)}}if(re==="ParenthesisNode")ee(Y.content,Y,"content");else if(re!=="ConstantNode"&&re!=="SymbolNode")for(var Pe=0;Pe=0;ce--)if(Z[ce]!==0){var Ee=new I(De?Z[ce]:Math.abs(Z[ce])),Pe=Z[ce]<0?"-":"+";if(ce>0){var Ce=new q(he);if(ce>1){var Oe=new I(ce);Ce=new R("^","pow",[Ce,Oe])}Z[ce]===-1&&De?Ee=new R("-","unaryMinus",[Ce]):Math.abs(Z[ce])===1?Ee=Ce:Ee=new R("*","multiply",[Ee,Ce])}De?we=Ee:Pe==="+"?we=new R("+","add",[we,Ee]):we=new R("-","subtract",[we,Ee]),De=!1}if(De)return new I(0);return we;function He(Se,ze,We){var Le=Se.type;if(Le==="FunctionNode")throw new Error("There is an unsolved function call");if(Le==="OperatorNode"){if(!"+-*^".includes(Se.op))throw new Error("Operator "+Se.op+" invalid");if(ze!==null){if((Se.fn==="unaryMinus"||Se.fn==="pow")&&ze.fn!=="add"&&ze.fn!=="subtract"&&ze.fn!=="multiply")throw new Error("Invalid "+Se.op+" placing");if((Se.fn==="subtract"||Se.fn==="add"||Se.fn==="multiply")&&ze.fn!=="add"&&ze.fn!=="subtract")throw new Error("Invalid "+Se.op+" placing");if((Se.fn==="subtract"||Se.fn==="add"||Se.fn==="unaryMinus")&&We.noFil!==0)throw new Error("Invalid "+Se.op+" placing")}(Se.op==="^"||Se.op==="*")&&(We.fire=Se.op);for(var lt=0;ltre&&(Z[ct]=0),Z[ct]+=We.cte*(We.oper==="+"?1:-1),re=Math.max(ct,re);return}We.cte=ct,We.fire===""&&(Z[0]+=We.cte*(We.oper==="+"?1:-1))}else throw new Error("Type "+Le+" is not allowed")}}});g();y();v();var zz="zpk2tf",ppe=["typed","add","multiply","Complex","number"],Uz=K(zz,ppe,e=>{var{typed:t,add:r,multiply:n,Complex:i,number:o}=e;return t(zz,{"Array,Array,number":function(s,f,p){return u(s,f,p)},"Array,Array":function(s,f){return u(s,f,1)},"Matrix,Matrix,number":function(s,f,p){return u(s.valueOf(),f.valueOf(),p)},"Matrix,Matrix":function(s,f){return u(s.valueOf(),f.valueOf(),1)}});function u(a,s,f){a.some(O=>O.type==="BigNumber")&&(a=a.map(O=>o(O))),s.some(O=>O.type==="BigNumber")&&(s=s.map(O=>o(O)));for(var p=[i(1,0)],h=[i(1,0)],x=0;x=0&&p-h{var{typed:t,add:r,multiply:n,Complex:i,divide:o,matrix:u}=e;return t(Hz,{"Array, Array":function(f,p){var h=a(512);return l(f,p,h)},"Array, Array, Array":function(f,p,h){return l(f,p,h)},"Array, Array, number":function(f,p,h){if(h<0)throw new Error("w must be a positive number");var x=a(h);return l(f,p,x)},"Matrix, Matrix":function(f,p){var h=a(512),{w:x,h:b}=l(f.valueOf(),p.valueOf(),h);return{w:u(x),h:u(b)}},"Matrix, Matrix, Matrix":function(f,p,h){var{h:x}=l(f.valueOf(),p.valueOf(),h.valueOf());return{h:u(x),w:u(h)}},"Matrix, Matrix, number":function(f,p,h){if(h<0)throw new Error("w must be a positive number");var x=a(h),{h:b}=l(f.valueOf(),p.valueOf(),x);return{h:u(b),w:u(x)}}});function l(s,f,p){for(var h=[],x=[],b=0;b{var{classes:t}=e;return function(n,i){var o=t[i&&i.mathjs];return o&&typeof o.fromJSON=="function"?o.fromJSON(i):i}});g();y();v();var gpe="replacer",vpe=[],Vz=K(gpe,vpe,()=>function(t,r){return typeof r=="number"&&(!isFinite(r)||isNaN(r))?{mathjs:"number",value:String(r)}:typeof r=="bigint"?{mathjs:"bigint",value:String(r)}:r});g();y();v();g();y();v();var Gz="13.0.0";var Yz=K("true",[],()=>!0),Zz=K("false",[],()=>!1),Xz=K("null",[],()=>null),Kz=wa("Infinity",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1/0):1/0}),Jz=wa("NaN",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(NaN):NaN}),Qz=wa("pi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?Iv(r):t_}),jz=wa("tau",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?PB(r):r_}),eU=wa("e",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?BB(r):n_}),tU=wa("phi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?LB(r):i_}),rU=wa("LN2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).ln():Math.LN2}),nU=wa("LN10",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(10).ln():Math.LN10}),iU=wa("LOG2E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),oU=wa("LOG10E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),aU=wa("SQRT1_2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),sU=wa("SQRT2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),uU=wa("i",["Complex"],e=>{var{Complex:t}=e;return t.I}),lU=K("PI",["pi"],e=>{var{pi:t}=e;return t}),fU=K("E",["e"],e=>{var{e:t}=e;return t}),cU=K("version",[],()=>Gz);function wa(e,t,r){return K(e,t,r,{recreateOnConfigChange:!0})}g();y();v();var pU=hr("speedOfLight","299792458","m s^-1"),mU=hr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),hU=hr("planckConstant","6.62607015e-34","J s"),dU=hr("reducedPlanckConstant","1.0545718176461565e-34","J s"),gU=hr("magneticConstant","1.25663706212e-6","N A^-2"),vU=hr("electricConstant","8.8541878128e-12","F m^-1"),yU=hr("vacuumImpedance","376.730313667","ohm"),xU=hr("coulomb","8.987551792261171e9","N m^2 C^-2"),wU=hr("elementaryCharge","1.602176634e-19","C"),bU=hr("bohrMagneton","9.2740100783e-24","J T^-1"),DU=hr("conductanceQuantum","7.748091729863649e-5","S"),NU=hr("inverseConductanceQuantum","12906.403729652257","ohm"),EU=hr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),SU=hr("nuclearMagneton","5.0507837461e-27","J T^-1"),AU=hr("klitzing","25812.807459304513","ohm");var CU=hr("bohrRadius","5.29177210903e-11","m"),MU=hr("classicalElectronRadius","2.8179403262e-15","m"),TU=hr("electronMass","9.1093837015e-31","kg"),OU=hr("fermiCoupling","1.1663787e-5","GeV^-2"),IU=tb("fineStructure",.0072973525693),FU=hr("hartreeEnergy","4.3597447222071e-18","J"),_U=hr("protonMass","1.67262192369e-27","kg"),kU=hr("deuteronMass","3.3435830926e-27","kg"),BU=hr("neutronMass","1.6749271613e-27","kg"),LU=hr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),PU=hr("rydberg","10973731.568160","m^-1"),RU=hr("thomsonCrossSection","6.6524587321e-29","m^2"),qU=tb("weakMixingAngle",.2229),zU=tb("efimovFactor",22.7),UU=hr("atomicMass","1.66053906660e-27","kg"),HU=hr("avogadro","6.02214076e23","mol^-1"),$U=hr("boltzmann","1.380649e-23","J K^-1"),WU=hr("faraday","96485.33212331001","C mol^-1"),VU=hr("firstRadiation","3.7417718521927573e-16","W m^2"),GU=hr("loschmidt","2.686780111798444e25","m^-3"),YU=hr("gasConstant","8.31446261815324","J K^-1 mol^-1"),ZU=hr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),XU=hr("molarVolume","0.022413969545014137","m^3 mol^-1"),KU=tb("sackurTetrode",-1.16487052358),JU=hr("secondRadiation","0.014387768775039337","m K"),QU=hr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),jU=hr("wienDisplacement","2.897771955e-3","m K"),eH=hr("molarMass","0.99999999965e-3","kg mol^-1"),tH=hr("molarMassC12","11.9999999958e-3","kg mol^-1"),rH=hr("gravity","9.80665","m s^-2"),nH=hr("planckLength","1.616255e-35","m"),iH=hr("planckMass","2.176435e-8","kg"),oH=hr("planckTime","5.391245e-44","s"),aH=hr("planckCharge","1.87554603778e-18","C"),sH=hr("planckTemperature","1.416785e+32","K");function hr(e,t,r){var n=["config","Unit","BigNumber"];return K(e,n,i=>{var{config:o,Unit:u,BigNumber:l}=i,a=o.number==="BigNumber"?new l(t):parseFloat(t),s=new u(a,r);return s.fixPrefix=!0,s})}function tb(e,t){var r=["config","BigNumber"];return K(e,r,n=>{var{config:i,BigNumber:o}=n;return i.number==="BigNumber"?new o(t):t})}g();y();v();var ype="apply",xpe=["typed","isInteger"],uH=K(ype,xpe,e=>{var{typed:t,isInteger:r}=e,n=Nh({typed:t,isInteger:r});return t("apply",{"...any":function(o){var u=o[1];$t(u)?o[1]=u-1:kt(u)&&(o[1]=u.minus(1));try{return n.apply(null,o)}catch(l){throw Jr(l)}}})},{isTransformFunction:!0});g();y();v();var wpe="column",bpe=["typed","Index","matrix","range"],lH=K(wpe,bpe,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=ow({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(l){var a=l.length-1,s=l[a];$t(s)&&(l[a]=s-1);try{return o.apply(null,l)}catch(f){throw Jr(f)}}})},{isTransformFunction:!0});g();y();v();g();y();v();function _h(e,t,r){var n=e.filter(function(a){return qr(a)&&!(a.name in t)&&!r.has(a.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,o=new Map,u=new mh(r,o,new Set([i])),l=e.compile();return function(s){return o.set(i,s),l.evaluate(u)}}var Dpe="filter",Npe=["typed"],cH=K(Dpe,Npe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(qr(i[1])||$a(i[1])?a=i[1].compile().evaluate(u):a=_h(i[1],o,u)),n(l,a)}r.rawArgs=!0;var n=t("filter",{"Array, function":fH,"Matrix, function":function(o,u){return o.create(fH(o.toArray(),u))},"Array, RegExp":yh,"Matrix, RegExp":function(o,u){return o.create(yh(o.toArray(),u))}});return r},{isTransformFunction:!0});function fH(e,t){return Ux(e,function(r,n,i){return Ya(t,r,[n+1],i,"filter")})}g();y();v();var Epe="forEach",Spe=["typed"],pH=K(Epe,Spe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(qr(i[1])||$a(i[1])?a=i[1].compile().evaluate(u):a=_h(i[1],o,u)),n(l,a)}r.rawArgs=!0;var n=t("forEach",{"Array | Matrix, function":function(o,u){var l=function a(s,f){if(Array.isArray(s))Ff(s,function(p,h){a(p,f.concat(h+1))});else return Ya(u,s,f,o,"forEach")};l(o.valueOf(),[])}});return r},{isTransformFunction:!0});g();y();v();var Ape="index",Cpe=["Index","getMatrixDataType"],mH=K(Ape,Cpe,e=>{var{Index:t,getMatrixDataType:r}=e;return function(){for(var i=[],o=0,u=arguments.length;o0?0:2;else if(l&&l.isSet===!0)l=l.map(function(s){return s-1});else if(pr(l)||Et(l))r(l)!=="boolean"&&(l=l.map(function(s){return s-1}));else if($t(l))l--;else if(kt(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");i[o]=l}var a=new t;return t.apply(a,i),a}},{isTransformFunction:!0});g();y();v();var Mpe="map",Tpe=["typed"],dH=K(Mpe,Tpe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(qr(i[1])||$a(i[1])?a=i[1].compile().evaluate(u):a=_h(i[1],o,u)),n(l,a)}r.rawArgs=!0;var n=t("map",{"Array, function":function(o,u){return hH(o,u,o)},"Matrix, function":function(o,u){return o.create(hH(o.valueOf(),u,o))}});return r},{isTransformFunction:!0});function hH(e,t,r){function n(i,o){return Array.isArray(i)?Yo(i,function(u,l){return n(u,o.concat(l+1))}):Ya(t,i,o,r,"map")}return n(e,[])}g();y();v();g();y();v();function go(e){if(e.length===2&&yn(e[0])){e=e.slice();var t=e[1];$t(t)?e[1]=t-1:kt(t)&&(e[1]=t.minus(1))}return e}var Ope="max",Ipe=["typed","config","numeric","larger"],gH=K(Ope,Ipe,e=>{var{typed:t,config:r,numeric:n,larger:i}=e,o=Dw({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(l){l=go(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();y();v();var Fpe="mean",_pe=["typed","add","divide"],vH=K(Fpe,_pe,e=>{var{typed:t,add:r,divide:n}=e,i=Kw({typed:t,add:r,divide:n});return t("mean",{"...any":function(u){u=go(u);try{return i.apply(null,u)}catch(l){throw Jr(l)}}})},{isTransformFunction:!0});g();y();v();var kpe="min",Bpe=["typed","config","numeric","smaller"],yH=K(kpe,Bpe,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e,o=Nw({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(l){l=go(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();y();v();var Lpe="range",Ppe=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],xH=K(Lpe,Ppe,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:u,larger:l,largerEq:a,add:s,isPositive:f}=e,p=lw({typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:u,larger:l,largerEq:a,add:s,isPositive:f});return t("range",{"...any":function(x){var b=x.length-1,w=x[b];return typeof w!="boolean"&&x.push(!0),p.apply(null,x)}})},{isTransformFunction:!0});g();y();v();var Rpe="row",qpe=["typed","Index","matrix","range"],wH=K(Rpe,qpe,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=fw({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(l){var a=l.length-1,s=l[a];$t(s)&&(l[a]=s-1);try{return o.apply(null,l)}catch(f){throw Jr(f)}}})},{isTransformFunction:!0});g();y();v();var zpe="subset",Upe=["typed","matrix","zeros","add"],bH=K(zpe,Upe,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=cw({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(l){try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();y();v();var Hpe="concat",$pe=["typed","matrix","isInteger"],DH=K(Hpe,$pe,e=>{var{typed:t,matrix:r,isInteger:n}=e,i=iw({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(u){var l=u.length-1,a=u[l];$t(a)?u[l]=a-1:kt(a)&&(u[l]=a.minus(1));try{return i.apply(null,u)}catch(s){throw Jr(s)}}})},{isTransformFunction:!0});g();y();v();var NH="diff",Wpe=["typed","matrix","subtract","number","bignumber"],EH=K(NH,Wpe,e=>{var{typed:t,matrix:r,subtract:n,number:i,bignumber:o}=e,u=aw({typed:t,matrix:r,subtract:n,number:i,bignumber:o});return t(NH,{"...any":function(a){a=go(a);try{return u.apply(null,a)}catch(s){throw Jr(s)}}})},{isTransformFunction:!0});g();y();v();var Vpe="std",Gpe=["typed","map","sqrt","variance"],SH=K(Vpe,Gpe,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e,o=jw({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(l){l=go(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();y();v();var AH="sum",Ype=["typed","config","add","numeric"],CH=K(AH,Ype,e=>{var{typed:t,config:r,add:n,numeric:i}=e,o=Yw({typed:t,config:r,add:n,numeric:i});return t(AH,{"...any":function(l){l=go(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();y();v();var Zpe="quantileSeq",Xpe=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],MH=K(Zpe,Xpe,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:u,partitionSelect:l,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h}=e,x=Qw({typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:u,partitionSelect:l,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h});return t("quantileSeq",{"Array | Matrix, number | BigNumber":x,"Array | Matrix, number | BigNumber, number":(w,A,E)=>x(w,A,b(E)),"Array | Matrix, number | BigNumber, boolean":x,"Array | Matrix, number | BigNumber, boolean, number":(w,A,E,O)=>x(w,A,E,b(O)),"Array | Matrix, Array | Matrix":x,"Array | Matrix, Array | Matrix, number":(w,A,E)=>x(w,A,b(E)),"Array | Matrix, Array | Matrix, boolean":x,"Array | Matrix, Array | Matrix, boolean, number":(w,A,E,O)=>x(w,A,E,b(O))});function b(w){return go([[],w])[1]}},{isTransformFunction:!0});g();y();v();var TH="cumsum",Kpe=["typed","add","unaryPlus"],OH=K(TH,Kpe,e=>{var{typed:t,add:r,unaryPlus:n}=e,i=Xw({typed:t,add:r,unaryPlus:n});return t(TH,{"...any":function(u){if(u.length===2&&yn(u[0])){var l=u[1];$t(l)?u[1]=l-1:kt(l)&&(u[1]=l.minus(1))}try{return i.apply(null,u)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();y();v();var IH="variance",Jpe=["typed","add","subtract","multiply","divide","apply","isNaN"],FH=K(IH,Jpe,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l}=e,a=Jw({typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l});return t(IH,{"...any":function(f){f=go(f);try{return a.apply(null,f)}catch(p){throw Jr(p)}}})},{isTransformFunction:!0});g();y();v();var _H="print",Qpe=["typed","matrix","zeros","add"],kH=K(_H,Qpe,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=mw({typed:t,matrix:r,zeros:n,add:i});return t(_H,{"string, Object | Array":function(a,s){return o(u(a),s)},"string, Object | Array, number | Object":function(a,s,f){return o(u(a),s,f)}});function u(l){return l.replace(pw,a=>{var s=a.slice(1).split("."),f=s.map(function(p){return!isNaN(p)&&p.length>0?parseInt(p)-1:p});return"$"+f.join(".")})}},{isTransformFunction:!0});g();y();v();var jpe="and",eme=["typed","matrix","zeros","add","equalScalar","not","concat"],BH=K(jpe,eme,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=hw({typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u});function a(s,f,p){var h=s[0].compile().evaluate(p);if(!yn(h)&&!l(h,!0))return!1;var x=s[1].compile().evaluate(p);return l(h,x)}return a.rawArgs=!0,a},{isTransformFunction:!0});g();y();v();var tme="or",rme=["typed","matrix","equalScalar","DenseMatrix","concat"],LH=K(tme,rme,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=nw({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o});function l(a,s,f){var p=a[0].compile().evaluate(f);if(!yn(p)&&u(p,!1))return!0;var h=a[1].compile().evaluate(f);return u(p,h)}return l.rawArgs=!0,l},{isTransformFunction:!0});g();y();v();var nme="bitAnd",ime=["typed","matrix","zeros","add","equalScalar","not","concat"],PH=K(nme,ime,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=tw({typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u});function a(s,f,p){var h=s[0].compile().evaluate(p);if(!yn(h)){if(isNaN(h))return NaN;if(h===0||h===!1)return 0}var x=s[1].compile().evaluate(p);return l(h,x)}return a.rawArgs=!0,a},{isTransformFunction:!0});g();y();v();var ome="bitOr",ame=["typed","matrix","equalScalar","DenseMatrix","concat"],RH=K(ome,ame,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=rw({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o});function l(a,s,f){var p=a[0].compile().evaluate(f);if(!yn(p)){if(isNaN(p))return NaN;if(p===-1)return-1;if(p===!0)return 1}var h=a[1].compile().evaluate(f);return u(p,h)}return l.rawArgs=!0,l},{isTransformFunction:!0});g();y();v();g();y();v();var XA=ZA;g();y();v();var $H=rn(Dx(),1);g();y();v();var zH=rn(qH(),1);function UH(e){var t=new zH.default;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}g();y();v();function HH(e,t,r,n){function i(A,E){var O=arguments.length;if(O!==1&&O!==2)throw new xa("import",O,1,2);E||(E={});function M(P,R,q){if(Array.isArray(R))R.forEach(V=>M(P,V));else if(typeof R=="object")for(var U in R)St(R,U)&&M(P,R[U],U);else if(cp(R)||q!==void 0){var H=cp(R)?b(R)?R.fn+".transform":R.fn:q;if(St(P,H)&&P[H]!==R&&!E.silent)throw new Error('Cannot import "'+H+'" twice');P[H]=R}else if(!E.silent)throw new TypeError("Factory, Object, or Array expected")}var I={};M(I,A);for(var F in I)if(St(I,F)){var C=I[F];if(cp(C))s(C,E);else if(f(C))o(F,C,E);else if(!E.silent)throw new TypeError("Factory, Object, or Array expected")}}function o(A,E,O){if(O.wrap&&typeof E=="function"&&(E=a(E)),p(E)&&(E=e(A,{[E.signature]:E})),e.isTypedFunction(r[A])&&e.isTypedFunction(E)){O.override?E=e(A,E.signatures):E=e(r[A],E),r[A]=E,delete n[A],u(A,E),r.emit("import",A,function(){return E});return}if(r[A]===void 0||O.override){r[A]=E,delete n[A],u(A,E),r.emit("import",A,function(){return E});return}if(!O.silent)throw new Error('Cannot import "'+A+'": already exists')}function u(A,E){E&&typeof E.transform=="function"?(r.expression.transform[A]=E.transform,h(A)&&(r.expression.mathWithTransform[A]=E.transform)):(delete r.expression.transform[A],h(A)&&(r.expression.mathWithTransform[A]=E))}function l(A){delete r.expression.transform[A],h(A)?r.expression.mathWithTransform[A]=r[A]:delete r.expression.mathWithTransform[A]}function a(A){var E=function(){for(var M=[],I=0,F=arguments.length;I2&&arguments[2]!==void 0?arguments[2]:A.fn;if(O.includes("."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(O));var M=b(A)?r.expression.transform:r,I=O in r.expression.transform,F=St(M,O)?M[O]:void 0,C=function(){var R={};A.dependencies.map(hS).forEach(U=>{if(U.includes("."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(U));U==="math"?R.math=r:U==="mathWithTransform"?R.mathWithTransform=r.expression.mathWithTransform:U==="classes"?R.classes=r:R[U]=r[U]});var q=A(R);if(q&&typeof q.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = "expression.transform"');if(F===void 0||E.override)return q;if(e.isTypedFunction(F)&&e.isTypedFunction(q))return e(F,q);if(E.silent)return F;throw new Error('Cannot import "'+O+'": already exists')};!A.meta||A.meta.lazy!==!1?(fh(M,O,C),F&&I?l(O):(b(A)||x(A))&&fh(r.expression.mathWithTransform,O,()=>M[O])):(M[O]=C(),F&&I?l(O):(b(A)||x(A))&&fh(r.expression.mathWithTransform,O,()=>M[O])),n[O]=A,r.emit("import",O,C)}function f(A){return typeof A=="function"||typeof A=="number"||typeof A=="string"||typeof A=="boolean"||A===null||ui(A)||Ni(A)||kt(A)||da(A)||Et(A)||Array.isArray(A)}function p(A){return typeof A=="function"&&typeof A.signature=="string"}function h(A){return!St(w,A)}function x(A){return!A.fn.includes(".")&&!St(w,A.fn)&&(!A.meta||!A.meta.isClass)}function b(A){return A!==void 0&&A.meta!==void 0&&A.meta.isTransformFunction===!0||!1}var w={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function rb(e,t){var r=Jn({},sx,t);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=UH({isNumber:$t,isComplex:Ni,isBigNumber:kt,isBigInt:ux,isFraction:da,isUnit:ui,isString:gn,isArray:pr,isMatrix:Et,isCollection:yn,isDenseMatrix:dl,isSparseMatrix:ga,isRange:Af,isIndex:Nu,isBoolean:lx,isResultSet:fx,isHelp:uh,isFunction:cx,isDate:px,isRegExp:mx,isObject:Eu,isNull:hx,isUndefined:dx,isAccessorNode:Fo,isArrayNode:Ei,isAssignmentNode:gx,isBlockNode:vx,isConditionalNode:yx,isConstantNode:or,isFunctionAssignmentNode:$a,isFunctionNode:eo,isIndexNode:Vo,isNode:cr,isObjectNode:Su,isOperatorNode:Xr,isParenthesisNode:Si,isRangeNode:xx,isRelationalNode:wx,isSymbolNode:qr,isChain:lh});n.config=GI(r,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var i=[],o=[];function u(f){if(cp(f))return f(n);var p=f[Object.keys(f)[0]];if(cp(p))return p(n);if(!UI(f))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",f),new Error("Factory object with properties `type`, `name`, and `factory` expected");var h=i.indexOf(f),x;return h===-1?(f.math===!0?x=f.factory(n.type,r,u,n.typed,n):x=f.factory(n.type,r,u,n.typed),i.push(f),o.push(x)):x=o[h],x}var l={};function a(){for(var f=arguments.length,p=new Array(f),h=0;h{Object.values(l).forEach(f=>{f&&f.meta&&f.meta.recreateOnConfigChange&&s(f,{override:!0})})}),n.create=rb.bind(null,e),n.factory=K,n.import(Object.values(qI(e))),n.ArgumentsError=xa,n.DimensionError=Jt,n.IndexError=Mi,n}var Hh={};qa(Hh,{ABS:()=>Ahe,ACCRINT:()=>V0e,ACCRINTM:()=>G0e,ACOS:()=>Che,ACOSH:()=>Mhe,ACOT:()=>The,ACOTH:()=>Ohe,AGGREGATE:()=>Ihe,AMORDEGRC:()=>Y0e,AMORLINC:()=>Z0e,AND:()=>H1e,ARABIC:()=>Fhe,ASC:()=>mge,ASIN:()=>_he,ASINH:()=>khe,ATAN:()=>Bhe,ATAN2:()=>Lhe,ATANH:()=>Phe,AVEDEV:()=>Gme,AVERAGE:()=>Np,AVERAGEA:()=>fC,AVERAGEIF:()=>Yme,AVERAGEIFS:()=>Zme,BAHTTEXT:()=>hge,BASE:()=>Rhe,BESSELI:()=>zge,BESSELJ:()=>Uge,BESSELK:()=>Hge,BESSELY:()=>$ge,BETA:()=>Rv,BETADIST:()=>Ave,BETAINV:()=>Cve,BIN2DEC:()=>Wge,BIN2HEX:()=>Vge,BIN2OCT:()=>Gge,BINOM:()=>qh,BINOMDIST:()=>Mve,BITAND:()=>Yge,BITLSHIFT:()=>Zge,BITOR:()=>Xge,BITRSHIFT:()=>Kge,BITXOR:()=>Jge,CEILING:()=>Sl,CEILINGMATH:()=>Tve,CEILINGPRECISE:()=>Ove,CELL:()=>bme,CHAR:()=>v$,CHIDIST:()=>Ive,CHIDISTRT:()=>Fve,CHIINV:()=>_ve,CHIINVRT:()=>kve,CHISQ:()=>qs,CHITEST:()=>Bve,CHOOSE:()=>Bme,CLEAN:()=>dge,CODE:()=>y$,COLUMN:()=>Lme,COLUMNS:()=>Pme,COMBIN:()=>kh,COMBINA:()=>qhe,COMPLEX:()=>xo,CONCAT:()=>gge,CONCATENATE:()=>x$,CONFIDENCE:()=>cC,CONVERT:()=>Qge,CORREL:()=>Xme,COS:()=>zhe,COSH:()=>Uhe,COT:()=>Hhe,COTH:()=>$he,COUNT:()=>Bv,COUNTA:()=>Lv,COUNTBLANK:()=>a$,COUNTIF:()=>Kme,COUNTIFS:()=>Jme,COUPDAYBS:()=>X0e,COUPDAYS:()=>K0e,COUPDAYSNC:()=>J0e,COUPNCD:()=>Q0e,COUPNUM:()=>j0e,COUPPCD:()=>e1e,COVAR:()=>Lve,COVARIANCE:()=>zh,COVARIANCEP:()=>Pve,COVARIANCES:()=>Rve,CRITBINOM:()=>qve,CSC:()=>Whe,CSCH:()=>Vhe,CUMIPMT:()=>t1e,CUMPRINC:()=>r1e,DATE:()=>Jde,DATEDIF:()=>Pf,DATEVALUE:()=>Qde,DAVERAGE:()=>F0e,DAY:()=>jde,DAYS:()=>Dp,DAYS360:()=>Rf,DB:()=>n1e,DBCS:()=>vge,DCOUNT:()=>_0e,DCOUNTA:()=>k0e,DDB:()=>i1e,DEC2BIN:()=>jge,DEC2HEX:()=>eve,DEC2OCT:()=>tve,DECIMAL:()=>Ghe,DEGREES:()=>Yhe,DELTA:()=>rve,DEVSQ:()=>Qme,DGET:()=>B0e,DISC:()=>o1e,DMAX:()=>L0e,DMIN:()=>P0e,DOLLAR:()=>yge,DOLLARDE:()=>a1e,DOLLARFR:()=>s1e,DPRODUCT:()=>R0e,DSTDEV:()=>q0e,DSTDEVP:()=>z0e,DSUM:()=>U0e,DURATION:()=>u1e,DVAR:()=>H0e,DVARP:()=>$0e,EDATE:()=>ege,EFFECT:()=>l1e,EOMONTH:()=>tge,ERF:()=>NC,ERFC:()=>EC,ERFCPRECISE:()=>zve,ERFPRECISE:()=>Uve,ERROR:()=>t$,EVEN:()=>Zhe,EXACT:()=>xge,EXP:()=>Xhe,EXPON:()=>pC,EXPONDIST:()=>Hve,F:()=>zs,FACT:()=>El,FACTDOUBLE:()=>h$,FALSE:()=>$1e,FDIST:()=>$ve,FDISTRT:()=>Wve,FIND:()=>wge,FINV:()=>Vve,FINVRT:()=>Gve,FISHER:()=>jme,FISHERINV:()=>ehe,FIXED:()=>w$,FLOOR:()=>Ap,FLOORMATH:()=>Yve,FLOORPRECISE:()=>Zve,FORECAST:()=>s$,FREQUENCY:()=>the,FTEST:()=>Xve,FV:()=>Cp,FVSCHEDULE:()=>f1e,GAMMA:()=>qv,GAMMADIST:()=>Kve,GAMMAINV:()=>Jve,GAMMALN:()=>mC,GAMMALNPRECISE:()=>Qve,GAUSS:()=>rhe,GCD:()=>Khe,GEOMEAN:()=>nhe,GESTEP:()=>nve,GROWTH:()=>ihe,HARMEAN:()=>ohe,HEX2BIN:()=>ive,HEX2DEC:()=>ove,HEX2OCT:()=>ave,HLOOKUP:()=>Rme,HOUR:()=>rge,HYPGEOM:()=>hC,HYPGEOMDIST:()=>jve,IF:()=>W1e,IFERROR:()=>G1e,IFNA:()=>Y1e,IFS:()=>V1e,IMABS:()=>SC,IMAGINARY:()=>nn,IMARGUMENT:()=>AC,IMCONJUGATE:()=>sve,IMCOS:()=>wb,IMCOSH:()=>b$,IMCOT:()=>uve,IMCSC:()=>yve,IMCSCH:()=>xve,IMDIV:()=>Tp,IMEXP:()=>lve,IMLN:()=>fve,IMLOG10:()=>cve,IMLOG2:()=>pve,IMPOWER:()=>mve,IMPRODUCT:()=>hve,IMREAL:()=>on,IMSEC:()=>dve,IMSECH:()=>gve,IMSIN:()=>bb,IMSINH:()=>D$,IMSQRT:()=>vve,IMSUB:()=>wve,IMSUM:()=>bve,IMTAN:()=>Dve,INDEX:()=>qme,INFO:()=>Dme,INT:()=>Jhe,INTERCEPT:()=>ahe,INTRATE:()=>c1e,IPMT:()=>S$,IRR:()=>p1e,ISBLANK:()=>Nme,ISERR:()=>r$,ISERROR:()=>gb,ISEVEN:()=>Eme,ISFORMULA:()=>Sme,ISLOGICAL:()=>n$,ISNA:()=>Ame,ISNONTEXT:()=>Cme,ISNUMBER:()=>vb,ISO:()=>Qhe,ISODD:()=>Mme,ISOWEEKNUM:()=>g$,ISPMT:()=>m1e,ISREF:()=>Tme,ISTEXT:()=>i$,KURT:()=>she,LARGE:()=>u$,LCM:()=>jhe,LEFT:()=>bge,LEN:()=>Dge,LINEST:()=>dC,LN:()=>ede,LOG:()=>tde,LOG10:()=>rde,LOGEST:()=>uhe,LOGINV:()=>e0e,LOGNORM:()=>Uh,LOGNORMDIST:()=>t0e,LOGNORMINV:()=>r0e,LOOKUP:()=>zme,LOWER:()=>Nge,MATCH:()=>Ume,MAX:()=>sb,MAXA:()=>lhe,MAXIFS:()=>fhe,MDURATION:()=>h1e,MEDIAN:()=>l$,MID:()=>Ege,MIN:()=>ub,MINA:()=>che,MINIFS:()=>phe,MINUTE:()=>nge,MIRR:()=>d1e,MMULT:()=>nde,MOD:()=>ide,MODE:()=>Ep,MODEMULT:()=>n0e,MODESNGL:()=>i0e,MONTH:()=>ige,MROUND:()=>ode,MULTINOMIAL:()=>ade,MUNIT:()=>sde,N:()=>Ome,NA:()=>Ime,NEGBINOM:()=>gC,NEGBINOMDIST:()=>o0e,NETWORKDAYS:()=>yb,NETWORKDAYSINTL:()=>a0e,NOMINAL:()=>g1e,NORM:()=>Us,NORMDIST:()=>s0e,NORMINV:()=>u0e,NORMSDIST:()=>l0e,NORMSINV:()=>f0e,NOT:()=>Z1e,NOW:()=>oge,NPER:()=>v1e,NPV:()=>iC,NUMBERVALUE:()=>Sge,OCT2BIN:()=>Nve,OCT2DEC:()=>Eve,OCT2HEX:()=>Sve,ODD:()=>ude,ODDFPRICE:()=>y1e,ODDFYIELD:()=>x1e,ODDLPRICE:()=>w1e,ODDLYIELD:()=>b1e,OR:()=>X1e,PDURATION:()=>D1e,PEARSON:()=>f$,PERCENTILE:()=>ba,PERCENTILEEXC:()=>c0e,PERCENTILEINC:()=>p0e,PERCENTRANK:()=>zv,PERCENTRANKEXC:()=>m0e,PERCENTRANKINC:()=>h0e,PERMUT:()=>mhe,PERMUTATIONA:()=>hhe,PHI:()=>dhe,PI:()=>lde,PMT:()=>Hv,POISSON:()=>vC,POISSONDIST:()=>d0e,POWER:()=>d$,PPMT:()=>N1e,PRICE:()=>E1e,PRICEDISC:()=>S1e,PRICEMAT:()=>A1e,PROB:()=>ghe,PRODUCT:()=>lb,PRONETIC:()=>Age,PROPER:()=>Cge,PV:()=>C1e,QUARTILE:()=>Sp,QUARTILEEXC:()=>g0e,QUARTILEINC:()=>v0e,QUOTIENT:()=>fde,RADIANS:()=>cde,RAND:()=>pde,RANDBETWEEN:()=>mde,RANK:()=>Uv,RANKAVG:()=>y0e,RANKEQ:()=>x0e,RATE:()=>M1e,RECEIVED:()=>T1e,REPLACE:()=>Mge,REPT:()=>Na,RIGHT:()=>Tge,ROMAN:()=>hde,ROUND:()=>Tu,ROUNDDOWN:()=>dde,ROUNDUP:()=>gde,ROW:()=>vhe,ROWS:()=>Hme,RRI:()=>O1e,RSQ:()=>yhe,SEARCH:()=>Oge,SEC:()=>vde,SECH:()=>yde,SECOND:()=>age,SERIESSUM:()=>xde,SHEET:()=>Fme,SHEETS:()=>_me,SIGN:()=>wde,SIN:()=>bde,SINH:()=>Dde,SKEW:()=>yC,SKEWP:()=>w0e,SLN:()=>I1e,SLOPE:()=>xhe,SMALL:()=>c$,SORT:()=>$me,SQRT:()=>Nde,SQRTPI:()=>Ede,STANDARDIZE:()=>whe,STDEV:()=>Ko,STDEVA:()=>bhe,STDEVP:()=>b0e,STDEVPA:()=>Dhe,STDEVS:()=>D0e,STEYX:()=>Nhe,SUBSTITUTE:()=>Ige,SUBTOTAL:()=>Sde,SUM:()=>Al,SUMIF:()=>Ade,SUMIFS:()=>Cde,SUMPRODUCT:()=>Mde,SUMSQ:()=>Tde,SUMX2MY2:()=>Ode,SUMX2PY2:()=>Ide,SUMXMY2:()=>Fde,SWITCH:()=>Q1e,SYD:()=>F1e,T:()=>Fge,TAN:()=>_de,TANH:()=>kde,TBILLEQ:()=>_1e,TBILLPRICE:()=>k1e,TBILLYIELD:()=>B1e,TDIST:()=>N0e,TDISTRT:()=>E0e,TEXT:()=>_ge,TEXTJOIN:()=>kge,TIME:()=>sge,TIMEVALUE:()=>uge,TINV:()=>S0e,TODAY:()=>lge,TRANSPOSE:()=>Wme,TREND:()=>Ehe,TRIM:()=>Bge,TRIMMEAN:()=>She,TRUE:()=>K1e,TRUNC:()=>Bde,TTEST:()=>A0e,TYPE:()=>kme,UNICHAR:()=>Lge,UNICODE:()=>Pge,UNIQUE:()=>lC,UPPER:()=>Rge,VALUE:()=>qge,VAR:()=>_o,VARA:()=>p$,VARP:()=>C0e,VARPA:()=>m$,VARS:()=>M0e,VDB:()=>L1e,VLOOKUP:()=>o$,WEEKDAY:()=>fge,WEEKNUM:()=>cge,WEIBULL:()=>xC,WEIBULLDIST:()=>T0e,WORKDAY:()=>xb,WORKDAYINTL:()=>O0e,XIRR:()=>P1e,XNPV:()=>R1e,XOR:()=>J1e,YEAR:()=>pge,YEARFRAC:()=>bC,YIELD:()=>q1e,YIELDDISC:()=>z1e,YIELDMAT:()=>U1e,Z:()=>wC,ZTEST:()=>I0e,utils:()=>j1e});g();y();v();var Mt=rn(VH(),1),Pv=rn(YH(),1),oC=new Error("#NULL!"),yo=new Error("#DIV/0!"),qe=new Error("#VALUE!"),Bh=new Error("#REF!"),pb=new Error("#NAME?"),tt=new Error("#NUM!"),Qt=new Error("#N/A"),aC=new Error("#ERROR!"),XH=new Error("#GETTING_DATA"),ume=Object.freeze({__proto__:null,data:XH,div0:yo,error:aC,na:Qt,name:pb,nil:oC,num:tt,ref:Bh,value:qe}),lme="=",fme=[">",">=","<","<=","=","<>"],KH="operator",JH="literal",cme=[KH,JH],ob=KH,qf=JH;function Nl(e,t){if(cme.indexOf(t)===-1)throw new Error("Unsupported token type: "+t);return{value:e,type:t}}function pme(e){return typeof e!="string"||/^\d+(\.\d+)?$/.test(e)&&(e=e.indexOf(".")===-1?parseInt(e,10):parseFloat(e)),e}function mme(e){let t=e.length,r=[],n=0,i="",o="";for(;n":case"<":case"=":o=o+u,i.length>0&&(r.push(i),i="");break;default:o.length>0&&(r.push(o),o=""),i=i+u;break}n++}return i.length>0&&r.push(i),o.length>0&&r.push(o),r}function hme(e){let t="",r=[];for(let n=0;n=0?r.push(Nl(i,ob)):t+=i}return t.length>0&&r.push(Nl(pme(t),qf)),r.length>0&&r[0].type!==ob&&r.unshift(Nl(lme,ob)),r}function dme(e){let t=[],r;for(let n=0;n":r=e[0]>e[1];break;case">=":r=e[0]>=e[1];break;case"<":r=e[0]":r=e[0]!=e[1];break}return r}function Lh(e){return hme(mme(e))}var Ph=dme;function mb(e){let t=[];return vo(e,r=>{t.push(r)}),t}function vo(e,t){let r=-1,n=e.length;for(;++rArray.isArray(i))||e.length===0)&&(e=[[...e]]),e.map((i,o)=>{i.map((u,l)=>{u||(e[o][l]=0)})});let r=e.reduce((i,o,u)=>o.length>e[i].length?u:i,0),n=e[r].length;return e.map(i=>[...i,...Array(n-i.length).fill(t||0)])}function gt(){let e;if(arguments.length===1){let t=arguments[0];e=yme(t)?mb.apply(null,arguments):[t]}else e=Array.from(arguments);for(;!xme(e);)e=nC(e);return e}function nC(e){return!e||!e.reduce?[e]:e.reduce((t,r)=>{let n=Array.isArray(t),i=Array.isArray(r);return n&&i?t.concat(r):n?(t.push(r),t):i?[t].concat(r):[t,r]})}function vme(e,t){return t=t||1,!e||typeof e.slice!="function"?e:e.slice(0,e.length-t)}function yme(e){return e!=null&&typeof e.length=="number"&&typeof e!="string"}function xme(e){if(!e)return!1;for(let t=0;te.map(n=>n[r])):qe}function Ka(e,t){let r=null;return vo(e,(n,i)=>{if(n[0]===t)return r=i,!1}),r??qe}function yr(){for(let e=0;etypeof t=="number")}function wme(e){e<60&&(e+=1);let r=Math.floor(e-25569)*86400,n=new Date(r*1e3),i=e-Math.floor(e)+1e-7,o=Math.floor(86400*i),u=o%60;o-=u;let l=Math.floor(o/(60*60)),a=Math.floor(o/60)%60,s=n.getUTCDate(),f=n.getUTCMonth();return e>=60&&e<61&&(s=29,f=1),new Date(n.getUTCFullYear(),f,s,l,a,u)}function uC(e){if(typeof e=="boolean"||e instanceof Error)return e;if(typeof e=="number")return e!==0;if(typeof e=="string"){let t=e.toUpperCase();if(t==="TRUE")return!0;if(t==="FALSE")return!1}return e instanceof Date&&!isNaN(e)?!0:qe}function br(e){if(!isNaN(e)){if(e instanceof Date)return new Date(e);let t=parseFloat(e);return t<0||t>=2958466?tt:wme(t)}return typeof e=="string"&&(e=/(\d{4})-(\d\d?)-(\d\d?)$/.test(e)?new Date(e+"T00:00:00.000"):new Date(e),!isNaN(e))?e:qe}function e$(e){let t=e.length,r;for(;t--;){if(r=br(e[t]),r===qe)return r;e[t]=r}return e}function ve(e){return e instanceof Error?e:e==null?0:(typeof e=="boolean"&&(e=+e),!isNaN(e)&&e!==""?parseFloat(e):qe)}function Ft(e){let t;if(!e||(t=e.length)===0)return qe;let r;for(;t--;){if(e[t]instanceof Error)return e[t];if(r=ve(e[t]),r instanceof Error)return r;e[t]=r}return e}function ei(e){return e instanceof Error?e:e==null?"":e.toString()}function hb(){let e=arguments.length;for(;e--;)if(typeof arguments[e]=="string")return!0;return!1}function db(){let e=mb(arguments),t=Ft(gt(e.shift()));if(t instanceof Error)return t;let r=e,n=r.length/2;for(let o=0;o{switch(e){case oC:return 1;case yo:return 2;case qe:return 3;case Bh:return 4;case pb:return 5;case tt:return 6;case Qt:return 7;case XH:return 8}return Qt};function Dme(){throw new Error("INFO is not implemented")}function Nme(e){return e===null}function r$(e){return[qe,Bh,yo,tt,pb,oC].indexOf(e)>=0||typeof e=="number"&&(isNaN(e)||!isFinite(e))}function gb(e){return r$(e)||e===Qt}function Eme(e){return!(Math.floor(Math.abs(e))&1)}function Sme(){throw new Error("ISFORMULA is not implemented")}function n$(e){return e===!0||e===!1}function Ame(e){return e===Qt}function Cme(e){return typeof e!="string"}function vb(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function Mme(e){return!!(Math.floor(Math.abs(e))&1)}function Tme(){throw new Error("ISREF is not implemented")}function i$(e){return typeof e=="string"}function Ome(e){return vb(e)?e:e instanceof Date?e.getTime():e===!0?1:e===!1?0:gb(e)?e:0}function Ime(){return Qt}function Fme(){throw new Error("SHEET is not implemented")}function _me(){throw new Error("SHEETS is not implemented")}function kme(e){if(vb(e))return 1;if(i$(e))return 2;if(n$(e))return 4;if(gb(e))return 16;if(Array.isArray(e))return 64}function Bme(){if(arguments.length<2)return Qt;let e=arguments[0];return e<1||e>254||arguments.length0&&!Array.isArray(e[0]);return i&&!r?(r=t,t=1):(r=r||1,t=t||1),r<0||t<0?qe:i&&t===1&&r<=e.length?e[r-1]:t<=e.length&&r<=e[t-1].length?e[t-1][r-1]:Bh}function zme(e,t,r){t=gt(t),r=r?gt(r):t;let n=typeof e=="number",i=Qt;for(let o=0;oe)return i}return i}function Ume(e,t,r){if(!e&&e!==0||!t||(arguments.length===2&&(r=1),t=gt(t),!(t instanceof Array))||r!==-1&&r!==0&&r!==1)return Qt;let n,i;for(let o=0;oi&&(n=o+1,i=t[o]):(n=o+1,i=t[o]))}else if(r===0){if(typeof e=="string"&&typeof t[o]=="string"){let u=e.toLowerCase().replace(/\?/g,".").replace(/\*/g,".*").replace(/~/g,"\\").replace(/\+/g,"\\+").replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\[/g,"\\[").replace(/\]/g,"\\]");if(new RegExp("^"+u+"$").test(t[o].toLowerCase()))return o+1}else if(t[o]===e)return o+1}else if(r===-1){if(t[o]===e)return o+1;t[o]>e&&(i?t[o]l.sort((a,s)=>(a=ei(a[t-1]),s=ei(s[t-1]),r===1?as?r:r*-1)),o=QH(e),u=n?ab(o):o;return t>=1&&t<=u[0].length?n?ab(i(u)):i(u):qe}function Wme(e){if(!e)return Qt;let t=QH(e);return ab(t)}function lC(){let e=[];for(let t=0;te&&(o=!0)}return i}var Vme=2.5066282746310002;function Gme(){let t=gt(arguments).filter(Rh);if(t.length===0)return tt;let r=Ft(t);return r instanceof Error?r:Mt.default.sum((0,Mt.default)(r).subtract(Mt.default.mean(r)).abs()[0])/r.length}function Np(){let t=gt(arguments).filter(Rh);if(t.length===0)return yo;let r=yr.apply(void 0,t);if(r)return r;let n=Mp(t),i=n.length,o=0,u=0,l;for(let a=0;an+i,0)/e.length;return isNaN(r)?0:r}var Rv={};Rv.DIST=function(e,t,r,n,i,o){return arguments.length<4||(i=i===void 0?0:i,o=o===void 0?1:o,e=ve(e),t=ve(t),r=ve(r),i=ve(i),o=ve(o),ft(e,t,r,i,o))?qe:(e=(e-i)/(o-i),n?Mt.default.beta.cdf(e,t,r):Mt.default.beta.pdf(e,t,r))};Rv.INV=(e,t,r,n,i)=>(n=n===void 0?0:n,i=i===void 0?1:i,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),ft(e,t,r,n,i)?qe:Mt.default.beta.inv(e,t,r)*(i-n)+n);var qh={};qh.DIST=(e,t,r,n)=>(e=ve(e),t=ve(t),r=ve(r),n=ve(n),ft(e,t,r,n)?qe:n?Mt.default.binomial.cdf(e,t,r):Mt.default.binomial.pdf(e,t,r));qh.DIST.RANGE=(e,t,r,n)=>{if(n=n===void 0?r:n,e=ve(e),t=ve(t),r=ve(r),n=ve(n),ft(e,t,r,n))return qe;let i=0;for(let o=r;o<=n;o++)i+=kh(e,o)*Math.pow(t,o)*Math.pow(1-t,e-o);return i};qh.INV=(e,t,r)=>{if(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r))return qe;let n=0;for(;n<=e;){if(Mt.default.binomial.cdf(n,e,t)>=r)return n;n++}};var qs={};qs.DIST=(e,t,r)=>(e=ve(e),t=ve(t),ft(e,t)?qe:r?Mt.default.chisquare.cdf(e,t):Mt.default.chisquare.pdf(e,t));qs.DIST.RT=(e,t)=>!e|!t?Qt:e<1||t>Math.pow(10,10)?tt:typeof e!="number"||typeof t!="number"?qe:1-Mt.default.chisquare.cdf(e,t);qs.INV=(e,t)=>(e=ve(e),t=ve(t),ft(e,t)?qe:Mt.default.chisquare.inv(e,t));qs.INV.RT=(e,t)=>!e|!t?Qt:e<0||e>1||t<1||t>Math.pow(10,10)?tt:typeof e!="number"||typeof t!="number"?qe:Mt.default.chisquare.inv(1-e,t);qs.TEST=function(e,t){if(arguments.length!==2)return Qt;if(!(e instanceof Array)||!(t instanceof Array)||e.length!==t.length||e[0]&&t[0]&&e[0].length!==t[0].length)return qe;let r=e.length,n,i,o;for(i=0;i=2;)x=x*p/b,b=b-2;let w=x,A=h;for(;w>1e-10*x;)A=A+2,w=w*p/A,x=x+w;return 1-x}return Math.round(f(a,l)*1e6)/1e6};var cC={};cC.NORM=(e,t,r)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:Mt.default.normalci(1,e,t,r)[1]-1);cC.T=(e,t,r)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:Mt.default.tci(1,e,t,r)[1]-1);function Xme(e,t){return e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t)?qe:Mt.default.corrcoeff(e,t)}function Bv(){let e=gt(arguments);return Mp(e).length}function Lv(){let e=gt(arguments);return e.length-a$(e)}function a$(){let e=gt(arguments),t=0,r;for(let n=0;n{if(e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t))return qe;let r=Mt.default.mean(e),n=Mt.default.mean(t),i=0,o=e.length;for(let u=0;u(e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t)?qe:Mt.default.covariance(e,t));function Qme(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=Mt.default.mean(e),r=0;for(let n=0;n(e=ve(e),t=ve(t),ft(e,t)?qe:r?Mt.default.exponential.cdf(e,t):Mt.default.exponential.pdf(e,t));var zs={};zs.DIST=(e,t,r,n)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:n?Mt.default.centralF.cdf(e,t,r):Mt.default.centralF.pdf(e,t,r));zs.DIST.RT=function(e,t,r){return arguments.length!==3?Qt:e<0||t<1||r<1?tt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:1-Mt.default.centralF.cdf(e,t,r)};zs.INV=(e,t,r)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:e<=0||e>1?tt:Mt.default.centralF.inv(e,t,r));zs.INV.RT=function(e,t,r){return arguments.length!==3?Qt:e<0||e>1||t<1||t>Math.pow(10,10)||r<1||r>Math.pow(10,10)?tt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:Mt.default.centralF.inv(1-e,t,r)};zs.TEST=(e,t)=>{if(!e||!t||!(e instanceof Array)||!(t instanceof Array))return Qt;if(e.length<2||t.length<2)return yo;let r=(l,a)=>{let s=0;for(let f=0;ft[o-1]&&e[u]<=t[o]&&(i[o]+=1):o===n&&e[u]>t[n-1]&&(i[n]+=1)}return i}function qv(e){return e=ve(e),e instanceof Error?e:e===0||parseInt(e,10)===e&&e<0?tt:Mt.default.gammafn(e)}qv.DIST=function(e,t,r,n){return arguments.length!==4?Qt:e<0||t<=0||r<=0||typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:n?Mt.default.gamma.cdf(e,t,r,!0):Mt.default.gamma.pdf(e,t,r,!1)};qv.INV=function(e,t,r){return arguments.length!==3?Qt:e<0||e>1||t<=0||r<=0?tt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:Mt.default.gamma.inv(e,t,r)};function mC(e){return e=ve(e),e instanceof Error?e:Mt.default.gammaln(e)}mC.PRECISE=function(e){return arguments.length!==1?Qt:e<=0?tt:typeof e!="number"?qe:Mt.default.gammaln(e)};function rhe(e){return e=ve(e),e instanceof Error?e:Mt.default.normal.cdf(e,0,1)-.5}function nhe(){let e=Ft(gt(arguments));return e instanceof Error?e:Mt.default.geomean(e)}function ihe(e,t,r,n){if(e=Ft(gt(e)),e instanceof Error)return e;let i;if(t===void 0)for(t=[],i=1;i<=e.length;i++)t.push(i);if(r===void 0&&(r=t),t=Ft(gt(t)),r=Ft(gt(r)),ft(t,r))return qe;n===void 0&&(n=!0);let o=e.length,u=0,l=0,a=0,s=0;for(i=0;i{if(e=ve(e),t=ve(t),r=ve(r),n=ve(n),ft(e,t,r,n))return qe;function o(l,a,s,f){return kh(s,l)*kh(f-s,a-l)/kh(f,a)}function u(l,a,s,f){let p=0;for(let h=0;h<=l;h++)p+=o(h,a,s,f);return p}return i?u(e,t,r,n):o(e,t,r,n)};function ahe(e,t){return e=Ft(e),t=Ft(t),ft(e,t)?qe:e.length!==t.length?Qt:s$(0,e,t)}function she(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=Mt.default.mean(e),r=e.length,n=0;for(let i=0;ii-n)[t-1]))}function dC(e,t){if(e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t))return qe;let r=Mt.default.mean(e),n=Mt.default.mean(t),i=t.length,o=0,u=0;for(let s=0;s(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:n?Mt.default.lognormal.cdf(e,t,r):Mt.default.lognormal.pdf(e,t,r));Uh.INV=(e,t,r)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:Mt.default.lognormal.inv(e,t,r));function sb(){let e=gt(arguments),t=yr.apply(void 0,e);if(t)return t;let r=Mp(e);return r.length===0?0:Math.max.apply(Math,r)}function lhe(){let e=gt(arguments),t=yr.apply(void 0,e);if(t)return t;let r=sC(e);return r=r.map(n=>n??0),r.length===0?0:Math.max.apply(Math,r)}function fhe(){let e=db(...arguments);return e.length===0?0:Math.max.apply(Math,e)}function l$(){let e=gt(arguments),t=yr.apply(void 0,e);if(t)return t;let r=sC(e),n=Mt.default.median(r);return isNaN(n)&&(n=tt),n}function ub(){let e=gt(arguments),t=yr.apply(void 0,e);if(t)return t;let r=Mp(e);return r.length===0?0:Math.min.apply(Math,r)}function che(){let e=gt(arguments),t=yr.apply(void 0,e);if(t)return t;let r=sC(e);return r=r.map(n=>n??0),r.length===0?0:Math.min.apply(Math,r)}function phe(){let e=db(...arguments);return e.length===0?0:Math.min.apply(Math,e)}var Ep={};Ep.MULT=function(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=e.length,r={},n=[],i=0,o;for(let u=0;ui&&(i=r[o],n=[]),r[o]===i&&(n[n.length]=o);return n};Ep.SNGL=function(){let e=Ft(gt(arguments));return e instanceof Error?e:Ep.MULT(e).sort((t,r)=>t-r)[0]};var gC={};gC.DIST=(e,t,r,n)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:n?Mt.default.negbin.cdf(e,t,r):Mt.default.negbin.pdf(e,t,r));var Us={};Us.DIST=(e,t,r,n)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:r<=0?tt:n?Mt.default.normal.cdf(e,t,r):Mt.default.normal.pdf(e,t,r));Us.INV=(e,t,r)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:Mt.default.normal.inv(e,t,r));Us.S={};Us.S.DIST=(e,t)=>(e=ve(e),e instanceof Error?qe:t?Mt.default.normal.cdf(e,0,1):Mt.default.normal.pdf(e,0,1));Us.S.INV=e=>(e=ve(e),e instanceof Error?qe:Mt.default.normal.inv(e,0,1));function f$(e,t){if(t=Ft(gt(t)),e=Ft(gt(e)),ft(t,e))return qe;let r=Mt.default.mean(e),n=Mt.default.mean(t),i=e.length,o=0,u=0,l=0;for(let a=0;a{if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;e=e.sort((o,u)=>o-u);let r=e.length;if(t<1/(r+1)||t>1-1/(r+1))return tt;let n=t*(r+1)-1,i=Math.floor(n);return jH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};ba.INC=(e,t)=>{if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;e=e.sort((o,u)=>o-u);let r=e.length,n=t*(r-1),i=Math.floor(n);return jH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};var zv={};zv.EXC=(e,t,r)=>{if(r=r===void 0?3:r,e=Ft(gt(e)),t=ve(t),r=ve(r),ft(e,t,r))return qe;e=e.sort((f,p)=>f-p);let n=lC.apply(null,e),i=e.length,o=n.length,u=Math.pow(10,r),l=0,a=!1,s=0;for(;!a&&s=n[s]&&(t{if(r=r===void 0?3:r,e=Ft(gt(e)),t=ve(t),r=ve(r),ft(e,t,r))return qe;e=e.sort((f,p)=>f-p);let n=lC.apply(null,e),i=e.length,o=n.length,u=Math.pow(10,r),l=0,a=!1,s=0;for(;!a&&s=n[s]&&(t(e=ve(e),t=ve(t),ft(e,t)?qe:r?Mt.default.poisson.cdf(e,t):Mt.default.poisson.pdf(e,t));function ghe(e,t,r,n){if(r===void 0)return 0;if(n=n===void 0?r:n,e=Ft(gt(e)),t=Ft(gt(t)),r=ve(r),n=ve(n),ft(e,t,r,n))return qe;if(r===n)return e.indexOf(r)>=0?t[e.indexOf(r)]:0;let i=e.sort((l,a)=>l-a),o=i.length,u=0;for(let l=0;l=r&&i[l]<=n&&(u+=t[e.indexOf(i[l])]);return u}var Sp={};Sp.EXC=(e,t)=>{if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;switch(t){case 1:return ba.EXC(e,.25);case 2:return ba.EXC(e,.5);case 3:return ba.EXC(e,.75);default:return tt}};Sp.INC=(e,t)=>{if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;switch(t){case 1:return ba.INC(e,.25);case 2:return ba.INC(e,.5);case 3:return ba.INC(e,.75);default:return tt}};var Uv={};Uv.AVG=(e,t,r)=>{if(e=ve(e),t=Ft(gt(t)),ft(e,t))return qe;t=gt(t),r=r||!1;let n=r?(u,l)=>u-l:(u,l)=>l-u;t=t.sort(n);let i=t.length,o=0;for(let u=0;u1?(2*t.indexOf(e)+o+1)/2:t.indexOf(e)+1};Uv.EQ=(e,t,r)=>{if(e=ve(e),t=Ft(gt(t)),ft(e,t))return qe;r=r||!1;let n=r?(i,o)=>i-o:(i,o)=>o-i;return t=t.sort(n),t.indexOf(e)+1};function vhe(e,t){if(arguments.length!==2)return Qt;if(t<0)return tt;if(!(e instanceof Array)||typeof t!="number")return qe;if(e.length!==0)return Mt.default.row(e,t)}function yhe(e,t){return e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t)?qe:Math.pow(f$(e,t),2)}function yC(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=Mt.default.mean(e),r=e.length,n=0;for(let i=0;ir-n)[t-1]}function whe(e,t,r){return e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:(e-t)/r}var Ko={};Ko.P=function(){let e=_o.P.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=tt),t};Ko.S=function(){let e=_o.S.apply(this,arguments);return Math.sqrt(e)};function bhe(){let e=p$.apply(this,arguments);return Math.sqrt(e)}function Dhe(){let e=m$.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=tt),t}function Nhe(e,t){if(e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t))return qe;let r=Mt.default.mean(t),n=Mt.default.mean(e),i=t.length,o=0,u=0,l=0;for(let a=0;ar!==1&&r!==2?tt:r===1?Da.DIST.RT(e,t):Da.DIST["2T"](e,t);Da.DIST["2T"]=function(e,t){return arguments.length!==2?Qt:e<0||t<1?tt:typeof e!="number"||typeof t!="number"?qe:(1-Mt.default.studentt.cdf(e,t))*2};Da.DIST.RT=function(e,t){return arguments.length!==2?Qt:e<0||t<1?tt:typeof e!="number"||typeof t!="number"?qe:1-Mt.default.studentt.cdf(e,t)};Da.INV=(e,t)=>(e=ve(e),t=ve(t),ft(e,t)?qe:Mt.default.studentt.inv(e,t));Da.INV["2T"]=(e,t)=>(e=ve(e),t=ve(t),e<=0||e>1||t<1?tt:ft(e,t)?qe:Math.abs(Mt.default.studentt.inv(e/2,t)));Da.TEST=(e,t)=>{if(e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t))return qe;let r=Mt.default.mean(e),n=Mt.default.mean(t),i=0,o=0,u;for(u=0;u{u.push(i*l+o)}),u}function She(e,t){if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;let r=Ap(e.length*t,2)/2;return Mt.default.mean(vme(wn(e.sort((n,i)=>n-i),r),r))}var _o={};_o.P=function(){let e=Mp(gt(arguments)),t=e.length,r=0,n=Np(e),i;for(let o=0;o(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:n?1-Math.exp(-Math.pow(e/r,t)):Math.pow(e,t-1)*Math.exp(-Math.pow(e/r,t))*t/Math.pow(r,t));var wC={};wC.TEST=(e,t,r)=>{if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;r=r||Ko.S(e);let n=e.length;return 1-Us.S.DIST((Np(e)-t)/(r/Math.sqrt(n)),!0)};function Ahe(e){return e=ve(e),e instanceof Error?e:Math.abs(e)}function Che(e){if(e=ve(e),e instanceof Error)return e;let t=Math.acos(e);return isNaN(t)&&(t=tt),t}function Mhe(e){if(e=ve(e),e instanceof Error)return e;let t=Math.log(e+Math.sqrt(e*e-1));return isNaN(t)&&(t=tt),t}function The(e){return e=ve(e),e instanceof Error?e:Math.atan(1/e)}function Ohe(e){if(e=ve(e),e instanceof Error)return e;let t=.5*Math.log((e+1)/(e-1));return isNaN(t)&&(t=tt),t}function Ihe(e,t,r,n){if(e=ve(e),t=ve(e),ft(e,t))return qe;switch(e){case 1:return Np(r);case 2:return Bv(r);case 3:return Lv(r);case 4:return sb(r);case 5:return ub(r);case 6:return lb(r);case 7:return Ko.S(r);case 8:return Ko.P(r);case 9:return Al(r);case 10:return _o.S(r);case 11:return _o.P(r);case 12:return l$(r);case 13:return Ep.SNGL(r);case 14:return u$(r,n);case 15:return c$(r,n);case 16:return ba.INC(r,n);case 17:return Sp.INC(r,n);case 18:return ba.EXC(r,n);case 19:return Sp.EXC(r,n)}}function Fhe(e){if(e==null)return 0;if(e instanceof Error)return e;if(!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(e))return qe;let t=0;return e.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,r=>{t+={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}[r]}),t}function _he(e){if(e=ve(e),e instanceof Error)return e;let t=Math.asin(e);return isNaN(t)&&(t=tt),t}function khe(e){return e=ve(e),e instanceof Error?e:Math.log(e+Math.sqrt(e*e+1))}function Bhe(e){return e=ve(e),e instanceof Error?e:Math.atan(e)}function Lhe(e,t){e=ve(e),t=ve(t);let r=yr(e,t);return r||Math.atan2(e,t)}function Phe(e){if(e=ve(e),e instanceof Error)return e;let t=Math.log((1+e)/(1-e))/2;return isNaN(t)&&(t=tt),t}function Rhe(e,t,r){e=ve(e),t=ve(t),r=ve(r);let n=yr(e,t,r);if(n)return n;if(t===0)return tt;let i=e.toString(t);return new Array(Math.max(r+1-i.length,0)).join("0")+i}function Sl(e,t,r){e=ve(e),t=ve(t),r=ve(r);let n=yr(e,t,r);if(n)return n;if(t===0)return 0;t=Math.abs(t);let i=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Tu(Math.ceil(e/t)*t,i):r===0?-Tu(Math.floor(Math.abs(e)/t)*t,i):-Tu(Math.ceil(Math.abs(e)/t)*t,i)}Sl.MATH=Sl;Sl.PRECISE=Sl;function kh(e,t){e=ve(e),t=ve(t);let r=yr(e,t);return r||(e1?aC:(e=ve(e),e instanceof Error||(e=Math.exp(e)),e)}var nb=[];function El(e){if(e=ve(e),e instanceof Error)return e;let t=Math.floor(e);return t===0||t===1?1:(nb[t]>0||(nb[t]=El(t-1)*t),nb[t])}function h$(e){if(e=ve(e),e instanceof Error)return e;let t=Math.floor(e);return t<=0?1:t*h$(t-2)}function Ap(e,t){e=ve(e),t=ve(t);let r=yr(e,t);if(r)return r;if(t===0)return 0;if(!(e>=0&&t>0)&&!(e<=0&&t<0))return tt;t=Math.abs(t);let n=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Tu(Math.floor(e/t)*t,n):-Tu(Math.ceil(Math.abs(e)/t),n)}Ap.MATH=(e,t,r)=>{if(t instanceof Error)return t;t=t===void 0?0:t,e=ve(e),t=ve(t),r=ve(r);let n=yr(e,t,r);if(n)return n;if(t===0)return 0;t=t?Math.abs(t):1;let i=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Tu(Math.floor(e/t)*t,i):r===0||r===void 0?-Tu(Math.ceil(Math.abs(e)/t)*t,i):-Tu(Math.floor(Math.abs(e)/t)*t,i)};Ap.PRECISE=Ap.MATH;function Khe(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=e.length,r=e[0],n=r<0?-r:r;for(let i=1;iu?n%=u:u%=n;n+=u}return n}function Jhe(e){return e=ve(e),e instanceof Error?e:Math.floor(e)}var Qhe={CEILING:Sl};function jhe(){let e=Ft(gt(arguments));if(e instanceof Error)return e;for(var t,r,n,i,o=1;(n=e.pop())!==void 0;){if(n===0)return 0;for(;n>1;){if(n%2){for(t=3,r=Math.floor(Math.sqrt(n));t<=r&&n%t;t+=2);i=t<=r?t:n}else i=2;for(n/=i,o*=i,t=e.length;t;e[--t]%i===0&&(e[t]/=i)===1&&e.splice(t,1));}}return o}function ede(e){return e=ve(e),e instanceof Error?e:e===0?tt:Math.log(e)}function tde(e,t){e=ve(e),t=ve(t);let r=yr(e,t);return r||(e===0||t===0?tt:Math.log(e)/Math.log(t))}function rde(e){return e=ve(e),e instanceof Error?e:e===0?tt:Math.log(e)/Math.log(10)}function nde(e,t){return!Array.isArray(e)||!Array.isArray(t)||e.some(n=>!n.length)||t.some(n=>!n.length)||nC(e).some(n=>typeof n!="number")||nC(t).some(n=>typeof n!="number")||e[0].length!==t.length?qe:Array(e.length).fill(0).map(()=>Array(t[0].length).fill(0)).map((n,i)=>n.map((o,u)=>e[i].reduce((l,a,s)=>l+a*t[s][u],0)))}function ide(e,t){e=ve(e),t=ve(t);let r=yr(e,t);if(r)return r;if(t===0)return yo;let n=Math.abs(e%t);return n=e<0?t-n:n,t>0?n:-n}function ode(e,t){e=ve(e),t=ve(t);let r=yr(e,t);return r||(e*t===0?0:e*t<0?tt:Math.round(e/t)*t)}function ade(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=0,r=1;for(let n=0;n1?Qt:(e=parseInt(e),!e||e<=0?qe:Array(e).fill(0).map(()=>Array(e).fill(0)).map((t,r)=>(t[r]=1,t)))}function ude(e){if(e=ve(e),e instanceof Error)return e;let t=Math.ceil(Math.abs(e));return t=t&1?t:t+1,e>=0?t:-t}function lde(){return Math.PI}function d$(e,t){e=ve(e),t=ve(t);let r=yr(e,t);if(r)return r;if(e===0&&t===0)return tt;let n=Math.pow(e,t);return isNaN(n)?tt:n}function lb(){let t=gt(arguments).filter(i=>i!=null);if(t.length===0)return 0;let r=Ft(t);if(r instanceof Error)return r;let n=1;for(let i=0;i0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function gde(e,t){e=ve(e),t=ve(t);let r=yr(e,t);return r||(e>0?1:-1)*Math.ceil(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function vde(e){return e=ve(e),e instanceof Error?e:1/Math.cos(e)}function yde(e){return e=ve(e),e instanceof Error?e:2/(Math.exp(e)+Math.exp(-e))}function xde(e,t,r,n){if(e=ve(e),t=ve(t),r=ve(r),n=Ft(n),ft(e,t,r,n))return qe;let i=n[0]*Math.pow(e,t);for(let o=1;o{if(e instanceof Error)return!1;if(t instanceof Error)e=t;else if(typeof t=="number")e+=t;else if(typeof t=="string"){let r=parseFloat(t);!isNaN(r)&&(e+=r)}else if(Array.isArray(t)){let r=Al.apply(null,t);r instanceof Error?e=r:e+=r}}),e}function Ade(e,t,r){if(e=gt(e),r=r?gt(r):e,e instanceof Error)return e;if(t==null||t instanceof Error)return 0;let n=0,i=t==="*",o=i?null:Lh(t+"");for(let u=0;u0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function Lde(e,t){if(arguments.length!==2)return Qt;e=ve(e),t=ve(t);let r=yr(e,t);return r||e+t}function Pde(e,t){if(arguments.length!==2)return Qt;e=ve(e),t=ve(t);let r=yr(e,t);return r||(t===0?yo:e/t)}function Rde(e,t){return arguments.length!==2?Qt:e instanceof Error?e:t instanceof Error?t:(e===null&&(e=void 0),t===null&&(t=void 0),e===t)}function qde(e,t){if(arguments.length!==2)return Qt;if(e instanceof Error)return e;if(t instanceof Error)return t;hb(e,t)?(e=ei(e),t=ei(t)):(e=ve(e),t=ve(t));let r=yr(e,t);return r||e>t}function zde(e,t){if(arguments.length!==2)return Qt;hb(e,t)?(e=ei(e),t=ei(t)):(e=ve(e),t=ve(t));let r=yr(e,t);return r||e>=t}function Ude(e,t){if(arguments.length!==2)return Qt;hb(e,t)?(e=ei(e),t=ei(t)):(e=ve(e),t=ve(t));let r=yr(e,t);return r||ei||l===i&&a28){let i=[31,28,31,30,31,30,31,31,30,31,30,31][n],o=e.getFullYear();n===1&&(o%4===0&&o%100!==0||o%400===0)&&(i=29),r=Math.min(r,i)}return e.setDate(r),e}function tge(e,t){return e=br(e),e instanceof Error?e:isNaN(t)?qe:(t=parseInt(t,10),new Date(e.getFullYear(),e.getMonth()+t+1,0))}function rge(e){return e=br(e),e instanceof Error?e:e.getHours()}function g$(e){if(e=br(e),e instanceof Error)return e;e=cb(e),e.setDate(e.getDate()+4-(e.getDay()||7));let t=new Date(e.getFullYear(),0,1);return Math.ceil(((e-t)/864e5+1)/7)}function nge(e){return e=br(e),e instanceof Error?e:e.getMinutes()}function ige(e){return e=br(e),e instanceof Error?e:e.getMonth()+1}function yb(e,t,r){return yb.INTL(e,t,1,r)}yb.INTL=(e,t,r,n)=>{if(e=br(e),e instanceof Error)return e;if(t=br(t),t instanceof Error)return t;let i=!1,o=[],u=[1,2,3,4,5,6,0],l=new RegExp("^[0|1]{7}$");if(r===void 0)r=fb[1];else if(typeof r=="string"&&l.test(r)){i=!0,r=r.split("");for(let p=0;p0?f.getUTCDay():f.getDay(),x=i?o.includes(h):h===r[0]||h===r[1];for(let b=0;b{if(e=br(e),e instanceof Error)return e;if(t=ve(t),t instanceof Error)return t;if(r===void 0?r=fb[1]:r=fb[r],!(r instanceof Array))return qe;n===void 0?n=[]:n instanceof Array||(n=[n]);for(let u=0;u{let A=b.getFullYear(),E=new Date(A,2,1);if(eC(A)&&b=E)return!0;let O=w.getFullYear(),M=new Date(O,2,1);return eC(O)&&w>=M&&bl||i===l&&n>=u))return(o===a&&eC(o)||s(e,t)||l===1&&u===29)&&(f=366),ib(e,t)/f;let p=a-o+1,x=(new Date(a+1,0,1)-new Date(o,0,1))/1e3/60/60/24/p;return ib(e,t)/x}case 2:return ib(e,t)/360;case 3:return ib(e,t)/365;case 4:return(u+l*30+a*360-(n+i*30+o*360))/360}}function ZH(e){let t=e>-22038912e5?2:1;return Math.ceil((e-Zde)/864e5)+t}function mge(){throw new Error("ASC is not implemented")}function hge(){throw new Error("BAHTTEXT is not implemented")}function v$(e){return e=ve(e),e===0?qe:e instanceof Error?e:String.fromCharCode(e)}function dge(e){if(ft(e))return e;e=e||"";let t=/[\0-\x1F]/g;return e.replace(t,"")}function y$(e){if(ft(e))return e;e=e||"";let t=e.charCodeAt(0);return isNaN(t)&&(t=qe),t}function x$(){let e=gt(arguments),t=yr.apply(void 0,e);if(t)return t;let r=0;for(;(r=e.indexOf(!0))>-1;)e[r]="TRUE";let n=0;for(;(n=e.indexOf(!1))>-1;)e[n]="FALSE";return e.join("")}var gge=x$;function vge(){throw new Error("DBCS is not implemented")}function yge(e,t=2){if(e=ve(e),isNaN(e))return qe;e=Tu(e,t);let r={style:"currency",currency:"USD",minimumFractionDigits:t>=0?t:0,maximumFractionDigits:t>=0?t:0},n=e.toLocaleString("en-US",r);return e<0?"$("+n.slice(2)+")":n}function xge(e,t){if(arguments.length!==2)return Qt;let r=yr(e,t);return r||(e=ei(e),t=ei(t),e===t)}function wge(e,t,r){if(arguments.length<2)return Qt;e=ei(e),t=ei(t),r=r===void 0?0:r;let n=t.indexOf(e,r-1);return n===-1?qe:n+1}function w$(e,t=2,r=!1){if(e=ve(e),isNaN(e)||(t=ve(t),isNaN(t)))return qe;if(t<0){let n=Math.pow(10,-t);e=Math.round(e/n)*n}else e=e.toFixed(t);if(r)e=e.toString().replace(/,/g,"");else{let n=e.toString().split(".");n[0]=n[0].replace(/\B(?=(\d{3})+$)/g,","),e=n.join(".")}return e}function bge(e,t){let r=yr(e,t);return r||(e=ei(e),t=t===void 0?1:t,t=ve(t),t instanceof Error||typeof e!="string"?qe:e.substring(0,t))}function Dge(e){return arguments.length===0?aC:e instanceof Error?e:Array.isArray(e)?qe:ei(e).length}function Nge(e){return arguments.length!==1?qe:(e=ei(e),ft(e)?e:e.toLowerCase())}function Ege(e,t,r){if(t==null)return qe;if(t=ve(t),r=ve(r),ft(t,r)||typeof e!="string")return r;let n=t-1,i=n+r;return e.substring(n,i)}function Sge(e,t,r){return e=Rh(e)?e:"",typeof e=="number"?e:typeof e!="string"?Qt:(t=typeof t>"u"?".":t,r=typeof r>"u"?",":r,Number(e.replace(t,".").replace(r,"")))}function Age(){throw new Error("PRONETIC is not implemented")}function Cge(e){return ft(e)?e:isNaN(e)&&typeof e=="number"?qe:(e=ei(e),e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function Mge(e,t,r,n){return t=ve(t),r=ve(r),ft(t,r)||typeof e!="string"||typeof n!="string"?qe:e.substr(0,t-1)+n+e.substr(t-1+r)}function Na(e,t){let r=yr(e,t);return r||(e=ei(e),t=ve(t),t instanceof Error?t:new Array(t+1).join(e))}function Tge(e,t){let r=yr(e,t);return r||(e=ei(e),t=t===void 0?1:t,t=ve(t),t instanceof Error?t:e.substring(e.length-t))}function Oge(e,t,r){let n;return typeof e!="string"||typeof t!="string"?qe:(r=r===void 0?0:r,n=t.toLowerCase().indexOf(e.toLowerCase(),r-1)+1,n===0?qe:n)}function Ige(e,t,r,n){if(arguments.length<3)return Qt;if(!e||!t)return e;if(n===void 0)return e.split(t).join(r);{if(n=Math.floor(Number(n)),Number.isNaN(n)||n<=0)return qe;let i=0,o=0;for(;i>-1&&e.indexOf(t,i)>-1;)if(i=e.indexOf(t,i+1),o++,i>-1&&o===n)return e.substring(0,i)+r+e.substring(i+t.length);return e}}function Fge(e){return e instanceof Error||typeof e=="string"?e:""}function _ge(e,t){if(e===void 0||e instanceof Error||t instanceof Error)return Qt;if(e instanceof Date)return e.toISOString().slice(0,10);if(t==null)return"";if(typeof t=="number")return String(t);if(typeof t!="string")return qe;let r=t.startsWith("$")?"$":"",n=t.endsWith("%");t=t.replace(/%/g,"").replace(/\$/g,"");let i=t.includes(".")?t.split(".")[1].match(/0/g).length:0,o=!t.includes(",");return n&&(e=e*100),e=w$(e,i,o),e.startsWith("-")?(e=e.replace("-",""),e="-"+r+e):e=r+e,n&&(e=e+"%"),e}function kge(e,t,...r){if(typeof t!="boolean"&&(t=uC(t)),arguments.length<3)return Qt;e=e??"";let n=gt(r),i=t?n.filter(o=>o):n;if(Array.isArray(e)){e=gt(e);let o=i.map(l=>[l]),u=0;for(let l=0;l=n.length?Na("0",t-n.length)+n:tt)}function Gge(e,t){if(!DC(e))return tt;let r=e.toString();if(r.length===10&&r.substring(0,1)==="1")return(1073741312+parseInt(r.substring(1),2)).toString(8);let n=parseInt(e,2).toString(8);return t===void 0?n:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=n.length?Na("0",t-n.length)+n:tt)}function Yge(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?tt:e&t}function Zge(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?tt:t>=0?e<>-t}function Xge(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?tt:e|t}function Kge(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?tt:t>=0?e>>t:e<<-t}function Jge(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?tt:e^t}function xo(e,t,r){if(e=ve(e),t=ve(t),ft(e,t))return e;if(r=r===void 0?"i":r,r!=="i"&&r!=="j")return qe;if(e===0&&t===0)return 0;if(e===0)return t===1?r:t.toString()+r;if(t===0)return e.toString();{let n=t>0?"+":"";return e.toString()+n+(t===1?r:t.toString()+r)}}function Qge(e,t,r){if(e=ve(e),e instanceof Error)return e;let n=[["a.u. of action","?",null,"action",!1,!1,105457168181818e-48],["a.u. of charge","e",null,"electric_charge",!1,!1,160217653141414e-33],["a.u. of energy","Eh",null,"energy",!1,!1,435974417757576e-32],["a.u. of length","a?",null,"length",!1,!1,529177210818182e-25],["a.u. of mass","m?",null,"mass",!1,!1,910938261616162e-45],["a.u. of time","?/Eh",null,"time",!1,!1,241888432650516e-31],["admiralty knot","admkn",null,"speed",!1,!0,.514773333],["ampere","A",null,"electric_current",!0,!1,1],["ampere per meter","A/m",null,"magnetic_field_intensity",!0,!1,1],["\xE5ngstr\xF6m","\xC5",["ang"],"length",!1,!0,1e-10],["are","ar",null,"area",!1,!0,100],["astronomical unit","ua",null,"length",!1,!1,149597870691667e-25],["bar","bar",null,"pressure",!1,!1,1e5],["barn","b",null,"area",!1,!1,1e-28],["becquerel","Bq",null,"radioactivity",!0,!1,1],["bit","bit",["b"],"information",!1,!0,1],["btu","BTU",["btu"],"energy",!1,!0,1055.05585262],["byte","byte",null,"information",!1,!0,8],["candela","cd",null,"luminous_intensity",!0,!1,1],["candela per square metre","cd/m?",null,"luminance",!0,!1,1],["coulomb","C",null,"electric_charge",!0,!1,1],["cubic \xE5ngstr\xF6m","ang3",["ang^3"],"volume",!1,!0,1e-30],["cubic foot","ft3",["ft^3"],"volume",!1,!0,.028316846592],["cubic inch","in3",["in^3"],"volume",!1,!0,16387064e-12],["cubic light-year","ly3",["ly^3"],"volume",!1,!0,846786664623715e-61],["cubic metre","m3",["m^3"],"volume",!0,!0,1],["cubic mile","mi3",["mi^3"],"volume",!1,!0,416818182544058e-5],["cubic nautical mile","Nmi3",["Nmi^3"],"volume",!1,!0,6352182208],["cubic Pica","Pica3",["Picapt3","Pica^3","Picapt^3"],"volume",!1,!0,758660370370369e-22],["cubic yard","yd3",["yd^3"],"volume",!1,!0,.764554857984],["cup","cup",null,"volume",!1,!0,.0002365882365],["dalton","Da",["u"],"mass",!1,!1,166053886282828e-41],["day","d",["day"],"time",!1,!0,86400],["degree","\xB0",null,"angle",!1,!1,.0174532925199433],["degrees Rankine","Rank",null,"temperature",!1,!0,.555555555555556],["dyne","dyn",["dy"],"force",!1,!0,1e-5],["electronvolt","eV",["ev"],"energy",!1,!0,1.60217656514141],["ell","ell",null,"length",!1,!0,1.143],["erg","erg",["e"],"energy",!1,!0,1e-7],["farad","F",null,"electric_capacitance",!0,!1,1],["fluid ounce","oz",null,"volume",!1,!0,295735295625e-16],["foot","ft",null,"length",!1,!0,.3048],["foot-pound","flb",null,"energy",!1,!0,1.3558179483314],["gal","Gal",null,"acceleration",!1,!1,.01],["gallon","gal",null,"volume",!1,!0,.003785411784],["gauss","G",["ga"],"magnetic_flux_density",!1,!0,1],["grain","grain",null,"mass",!1,!0,647989e-10],["gram","g",null,"mass",!1,!0,.001],["gray","Gy",null,"absorbed_dose",!0,!1,1],["gross registered ton","GRT",["regton"],"volume",!1,!0,2.8316846592],["hectare","ha",null,"area",!1,!0,1e4],["henry","H",null,"inductance",!0,!1,1],["hertz","Hz",null,"frequency",!0,!1,1],["horsepower","HP",["h"],"power",!1,!0,745.69987158227],["horsepower-hour","HPh",["hh","hph"],"energy",!1,!0,2684519538e-3],["hour","h",["hr"],"time",!1,!0,3600],["imperial gallon (U.K.)","uk_gal",null,"volume",!1,!0,.00454609],["imperial hundredweight","lcwt",["uk_cwt","hweight"],"mass",!1,!0,50.802345],["imperial quart (U.K)","uk_qt",null,"volume",!1,!0,.0011365225],["imperial ton","brton",["uk_ton","LTON"],"mass",!1,!0,1016.046909],["inch","in",null,"length",!1,!0,.0254],["international acre","uk_acre",null,"area",!1,!0,4046.8564224],["IT calorie","cal",null,"energy",!1,!0,4.1868],["joule","J",null,"energy",!0,!0,1],["katal","kat",null,"catalytic_activity",!0,!1,1],["kelvin","K",["kel"],"temperature",!0,!0,1],["kilogram","kg",null,"mass",!0,!0,1],["knot","kn",null,"speed",!1,!0,.514444444444444],["light-year","ly",null,"length",!1,!0,9460730472580800],["litre","L",["l","lt"],"volume",!1,!0,.001],["lumen","lm",null,"luminous_flux",!0,!1,1],["lux","lx",null,"illuminance",!0,!1,1],["maxwell","Mx",null,"magnetic_flux",!1,!1,1e-18],["measurement ton","MTON",null,"volume",!1,!0,1.13267386368],["meter per hour","m/h",["m/hr"],"speed",!1,!0,.00027777777777778],["meter per second","m/s",["m/sec"],"speed",!0,!0,1],["meter per second squared","m?s??",null,"acceleration",!0,!1,1],["parsec","pc",["parsec"],"length",!1,!0,0x6da012f958ee1c],["meter squared per second","m?/s",null,"kinematic_viscosity",!0,!1,1],["metre","m",null,"length",!0,!0,1],["miles per hour","mph",null,"speed",!1,!0,.44704],["millimetre of mercury","mmHg",null,"pressure",!1,!1,133.322],["minute","?",null,"angle",!1,!1,.000290888208665722],["minute","min",["mn"],"time",!1,!0,60],["modern teaspoon","tspm",null,"volume",!1,!0,5e-6],["mole","mol",null,"amount_of_substance",!0,!1,1],["morgen","Morgen",null,"area",!1,!0,2500],["n.u. of action","?",null,"action",!1,!1,105457168181818e-48],["n.u. of mass","m?",null,"mass",!1,!1,910938261616162e-45],["n.u. of speed","c?",null,"speed",!1,!1,299792458],["n.u. of time","?/(me?c??)",null,"time",!1,!1,128808866778687e-35],["nautical mile","M",["Nmi"],"length",!1,!0,1852],["newton","N",null,"force",!0,!0,1],["\u0153rsted","Oe ",null,"magnetic_field_intensity",!1,!1,79.5774715459477],["ohm","\u03A9",null,"electric_resistance",!0,!1,1],["ounce mass","ozm",null,"mass",!1,!0,.028349523125],["pascal","Pa",null,"pressure",!0,!1,1],["pascal second","Pa?s",null,"dynamic_viscosity",!0,!1,1],["pferdest\xE4rke","PS",null,"power",!1,!0,735.49875],["phot","ph",null,"illuminance",!1,!1,1e-4],["pica (1/6 inch)","pica",null,"length",!1,!0,.00035277777777778],["pica (1/72 inch)","Pica",["Picapt"],"length",!1,!0,.00423333333333333],["poise","P",null,"dynamic_viscosity",!1,!1,.1],["pond","pond",null,"force",!1,!0,.00980665],["pound force","lbf",null,"force",!1,!0,4.4482216152605],["pound mass","lbm",null,"mass",!1,!0,.45359237],["quart","qt",null,"volume",!1,!0,.000946352946],["radian","rad",null,"angle",!0,!1,1],["second","?",null,"angle",!1,!1,484813681109536e-20],["second","s",["sec"],"time",!0,!0,1],["short hundredweight","cwt",["shweight"],"mass",!1,!0,45.359237],["siemens","S",null,"electrical_conductance",!0,!1,1],["sievert","Sv",null,"equivalent_dose",!0,!1,1],["slug","sg",null,"mass",!1,!0,14.59390294],["square \xE5ngstr\xF6m","ang2",["ang^2"],"area",!1,!0,1e-20],["square foot","ft2",["ft^2"],"area",!1,!0,.09290304],["square inch","in2",["in^2"],"area",!1,!0,64516e-8],["square light-year","ly2",["ly^2"],"area",!1,!0,895054210748189e17],["square meter","m?",null,"area",!0,!0,1],["square mile","mi2",["mi^2"],"area",!1,!0,2589988110336e-6],["square nautical mile","Nmi2",["Nmi^2"],"area",!1,!0,3429904],["square Pica","Pica2",["Picapt2","Pica^2","Picapt^2"],"area",!1,!0,1792111111111e-17],["square yard","yd2",["yd^2"],"area",!1,!0,.83612736],["statute mile","mi",null,"length",!1,!0,1609.344],["steradian","sr",null,"solid_angle",!0,!1,1],["stilb","sb",null,"luminance",!1,!1,1e-4],["stokes","St",null,"kinematic_viscosity",!1,!1,1e-4],["stone","stone",null,"mass",!1,!0,6.35029318],["tablespoon","tbs",null,"volume",!1,!0,147868e-10],["teaspoon","tsp",null,"volume",!1,!0,492892e-11],["tesla","T",null,"magnetic_flux_density",!0,!0,1],["thermodynamic calorie","c",null,"energy",!1,!0,4.184],["ton","ton",null,"mass",!1,!0,907.18474],["tonne","t",null,"mass",!1,!1,1e3],["U.K. pint","uk_pt",null,"volume",!1,!0,.00056826125],["U.S. bushel","bushel",null,"volume",!1,!0,.03523907],["U.S. oil barrel","barrel",null,"volume",!1,!0,.158987295],["U.S. pint","pt",["us_pt"],"volume",!1,!0,.000473176473],["U.S. survey mile","survey_mi",null,"length",!1,!0,1609.347219],["U.S. survey/statute acre","us_acre",null,"area",!1,!0,4046.87261],["volt","V",null,"voltage",!0,!1,1],["watt","W",null,"power",!0,!0,1],["watt-hour","Wh",["wh"],"energy",!1,!0,3600],["weber","Wb",null,"magnetic_flux",!0,!1,1],["yard","yd",null,"length",!1,!0,.9144],["year","yr",null,"time",!1,!0,31557600]],i={Yi:["yobi",80,12089258196146292e8,"Yi","yotta"],Zi:["zebi",70,11805916207174113e5,"Zi","zetta"],Ei:["exbi",60,1152921504606847e3,"Ei","exa"],Pi:["pebi",50,0x4000000000000,"Pi","peta"],Ti:["tebi",40,1099511627776,"Ti","tera"],Gi:["gibi",30,1073741824,"Gi","giga"],Mi:["mebi",20,1048576,"Mi","mega"],ki:["kibi",10,1024,"ki","kilo"]},o={Y:["yotta",1e24,"Y"],Z:["zetta",1e21,"Z"],E:["exa",1e18,"E"],P:["peta",1e15,"P"],T:["tera",1e12,"T"],G:["giga",1e9,"G"],M:["mega",1e6,"M"],k:["kilo",1e3,"k"],h:["hecto",100,"h"],e:["dekao",10,"e"],d:["deci",.1,"d"],c:["centi",.01,"c"],m:["milli",.001,"m"],u:["micro",1e-6,"u"],n:["nano",1e-9,"n"],p:["pico",1e-12,"p"],f:["femto",1e-15,"f"],a:["atto",1e-18,"a"],z:["zepto",1e-21,"z"],y:["yocto",1e-24,"y"]},u=null,l=null,a=t,s=r,f=1,p=1,h;for(let x=0;x=0)&&(u=n[x]),(n[x][1]===s||h.indexOf(s)>=0)&&(l=n[x]);if(u===null){let x=i[t.substring(0,2)],b=o[t.substring(0,1)];t.substring(0,2)==="da"&&(b=["dekao",10,"da"]),x?(f=x[2],a=t.substring(2)):b&&(f=b[1],a=t.substring(b[2].length));for(let w=0;w=0)&&(u=n[w])}if(l===null){let x=i[r.substring(0,2)],b=o[r.substring(0,1)];r.substring(0,2)==="da"&&(b=["dekao",10,"da"]),x?(p=x[2],s=r.substring(2)):b&&(p=b[1],s=r.substring(b[2].length));for(let w=0;w=0)&&(l=n[w])}return u===null||l===null||u[3]!==l[3]?Qt:e*u[6]*f/(l[6]*p)}function jge(e,t){if(e=ve(e),e instanceof Error)return e;if(!/^-?[0-9]{1,3}$/.test(e)||e<-512||e>511)return tt;if(e<0)return"1"+Na("0",9-(512+e).toString(2).length)+(512+e).toString(2);let r=parseInt(e,10).toString(2);return typeof t>"u"?r:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=r.length?Na("0",t-r.length)+r:tt)}function eve(e,t){if(e=ve(e),e instanceof Error)return e;if(!/^-?[0-9]{1,12}$/.test(e)||e<-549755813888||e>549755813887)return tt;if(e<0)return(1099511627776+e).toString(16);let r=parseInt(e,10).toString(16);return typeof t>"u"?r:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=r.length?Na("0",t-r.length)+r:tt)}function tve(e,t){if(e=ve(e),e instanceof Error)return e;if(!/^-?[0-9]{1,9}$/.test(e)||e<-536870912||e>536870911)return tt;if(e<0)return(1073741824+e).toString(8);let r=parseInt(e,10).toString(8);return typeof t>"u"?r:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=r.length?Na("0",t-r.length)+r:tt)}function rve(e,t){return t=t===void 0?0:t,e=ve(e),t=ve(t),ft(e,t)?qe:e===t?1:0}function NC(e,t){return t=t===void 0?0:t,e=ve(e),t=ve(t),ft(e,t)?qe:Mt.default.erf(e)}NC.PRECISE=()=>{throw new Error("ERF.PRECISE is not implemented")};function EC(e){return isNaN(e)?qe:Mt.default.erfc(e)}EC.PRECISE=()=>{throw new Error("ERFC.PRECISE is not implemented")};function nve(e,t){return t=t||0,e=ve(e),ft(t,e)?e:e>=t?1:0}function ive(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return tt;let r=e.length===10&&e.substring(0,1).toLowerCase()==="f",n=r?parseInt(e,16)-1099511627776:parseInt(e,16);if(n<-512||n>511)return tt;if(r)return"1"+Na("0",9-(512+n).toString(2).length)+(512+n).toString(2);let i=n.toString(2);return t===void 0?i:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=i.length?Na("0",t-i.length)+i:tt)}function ove(e){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return tt;let t=parseInt(e,16);return t>=549755813888?t-1099511627776:t}function ave(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return tt;let r=parseInt(e,16);if(r>536870911&&r<0xffe0000000)return tt;if(r>=0xffe0000000)return(r-0xffc0000000).toString(8);let n=r.toString(8);return t===void 0?n:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=n.length?Na("0",t-n.length)+n:tt)}function SC(e){let t=on(e),r=nn(e);return ft(t,r)?qe:Math.sqrt(Math.pow(t,2)+Math.pow(r,2))}function nn(e){if(e===void 0||e===!0||e===!1)return qe;if(e===0||e==="0")return 0;if(["i","j"].indexOf(e)>=0)return 1;e=e+"",e=e.replace("+i","+1i").replace("-i","-1i").replace("+j","+1j").replace("-j","-1j");let t=e.indexOf("+"),r=e.indexOf("-");t===0&&(t=e.indexOf("+",1)),r===0&&(r=e.indexOf("-",1));let n=e.substring(e.length-1,e.length),i=n==="i"||n==="j";return t>=0||r>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?tt:Number(e.substring(t+1,e.length-1)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?tt:-Number(e.substring(r+1,e.length-1)):tt:i?isNaN(e.substring(0,e.length-1))?tt:e.substring(0,e.length-1):isNaN(e)?tt:0}function AC(e){let t=on(e),r=nn(e);return ft(t,r)?qe:t===0&&r===0?yo:t===0&&r>0?Math.PI/2:t===0&&r<0?-Math.PI/2:r===0&&t>0?0:r===0&&t<0?-Math.PI:t>0?Math.atan(r/t):t<0&&r>=0?Math.atan(r/t)+Math.PI:Math.atan(r/t)-Math.PI}function sve(e){let t=on(e),r=nn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",r!==0?xo(t,-r,n):e}function wb(e){let t=on(e),r=nn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",xo(Math.cos(t)*(Math.exp(r)+Math.exp(-r))/2,-Math.sin(t)*(Math.exp(r)-Math.exp(-r))/2,n)}function b$(e){let t=on(e),r=nn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",xo(Math.cos(r)*(Math.exp(t)+Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)-Math.exp(-t))/2,n)}function uve(e){let t=on(e),r=nn(e);return ft(t,r)?qe:Tp(wb(e),bb(e))}function Tp(e,t){let r=on(e),n=nn(e),i=on(t),o=nn(t);if(ft(r,n,i,o))return qe;let u=e.substring(e.length-1),l=t.substring(t.length-1),a="i";if((u==="j"||l==="j")&&(a="j"),i===0&&o===0)return tt;let s=i*i+o*o;return xo((r*i+n*o)/s,(n*i-r*o)/s,a)}function lve(e){let t=on(e),r=nn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);n=n==="i"||n==="j"?n:"i";let i=Math.exp(t);return xo(i*Math.cos(r),i*Math.sin(r),n)}function fve(e){let t=on(e),r=nn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",xo(Math.log(Math.sqrt(t*t+r*r)),Math.atan(r/t),n)}function cve(e){let t=on(e),r=nn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",xo(Math.log(Math.sqrt(t*t+r*r))/Math.log(10),Math.atan(r/t)/Math.log(10),n)}function pve(e){let t=on(e),r=nn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",xo(Math.log(Math.sqrt(t*t+r*r))/Math.log(2),Math.atan(r/t)/Math.log(2),n)}function mve(e,t){t=ve(t);let r=on(e),n=nn(e);if(ft(t,r,n))return qe;let i=e.substring(e.length-1);i=i==="i"||i==="j"?i:"i";let o=Math.pow(SC(e),t),u=AC(e);return xo(o*Math.cos(t*u),o*Math.sin(t*u),i)}function hve(){let e=arguments[0];if(!arguments.length)return qe;for(let t=1;t=0)return 0;e=e+"";let t=e.indexOf("+"),r=e.indexOf("-");t===0&&(t=e.indexOf("+",1)),r===0&&(r=e.indexOf("-",1));let n=e.substring(e.length-1,e.length),i=n==="i"||n==="j";return t>=0||r>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?tt:Number(e.substring(0,t)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?tt:Number(e.substring(0,r)):tt:i?isNaN(e.substring(0,e.length-1))?tt:0:isNaN(e)?tt:e}function dve(e){if(e===!0||e===!1)return qe;let t=on(e),r=nn(e);return ft(t,r)?qe:Tp("1",wb(e))}function gve(e){let t=on(e),r=nn(e);return ft(t,r)?qe:Tp("1",b$(e))}function bb(e){let t=on(e),r=nn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",xo(Math.sin(t)*(Math.exp(r)+Math.exp(-r))/2,Math.cos(t)*(Math.exp(r)-Math.exp(-r))/2,n)}function D$(e){let t=on(e),r=nn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",xo(Math.cos(r)*(Math.exp(t)-Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)+Math.exp(-t))/2,n)}function vve(e){let t=on(e),r=nn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);n=n==="i"||n==="j"?n:"i";let i=Math.sqrt(SC(e)),o=AC(e);return xo(i*Math.cos(o/2),i*Math.sin(o/2),n)}function yve(e){if(e===!0||e===!1)return qe;let t=on(e),r=nn(e);return ft(t,r)?tt:Tp("1",bb(e))}function xve(e){if(e===!0||e===!1)return qe;let t=on(e),r=nn(e);return ft(t,r)?tt:Tp("1",D$(e))}function wve(e,t){let r=on(e),n=nn(e),i=on(t),o=nn(t);if(ft(r,n,i,o))return qe;let u=e.substring(e.length-1),l=t.substring(t.length-1),a="i";return(u==="j"||l==="j")&&(a="j"),xo(r-i,n-o,a)}function bve(){if(!arguments.length)return qe;let e=gt(arguments),t=e[0];for(let r=1;r511)return tt;if(r)return"1"+Na("0",9-(512+n).toString(2).length)+(512+n).toString(2);let i=n.toString(2);return typeof t>"u"?i:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=i.length?Na("0",t-i.length)+i:tt)}function Eve(e){if(!/^[0-7]{1,10}$/.test(e))return tt;let t=parseInt(e,8);return t>=536870912?t-1073741824:t}function Sve(e,t){if(!/^[0-7]{1,10}$/.test(e))return tt;let r=parseInt(e,8);if(r>=536870912)return"ff"+(r+3221225472).toString(16);let n=r.toString(16);return t===void 0?n:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=n.length?Na("0",t-n.length)+n:tt)}var Ave=Rv.DIST,Cve=Rv.INV,Mve=qh.DIST,Tve=Sl.MATH,Ove=Sl.PRECISE,Ive=qs.DIST,Fve=qs.DIST.RT,_ve=qs.INV,kve=qs.INV.RT,Bve=qs.TEST,Lve=zh.P,Pve=zh.P,Rve=zh.S,qve=qh.INV,zve=EC.PRECISE,Uve=NC.PRECISE,Hve=pC.DIST,$ve=zs.DIST,Wve=zs.DIST.RT,Vve=zs.INV,Gve=zs.INV.RT,Yve=Ap.MATH,Zve=Ap.PRECISE,Xve=zs.TEST,Kve=qv.DIST,Jve=qv.INV,Qve=mC.PRECISE,jve=hC.DIST,e0e=Uh.INV,t0e=Uh.DIST,r0e=Uh.INV,n0e=Ep.MULT,i0e=Ep.SNGL,o0e=gC.DIST,a0e=yb.INTL,s0e=Us.DIST,u0e=Us.INV,l0e=Us.S.DIST,f0e=Us.S.INV,c0e=ba.EXC,p0e=ba.INC,m0e=zv.EXC,h0e=zv.INC,d0e=vC.DIST,g0e=Sp.EXC,v0e=Sp.INC,y0e=Uv.AVG,x0e=Uv.EQ,w0e=yC.P,b0e=Ko.P,D0e=Ko.S,N0e=Da.DIST,E0e=Da.DIST.RT,S0e=Da.INV,A0e=Da.TEST,C0e=_o.P,M0e=_o.S,T0e=xC.DIST,O0e=xb.INTL,I0e=wC.TEST;function CC(e){let t=[];return vo(e,r=>{r&&t.push(r)}),t}function Ja(e,t){let r={};for(let o=1;on&&(n=t[o].length);for(let o=1;o{o+=i[u]}),n.length===0?yo:o/n.length}function _0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),Bv(o)}function k0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),Lv(o)}function B0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let o=Ka(e,t);i=wn(e[o])}else i=wn(e[t]);return n.length===0?qe:n.length>1?tt:i[n[0]]}function L0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=i[n[0]];return vo(n,u=>{o{o>i[u]&&(o=i[u])}),o}function R0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let l=Ka(e,t);i=wn(e[l])}else i=wn(e[t]);let o=[];vo(n,l=>{o.push(i[l])}),o=CC(o);let u=1;return vo(o,l=>{u*=l}),u}function q0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),o=CC(o),Ko.S(o)}function z0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),o=CC(o),Ko.P(o)}function U0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),Al(o)}function H0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),_o.S(o)}function $0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),_o.P(o)}function tC(e){return e&&e.getTime&&!isNaN(e.getTime())}function rC(e){return e instanceof Date?e:new Date(e)}function W0e(e,t,r){let n=br(t);for(n.setFullYear(e.getFullYear()),ne;)n.setMonth(n.getMonth()+-12/r);return n}function N$(e){return e=ve(e),[1,2,4].indexOf(e)===-1?tt:e}function E$(e){return e=ve(e),[0,1,2,3,4].indexOf(e)===-1?tt:e}function V0e(e,t,r,n,i,o,u){return e=rC(e),t=rC(t),r=rC(r),o=N$(o),u=E$(u),yr(o,u)?tt:!tC(e)||!tC(t)||!tC(r)?qe:n<=0||i<=0||r<=e?tt:(i=i||0,u=u||0,i*n*bC(e,r,u))}function G0e(){throw new Error("ACCRINTM is not implemented")}function Y0e(){throw new Error("AMORDEGRC is not implemented")}function Z0e(){throw new Error("AMORLINC is not implemented")}function X0e(){throw new Error("COUPDAYBS is not implemented")}function K0e(e,t,r,n){if(n=E$(n),r=N$(r),e=br(e),t=br(t),yr(e,t))return qe;if(yr(r,n)||e>=t)return tt;if(n===1){let o=W0e(e,t,r),u=br(o);return u.setMonth(u.getMonth()+12/r),Pf(o,u,"D")}let i;switch(n){case 0:case 2:case 4:i=360;break;case 3:i=365;break;default:return tt}return i/r}function J0e(){throw new Error("COUPDAYSNC is not implemented")}function Q0e(){throw new Error("COUPNCD is not implemented")}function j0e(){throw new Error("COUPNUM is not implemented")}function e1e(){throw new Error("COUPPCD is not implemented")}function t1e(e,t,r,n,i,o){if(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r))return qe;if(e<=0||t<=0||r<=0||n<1||i<1||n>i||o!==0&&o!==1)return tt;let u=Hv(e,t,r,0,o),l=0;n===1&&(o===0&&(l=-r),n++);for(let a=n;a<=i;a++)l+=o===1?Cp(e,a-2,u,r,1)-u:Cp(e,a-1,u,r,0);return l*=e,l}function r1e(e,t,r,n,i,o){if(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r))return qe;if(e<=0||t<=0||r<=0||n<1||i<1||n>i||o!==0&&o!==1)return tt;let u=Hv(e,t,r,0,o),l=0;n===1&&(l=o===0?u+r*e:u,n++);for(let a=n;a<=i;a++)l+=o>0?u-(Cp(e,a-2,u,r,1)-u)*e:u-Cp(e,a-1,u,r,0)*e;return l}function n1e(e,t,r,n,i){if(i=i===void 0?12:i,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),ft(e,t,r,n,i))return qe;if(e<0||t<0||r<0||n<0||[1,2,3,4,5,6,7,8,9,10,11,12].indexOf(i)===-1||n>r)return tt;if(t>=e)return 0;let o=(1-Math.pow(t/e,1/r)).toFixed(3),u=e*o*i/12,l=u,a=0,s=n===r?r-1:n;for(let f=2;f<=s;f++)a=(e-l)*o,l+=a;return n===1?u:n===r?(e-l)*o:a}function i1e(e,t,r,n,i){if(i=i===void 0?2:i,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),ft(e,t,r,n,i))return qe;if(e<0||t<0||r<0||n<0||i<=0||n>r)return tt;if(t>=e)return 0;let o=0,u=0;for(let l=1;l<=n;l++)u=Math.min((e-o)*(i/r),e-t-o),o+=u;return u}function o1e(e,t,r,n,i){if(e=br(e),t=br(t),r=ve(r),n=ve(n),i=ve(i),i=i||0,ft(e,t,r,n,i))return qe;if(r<=0||n<=0)return tt;if(e>=t)return qe;let o,u;switch(i){case 0:o=360,u=Rf(e,t,!1);break;case 1:o=365,u=Pf(e,t,"D");break;case 2:o=360,u=Pf(e,t,"D");break;case 3:o=365,u=Pf(e,t,"D");break;case 4:o=360,u=Rf(e,t,!0);break;default:return tt}return(n-r)/n*o/u}function a1e(e,t){if(e=ve(e),t=ve(t),ft(e,t))return qe;if(t<0)return tt;if(t>=0&&t<1)return yo;t=parseInt(t,10);let r=parseInt(e,10);r+=e%1*Math.pow(10,Math.ceil(Math.log(t)/Math.LN10))/t;let n=Math.pow(10,Math.ceil(Math.log(t)/Math.LN2)+1);return r=Math.round(r*n)/n,r}function s1e(e,t){if(e=ve(e),t=ve(t),ft(e,t))return qe;if(t<0)return tt;if(t>=0&&t<1)return yo;t=parseInt(t,10);let r=parseInt(e,10);return r+=e%1*Math.pow(10,-Math.ceil(Math.log(t)/Math.LN10))*t,r}function u1e(){throw new Error("DURATION is not implemented")}function l1e(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<=0||t<1?tt:(t=parseInt(t,10),Math.pow(1+e/t,t)-1)}function Cp(e,t,r,n,i){if(n=n||0,i=i||0,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),ft(e,t,r,n,i))return qe;let o;if(e===0)o=n+r*t;else{let u=Math.pow(1+e,t);o=i===1?n*u+r*(1+e)*(u-1)/e:n*u+r*(u-1)/e}return-o}function f1e(e,t){if(e=ve(e),t=Ft(gt(t)),ft(e,t))return qe;let r=t.length,n=e;for(let i=0;i{let A=w+1,E=x[0];for(let O=1;O{let A=w+1,E=0;for(let O=1;O0&&(o=!0),e[x]<0&&(u=!0);if(!o||!u)return tt;t=t===void 0?.1:t;let l=t,a=1e-10,s,f,p,h=!0;do p=r(e,i,l),s=l-p/n(e,i,l),f=Math.abs(s-l),l=s,h=f>a&&Math.abs(p)>a;while(h);return l}function m1e(e,t,r,n){return e=ve(e),t=ve(t),r=ve(r),n=ve(n),ft(e,t,r,n)?qe:n*e*(t/r-1)}function h1e(){throw new Error("MDURATION is not implemented")}function d1e(e,t,r){if(e=Ft(gt(e)),t=ve(t),r=ve(r),ft(e,t,r))return qe;let n=e.length,i=[],o=[];for(let a=0;a=t)return qe;let o,u;switch(i){case 0:o=360,u=Rf(e,t,!1);break;case 1:o=365,u=Pf(e,t,"D");break;case 2:o=360,u=Pf(e,t,"D");break;case 3:o=365,u=Pf(e,t,"D");break;case 4:o=360,u=Rf(e,t,!0);break;default:return tt}return n-r*n*u/o}function A1e(){throw new Error("PRICEMAT is not implemented")}function C1e(e,t,r,n,i){return n=n||0,i=i||0,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),ft(e,t,r,n,i)?qe:e===0?-r*t-n:((1-Math.pow(1+e,t))/e*r*(1+e*i)-n)/Math.pow(1+e,t)}function M1e(e,t,r,n,i,o){if(o=o===void 0?.01:o,n=n===void 0?0:n,i=i===void 0?0:i,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),o=ve(o),ft(e,t,r,n,i,o))return qe;let u=1e-10,l=20,a=o;i=i?1:0;for(let s=0;sr?tt:(n=parseInt(n,10),(e-t)*(r-n+1)*2/(r*(r+1)))}function _1e(e,t,r){return e=br(e),t=br(t),r=ve(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?tt:365*r/(360-r*Rf(e,t,!1))}function k1e(e,t,r){return e=br(e),t=br(t),r=ve(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?tt:100*(1-r*Rf(e,t,!1)/360)}function B1e(e,t,r){return e=br(e),t=br(t),r=ve(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?tt:(100-r)*360/(r*Rf(e,t,!1))}function L1e(){throw new Error("VDB is not implemented")}function P1e(e,t,r){if(e=Ft(gt(e)),t=e$(gt(t)),r=ve(r),ft(e,t,r))return qe;let n=(x,b,w)=>{let A=w+1,E=x[0];for(let O=1;O{let A=w+1,E=0;for(let O=1;O0&&(o=!0),e[x]<0&&(u=!0);if(!o||!u)return tt;r=r||.1;let l=r,a=1e-10,s,f,p,h=!0;do p=n(e,t,l),s=l-p/i(e,t,l),f=Math.abs(s-l),l=s,h=f>a&&Math.abs(p)>a;while(h);return l}function R1e(e,t,r){if(e=ve(e),t=Ft(gt(t)),r=e$(gt(r)),ft(e,t,r))return qe;let n=0;for(let i=0;i=2?t:!0,t==null&&(t=0),r=arguments.length===3?r:!1,r==null&&(r=0),e?t:r)}function V1e(){for(let e=0;e0){let t=arguments[0],r=arguments.length-1,n=Math.floor(r/2),i=!1,o=r%2!==0,u=r%2===0?null:arguments[arguments.length-1];if(n){for(let l=0;l{let l=Rt.getLineNumber(u),a=l+1,s="",f=u.text.trim().split("//")[0].split("#")[0];if(Rt.removeLineClass(u,"gutter","lineNoError"),Ge.settings.rulers?(Rt.removeLineClass(u,"wrap","noRuler"),Rt.addLineClass(u,"wrap","ruler")):(Rt.removeLineClass(u,"wrap","ruler"),Rt.addLineClass(u,"wrap","noRuler")),f)try{f=a>1&&f.charAt(0).match(/[+\-*/]/)&&Rt.getLine(a-2).length>0&&Ge.settings.contPrevLine?Ge.mathScope.ans+f:f,Uy()&&(f=f.replace(/[,;]/g,p=>p===","?".":",")),Ge.mathScope.avg=kr.evaluate(r.length>0?"("+kr.mean(r)+")":"0"),Ge.mathScope.total=kr.evaluate(n.length>0?"("+n.join("+")+")":"0"),Ge.mathScope.subtotal=kr.evaluate(i.length>0?"("+i.join("+")+")":"0");try{s=kr.evaluate(f,Ge.mathScope)}catch{s=eye(f)}if(s||s===0){Ge.mathScope._=s,Ge.mathScope.ans=s,Ge.mathScope["line"+a]=s,typeof s=="number"&&(r.push(s),n.push(s),i.push(s)),s=kr.format(s,{notation:Ge.settings.notation,lowerExp:+Ge.settings.expLower,upperExp:+Ge.settings.expUpper});let p=s;if(s=$v(s,!1),t=$v(p,!0),s.match(/\w\(x\)/)){let h=(/\w\(x\)$/.test(s)&&f!=="ans"?f:s).replace(/\s+/g,"");Ge.mathScope.ans=h,Ge.mathScope["line"+a]=h,s=`Plot`}}else i.length=0,s=""}catch(p){Ge.settings.lineErrors&&(Rt.addLineClass(l,"gutter","lineNoError"),s=`Error`)}else i.length=0;e+=`
    {var{typed:t,mathWithTransform:r,Help:n}=e;return t(V7,{any:function(o){var u,l=o;if(typeof o!="string"){for(u in r)if(Et(r,u)&&o===r[u]){l=u;break}}var a=fn(W7,l);if(!a){var s=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+s+'"')}return new n(a)}})});g();x();v();var Y7="chain",ice=["typed","Chain"],Z7=K(Y7,ice,e=>{var{typed:t,Chain:r}=e;return t(Y7,{"":function(){return new r},any:function(i){return new r(i)}})});g();x();v();var X7="det",oce=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],K7=K(X7,oce,e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:o,isZero:u,unaryMinus:l}=e;return t(X7,{any:function(f){return Lt(f)},"Array | Matrix":function(f){var p;switch(St(f)?p=f.size():Array.isArray(f)?(f=r(f),p=f.size()):p=[],p.length){case 0:return Lt(f);case 1:if(p[0]===1)return Lt(f.valueOf()[0]);if(p[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Kt(p)+")");case 2:{var h=p[0],y=p[1];if(h===y)return a(f.clone().valueOf(),h,y);if(y===0)return 1;throw new RangeError("Matrix must be square (size: "+Kt(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Kt(p)+")")}}});function a(s,f,p){if(f===1)return Lt(s[0][0]);if(f===2)return n(i(s[0][0],s[1][1]),i(s[1][0],s[0][1]));for(var h=!1,y=new Array(f).fill(0).map((P,R)=>R),b=0;b{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:o,unaryMinus:u,det:l,identity:a,abs:s}=e;return t(J7,{"Array | Matrix":function(h){var y=St(h)?h.size():Wt(h);switch(y.length){case 1:if(y[0]===1)return St(h)?r([n(1,h.valueOf()[0])]):[n(1,h[0])];throw new RangeError("Matrix must be square (size: "+Kt(y)+")");case 2:{var b=y[0],w=y[1];if(b===w)return St(h)?r(f(h.valueOf(),b,w),h.storage()):f(h,b,w);throw new RangeError("Matrix must be square (size: "+Kt(y)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Kt(y)+")")}},any:function(h){return n(1,h)}});function f(p,h,y){var b,w,A,S,O;if(h===1){if(S=p[0][0],S===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,S)]]}else if(h===2){var M=l(p);if(M===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(p[1][1],M),n(u(p[0][1]),M)],[n(u(p[1][0]),M),n(p[0][0],M)]]}else{var I=p.concat();for(b=0;bP&&(P=s(I[b][C]),R=b),b++;if(P===0)throw Error("Cannot calculate inverse, determinant is zero");b=R,b!==C&&(O=I[C],I[C]=I[b],I[b]=O,O=F[C],F[C]=F[b],F[b]=O);var q=I[C],U=F[C];for(b=0;b{var{typed:t,matrix:r,inv:n,deepEqual:i,equal:o,dotDivide:u,dot:l,ctranspose:a,divideScalar:s,multiply:f,add:p,Complex:h}=e;return t(j7,{"Array | Matrix":function(M){var I=St(M)?M.size():Wt(M);switch(I.length){case 1:return S(M)?a(M):I[0]===1?n(M):u(a(M),l(M,M));case 2:{if(S(M))return a(M);var F=I[0],C=I[1];if(F===C)try{return n(M)}catch(P){if(!(P instanceof Error&&P.message.match(/Cannot calculate inverse, determinant is zero/)))throw P}return St(M)?r(y(M.valueOf(),F,C),M.storage()):y(M,F,C)}default:throw new RangeError("Matrix must be two dimensional (size: "+Kt(I)+")")}},any:function(M){return o(M,0)?Lt(M):s(1,M)}});function y(O,M,I){var{C:F,F:C}=w(O,M,I),P=f(n(f(a(F),F)),a(F)),R=f(a(C),n(f(C,a(C))));return f(R,P)}function b(O,M,I){for(var F=Lt(O),C=0,P=0;PR.filter((U,H)=>H!A(l(F[q],F[q])));return{C,F:P}}function A(O){return o(p(O,h(1,1)),p(0,h(1,1)))}function S(O){return i(p(O,h(1,1)),p(f(O,0),h(1,1)))}});g();x();v();g();x();v();function tq(e){var{addScalar:t,subtract:r,flatten:n,multiply:i,multiplyScalar:o,divideScalar:u,sqrt:l,abs:a,bignumber:s,diag:f,size:p,reshape:h,inv:y,qr:b,usolve:w,usolveAll:A,equal:S,complex:O,larger:M,smaller:I,matrixFromColumns:F,dot:C}=e;function P(we,ce,Se,Pe){var Ce=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,Oe=R(we,ce,Se,Pe,Ce);q(we,ce,Se,Pe,Ce,Oe);var{values:He,C:Ee}=U(we,ce,Se,Pe,Ce);if(Ce){var ze=H(we,ce,Ee,Oe,He,Se,Pe);return{values:He,eigenvectors:ze}}return{values:He}}function R(we,ce,Se,Pe,Ce){var Oe=Pe==="BigNumber",He=Pe==="Complex",Ee=Oe?s(0):0,ze=Oe?s(1):He?O(1):1,We=Oe?s(1):1,Le=Oe?s(10):2,lt=o(Le,Le),ct;Ce&&(ct=Array(ce).fill(ze));for(var de=!1;!de;){de=!0;for(var be=0;be1&&(de=f(Array(Le-1).fill(Ee)))),Le-=1,ze.pop();for(var ot=0;ot2&&(de=f(Array(Le-2).fill(Ee)))),Le-=2,ze.pop(),ze.pop();for(var ut=0;ut+r(a(J),a(j))),be>100){var Pt=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+We.join(", "));throw Pt.values=We,Pt.vectors=[],Pt}var fe=Ce?i(ct,ie(lt,ce)):void 0;return{values:We,C:fe}}function H(we,ce,Se,Pe,Ce,Oe,He){var Ee=y(Se),ze=i(Ee,we,Se),We=He==="BigNumber",Le=He==="Complex",lt=We?s(0):Le?O(0):0,ct=We?s(1):Le?O(1):1,de=[],be=[];for(var Ue of Ce){var ge=Y(de,Ue,S);ge===-1?(de.push(Ue),be.push(1)):be[ge]+=1}for(var Re=[],Be=de.length,Ke=Array(ce).fill(lt),ot=f(Array(ce).fill(ct)),Qe=function(){var fe=de[ut],J=r(ze,i(fe,ot)),j=A(J,Ke);for(j.shift();j.lengthi(me,ye)),Re.push(...j.map(ye=>({value:fe,vector:n(ye)})))},ut=0;ut=5)return null;for(Ee=0;;){var ze=w(we,He);if(I(he(re(He,[ze])),Pe))break;if(++Ee>=10)return null;He=De(ze)}return He}function le(we,ce,Se){var Pe=Se==="BigNumber",Ce=Se==="Complex",Oe=Array(we).fill(0).map(He=>2*Math.random()-1);return Pe&&(Oe=Oe.map(He=>s(He))),Ce&&(Oe=Oe.map(He=>O(He))),Oe=re(Oe,ce),De(Oe,Se)}function re(we,ce){var Se=p(we);for(var Pe of ce)Pe=h(Pe,Se),we=r(we,i(u(C(Pe,we),C(Pe,Pe)),Pe));return we}function he(we){return a(l(C(we,we)))}function De(we,ce){var Se=ce==="BigNumber",Pe=ce==="Complex",Ce=Se?s(1):Pe?O(1):1;return i(u(Ce,he(we)),we)}return P}g();x();v();function rq(e){var{config:t,addScalar:r,subtract:n,abs:i,atan:o,cos:u,sin:l,multiplyScalar:a,inv:s,bignumber:f,multiply:p,add:h}=e;function y(q,U){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.relTol,V=arguments.length>3?arguments[3]:void 0,W=arguments.length>4?arguments[4]:void 0;if(V==="number")return b(q,H,W);if(V==="BigNumber")return w(q,H,W);throw TypeError("Unsupported data type: "+V)}function b(q,U,H){var V=q.length,W=Math.abs(U/V),ee,ie;if(H){ie=new Array(V);for(var Y=0;Y=Math.abs(W);){var le=Z[0][0],re=Z[0][1];ee=A(q[le][le],q[re][re],q[le][re]),q=F(q,ee,le,re),H&&(ie=O(ie,ee,le,re)),Z=C(q)}for(var he=Array(V).fill(0),De=0;De=i(W);){var le=Z[0][0],re=Z[0][1];ee=S(q[le][le],q[re][re],q[le][re]),q=I(q,ee,le,re),H&&(ie=M(ie,ee,le,re)),Z=P(q)}for(var he=Array(V).fill(0),De=0;De({value:W[ce],vector:we}));return{values:W,eigenvectors:De}}return y}var uce="eigs",lce=["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"],nq=K(uce,lce,e=>{var{config:t,typed:r,matrix:n,addScalar:i,subtract:o,equal:u,abs:l,atan:a,cos:s,sin:f,multiplyScalar:p,divideScalar:h,inv:y,bignumber:b,multiply:w,add:A,larger:S,column:O,flatten:M,number:I,complex:F,sqrt:C,diag:P,size:R,reshape:q,qr:U,usolve:H,usolveAll:V,im:W,re:ee,smaller:ie,matrixFromColumns:Y,dot:Z}=e,le=rq({config:t,addScalar:i,subtract:o,column:O,flatten:M,equal:u,abs:l,atan:a,cos:s,sin:f,multiplyScalar:p,inv:y,bignumber:b,complex:F,multiply:w,add:A}),re=tq({config:t,addScalar:i,subtract:o,multiply:w,multiplyScalar:p,flatten:M,divideScalar:h,sqrt:C,abs:l,bignumber:b,diag:P,size:R,reshape:q,qr:U,inv:y,usolve:H,usolveAll:V,equal:u,complex:F,larger:S,smaller:ie,matrixFromColumns:Y,dot:Z});return r("eigs",{Array:function(Oe){return he(n(Oe))},"Array, number|BigNumber":function(Oe,He){return he(n(Oe),{precision:He})},"Array, Object"(Ce,Oe){return he(n(Ce),Oe)},Matrix:function(Oe){return he(Oe,{matricize:!0})},"Matrix, number|BigNumber":function(Oe,He){return he(Oe,{precision:He,matricize:!0})},"Matrix, Object":function(Oe,He){var Ee={matricize:!0};return Jn(Ee,He),he(Oe,Ee)}});function he(Ce){var Oe,He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ee="eigenvectors"in He?He.eigenvectors:!0,ze=(Oe=He.precision)!==null&&Oe!==void 0?Oe:t.relTol,We=De(Ce,ze,Ee);return He.matricize&&(We.values=n(We.values),Ee&&(We.eigenvectors=We.eigenvectors.map(Le=>{var{value:lt,vector:ct}=Le;return{value:lt,vector:n(ct)}}))),Ee&&Object.defineProperty(We,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),We}function De(Ce,Oe,He){var Ee=Ce.toArray(),ze=Ce.size();if(ze.length!==2||ze[0]!==ze[1])throw new RangeError("Matrix must be square (size: ".concat(Kt(ze),")"));var We=ze[0];if(ce(Ee,We,Oe)&&(Se(Ee,We),we(Ee,We,Oe))){var Le=Pe(Ce,Ee,We);return le(Ee,We,Oe,Le,He)}var lt=Pe(Ce,Ee,We);return re(Ee,We,Oe,lt,He)}function we(Ce,Oe,He){for(var Ee=0;Ee{var{typed:t,abs:r,add:n,identity:i,inv:o,multiply:u}=e;return t(iq,{Matrix:function(p){var h=p.size();if(h.length!==2||h[0]!==h[1])throw new RangeError("Matrix must be square (size: "+Kt(h)+")");for(var y=h[0],b=1e-15,w=l(p),A=a(w,b),S=A.q,O=A.j,M=u(p,Math.pow(2,-O)),I=i(y),F=i(y),C=1,P=M,R=-1,q=1;q<=S;q++)q>1&&(P=u(P,M),R=-R),C=C*(S-q+1)/((2*S-q+1)*q),I=n(I,u(C,P)),F=n(F,u(C*R,P));for(var U=u(o(F),I),H=0;H{var{typed:t,abs:r,add:n,multiply:i,map:o,sqrt:u,subtract:l,inv:a,size:s,max:f,identity:p}=e,h=1e3,y=1e-6;function b(w){var A,S=0,O=w,M=p(s(w));do{var I=O;if(O=i(.5,n(I,a(M))),M=i(.5,n(M,a(I))),A=f(r(l(O,I))),A>y&&++S>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(A>y);return O}return t(aq,{"Array | Matrix":function(A){var S=St(A)?A.size():Wt(A);switch(S.length){case 1:if(S[0]===1)return o(A,u);throw new RangeError("Matrix must be square (size: "+Kt(S)+")");case 2:{var O=S[0],M=S[1];if(O===M)return b(A);throw new RangeError("Matrix must be square (size: "+Kt(S)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Kt(S)+")")}}})});g();x();v();var uq="sylvester",pce=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],lq=K(uq,pce,e=>{var{typed:t,schur:r,matrixFromColumns:n,matrix:i,multiply:o,range:u,concat:l,transpose:a,index:s,subset:f,add:p,subtract:h,identity:y,lusolve:b,abs:w}=e;return t(uq,{"Matrix, Matrix, Matrix":A,"Array, Matrix, Matrix":function(O,M,I){return A(i(O),M,I)},"Array, Array, Matrix":function(O,M,I){return A(i(O),i(M),I)},"Array, Matrix, Array":function(O,M,I){return A(i(O),M,i(I))},"Matrix, Array, Matrix":function(O,M,I){return A(O,i(M),I)},"Matrix, Array, Array":function(O,M,I){return A(O,i(M),i(I))},"Matrix, Matrix, Array":function(O,M,I){return A(O,M,i(I))},"Array, Array, Array":function(O,M,I){return A(i(O),i(M),i(I)).toArray()}});function A(S,O,M){for(var I=O.size()[0],F=S.size()[0],C=r(S),P=C.T,R=C.U,q=r(o(-1,O)),U=q.T,H=q.U,V=o(o(a(R),M),H),W=u(0,F),ee=[],ie=(Le,lt)=>l(Le,lt,1),Y=(Le,lt)=>l(Le,lt,0),Z=0;Z1e-5){for(var le=Y(f(V,s(W,Z)),f(V,s(W,Z+1))),re=0;re{var{typed:t,matrix:r,identity:n,multiply:i,qr:o,norm:u,subtract:l}=e;return t(fq,{Array:function(f){var p=a(r(f));return{U:p.U.valueOf(),T:p.T.valueOf()}},Matrix:function(f){return a(f)}});function a(s){var f=s.size()[0],p=s,h=n(f),y=0,b;do{b=p;var w=o(p),A=w.Q,S=w.R;if(p=i(S,A),h=i(h,A),y++>100)break}while(u(l(p,b))>1e-4);return{U:h,T:p}}});g();x();v();var pq="lyap",hce=["typed","matrix","sylvester","multiply","transpose"],mq=K(pq,hce,e=>{var{typed:t,matrix:r,sylvester:n,multiply:i,transpose:o}=e;return t(pq,{"Matrix, Matrix":function(l,a){return n(l,o(l),i(-1,a))},"Array, Matrix":function(l,a){return n(r(l),o(r(l)),i(-1,a))},"Matrix, Array":function(l,a){return n(l,o(r(l)),r(i(-1,a)))},"Array, Array":function(l,a){return n(r(l),o(r(l)),r(i(-1,a))).toArray()}})});g();x();v();var dce="divide",gce=["typed","matrix","multiply","equalScalar","divideScalar","inv"],hq=K(dce,gce,e=>{var{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:o,inv:u}=e,l=Pr({typed:t,equalScalar:i}),a=Qn({typed:t});return t("divide",by({"Array | Matrix, Array | Matrix":function(f,p){return n(f,u(p))},"DenseMatrix, any":function(f,p){return a(f,p,o,!1)},"SparseMatrix, any":function(f,p){return l(f,p,o,!1)},"Array, any":function(f,p){return a(r(f),p,o,!1).valueOf()},"any, Array | Matrix":function(f,p){return n(f,u(p))}},o.signatures))});g();x();v();var dq="distance",vce=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],gq=K(dq,vce,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,deepEqual:u,sqrt:l,abs:a}=e;return t(dq,{"Array, Array, Array":function(F,C,P){if(F.length===2&&C.length===2&&P.length===2){if(!f(F))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!f(P))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(u(C,P))throw new TypeError("LinePoint1 should not be same with LinePoint2");var R=n(P[1],C[1]),q=n(C[0],P[0]),U=n(i(P[0],C[1]),i(C[0],P[1]));return A(F[0],F[1],R,q,U)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(F,C,P){if(Object.keys(F).length===2&&Object.keys(C).length===2&&Object.keys(P).length===2){if(!f(F))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(C))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!f(P))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(u(b(C),b(P)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in F&&"pointY"in F&&"lineOnePtX"in C&&"lineOnePtY"in C&&"lineTwoPtX"in P&&"lineTwoPtY"in P){var R=n(P.lineTwoPtY,C.lineOnePtY),q=n(C.lineOnePtX,P.lineTwoPtX),U=n(i(P.lineTwoPtX,C.lineOnePtY),i(C.lineOnePtX,P.lineTwoPtY));return A(F.pointX,F.pointY,R,q,U)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(F,C){if(F.length===2&&C.length===3){if(!f(F))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return A(F[0],F[1],C[0],C[1],C[2])}else if(F.length===3&&C.length===6){if(!p(F))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!y(C))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return S(F[0],F[1],F[2],C[0],C[1],C[2],C[3],C[4],C[5])}else if(F.length===C.length&&F.length>0){if(!h(F))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!h(C))throw new TypeError("All values of an array should be numbers or BigNumbers");return O(F,C)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(F,C){if(Object.keys(F).length===2&&Object.keys(C).length===3){if(!f(F))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(C))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in F&&"pointY"in F&&"xCoeffLine"in C&&"yCoeffLine"in C&&"constant"in C)return A(F.pointX,F.pointY,C.xCoeffLine,C.yCoeffLine,C.constant);throw new TypeError("Key names do not match")}else if(Object.keys(F).length===3&&Object.keys(C).length===6){if(!p(F))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!y(C))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in F&&"pointY"in F&&"x0"in C&&"y0"in C&&"z0"in C&&"a"in C&&"b"in C&&"c"in C)return S(F.pointX,F.pointY,F.pointZ,C.x0,C.y0,C.z0,C.a,C.b,C.c);throw new TypeError("Key names do not match")}else if(Object.keys(F).length===2&&Object.keys(C).length===2){if(!f(F))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!f(C))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in F&&"pointOneY"in F&&"pointTwoX"in C&&"pointTwoY"in C)return O([F.pointOneX,F.pointOneY],[C.pointTwoX,C.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(F).length===3&&Object.keys(C).length===3){if(!p(F))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(C))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in F&&"pointOneY"in F&&"pointOneZ"in F&&"pointTwoX"in C&&"pointTwoY"in C&&"pointTwoZ"in C)return O([F.pointOneX,F.pointOneY,F.pointOneZ],[C.pointTwoX,C.pointTwoY,C.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(F){if(!w(F))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return M(F)}});function s(I){return typeof I=="number"||kt(I)}function f(I){return I.constructor!==Array&&(I=b(I)),s(I[0])&&s(I[1])}function p(I){return I.constructor!==Array&&(I=b(I)),s(I[0])&&s(I[1])&&s(I[2])}function h(I){return Array.isArray(I)||(I=b(I)),I.every(s)}function y(I){return I.constructor!==Array&&(I=b(I)),s(I[0])&&s(I[1])&&s(I[2])&&s(I[3])&&s(I[4])&&s(I[5])}function b(I){for(var F=Object.keys(I),C=[],P=0;PF.length!==2||!s(F[0])||!s(F[1])))return!1}else if(I[0].length===3&&s(I[0][0])&&s(I[0][1])&&s(I[0][2])){if(I.some(F=>F.length!==3||!s(F[0])||!s(F[1])||!s(F[2])))return!1}else return!1;return!0}function A(I,F,C,P,R){var q=a(r(r(i(C,I),i(P,F)),R)),U=l(r(i(C,C),i(P,P)));return o(q,U)}function S(I,F,C,P,R,q,U,H,V){var W=[n(i(n(R,F),V),i(n(q,C),H)),n(i(n(q,C),U),i(n(P,I),V)),n(i(n(P,I),H),i(n(R,F),U))];W=l(r(r(i(W[0],W[0]),i(W[1],W[1])),i(W[2],W[2])));var ee=l(r(r(i(U,U),i(H,H)),i(V,V)));return o(W,ee)}function O(I,F){for(var C=I.length,P=0,R=0,q=0;q{var{typed:t,config:r,abs:n,add:i,addScalar:o,matrix:u,multiply:l,multiplyScalar:a,divideScalar:s,subtract:f,smaller:p,equalScalar:h,flatten:y,isZero:b,isNumeric:w}=e;return t("intersect",{"Array, Array, Array":A,"Array, Array, Array, Array":S,"Matrix, Matrix, Matrix":function(H,V,W){var ee=A(H.valueOf(),V.valueOf(),W.valueOf());return ee===null?null:u(ee)},"Matrix, Matrix, Matrix, Matrix":function(H,V,W,ee){var ie=S(H.valueOf(),V.valueOf(),W.valueOf(),ee.valueOf());return ie===null?null:u(ie)}});function A(U,H,V){if(U=O(U),H=O(H),V=O(V),!I(U))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!I(H))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!F(V))throw new TypeError("Array with 4 numbers expected as third argument");return q(U[0],U[1],U[2],H[0],H[1],H[2],V[0],V[1],V[2],V[3])}function S(U,H,V,W){if(U=O(U),H=O(H),V=O(V),W=O(W),U.length===2){if(!M(U))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!M(H))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!M(V))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!M(W))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return C(U,H,V,W)}else if(U.length===3){if(!I(U))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!I(H))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!I(V))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!I(W))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return R(U[0],U[1],U[2],H[0],H[1],H[2],V[0],V[1],V[2],W[0],W[1],W[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function O(U){return U.length===1?U[0]:U.length>1&&Array.isArray(U[0])&&U.every(H=>Array.isArray(H)&&H.length===1)?y(U):U}function M(U){return U.length===2&&w(U[0])&&w(U[1])}function I(U){return U.length===3&&w(U[0])&&w(U[1])&&w(U[2])}function F(U){return U.length===4&&w(U[0])&&w(U[1])&&w(U[2])&&w(U[3])}function C(U,H,V,W){var ee=U,ie=V,Y=f(ee,H),Z=f(ie,W),le=f(a(Y[0],Z[1]),a(Z[0],Y[1]));if(b(le)||p(n(le),r.relTol))return null;var re=a(Z[0],ee[1]),he=a(Z[1],ee[0]),De=a(Z[0],ie[1]),we=a(Z[1],ie[0]),ce=s(o(f(f(re,he),De),we),le);return i(l(Y,ce),ee)}function P(U,H,V,W,ee,ie,Y,Z,le,re,he,De){var we=a(f(U,H),f(V,W)),ce=a(f(ee,ie),f(Y,Z)),Se=a(f(le,re),f(he,De));return o(o(we,ce),Se)}function R(U,H,V,W,ee,ie,Y,Z,le,re,he,De){var we=P(U,Y,re,Y,H,Z,he,Z,V,le,De,le),ce=P(re,Y,W,U,he,Z,ee,H,De,le,ie,V),Se=P(U,Y,W,U,H,Z,ee,H,V,le,ie,V),Pe=P(re,Y,re,Y,he,Z,he,Z,De,le,De,le),Ce=P(W,U,W,U,ee,H,ee,H,ie,V,ie,V),Oe=f(a(we,ce),a(Se,Pe)),He=f(a(Ce,Pe),a(ce,ce));if(b(He))return null;var Ee=s(Oe,He),ze=s(o(we,a(Ee,ce)),Pe),We=o(U,a(Ee,f(W,U))),Le=o(H,a(Ee,f(ee,H))),lt=o(V,a(Ee,f(ie,V))),ct=o(Y,a(ze,f(re,Y))),de=o(Z,a(ze,f(he,Z))),be=o(le,a(ze,f(De,le)));return h(We,ct)&&h(Le,de)&&h(lt,be)?[We,Le,lt]:null}function q(U,H,V,W,ee,ie,Y,Z,le,re){var he=a(U,Y),De=a(W,Y),we=a(H,Z),ce=a(ee,Z),Se=a(V,le),Pe=a(ie,le),Ce=f(f(f(re,he),we),Se),Oe=f(f(f(o(o(De,ce),Pe),he),we),Se),He=s(Ce,Oe),Ee=o(U,a(He,f(W,U))),ze=o(H,a(He,f(ee,H))),We=o(V,a(He,f(ie,V)));return[Ee,ze,We]}});g();x();v();var xq="sum",wce=["typed","config","add","numeric"],Yw=K(xq,wce,e=>{var{typed:t,config:r,add:n,numeric:i}=e;return t(xq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":u,"...":function(a){if(Va(a))throw new TypeError("Scalar values expected in function sum");return o(a)}});function o(l){var a;return mo(l,function(s){try{a=a===void 0?s:n(a,s)}catch(f){throw Tn(f,"sum",s)}}),a===void 0&&(a=i(0,r.number)),typeof a=="string"&&(a=i(a,co(a,r))),a}function u(l,a){try{var s=kf(l,a,n);return s}catch(f){throw Tn(f,"sum")}}});g();x();v();var Zw="cumsum",bce=["typed","add","unaryPlus"],Xw=K(Zw,bce,e=>{var{typed:t,add:r,unaryPlus:n}=e;return t(Zw,{Array:i,Matrix:function(s){return s.create(i(s.valueOf()))},"Array, number | BigNumber":u,"Matrix, number | BigNumber":function(s,f){return s.create(u(s.valueOf(),f))},"...":function(s){if(Va(s))throw new TypeError("All values expected to be scalar in function cumsum");return i(s)}});function i(a){try{return o(a)}catch(s){throw Tn(s,Zw)}}function o(a){if(a.length===0)return[];for(var s=[n(a[0])],f=1;f=f.length)throw new Mi(s,f.length);try{return l(a,s)}catch(p){throw Tn(p,Zw)}}function l(a,s){var f,p,h;if(s<=0){var y=a[0][0];if(Array.isArray(y)){for(h=$y(a),p=[],f=0;f{var{typed:t,add:r,divide:n}=e;return t(yq,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":i,"...":function(l){if(Va(l))throw new TypeError("Scalar values expected in function mean");return o(l)}});function i(u,l){try{var a=kf(u,l,r),s=Array.isArray(u)?Wt(u):u.size();return n(a,s[l])}catch(f){throw Tn(f,"mean")}}function o(u){var l,a=0;if(mo(u,function(s){try{l=l===void 0?s:r(l,s),a++}catch(f){throw Tn(f,"mean",s)}}),a===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,a)}});g();x();v();var wq="median",Nce=["typed","add","divide","compare","partitionSelect"],bq=K(wq,Nce,e=>{var{typed:t,add:r,divide:n,compare:i,partitionSelect:o}=e;function u(s){try{s=nr(s.valueOf());var f=s.length;if(f===0)throw new Error("Cannot calculate median of an empty array");if(f%2===0){for(var p=f/2-1,h=o(s,p+1),y=s[p],b=0;b0&&(y=s[b]);return a(y,h)}else{var w=o(s,(f-1)/2);return l(w)}}catch(A){throw Tn(A,"median")}}var l=t({"number | BigNumber | Complex | Unit":function(f){return f}}),a=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(f,p){return n(r(f,p),2)}});return t(wq,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(f,p){throw new Error("median(A, dim) is not yet supported")},"...":function(f){if(Va(f))throw new TypeError("Scalar values expected in function median");return u(f)}})});g();x();v();var Dq="mad",Sce=["typed","abs","map","median","subtract"],Nq=K(Dq,Sce,e=>{var{typed:t,abs:r,map:n,median:i,subtract:o}=e;return t(Dq,{"Array | Matrix":u,"...":function(a){return u(a)}});function u(l){if(l=nr(l.valueOf()),l.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var a=i(l);return i(n(l,function(s){return r(o(s,a))}))}catch(s){throw s instanceof TypeError&&s.message.includes("median")?new TypeError(s.message.replace("median","mad")):Tn(s,"mad")}}});g();x();v();var RA="unbiased",Sq="variance",Ece=["typed","add","subtract","multiply","divide","apply","isNaN"],Jw=K(Sq,Ece,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l}=e;return t(Sq,{"Array | Matrix":function(p){return a(p,RA)},"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":function(p,h){return s(p,h,RA)},"Array | Matrix, number | BigNumber, string":s,"...":function(p){return a(p,RA)}});function a(f,p){var h,y=0;if(f.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(mo(f,function(A){try{h=h===void 0?A:r(h,A),y++}catch(S){throw Tn(S,"variance",A)}}),y===0)throw new Error("Cannot calculate variance of an empty array");var b=o(h,y);if(h=void 0,mo(f,function(A){var S=n(A,b);h=h===void 0?i(S,S):r(h,i(S,S))}),l(h))return h;switch(p){case"uncorrected":return o(h,y);case"biased":return o(h,y+1);case"unbiased":{var w=kt(h)?h.mul(0):0;return y===1?w:o(h,y-1)}default:throw new Error('Unknown normalization "'+p+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function s(f,p,h){try{if(f.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return u(f,p,y=>a(y,h))}catch(y){throw Tn(y,"variance")}}});g();x();v();var Eq="quantileSeq",Ace=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Qw=K(Eq,Ace,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:u,partitionSelect:l,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h}=e,y=Dh({typed:t,isInteger:s});return t(Eq,{"Array | Matrix, number | BigNumber":(O,M)=>w(O,M,!1),"Array | Matrix, number | BigNumber, number":(O,M,I)=>b(O,M,!1,I,w),"Array | Matrix, number | BigNumber, boolean":w,"Array | Matrix, number | BigNumber, boolean, number":(O,M,I,F)=>b(O,M,I,F,w),"Array | Matrix, Array | Matrix":(O,M)=>A(O,M,!1),"Array | Matrix, Array | Matrix, number":(O,M,I)=>b(O,M,!1,I,A),"Array | Matrix, Array | Matrix, boolean":A,"Array | Matrix, Array | Matrix, boolean, number":(O,M,I,F)=>b(O,M,I,F,A)});function b(O,M,I,F,C){return y(O,F,P=>C(P,M,I))}function w(O,M,I){var F,C=O.valueOf();if(f(M,0))throw new Error("N/prob must be non-negative");if(p(M,1))return $t(M)?S(C,M,I):r(S(C,M,I));if(h(M,1)){if(!s(M))throw new Error("N must be a positive integer");if(h(M,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var P=n(M,1);F=[];for(var R=0;f(R,M);R++){var q=o(R+1,P);F.push(S(C,q,I))}return $t(M)?F:r(F)}}function A(O,M,I){for(var F=O.valueOf(),C=M.valueOf(),P=[],R=0;R0&&(U=F[V])}return n(u(U,i(1,q)),u(H,q))}});g();x();v();var Aq="std",Cce=["typed","map","sqrt","variance"],jw=K(Aq,Cce,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e;return t(Aq,{"Array | Matrix":o,"Array | Matrix, string":o,"Array | Matrix, number | BigNumber":o,"Array | Matrix, number | BigNumber, string":o,"...":function(l){return o(l)}});function o(u,l){if(u.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var a=i.apply(null,arguments);return xn(a)?r(a,n):n(a)}catch(s){throw s instanceof TypeError&&s.message.includes(" variance")?new TypeError(s.message.replace(" variance"," std")):s}}});g();x();v();var Cq="corr",Mce=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],Mq=K(Cq,Mce,e=>{var{typed:t,matrix:r,sqrt:n,sum:i,add:o,subtract:u,multiply:l,pow:a,divide:s}=e;return t(Cq,{"Array, Array":function(y,b){return f(y,b)},"Matrix, Matrix":function(y,b){var w=f(y.toArray(),b.toArray());return Array.isArray(w)?r(w):w}});function f(h,y){var b=[];if(Array.isArray(h[0])&&Array.isArray(y[0])){if(h.length!==y.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var w=0;wo(C,l(P,y[R])),0),O=i(h.map(C=>a(C,2))),M=i(y.map(C=>a(C,2))),I=u(l(b,S),l(w,A)),F=n(l(u(l(b,O),a(w,2)),u(l(b,M),a(A,2))));return s(I,F)}});g();x();v();var Tq="combinations",Tce=["typed"],Iq=K(Tq,Tce,e=>{var{typed:t}=e;return t(Tq,{"number, number":tA,"BigNumber, BigNumber":function(n,i){var o=n.constructor,u,l,a=n.minus(i),s=new o(1);if(!Oq(n)||!Oq(i))throw new TypeError("Positive integer value expected in function combinations");if(i.gt(n))throw new TypeError("k must be less than n in function combinations");if(u=s,i.lt(a))for(l=s;l.lte(a);l=l.plus(s))u=u.times(i.plus(l)).dividedBy(l);else for(l=s;l.lte(i);l=l.plus(s))u=u.times(a.plus(l)).dividedBy(l);return u}})});function Oq(e){return e.isInteger()&&e.gte(0)}g();x();v();var Fq="combinationsWithRep",Oce=["typed"],kq=K(Fq,Oce,e=>{var{typed:t}=e;return t(Fq,{"number, number":function(n,i){if(!Nt(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Nt(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(i{var{typed:t,config:r,multiplyScalar:n,pow:i,BigNumber:o,Complex:u}=e;function l(s){if(s.im===0)return Cv(s.re);if(s.re<.5){var f=new u(1-s.re,-s.im),p=new u(Math.PI*s.re,Math.PI*s.im);return new u(Math.PI).div(p.sin()).div(l(f))}s=new u(s.re-1,s.im);for(var h=new u(vp[0],0),y=1;y2;)h-=2,b+=h,y=y.times(b);return new o(y.toPrecision(o.precision))}});g();x();v();var Pq="lgamma",Fce=["Complex","typed"],Rq=K(Pq,Fce,e=>{var{Complex:t,typed:r}=e,n=7,i=7,o=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(Pq,{number:Mv,Complex:u,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function u(s){var f=6.283185307179586,p=1.1447298858494002,h=.1;if(s.isNaN())return new t(NaN,NaN);if(s.im===0)return new t(Mv(s.re),0);if(s.re>=n||Math.abs(s.im)>=i)return l(s);if(s.re<=h){var y=oF(f,s.im)*Math.floor(.5*s.re+.25),b=s.mul(Math.PI).sin().log(),w=u(new t(1-s.re,-s.im));return new t(p,y).sub(b).sub(w)}else return s.im>=0?a(s):a(s.conjugate()).conjugate()}function l(s){for(var f=s.sub(.5).mul(s.log()).sub(s).add(oA),p=new t(1,0).div(s),h=p.div(s),y=o[0],b=o[1],w=2*h.re,A=h.re*h.re+h.im*h.im,S=2;S<8;S++){var O=b;b=-A*y+o[S],y=w*y+O}var M=p.mul(h.mul(y).add(b));return f.add(M)}function a(s){var f=0,p=0,h=s;for(s=s.add(1);s.re<=n;){h=h.mul(s);var y=h.im<0?1:0;y!==0&&p===0&&f++,p=y,s=s.add(1)}return l(s).sub(h.log()).sub(new t(0,f*2*Math.PI*1))}});g();x();v();var qq="factorial",_ce=["typed","gamma"],zq=K(qq,_ce,e=>{var{typed:t,gamma:r}=e;return t(qq,{number:function(i){if(i<0)throw new Error("Value must be non-negative");return r(i+1)},BigNumber:function(i){if(i.isNegative())throw new Error("Value must be non-negative");return r(i.plus(1))},"Array | Matrix":t.referToSelf(n=>i=>Ct(i,n))})});g();x();v();var Uq="kldivergence",kce=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Hq=K(Uq,kce,e=>{var{typed:t,matrix:r,divide:n,sum:i,multiply:o,map:u,dotDivide:l,log:a,isNumeric:s}=e;return t(Uq,{"Array, Array":function(h,y){return f(r(h),r(y))},"Matrix, Array":function(h,y){return f(h,r(y))},"Array, Matrix":function(h,y){return f(r(h),y)},"Matrix, Matrix":function(h,y){return f(h,y)}});function f(p,h){var y=h.size().length,b=p.size().length;if(y>1)throw new Error("first object must be one dimensional");if(b>1)throw new Error("second object must be one dimensional");if(y!==b)throw new Error("Length of two vectors must be equal");var w=i(p);if(w===0)throw new Error("Sum of elements in first object must be non zero");var A=i(h);if(A===0)throw new Error("Sum of elements in second object must be non zero");var S=n(p,i(p)),O=n(h,i(h)),M=i(o(S,u(l(S,O),I=>a(I))));return s(M)?M:Number.NaN}});g();x();v();var $q="multinomial",Bce=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Wq=K($q,Bce,e=>{var{typed:t,add:r,divide:n,multiply:i,factorial:o,isInteger:u,isPositive:l}=e;return t($q,{"Array | Matrix":function(s){var f=0,p=1;return mo(s,function(h){if(!u(h)||!l(h))throw new TypeError("Positive integer value expected in function multinomial");f=r(f,h),p=i(p,o(h))}),n(o(f),p)}})});g();x();v();var Vq="permutations",Lce=["typed","factorial"],Yq=K(Vq,Lce,e=>{var{typed:t,factorial:r}=e;return t(Vq,{"number | BigNumber":r,"number, number":function(i,o){if(!Nt(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(!Nt(o)||o<0)throw new TypeError("Positive integer value expected in function permutations");if(o>i)throw new TypeError("second argument k must be less than or equal to first argument n");return xa(i-o+1,i)},"BigNumber, BigNumber":function(i,o){var u,l;if(!Gq(i)||!Gq(o))throw new TypeError("Positive integer value expected in function permutations");if(o.gt(i))throw new TypeError("second argument k must be less than or equal to first argument n");var a=i.mul(0).add(1);for(u=a,l=i.minus(o).plus(1);l.lte(i);l=l.plus(1))u=u.times(l);return u}})});function Gq(e){return e.isInteger()&&e.gte(0)}g();x();v();g();x();v();var VA=ln(cz(),1),Wce=(0,VA.default)(Date.now());function Nl(e){var t;function r(i){t=i===null?Wce:(0,VA.default)(String(i))}r(e);function n(){return t()}return n}var pz="pickRandom",Vce=["typed","config","?on"],mz=K(pz,Vce,e=>{var{typed:t,config:r,on:n}=e,i=Nl(r.randomSeed);return n&&n("config",function(u,l){u.randomSeed!==l.randomSeed&&(i=Nl(u.randomSeed))}),t(pz,{"Array | Matrix":function(l){return o(l,{})},"Array | Matrix, Object":function(l,a){return o(l,a)},"Array | Matrix, number":function(l,a){return o(l,{number:a})},"Array | Matrix, Array | Matrix":function(l,a){return o(l,{weights:a})},"Array | Matrix, Array | Matrix, number":function(l,a,s){return o(l,{number:s,weights:a})},"Array | Matrix, number, Array | Matrix":function(l,a,s){return o(l,{number:a,weights:s})}});function o(u,l){var{number:a,weights:s,elementWise:f=!0}=l,p=typeof a>"u";p&&(a=1);var h=St(u)?u.create:St(s)?s.create:null;u=u.valueOf(),s&&(s=s.valueOf()),f===!0&&(u=nr(u),s=nr(s));var y=0;if(typeof s<"u"){if(s.length!==u.length)throw new Error("Weights must have the same length as possibles");for(var b=0,w=s.length;b"u")O=u[Math.floor(i()*A)];else for(var M=i()*y,I=0,F=u.length;I1)for(var n=0,i=e.shift();n{var{typed:t,config:r,on:n}=e,i=Nl(r.randomSeed);return n&&n("config",function(l,a){l.randomSeed!==a.randomSeed&&(i=Nl(l.randomSeed))}),t(hz,{"":()=>u(0,1),number:l=>u(0,l),"number, number":(l,a)=>u(l,a),"Array | Matrix":l=>o(l,0,1),"Array | Matrix, number":(l,a)=>o(l,0,a),"Array | Matrix, number, number":(l,a,s)=>o(l,a,s)});function o(l,a,s){var f=_v(l.valueOf(),()=>u(a,s));return St(l)?l.create(f):f}function u(l,a){return l+i()*(a-l)}});g();x();v();var gz="randomInt",Yce=["typed","config","?on"],vz=K(gz,Yce,e=>{var{typed:t,config:r,on:n}=e,i=Nl(r.randomSeed);return n&&n("config",function(l,a){l.randomSeed!==a.randomSeed&&(i=Nl(l.randomSeed))}),t(gz,{"":()=>u(0,1),number:l=>u(0,l),"number, number":(l,a)=>u(l,a),"Array | Matrix":l=>o(l,0,1),"Array | Matrix, number":(l,a)=>o(l,0,a),"Array | Matrix, number, number":(l,a,s)=>o(l,a,s)});function o(l,a,s){var f=_v(l.valueOf(),()=>u(a,s));return St(l)?l.create(f):f}function u(l,a){return Math.floor(l+i()*(a-l))}});g();x();v();var xz="stirlingS2",Zce=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],yz=K(xz,Zce,e=>{var{typed:t,addScalar:r,subtractScalar:n,multiplyScalar:i,divideScalar:o,pow:u,factorial:l,combinations:a,isNegative:s,isInteger:f,number:p,bignumber:h,larger:y}=e,b=[],w=[];return t(xz,{"number | BigNumber, number | BigNumber":function(S,O){if(!f(S)||s(S)||!f(O)||s(O))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(y(O,S))throw new TypeError("k must be less than or equal to n in function stirlingS2");var M=!($t(S)&&$t(O)),I=M?w:b,F=M?h:p,C=p(S),P=p(O);if(I[C]&&I[C].length>P)return I[C][P];for(var R=0;R<=C;++R)if(I[R]||(I[R]=[F(R===0?1:0)]),R!==0)for(var q=I[R],U=I[R-1],H=q.length;H<=R&&H<=P;++H)H===R?q[H]=1:q[H]=r(i(F(H),U[H]),U[H-1]);return I[C][P]}})});g();x();v();var wz="bellNumbers",Xce=["typed","addScalar","isNegative","isInteger","stirlingS2"],bz=K(wz,Xce,e=>{var{typed:t,addScalar:r,isNegative:n,isInteger:i,stirlingS2:o}=e;return t(wz,{"number | BigNumber":function(l){if(!i(l)||n(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var a=0,s=0;s<=l;s++)a=r(a,o(l,s));return a}})});g();x();v();var Dz="catalan",Kce=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],Nz=K(Dz,Kce,e=>{var{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:o,isNegative:u,isInteger:l}=e;return t(Dz,{"number | BigNumber":function(s){if(!l(s)||u(s))throw new TypeError("Non-negative integer value expected in function catalan");return n(o(i(s,2),s),r(s,1))}})});g();x();v();var Sz="composition",Jce=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],Ez=K(Sz,Jce,e=>{var{typed:t,addScalar:r,combinations:n,isPositive:i,isNegative:o,isInteger:u,larger:l}=e;return t(Sz,{"number | BigNumber, number | BigNumber":function(s,f){if(!u(s)||!i(s)||!u(f)||!i(f))throw new TypeError("Positive integer value expected in function composition");if(l(f,s))throw new TypeError("k must be less than or equal to n in function composition");return n(r(s,-1),r(f,-1))}})});g();x();v();var Az="leafCount",Qce=["parse","typed"],Cz=K(Az,Qce,e=>{var{parse:t,typed:r}=e;function n(i){var o=0;return i.forEach(u=>{o+=n(u)}),o||1}return r(Az,{Node:function(o){return n(o)}})});g();x();v();g();x();v();function GA(e){return or(e)||Xr(e)&&e.isUnary()&&or(e.args[0])}function kv(e){return!!(or(e)||(eo(e)||Xr(e))&&e.args.every(kv)||Ei(e)&&kv(e.content))}g();x();v();function Mz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function YA(e){for(var t=1;t{var{FunctionNode:t,OperatorNode:r,SymbolNode:n}=e,i=!0,o=!1,u="defaultF",l={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:o,total:i,commutative:o,associative:o},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:o,total:i,commutative:o,associative:o},paren:{trivial:i,total:i,commutative:i,associative:o},defaultF:{trivial:o,total:i,commutative:o,associative:o}},a={divide:{total:o},log:{total:o}},s={subtract:{total:o},abs:{trivial:i},log:{total:i}};function f(M,I){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,C=u;if(typeof M=="string"?C=M:Xr(M)?C=M.fn.toString():eo(M)?C=M.name:Ei(M)&&(C="paren"),Et(F,C)){var P=F[C];if(Et(P,I))return P[I];if(Et(l,C))return l[C][I]}if(Et(F,u)){var R=F[u];return Et(R,I)?R[I]:l[u][I]}if(Et(l,C)){var q=l[C];if(Et(q,I))return q[I]}return l[u][I]}function p(M){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return f(M,"commutative",I)}function h(M){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return f(M,"associative",I)}function y(M,I){var F=YA({},M);for(var C in I)Et(M,C)?F[C]=YA(YA({},I[C]),M[C]):F[C]=I[C];return F}function b(M,I){if(!M.args||M.args.length===0)return M;M.args=w(M,I);for(var F=0;F2&&h(M,I)){for(var R=M.args.pop();M.args.length>0;)R=F([M.args.pop(),R]);M.args=R.args}}}function S(M,I){if(!(!M.args||M.args.length===0)){for(var F=O(M),C=M.args.length,P=0;P2&&h(M,I)){for(var R=M.args.shift();M.args.length>0;)R=F([R,M.args.shift()]);M.args=R.args}}}function O(M){return Xr(M)?function(I){try{return new r(M.op,M.fn,I,M.implicit)}catch(F){return console.error(F),[]}}:function(I){return new t(new n(M.name),I)}}return{createMakeNodeFunction:O,hasProperty:f,isCommutative:p,isAssociative:h,mergeContext:y,flatten:b,allChildren:w,unflattenr:A,unflattenl:S,defaultContext:l,realContext:a,positiveContext:s}});var tpe="simplify",rpe=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Tz=K(tpe,rpe,e=>{var{config:t,typed:r,parse:n,add:i,subtract:o,multiply:u,divide:l,pow:a,isZero:s,equal:f,resolve:p,simplifyConstant:h,simplifyCore:y,fraction:b,bignumber:w,mathWithTransform:A,matrix:S,AccessorNode:O,ArrayNode:M,ConstantNode:I,FunctionNode:F,IndexNode:C,ObjectNode:P,OperatorNode:R,ParenthesisNode:q,SymbolNode:U}=e,{hasProperty:H,isCommutative:V,isAssociative:W,mergeContext:ee,flatten:ie,unflattenr:Y,unflattenl:Z,createMakeNodeFunction:le,defaultContext:re,realContext:he,positiveContext:De}=Ih({FunctionNode:F,OperatorNode:R,SymbolNode:U});r.addConversion({from:"Object",to:"Map",convert:vl});var we=r("simplify",{Node:Ee,"Node, Map":(ge,Re)=>Ee(ge,!1,Re),"Node, Map, Object":(ge,Re,Be)=>Ee(ge,!1,Re,Be),"Node, Array":Ee,"Node, Array, Map":Ee,"Node, Array, Map, Object":Ee});r.removeConversion({from:"Object",to:"Map",convert:vl}),we.defaultContext=re,we.realContext=he,we.positiveContext=De;function ce(ge){return ge.transform(function(Re,Be,Ke){return Ei(Re)?ce(Re.content):Re})}var Se={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};we.rules=[y,{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}}},h,{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}}},h,{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"}];function Pe(ge,Re){var Be={};if(ge.s){var Ke=ge.s.split("->");if(Ke.length===2)Be.l=Ke[0],Be.r=Ke[1];else throw SyntaxError("Could not parse rule: "+ge.s)}else Be.l=ge.l,Be.r=ge.r;Be.l=ce(n(Be.l)),Be.r=ce(n(Be.r));for(var ot of["imposeContext","repeat","assuming"])ot in ge&&(Be[ot]=ge[ot]);if(ge.evaluate&&(Be.evaluate=n(ge.evaluate)),W(Be.l,Re)){var Qe=!V(Be.l,Re),ut;Qe&&(ut=He());var Pt=le(Be.l),fe=He();Be.expanded={},Be.expanded.l=Pt([Be.l,fe]),ie(Be.expanded.l,Re),Y(Be.expanded.l,Re),Be.expanded.r=Pt([Be.r,fe]),Qe&&(Be.expandedNC1={},Be.expandedNC1.l=Pt([ut,Be.l]),Be.expandedNC1.r=Pt([ut,Be.r]),Be.expandedNC2={},Be.expandedNC2.l=Pt([ut,Be.expanded.l]),Be.expandedNC2.r=Pt([ut,Be.expanded.r]))}return Be}function Ce(ge,Re){for(var Be=[],Ke=0;Ke2&&arguments[2]!==void 0?arguments[2]:Cf(),Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ot=Ke.consoleDebug;Re=Ce(Re||we.rules,Ke.context);var Qe=p(ge,Be);Qe=ce(Qe);for(var ut={},Pt=Qe.toString({parenthesis:"all"});!ut[Pt];){ut[Pt]=!0,Oe=0;var fe=Pt;ot&&console.log("Working on: ",Pt);for(var J=0;J ").concat(Re[J].r.toString()))),ot){var ne=Qe.toString({parenthesis:"all"});ne!==fe&&(console.log("Applying",j,"produced",ne),fe=ne)}Z(Qe,Ke.context)}Pt=Qe.toString({parenthesis:"all"})}return Qe}function ze(ge,Re,Be){var Ke=ge;if(ge)for(var ot=0;ot1&&(fe=Qe(ge.args.slice(0,Pt))),ot=ge.args.slice(Pt),Ke=ot.length===1?ot[0]:Qe(ot),Be.push(Qe([fe,Ke]))}return Be}function lt(ge,Re){var Be={placeholders:{}};if(!ge.placeholders&&!Re.placeholders)return Be;if(ge.placeholders){if(!Re.placeholders)return ge}else return Re;for(var Ke in ge.placeholders)if(Et(ge.placeholders,Ke)&&(Be.placeholders[Ke]=ge.placeholders[Ke],Et(Re.placeholders,Ke)&&!Ue(ge.placeholders[Ke],Re.placeholders[Ke])))return null;for(var ot in Re.placeholders)Et(Re.placeholders,ot)&&(Be.placeholders[ot]=Re.placeholders[ot]);return Be}function ct(ge,Re){var Be=[];if(ge.length===0||Re.length===0)return Be;for(var Ke,ot=0;ot2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var fe=be(ge.args[0],Re.args[1],Be);if(fe.length===0)return[];var J=be(ge.args[1],Re.args[0],Be);if(J.length===0)return[];Qe=[fe,J]}ot=de(Qe)}else if(Re.args.length>=2&&ge.args.length===2){for(var j=Le(Re,Be),ne=[],me=0;me2)throw Error("Unexpected non-binary associative function: "+ge.toString());return[]}}else if(ge instanceof U){if(ge.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(Se[ge.name]){if(ge.name!==Re.name)return[]}else switch(ge.name[1]>="a"&&ge.name[1]<="z"?ge.name.substring(0,2):ge.name[0]){case"n":case"_p":ot[0].placeholders[ge.name]=Re;break;case"c":case"cl":if(or(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"v":if(!or(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"vl":if(qr(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"cd":if(GA(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"vd":if(!GA(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"ce":if(kv(Re))ot[0].placeholders[ge.name]=Re;else return[];break;case"ve":if(!kv(Re))ot[0].placeholders[ge.name]=Re;else return[];break;default:throw new Error("Invalid symbol in rule: "+ge.name)}}else if(ge instanceof I){if(!f(ge.value,Re.value))return[]}else return[];return ot}function Ue(ge,Re){if(ge instanceof I&&Re instanceof I){if(!f(ge.value,Re.value))return!1}else if(ge instanceof U&&Re instanceof U){if(ge.name!==Re.name)return!1}else if(ge instanceof R&&Re instanceof R||ge instanceof F&&Re instanceof F){if(ge instanceof R){if(ge.op!==Re.op||ge.fn!==Re.fn)return!1}else if(ge instanceof F&&ge.name!==Re.name)return!1;if(ge.args.length!==Re.args.length)return!1;for(var Be=0;Be{var{typed:t,config:r,mathWithTransform:n,matrix:i,fraction:o,bignumber:u,AccessorNode:l,ArrayNode:a,ConstantNode:s,FunctionNode:f,IndexNode:p,ObjectNode:h,OperatorNode:y,SymbolNode:b}=e,{isCommutative:w,isAssociative:A,allChildren:S,createMakeNodeFunction:O}=Ih({FunctionNode:f,OperatorNode:y,SymbolNode:b}),M=t("simplifyConstant",{Node:ie=>P(ee(ie,{})),"Node, Object":function(Y,Z){return P(ee(Y,Z))}});function I(ie){return da(ie)?ie.valueOf():ie instanceof Array?ie.map(I):St(ie)?i(I(ie.valueOf())):ie}function F(ie,Y,Z){try{return n[ie].apply(null,Y)}catch{return Y=Y.map(I),q(n[ie].apply(null,Y),Z)}}var C=t({Fraction:H,number:function(Y){return Y<0?U(new s(-Y)):new s(Y)},BigNumber:function(Y){return Y<0?U(new s(-Y)):new s(Y)},bigint:function(Y){return Y<0n?U(new s(-Y)):new s(Y)},Complex:function(Y){throw new Error("Cannot convert Complex number to Node")},string:function(Y){return new s(Y)},Matrix:function(Y){return new a(Y.valueOf().map(Z=>C(Z)))}});function P(ie){return cr(ie)?ie:C(ie)}function R(ie,Y){var Z=Y&&Y.exactFractions!==!1;if(Z&&isFinite(ie)&&o){var le=o(ie),re=Y&&typeof Y.fractionsLimit=="number"?Y.fractionsLimit:1/0;if(le.valueOf()===ie&&le.n0;)if(or(le[0])&&typeof le[0].value!="string"){var re=q(le.shift().value,Z);Si(ie)?ie=ie.items[re-1]:(ie=ie.valueOf()[re-1],ie instanceof Array&&(ie=i(ie)))}else if(le.length>1&&or(le[1])&&typeof le[1].value!="string"){var he=q(le[1].value,Z),De=[],we=Si(ie)?ie.items:ie.valueOf();for(var ce of we)if(Si(ce))De.push(ce.items[he-1]);else if(St(ie))De.push(ce[he-1]);else break;if(De.length===we.length)Si(ie)?ie=new a(De):ie=i(De),le.splice(1,1);else break}else break;return le.length===Y.dimensions.length?new l(P(ie),Y):le.length>0?(Y=new p(le),new l(P(ie),Y)):ie}if(Su(ie)&&Y.dimensions.length===1&&or(Y.dimensions[0])){var Se=Y.dimensions[0].value;return Se in ie.properties?ie.properties[Se]:new s}return new l(P(ie),Y)}function W(ie,Y,Z,le){var re=Y.shift(),he=Y.reduce((De,we)=>{if(!cr(we)){var ce=De.pop();if(cr(ce))return[ce,we];try{return De.push(F(ie,[ce,we],le)),De}catch{De.push(ce)}}De.push(P(De.pop()));var Se=De.length===1?De[0]:Z(De);return[Z([Se,P(we)])]},[re]);return he.length===1?he[0]:Z([he[0],C(he[1])])}function ee(ie,Y){switch(ie.type){case"SymbolNode":return ie;case"ConstantNode":switch(typeof ie.value){case"number":return q(ie.value,Y);case"bigint":return q(ie.value,Y);case"string":return ie.value;default:if(!isNaN(ie.value))return q(ie.value,Y)}return ie;case"FunctionNode":if(n[ie.name]&&n[ie.name].rawArgs)return ie;{var Z=["add","multiply"];if(!Z.includes(ie.name)){var le=ie.args.map(We=>ee(We,Y));if(!le.some(cr))try{return F(ie.name,le,Y)}catch{}if(ie.name==="size"&&le.length===1&&Si(le[0])){for(var re=[],he=le[0];Si(he);)re.push(he.items.length),he=he.items[0];return i(re)}return new f(ie.name,le.map(P))}}case"OperatorNode":{var De=ie.fn.toString(),we,ce,Se=O(ie);if(Xr(ie)&&ie.isUnary())we=[ee(ie.args[0],Y)],cr(we[0])?ce=Se(we):ce=F(De,we,Y);else if(A(ie,Y.context))if(we=S(ie,Y.context),we=we.map(We=>ee(We,Y)),w(De,Y.context)){for(var Pe=[],Ce=[],Oe=0;Oe1?(ce=W(De,Pe,Se,Y),Ce.unshift(ce),ce=W(De,Ce,Se,Y)):ce=W(De,we,Se,Y)}else ce=W(De,we,Se,Y);else we=ie.args.map(We=>ee(We,Y)),ce=W(De,we,Se,Y);return ce}case"ParenthesisNode":return ee(ie.content,Y);case"AccessorNode":return V(ee(ie.object,Y),ee(ie.index,Y),Y);case"ArrayNode":{var He=ie.items.map(We=>ee(We,Y));return He.some(cr)?new a(He.map(P)):i(He)}case"IndexNode":return new p(ie.dimensions.map(We=>M(We,Y)));case"ObjectNode":{var Ee={};for(var ze in ie.properties)Ee[ze]=M(ie.properties[ze],Y);return new h(Ee)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(ie.type))}}return M});g();x();v();var Iz="simplifyCore",ope=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Fz=K(Iz,ope,e=>{var{typed:t,parse:r,equal:n,isZero:i,add:o,subtract:u,multiply:l,divide:a,pow:s,AccessorNode:f,ArrayNode:p,ConstantNode:h,FunctionNode:y,IndexNode:b,ObjectNode:w,OperatorNode:A,ParenthesisNode:S,SymbolNode:O}=e,M=new h(0),I=new h(1),F=new h(!0),C=new h(!1);function P(H){return Xr(H)&&["and","not","or"].includes(H.op)}var{hasProperty:R,isCommutative:q}=Ih({FunctionNode:y,OperatorNode:A,SymbolNode:O});function U(H){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=V?V.context:void 0;if(R(H,"trivial",W)){if(eo(H)&&H.args.length===1)return U(H.args[0],V);var ee=!1,ie=0;if(H.forEach(Ce=>{++ie,ie===1&&(ee=U(Ce,V))}),ie===1)return ee}var Y=H;if(eo(Y)){var Z=w6(Y.name);if(Z){if(Y.args.length>2&&R(Y,"associative",W))for(;Y.args.length>2;){var le=Y.args.pop(),re=Y.args.pop();Y.args.push(new A(Z,Y.name,[le,re]))}Y=new A(Z,Y.name,Y.args)}else return new y(U(Y.fn),Y.args.map(Ce=>U(Ce,V)))}if(Xr(Y)&&Y.isUnary()){var he=U(Y.args[0],V);if(Y.op==="~"&&Xr(he)&&he.isUnary()&&he.op==="~"||Y.op==="not"&&Xr(he)&&he.isUnary()&&he.op==="not"&&P(he.args[0]))return he.args[0];var De=!0;if(Y.op==="-"&&Xr(he)&&(he.isBinary()&&he.fn==="subtract"&&(Y=new A("-","subtract",[he.args[1],he.args[0]]),De=!1),he.isUnary()&&he.op==="-"))return he.args[0];if(De)return new A(Y.op,Y.fn,[he])}if(Xr(Y)&&Y.isBinary()){var we=U(Y.args[0],V),ce=U(Y.args[1],V);if(Y.op==="+"){if(or(we)&&i(we.value))return ce;if(or(ce)&&i(ce.value))return we;Xr(ce)&&ce.isUnary()&&ce.op==="-"&&(ce=ce.args[0],Y=new A("-","subtract",[we,ce]))}if(Y.op==="-")return Xr(ce)&&ce.isUnary()&&ce.op==="-"?U(new A("+","add",[we,ce.args[0]]),V):or(we)&&i(we.value)?U(new A("-","unaryMinus",[ce])):or(ce)&&i(ce.value)?we:new A(Y.op,Y.fn,[we,ce]);if(Y.op==="*"){if(or(we)){if(i(we.value))return M;if(n(we.value,1))return ce}if(or(ce)){if(i(ce.value))return M;if(n(ce.value,1))return we;if(q(Y,W))return new A(Y.op,Y.fn,[ce,we],Y.implicit)}return new A(Y.op,Y.fn,[we,ce],Y.implicit)}if(Y.op==="/")return or(we)&&i(we.value)?M:or(ce)&&n(ce.value,1)?we:new A(Y.op,Y.fn,[we,ce]);if(Y.op==="^"&&or(ce)){if(i(ce.value))return I;if(n(ce.value,1))return we}if(Y.op==="and"){if(or(we))if(we.value){if(P(ce))return ce;if(or(ce))return ce.value?F:C}else return C;if(or(ce))if(ce.value){if(P(we))return we}else return C}if(Y.op==="or"){if(or(we)){if(we.value)return F;if(P(ce))return ce}if(or(ce)){if(ce.value)return F;if(P(we))return we}}return new A(Y.op,Y.fn,[we,ce])}if(Xr(Y))return new A(Y.op,Y.fn,Y.args.map(Ce=>U(Ce,V)));if(Si(Y))return new p(Y.items.map(Ce=>U(Ce,V)));if(Fo(Y))return new f(U(Y.object,V),U(Y.index,V));if(Vo(Y))return new b(Y.dimensions.map(Ce=>U(Ce,V)));if(Su(Y)){var Se={};for(var Pe in Y.properties)Se[Pe]=U(Y.properties[Pe],V);return new w(Se)}return Y}return t(Iz,{Node:U,"Node,Object":U})});g();x();v();var ape="resolve",spe=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],_z=K(ape,spe,e=>{var{typed:t,parse:r,ConstantNode:n,FunctionNode:i,OperatorNode:o,ParenthesisNode:u}=e;function l(a,s){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!s)return a;if(qr(a)){if(f.has(a.name)){var p=Array.from(f).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(p,"}"))}var h=s.get(a.name);if(cr(h)){var y=new Set(f);return y.add(a.name),l(h,s,y)}else return typeof h=="number"?r(String(h)):h!==void 0?new n(h):a}else if(Xr(a)){var b=a.args.map(function(A){return l(A,s,f)});return new o(a.op,a.fn,b,a.implicit)}else{if(Ei(a))return new u(l(a.content,s,f));if(eo(a)){var w=a.args.map(function(A){return l(A,s,f)});return new i(a.name,w)}}return a.map(A=>l(A,s,f))}return t("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(a,s)=>l(a,vl(s)),"Array | Matrix":t.referToSelf(a=>s=>s.map(f=>a(f))),"Array | Matrix, null | undefined":t.referToSelf(a=>s=>s.map(f=>a(f))),"Array, Object":t.referTo("Array,Map",a=>(s,f)=>a(s,vl(f))),"Matrix, Object":t.referTo("Matrix,Map",a=>(s,f)=>a(s,vl(f))),"Array | Matrix, Map":t.referToSelf(a=>(s,f)=>s.map(p=>a(p,f)))})});g();x();v();var kz="symbolicEqual",upe=["parse","simplify","typed","OperatorNode"],Bz=K(kz,upe,e=>{var{parse:t,simplify:r,typed:n,OperatorNode:i}=e;function o(u,l){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=new i("-","subtract",[u,l]),f=r(s,{},a);return or(f)&&!f.value}return n(kz,{"Node, Node":o,"Node, Node, Object":o})});g();x();v();var Lz="derivative",lpe=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],Pz=K(Lz,lpe,e=>{var{typed:t,config:r,parse:n,simplify:i,equal:o,isZero:u,numeric:l,ConstantNode:a,FunctionNode:s,OperatorNode:f,ParenthesisNode:p,SymbolNode:h}=e;function y(M,I){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},C={};A(C,M,I.name);var P=S(M,C);return F.simplify?i(P):P}t.addConversion({from:"identifier",to:"SymbolNode",convert:n});var b=t(Lz,{"Node, SymbolNode":y,"Node, SymbolNode, Object":y});t.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),b._simplify=!0,b.toTex=function(M){return w.apply(null,M.args)};var w=t("_derivTex",{"Node, SymbolNode":function(I,F){return or(I)&&gr(I.value)==="string"?w(n(I.value).toString(),F.toString(),1):w(I.toTex(),F.toString(),1)},"Node, ConstantNode":function(I,F){if(gr(F.value)==="string")return w(I,n(F.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(I,F,C){return w(I.toString(),F.name,C.value)},"string, string, number":function(I,F,C){var P;return C===1?P="{d\\over d"+F+"}":P="{d^{"+C+"}\\over d"+F+"^{"+C+"}}",P+"\\left[".concat(I,"\\right]")}}),A=t("constTag",{"Object, ConstantNode, string":function(I,F){return I[F]=!0,!0},"Object, SymbolNode, string":function(I,F,C){return F.name!==C?(I[F]=!0,!0):!1},"Object, ParenthesisNode, string":function(I,F,C){return A(I,F.content,C)},"Object, FunctionAssignmentNode, string":function(I,F,C){return F.params.includes(C)?A(I,F.expr,C):(I[F]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(I,F,C){if(F.args.length>0){for(var P=A(I,F.args[0],C),R=1;R0){var P=I.args.filter(function(ie){return F[ie]===void 0}),R=P.length===1?P[0]:new f("*","multiply",P),q=C.concat(S(R,F));return new f("*","multiply",q)}return new f("+","add",I.args.map(function(ie){return new f("*","multiply",I.args.map(function(Y){return Y===ie?S(Y,F):Y.clone()}))}))}if(I.op==="/"&&I.isBinary()){var U=I.args[0],H=I.args[1];return F[H]!==void 0?new f("/","divide",[S(U,F),H]):F[U]!==void 0?new f("*","multiply",[new f("-","unaryMinus",[U]),new f("/","divide",[S(H,F),new f("^","pow",[H.clone(),O(2)])])]):new f("/","divide",[new f("-","subtract",[new f("*","multiply",[S(U,F),H.clone()]),new f("*","multiply",[U.clone(),S(H,F)])]),new f("^","pow",[H.clone(),O(2)])])}if(I.op==="^"&&I.isBinary()){var V=I.args[0],W=I.args[1];if(F[V]!==void 0)return or(V)&&(u(V.value)||o(V.value,1))?O(0):new f("*","multiply",[I,new f("*","multiply",[new s("log",[V.clone()]),S(W.clone(),F)])]);if(F[W]!==void 0){if(or(W)){if(u(W.value))return O(0);if(o(W.value,1))return S(V,F)}var ee=new f("^","pow",[V.clone(),new f("-","subtract",[W,O(1)])]);return new f("*","multiply",[W.clone(),new f("*","multiply",[S(V,F),ee])])}return new f("*","multiply",[new f("^","pow",[V.clone(),W.clone()]),new f("+","add",[new f("*","multiply",[S(V,F),new f("/","divide",[W.clone(),V.clone()])]),new f("*","multiply",[S(W,F),new s("log",[V.clone()])])])])}throw new Error('Cannot process operator "'+I.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function O(M,I){return new a(l(M,I||co(String(M),r)))}return b});g();x();v();var Rz="rationalize",fpe=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],qz=K(Rz,fpe,e=>{var{config:t,typed:r,equal:n,isZero:i,add:o,subtract:u,multiply:l,divide:a,pow:s,parse:f,simplifyConstant:p,simplifyCore:h,simplify:y,fraction:b,bignumber:w,mathWithTransform:A,matrix:S,AccessorNode:O,ArrayNode:M,ConstantNode:I,FunctionNode:F,IndexNode:C,ObjectNode:P,OperatorNode:R,SymbolNode:q,ParenthesisNode:U}=e;function H(Y){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,re=W(),he=V(Y,Z,!0,re.firstRules),De=he.variables.length,we={exactFractions:!1},ce={exactFractions:!0};if(Y=he.expression,De>=1){Y=ee(Y);var Se,Pe,Ce=!0,Oe=!1;Y=y(Y,re.firstRules,{},we);for(var He;Pe=Ce?re.distrDivRules:re.sucDivRules,Y=y(Y,Pe,{},ce),Ce=!Ce,He=Y.toString(),He!==Se;)Oe=!0,Se=He;Oe&&(Y=y(Y,re.firstRulesAgain,{},we)),Y=y(Y,re.finalRules,{},we)}var Ee=[],ze={};return Y.type==="OperatorNode"&&Y.isBinary()&&Y.op==="/"?(De===1&&(Y.args[0]=ie(Y.args[0],Ee),Y.args[1]=ie(Y.args[1])),le&&(ze.numerator=Y.args[0],ze.denominator=Y.args[1])):(De===1&&(Y=ie(Y,Ee)),le&&(ze.numerator=Y,ze.denominator=null)),le?(ze.coefficients=Ee,ze.variables=he.variables,ze.expression=Y,ze):Y}return r(Rz,{Node:H,"Node, boolean":(Y,Z)=>H(Y,{},Z),"Node, Object":H,"Node, Object, boolean":H});function V(Y,Z,le,re){var he=[],De=y(Y,re,Z,{exactFractions:!1});le=!!le;var we="+-*"+(le?"/":"");Se(De);var ce={};return ce.expression=De,ce.variables=he,ce;function Se(Pe){var Ce=Pe.type;if(Ce==="FunctionNode")throw new Error("There is an unsolved function call");if(Ce==="OperatorNode")if(Pe.op==="^"){if(Pe.args[1].type!=="ConstantNode"||!Nt(parseFloat(Pe.args[1].value)))throw new Error("There is a non-integer exponent");Se(Pe.args[0])}else{if(!we.includes(Pe.op))throw new Error("Operator "+Pe.op+" invalid in polynomial expression");for(var Oe=0;Oe1;if(re==="OperatorNode"&&Y.isBinary()){var De=!1,we;if(Y.op==="^"&&(Y.args[0].type==="ParenthesisNode"||Y.args[0].type==="OperatorNode")&&Y.args[1].type==="ConstantNode"&&(we=parseFloat(Y.args[1].value),De=we>=2&&Nt(we)),De){if(we>2){var ce=Y.args[0],Se=new R("^","pow",[Y.args[0].cloneDeep(),new I(we-1)]);Y=new R("*","multiply",[ce,Se])}else Y=new R("*","multiply",[Y.args[0],Y.args[0].cloneDeep()]);he&&(le==="content"?Z.content=Y:Z.args[le]=Y)}}if(re==="ParenthesisNode")ee(Y.content,Y,"content");else if(re!=="ConstantNode"&&re!=="SymbolNode")for(var Pe=0;Pe=0;ce--)if(Z[ce]!==0){var Se=new I(De?Z[ce]:Math.abs(Z[ce])),Pe=Z[ce]<0?"-":"+";if(ce>0){var Ce=new q(he);if(ce>1){var Oe=new I(ce);Ce=new R("^","pow",[Ce,Oe])}Z[ce]===-1&&De?Se=new R("-","unaryMinus",[Ce]):Math.abs(Z[ce])===1?Se=Ce:Se=new R("*","multiply",[Se,Ce])}De?we=Se:Pe==="+"?we=new R("+","add",[we,Se]):we=new R("-","subtract",[we,Se]),De=!1}if(De)return new I(0);return we;function He(Ee,ze,We){var Le=Ee.type;if(Le==="FunctionNode")throw new Error("There is an unsolved function call");if(Le==="OperatorNode"){if(!"+-*^".includes(Ee.op))throw new Error("Operator "+Ee.op+" invalid");if(ze!==null){if((Ee.fn==="unaryMinus"||Ee.fn==="pow")&&ze.fn!=="add"&&ze.fn!=="subtract"&&ze.fn!=="multiply")throw new Error("Invalid "+Ee.op+" placing");if((Ee.fn==="subtract"||Ee.fn==="add"||Ee.fn==="multiply")&&ze.fn!=="add"&&ze.fn!=="subtract")throw new Error("Invalid "+Ee.op+" placing");if((Ee.fn==="subtract"||Ee.fn==="add"||Ee.fn==="unaryMinus")&&We.noFil!==0)throw new Error("Invalid "+Ee.op+" placing")}(Ee.op==="^"||Ee.op==="*")&&(We.fire=Ee.op);for(var lt=0;ltre&&(Z[ct]=0),Z[ct]+=We.cte*(We.oper==="+"?1:-1),re=Math.max(ct,re);return}We.cte=ct,We.fire===""&&(Z[0]+=We.cte*(We.oper==="+"?1:-1))}else throw new Error("Type "+Le+" is not allowed")}}});g();x();v();var zz="zpk2tf",cpe=["typed","add","multiply","Complex","number"],Uz=K(zz,cpe,e=>{var{typed:t,add:r,multiply:n,Complex:i,number:o}=e;return t(zz,{"Array,Array,number":function(s,f,p){return u(s,f,p)},"Array,Array":function(s,f){return u(s,f,1)},"Matrix,Matrix,number":function(s,f,p){return u(s.valueOf(),f.valueOf(),p)},"Matrix,Matrix":function(s,f){return u(s.valueOf(),f.valueOf(),1)}});function u(a,s,f){a.some(O=>O.type==="BigNumber")&&(a=a.map(O=>o(O))),s.some(O=>O.type==="BigNumber")&&(s=s.map(O=>o(O)));for(var p=[i(1,0)],h=[i(1,0)],y=0;y=0&&p-h{var{typed:t,add:r,multiply:n,Complex:i,divide:o,matrix:u}=e;return t(Hz,{"Array, Array":function(f,p){var h=a(512);return l(f,p,h)},"Array, Array, Array":function(f,p,h){return l(f,p,h)},"Array, Array, number":function(f,p,h){if(h<0)throw new Error("w must be a positive number");var y=a(h);return l(f,p,y)},"Matrix, Matrix":function(f,p){var h=a(512),{w:y,h:b}=l(f.valueOf(),p.valueOf(),h);return{w:u(y),h:u(b)}},"Matrix, Matrix, Matrix":function(f,p,h){var{h:y}=l(f.valueOf(),p.valueOf(),h.valueOf());return{h:u(y),w:u(h)}},"Matrix, Matrix, number":function(f,p,h){if(h<0)throw new Error("w must be a positive number");var y=a(h),{h:b}=l(f.valueOf(),p.valueOf(),y);return{h:u(b),w:u(y)}}});function l(s,f,p){for(var h=[],y=[],b=0;b{var{classes:t}=e;return function(n,i){var o=t[i&&i.mathjs];return o&&typeof o.fromJSON=="function"?o.fromJSON(i):i}});g();x();v();var dpe="replacer",gpe=[],Vz=K(dpe,gpe,()=>function(t,r){return typeof r=="number"&&(!isFinite(r)||isNaN(r))?{mathjs:"number",value:String(r)}:typeof r=="bigint"?{mathjs:"bigint",value:String(r)}:r});g();x();v();g();x();v();var Gz="13.0.0";var Yz=K("true",[],()=>!0),Zz=K("false",[],()=>!1),Xz=K("null",[],()=>null),Kz=wa("Infinity",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1/0):1/0}),Jz=wa("NaN",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(NaN):NaN}),Qz=wa("pi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?Iv(r):t_}),jz=wa("tau",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?PB(r):r_}),eU=wa("e",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?BB(r):n_}),tU=wa("phi",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?LB(r):i_}),rU=wa("LN2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).ln():Math.LN2}),nU=wa("LN10",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(10).ln():Math.LN10}),iU=wa("LOG2E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),oU=wa("LOG10E",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),aU=wa("SQRT1_2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),sU=wa("SQRT2",["config","?BigNumber"],e=>{var{config:t,BigNumber:r}=e;return t.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),uU=wa("i",["Complex"],e=>{var{Complex:t}=e;return t.I}),lU=K("PI",["pi"],e=>{var{pi:t}=e;return t}),fU=K("E",["e"],e=>{var{e:t}=e;return t}),cU=K("version",[],()=>Gz);function wa(e,t,r){return K(e,t,r,{recreateOnConfigChange:!0})}g();x();v();var pU=hr("speedOfLight","299792458","m s^-1"),mU=hr("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),hU=hr("planckConstant","6.62607015e-34","J s"),dU=hr("reducedPlanckConstant","1.0545718176461565e-34","J s"),gU=hr("magneticConstant","1.25663706212e-6","N A^-2"),vU=hr("electricConstant","8.8541878128e-12","F m^-1"),xU=hr("vacuumImpedance","376.730313667","ohm"),yU=hr("coulomb","8.987551792261171e9","N m^2 C^-2"),wU=hr("elementaryCharge","1.602176634e-19","C"),bU=hr("bohrMagneton","9.2740100783e-24","J T^-1"),DU=hr("conductanceQuantum","7.748091729863649e-5","S"),NU=hr("inverseConductanceQuantum","12906.403729652257","ohm"),SU=hr("magneticFluxQuantum","2.0678338484619295e-15","Wb"),EU=hr("nuclearMagneton","5.0507837461e-27","J T^-1"),AU=hr("klitzing","25812.807459304513","ohm");var CU=hr("bohrRadius","5.29177210903e-11","m"),MU=hr("classicalElectronRadius","2.8179403262e-15","m"),TU=hr("electronMass","9.1093837015e-31","kg"),OU=hr("fermiCoupling","1.1663787e-5","GeV^-2"),IU=tb("fineStructure",.0072973525693),FU=hr("hartreeEnergy","4.3597447222071e-18","J"),_U=hr("protonMass","1.67262192369e-27","kg"),kU=hr("deuteronMass","3.3435830926e-27","kg"),BU=hr("neutronMass","1.6749271613e-27","kg"),LU=hr("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),PU=hr("rydberg","10973731.568160","m^-1"),RU=hr("thomsonCrossSection","6.6524587321e-29","m^2"),qU=tb("weakMixingAngle",.2229),zU=tb("efimovFactor",22.7),UU=hr("atomicMass","1.66053906660e-27","kg"),HU=hr("avogadro","6.02214076e23","mol^-1"),$U=hr("boltzmann","1.380649e-23","J K^-1"),WU=hr("faraday","96485.33212331001","C mol^-1"),VU=hr("firstRadiation","3.7417718521927573e-16","W m^2"),GU=hr("loschmidt","2.686780111798444e25","m^-3"),YU=hr("gasConstant","8.31446261815324","J K^-1 mol^-1"),ZU=hr("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),XU=hr("molarVolume","0.022413969545014137","m^3 mol^-1"),KU=tb("sackurTetrode",-1.16487052358),JU=hr("secondRadiation","0.014387768775039337","m K"),QU=hr("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),jU=hr("wienDisplacement","2.897771955e-3","m K"),eH=hr("molarMass","0.99999999965e-3","kg mol^-1"),tH=hr("molarMassC12","11.9999999958e-3","kg mol^-1"),rH=hr("gravity","9.80665","m s^-2"),nH=hr("planckLength","1.616255e-35","m"),iH=hr("planckMass","2.176435e-8","kg"),oH=hr("planckTime","5.391245e-44","s"),aH=hr("planckCharge","1.87554603778e-18","C"),sH=hr("planckTemperature","1.416785e+32","K");function hr(e,t,r){var n=["config","Unit","BigNumber"];return K(e,n,i=>{var{config:o,Unit:u,BigNumber:l}=i,a=o.number==="BigNumber"?new l(t):parseFloat(t),s=new u(a,r);return s.fixPrefix=!0,s})}function tb(e,t){var r=["config","BigNumber"];return K(e,r,n=>{var{config:i,BigNumber:o}=n;return i.number==="BigNumber"?new o(t):t})}g();x();v();var vpe="apply",xpe=["typed","isInteger"],uH=K(vpe,xpe,e=>{var{typed:t,isInteger:r}=e,n=Dh({typed:t,isInteger:r});return t("apply",{"...any":function(o){var u=o[1];$t(u)?o[1]=u-1:kt(u)&&(o[1]=u.minus(1));try{return n.apply(null,o)}catch(l){throw Jr(l)}}})},{isTransformFunction:!0});g();x();v();var ype="column",wpe=["typed","Index","matrix","range"],lH=K(ype,wpe,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=ow({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(l){var a=l.length-1,s=l[a];$t(s)&&(l[a]=s-1);try{return o.apply(null,l)}catch(f){throw Jr(f)}}})},{isTransformFunction:!0});g();x();v();g();x();v();function Fh(e,t,r){var n=e.filter(function(a){return qr(a)&&!(a.name in t)&&!r.has(a.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,o=new Map,u=new ph(r,o,new Set([i])),l=e.compile();return function(s){return o.set(i,s),l.evaluate(u)}}var bpe="filter",Dpe=["typed"],cH=K(bpe,Dpe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(qr(i[1])||$a(i[1])?a=i[1].compile().evaluate(u):a=Fh(i[1],o,u)),n(l,a)}r.rawArgs=!0;var n=t("filter",{"Array, function":fH,"Matrix, function":function(o,u){return o.create(fH(o.toArray(),u))},"Array, RegExp":vh,"Matrix, RegExp":function(o,u){return o.create(vh(o.toArray(),u))}});return r},{isTransformFunction:!0});function fH(e,t){return Uy(e,function(r,n,i){return Ya(t,r,[n+1],i,"filter")})}g();x();v();var Npe="forEach",Spe=["typed"],pH=K(Npe,Spe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(qr(i[1])||$a(i[1])?a=i[1].compile().evaluate(u):a=Fh(i[1],o,u)),n(l,a)}r.rawArgs=!0;var n=t("forEach",{"Array | Matrix, function":function(o,u){var l=function a(s,f){if(Array.isArray(s))Ff(s,function(p,h){a(p,f.concat(h+1))});else return Ya(u,s,f,o,"forEach")};l(o.valueOf(),[])}});return r},{isTransformFunction:!0});g();x();v();var Epe="index",Ape=["Index","getMatrixDataType"],mH=K(Epe,Ape,e=>{var{Index:t,getMatrixDataType:r}=e;return function(){for(var i=[],o=0,u=arguments.length;o0?0:2;else if(l&&l.isSet===!0)l=l.map(function(s){return s-1});else if(pr(l)||St(l))r(l)!=="boolean"&&(l=l.map(function(s){return s-1}));else if($t(l))l--;else if(kt(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");i[o]=l}var a=new t;return t.apply(a,i),a}},{isTransformFunction:!0});g();x();v();var Cpe="map",Mpe=["typed"],dH=K(Cpe,Mpe,e=>{var{typed:t}=e;function r(i,o,u){var l,a;return i[0]&&(l=i[0].compile().evaluate(u)),i[1]&&(qr(i[1])||$a(i[1])?a=i[1].compile().evaluate(u):a=Fh(i[1],o,u)),n(l,a)}r.rawArgs=!0;var n=t("map",{"Array, function":function(o,u){return hH(o,u,o)},"Matrix, function":function(o,u){return o.create(hH(o.valueOf(),u,o))}});return r},{isTransformFunction:!0});function hH(e,t,r){function n(i,o){return Array.isArray(i)?Yo(i,function(u,l){return n(u,o.concat(l+1))}):Ya(t,i,o,r,"map")}return n(e,[])}g();x();v();g();x();v();function go(e){if(e.length===2&&xn(e[0])){e=e.slice();var t=e[1];$t(t)?e[1]=t-1:kt(t)&&(e[1]=t.minus(1))}return e}var Tpe="max",Ope=["typed","config","numeric","larger"],gH=K(Tpe,Ope,e=>{var{typed:t,config:r,numeric:n,larger:i}=e,o=Dw({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(l){l=go(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();x();v();var Ipe="mean",Fpe=["typed","add","divide"],vH=K(Ipe,Fpe,e=>{var{typed:t,add:r,divide:n}=e,i=Kw({typed:t,add:r,divide:n});return t("mean",{"...any":function(u){u=go(u);try{return i.apply(null,u)}catch(l){throw Jr(l)}}})},{isTransformFunction:!0});g();x();v();var _pe="min",kpe=["typed","config","numeric","smaller"],xH=K(_pe,kpe,e=>{var{typed:t,config:r,numeric:n,smaller:i}=e,o=Nw({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(l){l=go(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();x();v();var Bpe="range",Lpe=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],yH=K(Bpe,Lpe,e=>{var{typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:u,larger:l,largerEq:a,add:s,isPositive:f}=e,p=lw({typed:t,config:r,matrix:n,bignumber:i,smaller:o,smallerEq:u,larger:l,largerEq:a,add:s,isPositive:f});return t("range",{"...any":function(y){var b=y.length-1,w=y[b];return typeof w!="boolean"&&y.push(!0),p.apply(null,y)}})},{isTransformFunction:!0});g();x();v();var Ppe="row",Rpe=["typed","Index","matrix","range"],wH=K(Ppe,Rpe,e=>{var{typed:t,Index:r,matrix:n,range:i}=e,o=fw({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(l){var a=l.length-1,s=l[a];$t(s)&&(l[a]=s-1);try{return o.apply(null,l)}catch(f){throw Jr(f)}}})},{isTransformFunction:!0});g();x();v();var qpe="subset",zpe=["typed","matrix","zeros","add"],bH=K(qpe,zpe,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=cw({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(l){try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();x();v();var Upe="concat",Hpe=["typed","matrix","isInteger"],DH=K(Upe,Hpe,e=>{var{typed:t,matrix:r,isInteger:n}=e,i=iw({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(u){var l=u.length-1,a=u[l];$t(a)?u[l]=a-1:kt(a)&&(u[l]=a.minus(1));try{return i.apply(null,u)}catch(s){throw Jr(s)}}})},{isTransformFunction:!0});g();x();v();var NH="diff",$pe=["typed","matrix","subtract","number","bignumber"],SH=K(NH,$pe,e=>{var{typed:t,matrix:r,subtract:n,number:i,bignumber:o}=e,u=aw({typed:t,matrix:r,subtract:n,number:i,bignumber:o});return t(NH,{"...any":function(a){a=go(a);try{return u.apply(null,a)}catch(s){throw Jr(s)}}})},{isTransformFunction:!0});g();x();v();var Wpe="std",Vpe=["typed","map","sqrt","variance"],EH=K(Wpe,Vpe,e=>{var{typed:t,map:r,sqrt:n,variance:i}=e,o=jw({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(l){l=go(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();x();v();var AH="sum",Gpe=["typed","config","add","numeric"],CH=K(AH,Gpe,e=>{var{typed:t,config:r,add:n,numeric:i}=e,o=Yw({typed:t,config:r,add:n,numeric:i});return t(AH,{"...any":function(l){l=go(l);try{return o.apply(null,l)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();x();v();var Ype="quantileSeq",Zpe=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],MH=K(Ype,Zpe,e=>{var{typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:u,partitionSelect:l,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h}=e,y=Qw({typed:t,bignumber:r,add:n,subtract:i,divide:o,multiply:u,partitionSelect:l,compare:a,isInteger:s,smaller:f,smallerEq:p,larger:h});return t("quantileSeq",{"Array | Matrix, number | BigNumber":y,"Array | Matrix, number | BigNumber, number":(w,A,S)=>y(w,A,b(S)),"Array | Matrix, number | BigNumber, boolean":y,"Array | Matrix, number | BigNumber, boolean, number":(w,A,S,O)=>y(w,A,S,b(O)),"Array | Matrix, Array | Matrix":y,"Array | Matrix, Array | Matrix, number":(w,A,S)=>y(w,A,b(S)),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(w,A,S,O)=>y(w,A,S,b(O))});function b(w){return go([[],w])[1]}},{isTransformFunction:!0});g();x();v();var TH="cumsum",Xpe=["typed","add","unaryPlus"],OH=K(TH,Xpe,e=>{var{typed:t,add:r,unaryPlus:n}=e,i=Xw({typed:t,add:r,unaryPlus:n});return t(TH,{"...any":function(u){if(u.length===2&&xn(u[0])){var l=u[1];$t(l)?u[1]=l-1:kt(l)&&(u[1]=l.minus(1))}try{return i.apply(null,u)}catch(a){throw Jr(a)}}})},{isTransformFunction:!0});g();x();v();var IH="variance",Kpe=["typed","add","subtract","multiply","divide","apply","isNaN"],FH=K(IH,Kpe,e=>{var{typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l}=e,a=Jw({typed:t,add:r,subtract:n,multiply:i,divide:o,apply:u,isNaN:l});return t(IH,{"...any":function(f){f=go(f);try{return a.apply(null,f)}catch(p){throw Jr(p)}}})},{isTransformFunction:!0});g();x();v();var _H="print",Jpe=["typed","matrix","zeros","add"],kH=K(_H,Jpe,e=>{var{typed:t,matrix:r,zeros:n,add:i}=e,o=mw({typed:t,matrix:r,zeros:n,add:i});return t(_H,{"string, Object | Array":function(a,s){return o(u(a),s)},"string, Object | Array, number | Object":function(a,s,f){return o(u(a),s,f)}});function u(l){return l.replace(pw,a=>{var s=a.slice(1).split("."),f=s.map(function(p){return!isNaN(p)&&p.length>0?parseInt(p)-1:p});return"$"+f.join(".")})}},{isTransformFunction:!0});g();x();v();var Qpe="and",jpe=["typed","matrix","zeros","add","equalScalar","not","concat"],BH=K(Qpe,jpe,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=hw({typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u});function a(s,f,p){var h=s[0].compile().evaluate(p);if(!xn(h)&&!l(h,!0))return!1;var y=s[1].compile().evaluate(p);return l(h,y)}return a.rawArgs=!0,a},{isTransformFunction:!0});g();x();v();var eme="or",tme=["typed","matrix","equalScalar","DenseMatrix","concat"],LH=K(eme,tme,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=nw({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o});function l(a,s,f){var p=a[0].compile().evaluate(f);if(!xn(p)&&u(p,!1))return!0;var h=a[1].compile().evaluate(f);return u(p,h)}return l.rawArgs=!0,l},{isTransformFunction:!0});g();x();v();var rme="bitAnd",nme=["typed","matrix","zeros","add","equalScalar","not","concat"],PH=K(rme,nme,e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u}=e,l=tw({typed:t,matrix:r,equalScalar:n,zeros:i,not:o,concat:u});function a(s,f,p){var h=s[0].compile().evaluate(p);if(!xn(h)){if(isNaN(h))return NaN;if(h===0||h===!1)return 0}var y=s[1].compile().evaluate(p);return l(h,y)}return a.rawArgs=!0,a},{isTransformFunction:!0});g();x();v();var ime="bitOr",ome=["typed","matrix","equalScalar","DenseMatrix","concat"],RH=K(ime,ome,e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o}=e,u=rw({typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:o});function l(a,s,f){var p=a[0].compile().evaluate(f);if(!xn(p)){if(isNaN(p))return NaN;if(p===-1)return-1;if(p===!0)return 1}var h=a[1].compile().evaluate(f);return u(p,h)}return l.rawArgs=!0,l},{isTransformFunction:!0});g();x();v();g();x();v();var XA=ZA;g();x();v();var $H=ln(Dy(),1);g();x();v();var zH=ln(qH(),1);function UH(e){var t=new zH.default;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}g();x();v();function HH(e,t,r,n){function i(A,S){var O=arguments.length;if(O!==1&&O!==2)throw new ya("import",O,1,2);S||(S={});function M(P,R,q){if(Array.isArray(R))R.forEach(V=>M(P,V));else if(typeof R=="object")for(var U in R)Et(R,U)&&M(P,R[U],U);else if(cp(R)||q!==void 0){var H=cp(R)?b(R)?R.fn+".transform":R.fn:q;if(Et(P,H)&&P[H]!==R&&!S.silent)throw new Error('Cannot import "'+H+'" twice');P[H]=R}else if(!S.silent)throw new TypeError("Factory, Object, or Array expected")}var I={};M(I,A);for(var F in I)if(Et(I,F)){var C=I[F];if(cp(C))s(C,S);else if(f(C))o(F,C,S);else if(!S.silent)throw new TypeError("Factory, Object, or Array expected")}}function o(A,S,O){if(O.wrap&&typeof S=="function"&&(S=a(S)),p(S)&&(S=e(A,{[S.signature]:S})),e.isTypedFunction(r[A])&&e.isTypedFunction(S)){O.override?S=e(A,S.signatures):S=e(r[A],S),r[A]=S,delete n[A],u(A,S),r.emit("import",A,function(){return S});return}if(r[A]===void 0||O.override){r[A]=S,delete n[A],u(A,S),r.emit("import",A,function(){return S});return}if(!O.silent)throw new Error('Cannot import "'+A+'": already exists')}function u(A,S){S&&typeof S.transform=="function"?(r.expression.transform[A]=S.transform,h(A)&&(r.expression.mathWithTransform[A]=S.transform)):(delete r.expression.transform[A],h(A)&&(r.expression.mathWithTransform[A]=S))}function l(A){delete r.expression.transform[A],h(A)?r.expression.mathWithTransform[A]=r[A]:delete r.expression.mathWithTransform[A]}function a(A){var S=function(){for(var M=[],I=0,F=arguments.length;I2&&arguments[2]!==void 0?arguments[2]:A.fn;if(O.includes("."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(O));var M=b(A)?r.expression.transform:r,I=O in r.expression.transform,F=Et(M,O)?M[O]:void 0,C=function(){var R={};A.dependencies.map(hE).forEach(U=>{if(U.includes("."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(U));U==="math"?R.math=r:U==="mathWithTransform"?R.mathWithTransform=r.expression.mathWithTransform:U==="classes"?R.classes=r:R[U]=r[U]});var q=A(R);if(q&&typeof q.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = "expression.transform"');if(F===void 0||S.override)return q;if(e.isTypedFunction(F)&&e.isTypedFunction(q))return e(F,q);if(S.silent)return F;throw new Error('Cannot import "'+O+'": already exists')};!A.meta||A.meta.lazy!==!1?(lh(M,O,C),F&&I?l(O):(b(A)||y(A))&&lh(r.expression.mathWithTransform,O,()=>M[O])):(M[O]=C(),F&&I?l(O):(b(A)||y(A))&&lh(r.expression.mathWithTransform,O,()=>M[O])),n[O]=A,r.emit("import",O,C)}function f(A){return typeof A=="function"||typeof A=="number"||typeof A=="string"||typeof A=="boolean"||A===null||ui(A)||Ni(A)||kt(A)||da(A)||St(A)||Array.isArray(A)}function p(A){return typeof A=="function"&&typeof A.signature=="string"}function h(A){return!Et(w,A)}function y(A){return!A.fn.includes(".")&&!Et(w,A.fn)&&(!A.meta||!A.meta.isClass)}function b(A){return A!==void 0&&A.meta!==void 0&&A.meta.isTransformFunction===!0||!1}var w={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function rb(e,t){var r=Jn({},sy,t);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=UH({isNumber:$t,isComplex:Ni,isBigNumber:kt,isBigInt:uy,isFraction:da,isUnit:ui,isString:gn,isArray:pr,isMatrix:St,isCollection:xn,isDenseMatrix:gl,isSparseMatrix:ga,isRange:Af,isIndex:Du,isBoolean:ly,isResultSet:fy,isHelp:sh,isFunction:cy,isDate:py,isRegExp:my,isObject:Nu,isNull:hy,isUndefined:dy,isAccessorNode:Fo,isArrayNode:Si,isAssignmentNode:gy,isBlockNode:vy,isConditionalNode:xy,isConstantNode:or,isFunctionAssignmentNode:$a,isFunctionNode:eo,isIndexNode:Vo,isNode:cr,isObjectNode:Su,isOperatorNode:Xr,isParenthesisNode:Ei,isRangeNode:yy,isRelationalNode:wy,isSymbolNode:qr,isChain:uh});n.config=GI(r,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var i=[],o=[];function u(f){if(cp(f))return f(n);var p=f[Object.keys(f)[0]];if(cp(p))return p(n);if(!UI(f))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",f),new Error("Factory object with properties `type`, `name`, and `factory` expected");var h=i.indexOf(f),y;return h===-1?(f.math===!0?y=f.factory(n.type,r,u,n.typed,n):y=f.factory(n.type,r,u,n.typed),i.push(f),o.push(y)):y=o[h],y}var l={};function a(){for(var f=arguments.length,p=new Array(f),h=0;h{Object.values(l).forEach(f=>{f&&f.meta&&f.meta.recreateOnConfigChange&&s(f,{override:!0})})}),n.create=rb.bind(null,e),n.factory=K,n.import(Object.values(qI(e))),n.ArgumentsError=ya,n.DimensionError=Jt,n.IndexError=Mi,n}var Uh={};qa(Uh,{ABS:()=>Ehe,ACCRINT:()=>W0e,ACCRINTM:()=>V0e,ACOS:()=>Ahe,ACOSH:()=>Che,ACOT:()=>Mhe,ACOTH:()=>The,AGGREGATE:()=>Ohe,AMORDEGRC:()=>G0e,AMORLINC:()=>Y0e,AND:()=>U1e,ARABIC:()=>Ihe,ASC:()=>pge,ASIN:()=>Fhe,ASINH:()=>_he,ATAN:()=>khe,ATAN2:()=>Bhe,ATANH:()=>Lhe,AVEDEV:()=>Vme,AVERAGE:()=>Np,AVERAGEA:()=>fC,AVERAGEIF:()=>Gme,AVERAGEIFS:()=>Yme,BAHTTEXT:()=>mge,BASE:()=>Phe,BESSELI:()=>qge,BESSELJ:()=>zge,BESSELK:()=>Uge,BESSELY:()=>Hge,BETA:()=>Rv,BETADIST:()=>Eve,BETAINV:()=>Ave,BIN2DEC:()=>$ge,BIN2HEX:()=>Wge,BIN2OCT:()=>Vge,BINOM:()=>Rh,BINOMDIST:()=>Cve,BITAND:()=>Gge,BITLSHIFT:()=>Yge,BITOR:()=>Zge,BITRSHIFT:()=>Xge,BITXOR:()=>Kge,CEILING:()=>Al,CEILINGMATH:()=>Mve,CEILINGPRECISE:()=>Tve,CELL:()=>wme,CHAR:()=>v$,CHIDIST:()=>Ove,CHIDISTRT:()=>Ive,CHIINV:()=>Fve,CHIINVRT:()=>_ve,CHISQ:()=>Rs,CHITEST:()=>kve,CHOOSE:()=>kme,CLEAN:()=>hge,CODE:()=>x$,COLUMN:()=>Bme,COLUMNS:()=>Lme,COMBIN:()=>_h,COMBINA:()=>Rhe,COMPLEX:()=>yo,CONCAT:()=>dge,CONCATENATE:()=>y$,CONFIDENCE:()=>cC,CONVERT:()=>Jge,CORREL:()=>Zme,COS:()=>qhe,COSH:()=>zhe,COT:()=>Uhe,COTH:()=>Hhe,COUNT:()=>Bv,COUNTA:()=>Lv,COUNTBLANK:()=>a$,COUNTIF:()=>Xme,COUNTIFS:()=>Kme,COUPDAYBS:()=>Z0e,COUPDAYS:()=>X0e,COUPDAYSNC:()=>K0e,COUPNCD:()=>J0e,COUPNUM:()=>Q0e,COUPPCD:()=>j0e,COVAR:()=>Bve,COVARIANCE:()=>qh,COVARIANCEP:()=>Lve,COVARIANCES:()=>Pve,CRITBINOM:()=>Rve,CSC:()=>$he,CSCH:()=>Whe,CUMIPMT:()=>e1e,CUMPRINC:()=>t1e,DATE:()=>Kde,DATEDIF:()=>Pf,DATEVALUE:()=>Jde,DAVERAGE:()=>I0e,DAY:()=>Qde,DAYS:()=>Dp,DAYS360:()=>Rf,DB:()=>r1e,DBCS:()=>gge,DCOUNT:()=>F0e,DCOUNTA:()=>_0e,DDB:()=>n1e,DEC2BIN:()=>Qge,DEC2HEX:()=>jge,DEC2OCT:()=>eve,DECIMAL:()=>Vhe,DEGREES:()=>Ghe,DELTA:()=>tve,DEVSQ:()=>Jme,DGET:()=>k0e,DISC:()=>i1e,DMAX:()=>B0e,DMIN:()=>L0e,DOLLAR:()=>vge,DOLLARDE:()=>o1e,DOLLARFR:()=>a1e,DPRODUCT:()=>P0e,DSTDEV:()=>R0e,DSTDEVP:()=>q0e,DSUM:()=>z0e,DURATION:()=>s1e,DVAR:()=>U0e,DVARP:()=>H0e,EDATE:()=>jde,EFFECT:()=>u1e,EOMONTH:()=>ege,ERF:()=>NC,ERFC:()=>SC,ERFCPRECISE:()=>qve,ERFPRECISE:()=>zve,ERROR:()=>t$,EVEN:()=>Yhe,EXACT:()=>xge,EXP:()=>Zhe,EXPON:()=>pC,EXPONDIST:()=>Uve,F:()=>qs,FACT:()=>El,FACTDOUBLE:()=>h$,FALSE:()=>H1e,FDIST:()=>Hve,FDISTRT:()=>$ve,FIND:()=>yge,FINV:()=>Wve,FINVRT:()=>Vve,FISHER:()=>Qme,FISHERINV:()=>jme,FIXED:()=>w$,FLOOR:()=>Ap,FLOORMATH:()=>Gve,FLOORPRECISE:()=>Yve,FORECAST:()=>s$,FREQUENCY:()=>ehe,FTEST:()=>Zve,FV:()=>Cp,FVSCHEDULE:()=>l1e,GAMMA:()=>qv,GAMMADIST:()=>Xve,GAMMAINV:()=>Kve,GAMMALN:()=>mC,GAMMALNPRECISE:()=>Jve,GAUSS:()=>the,GCD:()=>Xhe,GEOMEAN:()=>rhe,GESTEP:()=>rve,GROWTH:()=>nhe,HARMEAN:()=>ihe,HEX2BIN:()=>nve,HEX2DEC:()=>ive,HEX2OCT:()=>ove,HLOOKUP:()=>Pme,HOUR:()=>tge,HYPGEOM:()=>hC,HYPGEOMDIST:()=>Qve,IF:()=>$1e,IFERROR:()=>V1e,IFNA:()=>G1e,IFS:()=>W1e,IMABS:()=>EC,IMAGINARY:()=>rn,IMARGUMENT:()=>AC,IMCONJUGATE:()=>ave,IMCOS:()=>wb,IMCOSH:()=>b$,IMCOT:()=>sve,IMCSC:()=>vve,IMCSCH:()=>xve,IMDIV:()=>Tp,IMEXP:()=>uve,IMLN:()=>lve,IMLOG10:()=>fve,IMLOG2:()=>cve,IMPOWER:()=>pve,IMPRODUCT:()=>mve,IMREAL:()=>nn,IMSEC:()=>hve,IMSECH:()=>dve,IMSIN:()=>bb,IMSINH:()=>D$,IMSQRT:()=>gve,IMSUB:()=>yve,IMSUM:()=>wve,IMTAN:()=>bve,INDEX:()=>Rme,INFO:()=>bme,INT:()=>Khe,INTERCEPT:()=>ohe,INTRATE:()=>f1e,IPMT:()=>E$,IRR:()=>c1e,ISBLANK:()=>Dme,ISERR:()=>r$,ISERROR:()=>gb,ISEVEN:()=>Nme,ISFORMULA:()=>Sme,ISLOGICAL:()=>n$,ISNA:()=>Eme,ISNONTEXT:()=>Ame,ISNUMBER:()=>vb,ISO:()=>Jhe,ISODD:()=>Cme,ISOWEEKNUM:()=>g$,ISPMT:()=>p1e,ISREF:()=>Mme,ISTEXT:()=>i$,KURT:()=>ahe,LARGE:()=>u$,LCM:()=>Qhe,LEFT:()=>wge,LEN:()=>bge,LINEST:()=>dC,LN:()=>jhe,LOG:()=>ede,LOG10:()=>tde,LOGEST:()=>she,LOGINV:()=>jve,LOGNORM:()=>zh,LOGNORMDIST:()=>e0e,LOGNORMINV:()=>t0e,LOOKUP:()=>qme,LOWER:()=>Dge,MATCH:()=>zme,MAX:()=>sb,MAXA:()=>uhe,MAXIFS:()=>lhe,MDURATION:()=>m1e,MEDIAN:()=>l$,MID:()=>Nge,MIN:()=>ub,MINA:()=>fhe,MINIFS:()=>che,MINUTE:()=>rge,MIRR:()=>h1e,MMULT:()=>rde,MOD:()=>nde,MODE:()=>Sp,MODEMULT:()=>r0e,MODESNGL:()=>n0e,MONTH:()=>nge,MROUND:()=>ide,MULTINOMIAL:()=>ode,MUNIT:()=>ade,N:()=>Tme,NA:()=>Ome,NEGBINOM:()=>gC,NEGBINOMDIST:()=>i0e,NETWORKDAYS:()=>xb,NETWORKDAYSINTL:()=>o0e,NOMINAL:()=>d1e,NORM:()=>zs,NORMDIST:()=>a0e,NORMINV:()=>s0e,NORMSDIST:()=>u0e,NORMSINV:()=>l0e,NOT:()=>Y1e,NOW:()=>ige,NPER:()=>g1e,NPV:()=>iC,NUMBERVALUE:()=>Sge,OCT2BIN:()=>Dve,OCT2DEC:()=>Nve,OCT2HEX:()=>Sve,ODD:()=>sde,ODDFPRICE:()=>v1e,ODDFYIELD:()=>x1e,ODDLPRICE:()=>y1e,ODDLYIELD:()=>w1e,OR:()=>Z1e,PDURATION:()=>b1e,PEARSON:()=>f$,PERCENTILE:()=>ba,PERCENTILEEXC:()=>f0e,PERCENTILEINC:()=>c0e,PERCENTRANK:()=>zv,PERCENTRANKEXC:()=>p0e,PERCENTRANKINC:()=>m0e,PERMUT:()=>phe,PERMUTATIONA:()=>mhe,PHI:()=>hhe,PI:()=>ude,PMT:()=>Hv,POISSON:()=>vC,POISSONDIST:()=>h0e,POWER:()=>d$,PPMT:()=>D1e,PRICE:()=>N1e,PRICEDISC:()=>S1e,PRICEMAT:()=>E1e,PROB:()=>dhe,PRODUCT:()=>lb,PRONETIC:()=>Ege,PROPER:()=>Age,PV:()=>A1e,QUARTILE:()=>Ep,QUARTILEEXC:()=>d0e,QUARTILEINC:()=>g0e,QUOTIENT:()=>lde,RADIANS:()=>fde,RAND:()=>cde,RANDBETWEEN:()=>pde,RANK:()=>Uv,RANKAVG:()=>v0e,RANKEQ:()=>x0e,RATE:()=>C1e,RECEIVED:()=>M1e,REPLACE:()=>Cge,REPT:()=>Na,RIGHT:()=>Mge,ROMAN:()=>mde,ROUND:()=>Mu,ROUNDDOWN:()=>hde,ROUNDUP:()=>dde,ROW:()=>ghe,ROWS:()=>Ume,RRI:()=>T1e,RSQ:()=>vhe,SEARCH:()=>Tge,SEC:()=>gde,SECH:()=>vde,SECOND:()=>oge,SERIESSUM:()=>xde,SHEET:()=>Ime,SHEETS:()=>Fme,SIGN:()=>yde,SIN:()=>wde,SINH:()=>bde,SKEW:()=>xC,SKEWP:()=>y0e,SLN:()=>O1e,SLOPE:()=>xhe,SMALL:()=>c$,SORT:()=>Hme,SQRT:()=>Dde,SQRTPI:()=>Nde,STANDARDIZE:()=>yhe,STDEV:()=>Ko,STDEVA:()=>whe,STDEVP:()=>w0e,STDEVPA:()=>bhe,STDEVS:()=>b0e,STEYX:()=>Dhe,SUBSTITUTE:()=>Oge,SUBTOTAL:()=>Sde,SUM:()=>Cl,SUMIF:()=>Ede,SUMIFS:()=>Ade,SUMPRODUCT:()=>Cde,SUMSQ:()=>Mde,SUMX2MY2:()=>Tde,SUMX2PY2:()=>Ode,SUMXMY2:()=>Ide,SWITCH:()=>J1e,SYD:()=>I1e,T:()=>Ige,TAN:()=>Fde,TANH:()=>_de,TBILLEQ:()=>F1e,TBILLPRICE:()=>_1e,TBILLYIELD:()=>k1e,TDIST:()=>D0e,TDISTRT:()=>N0e,TEXT:()=>Fge,TEXTJOIN:()=>_ge,TIME:()=>age,TIMEVALUE:()=>sge,TINV:()=>S0e,TODAY:()=>uge,TRANSPOSE:()=>$me,TREND:()=>Nhe,TRIM:()=>kge,TRIMMEAN:()=>She,TRUE:()=>X1e,TRUNC:()=>kde,TTEST:()=>E0e,TYPE:()=>_me,UNICHAR:()=>Bge,UNICODE:()=>Lge,UNIQUE:()=>lC,UPPER:()=>Pge,VALUE:()=>Rge,VAR:()=>_o,VARA:()=>p$,VARP:()=>A0e,VARPA:()=>m$,VARS:()=>C0e,VDB:()=>B1e,VLOOKUP:()=>o$,WEEKDAY:()=>lge,WEEKNUM:()=>fge,WEIBULL:()=>yC,WEIBULLDIST:()=>M0e,WORKDAY:()=>yb,WORKDAYINTL:()=>T0e,XIRR:()=>L1e,XNPV:()=>P1e,XOR:()=>K1e,YEAR:()=>cge,YEARFRAC:()=>bC,YIELD:()=>R1e,YIELDDISC:()=>q1e,YIELDMAT:()=>z1e,Z:()=>wC,ZTEST:()=>O0e,utils:()=>Q1e});g();x();v();var Mt=ln(VH(),1),Pv=ln(YH(),1),oC=new Error("#NULL!"),xo=new Error("#DIV/0!"),qe=new Error("#VALUE!"),kh=new Error("#REF!"),pb=new Error("#NAME?"),tt=new Error("#NUM!"),Qt=new Error("#N/A"),aC=new Error("#ERROR!"),XH=new Error("#GETTING_DATA"),sme=Object.freeze({__proto__:null,data:XH,div0:xo,error:aC,na:Qt,name:pb,nil:oC,num:tt,ref:kh,value:qe}),ume="=",lme=[">",">=","<","<=","=","<>"],KH="operator",JH="literal",fme=[KH,JH],ob=KH,qf=JH;function Sl(e,t){if(fme.indexOf(t)===-1)throw new Error("Unsupported token type: "+t);return{value:e,type:t}}function cme(e){return typeof e!="string"||/^\d+(\.\d+)?$/.test(e)&&(e=e.indexOf(".")===-1?parseInt(e,10):parseFloat(e)),e}function pme(e){let t=e.length,r=[],n=0,i="",o="";for(;n":case"<":case"=":o=o+u,i.length>0&&(r.push(i),i="");break;default:o.length>0&&(r.push(o),o=""),i=i+u;break}n++}return i.length>0&&r.push(i),o.length>0&&r.push(o),r}function mme(e){let t="",r=[];for(let n=0;n=0?r.push(Sl(i,ob)):t+=i}return t.length>0&&r.push(Sl(cme(t),qf)),r.length>0&&r[0].type!==ob&&r.unshift(Sl(ume,ob)),r}function hme(e){let t=[],r;for(let n=0;n":r=e[0]>e[1];break;case">=":r=e[0]>=e[1];break;case"<":r=e[0]":r=e[0]!=e[1];break}return r}function Bh(e){return mme(pme(e))}var Lh=hme;function mb(e){let t=[];return vo(e,r=>{t.push(r)}),t}function vo(e,t){let r=-1,n=e.length;for(;++rArray.isArray(i))||e.length===0)&&(e=[[...e]]),e.map((i,o)=>{i.map((u,l)=>{u||(e[o][l]=0)})});let r=e.reduce((i,o,u)=>o.length>e[i].length?u:i,0),n=e[r].length;return e.map(i=>[...i,...Array(n-i.length).fill(t||0)])}function gt(){let e;if(arguments.length===1){let t=arguments[0];e=vme(t)?mb.apply(null,arguments):[t]}else e=Array.from(arguments);for(;!xme(e);)e=nC(e);return e}function nC(e){return!e||!e.reduce?[e]:e.reduce((t,r)=>{let n=Array.isArray(t),i=Array.isArray(r);return n&&i?t.concat(r):n?(t.push(r),t):i?[t].concat(r):[t,r]})}function gme(e,t){return t=t||1,!e||typeof e.slice!="function"?e:e.slice(0,e.length-t)}function vme(e){return e!=null&&typeof e.length=="number"&&typeof e!="string"}function xme(e){if(!e)return!1;for(let t=0;te.map(n=>n[r])):qe}function Ka(e,t){let r=null;return vo(e,(n,i)=>{if(n[0]===t)return r=i,!1}),r??qe}function xr(){for(let e=0;etypeof t=="number")}function yme(e){e<60&&(e+=1);let r=Math.floor(e-25569)*86400,n=new Date(r*1e3),i=e-Math.floor(e)+1e-7,o=Math.floor(86400*i),u=o%60;o-=u;let l=Math.floor(o/(60*60)),a=Math.floor(o/60)%60,s=n.getUTCDate(),f=n.getUTCMonth();return e>=60&&e<61&&(s=29,f=1),new Date(n.getUTCFullYear(),f,s,l,a,u)}function uC(e){if(typeof e=="boolean"||e instanceof Error)return e;if(typeof e=="number")return e!==0;if(typeof e=="string"){let t=e.toUpperCase();if(t==="TRUE")return!0;if(t==="FALSE")return!1}return e instanceof Date&&!isNaN(e)?!0:qe}function br(e){if(!isNaN(e)){if(e instanceof Date)return new Date(e);let t=parseFloat(e);return t<0||t>=2958466?tt:yme(t)}return typeof e=="string"&&(e=/(\d{4})-(\d\d?)-(\d\d?)$/.test(e)?new Date(e+"T00:00:00.000"):new Date(e),!isNaN(e))?e:qe}function e$(e){let t=e.length,r;for(;t--;){if(r=br(e[t]),r===qe)return r;e[t]=r}return e}function ve(e){return e instanceof Error?e:e==null?0:(typeof e=="boolean"&&(e=+e),!isNaN(e)&&e!==""?parseFloat(e):qe)}function Ft(e){let t;if(!e||(t=e.length)===0)return qe;let r;for(;t--;){if(e[t]instanceof Error)return e[t];if(r=ve(e[t]),r instanceof Error)return r;e[t]=r}return e}function ei(e){return e instanceof Error?e:e==null?"":e.toString()}function hb(){let e=arguments.length;for(;e--;)if(typeof arguments[e]=="string")return!0;return!1}function db(){let e=mb(arguments),t=Ft(gt(e.shift()));if(t instanceof Error)return t;let r=e,n=r.length/2;for(let o=0;o{switch(e){case oC:return 1;case xo:return 2;case qe:return 3;case kh:return 4;case pb:return 5;case tt:return 6;case Qt:return 7;case XH:return 8}return Qt};function bme(){throw new Error("INFO is not implemented")}function Dme(e){return e===null}function r$(e){return[qe,kh,xo,tt,pb,oC].indexOf(e)>=0||typeof e=="number"&&(isNaN(e)||!isFinite(e))}function gb(e){return r$(e)||e===Qt}function Nme(e){return!(Math.floor(Math.abs(e))&1)}function Sme(){throw new Error("ISFORMULA is not implemented")}function n$(e){return e===!0||e===!1}function Eme(e){return e===Qt}function Ame(e){return typeof e!="string"}function vb(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function Cme(e){return!!(Math.floor(Math.abs(e))&1)}function Mme(){throw new Error("ISREF is not implemented")}function i$(e){return typeof e=="string"}function Tme(e){return vb(e)?e:e instanceof Date?e.getTime():e===!0?1:e===!1?0:gb(e)?e:0}function Ome(){return Qt}function Ime(){throw new Error("SHEET is not implemented")}function Fme(){throw new Error("SHEETS is not implemented")}function _me(e){if(vb(e))return 1;if(i$(e))return 2;if(n$(e))return 4;if(gb(e))return 16;if(Array.isArray(e))return 64}function kme(){if(arguments.length<2)return Qt;let e=arguments[0];return e<1||e>254||arguments.length0&&!Array.isArray(e[0]);return i&&!r?(r=t,t=1):(r=r||1,t=t||1),r<0||t<0?qe:i&&t===1&&r<=e.length?e[r-1]:t<=e.length&&r<=e[t-1].length?e[t-1][r-1]:kh}function qme(e,t,r){t=gt(t),r=r?gt(r):t;let n=typeof e=="number",i=Qt;for(let o=0;oe)return i}return i}function zme(e,t,r){if(!e&&e!==0||!t||(arguments.length===2&&(r=1),t=gt(t),!(t instanceof Array))||r!==-1&&r!==0&&r!==1)return Qt;let n,i;for(let o=0;oi&&(n=o+1,i=t[o]):(n=o+1,i=t[o]))}else if(r===0){if(typeof e=="string"&&typeof t[o]=="string"){let u=e.toLowerCase().replace(/\?/g,".").replace(/\*/g,".*").replace(/~/g,"\\").replace(/\+/g,"\\+").replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\[/g,"\\[").replace(/\]/g,"\\]");if(new RegExp("^"+u+"$").test(t[o].toLowerCase()))return o+1}else if(t[o]===e)return o+1}else if(r===-1){if(t[o]===e)return o+1;t[o]>e&&(i?t[o]l.sort((a,s)=>(a=ei(a[t-1]),s=ei(s[t-1]),r===1?as?r:r*-1)),o=QH(e),u=n?ab(o):o;return t>=1&&t<=u[0].length?n?ab(i(u)):i(u):qe}function $me(e){if(!e)return Qt;let t=QH(e);return ab(t)}function lC(){let e=[];for(let t=0;te&&(o=!0)}return i}var Wme=2.5066282746310002;function Vme(){let t=gt(arguments).filter(Ph);if(t.length===0)return tt;let r=Ft(t);return r instanceof Error?r:Mt.default.sum((0,Mt.default)(r).subtract(Mt.default.mean(r)).abs()[0])/r.length}function Np(){let t=gt(arguments).filter(Ph);if(t.length===0)return xo;let r=xr.apply(void 0,t);if(r)return r;let n=Mp(t),i=n.length,o=0,u=0,l;for(let a=0;an+i,0)/e.length;return isNaN(r)?0:r}var Rv={};Rv.DIST=function(e,t,r,n,i,o){return arguments.length<4||(i=i===void 0?0:i,o=o===void 0?1:o,e=ve(e),t=ve(t),r=ve(r),i=ve(i),o=ve(o),ft(e,t,r,i,o))?qe:(e=(e-i)/(o-i),n?Mt.default.beta.cdf(e,t,r):Mt.default.beta.pdf(e,t,r))};Rv.INV=(e,t,r,n,i)=>(n=n===void 0?0:n,i=i===void 0?1:i,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),ft(e,t,r,n,i)?qe:Mt.default.beta.inv(e,t,r)*(i-n)+n);var Rh={};Rh.DIST=(e,t,r,n)=>(e=ve(e),t=ve(t),r=ve(r),n=ve(n),ft(e,t,r,n)?qe:n?Mt.default.binomial.cdf(e,t,r):Mt.default.binomial.pdf(e,t,r));Rh.DIST.RANGE=(e,t,r,n)=>{if(n=n===void 0?r:n,e=ve(e),t=ve(t),r=ve(r),n=ve(n),ft(e,t,r,n))return qe;let i=0;for(let o=r;o<=n;o++)i+=_h(e,o)*Math.pow(t,o)*Math.pow(1-t,e-o);return i};Rh.INV=(e,t,r)=>{if(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r))return qe;let n=0;for(;n<=e;){if(Mt.default.binomial.cdf(n,e,t)>=r)return n;n++}};var Rs={};Rs.DIST=(e,t,r)=>(e=ve(e),t=ve(t),ft(e,t)?qe:r?Mt.default.chisquare.cdf(e,t):Mt.default.chisquare.pdf(e,t));Rs.DIST.RT=(e,t)=>!e|!t?Qt:e<1||t>Math.pow(10,10)?tt:typeof e!="number"||typeof t!="number"?qe:1-Mt.default.chisquare.cdf(e,t);Rs.INV=(e,t)=>(e=ve(e),t=ve(t),ft(e,t)?qe:Mt.default.chisquare.inv(e,t));Rs.INV.RT=(e,t)=>!e|!t?Qt:e<0||e>1||t<1||t>Math.pow(10,10)?tt:typeof e!="number"||typeof t!="number"?qe:Mt.default.chisquare.inv(1-e,t);Rs.TEST=function(e,t){if(arguments.length!==2)return Qt;if(!(e instanceof Array)||!(t instanceof Array)||e.length!==t.length||e[0]&&t[0]&&e[0].length!==t[0].length)return qe;let r=e.length,n,i,o;for(i=0;i=2;)y=y*p/b,b=b-2;let w=y,A=h;for(;w>1e-10*y;)A=A+2,w=w*p/A,y=y+w;return 1-y}return Math.round(f(a,l)*1e6)/1e6};var cC={};cC.NORM=(e,t,r)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:Mt.default.normalci(1,e,t,r)[1]-1);cC.T=(e,t,r)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:Mt.default.tci(1,e,t,r)[1]-1);function Zme(e,t){return e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t)?qe:Mt.default.corrcoeff(e,t)}function Bv(){let e=gt(arguments);return Mp(e).length}function Lv(){let e=gt(arguments);return e.length-a$(e)}function a$(){let e=gt(arguments),t=0,r;for(let n=0;n{if(e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t))return qe;let r=Mt.default.mean(e),n=Mt.default.mean(t),i=0,o=e.length;for(let u=0;u(e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t)?qe:Mt.default.covariance(e,t));function Jme(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=Mt.default.mean(e),r=0;for(let n=0;n(e=ve(e),t=ve(t),ft(e,t)?qe:r?Mt.default.exponential.cdf(e,t):Mt.default.exponential.pdf(e,t));var qs={};qs.DIST=(e,t,r,n)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:n?Mt.default.centralF.cdf(e,t,r):Mt.default.centralF.pdf(e,t,r));qs.DIST.RT=function(e,t,r){return arguments.length!==3?Qt:e<0||t<1||r<1?tt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:1-Mt.default.centralF.cdf(e,t,r)};qs.INV=(e,t,r)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:e<=0||e>1?tt:Mt.default.centralF.inv(e,t,r));qs.INV.RT=function(e,t,r){return arguments.length!==3?Qt:e<0||e>1||t<1||t>Math.pow(10,10)||r<1||r>Math.pow(10,10)?tt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:Mt.default.centralF.inv(1-e,t,r)};qs.TEST=(e,t)=>{if(!e||!t||!(e instanceof Array)||!(t instanceof Array))return Qt;if(e.length<2||t.length<2)return xo;let r=(l,a)=>{let s=0;for(let f=0;ft[o-1]&&e[u]<=t[o]&&(i[o]+=1):o===n&&e[u]>t[n-1]&&(i[n]+=1)}return i}function qv(e){return e=ve(e),e instanceof Error?e:e===0||parseInt(e,10)===e&&e<0?tt:Mt.default.gammafn(e)}qv.DIST=function(e,t,r,n){return arguments.length!==4?Qt:e<0||t<=0||r<=0||typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:n?Mt.default.gamma.cdf(e,t,r,!0):Mt.default.gamma.pdf(e,t,r,!1)};qv.INV=function(e,t,r){return arguments.length!==3?Qt:e<0||e>1||t<=0||r<=0?tt:typeof e!="number"||typeof t!="number"||typeof r!="number"?qe:Mt.default.gamma.inv(e,t,r)};function mC(e){return e=ve(e),e instanceof Error?e:Mt.default.gammaln(e)}mC.PRECISE=function(e){return arguments.length!==1?Qt:e<=0?tt:typeof e!="number"?qe:Mt.default.gammaln(e)};function the(e){return e=ve(e),e instanceof Error?e:Mt.default.normal.cdf(e,0,1)-.5}function rhe(){let e=Ft(gt(arguments));return e instanceof Error?e:Mt.default.geomean(e)}function nhe(e,t,r,n){if(e=Ft(gt(e)),e instanceof Error)return e;let i;if(t===void 0)for(t=[],i=1;i<=e.length;i++)t.push(i);if(r===void 0&&(r=t),t=Ft(gt(t)),r=Ft(gt(r)),ft(t,r))return qe;n===void 0&&(n=!0);let o=e.length,u=0,l=0,a=0,s=0;for(i=0;i{if(e=ve(e),t=ve(t),r=ve(r),n=ve(n),ft(e,t,r,n))return qe;function o(l,a,s,f){return _h(s,l)*_h(f-s,a-l)/_h(f,a)}function u(l,a,s,f){let p=0;for(let h=0;h<=l;h++)p+=o(h,a,s,f);return p}return i?u(e,t,r,n):o(e,t,r,n)};function ohe(e,t){return e=Ft(e),t=Ft(t),ft(e,t)?qe:e.length!==t.length?Qt:s$(0,e,t)}function ahe(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=Mt.default.mean(e),r=e.length,n=0;for(let i=0;ii-n)[t-1]))}function dC(e,t){if(e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t))return qe;let r=Mt.default.mean(e),n=Mt.default.mean(t),i=t.length,o=0,u=0;for(let s=0;s(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:n?Mt.default.lognormal.cdf(e,t,r):Mt.default.lognormal.pdf(e,t,r));zh.INV=(e,t,r)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:Mt.default.lognormal.inv(e,t,r));function sb(){let e=gt(arguments),t=xr.apply(void 0,e);if(t)return t;let r=Mp(e);return r.length===0?0:Math.max.apply(Math,r)}function uhe(){let e=gt(arguments),t=xr.apply(void 0,e);if(t)return t;let r=sC(e);return r=r.map(n=>n??0),r.length===0?0:Math.max.apply(Math,r)}function lhe(){let e=db(...arguments);return e.length===0?0:Math.max.apply(Math,e)}function l$(){let e=gt(arguments),t=xr.apply(void 0,e);if(t)return t;let r=sC(e),n=Mt.default.median(r);return isNaN(n)&&(n=tt),n}function ub(){let e=gt(arguments),t=xr.apply(void 0,e);if(t)return t;let r=Mp(e);return r.length===0?0:Math.min.apply(Math,r)}function fhe(){let e=gt(arguments),t=xr.apply(void 0,e);if(t)return t;let r=sC(e);return r=r.map(n=>n??0),r.length===0?0:Math.min.apply(Math,r)}function che(){let e=db(...arguments);return e.length===0?0:Math.min.apply(Math,e)}var Sp={};Sp.MULT=function(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=e.length,r={},n=[],i=0,o;for(let u=0;ui&&(i=r[o],n=[]),r[o]===i&&(n[n.length]=o);return n};Sp.SNGL=function(){let e=Ft(gt(arguments));return e instanceof Error?e:Sp.MULT(e).sort((t,r)=>t-r)[0]};var gC={};gC.DIST=(e,t,r,n)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:n?Mt.default.negbin.cdf(e,t,r):Mt.default.negbin.pdf(e,t,r));var zs={};zs.DIST=(e,t,r,n)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:r<=0?tt:n?Mt.default.normal.cdf(e,t,r):Mt.default.normal.pdf(e,t,r));zs.INV=(e,t,r)=>(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:Mt.default.normal.inv(e,t,r));zs.S={};zs.S.DIST=(e,t)=>(e=ve(e),e instanceof Error?qe:t?Mt.default.normal.cdf(e,0,1):Mt.default.normal.pdf(e,0,1));zs.S.INV=e=>(e=ve(e),e instanceof Error?qe:Mt.default.normal.inv(e,0,1));function f$(e,t){if(t=Ft(gt(t)),e=Ft(gt(e)),ft(t,e))return qe;let r=Mt.default.mean(e),n=Mt.default.mean(t),i=e.length,o=0,u=0,l=0;for(let a=0;a{if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;e=e.sort((o,u)=>o-u);let r=e.length;if(t<1/(r+1)||t>1-1/(r+1))return tt;let n=t*(r+1)-1,i=Math.floor(n);return jH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};ba.INC=(e,t)=>{if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;e=e.sort((o,u)=>o-u);let r=e.length,n=t*(r-1),i=Math.floor(n);return jH(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))};var zv={};zv.EXC=(e,t,r)=>{if(r=r===void 0?3:r,e=Ft(gt(e)),t=ve(t),r=ve(r),ft(e,t,r))return qe;e=e.sort((f,p)=>f-p);let n=lC.apply(null,e),i=e.length,o=n.length,u=Math.pow(10,r),l=0,a=!1,s=0;for(;!a&&s=n[s]&&(t{if(r=r===void 0?3:r,e=Ft(gt(e)),t=ve(t),r=ve(r),ft(e,t,r))return qe;e=e.sort((f,p)=>f-p);let n=lC.apply(null,e),i=e.length,o=n.length,u=Math.pow(10,r),l=0,a=!1,s=0;for(;!a&&s=n[s]&&(t(e=ve(e),t=ve(t),ft(e,t)?qe:r?Mt.default.poisson.cdf(e,t):Mt.default.poisson.pdf(e,t));function dhe(e,t,r,n){if(r===void 0)return 0;if(n=n===void 0?r:n,e=Ft(gt(e)),t=Ft(gt(t)),r=ve(r),n=ve(n),ft(e,t,r,n))return qe;if(r===n)return e.indexOf(r)>=0?t[e.indexOf(r)]:0;let i=e.sort((l,a)=>l-a),o=i.length,u=0;for(let l=0;l=r&&i[l]<=n&&(u+=t[e.indexOf(i[l])]);return u}var Ep={};Ep.EXC=(e,t)=>{if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;switch(t){case 1:return ba.EXC(e,.25);case 2:return ba.EXC(e,.5);case 3:return ba.EXC(e,.75);default:return tt}};Ep.INC=(e,t)=>{if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;switch(t){case 1:return ba.INC(e,.25);case 2:return ba.INC(e,.5);case 3:return ba.INC(e,.75);default:return tt}};var Uv={};Uv.AVG=(e,t,r)=>{if(e=ve(e),t=Ft(gt(t)),ft(e,t))return qe;t=gt(t),r=r||!1;let n=r?(u,l)=>u-l:(u,l)=>l-u;t=t.sort(n);let i=t.length,o=0;for(let u=0;u1?(2*t.indexOf(e)+o+1)/2:t.indexOf(e)+1};Uv.EQ=(e,t,r)=>{if(e=ve(e),t=Ft(gt(t)),ft(e,t))return qe;r=r||!1;let n=r?(i,o)=>i-o:(i,o)=>o-i;return t=t.sort(n),t.indexOf(e)+1};function ghe(e,t){if(arguments.length!==2)return Qt;if(t<0)return tt;if(!(e instanceof Array)||typeof t!="number")return qe;if(e.length!==0)return Mt.default.row(e,t)}function vhe(e,t){return e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t)?qe:Math.pow(f$(e,t),2)}function xC(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=Mt.default.mean(e),r=e.length,n=0;for(let i=0;ir-n)[t-1]}function yhe(e,t,r){return e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:(e-t)/r}var Ko={};Ko.P=function(){let e=_o.P.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=tt),t};Ko.S=function(){let e=_o.S.apply(this,arguments);return Math.sqrt(e)};function whe(){let e=p$.apply(this,arguments);return Math.sqrt(e)}function bhe(){let e=m$.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=tt),t}function Dhe(e,t){if(e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t))return qe;let r=Mt.default.mean(t),n=Mt.default.mean(e),i=t.length,o=0,u=0,l=0;for(let a=0;ar!==1&&r!==2?tt:r===1?Da.DIST.RT(e,t):Da.DIST["2T"](e,t);Da.DIST["2T"]=function(e,t){return arguments.length!==2?Qt:e<0||t<1?tt:typeof e!="number"||typeof t!="number"?qe:(1-Mt.default.studentt.cdf(e,t))*2};Da.DIST.RT=function(e,t){return arguments.length!==2?Qt:e<0||t<1?tt:typeof e!="number"||typeof t!="number"?qe:1-Mt.default.studentt.cdf(e,t)};Da.INV=(e,t)=>(e=ve(e),t=ve(t),ft(e,t)?qe:Mt.default.studentt.inv(e,t));Da.INV["2T"]=(e,t)=>(e=ve(e),t=ve(t),e<=0||e>1||t<1?tt:ft(e,t)?qe:Math.abs(Mt.default.studentt.inv(e/2,t)));Da.TEST=(e,t)=>{if(e=Ft(gt(e)),t=Ft(gt(t)),ft(e,t))return qe;let r=Mt.default.mean(e),n=Mt.default.mean(t),i=0,o=0,u;for(u=0;u{u.push(i*l+o)}),u}function She(e,t){if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;let r=Ap(e.length*t,2)/2;return Mt.default.mean(gme(wn(e.sort((n,i)=>n-i),r),r))}var _o={};_o.P=function(){let e=Mp(gt(arguments)),t=e.length,r=0,n=Np(e),i;for(let o=0;o(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r)?qe:n?1-Math.exp(-Math.pow(e/r,t)):Math.pow(e,t-1)*Math.exp(-Math.pow(e/r,t))*t/Math.pow(r,t));var wC={};wC.TEST=(e,t,r)=>{if(e=Ft(gt(e)),t=ve(t),ft(e,t))return qe;r=r||Ko.S(e);let n=e.length;return 1-zs.S.DIST((Np(e)-t)/(r/Math.sqrt(n)),!0)};function Ehe(e){return e=ve(e),e instanceof Error?e:Math.abs(e)}function Ahe(e){if(e=ve(e),e instanceof Error)return e;let t=Math.acos(e);return isNaN(t)&&(t=tt),t}function Che(e){if(e=ve(e),e instanceof Error)return e;let t=Math.log(e+Math.sqrt(e*e-1));return isNaN(t)&&(t=tt),t}function Mhe(e){return e=ve(e),e instanceof Error?e:Math.atan(1/e)}function The(e){if(e=ve(e),e instanceof Error)return e;let t=.5*Math.log((e+1)/(e-1));return isNaN(t)&&(t=tt),t}function Ohe(e,t,r,n){if(e=ve(e),t=ve(e),ft(e,t))return qe;switch(e){case 1:return Np(r);case 2:return Bv(r);case 3:return Lv(r);case 4:return sb(r);case 5:return ub(r);case 6:return lb(r);case 7:return Ko.S(r);case 8:return Ko.P(r);case 9:return Cl(r);case 10:return _o.S(r);case 11:return _o.P(r);case 12:return l$(r);case 13:return Sp.SNGL(r);case 14:return u$(r,n);case 15:return c$(r,n);case 16:return ba.INC(r,n);case 17:return Ep.INC(r,n);case 18:return ba.EXC(r,n);case 19:return Ep.EXC(r,n)}}function Ihe(e){if(e==null)return 0;if(e instanceof Error)return e;if(!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(e))return qe;let t=0;return e.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,r=>{t+={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}[r]}),t}function Fhe(e){if(e=ve(e),e instanceof Error)return e;let t=Math.asin(e);return isNaN(t)&&(t=tt),t}function _he(e){return e=ve(e),e instanceof Error?e:Math.log(e+Math.sqrt(e*e+1))}function khe(e){return e=ve(e),e instanceof Error?e:Math.atan(e)}function Bhe(e,t){e=ve(e),t=ve(t);let r=xr(e,t);return r||Math.atan2(e,t)}function Lhe(e){if(e=ve(e),e instanceof Error)return e;let t=Math.log((1+e)/(1-e))/2;return isNaN(t)&&(t=tt),t}function Phe(e,t,r){e=ve(e),t=ve(t),r=ve(r);let n=xr(e,t,r);if(n)return n;if(t===0)return tt;let i=e.toString(t);return new Array(Math.max(r+1-i.length,0)).join("0")+i}function Al(e,t,r){e=ve(e),t=ve(t),r=ve(r);let n=xr(e,t,r);if(n)return n;if(t===0)return 0;t=Math.abs(t);let i=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Mu(Math.ceil(e/t)*t,i):r===0?-Mu(Math.floor(Math.abs(e)/t)*t,i):-Mu(Math.ceil(Math.abs(e)/t)*t,i)}Al.MATH=Al;Al.PRECISE=Al;function _h(e,t){e=ve(e),t=ve(t);let r=xr(e,t);return r||(e1?aC:(e=ve(e),e instanceof Error||(e=Math.exp(e)),e)}var nb=[];function El(e){if(e=ve(e),e instanceof Error)return e;let t=Math.floor(e);return t===0||t===1?1:(nb[t]>0||(nb[t]=El(t-1)*t),nb[t])}function h$(e){if(e=ve(e),e instanceof Error)return e;let t=Math.floor(e);return t<=0?1:t*h$(t-2)}function Ap(e,t){e=ve(e),t=ve(t);let r=xr(e,t);if(r)return r;if(t===0)return 0;if(!(e>=0&&t>0)&&!(e<=0&&t<0))return tt;t=Math.abs(t);let n=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Mu(Math.floor(e/t)*t,n):-Mu(Math.ceil(Math.abs(e)/t),n)}Ap.MATH=(e,t,r)=>{if(t instanceof Error)return t;t=t===void 0?0:t,e=ve(e),t=ve(t),r=ve(r);let n=xr(e,t,r);if(n)return n;if(t===0)return 0;t=t?Math.abs(t):1;let i=-Math.floor(Math.log(t)/Math.log(10));return e>=0?Mu(Math.floor(e/t)*t,i):r===0||r===void 0?-Mu(Math.ceil(Math.abs(e)/t)*t,i):-Mu(Math.floor(Math.abs(e)/t)*t,i)};Ap.PRECISE=Ap.MATH;function Xhe(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=e.length,r=e[0],n=r<0?-r:r;for(let i=1;iu?n%=u:u%=n;n+=u}return n}function Khe(e){return e=ve(e),e instanceof Error?e:Math.floor(e)}var Jhe={CEILING:Al};function Qhe(){let e=Ft(gt(arguments));if(e instanceof Error)return e;for(var t,r,n,i,o=1;(n=e.pop())!==void 0;){if(n===0)return 0;for(;n>1;){if(n%2){for(t=3,r=Math.floor(Math.sqrt(n));t<=r&&n%t;t+=2);i=t<=r?t:n}else i=2;for(n/=i,o*=i,t=e.length;t;e[--t]%i===0&&(e[t]/=i)===1&&e.splice(t,1));}}return o}function jhe(e){return e=ve(e),e instanceof Error?e:e===0?tt:Math.log(e)}function ede(e,t){e=ve(e),t=ve(t);let r=xr(e,t);return r||(e===0||t===0?tt:Math.log(e)/Math.log(t))}function tde(e){return e=ve(e),e instanceof Error?e:e===0?tt:Math.log(e)/Math.log(10)}function rde(e,t){return!Array.isArray(e)||!Array.isArray(t)||e.some(n=>!n.length)||t.some(n=>!n.length)||nC(e).some(n=>typeof n!="number")||nC(t).some(n=>typeof n!="number")||e[0].length!==t.length?qe:Array(e.length).fill(0).map(()=>Array(t[0].length).fill(0)).map((n,i)=>n.map((o,u)=>e[i].reduce((l,a,s)=>l+a*t[s][u],0)))}function nde(e,t){e=ve(e),t=ve(t);let r=xr(e,t);if(r)return r;if(t===0)return xo;let n=Math.abs(e%t);return n=e<0?t-n:n,t>0?n:-n}function ide(e,t){e=ve(e),t=ve(t);let r=xr(e,t);return r||(e*t===0?0:e*t<0?tt:Math.round(e/t)*t)}function ode(){let e=Ft(gt(arguments));if(e instanceof Error)return e;let t=0,r=1;for(let n=0;n1?Qt:(e=parseInt(e),!e||e<=0?qe:Array(e).fill(0).map(()=>Array(e).fill(0)).map((t,r)=>(t[r]=1,t)))}function sde(e){if(e=ve(e),e instanceof Error)return e;let t=Math.ceil(Math.abs(e));return t=t&1?t:t+1,e>=0?t:-t}function ude(){return Math.PI}function d$(e,t){e=ve(e),t=ve(t);let r=xr(e,t);if(r)return r;if(e===0&&t===0)return tt;let n=Math.pow(e,t);return isNaN(n)?tt:n}function lb(){let t=gt(arguments).filter(i=>i!=null);if(t.length===0)return 0;let r=Ft(t);if(r instanceof Error)return r;let n=1;for(let i=0;i0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function dde(e,t){e=ve(e),t=ve(t);let r=xr(e,t);return r||(e>0?1:-1)*Math.ceil(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function gde(e){return e=ve(e),e instanceof Error?e:1/Math.cos(e)}function vde(e){return e=ve(e),e instanceof Error?e:2/(Math.exp(e)+Math.exp(-e))}function xde(e,t,r,n){if(e=ve(e),t=ve(t),r=ve(r),n=Ft(n),ft(e,t,r,n))return qe;let i=n[0]*Math.pow(e,t);for(let o=1;o{if(e instanceof Error)return!1;if(t instanceof Error)e=t;else if(typeof t=="number")e+=t;else if(typeof t=="string"){let r=parseFloat(t);!isNaN(r)&&(e+=r)}else if(Array.isArray(t)){let r=Cl.apply(null,t);r instanceof Error?e=r:e+=r}}),e}function Ede(e,t,r){if(e=gt(e),r=r?gt(r):e,e instanceof Error)return e;if(t==null||t instanceof Error)return 0;let n=0,i=t==="*",o=i?null:Bh(t+"");for(let u=0;u0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function Bde(e,t){if(arguments.length!==2)return Qt;e=ve(e),t=ve(t);let r=xr(e,t);return r||e+t}function Lde(e,t){if(arguments.length!==2)return Qt;e=ve(e),t=ve(t);let r=xr(e,t);return r||(t===0?xo:e/t)}function Pde(e,t){return arguments.length!==2?Qt:e instanceof Error?e:t instanceof Error?t:(e===null&&(e=void 0),t===null&&(t=void 0),e===t)}function Rde(e,t){if(arguments.length!==2)return Qt;if(e instanceof Error)return e;if(t instanceof Error)return t;hb(e,t)?(e=ei(e),t=ei(t)):(e=ve(e),t=ve(t));let r=xr(e,t);return r||e>t}function qde(e,t){if(arguments.length!==2)return Qt;hb(e,t)?(e=ei(e),t=ei(t)):(e=ve(e),t=ve(t));let r=xr(e,t);return r||e>=t}function zde(e,t){if(arguments.length!==2)return Qt;hb(e,t)?(e=ei(e),t=ei(t)):(e=ve(e),t=ve(t));let r=xr(e,t);return r||ei||l===i&&a28){let i=[31,28,31,30,31,30,31,31,30,31,30,31][n],o=e.getFullYear();n===1&&(o%4===0&&o%100!==0||o%400===0)&&(i=29),r=Math.min(r,i)}return e.setDate(r),e}function ege(e,t){return e=br(e),e instanceof Error?e:isNaN(t)?qe:(t=parseInt(t,10),new Date(e.getFullYear(),e.getMonth()+t+1,0))}function tge(e){return e=br(e),e instanceof Error?e:e.getHours()}function g$(e){if(e=br(e),e instanceof Error)return e;e=cb(e),e.setDate(e.getDate()+4-(e.getDay()||7));let t=new Date(e.getFullYear(),0,1);return Math.ceil(((e-t)/864e5+1)/7)}function rge(e){return e=br(e),e instanceof Error?e:e.getMinutes()}function nge(e){return e=br(e),e instanceof Error?e:e.getMonth()+1}function xb(e,t,r){return xb.INTL(e,t,1,r)}xb.INTL=(e,t,r,n)=>{if(e=br(e),e instanceof Error)return e;if(t=br(t),t instanceof Error)return t;let i=!1,o=[],u=[1,2,3,4,5,6,0],l=new RegExp("^[0|1]{7}$");if(r===void 0)r=fb[1];else if(typeof r=="string"&&l.test(r)){i=!0,r=r.split("");for(let p=0;p0?f.getUTCDay():f.getDay(),y=i?o.includes(h):h===r[0]||h===r[1];for(let b=0;b{if(e=br(e),e instanceof Error)return e;if(t=ve(t),t instanceof Error)return t;if(r===void 0?r=fb[1]:r=fb[r],!(r instanceof Array))return qe;n===void 0?n=[]:n instanceof Array||(n=[n]);for(let u=0;u{let A=b.getFullYear(),S=new Date(A,2,1);if(eC(A)&&b=S)return!0;let O=w.getFullYear(),M=new Date(O,2,1);return eC(O)&&w>=M&&bl||i===l&&n>=u))return(o===a&&eC(o)||s(e,t)||l===1&&u===29)&&(f=366),ib(e,t)/f;let p=a-o+1,y=(new Date(a+1,0,1)-new Date(o,0,1))/1e3/60/60/24/p;return ib(e,t)/y}case 2:return ib(e,t)/360;case 3:return ib(e,t)/365;case 4:return(u+l*30+a*360-(n+i*30+o*360))/360}}function ZH(e){let t=e>-22038912e5?2:1;return Math.ceil((e-Yde)/864e5)+t}function pge(){throw new Error("ASC is not implemented")}function mge(){throw new Error("BAHTTEXT is not implemented")}function v$(e){return e=ve(e),e===0?qe:e instanceof Error?e:String.fromCharCode(e)}function hge(e){if(ft(e))return e;e=e||"";let t=/[\0-\x1F]/g;return e.replace(t,"")}function x$(e){if(ft(e))return e;e=e||"";let t=e.charCodeAt(0);return isNaN(t)&&(t=qe),t}function y$(){let e=gt(arguments),t=xr.apply(void 0,e);if(t)return t;let r=0;for(;(r=e.indexOf(!0))>-1;)e[r]="TRUE";let n=0;for(;(n=e.indexOf(!1))>-1;)e[n]="FALSE";return e.join("")}var dge=y$;function gge(){throw new Error("DBCS is not implemented")}function vge(e,t=2){if(e=ve(e),isNaN(e))return qe;e=Mu(e,t);let r={style:"currency",currency:"USD",minimumFractionDigits:t>=0?t:0,maximumFractionDigits:t>=0?t:0},n=e.toLocaleString("en-US",r);return e<0?"$("+n.slice(2)+")":n}function xge(e,t){if(arguments.length!==2)return Qt;let r=xr(e,t);return r||(e=ei(e),t=ei(t),e===t)}function yge(e,t,r){if(arguments.length<2)return Qt;e=ei(e),t=ei(t),r=r===void 0?0:r;let n=t.indexOf(e,r-1);return n===-1?qe:n+1}function w$(e,t=2,r=!1){if(e=ve(e),isNaN(e)||(t=ve(t),isNaN(t)))return qe;if(t<0){let n=Math.pow(10,-t);e=Math.round(e/n)*n}else e=e.toFixed(t);if(r)e=e.toString().replace(/,/g,"");else{let n=e.toString().split(".");n[0]=n[0].replace(/\B(?=(\d{3})+$)/g,","),e=n.join(".")}return e}function wge(e,t){let r=xr(e,t);return r||(e=ei(e),t=t===void 0?1:t,t=ve(t),t instanceof Error||typeof e!="string"?qe:e.substring(0,t))}function bge(e){return arguments.length===0?aC:e instanceof Error?e:Array.isArray(e)?qe:ei(e).length}function Dge(e){return arguments.length!==1?qe:(e=ei(e),ft(e)?e:e.toLowerCase())}function Nge(e,t,r){if(t==null)return qe;if(t=ve(t),r=ve(r),ft(t,r)||typeof e!="string")return r;let n=t-1,i=n+r;return e.substring(n,i)}function Sge(e,t,r){return e=Ph(e)?e:"",typeof e=="number"?e:typeof e!="string"?Qt:(t=typeof t>"u"?".":t,r=typeof r>"u"?",":r,Number(e.replace(t,".").replace(r,"")))}function Ege(){throw new Error("PRONETIC is not implemented")}function Age(e){return ft(e)?e:isNaN(e)&&typeof e=="number"?qe:(e=ei(e),e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}function Cge(e,t,r,n){return t=ve(t),r=ve(r),ft(t,r)||typeof e!="string"||typeof n!="string"?qe:e.substr(0,t-1)+n+e.substr(t-1+r)}function Na(e,t){let r=xr(e,t);return r||(e=ei(e),t=ve(t),t instanceof Error?t:new Array(t+1).join(e))}function Mge(e,t){let r=xr(e,t);return r||(e=ei(e),t=t===void 0?1:t,t=ve(t),t instanceof Error?t:e.substring(e.length-t))}function Tge(e,t,r){let n;return typeof e!="string"||typeof t!="string"?qe:(r=r===void 0?0:r,n=t.toLowerCase().indexOf(e.toLowerCase(),r-1)+1,n===0?qe:n)}function Oge(e,t,r,n){if(arguments.length<3)return Qt;if(!e||!t)return e;if(n===void 0)return e.split(t).join(r);{if(n=Math.floor(Number(n)),Number.isNaN(n)||n<=0)return qe;let i=0,o=0;for(;i>-1&&e.indexOf(t,i)>-1;)if(i=e.indexOf(t,i+1),o++,i>-1&&o===n)return e.substring(0,i)+r+e.substring(i+t.length);return e}}function Ige(e){return e instanceof Error||typeof e=="string"?e:""}function Fge(e,t){if(e===void 0||e instanceof Error||t instanceof Error)return Qt;if(e instanceof Date)return e.toISOString().slice(0,10);if(t==null)return"";if(typeof t=="number")return String(t);if(typeof t!="string")return qe;let r=t.startsWith("$")?"$":"",n=t.endsWith("%");t=t.replace(/%/g,"").replace(/\$/g,"");let i=t.includes(".")?t.split(".")[1].match(/0/g).length:0,o=!t.includes(",");return n&&(e=e*100),e=w$(e,i,o),e.startsWith("-")?(e=e.replace("-",""),e="-"+r+e):e=r+e,n&&(e=e+"%"),e}function _ge(e,t,...r){if(typeof t!="boolean"&&(t=uC(t)),arguments.length<3)return Qt;e=e??"";let n=gt(r),i=t?n.filter(o=>o):n;if(Array.isArray(e)){e=gt(e);let o=i.map(l=>[l]),u=0;for(let l=0;l=n.length?Na("0",t-n.length)+n:tt)}function Vge(e,t){if(!DC(e))return tt;let r=e.toString();if(r.length===10&&r.substring(0,1)==="1")return(1073741312+parseInt(r.substring(1),2)).toString(8);let n=parseInt(e,2).toString(8);return t===void 0?n:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=n.length?Na("0",t-n.length)+n:tt)}function Gge(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?tt:e&t}function Yge(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?tt:t>=0?e<>-t}function Zge(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?tt:e|t}function Xge(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?tt:t>=0?e>>t:e<<-t}function Kge(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?tt:e^t}function yo(e,t,r){if(e=ve(e),t=ve(t),ft(e,t))return e;if(r=r===void 0?"i":r,r!=="i"&&r!=="j")return qe;if(e===0&&t===0)return 0;if(e===0)return t===1?r:t.toString()+r;if(t===0)return e.toString();{let n=t>0?"+":"";return e.toString()+n+(t===1?r:t.toString()+r)}}function Jge(e,t,r){if(e=ve(e),e instanceof Error)return e;let n=[["a.u. of action","?",null,"action",!1,!1,105457168181818e-48],["a.u. of charge","e",null,"electric_charge",!1,!1,160217653141414e-33],["a.u. of energy","Eh",null,"energy",!1,!1,435974417757576e-32],["a.u. of length","a?",null,"length",!1,!1,529177210818182e-25],["a.u. of mass","m?",null,"mass",!1,!1,910938261616162e-45],["a.u. of time","?/Eh",null,"time",!1,!1,241888432650516e-31],["admiralty knot","admkn",null,"speed",!1,!0,.514773333],["ampere","A",null,"electric_current",!0,!1,1],["ampere per meter","A/m",null,"magnetic_field_intensity",!0,!1,1],["\xE5ngstr\xF6m","\xC5",["ang"],"length",!1,!0,1e-10],["are","ar",null,"area",!1,!0,100],["astronomical unit","ua",null,"length",!1,!1,149597870691667e-25],["bar","bar",null,"pressure",!1,!1,1e5],["barn","b",null,"area",!1,!1,1e-28],["becquerel","Bq",null,"radioactivity",!0,!1,1],["bit","bit",["b"],"information",!1,!0,1],["btu","BTU",["btu"],"energy",!1,!0,1055.05585262],["byte","byte",null,"information",!1,!0,8],["candela","cd",null,"luminous_intensity",!0,!1,1],["candela per square metre","cd/m?",null,"luminance",!0,!1,1],["coulomb","C",null,"electric_charge",!0,!1,1],["cubic \xE5ngstr\xF6m","ang3",["ang^3"],"volume",!1,!0,1e-30],["cubic foot","ft3",["ft^3"],"volume",!1,!0,.028316846592],["cubic inch","in3",["in^3"],"volume",!1,!0,16387064e-12],["cubic light-year","ly3",["ly^3"],"volume",!1,!0,846786664623715e-61],["cubic metre","m3",["m^3"],"volume",!0,!0,1],["cubic mile","mi3",["mi^3"],"volume",!1,!0,416818182544058e-5],["cubic nautical mile","Nmi3",["Nmi^3"],"volume",!1,!0,6352182208],["cubic Pica","Pica3",["Picapt3","Pica^3","Picapt^3"],"volume",!1,!0,758660370370369e-22],["cubic yard","yd3",["yd^3"],"volume",!1,!0,.764554857984],["cup","cup",null,"volume",!1,!0,.0002365882365],["dalton","Da",["u"],"mass",!1,!1,166053886282828e-41],["day","d",["day"],"time",!1,!0,86400],["degree","\xB0",null,"angle",!1,!1,.0174532925199433],["degrees Rankine","Rank",null,"temperature",!1,!0,.555555555555556],["dyne","dyn",["dy"],"force",!1,!0,1e-5],["electronvolt","eV",["ev"],"energy",!1,!0,1.60217656514141],["ell","ell",null,"length",!1,!0,1.143],["erg","erg",["e"],"energy",!1,!0,1e-7],["farad","F",null,"electric_capacitance",!0,!1,1],["fluid ounce","oz",null,"volume",!1,!0,295735295625e-16],["foot","ft",null,"length",!1,!0,.3048],["foot-pound","flb",null,"energy",!1,!0,1.3558179483314],["gal","Gal",null,"acceleration",!1,!1,.01],["gallon","gal",null,"volume",!1,!0,.003785411784],["gauss","G",["ga"],"magnetic_flux_density",!1,!0,1],["grain","grain",null,"mass",!1,!0,647989e-10],["gram","g",null,"mass",!1,!0,.001],["gray","Gy",null,"absorbed_dose",!0,!1,1],["gross registered ton","GRT",["regton"],"volume",!1,!0,2.8316846592],["hectare","ha",null,"area",!1,!0,1e4],["henry","H",null,"inductance",!0,!1,1],["hertz","Hz",null,"frequency",!0,!1,1],["horsepower","HP",["h"],"power",!1,!0,745.69987158227],["horsepower-hour","HPh",["hh","hph"],"energy",!1,!0,2684519538e-3],["hour","h",["hr"],"time",!1,!0,3600],["imperial gallon (U.K.)","uk_gal",null,"volume",!1,!0,.00454609],["imperial hundredweight","lcwt",["uk_cwt","hweight"],"mass",!1,!0,50.802345],["imperial quart (U.K)","uk_qt",null,"volume",!1,!0,.0011365225],["imperial ton","brton",["uk_ton","LTON"],"mass",!1,!0,1016.046909],["inch","in",null,"length",!1,!0,.0254],["international acre","uk_acre",null,"area",!1,!0,4046.8564224],["IT calorie","cal",null,"energy",!1,!0,4.1868],["joule","J",null,"energy",!0,!0,1],["katal","kat",null,"catalytic_activity",!0,!1,1],["kelvin","K",["kel"],"temperature",!0,!0,1],["kilogram","kg",null,"mass",!0,!0,1],["knot","kn",null,"speed",!1,!0,.514444444444444],["light-year","ly",null,"length",!1,!0,9460730472580800],["litre","L",["l","lt"],"volume",!1,!0,.001],["lumen","lm",null,"luminous_flux",!0,!1,1],["lux","lx",null,"illuminance",!0,!1,1],["maxwell","Mx",null,"magnetic_flux",!1,!1,1e-18],["measurement ton","MTON",null,"volume",!1,!0,1.13267386368],["meter per hour","m/h",["m/hr"],"speed",!1,!0,.00027777777777778],["meter per second","m/s",["m/sec"],"speed",!0,!0,1],["meter per second squared","m?s??",null,"acceleration",!0,!1,1],["parsec","pc",["parsec"],"length",!1,!0,0x6da012f958ee1c],["meter squared per second","m?/s",null,"kinematic_viscosity",!0,!1,1],["metre","m",null,"length",!0,!0,1],["miles per hour","mph",null,"speed",!1,!0,.44704],["millimetre of mercury","mmHg",null,"pressure",!1,!1,133.322],["minute","?",null,"angle",!1,!1,.000290888208665722],["minute","min",["mn"],"time",!1,!0,60],["modern teaspoon","tspm",null,"volume",!1,!0,5e-6],["mole","mol",null,"amount_of_substance",!0,!1,1],["morgen","Morgen",null,"area",!1,!0,2500],["n.u. of action","?",null,"action",!1,!1,105457168181818e-48],["n.u. of mass","m?",null,"mass",!1,!1,910938261616162e-45],["n.u. of speed","c?",null,"speed",!1,!1,299792458],["n.u. of time","?/(me?c??)",null,"time",!1,!1,128808866778687e-35],["nautical mile","M",["Nmi"],"length",!1,!0,1852],["newton","N",null,"force",!0,!0,1],["\u0153rsted","Oe ",null,"magnetic_field_intensity",!1,!1,79.5774715459477],["ohm","\u03A9",null,"electric_resistance",!0,!1,1],["ounce mass","ozm",null,"mass",!1,!0,.028349523125],["pascal","Pa",null,"pressure",!0,!1,1],["pascal second","Pa?s",null,"dynamic_viscosity",!0,!1,1],["pferdest\xE4rke","PS",null,"power",!1,!0,735.49875],["phot","ph",null,"illuminance",!1,!1,1e-4],["pica (1/6 inch)","pica",null,"length",!1,!0,.00035277777777778],["pica (1/72 inch)","Pica",["Picapt"],"length",!1,!0,.00423333333333333],["poise","P",null,"dynamic_viscosity",!1,!1,.1],["pond","pond",null,"force",!1,!0,.00980665],["pound force","lbf",null,"force",!1,!0,4.4482216152605],["pound mass","lbm",null,"mass",!1,!0,.45359237],["quart","qt",null,"volume",!1,!0,.000946352946],["radian","rad",null,"angle",!0,!1,1],["second","?",null,"angle",!1,!1,484813681109536e-20],["second","s",["sec"],"time",!0,!0,1],["short hundredweight","cwt",["shweight"],"mass",!1,!0,45.359237],["siemens","S",null,"electrical_conductance",!0,!1,1],["sievert","Sv",null,"equivalent_dose",!0,!1,1],["slug","sg",null,"mass",!1,!0,14.59390294],["square \xE5ngstr\xF6m","ang2",["ang^2"],"area",!1,!0,1e-20],["square foot","ft2",["ft^2"],"area",!1,!0,.09290304],["square inch","in2",["in^2"],"area",!1,!0,64516e-8],["square light-year","ly2",["ly^2"],"area",!1,!0,895054210748189e17],["square meter","m?",null,"area",!0,!0,1],["square mile","mi2",["mi^2"],"area",!1,!0,2589988110336e-6],["square nautical mile","Nmi2",["Nmi^2"],"area",!1,!0,3429904],["square Pica","Pica2",["Picapt2","Pica^2","Picapt^2"],"area",!1,!0,1792111111111e-17],["square yard","yd2",["yd^2"],"area",!1,!0,.83612736],["statute mile","mi",null,"length",!1,!0,1609.344],["steradian","sr",null,"solid_angle",!0,!1,1],["stilb","sb",null,"luminance",!1,!1,1e-4],["stokes","St",null,"kinematic_viscosity",!1,!1,1e-4],["stone","stone",null,"mass",!1,!0,6.35029318],["tablespoon","tbs",null,"volume",!1,!0,147868e-10],["teaspoon","tsp",null,"volume",!1,!0,492892e-11],["tesla","T",null,"magnetic_flux_density",!0,!0,1],["thermodynamic calorie","c",null,"energy",!1,!0,4.184],["ton","ton",null,"mass",!1,!0,907.18474],["tonne","t",null,"mass",!1,!1,1e3],["U.K. pint","uk_pt",null,"volume",!1,!0,.00056826125],["U.S. bushel","bushel",null,"volume",!1,!0,.03523907],["U.S. oil barrel","barrel",null,"volume",!1,!0,.158987295],["U.S. pint","pt",["us_pt"],"volume",!1,!0,.000473176473],["U.S. survey mile","survey_mi",null,"length",!1,!0,1609.347219],["U.S. survey/statute acre","us_acre",null,"area",!1,!0,4046.87261],["volt","V",null,"voltage",!0,!1,1],["watt","W",null,"power",!0,!0,1],["watt-hour","Wh",["wh"],"energy",!1,!0,3600],["weber","Wb",null,"magnetic_flux",!0,!1,1],["yard","yd",null,"length",!1,!0,.9144],["year","yr",null,"time",!1,!0,31557600]],i={Yi:["yobi",80,12089258196146292e8,"Yi","yotta"],Zi:["zebi",70,11805916207174113e5,"Zi","zetta"],Ei:["exbi",60,1152921504606847e3,"Ei","exa"],Pi:["pebi",50,0x4000000000000,"Pi","peta"],Ti:["tebi",40,1099511627776,"Ti","tera"],Gi:["gibi",30,1073741824,"Gi","giga"],Mi:["mebi",20,1048576,"Mi","mega"],ki:["kibi",10,1024,"ki","kilo"]},o={Y:["yotta",1e24,"Y"],Z:["zetta",1e21,"Z"],E:["exa",1e18,"E"],P:["peta",1e15,"P"],T:["tera",1e12,"T"],G:["giga",1e9,"G"],M:["mega",1e6,"M"],k:["kilo",1e3,"k"],h:["hecto",100,"h"],e:["dekao",10,"e"],d:["deci",.1,"d"],c:["centi",.01,"c"],m:["milli",.001,"m"],u:["micro",1e-6,"u"],n:["nano",1e-9,"n"],p:["pico",1e-12,"p"],f:["femto",1e-15,"f"],a:["atto",1e-18,"a"],z:["zepto",1e-21,"z"],y:["yocto",1e-24,"y"]},u=null,l=null,a=t,s=r,f=1,p=1,h;for(let y=0;y=0)&&(u=n[y]),(n[y][1]===s||h.indexOf(s)>=0)&&(l=n[y]);if(u===null){let y=i[t.substring(0,2)],b=o[t.substring(0,1)];t.substring(0,2)==="da"&&(b=["dekao",10,"da"]),y?(f=y[2],a=t.substring(2)):b&&(f=b[1],a=t.substring(b[2].length));for(let w=0;w=0)&&(u=n[w])}if(l===null){let y=i[r.substring(0,2)],b=o[r.substring(0,1)];r.substring(0,2)==="da"&&(b=["dekao",10,"da"]),y?(p=y[2],s=r.substring(2)):b&&(p=b[1],s=r.substring(b[2].length));for(let w=0;w=0)&&(l=n[w])}return u===null||l===null||u[3]!==l[3]?Qt:e*u[6]*f/(l[6]*p)}function Qge(e,t){if(e=ve(e),e instanceof Error)return e;if(!/^-?[0-9]{1,3}$/.test(e)||e<-512||e>511)return tt;if(e<0)return"1"+Na("0",9-(512+e).toString(2).length)+(512+e).toString(2);let r=parseInt(e,10).toString(2);return typeof t>"u"?r:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=r.length?Na("0",t-r.length)+r:tt)}function jge(e,t){if(e=ve(e),e instanceof Error)return e;if(!/^-?[0-9]{1,12}$/.test(e)||e<-549755813888||e>549755813887)return tt;if(e<0)return(1099511627776+e).toString(16);let r=parseInt(e,10).toString(16);return typeof t>"u"?r:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=r.length?Na("0",t-r.length)+r:tt)}function eve(e,t){if(e=ve(e),e instanceof Error)return e;if(!/^-?[0-9]{1,9}$/.test(e)||e<-536870912||e>536870911)return tt;if(e<0)return(1073741824+e).toString(8);let r=parseInt(e,10).toString(8);return typeof t>"u"?r:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=r.length?Na("0",t-r.length)+r:tt)}function tve(e,t){return t=t===void 0?0:t,e=ve(e),t=ve(t),ft(e,t)?qe:e===t?1:0}function NC(e,t){return t=t===void 0?0:t,e=ve(e),t=ve(t),ft(e,t)?qe:Mt.default.erf(e)}NC.PRECISE=()=>{throw new Error("ERF.PRECISE is not implemented")};function SC(e){return isNaN(e)?qe:Mt.default.erfc(e)}SC.PRECISE=()=>{throw new Error("ERFC.PRECISE is not implemented")};function rve(e,t){return t=t||0,e=ve(e),ft(t,e)?e:e>=t?1:0}function nve(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return tt;let r=e.length===10&&e.substring(0,1).toLowerCase()==="f",n=r?parseInt(e,16)-1099511627776:parseInt(e,16);if(n<-512||n>511)return tt;if(r)return"1"+Na("0",9-(512+n).toString(2).length)+(512+n).toString(2);let i=n.toString(2);return t===void 0?i:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=i.length?Na("0",t-i.length)+i:tt)}function ive(e){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return tt;let t=parseInt(e,16);return t>=549755813888?t-1099511627776:t}function ove(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return tt;let r=parseInt(e,16);if(r>536870911&&r<0xffe0000000)return tt;if(r>=0xffe0000000)return(r-0xffc0000000).toString(8);let n=r.toString(8);return t===void 0?n:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=n.length?Na("0",t-n.length)+n:tt)}function EC(e){let t=nn(e),r=rn(e);return ft(t,r)?qe:Math.sqrt(Math.pow(t,2)+Math.pow(r,2))}function rn(e){if(e===void 0||e===!0||e===!1)return qe;if(e===0||e==="0")return 0;if(["i","j"].indexOf(e)>=0)return 1;e=e+"",e=e.replace("+i","+1i").replace("-i","-1i").replace("+j","+1j").replace("-j","-1j");let t=e.indexOf("+"),r=e.indexOf("-");t===0&&(t=e.indexOf("+",1)),r===0&&(r=e.indexOf("-",1));let n=e.substring(e.length-1,e.length),i=n==="i"||n==="j";return t>=0||r>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?tt:Number(e.substring(t+1,e.length-1)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?tt:-Number(e.substring(r+1,e.length-1)):tt:i?isNaN(e.substring(0,e.length-1))?tt:e.substring(0,e.length-1):isNaN(e)?tt:0}function AC(e){let t=nn(e),r=rn(e);return ft(t,r)?qe:t===0&&r===0?xo:t===0&&r>0?Math.PI/2:t===0&&r<0?-Math.PI/2:r===0&&t>0?0:r===0&&t<0?-Math.PI:t>0?Math.atan(r/t):t<0&&r>=0?Math.atan(r/t)+Math.PI:Math.atan(r/t)-Math.PI}function ave(e){let t=nn(e),r=rn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",r!==0?yo(t,-r,n):e}function wb(e){let t=nn(e),r=rn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",yo(Math.cos(t)*(Math.exp(r)+Math.exp(-r))/2,-Math.sin(t)*(Math.exp(r)-Math.exp(-r))/2,n)}function b$(e){let t=nn(e),r=rn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",yo(Math.cos(r)*(Math.exp(t)+Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)-Math.exp(-t))/2,n)}function sve(e){let t=nn(e),r=rn(e);return ft(t,r)?qe:Tp(wb(e),bb(e))}function Tp(e,t){let r=nn(e),n=rn(e),i=nn(t),o=rn(t);if(ft(r,n,i,o))return qe;let u=e.substring(e.length-1),l=t.substring(t.length-1),a="i";if((u==="j"||l==="j")&&(a="j"),i===0&&o===0)return tt;let s=i*i+o*o;return yo((r*i+n*o)/s,(n*i-r*o)/s,a)}function uve(e){let t=nn(e),r=rn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);n=n==="i"||n==="j"?n:"i";let i=Math.exp(t);return yo(i*Math.cos(r),i*Math.sin(r),n)}function lve(e){let t=nn(e),r=rn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",yo(Math.log(Math.sqrt(t*t+r*r)),Math.atan(r/t),n)}function fve(e){let t=nn(e),r=rn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",yo(Math.log(Math.sqrt(t*t+r*r))/Math.log(10),Math.atan(r/t)/Math.log(10),n)}function cve(e){let t=nn(e),r=rn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",yo(Math.log(Math.sqrt(t*t+r*r))/Math.log(2),Math.atan(r/t)/Math.log(2),n)}function pve(e,t){t=ve(t);let r=nn(e),n=rn(e);if(ft(t,r,n))return qe;let i=e.substring(e.length-1);i=i==="i"||i==="j"?i:"i";let o=Math.pow(EC(e),t),u=AC(e);return yo(o*Math.cos(t*u),o*Math.sin(t*u),i)}function mve(){let e=arguments[0];if(!arguments.length)return qe;for(let t=1;t=0)return 0;e=e+"";let t=e.indexOf("+"),r=e.indexOf("-");t===0&&(t=e.indexOf("+",1)),r===0&&(r=e.indexOf("-",1));let n=e.substring(e.length-1,e.length),i=n==="i"||n==="j";return t>=0||r>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?tt:Number(e.substring(0,t)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?tt:Number(e.substring(0,r)):tt:i?isNaN(e.substring(0,e.length-1))?tt:0:isNaN(e)?tt:e}function hve(e){if(e===!0||e===!1)return qe;let t=nn(e),r=rn(e);return ft(t,r)?qe:Tp("1",wb(e))}function dve(e){let t=nn(e),r=rn(e);return ft(t,r)?qe:Tp("1",b$(e))}function bb(e){let t=nn(e),r=rn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",yo(Math.sin(t)*(Math.exp(r)+Math.exp(-r))/2,Math.cos(t)*(Math.exp(r)-Math.exp(-r))/2,n)}function D$(e){let t=nn(e),r=rn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);return n=n==="i"||n==="j"?n:"i",yo(Math.cos(r)*(Math.exp(t)-Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)+Math.exp(-t))/2,n)}function gve(e){let t=nn(e),r=rn(e);if(ft(t,r))return qe;let n=e.substring(e.length-1);n=n==="i"||n==="j"?n:"i";let i=Math.sqrt(EC(e)),o=AC(e);return yo(i*Math.cos(o/2),i*Math.sin(o/2),n)}function vve(e){if(e===!0||e===!1)return qe;let t=nn(e),r=rn(e);return ft(t,r)?tt:Tp("1",bb(e))}function xve(e){if(e===!0||e===!1)return qe;let t=nn(e),r=rn(e);return ft(t,r)?tt:Tp("1",D$(e))}function yve(e,t){let r=nn(e),n=rn(e),i=nn(t),o=rn(t);if(ft(r,n,i,o))return qe;let u=e.substring(e.length-1),l=t.substring(t.length-1),a="i";return(u==="j"||l==="j")&&(a="j"),yo(r-i,n-o,a)}function wve(){if(!arguments.length)return qe;let e=gt(arguments),t=e[0];for(let r=1;r511)return tt;if(r)return"1"+Na("0",9-(512+n).toString(2).length)+(512+n).toString(2);let i=n.toString(2);return typeof t>"u"?i:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=i.length?Na("0",t-i.length)+i:tt)}function Nve(e){if(!/^[0-7]{1,10}$/.test(e))return tt;let t=parseInt(e,8);return t>=536870912?t-1073741824:t}function Sve(e,t){if(!/^[0-7]{1,10}$/.test(e))return tt;let r=parseInt(e,8);if(r>=536870912)return"ff"+(r+3221225472).toString(16);let n=r.toString(16);return t===void 0?n:isNaN(t)?qe:t<0?tt:(t=Math.floor(t),t>=n.length?Na("0",t-n.length)+n:tt)}var Eve=Rv.DIST,Ave=Rv.INV,Cve=Rh.DIST,Mve=Al.MATH,Tve=Al.PRECISE,Ove=Rs.DIST,Ive=Rs.DIST.RT,Fve=Rs.INV,_ve=Rs.INV.RT,kve=Rs.TEST,Bve=qh.P,Lve=qh.P,Pve=qh.S,Rve=Rh.INV,qve=SC.PRECISE,zve=NC.PRECISE,Uve=pC.DIST,Hve=qs.DIST,$ve=qs.DIST.RT,Wve=qs.INV,Vve=qs.INV.RT,Gve=Ap.MATH,Yve=Ap.PRECISE,Zve=qs.TEST,Xve=qv.DIST,Kve=qv.INV,Jve=mC.PRECISE,Qve=hC.DIST,jve=zh.INV,e0e=zh.DIST,t0e=zh.INV,r0e=Sp.MULT,n0e=Sp.SNGL,i0e=gC.DIST,o0e=xb.INTL,a0e=zs.DIST,s0e=zs.INV,u0e=zs.S.DIST,l0e=zs.S.INV,f0e=ba.EXC,c0e=ba.INC,p0e=zv.EXC,m0e=zv.INC,h0e=vC.DIST,d0e=Ep.EXC,g0e=Ep.INC,v0e=Uv.AVG,x0e=Uv.EQ,y0e=xC.P,w0e=Ko.P,b0e=Ko.S,D0e=Da.DIST,N0e=Da.DIST.RT,S0e=Da.INV,E0e=Da.TEST,A0e=_o.P,C0e=_o.S,M0e=yC.DIST,T0e=yb.INTL,O0e=wC.TEST;function CC(e){let t=[];return vo(e,r=>{r&&t.push(r)}),t}function Ja(e,t){let r={};for(let o=1;on&&(n=t[o].length);for(let o=1;o{o+=i[u]}),n.length===0?xo:o/n.length}function F0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),Bv(o)}function _0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),Lv(o)}function k0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let o=Ka(e,t);i=wn(e[o])}else i=wn(e[t]);return n.length===0?qe:n.length>1?tt:i[n[0]]}function B0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=i[n[0]];return vo(n,u=>{o{o>i[u]&&(o=i[u])}),o}function P0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let l=Ka(e,t);i=wn(e[l])}else i=wn(e[t]);let o=[];vo(n,l=>{o.push(i[l])}),o=CC(o);let u=1;return vo(o,l=>{u*=l}),u}function R0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),o=CC(o),Ko.S(o)}function q0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),o=CC(o),Ko.P(o)}function z0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),Cl(o)}function U0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),_o.S(o)}function H0e(e,t,r){if(isNaN(t)&&typeof t!="string")return qe;let n=Ja(e,r),i=[];if(typeof t=="string"){let u=Ka(e,t);i=wn(e[u])}else i=wn(e[t]);let o=[];return vo(n,u=>{o.push(i[u])}),_o.P(o)}function tC(e){return e&&e.getTime&&!isNaN(e.getTime())}function rC(e){return e instanceof Date?e:new Date(e)}function $0e(e,t,r){let n=br(t);for(n.setFullYear(e.getFullYear()),ne;)n.setMonth(n.getMonth()+-12/r);return n}function N$(e){return e=ve(e),[1,2,4].indexOf(e)===-1?tt:e}function S$(e){return e=ve(e),[0,1,2,3,4].indexOf(e)===-1?tt:e}function W0e(e,t,r,n,i,o,u){return e=rC(e),t=rC(t),r=rC(r),o=N$(o),u=S$(u),xr(o,u)?tt:!tC(e)||!tC(t)||!tC(r)?qe:n<=0||i<=0||r<=e?tt:(i=i||0,u=u||0,i*n*bC(e,r,u))}function V0e(){throw new Error("ACCRINTM is not implemented")}function G0e(){throw new Error("AMORDEGRC is not implemented")}function Y0e(){throw new Error("AMORLINC is not implemented")}function Z0e(){throw new Error("COUPDAYBS is not implemented")}function X0e(e,t,r,n){if(n=S$(n),r=N$(r),e=br(e),t=br(t),xr(e,t))return qe;if(xr(r,n)||e>=t)return tt;if(n===1){let o=$0e(e,t,r),u=br(o);return u.setMonth(u.getMonth()+12/r),Pf(o,u,"D")}let i;switch(n){case 0:case 2:case 4:i=360;break;case 3:i=365;break;default:return tt}return i/r}function K0e(){throw new Error("COUPDAYSNC is not implemented")}function J0e(){throw new Error("COUPNCD is not implemented")}function Q0e(){throw new Error("COUPNUM is not implemented")}function j0e(){throw new Error("COUPPCD is not implemented")}function e1e(e,t,r,n,i,o){if(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r))return qe;if(e<=0||t<=0||r<=0||n<1||i<1||n>i||o!==0&&o!==1)return tt;let u=Hv(e,t,r,0,o),l=0;n===1&&(o===0&&(l=-r),n++);for(let a=n;a<=i;a++)l+=o===1?Cp(e,a-2,u,r,1)-u:Cp(e,a-1,u,r,0);return l*=e,l}function t1e(e,t,r,n,i,o){if(e=ve(e),t=ve(t),r=ve(r),ft(e,t,r))return qe;if(e<=0||t<=0||r<=0||n<1||i<1||n>i||o!==0&&o!==1)return tt;let u=Hv(e,t,r,0,o),l=0;n===1&&(l=o===0?u+r*e:u,n++);for(let a=n;a<=i;a++)l+=o>0?u-(Cp(e,a-2,u,r,1)-u)*e:u-Cp(e,a-1,u,r,0)*e;return l}function r1e(e,t,r,n,i){if(i=i===void 0?12:i,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),ft(e,t,r,n,i))return qe;if(e<0||t<0||r<0||n<0||[1,2,3,4,5,6,7,8,9,10,11,12].indexOf(i)===-1||n>r)return tt;if(t>=e)return 0;let o=(1-Math.pow(t/e,1/r)).toFixed(3),u=e*o*i/12,l=u,a=0,s=n===r?r-1:n;for(let f=2;f<=s;f++)a=(e-l)*o,l+=a;return n===1?u:n===r?(e-l)*o:a}function n1e(e,t,r,n,i){if(i=i===void 0?2:i,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),ft(e,t,r,n,i))return qe;if(e<0||t<0||r<0||n<0||i<=0||n>r)return tt;if(t>=e)return 0;let o=0,u=0;for(let l=1;l<=n;l++)u=Math.min((e-o)*(i/r),e-t-o),o+=u;return u}function i1e(e,t,r,n,i){if(e=br(e),t=br(t),r=ve(r),n=ve(n),i=ve(i),i=i||0,ft(e,t,r,n,i))return qe;if(r<=0||n<=0)return tt;if(e>=t)return qe;let o,u;switch(i){case 0:o=360,u=Rf(e,t,!1);break;case 1:o=365,u=Pf(e,t,"D");break;case 2:o=360,u=Pf(e,t,"D");break;case 3:o=365,u=Pf(e,t,"D");break;case 4:o=360,u=Rf(e,t,!0);break;default:return tt}return(n-r)/n*o/u}function o1e(e,t){if(e=ve(e),t=ve(t),ft(e,t))return qe;if(t<0)return tt;if(t>=0&&t<1)return xo;t=parseInt(t,10);let r=parseInt(e,10);r+=e%1*Math.pow(10,Math.ceil(Math.log(t)/Math.LN10))/t;let n=Math.pow(10,Math.ceil(Math.log(t)/Math.LN2)+1);return r=Math.round(r*n)/n,r}function a1e(e,t){if(e=ve(e),t=ve(t),ft(e,t))return qe;if(t<0)return tt;if(t>=0&&t<1)return xo;t=parseInt(t,10);let r=parseInt(e,10);return r+=e%1*Math.pow(10,-Math.ceil(Math.log(t)/Math.LN10))*t,r}function s1e(){throw new Error("DURATION is not implemented")}function u1e(e,t){return e=ve(e),t=ve(t),ft(e,t)?qe:e<=0||t<1?tt:(t=parseInt(t,10),Math.pow(1+e/t,t)-1)}function Cp(e,t,r,n,i){if(n=n||0,i=i||0,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),ft(e,t,r,n,i))return qe;let o;if(e===0)o=n+r*t;else{let u=Math.pow(1+e,t);o=i===1?n*u+r*(1+e)*(u-1)/e:n*u+r*(u-1)/e}return-o}function l1e(e,t){if(e=ve(e),t=Ft(gt(t)),ft(e,t))return qe;let r=t.length,n=e;for(let i=0;i{let A=w+1,S=y[0];for(let O=1;O{let A=w+1,S=0;for(let O=1;O0&&(o=!0),e[y]<0&&(u=!0);if(!o||!u)return tt;t=t===void 0?.1:t;let l=t,a=1e-10,s,f,p,h=!0;do p=r(e,i,l),s=l-p/n(e,i,l),f=Math.abs(s-l),l=s,h=f>a&&Math.abs(p)>a;while(h);return l}function p1e(e,t,r,n){return e=ve(e),t=ve(t),r=ve(r),n=ve(n),ft(e,t,r,n)?qe:n*e*(t/r-1)}function m1e(){throw new Error("MDURATION is not implemented")}function h1e(e,t,r){if(e=Ft(gt(e)),t=ve(t),r=ve(r),ft(e,t,r))return qe;let n=e.length,i=[],o=[];for(let a=0;a=t)return qe;let o,u;switch(i){case 0:o=360,u=Rf(e,t,!1);break;case 1:o=365,u=Pf(e,t,"D");break;case 2:o=360,u=Pf(e,t,"D");break;case 3:o=365,u=Pf(e,t,"D");break;case 4:o=360,u=Rf(e,t,!0);break;default:return tt}return n-r*n*u/o}function E1e(){throw new Error("PRICEMAT is not implemented")}function A1e(e,t,r,n,i){return n=n||0,i=i||0,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),ft(e,t,r,n,i)?qe:e===0?-r*t-n:((1-Math.pow(1+e,t))/e*r*(1+e*i)-n)/Math.pow(1+e,t)}function C1e(e,t,r,n,i,o){if(o=o===void 0?.01:o,n=n===void 0?0:n,i=i===void 0?0:i,e=ve(e),t=ve(t),r=ve(r),n=ve(n),i=ve(i),o=ve(o),ft(e,t,r,n,i,o))return qe;let u=1e-10,l=20,a=o;i=i?1:0;for(let s=0;sr?tt:(n=parseInt(n,10),(e-t)*(r-n+1)*2/(r*(r+1)))}function F1e(e,t,r){return e=br(e),t=br(t),r=ve(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?tt:365*r/(360-r*Rf(e,t,!1))}function _1e(e,t,r){return e=br(e),t=br(t),r=ve(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?tt:100*(1-r*Rf(e,t,!1)/360)}function k1e(e,t,r){return e=br(e),t=br(t),r=ve(r),ft(e,t,r)?qe:r<=0||e>t||t-e>365*24*60*60*1e3?tt:(100-r)*360/(r*Rf(e,t,!1))}function B1e(){throw new Error("VDB is not implemented")}function L1e(e,t,r){if(e=Ft(gt(e)),t=e$(gt(t)),r=ve(r),ft(e,t,r))return qe;let n=(y,b,w)=>{let A=w+1,S=y[0];for(let O=1;O{let A=w+1,S=0;for(let O=1;O0&&(o=!0),e[y]<0&&(u=!0);if(!o||!u)return tt;r=r||.1;let l=r,a=1e-10,s,f,p,h=!0;do p=n(e,t,l),s=l-p/i(e,t,l),f=Math.abs(s-l),l=s,h=f>a&&Math.abs(p)>a;while(h);return l}function P1e(e,t,r){if(e=ve(e),t=Ft(gt(t)),r=e$(gt(r)),ft(e,t,r))return qe;let n=0;for(let i=0;i=2?t:!0,t==null&&(t=0),r=arguments.length===3?r:!1,r==null&&(r=0),e?t:r)}function W1e(){for(let e=0;e0){let t=arguments[0],r=arguments.length-1,n=Math.floor(r/2),i=!1,o=r%2!==0,u=r%2===0?null:arguments[arguments.length-1];if(n){for(let l=0;lUh));window.math=kr;var MC="D t",TC="ccc, D t",OC="D",IC="ccc, D";function Tu(){Ge.refreshCM&&Rt.refresh();let e="",t="",r=[],n=[],i=[],o=Nr.now().setLocale(Ge.settings.locale);if(Ge.mathScope={},Ge.mathScope.now=o.toFormat(Ge.settings.dateDay?TC:MC),Ge.mathScope.today=o.toFormat(Ge.settings.dateDay?IC:OC),Ve("#clearButton").setAttribute("disabled",Rt.getValue()===""),Ve("#copyButton").setAttribute("disabled",Rt.getValue()===""),Rt.eachLine(u=>{let l=Rt.getLineNumber(u),a=l+1,s="",f=u.text.trim().split("//")[0].split("#")[0];if(Rt.removeLineClass(u,"gutter","lineNoError"),Ge.settings.rulers?(Rt.removeLineClass(u,"wrap","noRuler"),Rt.addLineClass(u,"wrap","ruler")):(Rt.removeLineClass(u,"wrap","ruler"),Rt.addLineClass(u,"wrap","noRuler")),f)try{f=a>1&&f.charAt(0).match(/[+\-*/]/)&&Rt.getLine(a-2).length>0&&Ge.settings.contPrevLine?Ge.mathScope.ans+f:f,Ux()&&(f=f.replace(/[,;]/g,p=>p===","?".":",")),Ge.mathScope.avg=kr.evaluate(r.length>0?"("+kr.mean(r)+")":"0"),Ge.mathScope.total=kr.evaluate(n.length>0?"("+n.join("+")+")":"0"),Ge.mathScope.subtotal=kr.evaluate(i.length>0?"("+i.join("+")+")":"0");try{s=kr.evaluate(f,Ge.mathScope)}catch{s=j1e(f)}if(s||s===0){Ge.mathScope._=s,Ge.mathScope.ans=s,Ge.mathScope["line"+a]=s,typeof s=="number"&&(r.push(s),n.push(s),i.push(s)),s=kr.format(s,{notation:Ge.settings.notation,lowerExp:+Ge.settings.expLower,upperExp:+Ge.settings.expUpper});let p=s;if(s=$v(s,!1),t=$v(p,!0),s.match(/\w\(x\)/)){let h=(/\w\(x\)$/.test(s)&&f!=="ans"?f:s).replace(/\s+/g,"");Ge.mathScope.ans=h,Ge.mathScope["line"+a]=h,s=`Plot`}}else i.length=0,s=""}catch(p){Ge.settings.lineErrors&&(Rt.addLineClass(l,"gutter","lineNoError"),s=`Error`)}else i.length=0;e+=`
    ${s} -
    `}),Ve("#output").innerHTML=e,Ge.activePage){let u=Xt.get("pages"),l=u.find(a=>a.id===Ge.activePage);l.data=Rt.getValue(),l.history=Rt.getHistory(),Xt.set("pages",u)}}function eye(e){if(e.match(/:/))try{kr.evaluate(e.split(":")[0])}catch{e=e.substring(e.indexOf(":")+1)}let t=/[+-] * .* *(millisecond|second|minute|hour|day|week|month|quarter|year|decade|century|centuries|millennium|millennia)s?/g;if(e.match(t)){e=e.replace("now",Ge.mathScope.now).replace("today",Ge.mathScope.today);let i=e.replace(t,"").trim(),o=e.replace(i,"").trim(),u={locale:Ge.settings.locale},l=Nr.fromFormat(i,Ge.settings.dateDay?TC:MC,u),a=Nr.fromFormat(i,Ge.settings.dateDay?IC:OC,u),s=l.isValid?l:a.isValid?a:!1,f=String(kr.evaluate(o+" to hours",Ge.mathScope)),p=Number(f.split(" ")[0]);if(s)e=`"${s.plus({hours:p}).toFormat(l.isValid?Ge.settings.dateDay?TC:MC:Ge.settings.dateDay?IC:OC)}"`;else return"Invalid Date"}let r=/%[ ]*of[ ]*/g,n=/[\w.]*%[ ]*of[ ]*/g;return e.match(n)&&(e=e.replaceAll(r,"/100*")),kr.evaluate(e,Ge.mathScope)}function A$(e){let t=e.length;return e.charAt(0)==='"'&&(e=e.substring(1,t--)),e.charAt(--t)==='"'&&(e=e.substring(0,t)),e}function $v(e,t){if(e=String(e),["bin","hex","oct"].includes(Ge.settings.notation))return A$(e);let r=e.trim().split(" ")[0],n=e.replace(r,""),i={maximumFractionDigits:Ge.settings.precision,useGrouping:t?Ge.settings.copyThouSep:Ge.settings.thouSep};return!r.includes("e")&&!isNaN(r)?Number(r).toLocaleString(Ge.settings.locale,i)+n:r.match(/e[+-]?\d+/)&&!isNaN(r.split("e")[0])?Number(r.split("e")[0]).toLocaleString(Ge.settings.locale,i)+"e"+e.split("e")[1]:A$(e)}var Ea=rn(Vm(),1),Sa=rn(Hs(),1),z7t=rn(T$(),1),U7t=rn(Db(),1),H7t=rn(k$(),1),$7t=rn(P$(),1),W7t=rn(z$(),1),V7t=rn($$(),1),G7t=rn(G$(),1),Y7t=rn(J$(),1),Z7t=rn(kC(),1),Rt=Sa.default.fromTextArea(Ve("#inputArea"),{autofocus:!0,extraKeys:{"Ctrl-Space":"autocomplete",Tab:()=>{}},mode:"numara",singleCursorHeightPerLine:!1,smartIndent:!1,theme:"numara",viewportMargin:1/0}),Q$={autofocus:!0,autoCloseBrackets:!0,mode:"javascript",singleCursorHeightPerLine:!1,tabSize:2},zf=Sa.default.fromTextArea(Ve("#udfInput"),Q$),Uf=Sa.default.fromTextArea(Ve("#uduInput"),Q$);Sa.default.defineMode("numara",()=>({token:e=>{if(e.match(/\/\/.*/)||e.match(/#.*/))return"comment";if(e.match(/\d/))return"number";if(e.match(/(?:\+|-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||`|'|\^|\?|!|%)/))return"operator";e.eatWhile(/\w/);let t=e.current();if(Ge.settings.currency&&(t.toLowerCase()in Ge.currencyRates||t.toLowerCase()==="usd"))return"currency";if(typeof kr[t]=="function"&&Object.getOwnPropertyNames(kr[t]).includes("signatures"))return"function";if(Ge.udfList.includes(t))return"udf";if(Ge.uduList.includes(t))return"udu";if(t.match(/\b(?:_|ans|total|subtotal|avg|today|now)\b/))return"scope";if(t.match(/\b(?:line\d+)\b/))return"lineNo";if(typeof Hh[t]=="function")return"excel";try{let r=kr.evaluate(t),n=kr.parse(t);if(r.units&&r)return"unit";if(n.isSymbolNode&&r)return"constant"}catch{}try{kr.evaluate(t)}catch{return"variable"}return e.next(),"space"}}));Sa.default.defineMode("plain",()=>({token:e=>(e.next(),"text")}));var Nb=[],j$=[{text:"_",desc:"Answer from last calculated line."},{text:"ans",desc:"Answer from last calculated line."},{text:"avg",desc:"Average of previous line values. Numbers only."},{text:"now",desc:"Current date and time."},{text:"subtotal",desc:"Total of all lines in previous block. Numbers only."},{text:"today",desc:"Current date."},{text:"total",desc:"Total of previous line values. Numbers only."}];j$.forEach(e=>{e.className="cm-scope",Nb.push(e)});Object.getOwnPropertyNames(kr).forEach(e=>{typeof kr[e]=="function"&&Object.getOwnPropertyNames(kr[e]).includes("signatures")&&Nb.push({text:e,className:"cm-function"})});Object.keys(Hh).forEach(e=>{Nb.push({text:e,className:"cm-excel"})});Sa.default.commands.autocomplete=e=>{Sa.default.showHint(e,Sa.default.hint.numaraHints,{completeSingle:!1,extraKeys:{Enter:"newline"}})};Sa.default.registerHelper("hint","numaraHints",e=>{let t=e.getCursor(),r=e.getLine(t.line),n=t.ch,i=n;for(;il.match(u)).sort((l,a)=>l.text.localeCompare(a.text)):[],from:Sa.default.Pos(t.line,n),to:Sa.default.Pos(t.line,i)}});Rt.on("changes",Qa);Rt.on("inputRead",e=>{Ge.settings.autocomplete&&Sa.default.commands.autocomplete(e)});Rt.on("cursorActivity",e=>{e.eachLine(t=>{let r=e.getLineNumber(t),n=e.getCursor().line;r===n?e.addLineClass(r,"gutter","activeLine"):e.removeLineClass(r,"gutter","activeLine")})});var ja=e=>e.nodeName.toLowerCase()==="li"?"right":"top-left";Rt.on("update",()=>{let e=Kn(".cm-function");if(e.length>0&&Ge.settings.keywordTips)for(let f of e)try{let p=JSON.parse(JSON.stringify(kr.help(f.innerText).toJSON()));Ea.default.tooltip(f,{pos:ja(f),title:p.description})}catch{Ea.default.tooltip(f,{pos:ja(f),title:"Description not available"})}let t=Kn(".cm-udf");if(t.length>0&&Ge.settings.keywordTips)for(let f of t)Ea.default.tooltip(f,{pos:ja(f),title:"User defined function"});let r=Kn(".cm-udu");if(r.length>0&&Ge.settings.keywordTips)for(let f of r)Ea.default.tooltip(f,{pos:ja(f),title:"User defined unit"});let n=Kn(".cm-currency");if(n.length>0&&Ge.settings.keywordTips)for(let f of n)try{let p=f.innerText.toLowerCase(),h=p==="usd"?"U.S. Dollar":Ge.currencyRates[p].name;Ea.default.tooltip(f,{pos:ja(f),title:h})}catch{Ea.default.tooltip(f,{pos:ja(f),title:"Description not available"})}let i=Kn(".cm-unit");if(i.length>0&&Ge.settings.keywordTips)for(let f of i)Ea.default.tooltip(f,{pos:ja(f),title:`Unit '${f.innerText}'`});let o=Kn(".cm-constant");if(o.length>0&&Ge.settings.keywordTips)for(let f of o)try{Ea.default.tooltip(f,{pos:ja(f),title:kr.help(f.innerText).doc.description+" (Constant)"})}catch{}let u=Kn(".cm-variable");if(u.length>0&&Ge.settings.keywordTips){for(let f of u)if(Ge.mathScope[f.innerText]&&typeof Ge.mathScope[f.innerText]!="function"){let p;try{p=$v(kr.evaluate(f.innerText,Ge.mathScope))}catch{p="Undefined"}Ea.default.tooltip(f,{pos:ja(f),title:p})}}let l=Kn(".cm-lineNo");if(l.length>0&&Ge.settings.keywordTips)for(let f of l){let p;try{p=typeof Ge.mathScope[f.innerText]=="function"?"Function":$v(kr.evaluate(f.innerText,Ge.mathScope))}catch{p="Undefined"}Ea.default.tooltip(f,{pos:ja(f),title:p})}let a=Kn(".cm-scope");if(a.length>0&&Ge.settings.keywordTips)for(let f of a)Ea.default.tooltip(f,{pos:ja(f),title:j$.filter(p=>f.innerText===p.text)[0].desc});let s=Kn(".cm-excel");if(s.length>0&&Ge.settings.keywordTips)for(let f of s)Ea.default.tooltip(f,{pos:ja(f),title:"Excel function"})});Rt.on("cursorActivity",e=>{let t=Xt.get("pages"),r=t.find(n=>n.id==Ge.activePage);r.cursor=e.getCursor(),Xt.set("pages",t)});function tye(){setTimeout(()=>{let e=Rt.getCursor().line,t=Rt.getLine(e),r=Ve("#output").children[e].innerText,n=Rt.getValue()==="",i=t.length>0,o=Rt.somethingSelected(),u=Rt.listSelections().length>1||Rt.listSelections()[0].anchor.line!==Rt.listSelections()[0].head.line,l=r!==""&&r!=="Error"&&r!=="Plot";numara.inputContextMenu(e,n,i,o,u,l)},20)}function rye(e){let t=e.srcElement.innerText,r=e.srcElement.dataset.line||e.srcElement.parentElement.dataset.line||Rt.lastLine(),n=r!==null&&t!==""&&t!=="Error"&&t!=="Plot",i=Rt.getValue()==="";numara.outputContextMenu(r,i,n)}function BC(){setTimeout(()=>{numara.textboxContextMenu()},20)}function nye(e,t){t=+t;let r=Rt.getLine(t).trim();navigator.clipboard.writeText(r).then(Rn(`Copied Line ${t+1} to clipboard.`))}function eW(e,t,r){t=+t;let n=Rt.getLine(t).trim(),i=Ve("#output").children[t].children[0].dataset.copy,o=r?`${n} = ${i}`:`${i}`;navigator.clipboard.writeText(o).then(Rn(r?`Copied Line ${t+1} with answer to clipboard.`:`Copied '${i}' to clipboard.`))}function iye(){Rt.getValue()===""?Rn("Nothing to copy."):navigator.clipboard.writeText(Rt.getValue()).then(Rn("Copied all lines to clipboard."))}function oye(){if(Rt.getValue()==="")Rn("Nothing to copy.");else{let e="";Rt.eachLine(t=>{let r=Rt.getLineNumber(t);e+=`${Ve("#output").children[r].innerText} +
    `}),Ve("#output").innerHTML=e,Ge.activePage){let u=Xt.get("pages"),l=u.find(a=>a.id===Ge.activePage);l.data=Rt.getValue(),l.history=Rt.getHistory(),Xt.set("pages",u)}}function j1e(e){if(e.match(/:/))try{kr.evaluate(e.split(":")[0])}catch{e=e.substring(e.indexOf(":")+1)}let t=/[+-] * .* *(millisecond|second|minute|hour|day|week|month|quarter|year|decade|century|centuries|millennium|millennia)s?/g;if(e.match(t)){e=e.replace("now",Ge.mathScope.now).replace("today",Ge.mathScope.today);let i=e.replace(t,"").trim(),o=e.replace(i,"").trim(),u={locale:Ge.settings.locale},l=Nr.fromFormat(i,Ge.settings.dateDay?TC:MC,u),a=Nr.fromFormat(i,Ge.settings.dateDay?IC:OC,u),s=l.isValid?l:a.isValid?a:!1,f=String(kr.evaluate(o+" to hours",Ge.mathScope)),p=Number(f.split(" ")[0]);if(s)e=`"${s.plus({hours:p}).toFormat(l.isValid?Ge.settings.dateDay?TC:MC:Ge.settings.dateDay?IC:OC)}"`;else return"Invalid Date"}let r=/%[ ]*of[ ]*/g,n=/[\w.]*%[ ]*of[ ]*/g;return e.match(n)&&(e=e.replaceAll(r,"/100*")),kr.evaluate(e,Ge.mathScope)}function A$(e){let t=e.length;return e.charAt(0)==='"'&&(e=e.substring(1,t--)),e.charAt(--t)==='"'&&(e=e.substring(0,t)),e}function $v(e,t){if(e=String(e),["bin","hex","oct"].includes(Ge.settings.notation))return A$(e);let r=e.trim().split(" ")[0],n=e.replace(r,""),i={maximumFractionDigits:Ge.settings.precision,useGrouping:t?Ge.settings.copyThouSep:Ge.settings.thouSep};return!r.includes("e")&&!isNaN(r)?Number(r).toLocaleString(Ge.settings.locale,i)+n:r.match(/e[+-]?\d+/)&&!isNaN(r.split("e")[0])?Number(r.split("e")[0]).toLocaleString(Ge.settings.locale,i)+"e"+e.split("e")[1]:A$(e)}var Sa=ln(Wg(),1),Ea=ln(Us(),1),z7t=ln(T$(),1),U7t=ln(Db(),1),H7t=ln(k$(),1),$7t=ln(P$(),1),W7t=ln(z$(),1),V7t=ln($$(),1),G7t=ln(G$(),1),Y7t=ln(J$(),1),Z7t=ln(kC(),1),Rt=Ea.default.fromTextArea(Ve("#inputArea"),{autofocus:!0,extraKeys:{"Ctrl-Space":"autocomplete",Tab:()=>{}},mode:"numara",singleCursorHeightPerLine:!1,smartIndent:!1,theme:"numara",viewportMargin:1/0}),Q$={autofocus:!0,autoCloseBrackets:!0,mode:"javascript",singleCursorHeightPerLine:!1,tabSize:2},zf=Ea.default.fromTextArea(Ve("#udfInput"),Q$),Uf=Ea.default.fromTextArea(Ve("#uduInput"),Q$);Ea.default.defineMode("numara",()=>({token:e=>{if(e.match(/\/\/.*/)||e.match(/#.*/))return"comment";if(e.match(/\d/))return"number";if(e.match(/(?:\+|-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||`|'|\^|\?|!|%)/))return"operator";e.eatWhile(/\w/);let t=e.current();if(Ge.settings.currency&&(t.toLowerCase()in Ge.currencyRates||t.toLowerCase()==="usd"))return"currency";if(typeof kr[t]=="function"&&Object.getOwnPropertyNames(kr[t]).includes("signatures"))return"function";if(Ge.udfList.includes(t))return"udf";if(Ge.uduList.includes(t))return"udu";if(t.match(/\b(?:_|ans|total|subtotal|avg|today|now)\b/))return"scope";if(t.match(/\b(?:line\d+)\b/))return"lineNo";if(typeof Uh[t]=="function")return"excel";try{let r=kr.evaluate(t),n=kr.parse(t);if(r.units&&r)return"unit";if(n.isSymbolNode&&r)return"constant"}catch{}try{kr.evaluate(t)}catch{return"variable"}return e.next(),"space"}}));Ea.default.defineMode("plain",()=>({token:e=>(e.next(),"text")}));var Nb=[],j$=[{text:"_",desc:"Answer from last calculated line."},{text:"ans",desc:"Answer from last calculated line."},{text:"avg",desc:"Average of previous line values. Numbers only."},{text:"now",desc:"Current date and time."},{text:"subtotal",desc:"Total of all lines in previous block. Numbers only."},{text:"today",desc:"Current date."},{text:"total",desc:"Total of previous line values. Numbers only."}];j$.forEach(e=>{e.className="cm-scope",Nb.push(e)});Object.getOwnPropertyNames(kr).forEach(e=>{typeof kr[e]=="function"&&Object.getOwnPropertyNames(kr[e]).includes("signatures")&&Nb.push({text:e,className:"cm-function"})});Object.keys(Uh).forEach(e=>{Nb.push({text:"xls."+e,className:"cm-excel"})});Ea.default.registerHelper("hint","numaraHints",e=>{let t=e.getCursor(),r=e.getLine(t.line),n=t.ch,i=n;for(;ia.match(l)).sort((a,s)=>a.text.localeCompare(s.text)):[],from:Ea.default.Pos(t.line,n),to:Ea.default.Pos(t.line,i)}});Ea.default.commands.autocomplete=e=>{Ea.default.showHint(e,Ea.default.hint.numaraHints,{completeSingle:!1,extraKeys:{Enter:"newline",Tab:()=>{}}})};Rt.on("changes",Tu);Rt.on("inputRead",e=>{Ge.settings.autocomplete&&Ea.default.commands.autocomplete(e)});Rt.on("cursorActivity",e=>{e.eachLine(t=>{let r=e.getLineNumber(t),n=e.getCursor().line;r===n?e.addLineClass(r,"gutter","activeLine"):e.removeLineClass(r,"gutter","activeLine")})});var Qa=e=>e.nodeName.toLowerCase()==="li"?"right":"top-left";Rt.on("update",()=>{let e=Kn(".cm-function");if(e.length>0&&Ge.settings.keywordTips)for(let f of e)try{let p=JSON.parse(JSON.stringify(kr.help(f.innerText).toJSON()));Sa.default.tooltip(f,{pos:Qa(f),title:p.description})}catch{Sa.default.tooltip(f,{pos:Qa(f),title:"Description not available"})}let t=Kn(".cm-udf");if(t.length>0&&Ge.settings.keywordTips)for(let f of t)Sa.default.tooltip(f,{pos:Qa(f),title:"User defined function"});let r=Kn(".cm-udu");if(r.length>0&&Ge.settings.keywordTips)for(let f of r)Sa.default.tooltip(f,{pos:Qa(f),title:"User defined unit"});let n=Kn(".cm-currency");if(n.length>0&&Ge.settings.keywordTips)for(let f of n)try{let p=f.innerText.toLowerCase(),h=p==="usd"?"U.S. Dollar":Ge.currencyRates[p].name;Sa.default.tooltip(f,{pos:Qa(f),title:h})}catch{Sa.default.tooltip(f,{pos:Qa(f),title:"Description not available"})}let i=Kn(".cm-unit");if(i.length>0&&Ge.settings.keywordTips)for(let f of i)Sa.default.tooltip(f,{pos:Qa(f),title:`Unit '${f.innerText}'`});let o=Kn(".cm-constant");if(o.length>0&&Ge.settings.keywordTips)for(let f of o)try{Sa.default.tooltip(f,{pos:Qa(f),title:kr.help(f.innerText).doc.description+" (Constant)"})}catch{}let u=Kn(".cm-variable");if(u.length>0&&Ge.settings.keywordTips){for(let f of u)if(Ge.mathScope[f.innerText]&&typeof Ge.mathScope[f.innerText]!="function"){let p;try{p=$v(kr.evaluate(f.innerText,Ge.mathScope))}catch{p="Undefined"}Sa.default.tooltip(f,{pos:Qa(f),title:p})}}let l=Kn(".cm-lineNo");if(l.length>0&&Ge.settings.keywordTips)for(let f of l){let p;try{p=typeof Ge.mathScope[f.innerText]=="function"?"Function":$v(kr.evaluate(f.innerText,Ge.mathScope))}catch{p="Undefined"}Sa.default.tooltip(f,{pos:Qa(f),title:p})}let a=Kn(".cm-scope");if(a.length>0&&Ge.settings.keywordTips)for(let f of a)Sa.default.tooltip(f,{pos:Qa(f),title:j$.filter(p=>f.innerText===p.text)[0].desc});let s=Kn(".cm-excel");if(s.length>0&&Ge.settings.keywordTips)for(let f of s)Sa.default.tooltip(f,{pos:Qa(f),title:"Excel function"})});Rt.on("cursorActivity",e=>{let t=Xt.get("pages"),r=t.find(n=>n.id==Ge.activePage);r.cursor=e.getCursor(),Xt.set("pages",t)});function exe(){setTimeout(()=>{let e=Rt.getCursor().line,t=Rt.getLine(e),r=Ve("#output").children[e].innerText,n=Rt.getValue()==="",i=t.length>0,o=Rt.somethingSelected(),u=Rt.listSelections().length>1||Rt.listSelections()[0].anchor.line!==Rt.listSelections()[0].head.line,l=r!==""&&r!=="Error"&&r!=="Plot";numara.inputContextMenu(e,n,i,o,u,l)},20)}function txe(e){let t=e.srcElement.innerText,r=e.srcElement.dataset.line||e.srcElement.parentElement.dataset.line||Rt.lastLine(),n=r!==null&&t!==""&&t!=="Error"&&t!=="Plot",i=Rt.getValue()==="";numara.outputContextMenu(r,i,n)}function BC(){setTimeout(()=>{numara.textboxContextMenu()},20)}function rxe(e,t){t=+t;let r=Rt.getLine(t).trim();navigator.clipboard.writeText(r).then(Rn(`Copied Line ${t+1} to clipboard.`))}function eW(e,t,r){t=+t;let n=Rt.getLine(t).trim(),i=Ve("#output").children[t].children[0].dataset.copy,o=r?`${n} = ${i}`:`${i}`;navigator.clipboard.writeText(o).then(Rn(r?`Copied Line ${t+1} with answer to clipboard.`:`Copied '${i}' to clipboard.`))}function nxe(){Rt.getValue()===""?Rn("Nothing to copy."):navigator.clipboard.writeText(Rt.getValue()).then(Rn("Copied all lines to clipboard."))}function ixe(){if(Rt.getValue()==="")Rn("Nothing to copy.");else{let e="";Rt.eachLine(t=>{let r=Rt.getLineNumber(t);e+=`${Ve("#output").children[r].innerText} `}),navigator.clipboard.writeText(e).then(Rn("Copied all answers to clipboard."))}}function LC(){if(Rt.getValue()==="")Rn("Nothing to copy.");else{let e="";Rt.eachLine(t=>{let r=Rt.getLineNumber(t);t=t.text.trim(),e+=t?t.match(/^(#|\/\/)/)?`${t} `:`${t} = ${Ve("#output").children[r].innerText} `:` -`}),navigator.clipboard.writeText(e).then(Rn("Copied page to clipboard."))}}Bi&&(Rt.on("contextmenu",tye),zf.on("contextmenu",BC),Uf.on("contextmenu",BC),Ve("#output").addEventListener("contextmenu",rye),Kn(".textBox").forEach(e=>{e.addEventListener("contextmenu",BC)}),numara.copyLine(nye),numara.copyAnswer(eW),numara.copyLineWithAnswer(eW),numara.copyAllLines(iye),numara.copyAllAnswers(oye),numara.copyAll(LC));g();y();v();kr.createUnit("USD",{aliases:["usd"]});function Eb(){let e="https://www.floatrates.com/widget/1030/cfc5515dfc13ada8d7b0e50b8143d55f/usd.json";navigator.onLine?(Ve("#lastUpdated").innerHTML='
    ',fetch(e).then(t=>t.json()).then(t=>{let r=["cup"];Ge.currencyRates=t,Object.keys(t).forEach(n=>{kr.createUnit(t[n].code,{aliases:[r.includes(t[n].code.toLowerCase())?"":t[n].code.toLowerCase()],definition:kr.unit(t[n].inverseRate+"USD")},{override:!0}),Xt.set("rateDate",t[n].date)}),Ve("#lastUpdated").innerHTML=Xt.get("rateDate"),Rt.setOption("mode",Ge.settings.syntax?"numara":"plain"),Qa()}).catch(t=>{Ve("#lastUpdated").innerHTML="n/a",Rn("Failed to get exchange rates ("+t+")","warning")})):(Ve("#lastUpdated").innerHTML="No internet connection.",Rn("No internet connection. Could not update exchange rates.","warning"))}g();y();v();g();y();v();g();y();v();g();y();v();var tW=(e,t,r=[])=>{let n=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach(i=>{n.setAttribute(i,String(t[i]))}),r.length&&r.forEach(i=>{let o=tW(...i);n.appendChild(o)}),n},rW=([e,t,r])=>tW(e,t,r);var aye=e=>Array.from(e.attributes).reduce((t,r)=>(t[r.name]=r.value,t),{}),sye=e=>typeof e=="string"?e:!e||!e.class?"":e.class&&typeof e.class=="string"?e.class.split(" "):e.class&&Array.isArray(e.class)?e.class:"",uye=e=>e.flatMap(sye).map(r=>r.trim()).filter(Boolean).filter((r,n,i)=>i.indexOf(r)===n).join(" "),lye=e=>e.replace(/(\w)(\w*)(_|-|\s*)/g,(t,r,n)=>r.toUpperCase()+n.toLowerCase()),PC=(e,{nameAttr:t,icons:r,attrs:n})=>{let i=e.getAttribute(t);if(i==null)return;let o=lye(i),u=r[o];if(!u)return console.warn(`${e.outerHTML} icon name was not found in the provided icons object.`);let l=aye(e),[a,s,f]=u,p={...s,"data-lucide":i,...n,...l},h=uye(["lucide",`lucide-${i}`,l,n]);h&&Object.assign(p,{class:h});let x=rW([a,p,f]);return e.parentNode?.replaceChild(x,e)};g();y();v();var xr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};g();y();v();var RC=["svg",xr,[["path",{d:"m21 16-4 4-4-4"}],["path",{d:"M17 20V4"}],["path",{d:"m3 8 4-4 4 4"}],["path",{d:"M7 4v16"}]]];g();y();v();var Sb=["svg",xr,[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}]]];g();y();v();var Ab=["svg",xr,[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]]];g();y();v();var qC=["svg",xr,[["circle",{cx:"12",cy:"12",r:"10"}]]];g();y();v();var zC=["svg",xr,[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]]];g();y();v();var UC=["svg",xr,[["polyline",{points:"15 10 20 15 15 20"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12"}]]];g();y();v();var HC=["svg",xr,[["circle",{cx:"12.1",cy:"12.1",r:"1"}]]];g();y();v();var $C=["svg",xr,[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"7 10 12 15 17 10"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3"}]]];g();y();v();var Cb=["svg",xr,[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]]];g();y();v();var WC=["svg",xr,[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"}],["path",{d:"M22 21H7"}],["path",{d:"m5 11 9 9"}]]];g();y();v();var VC=["svg",xr,[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]]];g();y();v();var GC=["svg",xr,[["path",{d:"M21 6H3"}],["path",{d:"M7 12H3"}],["path",{d:"M7 18H3"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14"}],["path",{d:"M11 10v4h4"}]]];g();y();v();var Mb=["svg",xr,[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"m16 15-3-3 3-3"}]]];g();y();v();var Tb=["svg",xr,[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}]]];g();y();v();var YC=["svg",xr,[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]]];g();y();v();var ZC=["svg",xr,[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1"}]]];g();y();v();var XC=["svg",xr,[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}],["path",{d:"M14 15H9v-5"}],["path",{d:"M16 3h5v5"}],["path",{d:"M21 3 9 15"}]]];g();y();v();var KC=["svg",xr,[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}],["circle",{cx:"12",cy:"12",r:"3"}]]];g();y();v();var JC=["svg",xr,[["path",{d:"M3 6h18"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}]]];g();y();v();var QC=["svg",xr,[["circle",{cx:"12",cy:"17",r:"1"}],["path",{d:"M3 7v6h6"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"}]]];g();y();v();var jC=["svg",xr,[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"17 8 12 3 7 8"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15"}]]];var nW=({icons:e={},nameAttr:t="data-lucide",attrs:r={}}={})=>{if(!Object.values(e).length)throw new Error(`Please provide an icons object. +`}),navigator.clipboard.writeText(e).then(Rn("Copied page to clipboard."))}}Bi&&(Rt.on("contextmenu",exe),zf.on("contextmenu",BC),Uf.on("contextmenu",BC),Ve("#output").addEventListener("contextmenu",txe),Kn(".textBox").forEach(e=>{e.addEventListener("contextmenu",BC)}),numara.copyLine(rxe),numara.copyAnswer(eW),numara.copyLineWithAnswer(eW),numara.copyAllLines(nxe),numara.copyAllAnswers(ixe),numara.copyAll(LC));g();x();v();kr.createUnit("USD",{aliases:["usd"]});function Sb(){let e="https://www.floatrates.com/widget/1030/cfc5515dfc13ada8d7b0e50b8143d55f/usd.json";navigator.onLine?(Ve("#lastUpdated").innerHTML='
    ',fetch(e).then(t=>t.json()).then(t=>{let r=["cup"];Ge.currencyRates=t,Object.keys(t).forEach(n=>{kr.createUnit(t[n].code,{aliases:[r.includes(t[n].code.toLowerCase())?"":t[n].code.toLowerCase()],definition:kr.unit(t[n].inverseRate+"USD")},{override:!0}),Xt.set("rateDate",t[n].date)}),Ve("#lastUpdated").innerHTML=Xt.get("rateDate"),Rt.setOption("mode",Ge.settings.syntax?"numara":"plain"),Tu()}).catch(t=>{Ve("#lastUpdated").innerHTML="n/a",Rn("Failed to get exchange rates ("+t+")","warning")})):(Ve("#lastUpdated").innerHTML="No internet connection.",Rn("No internet connection. Could not update exchange rates.","warning"))}g();x();v();g();x();v();g();x();v();g();x();v();var tW=(e,t,r=[])=>{let n=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach(i=>{n.setAttribute(i,String(t[i]))}),r.length&&r.forEach(i=>{let o=tW(...i);n.appendChild(o)}),n},rW=([e,t,r])=>tW(e,t,r);var oxe=e=>Array.from(e.attributes).reduce((t,r)=>(t[r.name]=r.value,t),{}),axe=e=>typeof e=="string"?e:!e||!e.class?"":e.class&&typeof e.class=="string"?e.class.split(" "):e.class&&Array.isArray(e.class)?e.class:"",sxe=e=>e.flatMap(axe).map(r=>r.trim()).filter(Boolean).filter((r,n,i)=>i.indexOf(r)===n).join(" "),uxe=e=>e.replace(/(\w)(\w*)(_|-|\s*)/g,(t,r,n)=>r.toUpperCase()+n.toLowerCase()),PC=(e,{nameAttr:t,icons:r,attrs:n})=>{let i=e.getAttribute(t);if(i==null)return;let o=uxe(i),u=r[o];if(!u)return console.warn(`${e.outerHTML} icon name was not found in the provided icons object.`);let l=oxe(e),[a,s,f]=u,p={...s,"data-lucide":i,...n,...l},h=sxe(["lucide",`lucide-${i}`,l,n]);h&&Object.assign(p,{class:h});let y=rW([a,p,f]);return e.parentNode?.replaceChild(y,e)};g();x();v();var yr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};g();x();v();var RC=["svg",yr,[["path",{d:"m21 16-4 4-4-4"}],["path",{d:"M17 20V4"}],["path",{d:"m3 8 4-4 4 4"}],["path",{d:"M7 4v16"}]]];g();x();v();var Eb=["svg",yr,[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}]]];g();x();v();var Ab=["svg",yr,[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]]];g();x();v();var qC=["svg",yr,[["circle",{cx:"12",cy:"12",r:"10"}]]];g();x();v();var zC=["svg",yr,[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]]];g();x();v();var UC=["svg",yr,[["polyline",{points:"15 10 20 15 15 20"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12"}]]];g();x();v();var HC=["svg",yr,[["circle",{cx:"12.1",cy:"12.1",r:"1"}]]];g();x();v();var $C=["svg",yr,[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"7 10 12 15 17 10"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3"}]]];g();x();v();var Cb=["svg",yr,[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]]];g();x();v();var WC=["svg",yr,[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"}],["path",{d:"M22 21H7"}],["path",{d:"m5 11 9 9"}]]];g();x();v();var VC=["svg",yr,[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]]];g();x();v();var GC=["svg",yr,[["path",{d:"M21 6H3"}],["path",{d:"M7 12H3"}],["path",{d:"M7 18H3"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14"}],["path",{d:"M11 10v4h4"}]]];g();x();v();var Mb=["svg",yr,[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"m16 15-3-3 3-3"}]]];g();x();v();var Tb=["svg",yr,[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}]]];g();x();v();var YC=["svg",yr,[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]]];g();x();v();var ZC=["svg",yr,[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1"}]]];g();x();v();var XC=["svg",yr,[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}],["path",{d:"M14 15H9v-5"}],["path",{d:"M16 3h5v5"}],["path",{d:"M21 3 9 15"}]]];g();x();v();var KC=["svg",yr,[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}],["circle",{cx:"12",cy:"12",r:"3"}]]];g();x();v();var JC=["svg",yr,[["path",{d:"M3 6h18"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}]]];g();x();v();var QC=["svg",yr,[["circle",{cx:"12",cy:"17",r:"1"}],["path",{d:"M3 7v6h6"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"}]]];g();x();v();var jC=["svg",yr,[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"17 8 12 3 7 8"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15"}]]];var nW=({icons:e={},nameAttr:t="data-lucide",attrs:r={}}={})=>{if(!Object.values(e).length)throw new Error(`Please provide an icons object. If you want to use all the icons you can import it like: \`import { createIcons, icons } from 'lucide'; -lucide.createIcons({icons});\``);if(typeof document>"u")throw new Error("`createIcons()` only works in a browser environment.");let n=document.querySelectorAll(`[${t}]`);if(Array.from(n).forEach(i=>PC(i,{nameAttr:t,icons:e,attrs:r})),t==="data-lucide"){let i=document.querySelectorAll("[icon-name]");i.length>0&&(console.warn("[Lucide] Some icons were found with the now deprecated icon-name attribute. These will still be replaced for backwards compatibility, but will no longer be supported in v1.0 and you should switch to data-lucide"),Array.from(i).forEach(o=>PC(o,{nameAttr:"icon-name",icons:e,attrs:r})))}};var fye={AlertCircle:Ab,ArrowUpDown:RC,Braces:Sb,Circle:qC,Copy:zC,CornerDownRight:UC,Dot:HC,Download:$C,EllipsisVertical:Cb,Eraser:WC,Info:VC,ListRestart:GC,PanelLeft:Tb,PanelLeftClose:Mb,Plus:YC,Printer:ZC,Scaling:XC,Settings:KC,Trash:JC,UndoDot:QC,Upload:jC},$h=()=>{nW({icons:fye})};g();y();v();var Ob="numara",iW="Numara",oW="Numara Calculator",eM="5.1.3",tM={name:"Timur Atalay",email:"mail@numara.io",url:"https://numara.io"};var Ib="https://github.com/bornova/numara-calculator";var tte=rn(ete(),1);function uc(){Ve("#plotTitle").innerHTML=Ge.plotFunction;let e=kr.simplify(Ge.plotFunction.split("=")[1],Ge.mathScope).toString(),t=kr.abs(kr.evaluate(e,{x:0}))*2;(t===1/0||t===0)&&(t=10);let r=Ge.activePlot?Ge.activePlot.meta.xScale.domain():[-t,t],n=Ge.activePlot?Ge.activePlot.meta.yScale.domain():[-t,t];Ge.activePlot=tte.default.default({data:[{derivative:Ge.settings.plotDerivative?{fn:kr.derivative(e,"x").toString(),updateOnMouseMove:!0}:!1,fn:e,graphType:"polyline",sampler:"builtIn"}],grid:Ge.settings.plotGrid,height:Ve("#plot").clientHeight,target:"#plot",tip:{xLine:Ge.settings.plotCross,yLine:Ge.settings.plotCross},width:Ve("#plot").clientWidth,xAxis:{domain:r},yAxis:{domain:n}})}Ve("#plotCrossModal").addEventListener("click",()=>{Ge.settings.plotCross=Ve("#plotCrossModal").checked,Xt.set("settings",Ge.settings),uc()});Ve("#plotDerivativeModal").addEventListener("click",()=>{Ge.settings.plotDerivative=Ve("#plotDerivativeModal").checked,Xt.set("settings",Ge.settings),uc()});Ve("#plotGridModal").addEventListener("click",()=>{Ge.settings.plotGrid=Ve("#plotGridModal").checked,Xt.set("settings",Ge.settings),uc()});Ve("#exportPlot").addEventListener("click",()=>{Ve(".function-plot").setAttribute("xmlns","http://www.w3.org/2000/svg");let e=iW+" Plot "+Ge.plotFunction,t=`\r -`,r=Ve(".function-plot").outerHTML,n=new Blob([t,r],{type:"image/svg+xml;charset=utf-8"}),i=document.createElement("a");i.href=URL.createObjectURL(n),i.download=e,i.click(),setTimeout(()=>URL.revokeObjectURL(i.href),6e4)});Ve("#resetPlot").addEventListener("click",()=>{Ge.activePlot=null,uc()});g();y();v();var pN=rn(nte(),1);function ite(){Ve("#defaultSettingsButton").style.display=pN.default.diff(Ge.settings,hn.defaults)?"inline":"none"}function ote(){Ve("#bigNumWarn").style.display=Ge.settings.numericOutput==="BigNumber"?"inline-block":"none"}function ate(){Ve("#localeWarn").style.display=Uy()?"inline-block":"none"}function ste(e){Ve("#"+e+"Mod").style.display=Ge.settings[e]!==hn.defaults[e]?"inline-block":"none"}function ASe(){pN.default.observableDiff(Ge.settings,hn.defaults,e=>{e.kind!=="E"&&(pN.default.applyChange(Ge.settings,hn.defaults,e),Xt.set("settings",Ge.settings))})}var hn={defaults:{alwaysOnTop:!1,autocomplete:!0,closeBrackets:!0,contPrevLine:!0,copyThouSep:!1,currency:!0,dateDay:!1,divider:!0,expLower:"-12",expUpper:"12",fontSize:"1.1rem",fontWeight:"400",inputWidth:60,keywordTips:!0,lineErrors:!0,lineHeight:"2em",lineNumbers:!0,lineWrap:!0,locale:"system",matchBrackets:!0,matrixType:"Matrix",notation:"auto",notifyDuration:"5000",notifyLocation:"bottom-center",numericOutput:"number",plotCross:!1,plotDerivative:!1,plotGrid:!1,precision:"4",predictable:!1,rulers:!1,syntax:!0,theme:"system",thouSep:!0},initialize:()=>{Ge.settings=Xt.get("settings"),Ge.settings?ASe():(Ge.settings=Ge.settings=JSON.parse(JSON.stringify(hn.defaults)),Xt.set("settings",hn.defaults)),hn.apply(),Kn(".settingItem").forEach(e=>{let t=document.createElement("span"),r=document.createElement("span");r.setAttribute("data-lucide","dot"),t.setAttribute("id",e.getAttribute("id")+"Mod"),t.setAttribute("class",e.getAttribute("type")==="checkbox"?"settingModToggle":"settingMod"),t.appendChild(r),t.addEventListener("click",()=>{let n=e.getAttribute("id");Ge.settings[n]=hn.defaults[n],hn.prep(),hn.save(),hn.apply()}),e.getAttribute("type")==="checkbox"?e.parentElement.before(t):e.before(t),$h()})},prep:()=>{let e=[["System","system"],["Chinese (PRC)","zh-CN"],["English (Canada)","en-CA"],["English (UK)","en-GB"],["English (US)","en-US"],["French (France)","fr-FR"],["German (Germany)","de-DE"],["Italian (Italy)","it-IT"],["Japanese (Japan)","ja-JP"],["Portuguese (Brazil)","pt-BR"],["Russian (Russia)","ru-RU"],["Spanish (Mexico)","es-MX"],["Spanish (Spain)","es-ES"],["Turkish (Turkey)","tr-TR"]],t=["Matrix","Array"],r=["number","BigNumber","Fraction"],n=["auto","engineering","exponential","fixed","-","bin","hex","oct"];Ve("#locale").innerHTML="";for(let i of e)Ve("#locale").innerHTML+=``;Ve("#precision-label").innerHTML=Ge.settings.precision,Ve("#expLower-label").innerHTML=Ge.settings.expLower,Ve("#expUpper-label").innerHTML=Ge.settings.expUpper,Ve("#numericOutput").innerHTML="";for(let i of r)Ve("#numericOutput").innerHTML+=``;Ve("#notation").innerHTML="";for(let i of n)Ve("#notation").innerHTML+=i==="-"?"":``;Ve("#matrixType").innerHTML="";for(let i of t)Ve("#matrixType").innerHTML+=``;Ve("#lastUpdated").innerHTML=Ge.settings.currency?Xt.get("rateDate"):"",Ve("#currencyUpdate").style.visibility=Ge.settings.currency?"visible":"hidden",Object.keys(Ge.settings).forEach(i=>{let o=Ve("#"+i);o&&(o.getAttribute("type")==="checkbox"?o.checked=Ge.settings[i]:o.value=Ge.settings[i],ste(i))}),Hy(),ite(),ate(),ote(),hn.toggleSubs()},apply:()=>{let e=Ge.settings.theme==="system"?Bi&&numara.isDark()?"dark":"light":Ge.settings.theme==="light"?"light":"dark";Ve("#style").setAttribute("href","css/"+e+".css"),Ve("#numaraLogo").setAttribute("src","assets/logo-"+e+".png");let t=Ge.settings.theme==="system"?Bi&&numara.isDark()?"material-darker":"default":Ge.settings.theme==="light"?"default":"material-darker";zf.setOption("theme",t),Uf.setOption("theme",t),Bi&&(numara.setTheme(Ge.settings.theme),numara.setOnTop(Ge.settings.alwaysOnTop));let r=Kn(".panelFont, .input .CodeMirror");for(let n of r)n.style.fontSize=Ge.settings.fontSize,n.style.fontWeight=Ge.settings.fontWeight,n.style.setProperty("line-height",Ge.settings.lineHeight,"important");Ve("#input").style.width=(Ge.settings.divider?Ge.settings.inputWidth:hn.defaults.inputWidth)+"%",Ve("#panelDivider").style.display=Ge.settings.divider?"block":"none",Ve("#output").style.textAlign=Ge.settings.divider?"left":"right",Rt.setOption("mode",Ge.settings.syntax?"numara":"plain"),Rt.setOption("lineNumbers",Ge.settings.lineNumbers),Rt.setOption("lineWrapping",Ge.settings.lineWrap),Rt.setOption("matchBrackets",Ge.settings.syntax&&Ge.settings.matchBrackets?{maxScanLines:1}:!1),Rt.setOption("autoCloseBrackets",Ge.settings.closeBrackets),kr.config({matrix:Ge.settings.matrixType,number:Ge.settings.numericOutput,predictable:Ge.settings.predictable}),setTimeout(Qa,10)},save:()=>{Object.keys(Ge.settings).forEach(e=>{let t=Ve("#"+e);t&&(Ge.settings[e]=t.getAttribute("type")==="checkbox"?t.checked:t.value,ste(e))}),Ve("#currency").checked||(localStorage.removeItem("rateDate"),Ge.currencyRates={}),Ve("#currencyUpdate").style.visibility=Ve("#currency").checked?"visible":"hidden",!Xt.get("rateDate")&&Ge.settings.currency&&Eb(),ite(),ate(),ote(),hn.toggleSubs(),Xt.set("settings",Ge.settings)},toggleSubs:()=>{Ve("#expUpper").disabled=Ge.settings.notation!=="auto",Ve("#expLower").disabled=Ge.settings.notation!=="auto",Ve("#keywordTips").disabled=!Ge.settings.syntax,Ve("#matchBrackets").disabled=!Ge.settings.syntax,Ve("#copyThouSep").disabled=!Ge.settings.thouSep,Ve("#expUpper").parentNode.style.opacity=Ge.settings.notation==="auto"?"1":"0.5",Ve("#expLower").parentNode.style.opacity=Ge.settings.notation==="auto"?"1":"0.5",Ve("#keywordTips").parentNode.style.opacity=Ge.settings.syntax?"1":"0.5",Ve("#matchBrackets").parentNode.style.opacity=Ge.settings.syntax?"1":"0.5",Ve("#copyThouSep").parentNode.style.opacity=Ge.settings.thouSep?"1":"0.5",Ve("#expUpperMod").style.pointerEvents=Ge.settings.notation==="auto"?"auto":"none",Ve("#expLowerMod").style.pointerEvents=Ge.settings.notation==="auto"?"auto":"none",Ve("#keywordTipsMod").style.pointerEvents=Ge.settings.syntax?"auto":"none",Ve("#matchBracketsMod").style.pointerEvents=Ge.settings.syntax?"auto":"none",Ve("#copyThouSepMod").style.pointerEvents=Ge.settings.thouSep?"auto":"none",Ve("#expUpperMod").parentNode.style.opacity=Ge.settings.notation==="auto"?"1":"0.5",Ve("#expLowerMod").parentNode.style.opacity=Ge.settings.notation==="auto"?"1":"0.5",Ve("#keywordTipsMod").parentNode.style.opacity=Ge.settings.syntax?"1":"0.5",Ve("#matchBracketsMod").parentNode.style.opacity=Ge.settings.syntax?"1":"0.5",Ve("#copyThouSepMod").parentNode.style.opacity=Ge.settings.thouSep?"1":"0.5"}};Ve("#defaultSettingsButton").addEventListener("click",()=>{Ym("All settings will revert back to defaults.",()=>{Ge.settings=JSON.parse(JSON.stringify(hn.defaults)),Xt.set("settings",Ge.settings),hn.prep(),hn.save(),hn.apply()})});Ve("#dialog-settings-reset").addEventListener("click",()=>{Ym("All user settings and data will be lost.",()=>{Bi?numara.resetApp():(localStorage.clear(),location.reload())})});Bi&&Ve("#resetSizeButton").addEventListener("click",numara.resetSize);Ve("#localeWarn").addEventListener("click",()=>{yf("Caution: Locale",`Your locale (${Ge.settings.locale}) uses comma (,) as decimal separator. Therefore, you must use semicolon (;) as argument separator when using functions.

    Ex. sum(1;3) // 4`)});Ve("#bigNumWarn").addEventListener("click",()=>{yf("Caution: BigNumber Limitations",`Using the BigNumber may break function plotting and is not compatible with some math functions. +lucide.createIcons({icons});\``);if(typeof document>"u")throw new Error("`createIcons()` only works in a browser environment.");let n=document.querySelectorAll(`[${t}]`);if(Array.from(n).forEach(i=>PC(i,{nameAttr:t,icons:e,attrs:r})),t==="data-lucide"){let i=document.querySelectorAll("[icon-name]");i.length>0&&(console.warn("[Lucide] Some icons were found with the now deprecated icon-name attribute. These will still be replaced for backwards compatibility, but will no longer be supported in v1.0 and you should switch to data-lucide"),Array.from(i).forEach(o=>PC(o,{nameAttr:"icon-name",icons:e,attrs:r})))}};var lxe={AlertCircle:Ab,ArrowUpDown:RC,Braces:Eb,Circle:qC,Copy:zC,CornerDownRight:UC,Dot:HC,Download:$C,EllipsisVertical:Cb,Eraser:WC,Info:VC,ListRestart:GC,PanelLeft:Tb,PanelLeftClose:Mb,Plus:YC,Printer:ZC,Scaling:XC,Settings:KC,Trash:JC,UndoDot:QC,Upload:jC},Hh=()=>{nW({icons:lxe})};g();x();v();var Ob="numara",iW="Numara",oW="Numara Calculator",eM="5.2.0",tM={name:"Timur Atalay",email:"mail@numara.io",url:"https://numara.io"};var Ib="https://github.com/bornova/numara-calculator";var tte=ln(ete(),1);function uc(){Ve("#plotTitle").innerHTML=Ge.plotFunction;let e=kr.simplify(Ge.plotFunction.split("=")[1],Ge.mathScope).toString(),t=kr.abs(kr.evaluate(e,{x:0}))*2;(t===1/0||t===0)&&(t=10);let r=Ge.activePlot?Ge.activePlot.meta.xScale.domain():[-t,t],n=Ge.activePlot?Ge.activePlot.meta.yScale.domain():[-t,t];Ge.activePlot=tte.default.default({data:[{derivative:Ge.settings.plotDerivative?{fn:kr.derivative(e,"x").toString(),updateOnMouseMove:!0}:!1,fn:e,graphType:"polyline",sampler:"builtIn"}],grid:Ge.settings.plotGrid,height:Ve("#plot").clientHeight,target:"#plot",tip:{xLine:Ge.settings.plotCross,yLine:Ge.settings.plotCross},width:Ve("#plot").clientWidth,xAxis:{domain:r},yAxis:{domain:n}})}Ve("#plotCrossModal").addEventListener("click",()=>{Ge.settings.plotCross=Ve("#plotCrossModal").checked,Xt.set("settings",Ge.settings),uc()});Ve("#plotDerivativeModal").addEventListener("click",()=>{Ge.settings.plotDerivative=Ve("#plotDerivativeModal").checked,Xt.set("settings",Ge.settings),uc()});Ve("#plotGridModal").addEventListener("click",()=>{Ge.settings.plotGrid=Ve("#plotGridModal").checked,Xt.set("settings",Ge.settings),uc()});Ve("#exportPlot").addEventListener("click",()=>{Ve(".function-plot").setAttribute("xmlns","http://www.w3.org/2000/svg");let e=iW+" Plot "+Ge.plotFunction,t=`\r +`,r=Ve(".function-plot").outerHTML,n=new Blob([t,r],{type:"image/svg+xml;charset=utf-8"}),i=document.createElement("a");i.href=URL.createObjectURL(n),i.download=e,i.click(),setTimeout(()=>URL.revokeObjectURL(i.href),6e4)});Ve("#resetPlot").addEventListener("click",()=>{Ge.activePlot=null,uc()});g();x();v();var pN=ln(nte(),1);function ite(){Ve("#defaultSettingsButton").style.display=pN.default.diff(Ge.settings,hn.defaults)?"inline":"none"}function ote(){Ve("#bigNumWarn").style.display=Ge.settings.numericOutput==="BigNumber"?"inline-block":"none"}function ate(){Ve("#localeWarn").style.display=Ux()?"inline-block":"none"}function ste(e){Ve("#"+e+"Mod").style.display=Ge.settings[e]!==hn.defaults[e]?"inline-block":"none"}function EEe(){pN.default.observableDiff(Ge.settings,hn.defaults,e=>{e.kind!=="E"&&(pN.default.applyChange(Ge.settings,hn.defaults,e),Xt.set("settings",Ge.settings))})}var hn={defaults:{alwaysOnTop:!1,autocomplete:!0,closeBrackets:!0,contPrevLine:!0,copyThouSep:!1,currency:!0,dateDay:!1,divider:!0,expLower:"-12",expUpper:"12",fontSize:"1.1rem",fontWeight:"400",inputWidth:60,keywordTips:!0,lineErrors:!0,lineHeight:"2em",lineNumbers:!0,lineWrap:!0,locale:"system",matchBrackets:!0,matrixType:"Matrix",notation:"auto",notifyDuration:"5000",notifyLocation:"bottom-center",numericOutput:"number",plotCross:!1,plotDerivative:!1,plotGrid:!1,precision:"4",predictable:!1,rulers:!1,syntax:!0,theme:"system",thouSep:!0},initialize:()=>{Ge.settings=Xt.get("settings"),Ge.settings?EEe():(Ge.settings=Ge.settings=JSON.parse(JSON.stringify(hn.defaults)),Xt.set("settings",hn.defaults)),hn.apply(),Kn(".settingItem").forEach(e=>{let t=document.createElement("span"),r=document.createElement("span");r.setAttribute("data-lucide","dot"),t.setAttribute("id",e.getAttribute("id")+"Mod"),t.setAttribute("class",e.getAttribute("type")==="checkbox"?"settingModToggle":"settingMod"),t.appendChild(r),t.addEventListener("click",()=>{let n=e.getAttribute("id");Ge.settings[n]=hn.defaults[n],hn.prep(),hn.save(),hn.apply()}),e.getAttribute("type")==="checkbox"?e.parentElement.before(t):e.before(t),Hh()})},prep:()=>{let e=[["System","system"],["Chinese (PRC)","zh-CN"],["English (Canada)","en-CA"],["English (UK)","en-GB"],["English (US)","en-US"],["French (France)","fr-FR"],["German (Germany)","de-DE"],["Italian (Italy)","it-IT"],["Japanese (Japan)","ja-JP"],["Portuguese (Brazil)","pt-BR"],["Russian (Russia)","ru-RU"],["Spanish (Mexico)","es-MX"],["Spanish (Spain)","es-ES"],["Turkish (Turkey)","tr-TR"]],t=["Matrix","Array"],r=["number","BigNumber","Fraction"],n=["auto","engineering","exponential","fixed","-","bin","hex","oct"];Ve("#locale").innerHTML="";for(let i of e)Ve("#locale").innerHTML+=``;Ve("#precision-label").innerHTML=Ge.settings.precision,Ve("#expLower-label").innerHTML=Ge.settings.expLower,Ve("#expUpper-label").innerHTML=Ge.settings.expUpper,Ve("#numericOutput").innerHTML="";for(let i of r)Ve("#numericOutput").innerHTML+=``;Ve("#notation").innerHTML="";for(let i of n)Ve("#notation").innerHTML+=i==="-"?"":``;Ve("#matrixType").innerHTML="";for(let i of t)Ve("#matrixType").innerHTML+=``;Ve("#lastUpdated").innerHTML=Ge.settings.currency?Xt.get("rateDate"):"",Ve("#currencyUpdate").style.visibility=Ge.settings.currency?"visible":"hidden",Object.keys(Ge.settings).forEach(i=>{let o=Ve("#"+i);o&&(o.getAttribute("type")==="checkbox"?o.checked=Ge.settings[i]:o.value=Ge.settings[i],ste(i))}),Hx(),ite(),ate(),ote(),hn.toggleSubs()},apply:()=>{let e=Ge.settings.theme==="system"?Bi&&numara.isDark()?"dark":"light":Ge.settings.theme==="light"?"light":"dark";Ve("#style").setAttribute("href","css/"+e+".css"),Ve("#numaraLogo").setAttribute("src","assets/logo-"+e+".png");let t=Ge.settings.theme==="system"?Bi&&numara.isDark()?"material-darker":"default":Ge.settings.theme==="light"?"default":"material-darker";zf.setOption("theme",t),Uf.setOption("theme",t),Bi&&(numara.setTheme(Ge.settings.theme),numara.setOnTop(Ge.settings.alwaysOnTop));let r=Kn(".panelFont, .input .CodeMirror");for(let n of r)n.style.fontSize=Ge.settings.fontSize,n.style.fontWeight=Ge.settings.fontWeight,n.style.setProperty("line-height",Ge.settings.lineHeight,"important");Ve("#input").style.width=(Ge.settings.divider?Ge.settings.inputWidth:hn.defaults.inputWidth)+"%",Ve("#panelDivider").style.display=Ge.settings.divider?"block":"none",Ve("#output").style.textAlign=Ge.settings.divider?"left":"right",Rt.setOption("mode",Ge.settings.syntax?"numara":"plain"),Rt.setOption("lineNumbers",Ge.settings.lineNumbers),Rt.setOption("lineWrapping",Ge.settings.lineWrap),Rt.setOption("matchBrackets",Ge.settings.syntax&&Ge.settings.matchBrackets?{maxScanLines:1}:!1),Rt.setOption("autoCloseBrackets",Ge.settings.closeBrackets),kr.config({matrix:Ge.settings.matrixType,number:Ge.settings.numericOutput,predictable:Ge.settings.predictable}),setTimeout(Tu,10)},save:()=>{Object.keys(Ge.settings).forEach(e=>{let t=Ve("#"+e);t&&(Ge.settings[e]=t.getAttribute("type")==="checkbox"?t.checked:t.value,ste(e))}),Ve("#currency").checked||(localStorage.removeItem("rateDate"),Ge.currencyRates={}),Ve("#currencyUpdate").style.visibility=Ve("#currency").checked?"visible":"hidden",!Xt.get("rateDate")&&Ge.settings.currency&&Sb(),ite(),ate(),ote(),hn.toggleSubs(),Xt.set("settings",Ge.settings)},toggleSubs:()=>{Ve("#expUpper").disabled=Ge.settings.notation!=="auto",Ve("#expLower").disabled=Ge.settings.notation!=="auto",Ve("#keywordTips").disabled=!Ge.settings.syntax,Ve("#matchBrackets").disabled=!Ge.settings.syntax,Ve("#copyThouSep").disabled=!Ge.settings.thouSep,Ve("#expUpper").parentNode.style.opacity=Ge.settings.notation==="auto"?"1":"0.5",Ve("#expLower").parentNode.style.opacity=Ge.settings.notation==="auto"?"1":"0.5",Ve("#keywordTips").parentNode.style.opacity=Ge.settings.syntax?"1":"0.5",Ve("#matchBrackets").parentNode.style.opacity=Ge.settings.syntax?"1":"0.5",Ve("#copyThouSep").parentNode.style.opacity=Ge.settings.thouSep?"1":"0.5",Ve("#expUpperMod").style.pointerEvents=Ge.settings.notation==="auto"?"auto":"none",Ve("#expLowerMod").style.pointerEvents=Ge.settings.notation==="auto"?"auto":"none",Ve("#keywordTipsMod").style.pointerEvents=Ge.settings.syntax?"auto":"none",Ve("#matchBracketsMod").style.pointerEvents=Ge.settings.syntax?"auto":"none",Ve("#copyThouSepMod").style.pointerEvents=Ge.settings.thouSep?"auto":"none",Ve("#expUpperMod").parentNode.style.opacity=Ge.settings.notation==="auto"?"1":"0.5",Ve("#expLowerMod").parentNode.style.opacity=Ge.settings.notation==="auto"?"1":"0.5",Ve("#keywordTipsMod").parentNode.style.opacity=Ge.settings.syntax?"1":"0.5",Ve("#matchBracketsMod").parentNode.style.opacity=Ge.settings.syntax?"1":"0.5",Ve("#copyThouSepMod").parentNode.style.opacity=Ge.settings.thouSep?"1":"0.5"}};Ve("#defaultSettingsButton").addEventListener("click",()=>{Gm("All settings will revert back to defaults.",()=>{Ge.settings=JSON.parse(JSON.stringify(hn.defaults)),Xt.set("settings",Ge.settings),hn.prep(),hn.save(),hn.apply()})});Ve("#dialog-settings-reset").addEventListener("click",()=>{Gm("All user settings and data will be lost.",()=>{Bi?numara.resetApp():(localStorage.clear(),location.reload())})});Bi&&Ve("#resetSizeButton").addEventListener("click",numara.resetSize);Ve("#localeWarn").addEventListener("click",()=>{cl("Caution: Locale",`Your locale (${Ge.settings.locale}) uses comma (,) as decimal separator. Therefore, you must use semicolon (;) as argument separator when using functions.

    Ex. sum(1;3) // 4`)});Ve("#bigNumWarn").addEventListener("click",()=>{cl("Caution: BigNumber Limitations",`Using the BigNumber may break function plotting and is not compatible with some math functions. It may also cause unexpected behavior and affect overall performance.

    - Read more on BigNumbers`)});Ve("#precision").addEventListener("input",()=>{Ve("#precision-label").innerHTML=Ve("#precision").value});Ve("#expLower").addEventListener("input",()=>{Ve("#expLower-label").innerHTML=Ve("#expLower").value});Ve("#expUpper").addEventListener("input",()=>{Ve("#expUpper-label").innerHTML=Ve("#expUpper").value});Kn(".settingItem").forEach(e=>{e.addEventListener("change",()=>{hn.save(),hn.apply()})});g();y();v();var lc=rn(Vm(),1);function ute(){let e=Xt.get("saved"),t=Xt.get("pages");e&&(Object.entries(e).forEach(([r,n])=>{t.push({id:r,name:n[0],data:n[1]})}),Xt.set("pages",t),localStorage.removeItem("saved"))}function g1(){let e=Xt.get("pages"),t=1;if(e){let r=new RegExp(/\b(Page \d+)$\b/),n=e.filter(o=>r.test(o.name.trim())).map(o=>+o.name.split(" ")[1]).sort((o,u)=>o-u),i=Math.max(...n);if(n[0]===1){for(let o=0;oXt.get("lastPage");function zl(){let e=Xt.get("pages");(!e||e.length===0)&&v1(),Ve("#pageList").innerHTML="",e.forEach(t=>{let r=document.createElement("div");r.id=t.id,r.classList.add("pageListItem","uk-flex-middle",Ge.activePage===t.id?"activePage":"inactivePage"),r.innerHTML=` + Read more on BigNumbers`)});Ve("#precision").addEventListener("input",()=>{Ve("#precision-label").innerHTML=Ve("#precision").value});Ve("#expLower").addEventListener("input",()=>{Ve("#expLower-label").innerHTML=Ve("#expLower").value});Ve("#expUpper").addEventListener("input",()=>{Ve("#expUpper-label").innerHTML=Ve("#expUpper").value});Kn(".settingItem").forEach(e=>{e.addEventListener("change",()=>{hn.save(),hn.apply()})});g();x();v();var lc=ln(Wg(),1);function ute(){let e=Xt.get("saved"),t=Xt.get("pages");e&&(Object.entries(e).forEach(([r,n])=>{t.push({id:r,name:n[0],data:n[1]})}),Xt.set("pages",t),localStorage.removeItem("saved"))}function g1(){let e=Xt.get("pages"),t=1;if(e){let r=new RegExp(/\b(Page \d+)$\b/),n=e.filter(o=>r.test(o.name.trim())).map(o=>+o.name.split(" ")[1]).sort((o,u)=>o-u),i=Math.max(...n);if(n[0]===1){for(let o=0;oXt.get("lastPage");function Ul(){let e=Xt.get("pages");(!e||e.length===0)&&v1(),Ve("#pageList").innerHTML="",e.forEach(t=>{let r=document.createElement("div");r.id=t.id,r.classList.add("pageListItem","uk-flex-middle",Ge.activePage===t.id?"activePage":"inactivePage"),r.innerHTML=`
    ${t.name}
    ${Nr.fromFormat(t.id,"yyyyMMddHHmmssSSS").toFormat("FF")}
    @@ -121,12 +121,12 @@ lucide.createIcons({icons});\``);if(typeof document>"u")throw new Error("`create
    Delete
    - `,r.addEventListener("click",n=>{switch(n.target.parentNode.dataset.action==="load"&&($d(t.id),lc.default.offcanvas("#sidePanel").hide()),n.target.dataset.action){case"rename":lc.default.dropdown(n.target.parentNode).hide(0),MSe(t.id);break;case"delete":CSe(t.id);break;case"duplicate":TSe(t.id);break}}),Ve("#pageList").appendChild(r)}),$h()}function $d(e){let t=Xt.get("pages").find(n=>n.id===e),r=t.cursor;Ge.activePage=e,Xt.set("lastPage",e),Ve("#pageName").innerHTML=t.name,Ve("#pageName").title=t.name,Rt.setValue(t.data),t.history&&Rt.setHistory(t.history),Rt.execCommand("goLineEnd"),r&&(Rt.setCursor(r),Rt.scrollIntoView(r)),zl()}function v1(){let e=Nr.local().toFormat("yyyyMMddHHmmssSSS"),t=g1();Xt.set("pages",[{id:e,name:t,data:Xt.get("input")||""}]),localStorage.removeItem("input"),$d(e)}function lte(e){let t=Nr.local().toFormat("yyyyMMddHHmmssSSS"),r=Xt.get("pages"),n=Ve("#newPageTitleInput").value.replace(/<|>/g,"").trim()||(e?"Imported page":g1());if(r.map(o=>o.name).includes(n)){Rn(`"${n}" already exists. Please choose a different page name.`,"danger");return}Ge.activePage=t,r.push({id:t,name:n,data:""}),Xt.set("pages",r),Xt.set("lastPage",t),Rt.setValue(""),zl(),Ve("#pageName").innerHTML=n,lc.default.modal("#dialog-newPage").hide()}function CSe(e){let t=Xt.get("pages");Ym('"'+t.find(r=>r.id===e).name+'" will be deleted.',()=>{t=t.filter(r=>r.id!==e),Xt.set("pages",t),t.length===0?v1():e===Ge.activePage&&$d(t.pop().id),zl()})}function MSe(e){let t=Xt.get("pages"),r=t.find(i=>i.id===e);Ve("#renamePageTitleInput").value=r.name,bu("#dialog-renamePage");function n(){r.name=Ve("#renamePageTitleInput").value.replace(/<|>/g,"").trim()||g1(),Xt.set("pages",t),zl(),Ve("#pageName").innerHTML=r.name,lc.default.modal("#dialog-renamePage").hide(),Ve("#dialog-renamePage-save").removeEventListener("click",n)}Ve("#dialog-renamePage-save").addEventListener("click",n)}function TSe(e){let t=Nr.local().toFormat("yyyyMMddHHmmssSSS"),r=Xt.get("pages"),n=r.find(u=>u.id===e),i=n.data,o=n.name+" (copy)";Ge.activePage=t,r.push({id:t,name:o,data:i}),Xt.set("pages",r),$d(t)}function mN(e){let t=Xt.get("pages"),r;switch(e){case"oldnew":r=t.sort((n,i)=>n.id-i.id);break;case"newold":r=t.sort((n,i)=>i.id-n.id);break;case"az":r=t.sort((n,i)=>n.name.localeCompare(i.name));break;case"za":r=t.sort((n,i)=>i.name.localeCompare(n.name));break}Xt.set("pages",r),zl(),lc.default.dropdown("#sortDropdown").hide(0)}function fte(){let e=Xt.get("pages"),r=[...Kn("#pageList > div")].map(n=>e.find(i=>i.id===n.getAttribute("id")));Xt.set("pages",r)}function OSe(){Ym("All pages will be deleted permanently.",()=>{Xt.set("pages",[]),v1(),zl()})}function cte(){Ve("#newPageTitleInput").value="",Ve("#newPageTitleInput").focus(),bu("#dialog-newPage")}Ve("#newPageButton").addEventListener("click",cte);Ve("#newPageButtonSP").addEventListener("click",cte);Ve("#dialog-newPage-save").addEventListener("click",()=>{lte(!1)});Ve("#newPageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Ve("#dialog-newPage-save").click()});Ve("#deleteAllPagesButton").addEventListener("click",OSe);Ve("#renamePageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Ve("#dialog-renamePage-save").click()});Ve("#sortOldNew").addEventListener("click",()=>{mN("oldnew")});Ve("#sortNewOld").addEventListener("click",()=>{mN("newold")});Ve("#sortAZ").addEventListener("click",()=>{mN("az")});Ve("#sortZA").addEventListener("click",()=>{mN("za")});Ve("#closeSidePanelButton").addEventListener("click",()=>{lc.default.offcanvas("#sidePanel").hide()});Ve("#printButton").addEventListener("click",()=>{window.print()});Bi?(Ve("#importButton").addEventListener("click",numara.import),numara.importData((e,t,r)=>{lte(!0),Rt.setValue(t),Rn(r,"success")}),numara.importDataError((e,t)=>{Rn(t,"danger")}),numara.main.import(numara.import),Ve("#exportButton").addEventListener("click",()=>{let t=Xt.get("pages").find(r=>r.id===Ge.activePage).name;numara.export(t,Rt.getValue())}),numara.exportData((e,t)=>{Rn(t,"success")}),numara.exportDataError((e,t)=>{Rn(t,"danger")}),numara.main.export(()=>{numara.export(Ve("#newPageTitleInput").value,Rt.getValue())}),numara.main.print(()=>{lc.default.offcanvas("#sidePanel").hide(),window.print()})):Kn("#exportButton, #importButton, #spDivider").forEach(e=>e.remove());g();y();v();var pte=rn(Vm(),1);function y1(e,t){try{(t==="func"?new Function(`'use strict'; let window; let numara; math.import({${e}}, {override: true})`):new Function(`'use strict'; let window; let numara; math.createUnit({${e}}, {override: true})`))();let n=new Function(`'use strict'; return {${e}}`);for(let i in n())Ge[t==="func"?"udfList":"uduList"].push(i);Xt.set(t==="func"?"udf":"udu",e),Qa(),pte.default.modal("#dialog-udfu").hide()}catch(r){yf(r.name,r.message)}}Ve("#dialog-udfu-save-f").addEventListener("click",()=>{y1(zf.getValue().trim(),"func")});Ve("#dialog-udfu-save-u").addEventListener("click",()=>{y1(Uf.getValue().trim(),"unit")});var Fa=rn(Vm(),1),vte=rn(mte(),1);g();y();v();(function(e){var t={},r=e.prototype.stopCallback;e.prototype.stopCallback=function(n,i,o,u){var l=this;return l.paused?!0:t[o]||t[u]?!1:r.call(l,n,i,o)},e.prototype.bindGlobal=function(n,i,o){var u=this;if(u.bind(n,i,o),n instanceof Array){for(var l=0;l{switch(n.target.parentNode.dataset.action==="load"&&(Hd(t.id),lc.default.offcanvas("#sidePanel").hide()),n.target.dataset.action){case"rename":lc.default.dropdown(n.target.parentNode).hide(0),CEe(t.id);break;case"delete":AEe(t.id);break;case"duplicate":MEe(t.id);break}}),Ve("#pageList").appendChild(r)}),Hh()}function Hd(e){let t=Xt.get("pages").find(n=>n.id===e),r=t.cursor;Ge.activePage=e,Xt.set("lastPage",e),Ve("#pageName").innerHTML=t.name,Ve("#pageName").title=t.name,Rt.setValue(t.data),t.history&&Rt.setHistory(t.history),Rt.execCommand("goLineEnd"),r&&(Rt.setCursor(r),Rt.scrollIntoView(r)),Ul()}function v1(){let e=Nr.local().toFormat("yyyyMMddHHmmssSSS"),t=g1();Xt.set("pages",[{id:e,name:t,data:Xt.get("input")||""}]),localStorage.removeItem("input"),Hd(e)}function lte(e){let t=Nr.local().toFormat("yyyyMMddHHmmssSSS"),r=Xt.get("pages"),n=Ve("#newPageTitleInput").value.replace(/<|>/g,"").trim()||(e?"Imported page":g1());if(r.map(o=>o.name).includes(n)){Rn(`"${n}" already exists. Please choose a different page name.`,"danger");return}Ge.activePage=t,r.push({id:t,name:n,data:""}),Xt.set("pages",r),Xt.set("lastPage",t),Rt.setValue(""),Ul(),Ve("#pageName").innerHTML=n,lc.default.modal("#dialog-newPage").hide()}function AEe(e){let t=Xt.get("pages");Gm('"'+t.find(r=>r.id===e).name+'" will be deleted.',()=>{t=t.filter(r=>r.id!==e),Xt.set("pages",t),t.length===0?v1():e===Ge.activePage&&Hd(t.pop().id),Ul()})}function CEe(e){let t=Xt.get("pages"),r=t.find(i=>i.id===e);Ve("#renamePageTitleInput").value=r.name,wu("#dialog-renamePage");function n(){r.name=Ve("#renamePageTitleInput").value.replace(/<|>/g,"").trim()||g1(),Xt.set("pages",t),Ul(),Ve("#pageName").innerHTML=r.name,lc.default.modal("#dialog-renamePage").hide(),Ve("#dialog-renamePage-save").removeEventListener("click",n)}Ve("#dialog-renamePage-save").addEventListener("click",n)}function MEe(e){let t=Nr.local().toFormat("yyyyMMddHHmmssSSS"),r=Xt.get("pages"),n=r.find(u=>u.id===e),i=n.data,o=n.name+" (copy)";Ge.activePage=t,r.push({id:t,name:o,data:i}),Xt.set("pages",r),Hd(t)}function mN(e){let t=Xt.get("pages"),r;switch(e){case"oldnew":r=t.sort((n,i)=>n.id-i.id);break;case"newold":r=t.sort((n,i)=>i.id-n.id);break;case"az":r=t.sort((n,i)=>n.name.localeCompare(i.name));break;case"za":r=t.sort((n,i)=>i.name.localeCompare(n.name));break}Xt.set("pages",r),Ul(),lc.default.dropdown("#sortDropdown").hide(0)}function fte(){let e=Xt.get("pages"),r=[...Kn("#pageList > div")].map(n=>e.find(i=>i.id===n.getAttribute("id")));Xt.set("pages",r)}function TEe(){Gm("All pages will be deleted permanently.",()=>{Xt.set("pages",[]),v1(),Ul()})}function cte(){Ve("#newPageTitleInput").value="",Ve("#newPageTitleInput").focus(),wu("#dialog-newPage")}Ve("#newPageButton").addEventListener("click",cte);Ve("#newPageButtonSP").addEventListener("click",cte);Ve("#dialog-newPage-save").addEventListener("click",()=>{lte(!1)});Ve("#newPageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Ve("#dialog-newPage-save").click()});Ve("#deleteAllPagesButton").addEventListener("click",TEe);Ve("#renamePageTitleInput").addEventListener("keyup",e=>{(e.key==="Enter"||e.keyCode===13)&&Ve("#dialog-renamePage-save").click()});Ve("#sortOldNew").addEventListener("click",()=>{mN("oldnew")});Ve("#sortNewOld").addEventListener("click",()=>{mN("newold")});Ve("#sortAZ").addEventListener("click",()=>{mN("az")});Ve("#sortZA").addEventListener("click",()=>{mN("za")});Ve("#closeSidePanelButton").addEventListener("click",()=>{lc.default.offcanvas("#sidePanel").hide()});Ve("#printButton").addEventListener("click",()=>{window.print()});Bi?(Ve("#importButton").addEventListener("click",numara.import),numara.importData((e,t,r)=>{lte(!0),Rt.setValue(t),Rn(r,"success")}),numara.importDataError((e,t)=>{Rn(t,"danger")}),numara.main.import(numara.import),Ve("#exportButton").addEventListener("click",()=>{let t=Xt.get("pages").find(r=>r.id===Ge.activePage).name;numara.export(t,Rt.getValue())}),numara.exportData((e,t)=>{Rn(t,"success")}),numara.exportDataError((e,t)=>{Rn(t,"danger")}),numara.main.export(()=>{numara.export(Ve("#newPageTitleInput").value,Rt.getValue())}),numara.main.print(()=>{lc.default.offcanvas("#sidePanel").hide(),window.print()})):Kn("#exportButton, #importButton, #spDivider").forEach(e=>e.remove());g();x();v();function x1(e,t){return new Promise(function(r,n){try{(t==="func"?new Function(`'use strict'; let window; let numara; math.import({${e}}, {override: true})`):new Function(`'use strict'; let window; let numara; math.createUnit({${e}}, {override: true})`))();let o=new Function(`'use strict'; return {${e}}`);for(let u in o())Ge[t==="func"?"udfList":"uduList"].push(u);Xt.set(t==="func"?"udf":"udu",e),r()}catch(i){n(i)}})}Ve("#dialog-udfu-save-f").addEventListener("click",()=>{x1(zf.getValue().trim(),"func").then(()=>{location.reload()}).catch(e=>{cl(e.name,e.message)})});Ve("#dialog-udfu-save-u").addEventListener("click",()=>{x1(Uf.getValue().trim(),"unit").then(()=>{location.reload()}).catch(e=>{cl(e.name,e.message)})});var Fa=ln(Wg(),1),gte=ln(pte(),1);g();x();v();(function(e){var t={},r=e.prototype.stopCallback;e.prototype.stopCallback=function(n,i,o,u){var l=this;return l.paused?!0:t[o]||t[u]?!1:r.call(l,n,i,o)},e.prototype.bindGlobal=function(n,i,o){var u=this;if(u.bind(n,i,o),n instanceof Array){for(var l=0;l -
    `;Ve("#gitLink").setAttribute("href",Ib);Ve("#webLink").setAttribute("href",tM.url);Ve("#licenseLink").setAttribute("href",Ib+"/blob/master/LICENSE");Ve("#helpLink").setAttribute("href",Ib+"/wiki");Bi?(numara.themeUpdate(hn.apply),numara.fullscreen()):"serviceWorker"in navigator&&navigator.serviceWorker.register("./sw.js").catch(()=>{console.log("Service worker registration failed.")});Bi&&!MO?(Ve("#header-mac").remove(),Ve("#header-win").style.display="block",Ve("#header-win-title").innerHTML=Ob,Ve("#max").style.display=numara.isMaximized()?"none":"block",Ve("#unmax").style.display=numara.isMaximized()?"block":"none",Ve("#min").addEventListener("click",numara.minimize),Ve("#max").addEventListener("click",numara.maximize),Ve("#unmax").addEventListener("click",numara.unmaximize),Ve("#close").addEventListener("click",numara.close),numara.isMax((e,t)=>{Ve("#unmax").style.display=t?"block":"none",Ve("#max").style.display=t?"none":"block"}),Ve("#header-win").addEventListener("dblclick",NE)):(Ve("#header-win").remove(),Ve("#header-mac").style.display="block",Ve("#header-mac-title").innerHTML=Ob,Bi&&Ve("#header-mac").addEventListener("dblclick",NE));$h();hn.initialize();Ge.settings.currency&&Eb();Xt.get("pages")?(Ge.activePage=uO(),$d(uO())):v1();ute();Xt.get("udf")||Xt.set("udf","");Xt.get("udu")||Xt.set("udu","");y1(Xt.get("udf"),"func");y1(Xt.get("udu"),"unit");zl();Ve("#clearButton").addEventListener("click",()=>{Rt.getValue()!==""&&(Rt.setValue(""),Rt.focus(),Qa())});Ve("#copyButton").addEventListener("click",()=>{LC()});Ve("#udfuButton").addEventListener("click",()=>{bu("#dialog-udfu")});Ve("#settingsButton").addEventListener("click",()=>{bu("#dialog-settings")});Ve("#aboutButton").addEventListener("click",()=>{bu("#dialog-about")});Ve("#output").addEventListener("click",e=>{switch(e.target.className){case"answer":navigator.clipboard.writeText(e.target.dataset.copy),Rn(`Copied '${e.target.dataset.copy}' to clipboard.`);break;case"plotButton":{let t=e.target.getAttribute("data-func");Ge.plotFunction=t.startsWith("line")?Ge.mathScope[t]:t;try{Ve("#plotCrossModal").checked=Ge.settings.plotCross,Ve("#plotDerivativeModal").checked=Ge.settings.plotDerivative,Ve("#plotGridModal").checked=Ge.settings.plotGrid,uc(),bu("#dialog-plot")}catch(r){yf("Error",r)}break}case"lineError":yf("Error on Line "+e.target.getAttribute("data-line"),e.target.getAttribute("data-error"));break}e.stopPropagation()});Ve("#output").addEventListener("mousedown",()=>{let e=document.getElementsByClassName("CodeMirror-selected");for(;e[0];)e[0].classList.remove("CodeMirror-selected")});var hte,cO=!1,dte=Ve("#panel"),dN=Ve("#panelDivider"),yte=()=>{dN.title=Ve("#input").style.width===hn.defaults.inputWidth+"%"?"Drag to resize":"Double click to reset position"};dN.addEventListener("dblclick",()=>{Ge.settings.inputWidth=hn.defaults.inputWidth,Xt.set("settings",Ge.settings),hn.apply(),yte()});dN.addEventListener("mousedown",e=>{cO=e.target===dN});Ve("#panel").addEventListener("mouseup",()=>{cO=!1});Ve("#panel").addEventListener("mousemove",e=>{if(cO){let t=Ge.settings.lineNumbers?12:27,n=(e.clientX-dte.offsetLeft-t)/dte.clientWidth*100,i=n<0?0:n>100?100:n;Ve("#input").style.width=i+"%",Ge.settings.inputWidth=i,Xt.set("settings",Ge.settings),clearTimeout(hte),hte=setTimeout(Qa,10)}yte()});Fa.default.mixin({data:{offset:5}},"tooltip");Fa.default.util.on("#dialog-settings","beforeshow",hn.prep);Fa.default.util.on("#setswitch","beforeshow",e=>{e.stopPropagation()});Fa.default.util.on("#dialog-udfu","shown",e=>{if(e.target.id==="dialog-udfu"){let t=Xt.get("udf").trim(),r=Xt.get("udu").trim();zf.setValue(t),Uf.setValue(r)}});Fa.default.util.on("#udfuSwitcher","shown",()=>{Rt.getInputField().blur()});Fa.default.util.on(".modal","hidden",()=>{setTimeout(()=>{Rt.focus()},100)});Fa.default.util.on("#dialog-plot","shown",uc);Fa.default.util.on("#dialog-plot","hide",()=>{Ge.activePlot=!1});Fa.default.util.on("#pageList","moved",()=>{fte(),zl()});Fa.default.util.on("#dialog-newPage","shown",()=>{Ve("#newPageTitleInput").setAttribute("placeholder",g1()),Ve("#newPageTitleInput").focus()});Fa.default.util.on("#dialog-renamePage","shown",()=>{setTimeout(()=>{Ve("#renamePageTitleInput").focus(),Ve("#renamePageTitleInput").select()},20)});Fa.default.util.on("#sidePanel","hidden",()=>{setTimeout(()=>{Rt.focus()},20)});document.addEventListener("keydown",e=>{Ge.refreshCM=!e.repeat});document.addEventListener("keyup",()=>{Ge.refreshCM=!0});var gte;window.addEventListener("resize",()=>{Ge.activePlot&&Ve("#dialog-plot").classList.contains("uk-open")&&uc(),clearTimeout(gte),gte=setTimeout(Qa,10),Hy()});var lO=!1,fO=!1,gN=Ve(".CodeMirror-scroll"),x1=Ve("#output");gN.addEventListener("scroll",()=>{lO||(fO=!0,x1.scrollTop=gN.scrollTop),lO=!1});x1.addEventListener("scroll",()=>{fO||(lO=!0,gN.scrollTop=x1.scrollTop),fO=!1,Ve("#scrollTop").style.display=x1.scrollTop>50?"block":"none"});Ve("#scrollTop").addEventListener("click",()=>{gN.scrollTop=0,x1.scrollTop=0});var ISe={clearButton:["command+d","ctrl+d"],exportButton:["command+e","ctrl+e"],importButton:["command+i","ctrl+i"],newPageButton:["command+n","ctrl+n"],printButton:["command+p","ctrl+p"],sidePanelButton:["tab"]};for(let[e,t]of Object.entries(ISe))vte.default.bindGlobal(t,r=>{r.preventDefault(),Kn(".uk-open").length===0?Ve("#"+e).click():Ve("#sidePanel").classList.contains("uk-open")&&!Ve("#dialog-newPage").classList.contains("uk-open")&&Ve("#closeSidePanelButton").click()});TO();Ve("#restartButton").addEventListener("click",()=>{numara.updateApp()});Bi&&Ve("#dialog-about-appVersion").addEventListener("click",e=>{e.detail===9&&numara.openDevTools()});window.addEventListener("beforeprint",()=>{let e=document.createElement("div");e.setAttribute("id","printArea"),e.className="printArea",e.innerHTML=` +
    `;Ve("#gitLink").setAttribute("href",Ib);Ve("#webLink").setAttribute("href",tM.url);Ve("#licenseLink").setAttribute("href",Ib+"/blob/master/LICENSE");Ve("#helpLink").setAttribute("href",Ib+"/wiki");Bi?(numara.themeUpdate(hn.apply),numara.fullscreen()):"serviceWorker"in navigator&&navigator.serviceWorker.register("./sw.js").catch(()=>{console.log("Service worker registration failed.")});Bi&&!MO?(Ve("#header-mac").remove(),Ve("#header-win").style.display="block",Ve("#header-win-title").innerHTML=Ob,Ve("#max").style.display=numara.isMaximized()?"none":"block",Ve("#unmax").style.display=numara.isMaximized()?"block":"none",Ve("#min").addEventListener("click",numara.minimize),Ve("#max").addEventListener("click",numara.maximize),Ve("#unmax").addEventListener("click",numara.unmaximize),Ve("#close").addEventListener("click",numara.close),numara.isMax((e,t)=>{Ve("#unmax").style.display=t?"block":"none",Ve("#max").style.display=t?"none":"block"}),Ve("#header-win").addEventListener("dblclick",NS)):(Ve("#header-win").remove(),Ve("#header-mac").style.display="block",Ve("#header-mac-title").innerHTML=Ob,Bi&&Ve("#header-mac").addEventListener("dblclick",NS));Hh();hn.initialize();Ge.settings.currency&&Sb();Xt.get("pages")?(Ge.activePage=uO(),Hd(uO())):v1();ute();Xt.get("udf")||Xt.set("udf","");Xt.get("udu")||Xt.set("udu","");x1(Xt.get("udf"),"func");x1(Xt.get("udu"),"unit");Ul();Ve("#clearButton").addEventListener("click",()=>{Rt.getValue()!==""&&(Rt.setValue(""),Rt.focus(),Tu())});Ve("#copyButton").addEventListener("click",()=>{LC()});Ve("#udfuButton").addEventListener("click",()=>{wu("#dialog-udfu")});Ve("#settingsButton").addEventListener("click",()=>{wu("#dialog-settings")});Ve("#aboutButton").addEventListener("click",()=>{wu("#dialog-about")});Ve("#output").addEventListener("click",e=>{switch(e.target.className){case"answer":navigator.clipboard.writeText(e.target.dataset.copy),Rn(`Copied '${e.target.dataset.copy}' to clipboard.`);break;case"plotButton":{let t=e.target.getAttribute("data-func");Ge.plotFunction=t.startsWith("line")?Ge.mathScope[t]:t;try{Ve("#plotCrossModal").checked=Ge.settings.plotCross,Ve("#plotDerivativeModal").checked=Ge.settings.plotDerivative,Ve("#plotGridModal").checked=Ge.settings.plotGrid,uc(),wu("#dialog-plot")}catch(r){cl("Error",r)}break}case"lineError":cl("Error on Line "+e.target.getAttribute("data-line"),e.target.getAttribute("data-error"));break}e.stopPropagation()});Ve("#output").addEventListener("mousedown",()=>{let e=document.getElementsByClassName("CodeMirror-selected");for(;e[0];)e[0].classList.remove("CodeMirror-selected")});var mte,cO=!1,hte=Ve("#panel"),dN=Ve("#panelDivider"),vte=()=>{dN.title=Ve("#input").style.width===hn.defaults.inputWidth+"%"?"Drag to resize":"Double click to reset position"};dN.addEventListener("dblclick",()=>{Ge.settings.inputWidth=hn.defaults.inputWidth,Xt.set("settings",Ge.settings),hn.apply(),vte()});dN.addEventListener("mousedown",e=>{cO=e.target===dN});Ve("#panel").addEventListener("mouseup",()=>{cO=!1});Ve("#panel").addEventListener("mousemove",e=>{if(cO){let t=Ge.settings.lineNumbers?12:27,n=(e.clientX-hte.offsetLeft-t)/hte.clientWidth*100,i=n<0?0:n>100?100:n;Ve("#input").style.width=i+"%",Ge.settings.inputWidth=i,Xt.set("settings",Ge.settings),clearTimeout(mte),mte=setTimeout(Tu,10)}vte()});Fa.default.mixin({data:{offset:5}},"tooltip");Fa.default.util.on("#dialog-settings","beforeshow",hn.prep);Fa.default.util.on("#setswitch","beforeshow",e=>{e.stopPropagation()});Fa.default.util.on("#dialog-udfu","shown",e=>{if(e.target.id==="dialog-udfu"){let t=Xt.get("udf").trim(),r=Xt.get("udu").trim();zf.setValue(t),Uf.setValue(r)}});Fa.default.util.on("#udfuSwitcher","shown",()=>{Rt.getInputField().blur()});Fa.default.util.on(".modal","hidden",()=>{setTimeout(()=>{Rt.focus()},100)});Fa.default.util.on("#dialog-plot","shown",uc);Fa.default.util.on("#dialog-plot","hide",()=>{Ge.activePlot=!1});Fa.default.util.on("#pageList","moved",()=>{fte(),Ul()});Fa.default.util.on("#dialog-newPage","shown",()=>{Ve("#newPageTitleInput").setAttribute("placeholder",g1()),Ve("#newPageTitleInput").focus()});Fa.default.util.on("#dialog-renamePage","shown",()=>{setTimeout(()=>{Ve("#renamePageTitleInput").focus(),Ve("#renamePageTitleInput").select()},20)});Fa.default.util.on("#sidePanel","hidden",()=>{setTimeout(()=>{Rt.focus()},20)});document.addEventListener("keydown",e=>{Ge.refreshCM=!e.repeat});document.addEventListener("keyup",()=>{Ge.refreshCM=!0});var dte;window.addEventListener("resize",()=>{Ge.activePlot&&Ve("#dialog-plot").classList.contains("uk-open")&&uc(),clearTimeout(dte),dte=setTimeout(Tu,10),Hx()});var lO=!1,fO=!1,gN=Ve(".CodeMirror-scroll"),y1=Ve("#output");gN.addEventListener("scroll",()=>{lO||(fO=!0,y1.scrollTop=gN.scrollTop),lO=!1});y1.addEventListener("scroll",()=>{fO||(lO=!0,gN.scrollTop=y1.scrollTop),fO=!1,Ve("#scrollTop").style.display=y1.scrollTop>50?"block":"none"});Ve("#scrollTop").addEventListener("click",()=>{gN.scrollTop=0,y1.scrollTop=0});var OEe={clearButton:["command+d","ctrl+d"],exportButton:["command+e","ctrl+e"],importButton:["command+i","ctrl+i"],newPageButton:["command+n","ctrl+n"],printButton:["command+p","ctrl+p"],sidePanelButton:["tab"]};for(let[e,t]of Object.entries(OEe))gte.default.bindGlobal(t,r=>{r.preventDefault(),Kn(".uk-open").length===0?Ve("#"+e).click():Ve("#sidePanel").classList.contains("uk-open")&&!Ve("#dialog-newPage").classList.contains("uk-open")&&Ve("#closeSidePanelButton").click()});TO();Ve("#restartButton").addEventListener("click",()=>{numara.updateApp()});Bi&&Ve("#dialog-about-appVersion").addEventListener("click",e=>{e.detail===9&&numara.openDevTools()});window.addEventListener("beforeprint",()=>{let e=document.createElement("div");e.setAttribute("id","printArea"),e.className="printArea",e.innerHTML=`
    ${Ob}
    1) {\r\n for (var i = 1; i < arguments.length; i++)\r\n args[i - 1] = arguments[i];\r\n }\r\n queue.push(new Item(fun, args));\r\n if (queue.length === 1 && !draining)\r\n setTimeout(drainQueue, 0);\r\n}\r\n// v8 likes predictible objects\r\nfunction Item(fun, array) {\r\n this.fun = fun;\r\n this.array = array;\r\n}\r\nItem.prototype.run = function () {\r\n this.fun.apply(null, this.array);\r\n};\r\n\r\nvar title = 'browser';\r\nvar arch = 'x64';\r\nvar platform = 'browser';\r\nvar env = {\r\n PATH: '/usr/bin',\r\n LANG: navigator.language + '.UTF-8',\r\n PWD: '/',\r\n HOME: '/home',\r\n TMP: '/tmp',\r\n};\r\nvar argv = ['/usr/bin/node'];\r\nvar execArgv = [];\r\nvar version = 'v16.8.0';\r\nvar versions = {};\r\n\r\nvar emitWarning = function(message, type) {\r\n console.warn((type ? (type + ': ') : '') + message);\r\n};\r\n\r\nvar binding = function(name) { unimplemented('binding'); };\r\n\r\nvar umask = function(mask) { return 0; };\r\n\r\nvar cwd = function() { return '/'; };\r\nvar chdir = function(dir) {};\r\n\r\nvar release = {\r\n name: 'node',\r\n sourceUrl: '',\r\n headersUrl: '',\r\n libUrl: '',\r\n};\r\n\r\nfunction noop() {}\r\n\r\nvar _rawDebug = noop;\r\nvar moduleLoadList = [];\r\nfunction _linkedBinding(name) { unimplemented('_linkedBinding'); }\r\nvar domain = {};\r\nvar _exiting = false;\r\nvar config = {};\r\nfunction dlopen(name) { unimplemented('dlopen'); }\r\nfunction _getActiveRequests() { return []; }\r\nfunction _getActiveHandles() { return []; }\r\nvar reallyExit = noop;\r\nvar _kill = noop;\r\nvar cpuUsage = function() { return {}; };\r\nvar resourceUsage = cpuUsage;\r\nvar memoryUsage = cpuUsage;\r\nvar kill = noop;\r\nvar exit = noop;\r\nvar openStdin = noop;\r\nvar allowedNodeEnvironmentFlags = {};\r\nfunction assert(condition, message) {\r\n if (!condition) throw new Error(message || 'assertion error');\r\n}\r\nvar features = {\r\n inspector: false,\r\n debug: false,\r\n uv: false,\r\n ipv6: false,\r\n tls_alpn: false,\r\n tls_sni: false,\r\n tls_ocsp: false,\r\n tls: false,\r\n cached_builtins: true,\r\n};\r\nvar _fatalExceptions = noop;\r\nvar setUncaughtExceptionCaptureCallback = noop;\r\nfunction hasUncaughtExceptionCaptureCallback() { return false; }var _tickCallback = noop;\r\nvar _debugProcess = noop;\r\nvar _debugEnd = noop;\r\nvar _startProfilerIdleNotifier = noop;\r\nvar _stopProfilerIdleNotifier = noop;\r\nvar stdout = undefined;\r\nvar stderr = undefined;\r\nvar stdin = undefined;\r\nvar abort = noop;\r\nvar pid = 2;\r\nvar ppid = 1;\r\nvar execPath = '/bin/usr/node';\r\nvar debugPort = 9229;\r\nvar argv0 = 'node';\r\nvar _preload_modules = [];\r\nvar setSourceMapsEnabled = noop;\r\n\r\nvar _performance = {\r\n now: typeof performance !== 'undefined' ? performance.now.bind(performance) : undefined,\r\n timing: typeof performance !== 'undefined' ? performance.timing : undefined,\r\n};\r\nif (_performance.now === undefined) {\r\n var nowOffset = Date.now();\r\n\r\n if (_performance.timing && _performance.timing.navigationStart) {\r\n nowOffset = _performance.timing.navigationStart;\r\n }\r\n _performance.now = () => Date.now() - nowOffset;\r\n}\r\n\r\nfunction uptime() {\r\n return _performance.now() / 1000;\r\n}\r\n\r\nvar nanoPerSec = 1000000000;\r\nfunction hrtime(previousTimestamp) {\r\n var baseNow = Math.floor((Date.now() - _performance.now()) * 1e-3);\r\n var clocktime = _performance.now() * 1e-3;\r\n var seconds = Math.floor(clocktime) + baseNow;\r\n var nanoseconds = Math.floor((clocktime % 1) * 1e9);\r\n if (previousTimestamp) {\r\n seconds = seconds - previousTimestamp[0];\r\n nanoseconds = nanoseconds - previousTimestamp[1];\r\n if (nanoseconds < 0) {\r\n seconds--;\r\n nanoseconds += nanoPerSec;\r\n }\r\n }\r\n return [seconds, nanoseconds];\r\n}hrtime.bigint = function(time) {\r\n var diff = hrtime(time);\r\n if (typeof BigInt === 'undefined') {\r\n return diff[0] * nanoPerSec + diff[1];\r\n }\r\n return BigInt(diff[0] * nanoPerSec) + BigInt(diff[1]);\r\n};\r\n\r\nvar _maxListeners = 10;\r\nvar _events = {};\r\nvar _eventsCount = 0;\r\nfunction on () { return process }var addListener = on;\r\nvar once = on;\r\nvar off = on;\r\nvar removeListener = on;\r\nvar removeAllListeners = on;\r\nvar emit = noop;\r\nvar prependListener = on;\r\nvar prependOnceListener = on;\r\nfunction listeners (name) { return []; }\r\nvar process = {\r\n version,\r\n versions,\r\n arch,\r\n platform,\r\n release,\r\n _rawDebug,\r\n moduleLoadList,\r\n binding,\r\n _linkedBinding,\r\n _events,\r\n _eventsCount,\r\n _maxListeners,\r\n on,\r\n addListener,\r\n once,\r\n off,\r\n removeListener,\r\n removeAllListeners,\r\n emit,\r\n prependListener,\r\n prependOnceListener,\r\n listeners,\r\n domain,\r\n _exiting,\r\n config,\r\n dlopen,\r\n uptime,\r\n _getActiveRequests,\r\n _getActiveHandles,\r\n reallyExit,\r\n _kill,\r\n cpuUsage,\r\n resourceUsage,\r\n memoryUsage,\r\n kill,\r\n exit,\r\n openStdin,\r\n allowedNodeEnvironmentFlags,\r\n assert,\r\n features,\r\n _fatalExceptions,\r\n setUncaughtExceptionCaptureCallback,\r\n hasUncaughtExceptionCaptureCallback,\r\n emitWarning,\r\n nextTick,\r\n _tickCallback,\r\n _debugProcess,\r\n _debugEnd,\r\n _startProfilerIdleNotifier,\r\n _stopProfilerIdleNotifier,\r\n stdout,\r\n stdin,\r\n stderr,\r\n abort,\r\n umask,\r\n chdir,\r\n cwd,\r\n env,\r\n title,\r\n argv,\r\n execArgv,\r\n pid,\r\n ppid,\r\n execPath,\r\n debugPort,\r\n hrtime,\r\n argv0,\r\n _preload_modules,\r\n setSourceMapsEnabled,\r\n};\n\nexport { _debugEnd, _debugProcess, _events, _eventsCount, _exiting, _fatalExceptions, _getActiveHandles, _getActiveRequests, _kill, _linkedBinding, _maxListeners, _preload_modules, _rawDebug, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, _tickCallback, abort, addListener, allowedNodeEnvironmentFlags, arch, argv, argv0, assert, binding, chdir, config, cpuUsage, cwd, debugPort, process as default, dlopen, domain, emit, emitWarning, env, execArgv, execPath, exit, features, hasUncaughtExceptionCaptureCallback, hrtime, kill, listeners, memoryUsage, moduleLoadList, nextTick, off, on, once, openStdin, pid, platform, ppid, prependListener, prependOnceListener, reallyExit, release, removeAllListeners, removeListener, resourceUsage, setSourceMapsEnabled, setUncaughtExceptionCaptureCallback, stderr, stdin, stdout, title, umask, uptime, version, versions };\n", "export * as process from \"process\";\n", "var exports$3 = {},\n _dewExec$2 = false;\nfunction dew$2() {\n if (_dewExec$2) return exports$3;\n _dewExec$2 = true;\n exports$3.byteLength = byteLength;\n exports$3.toByteArray = toByteArray;\n exports$3.fromByteArray = fromByteArray;\n var lookup = [];\n var revLookup = [];\n var Arr = typeof Uint8Array !== \"undefined\" ? Uint8Array : Array;\n var code = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n for (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i];\n revLookup[code.charCodeAt(i)] = i;\n } // Support decoding URL-safe base64 strings, as Node.js does.\n // See: https://en.wikipedia.org/wiki/Base64#URL_applications\n\n\n revLookup[\"-\".charCodeAt(0)] = 62;\n revLookup[\"_\".charCodeAt(0)] = 63;\n\n function getLens(b64) {\n var len = b64.length;\n\n if (len % 4 > 0) {\n throw new Error(\"Invalid string. Length must be a multiple of 4\");\n } // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n\n\n var validLen = b64.indexOf(\"=\");\n if (validLen === -1) validLen = len;\n var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;\n return [validLen, placeHoldersLen];\n } // base64 is 4/3 + up to two characters of the original data\n\n\n function byteLength(b64) {\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n\n function _byteLength(b64, validLen, placeHoldersLen) {\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n\n function toByteArray(b64) {\n var tmp;\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));\n var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars\n\n var len = placeHoldersLen > 0 ? validLen - 4 : validLen;\n var i;\n\n for (i = 0; i < len; i += 4) {\n tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];\n arr[curByte++] = tmp >> 16 & 255;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n\n if (placeHoldersLen === 2) {\n tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;\n arr[curByte++] = tmp & 255;\n }\n\n if (placeHoldersLen === 1) {\n tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n\n return arr;\n }\n\n function tripletToBase64(num) {\n return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];\n }\n\n function encodeChunk(uint8, start, end) {\n var tmp;\n var output = [];\n\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);\n output.push(tripletToBase64(tmp));\n }\n\n return output.join(\"\");\n }\n\n function fromByteArray(uint8) {\n var tmp;\n var len = uint8.length;\n var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n\n var parts = [];\n var maxChunkLength = 16383; // must be multiple of 3\n // go through the array every three bytes, we'll deal with trailing stuff later\n\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n } // pad the end with zeros, but make sure to not forget the extra bytes\n\n\n if (extraBytes === 1) {\n tmp = uint8[len - 1];\n parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + \"==\");\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1];\n parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + \"=\");\n }\n\n return parts.join(\"\");\n }\n\n return exports$3;\n}\n\nvar exports$2 = {},\n _dewExec$1 = false;\nfunction dew$1() {\n if (_dewExec$1) return exports$2;\n _dewExec$1 = true;\n\n /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\n exports$2.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = -7;\n var i = isLE ? nBytes - 1 : 0;\n var d = isLE ? -1 : 1;\n var s = buffer[offset + i];\n i += d;\n e = s & (1 << -nBits) - 1;\n s >>= -nBits;\n nBits += eLen;\n\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : (s ? -1 : 1) * Infinity;\n } else {\n m = m + Math.pow(2, mLen);\n e = e - eBias;\n }\n\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\n };\n\n exports$2.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;\n var i = isLE ? 0 : nBytes - 1;\n var d = isLE ? 1 : -1;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n value = Math.abs(value);\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0;\n e = eMax;\n } else {\n e = Math.floor(Math.log(value) / Math.LN2);\n\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * Math.pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {}\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128;\n };\n\n return exports$2;\n}\n\nvar exports$1 = {},\n _dewExec = false;\nfunction dew() {\n if (_dewExec) return exports$1;\n _dewExec = true;\n\n const base64 = dew$2();\n\n const ieee754 = dew$1();\n\n const customInspectSymbol = typeof Symbol === \"function\" && typeof Symbol[\"for\"] === \"function\" ? Symbol[\"for\"](\"nodejs.util.inspect.custom\") // eslint-disable-line dot-notation\n : null;\n exports$1.Buffer = Buffer;\n exports$1.SlowBuffer = SlowBuffer;\n exports$1.INSPECT_MAX_BYTES = 50;\n const K_MAX_LENGTH = 2147483647;\n exports$1.kMaxLength = K_MAX_LENGTH;\n /**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\n\n Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport();\n\n if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(\"This browser lacks typed array (Uint8Array) support which is required by \" + \"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.\");\n }\n\n function typedArraySupport() {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1);\n const proto = {\n foo: function () {\n return 42;\n }\n };\n Object.setPrototypeOf(proto, Uint8Array.prototype);\n Object.setPrototypeOf(arr, proto);\n return arr.foo() === 42;\n } catch (e) {\n return false;\n }\n }\n\n Object.defineProperty(Buffer.prototype, \"parent\", {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined;\n return this.buffer;\n }\n });\n Object.defineProperty(Buffer.prototype, \"offset\", {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined;\n return this.byteOffset;\n }\n });\n\n function createBuffer(length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError(\"The value \\\"\" + length + \"\\\" is invalid for option \\\"size\\\"\");\n } // Return an augmented `Uint8Array` instance\n\n\n const buf = new Uint8Array(length);\n Object.setPrototypeOf(buf, Buffer.prototype);\n return buf;\n }\n /**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\n\n function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === \"number\") {\n if (typeof encodingOrOffset === \"string\") {\n throw new TypeError(\"The \\\"string\\\" argument must be of type string. Received type number\");\n }\n\n return allocUnsafe(arg);\n }\n\n return from(arg, encodingOrOffset, length);\n }\n\n Buffer.poolSize = 8192; // not used by this implementation\n\n function from(value, encodingOrOffset, length) {\n if (typeof value === \"string\") {\n return fromString(value, encodingOrOffset);\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value);\n }\n\n if (value == null) {\n throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, \" + \"or Array-like Object. Received type \" + typeof value);\n }\n\n if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n\n if (typeof SharedArrayBuffer !== \"undefined\" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n\n if (typeof value === \"number\") {\n throw new TypeError(\"The \\\"value\\\" argument must not be of type number. Received type number\");\n }\n\n const valueOf = value.valueOf && value.valueOf();\n\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length);\n }\n\n const b = fromObject(value);\n if (b) return b;\n\n if (typeof Symbol !== \"undefined\" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === \"function\") {\n return Buffer.from(value[Symbol.toPrimitive](\"string\"), encodingOrOffset, length);\n }\n\n throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, \" + \"or Array-like Object. Received type \" + typeof value);\n }\n /**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\n\n\n Buffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length);\n }; // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n // https://github.com/feross/buffer/pull/148\n\n\n Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype);\n Object.setPrototypeOf(Buffer, Uint8Array);\n\n function assertSize(size) {\n if (typeof size !== \"number\") {\n throw new TypeError(\"\\\"size\\\" argument must be of type number\");\n } else if (size < 0) {\n throw new RangeError(\"The value \\\"\" + size + \"\\\" is invalid for option \\\"size\\\"\");\n }\n }\n\n function alloc(size, fill, encoding) {\n assertSize(size);\n\n if (size <= 0) {\n return createBuffer(size);\n }\n\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === \"string\" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);\n }\n\n return createBuffer(size);\n }\n /**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\n\n\n Buffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding);\n };\n\n function allocUnsafe(size) {\n assertSize(size);\n return createBuffer(size < 0 ? 0 : checked(size) | 0);\n }\n /**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\n\n\n Buffer.allocUnsafe = function (size) {\n return allocUnsafe(size);\n };\n /**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\n\n\n Buffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size);\n };\n\n function fromString(string, encoding) {\n if (typeof encoding !== \"string\" || encoding === \"\") {\n encoding = \"utf8\";\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError(\"Unknown encoding: \" + encoding);\n }\n\n const length = byteLength(string, encoding) | 0;\n let buf = createBuffer(length);\n const actual = buf.write(string, encoding);\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual);\n }\n\n return buf;\n }\n\n function fromArrayLike(array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0;\n const buf = createBuffer(length);\n\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255;\n }\n\n return buf;\n }\n\n function fromArrayView(arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView);\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);\n }\n\n return fromArrayLike(arrayView);\n }\n\n function fromArrayBuffer(array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError(\"\\\"offset\\\" is outside of buffer bounds\");\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError(\"\\\"length\\\" is outside of buffer bounds\");\n }\n\n let buf;\n\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array);\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset);\n } else {\n buf = new Uint8Array(array, byteOffset, length);\n } // Return an augmented `Uint8Array` instance\n\n\n Object.setPrototypeOf(buf, Buffer.prototype);\n return buf;\n }\n\n function fromObject(obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0;\n const buf = createBuffer(len);\n\n if (buf.length === 0) {\n return buf;\n }\n\n obj.copy(buf, 0, 0, len);\n return buf;\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== \"number\" || numberIsNaN(obj.length)) {\n return createBuffer(0);\n }\n\n return fromArrayLike(obj);\n }\n\n if (obj.type === \"Buffer\" && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data);\n }\n }\n\n function checked(length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError(\"Attempt to allocate Buffer larger than maximum \" + \"size: 0x\" + K_MAX_LENGTH.toString(16) + \" bytes\");\n }\n\n return length | 0;\n }\n\n function SlowBuffer(length) {\n if (+length != length) {\n // eslint-disable-line eqeqeq\n length = 0;\n }\n\n return Buffer.alloc(+length);\n }\n\n Buffer.isBuffer = function isBuffer(b) {\n return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false\n };\n\n Buffer.compare = function compare(a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength);\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength);\n\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\"The \\\"buf1\\\", \\\"buf2\\\" arguments must be one of type Buffer or Uint8Array\");\n }\n\n if (a === b) return 0;\n let x = a.length;\n let y = b.length;\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n };\n\n Buffer.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case \"hex\":\n case \"utf8\":\n case \"utf-8\":\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n case \"base64\":\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return true;\n\n default:\n return false;\n }\n };\n\n Buffer.concat = function concat(list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError(\"\\\"list\\\" argument must be an Array of Buffers\");\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0);\n }\n\n let i;\n\n if (length === undefined) {\n length = 0;\n\n for (i = 0; i < list.length; ++i) {\n length += list[i].length;\n }\n }\n\n const buffer = Buffer.allocUnsafe(length);\n let pos = 0;\n\n for (i = 0; i < list.length; ++i) {\n let buf = list[i];\n\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf);\n buf.copy(buffer, pos);\n } else {\n Uint8Array.prototype.set.call(buffer, buf, pos);\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError(\"\\\"list\\\" argument must be an Array of Buffers\");\n } else {\n buf.copy(buffer, pos);\n }\n\n pos += buf.length;\n }\n\n return buffer;\n };\n\n function byteLength(string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length;\n }\n\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength;\n }\n\n if (typeof string !== \"string\") {\n throw new TypeError(\"The \\\"string\\\" argument must be one of type string, Buffer, or ArrayBuffer. \" + \"Received type \" + typeof string);\n }\n\n const len = string.length;\n const mustMatch = arguments.length > 2 && arguments[2] === true;\n if (!mustMatch && len === 0) return 0; // Use a for loop to avoid recursion\n\n let loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n return len;\n\n case \"utf8\":\n case \"utf-8\":\n return utf8ToBytes(string).length;\n\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return len * 2;\n\n case \"hex\":\n return len >>> 1;\n\n case \"base64\":\n return base64ToBytes(string).length;\n\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8\n }\n\n encoding = (\"\" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n }\n\n Buffer.byteLength = byteLength;\n\n function slowToString(encoding, start, end) {\n let loweredCase = false; // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n\n if (start === undefined || start < 0) {\n start = 0;\n } // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n\n\n if (start > this.length) {\n return \"\";\n }\n\n if (end === undefined || end > this.length) {\n end = this.length;\n }\n\n if (end <= 0) {\n return \"\";\n } // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n\n\n end >>>= 0;\n start >>>= 0;\n\n if (end <= start) {\n return \"\";\n }\n\n if (!encoding) encoding = \"utf8\";\n\n while (true) {\n switch (encoding) {\n case \"hex\":\n return hexSlice(this, start, end);\n\n case \"utf8\":\n case \"utf-8\":\n return utf8Slice(this, start, end);\n\n case \"ascii\":\n return asciiSlice(this, start, end);\n\n case \"latin1\":\n case \"binary\":\n return latin1Slice(this, start, end);\n\n case \"base64\":\n return base64Slice(this, start, end);\n\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return utf16leSlice(this, start, end);\n\n default:\n if (loweredCase) throw new TypeError(\"Unknown encoding: \" + encoding);\n encoding = (encoding + \"\").toLowerCase();\n loweredCase = true;\n }\n }\n } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n // to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n // reliably in a browserify context because there could be multiple different\n // copies of the 'buffer' package in use. This method works even for Buffer\n // instances that were created from another copy of the `buffer` package.\n // See: https://github.com/feross/buffer/issues/154\n\n\n Buffer.prototype._isBuffer = true;\n\n function swap(b, n, m) {\n const i = b[n];\n b[n] = b[m];\n b[m] = i;\n }\n\n Buffer.prototype.swap16 = function swap16() {\n const len = this.length;\n\n if (len % 2 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 16-bits\");\n }\n\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1);\n }\n\n return this;\n };\n\n Buffer.prototype.swap32 = function swap32() {\n const len = this.length;\n\n if (len % 4 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 32-bits\");\n }\n\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3);\n swap(this, i + 1, i + 2);\n }\n\n return this;\n };\n\n Buffer.prototype.swap64 = function swap64() {\n const len = this.length;\n\n if (len % 8 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 64-bits\");\n }\n\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7);\n swap(this, i + 1, i + 6);\n swap(this, i + 2, i + 5);\n swap(this, i + 3, i + 4);\n }\n\n return this;\n };\n\n Buffer.prototype.toString = function toString() {\n const length = this.length;\n if (length === 0) return \"\";\n if (arguments.length === 0) return utf8Slice(this, 0, length);\n return slowToString.apply(this, arguments);\n };\n\n Buffer.prototype.toLocaleString = Buffer.prototype.toString;\n\n Buffer.prototype.equals = function equals(b) {\n if (!Buffer.isBuffer(b)) throw new TypeError(\"Argument must be a Buffer\");\n if (this === b) return true;\n return Buffer.compare(this, b) === 0;\n };\n\n Buffer.prototype.inspect = function inspect() {\n let str = \"\";\n const max = exports$1.INSPECT_MAX_BYTES;\n str = this.toString(\"hex\", 0, max).replace(/(.{2})/g, \"$1 \").trim();\n if (this.length > max) str += \" ... \";\n return \"\";\n };\n\n if (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect;\n }\n\n Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength);\n }\n\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\"The \\\"target\\\" argument must be one of type Buffer or Uint8Array. \" + \"Received type \" + typeof target);\n }\n\n if (start === undefined) {\n start = 0;\n }\n\n if (end === undefined) {\n end = target ? target.length : 0;\n }\n\n if (thisStart === undefined) {\n thisStart = 0;\n }\n\n if (thisEnd === undefined) {\n thisEnd = this.length;\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError(\"out of range index\");\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0;\n }\n\n if (thisStart >= thisEnd) {\n return -1;\n }\n\n if (start >= end) {\n return 1;\n }\n\n start >>>= 0;\n end >>>= 0;\n thisStart >>>= 0;\n thisEnd >>>= 0;\n if (this === target) return 0;\n let x = thisEnd - thisStart;\n let y = end - start;\n const len = Math.min(x, y);\n const thisCopy = this.slice(thisStart, thisEnd);\n const targetCopy = target.slice(start, end);\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i];\n y = targetCopy[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n // OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n //\n // Arguments:\n // - buffer - a Buffer to search\n // - val - a string, Buffer, or number\n // - byteOffset - an index into `buffer`; will be clamped to an int32\n // - encoding - an optional encoding, relevant is val is a string\n // - dir - true for indexOf, false for lastIndexOf\n\n\n function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === \"string\") {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 2147483647) {\n byteOffset = 2147483647;\n } else if (byteOffset < -2147483648) {\n byteOffset = -2147483648;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === \"string\") {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === \"number\") {\n val = val & 255; // Search for a byte value [0-255]\n\n if (typeof Uint8Array.prototype.indexOf === \"function\") {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError(\"val must be string, number or Buffer\");\n }\n\n function arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n let indexSize = 1;\n let arrLength = arr.length;\n let valLength = val.length;\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase();\n\n if (encoding === \"ucs2\" || encoding === \"ucs-2\" || encoding === \"utf16le\" || encoding === \"utf-16le\") {\n if (arr.length < 2 || val.length < 2) {\n return -1;\n }\n\n indexSize = 2;\n arrLength /= 2;\n valLength /= 2;\n byteOffset /= 2;\n }\n }\n\n function read(buf, i) {\n if (indexSize === 1) {\n return buf[i];\n } else {\n return buf.readUInt16BE(i * indexSize);\n }\n }\n\n let i;\n\n if (dir) {\n let foundIndex = -1;\n\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i;\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;\n } else {\n if (foundIndex !== -1) i -= i - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;\n\n for (i = byteOffset; i >= 0; i--) {\n let found = true;\n\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false;\n break;\n }\n }\n\n if (found) return i;\n }\n }\n\n return -1;\n }\n\n Buffer.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1;\n };\n\n Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true);\n };\n\n Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false);\n };\n\n function hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0;\n const remaining = buf.length - offset;\n\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n\n if (length > remaining) {\n length = remaining;\n }\n }\n\n const strLen = string.length;\n\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n\n let i;\n\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16);\n if (numberIsNaN(parsed)) return i;\n buf[offset + i] = parsed;\n }\n\n return i;\n }\n\n function utf8Write(buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);\n }\n\n function asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length);\n }\n\n function base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length);\n }\n\n function ucs2Write(buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);\n }\n\n Buffer.prototype.write = function write(string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = \"utf8\";\n length = this.length;\n offset = 0; // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === \"string\") {\n encoding = offset;\n length = this.length;\n offset = 0; // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0;\n\n if (isFinite(length)) {\n length = length >>> 0;\n if (encoding === undefined) encoding = \"utf8\";\n } else {\n encoding = length;\n length = undefined;\n }\n } else {\n throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");\n }\n\n const remaining = this.length - offset;\n if (length === undefined || length > remaining) length = remaining;\n\n if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {\n throw new RangeError(\"Attempt to write outside buffer bounds\");\n }\n\n if (!encoding) encoding = \"utf8\";\n let loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case \"hex\":\n return hexWrite(this, string, offset, length);\n\n case \"utf8\":\n case \"utf-8\":\n return utf8Write(this, string, offset, length);\n\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n return asciiWrite(this, string, offset, length);\n\n case \"base64\":\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length);\n\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return ucs2Write(this, string, offset, length);\n\n default:\n if (loweredCase) throw new TypeError(\"Unknown encoding: \" + encoding);\n encoding = (\"\" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n };\n\n Buffer.prototype.toJSON = function toJSON() {\n return {\n type: \"Buffer\",\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n };\n\n function base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf);\n } else {\n return base64.fromByteArray(buf.slice(start, end));\n }\n }\n\n function utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end);\n const res = [];\n let i = start;\n\n while (i < end) {\n const firstByte = buf[i];\n let codePoint = null;\n let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint;\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 128) {\n codePoint = firstByte;\n }\n\n break;\n\n case 2:\n secondByte = buf[i + 1];\n\n if ((secondByte & 192) === 128) {\n tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;\n\n if (tempCodePoint > 127) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 3:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;\n\n if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 4:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n fourthByte = buf[i + 3];\n\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;\n\n if (tempCodePoint > 65535 && tempCodePoint < 1114112) {\n codePoint = tempCodePoint;\n }\n }\n\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 65533;\n bytesPerSequence = 1;\n } else if (codePoint > 65535) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 65536;\n res.push(codePoint >>> 10 & 1023 | 55296);\n codePoint = 56320 | codePoint & 1023;\n }\n\n res.push(codePoint);\n i += bytesPerSequence;\n }\n\n return decodeCodePointsArray(res);\n } // Based on http://stackoverflow.com/a/22747272/680742, the browser with\n // the lowest limit is Chrome, with 0x10000 args.\n // We go 1 magnitude less, for safety\n\n\n const MAX_ARGUMENTS_LENGTH = 4096;\n\n function decodeCodePointsArray(codePoints) {\n const len = codePoints.length;\n\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints); // avoid extra slice()\n } // Decode in chunks to avoid \"call stack size exceeded\".\n\n\n let res = \"\";\n let i = 0;\n\n while (i < len) {\n res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));\n }\n\n return res;\n }\n\n function asciiSlice(buf, start, end) {\n let ret = \"\";\n end = Math.min(buf.length, end);\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 127);\n }\n\n return ret;\n }\n\n function latin1Slice(buf, start, end) {\n let ret = \"\";\n end = Math.min(buf.length, end);\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i]);\n }\n\n return ret;\n }\n\n function hexSlice(buf, start, end) {\n const len = buf.length;\n if (!start || start < 0) start = 0;\n if (!end || end < 0 || end > len) end = len;\n let out = \"\";\n\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]];\n }\n\n return out;\n }\n\n function utf16leSlice(buf, start, end) {\n const bytes = buf.slice(start, end);\n let res = \"\"; // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);\n }\n\n return res;\n }\n\n Buffer.prototype.slice = function slice(start, end) {\n const len = this.length;\n start = ~~start;\n end = end === undefined ? len : ~~end;\n\n if (start < 0) {\n start += len;\n if (start < 0) start = 0;\n } else if (start > len) {\n start = len;\n }\n\n if (end < 0) {\n end += len;\n if (end < 0) end = 0;\n } else if (end > len) {\n end = len;\n }\n\n if (end < start) end = start;\n const newBuf = this.subarray(start, end); // Return an augmented `Uint8Array` instance\n\n Object.setPrototypeOf(newBuf, Buffer.prototype);\n return newBuf;\n };\n /*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\n\n\n function checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0) throw new RangeError(\"offset is not uint\");\n if (offset + ext > length) throw new RangeError(\"Trying to access beyond buffer length\");\n }\n\n Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n let val = this[offset];\n let mul = 1;\n let i = 0;\n\n while (++i < byteLength && (mul *= 256)) {\n val += this[offset + i] * mul;\n }\n\n return val;\n };\n\n Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n\n let val = this[offset + --byteLength];\n let mul = 1;\n\n while (byteLength > 0 && (mul *= 256)) {\n val += this[offset + --byteLength] * mul;\n }\n\n return val;\n };\n\n Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n return this[offset];\n };\n\n Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] | this[offset + 1] << 8;\n };\n\n Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] << 8 | this[offset + 1];\n };\n\n Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;\n };\n\n Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);\n };\n\n Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;\n const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;\n return BigInt(lo) + (BigInt(hi) << BigInt(32));\n });\n Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;\n return (BigInt(hi) << BigInt(32)) + BigInt(lo);\n });\n\n Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n let val = this[offset];\n let mul = 1;\n let i = 0;\n\n while (++i < byteLength && (mul *= 256)) {\n val += this[offset + i] * mul;\n }\n\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n };\n\n Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n let i = byteLength;\n let mul = 1;\n let val = this[offset + --i];\n\n while (i > 0 && (mul *= 256)) {\n val += this[offset + --i] * mul;\n }\n\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n };\n\n Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n if (!(this[offset] & 128)) return this[offset];\n return (255 - this[offset] + 1) * -1;\n };\n\n Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset] | this[offset + 1] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n\n Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset + 1] | this[offset] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n\n Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;\n };\n\n Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];\n };\n\n Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); // Overflow\n\n return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);\n });\n Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);\n });\n\n Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, true, 23, 4);\n };\n\n Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, false, 23, 4);\n };\n\n Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, true, 52, 8);\n };\n\n Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, false, 52, 8);\n };\n\n function checkInt(buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError(\"\\\"buffer\\\" argument must be a Buffer instance\");\n if (value > max || value < min) throw new RangeError(\"\\\"value\\\" argument is out of bounds\");\n if (offset + ext > buf.length) throw new RangeError(\"Index out of range\");\n }\n\n Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n let mul = 1;\n let i = 0;\n this[offset] = value & 255;\n\n while (++i < byteLength && (mul *= 256)) {\n this[offset + i] = value / mul & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n let i = byteLength - 1;\n let mul = 1;\n this[offset + i] = value & 255;\n\n while (--i >= 0 && (mul *= 256)) {\n this[offset + i] = value / mul & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 255, 0);\n this[offset] = value & 255;\n return offset + 1;\n };\n\n Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n\n Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n\n Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset + 3] = value >>> 24;\n this[offset + 2] = value >>> 16;\n this[offset + 1] = value >>> 8;\n this[offset] = value & 255;\n return offset + 4;\n };\n\n Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n\n function wrtBigUInt64LE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo = Number(value & BigInt(4294967295));\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n return offset;\n }\n\n function wrtBigUInt64BE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo = Number(value & BigInt(4294967295));\n buf[offset + 7] = lo;\n lo = lo >> 8;\n buf[offset + 6] = lo;\n lo = lo >> 8;\n buf[offset + 5] = lo;\n lo = lo >> 8;\n buf[offset + 4] = lo;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset + 3] = hi;\n hi = hi >> 8;\n buf[offset + 2] = hi;\n hi = hi >> 8;\n buf[offset + 1] = hi;\n hi = hi >> 8;\n buf[offset] = hi;\n return offset + 8;\n }\n\n Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt(\"0xffffffffffffffff\"));\n });\n Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt(\"0xffffffffffffffff\"));\n });\n\n Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n let i = 0;\n let mul = 1;\n let sub = 0;\n this[offset] = value & 255;\n\n while (++i < byteLength && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n let i = byteLength - 1;\n let mul = 1;\n let sub = 0;\n this[offset + i] = value & 255;\n\n while (--i >= 0 && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 127, -128);\n if (value < 0) value = 255 + value + 1;\n this[offset] = value & 255;\n return offset + 1;\n };\n\n Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n\n Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n\n Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n this[offset + 2] = value >>> 16;\n this[offset + 3] = value >>> 24;\n return offset + 4;\n };\n\n Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n if (value < 0) value = 4294967295 + value + 1;\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n\n Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt(\"0x8000000000000000\"), BigInt(\"0x7fffffffffffffff\"));\n });\n Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt(\"0x8000000000000000\"), BigInt(\"0x7fffffffffffffff\"));\n });\n\n function checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError(\"Index out of range\");\n if (offset < 0) throw new RangeError(\"Index out of range\");\n }\n\n function writeFloat(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 23, 4);\n return offset + 4;\n }\n\n Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert);\n };\n\n Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert);\n };\n\n function writeDouble(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 52, 8);\n return offset + 8;\n }\n\n Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert);\n };\n\n Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert);\n }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\n\n\n Buffer.prototype.copy = function copy(target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError(\"argument should be a Buffer\");\n if (!start) start = 0;\n if (!end && end !== 0) end = this.length;\n if (targetStart >= target.length) targetStart = target.length;\n if (!targetStart) targetStart = 0;\n if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done\n\n if (end === start) return 0;\n if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions\n\n if (targetStart < 0) {\n throw new RangeError(\"targetStart out of bounds\");\n }\n\n if (start < 0 || start >= this.length) throw new RangeError(\"Index out of range\");\n if (end < 0) throw new RangeError(\"sourceEnd out of bounds\"); // Are we oob?\n\n if (end > this.length) end = this.length;\n\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start;\n }\n\n const len = end - start;\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === \"function\") {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end);\n } else {\n Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart);\n }\n\n return len;\n }; // Usage:\n // buffer.fill(number[, offset[, end]])\n // buffer.fill(buffer[, offset[, end]])\n // buffer.fill(string[, offset[, end]][, encoding])\n\n\n Buffer.prototype.fill = function fill(val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === \"string\") {\n if (typeof start === \"string\") {\n encoding = start;\n start = 0;\n end = this.length;\n } else if (typeof end === \"string\") {\n encoding = end;\n end = this.length;\n }\n\n if (encoding !== undefined && typeof encoding !== \"string\") {\n throw new TypeError(\"encoding must be a string\");\n }\n\n if (typeof encoding === \"string\" && !Buffer.isEncoding(encoding)) {\n throw new TypeError(\"Unknown encoding: \" + encoding);\n }\n\n if (val.length === 1) {\n const code = val.charCodeAt(0);\n\n if (encoding === \"utf8\" && code < 128 || encoding === \"latin1\") {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code;\n }\n }\n } else if (typeof val === \"number\") {\n val = val & 255;\n } else if (typeof val === \"boolean\") {\n val = Number(val);\n } // Invalid ranges are not set to a default, so can range check early.\n\n\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError(\"Out of range index\");\n }\n\n if (end <= start) {\n return this;\n }\n\n start = start >>> 0;\n end = end === undefined ? this.length : end >>> 0;\n if (!val) val = 0;\n let i;\n\n if (typeof val === \"number\") {\n for (i = start; i < end; ++i) {\n this[i] = val;\n }\n } else {\n const bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding);\n const len = bytes.length;\n\n if (len === 0) {\n throw new TypeError(\"The value \\\"\" + val + \"\\\" is invalid for argument \\\"value\\\"\");\n }\n\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len];\n }\n }\n\n return this;\n }; // CUSTOM ERRORS\n // =============\n // Simplified versions from Node, changed for Buffer-only usage\n\n\n const errors = {};\n\n function E(sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor() {\n super();\n Object.defineProperty(this, \"message\", {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n }); // Add the error code to the name to include it in the stack trace.\n\n this.name = `${this.name} [${sym}]`; // Access the stack to generate the error message including the error code\n // from the name.\n\n this.stack; // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n\n delete this.name;\n }\n\n get code() {\n return sym;\n }\n\n set code(value) {\n Object.defineProperty(this, \"code\", {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n });\n }\n\n toString() {\n return `${this.name} [${sym}]: ${this.message}`;\n }\n\n };\n }\n\n E(\"ERR_BUFFER_OUT_OF_BOUNDS\", function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`;\n }\n\n return \"Attempt to access memory outside buffer bounds\";\n }, RangeError);\n E(\"ERR_INVALID_ARG_TYPE\", function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`;\n }, TypeError);\n E(\"ERR_OUT_OF_RANGE\", function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`;\n let received = input;\n\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input));\n } else if (typeof input === \"bigint\") {\n received = String(input);\n\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received);\n }\n\n received += \"n\";\n }\n\n msg += ` It must be ${range}. Received ${received}`;\n return msg;\n }, RangeError);\n\n function addNumericalSeparator(val) {\n let res = \"\";\n let i = val.length;\n const start = val[0] === \"-\" ? 1 : 0;\n\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`;\n }\n\n return `${val.slice(0, i)}${res}`;\n } // CHECK FUNCTIONS\n // ===============\n\n\n function checkBounds(buf, offset, byteLength) {\n validateNumber(offset, \"offset\");\n\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1));\n }\n }\n\n function checkIntBI(value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === \"bigint\" ? \"n\" : \"\";\n let range;\n\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`;\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + `${(byteLength + 1) * 8 - 1}${n}`;\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`;\n }\n\n throw new errors.ERR_OUT_OF_RANGE(\"value\", range, value);\n }\n\n checkBounds(buf, offset, byteLength);\n }\n\n function validateNumber(value, name) {\n if (typeof value !== \"number\") {\n throw new errors.ERR_INVALID_ARG_TYPE(name, \"number\", value);\n }\n }\n\n function boundsError(value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type);\n throw new errors.ERR_OUT_OF_RANGE(type || \"offset\", \"an integer\", value);\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || \"offset\", `>= ${type ? 1 : 0} and <= ${length}`, value);\n } // HELPER FUNCTIONS\n // ================\n\n\n const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;\n\n function base64clean(str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split(\"=\")[0]; // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n\n str = str.trim().replace(INVALID_BASE64_RE, \"\"); // Node converts strings with length < 2 to ''\n\n if (str.length < 2) return \"\"; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n\n while (str.length % 4 !== 0) {\n str = str + \"=\";\n }\n\n return str;\n }\n\n function utf8ToBytes(string, units) {\n units = units || Infinity;\n let codePoint;\n const length = string.length;\n let leadSurrogate = null;\n const bytes = [];\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i); // is surrogate component\n\n if (codePoint > 55295 && codePoint < 57344) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 56319) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n } // valid lead\n\n\n leadSurrogate = codePoint;\n continue;\n } // 2 leads in a row\n\n\n if (codePoint < 56320) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n leadSurrogate = codePoint;\n continue;\n } // valid surrogate pair\n\n\n codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n }\n\n leadSurrogate = null; // encode utf8\n\n if (codePoint < 128) {\n if ((units -= 1) < 0) break;\n bytes.push(codePoint);\n } else if (codePoint < 2048) {\n if ((units -= 2) < 0) break;\n bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128);\n } else if (codePoint < 65536) {\n if ((units -= 3) < 0) break;\n bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);\n } else if (codePoint < 1114112) {\n if ((units -= 4) < 0) break;\n bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);\n } else {\n throw new Error(\"Invalid code point\");\n }\n }\n\n return bytes;\n }\n\n function asciiToBytes(str) {\n const byteArray = [];\n\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 255);\n }\n\n return byteArray;\n }\n\n function utf16leToBytes(str, units) {\n let c, hi, lo;\n const byteArray = [];\n\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break;\n c = str.charCodeAt(i);\n hi = c >> 8;\n lo = c % 256;\n byteArray.push(lo);\n byteArray.push(hi);\n }\n\n return byteArray;\n }\n\n function base64ToBytes(str) {\n return base64.toByteArray(base64clean(str));\n }\n\n function blitBuffer(src, dst, offset, length) {\n let i;\n\n for (i = 0; i < length; ++i) {\n if (i + offset >= dst.length || i >= src.length) break;\n dst[i + offset] = src[i];\n }\n\n return i;\n } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n // the `instanceof` check but they should be treated as of that type.\n // See: https://github.com/feross/buffer/issues/166\n\n\n function isInstance(obj, type) {\n return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;\n }\n\n function numberIsNaN(obj) {\n // For IE11 support\n return obj !== obj; // eslint-disable-line no-self-compare\n } // Create lookup table for `toString('hex')`\n // See: https://github.com/feross/buffer/issues/219\n\n\n const hexSliceLookupTable = function () {\n const alphabet = \"0123456789abcdef\";\n const table = new Array(256);\n\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16;\n\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j];\n }\n }\n\n return table;\n }(); // Return not function with Error if BigInt not supported\n\n\n function defineBigIntMethod(fn) {\n return typeof BigInt === \"undefined\" ? BufferBigIntNotDefined : fn;\n }\n\n function BufferBigIntNotDefined() {\n throw new Error(\"BigInt not supported\");\n }\n\n return exports$1;\n}\n\nconst exports = dew();\nexports['Buffer']; exports['SlowBuffer']; exports['INSPECT_MAX_BYTES']; exports['kMaxLength'];\n\nvar Buffer = exports.Buffer;\r\nvar INSPECT_MAX_BYTES = exports.INSPECT_MAX_BYTES;\r\nvar kMaxLength = exports.kMaxLength;\n\nexport { Buffer, INSPECT_MAX_BYTES, exports as default, kMaxLength };\n", "export { Buffer } from \"buffer\";\n", "/*! UIkit 3.21.5 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define('uikit', factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.UIkit = factory());\n})(this, (function () { 'use strict';\n\n const { hasOwnProperty, toString } = Object.prototype;\n function hasOwn(obj, key) {\n return hasOwnProperty.call(obj, key);\n }\n const hyphenateRe = /\\B([A-Z])/g;\n const hyphenate = memoize((str) => str.replace(hyphenateRe, \"-$1\").toLowerCase());\n const camelizeRe = /-(\\w)/g;\n const camelize = memoize(\n (str) => (str.charAt(0).toLowerCase() + str.slice(1)).replace(camelizeRe, (_, c) => c.toUpperCase())\n );\n const ucfirst = memoize((str) => str.charAt(0).toUpperCase() + str.slice(1));\n function startsWith(str, search) {\n var _a;\n return (_a = str == null ? void 0 : str.startsWith) == null ? void 0 : _a.call(str, search);\n }\n function endsWith(str, search) {\n var _a;\n return (_a = str == null ? void 0 : str.endsWith) == null ? void 0 : _a.call(str, search);\n }\n function includes(obj, search) {\n var _a;\n return (_a = obj == null ? void 0 : obj.includes) == null ? void 0 : _a.call(obj, search);\n }\n function findIndex(array, predicate) {\n var _a;\n return (_a = array == null ? void 0 : array.findIndex) == null ? void 0 : _a.call(array, predicate);\n }\n const { isArray, from: toArray } = Array;\n const { assign } = Object;\n function isFunction(obj) {\n return typeof obj === \"function\";\n }\n function isObject(obj) {\n return obj !== null && typeof obj === \"object\";\n }\n function isPlainObject(obj) {\n return toString.call(obj) === \"[object Object]\";\n }\n function isWindow(obj) {\n return isObject(obj) && obj === obj.window;\n }\n function isDocument(obj) {\n return nodeType(obj) === 9;\n }\n function isNode(obj) {\n return nodeType(obj) >= 1;\n }\n function isElement(obj) {\n return nodeType(obj) === 1;\n }\n function nodeType(obj) {\n return !isWindow(obj) && isObject(obj) && obj.nodeType;\n }\n function isBoolean(value) {\n return typeof value === \"boolean\";\n }\n function isString(value) {\n return typeof value === \"string\";\n }\n function isNumber(value) {\n return typeof value === \"number\";\n }\n function isNumeric(value) {\n return isNumber(value) || isString(value) && !isNaN(value - parseFloat(value));\n }\n function isEmpty(obj) {\n return !(isArray(obj) ? obj.length : isObject(obj) ? Object.keys(obj).length : false);\n }\n function isUndefined(value) {\n return value === void 0;\n }\n function toBoolean(value) {\n return isBoolean(value) ? value : value === \"true\" || value === \"1\" || value === \"\" ? true : value === \"false\" || value === \"0\" ? false : value;\n }\n function toNumber(value) {\n const number = Number(value);\n return isNaN(number) ? false : number;\n }\n function toFloat(value) {\n return parseFloat(value) || 0;\n }\n function toNode(element) {\n return element && toNodes(element)[0];\n }\n function toNodes(element) {\n return isNode(element) ? [element] : Array.from(element || []).filter(isNode);\n }\n function toWindow(element) {\n if (isWindow(element)) {\n return element;\n }\n element = toNode(element);\n const document = isDocument(element) ? element : element == null ? void 0 : element.ownerDocument;\n return (document == null ? void 0 : document.defaultView) || window;\n }\n function isEqual(value, other) {\n return value === other || isObject(value) && isObject(other) && Object.keys(value).length === Object.keys(other).length && each(value, (val, key) => val === other[key]);\n }\n function swap(value, a, b) {\n return value.replace(new RegExp(`${a}|${b}`, \"g\"), (match) => match === a ? b : a);\n }\n function last(array) {\n return array[array.length - 1];\n }\n function each(obj, cb) {\n for (const key in obj) {\n if (false === cb(obj[key], key)) {\n return false;\n }\n }\n return true;\n }\n function sortBy(array, prop) {\n return array.slice().sort(\n ({ [prop]: propA = 0 }, { [prop]: propB = 0 }) => propA > propB ? 1 : propB > propA ? -1 : 0\n );\n }\n function sumBy(array, iteratee) {\n return array.reduce(\n (sum, item) => sum + toFloat(isFunction(iteratee) ? iteratee(item) : item[iteratee]),\n 0\n );\n }\n function uniqueBy(array, prop) {\n const seen = /* @__PURE__ */ new Set();\n return array.filter(({ [prop]: check }) => seen.has(check) ? false : seen.add(check));\n }\n function pick(obj, props) {\n return props.reduce((res, prop) => ({ ...res, [prop]: obj[prop] }), {});\n }\n function clamp(number, min = 0, max = 1) {\n return Math.min(Math.max(toNumber(number) || 0, min), max);\n }\n function noop() {\n }\n function intersectRect(...rects) {\n return [\n [\"bottom\", \"top\"],\n [\"right\", \"left\"]\n ].every(\n ([minProp, maxProp]) => Math.min(...rects.map(({ [minProp]: min }) => min)) - Math.max(...rects.map(({ [maxProp]: max }) => max)) > 0\n );\n }\n function pointInRect(point, rect) {\n return point.x <= rect.right && point.x >= rect.left && point.y <= rect.bottom && point.y >= rect.top;\n }\n function ratio(dimensions, prop, value) {\n const aProp = prop === \"width\" ? \"height\" : \"width\";\n return {\n [aProp]: dimensions[prop] ? Math.round(value * dimensions[aProp] / dimensions[prop]) : dimensions[aProp],\n [prop]: value\n };\n }\n function contain(dimensions, maxDimensions) {\n dimensions = { ...dimensions };\n for (const prop in dimensions) {\n dimensions = dimensions[prop] > maxDimensions[prop] ? ratio(dimensions, prop, maxDimensions[prop]) : dimensions;\n }\n return dimensions;\n }\n function cover$1(dimensions, maxDimensions) {\n dimensions = contain(dimensions, maxDimensions);\n for (const prop in dimensions) {\n dimensions = dimensions[prop] < maxDimensions[prop] ? ratio(dimensions, prop, maxDimensions[prop]) : dimensions;\n }\n return dimensions;\n }\n const Dimensions = { ratio, contain, cover: cover$1 };\n function getIndex(i, elements, current = 0, finite = false) {\n elements = toNodes(elements);\n const { length } = elements;\n if (!length) {\n return -1;\n }\n i = isNumeric(i) ? toNumber(i) : i === \"next\" ? current + 1 : i === \"previous\" ? current - 1 : i === \"last\" ? length - 1 : elements.indexOf(toNode(i));\n if (finite) {\n return clamp(i, 0, length - 1);\n }\n i %= length;\n return i < 0 ? i + length : i;\n }\n function memoize(fn) {\n const cache = /* @__PURE__ */ Object.create(null);\n return (key, ...args) => cache[key] || (cache[key] = fn(key, ...args));\n }\n\n function addClass(element, ...classes) {\n for (const node of toNodes(element)) {\n const add = toClasses(classes).filter((cls) => !hasClass(node, cls));\n if (add.length) {\n node.classList.add(...add);\n }\n }\n }\n function removeClass(element, ...classes) {\n for (const node of toNodes(element)) {\n const remove = toClasses(classes).filter((cls) => hasClass(node, cls));\n if (remove.length) {\n node.classList.remove(...remove);\n }\n }\n }\n function replaceClass(element, oldClass, newClass) {\n newClass = toClasses(newClass);\n oldClass = toClasses(oldClass).filter((cls) => !includes(newClass, cls));\n removeClass(element, oldClass);\n addClass(element, newClass);\n }\n function hasClass(element, cls) {\n [cls] = toClasses(cls);\n return toNodes(element).some((node) => node.classList.contains(cls));\n }\n function toggleClass(element, cls, force) {\n const classes = toClasses(cls);\n if (!isUndefined(force)) {\n force = !!force;\n }\n for (const node of toNodes(element)) {\n for (const cls2 of classes) {\n node.classList.toggle(cls2, force);\n }\n }\n }\n function toClasses(str) {\n return str ? isArray(str) ? str.map(toClasses).flat() : String(str).split(\" \").filter(Boolean) : [];\n }\n\n function attr(element, name, value) {\n var _a;\n if (isObject(name)) {\n for (const key in name) {\n attr(element, key, name[key]);\n }\n return;\n }\n if (isUndefined(value)) {\n return (_a = toNode(element)) == null ? void 0 : _a.getAttribute(name);\n } else {\n for (const el of toNodes(element)) {\n if (isFunction(value)) {\n value = value.call(el, attr(el, name));\n }\n if (value === null) {\n removeAttr(el, name);\n } else {\n el.setAttribute(name, value);\n }\n }\n }\n }\n function hasAttr(element, name) {\n return toNodes(element).some((element2) => element2.hasAttribute(name));\n }\n function removeAttr(element, name) {\n toNodes(element).forEach((element2) => element2.removeAttribute(name));\n }\n function data(element, attribute) {\n for (const name of [attribute, `data-${attribute}`]) {\n if (hasAttr(element, name)) {\n return attr(element, name);\n }\n }\n }\n\n const inBrowser = typeof window !== \"undefined\";\n const isRtl = inBrowser && document.dir === \"rtl\";\n const hasTouch = inBrowser && \"ontouchstart\" in window;\n const hasPointerEvents = inBrowser && window.PointerEvent;\n const pointerDown$1 = hasPointerEvents ? \"pointerdown\" : hasTouch ? \"touchstart\" : \"mousedown\";\n const pointerMove$1 = hasPointerEvents ? \"pointermove\" : hasTouch ? \"touchmove\" : \"mousemove\";\n const pointerUp$1 = hasPointerEvents ? \"pointerup\" : hasTouch ? \"touchend\" : \"mouseup\";\n const pointerEnter = hasPointerEvents ? \"pointerenter\" : hasTouch ? \"\" : \"mouseenter\";\n const pointerLeave = hasPointerEvents ? \"pointerleave\" : hasTouch ? \"\" : \"mouseleave\";\n const pointerCancel = hasPointerEvents ? \"pointercancel\" : \"touchcancel\";\n\n const voidElements = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true\n };\n function isVoidElement(element) {\n return toNodes(element).some((element2) => voidElements[element2.tagName.toLowerCase()]);\n }\n const isVisibleFn = inBrowser && Element.prototype.checkVisibility || function() {\n return this.offsetWidth || this.offsetHeight || this.getClientRects().length;\n };\n function isVisible(element) {\n return toNodes(element).some((element2) => isVisibleFn.call(element2));\n }\n const selInput = \"input,select,textarea,button\";\n function isInput(element) {\n return toNodes(element).some((element2) => matches(element2, selInput));\n }\n const selFocusable = `${selInput},a[href],[tabindex]`;\n function isFocusable(element) {\n return matches(element, selFocusable);\n }\n function parent(element) {\n var _a;\n return (_a = toNode(element)) == null ? void 0 : _a.parentElement;\n }\n function filter$1(element, selector) {\n return toNodes(element).filter((element2) => matches(element2, selector));\n }\n function matches(element, selector) {\n return toNodes(element).some((element2) => element2.matches(selector));\n }\n function parents(element, selector) {\n const elements = [];\n while (element = parent(element)) {\n if (!selector || matches(element, selector)) {\n elements.push(element);\n }\n }\n return elements;\n }\n function children(element, selector) {\n element = toNode(element);\n const children2 = element ? toArray(element.children) : [];\n return selector ? filter$1(children2, selector) : children2;\n }\n function index(element, ref) {\n return ref ? toNodes(element).indexOf(toNode(ref)) : children(parent(element)).indexOf(element);\n }\n function isSameSiteAnchor(el) {\n el = toNode(el);\n return el && [\"origin\", \"pathname\", \"search\"].every((part) => el[part] === location[part]);\n }\n function getTargetedElement(el) {\n if (isSameSiteAnchor(el)) {\n const { hash, ownerDocument } = toNode(el);\n const id = decodeURIComponent(hash).slice(1);\n return ownerDocument.getElementById(id) || ownerDocument.getElementsByName(id)[0];\n }\n }\n\n function query(selector, context) {\n return find(selector, getContext(selector, context));\n }\n function queryAll(selector, context) {\n return findAll(selector, getContext(selector, context));\n }\n function find(selector, context) {\n return toNode(_query(selector, toNode(context), \"querySelector\"));\n }\n function findAll(selector, context) {\n return toNodes(_query(selector, toNode(context), \"querySelectorAll\"));\n }\n function getContext(selector, context = document) {\n return isString(selector) && parseSelector(selector).isContextSelector || isDocument(context) ? context : context.ownerDocument;\n }\n const addStarRe = /([!>+~-])(?=\\s+[!>+~-]|\\s*$)/g;\n const splitSelectorRe = /.*?[^\\\\](?![^(]*\\))(?:,|$)/g;\n const trailingCommaRe = /\\s*,$/;\n const parseSelector = memoize((selector) => {\n var _a;\n selector = selector.replace(addStarRe, \"$1 *\");\n let isContextSelector = false;\n const selectors = [];\n for (let sel of (_a = selector.match(splitSelectorRe)) != null ? _a : []) {\n sel = sel.replace(trailingCommaRe, \"\").trim();\n isContextSelector || (isContextSelector = [\"!\", \"+\", \"~\", \"-\", \">\"].includes(sel[0]));\n selectors.push(sel);\n }\n return {\n selector: selectors.join(\",\"),\n selectors,\n isContextSelector\n };\n });\n const parsePositionSelector = memoize((selector) => {\n selector = selector.slice(1).trim();\n const index2 = selector.indexOf(\" \");\n return ~index2 ? [selector.slice(0, index2), selector.slice(index2 + 1)] : [selector, \"\"];\n });\n function _query(selector, context = document, queryFn) {\n if (!selector || !isString(selector)) {\n return selector;\n }\n const parsed = parseSelector(selector);\n if (!parsed.isContextSelector) {\n return _doQuery(context, queryFn, parsed.selector);\n }\n selector = \"\";\n const isSingle = parsed.selectors.length === 1;\n for (let sel of parsed.selectors) {\n let positionSel;\n let ctx = context;\n if (sel[0] === \"!\") {\n [positionSel, sel] = parsePositionSelector(sel);\n ctx = context.parentElement.closest(positionSel);\n if (!sel && isSingle) {\n return ctx;\n }\n }\n if (ctx && sel[0] === \"-\") {\n [positionSel, sel] = parsePositionSelector(sel);\n ctx = ctx.previousElementSibling;\n ctx = matches(ctx, positionSel) ? ctx : null;\n if (!sel && isSingle) {\n return ctx;\n }\n }\n if (!ctx) {\n continue;\n }\n if (isSingle) {\n if (sel[0] === \"~\" || sel[0] === \"+\") {\n sel = `:scope > :nth-child(${index(ctx) + 1}) ${sel}`;\n ctx = ctx.parentElement;\n } else if (sel[0] === \">\") {\n sel = `:scope ${sel}`;\n }\n return _doQuery(ctx, queryFn, sel);\n }\n selector += `${selector ? \",\" : \"\"}${domPath(ctx)} ${sel}`;\n }\n if (!isDocument(context)) {\n context = context.ownerDocument;\n }\n return _doQuery(context, queryFn, selector);\n }\n function _doQuery(context, queryFn, selector) {\n try {\n return context[queryFn](selector);\n } catch (e) {\n return null;\n }\n }\n function domPath(element) {\n const names = [];\n while (element.parentNode) {\n const id = attr(element, \"id\");\n if (id) {\n names.unshift(`#${escape(id)}`);\n break;\n } else {\n let { tagName } = element;\n if (tagName !== \"HTML\") {\n tagName += `:nth-child(${index(element) + 1})`;\n }\n names.unshift(tagName);\n element = element.parentNode;\n }\n }\n return names.join(\" > \");\n }\n function escape(css) {\n return isString(css) ? CSS.escape(css) : \"\";\n }\n\n function on(...args) {\n let [targets, types, selector, listener, useCapture = false] = getArgs(args);\n if (listener.length > 1) {\n listener = detail(listener);\n }\n if (useCapture == null ? void 0 : useCapture.self) {\n listener = selfFilter(listener);\n }\n if (selector) {\n listener = delegate(selector, listener);\n }\n for (const type of types) {\n for (const target of targets) {\n target.addEventListener(type, listener, useCapture);\n }\n }\n return () => off(targets, types, listener, useCapture);\n }\n function off(...args) {\n let [targets, types, , listener, useCapture = false] = getArgs(args);\n for (const type of types) {\n for (const target of targets) {\n target.removeEventListener(type, listener, useCapture);\n }\n }\n }\n function once(...args) {\n const [element, types, selector, listener, useCapture = false, condition] = getArgs(args);\n const off2 = on(\n element,\n types,\n selector,\n (e) => {\n const result = !condition || condition(e);\n if (result) {\n off2();\n listener(e, result);\n }\n },\n useCapture\n );\n return off2;\n }\n function trigger(targets, event, detail2) {\n return toEventTargets(targets).every(\n (target) => target.dispatchEvent(createEvent(event, true, true, detail2))\n );\n }\n function createEvent(e, bubbles = true, cancelable = false, detail2) {\n if (isString(e)) {\n e = new CustomEvent(e, { bubbles, cancelable, detail: detail2 });\n }\n return e;\n }\n function getArgs(args) {\n args[0] = toEventTargets(args[0]);\n if (isString(args[1])) {\n args[1] = args[1].split(\" \");\n }\n if (isFunction(args[2])) {\n args.splice(2, 0, false);\n }\n return args;\n }\n function delegate(selector, listener) {\n return (e) => {\n const current = selector[0] === \">\" ? findAll(selector, e.currentTarget).reverse().find((element) => element.contains(e.target)) : e.target.closest(selector);\n if (current) {\n e.current = current;\n listener.call(this, e);\n delete e.current;\n }\n };\n }\n function detail(listener) {\n return (e) => isArray(e.detail) ? listener(e, ...e.detail) : listener(e);\n }\n function selfFilter(listener) {\n return function(e) {\n if (e.target === e.currentTarget || e.target === e.current) {\n return listener.call(null, e);\n }\n };\n }\n function isEventTarget(target) {\n return target && \"addEventListener\" in target;\n }\n function toEventTarget(target) {\n return isEventTarget(target) ? target : toNode(target);\n }\n function toEventTargets(target) {\n return isArray(target) ? target.map(toEventTarget).filter(Boolean) : isString(target) ? findAll(target) : isEventTarget(target) ? [target] : toNodes(target);\n }\n function isTouch(e) {\n return e.pointerType === \"touch\" || !!e.touches;\n }\n function getEventPos(e) {\n var _a, _b;\n const { clientX: x, clientY: y } = ((_a = e.touches) == null ? void 0 : _a[0]) || ((_b = e.changedTouches) == null ? void 0 : _b[0]) || e;\n return { x, y };\n }\n\n const cssNumber = {\n \"animation-iteration-count\": true,\n \"column-count\": true,\n \"fill-opacity\": true,\n \"flex-grow\": true,\n \"flex-shrink\": true,\n \"font-weight\": true,\n \"line-height\": true,\n opacity: true,\n order: true,\n orphans: true,\n \"stroke-dasharray\": true,\n \"stroke-dashoffset\": true,\n widows: true,\n \"z-index\": true,\n zoom: true\n };\n function css(element, property, value, priority) {\n const elements = toNodes(element);\n for (const element2 of elements) {\n if (isString(property)) {\n property = propName(property);\n if (isUndefined(value)) {\n return getComputedStyle(element2).getPropertyValue(property);\n } else {\n element2.style.setProperty(\n property,\n isNumeric(value) && !cssNumber[property] ? `${value}px` : value || isNumber(value) ? value : \"\",\n priority\n );\n }\n } else if (isArray(property)) {\n const props = {};\n for (const prop of property) {\n props[prop] = css(element2, prop);\n }\n return props;\n } else if (isObject(property)) {\n for (const prop in property) {\n css(element2, prop, property[prop], value);\n }\n }\n }\n return elements[0];\n }\n const propName = memoize((name) => {\n if (startsWith(name, \"--\")) {\n return name;\n }\n name = hyphenate(name);\n const { style } = document.documentElement;\n if (name in style) {\n return name;\n }\n for (const prefix of [\"webkit\", \"moz\"]) {\n const prefixedName = `-${prefix}-${name}`;\n if (prefixedName in style) {\n return prefixedName;\n }\n }\n });\n\n const clsTransition = \"uk-transition\";\n const transitionEnd = \"transitionend\";\n const transitionCanceled = \"transitioncanceled\";\n function transition$1(element, props, duration = 400, timing = \"linear\") {\n duration = Math.round(duration);\n return Promise.all(\n toNodes(element).map(\n (element2) => new Promise((resolve, reject) => {\n for (const name in props) {\n css(element2, name);\n }\n const timer = setTimeout(() => trigger(element2, transitionEnd), duration);\n once(\n element2,\n [transitionEnd, transitionCanceled],\n ({ type }) => {\n clearTimeout(timer);\n removeClass(element2, clsTransition);\n css(element2, {\n transitionProperty: \"\",\n transitionDuration: \"\",\n transitionTimingFunction: \"\"\n });\n type === transitionCanceled ? reject() : resolve(element2);\n },\n { self: true }\n );\n addClass(element2, clsTransition);\n css(element2, {\n transitionProperty: Object.keys(props).map(propName).join(\",\"),\n transitionDuration: `${duration}ms`,\n transitionTimingFunction: timing,\n ...props\n });\n })\n )\n );\n }\n const Transition = {\n start: transition$1,\n async stop(element) {\n trigger(element, transitionEnd);\n await Promise.resolve();\n },\n async cancel(element) {\n trigger(element, transitionCanceled);\n await Promise.resolve();\n },\n inProgress(element) {\n return hasClass(element, clsTransition);\n }\n };\n const clsAnimation = \"uk-animation\";\n const animationEnd = \"animationend\";\n const animationCanceled = \"animationcanceled\";\n function animate$2(element, animation, duration = 200, origin, out) {\n return Promise.all(\n toNodes(element).map(\n (element2) => new Promise((resolve, reject) => {\n if (hasClass(element2, clsAnimation)) {\n trigger(element2, animationCanceled);\n }\n const classes = [\n animation,\n clsAnimation,\n `${clsAnimation}-${out ? \"leave\" : \"enter\"}`,\n origin && `uk-transform-origin-${origin}`,\n out && `${clsAnimation}-reverse`\n ];\n const timer = setTimeout(() => trigger(element2, animationEnd), duration);\n once(\n element2,\n [animationEnd, animationCanceled],\n ({ type }) => {\n clearTimeout(timer);\n type === animationCanceled ? reject() : resolve(element2);\n css(element2, \"animationDuration\", \"\");\n removeClass(element2, classes);\n },\n { self: true }\n );\n css(element2, \"animationDuration\", `${duration}ms`);\n addClass(element2, classes);\n })\n )\n );\n }\n const Animation = {\n in: animate$2,\n out(element, animation, duration, origin) {\n return animate$2(element, animation, duration, origin, true);\n },\n inProgress(element) {\n return hasClass(element, clsAnimation);\n },\n cancel(element) {\n trigger(element, animationCanceled);\n }\n };\n\n function ready(fn) {\n if (document.readyState !== \"loading\") {\n fn();\n return;\n }\n once(document, \"DOMContentLoaded\", fn);\n }\n function isTag(element, ...tagNames) {\n return tagNames.some((tagName) => {\n var _a;\n return ((_a = element == null ? void 0 : element.tagName) == null ? void 0 : _a.toLowerCase()) === tagName.toLowerCase();\n });\n }\n function empty(element) {\n element = $(element);\n element.innerHTML = \"\";\n return element;\n }\n function html(parent2, html2) {\n return isUndefined(html2) ? $(parent2).innerHTML : append(empty(parent2), html2);\n }\n const prepend = applyFn(\"prepend\");\n const append = applyFn(\"append\");\n const before = applyFn(\"before\");\n const after = applyFn(\"after\");\n function applyFn(fn) {\n return function(ref, element) {\n var _a;\n const nodes = toNodes(isString(element) ? fragment(element) : element);\n (_a = $(ref)) == null ? void 0 : _a[fn](...nodes);\n return unwrapSingle(nodes);\n };\n }\n function remove$1(element) {\n toNodes(element).forEach((element2) => element2.remove());\n }\n function wrapAll(element, structure) {\n structure = toNode(before(element, structure));\n while (structure.firstElementChild) {\n structure = structure.firstElementChild;\n }\n append(structure, element);\n return structure;\n }\n function wrapInner(element, structure) {\n return toNodes(\n toNodes(element).map(\n (element2) => element2.hasChildNodes() ? wrapAll(toArray(element2.childNodes), structure) : append(element2, structure)\n )\n );\n }\n function unwrap(element) {\n toNodes(element).map(parent).filter((value, index, self) => self.indexOf(value) === index).forEach((parent2) => parent2.replaceWith(...parent2.childNodes));\n }\n const singleTagRe = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>)?$/;\n function fragment(html2) {\n const matches = singleTagRe.exec(html2);\n if (matches) {\n return document.createElement(matches[1]);\n }\n const container = document.createElement(\"template\");\n container.innerHTML = html2.trim();\n return unwrapSingle(container.content.childNodes);\n }\n function unwrapSingle(nodes) {\n return nodes.length > 1 ? nodes : nodes[0];\n }\n function apply(node, fn) {\n if (!isElement(node)) {\n return;\n }\n fn(node);\n node = node.firstElementChild;\n while (node) {\n const next = node.nextElementSibling;\n apply(node, fn);\n node = next;\n }\n }\n function $(selector, context) {\n return isHtml(selector) ? toNode(fragment(selector)) : find(selector, context);\n }\n function $$(selector, context) {\n return isHtml(selector) ? toNodes(fragment(selector)) : findAll(selector, context);\n }\n function isHtml(str) {\n return isString(str) && startsWith(str.trim(), \"<\");\n }\n\n const dirs$1 = {\n width: [\"left\", \"right\"],\n height: [\"top\", \"bottom\"]\n };\n function dimensions$1(element) {\n const rect = isElement(element) ? toNode(element).getBoundingClientRect() : { height: height(element), width: width(element), top: 0, left: 0 };\n return {\n height: rect.height,\n width: rect.width,\n top: rect.top,\n left: rect.left,\n bottom: rect.top + rect.height,\n right: rect.left + rect.width\n };\n }\n function offset(element, coordinates) {\n if (coordinates) {\n css(element, { left: 0, top: 0 });\n }\n const currentOffset = dimensions$1(element);\n if (element) {\n const { scrollY, scrollX } = toWindow(element);\n const offsetBy = { height: scrollY, width: scrollX };\n for (const dir in dirs$1) {\n for (const prop of dirs$1[dir]) {\n currentOffset[prop] += offsetBy[dir];\n }\n }\n }\n if (!coordinates) {\n return currentOffset;\n }\n for (const prop of [\"left\", \"top\"]) {\n css(element, prop, coordinates[prop] - currentOffset[prop]);\n }\n }\n function position(element) {\n let { top, left } = offset(element);\n const {\n ownerDocument: { body, documentElement },\n offsetParent\n } = toNode(element);\n let parent = offsetParent || documentElement;\n while (parent && (parent === body || parent === documentElement) && css(parent, \"position\") === \"static\") {\n parent = parent.parentNode;\n }\n if (isElement(parent)) {\n const parentOffset = offset(parent);\n top -= parentOffset.top + toFloat(css(parent, \"borderTopWidth\"));\n left -= parentOffset.left + toFloat(css(parent, \"borderLeftWidth\"));\n }\n return {\n top: top - toFloat(css(element, \"marginTop\")),\n left: left - toFloat(css(element, \"marginLeft\"))\n };\n }\n function offsetPosition(element) {\n element = toNode(element);\n const offset2 = [element.offsetTop, element.offsetLeft];\n while (element = element.offsetParent) {\n offset2[0] += element.offsetTop + toFloat(css(element, `borderTopWidth`));\n offset2[1] += element.offsetLeft + toFloat(css(element, `borderLeftWidth`));\n if (css(element, \"position\") === \"fixed\") {\n const win = toWindow(element);\n offset2[0] += win.scrollY;\n offset2[1] += win.scrollX;\n return offset2;\n }\n }\n return offset2;\n }\n const height = dimension(\"height\");\n const width = dimension(\"width\");\n function dimension(prop) {\n const propName = ucfirst(prop);\n return (element, value) => {\n if (isUndefined(value)) {\n if (isWindow(element)) {\n return element[`inner${propName}`];\n }\n if (isDocument(element)) {\n const doc = element.documentElement;\n return Math.max(doc[`offset${propName}`], doc[`scroll${propName}`]);\n }\n element = toNode(element);\n value = css(element, prop);\n value = value === \"auto\" ? element[`offset${propName}`] : toFloat(value) || 0;\n return value - boxModelAdjust(element, prop);\n } else {\n return css(\n element,\n prop,\n !value && value !== 0 ? \"\" : +value + boxModelAdjust(element, prop) + \"px\"\n );\n }\n };\n }\n function boxModelAdjust(element, prop, sizing = \"border-box\") {\n return css(element, \"boxSizing\") === sizing ? sumBy(\n dirs$1[prop].map(ucfirst),\n (prop2) => toFloat(css(element, `padding${prop2}`)) + toFloat(css(element, `border${prop2}Width`))\n ) : 0;\n }\n function flipPosition(pos) {\n for (const dir in dirs$1) {\n for (const i in dirs$1[dir]) {\n if (dirs$1[dir][i] === pos) {\n return dirs$1[dir][1 - i];\n }\n }\n }\n return pos;\n }\n function toPx(value, property = \"width\", element = window, offsetDim = false) {\n if (!isString(value)) {\n return toFloat(value);\n }\n return sumBy(parseCalc(value), (value2) => {\n const unit = parseUnit(value2);\n return unit ? percent(\n unit === \"vh\" ? getViewportHeight() : unit === \"vw\" ? width(toWindow(element)) : offsetDim ? element[`offset${ucfirst(property)}`] : dimensions$1(element)[property],\n value2\n ) : value2;\n });\n }\n const calcRe = /-?\\d+(?:\\.\\d+)?(?:v[wh]|%|px)?/g;\n const parseCalc = memoize((calc) => calc.toString().replace(/\\s/g, \"\").match(calcRe) || []);\n const unitRe$1 = /(?:v[hw]|%)$/;\n const parseUnit = memoize((str) => (str.match(unitRe$1) || [])[0]);\n function percent(base, value) {\n return base * toFloat(value) / 100;\n }\n let vh;\n let vhEl;\n function getViewportHeight() {\n if (vh) {\n return vh;\n }\n if (!vhEl) {\n vhEl = $(\"
    \");\n css(vhEl, {\n height: \"100vh\",\n position: \"fixed\"\n });\n on(window, \"resize\", () => vh = null);\n }\n append(document.body, vhEl);\n vh = vhEl.clientHeight;\n remove$1(vhEl);\n return vh;\n }\n\n const fastdom = { read, write, clear, flush };\n const reads = [];\n const writes = [];\n function read(task) {\n reads.push(task);\n scheduleFlush();\n return task;\n }\n function write(task) {\n writes.push(task);\n scheduleFlush();\n return task;\n }\n function clear(task) {\n remove(reads, task);\n remove(writes, task);\n }\n let scheduled = false;\n function flush() {\n runTasks(reads);\n runTasks(writes.splice(0));\n scheduled = false;\n if (reads.length || writes.length) {\n scheduleFlush();\n }\n }\n function scheduleFlush() {\n if (!scheduled) {\n scheduled = true;\n queueMicrotask(flush);\n }\n }\n function runTasks(tasks) {\n let task;\n while (task = tasks.shift()) {\n try {\n task();\n } catch (e) {\n console.error(e);\n }\n }\n }\n function remove(array, item) {\n const index = array.indexOf(item);\n return ~index && array.splice(index, 1);\n }\n\n class MouseTracker {\n init() {\n this.positions = [];\n let position;\n this.unbind = on(document, \"mousemove\", (e) => position = getEventPos(e));\n this.interval = setInterval(() => {\n if (!position) {\n return;\n }\n this.positions.push(position);\n if (this.positions.length > 5) {\n this.positions.shift();\n }\n }, 50);\n }\n cancel() {\n var _a;\n (_a = this.unbind) == null ? void 0 : _a.call(this);\n clearInterval(this.interval);\n }\n movesTo(target) {\n if (!this.positions || this.positions.length < 2) {\n return false;\n }\n const p = dimensions$1(target);\n const { left, right, top, bottom } = p;\n const [prevPosition] = this.positions;\n const position = last(this.positions);\n const path = [prevPosition, position];\n if (pointInRect(position, p)) {\n return false;\n }\n const diagonals = [\n [\n { x: left, y: top },\n { x: right, y: bottom }\n ],\n [\n { x: left, y: bottom },\n { x: right, y: top }\n ]\n ];\n return diagonals.some((diagonal) => {\n const intersection = intersect(path, diagonal);\n return intersection && pointInRect(intersection, p);\n });\n }\n }\n function intersect([{ x: x1, y: y1 }, { x: x2, y: y2 }], [{ x: x3, y: y3 }, { x: x4, y: y4 }]) {\n const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n if (denominator === 0) {\n return false;\n }\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n if (ua < 0) {\n return false;\n }\n return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };\n }\n\n function observeIntersection(targets, cb, options = {}, { intersecting = true } = {}) {\n const observer = new IntersectionObserver(\n intersecting ? (entries, observer2) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n cb(entries, observer2);\n }\n } : cb,\n options\n );\n for (const el of toNodes(targets)) {\n observer.observe(el);\n }\n return observer;\n }\n const hasResizeObserver = inBrowser && window.ResizeObserver;\n function observeResize(targets, cb, options = { box: \"border-box\" }) {\n if (hasResizeObserver) {\n return observe$1(ResizeObserver, targets, cb, options);\n }\n const off = [on(window, \"load resize\", cb), on(document, \"loadedmetadata load\", cb, true)];\n return { disconnect: () => off.map((cb2) => cb2()) };\n }\n function observeViewportResize(cb) {\n return { disconnect: on([window, window.visualViewport], \"resize\", cb) };\n }\n function observeMutation(targets, cb, options) {\n return observe$1(MutationObserver, targets, cb, options);\n }\n function observe$1(Observer, targets, cb, options) {\n const observer = new Observer(cb);\n for (const el of toNodes(targets)) {\n observer.observe(el, options);\n }\n return observer;\n }\n\n function play(el) {\n if (isIFrame(el)) {\n call(el, { func: \"playVideo\", method: \"play\" });\n }\n if (isHTML5(el)) {\n el.play();\n }\n }\n function pause(el) {\n if (isIFrame(el)) {\n call(el, { func: \"pauseVideo\", method: \"pause\" });\n }\n if (isHTML5(el)) {\n el.pause();\n }\n }\n function mute(el) {\n if (isIFrame(el)) {\n call(el, { func: \"mute\", method: \"setVolume\", value: 0 });\n }\n if (isHTML5(el)) {\n el.muted = true;\n }\n }\n function isVideo(el) {\n return isHTML5(el) || isIFrame(el);\n }\n function isHTML5(el) {\n return isTag(el, \"video\");\n }\n function isIFrame(el) {\n return isTag(el, \"iframe\") && (isYoutube(el) || isVimeo(el));\n }\n function isYoutube(el) {\n return !!el.src.match(\n /\\/\\/.*?youtube(-nocookie)?\\.[a-z]+\\/(watch\\?v=[^&\\s]+|embed)|youtu\\.be\\/.*/\n );\n }\n function isVimeo(el) {\n return !!el.src.match(/vimeo\\.com\\/video\\/.*/);\n }\n async function call(el, cmd) {\n await enableApi(el);\n post(el, cmd);\n }\n function post(el, cmd) {\n el.contentWindow.postMessage(JSON.stringify({ event: \"command\", ...cmd }), \"*\");\n }\n const stateKey = \"_ukPlayer\";\n let counter = 0;\n function enableApi(el) {\n if (el[stateKey]) {\n return el[stateKey];\n }\n const youtube = isYoutube(el);\n const vimeo = isVimeo(el);\n const id = ++counter;\n let poller;\n return el[stateKey] = new Promise((resolve) => {\n youtube && once(el, \"load\", () => {\n const listener = () => post(el, { event: \"listening\", id });\n poller = setInterval(listener, 100);\n listener();\n });\n once(window, \"message\", resolve, false, ({ data }) => {\n try {\n data = JSON.parse(data);\n return youtube && (data == null ? void 0 : data.id) === id && data.event === \"onReady\" || vimeo && Number(data == null ? void 0 : data.player_id) === id;\n } catch (e) {\n }\n });\n el.src = `${el.src}${includes(el.src, \"?\") ? \"&\" : \"?\"}${youtube ? \"enablejsapi=1\" : `api=1&player_id=${id}`}`;\n }).then(() => clearInterval(poller));\n }\n\n function isInView(element, offsetTop = 0, offsetLeft = 0) {\n if (!isVisible(element)) {\n return false;\n }\n return intersectRect(\n ...overflowParents(element).map((parent2) => {\n const { top, left, bottom, right } = offsetViewport(parent2);\n return {\n top: top - offsetTop,\n left: left - offsetLeft,\n bottom: bottom + offsetTop,\n right: right + offsetLeft\n };\n }).concat(offset(element))\n );\n }\n function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {\n const parents2 = isVisible(element) ? scrollParents(element, false, [\"hidden\"]) : [];\n return parents2.reduce(\n (fn, scrollElement, i) => {\n const { scrollTop, scrollHeight, offsetHeight } = scrollElement;\n const viewport = offsetViewport(scrollElement);\n const maxScroll = scrollHeight - viewport.height;\n const { height: elHeight, top: elTop } = parents2[i - 1] ? offsetViewport(parents2[i - 1]) : offset(element);\n let top = Math.ceil(elTop - viewport.top - offsetBy + scrollTop);\n if (offsetBy > 0 && offsetHeight < elHeight + offsetBy) {\n top += offsetBy;\n } else {\n offsetBy = 0;\n }\n if (top > maxScroll) {\n offsetBy -= top - maxScroll;\n top = maxScroll;\n } else if (top < 0) {\n offsetBy -= top;\n top = 0;\n }\n return () => scrollTo(scrollElement, top - scrollTop, element, maxScroll).then(fn);\n },\n () => Promise.resolve()\n )();\n function scrollTo(element2, top, targetEl, maxScroll) {\n return new Promise((resolve) => {\n const scroll = element2.scrollTop;\n const duration = getDuration(Math.abs(top));\n const start = Date.now();\n const isScrollingElement = scrollingElement(element2) === element2;\n const targetTop = offset(targetEl).top + (isScrollingElement ? 0 : scroll);\n let prev = 0;\n let frames = 15;\n (function step() {\n const percent = ease(clamp((Date.now() - start) / duration));\n let diff = 0;\n if (parents2[0] === element2 && scroll + top < maxScroll) {\n diff = offset(targetEl).top + (isScrollingElement ? 0 : element2.scrollTop) - targetTop - dimensions$1(getCoveringElement(targetEl)).height;\n }\n element2.scrollTop = scroll + (top + diff) * percent;\n if (percent === 1 && (prev === diff || !frames--)) {\n resolve();\n } else {\n prev = diff;\n requestAnimationFrame(step);\n }\n })();\n });\n }\n function getDuration(dist) {\n return 40 * Math.pow(dist, 0.375);\n }\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n }\n function scrolledOver(element, startOffset = 0, endOffset = 0) {\n if (!isVisible(element)) {\n return 0;\n }\n const scrollElement = scrollParent(element, true);\n const { scrollHeight, scrollTop } = scrollElement;\n const { height: viewportHeight } = offsetViewport(scrollElement);\n const maxScroll = scrollHeight - viewportHeight;\n const elementOffsetTop = offsetPosition(element)[0] - offsetPosition(scrollElement)[0];\n const start = Math.max(0, elementOffsetTop - viewportHeight + startOffset);\n const end = Math.min(maxScroll, elementOffsetTop + element.offsetHeight - endOffset);\n return start < end ? clamp((scrollTop - start) / (end - start)) : 1;\n }\n function scrollParents(element, scrollable = false, props = []) {\n const scrollEl = scrollingElement(element);\n let ancestors = parents(element).reverse();\n ancestors = ancestors.slice(ancestors.indexOf(scrollEl) + 1);\n const fixedIndex = findIndex(ancestors, (el) => css(el, \"position\") === \"fixed\");\n if (~fixedIndex) {\n ancestors = ancestors.slice(fixedIndex);\n }\n return [scrollEl].concat(\n ancestors.filter(\n (parent2) => css(parent2, \"overflow\").split(\" \").some((prop) => includes([\"auto\", \"scroll\", ...props], prop)) && (!scrollable || parent2.scrollHeight > offsetViewport(parent2).height)\n )\n ).reverse();\n }\n function scrollParent(...args) {\n return scrollParents(...args)[0];\n }\n function overflowParents(element) {\n return scrollParents(element, false, [\"hidden\", \"clip\"]);\n }\n function offsetViewport(scrollElement) {\n const window = toWindow(scrollElement);\n let viewportElement = scrollElement === scrollingElement(scrollElement) ? window : scrollElement;\n if (isWindow(viewportElement) && window.visualViewport) {\n let { height, width, scale, pageTop: top, pageLeft: left } = window.visualViewport;\n height = Math.round(height * scale);\n width = Math.round(width * scale);\n return { height, width, top, left, bottom: top + height, right: left + width };\n }\n let rect = offset(viewportElement);\n if (css(viewportElement, \"display\") === \"inline\") {\n return rect;\n }\n for (let [prop, dir, start, end] of [\n [\"width\", \"x\", \"left\", \"right\"],\n [\"height\", \"y\", \"top\", \"bottom\"]\n ]) {\n if (isWindow(viewportElement)) {\n viewportElement = viewportElement.document;\n } else {\n rect[start] += toFloat(css(viewportElement, `border-${start}-width`));\n }\n const subpixel = rect[prop] % 1;\n rect[prop] = rect[dir] = viewportElement[`client${ucfirst(prop)}`] - (subpixel ? subpixel < 0.5 ? -subpixel : 1 - subpixel : 0);\n rect[end] = rect[prop] + rect[start];\n }\n return rect;\n }\n function getCoveringElement(target) {\n const { left, width, top } = dimensions$1(target);\n for (const position of top ? [0, top] : [0]) {\n let coverEl;\n for (const el of toWindow(target).document.elementsFromPoint(left + width / 2, position)) {\n if (!el.contains(target) && // If e.g. Offcanvas is not yet closed\n !hasClass(el, \"uk-togglable-leave\") && (hasPosition(el, \"fixed\") && zIndex(\n parents(target).reverse().find(\n (parent2) => !parent2.contains(el) && !hasPosition(parent2, \"static\")\n )\n ) < zIndex(el) || hasPosition(el, \"sticky\") && parent(el).contains(target)) && (!coverEl || dimensions$1(coverEl).height < dimensions$1(el).height)) {\n coverEl = el;\n }\n }\n if (coverEl) {\n return coverEl;\n }\n }\n }\n function zIndex(element) {\n return toFloat(css(element, \"zIndex\"));\n }\n function hasPosition(element, position) {\n return css(element, \"position\") === position;\n }\n function scrollingElement(element) {\n return toWindow(element).document.scrollingElement;\n }\n\n const dirs = [\n [\"width\", \"x\", \"left\", \"right\"],\n [\"height\", \"y\", \"top\", \"bottom\"]\n ];\n function positionAt(element, target, options) {\n options = {\n attach: {\n element: [\"left\", \"top\"],\n target: [\"left\", \"top\"],\n ...options.attach\n },\n offset: [0, 0],\n placement: [],\n ...options\n };\n if (!isArray(target)) {\n target = [target, target];\n }\n offset(element, getPosition(element, target, options));\n }\n function getPosition(element, target, options) {\n const position = attachTo(element, target, options);\n const { boundary, viewportOffset = 0, placement } = options;\n let offsetPosition = position;\n for (const [i, [prop, , start, end]] of Object.entries(dirs)) {\n const viewport = getViewport$2(element, target[i], viewportOffset, boundary, i);\n if (isWithin(position, viewport, i)) {\n continue;\n }\n let offsetBy = 0;\n if (placement[i] === \"flip\") {\n const attach = options.attach.target[i];\n if (attach === end && position[end] <= viewport[end] || attach === start && position[start] >= viewport[start]) {\n continue;\n }\n offsetBy = flip(element, target, options, i)[start] - position[start];\n const scrollArea = getScrollArea(element, target[i], viewportOffset, i);\n if (!isWithin(applyOffset(position, offsetBy, i), scrollArea, i)) {\n if (isWithin(position, scrollArea, i)) {\n continue;\n }\n if (options.recursion) {\n return false;\n }\n const newPos = flipAxis(element, target, options);\n if (newPos && isWithin(newPos, scrollArea, 1 - i)) {\n return newPos;\n }\n continue;\n }\n } else if (placement[i] === \"shift\") {\n const targetDim = offset(target[i]);\n const { offset: elOffset } = options;\n offsetBy = clamp(\n clamp(position[start], viewport[start], viewport[end] - position[prop]),\n targetDim[start] - position[prop] + elOffset[i],\n targetDim[end] - elOffset[i]\n ) - position[start];\n }\n offsetPosition = applyOffset(offsetPosition, offsetBy, i);\n }\n return offsetPosition;\n }\n function attachTo(element, target, options) {\n let { attach, offset: offsetBy } = {\n attach: {\n element: [\"left\", \"top\"],\n target: [\"left\", \"top\"],\n ...options.attach\n },\n offset: [0, 0],\n ...options\n };\n let elOffset = offset(element);\n for (const [i, [prop, , start, end]] of Object.entries(dirs)) {\n const targetOffset = attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);\n elOffset = applyOffset(\n elOffset,\n targetOffset[start] - elOffset[start] + moveBy(attach.target[i], end, targetOffset[prop]) - moveBy(attach.element[i], end, elOffset[prop]) + +offsetBy[i],\n i\n );\n }\n return elOffset;\n }\n function applyOffset(position, offset2, i) {\n const [, dir, start, end] = dirs[i];\n const newPos = { ...position };\n newPos[start] = position[dir] = position[start] + offset2;\n newPos[end] += offset2;\n return newPos;\n }\n function moveBy(attach, end, dim) {\n return attach === \"center\" ? dim / 2 : attach === end ? dim : 0;\n }\n function getViewport$2(element, target, viewportOffset, boundary, i) {\n let viewport = getIntersectionArea(...commonScrollParents(element, target).map(offsetViewport));\n if (viewportOffset) {\n viewport[dirs[i][2]] += viewportOffset;\n viewport[dirs[i][3]] -= viewportOffset;\n }\n if (boundary) {\n viewport = getIntersectionArea(\n viewport,\n offset(isArray(boundary) ? boundary[i] : boundary)\n );\n }\n return viewport;\n }\n function getScrollArea(element, target, viewportOffset, i) {\n const [prop, axis, start, end] = dirs[i];\n const [scrollElement] = commonScrollParents(element, target);\n const viewport = offsetViewport(scrollElement);\n if ([\"auto\", \"scroll\"].includes(css(scrollElement, `overflow-${axis}`))) {\n viewport[start] -= scrollElement[`scroll${ucfirst(start)}`];\n viewport[end] = viewport[start] + scrollElement[`scroll${ucfirst(prop)}`];\n }\n viewport[start] += viewportOffset;\n viewport[end] -= viewportOffset;\n return viewport;\n }\n function commonScrollParents(element, target) {\n return overflowParents(target).filter((parent) => parent.contains(element));\n }\n function getIntersectionArea(...rects) {\n let area = {};\n for (const rect of rects) {\n for (const [, , start, end] of dirs) {\n area[start] = Math.max(area[start] || 0, rect[start]);\n area[end] = Math.min(...[area[end], rect[end]].filter(Boolean));\n }\n }\n return area;\n }\n function isWithin(positionA, positionB, i) {\n const [, , start, end] = dirs[i];\n return positionA[start] >= positionB[start] && positionA[end] <= positionB[end];\n }\n function flip(element, target, { offset: offset2, attach }, i) {\n return attachTo(element, target, {\n attach: {\n element: flipAttach(attach.element, i),\n target: flipAttach(attach.target, i)\n },\n offset: flipOffset(offset2, i)\n });\n }\n function flipAxis(element, target, options) {\n return getPosition(element, target, {\n ...options,\n attach: {\n element: options.attach.element.map(flipAttachAxis).reverse(),\n target: options.attach.target.map(flipAttachAxis).reverse()\n },\n offset: options.offset.reverse(),\n placement: options.placement.reverse(),\n recursion: true\n });\n }\n function flipAttach(attach, i) {\n const newAttach = [...attach];\n const index = dirs[i].indexOf(attach[i]);\n if (~index) {\n newAttach[i] = dirs[i][1 - index % 2 + 2];\n }\n return newAttach;\n }\n function flipAttachAxis(prop) {\n for (let i = 0; i < dirs.length; i++) {\n const index = dirs[i].indexOf(prop);\n if (~index) {\n return dirs[1 - i][index % 2 + 2];\n }\n }\n }\n function flipOffset(offset2, i) {\n offset2 = [...offset2];\n offset2[i] *= -1;\n return offset2;\n }\n\n var util = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $: $,\n $$: $$,\n Animation: Animation,\n Dimensions: Dimensions,\n MouseTracker: MouseTracker,\n Transition: Transition,\n addClass: addClass,\n after: after,\n append: append,\n apply: apply,\n assign: assign,\n attr: attr,\n before: before,\n boxModelAdjust: boxModelAdjust,\n camelize: camelize,\n children: children,\n clamp: clamp,\n createEvent: createEvent,\n css: css,\n data: data,\n dimensions: dimensions$1,\n each: each,\n empty: empty,\n endsWith: endsWith,\n escape: escape,\n fastdom: fastdom,\n filter: filter$1,\n find: find,\n findAll: findAll,\n findIndex: findIndex,\n flipPosition: flipPosition,\n fragment: fragment,\n getCoveringElement: getCoveringElement,\n getEventPos: getEventPos,\n getIndex: getIndex,\n getTargetedElement: getTargetedElement,\n hasAttr: hasAttr,\n hasClass: hasClass,\n hasOwn: hasOwn,\n hasTouch: hasTouch,\n height: height,\n html: html,\n hyphenate: hyphenate,\n inBrowser: inBrowser,\n includes: includes,\n index: index,\n intersectRect: intersectRect,\n isArray: isArray,\n isBoolean: isBoolean,\n isDocument: isDocument,\n isElement: isElement,\n isEmpty: isEmpty,\n isEqual: isEqual,\n isFocusable: isFocusable,\n isFunction: isFunction,\n isInView: isInView,\n isInput: isInput,\n isNode: isNode,\n isNumber: isNumber,\n isNumeric: isNumeric,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isRtl: isRtl,\n isSameSiteAnchor: isSameSiteAnchor,\n isString: isString,\n isTag: isTag,\n isTouch: isTouch,\n isUndefined: isUndefined,\n isVideo: isVideo,\n isVisible: isVisible,\n isVoidElement: isVoidElement,\n isWindow: isWindow,\n last: last,\n matches: matches,\n memoize: memoize,\n mute: mute,\n noop: noop,\n observeIntersection: observeIntersection,\n observeMutation: observeMutation,\n observeResize: observeResize,\n observeViewportResize: observeViewportResize,\n off: off,\n offset: offset,\n offsetPosition: offsetPosition,\n offsetViewport: offsetViewport,\n on: on,\n once: once,\n overflowParents: overflowParents,\n parent: parent,\n parents: parents,\n pause: pause,\n pick: pick,\n play: play,\n pointInRect: pointInRect,\n pointerCancel: pointerCancel,\n pointerDown: pointerDown$1,\n pointerEnter: pointerEnter,\n pointerLeave: pointerLeave,\n pointerMove: pointerMove$1,\n pointerUp: pointerUp$1,\n position: position,\n positionAt: positionAt,\n prepend: prepend,\n propName: propName,\n query: query,\n queryAll: queryAll,\n ready: ready,\n remove: remove$1,\n removeAttr: removeAttr,\n removeClass: removeClass,\n replaceClass: replaceClass,\n scrollIntoView: scrollIntoView,\n scrollParent: scrollParent,\n scrollParents: scrollParents,\n scrolledOver: scrolledOver,\n selFocusable: selFocusable,\n selInput: selInput,\n sortBy: sortBy,\n startsWith: startsWith,\n sumBy: sumBy,\n swap: swap,\n toArray: toArray,\n toBoolean: toBoolean,\n toEventTargets: toEventTargets,\n toFloat: toFloat,\n toNode: toNode,\n toNodes: toNodes,\n toNumber: toNumber,\n toPx: toPx,\n toWindow: toWindow,\n toggleClass: toggleClass,\n trigger: trigger,\n ucfirst: ucfirst,\n uniqueBy: uniqueBy,\n unwrap: unwrap,\n width: width,\n wrapAll: wrapAll,\n wrapInner: wrapInner\n });\n\n var Class = {\n connected() {\n addClass(this.$el, this.$options.id);\n }\n };\n\n const units = [\"days\", \"hours\", \"minutes\", \"seconds\"];\n var countdown = {\n mixins: [Class],\n props: {\n date: String,\n clsWrapper: String,\n role: String\n },\n data: {\n date: \"\",\n clsWrapper: \".uk-countdown-%unit%\",\n role: \"timer\"\n },\n connected() {\n attr(this.$el, \"role\", this.role);\n this.date = toFloat(Date.parse(this.$props.date));\n this.end = false;\n this.start();\n },\n disconnected() {\n this.stop();\n },\n events: {\n name: \"visibilitychange\",\n el: () => document,\n handler() {\n if (document.hidden) {\n this.stop();\n } else {\n this.start();\n }\n }\n },\n methods: {\n start() {\n this.stop();\n this.update();\n if (!this.timer) {\n trigger(this.$el, \"countdownstart\");\n this.timer = setInterval(this.update, 1e3);\n }\n },\n stop() {\n if (this.timer) {\n clearInterval(this.timer);\n trigger(this.$el, \"countdownstop\");\n this.timer = null;\n }\n },\n update() {\n const timespan = getTimeSpan(this.date);\n if (!timespan.total) {\n this.stop();\n if (!this.end) {\n trigger(this.$el, \"countdownend\");\n this.end = true;\n }\n }\n for (const unit of units) {\n const el = $(this.clsWrapper.replace(\"%unit%\", unit), this.$el);\n if (!el) {\n continue;\n }\n let digits = Math.trunc(timespan[unit]).toString().padStart(2, \"0\");\n if (el.textContent !== digits) {\n digits = digits.split(\"\");\n if (digits.length !== el.children.length) {\n html(el, digits.map(() => \"\").join(\"\"));\n }\n digits.forEach((digit, i) => el.children[i].textContent = digit);\n }\n }\n }\n }\n };\n function getTimeSpan(date) {\n const total = Math.max(0, date - Date.now()) / 1e3;\n return {\n total,\n seconds: total % 60,\n minutes: total / 60 % 60,\n hours: total / 60 / 60 % 24,\n days: total / 60 / 60 / 24\n };\n }\n\n const strats = {};\n strats.events = strats.watch = strats.observe = strats.created = strats.beforeConnect = strats.connected = strats.beforeDisconnect = strats.disconnected = strats.destroy = concatStrat;\n strats.args = function(parentVal, childVal) {\n return childVal !== false && concatStrat(childVal || parentVal);\n };\n strats.update = function(parentVal, childVal) {\n return sortBy(\n concatStrat(parentVal, isFunction(childVal) ? { read: childVal } : childVal),\n \"order\"\n );\n };\n strats.props = function(parentVal, childVal) {\n if (isArray(childVal)) {\n const value = {};\n for (const key of childVal) {\n value[key] = String;\n }\n childVal = value;\n }\n return strats.methods(parentVal, childVal);\n };\n strats.computed = strats.methods = function(parentVal, childVal) {\n return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;\n };\n strats.i18n = strats.data = function(parentVal, childVal, vm) {\n if (!vm) {\n if (!childVal) {\n return parentVal;\n }\n if (!parentVal) {\n return childVal;\n }\n return function(vm2) {\n return mergeFnData(parentVal, childVal, vm2);\n };\n }\n return mergeFnData(parentVal, childVal, vm);\n };\n function mergeFnData(parentVal, childVal, vm) {\n return strats.computed(\n isFunction(parentVal) ? parentVal.call(vm, vm) : parentVal,\n isFunction(childVal) ? childVal.call(vm, vm) : childVal\n );\n }\n function concatStrat(parentVal, childVal) {\n parentVal = parentVal && !isArray(parentVal) ? [parentVal] : parentVal;\n return childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;\n }\n function defaultStrat(parentVal, childVal) {\n return isUndefined(childVal) ? parentVal : childVal;\n }\n function mergeOptions(parent, child, vm) {\n const options = {};\n if (isFunction(child)) {\n child = child.options;\n }\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n if (child.mixins) {\n for (const mixin of child.mixins) {\n parent = mergeOptions(parent, mixin, vm);\n }\n }\n for (const key in parent) {\n mergeKey(key);\n }\n for (const key in child) {\n if (!hasOwn(parent, key)) {\n mergeKey(key);\n }\n }\n function mergeKey(key) {\n options[key] = (strats[key] || defaultStrat)(parent[key], child[key], vm);\n }\n return options;\n }\n function parseOptions(options, args = []) {\n try {\n return options ? startsWith(options, \"{\") ? JSON.parse(options) : args.length && !includes(options, \":\") ? { [args[0]]: options } : options.split(\";\").reduce((options2, option) => {\n const [key, value] = option.split(/:(.*)/);\n if (key && !isUndefined(value)) {\n options2[key.trim()] = value.trim();\n }\n return options2;\n }, {}) : {};\n } catch (e) {\n return {};\n }\n }\n function coerce$1(type, value) {\n if (type === Boolean) {\n return toBoolean(value);\n } else if (type === Number) {\n return toNumber(value);\n } else if (type === \"list\") {\n return toList(value);\n } else if (type === Object && isString(value)) {\n return parseOptions(value);\n }\n return type ? type(value) : value;\n }\n const listRe = /,(?![^(]*\\))/;\n function toList(value) {\n return isArray(value) ? value : isString(value) ? value.split(listRe).map((value2) => isNumeric(value2) ? toNumber(value2) : toBoolean(value2.trim())) : [value];\n }\n\n function initUpdates(instance) {\n instance._data = {};\n instance._updates = [...instance.$options.update || []];\n }\n function prependUpdate(instance, update) {\n instance._updates.unshift(update);\n }\n function clearUpdateData(instance) {\n instance._data = null;\n }\n function callUpdate(instance, e = \"update\") {\n if (!instance._connected) {\n return;\n }\n if (!instance._updates.length) {\n return;\n }\n if (!instance._queued) {\n instance._queued = /* @__PURE__ */ new Set();\n fastdom.read(() => {\n if (instance._connected) {\n runUpdates(instance, instance._queued);\n }\n instance._queued = null;\n });\n }\n instance._queued.add(e.type || e);\n }\n function runUpdates(instance, types) {\n for (const { read, write, events = [] } of instance._updates) {\n if (!types.has(\"update\") && !events.some((type) => types.has(type))) {\n continue;\n }\n let result;\n if (read) {\n result = read.call(instance, instance._data, types);\n if (result && isPlainObject(result)) {\n assign(instance._data, result);\n }\n }\n if (write && result !== false) {\n fastdom.write(() => {\n if (instance._connected) {\n write.call(instance, instance._data, types);\n }\n });\n }\n }\n }\n\n function resize(options) {\n return observe(observeResize, options, \"resize\");\n }\n function intersection(options) {\n return observe(observeIntersection, options);\n }\n function mutation(options) {\n return observe(observeMutation, options);\n }\n function lazyload(options = {}) {\n return intersection({\n handler: function(entries, observer) {\n const { targets = this.$el, preload = 5 } = options;\n for (const el of toNodes(isFunction(targets) ? targets(this) : targets)) {\n $$('[loading=\"lazy\"]', el).slice(0, preload - 1).forEach((el2) => removeAttr(el2, \"loading\"));\n }\n for (const el of entries.filter(({ isIntersecting }) => isIntersecting).map(({ target }) => target)) {\n observer.unobserve(el);\n }\n },\n ...options\n });\n }\n function viewport(options) {\n return observe((target, handler) => observeViewportResize(handler), options, \"resize\");\n }\n function scroll$1(options) {\n return observe(\n (target, handler) => ({\n disconnect: on(toScrollTargets(target), \"scroll\", handler, { passive: true })\n }),\n options,\n \"scroll\"\n );\n }\n function swipe(options) {\n return {\n observe(target, handler) {\n return {\n observe: noop,\n unobserve: noop,\n disconnect: on(target, pointerDown$1, handler, { passive: true })\n };\n },\n handler(e) {\n if (!isTouch(e)) {\n return;\n }\n const pos = getEventPos(e);\n const target = \"tagName\" in e.target ? e.target : parent(e.target);\n once(document, `${pointerUp$1} ${pointerCancel} scroll`, (e2) => {\n const { x, y } = getEventPos(e2);\n if (e2.type !== \"scroll\" && target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {\n setTimeout(() => {\n trigger(target, \"swipe\");\n trigger(target, `swipe${swipeDirection(pos.x, pos.y, x, y)}`);\n });\n }\n });\n },\n ...options\n };\n }\n function observe(observe2, options, emit) {\n return {\n observe: observe2,\n handler() {\n callUpdate(this, emit);\n },\n ...options\n };\n }\n function swipeDirection(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? x1 - x2 > 0 ? \"Left\" : \"Right\" : y1 - y2 > 0 ? \"Up\" : \"Down\";\n }\n function toScrollTargets(elements) {\n return toNodes(elements).map((node) => {\n const { ownerDocument } = node;\n const parent2 = scrollParent(node, true);\n return parent2 === ownerDocument.scrollingElement ? ownerDocument : parent2;\n });\n }\n\n var Margin = {\n props: {\n margin: String,\n firstColumn: Boolean\n },\n data: {\n margin: \"uk-margin-small-top\",\n firstColumn: \"uk-first-column\"\n },\n observe: [\n mutation({\n options: {\n childList: true\n }\n }),\n mutation({\n options: {\n attributes: true,\n attributeFilter: [\"style\"]\n },\n target: ({ $el }) => [$el, ...children($el)]\n }),\n resize({\n target: ({ $el }) => [$el, ...children($el)]\n })\n ],\n update: {\n read() {\n return {\n rows: getRows(children(this.$el))\n };\n },\n write({ rows }) {\n for (const row of rows) {\n for (const el of row) {\n toggleClass(el, this.margin, rows[0] !== row);\n toggleClass(el, this.firstColumn, row[isRtl ? row.length - 1 : 0] === el);\n }\n }\n },\n events: [\"resize\"]\n }\n };\n function getRows(elements) {\n const sorted = [[]];\n const withOffset = elements.some(\n (el, i) => i && elements[i - 1].offsetParent !== el.offsetParent\n );\n for (const el of elements) {\n if (!isVisible(el)) {\n continue;\n }\n const offset = getOffset(el, withOffset);\n for (let i = sorted.length - 1; i >= 0; i--) {\n const current = sorted[i];\n if (!current[0]) {\n current.push(el);\n break;\n }\n const offsetCurrent = getOffset(current[0], withOffset);\n if (offset.top >= offsetCurrent.bottom - 1 && offset.top !== offsetCurrent.top) {\n sorted.push([el]);\n break;\n }\n if (offset.bottom - 1 > offsetCurrent.top || offset.top === offsetCurrent.top) {\n let j = current.length - 1;\n for (; j >= 0; j--) {\n const offsetCurrent2 = getOffset(current[j], withOffset);\n if (offset.left >= offsetCurrent2.left) {\n break;\n }\n }\n current.splice(j + 1, 0, el);\n break;\n }\n if (i === 0) {\n sorted.unshift([el]);\n break;\n }\n }\n }\n return sorted;\n }\n function getOffset(element, offset = false) {\n let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;\n if (offset) {\n [offsetTop, offsetLeft] = offsetPosition(element);\n }\n return {\n top: offsetTop,\n left: offsetLeft,\n bottom: offsetTop + offsetHeight,\n right: offsetLeft + offsetWidth\n };\n }\n\n async function slide(action, target, duration) {\n await awaitFrame();\n let nodes = children(target);\n const currentProps = nodes.map((el) => getProps$1(el, true));\n const targetProps = { ...css(target, [\"height\", \"padding\"]), display: \"block\" };\n const targets = nodes.concat(target);\n await Promise.all(targets.map(Transition.cancel));\n css(targets, \"transitionProperty\", \"none\");\n await action();\n nodes = nodes.concat(children(target).filter((el) => !includes(nodes, el)));\n await Promise.resolve();\n css(targets, \"transitionProperty\", \"\");\n const targetStyle = attr(target, \"style\");\n const targetPropsTo = css(target, [\"height\", \"padding\"]);\n const [propsTo, propsFrom] = getTransitionProps(target, nodes, currentProps);\n const attrsTo = nodes.map((el) => ({ style: attr(el, \"style\") }));\n nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));\n css(target, targetProps);\n trigger(target, \"scroll\");\n await awaitFrame();\n const transitions = nodes.map((el, i) => parent(el) === target && Transition.start(el, propsTo[i], duration, \"ease\")).concat(Transition.start(target, targetPropsTo, duration, \"ease\"));\n try {\n await Promise.all(transitions);\n nodes.forEach((el, i) => {\n attr(el, attrsTo[i]);\n if (parent(el) === target) {\n css(el, \"display\", propsTo[i].opacity === 0 ? \"none\" : \"\");\n }\n });\n attr(target, \"style\", targetStyle);\n } catch (e) {\n attr(nodes, \"style\", \"\");\n resetProps(target, targetProps);\n }\n }\n function getProps$1(el, opacity) {\n const zIndex = css(el, \"zIndex\");\n return isVisible(el) ? {\n display: \"\",\n opacity: opacity ? css(el, \"opacity\") : \"0\",\n pointerEvents: \"none\",\n position: \"absolute\",\n zIndex: zIndex === \"auto\" ? index(el) : zIndex,\n ...getPositionWithMargin(el)\n } : false;\n }\n function getTransitionProps(target, nodes, currentProps) {\n const propsTo = nodes.map(\n (el, i) => parent(el) && i in currentProps ? currentProps[i] ? isVisible(el) ? getPositionWithMargin(el) : { opacity: 0 } : { opacity: isVisible(el) ? 1 : 0 } : false\n );\n const propsFrom = propsTo.map((props, i) => {\n const from = parent(nodes[i]) === target && (currentProps[i] || getProps$1(nodes[i]));\n if (!from) {\n return false;\n }\n if (!props) {\n delete from.opacity;\n } else if (!(\"opacity\" in props)) {\n const { opacity } = from;\n if (opacity % 1) {\n props.opacity = 1;\n } else {\n delete from.opacity;\n }\n }\n return from;\n });\n return [propsTo, propsFrom];\n }\n function resetProps(el, props) {\n for (const prop in props) {\n css(el, prop, \"\");\n }\n }\n function getPositionWithMargin(el) {\n const { height, width } = dimensions$1(el);\n return {\n height,\n width,\n transform: \"\",\n ...position(el),\n ...css(el, [\"marginTop\", \"marginLeft\"])\n };\n }\n function awaitFrame() {\n return new Promise((resolve) => requestAnimationFrame(resolve));\n }\n\n const clsLeave = \"uk-transition-leave\";\n const clsEnter = \"uk-transition-enter\";\n function fade(action, target, duration, stagger = 0) {\n const index = transitionIndex(target, true);\n const propsIn = { opacity: 1 };\n const propsOut = { opacity: 0 };\n const wrapIndexFn = (fn) => () => index === transitionIndex(target) ? fn() : Promise.reject();\n const leaveFn = wrapIndexFn(async () => {\n addClass(target, clsLeave);\n await Promise.all(\n getTransitionNodes(target).map(\n (child, i) => new Promise(\n (resolve) => setTimeout(\n () => Transition.start(child, propsOut, duration / 2, \"ease\").then(\n resolve\n ),\n i * stagger\n )\n )\n )\n );\n removeClass(target, clsLeave);\n });\n const enterFn = wrapIndexFn(async () => {\n const oldHeight = height(target);\n addClass(target, clsEnter);\n action();\n css(children(target), { opacity: 0 });\n await awaitFrame();\n const nodes = children(target);\n const newHeight = height(target);\n css(target, \"alignContent\", \"flex-start\");\n height(target, oldHeight);\n const transitionNodes = getTransitionNodes(target);\n css(nodes, propsOut);\n const transitions = transitionNodes.map(async (child, i) => {\n await awaitTimeout(i * stagger);\n await Transition.start(child, propsIn, duration / 2, \"ease\");\n });\n if (oldHeight !== newHeight) {\n transitions.push(\n Transition.start(\n target,\n { height: newHeight },\n duration / 2 + transitionNodes.length * stagger,\n \"ease\"\n )\n );\n }\n await Promise.all(transitions).then(() => {\n removeClass(target, clsEnter);\n if (index === transitionIndex(target)) {\n css(target, { height: \"\", alignContent: \"\" });\n css(nodes, { opacity: \"\" });\n delete target.dataset.transition;\n }\n });\n });\n return hasClass(target, clsLeave) ? waitTransitionend(target).then(enterFn) : hasClass(target, clsEnter) ? waitTransitionend(target).then(leaveFn).then(enterFn) : leaveFn().then(enterFn);\n }\n function transitionIndex(target, next) {\n if (next) {\n target.dataset.transition = 1 + transitionIndex(target);\n }\n return toNumber(target.dataset.transition) || 0;\n }\n function waitTransitionend(target) {\n return Promise.all(\n children(target).filter(Transition.inProgress).map(\n (el) => new Promise((resolve) => once(el, \"transitionend transitioncanceled\", resolve))\n )\n );\n }\n function getTransitionNodes(target) {\n return getRows(children(target)).flat().filter(isVisible);\n }\n function awaitTimeout(timeout) {\n return new Promise((resolve) => setTimeout(resolve, timeout));\n }\n\n var Animate = {\n props: {\n duration: Number,\n animation: Boolean\n },\n data: {\n duration: 150,\n animation: \"slide\"\n },\n methods: {\n animate(action, target = this.$el) {\n const name = this.animation;\n const animationFn = name === \"fade\" ? fade : name === \"delayed-fade\" ? (...args) => fade(...args, 40) : name ? slide : () => {\n action();\n return Promise.resolve();\n };\n return animationFn(action, target, this.duration).catch(noop);\n }\n }\n };\n\n const keyMap = {\n TAB: 9,\n ESC: 27,\n SPACE: 32,\n END: 35,\n HOME: 36,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n };\n\n var filter = {\n mixins: [Animate],\n args: \"target\",\n props: {\n target: String,\n selActive: Boolean\n },\n data: {\n target: \"\",\n selActive: false,\n attrItem: \"uk-filter-control\",\n cls: \"uk-active\",\n duration: 250\n },\n computed: {\n children: ({ target }, $el) => $$(`${target} > *`, $el),\n toggles: ({ attrItem }, $el) => $$(`[${attrItem}],[data-${attrItem}]`, $el)\n },\n watch: {\n toggles(toggles) {\n this.updateState();\n const actives = $$(this.selActive, this.$el);\n for (const toggle of toggles) {\n if (this.selActive !== false) {\n toggleClass(toggle, this.cls, includes(actives, toggle));\n }\n const button = findButton(toggle);\n if (isTag(button, \"a\")) {\n attr(button, \"role\", \"button\");\n }\n }\n },\n children(list, prev) {\n if (prev) {\n this.updateState();\n }\n }\n },\n events: {\n name: \"click keydown\",\n delegate: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n handler(e) {\n if (e.type === \"keydown\" && e.keyCode !== keyMap.SPACE) {\n return;\n }\n if (e.target.closest(\"a,button\")) {\n e.preventDefault();\n this.apply(e.current);\n }\n }\n },\n methods: {\n apply(el) {\n const prevState = this.getState();\n const newState = mergeState(el, this.attrItem, this.getState());\n if (!isEqualState(prevState, newState)) {\n this.setState(newState);\n }\n },\n getState() {\n return this.toggles.filter((item) => hasClass(item, this.cls)).reduce((state, el) => mergeState(el, this.attrItem, state), {\n filter: { \"\": \"\" },\n sort: []\n });\n },\n async setState(state, animate = true) {\n state = { filter: { \"\": \"\" }, sort: [], ...state };\n trigger(this.$el, \"beforeFilter\", [this, state]);\n for (const toggle of this.toggles) {\n toggleClass(toggle, this.cls, matchFilter(toggle, this.attrItem, state));\n }\n await Promise.all(\n $$(this.target, this.$el).map((target) => {\n const filterFn = () => applyState(state, target, children(target));\n return animate ? this.animate(filterFn, target) : filterFn();\n })\n );\n trigger(this.$el, \"afterFilter\", [this]);\n },\n updateState() {\n fastdom.write(() => this.setState(this.getState(), false));\n }\n }\n };\n function getFilter(el, attr2) {\n return parseOptions(data(el, attr2), [\"filter\"]);\n }\n function isEqualState(stateA, stateB) {\n return [\"filter\", \"sort\"].every((prop) => isEqual(stateA[prop], stateB[prop]));\n }\n function applyState(state, target, children) {\n const selector = Object.values(state.filter).join(\"\");\n for (const el of children) {\n css(el, \"display\", selector && !matches(el, selector) ? \"none\" : \"\");\n }\n const [sort, order] = state.sort;\n if (sort) {\n const sorted = sortItems(children, sort, order);\n if (!isEqual(sorted, children)) {\n append(target, sorted);\n }\n }\n }\n function mergeState(el, attr2, state) {\n const { filter, group, sort, order = \"asc\" } = getFilter(el, attr2);\n if (filter || isUndefined(sort)) {\n if (group) {\n if (filter) {\n delete state.filter[\"\"];\n state.filter[group] = filter;\n } else {\n delete state.filter[group];\n if (isEmpty(state.filter) || \"\" in state.filter) {\n state.filter = { \"\": filter || \"\" };\n }\n }\n } else {\n state.filter = { \"\": filter || \"\" };\n }\n }\n if (!isUndefined(sort)) {\n state.sort = [sort, order];\n }\n return state;\n }\n function matchFilter(el, attr2, { filter: stateFilter = { \"\": \"\" }, sort: [stateSort, stateOrder] }) {\n const { filter = \"\", group = \"\", sort, order = \"asc\" } = getFilter(el, attr2);\n return isUndefined(sort) ? group in stateFilter && filter === stateFilter[group] || !filter && group && !(group in stateFilter) && !stateFilter[\"\"] : stateSort === sort && stateOrder === order;\n }\n function sortItems(nodes, sort, order) {\n return [...nodes].sort(\n (a, b) => data(a, sort).localeCompare(data(b, sort), void 0, { numeric: true }) * (order === \"asc\" || -1)\n );\n }\n function findButton(el) {\n return $(\"a,button\", el) || el;\n }\n\n let prevented;\n function preventBackgroundScroll(el) {\n const off = on(\n el,\n \"touchstart\",\n (e) => {\n if (e.targetTouches.length !== 1 || matches(e.target, 'input[type=\"range\"')) {\n return;\n }\n let prev = getEventPos(e).y;\n const offMove = on(\n el,\n \"touchmove\",\n (e2) => {\n const pos = getEventPos(e2).y;\n if (pos === prev) {\n return;\n }\n prev = pos;\n if (!scrollParents(e2.target).some((scrollParent) => {\n if (!el.contains(scrollParent)) {\n return false;\n }\n let { scrollHeight, clientHeight } = scrollParent;\n return clientHeight < scrollHeight;\n })) {\n e2.preventDefault();\n }\n },\n { passive: false }\n );\n once(el, \"scroll touchend touchcanel\", offMove, { capture: true });\n },\n { passive: true }\n );\n if (prevented) {\n return off;\n }\n prevented = true;\n const { scrollingElement } = document;\n css(scrollingElement, {\n overflowY: CSS.supports(\"overflow\", \"clip\") ? \"clip\" : \"hidden\",\n touchAction: \"none\",\n paddingRight: width(window) - scrollingElement.clientWidth || \"\"\n });\n return () => {\n prevented = false;\n off();\n css(scrollingElement, { overflowY: \"\", touchAction: \"\", paddingRight: \"\" });\n };\n }\n\n var Container = {\n props: {\n container: Boolean\n },\n data: {\n container: true\n },\n computed: {\n container({ container }) {\n return container === true && this.$container || container && $(container);\n }\n }\n };\n\n var Togglable = {\n props: {\n cls: Boolean,\n animation: \"list\",\n duration: Number,\n velocity: Number,\n origin: String,\n transition: String\n },\n data: {\n cls: false,\n animation: [false],\n duration: 200,\n velocity: 0.2,\n origin: false,\n transition: \"ease\",\n clsEnter: \"uk-togglable-enter\",\n clsLeave: \"uk-togglable-leave\"\n },\n computed: {\n hasAnimation: ({ animation }) => !!animation[0],\n hasTransition: ({ animation }) => [\"slide\", \"reveal\"].some((transition) => startsWith(animation[0], transition))\n },\n methods: {\n async toggleElement(targets, toggle, animate) {\n try {\n await Promise.all(\n toNodes(targets).map((el) => {\n const show = isBoolean(toggle) ? toggle : !this.isToggled(el);\n if (!trigger(el, `before${show ? \"show\" : \"hide\"}`, [this])) {\n return Promise.reject();\n }\n const promise = (isFunction(animate) ? animate : animate === false || !this.hasAnimation ? toggleInstant : this.hasTransition ? toggleTransition : toggleAnimation)(el, show, this);\n const cls = show ? this.clsEnter : this.clsLeave;\n addClass(el, cls);\n trigger(el, show ? \"show\" : \"hide\", [this]);\n const done = () => {\n removeClass(el, cls);\n trigger(el, show ? \"shown\" : \"hidden\", [this]);\n };\n return promise ? promise.then(done, () => {\n removeClass(el, cls);\n return Promise.reject();\n }) : done();\n })\n );\n return true;\n } catch (e) {\n return false;\n }\n },\n isToggled(el = this.$el) {\n el = toNode(el);\n return hasClass(el, this.clsEnter) ? true : hasClass(el, this.clsLeave) ? false : this.cls ? hasClass(el, this.cls.split(\" \")[0]) : isVisible(el);\n },\n _toggle(el, toggled) {\n if (!el) {\n return;\n }\n toggled = Boolean(toggled);\n let changed;\n if (this.cls) {\n changed = includes(this.cls, \" \") || toggled !== hasClass(el, this.cls);\n changed && toggleClass(el, this.cls, includes(this.cls, \" \") ? void 0 : toggled);\n } else {\n changed = toggled === el.hidden;\n changed && (el.hidden = !toggled);\n }\n $$(\"[autofocus]\", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());\n if (changed) {\n trigger(el, \"toggled\", [toggled, this]);\n }\n }\n }\n };\n function toggleInstant(el, show, { _toggle }) {\n Animation.cancel(el);\n Transition.cancel(el);\n return _toggle(el, show);\n }\n async function toggleTransition(el, show, { animation, duration, velocity, transition, _toggle }) {\n var _a;\n const [mode = \"reveal\", startProp = \"top\"] = ((_a = animation[0]) == null ? void 0 : _a.split(\"-\")) || [];\n const dirs = [\n [\"left\", \"right\"],\n [\"top\", \"bottom\"]\n ];\n const dir = dirs[includes(dirs[0], startProp) ? 0 : 1];\n const end = dir[1] === startProp;\n const props = [\"width\", \"height\"];\n const dimProp = props[dirs.indexOf(dir)];\n const marginProp = `margin-${dir[0]}`;\n const marginStartProp = `margin-${startProp}`;\n let currentDim = dimensions$1(el)[dimProp];\n const inProgress = Transition.inProgress(el);\n await Transition.cancel(el);\n if (show) {\n _toggle(el, true);\n }\n const prevProps = Object.fromEntries(\n [\n \"padding\",\n \"border\",\n \"width\",\n \"height\",\n \"minWidth\",\n \"minHeight\",\n \"overflowY\",\n \"overflowX\",\n marginProp,\n marginStartProp\n ].map((key) => [key, el.style[key]])\n );\n const dim = dimensions$1(el);\n const currentMargin = toFloat(css(el, marginProp));\n const marginStart = toFloat(css(el, marginStartProp));\n const endDim = dim[dimProp] + marginStart;\n if (!inProgress && !show) {\n currentDim += marginStart;\n }\n const [wrapper] = wrapInner(el, \"
    \");\n css(wrapper, {\n boxSizing: \"border-box\",\n height: dim.height,\n width: dim.width,\n ...css(el, [\n \"overflow\",\n \"padding\",\n \"borderTop\",\n \"borderRight\",\n \"borderBottom\",\n \"borderLeft\",\n \"borderImage\",\n marginStartProp\n ])\n });\n css(el, {\n padding: 0,\n border: 0,\n minWidth: 0,\n minHeight: 0,\n [marginStartProp]: 0,\n width: dim.width,\n height: dim.height,\n overflow: \"hidden\",\n [dimProp]: currentDim\n });\n const percent = currentDim / endDim;\n duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);\n const endProps = { [dimProp]: show ? endDim : 0 };\n if (end) {\n css(el, marginProp, endDim - currentDim + currentMargin);\n endProps[marginProp] = show ? currentMargin : endDim + currentMargin;\n }\n if (!end ^ mode === \"reveal\") {\n css(wrapper, marginProp, -endDim + currentDim);\n Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);\n }\n try {\n await Transition.start(el, endProps, duration, transition);\n } finally {\n css(el, prevProps);\n unwrap(wrapper.firstChild);\n if (!show) {\n _toggle(el, false);\n }\n }\n }\n function toggleAnimation(el, show, cmp) {\n const { animation, duration, _toggle } = cmp;\n if (show) {\n _toggle(el, true);\n return Animation.in(el, animation[0], duration, cmp.origin);\n }\n return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(\n () => _toggle(el, false)\n );\n }\n\n const active$1 = [];\n var Modal = {\n mixins: [Class, Container, Togglable],\n props: {\n selPanel: String,\n selClose: String,\n escClose: Boolean,\n bgClose: Boolean,\n stack: Boolean,\n role: String\n },\n data: {\n cls: \"uk-open\",\n escClose: true,\n bgClose: true,\n overlay: true,\n stack: false,\n role: \"dialog\"\n },\n computed: {\n panel: ({ selPanel }, $el) => $(selPanel, $el),\n transitionElement() {\n return this.panel;\n },\n bgClose({ bgClose }) {\n return bgClose && this.panel;\n }\n },\n connected() {\n attr(this.panel || this.$el, \"role\", this.role);\n if (this.overlay) {\n attr(this.panel || this.$el, \"aria-modal\", true);\n }\n },\n beforeDisconnect() {\n if (includes(active$1, this)) {\n this.toggleElement(this.$el, false, false);\n }\n },\n events: [\n {\n name: \"click\",\n delegate: ({ selClose }) => `${selClose},a[href*=\"#\"]`,\n handler(e) {\n const { current, defaultPrevented } = e;\n const { hash } = current;\n if (!defaultPrevented && hash && isSameSiteAnchor(current) && !this.$el.contains($(hash))) {\n this.hide();\n } else if (matches(current, this.selClose)) {\n e.preventDefault();\n this.hide();\n }\n }\n },\n {\n name: \"toggle\",\n self: true,\n handler(e) {\n if (e.defaultPrevented) {\n return;\n }\n e.preventDefault();\n if (this.isToggled() === includes(active$1, this)) {\n this.toggle();\n }\n }\n },\n {\n name: \"beforeshow\",\n self: true,\n handler(e) {\n if (includes(active$1, this)) {\n return false;\n }\n if (!this.stack && active$1.length) {\n Promise.all(active$1.map((modal) => modal.hide())).then(this.show);\n e.preventDefault();\n } else {\n active$1.push(this);\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (this.stack) {\n css(this.$el, \"zIndex\", toFloat(css(this.$el, \"zIndex\")) + active$1.length);\n }\n const handlers = [\n this.overlay && preventBackgroundFocus(this),\n this.overlay && preventBackgroundScroll(this.$el),\n this.bgClose && listenForBackgroundClose$1(this),\n this.escClose && listenForEscClose$1(this)\n ];\n once(\n this.$el,\n \"hidden\",\n () => handlers.forEach((handler) => handler && handler()),\n { self: true }\n );\n addClass(document.documentElement, this.clsPage);\n }\n },\n {\n name: \"shown\",\n self: true,\n handler() {\n if (!isFocusable(this.$el)) {\n attr(this.$el, \"tabindex\", \"-1\");\n }\n if (!matches(this.$el, \":focus-within\")) {\n this.$el.focus();\n }\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n if (includes(active$1, this)) {\n active$1.splice(active$1.indexOf(this), 1);\n }\n css(this.$el, \"zIndex\", \"\");\n if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {\n removeClass(document.documentElement, this.clsPage);\n }\n }\n }\n ],\n methods: {\n toggle() {\n return this.isToggled() ? this.hide() : this.show();\n },\n show() {\n if (this.container && parent(this.$el) !== this.container) {\n append(this.container, this.$el);\n return new Promise(\n (resolve) => requestAnimationFrame(() => this.show().then(resolve))\n );\n }\n return this.toggleElement(this.$el, true, animate$1);\n },\n hide() {\n return this.toggleElement(this.$el, false, animate$1);\n }\n }\n };\n function animate$1(el, show, { transitionElement, _toggle }) {\n return new Promise(\n (resolve, reject) => once(el, \"show hide\", () => {\n var _a;\n (_a = el._reject) == null ? void 0 : _a.call(el);\n el._reject = reject;\n _toggle(el, show);\n const off = once(\n transitionElement,\n \"transitionstart\",\n () => {\n once(transitionElement, \"transitionend transitioncancel\", resolve, {\n self: true\n });\n clearTimeout(timer);\n },\n { self: true }\n );\n const timer = setTimeout(\n () => {\n off();\n resolve();\n },\n toMs(css(transitionElement, \"transitionDuration\"))\n );\n })\n ).then(() => delete el._reject);\n }\n function toMs(time) {\n return time ? endsWith(time, \"ms\") ? toFloat(time) : toFloat(time) * 1e3 : 0;\n }\n function preventBackgroundFocus(modal) {\n return on(document, \"focusin\", (e) => {\n if (last(active$1) === modal && !modal.$el.contains(e.target)) {\n modal.$el.focus();\n }\n });\n }\n function listenForBackgroundClose$1(modal) {\n return on(document, pointerDown$1, ({ target }) => {\n if (last(active$1) !== modal || modal.overlay && !modal.$el.contains(target) || modal.panel.contains(target)) {\n return;\n }\n once(\n document,\n `${pointerUp$1} ${pointerCancel} scroll`,\n ({ defaultPrevented, type, target: newTarget }) => {\n if (!defaultPrevented && type === pointerUp$1 && target === newTarget) {\n modal.hide();\n }\n },\n true\n );\n });\n }\n function listenForEscClose$1(modal) {\n return on(document, \"keydown\", (e) => {\n if (e.keyCode === 27 && last(active$1) === modal) {\n modal.hide();\n }\n });\n }\n\n var Animations$2 = {\n slide: {\n show(dir) {\n return [{ transform: translate(dir * -100) }, { transform: translate() }];\n },\n percent(current) {\n return translated(current);\n },\n translate(percent, dir) {\n return [\n { transform: translate(dir * -100 * percent) },\n { transform: translate(dir * 100 * (1 - percent)) }\n ];\n }\n }\n };\n function translated(el) {\n return Math.abs(new DOMMatrix(css(el, \"transform\")).m41 / el.offsetWidth);\n }\n function translate(value = 0, unit = \"%\") {\n value += value ? unit : \"\";\n return `translate3d(${value}, 0, 0)`;\n }\n function scale3d(value) {\n return `scale3d(${value}, ${value}, 1)`;\n }\n\n function Transitioner$1(prev, next, dir, { animation, easing }) {\n const { percent, translate, show = noop } = animation;\n const props = show(dir);\n const { promise, resolve } = withResolvers();\n return {\n dir,\n show(duration, percent2 = 0, linear) {\n const timing = linear ? \"linear\" : easing;\n duration -= Math.round(duration * clamp(percent2, -1, 1));\n this.translate(percent2);\n triggerUpdate(next, \"itemin\", { percent: percent2, duration, timing, dir });\n triggerUpdate(prev, \"itemout\", { percent: 1 - percent2, duration, timing, dir });\n Promise.all([\n Transition.start(next, props[1], duration, timing),\n Transition.start(prev, props[0], duration, timing)\n ]).then(() => {\n this.reset();\n resolve();\n }, noop);\n return promise;\n },\n cancel() {\n return Transition.cancel([next, prev]);\n },\n reset() {\n for (const prop in props[0]) {\n css([next, prev], prop, \"\");\n }\n },\n async forward(duration, percent2 = this.percent()) {\n await this.cancel();\n return this.show(duration, percent2, true);\n },\n translate(percent2) {\n this.reset();\n const props2 = translate(percent2, dir);\n css(next, props2[1]);\n css(prev, props2[0]);\n triggerUpdate(next, \"itemtranslatein\", { percent: percent2, dir });\n triggerUpdate(prev, \"itemtranslateout\", { percent: 1 - percent2, dir });\n },\n percent() {\n return percent(prev || next, next, dir);\n },\n getDistance() {\n return prev == null ? void 0 : prev.offsetWidth;\n }\n };\n }\n function triggerUpdate(el, type, data) {\n trigger(el, createEvent(type, false, false, data));\n }\n function withResolvers() {\n let resolve;\n return { promise: new Promise((res) => resolve = res), resolve };\n }\n\n var I18n = {\n props: {\n i18n: Object\n },\n data: {\n i18n: null\n },\n methods: {\n t(key, ...params) {\n var _a, _b, _c;\n let i = 0;\n return ((_c = ((_a = this.i18n) == null ? void 0 : _a[key]) || ((_b = this.$options.i18n) == null ? void 0 : _b[key])) == null ? void 0 : _c.replace(\n /%s/g,\n () => params[i++] || \"\"\n )) || \"\";\n }\n }\n };\n\n var SliderAutoplay = {\n props: {\n autoplay: Boolean,\n autoplayInterval: Number,\n pauseOnHover: Boolean\n },\n data: {\n autoplay: false,\n autoplayInterval: 7e3,\n pauseOnHover: true\n },\n connected() {\n attr(this.list, \"aria-live\", this.autoplay ? \"off\" : \"polite\");\n this.autoplay && this.startAutoplay();\n },\n disconnected() {\n this.stopAutoplay();\n },\n update() {\n attr(this.slides, \"tabindex\", \"-1\");\n },\n events: [\n {\n name: \"visibilitychange\",\n el: () => document,\n filter: ({ autoplay }) => autoplay,\n handler() {\n if (document.hidden) {\n this.stopAutoplay();\n } else {\n this.startAutoplay();\n }\n }\n }\n ],\n methods: {\n startAutoplay() {\n this.stopAutoplay();\n this.interval = setInterval(() => {\n if (!(this.stack.length || this.draggable && matches(this.$el, \":focus-within\") && !matches(this.$el, \":focus\") || this.pauseOnHover && matches(this.$el, \":hover\"))) {\n this.show(\"next\");\n }\n }, this.autoplayInterval);\n },\n stopAutoplay() {\n clearInterval(this.interval);\n }\n }\n };\n\n const pointerOptions = { passive: false, capture: true };\n const pointerUpOptions = { passive: true, capture: true };\n const pointerDown = \"touchstart mousedown\";\n const pointerMove = \"touchmove mousemove\";\n const pointerUp = \"touchend touchcancel mouseup click input scroll\";\n const preventClick = (e) => e.preventDefault();\n var SliderDrag = {\n props: {\n draggable: Boolean\n },\n data: {\n draggable: true,\n threshold: 10\n },\n created() {\n for (const key of [\"start\", \"move\", \"end\"]) {\n const fn = this[key];\n this[key] = (e) => {\n const pos = getEventPos(e).x * (isRtl ? -1 : 1);\n this.prevPos = pos === this.pos ? this.prevPos : this.pos;\n this.pos = pos;\n fn(e);\n };\n }\n },\n events: [\n {\n name: pointerDown,\n passive: true,\n delegate: ({ selList }) => `${selList} > *`,\n handler(e) {\n if (!this.draggable || this.parallax || !isTouch(e) && hasSelectableText(e.target) || e.target.closest(selInput) || e.button > 0 || this.length < 2) {\n return;\n }\n this.start(e);\n }\n },\n {\n name: \"dragstart\",\n handler(e) {\n e.preventDefault();\n }\n },\n {\n // iOS workaround for slider stopping if swiping fast\n name: pointerMove,\n el: ({ list }) => list,\n handler: noop,\n ...pointerOptions\n }\n ],\n methods: {\n start() {\n this.drag = this.pos;\n if (this._transitioner) {\n this.percent = this._transitioner.percent();\n this.drag += this._transitioner.getDistance() * this.percent * this.dir;\n this._transitioner.cancel();\n this._transitioner.translate(this.percent);\n this.dragging = true;\n this.stack = [];\n } else {\n this.prevIndex = this.index;\n }\n on(document, pointerMove, this.move, pointerOptions);\n on(document, pointerUp, this.end, pointerUpOptions);\n css(this.list, \"userSelect\", \"none\");\n },\n move(e) {\n const distance = this.pos - this.drag;\n if (distance === 0 || this.prevPos === this.pos || !this.dragging && Math.abs(distance) < this.threshold) {\n return;\n }\n if (!this.dragging) {\n on(this.list, \"click\", preventClick, pointerOptions);\n }\n e.cancelable && e.preventDefault();\n this.dragging = true;\n this.dir = distance < 0 ? 1 : -1;\n let { slides, prevIndex } = this;\n let dis = Math.abs(distance);\n let nextIndex = this.getIndex(prevIndex + this.dir);\n let width = getDistance.call(this, prevIndex, nextIndex);\n while (nextIndex !== prevIndex && dis > width) {\n this.drag -= width * this.dir;\n prevIndex = nextIndex;\n dis -= width;\n nextIndex = this.getIndex(prevIndex + this.dir);\n width = getDistance.call(this, prevIndex, nextIndex);\n }\n this.percent = dis / width;\n const prev = slides[prevIndex];\n const next = slides[nextIndex];\n const changed = this.index !== nextIndex;\n const edge = prevIndex === nextIndex;\n let itemShown;\n for (const i of [this.index, this.prevIndex]) {\n if (!includes([nextIndex, prevIndex], i)) {\n trigger(slides[i], \"itemhidden\", [this]);\n if (edge) {\n itemShown = true;\n this.prevIndex = prevIndex;\n }\n }\n }\n if (this.index === prevIndex && this.prevIndex !== prevIndex || itemShown) {\n trigger(slides[this.index], \"itemshown\", [this]);\n }\n if (changed) {\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (!edge) {\n trigger(prev, \"beforeitemhide\", [this]);\n trigger(prev, \"itemhide\", [this]);\n }\n trigger(next, \"beforeitemshow\", [this]);\n trigger(next, \"itemshow\", [this]);\n }\n this._transitioner = this._translate(Math.abs(this.percent), prev, !edge && next);\n },\n end() {\n off(document, pointerMove, this.move, pointerOptions);\n off(document, pointerUp, this.end, pointerUpOptions);\n if (this.dragging) {\n this.dragging = null;\n if (this.index === this.prevIndex) {\n this.percent = 1 - this.percent;\n this.dir *= -1;\n this._show(false, this.index, true);\n this._transitioner = null;\n } else {\n const dirChange = (isRtl ? this.dir * (isRtl ? 1 : -1) : this.dir) < 0 === this.prevPos > this.pos;\n this.index = dirChange ? this.index : this.prevIndex;\n if (dirChange) {\n this.percent = 1 - this.percent;\n }\n this.show(\n this.dir > 0 && !dirChange || this.dir < 0 && dirChange ? \"next\" : \"previous\",\n true\n );\n }\n }\n setTimeout(() => off(this.list, \"click\", preventClick, pointerOptions));\n css(this.list, { userSelect: \"\" });\n this.drag = this.percent = null;\n }\n }\n };\n function getDistance(prev, next) {\n return this._getTransitioner(prev, prev !== next && next).getDistance() || this.slides[prev].offsetWidth;\n }\n function hasSelectableText(el) {\n return css(el, \"userSelect\") !== \"none\" && toArray(el.childNodes).some((el2) => el2.nodeType === 3 && el2.textContent.trim());\n }\n\n function initWatches(instance) {\n instance._watches = [];\n for (const watches of instance.$options.watch || []) {\n for (const [name, watch] of Object.entries(watches)) {\n registerWatch(instance, watch, name);\n }\n }\n instance._initial = true;\n }\n function registerWatch(instance, watch, name) {\n instance._watches.push({\n name,\n ...isPlainObject(watch) ? watch : { handler: watch }\n });\n }\n function runWatches(instance, values) {\n for (const { name, handler, immediate = true } of instance._watches) {\n if (instance._initial && immediate || hasOwn(values, name) && !isEqual(values[name], instance[name])) {\n handler.call(instance, instance[name], values[name]);\n }\n }\n instance._initial = false;\n }\n\n function initComputed(instance) {\n const { computed } = instance.$options;\n instance._computed = {};\n if (computed) {\n for (const key in computed) {\n registerComputed(instance, key, computed[key]);\n }\n }\n }\n const mutationOptions = { subtree: true, childList: true };\n function registerComputed(instance, key, cb) {\n instance._hasComputed = true;\n Object.defineProperty(instance, key, {\n enumerable: true,\n get() {\n const { _computed, $props, $el } = instance;\n if (!hasOwn(_computed, key)) {\n _computed[key] = (cb.get || cb).call(instance, $props, $el);\n if (cb.observe && instance._computedObserver) {\n const selector = cb.observe.call(instance, $props);\n instance._computedObserver.observe(\n [\"~\", \"+\", \"-\"].includes(selector[0]) ? $el.parentElement : $el.getRootNode(),\n mutationOptions\n );\n }\n }\n return _computed[key];\n },\n set(value) {\n const { _computed } = instance;\n _computed[key] = cb.set ? cb.set.call(instance, value) : value;\n if (isUndefined(_computed[key])) {\n delete _computed[key];\n }\n }\n });\n }\n function initComputedUpdates(instance) {\n if (!instance._hasComputed) {\n return;\n }\n prependUpdate(instance, {\n read: () => runWatches(instance, resetComputed(instance)),\n events: [\"resize\", \"computed\"]\n });\n instance._computedObserver = observeMutation(\n instance.$el,\n () => callUpdate(instance, \"computed\"),\n mutationOptions\n );\n }\n function disconnectComputedUpdates(instance) {\n var _a;\n (_a = instance._computedObserver) == null ? void 0 : _a.disconnect();\n delete instance._computedObserver;\n resetComputed(instance);\n }\n function resetComputed(instance) {\n const values = { ...instance._computed };\n instance._computed = {};\n return values;\n }\n\n function initEvents(instance) {\n instance._events = [];\n for (const event of instance.$options.events || []) {\n if (hasOwn(event, \"handler\")) {\n registerEvent(instance, event);\n } else {\n for (const key in event) {\n registerEvent(instance, event[key], key);\n }\n }\n }\n }\n function unbindEvents(instance) {\n instance._events.forEach((unbind) => unbind());\n delete instance._events;\n }\n function registerEvent(instance, event, key) {\n let { name, el, handler, capture, passive, delegate, filter, self } = isPlainObject(event) ? event : { name: key, handler: event };\n el = isFunction(el) ? el.call(instance, instance) : el || instance.$el;\n if (!el || isArray(el) && !el.length || filter && !filter.call(instance, instance)) {\n return;\n }\n instance._events.push(\n on(\n el,\n name,\n delegate ? isString(delegate) ? delegate : delegate.call(instance, instance) : null,\n isString(handler) ? instance[handler] : handler.bind(instance),\n { passive, capture, self }\n )\n );\n }\n\n function initObservers(instance) {\n instance._observers = [];\n for (const observer of instance.$options.observe || []) {\n registerObservable(instance, observer);\n }\n }\n function registerObserver(instance, ...observer) {\n instance._observers.push(...observer);\n }\n function disconnectObservers(instance) {\n for (const observer of instance._observers) {\n observer.disconnect();\n }\n }\n function registerObservable(instance, observable) {\n let { observe, target = instance.$el, handler, options, filter, args } = observable;\n if (filter && !filter.call(instance, instance)) {\n return;\n }\n const key = `_observe${instance._observers.length}`;\n if (isFunction(target) && !hasOwn(instance, key)) {\n registerComputed(instance, key, () => {\n const targets2 = target.call(instance, instance);\n return isArray(targets2) ? toNodes(targets2) : targets2;\n });\n }\n handler = isString(handler) ? instance[handler] : handler.bind(instance);\n if (isFunction(options)) {\n options = options.call(instance, instance);\n }\n const targets = hasOwn(instance, key) ? instance[key] : target;\n const observer = observe(targets, handler, options, args);\n if (isFunction(target) && isArray(instance[key])) {\n registerWatch(\n instance,\n { handler: updateTargets(observer, options), immediate: false },\n key\n );\n }\n registerObserver(instance, observer);\n }\n function updateTargets(observer, options) {\n return (targets, prev) => {\n for (const target of prev) {\n if (!includes(targets, target)) {\n if (observer.unobserve) {\n observer.unobserve(target);\n } else if (observer.observe) {\n observer.disconnect();\n }\n }\n }\n for (const target of targets) {\n if (!includes(prev, target) || !observer.unobserve) {\n observer.observe(target, options);\n }\n }\n };\n }\n\n function initProps(instance) {\n const { $options, $props } = instance;\n const props = getProps($options);\n assign($props, props);\n const { computed, methods } = $options;\n for (let key in $props) {\n if (key in props && (!computed || !hasOwn(computed, key)) && (!methods || !hasOwn(methods, key))) {\n instance[key] = $props[key];\n }\n }\n }\n function getProps(opts) {\n const data$1 = {};\n const { args = [], props = {}, el, id } = opts;\n if (!props) {\n return data$1;\n }\n for (const key in props) {\n const prop = hyphenate(key);\n let value = data(el, prop);\n if (isUndefined(value)) {\n continue;\n }\n value = props[key] === Boolean && value === \"\" ? true : coerce$1(props[key], value);\n if (prop === \"target\" && startsWith(value, \"_\")) {\n continue;\n }\n data$1[key] = value;\n }\n const options = parseOptions(data(el, id), args);\n for (const key in options) {\n const prop = camelize(key);\n if (!isUndefined(props[prop])) {\n data$1[prop] = coerce$1(props[prop], options[key]);\n }\n }\n return data$1;\n }\n const getAttributes = memoize((id, props) => {\n const attributes = Object.keys(props);\n const filter = attributes.concat(id).map((key) => [hyphenate(key), `data-${hyphenate(key)}`]).flat();\n return { attributes, filter };\n });\n function initPropsObserver(instance) {\n const { $options, $props } = instance;\n const { id, props, el } = $options;\n if (!props) {\n return;\n }\n const { attributes, filter } = getAttributes(id, props);\n const observer = new MutationObserver((records) => {\n const data = getProps($options);\n if (records.some(({ attributeName }) => {\n const prop = attributeName.replace(\"data-\", \"\");\n return (prop === id ? attributes : [camelize(prop), camelize(attributeName)]).some(\n (prop2) => !isUndefined(data[prop2]) && data[prop2] !== $props[prop2]\n );\n })) {\n instance.$reset();\n }\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: filter\n });\n registerObserver(instance, observer);\n }\n\n function callHook(instance, hook) {\n var _a;\n (_a = instance.$options[hook]) == null ? void 0 : _a.forEach((handler) => handler.call(instance));\n }\n function callConnected(instance) {\n if (instance._connected) {\n return;\n }\n initProps(instance);\n callHook(instance, \"beforeConnect\");\n instance._connected = true;\n initEvents(instance);\n initUpdates(instance);\n initWatches(instance);\n initObservers(instance);\n initPropsObserver(instance);\n initComputedUpdates(instance);\n callHook(instance, \"connected\");\n callUpdate(instance);\n }\n function callDisconnected(instance) {\n if (!instance._connected) {\n return;\n }\n callHook(instance, \"beforeDisconnect\");\n unbindEvents(instance);\n clearUpdateData(instance);\n disconnectObservers(instance);\n disconnectComputedUpdates(instance);\n callHook(instance, \"disconnected\");\n instance._connected = false;\n }\n\n let uid = 0;\n function init$1(instance, options = {}) {\n options.data = normalizeData(options, instance.constructor.options);\n instance.$options = mergeOptions(instance.constructor.options, options, instance);\n instance.$props = {};\n instance._uid = uid++;\n initData(instance);\n initMethods(instance);\n initComputed(instance);\n callHook(instance, \"created\");\n if (options.el) {\n instance.$mount(options.el);\n }\n }\n function initData(instance) {\n const { data = {} } = instance.$options;\n for (const key in data) {\n instance.$props[key] = instance[key] = data[key];\n }\n }\n function initMethods(instance) {\n const { methods } = instance.$options;\n if (methods) {\n for (const key in methods) {\n instance[key] = methods[key].bind(instance);\n }\n }\n }\n function normalizeData({ data = {} }, { args = [], props = {} }) {\n if (isArray(data)) {\n data = data.slice(0, args.length).reduce((data2, value, index) => {\n if (isPlainObject(value)) {\n assign(data2, value);\n } else {\n data2[args[index]] = value;\n }\n return data2;\n }, {});\n }\n for (const key in data) {\n if (isUndefined(data[key])) {\n delete data[key];\n } else if (props[key]) {\n data[key] = coerce$1(props[key], data[key]);\n }\n }\n return data;\n }\n\n const App = function(options) {\n init$1(this, options);\n };\n App.util = util;\n App.options = {};\n App.version = \"3.21.5\";\n\n const PREFIX = \"uk-\";\n const DATA = \"__uikit__\";\n const components$2 = {};\n function component(name, options) {\n var _a, _b;\n const id = PREFIX + hyphenate(name);\n if (!options) {\n if (!components$2[id].options) {\n components$2[id] = App.extend(components$2[id]);\n }\n return components$2[id];\n }\n name = camelize(name);\n App[name] = (element, data) => createComponent(name, element, data);\n const opt = (_a = options.options) != null ? _a : { ...options };\n opt.id = id;\n opt.name = name;\n (_b = opt.install) == null ? void 0 : _b.call(opt, App, opt, name);\n if (App._initialized && !opt.functional) {\n requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));\n }\n return components$2[id] = opt;\n }\n function createComponent(name, element, data, ...args) {\n const Component = component(name);\n return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? findAll(element).map(init)[0] : init();\n function init(element2) {\n const instance = getComponent(element2, name);\n if (instance) {\n if (data) {\n instance.$destroy();\n } else {\n return instance;\n }\n }\n return new Component({ el: element2, data });\n }\n }\n function getComponents(element) {\n return (element == null ? void 0 : element[DATA]) || {};\n }\n function getComponent(element, name) {\n return getComponents(element)[name];\n }\n function attachToElement(element, instance) {\n if (!element[DATA]) {\n element[DATA] = {};\n }\n element[DATA][instance.$options.name] = instance;\n }\n function detachFromElement(element, instance) {\n var _a;\n (_a = element[DATA]) == null ? true : delete _a[instance.$options.name];\n if (isEmpty(element[DATA])) {\n delete element[DATA];\n }\n }\n\n function globalApi(App) {\n App.component = component;\n App.getComponents = getComponents;\n App.getComponent = getComponent;\n App.update = update;\n App.use = function(plugin) {\n if (plugin.installed) {\n return;\n }\n plugin.call(null, this);\n plugin.installed = true;\n return this;\n };\n App.mixin = function(mixin, component2) {\n component2 = (isString(component2) ? this.component(component2) : component2) || this;\n component2.options = mergeOptions(component2.options, mixin);\n };\n App.extend = function(options) {\n options || (options = {});\n const Super = this;\n const Sub = function UIkitComponent(options2) {\n init$1(this, options2);\n };\n Sub.prototype = Object.create(Super.prototype);\n Sub.prototype.constructor = Sub;\n Sub.options = mergeOptions(Super.options, options);\n Sub.super = Super;\n Sub.extend = Super.extend;\n return Sub;\n };\n let container;\n Object.defineProperty(App, \"container\", {\n get() {\n return container || document.body;\n },\n set(element) {\n container = $(element);\n }\n });\n }\n function update(element, e) {\n element = element ? toNode(element) : document.body;\n for (const parentEl of parents(element).reverse()) {\n updateElement(parentEl, e);\n }\n apply(element, (element2) => updateElement(element2, e));\n }\n function updateElement(element, e) {\n const components = getComponents(element);\n for (const name in components) {\n callUpdate(components[name], e);\n }\n }\n\n function instanceApi(App) {\n App.prototype.$mount = function(el) {\n const instance = this;\n attachToElement(el, instance);\n instance.$options.el = el;\n if (document.contains(el)) {\n callConnected(instance);\n }\n };\n App.prototype.$destroy = function(removeEl = false) {\n const instance = this;\n const { el } = instance.$options;\n if (el) {\n callDisconnected(instance);\n }\n callHook(instance, \"destroy\");\n detachFromElement(el, instance);\n if (removeEl) {\n remove$1(instance.$el);\n }\n };\n App.prototype.$create = createComponent;\n App.prototype.$emit = function(e) {\n callUpdate(this, e);\n };\n App.prototype.$update = function(element = this.$el, e) {\n update(element, e);\n };\n App.prototype.$reset = function() {\n callDisconnected(this);\n callConnected(this);\n };\n App.prototype.$getComponent = getComponent;\n Object.defineProperties(App.prototype, {\n $el: {\n get() {\n return this.$options.el;\n }\n },\n $container: Object.getOwnPropertyDescriptor(App, \"container\")\n });\n }\n let id = 1;\n function generateId(instance, el = null) {\n return (el == null ? void 0 : el.id) || `${instance.$options.id}-${id++}`;\n }\n\n var SliderNav = {\n i18n: {\n next: \"Next slide\",\n previous: \"Previous slide\",\n slideX: \"Slide %s\",\n slideLabel: \"%s of %s\",\n role: \"String\"\n },\n data: {\n selNav: false,\n role: \"region\"\n },\n computed: {\n nav: ({ selNav }, $el) => $(selNav, $el),\n navChildren() {\n return children(this.nav);\n },\n selNavItem: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n navItems(_, $el) {\n return $$(this.selNavItem, $el);\n }\n },\n watch: {\n nav(nav, prev) {\n attr(nav, \"role\", \"tablist\");\n this.padNavitems();\n if (prev) {\n this.$emit();\n }\n },\n list(list) {\n if (isTag(list, \"ul\")) {\n attr(list, \"role\", \"presentation\");\n }\n },\n navChildren(children2) {\n attr(children2, \"role\", \"presentation\");\n this.padNavitems();\n this.updateNav();\n },\n navItems(items) {\n for (const el of items) {\n const cmd = data(el, this.attrItem);\n const button = $(\"a,button\", el) || el;\n let ariaLabel;\n let ariaControls = null;\n if (isNumeric(cmd)) {\n const item = toNumber(cmd);\n const slide = this.slides[item];\n if (slide) {\n if (!slide.id) {\n slide.id = generateId(this, slide);\n }\n ariaControls = slide.id;\n }\n ariaLabel = this.t(\"slideX\", toFloat(cmd) + 1);\n attr(button, \"role\", \"tab\");\n } else {\n if (this.list) {\n if (!this.list.id) {\n this.list.id = generateId(this, this.list);\n }\n ariaControls = this.list.id;\n }\n ariaLabel = this.t(cmd);\n }\n attr(button, {\n \"aria-controls\": ariaControls,\n \"aria-label\": attr(button, \"aria-label\") || ariaLabel\n });\n }\n },\n slides(slides) {\n slides.forEach(\n (slide, i) => attr(slide, {\n role: this.nav ? \"tabpanel\" : \"group\",\n \"aria-label\": this.t(\"slideLabel\", i + 1, this.length),\n \"aria-roledescription\": this.nav ? null : \"slide\"\n })\n );\n this.padNavitems();\n }\n },\n connected() {\n attr(this.$el, {\n role: this.role,\n \"aria-roledescription\": \"carousel\"\n });\n },\n update: [\n {\n write() {\n this.navItems.concat(this.nav).forEach((el) => el && (el.hidden = !this.maxIndex));\n this.updateNav();\n },\n events: [\"resize\"]\n }\n ],\n events: [\n {\n name: \"click keydown\",\n delegate: ({ selNavItem }) => selNavItem,\n filter: ({ parallax }) => !parallax,\n handler(e) {\n if (e.target.closest(\"a,button\") && (e.type === \"click\" || e.keyCode === keyMap.SPACE)) {\n e.preventDefault();\n this.show(data(e.current, this.attrItem));\n }\n }\n },\n {\n name: \"itemshow\",\n handler: \"updateNav\"\n },\n {\n name: \"keydown\",\n delegate: ({ selNavItem }) => selNavItem,\n filter: ({ parallax }) => !parallax,\n handler(e) {\n const { current, keyCode } = e;\n const cmd = data(current, this.attrItem);\n if (!isNumeric(cmd)) {\n return;\n }\n let i = keyCode === keyMap.HOME ? 0 : keyCode === keyMap.END ? \"last\" : keyCode === keyMap.LEFT ? \"previous\" : keyCode === keyMap.RIGHT ? \"next\" : -1;\n if (~i) {\n e.preventDefault();\n this.show(i);\n }\n }\n }\n ],\n methods: {\n updateNav() {\n const index = this.getValidIndex();\n for (const el of this.navItems) {\n const cmd = data(el, this.attrItem);\n const button = $(\"a,button\", el) || el;\n if (isNumeric(cmd)) {\n const item = toNumber(cmd);\n const active = item === index;\n toggleClass(el, this.clsActive, active);\n toggleClass(button, \"uk-disabled\", this.parallax);\n attr(button, {\n \"aria-selected\": active,\n tabindex: active && !this.parallax ? null : -1\n });\n if (active && button && matches(parent(el), \":focus-within\")) {\n button.focus();\n }\n } else {\n toggleClass(\n el,\n \"uk-invisible\",\n this.finite && (cmd === \"previous\" && index === 0 || cmd === \"next\" && index >= this.maxIndex)\n );\n }\n }\n },\n padNavitems() {\n if (!this.nav) {\n return;\n }\n const children2 = [];\n for (let i = 0; i < this.length; i++) {\n const attr2 = `${this.attrItem}=\"${i}\"`;\n children2[i] = this.navChildren.findLast((el) => el.matches(`[${attr2}]`)) || $(`
  • `);\n }\n if (!isEqual(children2, this.navChildren)) {\n html(this.nav, children2);\n }\n }\n }\n };\n\n const easeOutQuad = \"cubic-bezier(0.25, 0.46, 0.45, 0.94)\";\n const easeOutQuart = \"cubic-bezier(0.165, 0.84, 0.44, 1)\";\n var Slider = {\n mixins: [SliderAutoplay, SliderDrag, SliderNav, I18n],\n props: {\n clsActivated: String,\n easing: String,\n index: Number,\n finite: Boolean,\n velocity: Number\n },\n data: () => ({\n easing: \"ease\",\n finite: false,\n velocity: 1,\n index: 0,\n prevIndex: -1,\n stack: [],\n percent: 0,\n clsActive: \"uk-active\",\n clsActivated: \"\",\n clsEnter: \"uk-slide-enter\",\n clsLeave: \"uk-slide-leave\",\n clsSlideActive: \"uk-slide-active\",\n Transitioner: false,\n transitionOptions: {}\n }),\n connected() {\n this.prevIndex = -1;\n this.index = this.getValidIndex(this.$props.index);\n this.stack = [];\n },\n disconnected() {\n removeClass(this.slides, this.clsActive);\n },\n computed: {\n duration: ({ velocity }, $el) => speedUp($el.offsetWidth / velocity),\n list: ({ selList }, $el) => $(selList, $el),\n maxIndex() {\n return this.length - 1;\n },\n slides() {\n return children(this.list);\n },\n length() {\n return this.slides.length;\n }\n },\n watch: {\n slides(slides, prev) {\n if (prev) {\n this.$emit();\n }\n }\n },\n events: {\n itemshow({ target }) {\n addClass(target, this.clsEnter, this.clsSlideActive);\n },\n itemshown({ target }) {\n removeClass(target, this.clsEnter);\n },\n itemhide({ target }) {\n addClass(target, this.clsLeave);\n },\n itemhidden({ target }) {\n removeClass(target, this.clsLeave, this.clsSlideActive);\n }\n },\n methods: {\n show(index, force = false) {\n var _a;\n if (this.dragging || !this.length || this.parallax) {\n return;\n }\n const { stack } = this;\n const queueIndex = force ? 0 : stack.length;\n const reset = () => {\n stack.splice(queueIndex, 1);\n if (stack.length) {\n this.show(stack.shift(), true);\n }\n };\n stack[force ? \"unshift\" : \"push\"](index);\n if (!force && stack.length > 1) {\n if (stack.length === 2) {\n (_a = this._transitioner) == null ? void 0 : _a.forward(Math.min(this.duration, 200));\n }\n return;\n }\n const prevIndex = this.getIndex(this.index);\n const prev = hasClass(this.slides, this.clsActive) && this.slides[prevIndex];\n const nextIndex = this.getIndex(index, this.index);\n const next = this.slides[nextIndex];\n if (prev === next) {\n reset();\n return;\n }\n this.dir = getDirection(index, prevIndex);\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (prev && !trigger(prev, \"beforeitemhide\", [this]) || !trigger(next, \"beforeitemshow\", [this, prev])) {\n this.index = this.prevIndex;\n reset();\n return;\n }\n const promise = this._show(prev, next, force).then(() => {\n prev && trigger(prev, \"itemhidden\", [this]);\n trigger(next, \"itemshown\", [this]);\n stack.shift();\n this._transitioner = null;\n if (stack.length) {\n requestAnimationFrame(() => stack.length && this.show(stack.shift(), true));\n }\n });\n prev && trigger(prev, \"itemhide\", [this]);\n trigger(next, \"itemshow\", [this]);\n return promise;\n },\n getIndex(index = this.index, prev = this.index) {\n return clamp(\n getIndex(index, this.slides, prev, this.finite),\n 0,\n Math.max(0, this.maxIndex)\n );\n },\n getValidIndex(index = this.index, prevIndex = this.prevIndex) {\n return this.getIndex(index, prevIndex);\n },\n async _show(prev, next, force) {\n this._transitioner = this._getTransitioner(prev, next, this.dir, {\n easing: force ? next.offsetWidth < 600 ? easeOutQuad : easeOutQuart : this.easing,\n ...this.transitionOptions\n });\n if (!force && !prev) {\n this._translate(1);\n return;\n }\n const { length } = this.stack;\n return this._transitioner[length > 1 ? \"forward\" : \"show\"](\n length > 1 ? Math.min(this.duration, 75 + 75 / (length - 1)) : this.duration,\n this.percent\n );\n },\n _translate(percent, prev = this.prevIndex, next = this.index) {\n const transitioner = this._getTransitioner(prev === next ? false : prev, next);\n transitioner.translate(percent);\n return transitioner;\n },\n _getTransitioner(prev = this.prevIndex, next = this.index, dir = this.dir || 1, options = this.transitionOptions) {\n return new this.Transitioner(\n isNumber(prev) ? this.slides[prev] : prev,\n isNumber(next) ? this.slides[next] : next,\n dir * (isRtl ? -1 : 1),\n options\n );\n }\n }\n };\n function getDirection(index, prevIndex) {\n return index === \"next\" ? 1 : index === \"previous\" ? -1 : index < prevIndex ? -1 : 1;\n }\n function speedUp(x) {\n return 0.5 * x + 300;\n }\n\n var Slideshow = {\n mixins: [Slider],\n props: {\n animation: String\n },\n data: {\n animation: \"slide\",\n clsActivated: \"uk-transition-active\",\n Animations: Animations$2,\n Transitioner: Transitioner$1\n },\n computed: {\n animation({ animation, Animations: Animations2 }) {\n return { ...Animations2[animation] || Animations2.slide, name: animation };\n },\n transitionOptions() {\n return { animation: this.animation };\n }\n },\n observe: resize(),\n events: {\n beforeitemshow({ target }) {\n addClass(target, this.clsActive);\n },\n itemshown({ target }) {\n addClass(target, this.clsActivated);\n },\n itemhidden({ target }) {\n removeClass(target, this.clsActive, this.clsActivated);\n }\n }\n };\n\n var Animations$1 = {\n ...Animations$2,\n fade: {\n show() {\n return [{ opacity: 0 }, { opacity: 1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [{ opacity: 1 - percent }, { opacity: percent }];\n }\n },\n scale: {\n show() {\n return [\n { opacity: 0, transform: scale3d(1 - 0.2) },\n { opacity: 1, transform: scale3d(1) }\n ];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [\n { opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },\n { opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }\n ];\n }\n }\n };\n\n var LightboxPanel = {\n mixins: [Modal, Slideshow],\n functional: true,\n props: {\n delayControls: Number,\n preload: Number,\n videoAutoplay: Boolean,\n template: String\n },\n data: () => ({\n preload: 1,\n videoAutoplay: false,\n delayControls: 3e3,\n items: [],\n cls: \"uk-open\",\n clsPage: \"uk-lightbox-page\",\n selList: \".uk-lightbox-items\",\n attrItem: \"uk-lightbox-item\",\n selClose: \".uk-close-large\",\n selCaption: \".uk-lightbox-caption\",\n pauseOnHover: false,\n velocity: 2,\n Animations: Animations$1,\n template: `
    `\n }),\n created() {\n const $el = $(this.template);\n const list = $(this.selList, $el);\n this.items.forEach(() => append(list, \"
    \"));\n const close = $(\"[uk-close]\", $el);\n const closeLabel = this.t(\"close\");\n if (close && closeLabel) {\n close.dataset.i18n = JSON.stringify({ label: closeLabel });\n }\n this.$mount(append(this.container, $el));\n },\n events: [\n {\n name: `${pointerMove$1} ${pointerDown$1} keydown`,\n handler: \"showControls\"\n },\n {\n name: \"click\",\n self: true,\n delegate: ({ selList }) => `${selList} > *`,\n handler(e) {\n if (!e.defaultPrevented) {\n this.hide();\n }\n }\n },\n {\n name: \"shown\",\n self: true,\n handler: \"showControls\"\n },\n {\n name: \"hide\",\n self: true,\n handler() {\n this.hideControls();\n removeClass(this.slides, this.clsActive);\n Transition.stop(this.slides);\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n this.$destroy(true);\n }\n },\n {\n name: \"keyup\",\n el: () => document,\n handler({ keyCode }) {\n if (!this.isToggled(this.$el) || !this.draggable) {\n return;\n }\n let i = -1;\n if (keyCode === keyMap.LEFT) {\n i = \"previous\";\n } else if (keyCode === keyMap.RIGHT) {\n i = \"next\";\n } else if (keyCode === keyMap.HOME) {\n i = 0;\n } else if (keyCode === keyMap.END) {\n i = \"last\";\n }\n if (~i) {\n this.show(i);\n }\n }\n },\n {\n name: \"beforeitemshow\",\n handler(e) {\n if (this.isToggled()) {\n return;\n }\n this.draggable = false;\n e.preventDefault();\n this.toggleElement(this.$el, true, false);\n this.animation = Animations$1[\"scale\"];\n removeClass(e.target, this.clsActive);\n this.stack.splice(1, 0, this.index);\n }\n },\n {\n name: \"itemshow\",\n handler() {\n html($(this.selCaption, this.$el), this.getItem().caption || \"\");\n for (let j = -this.preload; j <= this.preload; j++) {\n this.loadItem(this.index + j);\n }\n }\n },\n {\n name: \"itemshown\",\n handler() {\n this.draggable = this.$props.draggable;\n }\n },\n {\n name: \"itemload\",\n async handler(_, item) {\n const { source: src, type, alt = \"\", poster, attrs = {} } = item;\n this.setItem(item, \"\");\n if (!src) {\n return;\n }\n let matches;\n const iframeAttrs = {\n allowfullscreen: \"\",\n style: \"max-width: 100%; box-sizing: border-box;\",\n \"uk-responsive\": \"\",\n \"uk-video\": `${this.videoAutoplay}`\n };\n if (type === \"image\" || src.match(/\\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\\?)/i)) {\n const img = createEl(\"img\", { src, alt, ...attrs });\n on(img, \"load\", () => this.setItem(item, img));\n on(img, \"error\", () => this.setError(item));\n } else if (type === \"video\" || src.match(/\\.(mp4|webm|ogv)($|\\?)/i)) {\n const video = createEl(\"video\", {\n src,\n poster,\n controls: \"\",\n playsinline: \"\",\n \"uk-video\": `${this.videoAutoplay}`,\n ...attrs\n });\n on(video, \"loadedmetadata\", () => this.setItem(item, video));\n on(video, \"error\", () => this.setError(item));\n } else if (type === \"iframe\" || src.match(/\\.(html|php)($|\\?)/i)) {\n this.setItem(\n item,\n createEl(\"iframe\", {\n src,\n allowfullscreen: \"\",\n class: \"uk-lightbox-iframe\",\n ...attrs\n })\n );\n } else if (matches = src.match(\n /\\/\\/(?:.*?youtube(-nocookie)?\\..*?(?:[?&]v=|\\/shorts\\/)|youtu\\.be\\/)([\\w-]{11})[&?]?(.*)?/\n )) {\n this.setItem(\n item,\n createEl(\"iframe\", {\n src: `https://www.youtube${matches[1] || \"\"}.com/embed/${matches[2]}${matches[3] ? `?${matches[3]}` : \"\"}`,\n width: 1920,\n height: 1080,\n ...iframeAttrs,\n ...attrs\n })\n );\n } else if (matches = src.match(/\\/\\/.*?vimeo\\.[a-z]+\\/(\\d+)[&?]?(.*)?/)) {\n try {\n const { height, width } = await (await fetch(\n `https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(\n src\n )}`,\n { credentials: \"omit\" }\n )).json();\n this.setItem(\n item,\n createEl(\"iframe\", {\n src: `https://player.vimeo.com/video/${matches[1]}${matches[2] ? `?${matches[2]}` : \"\"}`,\n width,\n height,\n ...iframeAttrs,\n ...attrs\n })\n );\n } catch (e) {\n this.setError(item);\n }\n }\n }\n }\n ],\n methods: {\n loadItem(index = this.index) {\n const item = this.getItem(index);\n if (!this.getSlide(item).childElementCount) {\n trigger(this.$el, \"itemload\", [item]);\n }\n },\n getItem(index = this.index) {\n return this.items[getIndex(index, this.slides)];\n },\n setItem(item, content) {\n trigger(this.$el, \"itemloaded\", [this, html(this.getSlide(item), content)]);\n },\n getSlide(item) {\n return this.slides[this.items.indexOf(item)];\n },\n setError(item) {\n this.setItem(item, '');\n },\n showControls() {\n clearTimeout(this.controlsTimer);\n this.controlsTimer = setTimeout(this.hideControls, this.delayControls);\n addClass(this.$el, \"uk-active\", \"uk-transition-active\");\n },\n hideControls() {\n removeClass(this.$el, \"uk-active\", \"uk-transition-active\");\n }\n }\n };\n function createEl(tag, attrs) {\n const el = fragment(`<${tag}>`);\n attr(el, attrs);\n return el;\n }\n\n var lightbox = {\n install: install$3,\n props: { toggle: String },\n data: { toggle: \"a\" },\n computed: {\n toggles: ({ toggle }, $el) => $$(toggle, $el)\n },\n watch: {\n toggles(toggles) {\n this.hide();\n for (const toggle of toggles) {\n if (isTag(toggle, \"a\")) {\n attr(toggle, \"role\", \"button\");\n }\n }\n }\n },\n disconnected() {\n this.hide();\n },\n events: {\n name: \"click\",\n delegate: ({ toggle }) => `${toggle}:not(.uk-disabled)`,\n handler(e) {\n if (!e.defaultPrevented) {\n e.preventDefault();\n this.show(e.current);\n }\n }\n },\n methods: {\n show(index) {\n const items = uniqueBy(this.toggles.map(toItem), \"source\");\n if (isElement(index)) {\n const { source } = toItem(index);\n index = findIndex(items, ({ source: src }) => source === src);\n }\n this.panel = this.panel || this.$create(\"lightboxPanel\", { ...this.$props, items });\n on(this.panel.$el, \"hidden\", () => this.panel = null);\n return this.panel.show(index);\n },\n hide() {\n var _a;\n return (_a = this.panel) == null ? void 0 : _a.hide();\n }\n }\n };\n function install$3(UIkit, Lightbox) {\n if (!UIkit.lightboxPanel) {\n UIkit.component(\"lightboxPanel\", LightboxPanel);\n }\n assign(Lightbox.props, UIkit.component(\"lightboxPanel\").options.props);\n }\n function toItem(el) {\n const item = {};\n for (const attr2 of [\"href\", \"caption\", \"type\", \"poster\", \"alt\", \"attrs\"]) {\n item[attr2 === \"href\" ? \"source\" : attr2] = data(el, attr2);\n }\n item.attrs = parseOptions(item.attrs);\n return item;\n }\n\n var notification = {\n mixins: [Container],\n functional: true,\n args: [\"message\", \"status\"],\n data: {\n message: \"\",\n status: \"\",\n timeout: 5e3,\n group: \"\",\n pos: \"top-center\",\n clsContainer: \"uk-notification\",\n clsClose: \"uk-notification-close\",\n clsMsg: \"uk-notification-message\"\n },\n install: install$2,\n computed: {\n marginProp: ({ pos }) => `margin-${pos.match(/[a-z]+(?=-)/)[0]}`,\n startProps() {\n return { opacity: 0, [this.marginProp]: -this.$el.offsetHeight };\n }\n },\n created() {\n const posClass = `${this.clsContainer}-${this.pos}`;\n const containerAttr = `data-${this.clsContainer}-container`;\n const container = $(`.${posClass}[${containerAttr}]`, this.container) || append(\n this.container,\n `
    `\n );\n this.$mount(\n append(\n container,\n `
    ${this.message}
    `\n )\n );\n },\n async connected() {\n const margin = toFloat(css(this.$el, this.marginProp));\n await Transition.start(css(this.$el, this.startProps), {\n opacity: 1,\n [this.marginProp]: margin\n });\n if (this.timeout) {\n this.timer = setTimeout(this.close, this.timeout);\n }\n },\n events: {\n click(e) {\n if (e.target.closest('a[href=\"#\"],a[href=\"\"]')) {\n e.preventDefault();\n }\n this.close();\n },\n [pointerEnter]() {\n if (this.timer) {\n clearTimeout(this.timer);\n }\n },\n [pointerLeave]() {\n if (this.timeout) {\n this.timer = setTimeout(this.close, this.timeout);\n }\n }\n },\n methods: {\n async close(immediate) {\n const removeFn = (el) => {\n const container = parent(el);\n trigger(el, \"close\", [this]);\n remove$1(el);\n if (!(container == null ? void 0 : container.hasChildNodes())) {\n remove$1(container);\n }\n };\n if (this.timer) {\n clearTimeout(this.timer);\n }\n if (!immediate) {\n await Transition.start(this.$el, this.startProps);\n }\n removeFn(this.$el);\n }\n }\n };\n function install$2(UIkit) {\n UIkit.notification.closeAll = function(group, immediate) {\n apply(document.body, (el) => {\n const notification = UIkit.getComponent(el, \"notification\");\n if (notification && (!group || group === notification.group)) {\n notification.close(immediate);\n }\n });\n };\n }\n\n var Media = {\n props: {\n media: Boolean\n },\n data: {\n media: false\n },\n connected() {\n const media = toMedia(this.media, this.$el);\n this.matchMedia = true;\n if (media) {\n this.mediaObj = window.matchMedia(media);\n const handler = () => {\n this.matchMedia = this.mediaObj.matches;\n trigger(this.$el, createEvent(\"mediachange\", false, true, [this.mediaObj]));\n };\n this.offMediaObj = on(this.mediaObj, \"change\", () => {\n handler();\n this.$emit(\"resize\");\n });\n handler();\n }\n },\n disconnected() {\n var _a;\n (_a = this.offMediaObj) == null ? void 0 : _a.call(this);\n }\n };\n function toMedia(value, element) {\n if (isString(value)) {\n if (startsWith(value, \"@\")) {\n value = toFloat(css(element, `--uk-breakpoint-${value.slice(1)}`));\n } else if (isNaN(value)) {\n return value;\n }\n }\n return value && isNumeric(value) ? `(min-width: ${value}px)` : \"\";\n }\n\n function getMaxPathLength(el) {\n return isVisible(el) ? Math.ceil(Math.max(0, ...$$(\"[stroke]\", el).map((stroke) => stroke.getTotalLength()))) : 0;\n }\n\n const props = {\n x: transformFn,\n y: transformFn,\n rotate: transformFn,\n scale: transformFn,\n color: colorFn,\n backgroundColor: colorFn,\n borderColor: colorFn,\n blur: filterFn,\n hue: filterFn,\n fopacity: filterFn,\n grayscale: filterFn,\n invert: filterFn,\n saturate: filterFn,\n sepia: filterFn,\n opacity: cssPropFn,\n stroke: strokeFn,\n bgx: backgroundFn,\n bgy: backgroundFn\n };\n const { keys } = Object;\n var Parallax = {\n mixins: [Media],\n props: fillObject(keys(props), \"list\"),\n data: fillObject(keys(props), void 0),\n computed: {\n props(properties, $el) {\n const stops = {};\n for (const prop in properties) {\n if (prop in props && !isUndefined(properties[prop])) {\n stops[prop] = properties[prop].slice();\n }\n }\n const result = {};\n for (const prop in stops) {\n result[prop] = props[prop](prop, $el, stops[prop], stops);\n }\n return result;\n }\n },\n events: {\n load() {\n this.$emit();\n }\n },\n methods: {\n reset() {\n for (const prop in this.getCss(0)) {\n css(this.$el, prop, \"\");\n }\n },\n getCss(percent) {\n const css2 = {};\n for (const prop in this.props) {\n this.props[prop](css2, clamp(percent));\n }\n css2.willChange = Object.keys(css2).map(propName).join(\",\");\n return css2;\n }\n }\n };\n function transformFn(prop, el, stops) {\n let unit = getUnit(stops) || { x: \"px\", y: \"px\", rotate: \"deg\" }[prop] || \"\";\n let transformFn2;\n if (prop === \"x\" || prop === \"y\") {\n prop = `translate${ucfirst(prop)}`;\n transformFn2 = (stop) => toFloat(toFloat(stop).toFixed(unit === \"px\" ? 0 : 6));\n } else if (prop === \"scale\") {\n unit = \"\";\n transformFn2 = (stop) => {\n var _a;\n return getUnit([stop]) ? toPx(stop, \"width\", el, true) / el[`offset${((_a = stop.endsWith) == null ? void 0 : _a.call(stop, \"vh\")) ? \"Height\" : \"Width\"}`] : toFloat(stop);\n };\n }\n if (stops.length === 1) {\n stops.unshift(prop === \"scale\" ? 1 : 0);\n }\n stops = parseStops(stops, transformFn2);\n return (css2, percent) => {\n css2.transform = `${css2.transform || \"\"} ${prop}(${getValue(stops, percent)}${unit})`;\n };\n }\n function colorFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(getCssValue(el, prop, \"\"));\n }\n stops = parseStops(stops, (stop) => parseColor(el, stop));\n return (css2, percent) => {\n const [start, end, p] = getStop(stops, percent);\n const value = start.map((value2, i) => {\n value2 += p * (end[i] - value2);\n return i === 3 ? toFloat(value2) : parseInt(value2, 10);\n }).join(\",\");\n css2[prop] = `rgba(${value})`;\n };\n }\n function parseColor(el, color) {\n return getCssValue(el, \"color\", color).split(/[(),]/g).slice(1, -1).concat(1).slice(0, 4).map(toFloat);\n }\n function filterFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const unit = getUnit(stops) || { blur: \"px\", hue: \"deg\" }[prop] || \"%\";\n prop = { fopacity: \"opacity\", hue: \"hue-rotate\" }[prop] || prop;\n stops = parseStops(stops);\n return (css2, percent) => {\n const value = getValue(stops, percent);\n css2.filter = `${css2.filter || \"\"} ${prop}(${value + unit})`;\n };\n }\n function cssPropFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(getCssValue(el, prop, \"\"));\n }\n stops = parseStops(stops);\n return (css2, percent) => {\n css2[prop] = getValue(stops, percent);\n };\n }\n function strokeFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const unit = getUnit(stops);\n const length = getMaxPathLength(el);\n stops = parseStops(stops.reverse(), (stop) => {\n stop = toFloat(stop);\n return unit === \"%\" ? stop * length / 100 : stop;\n });\n if (!stops.some(([value]) => value)) {\n return noop;\n }\n css(el, \"strokeDasharray\", length);\n return (css2, percent) => {\n css2.strokeDashoffset = getValue(stops, percent);\n };\n }\n function backgroundFn(prop, el, stops, props2) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const attr = prop === \"bgy\" ? \"height\" : \"width\";\n props2[prop] = parseStops(stops, (stop) => toPx(stop, attr, el));\n const bgProps = [\"bgx\", \"bgy\"].filter((prop2) => prop2 in props2);\n if (bgProps.length === 2 && prop === \"bgx\") {\n return noop;\n }\n if (getCssValue(el, \"backgroundSize\", \"\") === \"cover\") {\n return backgroundCoverFn(prop, el, stops, props2);\n }\n const positions = {};\n for (const prop2 of bgProps) {\n positions[prop2] = getBackgroundPos(el, prop2);\n }\n return setBackgroundPosFn(bgProps, positions, props2);\n }\n function backgroundCoverFn(prop, el, stops, props2) {\n const dimImage = getBackgroundImageDimensions(el);\n if (!dimImage.width) {\n return noop;\n }\n const dimEl = {\n width: el.offsetWidth,\n height: el.offsetHeight\n };\n const bgProps = [\"bgx\", \"bgy\"].filter((prop2) => prop2 in props2);\n const positions = {};\n for (const prop2 of bgProps) {\n const values = props2[prop2].map(([value]) => value);\n const min = Math.min(...values);\n const max = Math.max(...values);\n const down = values.indexOf(min) < values.indexOf(max);\n const diff = max - min;\n positions[prop2] = `${(down ? -diff : 0) - (down ? min : max)}px`;\n dimEl[prop2 === \"bgy\" ? \"height\" : \"width\"] += diff;\n }\n const dim = Dimensions.cover(dimImage, dimEl);\n for (const prop2 of bgProps) {\n const attr = prop2 === \"bgy\" ? \"height\" : \"width\";\n const overflow = dim[attr] - dimEl[attr];\n positions[prop2] = `max(${getBackgroundPos(el, prop2)},-${overflow}px) + ${positions[prop2]}`;\n }\n const fn = setBackgroundPosFn(bgProps, positions, props2);\n return (css2, percent) => {\n fn(css2, percent);\n css2.backgroundSize = `${dim.width}px ${dim.height}px`;\n css2.backgroundRepeat = \"no-repeat\";\n };\n }\n function getBackgroundPos(el, prop) {\n return getCssValue(el, `background-position-${prop.slice(-1)}`, \"\");\n }\n function setBackgroundPosFn(bgProps, positions, props2) {\n return function(css2, percent) {\n for (const prop of bgProps) {\n const value = getValue(props2[prop], percent);\n css2[`background-position-${prop.slice(-1)}`] = `calc(${positions[prop]} + ${value}px)`;\n }\n };\n }\n const loading = {};\n const dimensions = {};\n function getBackgroundImageDimensions(el) {\n const src = css(el, \"backgroundImage\").replace(/^none|url\\([\"']?(.+?)[\"']?\\)$/, \"$1\");\n if (dimensions[src]) {\n return dimensions[src];\n }\n const image = new Image();\n if (src) {\n image.src = src;\n if (!image.naturalWidth && !loading[src]) {\n once(image, \"error load\", () => {\n dimensions[src] = toDimensions(image);\n trigger(el, createEvent(\"load\", false));\n });\n loading[src] = true;\n return toDimensions(image);\n }\n }\n return dimensions[src] = toDimensions(image);\n }\n function toDimensions(image) {\n return {\n width: image.naturalWidth,\n height: image.naturalHeight\n };\n }\n function parseStops(stops, fn = toFloat) {\n const result = [];\n const { length } = stops;\n let nullIndex = 0;\n for (let i = 0; i < length; i++) {\n let [value, percent] = isString(stops[i]) ? stops[i].trim().split(/ (?![^(]*\\))/) : [stops[i]];\n value = fn(value);\n percent = percent ? toFloat(percent) / 100 : null;\n if (i === 0) {\n if (percent === null) {\n percent = 0;\n } else if (percent) {\n result.push([value, 0]);\n }\n } else if (i === length - 1) {\n if (percent === null) {\n percent = 1;\n } else if (percent !== 1) {\n result.push([value, percent]);\n percent = 1;\n }\n }\n result.push([value, percent]);\n if (percent === null) {\n nullIndex++;\n } else if (nullIndex) {\n const leftPercent = result[i - nullIndex - 1][1];\n const p = (percent - leftPercent) / (nullIndex + 1);\n for (let j = nullIndex; j > 0; j--) {\n result[i - j][1] = leftPercent + p * (nullIndex - j + 1);\n }\n nullIndex = 0;\n }\n }\n return result;\n }\n function getStop(stops, percent) {\n const index = findIndex(stops.slice(1), ([, targetPercent]) => percent <= targetPercent) + 1;\n return [\n stops[index - 1][0],\n stops[index][0],\n (percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])\n ];\n }\n function getValue(stops, percent) {\n const [start, end, p] = getStop(stops, percent);\n return start + Math.abs(start - end) * p * (start < end ? 1 : -1);\n }\n const unitRe = /^-?\\d+(?:\\.\\d+)?(\\S+)?/;\n function getUnit(stops, defaultUnit) {\n var _a;\n for (const stop of stops) {\n const match = (_a = stop.match) == null ? void 0 : _a.call(stop, unitRe);\n if (match) {\n return match[1];\n }\n }\n return defaultUnit;\n }\n function getCssValue(el, prop, value) {\n const prev = el.style[prop];\n const val = css(css(el, prop, value), prop);\n el.style[prop] = prev;\n return val;\n }\n function fillObject(keys2, value) {\n return keys2.reduce((data, prop) => {\n data[prop] = value;\n return data;\n }, {});\n }\n function ease(percent, easing) {\n return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, 1 - easing);\n }\n\n var parallax = {\n mixins: [Parallax],\n props: {\n target: String,\n viewport: Number,\n // Deprecated\n easing: Number,\n start: String,\n end: String\n },\n data: {\n target: false,\n viewport: 1,\n easing: 1,\n start: 0,\n end: 0\n },\n computed: {\n target: ({ target }, $el) => getOffsetElement(target && query(target, $el) || $el),\n start({ start }) {\n return toPx(start, \"height\", this.target, true);\n },\n end({ end, viewport: viewport2 }) {\n return toPx(\n end || (viewport2 = (1 - viewport2) * 100) && `${viewport2}vh+${viewport2}%`,\n \"height\",\n this.target,\n true\n );\n }\n },\n observe: [\n viewport(),\n scroll$1({ target: ({ target }) => target }),\n resize({ target: ({ $el, target }) => [$el, target, scrollParent(target, true)] })\n ],\n update: {\n read({ percent }, types) {\n if (!types.has(\"scroll\")) {\n percent = false;\n }\n if (!isVisible(this.$el)) {\n return false;\n }\n if (!this.matchMedia) {\n return;\n }\n const prev = percent;\n percent = ease(scrolledOver(this.target, this.start, this.end), this.easing);\n return {\n percent,\n style: prev === percent ? false : this.getCss(percent)\n };\n },\n write({ style }) {\n if (!this.matchMedia) {\n this.reset();\n return;\n }\n style && css(this.$el, style);\n },\n events: [\"scroll\", \"resize\"]\n }\n };\n function getOffsetElement(el) {\n return el ? \"offsetTop\" in el ? el : getOffsetElement(parent(el)) : document.documentElement;\n }\n\n var SliderParallax = {\n props: {\n parallax: Boolean,\n parallaxTarget: Boolean,\n parallaxStart: String,\n parallaxEnd: String,\n parallaxEasing: Number\n },\n data: {\n parallax: false,\n parallaxTarget: false,\n parallaxStart: 0,\n parallaxEnd: 0,\n parallaxEasing: 0\n },\n observe: [\n resize({\n target: ({ $el, parallaxTarget }) => [$el, parallaxTarget],\n filter: ({ parallax }) => parallax\n }),\n scroll$1({ filter: ({ parallax }) => parallax })\n ],\n computed: {\n parallaxTarget({ parallaxTarget }, $el) {\n return parallaxTarget && query(parallaxTarget, $el) || this.list;\n }\n },\n update: {\n read() {\n if (!this.parallax) {\n return false;\n }\n const target = this.parallaxTarget;\n if (!target) {\n return false;\n }\n const start = toPx(this.parallaxStart, \"height\", target, true);\n const end = toPx(this.parallaxEnd, \"height\", target, true);\n const percent = ease(scrolledOver(target, start, end), this.parallaxEasing);\n return { parallax: this.getIndexAt(percent) };\n },\n write({ parallax }) {\n const [prevIndex, slidePercent] = parallax;\n const nextIndex = this.getValidIndex(prevIndex + Math.ceil(slidePercent));\n const prev = this.slides[prevIndex];\n const next = this.slides[nextIndex];\n const { triggerShow, triggerShown, triggerHide, triggerHidden } = useTriggers(this);\n if (~this.prevIndex) {\n for (const i of /* @__PURE__ */ new Set([this.index, this.prevIndex])) {\n if (!includes([nextIndex, prevIndex], i)) {\n triggerHide(this.slides[i]);\n triggerHidden(this.slides[i]);\n }\n }\n }\n const changed = this.prevIndex !== prevIndex || this.index !== nextIndex;\n this.dir = 1;\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (prev !== next) {\n triggerHide(prev);\n }\n triggerShow(next);\n if (changed) {\n triggerShown(prev);\n }\n this._translate(prev === next ? 1 : slidePercent, prev, next);\n },\n events: [\"scroll\", \"resize\"]\n },\n methods: {\n getIndexAt(percent) {\n const index = percent * (this.length - 1);\n return [Math.floor(index), index % 1];\n }\n }\n };\n function useTriggers(cmp) {\n const { clsSlideActive, clsEnter, clsLeave } = cmp;\n return { triggerShow, triggerShown, triggerHide, triggerHidden };\n function triggerShow(el) {\n if (hasClass(el, clsLeave)) {\n triggerHide(el);\n triggerHidden(el);\n }\n if (!hasClass(el, clsSlideActive)) {\n trigger(el, \"beforeitemshow\", [cmp]);\n trigger(el, \"itemshow\", [cmp]);\n }\n }\n function triggerShown(el) {\n if (hasClass(el, clsEnter)) {\n trigger(el, \"itemshown\", [cmp]);\n }\n }\n function triggerHide(el) {\n if (!hasClass(el, clsSlideActive)) {\n triggerShow(el);\n }\n if (hasClass(el, clsEnter)) {\n triggerShown(el);\n }\n if (!hasClass(el, clsLeave)) {\n trigger(el, \"beforeitemhide\", [cmp]);\n trigger(el, \"itemhide\", [cmp]);\n }\n }\n function triggerHidden(el) {\n if (hasClass(el, clsLeave)) {\n trigger(el, \"itemhidden\", [cmp]);\n }\n }\n }\n\n var SliderReactive = {\n update: {\n write() {\n if (this.stack.length || this.dragging || this.parallax) {\n return;\n }\n const index = this.getValidIndex();\n if (!~this.prevIndex || this.index !== index) {\n this.show(index);\n } else {\n this._translate(1);\n }\n },\n events: [\"resize\"]\n }\n };\n\n var SliderPreload = {\n observe: lazyload({\n target: ({ slides }) => slides,\n targets: (instance) => instance.getAdjacentSlides()\n }),\n methods: {\n getAdjacentSlides() {\n return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);\n }\n }\n };\n\n function Transitioner(prev, next, dir, { center, easing, list }) {\n const from = prev ? getLeft(prev, list, center) : getLeft(next, list, center) + dimensions$1(next).width * dir;\n const to = next ? getLeft(next, list, center) : from + dimensions$1(prev).width * dir * (isRtl ? -1 : 1);\n const { promise, resolve } = withResolvers();\n return {\n dir,\n show(duration, percent = 0, linear) {\n const timing = linear ? \"linear\" : easing;\n duration -= Math.round(duration * clamp(percent, -1, 1));\n css(list, \"transitionProperty\", \"none\");\n this.translate(percent);\n css(list, \"transitionProperty\", \"\");\n percent = prev ? percent : clamp(percent, 0, 1);\n triggerUpdate(this.getItemIn(), \"itemin\", { percent, duration, timing, dir });\n prev && triggerUpdate(this.getItemIn(true), \"itemout\", {\n percent: 1 - percent,\n duration,\n timing,\n dir\n });\n Transition.start(\n list,\n { transform: translate(-to * (isRtl ? -1 : 1), \"px\") },\n duration,\n timing\n ).then(resolve, noop);\n return promise;\n },\n cancel() {\n return Transition.cancel(list);\n },\n reset() {\n css(list, \"transform\", \"\");\n },\n async forward(duration, percent = this.percent()) {\n await this.cancel();\n return this.show(duration, percent, true);\n },\n translate(percent) {\n if (percent === this.percent()) {\n return;\n }\n const distance = this.getDistance() * dir * (isRtl ? -1 : 1);\n css(\n list,\n \"transform\",\n translate(\n clamp(\n -to + (distance - distance * percent),\n -getWidth(list),\n dimensions$1(list).width\n ) * (isRtl ? -1 : 1),\n \"px\"\n )\n );\n const actives = this.getActives();\n const itemIn = this.getItemIn();\n const itemOut = this.getItemIn(true);\n percent = prev ? clamp(percent, -1, 1) : 0;\n for (const slide of children(list)) {\n const isActive = includes(actives, slide);\n const isIn = slide === itemIn;\n const isOut = slide === itemOut;\n const translateIn = isIn || !isOut && (isActive || dir * (isRtl ? -1 : 1) === -1 ^ getElLeft(slide, list) > getElLeft(prev || next));\n triggerUpdate(slide, `itemtranslate${translateIn ? \"in\" : \"out\"}`, {\n dir,\n percent: isOut ? 1 - percent : isIn ? percent : isActive ? 1 : 0\n });\n }\n },\n percent() {\n return Math.abs(\n (new DOMMatrix(css(list, \"transform\")).m41 * (isRtl ? -1 : 1) + from) / (to - from)\n );\n },\n getDistance() {\n return Math.abs(to - from);\n },\n getItemIn(out = false) {\n let actives = this.getActives();\n let nextActives = inView(list, getLeft(next || prev, list, center));\n if (out) {\n const temp = actives;\n actives = nextActives;\n nextActives = temp;\n }\n return nextActives[findIndex(nextActives, (el) => !includes(actives, el))];\n },\n getActives() {\n return inView(list, getLeft(prev || next, list, center));\n }\n };\n }\n function getLeft(el, list, center) {\n const left = getElLeft(el, list);\n return center ? left - centerEl(el, list) : Math.min(left, getMax(list));\n }\n function getMax(list) {\n return Math.max(0, getWidth(list) - dimensions$1(list).width);\n }\n function getWidth(list, index) {\n return sumBy(children(list).slice(0, index), (el) => dimensions$1(el).width);\n }\n function centerEl(el, list) {\n return dimensions$1(list).width / 2 - dimensions$1(el).width / 2;\n }\n function getElLeft(el, list) {\n return el && (position(el).left + (isRtl ? dimensions$1(el).width - dimensions$1(list).width : 0)) * (isRtl ? -1 : 1) || 0;\n }\n function inView(list, listLeft) {\n listLeft -= 1;\n const listWidth = dimensions$1(list).width;\n const listRight = listLeft + listWidth + 2;\n return children(list).filter((slide) => {\n const slideLeft = getElLeft(slide, list);\n const slideRight = slideLeft + Math.min(dimensions$1(slide).width, listWidth);\n return slideLeft >= listLeft && slideRight <= listRight;\n });\n }\n\n var slider = {\n mixins: [Class, Slider, SliderReactive, SliderParallax, SliderPreload],\n props: {\n center: Boolean,\n sets: Boolean,\n active: String\n },\n data: {\n center: false,\n sets: false,\n attrItem: \"uk-slider-item\",\n selList: \".uk-slider-items\",\n selNav: \".uk-slider-nav\",\n clsContainer: \"uk-slider-container\",\n active: \"all\",\n Transitioner\n },\n computed: {\n finite({ finite }) {\n return finite || isFinite(this.list, this.center);\n },\n maxIndex() {\n if (!this.finite || this.center && !this.sets) {\n return this.length - 1;\n }\n if (this.center) {\n return last(this.sets);\n }\n let lft = 0;\n const max = getMax(this.list);\n const index = findIndex(this.slides, (el) => {\n if (lft >= max) {\n return true;\n }\n lft += dimensions$1(el).width;\n });\n return ~index ? index : this.length - 1;\n },\n sets({ sets: enabled }) {\n if (!enabled || this.parallax) {\n return;\n }\n let left = 0;\n const sets = [];\n const width = dimensions$1(this.list).width;\n for (let i = 0; i < this.length; i++) {\n const slideWidth = dimensions$1(this.slides[i]).width;\n if (left + slideWidth > width) {\n left = 0;\n }\n if (this.center) {\n if (left < width / 2 && left + slideWidth + dimensions$1(this.slides[getIndex(i + 1, this.slides)]).width / 2 > width / 2) {\n sets.push(i);\n left = width / 2 - slideWidth / 2;\n }\n } else if (left === 0) {\n sets.push(Math.min(i, this.maxIndex));\n }\n left += slideWidth;\n }\n if (sets.length) {\n return sets;\n }\n },\n transitionOptions() {\n return {\n center: this.center,\n list: this.list\n };\n },\n slides() {\n return children(this.list).filter(isVisible);\n }\n },\n connected() {\n toggleClass(this.$el, this.clsContainer, !$(`.${this.clsContainer}`, this.$el));\n },\n observe: resize({\n target: ({ slides, $el }) => [$el, ...slides]\n }),\n update: {\n write() {\n for (const el of this.navItems) {\n const index = toNumber(data(el, this.attrItem));\n if (index !== false) {\n el.hidden = !this.maxIndex || index > this.maxIndex || this.sets && !includes(this.sets, index);\n }\n }\n this.reorder();\n if (!this.parallax) {\n this._translate(1);\n }\n this.updateActiveClasses();\n },\n events: [\"resize\"]\n },\n events: {\n beforeitemshow(e) {\n if (!this.dragging && this.sets && this.stack.length < 2 && !includes(this.sets, this.index)) {\n this.index = this.getValidIndex();\n }\n const diff = Math.abs(\n this.index - this.prevIndex + (this.dir > 0 && this.index < this.prevIndex || this.dir < 0 && this.index > this.prevIndex ? (this.maxIndex + 1) * this.dir : 0)\n );\n if (!this.dragging && diff > 1) {\n for (let i = 0; i < diff; i++) {\n this.stack.splice(1, 0, this.dir > 0 ? \"next\" : \"previous\");\n }\n e.preventDefault();\n return;\n }\n const index = this.dir < 0 || !this.slides[this.prevIndex] ? this.index : this.prevIndex;\n const avgWidth = getWidth(this.list) / this.length;\n this.duration = speedUp(avgWidth / this.velocity) * (dimensions$1(this.slides[index]).width / avgWidth);\n this.reorder();\n },\n itemshow() {\n if (~this.prevIndex) {\n addClass(this._getTransitioner().getItemIn(), this.clsActive);\n }\n this.updateActiveClasses(this.prevIndex);\n },\n itemshown() {\n this.updateActiveClasses();\n }\n },\n methods: {\n reorder() {\n if (this.finite) {\n css(this.slides, \"order\", \"\");\n return;\n }\n const index = this.dir > 0 && this.slides[this.prevIndex] ? this.prevIndex : this.index;\n this.slides.forEach(\n (slide, i) => css(\n slide,\n \"order\",\n this.dir > 0 && i < index ? 1 : this.dir < 0 && i >= this.index ? -1 : \"\"\n )\n );\n if (!this.center || !this.length) {\n return;\n }\n const next = this.slides[index];\n let width = dimensions$1(this.list).width / 2 - dimensions$1(next).width / 2;\n let j = 0;\n while (width > 0) {\n const slideIndex = this.getIndex(--j + index, index);\n const slide = this.slides[slideIndex];\n css(slide, \"order\", slideIndex > index ? -2 : -1);\n width -= dimensions$1(slide).width;\n }\n },\n updateActiveClasses(currentIndex = this.index) {\n let actives = this._getTransitioner(currentIndex).getActives();\n if (this.active !== \"all\") {\n actives = [this.slides[this.getValidIndex(currentIndex)]];\n }\n const activeClasses = [\n this.clsActive,\n !this.sets || includes(this.sets, toFloat(this.index)) ? this.clsActivated : \"\"\n ];\n for (const slide of this.slides) {\n const active = includes(actives, slide);\n toggleClass(slide, activeClasses, active);\n attr(slide, \"aria-hidden\", !active);\n for (const focusable of $$(selFocusable, slide)) {\n if (!hasOwn(focusable, \"_tabindex\")) {\n focusable._tabindex = attr(focusable, \"tabindex\");\n }\n attr(focusable, \"tabindex\", active ? focusable._tabindex : -1);\n }\n }\n },\n getValidIndex(index = this.index, prevIndex = this.prevIndex) {\n index = this.getIndex(index, prevIndex);\n if (!this.sets) {\n return index;\n }\n let prev;\n do {\n if (includes(this.sets, index)) {\n return index;\n }\n prev = index;\n index = this.getIndex(index + this.dir, prevIndex);\n } while (index !== prev);\n return index;\n },\n getAdjacentSlides() {\n const { width } = dimensions$1(this.list);\n const left = -width;\n const right = width * 2;\n const slideWidth = dimensions$1(this.slides[this.index]).width;\n const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;\n const slides = /* @__PURE__ */ new Set();\n for (const i of [-1, 1]) {\n let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);\n let j = 0;\n do {\n const slide = this.slides[this.getIndex(this.index + i + j++ * i)];\n currentLeft += dimensions$1(slide).width * i;\n slides.add(slide);\n } while (this.length > j && currentLeft > left && currentLeft < right);\n }\n return Array.from(slides);\n },\n getIndexAt(percent) {\n let index = -1;\n const scrollDist = this.center ? getWidth(this.list) - (dimensions$1(this.slides[0]).width / 2 + dimensions$1(last(this.slides)).width / 2) : getWidth(this.list, this.maxIndex);\n let dist = percent * scrollDist;\n let slidePercent = 0;\n do {\n const slideWidth = dimensions$1(this.slides[++index]).width;\n const slideDist = this.center ? slideWidth / 2 + dimensions$1(this.slides[index + 1]).width / 2 : slideWidth;\n slidePercent = dist / slideDist % 1;\n dist -= slideDist;\n } while (dist >= 0 && index < this.maxIndex);\n return [index, slidePercent];\n }\n }\n };\n function isFinite(list, center) {\n if (!list || list.length < 2) {\n return true;\n }\n const { width: listWidth } = dimensions$1(list);\n if (!center) {\n return Math.ceil(getWidth(list)) < Math.trunc(listWidth + getMaxElWidth(list));\n }\n const slides = children(list);\n const listHalf = Math.trunc(listWidth / 2);\n for (const index in slides) {\n const slide = slides[index];\n const slideWidth = dimensions$1(slide).width;\n const slidesInView = /* @__PURE__ */ new Set([slide]);\n let diff = 0;\n for (const i of [-1, 1]) {\n let left = slideWidth / 2;\n let j = 0;\n while (left < listHalf) {\n const nextSlide = slides[getIndex(+index + i + j++ * i, slides)];\n if (slidesInView.has(nextSlide)) {\n return true;\n }\n left += dimensions$1(nextSlide).width;\n slidesInView.add(nextSlide);\n }\n diff = Math.max(\n diff,\n slideWidth / 2 + dimensions$1(slides[getIndex(+index + i, slides)]).width / 2 - (left - listHalf)\n );\n }\n if (Math.trunc(diff) > sumBy(\n slides.filter((slide2) => !slidesInView.has(slide2)),\n (slide2) => dimensions$1(slide2).width\n )) {\n return true;\n }\n }\n return false;\n }\n function getMaxElWidth(list) {\n return Math.max(0, ...children(list).map((el) => dimensions$1(el).width));\n }\n\n var sliderParallax = {\n mixins: [Parallax],\n beforeConnect() {\n this.item = this.$el.closest(`.${this.$options.id.replace(\"parallax\", \"items\")} > *`);\n },\n disconnected() {\n this.item = null;\n },\n events: [\n {\n name: \"itemin itemout\",\n self: true,\n el: ({ item }) => item,\n handler({ type, detail: { percent, duration, timing, dir } }) {\n fastdom.read(() => {\n if (!this.matchMedia) {\n return;\n }\n const propsFrom = this.getCss(getCurrentPercent(type, dir, percent));\n const propsTo = this.getCss(isIn(type) ? 0.5 : dir > 0 ? 1 : 0);\n fastdom.write(() => {\n css(this.$el, propsFrom);\n Transition.start(this.$el, propsTo, duration, timing).catch(noop);\n });\n });\n }\n },\n {\n name: \"transitioncanceled transitionend\",\n self: true,\n el: ({ item }) => item,\n handler() {\n Transition.cancel(this.$el);\n }\n },\n {\n name: \"itemtranslatein itemtranslateout\",\n self: true,\n el: ({ item }) => item,\n handler({ type, detail: { percent, dir } }) {\n fastdom.read(() => {\n if (!this.matchMedia) {\n this.reset();\n return;\n }\n const props = this.getCss(getCurrentPercent(type, dir, percent));\n fastdom.write(() => css(this.$el, props));\n });\n }\n }\n ]\n };\n function isIn(type) {\n return endsWith(type, \"in\");\n }\n function getCurrentPercent(type, dir, percent) {\n percent /= 2;\n return isIn(type) ^ dir < 0 ? percent : 1 - percent;\n }\n\n var Animations = {\n ...Animations$2,\n fade: {\n show() {\n return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [{ opacity: 1 - percent, zIndex: 0 }, { zIndex: -1 }];\n }\n },\n scale: {\n show() {\n return [{ opacity: 0, transform: scale3d(1 + 0.5), zIndex: 0 }, { zIndex: -1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [\n { opacity: 1 - percent, transform: scale3d(1 + 0.5 * percent), zIndex: 0 },\n { zIndex: -1 }\n ];\n }\n },\n pull: {\n show(dir) {\n return dir < 0 ? [\n { transform: translate(30), zIndex: -1 },\n { transform: translate(), zIndex: 0 }\n ] : [\n { transform: translate(-100), zIndex: 0 },\n { transform: translate(), zIndex: -1 }\n ];\n },\n percent(current, next, dir) {\n return dir < 0 ? 1 - translated(next) : translated(current);\n },\n translate(percent, dir) {\n return dir < 0 ? [\n { transform: translate(30 * percent), zIndex: -1 },\n { transform: translate(-100 * (1 - percent)), zIndex: 0 }\n ] : [\n { transform: translate(-percent * 100), zIndex: 0 },\n { transform: translate(30 * (1 - percent)), zIndex: -1 }\n ];\n }\n },\n push: {\n show(dir) {\n return dir < 0 ? [\n { transform: translate(100), zIndex: 0 },\n { transform: translate(), zIndex: -1 }\n ] : [\n { transform: translate(-30), zIndex: -1 },\n { transform: translate(), zIndex: 0 }\n ];\n },\n percent(current, next, dir) {\n return dir > 0 ? 1 - translated(next) : translated(current);\n },\n translate(percent, dir) {\n return dir < 0 ? [\n { transform: translate(percent * 100), zIndex: 0 },\n { transform: translate(-30 * (1 - percent)), zIndex: -1 }\n ] : [\n { transform: translate(-30 * percent), zIndex: -1 },\n { transform: translate(100 * (1 - percent)), zIndex: 0 }\n ];\n }\n }\n };\n\n var slideshow = {\n mixins: [Class, Slideshow, SliderReactive, SliderParallax, SliderPreload],\n props: {\n ratio: String,\n minHeight: String,\n maxHeight: String\n },\n data: {\n ratio: \"16:9\",\n minHeight: void 0,\n maxHeight: void 0,\n selList: \".uk-slideshow-items\",\n attrItem: \"uk-slideshow-item\",\n selNav: \".uk-slideshow-nav\",\n Animations\n },\n watch: {\n list(list) {\n css(list, {\n aspectRatio: this.ratio ? this.ratio.replace(\":\", \"/\") : void 0,\n minHeight: this.minHeight,\n maxHeight: this.maxHeight,\n minWidth: \"100%\",\n maxWidth: \"100%\"\n });\n }\n },\n methods: {\n getAdjacentSlides() {\n return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);\n }\n }\n };\n\n var sortable = {\n mixins: [Class, Animate],\n props: {\n group: String,\n threshold: Number,\n clsItem: String,\n clsPlaceholder: String,\n clsDrag: String,\n clsDragState: String,\n clsBase: String,\n clsNoDrag: String,\n clsEmpty: String,\n clsCustom: String,\n handle: String\n },\n data: {\n group: false,\n threshold: 5,\n clsItem: \"uk-sortable-item\",\n clsPlaceholder: \"uk-sortable-placeholder\",\n clsDrag: \"uk-sortable-drag\",\n clsDragState: \"uk-drag\",\n clsBase: \"uk-sortable\",\n clsNoDrag: \"uk-sortable-nodrag\",\n clsEmpty: \"uk-sortable-empty\",\n clsCustom: \"\",\n handle: false,\n pos: {}\n },\n events: {\n name: pointerDown$1,\n passive: false,\n handler: \"init\"\n },\n computed: {\n target: (_, $el) => ($el.tBodies || [$el])[0],\n items() {\n return children(this.target);\n },\n isEmpty() {\n return !this.items.length;\n },\n handles({ handle }, $el) {\n return handle ? $$(handle, $el) : this.items;\n }\n },\n watch: {\n isEmpty(empty) {\n toggleClass(this.target, this.clsEmpty, empty);\n },\n handles(handles, prev) {\n css(prev, { touchAction: \"\", userSelect: \"\" });\n css(handles, { touchAction: \"none\", userSelect: \"none\" });\n }\n },\n update: {\n write(data) {\n if (!this.drag || !parent(this.placeholder)) {\n return;\n }\n const {\n pos: { x, y },\n origin: { offsetTop, offsetLeft },\n placeholder\n } = this;\n css(this.drag, {\n top: y - offsetTop,\n left: x - offsetLeft\n });\n const sortable = this.getSortable(document.elementFromPoint(x, y));\n if (!sortable) {\n return;\n }\n const { items } = sortable;\n if (items.some(Transition.inProgress)) {\n return;\n }\n const target = findTarget(items, { x, y });\n if (items.length && (!target || target === placeholder)) {\n return;\n }\n const previous = this.getSortable(placeholder);\n const insertTarget = findInsertTarget(\n sortable.target,\n target,\n placeholder,\n x,\n y,\n sortable === previous && data.moved !== target\n );\n if (insertTarget === false) {\n return;\n }\n if (insertTarget && placeholder === insertTarget) {\n return;\n }\n if (sortable !== previous) {\n previous.remove(placeholder);\n data.moved = target;\n } else {\n delete data.moved;\n }\n sortable.insert(placeholder, insertTarget);\n this.touched.add(sortable);\n },\n events: [\"move\"]\n },\n methods: {\n init(e) {\n const { target, button, defaultPrevented } = e;\n const [placeholder] = this.items.filter((el) => el.contains(target));\n if (!placeholder || defaultPrevented || button > 0 || isInput(target) || target.closest(`.${this.clsNoDrag}`) || this.handle && !target.closest(this.handle)) {\n return;\n }\n e.preventDefault();\n this.pos = getEventPos(e);\n this.touched = /* @__PURE__ */ new Set([this]);\n this.placeholder = placeholder;\n this.origin = { target, index: index(placeholder), ...this.pos };\n on(document, pointerMove$1, this.move);\n on(document, pointerUp$1, this.end);\n if (!this.threshold) {\n this.start(e);\n }\n },\n start(e) {\n this.drag = appendDrag(this.$container, this.placeholder);\n const { left, top } = dimensions$1(this.placeholder);\n assign(this.origin, { offsetLeft: this.pos.x - left, offsetTop: this.pos.y - top });\n addClass(this.drag, this.clsDrag, this.clsCustom);\n addClass(this.placeholder, this.clsPlaceholder);\n addClass(this.items, this.clsItem);\n addClass(document.documentElement, this.clsDragState);\n trigger(this.$el, \"start\", [this, this.placeholder]);\n trackScroll(this.pos);\n this.move(e);\n },\n move: throttle(function(e) {\n assign(this.pos, getEventPos(e));\n if (!this.drag && (Math.abs(this.pos.x - this.origin.x) > this.threshold || Math.abs(this.pos.y - this.origin.y) > this.threshold)) {\n this.start(e);\n }\n this.$emit(\"move\");\n }),\n end() {\n off(document, pointerMove$1, this.move);\n off(document, pointerUp$1, this.end);\n if (!this.drag) {\n return;\n }\n untrackScroll();\n const sortable = this.getSortable(this.placeholder);\n if (this === sortable) {\n if (this.origin.index !== index(this.placeholder)) {\n trigger(this.$el, \"moved\", [this, this.placeholder]);\n }\n } else {\n trigger(sortable.$el, \"added\", [sortable, this.placeholder]);\n trigger(this.$el, \"removed\", [this, this.placeholder]);\n }\n trigger(this.$el, \"stop\", [this, this.placeholder]);\n remove$1(this.drag);\n this.drag = null;\n for (const { clsPlaceholder, clsItem } of this.touched) {\n for (const sortable2 of this.touched) {\n removeClass(sortable2.items, clsPlaceholder, clsItem);\n }\n }\n this.touched = null;\n removeClass(document.documentElement, this.clsDragState);\n },\n insert(element, target) {\n addClass(this.items, this.clsItem);\n if (target && target.previousElementSibling !== element) {\n this.animate(() => before(target, element));\n } else if (!target && this.target.lastElementChild !== element) {\n this.animate(() => append(this.target, element));\n }\n },\n remove(element) {\n if (this.target.contains(element)) {\n this.animate(() => remove$1(element));\n }\n },\n getSortable(element) {\n do {\n const sortable = this.$getComponent(element, \"sortable\");\n if (sortable && (sortable === this || this.group !== false && sortable.group === this.group)) {\n return sortable;\n }\n } while (element = parent(element));\n }\n }\n };\n let trackTimer;\n function trackScroll(pos) {\n let last = Date.now();\n trackTimer = setInterval(() => {\n let { x, y } = pos;\n y += document.scrollingElement.scrollTop;\n const dist = (Date.now() - last) * 0.3;\n last = Date.now();\n scrollParents(document.elementFromPoint(x, pos.y)).reverse().some((scrollEl) => {\n let { scrollTop: scroll, scrollHeight } = scrollEl;\n const { top, bottom, height: height2 } = offsetViewport(scrollEl);\n if (top < y && top + 35 > y) {\n scroll -= dist;\n } else if (bottom > y && bottom - 35 < y) {\n scroll += dist;\n } else {\n return;\n }\n if (scroll > 0 && scroll < scrollHeight - height2) {\n scrollEl.scrollTop = scroll;\n return true;\n }\n });\n }, 15);\n }\n function untrackScroll() {\n clearInterval(trackTimer);\n }\n function appendDrag(container, element) {\n let clone;\n if (isTag(element, \"li\", \"tr\")) {\n clone = $(\"
    \");\n append(clone, element.cloneNode(true).children);\n for (const attribute of element.getAttributeNames()) {\n attr(clone, attribute, element.getAttribute(attribute));\n }\n } else {\n clone = element.cloneNode(true);\n }\n append(container, clone);\n css(clone, \"margin\", \"0\", \"important\");\n css(clone, {\n boxSizing: \"border-box\",\n width: element.offsetWidth,\n height: element.offsetHeight,\n padding: css(element, \"padding\")\n });\n height(clone.firstElementChild, height(element.firstElementChild));\n return clone;\n }\n function findTarget(items, point) {\n return items[findIndex(items, (item) => pointInRect(point, dimensions$1(item)))];\n }\n function findInsertTarget(list, target, placeholder, x, y, sameList) {\n if (!children(list).length) {\n return;\n }\n const rect = dimensions$1(target);\n if (!sameList) {\n if (!isHorizontal(list, placeholder)) {\n return y < rect.top + rect.height / 2 ? target : target.nextElementSibling;\n }\n return target;\n }\n const placeholderRect = dimensions$1(placeholder);\n const sameRow = linesIntersect(\n [rect.top, rect.bottom],\n [placeholderRect.top, placeholderRect.bottom]\n );\n const [pointerPos, lengthProp, startProp, endProp] = sameRow ? [x, \"width\", \"left\", \"right\"] : [y, \"height\", \"top\", \"bottom\"];\n const diff = placeholderRect[lengthProp] < rect[lengthProp] ? rect[lengthProp] - placeholderRect[lengthProp] : 0;\n if (placeholderRect[startProp] < rect[startProp]) {\n if (diff && pointerPos < rect[startProp] + diff) {\n return false;\n }\n return target.nextElementSibling;\n }\n if (diff && pointerPos > rect[endProp] - diff) {\n return false;\n }\n return target;\n }\n function isHorizontal(list, placeholder) {\n const single = children(list).length === 1;\n if (single) {\n append(list, placeholder);\n }\n const items = children(list);\n const isHorizontal2 = items.some((el, i) => {\n const rectA = dimensions$1(el);\n return items.slice(i + 1).some((el2) => {\n const rectB = dimensions$1(el2);\n return !linesIntersect([rectA.left, rectA.right], [rectB.left, rectB.right]);\n });\n });\n if (single) {\n remove$1(placeholder);\n }\n return isHorizontal2;\n }\n function linesIntersect(lineA, lineB) {\n return lineA[1] > lineB[0] && lineB[1] > lineA[0];\n }\n function throttle(fn) {\n let throttled;\n return function(...args) {\n if (!throttled) {\n throttled = true;\n fn.call(this, ...args);\n requestAnimationFrame(() => throttled = false);\n }\n };\n }\n\n var Position = {\n props: {\n pos: String,\n offset: Boolean,\n flip: Boolean,\n shift: Boolean,\n inset: Boolean\n },\n data: {\n pos: `bottom-${isRtl ? \"right\" : \"left\"}`,\n offset: false,\n flip: true,\n shift: true,\n inset: false\n },\n connected() {\n this.pos = this.$props.pos.split(\"-\").concat(\"center\").slice(0, 2);\n [this.dir, this.align] = this.pos;\n this.axis = includes([\"top\", \"bottom\"], this.dir) ? \"y\" : \"x\";\n },\n methods: {\n positionAt(element, target, boundary) {\n let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];\n const placement = [this.flip && \"flip\", this.shift && \"shift\"];\n const attach = {\n element: [this.inset ? this.dir : flipPosition(this.dir), this.align],\n target: [this.dir, this.align]\n };\n if (this.axis === \"y\") {\n for (const prop in attach) {\n attach[prop].reverse();\n }\n offset.reverse();\n placement.reverse();\n }\n const restoreScrollPosition = storeScrollPosition(element);\n const elDim = dimensions$1(element);\n css(element, { top: -elDim.height, left: -elDim.width });\n positionAt(element, target, {\n attach,\n offset,\n boundary,\n placement,\n viewportOffset: this.getViewportOffset(element)\n });\n restoreScrollPosition();\n },\n getPositionOffset(element = this.$el) {\n return toPx(\n this.offset === false ? css(element, \"--uk-position-offset\") : this.offset,\n this.axis === \"x\" ? \"width\" : \"height\",\n element\n ) * (includes([\"left\", \"top\"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);\n },\n getShiftOffset(element = this.$el) {\n return this.align === \"center\" ? 0 : toPx(\n css(element, \"--uk-position-shift-offset\"),\n this.axis === \"y\" ? \"width\" : \"height\",\n element\n ) * (includes([\"left\", \"top\"], this.align) ? 1 : -1);\n },\n getViewportOffset(element) {\n return toPx(css(element, \"--uk-position-viewport-offset\"));\n }\n }\n };\n function storeScrollPosition(element) {\n const scrollElement = scrollParent(element);\n const { scrollTop } = scrollElement;\n return () => {\n if (scrollTop !== scrollElement.scrollTop) {\n scrollElement.scrollTop = scrollTop;\n }\n };\n }\n\n var tooltip = {\n mixins: [Container, Togglable, Position],\n data: {\n pos: \"top\",\n animation: [\"uk-animation-scale-up\"],\n duration: 100,\n cls: \"uk-active\"\n },\n connected() {\n makeFocusable(this.$el);\n },\n disconnected() {\n this.hide();\n },\n methods: {\n show() {\n if (this.isToggled(this.tooltip || null)) {\n return;\n }\n const { delay = 0, title } = parseProps(this.$options);\n if (!title) {\n return;\n }\n const titleAttr = attr(this.$el, \"title\");\n const off = on(this.$el, [\"blur\", pointerLeave], (e) => !isTouch(e) && this.hide());\n this.reset = () => {\n attr(this.$el, { title: titleAttr, \"aria-describedby\": null });\n off();\n };\n const id = generateId(this);\n attr(this.$el, { title: null, \"aria-describedby\": id });\n clearTimeout(this.showTimer);\n this.showTimer = setTimeout(() => this._show(title, id), delay);\n },\n async hide() {\n var _a;\n if (matches(this.$el, \"input:focus\")) {\n return;\n }\n clearTimeout(this.showTimer);\n if (this.isToggled(this.tooltip || null)) {\n await this.toggleElement(this.tooltip, false, false);\n }\n (_a = this.reset) == null ? void 0 : _a.call(this);\n remove$1(this.tooltip);\n this.tooltip = null;\n },\n async _show(title, id) {\n this.tooltip = append(\n this.container,\n `
    ${title}
    `\n );\n on(this.tooltip, \"toggled\", (e, toggled) => {\n if (!toggled) {\n return;\n }\n const update = () => this.positionAt(this.tooltip, this.$el);\n update();\n const [dir, align] = getAlignment(this.tooltip, this.$el, this.pos);\n this.origin = this.axis === \"y\" ? `${flipPosition(dir)}-${align}` : `${align}-${flipPosition(dir)}`;\n const handlers = [\n once(\n document,\n `keydown ${pointerDown$1}`,\n this.hide,\n false,\n (e2) => e2.type === pointerDown$1 && !this.$el.contains(e2.target) || e2.type === \"keydown\" && e2.keyCode === keyMap.ESC\n ),\n on([document, ...overflowParents(this.$el)], \"scroll\", update, {\n passive: true\n })\n ];\n once(this.tooltip, \"hide\", () => handlers.forEach((handler) => handler()), {\n self: true\n });\n });\n if (!await this.toggleElement(this.tooltip, true)) {\n this.hide();\n }\n }\n },\n events: {\n // Clicking a button does not give it focus on all browsers and platforms\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus\n [`focus ${pointerEnter} ${pointerDown$1}`](e) {\n if (!isTouch(e) || e.type === pointerDown$1) {\n this.show();\n }\n }\n }\n };\n function makeFocusable(el) {\n if (!isFocusable(el)) {\n attr(el, \"tabindex\", \"0\");\n }\n }\n function getAlignment(el, target, [dir, align]) {\n const elOffset = offset(el);\n const targetOffset = offset(target);\n const properties = [\n [\"left\", \"right\"],\n [\"top\", \"bottom\"]\n ];\n for (const props2 of properties) {\n if (elOffset[props2[0]] >= targetOffset[props2[1]]) {\n dir = props2[1];\n break;\n }\n if (elOffset[props2[1]] <= targetOffset[props2[0]]) {\n dir = props2[0];\n break;\n }\n }\n const props = includes(properties[0], dir) ? properties[1] : properties[0];\n align = props.find((prop) => elOffset[prop] === targetOffset[prop]) || \"center\";\n return [dir, align];\n }\n function parseProps(options) {\n const { el, id, data: data$1 } = options;\n return [\"delay\", \"title\"].reduce((obj, key) => ({ [key]: data(el, key), ...obj }), {\n ...parseOptions(data(el, id), [\"title\"]),\n ...data$1\n });\n }\n\n var upload = {\n mixins: [I18n],\n i18n: {\n invalidMime: \"Invalid File Type: %s\",\n invalidName: \"Invalid File Name: %s\",\n invalidSize: \"Invalid File Size: %s Kilobytes Max\"\n },\n props: {\n allow: String,\n clsDragover: String,\n concurrent: Number,\n maxSize: Number,\n method: String,\n mime: String,\n multiple: Boolean,\n name: String,\n params: Object,\n type: String,\n url: String\n },\n data: {\n allow: false,\n clsDragover: \"uk-dragover\",\n concurrent: 1,\n maxSize: 0,\n method: \"POST\",\n mime: false,\n multiple: false,\n name: \"files[]\",\n params: {},\n type: \"\",\n url: \"\",\n abort: noop,\n beforeAll: noop,\n beforeSend: noop,\n complete: noop,\n completeAll: noop,\n error: noop,\n fail: noop,\n load: noop,\n loadEnd: noop,\n loadStart: noop,\n progress: noop\n },\n events: {\n change(e) {\n if (!matches(e.target, 'input[type=\"file\"]')) {\n return;\n }\n e.preventDefault();\n if (e.target.files) {\n this.upload(e.target.files);\n }\n e.target.value = \"\";\n },\n drop(e) {\n stop(e);\n const transfer = e.dataTransfer;\n if (!(transfer == null ? void 0 : transfer.files)) {\n return;\n }\n removeClass(this.$el, this.clsDragover);\n this.upload(transfer.files);\n },\n dragenter(e) {\n stop(e);\n },\n dragover(e) {\n stop(e);\n addClass(this.$el, this.clsDragover);\n },\n dragleave(e) {\n stop(e);\n removeClass(this.$el, this.clsDragover);\n }\n },\n methods: {\n async upload(files) {\n files = toArray(files);\n if (!files.length) {\n return;\n }\n trigger(this.$el, \"upload\", [files]);\n for (const file of files) {\n if (this.maxSize && this.maxSize * 1e3 < file.size) {\n this.fail(this.t(\"invalidSize\", this.maxSize));\n return;\n }\n if (this.allow && !match$1(this.allow, file.name)) {\n this.fail(this.t(\"invalidName\", this.allow));\n return;\n }\n if (this.mime && !match$1(this.mime, file.type)) {\n this.fail(this.t(\"invalidMime\", this.mime));\n return;\n }\n }\n if (!this.multiple) {\n files = files.slice(0, 1);\n }\n this.beforeAll(this, files);\n const chunks = chunk(files, this.concurrent);\n const upload = async (files2) => {\n const data = new FormData();\n files2.forEach((file) => data.append(this.name, file));\n for (const key in this.params) {\n data.append(key, this.params[key]);\n }\n try {\n const xhr = await ajax(this.url, {\n data,\n method: this.method,\n responseType: this.type,\n beforeSend: (env) => {\n const { xhr: xhr2 } = env;\n on(xhr2.upload, \"progress\", this.progress);\n for (const type of [\"loadStart\", \"load\", \"loadEnd\", \"abort\"]) {\n on(xhr2, type.toLowerCase(), this[type]);\n }\n return this.beforeSend(env);\n }\n });\n this.complete(xhr);\n if (chunks.length) {\n await upload(chunks.shift());\n } else {\n this.completeAll(xhr);\n }\n } catch (e) {\n this.error(e);\n }\n };\n await upload(chunks.shift());\n }\n }\n };\n function match$1(pattern, path) {\n return path.match(\n new RegExp(\n `^${pattern.replace(/\\//g, \"\\\\/\").replace(/\\*\\*/g, \"(\\\\/[^\\\\/]+)*\").replace(/\\*/g, \"[^\\\\/]+\").replace(/((?!\\\\))\\?/g, \"$1.\")}$`,\n \"i\"\n )\n );\n }\n function chunk(files, size) {\n const chunks = [];\n for (let i = 0; i < files.length; i += size) {\n chunks.push(files.slice(i, i + size));\n }\n return chunks;\n }\n function stop(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n async function ajax(url, options) {\n const env = {\n data: null,\n method: \"GET\",\n headers: {},\n xhr: new XMLHttpRequest(),\n beforeSend: noop,\n responseType: \"\",\n ...options\n };\n await env.beforeSend(env);\n return send(url, env);\n }\n function send(url, env) {\n return new Promise((resolve, reject) => {\n const { xhr } = env;\n for (const prop in env) {\n if (prop in xhr) {\n try {\n xhr[prop] = env[prop];\n } catch (e) {\n }\n }\n }\n xhr.open(env.method.toUpperCase(), url);\n for (const header in env.headers) {\n xhr.setRequestHeader(header, env.headers[header]);\n }\n on(xhr, \"load\", () => {\n if (xhr.status === 0 || xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {\n resolve(xhr);\n } else {\n reject(\n assign(Error(xhr.statusText), {\n xhr,\n status: xhr.status\n })\n );\n }\n });\n on(xhr, \"error\", () => reject(assign(Error(\"Network Error\"), { xhr })));\n on(xhr, \"timeout\", () => reject(assign(Error(\"Network Timeout\"), { xhr })));\n xhr.send(env.data);\n });\n }\n\n var components$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Countdown: countdown,\n Filter: filter,\n Lightbox: lightbox,\n LightboxPanel: LightboxPanel,\n Notification: notification,\n Parallax: parallax,\n Slider: slider,\n SliderParallax: sliderParallax,\n Slideshow: slideshow,\n SlideshowParallax: sliderParallax,\n Sortable: sortable,\n Tooltip: tooltip,\n Upload: upload\n });\n\n function boot(App) {\n if (inBrowser && window.MutationObserver) {\n if (document.body) {\n requestAnimationFrame(() => init(App));\n } else {\n new MutationObserver((records, observer) => {\n if (document.body) {\n init(App);\n observer.disconnect();\n }\n }).observe(document.documentElement, { childList: true });\n }\n }\n }\n function init(App) {\n trigger(document, \"uikit:init\", App);\n if (document.body) {\n apply(document.body, connect);\n }\n new MutationObserver((records) => records.forEach(applyChildListMutation)).observe(document, {\n subtree: true,\n childList: true\n });\n new MutationObserver((records) => records.forEach(applyAttributeMutation)).observe(document, {\n subtree: true,\n attributes: true\n });\n App._initialized = true;\n }\n function applyChildListMutation({ addedNodes, removedNodes }) {\n for (const node of addedNodes) {\n apply(node, connect);\n }\n for (const node of removedNodes) {\n apply(node, disconnect);\n }\n }\n function applyAttributeMutation({ target, attributeName }) {\n var _a;\n const name = getComponentName(attributeName);\n if (name) {\n if (hasAttr(target, attributeName)) {\n createComponent(name, target);\n } else {\n (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();\n }\n }\n }\n function connect(node) {\n const components2 = getComponents(node);\n for (const name in components2) {\n callConnected(components2[name]);\n }\n for (const attributeName of node.getAttributeNames()) {\n const name = getComponentName(attributeName);\n name && createComponent(name, node);\n }\n }\n function disconnect(node) {\n const components2 = getComponents(node);\n for (const name in components2) {\n callDisconnected(components2[name]);\n }\n }\n function getComponentName(attribute) {\n if (startsWith(attribute, \"data-\")) {\n attribute = attribute.slice(5);\n }\n const cmp = components$2[attribute];\n return cmp && (cmp.options || cmp).name;\n }\n\n globalApi(App);\n instanceApi(App);\n\n var Accordion = {\n mixins: [Class, Togglable],\n props: {\n animation: Boolean,\n targets: String,\n active: null,\n collapsible: Boolean,\n multiple: Boolean,\n toggle: String,\n content: String,\n offset: Number\n },\n data: {\n targets: \"> *\",\n active: false,\n animation: true,\n collapsible: true,\n multiple: false,\n clsOpen: \"uk-open\",\n toggle: \"> .uk-accordion-title\",\n content: \"> .uk-accordion-content\",\n offset: 0\n },\n computed: {\n items: ({ targets }, $el) => $$(targets, $el),\n toggles({ toggle }) {\n return this.items.map((item) => $(toggle, item));\n },\n contents({ content }) {\n return this.items.map((item) => {\n var _a;\n return ((_a = item._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, item);\n });\n }\n },\n watch: {\n items(items, prev) {\n if (prev || hasClass(items, this.clsOpen)) {\n return;\n }\n const active = this.active !== false && items[Number(this.active)] || !this.collapsible && items[0];\n if (active) {\n this.toggle(active, false);\n }\n },\n toggles() {\n this.$emit();\n },\n contents(items) {\n for (const el of items) {\n const isOpen = hasClass(\n this.items.find((item) => item.contains(el)),\n this.clsOpen\n );\n hide(el, !isOpen);\n }\n this.$emit();\n }\n },\n observe: lazyload(),\n events: [\n {\n name: \"click keydown\",\n delegate: ({ targets, $props }) => `${targets} ${$props.toggle}`,\n async handler(e) {\n var _a;\n if (e.type === \"keydown\" && e.keyCode !== keyMap.SPACE) {\n return;\n }\n e.preventDefault();\n (_a = this._off) == null ? void 0 : _a.call(this);\n this._off = keepScrollPosition(e.target);\n await this.toggle(index(this.toggles, e.current));\n this._off();\n }\n },\n {\n name: \"shown hidden\",\n self: true,\n delegate: ({ targets }) => targets,\n handler() {\n this.$emit();\n }\n }\n ],\n update() {\n const activeItems = filter$1(this.items, `.${this.clsOpen}`);\n for (const index2 in this.items) {\n const toggle = this.toggles[index2];\n const content = this.contents[index2];\n if (!toggle || !content) {\n continue;\n }\n toggle.id = generateId(this, toggle);\n content.id = generateId(this, content);\n const active = includes(activeItems, this.items[index2]);\n attr(toggle, {\n role: isTag(toggle, \"a\") ? \"button\" : null,\n \"aria-controls\": content.id,\n \"aria-expanded\": active,\n \"aria-disabled\": !this.collapsible && activeItems.length < 2 && active\n });\n attr(content, { role: \"region\", \"aria-labelledby\": toggle.id });\n if (isTag(content, \"ul\")) {\n attr(children(content), \"role\", \"presentation\");\n }\n }\n },\n methods: {\n toggle(item, animate) {\n item = this.items[getIndex(item, this.items)];\n let items = [item];\n const activeItems = filter$1(this.items, `.${this.clsOpen}`);\n if (!this.multiple && !includes(activeItems, items[0])) {\n items = items.concat(activeItems);\n }\n if (!this.collapsible && activeItems.length < 2 && includes(activeItems, item)) {\n return;\n }\n return Promise.all(\n items.map(\n (el) => this.toggleElement(el, !includes(activeItems, el), (el2, show) => {\n toggleClass(el2, this.clsOpen, show);\n if (animate === false || !this.animation) {\n hide($(this.content, el2), !show);\n return;\n }\n return transition(el2, show, this);\n })\n )\n );\n }\n }\n };\n function hide(el, hide2) {\n el && (el.hidden = hide2);\n }\n async function transition(el, show, { content, duration, velocity, transition: transition2 }) {\n var _a;\n content = ((_a = el._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, el);\n if (!el._wrapper) {\n el._wrapper = wrapAll(content, \"
    \");\n }\n const wrapper = el._wrapper;\n css(wrapper, \"overflow\", \"hidden\");\n const currentHeight = toFloat(css(wrapper, \"height\"));\n await Transition.cancel(wrapper);\n hide(content, false);\n const endHeight = sumBy([\"marginTop\", \"marginBottom\"], (prop) => css(content, prop)) + dimensions$1(content).height;\n const percent = currentHeight / endHeight;\n duration = (velocity * endHeight + duration) * (show ? 1 - percent : percent);\n css(wrapper, \"height\", currentHeight);\n await Transition.start(wrapper, { height: show ? endHeight : 0 }, duration, transition2);\n unwrap(content);\n delete el._wrapper;\n if (!show) {\n hide(content, true);\n }\n }\n function keepScrollPosition(el) {\n const scrollElement = scrollParent(el, true);\n let frame;\n (function scroll() {\n frame = requestAnimationFrame(() => {\n const { top } = dimensions$1(el);\n if (top < 0) {\n scrollElement.scrollTop += top;\n }\n scroll();\n });\n })();\n return () => requestAnimationFrame(() => cancelAnimationFrame(frame));\n }\n\n var alert = {\n mixins: [Class, Togglable],\n args: \"animation\",\n props: {\n animation: Boolean,\n close: String\n },\n data: {\n animation: true,\n selClose: \".uk-alert-close\",\n duration: 150\n },\n events: {\n name: \"click\",\n delegate: ({ selClose }) => selClose,\n handler(e) {\n e.preventDefault();\n this.close();\n }\n },\n methods: {\n async close() {\n await this.toggleElement(this.$el, false, animate);\n this.$destroy(true);\n }\n }\n };\n function animate(el, show, { duration, transition, velocity }) {\n const height = toFloat(css(el, \"height\"));\n css(el, \"height\", height);\n return Transition.start(\n el,\n {\n height: 0,\n marginTop: 0,\n marginBottom: 0,\n paddingTop: 0,\n paddingBottom: 0,\n borderTop: 0,\n borderBottom: 0,\n opacity: 0\n },\n velocity * height + duration,\n transition\n );\n }\n\n var Video = {\n args: \"autoplay\",\n props: {\n automute: Boolean,\n autoplay: Boolean\n },\n data: {\n automute: false,\n autoplay: true\n },\n beforeConnect() {\n if (this.autoplay === \"inview\" && !hasAttr(this.$el, \"preload\")) {\n this.$el.preload = \"none\";\n }\n if (isTag(this.$el, \"iframe\") && !hasAttr(this.$el, \"allow\")) {\n this.$el.allow = \"autoplay\";\n }\n if (this.autoplay === \"hover\") {\n if (isTag(this.$el, \"video\")) {\n this.$el.tabindex = 0;\n } else {\n this.autoplay = true;\n }\n }\n if (this.automute) {\n mute(this.$el);\n }\n },\n events: [\n {\n name: `${pointerEnter} focusin`,\n filter: ({ autoplay }) => includes(autoplay, \"hover\"),\n handler(e) {\n if (!isTouch(e) || !isPlaying(this.$el)) {\n play(this.$el);\n } else {\n pause(this.$el);\n }\n }\n },\n {\n name: `${pointerLeave} focusout`,\n filter: ({ autoplay }) => includes(autoplay, \"hover\"),\n handler(e) {\n if (!isTouch(e)) {\n pause(this.$el);\n }\n }\n }\n ],\n observe: [\n intersection({\n filter: ({ $el, autoplay }) => autoplay && autoplay !== \"hover\" && isVideo($el),\n handler([{ isIntersecting }]) {\n if (!document.fullscreenElement) {\n if (isIntersecting) {\n play(this.$el);\n } else {\n pause(this.$el);\n }\n }\n },\n args: { intersecting: false },\n options: ({ $el, autoplay }) => ({ root: autoplay === \"inview\" ? null : parent($el) })\n })\n ]\n };\n function isPlaying(videoEl) {\n return !videoEl.paused && !videoEl.ended;\n }\n\n var cover = {\n mixins: [Video],\n props: {\n width: Number,\n height: Number\n },\n data: {\n automute: true\n },\n created() {\n this.useObjectFit = isTag(this.$el, \"img\", \"video\");\n },\n observe: resize({\n target: ({ $el }) => getPositionedParent($el) || parent($el),\n filter: ({ useObjectFit }) => !useObjectFit\n }),\n update: {\n read() {\n if (this.useObjectFit) {\n return false;\n }\n const { ratio, cover } = Dimensions;\n const { $el, width, height } = this;\n let dim = { width, height };\n if (!width || !height) {\n const intrinsic = {\n width: $el.naturalWidth || $el.videoWidth || $el.clientWidth,\n height: $el.naturalHeight || $el.videoHeight || $el.clientHeight\n };\n if (width) {\n dim = ratio(intrinsic, \"width\", width);\n } else if (height) {\n dim = ratio(intrinsic, \"height\", height);\n } else {\n dim = intrinsic;\n }\n }\n const { offsetHeight: coverHeight, offsetWidth: coverWidth } = getPositionedParent($el) || parent($el);\n const coverDim = cover(dim, { width: coverWidth, height: coverHeight });\n if (!coverDim.width || !coverDim.height) {\n return false;\n }\n return coverDim;\n },\n write({ height, width }) {\n css(this.$el, { height, width });\n },\n events: [\"resize\"]\n }\n };\n function getPositionedParent(el) {\n while (el = parent(el)) {\n if (css(el, \"position\") !== \"static\") {\n return el;\n }\n }\n }\n\n let active;\n var drop = {\n mixins: [Container, Position, Togglable],\n args: \"pos\",\n props: {\n mode: \"list\",\n toggle: Boolean,\n boundary: Boolean,\n boundaryX: Boolean,\n boundaryY: Boolean,\n target: Boolean,\n targetX: Boolean,\n targetY: Boolean,\n stretch: Boolean,\n delayShow: Number,\n delayHide: Number,\n autoUpdate: Boolean,\n clsDrop: String,\n animateOut: Boolean,\n bgScroll: Boolean,\n closeOnScroll: Boolean\n },\n data: {\n mode: [\"click\", \"hover\"],\n toggle: \"- *\",\n boundary: false,\n boundaryX: false,\n boundaryY: false,\n target: false,\n targetX: false,\n targetY: false,\n stretch: false,\n delayShow: 0,\n delayHide: 800,\n autoUpdate: true,\n clsDrop: false,\n animateOut: false,\n bgScroll: true,\n animation: [\"uk-animation-fade\"],\n cls: \"uk-open\",\n container: false,\n closeOnScroll: false\n },\n computed: {\n boundary({ boundary, boundaryX, boundaryY }, $el) {\n return [\n query(boundaryX || boundary, $el) || window,\n query(boundaryY || boundary, $el) || window\n ];\n },\n target({ target, targetX, targetY }, $el) {\n targetX || (targetX = target || this.targetEl);\n targetY || (targetY = target || this.targetEl);\n return [\n targetX === true ? window : query(targetX, $el),\n targetY === true ? window : query(targetY, $el)\n ];\n }\n },\n created() {\n this.tracker = new MouseTracker();\n },\n beforeConnect() {\n this.clsDrop = this.$props.clsDrop || this.$options.id;\n },\n connected() {\n addClass(this.$el, \"uk-drop\", this.clsDrop);\n if (this.toggle && !this.targetEl) {\n this.targetEl = createToggleComponent(this);\n }\n this._style = pick(this.$el.style, [\"width\", \"height\"]);\n },\n disconnected() {\n if (this.isActive()) {\n this.hide(false);\n active = null;\n }\n css(this.$el, this._style);\n },\n events: [\n {\n name: \"click\",\n delegate: () => \".uk-drop-close\",\n handler(e) {\n e.preventDefault();\n this.hide(false);\n }\n },\n {\n name: \"click\",\n delegate: () => 'a[href*=\"#\"]',\n handler({ defaultPrevented, current }) {\n const { hash } = current;\n if (!defaultPrevented && hash && isSameSiteAnchor(current) && !this.$el.contains($(hash))) {\n this.hide(false);\n }\n }\n },\n {\n name: \"beforescroll\",\n handler() {\n this.hide(false);\n }\n },\n {\n name: \"toggle\",\n self: true,\n handler(e, toggle) {\n e.preventDefault();\n if (this.isToggled()) {\n this.hide(false);\n } else {\n this.show(toggle == null ? void 0 : toggle.$el, false);\n }\n }\n },\n {\n name: \"toggleshow\",\n self: true,\n handler(e, toggle) {\n e.preventDefault();\n this.show(toggle == null ? void 0 : toggle.$el);\n }\n },\n {\n name: \"togglehide\",\n self: true,\n handler(e) {\n e.preventDefault();\n if (!matches(this.$el, \":focus,:hover\")) {\n this.hide();\n }\n }\n },\n {\n name: `${pointerEnter} focusin`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (!isTouch(e)) {\n this.clearTimers();\n }\n }\n },\n {\n name: `${pointerLeave} focusout`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (!isTouch(e) && e.relatedTarget) {\n this.hide();\n }\n }\n },\n {\n name: \"toggled\",\n self: true,\n handler(e, toggled) {\n if (toggled) {\n this.clearTimers();\n this.position();\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n active = this;\n this.tracker.init();\n attr(this.targetEl, \"aria-expanded\", true);\n const handlers = [\n listenForResize(this),\n listenForEscClose(this),\n listenForBackgroundClose(this),\n this.autoUpdate && listenForScroll(this),\n this.closeOnScroll && listenForScrollClose(this)\n ];\n once(this.$el, \"hide\", () => handlers.forEach((handler) => handler && handler()), {\n self: true\n });\n if (!this.bgScroll) {\n once(this.$el, \"hidden\", preventBackgroundScroll(this.$el), { self: true });\n }\n }\n },\n {\n name: \"beforehide\",\n self: true,\n handler: \"clearTimers\"\n },\n {\n name: \"hide\",\n handler({ target }) {\n if (this.$el !== target) {\n active = active === null && this.$el.contains(target) && this.isToggled() ? this : active;\n return;\n }\n active = this.isActive() ? null : active;\n this.tracker.cancel();\n attr(this.targetEl, \"aria-expanded\", null);\n }\n }\n ],\n update: {\n write() {\n if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {\n this.position();\n }\n }\n },\n methods: {\n show(target = this.targetEl, delay = true) {\n if (this.isToggled() && target && this.targetEl && target !== this.targetEl) {\n this.hide(false, false);\n }\n this.targetEl = target;\n this.clearTimers();\n if (this.isActive()) {\n return;\n }\n if (active) {\n if (delay && active.isDelaying()) {\n this.showTimer = setTimeout(() => matches(target, \":hover\") && this.show(), 10);\n return;\n }\n let prev;\n while (active && prev !== active && !active.$el.contains(this.$el)) {\n prev = active;\n active.hide(false, false);\n }\n }\n if (this.container && parent(this.$el) !== this.container) {\n append(this.container, this.$el);\n }\n this.showTimer = setTimeout(\n () => this.toggleElement(this.$el, true),\n delay && this.delayShow || 0\n );\n },\n hide(delay = true, animate = true) {\n const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);\n this.clearTimers();\n this.isDelayedHide = delay;\n if (delay && this.isDelaying()) {\n this.hideTimer = setTimeout(this.hide, 50);\n } else if (delay && this.delayHide) {\n this.hideTimer = setTimeout(hide, this.delayHide);\n } else {\n hide();\n }\n },\n clearTimers() {\n clearTimeout(this.showTimer);\n clearTimeout(this.hideTimer);\n this.showTimer = null;\n this.hideTimer = null;\n },\n isActive() {\n return active === this;\n },\n isDelaying() {\n return [this.$el, ...$$(\".uk-drop\", this.$el)].some((el) => this.tracker.movesTo(el));\n },\n position() {\n removeClass(this.$el, \"uk-drop-stack\");\n css(this.$el, this._style);\n this.$el.hidden = true;\n const viewports = this.target.map((target) => getViewport$1(this.$el, target));\n const viewportOffset = this.getViewportOffset(this.$el);\n const dirs = [\n [0, [\"x\", \"width\", \"left\", \"right\"]],\n [1, [\"y\", \"height\", \"top\", \"bottom\"]]\n ];\n for (const [i, [axis, prop]] of dirs) {\n if (this.axis !== axis && includes([axis, true], this.stretch)) {\n css(this.$el, {\n [prop]: Math.min(\n offset(this.boundary[i])[prop],\n viewports[i][prop] - 2 * viewportOffset\n ),\n [`overflow-${axis}`]: \"auto\"\n });\n }\n }\n const maxWidth = viewports[0].width - 2 * viewportOffset;\n this.$el.hidden = false;\n css(this.$el, \"maxWidth\", \"\");\n if (this.$el.offsetWidth > maxWidth) {\n addClass(this.$el, \"uk-drop-stack\");\n }\n css(this.$el, \"maxWidth\", maxWidth);\n this.positionAt(this.$el, this.target, this.boundary);\n for (const [i, [axis, prop, start, end]] of dirs) {\n if (this.axis === axis && includes([axis, true], this.stretch)) {\n const positionOffset = Math.abs(this.getPositionOffset());\n const targetOffset = offset(this.target[i]);\n const elOffset = offset(this.$el);\n css(this.$el, {\n [prop]: (targetOffset[start] > elOffset[start] ? targetOffset[this.inset ? end : start] - Math.max(\n offset(this.boundary[i])[start],\n viewports[i][start] + viewportOffset\n ) : Math.min(\n offset(this.boundary[i])[end],\n viewports[i][end] - viewportOffset\n ) - targetOffset[this.inset ? start : end]) - positionOffset,\n [`overflow-${axis}`]: \"auto\"\n });\n this.positionAt(this.$el, this.target, this.boundary);\n }\n }\n }\n }\n };\n function getViewport$1(el, target) {\n return offsetViewport(overflowParents(target).find((parent2) => parent2.contains(el)));\n }\n function createToggleComponent(drop) {\n const { $el } = drop.$create(\"toggle\", query(drop.toggle, drop.$el), {\n target: drop.$el,\n mode: drop.mode\n });\n attr($el, \"aria-haspopup\", true);\n return $el;\n }\n function listenForResize(drop) {\n const update = () => drop.$emit();\n const off = [\n observeViewportResize(update),\n observeResize(overflowParents(drop.$el).concat(drop.target), update)\n ];\n return () => off.map((observer) => observer.disconnect());\n }\n function listenForScroll(drop, fn = () => drop.$emit()) {\n return on([document, ...overflowParents(drop.$el)], \"scroll\", fn, {\n passive: true\n });\n }\n function listenForEscClose(drop) {\n return on(document, \"keydown\", (e) => {\n if (e.keyCode === keyMap.ESC) {\n drop.hide(false);\n }\n });\n }\n function listenForScrollClose(drop) {\n return listenForScroll(drop, () => drop.hide(false));\n }\n function listenForBackgroundClose(drop) {\n return on(document, pointerDown$1, ({ target }) => {\n if (drop.$el.contains(target)) {\n return;\n }\n once(\n document,\n `${pointerUp$1} ${pointerCancel} scroll`,\n ({ defaultPrevented, type, target: newTarget }) => {\n var _a;\n if (!defaultPrevented && type === pointerUp$1 && target === newTarget && !((_a = drop.targetEl) == null ? void 0 : _a.contains(target))) {\n drop.hide(false);\n }\n },\n true\n );\n });\n }\n\n var Dropnav = {\n mixins: [Class, Container],\n props: {\n align: String,\n clsDrop: String,\n boundary: Boolean,\n dropbar: Boolean,\n dropbarAnchor: Boolean,\n duration: Number,\n mode: Boolean,\n offset: Boolean,\n stretch: Boolean,\n delayShow: Boolean,\n delayHide: Boolean,\n target: Boolean,\n targetX: Boolean,\n targetY: Boolean,\n animation: Boolean,\n animateOut: Boolean,\n closeOnScroll: Boolean\n },\n data: {\n align: isRtl ? \"right\" : \"left\",\n clsDrop: \"uk-dropdown\",\n clsDropbar: \"uk-dropnav-dropbar\",\n boundary: true,\n dropbar: false,\n dropbarAnchor: false,\n duration: 200,\n container: false,\n selNavItem: \"> li > a, > ul > li > a\"\n },\n computed: {\n dropbarAnchor: ({ dropbarAnchor }, $el) => query(dropbarAnchor, $el) || $el,\n dropbar({ dropbar }) {\n if (!dropbar) {\n return null;\n }\n dropbar = this._dropbar || query(dropbar, this.$el) || $(`+ .${this.clsDropbar}`, this.$el);\n return dropbar ? dropbar : this._dropbar = $(\"
    \");\n },\n dropContainer(_, $el) {\n return this.container || $el;\n },\n dropdowns({ clsDrop }, $el) {\n var _a;\n const dropdowns = $$(`.${clsDrop}`, $el);\n if (this.dropContainer !== $el) {\n for (const el of $$(`.${clsDrop}`, this.dropContainer)) {\n const target = (_a = this.getDropdown(el)) == null ? void 0 : _a.targetEl;\n if (!includes(dropdowns, el) && target && this.$el.contains(target)) {\n dropdowns.push(el);\n }\n }\n }\n return dropdowns;\n },\n items({ selNavItem }, $el) {\n return $$(selNavItem, $el);\n }\n },\n watch: {\n dropbar(dropbar) {\n addClass(\n dropbar,\n \"uk-dropbar\",\n \"uk-dropbar-top\",\n this.clsDropbar,\n `uk-${this.$options.name}-dropbar`\n );\n },\n dropdowns() {\n this.initializeDropdowns();\n }\n },\n connected() {\n this.initializeDropdowns();\n },\n disconnected() {\n remove$1(this._dropbar);\n delete this._dropbar;\n },\n events: [\n {\n name: \"mouseover focusin\",\n delegate: ({ selNavItem }) => selNavItem,\n handler({ current }) {\n const active2 = this.getActive();\n if (active2 && includes(active2.mode, \"hover\") && active2.targetEl && !current.contains(active2.targetEl) && !active2.isDelaying()) {\n active2.hide(false);\n }\n }\n },\n {\n name: \"keydown\",\n self: true,\n delegate: ({ selNavItem }) => selNavItem,\n handler(e) {\n var _a;\n const { current, keyCode } = e;\n const active2 = this.getActive();\n if (keyCode === keyMap.DOWN && (active2 == null ? void 0 : active2.targetEl) === current) {\n e.preventDefault();\n (_a = $(selFocusable, active2.$el)) == null ? void 0 : _a.focus();\n }\n handleNavItemNavigation(e, this.items, active2);\n }\n },\n {\n name: \"keydown\",\n el: ({ dropContainer }) => dropContainer,\n delegate: ({ clsDrop }) => `.${clsDrop}`,\n handler(e) {\n var _a;\n const { current, keyCode, target } = e;\n if (isInput(target) || !includes(this.dropdowns, current)) {\n return;\n }\n const active2 = this.getActive();\n let next = -1;\n if (keyCode === keyMap.HOME) {\n next = 0;\n } else if (keyCode === keyMap.END) {\n next = \"last\";\n } else if (keyCode === keyMap.UP) {\n next = \"previous\";\n } else if (keyCode === keyMap.DOWN) {\n next = \"next\";\n } else if (keyCode === keyMap.ESC) {\n (_a = active2.targetEl) == null ? void 0 : _a.focus();\n }\n if (~next) {\n e.preventDefault();\n const elements = $$(selFocusable, current);\n elements[getIndex(\n next,\n elements,\n findIndex(elements, (el) => matches(el, \":focus\"))\n )].focus();\n }\n handleNavItemNavigation(e, this.items, active2);\n }\n },\n {\n name: \"mouseleave\",\n el: ({ dropbar }) => dropbar,\n filter: ({ dropbar }) => dropbar,\n handler() {\n const active2 = this.getActive();\n if (active2 && includes(active2.mode, \"hover\") && !this.dropdowns.some((el) => matches(el, \":hover\"))) {\n active2.hide();\n }\n }\n },\n {\n name: \"beforeshow\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n if (!this.isDropbarDrop(target)) {\n return;\n }\n if (this.dropbar.previousElementSibling !== this.dropbarAnchor) {\n after(this.dropbarAnchor, this.dropbar);\n }\n addClass(target, `${this.clsDrop}-dropbar`);\n }\n },\n {\n name: \"show\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n if (!this.isDropbarDrop(target)) {\n return;\n }\n const drop = this.getDropdown(target);\n const adjustHeight = () => {\n const maxBottom = Math.max(\n ...parents(target, `.${this.clsDrop}`).concat(target).map((el) => offset(el).bottom)\n );\n offset(this.dropbar, {\n left: offset(this.dropbar).left,\n top: this.getDropbarOffset(drop.getPositionOffset())\n });\n this.transitionTo(\n maxBottom - offset(this.dropbar).top + toFloat(css(target, \"marginBottom\")),\n target\n );\n };\n this._observer = observeResize([drop.$el, ...drop.target], adjustHeight);\n adjustHeight();\n }\n },\n {\n name: \"beforehide\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler(e) {\n const active2 = this.getActive();\n if (matches(this.dropbar, \":hover\") && active2.$el === e.target && this.isDropbarDrop(active2.$el) && includes(active2.mode, \"hover\") && active2.isDelayedHide && !this.items.some((el) => active2.targetEl !== el && matches(el, \":focus\"))) {\n e.preventDefault();\n }\n }\n },\n {\n name: \"hide\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n var _a;\n if (!this.isDropbarDrop(target)) {\n return;\n }\n (_a = this._observer) == null ? void 0 : _a.disconnect();\n const active2 = this.getActive();\n if (!active2 || active2.$el === target) {\n this.transitionTo(0);\n }\n }\n }\n ],\n methods: {\n getActive() {\n var _a;\n return includes(this.dropdowns, (_a = active) == null ? void 0 : _a.$el) && active;\n },\n async transitionTo(newHeight, el) {\n const { dropbar } = this;\n const oldHeight = height(dropbar);\n el = oldHeight < newHeight && el;\n await Transition.cancel([el, dropbar]);\n if (el) {\n const diff = offset(el).top - offset(dropbar).top - oldHeight;\n if (diff > 0) {\n css(el, \"transitionDelay\", `${diff / newHeight * this.duration}ms`);\n }\n }\n css(el, \"clipPath\", `polygon(0 0,100% 0,100% ${oldHeight}px,0 ${oldHeight}px)`);\n height(dropbar, oldHeight);\n await Promise.all([\n Transition.start(dropbar, { height: newHeight }, this.duration),\n Transition.start(\n el,\n { clipPath: `polygon(0 0,100% 0,100% ${newHeight}px,0 ${newHeight}px)` },\n this.duration\n ).finally(() => css(el, { clipPath: \"\", transitionDelay: \"\" }))\n ]).catch(noop);\n },\n getDropdown(el) {\n return this.$getComponent(el, \"drop\") || this.$getComponent(el, \"dropdown\");\n },\n isDropbarDrop(el) {\n return includes(this.dropdowns, el) && hasClass(el, this.clsDrop);\n },\n getDropbarOffset(offsetTop) {\n const { $el, target, targetY } = this;\n const { top, height: height2 } = offset(query(targetY || target || $el, $el));\n return top + height2 + offsetTop;\n },\n initializeDropdowns() {\n this.$create(\n \"drop\",\n this.dropdowns.filter((el) => !this.getDropdown(el)),\n {\n ...this.$props,\n flip: false,\n shift: true,\n pos: `bottom-${this.align}`,\n boundary: this.boundary === true ? this.$el : this.boundary\n }\n );\n }\n }\n };\n function handleNavItemNavigation(e, toggles, active2) {\n var _a, _b, _c;\n const { current, keyCode } = e;\n let next = -1;\n if (keyCode === keyMap.HOME) {\n next = 0;\n } else if (keyCode === keyMap.END) {\n next = \"last\";\n } else if (keyCode === keyMap.LEFT) {\n next = \"previous\";\n } else if (keyCode === keyMap.RIGHT) {\n next = \"next\";\n } else if (keyCode === keyMap.TAB) {\n (_a = active2.targetEl) == null ? void 0 : _a.focus();\n (_b = active2.hide) == null ? void 0 : _b.call(active2, false);\n }\n if (~next) {\n e.preventDefault();\n (_c = active2.hide) == null ? void 0 : _c.call(active2, false);\n toggles[getIndex(next, toggles, toggles.indexOf(active2.targetEl || current))].focus();\n }\n }\n\n var formCustom = {\n mixins: [Class],\n args: \"target\",\n props: {\n target: Boolean\n },\n data: {\n target: false\n },\n computed: {\n input: (_, $el) => $(selInput, $el),\n state() {\n return this.input.nextElementSibling;\n },\n target({ target }, $el) {\n return target && (target === true && parent(this.input) === $el && this.input.nextElementSibling || $(target, $el));\n }\n },\n update() {\n var _a;\n const { target, input } = this;\n if (!target) {\n return;\n }\n let option;\n const prop = isInput(target) ? \"value\" : \"textContent\";\n const prev = target[prop];\n const value = ((_a = input.files) == null ? void 0 : _a[0]) ? input.files[0].name : matches(input, \"select\") && (option = $$(\"option\", input).filter((el) => el.selected)[0]) ? option.textContent : input.value;\n if (prev !== value) {\n target[prop] = value;\n }\n },\n events: [\n {\n name: \"change\",\n handler() {\n this.$emit();\n }\n },\n {\n name: \"reset\",\n el: ({ $el }) => $el.closest(\"form\"),\n handler() {\n this.$emit();\n }\n }\n ]\n };\n\n var grid = {\n extends: Margin,\n mixins: [Class],\n name: \"grid\",\n props: {\n masonry: Boolean,\n parallax: String,\n parallaxStart: String,\n parallaxEnd: String,\n parallaxJustify: Boolean\n },\n data: {\n margin: \"uk-grid-margin\",\n clsStack: \"uk-grid-stack\",\n masonry: false,\n parallax: 0,\n parallaxStart: 0,\n parallaxEnd: 0,\n parallaxJustify: false\n },\n connected() {\n this.masonry && addClass(this.$el, \"uk-flex-top\", \"uk-flex-wrap-top\");\n },\n observe: scroll$1({ filter: ({ parallax, parallaxJustify }) => parallax || parallaxJustify }),\n update: [\n {\n write({ rows }) {\n toggleClass(this.$el, this.clsStack, !rows.some((row) => row.length > 1));\n },\n events: [\"resize\"]\n },\n {\n read(data) {\n const { rows } = data;\n let { masonry, parallax, parallaxJustify, margin } = this;\n parallax = Math.max(0, toPx(parallax));\n if (!(masonry || parallax || parallaxJustify) || positionedAbsolute(rows) || rows[0].some(\n (el, i) => rows.some((row) => row[i] && row[i].offsetWidth !== el.offsetWidth)\n )) {\n return data.translates = data.scrollColumns = false;\n }\n let gutter = getGutter(rows, margin);\n let columns;\n let translates;\n if (masonry) {\n [columns, translates] = applyMasonry(rows, gutter, masonry === \"next\");\n } else {\n columns = transpose(rows);\n }\n const columnHeights = columns.map(\n (column) => sumBy(column, \"offsetHeight\") + gutter * (column.length - 1)\n );\n const height = Math.max(0, ...columnHeights);\n let scrollColumns;\n let parallaxStart;\n let parallaxEnd;\n if (parallax || parallaxJustify) {\n scrollColumns = columnHeights.map(\n (hgt, i) => parallaxJustify ? height - hgt + parallax : parallax / (i % 2 || 8)\n );\n if (!parallaxJustify) {\n parallax = Math.max(\n ...columnHeights.map((hgt, i) => hgt + scrollColumns[i] - height)\n );\n }\n parallaxStart = toPx(this.parallaxStart, \"height\", this.$el, true);\n parallaxEnd = toPx(this.parallaxEnd, \"height\", this.$el, true);\n }\n return {\n columns,\n translates,\n scrollColumns,\n parallaxStart,\n parallaxEnd,\n padding: parallax,\n height: translates ? height : \"\"\n };\n },\n write({ height, padding }) {\n css(this.$el, \"paddingBottom\", padding || \"\");\n height !== false && css(this.$el, \"height\", height);\n },\n events: [\"resize\"]\n },\n {\n read({ rows, scrollColumns, parallaxStart, parallaxEnd }) {\n return {\n scrolled: scrollColumns && !positionedAbsolute(rows) ? scrolledOver(this.$el, parallaxStart, parallaxEnd) : false\n };\n },\n write({ columns, scrolled, scrollColumns, translates }) {\n if (!scrolled && !translates) {\n return;\n }\n columns.forEach(\n (column, i) => column.forEach((el, j) => {\n let [x, y] = translates && translates[i][j] || [0, 0];\n if (scrolled) {\n y += scrolled * scrollColumns[i];\n }\n css(el, \"transform\", `translate(${x}px, ${y}px)`);\n })\n );\n },\n events: [\"scroll\", \"resize\"]\n }\n ]\n };\n function positionedAbsolute(rows) {\n return rows.flat().some((el) => css(el, \"position\") === \"absolute\");\n }\n function applyMasonry(rows, gutter, next) {\n const columns = [];\n const translates = [];\n const columnHeights = Array(rows[0].length).fill(0);\n let rowHeights = 0;\n for (let row of rows) {\n if (isRtl) {\n row = row.reverse();\n }\n let height = 0;\n for (const j in row) {\n const { offsetWidth, offsetHeight } = row[j];\n const index = next ? j : columnHeights.indexOf(Math.min(...columnHeights));\n push(columns, index, row[j]);\n push(translates, index, [\n (index - j) * offsetWidth * (isRtl ? -1 : 1),\n columnHeights[index] - rowHeights\n ]);\n columnHeights[index] += offsetHeight + gutter;\n height = Math.max(height, offsetHeight);\n }\n rowHeights += height + gutter;\n }\n return [columns, translates];\n }\n function getGutter(rows, cls) {\n const node = rows.flat().find((el) => hasClass(el, cls));\n return toFloat(node ? css(node, \"marginTop\") : css(rows[0][0], \"paddingLeft\"));\n }\n function transpose(rows) {\n const columns = [];\n for (const row of rows) {\n for (const i in row) {\n push(columns, i, row[i]);\n }\n }\n return columns;\n }\n function push(array, index, value) {\n if (!array[index]) {\n array[index] = [];\n }\n array[index].push(value);\n }\n\n var heightMatch = {\n args: \"target\",\n props: {\n target: String,\n row: Boolean\n },\n data: {\n target: \"> *\",\n row: true\n },\n computed: {\n elements: ({ target }, $el) => $$(target, $el)\n },\n observe: resize({\n target: ({ $el, elements }) => elements.reduce((elements2, el) => elements2.concat(el, ...el.children), [$el])\n }),\n events: {\n // Hidden elements may change height when fonts load\n name: \"loadingdone\",\n el: () => document.fonts,\n handler() {\n this.$emit(\"resize\");\n }\n },\n update: {\n read() {\n return {\n rows: (this.row ? getRows(this.elements) : [this.elements]).map(match)\n };\n },\n write({ rows }) {\n for (const { heights, elements } of rows) {\n elements.forEach((el, i) => css(el, \"minHeight\", heights[i]));\n }\n },\n events: [\"resize\"]\n }\n };\n function match(elements) {\n if (elements.length < 2) {\n return { heights: [\"\"], elements };\n }\n let heights = elements.map(getHeight);\n const max = Math.max(...heights);\n return {\n heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? \"\" : max),\n elements\n };\n }\n function getHeight(element) {\n const style = pick(element.style, [\"display\", \"minHeight\"]);\n if (!isVisible(element)) {\n css(element, \"display\", \"block\", \"important\");\n }\n css(element, \"minHeight\", \"\");\n const height = dimensions$1(element).height - boxModelAdjust(element, \"height\", \"content-box\");\n css(element, style);\n return height;\n }\n\n var heightPlaceholder = {\n args: \"target\",\n props: {\n target: String\n },\n data: {\n target: \"\"\n },\n computed: {\n target: {\n get: ({ target }, $el) => query(target, $el),\n observe: ({ target }) => target\n }\n },\n observe: resize({ target: ({ target }) => target }),\n update: {\n read() {\n return this.target ? { height: this.target.offsetHeight } : false;\n },\n write({ height }) {\n css(this.$el, { minHeight: height });\n },\n events: [\"resize\"]\n }\n };\n\n var heightViewport = {\n props: {\n expand: Boolean,\n offsetTop: Boolean,\n offsetBottom: Boolean,\n minHeight: Number\n },\n data: {\n expand: false,\n offsetTop: false,\n offsetBottom: false,\n minHeight: 0\n },\n // check for offsetTop change\n observe: [\n viewport({ filter: ({ expand }) => expand }),\n resize({ target: ({ $el }) => scrollParents($el) })\n ],\n update: {\n read() {\n if (!isVisible(this.$el)) {\n return false;\n }\n let minHeight = \"\";\n const box = boxModelAdjust(this.$el, \"height\", \"content-box\");\n const { body, scrollingElement } = document;\n const scrollElement = scrollParent(this.$el);\n const { height: viewportHeight } = offsetViewport(\n scrollElement === body ? scrollingElement : scrollElement\n );\n const isScrollingElement = scrollingElement === scrollElement || body === scrollElement;\n minHeight = `calc(${isScrollingElement ? \"100vh\" : `${viewportHeight}px`}`;\n if (this.expand) {\n const diff = dimensions$1(scrollElement).height - dimensions$1(this.$el).height;\n minHeight += ` - ${diff}px`;\n } else {\n if (this.offsetTop) {\n if (isScrollingElement) {\n const offsetTopEl = this.offsetTop === true ? this.$el : query(this.offsetTop, this.$el);\n const { top } = offset(offsetTopEl);\n minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : \"\";\n } else {\n minHeight += ` - ${boxModelAdjust(scrollElement, \"height\", css(scrollElement, \"boxSizing\"))}px`;\n }\n }\n if (this.offsetBottom === true) {\n minHeight += ` - ${dimensions$1(this.$el.nextElementSibling).height}px`;\n } else if (isNumeric(this.offsetBottom)) {\n minHeight += ` - ${this.offsetBottom}vh`;\n } else if (this.offsetBottom && endsWith(this.offsetBottom, \"px\")) {\n minHeight += ` - ${toFloat(this.offsetBottom)}px`;\n } else if (isString(this.offsetBottom)) {\n minHeight += ` - ${dimensions$1(query(this.offsetBottom, this.$el)).height}px`;\n }\n }\n minHeight += `${box ? ` - ${box}px` : \"\"})`;\n return { minHeight };\n },\n write({ minHeight }) {\n css(this.$el, \"minHeight\", `max(${this.minHeight || 0}px, ${minHeight})`);\n },\n events: [\"resize\"]\n }\n };\n\n var closeIcon = \"\";\n\n var closeLarge = \"\";\n\n var dropParentIcon = \"\";\n\n var marker = \"\";\n\n var navParentIconLarge = \"\";\n\n var navParentIcon = \"\";\n\n var navbarParentIcon = \"\";\n\n var navbarToggleIcon = \"\";\n\n var overlayIcon = \"\";\n\n var paginationNext = \"\";\n\n var paginationPrevious = \"\";\n\n var searchIcon = \"\";\n\n var searchLarge = \"\";\n\n var searchMedium = \"\";\n\n var slidenavNextLarge = \"\";\n\n var slidenavNext = \"\";\n\n var slidenavPreviousLarge = \"\";\n\n var slidenavPrevious = \"\";\n\n var spinner = \"\";\n\n var totop = \"\";\n\n var Svg = {\n args: \"src\",\n props: {\n width: Number,\n height: Number,\n ratio: Number\n },\n data: {\n ratio: 1\n },\n connected() {\n this.svg = this.getSvg().then((el) => {\n if (!this._connected) {\n return;\n }\n const svg = insertSVG(el, this.$el);\n if (this.svgEl && svg !== this.svgEl) {\n remove$1(this.svgEl);\n }\n applyWidthAndHeight.call(this, svg, el);\n return this.svgEl = svg;\n }, noop);\n },\n disconnected() {\n this.svg.then((svg) => {\n if (this._connected) {\n return;\n }\n if (isVoidElement(this.$el)) {\n this.$el.hidden = false;\n }\n remove$1(svg);\n this.svgEl = null;\n });\n this.svg = null;\n },\n methods: {\n async getSvg() {\n }\n }\n };\n function insertSVG(el, root) {\n if (isVoidElement(root) || isTag(root, \"canvas\")) {\n root.hidden = true;\n const next = root.nextElementSibling;\n return equals(el, next) ? next : after(root, el);\n }\n const last = root.lastElementChild;\n return equals(el, last) ? last : append(root, el);\n }\n function equals(el, other) {\n return isTag(el, \"svg\") && isTag(other, \"svg\") && el.innerHTML === other.innerHTML;\n }\n function applyWidthAndHeight(el, ref) {\n const props = [\"width\", \"height\"];\n let dimensions = props.map((prop) => this[prop]);\n if (!dimensions.some((val) => val)) {\n dimensions = props.map((prop) => attr(ref, prop));\n }\n const viewBox = attr(ref, \"viewBox\");\n if (viewBox && !dimensions.some((val) => val)) {\n dimensions = viewBox.split(\" \").slice(2);\n }\n dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));\n }\n\n var svg = {\n mixins: [Svg],\n args: \"src\",\n props: {\n src: String,\n icon: String,\n attributes: \"list\",\n strokeAnimation: Boolean\n },\n data: {\n strokeAnimation: false\n },\n observe: [\n mutation({\n async handler() {\n const svg = await this.svg;\n if (svg) {\n applyAttributes.call(this, svg);\n }\n },\n options: {\n attributes: true,\n attributeFilter: [\"id\", \"class\", \"style\"]\n }\n })\n ],\n async connected() {\n if (includes(this.src, \"#\")) {\n [this.src, this.icon] = this.src.split(\"#\");\n }\n const svg = await this.svg;\n if (svg) {\n applyAttributes.call(this, svg);\n if (this.strokeAnimation) {\n applyAnimation(svg);\n }\n }\n },\n methods: {\n async getSvg() {\n if (isTag(this.$el, \"img\") && !this.$el.complete && this.$el.loading === \"lazy\") {\n await new Promise((resolve) => once(this.$el, \"load\", resolve));\n }\n return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject(\"SVG not found.\");\n }\n }\n };\n function applyAttributes(el) {\n const { $el } = this;\n addClass(el, attr($el, \"class\"), \"uk-svg\");\n for (let i = 0; i < $el.style.length; i++) {\n const prop = $el.style[i];\n css(el, prop, css($el, prop));\n }\n for (const attribute in this.attributes) {\n const [prop, value] = this.attributes[attribute].split(\":\", 2);\n attr(el, prop, value);\n }\n if (!this.$el.id) {\n removeAttr(el, \"id\");\n }\n }\n const loadSVG = memoize(async (src) => {\n if (src) {\n if (startsWith(src, \"data:\")) {\n return decodeURIComponent(src.split(\",\")[1]);\n } else {\n return (await fetch(src)).text();\n }\n } else {\n return Promise.reject();\n }\n });\n function parseSVG(svg, icon) {\n if (icon && includes(svg, \"/g;\n const parseSymbols = memoize(function(svg) {\n const symbols = {};\n symbolRe.lastIndex = 0;\n let match;\n while (match = symbolRe.exec(svg)) {\n symbols[match[3]] = ``;\n }\n return symbols;\n });\n function applyAnimation(el) {\n const length = getMaxPathLength(el);\n if (length) {\n css(el, \"--uk-animation-stroke\", length);\n }\n }\n function stringToSvg(string) {\n const container = document.createElement(\"template\");\n container.innerHTML = string;\n return container.content.firstElementChild;\n }\n\n const icons = {\n spinner,\n totop,\n marker,\n \"close-icon\": closeIcon,\n \"close-large\": closeLarge,\n \"drop-parent-icon\": dropParentIcon,\n \"nav-parent-icon\": navParentIcon,\n \"nav-parent-icon-large\": navParentIconLarge,\n \"navbar-parent-icon\": navbarParentIcon,\n \"navbar-toggle-icon\": navbarToggleIcon,\n \"overlay-icon\": overlayIcon,\n \"pagination-next\": paginationNext,\n \"pagination-previous\": paginationPrevious,\n \"search-icon\": searchIcon,\n \"search-medium\": searchMedium,\n \"search-large\": searchLarge,\n \"search-toggle-icon\": searchIcon,\n \"slidenav-next\": slidenavNext,\n \"slidenav-next-large\": slidenavNextLarge,\n \"slidenav-previous\": slidenavPrevious,\n \"slidenav-previous-large\": slidenavPreviousLarge\n };\n const Icon = {\n install: install$1,\n mixins: [Svg],\n args: \"icon\",\n props: { icon: String },\n isIcon: true,\n beforeConnect() {\n addClass(this.$el, \"uk-icon\");\n },\n methods: {\n async getSvg() {\n const icon = getIcon(this.icon);\n if (!icon) {\n throw \"Icon not found.\";\n }\n return icon;\n }\n }\n };\n const IconComponent = {\n args: false,\n extends: Icon,\n data: (vm) => ({\n icon: hyphenate(vm.constructor.options.name)\n }),\n beforeConnect() {\n addClass(this.$el, this.$options.id);\n }\n };\n const NavParentIcon = {\n extends: IconComponent,\n beforeConnect() {\n const icon = this.$props.icon;\n this.icon = this.$el.closest(\".uk-nav-primary\") ? `${icon}-large` : icon;\n }\n };\n const Search = {\n extends: IconComponent,\n mixins: [I18n],\n i18n: { toggle: \"Open Search\", submit: \"Submit Search\" },\n beforeConnect() {\n const isToggle = hasClass(this.$el, \"uk-search-toggle\") || hasClass(this.$el, \"uk-navbar-toggle\");\n this.icon = isToggle ? \"search-toggle-icon\" : hasClass(this.$el, \"uk-search-icon\") && this.$el.closest(\".uk-search-large\") ? \"search-large\" : this.$el.closest(\".uk-search-medium\") ? \"search-medium\" : this.$props.icon;\n if (hasAttr(this.$el, \"aria-label\")) {\n return;\n }\n if (isToggle) {\n const label = this.t(\"toggle\");\n attr(this.$el, \"aria-label\", label);\n } else {\n const button = this.$el.closest(\"a,button\");\n if (button) {\n const label = this.t(\"submit\");\n attr(button, \"aria-label\", label);\n }\n }\n }\n };\n const Spinner = {\n extends: IconComponent,\n beforeConnect() {\n attr(this.$el, \"role\", \"status\");\n },\n methods: {\n async getSvg() {\n const icon = await Icon.methods.getSvg.call(this);\n if (this.ratio !== 1) {\n css($(\"circle\", icon), \"strokeWidth\", 1 / this.ratio);\n }\n return icon;\n }\n }\n };\n const ButtonComponent = {\n extends: IconComponent,\n mixins: [I18n],\n beforeConnect() {\n const button = this.$el.closest(\"a,button\");\n attr(button, \"role\", this.role !== null && isTag(button, \"a\") ? \"button\" : this.role);\n const label = this.t(\"label\");\n if (label && !hasAttr(button, \"aria-label\")) {\n attr(button, \"aria-label\", label);\n }\n }\n };\n const Slidenav = {\n extends: ButtonComponent,\n beforeConnect() {\n addClass(this.$el, \"uk-slidenav\");\n const icon = this.$props.icon;\n this.icon = hasClass(this.$el, \"uk-slidenav-large\") ? `${icon}-large` : icon;\n }\n };\n const NavbarToggleIcon = {\n extends: ButtonComponent,\n i18n: { label: \"Open menu\" }\n };\n const Close = {\n extends: ButtonComponent,\n i18n: { label: \"Close\" },\n beforeConnect() {\n this.icon = `close-${hasClass(this.$el, \"uk-close-large\") ? \"large\" : \"icon\"}`;\n }\n };\n const Marker = {\n extends: ButtonComponent,\n i18n: { label: \"Open\" }\n };\n const Totop = {\n extends: ButtonComponent,\n i18n: { label: \"Back to top\" }\n };\n const PaginationNext = {\n extends: ButtonComponent,\n i18n: { label: \"Next page\" },\n data: { role: null }\n };\n const PaginationPrevious = {\n extends: ButtonComponent,\n i18n: { label: \"Previous page\" },\n data: { role: null }\n };\n const parsed = {};\n function install$1(UIkit) {\n UIkit.icon.add = (name, svg) => {\n const added = isString(name) ? { [name]: svg } : name;\n each(added, (svg2, name2) => {\n icons[name2] = svg2;\n delete parsed[name2];\n });\n if (UIkit._initialized) {\n apply(\n document.body,\n (el) => each(UIkit.getComponents(el), (cmp) => {\n cmp.$options.isIcon && cmp.icon in added && cmp.$reset();\n })\n );\n }\n };\n }\n const aliases = { twitter: \"x\" };\n function getIcon(icon) {\n icon = aliases[icon] || icon;\n if (!icons[icon]) {\n return null;\n }\n if (!parsed[icon]) {\n parsed[icon] = stringToSvg(icons[applyRtl(icon)] || icons[icon]);\n }\n return parsed[icon].cloneNode(true);\n }\n function applyRtl(icon) {\n return isRtl ? swap(swap(icon, \"left\", \"right\"), \"previous\", \"next\") : icon;\n }\n\n var img = {\n args: \"dataSrc\",\n props: {\n dataSrc: String,\n sources: String,\n margin: String,\n target: String,\n loading: String\n },\n data: {\n dataSrc: \"\",\n sources: false,\n margin: \"50%\",\n target: false,\n loading: \"lazy\"\n },\n connected() {\n if (this.loading !== \"lazy\") {\n this.load();\n } else if (isImg(this.$el)) {\n this.$el.loading = \"lazy\";\n setSrcAttrs(this.$el);\n }\n },\n disconnected() {\n if (this.img) {\n this.img.onload = \"\";\n }\n delete this.img;\n },\n observe: intersection({\n handler(entries, observer) {\n this.load();\n observer.disconnect();\n },\n options: ({ margin }) => ({ rootMargin: margin }),\n filter: ({ loading }) => loading === \"lazy\",\n target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el\n }),\n methods: {\n load() {\n if (this.img) {\n return this.img;\n }\n const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);\n removeAttr(image, \"loading\");\n setSrcAttrs(this.$el, image.currentSrc);\n return this.img = image;\n }\n }\n };\n function setSrcAttrs(el, src) {\n if (isImg(el)) {\n const parentNode = parent(el);\n const elements = isTag(parentNode, \"picture\") ? children(parentNode) : [el];\n elements.forEach((el2) => setSourceProps(el2, el2));\n } else if (src) {\n const change = !includes(el.style.backgroundImage, src);\n if (change) {\n css(el, \"backgroundImage\", `url(${escape(src)})`);\n trigger(el, createEvent(\"load\", false));\n }\n }\n }\n const srcProps = [\"data-src\", \"data-srcset\", \"sizes\"];\n function setSourceProps(sourceEl, targetEl) {\n for (const prop of srcProps) {\n const value = data(sourceEl, prop);\n if (value) {\n attr(targetEl, prop.replace(/^(data-)+/, \"\"), value);\n }\n }\n }\n function getImageFromElement(el, src, sources) {\n const img = new Image();\n wrapInPicture(img, sources);\n setSourceProps(el, img);\n img.onload = () => {\n setSrcAttrs(el, img.currentSrc);\n };\n attr(img, \"src\", src);\n return img;\n }\n function wrapInPicture(img, sources) {\n sources = parseSources(sources);\n if (sources.length) {\n const picture = fragment(\"\");\n for (const attrs of sources) {\n const source = fragment(\"\");\n attr(source, attrs);\n append(picture, source);\n }\n append(picture, img);\n }\n }\n function parseSources(sources) {\n if (!sources) {\n return [];\n }\n if (startsWith(sources, \"[\")) {\n try {\n sources = JSON.parse(sources);\n } catch (e) {\n sources = [];\n }\n } else {\n sources = parseOptions(sources);\n }\n if (!isArray(sources)) {\n sources = [sources];\n }\n return sources.filter((source) => !isEmpty(source));\n }\n function isImg(el) {\n return isTag(el, \"img\");\n }\n\n var inverse = {\n props: {\n target: String,\n selActive: String\n },\n data: {\n target: false,\n selActive: false\n },\n computed: {\n target: ({ target }, $el) => target ? $$(target, $el) : $el\n },\n observe: [\n intersection({\n handler(entries) {\n this.isIntersecting = entries.some(({ isIntersecting }) => isIntersecting);\n this.$emit();\n },\n target: ({ target }) => target,\n args: { intersecting: false }\n }),\n mutation({\n target: ({ target }) => target,\n options: { attributes: true, attributeFilter: [\"class\"], attributeOldValue: true }\n }),\n {\n target: ({ target }) => target,\n observe: (target, handler) => {\n const observer = observeResize(\n [...toNodes(target), document.documentElement],\n handler\n );\n const listener = [\n on(document, \"scroll itemshown itemhidden\", handler, {\n passive: true,\n capture: true\n }),\n on(document, \"show hide transitionstart\", (e) => {\n handler();\n return observer.observe(e.target);\n }),\n on(document, \"shown hidden transitionend transitioncancel\", (e) => {\n handler();\n return observer.unobserve(e.target);\n })\n ];\n return {\n observe: observer.observe.bind(observer),\n unobserve: observer.unobserve.bind(observer),\n disconnect() {\n observer.disconnect();\n listener.map((off) => off());\n }\n };\n },\n handler() {\n this.$emit();\n }\n }\n ],\n update: {\n read() {\n if (!this.isIntersecting) {\n return false;\n }\n for (const target of toNodes(this.target)) {\n let color = !this.selActive || matches(target, this.selActive) ? findTargetColor(target) : \"\";\n if (color !== false) {\n replaceClass(target, \"uk-light uk-dark\", color);\n }\n }\n }\n }\n };\n function findTargetColor(target) {\n const dim = dimensions$1(target);\n const viewport = dimensions$1(window);\n if (!intersectRect(dim, viewport)) {\n return false;\n }\n const { left, top, height, width } = dim;\n let last;\n for (const percent of [0.25, 0.5, 0.75]) {\n const elements = target.ownerDocument.elementsFromPoint(\n Math.max(0, Math.min(left + width * percent, viewport.width - 1)),\n Math.max(0, Math.min(top + height / 2, viewport.height - 1))\n );\n for (const element of elements) {\n if (target.contains(element) || !checkVisibility(element) || element.closest('[class*=\"-leave\"]') && elements.some((el) => element !== el && matches(el, '[class*=\"-enter\"]'))) {\n continue;\n }\n const color = css(element, \"--uk-inverse\");\n if (color) {\n if (color === last) {\n return `uk-${color}`;\n }\n last = color;\n break;\n }\n }\n }\n return last ? `uk-${last}` : \"\";\n }\n function checkVisibility(element) {\n if (css(element, \"visibility\") !== \"visible\") {\n return false;\n }\n while (element) {\n if (css(element, \"opacity\") === \"0\") {\n return false;\n }\n element = parent(element);\n }\n return true;\n }\n\n var leader = {\n mixins: [Class, Media],\n props: {\n fill: String\n },\n data: {\n fill: \"\",\n clsWrapper: \"uk-leader-fill\",\n clsHide: \"uk-leader-hide\",\n attrFill: \"data-fill\"\n },\n computed: {\n fill: ({ fill }, $el) => fill || css($el, \"--uk-leader-fill-content\")\n },\n connected() {\n [this.wrapper] = wrapInner(this.$el, ``);\n },\n disconnected() {\n unwrap(this.wrapper.childNodes);\n },\n observe: resize(),\n update: {\n read() {\n const width = Math.trunc(this.$el.offsetWidth / 2);\n return {\n width,\n fill: this.fill,\n hide: !this.matchMedia\n };\n },\n write({ width, fill, hide }) {\n toggleClass(this.wrapper, this.clsHide, hide);\n attr(this.wrapper, this.attrFill, new Array(width).join(fill));\n },\n events: [\"resize\"]\n }\n };\n\n var modal = {\n install,\n mixins: [Modal],\n data: {\n clsPage: \"uk-modal-page\",\n selPanel: \".uk-modal-dialog\",\n selClose: \".uk-modal-close, .uk-modal-close-default, .uk-modal-close-outside, .uk-modal-close-full\"\n },\n events: [\n {\n name: \"fullscreenchange webkitendfullscreen\",\n capture: true,\n handler(e) {\n if (isTag(e.target, \"video\") && this.isToggled() && !document.fullscreenElement) {\n this.hide();\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (hasClass(this.panel, \"uk-margin-auto-vertical\")) {\n addClass(this.$el, \"uk-flex\");\n } else {\n css(this.$el, \"display\", \"block\");\n }\n height(this.$el);\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n css(this.$el, \"display\", \"\");\n removeClass(this.$el, \"uk-flex\");\n }\n }\n ]\n };\n function install({ modal }) {\n modal.dialog = function(content, options) {\n const dialog = modal($(`
    ${content}
    `), {\n stack: true,\n role: \"alertdialog\",\n ...options\n });\n dialog.show();\n on(\n dialog.$el,\n \"hidden\",\n async () => {\n await Promise.resolve();\n dialog.$destroy(true);\n },\n { self: true }\n );\n return dialog;\n };\n modal.alert = function(message, options) {\n return openDialog(\n ({ i18n }) => `
    ${isString(message) ? message : html(message)}
    `,\n options\n );\n };\n modal.confirm = function(message, options) {\n return openDialog(\n ({ i18n }) => `
    ${isString(message) ? message : html(message)}
    `,\n options,\n () => Promise.reject()\n );\n };\n modal.prompt = function(message, value, options) {\n const promise = openDialog(\n ({ i18n }) => `
    `,\n options,\n () => null,\n () => input.value\n );\n const { $el } = promise.dialog;\n const input = $(\"input\", $el);\n input.value = value || \"\";\n on($el, \"show\", () => input.select());\n return promise;\n };\n modal.i18n = {\n ok: \"Ok\",\n cancel: \"Cancel\"\n };\n function openDialog(tmpl, options, hideFn = noop, submitFn = noop) {\n options = {\n bgClose: false,\n escClose: true,\n ...options,\n i18n: { ...modal.i18n, ...options == null ? void 0 : options.i18n }\n };\n const dialog = modal.dialog(tmpl(options), options);\n return assign(\n new Promise((resolve) => {\n const off = on(dialog.$el, \"hide\", () => resolve(hideFn()));\n on(dialog.$el, \"submit\", \"form\", (e) => {\n e.preventDefault();\n resolve(submitFn(dialog));\n off();\n dialog.hide();\n });\n }),\n { dialog }\n );\n }\n }\n\n var nav = {\n extends: Accordion,\n data: {\n targets: \"> .uk-parent\",\n toggle: \"> a\",\n content: \"> ul\"\n }\n };\n\n const clsNavbarTransparent = \"uk-navbar-transparent\";\n var navbar = {\n extends: Dropnav,\n props: {\n dropbarTransparentMode: Boolean\n },\n data: {\n clsDrop: \"uk-navbar-dropdown\",\n selNavItem: \".uk-navbar-nav > li > a,a.uk-navbar-item,button.uk-navbar-item,.uk-navbar-item a,.uk-navbar-item button,.uk-navbar-toggle\",\n // Simplify with :where() selector once browser target is Safari 14+\n dropbarTransparentMode: false\n },\n computed: {\n navbarContainer: (_, $el) => $el.closest(\".uk-navbar-container\")\n },\n watch: {\n items() {\n const justify = hasClass(this.$el, \"uk-navbar-justify\");\n const containers = $$(\".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right\", this.$el);\n for (const container of containers) {\n const items = justify ? $$(\".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle\", container).length : \"\";\n css(container, \"flexGrow\", items);\n }\n }\n },\n events: [\n {\n name: \"show\",\n el: ({ dropContainer }) => dropContainer,\n handler({ target }) {\n if (this.getTransparentMode(target) === \"remove\" && hasClass(this.navbarContainer, clsNavbarTransparent)) {\n removeClass(this.navbarContainer, clsNavbarTransparent);\n this._transparent = true;\n }\n }\n },\n {\n name: \"hide\",\n el: ({ dropContainer }) => dropContainer,\n async handler() {\n await awaitMacroTask();\n if (!this.getActive() && this._transparent) {\n addClass(this.navbarContainer, clsNavbarTransparent);\n this._transparent = null;\n }\n }\n }\n ],\n methods: {\n getTransparentMode(el) {\n if (!this.navbarContainer) {\n return;\n }\n if (this.dropbar && this.isDropbarDrop(el)) {\n return this.dropbarTransparentMode;\n }\n const drop = this.getDropdown(el);\n if (drop && hasClass(el, \"uk-dropbar\")) {\n return drop.inset ? \"behind\" : \"remove\";\n }\n },\n getDropbarOffset(offsetTop) {\n const { top, height } = offset(this.navbarContainer);\n return top + (this.dropbarTransparentMode === \"behind\" ? 0 : height + offsetTop);\n }\n }\n };\n function awaitMacroTask() {\n return new Promise((resolve) => setTimeout(resolve));\n }\n\n var offcanvas = {\n mixins: [Modal],\n args: \"mode\",\n props: {\n mode: String,\n flip: Boolean,\n overlay: Boolean,\n swiping: Boolean\n },\n data: {\n mode: \"slide\",\n flip: false,\n overlay: false,\n clsPage: \"uk-offcanvas-page\",\n clsContainer: \"uk-offcanvas-container\",\n selPanel: \".uk-offcanvas-bar\",\n clsFlip: \"uk-offcanvas-flip\",\n clsContainerAnimation: \"uk-offcanvas-container-animation\",\n clsSidebarAnimation: \"uk-offcanvas-bar-animation\",\n clsMode: \"uk-offcanvas\",\n clsOverlay: \"uk-offcanvas-overlay\",\n selClose: \".uk-offcanvas-close\",\n container: false,\n swiping: true\n },\n computed: {\n clsFlip: ({ flip, clsFlip }) => flip ? clsFlip : \"\",\n clsOverlay: ({ overlay, clsOverlay }) => overlay ? clsOverlay : \"\",\n clsMode: ({ mode, clsMode }) => `${clsMode}-${mode}`,\n clsSidebarAnimation: ({ mode, clsSidebarAnimation }) => mode === \"none\" || mode === \"reveal\" ? \"\" : clsSidebarAnimation,\n clsContainerAnimation: ({ mode, clsContainerAnimation }) => mode !== \"push\" && mode !== \"reveal\" ? \"\" : clsContainerAnimation,\n transitionElement({ mode }) {\n return mode === \"reveal\" ? parent(this.panel) : this.panel;\n }\n },\n observe: swipe({ filter: ({ swiping }) => swiping }),\n update: {\n read() {\n if (this.isToggled() && !isVisible(this.$el)) {\n this.hide();\n }\n },\n events: [\"resize\"]\n },\n events: [\n {\n name: \"touchmove\",\n self: true,\n passive: false,\n filter: ({ overlay }) => overlay,\n handler(e) {\n e.cancelable && e.preventDefault();\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (this.mode === \"reveal\" && !hasClass(parent(this.panel), this.clsMode)) {\n wrapAll(this.panel, \"
    \");\n addClass(parent(this.panel), this.clsMode);\n }\n const { body, scrollingElement } = document;\n addClass(body, this.clsContainer, this.clsFlip);\n css(body, \"touch-action\", \"pan-y pinch-zoom\");\n css(this.$el, \"display\", \"block\");\n css(this.panel, \"maxWidth\", scrollingElement.clientWidth);\n addClass(this.$el, this.clsOverlay);\n addClass(\n this.panel,\n this.clsSidebarAnimation,\n this.mode === \"reveal\" ? \"\" : this.clsMode\n );\n height(body);\n addClass(body, this.clsContainerAnimation);\n this.clsContainerAnimation && suppressUserScale();\n }\n },\n {\n name: \"hide\",\n self: true,\n handler() {\n removeClass(document.body, this.clsContainerAnimation);\n css(document.body, \"touch-action\", \"\");\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n this.clsContainerAnimation && resumeUserScale();\n if (this.mode === \"reveal\") {\n unwrap(this.panel);\n }\n removeClass(this.panel, this.clsSidebarAnimation, this.clsMode);\n removeClass(this.$el, this.clsOverlay);\n css(this.$el, \"display\", \"\");\n css(this.panel, \"maxWidth\", \"\");\n removeClass(document.body, this.clsContainer, this.clsFlip);\n }\n },\n {\n name: \"swipeLeft swipeRight\",\n handler(e) {\n if (this.isToggled() && endsWith(e.type, \"Left\") ^ this.flip) {\n this.hide();\n }\n }\n }\n ]\n };\n function suppressUserScale() {\n getViewport().content += \",user-scalable=0\";\n }\n function resumeUserScale() {\n const viewport = getViewport();\n viewport.content = viewport.content.replace(/,user-scalable=0$/, \"\");\n }\n function getViewport() {\n return $('meta[name=\"viewport\"]', document.head) || append(document.head, '');\n }\n\n var overflowAuto = {\n mixins: [Class],\n props: {\n selContainer: String,\n selContent: String,\n minHeight: Number\n },\n data: {\n selContainer: \".uk-modal\",\n selContent: \".uk-modal-dialog\",\n minHeight: 150\n },\n computed: {\n container: ({ selContainer }, $el) => $el.closest(selContainer),\n content: ({ selContent }, $el) => $el.closest(selContent)\n },\n observe: resize({\n target: ({ container, content }) => [container, content]\n }),\n update: {\n read() {\n if (!this.content || !this.container || !isVisible(this.$el)) {\n return false;\n }\n return {\n max: Math.max(\n this.minHeight,\n height(this.container) - (dimensions$1(this.content).height - height(this.$el))\n )\n };\n },\n write({ max }) {\n css(this.$el, { minHeight: this.minHeight, maxHeight: max });\n },\n events: [\"resize\"]\n }\n };\n\n var responsive = {\n props: [\"width\", \"height\"],\n connected() {\n addClass(this.$el, \"uk-responsive-width\");\n css(this.$el, \"aspectRatio\", `${this.width}/${this.height}`);\n }\n };\n\n var scroll = {\n props: {\n offset: Number\n },\n data: {\n offset: 0\n },\n connected() {\n registerClick(this);\n },\n disconnected() {\n unregisterClick(this);\n },\n methods: {\n async scrollTo(el) {\n el = el && $(el) || document.body;\n if (trigger(this.$el, \"beforescroll\", [this, el])) {\n await scrollIntoView(el, { offset: this.offset });\n trigger(this.$el, \"scrolled\", [this, el]);\n }\n }\n }\n };\n const instances = /* @__PURE__ */ new Set();\n function registerClick(cmp) {\n if (!instances.size) {\n on(document, \"click\", clickHandler);\n }\n instances.add(cmp);\n }\n function unregisterClick(cmp) {\n instances.delete(cmp);\n if (!instances.size) {\n off(document, \"click\", clickHandler);\n }\n }\n function clickHandler(e) {\n if (e.defaultPrevented) {\n return;\n }\n for (const instance of instances) {\n if (instance.$el.contains(e.target) && isSameSiteAnchor(instance.$el)) {\n e.preventDefault();\n if (window.location.href !== instance.$el.href) {\n window.history.pushState({}, \"\", instance.$el.href);\n }\n instance.scrollTo(getTargetedElement(instance.$el));\n }\n }\n }\n\n const clsInView = \"uk-scrollspy-inview\";\n var scrollspy = {\n args: \"cls\",\n props: {\n cls: String,\n target: String,\n hidden: Boolean,\n margin: String,\n repeat: Boolean,\n delay: Number\n },\n data: () => ({\n cls: \"\",\n target: false,\n hidden: true,\n margin: \"-1px\",\n repeat: false,\n delay: 0\n }),\n computed: {\n elements: ({ target }, $el) => target ? $$(target, $el) : [$el]\n },\n watch: {\n elements(elements) {\n if (this.hidden) {\n css(filter$1(elements, `:not(.${clsInView})`), \"opacity\", 0);\n }\n }\n },\n connected() {\n this.elementData = /* @__PURE__ */ new Map();\n },\n disconnected() {\n for (const [el, state] of this.elementData.entries()) {\n removeClass(el, clsInView, (state == null ? void 0 : state.cls) || \"\");\n }\n delete this.elementData;\n },\n observe: intersection({\n target: ({ elements }) => elements,\n handler(records) {\n const elements = this.elementData;\n for (const { target: el, isIntersecting } of records) {\n if (!elements.has(el)) {\n elements.set(el, {\n cls: data(el, \"uk-scrollspy-class\") || this.cls\n });\n }\n const state = elements.get(el);\n if (!this.repeat && state.show) {\n continue;\n }\n state.show = isIntersecting;\n }\n this.$emit();\n },\n options: ({ margin }) => ({ rootMargin: margin }),\n args: { intersecting: false }\n }),\n update: [\n {\n write(data) {\n for (const [el, state] of this.elementData.entries()) {\n if (state.show && !state.inview && !state.queued) {\n state.queued = true;\n data.promise = (data.promise || Promise.resolve()).then(() => new Promise((resolve) => setTimeout(resolve, this.delay))).then(() => {\n this.toggle(el, true);\n setTimeout(() => {\n state.queued = false;\n this.$emit();\n }, 300);\n });\n } else if (!state.show && state.inview && !state.queued && this.repeat) {\n this.toggle(el, false);\n }\n }\n }\n }\n ],\n methods: {\n toggle(el, inview) {\n var _a, _b;\n const state = (_a = this.elementData) == null ? void 0 : _a.get(el);\n if (!state) {\n return;\n }\n (_b = state.off) == null ? void 0 : _b.call(state);\n css(el, \"opacity\", !inview && this.hidden ? 0 : \"\");\n toggleClass(el, clsInView, inview);\n toggleClass(el, state.cls);\n let match;\n if (match = state.cls.match(/\\buk-animation-[\\w-]+/g)) {\n const removeAnimationClasses = () => removeClass(el, match);\n if (inview) {\n state.off = once(el, \"animationcancel animationend\", removeAnimationClasses, {\n self: true\n });\n } else {\n removeAnimationClasses();\n }\n }\n trigger(el, inview ? \"inview\" : \"outview\");\n state.inview = inview;\n }\n }\n };\n\n var scrollspyNav = {\n props: {\n cls: String,\n closest: Boolean,\n scroll: Boolean,\n target: String,\n offset: Number\n },\n data: {\n cls: \"uk-active\",\n closest: false,\n scroll: false,\n target: \"a[href]\",\n offset: 0\n },\n computed: {\n links: ({ target }, $el) => $$(target, $el).filter((el) => isSameSiteAnchor(el)),\n elements({ closest }) {\n return this.links.map((el) => el.closest(closest || \"*\"));\n }\n },\n watch: {\n links(links) {\n if (this.scroll) {\n this.$create(\"scroll\", links, { offset: this.offset });\n }\n }\n },\n observe: [intersection(), scroll$1()],\n update: [\n {\n read() {\n const targets = this.links.map((el) => getTargetedElement(el) || el.ownerDocument);\n const { length } = targets;\n if (!length || !isVisible(this.$el)) {\n return false;\n }\n const scrollElement = scrollParent(targets, true);\n const { scrollTop, scrollHeight } = scrollElement;\n const viewport = offsetViewport(scrollElement);\n const max = scrollHeight - viewport.height;\n let active = false;\n if (scrollTop >= max) {\n active = length - 1;\n } else {\n const offsetBy = this.offset + dimensions$1(getCoveringElement()).height + viewport.height * 0.1;\n for (let i = 0; i < targets.length; i++) {\n if (offset(targets[i]).top - viewport.top - offsetBy > 0) {\n break;\n }\n active = +i;\n }\n }\n return { active };\n },\n write({ active }) {\n const changed = active !== false && !hasClass(this.elements[active], this.cls);\n this.links.forEach((el) => el.blur());\n for (let i = 0; i < this.elements.length; i++) {\n toggleClass(this.elements[i], this.cls, +i === active);\n }\n if (changed) {\n trigger(this.$el, \"active\", [active, this.elements[active]]);\n }\n },\n events: [\"scroll\", \"resize\"]\n }\n ]\n };\n\n var sticky = {\n mixins: [Class, Media],\n props: {\n position: String,\n top: null,\n bottom: null,\n start: null,\n end: null,\n offset: String,\n overflowFlip: Boolean,\n animation: String,\n clsActive: String,\n clsInactive: String,\n clsFixed: String,\n clsBelow: String,\n selTarget: String,\n showOnUp: Boolean,\n targetOffset: Number\n },\n data: {\n position: \"top\",\n top: false,\n bottom: false,\n start: false,\n end: false,\n offset: 0,\n overflowFlip: false,\n animation: \"\",\n clsActive: \"uk-active\",\n clsInactive: \"\",\n clsFixed: \"uk-sticky-fixed\",\n clsBelow: \"uk-sticky-below\",\n selTarget: \"\",\n showOnUp: false,\n targetOffset: false\n },\n computed: {\n target: ({ selTarget }, $el) => selTarget && $(selTarget, $el) || $el\n },\n connected() {\n this.start = coerce(this.start || this.top);\n this.end = coerce(this.end || this.bottom);\n this.placeholder = $(\"+ .uk-sticky-placeholder\", this.$el) || $('
    ');\n this.isFixed = false;\n this.setActive(false);\n },\n beforeDisconnect() {\n if (this.isFixed) {\n this.hide();\n removeClass(this.target, this.clsInactive);\n }\n reset(this.$el);\n remove$1(this.placeholder);\n this.placeholder = null;\n },\n observe: [\n viewport(),\n scroll$1({ target: () => document.scrollingElement }),\n resize({\n target: ({ $el }) => [$el, parent($el), document.scrollingElement],\n handler(entries) {\n this.$emit(\n this._data.resized && entries.some(({ target }) => target === parent(this.$el)) ? \"update\" : \"resize\"\n );\n this._data.resized = true;\n }\n })\n ],\n events: [\n {\n name: \"load hashchange popstate\",\n el: () => window,\n filter: ({ targetOffset }) => targetOffset !== false,\n handler() {\n const { scrollingElement } = document;\n if (!location.hash || scrollingElement.scrollTop === 0) {\n return;\n }\n setTimeout(() => {\n const targetOffset = offset($(location.hash));\n const elOffset = offset(this.$el);\n if (this.isFixed && intersectRect(targetOffset, elOffset)) {\n scrollingElement.scrollTop = Math.ceil(\n targetOffset.top - elOffset.height - toPx(this.targetOffset, \"height\", this.placeholder) - toPx(this.offset, \"height\", this.placeholder)\n );\n }\n });\n }\n }\n ],\n update: [\n {\n read({ height: height$1, width, margin, sticky }, types) {\n this.inactive = !this.matchMedia || !isVisible(this.$el) || !this.$el.offsetHeight;\n if (this.inactive) {\n return;\n }\n const hide = this.isFixed && types.has(\"update\");\n if (hide) {\n preventTransition(this.target);\n this.hide();\n }\n if (!this.active) {\n ({ height: height$1, width } = dimensions$1(this.$el));\n margin = css(this.$el, \"margin\");\n }\n if (hide) {\n this.show();\n }\n const viewport2 = toPx(\"100vh\", \"height\");\n const dynamicViewport = height(window);\n const maxScrollHeight = Math.max(\n 0,\n document.scrollingElement.scrollHeight - viewport2\n );\n let position = this.position;\n if (this.overflowFlip && height$1 > viewport2) {\n position = position === \"top\" ? \"bottom\" : \"top\";\n }\n const referenceElement = this.isFixed ? this.placeholder : this.$el;\n let offset$1 = toPx(this.offset, \"height\", sticky ? this.$el : referenceElement);\n if (position === \"bottom\" && (height$1 < dynamicViewport || this.overflowFlip)) {\n offset$1 += dynamicViewport - height$1;\n }\n const overflow = this.overflowFlip ? 0 : Math.max(0, height$1 + offset$1 - viewport2);\n const topOffset = offset(referenceElement).top;\n const elHeight = dimensions$1(this.$el).height;\n const start = (this.start === false ? topOffset : parseProp(this.start, this.$el, topOffset)) - offset$1;\n const end = this.end === false ? maxScrollHeight : Math.min(\n maxScrollHeight,\n parseProp(this.end, this.$el, topOffset + height$1, true) - elHeight - offset$1 + overflow\n );\n sticky = maxScrollHeight && !this.showOnUp && start + offset$1 === topOffset && end === Math.min(\n maxScrollHeight,\n parseProp(true, this.$el, 0, true) - elHeight - offset$1 + overflow\n ) && css(parent(this.$el), \"overflowY\") === \"visible\";\n return {\n start,\n end,\n offset: offset$1,\n overflow,\n height: height$1,\n elHeight,\n width,\n margin,\n top: offsetPosition(referenceElement)[0],\n sticky,\n viewport: viewport2,\n maxScrollHeight\n };\n },\n write({ height, width, margin, offset, sticky }) {\n if (this.inactive || sticky || !this.isFixed) {\n reset(this.$el);\n }\n if (this.inactive) {\n return;\n }\n if (sticky) {\n height = width = margin = 0;\n css(this.$el, { position: \"sticky\", top: offset });\n }\n const { placeholder } = this;\n css(placeholder, { height, width, margin });\n if (parent(placeholder) !== parent(this.$el) || sticky ^ index(placeholder) < index(this.$el)) {\n (sticky ? before : after)(this.$el, placeholder);\n placeholder.hidden = true;\n }\n },\n events: [\"resize\"]\n },\n {\n read({\n scroll: prevScroll = 0,\n dir: prevDir = \"down\",\n overflow,\n overflowScroll = 0,\n start,\n end,\n elHeight,\n height,\n sticky,\n maxScrollHeight\n }) {\n const scroll2 = Math.min(document.scrollingElement.scrollTop, maxScrollHeight);\n const dir = prevScroll <= scroll2 ? \"down\" : \"up\";\n const referenceElement = this.isFixed ? this.placeholder : this.$el;\n return {\n dir,\n prevDir,\n scroll: scroll2,\n prevScroll,\n below: scroll2 > offset(referenceElement).top + (sticky ? Math.min(height, elHeight) : height),\n offsetParentTop: offset(referenceElement.offsetParent).top,\n overflowScroll: clamp(\n overflowScroll + clamp(scroll2, start, end) - clamp(prevScroll, start, end),\n 0,\n overflow\n )\n };\n },\n write(data, types) {\n const isScrollUpdate = types.has(\"scroll\");\n const {\n initTimestamp = 0,\n dir,\n prevDir,\n scroll: scroll2,\n prevScroll = 0,\n top,\n start,\n below\n } = data;\n if (scroll2 < 0 || scroll2 === prevScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {\n return;\n }\n const now = Date.now();\n if (now - initTimestamp > 300 || dir !== prevDir) {\n data.initScroll = scroll2;\n data.initTimestamp = now;\n }\n if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll2) <= 30 && Math.abs(prevScroll - scroll2) <= 10) {\n return;\n }\n if (this.inactive || scroll2 < start || this.showOnUp && (scroll2 <= start || dir === \"down\" && isScrollUpdate || dir === \"up\" && !this.isFixed && !below)) {\n if (!this.isFixed) {\n if (Animation.inProgress(this.$el) && top > scroll2) {\n Animation.cancel(this.$el);\n this.hide();\n }\n return;\n }\n if (this.animation && below) {\n if (hasClass(this.$el, \"uk-animation-leave\")) {\n return;\n }\n Animation.out(this.$el, this.animation).then(() => this.hide(), noop);\n } else {\n this.hide();\n }\n } else if (this.isFixed) {\n this.update();\n } else if (this.animation && below) {\n this.show();\n Animation.in(this.$el, this.animation).catch(noop);\n } else {\n preventTransition(this.target);\n this.show();\n }\n },\n events: [\"resize\", \"resizeViewport\", \"scroll\"]\n }\n ],\n methods: {\n show() {\n this.isFixed = true;\n this.update();\n this.placeholder.hidden = false;\n },\n hide() {\n const { offset, sticky } = this._data;\n this.setActive(false);\n removeClass(this.$el, this.clsFixed, this.clsBelow);\n if (sticky) {\n css(this.$el, \"top\", offset);\n } else {\n css(this.$el, {\n position: \"\",\n top: \"\",\n width: \"\",\n marginTop: \"\"\n });\n }\n this.placeholder.hidden = true;\n this.isFixed = false;\n },\n update() {\n let {\n width,\n scroll: scroll2 = 0,\n overflow,\n overflowScroll = 0,\n start,\n end,\n offset,\n offsetParentTop,\n sticky,\n below\n } = this._data;\n const active = start !== 0 || scroll2 > start;\n if (!sticky) {\n let position = \"fixed\";\n if (scroll2 > end) {\n offset += end - offsetParentTop + overflowScroll - overflow;\n position = \"absolute\";\n }\n css(this.$el, { position, width, marginTop: 0 }, \"important\");\n }\n css(this.$el, \"top\", offset - overflowScroll);\n this.setActive(active);\n toggleClass(this.$el, this.clsBelow, below);\n addClass(this.$el, this.clsFixed);\n },\n setActive(active) {\n const prev = this.active;\n this.active = active;\n if (active) {\n replaceClass(this.target, this.clsInactive, this.clsActive);\n prev !== active && trigger(this.$el, \"active\");\n } else {\n replaceClass(this.target, this.clsActive, this.clsInactive);\n if (prev !== active) {\n preventTransition(this.target);\n trigger(this.$el, \"inactive\");\n }\n }\n }\n }\n };\n function parseProp(value, el, propOffset, padding) {\n if (!value) {\n return 0;\n }\n if (isNumeric(value) || isString(value) && value.match(/^-?\\d/)) {\n return propOffset + toPx(value, \"height\", el, true);\n } else {\n const refElement = value === true ? parent(el) : query(value, el);\n return offset(refElement).bottom - (padding && (refElement == null ? void 0 : refElement.contains(el)) ? toFloat(css(refElement, \"paddingBottom\")) : 0);\n }\n }\n function coerce(value) {\n if (value === \"true\") {\n return true;\n } else if (value === \"false\") {\n return false;\n }\n return value;\n }\n function reset(el) {\n css(el, { position: \"\", top: \"\", marginTop: \"\", width: \"\" });\n }\n const clsTransitionDisable = \"uk-transition-disable\";\n function preventTransition(element) {\n if (!hasClass(element, clsTransitionDisable)) {\n addClass(element, clsTransitionDisable);\n requestAnimationFrame(() => removeClass(element, clsTransitionDisable));\n }\n }\n\n const selDisabled = \".uk-disabled *, .uk-disabled, [disabled]\";\n var Switcher = {\n mixins: [Togglable],\n args: \"connect\",\n props: {\n connect: String,\n toggle: String,\n itemNav: String,\n active: Number,\n followFocus: Boolean,\n swiping: Boolean\n },\n data: {\n connect: \"~.uk-switcher\",\n toggle: \"> * > :first-child\",\n itemNav: false,\n active: 0,\n cls: \"uk-active\",\n attrItem: \"uk-switcher-item\",\n selVertical: \".uk-nav\",\n followFocus: false,\n swiping: true\n },\n computed: {\n connects: {\n get: ({ connect }, $el) => queryAll(connect, $el),\n observe: ({ connect }) => connect\n },\n connectChildren() {\n return this.connects.map((el) => children(el)).flat();\n },\n toggles: ({ toggle }, $el) => $$(toggle, $el),\n children(_, $el) {\n return children($el).filter(\n (child) => this.toggles.some((toggle) => child.contains(toggle))\n );\n }\n },\n watch: {\n connects(connects) {\n if (this.swiping) {\n css(connects, \"touchAction\", \"pan-y pinch-zoom\");\n }\n this.$emit();\n },\n connectChildren() {\n let index = Math.max(0, this.index());\n for (const el of this.connects) {\n children(el).forEach((child, i) => toggleClass(child, this.cls, i === index));\n }\n this.$emit();\n },\n toggles(toggles) {\n this.$emit();\n const active = this.index();\n this.show(~active ? active : toggles[this.active] || toggles[0]);\n }\n },\n connected() {\n attr(this.$el, \"role\", \"tablist\");\n },\n observe: [\n lazyload({ targets: ({ connectChildren }) => connectChildren }),\n swipe({ target: ({ connects }) => connects, filter: ({ swiping }) => swiping })\n ],\n events: [\n {\n name: \"click keydown\",\n delegate: ({ toggle }) => toggle,\n handler(e) {\n if (!matches(e.current, selDisabled) && (e.type === \"click\" || e.keyCode === keyMap.SPACE)) {\n e.preventDefault();\n this.show(e.current);\n }\n }\n },\n {\n name: \"keydown\",\n delegate: ({ toggle }) => toggle,\n handler(e) {\n const { current, keyCode } = e;\n const isVertical = matches(this.$el, this.selVertical);\n let i = keyCode === keyMap.HOME ? 0 : keyCode === keyMap.END ? \"last\" : keyCode === keyMap.LEFT && !isVertical || keyCode === keyMap.UP && isVertical ? \"previous\" : keyCode === keyMap.RIGHT && !isVertical || keyCode === keyMap.DOWN && isVertical ? \"next\" : -1;\n if (~i) {\n e.preventDefault();\n const toggles = this.toggles.filter((el) => !matches(el, selDisabled));\n const next = toggles[getIndex(i, toggles, toggles.indexOf(current))];\n next.focus();\n if (this.followFocus) {\n this.show(next);\n }\n }\n }\n },\n {\n name: \"click\",\n el: ({ $el, connects, itemNav }) => connects.concat(itemNav ? queryAll(itemNav, $el) : []),\n delegate: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n handler(e) {\n if (e.target.closest(\"a,button\")) {\n e.preventDefault();\n this.show(data(e.current, this.attrItem));\n }\n }\n },\n {\n name: \"swipeRight swipeLeft\",\n filter: ({ swiping }) => swiping,\n el: ({ connects }) => connects,\n handler({ type }) {\n this.show(endsWith(type, \"Left\") ? \"next\" : \"previous\");\n }\n }\n ],\n update() {\n var _a;\n for (const el of this.connects) {\n if (isTag(el, \"ul\")) {\n attr(el, \"role\", \"presentation\");\n }\n }\n attr(children(this.$el), \"role\", \"presentation\");\n for (const index in this.toggles) {\n const toggle = this.toggles[index];\n const item = (_a = this.connects[0]) == null ? void 0 : _a.children[index];\n attr(toggle, \"role\", \"tab\");\n if (!item) {\n continue;\n }\n toggle.id = generateId(this, toggle);\n item.id = generateId(this, item);\n attr(toggle, \"aria-controls\", item.id);\n attr(item, { role: \"tabpanel\", \"aria-labelledby\": toggle.id });\n }\n attr(this.$el, \"aria-orientation\", matches(this.$el, this.selVertical) ? \"vertical\" : null);\n },\n methods: {\n index() {\n return findIndex(this.children, (el) => hasClass(el, this.cls));\n },\n show(item) {\n const toggles = this.toggles.filter((el) => !matches(el, selDisabled));\n const prev = this.index();\n const next = getIndex(\n !isNode(item) || includes(toggles, item) ? item : 0,\n toggles,\n getIndex(this.toggles[prev], toggles)\n );\n const active = getIndex(toggles[next], this.toggles);\n this.children.forEach((child, i) => {\n toggleClass(child, this.cls, active === i);\n attr(this.toggles[i], {\n \"aria-selected\": active === i,\n tabindex: active === i ? null : -1\n });\n });\n const animate = prev >= 0 && prev !== next;\n this.connects.forEach(async ({ children: children2 }) => {\n const actives = toArray(children2).filter(\n (child, i) => i !== active && hasClass(child, this.cls)\n );\n if (await this.toggleElement(actives, false, animate)) {\n await this.toggleElement(children2[active], true, animate);\n }\n });\n }\n }\n };\n\n var tab = {\n mixins: [Class],\n extends: Switcher,\n props: {\n media: Boolean\n },\n data: {\n media: 960,\n attrItem: \"uk-tab-item\",\n selVertical: \".uk-tab-left,.uk-tab-right\"\n },\n connected() {\n const cls = hasClass(this.$el, \"uk-tab-left\") ? \"uk-tab-left\" : hasClass(this.$el, \"uk-tab-right\") ? \"uk-tab-right\" : false;\n if (cls) {\n this.$create(\"toggle\", this.$el, { cls, mode: \"media\", media: this.media });\n }\n }\n };\n\n const KEY_SPACE = 32;\n var toggle = {\n mixins: [Media, Togglable],\n args: \"target\",\n props: {\n href: String,\n target: null,\n mode: \"list\",\n queued: Boolean\n },\n data: {\n href: false,\n target: false,\n mode: \"click\",\n queued: true\n },\n computed: {\n target: {\n get: ({ target }, $el) => {\n target = queryAll(target || $el.hash, $el);\n return target.length ? target : [$el];\n },\n observe: ({ target }) => target\n }\n },\n connected() {\n if (!includes(this.mode, \"media\")) {\n if (!isFocusable(this.$el)) {\n attr(this.$el, \"tabindex\", \"0\");\n }\n if (!this.cls && isTag(this.$el, \"a\")) {\n attr(this.$el, \"role\", \"button\");\n }\n }\n },\n observe: lazyload({ targets: ({ target }) => target }),\n events: [\n {\n name: pointerDown$1,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n this._preventClick = null;\n if (!isTouch(e) || isBoolean(this._showState) || this.$el.disabled) {\n return;\n }\n trigger(this.$el, \"focus\");\n once(\n document,\n pointerDown$1,\n () => trigger(this.$el, \"blur\"),\n true,\n (e2) => !this.$el.contains(e2.target)\n );\n if (includes(this.mode, \"click\")) {\n this._preventClick = true;\n }\n }\n },\n {\n // mouseenter mouseleave are added because of Firefox bug,\n // where pointerleave is triggered immediately after pointerenter on scroll\n name: `mouseenter mouseleave ${pointerEnter} ${pointerLeave} focus blur`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (isTouch(e) || this.$el.disabled) {\n return;\n }\n const show = includes([\"mouseenter\", pointerEnter, \"focus\"], e.type);\n const expanded = this.isToggled(this.target);\n if (!show && (!isBoolean(this._showState) || e.type !== \"blur\" && matches(this.$el, \":focus\") || e.type === \"blur\" && matches(this.$el, \":hover\"))) {\n if (expanded === this._showState) {\n this._showState = null;\n }\n return;\n }\n if (show && isBoolean(this._showState) && expanded !== this._showState) {\n return;\n }\n this._showState = show ? expanded : null;\n this.toggle(`toggle${show ? \"show\" : \"hide\"}`);\n }\n },\n {\n name: \"keydown\",\n filter: ({ $el, mode }) => includes(mode, \"click\") && !isTag($el, \"input\"),\n handler(e) {\n if (e.keyCode === KEY_SPACE) {\n e.preventDefault();\n this.$el.click();\n }\n }\n },\n {\n name: \"click\",\n filter: ({ mode }) => [\"click\", \"hover\"].some((m) => includes(mode, m)),\n handler(e) {\n let link;\n if (this._preventClick || e.target.closest('a[href=\"#\"], a[href=\"\"]') || (link = e.target.closest(\"a[href]\")) && (!this.isToggled(this.target) || link.hash && matches(this.target, link.hash))) {\n e.preventDefault();\n }\n if (!this._preventClick && includes(this.mode, \"click\")) {\n this.toggle();\n }\n }\n },\n {\n name: \"mediachange\",\n filter: ({ mode }) => includes(mode, \"media\"),\n el: ({ target }) => target,\n handler(e, mediaObj) {\n if (mediaObj.matches ^ this.isToggled(this.target)) {\n this.toggle();\n }\n }\n }\n ],\n methods: {\n async toggle(type) {\n if (!trigger(this.target, type || \"toggle\", [this])) {\n return;\n }\n if (hasAttr(this.$el, \"aria-expanded\")) {\n attr(this.$el, \"aria-expanded\", !this.isToggled(this.target));\n }\n if (!this.queued) {\n return this.toggleElement(this.target);\n }\n const leaving = this.target.filter((el) => hasClass(el, this.clsLeave));\n if (leaving.length) {\n for (const el of this.target) {\n const isLeaving = includes(leaving, el);\n this.toggleElement(el, isLeaving, isLeaving);\n }\n return;\n }\n const toggled = this.target.filter(this.isToggled);\n if (await this.toggleElement(toggled, false)) {\n await this.toggleElement(\n this.target.filter((el) => !includes(toggled, el)),\n true\n );\n }\n }\n }\n };\n\n var components = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Accordion: Accordion,\n Alert: alert,\n Close: Close,\n Cover: cover,\n Drop: drop,\n DropParentIcon: IconComponent,\n Dropdown: drop,\n Dropnav: Dropnav,\n FormCustom: formCustom,\n Grid: grid,\n HeightMatch: heightMatch,\n HeightPlaceholder: heightPlaceholder,\n HeightViewport: heightViewport,\n Icon: Icon,\n Img: img,\n Inverse: inverse,\n Leader: leader,\n Margin: Margin,\n Marker: Marker,\n Modal: modal,\n Nav: nav,\n NavParentIcon: NavParentIcon,\n Navbar: navbar,\n NavbarParentIcon: IconComponent,\n NavbarToggleIcon: NavbarToggleIcon,\n Offcanvas: offcanvas,\n OverflowAuto: overflowAuto,\n OverlayIcon: IconComponent,\n PaginationNext: PaginationNext,\n PaginationPrevious: PaginationPrevious,\n Responsive: responsive,\n Scroll: scroll,\n Scrollspy: scrollspy,\n ScrollspyNav: scrollspyNav,\n SearchIcon: Search,\n SlidenavNext: Slidenav,\n SlidenavPrevious: Slidenav,\n Spinner: Spinner,\n Sticky: sticky,\n Svg: svg,\n Switcher: Switcher,\n Tab: tab,\n Toggle: toggle,\n Totop: Totop,\n Video: Video\n });\n\n each(components, (component, name) => App.component(name, component));\n boot(App);\n\n each(components$1, (component, name) => App.component(name, component));\n\n return App;\n\n}));\n", "function ok() {\n return true;\n}\nfunction notOk() {\n return false;\n}\nfunction undef() {\n return undefined;\n}\nconst NOT_TYPED_FUNCTION = 'Argument is not a typed-function.';\n\n/**\n * @typedef {{\n * params: Param[],\n * fn: function,\n * test: function,\n * implementation: function\n * }} Signature\n *\n * @typedef {{\n * types: Type[],\n * hasAny: boolean,\n * hasConversion: boolean,\n * restParam: boolean\n * }} Param\n *\n * @typedef {{\n * name: string,\n * typeIndex: number,\n * test: function,\n * isAny: boolean,\n * conversion?: ConversionDef,\n * conversionIndex: number,\n * }} Type\n *\n * @typedef {{\n * from: string,\n * to: string,\n * convert: function (*) : *\n * }} ConversionDef\n *\n * @typedef {{\n * name: string,\n * test: function(*) : boolean,\n * isAny?: boolean\n * }} TypeDef\n */\n\n/**\n * @returns {() => function}\n */\nfunction create() {\n // data type tests\n\n /**\n * Returns true if the argument is a non-null \"plain\" object\n */\n function isPlainObject(x) {\n return typeof x === 'object' && x !== null && x.constructor === Object;\n }\n const _types = [{\n name: 'number',\n test: function (x) {\n return typeof x === 'number';\n }\n }, {\n name: 'string',\n test: function (x) {\n return typeof x === 'string';\n }\n }, {\n name: 'boolean',\n test: function (x) {\n return typeof x === 'boolean';\n }\n }, {\n name: 'Function',\n test: function (x) {\n return typeof x === 'function';\n }\n }, {\n name: 'Array',\n test: Array.isArray\n }, {\n name: 'Date',\n test: function (x) {\n return x instanceof Date;\n }\n }, {\n name: 'RegExp',\n test: function (x) {\n return x instanceof RegExp;\n }\n }, {\n name: 'Object',\n test: isPlainObject\n }, {\n name: 'null',\n test: function (x) {\n return x === null;\n }\n }, {\n name: 'undefined',\n test: function (x) {\n return x === undefined;\n }\n }];\n const anyType = {\n name: 'any',\n test: ok,\n isAny: true\n };\n\n // Data structures to track the types. As these are local variables in\n // create(), each typed universe will get its own copy, but the variables\n // will only be accessible through the (closures of the) functions supplied\n // as properties of the typed object, not directly.\n // These will be initialized in clear() below\n let typeMap; // primary store of all types\n let typeList; // Array of just type names, for the sake of ordering\n\n // And similar data structures for the type conversions:\n let nConversions = 0;\n // the actual conversions are stored on a property of the destination types\n\n // This is a temporary object, will be replaced with a function at the end\n let typed = {\n createCount: 0\n };\n\n /**\n * Takes a type name and returns the corresponding official type object\n * for that type.\n *\n * @param {string} typeName\n * @returns {TypeDef} type\n */\n function findType(typeName) {\n const type = typeMap.get(typeName);\n if (type) {\n return type;\n }\n // Remainder is error handling\n let message = 'Unknown type \"' + typeName + '\"';\n const name = typeName.toLowerCase();\n let otherName;\n for (otherName of typeList) {\n if (otherName.toLowerCase() === name) {\n message += '. Did you mean \"' + otherName + '\" ?';\n break;\n }\n }\n throw new TypeError(message);\n }\n\n /**\n * Adds an array `types` of type definitions to this typed instance.\n * Each type definition should be an object with properties:\n * 'name' - a string giving the name of the type; 'test' - function\n * returning a boolean that tests membership in the type; and optionally\n * 'isAny' - true only for the 'any' type.\n *\n * The second optional argument, `before`, gives the name of a type that\n * these types should be added before. The new types are added in the\n * order specified.\n * @param {TypeDef[]} types\n * @param {string | boolean} [beforeSpec='any'] before\n */\n function addTypes(types) {\n let beforeSpec = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any';\n const beforeIndex = beforeSpec ? findType(beforeSpec).index : typeList.length;\n const newTypes = [];\n for (let i = 0; i < types.length; ++i) {\n if (!types[i] || typeof types[i].name !== 'string' || typeof types[i].test !== 'function') {\n throw new TypeError('Object with properties {name: string, test: function} expected');\n }\n const typeName = types[i].name;\n if (typeMap.has(typeName)) {\n throw new TypeError('Duplicate type name \"' + typeName + '\"');\n }\n newTypes.push(typeName);\n typeMap.set(typeName, {\n name: typeName,\n test: types[i].test,\n isAny: types[i].isAny,\n index: beforeIndex + i,\n conversionsTo: [] // Newly added type can't have any conversions to it\n });\n }\n // update the typeList\n const affectedTypes = typeList.slice(beforeIndex);\n typeList = typeList.slice(0, beforeIndex).concat(newTypes).concat(affectedTypes);\n // Fix the indices\n for (let i = beforeIndex + newTypes.length; i < typeList.length; ++i) {\n typeMap.get(typeList[i]).index = i;\n }\n }\n\n /**\n * Removes all types and conversions from this typed instance.\n * May cause previously constructed typed-functions to throw\n * strange errors when they are called with types that do not\n * match any of their signatures.\n */\n function clear() {\n typeMap = new Map();\n typeList = [];\n nConversions = 0;\n addTypes([anyType], false);\n }\n\n // initialize the types to the default list\n clear();\n addTypes(_types);\n\n /**\n * Removes all conversions, leaving the types alone.\n */\n function clearConversions() {\n let typeName;\n for (typeName of typeList) {\n typeMap.get(typeName).conversionsTo = [];\n }\n nConversions = 0;\n }\n\n /**\n * Find the type names that match a value.\n * @param {*} value\n * @return {string[]} Array of names of types for which\n * the type test matches the value.\n */\n function findTypeNames(value) {\n const matches = typeList.filter(name => {\n const type = typeMap.get(name);\n return !type.isAny && type.test(value);\n });\n if (matches.length) {\n return matches;\n }\n return ['any'];\n }\n\n /**\n * Check if an entity is a typed function created by any instance\n * @param {any} entity\n * @returns {boolean}\n */\n function isTypedFunction(entity) {\n return entity && typeof entity === 'function' && '_typedFunctionData' in entity;\n }\n\n /**\n * Find a specific signature from a (composed) typed function, for example:\n *\n * typed.findSignature(fn, ['number', 'string'])\n * typed.findSignature(fn, 'number, string')\n * typed.findSignature(fn, 'number,string', {exact: true})\n *\n * This function findSignature will by default return the best match to\n * the given signature, possibly employing type conversions.\n *\n * The (optional) third argument is a plain object giving options\n * controlling the signature search. Currently the only implemented\n * option is `exact`: if specified as true (default is false), only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Note that a (possibly different) type matching\n * `any`, or one or more instances of TYPE matching `...TYPE` are\n * considered exact matches in this regard, as no conversions are used.\n *\n * This function returns a \"signature\" object, as does `typed.resolve()`,\n * which is a plain object with four keys: `params` (the array of parameters\n * for this signature), `fn` (the originally supplied function for this\n * signature), `test` (a generated function that determines if an argument\n * list matches this signature, and `implementation` (the function to call\n * on a matching argument list, that performs conversions if necessary and\n * then calls the originally supplied function).\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature search as documented\n * @return {{ params: Param[], fn: function, test: function, implementation: function }}\n * Returns the matching signature, or throws an error when no signature\n * is found.\n */\n function findSignature(fn, signature, options) {\n if (!isTypedFunction(fn)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n\n // Canonicalize input\n const exact = options && options.exact;\n const stringSignature = Array.isArray(signature) ? signature.join(',') : signature;\n const params = parseSignature(stringSignature);\n const canonicalSignature = stringifyParams(params);\n\n // First hope we get lucky and exactly match a signature\n if (!exact || canonicalSignature in fn.signatures) {\n // OK, we can check the internal signatures\n const match = fn._typedFunctionData.signatureMap.get(canonicalSignature);\n if (match) {\n return match;\n }\n }\n\n // Oh well, we did not; so we have to go back and check the parameters\n // one by one, in order to catch things like `any` and rest params.\n // Note here we can assume there is at least one parameter, because\n // the empty signature would have matched successfully above.\n const nParams = params.length;\n let remainingSignatures;\n if (exact) {\n remainingSignatures = [];\n let name;\n for (name in fn.signatures) {\n remainingSignatures.push(fn._typedFunctionData.signatureMap.get(name));\n }\n } else {\n remainingSignatures = fn._typedFunctionData.signatures;\n }\n for (let i = 0; i < nParams; ++i) {\n const want = params[i];\n const filteredSignatures = [];\n let possibility;\n for (possibility of remainingSignatures) {\n const have = getParamAtIndex(possibility.params, i);\n if (!have || want.restParam && !have.restParam) {\n continue;\n }\n if (!have.hasAny) {\n // have to check all of the wanted types are available\n const haveTypes = paramTypeSet(have);\n if (want.types.some(wtype => !haveTypes.has(wtype.name))) {\n continue;\n }\n }\n // OK, this looks good\n filteredSignatures.push(possibility);\n }\n remainingSignatures = filteredSignatures;\n if (remainingSignatures.length === 0) break;\n }\n // Return the first remaining signature that was totally matched:\n let candidate;\n for (candidate of remainingSignatures) {\n if (candidate.params.length <= nParams) {\n return candidate;\n }\n }\n throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + stringifyParams(params, ', ') + '))');\n }\n\n /**\n * Find the proper function to call for a specific signature from\n * a (composed) typed function, for example:\n *\n * typed.find(fn, ['number', 'string'])\n * typed.find(fn, 'number, string')\n * typed.find(fn, 'number,string', {exact: true})\n *\n * This function find will by default return the best match to\n * the given signature, possibly employing type conversions (and returning\n * a function that will perform those conversions as needed). The\n * (optional) third argument is a plain object giving options contolling\n * the signature search. Currently only the option `exact` is implemented,\n * which defaults to \"false\". If `exact` is specified as true, then only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Uses of `any` and `...TYPE` are considered exact if\n * no conversions are necessary to apply the corresponding function.\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature match as documented\n * @return {function}\n * Returns the function to call for the given signature, or throws an\n * error if no match is found.\n */\n function find(fn, signature, options) {\n return findSignature(fn, signature, options).implementation;\n }\n\n /**\n * Convert a given value to another data type, specified by type name.\n *\n * @param {*} value\n * @param {string} typeName\n */\n function convert(value, typeName) {\n // check conversion is needed\n const type = findType(typeName);\n if (type.test(value)) {\n return value;\n }\n const conversions = type.conversionsTo;\n if (conversions.length === 0) {\n throw new Error('There are no conversions to ' + typeName + ' defined.');\n }\n for (let i = 0; i < conversions.length; i++) {\n const fromType = findType(conversions[i].from);\n if (fromType.test(value)) {\n return conversions[i].convert(value);\n }\n }\n throw new Error('Cannot convert ' + value + ' to ' + typeName);\n }\n\n /**\n * Stringify parameters in a normalized way\n * @param {Param[]} params\n * @param {string} [','] separator\n * @return {string}\n */\n function stringifyParams(params) {\n let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';\n return params.map(p => p.name).join(separator);\n }\n\n /**\n * Parse a parameter, like \"...number | boolean\"\n * @param {string} param\n * @return {Param} param\n */\n function parseParam(param) {\n const restParam = param.indexOf('...') === 0;\n const types = !restParam ? param : param.length > 3 ? param.slice(3) : 'any';\n const typeDefs = types.split('|').map(s => findType(s.trim()));\n let hasAny = false;\n let paramName = restParam ? '...' : '';\n const exactTypes = typeDefs.map(function (type) {\n hasAny = type.isAny || hasAny;\n paramName += type.name + '|';\n return {\n name: type.name,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion: null,\n conversionIndex: -1\n };\n });\n return {\n types: exactTypes,\n name: paramName.slice(0, -1),\n // remove trailing '|' from above\n hasAny,\n hasConversion: false,\n restParam\n };\n }\n\n /**\n * Expands a parsed parameter with the types available from currently\n * defined conversions.\n * @param {Param} param\n * @return {Param} param\n */\n function expandParam(param) {\n const typeNames = param.types.map(t => t.name);\n const matchingConversions = availableConversions(typeNames);\n let hasAny = param.hasAny;\n let newName = param.name;\n const convertibleTypes = matchingConversions.map(function (conversion) {\n const type = findType(conversion.from);\n hasAny = type.isAny || hasAny;\n newName += '|' + conversion.from;\n return {\n name: conversion.from,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion,\n conversionIndex: conversion.index\n };\n });\n return {\n types: param.types.concat(convertibleTypes),\n name: newName,\n hasAny,\n hasConversion: convertibleTypes.length > 0,\n restParam: param.restParam\n };\n }\n\n /**\n * Return the set of type names in a parameter.\n * Caches the result for efficiency\n *\n * @param {Param} param\n * @return {Set} typenames\n */\n function paramTypeSet(param) {\n if (!param.typeSet) {\n param.typeSet = new Set();\n param.types.forEach(type => param.typeSet.add(type.name));\n }\n return param.typeSet;\n }\n\n /**\n * Parse a signature with comma separated parameters,\n * like \"number | boolean, ...string\"\n *\n * @param {string} signature\n * @return {Param[]} params\n */\n function parseSignature(rawSignature) {\n const params = [];\n if (typeof rawSignature !== 'string') {\n throw new TypeError('Signatures must be strings');\n }\n const signature = rawSignature.trim();\n if (signature === '') {\n return params;\n }\n const rawParams = signature.split(',');\n for (let i = 0; i < rawParams.length; ++i) {\n const parsedParam = parseParam(rawParams[i].trim());\n if (parsedParam.restParam && i !== rawParams.length - 1) {\n throw new SyntaxError('Unexpected rest parameter \"' + rawParams[i] + '\": ' + 'only allowed for the last parameter');\n }\n // if invalid, short-circuit (all the types may have been filtered)\n if (parsedParam.types.length === 0) {\n return null;\n }\n params.push(parsedParam);\n }\n return params;\n }\n\n /**\n * Test whether a set of params contains a restParam\n * @param {Param[]} params\n * @return {boolean} Returns true when the last parameter is a restParam\n */\n function hasRestParam(params) {\n const param = last(params);\n return param ? param.restParam : false;\n }\n\n /**\n * Create a type test for a single parameter, which can have one or multiple\n * types.\n * @param {Param} param\n * @return {function(x: *) : boolean} Returns a test function\n */\n function compileTest(param) {\n if (!param || param.types.length === 0) {\n // nothing to do\n return ok;\n } else if (param.types.length === 1) {\n return findType(param.types[0].name).test;\n } else if (param.types.length === 2) {\n const test0 = findType(param.types[0].name).test;\n const test1 = findType(param.types[1].name).test;\n return function or(x) {\n return test0(x) || test1(x);\n };\n } else {\n // param.types.length > 2\n const tests = param.types.map(function (type) {\n return findType(type.name).test;\n });\n return function or(x) {\n for (let i = 0; i < tests.length; i++) {\n if (tests[i](x)) {\n return true;\n }\n }\n return false;\n };\n }\n }\n\n /**\n * Create a test for all parameters of a signature\n * @param {Param[]} params\n * @return {function(args: Array<*>) : boolean}\n */\n function compileTests(params) {\n let tests, test0, test1;\n if (hasRestParam(params)) {\n // variable arguments like '...number'\n tests = initial(params).map(compileTest);\n const varIndex = tests.length;\n const lastTest = compileTest(last(params));\n const testRestParam = function (args) {\n for (let i = varIndex; i < args.length; i++) {\n if (!lastTest(args[i])) {\n return false;\n }\n }\n return true;\n };\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return testRestParam(args) && args.length >= varIndex + 1;\n };\n } else {\n // no variable arguments\n if (params.length === 0) {\n return function testArgs(args) {\n return args.length === 0;\n };\n } else if (params.length === 1) {\n test0 = compileTest(params[0]);\n return function testArgs(args) {\n return test0(args[0]) && args.length === 1;\n };\n } else if (params.length === 2) {\n test0 = compileTest(params[0]);\n test1 = compileTest(params[1]);\n return function testArgs(args) {\n return test0(args[0]) && test1(args[1]) && args.length === 2;\n };\n } else {\n // arguments.length > 2\n tests = params.map(compileTest);\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return args.length === tests.length;\n };\n }\n }\n }\n\n /**\n * Find the parameter at a specific index of a Params list.\n * Handles rest parameters.\n * @param {Param[]} params\n * @param {number} index\n * @return {Param | null} Returns the matching parameter when found,\n * null otherwise.\n */\n function getParamAtIndex(params, index) {\n return index < params.length ? params[index] : hasRestParam(params) ? last(params) : null;\n }\n\n /**\n * Get all type names of a parameter\n * @param {Params[]} params\n * @param {number} index\n * @return {string[]} Returns an array with type names\n */\n function getTypeSetAtIndex(params, index) {\n const param = getParamAtIndex(params, index);\n if (!param) {\n return new Set();\n }\n return paramTypeSet(param);\n }\n\n /**\n * Test whether a type is an exact type or conversion\n * @param {Type} type\n * @return {boolean} Returns true when\n */\n function isExactType(type) {\n return type.conversion === null || type.conversion === undefined;\n }\n\n /**\n * Helper function for creating error messages: create an array with\n * all available types on a specific argument index.\n * @param {Signature[]} signatures\n * @param {number} index\n * @return {string[]} Returns an array with available types\n */\n function mergeExpectedParams(signatures, index) {\n const typeSet = new Set();\n signatures.forEach(signature => {\n const paramSet = getTypeSetAtIndex(signature.params, index);\n let name;\n for (name of paramSet) {\n typeSet.add(name);\n }\n });\n return typeSet.has('any') ? ['any'] : Array.from(typeSet);\n }\n\n /**\n * Create\n * @param {string} name The name of the function\n * @param {array.<*>} args The actual arguments passed to the function\n * @param {Signature[]} signatures A list with available signatures\n * @return {TypeError} Returns a type error with additional data\n * attached to it in the property `data`\n */\n function createError(name, args, signatures) {\n let err, expected;\n const _name = name || 'unnamed';\n\n // test for wrong type at some index\n let matchingSignatures = signatures;\n let index;\n for (index = 0; index < args.length; index++) {\n const nextMatchingDefs = [];\n matchingSignatures.forEach(signature => {\n const param = getParamAtIndex(signature.params, index);\n const test = compileTest(param);\n if ((index < signature.params.length || hasRestParam(signature.params)) && test(args[index])) {\n nextMatchingDefs.push(signature);\n }\n });\n if (nextMatchingDefs.length === 0) {\n // no matching signatures anymore, throw error \"wrong type\"\n expected = mergeExpectedParams(matchingSignatures, index);\n if (expected.length > 0) {\n const actualTypes = findTypeNames(args[index]);\n err = new TypeError('Unexpected type of argument in function ' + _name + ' (expected: ' + expected.join(' or ') + ', actual: ' + actualTypes.join(' | ') + ', index: ' + index + ')');\n err.data = {\n category: 'wrongType',\n fn: _name,\n index,\n actual: actualTypes,\n expected\n };\n return err;\n }\n } else {\n matchingSignatures = nextMatchingDefs;\n }\n }\n\n // test for too few arguments\n const lengths = matchingSignatures.map(function (signature) {\n return hasRestParam(signature.params) ? Infinity : signature.params.length;\n });\n if (args.length < Math.min.apply(null, lengths)) {\n expected = mergeExpectedParams(matchingSignatures, index);\n err = new TypeError('Too few arguments in function ' + _name + ' (expected: ' + expected.join(' or ') + ', index: ' + args.length + ')');\n err.data = {\n category: 'tooFewArgs',\n fn: _name,\n index: args.length,\n expected\n };\n return err;\n }\n\n // test for too many arguments\n const maxLength = Math.max.apply(null, lengths);\n if (args.length > maxLength) {\n err = new TypeError('Too many arguments in function ' + _name + ' (expected: ' + maxLength + ', actual: ' + args.length + ')');\n err.data = {\n category: 'tooManyArgs',\n fn: _name,\n index: args.length,\n expectedLength: maxLength\n };\n return err;\n }\n\n // Generic error\n const argTypes = [];\n for (let i = 0; i < args.length; ++i) {\n argTypes.push(findTypeNames(args[i]).join('|'));\n }\n err = new TypeError('Arguments of type \"' + argTypes.join(', ') + '\" do not match any of the defined signatures of function ' + _name + '.');\n err.data = {\n category: 'mismatch',\n actual: argTypes\n };\n return err;\n }\n\n /**\n * Find the lowest index of all exact types of a parameter (no conversions)\n * @param {Param} param\n * @return {number} Returns the index of the lowest type in typed.types\n */\n function getLowestTypeIndex(param) {\n let min = typeList.length + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].typeIndex);\n }\n }\n return min;\n }\n\n /**\n * Find the lowest index of the conversion of all types of the parameter\n * having a conversion\n * @param {Param} param\n * @return {number} Returns the lowest index of the conversions of this type\n */\n function getLowestConversionIndex(param) {\n let min = nConversions + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (!isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].conversionIndex);\n }\n }\n return min;\n }\n\n /**\n * Compare two params\n * @param {Param} param1\n * @param {Param} param2\n * @return {number} returns -1 when param1 must get a lower\n * index than param2, 1 when the opposite,\n * or zero when both are equal\n */\n function compareParams(param1, param2) {\n // We compare a number of metrics on a param in turn:\n // 1) 'any' parameters are the least preferred\n if (param1.hasAny) {\n if (!param2.hasAny) {\n return 1;\n }\n } else if (param2.hasAny) {\n return -1;\n }\n\n // 2) Prefer non-rest to rest parameters\n if (param1.restParam) {\n if (!param2.restParam) {\n return 1;\n }\n } else if (param2.restParam) {\n return -1;\n }\n\n // 3) Prefer exact type match to conversions\n if (param1.hasConversion) {\n if (!param2.hasConversion) {\n return 1;\n }\n } else if (param2.hasConversion) {\n return -1;\n }\n\n // 4) Prefer lower type index:\n const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2);\n if (typeDiff < 0) {\n return -1;\n }\n if (typeDiff > 0) {\n return 1;\n }\n\n // 5) Prefer lower conversion index\n const convDiff = getLowestConversionIndex(param1) - getLowestConversionIndex(param2);\n if (convDiff < 0) {\n return -1;\n }\n if (convDiff > 0) {\n return 1;\n }\n\n // Don't have a basis for preference\n return 0;\n }\n\n /**\n * Compare two signatures\n * @param {Signature} signature1\n * @param {Signature} signature2\n * @return {number} returns a negative number when param1 must get a lower\n * index than param2, a positive number when the opposite,\n * or zero when both are equal\n */\n function compareSignatures(signature1, signature2) {\n const pars1 = signature1.params;\n const pars2 = signature2.params;\n const last1 = last(pars1);\n const last2 = last(pars2);\n const hasRest1 = hasRestParam(pars1);\n const hasRest2 = hasRestParam(pars2);\n // We compare a number of metrics on signatures in turn:\n // 1) An \"any rest param\" is least preferred\n if (hasRest1 && last1.hasAny) {\n if (!hasRest2 || !last2.hasAny) {\n return 1;\n }\n } else if (hasRest2 && last2.hasAny) {\n return -1;\n }\n\n // 2) Minimize the number of 'any' parameters\n let any1 = 0;\n let conv1 = 0;\n let par;\n for (par of pars1) {\n if (par.hasAny) ++any1;\n if (par.hasConversion) ++conv1;\n }\n let any2 = 0;\n let conv2 = 0;\n for (par of pars2) {\n if (par.hasAny) ++any2;\n if (par.hasConversion) ++conv2;\n }\n if (any1 !== any2) {\n return any1 - any2;\n }\n\n // 3) A conversion rest param is less preferred\n if (hasRest1 && last1.hasConversion) {\n if (!hasRest2 || !last2.hasConversion) {\n return 1;\n }\n } else if (hasRest2 && last2.hasConversion) {\n return -1;\n }\n\n // 4) Minimize the number of conversions\n if (conv1 !== conv2) {\n return conv1 - conv2;\n }\n\n // 5) Prefer no rest param\n if (hasRest1) {\n if (!hasRest2) {\n return 1;\n }\n } else if (hasRest2) {\n return -1;\n }\n\n // 6) Prefer shorter with rest param, longer without\n const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -1 : 1);\n if (lengthCriterion !== 0) {\n return lengthCriterion;\n }\n\n // Signatures are identical in each of the above metrics.\n // In particular, they are the same length.\n // We can therefore compare the parameters one by one.\n // First we count which signature has more preferred parameters.\n const comparisons = [];\n let tc = 0;\n for (let i = 0; i < pars1.length; ++i) {\n const thisComparison = compareParams(pars1[i], pars2[i]);\n comparisons.push(thisComparison);\n tc += thisComparison;\n }\n if (tc !== 0) {\n return tc;\n }\n\n // They have the same number of preferred parameters, so go by the\n // earliest parameter in which we have a preference.\n // In other words, dispatch is driven somewhat more by earlier\n // parameters than later ones.\n let c;\n for (c of comparisons) {\n if (c !== 0) {\n return c;\n }\n }\n\n // It's a tossup:\n return 0;\n }\n\n /**\n * Produce a list of all conversions from distinct types to one of\n * the given types.\n *\n * @param {string[]} typeNames\n * @return {ConversionDef[]} Returns the conversions that are available\n * resulting in any given type (if any)\n */\n function availableConversions(typeNames) {\n if (typeNames.length === 0) {\n return [];\n }\n const types = typeNames.map(findType);\n if (typeNames.length > 1) {\n types.sort((t1, t2) => t1.index - t2.index);\n }\n let matches = types[0].conversionsTo;\n if (typeNames.length === 1) {\n return matches;\n }\n matches = matches.concat([]); // shallow copy the matches\n // Since the types are now in index order, we just want the first\n // occurrence of any from type:\n const knownTypes = new Set(typeNames);\n for (let i = 1; i < types.length; ++i) {\n let newMatch;\n for (newMatch of types[i].conversionsTo) {\n if (!knownTypes.has(newMatch.from)) {\n matches.push(newMatch);\n knownTypes.add(newMatch.from);\n }\n }\n }\n return matches;\n }\n\n /**\n * Preprocess arguments before calling the original function:\n * - if needed convert the parameters\n * - in case of rest parameters, move the rest parameters into an Array\n * @param {Param[]} params\n * @param {function} fn\n * @return {function} Returns a wrapped function\n */\n function compileArgsPreprocessing(params, fn) {\n let fnConvert = fn;\n\n // TODO: can we make this wrapper function smarter/simpler?\n\n if (params.some(p => p.hasConversion)) {\n const restParam = hasRestParam(params);\n const compiledConversions = params.map(compileArgConversion);\n fnConvert = function convertArgs() {\n const args = [];\n const last = restParam ? arguments.length - 1 : arguments.length;\n for (let i = 0; i < last; i++) {\n args[i] = compiledConversions[i](arguments[i]);\n }\n if (restParam) {\n args[last] = arguments[last].map(compiledConversions[last]);\n }\n return fn.apply(this, args);\n };\n }\n let fnPreprocess = fnConvert;\n if (hasRestParam(params)) {\n const offset = params.length - 1;\n fnPreprocess = function preprocessRestParams() {\n return fnConvert.apply(this, slice(arguments, 0, offset).concat([slice(arguments, offset)]));\n };\n }\n return fnPreprocess;\n }\n\n /**\n * Compile conversion for a parameter to the right type\n * @param {Param} param\n * @return {function} Returns the wrapped function that will convert arguments\n *\n */\n function compileArgConversion(param) {\n let test0, test1, conversion0, conversion1;\n const tests = [];\n const conversions = [];\n param.types.forEach(function (type) {\n if (type.conversion) {\n tests.push(findType(type.conversion.from).test);\n conversions.push(type.conversion.convert);\n }\n });\n\n // create optimized conversion functions depending on the number of conversions\n switch (conversions.length) {\n case 0:\n return function convertArg(arg) {\n return arg;\n };\n case 1:\n test0 = tests[0];\n conversion0 = conversions[0];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n return arg;\n };\n case 2:\n test0 = tests[0];\n test1 = tests[1];\n conversion0 = conversions[0];\n conversion1 = conversions[1];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n if (test1(arg)) {\n return conversion1(arg);\n }\n return arg;\n };\n default:\n return function convertArg(arg) {\n for (let i = 0; i < conversions.length; i++) {\n if (tests[i](arg)) {\n return conversions[i](arg);\n }\n }\n return arg;\n };\n }\n }\n\n /**\n * Split params with union types in to separate params.\n *\n * For example:\n *\n * splitParams([['Array', 'Object'], ['string', 'RegExp'])\n * // returns:\n * // [\n * // ['Array', 'string'],\n * // ['Array', 'RegExp'],\n * // ['Object', 'string'],\n * // ['Object', 'RegExp']\n * // ]\n *\n * @param {Param[]} params\n * @return {Param[]}\n */\n function splitParams(params) {\n function _splitParams(params, index, paramsSoFar) {\n if (index < params.length) {\n const param = params[index];\n let resultingParams = [];\n if (param.restParam) {\n // split the types of a rest parameter in two:\n // one with only exact types, and one with exact types and conversions\n const exactTypes = param.types.filter(isExactType);\n if (exactTypes.length < param.types.length) {\n resultingParams.push({\n types: exactTypes,\n name: '...' + exactTypes.map(t => t.name).join('|'),\n hasAny: exactTypes.some(t => t.isAny),\n hasConversion: false,\n restParam: true\n });\n }\n resultingParams.push(param);\n } else {\n // split all the types of a regular parameter into one type per param\n resultingParams = param.types.map(function (type) {\n return {\n types: [type],\n name: type.name,\n hasAny: type.isAny,\n hasConversion: type.conversion,\n restParam: false\n };\n });\n }\n\n // recurse over the groups with types\n return flatMap(resultingParams, function (nextParam) {\n return _splitParams(params, index + 1, paramsSoFar.concat([nextParam]));\n });\n } else {\n // we've reached the end of the parameters.\n return [paramsSoFar];\n }\n }\n return _splitParams(params, 0, []);\n }\n\n /**\n * Test whether two param lists represent conflicting signatures\n * @param {Param[]} params1\n * @param {Param[]} params2\n * @return {boolean} Returns true when the signatures conflict, false otherwise.\n */\n function conflicting(params1, params2) {\n const ii = Math.max(params1.length, params2.length);\n for (let i = 0; i < ii; i++) {\n const typeSet1 = getTypeSetAtIndex(params1, i);\n const typeSet2 = getTypeSetAtIndex(params2, i);\n let overlap = false;\n let name;\n for (name of typeSet2) {\n if (typeSet1.has(name)) {\n overlap = true;\n break;\n }\n }\n if (!overlap) {\n return false;\n }\n }\n const len1 = params1.length;\n const len2 = params2.length;\n const restParam1 = hasRestParam(params1);\n const restParam2 = hasRestParam(params2);\n return restParam1 ? restParam2 ? len1 === len2 : len2 >= len1 : restParam2 ? len1 >= len2 : len1 === len2;\n }\n\n /**\n * Helper function for `resolveReferences` that returns a copy of\n * functionList wihe any prior resolutions cleared out, in case we are\n * recycling signatures from a prior typed function construction.\n *\n * @param {Array.} functionList\n * @return {Array.}\n */\n function clearResolutions(functionList) {\n return functionList.map(fn => {\n if (isReferToSelf(fn)) {\n return referToSelf(fn.referToSelf.callback);\n }\n if (isReferTo(fn)) {\n return makeReferTo(fn.referTo.references, fn.referTo.callback);\n }\n return fn;\n });\n }\n\n /**\n * Take a list of references, a list of functions functionList, and a\n * signatureMap indexing signatures into functionList, and return\n * the list of resolutions, or a false-y value if they don't all\n * resolve in a valid way (yet).\n *\n * @param {string[]} references\n * @param {Array} signatureMap\n * @return {function[] | false} resolutions\n */\n function collectResolutions(references, functionList, signatureMap) {\n const resolvedReferences = [];\n let reference;\n for (reference of references) {\n let resolution = signatureMap[reference];\n if (typeof resolution !== 'number') {\n throw new TypeError('No definition for referenced signature \"' + reference + '\"');\n }\n resolution = functionList[resolution];\n if (typeof resolution !== 'function') {\n return false;\n }\n resolvedReferences.push(resolution);\n }\n return resolvedReferences;\n }\n\n /**\n * Resolve any references in the functionList for the typed function\n * itself. The signatureMap tells which index in the functionList a\n * given signature should be mapped to (for use in resolving typed.referTo)\n * and self provides the destions of a typed.referToSelf.\n *\n * @param {Array} functionList\n * @param {Object.} signatureMap\n * @param {function} self The typed-function itself\n * @return {Array} The list of resolved functions\n */\n function resolveReferences(functionList, signatureMap, self) {\n const resolvedFunctions = clearResolutions(functionList);\n const isResolved = new Array(resolvedFunctions.length).fill(false);\n let leftUnresolved = true;\n while (leftUnresolved) {\n leftUnresolved = false;\n let nothingResolved = true;\n for (let i = 0; i < resolvedFunctions.length; ++i) {\n if (isResolved[i]) continue;\n const fn = resolvedFunctions[i];\n if (isReferToSelf(fn)) {\n resolvedFunctions[i] = fn.referToSelf.callback(self);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referToSelf = fn.referToSelf;\n isResolved[i] = true;\n nothingResolved = false;\n } else if (isReferTo(fn)) {\n const resolvedReferences = collectResolutions(fn.referTo.references, resolvedFunctions, signatureMap);\n if (resolvedReferences) {\n resolvedFunctions[i] = fn.referTo.callback.apply(this, resolvedReferences);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referTo = fn.referTo;\n isResolved[i] = true;\n nothingResolved = false;\n } else {\n leftUnresolved = true;\n }\n }\n }\n if (nothingResolved && leftUnresolved) {\n throw new SyntaxError('Circular reference detected in resolving typed.referTo');\n }\n }\n return resolvedFunctions;\n }\n\n /**\n * Validate whether any of the function bodies contains a self-reference\n * usage like `this(...)` or `this.signatures`. This self-referencing is\n * deprecated since typed-function v3. It has been replaced with\n * the functions typed.referTo and typed.referToSelf.\n * @param {Object.} signaturesMap\n */\n function validateDeprecatedThis(signaturesMap) {\n // TODO: remove this deprecation warning logic some day (it's introduced in v3)\n\n // match occurrences like 'this(' and 'this.signatures'\n const deprecatedThisRegex = /\\bthis(\\(|\\.signatures\\b)/;\n Object.keys(signaturesMap).forEach(signature => {\n const fn = signaturesMap[signature];\n if (deprecatedThisRegex.test(fn.toString())) {\n throw new SyntaxError('Using `this` to self-reference a function ' + 'is deprecated since typed-function@3. ' + 'Use typed.referTo and typed.referToSelf instead.');\n }\n });\n }\n\n /**\n * Create a typed function\n * @param {String} name The name for the typed function\n * @param {Object.} rawSignaturesMap\n * An object with one or\n * multiple signatures as key, and the\n * function corresponding to the\n * signature as value.\n * @return {function} Returns the created typed function.\n */\n function createTypedFunction(name, rawSignaturesMap) {\n typed.createCount++;\n if (Object.keys(rawSignaturesMap).length === 0) {\n throw new SyntaxError('No signatures provided');\n }\n if (typed.warnAgainstDeprecatedThis) {\n validateDeprecatedThis(rawSignaturesMap);\n }\n\n // Main processing loop for signatures\n const parsedParams = [];\n const originalFunctions = [];\n const signaturesMap = {};\n const preliminarySignatures = []; // may have duplicates from conversions\n let signature;\n for (signature in rawSignaturesMap) {\n // A) Protect against polluted Object prototype:\n if (!Object.prototype.hasOwnProperty.call(rawSignaturesMap, signature)) {\n continue;\n }\n // B) Parse the signature\n const params = parseSignature(signature);\n if (!params) continue;\n // C) Check for conflicts\n parsedParams.forEach(function (pp) {\n if (conflicting(pp, params)) {\n throw new TypeError('Conflicting signatures \"' + stringifyParams(pp) + '\" and \"' + stringifyParams(params) + '\".');\n }\n });\n parsedParams.push(params);\n // D) Store the provided function and add conversions\n const functionIndex = originalFunctions.length;\n originalFunctions.push(rawSignaturesMap[signature]);\n const conversionParams = params.map(expandParam);\n // E) Split the signatures and collect them up\n let sp;\n for (sp of splitParams(conversionParams)) {\n const spName = stringifyParams(sp);\n preliminarySignatures.push({\n params: sp,\n name: spName,\n fn: functionIndex\n });\n if (sp.every(p => !p.hasConversion)) {\n signaturesMap[spName] = functionIndex;\n }\n }\n }\n preliminarySignatures.sort(compareSignatures);\n\n // Note the forward reference to theTypedFn\n const resolvedFunctions = resolveReferences(originalFunctions, signaturesMap, theTypedFn);\n\n // Fill in the proper function for each signature\n let s;\n for (s in signaturesMap) {\n if (Object.prototype.hasOwnProperty.call(signaturesMap, s)) {\n signaturesMap[s] = resolvedFunctions[signaturesMap[s]];\n }\n }\n const signatures = [];\n const internalSignatureMap = new Map(); // benchmarks faster than object\n for (s of preliminarySignatures) {\n // Note it's only safe to eliminate duplicates like this\n // _after_ the signature sorting step above; otherwise we might\n // remove the wrong one.\n if (!internalSignatureMap.has(s.name)) {\n s.fn = resolvedFunctions[s.fn];\n signatures.push(s);\n internalSignatureMap.set(s.name, s);\n }\n }\n\n // we create a highly optimized checks for the first couple of signatures with max 2 arguments\n const ok0 = signatures[0] && signatures[0].params.length <= 2 && !hasRestParam(signatures[0].params);\n const ok1 = signatures[1] && signatures[1].params.length <= 2 && !hasRestParam(signatures[1].params);\n const ok2 = signatures[2] && signatures[2].params.length <= 2 && !hasRestParam(signatures[2].params);\n const ok3 = signatures[3] && signatures[3].params.length <= 2 && !hasRestParam(signatures[3].params);\n const ok4 = signatures[4] && signatures[4].params.length <= 2 && !hasRestParam(signatures[4].params);\n const ok5 = signatures[5] && signatures[5].params.length <= 2 && !hasRestParam(signatures[5].params);\n const allOk = ok0 && ok1 && ok2 && ok3 && ok4 && ok5;\n\n // compile the tests\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].test = compileTests(signatures[i].params);\n }\n const test00 = ok0 ? compileTest(signatures[0].params[0]) : notOk;\n const test10 = ok1 ? compileTest(signatures[1].params[0]) : notOk;\n const test20 = ok2 ? compileTest(signatures[2].params[0]) : notOk;\n const test30 = ok3 ? compileTest(signatures[3].params[0]) : notOk;\n const test40 = ok4 ? compileTest(signatures[4].params[0]) : notOk;\n const test50 = ok5 ? compileTest(signatures[5].params[0]) : notOk;\n const test01 = ok0 ? compileTest(signatures[0].params[1]) : notOk;\n const test11 = ok1 ? compileTest(signatures[1].params[1]) : notOk;\n const test21 = ok2 ? compileTest(signatures[2].params[1]) : notOk;\n const test31 = ok3 ? compileTest(signatures[3].params[1]) : notOk;\n const test41 = ok4 ? compileTest(signatures[4].params[1]) : notOk;\n const test51 = ok5 ? compileTest(signatures[5].params[1]) : notOk;\n\n // compile the functions\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].implementation = compileArgsPreprocessing(signatures[i].params, signatures[i].fn);\n }\n const fn0 = ok0 ? signatures[0].implementation : undef;\n const fn1 = ok1 ? signatures[1].implementation : undef;\n const fn2 = ok2 ? signatures[2].implementation : undef;\n const fn3 = ok3 ? signatures[3].implementation : undef;\n const fn4 = ok4 ? signatures[4].implementation : undef;\n const fn5 = ok5 ? signatures[5].implementation : undef;\n const len0 = ok0 ? signatures[0].params.length : -1;\n const len1 = ok1 ? signatures[1].params.length : -1;\n const len2 = ok2 ? signatures[2].params.length : -1;\n const len3 = ok3 ? signatures[3].params.length : -1;\n const len4 = ok4 ? signatures[4].params.length : -1;\n const len5 = ok5 ? signatures[5].params.length : -1;\n\n // simple and generic, but also slow\n const iStart = allOk ? 6 : 0;\n const iEnd = signatures.length;\n // de-reference ahead for execution speed:\n const tests = signatures.map(s => s.test);\n const fns = signatures.map(s => s.implementation);\n const generic = function generic() {\n 'use strict';\n\n for (let i = iStart; i < iEnd; i++) {\n if (tests[i](arguments)) {\n return fns[i].apply(this, arguments);\n }\n }\n return typed.onMismatch(name, arguments, signatures);\n };\n\n // create the typed function\n // fast, specialized version. Falls back to the slower, generic one if needed\n function theTypedFn(arg0, arg1) {\n 'use strict';\n\n if (arguments.length === len0 && test00(arg0) && test01(arg1)) {\n return fn0.apply(this, arguments);\n }\n if (arguments.length === len1 && test10(arg0) && test11(arg1)) {\n return fn1.apply(this, arguments);\n }\n if (arguments.length === len2 && test20(arg0) && test21(arg1)) {\n return fn2.apply(this, arguments);\n }\n if (arguments.length === len3 && test30(arg0) && test31(arg1)) {\n return fn3.apply(this, arguments);\n }\n if (arguments.length === len4 && test40(arg0) && test41(arg1)) {\n return fn4.apply(this, arguments);\n }\n if (arguments.length === len5 && test50(arg0) && test51(arg1)) {\n return fn5.apply(this, arguments);\n }\n return generic.apply(this, arguments);\n }\n\n // attach name the typed function\n try {\n Object.defineProperty(theTypedFn, 'name', {\n value: name\n });\n } catch (err) {\n // old browsers do not support Object.defineProperty and some don't support setting the name property\n // the function name is not essential for the functioning, it's mostly useful for debugging,\n // so it's fine to have unnamed functions.\n }\n\n // attach signatures to the function.\n // This property is close to the original collection of signatures\n // used to create the typed-function, just with unions split:\n theTypedFn.signatures = signaturesMap;\n\n // Store internal data for functions like resolve, find, etc.\n // Also serves as the flag that this is a typed-function\n theTypedFn._typedFunctionData = {\n signatures,\n signatureMap: internalSignatureMap\n };\n return theTypedFn;\n }\n\n /**\n * Action to take on mismatch\n * @param {string} name Name of function that was attempted to be called\n * @param {Array} args Actual arguments to the call\n * @param {Array} signatures Known signatures of the named typed-function\n */\n function _onMismatch(name, args, signatures) {\n throw createError(name, args, signatures);\n }\n\n /**\n * Return all but the last items of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {Array}\n */\n function initial(arr) {\n return slice(arr, 0, arr.length - 1);\n }\n\n /**\n * return the last item of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {*}\n */\n function last(arr) {\n return arr[arr.length - 1];\n }\n\n /**\n * Slice an array or function Arguments\n * @param {Array | Arguments | IArguments} arr\n * @param {number} start\n * @param {number} [end]\n * @return {Array}\n */\n function slice(arr, start, end) {\n return Array.prototype.slice.call(arr, start, end);\n }\n\n /**\n * Return the first item from an array for which test(arr[i]) returns true\n * @param {Array} arr\n * @param {function} test\n * @return {* | undefined} Returns the first matching item\n * or undefined when there is no match\n */\n function findInArray(arr, test) {\n for (let i = 0; i < arr.length; i++) {\n if (test(arr[i])) {\n return arr[i];\n }\n }\n return undefined;\n }\n\n /**\n * Flat map the result invoking a callback for every item in an array.\n * https://gist.github.com/samgiles/762ee337dff48623e729\n * @param {Array} arr\n * @param {function} callback\n * @return {Array}\n */\n function flatMap(arr, callback) {\n return Array.prototype.concat.apply([], arr.map(callback));\n }\n\n /**\n * Create a reference callback to one or multiple signatures\n *\n * Syntax:\n *\n * typed.referTo(signature1, signature2, ..., function callback(fn1, fn2, ...) {\n * // ...\n * })\n *\n * @returns {{referTo: {references: string[], callback}}}\n */\n function referTo() {\n const references = initial(arguments).map(s => stringifyParams(parseSignature(s)));\n const callback = last(arguments);\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as last argument');\n }\n return makeReferTo(references, callback);\n }\n function makeReferTo(references, callback) {\n return {\n referTo: {\n references,\n callback\n }\n };\n }\n\n /**\n * Create a reference callback to the typed-function itself\n *\n * @param {(self: function) => function} callback\n * @returns {{referToSelf: { callback: function }}}\n */\n function referToSelf(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as first argument');\n }\n return {\n referToSelf: {\n callback\n }\n };\n }\n\n /**\n * Test whether something is a referTo object, holding a list with reference\n * signatures and a callback.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferTo(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referTo === 'object' && Array.isArray(objectOrFn.referTo.references) && typeof objectOrFn.referTo.callback === 'function';\n }\n\n /**\n * Test whether something is a referToSelf object, holding a callback where\n * to pass `self`.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferToSelf(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referToSelf === 'object' && typeof objectOrFn.referToSelf.callback === 'function';\n }\n\n /**\n * Check if name is (A) new, (B) a match, or (C) a mismatch; and throw\n * an error in case (C).\n *\n * @param { string | undefined } nameSoFar\n * @param { string | undefined } newName\n * @returns { string } updated name\n */\n function checkName(nameSoFar, newName) {\n if (!nameSoFar) {\n return newName;\n }\n if (newName && newName !== nameSoFar) {\n const err = new Error('Function names do not match (expected: ' + nameSoFar + ', actual: ' + newName + ')');\n err.data = {\n actual: newName,\n expected: nameSoFar\n };\n throw err;\n }\n return nameSoFar;\n }\n\n /**\n * Retrieve the implied name from an object with signature keys\n * and function values, checking whether all value names match\n *\n * @param { {string: function} } obj\n */\n function getObjectName(obj) {\n let name;\n for (const key in obj) {\n // Only pay attention to own properties, and only if their values\n // are typed functions or functions with a signature property\n if (Object.prototype.hasOwnProperty.call(obj, key) && (isTypedFunction(obj[key]) || typeof obj[key].signature === 'string')) {\n name = checkName(name, obj[key].name);\n }\n }\n return name;\n }\n\n /**\n * Copy all of the signatures from the second argument into the first,\n * which is modified by side effect, checking for conflicts\n *\n * @param {Object.} dest\n * @param {Object.} source\n */\n function mergeSignatures(dest, source) {\n let key;\n for (key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (key in dest) {\n if (source[key] !== dest[key]) {\n const err = new Error('Signature \"' + key + '\" is defined twice');\n err.data = {\n signature: key,\n sourceFunction: source[key],\n destFunction: dest[key]\n };\n throw err;\n }\n // else: both signatures point to the same function, that's fine\n }\n dest[key] = source[key];\n }\n }\n }\n const saveTyped = typed;\n\n /**\n * Originally the main function was a typed function itself, but then\n * it might not be able to generate error messages if the client\n * replaced the type system with different names.\n *\n * Main entry: typed([name], functions/objects with signatures...)\n *\n * Assembles and returns a new typed-function from the given items\n * that provide signatures and implementations, each of which may be\n * * a plain object mapping (string) signatures to implementing functions,\n * * a previously constructed typed function, or\n * * any other single function with a string-valued property `signature`.\n * The name of the resulting typed-function will be given by the\n * string-valued name argument if present, or if not, by the name\n * of any of the arguments that have one, as long as any that do are\n * consistent with each other. If no name is specified, the name will be\n * an empty string.\n *\n * @param {string} maybeName [optional]\n * @param {(function|object)[]} signature providers\n * @returns {typed-function}\n */\n typed = function (maybeName) {\n const named = typeof maybeName === 'string';\n const start = named ? 1 : 0;\n let name = named ? maybeName : '';\n const allSignatures = {};\n for (let i = start; i < arguments.length; ++i) {\n const item = arguments[i];\n let theseSignatures = {};\n let thisName;\n if (typeof item === 'function') {\n thisName = item.name;\n if (typeof item.signature === 'string') {\n // Case 1: Ordinary function with a string 'signature' property\n theseSignatures[item.signature] = item;\n } else if (isTypedFunction(item)) {\n // Case 2: Existing typed function\n theseSignatures = item.signatures;\n }\n } else if (isPlainObject(item)) {\n // Case 3: Plain object, assume keys = signatures, values = functions\n theseSignatures = item;\n if (!named) {\n thisName = getObjectName(item);\n }\n }\n if (Object.keys(theseSignatures).length === 0) {\n const err = new TypeError('Argument to \\'typed\\' at index ' + i + ' is not a (typed) function, ' + 'nor an object with signatures as keys and functions as values.');\n err.data = {\n index: i,\n argument: item\n };\n throw err;\n }\n if (!named) {\n name = checkName(name, thisName);\n }\n mergeSignatures(allSignatures, theseSignatures);\n }\n return createTypedFunction(name || '', allSignatures);\n };\n typed.create = create;\n typed.createCount = saveTyped.createCount;\n typed.onMismatch = _onMismatch;\n typed.throwMismatchError = _onMismatch;\n typed.createError = createError;\n typed.clear = clear;\n typed.clearConversions = clearConversions;\n typed.addTypes = addTypes;\n typed._findType = findType; // For unit testing only\n typed.referTo = referTo;\n typed.referToSelf = referToSelf;\n typed.convert = convert;\n typed.findSignature = findSignature;\n typed.find = find;\n typed.isTypedFunction = isTypedFunction;\n typed.warnAgainstDeprecatedThis = true;\n\n /**\n * add a type (convenience wrapper for typed.addTypes)\n * @param {{name: string, test: function}} type\n * @param {boolean} [beforeObjectTest=true]\n * If true, the new test will be inserted before\n * the test with name 'Object' (if any), since\n * tests for Object match Array and classes too.\n */\n typed.addType = function (type, beforeObjectTest) {\n let before = 'any';\n if (beforeObjectTest !== false && typeMap.has('Object')) {\n before = 'Object';\n }\n typed.addTypes([type], before);\n };\n\n /**\n * Verify that the ConversionDef conversion has a valid format.\n *\n * @param {conversionDef} conversion\n * @return {void}\n * @throws {TypeError|SyntaxError}\n */\n function _validateConversion(conversion) {\n if (!conversion || typeof conversion.from !== 'string' || typeof conversion.to !== 'string' || typeof conversion.convert !== 'function') {\n throw new TypeError('Object with properties {from: string, to: string, convert: function} expected');\n }\n if (conversion.to === conversion.from) {\n throw new SyntaxError('Illegal to define conversion from \"' + conversion.from + '\" to itself.');\n }\n }\n\n /**\n * Add a conversion\n *\n * @param {ConversionDef} conversion\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversion = function (conversion) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n override: false\n };\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existing = to.conversionsTo.find(other => other.from === conversion.from);\n if (existing) {\n if (options && options.override) {\n typed.removeConversion({\n from: existing.from,\n to: conversion.to,\n convert: existing.convert\n });\n } else {\n throw new Error('There is already a conversion from \"' + conversion.from + '\" to \"' + to.name + '\"');\n }\n }\n to.conversionsTo.push({\n from: conversion.from,\n convert: conversion.convert,\n index: nConversions++\n });\n };\n\n /**\n * Convenience wrapper to call addConversion on each conversion in a list.\n *\n * @param {ConversionDef[]} conversions\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversions = function (conversions, options) {\n conversions.forEach(conversion => typed.addConversion(conversion, options));\n };\n\n /**\n * Remove the specified conversion. The format is the same as for\n * addConversion, and the convert function must match or an error\n * is thrown.\n *\n * @param {{from: string, to: string, convert: function}} conversion\n * @returns {void}\n * @throws {TypeError|SyntaxError|Error}\n */\n typed.removeConversion = function (conversion) {\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existingConversion = findInArray(to.conversionsTo, c => c.from === conversion.from);\n if (!existingConversion) {\n throw new Error('Attempt to remove nonexistent conversion from ' + conversion.from + ' to ' + conversion.to);\n }\n if (existingConversion.convert !== conversion.convert) {\n throw new Error('Conversion to remove does not match existing conversion');\n }\n const index = to.conversionsTo.indexOf(existingConversion);\n to.conversionsTo.splice(index, 1);\n };\n\n /**\n * Produce the specific signature that a typed function\n * will execute on the given arguments. Here, a \"signature\" is an\n * object with properties 'params', 'test', 'fn', and 'implementation'.\n * This last property is a function that converts params as necessary\n * and then calls 'fn'. Returns null if there is no matching signature.\n * @param {typed-function} tf\n * @param {any[]} argList\n * @returns {{params: string, test: function, fn: function, implementation: function}}\n */\n typed.resolve = function (tf, argList) {\n if (!isTypedFunction(tf)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n const sigs = tf._typedFunctionData.signatures;\n for (let i = 0; i < sigs.length; ++i) {\n if (sigs[i].test(argList)) {\n return sigs[i];\n }\n }\n return null;\n };\n return typed;\n}\nexport default create();\n//# sourceMappingURL=typed-function.mjs.map", "/**\n * @license Complex.js v2.1.1 12/05/2020\n *\n * Copyright (c) 2020, Robert Eisele (robert@xarg.org)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n **/\n\n/**\n *\n * This class allows the manipulation of complex numbers.\n * You can pass a complex number in different formats. Either as object, double, string or two integer parameters.\n *\n * Object form\n * { re: , im: }\n * { arg: , abs: }\n * { phi: , r: }\n *\n * Array / Vector form\n * [ real, imaginary ]\n *\n * Double form\n * 99.3 - Single double value\n *\n * String form\n * '23.1337' - Simple real number\n * '15+3i' - a simple complex number\n * '3-i' - a simple complex number\n *\n * Example:\n *\n * var c = new Complex('99.3+8i');\n * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2);\n *\n */\n\n(function(root) {\n\n 'use strict';\n\n var cosh = Math.cosh || function(x) {\n return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5;\n };\n\n var sinh = Math.sinh || function(x) {\n return Math.abs(x) < 1e-9 ? x : (Math.exp(x) - Math.exp(-x)) * 0.5;\n };\n\n /**\n * Calculates cos(x) - 1 using Taylor series if x is small (-\u00BC\u03C0 \u2264 x \u2264 \u00BC\u03C0).\n *\n * @param {number} x\n * @returns {number} cos(x) - 1\n */\n var cosm1 = function(x) {\n\n var b = Math.PI / 4;\n if (-b > x || x > b) {\n return Math.cos(x) - 1.0;\n }\n\n /* Calculate horner form of polynomial of taylor series in Q\n var fac = 1, alt = 1, pol = {};\n for (var i = 0; i <= 16; i++) {\n fac*= i || 1;\n if (i % 2 == 0) {\n pol[i] = new Fraction(1, alt * fac);\n alt = -alt;\n }\n }\n console.log(new Polynomial(pol).toHorner()); // (((((((1/20922789888000x^2-1/87178291200)x^2+1/479001600)x^2-1/3628800)x^2+1/40320)x^2-1/720)x^2+1/24)x^2-1/2)x^2+1\n */\n\n var xx = x * x;\n return xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx / 20922789888000\n - 1 / 87178291200)\n + 1 / 479001600)\n - 1 / 3628800)\n + 1 / 40320)\n - 1 / 720)\n + 1 / 24)\n - 1 / 2);\n };\n\n var hypot = function(x, y) {\n\n var a = Math.abs(x);\n var b = Math.abs(y);\n\n if (a < 3000 && b < 3000) {\n return Math.sqrt(a * a + b * b);\n }\n\n if (a < b) {\n a = b;\n b = x / y;\n } else {\n b = y / x;\n }\n return a * Math.sqrt(1 + b * b);\n };\n\n var parser_exit = function() {\n throw SyntaxError('Invalid Param');\n };\n\n /**\n * Calculates log(sqrt(a^2+b^2)) in a way to avoid overflows\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\n function logHypot(a, b) {\n\n var _a = Math.abs(a);\n var _b = Math.abs(b);\n\n if (a === 0) {\n return Math.log(_b);\n }\n\n if (b === 0) {\n return Math.log(_a);\n }\n\n if (_a < 3000 && _b < 3000) {\n return Math.log(a * a + b * b) * 0.5;\n }\n\n /* I got 4 ideas to compute this property without overflow:\n *\n * Testing 1000000 times with random samples for a,b \u2208 [1, 1000000000] against a big decimal library to get an error estimate\n *\n * 1. Only eliminate the square root: (OVERALL ERROR: 3.9122483030951116e-11)\n\n Math.log(a * a + b * b) / 2\n\n *\n *\n * 2. Try to use the non-overflowing pythagoras: (OVERALL ERROR: 8.889760039210159e-10)\n\n var fn = function(a, b) {\n a = Math.abs(a);\n b = Math.abs(b);\n var t = Math.min(a, b);\n a = Math.max(a, b);\n t = t / a;\n\n return Math.log(a) + Math.log(1 + t * t) / 2;\n };\n\n * 3. Abuse the identity cos(atan(y/x) = x / sqrt(x^2+y^2): (OVERALL ERROR: 3.4780178737037204e-10)\n\n Math.log(a / Math.cos(Math.atan2(b, a)))\n\n * 4. Use 3. and apply log rules: (OVERALL ERROR: 1.2014087502620896e-9)\n\n Math.log(a) - Math.log(Math.cos(Math.atan2(b, a)))\n\n */\n\n a = a / 2;\n b = b / 2;\n\n return 0.5 * Math.log(a * a + b * b) + Math.LN2;\n }\n\n var parse = function(a, b) {\n\n var z = { 're': 0, 'im': 0 };\n\n if (a === undefined || a === null) {\n z['re'] =\n z['im'] = 0;\n } else if (b !== undefined) {\n z['re'] = a;\n z['im'] = b;\n } else\n switch (typeof a) {\n\n case 'object':\n\n if ('im' in a && 're' in a) {\n z['re'] = a['re'];\n z['im'] = a['im'];\n } else if ('abs' in a && 'arg' in a) {\n if (!Number.isFinite(a['abs']) && Number.isFinite(a['arg'])) {\n return Complex['INFINITY'];\n }\n z['re'] = a['abs'] * Math.cos(a['arg']);\n z['im'] = a['abs'] * Math.sin(a['arg']);\n } else if ('r' in a && 'phi' in a) {\n if (!Number.isFinite(a['r']) && Number.isFinite(a['phi'])) {\n return Complex['INFINITY'];\n }\n z['re'] = a['r'] * Math.cos(a['phi']);\n z['im'] = a['r'] * Math.sin(a['phi']);\n } else if (a.length === 2) { // Quick array check\n z['re'] = a[0];\n z['im'] = a[1];\n } else {\n parser_exit();\n }\n break;\n\n case 'string':\n\n z['im'] = /* void */\n z['re'] = 0;\n\n var tokens = a.match(/\\d+\\.?\\d*e[+-]?\\d+|\\d+\\.?\\d*|\\.\\d+|./g);\n var plus = 1;\n var minus = 0;\n\n if (tokens === null) {\n parser_exit();\n }\n\n for (var i = 0; i < tokens.length; i++) {\n\n var c = tokens[i];\n\n if (c === ' ' || c === '\\t' || c === '\\n') {\n /* void */\n } else if (c === '+') {\n plus++;\n } else if (c === '-') {\n minus++;\n } else if (c === 'i' || c === 'I') {\n\n if (plus + minus === 0) {\n parser_exit();\n }\n\n if (tokens[i + 1] !== ' ' && !isNaN(tokens[i + 1])) {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + tokens[i + 1]);\n i++;\n } else {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + '1');\n }\n plus = minus = 0;\n\n } else {\n\n if (plus + minus === 0 || isNaN(c)) {\n parser_exit();\n }\n\n if (tokens[i + 1] === 'i' || tokens[i + 1] === 'I') {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + c);\n i++;\n } else {\n z['re'] += parseFloat((minus % 2 ? '-' : '') + c);\n }\n plus = minus = 0;\n }\n }\n\n // Still something on the stack\n if (plus + minus > 0) {\n parser_exit();\n }\n break;\n\n case 'number':\n z['im'] = 0;\n z['re'] = a;\n break;\n\n default:\n parser_exit();\n }\n\n if (isNaN(z['re']) || isNaN(z['im'])) {\n // If a calculation is NaN, we treat it as NaN and don't throw\n //parser_exit();\n }\n\n return z;\n };\n\n /**\n * @constructor\n * @returns {Complex}\n */\n function Complex(a, b) {\n\n if (!(this instanceof Complex)) {\n return new Complex(a, b);\n }\n\n var z = parse(a, b);\n\n this['re'] = z['re'];\n this['im'] = z['im'];\n }\n\n Complex.prototype = {\n\n 're': 0,\n 'im': 0,\n\n /**\n * Calculates the sign of a complex number, which is a normalized complex\n *\n * @returns {Complex}\n */\n 'sign': function() {\n\n var abs = this['abs']();\n\n return new Complex(\n this['re'] / abs,\n this['im'] / abs);\n },\n\n /**\n * Adds two complex numbers\n *\n * @returns {Complex}\n */\n 'add': function(a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity + Infinity = NaN\n if (this['isInfinite']() && z['isInfinite']()) {\n return Complex['NAN'];\n }\n\n // Infinity + z = Infinity { where z != Infinity }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n return new Complex(\n this['re'] + z['re'],\n this['im'] + z['im']);\n },\n\n /**\n * Subtracts two complex numbers\n *\n * @returns {Complex}\n */\n 'sub': function(a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity - Infinity = NaN\n if (this['isInfinite']() && z['isInfinite']()) {\n return Complex['NAN'];\n }\n\n // Infinity - z = Infinity { where z != Infinity }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n return new Complex(\n this['re'] - z['re'],\n this['im'] - z['im']);\n },\n\n /**\n * Multiplies two complex numbers\n *\n * @returns {Complex}\n */\n 'mul': function(a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity * 0 = NaN\n if ((this['isInfinite']() && z['isZero']()) || (this['isZero']() && z['isInfinite']())) {\n return Complex['NAN'];\n }\n\n // Infinity * z = Infinity { where z != 0 }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n // Short circuit for real values\n if (z['im'] === 0 && this['im'] === 0) {\n return new Complex(this['re'] * z['re'], 0);\n }\n\n return new Complex(\n this['re'] * z['re'] - this['im'] * z['im'],\n this['re'] * z['im'] + this['im'] * z['re']);\n },\n\n /**\n * Divides two complex numbers\n *\n * @returns {Complex}\n */\n 'div': function(a, b) {\n\n var z = new Complex(a, b);\n\n // 0 / 0 = NaN and Infinity / Infinity = NaN\n if ((this['isZero']() && z['isZero']()) || (this['isInfinite']() && z['isInfinite']())) {\n return Complex['NAN'];\n }\n\n // Infinity / 0 = Infinity\n if (this['isInfinite']() || z['isZero']()) {\n return Complex['INFINITY'];\n }\n\n // 0 / Infinity = 0\n if (this['isZero']() || z['isInfinite']()) {\n return Complex['ZERO'];\n }\n\n a = this['re'];\n b = this['im'];\n\n var c = z['re'];\n var d = z['im'];\n var t, x;\n\n if (0 === d) {\n // Divisor is real\n return new Complex(a / c, b / c);\n }\n\n if (Math.abs(c) < Math.abs(d)) {\n\n x = c / d;\n t = c * x + d;\n\n return new Complex(\n (a * x + b) / t,\n (b * x - a) / t);\n\n } else {\n\n x = d / c;\n t = d * x + c;\n\n return new Complex(\n (a + b * x) / t,\n (b - a * x) / t);\n }\n },\n\n /**\n * Calculate the power of two complex numbers\n *\n * @returns {Complex}\n */\n 'pow': function(a, b) {\n\n var z = new Complex(a, b);\n\n a = this['re'];\n b = this['im'];\n\n if (z['isZero']()) {\n return Complex['ONE'];\n }\n\n // If the exponent is real\n if (z['im'] === 0) {\n\n if (b === 0 && a > 0) {\n\n return new Complex(Math.pow(a, z['re']), 0);\n\n } else if (a === 0) { // If base is fully imaginary\n\n switch ((z['re'] % 4 + 4) % 4) {\n case 0:\n return new Complex(Math.pow(b, z['re']), 0);\n case 1:\n return new Complex(0, Math.pow(b, z['re']));\n case 2:\n return new Complex(-Math.pow(b, z['re']), 0);\n case 3:\n return new Complex(0, -Math.pow(b, z['re']));\n }\n }\n }\n\n /* I couldn't find a good formula, so here is a derivation and optimization\n *\n * z_1^z_2 = (a + bi)^(c + di)\n * = exp((c + di) * log(a + bi)\n * = pow(a^2 + b^2, (c + di) / 2) * exp(i(c + di)atan2(b, a))\n * =>...\n * Re = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * cos(d * log(a^2 + b^2) / 2 + c * atan2(b, a))\n * Im = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * sin(d * log(a^2 + b^2) / 2 + c * atan2(b, a))\n *\n * =>...\n * Re = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * cos(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a))\n * Im = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * sin(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a))\n *\n * =>\n * Re = exp(c * logsq2 - d * arg(z_1)) * cos(d * logsq2 + c * arg(z_1))\n * Im = exp(c * logsq2 - d * arg(z_1)) * sin(d * logsq2 + c * arg(z_1))\n *\n */\n\n if (a === 0 && b === 0 && z['re'] > 0 && z['im'] >= 0) {\n return Complex['ZERO'];\n }\n\n var arg = Math.atan2(b, a);\n var loh = logHypot(a, b);\n\n a = Math.exp(z['re'] * loh - z['im'] * arg);\n b = z['im'] * loh + z['re'] * arg;\n return new Complex(\n a * Math.cos(b),\n a * Math.sin(b));\n },\n\n /**\n * Calculate the complex square root\n *\n * @returns {Complex}\n */\n 'sqrt': function() {\n\n var a = this['re'];\n var b = this['im'];\n var r = this['abs']();\n\n var re, im;\n\n if (a >= 0) {\n\n if (b === 0) {\n return new Complex(Math.sqrt(a), 0);\n }\n\n re = 0.5 * Math.sqrt(2.0 * (r + a));\n } else {\n re = Math.abs(b) / Math.sqrt(2 * (r - a));\n }\n\n if (a <= 0) {\n im = 0.5 * Math.sqrt(2.0 * (r - a));\n } else {\n im = Math.abs(b) / Math.sqrt(2 * (r + a));\n }\n\n return new Complex(re, b < 0 ? -im : im);\n },\n\n /**\n * Calculate the complex exponent\n *\n * @returns {Complex}\n */\n 'exp': function() {\n\n var tmp = Math.exp(this['re']);\n\n if (this['im'] === 0) {\n //return new Complex(tmp, 0);\n }\n return new Complex(\n tmp * Math.cos(this['im']),\n tmp * Math.sin(this['im']));\n },\n\n /**\n * Calculate the complex exponent and subtracts one.\n *\n * This may be more accurate than `Complex(x).exp().sub(1)` if\n * `x` is small.\n *\n * @returns {Complex}\n */\n 'expm1': function() {\n\n /**\n * exp(a + i*b) - 1\n = exp(a) * (cos(b) + j*sin(b)) - 1\n = expm1(a)*cos(b) + cosm1(b) + j*exp(a)*sin(b)\n */\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.expm1(a) * Math.cos(b) + cosm1(b),\n Math.exp(a) * Math.sin(b));\n },\n\n /**\n * Calculate the natural log\n *\n * @returns {Complex}\n */\n 'log': function() {\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0 && a > 0) {\n //return new Complex(Math.log(a), 0);\n }\n\n return new Complex(\n logHypot(a, b),\n Math.atan2(b, a));\n },\n\n /**\n * Calculate the magnitude of the complex number\n *\n * @returns {number}\n */\n 'abs': function() {\n\n return hypot(this['re'], this['im']);\n },\n\n /**\n * Calculate the angle of the complex number\n *\n * @returns {number}\n */\n 'arg': function() {\n\n return Math.atan2(this['im'], this['re']);\n },\n\n /**\n * Calculate the sine of the complex number\n *\n * @returns {Complex}\n */\n 'sin': function() {\n\n // sin(z) = ( e^iz - e^-iz ) / 2i \n // = sin(a)cosh(b) + i cos(a)sinh(b)\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.sin(a) * cosh(b),\n Math.cos(a) * sinh(b));\n },\n\n /**\n * Calculate the cosine\n *\n * @returns {Complex}\n */\n 'cos': function() {\n\n // cos(z) = ( e^iz + e^-iz ) / 2 \n // = cos(a)cosh(b) - i sin(a)sinh(b)\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.cos(a) * cosh(b),\n -Math.sin(a) * sinh(b));\n },\n\n /**\n * Calculate the tangent\n *\n * @returns {Complex}\n */\n 'tan': function() {\n\n // tan(z) = sin(z) / cos(z) \n // = ( e^iz - e^-iz ) / ( i( e^iz + e^-iz ) )\n // = ( e^2iz - 1 ) / i( e^2iz + 1 )\n // = ( sin(2a) + i sinh(2b) ) / ( cos(2a) + cosh(2b) )\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = Math.cos(a) + cosh(b);\n\n return new Complex(\n Math.sin(a) / d,\n sinh(b) / d);\n },\n\n /**\n * Calculate the cotangent\n *\n * @returns {Complex}\n */\n 'cot': function() {\n\n // cot(c) = i(e^(ci) + e^(-ci)) / (e^(ci) - e^(-ci))\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = Math.cos(a) - cosh(b);\n\n return new Complex(\n -Math.sin(a) / d,\n sinh(b) / d);\n },\n\n /**\n * Calculate the secant\n *\n * @returns {Complex}\n */\n 'sec': function() {\n\n // sec(c) = 2 / (e^(ci) + e^(-ci))\n\n var a = this['re'];\n var b = this['im'];\n var d = 0.5 * cosh(2 * b) + 0.5 * Math.cos(2 * a);\n\n return new Complex(\n Math.cos(a) * cosh(b) / d,\n Math.sin(a) * sinh(b) / d);\n },\n\n /**\n * Calculate the cosecans\n *\n * @returns {Complex}\n */\n 'csc': function() {\n\n // csc(c) = 2i / (e^(ci) - e^(-ci))\n\n var a = this['re'];\n var b = this['im'];\n var d = 0.5 * cosh(2 * b) - 0.5 * Math.cos(2 * a);\n\n return new Complex(\n Math.sin(a) * cosh(b) / d,\n -Math.cos(a) * sinh(b) / d);\n },\n\n /**\n * Calculate the complex arcus sinus\n *\n * @returns {Complex}\n */\n 'asin': function() {\n\n // asin(c) = -i * log(ci + sqrt(1 - c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n var t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n var t2 = new Complex(\n t1['re'] - b,\n t1['im'] + a)['log']();\n\n return new Complex(t2['im'], -t2['re']);\n },\n\n /**\n * Calculate the complex arcus cosinus\n *\n * @returns {Complex}\n */\n 'acos': function() {\n\n // acos(c) = i * log(c - i * sqrt(1 - c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n var t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n var t2 = new Complex(\n t1['re'] - b,\n t1['im'] + a)['log']();\n\n return new Complex(Math.PI / 2 - t2['im'], t2['re']);\n },\n\n /**\n * Calculate the complex arcus tangent\n *\n * @returns {Complex}\n */\n 'atan': function() {\n\n // atan(c) = i / 2 log((i + x) / (i - x))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0) {\n\n if (b === 1) {\n return new Complex(0, Infinity);\n }\n\n if (b === -1) {\n return new Complex(0, -Infinity);\n }\n }\n\n var d = a * a + (1.0 - b) * (1.0 - b);\n\n var t1 = new Complex(\n (1 - b * b - a * a) / d,\n -2 * a / d).log();\n\n return new Complex(-0.5 * t1['im'], 0.5 * t1['re']);\n },\n\n /**\n * Calculate the complex arcus cotangent\n *\n * @returns {Complex}\n */\n 'acot': function() {\n\n // acot(c) = i / 2 log((c - i) / (c + i))\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0) {\n return new Complex(Math.atan2(1, a), 0);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).atan()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).atan();\n },\n\n /**\n * Calculate the complex arcus secant\n *\n * @returns {Complex}\n */\n 'asec': function() {\n\n // asec(c) = -i * log(1 / c + sqrt(1 - i / c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Infinity);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).acos()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).acos();\n },\n\n /**\n * Calculate the complex arcus cosecans\n *\n * @returns {Complex}\n */\n 'acsc': function() {\n\n // acsc(c) = -i * log(i / c + sqrt(1 - 1 / c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(Math.PI / 2, Infinity);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).asin()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).asin();\n },\n\n /**\n * Calculate the complex sinh\n *\n * @returns {Complex}\n */\n 'sinh': function() {\n\n // sinh(c) = (e^c - e^-c) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n sinh(a) * Math.cos(b),\n cosh(a) * Math.sin(b));\n },\n\n /**\n * Calculate the complex cosh\n *\n * @returns {Complex}\n */\n 'cosh': function() {\n\n // cosh(c) = (e^c + e^-c) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n cosh(a) * Math.cos(b),\n sinh(a) * Math.sin(b));\n },\n\n /**\n * Calculate the complex tanh\n *\n * @returns {Complex}\n */\n 'tanh': function() {\n\n // tanh(c) = (e^c - e^-c) / (e^c + e^-c)\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = cosh(a) + Math.cos(b);\n\n return new Complex(\n sinh(a) / d,\n Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex coth\n *\n * @returns {Complex}\n */\n 'coth': function() {\n\n // coth(c) = (e^c + e^-c) / (e^c - e^-c)\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = cosh(a) - Math.cos(b);\n\n return new Complex(\n sinh(a) / d,\n -Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex coth\n *\n * @returns {Complex}\n */\n 'csch': function() {\n\n // csch(c) = 2 / (e^c - e^-c)\n\n var a = this['re'];\n var b = this['im'];\n var d = Math.cos(2 * b) - cosh(2 * a);\n\n return new Complex(\n -2 * sinh(a) * Math.cos(b) / d,\n 2 * cosh(a) * Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex sech\n *\n * @returns {Complex}\n */\n 'sech': function() {\n\n // sech(c) = 2 / (e^c + e^-c)\n\n var a = this['re'];\n var b = this['im'];\n var d = Math.cos(2 * b) + cosh(2 * a);\n\n return new Complex(\n 2 * cosh(a) * Math.cos(b) / d,\n -2 * sinh(a) * Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex asinh\n *\n * @returns {Complex}\n */\n 'asinh': function() {\n\n // asinh(c) = log(c + sqrt(c^2 + 1))\n\n var tmp = this['im'];\n this['im'] = -this['re'];\n this['re'] = tmp;\n var res = this['asin']();\n\n this['re'] = -this['im'];\n this['im'] = tmp;\n tmp = res['re'];\n\n res['re'] = -res['im'];\n res['im'] = tmp;\n return res;\n },\n\n /**\n * Calculate the complex acosh\n *\n * @returns {Complex}\n */\n 'acosh': function() {\n\n // acosh(c) = log(c + sqrt(c^2 - 1))\n\n var res = this['acos']();\n if (res['im'] <= 0) {\n var tmp = res['re'];\n res['re'] = -res['im'];\n res['im'] = tmp;\n } else {\n var tmp = res['im'];\n res['im'] = -res['re'];\n res['re'] = tmp;\n }\n return res;\n },\n\n /**\n * Calculate the complex atanh\n *\n * @returns {Complex}\n */\n 'atanh': function() {\n\n // atanh(c) = log((1+c) / (1-c)) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n var noIM = a > 1 && b === 0;\n var oneMinus = 1 - a;\n var onePlus = 1 + a;\n var d = oneMinus * oneMinus + b * b;\n\n var x = (d !== 0)\n ? new Complex(\n (onePlus * oneMinus - b * b) / d,\n (b * oneMinus + onePlus * b) / d)\n : new Complex(\n (a !== -1) ? (a / 0) : 0,\n (b !== 0) ? (b / 0) : 0);\n\n var temp = x['re'];\n x['re'] = logHypot(x['re'], x['im']) / 2;\n x['im'] = Math.atan2(x['im'], temp) / 2;\n if (noIM) {\n x['im'] = -x['im'];\n }\n return x;\n },\n\n /**\n * Calculate the complex acoth\n *\n * @returns {Complex}\n */\n 'acoth': function() {\n\n // acoth(c) = log((c+1) / (c-1)) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Math.PI / 2);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).atanh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).atanh();\n },\n\n /**\n * Calculate the complex acsch\n *\n * @returns {Complex}\n */\n 'acsch': function() {\n\n // acsch(c) = log((1+sqrt(1+c^2))/c)\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0) {\n\n return new Complex(\n (a !== 0)\n ? Math.log(a + Math.sqrt(a * a + 1))\n : Infinity, 0);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).asinh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).asinh();\n },\n\n /**\n * Calculate the complex asech\n *\n * @returns {Complex}\n */\n 'asech': function() {\n\n // asech(c) = log((1+sqrt(1-c^2))/c)\n\n var a = this['re'];\n var b = this['im'];\n\n if (this['isZero']()) {\n return Complex['INFINITY'];\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).acosh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).acosh();\n },\n\n /**\n * Calculate the complex inverse 1/z\n *\n * @returns {Complex}\n */\n 'inverse': function() {\n\n // 1 / 0 = Infinity and 1 / Infinity = 0\n if (this['isZero']()) {\n return Complex['INFINITY'];\n }\n\n if (this['isInfinite']()) {\n return Complex['ZERO'];\n }\n\n var a = this['re'];\n var b = this['im'];\n\n var d = a * a + b * b;\n\n return new Complex(a / d, -b / d);\n },\n\n /**\n * Returns the complex conjugate\n *\n * @returns {Complex}\n */\n 'conjugate': function() {\n\n return new Complex(this['re'], -this['im']);\n },\n\n /**\n * Gets the negated complex number\n *\n * @returns {Complex}\n */\n 'neg': function() {\n\n return new Complex(-this['re'], -this['im']);\n },\n\n /**\n * Ceils the actual complex number\n *\n * @returns {Complex}\n */\n 'ceil': function(places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.ceil(this['re'] * places) / places,\n Math.ceil(this['im'] * places) / places);\n },\n\n /**\n * Floors the actual complex number\n *\n * @returns {Complex}\n */\n 'floor': function(places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.floor(this['re'] * places) / places,\n Math.floor(this['im'] * places) / places);\n },\n\n /**\n * Ceils the actual complex number\n *\n * @returns {Complex}\n */\n 'round': function(places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.round(this['re'] * places) / places,\n Math.round(this['im'] * places) / places);\n },\n\n /**\n * Compares two complex numbers\n *\n * **Note:** new Complex(Infinity).equals(Infinity) === false\n *\n * @returns {boolean}\n */\n 'equals': function(a, b) {\n\n var z = new Complex(a, b);\n\n return Math.abs(z['re'] - this['re']) <= Complex['EPSILON'] &&\n Math.abs(z['im'] - this['im']) <= Complex['EPSILON'];\n },\n\n /**\n * Clones the actual object\n *\n * @returns {Complex}\n */\n 'clone': function() {\n\n return new Complex(this['re'], this['im']);\n },\n\n /**\n * Gets a string of the actual complex number\n *\n * @returns {string}\n */\n 'toString': function() {\n\n var a = this['re'];\n var b = this['im'];\n var ret = \"\";\n\n if (this['isNaN']()) {\n return 'NaN';\n }\n\n if (this['isInfinite']()) {\n return 'Infinity';\n }\n\n if (Math.abs(a) < Complex['EPSILON']) {\n a = 0;\n }\n\n if (Math.abs(b) < Complex['EPSILON']) {\n b = 0;\n }\n\n // If is real number\n if (b === 0) {\n return ret + a;\n }\n\n if (a !== 0) {\n ret += a;\n ret += \" \";\n if (b < 0) {\n b = -b;\n ret += \"-\";\n } else {\n ret += \"+\";\n }\n ret += \" \";\n } else if (b < 0) {\n b = -b;\n ret += \"-\";\n }\n\n if (1 !== b) { // b is the absolute imaginary part\n ret += b;\n }\n return ret + \"i\";\n },\n\n /**\n * Returns the actual number as a vector\n *\n * @returns {Array}\n */\n 'toVector': function() {\n\n return [this['re'], this['im']];\n },\n\n /**\n * Returns the actual real value of the current object\n *\n * @returns {number|null}\n */\n 'valueOf': function() {\n\n if (this['im'] === 0) {\n return this['re'];\n }\n return null;\n },\n\n /**\n * Determines whether a complex number is not on the Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isNaN': function() {\n return isNaN(this['re']) || isNaN(this['im']);\n },\n\n /**\n * Determines whether or not a complex number is at the zero pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isZero': function() {\n return this['im'] === 0 && this['re'] === 0;\n },\n\n /**\n * Determines whether a complex number is not at the infinity pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isFinite': function() {\n return isFinite(this['re']) && isFinite(this['im']);\n },\n\n /**\n * Determines whether or not a complex number is at the infinity pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isInfinite': function() {\n return !(this['isNaN']() || this['isFinite']());\n }\n };\n\n Complex['ZERO'] = new Complex(0, 0);\n Complex['ONE'] = new Complex(1, 0);\n Complex['I'] = new Complex(0, 1);\n Complex['PI'] = new Complex(Math.PI, 0);\n Complex['E'] = new Complex(Math.E, 0);\n Complex['INFINITY'] = new Complex(Infinity, Infinity);\n Complex['NAN'] = new Complex(NaN, NaN);\n Complex['EPSILON'] = 1e-15;\n\n if (typeof define === 'function' && define['amd']) {\n define([], function() {\n return Complex;\n });\n } else if (typeof exports === 'object') {\n Object.defineProperty(Complex, \"__esModule\", { 'value': true });\n Complex['default'] = Complex;\n Complex['Complex'] = Complex;\n module['exports'] = Complex;\n } else {\n root['Complex'] = Complex;\n }\n\n})(this);\n", "/*\r\n * Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license\r\n * Author: Jim Palmer (based on chunking idea from Dave Koelle)\r\n */\r\n/*jshint unused:false */\r\nmodule.exports = function naturalSort (a, b) {\r\n\t\"use strict\";\r\n\tvar re = /(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,\r\n\t\tsre = /(^[ ]*|[ ]*$)/g,\r\n\t\tdre = /(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,\r\n\t\thre = /^0x[0-9a-f]+$/i,\r\n\t\tore = /^0/,\r\n\t\ti = function(s) { return naturalSort.insensitive && ('' + s).toLowerCase() || '' + s; },\r\n\t\t// convert all to strings strip whitespace\r\n\t\tx = i(a).replace(sre, '') || '',\r\n\t\ty = i(b).replace(sre, '') || '',\r\n\t\t// chunk/tokenize\r\n\t\txN = x.replace(re, '\\0$1\\0').replace(/\\0$/,'').replace(/^\\0/,'').split('\\0'),\r\n\t\tyN = y.replace(re, '\\0$1\\0').replace(/\\0$/,'').replace(/^\\0/,'').split('\\0'),\r\n\t\t// numeric, hex or date detection\r\n\t\txD = parseInt(x.match(hre), 16) || (xN.length !== 1 && x.match(dre) && Date.parse(x)),\r\n\t\tyD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null,\r\n\t\toFxNcL, oFyNcL;\r\n\t// first try and sort Hex codes or Dates\r\n\tif (yD) {\r\n\t\tif ( xD < yD ) { return -1; }\r\n\t\telse if ( xD > yD ) { return 1; }\r\n\t}\r\n\t// natural sorting through split numeric strings and default strings\r\n\tfor(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {\r\n\t\t// find floats not starting with '0', string or 0 if not defined (Clint Priest)\r\n\t\toFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;\r\n\t\toFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;\r\n\t\t// handle numeric vs string comparison - number < string - (Kyle Adams)\r\n\t\tif (isNaN(oFxNcL) !== isNaN(oFyNcL)) { return (isNaN(oFxNcL)) ? 1 : -1; }\r\n\t\t// rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'\r\n\t\telse if (typeof oFxNcL !== typeof oFyNcL) {\r\n\t\t\toFxNcL += '';\r\n\t\t\toFyNcL += '';\r\n\t\t}\r\n\t\tif (oFxNcL < oFyNcL) { return -1; }\r\n\t\tif (oFxNcL > oFyNcL) { return 1; }\r\n\t}\r\n\treturn 0;\r\n};\r\n", "\"use strict\";\n\n// Map the characters to escape to their escaped values. The list is derived\n// from http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar defaultEscapes = {\n \"{\": \"\\\\{\",\n \"}\": \"\\\\}\",\n \"\\\\\": \"\\\\textbackslash{}\",\n \"#\": \"\\\\#\",\n $: \"\\\\$\",\n \"%\": \"\\\\%\",\n \"&\": \"\\\\&\",\n \"^\": \"\\\\textasciicircum{}\",\n _: \"\\\\_\",\n \"~\": \"\\\\textasciitilde{}\"\n};\nvar formatEscapes = {\n \"\\u2013\": \"\\\\--\",\n \"\\u2014\": \"\\\\---\",\n \" \": \"~\",\n \"\\t\": \"\\\\qquad{}\",\n \"\\r\\n\": \"\\\\newline{}\",\n \"\\n\": \"\\\\newline{}\"\n};\n\nvar defaultEscapeMapFn = function defaultEscapeMapFn(defaultEscapes, formatEscapes) {\n return _extends({}, defaultEscapes, formatEscapes);\n};\n\n/**\n * Escape a string to be used in LaTeX documents.\n * @param {string} str the string to be escaped.\n * @param {boolean} params.preserveFormatting whether formatting escapes should\n * be performed (default: false).\n * @param {function} params.escapeMapFn the function to modify the escape maps.\n * @return {string} the escaped string, ready to be used in LaTeX.\n */\nmodule.exports = function (str) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$preserveFormatti = _ref.preserveFormatting,\n preserveFormatting = _ref$preserveFormatti === undefined ? false : _ref$preserveFormatti,\n _ref$escapeMapFn = _ref.escapeMapFn,\n escapeMapFn = _ref$escapeMapFn === undefined ? defaultEscapeMapFn : _ref$escapeMapFn;\n\n var runningStr = String(str);\n var result = \"\";\n\n var escapes = escapeMapFn(_extends({}, defaultEscapes), preserveFormatting ? _extends({}, formatEscapes) : {});\n var escapeKeys = Object.keys(escapes); // as it is reused later on\n\n // Algorithm: Go through the string character by character, if it matches\n // with one of the special characters then we'll replace it with the escaped\n // version.\n\n var _loop = function _loop() {\n var specialCharFound = false;\n escapeKeys.forEach(function (key, index) {\n if (specialCharFound) {\n return;\n }\n if (runningStr.length >= key.length && runningStr.slice(0, key.length) === key) {\n result += escapes[escapeKeys[index]];\n runningStr = runningStr.slice(key.length, runningStr.length);\n specialCharFound = true;\n }\n });\n if (!specialCharFound) {\n result += runningStr.slice(0, 1);\n runningStr = runningStr.slice(1, runningStr.length);\n }\n };\n\n while (runningStr) {\n _loop();\n }\n return result;\n};", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = String(data);\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "export default {};\n", "/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n} else {\n // When included as a plain script, set up Math.seedrandom global.\n math['seed' + rngname] = seedrandom;\n}\n\n\n// End anonymous scope, and pass initial values.\n})(\n // global: `self` in browsers (including strict mode and web workers),\n // otherwise `this` in Node and other environments\n (typeof self !== 'undefined') ? self : this,\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "function E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n", "(function (window, factory) {\n if (typeof exports === 'object') {\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n define(factory);\n } else {\n window.jStat = factory();\n }\n})(this, function () {\nvar jStat = (function(Math, undefined) {\n\n// For quick reference.\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\nvar toString = Object.prototype.toString;\n\n// Calculate correction for IEEE error\n// TODO: This calculation can be improved.\nfunction calcRdx(n, m) {\n var val = n > m ? n : m;\n return Math.pow(10,\n 17 - ~~(Math.log(((val > 0) ? val : -val)) * Math.LOG10E));\n}\n\n\nvar isArray = Array.isArray || function isArray(arg) {\n return toString.call(arg) === '[object Array]';\n};\n\n\nfunction isFunction(arg) {\n return toString.call(arg) === '[object Function]';\n}\n\n\nfunction isNumber(num) {\n return (typeof num === 'number') ? num - num === 0 : false;\n}\n\n\n// Converts the jStat matrix to vector.\nfunction toVector(arr) {\n return concat.apply([], arr);\n}\n\n\n// The one and only jStat constructor.\nfunction jStat() {\n return new jStat._init(arguments);\n}\n\n\n// TODO: Remove after all references in src files have been removed.\njStat.fn = jStat.prototype;\n\n\n// By separating the initializer from the constructor it's easier to handle\n// always returning a new instance whether \"new\" was used or not.\njStat._init = function _init(args) {\n // If first argument is an array, must be vector or matrix.\n if (isArray(args[0])) {\n // Check if matrix.\n if (isArray(args[0][0])) {\n // See if a mapping function was also passed.\n if (isFunction(args[1]))\n args[0] = jStat.map(args[0], args[1]);\n // Iterate over each is faster than this.push.apply(this, args[0].\n for (var i = 0; i < args[0].length; i++)\n this[i] = args[0][i];\n this.length = args[0].length;\n\n // Otherwise must be a vector.\n } else {\n this[0] = isFunction(args[1]) ? jStat.map(args[0], args[1]) : args[0];\n this.length = 1;\n }\n\n // If first argument is number, assume creation of sequence.\n } else if (isNumber(args[0])) {\n this[0] = jStat.seq.apply(null, args);\n this.length = 1;\n\n // Handle case when jStat object is passed to jStat.\n } else if (args[0] instanceof jStat) {\n // Duplicate the object and pass it back.\n return jStat(args[0].toArray());\n\n // Unexpected argument value, return empty jStat object.\n // TODO: This is strange behavior. Shouldn't this throw or some such to let\n // the user know they had bad arguments?\n } else {\n this[0] = [];\n this.length = 1;\n }\n\n return this;\n};\njStat._init.prototype = jStat.prototype;\njStat._init.constructor = jStat;\n\n\n// Utility functions.\n// TODO: for internal use only?\njStat.utils = {\n calcRdx: calcRdx,\n isArray: isArray,\n isFunction: isFunction,\n isNumber: isNumber,\n toVector: toVector\n};\n\n\njStat._random_fn = Math.random;\njStat.setRandom = function setRandom(fn) {\n if (typeof fn !== 'function')\n throw new TypeError('fn is not a function');\n jStat._random_fn = fn;\n};\n\n\n// Easily extend the jStat object.\n// TODO: is this seriously necessary?\njStat.extend = function extend(obj) {\n var i, j;\n\n if (arguments.length === 1) {\n for (j in obj)\n jStat[j] = obj[j];\n return this;\n }\n\n for (i = 1; i < arguments.length; i++) {\n for (j in arguments[i])\n obj[j] = arguments[i][j];\n }\n\n return obj;\n};\n\n\n// Returns the number of rows in the matrix.\njStat.rows = function rows(arr) {\n return arr.length || 1;\n};\n\n\n// Returns the number of columns in the matrix.\njStat.cols = function cols(arr) {\n return arr[0].length || 1;\n};\n\n\n// Returns the dimensions of the object { rows: i, cols: j }\njStat.dimensions = function dimensions(arr) {\n return {\n rows: jStat.rows(arr),\n cols: jStat.cols(arr)\n };\n};\n\n\n// Returns a specified row as a vector or return a sub matrix by pick some rows\njStat.row = function row(arr, index) {\n if (isArray(index)) {\n return index.map(function(i) {\n return jStat.row(arr, i);\n })\n }\n return arr[index];\n};\n\n\n// return row as array\n// rowa([[1,2],[3,4]],0) -> [1,2]\njStat.rowa = function rowa(arr, i) {\n return jStat.row(arr, i);\n};\n\n\n// Returns the specified column as a vector or return a sub matrix by pick some\n// columns\njStat.col = function col(arr, index) {\n if (isArray(index)) {\n var submat = jStat.arange(arr.length).map(function() {\n return new Array(index.length);\n });\n index.forEach(function(ind, i){\n jStat.arange(arr.length).forEach(function(j) {\n submat[j][i] = arr[j][ind];\n });\n });\n return submat;\n }\n var column = new Array(arr.length);\n for (var i = 0; i < arr.length; i++)\n column[i] = [arr[i][index]];\n return column;\n};\n\n\n// return column as array\n// cola([[1,2],[3,4]],0) -> [1,3]\njStat.cola = function cola(arr, i) {\n return jStat.col(arr, i).map(function(a){ return a[0] });\n};\n\n\n// Returns the diagonal of the matrix\njStat.diag = function diag(arr) {\n var nrow = jStat.rows(arr);\n var res = new Array(nrow);\n for (var row = 0; row < nrow; row++)\n res[row] = [arr[row][row]];\n return res;\n};\n\n\n// Returns the anti-diagonal of the matrix\njStat.antidiag = function antidiag(arr) {\n var nrow = jStat.rows(arr) - 1;\n var res = new Array(nrow);\n for (var i = 0; nrow >= 0; nrow--, i++)\n res[i] = [arr[i][nrow]];\n return res;\n};\n\n// Transpose a matrix or array.\njStat.transpose = function transpose(arr) {\n var obj = [];\n var objArr, rows, cols, j, i;\n\n // Make sure arr is in matrix format.\n if (!isArray(arr[0]))\n arr = [arr];\n\n rows = arr.length;\n cols = arr[0].length;\n\n for (i = 0; i < cols; i++) {\n objArr = new Array(rows);\n for (j = 0; j < rows; j++)\n objArr[j] = arr[j][i];\n obj.push(objArr);\n }\n\n // If obj is vector, return only single array.\n return obj.length === 1 ? obj[0] : obj;\n};\n\n\n// Map a function to an array or array of arrays.\n// \"toAlter\" is an internal variable.\njStat.map = function map(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n for (col = 0; col < ncol; col++)\n res[row][col] = func(arr[row][col], row, col);\n }\n\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Cumulatively combine the elements of an array or array of arrays using a function.\njStat.cumreduce = function cumreduce(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n if (ncol > 0)\n res[row][0] = arr[row][0];\n for (col = 1; col < ncol; col++)\n res[row][col] = func(res[row][col-1], arr[row][col]);\n }\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Destructively alter an array.\njStat.alter = function alter(arr, func) {\n return jStat.map(arr, func, true);\n};\n\n\n// Generate a rows x cols matrix according to the supplied function.\njStat.create = function create(rows, cols, func) {\n var res = new Array(rows);\n var i, j;\n\n if (isFunction(cols)) {\n func = cols;\n cols = rows;\n }\n\n for (i = 0; i < rows; i++) {\n res[i] = new Array(cols);\n for (j = 0; j < cols; j++)\n res[i][j] = func(i, j);\n }\n\n return res;\n};\n\n\nfunction retZero() { return 0; }\n\n\n// Generate a rows x cols matrix of zeros.\njStat.zeros = function zeros(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retZero);\n};\n\n\nfunction retOne() { return 1; }\n\n\n// Generate a rows x cols matrix of ones.\njStat.ones = function ones(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retOne);\n};\n\n\n// Generate a rows x cols matrix of uniformly random numbers.\njStat.rand = function rand(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, jStat._random_fn);\n};\n\n\nfunction retIdent(i, j) { return i === j ? 1 : 0; }\n\n\n// Generate an identity matrix of size row x cols.\njStat.identity = function identity(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retIdent);\n};\n\n\n// Tests whether a matrix is symmetric\njStat.symmetric = function symmetric(arr) {\n var size = arr.length;\n var row, col;\n\n if (arr.length !== arr[0].length)\n return false;\n\n for (row = 0; row < size; row++) {\n for (col = 0; col < size; col++)\n if (arr[col][row] !== arr[row][col])\n return false;\n }\n\n return true;\n};\n\n\n// Set all values to zero.\njStat.clear = function clear(arr) {\n return jStat.alter(arr, retZero);\n};\n\n\n// Generate sequence.\njStat.seq = function seq(min, max, length, func) {\n if (!isFunction(func))\n func = false;\n\n var arr = [];\n var hival = calcRdx(min, max);\n var step = (max * hival - min * hival) / ((length - 1) * hival);\n var current = min;\n var cnt;\n\n // Current is assigned using a technique to compensate for IEEE error.\n // TODO: Needs better implementation.\n for (cnt = 0;\n current <= max && cnt < length;\n cnt++, current = (min * hival + step * hival * cnt) / hival) {\n arr.push((func ? func(current, cnt) : current));\n }\n\n return arr;\n};\n\n\n// arange(5) -> [0,1,2,3,4]\n// arange(1,5) -> [1,2,3,4]\n// arange(5,1,-1) -> [5,4,3,2]\njStat.arange = function arange(start, end, step) {\n var rl = [];\n var i;\n step = step || 1;\n if (end === undefined) {\n end = start;\n start = 0;\n }\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(i);\n }\n } else {\n for (i = start; i > end; i += step) {\n rl.push(i);\n }\n }\n return rl;\n};\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// slice(A,{row:{end:2},col:{start:1}}) -> [[2,3],[5,6]]\n// slice(A,1,{start:1}) -> [5,6]\n// as numpy code A[:2,1:]\njStat.slice = (function(){\n function _slice(list, start, end, step) {\n // note it's not equal to range.map mode it's a bug\n var i;\n var rl = [];\n var length = list.length;\n if (start === undefined && end === undefined && step === undefined) {\n return jStat.copy(list);\n }\n\n start = start || 0;\n end = end || list.length;\n start = start >= 0 ? start : length + start;\n end = end >= 0 ? end : length + end;\n step = step || 1;\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(list[i]);\n }\n } else {\n for (i = start; i > end;i += step) {\n rl.push(list[i]);\n }\n }\n return rl;\n }\n\n function slice(list, rcSlice) {\n var colSlice, rowSlice;\n rcSlice = rcSlice || {};\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return list[rcSlice.row][rcSlice.col];\n var row = jStat.rowa(list, rcSlice.row);\n colSlice = rcSlice.col || {};\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n }\n\n if (isNumber(rcSlice.col)) {\n var col = jStat.cola(list, rcSlice.col);\n rowSlice = rcSlice.row || {};\n return _slice(col, rowSlice.start, rowSlice.end, rowSlice.step);\n }\n\n rowSlice = rcSlice.row || {};\n colSlice = rcSlice.col || {};\n var rows = _slice(list, rowSlice.start, rowSlice.end, rowSlice.step);\n return rows.map(function(row) {\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n });\n }\n\n return slice;\n}());\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// sliceAssign(A,{row:{start:1},col:{start:1}},[[0,0],[0,0]])\n// A=[[1,2,3],[4,0,0],[7,0,0]]\njStat.sliceAssign = function sliceAssign(A, rcSlice, B) {\n var nl, ml;\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return A[rcSlice.row][rcSlice.col] = B;\n rcSlice.col = rcSlice.col || {};\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n nl = jStat.arange(rcSlice.col.start,\n Math.min(A.length, rcSlice.col.end),\n rcSlice.col.step);\n var m = rcSlice.row;\n nl.forEach(function(n, i) {\n A[m][n] = B[i];\n });\n return A;\n }\n\n if (isNumber(rcSlice.col)) {\n rcSlice.row = rcSlice.row || {};\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n ml = jStat.arange(rcSlice.row.start,\n Math.min(A[0].length, rcSlice.row.end),\n rcSlice.row.step);\n var n = rcSlice.col;\n ml.forEach(function(m, j) {\n A[m][n] = B[j];\n });\n return A;\n }\n\n if (B[0].length === undefined) {\n B = [B];\n }\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n ml = jStat.arange(rcSlice.row.start,\n Math.min(A.length, rcSlice.row.end),\n rcSlice.row.step);\n nl = jStat.arange(rcSlice.col.start,\n Math.min(A[0].length, rcSlice.col.end),\n rcSlice.col.step);\n ml.forEach(function(m, i) {\n nl.forEach(function(n, j) {\n A[m][n] = B[i][j];\n });\n });\n return A;\n};\n\n\n// [1,2,3] ->\n// [[1,0,0],[0,2,0],[0,0,3]]\njStat.diagonal = function diagonal(diagArray) {\n var mat = jStat.zeros(diagArray.length, diagArray.length);\n diagArray.forEach(function(t, i) {\n mat[i][i] = t;\n });\n return mat;\n};\n\n\n// return copy of A\njStat.copy = function copy(A) {\n return A.map(function(row) {\n if (isNumber(row))\n return row;\n return row.map(function(t) {\n return t;\n });\n });\n};\n\n\n// TODO: Go over this entire implementation. Seems a tragic waste of resources\n// doing all this work. Instead, and while ugly, use new Function() to generate\n// a custom function for each static method.\n\n// Quick reference.\nvar jProto = jStat.prototype;\n\n// Default length.\njProto.length = 0;\n\n// For internal use only.\n// TODO: Check if they're actually used, and if they are then rename them\n// to _*\njProto.push = Array.prototype.push;\njProto.sort = Array.prototype.sort;\njProto.splice = Array.prototype.splice;\njProto.slice = Array.prototype.slice;\n\n\n// Return a clean array.\njProto.toArray = function toArray() {\n return this.length > 1 ? slice.call(this) : slice.call(this)[0];\n};\n\n\n// Map a function to a matrix or vector.\njProto.map = function map(func, toAlter) {\n return jStat(jStat.map(this, func, toAlter));\n};\n\n\n// Cumulatively combine the elements of a matrix or vector using a function.\njProto.cumreduce = function cumreduce(func, toAlter) {\n return jStat(jStat.cumreduce(this, func, toAlter));\n};\n\n\n// Destructively alter an array.\njProto.alter = function alter(func) {\n jStat.alter(this, func);\n return this;\n};\n\n\n// Extend prototype with methods that have no argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(func) {\n var self = this,\n results;\n // Check for callback.\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self));\n });\n return this;\n }\n results = jStat[passfunc](this);\n return isArray(results) ? jStat(results) : results;\n };\n })(funcs[i]);\n})('transpose clear symmetric rows cols dimensions diag antidiag'.split(' '));\n\n\n// Extend prototype with methods that have one argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(index, func) {\n var self = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self, index));\n });\n return this;\n }\n return jStat(jStat[passfunc](this, index));\n };\n })(funcs[i]);\n})('row col'.split(' '));\n\n\n// Extend prototype with simple shortcut methods.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function() {\n return jStat(jStat[passfunc].apply(null, arguments));\n };\n })(funcs[i]);\n})('create zeros ones rand identity'.split(' '));\n\n\n// Exposing jStat.\nreturn jStat;\n\n}(Math));\n(function(jStat, Math) {\n\nvar isFunction = jStat.utils.isFunction;\n\n// Ascending functions for sort\nfunction ascNum(a, b) { return a - b; }\n\nfunction clip(arg, min, max) {\n return Math.max(min, Math.min(arg, max));\n}\n\n\n// sum of an array\njStat.sum = function sum(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n\n// sum squared\njStat.sumsqrd = function sumsqrd(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i] * arr[i];\n return sum;\n};\n\n\n// sum of squared errors of prediction (SSE)\njStat.sumsqerr = function sumsqerr(arr) {\n var mean = jStat.mean(arr);\n var sum = 0;\n var i = arr.length;\n var tmp;\n while (--i >= 0) {\n tmp = arr[i] - mean;\n sum += tmp * tmp;\n }\n return sum;\n};\n\n// sum of an array in each row\njStat.sumrow = function sumrow(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n// product of an array\njStat.product = function product(arr) {\n var prod = 1;\n var i = arr.length;\n while (--i >= 0)\n prod *= arr[i];\n return prod;\n};\n\n\n// minimum value of an array\njStat.min = function min(arr) {\n var low = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] < low)\n low = arr[i];\n return low;\n};\n\n\n// maximum value of an array\njStat.max = function max(arr) {\n var high = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] > high)\n high = arr[i];\n return high;\n};\n\n\n// unique values of an array\njStat.unique = function unique(arr) {\n var hash = {}, _arr = [];\n for(var i = 0; i < arr.length; i++) {\n if (!hash[arr[i]]) {\n hash[arr[i]] = true;\n _arr.push(arr[i]);\n }\n }\n return _arr;\n};\n\n\n// mean value of an array\njStat.mean = function mean(arr) {\n return jStat.sum(arr) / arr.length;\n};\n\n\n// mean squared error (MSE)\njStat.meansqerr = function meansqerr(arr) {\n return jStat.sumsqerr(arr) / arr.length;\n};\n\n\n// geometric mean of an array\njStat.geomean = function geomean(arr) {\n var logs = arr.map(Math.log)\n var meanOfLogs = jStat.mean(logs)\n return Math.exp(meanOfLogs)\n};\n\n\n// median of an array\njStat.median = function median(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n // check if array is even or odd, then return the appropriate\n return !(arrlen & 1)\n ? (_arr[(arrlen / 2) - 1 ] + _arr[(arrlen / 2)]) / 2\n : _arr[(arrlen / 2) | 0 ];\n};\n\n\n// cumulative sum of an array\njStat.cumsum = function cumsum(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a + b; });\n};\n\n\n// cumulative product of an array\njStat.cumprod = function cumprod(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a * b; });\n};\n\n\n// successive differences of a sequence\njStat.diff = function diff(arr) {\n var diffs = [];\n var arrLen = arr.length;\n var i;\n for (i = 1; i < arrLen; i++)\n diffs.push(arr[i] - arr[i - 1]);\n return diffs;\n};\n\n\n// ranks of an array\njStat.rank = function (arr) {\n var i;\n var distinctNumbers = [];\n var numberCounts = {};\n for (i = 0; i < arr.length; i++) {\n var number = arr[i];\n if (numberCounts[number]) {\n numberCounts[number]++;\n } else {\n numberCounts[number] = 1;\n distinctNumbers.push(number);\n }\n }\n\n var sortedDistinctNumbers = distinctNumbers.sort(ascNum);\n var numberRanks = {};\n var currentRank = 1;\n for (i = 0; i < sortedDistinctNumbers.length; i++) {\n var number = sortedDistinctNumbers[i];\n var count = numberCounts[number];\n var first = currentRank;\n var last = currentRank + count - 1;\n var rank = (first + last) / 2;\n numberRanks[number] = rank;\n currentRank += count;\n }\n\n return arr.map(function (number) {\n return numberRanks[number];\n });\n};\n\n\n// mode of an array\n// if there are multiple modes of an array, return all of them\n// is this the appropriate way of handling it?\njStat.mode = function mode(arr) {\n var arrLen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n var count = 1;\n var maxCount = 0;\n var numMaxCount = 0;\n var mode_arr = [];\n var i;\n\n for (i = 0; i < arrLen; i++) {\n if (_arr[i] === _arr[i + 1]) {\n count++;\n } else {\n if (count > maxCount) {\n mode_arr = [_arr[i]];\n maxCount = count;\n numMaxCount = 0;\n }\n // are there multiple max counts\n else if (count === maxCount) {\n mode_arr.push(_arr[i]);\n numMaxCount++;\n }\n // resetting count for new value in array\n count = 1;\n }\n }\n\n return numMaxCount === 0 ? mode_arr[0] : mode_arr;\n};\n\n\n// range of an array\njStat.range = function range(arr) {\n return jStat.max(arr) - jStat.min(arr);\n};\n\n// variance of an array\n// flag = true indicates sample instead of population\njStat.variance = function variance(arr, flag) {\n return jStat.sumsqerr(arr) / (arr.length - (flag ? 1 : 0));\n};\n\n// pooled variance of an array of arrays\njStat.pooledvariance = function pooledvariance(arr) {\n var sumsqerr = arr.reduce(function (a, samples) {return a + jStat.sumsqerr(samples);}, 0);\n var count = arr.reduce(function (a, samples) {return a + samples.length;}, 0);\n return sumsqerr / (count - arr.length);\n};\n\n// deviation of an array\njStat.deviation = function (arr) {\n var mean = jStat.mean(arr);\n var arrlen = arr.length;\n var dev = new Array(arrlen);\n for (var i = 0; i < arrlen; i++) {\n dev[i] = arr[i] - mean;\n }\n return dev;\n};\n\n// standard deviation of an array\n// flag = true indicates sample instead of population\njStat.stdev = function stdev(arr, flag) {\n return Math.sqrt(jStat.variance(arr, flag));\n};\n\n// pooled standard deviation of an array of arrays\njStat.pooledstdev = function pooledstdev(arr) {\n return Math.sqrt(jStat.pooledvariance(arr));\n};\n\n// mean deviation (mean absolute deviation) of an array\njStat.meandev = function meandev(arr) {\n var mean = jStat.mean(arr);\n var a = [];\n for (var i = arr.length - 1; i >= 0; i--) {\n a.push(Math.abs(arr[i] - mean));\n }\n return jStat.mean(a);\n};\n\n\n// median deviation (median absolute deviation) of an array\njStat.meddev = function meddev(arr) {\n var median = jStat.median(arr);\n var a = [];\n for (var i = arr.length - 1; i >= 0; i--) {\n a.push(Math.abs(arr[i] - median));\n }\n return jStat.median(a);\n};\n\n\n// coefficient of variation\njStat.coeffvar = function coeffvar(arr) {\n return jStat.stdev(arr) / jStat.mean(arr);\n};\n\n\n// quartiles of an array\njStat.quartiles = function quartiles(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n return [\n _arr[ Math.round((arrlen) / 4) - 1 ],\n _arr[ Math.round((arrlen) / 2) - 1 ],\n _arr[ Math.round((arrlen) * 3 / 4) - 1 ]\n ];\n};\n\n\n// Arbitary quantiles of an array. Direct port of the scipy.stats\n// implementation by Pierre GF Gerard-Marchant.\njStat.quantiles = function quantiles(arr, quantilesArray, alphap, betap) {\n var sortedArray = arr.slice().sort(ascNum);\n var quantileVals = [quantilesArray.length];\n var n = arr.length;\n var i, p, m, aleph, k, gamma;\n\n if (typeof alphap === 'undefined')\n alphap = 3 / 8;\n if (typeof betap === 'undefined')\n betap = 3 / 8;\n\n for (i = 0; i < quantilesArray.length; i++) {\n p = quantilesArray[i];\n m = alphap + p * (1 - alphap - betap);\n aleph = n * p + m;\n k = Math.floor(clip(aleph, 1, n - 1));\n gamma = clip(aleph - k, 0, 1);\n quantileVals[i] = (1 - gamma) * sortedArray[k - 1] + gamma * sortedArray[k];\n }\n\n return quantileVals;\n};\n\n// Return the k-th percentile of values in a range, where k is in the range 0..1, inclusive.\n// Passing true for the exclusive parameter excludes both endpoints of the range.\njStat.percentile = function percentile(arr, k, exclusive) {\n var _arr = arr.slice().sort(ascNum);\n var realIndex = k * (_arr.length + (exclusive ? 1 : -1)) + (exclusive ? 0 : 1);\n var index = parseInt(realIndex);\n var frac = realIndex - index;\n if (index + 1 < _arr.length) {\n return _arr[index - 1] + frac * (_arr[index] - _arr[index - 1]);\n } else {\n return _arr[index - 1];\n }\n}\n\n// The percentile rank of score in a given array. Returns the percentage\n// of all values in the input array that are less than (kind='strict') or\n// less or equal than (kind='weak') score. Default is weak.\njStat.percentileOfScore = function percentileOfScore(arr, score, kind) {\n var counter = 0;\n var len = arr.length;\n var strict = false;\n var value, i;\n\n if (kind === 'strict')\n strict = true;\n\n for (i = 0; i < len; i++) {\n value = arr[i];\n if ((strict && value < score) ||\n (!strict && value <= score)) {\n counter++;\n }\n }\n\n return counter / len;\n};\n\n\n// Histogram (bin count) data\njStat.histogram = function histogram(arr, binCnt) {\n binCnt = binCnt || 4;\n var first = jStat.min(arr);\n var binWidth = (jStat.max(arr) - first) / binCnt;\n var len = arr.length;\n var bins = [];\n var i;\n\n for (i = 0; i < binCnt; i++)\n bins[i] = 0;\n for (i = 0; i < len; i++)\n bins[Math.min(Math.floor(((arr[i] - first) / binWidth)), binCnt - 1)] += 1;\n\n return bins;\n};\n\n\n// covariance of two arrays\njStat.covariance = function covariance(arr1, arr2) {\n var u = jStat.mean(arr1);\n var v = jStat.mean(arr2);\n var arr1Len = arr1.length;\n var sq_dev = new Array(arr1Len);\n var i;\n\n for (i = 0; i < arr1Len; i++)\n sq_dev[i] = (arr1[i] - u) * (arr2[i] - v);\n\n return jStat.sum(sq_dev) / (arr1Len - 1);\n};\n\n\n// (pearson's) population correlation coefficient, rho\njStat.corrcoeff = function corrcoeff(arr1, arr2) {\n return jStat.covariance(arr1, arr2) /\n jStat.stdev(arr1, 1) /\n jStat.stdev(arr2, 1);\n};\n\n // (spearman's) rank correlation coefficient, sp\njStat.spearmancoeff = function (arr1, arr2) {\n arr1 = jStat.rank(arr1);\n arr2 = jStat.rank(arr2);\n //return pearson's correlation of the ranks:\n return jStat.corrcoeff(arr1, arr2);\n}\n\n\n// statistical standardized moments (general form of skew/kurt)\njStat.stanMoment = function stanMoment(arr, n) {\n var mu = jStat.mean(arr);\n var sigma = jStat.stdev(arr);\n var len = arr.length;\n var skewSum = 0;\n\n for (var i = 0; i < len; i++)\n skewSum += Math.pow((arr[i] - mu) / sigma, n);\n\n return skewSum / arr.length;\n};\n\n// (pearson's) moment coefficient of skewness\njStat.skewness = function skewness(arr) {\n return jStat.stanMoment(arr, 3);\n};\n\n// (pearson's) (excess) kurtosis\njStat.kurtosis = function kurtosis(arr) {\n return jStat.stanMoment(arr, 4) - 3;\n};\n\n\nvar jProto = jStat.prototype;\n\n\n// Extend jProto with method for calculating cumulative sums and products.\n// This differs from the similar extension below as cumsum and cumprod should\n// not be run again in the case fullbool === true.\n// If a matrix is passed, automatically assume operation should be done on the\n// columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('cumsum cumprod').split(' '));\n\n\n// Extend jProto with methods which don't require arguments and work on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n if (passfunc !== 'sumrow')\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return fullbool === true\n ? jStat[passfunc](jStat.utils.toVector(arr))\n : arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr ' +\n 'geomean median diff rank mode range variance deviation stdev meandev ' +\n 'meddev coeffvar quartiles histogram skewness kurtosis').split(' '));\n\n\n// Extend jProto with functions that take arguments. Operations on matrices are\n// done on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function() {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n var args = Array.prototype.slice.call(arguments);\n var callbackFunction;\n\n // If the last argument is a function, we assume it's a callback; we\n // strip the callback out and call the function again.\n if (isFunction(args[args.length - 1])) {\n callbackFunction = args[args.length - 1];\n var argsToPass = args.slice(0, args.length - 1);\n\n setTimeout(function() {\n callbackFunction.call(tmpthis,\n jProto[passfunc].apply(tmpthis, argsToPass));\n });\n return this;\n\n // Otherwise we curry the function args and call normally.\n } else {\n callbackFunction = undefined;\n var curriedFunction = function curriedFunction(vector) {\n return jStat[passfunc].apply(tmpthis, [vector].concat(args));\n }\n }\n\n // If this is a matrix, run column-by-column.\n if (this.length > 1) {\n tmpthis = tmpthis.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = curriedFunction(tmpthis[i]);\n return arr;\n }\n\n // Otherwise run on the vector.\n return curriedFunction(this[0]);\n };\n })(funcs[i]);\n})('quantiles percentileOfScore'.split(' '));\n\n}(jStat, Math));\n// Special functions //\n(function(jStat, Math) {\n\n// Log-gamma function\njStat.gammaln = function gammaln(x) {\n var j = 0;\n var cof = [\n 76.18009172947146, -86.50532032941677, 24.01409824083091,\n -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5\n ];\n var ser = 1.000000000190015;\n var xx, y, tmp;\n tmp = (y = xx = x) + 5.5;\n tmp -= (xx + 0.5) * Math.log(tmp);\n for (; j < 6; j++)\n ser += cof[j] / ++y;\n return Math.log(2.5066282746310005 * ser / xx) - tmp;\n};\n\n/*\n * log-gamma function to support poisson distribution sampling. The\n * algorithm comes from SPECFUN by Shanjie Zhang and Jianming Jin and their\n * book \"Computation of Special Functions\", 1996, John Wiley & Sons, Inc.\n */\njStat.loggam = function loggam(x) {\n var x0, x2, xp, gl, gl0;\n var k, n;\n\n var a = [8.333333333333333e-02, -2.777777777777778e-03,\n 7.936507936507937e-04, -5.952380952380952e-04,\n 8.417508417508418e-04, -1.917526917526918e-03,\n 6.410256410256410e-03, -2.955065359477124e-02,\n 1.796443723688307e-01, -1.39243221690590e+00];\n x0 = x;\n n = 0;\n if ((x == 1.0) || (x == 2.0)) {\n return 0.0;\n }\n if (x <= 7.0) {\n n = Math.floor(7 - x);\n x0 = x + n;\n }\n x2 = 1.0 / (x0 * x0);\n xp = 2 * Math.PI;\n gl0 = a[9];\n for (k = 8; k >= 0; k--) {\n gl0 *= x2;\n gl0 += a[k];\n }\n gl = gl0 / x0 + 0.5 * Math.log(xp) + (x0 - 0.5) * Math.log(x0) - x0;\n if (x <= 7.0) {\n for (k = 1; k <= n; k++) {\n gl -= Math.log(x0 - 1.0);\n x0 -= 1.0;\n }\n }\n return gl;\n}\n\n// gamma of x\njStat.gammafn = function gammafn(x) {\n var p = [-1.716185138865495, 24.76565080557592, -379.80425647094563,\n 629.3311553128184, 866.9662027904133, -31451.272968848367,\n -36144.413418691176, 66456.14382024054\n ];\n var q = [-30.8402300119739, 315.35062697960416, -1015.1563674902192,\n -3107.771671572311, 22538.118420980151, 4755.8462775278811,\n -134659.9598649693, -115132.2596755535];\n var fact = false;\n var n = 0;\n var xden = 0;\n var xnum = 0;\n var y = x;\n var i, z, yi, res;\n if (x > 171.6243769536076) {\n return Infinity;\n }\n if (y <= 0) {\n res = y % 1 + 3.6e-16;\n if (res) {\n fact = (!(y & 1) ? 1 : -1) * Math.PI / Math.sin(Math.PI * res);\n y = 1 - y;\n } else {\n return Infinity;\n }\n }\n yi = y;\n if (y < 1) {\n z = y++;\n } else {\n z = (y -= n = (y | 0) - 1) - 1;\n }\n for (i = 0; i < 8; ++i) {\n xnum = (xnum + p[i]) * z;\n xden = xden * z + q[i];\n }\n res = xnum / xden + 1;\n if (yi < y) {\n res /= yi;\n } else if (yi > y) {\n for (i = 0; i < n; ++i) {\n res *= y;\n y++;\n }\n }\n if (fact) {\n res = fact / res;\n }\n return res;\n};\n\n\n// lower incomplete gamma function, which is usually typeset with a\n// lower-case greek gamma as the function symbol\njStat.gammap = function gammap(a, x) {\n return jStat.lowRegGamma(a, x) * jStat.gammafn(a);\n};\n\n\n// The lower regularized incomplete gamma function, usually written P(a,x)\njStat.lowRegGamma = function lowRegGamma(a, x) {\n var aln = jStat.gammaln(a);\n var ap = a;\n var sum = 1 / a;\n var del = sum;\n var b = x + 1 - a;\n var c = 1 / 1.0e-30;\n var d = 1 / b;\n var h = d;\n var i = 1;\n // calculate maximum number of itterations required for a\n var ITMAX = -~(Math.log((a >= 1) ? a : 1 / a) * 8.5 + a * 0.4 + 17);\n var an;\n\n if (x < 0 || a <= 0) {\n return NaN;\n } else if (x < a + 1) {\n for (; i <= ITMAX; i++) {\n sum += del *= x / ++ap;\n }\n return (sum * Math.exp(-x + a * Math.log(x) - (aln)));\n }\n\n for (; i <= ITMAX; i++) {\n an = -i * (i - a);\n b += 2;\n d = an * d + b;\n c = b + an / c;\n d = 1 / d;\n h *= d * c;\n }\n\n return (1 - h * Math.exp(-x + a * Math.log(x) - (aln)));\n};\n\n// natural log factorial of n\njStat.factorialln = function factorialln(n) {\n return n < 0 ? NaN : jStat.gammaln(n + 1);\n};\n\n// factorial of n\njStat.factorial = function factorial(n) {\n return n < 0 ? NaN : jStat.gammafn(n + 1);\n};\n\n// combinations of n, m\njStat.combination = function combination(n, m) {\n // make sure n or m don't exceed the upper limit of usable values\n return (n > 170 || m > 170)\n ? Math.exp(jStat.combinationln(n, m))\n : (jStat.factorial(n) / jStat.factorial(m)) / jStat.factorial(n - m);\n};\n\n\njStat.combinationln = function combinationln(n, m){\n return jStat.factorialln(n) - jStat.factorialln(m) - jStat.factorialln(n - m);\n};\n\n\n// permutations of n, m\njStat.permutation = function permutation(n, m) {\n return jStat.factorial(n) / jStat.factorial(n - m);\n};\n\n\n// beta function\njStat.betafn = function betafn(x, y) {\n // ensure arguments are positive\n if (x <= 0 || y <= 0)\n return undefined;\n // make sure x + y doesn't exceed the upper limit of usable values\n return (x + y > 170)\n ? Math.exp(jStat.betaln(x, y))\n : jStat.gammafn(x) * jStat.gammafn(y) / jStat.gammafn(x + y);\n};\n\n\n// natural logarithm of beta function\njStat.betaln = function betaln(x, y) {\n return jStat.gammaln(x) + jStat.gammaln(y) - jStat.gammaln(x + y);\n};\n\n\n// Evaluates the continued fraction for incomplete beta function by modified\n// Lentz's method.\njStat.betacf = function betacf(x, a, b) {\n var fpmin = 1e-30;\n var m = 1;\n var qab = a + b;\n var qap = a + 1;\n var qam = a - 1;\n var c = 1;\n var d = 1 - qab * x / qap;\n var m2, aa, del, h;\n\n // These q's will be used in factors that occur in the coefficients\n if (Math.abs(d) < fpmin)\n d = fpmin;\n d = 1 / d;\n h = d;\n\n for (; m <= 100; m++) {\n m2 = 2 * m;\n aa = m * (b - m) * x / ((qam + m2) * (a + m2));\n // One step (the even one) of the recurrence\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n h *= d * c;\n aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2));\n // Next step of the recurrence (the odd one)\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n del = d * c;\n h *= del;\n if (Math.abs(del - 1.0) < 3e-7)\n break;\n }\n\n return h;\n};\n\n\n// Returns the inverse of the lower regularized inomplete gamma function\njStat.gammapinv = function gammapinv(p, a) {\n var j = 0;\n var a1 = a - 1;\n var EPS = 1e-8;\n var gln = jStat.gammaln(a);\n var x, err, t, u, pp, lna1, afac;\n\n if (p >= 1)\n return Math.max(100, a + 100 * Math.sqrt(a));\n if (p <= 0)\n return 0;\n if (a > 1) {\n lna1 = Math.log(a1);\n afac = Math.exp(a1 * (lna1 - 1) - gln);\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t * (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n x = Math.max(1e-3,\n a * Math.pow(1 - 1 / (9 * a) - x / (3 * Math.sqrt(a)), 3));\n } else {\n t = 1 - a * (0.253 + a * 0.12);\n if (p < t)\n x = Math.pow(p / t, 1 / a);\n else\n x = 1 - Math.log(1 - (p - t) / (1 - t));\n }\n\n for(; j < 12; j++) {\n if (x <= 0)\n return 0;\n err = jStat.lowRegGamma(a, x) - p;\n if (a > 1)\n t = afac * Math.exp(-(x - a1) + a1 * (Math.log(x) - lna1));\n else\n t = Math.exp(-x + a1 * Math.log(x) - gln);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / x - 1))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (Math.abs(t) < EPS * x)\n break;\n }\n\n return x;\n};\n\n\n// Returns the error function erf(x)\njStat.erf = function erf(x) {\n var cof = [-1.3026537197817094, 6.4196979235649026e-1, 1.9476473204185836e-2,\n -9.561514786808631e-3, -9.46595344482036e-4, 3.66839497852761e-4,\n 4.2523324806907e-5, -2.0278578112534e-5, -1.624290004647e-6,\n 1.303655835580e-6, 1.5626441722e-8, -8.5238095915e-8,\n 6.529054439e-9, 5.059343495e-9, -9.91364156e-10,\n -2.27365122e-10, 9.6467911e-11, 2.394038e-12,\n -6.886027e-12, 8.94487e-13, 3.13092e-13,\n -1.12708e-13, 3.81e-16, 7.106e-15,\n -1.523e-15, -9.4e-17, 1.21e-16,\n -2.8e-17];\n var j = cof.length - 1;\n var isneg = false;\n var d = 0;\n var dd = 0;\n var t, ty, tmp, res;\n\n if (x < 0) {\n x = -x;\n isneg = true;\n }\n\n t = 2 / (2 + x);\n ty = 4 * t - 2;\n\n for(; j > 0; j--) {\n tmp = d;\n d = ty * d - dd + cof[j];\n dd = tmp;\n }\n\n res = t * Math.exp(-x * x + 0.5 * (cof[0] + ty * d) - dd);\n return isneg ? res - 1 : 1 - res;\n};\n\n\n// Returns the complmentary error function erfc(x)\njStat.erfc = function erfc(x) {\n return 1 - jStat.erf(x);\n};\n\n\n// Returns the inverse of the complementary error function\njStat.erfcinv = function erfcinv(p) {\n var j = 0;\n var x, err, t, pp;\n if (p >= 2)\n return -100;\n if (p <= 0)\n return 100;\n pp = (p < 1) ? p : 2 - p;\n t = Math.sqrt(-2 * Math.log(pp / 2));\n x = -0.70711 * ((2.30753 + t * 0.27061) /\n (1 + t * (0.99229 + t * 0.04481)) - t);\n for (; j < 2; j++) {\n err = jStat.erfc(x) - pp;\n x += err / (1.12837916709551257 * Math.exp(-x * x) - x * err);\n }\n return (p < 1) ? x : -x;\n};\n\n\n// Returns the inverse of the incomplete beta function\njStat.ibetainv = function ibetainv(p, a, b) {\n var EPS = 1e-8;\n var a1 = a - 1;\n var b1 = b - 1;\n var j = 0;\n var lna, lnb, pp, t, u, err, x, al, h, w, afac;\n if (p <= 0)\n return 0;\n if (p >= 1)\n return 1;\n if (a >= 1 && b >= 1) {\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t* (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n al = (x * x - 3) / 6;\n h = 2 / (1 / (2 * a - 1) + 1 / (2 * b - 1));\n w = (x * Math.sqrt(al + h) / h) - (1 / (2 * b - 1) - 1 / (2 * a - 1)) *\n (al + 5 / 6 - 2 / (3 * h));\n x = a / (a + b * Math.exp(2 * w));\n } else {\n lna = Math.log(a / (a + b));\n lnb = Math.log(b / (a + b));\n t = Math.exp(a * lna) / a;\n u = Math.exp(b * lnb) / b;\n w = t + u;\n if (p < t / w)\n x = Math.pow(a * w * p, 1 / a);\n else\n x = 1 - Math.pow(b * w * (1 - p), 1 / b);\n }\n afac = -jStat.gammaln(a) - jStat.gammaln(b) + jStat.gammaln(a + b);\n for(; j < 10; j++) {\n if (x === 0 || x === 1)\n return x;\n err = jStat.ibeta(x, a, b) - p;\n t = Math.exp(a1 * Math.log(x) + b1 * Math.log(1 - x) + afac);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * (a1 / x - b1 / (1 - x)))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (x >= 1)\n x = 0.5 * (x + t + 1);\n if (Math.abs(t) < EPS * x && j > 0)\n break;\n }\n return x;\n};\n\n\n// Returns the incomplete beta function I_x(a,b)\njStat.ibeta = function ibeta(x, a, b) {\n // Factors in front of the continued fraction.\n var bt = (x === 0 || x === 1) ? 0 :\n Math.exp(jStat.gammaln(a + b) - jStat.gammaln(a) -\n jStat.gammaln(b) + a * Math.log(x) + b *\n Math.log(1 - x));\n if (x < 0 || x > 1)\n return false;\n if (x < (a + 1) / (a + b + 2))\n // Use continued fraction directly.\n return bt * jStat.betacf(x, a, b) / a;\n // else use continued fraction after making the symmetry transformation.\n return 1 - bt * jStat.betacf(1 - x, b, a) / b;\n};\n\n\n// Returns a normal deviate (mu=0, sigma=1).\n// If n and m are specified it returns a object of normal deviates.\njStat.randn = function randn(n, m) {\n var u, v, x, y, q;\n if (!m)\n m = n;\n if (n)\n return jStat.create(n, m, function() { return jStat.randn(); });\n do {\n u = jStat._random_fn();\n v = 1.7156 * (jStat._random_fn() - 0.5);\n x = u - 0.449871;\n y = Math.abs(v) + 0.386595;\n q = x * x + y * (0.19600 * y - 0.25472 * x);\n } while (q > 0.27597 && (q > 0.27846 || v * v > -4 * Math.log(u) * u * u));\n return v / u;\n};\n\n\n// Returns a gamma deviate by the method of Marsaglia and Tsang.\njStat.randg = function randg(shape, n, m) {\n var oalph = shape;\n var a1, a2, u, v, x, mat;\n if (!m)\n m = n;\n if (!shape)\n shape = 1;\n if (n) {\n mat = jStat.zeros(n,m);\n mat.alter(function() { return jStat.randg(shape); });\n return mat;\n }\n if (shape < 1)\n shape += 1;\n a1 = shape - 1 / 3;\n a2 = 1 / Math.sqrt(9 * a1);\n do {\n do {\n x = jStat.randn();\n v = 1 + a2 * x;\n } while(v <= 0);\n v = v * v * v;\n u = jStat._random_fn();\n } while(u > 1 - 0.331 * Math.pow(x, 4) &&\n Math.log(u) > 0.5 * x*x + a1 * (1 - v + Math.log(v)));\n // alpha > 1\n if (shape == oalph)\n return a1 * v;\n // alpha < 1\n do {\n u = jStat._random_fn();\n } while(u === 0);\n return Math.pow(u, 1 / oalph) * a1 * v;\n};\n\n\n// making use of static methods on the instance\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(\n jStat.map(this, function(value) { return jStat[passfunc](value); }));\n }\n })(funcs[i]);\n})('gammaln gammafn factorial factorialln'.split(' '));\n\n\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(jStat[passfunc].apply(null, arguments));\n };\n })(funcs[i]);\n})('randn'.split(' '));\n\n}(jStat, Math));\n(function(jStat, Math) {\n\n// generate all distribution instance methods\n(function(list) {\n for (var i = 0; i < list.length; i++) (function(func) {\n // distribution instance method\n jStat[func] = function f(a, b, c) {\n if (!(this instanceof f))\n return new f(a, b, c);\n this._a = a;\n this._b = b;\n this._c = c;\n return this;\n };\n // distribution method to be used on a jStat instance\n jStat.fn[func] = function(a, b, c) {\n var newthis = jStat[func](a, b, c);\n newthis.data = this;\n return newthis;\n };\n // sample instance method\n jStat[func].prototype.sample = function(arr) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (arr)\n return jStat.alter(arr, function() {\n return jStat[func].sample(a, b, c);\n });\n else\n return jStat[func].sample(a, b, c);\n };\n // generate the pdf, cdf and inv instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function(x) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (!x && x !== 0)\n x = this.data;\n if (typeof x !== 'number') {\n return jStat.fn.map.call(x, function(x) {\n return jStat[func][fnfunc](x, a, b, c);\n });\n }\n return jStat[func][fnfunc](x, a, b, c);\n };\n })(vals[i]);\n })('pdf cdf inv'.split(' '));\n // generate the mean, median, mode and variance instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function() {\n return jStat[func][fnfunc](this._a, this._b, this._c);\n };\n })(vals[i]);\n })('mean median mode variance'.split(' '));\n })(list[i]);\n})((\n 'beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy ' +\n 'laplace lognormal noncentralt normal pareto studentt weibull uniform ' +\n 'binomial negbin hypgeom poisson triangular tukey arcsine'\n).split(' '));\n\n\n\n// extend beta function with static methods\njStat.extend(jStat.beta, {\n pdf: function pdf(x, alpha, beta) {\n // PDF is zero outside the support\n if (x > 1 || x < 0)\n return 0;\n // PDF is one for the uniform case\n if (alpha == 1 && beta == 1)\n return 1;\n\n if (alpha < 512 && beta < 512) {\n return (Math.pow(x, alpha - 1) * Math.pow(1 - x, beta - 1)) /\n jStat.betafn(alpha, beta);\n } else {\n return Math.exp((alpha - 1) * Math.log(x) +\n (beta - 1) * Math.log(1 - x) -\n jStat.betaln(alpha, beta));\n }\n },\n\n cdf: function cdf(x, alpha, beta) {\n return (x > 1 || x < 0) ? (x > 1) * 1 : jStat.ibeta(x, alpha, beta);\n },\n\n inv: function inv(x, alpha, beta) {\n return jStat.ibetainv(x, alpha, beta);\n },\n\n mean: function mean(alpha, beta) {\n return alpha / (alpha + beta);\n },\n\n median: function median(alpha, beta) {\n return jStat.ibetainv(0.5, alpha, beta);\n },\n\n mode: function mode(alpha, beta) {\n return (alpha - 1 ) / ( alpha + beta - 2);\n },\n\n // return a random sample\n sample: function sample(alpha, beta) {\n var u = jStat.randg(alpha);\n return u / (u + jStat.randg(beta));\n },\n\n variance: function variance(alpha, beta) {\n return (alpha * beta) / (Math.pow(alpha + beta, 2) * (alpha + beta + 1));\n }\n});\n\n// extend F function with static methods\njStat.extend(jStat.centralF, {\n // This implementation of the pdf function avoids float overflow\n // See the way that R calculates this value:\n // https://svn.r-project.org/R/trunk/src/nmath/df.c\n pdf: function pdf(x, df1, df2) {\n var p, q, f;\n\n if (x < 0)\n return 0;\n\n if (df1 <= 2) {\n if (x === 0 && df1 < 2) {\n return Infinity;\n }\n if (x === 0 && df1 === 2) {\n return 1;\n }\n return (1 / jStat.betafn(df1 / 2, df2 / 2)) *\n Math.pow(df1 / df2, df1 / 2) *\n Math.pow(x, (df1/2) - 1) *\n Math.pow((1 + (df1 / df2) * x), -(df1 + df2) / 2);\n }\n\n p = (df1 * x) / (df2 + x * df1);\n q = df2 / (df2 + x * df1);\n f = df1 * q / 2.0;\n return f * jStat.binomial.pdf((df1 - 2) / 2, (df1 + df2 - 2) / 2, p);\n },\n\n cdf: function cdf(x, df1, df2) {\n if (x < 0)\n return 0;\n return jStat.ibeta((df1 * x) / (df1 * x + df2), df1 / 2, df2 / 2);\n },\n\n inv: function inv(x, df1, df2) {\n return df2 / (df1 * (1 / jStat.ibetainv(x, df1 / 2, df2 / 2) - 1));\n },\n\n mean: function mean(df1, df2) {\n return (df2 > 2) ? df2 / (df2 - 2) : undefined;\n },\n\n mode: function mode(df1, df2) {\n return (df1 > 2) ? (df2 * (df1 - 2)) / (df1 * (df2 + 2)) : undefined;\n },\n\n // return a random sample\n sample: function sample(df1, df2) {\n var x1 = jStat.randg(df1 / 2) * 2;\n var x2 = jStat.randg(df2 / 2) * 2;\n return (x1 / df1) / (x2 / df2);\n },\n\n variance: function variance(df1, df2) {\n if (df2 <= 4)\n return undefined;\n return 2 * df2 * df2 * (df1 + df2 - 2) /\n (df1 * (df2 - 2) * (df2 - 2) * (df2 - 4));\n }\n});\n\n\n// extend cauchy function with static methods\njStat.extend(jStat.cauchy, {\n pdf: function pdf(x, local, scale) {\n if (scale < 0) { return 0; }\n\n return (scale / (Math.pow(x - local, 2) + Math.pow(scale, 2))) / Math.PI;\n },\n\n cdf: function cdf(x, local, scale) {\n return Math.atan((x - local) / scale) / Math.PI + 0.5;\n },\n\n inv: function(p, local, scale) {\n return local + scale * Math.tan(Math.PI * (p - 0.5));\n },\n\n median: function median(local/*, scale*/) {\n return local;\n },\n\n mode: function mode(local/*, scale*/) {\n return local;\n },\n\n sample: function sample(local, scale) {\n return jStat.randn() *\n Math.sqrt(1 / (2 * jStat.randg(0.5))) * scale + local;\n }\n});\n\n\n\n// extend chisquare function with static methods\njStat.extend(jStat.chisquare, {\n pdf: function pdf(x, dof) {\n if (x < 0)\n return 0;\n return (x === 0 && dof === 2) ? 0.5 :\n Math.exp((dof / 2 - 1) * Math.log(x) - x / 2 - (dof / 2) *\n Math.log(2) - jStat.gammaln(dof / 2));\n },\n\n cdf: function cdf(x, dof) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(dof / 2, x / 2);\n },\n\n inv: function(p, dof) {\n return 2 * jStat.gammapinv(p, 0.5 * dof);\n },\n\n mean : function(dof) {\n return dof;\n },\n\n // TODO: this is an approximation (is there a better way?)\n median: function median(dof) {\n return dof * Math.pow(1 - (2 / (9 * dof)), 3);\n },\n\n mode: function mode(dof) {\n return (dof - 2 > 0) ? dof - 2 : 0;\n },\n\n sample: function sample(dof) {\n return jStat.randg(dof / 2) * 2;\n },\n\n variance: function variance(dof) {\n return 2 * dof;\n }\n});\n\n\n\n// extend exponential function with static methods\njStat.extend(jStat.exponential, {\n pdf: function pdf(x, rate) {\n return x < 0 ? 0 : rate * Math.exp(-rate * x);\n },\n\n cdf: function cdf(x, rate) {\n return x < 0 ? 0 : 1 - Math.exp(-rate * x);\n },\n\n inv: function(p, rate) {\n return -Math.log(1 - p) / rate;\n },\n\n mean : function(rate) {\n return 1 / rate;\n },\n\n median: function (rate) {\n return (1 / rate) * Math.log(2);\n },\n\n mode: function mode(/*rate*/) {\n return 0;\n },\n\n sample: function sample(rate) {\n return -1 / rate * Math.log(jStat._random_fn());\n },\n\n variance : function(rate) {\n return Math.pow(rate, -2);\n }\n});\n\n\n\n// extend gamma function with static methods\njStat.extend(jStat.gamma, {\n pdf: function pdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return (x === 0 && shape === 1) ? 1 / scale :\n Math.exp((shape - 1) * Math.log(x) - x / scale -\n jStat.gammaln(shape) - shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(shape, x / scale);\n },\n\n inv: function(p, shape, scale) {\n return jStat.gammapinv(p, shape) * scale;\n },\n\n mean : function(shape, scale) {\n return shape * scale;\n },\n\n mode: function mode(shape, scale) {\n if(shape > 1) return (shape - 1) * scale;\n return undefined;\n },\n\n sample: function sample(shape, scale) {\n return jStat.randg(shape) * scale;\n },\n\n variance: function variance(shape, scale) {\n return shape * scale * scale;\n }\n});\n\n// extend inverse gamma function with static methods\njStat.extend(jStat.invgamma, {\n pdf: function pdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return Math.exp(-(shape + 1) * Math.log(x) - scale / x -\n jStat.gammaln(shape) + shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return 1 - jStat.lowRegGamma(shape, scale / x);\n },\n\n inv: function(p, shape, scale) {\n return scale / jStat.gammapinv(1 - p, shape);\n },\n\n mean : function(shape, scale) {\n return (shape > 1) ? scale / (shape - 1) : undefined;\n },\n\n mode: function mode(shape, scale) {\n return scale / (shape + 1);\n },\n\n sample: function sample(shape, scale) {\n return scale / jStat.randg(shape);\n },\n\n variance: function variance(shape, scale) {\n if (shape <= 2)\n return undefined;\n return scale * scale / ((shape - 1) * (shape - 1) * (shape - 2));\n }\n});\n\n\n// extend kumaraswamy function with static methods\njStat.extend(jStat.kumaraswamy, {\n pdf: function pdf(x, alpha, beta) {\n if (x === 0 && alpha === 1)\n return beta;\n else if (x === 1 && beta === 1)\n return alpha;\n return Math.exp(Math.log(alpha) + Math.log(beta) + (alpha - 1) *\n Math.log(x) + (beta - 1) *\n Math.log(1 - Math.pow(x, alpha)));\n },\n\n cdf: function cdf(x, alpha, beta) {\n if (x < 0)\n return 0;\n else if (x > 1)\n return 1;\n return (1 - Math.pow(1 - Math.pow(x, alpha), beta));\n },\n\n inv: function inv(p, alpha, beta) {\n return Math.pow(1 - Math.pow(1 - p, 1 / beta), 1 / alpha);\n },\n\n mean : function(alpha, beta) {\n return (beta * jStat.gammafn(1 + 1 / alpha) *\n jStat.gammafn(beta)) / (jStat.gammafn(1 + 1 / alpha + beta));\n },\n\n median: function median(alpha, beta) {\n return Math.pow(1 - Math.pow(2, -1 / beta), 1 / alpha);\n },\n\n mode: function mode(alpha, beta) {\n if (!(alpha >= 1 && beta >= 1 && (alpha !== 1 && beta !== 1)))\n return undefined;\n return Math.pow((alpha - 1) / (alpha * beta - 1), 1 / alpha);\n },\n\n variance: function variance(/*alpha, beta*/) {\n throw new Error('variance not yet implemented');\n // TODO: complete this\n }\n});\n\n\n\n// extend lognormal function with static methods\njStat.extend(jStat.lognormal, {\n pdf: function pdf(x, mu, sigma) {\n if (x <= 0)\n return 0;\n return Math.exp(-Math.log(x) - 0.5 * Math.log(2 * Math.PI) -\n Math.log(sigma) - Math.pow(Math.log(x) - mu, 2) /\n (2 * sigma * sigma));\n },\n\n cdf: function cdf(x, mu, sigma) {\n if (x < 0)\n return 0;\n return 0.5 +\n (0.5 * jStat.erf((Math.log(x) - mu) / Math.sqrt(2 * sigma * sigma)));\n },\n\n inv: function(p, mu, sigma) {\n return Math.exp(-1.41421356237309505 * sigma * jStat.erfcinv(2 * p) + mu);\n },\n\n mean: function mean(mu, sigma) {\n return Math.exp(mu + sigma * sigma / 2);\n },\n\n median: function median(mu/*, sigma*/) {\n return Math.exp(mu);\n },\n\n mode: function mode(mu, sigma) {\n return Math.exp(mu - sigma * sigma);\n },\n\n sample: function sample(mu, sigma) {\n return Math.exp(jStat.randn() * sigma + mu);\n },\n\n variance: function variance(mu, sigma) {\n return (Math.exp(sigma * sigma) - 1) * Math.exp(2 * mu + sigma * sigma);\n }\n});\n\n\n\n// extend noncentralt function with static methods\njStat.extend(jStat.noncentralt, {\n pdf: function pdf(x, dof, ncp) {\n var tol = 1e-14;\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.pdf(x, dof)\n\n if (Math.abs(x) < tol) { // different formula for x == 0\n return Math.exp(jStat.gammaln((dof + 1) / 2) - ncp * ncp / 2 -\n 0.5 * Math.log(Math.PI * dof) - jStat.gammaln(dof / 2));\n }\n\n // formula for x != 0\n return dof / x *\n (jStat.noncentralt.cdf(x * Math.sqrt(1 + 2 / dof), dof+2, ncp) -\n jStat.noncentralt.cdf(x, dof, ncp));\n },\n\n cdf: function cdf(x, dof, ncp) {\n var tol = 1e-14;\n var min_iterations = 200;\n\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.cdf(x, dof);\n\n // turn negative x into positive and flip result afterwards\n var flip = false;\n if (x < 0) {\n flip = true;\n ncp = -ncp;\n }\n\n var prob = jStat.normal.cdf(-ncp, 0, 1);\n var value = tol + 1;\n // use value at last two steps to determine convergence\n var lastvalue = value;\n var y = x * x / (x * x + dof);\n var j = 0;\n var p = Math.exp(-ncp * ncp / 2);\n var q = Math.exp(-ncp * ncp / 2 - 0.5 * Math.log(2) -\n jStat.gammaln(3 / 2)) * ncp;\n while (j < min_iterations || lastvalue > tol || value > tol) {\n lastvalue = value;\n if (j > 0) {\n p *= (ncp * ncp) / (2 * j);\n q *= (ncp * ncp) / (2 * (j + 1 / 2));\n }\n value = p * jStat.beta.cdf(y, j + 0.5, dof / 2) +\n q * jStat.beta.cdf(y, j+1, dof/2);\n prob += 0.5 * value;\n j++;\n }\n\n return flip ? (1 - prob) : prob;\n }\n});\n\n\n// extend normal function with static methods\njStat.extend(jStat.normal, {\n pdf: function pdf(x, mean, std) {\n return Math.exp(-0.5 * Math.log(2 * Math.PI) -\n Math.log(std) - Math.pow(x - mean, 2) / (2 * std * std));\n },\n\n cdf: function cdf(x, mean, std) {\n return 0.5 * (1 + jStat.erf((x - mean) / Math.sqrt(2 * std * std)));\n },\n\n inv: function(p, mean, std) {\n return -1.41421356237309505 * std * jStat.erfcinv(2 * p) + mean;\n },\n\n mean : function(mean/*, std*/) {\n return mean;\n },\n\n median: function median(mean/*, std*/) {\n return mean;\n },\n\n mode: function (mean/*, std*/) {\n return mean;\n },\n\n sample: function sample(mean, std) {\n return jStat.randn() * std + mean;\n },\n\n variance : function(mean, std) {\n return std * std;\n }\n});\n\n\n\n// extend pareto function with static methods\njStat.extend(jStat.pareto, {\n pdf: function pdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return (shape * Math.pow(scale, shape)) / Math.pow(x, shape + 1);\n },\n\n cdf: function cdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return 1 - Math.pow(scale / x, shape);\n },\n\n inv: function inv(p, scale, shape) {\n return scale / Math.pow(1 - p, 1 / shape);\n },\n\n mean: function mean(scale, shape) {\n if (shape <= 1)\n return undefined;\n return (shape * Math.pow(scale, shape)) / (shape - 1);\n },\n\n median: function median(scale, shape) {\n return scale * (shape * Math.SQRT2);\n },\n\n mode: function mode(scale/*, shape*/) {\n return scale;\n },\n\n variance : function(scale, shape) {\n if (shape <= 2)\n return undefined;\n return (scale*scale * shape) / (Math.pow(shape - 1, 2) * (shape - 2));\n }\n});\n\n\n\n// extend studentt function with static methods\njStat.extend(jStat.studentt, {\n pdf: function pdf(x, dof) {\n dof = dof > 1e100 ? 1e100 : dof;\n return (1/(Math.sqrt(dof) * jStat.betafn(0.5, dof/2))) *\n Math.pow(1 + ((x * x) / dof), -((dof + 1) / 2));\n },\n\n cdf: function cdf(x, dof) {\n var dof2 = dof / 2;\n return jStat.ibeta((x + Math.sqrt(x * x + dof)) /\n (2 * Math.sqrt(x * x + dof)), dof2, dof2);\n },\n\n inv: function(p, dof) {\n var x = jStat.ibetainv(2 * Math.min(p, 1 - p), 0.5 * dof, 0.5);\n x = Math.sqrt(dof * (1 - x) / x);\n return (p > 0.5) ? x : -x;\n },\n\n mean: function mean(dof) {\n return (dof > 1) ? 0 : undefined;\n },\n\n median: function median(/*dof*/) {\n return 0;\n },\n\n mode: function mode(/*dof*/) {\n return 0;\n },\n\n sample: function sample(dof) {\n return jStat.randn() * Math.sqrt(dof / (2 * jStat.randg(dof / 2)));\n },\n\n variance: function variance(dof) {\n return (dof > 2) ? dof / (dof - 2) : (dof > 1) ? Infinity : undefined;\n }\n});\n\n\n\n// extend weibull function with static methods\njStat.extend(jStat.weibull, {\n pdf: function pdf(x, scale, shape) {\n if (x < 0 || scale < 0 || shape < 0)\n return 0;\n return (shape / scale) * Math.pow((x / scale), (shape - 1)) *\n Math.exp(-(Math.pow((x / scale), shape)));\n },\n\n cdf: function cdf(x, scale, shape) {\n return x < 0 ? 0 : 1 - Math.exp(-Math.pow((x / scale), shape));\n },\n\n inv: function(p, scale, shape) {\n return scale * Math.pow(-Math.log(1 - p), 1 / shape);\n },\n\n mean : function(scale, shape) {\n return scale * jStat.gammafn(1 + 1 / shape);\n },\n\n median: function median(scale, shape) {\n return scale * Math.pow(Math.log(2), 1 / shape);\n },\n\n mode: function mode(scale, shape) {\n if (shape <= 1)\n return 0;\n return scale * Math.pow((shape - 1) / shape, 1 / shape);\n },\n\n sample: function sample(scale, shape) {\n return scale * Math.pow(-Math.log(jStat._random_fn()), 1 / shape);\n },\n\n variance: function variance(scale, shape) {\n return scale * scale * jStat.gammafn(1 + 2 / shape) -\n Math.pow(jStat.weibull.mean(scale, shape), 2);\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.uniform, {\n pdf: function pdf(x, a, b) {\n return (x < a || x > b) ? 0 : 1 / (b - a);\n },\n\n cdf: function cdf(x, a, b) {\n if (x < a)\n return 0;\n else if (x < b)\n return (x - a) / (b - a);\n return 1;\n },\n\n inv: function(p, a, b) {\n return a + (p * (b - a));\n },\n\n mean: function mean(a, b) {\n return 0.5 * (a + b);\n },\n\n median: function median(a, b) {\n return jStat.mean(a, b);\n },\n\n mode: function mode(/*a, b*/) {\n throw new Error('mode is not yet implemented');\n },\n\n sample: function sample(a, b) {\n return (a / 2 + b / 2) + (b / 2 - a / 2) * (2 * jStat._random_fn() - 1);\n },\n\n variance: function variance(a, b) {\n return Math.pow(b - a, 2) / 12;\n }\n});\n\n\n// Got this from http://www.math.ucla.edu/~tom/distributions/binomial.html\nfunction betinc(x, a, b, eps) {\n var a0 = 0;\n var b0 = 1;\n var a1 = 1;\n var b1 = 1;\n var m9 = 0;\n var a2 = 0;\n var c9;\n\n while (Math.abs((a1 - a2) / a1) > eps) {\n a2 = a1;\n c9 = -(a + m9) * (a + b + m9) * x / (a + 2 * m9) / (a + 2 * m9 + 1);\n a0 = a1 + c9 * a0;\n b0 = b1 + c9 * b0;\n m9 = m9 + 1;\n c9 = m9 * (b - m9) * x / (a + 2 * m9 - 1) / (a + 2 * m9);\n a1 = a0 + c9 * a1;\n b1 = b0 + c9 * b1;\n a0 = a0 / b1;\n b0 = b0 / b1;\n a1 = a1 / b1;\n b1 = 1;\n }\n\n return a1 / a;\n}\n\n\n// extend uniform function with static methods\njStat.extend(jStat.binomial, {\n pdf: function pdf(k, n, p) {\n return (p === 0 || p === 1) ?\n ((n * p) === k ? 1 : 0) :\n jStat.combination(n, k) * Math.pow(p, k) * Math.pow(1 - p, n - k);\n },\n\n cdf: function cdf(x, n, p) {\n var betacdf;\n var eps = 1e-10;\n\n if (x < 0)\n return 0;\n if (x >= n)\n return 1;\n if (p < 0 || p > 1 || n <= 0)\n return NaN;\n\n x = Math.floor(x);\n var z = p;\n var a = x + 1;\n var b = n - x;\n var s = a + b;\n var bt = Math.exp(jStat.gammaln(s) - jStat.gammaln(b) -\n jStat.gammaln(a) + a * Math.log(z) + b * Math.log(1 - z));\n\n if (z < (a + 1) / (s + 2))\n betacdf = bt * betinc(z, a, b, eps);\n else\n betacdf = 1 - bt * betinc(1 - z, b, a, eps);\n\n return Math.round((1 - betacdf) * (1 / eps)) / (1 / eps);\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.negbin, {\n pdf: function pdf(k, r, p) {\n if (k !== k >>> 0)\n return false;\n if (k < 0)\n return 0;\n return jStat.combination(k + r - 1, r - 1) *\n Math.pow(1 - p, k) * Math.pow(p, r);\n },\n\n cdf: function cdf(x, r, p) {\n var sum = 0,\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sum += jStat.negbin.pdf(k, r, p);\n }\n return sum;\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.hypgeom, {\n pdf: function pdf(k, N, m, n) {\n // Hypergeometric PDF.\n\n // A simplification of the CDF algorithm below.\n\n // k = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(k !== k | 0) {\n return false;\n } else if(k < 0 || k < m - (N - n)) {\n // It's impossible to have this few successes drawn.\n return 0;\n } else if(k > n || k > m) {\n // It's impossible to have this many successes drawn.\n return 0;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.pdf(N - m - n + k, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return jStat.hypgeom.pdf(n - k, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return jStat.hypgeom.pdf(m - k, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.pdf(k, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate product to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < k; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledPDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n scaledPDF *= 1 - (m / (N - samplesDone));\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledPDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledPDF));\n }\n },\n\n cdf: function cdf(x, N, m, n) {\n // Hypergeometric CDF.\n\n // This algorithm is due to Prof. Thomas S. Ferguson, ,\n // and comes from his hypergeometric test calculator at\n // .\n\n // x = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(x < 0 || x < m - (N - n)) {\n // It's impossible to have this few successes drawn or fewer.\n return 0;\n } else if(x >= n || x >= m) {\n // We will always have this many successes or fewer.\n return 1;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.cdf(N - m - n + x, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return 1 - jStat.hypgeom.cdf(n - x - 1, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return 1 - jStat.hypgeom.cdf(m - x - 1, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.cdf(x, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate sum to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // Holds the intermediate, scaled total CDF.\n var scaledCDF = 1;\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < x; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledCDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n var factor = 1 - (m / (N - samplesDone));\n\n scaledPDF *= factor;\n scaledCDF *= factor;\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n\n // Add to the CDF answer.\n scaledCDF += scaledPDF;\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledCDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledCDF));\n }\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.poisson, {\n pdf: function pdf(k, l) {\n if (l < 0 || (k % 1) !== 0 || k < 0) {\n return 0;\n }\n\n return Math.pow(l, k) * Math.exp(-l) / jStat.factorial(k);\n },\n\n cdf: function cdf(x, l) {\n var sumarr = [],\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sumarr.push(jStat.poisson.pdf(k, l));\n }\n return jStat.sum(sumarr);\n },\n\n mean : function(l) {\n return l;\n },\n\n variance : function(l) {\n return l;\n },\n\n sampleSmall: function sampleSmall(l) {\n var p = 1, k = 0, L = Math.exp(-l);\n do {\n k++;\n p *= jStat._random_fn();\n } while (p > L);\n return k - 1;\n },\n\n sampleLarge: function sampleLarge(l) {\n var lam = l;\n var k;\n var U, V, slam, loglam, a, b, invalpha, vr, us;\n\n slam = Math.sqrt(lam);\n loglam = Math.log(lam);\n b = 0.931 + 2.53 * slam;\n a = -0.059 + 0.02483 * b;\n invalpha = 1.1239 + 1.1328 / (b - 3.4);\n vr = 0.9277 - 3.6224 / (b - 2);\n\n while (1) {\n U = Math.random() - 0.5;\n V = Math.random();\n us = 0.5 - Math.abs(U);\n k = Math.floor((2 * a / us + b) * U + lam + 0.43);\n if ((us >= 0.07) && (V <= vr)) {\n return k;\n }\n if ((k < 0) || ((us < 0.013) && (V > us))) {\n continue;\n }\n /* log(V) == log(0.0) ok here */\n /* if U==0.0 so that us==0.0, log is ok since always returns */\n if ((Math.log(V) + Math.log(invalpha) - Math.log(a / (us * us) + b)) <= (-lam + k * loglam - jStat.loggam(k + 1))) {\n return k;\n }\n }\n },\n\n sample: function sample(l) {\n if (l < 10)\n return this.sampleSmall(l);\n else\n return this.sampleLarge(l);\n }\n});\n\n// extend triangular function with static methods\njStat.extend(jStat.triangular, {\n pdf: function pdf(x, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (x < a || x > b) {\n return 0;\n } else if (x < c) {\n return (2 * (x - a)) / ((b - a) * (c - a));\n } else if (x === c) {\n return (2 / (b - a));\n } else { // x > c\n return (2 * (b - x)) / ((b - a) * (b - c));\n }\n }\n },\n\n cdf: function cdf(x, a, b, c) {\n if (b <= a || c < a || c > b)\n return NaN;\n if (x <= a)\n return 0;\n else if (x >= b)\n return 1;\n if (x <= c)\n return Math.pow(x - a, 2) / ((b - a) * (c - a));\n else // x > c\n return 1 - Math.pow(b - x, 2) / ((b - a) * (b - c));\n },\n\n inv: function inv(p, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (p <= ((c - a) / (b - a))) {\n return a + (b - a) * Math.sqrt(p * ((c - a) / (b - a)));\n } else { // p > ((c - a) / (b - a))\n return a + (b - a) * (1 - Math.sqrt((1 - p) * (1 - ((c - a) / (b - a)))));\n }\n }\n },\n\n mean: function mean(a, b, c) {\n return (a + b + c) / 3;\n },\n\n median: function median(a, b, c) {\n if (c <= (a + b) / 2) {\n return b - Math.sqrt((b - a) * (b - c)) / Math.sqrt(2);\n } else if (c > (a + b) / 2) {\n return a + Math.sqrt((b - a) * (c - a)) / Math.sqrt(2);\n }\n },\n\n mode: function mode(a, b, c) {\n return c;\n },\n\n sample: function sample(a, b, c) {\n var u = jStat._random_fn();\n if (u < ((c - a) / (b - a)))\n return a + Math.sqrt(u * (b - a) * (c - a))\n return b - Math.sqrt((1 - u) * (b - a) * (b - c));\n },\n\n variance: function variance(a, b, c) {\n return (a * a + b * b + c * c - a * b - a * c - b * c) / 18;\n }\n});\n\n\n// extend arcsine function with static methods\njStat.extend(jStat.arcsine, {\n pdf: function pdf(x, a, b) {\n if (b <= a) return NaN;\n\n return (x <= a || x >= b) ? 0 :\n (2 / Math.PI) *\n Math.pow(Math.pow(b - a, 2) -\n Math.pow(2 * x - a - b, 2), -0.5);\n },\n\n cdf: function cdf(x, a, b) {\n if (x < a)\n return 0;\n else if (x < b)\n return (2 / Math.PI) * Math.asin(Math.sqrt((x - a)/(b - a)));\n return 1;\n },\n\n inv: function(p, a, b) {\n return a + (0.5 - 0.5 * Math.cos(Math.PI * p)) * (b - a);\n },\n\n mean: function mean(a, b) {\n if (b <= a) return NaN;\n return (a + b) / 2;\n },\n\n median: function median(a, b) {\n if (b <= a) return NaN;\n return (a + b) / 2;\n },\n\n mode: function mode(/*a, b*/) {\n throw new Error('mode is not yet implemented');\n },\n\n sample: function sample(a, b) {\n return ((a + b) / 2) + ((b - a) / 2) *\n Math.sin(2 * Math.PI * jStat.uniform.sample(0, 1));\n },\n\n variance: function variance(a, b) {\n if (b <= a) return NaN;\n return Math.pow(b - a, 2) / 8;\n }\n});\n\n\nfunction laplaceSign(x) { return x / Math.abs(x); }\n\njStat.extend(jStat.laplace, {\n pdf: function pdf(x, mu, b) {\n return (b <= 0) ? 0 : (Math.exp(-Math.abs(x - mu) / b)) / (2 * b);\n },\n\n cdf: function cdf(x, mu, b) {\n if (b <= 0) { return 0; }\n\n if(x < mu) {\n return 0.5 * Math.exp((x - mu) / b);\n } else {\n return 1 - 0.5 * Math.exp(- (x - mu) / b);\n }\n },\n\n mean: function(mu/*, b*/) {\n return mu;\n },\n\n median: function(mu/*, b*/) {\n return mu;\n },\n\n mode: function(mu/*, b*/) {\n return mu;\n },\n\n variance: function(mu, b) {\n return 2 * b * b;\n },\n\n sample: function sample(mu, b) {\n var u = jStat._random_fn() - 0.5;\n\n return mu - (b * laplaceSign(u) * Math.log(1 - (2 * Math.abs(u))));\n }\n});\n\nfunction tukeyWprob(w, rr, cc) {\n var nleg = 12;\n var ihalf = 6;\n\n var C1 = -30;\n var C2 = -50;\n var C3 = 60;\n var bb = 8;\n var wlar = 3;\n var wincr1 = 2;\n var wincr2 = 3;\n var xleg = [\n 0.981560634246719250690549090149,\n 0.904117256370474856678465866119,\n 0.769902674194304687036893833213,\n 0.587317954286617447296702418941,\n 0.367831498998180193752691536644,\n 0.125233408511468915472441369464\n ];\n var aleg = [\n 0.047175336386511827194615961485,\n 0.106939325995318430960254718194,\n 0.160078328543346226334652529543,\n 0.203167426723065921749064455810,\n 0.233492536538354808760849898925,\n 0.249147045813402785000562436043\n ];\n\n var qsqz = w * 0.5;\n\n // if w >= 16 then the integral lower bound (occurs for c=20)\n // is 0.99999999999995 so return a value of 1.\n\n if (qsqz >= bb)\n return 1.0;\n\n // find (f(w/2) - 1) ^ cc\n // (first term in integral of hartley's form).\n\n var pr_w = 2 * jStat.normal.cdf(qsqz, 0, 1, 1, 0) - 1; // erf(qsqz / M_SQRT2)\n // if pr_w ^ cc < 2e-22 then set pr_w = 0\n if (pr_w >= Math.exp(C2 / cc))\n pr_w = Math.pow(pr_w, cc);\n else\n pr_w = 0.0;\n\n // if w is large then the second component of the\n // integral is small, so fewer intervals are needed.\n\n var wincr;\n if (w > wlar)\n wincr = wincr1;\n else\n wincr = wincr2;\n\n // find the integral of second term of hartley's form\n // for the integral of the range for equal-length\n // intervals using legendre quadrature. limits of\n // integration are from (w/2, 8). two or three\n // equal-length intervals are used.\n\n // blb and bub are lower and upper limits of integration.\n\n var blb = qsqz;\n var binc = (bb - qsqz) / wincr;\n var bub = blb + binc;\n var einsum = 0.0;\n\n // integrate over each interval\n\n var cc1 = cc - 1.0;\n for (var wi = 1; wi <= wincr; wi++) {\n var elsum = 0.0;\n var a = 0.5 * (bub + blb);\n\n // legendre quadrature with order = nleg\n\n var b = 0.5 * (bub - blb);\n\n for (var jj = 1; jj <= nleg; jj++) {\n var j, xx;\n if (ihalf < jj) {\n j = (nleg - jj) + 1;\n xx = xleg[j-1];\n } else {\n j = jj;\n xx = -xleg[j-1];\n }\n var c = b * xx;\n var ac = a + c;\n\n // if exp(-qexpo/2) < 9e-14,\n // then doesn't contribute to integral\n\n var qexpo = ac * ac;\n if (qexpo > C3)\n break;\n\n var pplus = 2 * jStat.normal.cdf(ac, 0, 1, 1, 0);\n var pminus= 2 * jStat.normal.cdf(ac, w, 1, 1, 0);\n\n // if rinsum ^ (cc-1) < 9e-14,\n // then doesn't contribute to integral\n\n var rinsum = (pplus * 0.5) - (pminus * 0.5);\n if (rinsum >= Math.exp(C1 / cc1)) {\n rinsum = (aleg[j-1] * Math.exp(-(0.5 * qexpo))) * Math.pow(rinsum, cc1);\n elsum += rinsum;\n }\n }\n elsum *= (((2.0 * b) * cc) / Math.sqrt(2 * Math.PI));\n einsum += elsum;\n blb = bub;\n bub += binc;\n }\n\n // if pr_w ^ rr < 9e-14, then return 0\n pr_w += einsum;\n if (pr_w <= Math.exp(C1 / rr))\n return 0;\n\n pr_w = Math.pow(pr_w, rr);\n if (pr_w >= 1) // 1 was iMax was eps\n return 1;\n return pr_w;\n}\n\nfunction tukeyQinv(p, c, v) {\n var p0 = 0.322232421088;\n var q0 = 0.993484626060e-01;\n var p1 = -1.0;\n var q1 = 0.588581570495;\n var p2 = -0.342242088547;\n var q2 = 0.531103462366;\n var p3 = -0.204231210125;\n var q3 = 0.103537752850;\n var p4 = -0.453642210148e-04;\n var q4 = 0.38560700634e-02;\n var c1 = 0.8832;\n var c2 = 0.2368;\n var c3 = 1.214;\n var c4 = 1.208;\n var c5 = 1.4142;\n var vmax = 120.0;\n\n var ps = 0.5 - 0.5 * p;\n var yi = Math.sqrt(Math.log(1.0 / (ps * ps)));\n var t = yi + (((( yi * p4 + p3) * yi + p2) * yi + p1) * yi + p0)\n / (((( yi * q4 + q3) * yi + q2) * yi + q1) * yi + q0);\n if (v < vmax) t += (t * t * t + t) / v / 4.0;\n var q = c1 - c2 * t;\n if (v < vmax) q += -c3 / v + c4 * t / v;\n return t * (q * Math.log(c - 1.0) + c5);\n}\n\njStat.extend(jStat.tukey, {\n cdf: function cdf(q, nmeans, df) {\n // Identical implementation as the R ptukey() function as of commit 68947\n var rr = 1;\n var cc = nmeans;\n\n var nlegq = 16;\n var ihalfq = 8;\n\n var eps1 = -30.0;\n var eps2 = 1.0e-14;\n var dhaf = 100.0;\n var dquar = 800.0;\n var deigh = 5000.0;\n var dlarg = 25000.0;\n var ulen1 = 1.0;\n var ulen2 = 0.5;\n var ulen3 = 0.25;\n var ulen4 = 0.125;\n var xlegq = [\n 0.989400934991649932596154173450,\n 0.944575023073232576077988415535,\n 0.865631202387831743880467897712,\n 0.755404408355003033895101194847,\n 0.617876244402643748446671764049,\n 0.458016777657227386342419442984,\n 0.281603550779258913230460501460,\n 0.950125098376374401853193354250e-1\n ];\n var alegq = [\n 0.271524594117540948517805724560e-1,\n 0.622535239386478928628438369944e-1,\n 0.951585116824927848099251076022e-1,\n 0.124628971255533872052476282192,\n 0.149595988816576732081501730547,\n 0.169156519395002538189312079030,\n 0.182603415044923588866763667969,\n 0.189450610455068496285396723208\n ];\n\n if (q <= 0)\n return 0;\n\n // df must be > 1\n // there must be at least two values\n\n if (df < 2 || rr < 1 || cc < 2) return NaN;\n\n if (!Number.isFinite(q))\n return 1;\n\n if (df > dlarg)\n return tukeyWprob(q, rr, cc);\n\n // calculate leading constant\n\n var f2 = df * 0.5;\n var f2lf = ((f2 * Math.log(df)) - (df * Math.log(2))) - jStat.gammaln(f2);\n var f21 = f2 - 1.0;\n\n // integral is divided into unit, half-unit, quarter-unit, or\n // eighth-unit length intervals depending on the value of the\n // degrees of freedom.\n\n var ff4 = df * 0.25;\n var ulen;\n if (df <= dhaf) ulen = ulen1;\n else if (df <= dquar) ulen = ulen2;\n else if (df <= deigh) ulen = ulen3;\n else ulen = ulen4;\n\n f2lf += Math.log(ulen);\n\n // integrate over each subinterval\n\n var ans = 0.0;\n\n for (var i = 1; i <= 50; i++) {\n var otsum = 0.0;\n\n // legendre quadrature with order = nlegq\n // nodes (stored in xlegq) are symmetric around zero.\n\n var twa1 = (2 * i - 1) * ulen;\n\n for (var jj = 1; jj <= nlegq; jj++) {\n var j, t1;\n if (ihalfq < jj) {\n j = jj - ihalfq - 1;\n t1 = (f2lf + (f21 * Math.log(twa1 + (xlegq[j] * ulen))))\n - (((xlegq[j] * ulen) + twa1) * ff4);\n } else {\n j = jj - 1;\n t1 = (f2lf + (f21 * Math.log(twa1 - (xlegq[j] * ulen))))\n + (((xlegq[j] * ulen) - twa1) * ff4);\n }\n\n // if exp(t1) < 9e-14, then doesn't contribute to integral\n var qsqz;\n if (t1 >= eps1) {\n if (ihalfq < jj) {\n qsqz = q * Math.sqrt(((xlegq[j] * ulen) + twa1) * 0.5);\n } else {\n qsqz = q * Math.sqrt(((-(xlegq[j] * ulen)) + twa1) * 0.5);\n }\n\n // call wprob to find integral of range portion\n\n var wprb = tukeyWprob(qsqz, rr, cc);\n var rotsum = (wprb * alegq[j]) * Math.exp(t1);\n otsum += rotsum;\n }\n // end legendre integral for interval i\n // L200:\n }\n\n // if integral for interval i < 1e-14, then stop.\n // However, in order to avoid small area under left tail,\n // at least 1 / ulen intervals are calculated.\n if (i * ulen >= 1.0 && otsum <= eps2)\n break;\n\n // end of interval i\n // L330:\n\n ans += otsum;\n }\n\n if (otsum > eps2) { // not converged\n throw new Error('tukey.cdf failed to converge');\n }\n if (ans > 1)\n ans = 1;\n return ans;\n },\n\n inv: function(p, nmeans, df) {\n // Identical implementation as the R qtukey() function as of commit 68947\n var rr = 1;\n var cc = nmeans;\n\n var eps = 0.0001;\n var maxiter = 50;\n\n // df must be > 1 ; there must be at least two values\n if (df < 2 || rr < 1 || cc < 2) return NaN;\n\n if (p < 0 || p > 1) return NaN;\n if (p === 0) return 0;\n if (p === 1) return Infinity;\n\n // Initial value\n\n var x0 = tukeyQinv(p, cc, df);\n\n // Find prob(value < x0)\n\n var valx0 = jStat.tukey.cdf(x0, nmeans, df) - p;\n\n // Find the second iterate and prob(value < x1).\n // If the first iterate has probability value\n // exceeding p then second iterate is 1 less than\n // first iterate; otherwise it is 1 greater.\n\n var x1;\n if (valx0 > 0.0)\n x1 = Math.max(0.0, x0 - 1.0);\n else\n x1 = x0 + 1.0;\n var valx1 = jStat.tukey.cdf(x1, nmeans, df) - p;\n\n // Find new iterate\n\n var ans;\n for(var iter = 1; iter < maxiter; iter++) {\n ans = x1 - ((valx1 * (x1 - x0)) / (valx1 - valx0));\n valx0 = valx1;\n\n // New iterate must be >= 0\n\n x0 = x1;\n if (ans < 0.0) {\n ans = 0.0;\n valx1 = -p;\n }\n // Find prob(value < new iterate)\n\n valx1 = jStat.tukey.cdf(ans, nmeans, df) - p;\n x1 = ans;\n\n // If the difference between two successive\n // iterates is less than eps, stop\n\n var xabs = Math.abs(x1 - x0);\n if (xabs < eps)\n return ans;\n }\n\n throw new Error('tukey.inv failed to converge');\n }\n});\n\n}(jStat, Math));\n/* Provides functions for the solution of linear system of equations, integration, extrapolation,\n * interpolation, eigenvalue problems, differential equations and PCA analysis. */\n\n(function(jStat, Math) {\n\nvar push = Array.prototype.push;\nvar isArray = jStat.utils.isArray;\n\nfunction isUsable(arg) {\n return isArray(arg) || arg instanceof jStat;\n}\n\njStat.extend({\n\n // add a vector/matrix to a vector/matrix or scalar\n add: function add(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value + arg[row][col];\n });\n }\n return jStat.map(arr, function(value) { return value + arg; });\n },\n\n // subtract a vector or scalar from the vector\n subtract: function subtract(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value - arg[row][col] || 0;\n });\n }\n return jStat.map(arr, function(value) { return value - arg; });\n },\n\n // matrix division\n divide: function divide(arr, arg) {\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.multiply(arr, jStat.inv(arg));\n }\n return jStat.map(arr, function(value) { return value / arg; });\n },\n\n // matrix multiplication\n multiply: function multiply(arr, arg) {\n var row, col, nrescols, sum, nrow, ncol, res, rescols;\n // eg: arr = 2 arg = 3 -> 6 for res[0][0] statement closure\n if (arr.length === undefined && arg.length === undefined) {\n return arr * arg;\n }\n nrow = arr.length,\n ncol = arr[0].length,\n res = jStat.zeros(nrow, nrescols = (isUsable(arg)) ? arg[0].length : ncol),\n rescols = 0;\n if (isUsable(arg)) {\n for (; rescols < nrescols; rescols++) {\n for (row = 0; row < nrow; row++) {\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += arr[row][col] * arg[col][rescols];\n res[row][rescols] = sum;\n }\n }\n return (nrow === 1 && rescols === 1) ? res[0][0] : res;\n }\n return jStat.map(arr, function(value) { return value * arg; });\n },\n\n // outer([1,2,3],[4,5,6])\n // ===\n // [[1],[2],[3]] times [[4,5,6]]\n // ->\n // [[4,5,6],[8,10,12],[12,15,18]]\n outer:function outer(A, B) {\n return jStat.multiply(A.map(function(t){ return [t] }), [B]);\n },\n\n\n // Returns the dot product of two matricies\n dot: function dot(arr, arg) {\n if (!isUsable(arr[0])) arr = [ arr ];\n if (!isUsable(arg[0])) arg = [ arg ];\n // convert column to row vector\n var left = (arr[0].length === 1 && arr.length !== 1) ? jStat.transpose(arr) : arr,\n right = (arg[0].length === 1 && arg.length !== 1) ? jStat.transpose(arg) : arg,\n res = [],\n row = 0,\n nrow = left.length,\n ncol = left[0].length,\n sum, col;\n for (; row < nrow; row++) {\n res[row] = [];\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += left[row][col] * right[row][col];\n res[row] = sum;\n }\n return (res.length === 1) ? res[0] : res;\n },\n\n // raise every element by a scalar\n pow: function pow(arr, arg) {\n return jStat.map(arr, function(value) { return Math.pow(value, arg); });\n },\n\n // exponentiate every element\n exp: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.exp(value); });\n },\n\n // generate the natural log of every element\n log: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.log(value); });\n },\n\n // generate the absolute values of the vector\n abs: function abs(arr) {\n return jStat.map(arr, function(value) { return Math.abs(value); });\n },\n\n // computes the p-norm of the vector\n // In the case that a matrix is passed, uses the first row as the vector\n norm: function norm(arr, p) {\n var nnorm = 0,\n i = 0;\n // check the p-value of the norm, and set for most common case\n if (isNaN(p)) p = 2;\n // check if multi-dimensional array, and make vector correction\n if (isUsable(arr[0])) arr = arr[0];\n // vector norm\n for (; i < arr.length; i++) {\n nnorm += Math.pow(Math.abs(arr[i]), p);\n }\n return Math.pow(nnorm, 1 / p);\n },\n\n // computes the angle between two vectors in rads\n // In case a matrix is passed, this uses the first row as the vector\n angle: function angle(arr, arg) {\n return Math.acos(jStat.dot(arr, arg) / (jStat.norm(arr) * jStat.norm(arg)));\n },\n\n // augment one matrix by another\n // Note: this function returns a matrix, not a jStat object\n aug: function aug(a, b) {\n var newarr = [];\n var i;\n for (i = 0; i < a.length; i++) {\n newarr.push(a[i].slice());\n }\n for (i = 0; i < newarr.length; i++) {\n push.apply(newarr[i], b[i]);\n }\n return newarr;\n },\n\n // The inv() function calculates the inverse of a matrix\n // Create the inverse by augmenting the matrix by the identity matrix of the\n // appropriate size, and then use G-J elimination on the augmented matrix.\n inv: function inv(a) {\n var rows = a.length;\n var cols = a[0].length;\n var b = jStat.identity(rows, cols);\n var c = jStat.gauss_jordan(a, b);\n var result = [];\n var i = 0;\n var j;\n\n //We need to copy the inverse portion to a new matrix to rid G-J artifacts\n for (; i < rows; i++) {\n result[i] = [];\n for (j = cols; j < c[0].length; j++)\n result[i][j - cols] = c[i][j];\n }\n return result;\n },\n\n // calculate the determinant of a matrix\n det: function det(a) {\n if (a.length === 2) {\n return a[0][0] * a[1][1] - a[0][1] * a[1][0];\n }\n\n var determinant = 0;\n for (var i = 0; i < a.length; i++) {\n // build a sub matrix without column `i`\n var submatrix = [];\n for (var row = 1; row < a.length; row++) {\n submatrix[row - 1] = [];\n for (var col = 0; col < a.length; col++) {\n if (col < i) {\n submatrix[row - 1][col] = a[row][col];\n } else if (col > i) {\n submatrix[row - 1][col - 1] = a[row][col];\n }\n }\n }\n\n // alternate between + and - between determinants\n var sign = i % 2 ? -1 : 1;\n determinant += det(submatrix) * a[0][i] * sign;\n }\n\n return determinant\n },\n\n gauss_elimination: function gauss_elimination(a, b) {\n var i = 0,\n j = 0,\n n = a.length,\n m = a[0].length,\n factor = 1,\n sum = 0,\n x = [],\n maug, pivot, temp, k;\n a = jStat.aug(a, b);\n maug = a[0].length;\n for(i = 0; i < n; i++) {\n pivot = a[i][i];\n j = i;\n for (k = i + 1; k < m; k++) {\n if (pivot < Math.abs(a[k][i])) {\n pivot = a[k][i];\n j = k;\n }\n }\n if (j != i) {\n for(k = 0; k < maug; k++) {\n temp = a[i][k];\n a[i][k] = a[j][k];\n a[j][k] = temp;\n }\n }\n for (j = i + 1; j < n; j++) {\n factor = a[j][i] / a[i][i];\n for(k = i; k < maug; k++) {\n a[j][k] = a[j][k] - factor * a[i][k];\n }\n }\n }\n for (i = n - 1; i >= 0; i--) {\n sum = 0;\n for (j = i + 1; j<= n - 1; j++) {\n sum = sum + x[j] * a[i][j];\n }\n x[i] =(a[i][maug - 1] - sum) / a[i][i];\n }\n return x;\n },\n\n gauss_jordan: function gauss_jordan(a, b) {\n var m = jStat.aug(a, b);\n var h = m.length;\n var w = m[0].length;\n var c = 0;\n var x, y, y2;\n // find max pivot\n for (y = 0; y < h; y++) {\n var maxrow = y;\n for (y2 = y+1; y2 < h; y2++) {\n if (Math.abs(m[y2][y]) > Math.abs(m[maxrow][y]))\n maxrow = y2;\n }\n var tmp = m[y];\n m[y] = m[maxrow];\n m[maxrow] = tmp\n for (y2 = y+1; y2 < h; y2++) {\n c = m[y2][y] / m[y][y];\n for (x = y; x < w; x++) {\n m[y2][x] -= m[y][x] * c;\n }\n }\n }\n // backsubstitute\n for (y = h-1; y >= 0; y--) {\n c = m[y][y];\n for (y2 = 0; y2 < y; y2++) {\n for (x = w-1; x > y-1; x--) {\n m[y2][x] -= m[y][x] * m[y2][y] / c;\n }\n }\n m[y][y] /= c;\n for (x = h; x < w; x++) {\n m[y][x] /= c;\n }\n }\n return m;\n },\n\n // solve equation\n // Ax=b\n // A is upper triangular matrix\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[1,2,3]\n // triaUpSolve(A,b) // -> [2.666,0.1666,1.666]\n // if you use matrix style\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[[1],[2],[3]]\n // will return [[2.666],[0.1666],[1.666]]\n triaUpSolve: function triaUpSolve(A, b) {\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n var matrix_mode = false;\n\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n parts = jStat.arange(i + 1, size).map(function(j) {\n return x[j] * A[i][j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n });\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n triaLowSolve: function triaLowSolve(A, b) {\n // like to triaUpSolve but A is lower triangular matrix\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n\n var matrix_mode=false;\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(j) {\n return A[i][j] * x[j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n })\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n\n // A -> [L,U]\n // A=LU\n // L is lower triangular matrix\n // U is upper triangular matrix\n lu: function lu(A) {\n var size = A.length;\n //var L=jStat.diagonal(jStat.ones(1,size)[0]);\n var L = jStat.identity(size);\n var R = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(t) {\n R[0][t] = A[0][t];\n });\n jStat.arange(1, size).forEach(function(l) {\n jStat.arange(l).forEach(function(i) {\n parts = jStat.arange(i).map(function(jj) {\n return L[l][jj] * R[jj][i];\n });\n L[l][i] = (A[l][i] - jStat.sum(parts)) / R[i][i];\n });\n jStat.arange(l, size).forEach(function(j) {\n parts = jStat.arange(l).map(function(jj) {\n return L[l][jj] * R[jj][j];\n });\n R[l][j] = A[parts.length][j] - jStat.sum(parts);\n });\n });\n return [L, R];\n },\n\n // A -> T\n // A=TT'\n // T is lower triangular matrix\n cholesky: function cholesky(A) {\n var size = A.length;\n var T = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(t) {\n return Math.pow(T[i][t],2);\n });\n T[i][i] = Math.sqrt(A[i][i] - jStat.sum(parts));\n jStat.arange(i + 1, size).forEach(function(j) {\n parts = jStat.arange(i).map(function(t) {\n return T[i][t] * T[j][t];\n });\n T[j][i] = (A[i][j] - jStat.sum(parts)) / T[i][i];\n });\n });\n return T;\n },\n\n\n gauss_jacobi: function gauss_jacobi(a, b, x, r) {\n var i = 0;\n var j = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(d), jStat.add(l, u)), -1);\n c = jStat.multiply(jStat.inv(d), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk,xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n gauss_seidel: function gauss_seidel(a, b, x, r) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d, l)), u), -1);\n c = jStat.multiply(jStat.inv(jStat.add(d, l)), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i = i + 1;\n }\n return xk;\n },\n\n SOR: function SOR(a, b, x, r, w) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.inv(jStat.add(d, jStat.multiply(l, w))),\n jStat.subtract(jStat.multiply(d, 1 - w),\n jStat.multiply(u, w)));\n c = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d,\n jStat.multiply(l, w))), b), w);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n householder: function householder(a) {\n var m = a.length;\n var n = a[0].length;\n var i = 0;\n var w = [];\n var p = [];\n var alpha, r, k, j, factor;\n for (; i < m - 1; i++) {\n alpha = 0;\n for (j = i + 1; j < n; j++)\n alpha += (a[j][i] * a[j][i]);\n factor = (a[i + 1][i] > 0) ? -1 : 1;\n alpha = factor * Math.sqrt(alpha);\n r = Math.sqrt((((alpha * alpha) - a[i + 1][i] * alpha) / 2));\n w = jStat.zeros(m, 1);\n w[i + 1][0] = (a[i + 1][i] - alpha) / (2 * r);\n for (k = i + 2; k < m; k++) w[k][0] = a[k][i] / (2 * r);\n p = jStat.subtract(jStat.identity(m, n),\n jStat.multiply(jStat.multiply(w, jStat.transpose(w)), 2));\n a = jStat.multiply(p, jStat.multiply(a, p));\n }\n return a;\n },\n\n // A -> [Q,R]\n // Q is orthogonal matrix\n // R is upper triangular\n QR: (function() {\n // x -> Q\n // find a orthogonal matrix Q st.\n // Qx=y\n // y is [||x||,0,0,...]\n\n // quick ref\n var sum = jStat.sum;\n var range = jStat.arange;\n\n function qr2(x) {\n // quick impletation\n // https://www.stat.wisc.edu/~larget/math496/qr.html\n\n var n = x.length;\n var p = x[0].length;\n\n var r = jStat.zeros(p, p);\n x = jStat.copy(x);\n\n var i,j,k;\n for(j = 0; j < p; j++){\n r[j][j] = Math.sqrt(sum(range(n).map(function(i){\n return x[i][j] * x[i][j];\n })));\n for(i = 0; i < n; i++){\n x[i][j] = x[i][j] / r[j][j];\n }\n for(k = j+1; k < p; k++){\n r[j][k] = sum(range(n).map(function(i){\n return x[i][j] * x[i][k];\n }));\n for(i = 0; i < n; i++){\n x[i][k] = x[i][k] - x[i][j]*r[j][k];\n }\n }\n }\n return [x, r];\n }\n\n return qr2;\n }()),\n\n lstsq: (function() {\n // solve least squard problem for Ax=b as QR decomposition way if b is\n // [[b1],[b2],[b3]] form will return [[x1],[x2],[x3]] array form solution\n // else b is [b1,b2,b3] form will return [x1,x2,x3] array form solution\n function R_I(A) {\n A = jStat.copy(A);\n var size = A.length;\n var I = jStat.identity(size);\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n jStat.sliceAssign(\n I, { row: i }, jStat.divide(jStat.slice(I, { row: i }), A[i][i]));\n jStat.sliceAssign(\n A, { row: i }, jStat.divide(jStat.slice(A, { row: i }), A[i][i]));\n jStat.arange(i).forEach(function(j) {\n var c = jStat.multiply(A[j][i], -1);\n var Aj = jStat.slice(A, { row: j });\n var cAi = jStat.multiply(jStat.slice(A, { row: i }), c);\n jStat.sliceAssign(A, { row: j }, jStat.add(Aj, cAi));\n var Ij = jStat.slice(I, { row: j });\n var cIi = jStat.multiply(jStat.slice(I, { row: i }), c);\n jStat.sliceAssign(I, { row: j }, jStat.add(Ij, cIi));\n })\n });\n return I;\n }\n\n function qr_solve(A, b){\n var array_mode = false;\n if (b[0].length === undefined) {\n // [c1,c2,c3] mode\n b = b.map(function(x){ return [x] });\n array_mode = true;\n }\n var QR = jStat.QR(A);\n var Q = QR[0];\n var R = QR[1];\n var attrs = A[0].length;\n var Q1 = jStat.slice(Q,{col:{end:attrs}});\n var R1 = jStat.slice(R,{row:{end:attrs}});\n var RI = R_I(R1);\n var Q2 = jStat.transpose(Q1);\n\n if(Q2[0].length === undefined){\n Q2 = [Q2]; // The confusing jStat.multifly implementation threat nature process again.\n }\n\n var x = jStat.multiply(jStat.multiply(RI, Q2), b);\n\n if(x.length === undefined){\n x = [[x]]; // The confusing jStat.multifly implementation threat nature process again.\n }\n\n\n if (array_mode)\n return x.map(function(i){ return i[0] });\n return x;\n }\n\n return qr_solve;\n }()),\n\n jacobi: function jacobi(a) {\n var condition = 1;\n var n = a.length;\n var e = jStat.identity(n, n);\n var ev = [];\n var b, i, j, p, q, maxim, theta, s;\n // condition === 1 only if tolerance is not reached\n while (condition === 1) {\n maxim = a[0][1];\n p = 0;\n q = 1;\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n if (i != j) {\n if (maxim < Math.abs(a[i][j])) {\n maxim = Math.abs(a[i][j]);\n p = i;\n q = j;\n }\n }\n }\n }\n if (a[p][p] === a[q][q])\n theta = (a[p][q] > 0) ? Math.PI / 4 : -Math.PI / 4;\n else\n theta = Math.atan(2 * a[p][q] / (a[p][p] - a[q][q])) / 2;\n s = jStat.identity(n, n);\n s[p][p] = Math.cos(theta);\n s[p][q] = -Math.sin(theta);\n s[q][p] = Math.sin(theta);\n s[q][q] = Math.cos(theta);\n // eigen vector matrix\n e = jStat.multiply(e, s);\n b = jStat.multiply(jStat.multiply(jStat.inv(s), a), s);\n a = b;\n condition = 0;\n for (i = 1; i < n; i++) {\n for (j = 1; j < n; j++) {\n if (i != j && Math.abs(a[i][j]) > 0.001) {\n condition = 1;\n }\n }\n }\n }\n for (i = 0; i < n; i++) ev.push(a[i][i]);\n //returns both the eigenvalue and eigenmatrix\n return [e, ev];\n },\n\n rungekutta: function rungekutta(f, h, p, t_j, u_j, order) {\n var k1, k2, u_j1, k3, k4;\n if (order === 2) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h, u_j + k1);\n u_j1 = u_j + (k1 + k2) / 2;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n if (order === 4) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h / 2, u_j + k1 / 2);\n k3 = h * f(t_j + h / 2, u_j + k2 / 2);\n k4 = h * f(t_j +h, u_j + k3);\n u_j1 = u_j + (k1 + 2 * k2 + 2 * k3 + k4) / 6;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n return u_j;\n },\n\n romberg: function romberg(f, a, b, order) {\n var i = 0;\n var h = (b - a) / 2;\n var x = [];\n var h1 = [];\n var g = [];\n var m, a1, j, k, I;\n while (i < order / 2) {\n I = f(a);\n for (j = a, k = 0; j <= b; j = j + h, k++) x[k] = j;\n m = x.length;\n for (j = 1; j < m - 1; j++) {\n I += (((j % 2) !== 0) ? 4 : 2) * f(x[j]);\n }\n I = (h / 3) * (I + f(b));\n g[i] = I;\n h /= 2;\n i++;\n }\n a1 = g.length;\n m = 1;\n while (a1 !== 1) {\n for (j = 0; j < a1 - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a1 = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n richardson: function richardson(X, f, x, h) {\n function pos(X, x) {\n var i = 0;\n var n = X.length;\n var p;\n for (; i < n; i++)\n if (X[i] === x) p = i;\n return p;\n }\n var h_min = Math.abs(x - X[pos(X, x) + 1]);\n var i = 0;\n var g = [];\n var h1 = [];\n var y1, y2, m, a, j;\n while (h >= h_min) {\n y1 = pos(X, x + h);\n y2 = pos(X, x);\n g[i] = (f[y1] - 2 * f[y2] + f[2 * y2 - y1]) / (h * h);\n h /= 2;\n i++;\n }\n a = g.length;\n m = 1;\n while (a != 1) {\n for (j = 0; j < a - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n simpson: function simpson(f, a, b, n) {\n var h = (b - a) / n;\n var I = f(a);\n var x = [];\n var j = a;\n var k = 0;\n var i = 1;\n var m;\n for (; j <= b; j = j + h, k++)\n x[k] = j;\n m = x.length;\n for (; i < m - 1; i++) {\n I += ((i % 2 !== 0) ? 4 : 2) * f(x[i]);\n }\n return (h / 3) * (I + f(b));\n },\n\n hermite: function hermite(X, F, dF, value) {\n var n = X.length;\n var p = 0;\n var i = 0;\n var l = [];\n var dl = [];\n var A = [];\n var B = [];\n var j;\n for (; i < n; i++) {\n l[i] = 1;\n for (j = 0; j < n; j++) {\n if (i != j) l[i] *= (value - X[j]) / (X[i] - X[j]);\n }\n dl[i] = 0;\n for (j = 0; j < n; j++) {\n if (i != j) dl[i] += 1 / (X [i] - X[j]);\n }\n A[i] = (1 - 2 * (value - X[i]) * dl[i]) * (l[i] * l[i]);\n B[i] = (value - X[i]) * (l[i] * l[i]);\n p += (A[i] * F[i] + B[i] * dF[i]);\n }\n return p;\n },\n\n lagrange: function lagrange(X, F, value) {\n var p = 0;\n var i = 0;\n var j, l;\n var n = X.length;\n for (; i < n; i++) {\n l = F[i];\n for (j = 0; j < n; j++) {\n // calculating the lagrange polynomial L_i\n if (i != j) l *= (value - X[j]) / (X[i] - X[j]);\n }\n // adding the lagrange polynomials found above\n p += l;\n }\n return p;\n },\n\n cubic_spline: function cubic_spline(X, F, value) {\n var n = X.length;\n var i = 0, j;\n var A = [];\n var B = [];\n var alpha = [];\n var c = [];\n var h = [];\n var b = [];\n var d = [];\n for (; i < n - 1; i++)\n h[i] = X[i + 1] - X[i];\n alpha[0] = 0;\n for (i = 1; i < n - 1; i++) {\n alpha[i] = (3 / h[i]) * (F[i + 1] - F[i]) -\n (3 / h[i-1]) * (F[i] - F[i-1]);\n }\n for (i = 1; i < n - 1; i++) {\n A[i] = [];\n B[i] = [];\n A[i][i-1] = h[i-1];\n A[i][i] = 2 * (h[i - 1] + h[i]);\n A[i][i+1] = h[i];\n B[i][0] = alpha[i];\n }\n c = jStat.multiply(jStat.inv(A), B);\n for (j = 0; j < n - 1; j++) {\n b[j] = (F[j + 1] - F[j]) / h[j] - h[j] * (c[j + 1][0] + 2 * c[j][0]) / 3;\n d[j] = (c[j + 1][0] - c[j][0]) / (3 * h[j]);\n }\n for (j = 0; j < n; j++) {\n if (X[j] > value) break;\n }\n j -= 1;\n return F[j] + (value - X[j]) * b[j] + jStat.sq(value-X[j]) *\n c[j] + (value - X[j]) * jStat.sq(value - X[j]) * d[j];\n },\n\n gauss_quadrature: function gauss_quadrature() {\n throw new Error('gauss_quadrature not yet implemented');\n },\n\n PCA: function PCA(X) {\n var m = X.length;\n var n = X[0].length;\n var i = 0;\n var j, temp1;\n var u = [];\n var D = [];\n var result = [];\n var temp2 = [];\n var Y = [];\n var Bt = [];\n var B = [];\n var C = [];\n var V = [];\n var Vt = [];\n for (i = 0; i < m; i++) {\n u[i] = jStat.sum(X[i]) / n;\n }\n for (i = 0; i < n; i++) {\n B[i] = [];\n for(j = 0; j < m; j++) {\n B[i][j] = X[j][i] - u[j];\n }\n }\n B = jStat.transpose(B);\n for (i = 0; i < m; i++) {\n C[i] = [];\n for (j = 0; j < m; j++) {\n C[i][j] = (jStat.dot([B[i]], [B[j]])) / (n - 1);\n }\n }\n result = jStat.jacobi(C);\n V = result[0];\n D = result[1];\n Vt = jStat.transpose(V);\n for (i = 0; i < D.length; i++) {\n for (j = i; j < D.length; j++) {\n if(D[i] < D[j]) {\n temp1 = D[i];\n D[i] = D[j];\n D[j] = temp1;\n temp2 = Vt[i];\n Vt[i] = Vt[j];\n Vt[j] = temp2;\n }\n }\n }\n Bt = jStat.transpose(B);\n for (i = 0; i < m; i++) {\n Y[i] = [];\n for (j = 0; j < Bt.length; j++) {\n Y[i][j] = jStat.dot([Vt[i]], [Bt[j]]);\n }\n }\n return [X, D, Vt, Y];\n }\n});\n\n// extend jStat.fn with methods that require one argument\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function(arg, func) {\n var tmpthis = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jStat.fn[passfunc].call(tmpthis, arg));\n }, 15);\n return this;\n }\n if (typeof jStat[passfunc](this, arg) === 'number')\n return jStat[passfunc](this, arg);\n else\n return jStat(jStat[passfunc](this, arg));\n };\n }(funcs[i]));\n}('add divide multiply subtract dot pow exp log abs norm angle'.split(' ')));\n\n}(jStat, Math));\n(function(jStat, Math) {\n\nvar slice = [].slice;\nvar isNumber = jStat.utils.isNumber;\nvar isArray = jStat.utils.isArray;\n\n// flag==true denotes use of sample standard deviation\n// Z Statistics\njStat.extend({\n // 2 different parameter lists:\n // (value, mean, sd)\n // (value, array, flag)\n zscore: function zscore() {\n var args = slice.call(arguments);\n if (isNumber(args[1])) {\n return (args[0] - args[1]) / args[2];\n }\n return (args[0] - jStat.mean(args[1])) / jStat.stdev(args[1], args[2]);\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, sides)\n // (zscore, sides)\n // (value, array, sides, flag)\n ztest: function ztest() {\n var args = slice.call(arguments);\n var z;\n if (isArray(args[1])) {\n // (value, array, sides, flag)\n z = jStat.zscore(args[0],args[1],args[3]);\n return (args[2] === 1) ?\n (jStat.normal.cdf(-Math.abs(z), 0, 1)) :\n (jStat.normal.cdf(-Math.abs(z), 0, 1)*2);\n } else {\n if (args.length > 2) {\n // (value, mean, sd, sides)\n z = jStat.zscore(args[0],args[1],args[2]);\n return (args[3] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)* 2);\n } else {\n // (zscore, sides)\n z = args[0];\n return (args[1] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)*2);\n }\n }\n }\n});\n\njStat.extend(jStat.fn, {\n zscore: function zscore(value, flag) {\n return (value - this.mean()) / this.stdev(flag);\n },\n\n ztest: function ztest(value, sides, flag) {\n var zscore = Math.abs(this.zscore(value, flag));\n return (sides === 1) ?\n (jStat.normal.cdf(-zscore, 0, 1)) :\n (jStat.normal.cdf(-zscore, 0, 1) * 2);\n }\n});\n\n// T Statistics\njStat.extend({\n // 2 parameter lists\n // (value, mean, sd, n)\n // (value, array)\n tscore: function tscore() {\n var args = slice.call(arguments);\n return (args.length === 4) ?\n ((args[0] - args[1]) / (args[2] / Math.sqrt(args[3]))) :\n ((args[0] - jStat.mean(args[1])) /\n (jStat.stdev(args[1], true) / Math.sqrt(args[1].length)));\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, n, sides)\n // (tscore, n, sides)\n // (value, array, sides)\n ttest: function ttest() {\n var args = slice.call(arguments);\n var tscore;\n if (args.length === 5) {\n tscore = Math.abs(jStat.tscore(args[0], args[1], args[2], args[3]));\n return (args[4] === 1) ?\n (jStat.studentt.cdf(-tscore, args[3]-1)) :\n (jStat.studentt.cdf(-tscore, args[3]-1)*2);\n }\n if (isNumber(args[1])) {\n tscore = Math.abs(args[0])\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1]-1)) :\n (jStat.studentt.cdf(-tscore, args[1]-1) * 2);\n }\n tscore = Math.abs(jStat.tscore(args[0], args[1]))\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1].length-1)) :\n (jStat.studentt.cdf(-tscore, args[1].length-1) * 2);\n }\n});\n\njStat.extend(jStat.fn, {\n tscore: function tscore(value) {\n return (value - this.mean()) / (this.stdev(true) / Math.sqrt(this.cols()));\n },\n\n ttest: function ttest(value, sides) {\n return (sides === 1) ?\n (1 - jStat.studentt.cdf(Math.abs(this.tscore(value)), this.cols()-1)) :\n (jStat.studentt.cdf(-Math.abs(this.tscore(value)), this.cols()-1)*2);\n }\n});\n\n// F Statistics\njStat.extend({\n // Paramter list is as follows:\n // (array1, array2, array3, ...)\n // or it is an array of arrays\n // array of arrays conversion\n anovafscore: function anovafscore() {\n var args = slice.call(arguments),\n expVar, sample, sampMean, sampSampMean, tmpargs, unexpVar, i, j;\n if (args.length === 1) {\n tmpargs = new Array(args[0].length);\n for (i = 0; i < args[0].length; i++) {\n tmpargs[i] = args[0][i];\n }\n args = tmpargs;\n }\n // Builds sample array\n sample = new Array();\n for (i = 0; i < args.length; i++) {\n sample = sample.concat(args[i]);\n }\n sampMean = jStat.mean(sample);\n // Computes the explained variance\n expVar = 0;\n for (i = 0; i < args.length; i++) {\n expVar = expVar + args[i].length * Math.pow(jStat.mean(args[i]) - sampMean, 2);\n }\n expVar /= (args.length - 1);\n // Computes unexplained variance\n unexpVar = 0;\n for (i = 0; i < args.length; i++) {\n sampSampMean = jStat.mean(args[i]);\n for (j = 0; j < args[i].length; j++) {\n unexpVar += Math.pow(args[i][j] - sampSampMean, 2);\n }\n }\n unexpVar /= (sample.length - args.length);\n return expVar / unexpVar;\n },\n\n // 2 different paramter setups\n // (array1, array2, array3, ...)\n // (anovafscore, df1, df2)\n anovaftest: function anovaftest() {\n var args = slice.call(arguments),\n df1, df2, n, i;\n if (isNumber(args[0])) {\n return 1 - jStat.centralF.cdf(args[0], args[1], args[2]);\n }\n var anovafscore = jStat.anovafscore(args);\n df1 = args.length - 1;\n n = 0;\n for (i = 0; i < args.length; i++) {\n n = n + args[i].length;\n }\n df2 = n - df1 - 1;\n return 1 - jStat.centralF.cdf(anovafscore, df1, df2);\n },\n\n ftest: function ftest(fscore, df1, df2) {\n return 1 - jStat.centralF.cdf(fscore, df1, df2);\n }\n});\n\njStat.extend(jStat.fn, {\n anovafscore: function anovafscore() {\n return jStat.anovafscore(this.toArray());\n },\n\n anovaftes: function anovaftes() {\n var n = 0;\n var i;\n for (i = 0; i < this.length; i++) {\n n = n + this[i].length;\n }\n return jStat.ftest(this.anovafscore(), this.length - 1, n - this.length);\n }\n});\n\n// Tukey's range test\njStat.extend({\n // 2 parameter lists\n // (mean1, mean2, n1, n2, sd)\n // (array1, array2, sd)\n qscore: function qscore() {\n var args = slice.call(arguments);\n var mean1, mean2, n1, n2, sd;\n if (isNumber(args[0])) {\n mean1 = args[0];\n mean2 = args[1];\n n1 = args[2];\n n2 = args[3];\n sd = args[4];\n } else {\n mean1 = jStat.mean(args[0]);\n mean2 = jStat.mean(args[1]);\n n1 = args[0].length;\n n2 = args[1].length;\n sd = args[2];\n }\n return Math.abs(mean1 - mean2) / (sd * Math.sqrt((1 / n1 + 1 / n2) / 2));\n },\n\n // 3 different parameter lists:\n // (qscore, n, k)\n // (mean1, mean2, n1, n2, sd, n, k)\n // (array1, array2, sd, n, k)\n qtest: function qtest() {\n var args = slice.call(arguments);\n\n var qscore;\n if (args.length === 3) {\n qscore = args[0];\n args = args.slice(1);\n } else if (args.length === 7) {\n qscore = jStat.qscore(args[0], args[1], args[2], args[3], args[4]);\n args = args.slice(5);\n } else {\n qscore = jStat.qscore(args[0], args[1], args[2]);\n args = args.slice(3);\n }\n\n var n = args[0];\n var k = args[1];\n\n return 1 - jStat.tukey.cdf(qscore, k, n - k);\n },\n\n tukeyhsd: function tukeyhsd(arrays) {\n var sd = jStat.pooledstdev(arrays);\n var means = arrays.map(function (arr) {return jStat.mean(arr);});\n var n = arrays.reduce(function (n, arr) {return n + arr.length;}, 0);\n\n var results = [];\n for (var i = 0; i < arrays.length; ++i) {\n for (var j = i + 1; j < arrays.length; ++j) {\n var p = jStat.qtest(means[i], means[j], arrays[i].length, arrays[j].length, sd, n, arrays.length);\n results.push([[i, j], p]);\n }\n }\n\n return results;\n }\n});\n\n// Error Bounds\njStat.extend({\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n normalci: function normalci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n jStat.stdev(args[2]) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n tci: function tci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[3] - 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[2].length - 1) *\n jStat.stdev(args[2], true) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n significant: function significant(pvalue, alpha) {\n return pvalue < alpha;\n }\n});\n\njStat.extend(jStat.fn, {\n normalci: function normalci(value, alpha) {\n return jStat.normalci(value, alpha, this.toArray());\n },\n\n tci: function tci(value, alpha) {\n return jStat.tci(value, alpha, this.toArray());\n }\n});\n\n// internal method for calculating the z-score for a difference of proportions test\nfunction differenceOfProportions(p1, n1, p2, n2) {\n if (p1 > 1 || p2 > 1 || p1 <= 0 || p2 <= 0) {\n throw new Error(\"Proportions should be greater than 0 and less than 1\")\n }\n var pooled = (p1 * n1 + p2 * n2) / (n1 + n2);\n var se = Math.sqrt(pooled * (1 - pooled) * ((1/n1) + (1/n2)));\n return (p1 - p2) / se;\n}\n\n// Difference of Proportions\njStat.extend(jStat.fn, {\n oneSidedDifferenceOfProportions: function oneSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 1);\n },\n\n twoSidedDifferenceOfProportions: function twoSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 2);\n }\n});\n\n}(jStat, Math));\njStat.models = (function(){\n function sub_regress(exog) {\n var var_count = exog[0].length;\n var modelList = jStat.arange(var_count).map(function(endog_index) {\n var exog_index =\n jStat.arange(var_count).filter(function(i){return i!==endog_index});\n return ols(jStat.col(exog, endog_index).map(function(x){ return x[0] }),\n jStat.col(exog, exog_index))\n });\n return modelList;\n }\n\n // do OLS model regress\n // exog have include const columns ,it will not generate it .In fact, exog is\n // \"design matrix\" look at\n //https://en.wikipedia.org/wiki/Design_matrix\n function ols(endog, exog) {\n var nobs = endog.length;\n var df_model = exog[0].length - 1;\n var df_resid = nobs-df_model - 1;\n var coef = jStat.lstsq(exog, endog);\n var predict =\n jStat.multiply(exog, coef.map(function(x) { return [x] }))\n .map(function(p) { return p[0] });\n var resid = jStat.subtract(endog, predict);\n var ybar = jStat.mean(endog);\n // constant cause problem\n // var SST = jStat.sum(endog.map(function(y) {\n // return Math.pow(y-ybar,2);\n // }));\n var SSE = jStat.sum(predict.map(function(f) {\n return Math.pow(f - ybar, 2);\n }));\n var SSR = jStat.sum(endog.map(function(y, i) {\n return Math.pow(y - predict[i], 2);\n }));\n var SST = SSE + SSR;\n var R2 = (SSE / SST);\n return {\n exog:exog,\n endog:endog,\n nobs:nobs,\n df_model:df_model,\n df_resid:df_resid,\n coef:coef,\n predict:predict,\n resid:resid,\n ybar:ybar,\n SST:SST,\n SSE:SSE,\n SSR:SSR,\n R2:R2\n };\n }\n\n // H0: b_I=0\n // H1: b_I!=0\n function t_test(model) {\n var subModelList = sub_regress(model.exog);\n //var sigmaHat=jStat.stdev(model.resid);\n var sigmaHat = Math.sqrt(model.SSR / (model.df_resid));\n var seBetaHat = subModelList.map(function(mod) {\n var SST = mod.SST;\n var R2 = mod.R2;\n return sigmaHat / Math.sqrt(SST * (1 - R2));\n });\n var tStatistic = model.coef.map(function(coef, i) {\n return (coef - 0) / seBetaHat[i];\n });\n var pValue = tStatistic.map(function(t) {\n var leftppf = jStat.studentt.cdf(t, model.df_resid);\n return (leftppf > 0.5 ? 1 - leftppf : leftppf) * 2;\n });\n var c = jStat.studentt.inv(0.975, model.df_resid);\n var interval95 = model.coef.map(function(coef, i) {\n var d = c * seBetaHat[i];\n return [coef - d, coef + d];\n })\n return {\n se: seBetaHat,\n t: tStatistic,\n p: pValue,\n sigmaHat: sigmaHat,\n interval95: interval95\n };\n }\n\n function F_test(model) {\n var F_statistic =\n (model.R2 / model.df_model) / ((1 - model.R2) / model.df_resid);\n var fcdf = function(x, n1, n2) {\n return jStat.beta.cdf(x / (n2 / n1 + x), n1 / 2, n2 / 2)\n }\n var pvalue = 1 - fcdf(F_statistic, model.df_model, model.df_resid);\n return { F_statistic: F_statistic, pvalue: pvalue };\n }\n\n function ols_wrap(endog, exog) {\n var model = ols(endog,exog);\n var ttest = t_test(model);\n var ftest = F_test(model);\n // Provide the Wherry / Ezekiel / McNemar / Cohen Adjusted R^2\n // Which matches the 'adjusted R^2' provided by R's lm package\n var adjust_R2 =\n 1 - (1 - model.R2) * ((model.nobs - 1) / (model.df_resid));\n model.t = ttest;\n model.f = ftest;\n model.adjust_R2 = adjust_R2;\n return model;\n }\n\n return { ols: ols_wrap };\n})();\n//To regress, simply build X matrix\n//(append column of 1's) using\n//buildxmatrix and build the Y\n//matrix using buildymatrix\n//(simply the transpose)\n//and run regress.\n\n\n\n//Regressions\n\njStat.extend({\n buildxmatrix: function buildxmatrix(){\n //Parameters will be passed in as such\n //(array1,array2,array3,...)\n //as (x1,x2,x3,...)\n //needs to be (1,x1,x2,x3,...)\n var matrixRows = new Array(arguments.length);\n for(var i=0;i1){\n result = [];\n for (i = 0; i < A.rows(); i++) {\n result[i] = [];\n for (j = 0; j < B.cols(); j++) {\n sum = 0;\n for (k = 0; k < A.cols(); k++) {\n sum += A.toArray()[i][k] * B.toArray()[k][j];\n }\n result[i][j] = sum;\n }\n }\n return jStat(result);\n }\n result = [];\n for (i = 0; i < A.rows(); i++) {\n result[i] = [];\n for (j = 0; j < B.cols(); j++) {\n sum = 0;\n for (k = 0; k < A.cols(); k++) {\n sum += A.toArray()[i][k] * B.toArray()[j];\n }\n result[i][j] = sum;\n }\n }\n return jStat(result);\n }\n },\n\n //regress and regresst to be fixed\n\n regress: function regress(jMatX,jMatY){\n //print(\"regressin!\");\n //print(jMatX.toArray());\n var innerinv = jStat.xtranspxinv(jMatX);\n //print(innerinv);\n var xtransp = jMatX.transpose();\n var next = jStat.matrixmult(jStat(innerinv),xtransp);\n return jStat.matrixmult(next,jMatY);\n\n },\n\n regresst: function regresst(jMatX,jMatY,sides){\n var beta = jStat.regress(jMatX,jMatY);\n\n var compile = {};\n compile.anova = {};\n var jMatYBar = jStat.jMatYBar(jMatX, beta);\n compile.yBar = jMatYBar;\n var yAverage = jMatY.mean();\n compile.anova.residuals = jStat.residuals(jMatY, jMatYBar);\n\n compile.anova.ssr = jStat.ssr(jMatYBar, yAverage);\n compile.anova.msr = compile.anova.ssr / (jMatX[0].length - 1);\n\n compile.anova.sse = jStat.sse(jMatY, jMatYBar);\n compile.anova.mse =\n compile.anova.sse / (jMatY.length - (jMatX[0].length - 1) - 1);\n\n compile.anova.sst = jStat.sst(jMatY, yAverage);\n compile.anova.mst = compile.anova.sst / (jMatY.length - 1);\n\n compile.anova.r2 = 1 - (compile.anova.sse / compile.anova.sst);\n if (compile.anova.r2 < 0) compile.anova.r2 = 0;\n\n compile.anova.fratio = compile.anova.msr / compile.anova.mse;\n compile.anova.pvalue =\n jStat.anovaftest(compile.anova.fratio,\n jMatX[0].length - 1,\n jMatY.length - (jMatX[0].length - 1) - 1);\n\n compile.anova.rmse = Math.sqrt(compile.anova.mse);\n\n compile.anova.r2adj = 1 - (compile.anova.mse / compile.anova.mst);\n if (compile.anova.r2adj < 0) compile.anova.r2adj = 0;\n\n compile.stats = new Array(jMatX[0].length);\n var covar = jStat.xtranspxinv(jMatX);\n var sds, ts, ps;\n\n for(var i=0; i n) {\n ret = _bessel_iter(x, n, bessel0(x), bessel1(x),-1);\n } else {\n var m=2*M.floor((n+M.floor(M.sqrt(40*n)))/2);\n var jsum=false;\n var bjp=0.0, sum=0.0;\n var bj=1.0, bjm = 0.0;\n var tox = 2 / x;\n for (var j=m;j>0;j--) {\n bjm=j*tox*bj-bjp;\n bjp=bj;\n bj=bjm;\n if (M.abs(bj) > 1E10) {\n bj *= 1E-10;\n bjp *= 1E-10;\n ret *= 1E-10;\n sum *= 1E-10;\n }\n if (jsum) sum += bj;\n jsum=!jsum;\n if (j == n) ret=bjp;\n }\n sum=2.0*sum-bj;\n ret /= sum;\n }\n return ret;\n };\n})();\nvar bessely = (function() {\n var W = 0.636619772;\n\n var b0_a1a = [-2957821389.0, 7062834065.0, -512359803.6, 10879881.29, -86327.92757, 228.4622733].reverse();\n var b0_a2a = [40076544269.0, 745249964.8, 7189466.438, 47447.26470, 226.1030244, 1.0].reverse();\n var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934945152e-7].reverse();\n\n function bessel0(x) {\n var a=0, a1=0, a2=0, y = x * x, xx = x - 0.785398164;\n if(x < 8) {\n a1 = _horner(b0_a1a, y);\n a2 = _horner(b0_a2a, y);\n a = a1/a2 + W * besselj(x,0) * M.log(x);\n } else {\n y = 64 / y;\n a1 = _horner(b0_a1b, y);\n a2 = _horner(b0_a2b, y);\n a = M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n var b1_a1a = [-0.4900604943e13, 0.1275274390e13, -0.5153438139e11, 0.7349264551e9, -0.4237922726e7, 0.8511937935e4].reverse();\n var b1_a2a = [0.2499580570e14, 0.4244419664e12, 0.3733650367e10, 0.2245904002e8, 0.1020426050e6, 0.3549632885e3, 1].reverse();\n var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n\n function bessel1(x) {\n var a=0, a1=0, a2=0, y = x*x, xx = x - 2.356194491;\n if(x < 8) {\n a1 = x*_horner(b1_a1a, y);\n a2 = _horner(b1_a2a, y);\n a = a1/a2 + W * (besselj(x,1) * M.log(x) - 1 / x);\n } else {\n y = 64 / y;\n a1=_horner(b1_a1b, y);\n a2=_horner(b1_a2b, y);\n a=M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELY', 1, -1);\n})();\nvar besseli = (function() {\n var b0_a = [1.0, 3.5156229, 3.0899424, 1.2067492, 0.2659732, 0.360768e-1, 0.45813e-2].reverse();\n var b0_b = [0.39894228, 0.1328592e-1, 0.225319e-2, -0.157565e-2, 0.916281e-2, -0.2057706e-1, 0.2635537e-1, -0.1647633e-1, 0.392377e-2].reverse();\n\n function bessel0(x) {\n if(x <= 3.75) return _horner(b0_a, x*x/(3.75*3.75));\n return M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b0_b, 3.75/M.abs(x));\n }\n\n var b1_a = [0.5, 0.87890594, 0.51498869, 0.15084934, 0.2658733e-1, 0.301532e-2, 0.32411e-3].reverse();\n var b1_b = [0.39894228, -0.3988024e-1, -0.362018e-2, 0.163801e-2, -0.1031555e-1, 0.2282967e-1, -0.2895312e-1, 0.1787654e-1, -0.420059e-2].reverse();\n\n function bessel1(x) {\n if(x < 3.75) return x * _horner(b1_a, x*x/(3.75*3.75));\n return (x < 0 ? -1 : 1) * M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b1_b, 3.75/M.abs(x));\n }\n\n return function besseli(x, n) {\n n = Math.round(n);\n if(n === 0) return bessel0(x);\n if(n === 1) return bessel1(x);\n if(n < 0) return NaN;\n if(M.abs(x) === 0) return 0;\n if(x == Infinity) return Infinity;\n\n var ret = 0.0, j, tox = 2 / M.abs(x), bip = 0.0, bi=1.0, bim=0.0;\n var m=2*M.round((n+M.round(M.sqrt(40*n)))/2);\n for (j=m;j>0;j--) {\n bim=j*tox*bi + bip;\n bip=bi; bi=bim;\n if (M.abs(bi) > 1E10) {\n bi *= 1E-10;\n bip *= 1E-10;\n ret *= 1E-10;\n }\n if(j == n) ret = bip;\n }\n ret *= besseli(x, 0) / bi;\n return x < 0 && (n%2) ? -ret : ret;\n };\n\n})();\n\nvar besselk = (function() {\n var b0_a = [-0.57721566, 0.42278420, 0.23069756, 0.3488590e-1, 0.262698e-2, 0.10750e-3, 0.74e-5].reverse();\n var b0_b = [1.25331414, -0.7832358e-1, 0.2189568e-1, -0.1062446e-1, 0.587872e-2, -0.251540e-2, 0.53208e-3].reverse();\n\n function bessel0(x) {\n if(x <= 2) return -M.log(x/2) * besseli(x,0) + _horner(b0_a, x*x/4);\n return M.exp(-x) / M.sqrt(x) * _horner(b0_b, 2/x);\n }\n\n var b1_a = [1.0, 0.15443144, -0.67278579, -0.18156897, -0.1919402e-1, -0.110404e-2, -0.4686e-4].reverse();\n var b1_b = [1.25331414, 0.23498619, -0.3655620e-1, 0.1504268e-1, -0.780353e-2, 0.325614e-2, -0.68245e-3].reverse();\n\n function bessel1(x) {\n if(x <= 2) return M.log(x/2) * besseli(x,1) + (1/x) * _horner(b1_a, x*x/4);\n return M.exp(-x)/M.sqrt(x)*_horner(b1_b, 2/x);\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELK', 2, 1);\n})();\nBESSEL.besselj = besselj;\nBESSEL.bessely = bessely;\nBESSEL.besseli = besseli;\nBESSEL.besselk = besselk;\n}));\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// This is CodeMirror (https://codemirror.net/5), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\/(\\d+)/.exec(userAgent);\n var chrome_version = chrome && +chrome[1];\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = safari && (/Mobile\\/\\w+/.test(userAgent) || navigator.maxTouchPoints > 2);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt(rootNode) {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var doc = rootNode.ownerDocument || rootNode;\n var activeElement;\n try {\n activeElement = rootNode.activeElement;\n } catch(e) {\n activeElement = doc.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function doc(cm) { return cm.display.wrapper.ownerDocument }\n\n function root(cm) {\n return rootNode(cm.display.wrapper)\n }\n\n function rootNode(element) {\n // Detect modern browsers (2017+).\n return element.getRootNode ? element.getRootNode() : element.ownerDocument\n }\n\n function win(cm) { return doc(cm).defaultView }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {\n this.id = null;\n this.f = null;\n this.time = 0;\n this.handler = bind(this.onTimeout, this);\n };\n Delayed.prototype.onTimeout = function (self) {\n self.id = 0;\n if (self.time <= +new Date) {\n self.f();\n } else {\n setTimeout(self.handler, self.time - +new Date);\n }\n };\n Delayed.prototype.set = function (ms, f) {\n this.f = f;\n var time = +new Date + ms;\n if (!this.id || time < this.time) {\n clearTimeout(this.id);\n this.id = setTimeout(this.handler, ms);\n this.time = time;\n }\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 50;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length, isRTL = direction == \"rtl\" ? 1 : 0;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n at += isRTL;\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers || (emitter._handlers = {});\n map[type] = (map[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers, arr = map && map[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range;\n try {range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\\\s)\" + lineClass[2] + \"(?:$|\\\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n\n // Add a span to a line.\n function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n gutterWrap.setAttribute(\"aria-hidden\", \"true\");\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n var isWidget = classTest(\"CodeMirror-linewidget\");\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (isWidget.test(node.className)) { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\" + (widget.className ? \" \" + widget.className : \"\"));\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\", \"CodeMirror-line-like\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i];\n mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX(doc) {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) }\n return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft\n }\n function pageScrollY(doc) {\n if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) }\n return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var ref = visualLine(lineObj);\n var widgets = ref.widgets;\n var height = 0;\n if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)\n { height += widgetHeight(widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY(doc(cm)));\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX(doc(cm)));\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX(doc(cm));\n top -= pageScrollY(doc(cm));\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = outside; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight; box.bottom += widgetHeight;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n var customCursor = cm.options.$customCursor;\n if (customCursor) { primary = true; }\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty();\n if (customCursor) {\n var head = customCursor(cm, range);\n if (head) { drawSelectionCursor(cm, head, curFragment); }\n } else if (collapsed || cm.options.showCursorWhenSelecting) {\n drawSelectionCursor(cm, range.head, curFragment);\n }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () {\n if (!cm.hasFocus()) { onBlur(cm); }\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.hasFocus()) {\n cm.display.input.focus();\n if (!cm.state.focused) { onFocus(cm); }\n }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n if (cm.state.focused) { onBlur(cm); }\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n var doc = display.wrapper.ownerDocument;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.scrollTop = 0;\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.visibility = this.vert.style.visibility = \"hidden\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.visibility = \"\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt != bar) { bar.style.visibility = \"hidden\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt(root(cm));\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt(root(cm));\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = win(cm).getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(rootNode(snapshot.activeElt))) { return }\n snapshot.activeElt.focus();\n if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&\n snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var doc = snapshot.activeElt.ownerDocument;\n var sel = doc.defaultView.getSelection(), range = doc.createRange();\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n } else if (first) {\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(display) {\n var width = display.gutters.offsetWidth;\n display.sizer.style.marginLeft = width + \"px\";\n // Send an event to consumers responding to changes in gutter width.\n signalLater(display, \"gutterChanged\", display);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }\n\n function getGutters(gutters, lineNumbers) {\n var result = [], sawLineNumbers = false;\n for (var i = 0; i < gutters.length; i++) {\n var name = gutters[i], style = null;\n if (typeof name != \"string\") { style = name.style; name = name.className; }\n if (name == \"CodeMirror-linenumbers\") {\n if (!lineNumbers) { continue }\n else { sawLineNumbers = true; }\n }\n result.push({className: name, style: style});\n }\n if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n return result\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }\n\n function updateGutters(cm) {\n renderGutters(cm.display);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input, options) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n // See #6982. FIXME remove when this has been fixed for a while in Chrome\n if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = \"inset(0px)\"; }\n\n // This attribute is respected by automatic translation systems such as Google Translate,\n // and may also be respected by tools used by human translators.\n d.wrapper.setAttribute('translate', 'no');\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n renderGutters(d);\n\n input.init(d);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n // On Chrome 102, viewport updates somehow stop wheel-based\n // scrolling. Turning off pointer events during the scroll seems\n // to avoid the issue.\n if (chrome && chrome_version == 102) {\n if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = \"none\"; }\n else { clearTimeout(cm.display.chromeScrollHack); }\n cm.display.chromeScrollHack = setTimeout(function () {\n cm.display.chromeScrollHack = null;\n cm.display.sizer.style.pointerEvents = \"\";\n }, 100);\n }\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n var pixelsPerUnit = wheelPixelsPerUnit;\n if (e.deltaMode === 0) {\n dx = e.deltaX;\n dy = e.deltaY;\n pixelsPerUnit = 1;\n }\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && pixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && pixelsPerUnit != null) {\n var pixels = dy * pixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20 && e.deltaMode !== 0) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n cm.options.direction = doc.direction;\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(prev) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = prev ? prev.undoDepth : Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption(\"readOnly\") != \"nocursor\")\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n\n // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n // is with selectLeft/Right\n var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? preventCursorRight : preventCursorLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? preventCursorLeft : preventCursorRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n\n if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))\n { doc.cantEdit = false; }\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n { if (op(this.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n if (lineSep === '') { return lines.join('') }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range.head; }\n else if (start == \"anchor\") { pos = range.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to(); }\n else { pos = range.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head || ranges[i].anchor)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {\n var this$1 = this;\n\n this.history = new History(this.history);\n linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);\n },\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) { continue }\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var markAsReadAndPasteIfAllFilesAreRead = function () {\n if (++read == n) {\n operation(cm, function () {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(\n text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));\n })();\n }\n };\n var readTextFromFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n var reader = new FileReader;\n reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };\n reader.onload = function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n text[i] = content;\n markAsReadAndPasteIfAllFilesAreRead();\n };\n reader.readAsText(file);\n };\n for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e$1){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 224: \"Mod\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\", \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\",\n \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\",\n \"Ctrl-T\": \"transposeChars\", \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Mod\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n if (cm.doc.direction == \"rtl\") { dir = -dir; }\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"codepoint\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(start.ch, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n cm.curOp.focus = activeElt(root(cm));\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)\n { document.execCommand(\"cut\"); }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n win(cm).focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(root(cm)); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n if (cm.state.delayingBlurEvent) {\n if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }\n else { delayBlurEvent(cm); }\n }\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if ((webkit && !safari) || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { return display.input.focus(); }, 20);\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n if (ie) { delayBlurEvent(cm); }\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt(root(cm));\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e$1) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.display.gutterSpecs[i];\n signal(cm, type, cm, line, gutter.className, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\u202d\\u202e\\u2066\\u2067\\u2069\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n updateGutters(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm, val) {\n cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n updateGutters(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm, val) {\n cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n updateGutters(cm);\n }, true);\n option(\"firstLineNumber\", 1, updateGutters, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n\n option(\"screenReaderLabel\", null, function (cm, val) {\n val = (val === '') ? null : val;\n cm.display.input.screenReaderLabelChanged(val);\n });\n\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input, options);\n display.wrapper.CodeMirror = this;\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(function () {\n if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }\n }, 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == textLines.join(\"\\n\"))\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus())\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", autocorrect ? \"on\" : \"off\");\n field.setAttribute(\"autocapitalize\", autocapitalize ? \"on\" : \"off\");\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){win(this).focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(root(this)) },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"codepoint\", \"char\", \"column\" (like char, but\n // doesn't cross line boundaries), \"word\" (across next word), or\n // \"group\" (to the start of next group of word or\n // non-word-non-whitespace chars). The visually param controls\n // whether, in right-to-left text, direction 1 means to move towards\n // the next index in the string, or towards the character to the right\n // of the current position. The resulting position will have a\n // hitSide=true property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n var lineDir = visually && doc.direction == \"rtl\" ? -dir : dir;\n function findNextLine() {\n var l = pos.line + lineDir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (unit == \"codepoint\") {\n var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));\n if (isNaN(ch)) {\n next = null;\n } else {\n var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;\n next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);\n }\n } else if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\" || unit == \"codepoint\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n div.contentEditable = true;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n function belongsToInput(e) {\n for (var t = e.target; t; t = t.parentNode) {\n if (t == div) { return true }\n if (/\\bCodeMirror-(?:line)?widget\\b/.test(t.className)) { break }\n }\n return false\n }\n\n on(div, \"paste\", function (e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n disableBrowserMagic(te);\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = activeElt(rootNode(div));\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.div.setAttribute('aria-label', label);\n } else {\n this.div.removeAttribute('aria-label');\n }\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = activeElt(rootNode(this.div)) == this.div;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor() || activeElt(rootNode(this.div)) != this.div)\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var this$1 = this;\n\n var input = this;\n if (this.selectionInEditor())\n { setTimeout(function () { return this$1.pollSelection(); }, 20); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find(0)))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n this.resetting = false;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n var opts = this.cm.options;\n disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);\n };\n\n TextareaInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.textarea.setAttribute('aria-label', label);\n } else {\n this.textarea.removeAttribute('aria-label');\n }\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing && typing) { return }\n var cm = this.cm;\n this.resetting = true;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n this.resetting = false;\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt(rootNode(this.textarea)) != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || this.resetting || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n this.textarea.readOnly = !!val;\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt(rootNode(textarea));\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, \u2026*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.65.16\";\n\n return CodeMirror;\n\n})));\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var trackScope = parserConfig.trackScope !== false\n var isTS = parserConfig.typescript;\n var wordRE = parserConfig.wordCharacters || /[\\w$\\xa1-\\uffff]/;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\"), D = kw(\"keyword d\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n return {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": D, \"break\": D, \"continue\": D, \"new\": kw(\"new\"), \"delete\": C, \"void\": C, \"throw\": C,\n \"debugger\": kw(\"debugger\"), \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C,\n \"await\": C\n };\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^@]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d[\\d_]*(?:[eE][+\\-]?[\\d_]+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.match(/^(?:x[\\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^[\\d_]*(?:n|(?:\\.[\\d_]*)?(?:[eE][+\\-]?[\\d_]+)?)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (expressionAllowed(stream, state, 1)) {\n readRegexp(stream);\n stream.match(/^\\b(([gimyus])(?![gimyus]*\\2))+\\b/);\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eat(\"=\");\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\" && stream.peek() == \"!\") {\n stream.skipToEnd();\n return ret(\"meta\", \"meta\");\n } else if (ch == \"#\" && stream.eatWhile(wordRE)) {\n return ret(\"variable\", \"property\")\n } else if (ch == \"<\" && stream.match(\"!--\") ||\n (ch == \"-\" && stream.match(\"->\") && !/\\S/.test(stream.string.slice(0, stream.start)))) {\n stream.skipToEnd()\n return ret(\"comment\", \"comment\")\n } else if (isOperatorChar.test(ch)) {\n if (ch != \">\" || !state.lexical || state.lexical.type != \">\") {\n if (stream.eat(\"=\")) {\n if (ch == \"!\" || ch == \"=\") stream.eat(\"=\")\n } else if (/[<>*+\\-|&?]/.test(ch)) {\n stream.eat(ch)\n if (ch == \">\") stream.eat(ch)\n }\n }\n if (ch == \"?\" && stream.eat(\".\")) return ret(\".\")\n return ret(\"operator\", \"operator\", stream.current());\n } else if (wordRE.test(ch)) {\n stream.eatWhile(wordRE);\n var word = stream.current()\n if (state.lastType != \".\") {\n if (keywords.propertyIsEnumerable(word)) {\n var kw = keywords[word]\n return ret(kw.type, kw.style, word)\n }\n if (word == \"async\" && stream.match(/^(\\s|\\/\\*([^*]|\\*(?!\\/))*?\\*\\/)*[\\[\\(\\w]/, false))\n return ret(\"async\", \"keyword\", word)\n }\n return ret(\"variable\", \"variable\", word)\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n if (isTS) { // Try to skip TypeScript return type declarations after the arguments\n var m = /:\\s*(?:\\w+(?:<[^>]*>|\\[\\])?|\\{[^}]*\\})\\s*$/.exec(stream.string.slice(stream.start, arrow))\n if (m) arrow = m.index\n }\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) { if (ch == \"(\") sawSomething = true; break; }\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (wordRE.test(ch)) {\n sawSomething = true;\n } else if (/[\"'\\/`]/.test(ch)) {\n for (;; --pos) {\n if (pos == 0) return\n var next = stream.string.charAt(pos - 1)\n if (next == ch && stream.string.charAt(pos - 2) != \"\\\\\") { pos--; break }\n }\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true,\n \"regexp\": true, \"this\": true, \"import\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n if (!trackScope) return false\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function inList(name, list) {\n for (var v = list; v; v = v.next) if (v.name == name) return true\n return false;\n }\n function register(varname) {\n var state = cx.state;\n cx.marked = \"def\";\n if (!trackScope) return\n if (state.context) {\n if (state.lexical.info == \"var\" && state.context && state.context.block) {\n // FIXME function decls are also not block scoped\n var newContext = registerVarScoped(varname, state.context)\n if (newContext != null) {\n state.context = newContext\n return\n }\n } else if (!inList(varname, state.localVars)) {\n state.localVars = new Var(varname, state.localVars)\n return\n }\n }\n // Fall through means this is global\n if (parserConfig.globalVars && !inList(varname, state.globalVars))\n state.globalVars = new Var(varname, state.globalVars)\n }\n function registerVarScoped(varname, context) {\n if (!context) {\n return null\n } else if (context.block) {\n var inner = registerVarScoped(varname, context.prev)\n if (!inner) return null\n if (inner == context.prev) return context\n return new Context(inner, context.vars, true)\n } else if (inList(varname, context.vars)) {\n return context\n } else {\n return new Context(context.prev, new Var(varname, context.vars), false)\n }\n }\n\n function isModifier(name) {\n return name == \"public\" || name == \"private\" || name == \"protected\" || name == \"abstract\" || name == \"readonly\"\n }\n\n // Combinators\n\n function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }\n function Var(name, next) { this.name = name; this.next = next }\n\n var defaultVars = new Var(\"this\", new Var(\"arguments\", null))\n function pushcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, false)\n cx.state.localVars = defaultVars\n }\n function pushblockcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, true)\n cx.state.localVars = null\n }\n pushcontext.lex = pushblockcontext.lex = true\n function popcontext() {\n cx.state.localVars = cx.state.context.vars\n cx.state.context = cx.state.context.prev\n }\n popcontext.lex = true\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n else for (var outer = state.lexical; outer && outer.type == \")\" && outer.align; outer = outer.prev)\n indent = outer.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\" || type == \"}\" || type == \")\" || type == \"]\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), parenExpr, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"keyword d\") return cx.stream.match(/^\\s*$/, false) ? cont() : cont(pushlex(\"stat\"), maybeexpression, expect(\";\"), poplex);\n if (type == \"debugger\") return cont(expect(\";\"));\n if (type == \"{\") return cont(pushlex(\"}\"), pushblockcontext, block, poplex, popcontext);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), parenExpr, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), pushblockcontext, forspec, statement, popcontext, poplex);\n if (type == \"class\" || (isTS && value == \"interface\")) {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\", type == \"class\" ? type : value), className, poplex)\n }\n if (type == \"variable\") {\n if (isTS && value == \"declare\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else if (isTS && (value == \"module\" || value == \"enum\" || value == \"type\") && cx.stream.match(/^\\s*\\w/, false)) {\n cx.marked = \"keyword\"\n if (value == \"enum\") return cont(enumdef);\n else if (value == \"type\") return cont(typename, expect(\"operator\"), typeexpr, expect(\";\"));\n else return cont(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), block, poplex, poplex)\n } else if (isTS && value == \"namespace\") {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\"), expression, statement, poplex)\n } else if (isTS && value == \"abstract\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else {\n return cont(pushlex(\"stat\"), maybelabel);\n }\n }\n if (type == \"switch\") return cont(pushlex(\"form\"), parenExpr, expect(\"{\"), pushlex(\"}\", \"switch\"), pushblockcontext,\n block, poplex, poplex, popcontext);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);\n if (type == \"export\") return cont(pushlex(\"stat\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"stat\"), afterImport, poplex);\n if (type == \"async\") return cont(statement)\n if (value == \"@\") return cont(expression, statement)\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function maybeCatchBinding(type) {\n if (type == \"(\") return cont(funarg, expect(\")\"))\n }\n function expression(type, value) {\n return expressionInner(type, value, false);\n }\n function expressionNoComma(type, value) {\n return expressionInner(type, value, true);\n }\n function parenExpr(type) {\n if (type != \"(\") return pass()\n return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex)\n }\n function expressionInner(type, value, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"class\" || (isTS && value == \"interface\")) { cx.marked = \"keyword\"; return cont(pushlex(\"form\"), classExpression, poplex); }\n if (type == \"keyword c\" || type == \"async\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") return pass(quasi, maybeop);\n if (type == \"new\") return cont(maybeTarget(noComma));\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(maybeexpression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (type == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value) || isTS && value == \"!\") return cont(me);\n if (isTS && value == \"<\" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\\s*\\(/, false))\n return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n if (isTS && value == \"as\") { cx.marked = \"keyword\"; return cont(typeexpr, me) }\n if (type == \"regexp\") {\n cx.state.lastType = cx.marked = \"operator\"\n cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)\n return cont(expr)\n }\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(maybeexpression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expressionNoComma);\n }\n function maybeTarget(noComma) {\n return function(type) {\n if (type == \".\") return cont(noComma ? targetNoComma : target);\n else if (type == \"variable\" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)\n else return pass(noComma ? expressionNoComma : expression);\n };\n }\n function target(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorComma); }\n }\n function targetNoComma(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorNoComma); }\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"async\") {\n cx.marked = \"property\";\n return cont(objprop);\n } else if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params\n if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\\s*:\\s*/, false)))\n cx.state.fatArrowAt = cx.stream.pos + m[0].length\n return cont(afterprop);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (cx.style + \" property\");\n return cont(afterprop);\n } else if (type == \"jsonld-keyword\") {\n return cont(afterprop);\n } else if (isTS && isModifier(value)) {\n cx.marked = \"keyword\"\n return cont(objprop)\n } else if (type == \"[\") {\n return cont(expression, maybetype, expect(\"]\"), afterprop);\n } else if (type == \"spread\") {\n return cont(expressionNoComma, afterprop);\n } else if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(objprop);\n } else if (type == \":\") {\n return pass(afterprop)\n }\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end, sep) {\n function proceed(type, value) {\n if (sep ? sep.indexOf(type) > -1 : type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(function(type, value) {\n if (type == end || value == end) return pass()\n return pass(what)\n }, proceed);\n }\n if (type == end || value == end) return cont();\n if (sep && sep.indexOf(\";\") > -1) return pass(what)\n return cont(expect(end));\n }\n return function(type, value) {\n if (type == end || value == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type, value) {\n if (isTS) {\n if (type == \":\") return cont(typeexpr);\n if (value == \"?\") return cont(maybetype);\n }\n }\n function maybetypeOrIn(type, value) {\n if (isTS && (type == \":\" || value == \"in\")) return cont(typeexpr)\n }\n function mayberettype(type) {\n if (isTS && type == \":\") {\n if (cx.stream.match(/^\\s*\\w+\\s+is\\b/, false)) return cont(expression, isKW, typeexpr)\n else return cont(typeexpr)\n }\n }\n function isKW(_, value) {\n if (value == \"is\") {\n cx.marked = \"keyword\"\n return cont()\n }\n }\n function typeexpr(type, value) {\n if (value == \"keyof\" || value == \"typeof\" || value == \"infer\" || value == \"readonly\") {\n cx.marked = \"keyword\"\n return cont(value == \"typeof\" ? expressionNoComma : typeexpr)\n }\n if (type == \"variable\" || value == \"void\") {\n cx.marked = \"type\"\n return cont(afterType)\n }\n if (value == \"|\" || value == \"&\") return cont(typeexpr)\n if (type == \"string\" || type == \"number\" || type == \"atom\") return cont(afterType);\n if (type == \"[\") return cont(pushlex(\"]\"), commasep(typeexpr, \"]\", \",\"), poplex, afterType)\n if (type == \"{\") return cont(pushlex(\"}\"), typeprops, poplex, afterType)\n if (type == \"(\") return cont(commasep(typearg, \")\"), maybeReturnType, afterType)\n if (type == \"<\") return cont(commasep(typeexpr, \">\"), typeexpr)\n if (type == \"quasi\") { return pass(quasiType, afterType); }\n }\n function maybeReturnType(type) {\n if (type == \"=>\") return cont(typeexpr)\n }\n function typeprops(type) {\n if (type.match(/[\\}\\)\\]]/)) return cont()\n if (type == \",\" || type == \";\") return cont(typeprops)\n return pass(typeprop, typeprops)\n }\n function typeprop(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\"\n return cont(typeprop)\n } else if (value == \"?\" || type == \"number\" || type == \"string\") {\n return cont(typeprop)\n } else if (type == \":\") {\n return cont(typeexpr)\n } else if (type == \"[\") {\n return cont(expect(\"variable\"), maybetypeOrIn, expect(\"]\"), typeprop)\n } else if (type == \"(\") {\n return pass(functiondecl, typeprop)\n } else if (!type.match(/[;\\}\\)\\],]/)) {\n return cont()\n }\n }\n function quasiType(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasiType);\n return cont(typeexpr, continueQuasiType);\n }\n function continueQuasiType(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasiType);\n }\n }\n function typearg(type, value) {\n if (type == \"variable\" && cx.stream.match(/^\\s*[?:]/, false) || value == \"?\") return cont(typearg)\n if (type == \":\") return cont(typeexpr)\n if (type == \"spread\") return cont(typearg)\n return pass(typeexpr)\n }\n function afterType(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n if (value == \"|\" || type == \".\" || value == \"&\") return cont(typeexpr)\n if (type == \"[\") return cont(typeexpr, expect(\"]\"), afterType)\n if (value == \"extends\" || value == \"implements\") { cx.marked = \"keyword\"; return cont(typeexpr) }\n if (value == \"?\") return cont(typeexpr, expect(\":\"), typeexpr)\n }\n function maybeTypeArgs(_, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n }\n function typeparam() {\n return pass(typeexpr, maybeTypeDefault)\n }\n function maybeTypeDefault(_, value) {\n if (value == \"=\") return cont(typeexpr)\n }\n function vardef(_, value) {\n if (value == \"enum\") {cx.marked = \"keyword\"; return cont(enumdef)}\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(pattern) }\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"spread\") return cont(pattern);\n if (type == \"[\") return contCommasep(eltpattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n if (type == \"spread\") return cont(pattern);\n if (type == \"}\") return pass();\n if (type == \"[\") return cont(expression, expect(']'), expect(':'), proppattern);\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function eltpattern() {\n return pass(pattern, maybeAssign)\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type, value) {\n if (value == \"await\") return cont(forspec);\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, forspec2);\n if (type == \"variable\") return cont(forspec2);\n return pass(forspec2)\n }\n function forspec2(type, value) {\n if (type == \")\") return cont()\n if (type == \";\") return cont(forspec2)\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression, forspec2) }\n return pass(expression, forspec2)\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, statement, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondef)\n }\n function functiondecl(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondecl);}\n if (type == \"variable\") {register(value); return cont(functiondecl);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondecl)\n }\n function typename(type, value) {\n if (type == \"keyword\" || type == \"variable\") {\n cx.marked = \"type\"\n return cont(typename)\n } else if (value == \"<\") {\n return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex)\n }\n }\n function funarg(type, value) {\n if (value == \"@\") cont(expression, funarg)\n if (type == \"spread\") return cont(funarg);\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(funarg); }\n if (isTS && type == \"this\") return cont(maybetype, maybeAssign)\n return pass(pattern, maybetype, maybeAssign);\n }\n function classExpression(type, value) {\n // Class expressions may have an optional name.\n if (type == \"variable\") return className(type, value);\n return classNameAfter(type, value);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, classNameAfter)\n if (value == \"extends\" || value == \"implements\" || (isTS && type == \",\")) {\n if (value == \"implements\") cx.marked = \"keyword\";\n return cont(isTS ? typeexpr : expression, classNameAfter);\n }\n if (type == \"{\") return cont(pushlex(\"}\"), classBody, poplex);\n }\n function classBody(type, value) {\n if (type == \"async\" ||\n (type == \"variable\" &&\n (value == \"static\" || value == \"get\" || value == \"set\" || (isTS && isModifier(value))) &&\n cx.stream.match(/^\\s+#?[\\w$\\xa1-\\uffff]/, false))) {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n return cont(classfield, classBody);\n }\n if (type == \"number\" || type == \"string\") return cont(classfield, classBody);\n if (type == \"[\")\n return cont(expression, maybetype, expect(\"]\"), classfield, classBody)\n if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (isTS && type == \"(\") return pass(functiondecl, classBody)\n if (type == \";\" || type == \",\") return cont(classBody);\n if (type == \"}\") return cont();\n if (value == \"@\") return cont(expression, classBody)\n }\n function classfield(type, value) {\n if (value == \"!\") return cont(classfield)\n if (value == \"?\") return cont(classfield)\n if (type == \":\") return cont(typeexpr, maybeAssign)\n if (value == \"=\") return cont(expressionNoComma)\n var context = cx.state.lexical.prev, isInterface = context && context.info == \"interface\"\n return pass(isInterface ? functiondecl : functiondef)\n }\n function afterExport(type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n if (type == \"{\") return cont(commasep(exportField, \"}\"), maybeFrom, expect(\";\"));\n return pass(statement);\n }\n function exportField(type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(expect(\"variable\")); }\n if (type == \"variable\") return pass(expressionNoComma, exportField);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n if (type == \"(\") return pass(expression);\n if (type == \".\") return pass(maybeoperatorComma);\n return pass(importSpec, maybeMoreImports, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n if (value == \"*\") cx.marked = \"keyword\";\n return cont(maybeAs);\n }\n function maybeMoreImports(type) {\n if (type == \",\") return cont(importSpec, maybeMoreImports)\n }\n function maybeAs(_type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(importSpec); }\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(commasep(expressionNoComma, \"]\"));\n }\n function enumdef() {\n return pass(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), commasep(enummember, \"}\"), poplex, poplex)\n }\n function enummember() {\n return pass(pattern, maybeAssign);\n }\n\n function isContinuedStatement(state, textAfter) {\n return state.lastType == \"operator\" || state.lastType == \",\" ||\n isOperatorChar.test(textAfter.charAt(0)) ||\n /[,.]/.test(textAfter.charAt(0));\n }\n\n function expressionAllowed(stream, state, backUp) {\n return state.tokenize == tokenBase &&\n /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\\[{}\\(,;:]|=>)$/.test(state.lastType) ||\n (state.lastType == \"quasi\" && /\\{\\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && new Context(null, null, false),\n indented: basecolumn || 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse && c != popcontext) break;\n }\n while ((lexical.type == \"stat\" || lexical.type == \"form\") &&\n (firstChar == \"}\" || ((top = state.cc[state.cc.length - 1]) &&\n (top == maybeoperatorComma || top == maybeoperatorNoComma) &&\n !/^[,\\.=+\\-*:?[\\(]/.test(textAfter))))\n lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info.length + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricInput: /^\\s*(?:case .*?:|default:|\\{|\\})$/,\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n blockCommentContinue: jsonMode ? null : \" * \",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode,\n\n expressionAllowed: expressionAllowed,\n\n skipExpression: function(state) {\n parseJS(state, \"atom\", \"atom\", \"true\", new CodeMirror.StringStream(\"\", 2, null))\n }\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/x-javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/x-json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/manifest+json\", { name: \"javascript\", json: true })\nCodeMirror.defineMIME(\"application/ld+json\", { name: \"javascript\", jsonld: true });\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Open simple dialogs on top of an editor. Relies on dialog.css.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n function dialogDiv(cm, template, bottom) {\n var wrap = cm.getWrapperElement();\n var dialog;\n dialog = wrap.appendChild(document.createElement(\"div\"));\n if (bottom)\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-bottom\";\n else\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-top\";\n\n if (typeof template == \"string\") {\n dialog.innerHTML = template;\n } else { // Assuming it's a detached DOM element.\n dialog.appendChild(template);\n }\n CodeMirror.addClass(wrap, 'dialog-opened');\n return dialog;\n }\n\n function closeNotification(cm, newVal) {\n if (cm.state.currentNotificationClose)\n cm.state.currentNotificationClose();\n cm.state.currentNotificationClose = newVal;\n }\n\n CodeMirror.defineExtension(\"openDialog\", function(template, callback, options) {\n if (!options) options = {};\n\n closeNotification(this, null);\n\n var dialog = dialogDiv(this, template, options.bottom);\n var closed = false, me = this;\n function close(newVal) {\n if (typeof newVal == 'string') {\n inp.value = newVal;\n } else {\n if (closed) return;\n closed = true;\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n me.focus();\n\n if (options.onClose) options.onClose(dialog);\n }\n }\n\n var inp = dialog.getElementsByTagName(\"input\")[0], button;\n if (inp) {\n inp.focus();\n\n if (options.value) {\n inp.value = options.value;\n if (options.selectValueOnOpen !== false) {\n inp.select();\n }\n }\n\n if (options.onInput)\n CodeMirror.on(inp, \"input\", function(e) { options.onInput(e, inp.value, close);});\n if (options.onKeyUp)\n CodeMirror.on(inp, \"keyup\", function(e) {options.onKeyUp(e, inp.value, close);});\n\n CodeMirror.on(inp, \"keydown\", function(e) {\n if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }\n if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {\n inp.blur();\n CodeMirror.e_stop(e);\n close();\n }\n if (e.keyCode == 13) callback(inp.value, e);\n });\n\n if (options.closeOnBlur !== false) CodeMirror.on(dialog, \"focusout\", function (evt) {\n if (evt.relatedTarget !== null) close();\n });\n } else if (button = dialog.getElementsByTagName(\"button\")[0]) {\n CodeMirror.on(button, \"click\", function() {\n close();\n me.focus();\n });\n\n if (options.closeOnBlur !== false) CodeMirror.on(button, \"blur\", close);\n\n button.focus();\n }\n return close;\n });\n\n CodeMirror.defineExtension(\"openConfirm\", function(template, callbacks, options) {\n closeNotification(this, null);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var buttons = dialog.getElementsByTagName(\"button\");\n var closed = false, me = this, blurring = 1;\n function close() {\n if (closed) return;\n closed = true;\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n me.focus();\n }\n buttons[0].focus();\n for (var i = 0; i < buttons.length; ++i) {\n var b = buttons[i];\n (function(callback) {\n CodeMirror.on(b, \"click\", function(e) {\n CodeMirror.e_preventDefault(e);\n close();\n if (callback) callback(me);\n });\n })(callbacks[i]);\n CodeMirror.on(b, \"blur\", function() {\n --blurring;\n setTimeout(function() { if (blurring <= 0) close(); }, 200);\n });\n CodeMirror.on(b, \"focus\", function() { ++blurring; });\n }\n });\n\n /*\n * openNotification\n * Opens a notification, that can be closed with an optional timer\n * (default 5000ms timer) and always closes on click.\n *\n * If a notification is opened while another is opened, it will close the\n * currently opened one and open the new one immediately.\n */\n CodeMirror.defineExtension(\"openNotification\", function(template, options) {\n closeNotification(this, close);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var closed = false, doneTimer;\n var duration = options && typeof options.duration !== \"undefined\" ? options.duration : 5000;\n\n function close() {\n if (closed) return;\n closed = true;\n clearTimeout(doneTimer);\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n }\n\n CodeMirror.on(dialog, 'click', function(e) {\n CodeMirror.e_preventDefault(e);\n close();\n });\n\n if (duration)\n doneTimer = setTimeout(close, duration);\n\n return close;\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n CodeMirror.defineOption(\"placeholder\", \"\", function(cm, val, old) {\n var prev = old && old != CodeMirror.Init;\n if (val && !prev) {\n cm.on(\"blur\", onBlur);\n cm.on(\"change\", onChange);\n cm.on(\"swapDoc\", onChange);\n CodeMirror.on(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose = function() { onComposition(cm) })\n onChange(cm);\n } else if (!val && prev) {\n cm.off(\"blur\", onBlur);\n cm.off(\"change\", onChange);\n cm.off(\"swapDoc\", onChange);\n CodeMirror.off(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose)\n clearPlaceholder(cm);\n var wrapper = cm.getWrapperElement();\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\");\n }\n\n if (val && !cm.hasFocus()) onBlur(cm);\n });\n\n function clearPlaceholder(cm) {\n if (cm.state.placeholder) {\n cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);\n cm.state.placeholder = null;\n }\n }\n function setPlaceholder(cm) {\n clearPlaceholder(cm);\n var elt = cm.state.placeholder = document.createElement(\"pre\");\n elt.style.cssText = \"height: 0; overflow: visible\";\n elt.style.direction = cm.getOption(\"direction\");\n elt.className = \"CodeMirror-placeholder CodeMirror-line-like\";\n var placeHolder = cm.getOption(\"placeholder\")\n if (typeof placeHolder == \"string\") placeHolder = document.createTextNode(placeHolder)\n elt.appendChild(placeHolder)\n cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);\n }\n\n function onComposition(cm) {\n setTimeout(function() {\n var empty = false\n if (cm.lineCount() == 1) {\n var input = cm.getInputField()\n empty = input.nodeName == \"TEXTAREA\" ? !cm.getLine(0).length\n : !/[^\\u200b]/.test(input.querySelector(\".CodeMirror-line\").textContent)\n }\n if (empty) setPlaceholder(cm)\n else clearPlaceholder(cm)\n }, 20)\n }\n\n function onBlur(cm) {\n if (isEmpty(cm)) setPlaceholder(cm);\n }\n function onChange(cm) {\n var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\") + (empty ? \" CodeMirror-empty\" : \"\");\n\n if (empty) setPlaceholder(cm);\n else clearPlaceholder(cm);\n }\n\n function isEmpty(cm) {\n return (cm.lineCount() === 1) && (cm.getLine(0) === \"\");\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var defaults = {\n pairs: \"()[]{}''\\\"\\\"\",\n closeBefore: \")]}'\\\":;>\",\n triples: \"\",\n explode: \"[]{}\"\n };\n\n var Pos = CodeMirror.Pos;\n\n CodeMirror.defineOption(\"autoCloseBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.removeKeyMap(keyMap);\n cm.state.closeBrackets = null;\n }\n if (val) {\n ensureBound(getOption(val, \"pairs\"))\n cm.state.closeBrackets = val;\n cm.addKeyMap(keyMap);\n }\n });\n\n function getOption(conf, name) {\n if (name == \"pairs\" && typeof conf == \"string\") return conf;\n if (typeof conf == \"object\" && conf[name] != null) return conf[name];\n return defaults[name];\n }\n\n var keyMap = {Backspace: handleBackspace, Enter: handleEnter};\n function ensureBound(chars) {\n for (var i = 0; i < chars.length; i++) {\n var ch = chars.charAt(i), key = \"'\" + ch + \"'\"\n if (!keyMap[key]) keyMap[key] = handler(ch)\n }\n }\n ensureBound(defaults.pairs + \"`\")\n\n function handler(ch) {\n return function(cm) { return handleChar(cm, ch); };\n }\n\n function getConfig(cm) {\n var deflt = cm.state.closeBrackets;\n if (!deflt || deflt.override) return deflt;\n var mode = cm.getModeAt(cm.getCursor());\n return mode.closeBrackets || deflt;\n }\n\n function handleBackspace(cm) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n for (var i = ranges.length - 1; i >= 0; i--) {\n var cur = ranges[i].head;\n cm.replaceRange(\"\", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), \"+delete\");\n }\n }\n\n function handleEnter(cm) {\n var conf = getConfig(cm);\n var explode = conf && getOption(conf, \"explode\");\n if (!explode || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n cm.operation(function() {\n var linesep = cm.lineSeparator() || \"\\n\";\n cm.replaceSelection(linesep + linesep, null);\n moveSel(cm, -1)\n ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var line = ranges[i].head.line;\n cm.indentLine(line, null, true);\n cm.indentLine(line + 1, null, true);\n }\n });\n }\n\n function moveSel(cm, dir) {\n var newRanges = [], ranges = cm.listSelections(), primary = 0\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i]\n if (range.head == cm.getCursor()) primary = i\n var pos = range.head.ch || dir > 0 ? {line: range.head.line, ch: range.head.ch + dir} : {line: range.head.line - 1}\n newRanges.push({anchor: pos, head: pos})\n }\n cm.setSelections(newRanges, primary)\n }\n\n function contractSelection(sel) {\n var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;\n return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),\n head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};\n }\n\n function handleChar(cm, ch) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var pos = pairs.indexOf(ch);\n if (pos == -1) return CodeMirror.Pass;\n\n var closeBefore = getOption(conf,\"closeBefore\");\n\n var triples = getOption(conf, \"triples\");\n\n var identical = pairs.charAt(pos + 1) == ch;\n var ranges = cm.listSelections();\n var opening = pos % 2 == 0;\n\n var type;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], cur = range.head, curType;\n var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));\n if (opening && !range.empty()) {\n curType = \"surround\";\n } else if ((identical || !opening) && next == ch) {\n if (identical && stringStartsAfter(cm, cur))\n curType = \"both\";\n else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)\n curType = \"skipThree\";\n else\n curType = \"skip\";\n } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&\n cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) {\n if (cur.ch > 2 && /\\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass;\n curType = \"addFour\";\n } else if (identical) {\n var prev = cur.ch == 0 ? \" \" : cm.getRange(Pos(cur.line, cur.ch - 1), cur)\n if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = \"both\";\n else return CodeMirror.Pass;\n } else if (opening && (next.length === 0 || /\\s/.test(next) || closeBefore.indexOf(next) > -1)) {\n curType = \"both\";\n } else {\n return CodeMirror.Pass;\n }\n if (!type) type = curType;\n else if (type != curType) return CodeMirror.Pass;\n }\n\n var left = pos % 2 ? pairs.charAt(pos - 1) : ch;\n var right = pos % 2 ? ch : pairs.charAt(pos + 1);\n cm.operation(function() {\n if (type == \"skip\") {\n moveSel(cm, 1)\n } else if (type == \"skipThree\") {\n moveSel(cm, 3)\n } else if (type == \"surround\") {\n var sels = cm.getSelections();\n for (var i = 0; i < sels.length; i++)\n sels[i] = left + sels[i] + right;\n cm.replaceSelections(sels, \"around\");\n sels = cm.listSelections().slice();\n for (var i = 0; i < sels.length; i++)\n sels[i] = contractSelection(sels[i]);\n cm.setSelections(sels);\n } else if (type == \"both\") {\n cm.replaceSelection(left + right, null);\n cm.triggerElectric(left + right);\n moveSel(cm, -1)\n } else if (type == \"addFour\") {\n cm.replaceSelection(left + left + left + left, \"before\");\n moveSel(cm, 1)\n }\n });\n }\n\n function charsAround(cm, pos) {\n var str = cm.getRange(Pos(pos.line, pos.ch - 1),\n Pos(pos.line, pos.ch + 1));\n return str.length == 2 ? str : null;\n }\n\n function stringStartsAfter(cm, pos) {\n var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))\n return /\\bstring/.test(token.type) && token.start == pos.ch &&\n (pos.ch == 0 || !/\\bstring/.test(cm.getTokenTypeAt(pos)))\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var ie_lt8 = /MSIE \\d/.test(navigator.userAgent) &&\n (document.documentMode == null || document.documentMode < 8);\n\n var Pos = CodeMirror.Pos;\n\n var matching = {\"(\": \")>\", \")\": \"(<\", \"[\": \"]>\", \"]\": \"[<\", \"{\": \"}>\", \"}\": \"{<\", \"<\": \">>\", \">\": \"<<\"};\n\n function bracketRegex(config) {\n return config && config.bracketRegex || /[(){}[\\]]/\n }\n\n function findMatchingBracket(cm, where, config) {\n var line = cm.getLineHandle(where.line), pos = where.ch - 1;\n var afterCursor = config && config.afterCursor\n if (afterCursor == null)\n afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)\n var re = bracketRegex(config)\n\n // A cursor is defined as between two characters, but in in vim command mode\n // (i.e. not insert mode), the cursor is visually represented as a\n // highlighted box on top of the 2nd character. Otherwise, we allow matches\n // from before or after the cursor.\n var match = (!afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)]) ||\n re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)];\n if (!match) return null;\n var dir = match.charAt(1) == \">\" ? 1 : -1;\n if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;\n var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));\n\n var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config);\n if (found == null) return null;\n return {from: Pos(where.line, pos), to: found && found.pos,\n match: found && found.ch == match.charAt(0), forward: dir > 0};\n }\n\n // bracketRegex is used to specify which type of bracket to scan\n // should be a regexp, e.g. /[[\\]]/\n //\n // Note: If \"where\" is on an open bracket, then this bracket is ignored.\n //\n // Returns false when no bracket was found, null when it reached\n // maxScanLines and gave up\n function scanForBracket(cm, where, dir, style, config) {\n var maxScanLen = (config && config.maxScanLineLength) || 10000;\n var maxScanLines = (config && config.maxScanLines) || 1000;\n\n var stack = [];\n var re = bracketRegex(config)\n var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)\n : Math.max(cm.firstLine() - 1, where.line - maxScanLines);\n for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {\n var line = cm.getLine(lineNo);\n if (!line) continue;\n var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;\n if (line.length > maxScanLen) continue;\n if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);\n for (; pos != end; pos += dir) {\n var ch = line.charAt(pos);\n if (re.test(ch) && (style === undefined ||\n (cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || \"\") == (style || \"\"))) {\n var match = matching[ch];\n if (match && (match.charAt(1) == \">\") == (dir > 0)) stack.push(ch);\n else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};\n else stack.pop();\n }\n }\n }\n return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;\n }\n\n function matchBrackets(cm, autoclear, config) {\n // Disable brace matching in long lines, since it'll cause hugely slow updates\n var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000,\n highlightNonMatching = config && config.highlightNonMatching;\n var marks = [], ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);\n if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) {\n var style = match.match ? \"CodeMirror-matchingbracket\" : \"CodeMirror-nonmatchingbracket\";\n marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));\n if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)\n marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));\n }\n }\n\n if (marks.length) {\n // Kludge to work around the IE bug from issue #1193, where text\n // input stops going to the textarea whenever this fires.\n if (ie_lt8 && cm.state.focused) cm.focus();\n\n var clear = function() {\n cm.operation(function() {\n for (var i = 0; i < marks.length; i++) marks[i].clear();\n });\n };\n if (autoclear) setTimeout(clear, 800);\n else return clear;\n }\n }\n\n function doMatchBrackets(cm) {\n cm.operation(function() {\n if (cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);\n });\n }\n\n function clearHighlighted(cm) {\n if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n }\n\n CodeMirror.defineOption(\"matchBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.off(\"cursorActivity\", doMatchBrackets);\n cm.off(\"focus\", doMatchBrackets)\n cm.off(\"blur\", clearHighlighted)\n clearHighlighted(cm);\n }\n if (val) {\n cm.state.matchBrackets = typeof val == \"object\" ? val : {};\n cm.on(\"cursorActivity\", doMatchBrackets);\n cm.on(\"focus\", doMatchBrackets)\n cm.on(\"blur\", clearHighlighted)\n }\n });\n\n CodeMirror.defineExtension(\"matchBrackets\", function() {matchBrackets(this, true);});\n CodeMirror.defineExtension(\"findMatchingBracket\", function(pos, config, oldConfig){\n // Backwards-compatibility kludge\n if (oldConfig || typeof config == \"boolean\") {\n if (!oldConfig) {\n config = config ? {strict: true} : null\n } else {\n oldConfig.strict = config\n config = oldConfig\n }\n }\n return findMatchingBracket(this, pos, config)\n });\n CodeMirror.defineExtension(\"scanForBracket\", function(pos, dir, style, config){\n return scanForBracket(this, pos, dir, style, config);\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// declare global: DOMRect\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n CodeMirror.defineExtension(\"closeHint\", function() {\n if (this.state.completionActive) this.state.completionActive.close()\n })\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n if (this.options.updateOnCursorActivity) {\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n if (this.options.updateOnCursorActivity) {\n this.cm.off(\"cursorActivity\", this.activityFunc);\n }\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i], self = this;\n this.cm.operation(function() {\n if (completion.hint)\n completion.hint(self.cm, data, completion);\n else\n self.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n self.cm.scrollIntoView();\n });\n if (this.options.closeOnPick) {\n this.close();\n }\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var identStart = this.startPos;\n if(this.data) {\n identStart = this.data.from;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < identStart.ch || this.cm.somethingSelected() ||\n (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n\n var mac = /Mac/.test(navigator.platform);\n\n if (mac) {\n baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n }\n\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.id = \"cm-complete-\" + Math.floor(Math.random(1e6))\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n var ownerDocument = cm.getInputField().ownerDocument;\n var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n var hints = this.hints = ownerDocument.createElement(\"ul\");\n hints.setAttribute(\"role\", \"listbox\")\n hints.setAttribute(\"aria-expanded\", \"true\")\n hints.id = this.id\n var theme = completion.cm.options.theme;\n hints.className = \"CodeMirror-hints \" + theme;\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (i == this.selectedHint) elt.setAttribute(\"aria-selected\", \"true\")\n elt.id = this.id + \"-\" + i\n elt.setAttribute(\"role\", \"option\")\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var container = completion.options.container || ownerDocument.body;\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n var offsetLeft = 0, offsetTop = 0;\n if (container !== ownerDocument.body) {\n // We offset the cursor position because left and top are relative to the offsetParent's top left corner.\n var isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1;\n var offsetParent = isContainerPositioned ? container : container.offsetParent;\n var offsetParentPosition = offsetParent.getBoundingClientRect();\n var bodyPosition = ownerDocument.body.getBoundingClientRect();\n offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft);\n offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop);\n }\n hints.style.left = (left - offsetLeft) + \"px\";\n hints.style.top = (top - offsetTop) + \"px\";\n\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n container.appendChild(hints);\n cm.getInputField().setAttribute(\"aria-autocomplete\", \"list\")\n cm.getInputField().setAttribute(\"aria-owns\", this.id)\n cm.getInputField().setAttribute(\"aria-activedescendant\", this.id + \"-\" + this.selectedHint)\n\n var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect();\n var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false;\n\n // Compute in the timeout to avoid reflow on init\n var startScroll;\n setTimeout(function() { startScroll = cm.getScrollInfo(); });\n\n var overlapY = box.bottom - winH;\n if (overlapY > 0) { // Does not fit below\n var height = box.bottom - box.top, spaceAbove = box.top - (pos.bottom - pos.top) - 2\n if (winH - box.top < spaceAbove) { // More room at the top\n if (height > spaceAbove) hints.style.height = (height = spaceAbove) + \"px\";\n hints.style.top = ((top = pos.top - height) + offsetTop) + \"px\";\n below = false;\n } else {\n hints.style.height = (winH - box.top - 2) + \"px\";\n }\n }\n var overlapX = box.right - winW;\n if (scrolls) overlapX += cm.display.nativeBarWidth;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = Math.max(pos.left - overlapX - offsetLeft, 0)) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n if (!startScroll) startScroll = cm.getScrollInfo();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n // The first hint doesn't need to be scrolled to on init\n var selectedHintRange = this.getSelectedHintRange();\n if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) {\n this.scrollToActive();\n }\n\n CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n var input = this.completion.cm.getInputField()\n input.removeAttribute(\"aria-activedescendant\")\n input.removeAttribute(\"aria-owns\")\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n if (node) {\n node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node.removeAttribute(\"aria-selected\")\n }\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n node.setAttribute(\"aria-selected\", \"true\")\n this.completion.cm.getInputField().setAttribute(\"aria-activedescendant\", node.id)\n this.scrollToActive()\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n scrollToActive: function() {\n var selectedHintRange = this.getSelectedHintRange();\n var node1 = this.hints.childNodes[selectedHintRange.from];\n var node2 = this.hints.childNodes[selectedHintRange.to];\n var firstNode = this.hints.firstChild;\n if (node1.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop;\n else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop;\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n },\n\n getSelectedHintRange: function() {\n var margin = this.completion.options.scrollMargin || 0;\n return {\n from: Math.max(0, this.selectedHint - margin),\n to: Math.min(this.data.list.length - 1, this.selectedHint + margin),\n };\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n term = token.string.substr(0, cur.ch - token.start)\n } else {\n term = \"\"\n from = cur\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnPick: true,\n closeOnUnfocus: true,\n updateOnCursorActivity: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null,\n paddingForScrollbar: true,\n moveOnOverlap: true,\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Defines jumpToLine command. Uses dialog.js if present.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../dialog/dialog\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../dialog/dialog\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n // default search panel location\n CodeMirror.defineOption(\"search\", {bottom: false});\n\n function dialog(cm, text, shortText, deflt, f) {\n if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});\n else f(prompt(shortText, deflt));\n }\n\n function getJumpDialog(cm) {\n return cm.phrase(\"Jump to line:\") + ' ' + cm.phrase(\"(Use line:column or scroll% syntax)\") + '';\n }\n\n function interpretLine(cm, string) {\n var num = Number(string)\n if (/^[-+]/.test(string)) return cm.getCursor().line + num\n else return num - 1\n }\n\n CodeMirror.commands.jumpToLine = function(cm) {\n var cur = cm.getCursor();\n dialog(cm, getJumpDialog(cm), cm.phrase(\"Jump to line:\"), (cur.line + 1) + \":\" + cur.ch, function(posStr) {\n if (!posStr) return;\n\n var match;\n if (match = /^\\s*([\\+\\-]?\\d+)\\s*\\:\\s*(\\d+)\\s*$/.exec(posStr)) {\n cm.setCursor(interpretLine(cm, match[1]), Number(match[2]))\n } else if (match = /^\\s*([\\+\\-]?\\d+(\\.\\d+)?)\\%\\s*/.exec(posStr)) {\n var line = Math.round(cm.lineCount() * Number(match[1]) / 100);\n if (/^[-+]/.test(match[1])) line = cur.line + line + 1;\n cm.setCursor(line - 1, cur.ch);\n } else if (match = /^\\s*\\:?\\s*([\\+\\-]?\\d+)\\s*/.exec(posStr)) {\n cm.setCursor(interpretLine(cm, match[1]), cur.ch);\n }\n });\n };\n\n CodeMirror.keyMap[\"default\"][\"Alt-G\"] = \"jumpToLine\";\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"))\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod)\n else // Plain browser env\n mod(CodeMirror)\n})(function(CodeMirror) {\n \"use strict\"\n var Pos = CodeMirror.Pos\n\n function regexpFlags(regexp) {\n var flags = regexp.flags\n return flags != null ? flags : (regexp.ignoreCase ? \"i\" : \"\")\n + (regexp.global ? \"g\" : \"\")\n + (regexp.multiline ? \"m\" : \"\")\n }\n\n function ensureFlags(regexp, flags) {\n var current = regexpFlags(regexp), target = current\n for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1)\n target += flags.charAt(i)\n return current == target ? regexp : new RegExp(regexp.source, target)\n }\n\n function maybeMultiline(regexp) {\n return /\\\\s|\\\\n|\\n|\\\\W|\\\\D|\\[\\^/.test(regexp.source)\n }\n\n function searchRegexpForward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) {\n regexp.lastIndex = ch\n var string = doc.getLine(line), match = regexp.exec(string)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpForwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start)\n\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunk = 1\n for (var line = start.line, last = doc.lastLine(); line <= last;) {\n // This grows the search buffer in exponentially-sized chunks\n // between matches, so that nearby matches are fast and don't\n // require concatenating the whole document (in case we're\n // searching for something that has tons of matches), but at the\n // same time, the amount of retries is limited.\n for (var i = 0; i < chunk; i++) {\n if (line > last) break\n var curLine = doc.getLine(line++)\n string = string == null ? curLine : string + \"\\n\" + curLine\n }\n chunk = chunk * 2\n regexp.lastIndex = start.ch\n var match = regexp.exec(string)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = start.line + before.length - 1, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n function lastMatchIn(string, regexp, endMargin) {\n var match, from = 0\n while (from <= string.length) {\n regexp.lastIndex = from\n var newMatch = regexp.exec(string)\n if (!newMatch) break\n var end = newMatch.index + newMatch[0].length\n if (end > string.length - endMargin) break\n if (!match || end > match.index + match[0].length)\n match = newMatch\n from = newMatch.index + 1\n }\n return match\n }\n\n function searchRegexpBackward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) {\n var string = doc.getLine(line)\n var match = lastMatchIn(string, regexp, ch < 0 ? 0 : string.length - ch)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpBackwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpBackward(doc, regexp, start)\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunkSize = 1, endMargin = doc.getLine(start.line).length - start.ch\n for (var line = start.line, first = doc.firstLine(); line >= first;) {\n for (var i = 0; i < chunkSize && line >= first; i++) {\n var curLine = doc.getLine(line--)\n string = string == null ? curLine : curLine + \"\\n\" + string\n }\n chunkSize *= 2\n\n var match = lastMatchIn(string, regexp, endMargin)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = line + before.length, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n var doFold, noFold\n if (String.prototype.normalize) {\n doFold = function(str) { return str.normalize(\"NFD\").toLowerCase() }\n noFold = function(str) { return str.normalize(\"NFD\") }\n } else {\n doFold = function(str) { return str.toLowerCase() }\n noFold = function(str) { return str }\n }\n\n // Maps a position in a case-folded line back to a position in the original line\n // (compensating for codepoints increasing in number during folding)\n function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }\n\n function searchStringForward(doc, query, start, caseFold) {\n // Empty string would match anything and never progress, so we\n // define it to match nothing instead.\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) {\n var orig = doc.getLine(line).slice(ch), string = fold(orig)\n if (lines.length == 1) {\n var found = string.indexOf(lines[0])\n if (found == -1) continue search\n var start = adjustPos(orig, string, found, fold) + ch\n return {from: Pos(line, adjustPos(orig, string, found, fold) + ch),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch)}\n } else {\n var cutFrom = string.length - lines[0].length\n if (string.slice(cutFrom) != lines[0]) continue search\n for (var i = 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(line + i)) != lines[i]) continue search\n var end = doc.getLine(line + lines.length - 1), endString = fold(end), lastLine = lines[lines.length - 1]\n if (endString.slice(0, lastLine.length) != lastLine) continue search\n return {from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch),\n to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold))}\n }\n }\n }\n\n function searchStringBackward(doc, query, start, caseFold) {\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) {\n var orig = doc.getLine(line)\n if (ch > -1) orig = orig.slice(0, ch)\n var string = fold(orig)\n if (lines.length == 1) {\n var found = string.lastIndexOf(lines[0])\n if (found == -1) continue search\n return {from: Pos(line, adjustPos(orig, string, found, fold)),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold))}\n } else {\n var lastLine = lines[lines.length - 1]\n if (string.slice(0, lastLine.length) != lastLine) continue search\n for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(start + i)) != lines[i]) continue search\n var top = doc.getLine(line + 1 - lines.length), topString = fold(top)\n if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search\n return {from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)),\n to: Pos(line, adjustPos(orig, string, lastLine.length, fold))}\n }\n }\n }\n\n function SearchCursor(doc, query, pos, options) {\n this.atOccurrence = false\n this.afterEmptyMatch = false\n this.doc = doc\n pos = pos ? doc.clipPos(pos) : Pos(0, 0)\n this.pos = {from: pos, to: pos}\n\n var caseFold\n if (typeof options == \"object\") {\n caseFold = options.caseFold\n } else { // Backwards compat for when caseFold was the 4th argument\n caseFold = options\n options = null\n }\n\n if (typeof query == \"string\") {\n if (caseFold == null) caseFold = false\n this.matches = function(reverse, pos) {\n return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold)\n }\n } else {\n query = ensureFlags(query, \"gm\")\n if (!options || options.multiline !== false)\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos)\n }\n else\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos)\n }\n }\n }\n\n SearchCursor.prototype = {\n findNext: function() {return this.find(false)},\n findPrevious: function() {return this.find(true)},\n\n find: function(reverse) {\n var head = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);\n if (this.afterEmptyMatch && this.atOccurrence) {\n // do not return the same 0 width match twice\n head = Pos(head.line, head.ch)\n if (reverse) {\n head.ch--;\n if (head.ch < 0) {\n head.line--;\n head.ch = (this.doc.getLine(head.line) || \"\").length;\n }\n } else {\n head.ch++;\n if (head.ch > (this.doc.getLine(head.line) || \"\").length) {\n head.ch = 0;\n head.line++;\n }\n }\n if (CodeMirror.cmpPos(head, this.doc.clipPos(head)) != 0) {\n return this.atOccurrence = false\n }\n }\n var result = this.matches(reverse, head)\n this.afterEmptyMatch = result && CodeMirror.cmpPos(result.from, result.to) == 0\n\n if (result) {\n this.pos = result\n this.atOccurrence = true\n return this.pos.match || true\n } else {\n var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0)\n this.pos = {from: end, to: end}\n return this.atOccurrence = false\n }\n },\n\n from: function() {if (this.atOccurrence) return this.pos.from},\n to: function() {if (this.atOccurrence) return this.pos.to},\n\n replace: function(newText, origin) {\n if (!this.atOccurrence) return\n var lines = CodeMirror.splitLines(newText)\n this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin)\n this.pos.to = Pos(this.pos.from.line + lines.length - 1,\n lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0))\n }\n }\n\n CodeMirror.defineExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this.doc, query, pos, caseFold)\n })\n CodeMirror.defineDocExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this, query, pos, caseFold)\n })\n\n CodeMirror.defineExtension(\"selectMatches\", function(query, caseFold) {\n var ranges = []\n var cur = this.getSearchCursor(query, this.getCursor(\"from\"), caseFold)\n while (cur.findNext()) {\n if (CodeMirror.cmpPos(cur.to(), this.getCursor(\"to\")) > 0) break\n ranges.push({anchor: cur.from(), head: cur.to()})\n }\n if (ranges.length)\n this.setSelections(ranges, 0)\n })\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Define search commands. Depends on dialog.js or another\n// implementation of the openDialog method.\n\n// Replace works a little oddly -- it will do the replace on the next\n// Ctrl-G (or whatever is bound to findNext) press. You prevent a\n// replace by making sure the match is no longer selected when hitting\n// Ctrl-G.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"./searchcursor\"), require(\"../dialog/dialog\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"./searchcursor\", \"../dialog/dialog\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n // default search panel location\n CodeMirror.defineOption(\"search\", {bottom: false});\n\n function searchOverlay(query, caseInsensitive) {\n if (typeof query == \"string\")\n query = new RegExp(query.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\"), caseInsensitive ? \"gi\" : \"g\");\n else if (!query.global)\n query = new RegExp(query.source, query.ignoreCase ? \"gi\" : \"g\");\n\n return {token: function(stream) {\n query.lastIndex = stream.pos;\n var match = query.exec(stream.string);\n if (match && match.index == stream.pos) {\n stream.pos += match[0].length || 1;\n return \"searching\";\n } else if (match) {\n stream.pos = match.index;\n } else {\n stream.skipToEnd();\n }\n }};\n }\n\n function SearchState() {\n this.posFrom = this.posTo = this.lastQuery = this.query = null;\n this.overlay = null;\n }\n\n function getSearchState(cm) {\n return cm.state.search || (cm.state.search = new SearchState());\n }\n\n function queryCaseInsensitive(query) {\n return typeof query == \"string\" && query == query.toLowerCase();\n }\n\n function getSearchCursor(cm, query, pos) {\n // Heuristic: if the query string is all lowercase, do a case insensitive search.\n return cm.getSearchCursor(query, pos, {caseFold: queryCaseInsensitive(query), multiline: true});\n }\n\n function persistentDialog(cm, text, deflt, onEnter, onKeyDown) {\n cm.openDialog(text, onEnter, {\n value: deflt,\n selectValueOnOpen: true,\n closeOnEnter: false,\n onClose: function() { clearSearch(cm); },\n onKeyDown: onKeyDown,\n bottom: cm.options.search.bottom\n });\n }\n\n function dialog(cm, text, shortText, deflt, f) {\n if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});\n else f(prompt(shortText, deflt));\n }\n\n function confirmDialog(cm, text, shortText, fs) {\n if (cm.openConfirm) cm.openConfirm(text, fs);\n else if (confirm(shortText)) fs[0]();\n }\n\n function parseString(string) {\n return string.replace(/\\\\([nrt\\\\])/g, function(match, ch) {\n if (ch == \"n\") return \"\\n\"\n if (ch == \"r\") return \"\\r\"\n if (ch == \"t\") return \"\\t\"\n if (ch == \"\\\\\") return \"\\\\\"\n return match\n })\n }\n\n function parseQuery(query) {\n var isRE = query.match(/^\\/(.*)\\/([a-z]*)$/);\n if (isRE) {\n try { query = new RegExp(isRE[1], isRE[2].indexOf(\"i\") == -1 ? \"\" : \"i\"); }\n catch(e) {} // Not a regular expression after all, do a string search\n } else {\n query = parseString(query)\n }\n if (typeof query == \"string\" ? query == \"\" : query.test(\"\"))\n query = /x^/;\n return query;\n }\n\n function startSearch(cm, state, query) {\n state.queryText = query;\n state.query = parseQuery(query);\n cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));\n state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));\n cm.addOverlay(state.overlay);\n if (cm.showMatchesOnScrollbar) {\n if (state.annotate) { state.annotate.clear(); state.annotate = null; }\n state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));\n }\n }\n\n function doSearch(cm, rev, persistent, immediate) {\n var state = getSearchState(cm);\n if (state.query) return findNext(cm, rev);\n var q = cm.getSelection() || state.lastQuery;\n if (q instanceof RegExp && q.source == \"x^\") q = null\n if (persistent && cm.openDialog) {\n var hiding = null\n var searchNext = function(query, event) {\n CodeMirror.e_stop(event);\n if (!query) return;\n if (query != state.queryText) {\n startSearch(cm, state, query);\n state.posFrom = state.posTo = cm.getCursor();\n }\n if (hiding) hiding.style.opacity = 1\n findNext(cm, event.shiftKey, function(_, to) {\n var dialog\n if (to.line < 3 && document.querySelector &&\n (dialog = cm.display.wrapper.querySelector(\".CodeMirror-dialog\")) &&\n dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, \"window\").top)\n (hiding = dialog).style.opacity = .4\n })\n };\n persistentDialog(cm, getQueryDialog(cm), q, searchNext, function(event, query) {\n var keyName = CodeMirror.keyName(event)\n var extra = cm.getOption('extraKeys'), cmd = (extra && extra[keyName]) || CodeMirror.keyMap[cm.getOption(\"keyMap\")][keyName]\n if (cmd == \"findNext\" || cmd == \"findPrev\" ||\n cmd == \"findPersistentNext\" || cmd == \"findPersistentPrev\") {\n CodeMirror.e_stop(event);\n startSearch(cm, getSearchState(cm), query);\n cm.execCommand(cmd);\n } else if (cmd == \"find\" || cmd == \"findPersistent\") {\n CodeMirror.e_stop(event);\n searchNext(query, event);\n }\n });\n if (immediate && q) {\n startSearch(cm, state, q);\n findNext(cm, rev);\n }\n } else {\n dialog(cm, getQueryDialog(cm), \"Search for:\", q, function(query) {\n if (query && !state.query) cm.operation(function() {\n startSearch(cm, state, query);\n state.posFrom = state.posTo = cm.getCursor();\n findNext(cm, rev);\n });\n });\n }\n }\n\n function findNext(cm, rev, callback) {cm.operation(function() {\n var state = getSearchState(cm);\n var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);\n if (!cursor.find(rev)) {\n cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));\n if (!cursor.find(rev)) return;\n }\n cm.setSelection(cursor.from(), cursor.to());\n cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20);\n state.posFrom = cursor.from(); state.posTo = cursor.to();\n if (callback) callback(cursor.from(), cursor.to())\n });}\n\n function clearSearch(cm) {cm.operation(function() {\n var state = getSearchState(cm);\n state.lastQuery = state.query;\n if (!state.query) return;\n state.query = state.queryText = null;\n cm.removeOverlay(state.overlay);\n if (state.annotate) { state.annotate.clear(); state.annotate = null; }\n });}\n\n function el(tag, attrs) {\n var element = tag ? document.createElement(tag) : document.createDocumentFragment();\n for (var key in attrs) {\n element[key] = attrs[key];\n }\n for (var i = 2; i < arguments.length; i++) {\n var child = arguments[i]\n element.appendChild(typeof child == \"string\" ? document.createTextNode(child) : child);\n }\n return element;\n }\n\n function getQueryDialog(cm) {\n var label = el(\"label\", {className: \"CodeMirror-search-label\"},\n cm.phrase(\"Search:\"),\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\",\n id: \"CodeMirror-search-field\"}));\n label.setAttribute(\"for\",\"CodeMirror-search-field\");\n return el(\"\", null, label, \" \",\n el(\"span\", {style: \"color: #666\", className: \"CodeMirror-search-hint\"},\n cm.phrase(\"(Use /re/ syntax for regexp search)\")));\n }\n function getReplaceQueryDialog(cm) {\n return el(\"\", null, \" \",\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\"}), \" \",\n el(\"span\", {style: \"color: #666\", className: \"CodeMirror-search-hint\"},\n cm.phrase(\"(Use /re/ syntax for regexp search)\")));\n }\n function getReplacementQueryDialog(cm) {\n return el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, cm.phrase(\"With:\")), \" \",\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\"}));\n }\n function getDoReplaceConfirm(cm) {\n return el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, cm.phrase(\"Replace?\")), \" \",\n el(\"button\", {}, cm.phrase(\"Yes\")), \" \",\n el(\"button\", {}, cm.phrase(\"No\")), \" \",\n el(\"button\", {}, cm.phrase(\"All\")), \" \",\n el(\"button\", {}, cm.phrase(\"Stop\")));\n }\n\n function replaceAll(cm, query, text) {\n cm.operation(function() {\n for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {\n if (typeof query != \"string\") {\n var match = cm.getRange(cursor.from(), cursor.to()).match(query);\n cursor.replace(text.replace(/\\$(\\d)/g, function(_, i) {return match[i];}));\n } else cursor.replace(text);\n }\n });\n }\n\n function replace(cm, all) {\n if (cm.getOption(\"readOnly\")) return;\n var query = cm.getSelection() || getSearchState(cm).lastQuery;\n var dialogText = all ? cm.phrase(\"Replace all:\") : cm.phrase(\"Replace:\")\n var fragment = el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, dialogText),\n getReplaceQueryDialog(cm))\n dialog(cm, fragment, dialogText, query, function(query) {\n if (!query) return;\n query = parseQuery(query);\n dialog(cm, getReplacementQueryDialog(cm), cm.phrase(\"Replace with:\"), \"\", function(text) {\n text = parseString(text)\n if (all) {\n replaceAll(cm, query, text)\n } else {\n clearSearch(cm);\n var cursor = getSearchCursor(cm, query, cm.getCursor(\"from\"));\n var advance = function() {\n var start = cursor.from(), match;\n if (!(match = cursor.findNext())) {\n cursor = getSearchCursor(cm, query);\n if (!(match = cursor.findNext()) ||\n (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;\n }\n cm.setSelection(cursor.from(), cursor.to());\n cm.scrollIntoView({from: cursor.from(), to: cursor.to()});\n confirmDialog(cm, getDoReplaceConfirm(cm), cm.phrase(\"Replace?\"),\n [function() {doReplace(match);}, advance,\n function() {replaceAll(cm, query, text)}]);\n };\n var doReplace = function(match) {\n cursor.replace(typeof query == \"string\" ? text :\n text.replace(/\\$(\\d)/g, function(_, i) {return match[i];}));\n advance();\n };\n advance();\n }\n });\n });\n }\n\n CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};\n CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);};\n CodeMirror.commands.findPersistentNext = function(cm) {doSearch(cm, false, true, true);};\n CodeMirror.commands.findPersistentPrev = function(cm) {doSearch(cm, true, true, true);};\n CodeMirror.commands.findNext = doSearch;\n CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};\n CodeMirror.commands.clearSearch = clearSearch;\n CodeMirror.commands.replace = replace;\n CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};\n});\n", null, "export default function(x) {\n return function constant() {\n return x;\n };\n}\n", "export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n", "const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We\u2019re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n", "export {Path, path, pathRound} from \"./path.js\";\n", "import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n", "import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 \u2265 r0, da1 \u2265 da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it\u2019s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector\u2019s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it\u2019s a circular sector?\n // Or perhaps it\u2019s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector\u2019s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n", "export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n", "function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n", "export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n", "export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n", "export default function(d) {\n return d;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n", "import curveLinear from \"./linear.js\";\n\nexport var curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nexport default function curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n", "import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport line from \"./line.js\";\n\nexport function lineRadial(l) {\n var c = l.curve;\n\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n\n l.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return l;\n}\n\nexport default function() {\n return lineRadial(line().curve(curveRadialLinear));\n}\n", "import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport area from \"./area.js\";\nimport {lineRadial} from \"./lineRadial.js\";\n\nexport default function() {\n var a = area().curve(curveRadialLinear),\n c = a.curve,\n x0 = a.lineX0,\n x1 = a.lineX1,\n y0 = a.lineY0,\n y1 = a.lineY1;\n\n a.angle = a.x, delete a.x;\n a.startAngle = a.x0, delete a.x0;\n a.endAngle = a.x1, delete a.x1;\n a.radius = a.y, delete a.y;\n a.innerRadius = a.y0, delete a.y0;\n a.outerRadius = a.y1, delete a.y1;\n a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;\n a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;\n a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;\n a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;\n\n a.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return a;\n}\n", "export default function(x, y) {\n return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];\n}\n", "import pointRadial from \"../pointRadial.js\";\n\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);\n else this._context.moveTo(x, y);\n break;\n }\n case 1: this._point = 2; // falls through\n default: {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);\n else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nclass BumpRadial {\n constructor(context) {\n this._context = context;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {}\n point(x, y) {\n x = +x, y = +y;\n if (this._point === 0) {\n this._point = 1;\n } else {\n const p0 = pointRadial(this._x0, this._y0);\n const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);\n const p2 = pointRadial(x, this._y0);\n const p3 = pointRadial(x, y);\n this._context.moveTo(...p0);\n this._context.bezierCurveTo(...p1, ...p2, ...p3);\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nexport function bumpX(context) {\n return new Bump(context, true);\n}\n\nexport function bumpY(context) {\n return new Bump(context, false);\n}\n\nexport function bumpRadial(context) {\n return new BumpRadial(context);\n}\n", "import {slice} from \"./array.js\";\nimport constant from \"./constant.js\";\nimport {bumpX, bumpY, bumpRadial} from \"./curve/bump.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nexport function link(curve) {\n let source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null,\n output = null,\n path = withPath(link);\n\n function link() {\n let buffer;\n const argv = slice.call(arguments);\n const s = source.apply(this, argv);\n const t = target.apply(this, argv);\n if (context == null) output = curve(buffer = path());\n output.lineStart();\n argv[0] = s, output.point(+x.apply(this, argv), +y.apply(this, argv));\n argv[0] = t, output.point(+x.apply(this, argv), +y.apply(this, argv));\n output.lineEnd();\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), link) : context;\n };\n\n return link;\n}\n\nexport function linkHorizontal() {\n return link(bumpX);\n}\n\nexport function linkVertical() {\n return link(bumpY);\n}\n\nexport function linkRadial() {\n const l = link(bumpRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n", "import {min, sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;\n const t = r / 2;\n const u = t * sqrt3;\n context.moveTo(0, r);\n context.lineTo(0, -r);\n context.moveTo(-u, -t);\n context.lineTo(u, t);\n context.moveTo(-u, t);\n context.lineTo(u, -t);\n }\n};\n", "import {pi, sqrt, tau} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst tan30 = sqrt(1 / 3);\nconst tan30_2 = tan30 * 2;\n\nexport default {\n draw(context, size) {\n const y = sqrt(size / tan30_2);\n const x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size) * 0.62625;\n context.moveTo(0, -r);\n context.lineTo(r, 0);\n context.lineTo(0, r);\n context.lineTo(-r, 0);\n context.closePath();\n }\n};\n", "import {min, sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size - min(size / 7, 2)) * 0.87559;\n context.moveTo(-r, 0);\n context.lineTo(r, 0);\n context.moveTo(0, r);\n context.lineTo(0, -r);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const w = sqrt(size);\n const x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size) * 0.4431;\n context.moveTo(r, r);\n context.lineTo(r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, r);\n context.closePath();\n }\n};\n", "import {sin, cos, sqrt, pi, tau} from \"../math.js\";\n\nconst ka = 0.89081309152928522810;\nconst kr = sin(pi / 10) / sin(7 * pi / 10);\nconst kx = sin(tau / 10) * kr;\nconst ky = -cos(tau / 10) * kr;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size * ka);\n const x = kx * r;\n const y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (let i = 1; i < 5; ++i) {\n const a = tau * i / 5;\n const c = cos(a);\n const s = sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const y = -sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const s = sqrt(size) * 0.6824;\n const t = s / 2;\n const u = (s * sqrt3) / 2; // cos(Math.PI / 6)\n context.moveTo(0, -s);\n context.lineTo(u, t);\n context.lineTo(-u, t);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / a);\n const x0 = r / 2, y0 = r * k;\n const x1 = x0, y1 = r * k + r;\n const x2 = -x1, y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n", "import {min, sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size - min(size / 6, 1.7)) * 0.6189;\n context.moveTo(-r, -r);\n context.lineTo(r, r);\n context.moveTo(-r, r);\n context.lineTo(r, -r);\n }\n};\n", "import constant from \"./constant.js\";\nimport {withPath} from \"./path.js\";\nimport asterisk from \"./symbol/asterisk.js\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport diamond2 from \"./symbol/diamond2.js\";\nimport plus from \"./symbol/plus.js\";\nimport square from \"./symbol/square.js\";\nimport square2 from \"./symbol/square2.js\";\nimport star from \"./symbol/star.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport triangle2 from \"./symbol/triangle2.js\";\nimport wye from \"./symbol/wye.js\";\nimport times from \"./symbol/times.js\";\n\n// These symbols are designed to be filled.\nexport const symbolsFill = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\n// These symbols are designed to be stroked (with a width of 1.5px and round caps).\nexport const symbolsStroke = [\n circle,\n plus,\n times,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null,\n path = withPath(symbol);\n\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n let buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n", "export default function() {}\n", "export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n", "import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n", "import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n", "import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n", "export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n", "function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic B\u00E9zier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n", "function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n", "function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n", "export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n", "export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport offsetNone from \"./offset/none.js\";\nimport orderNone from \"./order/none.js\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nfunction stackSeries(key) {\n const series = [];\n series.key = key;\n return series;\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var sz = Array.from(keys.apply(this, arguments), stackSeries),\n i, n = sz.length, j = -1,\n oz;\n\n for (const d of data) {\n for (i = 0, ++j; i < n; ++i) {\n (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;\n }\n }\n\n for (i = 0, oz = array(order(sz)); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none(series, order);\n}\n", "export default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = 0, d[1] = dy;\n }\n }\n }\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {\n for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;\n s0[j][1] += s0[j][0] = -y / 2;\n }\n none(series, order);\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none(series, order);\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n var peaks = series.map(peak);\n return none(series).sort(function(a, b) { return peaks[a] - peaks[b]; });\n}\n\nfunction peak(series) {\n var i = -1, j = 0, n = series.length, vi, vj = -Infinity;\n while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i;\n return j;\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n var sums = series.map(sum);\n return none(series).sort(function(a, b) { return sums[a] - sums[b]; });\n}\n\nexport function sum(series) {\n var s = 0, i = -1, n = series.length, v;\n while (++i < n) if (v = +series[i][1]) s += v;\n return s;\n}\n", "import ascending from \"./ascending.js\";\n\nexport default function(series) {\n return ascending(series).reverse();\n}\n", "import appearance from \"./appearance.js\";\nimport {sum} from \"./ascending.js\";\n\nexport default function(series) {\n var n = series.length,\n i,\n j,\n sums = series.map(sum),\n order = appearance(series),\n top = 0,\n bottom = 0,\n tops = [],\n bottoms = [];\n\n for (i = 0; i < n; ++i) {\n j = order[i];\n if (top < bottom) {\n top += sums[j];\n tops.push(j);\n } else {\n bottom += sums[j];\n bottoms.push(j);\n }\n }\n\n return bottoms.reverse().concat(tops);\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n return none(series).reverse();\n}\n", "export {default as arc} from \"./arc.js\";\nexport {default as area} from \"./area.js\";\nexport {default as line} from \"./line.js\";\nexport {default as pie} from \"./pie.js\";\nexport {default as areaRadial, default as radialArea} from \"./areaRadial.js\"; // Note: radialArea is deprecated!\nexport {default as lineRadial, default as radialLine} from \"./lineRadial.js\"; // Note: radialLine is deprecated!\nexport {default as pointRadial} from \"./pointRadial.js\";\nexport {link, linkHorizontal, linkVertical, linkRadial} from \"./link.js\";\n\nexport {default as symbol, symbolsStroke, symbolsFill, symbolsFill as symbols} from \"./symbol.js\";\nexport {default as symbolAsterisk} from \"./symbol/asterisk.js\";\nexport {default as symbolCircle} from \"./symbol/circle.js\";\nexport {default as symbolCross} from \"./symbol/cross.js\";\nexport {default as symbolDiamond} from \"./symbol/diamond.js\";\nexport {default as symbolDiamond2} from \"./symbol/diamond2.js\";\nexport {default as symbolPlus} from \"./symbol/plus.js\";\nexport {default as symbolSquare} from \"./symbol/square.js\";\nexport {default as symbolSquare2} from \"./symbol/square2.js\";\nexport {default as symbolStar} from \"./symbol/star.js\";\nexport {default as symbolTriangle} from \"./symbol/triangle.js\";\nexport {default as symbolTriangle2} from \"./symbol/triangle2.js\";\nexport {default as symbolWye} from \"./symbol/wye.js\";\nexport {default as symbolTimes, default as symbolX} from \"./symbol/times.js\";\n\nexport {default as curveBasisClosed} from \"./curve/basisClosed.js\";\nexport {default as curveBasisOpen} from \"./curve/basisOpen.js\";\nexport {default as curveBasis} from \"./curve/basis.js\";\nexport {bumpX as curveBumpX, bumpY as curveBumpY} from \"./curve/bump.js\";\nexport {default as curveBundle} from \"./curve/bundle.js\";\nexport {default as curveCardinalClosed} from \"./curve/cardinalClosed.js\";\nexport {default as curveCardinalOpen} from \"./curve/cardinalOpen.js\";\nexport {default as curveCardinal} from \"./curve/cardinal.js\";\nexport {default as curveCatmullRomClosed} from \"./curve/catmullRomClosed.js\";\nexport {default as curveCatmullRomOpen} from \"./curve/catmullRomOpen.js\";\nexport {default as curveCatmullRom} from \"./curve/catmullRom.js\";\nexport {default as curveLinearClosed} from \"./curve/linearClosed.js\";\nexport {default as curveLinear} from \"./curve/linear.js\";\nexport {monotoneX as curveMonotoneX, monotoneY as curveMonotoneY} from \"./curve/monotone.js\";\nexport {default as curveNatural} from \"./curve/natural.js\";\nexport {default as curveStep, stepAfter as curveStepAfter, stepBefore as curveStepBefore} from \"./curve/step.js\";\n\nexport {default as stack} from \"./stack.js\";\nexport {default as stackOffsetExpand} from \"./offset/expand.js\";\nexport {default as stackOffsetDiverging} from \"./offset/diverging.js\";\nexport {default as stackOffsetNone} from \"./offset/none.js\";\nexport {default as stackOffsetSilhouette} from \"./offset/silhouette.js\";\nexport {default as stackOffsetWiggle} from \"./offset/wiggle.js\";\nexport {default as stackOrderAppearance} from \"./order/appearance.js\";\nexport {default as stackOrderAscending} from \"./order/ascending.js\";\nexport {default as stackOrderDescending} from \"./order/descending.js\";\nexport {default as stackOrderInsideOut} from \"./order/insideOut.js\";\nexport {default as stackOrderNone} from \"./order/none.js\";\nexport {default as stackOrderReverse} from \"./order/reverse.js\";\n", "export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, \u00B1Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n", "export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n", "export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n", "// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n", "// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n", "import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n", "export default function(x) {\n return x;\n}\n", "import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\u00B5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"\u2212\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer \u201Cvalue\u201D part that can be\n // grouped, and fractional or exponential \u201Csuffix\u201D part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n", "import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n", "export {default as formatDefaultLocale, format, formatPrefix} from \"./defaultLocale.js\";\nexport {default as formatLocale} from \"./locale.js\";\nexport {default as formatSpecifier, FormatSpecifier} from \"./formatSpecifier.js\";\nexport {default as precisionFixed} from \"./precisionFixed.js\";\nexport {default as precisionPrefix} from \"./precisionPrefix.js\";\nexport {default as precisionRound} from \"./precisionRound.js\";\n", "export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n", "import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can\u2019t do this\n // for a comparator (except for specific, known comparators) because we can\u2019t\n // tell if the comparator is symmetric, and an asymmetric comparator can\u2019t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n", "export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n", "import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n", "export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n", "import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n", "const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n", "export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n", "export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n", "import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n", "import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof = number) {\n if (isNaN(p = +p)) return;\n numbers = Float64Array.from(values, (_, i) => number(valueof(values[i], i, values)));\n if (p <= 0) return minIndex(numbers);\n if (p >= 1) return maxIndex(numbers);\n var numbers,\n index = Uint32Array.from(values, (_, i) => i),\n j = numbers.length - 1,\n i = Math.floor(j * p);\n quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j]));\n i = greatest(index.subarray(0, i + 1), (i) => numbers[i]);\n return i >= 0 ? i : -1;\n}\n", "export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n", "export {default as bisect, bisectRight, bisectLeft, bisectCenter} from \"./bisect.js\";\nexport {default as ascending} from \"./ascending.js\";\nexport {default as bisector} from \"./bisector.js\";\nexport {blur, blur2, blurImage} from \"./blur.js\";\nexport {default as count} from \"./count.js\";\nexport {default as cross} from \"./cross.js\";\nexport {default as cumsum} from \"./cumsum.js\";\nexport {default as descending} from \"./descending.js\";\nexport {default as deviation} from \"./deviation.js\";\nexport {default as extent} from \"./extent.js\";\nexport {Adder, fsum, fcumsum} from \"./fsum.js\";\nexport {default as group, flatGroup, flatRollup, groups, index, indexes, rollup, rollups} from \"./group.js\";\nexport {default as groupSort} from \"./groupSort.js\";\nexport {default as bin, default as histogram} from \"./bin.js\"; // Deprecated; use bin.\nexport {default as thresholdFreedmanDiaconis} from \"./threshold/freedmanDiaconis.js\";\nexport {default as thresholdScott} from \"./threshold/scott.js\";\nexport {default as thresholdSturges} from \"./threshold/sturges.js\";\nexport {default as max} from \"./max.js\";\nexport {default as maxIndex} from \"./maxIndex.js\";\nexport {default as mean} from \"./mean.js\";\nexport {default as median, medianIndex} from \"./median.js\";\nexport {default as merge} from \"./merge.js\";\nexport {default as min} from \"./min.js\";\nexport {default as minIndex} from \"./minIndex.js\";\nexport {default as mode} from \"./mode.js\";\nexport {default as nice} from \"./nice.js\";\nexport {default as pairs} from \"./pairs.js\";\nexport {default as permute} from \"./permute.js\";\nexport {default as quantile, quantileIndex, quantileSorted} from \"./quantile.js\";\nexport {default as quickselect} from \"./quickselect.js\";\nexport {default as range} from \"./range.js\";\nexport {default as rank} from \"./rank.js\";\nexport {default as least} from \"./least.js\";\nexport {default as leastIndex} from \"./leastIndex.js\";\nexport {default as greatest} from \"./greatest.js\";\nexport {default as greatestIndex} from \"./greatestIndex.js\";\nexport {default as scan} from \"./scan.js\"; // Deprecated; use leastIndex.\nexport {default as shuffle, shuffler} from \"./shuffle.js\";\nexport {default as sum} from \"./sum.js\";\nexport {default as ticks, tickIncrement, tickStep} from \"./ticks.js\";\nexport {default as transpose} from \"./transpose.js\";\nexport {default as variance} from \"./variance.js\";\nexport {default as zip} from \"./zip.js\";\nexport {default as every} from \"./every.js\";\nexport {default as some} from \"./some.js\";\nexport {default as filter} from \"./filter.js\";\nexport {default as map} from \"./map.js\";\nexport {default as reduce} from \"./reduce.js\";\nexport {default as reverse} from \"./reverse.js\";\nexport {default as sort} from \"./sort.js\";\nexport {default as difference} from \"./difference.js\";\nexport {default as disjoint} from \"./disjoint.js\";\nexport {default as intersection} from \"./intersection.js\";\nexport {default as subset} from \"./subset.js\";\nexport {default as superset} from \"./superset.js\";\nexport {default as union} from \"./union.js\";\nexport {InternMap, InternSet} from \"internmap\";\n", "export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n", "import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n", "import {range as sequence} from \"d3-array\";\nimport {initRange} from \"./init.js\";\nimport ordinal from \"./ordinal.js\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n", "export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n", "import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n", "export const radians = Math.PI / 180;\nexport const degrees = 180 / Math.PI;\n", "import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * degrees;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * radians;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb() {\n return hcl2lab(this).rgb();\n }\n}));\n", "import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n", "export {default as color, rgb, hsl} from \"./color.js\";\nexport {default as lab, hcl, lch, gray} from \"./lab.js\";\nexport {default as cubehelix} from \"./cubehelix.js\";\n", "export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n", "import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n", "export default x => () => x;\n", "import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n", "import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n", "export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n", "import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n", "export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n", "export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n", "import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n", "import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n", "import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n", "export default function(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n", "import {hue} from \"./color.js\";\n\nexport default function(a, b) {\n var i = hue(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n}\n", "export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n", "var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n", "import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n", "import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n", "var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 \u2245 u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4);\n", "import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n", "import {lab as colorLab} from \"d3-color\";\nimport color from \"./color.js\";\n\nexport default function lab(start, end) {\n var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n a = color(start.a, end.a),\n b = color(start.b, end.b),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n", "import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n", "import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n", "import {default as value} from \"./value.js\";\n\nexport default function piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n", "export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n", "export {default as interpolate} from \"./value.js\";\nexport {default as interpolateArray} from \"./array.js\";\nexport {default as interpolateBasis} from \"./basis.js\";\nexport {default as interpolateBasisClosed} from \"./basisClosed.js\";\nexport {default as interpolateDate} from \"./date.js\";\nexport {default as interpolateDiscrete} from \"./discrete.js\";\nexport {default as interpolateHue} from \"./hue.js\";\nexport {default as interpolateNumber} from \"./number.js\";\nexport {default as interpolateNumberArray} from \"./numberArray.js\";\nexport {default as interpolateObject} from \"./object.js\";\nexport {default as interpolateRound} from \"./round.js\";\nexport {default as interpolateString} from \"./string.js\";\nexport {interpolateTransformCss, interpolateTransformSvg} from \"./transform/index.js\";\nexport {default as interpolateZoom} from \"./zoom.js\";\nexport {default as interpolateRgb, rgbBasis as interpolateRgbBasis, rgbBasisClosed as interpolateRgbBasisClosed} from \"./rgb.js\";\nexport {default as interpolateHsl, hslLong as interpolateHslLong} from \"./hsl.js\";\nexport {default as interpolateLab} from \"./lab.js\";\nexport {default as interpolateHcl, hclLong as interpolateHclLong} from \"./hcl.js\";\nexport {default as interpolateCubehelix, cubehelixLong as interpolateCubehelixLong} from \"./cubehelix.js\";\nexport {default as piecewise} from \"./piecewise.js\";\nexport {default as quantize} from \"./quantize.js\";\n", "export default function constants(x) {\n return function() {\n return x;\n };\n}\n", "export default function number(x) {\n return +x;\n}\n", "import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n", "import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n", "import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n", "import {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nexport default function identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number) : [0, 1];\n\n return linearish(scale);\n}\n", "export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n", "import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n", "import {linearish} from \"./linear.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nexport function symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nexport default function symlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n", "import {linearish} from \"./linear.js\";\nimport {copy, identity, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nexport function powish(transform) {\n var scale = transform(identity, identity),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity, identity)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nexport default function pow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nexport function sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n", "import continuous from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nfunction square(x) {\n return Math.sign(x) * x * x;\n}\n\nfunction unsquare(x) {\n return Math.sign(x) * Math.sqrt(Math.abs(x));\n}\n\nexport default function radial() {\n var squared = continuous(),\n range = [0, 1],\n round = false,\n unknown;\n\n function scale(x) {\n var y = unsquare(squared(x));\n return isNaN(y) ? unknown : round ? Math.round(y) : y;\n }\n\n scale.invert = function(y) {\n return squared.invert(square(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (squared.domain(_), scale) : squared.domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (squared.range((range = Array.from(_, number)).map(square)), scale) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return scale.range(_).round(true);\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, scale) : round;\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (squared.clamp(_), scale) : squared.clamp();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return radial(squared.domain(), range)\n .round(round)\n .clamp(squared.clamp())\n .unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n", "import {ascending, bisect, quantileSorted as threshold} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n", "import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n", "import {bisect} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n", "const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n", "import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n", "import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n", "import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n", "import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n", "export {\n timeInterval\n} from \"./interval.js\";\n\nexport {\n millisecond as utcMillisecond,\n milliseconds as utcMilliseconds,\n millisecond as timeMillisecond,\n milliseconds as timeMilliseconds\n} from \"./millisecond.js\";\n\nexport {\n second as utcSecond,\n seconds as utcSeconds,\n second as timeSecond,\n seconds as timeSeconds\n} from \"./second.js\";\n\nexport {\n timeMinute,\n timeMinutes,\n utcMinute,\n utcMinutes\n} from \"./minute.js\";\n\nexport {\n timeHour,\n timeHours,\n utcHour,\n utcHours\n} from \"./hour.js\";\n\nexport {\n timeDay,\n timeDays,\n utcDay,\n utcDays,\n unixDay,\n unixDays\n} from \"./day.js\";\n\nexport {\n timeSunday as timeWeek,\n timeSundays as timeWeeks,\n timeSunday,\n timeSundays,\n timeMonday,\n timeMondays,\n timeTuesday,\n timeTuesdays,\n timeWednesday,\n timeWednesdays,\n timeThursday,\n timeThursdays,\n timeFriday,\n timeFridays,\n timeSaturday,\n timeSaturdays,\n utcSunday as utcWeek,\n utcSundays as utcWeeks,\n utcSunday,\n utcSundays,\n utcMonday,\n utcMondays,\n utcTuesday,\n utcTuesdays,\n utcWednesday,\n utcWednesdays,\n utcThursday,\n utcThursdays,\n utcFriday,\n utcFridays,\n utcSaturday,\n utcSaturdays\n} from \"./week.js\";\n\nexport {\n timeMonth,\n timeMonths,\n utcMonth,\n utcMonths\n} from \"./month.js\";\n\nexport {\n timeYear,\n timeYears,\n utcYear,\n utcYears\n} from \"./year.js\";\n\nexport {\n utcTicks,\n utcTickInterval,\n timeTicks,\n timeTickInterval\n} from \"./ticks.js\";\n", "import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n", "import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n", "export {default as timeFormatDefaultLocale, timeFormat, timeParse, utcFormat, utcParse} from \"./defaultLocale.js\";\nexport {default as timeFormatLocale} from \"./locale.js\";\nexport {default as isoFormat} from \"./isoFormat.js\";\nexport {default as isoParse} from \"./isoParse.js\";\n", "import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n", "import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from \"d3-time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {calendar} from \"./time.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function utcTime() {\n return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n", "import {interpolate, interpolateRound} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport default function sequential() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialLog() {\n var scale = loggish(transformer()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n", "import {ascending, bisect, quantile} from \"d3-array\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\n\nexport default function sequentialQuantile() {\n var domain = [],\n interpolator = identity;\n\n function scale(x) {\n if (x != null && !isNaN(x = +x)) return interpolator((bisect(domain, x, 1) - 1) / (domain.length - 1));\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return scale;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.range = function() {\n return domain.map((d, i) => interpolator(i / (domain.length - 1)));\n };\n\n scale.quantiles = function(n) {\n return Array.from({length: n + 1}, (_, i) => quantile(domain, i / n));\n };\n\n scale.copy = function() {\n return sequentialQuantile(interpolator).domain(domain);\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n", "import {interpolate, interpolateRound, piecewise} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {copy} from \"./sequential.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nexport default function diverging() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n", "export {\n default as scaleBand,\n point as scalePoint\n} from \"./band.js\";\n\nexport {\n default as scaleIdentity\n} from \"./identity.js\";\n\nexport {\n default as scaleLinear\n} from \"./linear.js\";\n\nexport {\n default as scaleLog\n} from \"./log.js\";\n\nexport {\n default as scaleSymlog\n} from \"./symlog.js\";\n\nexport {\n default as scaleOrdinal,\n implicit as scaleImplicit\n} from \"./ordinal.js\";\n\nexport {\n default as scalePow,\n sqrt as scaleSqrt\n} from \"./pow.js\";\n\nexport {\n default as scaleRadial\n} from \"./radial.js\";\n\nexport {\n default as scaleQuantile\n} from \"./quantile.js\";\n\nexport {\n default as scaleQuantize\n} from \"./quantize.js\";\n\nexport {\n default as scaleThreshold\n} from \"./threshold.js\";\n\nexport {\n default as scaleTime\n} from \"./time.js\";\n\nexport {\n default as scaleUtc\n} from \"./utcTime.js\";\n\nexport {\n default as scaleSequential,\n sequentialLog as scaleSequentialLog,\n sequentialPow as scaleSequentialPow,\n sequentialSqrt as scaleSequentialSqrt,\n sequentialSymlog as scaleSequentialSymlog\n} from \"./sequential.js\";\n\nexport {\n default as scaleSequentialQuantile\n} from \"./sequentialQuantile.js\";\n\nexport {\n default as scaleDiverging,\n divergingLog as scaleDivergingLog,\n divergingPow as scaleDivergingPow,\n divergingSqrt as scaleDivergingSqrt,\n divergingSymlog as scaleDivergingSymlog\n} from \"./diverging.js\";\n\nexport {\n default as tickFormat\n} from \"./tickFormat.js\";\n", "export default function(x) {\n return x;\n}\n", "import identity from \"./identity.js\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + x + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + y + \")\";\n}\n\nfunction number(scale) {\n return d => +scale(d);\n}\n\nfunction center(scale, offset) {\n offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;\n if (scale.round()) offset = Math.round(offset);\n return d => +scale(d) + offset;\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n offset = typeof window !== \"undefined\" && window.devicePixelRatio > 1 ? 0 : 0.5,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + offset,\n range1 = +range[range.length - 1] + offset,\n position = (scale.bandwidth ? center : number)(scale.copy(), offset),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"currentColor\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"currentColor\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"currentColor\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"));\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient === right\n ? (tickSizeOuter ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H\" + offset + \"V\" + range1 + \"H\" + k * tickSizeOuter : \"M\" + offset + \",\" + range0 + \"V\" + range1)\n : (tickSizeOuter ? \"M\" + range0 + \",\" + k * tickSizeOuter + \"V\" + offset + \"H\" + range1 + \"V\" + k * tickSizeOuter : \"M\" + range0 + \",\" + offset + \"H\" + range1));\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d) + offset); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.ticks = function() {\n return tickArguments = Array.from(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n axis.offset = function(_) {\n return arguments.length ? (offset = +_, axis) : offset;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n", "export {\n axisTop,\n axisRight,\n axisBottom,\n axisLeft\n} from \"./axis.js\";\n", "var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n", "export {default as dispatch} from \"./dispatch.js\";\n", "export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n", "import namespaces from \"./namespaces.js\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n", "import namespace from \"./namespace.js\";\nimport {xhtml} from \"./namespaces.js\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n", "function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n", "import {Selection} from \"./index.js\";\nimport selector from \"../selector.js\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n", "// Given something array like (or null), returns something that is strictly an\n// array. This is used to ensure that array-like objects passed to d3.selectAll\n// or selection.selectAll are converted into proper arrays when creating a\n// selection; we don\u2019t ever want to create a selection backed by a live\n// HTMLCollection or NodeList. However, note that selection.selectAll will use a\n// static NodeList as a group, since it safely derived from querySelectorAll.\nexport default function array(x) {\n return x == null ? [] : Array.isArray(x) ? x : Array.from(x);\n}\n", "function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n", "import {Selection} from \"./index.js\";\nimport array from \"../array.js\";\nimport selectorAll from \"../selectorAll.js\";\n\nfunction arrayAll(select) {\n return function() {\n return array(select.apply(this, arguments));\n };\n}\n\nexport default function(select) {\n if (typeof select === \"function\") select = arrayAll(select);\n else select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n", "export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n\nexport function childMatcher(selector) {\n return function(node) {\n return node.matches(selector);\n };\n}\n\n", "import {childMatcher} from \"../matcher.js\";\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n return function() {\n return find.call(this.children, match);\n };\n}\n\nfunction childFirst() {\n return this.firstElementChild;\n}\n\nexport default function(match) {\n return this.select(match == null ? childFirst\n : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {childMatcher} from \"../matcher.js\";\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n return Array.from(this.children);\n}\n\nfunction childrenFilter(match) {\n return function() {\n return filter.call(this.children, match);\n };\n}\n\nexport default function(match) {\n return this.selectAll(match == null ? children\n : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {Selection} from \"./index.js\";\nimport matcher from \"../matcher.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n", "export default function(update) {\n return new Array(update.length);\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n", "export default function(x) {\n return function() {\n return x;\n };\n}\n", "import {Selection} from \"./index.js\";\nimport {EnterNode} from \"./enter.js\";\nimport constant from \"../constant.js\";\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don\u2019t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = new Map,\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n if (nodeByKeyValue.has(keyValue)) {\n exit[i] = node;\n } else {\n nodeByKeyValue.set(keyValue, node);\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = key.call(parent, data[i], i, data) + \"\";\n if (node = nodeByKeyValue.get(keyValue)) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue.delete(keyValue);\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n exit[i] = node;\n }\n }\n}\n\nfunction datum(node) {\n return node.__data__;\n}\n\nexport default function(value, key) {\n if (!arguments.length) return Array.from(this, datum);\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n\n// Given some data, this returns an array-like view of it: an object that\n// exposes a length property and allows numeric indexing. Note that unlike\n// selectAll, this isn\u2019t worried about \u201Clive\u201D collections because the resulting\n// array will only be used briefly while data is being bound. (It is possible to\n// cause the data to change while iterating by using a key function, but please\n// don\u2019t; we\u2019d rather avoid a gratuitous copy.)\nfunction arraylike(data) {\n return typeof data === \"object\" && \"length\" in data\n ? data // Array, TypedArray, NodeList, array-like\n : Array.from(data); // Map, Set, iterable, string, or anything else\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n", "export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n if (typeof onenter === \"function\") {\n enter = onenter(enter);\n if (enter) enter = enter.selection();\n } else {\n enter = enter.append(onenter + \"\");\n }\n if (onupdate != null) {\n update = onupdate(update);\n if (update) update = update.selection();\n }\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(context) {\n var selection = context.selection ? context.selection() : context;\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n", "export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n", "export default function() {\n return Array.from(this);\n}\n", "export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n", "export default function() {\n let size = 0;\n for (const node of this) ++size; // eslint-disable-line no-unused-vars\n return size;\n}\n", "export default function() {\n return !this.node();\n}\n", "export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n", "import namespace from \"../namespace.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n", "export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n", "import defaultView from \"../window.js\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n", "function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n", "function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n", "function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n", "function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n", "function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n", "function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n", "import creator from \"../creator.js\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n", "import creator from \"../creator.js\";\nimport selector from \"../selector.js\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n", "function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n", "function selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n", "export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n", "function contextListener(listener) {\n return function(event) {\n listener.call(this, event, this.__data__);\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, options) {\n return function() {\n var on = this.__on, o, listener = contextListener(value);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n this.addEventListener(o.type, o.listener = listener, o.options = options);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, options);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, options) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n return this;\n}\n", "import defaultView from \"../window.js\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n", "export default function*() {\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) yield node;\n }\n }\n}\n", "import selection_select from \"./select.js\";\nimport selection_selectAll from \"./selectAll.js\";\nimport selection_selectChild from \"./selectChild.js\";\nimport selection_selectChildren from \"./selectChildren.js\";\nimport selection_filter from \"./filter.js\";\nimport selection_data from \"./data.js\";\nimport selection_enter from \"./enter.js\";\nimport selection_exit from \"./exit.js\";\nimport selection_join from \"./join.js\";\nimport selection_merge from \"./merge.js\";\nimport selection_order from \"./order.js\";\nimport selection_sort from \"./sort.js\";\nimport selection_call from \"./call.js\";\nimport selection_nodes from \"./nodes.js\";\nimport selection_node from \"./node.js\";\nimport selection_size from \"./size.js\";\nimport selection_empty from \"./empty.js\";\nimport selection_each from \"./each.js\";\nimport selection_attr from \"./attr.js\";\nimport selection_style from \"./style.js\";\nimport selection_property from \"./property.js\";\nimport selection_classed from \"./classed.js\";\nimport selection_text from \"./text.js\";\nimport selection_html from \"./html.js\";\nimport selection_raise from \"./raise.js\";\nimport selection_lower from \"./lower.js\";\nimport selection_append from \"./append.js\";\nimport selection_insert from \"./insert.js\";\nimport selection_remove from \"./remove.js\";\nimport selection_clone from \"./clone.js\";\nimport selection_datum from \"./datum.js\";\nimport selection_on from \"./on.js\";\nimport selection_dispatch from \"./dispatch.js\";\nimport selection_iterator from \"./iterator.js\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n return this;\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n selectChild: selection_selectChild,\n selectChildren: selection_selectChildren,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n selection: selection_selection,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch,\n [Symbol.iterator]: selection_iterator\n};\n\nexport default selection;\n", "import {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n", "import creator from \"./creator.js\";\nimport select from \"./select.js\";\n\nexport default function(name) {\n return select(creator(name).call(document.documentElement));\n}\n", "var nextId = 0;\n\nexport default function local() {\n return new Local;\n}\n\nfunction Local() {\n this._ = \"@\" + (++nextId).toString(36);\n}\n\nLocal.prototype = local.prototype = {\n constructor: Local,\n get: function(node) {\n var id = this._;\n while (!(id in node)) if (!(node = node.parentNode)) return;\n return node[id];\n },\n set: function(node, value) {\n return node[this._] = value;\n },\n remove: function(node) {\n return this._ in node && delete node[this._];\n },\n toString: function() {\n return this._;\n }\n};\n", "export default function(event) {\n let sourceEvent;\n while (sourceEvent = event.sourceEvent) event = sourceEvent;\n return event;\n}\n", "import sourceEvent from \"./sourceEvent.js\";\n\nexport default function(event, node) {\n event = sourceEvent(event);\n if (node === undefined) node = event.currentTarget;\n if (node) {\n var svg = node.ownerSVGElement || node;\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n if (node.getBoundingClientRect) {\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n }\n }\n return [event.pageX, event.pageY];\n}\n", "import pointer from \"./pointer.js\";\nimport sourceEvent from \"./sourceEvent.js\";\n\nexport default function(events, node) {\n if (events.target) { // i.e., instanceof Event, not TouchList or iterable\n events = sourceEvent(events);\n if (node === undefined) node = events.currentTarget;\n events = events.touches || [events];\n }\n return Array.from(events, event => pointer(event, node));\n}\n", "import array from \"./array.js\";\nimport {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([document.querySelectorAll(selector)], [document.documentElement])\n : new Selection([array(selector)], root);\n}\n", "export {default as create} from \"./create.js\";\nexport {default as creator} from \"./creator.js\";\nexport {default as local} from \"./local.js\";\nexport {default as matcher} from \"./matcher.js\";\nexport {default as namespace} from \"./namespace.js\";\nexport {default as namespaces} from \"./namespaces.js\";\nexport {default as pointer} from \"./pointer.js\";\nexport {default as pointers} from \"./pointers.js\";\nexport {default as select} from \"./select.js\";\nexport {default as selectAll} from \"./selectAll.js\";\nexport {default as selection} from \"./selection/index.js\";\nexport {default as selector} from \"./selector.js\";\nexport {default as selectorAll} from \"./selectorAll.js\";\nexport {styleValue as style} from \"./selection/style.js\";\nexport {default as window} from \"./window.js\";\n", "// These are typically used in conjunction with noevent to ensure that we can\n// preventDefault on the event.\nexport const nonpassive = {passive: false};\nexport const nonpassivecapture = {capture: true, passive: false};\n\nexport function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n", "import {select} from \"d3-selection\";\nimport noevent, {nonpassivecapture} from \"./noevent.js\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, nonpassivecapture);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, nonpassivecapture);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, nonpassivecapture);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n", "export {default as drag} from \"./drag.js\";\nexport {default as dragDisable, yesdrag as dragEnable} from \"./nodrag.js\";\n", "var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we\u2019ve set an alarm, if we haven\u2019t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n", "import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(elapsed => {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n", "export {\n now,\n timer,\n timerFlush\n} from \"./timer.js\";\n\nexport {\n default as timeout\n} from \"./timeout.js\";\n\nexport {\n default as interval\n} from \"./interval.js\";\n", "import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n", "import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n", "import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we\u2019re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we\u2019re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n", "import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n", "import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n", "import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n", "import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n", "import {set} from \"./schedule.js\";\n\nfunction easeVarying(id, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (typeof v !== \"function\") throw new Error;\n set(this, id).ease = v;\n };\n}\n\nexport default function(value) {\n if (typeof value !== \"function\") throw new Error;\n return this.each(easeVarying(this._id, value));\n}\n", "import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n", "import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n", "import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n", "function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n", "import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n", "import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n", "import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n", "function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n", "import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n", "function textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n", "import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n", "import {set} from \"./schedule.js\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n\n // The selection was empty, resolve end immediately\n if (size === 0) resolve();\n });\n}\n", "import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_easeVarying from \"./easeVarying.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n selectChild: selection_prototype.selectChild,\n selectChildren: selection_prototype.selectChildren,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n easeVarying: transition_easeVarying,\n end: transition_end,\n [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n", "export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n", "export {\n linear as easeLinear\n} from \"./linear.js\";\n\nexport {\n quadInOut as easeQuad,\n quadIn as easeQuadIn,\n quadOut as easeQuadOut,\n quadInOut as easeQuadInOut\n} from \"./quad.js\";\n\nexport {\n cubicInOut as easeCubic,\n cubicIn as easeCubicIn,\n cubicOut as easeCubicOut,\n cubicInOut as easeCubicInOut\n} from \"./cubic.js\";\n\nexport {\n polyInOut as easePoly,\n polyIn as easePolyIn,\n polyOut as easePolyOut,\n polyInOut as easePolyInOut\n} from \"./poly.js\";\n\nexport {\n sinInOut as easeSin,\n sinIn as easeSinIn,\n sinOut as easeSinOut,\n sinInOut as easeSinInOut\n} from \"./sin.js\";\n\nexport {\n expInOut as easeExp,\n expIn as easeExpIn,\n expOut as easeExpOut,\n expInOut as easeExpInOut\n} from \"./exp.js\";\n\nexport {\n circleInOut as easeCircle,\n circleIn as easeCircleIn,\n circleOut as easeCircleOut,\n circleInOut as easeCircleInOut\n} from \"./circle.js\";\n\nexport {\n bounceOut as easeBounce,\n bounceIn as easeBounceIn,\n bounceOut as easeBounceOut,\n bounceInOut as easeBounceInOut\n} from \"./bounce.js\";\n\nexport {\n backInOut as easeBack,\n backIn as easeBackIn,\n backOut as easeBackOut,\n backInOut as easeBackInOut\n} from \"./back.js\";\n\nexport {\n elasticOut as easeElastic,\n elasticIn as easeElasticIn,\n elasticOut as easeElasticOut,\n elasticInOut as easeElasticInOut\n} from \"./elastic.js\";\n", "import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n throw new Error(`transition ${id} not found`);\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n", "import \"./selection/index.js\";\nexport {default as transition} from \"./transition/index.js\";\nexport {default as active} from \"./active.js\";\nexport {default as interrupt} from \"./interrupt.js\";\n", "export default x => () => x;\n", "export default function ZoomEvent(type, {\n sourceEvent,\n target,\n transform,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n transform: {value: transform, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n", "export function Transform(k, x, y) {\n this.k = k;\n this.x = x;\n this.y = y;\n}\n\nTransform.prototype = {\n constructor: Transform,\n scale: function(k) {\n return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n },\n translate: function(x, y) {\n return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n },\n apply: function(point) {\n return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n },\n applyX: function(x) {\n return x * this.k + this.x;\n },\n applyY: function(y) {\n return y * this.k + this.y;\n },\n invert: function(location) {\n return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n },\n invertX: function(x) {\n return (x - this.x) / this.k;\n },\n invertY: function(y) {\n return (y - this.y) / this.k;\n },\n rescaleX: function(x) {\n return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n },\n rescaleY: function(y) {\n return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n },\n toString: function() {\n return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n return node.__zoom;\n}\n", "export function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n", "import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolateZoom} from \"d3-interpolate\";\nimport {select, pointer} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport ZoomEvent from \"./event.js\";\nimport {Transform, identity} from \"./transform.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\n// Ignore right-click, since that should open the context menu.\n// except for pinch-to-zoom, which is sent as a wheel+ctrlKey event\nfunction defaultFilter(event) {\n return (!event.ctrlKey || event.type === 'wheel') && !event.button;\n}\n\nfunction defaultExtent() {\n var e = this;\n if (e instanceof SVGElement) {\n e = e.ownerSVGElement || e;\n if (e.hasAttribute(\"viewBox\")) {\n e = e.viewBox.baseVal;\n return [[e.x, e.y], [e.x + e.width, e.y + e.height]];\n }\n return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];\n }\n return [[0, 0], [e.clientWidth, e.clientHeight]];\n}\n\nfunction defaultTransform() {\n return this.__zoom || identity;\n}\n\nfunction defaultWheelDelta(event) {\n return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * (event.ctrlKey ? 10 : 1);\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nfunction defaultConstrain(transform, extent, translateExtent) {\n var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],\n dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],\n dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],\n dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];\n return transform.translate(\n dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),\n dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)\n );\n}\n\nexport default function() {\n var filter = defaultFilter,\n extent = defaultExtent,\n constrain = defaultConstrain,\n wheelDelta = defaultWheelDelta,\n touchable = defaultTouchable,\n scaleExtent = [0, Infinity],\n translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],\n duration = 250,\n interpolate = interpolateZoom,\n listeners = dispatch(\"start\", \"zoom\", \"end\"),\n touchstarting,\n touchfirst,\n touchending,\n touchDelay = 500,\n wheelDelay = 150,\n clickDistance2 = 0,\n tapDistance = 10;\n\n function zoom(selection) {\n selection\n .property(\"__zoom\", defaultTransform)\n .on(\"wheel.zoom\", wheeled, {passive: false})\n .on(\"mousedown.zoom\", mousedowned)\n .on(\"dblclick.zoom\", dblclicked)\n .filter(touchable)\n .on(\"touchstart.zoom\", touchstarted)\n .on(\"touchmove.zoom\", touchmoved)\n .on(\"touchend.zoom touchcancel.zoom\", touchended)\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n zoom.transform = function(collection, transform, point, event) {\n var selection = collection.selection ? collection.selection() : collection;\n selection.property(\"__zoom\", defaultTransform);\n if (collection !== selection) {\n schedule(collection, transform, point, event);\n } else {\n selection.interrupt().each(function() {\n gesture(this, arguments)\n .event(event)\n .start()\n .zoom(null, typeof transform === \"function\" ? transform.apply(this, arguments) : transform)\n .end();\n });\n }\n };\n\n zoom.scaleBy = function(selection, k, p, event) {\n zoom.scaleTo(selection, function() {\n var k0 = this.__zoom.k,\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return k0 * k1;\n }, p, event);\n };\n\n zoom.scaleTo = function(selection, k, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t0 = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p,\n p1 = t0.invert(p0),\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);\n }, p, event);\n };\n\n zoom.translateBy = function(selection, x, y, event) {\n zoom.transform(selection, function() {\n return constrain(this.__zoom.translate(\n typeof x === \"function\" ? x.apply(this, arguments) : x,\n typeof y === \"function\" ? y.apply(this, arguments) : y\n ), extent.apply(this, arguments), translateExtent);\n }, null, event);\n };\n\n zoom.translateTo = function(selection, x, y, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p;\n return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate(\n typeof x === \"function\" ? -x.apply(this, arguments) : -x,\n typeof y === \"function\" ? -y.apply(this, arguments) : -y\n ), e, translateExtent);\n }, p, event);\n };\n\n function scale(transform, k) {\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));\n return k === transform.k ? transform : new Transform(k, transform.x, transform.y);\n }\n\n function translate(transform, p0, p1) {\n var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;\n return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);\n }\n\n function centroid(extent) {\n return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];\n }\n\n function schedule(transition, transform, point, event) {\n transition\n .on(\"start.zoom\", function() { gesture(this, arguments).event(event).start(); })\n .on(\"interrupt.zoom end.zoom\", function() { gesture(this, arguments).event(event).end(); })\n .tween(\"zoom\", function() {\n var that = this,\n args = arguments,\n g = gesture(that, args).event(event),\n e = extent.apply(that, args),\n p = point == null ? centroid(e) : typeof point === \"function\" ? point.apply(that, args) : point,\n w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),\n a = that.__zoom,\n b = typeof transform === \"function\" ? transform.apply(that, args) : transform,\n i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));\n return function(t) {\n if (t === 1) t = b; // Avoid rounding error on end.\n else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }\n g.zoom(null, t);\n };\n });\n }\n\n function gesture(that, args, clean) {\n return (!clean && that.__zooming) || new Gesture(that, args);\n }\n\n function Gesture(that, args) {\n this.that = that;\n this.args = args;\n this.active = 0;\n this.sourceEvent = null;\n this.extent = extent.apply(that, args);\n this.taps = 0;\n }\n\n Gesture.prototype = {\n event: function(event) {\n if (event) this.sourceEvent = event;\n return this;\n },\n start: function() {\n if (++this.active === 1) {\n this.that.__zooming = this;\n this.emit(\"start\");\n }\n return this;\n },\n zoom: function(key, transform) {\n if (this.mouse && key !== \"mouse\") this.mouse[1] = transform.invert(this.mouse[0]);\n if (this.touch0 && key !== \"touch\") this.touch0[1] = transform.invert(this.touch0[0]);\n if (this.touch1 && key !== \"touch\") this.touch1[1] = transform.invert(this.touch1[0]);\n this.that.__zoom = transform;\n this.emit(\"zoom\");\n return this;\n },\n end: function() {\n if (--this.active === 0) {\n delete this.that.__zooming;\n this.emit(\"end\");\n }\n return this;\n },\n emit: function(type) {\n var d = select(this.that).datum();\n listeners.call(\n type,\n this.that,\n new ZoomEvent(type, {\n sourceEvent: this.sourceEvent,\n target: zoom,\n type,\n transform: this.that.__zoom,\n dispatch: listeners\n }),\n d\n );\n }\n };\n\n function wheeled(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var g = gesture(this, args).event(event),\n t = this.__zoom,\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),\n p = pointer(event);\n\n // If the mouse is in the same location as before, reuse it.\n // If there were recent wheel events, reset the wheel idle timeout.\n if (g.wheel) {\n if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {\n g.mouse[1] = t.invert(g.mouse[0] = p);\n }\n clearTimeout(g.wheel);\n }\n\n // If this wheel event won\u2019t trigger a transform change, ignore it.\n else if (t.k === k) return;\n\n // Otherwise, capture the mouse point and location at the start.\n else {\n g.mouse = [p, t.invert(p)];\n interrupt(this);\n g.start();\n }\n\n noevent(event);\n g.wheel = setTimeout(wheelidled, wheelDelay);\n g.zoom(\"mouse\", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));\n\n function wheelidled() {\n g.wheel = null;\n g.end();\n }\n }\n\n function mousedowned(event, ...args) {\n if (touchending || !filter.apply(this, arguments)) return;\n var currentTarget = event.currentTarget,\n g = gesture(this, args, true).event(event),\n v = select(event.view).on(\"mousemove.zoom\", mousemoved, true).on(\"mouseup.zoom\", mouseupped, true),\n p = pointer(event, currentTarget),\n x0 = event.clientX,\n y0 = event.clientY;\n\n dragDisable(event.view);\n nopropagation(event);\n g.mouse = [p, this.__zoom.invert(p)];\n interrupt(this);\n g.start();\n\n function mousemoved(event) {\n noevent(event);\n if (!g.moved) {\n var dx = event.clientX - x0, dy = event.clientY - y0;\n g.moved = dx * dx + dy * dy > clickDistance2;\n }\n g.event(event)\n .zoom(\"mouse\", constrain(translate(g.that.__zoom, g.mouse[0] = pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent));\n }\n\n function mouseupped(event) {\n v.on(\"mousemove.zoom mouseup.zoom\", null);\n dragEnable(event.view, g.moved);\n noevent(event);\n g.event(event).end();\n }\n }\n\n function dblclicked(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var t0 = this.__zoom,\n p0 = pointer(event.changedTouches ? event.changedTouches[0] : event, this),\n p1 = t0.invert(p0),\n k1 = t0.k * (event.shiftKey ? 0.5 : 2),\n t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);\n\n noevent(event);\n if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0, event);\n else select(this).call(zoom.transform, t1, p0, event);\n }\n\n function touchstarted(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var touches = event.touches,\n n = touches.length,\n g = gesture(this, args, event.changedTouches.length === n).event(event),\n started, i, t, p;\n\n nopropagation(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = pointer(t, this);\n p = [p, this.__zoom.invert(p), t.identifier];\n if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;\n else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0;\n }\n\n if (touchstarting) touchstarting = clearTimeout(touchstarting);\n\n if (started) {\n if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay);\n interrupt(this);\n g.start();\n }\n }\n\n function touchmoved(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t, p, l;\n\n noevent(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = pointer(t, this);\n if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;\n else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;\n }\n t = g.that.__zoom;\n if (g.touch1) {\n var p0 = g.touch0[0], l0 = g.touch0[1],\n p1 = g.touch1[0], l1 = g.touch1[1],\n dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,\n dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;\n t = scale(t, Math.sqrt(dp / dl));\n p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];\n l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];\n }\n else if (g.touch0) p = g.touch0[0], l = g.touch0[1];\n else return;\n\n g.zoom(\"touch\", constrain(translate(t, p, l), g.extent, translateExtent));\n }\n\n function touchended(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t;\n\n nopropagation(event);\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, touchDelay);\n for (i = 0; i < n; ++i) {\n t = touches[i];\n if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;\n else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;\n }\n if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;\n if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);\n else {\n g.end();\n // If this was a dbltap, reroute to the (optional) dblclick.zoom handler.\n if (g.taps === 2) {\n t = pointer(t, this);\n if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {\n var p = select(this).on(\"dblclick.zoom\");\n if (p) p.apply(this, arguments);\n }\n }\n }\n }\n\n zoom.wheelDelta = function(_) {\n return arguments.length ? (wheelDelta = typeof _ === \"function\" ? _ : constant(+_), zoom) : wheelDelta;\n };\n\n zoom.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), zoom) : filter;\n };\n\n zoom.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), zoom) : touchable;\n };\n\n zoom.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;\n };\n\n zoom.scaleExtent = function(_) {\n return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];\n };\n\n zoom.translateExtent = function(_) {\n return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];\n };\n\n zoom.constrain = function(_) {\n return arguments.length ? (constrain = _, zoom) : constrain;\n };\n\n zoom.duration = function(_) {\n return arguments.length ? (duration = +_, zoom) : duration;\n };\n\n zoom.interpolate = function(_) {\n return arguments.length ? (interpolate = _, zoom) : interpolate;\n };\n\n zoom.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? zoom : value;\n };\n\n zoom.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);\n };\n\n zoom.tapDistance = function(_) {\n return arguments.length ? (tapDistance = +_, zoom) : tapDistance;\n };\n\n return zoom;\n}\n", "export {default as zoom} from \"./zoom.js\";\nexport {default as zoomTransform, identity as zoomIdentity, Transform as ZoomTransform} from \"./transform.js\";\n", "var e,t,n=\"object\"==typeof Reflect?Reflect:null,r=n&&\"function\"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&\"function\"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this);}e=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function u(e){if(\"function\"!=typeof e)throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function v(e,t,n,r){var i,o,s,v;if(u(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit(\"newListener\",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if(\"function\"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=f(e))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error(\"Possible EventEmitter memory leak detected. \"+s.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");a.name=\"MaxListenersExceededWarning\",a.emitter=e,a.type=t,a.count=s.length,v=a,console&&console.warn&&console.warn(v);}return e}function a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=a.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return [];var i=r[t];return void 0===i?[]:\"function\"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var u=new Error(\"Unhandled error.\"+(s?\" (\"+s.message+\")\":\"\"));throw u.context=s,u}var f=o[e];if(void 0===f)return !1;if(\"function\"==typeof f)r(f,this,t);else {var v=f.length,a=c(f,v);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():!function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return \"function\"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};var y=e;y.EventEmitter;y.defaultMaxListeners;y.init;y.listenerCount;\n\ny.EventEmitter;\ny.defaultMaxListeners;\ny.init;\ny.listenerCount;\n\nexport { y };\n", "import { y } from './chunk-4bd36a8f.js';\nexport { y as default } from './chunk-4bd36a8f.js';\n\n// https://github.com/denoland/deno_std/blob/d005433c709054af87aca54f57a446b4f7966f11/node/events.ts#L501-L638\r\ny.once = function (emitter, event) {\r\n return new Promise((resolve, reject) => {\r\n function eventListener(...args) {\r\n if (errorListener !== undefined) {\r\n emitter.removeListener('error', errorListener);\r\n }\r\n resolve(args);\r\n }\r\n let errorListener;\r\n if (event !== 'error') {\r\n // deno-lint-ignore no-explicit-any\r\n errorListener = (err) => {\r\n emitter.removeListener(name, eventListener);\r\n reject(err);\r\n };\r\n\r\n emitter.once('error', errorListener);\r\n }\r\n\r\n emitter.once(event, eventListener);\r\n });\r\n};\r\ny.on = function (emitter, event) {\r\n const unconsumedEventValues = [];\r\n const unconsumedPromises = [];\r\n let error = null;\r\n let finished = false;\r\n\r\n const iterator = {\r\n async next() {\r\n const value = unconsumedEventValues.shift();\r\n if (value) {\r\n return createIterResult(value, false);\r\n }\r\n\r\n if (error) {\r\n const p = Promise.reject(error);\r\n error = null;\r\n return p;\r\n }\r\n\r\n if (finished) {\r\n return createIterResult(undefined, true);\r\n }\r\n\r\n return new Promise((resolve, reject) => unconsumedPromises.push({ resolve, reject }));\r\n },\r\n async return() {\r\n emitter.removeListener(event, eventHandler);\r\n emitter.removeListener('error', errorHandler);\r\n finished = true;\r\n\r\n for (const promise of unconsumedPromises) {\r\n promise.resolve(createIterResult(undefined, true));\r\n }\r\n\r\n return createIterResult(undefined, true);\r\n },\r\n throw(err) {\r\n error = err;\r\n emitter.removeListener(event, eventHandler);\r\n emitter.removeListener('error', errorHandler);\r\n },\r\n [Symbol.asyncIterator]() {\r\n return this;\r\n },\r\n };\r\n\r\n emitter.on(event, eventHandler);\r\n emitter.on('error', errorHandler);\r\n\r\n return iterator;\r\n\r\n function eventHandler(...args) {\r\n const promise = unconsumedPromises.shift();\r\n if (promise) {\r\n promise.resolve(createIterResult(args, false));\r\n } else {\r\n unconsumedEventValues.push(args);\r\n }\r\n }\r\n\r\n function errorHandler(err) {\r\n finished = true;\r\n const toError = unconsumedPromises.shift();\r\n if (toError) {\r\n toError.reject(err);\r\n } else {\r\n error = err;\r\n }\r\n iterator.return();\r\n }\r\n};\r\nconst {\r\n EventEmitter,\r\n defaultMaxListeners,\r\n init,\r\n listenerCount,\r\n on,\r\n once,\r\n} = y;\n\nexport { EventEmitter, defaultMaxListeners, init, listenerCount, on, once };\n", null, null, null, "module.exports = {\n EOF: 0,\n DELIMITER: 1,\n NUMBER: 2,\n STRING: 3,\n SYMBOL: 4\n}\n", "// token types\nvar tokenType = require('./token-type')\n\nvar ESCAPES = {\n 'n': '\\n',\n 'f': '\\f',\n 'r': '\\r',\n 't': '\\t',\n 'v': '\\v',\n '\\'': '\\'',\n '\"': '\"'\n}\n\nvar DELIMITERS = {\n ',': true,\n '(': true,\n ')': true,\n '[': true,\n ']': true,\n ';': true,\n\n // unary\n '~': true,\n\n // factorial\n '!': true,\n\n // arithmetic operators\n '+': true,\n '-': true,\n '*': true,\n '/': true,\n '%': true,\n '^': true,\n '**': true, // python power like\n\n // misc operators\n '|': true, // bitwise or\n '&': true, // bitwise and\n '^|': true, // bitwise xor\n '=': true,\n ':': true,\n '?': true,\n\n '||': true, // logical or\n '&&': true, // logical and\n 'xor': true, // logical xor\n\n // relational\n '==': true,\n '!=': true,\n '===': true,\n '!==': true,\n '<': true,\n '>': true,\n '>=': true,\n '<=': true,\n\n // shifts\n '>>>': true,\n '<<': true,\n '>>': true\n}\n\n// helpers\n\nfunction isDigit (c) {\n return c >= '0' && c <= '9'\n}\n\nfunction isIdentifier (c) {\n return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||\n c === '$' || c === '_'\n}\n\nfunction isWhitespace (c) {\n return c === ' ' || c === '\\r' || c === '\\t' ||\n c === '\\n' || c === '\\v' || c === '\\u00A0'\n}\n\nfunction isDelimiter (str) {\n return DELIMITERS[str]\n}\n\nfunction isQuote (c) {\n return c === '\\'' || c === '\"'\n}\n\n// lexer\n\nfunction Lexer () {}\n\nLexer.prototype.throwError = function (message, index) {\n index = typeof index === 'undefined' ? this.index : index\n\n var error = new Error(message + ' at index ' + index)\n error.index = index\n error.description = message\n throw error\n}\n\nLexer.prototype.lex = function (text) {\n this.text = text\n this.index = 0\n this.tokens = []\n\n while (this.index < this.text.length) {\n // skip whitespaces\n while (isWhitespace(this.peek())) {\n this.consume()\n }\n var c = this.peek()\n var c2 = c + this.peek(1)\n var c3 = c2 + this.peek(2)\n\n // order\n // - delimiter of 3 characters\n // - delimiter of 2 characters\n // - delimiter of 1 character\n // - number\n // - variables, functions and named operators\n if (isDelimiter(c3)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c3\n })\n this.consume()\n this.consume()\n this.consume()\n } else if (isDelimiter(c2)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c2\n })\n this.consume()\n this.consume()\n } else if (isDelimiter(c)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c\n })\n this.consume()\n } else if (isDigit(c) ||\n (c === '.' && isDigit(this.peek(1)))) {\n this.tokens.push({\n type: tokenType.NUMBER,\n value: this.readNumber()\n })\n } else if (isQuote(c)) {\n this.tokens.push({\n type: tokenType.STRING,\n value: this.readString()\n })\n } else if (isIdentifier(c)) {\n this.tokens.push({\n type: tokenType.SYMBOL,\n value: this.readIdentifier()\n })\n } else {\n this.throwError('unexpected character ' + c)\n }\n }\n\n // end token\n this.tokens.push({ type: tokenType.EOF })\n\n return this.tokens\n}\n\nLexer.prototype.peek = function (nth) {\n nth = nth || 0\n if (this.index + nth >= this.text.length) {\n return\n }\n return this.text.charAt(this.index + nth)\n}\n\nLexer.prototype.consume = function () {\n var current = this.peek()\n this.index += 1\n return current\n}\n\nLexer.prototype.readNumber = function () {\n var number = ''\n\n if (this.peek() === '.') {\n number += this.consume()\n if (!isDigit(this.peek())) {\n this.throwError('number expected')\n }\n } else {\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n if (this.peek() === '.') {\n number += this.consume()\n }\n }\n\n // numbers after the decimal dot\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n\n // exponent if available\n if ((this.peek() === 'e' || this.peek() === 'E')) {\n number += this.consume()\n\n if (!(isDigit(this.peek()) ||\n this.peek() === '+' ||\n this.peek() === '-')) {\n this.throwError()\n }\n\n if (this.peek() === '+' || this.peek() === '-') {\n number += this.consume()\n }\n\n if (!isDigit(this.peek())) {\n this.throwError('number expected')\n }\n\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n }\n return number\n}\n\nLexer.prototype.readIdentifier = function () {\n var text = ''\n while (isIdentifier(this.peek()) || isDigit(this.peek())) {\n text += this.consume()\n }\n return text\n}\n\nLexer.prototype.readString = function () {\n var quote = this.consume()\n var string = ''\n var escape\n while (true) {\n var c = this.consume()\n if (!c) {\n this.throwError('string is not closed')\n }\n if (escape) {\n if (c === 'u') {\n var hex = this.text.substring(this.index + 1, this.index + 5)\n if (!hex.match(/[\\da-f]{4}/i)) {\n this.throwError('invalid unicode escape')\n }\n this.index += 4\n string += String.fromCharCode(parseInt(hex, 16))\n } else {\n var replacement = ESCAPES[c]\n if (replacement) {\n string += replacement\n } else {\n string += c\n }\n }\n escape = false\n } else if (c === quote) {\n break\n } else if (c === '\\\\') {\n escape = true\n } else {\n string += c\n }\n }\n return string\n}\n\nmodule.exports = Lexer\n", "function Node () {\n\n}\n\nNode.prototype.type = 'Node'\n\nmodule.exports = Node\n", "var Node = require('./Node')\n\nvar SUPPORTED_TYPES = {\n number: true,\n string: true,\n 'boolean': true,\n 'undefined': true,\n 'null': true\n}\n\nfunction ConstantNode (value, type) {\n if (!SUPPORTED_TYPES[type]) {\n throw Error('unsupported type \\'' + type + '\\'')\n }\n this.value = value\n this.valueType = type\n}\n\nConstantNode.prototype = Object.create(Node.prototype)\n\nConstantNode.prototype.type = 'ConstantNode'\n\nmodule.exports = ConstantNode\n", "var Node = require('./Node')\n\nfunction OperatorNode (op, args) {\n this.op = op\n this.args = args || []\n}\n\nOperatorNode.prototype = Object.create(Node.prototype)\n\nOperatorNode.prototype.type = 'OperatorNode'\n\nmodule.exports = OperatorNode\n", "var Node = require('./Node')\n\nfunction UnaryNode (op, argument) {\n this.op = op\n this.argument = argument\n}\n\nUnaryNode.prototype = Object.create(Node.prototype)\n\nUnaryNode.prototype.type = 'UnaryNode'\n\nmodule.exports = UnaryNode\n", "var Node = require('./Node')\n\nfunction SymbolNode (name) {\n this.name = name\n}\n\nSymbolNode.prototype = Object.create(Node.prototype)\n\nSymbolNode.prototype.type = 'SymbolNode'\n\nmodule.exports = SymbolNode\n", "var Node = require('./Node')\n\nfunction FunctionNode (name, args) {\n this.name = name\n this.args = args\n}\n\nFunctionNode.prototype = Object.create(Node.prototype)\n\nFunctionNode.prototype.type = 'FunctionNode'\n\nmodule.exports = FunctionNode\n", "var Node = require('./Node')\n\nfunction ArrayNode (nodes) {\n this.nodes = nodes\n}\n\nArrayNode.prototype = Object.create(Node.prototype)\n\nArrayNode.prototype.type = 'ArrayNode'\n\nmodule.exports = ArrayNode\n", "var Node = require('./Node')\n\nfunction ConditionalNode (predicate, truthy, falsy) {\n this.condition = predicate\n this.trueExpr = truthy\n this.falseExpr = falsy\n}\n\nConditionalNode.prototype = Object.create(Node.prototype)\n\nConditionalNode.prototype.type = 'ConditionalNode'\n\nmodule.exports = ConditionalNode\n", "var Node = require('./Node')\n\nfunction AssignmentNode (name, expr) {\n this.name = name\n this.expr = expr\n}\n\nAssignmentNode.prototype = Object.create(Node.prototype)\n\nAssignmentNode.prototype.type = 'AssignmentNode'\n\nmodule.exports = AssignmentNode\n", "var Node = require('./Node')\n\nfunction BlockNode (blocks) {\n this.blocks = blocks\n}\n\nBlockNode.prototype = Object.create(Node.prototype)\n\nBlockNode.prototype.type = 'BlockNode'\n\nmodule.exports = BlockNode\n", "var tokenType = require('./token-type')\n\nvar Lexer = require('./Lexer')\nvar ConstantNode = require('./node/ConstantNode')\nvar OperatorNode = require('./node/OperatorNode')\nvar UnaryNode = require('./node/UnaryNode')\nvar SymbolNode = require('./node/SymbolNode')\nvar FunctionNode = require('./node/FunctionNode')\nvar ArrayNode = require('./node/ArrayNode')\nvar ConditionalNode = require('./node/ConditionalNode')\nvar AssignmentNode = require('./node/AssignmentNode')\nvar BlockNode = require('./node/BlockNode')\n\n/**\n * Grammar DSL:\n *\n * program : block (; block)*\n *\n * block : assignment\n *\n * assignment : ternary\n * | symbol `=` assignment\n *\n * ternary : logicalOR\n * | logicalOR `?` ternary `:` ternary\n *\n * logicalOR : logicalXOR\n * | logicalXOR (`||`,`or`) logicalOR\n *\n * logicalXOR : logicalAND\n * : logicalAND `xor` logicalXOR\n *\n * logicalAND : bitwiseOR\n * | bitwiseOR (`&&`,`and`) logicalAND\n *\n * bitwiseOR : bitwiseXOR\n * | bitwiseXOR `|` bitwiseOR\n *\n * bitwiseXOR : bitwiseAND\n * | bitwiseAND `^|` bitwiseXOR\n *\n * bitwiseAND : relational\n * | relational `&` bitwiseAND\n *\n * relational : shift\n * | shift (`!=` | `==` | `>` | '<' | '<=' |'>=') shift)\n *\n * shift : additive\n * | additive (`>>` | `<<` | `>>>`) shift\n *\n * additive : multiplicative\n * | multiplicative (`+` | `-`) additive\n *\n * multiplicative : unary\n * | unary (`*` | `/` | `%`) unary\n * | unary symbol\n *\n * unary : pow\n * | (`-` | `+` | `~`) unary\n *\n * pow : factorial\n * | factorial (`^`, '**') unary\n *\n * factorial : symbol\n * | symbol (`!`)\n *\n * symbol : symbolToken\n * | symbolToken functionCall\n * | string\n *\n * functionCall : `(` `)`\n * | `(` ternary (, ternary)* `)`\n *\n * string : `'` (character)* `'`\n * : `\"` (character)* `\"`\n * | array\n *\n * array : `[` `]`\n * | `[` assignment (, assignment)* `]`\n * | number\n *\n * number : number-token\n * | parentheses\n *\n * parentheses : `(` assignment `)`\n * : end\n *\n * end : NULL\n *\n * @param {[type]} lexer [description]\n */\nfunction Parser () {\n this.lexer = new Lexer()\n this.tokens = null\n}\n\nParser.prototype.current = function () {\n return this.tokens[0]\n}\n\nParser.prototype.next = function () {\n return this.tokens[1]\n}\n\nParser.prototype.peek = function () {\n if (this.tokens.length) {\n var first = this.tokens[0]\n for (var i = 0; i < arguments.length; i += 1) {\n if (first.value === arguments[i]) {\n return true\n }\n }\n }\n}\n\nParser.prototype.consume = function (e) {\n return this.tokens.shift()\n}\n\nParser.prototype.expect = function (e) {\n if (!this.peek(e)) {\n throw Error('expected ' + e)\n }\n return this.consume()\n}\n\nParser.prototype.isEOF = function () {\n return this.current().type === tokenType.EOF\n}\n\nParser.prototype.parse = function (text) {\n this.tokens = this.lexer.lex(text)\n return this.program()\n}\n\nParser.prototype.program = function () {\n var blocks = []\n while (!this.isEOF()) {\n blocks.push(this.assignment())\n if (this.peek(';')) {\n this.consume()\n }\n }\n this.end()\n return new BlockNode(blocks)\n}\n\nParser.prototype.assignment = function () {\n var left = this.ternary()\n if (left instanceof SymbolNode && this.peek('=')) {\n this.consume()\n return new AssignmentNode(left.name, this.assignment())\n }\n return left\n}\n\nParser.prototype.ternary = function () {\n var predicate = this.logicalOR()\n if (this.peek('?')) {\n this.consume()\n var truthy = this.ternary()\n this.expect(':')\n var falsy = this.ternary()\n return new ConditionalNode(predicate, truthy, falsy)\n }\n return predicate\n}\n\nParser.prototype.logicalOR = function () {\n var left = this.logicalXOR()\n if (this.peek('||')) {\n var op = this.consume()\n var right = this.logicalOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.logicalXOR = function () {\n var left = this.logicalAND()\n if (this.current().value === 'xor') {\n var op = this.consume()\n var right = this.logicalXOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.logicalAND = function () {\n var left = this.bitwiseOR()\n if (this.peek('&&')) {\n var op = this.consume()\n var right = this.logicalAND()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseOR = function () {\n var left = this.bitwiseXOR()\n if (this.peek('|')) {\n var op = this.consume()\n var right = this.bitwiseOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseXOR = function () {\n var left = this.bitwiseAND()\n if (this.peek('^|')) {\n var op = this.consume()\n var right = this.bitwiseXOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseAND = function () {\n var left = this.relational()\n if (this.peek('&')) {\n var op = this.consume()\n var right = this.bitwiseAND()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.relational = function () {\n var left = this.shift()\n if (this.peek('==', '===', '!=', '!==', '>=', '<=', '>', '<')) {\n var op = this.consume()\n var right = this.shift()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.shift = function () {\n var left = this.additive()\n if (this.peek('>>', '<<', '>>>')) {\n var op = this.consume()\n var right = this.shift()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.additive = function () {\n var left = this.multiplicative()\n while (this.peek('+', '-')) {\n var op = this.consume()\n left = new OperatorNode(op.value, [left, this.multiplicative()])\n }\n return left\n}\n\nParser.prototype.multiplicative = function () {\n var op, right\n var left = this.unary()\n while (this.peek('*', '/', '%')) {\n op = this.consume()\n left = new OperatorNode(op.value, [left, this.unary()])\n }\n\n // implicit multiplication\n // - 2 x\n // - 2(x)\n // - (2)2\n if (this.current().type === tokenType.SYMBOL ||\n this.peek('(') ||\n (!(left.type instanceof ConstantNode) && this.current().type === tokenType.NUMBER)\n ) {\n right = this.multiplicative()\n return new OperatorNode('*', [left, right])\n }\n\n return left\n}\n\nParser.prototype.unary = function () {\n if (this.peek('-', '+', '~')) {\n var op = this.consume()\n var right = this.unary()\n return new UnaryNode(op.value, right)\n }\n return this.pow()\n}\n\nParser.prototype.pow = function () {\n var left = this.factorial()\n if (this.peek('^', '**')) {\n var op = this.consume()\n var right = this.unary()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.factorial = function () {\n var left = this.symbol()\n if (this.peek('!')) {\n var op = this.consume()\n return new OperatorNode(op.value, [left])\n }\n return left\n}\n\nParser.prototype.symbol = function () {\n var current = this.current()\n if (current.type === tokenType.SYMBOL) {\n var symbol = this.consume()\n var node = this.functionCall(symbol)\n return node\n }\n return this.string()\n}\n\nParser.prototype.functionCall = function (symbolToken) {\n var name = symbolToken.value\n if (this.peek('(')) {\n this.consume()\n var params = []\n while (!this.peek(')') && !this.isEOF()) {\n params.push(this.assignment())\n if (this.peek(',')) {\n this.consume()\n }\n }\n this.expect(')')\n return new FunctionNode(name, params)\n }\n return new SymbolNode(name)\n}\n\nParser.prototype.string = function () {\n if (this.current().type === tokenType.STRING) {\n return new ConstantNode(this.consume().value, 'string')\n }\n return this.array()\n}\n\nParser.prototype.array = function () {\n if (this.peek('[')) {\n this.consume()\n var params = []\n while (!this.peek(']') && !this.isEOF()) {\n params.push(this.assignment())\n if (this.peek(',')) {\n this.consume()\n }\n }\n this.expect(']')\n return new ArrayNode(params)\n }\n return this.number()\n}\n\nParser.prototype.number = function () {\n var token = this.current()\n if (token.type === tokenType.NUMBER) {\n return new ConstantNode(this.consume().value, 'number')\n }\n return this.parentheses()\n}\n\nParser.prototype.parentheses = function () {\n var token = this.current()\n if (token.value === '(') {\n this.consume()\n var left = this.assignment()\n this.expect(')')\n return left\n }\n return this.end()\n}\n\nParser.prototype.end = function () {\n var token = this.current()\n if (token.type !== tokenType.EOF) {\n throw Error('unexpected end of expression')\n }\n}\n\nmodule.exports = Parser\n", "module.exports = {\n ArrayNode: require('./ArrayNode'),\n AssignmentNode: require('./AssignmentNode'),\n BlockNode: require('./BlockNode'),\n ConditionalNode: require('./ConditionalNode'),\n ConstantNode: require('./ConstantNode'),\n FunctionNode: require('./FunctionNode'),\n Node: require('./Node'),\n OperatorNode: require('./OperatorNode'),\n SymbolNode: require('./SymbolNode'),\n UnaryNode: require('./UnaryNode')\n}\n", "/*\n * mr-parser\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n\n'use strict'\n\nmodule.exports.Lexer = require('./lib/Lexer')\nmodule.exports.Parser = require('./lib/Parser')\nmodule.exports.nodeTypes = require('./lib/node/')\n", "'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n", "'use strict'\nmodule.exports = function (node) {\n var self = this\n var arr = []\n this.rawify(this.options.rawArrayExpressionElements, function () {\n arr = node.nodes.map(function (el) {\n return self.next(el)\n })\n })\n var arrString = '[' + arr.join(',') + ']'\n\n if (this.options.raw) {\n return arrString\n }\n return this.options.factory + '(' + arrString + ')'\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n return 'scope[\"' + node.name + '\"] = ' + this.next(node.expr)\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var condition = '!!(' + this.next(node.condition) + ')'\n var trueExpr = this.next(node.trueExpr)\n var falseExpr = this.next(node.falseExpr)\n return '(' + condition + ' ? (' + trueExpr + ') : (' + falseExpr + ') )'\n}\n", "'use strict'\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.value\n }\n return this.options.factory + '(' + node.value + ')'\n}\n", "'use strict'\nvar SymbolNode = require('mr-parser').nodeTypes.SymbolNode\n\nvar functionProxy = function (node) {\n return '$$mathCodegen.functionProxy(' + this.next(new SymbolNode(node.name)) + ', \"' + node.name + '\")'\n}\n\nmodule.exports = function (node) {\n var self = this\n // wrap in a helper function to detect the type of symbol it must be a function\n // NOTE: if successful the wrapper returns the function itself\n // NOTE: node.name should be a symbol so that it's correctly represented as a string in SymbolNode\n var method = functionProxy.call(this, node)\n var args = []\n this.rawify(this.options.rawCallExpressionElements, function () {\n args = node.args.map(function (arg) {\n return self.next(arg)\n })\n })\n return method + '(' + args.join(', ') + ')'\n}\n\nmodule.exports.functionProxy = functionProxy\n", "'use strict'\n\nmodule.exports = {\n // arithmetic\n '+': 'add',\n '-': 'sub',\n '*': 'mul',\n '/': 'div',\n '^': 'pow',\n '%': 'mod',\n '!': 'factorial',\n\n // misc operators\n '|': 'bitwiseOR', // bitwise or\n '^|': 'bitwiseXOR', // bitwise xor\n '&': 'bitwiseAND', // bitwise and\n\n '||': 'logicalOR', // logical or\n 'xor': 'logicalXOR', // logical xor\n '&&': 'logicalAND', // logical and\n\n // comparison\n '<': 'lessThan',\n '>': 'greaterThan',\n '<=': 'lessEqualThan',\n '>=': 'greaterEqualThan',\n '===': 'strictlyEqual',\n '==': 'equal',\n '!==': 'strictlyNotEqual',\n '!=': 'notEqual',\n\n // shift\n '>>': 'shiftRight',\n '<<': 'shiftLeft',\n '>>>': 'unsignedRightShift'\n}\n", "'use strict'\n\nvar Operators = require('../misc/Operators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return ['(' + this.next(node.args[0]), node.op, this.next(node.args[1]) + ')'].join(' ')\n }\n\n var namedOperator = Operators[node.op]\n\n if (!namedOperator) {\n throw TypeError('unidentified operator')\n }\n\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: node.args\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var id = node.name\n return '$$mathCodegen.getProperty(\"' + id + '\", scope, ns)'\n}\n", "'use strict'\n\nmodule.exports = {\n '+': 'positive',\n '-': 'negative',\n '~': 'oneComplement'\n}\n", "'use strict'\n\nvar UnaryOperators = require('../misc/UnaryOperators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.op + this.next(node.argument)\n }\n\n if (!(node.op in UnaryOperators)) {\n throw new SyntaxError(node.op + ' not implemented')\n }\n\n var namedOperator = UnaryOperators[node.op]\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: [node.argument]\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\nvar extend = require('extend')\n\nvar types = {\n ArrayNode: require('./node/ArrayNode'),\n AssignmentNode: require('./node/AssignmentNode'),\n ConditionalNode: require('./node/ConditionalNode'),\n ConstantNode: require('./node/ConstantNode'),\n FunctionNode: require('./node/FunctionNode'),\n OperatorNode: require('./node/OperatorNode'),\n SymbolNode: require('./node/SymbolNode'),\n UnaryNode: require('./node/UnaryNode')\n}\n\nvar Interpreter = function (owner, options) {\n this.owner = owner\n this.options = extend({\n factory: 'ns.factory',\n raw: false,\n rawArrayExpressionElements: true,\n rawCallExpressionElements: false\n }, options)\n}\n\nextend(Interpreter.prototype, types)\n\n// main method which decides which expression to call\nInterpreter.prototype.next = function (node) {\n if (!(node.type in this)) {\n throw new TypeError('the node type ' + node.type + ' is not implemented')\n }\n return this[node.type](node)\n}\n\nInterpreter.prototype.rawify = function (test, fn) {\n var oldRaw = this.options.raw\n if (test) {\n this.options.raw = true\n }\n fn()\n if (test) {\n this.options.raw = oldRaw\n }\n}\n\nmodule.exports = Interpreter\n", "'use strict'\n\nvar Parser = require('mr-parser').Parser\nvar Interpreter = require('./Interpreter')\nvar extend = require('extend')\n\nfunction CodeGenerator (options, defs) {\n this.statements = []\n this.defs = defs || {}\n this.interpreter = new Interpreter(this, options)\n}\n\nCodeGenerator.prototype.setDefs = function (defs) {\n this.defs = extend(this.defs, defs)\n return this\n}\n\nCodeGenerator.prototype.compile = function (namespace) {\n if (!namespace || !(typeof namespace === 'object' || typeof namespace === 'function')) {\n throw TypeError('namespace must be an object')\n }\n if (typeof namespace.factory !== 'function') {\n throw TypeError('namespace.factory must be a function')\n }\n\n // definitions available in the function\n // each property under this.defs is mapped to local variables\n // e.g\n //\n // function (defs) {\n // var ns = defs['ns']\n // // code generated for the expression\n // }\n this.defs.ns = namespace\n this.defs.$$mathCodegen = {\n getProperty: function (symbol, scope, ns) {\n if (symbol in scope) {\n return scope[symbol]\n }\n if (symbol in ns) {\n return ns[symbol]\n }\n throw SyntaxError('symbol \"' + symbol + '\" is undefined')\n },\n functionProxy: function (fn, name) {\n if (typeof fn !== 'function') {\n throw SyntaxError('symbol \"' + name + '\" must be a function')\n }\n return fn\n }\n }\n this.defs.$$processScope = this.defs.$$processScope || function () {}\n\n var defsCode = Object.keys(this.defs).map(function (name) {\n return 'var ' + name + ' = defs[\"' + name + '\"]'\n })\n\n // statement join\n if (!this.statements.length) {\n throw Error('there are no statements saved in this generator, make sure you parse an expression before compiling it')\n }\n\n // last statement is always a return statement\n this.statements[this.statements.length - 1] = 'return ' + this.statements[this.statements.length - 1]\n\n var code = this.statements.join(';')\n var factoryCode = defsCode.join('\\n') + '\\n' + [\n 'return {',\n ' eval: function (scope) {',\n ' scope = scope || {}',\n ' $$processScope(scope)',\n ' ' + code,\n ' },',\n \" code: '\" + code + \"'\",\n '}'\n ].join('\\n')\n\n /* eslint-disable */\n var factory = new Function('defs', factoryCode)\n return factory(this.defs)\n /* eslint-enable */\n}\n\nCodeGenerator.prototype.parse = function (code) {\n var self = this\n var program = new Parser().parse(code)\n this.statements = program.blocks.map(function (statement) {\n return self.interpreter.next(statement)\n })\n return this\n}\n\nmodule.exports = CodeGenerator\n", "/*\n * math-codegen\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/CodeGenerator')\n", "'use strict'\nmodule.exports = function () {\n var math = Object.create(Math)\n\n math.factory = function (a) {\n if (typeof a !== 'number') {\n throw new TypeError('built-in math factory only accepts numbers')\n }\n return Number(a)\n }\n\n math.add = function (a, b) {\n return a + b\n }\n math.sub = function (a, b) {\n return a - b\n }\n math.mul = function (a, b) {\n return a * b\n }\n math.div = function (a, b) {\n return a / b\n }\n math.mod = function (a, b) {\n return a % b\n }\n math.factorial = function (a) {\n var res = 1\n for (var i = 2; i <= a; i += 1) {\n res *= i\n }\n return res\n }\n\n // taken from https://github.com/josdejong/mathjs/blob/master/lib/function/arithmetic/nthRoot.js\n math.nthRoot = function (a, root) {\n var inv = root < 0\n if (inv) {\n root = -root\n }\n\n if (root === 0) {\n throw new Error('Root must be non-zero')\n }\n if (a < 0 && (Math.abs(root) % 2 !== 1)) {\n throw new Error('Root must be odd when a is negative.')\n }\n\n // edge cases zero and infinity\n if (a === 0) {\n return 0\n }\n if (!isFinite(a)) {\n return inv ? 0 : a\n }\n\n var x = Math.pow(Math.abs(a), 1 / root)\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a < 0 ? -x : x\n return inv ? 1 / x : x\n }\n\n // logical\n math.logicalOR = function (a, b) {\n return a || b\n }\n math.logicalXOR = function (a, b) {\n /* eslint-disable */\n return a != b\n /* eslint-enable*/\n }\n math.logicalAND = function (a, b) {\n return a && b\n }\n\n // bitwise\n math.bitwiseOR = function (a, b) {\n /* eslint-disable */\n return a | b\n /* eslint-enable*/\n }\n math.bitwiseXOR = function (a, b) {\n /* eslint-disable */\n return a ^ b\n /* eslint-enable*/\n }\n math.bitwiseAND = function (a, b) {\n /* eslint-disable */\n return a & b\n /* eslint-enable*/\n }\n\n // relational\n math.lessThan = function (a, b) {\n return a < b\n }\n math.lessEqualThan = function (a, b) {\n return a <= b\n }\n math.greaterThan = function (a, b) {\n return a > b\n }\n math.greaterEqualThan = function (a, b) {\n return a >= b\n }\n math.equal = function (a, b) {\n /* eslint-disable */\n return a == b\n /* eslint-enable*/\n }\n math.strictlyEqual = function (a, b) {\n return a === b\n }\n math.notEqual = function (a, b) {\n /* eslint-disable */\n return a != b\n /* eslint-enable*/\n }\n math.strictlyNotEqual = function (a, b) {\n return a !== b\n }\n\n // shift\n math.shiftRight = function (a, b) {\n return (a >> b)\n }\n math.shiftLeft = function (a, b) {\n return (a << b)\n }\n math.unsignedRightShift = function (a, b) {\n return (a >>> b)\n }\n\n // unary\n math.negative = function (a) {\n return -a\n }\n math.positive = function (a) {\n return a\n }\n\n return math\n}\n", "'use strict'\n\nvar CodeGenerator = require('math-codegen')\nvar math = require('./adapter')()\n\nfunction processScope (scope) {\n Object.keys(scope).forEach(function (k) {\n var value = scope[k]\n scope[k] = math.factory(value)\n })\n}\n\nmodule.exports = function (expression) {\n return new CodeGenerator()\n .setDefs({\n $$processScope: processScope\n })\n .parse(expression)\n .compile(math)\n}\n\nmodule.exports.math = math\n", "/*\n * built-in-math-eval\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n\n'use strict'\n\nmodule.exports = require('./lib/eval')\n", "'use strict'\nmodule.exports = function (node) {\n var self = this\n var arr = []\n this.rawify(this.options.rawArrayExpressionElements, function () {\n arr = node.nodes.map(function (el) {\n return self.next(el)\n })\n })\n var arrString = '[' + arr.join(',') + ']'\n\n if (this.options.raw) {\n return arrString\n }\n return this.options.factory + '(' + arrString + ')'\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n return 'scope[\"' + node.name + '\"] = ' + this.next(node.expr)\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var condition = '!!(' + this.next(node.condition) + ')'\n var trueExpr = this.next(node.trueExpr)\n var falseExpr = this.next(node.falseExpr)\n return '(' + condition + ' ? (' + trueExpr + ') : (' + falseExpr + ') )'\n}\n", "'use strict'\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.value\n }\n return this.options.factory + '(' + node.value + ')'\n}\n", "'use strict'\nvar SymbolNode = require('mr-parser').nodeTypes.SymbolNode\n\nvar functionProxy = function (node) {\n return '$$mathCodegen.functionProxy(' + this.next(new SymbolNode(node.name)) + ', \"' + node.name + '\")'\n}\n\nmodule.exports = function (node) {\n var self = this\n // wrap in a helper function to detect the type of symbol it must be a function\n // NOTE: if successful the wrapper returns the function itself\n // NOTE: node.name should be a symbol so that it's correctly represented as a string in SymbolNode\n var method = functionProxy.call(this, node)\n var args = []\n this.rawify(this.options.rawCallExpressionElements, function () {\n args = node.args.map(function (arg) {\n return self.next(arg)\n })\n })\n return method + '(' + args.join(', ') + ')'\n}\n\nmodule.exports.functionProxy = functionProxy\n", "'use strict'\n\nmodule.exports = {\n // arithmetic\n '+': 'add',\n '-': 'sub',\n '*': 'mul',\n '/': 'div',\n '^': 'pow',\n '%': 'mod',\n '!': 'factorial',\n\n // misc operators\n '|': 'bitwiseOR', // bitwise or\n '^|': 'bitwiseXOR', // bitwise xor\n '&': 'bitwiseAND', // bitwise and\n\n '||': 'logicalOR', // logical or\n 'xor': 'logicalXOR', // logical xor\n '&&': 'logicalAND', // logical and\n\n // comparison\n '<': 'lessThan',\n '>': 'greaterThan',\n '<=': 'lessEqualThan',\n '>=': 'greaterEqualThan',\n '===': 'strictlyEqual',\n '==': 'equal',\n '!==': 'strictlyNotEqual',\n '!=': 'notEqual',\n\n // shift\n '>>': 'shiftRight',\n '<<': 'shiftLeft',\n '>>>': 'unsignedRightShift'\n}\n", "'use strict'\n\nvar Operators = require('../misc/Operators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return ['(' + this.next(node.args[0]), node.op, this.next(node.args[1]) + ')'].join(' ')\n }\n\n var namedOperator = Operators[node.op]\n\n if (!namedOperator) {\n throw TypeError('unidentified operator')\n }\n\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: node.args\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var id = node.name\n return '$$mathCodegen.getProperty(\"' + id + '\", scope, ns)'\n}\n", "'use strict'\n\nmodule.exports = {\n '+': 'positive',\n '-': 'negative',\n '~': 'oneComplement'\n}\n", "'use strict'\n\nvar UnaryOperators = require('../misc/UnaryOperators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.op + this.next(node.argument)\n }\n\n if (!(node.op in UnaryOperators)) {\n throw new SyntaxError(node.op + ' not implemented')\n }\n\n var namedOperator = UnaryOperators[node.op]\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: [node.argument]\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\nvar extend = require('extend')\n\nvar types = {\n ArrayNode: require('./node/ArrayNode'),\n AssignmentNode: require('./node/AssignmentNode'),\n ConditionalNode: require('./node/ConditionalNode'),\n ConstantNode: require('./node/ConstantNode'),\n FunctionNode: require('./node/FunctionNode'),\n OperatorNode: require('./node/OperatorNode'),\n SymbolNode: require('./node/SymbolNode'),\n UnaryNode: require('./node/UnaryNode')\n}\n\nvar Interpreter = function (owner, options) {\n this.owner = owner\n this.options = extend({\n factory: 'ns.factory',\n raw: false,\n rawArrayExpressionElements: true,\n rawCallExpressionElements: false,\n applyFactoryToScope: false\n }, options)\n}\n\nextend(Interpreter.prototype, types)\n\n// main method which decides which expression to call\nInterpreter.prototype.next = function (node) {\n if (!(node.type in this)) {\n throw new TypeError('the node type ' + node.type + ' is not implemented')\n }\n return this[node.type](node)\n}\n\nInterpreter.prototype.rawify = function (test, fn) {\n var oldRaw = this.options.raw\n if (test) {\n this.options.raw = true\n }\n fn()\n if (test) {\n this.options.raw = oldRaw\n }\n}\n\nmodule.exports = Interpreter\n", "'use strict'\n\nvar Parser = require('mr-parser').Parser\nvar Interpreter = require('./Interpreter')\nvar extend = require('extend')\n\nfunction CodeGenerator (options, defs) {\n this.statements = []\n this.defs = defs || {}\n this.interpreter = new Interpreter(this, options)\n}\n\nCodeGenerator.prototype.setDefs = function (defs) {\n this.defs = extend(this.defs, defs)\n return this\n}\n\nCodeGenerator.prototype.compile = function (namespace) {\n var self = this\n if (!namespace || !(typeof namespace === 'object' || typeof namespace === 'function')) {\n throw TypeError('namespace must be an object')\n }\n if (typeof namespace.factory !== 'function') {\n throw TypeError('namespace.factory must be a function')\n }\n\n // definitions available in the function\n // each property under this.defs is mapped to local variables\n // e.g\n //\n // function (defs) {\n // var ns = defs['ns']\n // // code generated for the expression\n // }\n this.defs.ns = namespace\n this.defs.$$mathCodegen = {\n getProperty: function (symbol, scope, ns) {\n function applyFactoryIfNeeded (value) {\n if (self.interpreter.options.applyFactoryToScope && typeof value !== 'function') {\n return ns.factory(value)\n }\n return value\n }\n\n if (symbol in scope) {\n return applyFactoryIfNeeded(scope[symbol])\n }\n if (symbol in ns) {\n return applyFactoryIfNeeded(ns[symbol])\n }\n throw SyntaxError('symbol \"' + symbol + '\" is undefined')\n },\n functionProxy: function (fn, name) {\n if (typeof fn !== 'function') {\n throw SyntaxError('symbol \"' + name + '\" must be a function')\n }\n return fn\n }\n }\n this.defs.$$processScope = this.defs.$$processScope || function () {}\n\n var defsCode = Object.keys(this.defs).map(function (name) {\n return 'var ' + name + ' = defs[\"' + name + '\"]'\n })\n\n // statement join\n if (!this.statements.length) {\n throw Error('there are no statements saved in this generator, make sure you parse an expression before compiling it')\n }\n\n // last statement is always a return statement\n this.statements[this.statements.length - 1] = 'return ' + this.statements[this.statements.length - 1]\n\n var code = this.statements.join(';')\n var factoryCode = defsCode.join('\\n') + '\\n' + [\n 'return {',\n ' eval: function (scope) {',\n ' scope = scope || {}',\n ' $$processScope(scope)',\n ' ' + code,\n ' },',\n \" code: '\" + code + \"'\",\n '}'\n ].join('\\n')\n\n /* eslint-disable */\n var factory = new Function('defs', factoryCode)\n return factory(this.defs)\n /* eslint-enable */\n}\n\nCodeGenerator.prototype.parse = function (code) {\n var self = this\n var program = new Parser().parse(code)\n this.statements = program.blocks.map(function (statement) {\n return self.interpreter.next(statement)\n })\n return this\n}\n\nmodule.exports = CodeGenerator\n", "/*\n * math-codegen\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/CodeGenerator')\n", null, "var hasTypedArrays = false\nif(typeof Float64Array !== \"undefined\") {\n var DOUBLE_VIEW = new Float64Array(1)\n , UINT_VIEW = new Uint32Array(DOUBLE_VIEW.buffer)\n DOUBLE_VIEW[0] = 1.0\n hasTypedArrays = true\n if(UINT_VIEW[1] === 0x3ff00000) {\n //Use little endian\n module.exports = function doubleBitsLE(n) {\n DOUBLE_VIEW[0] = n\n return [ UINT_VIEW[0], UINT_VIEW[1] ]\n }\n function toDoubleLE(lo, hi) {\n UINT_VIEW[0] = lo\n UINT_VIEW[1] = hi\n return DOUBLE_VIEW[0]\n }\n module.exports.pack = toDoubleLE\n function lowUintLE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[0]\n }\n module.exports.lo = lowUintLE\n function highUintLE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[1]\n }\n module.exports.hi = highUintLE\n } else if(UINT_VIEW[0] === 0x3ff00000) {\n //Use big endian\n module.exports = function doubleBitsBE(n) {\n DOUBLE_VIEW[0] = n\n return [ UINT_VIEW[1], UINT_VIEW[0] ]\n }\n function toDoubleBE(lo, hi) {\n UINT_VIEW[1] = lo\n UINT_VIEW[0] = hi\n return DOUBLE_VIEW[0]\n }\n module.exports.pack = toDoubleBE\n function lowUintBE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[1]\n }\n module.exports.lo = lowUintBE\n function highUintBE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[0]\n }\n module.exports.hi = highUintBE\n } else {\n hasTypedArrays = false\n }\n}\nif(!hasTypedArrays) {\n var buffer = new Buffer(8)\n module.exports = function doubleBits(n) {\n buffer.writeDoubleLE(n, 0, true)\n return [ buffer.readUInt32LE(0, true), buffer.readUInt32LE(4, true) ]\n }\n function toDouble(lo, hi) {\n buffer.writeUInt32LE(lo, 0, true)\n buffer.writeUInt32LE(hi, 4, true)\n return buffer.readDoubleLE(0, true)\n }\n module.exports.pack = toDouble \n function lowUint(n) {\n buffer.writeDoubleLE(n, 0, true)\n return buffer.readUInt32LE(0, true)\n }\n module.exports.lo = lowUint\n function highUint(n) {\n buffer.writeDoubleLE(n, 0, true)\n return buffer.readUInt32LE(4, true)\n }\n module.exports.hi = highUint\n}\n\nmodule.exports.sign = function(n) {\n return module.exports.hi(n) >>> 31\n}\n\nmodule.exports.exponent = function(n) {\n var b = module.exports.hi(n)\n return ((b<<1) >>> 21) - 1023\n}\n\nmodule.exports.fraction = function(n) {\n var lo = module.exports.lo(n)\n var hi = module.exports.hi(n)\n var b = hi & ((1<<20) - 1)\n if(hi & 0x7ff00000) {\n b += (1<<20)\n }\n return [lo, b]\n}\n\nmodule.exports.denormalized = function(n) {\n var hi = module.exports.hi(n)\n return !(hi & 0x7ff00000)\n}", "\"use strict\"\n\nvar doubleBits = require(\"double-bits\")\n\nvar SMALLEST_DENORM = Math.pow(2, -1074)\nvar UINT_MAX = (-1)>>>0\n\nmodule.exports = nextafter\n\nfunction nextafter(x, y) {\n if(isNaN(x) || isNaN(y)) {\n return NaN\n }\n if(x === y) {\n return x\n }\n if(x === 0) {\n if(y < 0) {\n return -SMALLEST_DENORM\n } else {\n return SMALLEST_DENORM\n }\n }\n var hi = doubleBits.hi(x)\n var lo = doubleBits.lo(x)\n if((y > x) === (x > 0)) {\n if(lo === UINT_MAX) {\n hi += 1\n lo = 0\n } else {\n lo += 1\n }\n } else {\n if(lo === 0) {\n lo = UINT_MAX\n hi -= 1\n } else {\n lo -= 1\n }\n }\n return doubleBits.pack(lo, hi)\n}", null, null, null, null, null, null, null, null, null, null, "'use strict'\nmodule.exports = function (ns) {\n // mod\n ns.mod = ns.fmod\n\n // relational\n ns.lessThan = ns.lt\n ns.lessEqualThan = ns.leq\n ns.greaterThan = ns.gt\n ns.greaterEqualThan = ns.geq\n\n ns.strictlyEqual = ns.equal\n ns.strictlyNotEqual = ns.notEqual\n\n ns.logicalAND = function (a, b) {\n return a && b\n }\n ns.logicalXOR = function (a, b) {\n return a ^ b\n }\n ns.logicalOR = function (a, b) {\n return a || b\n }\n}\n", "/**\n * Created by mauricio on 5/12/15.\n */\n'use strict'\nmodule.exports = function (Interval) {\n return {\n disableRounding: function () {\n Interval.round.disable()\n },\n\n enableRounding: function () {\n Interval.round.enable()\n }\n }\n}\n", "/**\n * Created by mauricio on 5/12/15.\n */\n'use strict'\n\nconst CodeGenerator = require('math-codegen')\nconst Interval = require('interval-arithmetic').default\nrequire('./adapter')(Interval)\n\nfunction processScope (scope) {\n Object.keys(scope).forEach(function (k) {\n const value = scope[k]\n if (typeof value === 'number' || Array.isArray(value)) {\n scope[k] = Interval.factory(value)\n } else if (typeof value === 'object' && 'lo' in value && 'hi' in value) {\n scope[k] = Interval.factory(value.lo, value.hi)\n }\n })\n}\n\nmodule.exports = function (expression) {\n return new CodeGenerator()\n .setDefs({\n $$processScope: processScope\n })\n .parse(expression)\n .compile(Interval)\n}\n\nmodule.exports.policies = require('./policies')(Interval)\nmodule.exports.Interval = Interval\n", "/*\n * interval-arithmetic-eval\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/eval')\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map", null, ";(function(root, factory) { // eslint-disable-line no-extra-semi\n var deepDiff = factory(root);\n // eslint-disable-next-line no-undef\n if (typeof define === 'function' && define.amd) {\n // AMD\n define('DeepDiff', function() { // eslint-disable-line no-undef\n return deepDiff;\n });\n } else if (typeof exports === 'object' || typeof navigator === 'object' && navigator.product.match(/ReactNative/i)) {\n // Node.js or ReactNative\n module.exports = deepDiff;\n } else {\n // Browser globals\n var _deepdiff = root.DeepDiff;\n deepDiff.noConflict = function() {\n if (root.DeepDiff === deepDiff) {\n root.DeepDiff = _deepdiff;\n }\n return deepDiff;\n };\n root.DeepDiff = deepDiff;\n }\n}(this, function(root) {\n var validKinds = ['N', 'E', 'A', 'D'];\n\n // nodejs compatible on server side and in the browser.\n function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n\n function Diff(kind, path) {\n Object.defineProperty(this, 'kind', {\n value: kind,\n enumerable: true\n });\n if (path && path.length) {\n Object.defineProperty(this, 'path', {\n value: path,\n enumerable: true\n });\n }\n }\n\n function DiffEdit(path, origin, value) {\n DiffEdit.super_.call(this, 'E', path);\n Object.defineProperty(this, 'lhs', {\n value: origin,\n enumerable: true\n });\n Object.defineProperty(this, 'rhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffEdit, Diff);\n\n function DiffNew(path, value) {\n DiffNew.super_.call(this, 'N', path);\n Object.defineProperty(this, 'rhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffNew, Diff);\n\n function DiffDeleted(path, value) {\n DiffDeleted.super_.call(this, 'D', path);\n Object.defineProperty(this, 'lhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffDeleted, Diff);\n\n function DiffArray(path, index, item) {\n DiffArray.super_.call(this, 'A', path);\n Object.defineProperty(this, 'index', {\n value: index,\n enumerable: true\n });\n Object.defineProperty(this, 'item', {\n value: item,\n enumerable: true\n });\n }\n inherits(DiffArray, Diff);\n\n function arrayRemove(arr, from, to) {\n var rest = arr.slice((to || from) + 1 || arr.length);\n arr.length = from < 0 ? arr.length + from : from;\n arr.push.apply(arr, rest);\n return arr;\n }\n\n function realTypeOf(subject) {\n var type = typeof subject;\n if (type !== 'object') {\n return type;\n }\n\n if (subject === Math) {\n return 'math';\n } else if (subject === null) {\n return 'null';\n } else if (Array.isArray(subject)) {\n return 'array';\n } else if (Object.prototype.toString.call(subject) === '[object Date]') {\n return 'date';\n } else if (typeof subject.toString === 'function' && /^\\/.*\\//.test(subject.toString())) {\n return 'regexp';\n }\n return 'object';\n }\n\n // http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n function hashThisString(string) {\n var hash = 0;\n if (string.length === 0) { return hash; }\n for (var i = 0; i < string.length; i++) {\n var char = string.charCodeAt(i);\n hash = ((hash << 5) - hash) + char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return hash;\n }\n\n // Gets a hash of the given object in an array order-independent fashion\n // also object key order independent (easier since they can be alphabetized)\n function getOrderIndependentHash(object) {\n var accum = 0;\n var type = realTypeOf(object);\n\n if (type === 'array') {\n object.forEach(function (item) {\n // Addition is commutative so this is order indep\n accum += getOrderIndependentHash(item);\n });\n\n var arrayString = '[type: array, hash: ' + accum + ']';\n return accum + hashThisString(arrayString);\n }\n\n if (type === 'object') {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n var keyValueString = '[ type: object, key: ' + key + ', value hash: ' + getOrderIndependentHash(object[key]) + ']';\n accum += hashThisString(keyValueString);\n }\n }\n\n return accum;\n }\n\n // Non object, non array...should be good?\n var stringToHash = '[ type: ' + type + ' ; value: ' + object + ']';\n return accum + hashThisString(stringToHash);\n }\n\n function deepDiff(lhs, rhs, changes, prefilter, path, key, stack, orderIndependent) {\n changes = changes || [];\n path = path || [];\n stack = stack || [];\n var currentPath = path.slice(0);\n if (typeof key !== 'undefined' && key !== null) {\n if (prefilter) {\n if (typeof (prefilter) === 'function' && prefilter(currentPath, key)) {\n return;\n } else if (typeof (prefilter) === 'object') {\n if (prefilter.prefilter && prefilter.prefilter(currentPath, key)) {\n return;\n }\n if (prefilter.normalize) {\n var alt = prefilter.normalize(currentPath, key, lhs, rhs);\n if (alt) {\n lhs = alt[0];\n rhs = alt[1];\n }\n }\n }\n }\n currentPath.push(key);\n }\n\n // Use string comparison for regexes\n if (realTypeOf(lhs) === 'regexp' && realTypeOf(rhs) === 'regexp') {\n lhs = lhs.toString();\n rhs = rhs.toString();\n }\n\n var ltype = typeof lhs;\n var rtype = typeof rhs;\n var i, j, k, other;\n\n var ldefined = ltype !== 'undefined' ||\n (stack && (stack.length > 0) && stack[stack.length - 1].lhs &&\n Object.getOwnPropertyDescriptor(stack[stack.length - 1].lhs, key));\n var rdefined = rtype !== 'undefined' ||\n (stack && (stack.length > 0) && stack[stack.length - 1].rhs &&\n Object.getOwnPropertyDescriptor(stack[stack.length - 1].rhs, key));\n\n if (!ldefined && rdefined) {\n changes.push(new DiffNew(currentPath, rhs));\n } else if (!rdefined && ldefined) {\n changes.push(new DiffDeleted(currentPath, lhs));\n } else if (realTypeOf(lhs) !== realTypeOf(rhs)) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n } else if (realTypeOf(lhs) === 'date' && (lhs - rhs) !== 0) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n } else if (ltype === 'object' && lhs !== null && rhs !== null) {\n for (i = stack.length - 1; i > -1; --i) {\n if (stack[i].lhs === lhs) {\n other = true;\n break;\n }\n }\n if (!other) {\n stack.push({ lhs: lhs, rhs: rhs });\n if (Array.isArray(lhs)) {\n // If order doesn't matter, we need to sort our arrays\n if (orderIndependent) {\n lhs.sort(function (a, b) {\n return getOrderIndependentHash(a) - getOrderIndependentHash(b);\n });\n\n rhs.sort(function (a, b) {\n return getOrderIndependentHash(a) - getOrderIndependentHash(b);\n });\n }\n i = rhs.length - 1;\n j = lhs.length - 1;\n while (i > j) {\n changes.push(new DiffArray(currentPath, i, new DiffNew(undefined, rhs[i--])));\n }\n while (j > i) {\n changes.push(new DiffArray(currentPath, j, new DiffDeleted(undefined, lhs[j--])));\n }\n for (; i >= 0; --i) {\n deepDiff(lhs[i], rhs[i], changes, prefilter, currentPath, i, stack, orderIndependent);\n }\n } else {\n var akeys = Object.keys(lhs);\n var pkeys = Object.keys(rhs);\n for (i = 0; i < akeys.length; ++i) {\n k = akeys[i];\n other = pkeys.indexOf(k);\n if (other >= 0) {\n deepDiff(lhs[k], rhs[k], changes, prefilter, currentPath, k, stack, orderIndependent);\n pkeys[other] = null;\n } else {\n deepDiff(lhs[k], undefined, changes, prefilter, currentPath, k, stack, orderIndependent);\n }\n }\n for (i = 0; i < pkeys.length; ++i) {\n k = pkeys[i];\n if (k) {\n deepDiff(undefined, rhs[k], changes, prefilter, currentPath, k, stack, orderIndependent);\n }\n }\n }\n stack.length = stack.length - 1;\n } else if (lhs !== rhs) {\n // lhs is contains a cycle at this element and it differs from rhs\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n }\n } else if (lhs !== rhs) {\n if (!(ltype === 'number' && isNaN(lhs) && isNaN(rhs))) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n }\n }\n }\n\n function observableDiff(lhs, rhs, observer, prefilter, orderIndependent) {\n var changes = [];\n deepDiff(lhs, rhs, changes, prefilter, null, null, null, orderIndependent);\n if (observer) {\n for (var i = 0; i < changes.length; ++i) {\n observer(changes[i]);\n }\n }\n return changes;\n }\n\n function orderIndependentDeepDiff(lhs, rhs, changes, prefilter, path, key, stack) {\n return deepDiff(lhs, rhs, changes, prefilter, path, key, stack, true);\n }\n\n function accumulateDiff(lhs, rhs, prefilter, accum) {\n var observer = (accum) ?\n function (difference) {\n if (difference) {\n accum.push(difference);\n }\n } : undefined;\n var changes = observableDiff(lhs, rhs, observer, prefilter);\n return (accum) ? accum : (changes.length) ? changes : undefined;\n }\n\n function accumulateOrderIndependentDiff(lhs, rhs, prefilter, accum) {\n var observer = (accum) ?\n function (difference) {\n if (difference) {\n accum.push(difference);\n }\n } : undefined;\n var changes = observableDiff(lhs, rhs, observer, prefilter, true);\n return (accum) ? accum : (changes.length) ? changes : undefined;\n }\n\n function applyArrayChange(arr, index, change) {\n if (change.path && change.path.length) {\n var it = arr[index],\n i, u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n applyArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n delete it[change.path[i]];\n break;\n case 'E':\n case 'N':\n it[change.path[i]] = change.rhs;\n break;\n }\n } else {\n switch (change.kind) {\n case 'A':\n applyArrayChange(arr[index], change.index, change.item);\n break;\n case 'D':\n arr = arrayRemove(arr, index);\n break;\n case 'E':\n case 'N':\n arr[index] = change.rhs;\n break;\n }\n }\n return arr;\n }\n\n function applyChange(target, source, change) {\n if (typeof change === 'undefined' && source && ~validKinds.indexOf(source.kind)) {\n change = source;\n }\n if (target && change && change.kind) {\n var it = target,\n i = -1,\n last = change.path ? change.path.length - 1 : 0;\n while (++i < last) {\n if (typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = (typeof change.path[i + 1] !== 'undefined' && typeof change.path[i + 1] === 'number') ? [] : {};\n }\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n if (change.path && typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = [];\n }\n applyArrayChange(change.path ? it[change.path[i]] : it, change.index, change.item);\n break;\n case 'D':\n delete it[change.path[i]];\n break;\n case 'E':\n case 'N':\n it[change.path[i]] = change.rhs;\n break;\n }\n }\n }\n\n function revertArrayChange(arr, index, change) {\n if (change.path && change.path.length) {\n // the structure of the object at the index has changed...\n var it = arr[index],\n i, u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n revertArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n it[change.path[i]] = change.lhs;\n break;\n case 'E':\n it[change.path[i]] = change.lhs;\n break;\n case 'N':\n delete it[change.path[i]];\n break;\n }\n } else {\n // the array item is different...\n switch (change.kind) {\n case 'A':\n revertArrayChange(arr[index], change.index, change.item);\n break;\n case 'D':\n arr[index] = change.lhs;\n break;\n case 'E':\n arr[index] = change.lhs;\n break;\n case 'N':\n arr = arrayRemove(arr, index);\n break;\n }\n }\n return arr;\n }\n\n function revertChange(target, source, change) {\n if (target && source && change && change.kind) {\n var it = target,\n i, u;\n u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n if (typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = {};\n }\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n // Array was modified...\n // it will be an array...\n revertArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n // Item was deleted...\n it[change.path[i]] = change.lhs;\n break;\n case 'E':\n // Item was edited...\n it[change.path[i]] = change.lhs;\n break;\n case 'N':\n // Item is new...\n delete it[change.path[i]];\n break;\n }\n }\n }\n\n function applyDiff(target, source, filter) {\n if (target && source) {\n var onChange = function (change) {\n if (!filter || filter(target, source, change)) {\n applyChange(target, source, change);\n }\n };\n observableDiff(target, source, onChange);\n }\n }\n\n Object.defineProperties(accumulateDiff, {\n\n diff: {\n value: accumulateDiff,\n enumerable: true\n },\n orderIndependentDiff: {\n value: accumulateOrderIndependentDiff,\n enumerable: true\n },\n observableDiff: {\n value: observableDiff,\n enumerable: true\n },\n orderIndependentObservableDiff: {\n value: orderIndependentDeepDiff,\n enumerable: true\n },\n orderIndepHash: {\n value: getOrderIndependentHash,\n enumerable: true\n },\n applyDiff: {\n value: applyDiff,\n enumerable: true\n },\n applyChange: {\n value: applyChange,\n enumerable: true\n },\n revertChange: {\n value: revertChange,\n enumerable: true\n },\n isConflict: {\n value: function () {\n return typeof $conflict !== 'undefined';\n },\n enumerable: true\n }\n });\n\n // hackish...\n accumulateDiff.DeepDiff = accumulateDiff;\n // ...but works with:\n // import DeepDiff from 'deep-diff'\n // import { DeepDiff } from 'deep-diff'\n // const DeepDiff = require('deep-diff');\n // const { DeepDiff } = require('deep-diff');\n\n if (root) {\n root.DeepDiff = accumulateDiff;\n }\n\n return accumulateDiff;\n}));\n", "/*global define:false */\n/**\n * Copyright 2012-2017 Craig Campbell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Mousetrap is a simple keyboard shortcut library for Javascript with\n * no external dependencies\n *\n * @version 1.6.5\n * @url craig.is/killing/mice\n */\n(function(window, document, undefined) {\n\n // Check if mousetrap is used inside browser, if not, return\n if (!window) {\n return;\n }\n\n /**\n * mapping of special keycodes to their corresponding keys\n *\n * everything in this dictionary cannot use keypress events\n * so it has to be here to map to the correct keycodes for\n * keyup/keydown events\n *\n * @type {Object}\n */\n var _MAP = {\n 8: 'backspace',\n 9: 'tab',\n 13: 'enter',\n 16: 'shift',\n 17: 'ctrl',\n 18: 'alt',\n 20: 'capslock',\n 27: 'esc',\n 32: 'space',\n 33: 'pageup',\n 34: 'pagedown',\n 35: 'end',\n 36: 'home',\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down',\n 45: 'ins',\n 46: 'del',\n 91: 'meta',\n 93: 'meta',\n 224: 'meta'\n };\n\n /**\n * mapping for special characters so they can support\n *\n * this dictionary is only used incase you want to bind a\n * keyup or keydown event to one of these keys\n *\n * @type {Object}\n */\n var _KEYCODE_MAP = {\n 106: '*',\n 107: '+',\n 109: '-',\n 110: '.',\n 111 : '/',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-',\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: '\\''\n };\n\n /**\n * this is a mapping of keys that require shift on a US keypad\n * back to the non shift equivelents\n *\n * this is so you can use keyup events with these keys\n *\n * note that this will only work reliably on US keyboards\n *\n * @type {Object}\n */\n var _SHIFT_MAP = {\n '~': '`',\n '!': '1',\n '@': '2',\n '#': '3',\n '$': '4',\n '%': '5',\n '^': '6',\n '&': '7',\n '*': '8',\n '(': '9',\n ')': '0',\n '_': '-',\n '+': '=',\n ':': ';',\n '\\\"': '\\'',\n '<': ',',\n '>': '.',\n '?': '/',\n '|': '\\\\'\n };\n\n /**\n * this is a list of special strings you can use to map\n * to modifier keys when you specify your keyboard shortcuts\n *\n * @type {Object}\n */\n var _SPECIAL_ALIASES = {\n 'option': 'alt',\n 'command': 'meta',\n 'return': 'enter',\n 'escape': 'esc',\n 'plus': '+',\n 'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'\n };\n\n /**\n * variable to store the flipped version of _MAP from above\n * needed to check if we should use keypress or not when no action\n * is specified\n *\n * @type {Object|undefined}\n */\n var _REVERSE_MAP;\n\n /**\n * loop through the f keys, f1 to f19 and add them to the map\n * programatically\n */\n for (var i = 1; i < 20; ++i) {\n _MAP[111 + i] = 'f' + i;\n }\n\n /**\n * loop through to map numbers on the numeric keypad\n */\n for (i = 0; i <= 9; ++i) {\n\n // This needs to use a string cause otherwise since 0 is falsey\n // mousetrap will never fire for numpad 0 pressed as part of a keydown\n // event.\n //\n // @see https://github.com/ccampbell/mousetrap/pull/258\n _MAP[i + 96] = i.toString();\n }\n\n /**\n * cross browser add event method\n *\n * @param {Element|HTMLDocument} object\n * @param {string} type\n * @param {Function} callback\n * @returns void\n */\n function _addEvent(object, type, callback) {\n if (object.addEventListener) {\n object.addEventListener(type, callback, false);\n return;\n }\n\n object.attachEvent('on' + type, callback);\n }\n\n /**\n * takes the event and returns the key character\n *\n * @param {Event} e\n * @return {string}\n */\n function _characterFromEvent(e) {\n\n // for keypress events we should return the character as is\n if (e.type == 'keypress') {\n var character = String.fromCharCode(e.which);\n\n // if the shift key is not pressed then it is safe to assume\n // that we want the character to be lowercase. this means if\n // you accidentally have caps lock on then your key bindings\n // will continue to work\n //\n // the only side effect that might not be desired is if you\n // bind something like 'A' cause you want to trigger an\n // event when capital A is pressed caps lock will no longer\n // trigger the event. shift+a will though.\n if (!e.shiftKey) {\n character = character.toLowerCase();\n }\n\n return character;\n }\n\n // for non keypress events the special maps are needed\n if (_MAP[e.which]) {\n return _MAP[e.which];\n }\n\n if (_KEYCODE_MAP[e.which]) {\n return _KEYCODE_MAP[e.which];\n }\n\n // if it is not in the special map\n\n // with keydown and keyup events the character seems to always\n // come in as an uppercase character whether you are pressing shift\n // or not. we should make sure it is always lowercase for comparisons\n return String.fromCharCode(e.which).toLowerCase();\n }\n\n /**\n * checks if two arrays are equal\n *\n * @param {Array} modifiers1\n * @param {Array} modifiers2\n * @returns {boolean}\n */\n function _modifiersMatch(modifiers1, modifiers2) {\n return modifiers1.sort().join(',') === modifiers2.sort().join(',');\n }\n\n /**\n * takes a key event and figures out what the modifiers are\n *\n * @param {Event} e\n * @returns {Array}\n */\n function _eventModifiers(e) {\n var modifiers = [];\n\n if (e.shiftKey) {\n modifiers.push('shift');\n }\n\n if (e.altKey) {\n modifiers.push('alt');\n }\n\n if (e.ctrlKey) {\n modifiers.push('ctrl');\n }\n\n if (e.metaKey) {\n modifiers.push('meta');\n }\n\n return modifiers;\n }\n\n /**\n * prevents default for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _preventDefault(e) {\n if (e.preventDefault) {\n e.preventDefault();\n return;\n }\n\n e.returnValue = false;\n }\n\n /**\n * stops propogation for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _stopPropagation(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n return;\n }\n\n e.cancelBubble = true;\n }\n\n /**\n * determines if the keycode specified is a modifier key or not\n *\n * @param {string} key\n * @returns {boolean}\n */\n function _isModifier(key) {\n return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';\n }\n\n /**\n * reverses the map lookup so that we can look for specific keys\n * to see what can and can't use keypress\n *\n * @return {Object}\n */\n function _getReverseMap() {\n if (!_REVERSE_MAP) {\n _REVERSE_MAP = {};\n for (var key in _MAP) {\n\n // pull out the numeric keypad from here cause keypress should\n // be able to detect the keys from the character\n if (key > 95 && key < 112) {\n continue;\n }\n\n if (_MAP.hasOwnProperty(key)) {\n _REVERSE_MAP[_MAP[key]] = key;\n }\n }\n }\n return _REVERSE_MAP;\n }\n\n /**\n * picks the best action based on the key combination\n *\n * @param {string} key - character for key\n * @param {Array} modifiers\n * @param {string=} action passed in\n */\n function _pickBestAction(key, modifiers, action) {\n\n // if no action was picked in we should try to pick the one\n // that we think would work best for this key\n if (!action) {\n action = _getReverseMap()[key] ? 'keydown' : 'keypress';\n }\n\n // modifier keys don't work as expected with keypress,\n // switch to keydown\n if (action == 'keypress' && modifiers.length) {\n action = 'keydown';\n }\n\n return action;\n }\n\n /**\n * Converts from a string key combination to an array\n *\n * @param {string} combination like \"command+shift+l\"\n * @return {Array}\n */\n function _keysFromString(combination) {\n if (combination === '+') {\n return ['+'];\n }\n\n combination = combination.replace(/\\+{2}/g, '+plus');\n return combination.split('+');\n }\n\n /**\n * Gets info for a specific key combination\n *\n * @param {string} combination key combination (\"command+s\" or \"a\" or \"*\")\n * @param {string=} action\n * @returns {Object}\n */\n function _getKeyInfo(combination, action) {\n var keys;\n var key;\n var i;\n var modifiers = [];\n\n // take the keys from this pattern and figure out what the actual\n // pattern is all about\n keys = _keysFromString(combination);\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n // normalize key names\n if (_SPECIAL_ALIASES[key]) {\n key = _SPECIAL_ALIASES[key];\n }\n\n // if this is not a keypress event then we should\n // be smart about using shift keys\n // this will only work for US keyboards however\n if (action && action != 'keypress' && _SHIFT_MAP[key]) {\n key = _SHIFT_MAP[key];\n modifiers.push('shift');\n }\n\n // if this key is a modifier then add it to the list of modifiers\n if (_isModifier(key)) {\n modifiers.push(key);\n }\n }\n\n // depending on what the key combination is\n // we will try to pick the best event for it\n action = _pickBestAction(key, modifiers, action);\n\n return {\n key: key,\n modifiers: modifiers,\n action: action\n };\n }\n\n function _belongsTo(element, ancestor) {\n if (element === null || element === document) {\n return false;\n }\n\n if (element === ancestor) {\n return true;\n }\n\n return _belongsTo(element.parentNode, ancestor);\n }\n\n function Mousetrap(targetElement) {\n var self = this;\n\n targetElement = targetElement || document;\n\n if (!(self instanceof Mousetrap)) {\n return new Mousetrap(targetElement);\n }\n\n /**\n * element to attach key events to\n *\n * @type {Element}\n */\n self.target = targetElement;\n\n /**\n * a list of all the callbacks setup via Mousetrap.bind()\n *\n * @type {Object}\n */\n self._callbacks = {};\n\n /**\n * direct map of string combinations to callbacks used for trigger()\n *\n * @type {Object}\n */\n self._directMap = {};\n\n /**\n * keeps track of what level each sequence is at since multiple\n * sequences can start out with the same sequence\n *\n * @type {Object}\n */\n var _sequenceLevels = {};\n\n /**\n * variable to store the setTimeout call\n *\n * @type {null|number}\n */\n var _resetTimer;\n\n /**\n * temporary state where we will ignore the next keyup\n *\n * @type {boolean|string}\n */\n var _ignoreNextKeyup = false;\n\n /**\n * temporary state where we will ignore the next keypress\n *\n * @type {boolean}\n */\n var _ignoreNextKeypress = false;\n\n /**\n * are we currently inside of a sequence?\n * type of action (\"keyup\" or \"keydown\" or \"keypress\") or false\n *\n * @type {boolean|string}\n */\n var _nextExpectedAction = false;\n\n /**\n * resets all sequence counters except for the ones passed in\n *\n * @param {Object} doNotReset\n * @returns void\n */\n function _resetSequences(doNotReset) {\n doNotReset = doNotReset || {};\n\n var activeSequences = false,\n key;\n\n for (key in _sequenceLevels) {\n if (doNotReset[key]) {\n activeSequences = true;\n continue;\n }\n _sequenceLevels[key] = 0;\n }\n\n if (!activeSequences) {\n _nextExpectedAction = false;\n }\n }\n\n /**\n * finds all callbacks that match based on the keycode, modifiers,\n * and action\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event|Object} e\n * @param {string=} sequenceName - name of the sequence we are looking for\n * @param {string=} combination\n * @param {number=} level\n * @returns {Array}\n */\n function _getMatches(character, modifiers, e, sequenceName, combination, level) {\n var i;\n var callback;\n var matches = [];\n var action = e.type;\n\n // if there are no events related to this keycode\n if (!self._callbacks[character]) {\n return [];\n }\n\n // if a modifier key is coming up on its own we should allow it\n if (action == 'keyup' && _isModifier(character)) {\n modifiers = [character];\n }\n\n // loop through all callbacks for the key that was pressed\n // and see if any of them match\n for (i = 0; i < self._callbacks[character].length; ++i) {\n callback = self._callbacks[character][i];\n\n // if a sequence name is not specified, but this is a sequence at\n // the wrong level then move onto the next match\n if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {\n continue;\n }\n\n // if the action we are looking for doesn't match the action we got\n // then we should keep going\n if (action != callback.action) {\n continue;\n }\n\n // if this is a keypress event and the meta key and control key\n // are not pressed that means that we need to only look at the\n // character, otherwise check the modifiers as well\n //\n // chrome will not fire a keypress if meta or control is down\n // safari will fire a keypress if meta or meta+shift is down\n // firefox will fire a keypress if meta or control is down\n if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) {\n\n // when you bind a combination or sequence a second time it\n // should overwrite the first one. if a sequenceName or\n // combination is specified in this call it does just that\n //\n // @todo make deleting its own method?\n var deleteCombo = !sequenceName && callback.combo == combination;\n var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;\n if (deleteCombo || deleteSequence) {\n self._callbacks[character].splice(i, 1);\n }\n\n matches.push(callback);\n }\n }\n\n return matches;\n }\n\n /**\n * actually calls the callback function\n *\n * if your callback function returns false this will use the jquery\n * convention - prevent default and stop propogation on the event\n *\n * @param {Function} callback\n * @param {Event} e\n * @returns void\n */\n function _fireCallback(callback, e, combo, sequence) {\n\n // if this event should not happen stop here\n if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {\n return;\n }\n\n if (callback(e, combo) === false) {\n _preventDefault(e);\n _stopPropagation(e);\n }\n }\n\n /**\n * handles a character key event\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event} e\n * @returns void\n */\n self._handleKey = function(character, modifiers, e) {\n var callbacks = _getMatches(character, modifiers, e);\n var i;\n var doNotReset = {};\n var maxLevel = 0;\n var processedSequenceCallback = false;\n\n // Calculate the maxLevel for sequences so we can only execute the longest callback sequence\n for (i = 0; i < callbacks.length; ++i) {\n if (callbacks[i].seq) {\n maxLevel = Math.max(maxLevel, callbacks[i].level);\n }\n }\n\n // loop through matching callbacks for this key event\n for (i = 0; i < callbacks.length; ++i) {\n\n // fire for all sequence callbacks\n // this is because if for example you have multiple sequences\n // bound such as \"g i\" and \"g t\" they both need to fire the\n // callback for matching g cause otherwise you can only ever\n // match the first one\n if (callbacks[i].seq) {\n\n // only fire callbacks for the maxLevel to prevent\n // subsequences from also firing\n //\n // for example 'a option b' should not cause 'option b' to fire\n // even though 'option b' is part of the other sequence\n //\n // any sequences that do not match here will be discarded\n // below by the _resetSequences call\n if (callbacks[i].level != maxLevel) {\n continue;\n }\n\n processedSequenceCallback = true;\n\n // keep a list of which sequences were matches for later\n doNotReset[callbacks[i].seq] = 1;\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);\n continue;\n }\n\n // if there were no sequence matches but we are still here\n // that means this is a regular match so we should fire that\n if (!processedSequenceCallback) {\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo);\n }\n }\n\n // if the key you pressed matches the type of sequence without\n // being a modifier (ie \"keyup\" or \"keypress\") then we should\n // reset all sequences that were not matched by this event\n //\n // this is so, for example, if you have the sequence \"h a t\" and you\n // type \"h e a r t\" it does not match. in this case the \"e\" will\n // cause the sequence to reset\n //\n // modifier keys are ignored because you can have a sequence\n // that contains modifiers such as \"enter ctrl+space\" and in most\n // cases the modifier key will be pressed before the next key\n //\n // also if you have a sequence such as \"ctrl+b a\" then pressing the\n // \"b\" key will trigger a \"keypress\" and a \"keydown\"\n //\n // the \"keydown\" is expected when there is a modifier, but the\n // \"keypress\" ends up matching the _nextExpectedAction since it occurs\n // after and that causes the sequence to reset\n //\n // we ignore keypresses in a sequence that directly follow a keydown\n // for the same character\n var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;\n if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {\n _resetSequences(doNotReset);\n }\n\n _ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';\n };\n\n /**\n * handles a keydown event\n *\n * @param {Event} e\n * @returns void\n */\n function _handleKeyEvent(e) {\n\n // normalize e.which for key events\n // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion\n if (typeof e.which !== 'number') {\n e.which = e.keyCode;\n }\n\n var character = _characterFromEvent(e);\n\n // no character found then stop\n if (!character) {\n return;\n }\n\n // need to use === for the character check because the character can be 0\n if (e.type == 'keyup' && _ignoreNextKeyup === character) {\n _ignoreNextKeyup = false;\n return;\n }\n\n self.handleKey(character, _eventModifiers(e), e);\n }\n\n /**\n * called to set a 1 second timeout on the specified sequence\n *\n * this is so after each key press in the sequence you have 1 second\n * to press the next key before you have to start over\n *\n * @returns void\n */\n function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }\n\n /**\n * binds a key sequence to an event\n *\n * @param {string} combo - combo specified in bind call\n * @param {Array} keys\n * @param {Function} callback\n * @param {string=} action\n * @returns void\n */\n function _bindSequence(combo, keys, callback, action) {\n\n // start off by adding a sequence level record for this combination\n // and setting the level to 0\n _sequenceLevels[combo] = 0;\n\n /**\n * callback to increase the sequence level for this sequence and reset\n * all other sequences that were active\n *\n * @param {string} nextAction\n * @returns {Function}\n */\n function _increaseSequence(nextAction) {\n return function() {\n _nextExpectedAction = nextAction;\n ++_sequenceLevels[combo];\n _resetSequenceTimer();\n };\n }\n\n /**\n * wraps the specified callback inside of another function in order\n * to reset all sequence counters as soon as this sequence is done\n *\n * @param {Event} e\n * @returns void\n */\n function _callbackAndReset(e) {\n _fireCallback(callback, e, combo);\n\n // we should ignore the next key up if the action is key down\n // or keypress. this is so if you finish a sequence and\n // release the key the final key will not trigger a keyup\n if (action !== 'keyup') {\n _ignoreNextKeyup = _characterFromEvent(e);\n }\n\n // weird race condition if a sequence ends with the key\n // another sequence begins with\n setTimeout(_resetSequences, 10);\n }\n\n // loop through keys one at a time and bind the appropriate callback\n // function. for any key leading up to the final one it should\n // increase the sequence. after the final, it should reset all sequences\n //\n // if an action is specified in the original bind call then that will\n // be used throughout. otherwise we will pass the action that the\n // next key in the sequence should match. this allows a sequence\n // to mix and match keypress and keydown events depending on which\n // ones are better suited to the key provided\n for (var i = 0; i < keys.length; ++i) {\n var isFinal = i + 1 === keys.length;\n var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);\n _bindSingle(keys[i], wrappedCallback, action, combo, i);\n }\n }\n\n /**\n * binds a single keyboard combination\n *\n * @param {string} combination\n * @param {Function} callback\n * @param {string=} action\n * @param {string=} sequenceName - name of sequence if part of sequence\n * @param {number=} level - what part of the sequence the command is\n * @returns void\n */\n function _bindSingle(combination, callback, action, sequenceName, level) {\n\n // store a direct mapped reference for use with Mousetrap.trigger\n self._directMap[combination + ':' + action] = callback;\n\n // make sure multiple spaces in a row become a single space\n combination = combination.replace(/\\s+/g, ' ');\n\n var sequence = combination.split(' ');\n var info;\n\n // if this pattern is a sequence of keys then run through this method\n // to reprocess each pattern one key at a time\n if (sequence.length > 1) {\n _bindSequence(combination, sequence, callback, action);\n return;\n }\n\n info = _getKeyInfo(combination, action);\n\n // make sure to initialize array if this is the first time\n // a callback is added for this key\n self._callbacks[info.key] = self._callbacks[info.key] || [];\n\n // remove an existing match if there is one\n _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);\n\n // add this call back to the array\n // if it is a sequence put it at the beginning\n // if not put it at the end\n //\n // this is important because the way these are processed expects\n // the sequence ones to come first\n self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({\n callback: callback,\n modifiers: info.modifiers,\n action: info.action,\n seq: sequenceName,\n level: level,\n combo: combination\n });\n }\n\n /**\n * binds multiple combinations to the same callback\n *\n * @param {Array} combinations\n * @param {Function} callback\n * @param {string|undefined} action\n * @returns void\n */\n self._bindMultiple = function(combinations, callback, action) {\n for (var i = 0; i < combinations.length; ++i) {\n _bindSingle(combinations[i], callback, action);\n }\n };\n\n // start!\n _addEvent(targetElement, 'keypress', _handleKeyEvent);\n _addEvent(targetElement, 'keydown', _handleKeyEvent);\n _addEvent(targetElement, 'keyup', _handleKeyEvent);\n }\n\n /**\n * binds an event to mousetrap\n *\n * can be a single key, a combination of keys separated with +,\n * an array of keys, or a sequence of keys separated by spaces\n *\n * be sure to list the modifier keys first to make sure that the\n * correct key ends up getting bound (the last key in the pattern)\n *\n * @param {string|Array} keys\n * @param {Function} callback\n * @param {string=} action - 'keypress', 'keydown', or 'keyup'\n * @returns void\n */\n Mousetrap.prototype.bind = function(keys, callback, action) {\n var self = this;\n keys = keys instanceof Array ? keys : [keys];\n self._bindMultiple.call(self, keys, callback, action);\n return self;\n };\n\n /**\n * unbinds an event to mousetrap\n *\n * the unbinding sets the callback function of the specified key combo\n * to an empty function and deletes the corresponding key in the\n * _directMap dict.\n *\n * TODO: actually remove this from the _callbacks dictionary instead\n * of binding an empty function\n *\n * the keycombo+action has to be exactly the same as\n * it was defined in the bind method\n *\n * @param {string|Array} keys\n * @param {string} action\n * @returns void\n */\n Mousetrap.prototype.unbind = function(keys, action) {\n var self = this;\n return self.bind.call(self, keys, function() {}, action);\n };\n\n /**\n * triggers an event that has already been bound\n *\n * @param {string} keys\n * @param {string=} action\n * @returns void\n */\n Mousetrap.prototype.trigger = function(keys, action) {\n var self = this;\n if (self._directMap[keys + ':' + action]) {\n self._directMap[keys + ':' + action]({}, keys);\n }\n return self;\n };\n\n /**\n * resets the library back to its initial state. this is useful\n * if you want to clear out the current keyboard shortcuts and bind\n * new ones - for example if you switch to another page\n *\n * @returns void\n */\n Mousetrap.prototype.reset = function() {\n var self = this;\n self._callbacks = {};\n self._directMap = {};\n return self;\n };\n\n /**\n * should we stop this event before firing off callbacks\n *\n * @param {Event} e\n * @param {Element} element\n * @return {boolean}\n */\n Mousetrap.prototype.stopCallback = function(e, element) {\n var self = this;\n\n // if the element has the class \"mousetrap\" then no need to stop\n if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {\n return false;\n }\n\n if (_belongsTo(element, self.target)) {\n return false;\n }\n\n // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,\n // not the initial event target in the shadow tree. Note that not all events cross the\n // shadow boundary.\n // For shadow trees with `mode: 'open'`, the initial event target is the first element in\n // the event\u2019s composed path. For shadow trees with `mode: 'closed'`, the initial event\n // target cannot be obtained.\n if ('composedPath' in e && typeof e.composedPath === 'function') {\n // For open shadow trees, update `element` so that the following check works.\n var initialEventTarget = e.composedPath()[0];\n if (initialEventTarget !== e.target) {\n element = initialEventTarget;\n }\n }\n\n // stop for input, select, and textarea\n return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;\n };\n\n /**\n * exposes _handleKey publicly so it can be overwritten by extensions\n */\n Mousetrap.prototype.handleKey = function() {\n var self = this;\n return self._handleKey.apply(self, arguments);\n };\n\n /**\n * allow custom key mappings\n */\n Mousetrap.addKeycodes = function(object) {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n _MAP[key] = object[key];\n }\n }\n _REVERSE_MAP = null;\n };\n\n /**\n * Init the global mousetrap functions\n *\n * This method is needed to allow the global mousetrap functions to work\n * now that mousetrap is a constructor function.\n */\n Mousetrap.init = function() {\n var documentMousetrap = Mousetrap(document);\n for (var method in documentMousetrap) {\n if (method.charAt(0) !== '_') {\n Mousetrap[method] = (function(method) {\n return function() {\n return documentMousetrap[method].apply(documentMousetrap, arguments);\n };\n } (method));\n }\n }\n };\n\n Mousetrap.init();\n\n // expose mousetrap to the global object\n window.Mousetrap = Mousetrap;\n\n // expose as a common js module\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Mousetrap;\n }\n\n // expose mousetrap as an AMD module\n if (typeof define === 'function' && define.amd) {\n define(function() {\n return Mousetrap;\n });\n }\n}) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);\n", "import { $, $all, app, store } from './common'\nimport { copyAll } from './context'\nimport { cm, udfInput, uduInput } from './editor'\nimport { calculate } from './eval'\nimport { getRates } from './forex'\nimport { generateIcons } from './icons'\nimport { notify, showError, showModal } from './modal'\nimport { plot } from './plot'\nimport { settings } from './settings'\nimport { defaultPage, lastPage, loadPage, migrateSaved, getPageName, pageOrder, populatePages } from './pages'\nimport { applyUdfu } from './userDefined'\nimport { checkSize, checkUpdates, isMac, isElectron, toggleMinMax } from './utils'\n\nimport { author, description, homepage, name, version } from './../../package.json'\n\nimport { DateTime } from 'luxon'\n\nimport UIkit from 'uikit'\n\nimport Mousetrap from 'mousetrap'\nimport 'mousetrap-global-bind'\n\n// Set app info\ndocument.title = description\n\n$('#dialog-about-copyright').innerHTML = `Copyright \u00A9\uFE0F ${DateTime.local().year} ${author.name}`\n$('#dialog-about-appVersion').innerHTML = isElectron\n ? `Version ${version}`\n : `Version ${version}\n `\n$('#gitLink').setAttribute('href', homepage)\n$('#webLink').setAttribute('href', author.url)\n$('#licenseLink').setAttribute('href', homepage + '/blob/master/LICENSE')\n$('#helpLink').setAttribute('href', homepage + '/wiki')\n\n// Set theme and maximize if needed\nif (isElectron) {\n numara.themeUpdate(settings.apply)\n numara.fullscreen()\n} else {\n // Register service worker\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register('./sw.js').catch(() => {\n console.log('Service worker registration failed.')\n })\n }\n}\n\n// Set headers\nif (isElectron && !isMac) {\n $('#header-mac').remove()\n $('#header-win').style.display = 'block'\n $('#header-win-title').innerHTML = name\n\n $('#max').style.display = numara.isMaximized() ? 'none' : 'block'\n $('#unmax').style.display = numara.isMaximized() ? 'block' : 'none'\n\n $('#min').addEventListener('click', numara.minimize)\n $('#max').addEventListener('click', numara.maximize)\n $('#unmax').addEventListener('click', numara.unmaximize)\n $('#close').addEventListener('click', numara.close)\n\n numara.isMax((event, isMax) => {\n $('#unmax').style.display = isMax ? 'block' : 'none'\n $('#max').style.display = isMax ? 'none' : 'block'\n })\n\n $('#header-win').addEventListener('dblclick', toggleMinMax)\n} else {\n $('#header-win').remove()\n $('#header-mac').style.display = 'block'\n $('#header-mac-title').innerHTML = name\n\n if (isElectron) {\n $('#header-mac').addEventListener('dblclick', toggleMinMax)\n }\n}\n\n// Generate app icons\ngenerateIcons()\n\n// Initialize settings\nsettings.initialize()\n\n// Get exchange rates\nif (app.settings.currency) {\n getRates()\n}\n\n// Set user defined values\nif (!store.get('pages')) {\n defaultPage()\n} else {\n app.activePage = lastPage()\n loadPage(lastPage())\n}\n\nmigrateSaved()\n\n// Set user defined values\nif (!store.get('udf')) {\n store.set('udf', '')\n}\n\nif (!store.get('udu')) {\n store.set('udu', '')\n}\n\napplyUdfu(store.get('udf'), 'func')\napplyUdfu(store.get('udu'), 'unit')\n\n// Populate saved calculation\npopulatePages()\n\n// Action buttons\n$('#clearButton').addEventListener('click', () => {\n if (cm.getValue() !== '') {\n cm.setValue('')\n cm.focus()\n\n calculate()\n }\n})\n\n$('#copyButton').addEventListener('click', () => {\n copyAll()\n})\n\n$('#udfuButton').addEventListener('click', () => {\n showModal('#dialog-udfu')\n})\n\n$('#settingsButton').addEventListener('click', () => {\n showModal('#dialog-settings')\n})\n\n$('#aboutButton').addEventListener('click', () => {\n showModal('#dialog-about')\n})\n\n// Output panel actions\n$('#output').addEventListener('click', (event) => {\n switch (event.target.className) {\n case 'answer':\n navigator.clipboard.writeText(event.target.dataset.copy)\n\n notify(`Copied '${event.target.dataset.copy}' to clipboard.`)\n\n break\n case 'plotButton': {\n const func = event.target.getAttribute('data-func')\n\n app.plotFunction = func.startsWith('line') ? app.mathScope[func] : func\n\n try {\n $('#plotCrossModal').checked = app.settings.plotCross\n $('#plotDerivativeModal').checked = app.settings.plotDerivative\n $('#plotGridModal').checked = app.settings.plotGrid\n\n plot()\n\n showModal('#dialog-plot')\n } catch (error) {\n showError('Error', error)\n }\n\n break\n }\n case 'lineError':\n showError('Error on Line ' + event.target.getAttribute('data-line'), event.target.getAttribute('data-error'))\n\n break\n }\n\n event.stopPropagation()\n})\n\n// Clear input selections when clicked in output panel\n$('#output').addEventListener('mousedown', () => {\n const sels = document.getElementsByClassName('CodeMirror-selected')\n\n while (sels[0]) {\n sels[0].classList.remove('CodeMirror-selected')\n }\n})\n\n// Panel resizer\nlet resizeDelay\nlet isResizing = false\n\nconst panel = $('#panel')\nconst divider = $('#panelDivider')\n\n// Set divider tooltip.\nconst dividerTooltip = () => {\n divider.title =\n $('#input').style.width === settings.defaults.inputWidth + '%' ? 'Drag to resize' : 'Double click to reset position'\n}\n\ndivider.addEventListener('dblclick', () => {\n app.settings.inputWidth = settings.defaults.inputWidth\n\n store.set('settings', app.settings)\n\n settings.apply()\n\n dividerTooltip()\n})\n\ndivider.addEventListener('mousedown', (event) => {\n isResizing = event.target === divider\n})\n\n$('#panel').addEventListener('mouseup', () => {\n isResizing = false\n})\n\n$('#panel').addEventListener('mousemove', (event) => {\n if (isResizing) {\n const offset = app.settings.lineNumbers ? 12 : 27\n const pointerRelativeXpos = event.clientX - panel.offsetLeft - offset\n const iWidth = (pointerRelativeXpos / panel.clientWidth) * 100\n const inputWidth = iWidth < 0 ? 0 : iWidth > 100 ? 100 : iWidth\n\n $('#input').style.width = inputWidth + '%'\n\n app.settings.inputWidth = inputWidth\n\n store.set('settings', app.settings)\n\n clearTimeout(resizeDelay)\n\n resizeDelay = setTimeout(calculate, 10)\n }\n\n dividerTooltip()\n})\n\n// Tooltip defaults\nUIkit.mixin({ data: { offset: 5 } }, 'tooltip')\n\n// Initiate settings dialog\nUIkit.util.on('#dialog-settings', 'beforeshow', settings.prep)\n\nUIkit.util.on('#setswitch', 'beforeshow', (event) => {\n event.stopPropagation()\n})\n\n// Prepare user defined dialog inputs\nUIkit.util.on('#dialog-udfu', 'shown', (event) => {\n if (event.target.id === 'dialog-udfu') {\n const udf = store.get('udf').trim()\n const udu = store.get('udu').trim()\n\n udfInput.setValue(udf)\n uduInput.setValue(udu)\n }\n})\n\n// Blur input when user defined switcher is shown\nUIkit.util.on('#udfuSwitcher', 'shown', () => {\n cm.getInputField().blur()\n})\n\n// Focus on input when dialog is closed\nUIkit.util.on('.modal', 'hidden', () => {\n setTimeout(() => {\n cm.focus()\n }, 100)\n})\n\n// Plot dialog\nUIkit.util.on('#dialog-plot', 'shown', plot)\nUIkit.util.on('#dialog-plot', 'hide', () => {\n app.activePlot = false\n})\n\n// Save page sort order after move\nUIkit.util.on('#pageList', 'moved', () => {\n pageOrder()\n populatePages()\n})\n\n// Save dialog title focus on shown\nUIkit.util.on('#dialog-newPage', 'shown', () => {\n $('#newPageTitleInput').setAttribute('placeholder', getPageName())\n $('#newPageTitleInput').focus()\n})\n\n// Focus rename input on show\nUIkit.util.on('#dialog-renamePage', 'shown', () => {\n setTimeout(() => {\n $('#renamePageTitleInput').focus()\n $('#renamePageTitleInput').select()\n }, 20)\n})\n\nUIkit.util.on('#sidePanel', 'hidden', () => {\n setTimeout(() => {\n cm.focus()\n }, 20)\n})\n\n// Prevent CM refresh if keydown\ndocument.addEventListener('keydown', (event) => {\n app.refreshCM = !event.repeat\n})\n\ndocument.addEventListener('keyup', () => {\n app.refreshCM = true\n})\n\n// Relayout plot on window resize\nlet windowResizeDelay\n\nwindow.addEventListener('resize', () => {\n if (app.activePlot && $('#dialog-plot').classList.contains('uk-open')) {\n plot()\n }\n\n clearTimeout(windowResizeDelay)\n\n windowResizeDelay = setTimeout(calculate, 10)\n\n checkSize()\n})\n\n// Sync scroll\nlet inputScroll = false\nlet outputScroll = false\n\nconst inputPanel = $('.CodeMirror-scroll')\nconst outputPanel = $('#output')\n\ninputPanel.addEventListener('scroll', () => {\n if (!inputScroll) {\n outputScroll = true\n\n outputPanel.scrollTop = inputPanel.scrollTop\n }\n\n inputScroll = false\n})\n\noutputPanel.addEventListener('scroll', () => {\n if (!outputScroll) {\n inputScroll = true\n\n inputPanel.scrollTop = outputPanel.scrollTop\n }\n\n outputScroll = false\n\n $('#scrollTop').style.display = outputPanel.scrollTop > 50 ? 'block' : 'none'\n})\n\n$('#scrollTop').addEventListener('click', () => {\n inputPanel.scrollTop = 0\n outputPanel.scrollTop = 0\n})\n\n// Mousetrap\nconst traps = {\n clearButton: ['command+d', 'ctrl+d'],\n exportButton: ['command+e', 'ctrl+e'],\n importButton: ['command+i', 'ctrl+i'],\n newPageButton: ['command+n', 'ctrl+n'],\n printButton: ['command+p', 'ctrl+p'],\n sidePanelButton: ['tab']\n}\n\nfor (const [button, command] of Object.entries(traps)) {\n Mousetrap.bindGlobal(command, (event) => {\n event.preventDefault()\n\n if ($all('.uk-open').length === 0) {\n $('#' + button).click()\n } else if ($('#sidePanel').classList.contains('uk-open') && !$('#dialog-newPage').classList.contains('uk-open')) {\n $('#closeSidePanelButton').click()\n }\n })\n}\n\n// Check for updates.\ncheckUpdates()\n\n// Restart button if update is installed\n$('#restartButton').addEventListener('click', () => {\n numara.updateApp()\n})\n\n// Developer Tools\nif (isElectron) {\n $('#dialog-about-appVersion').addEventListener('click', (event) => {\n if (event.detail === 9) {\n numara.openDevTools()\n }\n })\n}\n\n// Print\nwindow.addEventListener('beforeprint', () => {\n const printArea = document.createElement('div')\n\n printArea.setAttribute('id', 'printArea')\n printArea.className = 'printArea'\n printArea.innerHTML = `\n
    ${name}
    \n
    `\n\n document.body.appendChild(printArea)\n\n cm.eachLine((line) => {\n const lineNo = cm.getLineNumber(line)\n const input = cm.getLine(lineNo)\n const answer = $('#output').children[lineNo].innerText\n const row = `\n \n ${app.settings.lineNumbers ? '' : ''}\n \n \n `\n\n $('#printPagele').innerHTML += row\n })\n\n printArea.innerHTML += `
    ' + (lineNo + 1) + '${input}${answer}
    `\n})\n\nwindow.addEventListener('afterprint', () => {\n $('#printArea').remove()\n})\n", "/** Query DOM element that matches the selector. */\nexport const $ = (selector) => document.querySelector(selector)\n\n/** Query all DOM elements matching the selector. */\nexport const $all = (selector) => document.querySelectorAll(selector)\n\n/** Local storage. */\nexport const store = {\n /** Get value from local storage. */\n get: (key) => JSON.parse(localStorage.getItem(key)),\n /** Save value to local storage. */\n set: (key, value) => {\n localStorage.setItem(key, JSON.stringify(value))\n }\n}\n\n/** App globals. */\nexport const app = {\n activePlot: null,\n activePage: null,\n currencyRates: {},\n mathScope: {},\n plotFunction: null,\n refreshCM: true,\n settings: null,\n udfList: [],\n uduList: []\n}\n", "import { $, $all } from './common'\nimport { cm, udfInput, uduInput } from './editor'\nimport { notify } from './modal'\nimport { isElectron } from './utils'\n\n/** Main context menus */\nfunction inputContext() {\n setTimeout(() => {\n const index = cm.getCursor().line\n const line = cm.getLine(index)\n const answer = $('#output').children[index].innerText\n const isEmpty = cm.getValue() === ''\n const isLine = line.length > 0\n const isSelection = cm.somethingSelected()\n const isMultiLine =\n cm.listSelections().length > 1 || cm.listSelections()[0].anchor.line !== cm.listSelections()[0].head.line\n const hasAnswer = answer !== '' && answer !== 'Error' && answer !== 'Plot'\n\n numara.inputContextMenu(index, isEmpty, isLine, isSelection, isMultiLine, hasAnswer)\n }, 20)\n}\n\n/** Output panel context menu. */\nfunction outputContext(event) {\n const answer = event.srcElement.innerText\n const index = event.srcElement.dataset.line || event.srcElement.parentElement.dataset.line || cm.lastLine()\n const hasAnswer = index !== null && answer !== '' && answer !== 'Error' && answer !== 'Plot'\n const isEmpty = cm.getValue() === ''\n\n numara.outputContextMenu(index, isEmpty, hasAnswer)\n}\n\n/** Textbox context menu. */\nfunction textboxContext() {\n setTimeout(() => {\n numara.textboxContextMenu()\n }, 20)\n}\n\n/** Copy line answer. */\nfunction copyLine(event, index) {\n index = +index\n\n const line = cm.getLine(index).trim()\n\n navigator.clipboard.writeText(line).then(notify(`Copied Line ${index + 1} to clipboard.`))\n}\n\n/** Copy line answer. */\nfunction copyAnswer(event, index, withLines) {\n index = +index\n\n const line = cm.getLine(index).trim()\n const answer = $('#output').children[index].children[0].dataset.copy\n const copiedText = withLines ? `${line} = ${answer}` : `${answer}`\n\n navigator.clipboard\n .writeText(copiedText)\n .then(notify(withLines ? `Copied Line ${index + 1} with answer to clipboard.` : `Copied '${answer}' to clipboard.`))\n}\n\n/** Copy all inputs. */\nfunction copyAllLines() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n navigator.clipboard.writeText(cm.getValue()).then(notify('Copied all lines to clipboard.'))\n }\n}\n\n/** Copy all answers. */\nfunction copyAllAnswers() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n let copiedOutputs = ''\n\n cm.eachLine((line) => {\n const index = cm.getLineNumber(line)\n\n copiedOutputs += `${$('#output').children[index].innerText}\\n`\n })\n\n navigator.clipboard.writeText(copiedOutputs).then(notify('Copied all answers to clipboard.'))\n }\n}\n\n/** Copy page. */\nexport function copyAll() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n let copiedCalc = ''\n\n cm.eachLine((line) => {\n const index = cm.getLineNumber(line)\n\n line = line.text.trim()\n\n copiedCalc += line\n ? line.match(/^(#|\\/\\/)/)\n ? `${line}\\n`\n : `${line} = ${$('#output').children[index].innerText}\\n`\n : '\\n'\n })\n\n navigator.clipboard.writeText(copiedCalc).then(notify('Copied page to clipboard.'))\n }\n}\n\n// Context menus\nif (isElectron) {\n cm.on('contextmenu', inputContext)\n\n udfInput.on('contextmenu', textboxContext)\n uduInput.on('contextmenu', textboxContext)\n\n $('#output').addEventListener('contextmenu', outputContext)\n\n $all('.textBox').forEach((el) => {\n el.addEventListener('contextmenu', textboxContext)\n })\n\n numara.copyLine(copyLine)\n numara.copyAnswer(copyAnswer)\n numara.copyLineWithAnswer(copyAnswer)\n numara.copyAllLines(copyAllLines)\n numara.copyAllAnswers(copyAllAnswers)\n numara.copyAll(copyAll)\n}\n", "import { $, $all, app, store } from './common'\nimport { calculate, formatAnswer, math } from './eval'\n\nimport * as formulajs from '@formulajs/formulajs'\n\nimport UIkit from 'uikit'\n\nimport CodeMirror from 'codemirror'\n\nimport 'codemirror/mode/javascript/javascript'\nimport 'codemirror/addon/dialog/dialog'\nimport 'codemirror/addon/display/placeholder'\nimport 'codemirror/addon/edit/closebrackets'\nimport 'codemirror/addon/edit/matchbrackets'\nimport 'codemirror/addon/hint/show-hint'\nimport 'codemirror/addon/search/jump-to-line'\nimport 'codemirror/addon/search/search'\nimport 'codemirror/addon/search/searchcursor'\n\n/** CodeMirror input panel. */\nexport const cm = CodeMirror.fromTextArea($('#inputArea'), {\n autofocus: true,\n extraKeys: { 'Ctrl-Space': 'autocomplete', Tab: () => {} },\n mode: 'numara',\n singleCursorHeightPerLine: false,\n smartIndent: false,\n theme: 'numara',\n viewportMargin: Infinity\n})\n\n// User defined functions and units editors\nconst udOptions = {\n autofocus: true,\n autoCloseBrackets: true,\n mode: 'javascript',\n singleCursorHeightPerLine: false,\n tabSize: 2\n}\n\nexport const udfInput = CodeMirror.fromTextArea($('#udfInput'), udOptions)\nexport const uduInput = CodeMirror.fromTextArea($('#uduInput'), udOptions)\n\n// Codemirror syntax templates\nCodeMirror.defineMode('numara', () => ({\n token: (stream) => {\n if (stream.match(/\\/\\/.*/) || stream.match(/#.*/)) {\n return 'comment'\n }\n\n if (stream.match(/\\d/)) {\n return 'number'\n }\n\n if (stream.match(/(?:\\+|-|\\*|\\/|,|;|\\.|:|@|~|=|>|<|&|\\||`|'|\\^|\\?|!|%)/)) {\n return 'operator'\n }\n\n stream.eatWhile(/\\w/)\n\n const cmStream = stream.current()\n\n if (app.settings.currency && (cmStream.toLowerCase() in app.currencyRates || cmStream.toLowerCase() === 'usd')) {\n return 'currency'\n }\n\n if (typeof math[cmStream] === 'function' && Object.getOwnPropertyNames(math[cmStream]).includes('signatures')) {\n return 'function'\n }\n\n if (app.udfList.includes(cmStream)) {\n return 'udf'\n }\n\n if (app.uduList.includes(cmStream)) {\n return 'udu'\n }\n\n if (cmStream.match(/\\b(?:_|ans|total|subtotal|avg|today|now)\\b/)) {\n return 'scope'\n }\n\n if (cmStream.match(/\\b(?:line\\d+)\\b/)) {\n return 'lineNo'\n }\n\n if (typeof formulajs[cmStream] === 'function') {\n return 'excel'\n }\n\n try {\n const val = math.evaluate(cmStream)\n const par = math.parse(cmStream)\n\n if (val.units && val) {\n return 'unit'\n }\n\n if (par.isSymbolNode && val) {\n return 'constant'\n }\n } catch {\n /** Ignore catch */\n }\n\n try {\n math.evaluate(cmStream)\n } catch {\n return 'variable'\n }\n\n stream.next()\n\n return 'space'\n }\n}))\n\nCodeMirror.defineMode('plain', () => ({\n token: (stream) => {\n stream.next()\n\n return 'text'\n }\n}))\n\n// Codemirror autocomplete hints\nconst numaraHints = []\n\nconst scopeList = [\n { text: '_', desc: 'Answer from last calculated line.' },\n { text: 'ans', desc: 'Answer from last calculated line.' },\n { text: 'avg', desc: 'Average of previous line values. Numbers only.' },\n { text: 'now', desc: 'Current date and time.' },\n { text: 'subtotal', desc: 'Total of all lines in previous block. Numbers only.' },\n { text: 'today', desc: 'Current date.' },\n { text: 'total', desc: 'Total of previous line values. Numbers only.' }\n]\n\nscopeList.forEach((scope) => {\n scope.className = 'cm-scope'\n numaraHints.push(scope)\n})\n\nObject.getOwnPropertyNames(math).forEach((f) => {\n if (typeof math[f] === 'function' && Object.getOwnPropertyNames(math[f]).includes('signatures')) {\n numaraHints.push({ text: f, className: 'cm-function' })\n }\n})\n\nObject.keys(formulajs).forEach((f) => {\n numaraHints.push({ text: f, className: 'cm-excel' })\n})\n\nCodeMirror.commands.autocomplete = (cm) => {\n CodeMirror.showHint(cm, CodeMirror.hint.numaraHints, {\n completeSingle: false,\n extraKeys: { Enter: 'newline' }\n })\n}\n\nCodeMirror.registerHelper('hint', 'numaraHints', (editor) => {\n const cmCursor = editor.getCursor()\n const cmCursorLine = editor.getLine(cmCursor.line)\n\n let start = cmCursor.ch\n let end = start\n\n while (end < cmCursorLine.length && /[\\w$]/.test(cmCursorLine.charAt(end))) {\n ++end\n }\n\n while (start && /[\\w$]/.test(cmCursorLine.charAt(start - 1))) {\n --start\n }\n\n const curWord = start !== end && cmCursorLine.slice(start, end)\n const curWordRegex = new RegExp('^' + curWord, 'i')\n\n return {\n list: !curWord\n ? []\n : numaraHints.filter(({ text }) => text.match(curWordRegex)).sort((a, b) => a.text.localeCompare(b.text)),\n from: CodeMirror.Pos(cmCursor.line, start),\n to: CodeMirror.Pos(cmCursor.line, end)\n }\n})\n\n// Codemirror handlers\ncm.on('changes', calculate)\n\ncm.on('inputRead', (cm) => {\n if (app.settings.autocomplete) {\n CodeMirror.commands.autocomplete(cm)\n }\n})\n\ncm.on('cursorActivity', (cm) => {\n cm.eachLine((line) => {\n const cmLineNo = cm.getLineNumber(line)\n const activeLine = cm.getCursor().line\n\n if (cmLineNo === activeLine) {\n cm.addLineClass(cmLineNo, 'gutter', 'activeLine')\n } else {\n cm.removeLineClass(cmLineNo, 'gutter', 'activeLine')\n }\n })\n})\n\nconst ttPos = (el) => (el.nodeName.toLowerCase() === 'li' ? 'right' : 'top-left')\n\ncm.on('update', () => {\n const funcs = $all('.cm-function')\n\n if (funcs.length > 0 && app.settings.keywordTips) {\n for (const f of funcs) {\n try {\n const obj = JSON.parse(JSON.stringify(math.help(f.innerText).toJSON()))\n\n UIkit.tooltip(f, {\n pos: ttPos(f),\n title: obj.description\n })\n } catch {\n UIkit.tooltip(f, {\n pos: ttPos(f),\n title: 'Description not available'\n })\n }\n }\n }\n\n const udfs = $all('.cm-udf')\n\n if (udfs.length > 0 && app.settings.keywordTips) {\n for (const f of udfs) {\n UIkit.tooltip(f, {\n pos: ttPos(f),\n title: 'User defined function'\n })\n }\n }\n\n const udus = $all('.cm-udu')\n\n if (udus.length > 0 && app.settings.keywordTips) {\n for (const u of udus) {\n UIkit.tooltip(u, {\n pos: ttPos(u),\n title: 'User defined unit'\n })\n }\n }\n\n const currencies = $all('.cm-currency')\n\n if (currencies.length > 0 && app.settings.keywordTips) {\n for (const c of currencies) {\n try {\n const currency = c.innerText.toLowerCase()\n const currencyName = currency === 'usd' ? 'U.S. Dollar' : app.currencyRates[currency].name\n\n UIkit.tooltip(c, {\n pos: ttPos(c),\n title: currencyName\n })\n } catch {\n UIkit.tooltip(c, {\n pos: ttPos(c),\n title: 'Description not available'\n })\n }\n }\n }\n\n const units = $all('.cm-unit')\n\n if (units.length > 0 && app.settings.keywordTips) {\n for (const u of units) {\n UIkit.tooltip(u, {\n pos: ttPos(u),\n title: `Unit '${u.innerText}'`\n })\n }\n }\n\n const constants = $all('.cm-constant')\n\n if (constants.length > 0 && app.settings.keywordTips) {\n for (const c of constants) {\n try {\n UIkit.tooltip(c, {\n pos: ttPos(c),\n title: math.help(c.innerText).doc.description + ' (Constant)'\n })\n } catch {\n /* No tooltip */\n }\n }\n }\n\n const vars = $all('.cm-variable')\n\n if (vars.length > 0 && app.settings.keywordTips) {\n for (const v of vars) {\n if (app.mathScope[v.innerText] && typeof app.mathScope[v.innerText] !== 'function') {\n let varTooltip\n\n try {\n varTooltip = formatAnswer(math.evaluate(v.innerText, app.mathScope))\n } catch {\n varTooltip = 'Undefined'\n }\n\n UIkit.tooltip(v, {\n pos: ttPos(v),\n title: varTooltip\n })\n }\n }\n }\n\n const lineNos = $all('.cm-lineNo')\n\n if (lineNos.length > 0 && app.settings.keywordTips) {\n for (const ln of lineNos) {\n let scopeTooltip\n\n try {\n scopeTooltip =\n typeof app.mathScope[ln.innerText] === 'function'\n ? 'Function'\n : formatAnswer(math.evaluate(ln.innerText, app.mathScope))\n } catch {\n scopeTooltip = 'Undefined'\n }\n\n UIkit.tooltip(ln, {\n pos: ttPos(ln),\n title: scopeTooltip\n })\n }\n }\n\n const scope = $all('.cm-scope')\n\n if (scope.length > 0 && app.settings.keywordTips) {\n for (const s of scope) {\n UIkit.tooltip(s, {\n pos: ttPos(s),\n title: scopeList.filter((scope) => s.innerText === scope.text)[0].desc\n })\n }\n }\n\n const excel = $all('.cm-excel')\n\n if (excel.length > 0 && app.settings.keywordTips) {\n for (const x of excel) {\n UIkit.tooltip(x, {\n pos: ttPos(x),\n title: 'Excel function'\n })\n }\n }\n})\n\ncm.on('cursorActivity', (cm) => {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id == app.activePage)\n\n page.cursor = cm.getCursor()\n\n store.set('pages', pages)\n})\n", "import { $, app, store } from './common'\nimport { cm } from './editor'\nimport { checkLocale } from './utils'\n\nimport { DateTime } from 'luxon'\nimport { create, all } from 'mathjs'\n\nimport * as formulajs from '@formulajs/formulajs'\n\nexport const math = create(all)\n\n// Import Formula.js into MathJs\nmath.import(formulajs, { silent: true, wrap: true })\n\n// Expose math to global scope for use in function-plot.\nwindow.math = math\n\nconst nowFormat = 'D t'\nconst nowDayFormat = 'ccc, D t'\n\nconst todayFormat = 'D'\nconst todayDayFormat = 'ccc, D'\n\n/** Calculate answers. */\nexport function calculate() {\n if (app.refreshCM) {\n cm.refresh()\n }\n\n let answers = ''\n let answerCopy = ''\n\n const avgs = []\n const totals = []\n const subtotals = []\n\n const dateTime = DateTime.now().setLocale(app.settings.locale)\n\n app.mathScope = {}\n app.mathScope.now = dateTime.toFormat(app.settings.dateDay ? nowDayFormat : nowFormat)\n app.mathScope.today = dateTime.toFormat(app.settings.dateDay ? todayDayFormat : todayFormat)\n\n $('#clearButton').setAttribute('disabled', cm.getValue() === '')\n $('#copyButton').setAttribute('disabled', cm.getValue() === '')\n\n cm.eachLine((cmLine) => {\n const cmLineNo = cm.getLineNumber(cmLine)\n const lineNo = cmLineNo + 1\n\n let answer = ''\n let line = cmLine.text.trim().split('//')[0].split('#')[0]\n\n cm.removeLineClass(cmLine, 'gutter', 'lineNoError')\n\n if (app.settings.rulers) {\n cm.removeLineClass(cmLine, 'wrap', 'noRuler')\n cm.addLineClass(cmLine, 'wrap', 'ruler')\n } else {\n cm.removeLineClass(cmLine, 'wrap', 'ruler')\n cm.addLineClass(cmLine, 'wrap', 'noRuler')\n }\n\n if (line) {\n try {\n line =\n lineNo > 1 &&\n line.charAt(0).match(/[+\\-*/]/) &&\n cm.getLine(lineNo - 2).length > 0 &&\n app.settings.contPrevLine\n ? app.mathScope.ans + line\n : line\n\n if (checkLocale()) {\n line = line.replace(/[,;]/g, (match) => (match === ',' ? '.' : ','))\n }\n\n app.mathScope.avg = math.evaluate(avgs.length > 0 ? '(' + math.mean(avgs) + ')' : '0')\n app.mathScope.total = math.evaluate(totals.length > 0 ? '(' + totals.join('+') + ')' : '0')\n app.mathScope.subtotal = math.evaluate(subtotals.length > 0 ? '(' + subtotals.join('+') + ')' : '0')\n\n try {\n answer = math.evaluate(line, app.mathScope)\n } catch {\n answer = evaluate(line)\n }\n\n if (answer || answer === 0) {\n app.mathScope._ = answer\n app.mathScope.ans = answer\n app.mathScope['line' + lineNo] = answer\n\n if (typeof answer === 'number') {\n avgs.push(answer)\n totals.push(answer)\n subtotals.push(answer)\n }\n\n answer = math.format(answer, {\n notation: app.settings.notation,\n lowerExp: +app.settings.expLower,\n upperExp: +app.settings.expUpper\n })\n\n const answerCopyInit = answer\n\n answer = formatAnswer(answer, false)\n answerCopy = formatAnswer(answerCopyInit, true)\n\n if (answer.match(/\\w\\(x\\)/)) {\n const plotAns = (/\\w\\(x\\)$/.test(answer) && line !== 'ans' ? line : answer).replace(/\\s+/g, '')\n\n app.mathScope.ans = plotAns\n app.mathScope['line' + lineNo] = plotAns\n\n answer = `Plot`\n }\n } else {\n subtotals.length = 0\n\n answer = ''\n }\n } catch (error) {\n if (app.settings.lineErrors) {\n cm.addLineClass(cmLineNo, 'gutter', 'lineNoError')\n\n answer = `Error`\n }\n }\n } else {\n subtotals.length = 0\n }\n\n answers += `\n ${answer}\n
    `\n })\n\n $('#output').innerHTML = answers\n\n if (app.activePage) {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === app.activePage)\n\n page.data = cm.getValue()\n page.history = cm.getHistory()\n\n store.set('pages', pages)\n }\n}\n\n/** Secondary evaluate method to try if math.evaluate fails */\nfunction evaluate(line) {\n if (line.match(/:/)) {\n try {\n math.evaluate(line.split(':')[0])\n } catch {\n line = line.substring(line.indexOf(':') + 1)\n }\n }\n\n const dateTimeReg =\n /[+-] * .* *(millisecond|second|minute|hour|day|week|month|quarter|year|decade|century|centuries|millennium|millennia)s?/g\n\n if (line.match(dateTimeReg)) {\n line = line.replace('now', app.mathScope.now).replace('today', app.mathScope.today)\n\n const lineDate = line.replace(dateTimeReg, '').trim()\n const lineDateRight = line.replace(lineDate, '').trim()\n const locale = { locale: app.settings.locale }\n const lineDateNow = DateTime.fromFormat(lineDate, app.settings.dateDay ? nowDayFormat : nowFormat, locale)\n const lineDateToday = DateTime.fromFormat(lineDate, app.settings.dateDay ? todayDayFormat : todayFormat, locale)\n const lineDateTime = lineDateNow.isValid ? lineDateNow : lineDateToday.isValid ? lineDateToday : false\n const rightOfDate = String(math.evaluate(lineDateRight + ' to hours', app.mathScope))\n const durHrs = Number(rightOfDate.split(' ')[0])\n\n if (lineDateTime) {\n const dtLine = lineDateTime\n .plus({ hours: durHrs })\n .toFormat(\n lineDateNow.isValid\n ? app.settings.dateDay\n ? nowDayFormat\n : nowFormat\n : app.settings.dateDay\n ? todayDayFormat\n : todayFormat\n )\n\n line = `\"${dtLine}\"`\n } else {\n return 'Invalid Date'\n }\n }\n\n const pcntOfReg = /%[ ]*of[ ]*/g\n const pcntOfValReg = /[\\w.]*%[ ]*of[ ]*/g\n\n if (line.match(pcntOfValReg)) {\n line = line.replaceAll(pcntOfReg, '/100*')\n }\n\n return math.evaluate(line, app.mathScope)\n}\n\nfunction stripAnswer(answer) {\n let t = answer.length\n\n if (answer.charAt(0) === '\"') {\n answer = answer.substring(1, t--)\n }\n\n if (answer.charAt(--t) === '\"') {\n answer = answer.substring(0, t)\n }\n\n return answer\n}\n\n/**\n * Format answer.\n *\n * @param {*} answer Value to format.\n * @param {boolean} separator Include thousands separator - True|False\n * @returns\n */\nexport function formatAnswer(answer, separator) {\n answer = String(answer)\n\n if (['bin', 'hex', 'oct'].includes(app.settings.notation)) {\n return stripAnswer(answer)\n }\n\n const a = answer.trim().split(' ')[0]\n const b = answer.replace(a, '')\n const digits = {\n maximumFractionDigits: app.settings.precision,\n useGrouping: separator ? app.settings.copyThouSep : app.settings.thouSep\n }\n\n const formattedAnswer =\n !a.includes('e') && !isNaN(a)\n ? Number(a).toLocaleString(app.settings.locale, digits) + b\n : a.match(/e[+-]?\\d+/) && !isNaN(a.split('e')[0])\n ? Number(a.split('e')[0]).toLocaleString(app.settings.locale, digits) + 'e' + answer.split('e')[1]\n : stripAnswer(answer)\n\n return formattedAnswer\n}\n", "import { $, app } from './common'\nimport { notify } from './modal'\n\n/** Check if app is running on MacOS. */\nexport const isMac = navigator.userAgent.toLowerCase().includes('mac')\n\n/** Check if app is running in Electron. */\nexport const isElectron = navigator.userAgent.toLowerCase().includes('electron')\n\n/** Check user locale for thousands separator. */\nexport function checkLocale() {\n const locale =\n app.settings.locale === 'system'\n ? navigator.languages && navigator.languages.length\n ? navigator.languages[0]\n : navigator.language\n : app.settings.locale\n\n return (1.11).toLocaleString(locale).match(/[,]/)\n}\n\n/** Check window size. */\nexport function checkSize() {\n $('#resetSizeButton').style.display = isElectron\n ? numara.isResized() && !numara.isMaximized()\n ? 'block'\n : 'none'\n : 'none'\n}\n\n/** Minimize/maximize window. */\nexport function toggleMinMax() {\n if (numara.isMaximized()) {\n numara.unmaximize()\n } else {\n numara.maximize()\n }\n}\n\n/** Check for app updates */\nexport function checkUpdates() {\n if (isElectron) {\n numara.checkUpdate()\n\n numara.notifyUpdate(() => {\n notify(\n 'Updating Numara... View update status'\n )\n\n $('#notificationDot').style.display = 'block'\n })\n\n numara.updateStatus((event, status) => {\n if (status === 'ready') {\n $('#dialog-about-updateStatus').innerHTML = 'Restart Numara to finish updating.'\n $('#restartButton').style.display = 'inline-block'\n\n if (!$('#dialog-about').classList.contains('uk-open')) {\n notify(\n 'Restart Numara to finish updating. Restart Now'\n )\n }\n } else {\n $('#dialog-about-updateStatus').innerHTML = status\n }\n })\n }\n}\n", "import { $, app } from './common'\n\nimport UIkit from 'uikit'\n\n/**\n * Show modal dialog for given id.\n *\n * @param {string} id Modal Id.\n */\nexport function showModal(id) {\n UIkit.modal(id, { bgClose: false, stack: true }).show()\n}\n\n/**\n * Show error dialog.\n *\n * @param {string} title Title of dialog box.\n * @param {string} e Error message to show.\n */\nexport function showError(title, error) {\n UIkit.util.on('#dialog-error', 'beforeshow', () => {\n $('#errTitle').innerHTML = title\n $('#errMsg').innerHTML = error\n })\n\n showModal('#dialog-error')\n}\n\n/**\n * Show app notifications.\n *\n * @param {string} msg Notification to show.\n * @param {string} stat Notification status: primary | success | warning | danger\n */\nexport function notify(msg, stat) {\n UIkit.notification({\n message: msg,\n pos: app.settings.notifyLocation,\n status: stat || 'primary',\n timeout: +app.settings.notifyDuration\n })\n}\n\n/**\n * Show confirmation dialog.\n *\n * @param {string} msg Confirmation message to show.\n * @param {function} action Function to run upon selecting Yes.\n */\nexport function confirm(msg, action) {\n $('#confirmMsg').innerHTML = msg\n\n showModal('#dialog-confirm')\n\n const yesAction = (event) => {\n action()\n\n event.stopPropagation()\n\n UIkit.modal('#dialog-confirm').hide()\n\n $('#confirm-yes').removeEventListener('click', yesAction)\n }\n\n $('#confirm-yes').addEventListener('click', yesAction)\n\n UIkit.util.on('#dialog-confirm', 'hidden', () => {\n $('#confirm-yes').removeEventListener('click', yesAction)\n })\n}\n", "import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.4.4\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n", "import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 ao\u00FBt 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 d\u00EDa\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"ma\u00F1ana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n", "import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n", "// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n", "import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n", "import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n", "/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n", "/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n", "import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n", "import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n", "import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n", "import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n", "import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n", "/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n", "import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n", "import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n", "import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n", "export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n", "import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n", "import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 \u2013 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 \u2013 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7\u20138 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 \u2013 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 \u2013 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' \u2013 '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" \u2013 \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n", "import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '\u0661'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabi\u02BB I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> '\u0627\u0644\u0627\u062B\u0646\u064A\u0646'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ '\u1014\u1036\u1014\u1000\u103A', '\u100A\u1014\u1031' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant J\u00E9sus-Christ', 'apr\u00E8s J\u00E9sus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n", "import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n", "import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport function explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n", "const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n", "// configuration\nexport { config } from './configReadonly.js';\n\n// functions and constants\nexport * from './pureFunctionsAny.generated.js';\nexport * from './impureFunctionsAny.generated.js';\nexport * from './typeChecks.js';\n\n// error classes\nexport { IndexError } from '../error/IndexError.js';\nexport { DimensionError } from '../error/DimensionError.js';\nexport { ArgumentsError } from '../error/ArgumentsError.js';\n\n// dependency groups\nexport * from './dependenciesAny.generated.js';\n\n// factory functions\nexport * from '../factoriesAny.js';\n\n// core\nexport { create } from '../core/create.js';\nexport { factory } from '../utils/factory.js';", "function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };", "export var DEFAULT_CONFIG = {\n // minimum relative difference between two compared values,\n // used by all comparison functions\n relTol: 1e-12,\n // minimum absolute difference between two compared values,\n // used by all comparison functions\n absTol: 1e-15,\n // type of default matrix output. Choose 'matrix' (default) or 'array'\n matrix: 'Matrix',\n // type of default number output. Choose 'number' (default) 'BigNumber', 'bigint', or 'Fraction'\n number: 'number',\n // type of fallback used for config { number: 'bigint' } when a value cannot be represented\n // in the configured numeric type. Choose 'number' (default) or 'BigNumber'.\n numberFallback: 'number',\n // number of significant digits in BigNumbers\n precision: 64,\n // predictable output type of functions. When true, output type depends only\n // on the input types. When false (default), output type can vary depending\n // on input values. For example `math.sqrt(-4)` returns `complex('2i')` when\n // predictable is false, and returns `NaN` when true.\n predictable: false,\n // random seed for seeded pseudo random number generation\n // null = randomly seed\n randomSeed: null\n};", "import { clone, deepExtend } from '../../utils/object.js';\nimport { DEFAULT_CONFIG } from '../config.js';\nexport var MATRIX_OPTIONS = ['Matrix', 'Array']; // valid values for option matrix\nexport var NUMBER_OPTIONS = ['number', 'BigNumber', 'Fraction']; // valid values for option number\n\nexport function configFactory(config, emit) {\n /**\n * Set configuration options for math.js, and get current options.\n * Will emit a 'config' event, with arguments (curr, prev, changes).\n *\n * This function is only available on a mathjs instance created using `create`.\n *\n * Syntax:\n *\n * math.config(config: Object): Object\n *\n * Examples:\n *\n *\n * import { create, all } from 'mathjs'\n *\n * // create a mathjs instance\n * const math = create(all)\n *\n * math.config().number // outputs 'number'\n * math.evaluate('0.4') // outputs number 0.4\n * math.config({number: 'Fraction'})\n * math.evaluate('0.4') // outputs Fraction 2/5\n *\n * @param {Object} [options] Available options:\n * {number} relTol\n * Minimum relative difference between two\n * compared values, used by all comparison functions.\n * {number} absTol\n * Minimum absolute difference between two\n * compared values, used by all comparison functions.\n * {string} matrix\n * A string 'Matrix' (default) or 'Array'.\n * {string} number\n * A string 'number' (default), 'BigNumber', 'bigint', or 'Fraction'\n * {number} precision\n * The number of significant digits for BigNumbers.\n * Not applicable for Numbers.\n * {string} parenthesis\n * How to display parentheses in LaTeX and string\n * output.\n * {string} randomSeed\n * Random seed for seeded pseudo random number generator.\n * Set to null to randomly seed.\n * @return {Object} Returns the current configuration\n */\n function _config(options) {\n if (options) {\n if (options.epsilon !== undefined) {\n // this if is only for backwards compatibility, it can be removed in the future.\n console.warn('Warning: The configuration option \"epsilon\" is deprecated. Use \"relTol\" and \"absTol\" instead.');\n var optionsFix = clone(options);\n optionsFix.relTol = options.epsilon;\n optionsFix.absTol = options.epsilon * 1e-3;\n delete optionsFix.epsilon;\n return _config(optionsFix);\n }\n var prev = clone(config);\n\n // validate some of the options\n validateOption(options, 'matrix', MATRIX_OPTIONS);\n validateOption(options, 'number', NUMBER_OPTIONS);\n\n // merge options\n deepExtend(config, options);\n var curr = clone(config);\n var changes = clone(options);\n\n // emit 'config' event\n emit('config', curr, prev, changes);\n return curr;\n } else {\n return clone(config);\n }\n }\n\n // attach the valid options to the function so they can be extended\n _config.MATRIX_OPTIONS = MATRIX_OPTIONS;\n _config.NUMBER_OPTIONS = NUMBER_OPTIONS;\n\n // attach the config properties as readonly properties to the config function\n Object.keys(DEFAULT_CONFIG).forEach(key => {\n Object.defineProperty(_config, key, {\n get: () => config[key],\n enumerable: true,\n configurable: true\n });\n });\n return _config;\n}\n\n/**\n * Validate an option\n * @param {Object} options Object with options\n * @param {string} name Name of the option to validate\n * @param {Array.} values Array with valid values for this option\n */\nfunction validateOption(options, name, values) {\n if (options[name] !== undefined && !values.includes(options[name])) {\n // unknown value\n console.warn('Warning: Unknown value \"' + options[name] + '\" for configuration option \"' + name + '\". ' + 'Available options: ' + values.map(value => JSON.stringify(value)).join(', ') + '.');\n }\n}", "import { isBigNumber, isObject } from './is.js';\n\n/**\n * Clone an object\n *\n * clone(x)\n *\n * Can clone any primitive type, array, and object.\n * If x has a function clone, this function will be invoked to clone the object.\n *\n * @param {*} x\n * @return {*} clone\n */\nexport function clone(x) {\n var type = typeof x;\n\n // immutable primitive types\n if (type === 'number' || type === 'bigint' || type === 'string' || type === 'boolean' || x === null || x === undefined) {\n return x;\n }\n\n // use clone function of the object when available\n if (typeof x.clone === 'function') {\n return x.clone();\n }\n\n // array\n if (Array.isArray(x)) {\n return x.map(function (value) {\n return clone(value);\n });\n }\n if (x instanceof Date) return new Date(x.valueOf());\n if (isBigNumber(x)) return x; // bignumbers are immutable\n\n // object\n if (isObject(x)) {\n return mapObject(x, clone);\n }\n throw new TypeError(\"Cannot clone: unknown type of value (value: \".concat(x, \")\"));\n}\n\n/**\n * Apply map to all properties of an object\n * @param {Object} object\n * @param {function} callback\n * @return {Object} Returns a copy of the object with mapped properties\n */\nexport function mapObject(object, callback) {\n var clone = {};\n for (var key in object) {\n if (hasOwnProperty(object, key)) {\n clone[key] = callback(object[key]);\n }\n }\n return clone;\n}\n\n/**\n * Extend object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n */\nexport function extend(a, b) {\n for (var prop in b) {\n if (hasOwnProperty(b, prop)) {\n a[prop] = b[prop];\n }\n }\n return a;\n}\n\n/**\n * Deep extend an object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @returns {Object}\n */\nexport function deepExtend(a, b) {\n // TODO: add support for Arrays to deepExtend\n if (Array.isArray(b)) {\n throw new TypeError('Arrays are not supported by deepExtend');\n }\n for (var prop in b) {\n // We check against prop not being in Object.prototype or Function.prototype\n // to prevent polluting for example Object.__proto__.\n if (hasOwnProperty(b, prop) && !(prop in Object.prototype) && !(prop in Function.prototype)) {\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n if (a[prop] && a[prop].constructor === Object) {\n deepExtend(a[prop], b[prop]);\n } else {\n a[prop] = b[prop];\n }\n } else if (Array.isArray(b[prop])) {\n throw new TypeError('Arrays are not supported by deepExtend');\n } else {\n a[prop] = b[prop];\n }\n }\n }\n return a;\n}\n\n/**\n * Deep test equality of all fields in two pairs of arrays or objects.\n * Compares values and functions strictly (ie. 2 is not the same as '2').\n * @param {Array | Object} a\n * @param {Array | Object} b\n * @returns {boolean}\n */\nexport function deepStrictEqual(a, b) {\n var prop, i, len;\n if (Array.isArray(a)) {\n if (!Array.isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (i = 0, len = a.length; i < len; i++) {\n if (!deepStrictEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n } else if (typeof a === 'function') {\n return a === b;\n } else if (a instanceof Object) {\n if (Array.isArray(b) || !(b instanceof Object)) {\n return false;\n }\n for (prop in a) {\n // noinspection JSUnfilteredForInLoop\n if (!(prop in b) || !deepStrictEqual(a[prop], b[prop])) {\n return false;\n }\n }\n for (prop in b) {\n // noinspection JSUnfilteredForInLoop\n if (!(prop in a)) {\n return false;\n }\n }\n return true;\n } else {\n return a === b;\n }\n}\n\n/**\n * Recursively flatten a nested object.\n * @param {Object} nestedObject\n * @return {Object} Returns the flattened object\n */\nexport function deepFlatten(nestedObject) {\n var flattenedObject = {};\n _deepFlatten(nestedObject, flattenedObject);\n return flattenedObject;\n}\n\n// helper function used by deepFlatten\nfunction _deepFlatten(nestedObject, flattenedObject) {\n for (var prop in nestedObject) {\n if (hasOwnProperty(nestedObject, prop)) {\n var value = nestedObject[prop];\n if (typeof value === 'object' && value !== null) {\n _deepFlatten(value, flattenedObject);\n } else {\n flattenedObject[prop] = value;\n }\n }\n }\n}\n\n/**\n * Test whether the current JavaScript engine supports Object.defineProperty\n * @returns {boolean} returns true if supported\n */\nexport function canDefineProperty() {\n // test needed for broken IE8 implementation\n try {\n if (Object.defineProperty) {\n Object.defineProperty({}, 'x', {\n get: function get() {\n return null;\n }\n });\n return true;\n }\n } catch (e) {}\n return false;\n}\n\n/**\n * Attach a lazy loading property to a constant.\n * The given function `fn` is called once when the property is first requested.\n *\n * @param {Object} object Object where to add the property\n * @param {string} prop Property name\n * @param {Function} valueResolver Function returning the property value. Called\n * without arguments.\n */\nexport function lazy(object, prop, valueResolver) {\n var _uninitialized = true;\n var _value;\n Object.defineProperty(object, prop, {\n get: function get() {\n if (_uninitialized) {\n _value = valueResolver();\n _uninitialized = false;\n }\n return _value;\n },\n set: function set(value) {\n _value = value;\n _uninitialized = false;\n },\n configurable: true,\n enumerable: true\n });\n}\n\n/**\n * Traverse a path into an object.\n * When a namespace is missing, it will be created\n * @param {Object} object\n * @param {string | string[]} path A dot separated string like 'name.space'\n * @return {Object} Returns the object at the end of the path\n */\nexport function traverse(object, path) {\n if (path && typeof path === 'string') {\n return traverse(object, path.split('.'));\n }\n var obj = object;\n if (path) {\n for (var i = 0; i < path.length; i++) {\n var key = path[i];\n if (!(key in obj)) {\n obj[key] = {};\n }\n obj = obj[key];\n }\n }\n return obj;\n}\n\n/**\n * A safe hasOwnProperty\n * @param {Object} object\n * @param {string} property\n */\nexport function hasOwnProperty(object, property) {\n return object && Object.hasOwnProperty.call(object, property);\n}\n\n/**\n * Test whether an object is a factory. a factory has fields:\n *\n * - factory: function (type: Object, config: Object, load: function, typed: function [, math: Object]) (required)\n * - name: string (optional)\n * - path: string A dot separated path (optional)\n * - math: boolean If true (false by default), the math namespace is passed\n * as fifth argument of the factory function\n *\n * @param {*} object\n * @returns {boolean}\n */\nexport function isLegacyFactory(object) {\n return object && typeof object.factory === 'function';\n}\n\n/**\n * Get a nested property from an object\n * @param {Object} object\n * @param {string | string[]} path\n * @returns {Object}\n */\nexport function get(object, path) {\n if (typeof path === 'string') {\n if (isPath(path)) {\n return get(object, path.split('.'));\n } else {\n return object[path];\n }\n }\n var child = object;\n for (var i = 0; i < path.length; i++) {\n var key = path[i];\n child = child ? child[key] : undefined;\n }\n return child;\n}\n\n/**\n * Set a nested property in an object\n * Mutates the object itself\n * If the path doesn't exist, it will be created\n * @param {Object} object\n * @param {string | string[]} path\n * @param {*} value\n * @returns {Object}\n */\nexport function set(object, path, value) {\n if (typeof path === 'string') {\n if (isPath(path)) {\n return set(object, path.split('.'), value);\n } else {\n object[path] = value;\n return object;\n }\n }\n var child = object;\n for (var i = 0; i < path.length - 1; i++) {\n var key = path[i];\n if (child[key] === undefined) {\n child[key] = {};\n }\n child = child[key];\n }\n if (path.length > 0) {\n var lastKey = path[path.length - 1];\n child[lastKey] = value;\n }\n return object;\n}\n\n/**\n * Create an object composed of the picked object properties\n * @param {Object} object\n * @param {string[]} properties\n * @param {function} [transform] Optional value to transform a value when picking it\n * @return {Object}\n */\nexport function pick(object, properties, transform) {\n var copy = {};\n for (var i = 0; i < properties.length; i++) {\n var key = properties[i];\n var value = get(object, key);\n if (value !== undefined) {\n set(copy, key, transform ? transform(value, key) : value);\n }\n }\n return copy;\n}\n\n/**\n * Shallow version of pick, creating an object composed of the picked object properties\n * but not for nested properties\n * @param {Object} object\n * @param {string[]} properties\n * @return {Object}\n */\nexport function pickShallow(object, properties) {\n var copy = {};\n for (var i = 0; i < properties.length; i++) {\n var key = properties[i];\n var value = object[key];\n if (value !== undefined) {\n copy[key] = value;\n }\n }\n return copy;\n}\n\n// helper function to test whether a string contains a path like 'user.name'\nfunction isPath(str) {\n return str.includes('.');\n}", "// type checks for all known types\n//\n// note that:\n//\n// - check by duck-typing on a property like `isUnit`, instead of checking instanceof.\n// instanceof cannot be used because that would not allow to pass data from\n// one instance of math.js to another since each has it's own instance of Unit.\n// - check the `isUnit` property via the constructor, so there will be no\n// matches for \"fake\" instances like plain objects with a property `isUnit`.\n// That is important for security reasons.\n// - It must not be possible to override the type checks used internally,\n// for security reasons, so these functions are not exposed in the expression\n// parser.\n\nexport function isNumber(x) {\n return typeof x === 'number';\n}\nexport function isBigNumber(x) {\n if (!x || typeof x !== 'object' || typeof x.constructor !== 'function') {\n return false;\n }\n if (x.isBigNumber === true && typeof x.constructor.prototype === 'object' && x.constructor.prototype.isBigNumber === true) {\n return true;\n }\n if (typeof x.constructor.isDecimal === 'function' && x.constructor.isDecimal(x) === true) {\n return true;\n }\n return false;\n}\nexport function isBigInt(x) {\n return typeof x === 'bigint';\n}\nexport function isComplex(x) {\n return x && typeof x === 'object' && Object.getPrototypeOf(x).isComplex === true || false;\n}\nexport function isFraction(x) {\n return x && typeof x === 'object' && Object.getPrototypeOf(x).isFraction === true || false;\n}\nexport function isUnit(x) {\n return x && x.constructor.prototype.isUnit === true || false;\n}\nexport function isString(x) {\n return typeof x === 'string';\n}\nexport var isArray = Array.isArray;\nexport function isMatrix(x) {\n return x && x.constructor.prototype.isMatrix === true || false;\n}\n\n/**\n * Test whether a value is a collection: an Array or Matrix\n * @param {*} x\n * @returns {boolean} isCollection\n */\nexport function isCollection(x) {\n return Array.isArray(x) || isMatrix(x);\n}\nexport function isDenseMatrix(x) {\n return x && x.isDenseMatrix && x.constructor.prototype.isMatrix === true || false;\n}\nexport function isSparseMatrix(x) {\n return x && x.isSparseMatrix && x.constructor.prototype.isMatrix === true || false;\n}\nexport function isRange(x) {\n return x && x.constructor.prototype.isRange === true || false;\n}\nexport function isIndex(x) {\n return x && x.constructor.prototype.isIndex === true || false;\n}\nexport function isBoolean(x) {\n return typeof x === 'boolean';\n}\nexport function isResultSet(x) {\n return x && x.constructor.prototype.isResultSet === true || false;\n}\nexport function isHelp(x) {\n return x && x.constructor.prototype.isHelp === true || false;\n}\nexport function isFunction(x) {\n return typeof x === 'function';\n}\nexport function isDate(x) {\n return x instanceof Date;\n}\nexport function isRegExp(x) {\n return x instanceof RegExp;\n}\nexport function isObject(x) {\n return !!(x && typeof x === 'object' && x.constructor === Object && !isComplex(x) && !isFraction(x));\n}\nexport function isNull(x) {\n return x === null;\n}\nexport function isUndefined(x) {\n return x === undefined;\n}\nexport function isAccessorNode(x) {\n return x && x.isAccessorNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isArrayNode(x) {\n return x && x.isArrayNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isAssignmentNode(x) {\n return x && x.isAssignmentNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isBlockNode(x) {\n return x && x.isBlockNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isConditionalNode(x) {\n return x && x.isConditionalNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isConstantNode(x) {\n return x && x.isConstantNode === true && x.constructor.prototype.isNode === true || false;\n}\n\n/* Very specialized: returns true for those nodes which in the numerator of\n a fraction means that the division in that fraction has precedence over implicit\n multiplication, e.g. -2/3 x parses as (-2/3) x and 3/4 x parses as (3/4) x but\n 6!/8 x parses as 6! / (8x). It is located here because it is shared between\n parse.js and OperatorNode.js (for parsing and printing, respectively).\n\n This should *not* be exported from mathjs, unlike most of the tests here.\n Its name does not start with 'is' to prevent utils/snapshot.js from thinking\n it should be exported.\n*/\nexport function rule2Node(node) {\n return isConstantNode(node) || isOperatorNode(node) && node.args.length === 1 && isConstantNode(node.args[0]) && '-+~'.includes(node.op);\n}\nexport function isFunctionAssignmentNode(x) {\n return x && x.isFunctionAssignmentNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isFunctionNode(x) {\n return x && x.isFunctionNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isIndexNode(x) {\n return x && x.isIndexNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isNode(x) {\n return x && x.isNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isObjectNode(x) {\n return x && x.isObjectNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isOperatorNode(x) {\n return x && x.isOperatorNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isParenthesisNode(x) {\n return x && x.isParenthesisNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isRangeNode(x) {\n return x && x.isRangeNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isRelationalNode(x) {\n return x && x.isRelationalNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isSymbolNode(x) {\n return x && x.isSymbolNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isChain(x) {\n return x && x.constructor.prototype.isChain === true || false;\n}\nexport function typeOf(x) {\n var t = typeof x;\n if (t === 'object') {\n if (x === null) return 'null';\n if (isBigNumber(x)) return 'BigNumber'; // Special: weird mashup with Decimal\n if (x.constructor && x.constructor.name) return x.constructor.name;\n return 'Object'; // just in case\n }\n return t; // can be 'string', 'number', 'boolean', 'function', 'bigint', ...\n}", "export { createTyped } from './core/function/typed.js';\nexport { createResultSet } from './type/resultset/ResultSet.js';\nexport { createBigNumberClass } from './type/bignumber/BigNumber.js';\nexport { createComplexClass } from './type/complex/Complex.js';\nexport { createFractionClass } from './type/fraction/Fraction.js';\nexport { createRangeClass } from './type/matrix/Range.js';\nexport { createMatrixClass } from './type/matrix/Matrix.js';\nexport { createDenseMatrixClass } from './type/matrix/DenseMatrix.js';\nexport { createClone } from './function/utils/clone.js';\nexport { createIsInteger } from './function/utils/isInteger.js';\nexport { createIsNegative } from './function/utils/isNegative.js';\nexport { createIsNumeric } from './function/utils/isNumeric.js';\nexport { createHasNumericValue } from './function/utils/hasNumericValue.js';\nexport { createIsPositive } from './function/utils/isPositive.js';\nexport { createIsZero } from './function/utils/isZero.js';\nexport { createIsNaN } from './function/utils/isNaN.js';\nexport { createTypeOf } from './function/utils/typeOf.js';\nexport { createEqualScalar } from './function/relational/equalScalar.js';\nexport { createSparseMatrixClass } from './type/matrix/SparseMatrix.js';\nexport { createNumber } from './type/number.js';\nexport { createBigint } from './type/bigint.js';\nexport { createString } from './type/string.js';\nexport { createBoolean } from './type/boolean.js';\nexport { createBignumber } from './type/bignumber/function/bignumber.js';\nexport { createComplex } from './type/complex/function/complex.js';\nexport { createFraction } from './type/fraction/function/fraction.js';\nexport { createMatrix } from './type/matrix/function/matrix.js';\nexport { createMatrixFromFunction } from './function/matrix/matrixFromFunction.js';\nexport { createMatrixFromRows } from './function/matrix/matrixFromRows.js';\nexport { createMatrixFromColumns } from './function/matrix/matrixFromColumns.js';\nexport { createSplitUnit } from './type/unit/function/splitUnit.js';\nexport { createUnaryMinus } from './function/arithmetic/unaryMinus.js';\nexport { createUnaryPlus } from './function/arithmetic/unaryPlus.js';\nexport { createAbs } from './function/arithmetic/abs.js';\nexport { createApply } from './function/matrix/apply.js';\nexport { createAddScalar } from './function/arithmetic/addScalar.js';\nexport { createSubtractScalar } from './function/arithmetic/subtractScalar.js';\nexport { createCbrt } from './function/arithmetic/cbrt.js';\nexport { createCeil } from './function/arithmetic/ceil.js';\nexport { createCube } from './function/arithmetic/cube.js';\nexport { createExp } from './function/arithmetic/exp.js';\nexport { createExpm1 } from './function/arithmetic/expm1.js';\nexport { createFix } from './function/arithmetic/fix.js';\nexport { createFloor } from './function/arithmetic/floor.js';\nexport { createGcd } from './function/arithmetic/gcd.js';\nexport { createLcm } from './function/arithmetic/lcm.js';\nexport { createLog10 } from './function/arithmetic/log10.js';\nexport { createLog2 } from './function/arithmetic/log2.js';\nexport { createMod } from './function/arithmetic/mod.js';\nexport { createMultiplyScalar } from './function/arithmetic/multiplyScalar.js';\nexport { createMultiply } from './function/arithmetic/multiply.js';\nexport { createNthRoot } from './function/arithmetic/nthRoot.js';\nexport { createSign } from './function/arithmetic/sign.js';\nexport { createSqrt } from './function/arithmetic/sqrt.js';\nexport { createSquare } from './function/arithmetic/square.js';\nexport { createSubtract } from './function/arithmetic/subtract.js';\nexport { createXgcd } from './function/arithmetic/xgcd.js';\nexport { createInvmod } from './function/arithmetic/invmod.js';\nexport { createDotMultiply } from './function/arithmetic/dotMultiply.js';\nexport { createBitAnd } from './function/bitwise/bitAnd.js';\nexport { createBitNot } from './function/bitwise/bitNot.js';\nexport { createBitOr } from './function/bitwise/bitOr.js';\nexport { createBitXor } from './function/bitwise/bitXor.js';\nexport { createArg } from './function/complex/arg.js';\nexport { createConj } from './function/complex/conj.js';\nexport { createIm } from './function/complex/im.js';\nexport { createRe } from './function/complex/re.js';\nexport { createNot } from './function/logical/not.js';\nexport { createOr } from './function/logical/or.js';\nexport { createXor } from './function/logical/xor.js';\nexport { createConcat } from './function/matrix/concat.js';\nexport { createColumn } from './function/matrix/column.js';\nexport { createCount } from './function/matrix/count.js';\nexport { createCross } from './function/matrix/cross.js';\nexport { createDiag } from './function/matrix/diag.js';\nexport { createFilter } from './function/matrix/filter.js';\nexport { createFlatten } from './function/matrix/flatten.js';\nexport { createForEach } from './function/matrix/forEach.js';\nexport { createGetMatrixDataType } from './function/matrix/getMatrixDataType.js';\nexport { createIdentity } from './function/matrix/identity.js';\nexport { createKron } from './function/matrix/kron.js';\nexport { createMap } from './function/matrix/map.js';\nexport { createDiff } from './function/matrix/diff.js';\nexport { createOnes } from './function/matrix/ones.js';\nexport { createRange } from './function/matrix/range.js';\nexport { createReshape } from './function/matrix/reshape.js';\nexport { createResize } from './function/matrix/resize.js';\nexport { createRotate } from './function/matrix/rotate.js';\nexport { createRotationMatrix } from './function/matrix/rotationMatrix.js';\nexport { createRow } from './function/matrix/row.js';\nexport { createSize } from './function/matrix/size.js';\nexport { createSqueeze } from './function/matrix/squeeze.js';\nexport { createSubset } from './function/matrix/subset.js';\nexport { createTranspose } from './function/matrix/transpose.js';\nexport { createCtranspose } from './function/matrix/ctranspose.js';\nexport { createZeros } from './function/matrix/zeros.js';\nexport { createFft } from './function/matrix/fft.js';\nexport { createIfft } from './function/matrix/ifft.js';\nexport { createSolveODE } from './function/numeric/solveODE.js';\nexport { createErf } from './function/special/erf.js';\nexport { createZeta } from './function/special/zeta.js';\nexport { createMode } from './function/statistics/mode.js';\nexport { createProd } from './function/statistics/prod.js';\nexport { createFormat } from './function/string/format.js';\nexport { createBin } from './function/string/bin.js';\nexport { createOct } from './function/string/oct.js';\nexport { createHex } from './function/string/hex.js';\nexport { createPrint } from './function/string/print.js';\nexport { createTo } from './function/unit/to.js';\nexport { createIsPrime } from './function/utils/isPrime.js';\nexport { createNumeric } from './function/utils/numeric.js';\nexport { createDivideScalar } from './function/arithmetic/divideScalar.js';\nexport { createPow } from './function/arithmetic/pow.js';\nexport { createRound } from './function/arithmetic/round.js';\nexport { createLog } from './function/arithmetic/log.js';\nexport { createLog1p } from './function/arithmetic/log1p.js';\nexport { createNthRoots } from './function/arithmetic/nthRoots.js';\nexport { createDotPow } from './function/arithmetic/dotPow.js';\nexport { createDotDivide } from './function/arithmetic/dotDivide.js';\nexport { createLsolve } from './function/algebra/solver/lsolve.js';\nexport { createUsolve } from './function/algebra/solver/usolve.js';\nexport { createLsolveAll } from './function/algebra/solver/lsolveAll.js';\nexport { createUsolveAll } from './function/algebra/solver/usolveAll.js';\nexport { createLeftShift } from './function/bitwise/leftShift.js';\nexport { createRightArithShift } from './function/bitwise/rightArithShift.js';\nexport { createRightLogShift } from './function/bitwise/rightLogShift.js';\nexport { createAnd } from './function/logical/and.js';\nexport { createCompare } from './function/relational/compare.js';\nexport { createCompareNatural } from './function/relational/compareNatural.js';\nexport { createCompareText } from './function/relational/compareText.js';\nexport { createEqual } from './function/relational/equal.js';\nexport { createEqualText } from './function/relational/equalText.js';\nexport { createSmaller } from './function/relational/smaller.js';\nexport { createSmallerEq } from './function/relational/smallerEq.js';\nexport { createLarger } from './function/relational/larger.js';\nexport { createLargerEq } from './function/relational/largerEq.js';\nexport { createDeepEqual } from './function/relational/deepEqual.js';\nexport { createUnequal } from './function/relational/unequal.js';\nexport { createPartitionSelect } from './function/matrix/partitionSelect.js';\nexport { createSort } from './function/matrix/sort.js';\nexport { createMax } from './function/statistics/max.js';\nexport { createMin } from './function/statistics/min.js';\nexport { createImmutableDenseMatrixClass } from './type/matrix/ImmutableDenseMatrix.js';\nexport { createIndexClass } from './type/matrix/MatrixIndex.js';\nexport { createFibonacciHeapClass } from './type/matrix/FibonacciHeap.js';\nexport { createSpaClass } from './type/matrix/Spa.js';\nexport { createUnitClass } from './type/unit/Unit.js';\nexport { createUnitFunction } from './type/unit/function/unit.js';\nexport { createSparse } from './type/matrix/function/sparse.js';\nexport { createCreateUnit } from './type/unit/function/createUnit.js';\nexport { createAcos } from './function/trigonometry/acos.js';\nexport { createAcosh } from './function/trigonometry/acosh.js';\nexport { createAcot } from './function/trigonometry/acot.js';\nexport { createAcoth } from './function/trigonometry/acoth.js';\nexport { createAcsc } from './function/trigonometry/acsc.js';\nexport { createAcsch } from './function/trigonometry/acsch.js';\nexport { createAsec } from './function/trigonometry/asec.js';\nexport { createAsech } from './function/trigonometry/asech.js';\nexport { createAsin } from './function/trigonometry/asin.js';\nexport { createAsinh } from './function/trigonometry/asinh.js';\nexport { createAtan } from './function/trigonometry/atan.js';\nexport { createAtan2 } from './function/trigonometry/atan2.js';\nexport { createAtanh } from './function/trigonometry/atanh.js';\nexport { createCos } from './function/trigonometry/cos.js';\nexport { createCosh } from './function/trigonometry/cosh.js';\nexport { createCot } from './function/trigonometry/cot.js';\nexport { createCoth } from './function/trigonometry/coth.js';\nexport { createCsc } from './function/trigonometry/csc.js';\nexport { createCsch } from './function/trigonometry/csch.js';\nexport { createSec } from './function/trigonometry/sec.js';\nexport { createSech } from './function/trigonometry/sech.js';\nexport { createSin } from './function/trigonometry/sin.js';\nexport { createSinh } from './function/trigonometry/sinh.js';\nexport { createTan } from './function/trigonometry/tan.js';\nexport { createTanh } from './function/trigonometry/tanh.js';\nexport { createSetCartesian } from './function/set/setCartesian.js';\nexport { createSetDifference } from './function/set/setDifference.js';\nexport { createSetDistinct } from './function/set/setDistinct.js';\nexport { createSetIntersect } from './function/set/setIntersect.js';\nexport { createSetIsSubset } from './function/set/setIsSubset.js';\nexport { createSetMultiplicity } from './function/set/setMultiplicity.js';\nexport { createSetPowerset } from './function/set/setPowerset.js';\nexport { createSetSize } from './function/set/setSize.js';\nexport { createSetSymDifference } from './function/set/setSymDifference.js';\nexport { createSetUnion } from './function/set/setUnion.js';\nexport { createAdd } from './function/arithmetic/add.js';\nexport { createHypot } from './function/arithmetic/hypot.js';\nexport { createNorm } from './function/arithmetic/norm.js';\nexport { createDot } from './function/matrix/dot.js';\nexport { createTrace } from './function/matrix/trace.js';\nexport { createIndex } from './type/matrix/function/index.js';\nexport { createNode } from './expression/node/Node.js';\nexport { createAccessorNode } from './expression/node/AccessorNode.js';\nexport { createArrayNode } from './expression/node/ArrayNode.js';\nexport { createAssignmentNode } from './expression/node/AssignmentNode.js';\nexport { createBlockNode } from './expression/node/BlockNode.js';\nexport { createConditionalNode } from './expression/node/ConditionalNode.js';\nexport { createConstantNode } from './expression/node/ConstantNode.js';\nexport { createFunctionAssignmentNode } from './expression/node/FunctionAssignmentNode.js';\nexport { createIndexNode } from './expression/node/IndexNode.js';\nexport { createObjectNode } from './expression/node/ObjectNode.js';\nexport { createOperatorNode } from './expression/node/OperatorNode.js';\nexport { createParenthesisNode } from './expression/node/ParenthesisNode.js';\nexport { createRangeNode } from './expression/node/RangeNode.js';\nexport { createRelationalNode } from './expression/node/RelationalNode.js';\nexport { createSymbolNode } from './expression/node/SymbolNode.js';\nexport { createFunctionNode } from './expression/node/FunctionNode.js';\nexport { createParse } from './expression/parse.js';\nexport { createCompile } from './expression/function/compile.js';\nexport { createEvaluate } from './expression/function/evaluate.js';\nexport { createParserClass } from './expression/Parser.js';\nexport { createParser } from './expression/function/parser.js';\nexport { createLup } from './function/algebra/decomposition/lup.js';\nexport { createQr } from './function/algebra/decomposition/qr.js';\nexport { createSlu } from './function/algebra/decomposition/slu.js';\nexport { createLusolve } from './function/algebra/solver/lusolve.js';\nexport { createPolynomialRoot } from './function/algebra/polynomialRoot.js';\nexport { createHelpClass } from './expression/Help.js';\nexport { createChainClass } from './type/chain/Chain.js';\nexport { createHelp } from './expression/function/help.js';\nexport { createChain } from './type/chain/function/chain.js';\nexport { createDet } from './function/matrix/det.js';\nexport { createInv } from './function/matrix/inv.js';\nexport { createPinv } from './function/matrix/pinv.js';\nexport { createEigs } from './function/matrix/eigs.js';\nexport { createExpm } from './function/matrix/expm.js';\nexport { createSqrtm } from './function/matrix/sqrtm.js';\nexport { createSylvester } from './function/algebra/sylvester.js';\nexport { createSchur } from './function/algebra/decomposition/schur.js';\nexport { createLyap } from './function/algebra/lyap.js';\nexport { createDivide } from './function/arithmetic/divide.js';\nexport { createDistance } from './function/geometry/distance.js';\nexport { createIntersect } from './function/geometry/intersect.js';\nexport { createSum } from './function/statistics/sum.js';\nexport { createCumSum } from './function/statistics/cumsum.js';\nexport { createMean } from './function/statistics/mean.js';\nexport { createMedian } from './function/statistics/median.js';\nexport { createMad } from './function/statistics/mad.js';\nexport { createVariance } from './function/statistics/variance.js';\nexport { createQuantileSeq } from './function/statistics/quantileSeq.js';\nexport { createStd } from './function/statistics/std.js';\nexport { createCorr } from './function/statistics/corr.js';\nexport { createCombinations } from './function/probability/combinations.js';\nexport { createCombinationsWithRep } from './function/probability/combinationsWithRep.js';\nexport { createGamma } from './function/probability/gamma.js';\nexport { createLgamma } from './function/probability/lgamma.js';\nexport { createFactorial } from './function/probability/factorial.js';\nexport { createKldivergence } from './function/probability/kldivergence.js';\nexport { createMultinomial } from './function/probability/multinomial.js';\nexport { createPermutations } from './function/probability/permutations.js';\nexport { createPickRandom } from './function/probability/pickRandom.js';\nexport { createRandom } from './function/probability/random.js';\nexport { createRandomInt } from './function/probability/randomInt.js';\nexport { createStirlingS2 } from './function/combinatorics/stirlingS2.js';\nexport { createBellNumbers } from './function/combinatorics/bellNumbers.js';\nexport { createCatalan } from './function/combinatorics/catalan.js';\nexport { createComposition } from './function/combinatorics/composition.js';\nexport { createLeafCount } from './function/algebra/leafCount.js';\nexport { createSimplify } from './function/algebra/simplify.js';\nexport { createSimplifyConstant } from './function/algebra/simplifyConstant.js';\nexport { createSimplifyCore } from './function/algebra/simplifyCore.js';\nexport { createResolve } from './function/algebra/resolve.js';\nexport { createSymbolicEqual } from './function/algebra/symbolicEqual.js';\nexport { createDerivative } from './function/algebra/derivative.js';\nexport { createRationalize } from './function/algebra/rationalize.js';\nexport { createZpk2tf } from './function/signal/zpk2tf.js';\nexport { createFreqz } from './function/signal/freqz.js';\nexport { createReviver } from './json/reviver.js';\nexport { createReplacer } from './json/replacer.js';\nexport { createE, createUppercaseE, createFalse, createI, createInfinity, createLN10, createLN2, createLOG10E, createLOG2E, createNaN, createNull, createPhi, createPi, createUppercasePi, createSQRT1_2,\n// eslint-disable-line camelcase\ncreateSQRT2, createTau, createTrue, createVersion } from './constants.js';\nexport { createAtomicMass, createAvogadro, createBohrMagneton, createBohrRadius, createBoltzmann, createClassicalElectronRadius, createConductanceQuantum, createCoulomb, createDeuteronMass, createEfimovFactor, createElectricConstant, createElectronMass, createElementaryCharge, createFaraday, createFermiCoupling, createFineStructure, createFirstRadiation, createGasConstant, createGravitationConstant, createGravity, createHartreeEnergy, createInverseConductanceQuantum, createKlitzing, createLoschmidt, createMagneticConstant, createMagneticFluxQuantum, createMolarMass, createMolarMassC12, createMolarPlanckConstant, createMolarVolume, createNeutronMass, createNuclearMagneton, createPlanckCharge, createPlanckConstant, createPlanckLength, createPlanckMass, createPlanckTemperature, createPlanckTime, createProtonMass, createQuantumOfCirculation, createReducedPlanckConstant, createRydberg, createSackurTetrode, createSecondRadiation, createSpeedOfLight, createStefanBoltzmann, createThomsonCrossSection, createVacuumImpedance, createWeakMixingAngle, createWienDisplacement } from './type/unit/physicalConstants.js';\nexport { createApplyTransform } from './expression/transform/apply.transform.js';\nexport { createColumnTransform } from './expression/transform/column.transform.js';\nexport { createFilterTransform } from './expression/transform/filter.transform.js';\nexport { createForEachTransform } from './expression/transform/forEach.transform.js';\nexport { createIndexTransform } from './expression/transform/index.transform.js';\nexport { createMapTransform } from './expression/transform/map.transform.js';\nexport { createMaxTransform } from './expression/transform/max.transform.js';\nexport { createMeanTransform } from './expression/transform/mean.transform.js';\nexport { createMinTransform } from './expression/transform/min.transform.js';\nexport { createRangeTransform } from './expression/transform/range.transform.js';\nexport { createRowTransform } from './expression/transform/row.transform.js';\nexport { createSubsetTransform } from './expression/transform/subset.transform.js';\nexport { createConcatTransform } from './expression/transform/concat.transform.js';\nexport { createDiffTransform } from './expression/transform/diff.transform.js';\nexport { createStdTransform } from './expression/transform/std.transform.js';\nexport { createSumTransform } from './expression/transform/sum.transform.js';\nexport { createQuantileSeqTransform } from './expression/transform/quantileSeq.transform.js';\nexport { createCumSumTransform } from './expression/transform/cumsum.transform.js';\nexport { createVarianceTransform } from './expression/transform/variance.transform.js';\nexport { createPrintTransform } from './expression/transform/print.transform.js';\nexport { createAndTransform } from './expression/transform/and.transform.js';\nexport { createOrTransform } from './expression/transform/or.transform.js';\nexport { createBitAndTransform } from './expression/transform/bitAnd.transform.js';\nexport { createBitOrTransform } from './expression/transform/bitOr.transform.js';", "/**\n * Create a typed-function which checks the types of the arguments and\n * can match them against multiple provided signatures. The typed-function\n * automatically converts inputs in order to find a matching signature.\n * Typed functions throw informative errors in case of wrong input arguments.\n *\n * See the library [typed-function](https://github.com/josdejong/typed-function)\n * for detailed documentation.\n *\n * Syntax:\n *\n * math.typed(name, signatures) : function\n * math.typed(signatures) : function\n *\n * Examples:\n *\n * // create a typed function with multiple types per argument (type union)\n * const fn2 = typed({\n * 'number | boolean': function (b) {\n * return 'b is a number or boolean'\n * },\n * 'string, number | boolean': function (a, b) {\n * return 'a is a string, b is a number or boolean'\n * }\n * })\n *\n * // create a typed function with an any type argument\n * const log = typed({\n * 'string, any': function (event, data) {\n * console.log('event: ' + event + ', data: ' + JSON.stringify(data))\n * }\n * })\n *\n * @param {string} [name] Optional name for the typed-function\n * @param {Object} signatures Object with one or multiple function signatures\n * @returns {function} The created typed-function.\n */\n\nimport { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigNumber, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMatrix, isNode, isNull, isNumber, isObject, isObjectNode, isOperatorNode, isParenthesisNode, isRange, isRangeNode, isRelationalNode, isRegExp, isResultSet, isSparseMatrix, isString, isSymbolNode, isUndefined, isUnit, isBigInt } from '../../utils/is.js';\nimport typedFunction from 'typed-function';\nimport { digits } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { isMap } from '../../utils/map.js';\n\n// returns a new instance of typed-function\nvar _createTyped2 = function _createTyped() {\n // initially, return the original instance of typed-function\n // consecutively, return a new instance from typed.create.\n _createTyped2 = typedFunction.create;\n return typedFunction;\n};\nvar dependencies = ['?BigNumber', '?Complex', '?DenseMatrix', '?Fraction'];\n\n/**\n * Factory function for creating a new typed instance\n * @param {Object} dependencies Object with data types like Complex and BigNumber\n * @returns {Function}\n */\nexport var createTyped = /* #__PURE__ */factory('typed', dependencies, function createTyped(_ref) {\n var {\n BigNumber,\n Complex,\n DenseMatrix,\n Fraction\n } = _ref;\n // TODO: typed-function must be able to silently ignore signatures with unknown data types\n\n // get a new instance of typed-function\n var typed = _createTyped2();\n\n // define all types. The order of the types determines in which order function\n // arguments are type-checked (so for performance it's important to put the\n // most used types first).\n typed.clear();\n typed.addTypes([{\n name: 'number',\n test: isNumber\n }, {\n name: 'Complex',\n test: isComplex\n }, {\n name: 'BigNumber',\n test: isBigNumber\n }, {\n name: 'bigint',\n test: isBigInt\n }, {\n name: 'Fraction',\n test: isFraction\n }, {\n name: 'Unit',\n test: isUnit\n },\n // The following type matches a valid variable name, i.e., an alphanumeric\n // string starting with an alphabetic character. It is used (at least)\n // in the definition of the derivative() function, as the argument telling\n // what to differentiate over must (currently) be a variable.\n {\n name: 'identifier',\n test: s => isString && /^(?:[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-\\u1C88\\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\\u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-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\u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uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])(?:[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-\\u1C88\\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\\u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\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])*$/.test(s)\n }, {\n name: 'string',\n test: isString\n }, {\n name: 'Chain',\n test: isChain\n }, {\n name: 'Array',\n test: isArray\n }, {\n name: 'Matrix',\n test: isMatrix\n }, {\n name: 'DenseMatrix',\n test: isDenseMatrix\n }, {\n name: 'SparseMatrix',\n test: isSparseMatrix\n }, {\n name: 'Range',\n test: isRange\n }, {\n name: 'Index',\n test: isIndex\n }, {\n name: 'boolean',\n test: isBoolean\n }, {\n name: 'ResultSet',\n test: isResultSet\n }, {\n name: 'Help',\n test: isHelp\n }, {\n name: 'function',\n test: isFunction\n }, {\n name: 'Date',\n test: isDate\n }, {\n name: 'RegExp',\n test: isRegExp\n }, {\n name: 'null',\n test: isNull\n }, {\n name: 'undefined',\n test: isUndefined\n }, {\n name: 'AccessorNode',\n test: isAccessorNode\n }, {\n name: 'ArrayNode',\n test: isArrayNode\n }, {\n name: 'AssignmentNode',\n test: isAssignmentNode\n }, {\n name: 'BlockNode',\n test: isBlockNode\n }, {\n name: 'ConditionalNode',\n test: isConditionalNode\n }, {\n name: 'ConstantNode',\n test: isConstantNode\n }, {\n name: 'FunctionNode',\n test: isFunctionNode\n }, {\n name: 'FunctionAssignmentNode',\n test: isFunctionAssignmentNode\n }, {\n name: 'IndexNode',\n test: isIndexNode\n }, {\n name: 'Node',\n test: isNode\n }, {\n name: 'ObjectNode',\n test: isObjectNode\n }, {\n name: 'OperatorNode',\n test: isOperatorNode\n }, {\n name: 'ParenthesisNode',\n test: isParenthesisNode\n }, {\n name: 'RangeNode',\n test: isRangeNode\n }, {\n name: 'RelationalNode',\n test: isRelationalNode\n }, {\n name: 'SymbolNode',\n test: isSymbolNode\n }, {\n name: 'Map',\n test: isMap\n }, {\n name: 'Object',\n test: isObject\n } // order 'Object' last, it matches on other classes too\n ]);\n typed.addConversions([{\n from: 'number',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n\n // note: conversion from number to BigNumber can fail if x has >15 digits\n if (digits(x) > 15) {\n throw new TypeError('Cannot implicitly convert a number with >15 significant digits to BigNumber ' + '(value: ' + x + '). ' + 'Use function bignumber(x) to convert to BigNumber.');\n }\n return new BigNumber(x);\n }\n }, {\n from: 'number',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x, 0);\n }\n }, {\n from: 'BigNumber',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x.toNumber(), 0);\n }\n }, {\n from: 'bigint',\n to: 'number',\n convert: function convert(x) {\n if (x > Number.MAX_SAFE_INTEGER) {\n throw new TypeError('Cannot implicitly convert bigint to number: ' + 'value exceeds the max safe integer value (value: ' + x + ')');\n }\n return Number(x);\n }\n }, {\n from: 'bigint',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n return new BigNumber(x.toString());\n }\n }, {\n from: 'bigint',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n return new Fraction(x.toString());\n }\n }, {\n from: 'Fraction',\n to: 'BigNumber',\n convert: function convert(x) {\n 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.');\n }\n }, {\n from: 'Fraction',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x.valueOf(), 0);\n }\n }, {\n from: 'number',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n var f = new Fraction(x);\n if (f.valueOf() !== x) {\n throw new TypeError('Cannot implicitly convert a number to a Fraction when there will be a loss of precision ' + '(value: ' + x + '). ' + 'Use function fraction(x) to convert to Fraction.');\n }\n return f;\n }\n }, {\n // FIXME: add conversion from Fraction to number, for example for `sqrt(fraction(1,3))`\n // from: 'Fraction',\n // to: 'number',\n // convert: function (x) {\n // return x.valueOf()\n // }\n // }, {\n from: 'string',\n to: 'number',\n convert: function convert(x) {\n var n = Number(x);\n if (isNaN(n)) {\n throw new Error('Cannot convert \"' + x + '\" to a number');\n }\n return n;\n }\n }, {\n from: 'string',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n try {\n return new BigNumber(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to BigNumber');\n }\n }\n }, {\n from: 'string',\n to: 'bigint',\n convert: function convert(x) {\n try {\n return BigInt(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to BigInt');\n }\n }\n }, {\n from: 'string',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n try {\n return new Fraction(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to Fraction');\n }\n }\n }, {\n from: 'string',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n try {\n return new Complex(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to Complex');\n }\n }\n }, {\n from: 'boolean',\n to: 'number',\n convert: function convert(x) {\n return +x;\n }\n }, {\n from: 'boolean',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n return new BigNumber(+x);\n }\n }, {\n from: 'boolean',\n to: 'bigint',\n convert: function convert(x) {\n return BigInt(+x);\n }\n }, {\n from: 'boolean',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n return new Fraction(+x);\n }\n }, {\n from: 'boolean',\n to: 'string',\n convert: function convert(x) {\n return String(x);\n }\n }, {\n from: 'Array',\n to: 'Matrix',\n convert: function convert(array) {\n if (!DenseMatrix) {\n throwNoMatrix();\n }\n return new DenseMatrix(array);\n }\n }, {\n from: 'Matrix',\n to: 'Array',\n convert: function convert(matrix) {\n return matrix.valueOf();\n }\n }]);\n\n // Provide a suggestion on how to call a function elementwise\n // This was added primarily as guidance for the v10 -> v11 transition,\n // and could potentially be removed in the future if it no longer seems\n // to be helpful.\n typed.onMismatch = (name, args, signatures) => {\n var usualError = typed.createError(name, args, signatures);\n if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && isCollection(args[0]) &&\n // check if the function can be unary:\n signatures.some(sig => !sig.params.includes(','))) {\n var err = new TypeError(\"Function '\".concat(name, \"' doesn't apply to matrices. To call it \") + \"elementwise on a matrix 'M', try 'map(M, \".concat(name, \")'.\"));\n err.data = usualError.data;\n throw err;\n }\n throw usualError;\n };\n\n // Provide a suggestion on how to call a function elementwise\n // This was added primarily as guidance for the v10 -> v11 transition,\n // and could potentially be removed in the future if it no longer seems\n // to be helpful.\n typed.onMismatch = (name, args, signatures) => {\n var usualError = typed.createError(name, args, signatures);\n if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && isCollection(args[0]) &&\n // check if the function can be unary:\n signatures.some(sig => !sig.params.includes(','))) {\n var err = new TypeError(\"Function '\".concat(name, \"' doesn't apply to matrices. To call it \") + \"elementwise on a matrix 'M', try 'map(M, \".concat(name, \")'.\"));\n err.data = usualError.data;\n throw err;\n }\n throw usualError;\n };\n return typed;\n});\nfunction throwNoBignumber(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a BigNumber: no class 'BigNumber' provided\"));\n}\nfunction throwNoComplex(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a Complex number: no class 'Complex' provided\"));\n}\nfunction throwNoMatrix() {\n throw new Error('Cannot convert array into a Matrix: no class \\'DenseMatrix\\' provided');\n}\nfunction throwNoFraction(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a Fraction, no class 'Fraction' provided.\"));\n}", "import { isBigNumber, isNumber, isObject } from './is.js';\n\n/**\n * @typedef {{sign: '+' | '-' | '', coefficients: number[], exponent: number}} SplitValue\n */\n\n/**\n * Check if a number is integer\n * @param {number | boolean} value\n * @return {boolean} isInteger\n */\nexport function isInteger(value) {\n if (typeof value === 'boolean') {\n return true;\n }\n return isFinite(value) ? value === Math.round(value) : false;\n}\n\n/**\n * Check if a string contains an integer\n * @param {string} str\n * @return {boolean} isInteger\n */\nexport function isIntegerStr(str) {\n // regex matching strings like \"123\" and \"-123\"\n return /^-?\\d+$/.test(str);\n}\n\n/**\n * Ensure the number type is compatible with the provided value.\n * If not, return 'number' instead.\n *\n * For example:\n *\n * safeNumberType('2.3', { number: 'bigint', numberFallback: 'number' })\n *\n * will return 'number' and not 'bigint' because trying to create a bigint with\n * value 2.3 would throw an exception.\n *\n * @param {string} numberStr\n * @param {{\n * number: 'number' | 'BigNumber' | 'bigint' | 'Fraction'\n * numberFallback: 'number' | 'BigNumber'\n * }} config\n * @returns {'number' | 'BigNumber' | 'bigint' | 'Fraction'}\n */\nexport function safeNumberType(numberStr, config) {\n if (config.number === 'bigint' && !isIntegerStr(numberStr)) {\n return config.numberFallback;\n }\n return config.number;\n}\n\n/**\n * Calculate the sign of a number\n * @param {number} x\n * @returns {number}\n */\nexport var sign = Math.sign || function (x) {\n if (x > 0) {\n return 1;\n } else if (x < 0) {\n return -1;\n } else {\n return 0;\n }\n};\n\n/**\n * Calculate the base-2 logarithm of a number\n * @param {number} x\n * @returns {number}\n */\nexport var log2 = Math.log2 || function log2(x) {\n return Math.log(x) / Math.LN2;\n};\n\n/**\n * Calculate the base-10 logarithm of a number\n * @param {number} x\n * @returns {number}\n */\nexport var log10 = Math.log10 || function log10(x) {\n return Math.log(x) / Math.LN10;\n};\n\n/**\n * Calculate the natural logarithm of a number + 1\n * @param {number} x\n * @returns {number}\n */\nexport var log1p = Math.log1p || function (x) {\n return Math.log(x + 1);\n};\n\n/**\n * Calculate cubic root for a number\n *\n * Code from es6-shim.js:\n * https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1564-L1577\n *\n * @param {number} x\n * @returns {number} Returns the cubic root of x\n */\nexport var cbrt = Math.cbrt || function cbrt(x) {\n if (x === 0) {\n return x;\n }\n var negate = x < 0;\n var result;\n if (negate) {\n x = -x;\n }\n if (isFinite(x)) {\n result = Math.exp(Math.log(x) / 3);\n // from https://en.wikipedia.org/wiki/Cube_root#Numerical_methods\n result = (x / (result * result) + 2 * result) / 3;\n } else {\n result = x;\n }\n return negate ? -result : result;\n};\n\n/**\n * Calculates exponentiation minus 1\n * @param {number} x\n * @return {number} res\n */\nexport var expm1 = Math.expm1 || function expm1(x) {\n return x >= 2e-4 || x <= -2e-4 ? Math.exp(x) - 1 : x + x * x / 2 + x * x * x / 6;\n};\n\n/**\n * Formats a number in a given base\n * @param {number} n\n * @param {number} base\n * @param {number} size\n * @returns {string}\n */\nfunction formatNumberToBase(n, base, size) {\n var prefixes = {\n 2: '0b',\n 8: '0o',\n 16: '0x'\n };\n var prefix = prefixes[base];\n var suffix = '';\n if (size) {\n if (size < 1) {\n throw new Error('size must be in greater than 0');\n }\n if (!isInteger(size)) {\n throw new Error('size must be an integer');\n }\n if (n > 2 ** (size - 1) - 1 || n < -(2 ** (size - 1))) {\n throw new Error(\"Value must be in range [-2^\".concat(size - 1, \", 2^\").concat(size - 1, \"-1]\"));\n }\n if (!isInteger(n)) {\n throw new Error('Value must be an integer');\n }\n if (n < 0) {\n n = n + 2 ** size;\n }\n suffix = \"i\".concat(size);\n }\n var sign = '';\n if (n < 0) {\n n = -n;\n sign = '-';\n }\n return \"\".concat(sign).concat(prefix).concat(n.toString(base)).concat(suffix);\n}\n\n/**\n * Convert a number to a formatted string representation.\n *\n * Syntax:\n *\n * format(value)\n * format(value, options)\n * format(value, precision)\n * format(value, fn)\n *\n * Where:\n *\n * {number} value The value to be formatted\n * {Object} options An object with formatting options. Available options:\n * {string} notation\n * Number notation. Choose from:\n * 'fixed' Always use regular number notation.\n * For example '123.40' and '14000000'\n * 'exponential' Always use exponential notation.\n * For example '1.234e+2' and '1.4e+7'\n * 'engineering' Always use engineering notation.\n * For example '123.4e+0' and '14.0e+6'\n * 'auto' (default) Regular number notation for numbers\n * having an absolute value between\n * `lowerExp` and `upperExp` bounds, and\n * uses exponential notation elsewhere.\n * Lower bound is included, upper bound\n * is excluded.\n * For example '123.4' and '1.4e7'.\n * 'bin', 'oct, or\n * 'hex' Format the number using binary, octal,\n * or hexadecimal notation.\n * For example '0b1101' and '0x10fe'.\n * {number} wordSize The word size in bits to use for formatting\n * in binary, octal, or hexadecimal notation.\n * To be used only with 'bin', 'oct', or 'hex'\n * values for 'notation' option. When this option\n * is defined the value is formatted as a signed\n * twos complement integer of the given word size\n * and the size suffix is appended to the output.\n * For example\n * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'.\n * Default value is undefined.\n * {number} precision A number between 0 and 16 to round\n * the digits of the number.\n * In case of notations 'exponential',\n * 'engineering', and 'auto',\n * `precision` defines the total\n * number of significant digits returned.\n * In case of notation 'fixed',\n * `precision` defines the number of\n * significant digits after the decimal\n * point.\n * `precision` is undefined by default,\n * not rounding any digits.\n * {number} lowerExp Exponent determining the lower boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `-3`.\n * {number} upperExp Exponent determining the upper boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `5`.\n * {Function} fn A custom formatting function. Can be used to override the\n * built-in notations. Function `fn` is called with `value` as\n * parameter and must return a string. Is useful for example to\n * format all values inside a matrix in a particular way.\n *\n * Examples:\n *\n * format(6.4) // '6.4'\n * format(1240000) // '1.24e6'\n * format(1/3) // '0.3333333333333333'\n * format(1/3, 3) // '0.333'\n * format(21385, 2) // '21000'\n * format(12.071, {notation: 'fixed'}) // '12'\n * format(2.3, {notation: 'fixed', precision: 2}) // '2.30'\n * format(52.8, {notation: 'exponential'}) // '5.28e+1'\n * format(12345678, {notation: 'engineering'}) // '12.345678e+6'\n *\n * @param {number} value\n * @param {Object | Function | number} [options]\n * @return {string} str The formatted value\n */\nexport function format(value, options) {\n if (typeof options === 'function') {\n // handle format(value, fn)\n return options(value);\n }\n\n // handle special cases\n if (value === Infinity) {\n return 'Infinity';\n } else if (value === -Infinity) {\n return '-Infinity';\n } else if (isNaN(value)) {\n return 'NaN';\n }\n var {\n notation,\n precision,\n wordSize\n } = normalizeFormatOptions(options);\n\n // handle the various notations\n switch (notation) {\n case 'fixed':\n return toFixed(value, precision);\n case 'exponential':\n return toExponential(value, precision);\n case 'engineering':\n return toEngineering(value, precision);\n case 'bin':\n return formatNumberToBase(value, 2, wordSize);\n case 'oct':\n return formatNumberToBase(value, 8, wordSize);\n case 'hex':\n return formatNumberToBase(value, 16, wordSize);\n case 'auto':\n // remove trailing zeros after the decimal point\n return toPrecision(value, precision, options).replace(/((\\.\\d*?)(0+))($|e)/, function () {\n var digits = arguments[2];\n var e = arguments[4];\n return digits !== '.' ? digits + e : e;\n });\n default:\n throw new Error('Unknown notation \"' + notation + '\". ' + 'Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.');\n }\n}\n\n/**\n * Normalize format options into an object:\n * {\n * notation: string,\n * precision: number | undefined,\n * wordSize: number | undefined\n * }\n */\nexport function normalizeFormatOptions(options) {\n // default values for options\n var notation = 'auto';\n var precision;\n var wordSize;\n if (options !== undefined) {\n if (isNumber(options)) {\n precision = options;\n } else if (isBigNumber(options)) {\n precision = options.toNumber();\n } else if (isObject(options)) {\n if (options.precision !== undefined) {\n precision = _toNumberOrThrow(options.precision, () => {\n throw new Error('Option \"precision\" must be a number or BigNumber');\n });\n }\n if (options.wordSize !== undefined) {\n wordSize = _toNumberOrThrow(options.wordSize, () => {\n throw new Error('Option \"wordSize\" must be a number or BigNumber');\n });\n }\n if (options.notation) {\n notation = options.notation;\n }\n } else {\n throw new Error('Unsupported type of options, number, BigNumber, or object expected');\n }\n }\n return {\n notation,\n precision,\n wordSize\n };\n}\n\n/**\n * Split a number into sign, coefficients, and exponent\n * @param {number | string} value\n * @return {SplitValue}\n * Returns an object containing sign, coefficients, and exponent\n */\nexport function splitNumber(value) {\n // parse the input value\n var match = String(value).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/);\n if (!match) {\n throw new SyntaxError('Invalid number ' + value);\n }\n var sign = match[1];\n var digits = match[2];\n var exponent = parseFloat(match[4] || '0');\n var dot = digits.indexOf('.');\n exponent += dot !== -1 ? dot - 1 : digits.length - 1;\n var coefficients = digits.replace('.', '') // remove the dot (must be removed before removing leading zeros)\n .replace(/^0*/, function (zeros) {\n // remove leading zeros, add their count to the exponent\n exponent -= zeros.length;\n return '';\n }).replace(/0*$/, '') // remove trailing zeros\n .split('').map(function (d) {\n return parseInt(d);\n });\n if (coefficients.length === 0) {\n coefficients.push(0);\n exponent++;\n }\n return {\n sign,\n coefficients,\n exponent\n };\n}\n\n/**\n * Format a number in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3'\n * @param {number | string} value\n * @param {number} [precision] Optional number of significant figures to return.\n */\nexport function toEngineering(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n var split = splitNumber(value);\n var rounded = roundDigits(split, precision);\n var e = rounded.exponent;\n var c = rounded.coefficients;\n\n // find nearest lower multiple of 3 for exponent\n var newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3;\n if (isNumber(precision)) {\n // add zeroes to give correct sig figs\n while (precision > c.length || e - newExp + 1 > c.length) {\n c.push(0);\n }\n } else {\n // concatenate coefficients with necessary zeros\n // add zeros if necessary (for example: 1e+8 -> 100e+6)\n var missingZeros = Math.abs(e - newExp) - (c.length - 1);\n for (var i = 0; i < missingZeros; i++) {\n c.push(0);\n }\n }\n\n // find difference in exponents\n var expDiff = Math.abs(e - newExp);\n var decimalIdx = 1;\n\n // push decimal index over by expDiff times\n while (expDiff > 0) {\n decimalIdx++;\n expDiff--;\n }\n\n // if all coefficient values are zero after the decimal point and precision is unset, don't add a decimal value.\n // otherwise concat with the rest of the coefficients\n var decimals = c.slice(decimalIdx).join('');\n var decimalVal = isNumber(precision) && decimals.length || decimals.match(/[1-9]/) ? '.' + decimals : '';\n var str = c.slice(0, decimalIdx).join('') + decimalVal + 'e' + (e >= 0 ? '+' : '') + newExp.toString();\n return rounded.sign + str;\n}\n\n/**\n * Format a number with fixed notation.\n * @param {number | string} value\n * @param {number} [precision=undefined] Optional number of decimals after the\n * decimal point. null by default.\n */\nexport function toFixed(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n var splitValue = splitNumber(value);\n var rounded = typeof precision === 'number' ? roundDigits(splitValue, splitValue.exponent + 1 + precision) : splitValue;\n var c = rounded.coefficients;\n var p = rounded.exponent + 1; // exponent may have changed\n\n // append zeros if needed\n var pp = p + (precision || 0);\n if (c.length < pp) {\n c = c.concat(zeros(pp - c.length));\n }\n\n // prepend zeros if needed\n if (p < 0) {\n c = zeros(-p + 1).concat(c);\n p = 1;\n }\n\n // insert a dot if needed\n if (p < c.length) {\n c.splice(p, 0, p === 0 ? '0.' : '.');\n }\n return rounded.sign + c.join('');\n}\n\n/**\n * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3'\n * @param {number | string} value\n * @param {number} [precision] Number of digits in formatted output.\n * If not provided, the maximum available digits\n * is used.\n */\nexport function toExponential(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n\n // round if needed, else create a clone\n var split = splitNumber(value);\n var rounded = precision ? roundDigits(split, precision) : split;\n var c = rounded.coefficients;\n var e = rounded.exponent;\n\n // append zeros if needed\n if (c.length < precision) {\n c = c.concat(zeros(precision - c.length));\n }\n\n // format as `C.CCCe+EEE` or `C.CCCe-EEE`\n var first = c.shift();\n return rounded.sign + first + (c.length > 0 ? '.' + c.join('') : '') + 'e' + (e >= 0 ? '+' : '') + e;\n}\n\n/**\n * Format a number with a certain precision\n * @param {number | string} value\n * @param {number} [precision=undefined] Optional number of digits.\n * @param {{lowerExp: number | undefined, upperExp: number | undefined}} [options]\n * By default:\n * lowerExp = -3 (incl)\n * upper = +5 (excl)\n * @return {string}\n */\nexport function toPrecision(value, precision, options) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n\n // determine lower and upper bound for exponential notation.\n var lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3);\n var upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5);\n var split = splitNumber(value);\n var rounded = precision ? roundDigits(split, precision) : split;\n if (rounded.exponent < lowerExp || rounded.exponent >= upperExp) {\n // exponential notation\n return toExponential(value, precision);\n } else {\n var c = rounded.coefficients;\n var e = rounded.exponent;\n\n // append trailing zeros\n if (c.length < precision) {\n c = c.concat(zeros(precision - c.length));\n }\n\n // append trailing zeros\n // TODO: simplify the next statement\n c = c.concat(zeros(e - c.length + 1 + (c.length < precision ? precision - c.length : 0)));\n\n // prepend zeros\n c = zeros(-e).concat(c);\n var dot = e > 0 ? e : 0;\n if (dot < c.length - 1) {\n c.splice(dot + 1, 0, '.');\n }\n return rounded.sign + c.join('');\n }\n}\n\n/**\n * Round the number of digits of a number *\n * @param {SplitValue} split A value split with .splitNumber(value)\n * @param {number} precision A positive integer\n * @return {SplitValue}\n * Returns an object containing sign, coefficients, and exponent\n * with rounded digits\n */\nexport function roundDigits(split, precision) {\n // create a clone\n var rounded = {\n sign: split.sign,\n coefficients: split.coefficients,\n exponent: split.exponent\n };\n var c = rounded.coefficients;\n\n // prepend zeros if needed\n while (precision <= 0) {\n c.unshift(0);\n rounded.exponent++;\n precision++;\n }\n if (c.length > precision) {\n var removed = c.splice(precision, c.length - precision);\n if (removed[0] >= 5) {\n var i = precision - 1;\n c[i]++;\n while (c[i] === 10) {\n c.pop();\n if (i === 0) {\n c.unshift(0);\n rounded.exponent++;\n i++;\n }\n i--;\n c[i]++;\n }\n }\n }\n return rounded;\n}\n\n/**\n * Create an array filled with zeros.\n * @param {number} length\n * @return {Array}\n */\nfunction zeros(length) {\n var arr = [];\n for (var i = 0; i < length; i++) {\n arr.push(0);\n }\n return arr;\n}\n\n/**\n * Count the number of significant digits of a number.\n *\n * For example:\n * 2.34 returns 3\n * 0.0034 returns 2\n * 120.5e+30 returns 4\n *\n * @param {number} value\n * @return {number} digits Number of significant digits\n */\nexport function digits(value) {\n return value.toExponential().replace(/e.*$/, '') // remove exponential notation\n .replace(/^0\\.?0*|\\./, '') // remove decimal point and leading zeros\n .length;\n}\n\n/**\n * Minimum number added to one that makes the result different than one\n */\nexport var DBL_EPSILON = Number.EPSILON || 2.2204460492503130808472633361816E-16;\n\n/**\n * Compares two floating point numbers.\n * @param {number} a - First value to compare\n * @param {number} b - Second value to compare\n * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0.\n * @param {number} [absTol=1e-12] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0.\n * @return {boolean} whether the two numbers are nearly equal\n *\n * @throws {Error} If `relTol` is less than or equal to 0.\n * @throws {Error} If `absTol` is less than 0.\n *\n * @example\n * nearlyEqual(1.000000001, 1.0, 1e-8); // true\n * nearlyEqual(1.000000002, 1.0, 0); // false\n * nearlyEqual(1.0, 1.009, undefined, 0.01); // true\n * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true\n */\nexport function nearlyEqual(a, b) {\n var relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-8;\n var absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n if (relTol <= 0) {\n throw new Error('Relative tolerance must be greater than 0');\n }\n if (absTol < 0) {\n throw new Error('Absolute tolerance must be at least 0');\n }\n\n // NaN\n if (isNaN(a) || isNaN(b)) {\n return false;\n }\n if (!isFinite(a) || !isFinite(b)) {\n return a === b;\n }\n if (a === b) {\n return true;\n }\n\n // abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)\n return Math.abs(a - b) <= Math.max(relTol * Math.max(Math.abs(a), Math.abs(b)), absTol);\n}\n\n/**\n * Calculate the hyperbolic arccos of a number\n * @param {number} x\n * @return {number}\n */\nexport var acosh = Math.acosh || function (x) {\n return Math.log(Math.sqrt(x * x - 1) + x);\n};\nexport var asinh = Math.asinh || function (x) {\n return Math.log(Math.sqrt(x * x + 1) + x);\n};\n\n/**\n * Calculate the hyperbolic arctangent of a number\n * @param {number} x\n * @return {number}\n */\nexport var atanh = Math.atanh || function (x) {\n return Math.log((1 + x) / (1 - x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic cosine of a number\n * @param {number} x\n * @returns {number}\n */\nexport var cosh = Math.cosh || function (x) {\n return (Math.exp(x) + Math.exp(-x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic sine of a number\n * @param {number} x\n * @returns {number}\n */\nexport var sinh = Math.sinh || function (x) {\n return (Math.exp(x) - Math.exp(-x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic tangent of a number\n * @param {number} x\n * @returns {number}\n */\nexport var tanh = Math.tanh || function (x) {\n var e = Math.exp(2 * x);\n return (e - 1) / (e + 1);\n};\n\n/**\n * Returns a value with the magnitude of x and the sign of y.\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\nexport function copysign(x, y) {\n var signx = x > 0 ? true : x < 0 ? false : 1 / x === Infinity;\n var signy = y > 0 ? true : y < 0 ? false : 1 / y === Infinity;\n return signx ^ signy ? -x : x;\n}\nfunction _toNumberOrThrow(value, onError) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n onError();\n }\n}\nfunction _toNumberOrDefault(value, defaultValue) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n return defaultValue;\n }\n}", "import { pickShallow } from './object.js';\n\n/**\n * Create a factory function, which can be used to inject dependencies.\n *\n * The created functions are memoized, a consecutive call of the factory\n * with the exact same inputs will return the same function instance.\n * The memoized cache is exposed on `factory.cache` and can be cleared\n * if needed.\n *\n * Example:\n *\n * const name = 'log'\n * const dependencies = ['config', 'typed', 'divideScalar', 'Complex']\n *\n * export const createLog = factory(name, dependencies, ({ typed, config, divideScalar, Complex }) => {\n * // ... create the function log here and return it\n * }\n *\n * @param {string} name Name of the function to be created\n * @param {string[]} dependencies The names of all required dependencies\n * @param {function} create Callback function called with an object with all dependencies\n * @param {Object} [meta] Optional object with meta information that will be attached\n * to the created factory function as property `meta`.\n * @returns {function}\n */\nexport function factory(name, dependencies, create, meta) {\n function assertAndCreate(scope) {\n // we only pass the requested dependencies to the factory function\n // to prevent functions to rely on dependencies that are not explicitly\n // requested.\n var deps = pickShallow(scope, dependencies.map(stripOptionalNotation));\n assertDependencies(name, dependencies, scope);\n return create(deps);\n }\n assertAndCreate.isFactory = true;\n assertAndCreate.fn = name;\n assertAndCreate.dependencies = dependencies.slice().sort();\n if (meta) {\n assertAndCreate.meta = meta;\n }\n return assertAndCreate;\n}\n\n/**\n * Sort all factories such that when loading in order, the dependencies are resolved.\n *\n * @param {Array} factories\n * @returns {Array} Returns a new array with the sorted factories.\n */\nexport function sortFactories(factories) {\n var factoriesByName = {};\n factories.forEach(factory => {\n factoriesByName[factory.fn] = factory;\n });\n function containsDependency(factory, dependency) {\n // TODO: detect circular references\n if (isFactory(factory)) {\n if (factory.dependencies.includes(dependency.fn || dependency.name)) {\n return true;\n }\n if (factory.dependencies.some(d => containsDependency(factoriesByName[d], dependency))) {\n return true;\n }\n }\n return false;\n }\n var sorted = [];\n function addFactory(factory) {\n var index = 0;\n while (index < sorted.length && !containsDependency(sorted[index], factory)) {\n index++;\n }\n sorted.splice(index, 0, factory);\n }\n\n // sort regular factory functions\n factories.filter(isFactory).forEach(addFactory);\n\n // sort legacy factory functions AFTER the regular factory functions\n factories.filter(factory => !isFactory(factory)).forEach(addFactory);\n return sorted;\n}\n\n// TODO: comment or cleanup if unused in the end\nexport function create(factories) {\n var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n sortFactories(factories).forEach(factory => factory(scope));\n return scope;\n}\n\n/**\n * Test whether an object is a factory. This is the case when it has\n * properties name, dependencies, and a function create.\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isFactory(obj) {\n return typeof obj === 'function' && typeof obj.fn === 'string' && Array.isArray(obj.dependencies);\n}\n\n/**\n * Assert that all dependencies of a list with dependencies are available in the provided scope.\n *\n * Will throw an exception when there are dependencies missing.\n *\n * @param {string} name Name for the function to be created. Used to generate a useful error message\n * @param {string[]} dependencies\n * @param {Object} scope\n */\nexport function assertDependencies(name, dependencies, scope) {\n var allDefined = dependencies.filter(dependency => !isOptionalDependency(dependency)) // filter optionals\n .every(dependency => scope[dependency] !== undefined);\n if (!allDefined) {\n var missingDependencies = dependencies.filter(dependency => scope[dependency] === undefined);\n\n // TODO: create a custom error class for this, a MathjsError or something like that\n throw new Error(\"Cannot create function \\\"\".concat(name, \"\\\", \") + \"some dependencies are missing: \".concat(missingDependencies.map(d => \"\\\"\".concat(d, \"\\\"\")).join(', '), \".\"));\n }\n}\nexport function isOptionalDependency(dependency) {\n return dependency && dependency[0] === '?';\n}\nexport function stripOptionalNotation(dependency) {\n return dependency && dependency[0] === '?' ? dependency.slice(1) : dependency;\n}", "import { setSafeProperty, hasSafeProperty, getSafeProperty } from './customs.js';\nimport { isObject } from './is.js';\n\n/**\n * A map facade on a bare object.\n *\n * The small number of methods needed to implement a scope,\n * forwarding on to the SafeProperty functions. Over time, the codebase\n * will stop using this method, as all objects will be Maps, rather than\n * more security prone objects.\n */\nexport class ObjectWrappingMap {\n constructor(object) {\n this.wrappedObject = object;\n this[Symbol.iterator] = this.entries;\n }\n keys() {\n return Object.keys(this.wrappedObject).values();\n }\n get(key) {\n return getSafeProperty(this.wrappedObject, key);\n }\n set(key, value) {\n setSafeProperty(this.wrappedObject, key, value);\n return this;\n }\n has(key) {\n return hasSafeProperty(this.wrappedObject, key);\n }\n entries() {\n return mapIterator(this.keys(), key => [key, this.get(key)]);\n }\n forEach(callback) {\n for (var key of this.keys()) {\n callback(this.get(key), key, this);\n }\n }\n delete(key) {\n delete this.wrappedObject[key];\n }\n clear() {\n for (var key of this.keys()) {\n this.delete(key);\n }\n }\n get size() {\n return Object.keys(this.wrappedObject).length;\n }\n}\n\n/**\n * Create a map with two partitions: a and b.\n * The set with bKeys determines which keys/values are read/written to map b,\n * all other values are read/written to map a\n *\n * For example:\n *\n * const a = new Map()\n * const b = new Map()\n * const p = new PartitionedMap(a, b, new Set(['x', 'y']))\n *\n * In this case, values `x` and `y` are read/written to map `b`,\n * all other values are read/written to map `a`.\n */\nexport class PartitionedMap {\n /**\n * @param {Map} a\n * @param {Map} b\n * @param {Set} bKeys\n */\n constructor(a, b, bKeys) {\n this.a = a;\n this.b = b;\n this.bKeys = bKeys;\n this[Symbol.iterator] = this.entries;\n }\n get(key) {\n return this.bKeys.has(key) ? this.b.get(key) : this.a.get(key);\n }\n set(key, value) {\n if (this.bKeys.has(key)) {\n this.b.set(key, value);\n } else {\n this.a.set(key, value);\n }\n return this;\n }\n has(key) {\n return this.b.has(key) || this.a.has(key);\n }\n keys() {\n return new Set([...this.a.keys(), ...this.b.keys()])[Symbol.iterator]();\n }\n entries() {\n return mapIterator(this.keys(), key => [key, this.get(key)]);\n }\n forEach(callback) {\n for (var key of this.keys()) {\n callback(this.get(key), key, this);\n }\n }\n delete(key) {\n return this.bKeys.has(key) ? this.b.delete(key) : this.a.delete(key);\n }\n clear() {\n this.a.clear();\n this.b.clear();\n }\n get size() {\n return [...this.keys()].length;\n }\n}\n\n/**\n * Create a new iterator that maps over the provided iterator, applying a mapping function to each item\n */\nfunction mapIterator(it, callback) {\n return {\n next: () => {\n var n = it.next();\n return n.done ? n : {\n value: callback(n.value),\n done: false\n };\n }\n };\n}\n\n/**\n * Creates an empty map, or whatever your platform's polyfill is.\n *\n * @returns an empty Map or Map like object.\n */\nexport function createEmptyMap() {\n return new Map();\n}\n\n/**\n * Creates a Map from the given object.\n *\n * @param { Map | { [key: string]: unknown } | undefined } mapOrObject\n * @returns\n */\nexport function createMap(mapOrObject) {\n if (!mapOrObject) {\n return createEmptyMap();\n }\n if (isMap(mapOrObject)) {\n return mapOrObject;\n }\n if (isObject(mapOrObject)) {\n return new ObjectWrappingMap(mapOrObject);\n }\n throw new Error('createMap can create maps from objects or Maps');\n}\n\n/**\n * Unwraps a map into an object.\n *\n * @param {Map} map\n * @returns { [key: string]: unknown }\n */\nexport function toObject(map) {\n if (map instanceof ObjectWrappingMap) {\n return map.wrappedObject;\n }\n var object = {};\n for (var key of map.keys()) {\n var value = map.get(key);\n setSafeProperty(object, key, value);\n }\n return object;\n}\n\n/**\n * Returns `true` if the passed object appears to be a Map (i.e. duck typing).\n *\n * Methods looked for are `get`, `set`, `keys` and `has`.\n *\n * @param {Map | object} object\n * @returns\n */\nexport function isMap(object) {\n // We can use the fast instanceof, or a slower duck typing check.\n // The duck typing method needs to cover enough methods to not be confused with DenseMatrix.\n if (!object) {\n return false;\n }\n return object instanceof Map || object instanceof ObjectWrappingMap || typeof object.set === 'function' && typeof object.get === 'function' && typeof object.keys === 'function' && typeof object.has === 'function';\n}\n\n/**\n * Copies the contents of key-value pairs from each `objects` in to `map`.\n *\n * Object is `objects` can be a `Map` or object.\n *\n * This is the `Map` analog to `Object.assign`.\n */\nexport function assign(map) {\n for (var _len = arguments.length, objects = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n objects[_key - 1] = arguments[_key];\n }\n for (var args of objects) {\n if (!args) {\n continue;\n }\n if (isMap(args)) {\n for (var key of args.keys()) {\n map.set(key, args.get(key));\n }\n } else if (isObject(args)) {\n for (var _key2 of Object.keys(args)) {\n map.set(_key2, args[_key2]);\n }\n }\n }\n return map;\n}", "import { hasOwnProperty } from './object.js';\n\n/**\n * Get a property of a plain object\n * Throws an error in case the object is not a plain object or the\n * property is not defined on the object itself\n * @param {Object} object\n * @param {string} prop\n * @return {*} Returns the property value when safe\n */\nfunction getSafeProperty(object, prop) {\n // only allow getting safe properties of a plain object\n if (isPlainObject(object) && isSafeProperty(object, prop)) {\n return object[prop];\n }\n if (typeof object[prop] === 'function' && isSafeMethod(object, prop)) {\n throw new Error('Cannot access method \"' + prop + '\" as a property');\n }\n throw new Error('No access to property \"' + prop + '\"');\n}\n\n/**\n * Set a property on a plain object.\n * Throws an error in case the object is not a plain object or the\n * property would override an inherited property like .constructor or .toString\n * @param {Object} object\n * @param {string} prop\n * @param {*} value\n * @return {*} Returns the value\n */\n// TODO: merge this function into access.js?\nfunction setSafeProperty(object, prop, value) {\n // only allow setting safe properties of a plain object\n if (isPlainObject(object) && isSafeProperty(object, prop)) {\n object[prop] = value;\n return value;\n }\n throw new Error('No access to property \"' + prop + '\"');\n}\nfunction getSafeProperties(object) {\n return Object.keys(object).filter(prop => hasOwnProperty(object, prop));\n}\nfunction hasSafeProperty(object, prop) {\n return prop in object;\n}\n\n/**\n * Test whether a property is safe to use for an object.\n * For example .toString and .constructor are not safe\n * @param {string} prop\n * @return {boolean} Returns true when safe\n */\nfunction isSafeProperty(object, prop) {\n if (!object || typeof object !== 'object') {\n return false;\n }\n // SAFE: whitelisted\n // e.g length\n if (hasOwnProperty(safeNativeProperties, prop)) {\n return true;\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (prop in Object.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Object.prototype is a root object\n return false;\n }\n // UNSAFE: inherited from Function prototype\n // e.g call, apply\n if (prop in Function.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Function.prototype is a root object\n return false;\n }\n return true;\n}\n\n/**\n * Validate whether a method is safe.\n * Throws an error when that's not the case.\n * @param {Object} object\n * @param {string} method\n * @return {function} Returns the method when valid\n */\nfunction getSafeMethod(object, method) {\n if (!isSafeMethod(object, method)) {\n throw new Error('No access to method \"' + method + '\"');\n }\n return object[method];\n}\n\n/**\n * Check whether a method is safe.\n * Throws an error when that's not the case (for example for `constructor`).\n * @param {Object} object\n * @param {string} method\n * @return {boolean} Returns true when safe, false otherwise\n */\nfunction isSafeMethod(object, method) {\n if (object === null || object === undefined || typeof object[method] !== 'function') {\n return false;\n }\n // UNSAFE: ghosted\n // e.g overridden toString\n // Note that IE10 doesn't support __proto__ and we can't do this check there.\n if (hasOwnProperty(object, method) && Object.getPrototypeOf && method in Object.getPrototypeOf(object)) {\n return false;\n }\n // SAFE: whitelisted\n // e.g toString\n if (hasOwnProperty(safeNativeMethods, method)) {\n return true;\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (method in Object.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Object.prototype is a root object\n return false;\n }\n // UNSAFE: inherited from Function prototype\n // e.g call, apply\n if (method in Function.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Function.prototype is a root object\n return false;\n }\n return true;\n}\nfunction isPlainObject(object) {\n return typeof object === 'object' && object && object.constructor === Object;\n}\nvar safeNativeProperties = {\n length: true,\n name: true\n};\nvar safeNativeMethods = {\n toString: true,\n valueOf: true,\n toLocaleString: true\n};\nexport { getSafeProperty };\nexport { setSafeProperty };\nexport { isSafeProperty };\nexport { hasSafeProperty };\nexport { getSafeProperties };\nexport { getSafeMethod };\nexport { isSafeMethod };\nexport { isPlainObject };", "import { factory } from '../../utils/factory.js';\nvar name = 'ResultSet';\nvar dependencies = [];\nexport var createResultSet = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * A ResultSet contains a list or results\n * @class ResultSet\n * @param {Array} entries\n * @constructor ResultSet\n */\n function ResultSet(entries) {\n if (!(this instanceof ResultSet)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.entries = entries || [];\n }\n\n /**\n * Attach type information\n */\n ResultSet.prototype.type = 'ResultSet';\n ResultSet.prototype.isResultSet = true;\n\n /**\n * Returns the array with results hold by this ResultSet\n * @memberof ResultSet\n * @returns {Array} entries\n */\n ResultSet.prototype.valueOf = function () {\n return this.entries;\n };\n\n /**\n * Returns the stringified results of the ResultSet\n * @memberof ResultSet\n * @returns {string} string\n */\n ResultSet.prototype.toString = function () {\n return '[' + this.entries.join(', ') + ']';\n };\n\n /**\n * Get a JSON representation of the ResultSet\n * @memberof ResultSet\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"ResultSet\", \"entries\": [...]}`\n */\n ResultSet.prototype.toJSON = function () {\n return {\n mathjs: 'ResultSet',\n entries: this.entries\n };\n };\n\n /**\n * Instantiate a ResultSet from a JSON object\n * @memberof ResultSet\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"ResultSet\", \"entries\": [...]}`\n * @return {ResultSet}\n */\n ResultSet.fromJSON = function (json) {\n return new ResultSet(json.entries);\n };\n return ResultSet;\n}, {\n isClass: true\n});", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'BigNumber';\nvar dependencies = ['?on', 'config'];\nexport var createBigNumberClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n config\n } = _ref;\n var BigNumber = Decimal.clone({\n precision: config.precision,\n modulo: Decimal.EUCLID\n });\n BigNumber.prototype = Object.create(BigNumber.prototype);\n\n /**\n * Attach type information\n */\n BigNumber.prototype.type = 'BigNumber';\n BigNumber.prototype.isBigNumber = true;\n\n /**\n * Get a JSON representation of a BigNumber containing\n * type information\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"BigNumber\", \"value\": \"0.2\"}`\n */\n BigNumber.prototype.toJSON = function () {\n return {\n mathjs: 'BigNumber',\n value: this.toString()\n };\n };\n\n /**\n * Instantiate a BigNumber from a JSON object\n * @param {Object} json a JSON object structured as:\n * `{\"mathjs\": \"BigNumber\", \"value\": \"0.2\"}`\n * @return {BigNumber}\n */\n BigNumber.fromJSON = function (json) {\n return new BigNumber(json.value);\n };\n if (on) {\n // listen for changed in the configuration, automatically apply changed precision\n on('config', function (curr, prev) {\n if (curr.precision !== prev.precision) {\n BigNumber.config({\n precision: curr.precision\n });\n }\n });\n }\n return BigNumber;\n}, {\n isClass: true\n});", "/*!\r\n * decimal.js v10.4.3\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js\r\n * Copyright (c) 2022 Michael Mclaughlin \r\n * MIT Licence\r\n */\r\n\r\n\r\n// ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The maximum exponent magnitude.\r\n // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.\r\nvar EXP_LIMIT = 9e15, // 0 to 9e15\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n // Base conversion alphabet.\r\n NUMERALS = '0123456789abcdef',\r\n\r\n // The natural logarithm of 10 (1025 digits).\r\n LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',\r\n\r\n // Pi (1025 digits).\r\n PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n DEFAULTS = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed at run-time using the `Decimal.config` method.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used when rounding to `precision`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 The IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.\r\n //\r\n // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian\r\n // division (9) are commonly used for the modulus operation. The other rounding modes can also\r\n // be used, but they may not give useful results.\r\n modulo: 1, // 0 to 9\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -EXP_LIMIT\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to EXP_LIMIT\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // JavaScript numbers: -324 (5e-324)\r\n minE: -EXP_LIMIT, // -1 to -EXP_LIMIT\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // JavaScript numbers: 308 (1.7976931348623157e+308)\r\n maxE: EXP_LIMIT, // 1 to EXP_LIMIT\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n crypto: false // true/false\r\n },\r\n\r\n\r\n// ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n inexact, quadrant,\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n precisionLimitExceeded = decimalError + 'Precision limit exceeded',\r\n cryptoUnavailable = decimalError + 'crypto unavailable',\r\n tag = '[object Decimal]',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isBinary = /^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,\r\n isHex = /^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,\r\n isOctal = /^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n\r\n LN10_PRECISION = LN10.length - 1,\r\n PI_PRECISION = PI.length - 1,\r\n\r\n // Decimal.prototype object\r\n P = { toStringTag: tag };\r\n\r\n\r\n// Decimal prototype methods\r\n\r\n\r\n/*\r\n * absoluteValue abs\r\n * ceil\r\n * clampedTo clamp\r\n * comparedTo cmp\r\n * cosine cos\r\n * cubeRoot cbrt\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy divToInt\r\n * equals eq\r\n * floor\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * hyperbolicCosine cosh\r\n * hyperbolicSine sinh\r\n * hyperbolicTangent tanh\r\n * inverseCosine acos\r\n * inverseHyperbolicCosine acosh\r\n * inverseHyperbolicSine asinh\r\n * inverseHyperbolicTangent atanh\r\n * inverseSine asin\r\n * inverseTangent atan\r\n * isFinite\r\n * isInteger isInt\r\n * isNaN\r\n * isNegative isNeg\r\n * isPositive isPos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * [maximum] [max]\r\n * [minimum] [min]\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * round\r\n * sine sin\r\n * squareRoot sqrt\r\n * tangent tan\r\n * times mul\r\n * toBinary\r\n * toDecimalPlaces toDP\r\n * toExponential\r\n * toFixed\r\n * toFraction\r\n * toHexadecimal toHex\r\n * toNearest\r\n * toNumber\r\n * toOctal\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits toSD\r\n * toString\r\n * truncated trunc\r\n * valueOf toJSON\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\nP.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s < 0) x.s = 1;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of positive Infinity.\r\n *\r\n */\r\nP.ceil = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal clamped to the range\r\n * delineated by `min` and `max`.\r\n *\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\nP.clampedTo = P.clamp = function (min, max) {\r\n var k,\r\n x = this,\r\n Ctor = x.constructor;\r\n min = new Ctor(min);\r\n max = new Ctor(max);\r\n if (!min.s || !max.s) return new Ctor(NaN);\r\n if (min.gt(max)) throw Error(invalidArgument + max);\r\n k = x.cmp(min);\r\n return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);\r\n};\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value,\r\n * NaN if the value of either Decimal is NaN.\r\n *\r\n */\r\nP.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this,\r\n xd = x.d,\r\n yd = (y = new x.constructor(y)).d,\r\n xs = x.s,\r\n ys = y.s;\r\n\r\n // Either NaN or \u00B1Infinity?\r\n if (!xd || !yd) {\r\n return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Either zero?\r\n if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;\r\n\r\n // Signs differ?\r\n if (xs !== ys) return xs;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;\r\n\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * cos(0) = 1\r\n * cos(-0) = 1\r\n * cos(Infinity) = NaN\r\n * cos(-Infinity) = NaN\r\n * cos(NaN) = NaN\r\n *\r\n */\r\nP.cosine = P.cos = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.d) return new Ctor(NaN);\r\n\r\n // cos(0) = cos(-0) = 1\r\n if (!x.d[0]) return new Ctor(1);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = cosine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n *\r\n * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * cbrt(0) = 0\r\n * cbrt(-0) = -0\r\n * cbrt(1) = 1\r\n * cbrt(-1) = -1\r\n * cbrt(N) = N\r\n * cbrt(-I) = -I\r\n * cbrt(I) = I\r\n *\r\n * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))\r\n *\r\n */\r\nP.cubeRoot = P.cbrt = function () {\r\n var e, m, n, r, rep, s, sd, t, t3, t3plusx,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = x.s * mathpow(x.s * x, 1 / 3);\r\n\r\n // Math.cbrt underflow/overflow?\r\n // Pass x to Math.pow as integer, then adjust the exponent of the result.\r\n if (!s || Math.abs(s) == 1 / 0) {\r\n n = digitsToString(x.d);\r\n e = x.e;\r\n\r\n // Adjust n exponent so it is a multiple of 3 away from x exponent.\r\n if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00');\r\n s = mathpow(n, 1 / 3);\r\n\r\n // Rarely, e may be one less than the result exponent value.\r\n e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n r.s = x.s;\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Halley's method.\r\n // TODO? Compare Newton's method.\r\n for (;;) {\r\n t = r;\r\n t3 = t.times(t).times(t);\r\n t3plusx = t3.plus(x);\r\n r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999\r\n // , i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\nP.decimalPlaces = P.dp = function () {\r\n var w,\r\n d = this.d,\r\n n = NaN;\r\n\r\n if (d) {\r\n w = d.length - 1;\r\n n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) n--;\r\n if (n < 0) n = 0;\r\n }\r\n\r\n return n;\r\n};\r\n\r\n\r\n/*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedToIntegerBy = P.divToInt = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\nP.equals = P.eq = function (y) {\r\n return this.cmp(y) === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of negative Infinity.\r\n *\r\n */\r\nP.floor = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 3);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\nP.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\nP.greaterThanOrEqualTo = P.gte = function (y) {\r\n var k = this.cmp(y);\r\n return k == 1 || k === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [1, Infinity]\r\n *\r\n * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...\r\n *\r\n * cosh(0) = 1\r\n * cosh(-0) = 1\r\n * cosh(Infinity) = Infinity\r\n * cosh(-Infinity) = Infinity\r\n * cosh(NaN) = NaN\r\n *\r\n * x time taken (ms) result\r\n * 1000 9 9.8503555700852349694e+433\r\n * 10000 25 4.4034091128314607936e+4342\r\n * 100000 171 1.4033316802130615897e+43429\r\n * 1000000 3817 1.5166076984010437725e+434294\r\n * 10000000 abandoned after 2 minute wait\r\n *\r\n * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))\r\n *\r\n */\r\nP.hyperbolicCosine = P.cosh = function () {\r\n var k, n, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor,\r\n one = new Ctor(1);\r\n\r\n if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);\r\n if (x.isZero()) return one;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1\r\n // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n // TODO? Estimation reused from cosine() and may not be optimal here.\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n n = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n n = '2.3283064365386962890625e-10';\r\n }\r\n\r\n x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);\r\n\r\n // Reverse argument reduction\r\n var cosh2_x,\r\n i = k,\r\n d8 = new Ctor(8);\r\n for (; i--;) {\r\n cosh2_x = x.times(x);\r\n x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));\r\n }\r\n\r\n return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...\r\n *\r\n * sinh(0) = 0\r\n * sinh(-0) = -0\r\n * sinh(Infinity) = Infinity\r\n * sinh(-Infinity) = -Infinity\r\n * sinh(NaN) = NaN\r\n *\r\n * x time taken (ms)\r\n * 10 2 ms\r\n * 100 5 ms\r\n * 1000 14 ms\r\n * 10000 82 ms\r\n * 100000 886 ms 1.4033316802130615897e+43429\r\n * 200000 2613 ms\r\n * 300000 5407 ms\r\n * 400000 8824 ms\r\n * 500000 13026 ms 8.7080643612718084129e+217146\r\n * 1000000 48543 ms\r\n *\r\n * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))\r\n *\r\n */\r\nP.hyperbolicSine = P.sinh = function () {\r\n var k, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n } else {\r\n\r\n // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))\r\n // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))\r\n // 3 multiplications and 1 addition\r\n\r\n // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))\r\n // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))\r\n // 4 multiplications and 2 additions\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n\r\n // Reverse argument reduction\r\n var sinh2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sinh2_x = x.times(x);\r\n x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));\r\n }\r\n }\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * tanh(x) = sinh(x) / cosh(x)\r\n *\r\n * tanh(0) = 0\r\n * tanh(-0) = -0\r\n * tanh(Infinity) = 1\r\n * tanh(-Infinity) = -1\r\n * tanh(NaN) = NaN\r\n *\r\n */\r\nP.hyperbolicTangent = P.tanh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(x.s);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 7;\r\n Ctor.rounding = 1;\r\n\r\n return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of\r\n * this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [0, pi]\r\n *\r\n * acos(x) = pi/2 - asin(x)\r\n *\r\n * acos(0) = pi/2\r\n * acos(-0) = pi/2\r\n * acos(1) = 0\r\n * acos(-1) = pi\r\n * acos(1/2) = pi/3\r\n * acos(-1/2) = 2*pi/3\r\n * acos(|x| > 1) = NaN\r\n * acos(NaN) = NaN\r\n *\r\n */\r\nP.inverseCosine = P.acos = function () {\r\n var halfPi,\r\n x = this,\r\n Ctor = x.constructor,\r\n k = x.abs().cmp(1),\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n return k === 0\r\n // |x| is 1\r\n ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)\r\n // |x| > 1 or x is NaN\r\n : new Ctor(NaN);\r\n }\r\n\r\n if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.asin();\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return halfPi.minus(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [1, Infinity]\r\n * Range: [0, Infinity]\r\n *\r\n * acosh(x) = ln(x + sqrt(x^2 - 1))\r\n *\r\n * acosh(x < 1) = NaN\r\n * acosh(NaN) = NaN\r\n * acosh(Infinity) = Infinity\r\n * acosh(-Infinity) = NaN\r\n * acosh(0) = NaN\r\n * acosh(-0) = NaN\r\n * acosh(1) = 0\r\n * acosh(-1) = NaN\r\n *\r\n */\r\nP.inverseHyperbolicCosine = P.acosh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);\r\n if (!x.isFinite()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).minus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * asinh(x) = ln(x + sqrt(x^2 + 1))\r\n *\r\n * asinh(NaN) = NaN\r\n * asinh(Infinity) = Infinity\r\n * asinh(-Infinity) = -Infinity\r\n * asinh(0) = 0\r\n * asinh(-0) = -0\r\n *\r\n */\r\nP.inverseHyperbolicSine = P.asinh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).plus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * atanh(x) = 0.5 * ln((1 + x) / (1 - x))\r\n *\r\n * atanh(|x| > 1) = NaN\r\n * atanh(NaN) = NaN\r\n * atanh(Infinity) = NaN\r\n * atanh(-Infinity) = NaN\r\n * atanh(0) = 0\r\n * atanh(-0) = -0\r\n * atanh(1) = Infinity\r\n * atanh(-1) = -Infinity\r\n *\r\n */\r\nP.inverseHyperbolicTangent = P.atanh = function () {\r\n var pr, rm, wpr, xsd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n xsd = x.sd();\r\n\r\n if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);\r\n\r\n Ctor.precision = wpr = xsd - x.e;\r\n\r\n x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);\r\n\r\n Ctor.precision = pr + 4;\r\n Ctor.rounding = 1;\r\n\r\n x = x.ln();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(0.5);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))\r\n *\r\n * asin(0) = 0\r\n * asin(-0) = -0\r\n * asin(1/2) = pi/6\r\n * asin(-1/2) = -pi/6\r\n * asin(1) = pi/2\r\n * asin(-1) = -pi/2\r\n * asin(|x| > 1) = NaN\r\n * asin(NaN) = NaN\r\n *\r\n * TODO? Compare performance of Taylor series.\r\n *\r\n */\r\nP.inverseSine = P.asin = function () {\r\n var halfPi, k,\r\n pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n k = x.abs().cmp(1);\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n\r\n // |x| is 1\r\n if (k === 0) {\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n halfPi.s = x.s;\r\n return halfPi;\r\n }\r\n\r\n // |x| > 1 or x is NaN\r\n return new Ctor(NaN);\r\n }\r\n\r\n // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n *\r\n * atan(0) = 0\r\n * atan(-0) = -0\r\n * atan(1) = pi/4\r\n * atan(-1) = -pi/4\r\n * atan(Infinity) = pi/2\r\n * atan(-Infinity) = -pi/2\r\n * atan(NaN) = NaN\r\n *\r\n */\r\nP.inverseTangent = P.atan = function () {\r\n var i, j, k, n, px, t, r, wpr, x2,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (!x.isFinite()) {\r\n if (!x.s) return new Ctor(NaN);\r\n if (pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.5);\r\n r.s = x.s;\r\n return r;\r\n }\r\n } else if (x.isZero()) {\r\n return new Ctor(x);\r\n } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.25);\r\n r.s = x.s;\r\n return r;\r\n }\r\n\r\n Ctor.precision = wpr = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);\r\n\r\n // Argument reduction\r\n // Ensure |x| < 0.42\r\n // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))\r\n\r\n k = Math.min(28, wpr / LOG_BASE + 2 | 0);\r\n\r\n for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));\r\n\r\n external = false;\r\n\r\n j = Math.ceil(wpr / LOG_BASE);\r\n n = 1;\r\n x2 = x.times(x);\r\n r = new Ctor(x);\r\n px = x;\r\n\r\n // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n for (; i !== -1;) {\r\n px = px.times(x2);\r\n t = r.minus(px.div(n += 2));\r\n\r\n px = px.times(x2);\r\n r = t.plus(px.div(n += 2));\r\n\r\n if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;);\r\n }\r\n\r\n if (k) r = r.times(2 << (k - 1));\r\n\r\n external = true;\r\n\r\n return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is a finite number, otherwise return false.\r\n *\r\n */\r\nP.isFinite = function () {\r\n return !!this.d;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\nP.isInteger = P.isInt = function () {\r\n return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is NaN, otherwise return false.\r\n *\r\n */\r\nP.isNaN = function () {\r\n return !this.s;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\nP.isNegative = P.isNeg = function () {\r\n return this.s < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\nP.isPositive = P.isPos = function () {\r\n return this.s > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is 0 or -0, otherwise return false.\r\n *\r\n */\r\nP.isZero = function () {\r\n return !!this.d && this.d[0] === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n};\r\n\r\n\r\n/*\r\n * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * If no base is specified, return log[10](arg).\r\n *\r\n * log[base](arg) = ln(arg) / ln(base)\r\n *\r\n * The result will always be correctly rounded if the base of the log is 10, and 'almost always'\r\n * otherwise:\r\n *\r\n * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen\r\n * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error\r\n * between the result and the correctly rounded result will be one ulp (unit in the last place).\r\n *\r\n * log[-b](a) = NaN\r\n * log[0](a) = NaN\r\n * log[1](a) = NaN\r\n * log[NaN](a) = NaN\r\n * log[Infinity](a) = NaN\r\n * log[b](0) = -Infinity\r\n * log[b](-0) = -Infinity\r\n * log[b](-a) = NaN\r\n * log[b](1) = 0\r\n * log[b](Infinity) = Infinity\r\n * log[b](NaN) = NaN\r\n *\r\n * [base] {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nP.logarithm = P.log = function (base) {\r\n var isBase10, d, denominator, k, inf, num, sd, r,\r\n arg = this,\r\n Ctor = arg.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding,\r\n guard = 5;\r\n\r\n // Default base is 10.\r\n if (base == null) {\r\n base = new Ctor(10);\r\n isBase10 = true;\r\n } else {\r\n base = new Ctor(base);\r\n d = base.d;\r\n\r\n // Return NaN if base is negative, or non-finite, or is 0 or 1.\r\n if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);\r\n\r\n isBase10 = base.eq(10);\r\n }\r\n\r\n d = arg.d;\r\n\r\n // Is arg negative, non-finite, 0 or 1?\r\n if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {\r\n return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);\r\n }\r\n\r\n // The result will have a non-terminating decimal expansion if base is 10 and arg is not an\r\n // integer power of 10.\r\n if (isBase10) {\r\n if (d.length > 1) {\r\n inf = true;\r\n } else {\r\n for (k = d[0]; k % 10 === 0;) k /= 10;\r\n inf = k !== 1;\r\n }\r\n }\r\n\r\n external = false;\r\n sd = pr + guard;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n\r\n // The result will have 5 rounding digits.\r\n r = divide(num, denominator, sd, 1);\r\n\r\n // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,\r\n // calculate 10 further digits.\r\n //\r\n // If the result is known to have an infinite decimal expansion, repeat this until it is clear\r\n // that the result is above or below the boundary. Otherwise, if after calculating the 10\r\n // further digits, the last 14 are nines, round up and assume the result is exact.\r\n // Also assume the result is exact if the last 14 are zero.\r\n //\r\n // Example of a result that will be incorrectly rounded:\r\n // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...\r\n // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it\r\n // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so\r\n // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal\r\n // place is still 2.6.\r\n if (checkRoundingDigits(r.d, k = pr, rm)) {\r\n\r\n do {\r\n sd += 10;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n r = divide(num, denominator, sd, 1);\r\n\r\n if (!inf) {\r\n\r\n // Check for 14 nines from the 2nd rounding digit, as the first may be 4.\r\n if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n\r\n break;\r\n }\r\n } while (checkRoundingDigits(r.d, k += 10, rm));\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.max = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'lt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.min = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'gt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.minus = P.sub = function (y) {\r\n var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return y negated if x is finite and y is \u00B1Infinity.\r\n else if (x.d) y.s = -y.s;\r\n\r\n // Return x if y is finite and x is \u00B1Infinity.\r\n // Return x if both are \u00B1Infinity with different signs.\r\n // Return NaN if both are \u00B1Infinity with the same sign.\r\n else y = new Ctor(y.d || x.s !== y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.plus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return y negated if x is zero and y is non-zero.\r\n if (yd[0]) y.s = -y.s;\r\n\r\n // Return x if y is zero and x is non-zero.\r\n else if (xd[0]) y = new Ctor(x);\r\n\r\n // Return zero if both are zero.\r\n // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.\r\n else return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n e = mathfloor(y.e / LOG_BASE);\r\n xe = mathfloor(x.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of\r\n // zeros needing to be prepended, but this can be avoided while still ensuring correct\r\n // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to `xd` if shorter.\r\n // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * The result depends on the modulo mode.\r\n *\r\n */\r\nP.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // Return NaN if x is \u00B1Infinity or NaN, or y is NaN or \u00B10.\r\n if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);\r\n\r\n // Return x if y is \u00B1Infinity or x is \u00B10.\r\n if (!y.d || x.d && !x.d[0]) {\r\n return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);\r\n }\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n\r\n if (Ctor.modulo == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // result = x - q * y where 0 <= result < abs(y)\r\n q = divide(x, y.abs(), 0, 3, 1);\r\n q.s *= y.s;\r\n } else {\r\n q = divide(x, y, 0, Ctor.modulo, 1);\r\n }\r\n\r\n q = q.times(y);\r\n\r\n external = true;\r\n\r\n return x.minus(q);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalExponential = P.exp = function () {\r\n return naturalExponential(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalLogarithm = P.ln = function () {\r\n return naturalLogarithm(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\nP.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.plus = P.add = function (y) {\r\n var carry, d, e, i, k, len, pr, rm, xd, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return x if y is finite and x is \u00B1Infinity.\r\n // Return x if both are \u00B1Infinity with the same sign.\r\n // Return NaN if both are \u00B1Infinity with different signs.\r\n // Return y if x is finite and y is \u00B1Infinity.\r\n else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.minus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!yd[0]) y = new Ctor(x);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n k = mathfloor(x.e / LOG_BASE);\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\nP.precision = P.sd = function (z) {\r\n var k,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n if (x.d) {\r\n k = getPrecision(x.d);\r\n if (z && x.e + 1 > k) k = x.e + 1;\r\n } else {\r\n k = NaN;\r\n }\r\n\r\n return k;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\nP.round = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n return finalise(new Ctor(x), x.e + 1, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n *\r\n * sin(0) = 0\r\n * sin(-0) = -0\r\n * sin(Infinity) = NaN\r\n * sin(-Infinity) = NaN\r\n * sin(NaN) = NaN\r\n *\r\n */\r\nP.sine = P.sin = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = sine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n */\r\nP.squareRoot = P.sqrt = function () {\r\n var m, n, sd, r, rep, t,\r\n x = this,\r\n d = x.d,\r\n e = x.e,\r\n s = x.s,\r\n Ctor = x.constructor;\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !d || !d[0]) {\r\n return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);\r\n }\r\n\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(d);\r\n\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * tan(0) = 0\r\n * tan(-0) = -0\r\n * tan(Infinity) = NaN\r\n * tan(-Infinity) = NaN\r\n * tan(NaN) = NaN\r\n *\r\n */\r\nP.tangent = P.tan = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n x = x.sin();\r\n x.s = 1;\r\n x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n y.s *= x.s;\r\n\r\n // If either is NaN, \u00B1Infinity or \u00B10...\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd\r\n\r\n // Return NaN if either is NaN.\r\n // Return NaN if x is \u00B10 and y is \u00B1Infinity, or y is \u00B10 and x is \u00B1Infinity.\r\n ? NaN\r\n\r\n // Return \u00B1Infinity if either is \u00B1Infinity.\r\n // Return \u00B10 if either is \u00B10.\r\n : !xd || !yd ? y.s / 0 : y.s * 0);\r\n }\r\n\r\n e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = getBase10Exponent(r, e);\r\n\r\n return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 2, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toBinary = function (sd, rm) {\r\n return toStringBinary(this, 2, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toDecimalPlaces = P.toDP = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return finalise(x, dp + x.e + 1, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), dp + 1, rm);\r\n str = finiteToString(x, true, dp + 1);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\nP.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = finalise(new Ctor(x), dp + x.e + 1, rm);\r\n str = finiteToString(y, false, dp + y.e + 1);\r\n }\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return an array representing the value of this Decimal as a simple fraction with an integer\r\n * numerator and an integer denominator.\r\n *\r\n * The denominator will be a positive non-zero value less than or equal to the specified maximum\r\n * denominator. If a maximum denominator is not specified, the denominator will be the lowest\r\n * value necessary to represent the number exactly.\r\n *\r\n * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity.\r\n *\r\n */\r\nP.toFraction = function (maxD) {\r\n var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r,\r\n x = this,\r\n xd = x.d,\r\n Ctor = x.constructor;\r\n\r\n if (!xd) return new Ctor(x);\r\n\r\n n1 = d0 = new Ctor(1);\r\n d1 = n0 = new Ctor(0);\r\n\r\n d = new Ctor(d1);\r\n e = d.e = getPrecision(xd) - x.e - 1;\r\n k = e % LOG_BASE;\r\n d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);\r\n\r\n if (maxD == null) {\r\n\r\n // d is 10**e, the minimum max-denominator needed.\r\n maxD = e > 0 ? d : n1;\r\n } else {\r\n n = new Ctor(maxD);\r\n if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);\r\n maxD = n.gt(d) ? (e > 0 ? d : n1) : n;\r\n }\r\n\r\n external = false;\r\n n = new Ctor(digitsToString(xd));\r\n pr = Ctor.precision;\r\n Ctor.precision = e = xd.length * LOG_BASE * 2;\r\n\r\n for (;;) {\r\n q = divide(n, d, 0, 1, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.cmp(maxD) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n d2 = n1;\r\n n1 = n0.plus(q.times(d2));\r\n n0 = d2;\r\n d2 = d;\r\n d = n.minus(q.times(d2));\r\n n = d2;\r\n }\r\n\r\n d2 = divide(maxD.minus(d0), d1, 0, 1, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1?\r\n r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1\r\n ? [n1, d1] : [n0, d0];\r\n\r\n Ctor.precision = pr;\r\n external = true;\r\n\r\n return r;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 16, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toHexadecimal = P.toHex = function (sd, rm) {\r\n return toStringBinary(this, 16, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding\r\n * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.\r\n *\r\n * The return value will always have the same sign as this Decimal, unless either this Decimal\r\n * or `y` is NaN, in which case the return value will be also be NaN.\r\n *\r\n * The return value is not affected by the value of `precision`.\r\n *\r\n * y {number|string|Decimal} The magnitude to round to a multiple of.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toNearest() rounding mode not an integer: {rm}'\r\n * 'toNearest() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toNearest = function (y, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n\r\n if (y == null) {\r\n\r\n // If x is not finite, return x.\r\n if (!x.d) return x;\r\n\r\n y = new Ctor(1);\r\n rm = Ctor.rounding;\r\n } else {\r\n y = new Ctor(y);\r\n if (rm === void 0) {\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(rm, 0, 8);\r\n }\r\n\r\n // If x is not finite, return x if y is not NaN, else NaN.\r\n if (!x.d) return y.s ? x : y;\r\n\r\n // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.\r\n if (!y.d) {\r\n if (y.s) y.s = x.s;\r\n return y;\r\n }\r\n }\r\n\r\n // If y is not zero, calculate the nearest multiple of y to x.\r\n if (y.d[0]) {\r\n external = false;\r\n x = divide(x, y, 0, rm, 1).times(y);\r\n external = true;\r\n finalise(x);\r\n\r\n // If y is zero, return zero with the sign of x.\r\n } else {\r\n y.s = x.s;\r\n x = y;\r\n }\r\n\r\n return x;\r\n};\r\n\r\n\r\n/*\r\n * Return the value of this Decimal converted to a number primitive.\r\n * Zero keeps its sign.\r\n *\r\n */\r\nP.toNumber = function () {\r\n return +this;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 8, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toOctal = function (sd, rm) {\r\n return toStringBinary(this, 8, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded\r\n * to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * ECMAScript compliant.\r\n *\r\n * pow(x, NaN) = NaN\r\n * pow(x, \u00B10) = 1\r\n\r\n * pow(NaN, non-zero) = NaN\r\n * pow(abs(x) > 1, +Infinity) = +Infinity\r\n * pow(abs(x) > 1, -Infinity) = +0\r\n * pow(abs(x) == 1, \u00B1Infinity) = NaN\r\n * pow(abs(x) < 1, +Infinity) = +0\r\n * pow(abs(x) < 1, -Infinity) = +Infinity\r\n * pow(+Infinity, y > 0) = +Infinity\r\n * pow(+Infinity, y < 0) = +0\r\n * pow(-Infinity, odd integer > 0) = -Infinity\r\n * pow(-Infinity, even integer > 0) = +Infinity\r\n * pow(-Infinity, odd integer < 0) = -0\r\n * pow(-Infinity, even integer < 0) = +0\r\n * pow(+0, y > 0) = +0\r\n * pow(+0, y < 0) = +Infinity\r\n * pow(-0, odd integer > 0) = -0\r\n * pow(-0, even integer > 0) = +0\r\n * pow(-0, odd integer < 0) = -Infinity\r\n * pow(-0, even integer < 0) = +Infinity\r\n * pow(finite x < 0, finite non-integer) = NaN\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the\r\n * probability of an incorrectly rounded result\r\n * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14\r\n * i.e. 1 in 250,000,000,000,000\r\n *\r\n * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).\r\n *\r\n * y {number|string|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\nP.toPower = P.pow = function (y) {\r\n var e, k, pr, r, rm, s,\r\n x = this,\r\n Ctor = x.constructor,\r\n yn = +(y = new Ctor(y));\r\n\r\n // Either \u00B1Infinity, NaN or \u00B10?\r\n if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));\r\n\r\n x = new Ctor(x);\r\n\r\n if (x.eq(1)) return x;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (y.eq(1)) return finalise(x, pr, rm);\r\n\r\n // y exponent\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = intPow(Ctor, x, k, pr);\r\n return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);\r\n }\r\n\r\n s = x.s;\r\n\r\n // if x is negative\r\n if (s < 0) {\r\n\r\n // if y is not an integer\r\n if (e < y.d.length - 1) return new Ctor(NaN);\r\n\r\n // Result is positive if x is negative and the last digit of integer y is even.\r\n if ((y.d[e] & 1) == 0) s = 1;\r\n\r\n // if x.eq(-1)\r\n if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {\r\n x.s = s;\r\n return x;\r\n }\r\n }\r\n\r\n // Estimate result exponent.\r\n // x^y = 10^e, where e = y * log10(x)\r\n // log10(x) = log10(x_significand) + x_exponent\r\n // log10(x_significand) = ln(x_significand) / ln(10)\r\n k = mathpow(+x, yn);\r\n e = k == 0 || !isFinite(k)\r\n ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1))\r\n : new Ctor(k + '').e;\r\n\r\n // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.\r\n\r\n // Overflow/underflow?\r\n if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);\r\n\r\n external = false;\r\n Ctor.rounding = x.s = 1;\r\n\r\n // Estimate the extra guard digits needed to ensure five correct rounding digits from\r\n // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):\r\n // new Decimal(2.32456).pow('2087987436534566.46411')\r\n // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815\r\n k = Math.min(12, (e + '').length);\r\n\r\n // r = x^y = exp(y*ln(x))\r\n r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);\r\n\r\n // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)\r\n if (r.d) {\r\n\r\n // Truncate to the required precision plus five rounding digits.\r\n r = finalise(r, pr + 5, 1);\r\n\r\n // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate\r\n // the result.\r\n if (checkRoundingDigits(r.d, pr, rm)) {\r\n e = pr + 10;\r\n\r\n // Truncate to the increased precision plus five rounding digits.\r\n r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);\r\n\r\n // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).\r\n if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n }\r\n }\r\n\r\n r.s = s;\r\n external = true;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toPrecision = function (sd, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), sd, rm);\r\n str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toSD() digits out of range: {sd}'\r\n * 'toSD() digits not an integer: {sd}'\r\n * 'toSD() rounding mode not an integer: {rm}'\r\n * 'toSD() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toSignificantDigits = P.toSD = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return finalise(new Ctor(x), sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\nP.toString = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.\r\n *\r\n */\r\nP.truncated = P.trunc = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 1);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n * Unlike `toString`, negative zero will include the minus sign.\r\n *\r\n */\r\nP.valueOf = P.toJSON = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() ? '-' + str : str;\r\n};\r\n\r\n\r\n// Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n/*\r\n * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,\r\n * finiteToString, naturalExponential, naturalLogarithm\r\n * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,\r\n * P.toPrecision, P.toSignificantDigits, toStringBinary, random\r\n * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm\r\n * convertBase toStringBinary, parseOther\r\n * cos P.cos\r\n * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,\r\n * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,\r\n * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,\r\n * taylorSeries, atan2, parseOther\r\n * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,\r\n * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,\r\n * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,\r\n * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,\r\n * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,\r\n * P.truncated, divide, getLn10, getPi, naturalExponential,\r\n * naturalLogarithm, ceil, floor, round, trunc\r\n * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,\r\n * toStringBinary\r\n * getBase10Exponent P.minus, P.plus, P.times, parseOther\r\n * getLn10 P.logarithm, naturalLogarithm\r\n * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2\r\n * getPrecision P.precision, P.toFraction\r\n * getZeroString digitsToString, finiteToString\r\n * intPow P.toPower, parseOther\r\n * isOdd toLessThanHalfPi\r\n * maxOrMin max, min\r\n * naturalExponential P.naturalExponential, P.toPower\r\n * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,\r\n * P.toPower, naturalExponential\r\n * nonFiniteToString finiteToString, toStringBinary\r\n * parseDecimal Decimal\r\n * parseOther Decimal\r\n * sin P.sin\r\n * taylorSeries P.cosh, P.sinh, cos, sin\r\n * toLessThanHalfPi P.cos, P.sin\r\n * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal\r\n * truncate intPow\r\n *\r\n * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,\r\n * naturalLogarithm, config, parseOther, random, Decimal\r\n */\r\n\r\n\r\nfunction digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n}\r\n\r\n\r\nfunction checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Check 5 rounding digits if `repeating` is null, 4 otherwise.\r\n * `repeating == null` if caller is `log` or `pow`,\r\n * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.\r\n */\r\nfunction checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n// Convert string of `baseIn` to an array of numbers of `baseOut`.\r\n// Eg. convertBase('255', 10, 16) returns [15, 15].\r\n// Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\r\nfunction convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n}\r\n\r\n\r\n/*\r\n * cos(x) = 1 - x^2/2! + x^4/4! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction cosine(Ctor, x) {\r\n var k, len, y;\r\n\r\n if (x.isZero()) return x;\r\n\r\n // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1\r\n // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n len = x.d.length;\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n y = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n y = '2.3283064365386962890625e-10';\r\n }\r\n\r\n Ctor.precision += k;\r\n\r\n x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));\r\n\r\n // Reverse argument reduction\r\n for (var i = k; i--;) {\r\n var cos2x = x.times(x);\r\n x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);\r\n }\r\n\r\n Ctor.precision -= k;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Perform division in the specified base.\r\n */\r\nvar divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k, base) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % base | 0;\r\n carry = temp / base | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, rm, dp, base) {\r\n var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0,\r\n yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(// Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :\r\n\r\n // Return \u00B10 if x is 0 or y is \u00B1Infinity, or return \u00B1Infinity as y is 0.\r\n xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);\r\n }\r\n\r\n if (base) {\r\n logBase = 1;\r\n e = x.e - y.e;\r\n } else {\r\n base = BASE;\r\n logBase = LOG_BASE;\r\n e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);\r\n }\r\n\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n // The digit array of a Decimal from toStringBinary may have trailing zeros.\r\n for (i = 0; yd[i] == (xd[i] || 0); i++);\r\n\r\n if (yd[i] > (xd[i] || 0)) e--;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else if (dp) {\r\n sd = pr + (x.e - y.e) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) {\r\n qd.push(1);\r\n more = true;\r\n } else {\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / logBase + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * base + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n more = k || i < xL;\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= base/2\r\n k = base / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k, base);\r\n xd = multiplyInteger(xd, k, base);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= base / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= base) k = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL, base);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL, base);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n\r\n more = rem[0] !== void 0;\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n }\r\n\r\n // logBase is 1 when divide is being used for base conversion.\r\n if (logBase == 1) {\r\n q.e = e;\r\n inexact = more;\r\n } else {\r\n\r\n // To calculate q.e, first get the number of digits of qd[0].\r\n for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;\r\n q.e = i + e * logBase - 1;\r\n\r\n finalise(q, dp ? pr + q.e + 1 : pr, rm, more);\r\n }\r\n\r\n return q;\r\n };\r\n})();\r\n\r\n\r\n/*\r\n * Round `x` to `sd` significant digits using rounding mode `rm`.\r\n * Check for over/under-flow.\r\n */\r\n function finalise(x, sd, rm, isTruncated) {\r\n var digits, i, j, k, rd, roundUp, w, xd, xdi,\r\n Ctor = x.constructor;\r\n\r\n // Don't round if sd is null or undefined.\r\n out: if (sd != null) {\r\n xd = x.d;\r\n\r\n // Infinity/NaN.\r\n if (!xd) return x;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd containing rd, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // digits: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;\r\n i = sd - digits;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / mathpow(10, digits - j - 1) % 10 | 0;\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) {\r\n if (isTruncated) {\r\n\r\n // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.\r\n for (; k++ <= xdi;) xd.push(0);\r\n w = rd = 0;\r\n digits = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (digits = 1; k >= 10; k /= 10) digits++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - digits.\r\n j = i - LOG_BASE + digits;\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;\r\n }\r\n }\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n isTruncated = isTruncated || sd < 0 ||\r\n xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));\r\n\r\n // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right\r\n // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression\r\n // will give 714.\r\n\r\n roundUp = rm < 4\r\n ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xd[0]) {\r\n xd.length = 0;\r\n if (roundUp) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xd[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (roundUp) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n\r\n // i will be the length of xd[0] before k is added.\r\n for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;\r\n j = xd[0] += k;\r\n for (k = 1; j >= 10; j /= 10) k++;\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xd[0] == BASE) xd[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n }\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > Ctor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < Ctor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // Ctor.underflow = true;\r\n } // else Ctor.underflow = false;\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\nfunction finiteToString(x, isExp, sd) {\r\n if (!x.isFinite()) return nonFiniteToString(x);\r\n var k,\r\n e = x.e,\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (x.e < 0 ? 'e' : 'e+') + x.e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return str;\r\n}\r\n\r\n\r\n// Calculate the base 10 exponent from the base 1e7 exponent.\r\nfunction getBase10Exponent(digits, e) {\r\n var w = digits[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for ( e *= LOG_BASE; w >= 10; w /= 10) e++;\r\n return e;\r\n}\r\n\r\n\r\nfunction getLn10(Ctor, sd, pr) {\r\n if (sd > LN10_PRECISION) {\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(precisionLimitExceeded);\r\n }\r\n return finalise(new Ctor(LN10), sd, 1, true);\r\n}\r\n\r\n\r\nfunction getPi(Ctor, sd, rm) {\r\n if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);\r\n return finalise(new Ctor(PI), sd, rm, true);\r\n}\r\n\r\n\r\nfunction getPrecision(digits) {\r\n var w = digits.length - 1,\r\n len = w * LOG_BASE + 1;\r\n\r\n w = digits[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) len--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = digits[0]; w >= 10; w /= 10) len++;\r\n }\r\n\r\n return len;\r\n}\r\n\r\n\r\nfunction getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an\r\n * integer of type number.\r\n *\r\n * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.\r\n *\r\n */\r\nfunction intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n}\r\n\r\n\r\nfunction isOdd(n) {\r\n return n.d[n.d.length - 1] & 1;\r\n}\r\n\r\n\r\n/*\r\n * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.\r\n */\r\nfunction maxOrMin(Ctor, args, ltgt) {\r\n var y,\r\n x = new Ctor(args[0]),\r\n i = 0;\r\n\r\n for (; ++i < args.length;) {\r\n y = new Ctor(args[i]);\r\n if (!y.s) {\r\n x = y;\r\n break;\r\n } else if (x[ltgt](y)) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000\r\n * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(Infinity) = Infinity\r\n * exp(-Infinity) = 0\r\n * exp(NaN) = NaN\r\n * exp(\u00B10) = 1\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n * The result will always be correctly rounded.\r\n *\r\n */\r\nfunction naturalExponential(x, sd) {\r\n var denominator, guard, j, pow, sum, t, wpr,\r\n rep = 0,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // 0/NaN/Infinity?\r\n if (!x.d || !x.d[0] || x.e > 17) {\r\n\r\n return new Ctor(x.d\r\n ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0\r\n : x.s ? x.s < 0 ? 0 : x : 0 / 0);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n // while abs(x) >= 0.1\r\n while (x.e > -2) {\r\n\r\n // x = x / 2^5\r\n x = x.times(t);\r\n k += 5;\r\n }\r\n\r\n // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision\r\n // necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(1);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = finalise(pow.times(x), wpr, 1);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n j = k;\r\n while (j--) sum = finalise(sum.times(sum), wpr, 1);\r\n\r\n // Check to see if the first 4 rounding digits are [49]999.\r\n // If so, repeat the summation with a higher precision, otherwise\r\n // e.g. with precision: 18, rounding: 1\r\n // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n\r\n if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += 10;\r\n denominator = pow = t = new Ctor(1);\r\n i = 0;\r\n rep++;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * ln(-n) = NaN\r\n * ln(0) = -Infinity\r\n * ln(-0) = -Infinity\r\n * ln(1) = 0\r\n * ln(Infinity) = Infinity\r\n * ln(-Infinity) = NaN\r\n * ln(NaN) = NaN\r\n *\r\n * ln(n) (n != 1) is non-terminating.\r\n *\r\n */\r\nfunction naturalLogarithm(y, sd) {\r\n var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // Is x negative or Infinity, NaN, 0 or 1?\r\n if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {\r\n return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n Ctor.precision = wpr += guard;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n\r\n if (Math.abs(e = x.e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = x.e;\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n Ctor.precision = pr;\r\n\r\n return sd == null ? finalise(x, pr, rm, external = true) : x;\r\n }\r\n\r\n // x1 is x reduced to a value near 1.\r\n x1 = x;\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = finalise(numerator.times(x2), wpr, 1);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction. Check that e is not 0 because, besides preventing an\r\n // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr, 1);\r\n\r\n // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n // been repeated previously) and the first 4 rounding digits 9999?\r\n // If so, restart the summation with a higher precision, otherwise\r\n // e.g. with precision: 12, rounding: 1\r\n // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += guard;\r\n t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = rep = 1;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n}\r\n\r\n\r\n// \u00B1Infinity, NaN.\r\nfunction nonFiniteToString(x) {\r\n // Unsigned.\r\n return String(x.s * x.s / 0);\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\nfunction parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.\r\n */\r\nfunction parseOther(x, str) {\r\n var base, Ctor, divisor, i, isFloat, len, p, xd, xe;\r\n\r\n if (str.indexOf('_') > -1) {\r\n str = str.replace(/(\\d)_(?=\\d)/g, '$1');\r\n if (isDecimal.test(str)) return parseDecimal(x, str);\r\n } else if (str === 'Infinity' || str === 'NaN') {\r\n if (!+str) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return x;\r\n }\r\n\r\n if (isHex.test(str)) {\r\n base = 16;\r\n str = str.toLowerCase();\r\n } else if (isBinary.test(str)) {\r\n base = 2;\r\n } else if (isOctal.test(str)) {\r\n base = 8;\r\n } else {\r\n throw Error(invalidArgument + str);\r\n }\r\n\r\n // Is there a binary exponent part?\r\n i = str.search(/p/i);\r\n\r\n if (i > 0) {\r\n p = +str.slice(i + 1);\r\n str = str.substring(2, i);\r\n } else {\r\n str = str.slice(2);\r\n }\r\n\r\n // Convert `str` as an integer then divide the result by `base` raised to a power such that the\r\n // fraction part will be restored.\r\n i = str.indexOf('.');\r\n isFloat = i >= 0;\r\n Ctor = x.constructor;\r\n\r\n if (isFloat) {\r\n str = str.replace('.', '');\r\n len = str.length;\r\n i = len - i;\r\n\r\n // log[10](16) = 1.2041... , log[10](88) = 1.9444....\r\n divisor = intPow(Ctor, new Ctor(base), i, i * 2);\r\n }\r\n\r\n xd = convertBase(str, base, BASE);\r\n xe = xd.length - 1;\r\n\r\n // Remove trailing zeros.\r\n for (i = xe; xd[i] === 0; --i) xd.pop();\r\n if (i < 0) return new Ctor(x.s * 0);\r\n x.e = getBase10Exponent(xd, xe);\r\n x.d = xd;\r\n external = false;\r\n\r\n // At what precision to perform the division to ensure exact conversion?\r\n // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)\r\n // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412\r\n // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.\r\n // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount\r\n // Therefore using 4 * the number of digits of str will always be enough.\r\n if (isFloat) x = divide(x, divisor, len * 4);\r\n\r\n // Multiply by the binary exponent part if present.\r\n if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));\r\n external = true;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction sine(Ctor, x) {\r\n var k,\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);\r\n }\r\n\r\n // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)\r\n // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)\r\n // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x);\r\n\r\n // Reverse argument reduction\r\n var sin2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sin2_x = x.times(x);\r\n x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n// Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.\r\nfunction taylorSeries(Ctor, n, x, y, isHyperbolic) {\r\n var j, t, u, x2,\r\n i = 1,\r\n pr = Ctor.precision,\r\n k = Math.ceil(pr / LOG_BASE);\r\n\r\n external = false;\r\n x2 = x.times(x);\r\n u = new Ctor(y);\r\n\r\n for (;;) {\r\n t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\r\n u = isHyperbolic ? y.plus(t) : y.minus(t);\r\n y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);\r\n t = u.plus(y);\r\n\r\n if (t.d[k] !== void 0) {\r\n for (j = k; t.d[j] === u.d[j] && j--;);\r\n if (j == -1) break;\r\n }\r\n\r\n j = u;\r\n u = y;\r\n y = t;\r\n t = j;\r\n i++;\r\n }\r\n\r\n external = true;\r\n t.d.length = k + 1;\r\n\r\n return t;\r\n}\r\n\r\n\r\n// Exponent e must be positive and non-zero.\r\nfunction tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n}\r\n\r\n\r\n// Return the absolute value of `x` reduced to less than or equal to half pi.\r\nfunction toLessThanHalfPi(Ctor, x) {\r\n var t,\r\n isNeg = x.s < 0,\r\n pi = getPi(Ctor, Ctor.precision, 1),\r\n halfPi = pi.times(0.5);\r\n\r\n x = x.abs();\r\n\r\n if (x.lte(halfPi)) {\r\n quadrant = isNeg ? 4 : 1;\r\n return x;\r\n }\r\n\r\n t = x.divToInt(pi);\r\n\r\n if (t.isZero()) {\r\n quadrant = isNeg ? 3 : 2;\r\n } else {\r\n x = x.minus(t.times(pi));\r\n\r\n // 0 <= x < pi\r\n if (x.lte(halfPi)) {\r\n quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1);\r\n return x;\r\n }\r\n\r\n quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2);\r\n }\r\n\r\n return x.minus(pi).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return the value of Decimal `x` as a string in base `baseOut`.\r\n *\r\n * If the optional `sd` argument is present include a binary exponent suffix.\r\n */\r\nfunction toStringBinary(x, baseOut, sd, rm) {\r\n var base, e, i, k, len, roundUp, str, xd, y,\r\n Ctor = x.constructor,\r\n isExp = sd !== void 0;\r\n\r\n if (isExp) {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n } else {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n }\r\n\r\n if (!x.isFinite()) {\r\n str = nonFiniteToString(x);\r\n } else {\r\n str = finiteToString(x);\r\n i = str.indexOf('.');\r\n\r\n // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:\r\n // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))\r\n // minBinaryExponent = floor(decimalExponent * log[2](10))\r\n // log[2](10) = 3.321928094887362347870319429489390175864\r\n\r\n if (isExp) {\r\n base = 2;\r\n if (baseOut == 16) {\r\n sd = sd * 4 - 3;\r\n } else if (baseOut == 8) {\r\n sd = sd * 3 - 2;\r\n }\r\n } else {\r\n base = baseOut;\r\n }\r\n\r\n // Convert the number as an integer then divide the result by its base raised to a power such\r\n // that the fraction part will be restored.\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n str = str.replace('.', '');\r\n y = new Ctor(1);\r\n y.e = str.length - i;\r\n y.d = convertBase(finiteToString(y), 10, base);\r\n y.e = y.d.length;\r\n }\r\n\r\n xd = convertBase(str, 10, base);\r\n e = len = xd.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] == 0;) xd.pop();\r\n\r\n if (!xd[0]) {\r\n str = isExp ? '0p+0' : '0';\r\n } else {\r\n if (i < 0) {\r\n e--;\r\n } else {\r\n x = new Ctor(x);\r\n x.d = xd;\r\n x.e = e;\r\n x = divide(x, y, sd, rm, 0, base);\r\n xd = x.d;\r\n e = x.e;\r\n roundUp = inexact;\r\n }\r\n\r\n // The rounding digit, i.e. the digit after the digit that may be rounded up.\r\n i = xd[sd];\r\n k = base / 2;\r\n roundUp = roundUp || xd[sd + 1] !== void 0;\r\n\r\n roundUp = rm < 4\r\n ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2))\r\n : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||\r\n rm === (x.s < 0 ? 8 : 7));\r\n\r\n xd.length = sd;\r\n\r\n if (roundUp) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (; ++xd[--sd] > base - 1;) {\r\n xd[sd] = 0;\r\n if (!sd) {\r\n ++e;\r\n xd.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n\r\n // Add binary exponent suffix?\r\n if (isExp) {\r\n if (len > 1) {\r\n if (baseOut == 16 || baseOut == 8) {\r\n i = baseOut == 16 ? 4 : 3;\r\n for (--len; len % i; len++) str += '0';\r\n xd = convertBase(str, base, baseOut);\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // xd[0] will always be be 1\r\n for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n } else {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n }\r\n\r\n str = str + (e < 0 ? 'p' : 'p+') + e;\r\n } else if (e < 0) {\r\n for (; ++e;) str = '0' + str;\r\n str = '0.' + str;\r\n } else {\r\n if (++e > len) for (e -= len; e-- ;) str += '0';\r\n else if (e < len) str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n}\r\n\r\n\r\n// Does not strip trailing zeros.\r\nfunction truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n}\r\n\r\n\r\n// Decimal methods\r\n\r\n\r\n/*\r\n * abs\r\n * acos\r\n * acosh\r\n * add\r\n * asin\r\n * asinh\r\n * atan\r\n * atanh\r\n * atan2\r\n * cbrt\r\n * ceil\r\n * clamp\r\n * clone\r\n * config\r\n * cos\r\n * cosh\r\n * div\r\n * exp\r\n * floor\r\n * hypot\r\n * ln\r\n * log\r\n * log2\r\n * log10\r\n * max\r\n * min\r\n * mod\r\n * mul\r\n * pow\r\n * random\r\n * round\r\n * set\r\n * sign\r\n * sin\r\n * sinh\r\n * sqrt\r\n * sub\r\n * sum\r\n * tan\r\n * tanh\r\n * trunc\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction abs(x) {\r\n return new this(x).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine in radians of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction acos(x) {\r\n return new this(x).acos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction acosh(x) {\r\n return new this(x).acosh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction add(x, y) {\r\n return new this(x).plus(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction asin(x) {\r\n return new this(x).asin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction asinh(x) {\r\n return new this(x).asinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction atan(x) {\r\n return new this(x).atan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction atanh(x) {\r\n return new this(x).atanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi\r\n * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi, pi]\r\n *\r\n * y {number|string|Decimal} The y-coordinate.\r\n * x {number|string|Decimal} The x-coordinate.\r\n *\r\n * atan2(\u00B10, -0) = \u00B1pi\r\n * atan2(\u00B10, +0) = \u00B10\r\n * atan2(\u00B10, -x) = \u00B1pi for x > 0\r\n * atan2(\u00B10, x) = \u00B10 for x > 0\r\n * atan2(-y, \u00B10) = -pi/2 for y > 0\r\n * atan2(y, \u00B10) = pi/2 for y > 0\r\n * atan2(\u00B1y, -Infinity) = \u00B1pi for finite y > 0\r\n * atan2(\u00B1y, +Infinity) = \u00B10 for finite y > 0\r\n * atan2(\u00B1Infinity, x) = \u00B1pi/2 for finite x\r\n * atan2(\u00B1Infinity, -Infinity) = \u00B13*pi/4\r\n * atan2(\u00B1Infinity, +Infinity) = \u00B1pi/4\r\n * atan2(NaN, x) = NaN\r\n * atan2(y, NaN) = NaN\r\n *\r\n */\r\nfunction atan2(y, x) {\r\n y = new this(y);\r\n x = new this(x);\r\n var r,\r\n pr = this.precision,\r\n rm = this.rounding,\r\n wpr = pr + 4;\r\n\r\n // Either NaN\r\n if (!y.s || !x.s) {\r\n r = new this(NaN);\r\n\r\n // Both \u00B1Infinity\r\n } else if (!y.d && !x.d) {\r\n r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);\r\n r.s = y.s;\r\n\r\n // x is \u00B1Infinity or y is \u00B10\r\n } else if (!x.d || y.isZero()) {\r\n r = x.s < 0 ? getPi(this, pr, rm) : new this(0);\r\n r.s = y.s;\r\n\r\n // y is \u00B1Infinity or x is \u00B10\r\n } else if (!y.d || x.isZero()) {\r\n r = getPi(this, wpr, 1).times(0.5);\r\n r.s = y.s;\r\n\r\n // Both non-zero and finite\r\n } else if (x.s < 0) {\r\n this.precision = wpr;\r\n this.rounding = 1;\r\n r = this.atan(divide(y, x, wpr, 1));\r\n x = getPi(this, wpr, 1);\r\n this.precision = pr;\r\n this.rounding = rm;\r\n r = y.s < 0 ? r.minus(x) : r.plus(x);\r\n } else {\r\n r = this.atan(divide(y, x, wpr, 1));\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction cbrt(x) {\r\n return new this(x).cbrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ceil(x) {\r\n return finalise(x = new this(x), x.e + 1, 2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.\r\n *\r\n * x {number|string|Decimal}\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\nfunction clamp(x, min, max) {\r\n return new this(x).clamp(min, max);\r\n}\r\n\r\n\r\n/*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n * maxE {number}\r\n * minE {number}\r\n * modulo {number}\r\n * crypto {boolean|number}\r\n * defaults {true}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\nfunction config(obj) {\r\n if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');\r\n var i, p, v,\r\n useDefaults = obj.defaults === true,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -EXP_LIMIT, 0,\r\n 'toExpPos', 0, EXP_LIMIT,\r\n 'maxE', 0, EXP_LIMIT,\r\n 'minE', -EXP_LIMIT, 0,\r\n 'modulo', 0, 9\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (v === true || v === false || v === 0 || v === 1) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n this[p] = true;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n } else {\r\n this[p] = false;\r\n }\r\n } else {\r\n throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n return this;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cos(x) {\r\n return new this(x).cos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cosh(x) {\r\n return new this(x).cosh();\r\n}\r\n\r\n\r\n/*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\nfunction clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * v {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(v) {\r\n var e, i, t,\r\n x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(v);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n // Duplicate.\r\n if (isDecimalInstance(v)) {\r\n x.s = v.s;\r\n\r\n if (external) {\r\n if (!v.d || v.e > Decimal.maxE) {\r\n\r\n // Infinity.\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (v.e < Decimal.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d.slice();\r\n }\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d ? v.d.slice() : v.d;\r\n }\r\n\r\n return;\r\n }\r\n\r\n t = typeof v;\r\n\r\n if (t === 'number') {\r\n if (v === 0) {\r\n x.s = 1 / v < 0 ? -1 : 1;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n if (v < 0) {\r\n v = -v;\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (v === ~~v && v < 1e7) {\r\n for (e = 0, i = v; i >= 10; i /= 10) e++;\r\n\r\n if (external) {\r\n if (e > Decimal.maxE) {\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (e < Decimal.minE) {\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n\r\n return;\r\n\r\n // Infinity, NaN.\r\n } else if (v * 0 !== 0) {\r\n if (!v) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return;\r\n }\r\n\r\n return parseDecimal(x, v.toString());\r\n\r\n } else if (t !== 'string') {\r\n throw Error(invalidArgument + v);\r\n }\r\n\r\n // Minus sign?\r\n if ((i = v.charCodeAt(0)) === 45) {\r\n v = v.slice(1);\r\n x.s = -1;\r\n } else {\r\n // Plus sign?\r\n if (i === 43) v = v.slice(1);\r\n x.s = 1;\r\n }\r\n\r\n return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n Decimal.EUCLID = 9;\r\n\r\n Decimal.config = Decimal.set = config;\r\n Decimal.clone = clone;\r\n Decimal.isDecimal = isDecimalInstance;\r\n\r\n Decimal.abs = abs;\r\n Decimal.acos = acos;\r\n Decimal.acosh = acosh; // ES6\r\n Decimal.add = add;\r\n Decimal.asin = asin;\r\n Decimal.asinh = asinh; // ES6\r\n Decimal.atan = atan;\r\n Decimal.atanh = atanh; // ES6\r\n Decimal.atan2 = atan2;\r\n Decimal.cbrt = cbrt; // ES6\r\n Decimal.ceil = ceil;\r\n Decimal.clamp = clamp;\r\n Decimal.cos = cos;\r\n Decimal.cosh = cosh; // ES6\r\n Decimal.div = div;\r\n Decimal.exp = exp;\r\n Decimal.floor = floor;\r\n Decimal.hypot = hypot; // ES6\r\n Decimal.ln = ln;\r\n Decimal.log = log;\r\n Decimal.log10 = log10; // ES6\r\n Decimal.log2 = log2; // ES6\r\n Decimal.max = max;\r\n Decimal.min = min;\r\n Decimal.mod = mod;\r\n Decimal.mul = mul;\r\n Decimal.pow = pow;\r\n Decimal.random = random;\r\n Decimal.round = round;\r\n Decimal.sign = sign; // ES6\r\n Decimal.sin = sin;\r\n Decimal.sinh = sinh; // ES6\r\n Decimal.sqrt = sqrt;\r\n Decimal.sub = sub;\r\n Decimal.sum = sum;\r\n Decimal.tan = tan;\r\n Decimal.tanh = tanh; // ES6\r\n Decimal.trunc = trunc; // ES6\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n if (obj.defaults !== true) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction div(x, y) {\r\n return new this(x).div(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The power to which to raise the base of the natural log.\r\n *\r\n */\r\nfunction exp(x) {\r\n return new this(x).exp();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction floor(x) {\r\n return finalise(x = new this(x), x.e + 1, 3);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction hypot() {\r\n var i, n,\r\n t = new this(0);\r\n\r\n external = false;\r\n\r\n for (i = 0; i < arguments.length;) {\r\n n = new this(arguments[i++]);\r\n if (!n.d) {\r\n if (n.s) {\r\n external = true;\r\n return new this(1 / 0);\r\n }\r\n t = n;\r\n } else if (t.d) {\r\n t = t.plus(n.times(n));\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return t.sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),\r\n * otherwise return false.\r\n *\r\n */\r\nfunction isDecimalInstance(obj) {\r\n return obj instanceof Decimal || obj && obj.toStringTag === tag || false;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ln(x) {\r\n return new this(x).ln();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base\r\n * is specified, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * log[y](x)\r\n *\r\n * x {number|string|Decimal} The argument of the logarithm.\r\n * y {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nfunction log(x, y) {\r\n return new this(x).log(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log2(x) {\r\n return new this(x).log(2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log10(x) {\r\n return new this(x).log(10);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction max() {\r\n return maxOrMin(this, arguments, 'lt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction min() {\r\n return maxOrMin(this, arguments, 'gt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mod(x, y) {\r\n return new this(x).mod(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mul(x, y) {\r\n return new this(x).mul(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The base.\r\n * y {number|string|Decimal} The exponent.\r\n *\r\n */\r\nfunction pow(x, y) {\r\n return new this(x).pow(y);\r\n}\r\n\r\n\r\n/*\r\n * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with\r\n * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros\r\n * are produced).\r\n *\r\n * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.\r\n *\r\n */\r\nfunction random(sd) {\r\n var d, e, k, n,\r\n i = 0,\r\n r = new this(1),\r\n rd = [];\r\n\r\n if (sd === void 0) sd = this.precision;\r\n else checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n k = Math.ceil(sd / LOG_BASE);\r\n\r\n if (!this.crypto) {\r\n for (; i < k;) rd[i++] = Math.random() * 1e7 | 0;\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n } else if (crypto.getRandomValues) {\r\n d = crypto.getRandomValues(new Uint32Array(k));\r\n\r\n for (; i < k;) {\r\n n = d[i];\r\n\r\n // 0 <= n < 4294967296\r\n // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).\r\n if (n >= 4.29e9) {\r\n d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\r\n } else {\r\n\r\n // 0 <= n <= 4289999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd[i++] = n % 1e7;\r\n }\r\n }\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n d = crypto.randomBytes(k *= 4);\r\n\r\n for (; i < k;) {\r\n\r\n // 0 <= n < 2147483648\r\n n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);\r\n\r\n // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).\r\n if (n >= 2.14e9) {\r\n crypto.randomBytes(4).copy(d, i);\r\n } else {\r\n\r\n // 0 <= n <= 2139999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd.push(n % 1e7);\r\n i += 4;\r\n }\r\n }\r\n\r\n i = k / 4;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n\r\n k = rd[--i];\r\n sd %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to sd.\r\n if (k && sd) {\r\n n = mathpow(10, LOG_BASE - sd);\r\n rd[i] = (k / n | 0) * n;\r\n }\r\n\r\n // Remove trailing words which are zero.\r\n for (; rd[i] === 0; i--) rd.pop();\r\n\r\n // Zero?\r\n if (i < 0) {\r\n e = 0;\r\n rd = [0];\r\n } else {\r\n e = -1;\r\n\r\n // Remove leading words which are zero and adjust exponent accordingly.\r\n for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\r\n\r\n // Count the digits of the first word of rd to determine leading zeros.\r\n for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\r\n\r\n // Adjust the exponent for leading zeros of the first word of rd.\r\n if (k < LOG_BASE) e -= LOG_BASE - k;\r\n }\r\n\r\n r.e = e;\r\n r.d = rd;\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.\r\n *\r\n * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction round(x) {\r\n return finalise(x = new this(x), x.e + 1, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if x > 0,\r\n * -1 if x < 0,\r\n * 0 if x is 0,\r\n * -0 if x is -0,\r\n * NaN otherwise\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sign(x) {\r\n x = new this(x);\r\n return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sin(x) {\r\n return new this(x).sin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sinh(x) {\r\n return new this(x).sinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sqrt(x) {\r\n return new this(x).sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction sub(x, y) {\r\n return new this(x).sub(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of the arguments, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * Only the result is rounded, not the intermediate calculations.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction sum() {\r\n var i = 0,\r\n args = arguments,\r\n x = new this(args[i]);\r\n\r\n external = false;\r\n for (; x.s && ++i < args.length;) x = x.plus(args[i]);\r\n external = true;\r\n\r\n return finalise(x, this.precision, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tan(x) {\r\n return new this(x).tan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tanh(x) {\r\n return new this(x).tanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` truncated to an integer.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction trunc(x) {\r\n return finalise(x = new this(x), x.e + 1, 1);\r\n}\r\n\r\n\r\nP[Symbol.for('nodejs.util.inspect.custom')] = P.toString;\r\nP[Symbol.toStringTag] = 'Decimal';\r\n\r\n// Create and configure initial Decimal constructor.\r\nexport var Decimal = P.constructor = clone(DEFAULTS);\r\n\r\n// Create the internal constants from their string values.\r\nLN10 = new Decimal(LN10);\r\nPI = new Decimal(PI);\r\n\r\nexport default Decimal;\r\n", "import Complex from 'complex.js';\nimport { format } from '../../utils/number.js';\nimport { isNumber, isUnit } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Complex';\nvar dependencies = [];\nexport var createComplexClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Attach type information\n */\n Object.defineProperty(Complex, 'name', {\n value: 'Complex'\n });\n Complex.prototype.constructor = Complex;\n Complex.prototype.type = 'Complex';\n Complex.prototype.isComplex = true;\n\n /**\n * Get a JSON representation of the complex number\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Complex\", \"re\": 2, \"im\": 3}`\n */\n Complex.prototype.toJSON = function () {\n return {\n mathjs: 'Complex',\n re: this.re,\n im: this.im\n };\n };\n\n /*\n * Return the value of the complex number in polar notation\n * The angle phi will be set in the interval of [-pi, pi].\n * @return {{r: number, phi: number}} Returns and object with properties r and phi.\n */\n Complex.prototype.toPolar = function () {\n return {\n r: this.abs(),\n phi: this.arg()\n };\n };\n\n /**\n * Get a string representation of the complex number,\n * with optional formatting options.\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @return {string} str\n */\n Complex.prototype.format = function (options) {\n var str = '';\n var im = this.im;\n var re = this.re;\n var strRe = format(this.re, options);\n var strIm = format(this.im, options);\n\n // round either re or im when smaller than the configured precision\n var precision = isNumber(options) ? options : options ? options.precision : null;\n if (precision !== null) {\n var epsilon = Math.pow(10, -precision);\n if (Math.abs(re / im) < epsilon) {\n re = 0;\n }\n if (Math.abs(im / re) < epsilon) {\n im = 0;\n }\n }\n if (im === 0) {\n // real value\n str = strRe;\n } else if (re === 0) {\n // purely complex value\n if (im === 1) {\n str = 'i';\n } else if (im === -1) {\n str = '-i';\n } else {\n str = strIm + 'i';\n }\n } else {\n // complex value\n if (im < 0) {\n if (im === -1) {\n str = strRe + ' - i';\n } else {\n str = strRe + ' - ' + strIm.substring(1) + 'i';\n }\n } else {\n if (im === 1) {\n str = strRe + ' + i';\n } else {\n str = strRe + ' + ' + strIm + 'i';\n }\n }\n }\n return str;\n };\n\n /**\n * Create a complex number from polar coordinates\n *\n * Usage:\n *\n * Complex.fromPolar(r: number, phi: number) : Complex\n * Complex.fromPolar({r: number, phi: number}) : Complex\n *\n * @param {*} args...\n * @return {Complex}\n */\n Complex.fromPolar = function (args) {\n switch (arguments.length) {\n case 1:\n {\n var arg = arguments[0];\n if (typeof arg === 'object') {\n return Complex(arg);\n } else {\n throw new TypeError('Input has to be an object with r and phi keys.');\n }\n }\n case 2:\n {\n var r = arguments[0];\n var phi = arguments[1];\n if (isNumber(r)) {\n if (isUnit(phi) && phi.hasBase('ANGLE')) {\n // convert unit to a number in radians\n phi = phi.toNumber('rad');\n }\n if (isNumber(phi)) {\n return new Complex({\n r,\n phi\n });\n }\n throw new TypeError('Phi is not a number nor an angle unit.');\n } else {\n throw new TypeError('Radius r is not a number.');\n }\n }\n default:\n throw new SyntaxError('Wrong number of arguments in function fromPolar');\n }\n };\n Complex.prototype.valueOf = Complex.prototype.toString;\n\n /**\n * Create a Complex number from a JSON object\n * @param {Object} json A JSON Object structured as\n * {\"mathjs\": \"Complex\", \"re\": 2, \"im\": 3}\n * All properties are optional, default values\n * for `re` and `im` are 0.\n * @return {Complex} Returns a new Complex number\n */\n Complex.fromJSON = function (json) {\n return new Complex(json);\n };\n\n /**\n * Compare two complex numbers, `a` and `b`:\n *\n * - Returns 1 when the real part of `a` is larger than the real part of `b`\n * - Returns -1 when the real part of `a` is smaller than the real part of `b`\n * - Returns 1 when the real parts are equal\n * and the imaginary part of `a` is larger than the imaginary part of `b`\n * - Returns -1 when the real parts are equal\n * and the imaginary part of `a` is smaller than the imaginary part of `b`\n * - Returns 0 when both real and imaginary parts are equal.\n *\n * @params {Complex} a\n * @params {Complex} b\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n Complex.compare = function (a, b) {\n if (a.re > b.re) {\n return 1;\n }\n if (a.re < b.re) {\n return -1;\n }\n if (a.im > b.im) {\n return 1;\n }\n if (a.im < b.im) {\n return -1;\n }\n return 0;\n };\n return Complex;\n}, {\n isClass: true\n});", "import Fraction from 'fraction.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Fraction';\nvar dependencies = [];\nexport var createFractionClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Attach type information\n */\n Object.defineProperty(Fraction, 'name', {\n value: 'Fraction'\n });\n Fraction.prototype.constructor = Fraction;\n Fraction.prototype.type = 'Fraction';\n Fraction.prototype.isFraction = true;\n\n /**\n * Get a JSON representation of a Fraction containing type information\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Fraction\", \"n\": 3, \"d\": 8}`\n */\n Fraction.prototype.toJSON = function () {\n return {\n mathjs: 'Fraction',\n n: this.s * this.n,\n d: this.d\n };\n };\n\n /**\n * Instantiate a Fraction from a JSON object\n * @param {Object} json a JSON object structured as:\n * `{\"mathjs\": \"Fraction\", \"n\": 3, \"d\": 8}`\n * @return {BigNumber}\n */\n Fraction.fromJSON = function (json) {\n return new Fraction(json);\n };\n return Fraction;\n}, {\n isClass: true\n});", "/**\n * @license Fraction.js v4.3.7 31/08/2023\n * https://www.xarg.org/2014/03/rational-numbers-in-javascript/\n *\n * Copyright (c) 2023, Robert Eisele (robert@raw.org)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n **/\n\n\n/**\n *\n * This class offers the possibility to calculate fractions.\n * You can pass a fraction in different formats. Either as array, as double, as string or as an integer.\n *\n * Array/Object form\n * [ 0 => , 1 => ]\n * [ n => , d => ]\n *\n * Integer form\n * - Single integer value\n *\n * Double form\n * - Single double value\n *\n * String form\n * 123.456 - a simple double\n * 123/456 - a string fraction\n * 123.'456' - a double with repeating decimal places\n * 123.(456) - synonym\n * 123.45'6' - a double with repeating last place\n * 123.45(6) - synonym\n *\n * Example:\n *\n * var f = new Fraction(\"9.4'31'\");\n * f.mul([-4, 3]).div(4.9);\n *\n */\n\n\n// Maximum search depth for cyclic rational numbers. 2000 should be more than enough.\n// Example: 1/7 = 0.(142857) has 6 repeating decimal places.\n// If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits\nvar MAX_CYCLE_LEN = 2000;\n\n// Parsed data to avoid calling \"new\" all the time\nvar P = {\n \"s\": 1,\n \"n\": 0,\n \"d\": 1\n};\n\nfunction assign(n, s) {\n\n if (isNaN(n = parseInt(n, 10))) {\n throw InvalidParameter();\n }\n return n * s;\n}\n\n// Creates a new Fraction internally without the need of the bulky constructor\nfunction newFraction(n, d) {\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n var f = Object.create(Fraction.prototype);\n f[\"s\"] = n < 0 ? -1 : 1;\n\n n = n < 0 ? -n : n;\n\n var a = gcd(n, d);\n\n f[\"n\"] = n / a;\n f[\"d\"] = d / a;\n return f;\n}\n\nfunction factorize(num) {\n\n var factors = {};\n\n var n = num;\n var i = 2;\n var s = 4;\n\n while (s <= n) {\n\n while (n % i === 0) {\n n/= i;\n factors[i] = (factors[i] || 0) + 1;\n }\n s+= 1 + 2 * i++;\n }\n\n if (n !== num) {\n if (n > 1)\n factors[n] = (factors[n] || 0) + 1;\n } else {\n factors[num] = (factors[num] || 0) + 1;\n }\n return factors;\n}\n\nvar parse = function(p1, p2) {\n\n var n = 0, d = 1, s = 1;\n var v = 0, w = 0, x = 0, y = 1, z = 1;\n\n var A = 0, B = 1;\n var C = 1, D = 1;\n\n var N = 10000000;\n var M;\n\n if (p1 === undefined || p1 === null) {\n /* void */\n } else if (p2 !== undefined) {\n n = p1;\n d = p2;\n s = n * d;\n\n if (n % 1 !== 0 || d % 1 !== 0) {\n throw NonIntegerParameter();\n }\n\n } else\n switch (typeof p1) {\n\n case \"object\":\n {\n if (\"d\" in p1 && \"n\" in p1) {\n n = p1[\"n\"];\n d = p1[\"d\"];\n if (\"s\" in p1)\n n*= p1[\"s\"];\n } else if (0 in p1) {\n n = p1[0];\n if (1 in p1)\n d = p1[1];\n } else {\n throw InvalidParameter();\n }\n s = n * d;\n break;\n }\n case \"number\":\n {\n if (p1 < 0) {\n s = p1;\n p1 = -p1;\n }\n\n if (p1 % 1 === 0) {\n n = p1;\n } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow\n\n if (p1 >= 1) {\n z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10));\n p1/= z;\n }\n\n // Using Farey Sequences\n // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/\n\n while (B <= N && D <= N) {\n M = (A + C) / (B + D);\n\n if (p1 === M) {\n if (B + D <= N) {\n n = A + C;\n d = B + D;\n } else if (D > B) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n break;\n\n } else {\n\n if (p1 > M) {\n A+= C;\n B+= D;\n } else {\n C+= A;\n D+= B;\n }\n\n if (B > N) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n }\n }\n n*= z;\n } else if (isNaN(p1) || isNaN(p2)) {\n d = n = NaN;\n }\n break;\n }\n case \"string\":\n {\n B = p1.match(/\\d+|./g);\n\n if (B === null)\n throw InvalidParameter();\n\n if (B[A] === '-') {// Check for minus sign at the beginning\n s = -1;\n A++;\n } else if (B[A] === '+') {// Check for plus sign at the beginning\n A++;\n }\n\n if (B.length === A + 1) { // Check if it's just a simple number \"1234\"\n w = assign(B[A++], s);\n } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number\n\n if (B[A] !== '.') { // Handle 0.5 and .5\n v = assign(B[A++], s);\n }\n A++;\n\n // Check for decimal places\n if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === \"'\" && B[A + 3] === \"'\") {\n w = assign(B[A], s);\n y = Math.pow(10, B[A].length);\n A++;\n }\n\n // Check for repeating places\n if (B[A] === '(' && B[A + 2] === ')' || B[A] === \"'\" && B[A + 2] === \"'\") {\n x = assign(B[A + 1], s);\n z = Math.pow(10, B[A + 1].length) - 1;\n A+= 3;\n }\n\n } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction \"123/456\" or \"123:456\"\n w = assign(B[A], s);\n y = assign(B[A + 2], 1);\n A+= 3;\n } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction \"123 1/2\"\n v = assign(B[A], s);\n w = assign(B[A + 2], s);\n y = assign(B[A + 4], 1);\n A+= 5;\n }\n\n if (B.length <= A) { // Check for more tokens on the stack\n d = y * z;\n s = /* void */\n n = x + d * v + z * w;\n break;\n }\n\n /* Fall through on error */\n }\n default:\n throw InvalidParameter();\n }\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n P[\"s\"] = s < 0 ? -1 : 1;\n P[\"n\"] = Math.abs(n);\n P[\"d\"] = Math.abs(d);\n};\n\nfunction modpow(b, e, m) {\n\n var r = 1;\n for (; e > 0; b = (b * b) % m, e >>= 1) {\n\n if (e & 1) {\n r = (r * b) % m;\n }\n }\n return r;\n}\n\n\nfunction cycleLen(n, d) {\n\n for (; d % 2 === 0;\n d/= 2) {\n }\n\n for (; d % 5 === 0;\n d/= 5) {\n }\n\n if (d === 1) // Catch non-cyclic numbers\n return 0;\n\n // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem:\n // 10^(d-1) % d == 1\n // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone,\n // as we want to translate the numbers to strings.\n\n var rem = 10 % d;\n var t = 1;\n\n for (; rem !== 1; t++) {\n rem = rem * 10 % d;\n\n if (t > MAX_CYCLE_LEN)\n return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1`\n }\n return t;\n}\n\n\nfunction cycleStart(n, d, len) {\n\n var rem1 = 1;\n var rem2 = modpow(10, len, d);\n\n for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE)\n // Solve 10^s == 10^(s+t) (mod d)\n\n if (rem1 === rem2)\n return t;\n\n rem1 = rem1 * 10 % d;\n rem2 = rem2 * 10 % d;\n }\n return 0;\n}\n\nfunction gcd(a, b) {\n\n if (!a)\n return b;\n if (!b)\n return a;\n\n while (1) {\n a%= b;\n if (!a)\n return b;\n b%= a;\n if (!b)\n return a;\n }\n};\n\n/**\n * Module constructor\n *\n * @constructor\n * @param {number|Fraction=} a\n * @param {number=} b\n */\nexport default function Fraction(a, b) {\n\n parse(a, b);\n\n if (this instanceof Fraction) {\n a = gcd(P[\"d\"], P[\"n\"]); // Abuse variable a\n this[\"s\"] = P[\"s\"];\n this[\"n\"] = P[\"n\"] / a;\n this[\"d\"] = P[\"d\"] / a;\n } else {\n return newFraction(P['s'] * P['n'], P['d']);\n }\n}\n\nvar DivisionByZero = function() { return new Error(\"Division by Zero\"); };\nvar InvalidParameter = function() { return new Error(\"Invalid argument\"); };\nvar NonIntegerParameter = function() { return new Error(\"Parameters must be integer\"); };\n\nFraction.prototype = {\n\n \"s\": 1,\n \"n\": 0,\n \"d\": 1,\n\n /**\n * Calculates the absolute value\n *\n * Ex: new Fraction(-4).abs() => 4\n **/\n \"abs\": function() {\n\n return newFraction(this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Inverts the sign of the current fraction\n *\n * Ex: new Fraction(-4).neg() => 4\n **/\n \"neg\": function() {\n\n return newFraction(-this[\"s\"] * this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Adds two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => 467 / 30\n **/\n \"add\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] + P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Subtracts two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => -427 / 30\n **/\n \"sub\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Multiplies two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").mul(3) => 5776 / 111\n **/\n \"mul\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Divides two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").inverse().div(3)\n **/\n \"div\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"d\"],\n this[\"d\"] * P[\"n\"]\n );\n },\n\n /**\n * Clones the actual object\n *\n * Ex: new Fraction(\"-17.(345)\").clone()\n **/\n \"clone\": function() {\n return newFraction(this['s'] * this['n'], this['d']);\n },\n\n /**\n * Calculates the modulo of two rational numbers - a more precise fmod\n *\n * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6)\n **/\n \"mod\": function(a, b) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return new Fraction(NaN);\n }\n\n if (a === undefined) {\n return newFraction(this[\"s\"] * this[\"n\"] % this[\"d\"], 1);\n }\n\n parse(a, b);\n if (0 === P[\"n\"] && 0 === this[\"d\"]) {\n throw DivisionByZero();\n }\n\n /*\n * First silly attempt, kinda slow\n *\n return that[\"sub\"]({\n \"n\": num[\"n\"] * Math.floor((this.n / this.d) / (num.n / num.d)),\n \"d\": num[\"d\"],\n \"s\": this[\"s\"]\n });*/\n\n /*\n * New attempt: a1 / b1 = a2 / b2 * q + r\n * => b2 * a1 = a2 * b1 * q + b1 * b2 * r\n * => (b2 * a1 % a2 * b1) / (b1 * b2)\n */\n return newFraction(\n this[\"s\"] * (P[\"d\"] * this[\"n\"]) % (P[\"n\"] * this[\"d\"]),\n P[\"d\"] * this[\"d\"]\n );\n },\n\n /**\n * Calculates the fractional gcd of two rational numbers\n *\n * Ex: new Fraction(5,8).gcd(3,7) => 1/56\n */\n \"gcd\": function(a, b) {\n\n parse(a, b);\n\n // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d)\n\n return newFraction(gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]), P[\"d\"] * this[\"d\"]);\n },\n\n /**\n * Calculates the fractional lcm of two rational numbers\n *\n * Ex: new Fraction(5,8).lcm(3,7) => 15\n */\n \"lcm\": function(a, b) {\n\n parse(a, b);\n\n // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d)\n\n if (P[\"n\"] === 0 && this[\"n\"] === 0) {\n return newFraction(0, 1);\n }\n return newFraction(P[\"n\"] * this[\"n\"], gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]));\n },\n\n /**\n * Calculates the ceil of a rational number\n *\n * Ex: new Fraction('4.(3)').ceil() => (5 / 1)\n **/\n \"ceil\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.ceil(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Calculates the floor of a rational number\n *\n * Ex: new Fraction('4.(3)').floor() => (4 / 1)\n **/\n \"floor\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.floor(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational number\n *\n * Ex: new Fraction('4.(3)').round() => (4 / 1)\n **/\n \"round\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.round(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational number to a multiple of another rational number\n *\n * Ex: new Fraction('0.9').roundTo(\"1/8\") => 7 / 8\n **/\n \"roundTo\": function(a, b) {\n\n /*\n k * x/y \u2264 a/b < (k+1) * x/y\n \u21D4 k \u2264 a/b / (x/y) < (k+1)\n \u21D4 k = floor(a/b * y/x)\n */\n\n parse(a, b);\n\n return newFraction(this['s'] * Math.round(this['n'] * P['d'] / (this['d'] * P['n'])) * P['n'], P['d']);\n },\n\n /**\n * Gets the inverse of the fraction, means numerator and denominator are exchanged\n *\n * Ex: new Fraction([-3, 4]).inverse() => -4 / 3\n **/\n \"inverse\": function() {\n\n return newFraction(this[\"s\"] * this[\"d\"], this[\"n\"]);\n },\n\n /**\n * Calculates the fraction to some rational exponent, if possible\n *\n * Ex: new Fraction(-1,2).pow(-3) => -8\n */\n \"pow\": function(a, b) {\n\n parse(a, b);\n\n // Trivial case when exp is an integer\n\n if (P['d'] === 1) {\n\n if (P['s'] < 0) {\n return newFraction(Math.pow(this['s'] * this[\"d\"], P['n']), Math.pow(this[\"n\"], P['n']));\n } else {\n return newFraction(Math.pow(this['s'] * this[\"n\"], P['n']), Math.pow(this[\"d\"], P['n']));\n }\n }\n\n // Negative roots become complex\n // (-a/b)^(c/d) = x\n // <=> (-1)^(c/d) * (a/b)^(c/d) = x\n // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180\u00B0\n // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index )\n // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case.\n if (this['s'] < 0) return null;\n\n // Now prime factor n and d\n var N = factorize(this['n']);\n var D = factorize(this['d']);\n\n // Exponentiate and take root for n and d individually\n var n = 1;\n var d = 1;\n for (var k in N) {\n if (k === '1') continue;\n if (k === '0') {\n n = 0;\n break;\n }\n N[k]*= P['n'];\n\n if (N[k] % P['d'] === 0) {\n N[k]/= P['d'];\n } else return null;\n n*= Math.pow(k, N[k]);\n }\n\n for (var k in D) {\n if (k === '1') continue;\n D[k]*= P['n'];\n\n if (D[k] % P['d'] === 0) {\n D[k]/= P['d'];\n } else return null;\n d*= Math.pow(k, D[k]);\n }\n\n if (P['s'] < 0) {\n return newFraction(d, n);\n }\n return newFraction(n, d);\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"equals\": function(a, b) {\n\n parse(a, b);\n return this[\"s\"] * this[\"n\"] * P[\"d\"] === P[\"s\"] * P[\"n\"] * this[\"d\"]; // Same as compare() === 0\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"compare\": function(a, b) {\n\n parse(a, b);\n var t = (this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * P[\"n\"] * this[\"d\"]);\n return (0 < t) - (t < 0);\n },\n\n \"simplify\": function(eps) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return this;\n }\n\n eps = eps || 0.001;\n\n var thisABS = this['abs']();\n var cont = thisABS['toContinued']();\n\n for (var i = 1; i < cont.length; i++) {\n\n var s = newFraction(cont[i - 1], 1);\n for (var k = i - 2; k >= 0; k--) {\n s = s['inverse']()['add'](cont[k]);\n }\n\n if (Math.abs(s['sub'](thisABS).valueOf()) < eps) {\n return s['mul'](this['s']);\n }\n }\n return this;\n },\n\n /**\n * Check if two rational numbers are divisible\n *\n * Ex: new Fraction(19.6).divisible(1.5);\n */\n \"divisible\": function(a, b) {\n\n parse(a, b);\n return !(!(P[\"n\"] * this[\"d\"]) || ((this[\"n\"] * P[\"d\"]) % (P[\"n\"] * this[\"d\"])));\n },\n\n /**\n * Returns a decimal representation of the fraction\n *\n * Ex: new Fraction(\"100.'91823'\").valueOf() => 100.91823918239183\n **/\n 'valueOf': function() {\n\n return this[\"s\"] * this[\"n\"] / this[\"d\"];\n },\n\n /**\n * Returns a string-fraction representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toFraction(true) => \"4 1/3\"\n **/\n 'toFraction': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n str+= \" \";\n n%= d;\n }\n\n str+= n;\n str+= '/';\n str+= d;\n }\n return str;\n },\n\n /**\n * Returns a latex representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toLatex() => \"\\frac{4}{3}\"\n **/\n 'toLatex': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n n%= d;\n }\n\n str+= \"\\\\frac{\";\n str+= n;\n str+= '}{';\n str+= d;\n str+= '}';\n }\n return str;\n },\n\n /**\n * Returns an array of continued fraction elements\n *\n * Ex: new Fraction(\"7/8\").toContinued() => [0,1,7]\n */\n 'toContinued': function() {\n\n var t;\n var a = this['n'];\n var b = this['d'];\n var res = [];\n\n if (isNaN(a) || isNaN(b)) {\n return res;\n }\n\n do {\n res.push(Math.floor(a / b));\n t = a % b;\n a = b;\n b = t;\n } while (a !== 1);\n\n return res;\n },\n\n /**\n * Creates a string representation of a fraction with all digits\n *\n * Ex: new Fraction(\"100.'91823'\").toString() => \"100.(91823)\"\n **/\n 'toString': function(dec) {\n\n var N = this[\"n\"];\n var D = this[\"d\"];\n\n if (isNaN(N) || isNaN(D)) {\n return \"NaN\";\n }\n\n dec = dec || 15; // 15 = decimal places when no repetation\n\n var cycLen = cycleLen(N, D); // Cycle length\n var cycOff = cycleStart(N, D, cycLen); // Cycle start\n\n var str = this['s'] < 0 ? \"-\" : \"\";\n\n str+= N / D | 0;\n\n N%= D;\n N*= 10;\n\n if (N)\n str+= \".\";\n\n if (cycLen) {\n\n for (var i = cycOff; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \"(\";\n for (var i = cycLen; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \")\";\n } else {\n for (var i = dec; N && i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n }\n return str;\n }\n};\n", "import { isBigNumber } from '../../utils/is.js';\nimport { format, sign } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Range';\nvar dependencies = [];\nexport var createRangeClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Create a range. A range has a start, step, and end, and contains functions\n * to iterate over the range.\n *\n * A range can be constructed as:\n *\n * const range = new Range(start, end)\n * const range = new Range(start, end, step)\n *\n * To get the result of the range:\n * range.forEach(function (x) {\n * console.log(x)\n * })\n * range.map(function (x) {\n * return math.sin(x)\n * })\n * range.toArray()\n *\n * Example usage:\n *\n * const c = new Range(2, 6) // 2:1:5\n * c.toArray() // [2, 3, 4, 5]\n * const d = new Range(2, -3, -1) // 2:-1:-2\n * d.toArray() // [2, 1, 0, -1, -2]\n *\n * @class Range\n * @constructor Range\n * @param {number} start included lower bound\n * @param {number} end excluded upper bound\n * @param {number} [step] step size, default value is 1\n */\n function Range(start, end, step) {\n if (!(this instanceof Range)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n var hasStart = start !== null && start !== undefined;\n var hasEnd = end !== null && end !== undefined;\n var hasStep = step !== null && step !== undefined;\n if (hasStart) {\n if (isBigNumber(start)) {\n start = start.toNumber();\n } else if (typeof start !== 'number') {\n throw new TypeError('Parameter start must be a number');\n }\n }\n if (hasEnd) {\n if (isBigNumber(end)) {\n end = end.toNumber();\n } else if (typeof end !== 'number') {\n throw new TypeError('Parameter end must be a number');\n }\n }\n if (hasStep) {\n if (isBigNumber(step)) {\n step = step.toNumber();\n } else if (typeof step !== 'number') {\n throw new TypeError('Parameter step must be a number');\n }\n }\n this.start = hasStart ? parseFloat(start) : 0;\n this.end = hasEnd ? parseFloat(end) : 0;\n this.step = hasStep ? parseFloat(step) : 1;\n }\n\n /**\n * Attach type information\n */\n Range.prototype.type = 'Range';\n Range.prototype.isRange = true;\n\n /**\n * Parse a string into a range,\n * The string contains the start, optional step, and end, separated by a colon.\n * If the string does not contain a valid range, null is returned.\n * For example str='0:2:11'.\n * @memberof Range\n * @param {string} str\n * @return {Range | null} range\n */\n Range.parse = function (str) {\n if (typeof str !== 'string') {\n return null;\n }\n var args = str.split(':');\n var nums = args.map(function (arg) {\n return parseFloat(arg);\n });\n var invalid = nums.some(function (num) {\n return isNaN(num);\n });\n if (invalid) {\n return null;\n }\n switch (nums.length) {\n case 2:\n return new Range(nums[0], nums[1]);\n case 3:\n return new Range(nums[0], nums[2], nums[1]);\n default:\n return null;\n }\n };\n\n /**\n * Create a clone of the range\n * @return {Range} clone\n */\n Range.prototype.clone = function () {\n return new Range(this.start, this.end, this.step);\n };\n\n /**\n * Retrieve the size of the range.\n * Returns an array containing one number, the number of elements in the range.\n * @memberof Range\n * @returns {number[]} size\n */\n Range.prototype.size = function () {\n var len = 0;\n var start = this.start;\n var step = this.step;\n var end = this.end;\n var diff = end - start;\n if (sign(step) === sign(diff)) {\n len = Math.ceil(diff / step);\n } else if (diff === 0) {\n len = 0;\n }\n if (isNaN(len)) {\n len = 0;\n }\n return [len];\n };\n\n /**\n * Calculate the minimum value in the range\n * @memberof Range\n * @return {number | undefined} min\n */\n Range.prototype.min = function () {\n var size = this.size()[0];\n if (size > 0) {\n if (this.step > 0) {\n // positive step\n return this.start;\n } else {\n // negative step\n return this.start + (size - 1) * this.step;\n }\n } else {\n return undefined;\n }\n };\n\n /**\n * Calculate the maximum value in the range\n * @memberof Range\n * @return {number | undefined} max\n */\n Range.prototype.max = function () {\n var size = this.size()[0];\n if (size > 0) {\n if (this.step > 0) {\n // positive step\n return this.start + (size - 1) * this.step;\n } else {\n // negative step\n return this.start;\n }\n } else {\n return undefined;\n }\n };\n\n /**\n * Execute a callback function for each value in the range.\n * @memberof Range\n * @param {function} callback The callback method is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Range being traversed.\n */\n Range.prototype.forEach = function (callback) {\n var x = this.start;\n var step = this.step;\n var end = this.end;\n var i = 0;\n if (step > 0) {\n while (x < end) {\n callback(x, [i], this);\n x += step;\n i++;\n }\n } else if (step < 0) {\n while (x > end) {\n callback(x, [i], this);\n x += step;\n i++;\n }\n }\n };\n\n /**\n * Execute a callback function for each value in the Range, and return the\n * results as an array\n * @memberof Range\n * @param {function} callback The callback method is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @returns {Array} array\n */\n Range.prototype.map = function (callback) {\n var array = [];\n this.forEach(function (value, index, obj) {\n array[index[0]] = callback(value, index, obj);\n });\n return array;\n };\n\n /**\n * Create an Array with a copy of the Ranges data\n * @memberof Range\n * @returns {Array} array\n */\n Range.prototype.toArray = function () {\n var array = [];\n this.forEach(function (value, index) {\n array[index[0]] = value;\n });\n return array;\n };\n\n /**\n * Get the primitive value of the Range, a one dimensional array\n * @memberof Range\n * @returns {Array} array\n */\n Range.prototype.valueOf = function () {\n // TODO: implement a caching mechanism for range.valueOf()\n return this.toArray();\n };\n\n /**\n * Get a string representation of the range, with optional formatting options.\n * Output is formatted as 'start:step:end', for example '2:6' or '0:0.2:11'\n * @memberof Range\n * @param {Object | number | function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n Range.prototype.format = function (options) {\n var str = format(this.start, options);\n if (this.step !== 1) {\n str += ':' + format(this.step, options);\n }\n str += ':' + format(this.end, options);\n return str;\n };\n\n /**\n * Get a string representation of the range.\n * @memberof Range\n * @returns {string}\n */\n Range.prototype.toString = function () {\n return this.format();\n };\n\n /**\n * Get a JSON representation of the range\n * @memberof Range\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Range\", \"start\": 2, \"end\": 4, \"step\": 1}`\n */\n Range.prototype.toJSON = function () {\n return {\n mathjs: 'Range',\n start: this.start,\n end: this.end,\n step: this.step\n };\n };\n\n /**\n * Instantiate a Range from a JSON object\n * @memberof Range\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Range\", \"start\": 2, \"end\": 4, \"step\": 1}`\n * @return {Range}\n */\n Range.fromJSON = function (json) {\n return new Range(json.start, json.end, json.step);\n };\n return Range;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'Matrix';\nvar dependencies = [];\nexport var createMatrixClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * @constructor Matrix\n *\n * A Matrix is a wrapper around an Array. A matrix can hold a multi dimensional\n * array. A matrix can be constructed as:\n *\n * let matrix = math.matrix(data)\n *\n * Matrix contains the functions to resize, get and set values, get the size,\n * clone the matrix and to convert the matrix to a vector, array, or scalar.\n * Furthermore, one can iterate over the matrix using map and forEach.\n * The internal Array of the Matrix can be accessed using the function valueOf.\n *\n * Example usage:\n *\n * let matrix = math.matrix([[1, 2], [3, 4]])\n * matix.size() // [2, 2]\n * matrix.resize([3, 2], 5)\n * matrix.valueOf() // [[1, 2], [3, 4], [5, 5]]\n * matrix.subset([1,2]) // 3 (indexes are zero-based)\n *\n */\n function Matrix() {\n if (!(this instanceof Matrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n }\n\n /**\n * Attach type information\n */\n Matrix.prototype.type = 'Matrix';\n Matrix.prototype.isMatrix = true;\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @return {string} The storage format.\n */\n Matrix.prototype.storage = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke storage on a Matrix interface');\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @return {string} The datatype.\n */\n Matrix.prototype.datatype = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke datatype on a Matrix interface');\n };\n\n /**\n * Create a new Matrix With the type of the current matrix instance\n * @param {Array | Object} data\n * @param {string} [datatype]\n */\n Matrix.prototype.create = function (data, datatype) {\n throw new Error('Cannot invoke create on a Matrix interface');\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n Matrix.prototype.subset = function (index, replacement, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke subset on a Matrix interface');\n };\n\n /**\n * Get a single element from the matrix.\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n Matrix.prototype.get = function (index) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke get on a Matrix interface');\n };\n\n /**\n * Replace a single element in the matrix.\n * @param {number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {Matrix} self\n */\n Matrix.prototype.set = function (index, value, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke set on a Matrix interface');\n };\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @param {number[]} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n Matrix.prototype.resize = function (size, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke resize on a Matrix interface');\n };\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * @param {number[]} size The new size the matrix should have.\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n Matrix.prototype.reshape = function (size, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke reshape on a Matrix interface');\n };\n\n /**\n * Create a clone of the matrix\n * @return {Matrix} clone\n */\n Matrix.prototype.clone = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke clone on a Matrix interface');\n };\n\n /**\n * Retrieve the size of the matrix.\n * @returns {number[]} size\n */\n Matrix.prototype.size = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke size on a Matrix interface');\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {Matrix} matrix\n */\n Matrix.prototype.map = function (callback, skipZeros) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke map on a Matrix interface');\n };\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n */\n Matrix.prototype.forEach = function (callback) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke forEach on a Matrix interface');\n };\n\n /**\n * Iterate over the matrix elements\n * @return {Iterable<{ value, index: number[] }>}\n */\n Matrix.prototype[Symbol.iterator] = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot iterate a Matrix interface');\n };\n\n /**\n * Create an Array with a copy of the data of the Matrix\n * @returns {Array} array\n */\n Matrix.prototype.toArray = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke toArray on a Matrix interface');\n };\n\n /**\n * Get the primitive value of the Matrix: a multidimensional array\n * @returns {Array} array\n */\n Matrix.prototype.valueOf = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke valueOf on a Matrix interface');\n };\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n Matrix.prototype.format = function (options) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke format on a Matrix interface');\n };\n\n /**\n * Get a string representation of the matrix\n * @returns {string} str\n */\n Matrix.prototype.toString = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke toString on a Matrix interface');\n };\n return Matrix;\n}, {\n isClass: true\n});", "import { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js';\nimport { arraySize, getArrayDataType, processSizesWildcard, reshape, resize, unsqueeze, validate, validateIndex, broadcastTo } from '../../utils/array.js';\nimport { format } from '../../utils/string.js';\nimport { isInteger } from '../../utils/number.js';\nimport { clone, deepStrictEqual } from '../../utils/object.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nimport { maxArgumentCount } from '../../utils/function.js';\nvar name = 'DenseMatrix';\nvar dependencies = ['Matrix'];\nexport var createDenseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Matrix\n } = _ref;\n /**\n * Dense Matrix implementation. A regular, dense matrix, supporting multi-dimensional matrices. This is the default matrix type.\n * @class DenseMatrix\n * @enum {{ value, index: number[] }}\n */\n function DenseMatrix(data, datatype) {\n if (!(this instanceof DenseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data)) {\n // check data is a DenseMatrix\n if (data.type === 'DenseMatrix') {\n // clone data & size\n this._data = clone(data._data);\n this._size = clone(data._size);\n this._datatype = datatype || data._datatype;\n } else {\n // build data from existing matrix\n this._data = data.toArray();\n this._size = data.size();\n this._datatype = datatype || data._datatype;\n }\n } else if (data && isArray(data.data) && isArray(data.size)) {\n // initialize fields from JSON representation\n this._data = data.data;\n this._size = data.size;\n // verify the dimensions of the array\n validate(this._data, this._size);\n this._datatype = datatype || data.datatype;\n } else if (isArray(data)) {\n // replace nested Matrices with Arrays\n this._data = preprocess(data);\n // get the dimensions of the array\n this._size = arraySize(this._data);\n // verify the dimensions of the array, TODO: compute size while processing array\n validate(this._data, this._size);\n // data type unknown\n this._datatype = datatype;\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._data = [];\n this._size = [0];\n this._datatype = datatype;\n }\n }\n DenseMatrix.prototype = new Matrix();\n\n /**\n * Create a new DenseMatrix\n */\n DenseMatrix.prototype.createDenseMatrix = function (data, datatype) {\n return new DenseMatrix(data, datatype);\n };\n\n /**\n * Attach type information\n */\n Object.defineProperty(DenseMatrix, 'name', {\n value: 'DenseMatrix'\n });\n DenseMatrix.prototype.constructor = DenseMatrix;\n DenseMatrix.prototype.type = 'DenseMatrix';\n DenseMatrix.prototype.isDenseMatrix = true;\n\n /**\n * Get the matrix type\n *\n * Usage:\n * const matrixType = matrix.getDataType() // retrieves the matrix type\n *\n * @memberOf DenseMatrix\n * @return {string} type information; if multiple types are found from the Matrix, it will return \"mixed\"\n */\n DenseMatrix.prototype.getDataType = function () {\n return getArrayDataType(this._data, typeOf);\n };\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @memberof DenseMatrix\n * @return {string} The storage format.\n */\n DenseMatrix.prototype.storage = function () {\n return 'dense';\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @memberof DenseMatrix\n * @return {string} The datatype.\n */\n DenseMatrix.prototype.datatype = function () {\n return this._datatype;\n };\n\n /**\n * Create a new DenseMatrix\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {string} [datatype]\n */\n DenseMatrix.prototype.create = function (data, datatype) {\n return new DenseMatrix(data, datatype);\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @memberof DenseMatrix\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n DenseMatrix.prototype.subset = function (index, replacement, defaultValue) {\n switch (arguments.length) {\n case 1:\n return _get(this, index);\n\n // intentional fall through\n case 2:\n case 3:\n return _set(this, index, replacement, defaultValue);\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n\n /**\n * Get a single element from the matrix.\n * @memberof DenseMatrix\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n DenseMatrix.prototype.get = function (index) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length !== this._size.length) {\n throw new DimensionError(index.length, this._size.length);\n }\n\n // check index\n for (var x = 0; x < index.length; x++) {\n validateIndex(index[x], this._size[x]);\n }\n var data = this._data;\n for (var i = 0, ii = index.length; i < ii; i++) {\n var indexI = index[i];\n validateIndex(indexI, data.length);\n data = data[indexI];\n }\n return data;\n };\n\n /**\n * Replace a single element in the matrix.\n * @memberof DenseMatrix\n * @param {number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {DenseMatrix} self\n */\n DenseMatrix.prototype.set = function (index, value, defaultValue) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length < this._size.length) {\n throw new DimensionError(index.length, this._size.length, '<');\n }\n var i, ii, indexI;\n\n // enlarge matrix when needed\n var size = index.map(function (i) {\n return i + 1;\n });\n _fit(this, size, defaultValue);\n\n // traverse over the dimensions\n var data = this._data;\n for (i = 0, ii = index.length - 1; i < ii; i++) {\n indexI = index[i];\n validateIndex(indexI, data.length);\n data = data[indexI];\n }\n\n // set new value\n indexI = index[index.length - 1];\n validateIndex(indexI, data.length);\n data[indexI] = value;\n return this;\n };\n\n /**\n * Get a submatrix of this matrix\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix\n * @param {Index} index Zero-based index\n * @private\n */\n function _get(matrix, index) {\n if (!isIndex(index)) {\n throw new TypeError('Invalid index');\n }\n var isScalar = index.isScalar();\n if (isScalar) {\n // return a scalar\n return matrix.get(index.min());\n } else {\n // validate dimensions\n var size = index.size();\n if (size.length !== matrix._size.length) {\n throw new DimensionError(size.length, matrix._size.length);\n }\n\n // validate if any of the ranges in the index is out of range\n var min = index.min();\n var max = index.max();\n for (var i = 0, ii = matrix._size.length; i < ii; i++) {\n validateIndex(min[i], matrix._size[i]);\n validateIndex(max[i], matrix._size[i]);\n }\n\n // retrieve submatrix\n // TODO: more efficient when creating an empty matrix and setting _data and _size manually\n return new DenseMatrix(_getSubmatrix(matrix._data, index, size.length, 0), matrix._datatype);\n }\n }\n\n /**\n * Recursively get a submatrix of a multi dimensional matrix.\n * Index is not checked for correct number or length of dimensions.\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {Index} index\n * @param {number} dims Total number of dimensions\n * @param {number} dim Current dimension\n * @return {Array} submatrix\n * @private\n */\n function _getSubmatrix(data, index, dims, dim) {\n var last = dim === dims - 1;\n var range = index.dimension(dim);\n if (last) {\n return range.map(function (i) {\n validateIndex(i, data.length);\n return data[i];\n }).valueOf();\n } else {\n return range.map(function (i) {\n validateIndex(i, data.length);\n var child = data[i];\n return _getSubmatrix(child, index, dims, dim + 1);\n }).valueOf();\n }\n }\n\n /**\n * Replace a submatrix in this matrix\n * Indexes are zero-based.\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix\n * @param {Index} index\n * @param {DenseMatrix | Array | *} submatrix\n * @param {*} defaultValue Default value, filled in on new entries when\n * the matrix is resized.\n * @return {DenseMatrix} matrix\n * @private\n */\n function _set(matrix, index, submatrix, defaultValue) {\n if (!index || index.isIndex !== true) {\n throw new TypeError('Invalid index');\n }\n\n // get index size and check whether the index contains a single value\n var iSize = index.size();\n var isScalar = index.isScalar();\n\n // calculate the size of the submatrix, and convert it into an Array if needed\n var sSize;\n if (isMatrix(submatrix)) {\n sSize = submatrix.size();\n submatrix = submatrix.valueOf();\n } else {\n sSize = arraySize(submatrix);\n }\n if (isScalar) {\n // set a scalar\n\n // check whether submatrix is a scalar\n if (sSize.length !== 0) {\n throw new TypeError('Scalar expected');\n }\n matrix.set(index.min(), submatrix, defaultValue);\n } else {\n // set a submatrix\n\n // broadcast submatrix\n if (!deepStrictEqual(sSize, iSize)) {\n try {\n if (sSize.length === 0) {\n submatrix = broadcastTo([submatrix], iSize);\n } else {\n submatrix = broadcastTo(submatrix, iSize);\n }\n sSize = arraySize(submatrix);\n } catch (_unused) {}\n }\n\n // validate dimensions\n if (iSize.length < matrix._size.length) {\n throw new DimensionError(iSize.length, matrix._size.length, '<');\n }\n if (sSize.length < iSize.length) {\n // calculate number of missing outer dimensions\n var i = 0;\n var outer = 0;\n while (iSize[i] === 1 && sSize[i] === 1) {\n i++;\n }\n while (iSize[i] === 1) {\n outer++;\n i++;\n }\n\n // unsqueeze both outer and inner dimensions\n submatrix = unsqueeze(submatrix, iSize.length, outer, sSize);\n }\n\n // check whether the size of the submatrix matches the index size\n if (!deepStrictEqual(iSize, sSize)) {\n throw new DimensionError(iSize, sSize, '>');\n }\n\n // enlarge matrix when needed\n var size = index.max().map(function (i) {\n return i + 1;\n });\n _fit(matrix, size, defaultValue);\n\n // insert the sub matrix\n var dims = iSize.length;\n var dim = 0;\n _setSubmatrix(matrix._data, index, submatrix, dims, dim);\n }\n return matrix;\n }\n\n /**\n * Replace a submatrix of a multi dimensional matrix.\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {Index} index\n * @param {Array} submatrix\n * @param {number} dims Total number of dimensions\n * @param {number} dim\n * @private\n */\n function _setSubmatrix(data, index, submatrix, dims, dim) {\n var last = dim === dims - 1;\n var range = index.dimension(dim);\n if (last) {\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n data[dataIndex] = submatrix[subIndex[0]];\n });\n } else {\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n _setSubmatrix(data[dataIndex], index, submatrix[subIndex[0]], dims, dim + 1);\n });\n }\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @memberof DenseMatrix\n * @param {number[] || Matrix} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n DenseMatrix.prototype.resize = function (size, defaultValue, copy) {\n // validate arguments\n if (!isCollection(size)) {\n throw new TypeError('Array or Matrix expected');\n }\n\n // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector\n var sizeArray = size.valueOf().map(value => {\n return Array.isArray(value) && value.length === 1 ? value[0] : value;\n });\n\n // matrix to resize\n var m = copy ? this.clone() : this;\n // resize matrix\n return _resize(m, sizeArray, defaultValue);\n };\n function _resize(matrix, size, defaultValue) {\n // check size\n if (size.length === 0) {\n // first value in matrix\n var v = matrix._data;\n // go deep\n while (isArray(v)) {\n v = v[0];\n }\n return v;\n }\n // resize matrix\n matrix._size = size.slice(0); // copy the array\n matrix._data = resize(matrix._data, matrix._size, defaultValue);\n // return matrix\n return matrix;\n }\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * NOTE: This might be better suited to copy by default, instead of modifying\n * in place. For now, it operates in place to remain consistent with\n * resize().\n *\n * @memberof DenseMatrix\n * @param {number[]} size The new size the matrix should have.\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n DenseMatrix.prototype.reshape = function (size, copy) {\n var m = copy ? this.clone() : this;\n m._data = reshape(m._data, size);\n var currentLength = m._size.reduce((length, size) => length * size);\n m._size = processSizesWildcard(size, currentLength);\n return m;\n };\n\n /**\n * Enlarge the matrix when it is smaller than given size.\n * If the matrix is larger or equal sized, nothing is done.\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix The matrix to be resized\n * @param {number[]} size\n * @param {*} defaultValue Default value, filled in on new entries.\n * @private\n */\n function _fit(matrix, size, defaultValue) {\n var\n // copy the array\n newSize = matrix._size.slice(0);\n var changed = false;\n\n // add dimensions when needed\n while (newSize.length < size.length) {\n newSize.push(0);\n changed = true;\n }\n\n // enlarge size when needed\n for (var i = 0, ii = size.length; i < ii; i++) {\n if (size[i] > newSize[i]) {\n newSize[i] = size[i];\n changed = true;\n }\n }\n if (changed) {\n // resize only when size is changed\n _resize(matrix, newSize, defaultValue);\n }\n }\n\n /**\n * Create a clone of the matrix\n * @memberof DenseMatrix\n * @return {DenseMatrix} clone\n */\n DenseMatrix.prototype.clone = function () {\n var m = new DenseMatrix({\n data: clone(this._data),\n size: clone(this._size),\n datatype: this._datatype\n });\n return m;\n };\n\n /**\n * Retrieve the size of the matrix.\n * @memberof DenseMatrix\n * @returns {number[]} size\n */\n DenseMatrix.prototype.size = function () {\n return this._size.slice(0); // return a clone of _size\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n *\n * @return {DenseMatrix} matrix\n */\n DenseMatrix.prototype.map = function (callback) {\n // matrix instance\n var me = this;\n var args = maxArgumentCount(callback);\n var recurse = function recurse(value, index) {\n if (isArray(value)) {\n return value.map(function (child, i) {\n return recurse(child, index.concat(i));\n });\n } else {\n // invoke the callback function with the right number of arguments\n if (args === 1) {\n return callback(value);\n } else if (args === 2) {\n return callback(value, index);\n } else {\n // 3 or -1\n return callback(value, index, me);\n }\n }\n };\n\n // determine the new datatype when the original matrix has datatype defined\n // TODO: should be done in matrix constructor instead\n var data = recurse(this._data, []);\n var datatype = this._datatype !== undefined ? getArrayDataType(data, typeOf) : undefined;\n return new DenseMatrix(data, datatype);\n };\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n */\n DenseMatrix.prototype.forEach = function (callback) {\n // matrix instance\n var me = this;\n var recurse = function recurse(value, index) {\n if (isArray(value)) {\n value.forEach(function (child, i) {\n recurse(child, index.concat(i));\n });\n } else {\n callback(value, index, me);\n }\n };\n recurse(this._data, []);\n };\n\n /**\n * Iterate over the matrix elements\n * @return {Iterable<{ value, index: number[] }>}\n */\n DenseMatrix.prototype[Symbol.iterator] = function* () {\n var recurse = function* recurse(value, index) {\n if (isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n yield* recurse(value[i], index.concat(i));\n }\n } else {\n yield {\n value,\n index\n };\n }\n };\n yield* recurse(this._data, []);\n };\n\n /**\n * Returns an array containing the rows of a 2D matrix\n * @returns {Array}\n */\n DenseMatrix.prototype.rows = function () {\n var result = [];\n var s = this.size();\n if (s.length !== 2) {\n throw new TypeError('Rows can only be returned for a 2D matrix.');\n }\n var data = this._data;\n for (var row of data) {\n result.push(new DenseMatrix([row], this._datatype));\n }\n return result;\n };\n\n /**\n * Returns an array containing the columns of a 2D matrix\n * @returns {Array}\n */\n DenseMatrix.prototype.columns = function () {\n var _this = this;\n var result = [];\n var s = this.size();\n if (s.length !== 2) {\n throw new TypeError('Rows can only be returned for a 2D matrix.');\n }\n var data = this._data;\n var _loop = function _loop(i) {\n var col = data.map(row => [row[i]]);\n result.push(new DenseMatrix(col, _this._datatype));\n };\n for (var i = 0; i < s[1]; i++) {\n _loop(i);\n }\n return result;\n };\n\n /**\n * Create an Array with a copy of the data of the DenseMatrix\n * @memberof DenseMatrix\n * @returns {Array} array\n */\n DenseMatrix.prototype.toArray = function () {\n return clone(this._data);\n };\n\n /**\n * Get the primitive value of the DenseMatrix: a multidimensional array\n * @memberof DenseMatrix\n * @returns {Array} array\n */\n DenseMatrix.prototype.valueOf = function () {\n return this._data;\n };\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @memberof DenseMatrix\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n DenseMatrix.prototype.format = function (options) {\n return format(this._data, options);\n };\n\n /**\n * Get a string representation of the matrix\n * @memberof DenseMatrix\n * @returns {string} str\n */\n DenseMatrix.prototype.toString = function () {\n return format(this._data);\n };\n\n /**\n * Get a JSON representation of the matrix\n * @memberof DenseMatrix\n * @returns {Object}\n */\n DenseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'DenseMatrix',\n data: this._data,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Get the kth Matrix diagonal.\n *\n * @memberof DenseMatrix\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved.\n *\n * @returns {Matrix} The matrix with the diagonal values.\n */\n DenseMatrix.prototype.diagonal = function (k) {\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // number diagonal values\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // x is a matrix get diagonal from matrix\n var data = [];\n\n // loop rows\n for (var i = 0; i < n; i++) {\n data[i] = this._data[i + kSub][i + kSuper];\n }\n\n // create DenseMatrix\n return new DenseMatrix({\n data,\n size: [n],\n datatype: this._datatype\n });\n };\n\n /**\n * Create a diagonal matrix.\n *\n * @memberof DenseMatrix\n * @param {Array} size The matrix size.\n * @param {number | Matrix | Array } value The values for the diagonal.\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in.\n * @param {number} [defaultValue] The default value for non-diagonal\n * @param {string} [datatype] The datatype for the diagonal\n *\n * @returns {DenseMatrix}\n */\n DenseMatrix.diagonal = function (size, value, k, defaultValue) {\n if (!isArray(size)) {\n throw new TypeError('Array expected, size parameter');\n }\n if (size.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // map size & validate\n size = size.map(function (s) {\n // check it is a big number\n if (isBigNumber(s)) {\n // convert it\n s = s.toNumber();\n }\n // validate arguments\n if (!isNumber(s) || !isInteger(s) || s < 1) {\n throw new Error('Size values must be positive integers');\n }\n return s;\n });\n\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // number of non-zero items\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // value extraction function\n var _value;\n\n // check value\n if (isArray(value)) {\n // validate array\n if (value.length !== n) {\n // number of values in array must be n\n throw new Error('Invalid value array length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value[i];\n };\n } else if (isMatrix(value)) {\n // matrix size\n var ms = value.size();\n // validate matrix\n if (ms.length !== 1 || ms[0] !== n) {\n // number of values in array must be n\n throw new Error('Invalid matrix length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value.get([i]);\n };\n } else {\n // define function\n _value = function _value() {\n // return value\n return value;\n };\n }\n\n // discover default value if needed\n if (!defaultValue) {\n // check first value in array\n defaultValue = isBigNumber(_value(0)) ? _value(0).mul(0) // trick to create a BigNumber with value zero\n : 0;\n }\n\n // empty array\n var data = [];\n\n // check we need to resize array\n if (size.length > 0) {\n // resize array\n data = resize(data, size, defaultValue);\n // fill diagonal\n for (var d = 0; d < n; d++) {\n data[d + kSub][d + kSuper] = _value(d);\n }\n }\n\n // create DenseMatrix\n return new DenseMatrix({\n data,\n size: [rows, columns]\n });\n };\n\n /**\n * Generate a matrix from a JSON object\n * @memberof DenseMatrix\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"DenseMatrix\", data: [], size: []}`,\n * where mathjs is optional\n * @returns {DenseMatrix}\n */\n DenseMatrix.fromJSON = function (json) {\n return new DenseMatrix(json);\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @memberof DenseMatrix\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n DenseMatrix.prototype.swapRows = function (i, j) {\n // check index\n if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) {\n throw new Error('Row index must be positive integers');\n }\n // check dimensions\n if (this._size.length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n // validate index\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[0]);\n\n // swap rows\n DenseMatrix._swapRows(i, j, this._data);\n // return current instance\n return this;\n };\n\n /**\n * Swap rows i and j in Dense Matrix data structure.\n *\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n * @param {Array} data Matrix data\n */\n DenseMatrix._swapRows = function (i, j, data) {\n // swap values i <-> j\n var vi = data[i];\n data[i] = data[j];\n data[j] = vi;\n };\n\n /**\n * Preprocess data, which can be an Array or DenseMatrix with nested Arrays and\n * Matrices. Clones all (nested) Arrays, and replaces all nested Matrices with Arrays\n * @memberof DenseMatrix\n * @param {Array | Matrix} data\n * @return {Array} data\n */\n function preprocess(data) {\n if (isMatrix(data)) {\n return preprocess(data.valueOf());\n }\n if (isArray(data)) {\n return data.map(preprocess);\n }\n return data;\n }\n return DenseMatrix;\n}, {\n isClass: true\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { isInteger } from './number.js';\nimport { isNumber, isBigNumber, isArray, isString } from './is.js';\nimport { format } from './string.js';\nimport { DimensionError } from '../error/DimensionError.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { deepStrictEqual } from './object.js';\n\n/**\n * Calculate the size of a multi dimensional array.\n * This function checks the size of the first entry, it does not validate\n * whether all dimensions match. (use function `validate` for that)\n * @param {Array} x\n * @Return {Number[]} size\n */\nexport function arraySize(x) {\n var s = [];\n while (Array.isArray(x)) {\n s.push(x.length);\n x = x[0];\n }\n return s;\n}\n\n/**\n * Recursively validate whether each element in a multi dimensional array\n * has a size corresponding to the provided size array.\n * @param {Array} array Array to be validated\n * @param {number[]} size Array with the size of each dimension\n * @param {number} dim Current dimension\n * @throws DimensionError\n * @private\n */\nfunction _validate(array, size, dim) {\n var i;\n var len = array.length;\n if (len !== size[dim]) {\n throw new DimensionError(len, size[dim]);\n }\n if (dim < size.length - 1) {\n // recursively validate each child array\n var dimNext = dim + 1;\n for (i = 0; i < len; i++) {\n var child = array[i];\n if (!Array.isArray(child)) {\n throw new DimensionError(size.length - 1, size.length, '<');\n }\n _validate(array[i], size, dimNext);\n }\n } else {\n // last dimension. none of the childs may be an array\n for (i = 0; i < len; i++) {\n if (Array.isArray(array[i])) {\n throw new DimensionError(size.length + 1, size.length, '>');\n }\n }\n }\n}\n\n/**\n * Validate whether each element in a multi dimensional array has\n * a size corresponding to the provided size array.\n * @param {Array} array Array to be validated\n * @param {number[]} size Array with the size of each dimension\n * @throws DimensionError\n */\nexport function validate(array, size) {\n var isScalar = size.length === 0;\n if (isScalar) {\n // scalar\n if (Array.isArray(array)) {\n throw new DimensionError(array.length, 0);\n }\n } else {\n // array\n _validate(array, size, 0);\n }\n}\n\n/**\n * Validate whether the source of the index matches the size of the Array\n * @param {Array | Matrix} array Array to be validated\n * @param {Index} index Index with the source information to validate\n * @throws DimensionError\n */\nexport function validateIndexSourceSize(value, index) {\n var valueSize = value.isMatrix ? value._size : arraySize(value);\n var sourceSize = index._sourceSize;\n // checks if the source size is not null and matches the valueSize\n sourceSize.forEach((sourceDim, i) => {\n if (sourceDim !== null && sourceDim !== valueSize[i]) {\n throw new DimensionError(sourceDim, valueSize[i]);\n }\n });\n}\n\n/**\n * Test whether index is an integer number with index >= 0 and index < length\n * when length is provided\n * @param {number} index Zero-based index\n * @param {number} [length] Length of the array\n */\nexport function validateIndex(index, length) {\n if (index !== undefined) {\n if (!isNumber(index) || !isInteger(index)) {\n throw new TypeError('Index must be an integer (value: ' + index + ')');\n }\n if (index < 0 || typeof length === 'number' && index >= length) {\n throw new IndexError(index, length);\n }\n }\n}\n\n/**\n * Test if and index has empty values\n * @param {number} index Zero-based index\n */\nexport function isEmptyIndex(index) {\n for (var i = 0; i < index._dimensions.length; ++i) {\n var dimension = index._dimensions[i];\n if (dimension._data && isArray(dimension._data)) {\n if (dimension._size[0] === 0) {\n return true;\n }\n } else if (dimension.isRange) {\n if (dimension.start === dimension.end) {\n return true;\n }\n } else if (isString(dimension)) {\n if (dimension.length === 0) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Resize a multi dimensional array. The resized array is returned.\n * @param {Array | number} array Array to be resized\n * @param {number[]} size Array with the size of each dimension\n * @param {*} [defaultValue=0] Value to be filled in in new entries,\n * zero by default. Specify for example `null`,\n * to clearly see entries that are not explicitly\n * set.\n * @return {Array} array The resized array\n */\nexport function resize(array, size, defaultValue) {\n // check the type of the arguments\n if (!Array.isArray(size)) {\n throw new TypeError('Array expected');\n }\n if (size.length === 0) {\n throw new Error('Resizing to scalar is not supported');\n }\n\n // check whether size contains positive integers\n size.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value < 0) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(size) + ')');\n }\n });\n\n // convert number to an array\n if (isNumber(array) || isBigNumber(array)) {\n array = [array];\n }\n\n // recursively resize the array\n var _defaultValue = defaultValue !== undefined ? defaultValue : 0;\n _resize(array, size, 0, _defaultValue);\n return array;\n}\n\n/**\n * Recursively resize a multi dimensional array\n * @param {Array} array Array to be resized\n * @param {number[]} size Array with the size of each dimension\n * @param {number} dim Current dimension\n * @param {*} [defaultValue] Value to be filled in in new entries,\n * undefined by default.\n * @private\n */\nfunction _resize(array, size, dim, defaultValue) {\n var i;\n var elem;\n var oldLen = array.length;\n var newLen = size[dim];\n var minLen = Math.min(oldLen, newLen);\n\n // apply new length\n array.length = newLen;\n if (dim < size.length - 1) {\n // non-last dimension\n var dimNext = dim + 1;\n\n // resize existing child arrays\n for (i = 0; i < minLen; i++) {\n // resize child array\n elem = array[i];\n if (!Array.isArray(elem)) {\n elem = [elem]; // add a dimension\n array[i] = elem;\n }\n _resize(elem, size, dimNext, defaultValue);\n }\n\n // create new child arrays\n for (i = minLen; i < newLen; i++) {\n // get child array\n elem = [];\n array[i] = elem;\n\n // resize new child array\n _resize(elem, size, dimNext, defaultValue);\n }\n } else {\n // last dimension\n\n // remove dimensions of existing values\n for (i = 0; i < minLen; i++) {\n while (Array.isArray(array[i])) {\n array[i] = array[i][0];\n }\n }\n\n // fill new elements with the default value\n for (i = minLen; i < newLen; i++) {\n array[i] = defaultValue;\n }\n }\n}\n\n/**\n * Re-shape a multi dimensional array to fit the specified dimensions\n * @param {Array} array Array to be reshaped\n * @param {number[]} sizes List of sizes for each dimension\n * @returns {Array} Array whose data has been formatted to fit the\n * specified dimensions\n *\n * @throws {DimensionError} If the product of the new dimension sizes does\n * not equal that of the old ones\n */\nexport function reshape(array, sizes) {\n var flatArray = flatten(array);\n var currentLength = flatArray.length;\n if (!Array.isArray(array) || !Array.isArray(sizes)) {\n throw new TypeError('Array expected');\n }\n if (sizes.length === 0) {\n throw new DimensionError(0, currentLength, '!=');\n }\n sizes = processSizesWildcard(sizes, currentLength);\n var newLength = product(sizes);\n if (currentLength !== newLength) {\n throw new DimensionError(newLength, currentLength, '!=');\n }\n try {\n return _reshape(flatArray, sizes);\n } catch (e) {\n if (e instanceof DimensionError) {\n throw new DimensionError(newLength, currentLength, '!=');\n }\n throw e;\n }\n}\n\n/**\n * Replaces the wildcard -1 in the sizes array.\n * @param {number[]} sizes List of sizes for each dimension. At most on wildcard.\n * @param {number} currentLength Number of elements in the array.\n * @throws {Error} If more than one wildcard or unable to replace it.\n * @returns {number[]} The sizes array with wildcard replaced.\n */\nexport function processSizesWildcard(sizes, currentLength) {\n var newLength = product(sizes);\n var processedSizes = sizes.slice();\n var WILDCARD = -1;\n var wildCardIndex = sizes.indexOf(WILDCARD);\n var isMoreThanOneWildcard = sizes.indexOf(WILDCARD, wildCardIndex + 1) >= 0;\n if (isMoreThanOneWildcard) {\n throw new Error('More than one wildcard in sizes');\n }\n var hasWildcard = wildCardIndex >= 0;\n var canReplaceWildcard = currentLength % newLength === 0;\n if (hasWildcard) {\n if (canReplaceWildcard) {\n processedSizes[wildCardIndex] = -currentLength / newLength;\n } else {\n throw new Error('Could not replace wildcard, since ' + currentLength + ' is no multiple of ' + -newLength);\n }\n }\n return processedSizes;\n}\n\n/**\n * Computes the product of all array elements.\n * @param {number[]} array Array of factors\n * @returns {number} Product of all elements\n */\nfunction product(array) {\n return array.reduce((prev, curr) => prev * curr, 1);\n}\n\n/**\n * Iteratively re-shape a multi dimensional array to fit the specified dimensions\n * @param {Array} array Array to be reshaped\n * @param {number[]} sizes List of sizes for each dimension\n * @returns {Array} Array whose data has been formatted to fit the\n * specified dimensions\n */\n\nfunction _reshape(array, sizes) {\n // testing if there are enough elements for the requested shape\n var tmpArray = array;\n var tmpArray2;\n // for each dimensions starting by the last one and ignoring the first one\n for (var sizeIndex = sizes.length - 1; sizeIndex > 0; sizeIndex--) {\n var size = sizes[sizeIndex];\n tmpArray2 = [];\n\n // aggregate the elements of the current tmpArray in elements of the requested size\n var length = tmpArray.length / size;\n for (var i = 0; i < length; i++) {\n tmpArray2.push(tmpArray.slice(i * size, (i + 1) * size));\n }\n // set it as the new tmpArray for the next loop turn or for return\n tmpArray = tmpArray2;\n }\n return tmpArray;\n}\n\n/**\n * Squeeze a multi dimensional array\n * @param {Array} array\n * @param {Array} [size]\n * @returns {Array} returns the array itself\n */\nexport function squeeze(array, size) {\n var s = size || arraySize(array);\n\n // squeeze outer dimensions\n while (Array.isArray(array) && array.length === 1) {\n array = array[0];\n s.shift();\n }\n\n // find the first dimension to be squeezed\n var dims = s.length;\n while (s[dims - 1] === 1) {\n dims--;\n }\n\n // squeeze inner dimensions\n if (dims < s.length) {\n array = _squeeze(array, dims, 0);\n s.length = dims;\n }\n return array;\n}\n\n/**\n * Recursively squeeze a multi dimensional array\n * @param {Array} array\n * @param {number} dims Required number of dimensions\n * @param {number} dim Current dimension\n * @returns {Array | *} Returns the squeezed array\n * @private\n */\nfunction _squeeze(array, dims, dim) {\n var i, ii;\n if (dim < dims) {\n var next = dim + 1;\n for (i = 0, ii = array.length; i < ii; i++) {\n array[i] = _squeeze(array[i], dims, next);\n }\n } else {\n while (Array.isArray(array)) {\n array = array[0];\n }\n }\n return array;\n}\n\n/**\n * Unsqueeze a multi dimensional array: add dimensions when missing\n *\n * Paramter `size` will be mutated to match the new, unqueezed matrix size.\n *\n * @param {Array} array\n * @param {number} dims Desired number of dimensions of the array\n * @param {number} [outer] Number of outer dimensions to be added\n * @param {Array} [size] Current size of array.\n * @returns {Array} returns the array itself\n * @private\n */\nexport function unsqueeze(array, dims, outer, size) {\n var s = size || arraySize(array);\n\n // unsqueeze outer dimensions\n if (outer) {\n for (var i = 0; i < outer; i++) {\n array = [array];\n s.unshift(1);\n }\n }\n\n // unsqueeze inner dimensions\n array = _unsqueeze(array, dims, 0);\n while (s.length < dims) {\n s.push(1);\n }\n return array;\n}\n\n/**\n * Recursively unsqueeze a multi dimensional array\n * @param {Array} array\n * @param {number} dims Required number of dimensions\n * @param {number} dim Current dimension\n * @returns {Array | *} Returns the squeezed array\n * @private\n */\nfunction _unsqueeze(array, dims, dim) {\n var i, ii;\n if (Array.isArray(array)) {\n var next = dim + 1;\n for (i = 0, ii = array.length; i < ii; i++) {\n array[i] = _unsqueeze(array[i], dims, next);\n }\n } else {\n for (var d = dim; d < dims; d++) {\n array = [array];\n }\n }\n return array;\n}\n/**\n * Flatten a multi dimensional array, put all elements in a one dimensional\n * array\n * @param {Array} array A multi dimensional array\n * @return {Array} The flattened array (1 dimensional)\n */\nexport function flatten(array) {\n if (!Array.isArray(array)) {\n // if not an array, return as is\n return array;\n }\n var flat = [];\n array.forEach(function callback(value) {\n if (Array.isArray(value)) {\n value.forEach(callback); // traverse through sub-arrays recursively\n } else {\n flat.push(value);\n }\n });\n return flat;\n}\n\n/**\n * A safe map\n * @param {Array} array\n * @param {function} callback\n */\nexport function map(array, callback) {\n return Array.prototype.map.call(array, callback);\n}\n\n/**\n * A safe forEach\n * @param {Array} array\n * @param {function} callback\n */\nexport function forEach(array, callback) {\n Array.prototype.forEach.call(array, callback);\n}\n\n/**\n * A safe filter\n * @param {Array} array\n * @param {function} callback\n */\nexport function filter(array, callback) {\n if (arraySize(array).length !== 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return Array.prototype.filter.call(array, callback);\n}\n\n/**\n * Filter values in a callback given a regular expression\n * @param {Array} array\n * @param {RegExp} regexp\n * @return {Array} Returns the filtered array\n * @private\n */\nexport function filterRegExp(array, regexp) {\n if (arraySize(array).length !== 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return Array.prototype.filter.call(array, entry => regexp.test(entry));\n}\n\n/**\n * A safe join\n * @param {Array} array\n * @param {string} separator\n */\nexport function join(array, separator) {\n return Array.prototype.join.call(array, separator);\n}\n\n/**\n * Assign a numeric identifier to every element of a sorted array\n * @param {Array} a An array\n * @return {Array} An array of objects containing the original value and its identifier\n */\nexport function identify(a) {\n if (!Array.isArray(a)) {\n throw new TypeError('Array input expected');\n }\n if (a.length === 0) {\n return a;\n }\n var b = [];\n var count = 0;\n b[0] = {\n value: a[0],\n identifier: 0\n };\n for (var i = 1; i < a.length; i++) {\n if (a[i] === a[i - 1]) {\n count++;\n } else {\n count = 0;\n }\n b.push({\n value: a[i],\n identifier: count\n });\n }\n return b;\n}\n\n/**\n * Remove the numeric identifier from the elements\n * @param {array} a An array\n * @return {array} An array of values without identifiers\n */\nexport function generalize(a) {\n if (!Array.isArray(a)) {\n throw new TypeError('Array input expected');\n }\n if (a.length === 0) {\n return a;\n }\n var b = [];\n for (var i = 0; i < a.length; i++) {\n b.push(a[i].value);\n }\n return b;\n}\n\n/**\n * Check the datatype of a given object\n * This is a low level implementation that should only be used by\n * parent Matrix classes such as SparseMatrix or DenseMatrix\n * This method does not validate Array Matrix shape\n * @param {Array} array\n * @param {function} typeOf Callback function to use to determine the type of a value\n * @return {string}\n */\nexport function getArrayDataType(array, typeOf) {\n var type; // to hold type info\n var length = 0; // to hold length value to ensure it has consistent sizes\n\n for (var i = 0; i < array.length; i++) {\n var item = array[i];\n var _isArray = Array.isArray(item);\n\n // Saving the target matrix row size\n if (i === 0 && _isArray) {\n length = item.length;\n }\n\n // If the current item is an array but the length does not equal the targetVectorSize\n if (_isArray && item.length !== length) {\n return undefined;\n }\n var itemType = _isArray ? getArrayDataType(item, typeOf) // recurse into a nested array\n : typeOf(item);\n if (type === undefined) {\n type = itemType; // first item\n } else if (type !== itemType) {\n return 'mixed';\n } else {\n // we're good, everything has the same type so far\n }\n }\n return type;\n}\n\n/**\n * Return the last item from an array\n * @param {array}\n * @returns {*}\n */\nexport function last(array) {\n return array[array.length - 1];\n}\n\n/**\n * Get all but the last element of array.\n * @param {array}\n * @returns {*}\n */\nexport function initial(array) {\n return array.slice(0, array.length - 1);\n}\n\n/**\n * Recursively concatenate two matrices.\n * The contents of the matrices is not cloned.\n * @param {Array} a Multi dimensional array\n * @param {Array} b Multi dimensional array\n * @param {number} concatDim The dimension on which to concatenate (zero-based)\n * @param {number} dim The current dim (zero-based)\n * @return {Array} c The concatenated matrix\n * @private\n */\nfunction concatRecursive(a, b, concatDim, dim) {\n if (dim < concatDim) {\n // recurse into next dimension\n if (a.length !== b.length) {\n throw new DimensionError(a.length, b.length);\n }\n var c = [];\n for (var i = 0; i < a.length; i++) {\n c[i] = concatRecursive(a[i], b[i], concatDim, dim + 1);\n }\n return c;\n } else {\n // concatenate this dimension\n return a.concat(b);\n }\n}\n\n/**\n * Concatenates many arrays in the specified direction\n * @param {...Array} arrays All the arrays to concatenate\n * @param {number} concatDim The dimension on which to concatenate (zero-based)\n * @returns\n*/\nexport function concat() {\n var arrays = Array.prototype.slice.call(arguments, 0, -1);\n var concatDim = Array.prototype.slice.call(arguments, -1);\n if (arrays.length === 1) {\n return arrays[0];\n }\n if (arrays.length > 1) {\n return arrays.slice(1).reduce(function (A, B) {\n return concatRecursive(A, B, concatDim, 0);\n }, arrays[0]);\n } else {\n throw new Error('Wrong number of arguments in function concat');\n }\n}\n\n/**\n * Receives two or more sizes and get's the broadcasted size for both.\n * @param {...number[]} sizes Sizes to broadcast together\n * @returns\n */\nexport function broadcastSizes() {\n for (var _len = arguments.length, sizes = new Array(_len), _key = 0; _key < _len; _key++) {\n sizes[_key] = arguments[_key];\n }\n var dimensions = sizes.map(s => s.length);\n var N = Math.max(...dimensions);\n var sizeMax = new Array(N).fill(null);\n // check for every size\n for (var i = 0; i < sizes.length; i++) {\n var size = sizes[i];\n var dim = dimensions[i];\n for (var j = 0; j < dim; j++) {\n var n = N - dim + j;\n if (size[j] > sizeMax[n]) {\n sizeMax[n] = size[j];\n }\n }\n }\n for (var _i = 0; _i < sizes.length; _i++) {\n checkBroadcastingRules(sizes[_i], sizeMax);\n }\n return sizeMax;\n}\n\n/**\n * Checks if it's possible to broadcast a size to another size\n * @param {number[]} size The size of the array to check\n * @param {number[]} toSize The size of the array to validate if it can be broadcasted to\n */\nexport function checkBroadcastingRules(size, toSize) {\n var N = toSize.length;\n var dim = size.length;\n for (var j = 0; j < dim; j++) {\n var n = N - dim + j;\n if (size[j] < toSize[n] && size[j] > 1 || size[j] > toSize[n]) {\n throw new Error(\"shape missmatch: missmatch is found in arg with shape (\".concat(size, \") not possible to broadcast dimension \").concat(dim, \" with size \").concat(size[j], \" to size \").concat(toSize[n]));\n }\n }\n}\n\n/**\n * Broadcasts a single array to a certain size\n * @param {array} array Array to be broadcasted\n * @param {number[]} toSize Size to broadcast the array\n * @returns The broadcasted array\n */\nexport function broadcastTo(array, toSize) {\n var Asize = arraySize(array);\n if (deepStrictEqual(Asize, toSize)) {\n return array;\n }\n checkBroadcastingRules(Asize, toSize);\n var broadcastedSize = broadcastSizes(Asize, toSize);\n var N = broadcastedSize.length;\n var paddedSize = [...Array(N - Asize.length).fill(1), ...Asize];\n var A = clone(array);\n // reshape A if needed to make it ready for concat\n if (Asize.length < N) {\n A = reshape(A, paddedSize);\n Asize = arraySize(A);\n }\n\n // stretches the array on each dimension to make it the same size as index\n for (var dim = 0; dim < N; dim++) {\n if (Asize[dim] < broadcastedSize[dim]) {\n A = stretch(A, broadcastedSize[dim], dim);\n Asize = arraySize(A);\n }\n }\n return A;\n}\n\n/**\n * Broadcasts arrays and returns the broadcasted arrays in an array\n * @param {...Array | any} arrays\n * @returns\n */\nexport function broadcastArrays() {\n for (var _len2 = arguments.length, arrays = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arrays[_key2] = arguments[_key2];\n }\n if (arrays.length === 0) {\n throw new Error('Insuficient number of argumnets in function broadcastArrays');\n }\n if (arrays.length === 1) {\n return arrays[0];\n }\n var sizes = arrays.map(function (array) {\n return arraySize(array);\n });\n var broadcastedSize = broadcastSizes(...sizes);\n var broadcastedArrays = [];\n arrays.forEach(function (array) {\n broadcastedArrays.push(broadcastTo(array, broadcastedSize));\n });\n return broadcastedArrays;\n}\n\n/**\n * stretches a matrix up to a certain size in a certain dimension\n * @param {Array} arrayToStretch\n * @param {number[]} sizeToStretch\n * @param {number} dimToStretch\n * @returns\n */\nexport function stretch(arrayToStretch, sizeToStretch, dimToStretch) {\n return concat(...Array(sizeToStretch).fill(arrayToStretch), dimToStretch);\n}\n\n/**\n * Deep clones a multidimensional array\n * @param {Array} array\n * @returns cloned array\n */\nexport function clone(array) {\n return _extends([], array);\n}", "import { isBigNumber, isString, typeOf } from './is.js';\nimport { format as formatNumber } from './number.js';\nimport { format as formatBigNumber } from './bignumber/formatter.js';\n\n/**\n * Check if a text ends with a certain string.\n * @param {string} text\n * @param {string} search\n */\nexport function endsWith(text, search) {\n var start = text.length - search.length;\n var end = text.length;\n return text.substring(start, end) === search;\n}\n\n/**\n * Format a value of any type into a string.\n *\n * Usage:\n * math.format(value)\n * math.format(value, precision)\n * math.format(value, options)\n *\n * When value is a function:\n *\n * - When the function has a property `syntax`, it returns this\n * syntax description.\n * - In other cases, a string `'function'` is returned.\n *\n * When `value` is an Object:\n *\n * - When the object contains a property `format` being a function, this\n * function is invoked as `value.format(options)` and the result is returned.\n * - When the object has its own `toString` method, this method is invoked\n * and the result is returned.\n * - In other cases the function will loop over all object properties and\n * return JSON object notation like '{\"a\": 2, \"b\": 3}'.\n *\n * Example usage:\n * math.format(2/7) // '0.2857142857142857'\n * math.format(math.pi, 3) // '3.14'\n * math.format(new Complex(2, 3)) // '2 + 3i'\n * math.format('hello') // '\"hello\"'\n *\n * @param {*} value Value to be stringified\n * @param {Object | number | Function} [options]\n * Formatting options. See src/utils/number.js:format for a\n * description of the available options controlling number output.\n * This generic \"format\" also supports the option property `truncate: NN`\n * giving the maximum number NN of characters to return (if there would\n * have been more, they are deleted and replaced by an ellipsis).\n * @return {string} str\n */\nexport function format(value, options) {\n var result = _format(value, options);\n if (options && typeof options === 'object' && 'truncate' in options && result.length > options.truncate) {\n return result.substring(0, options.truncate - 3) + '...';\n }\n return result;\n}\nfunction _format(value, options) {\n if (typeof value === 'number') {\n return formatNumber(value, options);\n }\n if (isBigNumber(value)) {\n return formatBigNumber(value, options);\n }\n\n // note: we use unsafe duck-typing here to check for Fractions, this is\n // ok here since we're only invoking toString or concatenating its values\n if (looksLikeFraction(value)) {\n if (!options || options.fraction !== 'decimal') {\n // output as ratio, like '1/3'\n return value.s * value.n + '/' + value.d;\n } else {\n // output as decimal, like '0.(3)'\n return value.toString();\n }\n }\n if (Array.isArray(value)) {\n return formatArray(value, options);\n }\n if (isString(value)) {\n return stringify(value);\n }\n if (typeof value === 'function') {\n return value.syntax ? String(value.syntax) : 'function';\n }\n if (value && typeof value === 'object') {\n if (typeof value.format === 'function') {\n return value.format(options);\n } else if (value && value.toString(options) !== {}.toString()) {\n // this object has a non-native toString method, use that one\n return value.toString(options);\n } else {\n var entries = Object.keys(value).map(key => {\n return stringify(key) + ': ' + format(value[key], options);\n });\n return '{' + entries.join(', ') + '}';\n }\n }\n return String(value);\n}\n\n/**\n * Stringify a value into a string enclosed in double quotes.\n * Unescaped double quotes and backslashes inside the value are escaped.\n * @param {*} value\n * @return {string}\n */\nexport function stringify(value) {\n var text = String(value);\n var escaped = '';\n var i = 0;\n while (i < text.length) {\n var c = text.charAt(i);\n escaped += c in controlCharacters ? controlCharacters[c] : c;\n i++;\n }\n return '\"' + escaped + '\"';\n}\nvar controlCharacters = {\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t'\n};\n\n/**\n * Escape special HTML characters\n * @param {*} value\n * @return {string}\n */\nexport function escape(value) {\n var text = String(value);\n text = text.replace(/&/g, '&').replace(/\"/g, '"').replace(/'/g, ''').replace(//g, '>');\n return text;\n}\n\n/**\n * Recursively format an n-dimensional matrix\n * Example output: \"[[1, 2], [3, 4]]\"\n * @param {Array} array\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\nfunction formatArray(array, options) {\n if (Array.isArray(array)) {\n var str = '[';\n var len = array.length;\n for (var i = 0; i < len; i++) {\n if (i !== 0) {\n str += ', ';\n }\n str += formatArray(array[i], options);\n }\n str += ']';\n return str;\n } else {\n return format(array, options);\n }\n}\n\n/**\n * Check whether a value looks like a Fraction (unsafe duck-type check)\n * @param {*} value\n * @return {boolean}\n */\nfunction looksLikeFraction(value) {\n return value && typeof value === 'object' && typeof value.s === 'number' && typeof value.n === 'number' && typeof value.d === 'number' || false;\n}\n\n/**\n * Compare two strings\n * @param {string} x\n * @param {string} y\n * @returns {number}\n */\nexport function compareText(x, y) {\n // we don't want to convert numbers to string, only accept string input\n if (!isString(x)) {\n throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + typeOf(x) + ', index: 0)');\n }\n if (!isString(y)) {\n throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + typeOf(y) + ', index: 1)');\n }\n return x === y ? 0 : x > y ? 1 : -1;\n}", "import { isBigNumber, isNumber } from '../is.js';\nimport { isInteger, normalizeFormatOptions } from '../number.js';\n\n/**\n * Formats a BigNumber in a given base\n * @param {BigNumber} n\n * @param {number} base\n * @param {number} size\n * @returns {string}\n */\nfunction formatBigNumberToBase(n, base, size) {\n var BigNumberCtor = n.constructor;\n var big2 = new BigNumberCtor(2);\n var suffix = '';\n if (size) {\n if (size < 1) {\n throw new Error('size must be in greater than 0');\n }\n if (!isInteger(size)) {\n throw new Error('size must be an integer');\n }\n if (n.greaterThan(big2.pow(size - 1).sub(1)) || n.lessThan(big2.pow(size - 1).mul(-1))) {\n throw new Error(\"Value must be in range [-2^\".concat(size - 1, \", 2^\").concat(size - 1, \"-1]\"));\n }\n if (!n.isInteger()) {\n throw new Error('Value must be an integer');\n }\n if (n.lessThan(0)) {\n n = n.add(big2.pow(size));\n }\n suffix = \"i\".concat(size);\n }\n switch (base) {\n case 2:\n return \"\".concat(n.toBinary()).concat(suffix);\n case 8:\n return \"\".concat(n.toOctal()).concat(suffix);\n case 16:\n return \"\".concat(n.toHexadecimal()).concat(suffix);\n default:\n throw new Error(\"Base \".concat(base, \" not supported \"));\n }\n}\n\n/**\n * Convert a BigNumber to a formatted string representation.\n *\n * Syntax:\n *\n * format(value)\n * format(value, options)\n * format(value, precision)\n * format(value, fn)\n *\n * Where:\n *\n * {number} value The value to be formatted\n * {Object} options An object with formatting options. Available options:\n * {string} notation\n * Number notation. Choose from:\n * 'fixed' Always use regular number notation.\n * For example '123.40' and '14000000'\n * 'exponential' Always use exponential notation.\n * For example '1.234e+2' and '1.4e+7'\n * 'auto' (default) Regular number notation for numbers\n * having an absolute value between\n * `lower` and `upper` bounds, and uses\n * exponential notation elsewhere.\n * Lower bound is included, upper bound\n * is excluded.\n * For example '123.4' and '1.4e7'.\n * 'bin', 'oct, or\n * 'hex' Format the number using binary, octal,\n * or hexadecimal notation.\n * For example '0b1101' and '0x10fe'.\n * {number} wordSize The word size in bits to use for formatting\n * in binary, octal, or hexadecimal notation.\n * To be used only with 'bin', 'oct', or 'hex'\n * values for 'notation' option. When this option\n * is defined the value is formatted as a signed\n * twos complement integer of the given word size\n * and the size suffix is appended to the output.\n * For example\n * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'.\n * Default value is undefined.\n * {number} precision A number between 0 and 16 to round\n * the digits of the number.\n * In case of notations 'exponential',\n * 'engineering', and 'auto',\n * `precision` defines the total\n * number of significant digits returned.\n * In case of notation 'fixed',\n * `precision` defines the number of\n * significant digits after the decimal\n * point.\n * `precision` is undefined by default.\n * {number} lowerExp Exponent determining the lower boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `-3`.\n * {number} upperExp Exponent determining the upper boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `5`.\n * {Function} fn A custom formatting function. Can be used to override the\n * built-in notations. Function `fn` is called with `value` as\n * parameter and must return a string. Is useful for example to\n * format all values inside a matrix in a particular way.\n *\n * Examples:\n *\n * format(6.4) // '6.4'\n * format(1240000) // '1.24e6'\n * format(1/3) // '0.3333333333333333'\n * format(1/3, 3) // '0.333'\n * format(21385, 2) // '21000'\n * format(12e8, {notation: 'fixed'}) // returns '1200000000'\n * format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000'\n * format(52.8, {notation: 'exponential'}) // returns '5.28e+1'\n * format(12400, {notation: 'engineering'}) // returns '12.400e+3'\n *\n * @param {BigNumber} value\n * @param {Object | Function | number | BigNumber} [options]\n * @return {string} str The formatted value\n */\nexport function format(value, options) {\n if (typeof options === 'function') {\n // handle format(value, fn)\n return options(value);\n }\n\n // handle special cases\n if (!value.isFinite()) {\n return value.isNaN() ? 'NaN' : value.gt(0) ? 'Infinity' : '-Infinity';\n }\n var {\n notation,\n precision,\n wordSize\n } = normalizeFormatOptions(options);\n\n // handle the various notations\n switch (notation) {\n case 'fixed':\n return toFixed(value, precision);\n case 'exponential':\n return toExponential(value, precision);\n case 'engineering':\n return toEngineering(value, precision);\n case 'bin':\n return formatBigNumberToBase(value, 2, wordSize);\n case 'oct':\n return formatBigNumberToBase(value, 8, wordSize);\n case 'hex':\n return formatBigNumberToBase(value, 16, wordSize);\n case 'auto':\n {\n // determine lower and upper bound for exponential notation.\n // TODO: implement support for upper and lower to be BigNumbers themselves\n var lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3);\n var upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5);\n\n // handle special case zero\n if (value.isZero()) return '0';\n\n // determine whether or not to output exponential notation\n var str;\n var rounded = value.toSignificantDigits(precision);\n var exp = rounded.e;\n if (exp >= lowerExp && exp < upperExp) {\n // normal number notation\n str = rounded.toFixed();\n } else {\n // exponential notation\n str = toExponential(value, precision);\n }\n\n // remove trailing zeros after the decimal point\n return str.replace(/((\\.\\d*?)(0+))($|e)/, function () {\n var digits = arguments[2];\n var e = arguments[4];\n return digits !== '.' ? digits + e : e;\n });\n }\n default:\n throw new Error('Unknown notation \"' + notation + '\". ' + 'Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.');\n }\n}\n\n/**\n * Format a BigNumber in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3'\n * @param {BigNumber} value\n * @param {number} [precision] Optional number of significant figures to return.\n */\nexport function toEngineering(value, precision) {\n // find nearest lower multiple of 3 for exponent\n var e = value.e;\n var newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3;\n\n // find difference in exponents, and calculate the value without exponent\n var valueWithoutExp = value.mul(Math.pow(10, -newExp));\n var valueStr = valueWithoutExp.toPrecision(precision);\n if (valueStr.includes('e')) {\n var BigNumber = value.constructor;\n valueStr = new BigNumber(valueStr).toFixed();\n }\n return valueStr + 'e' + (e >= 0 ? '+' : '') + newExp.toString();\n}\n\n/**\n * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3'\n * @param {BigNumber} value\n * @param {number} [precision] Number of digits in formatted output.\n * If not provided, the maximum available digits\n * is used.\n * @returns {string} str\n */\nexport function toExponential(value, precision) {\n if (precision !== undefined) {\n return value.toExponential(precision - 1); // Note the offset of one\n } else {\n return value.toExponential();\n }\n}\n\n/**\n * Format a number with fixed notation.\n * @param {BigNumber} value\n * @param {number} [precision=undefined] Optional number of decimals after the\n * decimal point. Undefined by default.\n */\nexport function toFixed(value, precision) {\n return value.toFixed(precision);\n}\nfunction _toNumberOrDefault(value, defaultValue) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n return defaultValue;\n }\n}", "/**\n * Create a range error with the message:\n * 'Dimension mismatch ( != )'\n * @param {number | number[]} actual The actual size\n * @param {number | number[]} expected The expected size\n * @param {string} [relation='!='] Optional relation between actual\n * and expected size: '!=', '<', etc.\n * @extends RangeError\n */\nexport function DimensionError(actual, expected, relation) {\n if (!(this instanceof DimensionError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.actual = actual;\n this.expected = expected;\n this.relation = relation;\n this.message = 'Dimension mismatch (' + (Array.isArray(actual) ? '[' + actual.join(', ') + ']' : actual) + ' ' + (this.relation || '!=') + ' ' + (Array.isArray(expected) ? '[' + expected.join(', ') + ']' : expected) + ')';\n this.stack = new Error().stack;\n}\nDimensionError.prototype = new RangeError();\nDimensionError.prototype.constructor = RangeError;\nDimensionError.prototype.name = 'DimensionError';\nDimensionError.prototype.isDimensionError = true;", "/**\n * Create a range error with the message:\n * 'Index out of range (index < min)'\n * 'Index out of range (index < max)'\n *\n * @param {number} index The actual index\n * @param {number} [min=0] Minimum index (included)\n * @param {number} [max] Maximum index (excluded)\n * @extends RangeError\n */\nexport function IndexError(index, min, max) {\n if (!(this instanceof IndexError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.index = index;\n if (arguments.length < 3) {\n this.min = 0;\n this.max = min;\n } else {\n this.min = min;\n this.max = max;\n }\n if (this.min !== undefined && this.index < this.min) {\n this.message = 'Index out of range (' + this.index + ' < ' + this.min + ')';\n } else if (this.max !== undefined && this.index >= this.max) {\n this.message = 'Index out of range (' + this.index + ' > ' + (this.max - 1) + ')';\n } else {\n this.message = 'Index out of range (' + this.index + ')';\n }\n this.stack = new Error().stack;\n}\nIndexError.prototype = new RangeError();\nIndexError.prototype.constructor = RangeError;\nIndexError.prototype.name = 'IndexError';\nIndexError.prototype.isIndexError = true;", "// function utils\n\nimport { lruQueue } from './lruQueue.js';\n\n/**\n * Memoize a given function by caching the computed result.\n * The cache of a memoized function can be cleared by deleting the `cache`\n * property of the function.\n *\n * @param {function} fn The function to be memoized.\n * Must be a pure function.\n * @param {Object} [options]\n * @param {function(args: Array): string} [options.hasher]\n * A custom hash builder. Is JSON.stringify by default.\n * @param {number | undefined} [options.limit]\n * Maximum number of values that may be cached. Undefined indicates\n * unlimited (default)\n * @return {function} Returns the memoized function\n */\nexport function memoize(fn) {\n var {\n hasher,\n limit\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n limit = limit == null ? Number.POSITIVE_INFINITY : limit;\n hasher = hasher == null ? JSON.stringify : hasher;\n return function memoize() {\n if (typeof memoize.cache !== 'object') {\n memoize.cache = {\n values: new Map(),\n lru: lruQueue(limit || Number.POSITIVE_INFINITY)\n };\n }\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n var hash = hasher(args);\n if (memoize.cache.values.has(hash)) {\n memoize.cache.lru.hit(hash);\n return memoize.cache.values.get(hash);\n }\n var newVal = fn.apply(fn, args);\n memoize.cache.values.set(hash, newVal);\n memoize.cache.values.delete(memoize.cache.lru.hit(hash));\n return newVal;\n };\n}\n\n/**\n * Memoize a given function by caching all results and the arguments,\n * and comparing against the arguments of previous results before\n * executing again.\n * This is less performant than `memoize` which calculates a hash,\n * which is very fast to compare. Use `memoizeCompare` only when it is\n * not possible to create a unique serializable hash from the function\n * arguments.\n * The isEqual function must compare two sets of arguments\n * and return true when equal (can be a deep equality check for example).\n * @param {function} fn\n * @param {function(a: *, b: *) : boolean} isEqual\n * @returns {function}\n */\nexport function memoizeCompare(fn, isEqual) {\n var memoize = function memoize() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n for (var c = 0; c < memoize.cache.length; c++) {\n var cached = memoize.cache[c];\n if (isEqual(args, cached.args)) {\n // TODO: move this cache entry to the top so recently used entries move up?\n return cached.res;\n }\n }\n var res = fn.apply(fn, args);\n memoize.cache.unshift({\n args,\n res\n });\n return res;\n };\n memoize.cache = [];\n return memoize;\n}\n\n/**\n * Find the maximum number of arguments expected by a typed function.\n * @param {function} fn A typed function\n * @return {number} Returns the maximum number of expected arguments.\n * Returns -1 when no signatures where found on the function.\n */\nexport function maxArgumentCount(fn) {\n return Object.keys(fn.signatures || {}).reduce(function (args, signature) {\n var count = (signature.match(/,/g) || []).length + 1;\n return Math.max(args, count);\n }, -1);\n}", "// (c) 2018, Mariusz Nowak\n// SPDX-License-Identifier: ISC\n// Derived from https://github.com/medikoo/lru-queue\nexport function lruQueue(limit) {\n var size = 0;\n var base = 1;\n var queue = Object.create(null);\n var map = Object.create(null);\n var index = 0;\n var del = function del(id) {\n var oldIndex = map[id];\n if (!oldIndex) return;\n delete queue[oldIndex];\n delete map[id];\n --size;\n if (base !== oldIndex) return;\n if (!size) {\n index = 0;\n base = 1;\n return;\n }\n while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */}\n };\n limit = Math.abs(limit);\n return {\n hit: function hit(id) {\n var oldIndex = map[id];\n var nuIndex = ++index;\n queue[nuIndex] = id;\n map[id] = nuIndex;\n if (!oldIndex) {\n ++size;\n if (size <= limit) return undefined;\n id = queue[base];\n del(id);\n return id;\n }\n delete queue[oldIndex];\n if (base !== oldIndex) return undefined;\n while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */}\n return undefined;\n },\n delete: del,\n clear: function clear() {\n size = index = 0;\n base = 1;\n queue = Object.create(null);\n map = Object.create(null);\n }\n };\n}", "import { clone as objectClone } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'clone';\nvar dependencies = ['typed'];\nexport var createClone = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Clone an object. Will make a deep copy of the data.\n *\n * Syntax:\n *\n * math.clone(x)\n *\n * Examples:\n *\n * math.clone(3.5) // returns number 3.5\n * math.clone(math.complex('2-4i')) // returns Complex 2 - 4i\n * math.clone(math.unit(45, 'deg')) // returns Unit 45 deg\n * math.clone([[1, 2], [3, 4]]) // returns Array [[1, 2], [3, 4]]\n * math.clone(\"hello world\") // returns string \"hello world\"\n *\n * @param {*} x Object to be cloned\n * @return {*} A clone of object x\n */\n return typed(name, {\n any: objectClone\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { isInteger as isIntegerNumber } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isInteger';\nvar dependencies = ['typed'];\nexport var createIsInteger = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is an integer number.\n * The function supports `number`, `BigNumber`, and `Fraction`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isInteger(x)\n *\n * Examples:\n *\n * math.isInteger(2) // returns true\n * math.isInteger(0) // returns true\n * math.isInteger(0.5) // returns false\n * math.isInteger(math.bignumber(500)) // returns true\n * math.isInteger(math.fraction(4)) // returns true\n * math.isInteger('3') // returns true\n * math.isInteger([3, 0.5, -2]) // returns [true, false, true]\n * math.isInteger(math.complex('2-4i')) // throws an error\n *\n * See also:\n *\n * isNumeric, isPositive, isNegative, isZero\n *\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` contains a numeric, integer value.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: isIntegerNumber,\n // TODO: what to do with isInteger(add(0.1, 0.2)) ?\n\n BigNumber: function BigNumber(x) {\n return x.isInt();\n },\n bigint: function bigint(x) {\n return true;\n },\n Fraction: function Fraction(x) {\n return x.d === 1 && isFinite(x.n);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { isCollection, isMatrix } from './is.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { arraySize } from './array.js';\nimport { _switch } from './switch.js';\n\n/**\n * Test whether an array contains collections\n * @param {Array} array\n * @returns {boolean} Returns true when the array contains one or multiple\n * collections (Arrays or Matrices). Returns false otherwise.\n */\nexport function containsCollections(array) {\n for (var i = 0; i < array.length; i++) {\n if (isCollection(array[i])) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Recursively loop over all elements in a given multi dimensional array\n * and invoke the callback on each of the elements.\n * @param {Array | Matrix} array\n * @param {Function} callback The callback method is invoked with one\n * parameter: the current element in the array\n */\nexport function deepForEach(array, callback) {\n if (isMatrix(array)) {\n array = array.valueOf();\n }\n for (var i = 0, ii = array.length; i < ii; i++) {\n var value = array[i];\n if (Array.isArray(value)) {\n deepForEach(value, callback);\n } else {\n callback(value);\n }\n }\n}\n\n/**\n * Execute the callback function element wise for each element in array and any\n * nested array\n * Returns an array with the results\n * @param {Array | Matrix} array\n * @param {Function} callback The callback is called with two parameters:\n * value1 and value2, which contain the current\n * element of both arrays.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {Array | Matrix} res\n */\nexport function deepMap(array, callback, skipZeros) {\n if (array && typeof array.map === 'function') {\n // TODO: replace array.map with a for loop to improve performance\n return array.map(function (x) {\n return deepMap(x, callback, skipZeros);\n });\n } else {\n return callback(array);\n }\n}\n\n/**\n * Reduce a given matrix or array to a new matrix or\n * array with one less dimension, applying the given\n * callback in the selected dimension.\n * @param {Array | Matrix} mat\n * @param {number} dim\n * @param {Function} callback\n * @return {Array | Matrix} res\n */\nexport function reduce(mat, dim, callback) {\n var size = Array.isArray(mat) ? arraySize(mat) : mat.size();\n if (dim < 0 || dim >= size.length) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, size.length);\n }\n if (isMatrix(mat)) {\n return mat.create(_reduce(mat.valueOf(), dim, callback));\n } else {\n return _reduce(mat, dim, callback);\n }\n}\n\n/**\n * Recursively reduce a matrix\n * @param {Array} mat\n * @param {number} dim\n * @param {Function} callback\n * @returns {Array} ret\n * @private\n */\nfunction _reduce(mat, dim, callback) {\n var i, ret, val, tran;\n if (dim <= 0) {\n if (!Array.isArray(mat[0])) {\n val = mat[0];\n for (i = 1; i < mat.length; i++) {\n val = callback(val, mat[i]);\n }\n return val;\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _reduce(tran[i], dim - 1, callback);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _reduce(mat[i], dim - 1, callback);\n }\n return ret;\n }\n}\n\n// TODO: document function scatter\nexport function scatter(a, j, w, x, u, mark, cindex, f, inverse, update, value) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n\n // vars\n var k, k0, k1, i;\n\n // check we need to process values (pattern matrix)\n if (x) {\n // values in j\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check value exists in current j\n if (w[i] !== mark) {\n // i is new entry in j\n w[i] = mark;\n // add i to pattern of C\n cindex.push(i);\n // x(i) = A, check we need to call function this time\n if (update) {\n // copy value to workspace calling callback function\n x[i] = inverse ? f(avalues[k], value) : f(value, avalues[k]);\n // function was called on current row\n u[i] = mark;\n } else {\n // copy value to workspace\n x[i] = avalues[k];\n }\n } else {\n // i exists in C already\n x[i] = inverse ? f(avalues[k], x[i]) : f(x[i], avalues[k]);\n // function was called on current row\n u[i] = mark;\n }\n }\n } else {\n // values in j\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check value exists in current j\n if (w[i] !== mark) {\n // i is new entry in j\n w[i] = mark;\n // add i to pattern of C\n cindex.push(i);\n } else {\n // indicate function was called on current row\n u[i] = mark;\n }\n }\n }\n}", "/**\n * Transpose a matrix\n * @param {Array} mat\n * @returns {Array} ret\n * @private\n */\nexport function _switch(mat) {\n var I = mat.length;\n var J = mat[0].length;\n var i, j;\n var ret = [];\n for (j = 0; j < J; j++) {\n var tmp = [];\n for (i = 0; i < I; i++) {\n tmp.push(mat[i][j]);\n }\n ret.push(tmp);\n }\n return ret;\n}", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNegativeNumber } from '../../plain/number/index.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nvar name = 'isNegative';\nvar dependencies = ['typed', 'config'];\nexport var createIsNegative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config\n } = _ref;\n /**\n * Test whether a value is negative: smaller than zero.\n * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNegative(x)\n *\n * Examples:\n *\n * math.isNegative(3) // returns false\n * math.isNegative(-2) // returns true\n * math.isNegative(0) // returns false\n * math.isNegative(-0) // returns false\n * math.isNegative(math.bignumber(2)) // returns false\n * math.isNegative(math.fraction(-2, 5)) // returns true\n * math.isNegative('-2') // returns true\n * math.isNegative([2, 0, -3]) // returns [false, false, true]\n *\n * See also:\n *\n * isNumeric, isPositive, isZero, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isNegativeNumber(x),\n BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : x.isNeg() && !x.isZero() && !x.isNaN(),\n bigint: x => x < 0n,\n Fraction: x => x.s < 0,\n // It's enough to decide on the sign\n\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { cbrt, expm1, isInteger, log10, log1p, log2, sign, toFixed } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function absNumber(a) {\n return Math.abs(a);\n}\nabsNumber.signature = n1;\nexport function addNumber(a, b) {\n return a + b;\n}\naddNumber.signature = n2;\nexport function subtractNumber(a, b) {\n return a - b;\n}\nsubtractNumber.signature = n2;\nexport function multiplyNumber(a, b) {\n return a * b;\n}\nmultiplyNumber.signature = n2;\nexport function divideNumber(a, b) {\n return a / b;\n}\ndivideNumber.signature = n2;\nexport function unaryMinusNumber(x) {\n return -x;\n}\nunaryMinusNumber.signature = n1;\nexport function unaryPlusNumber(x) {\n return x;\n}\nunaryPlusNumber.signature = n1;\nexport function cbrtNumber(x) {\n return cbrt(x);\n}\ncbrtNumber.signature = n1;\nexport function cubeNumber(x) {\n return x * x * x;\n}\ncubeNumber.signature = n1;\nexport function expNumber(x) {\n return Math.exp(x);\n}\nexpNumber.signature = n1;\nexport function expm1Number(x) {\n return expm1(x);\n}\nexpm1Number.signature = n1;\n\n/**\n * Calculate gcd for numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the greatest common denominator of a and b\n */\nexport function gcdNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var r;\n while (b !== 0) {\n r = a % b;\n a = b;\n b = r;\n }\n return a < 0 ? -a : a;\n}\ngcdNumber.signature = n2;\n\n/**\n * Calculate lcm for two numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the least common multiple of a and b\n */\nexport function lcmNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function lcm must be integer numbers');\n }\n if (a === 0 || b === 0) {\n return 0;\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n // evaluate lcm here inline to reduce overhead\n var t;\n var prod = a * b;\n while (b !== 0) {\n t = b;\n b = a % t;\n a = t;\n }\n return Math.abs(prod / a);\n}\nlcmNumber.signature = n2;\n\n/**\n * Calculate the logarithm of a value, optionally to a given base.\n * @param {number} x\n * @param {number | null | undefined} base\n * @return {number}\n */\nexport function logNumber(x, y) {\n if (y) {\n return Math.log(x) / Math.log(y);\n }\n return Math.log(x);\n}\n\n/**\n * Calculate the 10-base logarithm of a number\n * @param {number} x\n * @return {number}\n */\nexport function log10Number(x) {\n return log10(x);\n}\nlog10Number.signature = n1;\n\n/**\n * Calculate the 2-base logarithm of a number\n * @param {number} x\n * @return {number}\n */\nexport function log2Number(x) {\n return log2(x);\n}\nlog2Number.signature = n1;\n\n/**\n * Calculate the natural logarithm of a `number+1`\n * @param {number} x\n * @returns {number}\n */\nexport function log1pNumber(x) {\n return log1p(x);\n}\nlog1pNumber.signature = n1;\n\n/**\n * Calculate the modulus of two numbers\n * @param {number} x\n * @param {number} y\n * @returns {number} res\n * @private\n */\nexport function modNumber(x, y) {\n // We don't use JavaScript's % operator here as this doesn't work\n // correctly for x < 0 and x === 0\n // see https://en.wikipedia.org/wiki/Modulo_operation\n return y === 0 ? x : x - y * Math.floor(x / y);\n}\nmodNumber.signature = n2;\n\n/**\n * Calculate the nth root of a, solve x^root == a\n * http://rosettacode.org/wiki/Nth_root#JavaScript\n * @param {number} a\n * @param {number} [2] root\n * @private\n */\nexport function nthRootNumber(a) {\n var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n var inv = root < 0;\n if (inv) {\n root = -root;\n }\n if (root === 0) {\n throw new Error('Root must be non-zero');\n }\n if (a < 0 && Math.abs(root) % 2 !== 1) {\n throw new Error('Root must be odd when a is negative.');\n }\n\n // edge cases zero and infinity\n if (a === 0) {\n return inv ? Infinity : 0;\n }\n if (!isFinite(a)) {\n return inv ? 0 : a;\n }\n var x = Math.pow(Math.abs(a), 1 / root);\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a < 0 ? -x : x;\n return inv ? 1 / x : x;\n\n // Very nice algorithm, but fails with nthRoot(-2, 3).\n // Newton's method has some well-known problems at times:\n // https://en.wikipedia.org/wiki/Newton%27s_method#Failure_analysis\n /*\n let x = 1 // Initial guess\n let xPrev = 1\n let i = 0\n const iMax = 10000\n do {\n const delta = (a / Math.pow(x, root - 1) - x) / root\n xPrev = x\n x = x + delta\n i++\n }\n while (xPrev !== x && i < iMax)\n if (xPrev !== x) {\n throw new Error('Function nthRoot failed to converge')\n }\n return inv ? 1 / x : x\n */\n}\nexport function signNumber(x) {\n return sign(x);\n}\nsignNumber.signature = n1;\nexport function sqrtNumber(x) {\n return Math.sqrt(x);\n}\nsqrtNumber.signature = n1;\nexport function squareNumber(x) {\n return x * x;\n}\nsquareNumber.signature = n1;\n\n/**\n * Calculate xgcd for two numbers\n * @param {number} a\n * @param {number} b\n * @return {number} result\n * @private\n */\nexport function xgcdNumber(a, b) {\n // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm\n var t; // used to swap two variables\n var q; // quotient\n var r; // remainder\n var x = 0;\n var lastx = 1;\n var y = 1;\n var lasty = 0;\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function xgcd must be integer numbers');\n }\n while (b) {\n q = Math.floor(a / b);\n r = a - q * b;\n t = x;\n x = lastx - q * x;\n lastx = t;\n t = y;\n y = lasty - q * y;\n lasty = t;\n a = b;\n b = r;\n }\n var res;\n if (a < 0) {\n res = [-a, -lastx, -lasty];\n } else {\n res = [a, a ? lastx : 0, lasty];\n }\n return res;\n}\nxgcdNumber.signature = n2;\n\n/**\n * Calculates the power of x to y, x^y, for two numbers.\n * @param {number} x\n * @param {number} y\n * @return {number} res\n */\nexport function powNumber(x, y) {\n // x^Infinity === 0 if -1 < x < 1\n // A real number 0 is returned instead of complex(0)\n if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) {\n return 0;\n }\n return Math.pow(x, y);\n}\npowNumber.signature = n2;\n\n/**\n * round a number to the given number of decimals, or to zero if decimals is\n * not provided\n * @param {number} value\n * @param {number} decimals number of decimals, between 0 and 15 (0 by default)\n * @return {number} roundedValue\n */\nexport function roundNumber(value) {\n var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n if (!isInteger(decimals) || decimals < 0 || decimals > 15) {\n throw new Error('Number of decimals in function round must be an integer from 0 to 15 inclusive');\n }\n return parseFloat(toFixed(value, decimals));\n}\n\n/**\n * Calculate the norm of a number, the absolute value.\n * @param {number} x\n * @return {number}\n */\nexport function normNumber(x) {\n return Math.abs(x);\n}\nnormNumber.signature = n1;", "import { isInteger } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function bitAndNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitAnd');\n }\n return x & y;\n}\nbitAndNumber.signature = n2;\nexport function bitNotNumber(x) {\n if (!isInteger(x)) {\n throw new Error('Integer expected in function bitNot');\n }\n return ~x;\n}\nbitNotNumber.signature = n1;\nexport function bitOrNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitOr');\n }\n return x | y;\n}\nbitOrNumber.signature = n2;\nexport function bitXorNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitXor');\n }\n return x ^ y;\n}\nbitXorNumber.signature = n2;\nexport function leftShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function leftShift');\n }\n return x << y;\n}\nleftShiftNumber.signature = n2;\nexport function rightArithShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function rightArithShift');\n }\n return x >> y;\n}\nrightArithShiftNumber.signature = n2;\nexport function rightLogShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function rightLogShift');\n }\n return x >>> y;\n}\nrightLogShiftNumber.signature = n2;", "import { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nexport function combinationsNumber(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (k > n) {\n throw new TypeError('k must be less than or equal to n');\n }\n var nMinusk = n - k;\n var answer = 1;\n var firstnumerator = k < nMinusk ? nMinusk + 1 : k + 1;\n var nextdivisor = 2;\n var lastdivisor = k < nMinusk ? k : nMinusk;\n // balance multiplications and divisions to try to keep intermediate values\n // in exact-integer range as long as possible\n for (var nextnumerator = firstnumerator; nextnumerator <= n; ++nextnumerator) {\n answer *= nextnumerator;\n while (nextdivisor <= lastdivisor && answer % nextdivisor === 0) {\n answer /= nextdivisor;\n ++nextdivisor;\n }\n }\n // for big n, k, floating point may have caused weirdness in remainder\n if (nextdivisor <= lastdivisor) {\n answer /= product(nextdivisor, lastdivisor);\n }\n return answer;\n}\ncombinationsNumber.signature = 'number, number';", "/** @param {number} i\n * @param {number} n\n * @returns {number} product of i to n\n */\nexport function product(i, n) {\n if (n < i) {\n return 1;\n }\n if (n === i) {\n return n;\n }\n var half = n + i >> 1; // divide (n + i) by 2 and truncate to integer\n return product(i, half) * product(half + 1, n);\n}", "export var pi = Math.PI;\nexport var tau = 2 * Math.PI;\nexport var e = Math.E;\nexport var phi = 1.6180339887498948; // eslint-disable-line no-loss-of-precision", "var n1 = 'number';\nvar n2 = 'number, number';\nexport function notNumber(x) {\n return !x;\n}\nnotNumber.signature = n1;\nexport function orNumber(x, y) {\n return !!(x || y);\n}\norNumber.signature = n2;\nexport function xorNumber(x, y) {\n return !!x !== !!y;\n}\nxorNumber.signature = n2;\nexport function andNumber(x, y) {\n return !!(x && y);\n}\nandNumber.signature = n2;", "/* eslint-disable no-loss-of-precision */\n\nimport { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nexport function gammaNumber(n) {\n var x;\n if (isInteger(n)) {\n if (n <= 0) {\n return isFinite(n) ? Infinity : NaN;\n }\n if (n > 171) {\n return Infinity; // Will overflow\n }\n return product(1, n - 1);\n }\n if (n < 0.5) {\n return Math.PI / (Math.sin(Math.PI * n) * gammaNumber(1 - n));\n }\n if (n >= 171.35) {\n return Infinity; // will overflow\n }\n if (n > 85.0) {\n // Extended Stirling Approx\n var twoN = n * n;\n var threeN = twoN * n;\n var fourN = threeN * n;\n var fiveN = fourN * n;\n return Math.sqrt(2 * Math.PI / n) * Math.pow(n / Math.E, n) * (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) - 571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) + 5246819 / (75246796800 * fiveN * n));\n }\n --n;\n x = gammaP[0];\n for (var i = 1; i < gammaP.length; ++i) {\n x += gammaP[i] / (n + i);\n }\n var t = n + gammaG + 0.5;\n return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x;\n}\ngammaNumber.signature = 'number';\n\n// TODO: comment on the variables g and p\n\nexport var gammaG = 4.7421875;\nexport var gammaP = [0.99999999999999709182, 57.156235665862923517, -59.597960355475491248, 14.136097974741747174, -0.49191381609762019978, 0.33994649984811888699e-4, 0.46523628927048575665e-4, -0.98374475304879564677e-4, 0.15808870322491248884e-3, -0.21026444172410488319e-3, 0.21743961811521264320e-3, -0.16431810653676389022e-3, 0.84418223983852743293e-4, -0.26190838401581408670e-4, 0.36899182659531622704e-5];\n\n// lgamma implementation ref: https://mrob.com/pub/ries/lanczos-gamma.html#code\n\n// log(2 * pi) / 2\nexport var lnSqrt2PI = 0.91893853320467274178;\nexport var lgammaG = 5; // Lanczos parameter \"g\"\nexport var lgammaN = 7; // Range of coefficients \"n\"\n\nexport var lgammaSeries = [1.000000000190015, 76.18009172947146, -86.50532032941677, 24.01409824083091, -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5];\nexport function lgammaNumber(n) {\n if (n < 0) return NaN;\n if (n === 0) return Infinity;\n if (!isFinite(n)) return n;\n if (n < 0.5) {\n // Use Euler's reflection formula:\n // gamma(z) = PI / (sin(PI * z) * gamma(1 - z))\n return Math.log(Math.PI / Math.sin(Math.PI * n)) - lgammaNumber(1 - n);\n }\n\n // Compute the logarithm of the Gamma function using the Lanczos method\n\n n = n - 1;\n var base = n + lgammaG + 0.5; // Base of the Lanczos exponential\n var sum = lgammaSeries[0];\n\n // We start with the terms that have the smallest coefficients and largest denominator\n for (var i = lgammaN - 1; i >= 1; i--) {\n sum += lgammaSeries[i] / (n + i);\n }\n return lnSqrt2PI + (n + 0.5) * Math.log(base) - base + Math.log(sum);\n}\nlgammaNumber.signature = 'number';", "import { acosh, asinh, atanh, cosh, sign, sinh, tanh } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function acosNumber(x) {\n return Math.acos(x);\n}\nacosNumber.signature = n1;\nexport function acoshNumber(x) {\n return acosh(x);\n}\nacoshNumber.signature = n1;\nexport function acotNumber(x) {\n return Math.atan(1 / x);\n}\nacotNumber.signature = n1;\nexport function acothNumber(x) {\n return isFinite(x) ? (Math.log((x + 1) / x) + Math.log(x / (x - 1))) / 2 : 0;\n}\nacothNumber.signature = n1;\nexport function acscNumber(x) {\n return Math.asin(1 / x);\n}\nacscNumber.signature = n1;\nexport function acschNumber(x) {\n var xInv = 1 / x;\n return Math.log(xInv + Math.sqrt(xInv * xInv + 1));\n}\nacschNumber.signature = n1;\nexport function asecNumber(x) {\n return Math.acos(1 / x);\n}\nasecNumber.signature = n1;\nexport function asechNumber(x) {\n var xInv = 1 / x;\n var ret = Math.sqrt(xInv * xInv - 1);\n return Math.log(ret + xInv);\n}\nasechNumber.signature = n1;\nexport function asinNumber(x) {\n return Math.asin(x);\n}\nasinNumber.signature = n1;\nexport function asinhNumber(x) {\n return asinh(x);\n}\nasinhNumber.signature = n1;\nexport function atanNumber(x) {\n return Math.atan(x);\n}\natanNumber.signature = n1;\nexport function atan2Number(y, x) {\n return Math.atan2(y, x);\n}\natan2Number.signature = n2;\nexport function atanhNumber(x) {\n return atanh(x);\n}\natanhNumber.signature = n1;\nexport function cosNumber(x) {\n return Math.cos(x);\n}\ncosNumber.signature = n1;\nexport function coshNumber(x) {\n return cosh(x);\n}\ncoshNumber.signature = n1;\nexport function cotNumber(x) {\n return 1 / Math.tan(x);\n}\ncotNumber.signature = n1;\nexport function cothNumber(x) {\n var e = Math.exp(2 * x);\n return (e + 1) / (e - 1);\n}\ncothNumber.signature = n1;\nexport function cscNumber(x) {\n return 1 / Math.sin(x);\n}\ncscNumber.signature = n1;\nexport function cschNumber(x) {\n // consider values close to zero (+/-)\n if (x === 0) {\n return Number.POSITIVE_INFINITY;\n } else {\n return Math.abs(2 / (Math.exp(x) - Math.exp(-x))) * sign(x);\n }\n}\ncschNumber.signature = n1;\nexport function secNumber(x) {\n return 1 / Math.cos(x);\n}\nsecNumber.signature = n1;\nexport function sechNumber(x) {\n return 2 / (Math.exp(x) + Math.exp(-x));\n}\nsechNumber.signature = n1;\nexport function sinNumber(x) {\n return Math.sin(x);\n}\nsinNumber.signature = n1;\nexport function sinhNumber(x) {\n return sinh(x);\n}\nsinhNumber.signature = n1;\nexport function tanNumber(x) {\n return Math.tan(x);\n}\ntanNumber.signature = n1;\nexport function tanhNumber(x) {\n return tanh(x);\n}\ntanhNumber.signature = n1;", "import { isInteger } from '../../utils/number.js';\nvar n1 = 'number';\nexport function isIntegerNumber(x) {\n return isInteger(x);\n}\nisIntegerNumber.signature = n1;\nexport function isNegativeNumber(x) {\n return x < 0;\n}\nisNegativeNumber.signature = n1;\nexport function isPositiveNumber(x) {\n return x > 0;\n}\nisPositiveNumber.signature = n1;\nexport function isZeroNumber(x) {\n return x === 0;\n}\nisZeroNumber.signature = n1;\nexport function isNaNNumber(x) {\n return Number.isNaN(x);\n}\nisNaNNumber.signature = n1;", "/**\n * Compares two BigNumbers.\n * @param {BigNumber} a - First value to compare\n * @param {BigNumber} b - Second value to compare\n * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0.\n * @param {number} [absTol=0] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0.\n * @returns {boolean} whether the two numbers are nearly equal\n * @throws {Error} If `relTol` is less than or equal to 0.\n * @throws {Error} If `absTol` is less than 0.\n *\n * @example\n * nearlyEqual(1.000000001, 1.0, 1e-9); // true\n * nearlyEqual(1.000000002, 1.0, 0); // false\n * nearlyEqual(1.0, 1.009, undefined, 0.02); // true\n * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true\n */\nexport function nearlyEqual(a, b) {\n var relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-9;\n var absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n if (relTol <= 0) {\n throw new Error('Relative tolerance must be greater than 0');\n }\n if (absTol < 0) {\n throw new Error('Absolute tolerance must be at least 0');\n }\n // NaN\n if (a.isNaN() || b.isNaN()) {\n return false;\n }\n if (!a.isFinite() || !b.isFinite()) {\n return a.eq(b);\n }\n // use \"==\" operator, handles infinities\n if (a.eq(b)) {\n return true;\n }\n // abs(a-b) <= max(relTol * max(abs(a), abs(b)), absTol)\n return a.minus(b).abs().lte(a.constructor.max(a.constructor.max(a.abs(), b.abs()).mul(relTol), absTol));\n}", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isNumeric';\nvar dependencies = ['typed'];\nexport var createIsNumeric = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is an numeric value.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNumeric(x)\n *\n * Examples:\n *\n * math.isNumeric(2) // returns true\n * math.isNumeric('2') // returns false\n * math.hasNumericValue('2') // returns true\n * math.isNumeric(0) // returns true\n * math.isNumeric(math.bignumber('42')) // returns true\n * math.isNumeric(math.bigint('42')) // returns true\n * math.isNumeric(math.fraction(4)) // returns true\n * math.isNumeric(math.complex('2-4i')) // returns false\n * math.isNumeric([2.3, 'foo', false]) // returns [true, false, true]\n *\n * See also:\n *\n * isZero, isPositive, isNegative, isInteger, hasNumericValue\n *\n * @param {*} x Value to be tested\n * @return {boolean} Returns true when `x` is a `number`, `BigNumber`,\n * `Fraction`, or `boolean`. Returns false for other types.\n * Throws an error in case of unknown types.\n */\n return typed(name, {\n 'number | BigNumber | bigint | Fraction | boolean': () => true,\n 'Complex | Unit | string | null | undefined | Node': () => false,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'hasNumericValue';\nvar dependencies = ['typed', 'isNumeric'];\nexport var createHasNumericValue = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNumeric\n } = _ref;\n /**\n * Test whether a value is an numeric value.\n *\n * In case of a string, true is returned if the string contains a numeric value.\n *\n * Syntax:\n *\n * math.hasNumericValue(x)\n *\n * Examples:\n *\n * math.hasNumericValue(2) // returns true\n * math.hasNumericValue('2') // returns true\n * math.isNumeric('2') // returns false\n * math.hasNumericValue(0) // returns true\n * math.hasNumericValue(math.bignumber('500')) // returns true\n * math.hasNumericValue(math.bigint('42')) // returns true\n * math.hasNumericValue(42n) // returns true\n * math.hasNumericValue(math.fraction(4)) // returns true\n * math.hasNumericValue(math.complex('2-4i')) // returns false\n * math.hasNumericValue(false) // returns true\n * math.hasNumericValue([2.3, 'foo', false]) // returns [true, false, true]\n *\n * See also:\n *\n * isZero, isPositive, isNegative, isInteger, isNumeric\n *\n * @param {*} x Value to be tested\n * @return {boolean} Returns true when `x` is a `number`, `BigNumber`,\n * `Fraction`, `Boolean`, or a `String` containing number. Returns false for other types.\n * Throws an error in case of unknown types.\n */\n return typed(name, {\n boolean: () => true,\n string: function string(x) {\n return x.trim().length > 0 && !isNaN(Number(x));\n },\n any: function any(x) {\n return isNumeric(x);\n }\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isPositiveNumber } from '../../plain/number/index.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nvar name = 'isPositive';\nvar dependencies = ['typed', 'config'];\nexport var createIsPositive = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config\n } = _ref;\n /**\n * Test whether a value is positive: larger than zero.\n * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isPositive(x)\n *\n * Examples:\n *\n * math.isPositive(3) // returns true\n * math.isPositive(-2) // returns false\n * math.isPositive(0) // returns false\n * math.isPositive(-0) // returns false\n * math.isPositive(0.5) // returns true\n * math.isPositive(math.bignumber(2)) // returns true\n * math.isPositive(math.fraction(-2, 5)) // returns false\n * math.isPositive(math.fraction(1, 3)) // returns true\n * math.isPositive('2') // returns true\n * math.isPositive([2, 0, -3]) // returns [true, false, false]\n *\n * See also:\n *\n * isNumeric, isZero, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isPositiveNumber(x),\n BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : !x.isNeg() && !x.isZero() && !x.isNaN(),\n bigint: x => x > 0n,\n Fraction: x => x.s > 0 && x.n > 0,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isZero';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createIsZero = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Test whether a value is zero.\n * The function can check for zero for types `number`, `BigNumber`, `Fraction`,\n * `Complex`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isZero(x)\n *\n * Examples:\n *\n * math.isZero(0) // returns true\n * math.isZero(2) // returns false\n * math.isZero(0.5) // returns false\n * math.isZero(math.bignumber(0)) // returns true\n * math.isZero(math.fraction(0)) // returns true\n * math.isZero(math.fraction(1,3)) // returns false\n * math.isZero(math.complex('2 - 4i')) // returns false\n * math.isZero(math.complex('0i')) // returns true\n * math.isZero('0') // returns true\n * math.isZero('2') // returns false\n * math.isZero([2, 0, -3]) // returns [false, true, false]\n *\n * See also:\n *\n * isNumeric, isPositive, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n 'number | BigNumber | Complex | Fraction': x => equalScalar(x, 0),\n bigint: x => x === 0n,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNaNNumber } from '../../plain/number/index.js';\nvar name = 'isNaN';\nvar dependencies = ['typed'];\nexport var createIsNaN = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is NaN (not a number).\n * The function supports types `number`, `BigNumber`, `Fraction`, `Unit` and `Complex`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNaN(x)\n *\n * Examples:\n *\n * math.isNaN(3) // returns false\n * math.isNaN(NaN) // returns true\n * math.isNaN(0) // returns false\n * math.isNaN(math.bignumber(NaN)) // returns true\n * math.isNaN(math.bignumber(0)) // returns false\n * math.isNaN(math.fraction(-2, 5)) // returns false\n * math.isNaN('-2') // returns false\n * math.isNaN([2, 0, -3, NaN]) // returns [false, false, false, true]\n *\n * See also:\n *\n * isNumeric, isNegative, isPositive, isZero, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is NaN.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: isNaNNumber,\n BigNumber: function BigNumber(x) {\n return x.isNaN();\n },\n bigint: function bigint(x) {\n return false;\n },\n Fraction: function Fraction(x) {\n return false;\n },\n Complex: function Complex(x) {\n return x.isNaN();\n },\n Unit: function Unit(x) {\n return Number.isNaN(x.value);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { typeOf as _typeOf } from '../../utils/is.js';\nvar name = 'typeOf';\nvar dependencies = ['typed'];\nexport var createTypeOf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Determine the type of an entity.\n *\n * Syntax:\n *\n * math.typeOf(x)\n *\n * Examples:\n *\n * // This list is intended to include all relevant types, for testing\n * // purposes:\n * math.typeOf(3.5) // returns 'number'\n * math.typeOf(42n) // returns 'bigint'\n * math.typeOf(math.complex('2-4i')) // returns 'Complex'\n * math.typeOf(math.unit('45 deg')) // returns 'Unit'\n * math.typeOf('hello world') // returns 'string'\n * math.typeOf(null) // returns 'null'\n * math.typeOf(true) // returns 'boolean'\n * math.typeOf([1, 2, 3]) // returns 'Array'\n * math.typeOf(new Date()) // returns 'Date'\n * math.typeOf(function () {}) // returns 'function'\n * math.typeOf({a: 2, b: 3}) // returns 'Object'\n * math.typeOf(/a regexp/) // returns 'RegExp'\n * math.typeOf(undefined) // returns 'undefined'\n * math.typeOf(math.bignumber('23e99')) // returns 'BigNumber'\n * math.typeOf(math.chain(2)) // returns 'Chain'\n * math.typeOf(math.fraction(1, 3)) // returns 'Fraction'\n * math.typeOf(math.help('sqrt')) // returns 'Help'\n * math.typeOf(math.index(1, 3)) // returns 'Index'\n * math.typeOf(math.matrix([[1],[3]])) // returns 'DenseMatrix'\n * math.typeOf(math.matrix([],'sparse')) // returns 'SparseMatrix'\n * math.typeOf(new math.Range(0, 10)) // returns 'Range'\n * math.typeOf(math.evaluate('a=2\\na')) // returns 'ResultSet'\n * math.typeOf(math.parse('A[2]')) // returns 'AccessorNode'\n * math.typeOf(math.parse('[1,2,3]')) // returns 'ArrayNode'\n * math.typeOf(math.parse('x=2')) // returns 'AssignmentNode'\n * math.typeOf(math.parse('a=2; b=3')) // returns 'BlockNode'\n * math.typeOf(math.parse('x<0?-1:1')) // returns 'ConditionalNode'\n * math.typeOf(math.parse('2.3')) // returns 'ConstantNode'\n * math.typeOf(math.parse('f(x)=x^2')) // returns 'FunctionAssignmentNode'\n * math.typeOf(math.parse('sqrt(4)')) // returns 'FunctionNode'\n * math.typeOf(math.parse('A[2]').index) // returns 'IndexNode'\n * math.typeOf(math.parse('{a:2}')) // returns 'ObjectNode'\n * math.typeOf(math.parse('(2+3)')) // returns 'ParenthesisNode'\n * math.typeOf(math.parse('1:10')) // returns 'RangeNode'\n * math.typeOf(math.parse('a {\n var {\n typed,\n config\n } = _ref;\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether two scalar values are nearly equal.\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Complex | Unit} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Complex} y Second value to compare\n * @return {boolean} Returns true when the compared values are equal, else returns false\n * @private\n */\n return typed(name, {\n 'boolean, boolean': function booleanBoolean(x, y) {\n return x === y;\n },\n 'number, number': function numberNumber(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.eq(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x === y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return x.equals(y);\n },\n 'Complex, Complex': function ComplexComplex(x, y) {\n return complexEquals(x, y, config.relTol, config.absTol);\n }\n }, compareUnits);\n});\nexport var createEqualScalarNumber = factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual } from './number.js';\n\n/**\n * Test whether two complex values are equal provided a given relTol and absTol.\n * Does not use or change the global Complex.EPSILON setting\n * @param {Complex} x - The first complex number for comparison.\n * @param {Complex} y - The second complex number for comparison.\n * @param {number} relTol - The relative tolerance for comparison.\n * @param {number} absTol - The absolute tolerance for comparison.\n * @returns {boolean} - Returns true if the two complex numbers are equal within the given tolerances, otherwise returns false.\n */\nexport function complexEquals(x, y, relTol, absTol) {\n return nearlyEqual(x.re, y.re, relTol, absTol) && nearlyEqual(x.im, y.im, relTol, absTol);\n}", "import { factory } from '../../utils/factory.js';\nexport var createCompareUnits = /* #__PURE__ */factory('compareUnits', ['typed'], _ref => {\n var {\n typed\n } = _ref;\n return {\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (!x.equalBase(y)) {\n throw new Error('Cannot compare units with different base');\n }\n return typed.find(self, [x.valueType(), y.valueType()])(x.value, y.value);\n })\n };\n});", "import { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { format } from '../../utils/string.js';\nimport { clone, deepStrictEqual } from '../../utils/object.js';\nimport { arraySize, getArrayDataType, processSizesWildcard, unsqueeze, validateIndex } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { maxArgumentCount } from '../../utils/function.js';\nvar name = 'SparseMatrix';\nvar dependencies = ['typed', 'equalScalar', 'Matrix'];\nexport var createSparseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar,\n Matrix\n } = _ref;\n /**\n * Sparse Matrix implementation. This type implements\n * a [Compressed Column Storage](https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_(CSC_or_CCS))\n * format for two-dimensional sparse matrices.\n * @class SparseMatrix\n */\n function SparseMatrix(data, datatype) {\n if (!(this instanceof SparseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data)) {\n // create from matrix\n _createFromMatrix(this, data, datatype);\n } else if (data && isArray(data.index) && isArray(data.ptr) && isArray(data.size)) {\n // initialize fields\n this._values = data.values;\n this._index = data.index;\n this._ptr = data.ptr;\n this._size = data.size;\n this._datatype = datatype || data.datatype;\n } else if (isArray(data)) {\n // create from array\n _createFromArray(this, data, datatype);\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._values = [];\n this._index = [];\n this._ptr = [0];\n this._size = [0, 0];\n this._datatype = datatype;\n }\n }\n function _createFromMatrix(matrix, source, datatype) {\n // check matrix type\n if (source.type === 'SparseMatrix') {\n // clone arrays\n matrix._values = source._values ? clone(source._values) : undefined;\n matrix._index = clone(source._index);\n matrix._ptr = clone(source._ptr);\n matrix._size = clone(source._size);\n matrix._datatype = datatype || source._datatype;\n } else {\n // build from matrix data\n _createFromArray(matrix, source.valueOf(), datatype || source._datatype);\n }\n }\n function _createFromArray(matrix, data, datatype) {\n // initialize fields\n matrix._values = [];\n matrix._index = [];\n matrix._ptr = [];\n matrix._datatype = datatype;\n // discover rows & columns, do not use math.size() to avoid looping array twice\n var rows = data.length;\n var columns = 0;\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, datatype);\n }\n\n // check we have rows (empty array)\n if (rows > 0) {\n // column index\n var j = 0;\n do {\n // store pointer to values index\n matrix._ptr.push(matrix._index.length);\n // loop rows\n for (var i = 0; i < rows; i++) {\n // current row\n var row = data[i];\n // check row is an array\n if (isArray(row)) {\n // update columns if needed (only on first column)\n if (j === 0 && columns < row.length) {\n columns = row.length;\n }\n // check row has column\n if (j < row.length) {\n // value\n var v = row[j];\n // check value != 0\n if (!eq(v, zero)) {\n // store value\n matrix._values.push(v);\n // index\n matrix._index.push(i);\n }\n }\n } else {\n // update columns if needed (only on first column)\n if (j === 0 && columns < 1) {\n columns = 1;\n }\n // check value != 0 (row is a scalar)\n if (!eq(row, zero)) {\n // store value\n matrix._values.push(row);\n // index\n matrix._index.push(i);\n }\n }\n }\n // increment index\n j++;\n } while (j < columns);\n }\n // store number of values in ptr\n matrix._ptr.push(matrix._index.length);\n // size\n matrix._size = [rows, columns];\n }\n SparseMatrix.prototype = new Matrix();\n\n /**\n * Create a new SparseMatrix\n */\n SparseMatrix.prototype.createSparseMatrix = function (data, datatype) {\n return new SparseMatrix(data, datatype);\n };\n\n /**\n * Attach type information\n */\n Object.defineProperty(SparseMatrix, 'name', {\n value: 'SparseMatrix'\n });\n SparseMatrix.prototype.constructor = SparseMatrix;\n SparseMatrix.prototype.type = 'SparseMatrix';\n SparseMatrix.prototype.isSparseMatrix = true;\n\n /**\n * Get the matrix type\n *\n * Usage:\n * const matrixType = matrix.getDataType() // retrieves the matrix type\n *\n * @memberOf SparseMatrix\n * @return {string} type information; if multiple types are found from the Matrix, it will return \"mixed\"\n */\n SparseMatrix.prototype.getDataType = function () {\n return getArrayDataType(this._values, typeOf);\n };\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @memberof SparseMatrix\n * @return {string} The storage format.\n */\n SparseMatrix.prototype.storage = function () {\n return 'sparse';\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @memberof SparseMatrix\n * @return {string} The datatype.\n */\n SparseMatrix.prototype.datatype = function () {\n return this._datatype;\n };\n\n /**\n * Create a new SparseMatrix\n * @memberof SparseMatrix\n * @param {Array} data\n * @param {string} [datatype]\n */\n SparseMatrix.prototype.create = function (data, datatype) {\n return new SparseMatrix(data, datatype);\n };\n\n /**\n * Get the matrix density.\n *\n * Usage:\n * const density = matrix.density() // retrieve matrix density\n *\n * @memberof SparseMatrix\n * @return {number} The matrix density.\n */\n SparseMatrix.prototype.density = function () {\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n // calculate density\n return rows !== 0 && columns !== 0 ? this._index.length / (rows * columns) : 0;\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @memberof SparseMatrix\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n SparseMatrix.prototype.subset = function (index, replacement, defaultValue) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke subset on a Pattern only matrix');\n }\n\n // check arguments\n switch (arguments.length) {\n case 1:\n return _getsubset(this, index);\n\n // intentional fall through\n case 2:\n case 3:\n return _setsubset(this, index, replacement, defaultValue);\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n function _getsubset(matrix, idx) {\n // check idx\n if (!isIndex(idx)) {\n throw new TypeError('Invalid index');\n }\n var isScalar = idx.isScalar();\n if (isScalar) {\n // return a scalar\n return matrix.get(idx.min());\n }\n // validate dimensions\n var size = idx.size();\n if (size.length !== matrix._size.length) {\n throw new DimensionError(size.length, matrix._size.length);\n }\n\n // vars\n var i, ii, k, kk;\n\n // validate if any of the ranges in the index is out of range\n var min = idx.min();\n var max = idx.max();\n for (i = 0, ii = matrix._size.length; i < ii; i++) {\n validateIndex(min[i], matrix._size[i]);\n validateIndex(max[i], matrix._size[i]);\n }\n\n // matrix arrays\n var mvalues = matrix._values;\n var mindex = matrix._index;\n var mptr = matrix._ptr;\n\n // rows & columns dimensions for result matrix\n var rows = idx.dimension(0);\n var columns = idx.dimension(1);\n\n // workspace & permutation vector\n var w = [];\n var pv = [];\n\n // loop rows in resulting matrix\n rows.forEach(function (i, r) {\n // update permutation vector\n pv[i] = r[0];\n // mark i in workspace\n w[i] = true;\n });\n\n // result matrix arrays\n var values = mvalues ? [] : undefined;\n var index = [];\n var ptr = [];\n\n // loop columns in result matrix\n columns.forEach(function (j) {\n // update ptr\n ptr.push(index.length);\n // loop values in column j\n for (k = mptr[j], kk = mptr[j + 1]; k < kk; k++) {\n // row\n i = mindex[k];\n // check row is in result matrix\n if (w[i] === true) {\n // push index\n index.push(pv[i]);\n // check we need to process values\n if (values) {\n values.push(mvalues[k]);\n }\n }\n }\n });\n // update ptr\n ptr.push(index.length);\n\n // return matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size,\n datatype: matrix._datatype\n });\n }\n function _setsubset(matrix, index, submatrix, defaultValue) {\n // check index\n if (!index || index.isIndex !== true) {\n throw new TypeError('Invalid index');\n }\n\n // get index size and check whether the index contains a single value\n var iSize = index.size();\n var isScalar = index.isScalar();\n\n // calculate the size of the submatrix, and convert it into an Array if needed\n var sSize;\n if (isMatrix(submatrix)) {\n // submatrix size\n sSize = submatrix.size();\n // use array representation\n submatrix = submatrix.toArray();\n } else {\n // get submatrix size (array, scalar)\n sSize = arraySize(submatrix);\n }\n\n // check index is a scalar\n if (isScalar) {\n // verify submatrix is a scalar\n if (sSize.length !== 0) {\n throw new TypeError('Scalar expected');\n }\n // set value\n matrix.set(index.min(), submatrix, defaultValue);\n } else {\n // validate dimensions, index size must be one or two dimensions\n if (iSize.length !== 1 && iSize.length !== 2) {\n throw new DimensionError(iSize.length, matrix._size.length, '<');\n }\n\n // check submatrix and index have the same dimensions\n if (sSize.length < iSize.length) {\n // calculate number of missing outer dimensions\n var i = 0;\n var outer = 0;\n while (iSize[i] === 1 && sSize[i] === 1) {\n i++;\n }\n while (iSize[i] === 1) {\n outer++;\n i++;\n }\n // unsqueeze both outer and inner dimensions\n submatrix = unsqueeze(submatrix, iSize.length, outer, sSize);\n }\n\n // check whether the size of the submatrix matches the index size\n if (!deepStrictEqual(iSize, sSize)) {\n throw new DimensionError(iSize, sSize, '>');\n }\n\n // insert the sub matrix\n if (iSize.length === 1) {\n // if the replacement index only has 1 dimension, go trough each one and set its value\n var range = index.dimension(0);\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n matrix.set([dataIndex, 0], submatrix[subIndex[0]], defaultValue);\n });\n } else {\n // if the replacement index has 2 dimensions, go through each one and set the value in the correct index\n var firstDimensionRange = index.dimension(0);\n var secondDimensionRange = index.dimension(1);\n firstDimensionRange.forEach(function (firstDataIndex, firstSubIndex) {\n validateIndex(firstDataIndex);\n secondDimensionRange.forEach(function (secondDataIndex, secondSubIndex) {\n validateIndex(secondDataIndex);\n matrix.set([firstDataIndex, secondDataIndex], submatrix[firstSubIndex[0]][secondSubIndex[0]], defaultValue);\n });\n });\n }\n }\n return matrix;\n }\n\n /**\n * Get a single element from the matrix.\n * @memberof SparseMatrix\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n SparseMatrix.prototype.get = function (index) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length !== this._size.length) {\n throw new DimensionError(index.length, this._size.length);\n }\n\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke get on a Pattern only matrix');\n }\n\n // row and column\n var i = index[0];\n var j = index[1];\n\n // check i, j are valid\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[1]);\n\n // find value index\n var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);\n // check k is prior to next column k and it is in the correct row\n if (k < this._ptr[j + 1] && this._index[k] === i) {\n return this._values[k];\n }\n return 0;\n };\n\n /**\n * Replace a single element in the matrix.\n * @memberof SparseMatrix\n * @param {number[]} index Zero-based index\n * @param {*} v\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be set to zero.\n * @return {SparseMatrix} self\n */\n SparseMatrix.prototype.set = function (index, v, defaultValue) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length !== this._size.length) {\n throw new DimensionError(index.length, this._size.length);\n }\n\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke set on a Pattern only matrix');\n }\n\n // row and column\n var i = index[0];\n var j = index[1];\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(this._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [this._datatype, this._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, this._datatype);\n }\n\n // check we need to resize matrix\n if (i > rows - 1 || j > columns - 1) {\n // resize matrix\n _resize(this, Math.max(i + 1, rows), Math.max(j + 1, columns), defaultValue);\n // update rows & columns\n rows = this._size[0];\n columns = this._size[1];\n }\n\n // check i, j are valid\n validateIndex(i, rows);\n validateIndex(j, columns);\n\n // find value index\n var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);\n // check k is prior to next column k and it is in the correct row\n if (k < this._ptr[j + 1] && this._index[k] === i) {\n // check value != 0\n if (!eq(v, zero)) {\n // update value\n this._values[k] = v;\n } else {\n // remove value from matrix\n _remove(k, j, this._values, this._index, this._ptr);\n }\n } else {\n if (!eq(v, zero)) {\n // insert value @ (i, j)\n _insert(k, i, j, v, this._values, this._index, this._ptr);\n }\n }\n return this;\n };\n function _getValueIndex(i, top, bottom, index) {\n // check row is on the bottom side\n if (bottom - top === 0) {\n return bottom;\n }\n // loop rows [top, bottom[\n for (var r = top; r < bottom; r++) {\n // check we found value index\n if (index[r] === i) {\n return r;\n }\n }\n // we did not find row\n return top;\n }\n function _remove(k, j, values, index, ptr) {\n // remove value @ k\n values.splice(k, 1);\n index.splice(k, 1);\n // update pointers\n for (var x = j + 1; x < ptr.length; x++) {\n ptr[x]--;\n }\n }\n function _insert(k, i, j, v, values, index, ptr) {\n // insert value\n values.splice(k, 0, v);\n // update row for k\n index.splice(k, 0, i);\n // update column pointers\n for (var x = j + 1; x < ptr.length; x++) {\n ptr[x]++;\n }\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @memberof SparseMatrix\n * @param {number[] | Matrix} size The new size the matrix should have.\n * Since sparse matrices are always two-dimensional,\n * size must be two numbers in either an array or a matrix\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n SparseMatrix.prototype.resize = function (size, defaultValue, copy) {\n // validate arguments\n if (!isCollection(size)) {\n throw new TypeError('Array or Matrix expected');\n }\n\n // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector\n var sizeArray = size.valueOf().map(value => {\n return Array.isArray(value) && value.length === 1 ? value[0] : value;\n });\n if (sizeArray.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // check sizes\n sizeArray.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value < 0) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(sizeArray) + ')');\n }\n });\n\n // matrix to resize\n var m = copy ? this.clone() : this;\n // resize matrix\n return _resize(m, sizeArray[0], sizeArray[1], defaultValue);\n };\n function _resize(matrix, rows, columns, defaultValue) {\n // value to insert at the time of growing matrix\n var value = defaultValue || 0;\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(matrix._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, matrix._datatype);\n // convert value to the same datatype\n value = typed.convert(value, matrix._datatype);\n }\n\n // should we insert the value?\n var ins = !eq(value, zero);\n\n // old columns and rows\n var r = matrix._size[0];\n var c = matrix._size[1];\n var i, j, k;\n\n // check we need to increase columns\n if (columns > c) {\n // loop new columns\n for (j = c; j < columns; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._values.length;\n // check we need to insert matrix._values\n if (ins) {\n // loop rows\n for (i = 0; i < r; i++) {\n // add new matrix._values\n matrix._values.push(value);\n // update matrix._index\n matrix._index.push(i);\n }\n }\n }\n // store number of matrix._values in matrix._ptr\n matrix._ptr[columns] = matrix._values.length;\n } else if (columns < c) {\n // truncate matrix._ptr\n matrix._ptr.splice(columns + 1, c - columns);\n // truncate matrix._values and matrix._index\n matrix._values.splice(matrix._ptr[columns], matrix._values.length);\n matrix._index.splice(matrix._ptr[columns], matrix._index.length);\n }\n // update columns\n c = columns;\n\n // check we need to increase rows\n if (rows > r) {\n // check we have to insert values\n if (ins) {\n // inserts\n var n = 0;\n // loop columns\n for (j = 0; j < c; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._ptr[j] + n;\n // where to insert matrix._values\n k = matrix._ptr[j + 1] + n;\n // pointer\n var p = 0;\n // loop new rows, initialize pointer\n for (i = r; i < rows; i++, p++) {\n // add value\n matrix._values.splice(k + p, 0, value);\n // update matrix._index\n matrix._index.splice(k + p, 0, i);\n // increment inserts\n n++;\n }\n }\n // store number of matrix._values in matrix._ptr\n matrix._ptr[c] = matrix._values.length;\n }\n } else if (rows < r) {\n // deletes\n var d = 0;\n // loop columns\n for (j = 0; j < c; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._ptr[j] - d;\n // where matrix._values start for next column\n var k0 = matrix._ptr[j];\n var k1 = matrix._ptr[j + 1] - d;\n // loop matrix._index\n for (k = k0; k < k1; k++) {\n // row\n i = matrix._index[k];\n // check we need to delete value and matrix._index\n if (i > rows - 1) {\n // remove value\n matrix._values.splice(k, 1);\n // remove item from matrix._index\n matrix._index.splice(k, 1);\n // increase deletes\n d++;\n }\n }\n }\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._values.length;\n }\n // update matrix._size\n matrix._size[0] = rows;\n matrix._size[1] = columns;\n // return matrix\n return matrix;\n }\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * NOTE: This might be better suited to copy by default, instead of modifying\n * in place. For now, it operates in place to remain consistent with\n * resize().\n *\n * @memberof SparseMatrix\n * @param {number[]} sizes The new size the matrix should have.\n * Since sparse matrices are always two-dimensional,\n * size must be two numbers in either an array or a matrix\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n SparseMatrix.prototype.reshape = function (sizes, copy) {\n // validate arguments\n if (!isArray(sizes)) {\n throw new TypeError('Array expected');\n }\n if (sizes.length !== 2) {\n throw new Error('Sparse matrices can only be reshaped in two dimensions');\n }\n\n // check sizes\n sizes.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value <= -2 || value === 0) {\n throw new TypeError('Invalid size, must contain positive integers or -1 ' + '(size: ' + format(sizes) + ')');\n }\n });\n var currentLength = this._size[0] * this._size[1];\n sizes = processSizesWildcard(sizes, currentLength);\n var newLength = sizes[0] * sizes[1];\n\n // m * n must not change\n if (currentLength !== newLength) {\n throw new Error('Reshaping sparse matrix will result in the wrong number of elements');\n }\n\n // matrix to reshape\n var m = copy ? this.clone() : this;\n\n // return unchanged if the same shape\n if (this._size[0] === sizes[0] && this._size[1] === sizes[1]) {\n return m;\n }\n\n // Convert to COO format (generate a column index)\n var colIndex = [];\n for (var i = 0; i < m._ptr.length; i++) {\n for (var j = 0; j < m._ptr[i + 1] - m._ptr[i]; j++) {\n colIndex.push(i);\n }\n }\n\n // Clone the values array\n var values = m._values.slice();\n\n // Clone the row index array\n var rowIndex = m._index.slice();\n\n // Transform the (row, column) indices\n for (var _i = 0; _i < m._index.length; _i++) {\n var r1 = rowIndex[_i];\n var c1 = colIndex[_i];\n var flat = r1 * m._size[1] + c1;\n colIndex[_i] = flat % sizes[1];\n rowIndex[_i] = Math.floor(flat / sizes[1]);\n }\n\n // Now reshaping is supposed to preserve the row-major order, BUT these sparse matrices are stored\n // in column-major order, so we have to reorder the value array now. One option is to use a multisort,\n // sorting several arrays based on some other array.\n\n // OR, we could easily just:\n\n // 1. Remove all values from the matrix\n m._values.length = 0;\n m._index.length = 0;\n m._ptr.length = sizes[1] + 1;\n m._size = sizes.slice();\n for (var _i2 = 0; _i2 < m._ptr.length; _i2++) {\n m._ptr[_i2] = 0;\n }\n\n // 2. Re-insert all elements in the proper order (simplified code from SparseMatrix.prototype.set)\n // This step is probably the most time-consuming\n for (var h = 0; h < values.length; h++) {\n var _i3 = rowIndex[h];\n var _j = colIndex[h];\n var v = values[h];\n var k = _getValueIndex(_i3, m._ptr[_j], m._ptr[_j + 1], m._index);\n _insert(k, _i3, _j, v, m._values, m._index, m._ptr);\n }\n\n // The value indices are inserted out of order, but apparently that's... still OK?\n\n return m;\n };\n\n /**\n * Create a clone of the matrix\n * @memberof SparseMatrix\n * @return {SparseMatrix} clone\n */\n SparseMatrix.prototype.clone = function () {\n var m = new SparseMatrix({\n values: this._values ? clone(this._values) : undefined,\n index: clone(this._index),\n ptr: clone(this._ptr),\n size: clone(this._size),\n datatype: this._datatype\n });\n return m;\n };\n\n /**\n * Retrieve the size of the matrix.\n * @memberof SparseMatrix\n * @returns {number[]} size\n */\n SparseMatrix.prototype.size = function () {\n return this._size.slice(0); // copy the Array\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @memberof SparseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {SparseMatrix} matrix\n */\n SparseMatrix.prototype.map = function (callback, skipZeros) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke map on a Pattern only matrix');\n }\n // matrix instance\n var me = this;\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n // invoke callback\n var args = maxArgumentCount(callback);\n var invoke = function invoke(v, i, j) {\n // invoke callback\n if (args === 1) return callback(v);\n if (args === 2) return callback(v, [i, j]);\n return callback(v, [i, j], me);\n };\n // invoke _map\n return _map(this, 0, rows - 1, 0, columns - 1, invoke, skipZeros);\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on the interval\n * [minRow..maxRow, minColumn..maxColumn].\n */\n function _map(matrix, minRow, maxRow, minColumn, maxColumn, callback, skipZeros) {\n // result arrays\n var values = [];\n var index = [];\n var ptr = [];\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(matrix._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, matrix._datatype);\n }\n\n // invoke callback\n var invoke = function invoke(v, x, y) {\n // invoke callback\n v = callback(v, x, y);\n // check value != 0\n if (!eq(v, zero)) {\n // store value\n values.push(v);\n // index\n index.push(x);\n }\n };\n // loop columns\n for (var j = minColumn; j <= maxColumn; j++) {\n // store pointer to values index\n ptr.push(values.length);\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = matrix._ptr[j];\n var k1 = matrix._ptr[j + 1];\n if (skipZeros) {\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = matrix._index[k];\n // check i is in range\n if (i >= minRow && i <= maxRow) {\n // value @ k\n invoke(matrix._values[k], i - minRow, j - minColumn);\n }\n }\n } else {\n // create a cache holding all defined values\n var _values = {};\n for (var _k = k0; _k < k1; _k++) {\n var _i4 = matrix._index[_k];\n _values[_i4] = matrix._values[_k];\n }\n\n // loop over all rows (indexes can be unordered so we can't use that),\n // and either read the value or zero\n for (var _i5 = minRow; _i5 <= maxRow; _i5++) {\n var value = _i5 in _values ? _values[_i5] : 0;\n invoke(value, _i5 - minRow, j - minColumn);\n }\n }\n }\n\n // store number of values in ptr\n ptr.push(values.length);\n // return sparse matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [maxRow - minRow + 1, maxColumn - minColumn + 1]\n });\n }\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @memberof SparseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n * If false, the indices are guaranteed to be in order,\n * if true, the indices can be unordered.\n */\n SparseMatrix.prototype.forEach = function (callback, skipZeros) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke forEach on a Pattern only matrix');\n }\n // matrix instance\n var me = this;\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n if (skipZeros) {\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n\n // value @ k\n callback(this._values[k], [i, j], me);\n }\n } else {\n // create a cache holding all defined values\n var values = {};\n for (var _k2 = k0; _k2 < k1; _k2++) {\n var _i6 = this._index[_k2];\n values[_i6] = this._values[_k2];\n }\n\n // loop over all rows (indexes can be unordered so we can't use that),\n // and either read the value or zero\n for (var _i7 = 0; _i7 < rows; _i7++) {\n var value = _i7 in values ? values[_i7] : 0;\n callback(value, [_i7, j], me);\n }\n }\n }\n };\n\n /**\n * Iterate over the matrix elements, skipping zeros\n * @return {Iterable<{ value, index: number[] }>}\n */\n SparseMatrix.prototype[Symbol.iterator] = function* () {\n if (!this._values) {\n throw new Error('Cannot iterate a Pattern only matrix');\n }\n var columns = this._size[1];\n for (var j = 0; j < columns; j++) {\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n yield {\n value: this._values[k],\n index: [i, j]\n };\n }\n }\n };\n\n /**\n * Create an Array with a copy of the data of the SparseMatrix\n * @memberof SparseMatrix\n * @returns {Array} array\n */\n SparseMatrix.prototype.toArray = function () {\n return _toArray(this._values, this._index, this._ptr, this._size, true);\n };\n\n /**\n * Get the primitive value of the SparseMatrix: a two dimensions array\n * @memberof SparseMatrix\n * @returns {Array} array\n */\n SparseMatrix.prototype.valueOf = function () {\n return _toArray(this._values, this._index, this._ptr, this._size, false);\n };\n function _toArray(values, index, ptr, size, copy) {\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n // result\n var a = [];\n // vars\n var i, j;\n // initialize array\n for (i = 0; i < rows; i++) {\n a[i] = [];\n for (j = 0; j < columns; j++) {\n a[i][j] = 0;\n }\n }\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n i = index[k];\n // set value (use one for pattern matrix)\n a[i][j] = values ? copy ? clone(values[k]) : values[k] : 1;\n }\n }\n return a;\n }\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @memberof SparseMatrix\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n SparseMatrix.prototype.format = function (options) {\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n // density\n var density = this.density();\n // rows & columns\n var str = 'Sparse Matrix [' + format(rows, options) + ' x ' + format(columns, options) + '] density: ' + format(density, options) + '\\n';\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n // append value\n str += '\\n (' + format(i, options) + ', ' + format(j, options) + ') ==> ' + (this._values ? format(this._values[k], options) : 'X');\n }\n }\n return str;\n };\n\n /**\n * Get a string representation of the matrix\n * @memberof SparseMatrix\n * @returns {string} str\n */\n SparseMatrix.prototype.toString = function () {\n return format(this.toArray());\n };\n\n /**\n * Get a JSON representation of the matrix\n * @memberof SparseMatrix\n * @returns {Object}\n */\n SparseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'SparseMatrix',\n values: this._values,\n index: this._index,\n ptr: this._ptr,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Get the kth Matrix diagonal.\n *\n * @memberof SparseMatrix\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved.\n *\n * @returns {Matrix} The matrix vector with the diagonal values.\n */\n SparseMatrix.prototype.diagonal = function (k) {\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // number diagonal values\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // diagonal arrays\n var values = [];\n var index = [];\n var ptr = [];\n // initial ptr value\n ptr[0] = 0;\n // loop columns\n for (var j = kSuper; j < columns && values.length < n; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n // loop x within [k0, k1[\n for (var x = k0; x < k1; x++) {\n // row index\n var i = this._index[x];\n // check row\n if (i === j - kSuper + kSub) {\n // value on this column\n values.push(this._values[x]);\n // store row\n index[values.length - 1] = i - kSub;\n // exit loop\n break;\n }\n }\n }\n // close ptr\n ptr.push(values.length);\n // return matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [n, 1]\n });\n };\n\n /**\n * Generate a matrix from a JSON object\n * @memberof SparseMatrix\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SparseMatrix\", \"values\": [], \"index\": [], \"ptr\": [], \"size\": []}`,\n * where mathjs is optional\n * @returns {SparseMatrix}\n */\n SparseMatrix.fromJSON = function (json) {\n return new SparseMatrix(json);\n };\n\n /**\n * Create a diagonal matrix.\n *\n * @memberof SparseMatrix\n * @param {Array} size The matrix size.\n * @param {number | Array | Matrix } value The values for the diagonal.\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in.\n * @param {number} [defaultValue] The default value for non-diagonal\n * @param {string} [datatype] The Matrix datatype, values must be of this datatype.\n *\n * @returns {SparseMatrix}\n */\n SparseMatrix.diagonal = function (size, value, k, defaultValue, datatype) {\n if (!isArray(size)) {\n throw new TypeError('Array expected, size parameter');\n }\n if (size.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // map size & validate\n size = size.map(function (s) {\n // check it is a big number\n if (isBigNumber(s)) {\n // convert it\n s = s.toNumber();\n }\n // validate arguments\n if (!isNumber(s) || !isInteger(s) || s < 1) {\n throw new Error('Size values must be positive integers');\n }\n return s;\n });\n\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, datatype);\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // number of non-zero items\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // value extraction function\n var _value;\n\n // check value\n if (isArray(value)) {\n // validate array\n if (value.length !== n) {\n // number of values in array must be n\n throw new Error('Invalid value array length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value[i];\n };\n } else if (isMatrix(value)) {\n // matrix size\n var ms = value.size();\n // validate matrix\n if (ms.length !== 1 || ms[0] !== n) {\n // number of values in array must be n\n throw new Error('Invalid matrix length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value.get([i]);\n };\n } else {\n // define function\n _value = function _value() {\n // return value\n return value;\n };\n }\n\n // create arrays\n var values = [];\n var index = [];\n var ptr = [];\n\n // loop items\n for (var j = 0; j < columns; j++) {\n // number of rows with value\n ptr.push(values.length);\n // diagonal index\n var i = j - kSuper;\n // check we need to set diagonal value\n if (i >= 0 && i < n) {\n // get value @ i\n var v = _value(i);\n // check for zero\n if (!eq(v, zero)) {\n // column\n index.push(i + kSub);\n // add value\n values.push(v);\n }\n }\n }\n // last value should be number of values\n ptr.push(values.length);\n // create SparseMatrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [rows, columns]\n });\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @memberof SparseMatrix\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n SparseMatrix.prototype.swapRows = function (i, j) {\n // check index\n if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) {\n throw new Error('Row index must be positive integers');\n }\n // check dimensions\n if (this._size.length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n // validate index\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[0]);\n\n // swap rows\n SparseMatrix._swapRows(i, j, this._size[1], this._values, this._index, this._ptr);\n // return current instance\n return this;\n };\n\n /**\n * Loop rows with data in column j.\n *\n * @param {number} j Column\n * @param {Array} values Matrix values\n * @param {Array} index Matrix row indeces\n * @param {Array} ptr Matrix column pointers\n * @param {Function} callback Callback function invoked for every row in column j\n */\n SparseMatrix._forEachRow = function (j, values, index, ptr, callback) {\n // indeces for column j\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // loop\n for (var k = k0; k < k1; k++) {\n // invoke callback\n callback(index[k], values[k]);\n }\n };\n\n /**\n * Swap rows x and y in Sparse Matrix data structures.\n *\n * @param {number} x Matrix row index 1\n * @param {number} y Matrix row index 2\n * @param {number} columns Number of columns in matrix\n * @param {Array} values Matrix values\n * @param {Array} index Matrix row indeces\n * @param {Array} ptr Matrix column pointers\n */\n SparseMatrix._swapRows = function (x, y, columns, values, index, ptr) {\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // find value index @ x\n var kx = _getValueIndex(x, k0, k1, index);\n // find value index @ x\n var ky = _getValueIndex(y, k0, k1, index);\n // check both rows exist in matrix\n if (kx < k1 && ky < k1 && index[kx] === x && index[ky] === y) {\n // swap values (check for pattern matrix)\n if (values) {\n var v = values[kx];\n values[kx] = values[ky];\n values[ky] = v;\n }\n // next column\n continue;\n }\n // check x row exist & no y row\n if (kx < k1 && index[kx] === x && (ky >= k1 || index[ky] !== y)) {\n // value @ x (check for pattern matrix)\n var vx = values ? values[kx] : undefined;\n // insert value @ y\n index.splice(ky, 0, y);\n if (values) {\n values.splice(ky, 0, vx);\n }\n // remove value @ x (adjust array index if needed)\n index.splice(ky <= kx ? kx + 1 : kx, 1);\n if (values) {\n values.splice(ky <= kx ? kx + 1 : kx, 1);\n }\n // next column\n continue;\n }\n // check y row exist & no x row\n if (ky < k1 && index[ky] === y && (kx >= k1 || index[kx] !== x)) {\n // value @ y (check for pattern matrix)\n var vy = values ? values[ky] : undefined;\n // insert value @ x\n index.splice(kx, 0, x);\n if (values) {\n values.splice(kx, 0, vy);\n }\n // remove value @ y (adjust array index if needed)\n index.splice(kx <= ky ? ky + 1 : ky, 1);\n if (values) {\n values.splice(kx <= ky ? ky + 1 : ky, 1);\n }\n }\n }\n };\n return SparseMatrix;\n}, {\n isClass: true\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'number';\nvar dependencies = ['typed'];\n\n/**\n * Separates the radix, integer part, and fractional part of a non decimal number string\n * @param {string} input string to parse\n * @returns {object} the parts of the string or null if not a valid input\n */\nfunction getNonDecimalNumberParts(input) {\n var nonDecimalWithRadixMatch = input.match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/);\n if (nonDecimalWithRadixMatch) {\n var radix = {\n '0b': 2,\n '0o': 8,\n '0x': 16\n }[nonDecimalWithRadixMatch[1]];\n var integerPart = nonDecimalWithRadixMatch[2];\n var fractionalPart = nonDecimalWithRadixMatch[3];\n return {\n input,\n radix,\n integerPart,\n fractionalPart\n };\n } else {\n return null;\n }\n}\n\n/**\n * Makes a number from a radix, and integer part, and a fractional part\n * @param {parts} [x] parts of the number string (from getNonDecimalNumberParts)\n * @returns {number} the number\n */\nfunction makeNumberFromNonDecimalParts(parts) {\n var n = parseInt(parts.integerPart, parts.radix);\n var f = 0;\n for (var i = 0; i < parts.fractionalPart.length; i++) {\n var digitValue = parseInt(parts.fractionalPart[i], parts.radix);\n f += digitValue / Math.pow(parts.radix, i + 1);\n }\n var result = n + f;\n if (isNaN(result)) {\n throw new SyntaxError('String \"' + parts.input + '\" is not a valid number');\n }\n return result;\n}\nexport var createNumber = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a number or convert a string, boolean, or unit to a number.\n * When value is a matrix, all elements will be converted to number.\n *\n * Syntax:\n *\n * math.number(value)\n * math.number(unit, valuelessUnit)\n *\n * Examples:\n *\n * math.number(2) // returns number 2\n * math.number('7.2') // returns number 7.2\n * math.number(true) // returns number 1\n * math.number([true, false, true, true]) // returns [1, 0, 1, 1]\n * math.number(math.unit('52cm'), 'm') // returns 0.52\n *\n * See also:\n *\n * bignumber, bigint, boolean, numeric, complex, index, matrix, string, unit\n *\n * @param {string | number | BigNumber | Fraction | boolean | Array | Matrix | Unit | null} [value] Value to be converted\n * @param {Unit | string} [valuelessUnit] A valueless unit, used to convert a unit to a number\n * @return {number | Array | Matrix} The created number\n */\n var number = typed('number', {\n '': function _() {\n return 0;\n },\n number: function number(x) {\n return x;\n },\n string: function string(x) {\n if (x === 'NaN') return NaN;\n var nonDecimalNumberParts = getNonDecimalNumberParts(x);\n if (nonDecimalNumberParts) {\n return makeNumberFromNonDecimalParts(nonDecimalNumberParts);\n }\n var size = 0;\n var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);\n if (wordSizeSuffixMatch) {\n // x includes a size suffix like 0xffffi32, so we extract\n // the suffix and remove it from x\n size = Number(wordSizeSuffixMatch[2]);\n x = wordSizeSuffixMatch[1];\n }\n var num = Number(x);\n if (isNaN(num)) {\n throw new SyntaxError('String \"' + x + '\" is not a valid number');\n }\n if (wordSizeSuffixMatch) {\n // x is a signed bin, oct, or hex literal\n // num is the value of string x if x is interpreted as unsigned\n if (num > 2 ** size - 1) {\n // literal is too large for size suffix\n throw new SyntaxError(\"String \\\"\".concat(x, \"\\\" is out of range\"));\n }\n // check if the bit at index size - 1 is set and if so do the twos complement\n if (num >= 2 ** (size - 1)) {\n num = num - 2 ** size;\n }\n }\n return num;\n },\n BigNumber: function BigNumber(x) {\n return x.toNumber();\n },\n bigint: function bigint(x) {\n return Number(x);\n },\n Fraction: function Fraction(x) {\n return x.valueOf();\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n null: function _null(x) {\n return 0;\n },\n 'Unit, string | Unit': function UnitStringUnit(unit, valuelessUnit) {\n return unit.toNumber(valuelessUnit);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n // reviver function to parse a JSON object like:\n //\n // {\"mathjs\":\"number\",\"value\":\"2.3\"}\n //\n // into a number 2.3\n number.fromJSON = function (json) {\n return parseFloat(json.value);\n };\n return number;\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'bigint';\nvar dependencies = ['typed'];\nexport var createBigint = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a bigint or convert a string, boolean, or unit to a bigint.\n * When value is a matrix, all elements will be converted to bigint.\n *\n * Syntax:\n *\n * math.bigint(value)\n *\n * Examples:\n *\n * math.bigint(2) // returns 2n\n * math.bigint('123') // returns 123n\n * math.bigint(true) // returns 1n\n * math.bigint([true, false, true, true]) // returns [1n, 0n, 1n, 1n]\n *\n * See also:\n *\n * number, bignumber, boolean, complex, index, matrix, string, unit\n *\n * @param {string | number | BigNumber | bigint | Fraction | boolean | Array | Matrix | null} [value] Value to be converted\n * @return {bigint | Array | Matrix} The created bigint\n */\n var bigint = typed('bigint', {\n '': function _() {\n return 0n;\n },\n bigint: function bigint(x) {\n return x;\n },\n number: function number(x) {\n return BigInt(x.toFixed());\n },\n BigNumber: function BigNumber(x) {\n return BigInt(x.round().toString());\n },\n Fraction: function Fraction(x) {\n return BigInt(x.valueOf().toFixed());\n },\n 'string | boolean': function stringBoolean(x) {\n return BigInt(x);\n },\n null: function _null(x) {\n return 0n;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n // reviver function to parse a JSON object like:\n //\n // {\"mathjs\":\"bigint\",\"value\":\"123\"}\n //\n // into a bigint 123n\n bigint.fromJSON = function (json) {\n return BigInt(json.value);\n };\n return bigint;\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nimport { format } from '../utils/number.js';\nvar name = 'string';\nvar dependencies = ['typed'];\nexport var createString = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a string or convert any object into a string.\n * Elements of Arrays and Matrices are processed element wise.\n *\n * Syntax:\n *\n * math.string(value)\n *\n * Examples:\n *\n * math.string(4.2) // returns string '4.2'\n * math.string(math.complex(3, 2) // returns string '3 + 2i'\n *\n * const u = math.unit(5, 'km')\n * math.string(u.to('m')) // returns string '5000 m'\n *\n * math.string([true, false]) // returns ['true', 'false']\n *\n * See also:\n *\n * bignumber, boolean, complex, index, matrix, number, unit\n *\n * @param {* | Array | Matrix | null} [value] A value to convert to a string\n * @return {string | Array | Matrix} The created string\n */\n return typed(name, {\n '': function _() {\n return '';\n },\n number: format,\n null: function _null(x) {\n return 'null';\n },\n boolean: function boolean(x) {\n return x + '';\n },\n string: function string(x) {\n return x;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)),\n any: function any(x) {\n return String(x);\n }\n });\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'boolean';\nvar dependencies = ['typed'];\nexport var createBoolean = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a boolean or convert a string or number to a boolean.\n * In case of a number, `true` is returned for non-zero numbers, and `false` in\n * case of zero.\n * Strings can be `'true'` or `'false'`, or can contain a number.\n * When value is a matrix, all elements will be converted to boolean.\n *\n * Syntax:\n *\n * math.boolean(x)\n *\n * Examples:\n *\n * math.boolean(0) // returns false\n * math.boolean(1) // returns true\n * math.boolean(-3) // returns true\n * math.boolean('true') // returns true\n * math.boolean('false') // returns false\n * math.boolean([1, 0, 1, 1]) // returns [true, false, true, true]\n *\n * See also:\n *\n * bignumber, complex, index, matrix, string, unit\n *\n * @param {string | number | boolean | Array | Matrix | null} value A value of any type\n * @return {boolean | Array | Matrix} The boolean value\n */\n return typed(name, {\n '': function _() {\n return false;\n },\n boolean: function boolean(x) {\n return x;\n },\n number: function number(x) {\n return !!x;\n },\n null: function _null(x) {\n return false;\n },\n BigNumber: function BigNumber(x) {\n return !x.isZero();\n },\n string: function string(x) {\n // try case insensitive\n var lcase = x.toLowerCase();\n if (lcase === 'true') {\n return true;\n } else if (lcase === 'false') {\n return false;\n }\n\n // test whether value is a valid number\n var num = Number(x);\n if (x !== '' && !isNaN(num)) {\n return !!num;\n }\n throw new Error('Cannot convert \"' + x + '\" to a boolean');\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'bignumber';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createBignumber = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber\n } = _ref;\n /**\n * Create a BigNumber, which can store numbers with arbitrary precision.\n * When a matrix is provided, all elements will be converted to BigNumber.\n *\n * Syntax:\n *\n * math.bignumber(x)\n *\n * Examples:\n *\n * 0.1 + 0.2 // returns number 0.30000000000000004\n * math.bignumber(0.1) + math.bignumber(0.2) // returns BigNumber 0.3\n *\n *\n * 7.2e500 // returns number Infinity\n * math.bignumber('7.2e500') // returns BigNumber 7.2e500\n *\n * See also:\n *\n * number, bigint, boolean, complex, index, matrix, string, unit\n *\n * @param {number | string | Fraction | BigNumber | bigint | Array | Matrix | boolean | null} [value] Value for the big number,\n * 0 by default.\n * @returns {BigNumber} The created bignumber\n */\n return typed('bignumber', {\n '': function _() {\n return new BigNumber(0);\n },\n number: function number(x) {\n // convert to string to prevent errors in case of >15 digits\n return new BigNumber(x + '');\n },\n string: function string(x) {\n var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);\n if (wordSizeSuffixMatch) {\n // x has a word size suffix\n var size = wordSizeSuffixMatch[2];\n var n = BigNumber(wordSizeSuffixMatch[1]);\n var twoPowSize = new BigNumber(2).pow(Number(size));\n if (n.gt(twoPowSize.sub(1))) {\n throw new SyntaxError(\"String \\\"\".concat(x, \"\\\" is out of range\"));\n }\n var twoPowSizeSubOne = new BigNumber(2).pow(Number(size) - 1);\n if (n.gte(twoPowSizeSubOne)) {\n return n.sub(twoPowSize);\n } else {\n return n;\n }\n }\n return new BigNumber(x);\n },\n BigNumber: function BigNumber(x) {\n // we assume a BigNumber is immutable\n return x;\n },\n bigint: function bigint(x) {\n return new BigNumber(x.toString());\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n Fraction: function Fraction(x) {\n return new BigNumber(x.n).div(x.d).times(x.s);\n },\n null: function _null(x) {\n return new BigNumber(0);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'complex';\nvar dependencies = ['typed', 'Complex'];\nexport var createComplex = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Complex\n } = _ref;\n /**\n * Create a complex value or convert a value to a complex value.\n *\n * Syntax:\n *\n * math.complex() // creates a complex value with zero\n * // as real and imaginary part.\n * math.complex(re : number, im : string) // creates a complex value with provided\n * // values for real and imaginary part.\n * math.complex(re : number) // creates a complex value with provided\n * // real value and zero imaginary part.\n * math.complex(complex : Complex) // clones the provided complex value.\n * math.complex(arg : string) // parses a string into a complex value.\n * math.complex(array : Array) // converts the elements of the array\n * // or matrix element wise into a\n * // complex value.\n * math.complex({re: number, im: number}) // creates a complex value with provided\n * // values for real an imaginary part.\n * math.complex({r: number, phi: number}) // creates a complex value with provided\n * // polar coordinates\n *\n * Examples:\n *\n * const a = math.complex(3, -4) // a = Complex 3 - 4i\n * a.re = 5 // a = Complex 5 - 4i\n * const i = a.im // Number -4\n * const b = math.complex('2 + 6i') // Complex 2 + 6i\n * const c = math.complex() // Complex 0 + 0i\n * const d = math.add(a, b) // Complex 5 + 2i\n *\n * See also:\n *\n * bignumber, boolean, index, matrix, number, string, unit\n *\n * @param {* | Array | Matrix} [args]\n * Arguments specifying the real and imaginary part of the complex number\n * @return {Complex | Array | Matrix} Returns a complex value\n */\n return typed('complex', {\n '': function _() {\n return Complex.ZERO;\n },\n number: function number(x) {\n return new Complex(x, 0);\n },\n 'number, number': function numberNumber(re, im) {\n return new Complex(re, im);\n },\n // TODO: this signature should be redundant\n 'BigNumber, BigNumber': function BigNumberBigNumber(re, im) {\n return new Complex(re.toNumber(), im.toNumber());\n },\n Fraction: function Fraction(x) {\n return new Complex(x.valueOf(), 0);\n },\n Complex: function Complex(x) {\n return x.clone();\n },\n string: function string(x) {\n return Complex(x); // for example '2 + 3i'\n },\n null: function _null(x) {\n return Complex(0);\n },\n Object: function Object(x) {\n if ('re' in x && 'im' in x) {\n return new Complex(x.re, x.im);\n }\n if ('r' in x && 'phi' in x || 'abs' in x && 'arg' in x) {\n return new Complex(x);\n }\n throw new Error('Expected object with properties (re and im) or (r and phi) or (abs and arg)');\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'fraction';\nvar dependencies = ['typed', 'Fraction'];\nexport var createFraction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Fraction\n } = _ref;\n /**\n * Create a fraction or convert a value to a fraction.\n *\n * With one numeric argument, produces the closest rational approximation to the\n * input.\n * With two arguments, the first is the numerator and the second is the denominator,\n * and creates the corresponding fraction. Both numerator and denominator must be\n * integers.\n * With one object argument, looks for the integer numerator as the value of property\n * 'n' and the integer denominator as the value of property 'd'.\n * With a matrix argument, creates a matrix of the same shape with entries\n * converted into fractions.\n *\n * Syntax:\n * math.fraction(value)\n * math.fraction(numerator, denominator)\n * math.fraction({n: numerator, d: denominator})\n * math.fraction(matrix: Array | Matrix)\n *\n * Examples:\n *\n * math.fraction(6.283) // returns Fraction 6283/1000\n * math.fraction(1, 3) // returns Fraction 1/3\n * math.fraction('2/3') // returns Fraction 2/3\n * math.fraction({n: 2, d: 3}) // returns Fraction 2/3\n * math.fraction([0.2, 0.25, 1.25]) // returns Array [1/5, 1/4, 5/4]\n * math.fraction(4, 5.1) // throws Error: Parameters must be integer\n *\n * See also:\n *\n * bignumber, number, string, unit\n *\n * @param {number | string | Fraction | BigNumber | bigint | Unit | Array | Matrix} [args]\n * Arguments specifying the value, or numerator and denominator of\n * the fraction\n * @return {Fraction | Array | Matrix} Returns a fraction\n */\n return typed('fraction', {\n number: function number(x) {\n if (!isFinite(x) || isNaN(x)) {\n throw new Error(x + ' cannot be represented as a fraction');\n }\n return new Fraction(x);\n },\n string: function string(x) {\n return new Fraction(x);\n },\n 'number, number': function numberNumber(numerator, denominator) {\n return new Fraction(numerator, denominator);\n },\n null: function _null(x) {\n return new Fraction(0);\n },\n BigNumber: function BigNumber(x) {\n return new Fraction(x.toString());\n },\n bigint: function bigint(x) {\n return new Fraction(x.toString());\n },\n Fraction: function Fraction(x) {\n return x; // fractions are immutable\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n Object: function Object(x) {\n return new Fraction(x);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matrix';\nvar dependencies = ['typed', 'Matrix', 'DenseMatrix', 'SparseMatrix'];\nexport var createMatrix = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Matrix,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a Matrix. The function creates a new `math.Matrix` object from\n * an `Array`. A Matrix has utility functions to manipulate the data in the\n * matrix, like getting the size and getting or setting values in the matrix.\n * Supported storage formats are 'dense' and 'sparse'.\n *\n * Syntax:\n *\n * math.matrix() // creates an empty matrix using default storage format (dense).\n * math.matrix(data) // creates a matrix with initial data using default storage format (dense).\n * math.matrix('dense') // creates an empty matrix using the given storage format.\n * math.matrix(data, 'dense') // creates a matrix with initial data using the given storage format.\n * math.matrix(data, 'sparse') // creates a sparse matrix with initial data.\n * math.matrix(data, 'sparse', 'number') // creates a sparse matrix with initial data, number data type.\n *\n * Examples:\n *\n * let m = math.matrix([[1, 2], [3, 4]])\n * m.size() // Array [2, 2]\n * m.resize([3, 2], 5)\n * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]]\n * m.get([1, 0]) // number 3\n *\n * See also:\n *\n * bignumber, boolean, complex, index, number, string, unit, sparse\n *\n * @param {Array | Matrix} [data] A multi dimensional array\n * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'`\n * @param {string} [datatype] Type of the values\n *\n * @return {Matrix} The created matrix\n */\n return typed(name, {\n '': function _() {\n return _create([]);\n },\n string: function string(format) {\n return _create([], format);\n },\n 'string, string': function stringString(format, datatype) {\n return _create([], format, datatype);\n },\n Array: function Array(data) {\n return _create(data);\n },\n Matrix: function Matrix(data) {\n return _create(data, data.storage());\n },\n 'Array | Matrix, string': _create,\n 'Array | Matrix, string, string': _create\n });\n\n /**\n * Create a new Matrix with given storage format\n * @param {Array} data\n * @param {string} [format]\n * @param {string} [datatype]\n * @returns {Matrix} Returns a new Matrix\n * @private\n */\n function _create(data, format, datatype) {\n // get storage format constructor\n if (format === 'dense' || format === 'default' || format === undefined) {\n return new DenseMatrix(data, datatype);\n }\n if (format === 'sparse') {\n return new SparseMatrix(data, datatype);\n }\n throw new TypeError('Unknown matrix type ' + JSON.stringify(format) + '.');\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromFunction';\nvar dependencies = ['typed', 'matrix', 'isZero'];\nexport var createMatrixFromFunction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isZero\n } = _ref;\n /**\n * Create a matrix by evaluating a generating function at each index.\n * The simplest overload returns a multi-dimensional array as long as `size` is an array.\n * Passing `size` as a Matrix or specifying a `format` will result in returning a Matrix.\n *\n * Syntax:\n *\n * math.matrixFromFunction(size, fn)\n * math.matrixFromFunction(size, fn, format)\n * math.matrixFromFunction(size, fn, format, datatype)\n * math.matrixFromFunction(size, format, fn)\n * math.matrixFromFunction(size, format, datatype, fn)\n *\n * Examples:\n *\n * math.matrixFromFunction([3,3], i => i[0] - i[1]) // an antisymmetric matrix\n * math.matrixFromFunction([100, 100], 'sparse', i => i[0] - i[1] === 1 ? 4 : 0) // a sparse subdiagonal matrix\n * math.matrixFromFunction([5], i => math.random()) // a random vector\n *\n * See also:\n *\n * matrix, zeros\n *\n * @param {Array | Matrix} size The size of the matrix to be created\n * @param {function} fn Callback function invoked for every entry in the matrix\n * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'`\n * @param {string} [datatype] Type of the values\n * @return {Array | Matrix} Returns the created matrix\n */\n return typed(name, {\n 'Array | Matrix, function, string, string': function ArrayMatrixFunctionStringString(size, fn, format, datatype) {\n return _create(size, fn, format, datatype);\n },\n 'Array | Matrix, function, string': function ArrayMatrixFunctionString(size, fn, format) {\n return _create(size, fn, format);\n },\n 'Matrix, function': function MatrixFunction(size, fn) {\n return _create(size, fn, 'dense');\n },\n 'Array, function': function ArrayFunction(size, fn) {\n return _create(size, fn, 'dense').toArray();\n },\n 'Array | Matrix, string, function': function ArrayMatrixStringFunction(size, format, fn) {\n return _create(size, fn, format);\n },\n 'Array | Matrix, string, string, function': function ArrayMatrixStringStringFunction(size, format, datatype, fn) {\n return _create(size, fn, format, datatype);\n }\n });\n function _create(size, fn, format, datatype) {\n var m;\n if (datatype !== undefined) {\n m = matrix(format, datatype);\n } else {\n m = matrix(format);\n }\n m.resize(size);\n m.forEach(function (_, index) {\n var val = fn(index);\n if (isZero(val)) return;\n m.set(index, val);\n });\n return m;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromRows';\nvar dependencies = ['typed', 'matrix', 'flatten', 'size'];\nexport var createMatrixFromRows = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n flatten,\n size\n } = _ref;\n /**\n * Create a dense matrix from vectors as individual rows.\n * If you pass column vectors, they will be transposed (but not conjugated!)\n *\n * Syntax:\n *\n * math.matrixFromRows(...arr)\n * math.matrixFromRows(row1, row2)\n * math.matrixFromRows(row1, row2, row3)\n *\n * Examples:\n *\n * math.matrixFromRows([1, 2, 3], [[4],[5],[6]])\n * math.matrixFromRows(...vectors)\n *\n * See also:\n *\n * matrix, matrixFromColumns, matrixFromFunction, zeros\n *\n * @param {... Array | Matrix} rows Multiple rows\n * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned\n */\n return typed(name, {\n '...Array': function Array(arr) {\n return _createArray(arr);\n },\n '...Matrix': function Matrix(arr) {\n return matrix(_createArray(arr.map(m => m.toArray())));\n }\n\n // TODO implement this properly for SparseMatrix\n });\n function _createArray(arr) {\n if (arr.length === 0) throw new TypeError('At least one row is needed to construct a matrix.');\n var N = checkVectorTypeAndReturnLength(arr[0]);\n var result = [];\n for (var row of arr) {\n var rowLength = checkVectorTypeAndReturnLength(row);\n if (rowLength !== N) {\n throw new TypeError('The vectors had different length: ' + (N | 0) + ' \u2260 ' + (rowLength | 0));\n }\n result.push(flatten(row));\n }\n return result;\n }\n function checkVectorTypeAndReturnLength(vec) {\n var s = size(vec);\n if (s.length === 1) {\n // 1D vector\n return s[0];\n } else if (s.length === 2) {\n // 2D vector\n if (s[0] === 1) {\n // row vector\n return s[1];\n } else if (s[1] === 1) {\n // col vector\n return s[0];\n } else {\n throw new TypeError('At least one of the arguments is not a vector.');\n }\n } else {\n throw new TypeError('Only one- or two-dimensional vectors are supported.');\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromColumns';\nvar dependencies = ['typed', 'matrix', 'flatten', 'size'];\nexport var createMatrixFromColumns = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n flatten,\n size\n } = _ref;\n /**\n * Create a dense matrix from vectors as individual columns.\n * If you pass row vectors, they will be transposed (but not conjugated!)\n *\n * Syntax:\n *\n * math.matrixFromColumns(...arr)\n * math.matrixFromColumns(col1, col2)\n * math.matrixFromColumns(col1, col2, col3)\n *\n * Examples:\n *\n * math.matrixFromColumns([1, 2, 3], [[4],[5],[6]])\n * math.matrixFromColumns(...vectors)\n *\n * See also:\n *\n * matrix, matrixFromRows, matrixFromFunction, zeros\n *\n * @param {... Array | Matrix} cols Multiple columns\n * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned\n */\n return typed(name, {\n '...Array': function Array(arr) {\n return _createArray(arr);\n },\n '...Matrix': function Matrix(arr) {\n return matrix(_createArray(arr.map(m => m.toArray())));\n }\n\n // TODO implement this properly for SparseMatrix\n });\n function _createArray(arr) {\n if (arr.length === 0) throw new TypeError('At least one column is needed to construct a matrix.');\n var N = checkVectorTypeAndReturnLength(arr[0]);\n\n // create an array with empty rows\n var result = [];\n for (var i = 0; i < N; i++) {\n result[i] = [];\n }\n\n // loop columns\n for (var col of arr) {\n var colLength = checkVectorTypeAndReturnLength(col);\n if (colLength !== N) {\n throw new TypeError('The vectors had different length: ' + (N | 0) + ' \u2260 ' + (colLength | 0));\n }\n var f = flatten(col);\n\n // push a value to each row\n for (var _i = 0; _i < N; _i++) {\n result[_i].push(f[_i]);\n }\n }\n return result;\n }\n function checkVectorTypeAndReturnLength(vec) {\n var s = size(vec);\n if (s.length === 1) {\n // 1D vector\n return s[0];\n } else if (s.length === 2) {\n // 2D vector\n if (s[0] === 1) {\n // row vector\n return s[1];\n } else if (s[1] === 1) {\n // col vector\n return s[0];\n } else {\n throw new TypeError('At least one of the arguments is not a vector.');\n }\n } else {\n throw new TypeError('Only one- or two-dimensional vectors are supported.');\n }\n }\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'splitUnit';\nvar dependencies = ['typed'];\nexport var createSplitUnit = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Split a unit in an array of units whose sum is equal to the original unit.\n *\n * Syntax:\n *\n * math.splitUnit(unit: Unit, parts: Array.)\n *\n * Example:\n *\n * math.splitUnit(new Unit(1, 'm'), ['feet', 'inch'])\n * // [ 3 feet, 3.3700787401575 inch ]\n *\n * See also:\n *\n * unit\n *\n * @param {Array} [parts] An array of strings or valueless units.\n * @return {Array} An array of units.\n */\n return typed(name, {\n 'Unit, Array': function UnitArray(unit, parts) {\n return unit.splitUnit(parts);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { unaryMinusNumber } from '../../plain/number/index.js';\nvar name = 'unaryMinus';\nvar dependencies = ['typed'];\nexport var createUnaryMinus = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Inverse the sign of a value, apply a unary minus operation.\n *\n * For matrices, the function is evaluated element wise. Boolean values and\n * strings will be converted to a number. For complex numbers, both real and\n * complex value are inverted.\n *\n * Syntax:\n *\n * math.unaryMinus(x)\n *\n * Examples:\n *\n * math.unaryMinus(3.5) // returns -3.5\n * math.unaryMinus(-4.2) // returns 4.2\n *\n * See also:\n *\n * add, subtract, unaryPlus\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Number to be inverted.\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Returns the value with inverted sign.\n */\n return typed(name, {\n number: unaryMinusNumber,\n 'Complex | BigNumber | Fraction': x => x.neg(),\n bigint: x => -x,\n Unit: typed.referToSelf(self => x => {\n var res = x.clone();\n res.value = typed.find(self, res.valueType())(x.value);\n return res;\n }),\n // deep map collection, skip zeros since unaryMinus(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true))\n\n // TODO: add support for string\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { unaryPlusNumber } from '../../plain/number/index.js';\nimport { safeNumberType } from '../../utils/number.js';\nvar name = 'unaryPlus';\nvar dependencies = ['typed', 'config', 'numeric'];\nexport var createUnaryPlus = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric\n } = _ref;\n /**\n * Unary plus operation.\n * Boolean values and strings will be converted to a number, numeric values will be returned as is.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.unaryPlus(x)\n *\n * Examples:\n *\n * math.unaryPlus(3.5) // returns 3.5\n * math.unaryPlus(1) // returns 1\n *\n * See also:\n *\n * unaryMinus, add, subtract\n *\n * @param {number | BigNumber | bigint | Fraction | string | Complex | Unit | Array | Matrix} x\n * Input value\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix}\n * Returns the input value when numeric, converts to a number when input is non-numeric.\n */\n return typed(name, {\n number: unaryPlusNumber,\n Complex: function Complex(x) {\n return x; // complex numbers are immutable\n },\n BigNumber: function BigNumber(x) {\n return x; // bignumbers are immutable\n },\n bigint: function bigint(x) {\n return x;\n },\n Fraction: function Fraction(x) {\n return x; // fractions are immutable\n },\n Unit: function Unit(x) {\n return x.clone();\n },\n // deep map collection, skip zeros since unaryPlus(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)),\n boolean: function boolean(x) {\n return numeric(x ? 1 : 0, config.number);\n },\n string: function string(x) {\n return numeric(x, safeNumberType(x, config));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { absNumber } from '../../plain/number/index.js';\nvar name = 'abs';\nvar dependencies = ['typed'];\nexport var createAbs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the absolute value of a number. For matrices, the function is\n * evaluated element wise.\n *\n * Syntax:\n *\n * math.abs(x)\n *\n * Examples:\n *\n * math.abs(3.5) // returns number 3.5\n * math.abs(-4.2) // returns number 4.2\n *\n * math.abs([3, -5, -1, 0, 2]) // returns Array [3, 5, 1, 0, 2]\n *\n * See also:\n *\n * sign\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x\n * A number or matrix for which to get the absolute value\n * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit}\n * Absolute value of `x`\n */\n return typed(name, {\n number: absNumber,\n 'Complex | BigNumber | Fraction | Unit': x => x.abs(),\n bigint: x => x < 0n ? -x : x,\n // deep map collection, skip zeros since abs(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { arraySize } from '../../utils/array.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { IndexError } from '../../error/IndexError.js';\nvar name = 'apply';\nvar dependencies = ['typed', 'isInteger'];\nexport var createApply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n /**\n * Apply a function that maps an array to a scalar\n * along a given axis of a matrix or array.\n * Returns a new matrix or array with one less dimension than the input.\n *\n * Syntax:\n *\n * math.apply(A, dim, callback)\n *\n * Where:\n *\n * - `dim: number` is a zero-based dimension over which to concatenate the matrices.\n *\n * Examples:\n *\n * const A = [[1, 2], [3, 4]]\n * const sum = math.sum\n *\n * math.apply(A, 0, sum) // returns [4, 6]\n * math.apply(A, 1, sum) // returns [3, 7]\n *\n * See also:\n *\n * map, filter, forEach\n *\n * @param {Array | Matrix} array The input Matrix\n * @param {number} dim The dimension along which the callback is applied\n * @param {Function} callback The callback function that is applied. This Function\n * should take an array or 1-d matrix as an input and\n * return a number.\n * @return {Array | Matrix} res The residual matrix with the function applied over some dimension.\n */\n return typed(name, {\n 'Array | Matrix, number | BigNumber, function': function ArrayMatrixNumberBigNumberFunction(mat, dim, callback) {\n if (!isInteger(dim)) {\n throw new TypeError('Integer number expected for dimension');\n }\n var size = Array.isArray(mat) ? arraySize(mat) : mat.size();\n if (dim < 0 || dim >= size.length) {\n throw new IndexError(dim, size.length);\n }\n if (isMatrix(mat)) {\n return mat.create(_apply(mat.valueOf(), dim, callback));\n } else {\n return _apply(mat, dim, callback);\n }\n }\n });\n});\n\n/**\n * Recursively reduce a matrix\n * @param {Array} mat\n * @param {number} dim\n * @param {Function} callback\n * @returns {Array} ret\n * @private\n */\nfunction _apply(mat, dim, callback) {\n var i, ret, tran;\n if (dim <= 0) {\n if (!Array.isArray(mat[0])) {\n return callback(mat);\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _apply(tran[i], dim - 1, callback);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _apply(mat[i], dim - 1, callback);\n }\n return ret;\n }\n}\n\n/**\n * Transpose a matrix\n * @param {Array} mat\n * @returns {Array} ret\n * @private\n */\nfunction _switch(mat) {\n var I = mat.length;\n var J = mat[0].length;\n var i, j;\n var ret = [];\n for (j = 0; j < J; j++) {\n var tmp = [];\n for (i = 0; i < I; i++) {\n tmp.push(mat[i][j]);\n }\n ret.push(tmp);\n }\n return ret;\n}", "import { factory } from '../../utils/factory.js';\nimport { addNumber } from '../../plain/number/index.js';\nvar name = 'addScalar';\nvar dependencies = ['typed'];\nexport var createAddScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Add two scalar values, `x + y`.\n * This function is meant for internal use: it is used by the public function\n * `add`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to add\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to add\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Sum of `x` and `y`\n * @private\n */\n return typed(name, {\n 'number, number': addNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.add(y);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.plus(y);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x + y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return x.add(y);\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (x.value === null || x.value === undefined) {\n throw new Error('Parameter x contains a unit with undefined value');\n }\n if (y.value === null || y.value === undefined) {\n throw new Error('Parameter y contains a unit with undefined value');\n }\n if (!x.equalBase(y)) throw new Error('Units do not match');\n var res = x.clone();\n res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value);\n res.fixPrefix = false;\n return res;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { subtractNumber } from '../../plain/number/index.js';\nvar name = 'subtractScalar';\nvar dependencies = ['typed'];\nexport var createSubtractScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Subtract two scalar values, `x - y`.\n * This function is meant for internal use: it is used by the public function\n * `subtract`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to be subtracted from `x`\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Difference of `x` and `y`\n * @private\n */\n return typed(name, {\n 'number, number': subtractNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.sub(y);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.minus(y);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x - y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return x.sub(y);\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (x.value === null || x.value === undefined) {\n throw new Error('Parameter x contains a unit with undefined value');\n }\n if (y.value === null || y.value === undefined) {\n throw new Error('Parameter y contains a unit with undefined value');\n }\n if (!x.equalBase(y)) throw new Error('Units do not match');\n var res = x.clone();\n res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value);\n res.fixPrefix = false;\n return res;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isBigNumber, isComplex, isFraction } from '../../utils/is.js';\nimport { cbrtNumber } from '../../plain/number/index.js';\nvar name = 'cbrt';\nvar dependencies = ['config', 'typed', 'isNegative', 'unaryMinus', 'matrix', 'Complex', 'BigNumber', 'Fraction'];\nexport var createCbrt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n isNegative,\n unaryMinus,\n matrix,\n Complex,\n BigNumber,\n Fraction\n } = _ref;\n /**\n * Calculate the cubic root of a value.\n *\n * To avoid confusion with the matrix cube root, this function does not\n * apply to matrices. For a matrix, to take the cube root elementwise,\n * see the examples.\n *\n * Syntax:\n *\n * math.cbrt(x)\n * math.cbrt(x, allRoots)\n *\n * Examples:\n *\n * math.cbrt(27) // returns 3\n * math.cube(3) // returns 27\n * math.cbrt(-64) // returns -4\n * math.cbrt(math.unit('27 m^3')) // returns Unit 3 m\n * math.map([27, 64, 125], x => math.cbrt(x)) // returns [3, 4, 5]\n *\n * const x = math.complex('8i')\n * math.cbrt(x) // returns Complex 1.7320508075689 + i\n * math.cbrt(x, true) // returns Matrix [\n * // 1.7320508075689 + i\n * // -1.7320508075689 + i\n * // -2i\n * // ]\n *\n * See also:\n *\n * square, sqrt, cube\n *\n * @param {number | BigNumber | Complex | Unit} x\n * Value for which to calculate the cubic root.\n * @param {boolean} [allRoots] Optional, false by default. Only applicable\n * when `x` is a number or complex number. If true, all complex\n * roots are returned, if false (default) the principal root is\n * returned.\n * @return {number | BigNumber | Complex | Unit}\n * Returns the cubic root of `x`\n */\n return typed(name, {\n number: cbrtNumber,\n // note: signature 'number, boolean' is also supported,\n // created by typed as it knows how to convert number to Complex\n\n Complex: _cbrtComplex,\n 'Complex, boolean': _cbrtComplex,\n BigNumber: function BigNumber(x) {\n return x.cbrt();\n },\n Unit: _cbrtUnit\n });\n\n /**\n * Calculate the cubic root for a complex number\n * @param {Complex} x\n * @param {boolean} [allRoots] If true, the function will return an array\n * with all three roots. If false or undefined,\n * the principal root is returned.\n * @returns {Complex | Array. | Matrix.} Returns the cubic root(s) of x\n * @private\n */\n function _cbrtComplex(x, allRoots) {\n // https://www.wikiwand.com/en/Cube_root#/Complex_numbers\n\n var arg3 = x.arg() / 3;\n var abs = x.abs();\n\n // principal root:\n var principal = new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3).exp());\n if (allRoots) {\n var all = [principal, new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 + Math.PI * 2 / 3).exp()), new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 - Math.PI * 2 / 3).exp())];\n return config.matrix === 'Array' ? all : matrix(all);\n } else {\n return principal;\n }\n }\n\n /**\n * Calculate the cubic root for a Unit\n * @param {Unit} x\n * @return {Unit} Returns the cubic root of x\n * @private\n */\n function _cbrtUnit(x) {\n if (x.value && isComplex(x.value)) {\n var result = x.clone();\n result.value = 1.0;\n result = result.pow(1.0 / 3); // Compute the units\n result.value = _cbrtComplex(x.value); // Compute the value\n return result;\n } else {\n var negate = isNegative(x.value);\n if (negate) {\n x.value = unaryMinus(x.value);\n }\n\n // TODO: create a helper function for this\n var third;\n if (isBigNumber(x.value)) {\n third = new BigNumber(1).div(3);\n } else if (isFraction(x.value)) {\n third = new Fraction(1, 3);\n } else {\n third = 1 / 3;\n }\n var _result = x.pow(third);\n if (negate) {\n _result.value = unaryMinus(_result.value);\n }\n return _result;\n }\n }\n});", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'ceil';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createCeilNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => {\n var {\n typed,\n config,\n round\n } = _ref;\n return typed(name, {\n number: function number(x) {\n if (nearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return Math.ceil(x);\n }\n },\n 'number, number': function numberNumber(x, n) {\n if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n var [number, exponent] = \"\".concat(x, \"e\").split('e');\n var result = Math.ceil(Number(\"\".concat(number, \"e\").concat(Number(exponent) + n)));\n [number, exponent] = \"\".concat(result, \"e\").split('e');\n return Number(\"\".concat(number, \"e\").concat(Number(exponent) - n));\n }\n }\n });\n});\nexport var createCeil = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var ceilNumber = createCeilNumber({\n typed,\n config,\n round\n });\n /**\n * Round a value towards plus infinity\n * If `x` is complex, both real and imaginary part are rounded towards plus infinity.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.ceil(x)\n * math.ceil(x, n)\n *\n * Examples:\n *\n * math.ceil(3.2) // returns number 4\n * math.ceil(3.8) // returns number 4\n * math.ceil(-4.2) // returns number -4\n * math.ceil(-4.7) // returns number -4\n *\n * math.ceil(3.212, 2) // returns number 3.22\n * math.ceil(3.288, 2) // returns number 3.29\n * math.ceil(-4.212, 2) // returns number -4.21\n * math.ceil(-4.782, 2) // returns number -4.78\n *\n * const c = math.complex(3.24, -2.71)\n * math.ceil(c) // returns Complex 4 - 2i\n * math.ceil(c, 1) // returns Complex 3.3 - 2.7i\n *\n * math.ceil([3.2, 3.8, -4.7]) // returns Array [4, 4, -4]\n * math.ceil([3.21, 3.82, -4.71], 1) // returns Array [3.3, 3.9, -4.7]\n *\n * See also:\n *\n * floor, fix, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('ceil', {\n number: ceilNumber.signatures.number,\n 'number,number': ceilNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return x.ceil();\n },\n 'Complex, number': function ComplexNumber(x, n) {\n return x.ceil(n);\n },\n 'Complex, BigNumber': function ComplexBigNumber(x, n) {\n return x.ceil(n.toNumber());\n },\n BigNumber: function BigNumber(x) {\n if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return x.ceil();\n }\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, n) {\n if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_CEIL);\n }\n },\n Fraction: function Fraction(x) {\n return x.ceil();\n },\n 'Fraction, number': function FractionNumber(x, n) {\n return x.ceil(n);\n },\n 'Fraction, BigNumber': function FractionBigNumber(x, n) {\n return x.ceil(n.toNumber());\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo11xS0s';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo11xS0s = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked NZ times (number of nonzero items in S).\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo11xS0s(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // initialize ptr\n cptr[j] = cindex.length;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = aindex[k];\n // invoke callback\n var v = inverse ? cf(b, avalues[k]) : cf(avalues[k], b);\n // check value is zero\n if (!eq(v, zero)) {\n // push index & value\n cindex.push(i);\n cvalues.push(v);\n }\n }\n }\n // update ptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return s.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo12xSfs';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo12xSfs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked MxN times.\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 f(0, b) ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo12xSfs(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cdata = [];\n\n // workspaces\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var r = aindex[k];\n // update workspace\n x[r] = avalues[k];\n w[r] = mark;\n }\n // loop rows\n for (var i = 0; i < rows; i++) {\n // initialize C on first column\n if (j === 0) {\n // create row array\n cdata[i] = [];\n }\n // check sparse matrix has a value @ i,j\n if (w[i] === mark) {\n // invoke callback, update C\n cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b);\n } else {\n // dense matrix value @ i, j\n cdata[i][j] = inverse ? cf(b, 0) : cf(0, b);\n }\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { clone } from '../../../utils/object.js';\nvar name = 'matAlgo14xDs';\nvar dependencies = ['typed'];\nexport var createMatAlgo14xDs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, b).\n * Callback function invoked MxN times.\n *\n * C(i,j,...z) = f(Aij..z, b)\n *\n * @param {Matrix} a The DenseMatrix instance (A)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij..z,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Aij..z)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97659042\n */\n return function matAlgo14xDs(a, b, callback, inverse) {\n // a arrays\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype;\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // populate cdata, iterate through dimensions\n var cdata = asize.length > 0 ? _iterate(cf, 0, asize, asize[0], adata, b, inverse) : [];\n\n // c matrix\n return a.createDenseMatrix({\n data: cdata,\n size: clone(asize),\n datatype: dt\n });\n };\n\n // recursive function\n function _iterate(f, level, s, n, av, bv, inverse) {\n // initialize array for this level\n var cv = [];\n // check we reach the last level\n if (level === s.length - 1) {\n // loop arrays in last level\n for (var i = 0; i < n; i++) {\n // invoke callback and store value\n cv[i] = inverse ? f(bv, av[i]) : f(av[i], bv);\n }\n } else {\n // iterate current level\n for (var j = 0; j < n; j++) {\n // iterate next level\n cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv, inverse);\n }\n }\n return cv;\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { cubeNumber } from '../../plain/number/index.js';\nvar name = 'cube';\nvar dependencies = ['typed'];\nexport var createCube = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the cube of a value, `x * x * x`.\n * To avoid confusion with `pow(M,3)`, this function does not apply to matrices.\n * If you wish to cube every entry of a matrix, see the examples.\n *\n * Syntax:\n *\n * math.cube(x)\n *\n * Examples:\n *\n * math.cube(2) // returns number 8\n * math.pow(2, 3) // returns number 8\n * math.cube(4) // returns number 64\n * 4 * 4 * 4 // returns number 64\n *\n * math.map([1, 2, 3, 4], math.cube) // returns Array [1, 8, 27, 64]\n *\n * See also:\n *\n * multiply, square, pow, cbrt\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Number for which to calculate the cube\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Cube of x\n */\n return typed(name, {\n number: cubeNumber,\n Complex: function Complex(x) {\n return x.mul(x).mul(x); // Is faster than pow(x, 3)\n },\n BigNumber: function BigNumber(x) {\n return x.times(x).times(x);\n },\n bigint: function bigint(x) {\n return x * x * x;\n },\n Fraction: function Fraction(x) {\n return x.pow(3); // Is faster than mul()mul()mul()\n },\n Unit: function Unit(x) {\n return x.pow(3);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { expNumber } from '../../plain/number/index.js';\nvar name = 'exp';\nvar dependencies = ['typed'];\nexport var createExp = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the exponential of a value.\n * For matrices, if you want the matrix exponential of square matrix, use\n * the `expm` function; if you want to take the exponential of each element,\n * see the examples.\n *\n * Syntax:\n *\n * math.exp(x)\n *\n * Examples:\n *\n * math.exp(2) // returns number 7.3890560989306495\n * math.pow(math.e, 2) // returns number 7.3890560989306495\n * math.log(math.exp(2)) // returns number 2\n *\n * math.map([1, 2, 3], math.exp)\n * // returns Array [\n * // 2.718281828459045,\n * // 7.3890560989306495,\n * // 20.085536923187668\n * // ]\n *\n * See also:\n *\n * expm1, expm, log, pow\n *\n * @param {number | BigNumber | Complex} x A number to exponentiate\n * @return {number | BigNumber | Complex} Exponential of `x`\n */\n return typed(name, {\n number: expNumber,\n Complex: function Complex(x) {\n return x.exp();\n },\n BigNumber: function BigNumber(x) {\n return x.exp();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { expm1Number } from '../../plain/number/index.js';\nvar name = 'expm1';\nvar dependencies = ['typed', 'Complex'];\nexport var createExpm1 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Complex: _Complex\n } = _ref;\n /**\n * Calculate the value of subtracting 1 from the exponential value.\n * This function is more accurate than `math.exp(x)-1` when `x` is near 0\n * To avoid ambiguity with the matrix exponential `expm`, this function\n * does not operate on matrices; if you wish to apply it elementwise, see\n * the examples.\n *\n * Syntax:\n *\n * math.expm1(x)\n *\n * Examples:\n *\n * math.expm1(2) // returns number 6.38905609893065\n * math.pow(math.e, 2) - 1 // returns number 6.3890560989306495\n * math.expm1(1e-8) // returns number 1.0000000050000001e-8\n * math.exp(1e-8) - 1 // returns number 9.9999999392253e-9\n * math.log(math.expm1(2) + 1) // returns number 2\n *\n * math.map([1, 2, 3], math.expm1)\n * // returns Array [\n * // 1.718281828459045,\n * // 6.3890560989306495,\n * // 19.085536923187668\n * // ]\n *\n * See also:\n *\n * exp, expm, log, pow\n *\n * @param {number | BigNumber | Complex} x The number to exponentiate\n * @return {number | BigNumber | Complex} Exponential of `x`, minus one\n */\n return typed(name, {\n number: expm1Number,\n Complex: function Complex(x) {\n var r = Math.exp(x.re);\n return new _Complex(r * Math.cos(x.im) - 1, r * Math.sin(x.im));\n },\n BigNumber: function BigNumber(x) {\n return x.exp().minus(1);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'fix';\nvar dependencies = ['typed', 'Complex', 'matrix', 'ceil', 'floor', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createFixNumber = /* #__PURE__ */factory(name, ['typed', 'ceil', 'floor'], _ref => {\n var {\n typed,\n ceil,\n floor\n } = _ref;\n return typed(name, {\n number: function number(x) {\n return x > 0 ? floor(x) : ceil(x);\n },\n 'number, number': function numberNumber(x, n) {\n return x > 0 ? floor(x, n) : ceil(x, n);\n }\n });\n});\nexport var createFix = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n Complex: _Complex,\n matrix,\n ceil,\n floor,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var fixNumber = createFixNumber({\n typed,\n ceil,\n floor\n });\n /**\n * Round a value towards zero.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.fix(x)\n * math.fix(x,n)\n *\n * Examples:\n *\n * math.fix(3.2) // returns number 3\n * math.fix(3.8) // returns number 3\n * math.fix(-4.2) // returns number -4\n * math.fix(-4.7) // returns number -4\n *\n * math.fix(3.12, 1) // returns number 3.1\n * math.fix(3.18, 1) // returns number 3.1\n * math.fix(-4.12, 1) // returns number -4.1\n * math.fix(-4.17, 1) // returns number -4.1\n *\n * const c = math.complex(3.22, -2.78)\n * math.fix(c) // returns Complex 3 - 2i\n * math.fix(c, 1) // returns Complex 3.2 -2.7i\n *\n * math.fix([3.2, 3.8, -4.7]) // returns Array [3, 3, -4]\n * math.fix([3.2, 3.8, -4.7], 1) // returns Array [3.2, 3.8, -4.7]\n *\n * See also:\n *\n * ceil, floor, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('fix', {\n number: fixNumber.signatures.number,\n 'number, number | BigNumber': fixNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return new _Complex(x.re > 0 ? Math.floor(x.re) : Math.ceil(x.re), x.im > 0 ? Math.floor(x.im) : Math.ceil(x.im));\n },\n 'Complex, number': function ComplexNumber(x, n) {\n return new _Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n));\n },\n 'Complex, BigNumber': function ComplexBigNumber(x, bn) {\n var n = bn.toNumber();\n return new _Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n));\n },\n BigNumber: function BigNumber(x) {\n return x.isNegative() ? ceil(x) : floor(x);\n },\n 'BigNumber, number | BigNumber': function BigNumberNumberBigNumber(x, n) {\n return x.isNegative() ? ceil(x, n) : floor(x, n);\n },\n Fraction: function Fraction(x) {\n return x.s < 0 ? x.ceil() : x.floor();\n },\n 'Fraction, number | BigNumber': function FractionNumberBigNumber(x, n) {\n return x.s < 0 ? ceil(x, n) : floor(x, n);\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since fix(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array | Matrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since fix(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'floor';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createFloorNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => {\n var {\n typed,\n config,\n round\n } = _ref;\n return typed(name, {\n number: function number(x) {\n if (nearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return Math.floor(x);\n }\n },\n 'number, number': function numberNumber(x, n) {\n if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n var [number, exponent] = \"\".concat(x, \"e\").split('e');\n var result = Math.floor(Number(\"\".concat(number, \"e\").concat(Number(exponent) + n)));\n [number, exponent] = \"\".concat(result, \"e\").split('e');\n return Number(\"\".concat(number, \"e\").concat(Number(exponent) - n));\n }\n }\n });\n});\nexport var createFloor = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var floorNumber = createFloorNumber({\n typed,\n config,\n round\n });\n /**\n * Round a value towards minus infinity.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.floor(x)\n * math.floor(x, n)\n *\n * Examples:\n *\n * math.floor(3.2) // returns number 3\n * math.floor(3.8) // returns number 3\n * math.floor(-4.2) // returns number -5\n * math.floor(-4.7) // returns number -5\n *\n * math.floor(3.212, 2) // returns number 3.21\n * math.floor(3.288, 2) // returns number 3.28\n * math.floor(-4.212, 2) // returns number -4.22\n * math.floor(-4.782, 2) // returns number -4.79\n *\n * const c = math.complex(3.24, -2.71)\n * math.floor(c) // returns Complex 3 - 3i\n * math.floor(c, 1) // returns Complex 3.2 -2.8i\n *\n * math.floor([3.2, 3.8, -4.7]) // returns Array [3, 3, -5]\n * math.floor([3.21, 3.82, -4.71], 1) // returns Array [3.2, 3.8, -4.8]\n *\n * math.floor(math.tau, [2, 3]) // returns Array [6.28, 6.283]\n *\n * // Note that floor(array, array) currently not implemented.\n *\n * See also:\n *\n * ceil, fix, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('floor', {\n number: floorNumber.signatures.number,\n 'number,number': floorNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return x.floor();\n },\n 'Complex, number': function ComplexNumber(x, n) {\n return x.floor(n);\n },\n 'Complex, BigNumber': function ComplexBigNumber(x, n) {\n return x.floor(n.toNumber());\n },\n BigNumber: function BigNumber(x) {\n if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return x.floor();\n }\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, n) {\n if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_FLOOR);\n }\n },\n Fraction: function Fraction(x) {\n return x.floor();\n },\n 'Fraction, number': function FractionNumber(x, n) {\n return x.floor(n);\n },\n 'Fraction, BigNumber': function FractionBigNumber(x, n) {\n return x.floor(n.toNumber());\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since floor(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMod } from './mod.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nvar name = 'gcd';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix', 'concat'];\nvar gcdTypes = 'number | BigNumber | Fraction | Matrix | Array';\nvar gcdManyTypesSignature = \"\".concat(gcdTypes, \", \").concat(gcdTypes, \", ...\").concat(gcdTypes);\nfunction is1d(array) {\n return !array.some(element => Array.isArray(element));\n}\nexport var createGcd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n config,\n round,\n equalScalar,\n zeros,\n BigNumber,\n DenseMatrix,\n concat\n } = _ref;\n var mod = createMod({\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n });\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the greatest common divisor for two or more values or arrays.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.gcd(a, b)\n * math.gcd(a, b, c, ...)\n *\n * Examples:\n *\n * math.gcd(8, 12) // returns 4\n * math.gcd(-4, 6) // returns 2\n * math.gcd(25, 15, -10) // returns 5\n *\n * math.gcd([8, -4], [12, 6]) // returns [4, 2]\n *\n * See also:\n *\n * lcm, xgcd\n *\n * @param {... number | BigNumber | Fraction | Array | Matrix} args Two or more integer numbers\n * @return {number | BigNumber | Fraction | Array | Matrix} The greatest common divisor\n */\n return typed(name, {\n 'number, number': _gcdNumber,\n 'BigNumber, BigNumber': _gcdBigNumber,\n 'Fraction, Fraction': (x, y) => x.gcd(y)\n }, matrixAlgorithmSuite({\n SS: matAlgo04xSidSid,\n DS: matAlgo01xDSid,\n Ss: matAlgo10xSids\n }), {\n [gcdManyTypesSignature]: typed.referToSelf(self => (a, b, args) => {\n var res = self(a, b);\n for (var i = 0; i < args.length; i++) {\n res = self(res, args[i]);\n }\n return res;\n }),\n Array: typed.referToSelf(self => array => {\n if (array.length === 1 && Array.isArray(array[0]) && is1d(array[0])) {\n return self(...array[0]);\n }\n if (is1d(array)) {\n return self(...array);\n }\n throw new ArgumentsError('gcd() supports only 1d matrices!');\n }),\n Matrix: typed.referToSelf(self => matrix => {\n return self(matrix.toArray());\n })\n });\n\n /**\n * Calculate gcd for numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the greatest common denominator of a and b\n * @private\n */\n function _gcdNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var r;\n while (b !== 0) {\n r = mod(a, b);\n a = b;\n b = r;\n }\n return a < 0 ? -a : a;\n }\n\n /**\n * Calculate gcd for BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @returns {BigNumber} Returns greatest common denominator of a and b\n * @private\n */\n function _gcdBigNumber(a, b) {\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var zero = new BigNumber(0);\n while (!b.isZero()) {\n var r = mod(a, b);\n a = b;\n b = r;\n }\n return a.lt(zero) ? a.neg() : a;\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { createFloor } from './floor.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'mod';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createMod = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var floor = createFloor({\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculates the modulus, the remainder of an integer division.\n *\n * For matrices, the function is evaluated element wise.\n *\n * The modulus is defined as:\n *\n * x - y * floor(x / y)\n *\n * See https://en.wikipedia.org/wiki/Modulo_operation.\n *\n * Syntax:\n *\n * math.mod(x, y)\n *\n * Examples:\n *\n * math.mod(8, 3) // returns 2\n * math.mod(11, 2) // returns 1\n *\n * function isOdd(x) {\n * return math.mod(x, 2) != 0\n * }\n *\n * isOdd(2) // returns false\n * isOdd(3) // returns true\n *\n * See also:\n *\n * divide\n *\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Dividend\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} y Divisor\n * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the remainder of `x` divided by `y`.\n */\n return typed(name, {\n 'number, number': _modNumber,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return y.isZero() ? x : x.sub(y.mul(floor(x.div(y))));\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n if (y === 0n) {\n return x;\n }\n if (x < 0) {\n var m = x % y;\n return m === 0n ? m : m + y;\n }\n return x % y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return y.equals(0) ? x : x.sub(y.mul(floor(x.div(y))));\n }\n }, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n\n /**\n * Calculate the modulus of two numbers\n * @param {number} x\n * @param {number} y\n * @returns {number} res\n * @private\n */\n function _modNumber(x, y) {\n // We don't use JavaScript's % operator here as this doesn't work\n // correctly for x < 0 and x === 0\n // see https://en.wikipedia.org/wiki/Modulo_operation\n\n // We use mathjs floor to handle errors associated with\n // precision float approximation\n return y === 0 ? x : x - y * floor(x / y);\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo02xDS0';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo02xDS0 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij).\n * Callback function invoked NNZ times (number of nonzero items in SparseMatrix).\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (S)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function matAlgo02xDS0(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result (SparseMatrix)\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // loop columns in b\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = bindex[k];\n // update C(i,j)\n var cij = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n // check for nonzero\n if (!eq(cij, zero)) {\n // push i & v\n cindex.push(i);\n cvalues.push(cij);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return sparseMatrix.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo03xDSf';\nvar dependencies = ['typed'];\nexport var createMatAlgo03xDSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over SparseMatrix items and invokes the callback function f(Dij, Sij).\n * Callback function invoked M*N times.\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 f(Dij, 0) ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (C)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function matAlgo03xDSf(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result (DenseMatrix)\n var cdata = [];\n\n // initialize dense matrix\n for (var z = 0; z < rows; z++) {\n // initialize row\n cdata[z] = [];\n }\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns in b\n for (var j = 0; j < columns; j++) {\n // column mark\n var mark = j + 1;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = bindex[k];\n // update workspace\n x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n w[i] = mark;\n }\n // process workspace\n for (var y = 0; y < rows; y++) {\n // check we have a calculated value for current row\n if (w[y] === mark) {\n // use calculated value\n cdata[y][j] = x[y];\n } else {\n // calculate value\n cdata[y][j] = inverse ? cf(zero, adata[y][j]) : cf(adata[y][j], zero);\n }\n }\n }\n\n // return dense matrix\n return denseMatrix.createDenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo05xSfSf';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo05xSfSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 || B(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo05xSfSf(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var xa = cvalues ? [] : undefined;\n var xb = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // vars\n var i, j, k, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop values A(:,j)\n for (k = aptr[j], k1 = aptr[j + 1]; k < k1; k++) {\n // row\n i = aindex[k];\n // push index\n cindex.push(i);\n // update workspace\n wa[i] = mark;\n // check we need to process values\n if (xa) {\n xa[i] = avalues[k];\n }\n }\n // loop values B(:,j)\n for (k = bptr[j], k1 = bptr[j + 1]; k < k1; k++) {\n // row\n i = bindex[k];\n // check row existed in A\n if (wa[i] !== mark) {\n // push index\n cindex.push(i);\n }\n // update workspace\n wb[i] = mark;\n // check we need to process values\n if (xb) {\n xb[i] = bvalues[k];\n }\n }\n // check we need to process values (non pattern matrix)\n if (cvalues) {\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // marks\n var wai = wa[i];\n var wbi = wb[i];\n // check Aij or Bij are nonzero\n if (wai === mark || wbi === mark) {\n // matrix values @ i,j\n var va = wai === mark ? xa[i] : zero;\n var vb = wbi === mark ? xb[i] : zero;\n // Cij\n var vc = cf(va, vb);\n // check for zero\n if (!eq(vc, zero)) {\n // push value\n cvalues.push(vc);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { extend } from '../../../utils/object.js';\nimport { createMatAlgo13xDD } from './matAlgo13xDD.js';\nimport { createMatAlgo14xDs } from './matAlgo14xDs.js';\nimport { createBroadcast } from './broadcast.js';\nvar name = 'matrixAlgorithmSuite';\nvar dependencies = ['typed', 'matrix', 'concat'];\nexport var createMatrixAlgorithmSuite = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n concat\n } = _ref;\n var matAlgo13xDD = createMatAlgo13xDD({\n typed\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var broadcast = createBroadcast({\n concat\n });\n\n /**\n * Return a signatures object with the usual boilerplate of\n * matrix algorithms, based on a plain options object with the\n * following properties:\n * elop: function -- the elementwise operation to use, defaults to self\n * SS: function -- the algorithm to apply for two sparse matrices\n * DS: function -- the algorithm to apply for a dense and a sparse matrix\n * SD: function -- algo for a sparse and a dense; defaults to SD flipped\n * Ss: function -- the algorithm to apply for a sparse matrix and scalar\n * sS: function -- algo for scalar and sparse; defaults to Ss flipped\n * scalar: string -- typed-function type for scalars, defaults to 'any'\n *\n * If Ss is not specified, no matrix-scalar signatures are generated.\n *\n * @param {object} options\n * @return {Object} signatures\n */\n return function matrixAlgorithmSuite(options) {\n var elop = options.elop;\n var SD = options.SD || options.DS;\n var matrixSignatures;\n if (elop) {\n // First the dense ones\n matrixSignatures = {\n 'DenseMatrix, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(x, y), elop),\n 'Array, Array': (x, y) => matAlgo13xDD(...broadcast(matrix(x), matrix(y)), elop).valueOf(),\n 'Array, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(matrix(x), y), elop),\n 'DenseMatrix, Array': (x, y) => matAlgo13xDD(...broadcast(x, matrix(y)), elop)\n };\n // Now incorporate sparse matrices\n if (options.SS) {\n matrixSignatures['SparseMatrix, SparseMatrix'] = (x, y) => options.SS(...broadcast(x, y), elop, false);\n }\n if (options.DS) {\n matrixSignatures['DenseMatrix, SparseMatrix'] = (x, y) => options.DS(...broadcast(x, y), elop, false);\n matrixSignatures['Array, SparseMatrix'] = (x, y) => options.DS(...broadcast(matrix(x), y), elop, false);\n }\n if (SD) {\n matrixSignatures['SparseMatrix, DenseMatrix'] = (x, y) => SD(...broadcast(y, x), elop, true);\n matrixSignatures['SparseMatrix, Array'] = (x, y) => SD(...broadcast(matrix(y), x), elop, true);\n }\n } else {\n // No elop, use this\n // First the dense ones\n matrixSignatures = {\n 'DenseMatrix, DenseMatrix': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(x, y), self);\n }),\n 'Array, Array': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(matrix(x), matrix(y)), self).valueOf();\n }),\n 'Array, DenseMatrix': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(matrix(x), y), self);\n }),\n 'DenseMatrix, Array': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(x, matrix(y)), self);\n })\n };\n // Now incorporate sparse matrices\n if (options.SS) {\n matrixSignatures['SparseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.SS(...broadcast(x, y), self, false);\n });\n }\n if (options.DS) {\n matrixSignatures['DenseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.DS(...broadcast(x, y), self, false);\n });\n matrixSignatures['Array, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.DS(...broadcast(matrix(x), y), self, false);\n });\n }\n if (SD) {\n matrixSignatures['SparseMatrix, DenseMatrix'] = typed.referToSelf(self => (x, y) => {\n return SD(...broadcast(y, x), self, true);\n });\n matrixSignatures['SparseMatrix, Array'] = typed.referToSelf(self => (x, y) => {\n return SD(...broadcast(matrix(y), x), self, true);\n });\n }\n }\n\n // Now add the scalars\n var scalar = options.scalar || 'any';\n var Ds = options.Ds || options.Ss;\n if (Ds) {\n if (elop) {\n matrixSignatures['DenseMatrix,' + scalar] = (x, y) => matAlgo14xDs(x, y, elop, false);\n matrixSignatures[scalar + ', DenseMatrix'] = (x, y) => matAlgo14xDs(y, x, elop, true);\n matrixSignatures['Array,' + scalar] = (x, y) => matAlgo14xDs(matrix(x), y, elop, false).valueOf();\n matrixSignatures[scalar + ', Array'] = (x, y) => matAlgo14xDs(matrix(y), x, elop, true).valueOf();\n } else {\n matrixSignatures['DenseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n });\n matrixSignatures[scalar + ', DenseMatrix'] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(y, x, self, true);\n });\n matrixSignatures['Array,' + scalar] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(matrix(x), y, self, false).valueOf();\n });\n matrixSignatures[scalar + ', Array'] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n });\n }\n }\n var sS = options.sS !== undefined ? options.sS : options.Ss;\n if (elop) {\n if (options.Ss) {\n matrixSignatures['SparseMatrix,' + scalar] = (x, y) => options.Ss(x, y, elop, false);\n }\n if (sS) {\n matrixSignatures[scalar + ', SparseMatrix'] = (x, y) => sS(y, x, elop, true);\n }\n } else {\n if (options.Ss) {\n matrixSignatures['SparseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => {\n return options.Ss(x, y, self, false);\n });\n }\n if (sS) {\n matrixSignatures[scalar + ', SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return sS(y, x, self, true);\n });\n }\n }\n // Also pull in the scalar signatures if the operator is a typed function\n if (elop && elop.signatures) {\n extend(matrixSignatures, elop.signatures);\n }\n return matrixSignatures;\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo13xDD';\nvar dependencies = ['typed'];\nexport var createMatAlgo13xDD = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, Bij..z).\n * Callback function invoked MxN times.\n *\n * C(i,j,...z) = f(Aij..z, Bij..z)\n *\n * @param {Matrix} a The DenseMatrix instance (A)\n * @param {Matrix} b The DenseMatrix instance (B)\n * @param {Function} callback The f(Aij..z,Bij..z) operation to invoke\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97658658\n */\n return function matAlgo13xDD(a, b, callback) {\n // a arrays\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype;\n // b arrays\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype;\n // c arrays\n var csize = [];\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // validate each one of the dimension sizes\n for (var s = 0; s < asize.length; s++) {\n // must match\n if (asize[s] !== bsize[s]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n // update dimension in c\n csize[s] = asize[s];\n }\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt) {\n // datatype\n dt = adt;\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // populate cdata, iterate through dimensions\n var cdata = csize.length > 0 ? _iterate(cf, 0, csize, csize[0], adata, bdata) : [];\n\n // c matrix\n return a.createDenseMatrix({\n data: cdata,\n size: csize,\n datatype: dt\n });\n };\n\n // recursive function\n function _iterate(f, level, s, n, av, bv) {\n // initialize array for this level\n var cv = [];\n // check we reach the last level\n if (level === s.length - 1) {\n // loop arrays in last level\n for (var i = 0; i < n; i++) {\n // invoke callback and store value\n cv[i] = f(av[i], bv[i]);\n }\n } else {\n // iterate current level\n for (var j = 0; j < n; j++) {\n // iterate next level\n cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv[j]);\n }\n }\n return cv;\n }\n});", "import { checkBroadcastingRules } from '../../../utils/array.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'broadcast';\nvar dependancies = ['concat'];\nexport var createBroadcast = /* #__PURE__ */factory(name, dependancies, _ref => {\n var {\n concat\n } = _ref;\n /**\n * Broadcasts two matrices, and return both in an array\n * It checks if it's possible with broadcasting rules\n *\n * @param {Matrix} A First Matrix\n * @param {Matrix} B Second Matrix\n *\n * @return {Matrix[]} [ broadcastedA, broadcastedB ]\n */\n return function (A, B) {\n var N = Math.max(A._size.length, B._size.length); // max number of dims\n if (A._size.length === B._size.length) {\n if (A._size.every((dim, i) => dim === B._size[i])) {\n // If matrices have the same size return them\n return [A, B];\n }\n }\n var sizeA = _padLeft(A._size, N, 0); // pad to the left to align dimensions to the right\n var sizeB = _padLeft(B._size, N, 0); // pad to the left to align dimensions to the right\n\n // calculate the max dimensions\n var sizeMax = [];\n for (var dim = 0; dim < N; dim++) {\n sizeMax[dim] = Math.max(sizeA[dim], sizeB[dim]);\n }\n\n // check if the broadcasting rules applyes for both matrices\n checkBroadcastingRules(sizeA, sizeMax);\n checkBroadcastingRules(sizeB, sizeMax);\n\n // reshape A or B if needed to make them ready for concat\n var AA = A.clone();\n var BB = B.clone();\n if (AA._size.length < N) {\n AA.reshape(_padLeft(AA._size, N, 1));\n } else if (BB._size.length < N) {\n BB.reshape(_padLeft(BB._size, N, 1));\n }\n\n // stretches the matrices on each dimension to make them the same size\n for (var _dim = 0; _dim < N; _dim++) {\n if (AA._size[_dim] < sizeMax[_dim]) {\n AA = _stretch(AA, sizeMax[_dim], _dim);\n }\n if (BB._size[_dim] < sizeMax[_dim]) {\n BB = _stretch(BB, sizeMax[_dim], _dim);\n }\n }\n\n // return the array with the two broadcasted matrices\n return [AA, BB];\n };\n function _padLeft(shape, N, filler) {\n // pads an array of dimensions with numbers to the left, unitl the number of dimensions is N\n return [...Array(N - shape.length).fill(filler), ...shape];\n }\n function _stretch(arrayToStretch, sizeToStretch, dimToStretch) {\n // stretches a matrix up to a certain size in a certain dimension\n return concat(...Array(sizeToStretch).fill(arrayToStretch), dimToStretch);\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo01xDSid';\nvar dependencies = ['typed'];\nexport var createMatAlgo01xDSid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij).\n * Callback function invoked NNZ times (number of nonzero items in SparseMatrix).\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 Dij ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (S)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function algorithm1(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // process data types\n var dt = typeof adt === 'string' && adt !== 'mixed' && adt === bdt ? adt : undefined;\n // callback function\n var cf = dt ? typed.find(callback, [dt, dt]) : callback;\n\n // vars\n var i, j;\n\n // result (DenseMatrix)\n var cdata = [];\n // initialize c\n for (i = 0; i < rows; i++) {\n cdata[i] = [];\n }\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns in b\n for (j = 0; j < columns; j++) {\n // column mark\n var mark = j + 1;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // update workspace\n x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n // mark i as updated\n w[i] = mark;\n }\n // loop rows\n for (i = 0; i < rows; i++) {\n // check row is in workspace\n if (w[i] === mark) {\n // c[i][j] was already calculated\n cdata[i][j] = x[i];\n } else {\n // item does not exist in S\n cdata[i][j] = adata[i][j];\n }\n }\n }\n\n // return dense matrix\n return denseMatrix.createDenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo04xSidSid';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo04xSidSid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524 A(i,j) ; A(i,j) !== 0 && B(i,j) === 0\n * \u2514 B(i,j) ; A(i,j) === 0\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo04xSidSid(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspace\n var xa = avalues && bvalues ? [] : undefined;\n var xb = avalues && bvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // vars\n var i, j, k, k0, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop A(:,j)\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // update c\n cindex.push(i);\n // update workspace\n wa[i] = mark;\n // check we need to process values\n if (xa) {\n xa[i] = avalues[k];\n }\n }\n // loop B(:,j)\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // check row exists in A\n if (wa[i] === mark) {\n // update record in xa @ i\n if (xa) {\n // invoke callback\n var v = cf(xa[i], bvalues[k]);\n // check for zero\n if (!eq(v, zero)) {\n // update workspace\n xa[i] = v;\n } else {\n // remove mark (index will be removed later)\n wa[i] = null;\n }\n }\n } else {\n // update c\n cindex.push(i);\n // update workspace\n wb[i] = mark;\n // check we need to process values\n if (xb) {\n xb[i] = bvalues[k];\n }\n }\n }\n // check we need to process values (non pattern matrix)\n if (xa && xb) {\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // check workspace has value @ i\n if (wa[i] === mark) {\n // push value (Aij != 0 || (Aij != 0 && Bij != 0))\n cvalues[k] = xa[i];\n // increment pointer\n k++;\n } else if (wb[i] === mark) {\n // push value (bij != 0)\n cvalues[k] = xb[i];\n // increment pointer\n k++;\n } else {\n // remove index @ k\n cindex.splice(k, 1);\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo10xSids';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo10xSids = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked NZ times (number of nonzero items in S).\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 b ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo10xSids(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cdata = [];\n\n // workspaces\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var r = aindex[k];\n // update workspace\n x[r] = avalues[k];\n w[r] = mark;\n }\n // loop rows\n for (var i = 0; i < rows; i++) {\n // initialize C on first column\n if (j === 0) {\n // create row array\n cdata[i] = [];\n }\n // check sparse matrix has a value @ i,j\n if (w[i] === mark) {\n // invoke callback, update C\n cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b);\n } else {\n // dense matrix value @ i, j\n cdata[i][j] = b;\n }\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "/**\n * Create a syntax error with the message:\n * 'Wrong number of arguments in function ( provided, - expected)'\n * @param {string} fn Function name\n * @param {number} count Actual argument count\n * @param {number} min Minimum required argument count\n * @param {number} [max] Maximum required argument count\n * @extends Error\n */\nexport function ArgumentsError(fn, count, min, max) {\n if (!(this instanceof ArgumentsError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.fn = fn;\n this.count = count;\n this.min = min;\n this.max = max;\n this.message = 'Wrong number of arguments in function ' + fn + ' (' + count + ' provided, ' + min + (max !== undefined && max !== null ? '-' + max : '') + ' expected)';\n this.stack = new Error().stack;\n}\nArgumentsError.prototype = new Error();\nArgumentsError.prototype.constructor = Error;\nArgumentsError.prototype.name = 'ArgumentsError';\nArgumentsError.prototype.isArgumentsError = true;", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { lcmNumber } from '../../plain/number/index.js';\nvar name = 'lcm';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'concat'];\nexport var createLcm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var lcmTypes = 'number | BigNumber | Fraction | Matrix | Array';\n var lcmManySignature = {};\n lcmManySignature[\"\".concat(lcmTypes, \", \").concat(lcmTypes, \", ...\").concat(lcmTypes)] = typed.referToSelf(self => (a, b, args) => {\n var res = self(a, b);\n for (var i = 0; i < args.length; i++) {\n res = self(res, args[i]);\n }\n return res;\n });\n\n /**\n * Calculate the least common multiple for two or more values or arrays.\n *\n * lcm is defined as:\n *\n * lcm(a, b) = abs(a * b) / gcd(a, b)\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.lcm(a, b)\n * math.lcm(a, b, c, ...)\n *\n * Examples:\n *\n * math.lcm(4, 6) // returns 12\n * math.lcm(6, 21) // returns 42\n * math.lcm(6, 21, 5) // returns 210\n *\n * math.lcm([4, 6], [6, 21]) // returns [12, 42]\n *\n * See also:\n *\n * gcd, xgcd\n *\n * @param {... number | BigNumber | Array | Matrix} args Two or more integer numbers\n * @return {number | BigNumber | Array | Matrix} The least common multiple\n */\n return typed(name, {\n 'number, number': lcmNumber,\n 'BigNumber, BigNumber': _lcmBigNumber,\n 'Fraction, Fraction': (x, y) => x.lcm(y)\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }), lcmManySignature);\n\n /**\n * Calculate lcm for two BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @returns {BigNumber} Returns the least common multiple of a and b\n * @private\n */\n function _lcmBigNumber(a, b) {\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function lcm must be integer numbers');\n }\n if (a.isZero()) {\n return a;\n }\n if (b.isZero()) {\n return b;\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n // evaluate lcm here inline to reduce overhead\n var prod = a.times(b);\n while (!b.isZero()) {\n var t = b;\n b = a.mod(t);\n a = t;\n }\n return prod.div(a).abs();\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nimport { scatter } from '../../../utils/collection.js';\nvar name = 'matAlgo06xS0S0';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo06xS0S0 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked (Anz U Bnz) times, where Anz and Bnz are the nonzero elements in both matrices.\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo06xS0S0(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var x = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var w = [];\n // marks indicating value in a given row has been updated\n var u = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // scatter the values of A(:,j) into workspace\n scatter(a, j, w, x, u, mark, cindex, cf);\n // scatter the values of B(:,j) into workspace\n scatter(b, j, w, x, u, mark, cindex, cf);\n // check we need to process values (non pattern matrix)\n if (x) {\n // initialize first index in j\n var k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n var i = cindex[k];\n // check function was invoked on current row (Aij !=0 && Bij != 0)\n if (u[i] === mark) {\n // value @ i\n var v = x[i];\n // check for zero value\n if (!eq(v, zero)) {\n // push value\n cvalues.push(v);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n } else {\n // initialize first index in j\n var p = cptr[j];\n // loop index in j\n while (p < cindex.length) {\n // row\n var r = cindex[p];\n // check function was invoked on current row (Aij !=0 && Bij != 0)\n if (u[r] !== mark) {\n // remove value @ i, do not increment pointer\n cindex.splice(p, 1);\n } else {\n // increment pointer\n p++;\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log10Number } from '../../plain/number/index.js';\nvar name = 'log10';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createLog10 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex: _Complex\n } = _ref;\n /**\n * Calculate the 10-base logarithm of a value. This is the same as calculating `log(x, 10)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log10(x)\n *\n * Examples:\n *\n * math.log10(0.00001) // returns -5\n * math.log10(10000) // returns 4\n * math.log(10000) / math.log(10) // returns 4\n * math.pow(10, 4) // returns 10000\n *\n * See also:\n *\n * exp, log, log1p, log2\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the 10-base logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return log10Number(x);\n } else {\n // negative value -> complex value computation\n return new _Complex(x, 0).log().div(Math.LN10);\n }\n },\n Complex: function Complex(x) {\n return new _Complex(x).log().div(Math.LN10);\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.log();\n } else {\n // downgrade to number, return Complex valued result\n return new _Complex(x.toNumber(), 0).log().div(Math.LN10);\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log2Number } from '../../plain/number/index.js';\nvar name = 'log2';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createLog2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log2(x)\n *\n * Examples:\n *\n * math.log2(0.03125) // returns -5\n * math.log2(16) // returns 4\n * math.log2(16) / math.log2(2) // returns 4\n * math.pow(2, 4) // returns 16\n *\n * See also:\n *\n * exp, log, log1p, log10\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the 2-base logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return log2Number(x);\n } else {\n // negative value -> complex value computation\n return _log2Complex(new Complex(x, 0));\n }\n },\n Complex: _log2Complex,\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.log(2);\n } else {\n // downgrade to number, return Complex valued result\n return _log2Complex(new Complex(x.toNumber(), 0));\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n /**\n * Calculate log2 for a complex value\n * @param {Complex} x\n * @returns {Complex}\n * @private\n */\n function _log2Complex(x) {\n var newX = Math.sqrt(x.re * x.re + x.im * x.im);\n return new Complex(Math.log2 ? Math.log2(newX) : Math.log(newX) / Math.LN2, Math.atan2(x.im, x.re) / Math.LN2);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { multiplyNumber } from '../../plain/number/index.js';\nvar name = 'multiplyScalar';\nvar dependencies = ['typed'];\nexport var createMultiplyScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Multiply two scalar values, `x * y`.\n * This function is meant for internal use: it is used by the public function\n * `multiply`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to multiply\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to multiply\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Multiplication of `x` and `y`\n * @private\n */\n return typed('multiplyScalar', {\n 'number, number': multiplyNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.mul(y);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.times(y);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x * y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return x.mul(y);\n },\n 'number | Fraction | BigNumber | Complex, Unit': (x, y) => y.multiply(x),\n 'Unit, number | Fraction | BigNumber | Complex | Unit': (x, y) => x.multiply(y)\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'multiply';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'equalScalar', 'dot'];\nexport var createMultiply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n multiplyScalar,\n equalScalar,\n dot\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n function _validateMatrixDimensions(size1, size2) {\n // check left operand dimensions\n switch (size1.length) {\n case 1:\n // check size2\n switch (size2.length) {\n case 1:\n // Vector x Vector\n if (size1[0] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Vectors must have the same length');\n }\n break;\n case 2:\n // Vector x Matrix\n if (size1[0] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Vector length (' + size1[0] + ') must match Matrix rows (' + size2[0] + ')');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)');\n }\n break;\n case 2:\n // check size2\n switch (size2.length) {\n case 1:\n // Matrix x Vector\n if (size1[1] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Matrix columns (' + size1[1] + ') must match Vector length (' + size2[0] + ')');\n }\n break;\n case 2:\n // Matrix x Matrix\n if (size1[1] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Matrix A columns (' + size1[1] + ') must match Matrix B rows (' + size2[0] + ')');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix A has ' + size1.length + ' dimensions)');\n }\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (N)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {number} Scalar value\n */\n function _multiplyVectorVector(a, b, n) {\n // check empty vector\n if (n === 0) {\n throw new Error('Cannot multiply two empty vectors');\n }\n return dot(a, b);\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (M)\n * @param {Matrix} b Matrix (MxN)\n *\n * @return {Matrix} Dense Vector (N)\n */\n function _multiplyVectorMatrix(a, b) {\n // process storage\n if (b.storage() !== 'dense') {\n throw new Error('Support for SparseMatrix not implemented');\n }\n return _multiplyVectorDenseMatrix(a, b);\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (M)\n * @param {Matrix} b Dense Matrix (MxN)\n *\n * @return {Matrix} Dense Vector (N)\n */\n function _multiplyVectorDenseMatrix(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var alength = asize[0];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix columns\n for (var j = 0; j < bcolumns; j++) {\n // sum (do not initialize it with zero)\n var sum = mf(adata[0], bdata[0][j]);\n // loop vector\n for (var i = 1; i < alength; i++) {\n // multiply & accumulate\n sum = af(sum, mf(adata[i], bdata[i][j]));\n }\n c[j] = sum;\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Matrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} Dense Vector (M)\n */\n var _multiplyMatrixVector = typed('_multiplyMatrixVector', {\n 'DenseMatrix, any': _multiplyDenseMatrixVector,\n 'SparseMatrix, any': _multiplySparseMatrixVector\n });\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Matrix (MxN)\n * @param {Matrix} b Matrix (NxC)\n *\n * @return {Matrix} Matrix (MxC)\n */\n var _multiplyMatrixMatrix = typed('_multiplyMatrixMatrix', {\n 'DenseMatrix, DenseMatrix': _multiplyDenseMatrixDenseMatrix,\n 'DenseMatrix, SparseMatrix': _multiplyDenseMatrixSparseMatrix,\n 'SparseMatrix, DenseMatrix': _multiplySparseMatrixDenseMatrix,\n 'SparseMatrix, SparseMatrix': _multiplySparseMatrixSparseMatrix\n });\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} Dense Vector (M)\n */\n function _multiplyDenseMatrixVector(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = asize[0];\n var acolumns = asize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix a rows\n for (var i = 0; i < arows; i++) {\n // current row\n var row = adata[i];\n // sum (do not initialize it with zero)\n var sum = mf(row[0], bdata[0]);\n // loop matrix a columns\n for (var j = 1; j < acolumns; j++) {\n // multiply & accumulate\n sum = af(sum, mf(row[j], bdata[j]));\n }\n c[i] = sum;\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [arows],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b DenseMatrix (NxC)\n *\n * @return {Matrix} DenseMatrix (MxC)\n */\n function _multiplyDenseMatrixDenseMatrix(a, b) {\n // getDataType()\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = asize[0];\n var acolumns = asize[1];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix a rows\n for (var i = 0; i < arows; i++) {\n // current row\n var row = adata[i];\n // initialize row array\n c[i] = [];\n // loop matrix b columns\n for (var j = 0; j < bcolumns; j++) {\n // sum (avoid initializing sum to zero)\n var sum = mf(row[0], bdata[0][j]);\n // loop matrix a columns\n for (var x = 1; x < acolumns; x++) {\n // multiply & accumulate\n sum = af(sum, mf(row[x], bdata[x][j]));\n }\n c[i][j] = sum;\n }\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b SparseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplyDenseMatrixSparseMatrix(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b sparse\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n // validate b matrix\n if (!bvalues) {\n throw new Error('Cannot multiply Dense Matrix times Pattern only Matrix');\n }\n // rows & columns\n var arows = asize[0];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = b.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // indeces in column jb\n var kb0 = bptr[jb];\n var kb1 = bptr[jb + 1];\n // do not process column jb if no data exists\n if (kb1 > kb0) {\n // last row mark processed\n var last = 0;\n // loop a rows\n for (var i = 0; i < arows; i++) {\n // column mark\n var mark = i + 1;\n // C[i, jb]\n var cij = void 0;\n // values in b column j\n for (var kb = kb0; kb < kb1; kb++) {\n // row\n var ib = bindex[kb];\n // check value has been initialized\n if (last !== mark) {\n // first value in column jb\n cij = mf(adata[i][ib], bvalues[kb]);\n // update mark\n last = mark;\n } else {\n // accumulate value\n cij = af(cij, mf(adata[i][ib], bvalues[kb]));\n }\n }\n // check column has been processed and value != 0\n if (last === mark && !eq(cij, zero)) {\n // push row & value\n cindex.push(i);\n cvalues.push(cij);\n }\n }\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} SparseMatrix (M, 1)\n */\n function _multiplySparseMatrixVector(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // validate a matrix\n if (!avalues) {\n throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix');\n }\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = a._size[0];\n var brows = b._size[0];\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // workspace\n var x = [];\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n\n // update ptr\n cptr[0] = 0;\n // rows in b\n for (var ib = 0; ib < brows; ib++) {\n // b[ib]\n var vbi = bdata[ib];\n // check b[ib] != 0, avoid loops\n if (!eq(vbi, zero)) {\n // A values & index in ib column\n for (var ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // a row\n var ia = aindex[ka];\n // check value exists in current j\n if (!w[ia]) {\n // ia is new entry in j\n w[ia] = true;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(vbi, avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(vbi, avalues[ka]));\n }\n }\n }\n }\n // copy values from x to column jb of c\n for (var p1 = cindex.length, p = 0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n // update ptr\n cptr[1] = cindex.length;\n\n // matrix to return\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, 1],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b DenseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplySparseMatrixDenseMatrix(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // validate a matrix\n if (!avalues) {\n throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix');\n }\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = a._size[0];\n var brows = b._size[0];\n var bcolumns = b._size[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // workspace\n var x = [];\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // mark in workspace for current column\n var mark = jb + 1;\n // rows in jb\n for (var ib = 0; ib < brows; ib++) {\n // b[ib, jb]\n var vbij = bdata[ib][jb];\n // check b[ib, jb] != 0, avoid loops\n if (!eq(vbij, zero)) {\n // A values & index in ib column\n for (var ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // a row\n var ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(vbij, avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(vbij, avalues[ka]));\n }\n }\n }\n }\n // copy values from x to column jb of c\n for (var p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b SparseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplySparseMatrixSparseMatrix(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // b sparse\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // rows & columns\n var arows = a._size[0];\n var bcolumns = b._size[1];\n // flag indicating both matrices (a & b) contain data\n var values = avalues && bvalues;\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var cvalues = values ? [] : undefined;\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // workspace\n var x = values ? [] : undefined;\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n // variables\n var ka, ka0, ka1, kb, kb0, kb1, ia, ib;\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // mark in workspace for current column\n var mark = jb + 1;\n // B values & index in j\n for (kb0 = bptr[jb], kb1 = bptr[jb + 1], kb = kb0; kb < kb1; kb++) {\n // b row\n ib = bindex[kb];\n // check we need to process values\n if (values) {\n // loop values in a[:,ib]\n for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // row\n ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(bvalues[kb], avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(bvalues[kb], avalues[ka]));\n }\n }\n } else {\n // loop values in a[:,ib]\n for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // row\n ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n }\n }\n }\n }\n // check we need to process matrix values (pattern matrix)\n if (values) {\n // copy values from x to column jb of c\n for (var p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * Multiply two or more values, `x * y`.\n * For matrices, the matrix product is calculated.\n *\n * Syntax:\n *\n * math.multiply(x, y)\n * math.multiply(x, y, z, ...)\n *\n * Examples:\n *\n * math.multiply(4, 5.2) // returns number 20.8\n * math.multiply(2, 3, 4) // returns number 24\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(4, 1)\n * math.multiply(a, b) // returns Complex 5 + 14i\n *\n * const c = [[1, 2], [4, 3]]\n * const d = [[1, 2, 3], [3, -4, 7]]\n * math.multiply(c, d) // returns Array [[7, -6, 17], [13, -4, 33]]\n *\n * const e = math.unit('2.1 km')\n * math.multiply(3, e) // returns Unit 6.3 km\n *\n * See also:\n *\n * divide, prod, cross, dot\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to multiply\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to multiply\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y`\n */\n return typed(name, multiplyScalar, {\n // we extend the signatures of multiplyScalar with signatures dealing with matrices\n\n 'Array, Array': typed.referTo('Matrix, Matrix', selfMM => (x, y) => {\n // check dimensions\n _validateMatrixDimensions(arraySize(x), arraySize(y));\n\n // use dense matrix implementation\n var m = selfMM(matrix(x), matrix(y));\n // return array or scalar\n return isMatrix(m) ? m.valueOf() : m;\n }),\n 'Matrix, Matrix': function MatrixMatrix(x, y) {\n // dimensions\n var xsize = x.size();\n var ysize = y.size();\n\n // check dimensions\n _validateMatrixDimensions(xsize, ysize);\n\n // process dimensions\n if (xsize.length === 1) {\n // process y dimensions\n if (ysize.length === 1) {\n // Vector * Vector\n return _multiplyVectorVector(x, y, xsize[0]);\n }\n // Vector * Matrix\n return _multiplyVectorMatrix(x, y);\n }\n // process y dimensions\n if (ysize.length === 1) {\n // Matrix * Vector\n return _multiplyMatrixVector(x, y);\n }\n // Matrix * Matrix\n return _multiplyMatrixMatrix(x, y);\n },\n 'Matrix, Array': typed.referTo('Matrix,Matrix', selfMM => (x, y) => selfMM(x, matrix(y))),\n 'Array, Matrix': typed.referToSelf(self => (x, y) => {\n // use Matrix * Matrix implementation\n return self(matrix(x, y.storage()), y);\n }),\n 'SparseMatrix, any': function SparseMatrixAny(x, y) {\n return matAlgo11xS0s(x, y, multiplyScalar, false);\n },\n 'DenseMatrix, any': function DenseMatrixAny(x, y) {\n return matAlgo14xDs(x, y, multiplyScalar, false);\n },\n 'any, SparseMatrix': function anySparseMatrix(x, y) {\n return matAlgo11xS0s(y, x, multiplyScalar, true);\n },\n 'any, DenseMatrix': function anyDenseMatrix(x, y) {\n return matAlgo14xDs(y, x, multiplyScalar, true);\n },\n 'Array, any': function ArrayAny(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), y, multiplyScalar, false).valueOf();\n },\n 'any, Array': function anyArray(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, multiplyScalar, true).valueOf();\n },\n 'any, any': multiplyScalar,\n 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => {\n var result = self(x, y);\n for (var i = 0; i < rest.length; i++) {\n result = self(result, rest[i]);\n }\n return result;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { nthRootNumber } from '../../plain/number/index.js';\nvar name = 'nthRoot';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'concat'];\nexport var createNthRoot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n BigNumber: _BigNumber,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the nth root of a value.\n * The principal nth root of a positive real number A, is the positive real\n * solution of the equation\n *\n * x^root = A\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.nthRoot(a)\n * math.nthRoot(a, root)\n *\n * Examples:\n *\n * math.nthRoot(9, 2) // returns 3 (since 3^2 == 9)\n * math.sqrt(9) // returns 3 (since 3^2 == 9)\n * math.nthRoot(64, 3) // returns 4 (since 4^3 == 64)\n *\n * See also:\n *\n * sqrt, pow\n *\n * @param {number | BigNumber | Array | Matrix | Complex} a\n * Value for which to calculate the nth root\n * @param {number | BigNumber} [root=2] The root.\n * @return {number | Complex | Array | Matrix} Returns the nth root of `a`\n */\n function complexErr() {\n throw new Error('Complex number not supported in function nthRoot. Use nthRoots instead.');\n }\n return typed(name, {\n number: nthRootNumber,\n 'number, number': nthRootNumber,\n BigNumber: x => _bigNthRoot(x, new _BigNumber(2)),\n 'BigNumber, BigNumber': _bigNthRoot,\n Complex: complexErr,\n 'Complex, number': complexErr,\n Array: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(matrix(x), 2).valueOf()),\n DenseMatrix: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(x, 2)),\n SparseMatrix: typed.referTo('SparseMatrix,number', selfSn => x => selfSn(x, 2)),\n 'SparseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // sparse + sparse\n return matAlgo06xS0S0(x, y, self);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n }),\n 'DenseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // dense + sparse\n return matAlgo01xDSid(x, y, self, false);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n }),\n 'Array, SparseMatrix': typed.referTo('DenseMatrix,SparseMatrix', selfDS => (x, y) => selfDS(matrix(x), y)),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // sparse - scalar\n return matAlgo11xS0s(y, x, self, true);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n })\n }, matrixAlgorithmSuite({\n scalar: 'number | BigNumber',\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: false\n }));\n\n /**\n * Calculate the nth root of a for BigNumbers, solve x^root == a\n * https://rosettacode.org/wiki/Nth_root#JavaScript\n * @param {BigNumber} a\n * @param {BigNumber} root\n * @private\n */\n function _bigNthRoot(a, root) {\n var precision = _BigNumber.precision;\n var Big = _BigNumber.clone({\n precision: precision + 2\n });\n var zero = new _BigNumber(0);\n var one = new Big(1);\n var inv = root.isNegative();\n if (inv) {\n root = root.neg();\n }\n if (root.isZero()) {\n throw new Error('Root must be non-zero');\n }\n if (a.isNegative() && !root.abs().mod(2).equals(1)) {\n throw new Error('Root must be odd when a is negative.');\n }\n\n // edge cases zero and infinity\n if (a.isZero()) {\n return inv ? new Big(Infinity) : 0;\n }\n if (!a.isFinite()) {\n return inv ? zero : a;\n }\n var x = a.abs().pow(one.div(root));\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a.isNeg() ? x.neg() : x;\n return new _BigNumber((inv ? one.div(x) : x).toPrecision(precision));\n }\n});\nexport var createNthRootNumber = /* #__PURE__ */factory(name, ['typed'], _ref2 => {\n var {\n typed\n } = _ref2;\n return typed(name, {\n number: nthRootNumber,\n 'number, number': nthRootNumber\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { signNumber } from '../../plain/number/index.js';\nvar name = 'sign';\nvar dependencies = ['typed', 'BigNumber', 'Fraction', 'complex'];\nexport var createSign = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber,\n complex,\n Fraction: _Fraction\n } = _ref;\n /**\n * Compute the sign of a value. The sign of a value x is:\n *\n * - 1 when x > 0\n * - -1 when x < 0\n * - 0 when x == 0\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.sign(x)\n *\n * Examples:\n *\n * math.sign(3.5) // returns 1\n * math.sign(-4.2) // returns -1\n * math.sign(0) // returns 0\n *\n * math.sign([3, 5, -2, 0, 2]) // returns [1, 1, -1, 0, 1]\n *\n * See also:\n *\n * abs\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x\n * The number for which to determine the sign\n * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit}\n * The sign of `x`\n */\n return typed(name, {\n number: signNumber,\n Complex: function Complex(x) {\n return x.im === 0 ? complex(signNumber(x.re)) : x.sign();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(x.cmp(0));\n },\n bigint: function bigint(x) {\n return x > 0n ? 1n : x < 0n ? -1n : 0n;\n },\n Fraction: function Fraction(x) {\n return new _Fraction(x.s, 1);\n },\n // deep map collection, skip zeros since sign(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)),\n Unit: typed.referToSelf(self => x => {\n if (!x._isDerived() && x.units[0].unit.offset !== 0) {\n throw new TypeError('sign is ambiguous for units with offset');\n }\n return typed.find(self, x.valueType())(x.value);\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'sqrt';\nvar dependencies = ['config', 'typed', 'Complex'];\nexport var createSqrt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n Complex\n } = _ref;\n /**\n * Calculate the square root of a value.\n *\n * For matrices, if you want the matrix square root of a square matrix,\n * use the `sqrtm` function. If you wish to apply `sqrt` elementwise to\n * a matrix M, use `math.map(M, math.sqrt)`.\n *\n * Syntax:\n *\n * math.sqrt(x)\n *\n * Examples:\n *\n * math.sqrt(25) // returns 5\n * math.square(5) // returns 25\n * math.sqrt(-4) // returns Complex 2i\n *\n * See also:\n *\n * square, multiply, cube, cbrt, sqrtm\n *\n * @param {number | BigNumber | Complex | Unit} x\n * Value for which to calculate the square root.\n * @return {number | BigNumber | Complex | Unit}\n * Returns the square root of `x`\n */\n return typed('sqrt', {\n number: _sqrtNumber,\n Complex: function Complex(x) {\n return x.sqrt();\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.sqrt();\n } else {\n // negative value -> downgrade to number to do complex value computation\n return _sqrtNumber(x.toNumber());\n }\n },\n Unit: function Unit(x) {\n // Someday will work for complex units when they are implemented\n return x.pow(0.5);\n }\n });\n\n /**\n * Calculate sqrt for a number\n * @param {number} x\n * @returns {number | Complex} Returns the square root of x\n * @private\n */\n function _sqrtNumber(x) {\n if (isNaN(x)) {\n return NaN;\n } else if (x >= 0 || config.predictable) {\n return Math.sqrt(x);\n } else {\n return new Complex(x, 0).sqrt();\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { squareNumber } from '../../plain/number/index.js';\nvar name = 'square';\nvar dependencies = ['typed'];\nexport var createSquare = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the square of a value, `x * x`.\n * To avoid confusion with multiplying a square matrix by itself,\n * this function does not apply to matrices. If you wish to square\n * every element of a matrix, see the examples.\n *\n * Syntax:\n *\n * math.square(x)\n *\n * Examples:\n *\n * math.square(2) // returns number 4\n * math.square(3) // returns number 9\n * math.pow(3, 2) // returns number 9\n * math.multiply(3, 3) // returns number 9\n *\n * math.map([1, 2, 3, 4], math.square) // returns Array [1, 4, 9, 16]\n *\n * See also:\n *\n * multiply, cube, sqrt, pow\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x\n * Number for which to calculate the square\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit}\n * Squared value\n */\n return typed(name, {\n number: squareNumber,\n Complex: function Complex(x) {\n return x.mul(x);\n },\n BigNumber: function BigNumber(x) {\n return x.times(x);\n },\n bigint: function bigint(x) {\n return x * x;\n },\n Fraction: function Fraction(x) {\n return x.mul(x);\n },\n Unit: function Unit(x) {\n return x.pow(2);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'subtract';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'subtractScalar', 'unaryMinus', 'DenseMatrix', 'concat'];\nexport var createSubtract = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n subtractScalar,\n unaryMinus,\n DenseMatrix,\n concat\n } = _ref;\n // TODO: split function subtract in two: subtract and subtractScalar\n\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Subtract two values, `x - y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.subtract(x, y)\n *\n * Examples:\n *\n * math.subtract(5.3, 2) // returns number 3.3\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(4, 1)\n * math.subtract(a, b) // returns Complex -2 + 2i\n *\n * math.subtract([5, 7, 4], 4) // returns Array [1, 3, 0]\n *\n * const c = math.unit('2.1 km')\n * const d = math.unit('500m')\n * math.subtract(c, d) // returns Unit 1.6 km\n *\n * See also:\n *\n * add\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Initial value\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Value to subtract from `x`\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Subtraction of `x` and `y`\n */\n return typed(name, {\n 'any, any': subtractScalar\n }, matrixAlgorithmSuite({\n elop: subtractScalar,\n SS: matAlgo05xSfSf,\n DS: matAlgo01xDSid,\n SD: matAlgo03xDSf,\n Ss: matAlgo12xSfs,\n sS: matAlgo10xSids\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { xgcdNumber } from '../../plain/number/index.js';\nvar name = 'xgcd';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createXgcd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Calculate the extended greatest common divisor for two values.\n * See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm.\n *\n * Syntax:\n *\n * math.xgcd(a, b)\n *\n * Examples:\n *\n * math.xgcd(8, 12) // returns [4, -1, 1]\n * math.gcd(8, 12) // returns 4\n * math.xgcd(36163, 21199) // returns [1247, -7, 12]\n *\n * See also:\n *\n * gcd, lcm\n *\n * @param {number | BigNumber} a An integer number\n * @param {number | BigNumber} b An integer number\n * @return {Array} Returns an array containing 3 integers `[div, m, n]`\n * where `div = gcd(a, b)` and `a*m + b*n = div`\n */\n return typed(name, {\n 'number, number': function numberNumber(a, b) {\n var res = xgcdNumber(a, b);\n return config.matrix === 'Array' ? res : matrix(res);\n },\n 'BigNumber, BigNumber': _xgcdBigNumber\n // TODO: implement support for Fraction\n });\n\n /**\n * Calculate xgcd for two BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @return {BigNumber[]} result\n * @private\n */\n function _xgcdBigNumber(a, b) {\n // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm\n var\n // used to swap two variables\n t;\n var\n // quotient\n q;\n var\n // remainder\n r;\n var zero = new BigNumber(0);\n var one = new BigNumber(1);\n var x = zero;\n var lastx = one;\n var y = one;\n var lasty = zero;\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function xgcd must be integer numbers');\n }\n while (!b.isZero()) {\n q = a.div(b).floor();\n r = a.mod(b);\n t = x;\n x = lastx.minus(q.times(x));\n lastx = t;\n t = y;\n y = lasty.minus(q.times(y));\n lasty = t;\n a = b;\n b = r;\n }\n var res;\n if (a.lt(zero)) {\n res = [a.neg(), lastx.neg(), lasty.neg()];\n } else {\n res = [a, !a.isZero() ? lastx : 0, lasty];\n }\n return config.matrix === 'Array' ? res : matrix(res);\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'invmod';\nvar dependencies = ['typed', 'config', 'BigNumber', 'xgcd', 'equal', 'smaller', 'mod', 'add', 'isInteger'];\nexport var createInvmod = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n BigNumber,\n xgcd,\n equal,\n smaller,\n mod,\n add,\n isInteger\n } = _ref;\n /**\n * Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation `ax \u2263 1 (mod b)`\n * See https://en.wikipedia.org/wiki/Modular_multiplicative_inverse.\n *\n * Syntax:\n *\n * math.invmod(a, b)\n *\n * Examples:\n *\n * math.invmod(8, 12) // returns NaN\n * math.invmod(7, 13) // returns 2\n * math.invmod(15151, 15122) // returns 10429\n *\n * See also:\n *\n * gcd, xgcd\n *\n * @param {number | BigNumber} a An integer number\n * @param {number | BigNumber} b An integer number\n * @return {number | BigNumber } Returns an integer number\n * where `invmod(a,b)*a \u2263 1 (mod b)`\n */\n return typed(name, {\n 'number, number': invmod,\n 'BigNumber, BigNumber': invmod\n });\n function invmod(a, b) {\n if (!isInteger(a) || !isInteger(b)) throw new Error('Parameters in function invmod must be integer numbers');\n a = mod(a, b);\n if (equal(b, 0)) throw new Error('Divisor must be non zero');\n var res = xgcd(a, b);\n res = res.valueOf();\n var [gcd, inv] = res;\n if (!equal(gcd, BigNumber(1))) return NaN;\n inv = mod(inv, b);\n if (smaller(inv, BigNumber(0))) inv = add(inv, b);\n return inv;\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotMultiply';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'multiplyScalar', 'concat'];\nexport var createDotMultiply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n multiplyScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo09xS0Sf = createMatAlgo09xS0Sf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Multiply two matrices element wise. The function accepts both matrices and\n * scalar values.\n *\n * Syntax:\n *\n * math.dotMultiply(x, y)\n *\n * Examples:\n *\n * math.dotMultiply(2, 4) // returns 8\n *\n * a = [[9, 5], [6, 1]]\n * b = [[3, 2], [5, 2]]\n *\n * math.dotMultiply(a, b) // returns [[27, 10], [30, 2]]\n * math.multiply(a, b) // returns [[52, 28], [23, 14]]\n *\n * See also:\n *\n * multiply, divide, dotDivide\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Left hand value\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Right hand value\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: multiplyScalar,\n SS: matAlgo09xS0Sf,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }));\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo09xS0Sf';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo09xS0Sf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and invokes the callback function f(Aij, Bij).\n * Callback function invoked NZA times, number of nonzero elements in A.\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo09xS0Sf(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var x = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // vars\n var i, j, k, k0, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // column mark\n var mark = j + 1;\n // check we need to process values\n if (x) {\n // loop B(:,j)\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // update workspace\n w[i] = mark;\n x[i] = bvalues[k];\n }\n }\n // loop A(:,j)\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check we need to process values\n if (x) {\n // b value @ i,j\n var vb = w[i] === mark ? x[i] : zero;\n // invoke f\n var vc = cf(avalues[k], vb);\n // check zero value\n if (!eq(vc, zero)) {\n // push index\n cindex.push(i);\n // push value\n cvalues.push(vc);\n }\n } else {\n // push index\n cindex.push(i);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { bitAndBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitAndNumber } from '../../plain/number/index.js';\nvar name = 'bitAnd';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'concat'];\nexport var createBitAnd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise AND two values, `x & y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.bitAnd(x, y)\n *\n * Examples:\n *\n * math.bitAnd(53, 131) // returns number 1\n *\n * math.bitAnd([1, 12, 31], 42) // returns Array [0, 8, 10]\n *\n * See also:\n *\n * bitNot, bitOr, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to and\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to and\n * @return {number | BigNumber | bigint | Array | Matrix} AND of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitAndNumber,\n 'BigNumber, BigNumber': bitAndBigNumber,\n 'bigint, bigint': (x, y) => x & y\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }));\n});", "/**\n * Bitwise and for Bignumbers\n *\n * Special Cases:\n * N & n = N\n * n & 0 = 0\n * n & -1 = n\n * n & n = n\n * I & I = I\n * -I & -I = -I\n * I & -I = 0\n * I & n = n\n * I & -n = I\n * -I & n = 0\n * -I & -n = -I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` & `y`, is fully precise\n * @private\n */\nexport function bitAndBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitAnd');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.eq(-1) || x.eq(y)) {\n return x;\n }\n if (y.isZero() || x.eq(-1)) {\n return y;\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !y.isFinite()) {\n if (x.isNegative() === y.isNegative()) {\n return x;\n }\n return new BigNumber(0);\n }\n if (!x.isFinite()) {\n if (y.isNegative()) {\n return x;\n }\n if (x.isNegative()) {\n return new BigNumber(0);\n }\n return y;\n }\n if (!y.isFinite()) {\n if (x.isNegative()) {\n return y;\n }\n if (y.isNegative()) {\n return new BigNumber(0);\n }\n return x;\n }\n }\n return bitwise(x, y, function (a, b) {\n return a & b;\n });\n}\n\n/**\n * Bitwise not\n * @param {BigNumber} x\n * @return {BigNumber} Result of ~`x`, fully precise\n *\n */\nexport function bitNotBigNumber(x) {\n if (x.isFinite() && !x.isInteger()) {\n throw new Error('Integer expected in function bitNot');\n }\n var BigNumber = x.constructor;\n var prevPrec = BigNumber.precision;\n BigNumber.config({\n precision: 1E9\n });\n var result = x.plus(new BigNumber(1));\n result.s = -result.s || null;\n BigNumber.config({\n precision: prevPrec\n });\n return result;\n}\n\n/**\n * Bitwise OR for BigNumbers\n *\n * Special Cases:\n * N | n = N\n * n | 0 = n\n * n | -1 = -1\n * n | n = n\n * I | I = I\n * -I | -I = -I\n * I | -n = -1\n * I | -I = -1\n * I | n = I\n * -I | n = -I\n * -I | -n = -n\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` | `y`, fully precise\n */\nexport function bitOrBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitOr');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n var negOne = new BigNumber(-1);\n if (x.isZero() || y.eq(negOne) || x.eq(y)) {\n return y;\n }\n if (y.isZero() || x.eq(negOne)) {\n return x;\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !x.isNegative() && y.isNegative() || x.isNegative() && !y.isNegative() && !y.isFinite()) {\n return negOne;\n }\n if (x.isNegative() && y.isNegative()) {\n return x.isFinite() ? x : y;\n }\n return x.isFinite() ? y : x;\n }\n return bitwise(x, y, function (a, b) {\n return a | b;\n });\n}\n\n/**\n * Applies bitwise function to numbers\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @param {function (a, b)} func\n * @return {BigNumber}\n */\nexport function bitwise(x, y, func) {\n var BigNumber = x.constructor;\n var xBits, yBits;\n var xSign = +(x.s < 0);\n var ySign = +(y.s < 0);\n if (xSign) {\n xBits = decCoefficientToBinaryString(bitNotBigNumber(x));\n for (var i = 0; i < xBits.length; ++i) {\n xBits[i] ^= 1;\n }\n } else {\n xBits = decCoefficientToBinaryString(x);\n }\n if (ySign) {\n yBits = decCoefficientToBinaryString(bitNotBigNumber(y));\n for (var _i = 0; _i < yBits.length; ++_i) {\n yBits[_i] ^= 1;\n }\n } else {\n yBits = decCoefficientToBinaryString(y);\n }\n var minBits, maxBits, minSign;\n if (xBits.length <= yBits.length) {\n minBits = xBits;\n maxBits = yBits;\n minSign = xSign;\n } else {\n minBits = yBits;\n maxBits = xBits;\n minSign = ySign;\n }\n var shortLen = minBits.length;\n var longLen = maxBits.length;\n var expFuncVal = func(xSign, ySign) ^ 1;\n var outVal = new BigNumber(expFuncVal ^ 1);\n var twoPower = new BigNumber(1);\n var two = new BigNumber(2);\n var prevPrec = BigNumber.precision;\n BigNumber.config({\n precision: 1E9\n });\n while (shortLen > 0) {\n if (func(minBits[--shortLen], maxBits[--longLen]) === expFuncVal) {\n outVal = outVal.plus(twoPower);\n }\n twoPower = twoPower.times(two);\n }\n while (longLen > 0) {\n if (func(minSign, maxBits[--longLen]) === expFuncVal) {\n outVal = outVal.plus(twoPower);\n }\n twoPower = twoPower.times(two);\n }\n BigNumber.config({\n precision: prevPrec\n });\n if (expFuncVal === 0) {\n outVal.s = -outVal.s;\n }\n return outVal;\n}\n\n/* Extracted from decimal.js, and edited to specialize. */\nfunction decCoefficientToBinaryString(x) {\n // Convert to string\n var a = x.d; // array with digits\n var r = a[0] + '';\n for (var i = 1; i < a.length; ++i) {\n var s = a[i] + '';\n for (var z = 7 - s.length; z--;) {\n s = '0' + s;\n }\n r += s;\n }\n var j = r.length;\n while (r.charAt(j) === '0') {\n j--;\n }\n var xe = x.e;\n var str = r.slice(0, j + 1 || 1);\n var strL = str.length;\n if (xe > 0) {\n if (++xe > strL) {\n // Append zeros.\n xe -= strL;\n while (xe--) {\n str += '0';\n }\n } else if (xe < strL) {\n str = str.slice(0, xe) + '.' + str.slice(xe);\n }\n }\n\n // Convert from base 10 (decimal) to base 2\n var arr = [0];\n for (var _i2 = 0; _i2 < str.length;) {\n var arrL = arr.length;\n while (arrL--) {\n arr[arrL] *= 10;\n }\n arr[0] += parseInt(str.charAt(_i2++)); // convert to int\n for (var _j = 0; _j < arr.length; ++_j) {\n if (arr[_j] > 1) {\n if (arr[_j + 1] === null || arr[_j + 1] === undefined) {\n arr[_j + 1] = 0;\n }\n arr[_j + 1] += arr[_j] >> 1;\n arr[_j] &= 1;\n }\n }\n }\n return arr.reverse();\n}\n\n/**\n * Bitwise XOR for BigNumbers\n *\n * Special Cases:\n * N ^ n = N\n * n ^ 0 = n\n * n ^ n = 0\n * n ^ -1 = ~n\n * I ^ n = I\n * I ^ -n = -I\n * I ^ -I = -1\n * -I ^ n = -I\n * -I ^ -n = I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` ^ `y`, fully precise\n *\n */\nexport function bitXor(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitXor');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n if (x.isZero()) {\n return y;\n }\n if (y.isZero()) {\n return x;\n }\n if (x.eq(y)) {\n return new BigNumber(0);\n }\n var negOne = new BigNumber(-1);\n if (x.eq(negOne)) {\n return bitNotBigNumber(y);\n }\n if (y.eq(negOne)) {\n return bitNotBigNumber(x);\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !y.isFinite()) {\n return negOne;\n }\n return new BigNumber(x.isNegative() === y.isNegative() ? Infinity : -Infinity);\n }\n return bitwise(x, y, function (a, b) {\n return a ^ b;\n });\n}\n\n/**\n * Bitwise left shift\n *\n * Special Cases:\n * n << -n = N\n * n << N = N\n * N << n = N\n * n << 0 = n\n * 0 << n = 0\n * I << I = N\n * I << n = I\n * n << I = I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` << `y`\n *\n */\nexport function leftShiftBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function leftShift');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.isZero()) {\n return x;\n }\n if (!x.isFinite() && !y.isFinite()) {\n return new BigNumber(NaN);\n }\n\n // Math.pow(2, y) is fully precise for y < 55, and fast\n if (y.lt(55)) {\n return x.times(Math.pow(2, y.toNumber()) + '');\n }\n return x.times(new BigNumber(2).pow(y));\n}\n\n/*\n * Special Cases:\n * n >> -n = N\n * n >> N = N\n * N >> n = N\n * I >> I = N\n * n >> 0 = n\n * I >> n = I\n * -I >> n = -I\n * -I >> I = -I\n * n >> I = I\n * -n >> I = -1\n * 0 >> n = 0\n *\n * @param {BigNumber} value\n * @param {BigNumber} value\n * @return {BigNumber} Result of `x` >> `y`\n *\n */\nexport function rightArithShiftBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function rightArithShift');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.isZero()) {\n return x;\n }\n if (!y.isFinite()) {\n if (x.isNegative()) {\n return new BigNumber(-1);\n }\n if (!x.isFinite()) {\n return new BigNumber(NaN);\n }\n return new BigNumber(0);\n }\n\n // Math.pow(2, y) is fully precise for y < 55, and fast\n if (y.lt(55)) {\n return x.div(Math.pow(2, y.toNumber()) + '').floor();\n }\n return x.div(new BigNumber(2).pow(y)).floor();\n}", "import { bitNotBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { bitNotNumber } from '../../plain/number/index.js';\nvar name = 'bitNot';\nvar dependencies = ['typed'];\nexport var createBitNot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Bitwise NOT value, `~x`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.bitNot(x)\n *\n * Examples:\n *\n * math.bitNot(1) // returns number -2\n *\n * math.bitNot([2, -3, 4]) // returns Array [-3, 2, -5]\n *\n * See also:\n *\n * bitAnd, bitOr, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to not\n * @return {number | BigNumber | bigint | Array | Matrix} NOT of `x`\n */\n return typed(name, {\n number: bitNotNumber,\n BigNumber: bitNotBigNumber,\n bigint: x => ~x,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { bitOrBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitOrNumber } from '../../plain/number/index.js';\nvar name = 'bitOr';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createBitOr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise OR two values, `x | y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the lowest print base.\n *\n * Syntax:\n *\n * math.bitOr(x, y)\n *\n * Examples:\n *\n * math.bitOr(1, 2) // returns number 3\n *\n * math.bitOr([1, 2, 3], 4) // returns Array [5, 6, 7]\n *\n * See also:\n *\n * bitAnd, bitNot, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to or\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to or\n * @return {number | BigNumber | bigint | Array | Matrix} OR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitOrNumber,\n 'BigNumber, BigNumber': bitOrBigNumber,\n 'bigint, bigint': (x, y) => x | y\n }, matrixAlgorithmSuite({\n SS: matAlgo04xSidSid,\n DS: matAlgo01xDSid,\n Ss: matAlgo10xSids\n }));\n});", "import { bitXor as bigBitXor } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitXorNumber } from '../../plain/number/index.js';\nvar name = 'bitXor';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat'];\nexport var createBitXor = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise XOR two values, `x ^ y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.bitXor(x, y)\n *\n * Examples:\n *\n * math.bitXor(1, 2) // returns number 3\n *\n * math.bitXor([2, 3, 4], 4) // returns Array [6, 7, 0]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to xor\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to xor\n * @return {number | BigNumber | bigint | Array | Matrix} XOR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitXorNumber,\n 'BigNumber, BigNumber': bigBitXor,\n 'bigint, bigint': (x, y) => x ^ y\n }, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo07xSSf';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo07xSSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B items (zero and nonzero) and invokes the callback function f(Aij, Bij).\n * Callback function invoked MxN times.\n *\n * C(i,j) = f(Aij, Bij)\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo07xSSf(a, b, callback) {\n // sparse matrix arrays\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // vars\n var i, j;\n\n // result arrays\n var cdata = [];\n // initialize c\n for (i = 0; i < rows; i++) {\n cdata[i] = [];\n }\n\n // workspaces\n var xa = [];\n var xb = [];\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // scatter the values of A(:,j) into workspace\n _scatter(a, j, wa, xa, mark);\n // scatter the values of B(:,j) into workspace\n _scatter(b, j, wb, xb, mark);\n // loop rows\n for (i = 0; i < rows; i++) {\n // matrix values @ i,j\n var va = wa[i] === mark ? xa[i] : zero;\n var vb = wb[i] === mark ? xb[i] : zero;\n // invoke callback\n cdata[i][j] = cf(va, vb);\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n function _scatter(m, j, w, x, mark) {\n // a arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // loop values in column j\n for (var k = ptr[j], k1 = ptr[j + 1]; k < k1; k++) {\n // row\n var i = index[k];\n // update workspace\n w[i] = mark;\n x[i] = values[k];\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'arg';\nvar dependencies = ['typed'];\nexport var createArg = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the argument of a complex value.\n * For a complex number `a + bi`, the argument is computed as `atan2(b, a)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.arg(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 2)\n * math.arg(a) / math.pi // returns number 0.25\n *\n * const b = math.complex('2 + 3i')\n * math.arg(b) // returns number 0.982793723247329\n * math.atan2(3, 2) // returns number 0.982793723247329\n *\n * See also:\n *\n * re, im, conj, abs\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The argument of x\n */\n return typed(name, {\n number: function number(x) {\n return Math.atan2(0, x);\n },\n BigNumber: function BigNumber(x) {\n return x.constructor.atan2(0, x);\n },\n Complex: function Complex(x) {\n return x.arg();\n },\n // TODO: implement BigNumber support for function arg\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'conj';\nvar dependencies = ['typed'];\nexport var createConj = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the complex conjugate of a complex value.\n * If `x = a+bi`, the complex conjugate of `x` is `a - bi`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.conj(x)\n *\n * Examples:\n *\n * math.conj(math.complex('2 + 3i')) // returns Complex 2 - 3i\n * math.conj(math.complex('2 - 3i')) // returns Complex 2 + 3i\n * math.conj(math.complex('-5.2i')) // returns Complex 5.2i\n *\n * See also:\n *\n * re, im, arg, abs\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Complex | Array | Matrix}\n * The complex conjugate of x\n */\n return typed(name, {\n 'number | BigNumber | Fraction': x => x,\n Complex: x => x.conjugate(),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'im';\nvar dependencies = ['typed'];\nexport var createIm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Get the imaginary part of a complex number.\n * For a complex number `a + bi`, the function returns `b`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.im(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 3)\n * math.re(a) // returns number 2\n * math.im(a) // returns number 3\n *\n * math.re(math.complex('-5.2i')) // returns number -5.2\n * math.re(math.complex(2.4)) // returns number 0\n *\n * See also:\n *\n * re, conj, abs, arg\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The imaginary part of x\n */\n return typed(name, {\n number: () => 0,\n 'BigNumber | Fraction': x => x.mul(0),\n Complex: x => x.im,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 're';\nvar dependencies = ['typed'];\nexport var createRe = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Get the real part of a complex number.\n * For a complex number `a + bi`, the function returns `a`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.re(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 3)\n * math.re(a) // returns number 2\n * math.im(a) // returns number 3\n *\n * math.re(math.complex('-5.2i')) // returns number 0\n * math.re(math.complex(2.4)) // returns number 2.4\n *\n * See also:\n *\n * im, conj, abs, arg\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The real part of x\n */\n return typed(name, {\n 'number | BigNumber | Fraction': x => x,\n Complex: x => x.re,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { notNumber } from '../../plain/number/index.js';\nvar name = 'not';\nvar dependencies = ['typed'];\nexport var createNot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Logical `not`. Flips boolean value of a given parameter.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.not(x)\n *\n * Examples:\n *\n * math.not(2) // returns false\n * math.not(0) // returns true\n * math.not(true) // returns false\n *\n * a = [2, -7, 0]\n * math.not(a) // returns [false, false, true]\n *\n * See also:\n *\n * and, or, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @return {boolean | Array | Matrix}\n * Returns true when input is a zero or empty value.\n */\n return typed(name, {\n 'null | undefined': () => true,\n number: notNumber,\n Complex: function Complex(x) {\n return x.re === 0 && x.im === 0;\n },\n BigNumber: function BigNumber(x) {\n return x.isZero() || x.isNaN();\n },\n bigint: x => !x,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { orNumber } from '../../plain/number/index.js';\nvar name = 'or';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createOr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `or`. Test if at least one value is defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.or(x, y)\n *\n * Examples:\n *\n * math.or(2, 4) // returns true\n *\n * a = [2, 5, 0]\n * b = [0, 22, 0]\n * c = 0\n *\n * math.or(a, b) // returns [true, true, false]\n * math.or(b, c) // returns [false, true, false]\n *\n * See also:\n *\n * and, not, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when one of the inputs is defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': orNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.re !== 0 || x.im !== 0 || y.re !== 0 || y.im !== 0;\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return !x.isZero() && !x.isNaN() || !y.isZero() && !y.isNaN();\n },\n 'bigint, bigint': orNumber,\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0))\n }, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { xorNumber } from '../../plain/number/index.js';\nvar name = 'xor';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat'];\nexport var createXor = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `xor`. Test whether one and only one value is defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.xor(x, y)\n *\n * Examples:\n *\n * math.xor(2, 4) // returns false\n *\n * a = [2, 0, 0]\n * b = [2, 7, 0]\n * c = 0\n *\n * math.xor(a, b) // returns [false, true, false]\n * math.xor(a, c) // returns [true, false, false]\n *\n * See also:\n *\n * and, not, or\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when one and only one input is defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': xorNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return (x.re !== 0 || x.im !== 0) !== (y.re !== 0 || y.im !== 0);\n },\n 'bigint, bigint': xorNumber,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return (!x.isZero() && !x.isNaN()) !== (!y.isZero() && !y.isNaN());\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0))\n }, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { isBigNumber, isMatrix, isNumber } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { arraySize, concat as _concat } from '../../utils/array.js';\nimport { IndexError } from '../../error/IndexError.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'concat';\nvar dependencies = ['typed', 'matrix', 'isInteger'];\nexport var createConcat = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isInteger\n } = _ref;\n /**\n * Concatenate two or more matrices.\n *\n * Syntax:\n *\n * math.concat(A, B, C, ...)\n * math.concat(A, B, C, ..., dim)\n *\n * Where:\n *\n * - `dim: number` is a zero-based dimension over which to concatenate the matrices.\n * By default the last dimension of the matrices.\n *\n * Examples:\n *\n * const A = [[1, 2], [5, 6]]\n * const B = [[3, 4], [7, 8]]\n *\n * math.concat(A, B) // returns [[1, 2, 3, 4], [5, 6, 7, 8]]\n * math.concat(A, B, 0) // returns [[1, 2], [5, 6], [3, 4], [7, 8]]\n * math.concat('hello', ' ', 'world') // returns 'hello world'\n *\n * See also:\n *\n * size, squeeze, subset, transpose\n *\n * @param {... Array | Matrix} args Two or more matrices\n * @return {Array | Matrix} Concatenated matrix\n */\n return typed(name, {\n // TODO: change signature to '...Array | Matrix, dim?' when supported\n '...Array | Matrix | number | BigNumber': function ArrayMatrixNumberBigNumber(args) {\n var i;\n var len = args.length;\n var dim = -1; // zero-based dimension\n var prevDim;\n var asMatrix = false;\n var matrices = []; // contains multi dimensional arrays\n\n for (i = 0; i < len; i++) {\n var arg = args[i];\n\n // test whether we need to return a Matrix (if not we return an Array)\n if (isMatrix(arg)) {\n asMatrix = true;\n }\n if (isNumber(arg) || isBigNumber(arg)) {\n if (i !== len - 1) {\n throw new Error('Dimension must be specified as last argument');\n }\n\n // last argument contains the dimension on which to concatenate\n prevDim = dim;\n dim = arg.valueOf(); // change BigNumber to number\n\n if (!isInteger(dim)) {\n throw new TypeError('Integer number expected for dimension');\n }\n if (dim < 0 || i > 0 && dim > prevDim) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, prevDim + 1);\n }\n } else {\n // this is a matrix or array\n var m = clone(arg).valueOf();\n var size = arraySize(m);\n matrices[i] = m;\n prevDim = dim;\n dim = size.length - 1;\n\n // verify whether each of the matrices has the same number of dimensions\n if (i > 0 && dim !== prevDim) {\n throw new DimensionError(prevDim + 1, dim + 1);\n }\n }\n }\n if (matrices.length === 0) {\n throw new SyntaxError('At least one matrix expected');\n }\n var res = matrices.shift();\n while (matrices.length) {\n res = _concat(res, matrices.shift(), dim);\n }\n return asMatrix ? matrix(res) : res;\n },\n '...string': function string(args) {\n return args.join('');\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { validateIndex } from '../../utils/array.js';\nvar name = 'column';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\nexport var createColumn = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n /**\n * Return a column from a Matrix.\n *\n * Syntax:\n *\n * math.column(value, index)\n *\n * Example:\n *\n * // get a column\n * const d = [[1, 2], [3, 4]]\n * math.column(d, 1) // returns [[2], [4]]\n *\n * See also:\n *\n * row\n *\n * @param {Array | Matrix } value An array or matrix\n * @param {number} column The index of the column\n * @return {Array | Matrix} The retrieved column\n */\n return typed(name, {\n 'Matrix, number': _column,\n 'Array, number': function ArrayNumber(value, column) {\n return _column(matrix(clone(value)), column).valueOf();\n }\n });\n\n /**\n * Retrieve a column of a matrix\n * @param {Matrix } value A matrix\n * @param {number} column The index of the column\n * @return {Matrix} The retrieved column\n */\n function _column(value, column) {\n // check dimensions\n if (value.size().length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n validateIndex(column, value.size()[1]);\n var rowRange = range(0, value.size()[0]);\n var index = new Index(rowRange, column);\n var result = value.subset(index);\n return isMatrix(result) ? result : matrix([[result]]);\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'count';\nvar dependencies = ['typed', 'size', 'prod'];\nexport var createCount = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n prod\n } = _ref;\n /**\n * Count the number of elements of a matrix, array or string.\n *\n * Syntax:\n *\n * math.count(x)\n *\n * Examples:\n *\n * math.count('hello world') // returns 11\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.count(A) // returns 6\n * math.count(math.range(1,6)) // returns 5\n *\n * See also:\n *\n * size\n *\n * @param {string | Array | Matrix} x A matrix or string\n * @return {number} An integer with the elements in `x`.\n */\n return typed(name, {\n string: function string(x) {\n return x.length;\n },\n 'Matrix | Array': function MatrixArray(x) {\n return prod(size(x));\n }\n });\n});", "import { arraySize, squeeze } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'cross';\nvar dependencies = ['typed', 'matrix', 'subtract', 'multiply'];\nexport var createCross = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n multiply\n } = _ref;\n /**\n * Calculate the cross product for two vectors in three dimensional space.\n * The cross product of `A = [a1, a2, a3]` and `B = [b1, b2, b3]` is defined\n * as:\n *\n * cross(A, B) = [\n * a2 * b3 - a3 * b2,\n * a3 * b1 - a1 * b3,\n * a1 * b2 - a2 * b1\n * ]\n *\n * If one of the input vectors has a dimension greater than 1, the output\n * vector will be a 1x3 (2-dimensional) matrix.\n *\n * Syntax:\n *\n * math.cross(x, y)\n *\n * Examples:\n *\n * math.cross([1, 1, 0], [0, 1, 1]) // Returns [1, -1, 1]\n * math.cross([3, -3, 1], [4, 9, 2]) // Returns [-15, -2, 39]\n * math.cross([2, 3, 4], [5, 6, 7]) // Returns [-3, 6, -3]\n * math.cross([[1, 2, 3]], [[4], [5], [6]]) // Returns [[-3, 6, -3]]\n *\n * See also:\n *\n * dot, multiply\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {Array | Matrix} Returns the cross product of `x` and `y`\n */\n return typed(name, {\n 'Matrix, Matrix': function MatrixMatrix(x, y) {\n return matrix(_cross(x.toArray(), y.toArray()));\n },\n 'Matrix, Array': function MatrixArray(x, y) {\n return matrix(_cross(x.toArray(), y));\n },\n 'Array, Matrix': function ArrayMatrix(x, y) {\n return matrix(_cross(x, y.toArray()));\n },\n 'Array, Array': _cross\n });\n\n /**\n * Calculate the cross product for two arrays\n * @param {Array} x First vector\n * @param {Array} y Second vector\n * @returns {Array} Returns the cross product of x and y\n * @private\n */\n function _cross(x, y) {\n var highestDimension = Math.max(arraySize(x).length, arraySize(y).length);\n x = squeeze(x);\n y = squeeze(y);\n var xSize = arraySize(x);\n var ySize = arraySize(y);\n if (xSize.length !== 1 || ySize.length !== 1 || xSize[0] !== 3 || ySize[0] !== 3) {\n throw new RangeError('Vectors with length 3 expected ' + '(Size A = [' + xSize.join(', ') + '], B = [' + ySize.join(', ') + '])');\n }\n var product = [subtract(multiply(x[1], y[2]), multiply(x[2], y[1])), subtract(multiply(x[2], y[0]), multiply(x[0], y[2])), subtract(multiply(x[0], y[1]), multiply(x[1], y[0]))];\n if (highestDimension > 1) {\n return [product];\n } else {\n return product;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'diag';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'SparseMatrix'];\nexport var createDiag = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a diagonal matrix or retrieve the diagonal of a matrix\n *\n * When `x` is a vector, a matrix with vector `x` on the diagonal will be returned.\n * When `x` is a two dimensional matrix, the matrixes `k`th diagonal will be returned as vector.\n * When k is positive, the values are placed on the super diagonal.\n * When k is negative, the values are placed on the sub diagonal.\n *\n * Syntax:\n *\n * math.diag(X)\n * math.diag(X, format)\n * math.diag(X, k)\n * math.diag(X, k, format)\n *\n * Examples:\n *\n * // create a diagonal matrix\n * math.diag([1, 2, 3]) // returns [[1, 0, 0], [0, 2, 0], [0, 0, 3]]\n * math.diag([1, 2, 3], 1) // returns [[0, 1, 0, 0], [0, 0, 2, 0], [0, 0, 0, 3]]\n * math.diag([1, 2, 3], -1) // returns [[0, 0, 0], [1, 0, 0], [0, 2, 0], [0, 0, 3]]\n *\n * // retrieve the diagonal from a matrix\n * const a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\n * math.diag(a) // returns [1, 5, 9]\n *\n * See also:\n *\n * ones, zeros, identity\n *\n * @param {Matrix | Array} x A two dimensional matrix or a vector\n * @param {number | BigNumber} [k=0] The diagonal where the vector will be filled\n * in or retrieved.\n * @param {string} [format='dense'] The matrix storage format.\n *\n * @returns {Matrix | Array} Diagonal matrix from input vector, or diagonal from input matrix.\n */\n return typed(name, {\n // FIXME: simplify this huge amount of signatures as soon as typed-function supports optional arguments\n\n Array: function Array(x) {\n return _diag(x, 0, arraySize(x), null);\n },\n 'Array, number': function ArrayNumber(x, k) {\n return _diag(x, k, arraySize(x), null);\n },\n 'Array, BigNumber': function ArrayBigNumber(x, k) {\n return _diag(x, k.toNumber(), arraySize(x), null);\n },\n 'Array, string': function ArrayString(x, format) {\n return _diag(x, 0, arraySize(x), format);\n },\n 'Array, number, string': function ArrayNumberString(x, k, format) {\n return _diag(x, k, arraySize(x), format);\n },\n 'Array, BigNumber, string': function ArrayBigNumberString(x, k, format) {\n return _diag(x, k.toNumber(), arraySize(x), format);\n },\n Matrix: function Matrix(x) {\n return _diag(x, 0, x.size(), x.storage());\n },\n 'Matrix, number': function MatrixNumber(x, k) {\n return _diag(x, k, x.size(), x.storage());\n },\n 'Matrix, BigNumber': function MatrixBigNumber(x, k) {\n return _diag(x, k.toNumber(), x.size(), x.storage());\n },\n 'Matrix, string': function MatrixString(x, format) {\n return _diag(x, 0, x.size(), format);\n },\n 'Matrix, number, string': function MatrixNumberString(x, k, format) {\n return _diag(x, k, x.size(), format);\n },\n 'Matrix, BigNumber, string': function MatrixBigNumberString(x, k, format) {\n return _diag(x, k.toNumber(), x.size(), format);\n }\n });\n\n /**\n * Creeate diagonal matrix from a vector or vice versa\n * @param {Array | Matrix} x\n * @param {number} k\n * @param {string} format Storage format for matrix. If null,\n * an Array is returned\n * @returns {Array | Matrix}\n * @private\n */\n function _diag(x, k, size, format) {\n if (!isInteger(k)) {\n throw new TypeError('Second parameter in function diag must be an integer');\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // check dimensions\n switch (size.length) {\n case 1:\n return _createDiagonalMatrix(x, k, format, size[0], kSub, kSuper);\n case 2:\n return _getDiagonal(x, k, format, size, kSub, kSuper);\n }\n throw new RangeError('Matrix for function diag must be 2 dimensional');\n }\n function _createDiagonalMatrix(x, k, format, l, kSub, kSuper) {\n // matrix size\n var ms = [l + kSub, l + kSuper];\n if (format && format !== 'sparse' && format !== 'dense') {\n throw new TypeError(\"Unknown matrix type \".concat(format, \"\\\"\"));\n }\n\n // create diagonal matrix\n var m = format === 'sparse' ? SparseMatrix.diagonal(ms, x, k) : DenseMatrix.diagonal(ms, x, k);\n // check we need to return a matrix\n return format !== null ? m : m.valueOf();\n }\n function _getDiagonal(x, k, format, s, kSub, kSuper) {\n // check x is a Matrix\n if (isMatrix(x)) {\n // get diagonal matrix\n var dm = x.diagonal(k);\n // check we need to return a matrix\n if (format !== null) {\n // check we need to change matrix format\n if (format !== dm.storage()) {\n return matrix(dm, format);\n }\n return dm;\n }\n return dm.valueOf();\n }\n // vector size\n var n = Math.min(s[0] - kSub, s[1] - kSuper);\n // diagonal values\n var vector = [];\n // loop diagonal\n for (var i = 0; i < n; i++) {\n vector[i] = x[i + kSub][i + kSuper];\n }\n // check we need to return a matrix\n return format !== null ? matrix(vector) : vector;\n }\n});", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { filter, filterRegExp } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'filter';\nvar dependencies = ['typed'];\nexport var createFilter = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Filter the items in an array or one dimensional matrix.\n *\n * Syntax:\n *\n * math.filter(x, test)\n *\n * Examples:\n *\n * function isPositive (x) {\n * return x > 0\n * }\n * math.filter([6, -2, -1, 4, 3], isPositive) // returns [6, 4, 3]\n *\n * math.filter([\"23\", \"foo\", \"100\", \"55\", \"bar\"], /[0-9]+/) // returns [\"23\", \"100\", \"55\"]\n *\n * See also:\n *\n * forEach, map, sort\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to filter\n * @param {Function | RegExp} test\n * A function or regular expression to test items.\n * All entries for which `test` returns true are returned.\n * When `test` is a function, it is invoked with three parameters:\n * the value of the element, the index of the element, and the\n * matrix/array being traversed. The function must return a boolean.\n * @return {Matrix | Array} Returns the filtered matrix.\n */\n return typed('filter', {\n 'Array, function': _filterCallback,\n 'Matrix, function': function MatrixFunction(x, test) {\n return x.create(_filterCallback(x.toArray(), test));\n },\n 'Array, RegExp': filterRegExp,\n 'Matrix, RegExp': function MatrixRegExp(x, test) {\n return x.create(filterRegExp(x.toArray(), test));\n }\n });\n});\n\n/**\n * Filter values in a callback given a callback function\n * @param {Array} x\n * @param {Function} callback\n * @return {Array} Returns the filtered array\n * @private\n */\nfunction _filterCallback(x, callback) {\n return filter(x, function (value, index, array) {\n // invoke the callback function with the right number of arguments\n return applyCallback(callback, value, [index], array, 'filter');\n });\n}", "import typed from 'typed-function';\nimport { typeOf as _typeOf } from './is.js';\n\n/**\n * Invoke a callback for functions like map and filter with a matching number of arguments\n * @param {function} callback\n * @param {any} value\n * @param {number | number[]} index\n * @param {Array} array\n * @param {string} mappingFnName The name of the function that is invoking these callbacks, for example \"map\" or \"filter\"\n * @returns {*}\n */\nexport function applyCallback(callback, value, index, array, mappingFnName) {\n if (typed.isTypedFunction(callback)) {\n // invoke the typed callback function with the matching number of arguments only\n\n var args3 = [value, index, array];\n var signature3 = typed.resolve(callback, args3);\n if (signature3) {\n return tryWithArgs(signature3.implementation, args3);\n }\n var args2 = [value, index];\n var signature2 = typed.resolve(callback, args2);\n if (signature2) {\n return tryWithArgs(signature2.implementation, args2);\n }\n var args1 = [value];\n var signature1 = typed.resolve(callback, args1);\n if (signature1) {\n return tryWithArgs(signature1.implementation, args1);\n }\n\n // fallback (will throw an exception)\n return tryWithArgs(callback, args3);\n } else {\n // A regular JavaScript function\n return callback(value, index, array);\n }\n\n /**\n * @param {function} signature The selected signature of the typed-function\n * @param {Array} args List with arguments to apply to the selected signature\n * @returns {*} Returns the return value of the invoked signature\n * @throws {TypeError} Throws an error when no matching signature was found\n */\n function tryWithArgs(signature, args) {\n try {\n return signature.apply(signature, args);\n } catch (err) {\n var _err$data;\n // Enrich the error message so the user understands that it took place inside the callback function\n if (err instanceof TypeError && ((_err$data = err.data) === null || _err$data === void 0 ? void 0 : _err$data.category) === 'wrongType') {\n var argsDesc = [];\n argsDesc.push(\"value: \".concat(_typeOf(value)));\n if (args.length >= 2) {\n argsDesc.push(\"index: \".concat(_typeOf(index)));\n }\n if (args.length >= 3) {\n argsDesc.push(\"array: \".concat(_typeOf(array)));\n }\n throw new TypeError(\"Function \".concat(mappingFnName, \" cannot apply callback arguments \") + \"\".concat(callback.name, \"(\").concat(argsDesc.join(', '), \") at index \").concat(JSON.stringify(index)));\n } else {\n throw new TypeError(\"Function \".concat(mappingFnName, \" cannot apply callback arguments \") + \"to function \".concat(callback.name, \": \").concat(err.message));\n }\n }\n }\n}", "import { flatten as flattenArray } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'flatten';\nvar dependencies = ['typed', 'matrix'];\nexport var createFlatten = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix\n } = _ref;\n /**\n * Flatten a multidimensional matrix into a single dimensional matrix.\n * A new matrix is returned, the original matrix is left untouched.\n *\n * Syntax:\n *\n * math.flatten(x)\n *\n * Examples:\n *\n * math.flatten([[1,2], [3,4]]) // returns [1, 2, 3, 4]\n *\n * See also:\n *\n * concat, resize, size, squeeze\n *\n * @param {Matrix | Array} x Matrix to be flattened\n * @return {Matrix | Array} Returns the flattened matrix\n */\n return typed(name, {\n Array: function Array(x) {\n return flattenArray(x);\n },\n Matrix: function Matrix(x) {\n var flat = flattenArray(x.toArray());\n // TODO: return the same matrix type as x (Dense or Sparse Matrix)\n return matrix(flat);\n }\n });\n});", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { forEach as forEachArray } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'forEach';\nvar dependencies = ['typed'];\nexport var createForEach = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterate over all elements of a matrix/array, and executes the given callback function.\n *\n * Syntax:\n *\n * math.forEach(x, callback)\n *\n * Examples:\n *\n * math.forEach([1, 2, 3], function(value) {\n * console.log(value)\n * })\n * // outputs 1, 2, 3\n *\n * See also:\n *\n * filter, map, sort\n *\n * @param {Matrix | Array} x The matrix to iterate on.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix/array being traversed.\n */\n return typed(name, {\n 'Array, function': _forEach,\n 'Matrix, function': function MatrixFunction(x, callback) {\n x.forEach(callback);\n }\n });\n});\n\n/**\n * forEach for a multidimensional array\n * @param {Array} array\n * @param {Function} callback\n * @private\n */\nfunction _forEach(array, callback) {\n var recurse = function recurse(value, index) {\n if (Array.isArray(value)) {\n forEachArray(value, function (child, i) {\n // we create a copy of the index array and append the new index value\n recurse(child, index.concat(i));\n });\n } else {\n // invoke the callback function with the right number of arguments\n return applyCallback(callback, value, index, array, 'forEach');\n }\n };\n recurse(array, []);\n}", "import { factory } from '../../utils/factory.js';\nimport { getArrayDataType } from '../../utils/array.js';\nimport { typeOf } from '../../utils/is.js';\nvar name = 'getMatrixDataType';\nvar dependencies = ['typed'];\nexport var createGetMatrixDataType = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Find the data type of all elements in a matrix or array,\n * for example 'number' if all items are a number and 'Complex' if all values\n * are complex numbers.\n * If a matrix contains more than one data type, it will return 'mixed'.\n *\n * Syntax:\n *\n * math.getMatrixDataType(x)\n *\n * Examples:\n *\n * const x = [ [1, 2, 3], [4, 5, 6] ]\n * const mixedX = [ [1, true], [2, 3] ]\n * const fractionX = [ [math.fraction(1, 3)], [math.fraction(1, 3)] ]\n * const unitX = [ [math.unit('5cm')], [math.unit('5cm')] ]\n * const bigNumberX = [ [math.bignumber(1)], [math.bignumber(0)] ]\n * const sparse = math.sparse(x)\n * const dense = math.matrix(x)\n * math.getMatrixDataType(x) // returns 'number'\n * math.getMatrixDataType(sparse) // returns 'number'\n * math.getMatrixDataType(dense) // returns 'number'\n * math.getMatrixDataType(mixedX) // returns 'mixed'\n * math.getMatrixDataType(fractionX) // returns 'Fraction'\n * math.getMatrixDataType(unitX) // returns 'Unit'\n * math.getMatrixDataType(bigNumberX) // return 'BigNumber'\n *\n * See also:\n * SparseMatrix, DenseMatrix\n *\n * @param {...Matrix | Array} x The Matrix with values.\n *\n * @return {string} A string representation of the matrix type\n */\n return typed(name, {\n Array: function Array(x) {\n return getArrayDataType(x, typeOf);\n },\n Matrix: function Matrix(x) {\n return x.getDataType();\n }\n });\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { resize } from '../../utils/array.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'identity';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix'];\nexport var createIdentity = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a 2-dimensional identity matrix with size m x n or n x n.\n * The matrix has ones on the diagonal and zeros elsewhere.\n *\n * Syntax:\n *\n * math.identity(n)\n * math.identity(n, format)\n * math.identity(m, n)\n * math.identity(m, n, format)\n * math.identity([m, n])\n * math.identity([m, n], format)\n *\n * Examples:\n *\n * math.identity(3) // returns [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\n * math.identity(3, 2) // returns [[1, 0], [0, 1], [0, 0]]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.identity(math.size(A)) // returns [[1, 0, 0], [0, 1, 0]]\n *\n * See also:\n *\n * diag, ones, zeros, size, range\n *\n * @param {...number | Matrix | Array} size The size for the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Matrix | Array | number} A matrix with ones on the diagonal.\n */\n return typed(name, {\n '': function _() {\n return config.matrix === 'Matrix' ? matrix([]) : [];\n },\n string: function string(format) {\n return matrix(format);\n },\n 'number | BigNumber': function numberBigNumber(rows) {\n return _identity(rows, rows, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber, string': function numberBigNumberString(rows, format) {\n return _identity(rows, rows, format);\n },\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(rows, cols) {\n return _identity(rows, cols, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber, number | BigNumber, string': function numberBigNumberNumberBigNumberString(rows, cols, format) {\n return _identity(rows, cols, format);\n },\n Array: function Array(size) {\n return _identityVector(size);\n },\n 'Array, string': function ArrayString(size, format) {\n return _identityVector(size, format);\n },\n Matrix: function Matrix(size) {\n return _identityVector(size.valueOf(), size.storage());\n },\n 'Matrix, string': function MatrixString(size, format) {\n return _identityVector(size.valueOf(), format);\n }\n });\n function _identityVector(size, format) {\n switch (size.length) {\n case 0:\n return format ? matrix(format) : [];\n case 1:\n return _identity(size[0], size[0], format);\n case 2:\n return _identity(size[0], size[1], format);\n default:\n throw new Error('Vector containing two values expected');\n }\n }\n\n /**\n * Create an identity matrix\n * @param {number | BigNumber} rows\n * @param {number | BigNumber} cols\n * @param {string} [format]\n * @returns {Matrix}\n * @private\n */\n function _identity(rows, cols, format) {\n // BigNumber constructor with the right precision\n var Big = isBigNumber(rows) || isBigNumber(cols) ? BigNumber : null;\n if (isBigNumber(rows)) rows = rows.toNumber();\n if (isBigNumber(cols)) cols = cols.toNumber();\n if (!isInteger(rows) || rows < 1) {\n throw new Error('Parameters in function identity must be positive integers');\n }\n if (!isInteger(cols) || cols < 1) {\n throw new Error('Parameters in function identity must be positive integers');\n }\n var one = Big ? new BigNumber(1) : 1;\n var defaultValue = Big ? new Big(0) : 0;\n var size = [rows, cols];\n\n // check we need to return a matrix\n if (format) {\n // create diagonal matrix (use optimized implementation for storage format)\n if (format === 'sparse') {\n return SparseMatrix.diagonal(size, one, 0, defaultValue);\n }\n if (format === 'dense') {\n return DenseMatrix.diagonal(size, one, 0, defaultValue);\n }\n throw new TypeError(\"Unknown matrix type \\\"\".concat(format, \"\\\"\"));\n }\n\n // create and resize array\n var res = resize([], size, defaultValue);\n // fill in ones on the diagonal\n var minimum = rows < cols ? rows : cols;\n // fill diagonal\n for (var d = 0; d < minimum; d++) {\n res[d][d] = one;\n }\n return res;\n }\n});", "import { arraySize as size } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'kron';\nvar dependencies = ['typed', 'matrix', 'multiplyScalar'];\nexport var createKron = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n multiplyScalar\n } = _ref;\n /**\n * Calculates the kronecker product of 2 matrices or vectors.\n *\n * NOTE: If a one dimensional vector / matrix is given, it will be\n * wrapped so its two dimensions.\n * See the examples.\n *\n * Syntax:\n *\n * math.kron(x, y)\n *\n * Examples:\n *\n * math.kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])\n * // returns [ [ 1, 2, 0, 0 ], [ 3, 4, 0, 0 ], [ 0, 0, 1, 2 ], [ 0, 0, 3, 4 ] ]\n *\n * math.kron([1,1], [2,3,4])\n * // returns [ [ 2, 3, 4, 2, 3, 4 ] ]\n *\n * See also:\n *\n * multiply, dot, cross\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {Array | Matrix} Returns the kronecker product of `x` and `y`\n */\n return typed(name, {\n 'Matrix, Matrix': function MatrixMatrix(x, y) {\n return matrix(_kron(x.toArray(), y.toArray()));\n },\n 'Matrix, Array': function MatrixArray(x, y) {\n return matrix(_kron(x.toArray(), y));\n },\n 'Array, Matrix': function ArrayMatrix(x, y) {\n return matrix(_kron(x, y.toArray()));\n },\n 'Array, Array': _kron\n });\n\n /**\n * Calculate the kronecker product of two matrices / vectors\n * @param {Array} a First vector\n * @param {Array} b Second vector\n * @returns {Array} Returns the kronecker product of x and y\n * @private\n */\n function _kron(a, b) {\n // Deal with the dimensions of the matricies.\n if (size(a).length === 1) {\n // Wrap it in a 2D Matrix\n a = [a];\n }\n if (size(b).length === 1) {\n // Wrap it in a 2D Matrix\n b = [b];\n }\n if (size(a).length > 2 || size(b).length > 2) {\n throw new RangeError('Vectors with dimensions greater then 2 are not supported expected ' + '(Size x = ' + JSON.stringify(a.length) + ', y = ' + JSON.stringify(b.length) + ')');\n }\n var t = [];\n var r = [];\n return a.map(function (a) {\n return b.map(function (b) {\n r = [];\n t.push(r);\n return a.map(function (y) {\n return b.map(function (x) {\n return r.push(multiplyScalar(y, x));\n });\n });\n });\n }) && t;\n }\n});", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'map';\nvar dependencies = ['typed'];\nexport var createMap = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a new matrix or array with the results of a callback function executed on\n * each entry of a given matrix/array.\n *\n * For each entry of the input, the callback is invoked with three arguments:\n * the value of the entry, the index at which that entry occurs, and the full\n * matrix/array being traversed. Note that because the matrix/array might be\n * multidimensional, the \"index\" argument is always an array of numbers giving\n * the index in each dimension. This is true even for vectors: the \"index\"\n * argument is an array of length 1, rather than simply a number.\n *\n * Syntax:\n *\n * math.map(x, callback)\n *\n * Examples:\n *\n * math.map([1, 2, 3], function(value) {\n * return value * value\n * }) // returns [1, 4, 9]\n *\n * // The callback is normally called with three arguments:\n * // callback(value, index, Array)\n * // If you want to call with only one argument, use:\n * math.map([1, 2, 3], x => math.format(x)) // returns ['1', '2', '3']\n *\n * See also:\n *\n * filter, forEach, sort\n *\n * @param {Matrix | Array} x The input to iterate on.\n * @param {Function} callback\n * The function to call (as described above) on each entry of the input\n * @return {Matrix | array}\n * Transformed map of x; always has the same type and shape as x\n */\n return typed(name, {\n 'Array, function': _map,\n 'Matrix, function': function MatrixFunction(x, callback) {\n return x.map(callback);\n }\n });\n});\n\n/**\n * Map for a multi dimensional array\n * @param {Array} array\n * @param {Function} callback\n * @return {Array}\n * @private\n */\nfunction _map(array, callback) {\n var recurse = function recurse(value, index) {\n if (Array.isArray(value)) {\n return value.map(function (child, i) {\n // we create a copy of the index array and append the new index value\n return recurse(child, index.concat(i));\n });\n } else {\n // invoke the callback function with the right number of arguments\n return applyCallback(callback, value, index, array, 'map');\n }\n };\n return recurse(array, []);\n}", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'diff';\nvar dependencies = ['typed', 'matrix', 'subtract', 'number'];\nexport var createDiff = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n number\n } = _ref;\n /**\n * Create a new matrix or array of the difference between elements of the given array\n * The optional dim parameter lets you specify the dimension to evaluate the difference of\n * If no dimension parameter is passed it is assumed as dimension 0\n *\n * Dimension is zero-based in javascript and one-based in the parser and can be a number or bignumber\n * Arrays must be 'rectangular' meaning arrays like [1, 2]\n * If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays\n *\n * Syntax:\n *\n * math.diff(arr)\n * math.diff(arr, dim)\n *\n * Examples:\n *\n * const arr = [1, 2, 4, 7, 0]\n * math.diff(arr) // returns [1, 2, 3, -7] (no dimension passed so 0 is assumed)\n * math.diff(math.matrix(arr)) // returns Matrix [1, 2, 3, -7]\n *\n * const arr = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [9, 8, 7, 6, 4]]\n * math.diff(arr) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]]\n * math.diff(arr, 0) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]]\n * math.diff(arr, 1) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]]\n * math.diff(arr, math.bignumber(1)) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]]\n *\n * math.diff(arr, 2) // throws RangeError as arr is 2 dimensional not 3\n * math.diff(arr, -1) // throws RangeError as negative dimensions are not allowed\n *\n * // These will all produce the same result\n * math.diff([[1, 2], [3, 4]])\n * math.diff([math.matrix([1, 2]), math.matrix([3, 4])])\n * math.diff([[1, 2], math.matrix([3, 4])])\n * math.diff([math.matrix([1, 2]), [3, 4]])\n * // They do not produce the same result as math.diff(math.matrix([[1, 2], [3, 4]])) as this returns a matrix\n *\n * See Also:\n *\n * sum\n * subtract\n * partitionSelect\n *\n * @param {Array | Matrix} arr An array or matrix\n * @param {number | BigNumber} dim Dimension\n * @return {Array | Matrix} Difference between array elements in given dimension\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(arr) {\n // No dimension specified => assume dimension 0\n if (isMatrix(arr)) {\n return matrix(_diff(arr.toArray()));\n } else {\n return _diff(arr);\n }\n },\n 'Array | Matrix, number': function ArrayMatrixNumber(arr, dim) {\n if (!isInteger(dim)) throw new RangeError('Dimension must be a whole number');\n if (isMatrix(arr)) {\n return matrix(_recursive(arr.toArray(), dim));\n } else {\n return _recursive(arr, dim);\n }\n },\n 'Array, BigNumber': typed.referTo('Array,number', selfAn => (arr, dim) => selfAn(arr, number(dim))),\n 'Matrix, BigNumber': typed.referTo('Matrix,number', selfMn => (arr, dim) => selfMn(arr, number(dim)))\n });\n\n /**\n * Recursively find the correct dimension in the array/matrix\n * Then Apply _diff to that dimension\n *\n * @param {Array} arr The array\n * @param {number} dim Dimension\n * @return {Array} resulting array\n */\n function _recursive(arr, dim) {\n if (isMatrix(arr)) {\n arr = arr.toArray(); // Makes sure arrays like [ matrix([0, 1]), matrix([1, 0]) ] are processed properly\n }\n if (!Array.isArray(arr)) {\n throw RangeError('Array/Matrix does not have that many dimensions');\n }\n if (dim > 0) {\n var result = [];\n arr.forEach(element => {\n result.push(_recursive(element, dim - 1));\n });\n return result;\n } else if (dim === 0) {\n return _diff(arr);\n } else {\n throw RangeError('Cannot have negative dimension');\n }\n }\n\n /**\n * Difference between elements in the array\n *\n * @param {Array} arr An array\n * @return {Array} resulting array\n */\n function _diff(arr) {\n var result = [];\n var size = arr.length;\n for (var i = 1; i < size; i++) {\n result.push(_ElementDiff(arr[i - 1], arr[i]));\n }\n return result;\n }\n\n /**\n * Difference between 2 objects\n *\n * @param {Object} obj1 First object\n * @param {Object} obj2 Second object\n * @return {Array} resulting array\n */\n function _ElementDiff(obj1, obj2) {\n // Convert matrices to arrays\n if (isMatrix(obj1)) obj1 = obj1.toArray();\n if (isMatrix(obj2)) obj2 = obj2.toArray();\n var obj1IsArray = Array.isArray(obj1);\n var obj2IsArray = Array.isArray(obj2);\n if (obj1IsArray && obj2IsArray) {\n return _ArrayDiff(obj1, obj2);\n }\n if (!obj1IsArray && !obj2IsArray) {\n return subtract(obj2, obj1); // Difference is (second - first) NOT (first - second)\n }\n throw TypeError('Cannot calculate difference between 1 array and 1 non-array');\n }\n\n /**\n * Difference of elements in 2 arrays\n *\n * @param {Array} arr1 Array 1\n * @param {Array} arr2 Array 2\n * @return {Array} resulting array\n */\n function _ArrayDiff(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n throw RangeError('Not all sub-arrays have the same length');\n }\n var result = [];\n var size = arr1.length;\n for (var i = 0; i < size; i++) {\n result.push(_ElementDiff(arr1[i], arr2[i]));\n }\n return result;\n }\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { resize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ones';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createOnes = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Create a matrix filled with ones. The created matrix can have one or\n * multiple dimensions.\n *\n * Syntax:\n *\n * math.ones(m)\n * math.ones(m, format)\n * math.ones(m, n)\n * math.ones(m, n, format)\n * math.ones([m, n])\n * math.ones([m, n], format)\n * math.ones([m, n, p, ...])\n * math.ones([m, n, p, ...], format)\n *\n * Examples:\n *\n * math.ones() // returns []\n * math.ones(3) // returns [1, 1, 1]\n * math.ones(3, 2) // returns [[1, 1], [1, 1], [1, 1]]\n * math.ones(3, 2, 'dense') // returns Dense Matrix [[1, 1], [1, 1], [1, 1]]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.ones(math.size(A)) // returns [[1, 1, 1], [1, 1, 1]]\n *\n * See also:\n *\n * zeros, identity, size, range\n *\n * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Array | Matrix | number} A matrix filled with ones\n */\n return typed('ones', {\n '': function _() {\n return config.matrix === 'Array' ? _ones([]) : _ones([], 'default');\n },\n // math.ones(m, n, p, ..., format)\n // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this\n '...number | BigNumber | string': function numberBigNumberString(size) {\n var last = size[size.length - 1];\n if (typeof last === 'string') {\n var format = size.pop();\n return _ones(size, format);\n } else if (config.matrix === 'Array') {\n return _ones(size);\n } else {\n return _ones(size, 'default');\n }\n },\n Array: _ones,\n Matrix: function Matrix(size) {\n var format = size.storage();\n return _ones(size.valueOf(), format);\n },\n 'Array | Matrix, string': function ArrayMatrixString(size, format) {\n return _ones(size.valueOf(), format);\n }\n });\n\n /**\n * Create an Array or Matrix with ones\n * @param {Array} size\n * @param {string} [format='default']\n * @return {Array | Matrix}\n * @private\n */\n function _ones(size, format) {\n var hasBigNumbers = _normalize(size);\n var defaultValue = hasBigNumbers ? new BigNumber(1) : 1;\n _validate(size);\n if (format) {\n // return a matrix\n var m = matrix(format);\n if (size.length > 0) {\n return m.resize(size, defaultValue);\n }\n return m;\n } else {\n // return an Array\n var arr = [];\n if (size.length > 0) {\n return resize(arr, size, defaultValue);\n }\n return arr;\n }\n }\n\n // replace BigNumbers with numbers, returns true if size contained BigNumbers\n function _normalize(size) {\n var hasBigNumbers = false;\n size.forEach(function (value, index, arr) {\n if (isBigNumber(value)) {\n hasBigNumbers = true;\n arr[index] = value.toNumber();\n }\n });\n return hasBigNumbers;\n }\n\n // validate arguments\n function _validate(size) {\n size.forEach(function (value) {\n if (typeof value !== 'number' || !isInteger(value) || value < 0) {\n throw new Error('Parameters in function ones must be positive integers');\n }\n });\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { noBignumber, noMatrix } from '../../utils/noop.js';\nvar name = 'range';\nvar dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive'];\nexport var createRange = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n } = _ref;\n /**\n * Create an array from a range.\n * By default, the range end is excluded. This can be customized by providing\n * an extra parameter `includeEnd`.\n *\n * Syntax:\n *\n * math.range(str [, includeEnd]) // Create a range from a string,\n * // where the string contains the\n * // start, optional step, and end,\n * // separated by a colon.\n * math.range(start, end [, includeEnd]) // Create a range with start and\n * // end and a step size of 1.\n * math.range(start, end, step [, includeEnd]) // Create a range with start, step,\n * // and end.\n *\n * Where:\n *\n * - `str: string`\n * A string 'start:end' or 'start:step:end'\n * - `start: {number | BigNumber | Unit}`\n * Start of the range\n * - `end: number | BigNumber | Unit`\n * End of the range, excluded by default, included when parameter includeEnd=true\n * - `step: number | BigNumber | Unit`\n * Step size. Default value is 1.\n * - `includeEnd: boolean`\n * Option to specify whether to include the end or not. False by default.\n *\n * Examples:\n *\n * math.range(2, 6) // [2, 3, 4, 5]\n * math.range(2, -3, -1) // [2, 1, 0, -1, -2]\n * math.range('2:1:6') // [2, 3, 4, 5]\n * math.range(2, 6, true) // [2, 3, 4, 5, 6]\n * math.range(math.unit(2, 'm'), math.unit(-3, 'm'), math.unit(-1, 'm')) // [2 m, 1 m, 0 m , -1 m, -2 m]\n *\n * See also:\n *\n * ones, zeros, size, subset\n *\n * @param {*} args Parameters describing the ranges `start`, `end`, and optional `step`.\n * @return {Array | Matrix} range\n */\n return typed(name, {\n // TODO: simplify signatures when typed-function supports default values and optional arguments\n\n // TODO: a number or boolean should not be converted to string here\n string: _strRange,\n 'string, boolean': _strRange,\n 'number, number': function numberNumber(start, end) {\n return _out(_range(start, end, 1, false));\n },\n 'number, number, number': function numberNumberNumber(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'number, number, boolean': function numberNumberBoolean(start, end, includeEnd) {\n return _out(_range(start, end, 1, includeEnd));\n },\n 'number, number, number, boolean': function numberNumberNumberBoolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(start, end) {\n var BigNumber = start.constructor;\n return _out(_range(start, end, new BigNumber(1), false));\n },\n 'BigNumber, BigNumber, BigNumber': function BigNumberBigNumberBigNumber(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'BigNumber, BigNumber, boolean': function BigNumberBigNumberBoolean(start, end, includeEnd) {\n var BigNumber = start.constructor;\n return _out(_range(start, end, new BigNumber(1), includeEnd));\n },\n 'BigNumber, BigNumber, BigNumber, boolean': function BigNumberBigNumberBigNumberBoolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n },\n 'Unit, Unit, Unit': function UnitUnitUnit(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'Unit, Unit, Unit, boolean': function UnitUnitUnitBoolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n }\n });\n function _out(arr) {\n if (config.matrix === 'Matrix') {\n return matrix ? matrix(arr) : noMatrix();\n }\n return arr;\n }\n function _strRange(str, includeEnd) {\n var r = _parse(str);\n if (!r) {\n throw new SyntaxError('String \"' + str + '\" is no valid range');\n }\n if (config.number === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return _out(_range(bignumber(r.start), bignumber(r.end), bignumber(r.step)), includeEnd);\n } else {\n return _out(_range(r.start, r.end, r.step, includeEnd));\n }\n }\n\n /**\n * Create a range with numbers or BigNumbers\n * @param {number | BigNumber | Unit} start\n * @param {number | BigNumber | Unit} end\n * @param {number | BigNumber | Unit} step\n * @param {boolean} includeEnd\n * @returns {Array} range\n * @private\n */\n function _range(start, end, step, includeEnd) {\n var array = [];\n var ongoing = isPositive(step) ? includeEnd ? smallerEq : smaller : includeEnd ? largerEq : larger;\n var x = start;\n while (ongoing(x, end)) {\n array.push(x);\n x = add(x, step);\n }\n return array;\n }\n\n /**\n * Parse a string into a range,\n * The string contains the start, optional step, and end, separated by a colon.\n * If the string does not contain a valid range, null is returned.\n * For example str='0:2:11'.\n * @param {string} str\n * @return {{start: number, end: number, step: number} | null} range Object containing properties start, end, step\n * @private\n */\n function _parse(str) {\n var args = str.split(':');\n\n // number\n var nums = args.map(function (arg) {\n // use Number and not parseFloat as Number returns NaN on invalid garbage in the string\n return Number(arg);\n });\n var invalid = nums.some(function (num) {\n return isNaN(num);\n });\n if (invalid) {\n return null;\n }\n switch (nums.length) {\n case 2:\n return {\n start: nums[0],\n end: nums[1],\n step: 1\n };\n case 3:\n return {\n start: nums[0],\n end: nums[2],\n step: nums[1]\n };\n default:\n return null;\n }\n }\n});", "export function noBignumber() {\n throw new Error('No \"bignumber\" implementation available');\n}\nexport function noFraction() {\n throw new Error('No \"fraction\" implementation available');\n}\nexport function noMatrix() {\n throw new Error('No \"matrix\" implementation available');\n}\nexport function noIndex() {\n throw new Error('No \"index\" implementation available');\n}\nexport function noSubset() {\n throw new Error('No \"matrix\" implementation available');\n}", "import { reshape as arrayReshape } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'reshape';\nvar dependencies = ['typed', 'isInteger', 'matrix'];\nexport var createReshape = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n /**\n * Reshape a multi dimensional array to fit the specified dimensions\n *\n * Syntax:\n *\n * math.reshape(x, sizes)\n *\n * Examples:\n *\n * math.reshape([1, 2, 3, 4, 5, 6], [2, 3])\n * // returns Array [[1, 2, 3], [4, 5, 6]]\n *\n * math.reshape([[1, 2], [3, 4]], [1, 4])\n * // returns Array [[1, 2, 3, 4]]\n *\n * math.reshape([[1, 2], [3, 4]], [4])\n * // returns Array [1, 2, 3, 4]\n *\n * const x = math.matrix([1, 2, 3, 4, 5, 6, 7, 8])\n * math.reshape(x, [2, 2, 2])\n * // returns Matrix [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\n *\n * math.reshape([1, 2, 3, 4], [-1, 2])\n * // returns Matrix [[1, 2], [3, 4]]\n *\n * See also:\n *\n * size, squeeze, resize\n *\n * @param {Array | Matrix | *} x Matrix to be reshaped\n * @param {number[]} sizes One dimensional array with integral sizes for\n * each dimension. One -1 is allowed as wildcard,\n * which calculates this dimension automatically.\n *\n * @return {* | Array | Matrix} A reshaped clone of matrix `x`\n *\n * @throws {TypeError} If `sizes` does not contain solely integers\n * @throws {DimensionError} If the product of the new dimension sizes does\n * not equal that of the old ones\n */\n return typed(name, {\n 'Matrix, Array': function MatrixArray(x, sizes) {\n return x.reshape(sizes, true);\n },\n 'Array, Array': function ArrayArray(x, sizes) {\n sizes.forEach(function (size) {\n if (!isInteger(size)) {\n throw new TypeError('Invalid size for dimension: ' + size);\n }\n });\n return arrayReshape(x, sizes);\n }\n });\n});", "import { isBigNumber, isMatrix } from '../../utils/is.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nimport { isInteger } from '../../utils/number.js';\nimport { format } from '../../utils/string.js';\nimport { clone } from '../../utils/object.js';\nimport { resize as arrayResize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'resize';\nvar dependencies = ['config', 'matrix'];\nexport var createResize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n matrix\n } = _ref;\n /**\n * Resize a matrix\n *\n * Syntax:\n *\n * math.resize(x, size)\n * math.resize(x, size, defaultValue)\n *\n * Examples:\n *\n * math.resize([1, 2, 3, 4, 5], [3]) // returns Array [1, 2, 3]\n * math.resize([1, 2, 3], [5], 0) // returns Array [1, 2, 3, 0, 0]\n * math.resize(2, [2, 3], 0) // returns Matrix [[2, 0, 0], [0, 0, 0]]\n * math.resize(\"hello\", [8], \"!\") // returns string 'hello!!!'\n *\n * See also:\n *\n * size, squeeze, subset, reshape\n *\n * @param {Array | Matrix | *} x Matrix to be resized\n * @param {Array | Matrix} size One dimensional array with numbers\n * @param {number | string} [defaultValue=0] Zero by default, except in\n * case of a string, in that case\n * defaultValue = ' '\n * @return {* | Array | Matrix} A resized clone of matrix `x`\n */\n // TODO: rework resize to a typed-function\n return function resize(x, size, defaultValue) {\n if (arguments.length !== 2 && arguments.length !== 3) {\n throw new ArgumentsError('resize', arguments.length, 2, 3);\n }\n if (isMatrix(size)) {\n size = size.valueOf(); // get Array\n }\n if (isBigNumber(size[0])) {\n // convert bignumbers to numbers\n size = size.map(function (value) {\n return !isBigNumber(value) ? value : value.toNumber();\n });\n }\n\n // check x is a Matrix\n if (isMatrix(x)) {\n // use optimized matrix implementation, return copy\n return x.resize(size, defaultValue, true);\n }\n if (typeof x === 'string') {\n // resize string\n return _resizeString(x, size, defaultValue);\n }\n\n // check result should be a matrix\n var asMatrix = Array.isArray(x) ? false : config.matrix !== 'Array';\n if (size.length === 0) {\n // output a scalar\n while (Array.isArray(x)) {\n x = x[0];\n }\n return clone(x);\n } else {\n // output an array/matrix\n if (!Array.isArray(x)) {\n x = [x];\n }\n x = clone(x);\n var res = arrayResize(x, size, defaultValue);\n return asMatrix ? matrix(res) : res;\n }\n };\n\n /**\n * Resize a string\n * @param {string} str\n * @param {number[]} size\n * @param {string} [defaultChar=' ']\n * @private\n */\n function _resizeString(str, size, defaultChar) {\n if (defaultChar !== undefined) {\n if (typeof defaultChar !== 'string' || defaultChar.length !== 1) {\n throw new TypeError('Single character expected as defaultValue');\n }\n } else {\n defaultChar = ' ';\n }\n if (size.length !== 1) {\n throw new DimensionError(size.length, 1);\n }\n var len = size[0];\n if (typeof len !== 'number' || !isInteger(len)) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(size) + ')');\n }\n if (str.length > len) {\n return str.substring(0, len);\n } else if (str.length < len) {\n var res = str;\n for (var i = 0, ii = len - str.length; i < ii; i++) {\n res += defaultChar;\n }\n return res;\n } else {\n return str;\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { arraySize } from '../../utils/array.js';\nvar name = 'rotate';\nvar dependencies = ['typed', 'multiply', 'rotationMatrix'];\nexport var createRotate = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n multiply,\n rotationMatrix\n } = _ref;\n /**\n * Rotate a vector of size 1x2 counter-clockwise by a given angle\n * Rotate a vector of size 1x3 counter-clockwise by a given angle around the given axis\n *\n * Syntax:\n *\n * math.rotate(w, theta)\n * math.rotate(w, theta, v)\n *\n * Examples:\n *\n * math.rotate([11, 12], math.pi / 2) // returns [-12, 11]\n * math.rotate(matrix([11, 12]), math.pi / 2) // returns [-12, 11]\n *\n * math.rotate([1, 0, 0], unit('90deg'), [0, 0, 1]) // returns [0, 1, 0]\n * math.rotate(matrix([1, 0, 0]), unit('90deg'), [0, 0, 1]) // returns Matrix [0, 1, 0]\n *\n * math.rotate([1, 0], math.complex(1 + i)) // returns [cos(1 + i) - sin(1 + i), sin(1 + i) + cos(1 + i)]\n *\n * See also:\n *\n * matrix, rotationMatrix\n *\n * @param {Array | Matrix} w Vector to rotate\n * @param {number | BigNumber | Complex | Unit} theta Rotation angle\n * @param {Array | Matrix} [v] Rotation axis\n * @return {Array | Matrix} Multiplication of the rotation matrix and w\n */\n return typed(name, {\n 'Array , number | BigNumber | Complex | Unit': function ArrayNumberBigNumberComplexUnit(w, theta) {\n _validateSize(w, 2);\n var matrixRes = multiply(rotationMatrix(theta), w);\n return matrixRes.toArray();\n },\n 'Matrix , number | BigNumber | Complex | Unit': function MatrixNumberBigNumberComplexUnit(w, theta) {\n _validateSize(w, 2);\n return multiply(rotationMatrix(theta), w);\n },\n 'Array, number | BigNumber | Complex | Unit, Array | Matrix': function ArrayNumberBigNumberComplexUnitArrayMatrix(w, theta, v) {\n _validateSize(w, 3);\n var matrixRes = multiply(rotationMatrix(theta, v), w);\n return matrixRes;\n },\n 'Matrix, number | BigNumber | Complex | Unit, Array | Matrix': function MatrixNumberBigNumberComplexUnitArrayMatrix(w, theta, v) {\n _validateSize(w, 3);\n return multiply(rotationMatrix(theta, v), w);\n }\n });\n function _validateSize(v, expectedSize) {\n var actualSize = Array.isArray(v) ? arraySize(v) : v.size();\n if (actualSize.length > 2) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n if (actualSize.length === 2 && actualSize[1] !== 1) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n if (actualSize[0] !== expectedSize) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n }\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'rotationMatrix';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'addScalar', 'unaryMinus', 'norm', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix', 'cos', 'sin'];\nexport var createRotationMatrix = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n addScalar,\n unaryMinus,\n norm,\n BigNumber,\n matrix,\n DenseMatrix,\n SparseMatrix,\n cos,\n sin\n } = _ref;\n /**\n * Create a 2-dimensional counter-clockwise rotation matrix (2x2) for a given angle (expressed in radians).\n * Create a 2-dimensional counter-clockwise rotation matrix (3x3) by a given angle (expressed in radians) around a given axis (1x3).\n *\n * Syntax:\n *\n * math.rotationMatrix(theta)\n * math.rotationMatrix(theta, format)\n * math.rotationMatrix(theta, [v])\n * math.rotationMatrix(theta, [v], format)\n *\n * Examples:\n *\n * math.rotationMatrix(math.pi / 2) // returns [[0, -1], [1, 0]]\n * math.rotationMatrix(math.bignumber(1)) // returns [[bignumber(cos(1)), bignumber(-sin(1))], [bignumber(sin(1)), bignumber(cos(1))]]\n * math.rotationMatrix(math.complex(1 + i)) // returns [[cos(1 + i), -sin(1 + i)], [sin(1 + i), cos(1 + i)]]\n * math.rotationMatrix(math.unit('1rad')) // returns [[cos(1), -sin(1)], [sin(1), cos(1)]]\n *\n * math.rotationMatrix(math.pi / 2, [0, 1, 0]) // returns [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]\n * math.rotationMatrix(math.pi / 2, matrix([0, 1, 0])) // returns matrix([[0, 0, 1], [0, 1, 0], [-1, 0, 0]])\n *\n *\n * See also:\n *\n * matrix, cos, sin\n *\n *\n * @param {number | BigNumber | Complex | Unit} theta Rotation angle\n * @param {Array | Matrix} [v] Rotation axis\n * @param {string} [format] Result Matrix storage format\n * @return {Array | Matrix} Rotation matrix\n */\n\n return typed(name, {\n '': function _() {\n return config.matrix === 'Matrix' ? matrix([]) : [];\n },\n string: function string(format) {\n return matrix(format);\n },\n 'number | BigNumber | Complex | Unit': function numberBigNumberComplexUnit(theta) {\n return _rotationMatrix2x2(theta, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber | Complex | Unit, string': function numberBigNumberComplexUnitString(theta, format) {\n return _rotationMatrix2x2(theta, format);\n },\n 'number | BigNumber | Complex | Unit, Array': function numberBigNumberComplexUnitArray(theta, v) {\n var matrixV = matrix(v);\n _validateVector(matrixV);\n return _rotationMatrix3x3(theta, matrixV, undefined);\n },\n 'number | BigNumber | Complex | Unit, Matrix': function numberBigNumberComplexUnitMatrix(theta, v) {\n _validateVector(v);\n var storageType = v.storage() || (config.matrix === 'Matrix' ? 'dense' : undefined);\n return _rotationMatrix3x3(theta, v, storageType);\n },\n 'number | BigNumber | Complex | Unit, Array, string': function numberBigNumberComplexUnitArrayString(theta, v, format) {\n var matrixV = matrix(v);\n _validateVector(matrixV);\n return _rotationMatrix3x3(theta, matrixV, format);\n },\n 'number | BigNumber | Complex | Unit, Matrix, string': function numberBigNumberComplexUnitMatrixString(theta, v, format) {\n _validateVector(v);\n return _rotationMatrix3x3(theta, v, format);\n }\n });\n\n /**\n * Returns 2x2 matrix of 2D rotation of angle theta\n *\n * @param {number | BigNumber | Complex | Unit} theta The rotation angle\n * @param {string} format The result Matrix storage format\n * @returns {Matrix}\n * @private\n */\n function _rotationMatrix2x2(theta, format) {\n var Big = isBigNumber(theta);\n var minusOne = Big ? new BigNumber(-1) : -1;\n var cosTheta = cos(theta);\n var sinTheta = sin(theta);\n var data = [[cosTheta, multiplyScalar(minusOne, sinTheta)], [sinTheta, cosTheta]];\n return _convertToFormat(data, format);\n }\n function _validateVector(v) {\n var size = v.size();\n if (size.length < 1 || size[0] !== 3) {\n throw new RangeError('Vector must be of dimensions 1x3');\n }\n }\n function _mul(array) {\n return array.reduce((p, curr) => multiplyScalar(p, curr));\n }\n function _convertToFormat(data, format) {\n if (format) {\n if (format === 'sparse') {\n return new SparseMatrix(data);\n }\n if (format === 'dense') {\n return new DenseMatrix(data);\n }\n throw new TypeError(\"Unknown matrix type \\\"\".concat(format, \"\\\"\"));\n }\n return data;\n }\n\n /**\n * Returns a 3x3 matrix of rotation of angle theta around vector v\n *\n * @param {number | BigNumber | Complex | Unit} theta The rotation angle\n * @param {Matrix} v The rotation axis vector\n * @param {string} format The storage format of the resulting matrix\n * @returns {Matrix}\n * @private\n */\n function _rotationMatrix3x3(theta, v, format) {\n var normV = norm(v);\n if (normV === 0) {\n throw new RangeError('Rotation around zero vector');\n }\n var Big = isBigNumber(theta) ? BigNumber : null;\n var one = Big ? new Big(1) : 1;\n var minusOne = Big ? new Big(-1) : -1;\n var vx = Big ? new Big(v.get([0]) / normV) : v.get([0]) / normV;\n var vy = Big ? new Big(v.get([1]) / normV) : v.get([1]) / normV;\n var vz = Big ? new Big(v.get([2]) / normV) : v.get([2]) / normV;\n var c = cos(theta);\n var oneMinusC = addScalar(one, unaryMinus(c));\n var s = sin(theta);\n var r11 = addScalar(c, _mul([vx, vx, oneMinusC]));\n var r12 = addScalar(_mul([vx, vy, oneMinusC]), _mul([minusOne, vz, s]));\n var r13 = addScalar(_mul([vx, vz, oneMinusC]), _mul([vy, s]));\n var r21 = addScalar(_mul([vx, vy, oneMinusC]), _mul([vz, s]));\n var r22 = addScalar(c, _mul([vy, vy, oneMinusC]));\n var r23 = addScalar(_mul([vy, vz, oneMinusC]), _mul([minusOne, vx, s]));\n var r31 = addScalar(_mul([vx, vz, oneMinusC]), _mul([minusOne, vy, s]));\n var r32 = addScalar(_mul([vy, vz, oneMinusC]), _mul([vx, s]));\n var r33 = addScalar(c, _mul([vz, vz, oneMinusC]));\n var data = [[r11, r12, r13], [r21, r22, r23], [r31, r32, r33]];\n return _convertToFormat(data, format);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { validateIndex } from '../../utils/array.js';\nvar name = 'row';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\nexport var createRow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n /**\n * Return a row from a Matrix.\n *\n * Syntax:\n *\n * math.row(value, index)\n *\n * Example:\n *\n * // get a row\n * const d = [[1, 2], [3, 4]]\n * math.row(d, 1) // returns [[3, 4]]\n *\n * See also:\n *\n * column\n *\n * @param {Array | Matrix } value An array or matrix\n * @param {number} row The index of the row\n * @return {Array | Matrix} The retrieved row\n */\n return typed(name, {\n 'Matrix, number': _row,\n 'Array, number': function ArrayNumber(value, row) {\n return _row(matrix(clone(value)), row).valueOf();\n }\n });\n\n /**\n * Retrieve a row of a matrix\n * @param {Matrix } value A matrix\n * @param {number} row The index of the row\n * @return {Matrix} The retrieved row\n */\n function _row(value, row) {\n // check dimensions\n if (value.size().length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n validateIndex(row, value.size()[0]);\n var columnRange = range(0, value.size()[1]);\n var index = new Index(row, columnRange);\n var result = value.subset(index);\n return isMatrix(result) ? result : matrix([[result]]);\n }\n});", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { noMatrix } from '../../utils/noop.js';\nvar name = 'size';\nvar dependencies = ['typed', 'config', '?matrix'];\nexport var createSize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix\n } = _ref;\n /**\n * Calculate the size of a matrix or scalar.\n *\n * Syntax:\n *\n * math.size(x)\n *\n * Examples:\n *\n * math.size(2.3) // returns []\n * math.size('hello world') // returns [11]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.size(A) // returns [2, 3]\n * math.size(math.range(1,6)) // returns [5]\n *\n * See also:\n *\n * count, resize, squeeze, subset\n *\n * @param {boolean | number | Complex | Unit | string | Array | Matrix} x A matrix\n * @return {Array | Matrix} A vector with size of `x`.\n */\n return typed(name, {\n Matrix: function Matrix(x) {\n return x.create(x.size());\n },\n Array: arraySize,\n string: function string(x) {\n return config.matrix === 'Array' ? [x.length] : matrix([x.length]);\n },\n 'number | Complex | BigNumber | Unit | boolean | null': function numberComplexBigNumberUnitBooleanNull(x) {\n // scalar\n return config.matrix === 'Array' ? [] : matrix ? matrix([]) : noMatrix();\n }\n });\n});", "import { clone } from '../../utils/object.js';\nimport { squeeze as arraySqueeze } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'squeeze';\nvar dependencies = ['typed', 'matrix'];\nexport var createSqueeze = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix\n } = _ref;\n /**\n * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix.\n *\n * Syntax:\n *\n * math.squeeze(x)\n *\n * Examples:\n *\n * math.squeeze([3]) // returns 3\n * math.squeeze([[3]]) // returns 3\n *\n * const A = math.zeros(3, 1) // returns [[0], [0], [0]] (size 3x1)\n * math.squeeze(A) // returns [0, 0, 0] (size 3)\n *\n * const B = math.zeros(1, 3) // returns [[0, 0, 0]] (size 1x3)\n * math.squeeze(B) // returns [0, 0, 0] (size 3)\n *\n * // only inner and outer dimensions are removed\n * const C = math.zeros(2, 1, 3) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3)\n * math.squeeze(C) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3)\n *\n * See also:\n *\n * subset\n *\n * @param {Matrix | Array} x Matrix to be squeezed\n * @return {Matrix | Array} Squeezed matrix\n */\n return typed(name, {\n Array: function Array(x) {\n return arraySqueeze(clone(x));\n },\n Matrix: function Matrix(x) {\n var res = arraySqueeze(x.toArray());\n // FIXME: return the same type of matrix as the input\n return Array.isArray(res) ? matrix(res) : res;\n },\n any: function any(x) {\n // scalar\n return clone(x);\n }\n });\n});", "import { isIndex } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { isEmptyIndex, validateIndex, validateIndexSourceSize } from '../../utils/array.js';\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'subset';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createSubset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n /**\n * Get or set a subset of a matrix or string.\n *\n * Syntax:\n * math.subset(value, index) // retrieve a subset\n * math.subset(value, index, replacement [, defaultValue]) // replace a subset\n *\n * Examples:\n *\n * // get a subset\n * const d = [[1, 2], [3, 4]]\n * math.subset(d, math.index(1, 0)) // returns 3\n * math.subset(d, math.index([0, 1], 1)) // returns [[2], [4]]\n * math.subset(d, math.index([false, true], 0)) // returns [[3]]\n *\n * // replace a subset\n * const e = []\n * const f = math.subset(e, math.index(0, [0, 2]), [5, 6]) // f = [[5, 0, 6]]\n * const g = math.subset(f, math.index(1, 1), 7, 0) // g = [[5, 0, 6], [0, 7, 0]]\n * math.subset(g, math.index([false, true], 1), 8) // returns [[5, 0, 6], [0, 8, 0]]\n *\n * // get submatrix using ranges\n * const M = [\n * [1,2,3],\n * [4,5,6],\n * [7,8,9]\n * ]\n * math.subset(M, math.index(math.range(0,2), math.range(0,3))) // [[1, 2, 3], [4, 5, 6]]\n *\n * See also:\n *\n * size, resize, squeeze, index\n *\n * @param {Array | Matrix | string} matrix An array, matrix, or string\n * @param {Index} index\n * For each dimension of the target, specifies an index or a list of\n * indices to fetch or set. `subset` uses the cartesian product of\n * the indices specified in each dimension.\n * @param {*} [replacement] An array, matrix, or scalar.\n * If provided, the subset is replaced with replacement.\n * If not provided, the subset is returned\n * @param {*} [defaultValue=undefined] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * math.matrix elements will be left undefined.\n * @return {Array | Matrix | string} Either the retrieved subset or the updated matrix.\n */\n\n return typed(name, {\n // get subset\n 'Matrix, Index': function MatrixIndex(value, index) {\n if (isEmptyIndex(index)) {\n return matrix();\n }\n validateIndexSourceSize(value, index);\n return value.subset(index);\n },\n 'Array, Index': typed.referTo('Matrix, Index', function (subsetRef) {\n return function (value, index) {\n var subsetResult = subsetRef(matrix(value), index);\n return index.isScalar() ? subsetResult : subsetResult.valueOf();\n };\n }),\n 'Object, Index': _getObjectProperty,\n 'string, Index': _getSubstring,\n // set subset\n 'Matrix, Index, any, any': function MatrixIndexAnyAny(value, index, replacement, defaultValue) {\n if (isEmptyIndex(index)) {\n return value;\n }\n validateIndexSourceSize(value, index);\n return value.clone().subset(index, _broadcastReplacement(replacement, index), defaultValue);\n },\n 'Array, Index, any, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement, defaultValue) {\n var subsetResult = subsetRef(matrix(value), index, replacement, defaultValue);\n return subsetResult.isMatrix ? subsetResult.valueOf() : subsetResult;\n };\n }),\n 'Array, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement) {\n return subsetRef(matrix(value), index, replacement, undefined).valueOf();\n };\n }),\n 'Matrix, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement) {\n return subsetRef(value, index, replacement, undefined);\n };\n }),\n 'string, Index, string': _setSubstring,\n 'string, Index, string, string': _setSubstring,\n 'Object, Index, any': _setObjectProperty\n });\n\n /**\n * Broadcasts a replacment value to be the same size as index\n * @param {number | BigNumber | Array | Matrix} replacement Replacement value to try to broadcast\n * @param {*} index Index value\n * @returns broadcasted replacement that matches the size of index\n */\n\n function _broadcastReplacement(replacement, index) {\n if (typeof replacement === 'string') {\n throw new Error('can\\'t boradcast a string');\n }\n if (index._isScalar) {\n return replacement;\n }\n var indexSize = index.size();\n if (indexSize.every(d => d > 0)) {\n try {\n return add(replacement, zeros(indexSize));\n } catch (error) {\n return replacement;\n }\n } else {\n return replacement;\n }\n }\n});\n\n/**\n * Retrieve a subset of a string\n * @param {string} str string from which to get a substring\n * @param {Index} index An index or list of indices (character positions)\n * @returns {string} substring\n * @private\n */\nfunction _getSubstring(str, index) {\n if (!isIndex(index)) {\n // TODO: better error message\n throw new TypeError('Index expected');\n }\n if (isEmptyIndex(index)) {\n return '';\n }\n validateIndexSourceSize(Array.from(str), index);\n if (index.size().length !== 1) {\n throw new DimensionError(index.size().length, 1);\n }\n\n // validate whether the range is out of range\n var strLen = str.length;\n validateIndex(index.min()[0], strLen);\n validateIndex(index.max()[0], strLen);\n var range = index.dimension(0);\n var substr = '';\n range.forEach(function (v) {\n substr += str.charAt(v);\n });\n return substr;\n}\n\n/**\n * Replace a substring in a string\n * @param {string} str string to be replaced\n * @param {Index} index An index or list of indices (character positions)\n * @param {string} replacement Replacement string\n * @param {string} [defaultValue] Default value to be used when resizing\n * the string. is ' ' by default\n * @returns {string} result\n * @private\n */\nfunction _setSubstring(str, index, replacement, defaultValue) {\n if (!index || index.isIndex !== true) {\n // TODO: better error message\n throw new TypeError('Index expected');\n }\n if (isEmptyIndex(index)) {\n return str;\n }\n validateIndexSourceSize(Array.from(str), index);\n if (index.size().length !== 1) {\n throw new DimensionError(index.size().length, 1);\n }\n if (defaultValue !== undefined) {\n if (typeof defaultValue !== 'string' || defaultValue.length !== 1) {\n throw new TypeError('Single character expected as defaultValue');\n }\n } else {\n defaultValue = ' ';\n }\n var range = index.dimension(0);\n var len = range.size()[0];\n if (len !== replacement.length) {\n throw new DimensionError(range.size()[0], replacement.length);\n }\n\n // validate whether the range is out of range\n var strLen = str.length;\n validateIndex(index.min()[0]);\n validateIndex(index.max()[0]);\n\n // copy the string into an array with characters\n var chars = [];\n for (var i = 0; i < strLen; i++) {\n chars[i] = str.charAt(i);\n }\n range.forEach(function (v, i) {\n chars[v] = replacement.charAt(i[0]);\n });\n\n // initialize undefined characters with a space\n if (chars.length > strLen) {\n for (var _i = strLen - 1, _len = chars.length; _i < _len; _i++) {\n if (!chars[_i]) {\n chars[_i] = defaultValue;\n }\n }\n }\n return chars.join('');\n}\n\n/**\n * Retrieve a property from an object\n * @param {Object} object\n * @param {Index} index\n * @return {*} Returns the value of the property\n * @private\n */\nfunction _getObjectProperty(object, index) {\n if (isEmptyIndex(index)) {\n return undefined;\n }\n if (index.size().length !== 1) {\n throw new DimensionError(index.size(), 1);\n }\n var key = index.dimension(0);\n if (typeof key !== 'string') {\n throw new TypeError('String expected as index to retrieve an object property');\n }\n return getSafeProperty(object, key);\n}\n\n/**\n * Set a property on an object\n * @param {Object} object\n * @param {Index} index\n * @param {*} replacement\n * @return {*} Returns the updated object\n * @private\n */\nfunction _setObjectProperty(object, index, replacement) {\n if (isEmptyIndex(index)) {\n return object;\n }\n if (index.size().length !== 1) {\n throw new DimensionError(index.size(), 1);\n }\n var key = index.dimension(0);\n if (typeof key !== 'string') {\n throw new TypeError('String expected as index to retrieve an object property');\n }\n\n // clone the object, and apply the property to the clone\n var updated = clone(object);\n setSafeProperty(updated, key, replacement);\n return updated;\n}", "import { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'transpose';\nvar dependencies = ['typed', 'matrix'];\nexport var createTranspose = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix\n } = _ref;\n /**\n * Transpose a matrix. All values of the matrix are reflected over its\n * main diagonal. Only applicable to two dimensional matrices containing\n * a vector (i.e. having size `[1,n]` or `[n,1]`). One dimensional\n * vectors and scalars return the input unchanged.\n *\n * Syntax:\n *\n * math.transpose(x)\n *\n * Examples:\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.transpose(A) // returns [[1, 4], [2, 5], [3, 6]]\n *\n * See also:\n *\n * diag, inv, subset, squeeze\n *\n * @param {Array | Matrix} x Matrix to be transposed\n * @return {Array | Matrix} The transposed matrix\n */\n return typed(name, {\n Array: x => transposeMatrix(matrix(x)).valueOf(),\n Matrix: transposeMatrix,\n any: clone // scalars\n });\n function transposeMatrix(x) {\n // matrix size\n var size = x.size();\n\n // result\n var c;\n\n // process dimensions\n switch (size.length) {\n case 1:\n // vector\n c = x.clone();\n break;\n case 2:\n {\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // check columns\n if (columns === 0) {\n // throw exception\n throw new RangeError('Cannot transpose a 2D matrix with no columns (size: ' + format(size) + ')');\n }\n\n // process storage format\n switch (x.storage()) {\n case 'dense':\n c = _denseTranspose(x, rows, columns);\n break;\n case 'sparse':\n c = _sparseTranspose(x, rows, columns);\n break;\n }\n }\n break;\n default:\n // multi dimensional\n throw new RangeError('Matrix must be a vector or two dimensional (size: ' + format(size) + ')');\n }\n return c;\n }\n function _denseTranspose(m, rows, columns) {\n // matrix array\n var data = m._data;\n // transposed matrix data\n var transposed = [];\n var transposedRow;\n // loop columns\n for (var j = 0; j < columns; j++) {\n // initialize row\n transposedRow = transposed[j] = [];\n // loop rows\n for (var i = 0; i < rows; i++) {\n // set data\n transposedRow[i] = clone(data[i][j]);\n }\n }\n // return matrix\n return m.createDenseMatrix({\n data: transposed,\n size: [columns, rows],\n datatype: m._datatype\n });\n }\n function _sparseTranspose(m, rows, columns) {\n // matrix arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // result matrices\n var cvalues = values ? [] : undefined;\n var cindex = [];\n var cptr = [];\n // row counts\n var w = [];\n for (var x = 0; x < rows; x++) {\n w[x] = 0;\n }\n // vars\n var p, l, j;\n // loop values in matrix\n for (p = 0, l = index.length; p < l; p++) {\n // number of values in row\n w[index[p]]++;\n }\n // cumulative sum\n var sum = 0;\n // initialize cptr with the cummulative sum of row counts\n for (var i = 0; i < rows; i++) {\n // update cptr\n cptr.push(sum);\n // update sum\n sum += w[i];\n // update w\n w[i] = cptr[i];\n }\n // update cptr\n cptr.push(sum);\n // loop columns\n for (j = 0; j < columns; j++) {\n // values & index in column\n for (var k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) {\n // C values & index\n var q = w[index[k]]++;\n // C[j, i] = A[i, j]\n cindex[q] = j;\n // check we need to process values (pattern matrix)\n if (values) {\n cvalues[q] = clone(values[k]);\n }\n }\n }\n // return matrix\n return m.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [columns, rows],\n datatype: m._datatype\n });\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'ctranspose';\nvar dependencies = ['typed', 'transpose', 'conj'];\nexport var createCtranspose = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n transpose,\n conj\n } = _ref;\n /**\n * Transpose and complex conjugate a matrix. All values of the matrix are\n * reflected over its main diagonal and then the complex conjugate is\n * taken. This is equivalent to complex conjugation for scalars and\n * vectors.\n *\n * Syntax:\n *\n * math.ctranspose(x)\n *\n * Examples:\n *\n * const A = [[1, 2, 3], [4, 5, math.complex(6,7)]]\n * math.ctranspose(A) // returns [[1, 4], [2, 5], [3, {re:6,im:7}]]\n *\n * See also:\n *\n * transpose, diag, inv, subset, squeeze\n *\n * @param {Array | Matrix} x Matrix to be ctransposed\n * @return {Array | Matrix} The ctransposed matrix\n */\n return typed(name, {\n any: function any(x) {\n return conj(transpose(x));\n }\n });\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { resize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'zeros';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createZeros = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Create a matrix filled with zeros. The created matrix can have one or\n * multiple dimensions.\n *\n * Syntax:\n *\n * math.zeros(m)\n * math.zeros(m, format)\n * math.zeros(m, n)\n * math.zeros(m, n, format)\n * math.zeros([m, n])\n * math.zeros([m, n], format)\n *\n * Examples:\n *\n * math.zeros() // returns []\n * math.zeros(3) // returns [0, 0, 0]\n * math.zeros(3, 2) // returns [[0, 0], [0, 0], [0, 0]]\n * math.zeros(3, 'dense') // returns [0, 0, 0]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.zeros(math.size(A)) // returns [[0, 0, 0], [0, 0, 0]]\n *\n * See also:\n *\n * ones, identity, size, range\n *\n * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Array | Matrix} A matrix filled with zeros\n */\n return typed(name, {\n '': function _() {\n return config.matrix === 'Array' ? _zeros([]) : _zeros([], 'default');\n },\n // math.zeros(m, n, p, ..., format)\n // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this\n '...number | BigNumber | string': function numberBigNumberString(size) {\n var last = size[size.length - 1];\n if (typeof last === 'string') {\n var format = size.pop();\n return _zeros(size, format);\n } else if (config.matrix === 'Array') {\n return _zeros(size);\n } else {\n return _zeros(size, 'default');\n }\n },\n Array: _zeros,\n Matrix: function Matrix(size) {\n var format = size.storage();\n return _zeros(size.valueOf(), format);\n },\n 'Array | Matrix, string': function ArrayMatrixString(size, format) {\n return _zeros(size.valueOf(), format);\n }\n });\n\n /**\n * Create an Array or Matrix with zeros\n * @param {Array} size\n * @param {string} [format='default']\n * @return {Array | Matrix}\n * @private\n */\n function _zeros(size, format) {\n var hasBigNumbers = _normalize(size);\n var defaultValue = hasBigNumbers ? new BigNumber(0) : 0;\n _validate(size);\n if (format) {\n // return a matrix\n var m = matrix(format);\n if (size.length > 0) {\n return m.resize(size, defaultValue);\n }\n return m;\n } else {\n // return an Array\n var arr = [];\n if (size.length > 0) {\n return resize(arr, size, defaultValue);\n }\n return arr;\n }\n }\n\n // replace BigNumbers with numbers, returns true if size contained BigNumbers\n function _normalize(size) {\n var hasBigNumbers = false;\n size.forEach(function (value, index, arr) {\n if (isBigNumber(value)) {\n hasBigNumbers = true;\n arr[index] = value.toNumber();\n }\n });\n return hasBigNumbers;\n }\n\n // validate arguments\n function _validate(size) {\n size.forEach(function (value) {\n if (typeof value !== 'number' || !isInteger(value) || value < 0) {\n throw new Error('Parameters in function zeros must be positive integers');\n }\n });\n }\n});\n\n// TODO: zeros contains almost the same code as ones. Reuse this?", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'fft';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'divideScalar', 'exp', 'tau', 'i', 'dotDivide', 'conj', 'pow', 'ceil', 'log2'];\nexport var createFft = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n multiplyScalar,\n divideScalar,\n exp,\n tau,\n i: I,\n dotDivide,\n conj,\n pow,\n ceil,\n log2\n } = _ref;\n /**\n * Calculate N-dimensional fourier transform\n *\n * Syntax:\n *\n * math.fft(arr)\n *\n * Examples:\n *\n * math.fft([[1, 0], [1, 0]]) // returns [[{re:2, im:0}, {re:2, im:0}], [{re:0, im:0}, {re:0, im:0}]]\n *\n *\n * See Also:\n *\n * ifft\n *\n * @param {Array | Matrix} arr An array or matrix\n * @return {Array | Matrix} N-dimensional fourier transformation of the array\n */\n return typed(name, {\n Array: _ndFft,\n Matrix: function Matrix(matrix) {\n return matrix.create(_ndFft(matrix.toArray()));\n }\n });\n\n /**\n * Perform an N-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _ndFft(arr) {\n var size = arraySize(arr);\n if (size.length === 1) return _fft(arr, size[0]);\n // ndFft along dimension 1,...,N-1 then 1dFft along dimension 0\n return _1dFft(arr.map(slice => _ndFft(slice, size.slice(1))), 0);\n }\n\n /**\n * Perform an 1-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @param {number} dim dimension of the array to perform on\n * @return {Array} resulting array\n */\n function _1dFft(arr, dim) {\n var size = arraySize(arr);\n if (dim !== 0) return new Array(size[0]).fill(0).map((_, i) => _1dFft(arr[i], dim - 1));\n if (size.length === 1) return _fft(arr);\n function _transpose(arr) {\n // Swap first 2 dimensions\n var size = arraySize(arr);\n return new Array(size[1]).fill(0).map((_, j) => new Array(size[0]).fill(0).map((_, i) => arr[i][j]));\n }\n return _transpose(_1dFft(_transpose(arr), 1));\n }\n /**\n * Perform an 1-dimensional non-power-of-2 Fourier transform using Chirp-Z Transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _czt(arr) {\n var n = arr.length;\n var w = exp(divideScalar(multiplyScalar(-1, multiplyScalar(I, tau)), n));\n var chirp = [];\n for (var i = 1 - n; i < n; i++) {\n chirp.push(pow(w, divideScalar(pow(i, 2), 2)));\n }\n var N2 = pow(2, ceil(log2(n + n - 1)));\n var xp = [...new Array(n).fill(0).map((_, i) => multiplyScalar(arr[i], chirp[n - 1 + i])), ...new Array(N2 - n).fill(0)];\n var ichirp = [...new Array(n + n - 1).fill(0).map((_, i) => divideScalar(1, chirp[i])), ...new Array(N2 - (n + n - 1)).fill(0)];\n var fftXp = _fft(xp);\n var fftIchirp = _fft(ichirp);\n var fftProduct = new Array(N2).fill(0).map((_, i) => multiplyScalar(fftXp[i], fftIchirp[i]));\n var ifftProduct = dotDivide(conj(_ndFft(conj(fftProduct))), N2);\n var ret = [];\n for (var _i = n - 1; _i < n + n - 1; _i++) {\n ret.push(multiplyScalar(ifftProduct[_i], chirp[_i]));\n }\n return ret;\n }\n /**\n * Perform an 1-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _fft(arr) {\n var len = arr.length;\n if (len === 1) return [arr[0]];\n if (len % 2 === 0) {\n var ret = [..._fft(arr.filter((_, i) => i % 2 === 0), len / 2), ..._fft(arr.filter((_, i) => i % 2 === 1), len / 2)];\n for (var k = 0; k < len / 2; k++) {\n var p = ret[k];\n var q = multiplyScalar(ret[k + len / 2], exp(multiplyScalar(multiplyScalar(tau, I), divideScalar(-k, len))));\n ret[k] = addScalar(p, q);\n ret[k + len / 2] = addScalar(p, multiplyScalar(-1, q));\n }\n return ret;\n } else {\n // use chirp-z transform for non-power-of-2 FFT\n return _czt(arr);\n }\n // throw new Error('Can only calculate FFT of power-of-two size')\n }\n});", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'ifft';\nvar dependencies = ['typed', 'fft', 'dotDivide', 'conj'];\nexport var createIfft = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n fft,\n dotDivide,\n conj\n } = _ref;\n /**\n * Calculate N-dimensional inverse fourier transform\n *\n * Syntax:\n *\n * math.ifft(arr)\n *\n * Examples:\n *\n * math.ifft([[2, 2], [0, 0]]) // returns [[{re:1, im:0}, {re:0, im:0}], [{re:1, im:0}, {re:0, im:0}]]\n *\n * See Also:\n *\n * fft\n *\n * @param {Array | Matrix} arr An array or matrix\n * @return {Array | Matrix} N-dimensional fourier transformation of the array\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(arr) {\n var size = isMatrix(arr) ? arr.size() : arraySize(arr);\n return dotDivide(conj(fft(conj(arr))), size.reduce((acc, curr) => acc * curr, 1));\n }\n });\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isUnit, isNumber, isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'solveODE';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'max', 'map', 'abs', 'isPositive', 'isNegative', 'larger', 'smaller', 'matrix', 'bignumber', 'unaryMinus'];\nexport var createSolveODE = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n max,\n map,\n abs,\n isPositive,\n isNegative,\n larger,\n smaller,\n matrix,\n bignumber,\n unaryMinus\n } = _ref;\n /**\n * Numerical Integration of Ordinary Differential Equations\n *\n * Two variable step methods are provided:\n * - \"RK23\": Bogacki\u2013Shampine method\n * - \"RK45\": Dormand-Prince method RK5(4)7M (default)\n *\n * The arguments are expected as follows.\n *\n * - `func` should be the forcing function `f(t, y)`\n * - `tspan` should be a vector of two numbers or units `[tStart, tEnd]`\n * - `y0` the initial state values, should be a scalar or a flat array\n * - `options` should be an object with the following information:\n * - `method` ('RK45'): ['RK23', 'RK45']\n * - `tol` (1e-3): Numeric tolerance of the method, the solver keeps the error estimates less than this value\n * - `firstStep`: Initial step size\n * - `minStep`: minimum step size of the method\n * - `maxStep`: maximum step size of the method\n * - `minDelta` (0.2): minimum ratio of change for the step\n * - `maxDelta` (5): maximum ratio of change for the step\n * - `maxIter` (1e4): maximum number of iterations\n *\n * The returned value is an object with `{t, y}` please note that even though `t` means time, it can represent any other independant variable like `x`:\n * - `t` an array of size `[n]`\n * - `y` the states array can be in two ways\n * - **if `y0` is a scalar:** returns an array-like of size `[n]`\n * - **if `y0` is a flat array-like of size [m]:** returns an array like of size `[n, m]`\n *\n * Syntax:\n *\n * math.solveODE(func, tspan, y0)\n * math.solveODE(func, tspan, y0, options)\n *\n * Examples:\n *\n * function func(t, y) {return y}\n * const tspan = [0, 4]\n * const y0 = 1\n * math.solveODE(func, tspan, y0)\n * math.solveODE(func, tspan, [1, 2])\n * math.solveODE(func, tspan, y0, { method:\"RK23\", maxStep:0.1 })\n *\n * See also:\n *\n * derivative, simplifyCore\n *\n * @param {function} func The forcing function f(t,y)\n * @param {Array | Matrix} tspan The time span\n * @param {number | BigNumber | Unit | Array | Matrix} y0 The initial value\n * @param {Object} [options] Optional configuration options\n * @return {Object} Return an object with t and y values as arrays\n */\n\n function _rk(butcherTableau) {\n // generates an adaptive runge kutta method from it's butcher tableau\n\n return function (f, tspan, y0, options) {\n // adaptive runge kutta methods\n var wrongTSpan = !(tspan.length === 2 && (tspan.every(isNumOrBig) || tspan.every(isUnit)));\n if (wrongTSpan) {\n throw new Error('\"tspan\" must be an Array of two numeric values or two units [tStart, tEnd]');\n }\n var t0 = tspan[0]; // initial time\n var tf = tspan[1]; // final time\n var isForwards = larger(tf, t0);\n var firstStep = options.firstStep;\n if (firstStep !== undefined && !isPositive(firstStep)) {\n throw new Error('\"firstStep\" must be positive');\n }\n var maxStep = options.maxStep;\n if (maxStep !== undefined && !isPositive(maxStep)) {\n throw new Error('\"maxStep\" must be positive');\n }\n var minStep = options.minStep;\n if (minStep && isNegative(minStep)) {\n throw new Error('\"minStep\" must be positive or zero');\n }\n var timeVars = [t0, tf, firstStep, minStep, maxStep].filter(x => x !== undefined);\n if (!(timeVars.every(isNumOrBig) || timeVars.every(isUnit))) {\n throw new Error('Inconsistent type of \"t\" dependant variables');\n }\n var steps = 1; // divide time in this number of steps\n var tol = options.tol ? options.tol : 1e-4; // define a tolerance (must be an option)\n var minDelta = options.minDelta ? options.minDelta : 0.2;\n var maxDelta = options.maxDelta ? options.maxDelta : 5;\n var maxIter = options.maxIter ? options.maxIter : 10000; // stop inifite evaluation if something goes wrong\n var hasBigNumbers = [t0, tf, ...y0, maxStep, minStep].some(isBigNumber);\n var [a, c, b, bp] = hasBigNumbers ? [bignumber(butcherTableau.a), bignumber(butcherTableau.c), bignumber(butcherTableau.b), bignumber(butcherTableau.bp)] : [butcherTableau.a, butcherTableau.c, butcherTableau.b, butcherTableau.bp];\n var h = firstStep ? isForwards ? firstStep : unaryMinus(firstStep) : divide(subtract(tf, t0), steps); // define the first step size\n var t = [t0]; // start the time array\n var y = [y0]; // start the solution array\n\n var deltaB = subtract(b, bp); // b - bp\n\n var n = 0;\n var iter = 0;\n var ongoing = _createOngoing(isForwards);\n var trimStep = _createTrimStep(isForwards);\n // iterate unitil it reaches either the final time or maximum iterations\n while (ongoing(t[n], tf)) {\n var k = [];\n\n // trim the time step so that it doesn't overshoot\n h = trimStep(t[n], tf, h);\n\n // calculate the first value of k\n k.push(f(t[n], y[n]));\n\n // calculate the rest of the values of k\n for (var i = 1; i < c.length; ++i) {\n k.push(f(add(t[n], multiply(c[i], h)), add(y[n], multiply(h, a[i], k))));\n }\n\n // estimate the error by comparing solutions of different orders\n var TE = max(abs(map(multiply(deltaB, k), X => isUnit(X) ? X.value : X)));\n if (TE < tol && tol / TE > 1 / 4) {\n // push solution if within tol\n t.push(add(t[n], h));\n y.push(add(y[n], multiply(h, b, k)));\n n++;\n }\n\n // estimate the delta value that will affect the step size\n var delta = 0.84 * (tol / TE) ** (1 / 5);\n if (smaller(delta, minDelta)) {\n delta = minDelta;\n } else if (larger(delta, maxDelta)) {\n delta = maxDelta;\n }\n delta = hasBigNumbers ? bignumber(delta) : delta;\n h = multiply(h, delta);\n if (maxStep && larger(abs(h), maxStep)) {\n h = isForwards ? maxStep : unaryMinus(maxStep);\n } else if (minStep && smaller(abs(h), minStep)) {\n h = isForwards ? minStep : unaryMinus(minStep);\n }\n iter++;\n if (iter > maxIter) {\n throw new Error('Maximum number of iterations reached, try changing options');\n }\n }\n return {\n t,\n y\n };\n };\n }\n function _rk23(f, tspan, y0, options) {\n // Bogacki\u2013Shampine method\n\n // Define the butcher table\n var a = [[], [1 / 2], [0, 3 / 4], [2 / 9, 1 / 3, 4 / 9]];\n var c = [null, 1 / 2, 3 / 4, 1];\n var b = [2 / 9, 1 / 3, 4 / 9, 0];\n var bp = [7 / 24, 1 / 4, 1 / 3, 1 / 8];\n var butcherTableau = {\n a,\n c,\n b,\n bp\n };\n\n // Solve an adaptive step size rk method\n return _rk(butcherTableau)(f, tspan, y0, options);\n }\n function _rk45(f, tspan, y0, options) {\n // Dormand Prince method\n\n // Define the butcher tableau\n var a = [[], [1 / 5], [3 / 40, 9 / 40], [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]];\n var c = [null, 1 / 5, 3 / 10, 4 / 5, 8 / 9, 1, 1];\n var b = [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84, 0];\n var bp = [5179 / 57600, 0, 7571 / 16695, 393 / 640, -92097 / 339200, 187 / 2100, 1 / 40];\n var butcherTableau = {\n a,\n c,\n b,\n bp\n };\n\n // Solve an adaptive step size rk method\n return _rk(butcherTableau)(f, tspan, y0, options);\n }\n function _solveODE(f, tspan, y0, opt) {\n var method = opt.method ? opt.method : 'RK45';\n var methods = {\n RK23: _rk23,\n RK45: _rk45\n };\n if (method.toUpperCase() in methods) {\n var methodOptions = _objectSpread({}, opt); // clone the options object\n delete methodOptions.method; // delete the method as it won't be needed\n return methods[method.toUpperCase()](f, tspan, y0, methodOptions);\n } else {\n // throw an error indicating there is no such method\n var methodsWithQuotes = Object.keys(methods).map(x => \"\\\"\".concat(x, \"\\\"\"));\n // generates a string of methods like: \"BDF\", \"RK23\" and \"RK45\"\n var availableMethodsString = \"\".concat(methodsWithQuotes.slice(0, -1).join(', '), \" and \").concat(methodsWithQuotes.slice(-1));\n throw new Error(\"Unavailable method \\\"\".concat(method, \"\\\". Available methods are \").concat(availableMethodsString));\n }\n }\n function _createOngoing(isForwards) {\n // returns the correct function to test if it's still iterating\n return isForwards ? smaller : larger;\n }\n function _createTrimStep(isForwards) {\n var outOfBounds = isForwards ? larger : smaller;\n return function (t, tf, h) {\n var next = add(t, h);\n return outOfBounds(next, tf) ? subtract(tf, t) : h;\n };\n }\n function isNumOrBig(x) {\n // checks if it's a number or bignumber\n return isBigNumber(x) || isNumber(x);\n }\n function _matrixSolveODE(f, T, y0, options) {\n // receives matrices and returns matrices\n var sol = _solveODE(f, T.toArray(), y0.toArray(), options);\n return {\n t: matrix(sol.t),\n y: matrix(sol.y)\n };\n }\n return typed('solveODE', {\n 'function, Array, Array, Object': _solveODE,\n 'function, Matrix, Matrix, Object': _matrixSolveODE,\n 'function, Array, Array': (f, T, y0) => _solveODE(f, T, y0, {}),\n 'function, Matrix, Matrix': (f, T, y0) => _matrixSolveODE(f, T, y0, {}),\n 'function, Array, number | BigNumber | Unit': (f, T, y0) => {\n var sol = _solveODE(f, T, [y0], {});\n return {\n t: sol.t,\n y: sol.y.map(Y => Y[0])\n };\n },\n 'function, Matrix, number | BigNumber | Unit': (f, T, y0) => {\n var sol = _solveODE(f, T.toArray(), [y0], {});\n return {\n t: matrix(sol.t),\n y: matrix(sol.y.map(Y => Y[0]))\n };\n },\n 'function, Array, number | BigNumber | Unit, Object': (f, T, y0, options) => {\n var sol = _solveODE(f, T, [y0], options);\n return {\n t: sol.t,\n y: sol.y.map(Y => Y[0])\n };\n },\n 'function, Matrix, number | BigNumber | Unit, Object': (f, T, y0, options) => {\n var sol = _solveODE(f, T.toArray(), [y0], options);\n return {\n t: matrix(sol.t),\n y: matrix(sol.y.map(Y => Y[0]))\n };\n }\n });\n});", "import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };", "import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };", "function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };", "import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };", "/* eslint-disable no-loss-of-precision */\n\nimport { deepMap } from '../../utils/collection.js';\nimport { sign } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'erf';\nvar dependencies = ['typed'];\nexport var createErf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the erf function of a value using a rational Chebyshev\n * approximations for different intervals of x.\n *\n * This is a translation of W. J. Cody's Fortran implementation from 1987\n * ( https://www.netlib.org/specfun/erf ). See the AMS publication\n * \"Rational Chebyshev Approximations for the Error Function\" by W. J. Cody\n * for an explanation of this process.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.erf(x)\n *\n * Examples:\n *\n * math.erf(0.2) // returns 0.22270258921047847\n * math.erf(-0.5) // returns -0.5204998778130465\n * math.erf(4) // returns 0.9999999845827421\n *\n * See also:\n * zeta\n *\n * @param {number | Array | Matrix} x A real number\n * @return {number | Array | Matrix} The erf of `x`\n */\n return typed('name', {\n number: function number(x) {\n var y = Math.abs(x);\n if (y >= MAX_NUM) {\n return sign(x);\n }\n if (y <= THRESH) {\n return sign(x) * erf1(y);\n }\n if (y <= 4.0) {\n return sign(x) * (1 - erfc2(y));\n }\n return sign(x) * (1 - erfc3(y));\n },\n 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self))\n\n // TODO: For complex numbers, use the approximation for the Faddeeva function\n // from \"More Efficient Computation of the Complex Error Function\" (AMS)\n });\n\n /**\n * Approximates the error function erf() for x <= 0.46875 using this function:\n * n\n * erf(x) = x * sum (p_j * x^(2j)) / (q_j * x^(2j))\n * j=0\n */\n function erf1(y) {\n var ysq = y * y;\n var xnum = P[0][4] * ysq;\n var xden = ysq;\n var i;\n for (i = 0; i < 3; i += 1) {\n xnum = (xnum + P[0][i]) * ysq;\n xden = (xden + Q[0][i]) * ysq;\n }\n return y * (xnum + P[0][3]) / (xden + Q[0][3]);\n }\n\n /**\n * Approximates the complement of the error function erfc() for\n * 0.46875 <= x <= 4.0 using this function:\n * n\n * erfc(x) = e^(-x^2) * sum (p_j * x^j) / (q_j * x^j)\n * j=0\n */\n function erfc2(y) {\n var xnum = P[1][8] * y;\n var xden = y;\n var i;\n for (i = 0; i < 7; i += 1) {\n xnum = (xnum + P[1][i]) * y;\n xden = (xden + Q[1][i]) * y;\n }\n var result = (xnum + P[1][7]) / (xden + Q[1][7]);\n var ysq = parseInt(y * 16) / 16;\n var del = (y - ysq) * (y + ysq);\n return Math.exp(-ysq * ysq) * Math.exp(-del) * result;\n }\n\n /**\n * Approximates the complement of the error function erfc() for x > 4.0 using\n * this function:\n *\n * erfc(x) = (e^(-x^2) / x) * [ 1/sqrt(pi) +\n * n\n * 1/(x^2) * sum (p_j * x^(-2j)) / (q_j * x^(-2j)) ]\n * j=0\n */\n function erfc3(y) {\n var ysq = 1 / (y * y);\n var xnum = P[2][5] * ysq;\n var xden = ysq;\n var i;\n for (i = 0; i < 4; i += 1) {\n xnum = (xnum + P[2][i]) * ysq;\n xden = (xden + Q[2][i]) * ysq;\n }\n var result = ysq * (xnum + P[2][4]) / (xden + Q[2][4]);\n result = (SQRPI - result) / y;\n ysq = parseInt(y * 16) / 16;\n var del = (y - ysq) * (y + ysq);\n return Math.exp(-ysq * ysq) * Math.exp(-del) * result;\n }\n});\n\n/**\n * Upper bound for the first approximation interval, 0 <= x <= THRESH\n * @constant\n */\nvar THRESH = 0.46875;\n\n/**\n * Constant used by W. J. Cody's Fortran77 implementation to denote sqrt(pi)\n * @constant\n */\nvar SQRPI = 5.6418958354775628695e-1;\n\n/**\n * Coefficients for each term of the numerator sum (p_j) for each approximation\n * interval (see W. J. Cody's paper for more details)\n * @constant\n */\nvar P = [[3.16112374387056560e00, 1.13864154151050156e02, 3.77485237685302021e02, 3.20937758913846947e03, 1.85777706184603153e-1], [5.64188496988670089e-1, 8.88314979438837594e00, 6.61191906371416295e01, 2.98635138197400131e02, 8.81952221241769090e02, 1.71204761263407058e03, 2.05107837782607147e03, 1.23033935479799725e03, 2.15311535474403846e-8], [3.05326634961232344e-1, 3.60344899949804439e-1, 1.25781726111229246e-1, 1.60837851487422766e-2, 6.58749161529837803e-4, 1.63153871373020978e-2]];\n\n/**\n * Coefficients for each term of the denominator sum (q_j) for each approximation\n * interval (see W. J. Cody's paper for more details)\n * @constant\n */\nvar Q = [[2.36012909523441209e01, 2.44024637934444173e02, 1.28261652607737228e03, 2.84423683343917062e03], [1.57449261107098347e01, 1.17693950891312499e02, 5.37181101862009858e02, 1.62138957456669019e03, 3.29079923573345963e03, 4.36261909014324716e03, 3.43936767414372164e03, 1.23033935480374942e03], [2.56852019228982242e00, 1.87295284992346047e00, 5.27905102951428412e-1, 6.05183413124413191e-2, 2.33520497626869185e-3]];\n\n/**\n * Maximum/minimum safe numbers to input to erf() (in ES6+, this number is\n * Number.[MAX|MIN]_SAFE_INTEGER). erf() for all numbers beyond this limit will\n * return 1\n */\nvar MAX_NUM = Math.pow(2, 53);", "import { factory } from '../../utils/factory.js';\nvar name = 'zeta';\nvar dependencies = ['typed', 'config', 'multiply', 'pow', 'divide', 'factorial', 'equal', 'smallerEq', 'isNegative', 'gamma', 'sin', 'subtract', 'add', '?Complex', '?BigNumber', 'pi'];\nexport var createZeta = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiply,\n pow,\n divide,\n factorial,\n equal,\n smallerEq,\n isNegative,\n gamma,\n sin,\n subtract,\n add,\n Complex,\n BigNumber: _BigNumber,\n pi\n } = _ref;\n /**\n * Compute the Riemann Zeta function of a value using an infinite series for\n * all of the complex plane using Riemann's Functional equation.\n *\n * Based off the paper by Xavier Gourdon and Pascal Sebah\n * ( http://numbers.computation.free.fr/Constants/Miscellaneous/zetaevaluations.pdf )\n *\n * Implementation and slight modification by Anik Patel\n *\n * Note: the implementation is accurate up to about 6 digits.\n *\n * Syntax:\n *\n * math.zeta(n)\n *\n * Examples:\n *\n * math.zeta(5) // returns 1.0369277551433895\n * math.zeta(-0.5) // returns -0.2078862249773449\n * math.zeta(math.i) // returns 0.0033002236853253153 - 0.4181554491413212i\n *\n * See also:\n * erf\n *\n * @param {number | Complex | BigNumber} s A Real, Complex or BigNumber parameter to the Riemann Zeta Function\n * @return {number | Complex | BigNumber} The Riemann Zeta of `s`\n */\n return typed(name, {\n number: s => zetaNumeric(s, value => value, () => 20),\n BigNumber: s => zetaNumeric(s, value => new _BigNumber(value), () => {\n // relTol is for example 1e-12. Extract the positive exponent 12 from that\n return Math.abs(Math.log10(config.relTol));\n }),\n Complex: zetaComplex\n });\n\n /**\n * @param {number | BigNumber} s\n * @param {(value: number) => number | BigNumber} createValue\n * @param {(value: number | BigNumber | Complex) => number} determineDigits\n * @returns {number | BigNumber}\n */\n function zetaNumeric(s, createValue, determineDigits) {\n if (equal(s, 0)) {\n return createValue(-0.5);\n }\n if (equal(s, 1)) {\n return createValue(NaN);\n }\n if (!isFinite(s)) {\n return isNegative(s) ? createValue(NaN) : createValue(1);\n }\n return zeta(s, createValue, determineDigits, s => s);\n }\n\n /**\n * @param {Complex} s\n * @returns {Complex}\n */\n function zetaComplex(s) {\n if (s.re === 0 && s.im === 0) {\n return new Complex(-0.5);\n }\n if (s.re === 1) {\n return new Complex(NaN, NaN);\n }\n if (s.re === Infinity && s.im === 0) {\n return new Complex(1);\n }\n if (s.im === Infinity || s.re === -Infinity) {\n return new Complex(NaN, NaN);\n }\n return zeta(s, value => value, s => Math.round(1.3 * 15 + 0.9 * Math.abs(s.im)), s => s.re);\n }\n\n /**\n * @param {number | BigNumber | Complex} s\n * @param {(value: number) => number | BigNumber | Complex} createValue\n * @param {(value: number | BigNumber | Complex) => number} determineDigits\n * @param {(value: number | BigNumber | Complex) => number} getRe\n * @returns {*|number}\n */\n function zeta(s, createValue, determineDigits, getRe) {\n var n = determineDigits(s);\n if (getRe(s) > -(n - 1) / 2) {\n return f(s, createValue(n), createValue);\n } else {\n // Function Equation for reflection to x < 1\n var c = multiply(pow(2, s), pow(createValue(pi), subtract(s, 1)));\n c = multiply(c, sin(multiply(divide(createValue(pi), 2), s)));\n c = multiply(c, gamma(subtract(1, s)));\n return multiply(c, zeta(subtract(1, s), createValue, determineDigits, getRe));\n }\n }\n\n /**\n * Calculate a portion of the sum\n * @param {number | BigNumber} k a positive integer\n * @param {number | BigNumber} n a positive integer\n * @return {number} the portion of the sum\n **/\n function d(k, n) {\n var S = k;\n for (var j = k; smallerEq(j, n); j = add(j, 1)) {\n var factor = divide(multiply(factorial(add(n, subtract(j, 1))), pow(4, j)), multiply(factorial(subtract(n, j)), factorial(multiply(2, j))));\n S = add(S, factor);\n }\n return multiply(n, S);\n }\n\n /**\n * Calculate the positive Riemann Zeta function\n * @param {number} s a real or complex number with s.re > 1\n * @param {number} n a positive integer\n * @param {(number) => number | BigNumber | Complex} createValue\n * @return {number} Riemann Zeta of s\n **/\n function f(s, n, createValue) {\n var c = divide(1, multiply(d(createValue(0), n), subtract(1, pow(2, subtract(1, s)))));\n var S = createValue(0);\n for (var k = createValue(1); smallerEq(k, n); k = add(k, 1)) {\n S = add(S, divide(multiply((-1) ** (k - 1), d(k, n)), pow(k, s)));\n }\n return multiply(c, S);\n }\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'mode';\nvar dependencies = ['typed', 'isNaN', 'isNumeric'];\nexport var createMode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNaN,\n isNumeric\n } = _ref;\n /**\n * Computes the mode of a set of numbers or a list with values(numbers or characters).\n * If there are multiple modes, it returns a list of those values.\n *\n * Syntax:\n *\n * math.mode(a, b, c, ...)\n * math.mode(A)\n *\n * Examples:\n *\n * math.mode(2, 1, 4, 3, 1) // returns [1]\n * math.mode([1, 2.7, 3.2, 4, 2.7]) // returns [2.7]\n * math.mode(1, 4, 6, 1, 6) // returns [1, 6]\n * math.mode('a','a','b','c') // returns [\"a\"]\n * math.mode(1, 1.5, 'abc') // returns [1, 1.5, \"abc\"]\n *\n * See also:\n *\n * median,\n * mean\n *\n * @param {... *} args A single matrix\n * @return {*} The mode of all values\n */\n return typed(name, {\n 'Array | Matrix': _mode,\n '...': function _(args) {\n return _mode(args);\n }\n });\n\n /**\n * Calculates the mode in an 1-dimensional array\n * @param {Array} values\n * @return {Array} mode\n * @private\n */\n function _mode(values) {\n values = flatten(values.valueOf());\n var num = values.length;\n if (num === 0) {\n throw new Error('Cannot calculate mode of an empty array');\n }\n var count = {};\n var mode = [];\n var max = 0;\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n if (isNumeric(value) && isNaN(value)) {\n throw new Error('Cannot calculate mode of an array containing NaN values');\n }\n if (!(value in count)) {\n count[value] = 0;\n }\n count[value]++;\n if (count[value] === max) {\n mode.push(value);\n } else if (count[value] > max) {\n max = count[value];\n mode = [value];\n }\n }\n return mode;\n }\n});", "import { deepForEach } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'prod';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'numeric'];\nexport var createProd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n numeric\n } = _ref;\n /**\n * Compute the product of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the sum of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.prod(a, b, c, ...)\n * math.prod(A)\n *\n * Examples:\n *\n * math.multiply(2, 3) // returns 6\n * math.prod(2, 3) // returns 6\n * math.prod(2, 3, 4) // returns 24\n * math.prod([2, 3, 4]) // returns 24\n * math.prod([[2, 5], [4, 3]]) // returns 120\n *\n * See also:\n *\n * mean, median, min, max, sum, std, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The product of all values\n */\n return typed(name, {\n // prod([a, b, c, d, ...])\n 'Array | Matrix': _prod,\n // prod([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function ArrayMatrixNumberBigNumber(array, dim) {\n // TODO: implement prod(A, dim)\n throw new Error('prod(A, dim) is not yet supported');\n // return reduce(arguments[0], arguments[1], math.prod)\n },\n // prod(a, b, c, d, ...)\n '...': function _(args) {\n return _prod(args);\n }\n });\n\n /**\n * Recursively calculate the product of an n-dimensional array\n * @param {Array} array\n * @return {number} prod\n * @private\n */\n function _prod(array) {\n var prod;\n deepForEach(array, function (value) {\n try {\n prod = prod === undefined ? value : multiplyScalar(prod, value);\n } catch (err) {\n throw improveErrorMessage(err, 'prod', value);\n }\n });\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof prod === 'string') {\n prod = numeric(prod, safeNumberType(prod, config));\n }\n if (prod === undefined) {\n throw new Error('Cannot calculate prod of an empty array');\n }\n return prod;\n }\n});", "import { typeOf } from '../../../utils/is.js';\n\n/**\n * Improve error messages for statistics functions. Errors are typically\n * thrown in an internally used function like larger, causing the error\n * not to mention the function (like max) which is actually used by the user.\n *\n * @param {Error} err\n * @param {String} fnName\n * @param {*} [value]\n * @return {Error}\n */\nexport function improveErrorMessage(err, fnName, value) {\n // TODO: add information with the index (also needs transform in expression parser)\n var details;\n if (String(err).includes('Unexpected type')) {\n details = arguments.length > 2 ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')' : ' (type: ' + err.data.actual + ')';\n return new TypeError('Cannot calculate ' + fnName + ', unexpected type of argument' + details);\n }\n if (String(err).includes('complex numbers')) {\n details = arguments.length > 2 ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')' : '';\n return new TypeError('Cannot calculate ' + fnName + ', no ordering relation is defined for complex numbers' + details);\n }\n return err;\n}", "import { format as formatString } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'format';\nvar dependencies = ['typed'];\nexport var createFormat = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Format a value of any type into a string.\n *\n * Syntax:\n *\n * math.format(value)\n * math.format(value, options)\n * math.format(value, precision)\n * math.format(value, callback)\n *\n * Where:\n *\n * - `value: *`\n * The value to be formatted\n * - `options: Object`\n * An object with formatting options. Available options:\n * - `notation: string`\n * Number notation. Choose from:\n * - `'fixed'`\n * Always use regular number notation.\n * For example `'123.40'` and `'14000000'`\n * - `'exponential'`\n * Always use exponential notation.\n * For example `'1.234e+2'` and `'1.4e+7'`\n * - `'engineering'`\n * Always use engineering notation: always have exponential notation,\n * and select the exponent to be a multiple of `3`.\n * For example `'123.4e+0'` and `'14.0e+6'`\n * - `'auto'` (default)\n * Regular number notation for numbers having an absolute value between\n * `lower` and `upper` bounds, and uses exponential notation elsewhere.\n * Lower bound is included, upper bound is excluded.\n * For example `'123.4'` and `'1.4e7'`.\n * - `'bin'`, `'oct'`, or `'hex'`\n * Format the number using binary, octal, or hexadecimal notation.\n * For example `'0b1101'` and `'0x10fe'`.\n * - `wordSize: number | BigNumber`\n * The word size in bits to use for formatting in binary, octal, or\n * hexadecimal notation. To be used only with `'bin'`, `'oct'`, or `'hex'`\n * values for `notation` option. When this option is defined the value\n * is formatted as a signed twos complement integer of the given word\n * size and the size suffix is appended to the output.\n * For example `format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'`.\n * Default value is undefined.\n * - `precision: number | BigNumber`\n * Limit the number of digits of the formatted value.\n * For regular numbers, must be a number between `0` and `16`.\n * For bignumbers, the maximum depends on the configured precision,\n * see function `config()`.\n * In case of notations `'exponential'`, `'engineering'`, and `'auto'`,\n * `precision` defines the total number of significant digits returned.\n * In case of notation `'fixed'`, `precision` defines the number of\n * significant digits after the decimal point.\n * `precision` is undefined by default.\n * - `lowerExp: number`\n * Exponent determining the lower boundary for formatting a value with\n * an exponent when `notation='auto'`. Default value is `-3`.\n * - `upperExp: number`\n * Exponent determining the upper boundary for formatting a value with\n * an exponent when `notation='auto'`. Default value is `5`.\n * - `fraction: string`. Available values: `'ratio'` (default) or `'decimal'`.\n * For example `format(fraction(1, 3))` will output `'1/3'` when `'ratio'`\n * is configured, and will output `'0.(3)'` when `'decimal'` is configured.\n * - `truncate: number`. Specifies the maximum allowed length of the\n * returned string. If it had been longer, the excess characters\n * are deleted and replaced with `'...'`.\n * - `callback: function`\n * A custom formatting function, invoked for all numeric elements in `value`,\n * for example all elements of a matrix, or the real and imaginary\n * parts of a complex number. This callback can be used to override the\n * built-in numeric notation with any type of formatting. Function `callback`\n * is called with `value` as parameter and must return a string.\n *\n * When `value` is an Object:\n *\n * - When the object contains a property `format` being a function, this function\n * is invoked as `value.format(options)` and the result is returned.\n * - When the object has its own `toString` method, this method is invoked\n * and the result is returned.\n * - In other cases the function will loop over all object properties and\n * return JSON object notation like '{\"a\": 2, \"b\": 3}'.\n *\n * When value is a function:\n *\n * - When the function has a property `syntax`, it returns this\n * syntax description.\n * - In other cases, a string `'function'` is returned.\n *\n * Examples:\n *\n * math.format(6.4) // returns '6.4'\n * math.format(1240000) // returns '1.24e+6'\n * math.format(1/3) // returns '0.3333333333333333'\n * math.format(1/3, 3) // returns '0.333'\n * math.format(21385, 2) // returns '21000'\n * math.format(12e8, {notation: 'fixed'}) // returns '1200000000'\n * math.format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000'\n * math.format(52.8, {notation: 'exponential'}) // returns '5.28e+1'\n * math.format(12400, {notation: 'engineering'}) // returns '12.4e+3'\n * math.format(2000, {lowerExp: -2, upperExp: 2}) // returns '2e+3'\n *\n * function formatCurrency(value) {\n * // return currency notation with two digits:\n * return '$' + value.toFixed(2)\n *\n * // you could also use math.format inside the callback:\n * // return '$' + math.format(value, {notation: 'fixed', precision: 2})\n * }\n * math.format([2.1, 3, 0.016], formatCurrency) // returns '[$2.10, $3.00, $0.02]'\n *\n * See also:\n *\n * print\n *\n * @param {*} value Value to be stringified\n * @param {Object | Function | number} [options] Formatting options\n * @return {string} The formatted value\n */\n return typed(name, {\n any: formatString,\n 'any, Object | function | number | BigNumber': formatString\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'bin';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as binary.\n *\n * Syntax:\n *\n * math.bin(value)\n *\n * Examples:\n *\n * //the following outputs \"0b10\"\n * math.bin(2)\n *\n * See also:\n *\n * oct\n * hex\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\nexport var createBin = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function numberBigNumber(n) {\n return format(n, {\n notation: 'bin'\n });\n },\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(n, wordSize) {\n return format(n, {\n notation: 'bin',\n wordSize\n });\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'oct';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as octal.\n *\n * Syntax:\n *\n * math.oct(value)\n *\n * Examples:\n *\n * //the following outputs \"0o70\"\n * math.oct(56)\n *\n * See also:\n *\n * bin\n * hex\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\n\nexport var createOct = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function numberBigNumber(n) {\n return format(n, {\n notation: 'oct'\n });\n },\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(n, wordSize) {\n return format(n, {\n notation: 'oct',\n wordSize\n });\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'hex';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as hexadecimal.\n *\n * Syntax:\n *\n * math.hex(value)\n *\n * Examples:\n *\n * math.hex(240) // returns \"0xF0\"\n *\n * See also:\n *\n * oct\n * bin\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\nexport var createHex = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function numberBigNumber(n) {\n return format(n, {\n notation: 'hex'\n });\n },\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(n, wordSize) {\n return format(n, {\n notation: 'hex',\n wordSize\n });\n }\n });\n});", "import { format } from '../../utils/string.js';\nimport { isString } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { printTemplate } from '../../utils/print.js';\nvar name = 'print';\nvar dependencies = ['typed'];\nexport var createPrint = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Interpolate values into a string template.\n *\n * Syntax:\n *\n * math.print(template, values)\n * math.print(template, values, precision)\n * math.print(template, values, options)\n *\n * Example usage:\n *\n * // the following outputs: 'Lucy is 5 years old'\n * math.print('Lucy is $age years old', {age: 5})\n *\n * // the following outputs: 'The value of pi is 3.141592654'\n * math.print('The value of pi is $pi', {pi: math.pi}, 10)\n *\n * // the following outputs: 'hello Mary! The date is 2013-03-23'\n * math.print('Hello $user.name! The date is $date', {\n * user: {\n * name: 'Mary',\n * },\n * date: new Date(2013, 2, 23).toISOString().substring(0, 10)\n * })\n *\n * // the following outputs: 'My favorite fruits are apples and bananas !'\n * math.print('My favorite fruits are $0 and $1 !', [\n * 'apples',\n * 'bananas'\n * ])\n *\n * See also:\n *\n * format\n *\n * @param {string} template A string containing variable placeholders.\n * @param {Object | Array | Matrix} values An object or array containing variables\n * which will be filled in in the template.\n * @param {number | Object} [options] Formatting options,\n * or the number of digits to format numbers.\n * See function math.format for a description\n * of all options.\n * @return {string} Interpolated string\n */\n return typed(name, {\n // note: Matrix will be converted automatically to an Array\n 'string, Object | Array': _print,\n 'string, Object | Array, number | Object': _print\n });\n});\n\n/**\n * Interpolate values into a string template.\n * @param {string} template\n * @param {Object} values\n * @param {number | Object} [options]\n * @returns {string} Interpolated string\n * @private\n */\nfunction _print(template, values, options) {\n return template.replace(printTemplate, function (original, key) {\n var keys = key.split('.');\n var value = values[keys.shift()];\n if (value !== undefined && value.isMatrix) {\n value = value.toArray();\n }\n while (keys.length && value !== undefined) {\n var k = keys.shift();\n value = k ? value[k] : value + '.';\n }\n if (value !== undefined) {\n if (!isString(value)) {\n return format(value, options);\n } else {\n return value;\n }\n }\n return original;\n });\n}", "export var printTemplate = /\\$([\\w.]+)/g;", "import { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'to';\nvar dependencies = ['typed', 'matrix', 'concat'];\nexport var createTo = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n concat\n } = _ref;\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Change the unit of a value.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.to(x, unit)\n *\n * Examples:\n *\n * math.to(math.unit('2 inch'), 'cm') // returns Unit 5.08 cm\n * math.to(math.unit('2 inch'), math.unit('cm')) // returns Unit 5.08 cm\n * math.to(math.unit(16, 'bytes'), 'bits') // returns Unit 128 bits\n *\n * See also:\n *\n * unit\n *\n * @param {Unit | Array | Matrix} x The unit to be converted.\n * @param {Unit | Array | Matrix} unit New unit. Can be a string like \"cm\"\n * or a unit without value.\n * @return {Unit | Array | Matrix} value with changed, fixed unit.\n */\n return typed(name, {\n 'Unit, Unit | string': (x, unit) => x.to(unit)\n }, matrixAlgorithmSuite({\n Ds: true\n }));\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isPrime';\nvar dependencies = ['typed'];\nexport var createIsPrime = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is prime: has no divisors other than itself and one.\n * The function supports type `number`, `bignumber`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isPrime(x)\n *\n * Examples:\n *\n * math.isPrime(3) // returns true\n * math.isPrime(-2) // returns false\n * math.isPrime(0) // returns false\n * math.isPrime(-0) // returns false\n * math.isPrime(0.5) // returns false\n * math.isPrime('2') // returns true\n * math.isPrime([2, 17, 100]) // returns [true, true, false]\n *\n * See also:\n *\n * isNumeric, isZero, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 3) {\n return x > 1;\n }\n if (x % 2 === 0 || x % 3 === 0) {\n return false;\n }\n for (var i = 5; i * i <= x; i += 6) {\n if (x % i === 0 || x % (i + 2) === 0) {\n return false;\n }\n }\n return true;\n },\n bigint: function bigint(x) {\n if (x <= 3n) {\n return x > 1n;\n }\n if (x % 2n === 0n || x % 3n === 0n) {\n return false;\n }\n for (var i = 5n; i * i <= x; i += 6n) {\n if (x % i === 0n || x % (i + 2n) === 0n) {\n return false;\n }\n }\n return true;\n },\n BigNumber: function BigNumber(n) {\n if (n.lte(3)) return n.gt(1);\n if (n.mod(2).eq(0) || n.mod(3).eq(0)) return false;\n if (n.lt(Math.pow(2, 32))) {\n var x = n.toNumber();\n for (var i = 5; i * i <= x; i += 6) {\n if (x % i === 0 || x % (i + 2) === 0) {\n return false;\n }\n }\n return true;\n }\n function modPow(base, exponent, modulus) {\n // exponent can be huge, use non-recursive variant\n var accumulator = 1;\n while (!exponent.eq(0)) {\n if (exponent.mod(2).eq(0)) {\n exponent = exponent.div(2);\n base = base.mul(base).mod(modulus);\n } else {\n exponent = exponent.sub(1);\n accumulator = base.mul(accumulator).mod(modulus);\n }\n }\n return accumulator;\n }\n\n // https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Deterministic_variants\n var Decimal = n.constructor.clone({\n precision: n.toFixed(0).length * 2\n });\n n = new Decimal(n);\n var r = 0;\n var d = n.sub(1);\n while (d.mod(2).eq(0)) {\n d = d.div(2);\n r += 1;\n }\n var bases = null;\n // https://en.wikipedia.org/wiki/Miller\u2013Rabin_primality_test#Testing_against_small_sets_of_bases\n if (n.lt('3317044064679887385961981')) {\n bases = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41].filter(x => x < n);\n } else {\n var max = Math.min(n.toNumber() - 2, Math.floor(2 * Math.pow(n.toFixed(0).length * Math.log(10), 2)));\n bases = [];\n for (var _i = 2; _i <= max; _i += 1) {\n bases.push(max);\n }\n }\n for (var _i2 = 0; _i2 < bases.length; _i2 += 1) {\n var a = bases[_i2];\n var adn = modPow(n.sub(n).add(a), d, n);\n if (!adn.eq(1)) {\n for (var _i3 = 0, _x = adn; !_x.eq(n.sub(1)); _i3 += 1, _x = _x.mul(_x).mod(n)) {\n if (_i3 === r - 1) {\n return false;\n }\n }\n }\n }\n return true;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { noBignumber, noFraction } from '../../utils/noop.js';\nvar name = 'numeric';\nvar dependencies = ['number', '?bignumber', '?fraction'];\nexport var createNumeric = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n number: _number,\n bignumber,\n fraction\n } = _ref;\n var validInputTypes = {\n string: true,\n number: true,\n BigNumber: true,\n Fraction: true\n };\n\n // Load the conversion functions for each output type\n var validOutputTypes = {\n number: x => _number(x),\n BigNumber: bignumber ? x => bignumber(x) : noBignumber,\n bigint: x => BigInt(x),\n Fraction: fraction ? x => fraction(x) : noFraction\n };\n\n /**\n * Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.\n *\n * Syntax:\n *\n * math.numeric(x)\n *\n * Examples:\n *\n * math.numeric('4') // returns 4\n * math.numeric('4', 'number') // returns 4\n * math.numeric('4', 'bigint') // returns 4n\n * math.numeric('4', 'BigNumber') // returns BigNumber 4\n * math.numeric('4', 'Fraction') // returns Fraction 4\n * math.numeric(4, 'Fraction') // returns Fraction 4\n * math.numeric(math.fraction(2, 5), 'number') // returns 0.4\n *\n * See also:\n *\n * number, fraction, bignumber, bigint, string, format\n *\n * @param {string | number | BigNumber | bigint | Fraction } value\n * A numeric value or a string containing a numeric value\n * @param {string} outputType\n * Desired numeric output type.\n * Available values: 'number', 'BigNumber', or 'Fraction'\n * @return {number | BigNumber | bigint | Fraction}\n * Returns an instance of the numeric in the requested type\n */\n return function numeric(value) {\n var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'number';\n var check = arguments.length > 2 ? arguments[2] : undefined;\n if (check !== undefined) {\n throw new SyntaxError('numeric() takes one or two arguments');\n }\n var inputType = typeOf(value);\n if (!(inputType in validInputTypes)) {\n throw new TypeError('Cannot convert ' + value + ' of type \"' + inputType + '\"; valid input types are ' + Object.keys(validInputTypes).join(', '));\n }\n if (!(outputType in validOutputTypes)) {\n throw new TypeError('Cannot convert ' + value + ' to type \"' + outputType + '\"; valid output types are ' + Object.keys(validOutputTypes).join(', '));\n }\n if (outputType === inputType) {\n return value;\n } else {\n return validOutputTypes[outputType](value);\n }\n };\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'divideScalar';\nvar dependencies = ['typed', 'numeric'];\nexport var createDivideScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n numeric\n } = _ref;\n /**\n * Divide two scalar values, `x / y`.\n * This function is meant for internal use: it is used by the public functions\n * `divide` and `inv`.\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Numerator\n * @param {number | BigNumber | bigint | Fraction | Complex} y Denominator\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Quotient, `x / y`\n * @private\n */\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return x / y;\n },\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.div(y);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.div(y);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x / y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return x.div(y);\n },\n 'Unit, number | Complex | Fraction | BigNumber | Unit': (x, y) => x.divide(y),\n 'number | Fraction | Complex | BigNumber, Unit': (x, y) => y.divideInto(x)\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { arraySize as size } from '../../utils/array.js';\nimport { powNumber } from '../../plain/number/index.js';\nvar name = 'pow';\nvar dependencies = ['typed', 'config', 'identity', 'multiply', 'matrix', 'inv', 'fraction', 'number', 'Complex'];\nexport var createPow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n identity,\n multiply,\n matrix,\n inv,\n number,\n fraction,\n Complex\n } = _ref;\n /**\n * Calculates the power of x to y, `x ^ y`.\n *\n * Matrix exponentiation is supported for square matrices `x` and integers `y`:\n * when `y` is nonnegative, `x` may be any square matrix; and when `y` is\n * negative, `x` must be invertible, and then this function returns\n * inv(x)^(-y).\n *\n * For cubic roots of negative numbers, the function returns the principal\n * root by default. In order to let the function return the real root,\n * math.js can be configured with `math.config({predictable: true})`.\n * To retrieve all cubic roots of a value, use `math.cbrt(x, true)`.\n *\n * Syntax:\n *\n * math.pow(x, y)\n *\n * Examples:\n *\n * math.pow(2, 3) // returns number 8\n *\n * const a = math.complex(2, 3)\n * math.pow(a, 2) // returns Complex -5 + 12i\n *\n * const b = [[1, 2], [4, 3]]\n * math.pow(b, 2) // returns Array [[9, 8], [16, 17]]\n *\n * const c = [[1, 2], [4, 3]]\n * math.pow(c, -1) // returns Array [[-0.6, 0.4], [0.8, -0.2]]\n *\n * See also:\n *\n * multiply, sqrt, cbrt, nthRoot\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | bigint | Complex} y The exponent\n * @return {number | BigNumber | bigint | Complex | Array | Matrix} The value of `x` to the power `y`\n */\n return typed(name, {\n 'number, number': _pow,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.pow(y);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n if (y.isInteger() || x >= 0 || config.predictable) {\n return x.pow(y);\n } else {\n return new Complex(x.toNumber(), 0).pow(y.toNumber(), 0);\n }\n },\n 'bigint, bigint': (x, y) => x ** y,\n 'Fraction, Fraction': function FractionFraction(x, y) {\n var result = x.pow(y);\n if (result != null) {\n return result;\n }\n if (config.predictable) {\n throw new Error('Result of pow is non-rational and cannot be expressed as a fraction');\n } else {\n return _pow(x.valueOf(), y.valueOf());\n }\n },\n 'Array, number': _powArray,\n 'Array, BigNumber': function ArrayBigNumber(x, y) {\n return _powArray(x, y.toNumber());\n },\n 'Matrix, number': _powMatrix,\n 'Matrix, BigNumber': function MatrixBigNumber(x, y) {\n return _powMatrix(x, y.toNumber());\n },\n 'Unit, number | BigNumber': function UnitNumberBigNumber(x, y) {\n return x.pow(y);\n }\n });\n\n /**\n * Calculates the power of x to y, x^y, for two numbers.\n * @param {number} x\n * @param {number} y\n * @return {number | Complex} res\n * @private\n */\n function _pow(x, y) {\n // Alternatively could define a 'realmode' config option or something, but\n // 'predictable' will work for now\n if (config.predictable && !isInteger(y) && x < 0) {\n // Check to see if y can be represented as a fraction\n try {\n var yFrac = fraction(y);\n var yNum = number(yFrac);\n if (y === yNum || Math.abs((y - yNum) / y) < 1e-14) {\n if (yFrac.d % 2 === 1) {\n return (yFrac.n % 2 === 0 ? 1 : -1) * Math.pow(-x, y);\n }\n }\n } catch (ex) {\n // fraction() throws an error if y is Infinity, etc.\n }\n\n // Unable to express y as a fraction, so continue on\n }\n\n // **for predictable mode** x^Infinity === NaN if x < -1\n // N.B. this behavour is different from `Math.pow` which gives\n // (-2)^Infinity === Infinity\n if (config.predictable && (x < -1 && y === Infinity || x > -1 && x < 0 && y === -Infinity)) {\n return NaN;\n }\n if (isInteger(y) || x >= 0 || config.predictable) {\n return powNumber(x, y);\n } else {\n // TODO: the following infinity checks are duplicated from powNumber. Deduplicate this somehow\n\n // x^Infinity === 0 if -1 < x < 1\n // A real number 0 is returned instead of complex(0)\n if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) {\n return 0;\n }\n return new Complex(x, 0).pow(y, 0);\n }\n }\n\n /**\n * Calculate the power of a 2d array\n * @param {Array} x must be a 2 dimensional, square matrix\n * @param {number} y a integer value (positive if `x` is not invertible)\n * @returns {Array}\n * @private\n */\n function _powArray(x, y) {\n if (!isInteger(y)) {\n throw new TypeError('For A^b, b must be an integer (value is ' + y + ')');\n }\n // verify that A is a 2 dimensional square matrix\n var s = size(x);\n if (s.length !== 2) {\n throw new Error('For A^b, A must be 2 dimensional (A has ' + s.length + ' dimensions)');\n }\n if (s[0] !== s[1]) {\n throw new Error('For A^b, A must be square (size is ' + s[0] + 'x' + s[1] + ')');\n }\n if (y < 0) {\n try {\n return _powArray(inv(x), -y);\n } catch (error) {\n if (error.message === 'Cannot calculate inverse, determinant is zero') {\n throw new TypeError('For A^b, when A is not invertible, b must be a positive integer (value is ' + y + ')');\n }\n throw error;\n }\n }\n var res = identity(s[0]).valueOf();\n var px = x;\n while (y >= 1) {\n if ((y & 1) === 1) {\n res = multiply(px, res);\n }\n y >>= 1;\n px = multiply(px, px);\n }\n return res;\n }\n\n /**\n * Calculate the power of a 2d matrix\n * @param {Matrix} x must be a 2 dimensional, square matrix\n * @param {number} y a positive, integer value\n * @returns {Matrix}\n * @private\n */\n function _powMatrix(x, y) {\n return matrix(_powArray(x.valueOf(), y));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual, splitNumber } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { roundNumber } from '../../plain/number/index.js';\nvar NO_INT = 'Number of decimals in function round must be an integer';\nvar name = 'round';\nvar dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix'];\nexport var createRound = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n equalScalar,\n zeros,\n BigNumber: _BigNumber,\n DenseMatrix\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n function toExponent(epsilon) {\n return Math.abs(splitNumber(epsilon).exponent);\n }\n\n /**\n * Round a value towards the nearest rounded value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.round(x)\n * math.round(x, n)\n * math.round(unit, valuelessUnit)\n * math.round(unit, n, valuelessUnit)\n *\n * Examples:\n *\n * math.round(3.22) // returns number 3\n * math.round(3.82) // returns number 4\n * math.round(-4.2) // returns number -4\n * math.round(-4.7) // returns number -5\n * math.round(3.22, 1) // returns number 3.2\n * math.round(3.88, 1) // returns number 3.9\n * math.round(-4.21, 1) // returns number -4.2\n * math.round(-4.71, 1) // returns number -4.7\n * math.round(math.pi, 3) // returns number 3.142\n * math.round(123.45678, 2) // returns number 123.46\n *\n * const c = math.complex(3.2, -2.7)\n * math.round(c) // returns Complex 3 - 3i\n *\n * const unit = math.unit('3.241 cm')\n * const cm = math.unit('cm')\n * const mm = math.unit('mm')\n * math.round(unit, 1, cm) // returns Unit 3.2 cm\n * math.round(unit, 1, mm) // returns Unit 32.4 mm\n *\n * math.round([3.2, 3.8, -4.7]) // returns Array [3, 4, -5]\n *\n * See also:\n *\n * ceil, fix, floor\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Value to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @param {Unit} [valuelessUnit] A valueless unit\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed(name, {\n number: function number(x) {\n // Handle round off errors by first rounding to relTol precision\n var xEpsilon = roundNumber(x, toExponent(config.relTol));\n var xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return roundNumber(xSelected);\n },\n 'number, number': function numberNumber(x, n) {\n // Same as number: unless user specifies more decimals than relTol\n var epsilonExponent = toExponent(config.relTol);\n if (n >= epsilonExponent) {\n return roundNumber(x, n);\n }\n var xEpsilon = roundNumber(x, epsilonExponent);\n var xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return roundNumber(xSelected, n);\n },\n 'number, BigNumber': function numberBigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n return new _BigNumber(x).toDecimalPlaces(n.toNumber());\n },\n Complex: function Complex(x) {\n return x.round();\n },\n 'Complex, number': function ComplexNumber(x, n) {\n if (n % 1) {\n throw new TypeError(NO_INT);\n }\n return x.round(n);\n },\n 'Complex, BigNumber': function ComplexBigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n var _n = n.toNumber();\n return x.round(_n);\n },\n BigNumber: function BigNumber(x) {\n // Handle round off errors by first rounding to relTol precision\n var xEpsilon = new _BigNumber(x).toDecimalPlaces(toExponent(config.relTol));\n var xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return xSelected.toDecimalPlaces(0);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n\n // Same as BigNumber: unless user specifies more decimals than relTol\n var epsilonExponent = toExponent(config.relTol);\n if (n >= epsilonExponent) {\n return x.toDecimalPlaces(n.toNumber());\n }\n var xEpsilon = x.toDecimalPlaces(epsilonExponent);\n var xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return xSelected.toDecimalPlaces(n.toNumber());\n },\n Fraction: function Fraction(x) {\n return x.round();\n },\n 'Fraction, number': function FractionNumber(x, n) {\n if (n % 1) {\n throw new TypeError(NO_INT);\n }\n return x.round(n);\n },\n 'Fraction, BigNumber': function FractionBigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n return x.round(n.toNumber());\n },\n 'Unit, number, Unit': typed.referToSelf(self => function (x, n, unit) {\n var valueless = x.toNumeric(unit);\n return unit.multiply(self(valueless, n));\n }),\n 'Unit, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)),\n 'Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)),\n 'Array | Matrix, number, Unit': typed.referToSelf(self => (x, n, unit) => {\n // deep map collection, skip zeros since round(0) = 0\n return deepMap(x, value => self(value, n, unit), true);\n }),\n 'Array | Matrix, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)),\n 'Array | Matrix, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)),\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since round(0) = 0\n return deepMap(x, self, true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n return matAlgo11xS0s(x, n, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n return matAlgo14xDs(x, n, self, false);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), n, self, false).valueOf();\n }),\n 'number | Complex | BigNumber | Fraction, SparseMatrix': typed.referToSelf(self => (x, n) => {\n // check scalar is zero\n if (equalScalar(x, 0)) {\n // do not execute algorithm, result will be a zero matrix\n return zeros(n.size(), n.storage());\n }\n return matAlgo12xSfs(n, x, self, true);\n }),\n 'number | Complex | BigNumber | Fraction, DenseMatrix': typed.referToSelf(self => (x, n) => {\n // check scalar is zero\n if (equalScalar(x, 0)) {\n // do not execute algorithm, result will be a zero matrix\n return zeros(n.size(), n.storage());\n }\n return matAlgo14xDs(n, x, self, true);\n }),\n 'number | Complex | BigNumber | Fraction, Array': typed.referToSelf(self => (x, n) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(n), x, self, true).valueOf();\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { logNumber } from '../../plain/number/index.js';\nvar name = 'log';\nvar dependencies = ['config', 'typed', 'divideScalar', 'Complex'];\nexport var createLog = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n Complex\n } = _ref;\n /**\n * Calculate the logarithm of a value.\n *\n * To avoid confusion with the matrix logarithm, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.log(x)\n * math.log(x, base)\n *\n * Examples:\n *\n * math.log(3.5) // returns 1.252762968495368\n * math.exp(math.log(2.4)) // returns 2.4\n *\n * math.pow(10, 4) // returns 10000\n * math.log(10000, 10) // returns 4\n * math.log(10000) / math.log(10) // returns 4\n *\n * math.log(1024, 2) // returns 10\n * math.pow(2, 10) // returns 1024\n *\n * See also:\n *\n * exp, log2, log10, log1p\n *\n * @param {number | BigNumber | Complex} x\n * Value for which to calculate the logarithm.\n * @param {number | BigNumber | Complex} [base=e]\n * Optional base for the logarithm. If not provided, the natural\n * logarithm of `x` is calculated.\n * @return {number | BigNumber | Complex}\n * Returns the logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return logNumber(x);\n } else {\n // negative value -> complex value computation\n return new Complex(x, 0).log();\n }\n },\n Complex: function Complex(x) {\n return x.log();\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.ln();\n } else {\n // downgrade to number, return Complex valued result\n return new Complex(x.toNumber(), 0).log();\n }\n },\n 'any, any': typed.referToSelf(self => (x, base) => {\n // calculate logarithm for a specified base, log(x, base)\n return divideScalar(self(x), self(base));\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log1p as _log1p } from '../../utils/number.js';\nvar name = 'log1p';\nvar dependencies = ['typed', 'config', 'divideScalar', 'log', 'Complex'];\nexport var createLog1p = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n log,\n Complex\n } = _ref;\n /**\n * Calculate the logarithm of a `value+1`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log1p(x)\n * math.log1p(x, base)\n *\n * Examples:\n *\n * math.log1p(2.5) // returns 1.252762968495368\n * math.exp(math.log1p(1.4)) // returns 2.4\n *\n * math.pow(10, 4) // returns 10000\n * math.log1p(9999, 10) // returns 4\n * math.log1p(9999) / math.log(10) // returns 4\n *\n * See also:\n *\n * exp, log, log2, log10\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm of `x+1`.\n * @param {number | BigNumber | Complex} [base=e]\n * Optional base for the logarithm. If not provided, the natural\n * logarithm of `x+1` is calculated.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the logarithm of `x+1`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 || config.predictable) {\n return _log1p(x);\n } else {\n // negative value -> complex value computation\n return _log1pComplex(new Complex(x, 0));\n }\n },\n Complex: _log1pComplex,\n BigNumber: function BigNumber(x) {\n var y = x.plus(1);\n if (!y.isNegative() || config.predictable) {\n return y.ln();\n } else {\n // downgrade to number, return Complex valued result\n return _log1pComplex(new Complex(x.toNumber(), 0));\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)),\n 'any, any': typed.referToSelf(self => (x, base) => {\n // calculate logarithm for a specified base, log1p(x, base)\n return divideScalar(self(x), log(base));\n })\n });\n\n /**\n * Calculate the natural logarithm of a complex number + 1\n * @param {Complex} x\n * @returns {Complex}\n * @private\n */\n function _log1pComplex(x) {\n var xRe1p = x.re + 1;\n return new Complex(Math.log(Math.sqrt(xRe1p * xRe1p + x.im * x.im)), Math.atan2(x.im, xRe1p));\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'nthRoots';\nvar dependencies = ['config', 'typed', 'divideScalar', 'Complex'];\nexport var createNthRoots = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n Complex\n } = _ref;\n /**\n * Each function here returns a real multiple of i as a Complex value.\n * @param {number} val\n * @return {Complex} val, i*val, -val or -i*val for index 0, 1, 2, 3\n */\n // This is used to fix float artifacts for zero-valued components.\n var _calculateExactResult = [function realPos(val) {\n return new Complex(val, 0);\n }, function imagPos(val) {\n return new Complex(0, val);\n }, function realNeg(val) {\n return new Complex(-val, 0);\n }, function imagNeg(val) {\n return new Complex(0, -val);\n }];\n\n /**\n * Calculate the nth root of a Complex Number a using De Movire's Theorem.\n * @param {Complex} a\n * @param {number} root\n * @return {Array} array of n Complex Roots\n */\n function _nthComplexRoots(a, root) {\n if (root < 0) throw new Error('Root must be greater than zero');\n if (root === 0) throw new Error('Root must be non-zero');\n if (root % 1 !== 0) throw new Error('Root must be an integer');\n if (a === 0 || a.abs() === 0) return [new Complex(0, 0)];\n var aIsNumeric = typeof a === 'number';\n var offset;\n // determine the offset (argument of a)/(pi/2)\n if (aIsNumeric || a.re === 0 || a.im === 0) {\n if (aIsNumeric) {\n offset = 2 * +(a < 0); // numeric value on the real axis\n } else if (a.im === 0) {\n offset = 2 * +(a.re < 0); // complex value on the real axis\n } else {\n offset = 2 * +(a.im < 0) + 1; // complex value on the imaginary axis\n }\n }\n var arg = a.arg();\n var abs = a.abs();\n var roots = [];\n var r = Math.pow(abs, 1 / root);\n for (var k = 0; k < root; k++) {\n var halfPiFactor = (offset + 4 * k) / root;\n /**\n * If (offset + 4*k)/root is an integral multiple of pi/2\n * then we can produce a more exact result.\n */\n if (halfPiFactor === Math.round(halfPiFactor)) {\n roots.push(_calculateExactResult[halfPiFactor % 4](r));\n continue;\n }\n roots.push(new Complex({\n r,\n phi: (arg + 2 * Math.PI * k) / root\n }));\n }\n return roots;\n }\n\n /**\n * Calculate the nth roots of a value.\n * An nth root of a positive real number A,\n * is a positive real solution of the equation \"x^root = A\".\n * This function returns an array of complex values.\n *\n * Syntax:\n *\n * math.nthRoots(x)\n * math.nthRoots(x, root)\n *\n * Examples:\n *\n * math.nthRoots(1)\n * // returns [\n * // {re: 1, im: 0},\n * // {re: -1, im: 0}\n * // ]\n * math.nthRoots(1, 3)\n * // returns [\n * // { re: 1, im: 0 },\n * // { re: -0.4999999999999998, im: 0.8660254037844387 },\n * // { re: -0.5000000000000004, im: -0.8660254037844385 }\n * // ]\n *\n * See also:\n *\n * nthRoot, pow, sqrt\n *\n * @param {number | BigNumber | Fraction | Complex} x Number to be rounded\n * @param {number} [root=2] Optional root, default value is 2\n * @return {number | BigNumber | Fraction | Complex} Returns the nth roots\n */\n return typed(name, {\n Complex: function Complex(x) {\n return _nthComplexRoots(x, 2);\n },\n 'Complex, number': _nthComplexRoots\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotPow';\nvar dependencies = ['typed', 'equalScalar', 'matrix', 'pow', 'DenseMatrix', 'concat'];\nexport var createDotPow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar,\n matrix,\n pow,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var powScalarSignatures = {};\n for (var signature in pow.signatures) {\n if (Object.prototype.hasOwnProperty.call(pow.signatures, signature)) {\n if (!signature.includes('Matrix') && !signature.includes('Array')) {\n powScalarSignatures[signature] = pow.signatures[signature];\n }\n }\n }\n var powScalar = typed(powScalarSignatures);\n\n /**\n * Calculates the power of x to y element wise.\n *\n * Syntax:\n *\n * math.dotPow(x, y)\n *\n * Examples:\n *\n * math.dotPow(2, 3) // returns number 8\n *\n * const a = [[1, 2], [4, 3]]\n * math.dotPow(a, 2) // returns Array [[1, 4], [16, 9]]\n * math.pow(a, 2) // returns Array [[9, 8], [16, 17]]\n *\n * See also:\n *\n * pow, sqrt, multiply\n *\n * @param {number | BigNumber | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | Complex | Unit | Array | Matrix} y The exponent\n * @return {number | BigNumber | Complex | Unit | Array | Matrix} The value of `x` to the power `y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: powScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotDivide';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'divideScalar', 'DenseMatrix', 'concat'];\nexport var createDotDivide = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n divideScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Divide two matrices element wise. The function accepts both matrices and\n * scalar values.\n *\n * Syntax:\n *\n * math.dotDivide(x, y)\n *\n * Examples:\n *\n * math.dotDivide(2, 4) // returns 0.5\n *\n * a = [[9, 5], [6, 1]]\n * b = [[3, 2], [5, 2]]\n *\n * math.dotDivide(a, b) // returns [[3, 2.5], [1.2, 0.5]]\n * math.divide(a, b) // returns [[1.75, 0.75], [-1.75, 2.25]]\n *\n * See also:\n *\n * divide, multiply, dotMultiply\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Denominator\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Quotient, `x ./ y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: divideScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'lsolve';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createLsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds one solution of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix. Throws an error if there's no solution.\n *\n * `L * x = b`\n *\n * Syntax:\n *\n * math.lsolve(L, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = lsolve(a, b) // [[-5.5], [20]]\n *\n * See also:\n *\n * lsolveAll, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} L A N x N matrix or array (L)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix | Array} A column vector with the linear system solution (x)\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrixArrayMatrix(m, b) {\n return _sparseForwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrixArrayMatrix(m, b) {\n return _denseForwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function ArrayArrayMatrix(a, b) {\n var m = matrix(a);\n var r = _denseForwardSubstitution(m, b);\n return r.valueOf();\n }\n });\n function _denseForwardSubstitution(m, b) {\n // validate matrix and vector, return copy of column vector b\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // result\n var x = [];\n var mdata = m._data;\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n var bj = bdata[j][0] || 0;\n var xj = void 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = mdata[j][j];\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n xj = divideScalar(bj, vjj);\n\n // loop rows\n for (var i = j + 1; i < rows; i++) {\n bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];\n }\n } else {\n // degenerate row, we can choose any value\n xj = 0;\n }\n x[j] = [xj];\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n function _sparseForwardSubstitution(m, b) {\n // validate matrix and vector, return copy of column vector b\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // result\n var x = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n var bj = bdata[j][0] || 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = 0;\n // matrix values & indices (column j)\n var jValues = [];\n var jIndices = [];\n\n // first and last index in the column\n var firstIndex = ptr[j];\n var lastIndex = ptr[j + 1];\n\n // values in column, find value at [j, j]\n for (var k = firstIndex; k < lastIndex; k++) {\n var i = index[k];\n\n // check row (rows are not sorted!)\n if (i === j) {\n vjj = values[k];\n } else if (i > j) {\n // store lower triangular\n jValues.push(values[k]);\n jIndices.push(i);\n }\n }\n\n // at this point we must have a value in vjj\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n var xj = divideScalar(bj, vjj);\n for (var _k = 0, l = jIndices.length; _k < l; _k++) {\n var _i = jIndices[_k];\n bdata[_i] = [subtractScalar(bdata[_i][0] || 0, multiplyScalar(xj, jValues[_k]))];\n }\n x[j] = [xj];\n } else {\n // degenerate row, we can choose any value\n x[j] = [0];\n }\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n});", "import { isArray, isMatrix, isDenseMatrix, isSparseMatrix } from '../../../../utils/is.js';\nimport { arraySize } from '../../../../utils/array.js';\nimport { format } from '../../../../utils/string.js';\nexport function createSolveValidation(_ref) {\n var {\n DenseMatrix\n } = _ref;\n /**\n * Validates matrix and column vector b for backward/forward substitution algorithms.\n *\n * @param {Matrix} m An N x N matrix\n * @param {Array | Matrix} b A column vector\n * @param {Boolean} copy Return a copy of vector b\n *\n * @return {DenseMatrix} Dense column vector b\n */\n return function solveValidation(m, b, copy) {\n var mSize = m.size();\n if (mSize.length !== 2) {\n throw new RangeError('Matrix must be two dimensional (size: ' + format(mSize) + ')');\n }\n var rows = mSize[0];\n var columns = mSize[1];\n if (rows !== columns) {\n throw new RangeError('Matrix must be square (size: ' + format(mSize) + ')');\n }\n var data = [];\n if (isMatrix(b)) {\n var bSize = b.size();\n var bdata = b._data;\n\n // 1-dim vector\n if (bSize.length === 1) {\n if (bSize[0] !== rows) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var i = 0; i < rows; i++) {\n data[i] = [bdata[i]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n\n // 2-dim column\n if (bSize.length === 2) {\n if (bSize[0] !== rows || bSize[1] !== 1) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n if (isDenseMatrix(b)) {\n if (copy) {\n data = [];\n for (var _i = 0; _i < rows; _i++) {\n data[_i] = [bdata[_i][0]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n return b;\n }\n if (isSparseMatrix(b)) {\n for (var _i2 = 0; _i2 < rows; _i2++) {\n data[_i2] = [0];\n }\n var values = b._values;\n var index = b._index;\n var ptr = b._ptr;\n for (var k1 = ptr[1], k = ptr[0]; k < k1; k++) {\n var _i3 = index[k];\n data[_i3][0] = values[k];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n }\n throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.');\n }\n if (isArray(b)) {\n var bsize = arraySize(b);\n if (bsize.length === 1) {\n if (bsize[0] !== rows) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var _i4 = 0; _i4 < rows; _i4++) {\n data[_i4] = [b[_i4]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1]\n });\n }\n if (bsize.length === 2) {\n if (bsize[0] !== rows || bsize[1] !== 1) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var _i5 = 0; _i5 < rows; _i5++) {\n data[_i5] = [b[_i5][0]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1]\n });\n }\n throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.');\n }\n };\n}", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'usolve';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createUsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds one solution of a linear equation system by backward substitution. Matrix must be an upper triangular matrix. Throws an error if there's no solution.\n *\n * `U * x = b`\n *\n * Syntax:\n *\n * math.usolve(U, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = usolve(a, b) // [[8], [9]]\n *\n * See also:\n *\n * usolveAll, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} U A N x N matrix or array (U)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix | Array} A column vector with the linear system solution (x)\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrixArrayMatrix(m, b) {\n return _sparseBackwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrixArrayMatrix(m, b) {\n return _denseBackwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function ArrayArrayMatrix(a, b) {\n var m = matrix(a);\n var r = _denseBackwardSubstitution(m, b);\n return r.valueOf();\n }\n });\n function _denseBackwardSubstitution(m, b) {\n // make b into a column vector\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // result\n var x = [];\n var mdata = m._data;\n // loop columns backwards\n for (var j = columns - 1; j >= 0; j--) {\n // b[j]\n var bj = bdata[j][0] || 0;\n // x[j]\n var xj = void 0;\n if (!equalScalar(bj, 0)) {\n // value at [j, j]\n var vjj = mdata[j][j];\n if (equalScalar(vjj, 0)) {\n // system cannot be solved\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n xj = divideScalar(bj, vjj);\n\n // loop rows\n for (var i = j - 1; i >= 0; i--) {\n // update copy of b\n bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];\n }\n } else {\n // zero value at j\n xj = 0;\n }\n // update x\n x[j] = [xj];\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n function _sparseBackwardSubstitution(m, b) {\n // make b into a column vector\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // result\n var x = [];\n\n // loop columns backwards\n for (var j = columns - 1; j >= 0; j--) {\n var bj = bdata[j][0] || 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = 0;\n\n // upper triangular matrix values & index (column j)\n var jValues = [];\n var jIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[j];\n var lastIndex = ptr[j + 1];\n\n // values in column, find value at [j, j], loop backwards\n for (var k = lastIndex - 1; k >= firstIndex; k--) {\n var i = index[k];\n\n // check row (rows are not sorted!)\n if (i === j) {\n vjj = values[k];\n } else if (i < j) {\n // store upper triangular\n jValues.push(values[k]);\n jIndices.push(i);\n }\n }\n\n // at this point we must have a value in vjj\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n var xj = divideScalar(bj, vjj);\n for (var _k = 0, _lastIndex = jIndices.length; _k < _lastIndex; _k++) {\n var _i = jIndices[_k];\n bdata[_i] = [subtractScalar(bdata[_i][0], multiplyScalar(xj, jValues[_k]))];\n }\n x[j] = [xj];\n } else {\n // degenerate row, we can choose any value\n x[j] = [0];\n }\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'lsolveAll';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createLsolveAll = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds all solutions of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix.\n *\n * `L * x = b`\n *\n * Syntax:\n *\n * math.lsolveAll(L, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = lsolveAll(a, b) // [ [[-5.5], [20]] ]\n *\n * See also:\n *\n * lsolve, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} L A N x N matrix or array (L)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrixArrayMatrix(m, b) {\n return _sparseForwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrixArrayMatrix(m, b) {\n return _denseForwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function ArrayArrayMatrix(a, b) {\n var m = matrix(a);\n var R = _denseForwardSubstitution(m, b);\n return R.map(r => r.valueOf());\n }\n });\n function _denseForwardSubstitution(m, b_) {\n // the algorithm is derived from\n // https://www.overleaf.com/read/csvgqdxggyjv\n\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var M = m._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // loop columns\n for (var i = 0; i < columns; i++) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n if (!equalScalar(M[i][i], 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], M[i][i]);\n for (var j = i + 1; j < columns; j++) {\n // b[j] -= b[i] * M[j,i]\n b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j = i + 1; _j < columns; _j++) {\n bNew[_j] = subtractScalar(bNew[_j], M[_j][i]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n function _sparseForwardSubstitution(m, b_) {\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // loop columns\n for (var i = 0; i < columns; i++) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n\n // values & indices (column i)\n var iValues = [];\n var iIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[i];\n var lastIndex = ptr[i + 1];\n\n // find the value at [i, i]\n var Mii = 0;\n for (var j = firstIndex; j < lastIndex; j++) {\n var J = index[j];\n // check row\n if (J === i) {\n Mii = values[j];\n } else if (J > i) {\n // store lower triangular\n iValues.push(values[j]);\n iIndices.push(J);\n }\n }\n if (!equalScalar(Mii, 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], Mii);\n for (var _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) {\n var _J = iIndices[_j2];\n b[_J] = subtractScalar(b[_J], multiplyScalar(b[i], iValues[_j2]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) {\n var _J2 = iIndices[_j3];\n bNew[_J2] = subtractScalar(bNew[_J2], iValues[_j3]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'usolveAll';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createUsolveAll = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds all solutions of a linear equation system by backward substitution. Matrix must be an upper triangular matrix.\n *\n * `U * x = b`\n *\n * Syntax:\n *\n * math.usolveAll(U, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = usolveAll(a, b) // [ [[8], [9]] ]\n *\n * See also:\n *\n * usolve, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} U A N x N matrix or array (U)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrixArrayMatrix(m, b) {\n return _sparseBackwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrixArrayMatrix(m, b) {\n return _denseBackwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function ArrayArrayMatrix(a, b) {\n var m = matrix(a);\n var R = _denseBackwardSubstitution(m, b);\n return R.map(r => r.valueOf());\n }\n });\n function _denseBackwardSubstitution(m, b_) {\n // the algorithm is derived from\n // https://www.overleaf.com/read/csvgqdxggyjv\n\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var M = m._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // loop columns backwards\n for (var i = columns - 1; i >= 0; i--) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n if (!equalScalar(M[i][i], 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], M[i][i]);\n for (var j = i - 1; j >= 0; j--) {\n // b[j] -= b[i] * M[j,i]\n b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j = i - 1; _j >= 0; _j--) {\n bNew[_j] = subtractScalar(bNew[_j], M[_j][i]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n function _sparseBackwardSubstitution(m, b_) {\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // loop columns backwards\n for (var i = columns - 1; i >= 0; i--) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n\n // values & indices (column i)\n var iValues = [];\n var iIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[i];\n var lastIndex = ptr[i + 1];\n\n // find the value at [i, i]\n var Mii = 0;\n for (var j = lastIndex - 1; j >= firstIndex; j--) {\n var J = index[j];\n // check row\n if (J === i) {\n Mii = values[j];\n } else if (J < i) {\n // store upper triangular\n iValues.push(values[j]);\n iIndices.push(J);\n }\n }\n if (!equalScalar(Mii, 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], Mii);\n\n // loop upper triangular\n for (var _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) {\n var _J = iIndices[_j2];\n b[_J] = subtractScalar(b[_J], multiplyScalar(b[i], iValues[_j2]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n\n // loop upper triangular\n for (var _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) {\n var _J2 = iIndices[_j3];\n bNew[_J2] = subtractScalar(bNew[_J2], iValues[_j3]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nimport { leftShiftNumber } from '../../plain/number/index.js';\nimport { leftShiftBigNumber } from '../../utils/bignumber/bitwise.js';\nvar name = 'leftShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createLeftShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise left logical shift of a value x by y number of bits, `x << y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.leftShift(x, y)\n *\n * Examples:\n *\n * math.leftShift(1, 2) // returns number 4\n *\n * math.leftShift([1, 2, 4], 4) // returns Array [16, 32, 64]\n *\n * See also:\n *\n * leftShift, bitNot, bitOr, bitXor, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber | bigint} y Amount of shifts\n * @return {number | BigNumber | bigint | Array | Matrix} `x` shifted left `y` times\n */\n return typed(name, {\n 'number, number': leftShiftNumber,\n 'BigNumber, BigNumber': leftShiftBigNumber,\n 'bigint, bigint': (x, y) => x << y,\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo08xS0Sid';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo08xS0Sid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524 A(i,j) ; A(i,j) !== 0 && B(i,j) === 0\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo08xS0Sid(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues || !bvalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrices');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // vars\n var k, k0, k1, i;\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop values in a\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // mark workspace\n w[i] = mark;\n // set value\n x[i] = avalues[k];\n // add index\n cindex.push(i);\n }\n // loop values in b\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // check value exists in workspace\n if (w[i] === mark) {\n // evaluate callback\n x[i] = cf(x[i], bvalues[k]);\n }\n }\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // value @ i\n var v = x[i];\n // check for zero value\n if (!eq(v, zero)) {\n // push value\n cvalues.push(v);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../utils/factory.js';\nexport var createUseMatrixForArrayScalar = /* #__PURE__ */factory('useMatrixForArrayScalar', ['typed', 'matrix'], _ref => {\n var {\n typed,\n matrix\n } = _ref;\n return {\n 'Array, number': typed.referTo('DenseMatrix, number', selfDn => (x, y) => selfDn(matrix(x), y).valueOf()),\n 'Array, BigNumber': typed.referTo('DenseMatrix, BigNumber', selfDB => (x, y) => selfDB(matrix(x), y).valueOf()),\n 'number, Array': typed.referTo('number, DenseMatrix', selfnD => (x, y) => selfnD(x, matrix(y)).valueOf()),\n 'BigNumber, Array': typed.referTo('BigNumber, DenseMatrix', selfBD => (x, y) => selfBD(x, matrix(y)).valueOf())\n };\n});", "import { rightArithShiftBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nimport { rightArithShiftNumber } from '../../plain/number/index.js';\nvar name = 'rightArithShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createRightArithShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise right arithmetic shift of a value x by y number of bits, `x >> y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.rightArithShift(x, y)\n *\n * Examples:\n *\n * math.rightArithShift(4, 2) // returns number 1\n *\n * math.rightArithShift([16, -32, 64], 4) // returns Array [1, -2, 4]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, bitXor, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber | bigint} y Amount of shifts\n * @return {number | BigNumber | bigint | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n return typed(name, {\n 'number, number': rightArithShiftNumber,\n 'BigNumber, BigNumber': rightArithShiftBigNumber,\n 'bigint, bigint': (x, y) => x >> y,\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { rightLogShiftNumber } from '../../plain/number/index.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nvar name = 'rightLogShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createRightLogShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise right logical shift of value x by y number of bits, `x >>> y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.rightLogShift(x, y)\n *\n * Examples:\n *\n * math.rightLogShift(4, 2) // returns number 1\n *\n * math.rightLogShift([16, 32, 64], 4) // returns Array [1, 2, 4]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, bitXor, leftShift, rightLogShift\n *\n * @param {number | Array | Matrix} x Value to be shifted\n * @param {number} y Amount of shifts\n * @return {number | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n\n return typed(name, {\n 'number, number': rightLogShiftNumber,\n // 'BigNumber, BigNumber': ..., // TODO: implement BigNumber support for rightLogShift\n\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { andNumber } from '../../plain/number/index.js';\nvar name = 'and';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'not', 'concat'];\nexport var createAnd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `and`. Test whether two values are both defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.and(x, y)\n *\n * Examples:\n *\n * math.and(2, 4) // returns true\n *\n * a = [2, 0, 0]\n * b = [3, 7, 0]\n * c = 0\n *\n * math.and(a, b) // returns [true, false, false]\n * math.and(a, c) // returns [false, false, false]\n *\n * See also:\n *\n * not, or, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when both inputs are defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': andNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return (x.re !== 0 || x.im !== 0) && (y.re !== 0 || y.im !== 0);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return !x.isZero() && !y.isZero() && !x.isNaN() && !y.isNaN();\n },\n 'bigint, bigint': andNumber,\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0)),\n 'SparseMatrix, any': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(y)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, any': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(y)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'any, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(x)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo11xS0s(y, x, self, true);\n }),\n 'any, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(x)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n }),\n 'Array, any': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return self(matrix(x), y).valueOf();\n }),\n 'any, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return self(x, matrix(y)).valueOf();\n })\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0\n }));\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'compare';\nvar dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'BigNumber', 'Fraction', 'DenseMatrix', 'concat'];\nexport var createCompare = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n equalScalar,\n matrix,\n BigNumber,\n Fraction,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.\n *\n * x and y are considered equal when the relative difference between x and y\n * is smaller than the configured absTol and relTol. The function cannot be used to\n * compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.compare(x, y)\n *\n * Examples:\n *\n * math.compare(6, 1) // returns 1\n * math.compare(2, 3) // returns -1\n * math.compare(7, 7) // returns 0\n * math.compare('10', '2') // returns 1\n * math.compare('1000', '1e3') // returns 0\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('40 mm')\n * math.compare(a, b) // returns 1\n *\n * math.compare(2, [1, 2, 3]) // returns [1, 0, -1]\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, larger, largerEq, compareNatural, compareText\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} y Second value to compare\n * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, createCompareNumber({\n typed,\n config\n }), {\n 'boolean, boolean': function booleanBoolean(x, y) {\n return x === y ? 0 : x > y ? 1 : -1;\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return bigNearlyEqual(x, y, config.relTol, config.absTol) ? new BigNumber(0) : new BigNumber(x.cmp(y));\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x === y ? 0n : x > y ? 1n : -1n;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return new Fraction(x.compare(y));\n },\n 'Complex, Complex': function ComplexComplex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createCompareNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol) ? 0 : x > y ? 1 : -1;\n }\n });\n});", "import naturalSort from 'javascript-natural-sort';\nimport { isDenseMatrix, isSparseMatrix, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'compareNatural';\nvar dependencies = ['typed', 'compare'];\nexport var createCompareNatural = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compare\n } = _ref;\n var compareBooleans = compare.signatures['boolean,boolean'];\n\n /**\n * Compare two values of any type in a deterministic, natural way.\n *\n * For numeric values, the function works the same as `math.compare`.\n * For types of values that can't be compared mathematically,\n * the function compares in a natural way.\n *\n * For numeric values, x and y are considered equal when the relative\n * difference between x and y is smaller than the configured relTol and absTol.\n * The function cannot be used to compare values smaller than\n * approximately 2.22e-16.\n *\n * For Complex numbers, first the real parts are compared. If equal,\n * the imaginary parts are compared.\n *\n * Strings are compared with a natural sorting algorithm, which\n * orders strings in a \"logic\" way following some heuristics.\n * This differs from the function `compare`, which converts the string\n * into a numeric value and compares that. The function `compareText`\n * on the other hand compares text lexically.\n *\n * Arrays and Matrices are compared value by value until there is an\n * unequal pair of values encountered. Objects are compared by sorted\n * keys until the keys or their values are unequal.\n *\n * Syntax:\n *\n * math.compareNatural(x, y)\n *\n * Examples:\n *\n * math.compareNatural(6, 1) // returns 1\n * math.compareNatural(2, 3) // returns -1\n * math.compareNatural(7, 7) // returns 0\n *\n * math.compareNatural('10', '2') // returns 1\n * math.compareText('10', '2') // returns -1\n * math.compare('10', '2') // returns 1\n *\n * math.compareNatural('Answer: 10', 'Answer: 2') // returns 1\n * math.compareText('Answer: 10', 'Answer: 2') // returns -1\n * math.compare('Answer: 10', 'Answer: 2')\n * // Error: Cannot convert \"Answer: 10\" to a number\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('40 mm')\n * math.compareNatural(a, b) // returns 1\n *\n * const c = math.complex('2 + 3i')\n * const d = math.complex('2 + 4i')\n * math.compareNatural(c, d) // returns -1\n *\n * math.compareNatural([1, 2, 4], [1, 2, 3]) // returns 1\n * math.compareNatural([1, 2, 3], [1, 2]) // returns 1\n * math.compareNatural([1, 5], [1, 2, 3]) // returns 1\n * math.compareNatural([1, 2], [1, 2]) // returns 0\n *\n * math.compareNatural({a: 2}, {a: 4}) // returns -1\n *\n * See also:\n *\n * compare, compareText\n *\n * @param {*} x First value to compare\n * @param {*} y Second value to compare\n * @return {number} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, {\n 'any, any': _compareNatural\n }); // just to check # args\n\n function _compareNatural(x, y) {\n var typeX = typeOf(x);\n var typeY = typeOf(y);\n var c;\n\n // numeric types\n if ((typeX === 'number' || typeX === 'BigNumber' || typeX === 'Fraction') && (typeY === 'number' || typeY === 'BigNumber' || typeY === 'Fraction')) {\n c = compare(x, y);\n if (c.toString() !== '0') {\n // c can be number, BigNumber, or Fraction\n return c > 0 ? 1 : -1; // return a number\n } else {\n return naturalSort(typeX, typeY);\n }\n }\n\n // matrix types\n var matTypes = ['Array', 'DenseMatrix', 'SparseMatrix'];\n if (matTypes.includes(typeX) || matTypes.includes(typeY)) {\n c = compareMatricesAndArrays(_compareNatural, x, y);\n if (c !== 0) {\n return c;\n } else {\n return naturalSort(typeX, typeY);\n }\n }\n\n // in case of different types, order by name of type, i.e. 'BigNumber' < 'Complex'\n if (typeX !== typeY) {\n return naturalSort(typeX, typeY);\n }\n if (typeX === 'Complex') {\n return compareComplexNumbers(x, y);\n }\n if (typeX === 'Unit') {\n if (x.equalBase(y)) {\n return _compareNatural(x.value, y.value);\n }\n\n // compare by units\n return compareArrays(_compareNatural, x.formatUnits(), y.formatUnits());\n }\n if (typeX === 'boolean') {\n return compareBooleans(x, y);\n }\n if (typeX === 'string') {\n return naturalSort(x, y);\n }\n if (typeX === 'Object') {\n return compareObjects(_compareNatural, x, y);\n }\n if (typeX === 'null') {\n return 0;\n }\n if (typeX === 'undefined') {\n return 0;\n }\n\n // this should not occur...\n throw new TypeError('Unsupported type of value \"' + typeX + '\"');\n }\n\n /**\n * Compare mixed matrix/array types, by converting to same-shaped array.\n * This comparator is non-deterministic regarding input types.\n * @param {Array | SparseMatrix | DenseMatrix | *} x\n * @param {Array | SparseMatrix | DenseMatrix | *} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareMatricesAndArrays(compareNatural, x, y) {\n if (isSparseMatrix(x) && isSparseMatrix(y)) {\n return compareArrays(compareNatural, x.toJSON().values, y.toJSON().values);\n }\n if (isSparseMatrix(x)) {\n // note: convert to array is expensive\n return compareMatricesAndArrays(compareNatural, x.toArray(), y);\n }\n if (isSparseMatrix(y)) {\n // note: convert to array is expensive\n return compareMatricesAndArrays(compareNatural, x, y.toArray());\n }\n\n // convert DenseArray into Array\n if (isDenseMatrix(x)) {\n return compareMatricesAndArrays(compareNatural, x.toJSON().data, y);\n }\n if (isDenseMatrix(y)) {\n return compareMatricesAndArrays(compareNatural, x, y.toJSON().data);\n }\n\n // convert scalars to array\n if (!Array.isArray(x)) {\n return compareMatricesAndArrays(compareNatural, [x], y);\n }\n if (!Array.isArray(y)) {\n return compareMatricesAndArrays(compareNatural, x, [y]);\n }\n return compareArrays(compareNatural, x, y);\n }\n\n /**\n * Compare two Arrays\n *\n * - First, compares value by value\n * - Next, if all corresponding values are equal,\n * look at the length: longest array will be considered largest\n *\n * @param {Array} x\n * @param {Array} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareArrays(compareNatural, x, y) {\n // compare each value\n for (var i = 0, ii = Math.min(x.length, y.length); i < ii; i++) {\n var v = compareNatural(x[i], y[i]);\n if (v !== 0) {\n return v;\n }\n }\n\n // compare the size of the arrays\n if (x.length > y.length) {\n return 1;\n }\n if (x.length < y.length) {\n return -1;\n }\n\n // both Arrays have equal size and content\n return 0;\n }\n\n /**\n * Compare two objects\n *\n * - First, compare sorted property names\n * - Next, compare the property values\n *\n * @param {Object} x\n * @param {Object} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareObjects(compareNatural, x, y) {\n var keysX = Object.keys(x);\n var keysY = Object.keys(y);\n\n // compare keys\n keysX.sort(naturalSort);\n keysY.sort(naturalSort);\n var c = compareArrays(compareNatural, keysX, keysY);\n if (c !== 0) {\n return c;\n }\n\n // compare values\n for (var i = 0; i < keysX.length; i++) {\n var v = compareNatural(x[keysX[i]], y[keysY[i]]);\n if (v !== 0) {\n return v;\n }\n }\n return 0;\n }\n});\n\n/**\n * Compare two complex numbers, `x` and `y`:\n *\n * - First, compare the real values of `x` and `y`\n * - If equal, compare the imaginary values of `x` and `y`\n *\n * @params {Complex} x\n * @params {Complex} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\nfunction compareComplexNumbers(x, y) {\n if (x.re > y.re) {\n return 1;\n }\n if (x.re < y.re) {\n return -1;\n }\n if (x.im > y.im) {\n return 1;\n }\n if (x.im < y.im) {\n return -1;\n }\n return 0;\n}", "import { compareText as _compareText } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'compareText';\nvar dependencies = ['typed', 'matrix', 'concat'];\n_compareText.signature = 'any, any';\nexport var createCompareText = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n concat\n } = _ref;\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Compare two strings lexically. Comparison is case sensitive.\n * Returns 1 when x > y, -1 when x < y, and 0 when x == y.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.compareText(x, y)\n *\n * Examples:\n *\n * math.compareText('B', 'A') // returns 1\n * math.compareText('2', '10') // returns 1\n * math.compare('2', '10') // returns -1\n * math.compareNatural('2', '10') // returns -1\n *\n * math.compareText('B', ['A', 'B', 'C']) // returns [1, 0, -1]\n *\n * See also:\n *\n * equal, equalText, compare, compareNatural\n *\n * @param {string | Array | DenseMatrix} x First string to compare\n * @param {string | Array | DenseMatrix} y Second string to compare\n * @return {number | Array | DenseMatrix} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, _compareText, matrixAlgorithmSuite({\n elop: _compareText,\n Ds: true\n }));\n});\nexport var createCompareTextNumber = /* #__PURE__ */factory(name, ['typed'], _ref2 => {\n var {\n typed\n } = _ref2;\n return typed(name, _compareText);\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'equal';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Test whether two values are equal.\n *\n * The function tests whether the relative difference between x and y is\n * smaller than the configured relTol and absTol. The function cannot be used to\n * compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * In case of complex numbers, x.re must equal y.re, and x.im must equal y.im.\n *\n * Values `null` and `undefined` are compared strictly, thus `null` is only\n * equal to `null` and nothing else, and `undefined` is only equal to\n * `undefined` and nothing else. Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.equal(x, y)\n *\n * Examples:\n *\n * math.equal(2 + 2, 3) // returns false\n * math.equal(2 + 2, 4) // returns true\n *\n * const a = math.unit('50 cm')\n * const b = math.unit('5 m')\n * math.equal(a, b) // returns true\n *\n * const c = [2, 5, 1]\n * const d = [2, 7, 1]\n *\n * math.equal(c, d) // returns [true, false, true]\n * math.deepEqual(c, d) // returns false\n *\n * math.equal(\"1000\", \"1e3\") // returns true\n * math.equal(0, null) // returns false\n *\n * See also:\n *\n * unequal, smaller, smallerEq, larger, largerEq, compare, deepEqual, equalText\n *\n * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the compared values are equal, else returns false\n */\n return typed(name, createEqualNumber({\n typed,\n equalScalar\n }), matrixAlgorithmSuite({\n elop: equalScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createEqualNumber = factory(name, ['typed', 'equalScalar'], _ref2 => {\n var {\n typed,\n equalScalar\n } = _ref2;\n return typed(name, {\n 'any, any': function anyAny(x, y) {\n // strict equality for null and undefined?\n if (x === null) {\n return y === null;\n }\n if (y === null) {\n return x === null;\n }\n if (x === undefined) {\n return y === undefined;\n }\n if (y === undefined) {\n return x === undefined;\n }\n return equalScalar(x, y);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'equalText';\nvar dependencies = ['typed', 'compareText', 'isZero'];\nexport var createEqualText = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compareText,\n isZero\n } = _ref;\n /**\n * Check equality of two strings. Comparison is case sensitive.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.equalText(x, y)\n *\n * Examples:\n *\n * math.equalText('Hello', 'Hello') // returns true\n * math.equalText('a', 'A') // returns false\n * math.equal('2e3', '2000') // returns true\n * math.equalText('2e3', '2000') // returns false\n *\n * math.equalText('B', ['A', 'B', 'C']) // returns [false, true, false]\n *\n * See also:\n *\n * equal, compareText, compare, compareNatural\n *\n * @param {string | Array | DenseMatrix} x First string to compare\n * @param {string | Array | DenseMatrix} y Second string to compare\n * @return {number | Array | DenseMatrix} Returns true if the values are equal, and false if not.\n */\n return typed(name, {\n 'any, any': function anyAny(x, y) {\n return isZero(compareText(x, y));\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'smaller';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createSmaller = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is smaller than y.\n *\n * The function returns true when x is smaller than y and the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.smaller(x, y)\n *\n * Examples:\n *\n * math.smaller(2, 3) // returns true\n * math.smaller(5, 2 * 2) // returns false\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('2 inch')\n * math.smaller(a, b) // returns true\n *\n * See also:\n *\n * equal, unequal, smallerEq, smaller, smallerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false\n */\n return typed(name, createSmallerNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x < y,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.lt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x < y,\n 'Fraction, Fraction': (x, y) => x.compare(y) === -1,\n 'Complex, Complex': function ComplexComplex(x, y) {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createSmallerNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return x < y && !nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'smallerEq';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createSmallerEq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is smaller or equal to y.\n *\n * The function returns true when x is smaller than y or the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.smallerEq(x, y)\n *\n * Examples:\n *\n * math.smaller(1 + 2, 3) // returns false\n * math.smallerEq(1 + 2, 3) // returns true\n *\n * See also:\n *\n * equal, unequal, smaller, larger, largerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false\n */\n return typed(name, createSmallerEqNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x <= y,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.lte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x <= y,\n 'Fraction, Fraction': (x, y) => x.compare(y) !== 1,\n 'Complex, Complex': function ComplexComplex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createSmallerEqNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return x <= y || nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'larger';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createLarger = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is larger than y.\n *\n * The function returns true when x is larger than y and the relative\n * difference between x and y is larger than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.larger(x, y)\n *\n * Examples:\n *\n * math.larger(2, 3) // returns false\n * math.larger(5, 2 + 2) // returns true\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('2 inch')\n * math.larger(a, b) // returns false\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, largerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is larger than y, else returns false\n */\n return typed(name, createLargerNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x > y,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.gt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x > y,\n 'Fraction, Fraction': (x, y) => x.compare(y) === 1,\n 'Complex, Complex': function ComplexComplex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createLargerNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return x > y && !nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'largerEq';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createLargerEq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is larger or equal to y.\n *\n * The function returns true when x is larger than y or the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.largerEq(x, y)\n *\n * Examples:\n *\n * math.larger(2, 1 + 1) // returns false\n * math.largerEq(2, 1 + 1) // returns true\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, larger, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is larger or equal to y, else returns false\n */\n return typed(name, createLargerEqNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x >= y,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.gte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x >= y;\n },\n 'Fraction, Fraction': (x, y) => x.compare(y) !== -1,\n 'Complex, Complex': function ComplexComplex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createLargerEqNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return x >= y || nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'deepEqual';\nvar dependencies = ['typed', 'equal'];\nexport var createDeepEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equal\n } = _ref;\n /**\n * Test element wise whether two matrices are equal.\n * The function accepts both matrices and scalar values.\n *\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.deepEqual(x, y)\n *\n * Examples:\n *\n * math.deepEqual(2, 4) // returns false\n *\n * a = [2, 5, 1]\n * b = [2, 7, 1]\n *\n * math.deepEqual(a, b) // returns false\n * math.equal(a, b) // returns [true, false, true]\n *\n * See also:\n *\n * equal, unequal\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x First matrix to compare\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second matrix to compare\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix}\n * Returns true when the input matrices have the same size and each of their elements is equal.\n */\n return typed(name, {\n 'any, any': function anyAny(x, y) {\n return _deepEqual(x.valueOf(), y.valueOf());\n }\n });\n\n /**\n * Test whether two arrays have the same size and all elements are equal\n * @param {Array | *} x\n * @param {Array | *} y\n * @return {boolean} Returns true if both arrays are deep equal\n */\n function _deepEqual(x, y) {\n if (Array.isArray(x)) {\n if (Array.isArray(y)) {\n var len = x.length;\n if (len !== y.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n if (!_deepEqual(x[i], y[i])) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n } else {\n if (Array.isArray(y)) {\n return false;\n } else {\n return equal(x, y);\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'unequal';\nvar dependencies = ['typed', 'config', 'equalScalar', 'matrix', 'DenseMatrix', 'concat'];\nexport var createUnequal = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n equalScalar,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Test whether two values are unequal.\n *\n * The function tests whether the relative difference between x and y is\n * larger than the configured relTol and absTol. The function cannot be used to compare\n * values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im.\n * Strings are compared by their numerical value.\n *\n * Values `null` and `undefined` are compared strictly, thus `null` is unequal\n * with everything except `null`, and `undefined` is unequal with everything\n * except `undefined`.\n *\n * Syntax:\n *\n * math.unequal(x, y)\n *\n * Examples:\n *\n * math.unequal(2 + 2, 3) // returns true\n * math.unequal(2 + 2, 4) // returns false\n *\n * const a = math.unit('50 cm')\n * const b = math.unit('5 m')\n * math.unequal(a, b) // returns false\n *\n * const c = [2, 5, 1]\n * const d = [2, 7, 1]\n *\n * math.unequal(c, d) // returns [false, true, false]\n * math.deepEqual(c, d) // returns false\n *\n * math.unequal(0, null) // returns true\n * See also:\n *\n * equal, deepEqual, smaller, smallerEq, larger, largerEq, compare\n *\n * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} x First value to compare\n * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the compared values are unequal, else returns false\n */\n return typed(name, createUnequalNumber({\n typed,\n equalScalar\n }), matrixAlgorithmSuite({\n elop: _unequal,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n function _unequal(x, y) {\n return !equalScalar(x, y);\n }\n});\nexport var createUnequalNumber = factory(name, ['typed', 'equalScalar'], _ref2 => {\n var {\n typed,\n equalScalar\n } = _ref2;\n return typed(name, {\n 'any, any': function anyAny(x, y) {\n // strict equality for null and undefined?\n if (x === null) {\n return y !== null;\n }\n if (y === null) {\n return x !== null;\n }\n if (x === undefined) {\n return y !== undefined;\n }\n if (y === undefined) {\n return x !== undefined;\n }\n return !equalScalar(x, y);\n }\n });\n});", "import { isMatrix } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'partitionSelect';\nvar dependencies = ['typed', 'isNumeric', 'isNaN', 'compare'];\nexport var createPartitionSelect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNumeric,\n isNaN,\n compare\n } = _ref;\n var asc = compare;\n var desc = (a, b) => -compare(a, b);\n\n /**\n * Partition-based selection of an array or 1D matrix.\n * Will find the kth smallest value, and mutates the input array.\n * Uses Quickselect.\n *\n * Syntax:\n *\n * math.partitionSelect(x, k)\n * math.partitionSelect(x, k, compare)\n *\n * Examples:\n *\n * math.partitionSelect([5, 10, 1], 2) // returns 10\n * math.partitionSelect(['C', 'B', 'A', 'D'], 1, math.compareText) // returns 'B'\n *\n * function sortByLength (a, b) {\n * return a.length - b.length\n * }\n * math.partitionSelect(['Langdon', 'Tom', 'Sara'], 2, sortByLength) // returns 'Langdon'\n *\n * // the input array is mutated\n * arr = [5, 2, 1]\n * math.partitionSelect(arr, 0) // returns 1, arr is now: [1, 2, 5]\n * math.partitionSelect(arr, 1, 'desc') // returns 2, arr is now: [5, 2, 1]\n *\n * See also:\n *\n * sort\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to sort\n * @param {Number} k The kth smallest value to be retrieved zero-based index\n * @param {Function | 'asc' | 'desc'} [compare='asc']\n * An optional comparator function. The function is called as\n * `compare(a, b)`, and must return 1 when a > b, -1 when a < b,\n * and 0 when a == b.\n * @return {*} Returns the kth lowest value.\n */\n return typed(name, {\n 'Array | Matrix, number': function ArrayMatrixNumber(x, k) {\n return _partitionSelect(x, k, asc);\n },\n 'Array | Matrix, number, string': function ArrayMatrixNumberString(x, k, compare) {\n if (compare === 'asc') {\n return _partitionSelect(x, k, asc);\n } else if (compare === 'desc') {\n return _partitionSelect(x, k, desc);\n } else {\n throw new Error('Compare string must be \"asc\" or \"desc\"');\n }\n },\n 'Array | Matrix, number, function': _partitionSelect\n });\n function _partitionSelect(x, k, compare) {\n if (!isInteger(k) || k < 0) {\n throw new Error('k must be a non-negative integer');\n }\n if (isMatrix(x)) {\n var size = x.size();\n if (size.length > 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return quickSelect(x.valueOf(), k, compare);\n }\n if (Array.isArray(x)) {\n return quickSelect(x, k, compare);\n }\n }\n\n /**\n * Quickselect algorithm.\n * Code adapted from:\n * https://blog.teamleadnet.com/2012/07/quick-select-algorithm-find-kth-element.html\n *\n * @param {Array} arr\n * @param {Number} k\n * @param {Function} compare\n * @private\n */\n function quickSelect(arr, k, compare) {\n if (k >= arr.length) {\n throw new Error('k out of bounds');\n }\n\n // check for NaN values since these can cause an infinite while loop\n for (var i = 0; i < arr.length; i++) {\n if (isNumeric(arr[i]) && isNaN(arr[i])) {\n return arr[i]; // return NaN\n }\n }\n var from = 0;\n var to = arr.length - 1;\n\n // if from == to we reached the kth element\n while (from < to) {\n var r = from;\n var w = to;\n var pivot = arr[Math.floor(Math.random() * (to - from + 1)) + from];\n\n // stop if the reader and writer meets\n while (r < w) {\n // arr[r] >= pivot\n if (compare(arr[r], pivot) >= 0) {\n // put the large values at the end\n var tmp = arr[w];\n arr[w] = arr[r];\n arr[r] = tmp;\n --w;\n } else {\n // the value is smaller than the pivot, skip\n ++r;\n }\n }\n\n // if we stepped up (r++) we need to step one down (arr[r] > pivot)\n if (compare(arr[r], pivot) > 0) {\n --r;\n }\n\n // the r pointer is on the end of the first k elements\n if (k <= r) {\n to = r;\n } else {\n from = r + 1;\n }\n }\n return arr[k];\n }\n});", "import { arraySize as size } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'sort';\nvar dependencies = ['typed', 'matrix', 'compare', 'compareNatural'];\nexport var createSort = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n compare,\n compareNatural\n } = _ref;\n var compareAsc = compare;\n var compareDesc = (a, b) => -compare(a, b);\n\n /**\n * Sort the items in a matrix.\n *\n * Syntax:\n *\n * math.sort(x)\n * math.sort(x, compare)\n *\n * Examples:\n *\n * math.sort([5, 10, 1]) // returns [1, 5, 10]\n * math.sort(['C', 'B', 'A', 'D'], math.compareNatural)\n * // returns ['A', 'B', 'C', 'D']\n *\n * function sortByLength (a, b) {\n * return a.length - b.length\n * }\n * math.sort(['Langdon', 'Tom', 'Sara'], sortByLength)\n * // returns ['Tom', 'Sara', 'Langdon']\n *\n * See also:\n *\n * filter, forEach, map, compare, compareNatural\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to sort\n * @param {Function | 'asc' | 'desc' | 'natural'} [compare='asc']\n * An optional _comparator function or name. The function is called as\n * `compare(a, b)`, and must return 1 when a > b, -1 when a < b,\n * and 0 when a == b.\n * @return {Matrix | Array} Returns the sorted matrix.\n */\n return typed(name, {\n Array: function Array(x) {\n _arrayIsVector(x);\n return x.sort(compareAsc);\n },\n Matrix: function Matrix(x) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(compareAsc), x.storage());\n },\n 'Array, function': function ArrayFunction(x, _comparator) {\n _arrayIsVector(x);\n return x.sort(_comparator);\n },\n 'Matrix, function': function MatrixFunction(x, _comparator) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(_comparator), x.storage());\n },\n 'Array, string': function ArrayString(x, order) {\n _arrayIsVector(x);\n return x.sort(_comparator(order));\n },\n 'Matrix, string': function MatrixString(x, order) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(_comparator(order)), x.storage());\n }\n });\n\n /**\n * Get the comparator for given order ('asc', 'desc', 'natural')\n * @param {'asc' | 'desc' | 'natural'} order\n * @return {Function} Returns a _comparator function\n */\n function _comparator(order) {\n if (order === 'asc') {\n return compareAsc;\n } else if (order === 'desc') {\n return compareDesc;\n } else if (order === 'natural') {\n return compareNatural;\n } else {\n throw new Error('String \"asc\", \"desc\", or \"natural\" expected');\n }\n }\n\n /**\n * Validate whether an array is one dimensional\n * Throws an error when this is not the case\n * @param {Array} array\n * @private\n */\n function _arrayIsVector(array) {\n if (size(array).length !== 1) {\n throw new Error('One dimensional array expected');\n }\n }\n\n /**\n * Validate whether a matrix is one dimensional\n * Throws an error when this is not the case\n * @param {Matrix} matrix\n * @private\n */\n function _matrixIsVector(matrix) {\n if (matrix.size().length !== 1) {\n throw new Error('One dimensional matrix expected');\n }\n }\n});", "import { deepForEach, reduce, containsCollections } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'max';\nvar dependencies = ['typed', 'config', 'numeric', 'larger'];\nexport var createMax = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n larger\n } = _ref;\n /**\n * Compute the maximum value of a matrix or a list with values.\n * In case of a multidimensional array, the maximum of the flattened array\n * will be calculated. When `dim` is provided, the maximum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.max(a, b, c, ...)\n * math.max(A)\n * math.max(A, dimension)\n *\n * Examples:\n *\n * math.max(2, 1, 4, 3) // returns 4\n * math.max([2, 1, 4, 3]) // returns 4\n *\n * // maximum over a specified dimension (zero-based)\n * math.max([[2, 5], [4, 3], [1, 7]], 0) // returns [4, 7]\n * math.max([[2, 5], [4, 3], [1, 7]], 1) // returns [5, 4, 7]\n *\n * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1\n * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5\n *\n * See also:\n *\n * mean, median, min, prod, std, sum, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The maximum value\n */\n return typed(name, {\n // max([a, b, c, d, ...])\n 'Array | Matrix': _max,\n // max([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function ArrayMatrixNumberBigNumber(array, dim) {\n return reduce(array, dim.valueOf(), _largest);\n },\n // max(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function max');\n }\n return _max(args);\n }\n });\n\n /**\n * Return the largest of two values\n * @param {*} x\n * @param {*} y\n * @returns {*} Returns x when x is largest, or y when y is largest\n * @private\n */\n function _largest(x, y) {\n try {\n return larger(x, y) ? x : y;\n } catch (err) {\n throw improveErrorMessage(err, 'max', y);\n }\n }\n\n /**\n * Recursively calculate the maximum value in an n-dimensional array\n * @param {Array} array\n * @return {number} max\n * @private\n */\n function _max(array) {\n var res;\n deepForEach(array, function (value) {\n try {\n if (isNaN(value) && typeof value === 'number') {\n res = NaN;\n } else if (res === undefined || larger(value, res)) {\n res = value;\n }\n } catch (err) {\n throw improveErrorMessage(err, 'max', value);\n }\n });\n if (res === undefined) {\n throw new Error('Cannot calculate max of an empty array');\n }\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof res === 'string') {\n res = numeric(res, safeNumberType(res, config));\n }\n return res;\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'min';\nvar dependencies = ['typed', 'config', 'numeric', 'smaller'];\nexport var createMin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n smaller\n } = _ref;\n /**\n * Compute the minimum value of a matrix or a list of values.\n * In case of a multidimensional array, the minimum of the flattened array\n * will be calculated. When `dim` is provided, the minimum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.min(a, b, c, ...)\n * math.min(A)\n * math.min(A, dimension)\n *\n * Examples:\n *\n * math.min(2, 1, 4, 3) // returns 1\n * math.min([2, 1, 4, 3]) // returns 1\n *\n * // minimum over a specified dimension (zero-based)\n * math.min([[2, 5], [4, 3], [1, 7]], 0) // returns [1, 3]\n * math.min([[2, 5], [4, 3], [1, 7]], 1) // returns [2, 3, 1]\n *\n * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1\n * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5\n *\n * See also:\n *\n * mean, median, max, prod, std, sum, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The minimum value\n */\n return typed(name, {\n // min([a, b, c, d, ...])\n 'Array | Matrix': _min,\n // min([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function ArrayMatrixNumberBigNumber(array, dim) {\n return reduce(array, dim.valueOf(), _smallest);\n },\n // min(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function min');\n }\n return _min(args);\n }\n });\n\n /**\n * Return the smallest of two values\n * @param {*} x\n * @param {*} y\n * @returns {*} Returns x when x is smallest, or y when y is smallest\n * @private\n */\n function _smallest(x, y) {\n try {\n return smaller(x, y) ? x : y;\n } catch (err) {\n throw improveErrorMessage(err, 'min', y);\n }\n }\n\n /**\n * Recursively calculate the minimum value in an n-dimensional array\n * @param {Array} array\n * @return {number} min\n * @private\n */\n function _min(array) {\n var min;\n deepForEach(array, function (value) {\n try {\n if (isNaN(value) && typeof value === 'number') {\n min = NaN;\n } else if (min === undefined || smaller(value, min)) {\n min = value;\n }\n } catch (err) {\n throw improveErrorMessage(err, 'min', value);\n }\n });\n if (min === undefined) {\n throw new Error('Cannot calculate min of an empty array');\n }\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof min === 'string') {\n min = numeric(min, safeNumberType(min, config));\n }\n return min;\n }\n});", "import { isArray, isMatrix, isString, typeOf } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ImmutableDenseMatrix';\nvar dependencies = ['smaller', 'DenseMatrix'];\nexport var createImmutableDenseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n smaller,\n DenseMatrix\n } = _ref;\n function ImmutableDenseMatrix(data, datatype) {\n if (!(this instanceof ImmutableDenseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data) || isArray(data)) {\n // use DenseMatrix implementation\n var matrix = new DenseMatrix(data, datatype);\n // internal structures\n this._data = matrix._data;\n this._size = matrix._size;\n this._datatype = matrix._datatype;\n this._min = null;\n this._max = null;\n } else if (data && isArray(data.data) && isArray(data.size)) {\n // initialize fields from JSON representation\n this._data = data.data;\n this._size = data.size;\n this._datatype = data.datatype;\n this._min = typeof data.min !== 'undefined' ? data.min : null;\n this._max = typeof data.max !== 'undefined' ? data.max : null;\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._data = [];\n this._size = [0];\n this._datatype = datatype;\n this._min = null;\n this._max = null;\n }\n }\n ImmutableDenseMatrix.prototype = new DenseMatrix();\n\n /**\n * Attach type information\n */\n ImmutableDenseMatrix.prototype.type = 'ImmutableDenseMatrix';\n ImmutableDenseMatrix.prototype.isImmutableDenseMatrix = true;\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @param {Index} index\n * @param {Array | ImmutableDenseMatrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n ImmutableDenseMatrix.prototype.subset = function (index) {\n switch (arguments.length) {\n case 1:\n {\n // use base implementation\n var m = DenseMatrix.prototype.subset.call(this, index);\n // check result is a matrix\n if (isMatrix(m)) {\n // return immutable matrix\n return new ImmutableDenseMatrix({\n data: m._data,\n size: m._size,\n datatype: m._datatype\n });\n }\n return m;\n }\n // intentional fall through\n case 2:\n case 3:\n throw new Error('Cannot invoke set subset on an Immutable Matrix instance');\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n\n /**\n * Replace a single element in the matrix.\n * @param {Number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {ImmutableDenseMatrix} self\n */\n ImmutableDenseMatrix.prototype.set = function () {\n throw new Error('Cannot invoke set on an Immutable Matrix instance');\n };\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @param {Number[]} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n ImmutableDenseMatrix.prototype.resize = function () {\n throw new Error('Cannot invoke resize on an Immutable Matrix instance');\n };\n\n /**\n * Disallows reshaping in favor of immutability.\n *\n * @throws {Error} Operation not allowed\n */\n ImmutableDenseMatrix.prototype.reshape = function () {\n throw new Error('Cannot invoke reshape on an Immutable Matrix instance');\n };\n\n /**\n * Create a clone of the matrix\n * @return {ImmutableDenseMatrix} clone\n */\n ImmutableDenseMatrix.prototype.clone = function () {\n return new ImmutableDenseMatrix({\n data: clone(this._data),\n size: clone(this._size),\n datatype: this._datatype\n });\n };\n\n /**\n * Get a JSON representation of the matrix\n * @returns {Object}\n */\n ImmutableDenseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'ImmutableDenseMatrix',\n data: this._data,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Generate a matrix from a JSON object\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ImmutableDenseMatrix\", data: [], size: []}`,\n * where mathjs is optional\n * @returns {ImmutableDenseMatrix}\n */\n ImmutableDenseMatrix.fromJSON = function (json) {\n return new ImmutableDenseMatrix(json);\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @param {Number} i Matrix row index 1\n * @param {Number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n ImmutableDenseMatrix.prototype.swapRows = function () {\n throw new Error('Cannot invoke swapRows on an Immutable Matrix instance');\n };\n\n /**\n * Calculate the minimum value in the set\n * @return {Number | undefined} min\n */\n ImmutableDenseMatrix.prototype.min = function () {\n // check min has been calculated before\n if (this._min === null) {\n // minimum\n var m = null;\n // compute min\n this.forEach(function (v) {\n if (m === null || smaller(v, m)) {\n m = v;\n }\n });\n this._min = m !== null ? m : undefined;\n }\n return this._min;\n };\n\n /**\n * Calculate the maximum value in the set\n * @return {Number | undefined} max\n */\n ImmutableDenseMatrix.prototype.max = function () {\n // check max has been calculated before\n if (this._max === null) {\n // maximum\n var m = null;\n // compute max\n this.forEach(function (v) {\n if (m === null || smaller(m, v)) {\n m = v;\n }\n });\n this._max = m !== null ? m : undefined;\n }\n return this._max;\n };\n return ImmutableDenseMatrix;\n}, {\n isClass: true\n});", "import { isArray, isMatrix, isRange } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Index';\nvar dependencies = ['ImmutableDenseMatrix', 'getMatrixDataType'];\nexport var createIndexClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n ImmutableDenseMatrix,\n getMatrixDataType\n } = _ref;\n /**\n * Create an index. An Index can store ranges and sets for multiple dimensions.\n * Matrix.get, Matrix.set, and math.subset accept an Index as input.\n *\n * Usage:\n * const index = new Index(range1, range2, matrix1, array1, ...)\n *\n * Where each parameter can be any of:\n * A number\n * A string (containing a name of an object property)\n * An instance of Range\n * An Array with the Set values\n * An Array with Booleans\n * A Matrix with the Set values\n * A Matrix with Booleans\n *\n * The parameters start, end, and step must be integer numbers.\n *\n * @class Index\n * @Constructor Index\n * @param {...*} ranges\n */\n function Index(ranges) {\n if (!(this instanceof Index)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this._dimensions = [];\n this._sourceSize = [];\n this._isScalar = true;\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n var arg = arguments[i];\n var argIsArray = isArray(arg);\n var argIsMatrix = isMatrix(arg);\n var sourceSize = null;\n if (isRange(arg)) {\n this._dimensions.push(arg);\n this._isScalar = false;\n } else if (argIsArray || argIsMatrix) {\n // create matrix\n var m = void 0;\n if (getMatrixDataType(arg) === 'boolean') {\n if (argIsArray) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg).valueOf());\n if (argIsMatrix) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg._data).valueOf());\n sourceSize = arg.valueOf().length;\n } else {\n m = _createImmutableMatrix(arg.valueOf());\n }\n this._dimensions.push(m);\n // size\n var size = m.size();\n // scalar\n if (size.length !== 1 || size[0] !== 1 || sourceSize !== null) {\n this._isScalar = false;\n }\n } else if (typeof arg === 'number') {\n this._dimensions.push(_createImmutableMatrix([arg]));\n } else if (typeof arg === 'string') {\n // object property (arguments.count should be 1)\n this._dimensions.push(arg);\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range');\n }\n this._sourceSize.push(sourceSize);\n // TODO: implement support for wildcard '*'\n }\n }\n\n /**\n * Attach type information\n */\n Index.prototype.type = 'Index';\n Index.prototype.isIndex = true;\n function _createImmutableMatrix(arg) {\n // loop array elements\n for (var i = 0, l = arg.length; i < l; i++) {\n if (typeof arg[i] !== 'number' || !isInteger(arg[i])) {\n throw new TypeError('Index parameters must be positive integer numbers');\n }\n }\n // create matrix\n return new ImmutableDenseMatrix(arg);\n }\n\n /**\n * Create a clone of the index\n * @memberof Index\n * @return {Index} clone\n */\n Index.prototype.clone = function () {\n var index = new Index();\n index._dimensions = clone(this._dimensions);\n index._isScalar = this._isScalar;\n index._sourceSize = this._sourceSize;\n return index;\n };\n\n /**\n * Create an index from an array with ranges/numbers\n * @memberof Index\n * @param {Array.} ranges\n * @return {Index} index\n * @private\n */\n Index.create = function (ranges) {\n var index = new Index();\n Index.apply(index, ranges);\n return index;\n };\n\n /**\n * Retrieve the size of the index, the number of elements for each dimension.\n * @memberof Index\n * @returns {number[]} size\n */\n Index.prototype.size = function () {\n var size = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var d = this._dimensions[i];\n size[i] = typeof d === 'string' ? 1 : d.size()[0];\n }\n return size;\n };\n\n /**\n * Get the maximum value for each of the indexes ranges.\n * @memberof Index\n * @returns {number[]} max\n */\n Index.prototype.max = function () {\n var values = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var range = this._dimensions[i];\n values[i] = typeof range === 'string' ? range : range.max();\n }\n return values;\n };\n\n /**\n * Get the minimum value for each of the indexes ranges.\n * @memberof Index\n * @returns {number[]} min\n */\n Index.prototype.min = function () {\n var values = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var range = this._dimensions[i];\n values[i] = typeof range === 'string' ? range : range.min();\n }\n return values;\n };\n\n /**\n * Loop over each of the ranges of the index\n * @memberof Index\n * @param {Function} callback Called for each range with a Range as first\n * argument, the dimension as second, and the\n * index object as third.\n */\n Index.prototype.forEach = function (callback) {\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n callback(this._dimensions[i], i, this);\n }\n };\n\n /**\n * Retrieve the dimension for the given index\n * @memberof Index\n * @param {Number} dim Number of the dimension\n * @returns {Range | null} range\n */\n Index.prototype.dimension = function (dim) {\n return this._dimensions[dim] || null;\n };\n\n /**\n * Test whether this index contains an object property\n * @returns {boolean} Returns true if the index is an object property\n */\n Index.prototype.isObjectProperty = function () {\n return this._dimensions.length === 1 && typeof this._dimensions[0] === 'string';\n };\n\n /**\n * Returns the object property name when the Index holds a single object property,\n * else returns null\n * @returns {string | null}\n */\n Index.prototype.getObjectProperty = function () {\n return this.isObjectProperty() ? this._dimensions[0] : null;\n };\n\n /**\n * Test whether this index contains only a single value.\n *\n * This is the case when the index is created with only scalar values as ranges,\n * not for ranges resolving into a single value.\n * @memberof Index\n * @return {boolean} isScalar\n */\n Index.prototype.isScalar = function () {\n return this._isScalar;\n };\n\n /**\n * Expand the Index into an array.\n * For example new Index([0,3], [2,7]) returns [[0,1,2], [2,3,4,5,6]]\n * @memberof Index\n * @returns {Array} array\n */\n Index.prototype.toArray = function () {\n var array = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var dimension = this._dimensions[i];\n array.push(typeof dimension === 'string' ? dimension : dimension.toArray());\n }\n return array;\n };\n\n /**\n * Get the primitive value of the Index, a two dimensional array.\n * Equivalent to Index.toArray().\n * @memberof Index\n * @returns {Array} array\n */\n Index.prototype.valueOf = Index.prototype.toArray;\n\n /**\n * Get the string representation of the index, for example '[2:6]' or '[0:2:10, 4:7, [1,2,3]]'\n * @memberof Index\n * @returns {String} str\n */\n Index.prototype.toString = function () {\n var strings = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var dimension = this._dimensions[i];\n if (typeof dimension === 'string') {\n strings.push(JSON.stringify(dimension));\n } else {\n strings.push(dimension.toString());\n }\n }\n return '[' + strings.join(', ') + ']';\n };\n\n /**\n * Get a JSON representation of the Index\n * @memberof Index\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Index\", \"ranges\": [{\"mathjs\": \"Range\", start: 0, end: 10, step:1}, ...]}`\n */\n Index.prototype.toJSON = function () {\n return {\n mathjs: 'Index',\n dimensions: this._dimensions\n };\n };\n\n /**\n * Instantiate an Index from a JSON object\n * @memberof Index\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Index\", \"dimensions\": [{\"mathjs\": \"Range\", start: 0, end: 10, step:1}, ...]}`\n * @return {Index}\n */\n Index.fromJSON = function (json) {\n return Index.create(json.dimensions);\n };\n return Index;\n}, {\n isClass: true\n});\n\n/**\n * Receives an array of booleans and returns an array of Numbers for Index\n * @param {Array} booleanArrayIndex An array of booleans\n * @return {Array} A set of numbers ready for index\n */\nfunction _booleansArrayToNumbersForIndex(booleanArrayIndex) {\n // gets an array of booleans and returns an array of numbers\n var indexOfNumbers = [];\n booleanArrayIndex.forEach((bool, idx) => {\n if (bool) {\n indexOfNumbers.push(idx);\n }\n });\n return indexOfNumbers;\n}", "import { factory } from '../../utils/factory.js';\nvar name = 'FibonacciHeap';\nvar dependencies = ['smaller', 'larger'];\nexport var createFibonacciHeapClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n smaller,\n larger\n } = _ref;\n var oneOverLogPhi = 1.0 / Math.log((1.0 + Math.sqrt(5.0)) / 2.0);\n\n /**\n * Fibonacci Heap implementation, used interally for Matrix math.\n * @class FibonacciHeap\n * @constructor FibonacciHeap\n */\n function FibonacciHeap() {\n if (!(this instanceof FibonacciHeap)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // initialize fields\n this._minimum = null;\n this._size = 0;\n }\n\n /**\n * Attach type information\n */\n FibonacciHeap.prototype.type = 'FibonacciHeap';\n FibonacciHeap.prototype.isFibonacciHeap = true;\n\n /**\n * Inserts a new data element into the heap. No heap consolidation is\n * performed at this time, the new node is simply inserted into the root\n * list of this heap. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.insert = function (key, value) {\n // create node\n var node = {\n key,\n value,\n degree: 0\n };\n // check we have a node in the minimum\n if (this._minimum) {\n // minimum node\n var minimum = this._minimum;\n // update left & right of node\n node.left = minimum;\n node.right = minimum.right;\n minimum.right = node;\n node.right.left = node;\n // update minimum node in heap if needed\n if (smaller(key, minimum.key)) {\n // node has a smaller key, use it as minimum\n this._minimum = node;\n }\n } else {\n // set left & right\n node.left = node;\n node.right = node;\n // this is the first node\n this._minimum = node;\n }\n // increment number of nodes in heap\n this._size++;\n // return node\n return node;\n };\n\n /**\n * Returns the number of nodes in heap. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.size = function () {\n return this._size;\n };\n\n /**\n * Removes all elements from this heap.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.clear = function () {\n this._minimum = null;\n this._size = 0;\n };\n\n /**\n * Returns true if the heap is empty, otherwise false.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.isEmpty = function () {\n return this._size === 0;\n };\n\n /**\n * Extracts the node with minimum key from heap. Amortized running\n * time: O(log n).\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.extractMinimum = function () {\n // node to remove\n var node = this._minimum;\n // check we have a minimum\n if (node === null) {\n return node;\n }\n // current minimum\n var minimum = this._minimum;\n // get number of children\n var numberOfChildren = node.degree;\n // pointer to the first child\n var x = node.child;\n // for each child of node do...\n while (numberOfChildren > 0) {\n // store node in right side\n var tempRight = x.right;\n // remove x from child list\n x.left.right = x.right;\n x.right.left = x.left;\n // add x to root list of heap\n x.left = minimum;\n x.right = minimum.right;\n minimum.right = x;\n x.right.left = x;\n // set Parent[x] to null\n x.parent = null;\n x = tempRight;\n numberOfChildren--;\n }\n // remove node from root list of heap\n node.left.right = node.right;\n node.right.left = node.left;\n // update minimum\n if (node === node.right) {\n // empty\n minimum = null;\n } else {\n // update minimum\n minimum = node.right;\n // we need to update the pointer to the root with minimum key\n minimum = _findMinimumNode(minimum, this._size);\n }\n // decrement size of heap\n this._size--;\n // update minimum\n this._minimum = minimum;\n // return node\n return node;\n };\n\n /**\n * Removes a node from the heap given the reference to the node. The trees\n * in the heap will be consolidated, if necessary. This operation may fail\n * to remove the correct element if there are nodes with key value -Infinity.\n * Running time: O(log n) amortized.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.remove = function (node) {\n // decrease key value\n this._minimum = _decreaseKey(this._minimum, node, -1);\n // remove the smallest\n this.extractMinimum();\n };\n\n /**\n * Decreases the key value for a heap node, given the new value to take on.\n * The structure of the heap may be changed and will not be consolidated.\n * Running time: O(1) amortized.\n * @memberof FibonacciHeap\n */\n function _decreaseKey(minimum, node, key) {\n // set node key\n node.key = key;\n // get parent node\n var parent = node.parent;\n if (parent && smaller(node.key, parent.key)) {\n // remove node from parent\n _cut(minimum, node, parent);\n // remove all nodes from parent to the root parent\n _cascadingCut(minimum, parent);\n }\n // update minimum node if needed\n if (smaller(node.key, minimum.key)) {\n minimum = node;\n }\n // return minimum\n return minimum;\n }\n\n /**\n * The reverse of the link operation: removes node from the child list of parent.\n * This method assumes that min is non-null. Running time: O(1).\n * @memberof FibonacciHeap\n */\n function _cut(minimum, node, parent) {\n // remove node from parent children and decrement Degree[parent]\n node.left.right = node.right;\n node.right.left = node.left;\n parent.degree--;\n // reset y.child if necessary\n if (parent.child === node) {\n parent.child = node.right;\n }\n // remove child if degree is 0\n if (parent.degree === 0) {\n parent.child = null;\n }\n // add node to root list of heap\n node.left = minimum;\n node.right = minimum.right;\n minimum.right = node;\n node.right.left = node;\n // set parent[node] to null\n node.parent = null;\n // set mark[node] to false\n node.mark = false;\n }\n\n /**\n * Performs a cascading cut operation. This cuts node from its parent and then\n * does the same for its parent, and so on up the tree.\n * Running time: O(log n); O(1) excluding the recursion.\n * @memberof FibonacciHeap\n */\n function _cascadingCut(minimum, node) {\n // store parent node\n var parent = node.parent;\n // if there's a parent...\n if (!parent) {\n return;\n }\n // if node is unmarked, set it marked\n if (!node.mark) {\n node.mark = true;\n } else {\n // it's marked, cut it from parent\n _cut(minimum, node, parent);\n // cut its parent as well\n _cascadingCut(parent);\n }\n }\n\n /**\n * Make the first node a child of the second one. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n var _linkNodes = function _linkNodes(node, parent) {\n // remove node from root list of heap\n node.left.right = node.right;\n node.right.left = node.left;\n // make node a Child of parent\n node.parent = parent;\n if (!parent.child) {\n parent.child = node;\n node.right = node;\n node.left = node;\n } else {\n node.left = parent.child;\n node.right = parent.child.right;\n parent.child.right = node;\n node.right.left = node;\n }\n // increase degree[parent]\n parent.degree++;\n // set mark[node] false\n node.mark = false;\n };\n function _findMinimumNode(minimum, size) {\n // to find trees of the same degree efficiently we use an array of length O(log n) in which we keep a pointer to one root of each degree\n var arraySize = Math.floor(Math.log(size) * oneOverLogPhi) + 1;\n // create list with initial capacity\n var array = new Array(arraySize);\n // find the number of root nodes.\n var numRoots = 0;\n var x = minimum;\n if (x) {\n numRoots++;\n x = x.right;\n while (x !== minimum) {\n numRoots++;\n x = x.right;\n }\n }\n // vars\n var y;\n // For each node in root list do...\n while (numRoots > 0) {\n // access this node's degree..\n var d = x.degree;\n // get next node\n var next = x.right;\n // check if there is a node already in array with the same degree\n while (true) {\n // get node with the same degree is any\n y = array[d];\n if (!y) {\n break;\n }\n // make one node with the same degree a child of the other, do this based on the key value.\n if (larger(x.key, y.key)) {\n var temp = y;\n y = x;\n x = temp;\n }\n // make y a child of x\n _linkNodes(y, x);\n // we have handled this degree, go to next one.\n array[d] = null;\n d++;\n }\n // save this node for later when we might encounter another of the same degree.\n array[d] = x;\n // move forward through list.\n x = next;\n numRoots--;\n }\n // Set min to null (effectively losing the root list) and reconstruct the root list from the array entries in array[].\n minimum = null;\n // loop nodes in array\n for (var i = 0; i < arraySize; i++) {\n // get current node\n y = array[i];\n if (!y) {\n continue;\n }\n // check if we have a linked list\n if (minimum) {\n // First remove node from root list.\n y.left.right = y.right;\n y.right.left = y.left;\n // now add to root list, again.\n y.left = minimum;\n y.right = minimum.right;\n minimum.right = y;\n y.right.left = y;\n // check if this is a new min.\n if (smaller(y.key, minimum.key)) {\n minimum = y;\n }\n } else {\n minimum = y;\n }\n }\n return minimum;\n }\n return FibonacciHeap;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'Spa';\nvar dependencies = ['addScalar', 'equalScalar', 'FibonacciHeap'];\nexport var createSpaClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n addScalar,\n equalScalar,\n FibonacciHeap\n } = _ref;\n /**\n * An ordered Sparse Accumulator is a representation for a sparse vector that includes a dense array\n * of the vector elements and an ordered list of non-zero elements.\n */\n function Spa() {\n if (!(this instanceof Spa)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // allocate vector, TODO use typed arrays\n this._values = [];\n this._heap = new FibonacciHeap();\n }\n\n /**\n * Attach type information\n */\n Spa.prototype.type = 'Spa';\n Spa.prototype.isSpa = true;\n\n /**\n * Set the value for index i.\n *\n * @param {number} i The index\n * @param {number | BigNumber | Complex} The value at index i\n */\n Spa.prototype.set = function (i, v) {\n // check we have a value @ i\n if (!this._values[i]) {\n // insert in heap\n var node = this._heap.insert(i, v);\n // set the value @ i\n this._values[i] = node;\n } else {\n // update the value @ i\n this._values[i].value = v;\n }\n };\n Spa.prototype.get = function (i) {\n var node = this._values[i];\n if (node) {\n return node.value;\n }\n return 0;\n };\n Spa.prototype.accumulate = function (i, v) {\n // node @ i\n var node = this._values[i];\n if (!node) {\n // insert in heap\n node = this._heap.insert(i, v);\n // initialize value\n this._values[i] = node;\n } else {\n // accumulate value\n node.value = addScalar(node.value, v);\n }\n };\n Spa.prototype.forEach = function (from, to, callback) {\n // references\n var heap = this._heap;\n var values = this._values;\n // nodes\n var nodes = [];\n // node with minimum key, save it\n var node = heap.extractMinimum();\n if (node) {\n nodes.push(node);\n }\n // extract nodes from heap (ordered)\n while (node && node.key <= to) {\n // check it is in range\n if (node.key >= from) {\n // check value is not zero\n if (!equalScalar(node.value, 0)) {\n // invoke callback\n callback(node.key, node.value, this);\n }\n }\n // extract next node, save it\n node = heap.extractMinimum();\n if (node) {\n nodes.push(node);\n }\n }\n // reinsert all nodes in heap\n for (var i = 0; i < nodes.length; i++) {\n // current node\n var n = nodes[i];\n // insert node in heap\n node = heap.insert(n.key, n.value);\n // update values\n values[node.key] = node;\n }\n };\n Spa.prototype.swap = function (i, j) {\n // node @ i and j\n var nodei = this._values[i];\n var nodej = this._values[j];\n // check we need to insert indeces\n if (!nodei && nodej) {\n // insert in heap\n nodei = this._heap.insert(i, nodej.value);\n // remove from heap\n this._heap.remove(nodej);\n // set values\n this._values[i] = nodei;\n this._values[j] = undefined;\n } else if (nodei && !nodej) {\n // insert in heap\n nodej = this._heap.insert(j, nodei.value);\n // remove from heap\n this._heap.remove(nodei);\n // set values\n this._values[j] = nodej;\n this._values[i] = undefined;\n } else if (nodei && nodej) {\n // swap values\n var v = nodei.value;\n nodei.value = nodej.value;\n nodej.value = v;\n }\n };\n return Spa;\n}, {\n isClass: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isComplex, isUnit, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { memoize } from '../../utils/function.js';\nimport { endsWith } from '../../utils/string.js';\nimport { clone, hasOwnProperty } from '../../utils/object.js';\nimport { createBigNumberPi as createPi } from '../../utils/bignumber/constants.js';\nvar name = 'Unit';\nvar dependencies = ['?on', 'config', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'abs', 'fix', 'round', 'equal', 'isNumeric', 'format', 'number', 'Complex', 'BigNumber', 'Fraction'];\nexport var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n config,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n pow,\n abs,\n fix,\n round,\n equal,\n isNumeric,\n format,\n number: _number,\n Complex,\n BigNumber: _BigNumber,\n Fraction: _Fraction\n } = _ref;\n var toNumber = _number;\n /**\n * A unit can be constructed in the following ways:\n *\n * const a = new Unit(value, valuelessUnit)\n * const b = new Unit(null, valuelessUnit)\n * const c = Unit.parse(str)\n *\n * Example usage:\n *\n * const a = new Unit(5, 'cm') // 50 mm\n * const b = Unit.parse('23 kg') // 23 kg\n * const c = math.in(a, new Unit(null, 'm') // 0.05 m\n * const d = new Unit(9.81, \"m/s^2\") // 9.81 m/s^2\n *\n * @class Unit\n * @constructor Unit\n * @param {number | BigNumber | Fraction | Complex | boolean} [value] A value like 5.2\n * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like \"cm\"\n */\n function Unit(value, valuelessUnit) {\n if (!(this instanceof Unit)) {\n throw new Error('Constructor must be called with the new operator');\n }\n if (!(value === null || value === undefined || isNumeric(value) || isComplex(value))) {\n throw new TypeError('First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined');\n }\n this.fixPrefix = false; // if true, function format will not search for the\n // best prefix but leave it as initially provided.\n // fixPrefix is set true by the method Unit.to\n\n // The justification behind this is that if the constructor is explicitly called,\n // the caller wishes the units to be returned exactly as supplied.\n this.skipAutomaticSimplification = true;\n if (valuelessUnit === undefined) {\n this.units = [];\n this.dimensions = BASE_DIMENSIONS.map(x => 0);\n } else if (typeof valuelessUnit === 'string') {\n var u = Unit.parse(valuelessUnit);\n this.units = u.units;\n this.dimensions = u.dimensions;\n } else if (isUnit(valuelessUnit) && valuelessUnit.value === null) {\n // clone from valuelessUnit\n this.fixPrefix = valuelessUnit.fixPrefix;\n this.skipAutomaticSimplification = valuelessUnit.skipAutomaticSimplification;\n this.dimensions = valuelessUnit.dimensions.slice(0);\n this.units = valuelessUnit.units.map(u => _extends({}, u));\n } else {\n throw new TypeError('Second parameter in Unit constructor must be a string or valueless Unit');\n }\n this.value = this._normalize(value);\n }\n\n /**\n * Attach type information\n */\n Object.defineProperty(Unit, 'name', {\n value: 'Unit'\n });\n Unit.prototype.constructor = Unit;\n Unit.prototype.type = 'Unit';\n Unit.prototype.isUnit = true;\n\n // private variables and functions for the Unit parser\n var text, index, c;\n function skipWhitespace() {\n while (c === ' ' || c === '\\t') {\n next();\n }\n }\n function isDigitDot(c) {\n return c >= '0' && c <= '9' || c === '.';\n }\n function isDigit(c) {\n return c >= '0' && c <= '9';\n }\n function next() {\n index++;\n c = text.charAt(index);\n }\n function revert(oldIndex) {\n index = oldIndex;\n c = text.charAt(index);\n }\n function parseNumber() {\n var number = '';\n var oldIndex = index;\n if (c === '+') {\n next();\n } else if (c === '-') {\n number += c;\n next();\n }\n if (!isDigitDot(c)) {\n // a + or - must be followed by a digit\n revert(oldIndex);\n return null;\n }\n\n // get number, can have a single dot\n if (c === '.') {\n number += c;\n next();\n if (!isDigit(c)) {\n // this is no legal number, it is just a dot\n revert(oldIndex);\n return null;\n }\n } else {\n while (isDigit(c)) {\n number += c;\n next();\n }\n if (c === '.') {\n number += c;\n next();\n }\n }\n while (isDigit(c)) {\n number += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\" or \"1.23e50\"\n if (c === 'E' || c === 'e') {\n // The grammar branches here. This could either be part of an exponent or the start of a unit that begins with the letter e, such as \"4exabytes\"\n\n var tentativeNumber = '';\n var tentativeIndex = index;\n tentativeNumber += c;\n next();\n if (c === '+' || c === '-') {\n tentativeNumber += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent (otherwise we assume it is not scientific notation)\n if (!isDigit(c)) {\n // The e or E must belong to something else, so return the number without the e or E.\n revert(tentativeIndex);\n return number;\n }\n\n // We can now safely say that this is scientific notation.\n number = number + tentativeNumber;\n while (isDigit(c)) {\n number += c;\n next();\n }\n }\n return number;\n }\n function parseUnit() {\n var unitName = '';\n\n // Alphanumeric characters only; matches [a-zA-Z0-9]\n while (isDigit(c) || Unit.isValidAlpha(c)) {\n unitName += c;\n next();\n }\n\n // Must begin with [a-zA-Z]\n var firstC = unitName.charAt(0);\n if (Unit.isValidAlpha(firstC)) {\n return unitName;\n } else {\n return null;\n }\n }\n function parseCharacter(toFind) {\n if (c === toFind) {\n next();\n return toFind;\n } else {\n return null;\n }\n }\n\n /**\n * Parse a string into a unit. The value of the unit is parsed as number,\n * BigNumber, or Fraction depending on the math.js config setting `number`.\n *\n * Throws an exception if the provided string does not contain a valid unit or\n * cannot be parsed.\n * @memberof Unit\n * @param {string} str A string like \"5.2 inch\", \"4e2 cm/s^2\"\n * @return {Unit} unit\n */\n Unit.parse = function (str, options) {\n options = options || {};\n text = str;\n index = -1;\n c = '';\n if (typeof text !== 'string') {\n throw new TypeError('Invalid argument in Unit.parse, string expected');\n }\n var unit = new Unit();\n unit.units = [];\n var powerMultiplierCurrent = 1;\n var expectingUnit = false;\n\n // A unit should follow this pattern:\n // [number] ...[ [*/] unit[^number] ]\n // unit[^number] ... [ [*/] unit[^number] ]\n\n // Rules:\n // number is any floating point number.\n // unit is any alphanumeric string beginning with an alpha. Units with names like e3 should be avoided because they look like the exponent of a floating point number!\n // The string may optionally begin with a number.\n // Each unit may optionally be followed by ^number.\n // Whitespace or a forward slash is recommended between consecutive units, although the following technically is parseable:\n // 2m^2kg/s^2\n // it is not good form. If a unit starts with e, then it could be confused as a floating point number:\n // 4erg\n\n next();\n skipWhitespace();\n\n // Optional number at the start of the string\n var valueStr = parseNumber();\n var value = null;\n if (valueStr) {\n if (config.number === 'BigNumber') {\n value = new _BigNumber(valueStr);\n } else if (config.number === 'Fraction') {\n try {\n // not all numbers can be turned in Fractions, for example very small numbers not\n value = new _Fraction(valueStr);\n } catch (err) {\n value = parseFloat(valueStr);\n }\n } else {\n // number\n value = parseFloat(valueStr);\n }\n skipWhitespace(); // Whitespace is not required here\n\n // handle multiplication or division right after the value, like '1/s'\n if (parseCharacter('*')) {\n powerMultiplierCurrent = 1;\n expectingUnit = true;\n } else if (parseCharacter('/')) {\n powerMultiplierCurrent = -1;\n expectingUnit = true;\n }\n }\n\n // Stack to keep track of powerMultipliers applied to each parentheses group\n var powerMultiplierStack = [];\n\n // Running product of all elements in powerMultiplierStack\n var powerMultiplierStackProduct = 1;\n while (true) {\n skipWhitespace();\n\n // Check for and consume opening parentheses, pushing powerMultiplierCurrent to the stack\n // A '(' will always appear directly before a unit.\n while (c === '(') {\n powerMultiplierStack.push(powerMultiplierCurrent);\n powerMultiplierStackProduct *= powerMultiplierCurrent;\n powerMultiplierCurrent = 1;\n next();\n skipWhitespace();\n }\n\n // Is there something here?\n var uStr = void 0;\n if (c) {\n var oldC = c;\n uStr = parseUnit();\n if (uStr === null) {\n throw new SyntaxError('Unexpected \"' + oldC + '\" in \"' + text + '\" at index ' + index.toString());\n }\n } else {\n // End of input.\n break;\n }\n\n // Verify the unit exists and get the prefix (if any)\n var res = _findUnit(uStr);\n if (res === null) {\n // Unit not found.\n throw new SyntaxError('Unit \"' + uStr + '\" not found.');\n }\n var power = powerMultiplierCurrent * powerMultiplierStackProduct;\n // Is there a \"^ number\"?\n skipWhitespace();\n if (parseCharacter('^')) {\n skipWhitespace();\n var p = parseNumber();\n if (p === null) {\n // No valid number found for the power!\n throw new SyntaxError('In \"' + str + '\", \"^\" must be followed by a floating-point number');\n }\n power *= p;\n }\n\n // Add the unit to the list\n unit.units.push({\n unit: res.unit,\n prefix: res.prefix,\n power\n });\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n unit.dimensions[i] += (res.unit.dimensions[i] || 0) * power;\n }\n\n // Check for and consume closing parentheses, popping from the stack.\n // A ')' will always follow a unit.\n skipWhitespace();\n while (c === ')') {\n if (powerMultiplierStack.length === 0) {\n throw new SyntaxError('Unmatched \")\" in \"' + text + '\" at index ' + index.toString());\n }\n powerMultiplierStackProduct /= powerMultiplierStack.pop();\n next();\n skipWhitespace();\n }\n\n // \"*\" and \"/\" should mean we are expecting something to come next.\n // Is there a forward slash? If so, negate powerMultiplierCurrent. The next unit or paren group is in the denominator.\n expectingUnit = false;\n if (parseCharacter('*')) {\n // explicit multiplication\n powerMultiplierCurrent = 1;\n expectingUnit = true;\n } else if (parseCharacter('/')) {\n // division\n powerMultiplierCurrent = -1;\n expectingUnit = true;\n } else {\n // implicit multiplication\n powerMultiplierCurrent = 1;\n }\n\n // Replace the unit into the auto unit system\n if (res.unit.base) {\n var baseDim = res.unit.base.key;\n UNIT_SYSTEMS.auto[baseDim] = {\n unit: res.unit,\n prefix: res.prefix\n };\n }\n }\n\n // Has the string been entirely consumed?\n skipWhitespace();\n if (c) {\n throw new SyntaxError('Could not parse: \"' + str + '\"');\n }\n\n // Is there a trailing slash?\n if (expectingUnit) {\n throw new SyntaxError('Trailing characters: \"' + str + '\"');\n }\n\n // Is the parentheses stack empty?\n if (powerMultiplierStack.length !== 0) {\n throw new SyntaxError('Unmatched \"(\" in \"' + text + '\"');\n }\n\n // Are there any units at all?\n if (unit.units.length === 0 && !options.allowNoUnits) {\n throw new SyntaxError('\"' + str + '\" contains no units');\n }\n unit.value = value !== undefined ? unit._normalize(value) : null;\n return unit;\n };\n\n /**\n * create a copy of this unit\n * @memberof Unit\n * @return {Unit} Returns a cloned version of the unit\n */\n Unit.prototype.clone = function () {\n var unit = new Unit();\n unit.fixPrefix = this.fixPrefix;\n unit.skipAutomaticSimplification = this.skipAutomaticSimplification;\n unit.value = clone(this.value);\n unit.dimensions = this.dimensions.slice(0);\n unit.units = [];\n for (var i = 0; i < this.units.length; i++) {\n unit.units[i] = {};\n for (var p in this.units[i]) {\n if (hasOwnProperty(this.units[i], p)) {\n unit.units[i][p] = this.units[i][p];\n }\n }\n }\n return unit;\n };\n\n /**\n * Return the type of the value of this unit\n *\n * @memberof Unit\n * @ return {string} type of the value of the unit\n */\n Unit.prototype.valueType = function () {\n return typeOf(this.value);\n };\n\n /**\n * Return whether the unit is derived (such as m/s, or cm^2, but not N)\n * @memberof Unit\n * @return {boolean} True if the unit is derived\n */\n Unit.prototype._isDerived = function () {\n if (this.units.length === 0) {\n return false;\n }\n return this.units.length > 1 || Math.abs(this.units[0].power - 1.0) > 1e-15;\n };\n\n /**\n * Normalize a value, based on its currently set unit(s)\n * @memberof Unit\n * @param {number | BigNumber | Fraction | boolean} value\n * @return {number | BigNumber | Fraction | boolean} normalized value\n * @private\n */\n Unit.prototype._normalize = function (value) {\n if (value === null || value === undefined || this.units.length === 0) {\n return value;\n }\n var res = value;\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n for (var i = 0; i < this.units.length; i++) {\n var unitValue = convert(this.units[i].unit.value);\n var unitPrefixValue = convert(this.units[i].prefix.value);\n var unitPower = convert(this.units[i].power);\n res = multiplyScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));\n }\n return res;\n };\n\n /**\n * Denormalize a value, based on its currently set unit(s)\n * @memberof Unit\n * @param {number} value\n * @param {number} [prefixValue] Optional prefix value to be used (ignored if this is a derived unit)\n * @return {number} denormalized value\n * @private\n */\n Unit.prototype._denormalize = function (value, prefixValue) {\n if (value === null || value === undefined || this.units.length === 0) {\n return value;\n }\n var res = value;\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n for (var i = 0; i < this.units.length; i++) {\n var unitValue = convert(this.units[i].unit.value);\n var unitPrefixValue = convert(this.units[i].prefix.value);\n var unitPower = convert(this.units[i].power);\n res = divideScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));\n }\n return res;\n };\n\n /**\n * Find a unit from a string\n * @memberof Unit\n * @param {string} str A string like 'cm' or 'inch'\n * @returns {Object | null} result When found, an object with fields unit and\n * prefix is returned. Else, null is returned.\n * @private\n */\n var _findUnit = memoize(str => {\n // First, match units names exactly. For example, a user could define 'mm' as 10^-4 m, which is silly, but then we would want 'mm' to match the user-defined unit.\n if (hasOwnProperty(UNITS, str)) {\n var unit = UNITS[str];\n var prefix = unit.prefixes[''];\n return {\n unit,\n prefix\n };\n }\n for (var _name in UNITS) {\n if (hasOwnProperty(UNITS, _name)) {\n if (endsWith(str, _name)) {\n var _unit = UNITS[_name];\n var prefixLen = str.length - _name.length;\n var prefixName = str.substring(0, prefixLen);\n var _prefix = hasOwnProperty(_unit.prefixes, prefixName) ? _unit.prefixes[prefixName] : undefined;\n if (_prefix !== undefined) {\n // store unit, prefix, and value\n return {\n unit: _unit,\n prefix: _prefix\n };\n }\n }\n }\n }\n return null;\n }, {\n hasher: args => args[0],\n limit: 100\n });\n\n /**\n * Test if the given expression is a unit.\n * The unit can have a prefix but cannot have a value.\n * @memberof Unit\n * @param {string} name A string to be tested whether it is a value less unit.\n * The unit can have prefix, like \"cm\"\n * @return {boolean} true if the given string is a unit\n */\n Unit.isValuelessUnit = function (name) {\n return _findUnit(name) !== null;\n };\n\n /**\n * check if this unit has given base unit\n * If this unit is a derived unit, this will ALWAYS return false, since by definition base units are not derived.\n * @memberof Unit\n * @param {BASE_UNITS | string | undefined} base\n */\n Unit.prototype.hasBase = function (base) {\n if (typeof base === 'string') {\n base = BASE_UNITS[base];\n }\n if (!base) {\n return false;\n }\n\n // All dimensions must be the same\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n if (Math.abs((this.dimensions[i] || 0) - (base.dimensions[i] || 0)) > 1e-12) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * Check if this unit has a base or bases equal to another base or bases\n * For derived units, the exponent on each base also must match\n * @memberof Unit\n * @param {Unit} other\n * @return {boolean} true if equal base\n */\n Unit.prototype.equalBase = function (other) {\n // All dimensions must be the same\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n if (Math.abs((this.dimensions[i] || 0) - (other.dimensions[i] || 0)) > 1e-12) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * Check if this unit equals another unit\n * @memberof Unit\n * @param {Unit} other\n * @return {boolean} true if both units are equal\n */\n Unit.prototype.equals = function (other) {\n return this.equalBase(other) && equal(this.value, other.value);\n };\n\n /**\n * Multiply this unit with another one or with a scalar\n * @memberof Unit\n * @param {Unit} other\n * @return {Unit} product of this unit and the other unit\n */\n Unit.prototype.multiply = function (_other) {\n var res = this.clone();\n var other = isUnit(_other) ? _other : new Unit(_other);\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) + (other.dimensions[i] || 0);\n }\n\n // Append other's units list onto res\n for (var _i = 0; _i < other.units.length; _i++) {\n // Make a shallow copy of every unit\n var inverted = _objectSpread({}, other.units[_i]);\n res.units.push(inverted);\n }\n\n // If at least one operand has a value, then the result should also have a value\n if (this.value !== null || other.value !== null) {\n var valThis = this.value === null ? this._normalize(1) : this.value;\n var valOther = other.value === null ? other._normalize(1) : other.value;\n res.value = multiplyScalar(valThis, valOther);\n } else {\n res.value = null;\n }\n if (isUnit(_other)) {\n res.skipAutomaticSimplification = false;\n }\n return getNumericIfUnitless(res);\n };\n\n /**\n * Divide a number by this unit\n *\n * @memberof Unit\n * @param {numeric} numerator\n * @param {unit} result of dividing numerator by this unit\n */\n Unit.prototype.divideInto = function (numerator) {\n return new Unit(numerator).divide(this);\n };\n\n /**\n * Divide this unit by another one\n * @memberof Unit\n * @param {Unit | numeric} other\n * @return {Unit} result of dividing this unit by the other unit\n */\n Unit.prototype.divide = function (_other) {\n var res = this.clone();\n var other = isUnit(_other) ? _other : new Unit(_other);\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) - (other.dimensions[i] || 0);\n }\n\n // Invert and append other's units list onto res\n for (var _i2 = 0; _i2 < other.units.length; _i2++) {\n // Make a shallow copy of every unit\n var inverted = _objectSpread(_objectSpread({}, other.units[_i2]), {}, {\n power: -other.units[_i2].power\n });\n res.units.push(inverted);\n }\n\n // If at least one operand has a value, the result should have a value\n if (this.value !== null || other.value !== null) {\n var valThis = this.value === null ? this._normalize(1) : this.value;\n var valOther = other.value === null ? other._normalize(1) : other.value;\n res.value = divideScalar(valThis, valOther);\n } else {\n res.value = null;\n }\n if (isUnit(_other)) {\n res.skipAutomaticSimplification = false;\n }\n return getNumericIfUnitless(res);\n };\n\n /**\n * Calculate the power of a unit\n * @memberof Unit\n * @param {number | Fraction | BigNumber} p\n * @returns {Unit} The result: this^p\n */\n Unit.prototype.pow = function (p) {\n var res = this.clone();\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) * p;\n }\n\n // Adjust the power of each unit in the list\n for (var _i3 = 0; _i3 < res.units.length; _i3++) {\n res.units[_i3].power *= p;\n }\n if (res.value !== null) {\n res.value = pow(res.value, p);\n\n // only allow numeric output, we don't want to return a Complex number\n // if (!isNumeric(res.value)) {\n // res.value = NaN\n // }\n // Update: Complex supported now\n } else {\n res.value = null;\n }\n res.skipAutomaticSimplification = false;\n return getNumericIfUnitless(res);\n };\n\n /**\n * Return the numeric value of this unit if it is dimensionless, has a value, and config.predictable == false; or the original unit otherwise\n * @param {Unit} unit\n * @returns {number | Fraction | BigNumber | Unit} The numeric value of the unit if conditions are met, or the original unit otherwise\n */\n function getNumericIfUnitless(unit) {\n if (unit.equalBase(BASE_UNITS.NONE) && unit.value !== null && !config.predictable) {\n return unit.value;\n } else {\n return unit;\n }\n }\n\n /**\n * Calculate the absolute value of a unit\n * @memberof Unit\n * @param {number | Fraction | BigNumber} x\n * @returns {Unit} The result: |x|, absolute value of x\n */\n Unit.prototype.abs = function () {\n var ret = this.clone();\n if (ret.value !== null) {\n if (ret._isDerived() || ret.units.length === 0 || ret.units[0].unit.offset === 0) {\n ret.value = abs(ret.value);\n } else {\n // To give the correct, but unexpected, results for units with an offset.\n // For example, abs(-283.15 degC) = -263.15 degC !!!\n // We must take the offset into consideration here\n var convert = ret._numberConverter(); // convert to Fraction or BigNumber if needed\n var unitValue = convert(ret.units[0].unit.value);\n var nominalOffset = convert(ret.units[0].unit.offset);\n var unitOffset = multiplyScalar(unitValue, nominalOffset);\n ret.value = subtractScalar(abs(addScalar(ret.value, unitOffset)), unitOffset);\n }\n }\n for (var i in ret.units) {\n if (ret.units[i].unit.name === 'VA' || ret.units[i].unit.name === 'VAR') {\n ret.units[i].unit = UNITS.W;\n }\n }\n return ret;\n };\n\n /**\n * Convert the unit to a specific unit name.\n * @memberof Unit\n * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like \"cm\"\n * @returns {Unit} Returns a clone of the unit with a fixed prefix and unit.\n */\n Unit.prototype.to = function (valuelessUnit) {\n var value = this.value === null ? this._normalize(1) : this.value;\n var other;\n if (typeof valuelessUnit === 'string') {\n other = Unit.parse(valuelessUnit);\n } else if (isUnit(valuelessUnit)) {\n other = valuelessUnit.clone();\n } else {\n throw new Error('String or Unit expected as parameter');\n }\n if (!this.equalBase(other)) {\n throw new Error(\"Units do not match ('\".concat(other.toString(), \"' != '\").concat(this.toString(), \"')\"));\n }\n if (other.value !== null) {\n throw new Error('Cannot convert to a unit with a value');\n }\n if (this.value === null || this._isDerived() || this.units.length === 0 || other.units.length === 0 || this.units[0].unit.offset === other.units[0].unit.offset) {\n other.value = clone(value);\n } else {\n /* Need to adjust value by difference in offset to convert */\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n var thisUnitValue = this.units[0].unit.value;\n var thisNominalOffset = this.units[0].unit.offset;\n var thisUnitOffset = multiplyScalar(thisUnitValue, thisNominalOffset);\n var otherUnitValue = other.units[0].unit.value;\n var otherNominalOffset = other.units[0].unit.offset;\n var otherUnitOffset = multiplyScalar(otherUnitValue, otherNominalOffset);\n other.value = addScalar(value, convert(subtractScalar(thisUnitOffset, otherUnitOffset)));\n }\n other.fixPrefix = true;\n other.skipAutomaticSimplification = true;\n return other;\n };\n\n /**\n * Return the value of the unit when represented with given valueless unit\n * @memberof Unit\n * @param {string | Unit} valuelessUnit For example 'cm' or 'inch'\n * @return {number} Returns the unit value as number.\n */\n // TODO: deprecate Unit.toNumber? It's always better to use toNumeric\n Unit.prototype.toNumber = function (valuelessUnit) {\n return toNumber(this.toNumeric(valuelessUnit));\n };\n\n /**\n * Return the value of the unit in the original numeric type\n * @memberof Unit\n * @param {string | Unit} valuelessUnit For example 'cm' or 'inch'\n * @return {number | BigNumber | Fraction} Returns the unit value\n */\n Unit.prototype.toNumeric = function (valuelessUnit) {\n var other;\n if (valuelessUnit) {\n // Allow getting the numeric value without converting to a different unit\n other = this.to(valuelessUnit);\n } else {\n other = this.clone();\n }\n if (other._isDerived() || other.units.length === 0) {\n return other._denormalize(other.value);\n } else {\n return other._denormalize(other.value, other.units[0].prefix.value);\n }\n };\n\n /**\n * Get a string representation of the unit.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.toString = function () {\n return this.format();\n };\n\n /**\n * Get a JSON representation of the unit\n * @memberof Unit\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Unit\", \"value\": 2, \"unit\": \"cm\", \"fixPrefix\": false}`\n */\n Unit.prototype.toJSON = function () {\n return {\n mathjs: 'Unit',\n value: this._denormalize(this.value),\n unit: this.units.length > 0 ? this.formatUnits() : null,\n fixPrefix: this.fixPrefix\n };\n };\n\n /**\n * Instantiate a Unit from a JSON object\n * @memberof Unit\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Unit\", \"value\": 2, \"unit\": \"cm\", \"fixPrefix\": false}`\n * @return {Unit}\n */\n Unit.fromJSON = function (json) {\n var _json$unit;\n var unit = new Unit(json.value, (_json$unit = json.unit) !== null && _json$unit !== void 0 ? _json$unit : undefined);\n unit.fixPrefix = json.fixPrefix || false;\n return unit;\n };\n\n /**\n * Returns the string representation of the unit.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.valueOf = Unit.prototype.toString;\n\n /**\n * Simplify this Unit's unit list and return a new Unit with the simplified list.\n * The returned Unit will contain a list of the \"best\" units for formatting.\n */\n Unit.prototype.simplify = function () {\n var ret = this.clone();\n var proposedUnitList = [];\n\n // Search for a matching base\n var matchingBase;\n for (var key in currentUnitSystem) {\n if (hasOwnProperty(currentUnitSystem, key)) {\n if (ret.hasBase(BASE_UNITS[key])) {\n matchingBase = key;\n break;\n }\n }\n }\n if (matchingBase === 'NONE') {\n ret.units = [];\n } else {\n var matchingUnit;\n if (matchingBase) {\n // Does the unit system have a matching unit?\n if (hasOwnProperty(currentUnitSystem, matchingBase)) {\n matchingUnit = currentUnitSystem[matchingBase];\n }\n }\n if (matchingUnit) {\n ret.units = [{\n unit: matchingUnit.unit,\n prefix: matchingUnit.prefix,\n power: 1.0\n }];\n } else {\n // Multiple units or units with powers are formatted like this:\n // 5 (kg m^2) / (s^3 mol)\n // Build an representation from the base units of the current unit system\n var missingBaseDim = false;\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n var baseDim = BASE_DIMENSIONS[i];\n if (Math.abs(ret.dimensions[i] || 0) > 1e-12) {\n if (hasOwnProperty(currentUnitSystem, baseDim)) {\n proposedUnitList.push({\n unit: currentUnitSystem[baseDim].unit,\n prefix: currentUnitSystem[baseDim].prefix,\n power: ret.dimensions[i] || 0\n });\n } else {\n missingBaseDim = true;\n }\n }\n }\n\n // Is the proposed unit list \"simpler\" than the existing one?\n if (proposedUnitList.length < ret.units.length && !missingBaseDim) {\n // Replace this unit list with the proposed list\n ret.units = proposedUnitList;\n }\n }\n }\n return ret;\n };\n\n /**\n * Returns a new Unit in the SI system with the same value as this one\n */\n Unit.prototype.toSI = function () {\n var ret = this.clone();\n var proposedUnitList = [];\n\n // Multiple units or units with powers are formatted like this:\n // 5 (kg m^2) / (s^3 mol)\n // Build an representation from the base units of the SI unit system\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n var baseDim = BASE_DIMENSIONS[i];\n if (Math.abs(ret.dimensions[i] || 0) > 1e-12) {\n if (hasOwnProperty(UNIT_SYSTEMS.si, baseDim)) {\n proposedUnitList.push({\n unit: UNIT_SYSTEMS.si[baseDim].unit,\n prefix: UNIT_SYSTEMS.si[baseDim].prefix,\n power: ret.dimensions[i] || 0\n });\n } else {\n throw new Error('Cannot express custom unit ' + baseDim + ' in SI units');\n }\n }\n }\n\n // Replace this unit list with the proposed list\n ret.units = proposedUnitList;\n ret.fixPrefix = true;\n ret.skipAutomaticSimplification = true;\n if (this.value !== null) {\n ret.value = null;\n return this.to(ret);\n }\n return ret;\n };\n\n /**\n * Get a string representation of the units of this Unit, without the value. The unit list is formatted as-is without first being simplified.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.formatUnits = function () {\n var strNum = '';\n var strDen = '';\n var nNum = 0;\n var nDen = 0;\n for (var i = 0; i < this.units.length; i++) {\n if (this.units[i].power > 0) {\n nNum++;\n strNum += ' ' + this.units[i].prefix.name + this.units[i].unit.name;\n if (Math.abs(this.units[i].power - 1.0) > 1e-15) {\n strNum += '^' + this.units[i].power;\n }\n } else if (this.units[i].power < 0) {\n nDen++;\n }\n }\n if (nDen > 0) {\n for (var _i4 = 0; _i4 < this.units.length; _i4++) {\n if (this.units[_i4].power < 0) {\n if (nNum > 0) {\n strDen += ' ' + this.units[_i4].prefix.name + this.units[_i4].unit.name;\n if (Math.abs(this.units[_i4].power + 1.0) > 1e-15) {\n strDen += '^' + -this.units[_i4].power;\n }\n } else {\n strDen += ' ' + this.units[_i4].prefix.name + this.units[_i4].unit.name;\n strDen += '^' + this.units[_i4].power;\n }\n }\n }\n }\n // Remove leading \" \"\n strNum = strNum.substr(1);\n strDen = strDen.substr(1);\n\n // Add parans for better copy/paste back into evaluate, for example, or for better pretty print formatting\n if (nNum > 1 && nDen > 0) {\n strNum = '(' + strNum + ')';\n }\n if (nDen > 1 && nNum > 0) {\n strDen = '(' + strDen + ')';\n }\n var str = strNum;\n if (nNum > 0 && nDen > 0) {\n str += ' / ';\n }\n str += strDen;\n return str;\n };\n\n /**\n * Get a string representation of the Unit, with optional formatting options.\n * @memberof Unit\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @return {string}\n */\n Unit.prototype.format = function (options) {\n // Simplfy the unit list, unless it is valueless or was created directly in the\n // constructor or as the result of to or toSI\n var simp = this.skipAutomaticSimplification || this.value === null ? this.clone() : this.simplify();\n\n // Apply some custom logic for handling VA and VAR. The goal is to express the value of the unit as a real value, if possible. Otherwise, use a real-valued unit instead of a complex-valued one.\n var isImaginary = false;\n if (typeof simp.value !== 'undefined' && simp.value !== null && isComplex(simp.value)) {\n // TODO: Make this better, for example, use relative magnitude of re and im rather than absolute\n isImaginary = Math.abs(simp.value.re) < 1e-14;\n }\n for (var i in simp.units) {\n if (hasOwnProperty(simp.units, i)) {\n if (simp.units[i].unit) {\n if (simp.units[i].unit.name === 'VA' && isImaginary) {\n simp.units[i].unit = UNITS.VAR;\n } else if (simp.units[i].unit.name === 'VAR' && !isImaginary) {\n simp.units[i].unit = UNITS.VA;\n }\n }\n }\n }\n\n // Now apply the best prefix\n // Units must have only one unit and not have the fixPrefix flag set\n if (simp.units.length === 1 && !simp.fixPrefix) {\n // Units must have integer powers, otherwise the prefix will change the\n // outputted value by not-an-integer-power-of-ten\n if (Math.abs(simp.units[0].power - Math.round(simp.units[0].power)) < 1e-14) {\n // Apply the best prefix\n simp.units[0].prefix = simp._bestPrefix();\n }\n }\n var value = simp._denormalize(simp.value);\n var str = simp.value !== null ? format(value, options || {}) : '';\n var unitStr = simp.formatUnits();\n if (simp.value && isComplex(simp.value)) {\n str = '(' + str + ')'; // Surround complex values with ( ) to enable better parsing\n }\n if (unitStr.length > 0 && str.length > 0) {\n str += ' ';\n }\n str += unitStr;\n return str;\n };\n\n /**\n * Calculate the best prefix using current value.\n * @memberof Unit\n * @returns {Object} prefix\n * @private\n */\n Unit.prototype._bestPrefix = function () {\n if (this.units.length !== 1) {\n throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!');\n }\n if (Math.abs(this.units[0].power - Math.round(this.units[0].power)) >= 1e-14) {\n throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!');\n }\n\n // find the best prefix value (resulting in the value of which\n // the absolute value of the log10 is closest to zero,\n // though with a little offset of 1.2 for nicer values: you get a\n // sequence 1mm 100mm 500mm 0.6m 1m 10m 100m 500m 0.6km 1km ...\n\n // Note: the units value can be any numeric type, but to find the best\n // prefix it's enough to work with limited precision of a regular number\n // Update: using mathjs abs since we also allow complex numbers\n var absValue = this.value !== null ? abs(this.value) : 0;\n var absUnitValue = abs(this.units[0].unit.value);\n var bestPrefix = this.units[0].prefix;\n if (absValue === 0) {\n return bestPrefix;\n }\n var power = this.units[0].power;\n var bestDiff = Math.log(absValue / Math.pow(bestPrefix.value * absUnitValue, power)) / Math.LN10 - 1.2;\n if (bestDiff > -2.200001 && bestDiff < 1.800001) return bestPrefix; // Allow the original prefix\n bestDiff = Math.abs(bestDiff);\n var prefixes = this.units[0].unit.prefixes;\n for (var p in prefixes) {\n if (hasOwnProperty(prefixes, p)) {\n var prefix = prefixes[p];\n if (prefix.scientific) {\n var diff = Math.abs(Math.log(absValue / Math.pow(prefix.value * absUnitValue, power)) / Math.LN10 - 1.2);\n if (diff < bestDiff || diff === bestDiff && prefix.name.length < bestPrefix.name.length) {\n // choose the prefix with the smallest diff, or if equal, choose the one\n // with the shortest name (can happen with SHORTLONG for example)\n bestPrefix = prefix;\n bestDiff = diff;\n }\n }\n }\n }\n return bestPrefix;\n };\n\n /**\n * Returns an array of units whose sum is equal to this unit\n * @memberof Unit\n * @param {Array} [parts] An array of strings or valueless units.\n *\n * Example:\n *\n * const u = new Unit(1, 'm')\n * u.splitUnit(['feet', 'inch'])\n * [ 3 feet, 3.3700787401575 inch ]\n *\n * @return {Array} An array of units.\n */\n Unit.prototype.splitUnit = function (parts) {\n var x = this.clone();\n var ret = [];\n for (var i = 0; i < parts.length; i++) {\n // Convert x to the requested unit\n x = x.to(parts[i]);\n if (i === parts.length - 1) break;\n\n // Get the numeric value of this unit\n var xNumeric = x.toNumeric();\n\n // Check to see if xNumeric is nearly equal to an integer,\n // since fix can incorrectly round down if there is round-off error\n var xRounded = round(xNumeric);\n var xFixed = void 0;\n var isNearlyEqual = equal(xRounded, xNumeric);\n if (isNearlyEqual) {\n xFixed = xRounded;\n } else {\n xFixed = fix(x.toNumeric());\n }\n var y = new Unit(xFixed, parts[i].toString());\n ret.push(y);\n x = subtractScalar(x, y);\n }\n\n // This little bit fixes a bug where the remainder should be 0 but is a little bit off.\n // But instead of comparing x, the remainder, with zero--we will compare the sum of\n // all the parts so far with the original value. If they are nearly equal,\n // we set the remainder to 0.\n var testSum = 0;\n for (var _i5 = 0; _i5 < ret.length; _i5++) {\n testSum = addScalar(testSum, ret[_i5].value);\n }\n if (equal(testSum, this.value)) {\n x.value = 0;\n }\n ret.push(x);\n return ret;\n };\n var PREFIXES = {\n NONE: {\n '': {\n name: '',\n value: 1,\n scientific: true\n }\n },\n SHORT: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e1,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e2,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e3,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e6,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e9,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e12,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e15,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e18,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e21,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e24,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e27,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e30,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-1,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-2,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-3,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-6,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-9,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-12,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-15,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-18,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-21,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-24,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-27,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-30,\n scientific: true\n }\n },\n LONG: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n deca: {\n name: 'deca',\n value: 1e1,\n scientific: false\n },\n hecto: {\n name: 'hecto',\n value: 1e2,\n scientific: false\n },\n kilo: {\n name: 'kilo',\n value: 1e3,\n scientific: true\n },\n mega: {\n name: 'mega',\n value: 1e6,\n scientific: true\n },\n giga: {\n name: 'giga',\n value: 1e9,\n scientific: true\n },\n tera: {\n name: 'tera',\n value: 1e12,\n scientific: true\n },\n peta: {\n name: 'peta',\n value: 1e15,\n scientific: true\n },\n exa: {\n name: 'exa',\n value: 1e18,\n scientific: true\n },\n zetta: {\n name: 'zetta',\n value: 1e21,\n scientific: true\n },\n yotta: {\n name: 'yotta',\n value: 1e24,\n scientific: true\n },\n ronna: {\n name: 'ronna',\n value: 1e27,\n scientific: true\n },\n quetta: {\n name: 'quetta',\n value: 1e30,\n scientific: true\n },\n deci: {\n name: 'deci',\n value: 1e-1,\n scientific: false\n },\n centi: {\n name: 'centi',\n value: 1e-2,\n scientific: false\n },\n milli: {\n name: 'milli',\n value: 1e-3,\n scientific: true\n },\n micro: {\n name: 'micro',\n value: 1e-6,\n scientific: true\n },\n nano: {\n name: 'nano',\n value: 1e-9,\n scientific: true\n },\n pico: {\n name: 'pico',\n value: 1e-12,\n scientific: true\n },\n femto: {\n name: 'femto',\n value: 1e-15,\n scientific: true\n },\n atto: {\n name: 'atto',\n value: 1e-18,\n scientific: true\n },\n zepto: {\n name: 'zepto',\n value: 1e-21,\n scientific: true\n },\n yocto: {\n name: 'yocto',\n value: 1e-24,\n scientific: true\n },\n ronto: {\n name: 'ronto',\n value: 1e-27,\n scientific: true\n },\n quecto: {\n name: 'quecto',\n value: 1e-30,\n scientific: true\n }\n },\n SQUARED: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e2,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e4,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e6,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e12,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e18,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e24,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e30,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e36,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e42,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e48,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e54,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e60,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-2,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-4,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-6,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-12,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-18,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-24,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-30,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-36,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-42,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-48,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-54,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-60,\n scientific: true\n }\n },\n CUBIC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e3,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e6,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e9,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e18,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e27,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e36,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e45,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e54,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e63,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e72,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e81,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e90,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-3,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-6,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-9,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-18,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-27,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-36,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-45,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-54,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-63,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-72,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-81,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-90,\n scientific: true\n }\n },\n BINARY_SHORT_SI: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n k: {\n name: 'k',\n value: 1e3,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e6,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e9,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e12,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e15,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e18,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e21,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e24,\n scientific: true\n }\n },\n BINARY_SHORT_IEC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n Ki: {\n name: 'Ki',\n value: 1024,\n scientific: true\n },\n Mi: {\n name: 'Mi',\n value: Math.pow(1024, 2),\n scientific: true\n },\n Gi: {\n name: 'Gi',\n value: Math.pow(1024, 3),\n scientific: true\n },\n Ti: {\n name: 'Ti',\n value: Math.pow(1024, 4),\n scientific: true\n },\n Pi: {\n name: 'Pi',\n value: Math.pow(1024, 5),\n scientific: true\n },\n Ei: {\n name: 'Ei',\n value: Math.pow(1024, 6),\n scientific: true\n },\n Zi: {\n name: 'Zi',\n value: Math.pow(1024, 7),\n scientific: true\n },\n Yi: {\n name: 'Yi',\n value: Math.pow(1024, 8),\n scientific: true\n }\n },\n BINARY_LONG_SI: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n kilo: {\n name: 'kilo',\n value: 1e3,\n scientific: true\n },\n mega: {\n name: 'mega',\n value: 1e6,\n scientific: true\n },\n giga: {\n name: 'giga',\n value: 1e9,\n scientific: true\n },\n tera: {\n name: 'tera',\n value: 1e12,\n scientific: true\n },\n peta: {\n name: 'peta',\n value: 1e15,\n scientific: true\n },\n exa: {\n name: 'exa',\n value: 1e18,\n scientific: true\n },\n zetta: {\n name: 'zetta',\n value: 1e21,\n scientific: true\n },\n yotta: {\n name: 'yotta',\n value: 1e24,\n scientific: true\n }\n },\n BINARY_LONG_IEC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n kibi: {\n name: 'kibi',\n value: 1024,\n scientific: true\n },\n mebi: {\n name: 'mebi',\n value: Math.pow(1024, 2),\n scientific: true\n },\n gibi: {\n name: 'gibi',\n value: Math.pow(1024, 3),\n scientific: true\n },\n tebi: {\n name: 'tebi',\n value: Math.pow(1024, 4),\n scientific: true\n },\n pebi: {\n name: 'pebi',\n value: Math.pow(1024, 5),\n scientific: true\n },\n exi: {\n name: 'exi',\n value: Math.pow(1024, 6),\n scientific: true\n },\n zebi: {\n name: 'zebi',\n value: Math.pow(1024, 7),\n scientific: true\n },\n yobi: {\n name: 'yobi',\n value: Math.pow(1024, 8),\n scientific: true\n }\n },\n BTU: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n MM: {\n name: 'MM',\n value: 1e6,\n scientific: true\n }\n }\n };\n PREFIXES.SHORTLONG = _extends({}, PREFIXES.SHORT, PREFIXES.LONG);\n PREFIXES.BINARY_SHORT = _extends({}, PREFIXES.BINARY_SHORT_SI, PREFIXES.BINARY_SHORT_IEC);\n PREFIXES.BINARY_LONG = _extends({}, PREFIXES.BINARY_LONG_SI, PREFIXES.BINARY_LONG_IEC);\n\n /* Internally, each unit is represented by a value and a dimension array. The elements of the dimensions array have the following meaning:\n * Index Dimension\n * ----- ---------\n * 0 Length\n * 1 Mass\n * 2 Time\n * 3 Current\n * 4 Temperature\n * 5 Luminous intensity\n * 6 Amount of substance\n * 7 Angle\n * 8 Bit (digital)\n * For example, the unit \"298.15 K\" is a pure temperature and would have a value of 298.15 and a dimension array of [0, 0, 0, 0, 1, 0, 0, 0, 0]. The unit \"1 cal / (gm \u00B0C)\" can be written in terms of the 9 fundamental dimensions as [length^2] / ([time^2] * [temperature]), and would a value of (after conversion to SI) 4184.0 and a dimensions array of [2, 0, -2, 0, -1, 0, 0, 0, 0].\n *\n */\n\n var BASE_DIMENSIONS = ['MASS', 'LENGTH', 'TIME', 'CURRENT', 'TEMPERATURE', 'LUMINOUS_INTENSITY', 'AMOUNT_OF_SUBSTANCE', 'ANGLE', 'BIT'];\n var BASE_UNITS = {\n NONE: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 0]\n },\n MASS: {\n dimensions: [1, 0, 0, 0, 0, 0, 0, 0, 0]\n },\n LENGTH: {\n dimensions: [0, 1, 0, 0, 0, 0, 0, 0, 0]\n },\n TIME: {\n dimensions: [0, 0, 1, 0, 0, 0, 0, 0, 0]\n },\n CURRENT: {\n dimensions: [0, 0, 0, 1, 0, 0, 0, 0, 0]\n },\n TEMPERATURE: {\n dimensions: [0, 0, 0, 0, 1, 0, 0, 0, 0]\n },\n LUMINOUS_INTENSITY: {\n dimensions: [0, 0, 0, 0, 0, 1, 0, 0, 0]\n },\n AMOUNT_OF_SUBSTANCE: {\n dimensions: [0, 0, 0, 0, 0, 0, 1, 0, 0]\n },\n FORCE: {\n dimensions: [1, 1, -2, 0, 0, 0, 0, 0, 0]\n },\n SURFACE: {\n dimensions: [0, 2, 0, 0, 0, 0, 0, 0, 0]\n },\n VOLUME: {\n dimensions: [0, 3, 0, 0, 0, 0, 0, 0, 0]\n },\n ENERGY: {\n dimensions: [1, 2, -2, 0, 0, 0, 0, 0, 0]\n },\n POWER: {\n dimensions: [1, 2, -3, 0, 0, 0, 0, 0, 0]\n },\n PRESSURE: {\n dimensions: [1, -1, -2, 0, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CHARGE: {\n dimensions: [0, 0, 1, 1, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CAPACITANCE: {\n dimensions: [-1, -2, 4, 2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_POTENTIAL: {\n dimensions: [1, 2, -3, -1, 0, 0, 0, 0, 0]\n },\n ELECTRIC_RESISTANCE: {\n dimensions: [1, 2, -3, -2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_INDUCTANCE: {\n dimensions: [1, 2, -2, -2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CONDUCTANCE: {\n dimensions: [-1, -2, 3, 2, 0, 0, 0, 0, 0]\n },\n MAGNETIC_FLUX: {\n dimensions: [1, 2, -2, -1, 0, 0, 0, 0, 0]\n },\n MAGNETIC_FLUX_DENSITY: {\n dimensions: [1, 0, -2, -1, 0, 0, 0, 0, 0]\n },\n FREQUENCY: {\n dimensions: [0, 0, -1, 0, 0, 0, 0, 0, 0]\n },\n ANGLE: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 1, 0]\n },\n BIT: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 1]\n }\n };\n for (var key in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, key)) {\n BASE_UNITS[key].key = key;\n }\n }\n var BASE_UNIT_NONE = {};\n var UNIT_NONE = {\n name: '',\n base: BASE_UNIT_NONE,\n value: 1,\n offset: 0,\n dimensions: BASE_DIMENSIONS.map(x => 0)\n };\n var UNITS = {\n // length\n meter: {\n name: 'meter',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n inch: {\n name: 'inch',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0254,\n offset: 0\n },\n foot: {\n name: 'foot',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.3048,\n offset: 0\n },\n yard: {\n name: 'yard',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.9144,\n offset: 0\n },\n mile: {\n name: 'mile',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1609.344,\n offset: 0\n },\n link: {\n name: 'link',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.201168,\n offset: 0\n },\n rod: {\n name: 'rod',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 5.0292,\n offset: 0\n },\n chain: {\n name: 'chain',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 20.1168,\n offset: 0\n },\n angstrom: {\n name: 'angstrom',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1e-10,\n offset: 0\n },\n m: {\n name: 'm',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n in: {\n name: 'in',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0254,\n offset: 0\n },\n ft: {\n name: 'ft',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.3048,\n offset: 0\n },\n yd: {\n name: 'yd',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.9144,\n offset: 0\n },\n mi: {\n name: 'mi',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1609.344,\n offset: 0\n },\n li: {\n name: 'li',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.201168,\n offset: 0\n },\n rd: {\n name: 'rd',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 5.029210,\n offset: 0\n },\n ch: {\n name: 'ch',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 20.1168,\n offset: 0\n },\n mil: {\n name: 'mil',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0000254,\n offset: 0\n },\n // 1/1000 inch\n\n // Surface\n m2: {\n name: 'm2',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.SQUARED,\n value: 1,\n offset: 0\n },\n sqin: {\n name: 'sqin',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.00064516,\n offset: 0\n },\n // 645.16 mm2\n sqft: {\n name: 'sqft',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.09290304,\n offset: 0\n },\n // 0.09290304 m2\n sqyd: {\n name: 'sqyd',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.83612736,\n offset: 0\n },\n // 0.83612736 m2\n sqmi: {\n name: 'sqmi',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 2589988.110336,\n offset: 0\n },\n // 2.589988110336 km2\n sqrd: {\n name: 'sqrd',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 25.29295,\n offset: 0\n },\n // 25.29295 m2\n sqch: {\n name: 'sqch',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 404.6873,\n offset: 0\n },\n // 404.6873 m2\n sqmil: {\n name: 'sqmil',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 6.4516e-10,\n offset: 0\n },\n // 6.4516 * 10^-10 m2\n acre: {\n name: 'acre',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 4046.86,\n offset: 0\n },\n // 4046.86 m2\n hectare: {\n name: 'hectare',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 10000,\n offset: 0\n },\n // 10000 m2\n\n // Volume\n m3: {\n name: 'm3',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.CUBIC,\n value: 1,\n offset: 0\n },\n L: {\n name: 'L',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n // litre\n l: {\n name: 'l',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n // litre\n litre: {\n name: 'litre',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.LONG,\n value: 0.001,\n offset: 0\n },\n cuin: {\n name: 'cuin',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 1.6387064e-5,\n offset: 0\n },\n // 1.6387064e-5 m3\n cuft: {\n name: 'cuft',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.028316846592,\n offset: 0\n },\n // 28.316 846 592 L\n cuyd: {\n name: 'cuyd',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.764554857984,\n offset: 0\n },\n // 764.554 857 984 L\n teaspoon: {\n name: 'teaspoon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000005,\n offset: 0\n },\n // 5 mL\n tablespoon: {\n name: 'tablespoon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000015,\n offset: 0\n },\n // 15 mL\n // {name: 'cup', base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 0.000240, offset: 0}, // 240 mL // not possible, we have already another cup\n drop: {\n name: 'drop',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 5e-8,\n offset: 0\n },\n // 0.05 mL = 5e-8 m3\n gtt: {\n name: 'gtt',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 5e-8,\n offset: 0\n },\n // 0.05 mL = 5e-8 m3\n\n // Liquid volume\n minim: {\n name: 'minim',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.00000006161152,\n offset: 0\n },\n // 0.06161152 mL\n fluiddram: {\n name: 'fluiddram',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0000036966911,\n offset: 0\n },\n // 3.696691 mL\n fluidounce: {\n name: 'fluidounce',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.00002957353,\n offset: 0\n },\n // 29.57353 mL\n gill: {\n name: 'gill',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0001182941,\n offset: 0\n },\n // 118.2941 mL\n cc: {\n name: 'cc',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 1e-6,\n offset: 0\n },\n // 1e-6 L\n cup: {\n name: 'cup',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0002365882,\n offset: 0\n },\n // 236.5882 mL\n pint: {\n name: 'pint',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0004731765,\n offset: 0\n },\n // 473.1765 mL\n quart: {\n name: 'quart',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0009463529,\n offset: 0\n },\n // 946.3529 mL\n gallon: {\n name: 'gallon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.003785412,\n offset: 0\n },\n // 3.785412 L\n beerbarrel: {\n name: 'beerbarrel',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.1173478,\n offset: 0\n },\n // 117.3478 L\n oilbarrel: {\n name: 'oilbarrel',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.1589873,\n offset: 0\n },\n // 158.9873 L\n hogshead: {\n name: 'hogshead',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.2384810,\n offset: 0\n },\n // 238.4810 L\n\n // {name: 'min', base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 0.00000006161152, offset: 0}, // 0.06161152 mL // min is already in use as minute\n fldr: {\n name: 'fldr',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0000036966911,\n offset: 0\n },\n // 3.696691 mL\n floz: {\n name: 'floz',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.00002957353,\n offset: 0\n },\n // 29.57353 mL\n gi: {\n name: 'gi',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0001182941,\n offset: 0\n },\n // 118.2941 mL\n cp: {\n name: 'cp',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0002365882,\n offset: 0\n },\n // 236.5882 mL\n pt: {\n name: 'pt',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0004731765,\n offset: 0\n },\n // 473.1765 mL\n qt: {\n name: 'qt',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0009463529,\n offset: 0\n },\n // 946.3529 mL\n gal: {\n name: 'gal',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.003785412,\n offset: 0\n },\n // 3.785412 L\n bbl: {\n name: 'bbl',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.1173478,\n offset: 0\n },\n // 117.3478 L\n obl: {\n name: 'obl',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.1589873,\n offset: 0\n },\n // 158.9873 L\n // {name: 'hogshead', base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 0.2384810, offset: 0}, // 238.4810 L // TODO: hh?\n\n // Mass\n g: {\n name: 'g',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n gram: {\n name: 'gram',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.LONG,\n value: 0.001,\n offset: 0\n },\n ton: {\n name: 'ton',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 907.18474,\n offset: 0\n },\n t: {\n name: 't',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 1000,\n offset: 0\n },\n tonne: {\n name: 'tonne',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.LONG,\n value: 1000,\n offset: 0\n },\n grain: {\n name: 'grain',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 64.79891e-6,\n offset: 0\n },\n dram: {\n name: 'dram',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 1.7718451953125e-3,\n offset: 0\n },\n ounce: {\n name: 'ounce',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 28.349523125e-3,\n offset: 0\n },\n poundmass: {\n name: 'poundmass',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 453.59237e-3,\n offset: 0\n },\n hundredweight: {\n name: 'hundredweight',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 45.359237,\n offset: 0\n },\n stick: {\n name: 'stick',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 115e-3,\n offset: 0\n },\n stone: {\n name: 'stone',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 6.35029318,\n offset: 0\n },\n gr: {\n name: 'gr',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 64.79891e-6,\n offset: 0\n },\n dr: {\n name: 'dr',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 1.7718451953125e-3,\n offset: 0\n },\n oz: {\n name: 'oz',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 28.349523125e-3,\n offset: 0\n },\n lbm: {\n name: 'lbm',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 453.59237e-3,\n offset: 0\n },\n cwt: {\n name: 'cwt',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 45.359237,\n offset: 0\n },\n // Time\n s: {\n name: 's',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n min: {\n name: 'min',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 60,\n offset: 0\n },\n h: {\n name: 'h',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3600,\n offset: 0\n },\n second: {\n name: 'second',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n sec: {\n name: 'sec',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n minute: {\n name: 'minute',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 60,\n offset: 0\n },\n hour: {\n name: 'hour',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3600,\n offset: 0\n },\n day: {\n name: 'day',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 86400,\n offset: 0\n },\n week: {\n name: 'week',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 7 * 86400,\n offset: 0\n },\n month: {\n name: 'month',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 2629800,\n // 1/12th of Julian year\n offset: 0\n },\n year: {\n name: 'year',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 31557600,\n // Julian year\n offset: 0\n },\n decade: {\n name: 'decade',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 315576000,\n // Julian decade\n offset: 0\n },\n century: {\n name: 'century',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3155760000,\n // Julian century\n offset: 0\n },\n millennium: {\n name: 'millennium',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 31557600000,\n // Julian millennium\n offset: 0\n },\n // Frequency\n hertz: {\n name: 'Hertz',\n base: BASE_UNITS.FREQUENCY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0,\n reciprocal: true\n },\n Hz: {\n name: 'Hz',\n base: BASE_UNITS.FREQUENCY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0,\n reciprocal: true\n },\n // Angle\n rad: {\n name: 'rad',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n radian: {\n name: 'radian',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // deg = rad / (2*pi) * 360 = rad / 0.017453292519943295769236907684888\n deg: {\n name: 'deg',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n degree: {\n name: 'degree',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // grad = rad / (2*pi) * 400 = rad / 0.015707963267948966192313216916399\n grad: {\n name: 'grad',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n gradian: {\n name: 'gradian',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // cycle = rad / (2*pi) = rad / 6.2831853071795864769252867665793\n cycle: {\n name: 'cycle',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // arcsec = rad / (3600 * (360 / 2 * pi)) = rad / 0.0000048481368110953599358991410235795\n arcsec: {\n name: 'arcsec',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // arcmin = rad / (60 * (360 / 2 * pi)) = rad / 0.00029088820866572159615394846141477\n arcmin: {\n name: 'arcmin',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // Electric current\n A: {\n name: 'A',\n base: BASE_UNITS.CURRENT,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n ampere: {\n name: 'ampere',\n base: BASE_UNITS.CURRENT,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // Temperature\n // K(C) = \u00B0C + 273.15\n // K(F) = (\u00B0F + 459.67) * (5 / 9)\n // K(R) = \u00B0R * (5 / 9)\n K: {\n name: 'K',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n degC: {\n name: 'degC',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 273.15\n },\n degF: {\n name: 'degF',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: new _Fraction(5, 9),\n offset: 459.67\n },\n degR: {\n name: 'degR',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: new _Fraction(5, 9),\n offset: 0\n },\n kelvin: {\n name: 'kelvin',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n celsius: {\n name: 'celsius',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 273.15\n },\n fahrenheit: {\n name: 'fahrenheit',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: new _Fraction(5, 9),\n offset: 459.67\n },\n rankine: {\n name: 'rankine',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: new _Fraction(5, 9),\n offset: 0\n },\n // amount of substance\n mol: {\n name: 'mol',\n base: BASE_UNITS.AMOUNT_OF_SUBSTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n mole: {\n name: 'mole',\n base: BASE_UNITS.AMOUNT_OF_SUBSTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // luminous intensity\n cd: {\n name: 'cd',\n base: BASE_UNITS.LUMINOUS_INTENSITY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n candela: {\n name: 'candela',\n base: BASE_UNITS.LUMINOUS_INTENSITY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // TODO: units STERADIAN\n // {name: 'sr', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0},\n // {name: 'steradian', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0},\n\n // Force\n N: {\n name: 'N',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n newton: {\n name: 'newton',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n dyn: {\n name: 'dyn',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.SHORT,\n value: 0.00001,\n offset: 0\n },\n dyne: {\n name: 'dyne',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 0.00001,\n offset: 0\n },\n lbf: {\n name: 'lbf',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 4.4482216152605,\n offset: 0\n },\n poundforce: {\n name: 'poundforce',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 4.4482216152605,\n offset: 0\n },\n kip: {\n name: 'kip',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 4448.2216,\n offset: 0\n },\n kilogramforce: {\n name: 'kilogramforce',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 9.80665,\n offset: 0\n },\n // Energy\n J: {\n name: 'J',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n joule: {\n name: 'joule',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n erg: {\n name: 'erg',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORTLONG,\n // Both kiloerg and kerg are acceptable\n value: 1e-7,\n offset: 0\n },\n Wh: {\n name: 'Wh',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 3600,\n offset: 0\n },\n BTU: {\n name: 'BTU',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.BTU,\n value: 1055.05585262,\n offset: 0\n },\n eV: {\n name: 'eV',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 1.602176565e-19,\n offset: 0\n },\n electronvolt: {\n name: 'electronvolt',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.LONG,\n value: 1.602176565e-19,\n offset: 0\n },\n // Power\n W: {\n name: 'W',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n watt: {\n name: 'watt',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n hp: {\n name: 'hp',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.NONE,\n value: 745.6998715386,\n offset: 0\n },\n // Electrical power units\n VAR: {\n name: 'VAR',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: Complex.I,\n offset: 0\n },\n VA: {\n name: 'VA',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Pressure\n Pa: {\n name: 'Pa',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n psi: {\n name: 'psi',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 6894.75729276459,\n offset: 0\n },\n atm: {\n name: 'atm',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 101325,\n offset: 0\n },\n bar: {\n name: 'bar',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.SHORTLONG,\n value: 100000,\n offset: 0\n },\n torr: {\n name: 'torr',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 133.322,\n offset: 0\n },\n mmHg: {\n name: 'mmHg',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 133.322,\n offset: 0\n },\n mmH2O: {\n name: 'mmH2O',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 9.80665,\n offset: 0\n },\n cmH2O: {\n name: 'cmH2O',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 98.0665,\n offset: 0\n },\n // Electric charge\n coulomb: {\n name: 'coulomb',\n base: BASE_UNITS.ELECTRIC_CHARGE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n C: {\n name: 'C',\n base: BASE_UNITS.ELECTRIC_CHARGE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric capacitance\n farad: {\n name: 'farad',\n base: BASE_UNITS.ELECTRIC_CAPACITANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n F: {\n name: 'F',\n base: BASE_UNITS.ELECTRIC_CAPACITANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric potential\n volt: {\n name: 'volt',\n base: BASE_UNITS.ELECTRIC_POTENTIAL,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n V: {\n name: 'V',\n base: BASE_UNITS.ELECTRIC_POTENTIAL,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric resistance\n ohm: {\n name: 'ohm',\n base: BASE_UNITS.ELECTRIC_RESISTANCE,\n prefixes: PREFIXES.SHORTLONG,\n // Both Mohm and megaohm are acceptable\n value: 1,\n offset: 0\n },\n /*\n * Unicode breaks in browsers if charset is not specified\n \u03A9: {\n name: '\u03A9',\n base: BASE_UNITS.ELECTRIC_RESISTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n */\n // Electric inductance\n henry: {\n name: 'henry',\n base: BASE_UNITS.ELECTRIC_INDUCTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n H: {\n name: 'H',\n base: BASE_UNITS.ELECTRIC_INDUCTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric conductance\n siemens: {\n name: 'siemens',\n base: BASE_UNITS.ELECTRIC_CONDUCTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n S: {\n name: 'S',\n base: BASE_UNITS.ELECTRIC_CONDUCTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Magnetic flux\n weber: {\n name: 'weber',\n base: BASE_UNITS.MAGNETIC_FLUX,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n Wb: {\n name: 'Wb',\n base: BASE_UNITS.MAGNETIC_FLUX,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Magnetic flux density\n tesla: {\n name: 'tesla',\n base: BASE_UNITS.MAGNETIC_FLUX_DENSITY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n T: {\n name: 'T',\n base: BASE_UNITS.MAGNETIC_FLUX_DENSITY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Binary\n b: {\n name: 'b',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_SHORT,\n value: 1,\n offset: 0\n },\n bits: {\n name: 'bits',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_LONG,\n value: 1,\n offset: 0\n },\n B: {\n name: 'B',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_SHORT,\n value: 8,\n offset: 0\n },\n bytes: {\n name: 'bytes',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_LONG,\n value: 8,\n offset: 0\n }\n };\n\n // aliases (formerly plurals)\n // note that ALIASES is only used at creation to create more entries in UNITS by copying the aliased units\n var ALIASES = {\n meters: 'meter',\n inches: 'inch',\n feet: 'foot',\n yards: 'yard',\n miles: 'mile',\n links: 'link',\n rods: 'rod',\n chains: 'chain',\n angstroms: 'angstrom',\n lt: 'l',\n litres: 'litre',\n liter: 'litre',\n liters: 'litre',\n teaspoons: 'teaspoon',\n tablespoons: 'tablespoon',\n minims: 'minim',\n fluiddrams: 'fluiddram',\n fluidounces: 'fluidounce',\n gills: 'gill',\n cups: 'cup',\n pints: 'pint',\n quarts: 'quart',\n gallons: 'gallon',\n beerbarrels: 'beerbarrel',\n oilbarrels: 'oilbarrel',\n hogsheads: 'hogshead',\n gtts: 'gtt',\n grams: 'gram',\n tons: 'ton',\n tonnes: 'tonne',\n grains: 'grain',\n drams: 'dram',\n ounces: 'ounce',\n poundmasses: 'poundmass',\n hundredweights: 'hundredweight',\n sticks: 'stick',\n lb: 'lbm',\n lbs: 'lbm',\n kips: 'kip',\n kgf: 'kilogramforce',\n acres: 'acre',\n hectares: 'hectare',\n sqfeet: 'sqft',\n sqyard: 'sqyd',\n sqmile: 'sqmi',\n sqmiles: 'sqmi',\n mmhg: 'mmHg',\n mmh2o: 'mmH2O',\n cmh2o: 'cmH2O',\n seconds: 'second',\n secs: 'second',\n minutes: 'minute',\n mins: 'minute',\n hours: 'hour',\n hr: 'hour',\n hrs: 'hour',\n days: 'day',\n weeks: 'week',\n months: 'month',\n years: 'year',\n decades: 'decade',\n centuries: 'century',\n millennia: 'millennium',\n hertz: 'hertz',\n radians: 'radian',\n degrees: 'degree',\n gradians: 'gradian',\n cycles: 'cycle',\n arcsecond: 'arcsec',\n arcseconds: 'arcsec',\n arcminute: 'arcmin',\n arcminutes: 'arcmin',\n BTUs: 'BTU',\n watts: 'watt',\n joules: 'joule',\n amperes: 'ampere',\n amps: 'ampere',\n amp: 'ampere',\n coulombs: 'coulomb',\n volts: 'volt',\n ohms: 'ohm',\n farads: 'farad',\n webers: 'weber',\n teslas: 'tesla',\n electronvolts: 'electronvolt',\n moles: 'mole',\n bit: 'bits',\n byte: 'bytes'\n };\n\n /**\n * Calculate the values for the angle units.\n * Value is calculated as number or BigNumber depending on the configuration\n * @param {{number: 'number' | 'BigNumber'}} config\n */\n function calculateAngleValues(config) {\n if (config.number === 'BigNumber') {\n var pi = createPi(_BigNumber);\n UNITS.rad.value = new _BigNumber(1);\n UNITS.deg.value = pi.div(180); // 2 * pi / 360\n UNITS.grad.value = pi.div(200); // 2 * pi / 400\n UNITS.cycle.value = pi.times(2); // 2 * pi\n UNITS.arcsec.value = pi.div(648000); // 2 * pi / 360 / 3600\n UNITS.arcmin.value = pi.div(10800); // 2 * pi / 360 / 60\n } else {\n // number\n UNITS.rad.value = 1;\n UNITS.deg.value = Math.PI / 180; // 2 * pi / 360\n UNITS.grad.value = Math.PI / 200; // 2 * pi / 400\n UNITS.cycle.value = Math.PI * 2; // 2 * pi\n UNITS.arcsec.value = Math.PI / 648000; // 2 * pi / 360 / 3600\n UNITS.arcmin.value = Math.PI / 10800; // 2 * pi / 360 / 60\n }\n\n // copy to the full names of the angles\n UNITS.radian.value = UNITS.rad.value;\n UNITS.degree.value = UNITS.deg.value;\n UNITS.gradian.value = UNITS.grad.value;\n }\n\n // apply the angle values now\n calculateAngleValues(config);\n if (on) {\n // recalculate the values on change of configuration\n on('config', function (curr, prev) {\n if (curr.number !== prev.number) {\n calculateAngleValues(curr);\n }\n });\n }\n\n /**\n * A unit system is a set of dimensionally independent base units plus a set of derived units, formed by multiplication and division of the base units, that are by convention used with the unit system.\n * A user perhaps could issue a command to select a preferred unit system, or use the default (see below).\n * Auto unit system: The default unit system is updated on the fly anytime a unit is parsed. The corresponding unit in the default unit system is updated, so that answers are given in the same units the user supplies.\n */\n var UNIT_SYSTEMS = {\n si: {\n // Base units\n NONE: {\n unit: UNIT_NONE,\n prefix: PREFIXES.NONE['']\n },\n LENGTH: {\n unit: UNITS.m,\n prefix: PREFIXES.SHORT['']\n },\n MASS: {\n unit: UNITS.g,\n prefix: PREFIXES.SHORT.k\n },\n TIME: {\n unit: UNITS.s,\n prefix: PREFIXES.SHORT['']\n },\n CURRENT: {\n unit: UNITS.A,\n prefix: PREFIXES.SHORT['']\n },\n TEMPERATURE: {\n unit: UNITS.K,\n prefix: PREFIXES.SHORT['']\n },\n LUMINOUS_INTENSITY: {\n unit: UNITS.cd,\n prefix: PREFIXES.SHORT['']\n },\n AMOUNT_OF_SUBSTANCE: {\n unit: UNITS.mol,\n prefix: PREFIXES.SHORT['']\n },\n ANGLE: {\n unit: UNITS.rad,\n prefix: PREFIXES.SHORT['']\n },\n BIT: {\n unit: UNITS.bits,\n prefix: PREFIXES.SHORT['']\n },\n // Derived units\n FORCE: {\n unit: UNITS.N,\n prefix: PREFIXES.SHORT['']\n },\n ENERGY: {\n unit: UNITS.J,\n prefix: PREFIXES.SHORT['']\n },\n POWER: {\n unit: UNITS.W,\n prefix: PREFIXES.SHORT['']\n },\n PRESSURE: {\n unit: UNITS.Pa,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CHARGE: {\n unit: UNITS.C,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CAPACITANCE: {\n unit: UNITS.F,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_POTENTIAL: {\n unit: UNITS.V,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_RESISTANCE: {\n unit: UNITS.ohm,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_INDUCTANCE: {\n unit: UNITS.H,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CONDUCTANCE: {\n unit: UNITS.S,\n prefix: PREFIXES.SHORT['']\n },\n MAGNETIC_FLUX: {\n unit: UNITS.Wb,\n prefix: PREFIXES.SHORT['']\n },\n MAGNETIC_FLUX_DENSITY: {\n unit: UNITS.T,\n prefix: PREFIXES.SHORT['']\n },\n FREQUENCY: {\n unit: UNITS.Hz,\n prefix: PREFIXES.SHORT['']\n }\n }\n };\n\n // Clone to create the other unit systems\n UNIT_SYSTEMS.cgs = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n UNIT_SYSTEMS.cgs.LENGTH = {\n unit: UNITS.m,\n prefix: PREFIXES.SHORT.c\n };\n UNIT_SYSTEMS.cgs.MASS = {\n unit: UNITS.g,\n prefix: PREFIXES.SHORT['']\n };\n UNIT_SYSTEMS.cgs.FORCE = {\n unit: UNITS.dyn,\n prefix: PREFIXES.SHORT['']\n };\n UNIT_SYSTEMS.cgs.ENERGY = {\n unit: UNITS.erg,\n prefix: PREFIXES.NONE['']\n };\n // there are wholly 4 unique cgs systems for electricity and magnetism,\n // so let's not worry about it unless somebody complains\n\n UNIT_SYSTEMS.us = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n UNIT_SYSTEMS.us.LENGTH = {\n unit: UNITS.ft,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.MASS = {\n unit: UNITS.lbm,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.TEMPERATURE = {\n unit: UNITS.degF,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.FORCE = {\n unit: UNITS.lbf,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.ENERGY = {\n unit: UNITS.BTU,\n prefix: PREFIXES.BTU['']\n };\n UNIT_SYSTEMS.us.POWER = {\n unit: UNITS.hp,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.PRESSURE = {\n unit: UNITS.psi,\n prefix: PREFIXES.NONE['']\n };\n\n // Add additional unit systems here.\n\n // Choose a unit system to seed the auto unit system.\n UNIT_SYSTEMS.auto = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n\n // Set the current unit system\n var currentUnitSystem = UNIT_SYSTEMS.auto;\n\n /**\n * Set a unit system for formatting derived units.\n * @param {string} [name] The name of the unit system.\n */\n Unit.setUnitSystem = function (name) {\n if (hasOwnProperty(UNIT_SYSTEMS, name)) {\n currentUnitSystem = UNIT_SYSTEMS[name];\n } else {\n throw new Error('Unit system ' + name + ' does not exist. Choices are: ' + Object.keys(UNIT_SYSTEMS).join(', '));\n }\n };\n\n /**\n * Return the current unit system.\n * @return {string} The current unit system.\n */\n Unit.getUnitSystem = function () {\n for (var _key in UNIT_SYSTEMS) {\n if (hasOwnProperty(UNIT_SYSTEMS, _key)) {\n if (UNIT_SYSTEMS[_key] === currentUnitSystem) {\n return _key;\n }\n }\n }\n };\n\n /**\n * Converters to convert from number to an other numeric type like BigNumber\n * or Fraction\n */\n Unit.typeConverters = {\n BigNumber: function BigNumber(x) {\n if (x !== null && x !== void 0 && x.isFraction) return new _BigNumber(x.n).div(x.d).times(x.s);\n return new _BigNumber(x + ''); // stringify to prevent constructor error\n },\n Fraction: function Fraction(x) {\n return new _Fraction(x);\n },\n Complex: function Complex(x) {\n return x;\n },\n number: function number(x) {\n if (x !== null && x !== void 0 && x.isFraction) return _number(x);\n return x;\n }\n };\n\n /**\n * Retrieve the right converter function corresponding with this unit's\n * value\n *\n * @memberof Unit\n * @return {Function}\n */\n Unit.prototype._numberConverter = function () {\n var convert = Unit.typeConverters[this.valueType()];\n if (convert) {\n return convert;\n }\n throw new TypeError('Unsupported Unit value type \"' + this.valueType() + '\"');\n };\n\n /**\n * Retrieve the right convertor function corresponding with the type\n * of provided exampleValue.\n *\n * @param {string} type A string 'number', 'BigNumber', or 'Fraction'\n * In case of an unknown type,\n * @return {Function}\n */\n Unit._getNumberConverter = function (type) {\n if (!Unit.typeConverters[type]) {\n throw new TypeError('Unsupported type \"' + type + '\"');\n }\n return Unit.typeConverters[type];\n };\n\n // Add dimensions to each built-in unit\n for (var _key2 in UNITS) {\n if (hasOwnProperty(UNITS, _key2)) {\n var unit = UNITS[_key2];\n unit.dimensions = unit.base.dimensions;\n }\n }\n\n // Create aliases\n for (var _name2 in ALIASES) {\n if (hasOwnProperty(ALIASES, _name2)) {\n var _unit2 = UNITS[ALIASES[_name2]];\n var alias = {};\n for (var _key3 in _unit2) {\n if (hasOwnProperty(_unit2, _key3)) {\n alias[_key3] = _unit2[_key3];\n }\n }\n alias.name = _name2;\n UNITS[_name2] = alias;\n }\n }\n\n /**\n * Checks if a character is a valid latin letter (upper or lower case).\n * Note that this function can be overridden, for example to allow support of other alphabets.\n * @param {string} c Tested character\n */\n Unit.isValidAlpha = function isValidAlpha(c) {\n return /^[a-zA-Z]$/.test(c);\n };\n function assertUnitNameIsValid(name) {\n for (var i = 0; i < name.length; i++) {\n c = name.charAt(i);\n if (i === 0 && !Unit.isValidAlpha(c)) {\n throw new Error('Invalid unit name (must begin with alpha character): \"' + name + '\"');\n }\n if (i > 0 && !(Unit.isValidAlpha(c) || isDigit(c))) {\n throw new Error('Invalid unit name (only alphanumeric characters are allowed): \"' + name + '\"');\n }\n }\n }\n\n /**\n * Wrapper around createUnitSingle.\n * Example:\n * createUnit({\n * foo: { },\n * bar: {\n * definition: 'kg/foo',\n * aliases: ['ba', 'barr', 'bars'],\n * offset: 200\n * },\n * baz: '4 bar'\n * },\n * {\n * override: true\n * })\n * @param {object} obj Object map. Each key becomes a unit which is defined by its value.\n * @param {object} options\n */\n Unit.createUnit = function (obj, options) {\n if (typeof obj !== 'object') {\n throw new TypeError(\"createUnit expects first parameter to be of type 'Object'\");\n }\n\n // Remove all units and aliases we are overriding\n if (options && options.override) {\n for (var _key4 in obj) {\n if (hasOwnProperty(obj, _key4)) {\n Unit.deleteUnit(_key4);\n }\n if (obj[_key4].aliases) {\n for (var i = 0; i < obj[_key4].aliases.length; i++) {\n Unit.deleteUnit(obj[_key4].aliases[i]);\n }\n }\n }\n }\n\n // TODO: traverse multiple times until all units have been added\n var lastUnit;\n for (var _key5 in obj) {\n if (hasOwnProperty(obj, _key5)) {\n lastUnit = Unit.createUnitSingle(_key5, obj[_key5]);\n }\n }\n return lastUnit;\n };\n\n /**\n * Create a user-defined unit and register it with the Unit type.\n * Example:\n * createUnitSingle('knot', '0.514444444 m/s')\n * createUnitSingle('acre', new Unit(43560, 'ft^2'))\n *\n * @param {string} name The name of the new unit. Must be unique. Example: 'knot'\n * @param {string, Unit, Object} definition Definition of the unit in terms\n * of existing units. For example, '0.514444444 m / s'. Can be a Unit, a string,\n * or an Object. If an Object, may have the following properties:\n * - definition {string|Unit} The definition of this unit.\n * - prefixes {string} \"none\", \"short\", \"long\", \"binary_short\", or \"binary_long\".\n * The default is \"none\".\n * - aliases {Array} Array of strings. Example: ['knots', 'kt', 'kts']\n * - offset {Numeric} An offset to apply when converting from the unit. For\n * example, the offset for celsius is 273.15 and the offset for farhenheit\n * is 459.67. Default is 0.\n * - baseName {string} If the unit's dimension does not match that of any other\n * base unit, the name of the newly create base unit. Otherwise, this property\n * has no effect.\n *\n * @return {Unit}\n */\n Unit.createUnitSingle = function (name, obj) {\n if (typeof obj === 'undefined' || obj === null) {\n obj = {};\n }\n if (typeof name !== 'string') {\n throw new TypeError(\"createUnitSingle expects first parameter to be of type 'string'\");\n }\n\n // Check collisions with existing units\n if (hasOwnProperty(UNITS, name)) {\n throw new Error('Cannot create unit \"' + name + '\": a unit with that name already exists');\n }\n\n // TODO: Validate name for collisions with other built-in functions (like abs or cos, for example), and for acceptable variable names. For example, '42' is probably not a valid unit. Nor is '%', since it is also an operator.\n\n assertUnitNameIsValid(name);\n var defUnit = null; // The Unit from which the new unit will be created.\n var aliases = [];\n var offset = 0;\n var definition;\n var prefixes;\n var baseName;\n if (obj && obj.type === 'Unit') {\n defUnit = obj.clone();\n } else if (typeof obj === 'string') {\n if (obj !== '') {\n definition = obj;\n }\n } else if (typeof obj === 'object') {\n definition = obj.definition;\n prefixes = obj.prefixes;\n offset = obj.offset;\n baseName = obj.baseName;\n if (obj.aliases) {\n aliases = obj.aliases.valueOf(); // aliases could be a Matrix, so convert to Array\n }\n } else {\n throw new TypeError('Cannot create unit \"' + name + '\" from \"' + obj.toString() + '\": expecting \"string\" or \"Unit\" or \"Object\"');\n }\n if (aliases) {\n for (var i = 0; i < aliases.length; i++) {\n if (hasOwnProperty(UNITS, aliases[i])) {\n throw new Error('Cannot create alias \"' + aliases[i] + '\": a unit with that name already exists');\n }\n }\n }\n if (definition && typeof definition === 'string' && !defUnit) {\n try {\n defUnit = Unit.parse(definition, {\n allowNoUnits: true\n });\n } catch (ex) {\n ex.message = 'Could not create unit \"' + name + '\" from \"' + definition + '\": ' + ex.message;\n throw ex;\n }\n } else if (definition && definition.type === 'Unit') {\n defUnit = definition.clone();\n }\n aliases = aliases || [];\n offset = offset || 0;\n if (prefixes && prefixes.toUpperCase) {\n prefixes = PREFIXES[prefixes.toUpperCase()] || PREFIXES.NONE;\n } else {\n prefixes = PREFIXES.NONE;\n }\n\n // If defUnit is null, it is because the user did not\n // specify a defintion. So create a new base dimension.\n var newUnit = {};\n if (!defUnit) {\n // Add a new base dimension\n baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo\n if (BASE_DIMENSIONS.indexOf(baseName) >= 0) {\n throw new Error('Cannot create new base unit \"' + name + '\": a base unit with that name already exists (and cannot be overridden)');\n }\n BASE_DIMENSIONS.push(baseName);\n\n // Push 0 onto existing base units\n for (var b in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, b)) {\n BASE_UNITS[b].dimensions[BASE_DIMENSIONS.length - 1] = 0;\n }\n }\n\n // Add the new base unit\n var newBaseUnit = {\n dimensions: []\n };\n for (var _i6 = 0; _i6 < BASE_DIMENSIONS.length; _i6++) {\n newBaseUnit.dimensions[_i6] = 0;\n }\n newBaseUnit.dimensions[BASE_DIMENSIONS.length - 1] = 1;\n newBaseUnit.key = baseName;\n BASE_UNITS[baseName] = newBaseUnit;\n newUnit = {\n name,\n value: 1,\n dimensions: BASE_UNITS[baseName].dimensions.slice(0),\n prefixes,\n offset,\n base: BASE_UNITS[baseName]\n };\n currentUnitSystem[baseName] = {\n unit: newUnit,\n prefix: PREFIXES.NONE['']\n };\n } else {\n newUnit = {\n name,\n value: defUnit.value,\n dimensions: defUnit.dimensions.slice(0),\n prefixes,\n offset\n };\n\n // Create a new base if no matching base exists\n var anyMatch = false;\n for (var _i7 in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, _i7)) {\n var match = true;\n for (var j = 0; j < BASE_DIMENSIONS.length; j++) {\n if (Math.abs((newUnit.dimensions[j] || 0) - (BASE_UNITS[_i7].dimensions[j] || 0)) > 1e-12) {\n match = false;\n break;\n }\n }\n if (match) {\n anyMatch = true;\n newUnit.base = BASE_UNITS[_i7];\n break;\n }\n }\n }\n if (!anyMatch) {\n baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo\n // Add the new base unit\n var _newBaseUnit = {\n dimensions: defUnit.dimensions.slice(0)\n };\n _newBaseUnit.key = baseName;\n BASE_UNITS[baseName] = _newBaseUnit;\n currentUnitSystem[baseName] = {\n unit: newUnit,\n prefix: PREFIXES.NONE['']\n };\n newUnit.base = BASE_UNITS[baseName];\n }\n }\n Unit.UNITS[name] = newUnit;\n for (var _i8 = 0; _i8 < aliases.length; _i8++) {\n var aliasName = aliases[_i8];\n var _alias = {};\n for (var _key6 in newUnit) {\n if (hasOwnProperty(newUnit, _key6)) {\n _alias[_key6] = newUnit[_key6];\n }\n }\n _alias.name = aliasName;\n Unit.UNITS[aliasName] = _alias;\n }\n\n // delete the memoization cache because we created a new unit\n delete _findUnit.cache;\n return new Unit(null, name);\n };\n Unit.deleteUnit = function (name) {\n delete Unit.UNITS[name];\n\n // delete the memoization cache because we deleted a unit\n delete _findUnit.cache;\n };\n\n // expose arrays with prefixes, dimensions, units, systems\n Unit.PREFIXES = PREFIXES;\n Unit.BASE_DIMENSIONS = BASE_DIMENSIONS;\n Unit.BASE_UNITS = BASE_UNITS;\n Unit.UNIT_SYSTEMS = UNIT_SYSTEMS;\n Unit.UNITS = UNITS;\n return Unit;\n}, {\n isClass: true\n});", "import { memoize } from '../function.js';\n\n/**\n * Calculate BigNumber e\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns e\n */\nexport var createBigNumberE = memoize(function (BigNumber) {\n return new BigNumber(1).exp();\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber golden ratio, phi = (1+sqrt(5))/2\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns phi\n */\nexport var createBigNumberPhi = memoize(function (BigNumber) {\n return new BigNumber(1).plus(new BigNumber(5).sqrt()).div(2);\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber pi.\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns pi\n */\nexport var createBigNumberPi = memoize(function (BigNumber) {\n return BigNumber.acos(-1);\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber tau, tau = 2 * pi\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns tau\n */\nexport var createBigNumberTau = memoize(function (BigNumber) {\n return createBigNumberPi(BigNumber).times(2);\n}, {\n hasher\n});\n\n/**\n * Create a hash for a BigNumber constructor function. The created has is\n * the configured precision\n * @param {Array} args Supposed to contain a single entry with\n * a BigNumber constructor\n * @return {number} precision\n * @private\n */\nfunction hasher(args) {\n return args[0].precision;\n}", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'unit';\nvar dependencies = ['typed', 'Unit'];\n\n// This function is named createUnitFunction to prevent a naming conflict with createUnit\nexport var createUnitFunction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Unit\n } = _ref;\n /**\n * Create a unit. Depending on the passed arguments, the function\n * will create and return a new math.Unit object.\n * When a matrix is provided, all elements will be converted to units.\n *\n * Syntax:\n *\n * math.unit(unit : string)\n * math.unit(value : number, valuelessUnit : Unit)\n * math.unit(value : number, valuelessUnit : string)\n *\n * Examples:\n *\n * const kph = math.unit('km/h') // returns Unit km/h (valueless)\n * const v = math.unit(25, kph) // returns Unit 25 km/h\n * const a = math.unit(5, 'cm') // returns Unit 50 mm\n * const b = math.unit('23 kg') // returns Unit 23 kg\n * a.to('m') // returns Unit 0.05 m\n *\n * See also:\n *\n * bignumber, boolean, complex, index, matrix, number, string, createUnit\n *\n * @param {* | Array | Matrix} args A number and unit.\n * @return {Unit | Array | Matrix} The created unit\n */\n\n return typed(name, {\n Unit: function Unit(x) {\n return x.clone();\n },\n string: function string(x) {\n if (Unit.isValuelessUnit(x)) {\n return new Unit(null, x); // a pure unit\n }\n return Unit.parse(x, {\n allowNoUnits: true\n }); // a unit with value, like '5cm'\n },\n 'number | BigNumber | Fraction | Complex, string | Unit': function numberBigNumberFractionComplexStringUnit(value, unit) {\n return new Unit(value, unit);\n },\n 'number | BigNumber | Fraction': function numberBigNumberFraction(value) {\n // dimensionless\n return new Unit(value);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'sparse';\nvar dependencies = ['typed', 'SparseMatrix'];\nexport var createSparse = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n SparseMatrix\n } = _ref;\n /**\n * Create a Sparse Matrix. The function creates a new `math.Matrix` object from\n * an `Array`. A Matrix has utility functions to manipulate the data in the\n * matrix, like getting the size and getting or setting values in the matrix.\n * Note that a Sparse Matrix is always 2-dimensional, so for example if\n * you create one from a plain array of _n_ numbers, you get an _n_ by 1\n * Sparse \"column vector\".\n *\n * Syntax:\n *\n * math.sparse() // creates an empty sparse matrix.\n * math.sparse(data) // creates a sparse matrix with initial data.\n * math.sparse(data, 'number') // creates a sparse matrix with initial data, number datatype.\n *\n * Examples:\n *\n * let m = math.sparse([[1, 2], [3, 4]])\n * m.size() // Array [2, 2]\n * m.resize([3, 2], 5)\n * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]]\n * m.get([1, 0]) // number 3\n * let v = math.sparse([0, 0, 1])\n * v.size() // Array [3, 1]\n * v.get([2, 0]) // number 1\n *\n * See also:\n *\n * bignumber, boolean, complex, index, number, string, unit, matrix\n *\n * @param {Array | Matrix} [data] A two dimensional array\n *\n * @return {Matrix} The created matrix\n */\n return typed(name, {\n '': function _() {\n return new SparseMatrix([]);\n },\n string: function string(datatype) {\n return new SparseMatrix([], datatype);\n },\n 'Array | Matrix': function ArrayMatrix(data) {\n return new SparseMatrix(data);\n },\n 'Array | Matrix, string': function ArrayMatrixString(data, datatype) {\n return new SparseMatrix(data, datatype);\n }\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'createUnit';\nvar dependencies = ['typed', 'Unit'];\nexport var createCreateUnit = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Unit\n } = _ref;\n /**\n * Create a user-defined unit and register it with the Unit type.\n *\n * Syntax:\n *\n * math.createUnit({\n * baseUnit1: {\n * aliases: [string, ...]\n * prefixes: object\n * },\n * unit2: {\n * definition: string,\n * aliases: [string, ...]\n * prefixes: object,\n * offset: number\n * },\n * unit3: string // Shortcut\n * })\n *\n * // Another shortcut:\n * math.createUnit(string, unit : string, [object])\n *\n * Examples:\n *\n * math.createUnit('foo')\n * math.createUnit('knot', {definition: '0.514444444 m/s', aliases: ['knots', 'kt', 'kts']})\n * math.createUnit('mph', '1 mile/hour')\n * math.createUnit('km', math.unit(1000, 'm'))\n *\n * @param {string} name The name of the new unit. Must be unique. Example: 'knot'\n * @param {string, UnitDefinition, Unit} definition Definition of the unit in terms of existing units. For example, '0.514444444 m / s'.\n * @param {Object} options (optional) An object containing any of the following properties:\n * - `prefixes {string}` \"none\", \"short\", \"long\", \"binary_short\", or \"binary_long\". The default is \"none\".\n * - `aliases {Array}` Array of strings. Example: ['knots', 'kt', 'kts']\n * - `offset {Numeric}` An offset to apply when converting from the unit. For example, the offset for celsius is 273.15. Default is 0.\n *\n * See also:\n *\n * unit\n *\n * @return {Unit} The new unit\n */\n return typed(name, {\n // General function signature. First parameter is an object where each property is the definition of a new unit. The object keys are the unit names and the values are the definitions. The values can be objects, strings, or Units. If a property is an empty object or an empty string, a new base unit is created. The second parameter is the options.\n 'Object, Object': function ObjectObject(obj, options) {\n return Unit.createUnit(obj, options);\n },\n // Same as above but without the options.\n Object: function Object(obj) {\n return Unit.createUnit(obj, {});\n },\n // Shortcut method for creating one unit.\n 'string, Unit | string | Object, Object': function stringUnitStringObjectObject(name, def, options) {\n var obj = {};\n obj[name] = def;\n return Unit.createUnit(obj, options);\n },\n // Same as above but without the options.\n 'string, Unit | string | Object': function stringUnitStringObject(name, def) {\n var obj = {};\n obj[name] = def;\n return Unit.createUnit(obj, {});\n },\n // Without a definition, creates a base unit.\n string: function string(name) {\n var obj = {};\n obj[name] = {};\n return Unit.createUnit(obj, {});\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'acos';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAcos = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the inverse cosine of a value.\n *\n * To avoid confusion with the matrix arccosine, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acos(x)\n *\n * Examples:\n *\n * math.acos(0.5) // returns number 1.0471975511965979\n * math.acos(math.cos(1.5)) // returns number 1.5\n *\n * math.acos(2) // returns Complex 0 + 1.3169578969248166 i\n *\n * See also:\n *\n * cos, atan, asin\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc cosine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 && x <= 1 || config.predictable) {\n return Math.acos(x);\n } else {\n return new Complex(x, 0).acos();\n }\n },\n Complex: function Complex(x) {\n return x.acos();\n },\n BigNumber: function BigNumber(x) {\n return x.acos();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acoshNumber } from '../../plain/number/index.js';\nvar name = 'acosh';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAcosh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the hyperbolic arccos of a value,\n * defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.acosh(x)\n *\n * Examples:\n *\n * math.acosh(1.5) // returns 0.9624236501192069\n *\n * See also:\n *\n * cosh, asinh, atanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccosine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 1 || config.predictable) {\n return acoshNumber(x);\n }\n if (x <= -1) {\n return new Complex(Math.log(Math.sqrt(x * x - 1) - x), Math.PI);\n }\n return new Complex(x, 0).acosh();\n },\n Complex: function Complex(x) {\n return x.acosh();\n },\n BigNumber: function BigNumber(x) {\n return x.acosh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acotNumber } from '../../plain/number/index.js';\nvar name = 'acot';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createAcot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse cotangent of a value, defined as `acot(x) = atan(1/x)`.\n *\n * To avoid confusion with the matrix arccotanget, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acot(x)\n *\n * Examples:\n *\n * math.acot(0.5) // returns number 1.1071487177940904\n * math.acot(2) // returns number 0.4636476090008061\n * math.acot(math.cot(1.5)) // returns number 1.5\n *\n * See also:\n *\n * cot, atan\n *\n * @param {number | BigNumber| Complex} x Function input\n * @return {number | BigNumber| Complex} The arc cotangent of x\n */\n return typed(name, {\n number: acotNumber,\n Complex: function Complex(x) {\n return x.acot();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).atan();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acothNumber } from '../../plain/number/index.js';\nvar name = 'acoth';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAcoth = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic arccotangent of a value,\n * defined as `acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.\n *\n * To avoid confusion with the matrix hyperbolic arccotangent, this\n * function does not apply to matrices.\n *\n * Syntax:\n *\n * math.acoth(x)\n *\n * Examples:\n *\n * math.acoth(0.5) // returns 0.8047189562170503\n *\n * See also:\n *\n * acsch, asech\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccotangent of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 1 || x <= -1 || config.predictable) {\n return acothNumber(x);\n }\n return new Complex(x, 0).acoth();\n },\n Complex: function Complex(x) {\n return x.acoth();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).atanh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acscNumber } from '../../plain/number/index.js';\nvar name = 'acsc';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAcsc = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse cosecant of a value, defined as `acsc(x) = asin(1/x)`.\n *\n * To avoid confusion with the matrix arccosecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acsc(x)\n *\n * Examples:\n *\n * math.acsc(2) // returns 0.5235987755982989\n * math.acsc(0.5) // returns Complex 1.5707963267948966 -1.3169578969248166i\n * math.acsc(math.csc(1.5)) // returns number ~1.5\n *\n * See also:\n *\n * csc, asin, asec\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc cosecant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= -1 || x >= 1 || config.predictable) {\n return acscNumber(x);\n }\n return new Complex(x, 0).acsc();\n },\n Complex: function Complex(x) {\n return x.acsc();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).asin();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acschNumber } from '../../plain/number/index.js';\nvar name = 'acsch';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createAcsch = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic arccosecant of a value,\n * defined as `acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1))`.\n *\n * To avoid confusion with the matrix hyperbolic arccosecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.acsch(x)\n *\n * Examples:\n *\n * math.acsch(0.5) // returns 1.4436354751788103\n *\n * See also:\n *\n * asech, acoth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccosecant of x\n */\n return typed(name, {\n number: acschNumber,\n Complex: function Complex(x) {\n return x.acsch();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).asinh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asecNumber } from '../../plain/number/index.js';\nvar name = 'asec';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAsec = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse secant of a value. Defined as `asec(x) = acos(1/x)`.\n *\n * To avoid confusion with the matrix arcsecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.asec(x)\n *\n * Examples:\n *\n * math.asec(2) // returns 1.0471975511965979\n * math.asec(math.sec(1.5)) // returns 1.5\n *\n * math.asec(0.5) // returns Complex 0 + 1.3169578969248166i\n *\n * See also:\n *\n * acos, acot, acsc\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc secant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= -1 || x >= 1 || config.predictable) {\n return asecNumber(x);\n }\n return new Complex(x, 0).asec();\n },\n Complex: function Complex(x) {\n return x.asec();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).acos();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asechNumber } from '../../plain/number/index.js';\nvar name = 'asech';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAsech = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic arcsecant of a value,\n * defined as `asech(x) = acosh(1/x) = ln(sqrt(1/x^2 - 1) + 1/x)`.\n *\n * To avoid confusion with the matrix hyperbolic arcsecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.asech(x)\n *\n * Examples:\n *\n * math.asech(0.5) // returns 1.3169578969248166\n *\n * See also:\n *\n * acsch, acoth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arcsecant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 1 && x >= -1 || config.predictable) {\n var xInv = 1 / x;\n if (xInv > 0 || config.predictable) {\n return asechNumber(x);\n }\n var ret = Math.sqrt(xInv * xInv - 1);\n return new Complex(Math.log(ret - xInv), Math.PI);\n }\n return new Complex(x, 0).asech();\n },\n Complex: function Complex(x) {\n return x.asech();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).acosh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'asin';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAsin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the inverse sine of a value.\n *\n * To avoid confusion with the matric arcsine, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.asin(x)\n *\n * Examples:\n *\n * math.asin(0.5) // returns number 0.5235987755982989\n * math.asin(math.sin(1.5)) // returns number ~1.5\n *\n * math.asin(2) // returns Complex 1.5707963267948966 -1.3169578969248166i\n *\n * See also:\n *\n * sin, atan, acos\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc sine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 && x <= 1 || config.predictable) {\n return Math.asin(x);\n } else {\n return new Complex(x, 0).asin();\n }\n },\n Complex: function Complex(x) {\n return x.asin();\n },\n BigNumber: function BigNumber(x) {\n return x.asin();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asinhNumber } from '../../plain/number/index.js';\nvar name = 'asinh';\nvar dependencies = ['typed'];\nexport var createAsinh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic arcsine of a value,\n * defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.\n *\n * To avoid confusion with the matrix hyperbolic arcsine, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.asinh(x)\n *\n * Examples:\n *\n * math.asinh(0.5) // returns 0.48121182505960347\n *\n * See also:\n *\n * acosh, atanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arcsine of x\n */\n return typed('asinh', {\n number: asinhNumber,\n Complex: function Complex(x) {\n return x.asinh();\n },\n BigNumber: function BigNumber(x) {\n return x.asinh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'atan';\nvar dependencies = ['typed'];\nexport var createAtan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the inverse tangent of a value.\n *\n * To avoid confusion with matrix arctangent, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.atan(x)\n *\n * Examples:\n *\n * math.atan(0.5) // returns number 0.4636476090008061\n * math.atan(2) // returns number 1.1071487177940904\n * math.atan(math.tan(1.5)) // returns number 1.5\n *\n * See also:\n *\n * tan, asin, acos\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc tangent of x\n */\n return typed('atan', {\n number: function number(x) {\n return Math.atan(x);\n },\n Complex: function Complex(x) {\n return x.atan();\n },\n BigNumber: function BigNumber(x) {\n return x.atan();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'atan2';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'DenseMatrix', 'concat'];\nexport var createAtan2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n BigNumber,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo09xS0Sf = createMatAlgo09xS0Sf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the inverse tangent function with two arguments, y/x.\n * By providing two arguments, the right quadrant of the computed angle can be\n * determined.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.atan2(y, x)\n *\n * Examples:\n *\n * math.atan2(2, 2) / math.pi // returns number 0.25\n *\n * const angle = math.unit(60, 'deg') // returns Unit 60 deg\n * const x = math.cos(angle)\n * const y = math.sin(angle)\n *\n * math.atan(2) // returns number 1.1071487177940904\n *\n * See also:\n *\n * tan, atan, sin, cos\n *\n * @param {number | Array | Matrix} y Second dimension\n * @param {number | Array | Matrix} x First dimension\n * @return {number | Array | Matrix} Four-quadrant inverse tangent\n */\n return typed(name, {\n 'number, number': Math.atan2,\n // Complex numbers doesn't seem to have a reasonable implementation of\n // atan2(). Even Matlab removed the support, after they only calculated\n // the atan only on base of the real part of the numbers and ignored\n // the imaginary.\n\n 'BigNumber, BigNumber': (y, x) => BigNumber.atan2(y, x)\n }, matrixAlgorithmSuite({\n scalar: 'number | BigNumber',\n SS: matAlgo09xS0Sf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { atanhNumber } from '../../plain/number/index.js';\nvar name = 'atanh';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAtanh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the hyperbolic arctangent of a value,\n * defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.\n *\n * To avoid confusion with the matrix hyperbolic arctangent, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.atanh(x)\n *\n * Examples:\n *\n * math.atanh(0.5) // returns 0.5493061443340549\n *\n * See also:\n *\n * acosh, asinh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arctangent of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 1 && x >= -1 || config.predictable) {\n return atanhNumber(x);\n }\n return new Complex(x, 0).atanh();\n },\n Complex: function Complex(x) {\n return x.atanh();\n },\n BigNumber: function BigNumber(x) {\n return x.atanh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'cos';\nvar dependencies = ['typed'];\nexport var createCos = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cosine of a value.\n *\n * To avoid confusion with the matrix cosine, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.cos(x)\n *\n * Examples:\n *\n * math.cos(2) // returns number -0.4161468365471422\n * math.cos(math.pi / 4) // returns number 0.7071067811865475\n * math.cos(math.unit(180, 'deg')) // returns number -1\n * math.cos(math.unit(60, 'deg')) // returns number 0.5\n *\n * const angle = 0.2\n * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1\n *\n * See also:\n *\n * cos, tan\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Cosine of x\n */\n return typed(name, {\n number: Math.cos,\n 'Complex | BigNumber': x => x.cos()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nexport var createTrigUnit = /* #__PURE__ */factory('trigUnit', ['typed'], _ref => {\n var {\n typed\n } = _ref;\n return {\n Unit: typed.referToSelf(self => x => {\n if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) {\n throw new TypeError('Unit in function cot is no angle');\n }\n return typed.find(self, x.valueType())(x.value);\n })\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { cosh as coshNumber } from '../../utils/number.js';\nvar name = 'cosh';\nvar dependencies = ['typed'];\nexport var createCosh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic cosine of a value,\n * defined as `cosh(x) = 1/2 * (exp(x) + exp(-x))`.\n *\n * To avoid confusion with the matrix hyperbolic cosine, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.cosh(x)\n *\n * Examples:\n *\n * math.cosh(0.5) // returns number 1.1276259652063807\n *\n * See also:\n *\n * sinh, tanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cosine of x\n */\n return typed(name, {\n number: coshNumber,\n 'Complex | BigNumber': x => x.cosh()\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { cotNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'cot';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cotangent of a value. Defined as `cot(x) = 1 / tan(x)`.\n *\n * To avoid confusion with the matrix cotangent, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.cot(x)\n *\n * Examples:\n *\n * math.cot(2) // returns number -0.45765755436028577\n * 1 / math.tan(2) // returns number -0.45765755436028577\n *\n * See also:\n *\n * tan, sec, csc\n *\n * @param {number | Complex | Unit | Array | Matrix} x Function input\n * @return {number | Complex | Array | Matrix} Cotangent of x\n */\n return typed(name, {\n number: cotNumber,\n Complex: x => x.cot(),\n BigNumber: x => new _BigNumber(1).div(x.tan())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { cothNumber } from '../../plain/number/index.js';\nvar name = 'coth';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCoth = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic cotangent of a value,\n * defined as `coth(x) = 1 / tanh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic cotangent, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.coth(x)\n *\n * Examples:\n *\n * // coth(x) = 1 / tanh(x)\n * math.coth(2) // returns 1.0373147207275482\n * 1 / math.tanh(2) // returns 1.0373147207275482\n *\n * See also:\n *\n * sinh, tanh, cosh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cotangent of x\n */\n return typed(name, {\n number: cothNumber,\n Complex: x => x.coth(),\n BigNumber: x => new _BigNumber(1).div(x.tanh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { cscNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'csc';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCsc = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cosecant of a value, defined as `csc(x) = 1/sin(x)`.\n *\n * To avoid confusion with the matrix cosecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.csc(x)\n *\n * Examples:\n *\n * math.csc(2) // returns number 1.099750170294617\n * 1 / math.sin(2) // returns number 1.099750170294617\n *\n * See also:\n *\n * sin, sec, cot\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Cosecant of x\n */\n return typed(name, {\n number: cscNumber,\n Complex: x => x.csc(),\n BigNumber: x => new _BigNumber(1).div(x.sin())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { cschNumber } from '../../plain/number/index.js';\nvar name = 'csch';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCsch = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic cosecant of a value,\n * defined as `csch(x) = 1 / sinh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic cosecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.csch(x)\n *\n * Examples:\n *\n * // csch(x) = 1/ sinh(x)\n * math.csch(0.5) // returns 1.9190347513349437\n * 1 / math.sinh(0.5) // returns 1.9190347513349437\n *\n * See also:\n *\n * sinh, sech, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cosecant of x\n */\n return typed(name, {\n number: cschNumber,\n Complex: x => x.csch(),\n BigNumber: x => new _BigNumber(1).div(x.sinh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { secNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'sec';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createSec = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the secant of a value, defined as `sec(x) = 1/cos(x)`.\n *\n * To avoid confusion with the matrix secant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.sec(x)\n *\n * Examples:\n *\n * math.sec(2) // returns number -2.4029979617223822\n * 1 / math.cos(2) // returns number -2.4029979617223822\n *\n * See also:\n *\n * cos, csc, cot\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Secant of x\n */\n return typed(name, {\n number: secNumber,\n Complex: x => x.sec(),\n BigNumber: x => new _BigNumber(1).div(x.cos())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { sechNumber } from '../../plain/number/index.js';\nvar name = 'sech';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createSech = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic secant of a value,\n * defined as `sech(x) = 1 / cosh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic secant, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.sech(x)\n *\n * Examples:\n *\n * // sech(x) = 1/ cosh(x)\n * math.sech(0.5) // returns 0.886818883970074\n * 1 / math.cosh(0.5) // returns 0.886818883970074\n *\n * See also:\n *\n * cosh, csch, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic secant of x\n */\n return typed(name, {\n number: sechNumber,\n Complex: x => x.sech(),\n BigNumber: x => new _BigNumber(1).div(x.cosh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'sin';\nvar dependencies = ['typed'];\nexport var createSin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the sine of a value.\n *\n * To avoid confusion with the matrix sine, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.sin(x)\n *\n * Examples:\n *\n * math.sin(2) // returns number 0.9092974268256813\n * math.sin(math.pi / 4) // returns number 0.7071067811865475\n * math.sin(math.unit(90, 'deg')) // returns number 1\n * math.sin(math.unit(30, 'deg')) // returns number 0.5\n *\n * const angle = 0.2\n * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1\n *\n * See also:\n *\n * cos, tan\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Sine of x\n */\n return typed(name, {\n number: Math.sin,\n 'Complex | BigNumber': x => x.sin()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { sinhNumber } from '../../plain/number/index.js';\nvar name = 'sinh';\nvar dependencies = ['typed'];\nexport var createSinh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic sine of a value,\n * defined as `sinh(x) = 1/2 * (exp(x) - exp(-x))`.\n *\n * To avoid confusion with the matrix hyperbolic sine, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.sinh(x)\n *\n * Examples:\n *\n * math.sinh(0.5) // returns number 0.5210953054937474\n *\n * See also:\n *\n * cosh, tanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic sine of x\n */\n return typed(name, {\n number: sinhNumber,\n 'Complex | BigNumber': x => x.sinh()\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'tan';\nvar dependencies = ['typed'];\nexport var createTan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the tangent of a value. `tan(x)` is equal to `sin(x) / cos(x)`.\n *\n * To avoid confusion with the matrix tangent, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.tan(x)\n *\n * Examples:\n *\n * math.tan(0.5) // returns number 0.5463024898437905\n * math.sin(0.5) / math.cos(0.5) // returns number 0.5463024898437905\n * math.tan(math.pi / 4) // returns number 1\n * math.tan(math.unit(45, 'deg')) // returns number 1\n *\n * See also:\n *\n * atan, sin, cos\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Tangent of x\n */\n return typed(name, {\n number: Math.tan,\n 'Complex | BigNumber': x => x.tan()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { tanh as _tanh } from '../../utils/number.js';\nvar name = 'tanh';\nvar dependencies = ['typed'];\nexport var createTanh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic tangent of a value,\n * defined as `tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1)`.\n *\n * To avoid confusion with matrix hyperbolic tangent, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.tanh(x)\n *\n * Examples:\n *\n * // tanh(x) = sinh(x) / cosh(x) = 1 / coth(x)\n * math.tanh(0.5) // returns 0.46211715726000974\n * math.sinh(0.5) / math.cosh(0.5) // returns 0.46211715726000974\n * 1 / math.coth(0.5) // returns 0.46211715726000974\n *\n * See also:\n *\n * sinh, cosh, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic tangent of x\n */\n return typed('tanh', {\n number: _tanh,\n 'Complex | BigNumber': x => x.tanh()\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setCartesian';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetCartesian = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the cartesian product of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays\n * and the values will be sorted in ascending order before the operation.\n *\n * Syntax:\n *\n * math.setCartesian(set1, set2)\n *\n * Examples:\n *\n * math.setCartesian([1, 2], [3, 4]) // returns [[1, 3], [1, 4], [2, 3], [2, 4]]\n * math.setCartesian([4, 3], [2, 1]) // returns [[3, 1], [3, 2], [4, 1], [4, 2]]\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference, setPowerset\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The cartesian product of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n var result = [];\n if (subset(size(a1), new Index(0)) !== 0 && subset(size(a2), new Index(0)) !== 0) {\n // if any of them is empty, return empty\n var b1 = flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural);\n var b2 = flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural);\n result = [];\n for (var i = 0; i < b1.length; i++) {\n for (var j = 0; j < b2.length; j++) {\n result.push([b1[i], b2[j]]);\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return result;\n }\n // return a matrix otherwise\n return new DenseMatrix(result);\n }\n });\n});", "import { flatten, generalize, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setDifference';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetDifference = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the difference of two (multi)sets: every element of set1, that is not the element of set2.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setDifference(set1, set2)\n *\n * Examples:\n *\n * math.setDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2]\n * math.setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2]\n *\n * See also:\n *\n * setUnion, setIntersect, setSymDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The difference of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n var result;\n if (subset(size(a1), new Index(0)) === 0) {\n // empty-anything=empty\n result = [];\n } else if (subset(size(a2), new Index(0)) === 0) {\n // anything-empty=anything\n return flatten(a1.toArray());\n } else {\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n result = [];\n var inb2;\n for (var i = 0; i < b1.length; i++) {\n inb2 = false;\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n inb2 = true;\n break;\n }\n }\n if (!inb2) {\n result.push(b1[i]);\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return generalize(result);\n }\n // return a matrix otherwise\n return new DenseMatrix(generalize(result));\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setDistinct';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetDistinct = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Collect the distinct elements of a multiset.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setDistinct(set)\n *\n * Examples:\n *\n * math.setDistinct([1, 1, 1, 2, 2, 3]) // returns [1, 2, 3]\n *\n * See also:\n *\n * setMultiplicity\n *\n * @param {Array | Matrix} a A multiset\n * @return {Array | Matrix} A set containing the distinc elements of the multiset\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(a) {\n var result;\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return empty\n result = [];\n } else {\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n result = [];\n result.push(b[0]);\n for (var i = 1; i < b.length; i++) {\n if (compareNatural(b[i], b[i - 1]) !== 0) {\n result.push(b[i]);\n }\n }\n }\n // return an array, if the input was an array\n if (Array.isArray(a)) {\n return result;\n }\n // return a matrix otherwise\n return new DenseMatrix(result);\n }\n });\n});", "import { flatten, generalize, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setIntersect';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetIntersect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the intersection of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setIntersect(set1, set2)\n *\n * Examples:\n *\n * math.setIntersect([1, 2, 3, 4], [3, 4, 5, 6]) // returns [3, 4]\n * math.setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [3, 4]\n *\n * See also:\n *\n * setUnion, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The intersection of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n var result;\n if (subset(size(a1), new Index(0)) === 0 || subset(size(a2), new Index(0)) === 0) {\n // of any of them is empty, return empty\n result = [];\n } else {\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n result = [];\n for (var i = 0; i < b1.length; i++) {\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n result.push(b1[i]);\n break;\n }\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return generalize(result);\n }\n // return a matrix otherwise\n return new DenseMatrix(generalize(result));\n }\n });\n});", "import { flatten, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setIsSubset';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetIsSubset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Check whether a (multi)set is a subset of another (multi)set. (Every element of set1 is the element of set2.)\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setIsSubset(set1, set2)\n *\n * Examples:\n *\n * math.setIsSubset([1, 2], [3, 4, 5, 6]) // returns false\n * math.setIsSubset([3, 4], [3, 4, 5, 6]) // returns true\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {boolean} Returns true when a1 is a subset of a2, returns false otherwise\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // empty is a subset of anything\n return true;\n } else if (subset(size(a2), new Index(0)) === 0) {\n // anything is not a subset of empty\n return false;\n }\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n var inb2;\n for (var i = 0; i < b1.length; i++) {\n inb2 = false;\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n inb2 = true;\n break;\n }\n }\n if (inb2 === false) {\n return false;\n }\n }\n return true;\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setMultiplicity';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetMultiplicity = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Count the multiplicity of an element in a multiset.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setMultiplicity(element, set)\n *\n * Examples:\n *\n * math.setMultiplicity(1, [1, 2, 2, 4]) // returns 1\n * math.setMultiplicity(2, [1, 2, 2, 4]) // returns 2\n *\n * See also:\n *\n * setDistinct, setSize\n *\n * @param {number | BigNumber | Fraction | Complex} e An element in the multiset\n * @param {Array | Matrix} a A multiset\n * @return {number} The number of how many times the multiset contains the element\n */\n return typed(name, {\n 'number | BigNumber | Fraction | Complex, Array | Matrix': function numberBigNumberFractionComplexArrayMatrix(e, a) {\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return 0\n return 0;\n }\n var b = flatten(Array.isArray(a) ? a : a.toArray());\n var count = 0;\n for (var i = 0; i < b.length; i++) {\n if (compareNatural(b[i], e) === 0) {\n count++;\n }\n }\n return count;\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setPowerset';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetPowerset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Create the powerset of a (multi)set. (The powerset contains very possible subsets of a (multi)set.)\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setPowerset(set)\n *\n * Examples:\n *\n * math.setPowerset([1, 2, 3]) // returns [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]\n *\n * See also:\n *\n * setCartesian\n *\n * @param {Array | Matrix} a A (multi)set\n * @return {Array} The powerset of the (multi)set\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(a) {\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return empty\n return [];\n }\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n var result = [];\n var number = 0;\n while (number.toString(2).length <= b.length) {\n result.push(_subset(b, number.toString(2).split('').reverse()));\n number++;\n }\n // can not return a matrix, because of the different size of the subarrays\n return _sort(result);\n }\n });\n\n // create subset\n function _subset(array, bitarray) {\n var result = [];\n for (var i = 0; i < bitarray.length; i++) {\n if (bitarray[i] === '1') {\n result.push(array[i]);\n }\n }\n return result;\n }\n\n // sort subsests by length\n function _sort(array) {\n var temp = [];\n for (var i = array.length - 1; i > 0; i--) {\n for (var j = 0; j < i; j++) {\n if (array[j].length > array[j + 1].length) {\n temp = array[j];\n array[j] = array[j + 1];\n array[j + 1] = temp;\n }\n }\n }\n return array;\n }\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setSize';\nvar dependencies = ['typed', 'compareNatural'];\nexport var createSetSize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compareNatural\n } = _ref;\n /**\n * Count the number of elements of a (multi)set. When a second parameter is 'true', count only the unique values.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setSize(set)\n * math.setSize(set, unique)\n *\n * Examples:\n *\n * math.setSize([1, 2, 2, 4]) // returns 4\n * math.setSize([1, 2, 2, 4], true) // returns 3\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a A multiset\n * @param {boolean} [unique] If true, only the unique values are counted. False by default\n * @return {number} The number of elements of the (multi)set\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(a) {\n return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;\n },\n 'Array | Matrix, boolean': function ArrayMatrixBoolean(a, unique) {\n if (unique === false || a.length === 0) {\n return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;\n } else {\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n var count = 1;\n for (var i = 1; i < b.length; i++) {\n if (compareNatural(b[i], b[i - 1]) !== 0) {\n count++;\n }\n }\n return count;\n }\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setSymDifference';\nvar dependencies = ['typed', 'size', 'concat', 'subset', 'setDifference', 'Index'];\nexport var createSetSymDifference = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n concat,\n subset,\n setDifference,\n Index\n } = _ref;\n /**\n * Create the symmetric difference of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setSymDifference(set1, set2)\n *\n * Examples:\n *\n * math.setSymDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 5, 6]\n * math.setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 5, 6]\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The symmetric difference of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // if any of them is empty, return the other one\n return flatten(a2);\n } else if (subset(size(a2), new Index(0)) === 0) {\n return flatten(a1);\n }\n var b1 = flatten(a1);\n var b2 = flatten(a2);\n return concat(setDifference(b1, b2), setDifference(b2, b1));\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setUnion';\nvar dependencies = ['typed', 'size', 'concat', 'subset', 'setIntersect', 'setSymDifference', 'Index'];\nexport var createSetUnion = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n concat,\n subset,\n setIntersect,\n setSymDifference,\n Index\n } = _ref;\n /**\n * Create the union of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setUnion(set1, set2)\n *\n * Examples:\n *\n * math.setUnion([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 3, 4, 5, 6]\n * math.setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 3, 4, 5, 6]\n *\n * See also:\n *\n * setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The union of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // if any of them is empty, return the other one\n return flatten(a2);\n } else if (subset(size(a2), new Index(0)) === 0) {\n return flatten(a1);\n }\n var b1 = flatten(a1);\n var b2 = flatten(a2);\n return concat(setSymDifference(b1, b2), setIntersect(b1, b2));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'add';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'equalScalar', 'DenseMatrix', 'SparseMatrix', 'concat'];\nexport var createAdd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n equalScalar,\n DenseMatrix,\n SparseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n /**\n * Add two or more values, `x + y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.add(x, y)\n * math.add(x, y, z, ...)\n *\n * Examples:\n *\n * math.add(2, 3) // returns number 5\n * math.add(2, 3, 4) // returns number 9\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(-4, 1)\n * math.add(a, b) // returns Complex -2 + 4i\n *\n * math.add([1, 2, 3], 4) // returns Array [5, 6, 7]\n *\n * const c = math.unit('5 cm')\n * const d = math.unit('2.1 mm')\n * math.add(c, d) // returns Unit 52.1 mm\n *\n * math.add(\"2.3\", \"4\") // returns number 6.3\n *\n * See also:\n *\n * subtract, sum\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to add\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to add\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Sum of `x` and `y`\n */\n return typed(name, {\n 'any, any': addScalar,\n 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => {\n var result = self(x, y);\n for (var i = 0; i < rest.length; i++) {\n result = self(result, rest[i]);\n }\n return result;\n })\n }, matrixAlgorithmSuite({\n elop: addScalar,\n DS: matAlgo01xDSid,\n SS: matAlgo04xSidSid,\n Ss: matAlgo10xSids\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { flatten } from '../../utils/array.js';\nimport { isComplex } from '../../utils/is.js';\nvar name = 'hypot';\nvar dependencies = ['typed', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'sqrt', 'smaller', 'isPositive'];\nexport var createHypot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n addScalar,\n divideScalar,\n multiplyScalar,\n sqrt,\n smaller,\n isPositive\n } = _ref;\n /**\n * Calculate the hypotenusa of a list with values. The hypotenusa is defined as:\n *\n * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...)\n *\n * For matrix input, the hypotenusa is calculated for all values in the matrix.\n *\n * Syntax:\n *\n * math.hypot(a, b, ...)\n * math.hypot([a, b, c, ...])\n *\n * Examples:\n *\n * math.hypot(3, 4) // 5\n * math.hypot(3, 4, 5) // 7.0710678118654755\n * math.hypot([3, 4, 5]) // 7.0710678118654755\n * math.hypot(-2) // 2\n *\n * See also:\n *\n * abs, norm\n *\n * @param {... number | BigNumber | Array | Matrix} args A list with numeric values or an Array or Matrix.\n * Matrix and Array input is flattened and returns a\n * single number for the whole matrix.\n * @return {number | BigNumber} Returns the hypothenusa of the input values.\n */\n return typed(name, {\n '... number | BigNumber': _hypot,\n Array: _hypot,\n Matrix: M => _hypot(flatten(M.toArray()))\n });\n\n /**\n * Calculate the hypotenusa for an Array with values\n * @param {Array.} args\n * @return {number | BigNumber} Returns the result\n * @private\n */\n function _hypot(args) {\n // code based on `hypot` from es6-shim:\n // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1619-L1633\n var result = 0;\n var largest = 0;\n for (var i = 0; i < args.length; i++) {\n if (isComplex(args[i])) {\n throw new TypeError('Unexpected type of argument to hypot');\n }\n var value = abs(args[i]);\n if (smaller(largest, value)) {\n result = multiplyScalar(result, multiplyScalar(divideScalar(largest, value), divideScalar(largest, value)));\n result = addScalar(result, 1);\n largest = value;\n } else {\n result = addScalar(result, isPositive(value) ? multiplyScalar(divideScalar(value, largest), divideScalar(value, largest)) : value);\n }\n }\n return multiplyScalar(largest, sqrt(result));\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'norm';\nvar dependencies = ['typed', 'abs', 'add', 'pow', 'conj', 'sqrt', 'multiply', 'equalScalar', 'larger', 'smaller', 'matrix', 'ctranspose', 'eigs'];\nexport var createNorm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n pow,\n conj,\n sqrt,\n multiply,\n equalScalar,\n larger,\n smaller,\n matrix,\n ctranspose,\n eigs\n } = _ref;\n /**\n * Calculate the norm of a number, vector or matrix.\n *\n * The second parameter p is optional. If not provided, it defaults to 2.\n *\n * Syntax:\n *\n * math.norm(x)\n * math.norm(x, p)\n *\n * Examples:\n *\n * math.abs(-3.5) // returns 3.5\n * math.norm(-3.5) // returns 3.5\n *\n * math.norm(math.complex(3, -4)) // returns 5\n *\n * math.norm([1, 2, -3], Infinity) // returns 3\n * math.norm([1, 2, -3], -Infinity) // returns 1\n *\n * math.norm([3, 4], 2) // returns 5\n *\n * math.norm([[1, 2], [3, 4]], 1) // returns 6\n * math.norm([[1, 2], [3, 4]], 'inf') // returns 7\n * math.norm([[1, 2], [3, 4]], 'fro') // returns 5.477225575051661\n *\n * See also:\n *\n * abs, hypot\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the norm\n * @param {number | BigNumber | string} [p=2]\n * Vector space.\n * Supported numbers include Infinity and -Infinity.\n * Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm)\n * @return {number | BigNumber} the p-norm\n */\n return typed(name, {\n number: Math.abs,\n Complex: function Complex(x) {\n return x.abs();\n },\n BigNumber: function BigNumber(x) {\n // norm(x) = abs(x)\n return x.abs();\n },\n boolean: function boolean(x) {\n // norm(x) = abs(x)\n return Math.abs(x);\n },\n Array: function Array(x) {\n return _norm(matrix(x), 2);\n },\n Matrix: function Matrix(x) {\n return _norm(x, 2);\n },\n 'Array, number | BigNumber | string': function ArrayNumberBigNumberString(x, p) {\n return _norm(matrix(x), p);\n },\n 'Matrix, number | BigNumber | string': function MatrixNumberBigNumberString(x, p) {\n return _norm(x, p);\n }\n });\n\n /**\n * Calculate the plus infinity norm for a vector\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNormPlusInfinity(x) {\n // norm(x, Infinity) = max(abs(x))\n var pinf = 0;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n var v = abs(value);\n if (larger(v, pinf)) {\n pinf = v;\n }\n }, true);\n return pinf;\n }\n\n /**\n * Calculate the minus infinity norm for a vector\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNormMinusInfinity(x) {\n // norm(x, -Infinity) = min(abs(x))\n var ninf;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n var v = abs(value);\n if (!ninf || smaller(v, ninf)) {\n ninf = v;\n }\n }, true);\n return ninf || 0;\n }\n\n /**\n * Calculate the norm for a vector\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNorm(x, p) {\n // check p\n if (p === Number.POSITIVE_INFINITY || p === 'inf') {\n return _vectorNormPlusInfinity(x);\n }\n if (p === Number.NEGATIVE_INFINITY || p === '-inf') {\n return _vectorNormMinusInfinity(x);\n }\n if (p === 'fro') {\n return _norm(x, 2);\n }\n if (typeof p === 'number' && !isNaN(p)) {\n // check p != 0\n if (!equalScalar(p, 0)) {\n // norm(x, p) = sum(abs(xi) ^ p) ^ 1/p\n var n = 0;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n n = add(pow(abs(value), p), n);\n }, true);\n return pow(n, 1 / p);\n }\n return Number.POSITIVE_INFINITY;\n }\n // invalid parameter value\n throw new Error('Unsupported parameter value');\n }\n\n /**\n * Calculate the Frobenius norm for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormFrobenius(x) {\n // norm(x) = sqrt(sum(diag(x'x)))\n var fro = 0;\n x.forEach(function (value, index) {\n fro = add(fro, multiply(value, conj(value)));\n });\n return abs(sqrt(fro));\n }\n\n /**\n * Calculate the norm L1 for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormOne(x) {\n // norm(x) = the largest column sum\n var c = [];\n // result\n var maxc = 0;\n // skip zeros since abs(0) == 0\n x.forEach(function (value, index) {\n var j = index[1];\n var cj = add(c[j] || 0, abs(value));\n if (larger(cj, maxc)) {\n maxc = cj;\n }\n c[j] = cj;\n }, true);\n return maxc;\n }\n\n /**\n * Calculate the norm L2 for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormTwo(x) {\n // norm(x) = sqrt( max eigenvalue of A*.A)\n var sizeX = x.size();\n if (sizeX[0] !== sizeX[1]) {\n throw new RangeError('Invalid matrix dimensions');\n }\n var tx = ctranspose(x);\n var squaredX = multiply(tx, x);\n var eigenVals = eigs(squaredX).values.toArray();\n var rho = eigenVals[eigenVals.length - 1];\n return abs(sqrt(rho));\n }\n\n /**\n * Calculate the infinity norm for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormInfinity(x) {\n // norm(x) = the largest row sum\n var r = [];\n // result\n var maxr = 0;\n // skip zeros since abs(0) == 0\n x.forEach(function (value, index) {\n var i = index[0];\n var ri = add(r[i] || 0, abs(value));\n if (larger(ri, maxr)) {\n maxr = ri;\n }\n r[i] = ri;\n }, true);\n return maxr;\n }\n\n /**\n * Calculate the norm for a 2D Matrix (M*N)\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNorm(x, p) {\n // check p\n if (p === 1) {\n return _matrixNormOne(x);\n }\n if (p === Number.POSITIVE_INFINITY || p === 'inf') {\n return _matrixNormInfinity(x);\n }\n if (p === 'fro') {\n return _matrixNormFrobenius(x);\n }\n if (p === 2) {\n return _matrixNormTwo(x);\n } // invalid parameter value\n\n throw new Error('Unsupported parameter value ' + p);\n }\n\n /**\n * Calculate the norm for an array\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _norm(x, p) {\n // size\n var sizeX = x.size();\n\n // check if it is a vector\n if (sizeX.length === 1) {\n return _vectorNorm(x, p);\n }\n // MxN matrix\n if (sizeX.length === 2) {\n if (sizeX[0] && sizeX[1]) {\n return _matrixNorm(x, p);\n } else {\n throw new RangeError('Invalid matrix dimensions');\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'dot';\nvar dependencies = ['typed', 'addScalar', 'multiplyScalar', 'conj', 'size'];\nexport var createDot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n multiplyScalar,\n conj,\n size\n } = _ref;\n /**\n * Calculate the dot product of two vectors. The dot product of\n * `A = [a1, a2, ..., an]` and `B = [b1, b2, ..., bn]` is defined as:\n *\n * dot(A, B) = conj(a1) * b1 + conj(a2) * b2 + ... + conj(an) * bn\n *\n * Syntax:\n *\n * math.dot(x, y)\n *\n * Examples:\n *\n * math.dot([2, 4, 1], [2, 2, 3]) // returns number 15\n * math.multiply([2, 4, 1], [2, 2, 3]) // returns number 15\n *\n * See also:\n *\n * multiply, cross\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {number} Returns the dot product of `x` and `y`\n */\n return typed(name, {\n 'Array | DenseMatrix, Array | DenseMatrix': _denseDot,\n 'SparseMatrix, SparseMatrix': _sparseDot\n });\n function _validateDim(x, y) {\n var xSize = _size(x);\n var ySize = _size(y);\n var xLen, yLen;\n if (xSize.length === 1) {\n xLen = xSize[0];\n } else if (xSize.length === 2 && xSize[1] === 1) {\n xLen = xSize[0];\n } else {\n throw new RangeError('Expected a column vector, instead got a matrix of size (' + xSize.join(', ') + ')');\n }\n if (ySize.length === 1) {\n yLen = ySize[0];\n } else if (ySize.length === 2 && ySize[1] === 1) {\n yLen = ySize[0];\n } else {\n throw new RangeError('Expected a column vector, instead got a matrix of size (' + ySize.join(', ') + ')');\n }\n if (xLen !== yLen) throw new RangeError('Vectors must have equal length (' + xLen + ' != ' + yLen + ')');\n if (xLen === 0) throw new RangeError('Cannot calculate the dot product of empty vectors');\n return xLen;\n }\n function _denseDot(a, b) {\n var N = _validateDim(a, b);\n var adata = isMatrix(a) ? a._data : a;\n var adt = isMatrix(a) ? a._datatype || a.getDataType() : undefined;\n var bdata = isMatrix(b) ? b._data : b;\n var bdt = isMatrix(b) ? b._datatype || b.getDataType() : undefined;\n\n // are these 2-dimensional column vectors? (as opposed to 1-dimensional vectors)\n var aIsColumn = _size(a).length === 2;\n var bIsColumn = _size(b).length === 2;\n var add = addScalar;\n var mul = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n var dt = adt;\n // find signatures that matches (dt, dt)\n add = typed.find(addScalar, [dt, dt]);\n mul = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // both vectors 1-dimensional\n if (!aIsColumn && !bIsColumn) {\n var c = mul(conj(adata[0]), bdata[0]);\n for (var i = 1; i < N; i++) {\n c = add(c, mul(conj(adata[i]), bdata[i]));\n }\n return c;\n }\n\n // a is 1-dim, b is column\n if (!aIsColumn && bIsColumn) {\n var _c = mul(conj(adata[0]), bdata[0][0]);\n for (var _i = 1; _i < N; _i++) {\n _c = add(_c, mul(conj(adata[_i]), bdata[_i][0]));\n }\n return _c;\n }\n\n // a is column, b is 1-dim\n if (aIsColumn && !bIsColumn) {\n var _c2 = mul(conj(adata[0][0]), bdata[0]);\n for (var _i2 = 1; _i2 < N; _i2++) {\n _c2 = add(_c2, mul(conj(adata[_i2][0]), bdata[_i2]));\n }\n return _c2;\n }\n\n // both vectors are column\n if (aIsColumn && bIsColumn) {\n var _c3 = mul(conj(adata[0][0]), bdata[0][0]);\n for (var _i3 = 1; _i3 < N; _i3++) {\n _c3 = add(_c3, mul(conj(adata[_i3][0]), bdata[_i3][0]));\n }\n return _c3;\n }\n }\n function _sparseDot(x, y) {\n _validateDim(x, y);\n var xindex = x._index;\n var xvalues = x._values;\n var yindex = y._index;\n var yvalues = y._values;\n\n // TODO optimize add & mul using datatype\n var c = 0;\n var add = addScalar;\n var mul = multiplyScalar;\n var i = 0;\n var j = 0;\n while (i < xindex.length && j < yindex.length) {\n var I = xindex[i];\n var J = yindex[j];\n if (I < J) {\n i++;\n continue;\n }\n if (I > J) {\n j++;\n continue;\n }\n if (I === J) {\n c = add(c, mul(xvalues[i], yvalues[j]));\n i++;\n j++;\n }\n }\n return c;\n }\n\n // TODO remove this once #1771 is fixed\n function _size(x) {\n return isMatrix(x) ? x.size() : size(x);\n }\n});", "import { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'trace';\nvar dependencies = ['typed', 'matrix', 'add'];\nexport var createTrace = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n add\n } = _ref;\n /**\n * Calculate the trace of a matrix: the sum of the elements on the main\n * diagonal of a square matrix.\n *\n * Syntax:\n *\n * math.trace(x)\n *\n * Examples:\n *\n * math.trace([[1, 2], [3, 4]]) // returns 5\n *\n * const A = [\n * [1, 2, 3],\n * [-1, 2, 3],\n * [2, 0, 3]\n * ]\n * math.trace(A) // returns 6\n *\n * See also:\n *\n * diag\n *\n * @param {Array | Matrix} x A matrix\n *\n * @return {number} The trace of `x`\n */\n return typed('trace', {\n Array: function _arrayTrace(x) {\n // use dense matrix implementation\n return _denseTrace(matrix(x));\n },\n SparseMatrix: _sparseTrace,\n DenseMatrix: _denseTrace,\n any: clone\n });\n function _denseTrace(m) {\n // matrix size & data\n var size = m._size;\n var data = m._data;\n\n // process dimensions\n switch (size.length) {\n case 1:\n // vector\n if (size[0] === 1) {\n // return data[0]\n return clone(data[0]);\n }\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n case 2:\n {\n // two dimensional\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n // calulate sum\n var sum = 0;\n // loop diagonal\n for (var i = 0; i < rows; i++) {\n sum = add(sum, data[i][i]);\n }\n // return trace\n return sum;\n } else {\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional\n throw new RangeError('Matrix must be two dimensional (size: ' + format(size) + ')');\n }\n }\n function _sparseTrace(m) {\n // matrix arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n var size = m._size;\n // check dimensions\n var rows = size[0];\n var columns = size[1];\n // matrix must be square\n if (rows === columns) {\n // calulate sum\n var sum = 0;\n // check we have data (avoid looping columns)\n if (values.length > 0) {\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = index[k];\n // check row\n if (i === j) {\n // accumulate value\n sum = add(sum, values[k]);\n // exit loop\n break;\n }\n if (i > j) {\n // exit loop, no value on the diagonal for column j\n break;\n }\n }\n }\n }\n // return trace\n return sum;\n }\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n }\n});", "import { isBigNumber, isMatrix, isArray } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'index';\nvar dependencies = ['typed', 'Index'];\nexport var createIndex = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index\n } = _ref;\n /**\n * Create an index. An Index can store ranges having start, step, and end\n * for multiple dimensions.\n * Matrix.get, Matrix.set, and math.subset accept an Index as input.\n *\n * Syntax:\n *\n * math.index(range1, range2, ...)\n *\n * Where each range can be any of:\n *\n * - A number\n * - A string for getting/setting an object property\n * - An instance of `Range`\n * - A one-dimensional Array or a Matrix with numbers or booleans\n *\n * Indexes must be zero-based, integer numbers.\n *\n * Examples:\n *\n * const b = [1, 2, 3, 4, 5]\n * math.subset(b, math.index([1, 2, 3])) // returns [2, 3, 4]\n * math.subset(b, math.index([false, true, true, true, false])) // returns [2, 3, 4]\n *\n * const a = math.matrix([[1, 2], [3, 4]])\n * a.subset(math.index(0, 1)) // returns 2\n * a.subset(math.index(0, [false, true])) // returns 2\n *\n * See also:\n *\n * bignumber, boolean, complex, matrix, number, string, unit\n *\n * @param {...*} ranges Zero or more ranges or numbers.\n * @return {Index} Returns the created index\n */\n return typed(name, {\n '...number | string | BigNumber | Range | Array | Matrix': function numberStringBigNumberRangeArrayMatrix(args) {\n var ranges = args.map(function (arg) {\n if (isBigNumber(arg)) {\n return arg.toNumber(); // convert BigNumber to Number\n } else if (isArray(arg) || isMatrix(arg)) {\n return arg.map(function (elem) {\n // convert BigNumber to Number\n return isBigNumber(elem) ? elem.toNumber() : elem;\n });\n } else {\n return arg;\n }\n });\n var res = new Index();\n Index.apply(res, ranges);\n return res;\n }\n });\n});", "import { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { deepStrictEqual } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMap } from '../../utils/map.js';\nvar name = 'Node';\nvar dependencies = ['mathWithTransform'];\nexport var createNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n mathWithTransform\n } = _ref;\n /**\n * Validate the symbol names of a scope.\n * Throws an error when the scope contains an illegal symbol.\n * @param {Object} scope\n */\n function _validateScope(scope) {\n for (var symbol of [...keywords]) {\n if (scope.has(symbol)) {\n throw new Error('Scope contains an illegal symbol, \"' + symbol + '\" is a reserved keyword');\n }\n }\n }\n class Node {\n get type() {\n return 'Node';\n }\n get isNode() {\n return true;\n }\n\n /**\n * Evaluate the node\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} Returns the result\n */\n evaluate(scope) {\n return this.compile().evaluate(scope);\n }\n\n /**\n * Compile the node into an optimized, evauatable JavaScript function\n * @return {{evaluate: function([Object])}} object\n * Returns an object with a function 'evaluate',\n * which can be invoked as expr.evaluate([scope: Object]),\n * where scope is an optional object with\n * variables.\n */\n compile() {\n var expr = this._compile(mathWithTransform, {});\n var args = {};\n var context = null;\n function evaluate(scope) {\n var s = createMap(scope);\n _validateScope(s);\n return expr(s, args, context);\n }\n return {\n evaluate\n };\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n throw new Error('Method _compile must be implemented by type ' + this.type);\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run forEach on a Node interface');\n }\n\n /**\n * Create a new Node whose children are the results of calling the\n * provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run map on a Node interface');\n }\n\n /**\n * Validate whether an object is a Node, for use with map\n * @param {Node} node\n * @returns {Node} Returns the input if it's a node, else throws an Error\n * @protected\n */\n _ifNode(node) {\n if (!isNode(node)) {\n throw new TypeError('Callback function must return a Node');\n }\n return node;\n }\n\n /**\n * Recursively traverse all nodes in a node tree. Executes given callback for\n * this node and each of its child nodes.\n * @param {function(node: Node, path: string, parent: Node)} callback\n * A callback called for every node in the node tree.\n */\n traverse(callback) {\n // execute callback for itself\n // eslint-disable-next-line\n callback(this, null, null);\n\n // recursively traverse over all children of a node\n function _traverse(node, callback) {\n node.forEach(function (child, path, parent) {\n callback(child, path, parent);\n _traverse(child, callback);\n });\n }\n _traverse(this, callback);\n }\n\n /**\n * Recursively transform a node tree via a transform function.\n *\n * For example, to replace all nodes of type SymbolNode having name 'x' with\n * a ConstantNode with value 2:\n *\n * const res = Node.transform(function (node, path, parent) {\n * if (node && node.isSymbolNode) && (node.name === 'x')) {\n * return new ConstantNode(2)\n * }\n * else {\n * return node\n * }\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A mapping function accepting a node, and returning\n * a replacement for the node or the original node. The \"signature\"\n * of the callback must be:\n * callback(node: Node, index: string, parent: Node) : Node\n * @return {Node} Returns the original node or its replacement\n */\n transform(callback) {\n function _transform(child, path, parent) {\n var replacement = callback(child, path, parent);\n if (replacement !== child) {\n // stop iterating when the node is replaced\n return replacement;\n }\n return child.map(_transform);\n }\n return _transform(this, null, null);\n }\n\n /**\n * Find any node in the node tree matching given filter function. For\n * example, to find all nodes of type SymbolNode having name 'x':\n *\n * const results = Node.filter(function (node) {\n * return (node && node.isSymbolNode) && (node.name === 'x')\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A test function returning true when a node matches, and false\n * otherwise. Function signature:\n * callback(node: Node, index: string, parent: Node) : boolean\n * @return {Node[]} nodes\n * An array with nodes matching given filter criteria\n */\n filter(callback) {\n var nodes = [];\n this.traverse(function (node, path, parent) {\n if (callback(node, path, parent)) {\n nodes.push(node);\n }\n });\n return nodes;\n }\n\n /**\n * Create a shallow clone of this node\n * @return {Node}\n */\n clone() {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot clone a Node interface');\n }\n\n /**\n * Create a deep clone of this node\n * @return {Node}\n */\n cloneDeep() {\n return this.map(function (node) {\n return node.cloneDeep();\n });\n }\n\n /**\n * Deep compare this node with another node.\n * @param {Node} other\n * @return {boolean} Returns true when both nodes are of the same type and\n * contain the same values (as do their childs)\n */\n equals(other) {\n return other ? this.type === other.type && deepStrictEqual(this, other) : false;\n }\n\n /**\n * Get string representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toString(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toString(options);\n }\n\n /**\n * Internal function to generate the string output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toString() {\n // must be implemented by each of the Node implementations\n throw new Error('_toString not implemented for ' + this.type);\n }\n\n /**\n * Get a JSON representation of the node\n * Both .toJSON() and the static .fromJSON(json) should be implemented by all\n * implementations of Node\n * @returns {Object}\n */\n toJSON() {\n throw new Error('Cannot serialize object: toJSON not implemented by ' + this.type);\n }\n\n /**\n * Get HTML representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\" or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toHTML(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toHTML(options);\n }\n\n /**\n * Internal function to generate the HTML output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toHTML() {\n // must be implemented by each of the Node implementations\n throw new Error('_toHTML not implemented for ' + this.type);\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toTex(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toTex(options);\n }\n\n /**\n * Internal function to generate the LaTeX output.\n * This has to be implemented by every Node\n *\n * @param {Object} [options]\n * @throws {Error}\n */\n _toTex(options) {\n // must be implemented by each of the Node implementations\n throw new Error('_toTex not implemented for ' + this.type);\n }\n\n /**\n * Helper used by `to...` functions.\n */\n _getCustomString(options) {\n if (options && typeof options === 'object') {\n switch (typeof options.handler) {\n case 'object':\n case 'undefined':\n return;\n case 'function':\n return options.handler(this, options);\n default:\n throw new TypeError('Object or function expected as callback');\n }\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type;\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} node\n **/\n getContent() {\n return this;\n }\n }\n return Node;\n}, {\n isClass: true,\n isNode: true\n});", "// Reserved keywords not allowed to use in the parser\nexport var keywords = new Set(['end']);", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isNode, isObjectNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nvar name = 'AccessorNode';\nvar dependencies = ['subset', 'Node'];\nexport var createAccessorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n\n /**\n * Are parenthesis needed?\n * @private\n */\n function needParenthesis(node) {\n // TODO: maybe make a method on the nodes which tells whether they need parenthesis?\n return !(isAccessorNode(node) || isArrayNode(node) || isConstantNode(node) || isFunctionNode(node) || isObjectNode(node) || isParenthesisNode(node) || isSymbolNode(node));\n }\n class AccessorNode extends Node {\n /**\n * @constructor AccessorNode\n * @extends {Node}\n * Access an object property or get a matrix subset\n *\n * @param {Node} object The object from which to retrieve\n * a property or subset.\n * @param {IndexNode} index IndexNode containing ranges\n */\n constructor(object, index) {\n super();\n if (!isNode(object)) {\n throw new TypeError('Node expected for parameter \"object\"');\n }\n if (!isIndexNode(index)) {\n throw new TypeError('IndexNode expected for parameter \"index\"');\n }\n this.object = object;\n this.index = index;\n }\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAccessorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index._compile(math, argNames);\n if (this.index.isObjectProperty()) {\n var prop = this.index.getObjectProperty();\n return function evalAccessorNode(scope, args, context) {\n // get a property from an object evaluated using the scope.\n return getSafeProperty(evalObject(scope, args, context), prop);\n };\n } else {\n return function evalAccessorNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n // we pass just object here instead of context:\n var index = evalIndex(scope, args, object);\n return access(object, index);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n callback(this.index, 'index', this);\n }\n\n /**\n * Create a new AccessorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AccessorNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new AccessorNode(this._ifNode(callback(this.object, 'object', this)), this._ifNode(callback(this.index, 'index', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AccessorNode}\n */\n clone() {\n return new AccessorNode(this.object, this.index);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n if (needParenthesis(this.object)) {\n object = '(' + object + ')';\n }\n return object + this.index.toString(options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n if (needParenthesis(this.object)) {\n object = '(' + object + ')';\n }\n return object + this.index.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n if (needParenthesis(this.object)) {\n object = '\\\\left(\\' + object + \\'\\\\right)';\n }\n return object + this.index.toTex(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index\n };\n }\n\n /**\n * Instantiate an AccessorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AccessorNode\", object: ..., index: ...}`,\n * where mathjs is optional\n * @returns {AccessorNode}\n */\n static fromJSON(json) {\n return new AccessorNode(json.object, json.index);\n }\n }\n _defineProperty(AccessorNode, \"name\", name);\n return AccessorNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { getSafeProperty } from '../../../utils/customs.js';\nexport function accessFactory(_ref) {\n var {\n subset\n } = _ref;\n /**\n * Retrieve part of an object:\n *\n * - Retrieve a property from an object\n * - Retrieve a part of a string\n * - Retrieve a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @return {Object | Array | Matrix | string} Returns the subset\n */\n return function access(object, index) {\n try {\n if (Array.isArray(object)) {\n return subset(object, index);\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index);\n } else if (typeof object === 'string') {\n // TODO: move getStringSubset into a separate util file, use that\n return subset(object, index);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw new TypeError('Cannot apply a numeric index as object property');\n }\n return getSafeProperty(object, index.getObjectProperty());\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}", "import { IndexError } from '../../../error/IndexError.js';\n\n/**\n * Transform zero-based indices to one-based indices in errors\n * @param {Error} err\n * @returns {Error | IndexError} Returns the transformed error\n */\nexport function errorTransform(err) {\n if (err && err.isIndexError) {\n return new IndexError(err.index + 1, err.min + 1, err.max !== undefined ? err.max + 1 : undefined);\n }\n return err;\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isArrayNode, isNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ArrayNode';\nvar dependencies = ['Node'];\nexport var createArrayNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ArrayNode extends Node {\n /**\n * @constructor ArrayNode\n * @extends {Node}\n * Holds an 1-dimensional array with items\n * @param {Node[]} [items] 1 dimensional array with items\n */\n constructor(items) {\n super();\n this.items = items || [];\n\n // validate input\n if (!Array.isArray(this.items) || !this.items.every(isNode)) {\n throw new TypeError('Array containing Nodes expected');\n }\n }\n get type() {\n return name;\n }\n get isArrayNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalItems = map(this.items, function (item) {\n return item._compile(math, argNames);\n });\n var asMatrix = math.config.matrix !== 'Array';\n if (asMatrix) {\n var matrix = math.matrix;\n return function evalArrayNode(scope, args, context) {\n return matrix(map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n }));\n };\n } else {\n return function evalArrayNode(scope, args, context) {\n return map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n });\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.items.length; i++) {\n var node = this.items[i];\n callback(node, 'items[' + i + ']', this);\n }\n }\n\n /**\n * Create a new ArrayNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ArrayNode} Returns a transformed copy of the node\n */\n map(callback) {\n var items = [];\n for (var i = 0; i < this.items.length; i++) {\n items[i] = this._ifNode(callback(this.items[i], 'items[' + i + ']', this));\n }\n return new ArrayNode(items);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ArrayNode}\n */\n clone() {\n return new ArrayNode(this.items.slice(0));\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var items = this.items.map(function (node) {\n return node.toString(options);\n });\n return '[' + items.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n items: this.items\n };\n }\n\n /**\n * Instantiate an ArrayNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ArrayNode\", items: [...]}`,\n * where mathjs is optional\n * @returns {ArrayNode}\n */\n static fromJSON(json) {\n return new ArrayNode(json.items);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var items = this.items.map(function (node) {\n return node.toHTML(options);\n });\n return '[' + items.join(',') + ']';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n function itemsToTex(items, nested) {\n var mixedItems = items.some(isArrayNode) && !items.every(isArrayNode);\n var itemsFormRow = nested || mixedItems;\n var itemSep = itemsFormRow ? '&' : '\\\\\\\\';\n var itemsTex = items.map(function (node) {\n if (node.items) {\n return itemsToTex(node.items, !nested);\n } else {\n return node.toTex(options);\n }\n }).join(itemSep);\n return mixedItems || !itemsFormRow || itemsFormRow && !nested ? '\\\\begin{bmatrix}' + itemsTex + '\\\\end{bmatrix}' : itemsTex;\n }\n return itemsToTex(this.items, false);\n }\n }\n _defineProperty(ArrayNode, \"name\", name);\n return ArrayNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nimport { assignFactory } from './utils/assign.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'AssignmentNode';\nvar dependencies = ['subset', '?matrix',\n// FIXME: should not be needed at all, should be handled by subset\n'Node'];\nexport var createAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n matrix,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n var assign = assignFactory({\n subset,\n matrix\n });\n\n /*\n * Is parenthesis needed?\n * @param {node} node\n * @param {string} [parenthesis='keep']\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n if (!parenthesis) {\n parenthesis = 'keep';\n }\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.value, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class AssignmentNode extends Node {\n /**\n * @constructor AssignmentNode\n * @extends {Node}\n *\n * Define a symbol, like `a=3.2`, update a property like `a.b=3.2`, or\n * replace a subset of a matrix like `A[2,2]=42`.\n *\n * Syntax:\n *\n * new AssignmentNode(symbol, value)\n * new AssignmentNode(object, index, value)\n *\n * Usage:\n *\n * new AssignmentNode(new SymbolNode('a'), new ConstantNode(2)) // a=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode('b'),\n * new ConstantNode(2)) // a.b=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode(1, 2),\n * new ConstantNode(3)) // a[1,2]=3\n *\n * @param {SymbolNode | AccessorNode} object\n * Object on which to assign a value\n * @param {IndexNode} [index=null]\n * Index, property name or matrix index. Optional. If not provided\n * and `object` is a SymbolNode, the property is assigned to the\n * global scope.\n * @param {Node} value\n * The value to be assigned\n */\n constructor(object, index, value) {\n super();\n this.object = object;\n this.index = value ? index : null;\n this.value = value || index;\n\n // validate input\n if (!isSymbolNode(object) && !isAccessorNode(object)) {\n throw new TypeError('SymbolNode or AccessorNode expected as \"object\"');\n }\n if (isSymbolNode(object) && object.name === 'end') {\n throw new Error('Cannot assign to symbol \"end\"');\n }\n if (this.index && !isIndexNode(this.index)) {\n // index is optional\n throw new TypeError('IndexNode expected as \"index\"');\n }\n if (!isNode(this.value)) {\n throw new TypeError('Node expected as \"value\"');\n }\n }\n\n // class name for typing purposes:\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index ? this.index._compile(math, argNames) : null;\n var evalValue = this.value._compile(math, argNames);\n var name = this.object.name;\n if (!this.index) {\n // apply a variable to the scope, for example `a=2`\n if (!isSymbolNode(this.object)) {\n throw new TypeError('SymbolNode expected as object');\n }\n return function evalAssignmentNode(scope, args, context) {\n var value = evalValue(scope, args, context);\n scope.set(name, value);\n return value;\n };\n } else if (this.index.isObjectProperty()) {\n // apply an object property for example `a.b=2`\n var prop = this.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n setSafeProperty(object, prop, value);\n return value;\n };\n } else if (isSymbolNode(this.object)) {\n // update a matrix subset, for example `a[2]=3`\n return function evalAssignmentNode(scope, args, context) {\n var childObject = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n scope.set(name, assign(childObject, index, value));\n return value;\n };\n } else {\n // isAccessorNode(node.object) === true\n // update a matrix subset, for example `a.b[2]=3`\n\n // we will not use the compile function of the AccessorNode, but\n // compile it ourselves here as we need the parent object of the\n // AccessorNode:\n // wee need to apply the updated object to parent object\n var evalParentObject = this.object.object._compile(math, argNames);\n if (this.object.index.isObjectProperty()) {\n var parentProp = this.object.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n var childObject = getSafeProperty(parent, parentProp);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n setSafeProperty(parent, parentProp, assign(childObject, index, value));\n return value;\n };\n } else {\n // if some parameters use the 'end' parameter, we need to calculate\n // the size\n var evalParentIndex = this.object.index._compile(math, argNames);\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n // Important: we pass parent instead of context:\n var parentIndex = evalParentIndex(scope, args, parent);\n var childObject = access(parent, parentIndex);\n // Important: we pass childObject instead of context\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n assign(parent, parentIndex, assign(childObject, index, value));\n return value;\n };\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n if (this.index) {\n callback(this.index, 'index', this);\n }\n callback(this.value, 'value', this);\n }\n\n /**\n * Create a new AssignmentNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var object = this._ifNode(callback(this.object, 'object', this));\n var index = this.index ? this._ifNode(callback(this.index, 'index', this)) : null;\n var value = this._ifNode(callback(this.value, 'value', this));\n return new AssignmentNode(object, index, value);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AssignmentNode}\n */\n clone() {\n return new AssignmentNode(this.object, this.index, this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n var index = this.index ? this.index.toString(options) : '';\n var value = this.value.toString(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '(' + value + ')';\n }\n return object + index + ' = ' + value;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index,\n value: this.value\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AssignmentNode\", object: ..., index: ..., value: ...}`,\n * where mathjs is optional\n * @returns {AssignmentNode}\n */\n static fromJSON(json) {\n return new AssignmentNode(json.object, json.index, json.value);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n var index = this.index ? this.index.toHTML(options) : '';\n var value = this.value.toHTML(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '(' + value + ')';\n }\n return object + index + '=' + value;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n var index = this.index ? this.index.toTex(options) : '';\n var value = this.value.toTex(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = \"\\\\left(\".concat(value, \"\\\\right)\");\n }\n return object + index + '=' + value;\n }\n }\n _defineProperty(AssignmentNode, \"name\", name);\n return AssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { setSafeProperty } from '../../../utils/customs.js';\nexport function assignFactory(_ref) {\n var {\n subset,\n matrix\n } = _ref;\n /**\n * Replace part of an object:\n *\n * - Assign a property to an object\n * - Replace a part of a string\n * - Replace a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @param {*} value\n * @return {Object | Array | Matrix | string} Returns the original object\n * except in case of a string\n */\n // TODO: change assign to return the value instead of the object\n return function assign(object, index, value) {\n try {\n if (Array.isArray(object)) {\n var result = matrix(object).subset(index, value).valueOf();\n\n // shallow copy all (updated) items into the original array\n result.forEach((item, index) => {\n object[index] = item;\n });\n return object;\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index, value);\n } else if (typeof object === 'string') {\n // TODO: move setStringSubset into a separate util file, use that\n return subset(object, index, value);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw TypeError('Cannot apply a numeric index as object property');\n }\n setSafeProperty(object, index.getObjectProperty(), value);\n return object;\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}", "// list of identifiers of nodes in order of their precedence\n// also contains information about left/right associativity\n// and which other operator the operator is associative with\n// Example:\n// addition is associative with addition and subtraction, because:\n// (a+b)+c=a+(b+c)\n// (a+b)-c=a+(b-c)\n//\n// postfix operators are left associative, prefix operators\n// are right associative\n//\n// It's also possible to set the following properties:\n// latexParens: if set to false, this node doesn't need to be enclosed\n// in parentheses when using LaTeX\n// latexLeftParens: if set to false, this !OperatorNode's!\n// left argument doesn't need to be enclosed\n// in parentheses\n// latexRightParens: the same for the right argument\nimport { hasOwnProperty } from '../utils/object.js';\nimport { isConstantNode, isParenthesisNode, rule2Node } from '../utils/is.js';\nexport var properties = [{\n // assignment\n AssignmentNode: {},\n FunctionAssignmentNode: {}\n}, {\n // conditional expression\n ConditionalNode: {\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // conditionals don't need parentheses in LaTeX because\n // they are 2 dimensional\n }\n}, {\n // logical or\n 'OperatorNode:or': {\n op: 'or',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical xor\n 'OperatorNode:xor': {\n op: 'xor',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical and\n 'OperatorNode:and': {\n op: 'and',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise or\n 'OperatorNode:bitOr': {\n op: '|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise xor\n 'OperatorNode:bitXor': {\n op: '^|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise and\n 'OperatorNode:bitAnd': {\n op: '&',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // relational operators\n 'OperatorNode:equal': {\n op: '==',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:unequal': {\n op: '!=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smaller': {\n op: '<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:larger': {\n op: '>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smallerEq': {\n op: '<=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:largerEq': {\n op: '>=',\n associativity: 'left',\n associativeWith: []\n },\n RelationalNode: {\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitshift operators\n 'OperatorNode:leftShift': {\n op: '<<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightArithShift': {\n op: '>>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightLogShift': {\n op: '>>>',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // unit conversion\n 'OperatorNode:to': {\n op: 'to',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // range\n RangeNode: {}\n}, {\n // addition, subtraction\n 'OperatorNode:add': {\n op: '+',\n associativity: 'left',\n associativeWith: ['OperatorNode:add', 'OperatorNode:subtract']\n },\n 'OperatorNode:subtract': {\n op: '-',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // multiply, divide, modulus\n 'OperatorNode:multiply': {\n op: '*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n },\n 'OperatorNode:divide': {\n op: '/',\n associativity: 'left',\n associativeWith: [],\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // fractions don't require parentheses because\n // they're 2 dimensional, so parens aren't needed\n // in LaTeX\n },\n 'OperatorNode:dotMultiply': {\n op: '.*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'OperatorNode:dotMultiply', 'OperatorNode:doDivide']\n },\n 'OperatorNode:dotDivide': {\n op: './',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:mod': {\n op: 'mod',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // Repeat multiplication for implicit multiplication\n 'OperatorNode:multiply': {\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n }\n}, {\n // unary prefix operators\n 'OperatorNode:unaryPlus': {\n op: '+',\n associativity: 'right'\n },\n 'OperatorNode:unaryMinus': {\n op: '-',\n associativity: 'right'\n },\n 'OperatorNode:bitNot': {\n op: '~',\n associativity: 'right'\n },\n 'OperatorNode:not': {\n op: 'not',\n associativity: 'right'\n }\n}, {\n // exponentiation\n 'OperatorNode:pow': {\n op: '^',\n associativity: 'right',\n associativeWith: [],\n latexRightParens: false\n // the exponent doesn't need parentheses in\n // LaTeX because it's 2 dimensional\n // (it's on top)\n },\n 'OperatorNode:dotPow': {\n op: '.^',\n associativity: 'right',\n associativeWith: []\n }\n}, {\n // factorial\n 'OperatorNode:factorial': {\n op: '!',\n associativity: 'left'\n }\n}, {\n // matrix transpose\n 'OperatorNode:ctranspose': {\n op: \"'\",\n associativity: 'left'\n }\n}];\n\n/**\n * Returns the first non-parenthesis internal node, but only\n * when the 'parenthesis' option is unset or auto.\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {Node}\n */\nfunction unwrapParen(_node, parenthesis) {\n if (!parenthesis || parenthesis !== 'auto') return _node;\n var node = _node;\n while (isParenthesisNode(node)) node = node.content;\n return node;\n}\n\n/**\n * Get the precedence of a Node.\n * Higher number for higher precedence, starting with 0.\n * Returns null if the precedence is undefined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @param {string} implicit\n * @param {Node} parent (for determining context for implicit multiplication)\n * @return {number | null}\n */\nexport function getPrecedence(_node, parenthesis, implicit, parent) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var precedence = null;\n for (var i = 0; i < properties.length; i++) {\n if (identifier in properties[i]) {\n precedence = i;\n break;\n }\n }\n // Bump up precedence of implicit multiplication, except when preceded\n // by a \"Rule 2\" fraction ( [unaryOp]constant / constant )\n if (identifier === 'OperatorNode:multiply' && node.implicit && implicit !== 'show') {\n var leftArg = unwrapParen(node.args[0], parenthesis);\n if (!(isConstantNode(leftArg) && parent && parent.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(parent.args[0], parenthesis))) && !(leftArg.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(leftArg.args[0], parenthesis)) && isConstantNode(unwrapParen(leftArg.args[1])))) {\n precedence += 1;\n }\n }\n return precedence;\n}\n\n/**\n * Get the associativity of an operator (left or right).\n * Returns a string containing 'left' or 'right' or null if\n * the associativity is not defined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {string|null}\n * @throws {Error}\n */\nexport function getAssociativity(_node, parenthesis) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var index = getPrecedence(node, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifier];\n if (hasOwnProperty(property, 'associativity')) {\n if (property.associativity === 'left') {\n return 'left';\n }\n if (property.associativity === 'right') {\n return 'right';\n }\n // associativity is invalid\n throw Error('\\'' + identifier + '\\' has the invalid associativity \\'' + property.associativity + '\\'.');\n }\n\n // associativity is undefined\n return null;\n}\n\n/**\n * Check if an operator is associative with another operator.\n * Returns either true or false or null if not defined.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @param {string} parenthesis\n * @return {boolean | null}\n */\nexport function isAssociativeWith(nodeA, nodeB, parenthesis) {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n var a = parenthesis !== 'keep' ? nodeA.getContent() : nodeA;\n var b = parenthesis !== 'keep' ? nodeA.getContent() : nodeB;\n var identifierA = a.getIdentifier();\n var identifierB = b.getIdentifier();\n var index = getPrecedence(a, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifierA];\n if (hasOwnProperty(property, 'associativeWith') && property.associativeWith instanceof Array) {\n for (var i = 0; i < property.associativeWith.length; i++) {\n if (property.associativeWith[i] === identifierB) {\n return true;\n }\n }\n return false;\n }\n\n // associativeWith is not defined\n return null;\n}\n\n/**\n * Get the operator associated with a function name.\n * Returns a string with the operator symbol, or null if the\n * input is not the name of a function associated with an\n * operator.\n *\n * @param {string} Function name\n * @return {string | null} Associated operator symbol, if any\n */\nexport function getOperator(fn) {\n var identifier = 'OperatorNode:' + fn;\n for (var group of properties) {\n if (identifier in group) {\n return group[identifier].op;\n }\n }\n return null;\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { forEach, map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'BlockNode';\nvar dependencies = ['ResultSet', 'Node'];\nexport var createBlockNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n ResultSet,\n Node\n } = _ref;\n class BlockNode extends Node {\n /**\n * @constructor BlockNode\n * @extends {Node}\n * Holds a set with blocks\n * @param {Array.<{node: Node} | {node: Node, visible: boolean}>} blocks\n * An array with blocks, where a block is constructed as an\n * Object with properties block, which is a Node, and visible,\n * which is a boolean. The property visible is optional and\n * is true by default\n */\n constructor(blocks) {\n super();\n // validate input, copy blocks\n if (!Array.isArray(blocks)) throw new Error('Array expected');\n this.blocks = blocks.map(function (block) {\n var node = block && block.node;\n var visible = block && block.visible !== undefined ? block.visible : true;\n if (!isNode(node)) throw new TypeError('Property \"node\" must be a Node');\n if (typeof visible !== 'boolean') {\n throw new TypeError('Property \"visible\" must be a boolean');\n }\n return {\n node,\n visible\n };\n });\n }\n get type() {\n return name;\n }\n get isBlockNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalBlocks = map(this.blocks, function (block) {\n return {\n evaluate: block.node._compile(math, argNames),\n visible: block.visible\n };\n });\n return function evalBlockNodes(scope, args, context) {\n var results = [];\n forEach(evalBlocks, function evalBlockNode(block) {\n var result = block.evaluate(scope, args, context);\n if (block.visible) {\n results.push(result);\n }\n });\n return new ResultSet(results);\n };\n }\n\n /**\n * Execute a callback for each of the child blocks of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.blocks.length; i++) {\n callback(this.blocks[i].node, 'blocks[' + i + '].node', this);\n }\n }\n\n /**\n * Create a new BlockNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {BlockNode} Returns a transformed copy of the node\n */\n map(callback) {\n var blocks = [];\n for (var i = 0; i < this.blocks.length; i++) {\n var block = this.blocks[i];\n var node = this._ifNode(callback(block.node, 'blocks[' + i + '].node', this));\n blocks[i] = {\n node,\n visible: block.visible\n };\n }\n return new BlockNode(blocks);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {BlockNode}\n */\n clone() {\n var blocks = this.blocks.map(function (block) {\n return {\n node: block.node,\n visible: block.visible\n };\n });\n return new BlockNode(blocks);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.blocks.map(function (param) {\n return param.node.toString(options) + (param.visible ? '' : ';');\n }).join('\\n');\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n blocks: this.blocks\n };\n }\n\n /**\n * Instantiate an BlockNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"BlockNode\", blocks: [{node: ..., visible: false}, ...]}`,\n * where mathjs is optional\n * @returns {BlockNode}\n */\n static fromJSON(json) {\n return new BlockNode(json.blocks);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n return this.blocks.map(function (param) {\n return param.node.toHTML(options) + (param.visible ? '' : ';');\n }).join('
    ');\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return this.blocks.map(function (param) {\n return param.node.toTex(options) + (param.visible ? '' : ';');\n }).join('\\\\;\\\\;\\n');\n }\n }\n _defineProperty(BlockNode, \"name\", name);\n return BlockNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isBigNumber, isComplex, isNode, isUnit, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'ConditionalNode';\nvar dependencies = ['Node'];\nexport var createConditionalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Test whether a condition is met\n * @param {*} condition\n * @returns {boolean} true if condition is true or non-zero, else false\n */\n function testCondition(condition) {\n if (typeof condition === 'number' || typeof condition === 'boolean' || typeof condition === 'string') {\n return !!condition;\n }\n if (condition) {\n if (isBigNumber(condition)) {\n return !condition.isZero();\n }\n if (isComplex(condition)) {\n return !!(condition.re || condition.im);\n }\n if (isUnit(condition)) {\n return !!condition.value;\n }\n }\n if (condition === null || condition === undefined) {\n return false;\n }\n throw new TypeError('Unsupported type of condition \"' + typeOf(condition) + '\"');\n }\n class ConditionalNode extends Node {\n /**\n * A lazy evaluating conditional operator: 'condition ? trueExpr : falseExpr'\n *\n * @param {Node} condition Condition, must result in a boolean\n * @param {Node} trueExpr Expression evaluated when condition is true\n * @param {Node} falseExpr Expression evaluated when condition is true\n *\n * @constructor ConditionalNode\n * @extends {Node}\n */\n constructor(condition, trueExpr, falseExpr) {\n super();\n if (!isNode(condition)) {\n throw new TypeError('Parameter condition must be a Node');\n }\n if (!isNode(trueExpr)) {\n throw new TypeError('Parameter trueExpr must be a Node');\n }\n if (!isNode(falseExpr)) {\n throw new TypeError('Parameter falseExpr must be a Node');\n }\n this.condition = condition;\n this.trueExpr = trueExpr;\n this.falseExpr = falseExpr;\n }\n get type() {\n return name;\n }\n get isConditionalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalCondition = this.condition._compile(math, argNames);\n var evalTrueExpr = this.trueExpr._compile(math, argNames);\n var evalFalseExpr = this.falseExpr._compile(math, argNames);\n return function evalConditionalNode(scope, args, context) {\n return testCondition(evalCondition(scope, args, context)) ? evalTrueExpr(scope, args, context) : evalFalseExpr(scope, args, context);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.condition, 'condition', this);\n callback(this.trueExpr, 'trueExpr', this);\n callback(this.falseExpr, 'falseExpr', this);\n }\n\n /**\n * Create a new ConditionalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ConditionalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new ConditionalNode(this._ifNode(callback(this.condition, 'condition', this)), this._ifNode(callback(this.trueExpr, 'trueExpr', this)), this._ifNode(callback(this.falseExpr, 'falseExpr', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConditionalNode}\n */\n clone() {\n return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toString(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '(' + condition + ')';\n }\n var trueExpr = this.trueExpr.toString(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '(' + trueExpr + ')';\n }\n var falseExpr = this.falseExpr.toString(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '(' + falseExpr + ')';\n }\n return condition + ' ? ' + trueExpr + ' : ' + falseExpr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n condition: this.condition,\n trueExpr: this.trueExpr,\n falseExpr: this.falseExpr\n };\n }\n\n /**\n * Instantiate an ConditionalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"ConditionalNode\",\n * \"condition\": ...,\n * \"trueExpr\": ...,\n * \"falseExpr\": ...}\n * ```\n * where mathjs is optional\n * @returns {ConditionalNode}\n */\n static fromJSON(json) {\n return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toHTML(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '(' + condition + ')';\n }\n var trueExpr = this.trueExpr.toHTML(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '(' + trueExpr + ')';\n }\n var falseExpr = this.falseExpr.toHTML(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '(' + falseExpr + ')';\n }\n return condition + '?' + trueExpr + ':' + falseExpr;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return '\\\\begin{cases} {' + this.trueExpr.toTex(options) + '}, &\\\\quad{\\\\text{if }\\\\;' + this.condition.toTex(options) + '}\\\\\\\\{' + this.falseExpr.toTex(options) + '}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}';\n }\n }\n _defineProperty(ConditionalNode, \"name\", name);\n return ConditionalNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { format } from '../../utils/string.js';\nimport { typeOf } from '../../utils/is.js';\nimport { escapeLatex } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ConstantNode';\nvar dependencies = ['Node'];\nexport var createConstantNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ConstantNode extends Node {\n /**\n * A ConstantNode holds a constant value like a number or string.\n *\n * Usage:\n *\n * new ConstantNode(2.3)\n * new ConstantNode('hello')\n *\n * @param {*} value Value can be any type (number, BigNumber, bigint, string, ...)\n * @constructor ConstantNode\n * @extends {Node}\n */\n constructor(value) {\n super();\n this.value = value;\n }\n get type() {\n return name;\n }\n get isConstantNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var value = this.value;\n return function evalConstantNode() {\n return value;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new ConstantNode with children produced by the given callback.\n * Trivial because there are no children.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ConstantNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConstantNode}\n */\n clone() {\n return new ConstantNode(this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n return format(this.value, options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var value = this._toString(options);\n switch (typeOf(this.value)) {\n case 'number':\n case 'bigint':\n case 'BigNumber':\n case 'Fraction':\n return '' + value + '';\n case 'string':\n return '' + value + '';\n case 'boolean':\n return '' + value + '';\n case 'null':\n return '' + value + '';\n case 'undefined':\n return '' + value + '';\n default:\n return '' + value + '';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n value: this.value\n };\n }\n\n /**\n * Instantiate a ConstantNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", value: 2.3}`,\n * where mathjs is optional\n * @returns {ConstantNode}\n */\n static fromJSON(json) {\n return new ConstantNode(json.value);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var value = this._toString(options);\n var type = typeOf(this.value);\n switch (type) {\n case 'string':\n return '\\\\mathtt{' + escapeLatex(value) + '}';\n case 'number':\n case 'BigNumber':\n {\n var finite = type === 'BigNumber' ? this.value.isFinite() : isFinite(this.value);\n if (!finite) {\n return this.value.valueOf() < 0 ? '-\\\\infty' : '\\\\infty';\n }\n var index = value.toLowerCase().indexOf('e');\n if (index !== -1) {\n return value.substring(0, index) + '\\\\cdot10^{' + value.substring(index + 1) + '}';\n }\n return value;\n }\n case 'bigint':\n {\n return value.toString();\n }\n case 'Fraction':\n return this.value.toLatex();\n default:\n return value;\n }\n }\n }\n _defineProperty(ConstantNode, \"name\", name);\n return ConstantNode;\n}, {\n isClass: true,\n isNode: true\n});", "/* eslint no-template-curly-in-string: \"off\" */\n\nimport escapeLatexLib from 'escape-latex';\nimport { hasOwnProperty } from './object.js';\nexport var latexSymbols = {\n // GREEK LETTERS\n Alpha: 'A',\n alpha: '\\\\alpha',\n Beta: 'B',\n beta: '\\\\beta',\n Gamma: '\\\\Gamma',\n gamma: '\\\\gamma',\n Delta: '\\\\Delta',\n delta: '\\\\delta',\n Epsilon: 'E',\n epsilon: '\\\\epsilon',\n varepsilon: '\\\\varepsilon',\n Zeta: 'Z',\n zeta: '\\\\zeta',\n Eta: 'H',\n eta: '\\\\eta',\n Theta: '\\\\Theta',\n theta: '\\\\theta',\n vartheta: '\\\\vartheta',\n Iota: 'I',\n iota: '\\\\iota',\n Kappa: 'K',\n kappa: '\\\\kappa',\n varkappa: '\\\\varkappa',\n Lambda: '\\\\Lambda',\n lambda: '\\\\lambda',\n Mu: 'M',\n mu: '\\\\mu',\n Nu: 'N',\n nu: '\\\\nu',\n Xi: '\\\\Xi',\n xi: '\\\\xi',\n Omicron: 'O',\n omicron: 'o',\n Pi: '\\\\Pi',\n pi: '\\\\pi',\n varpi: '\\\\varpi',\n Rho: 'P',\n rho: '\\\\rho',\n varrho: '\\\\varrho',\n Sigma: '\\\\Sigma',\n sigma: '\\\\sigma',\n varsigma: '\\\\varsigma',\n Tau: 'T',\n tau: '\\\\tau',\n Upsilon: '\\\\Upsilon',\n upsilon: '\\\\upsilon',\n Phi: '\\\\Phi',\n phi: '\\\\phi',\n varphi: '\\\\varphi',\n Chi: 'X',\n chi: '\\\\chi',\n Psi: '\\\\Psi',\n psi: '\\\\psi',\n Omega: '\\\\Omega',\n omega: '\\\\omega',\n // logic\n true: '\\\\mathrm{True}',\n false: '\\\\mathrm{False}',\n // other\n i: 'i',\n // TODO use \\i ??\n inf: '\\\\infty',\n Inf: '\\\\infty',\n infinity: '\\\\infty',\n Infinity: '\\\\infty',\n oo: '\\\\infty',\n lim: '\\\\lim',\n undefined: '\\\\mathbf{?}'\n};\nexport var latexOperators = {\n transpose: '^\\\\top',\n ctranspose: '^H',\n factorial: '!',\n pow: '^',\n dotPow: '.^\\\\wedge',\n // TODO find ideal solution\n unaryPlus: '+',\n unaryMinus: '-',\n bitNot: '\\\\~',\n // TODO find ideal solution\n not: '\\\\neg',\n multiply: '\\\\cdot',\n divide: '\\\\frac',\n // TODO how to handle that properly?\n dotMultiply: '.\\\\cdot',\n // TODO find ideal solution\n dotDivide: '.:',\n // TODO find ideal solution\n mod: '\\\\mod',\n add: '+',\n subtract: '-',\n to: '\\\\rightarrow',\n leftShift: '<<',\n rightArithShift: '>>',\n rightLogShift: '>>>',\n equal: '=',\n unequal: '\\\\neq',\n smaller: '<',\n larger: '>',\n smallerEq: '\\\\leq',\n largerEq: '\\\\geq',\n bitAnd: '\\\\&',\n bitXor: '\\\\underline{|}',\n bitOr: '|',\n and: '\\\\wedge',\n xor: '\\\\veebar',\n or: '\\\\vee'\n};\nexport var latexFunctions = {\n // arithmetic\n abs: {\n 1: '\\\\left|${args[0]}\\\\right|'\n },\n add: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.add, \"${args[1]}\\\\right)\")\n },\n cbrt: {\n 1: '\\\\sqrt[3]{${args[0]}}'\n },\n ceil: {\n 1: '\\\\left\\\\lceil${args[0]}\\\\right\\\\rceil'\n },\n cube: {\n 1: '\\\\left(${args[0]}\\\\right)^3'\n },\n divide: {\n 2: '\\\\frac{${args[0]}}{${args[1]}}'\n },\n dotDivide: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotDivide, \"${args[1]}\\\\right)\")\n },\n dotMultiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotMultiply, \"${args[1]}\\\\right)\")\n },\n dotPow: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotPow, \"${args[1]}\\\\right)\")\n },\n exp: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n expm1: \"\\\\left(e\".concat(latexOperators.pow, \"{${args[0]}}-1\\\\right)\"),\n fix: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n floor: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rfloor'\n },\n gcd: '\\\\gcd\\\\left(${args}\\\\right)',\n hypot: '\\\\hypot\\\\left(${args}\\\\right)',\n log: {\n 1: '\\\\ln\\\\left(${args[0]}\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}\\\\right)'\n },\n log10: {\n 1: '\\\\log_{10}\\\\left(${args[0]}\\\\right)'\n },\n log1p: {\n 1: '\\\\ln\\\\left(${args[0]}+1\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}+1\\\\right)'\n },\n log2: '\\\\log_{2}\\\\left(${args[0]}\\\\right)',\n mod: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.mod, \"${args[1]}\\\\right)\")\n },\n multiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.multiply, \"${args[1]}\\\\right)\")\n },\n norm: {\n 1: '\\\\left\\\\|${args[0]}\\\\right\\\\|',\n 2: undefined // use default template\n },\n nthRoot: {\n 2: '\\\\sqrt[${args[1]}]{${args[0]}}'\n },\n nthRoots: {\n 2: '\\\\{y : $y^{args[1]} = {${args[0]}}\\\\}'\n },\n pow: {\n 2: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.pow, \"{${args[1]}}\")\n },\n round: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rceil',\n 2: undefined // use default template\n },\n sign: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n sqrt: {\n 1: '\\\\sqrt{${args[0]}}'\n },\n square: {\n 1: '\\\\left(${args[0]}\\\\right)^2'\n },\n subtract: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.subtract, \"${args[1]}\\\\right)\")\n },\n unaryMinus: {\n 1: \"\".concat(latexOperators.unaryMinus, \"\\\\left(${args[0]}\\\\right)\")\n },\n unaryPlus: {\n 1: \"\".concat(latexOperators.unaryPlus, \"\\\\left(${args[0]}\\\\right)\")\n },\n // bitwise\n bitAnd: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitAnd, \"${args[1]}\\\\right)\")\n },\n bitNot: {\n 1: latexOperators.bitNot + '\\\\left(${args[0]}\\\\right)'\n },\n bitOr: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitOr, \"${args[1]}\\\\right)\")\n },\n bitXor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitXor, \"${args[1]}\\\\right)\")\n },\n leftShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.leftShift, \"${args[1]}\\\\right)\")\n },\n rightArithShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightArithShift, \"${args[1]}\\\\right)\")\n },\n rightLogShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightLogShift, \"${args[1]}\\\\right)\")\n },\n // combinatorics\n bellNumbers: {\n 1: '\\\\mathrm{B}_{${args[0]}}'\n },\n catalan: {\n 1: '\\\\mathrm{C}_{${args[0]}}'\n },\n stirlingS2: {\n 2: '\\\\mathrm{S}\\\\left(${args}\\\\right)'\n },\n // complex\n arg: {\n 1: '\\\\arg\\\\left(${args[0]}\\\\right)'\n },\n conj: {\n 1: '\\\\left(${args[0]}\\\\right)^*'\n },\n im: {\n 1: '\\\\Im\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n re: {\n 1: '\\\\Re\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n // logical\n and: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.and, \"${args[1]}\\\\right)\")\n },\n not: {\n 1: latexOperators.not + '\\\\left(${args[0]}\\\\right)'\n },\n or: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.or, \"${args[1]}\\\\right)\")\n },\n xor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.xor, \"${args[1]}\\\\right)\")\n },\n // matrix\n cross: {\n 2: '\\\\left(${args[0]}\\\\right)\\\\times\\\\left(${args[1]}\\\\right)'\n },\n ctranspose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.ctranspose)\n },\n det: {\n 1: '\\\\det\\\\left(${args[0]}\\\\right)'\n },\n dot: {\n 2: '\\\\left(${args[0]}\\\\cdot${args[1]}\\\\right)'\n },\n expm: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n inv: {\n 1: '\\\\left(${args[0]}\\\\right)^{-1}'\n },\n pinv: {\n 1: '\\\\left(${args[0]}\\\\right)^{+}'\n },\n sqrtm: {\n 1: \"{${args[0]}}\".concat(latexOperators.pow, \"{\\\\frac{1}{2}}\")\n },\n trace: {\n 1: '\\\\mathrm{tr}\\\\left(${args[0]}\\\\right)'\n },\n transpose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.transpose)\n },\n // probability\n combinations: {\n 2: '\\\\binom{${args[0]}}{${args[1]}}'\n },\n combinationsWithRep: {\n 2: '\\\\left(\\\\!\\\\!{\\\\binom{${args[0]}}{${args[1]}}}\\\\!\\\\!\\\\right)'\n },\n factorial: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.factorial)\n },\n gamma: {\n 1: '\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n lgamma: {\n 1: '\\\\ln\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n // relational\n equal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.equal, \"${args[1]}\\\\right)\")\n },\n larger: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.larger, \"${args[1]}\\\\right)\")\n },\n largerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.largerEq, \"${args[1]}\\\\right)\")\n },\n smaller: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smaller, \"${args[1]}\\\\right)\")\n },\n smallerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smallerEq, \"${args[1]}\\\\right)\")\n },\n unequal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.unequal, \"${args[1]}\\\\right)\")\n },\n // special\n erf: {\n 1: 'erf\\\\left(${args[0]}\\\\right)'\n },\n // statistics\n max: '\\\\max\\\\left(${args}\\\\right)',\n min: '\\\\min\\\\left(${args}\\\\right)',\n variance: '\\\\mathrm{Var}\\\\left(${args}\\\\right)',\n // trigonometry\n acos: {\n 1: '\\\\cos^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acosh: {\n 1: '\\\\cosh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acot: {\n 1: '\\\\cot^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acoth: {\n 1: '\\\\coth^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsc: {\n 1: '\\\\csc^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsch: {\n 1: '\\\\mathrm{csch}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asec: {\n 1: '\\\\sec^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asech: {\n 1: '\\\\mathrm{sech}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asin: {\n 1: '\\\\sin^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asinh: {\n 1: '\\\\sinh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan: {\n 1: '\\\\tan^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan2: {\n 2: '\\\\mathrm{atan2}\\\\left(${args}\\\\right)'\n },\n atanh: {\n 1: '\\\\tanh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n cos: {\n 1: '\\\\cos\\\\left(${args[0]}\\\\right)'\n },\n cosh: {\n 1: '\\\\cosh\\\\left(${args[0]}\\\\right)'\n },\n cot: {\n 1: '\\\\cot\\\\left(${args[0]}\\\\right)'\n },\n coth: {\n 1: '\\\\coth\\\\left(${args[0]}\\\\right)'\n },\n csc: {\n 1: '\\\\csc\\\\left(${args[0]}\\\\right)'\n },\n csch: {\n 1: '\\\\mathrm{csch}\\\\left(${args[0]}\\\\right)'\n },\n sec: {\n 1: '\\\\sec\\\\left(${args[0]}\\\\right)'\n },\n sech: {\n 1: '\\\\mathrm{sech}\\\\left(${args[0]}\\\\right)'\n },\n sin: {\n 1: '\\\\sin\\\\left(${args[0]}\\\\right)'\n },\n sinh: {\n 1: '\\\\sinh\\\\left(${args[0]}\\\\right)'\n },\n tan: {\n 1: '\\\\tan\\\\left(${args[0]}\\\\right)'\n },\n tanh: {\n 1: '\\\\tanh\\\\left(${args[0]}\\\\right)'\n },\n // unit\n to: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.to, \"${args[1]}\\\\right)\")\n },\n // utils\n numeric: function numeric(node, options) {\n // Not sure if this is strictly right but should work correctly for the vast majority of use cases.\n return node.args[0].toTex();\n },\n // type\n number: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n },\n string: {\n 0: '\\\\mathtt{\"\"}',\n 1: '\\\\mathrm{string}\\\\left(${args[0]}\\\\right)'\n },\n bignumber: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n bigint: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n complex: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: \"\\\\left(\\\\left(${args[0]}\\\\right)+\".concat(latexSymbols.i, \"\\\\cdot\\\\left(${args[1]}\\\\right)\\\\right)\")\n },\n matrix: {\n 0: '\\\\begin{bmatrix}\\\\end{bmatrix}',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(${args[0]}\\\\right)'\n },\n sparse: {\n 0: '\\\\begin{bsparse}\\\\end{bsparse}',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n unit: {\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n }\n};\nexport var defaultTemplate = '\\\\mathrm{${name}}\\\\left(${args}\\\\right)';\nvar latexUnits = {\n deg: '^\\\\circ'\n};\nexport function escapeLatex(string) {\n return escapeLatexLib(string, {\n preserveFormatting: true\n });\n}\n\n// @param {string} name\n// @param {boolean} isUnit\nexport function toSymbol(name, isUnit) {\n isUnit = typeof isUnit === 'undefined' ? false : isUnit;\n if (isUnit) {\n if (hasOwnProperty(latexUnits, name)) {\n return latexUnits[name];\n }\n return '\\\\mathrm{' + escapeLatex(name) + '}';\n }\n if (hasOwnProperty(latexSymbols, name)) {\n return latexSymbols[name];\n }\n return escapeLatex(name);\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { escape } from '../../utils/string.js';\nimport { forEach, join } from '../../utils/array.js';\nimport { toSymbol } from '../../utils/latex.js';\nimport { getPrecedence } from '../operators.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'FunctionAssignmentNode';\nvar dependencies = ['typed', 'Node'];\nexport var createFunctionAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Node\n } = _ref;\n /**\n * Is parenthesis needed?\n * @param {Node} node\n * @param {Object} parenthesis\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.expr, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class FunctionAssignmentNode extends Node {\n /**\n * @constructor FunctionAssignmentNode\n * @extends {Node}\n * Function assignment\n *\n * @param {string} name Function name\n * @param {string[] | Array.<{name: string, type: string}>} params\n * Array with function parameter names, or an\n * array with objects containing the name\n * and type of the parameter\n * @param {Node} expr The function expression\n */\n constructor(name, params, expr) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Array containing strings or objects expected for parameter \"params\"');\n }\n if (!isNode(expr)) {\n throw new TypeError('Node expected for parameter \"expr\"');\n }\n if (keywords.has(name)) {\n throw new Error('Illegal function name, \"' + name + '\" is a reserved keyword');\n }\n var paramNames = new Set();\n for (var param of params) {\n var _name = typeof param === 'string' ? param : param.name;\n if (paramNames.has(_name)) {\n throw new Error(\"Duplicate parameter name \\\"\".concat(_name, \"\\\"\"));\n } else {\n paramNames.add(_name);\n }\n }\n this.name = name;\n this.params = params.map(function (param) {\n return param && param.name || param;\n });\n this.types = params.map(function (param) {\n return param && param.type || 'any';\n });\n this.expr = expr;\n }\n get type() {\n return name;\n }\n get isFunctionAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var childArgNames = Object.create(argNames);\n forEach(this.params, function (param) {\n childArgNames[param] = true;\n });\n\n // compile the function expression with the child args\n var evalExpr = this.expr._compile(math, childArgNames);\n var name = this.name;\n var params = this.params;\n var signature = join(this.types, ',');\n var syntax = name + '(' + join(this.params, ', ') + ')';\n return function evalFunctionAssignmentNode(scope, args, context) {\n var signatures = {};\n signatures[signature] = function () {\n var childArgs = Object.create(args);\n for (var i = 0; i < params.length; i++) {\n childArgs[params[i]] = arguments[i];\n }\n return evalExpr(scope, childArgs, context);\n };\n var fn = typed(name, signatures);\n fn.syntax = syntax;\n scope.set(name, fn);\n return fn;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.expr, 'expr', this);\n }\n\n /**\n * Create a new FunctionAssignmentNode whose children are the results of\n * calling the provided callback function for each child of the original\n * node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionAssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var expr = this._ifNode(callback(this.expr, 'expr', this));\n return new FunctionAssignmentNode(this.name, this.params.slice(0), expr);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionAssignmentNode}\n */\n clone() {\n return new FunctionAssignmentNode(this.name, this.params.slice(0), this.expr);\n }\n\n /**\n * get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toString(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')';\n }\n return this.name + '(' + this.params.join(', ') + ') = ' + expr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n var types = this.types;\n return {\n mathjs: name,\n name: this.name,\n params: this.params.map(function (param, index) {\n return {\n name: param,\n type: types[index]\n };\n }),\n expr: this.expr\n };\n }\n\n /**\n * Instantiate an FunctionAssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"FunctionAssignmentNode\",\n * name: ..., params: ..., expr: ...}\n * ```\n * where mathjs is optional\n * @returns {FunctionAssignmentNode}\n */\n static fromJSON(json) {\n return new FunctionAssignmentNode(json.name, json.params, json.expr);\n }\n\n /**\n * get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var params = [];\n for (var i = 0; i < this.params.length; i++) {\n params.push('' + escape(this.params[i]) + '');\n }\n var expr = this.expr.toHTML(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')';\n }\n return '' + escape(this.name) + '' + '(' + params.join(',') + ')' + '=' + expr;\n }\n\n /**\n * get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toTex(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = \"\\\\left(\".concat(expr, \"\\\\right)\");\n }\n return '\\\\mathrm{' + this.name + '}\\\\left(' + this.params.map(toSymbol).join(',') + '\\\\right)=' + expr;\n }\n }\n _defineProperty(FunctionAssignmentNode, \"name\", name);\n return FunctionAssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { map } from '../../utils/array.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isArray, isConstantNode, isMatrix, isNode, isString, typeOf } from '../../utils/is.js';\nimport { escape } from '../../utils/string.js';\nvar name = 'IndexNode';\nvar dependencies = ['Node', 'size'];\nexport var createIndexNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node,\n size\n } = _ref;\n class IndexNode extends Node {\n /**\n * @constructor IndexNode\n * @extends Node\n *\n * Describes a subset of a matrix or an object property.\n * Cannot be used on its own, needs to be used within an AccessorNode or\n * AssignmentNode.\n *\n * @param {Node[]} dimensions\n * @param {boolean} [dotNotation=false]\n * Optional property describing whether this index was written using dot\n * notation like `a.b`, or using bracket notation like `a[\"b\"]`\n * (which is the default). This property is used for string conversion.\n */\n constructor(dimensions, dotNotation) {\n super();\n this.dimensions = dimensions;\n this.dotNotation = dotNotation || false;\n\n // validate input\n if (!Array.isArray(dimensions) || !dimensions.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"dimensions\"');\n }\n if (this.dotNotation && !this.isObjectProperty()) {\n throw new Error('dotNotation only applicable for object properties');\n }\n }\n get type() {\n return name;\n }\n get isIndexNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // TODO: implement support for bignumber (currently bignumbers are silently\n // reduced to numbers when changing the value to zero-based)\n\n // TODO: Optimization: when the range values are ConstantNodes,\n // we can beforehand resolve the zero-based value\n\n // optimization for a simple object property\n var evalDimensions = map(this.dimensions, function (dimension, i) {\n var needsEnd = dimension.filter(node => node.isSymbolNode && node.name === 'end').length > 0;\n if (needsEnd) {\n // SymbolNode 'end' is used inside the index,\n // like in `A[end]` or `A[end - 2]`\n var childArgNames = Object.create(argNames);\n childArgNames.end = true;\n var _evalDimension = dimension._compile(math, childArgNames);\n return function evalDimension(scope, args, context) {\n if (!isMatrix(context) && !isArray(context) && !isString(context)) {\n throw new TypeError('Cannot resolve \"end\": ' + 'context must be a Matrix, Array, or string but is ' + typeOf(context));\n }\n var s = size(context).valueOf();\n var childArgs = Object.create(args);\n childArgs.end = s[i];\n return _evalDimension(scope, childArgs, context);\n };\n } else {\n // SymbolNode `end` not used\n return dimension._compile(math, argNames);\n }\n });\n var index = getSafeProperty(math, 'index');\n return function evalIndexNode(scope, args, context) {\n var dimensions = map(evalDimensions, function (evalDimension) {\n return evalDimension(scope, args, context);\n });\n return index(...dimensions);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.dimensions.length; i++) {\n callback(this.dimensions[i], 'dimensions[' + i + ']', this);\n }\n }\n\n /**\n * Create a new IndexNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {IndexNode} Returns a transformed copy of the node\n */\n map(callback) {\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this._ifNode(callback(this.dimensions[i], 'dimensions[' + i + ']', this));\n }\n return new IndexNode(dimensions, this.dotNotation);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {IndexNode}\n */\n clone() {\n return new IndexNode(this.dimensions.slice(0), this.dotNotation);\n }\n\n /**\n * Test whether this IndexNode contains a single property name\n * @return {boolean}\n */\n isObjectProperty() {\n return this.dimensions.length === 1 && isConstantNode(this.dimensions[0]) && typeof this.dimensions[0].value === 'string';\n }\n\n /**\n * Returns the property name if IndexNode contains a property.\n * If not, returns null.\n * @return {string | null}\n */\n getObjectProperty() {\n return this.isObjectProperty() ? this.dimensions[0].value : null;\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n // format the parameters like \"[1, 0:5]\"\n return this.dotNotation ? '.' + this.getObjectProperty() : '[' + this.dimensions.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n dimensions: this.dimensions,\n dotNotation: this.dotNotation\n };\n }\n\n /**\n * Instantiate an IndexNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"IndexNode\", dimensions: [...], dotNotation: false}`,\n * where mathjs is optional\n * @returns {IndexNode}\n */\n static fromJSON(json) {\n return new IndexNode(json.dimensions, json.dotNotation);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n // format the parameters like \"[1, 0:5]\"\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this.dimensions[i].toHTML();\n }\n if (this.dotNotation) {\n return '.' + '' + escape(this.getObjectProperty()) + '';\n } else {\n return '[' + dimensions.join(',') + ']';\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var dimensions = this.dimensions.map(function (range) {\n return range.toTex(options);\n });\n return this.dotNotation ? '.' + this.getObjectProperty() + '' : '_{' + dimensions.join(',') + '}';\n }\n }\n _defineProperty(IndexNode, \"name\", name);\n return IndexNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNode } from '../../utils/is.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { escape, stringify } from '../../utils/string.js';\nvar name = 'ObjectNode';\nvar dependencies = ['Node'];\nexport var createObjectNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ObjectNode extends Node {\n /**\n * @constructor ObjectNode\n * @extends {Node}\n * Holds an object with keys/values\n * @param {Object.} [properties] object with key/value pairs\n */\n constructor(properties) {\n super();\n this.properties = properties || {};\n\n // validate input\n if (properties) {\n if (!(typeof properties === 'object') || !Object.keys(properties).every(function (key) {\n return isNode(properties[key]);\n })) {\n throw new TypeError('Object containing Nodes expected');\n }\n }\n }\n get type() {\n return name;\n }\n get isObjectNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalEntries = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n // we stringify/parse the key here to resolve unicode characters,\n // so you cannot create a key like {\"co\\\\u006Estructor\": null}\n var stringifiedKey = stringify(key);\n var parsedKey = JSON.parse(stringifiedKey);\n var prop = getSafeProperty(this.properties, key);\n evalEntries[parsedKey] = prop._compile(math, argNames);\n }\n }\n return function evalObjectNode(scope, args, context) {\n var obj = {};\n for (var _key in evalEntries) {\n if (hasOwnProperty(evalEntries, _key)) {\n obj[_key] = evalEntries[_key](scope, args, context);\n }\n }\n return obj;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n callback(this.properties[key], 'properties[' + stringify(key) + ']', this);\n }\n }\n }\n\n /**\n * Create a new ObjectNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ObjectNode} Returns a transformed copy of the node\n */\n map(callback) {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this._ifNode(callback(this.properties[key], 'properties[' + stringify(key) + ']', this));\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ObjectNode}\n */\n clone() {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this.properties[key];\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push(stringify(key) + ': ' + this.properties[key].toString(options));\n }\n }\n return '{' + entries.join(', ') + '}';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n properties: this.properties\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ObjectNode\", \"properties\": {...}}`,\n * where mathjs is optional\n * @returns {ObjectNode}\n */\n static fromJSON(json) {\n return new ObjectNode(json.properties);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('' + escape(key) + '' + '' + ':' + this.properties[key].toHTML(options));\n }\n }\n return '{' + entries.join(',') + '}';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('\\\\mathbf{' + key + ':} & ' + this.properties[key].toTex(options) + '\\\\\\\\');\n }\n }\n var tex = '\\\\left\\\\{\\\\begin{array}{ll}' + entries.join('\\n') + '\\\\end{array}\\\\right\\\\}';\n return tex;\n }\n }\n _defineProperty(ObjectNode, \"name\", name);\n return ObjectNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isConstantNode, isOperatorNode, isParenthesisNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty, isSafeMethod } from '../../utils/customs.js';\nimport { getAssociativity, getPrecedence, isAssociativeWith, properties } from '../operators.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'OperatorNode';\nvar dependencies = ['Node'];\nexport var createOperatorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Returns true if the expression starts with a constant, under\n * the current parenthesization:\n * @param {Node} expression\n * @param {string} parenthesis\n * @return {boolean}\n */\n function startsWithConstant(expr, parenthesis) {\n var curNode = expr;\n if (parenthesis === 'auto') {\n while (isParenthesisNode(curNode)) curNode = curNode.content;\n }\n if (isConstantNode(curNode)) return true;\n if (isOperatorNode(curNode)) {\n return startsWithConstant(curNode.args[0], parenthesis);\n }\n return false;\n }\n\n /**\n * Calculate which parentheses are necessary. Gets an OperatorNode\n * (which is the root of the tree) and an Array of Nodes\n * (this.args) and returns an array where 'true' means that an argument\n * has to be enclosed in parentheses whereas 'false' means the opposite.\n *\n * @param {OperatorNode} root\n * @param {string} parenthesis\n * @param {Node[]} args\n * @param {boolean} latex\n * @return {boolean[]}\n * @private\n */\n function calculateNecessaryParentheses(root, parenthesis, implicit, args, latex) {\n // precedence of the root OperatorNode\n var precedence = getPrecedence(root, parenthesis, implicit);\n var associativity = getAssociativity(root, parenthesis);\n if (parenthesis === 'all' || args.length > 2 && root.getIdentifier() !== 'OperatorNode:add' && root.getIdentifier() !== 'OperatorNode:multiply') {\n return args.map(function (arg) {\n switch (arg.getContent().type) {\n // Nodes that don't need extra parentheses\n case 'ArrayNode':\n case 'ConstantNode':\n case 'SymbolNode':\n case 'ParenthesisNode':\n return false;\n default:\n return true;\n }\n });\n }\n var result;\n switch (args.length) {\n case 0:\n result = [];\n break;\n case 1:\n // unary operators\n {\n // precedence of the operand\n var operandPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex && operandPrecedence !== null) {\n var operandIdentifier;\n var rootIdentifier;\n if (parenthesis === 'keep') {\n operandIdentifier = args[0].getIdentifier();\n rootIdentifier = root.getIdentifier();\n } else {\n // Ignore Parenthesis Nodes when not in 'keep' mode\n operandIdentifier = args[0].getContent().getIdentifier();\n rootIdentifier = root.getContent().getIdentifier();\n }\n if (properties[precedence][rootIdentifier].latexLeftParens === false) {\n result = [false];\n break;\n }\n if (properties[operandPrecedence][operandIdentifier].latexParens === false) {\n result = [false];\n break;\n }\n }\n if (operandPrecedence === null) {\n // if the operand has no defined precedence, no parens are needed\n result = [false];\n break;\n }\n if (operandPrecedence <= precedence) {\n // if the operands precedence is lower, parens are needed\n result = [true];\n break;\n }\n\n // otherwise, no parens needed\n result = [false];\n }\n break;\n case 2:\n // binary operators\n {\n var lhsParens; // left hand side needs parenthesis?\n // precedence of the left hand side\n var lhsPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n // is the root node associative with the left hand side\n var assocWithLhs = isAssociativeWith(root, args[0], parenthesis);\n if (lhsPrecedence === null) {\n // if the left hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n lhsParens = false;\n } else if (lhsPrecedence === precedence && associativity === 'right' && !assocWithLhs) {\n // In case of equal precedence, if the root node is left associative\n // parens are **never** necessary for the left hand side.\n // If it is right associative however, parens are necessary\n // if the root node isn't associative with the left hand side\n lhsParens = true;\n } else if (lhsPrecedence < precedence) {\n lhsParens = true;\n } else {\n lhsParens = false;\n }\n var rhsParens; // right hand side needs parenthesis?\n // precedence of the right hand side\n var rhsPrecedence = getPrecedence(args[1], parenthesis, implicit, root);\n // is the root node associative with the right hand side?\n var assocWithRhs = isAssociativeWith(root, args[1], parenthesis);\n if (rhsPrecedence === null) {\n // if the right hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n rhsParens = false;\n } else if (rhsPrecedence === precedence && associativity === 'left' && !assocWithRhs) {\n // In case of equal precedence, if the root node is right associative\n // parens are **never** necessary for the right hand side.\n // If it is left associative however, parens are necessary\n // if the root node isn't associative with the right hand side\n rhsParens = true;\n } else if (rhsPrecedence < precedence) {\n rhsParens = true;\n } else {\n rhsParens = false;\n }\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex) {\n var _rootIdentifier;\n var lhsIdentifier;\n var rhsIdentifier;\n if (parenthesis === 'keep') {\n _rootIdentifier = root.getIdentifier();\n lhsIdentifier = root.args[0].getIdentifier();\n rhsIdentifier = root.args[1].getIdentifier();\n } else {\n // Ignore ParenthesisNodes when not in 'keep' mode\n _rootIdentifier = root.getContent().getIdentifier();\n lhsIdentifier = root.args[0].getContent().getIdentifier();\n rhsIdentifier = root.args[1].getContent().getIdentifier();\n }\n if (lhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexLeftParens === false) {\n lhsParens = false;\n }\n if (properties[lhsPrecedence][lhsIdentifier].latexParens === false) {\n lhsParens = false;\n }\n }\n if (rhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexRightParens === false) {\n rhsParens = false;\n }\n if (properties[rhsPrecedence][rhsIdentifier].latexParens === false) {\n rhsParens = false;\n }\n }\n }\n result = [lhsParens, rhsParens];\n }\n break;\n default:\n if (root.getIdentifier() === 'OperatorNode:add' || root.getIdentifier() === 'OperatorNode:multiply') {\n result = args.map(function (arg) {\n var argPrecedence = getPrecedence(arg, parenthesis, implicit, root);\n var assocWithArg = isAssociativeWith(root, arg, parenthesis);\n var argAssociativity = getAssociativity(arg, parenthesis);\n if (argPrecedence === null) {\n // if the argument has no defined precedence, no parens are needed\n return false;\n } else if (precedence === argPrecedence && associativity === argAssociativity && !assocWithArg) {\n return true;\n } else if (argPrecedence < precedence) {\n return true;\n }\n return false;\n });\n }\n break;\n }\n\n // Handles an edge case of parentheses with implicit multiplication\n // of ConstantNode.\n // In that case, parenthesize ConstantNodes that follow an unparenthesized\n // expression, even though they normally wouldn't be printed.\n if (args.length >= 2 && root.getIdentifier() === 'OperatorNode:multiply' && root.implicit && parenthesis !== 'all' && implicit === 'hide') {\n for (var i = 1; i < result.length; ++i) {\n if (startsWithConstant(args[i], parenthesis) && !result[i - 1] && (parenthesis !== 'keep' || !isParenthesisNode(args[i - 1]))) {\n result[i] = true;\n }\n }\n }\n return result;\n }\n class OperatorNode extends Node {\n /**\n * @constructor OperatorNode\n * @extends {Node}\n * An operator with two arguments, like 2+3\n *\n * @param {string} op Operator name, for example '+'\n * @param {string} fn Function name, for example 'add'\n * @param {Node[]} args Operator arguments\n * @param {boolean} [implicit] Is this an implicit multiplication?\n * @param {boolean} [isPercentage] Is this an percentage Operation?\n */\n constructor(op, fn, args, implicit, isPercentage) {\n super();\n // validate input\n if (typeof op !== 'string') {\n throw new TypeError('string expected for parameter \"op\"');\n }\n if (typeof fn !== 'string') {\n throw new TypeError('string expected for parameter \"fn\"');\n }\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n this.implicit = implicit === true;\n this.isPercentage = isPercentage === true;\n this.op = op;\n this.fn = fn;\n this.args = args || [];\n }\n get type() {\n return name;\n }\n get isOperatorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // validate fn\n if (typeof this.fn !== 'string' || !isSafeMethod(math, this.fn)) {\n if (!math[this.fn]) {\n throw new Error('Function ' + this.fn + ' missing in provided namespace \"math\"');\n } else {\n throw new Error('No access to function \"' + this.fn + '\"');\n }\n }\n var fn = getSafeProperty(math, this.fn);\n var evalArgs = map(this.args, function (arg) {\n return arg._compile(math, argNames);\n });\n if (typeof fn === 'function' && fn.rawArgs === true) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalOperatorNode(scope, args, context) {\n return fn(rawArgs, math, createSubScope(scope, args));\n };\n } else if (evalArgs.length === 1) {\n var evalArg0 = evalArgs[0];\n return function evalOperatorNode(scope, args, context) {\n return fn(evalArg0(scope, args, context));\n };\n } else if (evalArgs.length === 2) {\n var _evalArg = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return function evalOperatorNode(scope, args, context) {\n return fn(_evalArg(scope, args, context), evalArg1(scope, args, context));\n };\n } else {\n return function evalOperatorNode(scope, args, context) {\n return fn.apply(null, map(evalArgs, function (evalArg) {\n return evalArg(scope, args, context);\n }));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new OperatorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new OperatorNode(this.op, this.fn, args, this.implicit, this.isPercentage);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {OperatorNode}\n */\n clone() {\n return new OperatorNode(this.op, this.fn, this.args.slice(0), this.implicit, this.isPercentage);\n }\n\n /**\n * Check whether this is an unary OperatorNode:\n * has exactly one argument, like `-a`.\n * @return {boolean}\n * Returns true when an unary operator node, false otherwise.\n */\n isUnary() {\n return this.args.length === 1;\n }\n\n /**\n * Check whether this is a binary OperatorNode:\n * has exactly two arguments, like `a + b`.\n * @return {boolean}\n * Returns true when a binary operator node, false otherwise.\n */\n isBinary() {\n return this.args.length === 2;\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toString(options);\n if (parens[0]) {\n operand = '(' + operand + ')';\n }\n\n // for example for \"not\", we want a space between operand and argument\n var opIsNamed = /[a-zA-Z]+/.test(this.op);\n if (assoc === 'right') {\n // prefix operator\n return this.op + (opIsNamed ? ' ' : '') + operand;\n } else if (assoc === 'left') {\n // postfix\n return operand + (opIsNamed ? ' ' : '') + this.op;\n }\n\n // fall back to postfix\n return operand + this.op;\n } else if (args.length === 2) {\n var lhs = args[0].toString(options); // left hand side\n var rhs = args[1].toString(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '(' + lhs + ')';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '(' + rhs + ')';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + ' ' + rhs;\n }\n return lhs + ' ' + this.op + ' ' + rhs;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toString(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '(' + arg + ')';\n }\n return arg;\n });\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join(' ');\n }\n return stringifiedArgs.join(' ' + this.op + ' ');\n } else {\n // fallback to formatting as a function call\n return this.fn + '(' + this.args.join(', ') + ')';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n op: this.op,\n fn: this.fn,\n args: this.args,\n implicit: this.implicit,\n isPercentage: this.isPercentage\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"OperatorNode\",\n * \"op\": \"+\", \"fn\": \"add\", \"args\": [...],\n * \"implicit\": false,\n * \"isPercentage\":false}\n * ```\n * where mathjs is optional\n * @returns {OperatorNode}\n */\n static fromJSON(json) {\n return new OperatorNode(json.op, json.fn, json.args, json.implicit, json.isPercentage);\n }\n\n /**\n * Get HTML representation.\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toHTML(options);\n if (parens[0]) {\n operand = '(' + operand + ')';\n }\n if (assoc === 'right') {\n // prefix operator\n return '' + escape(this.op) + '' + operand;\n } else {\n // postfix when assoc === 'left' or undefined\n return operand + '' + escape(this.op) + '';\n }\n } else if (args.length === 2) {\n // binary operatoes\n var lhs = args[0].toHTML(options); // left hand side\n var rhs = args[1].toHTML(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '(' + lhs + ')';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '(' + rhs + ')';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + '' + rhs;\n }\n return lhs + '' + escape(this.op) + '' + rhs;\n } else {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toHTML(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '(' + arg + ')';\n }\n return arg;\n });\n if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join('');\n }\n return stringifiedArgs.join('' + escape(this.op) + '');\n } else {\n // fallback to formatting as a function call\n return '' + escape(this.fn) + '' + '(' + stringifiedArgs.join(',') + ')';\n }\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, true);\n var op = latexOperators[this.fn];\n op = typeof op === 'undefined' ? this.op : op; // fall back to using this.op\n\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toTex(options);\n if (parens[0]) {\n operand = \"\\\\left(\".concat(operand, \"\\\\right)\");\n }\n if (assoc === 'right') {\n // prefix operator\n return op + operand;\n } else if (assoc === 'left') {\n // postfix operator\n return operand + op;\n }\n\n // fall back to postfix\n return operand + op;\n } else if (args.length === 2) {\n // binary operators\n var lhs = args[0]; // left hand side\n var lhsTex = lhs.toTex(options);\n if (parens[0]) {\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n var rhs = args[1]; // right hand side\n var rhsTex = rhs.toTex(options);\n if (parens[1]) {\n rhsTex = \"\\\\left(\".concat(rhsTex, \"\\\\right)\");\n }\n\n // handle some exceptions (due to the way LaTeX works)\n var lhsIdentifier;\n if (parenthesis === 'keep') {\n lhsIdentifier = lhs.getIdentifier();\n } else {\n // Ignore ParenthesisNodes if in 'keep' mode\n lhsIdentifier = lhs.getContent().getIdentifier();\n }\n switch (this.getIdentifier()) {\n case 'OperatorNode:divide':\n // op contains '\\\\frac' at this point\n return op + '{' + lhsTex + '}' + '{' + rhsTex + '}';\n case 'OperatorNode:pow':\n lhsTex = '{' + lhsTex + '}';\n rhsTex = '{' + rhsTex + '}';\n switch (lhsIdentifier) {\n case 'ConditionalNode': //\n case 'OperatorNode:divide':\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n break;\n case 'OperatorNode:multiply':\n if (this.implicit && implicit === 'hide') {\n return lhsTex + '~' + rhsTex;\n }\n }\n return lhsTex + op + rhsTex;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var texifiedArgs = args.map(function (arg, index) {\n arg = arg.toTex(options);\n if (parens[index]) {\n arg = \"\\\\left(\".concat(arg, \"\\\\right)\");\n }\n return arg;\n });\n if (this.getIdentifier() === 'OperatorNode:multiply' && this.implicit && implicit === 'hide') {\n return texifiedArgs.join('~');\n }\n return texifiedArgs.join(op);\n } else {\n // fall back to formatting as a function call\n // as this is a fallback, it doesn't use\n // fancy function names\n return '\\\\mathrm{' + this.fn + '}\\\\left(' + args.map(function (arg) {\n return arg.toTex(options);\n }).join(',') + '\\\\right)';\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.fn;\n }\n }\n _defineProperty(OperatorNode, \"name\", name);\n return OperatorNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { ObjectWrappingMap, PartitionedMap } from './map.js';\n\n/**\n * Create a new scope which can access the parent scope,\n * but does not affect it when written. This is suitable for variable definitions\n * within a block node, or function definition.\n *\n * If parent scope has a createSubScope method, it delegates to that. Otherwise,\n * creates an empty map, and copies the parent scope to it, adding in\n * the remaining `args`.\n *\n * @param {Map} parentScope\n * @param {Object} args\n * @returns {PartitionedMap}\n */\nexport function createSubScope(parentScope, args) {\n return new PartitionedMap(parentScope, new ObjectWrappingMap(args), new Set(Object.keys(args)));\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ParenthesisNode';\nvar dependencies = ['Node'];\nexport var createParenthesisNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ParenthesisNode extends Node {\n /**\n * @constructor ParenthesisNode\n * @extends {Node}\n * A parenthesis node describes manual parenthesis from the user input\n * @param {Node} content\n * @extends {Node}\n */\n constructor(content) {\n super();\n // validate input\n if (!isNode(content)) {\n throw new TypeError('Node expected for parameter \"content\"');\n }\n this.content = content;\n }\n get type() {\n return name;\n }\n get isParenthesisNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n return this.content._compile(math, argNames);\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} content\n * @override\n **/\n getContent() {\n return this.content.getContent();\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.content, 'content', this);\n }\n\n /**\n * Create a new ParenthesisNode whose child is the result of calling\n * the provided callback function on the child of this node.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ParenthesisNode} Returns a clone of the node\n */\n map(callback) {\n var content = callback(this.content, 'content', this);\n return new ParenthesisNode(content);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ParenthesisNode}\n */\n clone() {\n return new ParenthesisNode(this.content);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '(' + this.content.toString(options) + ')';\n }\n return this.content.toString(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n content: this.content\n };\n }\n\n /**\n * Instantiate an ParenthesisNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ParenthesisNode\", \"content\": ...}`,\n * where mathjs is optional\n * @returns {ParenthesisNode}\n */\n static fromJSON(json) {\n return new ParenthesisNode(json.content);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '(' + this.content.toHTML(options) + ')';\n }\n return this.content.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return \"\\\\left(\".concat(this.content.toTex(options), \"\\\\right)\");\n }\n return this.content.toTex(options);\n }\n }\n _defineProperty(ParenthesisNode, \"name\", name);\n return ParenthesisNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'RangeNode';\nvar dependencies = ['Node'];\nexport var createRangeNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Calculate the necessary parentheses\n * @param {Node} node\n * @param {string} parenthesis\n * @param {string} implicit\n * @return {Object} parentheses\n * @private\n */\n function calculateNecessaryParentheses(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var parens = {};\n var startPrecedence = getPrecedence(node.start, parenthesis, implicit);\n parens.start = startPrecedence !== null && startPrecedence <= precedence || parenthesis === 'all';\n if (node.step) {\n var stepPrecedence = getPrecedence(node.step, parenthesis, implicit);\n parens.step = stepPrecedence !== null && stepPrecedence <= precedence || parenthesis === 'all';\n }\n var endPrecedence = getPrecedence(node.end, parenthesis, implicit);\n parens.end = endPrecedence !== null && endPrecedence <= precedence || parenthesis === 'all';\n return parens;\n }\n class RangeNode extends Node {\n /**\n * @constructor RangeNode\n * @extends {Node}\n * create a range\n * @param {Node} start included lower-bound\n * @param {Node} end included upper-bound\n * @param {Node} [step] optional step\n */\n constructor(start, end, step) {\n super();\n // validate inputs\n if (!isNode(start)) throw new TypeError('Node expected');\n if (!isNode(end)) throw new TypeError('Node expected');\n if (step && !isNode(step)) throw new TypeError('Node expected');\n if (arguments.length > 3) throw new Error('Too many arguments');\n this.start = start; // included lower-bound\n this.end = end; // included upper-bound\n this.step = step || null; // optional step\n }\n get type() {\n return name;\n }\n get isRangeNode() {\n return true;\n }\n\n /**\n * Check whether the RangeNode needs the `end` symbol to be defined.\n * This end is the size of the Matrix in current dimension.\n * @return {boolean}\n */\n needsEnd() {\n // find all `end` symbols in this RangeNode\n var endSymbols = this.filter(function (node) {\n return isSymbolNode(node) && node.name === 'end';\n });\n return endSymbols.length > 0;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var range = math.range;\n var evalStart = this.start._compile(math, argNames);\n var evalEnd = this.end._compile(math, argNames);\n if (this.step) {\n var evalStep = this.step._compile(math, argNames);\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context), evalStep(scope, args, context));\n };\n } else {\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.start, 'start', this);\n callback(this.end, 'end', this);\n if (this.step) {\n callback(this.step, 'step', this);\n }\n }\n\n /**\n * Create a new RangeNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RangeNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RangeNode(this._ifNode(callback(this.start, 'start', this)), this._ifNode(callback(this.end, 'end', this)), this.step && this._ifNode(callback(this.step, 'step', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RangeNode}\n */\n clone() {\n return new RangeNode(this.start, this.end, this.step && this.step);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toString(options);\n if (parens.start) {\n start = '(' + start + ')';\n }\n str = start;\n if (this.step) {\n var step = this.step.toString(options);\n if (parens.step) {\n step = '(' + step + ')';\n }\n str += ':' + step;\n }\n var end = this.end.toString(options);\n if (parens.end) {\n end = '(' + end + ')';\n }\n str += ':' + end;\n return str;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n start: this.start,\n end: this.end,\n step: this.step\n };\n }\n\n /**\n * Instantiate an RangeNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RangeNode\", \"start\": ..., \"end\": ..., \"step\": ...}`,\n * where mathjs is optional\n * @returns {RangeNode}\n */\n static fromJSON(json) {\n return new RangeNode(json.start, json.end, json.step);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toHTML(options);\n if (parens.start) {\n start = '(' + start + ')';\n }\n str = start;\n if (this.step) {\n var step = this.step.toHTML(options);\n if (parens.step) {\n step = '(' + step + ')';\n }\n str += ':' + step;\n }\n var end = this.end.toHTML(options);\n if (parens.end) {\n end = '(' + end + ')';\n }\n str += ':' + end;\n return str;\n }\n\n /**\n * Get LaTeX representation\n * @params {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n var str = this.start.toTex(options);\n if (parens.start) {\n str = \"\\\\left(\".concat(str, \"\\\\right)\");\n }\n if (this.step) {\n var step = this.step.toTex(options);\n if (parens.step) {\n step = \"\\\\left(\".concat(step, \"\\\\right)\");\n }\n str += ':' + step;\n }\n var end = this.end.toTex(options);\n if (parens.end) {\n end = \"\\\\left(\".concat(end, \"\\\\right)\");\n }\n str += ':' + end;\n return str;\n }\n }\n _defineProperty(RangeNode, \"name\", name);\n return RangeNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getPrecedence } from '../operators.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'RelationalNode';\nvar dependencies = ['Node'];\nexport var createRelationalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n var operatorMap = {\n equal: '==',\n unequal: '!=',\n smaller: '<',\n larger: '>',\n smallerEq: '<=',\n largerEq: '>='\n };\n class RelationalNode extends Node {\n /**\n * A node representing a chained conditional expression, such as 'x > y > z'\n *\n * @param {String[]} conditionals\n * An array of conditional operators used to compare the parameters\n * @param {Node[]} params\n * The parameters that will be compared\n *\n * @constructor RelationalNode\n * @extends {Node}\n */\n constructor(conditionals, params) {\n super();\n if (!Array.isArray(conditionals)) {\n throw new TypeError('Parameter conditionals must be an array');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Parameter params must be an array');\n }\n if (conditionals.length !== params.length - 1) {\n throw new TypeError('Parameter params must contain exactly one more element ' + 'than parameter conditionals');\n }\n this.conditionals = conditionals;\n this.params = params;\n }\n get type() {\n return name;\n }\n get isRelationalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var self = this;\n var compiled = this.params.map(p => p._compile(math, argNames));\n return function evalRelationalNode(scope, args, context) {\n var evalLhs;\n var evalRhs = compiled[0](scope, args, context);\n for (var i = 0; i < self.conditionals.length; i++) {\n evalLhs = evalRhs;\n evalRhs = compiled[i + 1](scope, args, context);\n var condFn = getSafeProperty(math, self.conditionals[i]);\n if (!condFn(evalLhs, evalRhs)) {\n return false;\n }\n }\n return true;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n this.params.forEach((n, i) => callback(n, 'params[' + i + ']', this), this);\n }\n\n /**\n * Create a new RelationalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RelationalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RelationalNode(this.conditionals.slice(), this.params.map((n, i) => this._ifNode(callback(n, 'params[' + i + ']', this)), this));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RelationalNode}\n */\n clone() {\n return new RelationalNode(this.conditionals, this.params);\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toString(options) + ')' : p.toString(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += ' ' + operatorMap[this.conditionals[i]];\n ret += ' ' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n conditionals: this.conditionals,\n params: this.params\n };\n }\n\n /**\n * Instantiate a RelationalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RelationalNode\", \"conditionals\": ..., \"params\": ...}`,\n * where mathjs is optional\n * @returns {RelationalNode}\n */\n static fromJSON(json) {\n return new RelationalNode(json.conditionals, json.params);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toHTML(options) + ')' : p.toHTML(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += '' + escape(operatorMap[this.conditionals[i]]) + '' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '\\\\left(' + p.toTex(options) + '\\right)' : p.toTex(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += latexOperators[this.conditionals[i]] + paramStrings[i + 1];\n }\n return ret;\n }\n }\n _defineProperty(RelationalNode, \"name\", name);\n return RelationalNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { toSymbol } from '../../utils/latex.js';\nvar name = 'SymbolNode';\nvar dependencies = ['math', '?Unit', 'Node'];\nexport var createSymbolNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n math,\n Unit,\n Node\n } = _ref;\n /**\n * Check whether some name is a valueless unit like \"inch\".\n * @param {string} name\n * @return {boolean}\n */\n function isValuelessUnit(name) {\n return Unit ? Unit.isValuelessUnit(name) : false;\n }\n class SymbolNode extends Node {\n /**\n * @constructor SymbolNode\n * @extends {Node}\n * A symbol node can hold and resolve a symbol\n * @param {string} name\n * @extends {Node}\n */\n constructor(name) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n this.name = name;\n }\n get type() {\n return 'SymbolNode';\n }\n get isSymbolNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var name = this.name;\n if (argNames[name] === true) {\n // this is a FunctionAssignment argument\n // (like an x when inside the expression of a function\n // assignment `f(x) = ...`)\n return function (scope, args, context) {\n return getSafeProperty(args, name);\n };\n } else if (name in math) {\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : getSafeProperty(math, name);\n };\n } else {\n var isUnit = isValuelessUnit(name);\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : isUnit ? new Unit(null, name) : SymbolNode.onUndefinedSymbol(name);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new SymbolNode with children produced by the given callback.\n * Trivial since a SymbolNode has no children\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {SymbolNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Throws an error 'Undefined symbol {name}'\n * @param {string} name\n */\n static onUndefinedSymbol(name) {\n throw new Error('Undefined symbol ' + name);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {SymbolNode}\n */\n clone() {\n return new SymbolNode(this.name);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.name;\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var name = escape(this.name);\n if (name === 'true' || name === 'false') {\n return '' + name + '';\n } else if (name === 'i') {\n return '' + name + '';\n } else if (name === 'Infinity') {\n return '' + name + '';\n } else if (name === 'NaN') {\n return '' + name + '';\n } else if (name === 'null') {\n return '' + name + '';\n } else if (name === 'undefined') {\n return '' + name + '';\n }\n return '' + name + '';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: 'SymbolNode',\n name: this.name\n };\n }\n\n /**\n * Instantiate a SymbolNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", name: \"x\"}`,\n * where mathjs is optional\n * @returns {SymbolNode}\n */\n static fromJSON(json) {\n return new SymbolNode(json.name);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n var isUnit = false;\n if (typeof math[this.name] === 'undefined' && isValuelessUnit(this.name)) {\n isUnit = true;\n }\n var symbol = toSymbol(this.name, isUnit);\n if (symbol[0] === '\\\\') {\n // no space needed if the symbol starts with '\\'\n return symbol;\n }\n // the space prevents symbols from breaking stuff like '\\cdot'\n // if it's written right before the symbol\n return ' ' + symbol;\n }\n }\n return SymbolNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isFunctionAssignmentNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { escape, format } from '../../utils/string.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { getSafeProperty, getSafeMethod } from '../../utils/customs.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { factory } from '../../utils/factory.js';\nimport { defaultTemplate, latexFunctions } from '../../utils/latex.js';\nvar name = 'FunctionNode';\nvar dependencies = ['math', 'Node', 'SymbolNode'];\nexport var createFunctionNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var _FunctionNode;\n var {\n math,\n Node,\n SymbolNode\n } = _ref;\n /* format to fixed length */\n var strin = entity => format(entity, {\n truncate: 78\n });\n\n /*\n * Expand a LaTeX template\n *\n * @param {string} template\n * @param {Node} node\n * @param {Object} options\n * @private\n **/\n function expandTemplate(template, node, options) {\n var latex = '';\n\n // Match everything of the form ${identifier} or ${identifier[2]} or $$\n // while submatching identifier and 2 (in the second case)\n var regex = /\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi;\n var inputPos = 0; // position in the input string\n var match;\n while ((match = regex.exec(template)) !== null) {\n // go through all matches\n // add everything in front of the match to the LaTeX string\n latex += template.substring(inputPos, match.index);\n inputPos = match.index;\n if (match[0] === '$$') {\n // escaped dollar sign\n latex += '$';\n inputPos++;\n } else {\n // template parameter\n inputPos += match[0].length;\n var property = node[match[1]];\n if (!property) {\n throw new ReferenceError('Template: Property ' + match[1] + ' does not exist.');\n }\n if (match[2] === undefined) {\n // no square brackets\n switch (typeof property) {\n case 'string':\n latex += property;\n break;\n case 'object':\n if (isNode(property)) {\n latex += property.toTex(options);\n } else if (Array.isArray(property)) {\n // make array of Nodes into comma separated list\n latex += property.map(function (arg, index) {\n if (isNode(arg)) {\n return arg.toTex(options);\n }\n throw new TypeError('Template: ' + match[1] + '[' + index + '] is not a Node.');\n }).join(',');\n } else {\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n break;\n default:\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n } else {\n // with square brackets\n if (isNode(property[match[2]] && property[match[2]])) {\n latex += property[match[2]].toTex(options);\n } else {\n throw new TypeError('Template: ' + match[1] + '[' + match[2] + '] is not a Node.');\n }\n }\n }\n }\n latex += template.slice(inputPos); // append rest of the template\n\n return latex;\n }\n class FunctionNode extends Node {\n /**\n * @constructor FunctionNode\n * @extends {./Node}\n * invoke a list with arguments on a node\n * @param {./Node | string} fn\n * Item resolving to a function on which to invoke\n * the arguments, typically a SymboNode or AccessorNode\n * @param {./Node[]} args\n */\n constructor(fn, args) {\n super();\n if (typeof fn === 'string') {\n fn = new SymbolNode(fn);\n }\n\n // validate input\n if (!isNode(fn)) throw new TypeError('Node expected as parameter \"fn\"');\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n this.fn = fn;\n this.args = args || [];\n }\n\n // readonly property name\n get name() {\n return this.fn.name || '';\n }\n get type() {\n return name;\n }\n get isFunctionNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // compile arguments\n var evalArgs = this.args.map(arg => arg._compile(math, argNames));\n if (isSymbolNode(this.fn)) {\n var _name = this.fn.name;\n if (!argNames[_name]) {\n // we can statically determine whether the function\n // has the rawArgs property\n var fn = _name in math ? getSafeProperty(math, _name) : undefined;\n var isRaw = typeof fn === 'function' && fn.rawArgs === true;\n var resolveFn = scope => {\n var value;\n if (scope.has(_name)) {\n value = scope.get(_name);\n } else if (_name in math) {\n value = getSafeProperty(math, _name);\n } else {\n return FunctionNode.onUndefinedFunction(_name);\n }\n if (typeof value === 'function') {\n return value;\n }\n throw new TypeError(\"'\".concat(_name, \"' is not a function; its value is:\\n \").concat(strin(value)));\n };\n if (isRaw) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n return fn(rawArgs, math, createSubScope(scope, args));\n };\n } else {\n // \"regular\" evaluation\n switch (evalArgs.length) {\n case 0:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n return fn();\n };\n case 1:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var evalArg0 = evalArgs[0];\n return fn(evalArg0(scope, args, context));\n };\n case 2:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var evalArg0 = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return fn(evalArg0(scope, args, context), evalArg1(scope, args, context));\n };\n default:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn(...values);\n };\n }\n }\n } else {\n // the function symbol is an argName\n var _rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = getSafeProperty(args, _name);\n if (typeof fn !== 'function') {\n throw new TypeError(\"Argument '\".concat(_name, \"' was not a function; received: \").concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs, math, createSubScope(scope, args));\n } else {\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n } else if (isAccessorNode(this.fn) && isIndexNode(this.fn.index) && this.fn.index.isObjectProperty()) {\n // execute the function with the right context:\n // the object of the AccessorNode\n\n var evalObject = this.fn.object._compile(math, argNames);\n var prop = this.fn.index.getObjectProperty();\n var _rawArgs2 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n var fn = getSafeMethod(object, prop);\n if (fn !== null && fn !== void 0 && fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs2, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(object, values);\n }\n };\n } else {\n // node.fn.isAccessorNode && !node.fn.index.isObjectProperty()\n // we have to dynamically determine whether the function has the\n // rawArgs property\n var fnExpr = this.fn.toString();\n var evalFn = this.fn._compile(math, argNames);\n var _rawArgs3 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = evalFn(scope, args, context);\n if (typeof fn !== 'function') {\n throw new TypeError(\"Expression '\".concat(fnExpr, \"' did not evaluate to a function; value is:\") + \"\\n \".concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs3, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.fn, 'fn', this);\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new FunctionNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionNode} Returns a transformed copy of the node\n */\n map(callback) {\n var fn = this._ifNode(callback(this.fn, 'fn', this));\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new FunctionNode(fn, args);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionNode}\n */\n clone() {\n return new FunctionNode(this.fn, this.args.slice(0));\n }\n\n /**\n * Throws an error 'Undefined function {name}'\n * @param {string} name\n */\n\n /**\n * Get string representation. (wrapper function)\n * This overrides parts of Node's toString function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toString\n * function.\n *\n * @param {Object} options\n * @return {string} str\n * @override\n */\n toString(options) {\n var customString;\n var name = this.fn.toString(options);\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, name)) {\n // callback is a map of callback functions\n customString = options.handler[name](this, options);\n }\n if (typeof customString !== 'undefined') {\n return customString;\n }\n\n // fall back to Node's toString\n return super.toString(options);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var args = this.args.map(function (arg) {\n return arg.toString(options);\n });\n var fn = isFunctionAssignmentNode(this.fn) ? '(' + this.fn.toString(options) + ')' : this.fn.toString(options);\n\n // format the arguments like \"add(2, 4.2)\"\n return fn + '(' + args.join(', ') + ')';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n fn: this.fn,\n args: this.args\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"FunctionNode\", fn: ..., args: ...}`,\n * where mathjs is optional\n * @returns {FunctionNode}\n */\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var args = this.args.map(function (arg) {\n return arg.toHTML(options);\n });\n\n // format the arguments like \"add(2, 4.2)\"\n return '' + escape(this.fn) + '(' + args.join(',') + ')';\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n * This overrides parts of Node's toTex function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toTex\n * function.\n *\n * @param {Object} options\n * @return {string}\n */\n toTex(options) {\n var customTex;\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, this.name)) {\n // callback is a map of callback functions\n customTex = options.handler[this.name](this, options);\n }\n if (typeof customTex !== 'undefined') {\n return customTex;\n }\n\n // fall back to Node's toTex\n return super.toTex(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var args = this.args.map(function (arg) {\n // get LaTeX of the arguments\n return arg.toTex(options);\n });\n var latexConverter;\n if (latexFunctions[this.name]) {\n latexConverter = latexFunctions[this.name];\n }\n\n // toTex property on the function itself\n if (math[this.name] && (typeof math[this.name].toTex === 'function' || typeof math[this.name].toTex === 'object' || typeof math[this.name].toTex === 'string')) {\n // .toTex is a callback function\n latexConverter = math[this.name].toTex;\n }\n var customToTex;\n switch (typeof latexConverter) {\n case 'function':\n // a callback function\n customToTex = latexConverter(this, options);\n break;\n case 'string':\n // a template string\n customToTex = expandTemplate(latexConverter, this, options);\n break;\n case 'object':\n // an object with different \"converters\" for different\n // numbers of arguments\n switch (typeof latexConverter[args.length]) {\n case 'function':\n customToTex = latexConverter[args.length](this, options);\n break;\n case 'string':\n customToTex = expandTemplate(latexConverter[args.length], this, options);\n break;\n }\n }\n if (typeof customToTex !== 'undefined') {\n return customToTex;\n }\n return expandTemplate(defaultTemplate, this, options);\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.name;\n }\n }\n _FunctionNode = FunctionNode;\n _defineProperty(FunctionNode, \"name\", name);\n _defineProperty(FunctionNode, \"onUndefinedFunction\", function (name) {\n throw new Error('Undefined function ' + name);\n });\n _defineProperty(FunctionNode, \"fromJSON\", function (json) {\n return new _FunctionNode(json.fn, json.args);\n });\n return FunctionNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../utils/factory.js';\nimport { isAccessorNode, isConstantNode, isFunctionNode, isOperatorNode, isSymbolNode, rule2Node } from '../utils/is.js';\nimport { deepMap } from '../utils/collection.js';\nimport { safeNumberType } from '../utils/number.js';\nimport { hasOwnProperty } from '../utils/object.js';\nvar name = 'parse';\nvar dependencies = ['typed', 'numeric', 'config', 'AccessorNode', 'ArrayNode', 'AssignmentNode', 'BlockNode', 'ConditionalNode', 'ConstantNode', 'FunctionAssignmentNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'RangeNode', 'RelationalNode', 'SymbolNode'];\nexport var createParse = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n numeric,\n config,\n AccessorNode,\n ArrayNode,\n AssignmentNode,\n BlockNode,\n ConditionalNode,\n ConstantNode,\n FunctionAssignmentNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n RangeNode,\n RelationalNode,\n SymbolNode\n } = _ref;\n /**\n * Parse an expression. Returns a node tree, which can be evaluated by\n * invoking node.evaluate().\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.parse(expr)\n * math.parse(expr, options)\n * math.parse([expr1, expr2, expr3, ...])\n * math.parse([expr1, expr2, expr3, ...], options)\n *\n * Example:\n *\n * const node1 = math.parse('sqrt(3^2 + 4^2)')\n * node1.compile().evaluate() // 5\n *\n * let scope = {a:3, b:4}\n * const node2 = math.parse('a * b') // 12\n * const code2 = node2.compile()\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.parse(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].compile().evaluate() // 12\n *\n * See also:\n *\n * evaluate, compile\n *\n * @param {string | string[] | Matrix} expr Expression to be parsed\n * @param {{nodes: Object}} [options] Available options:\n * - `nodes` a set of custom nodes\n * @return {Node | Node[]} node\n * @throws {Error}\n */\n var parse = typed(name, {\n string: function string(expression) {\n return parseStart(expression, {});\n },\n 'Array | Matrix': function ArrayMatrix(expressions) {\n return parseMultiple(expressions, {});\n },\n 'string, Object': function stringObject(expression, options) {\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n return parseStart(expression, extraNodes);\n },\n 'Array | Matrix, Object': parseMultiple\n });\n function parseMultiple(expressions) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n\n // parse an array or matrix with expressions\n return deepMap(expressions, function (elem) {\n if (typeof elem !== 'string') throw new TypeError('String expected');\n return parseStart(elem, extraNodes);\n });\n }\n\n // token types enumeration\n var TOKENTYPE = {\n NULL: 0,\n DELIMITER: 1,\n NUMBER: 2,\n SYMBOL: 3,\n UNKNOWN: 4\n };\n\n // map with all delimiters\n var DELIMITERS = {\n ',': true,\n '(': true,\n ')': true,\n '[': true,\n ']': true,\n '{': true,\n '}': true,\n '\"': true,\n '\\'': true,\n ';': true,\n '+': true,\n '-': true,\n '*': true,\n '.*': true,\n '/': true,\n './': true,\n '%': true,\n '^': true,\n '.^': true,\n '~': true,\n '!': true,\n '&': true,\n '|': true,\n '^|': true,\n '=': true,\n ':': true,\n '?': true,\n '==': true,\n '!=': true,\n '<': true,\n '>': true,\n '<=': true,\n '>=': true,\n '<<': true,\n '>>': true,\n '>>>': true\n };\n\n // map with all named delimiters\n var NAMED_DELIMITERS = {\n mod: true,\n to: true,\n in: true,\n and: true,\n xor: true,\n or: true,\n not: true\n };\n var CONSTANTS = {\n true: true,\n false: false,\n null: null,\n undefined\n };\n var NUMERIC_CONSTANTS = ['NaN', 'Infinity'];\n var ESCAPE_CHARACTERS = {\n '\"': '\"',\n \"'\": \"'\",\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t'\n // note that \\u is handled separately in parseStringToken()\n };\n function initialState() {\n return {\n extraNodes: {},\n // current extra nodes, must be careful not to mutate\n expression: '',\n // current expression\n comment: '',\n // last parsed comment\n index: 0,\n // current index in expr\n token: '',\n // current token\n tokenType: TOKENTYPE.NULL,\n // type of the token\n nestingLevel: 0,\n // level of nesting inside parameters, used to ignore newline characters\n conditionalLevel: null // when a conditional is being parsed, the level of the conditional is stored here\n };\n }\n\n /**\n * View upto `length` characters of the expression starting at the current character.\n *\n * @param {Object} state\n * @param {number} [length=1] Number of characters to view\n * @returns {string}\n * @private\n */\n function currentString(state, length) {\n return state.expression.substr(state.index, length);\n }\n\n /**\n * View the current character. Returns '' if end of expression is reached.\n *\n * @param {Object} state\n * @returns {string}\n * @private\n */\n function currentCharacter(state) {\n return currentString(state, 1);\n }\n\n /**\n * Get the next character from the expression.\n * The character is stored into the char c. If the end of the expression is\n * reached, the function puts an empty string in c.\n * @private\n */\n function next(state) {\n state.index++;\n }\n\n /**\n * Preview the previous character from the expression.\n * @return {string} cNext\n * @private\n */\n function prevCharacter(state) {\n return state.expression.charAt(state.index - 1);\n }\n\n /**\n * Preview the next character from the expression.\n * @return {string} cNext\n * @private\n */\n function nextCharacter(state) {\n return state.expression.charAt(state.index + 1);\n }\n\n /**\n * Get next token in the current string expr.\n * The token and token type are available as token and tokenType\n * @private\n */\n function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = '';\n\n // skip over ignored characters:\n while (true) {\n // comments:\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n }\n // whitespace: space, tab, and newline when inside parameters\n if (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } else {\n break;\n }\n }\n\n // check for end of expression\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER;\n\n // check for binary, octal, or hex\n var _c = currentString(state, 2);\n if (_c === '0b' || _c === '0o' || _c === '0x') {\n state.token += currentCharacter(state);\n next(state);\n state.token += currentCharacter(state);\n next(state);\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.';\n next(state);\n // get the digits after the radix\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i';\n next(state);\n // get the word size\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n return;\n }\n\n // get number, can have a single dot\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n }\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (hasOwnProperty(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n state.tokenType = TOKENTYPE.UNKNOWN;\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }\n\n /**\n * Get next token and skip newline tokens\n */\n function getTokenSkipNewline(state) {\n do {\n getToken(state);\n } while (state.token === '\\n'); // eslint-disable-line no-unmodified-loop-condition\n }\n\n /**\n * Open parameters.\n * New line characters will be ignored until closeParams(state) is called\n */\n function openParams(state) {\n state.nestingLevel++;\n }\n\n /**\n * Close parameters.\n * New line characters will no longer be ignored\n */\n function closeParams(state) {\n state.nestingLevel--;\n }\n\n /**\n * Checks whether the current character `c` is a valid alpha character:\n *\n * - A latin letter (upper or lower case) Ascii: a-z, A-Z\n * - An underscore Ascii: _\n * - A dollar sign Ascii: $\n * - A latin letter with accents Unicode: \\u00C0 - \\u02AF\n * - A greek letter Unicode: \\u0370 - \\u03FF\n * - A mathematical alphanumeric symbol Unicode: \\u{1D400} - \\u{1D7FF} excluding invalid code points\n *\n * The previous and next characters are needed to determine whether\n * this character is part of a unicode surrogate pair.\n *\n * @param {string} c Current character in the expression\n * @param {string} cPrev Previous character\n * @param {string} cNext Next character\n * @return {boolean}\n */\n parse.isAlpha = function isAlpha(c, cPrev, cNext) {\n return parse.isValidLatinOrGreek(c) || parse.isValidMathSymbol(c, cNext) || parse.isValidMathSymbol(cPrev, c);\n };\n\n /**\n * Test whether a character is a valid latin, greek, or letter-like character\n * @param {string} c\n * @return {boolean}\n */\n parse.isValidLatinOrGreek = function isValidLatinOrGreek(c) {\n return /^[a-zA-Z_$\\u00C0-\\u02AF\\u0370-\\u03FF\\u2100-\\u214F]$/.test(c);\n };\n\n /**\n * Test whether two given 16 bit characters form a surrogate pair of a\n * unicode math symbol.\n *\n * https://unicode-table.com/en/\n * https://www.wikiwand.com/en/Mathematical_operators_and_symbols_in_Unicode\n *\n * Note: In ES6 will be unicode aware:\n * https://stackoverflow.com/questions/280712/javascript-unicode-regexes\n * https://mathiasbynens.be/notes/es6-unicode-regex\n *\n * @param {string} high\n * @param {string} low\n * @return {boolean}\n */\n parse.isValidMathSymbol = function isValidMathSymbol(high, low) {\n return /^[\\uD835]$/.test(high) && /^[\\uDC00-\\uDFFF]$/.test(low) && /^[^\\uDC55\\uDC9D\\uDCA0\\uDCA1\\uDCA3\\uDCA4\\uDCA7\\uDCA8\\uDCAD\\uDCBA\\uDCBC\\uDCC4\\uDD06\\uDD0B\\uDD0C\\uDD15\\uDD1D\\uDD3A\\uDD3F\\uDD45\\uDD47-\\uDD49\\uDD51\\uDEA6\\uDEA7\\uDFCC\\uDFCD]$/.test(low);\n };\n\n /**\n * Check whether given character c is a white space character: space, tab, or enter\n * @param {string} c\n * @param {number} nestingLevel\n * @return {boolean}\n */\n parse.isWhitespace = function isWhitespace(c, nestingLevel) {\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n return c === ' ' || c === '\\t' || c === '\\n' && nestingLevel > 0;\n };\n\n /**\n * Test whether the character c is a decimal mark (dot).\n * This is the case when it's not the start of a delimiter '.*', './', or '.^'\n * @param {string} c\n * @param {string} cNext\n * @return {boolean}\n */\n parse.isDecimalMark = function isDecimalMark(c, cNext) {\n return c === '.' && cNext !== '/' && cNext !== '*' && cNext !== '^';\n };\n\n /**\n * checks if the given char c is a digit or dot\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigitDot = function isDigitDot(c) {\n return c >= '0' && c <= '9' || c === '.';\n };\n\n /**\n * checks if the given char c is a digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigit = function isDigit(c) {\n return c >= '0' && c <= '9';\n };\n\n /**\n * checks if the given char c is a hex digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isHexDigit = function isHexDigit(c) {\n return c >= '0' && c <= '9' || c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F';\n };\n\n /**\n * Start of the parse levels below, in order of precedence\n * @return {Node} node\n * @private\n */\n function parseStart(expression, extraNodes) {\n var state = initialState();\n _extends(state, {\n expression,\n extraNodes\n });\n getToken(state);\n var node = parseBlock(state);\n\n // check for garbage at the end of the expression\n // an expression ends with a empty character '' and tokenType DELIMITER\n if (state.token !== '') {\n if (state.tokenType === TOKENTYPE.DELIMITER) {\n // user entered a not existing operator like \"//\"\n\n // TODO: give hints for aliases, for example with \"<>\" give as hint \" did you mean !== ?\"\n throw createError(state, 'Unexpected operator ' + state.token);\n } else {\n throw createSyntaxError(state, 'Unexpected part \"' + state.token + '\"');\n }\n }\n return node;\n }\n\n /**\n * Parse a block with expressions. Expressions can be separated by a newline\n * character '\\n', or by a semicolon ';'. In case of a semicolon, no output\n * of the preceding line is returned.\n * @return {Node} node\n * @private\n */\n function parseBlock(state) {\n var node;\n var blocks = [];\n var visible;\n if (state.token !== '' && state.token !== '\\n' && state.token !== ';') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n\n // TODO: simplify this loop\n while (state.token === '\\n' || state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n if (blocks.length === 0 && node) {\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n getToken(state);\n if (state.token !== '\\n' && state.token !== ';' && state.token !== '') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n }\n if (blocks.length > 0) {\n return new BlockNode(blocks);\n } else {\n if (!node) {\n node = new ConstantNode(undefined);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n return node;\n }\n }\n\n /**\n * Assignment of a function or variable,\n * - can be a variable like 'a=2.3'\n * - or a updating an existing variable like 'matrix(2,3:5)=[6,7,8]'\n * - defining a function like 'f(x) = x^2'\n * @return {Node} node\n * @private\n */\n function parseAssignment(state) {\n var name, args, value, valid;\n var node = parseConditional(state);\n if (state.token === '=') {\n if (isSymbolNode(node)) {\n // parse a variable assignment like 'a = 2/3'\n name = node.name;\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(new SymbolNode(name), value);\n } else if (isAccessorNode(node)) {\n // parse a matrix subset assignment like 'A[1,2] = 4'\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(node.object, node.index, value);\n } else if (isFunctionNode(node) && isSymbolNode(node.fn)) {\n // parse function assignment like 'f(x) = x^2'\n valid = true;\n args = [];\n name = node.name;\n node.args.forEach(function (arg, index) {\n if (isSymbolNode(arg)) {\n args[index] = arg.name;\n } else {\n valid = false;\n }\n });\n if (valid) {\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new FunctionAssignmentNode(name, args, value);\n }\n }\n throw createSyntaxError(state, 'Invalid left hand side of assignment operator =');\n }\n return node;\n }\n\n /**\n * conditional operation\n *\n * condition ? truePart : falsePart\n *\n * Note: conditional operator is right-associative\n *\n * @return {Node} node\n * @private\n */\n function parseConditional(state) {\n var node = parseLogicalOr(state);\n while (state.token === '?') {\n // eslint-disable-line no-unmodified-loop-condition\n // set a conditional level, the range operator will be ignored as long\n // as conditionalLevel === state.nestingLevel.\n var prev = state.conditionalLevel;\n state.conditionalLevel = state.nestingLevel;\n getTokenSkipNewline(state);\n var condition = node;\n var trueExpr = parseAssignment(state);\n if (state.token !== ':') throw createSyntaxError(state, 'False part of conditional expression expected');\n state.conditionalLevel = null;\n getTokenSkipNewline(state);\n var falseExpr = parseAssignment(state); // Note: check for conditional operator again, right associativity\n\n node = new ConditionalNode(condition, trueExpr, falseExpr);\n\n // restore the previous conditional level\n state.conditionalLevel = prev;\n }\n return node;\n }\n\n /**\n * logical or, 'x or y'\n * @return {Node} node\n * @private\n */\n function parseLogicalOr(state) {\n var node = parseLogicalXor(state);\n while (state.token === 'or') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('or', 'or', [node, parseLogicalXor(state)]);\n }\n return node;\n }\n\n /**\n * logical exclusive or, 'x xor y'\n * @return {Node} node\n * @private\n */\n function parseLogicalXor(state) {\n var node = parseLogicalAnd(state);\n while (state.token === 'xor') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('xor', 'xor', [node, parseLogicalAnd(state)]);\n }\n return node;\n }\n\n /**\n * logical and, 'x and y'\n * @return {Node} node\n * @private\n */\n function parseLogicalAnd(state) {\n var node = parseBitwiseOr(state);\n while (state.token === 'and') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('and', 'and', [node, parseBitwiseOr(state)]);\n }\n return node;\n }\n\n /**\n * bitwise or, 'x | y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseOr(state) {\n var node = parseBitwiseXor(state);\n while (state.token === '|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('|', 'bitOr', [node, parseBitwiseXor(state)]);\n }\n return node;\n }\n\n /**\n * bitwise exclusive or (xor), 'x ^| y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseXor(state) {\n var node = parseBitwiseAnd(state);\n while (state.token === '^|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('^|', 'bitXor', [node, parseBitwiseAnd(state)]);\n }\n return node;\n }\n\n /**\n * bitwise and, 'x & y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseAnd(state) {\n var node = parseRelational(state);\n while (state.token === '&') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('&', 'bitAnd', [node, parseRelational(state)]);\n }\n return node;\n }\n\n /**\n * Parse a chained conditional, like 'a > b >= c'\n * @return {Node} node\n */\n function parseRelational(state) {\n var params = [parseShift(state)];\n var conditionals = [];\n var operators = {\n '==': 'equal',\n '!=': 'unequal',\n '<': 'smaller',\n '>': 'larger',\n '<=': 'smallerEq',\n '>=': 'largerEq'\n };\n while (hasOwnProperty(operators, state.token)) {\n // eslint-disable-line no-unmodified-loop-condition\n var cond = {\n name: state.token,\n fn: operators[state.token]\n };\n conditionals.push(cond);\n getTokenSkipNewline(state);\n params.push(parseShift(state));\n }\n if (params.length === 1) {\n return params[0];\n } else if (params.length === 2) {\n return new OperatorNode(conditionals[0].name, conditionals[0].fn, params);\n } else {\n return new RelationalNode(conditionals.map(c => c.fn), params);\n }\n }\n\n /**\n * Bitwise left shift, bitwise right arithmetic shift, bitwise right logical shift\n * @return {Node} node\n * @private\n */\n function parseShift(state) {\n var node, name, fn, params;\n node = parseConversion(state);\n var operators = {\n '<<': 'leftShift',\n '>>': 'rightArithShift',\n '>>>': 'rightLogShift'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n params = [node, parseConversion(state)];\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * conversion operators 'to' and 'in'\n * @return {Node} node\n * @private\n */\n function parseConversion(state) {\n var node, name, fn, params;\n node = parseRange(state);\n var operators = {\n to: 'to',\n in: 'to' // alias of 'to'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n if (name === 'in' && state.token === '') {\n // end of expression -> this is the unit 'in' ('inch')\n node = new OperatorNode('*', 'multiply', [node, new SymbolNode('in')], true);\n } else {\n // operator 'a to b' or 'a in b'\n params = [node, parseRange(state)];\n node = new OperatorNode(name, fn, params);\n }\n }\n return node;\n }\n\n /**\n * parse range, \"start:end\", \"start:step:end\", \":\", \"start:\", \":end\", etc\n * @return {Node} node\n * @private\n */\n function parseRange(state) {\n var node;\n var params = [];\n if (state.token === ':') {\n // implicit start=1 (one-based)\n node = new ConstantNode(1);\n } else {\n // explicit start\n node = parseAddSubtract(state);\n }\n if (state.token === ':' && state.conditionalLevel !== state.nestingLevel) {\n // we ignore the range operator when a conditional operator is being processed on the same level\n params.push(node);\n\n // parse step and end\n while (state.token === ':' && params.length < 3) {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n if (state.token === ')' || state.token === ']' || state.token === ',' || state.token === '') {\n // implicit end\n params.push(new SymbolNode('end'));\n } else {\n // explicit end\n params.push(parseAddSubtract(state));\n }\n }\n if (params.length === 3) {\n // params = [start, step, end]\n node = new RangeNode(params[0], params[2], params[1]); // start, end, step\n } else {\n // length === 2\n // params = [start, end]\n node = new RangeNode(params[0], params[1]); // start, end\n }\n }\n return node;\n }\n\n /**\n * add or subtract\n * @return {Node} node\n * @private\n */\n function parseAddSubtract(state) {\n var node, name, fn, params;\n node = parseMultiplyDivide(state);\n var operators = {\n '+': 'add',\n '-': 'subtract'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n var rightNode = parseMultiplyDivide(state);\n if (rightNode.isPercentage) {\n params = [node, new OperatorNode('*', 'multiply', [node, rightNode])];\n } else {\n params = [node, rightNode];\n }\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * multiply, divide\n * @return {Node} node\n * @private\n */\n function parseMultiplyDivide(state) {\n var node, last, name, fn;\n node = parseImplicitMultiplication(state);\n last = node;\n var operators = {\n '*': 'multiply',\n '.*': 'dotMultiply',\n '/': 'divide',\n './': 'dotDivide'\n };\n while (true) {\n if (hasOwnProperty(operators, state.token)) {\n // explicit operators\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n last = parseImplicitMultiplication(state);\n node = new OperatorNode(name, fn, [node, last]);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * implicit multiplication\n * @return {Node} node\n * @private\n */\n function parseImplicitMultiplication(state) {\n var node, last;\n node = parseRule2(state);\n last = node;\n while (true) {\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === 'in' && isConstantNode(node) || state.tokenType === TOKENTYPE.NUMBER && !isConstantNode(last) && (!isOperatorNode(last) || last.op === '!') || state.token === '(') {\n // parse implicit multiplication\n //\n // symbol: implicit multiplication like '2a', '(2+3)a', 'a b'\n // number: implicit multiplication like '(2+3)2'\n // parenthesis: implicit multiplication like '2(3+4)', '(3+4)(1+2)'\n last = parseRule2(state);\n node = new OperatorNode('*', 'multiply', [node, last], true /* implicit */);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * Infamous \"rule 2\" as described in https://github.com/josdejong/mathjs/issues/792#issuecomment-361065370\n * And as amended in https://github.com/josdejong/mathjs/issues/2370#issuecomment-1054052164\n * Explicit division gets higher precedence than implicit multiplication\n * when the division matches this pattern:\n * [unaryPrefixOp]?[number] / [number] [symbol]\n * @return {Node} node\n * @private\n */\n function parseRule2(state) {\n var node = parseModulusPercentage(state);\n var last = node;\n var tokenStates = [];\n while (true) {\n // Match the \"number /\" part of the pattern \"number / number symbol\"\n if (state.token === '/' && rule2Node(last)) {\n // Look ahead to see if the next token is a number\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"number / number\" part of the pattern\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // Look ahead again\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"symbol\" part of the pattern, or a left parenthesis\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === '(') {\n // We've matched the pattern \"number / number symbol\".\n // Rewind once and build the \"number / number\" node; the symbol will be consumed later\n _extends(state, tokenStates.pop());\n tokenStates.pop();\n last = parseModulusPercentage(state);\n node = new OperatorNode('/', 'divide', [node, last]);\n } else {\n // Not a match, so rewind\n tokenStates.pop();\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n // Not a match, so rewind\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * modulus and percentage\n * @return {Node} node\n * @private\n */\n function parseModulusPercentage(state) {\n var node, name, fn, params;\n node = parseUnary(state);\n var operators = {\n '%': 'mod',\n mod: 'mod'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n if (name === '%' && state.tokenType === TOKENTYPE.DELIMITER && state.token !== '(') {\n // If the expression contains only %, then treat that as /100\n node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true);\n } else {\n params = [node, parseUnary(state)];\n node = new OperatorNode(name, fn, params);\n }\n }\n return node;\n }\n\n /**\n * Unary plus and minus, and logical and bitwise not\n * @return {Node} node\n * @private\n */\n function parseUnary(state) {\n var name, params, fn;\n var operators = {\n '-': 'unaryMinus',\n '+': 'unaryPlus',\n '~': 'bitNot',\n not: 'not'\n };\n if (hasOwnProperty(operators, state.token)) {\n fn = operators[state.token];\n name = state.token;\n getTokenSkipNewline(state);\n params = [parseUnary(state)];\n return new OperatorNode(name, fn, params);\n }\n return parsePow(state);\n }\n\n /**\n * power\n * Note: power operator is right associative\n * @return {Node} node\n * @private\n */\n function parsePow(state) {\n var node, name, fn, params;\n node = parseLeftHandOperators(state);\n if (state.token === '^' || state.token === '.^') {\n name = state.token;\n fn = name === '^' ? 'pow' : 'dotPow';\n getTokenSkipNewline(state);\n params = [node, parseUnary(state)]; // Go back to unary, we can have '2^-3'\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * Left hand operators: factorial x!, ctranspose x'\n * @return {Node} node\n * @private\n */\n function parseLeftHandOperators(state) {\n var node, name, fn, params;\n node = parseCustomNodes(state);\n var operators = {\n '!': 'factorial',\n '\\'': 'ctranspose'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getToken(state);\n params = [node];\n node = new OperatorNode(name, fn, params);\n node = parseAccessors(state, node);\n }\n return node;\n }\n\n /**\n * Parse a custom node handler. A node handler can be used to process\n * nodes in a custom way, for example for handling a plot.\n *\n * A handler must be passed as second argument of the parse function.\n * - must extend math.Node\n * - must contain a function _compile(defs: Object) : string\n * - must contain a function find(filter: Object) : Node[]\n * - must contain a function toString() : string\n * - the constructor is called with a single argument containing all parameters\n *\n * For example:\n *\n * nodes = {\n * 'plot': PlotHandler\n * }\n *\n * The constructor of the handler is called as:\n *\n * node = new PlotHandler(params)\n *\n * The handler will be invoked when evaluating an expression like:\n *\n * node = math.parse('plot(sin(x), x)', nodes)\n *\n * @return {Node} node\n * @private\n */\n function parseCustomNodes(state) {\n var params = [];\n if (state.tokenType === TOKENTYPE.SYMBOL && hasOwnProperty(state.extraNodes, state.token)) {\n var CustomNode = state.extraNodes[state.token];\n getToken(state);\n\n // parse parameters\n if (state.token === '(') {\n params = [];\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n }\n\n // create a new custom node\n // noinspection JSValidateTypes\n return new CustomNode(params);\n }\n return parseSymbol(state);\n }\n\n /**\n * parse symbols: functions, variables, constants, units\n * @return {Node} node\n * @private\n */\n function parseSymbol(state) {\n var node, name;\n if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n name = state.token;\n getToken(state);\n if (hasOwnProperty(CONSTANTS, name)) {\n // true, false, null, ...\n node = new ConstantNode(CONSTANTS[name]);\n } else if (NUMERIC_CONSTANTS.includes(name)) {\n // NaN, Infinity\n node = new ConstantNode(numeric(name, 'number'));\n } else {\n node = new SymbolNode(name);\n }\n\n // parse function parameters and matrix index\n node = parseAccessors(state, node);\n return node;\n }\n return parseString(state);\n }\n\n /**\n * parse accessors:\n * - function invocation in round brackets (...), for example sqrt(2)\n * - index enclosed in square brackets [...], for example A[2,3]\n * - dot notation for properties, like foo.bar\n * @param {Object} state\n * @param {Node} node Node on which to apply the parameters. If there\n * are no parameters in the expression, the node\n * itself is returned\n * @param {string[]} [types] Filter the types of notations\n * can be ['(', '[', '.']\n * @return {Node} node\n * @private\n */\n function parseAccessors(state, node, types) {\n var params;\n while ((state.token === '(' || state.token === '[' || state.token === '.') && (!types || types.includes(state.token))) {\n // eslint-disable-line no-unmodified-loop-condition\n params = [];\n if (state.token === '(') {\n if (isSymbolNode(node) || isAccessorNode(node)) {\n // function invocation like fn(2, 3) or obj.fn(2, 3)\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new FunctionNode(node, params);\n } else {\n // implicit multiplication like (2+3)(4+5) or sqrt(2)(1+2)\n // don't parse it here but let it be handled by parseImplicitMultiplication\n // with correct precedence\n return node;\n }\n } else if (state.token === '[') {\n // index notation like variable[2, 3]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'Parenthesis ] expected');\n }\n closeParams(state);\n getToken(state);\n node = new AccessorNode(node, new IndexNode(params));\n } else {\n // dot notation like variable.prop\n getToken(state);\n var isPropertyName = state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS;\n if (!isPropertyName) {\n throw createSyntaxError(state, 'Property name expected after dot');\n }\n params.push(new ConstantNode(state.token));\n getToken(state);\n var dotNotation = true;\n node = new AccessorNode(node, new IndexNode(params, dotNotation));\n }\n }\n return node;\n }\n\n /**\n * Parse a single or double quoted string.\n * @return {Node} node\n * @private\n */\n function parseString(state) {\n var node, str;\n if (state.token === '\"' || state.token === \"'\") {\n str = parseStringToken(state, state.token);\n\n // create constant\n node = new ConstantNode(str);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseMatrix(state);\n }\n\n /**\n * Parse a string surrounded by single or double quotes\n * @param {Object} state\n * @param {\"'\" | \"\\\"\"} quote\n * @return {string}\n */\n function parseStringToken(state, quote) {\n var str = '';\n while (currentCharacter(state) !== '' && currentCharacter(state) !== quote) {\n if (currentCharacter(state) === '\\\\') {\n next(state);\n var char = currentCharacter(state);\n var escapeChar = ESCAPE_CHARACTERS[char];\n if (escapeChar !== undefined) {\n // an escaped control character like \\\" or \\n\n str += escapeChar;\n state.index += 1;\n } else if (char === 'u') {\n // escaped unicode character\n var unicode = state.expression.slice(state.index + 1, state.index + 5);\n if (/^[0-9A-Fa-f]{4}$/.test(unicode)) {\n // test whether the string holds four hexadecimal values\n str += String.fromCharCode(parseInt(unicode, 16));\n state.index += 5;\n } else {\n throw createSyntaxError(state, \"Invalid unicode character \\\\u\".concat(unicode));\n }\n } else {\n throw createSyntaxError(state, \"Bad escape character \\\\\".concat(char));\n }\n } else {\n // any regular character\n str += currentCharacter(state);\n next(state);\n }\n }\n getToken(state);\n if (state.token !== quote) {\n throw createSyntaxError(state, \"End of string \".concat(quote, \" expected\"));\n }\n getToken(state);\n return str;\n }\n\n /**\n * parse the matrix\n * @return {Node} node\n * @private\n */\n function parseMatrix(state) {\n var array, params, rows, cols;\n if (state.token === '[') {\n // matrix [...]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n // this is a non-empty matrix\n var row = parseRow(state);\n if (state.token === ';') {\n // 2 dimensional array\n rows = 1;\n params = [row];\n\n // the rows of the matrix are separated by dot-comma's\n while (state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n if (state.token !== ']') {\n params[rows] = parseRow(state);\n rows++;\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n\n // check if the number of columns matches in all rows\n cols = params[0].items.length;\n for (var r = 1; r < rows; r++) {\n if (params[r].items.length !== cols) {\n throw createError(state, 'Column dimensions mismatch ' + '(' + params[r].items.length + ' !== ' + cols + ')');\n }\n }\n array = new ArrayNode(params);\n } else {\n // 1 dimensional vector\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n array = row;\n }\n } else {\n // this is an empty matrix \"[ ]\"\n closeParams(state);\n getToken(state);\n array = new ArrayNode([]);\n }\n return parseAccessors(state, array);\n }\n return parseObject(state);\n }\n\n /**\n * Parse a single comma-separated row from a matrix, like 'a, b, c'\n * @return {ArrayNode} node\n */\n function parseRow(state) {\n var params = [parseAssignment(state)];\n var len = 1;\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n\n // parse expression\n if (state.token !== ']' && state.token !== ';') {\n params[len] = parseAssignment(state);\n len++;\n }\n }\n return new ArrayNode(params);\n }\n\n /**\n * parse an object, enclosed in angle brackets{...}, for example {value: 2}\n * @return {Node} node\n * @private\n */\n function parseObject(state) {\n if (state.token === '{') {\n openParams(state);\n var key;\n var properties = {};\n do {\n getToken(state);\n if (state.token !== '}') {\n // parse key\n if (state.token === '\"' || state.token === \"'\") {\n key = parseStringToken(state, state.token);\n } else if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n key = state.token;\n getToken(state);\n } else {\n throw createSyntaxError(state, 'Symbol or string expected as object key');\n }\n\n // parse key/value separator\n if (state.token !== ':') {\n throw createSyntaxError(state, 'Colon : expected after object key');\n }\n getToken(state);\n\n // parse key\n properties[key] = parseAssignment(state);\n }\n } while (state.token === ','); // eslint-disable-line no-unmodified-loop-condition\n\n if (state.token !== '}') {\n throw createSyntaxError(state, 'Comma , or bracket } expected after object value');\n }\n closeParams(state);\n getToken(state);\n var node = new ObjectNode(properties);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseNumber(state);\n }\n\n /**\n * parse a number\n * @return {Node} node\n * @private\n */\n function parseNumber(state) {\n var numberStr;\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // this is a number\n numberStr = state.token;\n getToken(state);\n var numericType = safeNumberType(numberStr, config);\n var value = numeric(numberStr, numericType);\n return new ConstantNode(value);\n }\n return parseParentheses(state);\n }\n\n /**\n * parentheses\n * @return {Node} node\n * @private\n */\n function parseParentheses(state) {\n var node;\n\n // check if it is a parenthesized expression\n if (state.token === '(') {\n // parentheses (...)\n openParams(state);\n getToken(state);\n node = parseAssignment(state); // start again\n\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new ParenthesisNode(node);\n node = parseAccessors(state, node);\n return node;\n }\n return parseEnd(state);\n }\n\n /**\n * Evaluated when the expression is not yet ended but expected to end\n * @return {Node} res\n * @private\n */\n function parseEnd(state) {\n if (state.token === '') {\n // syntax error or unexpected end of expression\n throw createSyntaxError(state, 'Unexpected end of expression');\n } else {\n throw createSyntaxError(state, 'Value expected');\n }\n }\n\n /**\n * Shortcut for getting the current row value (one based)\n * Returns the line of the currently handled expression\n * @private\n */\n /* TODO: implement keeping track on the row number\n function row () {\n return null\n }\n */\n\n /**\n * Shortcut for getting the current col value (one based)\n * Returns the column (position) where the last state.token starts\n * @private\n */\n function col(state) {\n return state.index - state.token.length + 1;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {SyntaxError} instantiated error\n * @private\n */\n function createSyntaxError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {Error} instantiated error\n * @private\n */\n function createError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n // Now that we can parse, automatically convert strings to Nodes by parsing\n typed.addConversion({\n from: 'string',\n to: 'Node',\n convert: parse\n });\n return parse;\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'compile';\nvar dependencies = ['typed', 'parse'];\nexport var createCompile = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Parse and compile an expression.\n * Returns a an object with a function `evaluate([scope])` to evaluate the\n * compiled expression.\n *\n * Syntax:\n *\n * math.compile(expr) // returns one node\n * math.compile([expr1, expr2, expr3, ...]) // returns an array with nodes\n *\n * Examples:\n *\n * const code1 = math.compile('sqrt(3^2 + 4^2)')\n * code1.evaluate() // 5\n *\n * let scope = {a: 3, b: 4}\n * const code2 = math.compile('a * b') // 12\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.compile(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].evaluate() // 12\n *\n * See also:\n *\n * parse, evaluate\n *\n * @param {string | string[] | Array | Matrix} expr\n * The expression to be compiled\n * @return {{evaluate: Function} | Array.<{evaluate: Function}>} code\n * An object with the compiled expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n return parse(expr).compile();\n },\n 'Array | Matrix': function ArrayMatrix(expr) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile();\n });\n }\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { createEmptyMap } from '../../utils/map.js';\nvar name = 'evaluate';\nvar dependencies = ['typed', 'parse'];\nexport var createEvaluate = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Evaluate an expression.\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.evaluate(expr)\n * math.evaluate(expr, scope)\n * math.evaluate([expr1, expr2, expr3, ...])\n * math.evaluate([expr1, expr2, expr3, ...], scope)\n *\n * Example:\n *\n * math.evaluate('(2+3)/4') // 1.25\n * math.evaluate('sqrt(3^2 + 4^2)') // 5\n * math.evaluate('sqrt(-4)') // 2i\n * math.evaluate(['a=3', 'b=4', 'a*b']) // [3, 4, 12]\n *\n * let scope = {a:3, b:4}\n * math.evaluate('a * b', scope) // 12\n *\n * See also:\n *\n * parse, compile\n *\n * @param {string | string[] | Matrix} expr The expression to be evaluated\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} The result of the expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n var scope = createEmptyMap();\n return parse(expr).compile().evaluate(scope);\n },\n 'string, Map | Object': function stringMapObject(expr, scope) {\n return parse(expr).compile().evaluate(scope);\n },\n 'Array | Matrix': function ArrayMatrix(expr) {\n var scope = createEmptyMap();\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n },\n 'Array | Matrix, Map | Object': function ArrayMatrixMapObject(expr, scope) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n }\n });\n});", "import { factory } from '../utils/factory.js';\nimport { createEmptyMap, toObject } from '../utils/map.js';\nvar name = 'Parser';\nvar dependencies = ['evaluate'];\nexport var createParserClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate\n } = _ref;\n /**\n * @constructor Parser\n * Parser contains methods to evaluate or parse expressions, and has a number\n * of convenience methods to get, set, and remove variables from memory. Parser\n * keeps a scope containing variables in memory, which is used for all\n * evaluations.\n *\n * Methods:\n * const result = parser.evaluate(expr) // evaluate an expression\n * const value = parser.get(name) // retrieve a variable from the parser\n * const values = parser.getAll() // retrieve all defined variables\n * parser.set(name, value) // set a variable in the parser\n * parser.remove(name) // clear a variable from the\n * // parsers scope\n * parser.clear() // clear the parsers scope\n *\n * Example usage:\n * const parser = new Parser()\n * // Note: there is a convenience method which can be used instead:\n * // const parser = new math.parser()\n *\n * // evaluate expressions\n * parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * parser.evaluate('sqrt(-4)') // 2i\n * parser.evaluate('2 inch in cm') // 5.08 cm\n * parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n */\n function Parser() {\n if (!(this instanceof Parser)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n Object.defineProperty(this, 'scope', {\n value: createEmptyMap(),\n writable: false\n });\n }\n\n /**\n * Attach type information\n */\n Parser.prototype.type = 'Parser';\n Parser.prototype.isParser = true;\n\n /**\n * Parse and evaluate the given expression\n * @param {string | string[]} expr A string containing an expression,\n * for example \"2+3\", or a list with expressions\n * @return {*} result The result, or undefined when the expression was empty\n * @throws {Error}\n */\n Parser.prototype.evaluate = function (expr) {\n // TODO: validate arguments\n return evaluate(expr, this.scope);\n };\n\n /**\n * Get a variable (a function or variable) by name from the parsers scope.\n * Returns undefined when not found\n * @param {string} name\n * @return {* | undefined} value\n */\n Parser.prototype.get = function (name) {\n // TODO: validate arguments\n if (this.scope.has(name)) {\n return this.scope.get(name);\n }\n };\n\n /**\n * Get a map with all defined variables\n * @return {Object} values\n */\n Parser.prototype.getAll = function () {\n return toObject(this.scope);\n };\n\n /**\n * Get a map with all defined variables\n * @return {Map} values\n */\n Parser.prototype.getAllAsMap = function () {\n return this.scope;\n };\n\n /**\n * Set a symbol (a function or variable) by name from the parsers scope.\n * @param {string} name\n * @param {* | undefined} value\n */\n Parser.prototype.set = function (name, value) {\n this.scope.set(name, value);\n return value;\n };\n\n /**\n * Remove a variable from the parsers scope\n * @param {string} name\n */\n Parser.prototype.remove = function (name) {\n this.scope.delete(name);\n };\n\n /**\n * Clear the scope with variables and functions\n */\n Parser.prototype.clear = function () {\n this.scope.clear();\n };\n return Parser;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'parser';\nvar dependencies = ['typed', 'Parser'];\nexport var createParser = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Parser\n } = _ref;\n /**\n * Create a parser. The function creates a new `math.Parser` object.\n *\n * Syntax:\n *\n * math.parser()\n *\n * Examples:\n *\n * const parser = new math.parser()\n *\n * // evaluate expressions\n * const a = parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * const b = parser.evaluate('sqrt(-4)') // 2i\n * const c = parser.evaluate('2 inch in cm') // 5.08 cm\n * const d = parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n * See also:\n *\n * evaluate, compile, parse\n *\n * @return {Parser} Parser\n */\n return typed(name, {\n '': function _() {\n return new Parser();\n }\n });\n});", "import { clone } from '../../../utils/object.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'lup';\nvar dependencies = ['typed', 'matrix', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'larger', 'equalScalar', 'unaryMinus', 'DenseMatrix', 'SparseMatrix', 'Spa'];\nexport var createLup = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n abs,\n addScalar,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n larger,\n equalScalar,\n unaryMinus,\n DenseMatrix,\n SparseMatrix,\n Spa\n } = _ref;\n /**\n * Calculate the Matrix LU decomposition with partial pivoting. Matrix `A` is decomposed in two matrices (`L`, `U`) and a\n * row permutation vector `p` where `A[p,:] = L * U`\n *\n * Syntax:\n *\n * math.lup(A)\n *\n * Example:\n *\n * const m = [[2, 1], [1, 4]]\n * const r = math.lup(m)\n * // r = {\n * // L: [[1, 0], [0.5, 1]],\n * // U: [[2, 1], [0, 3.5]],\n * // P: [0, 1]\n * // }\n *\n * See also:\n *\n * slu, lsolve, lusolve, usolve\n *\n * @param {Matrix | Array} A A two dimensional matrix or array for which to get the LUP decomposition.\n *\n * @return {{L: Array | Matrix, U: Array | Matrix, P: Array.}} The lower triangular matrix, the upper triangular matrix and the permutation matrix.\n */\n return typed(name, {\n DenseMatrix: function DenseMatrix(m) {\n return _denseLUP(m);\n },\n SparseMatrix: function SparseMatrix(m) {\n return _sparseLUP(m);\n },\n Array: function Array(a) {\n // create dense matrix from array\n var m = matrix(a);\n // lup, use matrix implementation\n var r = _denseLUP(m);\n // result\n return {\n L: r.L.valueOf(),\n U: r.U.valueOf(),\n p: r.p\n };\n }\n });\n function _denseLUP(m) {\n // rows & columns\n var rows = m._size[0];\n var columns = m._size[1];\n // minimum rows and columns\n var n = Math.min(rows, columns);\n // matrix array, clone original data\n var data = clone(m._data);\n // l matrix arrays\n var ldata = [];\n var lsize = [rows, n];\n // u matrix arrays\n var udata = [];\n var usize = [n, columns];\n // vars\n var i, j, k;\n // permutation vector\n var p = [];\n for (i = 0; i < rows; i++) {\n p[i] = i;\n }\n // loop columns\n for (j = 0; j < columns; j++) {\n // skip first column in upper triangular matrix\n if (j > 0) {\n // loop rows\n for (i = 0; i < rows; i++) {\n // min i,j\n var min = Math.min(i, j);\n // v[i, j]\n var s = 0;\n // loop up to min\n for (k = 0; k < min; k++) {\n // s = l[i, k] - data[k, j]\n s = addScalar(s, multiplyScalar(data[i][k], data[k][j]));\n }\n data[i][j] = subtractScalar(data[i][j], s);\n }\n }\n // row with larger value in cvector, row >= j\n var pi = j;\n var pabsv = 0;\n var vjj = 0;\n // loop rows\n for (i = j; i < rows; i++) {\n // data @ i, j\n var v = data[i][j];\n // absolute value\n var absv = abs(v);\n // value is greater than pivote value\n if (larger(absv, pabsv)) {\n // store row\n pi = i;\n // update max value\n pabsv = absv;\n // value @ [j, j]\n vjj = v;\n }\n }\n // swap rows (j <-> pi)\n if (j !== pi) {\n // swap values j <-> pi in p\n p[j] = [p[pi], p[pi] = p[j]][0];\n // swap j <-> pi in data\n DenseMatrix._swapRows(j, pi, data);\n }\n // check column is in lower triangular matrix\n if (j < rows) {\n // loop rows (lower triangular matrix)\n for (i = j + 1; i < rows; i++) {\n // value @ i, j\n var vij = data[i][j];\n if (!equalScalar(vij, 0)) {\n // update data\n data[i][j] = divideScalar(data[i][j], vjj);\n }\n }\n }\n }\n // loop columns\n for (j = 0; j < columns; j++) {\n // loop rows\n for (i = 0; i < rows; i++) {\n // initialize row in arrays\n if (j === 0) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i] = [];\n }\n // L\n ldata[i] = [];\n }\n // check we are in the upper triangular matrix\n if (i < j) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = data[i][j];\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = 0;\n }\n continue;\n }\n // diagonal value\n if (i === j) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = data[i][j];\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = 1;\n }\n continue;\n }\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = 0;\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = data[i][j];\n }\n }\n }\n // l matrix\n var l = new DenseMatrix({\n data: ldata,\n size: lsize\n });\n // u matrix\n var u = new DenseMatrix({\n data: udata,\n size: usize\n });\n // p vector\n var pv = [];\n for (i = 0, n = p.length; i < n; i++) {\n pv[p[i]] = i;\n }\n // return matrices\n return {\n L: l,\n U: u,\n p: pv,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\nP: ' + this.p;\n }\n };\n }\n function _sparseLUP(m) {\n // rows & columns\n var rows = m._size[0];\n var columns = m._size[1];\n // minimum rows and columns\n var n = Math.min(rows, columns);\n // matrix arrays (will not be modified, thanks to permutation vector)\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // l matrix arrays\n var lvalues = [];\n var lindex = [];\n var lptr = [];\n var lsize = [rows, n];\n // u matrix arrays\n var uvalues = [];\n var uindex = [];\n var uptr = [];\n var usize = [n, columns];\n // vars\n var i, j, k;\n // permutation vectors, (current index -> original index) and (original index -> current index)\n var pvCo = [];\n var pvOc = [];\n for (i = 0; i < rows; i++) {\n pvCo[i] = i;\n pvOc[i] = i;\n }\n // swap indices in permutation vectors (condition x < y)!\n var swapIndeces = function swapIndeces(x, y) {\n // find pv indeces getting data from x and y\n var kx = pvOc[x];\n var ky = pvOc[y];\n // update permutation vector current -> original\n pvCo[kx] = y;\n pvCo[ky] = x;\n // update permutation vector original -> current\n pvOc[x] = ky;\n pvOc[y] = kx;\n };\n // loop columns\n var _loop = function _loop() {\n // sparse accumulator\n var spa = new Spa();\n // check lower triangular matrix has a value @ column j\n if (j < rows) {\n // update ptr\n lptr.push(lvalues.length);\n // first value in j column for lower triangular matrix\n lvalues.push(1);\n lindex.push(j);\n }\n // update ptr\n uptr.push(uvalues.length);\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // copy column j into sparse accumulator\n for (k = k0; k < k1; k++) {\n // row\n i = index[k];\n // copy column values into sparse accumulator (use permutation vector)\n spa.set(pvCo[i], values[k]);\n }\n // skip first column in upper triangular matrix\n if (j > 0) {\n // loop rows in column j (above diagonal)\n spa.forEach(0, j - 1, function (k, vkj) {\n // loop rows in column k (L)\n SparseMatrix._forEachRow(k, lvalues, lindex, lptr, function (i, vik) {\n // check row is below k\n if (i > k) {\n // update spa value\n spa.accumulate(i, unaryMinus(multiplyScalar(vik, vkj)));\n }\n });\n });\n }\n // row with larger value in spa, row >= j\n var pi = j;\n var vjj = spa.get(j);\n var pabsv = abs(vjj);\n // loop values in spa (order by row, below diagonal)\n spa.forEach(j + 1, rows - 1, function (x, v) {\n // absolute value\n var absv = abs(v);\n // value is greater than pivote value\n if (larger(absv, pabsv)) {\n // store row\n pi = x;\n // update max value\n pabsv = absv;\n // value @ [j, j]\n vjj = v;\n }\n });\n // swap rows (j <-> pi)\n if (j !== pi) {\n // swap values j <-> pi in L\n SparseMatrix._swapRows(j, pi, lsize[1], lvalues, lindex, lptr);\n // swap values j <-> pi in U\n SparseMatrix._swapRows(j, pi, usize[1], uvalues, uindex, uptr);\n // swap values in spa\n spa.swap(j, pi);\n // update permutation vector (swap values @ j, pi)\n swapIndeces(j, pi);\n }\n // loop values in spa (order by row)\n spa.forEach(0, rows - 1, function (x, v) {\n // check we are above diagonal\n if (x <= j) {\n // update upper triangular matrix\n uvalues.push(v);\n uindex.push(x);\n } else {\n // update value\n v = divideScalar(v, vjj);\n // check value is non zero\n if (!equalScalar(v, 0)) {\n // update lower triangular matrix\n lvalues.push(v);\n lindex.push(x);\n }\n }\n });\n };\n for (j = 0; j < columns; j++) {\n _loop();\n }\n // update ptrs\n uptr.push(uvalues.length);\n lptr.push(lvalues.length);\n\n // return matrices\n return {\n L: new SparseMatrix({\n values: lvalues,\n index: lindex,\n ptr: lptr,\n size: lsize\n }),\n U: new SparseMatrix({\n values: uvalues,\n index: uindex,\n ptr: uptr,\n size: usize\n }),\n p: pvCo,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\nP: ' + this.p;\n }\n };\n }\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../../../utils/factory.js';\nvar name = 'qr';\nvar dependencies = ['typed', 'matrix', 'zeros', 'identity', 'isZero', 'equal', 'sign', 'sqrt', 'conj', 'unaryMinus', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'complex'];\nexport var createQr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n identity,\n isZero,\n equal,\n sign,\n sqrt,\n conj,\n unaryMinus,\n addScalar,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n complex\n } = _ref;\n /**\n * Calculate the Matrix QR decomposition. Matrix `A` is decomposed in\n * two matrices (`Q`, `R`) where `Q` is an\n * orthogonal matrix and `R` is an upper triangular matrix.\n *\n * Syntax:\n *\n * math.qr(A)\n *\n * Example:\n *\n * const m = [\n * [1, -1, 4],\n * [1, 4, -2],\n * [1, 4, 2],\n * [1, -1, 0]\n * ]\n * const result = math.qr(m)\n * // r = {\n * // Q: [\n * // [0.5, -0.5, 0.5],\n * // [0.5, 0.5, -0.5],\n * // [0.5, 0.5, 0.5],\n * // [0.5, -0.5, -0.5],\n * // ],\n * // R: [\n * // [2, 3, 2],\n * // [0, 5, -2],\n * // [0, 0, 4],\n * // [0, 0, 0]\n * // ]\n * // }\n *\n * See also:\n *\n * lup, lusolve\n *\n * @param {Matrix | Array} A A two dimensional matrix or array\n * for which to get the QR decomposition.\n *\n * @return {{Q: Array | Matrix, R: Array | Matrix}} Q: the orthogonal\n * matrix and R: the upper triangular matrix\n */\n return _extends(typed(name, {\n DenseMatrix: function DenseMatrix(m) {\n return _denseQR(m);\n },\n SparseMatrix: function SparseMatrix(m) {\n return _sparseQR(m);\n },\n Array: function Array(a) {\n // create dense matrix from array\n var m = matrix(a);\n // lup, use matrix implementation\n var r = _denseQR(m);\n // result\n return {\n Q: r.Q.valueOf(),\n R: r.R.valueOf()\n };\n }\n }), {\n _denseQRimpl\n });\n function _denseQRimpl(m) {\n // rows & columns (m x n)\n var rows = m._size[0]; // m\n var cols = m._size[1]; // n\n\n var Q = identity([rows], 'dense');\n var Qdata = Q._data;\n var R = m.clone();\n var Rdata = R._data;\n\n // vars\n var i, j, k;\n var w = zeros([rows], '');\n for (k = 0; k < Math.min(cols, rows); ++k) {\n /*\n * **k-th Household matrix**\n *\n * The matrix I - 2*v*transpose(v)\n * x = first column of A\n * x1 = first element of x\n * alpha = x1 / |x1| * |x|\n * e1 = tranpose([1, 0, 0, ...])\n * u = x - alpha * e1\n * v = u / |u|\n *\n * Household matrix = I - 2 * v * tranpose(v)\n *\n * * Initially Q = I and R = A.\n * * Household matrix is a reflection in a plane normal to v which\n * will zero out all but the top right element in R.\n * * Appplying reflection to both Q and R will not change product.\n * * Repeat this process on the (1,1) minor to get R as an upper\n * triangular matrix.\n * * Reflections leave the magnitude of the columns of Q unchanged\n * so Q remains othoganal.\n *\n */\n\n var pivot = Rdata[k][k];\n var sgn = unaryMinus(equal(pivot, 0) ? 1 : sign(pivot));\n var conjSgn = conj(sgn);\n var alphaSquared = 0;\n for (i = k; i < rows; i++) {\n alphaSquared = addScalar(alphaSquared, multiplyScalar(Rdata[i][k], conj(Rdata[i][k])));\n }\n var alpha = multiplyScalar(sgn, sqrt(alphaSquared));\n if (!isZero(alpha)) {\n // first element in vector u\n var u1 = subtractScalar(pivot, alpha);\n\n // w = v * u1 / |u| (only elements k to (rows-1) are used)\n w[k] = 1;\n for (i = k + 1; i < rows; i++) {\n w[i] = divideScalar(Rdata[i][k], u1);\n }\n\n // tau = - conj(u1 / alpha)\n var tau = unaryMinus(conj(divideScalar(u1, alpha)));\n var s = void 0;\n\n /*\n * tau and w have been choosen so that\n *\n * 2 * v * tranpose(v) = tau * w * tranpose(w)\n */\n\n /*\n * -- calculate R = R - tau * w * tranpose(w) * R --\n * Only do calculation with rows k to (rows-1)\n * Additionally columns 0 to (k-1) will not be changed by this\n * multiplication so do not bother recalculating them\n */\n for (j = k; j < cols; j++) {\n s = 0.0;\n\n // calculate jth element of [tranpose(w) * R]\n for (i = k; i < rows; i++) {\n s = addScalar(s, multiplyScalar(conj(w[i]), Rdata[i][j]));\n }\n\n // calculate the jth element of [tau * transpose(w) * R]\n s = multiplyScalar(s, tau);\n for (i = k; i < rows; i++) {\n Rdata[i][j] = multiplyScalar(subtractScalar(Rdata[i][j], multiplyScalar(w[i], s)), conjSgn);\n }\n }\n /*\n * -- calculate Q = Q - tau * Q * w * transpose(w) --\n * Q is a square matrix (rows x rows)\n * Only do calculation with columns k to (rows-1)\n * Additionally rows 0 to (k-1) will not be changed by this\n * multiplication so do not bother recalculating them\n */\n for (i = 0; i < rows; i++) {\n s = 0.0;\n\n // calculate ith element of [Q * w]\n for (j = k; j < rows; j++) {\n s = addScalar(s, multiplyScalar(Qdata[i][j], w[j]));\n }\n\n // calculate the ith element of [tau * Q * w]\n s = multiplyScalar(s, tau);\n for (j = k; j < rows; ++j) {\n Qdata[i][j] = divideScalar(subtractScalar(Qdata[i][j], multiplyScalar(s, conj(w[j]))), conjSgn);\n }\n }\n }\n }\n\n // return matrices\n return {\n Q,\n R,\n toString: function toString() {\n return 'Q: ' + this.Q.toString() + '\\nR: ' + this.R.toString();\n }\n };\n }\n function _denseQR(m) {\n var ret = _denseQRimpl(m);\n var Rdata = ret.R._data;\n if (m._data.length > 0) {\n var zero = Rdata[0][0].type === 'Complex' ? complex(0) : 0;\n for (var i = 0; i < Rdata.length; ++i) {\n for (var j = 0; j < i && j < (Rdata[0] || []).length; ++j) {\n Rdata[i][j] = zero;\n }\n }\n }\n return ret;\n }\n function _sparseQR(m) {\n throw new Error('qr not implemented for sparse matrices yet');\n }\n});", "import { isInteger } from '../../../utils/number.js';\nimport { factory } from '../../../utils/factory.js';\nimport { createCsSqr } from '../sparse/csSqr.js';\nimport { createCsLu } from '../sparse/csLu.js';\nvar name = 'slu';\nvar dependencies = ['typed', 'abs', 'add', 'multiply', 'transpose', 'divideScalar', 'subtract', 'larger', 'largerEq', 'SparseMatrix'];\nexport var createSlu = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n multiply,\n transpose,\n divideScalar,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n } = _ref;\n var csSqr = createCsSqr({\n add,\n multiply,\n transpose\n });\n var csLu = createCsLu({\n abs,\n divideScalar,\n multiply,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n });\n\n /**\n * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix `A` is decomposed in two matrices (`L`, `U`) and two permutation vectors (`pinv`, `q`) where\n *\n * `P * A * Q = L * U`\n *\n * Syntax:\n *\n * math.slu(A, order, threshold)\n *\n * Examples:\n *\n * const A = math.sparse([[4,3], [6, 3]])\n * math.slu(A, 1, 0.001)\n * // returns:\n * // {\n * // L: [[1, 0], [1.5, 1]]\n * // U: [[4, 3], [0, -1.5]]\n * // p: [0, 1]\n * // q: [0, 1]\n * // }\n *\n * See also:\n *\n * lup, lsolve, usolve, lusolve\n *\n * @param {SparseMatrix} A A two dimensional sparse matrix for which to get the LU decomposition.\n * @param {Number} order The Symbolic Ordering and Analysis order:\n * 0 - Natural ordering, no permutation vector q is returned\n * 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A'\n * 2 - Symbolic ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'.\n * This is appropriatefor LU factorization of unsymmetric matrices.\n * 3 - Symbolic ordering and analisis is performed on M = A' * A. This is best used for LU factorization is matrix M has no dense rows.\n * A dense row is a row with more than 10*sqr(columns) entries.\n * @param {Number} threshold Partial pivoting threshold (1 for partial pivoting)\n *\n * @return {Object} The lower triangular matrix, the upper triangular matrix and the permutation vectors.\n */\n return typed(name, {\n 'SparseMatrix, number, number': function SparseMatrixNumberNumber(a, order, threshold) {\n // verify order\n if (!isInteger(order) || order < 0 || order > 3) {\n throw new Error('Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]');\n }\n // verify threshold\n if (threshold < 0 || threshold > 1) {\n throw new Error('Partial pivoting threshold must be a number from 0 to 1');\n }\n\n // perform symbolic ordering and analysis\n var s = csSqr(order, a, false);\n\n // perform lu decomposition\n var f = csLu(a, s, threshold);\n\n // return decomposition\n return {\n L: f.L,\n U: f.U,\n p: f.pinv,\n q: s.q,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\np: ' + this.p.toString() + (this.q ? '\\nq: ' + this.q.toString() : '') + '\\n';\n }\n };\n }\n });\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csPermute } from './csPermute.js';\nimport { csPost } from './csPost.js';\nimport { csEtree } from './csEtree.js';\nimport { createCsAmd } from './csAmd.js';\nimport { createCsCounts } from './csCounts.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'csSqr';\nvar dependencies = ['add', 'multiply', 'transpose'];\nexport var createCsSqr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n add,\n multiply,\n transpose\n } = _ref;\n var csAmd = createCsAmd({\n add,\n multiply,\n transpose\n });\n var csCounts = createCsCounts({\n transpose\n });\n\n /**\n * Symbolic ordering and analysis for QR and LU decompositions.\n *\n * @param {Number} order The ordering strategy (see csAmd for more details)\n * @param {Matrix} a The A matrix\n * @param {boolean} qr Symbolic ordering and analysis for QR decomposition (true) or\n * symbolic ordering and analysis for LU decomposition (false)\n *\n * @return {Object} The Symbolic ordering and analysis for matrix A\n */\n return function csSqr(order, a, qr) {\n // a arrays\n var aptr = a._ptr;\n var asize = a._size;\n // columns\n var n = asize[1];\n // vars\n var k;\n // symbolic analysis result\n var s = {};\n // fill-reducing ordering\n s.q = csAmd(order, a);\n // validate results\n if (order && !s.q) {\n return null;\n }\n // QR symbolic analysis\n if (qr) {\n // apply permutations if needed\n var c = order ? csPermute(a, null, s.q, 0) : a;\n // etree of C'*C, where C=A(:,q)\n s.parent = csEtree(c, 1);\n // post order elimination tree\n var post = csPost(s.parent, n);\n // col counts chol(C'*C)\n s.cp = csCounts(c, s.parent, post, 1);\n // check we have everything needed to calculate number of nonzero elements\n if (c && s.parent && s.cp && _vcount(c, s)) {\n // calculate number of nonzero elements\n for (s.unz = 0, k = 0; k < n; k++) {\n s.unz += s.cp[k];\n }\n }\n } else {\n // for LU factorization only, guess nnz(L) and nnz(U)\n s.unz = 4 * aptr[n] + n;\n s.lnz = s.unz;\n }\n // return result S\n return s;\n };\n\n /**\n * Compute nnz(V) = s.lnz, s.pinv, s.leftmost, s.m2 from A and s.parent\n */\n function _vcount(a, s) {\n // a arrays\n var aptr = a._ptr;\n var aindex = a._index;\n var asize = a._size;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n // initialize s arrays\n s.pinv = []; // (m + n)\n s.leftmost = []; // (m)\n // vars\n var parent = s.parent;\n var pinv = s.pinv;\n var leftmost = s.leftmost;\n // workspace, next: first m entries, head: next n entries, tail: next n entries, nque: next n entries\n var w = []; // (m + 3 * n)\n var next = 0;\n var head = m;\n var tail = m + n;\n var nque = m + 2 * n;\n // vars\n var i, k, p, p0, p1;\n // initialize w\n for (k = 0; k < n; k++) {\n // queue k is empty\n w[head + k] = -1;\n w[tail + k] = -1;\n w[nque + k] = 0;\n }\n // initialize row arrays\n for (i = 0; i < m; i++) {\n leftmost[i] = -1;\n }\n // loop columns backwards\n for (k = n - 1; k >= 0; k--) {\n // values & index for column k\n for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // leftmost[i] = min(find(A(i,:)))\n leftmost[aindex[p]] = k;\n }\n }\n // scan rows in reverse order\n for (i = m - 1; i >= 0; i--) {\n // row i is not yet ordered\n pinv[i] = -1;\n k = leftmost[i];\n // check row i is empty\n if (k === -1) {\n continue;\n }\n // first row in queue k\n if (w[nque + k]++ === 0) {\n w[tail + k] = i;\n }\n // put i at head of queue k\n w[next + i] = w[head + k];\n w[head + k] = i;\n }\n s.lnz = 0;\n s.m2 = m;\n // find row permutation and nnz(V)\n for (k = 0; k < n; k++) {\n // remove row i from queue k\n i = w[head + k];\n // count V(k,k) as nonzero\n s.lnz++;\n // add a fictitious row\n if (i < 0) {\n i = s.m2++;\n }\n // associate row i with V(:,k)\n pinv[i] = k;\n // skip if V(k+1:m,k) is empty\n if (--nque[k] <= 0) {\n continue;\n }\n // nque[k] is nnz (V(k+1:m,k))\n s.lnz += w[nque + k];\n // move all rows to parent of k\n var pa = parent[k];\n if (pa !== -1) {\n if (w[nque + pa] === 0) {\n w[tail + pa] = w[tail + k];\n }\n w[next + w[tail + k]] = w[head + pa];\n w[head + pa] = w[next + i];\n w[nque + pa] += w[nque + k];\n }\n }\n for (i = 0; i < m; i++) {\n if (pinv[i] < 0) {\n pinv[i] = k++;\n }\n }\n return true;\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Permutes a sparse matrix C = P * A * Q\n *\n * @param {SparseMatrix} a The Matrix A\n * @param {Array} pinv The row permutation vector\n * @param {Array} q The column permutation vector\n * @param {boolean} values Create a pattern matrix (false), values and pattern otherwise\n *\n * @return {Matrix} C = P * A * Q, null on error\n */\nexport function csPermute(a, pinv, q, values) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n // c arrays\n var cvalues = values && a._values ? [] : null;\n var cindex = []; // (aptr[n])\n var cptr = []; // (n + 1)\n // initialize vars\n var nz = 0;\n // loop columns\n for (var k = 0; k < n; k++) {\n // column k of C is column q[k] of A\n cptr[k] = nz;\n // apply column permutation\n var j = q ? q[k] : k;\n // loop values in column j of A\n for (var t0 = aptr[j], t1 = aptr[j + 1], t = t0; t < t1; t++) {\n // row i of A is row pinv[i] of C\n var r = pinv ? pinv[aindex[t]] : aindex[t];\n // index\n cindex[nz] = r;\n // check we need to populate values\n if (cvalues) {\n cvalues[nz] = avalues[t];\n }\n // increment number of nonzero elements\n nz++;\n }\n }\n // finalize the last column of C\n cptr[n] = nz;\n // return C matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [m, n],\n datatype: adt\n });\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csTdfs } from './csTdfs.js';\n\n/**\n * Post order a tree of forest\n *\n * @param {Array} parent The tree or forest\n * @param {Number} n Number of columns\n */\nexport function csPost(parent, n) {\n // check inputs\n if (!parent) {\n return null;\n }\n // vars\n var k = 0;\n var j;\n // allocate result\n var post = []; // (n)\n // workspace, head: first n entries, next: next n entries, stack: last n entries\n var w = []; // (3 * n)\n var head = 0;\n var next = n;\n var stack = 2 * n;\n // initialize workspace\n for (j = 0; j < n; j++) {\n // empty linked lists\n w[head + j] = -1;\n }\n // traverse nodes in reverse order\n for (j = n - 1; j >= 0; j--) {\n // check j is a root\n if (parent[j] === -1) {\n continue;\n }\n // add j to list of its parent\n w[next + j] = w[head + parent[j]];\n w[head + parent[j]] = j;\n }\n // loop nodes\n for (j = 0; j < n; j++) {\n // skip j if it is not a root\n if (parent[j] !== -1) {\n continue;\n }\n // depth-first search\n k = csTdfs(j, k, w, head, next, post, stack);\n }\n return post;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Depth-first search and postorder of a tree rooted at node j\n *\n * @param {Number} j The tree node\n * @param {Number} k\n * @param {Array} w The workspace array\n * @param {Number} head The index offset within the workspace for the head array\n * @param {Number} next The index offset within the workspace for the next array\n * @param {Array} post The post ordering array\n * @param {Number} stack The index offset within the workspace for the stack array\n */\nexport function csTdfs(j, k, w, head, next, post, stack) {\n // variables\n var top = 0;\n // place j on the stack\n w[stack] = j;\n // while (stack is not empty)\n while (top >= 0) {\n // p = top of stack\n var p = w[stack + top];\n // i = youngest child of p\n var i = w[head + p];\n if (i === -1) {\n // p has no unordered children left\n top--;\n // node p is the kth postordered node\n post[k++] = p;\n } else {\n // remove i from children of p\n w[head + p] = w[next + i];\n // increment top\n ++top;\n // start dfs on child node i\n w[stack + top] = i;\n }\n }\n return k;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Computes the elimination tree of Matrix A (using triu(A)) or the\n * elimination tree of A'A without forming A'A.\n *\n * @param {Matrix} a The A Matrix\n * @param {boolean} ata A value of true the function computes the etree of A'A\n */\nexport function csEtree(a, ata) {\n // check inputs\n if (!a) {\n return null;\n }\n // a arrays\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n\n // allocate result\n var parent = []; // (n)\n\n // allocate workspace\n var w = []; // (n + (ata ? m : 0))\n var ancestor = 0; // first n entries in w\n var prev = n; // last m entries (ata = true)\n\n var i, inext;\n\n // check we are calculating A'A\n if (ata) {\n // initialize workspace\n for (i = 0; i < m; i++) {\n w[prev + i] = -1;\n }\n }\n // loop columns\n for (var k = 0; k < n; k++) {\n // node k has no parent yet\n parent[k] = -1;\n // nor does k have an ancestor\n w[ancestor + k] = -1;\n // values in column k\n for (var p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // row\n var r = aindex[p];\n // node\n i = ata ? w[prev + r] : r;\n // traverse from i to k\n for (; i !== -1 && i < k; i = inext) {\n // inext = ancestor of i\n inext = w[ancestor + i];\n // path compression\n w[ancestor + i] = k;\n // check no anc., parent is k\n if (inext === -1) {\n parent[i] = k;\n }\n }\n if (ata) {\n w[prev + r] = k;\n }\n }\n }\n return parent;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { factory } from '../../../utils/factory.js';\nimport { csFkeep } from './csFkeep.js';\nimport { csFlip } from './csFlip.js';\nimport { csTdfs } from './csTdfs.js';\nvar name = 'csAmd';\nvar dependencies = ['add', 'multiply', 'transpose'];\nexport var createCsAmd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n add,\n multiply,\n transpose\n } = _ref;\n /**\n * Approximate minimum degree ordering. The minimum degree algorithm is a widely used\n * heuristic for finding a permutation P so that P*A*P' has fewer nonzeros in its factorization\n * than A. It is a gready method that selects the sparsest pivot row and column during the course\n * of a right looking sparse Cholesky factorization.\n *\n * @param {Number} order 0: Natural, 1: Cholesky, 2: LU, 3: QR\n * @param {Matrix} m Sparse Matrix\n */\n return function csAmd(order, a) {\n // check input parameters\n if (!a || order <= 0 || order > 3) {\n return null;\n }\n // a matrix arrays\n var asize = a._size;\n // rows and columns\n var m = asize[0];\n var n = asize[1];\n // initialize vars\n var lemax = 0;\n // dense threshold\n var dense = Math.max(16, 10 * Math.sqrt(n));\n dense = Math.min(n - 2, dense);\n // create target matrix C\n var cm = _createTargetMatrix(order, a, m, n, dense);\n // drop diagonal entries\n csFkeep(cm, _diag, null);\n // C matrix arrays\n var cindex = cm._index;\n var cptr = cm._ptr;\n\n // number of nonzero elements in C\n var cnz = cptr[n];\n\n // allocate result (n+1)\n var P = [];\n\n // create workspace (8 * (n + 1))\n var W = [];\n var len = 0; // first n + 1 entries\n var nv = n + 1; // next n + 1 entries\n var next = 2 * (n + 1); // next n + 1 entries\n var head = 3 * (n + 1); // next n + 1 entries\n var elen = 4 * (n + 1); // next n + 1 entries\n var degree = 5 * (n + 1); // next n + 1 entries\n var w = 6 * (n + 1); // next n + 1 entries\n var hhead = 7 * (n + 1); // last n + 1 entries\n\n // use P as workspace for last\n var last = P;\n\n // initialize quotient graph\n var mark = _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree);\n\n // initialize degree lists\n var nel = _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next);\n\n // minimum degree node\n var mindeg = 0;\n\n // vars\n var i, j, k, k1, k2, e, pj, ln, nvi, pk, eln, p1, p2, pn, h, d;\n\n // while (selecting pivots) do\n while (nel < n) {\n // select node of minimum approximate degree. amd() is now ready to start eliminating the graph. It first\n // finds a node k of minimum degree and removes it from its degree list. The variable nel keeps track of thow\n // many nodes have been eliminated.\n for (k = -1; mindeg < n && (k = W[head + mindeg]) === -1; mindeg++);\n if (W[next + k] !== -1) {\n last[W[next + k]] = -1;\n }\n // remove k from degree list\n W[head + mindeg] = W[next + k];\n // elenk = |Ek|\n var elenk = W[elen + k];\n // # of nodes k represents\n var nvk = W[nv + k];\n // W[nv + k] nodes of A eliminated\n nel += nvk;\n\n // Construct a new element. The new element Lk is constructed in place if |Ek| = 0. nv[i] is\n // negated for all nodes i in Lk to flag them as members of this set. Each node i is removed from the\n // degree lists. All elements e in Ek are absorved into element k.\n var dk = 0;\n // flag k as in Lk\n W[nv + k] = -nvk;\n var p = cptr[k];\n // do in place if W[elen + k] === 0\n var pk1 = elenk === 0 ? p : cnz;\n var pk2 = pk1;\n for (k1 = 1; k1 <= elenk + 1; k1++) {\n if (k1 > elenk) {\n // search the nodes in k\n e = k;\n // list of nodes starts at cindex[pj]\n pj = p;\n // length of list of nodes in k\n ln = W[len + k] - elenk;\n } else {\n // search the nodes in e\n e = cindex[p++];\n pj = cptr[e];\n // length of list of nodes in e\n ln = W[len + e];\n }\n for (k2 = 1; k2 <= ln; k2++) {\n i = cindex[pj++];\n // check node i dead, or seen\n if ((nvi = W[nv + i]) <= 0) {\n continue;\n }\n // W[degree + Lk] += size of node i\n dk += nvi;\n // negate W[nv + i] to denote i in Lk\n W[nv + i] = -nvi;\n // place i in Lk\n cindex[pk2++] = i;\n if (W[next + i] !== -1) {\n last[W[next + i]] = last[i];\n }\n // check we need to remove i from degree list\n if (last[i] !== -1) {\n W[next + last[i]] = W[next + i];\n } else {\n W[head + W[degree + i]] = W[next + i];\n }\n }\n if (e !== k) {\n // absorb e into k\n cptr[e] = csFlip(k);\n // e is now a dead element\n W[w + e] = 0;\n }\n }\n // cindex[cnz...nzmax] is free\n if (elenk !== 0) {\n cnz = pk2;\n }\n // external degree of k - |Lk\\i|\n W[degree + k] = dk;\n // element k is in cindex[pk1..pk2-1]\n cptr[k] = pk1;\n W[len + k] = pk2 - pk1;\n // k is now an element\n W[elen + k] = -2;\n\n // Find set differences. The scan1 function now computes the set differences |Le \\ Lk| for all elements e. At the start of the\n // scan, no entry in the w array is greater than or equal to mark.\n\n // clear w if necessary\n mark = _wclear(mark, lemax, W, w, n);\n // scan 1: find |Le\\Lk|\n for (pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check if W[elen + i] empty, skip it\n if ((eln = W[elen + i]) <= 0) {\n continue;\n }\n // W[nv + i] was negated\n nvi = -W[nv + i];\n var wnvi = mark - nvi;\n // scan Ei\n for (p = cptr[i], p1 = cptr[i] + eln - 1; p <= p1; p++) {\n e = cindex[p];\n if (W[w + e] >= mark) {\n // decrement |Le\\Lk|\n W[w + e] -= nvi;\n } else if (W[w + e] !== 0) {\n // ensure e is a live element, 1st time e seen in scan 1\n W[w + e] = W[degree + e] + wnvi;\n }\n }\n }\n\n // degree update\n // The second pass computes the approximate degree di, prunes the sets Ei and Ai, and computes a hash\n // function h(i) for all nodes in Lk.\n\n // scan2: degree update\n for (pk = pk1; pk < pk2; pk++) {\n // consider node i in Lk\n i = cindex[pk];\n p1 = cptr[i];\n p2 = p1 + W[elen + i] - 1;\n pn = p1;\n // scan Ei\n for (h = 0, d = 0, p = p1; p <= p2; p++) {\n e = cindex[p];\n // check e is an unabsorbed element\n if (W[w + e] !== 0) {\n // dext = |Le\\Lk|\n var dext = W[w + e] - mark;\n if (dext > 0) {\n // sum up the set differences\n d += dext;\n // keep e in Ei\n cindex[pn++] = e;\n // compute the hash of node i\n h += e;\n } else {\n // aggressive absorb. e->k\n cptr[e] = csFlip(k);\n // e is a dead element\n W[w + e] = 0;\n }\n }\n }\n // W[elen + i] = |Ei|\n W[elen + i] = pn - p1 + 1;\n var p3 = pn;\n var p4 = p1 + W[len + i];\n // prune edges in Ai\n for (p = p2 + 1; p < p4; p++) {\n j = cindex[p];\n // check node j dead or in Lk\n var nvj = W[nv + j];\n if (nvj <= 0) {\n continue;\n }\n // degree(i) += |j|\n d += nvj;\n // place j in node list of i\n cindex[pn++] = j;\n // compute hash for node i\n h += j;\n }\n // check for mass elimination\n if (d === 0) {\n // absorb i into k\n cptr[i] = csFlip(k);\n nvi = -W[nv + i];\n // |Lk| -= |i|\n dk -= nvi;\n // |k| += W[nv + i]\n nvk += nvi;\n nel += nvi;\n W[nv + i] = 0;\n // node i is dead\n W[elen + i] = -1;\n } else {\n // update degree(i)\n W[degree + i] = Math.min(W[degree + i], d);\n // move first node to end\n cindex[pn] = cindex[p3];\n // move 1st el. to end of Ei\n cindex[p3] = cindex[p1];\n // add k as 1st element in of Ei\n cindex[p1] = k;\n // new len of adj. list of node i\n W[len + i] = pn - p1 + 1;\n // finalize hash of i\n h = (h < 0 ? -h : h) % n;\n // place i in hash bucket\n W[next + i] = W[hhead + h];\n W[hhead + h] = i;\n // save hash of i in last[i]\n last[i] = h;\n }\n }\n // finalize |Lk|\n W[degree + k] = dk;\n lemax = Math.max(lemax, dk);\n // clear w\n mark = _wclear(mark + lemax, lemax, W, w, n);\n\n // Supernode detection. Supernode detection relies on the hash function h(i) computed for each node i.\n // If two nodes have identical adjacency lists, their hash functions wil be identical.\n for (pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check i is dead, skip it\n if (W[nv + i] >= 0) {\n continue;\n }\n // scan hash bucket of node i\n h = last[i];\n i = W[hhead + h];\n // hash bucket will be empty\n W[hhead + h] = -1;\n for (; i !== -1 && W[next + i] !== -1; i = W[next + i], mark++) {\n ln = W[len + i];\n eln = W[elen + i];\n for (p = cptr[i] + 1; p <= cptr[i] + ln - 1; p++) {\n W[w + cindex[p]] = mark;\n }\n var jlast = i;\n // compare i with all j\n for (j = W[next + i]; j !== -1;) {\n var ok = W[len + j] === ln && W[elen + j] === eln;\n for (p = cptr[j] + 1; ok && p <= cptr[j] + ln - 1; p++) {\n // compare i and j\n if (W[w + cindex[p]] !== mark) {\n ok = 0;\n }\n }\n // check i and j are identical\n if (ok) {\n // absorb j into i\n cptr[j] = csFlip(i);\n W[nv + i] += W[nv + j];\n W[nv + j] = 0;\n // node j is dead\n W[elen + j] = -1;\n // delete j from hash bucket\n j = W[next + j];\n W[next + jlast] = j;\n } else {\n // j and i are different\n jlast = j;\n j = W[next + j];\n }\n }\n }\n }\n\n // Finalize new element. The elimination of node k is nearly complete. All nodes i in Lk are scanned one last time.\n // Node i is removed from Lk if it is dead. The flagged status of nv[i] is cleared.\n for (p = pk1, pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check i is dead, skip it\n if ((nvi = -W[nv + i]) <= 0) {\n continue;\n }\n // restore W[nv + i]\n W[nv + i] = nvi;\n // compute external degree(i)\n d = W[degree + i] + dk - nvi;\n d = Math.min(d, n - nel - nvi);\n if (W[head + d] !== -1) {\n last[W[head + d]] = i;\n }\n // put i back in degree list\n W[next + i] = W[head + d];\n last[i] = -1;\n W[head + d] = i;\n // find new minimum degree\n mindeg = Math.min(mindeg, d);\n W[degree + i] = d;\n // place i in Lk\n cindex[p++] = i;\n }\n // # nodes absorbed into k\n W[nv + k] = nvk;\n // length of adj list of element k\n if ((W[len + k] = p - pk1) === 0) {\n // k is a root of the tree\n cptr[k] = -1;\n // k is now a dead element\n W[w + k] = 0;\n }\n if (elenk !== 0) {\n // free unused space in Lk\n cnz = p;\n }\n }\n\n // Postordering. The elimination is complete, but no permutation has been computed. All that is left\n // of the graph is the assembly tree (ptr) and a set of dead nodes and elements (i is a dead node if\n // nv[i] is zero and a dead element if nv[i] > 0). It is from this information only that the final permutation\n // is computed. The tree is restored by unflipping all of ptr.\n\n // fix assembly tree\n for (i = 0; i < n; i++) {\n cptr[i] = csFlip(cptr[i]);\n }\n for (j = 0; j <= n; j++) {\n W[head + j] = -1;\n }\n // place unordered nodes in lists\n for (j = n; j >= 0; j--) {\n // skip if j is an element\n if (W[nv + j] > 0) {\n continue;\n }\n // place j in list of its parent\n W[next + j] = W[head + cptr[j]];\n W[head + cptr[j]] = j;\n }\n // place elements in lists\n for (e = n; e >= 0; e--) {\n // skip unless e is an element\n if (W[nv + e] <= 0) {\n continue;\n }\n if (cptr[e] !== -1) {\n // place e in list of its parent\n W[next + e] = W[head + cptr[e]];\n W[head + cptr[e]] = e;\n }\n }\n // postorder the assembly tree\n for (k = 0, i = 0; i <= n; i++) {\n if (cptr[i] === -1) {\n k = csTdfs(i, k, W, head, next, P, w);\n }\n }\n // remove last item in array\n P.splice(P.length - 1, 1);\n // return P\n return P;\n };\n\n /**\n * Creates the matrix that will be used by the approximate minimum degree ordering algorithm. The function accepts the matrix M as input and returns a permutation\n * vector P. The amd algorithm operates on a symmetrix matrix, so one of three symmetric matrices is formed.\n *\n * Order: 0\n * A natural ordering P=null matrix is returned.\n *\n * Order: 1\n * Matrix must be square. This is appropriate for a Cholesky or LU factorization.\n * P = M + M'\n *\n * Order: 2\n * Dense columns from M' are dropped, M recreated from M'. This is appropriatefor LU factorization of unsymmetric matrices.\n * P = M' * M\n *\n * Order: 3\n * This is best used for QR factorization or LU factorization is matrix M has no dense rows. A dense row is a row with more than 10*sqr(columns) entries.\n * P = M' * M\n */\n function _createTargetMatrix(order, a, m, n, dense) {\n // compute A'\n var at = transpose(a);\n\n // check order = 1, matrix must be square\n if (order === 1 && n === m) {\n // C = A + A'\n return add(a, at);\n }\n\n // check order = 2, drop dense columns from M'\n if (order === 2) {\n // transpose arrays\n var tindex = at._index;\n var tptr = at._ptr;\n // new column index\n var p2 = 0;\n // loop A' columns (rows)\n for (var j = 0; j < m; j++) {\n // column j of AT starts here\n var p = tptr[j];\n // new column j starts here\n tptr[j] = p2;\n // skip dense col j\n if (tptr[j + 1] - p > dense) {\n continue;\n }\n // map rows in column j of A\n for (var p1 = tptr[j + 1]; p < p1; p++) {\n tindex[p2++] = tindex[p];\n }\n }\n // finalize AT\n tptr[m] = p2;\n // recreate A from new transpose matrix\n a = transpose(at);\n // use A' * A\n return multiply(at, a);\n }\n\n // use A' * A, square or rectangular matrix\n return multiply(at, a);\n }\n\n /**\n * Initialize quotient graph. There are four kind of nodes and elements that must be represented:\n *\n * - A live node is a node i (or a supernode) that has not been selected as a pivot nad has not been merged into another supernode.\n * - A dead node i is one that has been removed from the graph, having been absorved into r = flip(ptr[i]).\n * - A live element e is one that is in the graph, having been formed when node e was selected as the pivot.\n * - A dead element e is one that has benn absorved into a subsequent element s = flip(ptr[e]).\n */\n function _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree) {\n // Initialize quotient graph\n for (var k = 0; k < n; k++) {\n W[len + k] = cptr[k + 1] - cptr[k];\n }\n W[len + n] = 0;\n // initialize workspace\n for (var i = 0; i <= n; i++) {\n // degree list i is empty\n W[head + i] = -1;\n last[i] = -1;\n W[next + i] = -1;\n // hash list i is empty\n W[hhead + i] = -1;\n // node i is just one node\n W[nv + i] = 1;\n // node i is alive\n W[w + i] = 1;\n // Ek of node i is empty\n W[elen + i] = 0;\n // degree of node i\n W[degree + i] = W[len + i];\n }\n // clear w\n var mark = _wclear(0, 0, W, w, n);\n // n is a dead element\n W[elen + n] = -2;\n // n is a root of assembly tree\n cptr[n] = -1;\n // n is a dead element\n W[w + n] = 0;\n // return mark\n return mark;\n }\n\n /**\n * Initialize degree lists. Each node is placed in its degree lists. Nodes of zero degree are eliminated immediately. Nodes with\n * degree >= dense are alsol eliminated and merged into a placeholder node n, a dead element. Thes nodes will appera last in the\n * output permutation p.\n */\n function _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next) {\n // result\n var nel = 0;\n // loop columns\n for (var i = 0; i < n; i++) {\n // degree @ i\n var d = W[degree + i];\n // check node i is empty\n if (d === 0) {\n // element i is dead\n W[elen + i] = -2;\n nel++;\n // i is a root of assembly tree\n cptr[i] = -1;\n W[w + i] = 0;\n } else if (d > dense) {\n // absorb i into element n\n W[nv + i] = 0;\n // node i is dead\n W[elen + i] = -1;\n nel++;\n cptr[i] = csFlip(n);\n W[nv + n]++;\n } else {\n var h = W[head + d];\n if (h !== -1) {\n last[h] = i;\n }\n // put node i in degree list d\n W[next + i] = W[head + d];\n W[head + d] = i;\n }\n }\n return nel;\n }\n function _wclear(mark, lemax, W, w, n) {\n if (mark < 2 || mark + lemax < 0) {\n for (var k = 0; k < n; k++) {\n if (W[w + k] !== 0) {\n W[w + k] = 1;\n }\n }\n mark = 2;\n }\n // at this point, W [0..n-1] < mark holds\n return mark;\n }\n function _diag(i, j) {\n return i !== j;\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Keeps entries in the matrix when the callback function returns true, removes the entry otherwise\n *\n * @param {Matrix} a The sparse matrix\n * @param {function} callback The callback function, function will be invoked with the following args:\n * - The entry row\n * - The entry column\n * - The entry value\n * - The state parameter\n * @param {any} other The state\n *\n * @return The number of nonzero elements in the matrix\n */\nexport function csFkeep(a, callback, other) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n // columns\n var n = asize[1];\n // nonzero items\n var nz = 0;\n // loop columns\n for (var j = 0; j < n; j++) {\n // get current location of col j\n var p = aptr[j];\n // record new location of col j\n aptr[j] = nz;\n for (; p < aptr[j + 1]; p++) {\n // check we need to keep this item\n if (callback(aindex[p], j, avalues ? avalues[p] : 1, other)) {\n // keep A(i,j)\n aindex[nz] = aindex[p];\n // check we need to process values (pattern only)\n if (avalues) {\n avalues[nz] = avalues[p];\n }\n // increment nonzero items\n nz++;\n }\n }\n }\n // finalize A\n aptr[n] = nz;\n // trim arrays\n aindex.splice(nz, aindex.length - nz);\n // check we need to process values (pattern only)\n if (avalues) {\n avalues.splice(nz, avalues.length - nz);\n }\n // return number of nonzero items\n return nz;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * This function \"flips\" its input about the integer -1.\n *\n * @param {Number} i The value to flip\n */\nexport function csFlip(i) {\n // flip the value\n return -i - 2;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { factory } from '../../../utils/factory.js';\nimport { csLeaf } from './csLeaf.js';\nvar name = 'csCounts';\nvar dependencies = ['transpose'];\nexport var createCsCounts = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n transpose\n } = _ref;\n /**\n * Computes the column counts using the upper triangular part of A.\n * It transposes A internally, none of the input parameters are modified.\n *\n * @param {Matrix} a The sparse matrix A\n *\n * @param {Matrix} ata Count the columns of A'A instead\n *\n * @return An array of size n of the column counts or null on error\n */\n return function (a, parent, post, ata) {\n // check inputs\n if (!a || !parent || !post) {\n return null;\n }\n // a matrix arrays\n var asize = a._size;\n // rows and columns\n var m = asize[0];\n var n = asize[1];\n // variables\n var i, j, k, J, p, p0, p1;\n\n // workspace size\n var s = 4 * n + (ata ? n + m + 1 : 0);\n // allocate workspace\n var w = []; // (s)\n var ancestor = 0; // first n entries\n var maxfirst = n; // next n entries\n var prevleaf = 2 * n; // next n entries\n var first = 3 * n; // next n entries\n var head = 4 * n; // next n + 1 entries (used when ata is true)\n var next = 5 * n + 1; // last entries in workspace\n // clear workspace w[0..s-1]\n for (k = 0; k < s; k++) {\n w[k] = -1;\n }\n\n // allocate result\n var colcount = []; // (n)\n\n // AT = A'\n var at = transpose(a);\n // at arrays\n var tindex = at._index;\n var tptr = at._ptr;\n\n // find w[first + j]\n for (k = 0; k < n; k++) {\n j = post[k];\n // colcount[j]=1 if j is a leaf\n colcount[j] = w[first + j] === -1 ? 1 : 0;\n for (; j !== -1 && w[first + j] === -1; j = parent[j]) {\n w[first + j] = k;\n }\n }\n\n // initialize ata if needed\n if (ata) {\n // invert post\n for (k = 0; k < n; k++) {\n w[post[k]] = k;\n }\n // loop rows (columns in AT)\n for (i = 0; i < m; i++) {\n // values in column i of AT\n for (k = n, p0 = tptr[i], p1 = tptr[i + 1], p = p0; p < p1; p++) {\n k = Math.min(k, w[tindex[p]]);\n }\n // place row i in linked list k\n w[next + i] = w[head + k];\n w[head + k] = i;\n }\n }\n\n // each node in its own set\n for (i = 0; i < n; i++) {\n w[ancestor + i] = i;\n }\n for (k = 0; k < n; k++) {\n // j is the kth node in postordered etree\n j = post[k];\n // check j is not a root\n if (parent[j] !== -1) {\n colcount[parent[j]]--;\n }\n\n // J=j for LL'=A case\n for (J = ata ? w[head + k] : j; J !== -1; J = ata ? w[next + J] : -1) {\n for (p = tptr[J]; p < tptr[J + 1]; p++) {\n i = tindex[p];\n var r = csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor);\n // check A(i,j) is in skeleton\n if (r.jleaf >= 1) {\n colcount[j]++;\n }\n // check account for overlap in q\n if (r.jleaf === 2) {\n colcount[r.q]--;\n }\n }\n }\n if (parent[j] !== -1) {\n w[ancestor + j] = parent[j];\n }\n }\n // sum up colcount's of each child\n for (j = 0; j < n; j++) {\n if (parent[j] !== -1) {\n colcount[parent[j]] += colcount[j];\n }\n }\n return colcount;\n };\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * This function determines if j is a leaf of the ith row subtree.\n * Consider A(i,j), node j in ith row subtree and return lca(jprev,j)\n *\n * @param {Number} i The ith row subtree\n * @param {Number} j The node to test\n * @param {Array} w The workspace array\n * @param {Number} first The index offset within the workspace for the first array\n * @param {Number} maxfirst The index offset within the workspace for the maxfirst array\n * @param {Number} prevleaf The index offset within the workspace for the prevleaf array\n * @param {Number} ancestor The index offset within the workspace for the ancestor array\n *\n * @return {Object}\n */\nexport function csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor) {\n var s, sparent;\n\n // our result\n var jleaf = 0;\n var q;\n\n // check j is a leaf\n if (i <= j || w[first + j] <= w[maxfirst + i]) {\n return -1;\n }\n // update max first[j] seen so far\n w[maxfirst + i] = w[first + j];\n // jprev = previous leaf of ith subtree\n var jprev = w[prevleaf + i];\n w[prevleaf + i] = j;\n\n // check j is first or subsequent leaf\n if (jprev === -1) {\n // 1st leaf, q = root of ith subtree\n jleaf = 1;\n q = i;\n } else {\n // update jleaf\n jleaf = 2;\n // q = least common ancester (jprev,j)\n for (q = jprev; q !== w[ancestor + q]; q = w[ancestor + q]);\n for (s = jprev; s !== q; s = sparent) {\n // path compression\n sparent = w[ancestor + s];\n w[ancestor + s] = q;\n }\n }\n return {\n jleaf,\n q\n };\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { factory } from '../../../utils/factory.js';\nimport { createCsSpsolve } from './csSpsolve.js';\nvar name = 'csLu';\nvar dependencies = ['abs', 'divideScalar', 'multiply', 'subtract', 'larger', 'largerEq', 'SparseMatrix'];\nexport var createCsLu = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n abs,\n divideScalar,\n multiply,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n } = _ref;\n var csSpsolve = createCsSpsolve({\n divideScalar,\n multiply,\n subtract\n });\n\n /**\n * Computes the numeric LU factorization of the sparse matrix A. Implements a Left-looking LU factorization\n * algorithm that computes L and U one column at a tume. At the kth step, it access columns 1 to k-1 of L\n * and column k of A. Given the fill-reducing column ordering q (see parameter s) computes L, U and pinv so\n * L * U = A(p, q), where p is the inverse of pinv.\n *\n * @param {Matrix} m The A Matrix to factorize\n * @param {Object} s The symbolic analysis from csSqr(). Provides the fill-reducing\n * column ordering q\n * @param {Number} tol Partial pivoting threshold (1 for partial pivoting)\n *\n * @return {Number} The numeric LU factorization of A or null\n */\n return function csLu(m, s, tol) {\n // validate input\n if (!m) {\n return null;\n }\n // m arrays\n var size = m._size;\n // columns\n var n = size[1];\n // symbolic analysis result\n var q;\n var lnz = 100;\n var unz = 100;\n // update symbolic analysis parameters\n if (s) {\n q = s.q;\n lnz = s.lnz || lnz;\n unz = s.unz || unz;\n }\n // L arrays\n var lvalues = []; // (lnz)\n var lindex = []; // (lnz)\n var lptr = []; // (n + 1)\n // L\n var L = new SparseMatrix({\n values: lvalues,\n index: lindex,\n ptr: lptr,\n size: [n, n]\n });\n // U arrays\n var uvalues = []; // (unz)\n var uindex = []; // (unz)\n var uptr = []; // (n + 1)\n // U\n var U = new SparseMatrix({\n values: uvalues,\n index: uindex,\n ptr: uptr,\n size: [n, n]\n });\n // inverse of permutation vector\n var pinv = []; // (n)\n // vars\n var i, p;\n // allocate arrays\n var x = []; // (n)\n var xi = []; // (2 * n)\n // initialize variables\n for (i = 0; i < n; i++) {\n // clear workspace\n x[i] = 0;\n // no rows pivotal yet\n pinv[i] = -1;\n // no cols of L yet\n lptr[i + 1] = 0;\n }\n // reset number of nonzero elements in L and U\n lnz = 0;\n unz = 0;\n // compute L(:,k) and U(:,k)\n for (var k = 0; k < n; k++) {\n // update ptr\n lptr[k] = lnz;\n uptr[k] = unz;\n // apply column permutations if needed\n var col = q ? q[k] : k;\n // solve triangular system, x = L\\A(:,col)\n var top = csSpsolve(L, m, col, xi, x, pinv, 1);\n // find pivot\n var ipiv = -1;\n var a = -1;\n // loop xi[] from top -> n\n for (p = top; p < n; p++) {\n // x[i] is nonzero\n i = xi[p];\n // check row i is not yet pivotal\n if (pinv[i] < 0) {\n // absolute value of x[i]\n var xabs = abs(x[i]);\n // check absoulte value is greater than pivot value\n if (larger(xabs, a)) {\n // largest pivot candidate so far\n a = xabs;\n ipiv = i;\n }\n } else {\n // x(i) is the entry U(pinv[i],k)\n uindex[unz] = pinv[i];\n uvalues[unz++] = x[i];\n }\n }\n // validate we found a valid pivot\n if (ipiv === -1 || a <= 0) {\n return null;\n }\n // update actual pivot column, give preference to diagonal value\n if (pinv[col] < 0 && largerEq(abs(x[col]), multiply(a, tol))) {\n ipiv = col;\n }\n // the chosen pivot\n var pivot = x[ipiv];\n // last entry in U(:,k) is U(k,k)\n uindex[unz] = k;\n uvalues[unz++] = pivot;\n // ipiv is the kth pivot row\n pinv[ipiv] = k;\n // first entry in L(:,k) is L(k,k) = 1\n lindex[lnz] = ipiv;\n lvalues[lnz++] = 1;\n // L(k+1:n,k) = x / pivot\n for (p = top; p < n; p++) {\n // row\n i = xi[p];\n // check x(i) is an entry in L(:,k)\n if (pinv[i] < 0) {\n // save unpermuted row in L\n lindex[lnz] = i;\n // scale pivot column\n lvalues[lnz++] = divideScalar(x[i], pivot);\n }\n // x[0..n-1] = 0 for next k\n x[i] = 0;\n }\n }\n // update ptr\n lptr[n] = lnz;\n uptr[n] = unz;\n // fix row indices of L for final pinv\n for (p = 0; p < lnz; p++) {\n lindex[p] = pinv[lindex[p]];\n }\n // trim arrays\n lvalues.splice(lnz, lvalues.length - lnz);\n lindex.splice(lnz, lindex.length - lnz);\n uvalues.splice(unz, uvalues.length - unz);\n uindex.splice(unz, uindex.length - unz);\n // return LU factor\n return {\n L,\n U,\n pinv\n };\n };\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csReach } from './csReach.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'csSpsolve';\nvar dependencies = ['divideScalar', 'multiply', 'subtract'];\nexport var createCsSpsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n divideScalar,\n multiply,\n subtract\n } = _ref;\n /**\n * The function csSpsolve() computes the solution to G * x = bk, where bk is the\n * kth column of B. When lo is true, the function assumes G = L is lower triangular with the\n * diagonal entry as the first entry in each column. When lo is true, the function assumes G = U\n * is upper triangular with the diagonal entry as the last entry in each column.\n *\n * @param {Matrix} g The G matrix\n * @param {Matrix} b The B matrix\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} x The soluton to the linear system G * x = b\n * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b\n * @param {boolean} lo The lower (true) upper triangular (false) flag\n *\n * @return {Number} The index for the nonzero pattern\n */\n return function csSpsolve(g, b, k, xi, x, pinv, lo) {\n // g arrays\n var gvalues = g._values;\n var gindex = g._index;\n var gptr = g._ptr;\n var gsize = g._size;\n // columns\n var n = gsize[1];\n // b arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n // vars\n var p, p0, p1, q;\n // xi[top..n-1] = csReach(B(:,k))\n var top = csReach(g, b, k, xi, pinv);\n // clear x\n for (p = top; p < n; p++) {\n x[xi[p]] = 0;\n }\n // scatter b\n for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) {\n x[bindex[p]] = bvalues[p];\n }\n // loop columns\n for (var px = top; px < n; px++) {\n // x array index for px\n var j = xi[px];\n // apply permutation vector (U x = b), j maps to column J of G\n var J = pinv ? pinv[j] : j;\n // check column J is empty\n if (J < 0) {\n continue;\n }\n // column value indeces in G, p0 <= p < p1\n p0 = gptr[J];\n p1 = gptr[J + 1];\n // x(j) /= G(j,j)\n x[j] = divideScalar(x[j], gvalues[lo ? p0 : p1 - 1]);\n // first entry L(j,j)\n p = lo ? p0 + 1 : p0;\n q = lo ? p1 : p1 - 1;\n // loop\n for (; p < q; p++) {\n // row\n var i = gindex[p];\n // x(i) -= G(i,j) * x(j)\n x[i] = subtract(x[i], multiply(gvalues[p], x[j]));\n }\n }\n // return top of stack\n return top;\n };\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { csMarked } from './csMarked.js';\nimport { csMark } from './csMark.js';\nimport { csDfs } from './csDfs.js';\n\n/**\n * The csReach function computes X = Reach(B), where B is the nonzero pattern of the n-by-1\n * sparse column of vector b. The function returns the set of nodes reachable from any node in B. The\n * nonzero pattern xi of the solution x to the sparse linear system Lx=b is given by X=Reach(B).\n *\n * @param {Matrix} g The G matrix\n * @param {Matrix} b The B matrix\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} pinv The inverse row permutation vector\n *\n * @return {Number} The index for the nonzero pattern\n */\nexport function csReach(g, b, k, xi, pinv) {\n // g arrays\n var gptr = g._ptr;\n var gsize = g._size;\n // b arrays\n var bindex = b._index;\n var bptr = b._ptr;\n // columns\n var n = gsize[1];\n // vars\n var p, p0, p1;\n // initialize top\n var top = n;\n // loop column indeces in B\n for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) {\n // node i\n var i = bindex[p];\n // check node i is marked\n if (!csMarked(gptr, i)) {\n // start a dfs at unmarked node i\n top = csDfs(i, g, top, xi, pinv);\n }\n }\n // loop columns from top -> n - 1\n for (p = top; p < n; p++) {\n // restore G\n csMark(gptr, xi[p]);\n }\n return top;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Checks if the node at w[j] is marked\n *\n * @param {Array} w The array\n * @param {Number} j The array index\n */\nexport function csMarked(w, j) {\n // check node is marked\n return w[j] < 0;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { csFlip } from './csFlip.js';\n\n/**\n * Marks the node at w[j]\n *\n * @param {Array} w The array\n * @param {Number} j The array index\n */\nexport function csMark(w, j) {\n // mark w[j]\n w[j] = csFlip(w[j]);\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csMarked } from './csMarked.js';\nimport { csMark } from './csMark.js';\nimport { csUnflip } from './csUnflip.js';\n\n/**\n * Depth-first search computes the nonzero pattern xi of the directed graph G (Matrix) starting\n * at nodes in B (see csReach()).\n *\n * @param {Number} j The starting node for the DFS algorithm\n * @param {Matrix} g The G matrix to search, ptr array modified, then restored\n * @param {Number} top Start index in stack xi[top..n-1]\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b\n *\n * @return {Number} New value of top\n */\nexport function csDfs(j, g, top, xi, pinv) {\n // g arrays\n var index = g._index;\n var ptr = g._ptr;\n var size = g._size;\n // columns\n var n = size[1];\n // vars\n var i, p, p2;\n // initialize head\n var head = 0;\n // initialize the recursion stack\n xi[0] = j;\n // loop\n while (head >= 0) {\n // get j from the top of the recursion stack\n j = xi[head];\n // apply permutation vector\n var jnew = pinv ? pinv[j] : j;\n // check node j is marked\n if (!csMarked(ptr, j)) {\n // mark node j as visited\n csMark(ptr, j);\n // update stack (last n entries in xi)\n xi[n + head] = jnew < 0 ? 0 : csUnflip(ptr[jnew]);\n }\n // node j done if no unvisited neighbors\n var done = 1;\n // examine all neighbors of j, stack (last n entries in xi)\n for (p = xi[n + head], p2 = jnew < 0 ? 0 : csUnflip(ptr[jnew + 1]); p < p2; p++) {\n // consider neighbor node i\n i = index[p];\n // check we have visited node i, skip it\n if (csMarked(ptr, i)) {\n continue;\n }\n // pause depth-first search of node j, update stack (last n entries in xi)\n xi[n + head] = p;\n // start dfs at node i\n xi[++head] = i;\n // node j is not done\n done = 0;\n // break, to start dfs(i)\n break;\n }\n // check depth-first search at node j is done\n if (done) {\n // remove j from the recursion stack\n head--;\n // and place in the output stack\n xi[--top] = j;\n }\n }\n return top;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csFlip } from './csFlip.js';\n\n/**\n * Flips the value if it is negative of returns the same value otherwise.\n *\n * @param {Number} i The value to flip\n */\nexport function csUnflip(i) {\n // flip the value if it is negative\n return i < 0 ? csFlip(i) : i;\n}", "import { isArray, isMatrix } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nimport { csIpvec } from '../sparse/csIpvec.js';\nvar name = 'lusolve';\nvar dependencies = ['typed', 'matrix', 'lup', 'slu', 'usolve', 'lsolve', 'DenseMatrix'];\nexport var createLusolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n lup,\n slu,\n usolve,\n lsolve,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Solves the linear system `A * x = b` where `A` is an [n x n] matrix and `b` is a [n] column vector.\n *\n * Syntax:\n *\n * math.lusolve(A, b) // returns column vector with the solution to the linear system A * x = b\n * math.lusolve(lup, b) // returns column vector with the solution to the linear system A * x = b, lup = math.lup(A)\n *\n * Examples:\n *\n * const m = [[1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 3, 0], [0, 0, 0, 4]]\n *\n * const x = math.lusolve(m, [-1, -1, -1, -1]) // x = [[-1], [-0.5], [-1/3], [-0.25]]\n *\n * const f = math.lup(m)\n * const x1 = math.lusolve(f, [-1, -1, -1, -1]) // x1 = [[-1], [-0.5], [-1/3], [-0.25]]\n * const x2 = math.lusolve(f, [1, 2, 1, -1]) // x2 = [[1], [1], [1/3], [-0.25]]\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = math.lusolve(a, b) // [[2], [5]]\n *\n * See also:\n *\n * lup, slu, lsolve, usolve\n *\n * @param {Matrix | Array | Object} A Invertible Matrix or the Matrix LU decomposition\n * @param {Matrix | Array} b Column Vector\n * @param {number} [order] The Symbolic Ordering and Analysis order, see slu for details. Matrix must be a SparseMatrix\n * @param {Number} [threshold] Partial pivoting threshold (1 for partial pivoting), see slu for details. Matrix must be a SparseMatrix.\n *\n * @return {DenseMatrix | Array} Column vector with the solution to the linear system A * x = b\n */\n return typed(name, {\n 'Array, Array | Matrix': function ArrayArrayMatrix(a, b) {\n a = matrix(a);\n var d = lup(a);\n var x = _lusolve(d.L, d.U, d.p, null, b);\n return x.valueOf();\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrixArrayMatrix(a, b) {\n var d = lup(a);\n return _lusolve(d.L, d.U, d.p, null, b);\n },\n 'SparseMatrix, Array | Matrix': function SparseMatrixArrayMatrix(a, b) {\n var d = lup(a);\n return _lusolve(d.L, d.U, d.p, null, b);\n },\n 'SparseMatrix, Array | Matrix, number, number': function SparseMatrixArrayMatrixNumberNumber(a, b, order, threshold) {\n var d = slu(a, order, threshold);\n return _lusolve(d.L, d.U, d.p, d.q, b);\n },\n 'Object, Array | Matrix': function ObjectArrayMatrix(d, b) {\n return _lusolve(d.L, d.U, d.p, d.q, b);\n }\n });\n function _toMatrix(a) {\n if (isMatrix(a)) {\n return a;\n }\n if (isArray(a)) {\n return matrix(a);\n }\n throw new TypeError('Invalid Matrix LU decomposition');\n }\n function _lusolve(l, u, p, q, b) {\n // verify decomposition\n l = _toMatrix(l);\n u = _toMatrix(u);\n\n // apply row permutations if needed (b is a DenseMatrix)\n if (p) {\n b = solveValidation(l, b, true);\n b._data = csIpvec(p, b._data);\n }\n\n // use forward substitution to resolve L * y = b\n var y = lsolve(l, b);\n // use backward substitution to resolve U * x = y\n var x = usolve(u, y);\n\n // apply column permutations if needed (x is a DenseMatrix)\n if (q) {\n x._data = csIpvec(q, x._data);\n }\n return x;\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Permutes a vector; x = P'b. In MATLAB notation, x(p)=b.\n *\n * @param {Array} p The permutation vector of length n. null value denotes identity\n * @param {Array} b The input vector\n *\n * @return {Array} The output vector x = P'b\n */\nexport function csIpvec(p, b) {\n // vars\n var k;\n var n = b.length;\n var x = [];\n // check permutation vector was provided, p = null denotes identity\n if (p) {\n // loop vector\n for (k = 0; k < n; k++) {\n // apply permutation\n x[p[k]] = b[k];\n }\n } else {\n // loop vector\n for (k = 0; k < n; k++) {\n // x[i] = b[i]\n x[k] = b[k];\n }\n }\n return x;\n}", "import { factory } from '../../utils/factory.js';\nvar name = 'polynomialRoot';\nvar dependencies = ['typed', 'isZero', 'equalScalar', 'add', 'subtract', 'multiply', 'divide', 'sqrt', 'unaryMinus', 'cbrt', 'typeOf', 'im', 're'];\nexport var createPolynomialRoot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isZero,\n equalScalar,\n add,\n subtract,\n multiply,\n divide,\n sqrt,\n unaryMinus,\n cbrt,\n typeOf,\n im,\n re\n } = _ref;\n /**\n * Finds the numerical values of the distinct roots of a polynomial with real or complex coefficients.\n * Currently operates only on linear, quadratic, and cubic polynomials using the standard\n * formulas for the roots.\n *\n * Syntax:\n *\n * math.polynomialRoot(constant, linearCoeff, quadraticCoeff, cubicCoeff)\n *\n * Examples:\n * // linear\n * math.polynomialRoot(6, 3) // [-2]\n * math.polynomialRoot(math.complex(6,3), 3) // [-2 - i]\n * math.polynomialRoot(math.complex(6,3), math.complex(2,1)) // [-3 + 0i]\n * // quadratic\n * math.polynomialRoot(2, -3, 1) // [2, 1]\n * math.polynomialRoot(8, 8, 2) // [-2]\n * math.polynomialRoot(-2, 0, 1) // [1.4142135623730951, -1.4142135623730951]\n * math.polynomialRoot(2, -2, 1) // [1 + i, 1 - i]\n * math.polynomialRoot(math.complex(1,3), math.complex(-3, -2), 1) // [2 + i, 1 + i]\n * // cubic\n * math.polynomialRoot(-6, 11, -6, 1) // [1, 3, 2]\n * math.polynomialRoot(-8, 0, 0, 1) // [-1 - 1.7320508075688774i, 2, -1 + 1.7320508075688774i]\n * math.polynomialRoot(0, 8, 8, 2) // [0, -2]\n * math.polynomialRoot(1, 1, 1, 1) // [-1 + 0i, 0 - i, 0 + i]\n *\n * See also:\n * cbrt, sqrt\n *\n * @param {... number | Complex} coeffs\n * The coefficients of the polynomial, starting with with the constant coefficent, followed\n * by the linear coefficient and subsequent coefficients of increasing powers.\n * @return {Array} The distinct roots of the polynomial\n */\n\n return typed(name, {\n 'number|Complex, ...number|Complex': (constant, restCoeffs) => {\n var coeffs = [constant, ...restCoeffs];\n while (coeffs.length > 0 && isZero(coeffs[coeffs.length - 1])) {\n coeffs.pop();\n }\n if (coeffs.length < 2) {\n throw new RangeError(\"Polynomial [\".concat(constant, \", \").concat(restCoeffs, \"] must have a non-zero non-constant coefficient\"));\n }\n switch (coeffs.length) {\n case 2:\n // linear\n return [unaryMinus(divide(coeffs[0], coeffs[1]))];\n case 3:\n {\n // quadratic\n var [c, b, a] = coeffs;\n var denom = multiply(2, a);\n var d1 = multiply(b, b);\n var d2 = multiply(4, a, c);\n if (equalScalar(d1, d2)) return [divide(unaryMinus(b), denom)];\n var discriminant = sqrt(subtract(d1, d2));\n return [divide(subtract(discriminant, b), denom), divide(subtract(unaryMinus(discriminant), b), denom)];\n }\n case 4:\n {\n // cubic, cf. https://en.wikipedia.org/wiki/Cubic_equation\n var [d, _c, _b, _a] = coeffs;\n var _denom = unaryMinus(multiply(3, _a));\n var D0_1 = multiply(_b, _b);\n var D0_2 = multiply(3, _a, _c);\n var D1_1 = add(multiply(2, _b, _b, _b), multiply(27, _a, _a, d));\n var D1_2 = multiply(9, _a, _b, _c);\n if (equalScalar(D0_1, D0_2) && equalScalar(D1_1, D1_2)) {\n return [divide(_b, _denom)];\n }\n var Delta0 = subtract(D0_1, D0_2);\n var Delta1 = subtract(D1_1, D1_2);\n var discriminant1 = add(multiply(18, _a, _b, _c, d), multiply(_b, _b, _c, _c));\n var discriminant2 = add(multiply(4, _b, _b, _b, d), multiply(4, _a, _c, _c, _c), multiply(27, _a, _a, d, d));\n if (equalScalar(discriminant1, discriminant2)) {\n return [divide(subtract(multiply(4, _a, _b, _c), add(multiply(9, _a, _a, d), multiply(_b, _b, _b))), multiply(_a, Delta0)),\n // simple root\n divide(subtract(multiply(9, _a, d), multiply(_b, _c)), multiply(2, Delta0)) // double root\n ];\n }\n // OK, we have three distinct roots\n var Ccubed;\n if (equalScalar(D0_1, D0_2)) {\n Ccubed = Delta1;\n } else {\n Ccubed = divide(add(Delta1, sqrt(subtract(multiply(Delta1, Delta1), multiply(4, Delta0, Delta0, Delta0)))), 2);\n }\n var allRoots = true;\n var rawRoots = cbrt(Ccubed, allRoots).toArray().map(C => divide(add(_b, C, divide(Delta0, C)), _denom));\n return rawRoots.map(r => {\n if (typeOf(r) === 'Complex' && equalScalar(re(r), re(r) + im(r))) {\n return re(r);\n }\n return r;\n });\n }\n default:\n throw new RangeError(\"only implemented for cubic or lower-order polynomials, not \".concat(coeffs));\n }\n }\n });\n});", "import { isHelp } from '../utils/is.js';\nimport { clone } from '../utils/object.js';\nimport { format } from '../utils/string.js';\nimport { factory } from '../utils/factory.js';\nvar name = 'Help';\nvar dependencies = ['evaluate'];\nexport var createHelpClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate\n } = _ref;\n /**\n * Documentation object\n * @param {Object} doc Object containing properties:\n * {string} name\n * {string} category\n * {string} description\n * {string[]} syntax\n * {string[]} examples\n * {string[]} seealso\n * @constructor\n */\n function Help(doc) {\n if (!(this instanceof Help)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (!doc) throw new Error('Argument \"doc\" missing');\n this.doc = doc;\n }\n\n /**\n * Attach type information\n */\n Help.prototype.type = 'Help';\n Help.prototype.isHelp = true;\n\n /**\n * Generate a string representation of the Help object\n * @return {string} Returns a string\n * @private\n */\n Help.prototype.toString = function () {\n var doc = this.doc || {};\n var desc = '\\n';\n if (doc.name) {\n desc += 'Name: ' + doc.name + '\\n\\n';\n }\n if (doc.category) {\n desc += 'Category: ' + doc.category + '\\n\\n';\n }\n if (doc.description) {\n desc += 'Description:\\n ' + doc.description + '\\n\\n';\n }\n if (doc.syntax) {\n desc += 'Syntax:\\n ' + doc.syntax.join('\\n ') + '\\n\\n';\n }\n if (doc.examples) {\n desc += 'Examples:\\n';\n\n // after evaluating the examples, we restore config in case the examples\n // did change the config.\n var configChanged = false;\n var originalConfig = evaluate('config()');\n var scope = {\n config: newConfig => {\n configChanged = true;\n return evaluate('config(newConfig)', {\n newConfig\n });\n }\n };\n for (var i = 0; i < doc.examples.length; i++) {\n var expr = doc.examples[i];\n desc += ' ' + expr + '\\n';\n var res = void 0;\n try {\n // note: res can be undefined when `expr` is an empty string\n res = evaluate(expr, scope);\n } catch (e) {\n res = e;\n }\n if (res !== undefined && !isHelp(res)) {\n desc += ' ' + format(res, {\n precision: 14\n }) + '\\n';\n }\n }\n desc += '\\n';\n if (configChanged) {\n evaluate('config(originalConfig)', {\n originalConfig\n });\n }\n }\n if (doc.mayThrow && doc.mayThrow.length) {\n desc += 'Throws: ' + doc.mayThrow.join(', ') + '\\n\\n';\n }\n if (doc.seealso && doc.seealso.length) {\n desc += 'See also: ' + doc.seealso.join(', ') + '\\n';\n }\n return desc;\n };\n\n /**\n * Export the help object to JSON\n */\n Help.prototype.toJSON = function () {\n var obj = clone(this.doc);\n obj.mathjs = 'Help';\n return obj;\n };\n\n /**\n * Instantiate a Help object from a JSON object\n * @param {Object} json\n * @returns {Help} Returns a new Help object\n */\n Help.fromJSON = function (json) {\n var doc = {};\n Object.keys(json).filter(prop => prop !== 'mathjs').forEach(prop => {\n doc[prop] = json[prop];\n });\n return new Help(doc);\n };\n\n /**\n * Returns a string representation of the Help object\n */\n Help.prototype.valueOf = Help.prototype.toString;\n return Help;\n}, {\n isClass: true\n});", "import { isChain } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { hasOwnProperty, lazy } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Chain';\nvar dependencies = ['?on', 'math', 'typed'];\nexport var createChainClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n math,\n typed\n } = _ref;\n /**\n * @constructor Chain\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing chain.done(), which will return\n * the final value.\n *\n * The Chain has a number of special functions:\n * - done() Finalize the chained operation and return the\n * chain's value.\n * - valueOf() The same as done()\n * - toString() Returns a string representation of the chain's value.\n *\n * @param {*} [value]\n */\n function Chain(value) {\n if (!(this instanceof Chain)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (isChain(value)) {\n this.value = value.value;\n } else {\n this.value = value;\n }\n }\n\n /**\n * Attach type information\n */\n Chain.prototype.type = 'Chain';\n Chain.prototype.isChain = true;\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method valueOf()\n * @returns {*} value\n */\n Chain.prototype.done = function () {\n return this.value;\n };\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method done()\n * @returns {*} value\n */\n Chain.prototype.valueOf = function () {\n return this.value;\n };\n\n /**\n * Get a string representation of the value in the chain\n * @returns {string}\n */\n Chain.prototype.toString = function () {\n return format(this.value);\n };\n\n /**\n * Get a JSON representation of the chain\n * @returns {Object}\n */\n Chain.prototype.toJSON = function () {\n return {\n mathjs: 'Chain',\n value: this.value\n };\n };\n\n /**\n * Instantiate a Chain from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"Chain\", value: ...}`,\n * where mathjs is optional\n * @returns {Chain}\n */\n Chain.fromJSON = function (json) {\n return new Chain(json.value);\n };\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {Function} fn The function to be proxied\n * If fn is no function, it is silently ignored.\n * @private\n */\n function createProxy(name, fn) {\n if (typeof fn === 'function') {\n Chain.prototype[name] = chainify(fn);\n }\n }\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {function} resolver The function resolving with the\n * function to be proxied\n * @private\n */\n function createLazyProxy(name, resolver) {\n lazy(Chain.prototype, name, function outerResolver() {\n var fn = resolver();\n if (typeof fn === 'function') {\n return chainify(fn);\n }\n return undefined; // if not a function, ignore\n });\n }\n\n /**\n * Make a function chainable\n * @param {function} fn\n * @return {Function} chain function\n * @private\n */\n function chainify(fn) {\n return function () {\n // Here, `this` will be the context of a Chain instance\n if (arguments.length === 0) {\n return new Chain(fn(this.value));\n }\n var args = [this.value];\n for (var i = 0; i < arguments.length; i++) {\n args[i + 1] = arguments[i];\n }\n if (typed.isTypedFunction(fn)) {\n var sigObject = typed.resolve(fn, args);\n // We want to detect if a rest parameter has matched across the\n // value in the chain and the current arguments of this call.\n // That is the case if and only if the matching signature has\n // exactly one parameter (which then must be a rest parameter\n // as it is matching at least two actual arguments).\n if (sigObject.params.length === 1) {\n throw new Error('chain function ' + fn.name + ' cannot match rest parameter between chain value and additional arguments.');\n }\n return new Chain(sigObject.implementation.apply(fn, args));\n }\n return new Chain(fn.apply(fn, args));\n };\n }\n\n /**\n * Create a proxy for a single method, or an object with multiple methods.\n * Example usage:\n *\n * Chain.createProxy('add', function add (x, y) {...})\n * Chain.createProxy({\n * add: function add (x, y) {...},\n * subtract: function subtract (x, y) {...}\n * }\n *\n * @param {string | Object} arg0 A name (string), or an object with\n * functions\n * @param {*} [arg1] A function, when arg0 is a name\n */\n Chain.createProxy = function (arg0, arg1) {\n if (typeof arg0 === 'string') {\n // createProxy(name, value)\n createProxy(arg0, arg1);\n } else {\n var _loop = function _loop(_name) {\n if (hasOwnProperty(arg0, _name) && excludedNames[_name] === undefined) {\n createLazyProxy(_name, () => arg0[_name]);\n }\n };\n // createProxy(values)\n for (var _name in arg0) {\n _loop(_name);\n }\n }\n };\n var excludedNames = {\n expression: true,\n docs: true,\n type: true,\n classes: true,\n json: true,\n error: true,\n isChain: true // conflicts with the property isChain of a Chain instance\n };\n\n // create proxy for everything that is in math.js\n Chain.createProxy(math);\n\n // register on the import event, automatically add a proxy for every imported function.\n if (on) {\n on('import', function (name, resolver, path) {\n if (!path) {\n // an imported function (not a data type or something special)\n createLazyProxy(name, resolver);\n }\n });\n }\n return Chain;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { embeddedDocs } from '../embeddedDocs/embeddedDocs.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nvar name = 'help';\nvar dependencies = ['typed', 'mathWithTransform', 'Help'];\nexport var createHelp = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n mathWithTransform,\n Help\n } = _ref;\n /**\n * Retrieve help on a function or data type.\n * Help files are retrieved from the embedded documentation in math.docs.\n *\n * Syntax:\n *\n * math.help(search)\n *\n * Examples:\n *\n * console.log(math.help('sin').toString())\n * console.log(math.help(math.add).toString())\n * console.log(math.help(math.add).toJSON())\n *\n * @param {Function | string | Object} search A function or function name\n * for which to get help\n * @return {Help} A help object\n */\n return typed(name, {\n any: function any(search) {\n var prop;\n var searchName = search;\n if (typeof search !== 'string') {\n for (prop in mathWithTransform) {\n // search in functions and constants\n if (hasOwnProperty(mathWithTransform, prop) && search === mathWithTransform[prop]) {\n searchName = prop;\n break;\n }\n }\n\n /* TODO: implement help for data types\n if (!text) {\n // search data type\n for (prop in math.type) {\n if (hasOwnProperty(math, prop)) {\n if (search === math.type[prop]) {\n text = prop\n break\n }\n }\n }\n }\n */\n }\n var doc = getSafeProperty(embeddedDocs, searchName);\n if (!doc) {\n var searchText = typeof searchName === 'function' ? searchName.name : searchName;\n throw new Error('No documentation found on \"' + searchText + '\"');\n }\n return new Help(doc);\n }\n });\n});", "import { eDocs } from './constants/e.js';\nimport { falseDocs } from './constants/false.js';\nimport { iDocs } from './constants/i.js';\nimport { InfinityDocs } from './constants/Infinity.js';\nimport { LN10Docs } from './constants/LN10.js';\nimport { LN2Docs } from './constants/LN2.js';\nimport { LOG10EDocs } from './constants/LOG10E.js';\nimport { LOG2EDocs } from './constants/LOG2E.js';\nimport { NaNDocs } from './constants/NaN.js';\nimport { nullDocs } from './constants/null.js';\nimport { phiDocs } from './constants/phi.js';\nimport { piDocs } from './constants/pi.js';\nimport { SQRT12Docs } from './constants/SQRT1_2.js';\nimport { SQRT2Docs } from './constants/SQRT2.js';\nimport { tauDocs } from './constants/tau.js';\nimport { trueDocs } from './constants/true.js';\nimport { versionDocs } from './constants/version.js';\nimport { bignumberDocs } from './construction/bignumber.js';\nimport { bigintDocs } from './construction/bigint.js';\nimport { booleanDocs } from './construction/boolean.js';\nimport { complexDocs } from './construction/complex.js';\nimport { createUnitDocs } from './construction/createUnit.js';\nimport { fractionDocs } from './construction/fraction.js';\nimport { indexDocs } from './construction/index.js';\nimport { matrixDocs } from './construction/matrix.js';\nimport { numberDocs } from './construction/number.js';\nimport { sparseDocs } from './construction/sparse.js';\nimport { splitUnitDocs } from './construction/splitUnit.js';\nimport { stringDocs } from './construction/string.js';\nimport { unitDocs } from './construction/unit.js';\nimport { configDocs } from './core/config.js';\nimport { importDocs } from './core/import.js';\nimport { typedDocs } from './core/typed.js';\nimport { derivativeDocs } from './function/algebra/derivative.js';\nimport { leafCountDocs } from './function/algebra/leafCount.js';\nimport { lsolveDocs } from './function/algebra/lsolve.js';\nimport { lsolveAllDocs } from './function/algebra/lsolveAll.js';\nimport { lupDocs } from './function/algebra/lup.js';\nimport { lusolveDocs } from './function/algebra/lusolve.js';\nimport { polynomialRootDocs } from './function/algebra/polynomialRoot.js';\nimport { qrDocs } from './function/algebra/qr.js';\nimport { rationalizeDocs } from './function/algebra/rationalize.js';\nimport { resolveDocs } from './function/algebra/resolve.js';\nimport { simplifyDocs } from './function/algebra/simplify.js';\nimport { simplifyConstantDocs } from './function/algebra/simplifyConstant.js';\nimport { simplifyCoreDocs } from './function/algebra/simplifyCore.js';\nimport { sluDocs } from './function/algebra/slu.js';\nimport { symbolicEqualDocs } from './function/algebra/symbolicEqual.js';\nimport { usolveDocs } from './function/algebra/usolve.js';\nimport { usolveAllDocs } from './function/algebra/usolveAll.js';\nimport { absDocs } from './function/arithmetic/abs.js';\nimport { addDocs } from './function/arithmetic/add.js';\nimport { cbrtDocs } from './function/arithmetic/cbrt.js';\nimport { ceilDocs } from './function/arithmetic/ceil.js';\nimport { cubeDocs } from './function/arithmetic/cube.js';\nimport { divideDocs } from './function/arithmetic/divide.js';\nimport { dotDivideDocs } from './function/arithmetic/dotDivide.js';\nimport { dotMultiplyDocs } from './function/arithmetic/dotMultiply.js';\nimport { dotPowDocs } from './function/arithmetic/dotPow.js';\nimport { expDocs } from './function/arithmetic/exp.js';\nimport { expmDocs } from './function/arithmetic/expm.js';\nimport { expm1Docs } from './function/arithmetic/expm1.js';\nimport { fixDocs } from './function/arithmetic/fix.js';\nimport { floorDocs } from './function/arithmetic/floor.js';\nimport { gcdDocs } from './function/arithmetic/gcd.js';\nimport { hypotDocs } from './function/arithmetic/hypot.js';\nimport { invmodDocs } from './function/arithmetic/invmod.js';\nimport { lcmDocs } from './function/arithmetic/lcm.js';\nimport { logDocs } from './function/arithmetic/log.js';\nimport { log10Docs } from './function/arithmetic/log10.js';\nimport { log1pDocs } from './function/arithmetic/log1p.js';\nimport { log2Docs } from './function/arithmetic/log2.js';\nimport { modDocs } from './function/arithmetic/mod.js';\nimport { multiplyDocs } from './function/arithmetic/multiply.js';\nimport { normDocs } from './function/arithmetic/norm.js';\nimport { nthRootDocs } from './function/arithmetic/nthRoot.js';\nimport { nthRootsDocs } from './function/arithmetic/nthRoots.js';\nimport { powDocs } from './function/arithmetic/pow.js';\nimport { roundDocs } from './function/arithmetic/round.js';\nimport { signDocs } from './function/arithmetic/sign.js';\nimport { sqrtDocs } from './function/arithmetic/sqrt.js';\nimport { sqrtmDocs } from './function/arithmetic/sqrtm.js';\nimport { sylvesterDocs } from './function/algebra/sylvester.js';\nimport { schurDocs } from './function/algebra/schur.js';\nimport { lyapDocs } from './function/algebra/lyap.js';\nimport { squareDocs } from './function/arithmetic/square.js';\nimport { subtractDocs } from './function/arithmetic/subtract.js';\nimport { unaryMinusDocs } from './function/arithmetic/unaryMinus.js';\nimport { unaryPlusDocs } from './function/arithmetic/unaryPlus.js';\nimport { xgcdDocs } from './function/arithmetic/xgcd.js';\nimport { bitAndDocs } from './function/bitwise/bitAnd.js';\nimport { bitNotDocs } from './function/bitwise/bitNot.js';\nimport { bitOrDocs } from './function/bitwise/bitOr.js';\nimport { bitXorDocs } from './function/bitwise/bitXor.js';\nimport { leftShiftDocs } from './function/bitwise/leftShift.js';\nimport { rightArithShiftDocs } from './function/bitwise/rightArithShift.js';\nimport { rightLogShiftDocs } from './function/bitwise/rightLogShift.js';\nimport { bellNumbersDocs } from './function/combinatorics/bellNumbers.js';\nimport { catalanDocs } from './function/combinatorics/catalan.js';\nimport { compositionDocs } from './function/combinatorics/composition.js';\nimport { stirlingS2Docs } from './function/combinatorics/stirlingS2.js';\nimport { argDocs } from './function/complex/arg.js';\nimport { conjDocs } from './function/complex/conj.js';\nimport { imDocs } from './function/complex/im.js';\nimport { reDocs } from './function/complex/re.js';\nimport { evaluateDocs } from './function/expression/evaluate.js';\nimport { helpDocs } from './function/expression/help.js';\nimport { distanceDocs } from './function/geometry/distance.js';\nimport { intersectDocs } from './function/geometry/intersect.js';\nimport { andDocs } from './function/logical/and.js';\nimport { notDocs } from './function/logical/not.js';\nimport { orDocs } from './function/logical/or.js';\nimport { xorDocs } from './function/logical/xor.js';\nimport { columnDocs } from './function/matrix/column.js';\nimport { concatDocs } from './function/matrix/concat.js';\nimport { countDocs } from './function/matrix/count.js';\nimport { crossDocs } from './function/matrix/cross.js';\nimport { ctransposeDocs } from './function/matrix/ctranspose.js';\nimport { detDocs } from './function/matrix/det.js';\nimport { diagDocs } from './function/matrix/diag.js';\nimport { diffDocs } from './function/matrix/diff.js';\nimport { dotDocs } from './function/matrix/dot.js';\nimport { eigsDocs } from './function/matrix/eigs.js';\nimport { filterDocs } from './function/matrix/filter.js';\nimport { flattenDocs } from './function/matrix/flatten.js';\nimport { forEachDocs } from './function/matrix/forEach.js';\nimport { getMatrixDataTypeDocs } from './function/matrix/getMatrixDataType.js';\nimport { identityDocs } from './function/matrix/identity.js';\nimport { invDocs } from './function/matrix/inv.js';\nimport { pinvDocs } from './function/matrix/pinv.js';\nimport { kronDocs } from './function/matrix/kron.js';\nimport { mapDocs } from './function/matrix/map.js';\nimport { matrixFromColumnsDocs } from './function/matrix/matrixFromColumns.js';\nimport { matrixFromFunctionDocs } from './function/matrix/matrixFromFunction.js';\nimport { matrixFromRowsDocs } from './function/matrix/matrixFromRows.js';\nimport { onesDocs } from './function/matrix/ones.js';\nimport { partitionSelectDocs } from './function/matrix/partitionSelect.js';\nimport { rangeDocs } from './function/matrix/range.js';\nimport { reshapeDocs } from './function/matrix/reshape.js';\nimport { resizeDocs } from './function/matrix/resize.js';\nimport { rotateDocs } from './function/matrix/rotate.js';\nimport { rotationMatrixDocs } from './function/matrix/rotationMatrix.js';\nimport { rowDocs } from './function/matrix/row.js';\nimport { sizeDocs } from './function/matrix/size.js';\nimport { sortDocs } from './function/matrix/sort.js';\nimport { squeezeDocs } from './function/matrix/squeeze.js';\nimport { subsetDocs } from './function/matrix/subset.js';\nimport { traceDocs } from './function/matrix/trace.js';\nimport { transposeDocs } from './function/matrix/transpose.js';\nimport { zerosDocs } from './function/matrix/zeros.js';\nimport { fftDocs } from './function/matrix/fft.js';\nimport { ifftDocs } from './function/matrix/ifft.js';\nimport { combinationsDocs } from './function/probability/combinations.js';\nimport { combinationsWithRepDocs } from './function/probability/combinationsWithRep.js';\nimport { factorialDocs } from './function/probability/factorial.js';\nimport { gammaDocs } from './function/probability/gamma.js';\nimport { lgammaDocs } from './function/probability/lgamma.js';\nimport { kldivergenceDocs } from './function/probability/kldivergence.js';\nimport { multinomialDocs } from './function/probability/multinomial.js';\nimport { permutationsDocs } from './function/probability/permutations.js';\nimport { pickRandomDocs } from './function/probability/pickRandom.js';\nimport { randomDocs } from './function/probability/random.js';\nimport { randomIntDocs } from './function/probability/randomInt.js';\nimport { compareDocs } from './function/relational/compare.js';\nimport { compareNaturalDocs } from './function/relational/compareNatural.js';\nimport { compareTextDocs } from './function/relational/compareText.js';\nimport { deepEqualDocs } from './function/relational/deepEqual.js';\nimport { equalDocs } from './function/relational/equal.js';\nimport { equalTextDocs } from './function/relational/equalText.js';\nimport { largerDocs } from './function/relational/larger.js';\nimport { largerEqDocs } from './function/relational/largerEq.js';\nimport { smallerDocs } from './function/relational/smaller.js';\nimport { smallerEqDocs } from './function/relational/smallerEq.js';\nimport { unequalDocs } from './function/relational/unequal.js';\nimport { setCartesianDocs } from './function/set/setCartesian.js';\nimport { setDifferenceDocs } from './function/set/setDifference.js';\nimport { setDistinctDocs } from './function/set/setDistinct.js';\nimport { setIntersectDocs } from './function/set/setIntersect.js';\nimport { setIsSubsetDocs } from './function/set/setIsSubset.js';\nimport { setMultiplicityDocs } from './function/set/setMultiplicity.js';\nimport { setPowersetDocs } from './function/set/setPowerset.js';\nimport { setSizeDocs } from './function/set/setSize.js';\nimport { setSymDifferenceDocs } from './function/set/setSymDifference.js';\nimport { setUnionDocs } from './function/set/setUnion.js';\nimport { zpk2tfDocs } from './function/signal/zpk2tf.js';\nimport { freqzDocs } from './function/signal/freqz.js';\nimport { erfDocs } from './function/special/erf.js';\nimport { zetaDocs } from './function/special/zeta.js';\nimport { madDocs } from './function/statistics/mad.js';\nimport { maxDocs } from './function/statistics/max.js';\nimport { meanDocs } from './function/statistics/mean.js';\nimport { medianDocs } from './function/statistics/median.js';\nimport { minDocs } from './function/statistics/min.js';\nimport { modeDocs } from './function/statistics/mode.js';\nimport { prodDocs } from './function/statistics/prod.js';\nimport { quantileSeqDocs } from './function/statistics/quantileSeq.js';\nimport { stdDocs } from './function/statistics/std.js';\nimport { cumSumDocs } from './function/statistics/cumsum.js';\nimport { sumDocs } from './function/statistics/sum.js';\nimport { varianceDocs } from './function/statistics/variance.js';\nimport { corrDocs } from './function/statistics/corr.js';\nimport { acosDocs } from './function/trigonometry/acos.js';\nimport { acoshDocs } from './function/trigonometry/acosh.js';\nimport { acotDocs } from './function/trigonometry/acot.js';\nimport { acothDocs } from './function/trigonometry/acoth.js';\nimport { acscDocs } from './function/trigonometry/acsc.js';\nimport { acschDocs } from './function/trigonometry/acsch.js';\nimport { asecDocs } from './function/trigonometry/asec.js';\nimport { asechDocs } from './function/trigonometry/asech.js';\nimport { asinDocs } from './function/trigonometry/asin.js';\nimport { asinhDocs } from './function/trigonometry/asinh.js';\nimport { atanDocs } from './function/trigonometry/atan.js';\nimport { atan2Docs } from './function/trigonometry/atan2.js';\nimport { atanhDocs } from './function/trigonometry/atanh.js';\nimport { cosDocs } from './function/trigonometry/cos.js';\nimport { coshDocs } from './function/trigonometry/cosh.js';\nimport { cotDocs } from './function/trigonometry/cot.js';\nimport { cothDocs } from './function/trigonometry/coth.js';\nimport { cscDocs } from './function/trigonometry/csc.js';\nimport { cschDocs } from './function/trigonometry/csch.js';\nimport { secDocs } from './function/trigonometry/sec.js';\nimport { sechDocs } from './function/trigonometry/sech.js';\nimport { sinDocs } from './function/trigonometry/sin.js';\nimport { sinhDocs } from './function/trigonometry/sinh.js';\nimport { tanDocs } from './function/trigonometry/tan.js';\nimport { tanhDocs } from './function/trigonometry/tanh.js';\nimport { toDocs } from './function/units/to.js';\nimport { binDocs } from './function/utils/bin.js';\nimport { cloneDocs } from './function/utils/clone.js';\nimport { formatDocs } from './function/utils/format.js';\nimport { hasNumericValueDocs } from './function/utils/hasNumericValue.js';\nimport { hexDocs } from './function/utils/hex.js';\nimport { isIntegerDocs } from './function/utils/isInteger.js';\nimport { isNaNDocs } from './function/utils/isNaN.js';\nimport { isNegativeDocs } from './function/utils/isNegative.js';\nimport { isNumericDocs } from './function/utils/isNumeric.js';\nimport { isPositiveDocs } from './function/utils/isPositive.js';\nimport { isPrimeDocs } from './function/utils/isPrime.js';\nimport { isZeroDocs } from './function/utils/isZero.js';\nimport { numericDocs } from './function/utils/numeric.js';\nimport { octDocs } from './function/utils/oct.js';\nimport { printDocs } from './function/utils/print.js';\nimport { typeOfDocs } from './function/utils/typeOf.js';\nimport { solveODEDocs } from './function/numeric/solveODE.js';\nexport var embeddedDocs = {\n // construction functions\n bignumber: bignumberDocs,\n bigint: bigintDocs,\n boolean: booleanDocs,\n complex: complexDocs,\n createUnit: createUnitDocs,\n fraction: fractionDocs,\n index: indexDocs,\n matrix: matrixDocs,\n number: numberDocs,\n sparse: sparseDocs,\n splitUnit: splitUnitDocs,\n string: stringDocs,\n unit: unitDocs,\n // constants\n e: eDocs,\n E: eDocs,\n false: falseDocs,\n i: iDocs,\n Infinity: InfinityDocs,\n LN2: LN2Docs,\n LN10: LN10Docs,\n LOG2E: LOG2EDocs,\n LOG10E: LOG10EDocs,\n NaN: NaNDocs,\n null: nullDocs,\n pi: piDocs,\n PI: piDocs,\n phi: phiDocs,\n SQRT1_2: SQRT12Docs,\n SQRT2: SQRT2Docs,\n tau: tauDocs,\n true: trueDocs,\n version: versionDocs,\n // physical constants\n // TODO: more detailed docs for physical constants\n speedOfLight: {\n description: 'Speed of light in vacuum',\n examples: ['speedOfLight']\n },\n gravitationConstant: {\n description: 'Newtonian constant of gravitation',\n examples: ['gravitationConstant']\n },\n planckConstant: {\n description: 'Planck constant',\n examples: ['planckConstant']\n },\n reducedPlanckConstant: {\n description: 'Reduced Planck constant',\n examples: ['reducedPlanckConstant']\n },\n magneticConstant: {\n description: 'Magnetic constant (vacuum permeability)',\n examples: ['magneticConstant']\n },\n electricConstant: {\n description: 'Electric constant (vacuum permeability)',\n examples: ['electricConstant']\n },\n vacuumImpedance: {\n description: 'Characteristic impedance of vacuum',\n examples: ['vacuumImpedance']\n },\n coulomb: {\n description: 'Coulomb\\'s constant',\n examples: ['coulomb']\n },\n elementaryCharge: {\n description: 'Elementary charge',\n examples: ['elementaryCharge']\n },\n bohrMagneton: {\n description: 'Borh magneton',\n examples: ['bohrMagneton']\n },\n conductanceQuantum: {\n description: 'Conductance quantum',\n examples: ['conductanceQuantum']\n },\n inverseConductanceQuantum: {\n description: 'Inverse conductance quantum',\n examples: ['inverseConductanceQuantum']\n },\n // josephson: {description: 'Josephson constant', examples: ['josephson']},\n magneticFluxQuantum: {\n description: 'Magnetic flux quantum',\n examples: ['magneticFluxQuantum']\n },\n nuclearMagneton: {\n description: 'Nuclear magneton',\n examples: ['nuclearMagneton']\n },\n klitzing: {\n description: 'Von Klitzing constant',\n examples: ['klitzing']\n },\n bohrRadius: {\n description: 'Borh radius',\n examples: ['bohrRadius']\n },\n classicalElectronRadius: {\n description: 'Classical electron radius',\n examples: ['classicalElectronRadius']\n },\n electronMass: {\n description: 'Electron mass',\n examples: ['electronMass']\n },\n fermiCoupling: {\n description: 'Fermi coupling constant',\n examples: ['fermiCoupling']\n },\n fineStructure: {\n description: 'Fine-structure constant',\n examples: ['fineStructure']\n },\n hartreeEnergy: {\n description: 'Hartree energy',\n examples: ['hartreeEnergy']\n },\n protonMass: {\n description: 'Proton mass',\n examples: ['protonMass']\n },\n deuteronMass: {\n description: 'Deuteron Mass',\n examples: ['deuteronMass']\n },\n neutronMass: {\n description: 'Neutron mass',\n examples: ['neutronMass']\n },\n quantumOfCirculation: {\n description: 'Quantum of circulation',\n examples: ['quantumOfCirculation']\n },\n rydberg: {\n description: 'Rydberg constant',\n examples: ['rydberg']\n },\n thomsonCrossSection: {\n description: 'Thomson cross section',\n examples: ['thomsonCrossSection']\n },\n weakMixingAngle: {\n description: 'Weak mixing angle',\n examples: ['weakMixingAngle']\n },\n efimovFactor: {\n description: 'Efimov factor',\n examples: ['efimovFactor']\n },\n atomicMass: {\n description: 'Atomic mass constant',\n examples: ['atomicMass']\n },\n avogadro: {\n description: 'Avogadro\\'s number',\n examples: ['avogadro']\n },\n boltzmann: {\n description: 'Boltzmann constant',\n examples: ['boltzmann']\n },\n faraday: {\n description: 'Faraday constant',\n examples: ['faraday']\n },\n firstRadiation: {\n description: 'First radiation constant',\n examples: ['firstRadiation']\n },\n loschmidt: {\n description: 'Loschmidt constant at T=273.15 K and p=101.325 kPa',\n examples: ['loschmidt']\n },\n gasConstant: {\n description: 'Gas constant',\n examples: ['gasConstant']\n },\n molarPlanckConstant: {\n description: 'Molar Planck constant',\n examples: ['molarPlanckConstant']\n },\n molarVolume: {\n description: 'Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa',\n examples: ['molarVolume']\n },\n sackurTetrode: {\n description: 'Sackur-Tetrode constant at T=1 K and p=101.325 kPa',\n examples: ['sackurTetrode']\n },\n secondRadiation: {\n description: 'Second radiation constant',\n examples: ['secondRadiation']\n },\n stefanBoltzmann: {\n description: 'Stefan-Boltzmann constant',\n examples: ['stefanBoltzmann']\n },\n wienDisplacement: {\n description: 'Wien displacement law constant',\n examples: ['wienDisplacement']\n },\n // spectralRadiance: {description: 'First radiation constant for spectral radiance', examples: ['spectralRadiance']},\n\n molarMass: {\n description: 'Molar mass constant',\n examples: ['molarMass']\n },\n molarMassC12: {\n description: 'Molar mass constant of carbon-12',\n examples: ['molarMassC12']\n },\n gravity: {\n description: 'Standard acceleration of gravity (standard acceleration of free-fall on Earth)',\n examples: ['gravity']\n },\n planckLength: {\n description: 'Planck length',\n examples: ['planckLength']\n },\n planckMass: {\n description: 'Planck mass',\n examples: ['planckMass']\n },\n planckTime: {\n description: 'Planck time',\n examples: ['planckTime']\n },\n planckCharge: {\n description: 'Planck charge',\n examples: ['planckCharge']\n },\n planckTemperature: {\n description: 'Planck temperature',\n examples: ['planckTemperature']\n },\n // functions - algebra\n derivative: derivativeDocs,\n lsolve: lsolveDocs,\n lsolveAll: lsolveAllDocs,\n lup: lupDocs,\n lusolve: lusolveDocs,\n leafCount: leafCountDocs,\n polynomialRoot: polynomialRootDocs,\n resolve: resolveDocs,\n simplify: simplifyDocs,\n simplifyConstant: simplifyConstantDocs,\n simplifyCore: simplifyCoreDocs,\n symbolicEqual: symbolicEqualDocs,\n rationalize: rationalizeDocs,\n slu: sluDocs,\n usolve: usolveDocs,\n usolveAll: usolveAllDocs,\n qr: qrDocs,\n // functions - arithmetic\n abs: absDocs,\n add: addDocs,\n cbrt: cbrtDocs,\n ceil: ceilDocs,\n cube: cubeDocs,\n divide: divideDocs,\n dotDivide: dotDivideDocs,\n dotMultiply: dotMultiplyDocs,\n dotPow: dotPowDocs,\n exp: expDocs,\n expm: expmDocs,\n expm1: expm1Docs,\n fix: fixDocs,\n floor: floorDocs,\n gcd: gcdDocs,\n hypot: hypotDocs,\n lcm: lcmDocs,\n log: logDocs,\n log2: log2Docs,\n log1p: log1pDocs,\n log10: log10Docs,\n mod: modDocs,\n multiply: multiplyDocs,\n norm: normDocs,\n nthRoot: nthRootDocs,\n nthRoots: nthRootsDocs,\n pow: powDocs,\n round: roundDocs,\n sign: signDocs,\n sqrt: sqrtDocs,\n sqrtm: sqrtmDocs,\n square: squareDocs,\n subtract: subtractDocs,\n unaryMinus: unaryMinusDocs,\n unaryPlus: unaryPlusDocs,\n xgcd: xgcdDocs,\n invmod: invmodDocs,\n // functions - bitwise\n bitAnd: bitAndDocs,\n bitNot: bitNotDocs,\n bitOr: bitOrDocs,\n bitXor: bitXorDocs,\n leftShift: leftShiftDocs,\n rightArithShift: rightArithShiftDocs,\n rightLogShift: rightLogShiftDocs,\n // functions - combinatorics\n bellNumbers: bellNumbersDocs,\n catalan: catalanDocs,\n composition: compositionDocs,\n stirlingS2: stirlingS2Docs,\n // functions - core\n config: configDocs,\n import: importDocs,\n typed: typedDocs,\n // functions - complex\n arg: argDocs,\n conj: conjDocs,\n re: reDocs,\n im: imDocs,\n // functions - expression\n evaluate: evaluateDocs,\n help: helpDocs,\n // functions - geometry\n distance: distanceDocs,\n intersect: intersectDocs,\n // functions - logical\n and: andDocs,\n not: notDocs,\n or: orDocs,\n xor: xorDocs,\n // functions - matrix\n concat: concatDocs,\n count: countDocs,\n cross: crossDocs,\n column: columnDocs,\n ctranspose: ctransposeDocs,\n det: detDocs,\n diag: diagDocs,\n diff: diffDocs,\n dot: dotDocs,\n getMatrixDataType: getMatrixDataTypeDocs,\n identity: identityDocs,\n filter: filterDocs,\n flatten: flattenDocs,\n forEach: forEachDocs,\n inv: invDocs,\n pinv: pinvDocs,\n eigs: eigsDocs,\n kron: kronDocs,\n matrixFromFunction: matrixFromFunctionDocs,\n matrixFromRows: matrixFromRowsDocs,\n matrixFromColumns: matrixFromColumnsDocs,\n map: mapDocs,\n ones: onesDocs,\n partitionSelect: partitionSelectDocs,\n range: rangeDocs,\n resize: resizeDocs,\n reshape: reshapeDocs,\n rotate: rotateDocs,\n rotationMatrix: rotationMatrixDocs,\n row: rowDocs,\n size: sizeDocs,\n sort: sortDocs,\n squeeze: squeezeDocs,\n subset: subsetDocs,\n trace: traceDocs,\n transpose: transposeDocs,\n zeros: zerosDocs,\n fft: fftDocs,\n ifft: ifftDocs,\n sylvester: sylvesterDocs,\n schur: schurDocs,\n lyap: lyapDocs,\n // functions - numeric\n solveODE: solveODEDocs,\n // functions - probability\n combinations: combinationsDocs,\n combinationsWithRep: combinationsWithRepDocs,\n // distribution: distributionDocs,\n factorial: factorialDocs,\n gamma: gammaDocs,\n kldivergence: kldivergenceDocs,\n lgamma: lgammaDocs,\n multinomial: multinomialDocs,\n permutations: permutationsDocs,\n pickRandom: pickRandomDocs,\n random: randomDocs,\n randomInt: randomIntDocs,\n // functions - relational\n compare: compareDocs,\n compareNatural: compareNaturalDocs,\n compareText: compareTextDocs,\n deepEqual: deepEqualDocs,\n equal: equalDocs,\n equalText: equalTextDocs,\n larger: largerDocs,\n largerEq: largerEqDocs,\n smaller: smallerDocs,\n smallerEq: smallerEqDocs,\n unequal: unequalDocs,\n // functions - set\n setCartesian: setCartesianDocs,\n setDifference: setDifferenceDocs,\n setDistinct: setDistinctDocs,\n setIntersect: setIntersectDocs,\n setIsSubset: setIsSubsetDocs,\n setMultiplicity: setMultiplicityDocs,\n setPowerset: setPowersetDocs,\n setSize: setSizeDocs,\n setSymDifference: setSymDifferenceDocs,\n setUnion: setUnionDocs,\n // functions - signal\n zpk2tf: zpk2tfDocs,\n freqz: freqzDocs,\n // functions - special\n erf: erfDocs,\n zeta: zetaDocs,\n // functions - statistics\n cumsum: cumSumDocs,\n mad: madDocs,\n max: maxDocs,\n mean: meanDocs,\n median: medianDocs,\n min: minDocs,\n mode: modeDocs,\n prod: prodDocs,\n quantileSeq: quantileSeqDocs,\n std: stdDocs,\n sum: sumDocs,\n variance: varianceDocs,\n corr: corrDocs,\n // functions - trigonometry\n acos: acosDocs,\n acosh: acoshDocs,\n acot: acotDocs,\n acoth: acothDocs,\n acsc: acscDocs,\n acsch: acschDocs,\n asec: asecDocs,\n asech: asechDocs,\n asin: asinDocs,\n asinh: asinhDocs,\n atan: atanDocs,\n atanh: atanhDocs,\n atan2: atan2Docs,\n cos: cosDocs,\n cosh: coshDocs,\n cot: cotDocs,\n coth: cothDocs,\n csc: cscDocs,\n csch: cschDocs,\n sec: secDocs,\n sech: sechDocs,\n sin: sinDocs,\n sinh: sinhDocs,\n tan: tanDocs,\n tanh: tanhDocs,\n // functions - units\n to: toDocs,\n // functions - utils\n clone: cloneDocs,\n format: formatDocs,\n bin: binDocs,\n oct: octDocs,\n hex: hexDocs,\n isNaN: isNaNDocs,\n isInteger: isIntegerDocs,\n isNegative: isNegativeDocs,\n isNumeric: isNumericDocs,\n hasNumericValue: hasNumericValueDocs,\n isPositive: isPositiveDocs,\n isPrime: isPrimeDocs,\n isZero: isZeroDocs,\n print: printDocs,\n typeOf: typeOfDocs,\n numeric: numericDocs\n};", "export var eDocs = {\n name: 'e',\n category: 'Constants',\n syntax: ['e'],\n description: 'Euler\\'s number, the base of the natural logarithm. Approximately equal to 2.71828',\n examples: ['e', 'e ^ 2', 'exp(2)', 'log(e)'],\n seealso: ['exp']\n};", "export var falseDocs = {\n name: 'false',\n category: 'Constants',\n syntax: ['false'],\n description: 'Boolean value false',\n examples: ['false'],\n seealso: ['true']\n};", "export var iDocs = {\n name: 'i',\n category: 'Constants',\n syntax: ['i'],\n 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.',\n examples: ['i', 'i * i', 'sqrt(-1)'],\n seealso: []\n};", "export var InfinityDocs = {\n name: 'Infinity',\n category: 'Constants',\n syntax: ['Infinity'],\n description: 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.',\n examples: ['Infinity', '1 / 0'],\n seealso: []\n};", "export var LN10Docs = {\n name: 'LN10',\n category: 'Constants',\n syntax: ['LN10'],\n description: 'Returns the natural logarithm of 10, approximately equal to 2.302',\n examples: ['LN10', 'log(10)'],\n seealso: []\n};", "export var LN2Docs = {\n name: 'LN2',\n category: 'Constants',\n syntax: ['LN2'],\n description: 'Returns the natural logarithm of 2, approximately equal to 0.693',\n examples: ['LN2', 'log(2)'],\n seealso: []\n};", "export var LOG10EDocs = {\n name: 'LOG10E',\n category: 'Constants',\n syntax: ['LOG10E'],\n description: 'Returns the base-10 logarithm of E, approximately equal to 0.434',\n examples: ['LOG10E', 'log(e, 10)'],\n seealso: []\n};", "export var LOG2EDocs = {\n name: 'LOG2E',\n category: 'Constants',\n syntax: ['LOG2E'],\n description: 'Returns the base-2 logarithm of E, approximately equal to 1.442',\n examples: ['LOG2E', 'log(e, 2)'],\n seealso: []\n};", "export var NaNDocs = {\n name: 'NaN',\n category: 'Constants',\n syntax: ['NaN'],\n description: 'Not a number',\n examples: ['NaN', '0 / 0'],\n seealso: []\n};", "export var nullDocs = {\n name: 'null',\n category: 'Constants',\n syntax: ['null'],\n description: 'Value null',\n examples: ['null'],\n seealso: ['true', 'false']\n};", "export var phiDocs = {\n name: 'phi',\n category: 'Constants',\n syntax: ['phi'],\n 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...',\n examples: ['phi'],\n seealso: []\n};", "export var piDocs = {\n name: 'pi',\n category: 'Constants',\n syntax: ['pi'],\n 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',\n examples: ['pi', 'sin(pi/2)'],\n seealso: ['tau']\n};", "export var SQRT12Docs = {\n name: 'SQRT1_2',\n category: 'Constants',\n syntax: ['SQRT1_2'],\n description: 'Returns the square root of 1/2, approximately equal to 0.707',\n examples: ['SQRT1_2', 'sqrt(1/2)'],\n seealso: []\n};", "export var SQRT2Docs = {\n name: 'SQRT2',\n category: 'Constants',\n syntax: ['SQRT2'],\n description: 'Returns the square root of 2, approximately equal to 1.414',\n examples: ['SQRT2', 'sqrt(2)'],\n seealso: []\n};", "export var tauDocs = {\n name: 'tau',\n category: 'Constants',\n syntax: ['tau'],\n description: 'Tau is the ratio constant of a circle\\'s circumference to radius, equal to 2 * pi, approximately 6.2832.',\n examples: ['tau', '2 * pi'],\n seealso: ['pi']\n};", "export var trueDocs = {\n name: 'true',\n category: 'Constants',\n syntax: ['true'],\n description: 'Boolean value true',\n examples: ['true'],\n seealso: ['false']\n};", "export var versionDocs = {\n name: 'version',\n category: 'Constants',\n syntax: ['version'],\n description: 'A string with the version number of math.js',\n examples: ['version'],\n seealso: []\n};", "export var bignumberDocs = {\n name: 'bignumber',\n category: 'Construction',\n syntax: ['bignumber(x)'],\n description: 'Create a big number from a number or string.',\n examples: ['0.1 + 0.2', 'bignumber(0.1) + bignumber(0.2)', 'bignumber(\"7.2\")', 'bignumber(\"7.2e500\")', 'bignumber([0.1, 0.2, 0.3])'],\n seealso: ['boolean', 'bigint', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var bigintDocs = {\n name: 'bigint',\n category: 'Construction',\n syntax: ['bigint(x)'],\n description: 'Create a bigint, an integer with an arbitrary number of digits, from a number or string.',\n examples: ['123123123123123123 # a large number will lose digits', 'bigint(\"123123123123123123\")', 'bignumber([\"1\", \"3\", \"5\"])'],\n seealso: ['boolean', 'bignumber', 'number', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var booleanDocs = {\n name: 'boolean',\n category: 'Construction',\n syntax: ['x', 'boolean(x)'],\n description: 'Convert a string or number into a boolean.',\n examples: ['boolean(0)', 'boolean(1)', 'boolean(3)', 'boolean(\"true\")', 'boolean(\"false\")', 'boolean([1, 0, 1, 1])'],\n seealso: ['bignumber', 'complex', 'index', 'matrix', 'number', 'string', 'unit']\n};", "export var complexDocs = {\n name: 'complex',\n category: 'Construction',\n syntax: ['complex()', 'complex(re, im)', 'complex(string)'],\n description: 'Create a complex number.',\n examples: ['complex()', 'complex(2, 3)', 'complex(\"7 - 2i\")'],\n seealso: ['bignumber', 'boolean', 'index', 'matrix', 'number', 'string', 'unit']\n};", "export var createUnitDocs = {\n name: 'createUnit',\n category: 'Construction',\n syntax: ['createUnit(definitions)', 'createUnit(name, definition)'],\n description: 'Create a user-defined unit and register it with the Unit type.',\n examples: ['createUnit(\"foo\")', 'createUnit(\"knot\", {definition: \"0.514444444 m/s\", aliases: [\"knots\", \"kt\", \"kts\"]})', 'createUnit(\"mph\", \"1 mile/hour\")'],\n seealso: ['unit', 'splitUnit']\n};", "export var fractionDocs = {\n name: 'fraction',\n category: 'Construction',\n syntax: ['fraction(num)', 'fraction(matrix)', 'fraction(num,den)', 'fraction({n: num, d: den})'],\n description: 'Create a fraction from a number or from integer numerator and denominator.',\n examples: ['fraction(0.125)', 'fraction(1, 3) + fraction(2, 5)', 'fraction({n: 333, d: 53})', 'fraction([sqrt(9), sqrt(10), sqrt(11)])'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'string', 'unit']\n};", "export var indexDocs = {\n name: 'index',\n category: 'Construction',\n syntax: ['[start]', '[start:end]', '[start:step:end]', '[start1, start 2, ...]', '[start1:end1, start2:end2, ...]', '[start1:step1:end1, start2:step2:end2, ...]'],\n description: 'Create an index to get or replace a subset of a matrix',\n 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]'],\n seealso: ['bignumber', 'boolean', 'complex', 'matrix,', 'number', 'range', 'string', 'unit']\n};", "export var matrixDocs = {\n name: 'matrix',\n category: 'Construction',\n syntax: ['[]', '[a1, b1, ...; a2, b2, ...]', 'matrix()', 'matrix(\"dense\")', 'matrix([...])'],\n description: 'Create a matrix.',\n 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\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'sparse']\n};", "export var numberDocs = {\n name: 'number',\n category: 'Construction',\n syntax: ['x', 'number(x)', 'number(unit, valuelessUnit)'],\n description: 'Create a number or convert a string or boolean into a number.',\n examples: ['2', '2e3', '4.05', 'number(2)', 'number(\"7.2\")', 'number(true)', 'number([true, false, true, true])', 'number(unit(\"52cm\"), \"m\")'],\n seealso: ['bignumber', 'bigint', 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var sparseDocs = {\n name: 'sparse',\n category: 'Construction',\n syntax: ['sparse()', 'sparse([a1, b1, ...; a1, b2, ...])', 'sparse([a1, b1, ...; a1, b2, ...], \"number\")'],\n description: 'Create a sparse matrix.',\n examples: ['sparse()', 'sparse([3, 4; 5, 6])', 'sparse([3, 0; 5, 0], \"number\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'matrix']\n};", "export var splitUnitDocs = {\n name: 'splitUnit',\n category: 'Construction',\n syntax: ['splitUnit(unit: Unit, parts: Unit[])'],\n description: 'Split a unit in an array of units whose sum is equal to the original unit.',\n examples: ['splitUnit(1 m, [\"feet\", \"inch\"])'],\n seealso: ['unit', 'createUnit']\n};", "export var stringDocs = {\n name: 'string',\n category: 'Construction',\n syntax: ['\"text\"', 'string(x)'],\n description: 'Create a string or convert a value to a string',\n examples: ['\"Hello World!\"', 'string(4.2)', 'string(3 + 2i)'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'unit']\n};", "export var unitDocs = {\n name: 'unit',\n category: 'Construction',\n syntax: ['value unit', 'unit(value, unit)', 'unit(string)'],\n description: 'Create a unit.',\n examples: ['5.5 mm', '3 inch', 'unit(7.1, \"kilogram\")', 'unit(\"23 deg\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'string']\n};", "export var configDocs = {\n name: 'config',\n category: 'Core',\n syntax: ['config()', 'config(options)'],\n description: 'Get configuration or change configuration.',\n examples: ['config()', '1/3 + 1/4', 'config({number: \"Fraction\"})', '1/3 + 1/4'],\n seealso: []\n};", "export var importDocs = {\n name: 'import',\n category: 'Core',\n syntax: ['import(functions)', 'import(functions, options)'],\n description: 'Import functions or constants from an object.',\n examples: ['import({myFn: f(x)=x^2, myConstant: 32 })', 'myFn(2)', 'myConstant'],\n seealso: []\n};", "export var typedDocs = {\n name: 'typed',\n category: 'Core',\n syntax: ['typed(signatures)', 'typed(name, signatures)'],\n description: 'Create a typed function.',\n examples: ['double = typed({ \"number\": f(x)=x+x, \"string\": f(x)=concat(x,x) })', 'double(2)', 'double(\"hello\")'],\n seealso: []\n};", "export var derivativeDocs = {\n name: 'derivative',\n category: 'Algebra',\n syntax: ['derivative(expr, variable)', 'derivative(expr, variable, {simplify: boolean})'],\n 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.',\n 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})'],\n seealso: ['simplify', 'parse', 'evaluate']\n};", "export var leafCountDocs = {\n name: 'leafCount',\n category: 'Algebra',\n syntax: ['leafCount(expr)'],\n description: 'Computes the number of leaves in the parse tree of the given expression',\n examples: ['leafCount(\"e^(i*pi)-1\")', 'leafCount(parse(\"{a: 22/7, b: 10^(1/2)}\"))'],\n seealso: ['simplify']\n};", "export var lsolveDocs = {\n name: 'lsolve',\n category: 'Algebra',\n syntax: ['x=lsolve(L, b)'],\n 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.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolveAll', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};", "export var lsolveAllDocs = {\n name: 'lsolveAll',\n category: 'Algebra',\n syntax: ['x=lsolveAll(L, b)'],\n 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.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolve', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};", "export var lupDocs = {\n name: 'lup',\n category: 'Algebra',\n syntax: ['lup(m)'],\n description: 'Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U',\n examples: ['lup([[2, 1], [1, 4]])', 'lup(matrix([[2, 1], [1, 4]]))', 'lup(sparse([[2, 1], [1, 4]]))'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'slu', 'qr']\n};", "export var lusolveDocs = {\n name: 'lusolve',\n category: 'Algebra',\n syntax: ['x=lusolve(A, b)', 'x=lusolve(lu, b)'],\n description: 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lusolve(a, b)'],\n seealso: ['lup', 'slu', 'lsolve', 'usolve', 'matrix', 'sparse']\n};", "export var polynomialRootDocs = {\n name: 'polynomialRoot',\n category: 'Algebra',\n syntax: ['x=polynomialRoot(-6, 3)', 'x=polynomialRoot(4, -4, 1)', 'x=polynomialRoot(-8, 12, -6, 1)'],\n description: 'Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.',\n examples: ['a = polynomialRoot(-6, 11, -6, 1)'],\n seealso: ['cbrt', 'sqrt']\n};", "export var qrDocs = {\n name: 'qr',\n category: 'Algebra',\n syntax: ['qr(A)'],\n 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.',\n examples: ['qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])'],\n seealso: ['lup', 'slu', 'matrix']\n};", "export var rationalizeDocs = {\n name: 'rationalize',\n category: 'Algebra',\n syntax: ['rationalize(expr)', 'rationalize(expr, scope)', 'rationalize(expr, scope, detailed)'],\n 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.',\n examples: ['rationalize(\"2x/y - y/(x+1)\")', 'rationalize(\"2x/y - y/(x+1)\", true)'],\n seealso: ['simplify']\n};", "export var resolveDocs = {\n name: 'resolve',\n category: 'Algebra',\n syntax: ['resolve(node, scope)'],\n description: 'Recursively substitute variables in an expression tree.',\n 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\") })'],\n seealso: ['simplify', 'evaluate'],\n mayThrow: ['ReferenceError']\n};", "export var simplifyDocs = {\n name: 'simplify',\n category: 'Algebra',\n syntax: ['simplify(expr)', 'simplify(expr, rules)'],\n description: 'Simplify an expression tree.',\n examples: ['simplify(\"3 + 2 / 4\")', 'simplify(\"2x + x\")', 'f = parse(\"x * (x + 2 + x)\")', 'simplified = simplify(f)', 'simplified.evaluate({x: 2})'],\n seealso: ['simplifyCore', 'derivative', 'evaluate', 'parse', 'rationalize', 'resolve']\n};", "export var simplifyConstantDocs = {\n name: 'simplifyConstant',\n category: 'Algebra',\n syntax: ['simplifyConstant(expr)', 'simplifyConstant(expr, options)'],\n description: 'Replace constant subexpressions of node with their values.',\n examples: ['simplifyConstant(\"(3-3)*x\")', 'simplifyConstant(parse(\"z-cos(tau/8)\"))'],\n seealso: ['simplify', 'simplifyCore', 'evaluate']\n};", "export var simplifyCoreDocs = {\n name: 'simplifyCore',\n category: 'Algebra',\n syntax: ['simplifyCore(node)'],\n description: 'Perform simple one-pass simplifications on an expression tree.',\n examples: ['simplifyCore(parse(\"0*x\"))', 'simplifyCore(parse(\"(x+0)*2\"))'],\n seealso: ['simplify', 'simplifyConstant', 'evaluate']\n};", "export var sluDocs = {\n name: 'slu',\n category: 'Algebra',\n syntax: ['slu(A, order, threshold)'],\n 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',\n 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)'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'lup', 'qr']\n};", "export var symbolicEqualDocs = {\n name: 'symbolicEqual',\n category: 'Algebra',\n syntax: ['symbolicEqual(expr1, expr2)', 'symbolicEqual(expr1, expr2, options)'],\n description: 'Returns true if the difference of the expressions simplifies to 0',\n examples: ['symbolicEqual(\"x*y\",\"y*x\")', 'symbolicEqual(\"abs(x^2)\", \"x^2\")', 'symbolicEqual(\"abs(x)\", \"x\", {context: {abs: {trivial: true}}})'],\n seealso: ['simplify', 'evaluate']\n};", "export var usolveDocs = {\n name: 'usolve',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n 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.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolveAll', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};", "export var usolveAllDocs = {\n name: 'usolveAll',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n 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.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolve', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};", "export var absDocs = {\n name: 'abs',\n category: 'Arithmetic',\n syntax: ['abs(x)'],\n description: 'Compute the absolute value.',\n examples: ['abs(3.5)', 'abs(-4.2)'],\n seealso: ['sign']\n};", "export var addDocs = {\n name: 'add',\n category: 'Operators',\n syntax: ['x + y', 'add(x, y)'],\n description: 'Add two values.',\n examples: ['a = 2.1 + 3.6', 'a - 3.6', '3 + 2i', '3 cm + 2 inch', '\"2.3\" + \"4\"'],\n seealso: ['subtract']\n};", "export var cbrtDocs = {\n name: 'cbrt',\n category: 'Arithmetic',\n syntax: ['cbrt(x)', 'cbrt(x, allRoots)'],\n 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',\n examples: ['cbrt(64)', 'cube(4)', 'cbrt(-8)', 'cbrt(2 + 3i)', 'cbrt(8i)', 'cbrt(8i, true)', 'cbrt(27 m^3)'],\n seealso: ['square', 'sqrt', 'cube', 'multiply']\n};", "export var ceilDocs = {\n name: 'ceil',\n category: 'Arithmetic',\n syntax: ['ceil(x)'],\n description: 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.',\n examples: ['ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)'],\n seealso: ['floor', 'fix', 'round']\n};", "export var cubeDocs = {\n name: 'cube',\n category: 'Arithmetic',\n syntax: ['cube(x)'],\n description: 'Compute the cube of a value. The cube of x is x * x * x.',\n examples: ['cube(2)', '2^3', '2 * 2 * 2'],\n seealso: ['multiply', 'square', 'pow']\n};", "export var divideDocs = {\n name: 'divide',\n category: 'Operators',\n syntax: ['x / y', 'divide(x, y)'],\n description: 'Divide two values.',\n examples: ['a = 2 / 3', 'a * 3', '4.5 / 2', '3 + 4 / 2', '(3 + 4) / 2', '18 km / 4.5'],\n seealso: ['multiply']\n};", "export var dotDivideDocs = {\n name: 'dotDivide',\n category: 'Operators',\n syntax: ['x ./ y', 'dotDivide(x, y)'],\n description: 'Divide two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a ./ b'],\n seealso: ['multiply', 'dotMultiply', 'divide']\n};", "export var dotMultiplyDocs = {\n name: 'dotMultiply',\n category: 'Operators',\n syntax: ['x .* y', 'dotMultiply(x, y)'],\n description: 'Multiply two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a .* b'],\n seealso: ['multiply', 'divide', 'dotDivide']\n};", "export var dotPowDocs = {\n name: 'dotPow',\n category: 'Operators',\n syntax: ['x .^ y', 'dotPow(x, y)'],\n description: 'Calculates the power of x to y element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a .^ 2'],\n seealso: ['pow']\n};", "export var expDocs = {\n name: 'exp',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n description: 'Calculate the exponent of a value.',\n 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'],\n seealso: ['expm', 'expm1', 'pow', 'log']\n};", "export var expmDocs = {\n name: 'expm',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n 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.',\n examples: ['expm([[0,2],[0,0]])'],\n seealso: ['exp']\n};", "export var expm1Docs = {\n name: 'expm1',\n category: 'Arithmetic',\n syntax: ['expm1(x)'],\n description: 'Calculate the value of subtracting 1 from the exponential value.',\n examples: ['expm1(2)', 'pow(e, 2) - 1', 'log(expm1(2) + 1)'],\n seealso: ['exp', 'pow', 'log']\n};", "export var fixDocs = {\n name: 'fix',\n category: 'Arithmetic',\n syntax: ['fix(x)'],\n description: 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.',\n examples: ['fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)'],\n seealso: ['ceil', 'floor', 'round']\n};", "export var floorDocs = {\n name: 'floor',\n category: 'Arithmetic',\n syntax: ['floor(x)'],\n description: 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.',\n examples: ['floor(3.2)', 'floor(3.8)', 'floor(-4.2)'],\n seealso: ['ceil', 'fix', 'round']\n};", "export var gcdDocs = {\n name: 'gcd',\n category: 'Arithmetic',\n syntax: ['gcd(a, b)', 'gcd(a, b, c, ...)'],\n description: 'Compute the greatest common divisor.',\n examples: ['gcd(8, 12)', 'gcd(-4, 6)', 'gcd(25, 15, -10)'],\n seealso: ['lcm', 'xgcd']\n};", "export var hypotDocs = {\n name: 'hypot',\n category: 'Arithmetic',\n syntax: ['hypot(a, b, c, ...)', 'hypot([a, b, c, ...])'],\n description: 'Calculate the hypotenusa of a list with values. ',\n examples: ['hypot(3, 4)', 'sqrt(3^2 + 4^2)', 'hypot(-2)', 'hypot([3, 4, 5])'],\n seealso: ['abs', 'norm']\n};", "export var invmodDocs = {\n name: 'invmod',\n category: 'Arithmetic',\n syntax: ['invmod(a, b)'],\n description: 'Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \u2263 1 (mod b)',\n examples: ['invmod(8, 12)', 'invmod(7, 13)', 'invmod(15151, 15122)'],\n seealso: ['gcd', 'xgcd']\n};", "export var lcmDocs = {\n name: 'lcm',\n category: 'Arithmetic',\n syntax: ['lcm(x, y)'],\n description: 'Compute the least common multiple.',\n examples: ['lcm(4, 6)', 'lcm(6, 21)', 'lcm(6, 21, 5)'],\n seealso: ['gcd']\n};", "export var logDocs = {\n name: 'log',\n category: 'Arithmetic',\n syntax: ['log(x)', 'log(x, base)'],\n 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).',\n 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'],\n seealso: ['exp', 'log1p', 'log2', 'log10']\n};", "export var log10Docs = {\n name: 'log10',\n category: 'Arithmetic',\n syntax: ['log10(x)'],\n description: 'Compute the 10-base logarithm of a value.',\n examples: ['log10(0.00001)', 'log10(10000)', '10 ^ 4', 'log(10000) / log(10)', 'log(10000, 10)'],\n seealso: ['exp', 'log']\n};", "export var log1pDocs = {\n name: 'log1p',\n category: 'Arithmetic',\n syntax: ['log1p(x)', 'log1p(x, base)'],\n description: 'Calculate the logarithm of a `value+1`',\n examples: ['log1p(2.5)', 'exp(log1p(1.4))', 'pow(10, 4)', 'log1p(9999, 10)', 'log1p(9999) / log(10)'],\n seealso: ['exp', 'log', 'log2', 'log10']\n};", "export var log2Docs = {\n name: 'log2',\n category: 'Arithmetic',\n syntax: ['log2(x)'],\n description: 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.',\n examples: ['log2(0.03125)', 'log2(16)', 'log2(16) / log2(2)', 'pow(2, 4)'],\n seealso: ['exp', 'log1p', 'log', 'log10']\n};", "export var modDocs = {\n name: 'mod',\n category: 'Operators',\n syntax: ['x % y', 'x mod y', 'mod(x, y)'],\n description: 'Calculates the modulus, the remainder of an integer division.',\n examples: ['7 % 3', '11 % 2', '10 mod 4', 'isOdd(x) = x % 2', 'isOdd(2)', 'isOdd(3)'],\n seealso: ['divide']\n};", "export var multiplyDocs = {\n name: 'multiply',\n category: 'Operators',\n syntax: ['x * y', 'multiply(x, y)'],\n description: 'multiply two values.',\n examples: ['a = 2.1 * 3.4', 'a / 3.4', '2 * 3 + 4', '2 * (3 + 4)', '3 * 2.1 km'],\n seealso: ['divide']\n};", "export var normDocs = {\n name: 'norm',\n category: 'Arithmetic',\n syntax: ['norm(x)', 'norm(x, p)'],\n description: 'Calculate the norm of a number, vector or matrix.',\n 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\")']\n};", "export var nthRootDocs = {\n name: 'nthRoot',\n category: 'Arithmetic',\n syntax: ['nthRoot(a)', 'nthRoot(a, root)'],\n 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\".',\n examples: ['4 ^ 3', 'nthRoot(64, 3)', 'nthRoot(9, 2)', 'sqrt(9)'],\n seealso: ['nthRoots', 'pow', 'sqrt']\n};", "export var nthRootsDocs = {\n name: 'nthRoots',\n category: 'Arithmetic',\n syntax: ['nthRoots(A)', 'nthRoots(A, root)'],\n 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.',\n examples: ['nthRoots(1)', 'nthRoots(1, 3)'],\n seealso: ['sqrt', 'pow', 'nthRoot']\n};", "export var powDocs = {\n name: 'pow',\n category: 'Operators',\n syntax: ['x ^ y', 'pow(x, y)'],\n description: 'Calculates the power of x to y, x^y.',\n examples: ['2^3', '2*2*2', '1 + e ^ (pi * i)', 'pow([[1, 2], [4, 3]], 2)', 'pow([[1, 2], [4, 3]], -1)'],\n seealso: ['multiply', 'nthRoot', 'nthRoots', 'sqrt']\n};", "export var roundDocs = {\n name: 'round',\n category: 'Arithmetic',\n syntax: ['round(x)', 'round(x, n)', 'round(unit, valuelessUnit)', 'round(unit, n, valuelessUnit)'],\n 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.',\n 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])'],\n seealso: ['ceil', 'floor', 'fix']\n};", "export var signDocs = {\n name: 'sign',\n category: 'Arithmetic',\n syntax: ['sign(x)'],\n description: 'Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.',\n examples: ['sign(3.5)', 'sign(-4.2)', 'sign(0)'],\n seealso: ['abs']\n};", "export var sqrtDocs = {\n name: 'sqrt',\n category: 'Arithmetic',\n syntax: ['sqrt(x)'],\n description: 'Compute the square root value. If x = y * y, then y is the square root of x.',\n examples: ['sqrt(25)', '5 * 5', 'sqrt(-1)'],\n seealso: ['square', 'sqrtm', 'multiply', 'nthRoot', 'nthRoots', 'pow']\n};", "export var sqrtmDocs = {\n name: 'sqrtm',\n category: 'Arithmetic',\n syntax: ['sqrtm(x)'],\n 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`.',\n examples: ['sqrtm([[33, 24], [48, 57]])'],\n seealso: ['sqrt', 'abs', 'square', 'multiply']\n};", "export var sylvesterDocs = {\n name: 'sylvester',\n category: 'Algebra',\n syntax: ['sylvester(A,B,C)'],\n description: 'Solves the real-valued Sylvester equation AX+XB=C for X',\n 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)'],\n seealso: ['schur', 'lyap']\n};", "export var schurDocs = {\n name: 'schur',\n category: 'Algebra',\n syntax: ['schur(A)'],\n description: 'Performs a real Schur decomposition of the real matrix A = UTU\\'',\n examples: ['schur([[1, 0], [-4, 3]])', 'A = [[1, 0], [-4, 3]]', 'schur(A)'],\n seealso: ['lyap', 'sylvester']\n};", "export var lyapDocs = {\n name: 'lyap',\n category: 'Algebra',\n syntax: ['lyap(A,Q)'],\n description: 'Solves the Continuous-time Lyapunov equation AP+PA\\'+Q=0 for P',\n examples: ['lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])', 'A = [[-2, 0], [1, -4]]', 'Q = [[3, 1], [1, 3]]', 'lyap(A,Q)'],\n seealso: ['schur', 'sylvester']\n};", "export var squareDocs = {\n name: 'square',\n category: 'Arithmetic',\n syntax: ['square(x)'],\n description: 'Compute the square of a value. The square of x is x * x.',\n examples: ['square(3)', 'sqrt(9)', '3^2', '3 * 3'],\n seealso: ['multiply', 'pow', 'sqrt', 'cube']\n};", "export var subtractDocs = {\n name: 'subtract',\n category: 'Operators',\n syntax: ['x - y', 'subtract(x, y)'],\n description: 'subtract two values.',\n examples: ['a = 5.3 - 2', 'a + 2', '2/3 - 1/6', '2 * 3 - 3', '2.1 km - 500m'],\n seealso: ['add']\n};", "export var unaryMinusDocs = {\n name: 'unaryMinus',\n category: 'Operators',\n syntax: ['-x', 'unaryMinus(x)'],\n description: 'Inverse the sign of a value. Converts booleans and strings to numbers.',\n examples: ['-4.5', '-(-5.6)', '-\"22\"'],\n seealso: ['add', 'subtract', 'unaryPlus']\n};", "export var unaryPlusDocs = {\n name: 'unaryPlus',\n category: 'Operators',\n syntax: ['+x', 'unaryPlus(x)'],\n description: 'Converts booleans and strings to numbers.',\n examples: ['+true', '+\"2\"'],\n seealso: ['add', 'subtract', 'unaryMinus']\n};", "export var xgcdDocs = {\n name: 'xgcd',\n category: 'Arithmetic',\n syntax: ['xgcd(a, b)'],\n 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.',\n examples: ['xgcd(8, 12)', 'gcd(8, 12)', 'xgcd(36163, 21199)'],\n seealso: ['gcd', 'lcm']\n};", "export var bitAndDocs = {\n name: 'bitAnd',\n category: 'Bitwise',\n syntax: ['x & y', 'bitAnd(x, y)'],\n 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',\n examples: ['5 & 3', 'bitAnd(53, 131)', '[1, 12, 31] & 42'],\n seealso: ['bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitNotDocs = {\n name: 'bitNot',\n category: 'Bitwise',\n syntax: ['~x', 'bitNot(x)'],\n 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.',\n examples: ['~1', '~2', 'bitNot([2, -3, 4])'],\n seealso: ['bitAnd', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitOrDocs = {\n name: 'bitOr',\n category: 'Bitwise',\n syntax: ['x | y', 'bitOr(x, y)'],\n 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.',\n examples: ['5 | 3', 'bitOr([1, 2, 3], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitXorDocs = {\n name: 'bitXor',\n category: 'Bitwise',\n syntax: ['bitXor(x, y)'],\n 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.',\n examples: ['bitOr(1, 2)', 'bitXor([2, 3, 4], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var leftShiftDocs = {\n name: 'leftShift',\n category: 'Bitwise',\n syntax: ['x << y', 'leftShift(x, y)'],\n description: 'Bitwise left logical shift of a value x by y number of bits.',\n examples: ['4 << 1', '8 >> 1'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'rightArithShift', 'rightLogShift']\n};", "export var rightArithShiftDocs = {\n name: 'rightArithShift',\n category: 'Bitwise',\n syntax: ['x >> y', 'rightArithShift(x, y)'],\n description: 'Bitwise right arithmetic shift of a value x by y number of bits.',\n examples: ['8 >> 1', '4 << 1', '-12 >> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightLogShift']\n};", "export var rightLogShiftDocs = {\n name: 'rightLogShift',\n category: 'Bitwise',\n syntax: ['x >>> y', 'rightLogShift(x, y)'],\n description: 'Bitwise right logical shift of a value x by y number of bits.',\n examples: ['8 >>> 1', '4 << 1', '-12 >>> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift']\n};", "export var bellNumbersDocs = {\n name: 'bellNumbers',\n category: 'Combinatorics',\n syntax: ['bellNumbers(n)'],\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.',\n examples: ['bellNumbers(3)', 'bellNumbers(8)'],\n seealso: ['stirlingS2']\n};", "export var catalanDocs = {\n name: 'catalan',\n category: 'Combinatorics',\n syntax: ['catalan(n)'],\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.',\n examples: ['catalan(3)', 'catalan(8)'],\n seealso: ['bellNumbers']\n};", "export var compositionDocs = {\n name: 'composition',\n category: 'Combinatorics',\n syntax: ['composition(n, k)'],\n description: 'The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.',\n examples: ['composition(5, 3)'],\n seealso: ['combinations']\n};", "export var stirlingS2Docs = {\n name: 'stirlingS2',\n category: 'Combinatorics',\n syntax: ['stirlingS2(n, k)'],\n 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.',\n examples: ['stirlingS2(5, 3)'],\n seealso: ['bellNumbers']\n};", "export var argDocs = {\n name: 'arg',\n category: 'Complex',\n syntax: ['arg(x)'],\n description: 'Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).',\n examples: ['arg(2 + 2i)', 'atan2(3, 2)', 'arg(2 + 3i)'],\n seealso: ['re', 'im', 'conj', 'abs']\n};", "export var conjDocs = {\n name: 'conj',\n category: 'Complex',\n syntax: ['conj(x)'],\n description: 'Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.',\n examples: ['conj(2 + 3i)', 'conj(2 - 3i)', 'conj(-5.2i)'],\n seealso: ['re', 'im', 'abs', 'arg']\n};", "export var imDocs = {\n name: 'im',\n category: 'Complex',\n syntax: ['im(x)'],\n description: 'Get the imaginary part of a complex number.',\n examples: ['im(2 + 3i)', 're(2 + 3i)', 'im(-5.2i)', 'im(2.4)'],\n seealso: ['re', 'conj', 'abs', 'arg']\n};", "export var reDocs = {\n name: 're',\n category: 'Complex',\n syntax: ['re(x)'],\n description: 'Get the real part of a complex number.',\n examples: ['re(2 + 3i)', 'im(2 + 3i)', 're(-5.2i)', 're(2.4)'],\n seealso: ['im', 'conj', 'abs', 'arg']\n};", "export var evaluateDocs = {\n name: 'evaluate',\n category: 'Expression',\n syntax: ['evaluate(expression)', 'evaluate(expression, scope)', 'evaluate([expr1, expr2, expr3, ...])', 'evaluate([expr1, expr2, expr3, ...], scope)'],\n description: 'Evaluate an expression or an array with expressions.',\n 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\"])'],\n seealso: []\n};", "export var helpDocs = {\n name: 'help',\n category: 'Expression',\n syntax: ['help(object)', 'help(string)'],\n description: 'Display documentation on a function or data type.',\n examples: ['help(sqrt)', 'help(\"complex\")'],\n seealso: []\n};", "export var distanceDocs = {\n name: 'distance',\n category: 'Geometry',\n syntax: ['distance([x1, y1], [x2, y2])', 'distance([[x1, y1], [x2, y2]])'],\n description: 'Calculates the Euclidean distance between two points.',\n examples: ['distance([0,0], [4,4])', 'distance([[0,0], [4,4]])'],\n seealso: []\n};", "export var intersectDocs = {\n name: 'intersect',\n category: 'Geometry',\n syntax: ['intersect(expr1, expr2, expr3, expr4)', 'intersect(expr1, expr2, expr3)'],\n description: 'Computes the intersection point of lines and/or planes.',\n examples: ['intersect([0, 0], [10, 10], [10, 0], [0, 10])', 'intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])'],\n seealso: []\n};", "export var andDocs = {\n name: 'and',\n category: 'Logical',\n syntax: ['x and y', 'and(x, y)'],\n description: 'Logical and. Test whether two values are both defined with a nonzero/nonempty value.',\n examples: ['true and false', 'true and true', '2 and 4'],\n seealso: ['not', 'or', 'xor']\n};", "export var notDocs = {\n name: 'not',\n category: 'Logical',\n syntax: ['not x', 'not(x)'],\n description: 'Logical not. Flips the boolean value of given argument.',\n examples: ['not true', 'not false', 'not 2', 'not 0'],\n seealso: ['and', 'or', 'xor']\n};", "export var orDocs = {\n name: 'or',\n category: 'Logical',\n syntax: ['x or y', 'or(x, y)'],\n description: 'Logical or. Test if at least one value is defined with a nonzero/nonempty value.',\n examples: ['true or false', 'false or false', '0 or 4'],\n seealso: ['not', 'and', 'xor']\n};", "export var xorDocs = {\n name: 'xor',\n category: 'Logical',\n syntax: ['x xor y', 'xor(x, y)'],\n description: 'Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.',\n examples: ['true xor false', 'false xor false', 'true xor true', '0 xor 4'],\n seealso: ['not', 'and', 'or']\n};", "export var columnDocs = {\n name: 'column',\n category: 'Matrix',\n syntax: ['column(x, index)'],\n description: 'Return a column from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'column(A, 1)', 'column(A, 2)'],\n seealso: ['row', 'matrixFromColumns']\n};", "export var concatDocs = {\n name: 'concat',\n category: 'Matrix',\n syntax: ['concat(A, B, C, ...)', 'concat(A, B, C, ..., dim)'],\n 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.',\n examples: ['A = [1, 2; 5, 6]', 'B = [3, 4; 7, 8]', 'concat(A, B)', 'concat(A, B, 1)', 'concat(A, B, 2)'],\n seealso: ['det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var countDocs = {\n name: 'count',\n category: 'Matrix',\n syntax: ['count(x)'],\n description: 'Count the number of elements of a matrix, array or string.',\n examples: ['a = [1, 2; 3, 4; 5, 6]', 'count(a)', 'size(a)', 'count(\"hello world\")'],\n seealso: ['size']\n};", "export var crossDocs = {\n name: 'cross',\n category: 'Matrix',\n syntax: ['cross(A, B)'],\n description: 'Calculate the cross product for two vectors in three dimensional space.',\n examples: ['cross([1, 1, 0], [0, 1, 1])', 'cross([3, -3, 1], [4, 9, 2])', 'cross([2, 3, 4], [5, 6, 7])'],\n seealso: ['multiply', 'dot']\n};", "export var ctransposeDocs = {\n name: 'ctranspose',\n category: 'Matrix',\n syntax: ['x\\'', 'ctranspose(x)'],\n description: 'Complex Conjugate and Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'ctranspose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};", "export var detDocs = {\n name: 'det',\n category: 'Matrix',\n syntax: ['det(x)'],\n description: 'Calculate the determinant of a matrix',\n examples: ['det([1, 2; 3, 4])', 'det([-2, 2, 3; -1, 1, 3; 2, 0, -1])'],\n seealso: ['concat', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var diagDocs = {\n name: 'diag',\n category: 'Matrix',\n syntax: ['diag(x)', 'diag(x, k)'],\n 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.',\n examples: ['diag(1:3)', 'diag(1:3, 1)', 'a = [1, 2, 3; 4, 5, 6; 7, 8, 9]', 'diag(a)'],\n seealso: ['concat', 'det', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var diffDocs = {\n name: 'diff',\n category: 'Matrix',\n syntax: ['diff(arr)', 'diff(arr, dim)'],\n description: ['Create a new matrix or array with the difference of the passed matrix or array.', 'Dim parameter is optional and used to indicant 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'],\n 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)'],\n seealso: ['subtract', 'partitionSelect']\n};", "export var dotDocs = {\n name: 'dot',\n category: 'Matrix',\n syntax: ['dot(A, B)', 'A * B'],\n 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',\n examples: ['dot([2, 4, 1], [2, 2, 3])', '[2, 4, 1] * [2, 2, 3]'],\n seealso: ['multiply', 'cross']\n};", "export var eigsDocs = {\n name: 'eigs',\n category: 'Matrix',\n syntax: ['eigs(x)'],\n description: 'Calculate the eigenvalues and optionally eigenvectors of a square matrix',\n examples: ['eigs([[5, 2.3], [2.3, 1]])', 'eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })'],\n seealso: ['inv']\n};", "export var filterDocs = {\n name: 'filter',\n category: 'Matrix',\n syntax: ['filter(x, test)'],\n description: 'Filter items in a matrix.',\n examples: ['isPositive(x) = x > 0', 'filter([6, -2, -1, 4, 3], isPositive)', 'filter([6, -2, 0, 1, 0], x != 0)'],\n seealso: ['sort', 'map', 'forEach']\n};", "export var flattenDocs = {\n name: 'flatten',\n category: 'Matrix',\n syntax: ['flatten(x)'],\n description: 'Flatten a multi dimensional matrix into a single dimensional matrix.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'size(a)', 'b = flatten(a)', 'size(b)'],\n seealso: ['concat', 'resize', 'size', 'squeeze']\n};", "export var forEachDocs = {\n name: 'forEach',\n category: 'Matrix',\n syntax: ['forEach(x, callback)'],\n description: 'Iterates over all elements of a matrix/array, and executes the given callback function.',\n examples: ['numberOfPets = {}', 'addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;', 'forEach([\"Dog\",\"Cat\",\"Cat\"], addPet)', 'numberOfPets'],\n seealso: ['map', 'sort', 'filter']\n};", "export var getMatrixDataTypeDocs = {\n name: 'getMatrixDataType',\n category: 'Matrix',\n syntax: ['getMatrixDataType(x)'],\n 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\".',\n examples: ['getMatrixDataType([1, 2, 3])', 'getMatrixDataType([[5 cm], [2 inch]])', 'getMatrixDataType([1, \"text\"])', 'getMatrixDataType([1, bignumber(4)])'],\n seealso: ['matrix', 'sparse', 'typeOf']\n};", "export var identityDocs = {\n name: 'identity',\n category: 'Matrix',\n syntax: ['identity(n)', 'identity(m, n)', 'identity([m, n])'],\n description: 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.',\n examples: ['identity(3)', 'identity(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'identity(size(a))'],\n seealso: ['concat', 'det', 'diag', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var invDocs = {\n name: 'inv',\n category: 'Matrix',\n syntax: ['inv(x)'],\n description: 'Calculate the inverse of a matrix',\n examples: ['inv([1, 2; 3, 4])', 'inv(4)', '1 / 4'],\n seealso: ['concat', 'det', 'diag', 'identity', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var pinvDocs = {\n name: 'pinv',\n category: 'Matrix',\n syntax: ['pinv(x)'],\n description: 'Calculate the Moore\u2013Penrose inverse of a matrix',\n examples: ['pinv([1, 2; 3, 4])', 'pinv([[1, 0], [0, 1], [0, 1]])', 'pinv(4)'],\n seealso: ['inv']\n};", "export var kronDocs = {\n name: 'kron',\n category: 'Matrix',\n syntax: ['kron(x, y)'],\n description: 'Calculates the kronecker product of 2 matrices or vectors.',\n examples: ['kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])', 'kron([1,1], [2,3,4])'],\n seealso: ['multiply', 'dot', 'cross']\n};", "export var mapDocs = {\n name: 'map',\n category: 'Matrix',\n syntax: ['map(x, callback)'],\n description: 'Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.',\n examples: ['map([1, 2, 3], square)'],\n seealso: ['filter', 'forEach']\n};", "export var matrixFromColumnsDocs = {\n name: 'matrixFromColumns',\n category: 'Matrix',\n syntax: ['matrixFromColumns(...arr)', 'matrixFromColumns(row1, row2)', 'matrixFromColumns(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual columns.',\n examples: ['matrixFromColumns([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromFunction', 'zeros']\n};", "export var matrixFromFunctionDocs = {\n name: 'matrixFromFunction',\n category: 'Matrix',\n syntax: ['matrixFromFunction(size, fn)', 'matrixFromFunction(size, fn, format)', 'matrixFromFunction(size, fn, format, datatype)', 'matrixFromFunction(size, format, fn)', 'matrixFromFunction(size, format, datatype, fn)'],\n description: 'Create a matrix by evaluating a generating function at each index.',\n 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)'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromColumns', 'zeros']\n};", "export var matrixFromRowsDocs = {\n name: 'matrixFromRows',\n category: 'Matrix',\n syntax: ['matrixFromRows(...arr)', 'matrixFromRows(row1, row2)', 'matrixFromRows(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual rows.',\n examples: ['matrixFromRows([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromColumns', 'matrixFromFunction', 'zeros']\n};", "export var onesDocs = {\n name: 'ones',\n category: 'Matrix',\n syntax: ['ones(m)', 'ones(m, n)', 'ones(m, n, p, ...)', 'ones([m])', 'ones([m, n])', 'ones([m, n, p, ...])'],\n description: 'Create a matrix containing ones.',\n examples: ['ones(3)', 'ones(3, 5)', 'ones([2,3]) * 4.5', 'a = [1, 2, 3; 4, 5, 6]', 'ones(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var partitionSelectDocs = {\n name: 'partitionSelect',\n category: 'Matrix',\n syntax: ['partitionSelect(x, k)', 'partitionSelect(x, k, compare)'],\n description: 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.',\n 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'],\n seealso: ['sort']\n};", "export var rangeDocs = {\n name: 'range',\n category: 'Type',\n syntax: ['start:end', 'start:step:end', 'range(start, end)', 'range(start, end, step)', 'range(string)'],\n description: 'Create a range. Lower bound of the range is included, upper bound is excluded.',\n 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]'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var reshapeDocs = {\n name: 'reshape',\n category: 'Matrix',\n syntax: ['reshape(x, sizes)'],\n description: 'Reshape a multi dimensional array to fit the specified dimensions.',\n 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])'],\n seealso: ['size', 'squeeze', 'resize']\n};", "export var resizeDocs = {\n name: 'resize',\n category: 'Matrix',\n syntax: ['resize(x, size)', 'resize(x, size, defaultValue)'],\n description: 'Resize a matrix.',\n 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], \"!\")'],\n seealso: ['size', 'subset', 'squeeze', 'reshape']\n};", "export var rotateDocs = {\n name: 'rotate',\n category: 'Matrix',\n syntax: ['rotate(w, theta)', 'rotate(w, theta, v)'],\n 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.',\n 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]))'],\n seealso: ['matrix', 'rotationMatrix']\n};", "export var rotationMatrixDocs = {\n name: 'rotationMatrix',\n category: 'Matrix',\n syntax: ['rotationMatrix(theta)', 'rotationMatrix(theta, v)', 'rotationMatrix(theta, v, format)'],\n 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.',\n examples: ['rotationMatrix(pi / 2)', 'rotationMatrix(unit(\"45deg\"), [0, 0, 1])', 'rotationMatrix(1, matrix([0, 0, 1]), \"sparse\")'],\n seealso: ['cos', 'sin']\n};", "export var rowDocs = {\n name: 'row',\n category: 'Matrix',\n syntax: ['row(x, index)'],\n description: 'Return a row from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'row(A, 1)', 'row(A, 2)'],\n seealso: ['column', 'matrixFromRows']\n};", "export var sizeDocs = {\n name: 'size',\n category: 'Matrix',\n syntax: ['size(x)'],\n description: 'Calculate the size of a matrix.',\n examples: ['size(2.3)', 'size(\"hello world\")', 'a = [1, 2; 3, 4; 5, 6]', 'size(a)', 'size(1:6)'],\n seealso: ['concat', 'count', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var sortDocs = {\n name: 'sort',\n category: 'Matrix',\n syntax: ['sort(x)', 'sort(x, compare)'],\n description: 'Sort the items in a matrix. Compare can be a string \"asc\", \"desc\", \"natural\", or a custom sort function.',\n 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\")'],\n seealso: ['map', 'filter', 'forEach']\n};", "export var squeezeDocs = {\n name: 'squeeze',\n category: 'Matrix',\n syntax: ['squeeze(x)'],\n description: 'Remove inner and outer singleton dimensions from a matrix.',\n examples: ['a = zeros(3,2,1)', 'size(squeeze(a))', 'b = zeros(1,1,3)', 'size(squeeze(b))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var subsetDocs = {\n name: 'subset',\n category: 'Matrix',\n syntax: ['value(index)', 'value(index) = replacement', 'subset(value, [index])', 'subset(value, [index], replacement)'],\n 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.',\n 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'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'trace', 'transpose', 'zeros']\n};", "export var traceDocs = {\n name: 'trace',\n category: 'Matrix',\n syntax: ['trace(A)'],\n description: 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.',\n examples: ['A = [1, 2, 3; -1, 2, 3; 2, 0, 3]', 'trace(A)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros']\n};", "export var transposeDocs = {\n name: 'transpose',\n category: 'Matrix',\n syntax: ['x\\'', 'transpose(x)'],\n description: 'Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'transpose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};", "export var zerosDocs = {\n name: 'zeros',\n category: 'Matrix',\n syntax: ['zeros(m)', 'zeros(m, n)', 'zeros(m, n, p, ...)', 'zeros([m])', 'zeros([m, n])', 'zeros([m, n, p, ...])'],\n description: 'Create a matrix containing zeros.',\n examples: ['zeros(3)', 'zeros(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'zeros(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose']\n};", "export var fftDocs = {\n name: 'fft',\n category: 'Matrix',\n syntax: ['fft(x)'],\n description: 'Calculate N-dimensional fourier transform',\n examples: ['fft([[1, 0], [1, 0]])'],\n seealso: ['ifft']\n};", "export var ifftDocs = {\n name: 'ifft',\n category: 'Matrix',\n syntax: ['ifft(x)'],\n description: 'Calculate N-dimensional inverse fourier transform',\n examples: ['ifft([[2, 2], [0, 0]])'],\n seealso: ['fft']\n};", "export var combinationsDocs = {\n name: 'combinations',\n category: 'Probability',\n syntax: ['combinations(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time',\n examples: ['combinations(7, 5)'],\n seealso: ['combinationsWithRep', 'permutations', 'factorial']\n};", "export var combinationsWithRepDocs = {\n name: 'combinationsWithRep',\n category: 'Probability',\n syntax: ['combinationsWithRep(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time with replacements.',\n examples: ['combinationsWithRep(7, 5)'],\n seealso: ['combinations', 'permutations', 'factorial']\n};", "export var factorialDocs = {\n name: 'factorial',\n category: 'Probability',\n syntax: ['n!', 'factorial(n)'],\n description: 'Compute the factorial of a value',\n examples: ['5!', '5 * 4 * 3 * 2 * 1', '3!'],\n seealso: ['combinations', 'combinationsWithRep', 'permutations', 'gamma']\n};", "export var gammaDocs = {\n name: 'gamma',\n category: 'Probability',\n syntax: ['gamma(n)'],\n description: 'Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.',\n examples: ['gamma(4)', '3!', 'gamma(1/2)', 'sqrt(pi)'],\n seealso: ['factorial']\n};", "export var lgammaDocs = {\n name: 'lgamma',\n category: 'Probability',\n syntax: ['lgamma(n)'],\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.',\n examples: ['lgamma(4)', 'lgamma(1/2)', 'lgamma(i)', 'lgamma(complex(1.1, 2))'],\n seealso: ['gamma']\n};", "export var kldivergenceDocs = {\n name: 'kldivergence',\n category: 'Probability',\n syntax: ['kldivergence(x, y)'],\n description: 'Calculate the Kullback-Leibler (KL) divergence between two distributions.',\n examples: ['kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])'],\n seealso: []\n};", "export var multinomialDocs = {\n name: 'multinomial',\n category: 'Probability',\n syntax: ['multinomial(A)'],\n 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.',\n examples: ['multinomial([1, 2, 1])'],\n seealso: ['combinations', 'factorial']\n};", "export var permutationsDocs = {\n name: 'permutations',\n category: 'Probability',\n syntax: ['permutations(n)', 'permutations(n, k)'],\n description: 'Compute the number of permutations of n items taken k at a time',\n examples: ['permutations(5)', 'permutations(5, 3)'],\n seealso: ['combinations', 'combinationsWithRep', 'factorial']\n};", "export var pickRandomDocs = {\n name: 'pickRandom',\n category: 'Probability',\n syntax: ['pickRandom(array)', 'pickRandom(array, number)', 'pickRandom(array, weights)', 'pickRandom(array, number, weights)', 'pickRandom(array, weights, number)'],\n description: 'Pick a random entry from a given array.',\n 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)'],\n seealso: ['random', 'randomInt']\n};", "export var randomDocs = {\n name: 'random',\n category: 'Probability',\n syntax: ['random()', 'random(max)', 'random(min, max)', 'random(size)', 'random(size, max)', 'random(size, min, max)'],\n description: 'Return a random number.',\n examples: ['random()', 'random(10, 20)', 'random([2, 3])'],\n seealso: ['pickRandom', 'randomInt']\n};", "export var randomIntDocs = {\n name: 'randomInt',\n category: 'Probability',\n syntax: ['randomInt(max)', 'randomInt(min, max)', 'randomInt(size)', 'randomInt(size, max)', 'randomInt(size, min, max)'],\n description: 'Return a random integer number',\n examples: ['randomInt(10, 20)', 'randomInt([2, 3], 10)'],\n seealso: ['pickRandom', 'random']\n};", "export var compareDocs = {\n name: 'compare',\n category: 'Relational',\n syntax: ['compare(x, y)'],\n description: 'Compare two values. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compare(2, 3)', 'compare(3, 2)', 'compare(2, 2)', 'compare(5cm, 40mm)', 'compare(2, [1, 2, 3])'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compareNatural', 'compareText']\n};", "export var compareNaturalDocs = {\n name: 'compareNatural',\n category: 'Relational',\n syntax: ['compareNatural(x, y)'],\n 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.',\n 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})'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare', 'compareText']\n};", "export var compareTextDocs = {\n name: 'compareText',\n category: 'Relational',\n syntax: ['compareText(x, y)'],\n description: 'Compare two strings lexically. Comparison is case sensitive. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n 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\"])'],\n seealso: ['compare', 'compareNatural']\n};", "export var deepEqualDocs = {\n name: 'deepEqual',\n category: 'Relational',\n syntax: ['deepEqual(x, y)'],\n 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.',\n examples: ['deepEqual([1,3,4], [1,3,4])', 'deepEqual([1,3,4], [1,3])'],\n seealso: ['equal', 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare']\n};", "export var equalDocs = {\n name: 'equal',\n category: 'Relational',\n syntax: ['x == y', 'equal(x, y)'],\n description: 'Check equality of two values. Returns true if the values are equal, and false if not.',\n examples: ['2+2 == 3', '2+2 == 4', 'a = 3.2', 'b = 6-2.8', 'a == b', '50cm == 0.5m'],\n seealso: ['unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual', 'equalText']\n};", "export var equalTextDocs = {\n name: 'equalText',\n category: 'Relational',\n syntax: ['equalText(x, y)'],\n description: 'Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.',\n examples: ['equalText(\"Hello\", \"Hello\")', 'equalText(\"a\", \"A\")', 'equal(\"2e3\", \"2000\")', 'equalText(\"2e3\", \"2000\")', 'equalText(\"B\", [\"A\", \"B\", \"C\"])'],\n seealso: ['compare', 'compareNatural', 'compareText', 'equal']\n};", "export var largerDocs = {\n name: 'larger',\n category: 'Relational',\n syntax: ['x > y', 'larger(x, y)'],\n description: 'Check if value x is larger than y. Returns true if x is larger than y, and false if not.',\n examples: ['2 > 3', '5 > 2*2', 'a = 3.3', 'b = 6-2.8', '(a > b)', '(b < a)', '5 cm > 2 inch'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare']\n};", "export var largerEqDocs = {\n name: 'largerEq',\n category: 'Relational',\n syntax: ['x >= y', 'largerEq(x, y)'],\n 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.',\n examples: ['2 >= 1+1', '2 > 1+1', 'a = 3.2', 'b = 6-2.8', '(a >= b)'],\n seealso: ['equal', 'unequal', 'smallerEq', 'smaller', 'compare']\n};", "export var smallerDocs = {\n name: 'smaller',\n category: 'Relational',\n syntax: ['x < y', 'smaller(x, y)'],\n description: 'Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.',\n examples: ['2 < 3', '5 < 2*2', 'a = 3.3', 'b = 6-2.8', '(a < b)', '5 cm < 2 inch'],\n seealso: ['equal', 'unequal', 'larger', 'smallerEq', 'largerEq', 'compare']\n};", "export var smallerEqDocs = {\n name: 'smallerEq',\n category: 'Relational',\n syntax: ['x <= y', 'smallerEq(x, y)'],\n description: 'Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.',\n examples: ['2 <= 1+1', '2 < 1+1', 'a = 3.2', 'b = 6-2.8', '(a <= b)'],\n seealso: ['equal', 'unequal', 'larger', 'smaller', 'largerEq', 'compare']\n};", "export var unequalDocs = {\n name: 'unequal',\n category: 'Relational',\n syntax: ['x != y', 'unequal(x, y)'],\n description: 'Check unequality of two values. Returns true if the values are unequal, and false if they are equal.',\n examples: ['2+2 != 3', '2+2 != 4', 'a = 3.2', 'b = 6-2.8', 'a != b', '50cm != 0.5m', '5 cm != 2 inch'],\n seealso: ['equal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual']\n};", "export var setCartesianDocs = {\n name: 'setCartesian',\n category: 'Set',\n syntax: ['setCartesian(set1, set2)'],\n 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.',\n examples: ['setCartesian([1, 2], [3, 4])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference', 'setPowerset']\n};", "export var setDifferenceDocs = {\n name: 'setDifference',\n category: 'Set',\n syntax: ['setDifference(set1, set2)'],\n 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.',\n examples: ['setDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setSymDifference']\n};", "export var setDistinctDocs = {\n name: 'setDistinct',\n category: 'Set',\n syntax: ['setDistinct(set)'],\n description: 'Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setDistinct([1, 1, 1, 2, 2, 3])'],\n seealso: ['setMultiplicity']\n};", "export var setIntersectDocs = {\n name: 'setIntersect',\n category: 'Set',\n syntax: ['setIntersect(set1, set2)'],\n description: 'Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setIntersect([1, 2, 3, 4], [3, 4, 5, 6])', 'setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setDifference']\n};", "export var setIsSubsetDocs = {\n name: 'setIsSubset',\n category: 'Set',\n syntax: ['setIsSubset(set1, set2)'],\n 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.',\n examples: ['setIsSubset([1, 2], [3, 4, 5, 6])', 'setIsSubset([3, 4], [3, 4, 5, 6])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setMultiplicityDocs = {\n name: 'setMultiplicity',\n category: 'Set',\n syntax: ['setMultiplicity(element, set)'],\n 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.',\n examples: ['setMultiplicity(1, [1, 2, 2, 4])', 'setMultiplicity(2, [1, 2, 2, 4])'],\n seealso: ['setDistinct', 'setSize']\n};", "export var setPowersetDocs = {\n name: 'setPowerset',\n category: 'Set',\n syntax: ['setPowerset(set)'],\n 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.',\n examples: ['setPowerset([1, 2, 3])'],\n seealso: ['setCartesian']\n};", "export var setSizeDocs = {\n name: 'setSize',\n category: 'Set',\n syntax: ['setSize(set)', 'setSize(set, unique)'],\n 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.',\n examples: ['setSize([1, 2, 2, 4])', 'setSize([1, 2, 2, 4], true)'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setSymDifferenceDocs = {\n name: 'setSymDifference',\n category: 'Set',\n syntax: ['setSymDifference(set1, set2)'],\n description: 'Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setUnionDocs = {\n name: 'setUnion',\n category: 'Set',\n syntax: ['setUnion(set1, set2)'],\n description: 'Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setUnion([1, 2, 3, 4], [3, 4, 5, 6])', 'setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setIntersect', 'setDifference']\n};", "export var zpk2tfDocs = {\n name: 'zpk2tf',\n category: 'Signal',\n syntax: ['zpk2tf(z, p, k)'],\n description: 'Compute the transfer function of a zero-pole-gain model.',\n examples: ['zpk2tf([1, 2], [-1, -2], 1)', 'zpk2tf([1, 2], [-1, -2])', 'zpk2tf([1 - 3i, 2 + 2i], [-1, -2])'],\n seealso: []\n};", "export var freqzDocs = {\n name: 'freqz',\n category: 'Signal',\n syntax: ['freqz(b, a)', 'freqz(b, a, w)'],\n description: 'Calculates the frequency response of a filter given its numerator and denominator coefficients.',\n examples: ['freqz([1, 2], [1, 2, 3])', 'freqz([1, 2], [1, 2, 3], [0, 1])', 'freqz([1, 2], [1, 2, 3], 512)'],\n seealso: []\n};", "export var erfDocs = {\n name: 'erf',\n category: 'Special',\n syntax: ['erf(x)'],\n description: 'Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x',\n examples: ['erf(0.2)', 'erf(-0.5)', 'erf(4)'],\n seealso: []\n};", "export var zetaDocs = {\n name: 'zeta',\n category: 'Special',\n syntax: ['zeta(s)'],\n description: 'Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane',\n examples: ['zeta(0.2)', 'zeta(-0.5)', 'zeta(4)'],\n seealso: []\n};", "export var madDocs = {\n name: 'mad',\n category: 'Statistics',\n syntax: ['mad(a, b, c, ...)', 'mad(A)'],\n 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.',\n examples: ['mad(10, 20, 30)', 'mad([1, 2, 3])'],\n seealso: ['mean', 'median', 'std', 'abs']\n};", "export var maxDocs = {\n name: 'max',\n category: 'Statistics',\n syntax: ['max(a, b, c, ...)', 'max(A)', 'max(A, dimension)'],\n description: 'Compute the maximum value of a list of values.',\n 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)'],\n seealso: ['mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var meanDocs = {\n name: 'mean',\n category: 'Statistics',\n syntax: ['mean(a, b, c, ...)', 'mean(A)', 'mean(A, dimension)'],\n description: 'Compute the arithmetic mean of a list of values.',\n 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])'],\n seealso: ['max', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var medianDocs = {\n name: 'median',\n category: 'Statistics',\n syntax: ['median(a, b, c, ...)', 'median(A)'],\n 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.',\n examples: ['median(5, 2, 7)', 'median([3, -1, 5, 7])'],\n seealso: ['max', 'mean', 'min', 'prod', 'std', 'sum', 'variance', 'quantileSeq']\n};", "export var minDocs = {\n name: 'min',\n category: 'Statistics',\n syntax: ['min(a, b, c, ...)', 'min(A)', 'min(A, dimension)'],\n description: 'Compute the minimum value of a list of values.',\n 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)'],\n seealso: ['max', 'mean', 'median', 'prod', 'std', 'sum', 'variance']\n};", "export var modeDocs = {\n name: 'mode',\n category: 'Statistics',\n syntax: ['mode(a, b, c, ...)', 'mode(A)', 'mode(A, a, b, B, c, ...)'],\n description: 'Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.',\n examples: ['mode(2, 1, 4, 3, 1)', 'mode([1, 2.7, 3.2, 4, 2.7])', 'mode(1, 4, 6, 1, 6)'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'std', 'sum', 'variance']\n};", "export var prodDocs = {\n name: 'prod',\n category: 'Statistics',\n syntax: ['prod(a, b, c, ...)', 'prod(A)'],\n description: 'Compute the product of all values.',\n examples: ['prod(2, 3, 4)', 'prod([2, 3, 4])', 'prod([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'std', 'sum', 'variance']\n};", "export var quantileSeqDocs = {\n name: 'quantileSeq',\n category: 'Statistics',\n syntax: ['quantileSeq(A, prob[, sorted])', 'quantileSeq(A, [prob1, prob2, ...][, sorted])', 'quantileSeq(A, N[, sorted])'],\n 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 probablity are: Number, BigNumber. \\n\\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.',\n 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)'],\n seealso: ['mean', 'median', 'min', 'max', 'prod', 'std', 'sum', 'variance']\n};", "export var stdDocs = {\n name: 'std',\n category: 'Statistics',\n syntax: ['std(a, b, c, ...)', 'std(A)', 'std(A, dimension)', 'std(A, normalization)', 'std(A, dimension, normalization)'],\n 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\".',\n 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])'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'sum', 'variance']\n};", "export var cumSumDocs = {\n name: 'cumsum',\n category: 'Statistics',\n syntax: ['cumsum(a, b, c, ...)', 'cumsum(A)'],\n description: 'Compute the cumulative sum of all values.',\n 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)'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var sumDocs = {\n name: 'sum',\n category: 'Statistics',\n syntax: ['sum(a, b, c, ...)', 'sum(A)', 'sum(A, dimension)'],\n description: 'Compute the sum of all values.',\n examples: ['sum(2, 3, 4, 1)', 'sum([2, 3, 4, 1])', 'sum([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var varianceDocs = {\n name: 'variance',\n category: 'Statistics',\n syntax: ['variance(a, b, c, ...)', 'variance(A)', 'variance(A, dimension)', 'variance(A, normalization)', 'variance(A, dimension, normalization)'],\n description: 'Compute the variance of all values. Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n 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])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};", "export var corrDocs = {\n name: 'corr',\n category: 'Statistics',\n syntax: ['corr(A,B)'],\n description: 'Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.',\n 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]]))'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};", "export var acosDocs = {\n name: 'acos',\n category: 'Trigonometry',\n syntax: ['acos(x)'],\n description: 'Compute the inverse cosine of a value in radians.',\n examples: ['acos(0.5)', 'acos(cos(2.3))'],\n seealso: ['cos', 'atan', 'asin']\n};", "export var acoshDocs = {\n name: 'acosh',\n category: 'Trigonometry',\n syntax: ['acosh(x)'],\n description: 'Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.',\n examples: ['acosh(1.5)'],\n seealso: ['cosh', 'asinh', 'atanh']\n};", "export var acotDocs = {\n name: 'acot',\n category: 'Trigonometry',\n syntax: ['acot(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acot(0.5)', 'acot(cot(0.5))', 'acot(2)'],\n seealso: ['cot', 'atan']\n};", "export var acothDocs = {\n name: 'acoth',\n category: 'Trigonometry',\n syntax: ['acoth(x)'],\n description: 'Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.',\n examples: ['acoth(2)', 'acoth(0.5)'],\n seealso: ['acsch', 'asech']\n};", "export var acscDocs = {\n name: 'acsc',\n category: 'Trigonometry',\n syntax: ['acsc(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acsc(2)', 'acsc(csc(0.5))', 'acsc(0.5)'],\n seealso: ['csc', 'asin', 'asec']\n};", "export var acschDocs = {\n name: 'acsch',\n category: 'Trigonometry',\n syntax: ['acsch(x)'],\n description: 'Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.',\n examples: ['acsch(0.5)'],\n seealso: ['asech', 'acoth']\n};", "export var asecDocs = {\n name: 'asec',\n category: 'Trigonometry',\n syntax: ['asec(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asec(0.5)', 'asec(sec(0.5))', 'asec(2)'],\n seealso: ['acos', 'acot', 'acsc']\n};", "export var asechDocs = {\n name: 'asech',\n category: 'Trigonometry',\n syntax: ['asech(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asech(0.5)'],\n seealso: ['acsch', 'acoth']\n};", "export var asinDocs = {\n name: 'asin',\n category: 'Trigonometry',\n syntax: ['asin(x)'],\n description: 'Compute the inverse sine of a value in radians.',\n examples: ['asin(0.5)', 'asin(sin(0.5))'],\n seealso: ['sin', 'acos', 'atan']\n};", "export var asinhDocs = {\n name: 'asinh',\n category: 'Trigonometry',\n syntax: ['asinh(x)'],\n description: 'Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.',\n examples: ['asinh(0.5)'],\n seealso: ['acosh', 'atanh']\n};", "export var atanDocs = {\n name: 'atan',\n category: 'Trigonometry',\n syntax: ['atan(x)'],\n description: 'Compute the inverse tangent of a value in radians.',\n examples: ['atan(0.5)', 'atan(tan(0.5))'],\n seealso: ['tan', 'acos', 'asin']\n};", "export var atan2Docs = {\n name: 'atan2',\n category: 'Trigonometry',\n syntax: ['atan2(y, x)'],\n description: 'Computes the principal value of the arc tangent of y/x in radians.',\n examples: ['atan2(2, 2) / pi', 'angle = 60 deg in rad', 'x = cos(angle)', 'y = sin(angle)', 'atan2(y, x)'],\n seealso: ['sin', 'cos', 'tan']\n};", "export var atanhDocs = {\n name: 'atanh',\n category: 'Trigonometry',\n syntax: ['atanh(x)'],\n description: 'Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.',\n examples: ['atanh(0.5)'],\n seealso: ['acosh', 'asinh']\n};", "export var cosDocs = {\n name: 'cos',\n category: 'Trigonometry',\n syntax: ['cos(x)'],\n description: 'Compute the cosine of x in radians.',\n examples: ['cos(2)', 'cos(pi / 4) ^ 2', 'cos(180 deg)', 'cos(60 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['acos', 'sin', 'tan']\n};", "export var coshDocs = {\n name: 'cosh',\n category: 'Trigonometry',\n syntax: ['cosh(x)'],\n description: 'Compute the hyperbolic cosine of x in radians.',\n examples: ['cosh(0.5)'],\n seealso: ['sinh', 'tanh', 'coth']\n};", "export var cotDocs = {\n name: 'cot',\n category: 'Trigonometry',\n syntax: ['cot(x)'],\n description: 'Compute the cotangent of x in radians. Defined as 1/tan(x)',\n examples: ['cot(2)', '1 / tan(2)'],\n seealso: ['sec', 'csc', 'tan']\n};", "export var cothDocs = {\n name: 'coth',\n category: 'Trigonometry',\n syntax: ['coth(x)'],\n description: 'Compute the hyperbolic cotangent of x in radians.',\n examples: ['coth(2)', '1 / tanh(2)'],\n seealso: ['sech', 'csch', 'tanh']\n};", "export var cscDocs = {\n name: 'csc',\n category: 'Trigonometry',\n syntax: ['csc(x)'],\n description: 'Compute the cosecant of x in radians. Defined as 1/sin(x)',\n examples: ['csc(2)', '1 / sin(2)'],\n seealso: ['sec', 'cot', 'sin']\n};", "export var cschDocs = {\n name: 'csch',\n category: 'Trigonometry',\n syntax: ['csch(x)'],\n description: 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)',\n examples: ['csch(2)', '1 / sinh(2)'],\n seealso: ['sech', 'coth', 'sinh']\n};", "export var secDocs = {\n name: 'sec',\n category: 'Trigonometry',\n syntax: ['sec(x)'],\n description: 'Compute the secant of x in radians. Defined as 1/cos(x)',\n examples: ['sec(2)', '1 / cos(2)'],\n seealso: ['cot', 'csc', 'cos']\n};", "export var sechDocs = {\n name: 'sech',\n category: 'Trigonometry',\n syntax: ['sech(x)'],\n description: 'Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)',\n examples: ['sech(2)', '1 / cosh(2)'],\n seealso: ['coth', 'csch', 'cosh']\n};", "export var sinDocs = {\n name: 'sin',\n category: 'Trigonometry',\n syntax: ['sin(x)'],\n description: 'Compute the sine of x in radians.',\n examples: ['sin(2)', 'sin(pi / 4) ^ 2', 'sin(90 deg)', 'sin(30 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['asin', 'cos', 'tan']\n};", "export var sinhDocs = {\n name: 'sinh',\n category: 'Trigonometry',\n syntax: ['sinh(x)'],\n description: 'Compute the hyperbolic sine of x in radians.',\n examples: ['sinh(0.5)'],\n seealso: ['cosh', 'tanh']\n};", "export var tanDocs = {\n name: 'tan',\n category: 'Trigonometry',\n syntax: ['tan(x)'],\n description: 'Compute the tangent of x in radians.',\n examples: ['tan(0.5)', 'sin(0.5) / cos(0.5)', 'tan(pi / 4)', 'tan(45 deg)'],\n seealso: ['atan', 'sin', 'cos']\n};", "export var tanhDocs = {\n name: 'tanh',\n category: 'Trigonometry',\n syntax: ['tanh(x)'],\n description: 'Compute the hyperbolic tangent of x in radians.',\n examples: ['tanh(0.5)', 'sinh(0.5) / cosh(0.5)'],\n seealso: ['sinh', 'cosh']\n};", "export var toDocs = {\n name: 'to',\n category: 'Units',\n syntax: ['x to unit', 'to(x, unit)'],\n description: 'Change the unit of a value.',\n examples: ['5 inch to cm', '3.2kg to g', '16 bytes in bits'],\n seealso: []\n};", "export var binDocs = {\n name: 'bin',\n category: 'Utils',\n syntax: ['bin(value)'],\n description: 'Format a number as binary',\n examples: ['bin(2)'],\n seealso: ['oct', 'hex']\n};", "export var cloneDocs = {\n name: 'clone',\n category: 'Utils',\n syntax: ['clone(x)'],\n description: 'Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices',\n examples: ['clone(3.5)', 'clone(2 - 4i)', 'clone(45 deg)', 'clone([1, 2; 3, 4])', 'clone(\"hello world\")'],\n seealso: []\n};", "export var formatDocs = {\n name: 'format',\n category: 'Utils',\n syntax: ['format(value)', 'format(value, precision)'],\n description: 'Format a value of any type as string.',\n examples: ['format(2.3)', 'format(3 - 4i)', 'format([])', 'format(pi, 3)'],\n seealso: ['print']\n};", "export var hasNumericValueDocs = {\n name: 'hasNumericValue',\n category: 'Utils',\n syntax: ['hasNumericValue(x)'],\n description: 'Test whether a value is an numeric value. ' + 'In case of a string, true is returned if the string contains a numeric value.',\n examples: ['hasNumericValue(2)', 'hasNumericValue(\"2\")', 'isNumeric(\"2\")', 'hasNumericValue(0)', 'hasNumericValue(bignumber(500))', 'hasNumericValue(fraction(0.125))', 'hasNumericValue(2 + 3i)', 'hasNumericValue([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric']\n};", "export var hexDocs = {\n name: 'hex',\n category: 'Utils',\n syntax: ['hex(value)'],\n description: 'Format a number as hexadecimal',\n examples: ['hex(240)'],\n seealso: ['bin', 'oct']\n};", "export var isIntegerDocs = {\n name: 'isInteger',\n category: 'Utils',\n syntax: ['isInteger(x)'],\n description: 'Test whether a value is an integer number.',\n examples: ['isInteger(2)', 'isInteger(3.5)', 'isInteger([3, 0.5, -2])'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNaNDocs = {\n name: 'isNaN',\n category: 'Utils',\n syntax: ['isNaN(x)'],\n description: 'Test whether a value is NaN (not a number)',\n examples: ['isNaN(2)', 'isNaN(0 / 0)', 'isNaN(NaN)', 'isNaN(Infinity)'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNegativeDocs = {\n name: 'isNegative',\n category: 'Utils',\n syntax: ['isNegative(x)'],\n description: 'Test whether a value is negative: smaller than zero.',\n examples: ['isNegative(2)', 'isNegative(0)', 'isNegative(-4)', 'isNegative([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNumericDocs = {\n name: 'isNumeric',\n category: 'Utils',\n syntax: ['isNumeric(x)'],\n description: 'Test whether a value is a numeric value. ' + 'Returns true when the input is a number, BigNumber, Fraction, or boolean.',\n examples: ['isNumeric(2)', 'isNumeric(\"2\")', 'hasNumericValue(\"2\")', 'isNumeric(0)', 'isNumeric(bignumber(500))', 'isNumeric(fraction(0.125))', 'isNumeric(2 + 3i)', 'isNumeric([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue']\n};", "export var isPositiveDocs = {\n name: 'isPositive',\n category: 'Utils',\n syntax: ['isPositive(x)'],\n description: 'Test whether a value is positive: larger than zero.',\n examples: ['isPositive(2)', 'isPositive(0)', 'isPositive(-4)', 'isPositive([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};", "export var isPrimeDocs = {\n name: 'isPrime',\n category: 'Utils',\n syntax: ['isPrime(x)'],\n description: 'Test whether a value is prime: has no divisors other than itself and one.',\n examples: ['isPrime(3)', 'isPrime(-2)', 'isPrime([2, 17, 100])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};", "export var isZeroDocs = {\n name: 'isZero',\n category: 'Utils',\n syntax: ['isZero(x)'],\n description: 'Test whether a value is zero.',\n examples: ['isZero(2)', 'isZero(0)', 'isZero(-4)', 'isZero([3, 0, -2, 0])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isPositive']\n};", "export var numericDocs = {\n name: 'numeric',\n category: 'Utils',\n syntax: ['numeric(x)'],\n description: 'Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.',\n examples: ['numeric(\"4\")', 'numeric(\"4\", \"number\")', 'numeric(\"4\", \"bigint\")', 'numeric(\"4\", \"BigNumber\")', 'numeric(\"4\", \"Fraction\")', 'numeric(4, \"Fraction\")', 'numeric(fraction(2, 5), \"number\")'],\n seealso: ['number', 'bigint', 'fraction', 'bignumber', 'string', 'format']\n};", "export var octDocs = {\n name: 'oct',\n category: 'Utils',\n syntax: ['oct(value)'],\n description: 'Format a number as octal',\n examples: ['oct(56)'],\n seealso: ['bin', 'hex']\n};", "export var printDocs = {\n name: 'print',\n category: 'Utils',\n syntax: ['print(template, values)', 'print(template, values, precision)'],\n description: 'Interpolate values into a string template.',\n 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])'],\n seealso: ['format']\n};", "export var typeOfDocs = {\n name: 'typeOf',\n category: 'Utils',\n syntax: ['typeOf(x)'],\n description: 'Get the type of a variable.',\n examples: ['typeOf(3.5)', 'typeOf(2 - 4i)', 'typeOf(45 deg)', 'typeOf(\"hello world\")'],\n seealso: ['getMatrixDataType']\n};", "export var solveODEDocs = {\n name: 'solveODE',\n category: 'Numeric',\n syntax: ['solveODE(func, tspan, y0)', 'solveODE(func, tspan, y0, options)'],\n description: 'Numerical Integration of Ordinary Differential Equations.',\n 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 })'],\n seealso: ['derivative', 'simplifyCore']\n};", "import { factory } from '../../../utils/factory.js';\nvar name = 'chain';\nvar dependencies = ['typed', 'Chain'];\nexport var createChain = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Chain\n } = _ref;\n /**\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing `chain.done()`, which returns\n * the final value.\n *\n * The chain has a number of special functions:\n *\n * - `done()` Finalize the chain and return the chain's value.\n * - `valueOf()` The same as `done()`\n * - `toString()` Executes `math.format()` onto the chain's value, returning\n * a string representation of the value.\n *\n * Syntax:\n *\n * math.chain(value)\n *\n * Examples:\n *\n * math.chain(3)\n * .add(4)\n * .subtract(2)\n * .done() // 5\n *\n * math.chain( [[1, 2], [3, 4]] )\n * .subset(math.index(0, 0), 8)\n * .multiply(3)\n * .done() // [[24, 6], [9, 12]]\n *\n * @param {*} [value] A value of any type on which to start a chained operation.\n * @return {math.Chain} The created chain\n */\n return typed(name, {\n '': function _() {\n return new Chain();\n },\n any: function any(value) {\n return new Chain(value);\n }\n });\n});", "import { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'det';\nvar dependencies = ['typed', 'matrix', 'subtractScalar', 'multiply', 'divideScalar', 'isZero', 'unaryMinus'];\nexport var createDet = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtractScalar,\n multiply,\n divideScalar,\n isZero,\n unaryMinus\n } = _ref;\n /**\n * Calculate the determinant of a matrix.\n *\n * Syntax:\n *\n * math.det(x)\n *\n * Examples:\n *\n * math.det([[1, 2], [3, 4]]) // returns -2\n *\n * const A = [\n * [-2, 2, 3],\n * [-1, 1, 3],\n * [2, 0, -1]\n * ]\n * math.det(A) // returns 6\n *\n * See also:\n *\n * inv\n *\n * @param {Array | Matrix} x A matrix\n * @return {number} The determinant of `x`\n */\n return typed(name, {\n any: function any(x) {\n return clone(x);\n },\n 'Array | Matrix': function det(x) {\n var size;\n if (isMatrix(x)) {\n size = x.size();\n } else if (Array.isArray(x)) {\n x = matrix(x);\n size = x.size();\n } else {\n // a scalar\n size = [];\n }\n switch (size.length) {\n case 0:\n // scalar\n return clone(x);\n case 1:\n // vector\n if (size[0] === 1) {\n return clone(x.valueOf()[0]);\n }\n if (size[0] === 0) {\n return 1; // det of an empty matrix is per definition 1\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n {\n // two-dimensional array\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n return _det(x.clone().valueOf(), rows, cols);\n }\n if (cols === 0) {\n return 1; // det of an empty matrix is per definition 1\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n }\n });\n\n /**\n * Calculate the determinant of a matrix\n * @param {Array[]} matrix A square, two dimensional matrix\n * @param {number} rows Number of rows of the matrix (zero-based)\n * @param {number} cols Number of columns of the matrix (zero-based)\n * @returns {number} det\n * @private\n */\n function _det(matrix, rows, cols) {\n if (rows === 1) {\n // this is a 1 x 1 matrix\n return clone(matrix[0][0]);\n } else if (rows === 2) {\n // this is a 2 x 2 matrix\n // the determinant of [a11,a12;a21,a22] is det = a11*a22-a21*a12\n return subtractScalar(multiply(matrix[0][0], matrix[1][1]), multiply(matrix[1][0], matrix[0][1]));\n } else {\n // Bareiss algorithm\n // this algorithm have same complexity as LUP decomposition (O(n^3))\n // but it preserve precision of floating point more relative to the LUP decomposition\n var negated = false;\n var rowIndices = new Array(rows).fill(0).map((_, i) => i); // matrix index of row i\n for (var k = 0; k < rows; k++) {\n var k_ = rowIndices[k];\n if (isZero(matrix[k_][k])) {\n var _k = void 0;\n for (_k = k + 1; _k < rows; _k++) {\n if (!isZero(matrix[rowIndices[_k]][k])) {\n k_ = rowIndices[_k];\n rowIndices[_k] = rowIndices[k];\n rowIndices[k] = k_;\n negated = !negated;\n break;\n }\n }\n if (_k === rows) return matrix[k_][k]; // some zero of the type\n }\n var piv = matrix[k_][k];\n var piv_ = k === 0 ? 1 : matrix[rowIndices[k - 1]][k - 1];\n for (var i = k + 1; i < rows; i++) {\n var i_ = rowIndices[i];\n for (var j = k + 1; j < rows; j++) {\n matrix[i_][j] = divideScalar(subtractScalar(multiply(matrix[i_][j], piv), multiply(matrix[i_][k], matrix[k_][j])), piv_);\n }\n }\n }\n var det = matrix[rowIndices[rows - 1]][rows - 1];\n return negated ? unaryMinus(det) : det;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nvar name = 'inv';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'addScalar', 'multiply', 'unaryMinus', 'det', 'identity', 'abs'];\nexport var createInv = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n addScalar,\n multiply,\n unaryMinus,\n det,\n identity,\n abs\n } = _ref;\n /**\n * Calculate the inverse of a square matrix.\n *\n * Syntax:\n *\n * math.inv(x)\n *\n * Examples:\n *\n * math.inv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]\n * math.inv(4) // returns 0.25\n * 1 / 4 // returns 0.25\n *\n * See also:\n *\n * det, transpose\n *\n * @param {number | Complex | Array | Matrix} x Matrix to be inversed\n * @return {number | Complex | Array | Matrix} The inverse of `x`.\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(x) {\n var size = isMatrix(x) ? x.size() : arraySize(x);\n switch (size.length) {\n case 1:\n // vector\n if (size[0] === 1) {\n if (isMatrix(x)) {\n return matrix([divideScalar(1, x.valueOf()[0])]);\n } else {\n return [divideScalar(1, x[0])];\n }\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n // two dimensional array\n {\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n if (isMatrix(x)) {\n return matrix(_inv(x.valueOf(), rows, cols), x.storage());\n } else {\n // return an Array\n return _inv(x, rows, cols);\n }\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n },\n any: function any(x) {\n // scalar\n return divideScalar(1, x); // FIXME: create a BigNumber one when configured for bignumbers\n }\n });\n\n /**\n * Calculate the inverse of a square matrix\n * @param {Array[]} mat A square matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns, must equal rows\n * @return {Array[]} inv Inverse matrix\n * @private\n */\n function _inv(mat, rows, cols) {\n var r, s, f, value, temp;\n if (rows === 1) {\n // this is a 1 x 1 matrix\n value = mat[0][0];\n if (value === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n return [[divideScalar(1, value)]];\n } else if (rows === 2) {\n // this is a 2 x 2 matrix\n var d = det(mat);\n if (d === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n return [[divideScalar(mat[1][1], d), divideScalar(unaryMinus(mat[0][1]), d)], [divideScalar(unaryMinus(mat[1][0]), d), divideScalar(mat[0][0], d)]];\n } else {\n // this is a matrix of 3 x 3 or larger\n // calculate inverse using gauss-jordan elimination\n // https://en.wikipedia.org/wiki/Gaussian_elimination\n // http://mathworld.wolfram.com/MatrixInverse.html\n // http://math.uww.edu/~mcfarlat/inverse.htm\n\n // make a copy of the matrix (only the arrays, not of the elements)\n var A = mat.concat();\n for (r = 0; r < rows; r++) {\n A[r] = A[r].concat();\n }\n\n // create an identity matrix which in the end will contain the\n // matrix inverse\n var B = identity(rows).valueOf();\n\n // loop over all columns, and perform row reductions\n for (var c = 0; c < cols; c++) {\n // Pivoting: Swap row c with row r, where row r contains the largest element A[r][c]\n var ABig = abs(A[c][c]);\n var rBig = c;\n r = c + 1;\n while (r < rows) {\n if (abs(A[r][c]) > ABig) {\n ABig = abs(A[r][c]);\n rBig = r;\n }\n r++;\n }\n if (ABig === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n r = rBig;\n if (r !== c) {\n temp = A[c];\n A[c] = A[r];\n A[r] = temp;\n temp = B[c];\n B[c] = B[r];\n B[r] = temp;\n }\n\n // eliminate non-zero values on the other rows at column c\n var Ac = A[c];\n var Bc = B[c];\n for (r = 0; r < rows; r++) {\n var Ar = A[r];\n var Br = B[r];\n if (r !== c) {\n // eliminate value at column c and row r\n if (Ar[c] !== 0) {\n f = divideScalar(unaryMinus(Ar[c]), Ac[c]);\n\n // add (f * row c) to row r to eliminate the value\n // at column c\n for (s = c; s < cols; s++) {\n Ar[s] = addScalar(Ar[s], multiply(f, Ac[s]));\n }\n for (s = 0; s < cols; s++) {\n Br[s] = addScalar(Br[s], multiply(f, Bc[s]));\n }\n }\n } else {\n // normalize value at Acc to 1,\n // divide each value on row r with the value at Acc\n f = Ac[c];\n for (s = c; s < cols; s++) {\n Ar[s] = divideScalar(Ar[s], f);\n }\n for (s = 0; s < cols; s++) {\n Br[s] = divideScalar(Br[s], f);\n }\n }\n }\n }\n return B;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nimport { clone } from '../../utils/object.js';\nvar name = 'pinv';\nvar dependencies = ['typed', 'matrix', 'inv', 'deepEqual', 'equal', 'dotDivide', 'dot', 'ctranspose', 'divideScalar', 'multiply', 'add', 'Complex'];\nexport var createPinv = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n inv,\n deepEqual,\n equal,\n dotDivide,\n dot,\n ctranspose,\n divideScalar,\n multiply,\n add,\n Complex\n } = _ref;\n /**\n * Calculate the Moore\u2013Penrose inverse of a matrix.\n *\n * Syntax:\n *\n * math.pinv(x)\n *\n * Examples:\n *\n * math.pinv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]\n * math.pinv([[1, 0], [0, 1], [0, 1]]) // returns [[1, 0, 0], [0, 0.5, 0.5]]\n * math.pinv(4) // returns 0.25\n *\n * See also:\n *\n * inv\n *\n * @param {number | Complex | Array | Matrix} x Matrix to be inversed\n * @return {number | Complex | Array | Matrix} The inverse of `x`.\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(x) {\n var size = isMatrix(x) ? x.size() : arraySize(x);\n switch (size.length) {\n case 1:\n // vector\n if (_isZeros(x)) return ctranspose(x); // null vector\n if (size[0] === 1) {\n return inv(x); // invertible matrix\n } else {\n return dotDivide(ctranspose(x), dot(x, x));\n }\n case 2:\n // two dimensional array\n {\n if (_isZeros(x)) return ctranspose(x); // zero matrixx\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n try {\n return inv(x); // invertible matrix\n } catch (err) {\n if (err instanceof Error && err.message.match(/Cannot calculate inverse, determinant is zero/)) {\n // Expected\n } else {\n throw err;\n }\n }\n }\n if (isMatrix(x)) {\n return matrix(_pinv(x.valueOf(), rows, cols), x.storage());\n } else {\n // return an Array\n return _pinv(x, rows, cols);\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n },\n any: function any(x) {\n // scalar\n if (equal(x, 0)) return clone(x); // zero\n return divideScalar(1, x);\n }\n });\n\n /**\n * Calculate the Moore\u2013Penrose inverse of a matrix\n * @param {Array[]} mat A matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {Array[]} pinv Pseudoinverse matrix\n * @private\n */\n function _pinv(mat, rows, cols) {\n var {\n C,\n F\n } = _rankFact(mat, rows, cols); // TODO: Use SVD instead (may improve precision)\n var Cpinv = multiply(inv(multiply(ctranspose(C), C)), ctranspose(C));\n var Fpinv = multiply(ctranspose(F), inv(multiply(F, ctranspose(F))));\n return multiply(Fpinv, Cpinv);\n }\n\n /**\n * Calculate the reduced row echelon form of a matrix\n *\n * Modified from https://rosettacode.org/wiki/Reduced_row_echelon_form\n *\n * @param {Array[]} mat A matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {Array[]} Reduced row echelon form\n * @private\n */\n function _rref(mat, rows, cols) {\n var M = clone(mat);\n var lead = 0;\n for (var r = 0; r < rows; r++) {\n if (cols <= lead) {\n return M;\n }\n var i = r;\n while (_isZero(M[i][lead])) {\n i++;\n if (rows === i) {\n i = r;\n lead++;\n if (cols === lead) {\n return M;\n }\n }\n }\n [M[i], M[r]] = [M[r], M[i]];\n var val = M[r][lead];\n for (var j = 0; j < cols; j++) {\n M[r][j] = dotDivide(M[r][j], val);\n }\n for (var _i = 0; _i < rows; _i++) {\n if (_i === r) continue;\n val = M[_i][lead];\n for (var _j = 0; _j < cols; _j++) {\n M[_i][_j] = add(M[_i][_j], multiply(-1, multiply(val, M[r][_j])));\n }\n }\n lead++;\n }\n return M;\n }\n\n /**\n * Calculate the rank factorization of a matrix\n *\n * @param {Array[]} mat A matrix (M)\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {{C: Array, F: Array}} rank factorization where M = C F\n * @private\n */\n function _rankFact(mat, rows, cols) {\n var rref = _rref(mat, rows, cols);\n var C = mat.map((_, i) => _.filter((_, j) => j < rows && !_isZero(dot(rref[j], rref[j]))));\n var F = rref.filter((_, i) => !_isZero(dot(rref[i], rref[i])));\n return {\n C,\n F\n };\n }\n function _isZero(x) {\n return equal(add(x, Complex(1, 1)), add(0, Complex(1, 1)));\n }\n function _isZeros(arr) {\n return deepEqual(add(arr, Complex(1, 1)), add(multiply(arr, 0), Complex(1, 1)));\n }\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nimport { createComplexEigs } from './eigs/complexEigs.js';\nimport { createRealSymmetric } from './eigs/realSymmetric.js';\nimport { typeOf, isNumber, isBigNumber, isComplex, isFraction } from '../../utils/is.js';\nvar name = 'eigs';\n\n// The absolute state of math.js's dependency system:\nvar dependencies = ['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'];\nexport var createEigs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n matrix,\n addScalar,\n subtract,\n equal,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n divideScalar,\n inv,\n bignumber,\n multiply,\n add,\n larger,\n column,\n flatten,\n number,\n complex,\n sqrt,\n diag,\n size,\n reshape,\n qr,\n usolve,\n usolveAll,\n im,\n re,\n smaller,\n matrixFromColumns,\n dot\n } = _ref;\n var doRealSymmetric = createRealSymmetric({\n config,\n addScalar,\n subtract,\n column,\n flatten,\n equal,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n inv,\n bignumber,\n complex,\n multiply,\n add\n });\n var doComplexEigs = createComplexEigs({\n config,\n addScalar,\n subtract,\n multiply,\n multiplyScalar,\n flatten,\n divideScalar,\n sqrt,\n abs,\n bignumber,\n diag,\n size,\n reshape,\n qr,\n inv,\n usolve,\n usolveAll,\n equal,\n complex,\n larger,\n smaller,\n matrixFromColumns,\n dot\n });\n\n /**\n * Compute eigenvalues and optionally eigenvectors of a square matrix.\n * The eigenvalues are sorted by their absolute value, ascending, and\n * returned as a vector in the `values` property of the returned project.\n * An eigenvalue with algebraic multiplicity k will be listed k times, so\n * that the returned `values` vector always has length equal to the size\n * of the input matrix.\n *\n * The `eigenvectors` property of the return value provides the eigenvectors.\n * It is an array of plain objects: the `value` property of each gives the\n * associated eigenvalue, and the `vector` property gives the eigenvector\n * itself. Note that the same `value` property will occur as many times in\n * the list provided by `eigenvectors` as the geometric multiplicity of\n * that value.\n *\n * If the algorithm fails to converge, it will throw an error \u2013\n * in that case, however, you may still find useful information\n * in `err.values` and `err.vectors`.\n *\n * Note that the 'precision' option does not directly specify the _accuracy_\n * of the returned eigenvalues. Rather, it determines how small an entry\n * of the iterative approximations to an upper triangular matrix must be\n * in order to be considered zero. The actual accuracy of the returned\n * eigenvalues may be greater or less than the precision, depending on the\n * conditioning of the matrix and how far apart or close the actual\n * eigenvalues are. Note that currently, relatively simple, \"traditional\"\n * methods of eigenvalue computation are being used; this is not a modern,\n * high-precision eigenvalue computation. That said, it should typically\n * produce fairly reasonable results.\n *\n * Syntax:\n *\n * math.eigs(x, [prec])\n * math.eigs(x, {options})\n *\n * Examples:\n *\n * const { eigs, multiply, column, transpose, matrixFromColumns } = math\n * const H = [[5, 2.3], [2.3, 1]]\n * const ans = eigs(H) // returns {values: [E1,E2...sorted], eigenvectors: [{value: E1, vector: v2}, {value: e, vector: v2}, ...]\n * const E = ans.values\n * const V = ans.eigenvectors\n * multiply(H, V[0].vector)) // returns multiply(E[0], V[0].vector))\n * const U = matrixFromColumns(...V.map(obj => obj.vector))\n * const UTxHxU = multiply(transpose(U), H, U) // diagonalizes H if possible\n * E[0] == UTxHxU[0][0] // returns true always\n *\n * // Compute only approximate eigenvalues:\n * const {values} = eigs(H, {eigenvectors: false, precision: 1e-6})\n *\n * See also:\n *\n * inv\n *\n * @param {Array | Matrix} x Matrix to be diagonalized\n *\n * @param {number | BigNumber | OptsObject} [opts] Object with keys `precision`, defaulting to config.relTol, and `eigenvectors`, defaulting to true and specifying whether to compute eigenvectors. If just a number, specifies precision.\n * @return {{values: Array|Matrix, eigenvectors?: Array}} Object containing an array of eigenvalues and an array of {value: number|BigNumber, vector: Array|Matrix} objects. The eigenvectors property is undefined if eigenvectors were not requested.\n *\n */\n return typed('eigs', {\n // The conversion to matrix in the first two implementations,\n // just to convert back to an array right away in\n // computeValuesAndVectors, is unfortunate, and should perhaps be\n // streamlined. It is done because the Matrix object carries some\n // type information about its entries, and so constructing the matrix\n // is a roundabout way of doing type detection.\n Array: function Array(x) {\n return doEigs(matrix(x));\n },\n 'Array, number|BigNumber': function ArrayNumberBigNumber(x, prec) {\n return doEigs(matrix(x), {\n precision: prec\n });\n },\n 'Array, Object'(x, opts) {\n return doEigs(matrix(x), opts);\n },\n Matrix: function Matrix(mat) {\n return doEigs(mat, {\n matricize: true\n });\n },\n 'Matrix, number|BigNumber': function MatrixNumberBigNumber(mat, prec) {\n return doEigs(mat, {\n precision: prec,\n matricize: true\n });\n },\n 'Matrix, Object': function MatrixObject(mat, opts) {\n var useOpts = {\n matricize: true\n };\n _extends(useOpts, opts);\n return doEigs(mat, useOpts);\n }\n });\n function doEigs(mat) {\n var _opts$precision;\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var computeVectors = 'eigenvectors' in opts ? opts.eigenvectors : true;\n var prec = (_opts$precision = opts.precision) !== null && _opts$precision !== void 0 ? _opts$precision : config.relTol;\n var result = computeValuesAndVectors(mat, prec, computeVectors);\n if (opts.matricize) {\n result.values = matrix(result.values);\n if (computeVectors) {\n result.eigenvectors = result.eigenvectors.map(_ref2 => {\n var {\n value,\n vector\n } = _ref2;\n return {\n value,\n vector: matrix(vector)\n };\n });\n }\n }\n if (computeVectors) {\n Object.defineProperty(result, 'vectors', {\n enumerable: false,\n // to make sure that the eigenvectors can still be\n // converted to string.\n get: () => {\n throw new Error('eigs(M).vectors replaced with eigs(M).eigenvectors');\n }\n });\n }\n return result;\n }\n function computeValuesAndVectors(mat, prec, computeVectors) {\n var arr = mat.toArray(); // NOTE: arr is guaranteed to be unaliased\n // and so safe to modify in place\n var asize = mat.size();\n if (asize.length !== 2 || asize[0] !== asize[1]) {\n throw new RangeError(\"Matrix must be square (size: \".concat(format(asize), \")\"));\n }\n var N = asize[0];\n if (isReal(arr, N, prec)) {\n coerceReal(arr, N); // modifies arr by side effect\n\n if (isSymmetric(arr, N, prec)) {\n var _type = coerceTypes(mat, arr, N); // modifies arr by side effect\n return doRealSymmetric(arr, N, prec, _type, computeVectors);\n }\n }\n var type = coerceTypes(mat, arr, N); // modifies arr by side effect\n return doComplexEigs(arr, N, prec, type, computeVectors);\n }\n\n /** @return {boolean} */\n function isSymmetric(arr, N, prec) {\n for (var i = 0; i < N; i++) {\n for (var j = i; j < N; j++) {\n // TODO proper comparison of bignum and frac\n if (larger(bignumber(abs(subtract(arr[i][j], arr[j][i]))), prec)) {\n return false;\n }\n }\n }\n return true;\n }\n\n /** @return {boolean} */\n function isReal(arr, N, prec) {\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n // TODO proper comparison of bignum and frac\n if (larger(bignumber(abs(im(arr[i][j]))), prec)) {\n return false;\n }\n }\n }\n return true;\n }\n function coerceReal(arr, N) {\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n arr[i][j] = re(arr[i][j]);\n }\n }\n }\n\n /** @return {'number' | 'BigNumber' | 'Complex'} */\n function coerceTypes(mat, arr, N) {\n /** @type {string} */\n var type = mat.datatype();\n if (type === 'number' || type === 'BigNumber' || type === 'Complex') {\n return type;\n }\n var hasNumber = false;\n var hasBig = false;\n var hasComplex = false;\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n var el = arr[i][j];\n if (isNumber(el) || isFraction(el)) {\n hasNumber = true;\n } else if (isBigNumber(el)) {\n hasBig = true;\n } else if (isComplex(el)) {\n hasComplex = true;\n } else {\n throw TypeError('Unsupported type in Matrix: ' + typeOf(el));\n }\n }\n }\n if (hasBig && hasComplex) {\n console.warn('Complex BigNumbers not supported, this operation will lose precission.');\n }\n if (hasComplex) {\n for (var _i = 0; _i < N; _i++) {\n for (var _j = 0; _j < N; _j++) {\n arr[_i][_j] = complex(arr[_i][_j]);\n }\n }\n return 'Complex';\n }\n if (hasBig) {\n for (var _i2 = 0; _i2 < N; _i2++) {\n for (var _j2 = 0; _j2 < N; _j2++) {\n arr[_i2][_j2] = bignumber(arr[_i2][_j2]);\n }\n }\n return 'BigNumber';\n }\n if (hasNumber) {\n for (var _i3 = 0; _i3 < N; _i3++) {\n for (var _j3 = 0; _j3 < N; _j3++) {\n arr[_i3][_j3] = number(arr[_i3][_j3]);\n }\n }\n return 'number';\n } else {\n throw TypeError('Matrix contains unsupported types only.');\n }\n }\n});", "import { clone } from '../../../utils/object.js';\nexport function createComplexEigs(_ref) {\n var {\n addScalar,\n subtract,\n flatten,\n multiply,\n multiplyScalar,\n divideScalar,\n sqrt,\n abs,\n bignumber,\n diag,\n size,\n reshape,\n inv,\n qr,\n usolve,\n usolveAll,\n equal,\n complex,\n larger,\n smaller,\n matrixFromColumns,\n dot\n } = _ref;\n /**\n * @param {number[][]} arr the matrix to find eigenvalues of\n * @param {number} N size of the matrix\n * @param {number|BigNumber} prec precision, anything lower will be considered zero\n * @param {'number'|'BigNumber'|'Complex'} type\n * @param {boolean} findVectors should we find eigenvectors?\n *\n * @returns {{ values: number[], vectors: number[][] }}\n */\n function complexEigs(arr, N, prec, type) {\n var findVectors = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n // TODO check if any row/col are zero except the diagonal\n\n // make sure corresponding rows and columns have similar magnitude\n // important because of numerical stability\n // MODIFIES arr by side effect!\n var R = balance(arr, N, prec, type, findVectors);\n\n // R is the row transformation matrix\n // arr = A' = R A R^-1, A is the original matrix\n // (if findVectors is false, R is undefined)\n // (And so to return to original matrix: A = R^-1 arr R)\n\n // TODO if magnitudes of elements vary over many orders,\n // move greatest elements to the top left corner\n\n // using similarity transformations, reduce the matrix\n // to Hessenberg form (upper triangular plus one subdiagonal row)\n // updates the transformation matrix R with new row operationsq\n // MODIFIES arr by side effect!\n reduceToHessenberg(arr, N, prec, type, findVectors, R);\n // still true that original A = R^-1 arr R)\n\n // find eigenvalues\n var {\n values,\n C\n } = iterateUntilTriangular(arr, N, prec, type, findVectors);\n\n // values is the list of eigenvalues, C is the column\n // transformation matrix that transforms arr, the hessenberg\n // matrix, to upper triangular\n // (So U = C^-1 arr C and the relationship between current arr\n // and original A is unchanged.)\n\n if (findVectors) {\n var eigenvectors = findEigenvectors(arr, N, C, R, values, prec, type);\n return {\n values,\n eigenvectors\n };\n }\n return {\n values\n };\n }\n\n /**\n * @param {number[][]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {number[][]}\n */\n function balance(arr, N, prec, type, findVectors) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var realzero = big ? bignumber(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n var realone = big ? bignumber(1) : 1;\n\n // base of the floating-point arithmetic\n var radix = big ? bignumber(10) : 2;\n var radixSq = multiplyScalar(radix, radix);\n\n // the diagonal transformation matrix R\n var Rdiag;\n if (findVectors) {\n Rdiag = Array(N).fill(one);\n }\n\n // this isn't the only time we loop thru the matrix...\n var last = false;\n while (!last) {\n // ...haha I'm joking! unless...\n last = true;\n for (var i = 0; i < N; i++) {\n // compute the taxicab norm of i-th column and row\n // TODO optimize for complex numbers\n var colNorm = realzero;\n var rowNorm = realzero;\n for (var j = 0; j < N; j++) {\n if (i === j) continue;\n colNorm = addScalar(colNorm, abs(arr[j][i]));\n rowNorm = addScalar(rowNorm, abs(arr[i][j]));\n }\n if (!equal(colNorm, 0) && !equal(rowNorm, 0)) {\n // find integer power closest to balancing the matrix\n // (we want to scale only by integer powers of radix,\n // so that we don't lose any precision due to round-off)\n\n var f = realone;\n var c = colNorm;\n var rowDivRadix = divideScalar(rowNorm, radix);\n var rowMulRadix = multiplyScalar(rowNorm, radix);\n while (smaller(c, rowDivRadix)) {\n c = multiplyScalar(c, radixSq);\n f = multiplyScalar(f, radix);\n }\n while (larger(c, rowMulRadix)) {\n c = divideScalar(c, radixSq);\n f = divideScalar(f, radix);\n }\n\n // check whether balancing is needed\n // condition = (c + rowNorm) / f < 0.95 * (colNorm + rowNorm)\n var condition = smaller(divideScalar(addScalar(c, rowNorm), f), multiplyScalar(addScalar(colNorm, rowNorm), 0.95));\n\n // apply balancing similarity transformation\n if (condition) {\n // we should loop once again to check whether\n // another rebalancing is needed\n last = false;\n var g = divideScalar(1, f);\n for (var _j = 0; _j < N; _j++) {\n if (i === _j) {\n continue;\n }\n arr[i][_j] = multiplyScalar(arr[i][_j], g);\n arr[_j][i] = multiplyScalar(arr[_j][i], f);\n }\n\n // keep track of transformations\n if (findVectors) {\n Rdiag[i] = multiplyScalar(Rdiag[i], g);\n }\n }\n }\n }\n }\n\n // return the diagonal row transformation matrix\n return findVectors ? diag(Rdiag) : null;\n }\n\n /**\n * @param {number[][]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number'|'BigNumber'|'Complex'} type\n * @param {boolean} findVectors\n * @param {number[][]} R the row transformation matrix that will be modified\n */\n function reduceToHessenberg(arr, N, prec, type, findVectors, R) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n if (big) {\n prec = bignumber(prec);\n }\n for (var i = 0; i < N - 2; i++) {\n // Find the largest subdiag element in the i-th col\n\n var maxIndex = 0;\n var max = zero;\n for (var j = i + 1; j < N; j++) {\n var el = arr[j][i];\n if (smaller(abs(max), abs(el))) {\n max = el;\n maxIndex = j;\n }\n }\n\n // This col is pivoted, no need to do anything\n if (smaller(abs(max), prec)) {\n continue;\n }\n if (maxIndex !== i + 1) {\n // Interchange maxIndex-th and (i+1)-th row\n var tmp1 = arr[maxIndex];\n arr[maxIndex] = arr[i + 1];\n arr[i + 1] = tmp1;\n\n // Interchange maxIndex-th and (i+1)-th column\n for (var _j2 = 0; _j2 < N; _j2++) {\n var tmp2 = arr[_j2][maxIndex];\n arr[_j2][maxIndex] = arr[_j2][i + 1];\n arr[_j2][i + 1] = tmp2;\n }\n\n // keep track of transformations\n if (findVectors) {\n var tmp3 = R[maxIndex];\n R[maxIndex] = R[i + 1];\n R[i + 1] = tmp3;\n }\n }\n\n // Reduce following rows and columns\n for (var _j3 = i + 2; _j3 < N; _j3++) {\n var n = divideScalar(arr[_j3][i], max);\n if (n === 0) {\n continue;\n }\n\n // from j-th row subtract n-times (i+1)th row\n for (var k = 0; k < N; k++) {\n arr[_j3][k] = subtract(arr[_j3][k], multiplyScalar(n, arr[i + 1][k]));\n }\n\n // to (i+1)th column add n-times j-th column\n for (var _k = 0; _k < N; _k++) {\n arr[_k][i + 1] = addScalar(arr[_k][i + 1], multiplyScalar(n, arr[_k][_j3]));\n }\n\n // keep track of transformations\n if (findVectors) {\n for (var _k2 = 0; _k2 < N; _k2++) {\n R[_j3][_k2] = subtract(R[_j3][_k2], multiplyScalar(n, R[i + 1][_k2]));\n }\n }\n }\n }\n return R;\n }\n\n /**\n * @returns {{values: values, C: Matrix}}\n * @see Press, Wiliams: Numerical recipes in Fortran 77\n * @see https://en.wikipedia.org/wiki/QR_algorithm\n */\n function iterateUntilTriangular(A, N, prec, type, findVectors) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n if (big) {\n prec = bignumber(prec);\n }\n\n // The Francis Algorithm\n // The core idea of this algorithm is that doing successive\n // A' = QtAQ transformations will eventually converge to block-\n // upper-triangular with diagonal blocks either 1x1 or 2x2.\n // The Q here is the one from the QR decomposition, A = QR.\n // Since the eigenvalues of a block-upper-triangular matrix are\n // the eigenvalues of its diagonal blocks and we know how to find\n // eigenvalues of a 2x2 matrix, we know the eigenvalues of A.\n\n var arr = clone(A);\n\n // the list of converged eigenvalues\n var lambdas = [];\n\n // size of arr, which will get smaller as eigenvalues converge\n var n = N;\n\n // the diagonal of the block-diagonal matrix that turns\n // converged 2x2 matrices into upper triangular matrices\n var Sdiag = [];\n\n // N\u00D7N matrix describing the overall transformation done during the QR algorithm\n var Qtotal = findVectors ? diag(Array(N).fill(one)) : undefined;\n\n // nxn matrix describing the QR transformations done since last convergence\n var Qpartial = findVectors ? diag(Array(n).fill(one)) : undefined;\n\n // last eigenvalue converged before this many steps\n var lastConvergenceBefore = 0;\n while (lastConvergenceBefore <= 100) {\n lastConvergenceBefore += 1;\n\n // TODO if the convergence is slow, do something clever\n\n // Perform the factorization\n\n var k = arr[n - 1][n - 1]; // TODO this is apparently a somewhat\n // old-fashioned choice; ideally set close to an eigenvalue, or\n // perhaps better yet switch to the implicit QR version that is sometimes\n // specifically called the \"Francis algorithm\" that is alluded to\n // in the following TODO. (Or perhaps we switch to an independently\n // optimized third-party package for the linear algebra operations...)\n\n for (var i = 0; i < n; i++) {\n arr[i][i] = subtract(arr[i][i], k);\n }\n\n // TODO do an implicit QR transformation\n var {\n Q,\n R\n } = qr(arr);\n arr = multiply(R, Q);\n for (var _i = 0; _i < n; _i++) {\n arr[_i][_i] = addScalar(arr[_i][_i], k);\n }\n\n // keep track of transformations\n if (findVectors) {\n Qpartial = multiply(Qpartial, Q);\n }\n\n // The rightmost diagonal element converged to an eigenvalue\n if (n === 1 || smaller(abs(arr[n - 1][n - 2]), prec)) {\n lastConvergenceBefore = 0;\n lambdas.push(arr[n - 1][n - 1]);\n\n // keep track of transformations\n if (findVectors) {\n Sdiag.unshift([[1]]);\n inflateMatrix(Qpartial, N);\n Qtotal = multiply(Qtotal, Qpartial);\n if (n > 1) {\n Qpartial = diag(Array(n - 1).fill(one));\n }\n }\n\n // reduce the matrix size\n n -= 1;\n arr.pop();\n for (var _i2 = 0; _i2 < n; _i2++) {\n arr[_i2].pop();\n }\n\n // The rightmost diagonal 2x2 block converged\n } else if (n === 2 || smaller(abs(arr[n - 2][n - 3]), prec)) {\n lastConvergenceBefore = 0;\n var ll = eigenvalues2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1]);\n lambdas.push(...ll);\n\n // keep track of transformations\n if (findVectors) {\n Sdiag.unshift(jordanBase2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1], ll[0], ll[1], prec, type));\n inflateMatrix(Qpartial, N);\n Qtotal = multiply(Qtotal, Qpartial);\n if (n > 2) {\n Qpartial = diag(Array(n - 2).fill(one));\n }\n }\n\n // reduce the matrix size\n n -= 2;\n arr.pop();\n arr.pop();\n for (var _i3 = 0; _i3 < n; _i3++) {\n arr[_i3].pop();\n arr[_i3].pop();\n }\n }\n if (n === 0) {\n break;\n }\n }\n\n // standard sorting\n lambdas.sort((a, b) => +subtract(abs(a), abs(b)));\n\n // the algorithm didn't converge\n if (lastConvergenceBefore > 100) {\n var err = Error('The eigenvalues failed to converge. Only found these eigenvalues: ' + lambdas.join(', '));\n err.values = lambdas;\n err.vectors = [];\n throw err;\n }\n\n // combine the overall QR transformation Qtotal with the subsequent\n // transformation S that turns the diagonal 2x2 blocks to upper triangular\n var C = findVectors ? multiply(Qtotal, blockDiag(Sdiag, N)) : undefined;\n return {\n values: lambdas,\n C\n };\n }\n\n /**\n * @param {Matrix} A hessenberg-form matrix\n * @param {number} N size of A\n * @param {Matrix} C column transformation matrix that turns A into upper triangular\n * @param {Matrix} R similarity that turns original matrix into A\n * @param {number[]} values array of eigenvalues of A\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {number[][]} eigenvalues\n */\n function findEigenvectors(A, N, C, R, values, prec, type) {\n var Cinv = inv(C);\n var U = multiply(Cinv, A, C);\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n\n // turn values into a kind of \"multiset\"\n // this way it is easier to find eigenvectors\n var uniqueValues = [];\n var multiplicities = [];\n for (var lambda of values) {\n var i = indexOf(uniqueValues, lambda, equal);\n if (i === -1) {\n uniqueValues.push(lambda);\n multiplicities.push(1);\n } else {\n multiplicities[i] += 1;\n }\n }\n\n // find eigenvectors by solving U \u2212 lambdaE = 0\n // TODO replace with an iterative eigenvector algorithm\n // (this one might fail for imprecise eigenvalues)\n\n var vectors = [];\n var len = uniqueValues.length;\n var b = Array(N).fill(zero);\n var E = diag(Array(N).fill(one));\n var _loop = function _loop() {\n var lambda = uniqueValues[_i4];\n var S = subtract(U, multiply(lambda, E)); // the characteristic matrix\n\n var solutions = usolveAll(S, b);\n solutions.shift(); // ignore the null vector\n\n // looks like we missed something, try inverse iteration\n // But if that fails, just presume that the original matrix truly\n // was defective.\n while (solutions.length < multiplicities[_i4]) {\n var approxVec = inverseIterate(S, N, solutions, prec, type);\n if (approxVec === null) {\n break;\n } // no more vectors were found\n solutions.push(approxVec);\n }\n\n // Transform back into original array coordinates\n var correction = multiply(inv(R), C);\n solutions = solutions.map(v => multiply(correction, v));\n vectors.push(...solutions.map(v => ({\n value: lambda,\n vector: flatten(v)\n })));\n };\n for (var _i4 = 0; _i4 < len; _i4++) {\n _loop();\n }\n return vectors;\n }\n\n /**\n * Compute the eigenvalues of an 2x2 matrix\n * @return {[number,number]}\n */\n function eigenvalues2x2(a, b, c, d) {\n // lambda_+- = 1/2 trA +- 1/2 sqrt( tr^2 A - 4 detA )\n var trA = addScalar(a, d);\n var detA = subtract(multiplyScalar(a, d), multiplyScalar(b, c));\n var x = multiplyScalar(trA, 0.5);\n var y = multiplyScalar(sqrt(subtract(multiplyScalar(trA, trA), multiplyScalar(4, detA))), 0.5);\n return [addScalar(x, y), subtract(x, y)];\n }\n\n /**\n * For an 2x2 matrix compute the transformation matrix S,\n * so that SAS^-1 is an upper triangular matrix\n * @return {[[number,number],[number,number]]}\n * @see https://math.berkeley.edu/~ogus/old/Math_54-05/webfoils/jordan.pdf\n * @see http://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html\n */\n function jordanBase2x2(a, b, c, d, l1, l2, prec, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n\n // matrix is already upper triangular\n // return an identity matrix\n if (smaller(abs(c), prec)) {\n return [[one, zero], [zero, one]];\n }\n\n // matrix is diagonalizable\n // return its eigenvectors as columns\n if (larger(abs(subtract(l1, l2)), prec)) {\n return [[subtract(l1, d), subtract(l2, d)], [c, c]];\n }\n\n // matrix is not diagonalizable\n // compute diagonal elements of N = A - lambdaI\n var na = subtract(a, l1);\n var nd = subtract(d, l1);\n\n // col(N,2) = 0 implies S = ( col(N,1), e_1 )\n // col(N,2) != 0 implies S = ( col(N,2), e_2 )\n\n if (smaller(abs(b), prec) && smaller(abs(nd), prec)) {\n return [[na, one], [c, zero]];\n } else {\n return [[b, zero], [nd, one]];\n }\n }\n\n /**\n * Enlarge the matrix from nxn to NxN, setting the new\n * elements to 1 on diagonal and 0 elsewhere\n */\n function inflateMatrix(arr, N) {\n // add columns\n for (var i = 0; i < arr.length; i++) {\n arr[i].push(...Array(N - arr[i].length).fill(0));\n }\n\n // add rows\n for (var _i5 = arr.length; _i5 < N; _i5++) {\n arr.push(Array(N).fill(0));\n arr[_i5][_i5] = 1;\n }\n return arr;\n }\n\n /**\n * Create a block-diagonal matrix with the given square matrices on the diagonal\n * @param {Matrix[] | number[][][]} arr array of matrices to be placed on the diagonal\n * @param {number} N the size of the resulting matrix\n */\n function blockDiag(arr, N) {\n var M = [];\n for (var i = 0; i < N; i++) {\n M[i] = Array(N).fill(0);\n }\n var I = 0;\n for (var sub of arr) {\n var n = sub.length;\n for (var _i6 = 0; _i6 < n; _i6++) {\n for (var j = 0; j < n; j++) {\n M[I + _i6][I + j] = sub[_i6][j];\n }\n }\n I += n;\n }\n return M;\n }\n\n /**\n * Finds the index of an element in an array using a custom equality function\n * @template T\n * @param {Array} arr array in which to search\n * @param {T} el the element to find\n * @param {function(T, T): boolean} fn the equality function, first argument is an element of `arr`, the second is always `el`\n * @returns {number} the index of `el`, or -1 when it's not in `arr`\n */\n function indexOf(arr, el, fn) {\n for (var i = 0; i < arr.length; i++) {\n if (fn(arr[i], el)) {\n return i;\n }\n }\n return -1;\n }\n\n /**\n * Provided a near-singular upper-triangular matrix A and a list of vectors,\n * finds an eigenvector of A with the smallest eigenvalue, which is orthogonal\n * to each vector in the list\n * @template T\n * @param {T[][]} A near-singular square matrix\n * @param {number} N dimension\n * @param {T[][]} orthog list of vectors\n * @param {number} prec epsilon\n * @param {'number'|'BigNumber'|'Complex'} type\n * @return {T[] | null} eigenvector\n *\n * @see Numerical Recipes for Fortran 77 \u2013 11.7 Eigenvalues or Eigenvectors by Inverse Iteration\n */\n function inverseIterate(A, N, orthog, prec, type) {\n var largeNum = type === 'BigNumber' ? bignumber(1000) : 1000;\n var b; // the vector\n\n // you better choose a random vector before I count to five\n var i = 0;\n for (; i < 5; ++i) {\n b = randomOrthogonalVector(N, orthog, type);\n try {\n b = usolve(A, b);\n } catch (_unused) {\n // That direction didn't work, likely because the original matrix\n // was defective. But still make the full number of tries...\n continue;\n }\n if (larger(norm(b), largeNum)) {\n break;\n }\n }\n if (i >= 5) {\n return null; // couldn't find any orthogonal vector in the image\n }\n\n // you better converge before I count to ten\n i = 0;\n while (true) {\n var c = usolve(A, b);\n if (smaller(norm(orthogonalComplement(b, [c])), prec)) {\n break;\n }\n if (++i >= 10) {\n return null;\n }\n b = normalize(c);\n }\n return b;\n }\n\n /**\n * Generates a random unit vector of dimension N, orthogonal to each vector in the list\n * @template T\n * @param {number} N dimension\n * @param {T[][]} orthog list of vectors\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {T[]} random vector\n */\n function randomOrthogonalVector(N, orthog, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n\n // generate random vector with the correct type\n var v = Array(N).fill(0).map(_ => 2 * Math.random() - 1);\n if (big) {\n v = v.map(n => bignumber(n));\n }\n if (cplx) {\n v = v.map(n => complex(n));\n }\n\n // project to orthogonal complement\n v = orthogonalComplement(v, orthog);\n\n // normalize\n return normalize(v, type);\n }\n\n /**\n * Project vector v to the orthogonal complement of an array of vectors\n */\n function orthogonalComplement(v, orthog) {\n var vectorShape = size(v);\n for (var w of orthog) {\n w = reshape(w, vectorShape); // make sure this is just a vector computation\n // v := v \u2212 (w, v)/|w|^2 w\n v = subtract(v, multiply(divideScalar(dot(w, v), dot(w, w)), w));\n }\n return v;\n }\n\n /**\n * Calculate the norm of a vector.\n * We can't use math.norm because factory can't handle circular dependency.\n * Seriously, I'm really fed up with factory.\n */\n function norm(v) {\n return abs(sqrt(dot(v, v)));\n }\n\n /**\n * Normalize a vector\n * @template T\n * @param {T[]} v\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {T[]} normalized vec\n */\n function normalize(v, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n return multiply(divideScalar(one, norm(v)), v);\n }\n return complexEigs;\n}", "import { clone } from '../../../utils/object.js';\nexport function createRealSymmetric(_ref) {\n var {\n config,\n addScalar,\n subtract,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n inv,\n bignumber,\n multiply,\n add\n } = _ref;\n /**\n * @param {number[] | BigNumber[]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number' | 'BigNumber'} type\n */\n function main(arr, N) {\n var prec = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : config.relTol;\n var type = arguments.length > 3 ? arguments[3] : undefined;\n var computeVectors = arguments.length > 4 ? arguments[4] : undefined;\n if (type === 'number') {\n return diag(arr, prec, computeVectors);\n }\n if (type === 'BigNumber') {\n return diagBig(arr, prec, computeVectors);\n }\n throw TypeError('Unsupported data type: ' + type);\n }\n\n // diagonalization implementation for number (efficient)\n function diag(x, precision, computeVectors) {\n var N = x.length;\n var e0 = Math.abs(precision / N);\n var psi;\n var Sij;\n if (computeVectors) {\n Sij = new Array(N);\n // Sij is Identity Matrix\n for (var i = 0; i < N; i++) {\n Sij[i] = Array(N).fill(0);\n Sij[i][i] = 1.0;\n }\n }\n // initial error\n var Vab = getAij(x);\n while (Math.abs(Vab[1]) >= Math.abs(e0)) {\n var _i = Vab[0][0];\n var j = Vab[0][1];\n psi = getTheta(x[_i][_i], x[j][j], x[_i][j]);\n x = x1(x, psi, _i, j);\n if (computeVectors) Sij = Sij1(Sij, psi, _i, j);\n Vab = getAij(x);\n }\n var Ei = Array(N).fill(0); // eigenvalues\n for (var _i2 = 0; _i2 < N; _i2++) {\n Ei[_i2] = x[_i2][_i2];\n }\n return sorting(clone(Ei), Sij, computeVectors);\n }\n\n // diagonalization implementation for bigNumber\n function diagBig(x, precision, computeVectors) {\n var N = x.length;\n var e0 = abs(precision / N);\n var psi;\n var Sij;\n if (computeVectors) {\n Sij = new Array(N);\n // Sij is Identity Matrix\n for (var i = 0; i < N; i++) {\n Sij[i] = Array(N).fill(0);\n Sij[i][i] = 1.0;\n }\n }\n // initial error\n var Vab = getAijBig(x);\n while (abs(Vab[1]) >= abs(e0)) {\n var _i3 = Vab[0][0];\n var j = Vab[0][1];\n psi = getThetaBig(x[_i3][_i3], x[j][j], x[_i3][j]);\n x = x1Big(x, psi, _i3, j);\n if (computeVectors) Sij = Sij1Big(Sij, psi, _i3, j);\n Vab = getAijBig(x);\n }\n var Ei = Array(N).fill(0); // eigenvalues\n for (var _i4 = 0; _i4 < N; _i4++) {\n Ei[_i4] = x[_i4][_i4];\n }\n // return [clone(Ei), clone(Sij)]\n return sorting(clone(Ei), Sij, computeVectors);\n }\n\n // get angle\n function getTheta(aii, ajj, aij) {\n var denom = ajj - aii;\n if (Math.abs(denom) <= config.relTol) {\n return Math.PI / 4.0;\n } else {\n return 0.5 * Math.atan(2.0 * aij / (ajj - aii));\n }\n }\n\n // get angle\n function getThetaBig(aii, ajj, aij) {\n var denom = subtract(ajj, aii);\n if (abs(denom) <= config.relTol) {\n return bignumber(-1).acos().div(4);\n } else {\n return multiplyScalar(0.5, atan(multiply(2.0, aij, inv(denom))));\n }\n }\n\n // update eigvec\n function Sij1(Sij, theta, i, j) {\n var N = Sij.length;\n var c = Math.cos(theta);\n var s = Math.sin(theta);\n var Ski = Array(N).fill(0);\n var Skj = Array(N).fill(0);\n for (var k = 0; k < N; k++) {\n Ski[k] = c * Sij[k][i] - s * Sij[k][j];\n Skj[k] = s * Sij[k][i] + c * Sij[k][j];\n }\n for (var _k = 0; _k < N; _k++) {\n Sij[_k][i] = Ski[_k];\n Sij[_k][j] = Skj[_k];\n }\n return Sij;\n }\n // update eigvec for overlap\n function Sij1Big(Sij, theta, i, j) {\n var N = Sij.length;\n var c = cos(theta);\n var s = sin(theta);\n var Ski = Array(N).fill(bignumber(0));\n var Skj = Array(N).fill(bignumber(0));\n for (var k = 0; k < N; k++) {\n Ski[k] = subtract(multiplyScalar(c, Sij[k][i]), multiplyScalar(s, Sij[k][j]));\n Skj[k] = addScalar(multiplyScalar(s, Sij[k][i]), multiplyScalar(c, Sij[k][j]));\n }\n for (var _k2 = 0; _k2 < N; _k2++) {\n Sij[_k2][i] = Ski[_k2];\n Sij[_k2][j] = Skj[_k2];\n }\n return Sij;\n }\n\n // update matrix\n function x1Big(Hij, theta, i, j) {\n var N = Hij.length;\n var c = bignumber(cos(theta));\n var s = bignumber(sin(theta));\n var c2 = multiplyScalar(c, c);\n var s2 = multiplyScalar(s, s);\n var Aki = Array(N).fill(bignumber(0));\n var Akj = Array(N).fill(bignumber(0));\n // 2cs Hij\n var csHij = multiply(bignumber(2), c, s, Hij[i][j]);\n // Aii\n var Aii = addScalar(subtract(multiplyScalar(c2, Hij[i][i]), csHij), multiplyScalar(s2, Hij[j][j]));\n var Ajj = add(multiplyScalar(s2, Hij[i][i]), csHij, multiplyScalar(c2, Hij[j][j]));\n // 0 to i\n for (var k = 0; k < N; k++) {\n Aki[k] = subtract(multiplyScalar(c, Hij[i][k]), multiplyScalar(s, Hij[j][k]));\n Akj[k] = addScalar(multiplyScalar(s, Hij[i][k]), multiplyScalar(c, Hij[j][k]));\n }\n // Modify Hij\n Hij[i][i] = Aii;\n Hij[j][j] = Ajj;\n Hij[i][j] = bignumber(0);\n Hij[j][i] = bignumber(0);\n // 0 to i\n for (var _k3 = 0; _k3 < N; _k3++) {\n if (_k3 !== i && _k3 !== j) {\n Hij[i][_k3] = Aki[_k3];\n Hij[_k3][i] = Aki[_k3];\n Hij[j][_k3] = Akj[_k3];\n Hij[_k3][j] = Akj[_k3];\n }\n }\n return Hij;\n }\n\n // update matrix\n function x1(Hij, theta, i, j) {\n var N = Hij.length;\n var c = Math.cos(theta);\n var s = Math.sin(theta);\n var c2 = c * c;\n var s2 = s * s;\n var Aki = Array(N).fill(0);\n var Akj = Array(N).fill(0);\n // Aii\n var Aii = c2 * Hij[i][i] - 2 * c * s * Hij[i][j] + s2 * Hij[j][j];\n var Ajj = s2 * Hij[i][i] + 2 * c * s * Hij[i][j] + c2 * Hij[j][j];\n // 0 to i\n for (var k = 0; k < N; k++) {\n Aki[k] = c * Hij[i][k] - s * Hij[j][k];\n Akj[k] = s * Hij[i][k] + c * Hij[j][k];\n }\n // Modify Hij\n Hij[i][i] = Aii;\n Hij[j][j] = Ajj;\n Hij[i][j] = 0;\n Hij[j][i] = 0;\n // 0 to i\n for (var _k4 = 0; _k4 < N; _k4++) {\n if (_k4 !== i && _k4 !== j) {\n Hij[i][_k4] = Aki[_k4];\n Hij[_k4][i] = Aki[_k4];\n Hij[j][_k4] = Akj[_k4];\n Hij[_k4][j] = Akj[_k4];\n }\n }\n return Hij;\n }\n\n // get max off-diagonal value from Upper Diagonal\n function getAij(Mij) {\n var N = Mij.length;\n var maxMij = 0;\n var maxIJ = [0, 1];\n for (var i = 0; i < N; i++) {\n for (var j = i + 1; j < N; j++) {\n if (Math.abs(maxMij) < Math.abs(Mij[i][j])) {\n maxMij = Math.abs(Mij[i][j]);\n maxIJ = [i, j];\n }\n }\n }\n return [maxIJ, maxMij];\n }\n\n // get max off-diagonal value from Upper Diagonal\n function getAijBig(Mij) {\n var N = Mij.length;\n var maxMij = 0;\n var maxIJ = [0, 1];\n for (var i = 0; i < N; i++) {\n for (var j = i + 1; j < N; j++) {\n if (abs(maxMij) < abs(Mij[i][j])) {\n maxMij = abs(Mij[i][j]);\n maxIJ = [i, j];\n }\n }\n }\n return [maxIJ, maxMij];\n }\n\n // sort results\n function sorting(E, S, computeVectors) {\n var N = E.length;\n var values = Array(N);\n var vecs;\n if (computeVectors) {\n vecs = Array(N);\n for (var k = 0; k < N; k++) {\n vecs[k] = Array(N);\n }\n }\n for (var i = 0; i < N; i++) {\n var minID = 0;\n var minE = E[0];\n for (var j = 0; j < E.length; j++) {\n if (abs(E[j]) < abs(minE)) {\n minID = j;\n minE = E[minID];\n }\n }\n values[i] = E.splice(minID, 1)[0];\n if (computeVectors) {\n for (var _k5 = 0; _k5 < N; _k5++) {\n vecs[i][_k5] = S[_k5][minID];\n S[_k5].splice(minID, 1);\n }\n }\n }\n if (!computeVectors) return {\n values\n };\n var eigenvectors = vecs.map((vector, i) => ({\n value: values[i],\n vector\n }));\n return {\n values,\n eigenvectors\n };\n }\n return main;\n}", "import { isSparseMatrix } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'expm';\nvar dependencies = ['typed', 'abs', 'add', 'identity', 'inv', 'multiply'];\nexport var createExpm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n identity,\n inv,\n multiply\n } = _ref;\n /**\n * Compute the matrix exponential, expm(A) = e^A. The matrix must be square.\n * Not to be confused with exp(a), which performs element-wise\n * exponentiation.\n *\n * The exponential is calculated using the Pad\u00E9 approximant with scaling and\n * squaring; see \"Nineteen Dubious Ways to Compute the Exponential of a\n * Matrix,\" by Moler and Van Loan.\n *\n * Syntax:\n *\n * math.expm(x)\n *\n * Examples:\n *\n * const A = [[0,2],[0,0]]\n * math.expm(A) // returns [[1,2],[0,1]]\n *\n * See also:\n *\n * exp\n *\n * @param {Matrix} x A square Matrix\n * @return {Matrix} The exponential of x\n */\n return typed(name, {\n Matrix: function Matrix(A) {\n // Check matrix size\n var size = A.size();\n if (size.length !== 2 || size[0] !== size[1]) {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n var n = size[0];\n\n // Desired accuracy of the approximant (The actual accuracy\n // will be affected by round-off error)\n var eps = 1e-15;\n\n // The Pad\u00E9 approximant is not so accurate when the values of A\n // are \"large\", so scale A by powers of two. Then compute the\n // exponential, and square the result repeatedly according to\n // the identity e^A = (e^(A/m))^m\n\n // Compute infinity-norm of A, ||A||, to see how \"big\" it is\n var infNorm = infinityNorm(A);\n\n // Find the optimal scaling factor and number of terms in the\n // Pad\u00E9 approximant to reach the desired accuracy\n var params = findParams(infNorm, eps);\n var q = params.q;\n var j = params.j;\n\n // The Pade approximation to e^A is:\n // Rqq(A) = Dqq(A) ^ -1 * Nqq(A)\n // where\n // Nqq(A) = sum(i=0, q, (2q-i)!p! / [ (2q)!i!(q-i)! ] A^i\n // Dqq(A) = sum(i=0, q, (2q-i)!q! / [ (2q)!i!(q-i)! ] (-A)^i\n\n // Scale A by 1 / 2^j\n var Apos = multiply(A, Math.pow(2, -j));\n\n // The i=0 term is just the identity matrix\n var N = identity(n);\n var D = identity(n);\n\n // Initialization (i=0)\n var factor = 1;\n\n // Initialization (i=1)\n var AposToI = Apos; // Cloning not necessary\n var alternate = -1;\n for (var i = 1; i <= q; i++) {\n if (i > 1) {\n AposToI = multiply(AposToI, Apos);\n alternate = -alternate;\n }\n factor = factor * (q - i + 1) / ((2 * q - i + 1) * i);\n N = add(N, multiply(factor, AposToI));\n D = add(D, multiply(factor * alternate, AposToI));\n }\n var R = multiply(inv(D), N);\n\n // Square j times\n for (var _i = 0; _i < j; _i++) {\n R = multiply(R, R);\n }\n return isSparseMatrix(A) ? A.createSparseMatrix(R) : R;\n }\n });\n function infinityNorm(A) {\n var n = A.size()[0];\n var infNorm = 0;\n for (var i = 0; i < n; i++) {\n var rowSum = 0;\n for (var j = 0; j < n; j++) {\n rowSum += abs(A.get([i, j]));\n }\n infNorm = Math.max(rowSum, infNorm);\n }\n return infNorm;\n }\n\n /**\n * Find the best parameters for the Pade approximant given\n * the matrix norm and desired accuracy. Returns the first acceptable\n * combination in order of increasing computational load.\n */\n function findParams(infNorm, eps) {\n var maxSearchSize = 30;\n for (var k = 0; k < maxSearchSize; k++) {\n for (var q = 0; q <= k; q++) {\n var j = k - q;\n if (errorEstimate(infNorm, q, j) < eps) {\n return {\n q,\n j\n };\n }\n }\n }\n throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)');\n }\n\n /**\n * Returns the estimated error of the Pade approximant for the given\n * parameters.\n */\n function errorEstimate(infNorm, q, j) {\n var qfac = 1;\n for (var i = 2; i <= q; i++) {\n qfac *= i;\n }\n var twoqfac = qfac;\n for (var _i2 = q + 1; _i2 <= 2 * q; _i2++) {\n twoqfac *= _i2;\n }\n var twoqp1fac = twoqfac * (2 * q + 1);\n return 8.0 * Math.pow(infNorm / Math.pow(2, j), 2 * q) * qfac * qfac / (twoqfac * twoqp1fac);\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'sqrtm';\nvar dependencies = ['typed', 'abs', 'add', 'multiply', 'map', 'sqrt', 'subtract', 'inv', 'size', 'max', 'identity'];\nexport var createSqrtm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n multiply,\n map,\n sqrt,\n subtract,\n inv,\n size,\n max,\n identity\n } = _ref;\n var _maxIterations = 1e3;\n var _tolerance = 1e-6;\n\n /**\n * Calculate the principal square root matrix using the Denman\u2013Beavers iterative method\n *\n * https://en.wikipedia.org/wiki/Square_root_of_a_matrix#By_Denman\u2013Beavers_iteration\n *\n * @param {Array | Matrix} A The square matrix `A`\n * @return {Array | Matrix} The principal square root of matrix `A`\n * @private\n */\n function _denmanBeavers(A) {\n var error;\n var iterations = 0;\n var Y = A;\n var Z = identity(size(A));\n do {\n var Yk = Y;\n Y = multiply(0.5, add(Yk, inv(Z)));\n Z = multiply(0.5, add(Z, inv(Yk)));\n error = max(abs(subtract(Y, Yk)));\n if (error > _tolerance && ++iterations > _maxIterations) {\n throw new Error('computing square root of matrix: iterative method could not converge');\n }\n } while (error > _tolerance);\n return Y;\n }\n\n /**\n * Calculate the principal square root of a square matrix.\n * The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.\n *\n * https://en.wikipedia.org/wiki/Square_root_of_a_matrix\n *\n * Syntax:\n *\n * math.sqrtm(A)\n *\n * Examples:\n *\n * math.sqrtm([[33, 24], [48, 57]]) // returns [[5, 2], [4, 7]]\n *\n * See also:\n *\n * sqrt, pow\n *\n * @param {Array | Matrix} A The square matrix `A`\n * @return {Array | Matrix} The principal square root of matrix `A`\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(A) {\n var size = isMatrix(A) ? A.size() : arraySize(A);\n switch (size.length) {\n case 1:\n // Single element Array | Matrix\n if (size[0] === 1) {\n return map(A, sqrt);\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n {\n // Two-dimensional Array | Matrix\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n return _denmanBeavers(A);\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // Multi dimensional array\n throw new RangeError('Matrix must be at most two dimensional ' + '(size: ' + format(size) + ')');\n }\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'sylvester';\nvar dependencies = ['typed', 'schur', 'matrixFromColumns', 'matrix', 'multiply', 'range', 'concat', 'transpose', 'index', 'subset', 'add', 'subtract', 'identity', 'lusolve', 'abs'];\nexport var createSylvester = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n schur,\n matrixFromColumns,\n matrix,\n multiply,\n range,\n concat,\n transpose,\n index,\n subset,\n add,\n subtract,\n identity,\n lusolve,\n abs\n } = _ref;\n /**\n *\n * Solves the real-valued Sylvester equation AX+XB=C for X, where A, B and C are\n * matrices of appropriate dimensions, being A and B squared. Notice that other\n * equivalent definitions for the Sylvester equation exist and this function\n * assumes the one presented in the original publication of the the Bartels-\n * Stewart algorithm, which is implemented by this function.\n * https://en.wikipedia.org/wiki/Sylvester_equation\n *\n * Syntax:\n *\n * math.sylvester(A, B, C)\n *\n * Examples:\n *\n * const A = [[-1, -2], [1, 1]]\n * const B = [[2, -1], [1, -2]]\n * const C = [[-3, 2], [3, 0]]\n * math.sylvester(A, B, C) // returns DenseMatrix [[-0.25, 0.25], [1.5, -1.25]]\n *\n * See also:\n *\n * schur, lyap\n *\n * @param {Matrix | Array} A Matrix A\n * @param {Matrix | Array} B Matrix B\n * @param {Matrix | Array} C Matrix C\n * @return {Matrix | Array} Matrix X, solving the Sylvester equation\n */\n return typed(name, {\n 'Matrix, Matrix, Matrix': _sylvester,\n 'Array, Matrix, Matrix': function ArrayMatrixMatrix(A, B, C) {\n return _sylvester(matrix(A), B, C);\n },\n 'Array, Array, Matrix': function ArrayArrayMatrix(A, B, C) {\n return _sylvester(matrix(A), matrix(B), C);\n },\n 'Array, Matrix, Array': function ArrayMatrixArray(A, B, C) {\n return _sylvester(matrix(A), B, matrix(C));\n },\n 'Matrix, Array, Matrix': function MatrixArrayMatrix(A, B, C) {\n return _sylvester(A, matrix(B), C);\n },\n 'Matrix, Array, Array': function MatrixArrayArray(A, B, C) {\n return _sylvester(A, matrix(B), matrix(C));\n },\n 'Matrix, Matrix, Array': function MatrixMatrixArray(A, B, C) {\n return _sylvester(A, B, matrix(C));\n },\n 'Array, Array, Array': function ArrayArrayArray(A, B, C) {\n return _sylvester(matrix(A), matrix(B), matrix(C)).toArray();\n }\n });\n function _sylvester(A, B, C) {\n var n = B.size()[0];\n var m = A.size()[0];\n var sA = schur(A);\n var F = sA.T;\n var U = sA.U;\n var sB = schur(multiply(-1, B));\n var G = sB.T;\n var V = sB.U;\n var D = multiply(multiply(transpose(U), C), V);\n var all = range(0, m);\n var y = [];\n var hc = (a, b) => concat(a, b, 1);\n var vc = (a, b) => concat(a, b, 0);\n for (var k = 0; k < n; k++) {\n if (k < n - 1 && abs(subset(G, index(k + 1, k))) > 1e-5) {\n var RHS = vc(subset(D, index(all, k)), subset(D, index(all, k + 1)));\n for (var j = 0; j < k; j++) {\n RHS = add(RHS, vc(multiply(y[j], subset(G, index(j, k))), multiply(y[j], subset(G, index(j, k + 1)))));\n }\n var gkk = multiply(identity(m), multiply(-1, subset(G, index(k, k))));\n var gmk = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k))));\n var gkm = multiply(identity(m), multiply(-1, subset(G, index(k, k + 1))));\n var gmm = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k + 1))));\n var LHS = vc(hc(add(F, gkk), gmk), hc(gkm, add(F, gmm)));\n var yAux = lusolve(LHS, RHS);\n y[k] = yAux.subset(index(range(0, m), 0));\n y[k + 1] = yAux.subset(index(range(m, 2 * m), 0));\n k++;\n } else {\n var _RHS = subset(D, index(all, k));\n for (var _j = 0; _j < k; _j++) {\n _RHS = add(_RHS, multiply(y[_j], subset(G, index(_j, k))));\n }\n var _gkk = subset(G, index(k, k));\n var _LHS = subtract(F, multiply(_gkk, identity(m)));\n y[k] = lusolve(_LHS, _RHS);\n }\n }\n var Y = matrix(matrixFromColumns(...y));\n var X = multiply(U, multiply(Y, transpose(V)));\n return X;\n }\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'schur';\nvar dependencies = ['typed', 'matrix', 'identity', 'multiply', 'qr', 'norm', 'subtract'];\nexport var createSchur = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n identity,\n multiply,\n qr,\n norm,\n subtract\n } = _ref;\n /**\n *\n * Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal\n * and T is upper quasi-triangular.\n * https://en.wikipedia.org/wiki/Schur_decomposition\n *\n * Syntax:\n *\n * math.schur(A)\n *\n * Examples:\n *\n * const A = [[1, 0], [-4, 3]]\n * math.schur(A) // returns {T: [[3, 4], [0, 1]], R: [[0, 1], [-1, 0]]}\n *\n * See also:\n *\n * sylvester, lyap, qr\n *\n * @param {Array | Matrix} A Matrix A\n * @return {{U: Array | Matrix, T: Array | Matrix}} Object containing both matrix U and T of the Schur Decomposition A=UTU'\n */\n return typed(name, {\n Array: function Array(X) {\n var r = _schur(matrix(X));\n return {\n U: r.U.valueOf(),\n T: r.T.valueOf()\n };\n },\n Matrix: function Matrix(X) {\n return _schur(X);\n }\n });\n function _schur(X) {\n var n = X.size()[0];\n var A = X;\n var U = identity(n);\n var k = 0;\n var A0;\n do {\n A0 = A;\n var QR = qr(A);\n var Q = QR.Q;\n var R = QR.R;\n A = multiply(R, Q);\n U = multiply(U, Q);\n if (k++ > 100) {\n break;\n }\n } while (norm(subtract(A, A0)) > 1e-4);\n return {\n U,\n T: A\n };\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'lyap';\nvar dependencies = ['typed', 'matrix', 'sylvester', 'multiply', 'transpose'];\nexport var createLyap = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n sylvester,\n multiply,\n transpose\n } = _ref;\n /**\n *\n * Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P, where\n * Q is an input matrix. When Q is symmetric, P is also symmetric. Notice\n * that different equivalent definitions exist for the Continuous-time\n * Lyapunov equation.\n * https://en.wikipedia.org/wiki/Lyapunov_equation\n *\n * Syntax:\n *\n * math.lyap(A, Q)\n *\n * Examples:\n *\n * const A = [[-2, 0], [1, -4]]\n * const Q = [[3, 1], [1, 3]]\n * const P = math.lyap(A, Q)\n *\n * See also:\n *\n * sylvester, schur\n *\n * @param {Matrix | Array} A Matrix A\n * @param {Matrix | Array} Q Matrix Q\n * @return {Matrix | Array} Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q\n */\n return typed(name, {\n 'Matrix, Matrix': function MatrixMatrix(A, Q) {\n return sylvester(A, transpose(A), multiply(-1, Q));\n },\n 'Array, Matrix': function ArrayMatrix(A, Q) {\n return sylvester(matrix(A), transpose(matrix(A)), multiply(-1, Q));\n },\n 'Matrix, Array': function MatrixArray(A, Q) {\n return sylvester(A, transpose(matrix(A)), matrix(multiply(-1, Q)));\n },\n 'Array, Array': function ArrayArray(A, Q) {\n return sylvester(matrix(A), transpose(matrix(A)), matrix(multiply(-1, Q))).toArray();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { extend } from '../../utils/object.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'divide';\nvar dependencies = ['typed', 'matrix', 'multiply', 'equalScalar', 'divideScalar', 'inv'];\nexport var createDivide = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n multiply,\n equalScalar,\n divideScalar,\n inv\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n\n /**\n * Divide two values, `x / y`.\n * To divide matrices, `x` is multiplied with the inverse of `y`: `x * inv(y)`.\n *\n * Syntax:\n *\n * math.divide(x, y)\n *\n * Examples:\n *\n * math.divide(2, 3) // returns number 0.6666666666666666\n *\n * const a = math.complex(5, 14)\n * const b = math.complex(4, 1)\n * math.divide(a, b) // returns Complex 2 + 3i\n *\n * const c = [[7, -6], [13, -4]]\n * const d = [[1, 2], [4, 3]]\n * math.divide(c, d) // returns Array [[-9, 4], [-11, 6]]\n *\n * const e = math.unit('18 km')\n * math.divide(e, 4.5) // returns Unit 4 km\n *\n * See also:\n *\n * multiply\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix} y Denominator\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Quotient, `x / y`\n */\n return typed('divide', extend({\n // we extend the signatures of divideScalar with signatures dealing with matrices\n\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(x, y) {\n // TODO: implement matrix right division using pseudo inverse\n // https://www.mathworks.nl/help/matlab/ref/mrdivide.html\n // https://www.gnu.org/software/octave/doc/interpreter/Arithmetic-Ops.html\n // https://stackoverflow.com/questions/12263932/how-does-gnu-octave-matrix-division-work-getting-unexpected-behaviour\n return multiply(x, inv(y));\n },\n 'DenseMatrix, any': function DenseMatrixAny(x, y) {\n return matAlgo14xDs(x, y, divideScalar, false);\n },\n 'SparseMatrix, any': function SparseMatrixAny(x, y) {\n return matAlgo11xS0s(x, y, divideScalar, false);\n },\n 'Array, any': function ArrayAny(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), y, divideScalar, false).valueOf();\n },\n 'any, Array | Matrix': function anyArrayMatrix(x, y) {\n return multiply(x, inv(y));\n }\n }, divideScalar.signatures));\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'distance';\nvar dependencies = ['typed', 'addScalar', 'subtractScalar', 'divideScalar', 'multiplyScalar', 'deepEqual', 'sqrt', 'abs'];\nexport var createDistance = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n deepEqual,\n sqrt,\n abs\n } = _ref;\n /**\n * Calculates:\n * The eucledian distance between two points in N-dimensional spaces.\n * Distance between point and a line in 2 and 3 dimensional spaces.\n * Pairwise distance between a set of 2D or 3D points\n * NOTE:\n * When substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c\n * For parametric equation of a 3D line, x0, y0, z0, a, b, c are from: (x\u2212x0, y\u2212y0, z\u2212z0) = t(a, b, c)\n *\n * Syntax:\n *\n * math.distance([x1,y1], [x2,y2])\n * math.distance({pointOneX, pointOneY}, {pointTwoX, pointTwoY})\n * math.distance([x1,y1,z1], [x2,y2,z2])\n * math.distance({pointOneX, pointOneY, pointOneZ}, {pointTwoX, pointTwoY, pointTwoZ})\n * math.distance([x1,y1,z1,a1], [x2,y2,z2,a2])\n * math.distance([[x1,y1], [x2,y2], [x3,y3]])\n * math.distance([[x1,y1,z1], [x2,y2,z2], [x3,y3,z3]])\n * math.distance([pointX,pointY], [a,b,c])\n * math.distance([pointX,pointY], [lineOnePtX,lineOnePtY], [lineTwoPtX,lineTwoPtY])\n * math.distance({pointX, pointY}, {lineOnePtX, lineOnePtY}, {lineTwoPtX, lineTwoPtY})\n * math.distance([pointX,pointY,pointZ], [x0, y0, z0, a, b, c])\n * math.distance({pointX, pointY, pointZ}, {x0, y0, z0, a, b, c})\n *\n * Examples:\n * math.distance([0,0], [4,4]) // Returns 5.656854249492381\n * math.distance(\n * {pointOneX: 0, pointOneY: 0},\n * {pointTwoX: 10, pointTwoY: 10}) // Returns 14.142135623730951\n * math.distance([1, 0, 1], [4, -2, 2]) // Returns 3.7416573867739413\n * math.distance(\n * {pointOneX: 4, pointOneY: 5, pointOneZ: 8},\n * {pointTwoX: 2, pointTwoY: 7, pointTwoZ: 9}) // Returns 3\n * math.distance([1, 0, 1, 0], [0, -1, 0, -1]) // Returns 2\n * math.distance([[1, 2], [1, 2], [1, 3]]) // Returns [0, 1, 1]\n * math.distance([[1,2,4], [1,2,6], [8,1,3]]) // Returns [2, 7.14142842854285, 7.681145747868608]\n * math.distance([10, 10], [8, 1, 3]) // Returns 11.535230316796387\n * math.distance([0, 0], [3, 0], [0, 4]) // Returns 2.4\n * math.distance(\n * {pointX: 0, pointY: 0},\n * {lineOnePtX: 3, lineOnePtY: 0},\n * {lineTwoPtX: 0, lineTwoPtY: 4}) // Returns 2.4\n * math.distance([2, 3, 1], [1, 1, 2, 5, 0, 1]) // Returns 2.3204774044612857\n * math.distance(\n * {pointX: 2, pointY: 3, pointZ: 1},\n * {x0: 1, y0: 1, z0: 2, a: 5, b: 0, c: 1}) // Returns 2.3204774044612857\n *\n * @param {Array | Matrix | Object} x Co-ordinates of first point\n * @param {Array | Matrix | Object} y Co-ordinates of second point\n * @return {Number | BigNumber} Returns the distance from two/three points\n */\n return typed(name, {\n 'Array, Array, Array': function ArrayArrayArray(x, y, z) {\n // Point to Line 2D (x=Point, y=LinePoint1, z=LinePoint2)\n if (x.length === 2 && y.length === 2 && z.length === 2) {\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_2d(y)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument');\n }\n if (!_2d(z)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument');\n }\n if (deepEqual(y, z)) {\n throw new TypeError('LinePoint1 should not be same with LinePoint2');\n }\n var xCoeff = subtractScalar(z[1], y[1]);\n var yCoeff = subtractScalar(y[0], z[0]);\n var constant = subtractScalar(multiplyScalar(z[0], y[1]), multiplyScalar(y[0], z[1]));\n return _distancePointLine2D(x[0], x[1], xCoeff, yCoeff, constant);\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Object, Object, Object': function ObjectObjectObject(x, y, z) {\n if (Object.keys(x).length === 2 && Object.keys(y).length === 2 && Object.keys(z).length === 2) {\n if (!_2d(x)) {\n throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers');\n }\n if (!_2d(y)) {\n throw new TypeError('Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers');\n }\n if (!_2d(z)) {\n throw new TypeError('Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers');\n }\n if (deepEqual(_objectToArray(y), _objectToArray(z))) {\n throw new TypeError('LinePoint1 should not be same with LinePoint2');\n }\n if ('pointX' in x && 'pointY' in x && 'lineOnePtX' in y && 'lineOnePtY' in y && 'lineTwoPtX' in z && 'lineTwoPtY' in z) {\n var xCoeff = subtractScalar(z.lineTwoPtY, y.lineOnePtY);\n var yCoeff = subtractScalar(y.lineOnePtX, z.lineTwoPtX);\n var constant = subtractScalar(multiplyScalar(z.lineTwoPtX, y.lineOnePtY), multiplyScalar(y.lineOnePtX, z.lineTwoPtY));\n return _distancePointLine2D(x.pointX, x.pointY, xCoeff, yCoeff, constant);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Array, Array': function ArrayArray(x, y) {\n // Point to Line 2D (x=[pointX, pointY], y=[x-coeff, y-coeff, const])\n if (x.length === 2 && y.length === 3) {\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n return _distancePointLine2D(x[0], x[1], y[0], y[1], y[2]);\n } else if (x.length === 3 && y.length === 6) {\n // Point to Line 3D\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_parametricLine(y)) {\n throw new TypeError('Array with 6 numbers or BigNumbers expected for second argument');\n }\n return _distancePointLine3D(x[0], x[1], x[2], y[0], y[1], y[2], y[3], y[4], y[5]);\n } else if (x.length === y.length && x.length > 0) {\n // Point to Point N-dimensions\n if (!_containsOnlyNumbers(x)) {\n throw new TypeError('All values of an array should be numbers or BigNumbers');\n }\n if (!_containsOnlyNumbers(y)) {\n throw new TypeError('All values of an array should be numbers or BigNumbers');\n }\n return _euclideanDistance(x, y);\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Object, Object': function ObjectObject(x, y) {\n if (Object.keys(x).length === 2 && Object.keys(y).length === 3) {\n if (!_2d(x)) {\n throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers');\n }\n if (!_3d(y)) {\n throw new TypeError('Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers');\n }\n if ('pointX' in x && 'pointY' in x && 'xCoeffLine' in y && 'yCoeffLine' in y && 'constant' in y) {\n return _distancePointLine2D(x.pointX, x.pointY, y.xCoeffLine, y.yCoeffLine, y.constant);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 3 && Object.keys(y).length === 6) {\n // Point to Line 3D\n if (!_3d(x)) {\n throw new TypeError('Values of pointX, pointY and pointZ should be numbers or BigNumbers');\n }\n if (!_parametricLine(y)) {\n throw new TypeError('Values of x0, y0, z0, a, b and c should be numbers or BigNumbers');\n }\n if ('pointX' in x && 'pointY' in x && 'x0' in y && 'y0' in y && 'z0' in y && 'a' in y && 'b' in y && 'c' in y) {\n return _distancePointLine3D(x.pointX, x.pointY, x.pointZ, y.x0, y.y0, y.z0, y.a, y.b, y.c);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 2 && Object.keys(y).length === 2) {\n // Point to Point 2D\n if (!_2d(x)) {\n throw new TypeError('Values of pointOneX and pointOneY should be numbers or BigNumbers');\n }\n if (!_2d(y)) {\n throw new TypeError('Values of pointTwoX and pointTwoY should be numbers or BigNumbers');\n }\n if ('pointOneX' in x && 'pointOneY' in x && 'pointTwoX' in y && 'pointTwoY' in y) {\n return _euclideanDistance([x.pointOneX, x.pointOneY], [y.pointTwoX, y.pointTwoY]);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 3 && Object.keys(y).length === 3) {\n // Point to Point 3D\n if (!_3d(x)) {\n throw new TypeError('Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers');\n }\n if (!_3d(y)) {\n throw new TypeError('Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers');\n }\n if ('pointOneX' in x && 'pointOneY' in x && 'pointOneZ' in x && 'pointTwoX' in y && 'pointTwoY' in y && 'pointTwoZ' in y) {\n return _euclideanDistance([x.pointOneX, x.pointOneY, x.pointOneZ], [y.pointTwoX, y.pointTwoY, y.pointTwoZ]);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n Array: function Array(arr) {\n if (!_pairwise(arr)) {\n throw new TypeError('Incorrect array format entered for pairwise distance calculation');\n }\n return _distancePairwise(arr);\n }\n });\n function _isNumber(a) {\n // distance supports numbers and bignumbers\n return typeof a === 'number' || isBigNumber(a);\n }\n function _2d(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]);\n }\n function _3d(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]);\n }\n function _containsOnlyNumbers(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (!Array.isArray(a)) {\n a = _objectToArray(a);\n }\n return a.every(_isNumber);\n }\n function _parametricLine(a) {\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]) && _isNumber(a[3]) && _isNumber(a[4]) && _isNumber(a[5]);\n }\n function _objectToArray(o) {\n var keys = Object.keys(o);\n var a = [];\n for (var i = 0; i < keys.length; i++) {\n a.push(o[keys[i]]);\n }\n return a;\n }\n function _pairwise(a) {\n // checks for valid arguments passed to _distancePairwise(Array)\n if (a[0].length === 2 && _isNumber(a[0][0]) && _isNumber(a[0][1])) {\n if (a.some(aI => aI.length !== 2 || !_isNumber(aI[0]) || !_isNumber(aI[1]))) {\n return false;\n }\n } else if (a[0].length === 3 && _isNumber(a[0][0]) && _isNumber(a[0][1]) && _isNumber(a[0][2])) {\n if (a.some(aI => aI.length !== 3 || !_isNumber(aI[0]) || !_isNumber(aI[1]) || !_isNumber(aI[2]))) {\n return false;\n }\n } else {\n return false;\n }\n return true;\n }\n function _distancePointLine2D(x, y, a, b, c) {\n var num = abs(addScalar(addScalar(multiplyScalar(a, x), multiplyScalar(b, y)), c));\n var den = sqrt(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)));\n return divideScalar(num, den);\n }\n function _distancePointLine3D(x, y, z, x0, y0, z0, a, b, c) {\n var num = [subtractScalar(multiplyScalar(subtractScalar(y0, y), c), multiplyScalar(subtractScalar(z0, z), b)), subtractScalar(multiplyScalar(subtractScalar(z0, z), a), multiplyScalar(subtractScalar(x0, x), c)), subtractScalar(multiplyScalar(subtractScalar(x0, x), b), multiplyScalar(subtractScalar(y0, y), a))];\n num = sqrt(addScalar(addScalar(multiplyScalar(num[0], num[0]), multiplyScalar(num[1], num[1])), multiplyScalar(num[2], num[2])));\n var den = sqrt(addScalar(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)), multiplyScalar(c, c)));\n return divideScalar(num, den);\n }\n function _euclideanDistance(x, y) {\n var vectorSize = x.length;\n var result = 0;\n var diff = 0;\n for (var i = 0; i < vectorSize; i++) {\n diff = subtractScalar(x[i], y[i]);\n result = addScalar(multiplyScalar(diff, diff), result);\n }\n return sqrt(result);\n }\n function _distancePairwise(a) {\n var result = [];\n var pointA = [];\n var pointB = [];\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = i + 1; j < a.length; j++) {\n if (a[0].length === 2) {\n pointA = [a[i][0], a[i][1]];\n pointB = [a[j][0], a[j][1]];\n } else if (a[0].length === 3) {\n pointA = [a[i][0], a[i][1], a[i][2]];\n pointB = [a[j][0], a[j][1], a[j][2]];\n }\n result.push(_euclideanDistance(pointA, pointB));\n }\n }\n return result;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'intersect';\nvar dependencies = ['typed', 'config', 'abs', 'add', 'addScalar', 'matrix', 'multiply', 'multiplyScalar', 'divideScalar', 'subtract', 'smaller', 'equalScalar', 'flatten', 'isZero', 'isNumeric'];\nexport var createIntersect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n abs,\n add,\n addScalar,\n matrix,\n multiply,\n multiplyScalar,\n divideScalar,\n subtract,\n smaller,\n equalScalar,\n flatten,\n isZero,\n isNumeric\n } = _ref;\n /**\n * Calculates the point of intersection of two lines in two or three dimensions\n * and of a line and a plane in three dimensions. The inputs are in the form of\n * arrays or 1 dimensional matrices. The line intersection functions return null\n * if the lines do not meet.\n *\n * Note: Fill the plane coefficients as `x + y + z = c` and not as `x + y + z + c = 0`.\n *\n * Syntax:\n *\n * math.intersect(endPoint1Line1, endPoint2Line1, endPoint1Line2, endPoint2Line2)\n * math.intersect(endPoint1, endPoint2, planeCoefficients)\n *\n * Examples:\n *\n * math.intersect([0, 0], [10, 10], [10, 0], [0, 10]) // Returns [5, 5]\n * math.intersect([0, 0, 0], [10, 10, 0], [10, 0, 0], [0, 10, 0]) // Returns [5, 5, 0]\n * math.intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6]) // Returns [7, -4, 3]\n *\n * @param {Array | Matrix} w Co-ordinates of first end-point of first line\n * @param {Array | Matrix} x Co-ordinates of second end-point of first line\n * @param {Array | Matrix} y Co-ordinates of first end-point of second line\n * OR Co-efficients of the plane's equation\n * @param {Array | Matrix} z Co-ordinates of second end-point of second line\n * OR undefined if the calculation is for line and plane\n * @return {Array} Returns the point of intersection of lines/lines-planes\n */\n return typed('intersect', {\n 'Array, Array, Array': _AAA,\n 'Array, Array, Array, Array': _AAAA,\n 'Matrix, Matrix, Matrix': function MatrixMatrixMatrix(x, y, plane) {\n var arr = _AAA(x.valueOf(), y.valueOf(), plane.valueOf());\n return arr === null ? null : matrix(arr);\n },\n 'Matrix, Matrix, Matrix, Matrix': function MatrixMatrixMatrixMatrix(w, x, y, z) {\n // TODO: output matrix type should match input matrix type\n var arr = _AAAA(w.valueOf(), x.valueOf(), y.valueOf(), z.valueOf());\n return arr === null ? null : matrix(arr);\n }\n });\n function _AAA(x, y, plane) {\n x = _coerceArr(x);\n y = _coerceArr(y);\n plane = _coerceArr(plane);\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n if (!_4d(plane)) {\n throw new TypeError('Array with 4 numbers expected as third argument');\n }\n return _intersectLinePlane(x[0], x[1], x[2], y[0], y[1], y[2], plane[0], plane[1], plane[2], plane[3]);\n }\n function _AAAA(w, x, y, z) {\n w = _coerceArr(w);\n x = _coerceArr(x);\n y = _coerceArr(y);\n z = _coerceArr(z);\n if (w.length === 2) {\n if (!_2d(w)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument');\n }\n if (!_2d(y)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument');\n }\n if (!_2d(z)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for fourth argument');\n }\n return _intersect2d(w, x, y, z);\n } else if (w.length === 3) {\n if (!_3d(w)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for third argument');\n }\n if (!_3d(z)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for fourth argument');\n }\n return _intersect3d(w[0], w[1], w[2], x[0], x[1], x[2], y[0], y[1], y[2], z[0], z[1], z[2]);\n } else {\n throw new TypeError('Arrays with two or thee dimensional points expected');\n }\n }\n\n /** Coerce row and column 2-dim arrays to 1-dim array */\n function _coerceArr(arr) {\n // row matrix\n if (arr.length === 1) return arr[0];\n\n // column matrix\n if (arr.length > 1 && Array.isArray(arr[0])) {\n if (arr.every(el => Array.isArray(el) && el.length === 1)) return flatten(arr);\n }\n return arr;\n }\n function _2d(x) {\n return x.length === 2 && isNumeric(x[0]) && isNumeric(x[1]);\n }\n function _3d(x) {\n return x.length === 3 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]);\n }\n function _4d(x) {\n return x.length === 4 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]) && isNumeric(x[3]);\n }\n function _intersect2d(p1a, p1b, p2a, p2b) {\n var o1 = p1a;\n var o2 = p2a;\n var d1 = subtract(o1, p1b);\n var d2 = subtract(o2, p2b);\n var det = subtract(multiplyScalar(d1[0], d2[1]), multiplyScalar(d2[0], d1[1]));\n if (isZero(det)) return null;\n if (smaller(abs(det), config.relTol)) {\n return null;\n }\n var d20o11 = multiplyScalar(d2[0], o1[1]);\n var d21o10 = multiplyScalar(d2[1], o1[0]);\n var d20o21 = multiplyScalar(d2[0], o2[1]);\n var d21o20 = multiplyScalar(d2[1], o2[0]);\n var t = divideScalar(addScalar(subtract(subtract(d20o11, d21o10), d20o21), d21o20), det);\n return add(multiply(d1, t), o1);\n }\n function _intersect3dHelper(a, b, c, d, e, f, g, h, i, j, k, l) {\n // (a - b)*(c - d) + (e - f)*(g - h) + (i - j)*(k - l)\n var add1 = multiplyScalar(subtract(a, b), subtract(c, d));\n var add2 = multiplyScalar(subtract(e, f), subtract(g, h));\n var add3 = multiplyScalar(subtract(i, j), subtract(k, l));\n return addScalar(addScalar(add1, add2), add3);\n }\n function _intersect3d(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) {\n var d1343 = _intersect3dHelper(x1, x3, x4, x3, y1, y3, y4, y3, z1, z3, z4, z3);\n var d4321 = _intersect3dHelper(x4, x3, x2, x1, y4, y3, y2, y1, z4, z3, z2, z1);\n var d1321 = _intersect3dHelper(x1, x3, x2, x1, y1, y3, y2, y1, z1, z3, z2, z1);\n var d4343 = _intersect3dHelper(x4, x3, x4, x3, y4, y3, y4, y3, z4, z3, z4, z3);\n var d2121 = _intersect3dHelper(x2, x1, x2, x1, y2, y1, y2, y1, z2, z1, z2, z1);\n var numerator = subtract(multiplyScalar(d1343, d4321), multiplyScalar(d1321, d4343));\n var denominator = subtract(multiplyScalar(d2121, d4343), multiplyScalar(d4321, d4321));\n if (isZero(denominator)) return null;\n var ta = divideScalar(numerator, denominator);\n var tb = divideScalar(addScalar(d1343, multiplyScalar(ta, d4321)), d4343);\n var pax = addScalar(x1, multiplyScalar(ta, subtract(x2, x1)));\n var pay = addScalar(y1, multiplyScalar(ta, subtract(y2, y1)));\n var paz = addScalar(z1, multiplyScalar(ta, subtract(z2, z1)));\n var pbx = addScalar(x3, multiplyScalar(tb, subtract(x4, x3)));\n var pby = addScalar(y3, multiplyScalar(tb, subtract(y4, y3)));\n var pbz = addScalar(z3, multiplyScalar(tb, subtract(z4, z3)));\n if (equalScalar(pax, pbx) && equalScalar(pay, pby) && equalScalar(paz, pbz)) {\n return [pax, pay, paz];\n } else {\n return null;\n }\n }\n function _intersectLinePlane(x1, y1, z1, x2, y2, z2, x, y, z, c) {\n var x1x = multiplyScalar(x1, x);\n var x2x = multiplyScalar(x2, x);\n var y1y = multiplyScalar(y1, y);\n var y2y = multiplyScalar(y2, y);\n var z1z = multiplyScalar(z1, z);\n var z2z = multiplyScalar(z2, z);\n var numerator = subtract(subtract(subtract(c, x1x), y1y), z1z);\n var denominator = subtract(subtract(subtract(addScalar(addScalar(x2x, y2y), z2z), x1x), y1y), z1z);\n var t = divideScalar(numerator, denominator);\n var px = addScalar(x1, multiplyScalar(t, subtract(x2, x1)));\n var py = addScalar(y1, multiplyScalar(t, subtract(y2, y1)));\n var pz = addScalar(z1, multiplyScalar(t, subtract(z2, z1)));\n return [px, py, pz];\n // TODO: Add cases when line is parallel to the plane:\n // (a) no intersection,\n // (b) line contained in plane\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'sum';\nvar dependencies = ['typed', 'config', 'add', 'numeric'];\nexport var createSum = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n add,\n numeric\n } = _ref;\n /**\n * Compute the sum of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the sum of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.sum(a, b, c, ...)\n * math.sum(A)\n * math.sum(A, dimension)\n *\n * Examples:\n *\n * math.sum(2, 1, 4, 3) // returns 10\n * math.sum([2, 1, 4, 3]) // returns 10\n * math.sum([[2, 5], [4, 3], [1, 7]]) // returns 22\n *\n * See also:\n *\n * mean, median, min, max, prod, std, variance, cumsum\n *\n * @param {... *} args A single matrix or multiple scalar values\n * @return {*} The sum of all values\n */\n return typed(name, {\n // sum([a, b, c, d, ...])\n 'Array | Matrix': _sum,\n // sum([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': _nsumDim,\n // sum(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function sum');\n }\n return _sum(args);\n }\n });\n\n /**\n * Recursively calculate the sum of an n-dimensional array\n * @param {Array | Matrix} array\n * @return {number} sum\n * @private\n */\n function _sum(array) {\n var sum;\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n } catch (err) {\n throw improveErrorMessage(err, 'sum', value);\n }\n });\n\n // make sure returning numeric value: parse a string into a numeric value\n if (sum === undefined) {\n sum = numeric(0, config.number);\n }\n if (typeof sum === 'string') {\n sum = numeric(sum, safeNumberType(sum, config));\n }\n return sum;\n }\n function _nsumDim(array, dim) {\n try {\n var sum = reduce(array, dim, add);\n return sum;\n } catch (err) {\n throw improveErrorMessage(err, 'sum');\n }\n }\n});", "import { containsCollections } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { _switch } from '../../utils/switch.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nimport { arraySize } from '../../utils/array.js';\nimport { IndexError } from '../../error/IndexError.js';\nvar name = 'cumsum';\nvar dependencies = ['typed', 'add', 'unaryPlus'];\nexport var createCumSum = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n unaryPlus\n } = _ref;\n /**\n * Compute the cumulative sum of a matrix or a list with values.\n * In case of a (multi dimensional) array or matrix, the cumulative sums\n * along a specified dimension (defaulting to the first) will be calculated.\n *\n * Syntax:\n *\n * math.cumsum(a, b, c, ...)\n * math.cumsum(A)\n *\n * Examples:\n *\n * math.cumsum(2, 1, 4, 3) // returns [2, 3, 7, 10]\n * math.cumsum([2, 1, 4, 3]) // returns [2, 3, 7, 10]\n * math.cumsum([[1, 2], [3, 4]]) // returns [[1, 2], [4, 6]]\n * math.cumsum([[1, 2], [3, 4]], 0) // returns [[1, 2], [4, 6]]\n * math.cumsum([[1, 2], [3, 4]], 1) // returns [[1, 3], [3, 7]]\n * math.cumsum([[2, 5], [4, 3], [1, 7]]) // returns [[2, 5], [6, 8], [7, 15]]\n *\n * See also:\n *\n * mean, median, min, max, prod, std, variance, sum\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The cumulative sum of all values\n */\n return typed(name, {\n // sum([a, b, c, d, ...])\n Array: _cumsum,\n Matrix: function Matrix(matrix) {\n return matrix.create(_cumsum(matrix.valueOf()));\n },\n // sum([a, b, c, d, ...], dim)\n 'Array, number | BigNumber': _ncumSumDim,\n 'Matrix, number | BigNumber': function MatrixNumberBigNumber(matrix, dim) {\n return matrix.create(_ncumSumDim(matrix.valueOf(), dim));\n },\n // cumsum(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('All values expected to be scalar in function cumsum');\n }\n return _cumsum(args);\n }\n });\n\n /**\n * Recursively calculate the cumulative sum of an n-dimensional array\n * @param {Array} array\n * @return {number} cumsum\n * @private\n */\n function _cumsum(array) {\n try {\n return _cumsummap(array);\n } catch (err) {\n throw improveErrorMessage(err, name);\n }\n }\n function _cumsummap(array) {\n if (array.length === 0) {\n return [];\n }\n var sums = [unaryPlus(array[0])]; // unaryPlus converts to number if need be\n for (var i = 1; i < array.length; ++i) {\n // Must use add below and not addScalar for the case of summing a\n // 2+-dimensional array along the 0th dimension (the row vectors,\n // or higher-d analogues, are literally added to each other).\n sums.push(add(sums[i - 1], array[i]));\n }\n return sums;\n }\n function _ncumSumDim(array, dim) {\n var size = arraySize(array);\n if (dim < 0 || dim >= size.length) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, size.length);\n }\n try {\n return _cumsumDimensional(array, dim);\n } catch (err) {\n throw improveErrorMessage(err, name);\n }\n }\n\n /* Possible TODO: Refactor _reduce in collection.js to be able to work here as well */\n function _cumsumDimensional(mat, dim) {\n var i, ret, tran;\n if (dim <= 0) {\n var initialValue = mat[0][0];\n if (!Array.isArray(initialValue)) {\n return _cumsummap(mat);\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _cumsumDimensional(tran[i], dim - 1);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _cumsumDimensional(mat[i], dim - 1);\n }\n return ret;\n }\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'mean';\nvar dependencies = ['typed', 'add', 'divide'];\nexport var createMean = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide\n } = _ref;\n /**\n * Compute the mean value of matrix or a list with values.\n * In case of a multidimensional array, the mean of the flattened array\n * will be calculated. When `dim` is provided, the maximum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.mean(a, b, c, ...)\n * math.mean(A)\n * math.mean(A, dimension)\n *\n * Examples:\n *\n * math.mean(2, 1, 4, 3) // returns 2.5\n * math.mean([1, 2.7, 3.2, 4]) // returns 2.725\n *\n * math.mean([[2, 5], [6, 3], [1, 7]], 0) // returns [3, 5]\n * math.mean([[2, 5], [6, 3], [1, 7]], 1) // returns [3.5, 4.5, 4]\n *\n * See also:\n *\n * median, min, max, sum, prod, std, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The mean of all values\n */\n return typed(name, {\n // mean([a, b, c, d, ...])\n 'Array | Matrix': _mean,\n // mean([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': _nmeanDim,\n // mean(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function mean');\n }\n return _mean(args);\n }\n });\n\n /**\n * Calculate the mean value in an n-dimensional array, returning a\n * n-1 dimensional array\n * @param {Array} array\n * @param {number} dim\n * @return {number} mean\n * @private\n */\n function _nmeanDim(array, dim) {\n try {\n var sum = reduce(array, dim, add);\n var s = Array.isArray(array) ? arraySize(array) : array.size();\n return divide(sum, s[dim]);\n } catch (err) {\n throw improveErrorMessage(err, 'mean');\n }\n }\n\n /**\n * Recursively calculate the mean value in an n-dimensional array\n * @param {Array} array\n * @return {number} mean\n * @private\n */\n function _mean(array) {\n var sum;\n var num = 0;\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n num++;\n } catch (err) {\n throw improveErrorMessage(err, 'mean', value);\n }\n });\n if (num === 0) {\n throw new Error('Cannot calculate the mean of an empty array');\n }\n return divide(sum, num);\n }\n});", "import { containsCollections } from '../../utils/collection.js';\nimport { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'median';\nvar dependencies = ['typed', 'add', 'divide', 'compare', 'partitionSelect'];\nexport var createMedian = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide,\n compare,\n partitionSelect\n } = _ref;\n /**\n * Recursively calculate the median of an n-dimensional array\n * @param {Array} array\n * @return {Number} median\n * @private\n */\n function _median(array) {\n try {\n array = flatten(array.valueOf());\n var num = array.length;\n if (num === 0) {\n throw new Error('Cannot calculate median of an empty array');\n }\n if (num % 2 === 0) {\n // even: return the average of the two middle values\n var mid = num / 2 - 1;\n var right = partitionSelect(array, mid + 1);\n\n // array now partitioned at mid + 1, take max of left part\n var left = array[mid];\n for (var i = 0; i < mid; ++i) {\n if (compare(array[i], left) > 0) {\n left = array[i];\n }\n }\n return middle2(left, right);\n } else {\n // odd: return the middle value\n var m = partitionSelect(array, (num - 1) / 2);\n return middle(m);\n }\n } catch (err) {\n throw improveErrorMessage(err, 'median');\n }\n }\n\n // helper function to type check the middle value of the array\n var middle = typed({\n 'number | BigNumber | Complex | Unit': function numberBigNumberComplexUnit(value) {\n return value;\n }\n });\n\n // helper function to type check the two middle value of the array\n var middle2 = typed({\n 'number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit': function numberBigNumberComplexUnitNumberBigNumberComplexUnit(left, right) {\n return divide(add(left, right), 2);\n }\n });\n\n /**\n * Compute the median of a matrix or a list with values. The values are\n * sorted and the middle value is returned. In case of an even number of\n * values, the average of the two middle values is returned.\n * Supported types of values are: Number, BigNumber, Unit\n *\n * In case of a (multi dimensional) array or matrix, the median of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.median(a, b, c, ...)\n * math.median(A)\n *\n * Examples:\n *\n * math.median(5, 2, 7) // returns 5\n * math.median([3, -1, 5, 7]) // returns 4\n *\n * See also:\n *\n * mean, min, max, sum, prod, std, variance, quantileSeq\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The median\n */\n return typed(name, {\n // median([a, b, c, d, ...])\n 'Array | Matrix': _median,\n // median([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function ArrayMatrixNumberBigNumber(array, dim) {\n // TODO: implement median(A, dim)\n throw new Error('median(A, dim) is not yet supported');\n // return reduce(arguments[0], arguments[1], ...)\n },\n // median(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function median');\n }\n return _median(args);\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'mad';\nvar dependencies = ['typed', 'abs', 'map', 'median', 'subtract'];\nexport var createMad = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n map,\n median,\n subtract\n } = _ref;\n /**\n * Compute the median absolute deviation of a matrix or a list with values.\n * The median absolute deviation is defined as the median of the absolute\n * deviations from the median.\n *\n * Syntax:\n *\n * math.mad(a, b, c, ...)\n * math.mad(A)\n *\n * Examples:\n *\n * math.mad(10, 20, 30) // returns 10\n * math.mad([1, 2, 3]) // returns 1\n * math.mad([[1, 2, 3], [4, 5, 6]]) // returns 1.5\n *\n * See also:\n *\n * median, mean, std, abs\n *\n * @param {Array | Matrix} array\n * A single matrix or multiple scalar values.\n * @return {*} The median absolute deviation.\n */\n return typed(name, {\n // mad([a, b, c, d, ...])\n 'Array | Matrix': _mad,\n // mad(a, b, c, d, ...)\n '...': function _(args) {\n return _mad(args);\n }\n });\n function _mad(array) {\n array = flatten(array.valueOf());\n if (array.length === 0) {\n throw new Error('Cannot calculate median absolute deviation (mad) of an empty array');\n }\n try {\n var med = median(array);\n return median(map(array, function (value) {\n return abs(subtract(value, med));\n }));\n } catch (err) {\n if (err instanceof TypeError && err.message.includes('median')) {\n throw new TypeError(err.message.replace('median', 'mad'));\n } else {\n throw improveErrorMessage(err, 'mad');\n }\n }\n }\n});", "import { deepForEach } from '../../utils/collection.js';\nimport { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar DEFAULT_NORMALIZATION = 'unbiased';\nvar name = 'variance';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN'];\nexport var createVariance = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n } = _ref;\n /**\n * Compute the variance of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the variance over all\n * elements will be calculated.\n *\n * Additionally, it is possible to compute the variance along the rows\n * or columns of a matrix by specifying the dimension as the second argument.\n *\n * Optionally, the type of normalization can be specified as the final\n * parameter. The parameter `normalization` can be one of the following values:\n *\n * - 'unbiased' (default) The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n *\n *\n * Note that older browser may not like the variable name `var`. In that\n * case, the function can be called as `math['var'](...)` instead of\n * `math.var(...)`.\n *\n * Syntax:\n *\n * math.variance(a, b, c, ...)\n * math.variance(A)\n * math.variance(A, normalization)\n * math.variance(A, dimension)\n * math.variance(A, dimension, normalization)\n *\n * Examples:\n *\n * math.variance(2, 4, 6) // returns 4\n * math.variance([2, 4, 6, 8]) // returns 6.666666666666667\n * math.variance([2, 4, 6, 8], 'uncorrected') // returns 5\n * math.variance([2, 4, 6, 8], 'biased') // returns 4\n *\n * math.variance([[1, 2, 3], [4, 5, 6]]) // returns 3.5\n * math.variance([[1, 2, 3], [4, 6, 8]], 0) // returns [4.5, 8, 12.5]\n * math.variance([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 4]\n * math.variance([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.5, 2]\n *\n * See also:\n *\n * mean, median, max, min, prod, std, sum\n *\n * @param {Array | Matrix} array\n * A single matrix or or multiple scalar values\n * @param {string} [normalization='unbiased']\n * Determines how to normalize the variance.\n * Choose 'unbiased' (default), 'uncorrected', or 'biased'.\n * @param dimension {number | BigNumber}\n * Determines the axis to compute the variance for a matrix\n * @return {*} The variance\n */\n return typed(name, {\n // variance([a, b, c, d, ...])\n 'Array | Matrix': function ArrayMatrix(array) {\n return _var(array, DEFAULT_NORMALIZATION);\n },\n // variance([a, b, c, d, ...], normalization)\n 'Array | Matrix, string': _var,\n // variance([a, b, c, c, ...], dim)\n 'Array | Matrix, number | BigNumber': function ArrayMatrixNumberBigNumber(array, dim) {\n return _varDim(array, dim, DEFAULT_NORMALIZATION);\n },\n // variance([a, b, c, c, ...], dim, normalization)\n 'Array | Matrix, number | BigNumber, string': _varDim,\n // variance(a, b, c, d, ...)\n '...': function _(args) {\n return _var(args, DEFAULT_NORMALIZATION);\n }\n });\n\n /**\n * Recursively calculate the variance of an n-dimensional array\n * @param {Array} array\n * @param {string} normalization\n * Determines how to normalize the variance:\n * - 'unbiased' The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n * @return {number | BigNumber} variance\n * @private\n */\n function _var(array, normalization) {\n var sum;\n var num = 0;\n if (array.length === 0) {\n throw new SyntaxError('Function variance requires one or more parameters (0 provided)');\n }\n\n // calculate the mean and number of elements\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n num++;\n } catch (err) {\n throw improveErrorMessage(err, 'variance', value);\n }\n });\n if (num === 0) throw new Error('Cannot calculate variance of an empty array');\n var mean = divide(sum, num);\n\n // calculate the variance\n sum = undefined;\n deepForEach(array, function (value) {\n var diff = subtract(value, mean);\n sum = sum === undefined ? multiply(diff, diff) : add(sum, multiply(diff, diff));\n });\n if (isNaN(sum)) {\n return sum;\n }\n switch (normalization) {\n case 'uncorrected':\n return divide(sum, num);\n case 'biased':\n return divide(sum, num + 1);\n case 'unbiased':\n {\n var zero = isBigNumber(sum) ? sum.mul(0) : 0;\n return num === 1 ? zero : divide(sum, num - 1);\n }\n default:\n throw new Error('Unknown normalization \"' + normalization + '\". ' + 'Choose \"unbiased\" (default), \"uncorrected\", or \"biased\".');\n }\n }\n function _varDim(array, dim, normalization) {\n try {\n if (array.length === 0) {\n throw new SyntaxError('Function variance requires one or more parameters (0 provided)');\n }\n return apply(array, dim, x => _var(x, normalization));\n } catch (err) {\n throw improveErrorMessage(err, 'variance');\n }\n }\n});", "import { isNumber } from '../../utils/is.js';\nimport { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { createApply } from '../matrix/apply.js';\nvar name = 'quantileSeq';\nvar dependencies = ['typed', '?bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger'];\nexport var createQuantileSeq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n } = _ref;\n var apply = createApply({\n typed,\n isInteger\n });\n\n /**\n * Compute the prob order quantile of a matrix or a list with values.\n * The sequence is sorted and the middle value is returned.\n * Supported types of sequence values are: Number, BigNumber, Unit\n * Supported types of probability are: Number, BigNumber\n *\n * In case of a multidimensional array or matrix, the prob order quantile\n * of all elements will be calculated.\n *\n * Syntax:\n *\n * math.quantileSeq(A, prob[, sorted])\n * math.quantileSeq(A, [prob1, prob2, ...][, sorted])\n * math.quantileSeq(A, N[, sorted])\n *\n * Examples:\n *\n * math.quantileSeq([3, -1, 5, 7], 0.5) // returns 4\n * math.quantileSeq([3, -1, 5, 7], [1/3, 2/3]) // returns [3, 5]\n * math.quantileSeq([3, -1, 5, 7], 2) // returns [3, 5]\n * math.quantileSeq([-1, 3, 5, 7], 0.5, true) // returns 4\n *\n * See also:\n *\n * median, mean, min, max, sum, prod, std, variance\n *\n * @param {Array, Matrix} data A single matrix or Array\n * @param {Number, BigNumber, Array} probOrN prob is the order of the quantile, while N is\n * the amount of evenly distributed steps of\n * probabilities; only one of these options can\n * be provided\n * @param {Boolean} sorted=false is data sorted in ascending order\n * @return {Number, BigNumber, Unit, Array} Quantile(s)\n */\n return typed(name, {\n 'Array | Matrix, number | BigNumber': (data, p) => _quantileSeqProbNumber(data, p, false),\n 'Array | Matrix, number | BigNumber, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbNumber),\n 'Array | Matrix, number | BigNumber, boolean': _quantileSeqProbNumber,\n 'Array | Matrix, number | BigNumber, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbNumber),\n 'Array | Matrix, Array | Matrix': (data, p) => _quantileSeqProbCollection(data, p, false),\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbCollection),\n 'Array | Matrix, Array | Matrix, boolean': _quantileSeqProbCollection,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbCollection)\n });\n function _quantileSeqDim(data, prob, sorted, dim, fn) {\n return apply(data, dim, x => fn(x, prob, sorted));\n }\n function _quantileSeqProbNumber(data, probOrN, sorted) {\n var probArr;\n var dataArr = data.valueOf();\n if (smaller(probOrN, 0)) {\n throw new Error('N/prob must be non-negative');\n }\n if (smallerEq(probOrN, 1)) {\n // quantileSeq([a, b, c, d, ...], prob[,sorted])\n return isNumber(probOrN) ? _quantileSeq(dataArr, probOrN, sorted) : bignumber(_quantileSeq(dataArr, probOrN, sorted));\n }\n if (larger(probOrN, 1)) {\n // quantileSeq([a, b, c, d, ...], N[,sorted])\n if (!isInteger(probOrN)) {\n throw new Error('N must be a positive integer');\n }\n\n // largest possible Array length is 2^32-1\n // 2^32 < 10^15, thus safe conversion guaranteed\n if (larger(probOrN, 4294967295)) {\n throw new Error('N must be less than or equal to 2^32-1, as that is the maximum length of an Array');\n }\n var nPlusOne = add(probOrN, 1);\n probArr = [];\n for (var i = 0; smaller(i, probOrN); i++) {\n var prob = divide(i + 1, nPlusOne);\n probArr.push(_quantileSeq(dataArr, prob, sorted));\n }\n return isNumber(probOrN) ? probArr : bignumber(probArr);\n }\n }\n\n /**\n * Calculate the prob order quantile of an n-dimensional array.\n *\n * @param {Array, Matrix} array\n * @param {Array, Matrix} prob\n * @param {Boolean} sorted\n * @return {Number, BigNumber, Unit} prob order quantile\n * @private\n */\n\n function _quantileSeqProbCollection(data, probOrN, sorted) {\n var dataArr = data.valueOf();\n // quantileSeq([a, b, c, d, ...], [prob1, prob2, ...][,sorted])\n var probOrNArr = probOrN.valueOf();\n var probArr = [];\n for (var i = 0; i < probOrNArr.length; ++i) {\n probArr.push(_quantileSeq(dataArr, probOrNArr[i], sorted));\n }\n return probArr;\n }\n\n /**\n * Calculate the prob order quantile of an n-dimensional array.\n *\n * @param {Array} array\n * @param {Number, BigNumber} prob\n * @param {Boolean} sorted\n * @return {Number, BigNumber, Unit} prob order quantile\n * @private\n */\n function _quantileSeq(array, prob, sorted) {\n var flat = flatten(array);\n var len = flat.length;\n if (len === 0) {\n throw new Error('Cannot calculate quantile of an empty sequence');\n }\n var index = isNumber(prob) ? prob * (len - 1) : prob.times(len - 1);\n var integerPart = isNumber(prob) ? Math.floor(index) : index.floor().toNumber();\n var fracPart = isNumber(prob) ? index % 1 : index.minus(integerPart);\n if (isInteger(index)) {\n return sorted ? flat[index] : partitionSelect(flat, isNumber(prob) ? index : index.valueOf());\n }\n var left;\n var right;\n if (sorted) {\n left = flat[integerPart];\n right = flat[integerPart + 1];\n } else {\n right = partitionSelect(flat, integerPart + 1);\n\n // max of partition is kth largest\n left = flat[integerPart];\n for (var i = 0; i < integerPart; ++i) {\n if (compare(flat[i], left) > 0) {\n left = flat[i];\n }\n }\n }\n // Q(prob) = (1-f)*A[floor(index)] + f*A[floor(index)+1]\n return add(multiply(left, subtract(1, fracPart)), multiply(right, fracPart));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'std';\nvar dependencies = ['typed', 'map', 'sqrt', 'variance'];\nexport var createStd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n map,\n sqrt,\n variance\n } = _ref;\n /**\n * Compute the standard deviation of a matrix or a list with values.\n * The standard deviations is defined as the square root of the variance:\n * `std(A) = sqrt(variance(A))`.\n * In case of a (multi dimensional) array or matrix, the standard deviation\n * over all elements will be calculated by default, unless an axis is specified\n * in which case the standard deviation will be computed along that axis.\n *\n * Additionally, it is possible to compute the standard deviation along the rows\n * or columns of a matrix by specifying the dimension as the second argument.\n *\n * Optionally, the type of normalization can be specified as the final\n * parameter. The parameter `normalization` can be one of the following values:\n *\n * - 'unbiased' (default) The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n *\n *\n * Syntax:\n *\n * math.std(a, b, c, ...)\n * math.std(A)\n * math.std(A, normalization)\n * math.std(A, dimension)\n * math.std(A, dimension, normalization)\n *\n * Examples:\n *\n * math.std(2, 4, 6) // returns 2\n * math.std([2, 4, 6, 8]) // returns 2.581988897471611\n * math.std([2, 4, 6, 8], 'uncorrected') // returns 2.23606797749979\n * math.std([2, 4, 6, 8], 'biased') // returns 2\n *\n * math.std([[1, 2, 3], [4, 5, 6]]) // returns 1.8708286933869707\n * math.std([[1, 2, 3], [4, 6, 8]], 0) // returns [2.1213203435596424, 2.8284271247461903, 3.5355339059327378]\n * math.std([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 2]\n * math.std([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.7071067811865476, 1.4142135623730951]\n *\n * See also:\n *\n * mean, median, max, min, prod, sum, variance\n *\n * @param {Array | Matrix} array\n * A single matrix or or multiple scalar values\n * @param {string} [normalization='unbiased']\n * Determines how to normalize the variance.\n * Choose 'unbiased' (default), 'uncorrected', or 'biased'.\n * @param dimension {number | BigNumber}\n * Determines the axis to compute the standard deviation for a matrix\n * @return {*} The standard deviation\n */\n return typed(name, {\n // std([a, b, c, d, ...])\n 'Array | Matrix': _std,\n // std([a, b, c, d, ...], normalization)\n 'Array | Matrix, string': _std,\n // std([a, b, c, c, ...], dim)\n 'Array | Matrix, number | BigNumber': _std,\n // std([a, b, c, c, ...], dim, normalization)\n 'Array | Matrix, number | BigNumber, string': _std,\n // std(a, b, c, d, ...)\n '...': function _(args) {\n return _std(args);\n }\n });\n function _std(array, normalization) {\n if (array.length === 0) {\n throw new SyntaxError('Function std requires one or more parameters (0 provided)');\n }\n try {\n var v = variance.apply(null, arguments);\n if (isCollection(v)) {\n return map(v, sqrt);\n } else {\n return sqrt(v);\n }\n } catch (err) {\n if (err instanceof TypeError && err.message.includes(' variance')) {\n throw new TypeError(err.message.replace(' variance', ' std'));\n } else {\n throw err;\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'corr';\nvar dependencies = ['typed', 'matrix', 'mean', 'sqrt', 'sum', 'add', 'subtract', 'multiply', 'pow', 'divide'];\nexport var createCorr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n sqrt,\n sum,\n add,\n subtract,\n multiply,\n pow,\n divide\n } = _ref;\n /**\n * Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.\n *\n * Syntax:\n *\n * math.corr(A, B)\n *\n * Examples:\n *\n * math.corr([1, 2, 3, 4, 5], [4, 5, 6, 7, 8]) // returns 1\n * math.corr([1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]) //returns 0.9569941688503644\n * math.corr([[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]],[[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]]) // returns [1,1]\n *\n * See also:\n *\n * median, mean, min, max, sum, prod, std, variance\n *\n * @param {Array | Matrix} A The first array or matrix to compute correlation coefficient\n * @param {Array | Matrix} B The second array or matrix to compute correlation coefficient\n * @return {*} The correlation coefficient\n */\n return typed(name, {\n 'Array, Array': function ArrayArray(A, B) {\n return _corr(A, B);\n },\n 'Matrix, Matrix': function MatrixMatrix(A, B) {\n var res = _corr(A.toArray(), B.toArray());\n return Array.isArray(res) ? matrix(res) : res;\n }\n });\n /**\n * Calculate the correlation coefficient between two arrays or matrices.\n * @param {Array | Matrix} A\n * @param {Array | Matrix} B\n * @return {*} correlation coefficient\n * @private\n */\n function _corr(A, B) {\n var correlations = [];\n if (Array.isArray(A[0]) && Array.isArray(B[0])) {\n if (A.length !== B.length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same length.');\n }\n for (var i = 0; i < A.length; i++) {\n if (A[i].length !== B[i].length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.');\n }\n correlations.push(correlation(A[i], B[i]));\n }\n return correlations;\n } else {\n if (A.length !== B.length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.');\n }\n return correlation(A, B);\n }\n }\n function correlation(A, B) {\n var n = A.length;\n var sumX = sum(A);\n var sumY = sum(B);\n var sumXY = A.reduce((acc, x, index) => add(acc, multiply(x, B[index])), 0);\n var sumXSquare = sum(A.map(x => pow(x, 2)));\n var sumYSquare = sum(B.map(y => pow(y, 2)));\n var numerator = subtract(multiply(n, sumXY), multiply(sumX, sumY));\n var denominator = sqrt(multiply(subtract(multiply(n, sumXSquare), pow(sumX, 2)), subtract(multiply(n, sumYSquare), pow(sumY, 2))));\n return divide(numerator, denominator);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { combinationsNumber } from '../../plain/number/combinations.js';\nvar name = 'combinations';\nvar dependencies = ['typed'];\nexport var createCombinations = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the number of ways of picking `k` unordered outcomes from `n`\n * possibilities.\n *\n * Combinations only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.combinations(n, k)\n *\n * Examples:\n *\n * math.combinations(7, 5) // returns 21\n *\n * See also:\n *\n * combinationsWithRep, permutations, factorial\n *\n * @param {number | BigNumber} n Total number of objects in the set\n * @param {number | BigNumber} k Number of objects in the subset\n * @return {number | BigNumber} Number of possible combinations.\n */\n return typed(name, {\n 'number, number': combinationsNumber,\n 'BigNumber, BigNumber': function BigNumberBigNumber(n, k) {\n var BigNumber = n.constructor;\n var result, i;\n var nMinusk = n.minus(k);\n var one = new BigNumber(1);\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (k.gt(n)) {\n throw new TypeError('k must be less than n in function combinations');\n }\n result = one;\n if (k.lt(nMinusk)) {\n for (i = one; i.lte(nMinusk); i = i.plus(one)) {\n result = result.times(k.plus(i)).dividedBy(i);\n }\n } else {\n for (i = one; i.lte(k); i = i.plus(one)) {\n result = result.times(nMinusk.plus(i)).dividedBy(i);\n }\n }\n return result;\n }\n\n // TODO: implement support for collection in combinations\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nvar name = 'combinationsWithRep';\nvar dependencies = ['typed'];\nexport var createCombinationsWithRep = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the number of ways of picking `k` unordered outcomes from `n`\n * possibilities, allowing individual outcomes to be repeated more than once.\n *\n * CombinationsWithRep only takes integer arguments.\n * The following condition must be enforced: k <= n + k -1.\n *\n * Syntax:\n *\n * math.combinationsWithRep(n, k)\n *\n * Examples:\n *\n * math.combinationsWithRep(7, 5) // returns 462\n *\n * See also:\n *\n * combinations, permutations, factorial\n *\n * @param {number | BigNumber} n Total number of objects in the set\n * @param {number | BigNumber} k Number of objects in the subset\n * @return {number | BigNumber} Number of possible combinations with replacement.\n */\n return typed(name, {\n 'number, number': function numberNumber(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (n < 1) {\n throw new TypeError('k must be less than or equal to n + k - 1');\n }\n if (k < n - 1) {\n var _prodrange = product(n, n + k - 1);\n return _prodrange / product(1, k);\n }\n var prodrange = product(k + 1, n + k - 1);\n return prodrange / product(1, n - 1);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(n, k) {\n var BigNumber = n.constructor;\n var result, i;\n var one = new BigNumber(1);\n var nMinusOne = n.minus(one);\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (n.lt(one)) {\n throw new TypeError('k must be less than or equal to n + k - 1 in function combinationsWithRep');\n }\n result = one;\n if (k.lt(nMinusOne)) {\n for (i = one; i.lte(nMinusOne); i = i.plus(one)) {\n result = result.times(k.plus(i)).dividedBy(i);\n }\n } else {\n for (i = one; i.lte(k); i = i.plus(one)) {\n result = result.times(nMinusOne.plus(i)).dividedBy(i);\n }\n }\n return result;\n }\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import { factory } from '../../utils/factory.js';\nimport { gammaG, gammaNumber, gammaP } from '../../plain/number/index.js';\nvar name = 'gamma';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'pow', 'BigNumber', 'Complex'];\nexport var createGamma = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n pow,\n BigNumber: _BigNumber,\n Complex\n } = _ref;\n /**\n * Compute the gamma function of a value using Lanczos approximation for\n * small values, and an extended Stirling approximation for large values.\n *\n * To avoid confusion with the matrix Gamma function, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.gamma(n)\n *\n * Examples:\n *\n * math.gamma(5) // returns 24\n * math.gamma(-0.5) // returns -3.5449077018110335\n * math.gamma(math.i) // returns -0.15494982830180973 - 0.49801566811835596i\n *\n * See also:\n *\n * combinations, factorial, permutations\n *\n * @param {number | BigNumber | Complex} n A real or complex number\n * @return {number | BigNumber | Complex} The gamma of `n`\n */\n\n function gammaComplex(n) {\n if (n.im === 0) {\n return gammaNumber(n.re);\n }\n\n // Lanczos approximation doesn't work well with real part lower than 0.5\n // So reflection formula is required\n if (n.re < 0.5) {\n // Euler's reflection formula\n // gamma(1-z) * gamma(z) = PI / sin(PI * z)\n // real part of Z should not be integer [sin(PI) == 0 -> 1/0 - undefined]\n // thanks to imperfect sin implementation sin(PI * n) != 0\n // we can safely use it anyway\n var _t = new Complex(1 - n.re, -n.im);\n var r = new Complex(Math.PI * n.re, Math.PI * n.im);\n return new Complex(Math.PI).div(r.sin()).div(gammaComplex(_t));\n }\n\n // Lanczos approximation\n // z -= 1\n n = new Complex(n.re - 1, n.im);\n\n // x = gammaPval[0]\n var x = new Complex(gammaP[0], 0);\n // for (i, gammaPval) in enumerate(gammaP):\n for (var i = 1; i < gammaP.length; ++i) {\n // x += gammaPval / (z + i)\n var gammaPval = new Complex(gammaP[i], 0);\n x = x.add(gammaPval.div(n.add(i)));\n }\n // t = z + gammaG + 0.5\n var t = new Complex(n.re + gammaG + 0.5, n.im);\n\n // y = sqrt(2 * pi) * t ** (z + 0.5) * exp(-t) * x\n var twoPiSqrt = Math.sqrt(2 * Math.PI);\n var tpow = t.pow(n.add(0.5));\n var expt = t.neg().exp();\n\n // y = [x] * [sqrt(2 * pi)] * [t ** (z + 0.5)] * [exp(-t)]\n return x.mul(twoPiSqrt).mul(tpow).mul(expt);\n }\n return typed(name, {\n number: gammaNumber,\n Complex: gammaComplex,\n BigNumber: function BigNumber(n) {\n if (n.isInteger()) {\n return n.isNegative() || n.isZero() ? new _BigNumber(Infinity) : bigFactorial(n.minus(1));\n }\n if (!n.isFinite()) {\n return new _BigNumber(n.isNegative() ? NaN : Infinity);\n }\n throw new Error('Integer BigNumber expected');\n }\n });\n\n /**\n * Calculate factorial for a BigNumber\n * @param {BigNumber} n\n * @returns {BigNumber} Returns the factorial of n\n */\n function bigFactorial(n) {\n if (n < 8) {\n return new _BigNumber([1, 1, 2, 6, 24, 120, 720, 5040][n]);\n }\n var precision = config.precision + (Math.log(n.toNumber()) | 0);\n var Big = _BigNumber.clone({\n precision\n });\n if (n % 2 === 1) {\n return n.times(bigFactorial(new _BigNumber(n - 1)));\n }\n var p = n;\n var prod = new Big(n);\n var sum = n.toNumber();\n while (p > 2) {\n p -= 2;\n sum += p;\n prod = prod.times(sum);\n }\n return new _BigNumber(prod.toPrecision(_BigNumber.precision));\n }\n});", "/* eslint-disable no-loss-of-precision */\n\n// References\n// ----------\n// [1] Hare, \"Computing the Principal Branch of log-Gamma\", Journal of Algorithms, 1997.\n// [2] https://math.stackexchange.com/questions/1338753/how-do-i-calculate-values-for-gamma-function-with-complex-arguments\n\nimport { lgammaNumber, lnSqrt2PI } from '../../plain/number/index.js';\nimport { factory } from '../../utils/factory.js';\nimport { copysign } from '../../utils/number.js';\nvar name = 'lgamma';\nvar dependencies = ['Complex', 'typed'];\nexport var createLgamma = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Complex,\n typed\n } = _ref;\n // Stirling series is non-convergent, we need to use the recurrence `lgamma(z) = lgamma(z+1) - log z` to get\n // sufficient accuracy.\n //\n // These two values are copied from Scipy implementation:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L37\n var SMALL_RE = 7;\n var SMALL_IM = 7;\n\n /**\n * The coefficients are B[2*n]/(2*n*(2*n - 1)) where B[2*n] is the (2*n)th Bernoulli number. See (1.1) in [1].\n *\n * If you cannot access the paper, can also get these values from the formula in [2].\n *\n * 1 / 12 = 0.00833333333333333333333333333333\n * 1 / 360 = 0.00277777777777777777777777777778\n * ...\n * 3617 / 133400 = 0.02955065359477124183006535947712\n */\n var coeffs = [-2.955065359477124183e-2, 6.4102564102564102564e-3, -1.9175269175269175269e-3, 8.4175084175084175084e-4, -5.952380952380952381e-4, 7.9365079365079365079e-4, -2.7777777777777777778e-3, 8.3333333333333333333e-2];\n\n /**\n * Logarithm of the gamma function for real, positive numbers and complex numbers,\n * using Lanczos approximation for numbers and Stirling series for complex numbers.\n *\n * Syntax:\n *\n * math.lgamma(n)\n *\n * Examples:\n *\n * math.lgamma(5) // returns 3.178053830347945\n * math.lgamma(0) // returns Infinity\n * math.lgamma(-0.5) // returns NaN\n * math.lgamma(math.i) // returns -0.6509231993018536 - 1.8724366472624294i\n *\n * See also:\n *\n * gamma\n *\n * @param {number | Complex} n A real or complex number\n * @return {number | Complex} The log gamma of `n`\n */\n return typed(name, {\n number: lgammaNumber,\n Complex: lgammaComplex,\n BigNumber: function BigNumber() {\n throw new Error(\"mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber\");\n }\n });\n function lgammaComplex(n) {\n var TWOPI = 6.2831853071795864769252842; // 2*pi\n var LOGPI = 1.1447298858494001741434262; // log(pi)\n\n var REFLECTION = 0.1;\n if (n.isNaN()) {\n return new Complex(NaN, NaN);\n } else if (n.im === 0) {\n return new Complex(lgammaNumber(n.re), 0);\n } else if (n.re >= SMALL_RE || Math.abs(n.im) >= SMALL_IM) {\n return lgammaStirling(n);\n } else if (n.re <= REFLECTION) {\n // Reflection formula. see Proposition 3.1 in [1]\n var tmp = copysign(TWOPI, n.im) * Math.floor(0.5 * n.re + 0.25);\n var a = n.mul(Math.PI).sin().log();\n var b = lgammaComplex(new Complex(1 - n.re, -n.im));\n return new Complex(LOGPI, tmp).sub(a).sub(b);\n } else if (n.im >= 0) {\n return lgammaRecurrence(n);\n } else {\n return lgammaRecurrence(n.conjugate()).conjugate();\n }\n }\n function lgammaStirling(z) {\n // formula ref in [2]\n // computation ref:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L101\n\n // left part\n\n // x (log(x) - 1) + 1/2 (log(2PI) - log(x))\n // => (x - 0.5) * log(x) - x + log(2PI) / 2\n var leftPart = z.sub(0.5).mul(z.log()).sub(z).add(lnSqrt2PI);\n\n // right part\n\n var rz = new Complex(1, 0).div(z);\n var rzz = rz.div(z);\n var a = coeffs[0];\n var b = coeffs[1];\n var r = 2 * rzz.re;\n var s = rzz.re * rzz.re + rzz.im * rzz.im;\n for (var i = 2; i < 8; i++) {\n var tmp = b;\n b = -s * a + coeffs[i];\n a = r * a + tmp;\n }\n var rightPart = rz.mul(rzz.mul(a).add(b));\n\n // plus left and right\n\n return leftPart.add(rightPart);\n }\n function lgammaRecurrence(z) {\n // computation ref:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L78\n\n var signflips = 0;\n var sb = 0;\n var shiftprod = z;\n z = z.add(1);\n while (z.re <= SMALL_RE) {\n shiftprod = shiftprod.mul(z);\n var nsb = shiftprod.im < 0 ? 1 : 0;\n if (nsb !== 0 && sb === 0) signflips++;\n sb = nsb;\n z = z.add(1);\n }\n return lgammaStirling(z).sub(shiftprod.log()).sub(new Complex(0, signflips * 2 * Math.PI * 1));\n }\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'factorial';\nvar dependencies = ['typed', 'gamma'];\nexport var createFactorial = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n gamma\n } = _ref;\n /**\n * Compute the factorial of a value\n *\n * Factorial only supports an integer value as argument.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.factorial(n)\n *\n * Examples:\n *\n * math.factorial(5) // returns 120\n * math.factorial(3) // returns 6\n *\n * See also:\n *\n * combinations, combinationsWithRep, gamma, permutations\n *\n * @param {number | BigNumber | Array | Matrix} n An integer number\n * @return {number | BigNumber | Array | Matrix} The factorial of `n`\n */\n return typed(name, {\n number: function number(n) {\n if (n < 0) {\n throw new Error('Value must be non-negative');\n }\n return gamma(n + 1);\n },\n BigNumber: function BigNumber(n) {\n if (n.isNegative()) {\n throw new Error('Value must be non-negative');\n }\n return gamma(n.plus(1));\n },\n 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'kldivergence';\nvar dependencies = ['typed', 'matrix', 'divide', 'sum', 'multiply', 'map', 'dotDivide', 'log', 'isNumeric'];\nexport var createKldivergence = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divide,\n sum,\n multiply,\n map,\n dotDivide,\n log,\n isNumeric\n } = _ref;\n /**\n * Calculate the Kullback-Leibler (KL) divergence between two distributions\n *\n * Syntax:\n *\n * math.kldivergence(x, y)\n *\n * Examples:\n *\n * math.kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5]) //returns 0.24376698773121153\n *\n *\n * @param {Array | Matrix} q First vector\n * @param {Array | Matrix} p Second vector\n * @return {number} Returns distance between q and p\n */\n return typed(name, {\n 'Array, Array': function ArrayArray(q, p) {\n return _kldiv(matrix(q), matrix(p));\n },\n 'Matrix, Array': function MatrixArray(q, p) {\n return _kldiv(q, matrix(p));\n },\n 'Array, Matrix': function ArrayMatrix(q, p) {\n return _kldiv(matrix(q), p);\n },\n 'Matrix, Matrix': function MatrixMatrix(q, p) {\n return _kldiv(q, p);\n }\n });\n function _kldiv(q, p) {\n var plength = p.size().length;\n var qlength = q.size().length;\n if (plength > 1) {\n throw new Error('first object must be one dimensional');\n }\n if (qlength > 1) {\n throw new Error('second object must be one dimensional');\n }\n if (plength !== qlength) {\n throw new Error('Length of two vectors must be equal');\n }\n\n // Before calculation, apply normalization\n var sumq = sum(q);\n if (sumq === 0) {\n throw new Error('Sum of elements in first object must be non zero');\n }\n var sump = sum(p);\n if (sump === 0) {\n throw new Error('Sum of elements in second object must be non zero');\n }\n var qnorm = divide(q, sum(q));\n var pnorm = divide(p, sum(p));\n var result = sum(multiply(qnorm, map(dotDivide(qnorm, pnorm), x => log(x))));\n if (isNumeric(result)) {\n return result;\n } else {\n return Number.NaN;\n }\n }\n});", "import { deepForEach } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'multinomial';\nvar dependencies = ['typed', 'add', 'divide', 'multiply', 'factorial', 'isInteger', 'isPositive'];\nexport var createMultinomial = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide,\n multiply,\n factorial,\n isInteger,\n isPositive\n } = _ref;\n /**\n * Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities.\n *\n * multinomial takes one array of integers as an argument.\n * The following condition must be enforced: every ai <= 0\n *\n * Syntax:\n *\n * math.multinomial(a) // a is an array type\n *\n * Examples:\n *\n * math.multinomial([1,2,1]) // returns 12\n *\n * See also:\n *\n * combinations, factorial\n *\n * @param {number[] | BigNumber[]} a Integer numbers of objects in the subset\n * @return {Number | BigNumber} Multinomial coefficient.\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(a) {\n var sum = 0;\n var denom = 1;\n deepForEach(a, function (ai) {\n if (!isInteger(ai) || !isPositive(ai)) {\n throw new TypeError('Positive integer value expected in function multinomial');\n }\n sum = add(sum, ai);\n denom = multiply(denom, factorial(ai));\n });\n return divide(factorial(sum), denom);\n }\n });\n});", "import { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'permutations';\nvar dependencies = ['typed', 'factorial'];\nexport var createPermutations = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n factorial\n } = _ref;\n /**\n * Compute the number of ways of obtaining an ordered subset of `k` elements\n * from a set of `n` elements.\n *\n * Permutations only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.permutations(n)\n * math.permutations(n, k)\n *\n * Examples:\n *\n * math.permutations(5) // 120\n * math.permutations(5, 3) // 60\n *\n * See also:\n *\n * combinations, combinationsWithRep, factorial\n *\n * @param {number | BigNumber} n The number of objects in total\n * @param {number | BigNumber} [k] The number of objects in the subset\n * @return {number | BigNumber} The number of permutations\n */\n return typed(name, {\n 'number | BigNumber': factorial,\n 'number, number': function numberNumber(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (k > n) {\n throw new TypeError('second argument k must be less than or equal to first argument n');\n }\n // Permute n objects, k at a time\n return product(n - k + 1, n);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(n, k) {\n var result, i;\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (k.gt(n)) {\n throw new TypeError('second argument k must be less than or equal to first argument n');\n }\n var one = n.mul(0).add(1);\n result = one;\n for (i = n.minus(k).plus(1); i.lte(n); i = i.plus(1)) {\n result = result.times(i);\n }\n return result;\n }\n\n // TODO: implement support for collection in permutations\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isMatrix, isNumber } from '../../utils/is.js';\nimport { createRng } from './util/seededRNG.js';\nvar name = 'pickRandom';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createPickRandom = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Random pick one or more values from a one dimensional array.\n * Array elements are picked using a random function with uniform or weighted distribution.\n *\n * Syntax:\n *\n * math.pickRandom(array)\n * math.pickRandom(array, number)\n * math.pickRandom(array, weights)\n * math.pickRandom(array, number, weights)\n * math.pickRandom(array, weights, number)\n * math.pickRandom(array, { weights, number, elementWise })\n *\n * Examples:\n *\n * math.pickRandom([3, 6, 12, 2]) // returns one of the values in the array\n * math.pickRandom([3, 6, 12, 2], 2) // returns an array of two of the values in the array\n * math.pickRandom([3, 6, 12, 2], { number: 2 }) // returns an array of two of the values in the array\n * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1]) // returns one of the values in the array with weighted distribution\n * math.pickRandom([3, 6, 12, 2], 2, [1, 3, 2, 1]) // returns an array of two of the values in the array with weighted distribution\n * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1], 2) // returns an array of two of the values in the array with weighted distribution\n *\n * math.pickRandom([{x: 1.0, y: 2.0}, {x: 1.1, y: 2.0}], { elementWise: false })\n * // returns one of the items in the array\n *\n * See also:\n *\n * random, randomInt\n *\n * @param {Array | Matrix} array A one dimensional array\n * @param {Int} number An int or float\n * @param {Array | Matrix} weights An array of ints or floats\n * @return {number | Array} Returns a single random value from array when number is undefined.\n * Returns an array with the configured number of elements when number is defined.\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(possibles) {\n return _pickRandom(possibles, {});\n },\n 'Array | Matrix, Object': function ArrayMatrixObject(possibles, options) {\n return _pickRandom(possibles, options);\n },\n 'Array | Matrix, number': function ArrayMatrixNumber(possibles, number) {\n return _pickRandom(possibles, {\n number\n });\n },\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(possibles, weights) {\n return _pickRandom(possibles, {\n weights\n });\n },\n 'Array | Matrix, Array | Matrix, number': function ArrayMatrixArrayMatrixNumber(possibles, weights, number) {\n return _pickRandom(possibles, {\n number,\n weights\n });\n },\n 'Array | Matrix, number, Array | Matrix': function ArrayMatrixNumberArrayMatrix(possibles, number, weights) {\n return _pickRandom(possibles, {\n number,\n weights\n });\n }\n });\n\n /**\n * @param {Array | Matrix} possibles\n * @param {{\n * number?: number,\n * weights?: Array | Matrix,\n * elementWise: boolean\n * }} options\n * @returns {number | Array}\n * @private\n */\n function _pickRandom(possibles, _ref2) {\n var {\n number,\n weights,\n elementWise = true\n } = _ref2;\n var single = typeof number === 'undefined';\n if (single) {\n number = 1;\n }\n var createMatrix = isMatrix(possibles) ? possibles.create : isMatrix(weights) ? weights.create : null;\n possibles = possibles.valueOf(); // get Array\n if (weights) {\n weights = weights.valueOf(); // get Array\n }\n if (elementWise === true) {\n possibles = flatten(possibles);\n weights = flatten(weights);\n }\n var totalWeights = 0;\n if (typeof weights !== 'undefined') {\n if (weights.length !== possibles.length) {\n throw new Error('Weights must have the same length as possibles');\n }\n for (var i = 0, len = weights.length; i < len; i++) {\n if (!isNumber(weights[i]) || weights[i] < 0) {\n throw new Error('Weights must be an array of positive numbers');\n }\n totalWeights += weights[i];\n }\n }\n var length = possibles.length;\n var result = [];\n var pick;\n while (result.length < number) {\n if (typeof weights === 'undefined') {\n pick = possibles[Math.floor(rng() * length)];\n } else {\n var randKey = rng() * totalWeights;\n for (var _i = 0, _len = possibles.length; _i < _len; _i++) {\n randKey -= weights[_i];\n if (randKey < 0) {\n pick = possibles[_i];\n break;\n }\n }\n }\n result.push(pick);\n }\n return single ? result[0] : createMatrix ? createMatrix(result) : result;\n }\n});", "import seedrandom from 'seedrandom';\nvar singletonRandom = /* #__PURE__ */seedrandom(Date.now());\nexport function createRng(randomSeed) {\n var random;\n\n // create a new random generator with given seed\n function setSeed(seed) {\n random = seed === null ? singletonRandom : seedrandom(String(seed));\n }\n\n // initialize a seeded pseudo random number generator with config's random seed\n setSeed(randomSeed);\n\n // wrapper function so the rng can be updated via generator\n function rng() {\n return random();\n }\n return rng;\n}", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { createRng } from './util/seededRNG.js';\nimport { randomMatrix } from './util/randomMatrix.js';\nvar name = 'random';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createRandom = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Return a random number larger or equal to `min` and smaller than `max`\n * using a uniform distribution.\n *\n * Syntax:\n *\n * math.random() // generate a random number between 0 and 1\n * math.random(max) // generate a random number between 0 and max\n * math.random(min, max) // generate a random number between min and max\n * math.random(size) // generate a matrix with random numbers between 0 and 1\n * math.random(size, max) // generate a matrix with random numbers between 0 and max\n * math.random(size, min, max) // generate a matrix with random numbers between min and max\n *\n * Examples:\n *\n * math.random() // returns a random number between 0 and 1\n * math.random(100) // returns a random number between 0 and 100\n * math.random(30, 40) // returns a random number between 30 and 40\n * math.random([2, 3]) // returns a 2x3 matrix with random numbers between 0 and 1\n *\n * See also:\n *\n * randomInt, pickRandom\n *\n * @param {Array | Matrix} [size] If provided, an array or matrix with given\n * size and filled with random values is returned\n * @param {number} [min] Minimum boundary for the random value, included\n * @param {number} [max] Maximum boundary for the random value, excluded\n * @return {number | Array | Matrix} A random number\n */\n return typed(name, {\n '': () => _random(0, 1),\n number: max => _random(0, max),\n 'number, number': (min, max) => _random(min, max),\n 'Array | Matrix': size => _randomMatrix(size, 0, 1),\n 'Array | Matrix, number': (size, max) => _randomMatrix(size, 0, max),\n 'Array | Matrix, number, number': (size, min, max) => _randomMatrix(size, min, max)\n });\n function _randomMatrix(size, min, max) {\n var res = randomMatrix(size.valueOf(), () => _random(min, max));\n return isMatrix(size) ? size.create(res) : res;\n }\n function _random(min, max) {\n return min + rng() * (max - min);\n }\n});\n\n// number only implementation of random, no matrix support\n// TODO: there is quite some duplicate code in both createRandom and createRandomNumber, can we improve that?\nexport var createRandomNumber = /* #__PURE__ */factory(name, ['typed', 'config', '?on'], _ref2 => {\n var {\n typed,\n config,\n on,\n matrix\n } = _ref2;\n // seeded pseudo random number generator1\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n return typed(name, {\n '': () => _random(0, 1),\n number: max => _random(0, max),\n 'number, number': (min, max) => _random(min, max)\n });\n function _random(min, max) {\n return min + rng() * (max - min);\n }\n});", "/**\n * This is a util function for generating a random matrix recursively.\n * @param {number[]} size\n * @param {function} random\n * @returns {Array}\n */\nexport function randomMatrix(size, random) {\n var data = [];\n size = size.slice(0);\n if (size.length > 1) {\n for (var i = 0, length = size.shift(); i < length; i++) {\n data.push(randomMatrix(size, random));\n }\n } else {\n for (var _i = 0, _length = size.shift(); _i < _length; _i++) {\n data.push(random());\n }\n }\n return data;\n}", "import { factory } from '../../utils/factory.js';\nimport { randomMatrix } from './util/randomMatrix.js';\nimport { createRng } from './util/seededRNG.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'randomInt';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createRandomInt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Return a random integer number larger or equal to `min` and smaller than `max`\n * using a uniform distribution.\n *\n * Syntax:\n *\n * math.randomInt() // generate a random integer between 0 and 1\n * math.randomInt(max) // generate a random integer between 0 and max\n * math.randomInt(min, max) // generate a random integer between min and max\n * math.randomInt(size) // generate a matrix with random integer between 0 and 1\n * math.randomInt(size, max) // generate a matrix with random integer between 0 and max\n * math.randomInt(size, min, max) // generate a matrix with random integer between min and max\n *\n * Examples:\n *\n * math.randomInt(100) // returns a random integer between 0 and 100\n * math.randomInt(30, 40) // returns a random integer between 30 and 40\n * math.randomInt([2, 3]) // returns a 2x3 matrix with random integers between 0 and 1\n *\n * See also:\n *\n * random, pickRandom\n *\n * @param {Array | Matrix} [size] If provided, an array or matrix with given\n * size and filled with random values is returned\n * @param {number} [min] Minimum boundary for the random value, included\n * @param {number} [max] Maximum boundary for the random value, excluded\n * @return {number | Array | Matrix} A random integer value\n */\n return typed(name, {\n '': () => _randomInt(0, 1),\n number: max => _randomInt(0, max),\n 'number, number': (min, max) => _randomInt(min, max),\n 'Array | Matrix': size => _randomIntMatrix(size, 0, 1),\n 'Array | Matrix, number': (size, max) => _randomIntMatrix(size, 0, max),\n 'Array | Matrix, number, number': (size, min, max) => _randomIntMatrix(size, min, max)\n });\n function _randomIntMatrix(size, min, max) {\n var res = randomMatrix(size.valueOf(), () => _randomInt(min, max));\n return isMatrix(size) ? size.create(res) : res;\n }\n function _randomInt(min, max) {\n return Math.floor(min + rng() * (max - min));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'stirlingS2';\nvar dependencies = ['typed', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'factorial', 'combinations', 'isNegative', 'isInteger', 'number', '?bignumber', 'larger'];\nexport var createStirlingS2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n pow,\n factorial,\n combinations,\n isNegative,\n isInteger,\n number,\n bignumber,\n larger\n } = _ref;\n var smallCache = [];\n var bigCache = [];\n /**\n * The Stirling numbers of the second kind, counts the number of ways to partition\n * a set of n labelled objects into k nonempty unlabelled subsets.\n * stirlingS2 only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * If n = k or k = 1 <= n, then s(n,k) = 1\n * If k = 0 < n, then s(n,k) = 0\n *\n * Note that if either n or k is supplied as a BigNumber, the result will be\n * as well.\n *\n * Syntax:\n *\n * math.stirlingS2(n, k)\n *\n * Examples:\n *\n * math.stirlingS2(5, 3) //returns 25\n *\n * See also:\n *\n * bellNumbers\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @param {Number | BigNumber} k Number of objects in the subset\n * @return {Number | BigNumber} S(n,k)\n */\n return typed(name, {\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(n, k) {\n if (!isInteger(n) || isNegative(n) || !isInteger(k) || isNegative(k)) {\n throw new TypeError('Non-negative integer value expected in function stirlingS2');\n } else if (larger(k, n)) {\n throw new TypeError('k must be less than or equal to n in function stirlingS2');\n }\n var big = !(isNumber(n) && isNumber(k));\n var cache = big ? bigCache : smallCache;\n var make = big ? bignumber : number;\n var nn = number(n);\n var nk = number(k);\n /* See if we already have the value: */\n if (cache[nn] && cache[nn].length > nk) {\n return cache[nn][nk];\n }\n /* Fill the cache */\n for (var m = 0; m <= nn; ++m) {\n if (!cache[m]) {\n cache[m] = [m === 0 ? make(1) : make(0)];\n }\n if (m === 0) continue;\n var row = cache[m];\n var prev = cache[m - 1];\n for (var i = row.length; i <= m && i <= nk; ++i) {\n if (i === m) {\n row[i] = 1;\n } else {\n row[i] = addScalar(multiplyScalar(make(i), prev[i]), prev[i - 1]);\n }\n }\n }\n return cache[nn][nk];\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'bellNumbers';\nvar dependencies = ['typed', 'addScalar', 'isNegative', 'isInteger', 'stirlingS2'];\nexport var createBellNumbers = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n isNegative,\n isInteger,\n stirlingS2\n } = _ref;\n /**\n * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S.\n * bellNumbers only takes integer arguments.\n * The following condition must be enforced: n >= 0\n *\n * Syntax:\n *\n * math.bellNumbers(n)\n *\n * Examples:\n *\n * math.bellNumbers(3) // returns 5\n * math.bellNumbers(8) // returns 4140\n *\n * See also:\n *\n * stirlingS2\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @return {Number | BigNumber} B(n)\n */\n return typed(name, {\n 'number | BigNumber': function numberBigNumber(n) {\n if (!isInteger(n) || isNegative(n)) {\n throw new TypeError('Non-negative integer value expected in function bellNumbers');\n }\n\n // Sum (k=0, n) S(n,k).\n var result = 0;\n for (var i = 0; i <= n; i++) {\n result = addScalar(result, stirlingS2(n, i));\n }\n return result;\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'catalan';\nvar dependencies = ['typed', 'addScalar', 'divideScalar', 'multiplyScalar', 'combinations', 'isNegative', 'isInteger'];\nexport var createCatalan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n divideScalar,\n multiplyScalar,\n combinations,\n isNegative,\n isInteger\n } = _ref;\n /**\n * The Catalan Numbers enumerate combinatorial structures of many different types.\n * catalan only takes integer arguments.\n * The following condition must be enforced: n >= 0\n *\n * Syntax:\n *\n * math.catalan(n)\n *\n * Examples:\n *\n * math.catalan(3) // returns 5\n * math.catalan(8) // returns 1430\n *\n * See also:\n *\n * bellNumbers\n *\n * @param {Number | BigNumber} n nth Catalan number\n * @return {Number | BigNumber} Cn(n)\n */\n return typed(name, {\n 'number | BigNumber': function numberBigNumber(n) {\n if (!isInteger(n) || isNegative(n)) {\n throw new TypeError('Non-negative integer value expected in function catalan');\n }\n return divideScalar(combinations(multiplyScalar(n, 2), n), addScalar(n, 1));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'composition';\nvar dependencies = ['typed', 'addScalar', 'combinations', 'isNegative', 'isPositive', 'isInteger', 'larger'];\nexport var createComposition = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n combinations,\n isPositive,\n isNegative,\n isInteger,\n larger\n } = _ref;\n /**\n * The composition counts of n into k parts.\n *\n * composition only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.composition(n, k)\n *\n * Examples:\n *\n * math.composition(5, 3) // returns 6\n *\n * See also:\n *\n * combinations\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @param {Number | BigNumber} k Number of objects in the subset\n * @return {Number | BigNumber} Returns the composition counts of n into k parts.\n */\n return typed(name, {\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(n, k) {\n if (!isInteger(n) || !isPositive(n) || !isInteger(k) || !isPositive(k)) {\n throw new TypeError('Positive integer value expected in function composition');\n } else if (larger(k, n)) {\n throw new TypeError('k must be less than or equal to n in function composition');\n }\n return combinations(addScalar(n, -1), addScalar(k, -1));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'leafCount';\nvar dependencies = ['parse', 'typed'];\nexport var createLeafCount = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n typed\n } = _ref;\n // This does the real work, but we don't have to recurse through\n // a typed call if we separate it out\n function countLeaves(node) {\n var count = 0;\n node.forEach(n => {\n count += countLeaves(n);\n });\n return count || 1;\n }\n\n /**\n * Gives the number of \"leaf nodes\" in the parse tree of the given expression\n * A leaf node is one that has no subexpressions, essentially either a\n * symbol or a constant. Note that `5!` has just one leaf, the '5'; the\n * unary factorial operator does not add a leaf. On the other hand,\n * function symbols do add leaves, so `sin(x)/cos(x)` has four leaves.\n *\n * The `simplify()` function should generally not increase the `leafCount()`\n * of an expression, although currently there is no guarantee that it never\n * does so. In many cases, `simplify()` reduces the leaf count.\n *\n * Syntax:\n *\n * math.leafCount(expr)\n *\n * Examples:\n *\n * math.leafCount('x') // 1\n * math.leafCount(math.parse('a*d-b*c')) // 4\n * math.leafCount('[a,b;c,d][0,1]') // 6\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to count the leaves of\n *\n * @return {number} The number of leaves of `expr`\n *\n */\n return typed(name, {\n Node: function Node(expr) {\n return countLeaves(expr);\n }\n });\n});", "import { isParenthesisNode } from '../../utils/is.js';\nimport { isConstantNode, isVariableNode, isNumericNode, isConstantExpression } from './simplify/wildcards.js';\nimport { factory } from '../../utils/factory.js';\nimport { createUtil } from './simplify/util.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { createEmptyMap, createMap } from '../../utils/map.js';\nvar name = 'simplify';\nvar dependencies = ['config', 'typed', 'parse', 'add', 'subtract', 'multiply', 'divide', 'pow', 'isZero', 'equal', 'resolve', 'simplifyConstant', 'simplifyCore', '?fraction', '?bignumber', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createSimplify = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n parse,\n add,\n subtract,\n multiply,\n divide,\n pow,\n isZero,\n equal,\n resolve,\n simplifyConstant,\n simplifyCore,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n var {\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n unflattenr,\n unflattenl,\n createMakeNodeFunction,\n defaultContext,\n realContext,\n positiveContext\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * Simplify an expression tree.\n *\n * A list of rules are applied to an expression, repeating over the list until\n * no further changes are made.\n * It's possible to pass a custom set of rules to the function as second\n * argument. A rule can be specified as an object, string, or function:\n *\n * const rules = [\n * { l: 'n1*n3 + n2*n3', r: '(n1+n2)*n3' },\n * 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n * function (node) {\n * // ... return a new node or return the node unchanged\n * return node\n * }\n * ]\n *\n * String and object rules consist of a left and right pattern. The left is\n * used to match against the expression and the right determines what matches\n * are replaced with. The main difference between a pattern and a normal\n * expression is that variables starting with the following characters are\n * interpreted as wildcards:\n *\n * - 'n' - Matches any node [Node]\n * - 'c' - Matches a constant literal (5 or 3.2) [ConstantNode]\n * - 'cl' - Matches a constant literal; same as c [ConstantNode]\n * - 'cd' - Matches a decimal literal (5 or -3.2) [ConstantNode or unaryMinus wrapping a ConstantNode]\n * - 'ce' - Matches a constant expression (-5 or \u221A3) [Expressions consisting of only ConstantNodes, functions, and operators]\n * - 'v' - Matches a variable; anything not matched by c (-5 or x) [Node that is not a ConstantNode]\n * - 'vl' - Matches a variable literal (x or y) [SymbolNode]\n * - 'vd' - Matches a non-decimal expression; anything not matched by cd (x or \u221A3) [Node that is not a ConstantNode or unaryMinus that is wrapping a ConstantNode]\n * - 've' - Matches a variable expression; anything not matched by ce (x or 2x) [Expressions that contain a SymbolNode or other non-constant term]\n *\n * The default list of rules is exposed on the function as `simplify.rules`\n * and can be used as a basis to built a set of custom rules. Note that since\n * the `simplifyCore` function is in the default list of rules, by default\n * simplify will convert any function calls in the expression that have\n * operator equivalents to their operator forms.\n *\n * To specify a rule as a string, separate the left and right pattern by '->'\n * When specifying a rule as an object, the following keys are meaningful:\n * - l - the left pattern\n * - r - the right pattern\n * - s - in lieu of l and r, the string form that is broken at -> to give them\n * - repeat - whether to repeat this rule until the expression stabilizes\n * - assuming - gives a context object, as in the 'context' option to\n * simplify. Every property in the context object must match the current\n * context in order, or else the rule will not be applied.\n * - imposeContext - gives a context object, as in the 'context' option to\n * simplify. Any settings specified will override the incoming context\n * for all matches of this rule.\n *\n * For more details on the theory, see:\n *\n * - [Strategies for simplifying math expressions (Stackoverflow)](https://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions)\n * - [Symbolic computation - Simplification (Wikipedia)](https://en.wikipedia.org/wiki/Symbolic_computation#Simplification)\n *\n * An optional `options` argument can be passed as last argument of `simplify`.\n * Currently available options (defaults in parentheses):\n * - `consoleDebug` (false): whether to write the expression being simplified\n * and any changes to it, along with the rule responsible, to console\n * - `context` (simplify.defaultContext): an object giving properties of\n * each operator, which determine what simplifications are allowed. The\n * currently meaningful properties are commutative, associative,\n * total (whether the operation is defined for all arguments), and\n * trivial (whether the operation applied to a single argument leaves\n * that argument unchanged). The default context is very permissive and\n * allows almost all simplifications. Only properties differing from\n * the default need to be specified; the default context is used as a\n * fallback. Additional contexts `simplify.realContext` and\n * `simplify.positiveContext` are supplied to cause simplify to perform\n * just simplifications guaranteed to preserve all values of the expression\n * assuming all variables and subexpressions are real numbers or\n * positive real numbers, respectively. (Note that these are in some cases\n * more restrictive than the default context; for example, the default\n * context will allow `x/x` to simplify to 1, whereas\n * `simplify.realContext` will not, as `0/0` is not equal to 1.)\n * - `exactFractions` (true): whether to try to convert all constants to\n * exact rational numbers.\n * - `fractionsLimit` (10000): when `exactFractions` is true, constants will\n * be expressed as fractions only when both numerator and denominator\n * are smaller than `fractionsLimit`.\n *\n * Syntax:\n *\n * math.simplify(expr)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules, scope)\n * math.simplify(expr, rules, scope, options)\n * math.simplify(expr, scope)\n * math.simplify(expr, scope, options)\n *\n * Examples:\n *\n * math.simplify('2 * 1 * x ^ (2 - 1)') // Node \"2 * x\"\n * math.simplify('2 * 3 * x', {x: 4}) // Node \"24\"\n * const f = math.parse('2 * 1 * x ^ (2 - 1)')\n * math.simplify(f) // Node \"2 * x\"\n * math.simplify('0.4 * x', {}, {exactFractions: true}) // Node \"x * 2 / 5\"\n * math.simplify('0.4 * x', {}, {exactFractions: false}) // Node \"0.4 * x\"\n *\n * See also:\n *\n * simplifyCore, derivative, evaluate, parse, rationalize, resolve\n *\n * @param {Node | string} expr\n * The expression to be simplified\n * @param {SimplifyRule[]} [rules]\n * Optional list with custom rules\n * @param {Object} [scope] Optional scope with variables\n * @param {SimplifyOptions} [options] Optional configuration settings\n * @return {Node} Returns the simplified form of `expr`\n */\n typed.addConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n var simplify = typed('simplify', {\n Node: _simplify,\n 'Node, Map': (expr, scope) => _simplify(expr, false, scope),\n 'Node, Map, Object': (expr, scope, options) => _simplify(expr, false, scope, options),\n 'Node, Array': _simplify,\n 'Node, Array, Map': _simplify,\n 'Node, Array, Map, Object': _simplify\n });\n typed.removeConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n simplify.defaultContext = defaultContext;\n simplify.realContext = realContext;\n simplify.positiveContext = positiveContext;\n function removeParens(node) {\n return node.transform(function (node, path, parent) {\n return isParenthesisNode(node) ? removeParens(node.content) : node;\n });\n }\n\n // All constants that are allowed in rules\n var SUPPORTED_CONSTANTS = {\n true: true,\n false: true,\n e: true,\n i: true,\n Infinity: true,\n LN2: true,\n LN10: true,\n LOG2E: true,\n LOG10E: true,\n NaN: true,\n phi: true,\n pi: true,\n SQRT1_2: true,\n SQRT2: true,\n tau: true\n // null: false,\n // undefined: false,\n // version: false,\n };\n\n // Array of strings, used to build the ruleSet.\n // Each l (left side) and r (right side) are parsed by\n // the expression parser into a node tree.\n // Left hand sides are matched to subtrees within the\n // expression to be parsed and replaced with the right\n // hand side.\n // TODO: Add support for constraints on constants (either in the form of a '=' expression or a callback [callback allows things like comparing symbols alphabetically])\n // To evaluate lhs constants for rhs constants, use: { l: 'c1+c2', r: 'c3', evaluate: 'c3 = c1 + c2' }. Multiple assignments are separated by ';' in block format.\n // It is possible to get into an infinite loop with conflicting rules\n simplify.rules = [simplifyCore,\n // { l: 'n+0', r: 'n' }, // simplifyCore\n // { l: 'n^0', r: '1' }, // simplifyCore\n // { l: '0*n', r: '0' }, // simplifyCore\n // { l: 'n/n', r: '1'}, // simplifyCore\n // { l: 'n^1', r: 'n' }, // simplifyCore\n // { l: '+n1', r:'n1' }, // simplifyCore\n // { l: 'n--n1', r:'n+n1' }, // simplifyCore\n {\n l: 'log(e)',\n r: '1'\n },\n // temporary rules\n // Note initially we tend constants to the right because like-term\n // collection prefers the left, and we would rather collect nonconstants\n {\n s: 'n-n1 -> n+-n1',\n // temporarily replace 'subtract' so we can further flatten the 'add' operator\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n-n -> 0',\n // partial alternative when we can't always subtract\n assuming: {\n subtract: {\n total: false\n }\n }\n }, {\n s: '-(cl*v) -> v * (-cl)',\n // make non-constant terms positive\n assuming: {\n multiply: {\n commutative: true\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(cl*v) -> (-cl) * v',\n // non-commutative version, part 1\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(v*cl) -> v * (-cl)',\n // non-commutative version, part 2\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n l: '-(n1/n2)',\n r: '-n1/n2'\n }, {\n l: '-v',\n r: 'v * (-1)'\n },\n // finish making non-constant terms positive\n {\n l: '(n1 + n2)*(-1)',\n r: 'n1*(-1) + n2*(-1)',\n repeat: true\n },\n // expand negations to achieve as much sign cancellation as possible\n {\n l: 'n/n1^n2',\n r: 'n*n1^-n2'\n },\n // temporarily replace 'divide' so we can further flatten the 'multiply' operator\n {\n l: 'n/n1',\n r: 'n*n1^-1'\n }, {\n s: '(n1*n2)^n3 -> n1^n3 * n2^n3',\n assuming: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: '(n1*n2)^(-1) -> n2^(-1) * n1^(-1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n },\n // expand nested exponentiation\n {\n s: '(n ^ n1) ^ n2 -> n ^ (n1 * n2)',\n assuming: {\n divide: {\n total: true\n }\n } // 1/(1/n) = n needs 1/n to exist\n },\n // collect like factors; into a sum, only do this for nonconstants\n {\n l: ' vd * ( vd * n1 + n2)',\n r: 'vd^2 * n1 + vd * n2'\n }, {\n s: ' vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2',\n assuming: {\n divide: {\n total: true\n }\n } // v*1/v = v^(1+-1) needs 1/v\n }, {\n s: 'vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n s: 'vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n l: 'n*n',\n r: 'n^2'\n }, {\n s: 'n * n^n1 -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n }\n } // n*1/n = n^(-1+1) needs 1/n\n }, {\n s: 'n^n1 * n^n2 -> n^(n1+n2)',\n assuming: {\n divide: {\n total: true\n }\n } // ditto for n^2*1/n^2\n },\n // Unfortunately, to deal with more complicated cancellations, it\n // becomes necessary to simplify constants twice per pass. It's not\n // terribly expensive compared to matching rules, so this should not\n // pose a performance problem.\n simplifyConstant,\n // First: before collecting like terms\n\n // collect like terms\n {\n s: 'n+n -> 2*n',\n assuming: {\n add: {\n total: true\n }\n } // 2 = 1 + 1 needs to exist\n }, {\n l: 'n+-n',\n r: '0'\n }, {\n l: 'vd*n + vd',\n r: 'vd*(n+1)'\n },\n // NOTE: leftmost position is special:\n {\n l: 'n3*n1 + n3*n2',\n r: 'n3*(n1+n2)'\n },\n // All sub-monomials tried there.\n {\n l: 'n3^(-n4)*n1 + n3 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+1) *n2)'\n }, {\n l: 'n3^(-n4)*n1 + n3^n5 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+n5)*n2)'\n },\n // noncommutative additional cases (term collection & factoring)\n {\n s: 'n*vd + vd -> (n+1)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'vd + n*vd -> (1+n)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n^n1 * n -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n l: 'n*cd + cd',\n r: '(n+1)*cd'\n }, {\n s: 'cd*n + cd -> cd*(n+1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'cd + cd*n -> cd*(1+n)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, simplifyConstant,\n // Second: before returning expressions to \"standard form\"\n\n // make factors positive (and undo 'make non-constant terms positive')\n {\n s: '(-n)*n1 -> -(n*n1)',\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n1*(-n) -> -(n1*n)',\n // in case * non-commutative\n assuming: {\n subtract: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n },\n // final ordering of constants\n {\n s: 'ce+ve -> ve+ce',\n assuming: {\n add: {\n commutative: true\n }\n },\n imposeContext: {\n add: {\n commutative: false\n }\n }\n }, {\n s: 'vd*cd -> cd*vd',\n assuming: {\n multiply: {\n commutative: true\n }\n },\n imposeContext: {\n multiply: {\n commutative: false\n }\n }\n },\n // undo temporary rules\n // { l: '(-1) * n', r: '-n' }, // #811 added test which proved this is redundant\n {\n l: 'n+-n1',\n r: 'n-n1'\n },\n // undo replace 'subtract'\n {\n l: 'n+-(n1)',\n r: 'n-(n1)'\n }, {\n s: 'n*(n1^-1) -> n/n1',\n // undo replace 'divide'; for * commutative\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n*n1^-n2 -> n/n1^n2',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n^-1 -> 1/n',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n l: 'n^1',\n r: 'n'\n },\n // can be produced by power cancellation\n {\n s: 'n*(n1/n2) -> (n*n1)/n2',\n // '*' before '/'\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n s: 'n-(n1+n2) -> n-n1-n2',\n // '-' before '+'\n assuming: {\n addition: {\n associative: true,\n commutative: true\n }\n }\n },\n // { l: '(n1/n2)/n3', r: 'n1/(n2*n3)' },\n // { l: '(n*n1)/(n*n2)', r: 'n1/n2' },\n\n // simplifyConstant can leave an extra factor of 1, which can always\n // be eliminated, since the identity always commutes\n {\n l: '1*n',\n r: 'n',\n imposeContext: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: 'n1/(n2/n3) -> (n1*n3)/n2',\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n l: 'n1/(-n2)',\n r: '-n1/n2'\n }];\n\n /**\n * Takes any rule object as allowed by the specification in simplify\n * and puts it in a standard form used by applyRule\n */\n function _canonicalizeRule(ruleObject, context) {\n var newRule = {};\n if (ruleObject.s) {\n var lr = ruleObject.s.split('->');\n if (lr.length === 2) {\n newRule.l = lr[0];\n newRule.r = lr[1];\n } else {\n throw SyntaxError('Could not parse rule: ' + ruleObject.s);\n }\n } else {\n newRule.l = ruleObject.l;\n newRule.r = ruleObject.r;\n }\n newRule.l = removeParens(parse(newRule.l));\n newRule.r = removeParens(parse(newRule.r));\n for (var prop of ['imposeContext', 'repeat', 'assuming']) {\n if (prop in ruleObject) {\n newRule[prop] = ruleObject[prop];\n }\n }\n if (ruleObject.evaluate) {\n newRule.evaluate = parse(ruleObject.evaluate);\n }\n if (isAssociative(newRule.l, context)) {\n var nonCommutative = !isCommutative(newRule.l, context);\n var leftExpandsym;\n // Gen. the LHS placeholder used in this NC-context specific expansion rules\n if (nonCommutative) leftExpandsym = _getExpandPlaceholderSymbol();\n var makeNode = createMakeNodeFunction(newRule.l);\n var expandsym = _getExpandPlaceholderSymbol();\n newRule.expanded = {};\n newRule.expanded.l = makeNode([newRule.l, expandsym]);\n // Push the expandsym into the deepest possible branch.\n // This helps to match the newRule against nodes returned from getSplits() later on.\n flatten(newRule.expanded.l, context);\n unflattenr(newRule.expanded.l, context);\n newRule.expanded.r = makeNode([newRule.r, expandsym]);\n\n // In and for a non-commutative context, attempting with yet additional expansion rules makes\n // way for more matches cases of multi-arg expressions; such that associative rules (such as\n // 'n*n -> n^2') can be applied to exprs. such as 'a * b * b' and 'a * b * b * a'.\n if (nonCommutative) {\n // 'Non-commutative' 1: LHS (placeholder) only\n newRule.expandedNC1 = {};\n newRule.expandedNC1.l = makeNode([leftExpandsym, newRule.l]);\n newRule.expandedNC1.r = makeNode([leftExpandsym, newRule.r]);\n // 'Non-commutative' 2: farmost LHS and RHS placeholders\n newRule.expandedNC2 = {};\n newRule.expandedNC2.l = makeNode([leftExpandsym, newRule.expanded.l]);\n newRule.expandedNC2.r = makeNode([leftExpandsym, newRule.expanded.r]);\n }\n }\n return newRule;\n }\n\n /**\n * Parse the string array of rules into nodes\n *\n * Example syntax for rules:\n *\n * Position constants to the left in a product:\n * { l: 'n1 * c1', r: 'c1 * n1' }\n * n1 is any Node, and c1 is a ConstantNode.\n *\n * Apply difference of squares formula:\n * { l: '(n1 - n2) * (n1 + n2)', r: 'n1^2 - n2^2' }\n * n1, n2 mean any Node.\n *\n * Short hand notation:\n * 'n1 * c1 -> c1 * n1'\n */\n function _buildRules(rules, context) {\n // Array of rules to be used to simplify expressions\n var ruleSet = [];\n for (var i = 0; i < rules.length; i++) {\n var rule = rules[i];\n var newRule = void 0;\n var ruleType = typeof rule;\n switch (ruleType) {\n case 'string':\n rule = {\n s: rule\n };\n /* falls through */\n case 'object':\n newRule = _canonicalizeRule(rule, context);\n break;\n case 'function':\n newRule = rule;\n break;\n default:\n throw TypeError('Unsupported type of rule: ' + ruleType);\n }\n // console.log('Adding rule: ' + rules[i])\n // console.log(newRule)\n ruleSet.push(newRule);\n }\n return ruleSet;\n }\n var _lastsym = 0;\n function _getExpandPlaceholderSymbol() {\n return new SymbolNode('_p' + _lastsym++);\n }\n function _simplify(expr, rules) {\n var scope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createEmptyMap();\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var debug = options.consoleDebug;\n rules = _buildRules(rules || simplify.rules, options.context);\n var res = resolve(expr, scope);\n res = removeParens(res);\n var visited = {};\n var str = res.toString({\n parenthesis: 'all'\n });\n while (!visited[str]) {\n visited[str] = true;\n _lastsym = 0; // counter for placeholder symbols\n var laststr = str;\n if (debug) console.log('Working on: ', str);\n for (var i = 0; i < rules.length; i++) {\n var rulestr = '';\n if (typeof rules[i] === 'function') {\n res = rules[i](res, options);\n if (debug) rulestr = rules[i].name;\n } else {\n flatten(res, options.context);\n res = applyRule(res, rules[i], options.context);\n if (debug) {\n rulestr = \"\".concat(rules[i].l.toString(), \" -> \").concat(rules[i].r.toString());\n }\n }\n if (debug) {\n var newstr = res.toString({\n parenthesis: 'all'\n });\n if (newstr !== laststr) {\n console.log('Applying', rulestr, 'produced', newstr);\n laststr = newstr;\n }\n }\n /* Use left-heavy binary tree internally,\n * since custom rule functions may expect it\n */\n unflattenl(res, options.context);\n }\n str = res.toString({\n parenthesis: 'all'\n });\n }\n return res;\n }\n function mapRule(nodes, rule, context) {\n var resNodes = nodes;\n if (nodes) {\n for (var i = 0; i < nodes.length; ++i) {\n var newNode = applyRule(nodes[i], rule, context);\n if (newNode !== nodes[i]) {\n if (resNodes === nodes) {\n resNodes = nodes.slice();\n }\n resNodes[i] = newNode;\n }\n }\n }\n return resNodes;\n }\n\n /**\n * Returns a simplfied form of node, or the original node if no simplification was possible.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object | Function} rule\n * @param {Object} context -- information about assumed properties of operators\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The simplified form of `expr`, or the original node if no simplification was possible.\n */\n function applyRule(node, rule, context) {\n // console.log('Entering applyRule(\"', rule.l.toString({parenthesis:'all'}), '->', rule.r.toString({parenthesis:'all'}), '\",', node.toString({parenthesis:'all'}),')')\n\n // check that the assumptions for this rule are satisfied by the current\n // context:\n if (rule.assuming) {\n for (var symbol in rule.assuming) {\n for (var property in rule.assuming[symbol]) {\n if (hasProperty(symbol, property, context) !== rule.assuming[symbol][property]) {\n return node;\n }\n }\n }\n }\n var mergedContext = mergeContext(rule.imposeContext, context);\n\n // Do not clone node unless we find a match\n var res = node;\n\n // First replace our child nodes with their simplified versions\n // If a child could not be simplified, applying the rule to it\n // will have no effect since the node is returned unchanged\n if (res instanceof OperatorNode || res instanceof FunctionNode) {\n var newArgs = mapRule(res.args, rule, context);\n if (newArgs !== res.args) {\n res = res.clone();\n res.args = newArgs;\n }\n } else if (res instanceof ParenthesisNode) {\n if (res.content) {\n var newContent = applyRule(res.content, rule, context);\n if (newContent !== res.content) {\n res = new ParenthesisNode(newContent);\n }\n }\n } else if (res instanceof ArrayNode) {\n var newItems = mapRule(res.items, rule, context);\n if (newItems !== res.items) {\n res = new ArrayNode(newItems);\n }\n } else if (res instanceof AccessorNode) {\n var newObj = res.object;\n if (res.object) {\n newObj = applyRule(res.object, rule, context);\n }\n var newIndex = res.index;\n if (res.index) {\n newIndex = applyRule(res.index, rule, context);\n }\n if (newObj !== res.object || newIndex !== res.index) {\n res = new AccessorNode(newObj, newIndex);\n }\n } else if (res instanceof IndexNode) {\n var newDims = mapRule(res.dimensions, rule, context);\n if (newDims !== res.dimensions) {\n res = new IndexNode(newDims);\n }\n } else if (res instanceof ObjectNode) {\n var changed = false;\n var newProps = {};\n for (var prop in res.properties) {\n newProps[prop] = applyRule(res.properties[prop], rule, context);\n if (newProps[prop] !== res.properties[prop]) {\n changed = true;\n }\n }\n if (changed) {\n res = new ObjectNode(newProps);\n }\n }\n\n // Try to match a rule against this node\n var repl = rule.r;\n var matches = _ruleMatch(rule.l, res, mergedContext)[0];\n\n // If the rule is associative operator, we can try matching it while allowing additional terms.\n // This allows us to match rules like 'n+n' to the expression '(1+x)+x' or even 'x+1+x' if the operator is commutative.\n if (!matches && rule.expanded) {\n repl = rule.expanded.r;\n matches = _ruleMatch(rule.expanded.l, res, mergedContext)[0];\n }\n // Additional, non-commutative context expansion-rules\n if (!matches && rule.expandedNC1) {\n repl = rule.expandedNC1.r;\n matches = _ruleMatch(rule.expandedNC1.l, res, mergedContext)[0];\n if (!matches) {\n // Existence of NC1 implies NC2\n repl = rule.expandedNC2.r;\n matches = _ruleMatch(rule.expandedNC2.l, res, mergedContext)[0];\n }\n }\n if (matches) {\n // const before = res.toString({parenthesis: 'all'})\n\n // Create a new node by cloning the rhs of the matched rule\n // we keep any implicit multiplication state if relevant\n var implicit = res.implicit;\n res = repl.clone();\n if (implicit && 'implicit' in repl) {\n res.implicit = true;\n }\n\n // Replace placeholders with their respective nodes without traversing deeper into the replaced nodes\n res = res.transform(function (node) {\n if (node.isSymbolNode && hasOwnProperty(matches.placeholders, node.name)) {\n return matches.placeholders[node.name].clone();\n } else {\n return node;\n }\n });\n\n // const after = res.toString({parenthesis: 'all'})\n // console.log('Simplified ' + before + ' to ' + after)\n }\n if (rule.repeat && res !== node) {\n res = applyRule(res, rule, context);\n }\n return res;\n }\n\n /**\n * Get (binary) combinations of a flattened binary node\n * e.g. +(node1, node2, node3) -> [\n * +(node1, +(node2, node3)),\n * +(node2, +(node1, node3)),\n * +(node3, +(node1, node2))]\n *\n */\n function getSplits(node, context) {\n var res = [];\n var right, rightArgs;\n var makeNode = createMakeNodeFunction(node);\n if (isCommutative(node, context)) {\n for (var i = 0; i < node.args.length; i++) {\n rightArgs = node.args.slice(0);\n rightArgs.splice(i, 1);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([node.args[i], right]));\n }\n } else {\n // Keep order, but try all parenthesizations\n for (var _i = 1; _i < node.args.length; _i++) {\n var left = node.args[0];\n if (_i > 1) {\n left = makeNode(node.args.slice(0, _i));\n }\n rightArgs = node.args.slice(_i);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([left, right]));\n }\n }\n return res;\n }\n\n /**\n * Returns the set union of two match-placeholders or null if there is a conflict.\n */\n function mergeMatch(match1, match2) {\n var res = {\n placeholders: {}\n };\n\n // Some matches may not have placeholders; this is OK\n if (!match1.placeholders && !match2.placeholders) {\n return res;\n } else if (!match1.placeholders) {\n return match2;\n } else if (!match2.placeholders) {\n return match1;\n }\n\n // Placeholders with the same key must match exactly\n for (var key in match1.placeholders) {\n if (hasOwnProperty(match1.placeholders, key)) {\n res.placeholders[key] = match1.placeholders[key];\n if (hasOwnProperty(match2.placeholders, key)) {\n if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) {\n return null;\n }\n }\n }\n }\n for (var _key in match2.placeholders) {\n if (hasOwnProperty(match2.placeholders, _key)) {\n res.placeholders[_key] = match2.placeholders[_key];\n }\n }\n return res;\n }\n\n /**\n * Combine two lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n */\n function combineChildMatches(list1, list2) {\n var res = [];\n if (list1.length === 0 || list2.length === 0) {\n return res;\n }\n var merged;\n for (var i1 = 0; i1 < list1.length; i1++) {\n for (var i2 = 0; i2 < list2.length; i2++) {\n merged = mergeMatch(list1[i1], list2[i2]);\n if (merged) {\n res.push(merged);\n }\n }\n }\n return res;\n }\n\n /**\n * Combine multiple lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n * Returns a list of unique matches.\n */\n function mergeChildMatches(childMatches) {\n if (childMatches.length === 0) {\n return childMatches;\n }\n var sets = childMatches.reduce(combineChildMatches);\n var uniqueSets = [];\n var unique = {};\n for (var i = 0; i < sets.length; i++) {\n var s = JSON.stringify(sets[i]);\n if (!unique[s]) {\n unique[s] = true;\n uniqueSets.push(sets[i]);\n }\n }\n return uniqueSets;\n }\n\n /**\n * Determines whether node matches rule.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} rule\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} context -- provides assumed properties of operators\n * @param {Boolean} isSplit -- whether we are in process of splitting an\n * n-ary operator node into possible binary combinations.\n * Defaults to false.\n * @return {Object} Information about the match, if it exists.\n */\n function _ruleMatch(rule, node, context, isSplit) {\n // console.log('Entering _ruleMatch(' + JSON.stringify(rule) + ', ' + JSON.stringify(node) + ')')\n // console.log('rule = ' + rule)\n // console.log('node = ' + node)\n\n // console.log('Entering _ruleMatch(', rule.toString({parenthesis:'all'}), ', ', node.toString({parenthesis:'all'}), ', ', context, ')')\n var res = [{\n placeholders: {}\n }];\n if (rule instanceof OperatorNode && node instanceof OperatorNode || rule instanceof FunctionNode && node instanceof FunctionNode) {\n // If the rule is an OperatorNode or a FunctionNode, then node must match exactly\n if (rule instanceof OperatorNode) {\n if (rule.op !== node.op || rule.fn !== node.fn) {\n return [];\n }\n } else if (rule instanceof FunctionNode) {\n if (rule.name !== node.name) {\n return [];\n }\n }\n\n // rule and node match. Search the children of rule and node.\n if (node.args.length === 1 && rule.args.length === 1 || !isAssociative(node, context) && node.args.length === rule.args.length || isSplit) {\n // Expect non-associative operators to match exactly,\n // except in any order if operator is commutative\n var childMatches = [];\n for (var i = 0; i < rule.args.length; i++) {\n var childMatch = _ruleMatch(rule.args[i], node.args[i], context);\n if (childMatch.length === 0) {\n // Child did not match, so stop searching immediately\n break;\n }\n // The child matched, so add the information returned from the child to our result\n childMatches.push(childMatch);\n }\n if (childMatches.length !== rule.args.length) {\n if (!isCommutative(node, context) ||\n // exact match in order needed\n rule.args.length === 1) {\n // nothing to commute\n return [];\n }\n if (rule.args.length > 2) {\n /* Need to generate all permutations and try them.\n * It's a bit complicated, and unlikely to come up since there\n * are very few ternary or higher operators. So punt for now.\n */\n throw new Error('permuting >2 commutative non-associative rule arguments not yet implemented');\n }\n /* Exactly two arguments, try them reversed */\n var leftMatch = _ruleMatch(rule.args[0], node.args[1], context);\n if (leftMatch.length === 0) {\n return [];\n }\n var rightMatch = _ruleMatch(rule.args[1], node.args[0], context);\n if (rightMatch.length === 0) {\n return [];\n }\n childMatches = [leftMatch, rightMatch];\n }\n res = mergeChildMatches(childMatches);\n } else if (node.args.length >= 2 && rule.args.length === 2) {\n // node is flattened, rule is not\n // Associative operators/functions can be split in different ways so we check if the rule\n // matches for each of them and return their union.\n var splits = getSplits(node, context);\n var splitMatches = [];\n for (var _i2 = 0; _i2 < splits.length; _i2++) {\n var matchSet = _ruleMatch(rule, splits[_i2], context, true); // recursing at the same tree depth here\n splitMatches = splitMatches.concat(matchSet);\n }\n return splitMatches;\n } else if (rule.args.length > 2) {\n throw Error('Unexpected non-binary associative function: ' + rule.toString());\n } else {\n // Incorrect number of arguments in rule and node, so no match\n return [];\n }\n } else if (rule instanceof SymbolNode) {\n // If the rule is a SymbolNode, then it carries a special meaning\n // according to the first one or two characters of the symbol node name.\n // These meanings are expalined in the documentation for simplify()\n if (rule.name.length === 0) {\n throw new Error('Symbol in rule has 0 length...!?');\n }\n if (SUPPORTED_CONSTANTS[rule.name]) {\n // built-in constant must match exactly\n if (rule.name !== node.name) {\n return [];\n }\n } else {\n // wildcards are composed of up to two alphabetic or underscore characters\n switch (rule.name[1] >= 'a' && rule.name[1] <= 'z' ? rule.name.substring(0, 2) : rule.name[0]) {\n case 'n':\n case '_p':\n // rule matches _anything_, so assign this node to the rule.name placeholder\n // Assign node to the rule.name placeholder.\n // Our parent will check for matches among placeholders.\n res[0].placeholders[rule.name] = node;\n break;\n case 'c':\n case 'cl':\n // rule matches a ConstantNode\n if (isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'v':\n // rule matches anything other than a ConstantNode\n if (!isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vl':\n // rule matches VariableNode\n if (isVariableNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'cd':\n // rule matches a ConstantNode or unaryMinus-wrapped ConstantNode\n if (isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vd':\n // rule matches anything other than a ConstantNode or unaryMinus-wrapped ConstantNode\n if (!isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'ce':\n // rule matches expressions that have a constant value\n if (isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 've':\n // rule matches expressions that do not have a constant value\n if (!isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n default:\n throw new Error('Invalid symbol in rule: ' + rule.name);\n }\n }\n } else if (rule instanceof ConstantNode) {\n // Literal constant must match exactly\n if (!equal(rule.value, node.value)) {\n return [];\n }\n } else {\n // Some other node was encountered which we aren't prepared for, so no match\n return [];\n }\n\n // It's a match!\n\n // console.log('_ruleMatch(' + rule.toString() + ', ' + node.toString() + ') found a match')\n return res;\n }\n\n /**\n * Determines whether p and q (and all their children nodes) are identical.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} p\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} q\n * @return {Object} Information about the match, if it exists.\n */\n function _exactMatch(p, q) {\n if (p instanceof ConstantNode && q instanceof ConstantNode) {\n if (!equal(p.value, q.value)) {\n return false;\n }\n } else if (p instanceof SymbolNode && q instanceof SymbolNode) {\n if (p.name !== q.name) {\n return false;\n }\n } else if (p instanceof OperatorNode && q instanceof OperatorNode || p instanceof FunctionNode && q instanceof FunctionNode) {\n if (p instanceof OperatorNode) {\n if (p.op !== q.op || p.fn !== q.fn) {\n return false;\n }\n } else if (p instanceof FunctionNode) {\n if (p.name !== q.name) {\n return false;\n }\n }\n if (p.args.length !== q.args.length) {\n return false;\n }\n for (var i = 0; i < p.args.length; i++) {\n if (!_exactMatch(p.args[i], q.args[i])) {\n return false;\n }\n }\n } else {\n return false;\n }\n return true;\n }\n return simplify;\n});", "import { isConstantNode, isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nexport { isConstantNode, isSymbolNode as isVariableNode } from '../../../utils/is.js';\nexport function isNumericNode(x) {\n return isConstantNode(x) || isOperatorNode(x) && x.isUnary() && isConstantNode(x.args[0]);\n}\nexport function isConstantExpression(x) {\n if (isConstantNode(x)) {\n // Basic Constant types\n return true;\n }\n if ((isFunctionNode(x) || isOperatorNode(x)) && x.args.every(isConstantExpression)) {\n // Can be constant depending on arguments\n return true;\n }\n if (isParenthesisNode(x) && isConstantExpression(x.content)) {\n // Parenthesis are transparent\n return true;\n }\n return false; // Probably missing some edge cases\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nimport { hasOwnProperty } from '../../../utils/object.js';\nvar name = 'simplifyUtil';\nvar dependencies = ['FunctionNode', 'OperatorNode', 'SymbolNode'];\nexport var createUtil = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n FunctionNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n // TODO commutative/associative properties rely on the arguments\n // e.g. multiply is not commutative for matrices\n // The properties should be calculated from an argument to simplify, or possibly something in math.config\n // the other option is for typed() to specify a return type so that we can evaluate the type of arguments\n\n /* So that properties of an operator fit on one line: */\n var T = true;\n var F = false;\n var defaultName = 'defaultF';\n var defaultContext = {\n /* */add: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /**/unaryPlus: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */subtract: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */multiply: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */divide: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */paren: {\n trivial: T,\n total: T,\n commutative: T,\n associative: F\n },\n /* */defaultF: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n }\n };\n var realContext = {\n divide: {\n total: F\n },\n log: {\n total: F\n }\n };\n var positiveContext = {\n subtract: {\n total: F\n },\n abs: {\n trivial: T\n },\n log: {\n total: T\n }\n };\n function hasProperty(nodeOrName, property) {\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultContext;\n var name = defaultName;\n if (typeof nodeOrName === 'string') {\n name = nodeOrName;\n } else if (isOperatorNode(nodeOrName)) {\n name = nodeOrName.fn.toString();\n } else if (isFunctionNode(nodeOrName)) {\n name = nodeOrName.name;\n } else if (isParenthesisNode(nodeOrName)) {\n name = 'paren';\n }\n if (hasOwnProperty(context, name)) {\n var properties = context[name];\n if (hasOwnProperty(properties, property)) {\n return properties[property];\n }\n if (hasOwnProperty(defaultContext, name)) {\n return defaultContext[name][property];\n }\n }\n if (hasOwnProperty(context, defaultName)) {\n var _properties = context[defaultName];\n if (hasOwnProperty(_properties, property)) {\n return _properties[property];\n }\n return defaultContext[defaultName][property];\n }\n /* name not found in context and context has no global default */\n /* So use default context. */\n if (hasOwnProperty(defaultContext, name)) {\n var _properties2 = defaultContext[name];\n if (hasOwnProperty(_properties2, property)) {\n return _properties2[property];\n }\n }\n return defaultContext[defaultName][property];\n }\n function isCommutative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'commutative', context);\n }\n function isAssociative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'associative', context);\n }\n\n /**\n * Merge the given contexts, with primary overriding secondary\n * wherever they might conflict\n */\n function mergeContext(primary, secondary) {\n var merged = _objectSpread({}, primary);\n for (var prop in secondary) {\n if (hasOwnProperty(primary, prop)) {\n merged[prop] = _objectSpread(_objectSpread({}, secondary[prop]), primary[prop]);\n } else {\n merged[prop] = secondary[prop];\n }\n }\n return merged;\n }\n\n /**\n * Flatten all associative operators in an expression tree.\n * Assumes parentheses have already been removed.\n */\n function flatten(node, context) {\n if (!node.args || node.args.length === 0) {\n return node;\n }\n node.args = allChildren(node, context);\n for (var i = 0; i < node.args.length; i++) {\n flatten(node.args[i], context);\n }\n }\n\n /**\n * Get the children of a node as if it has been flattened.\n * TODO implement for FunctionNodes\n */\n function allChildren(node, context) {\n var op;\n var children = [];\n var findChildren = function findChildren(node) {\n for (var i = 0; i < node.args.length; i++) {\n var child = node.args[i];\n if (isOperatorNode(child) && op === child.op) {\n findChildren(child);\n } else {\n children.push(child);\n }\n }\n };\n if (isAssociative(node, context)) {\n op = node.op;\n findChildren(node);\n return children;\n } else {\n return node.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a right-heavy binary tree.\n */\n function unflattenr(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenr(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.pop();\n while (node.args.length > 0) {\n curnode = makeNode([node.args.pop(), curnode]);\n }\n node.args = curnode.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a left-heavy binary tree.\n */\n function unflattenl(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenl(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.shift();\n while (node.args.length > 0) {\n curnode = makeNode([curnode, node.args.shift()]);\n }\n node.args = curnode.args;\n }\n }\n function createMakeNodeFunction(node) {\n if (isOperatorNode(node)) {\n return function (args) {\n try {\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } catch (err) {\n console.error(err);\n return [];\n }\n };\n } else {\n return function (args) {\n return new FunctionNode(new SymbolNode(node.name), args);\n };\n }\n }\n return {\n createMakeNodeFunction,\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n allChildren,\n unflattenr,\n unflattenl,\n defaultContext,\n realContext,\n positiveContext\n };\n});", "import { isFraction, isMatrix, isNode, isArrayNode, isConstantNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { createUtil } from './simplify/util.js';\nimport { noBignumber, noFraction } from '../../utils/noop.js';\nvar name = 'simplifyConstant';\nvar dependencies = ['typed', 'config', 'mathWithTransform', 'matrix', '?fraction', '?bignumber', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode'];\nexport var createSimplifyConstant = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n mathWithTransform,\n matrix,\n fraction,\n bignumber,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n var {\n isCommutative,\n isAssociative,\n allChildren,\n createMakeNodeFunction\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * simplifyConstant() takes a mathjs expression (either a Node representing\n * a parse tree or a string which it parses to produce a node), and replaces\n * any subexpression of it consisting entirely of constants with the computed\n * value of that subexpression.\n *\n * Syntax:\n *\n * math.simplifyConstant(expr)\n * math.simplifyConstant(expr, options)\n *\n * Examples:\n *\n * math.simplifyConstant('x + 4*3/6') // Node \"x + 2\"\n * math.simplifyConstant('z cos(0)') // Node \"z 1\"\n * math.simplifyConstant('(5.2 + 1.08)t', {exactFractions: false}) // Node \"6.28 t\"\n *\n * See also:\n *\n * simplify, simplifyCore, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with constant subexpressions evaluated\n */\n var simplifyConstant = typed('simplifyConstant', {\n Node: node => _ensureNode(foldFraction(node, {})),\n 'Node, Object': function NodeObject(expr, options) {\n return _ensureNode(foldFraction(expr, options));\n }\n });\n function _removeFractions(thing) {\n if (isFraction(thing)) {\n return thing.valueOf();\n }\n if (thing instanceof Array) {\n return thing.map(_removeFractions);\n }\n if (isMatrix(thing)) {\n return matrix(_removeFractions(thing.valueOf()));\n }\n return thing;\n }\n function _eval(fnname, args, options) {\n try {\n return mathWithTransform[fnname].apply(null, args);\n } catch (ignore) {\n // sometimes the implicit type conversion causes the evaluation to fail, so we'll try again after removing Fractions\n args = args.map(_removeFractions);\n return _toNumber(mathWithTransform[fnname].apply(null, args), options);\n }\n }\n var _toNode = typed({\n Fraction: _fractionToNode,\n number: function number(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n BigNumber: function BigNumber(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n); // old parameters: (n.toString(), 'number')\n },\n bigint: function bigint(n) {\n if (n < 0n) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n Complex: function Complex(s) {\n throw new Error('Cannot convert Complex number to Node');\n },\n string: function string(s) {\n return new ConstantNode(s);\n },\n Matrix: function Matrix(m) {\n return new ArrayNode(m.valueOf().map(e => _toNode(e)));\n }\n });\n function _ensureNode(thing) {\n if (isNode(thing)) {\n return thing;\n }\n return _toNode(thing);\n }\n\n // convert a number to a fraction only if it can be expressed exactly,\n // and when both numerator and denominator are small enough\n function _exactFraction(n, options) {\n var exactFractions = options && options.exactFractions !== false;\n if (exactFractions && isFinite(n) && fraction) {\n var f = fraction(n);\n var fractionsLimit = options && typeof options.fractionsLimit === 'number' ? options.fractionsLimit : Infinity; // no limit by default\n\n if (f.valueOf() === n && f.n < fractionsLimit && f.d < fractionsLimit) {\n return f;\n }\n }\n return n;\n }\n\n // Convert numbers to a preferred number type in preference order: Fraction, number, Complex\n // BigNumbers are left alone\n var _toNumber = typed({\n 'string, Object': function stringObject(s, options) {\n var numericType = safeNumberType(s, config);\n if (numericType === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return bignumber(s);\n } else if (numericType === 'bigint') {\n return BigInt(s);\n } else if (numericType === 'Fraction') {\n if (fraction === undefined) {\n noFraction();\n }\n return fraction(s);\n } else {\n var n = parseFloat(s);\n return _exactFraction(n, options);\n }\n },\n 'Fraction, Object': function FractionObject(s, options) {\n return s;\n },\n // we don't need options here\n\n 'BigNumber, Object': function BigNumberObject(s, options) {\n return s;\n },\n // we don't need options here\n\n 'number, Object': function numberObject(s, options) {\n return _exactFraction(s, options);\n },\n 'bigint, Object': function bigintObject(s, options) {\n return s;\n },\n 'Complex, Object': function ComplexObject(s, options) {\n if (s.im !== 0) {\n return s;\n }\n return _exactFraction(s.re, options);\n },\n 'Matrix, Object': function MatrixObject(s, options) {\n return matrix(_exactFraction(s.valueOf()));\n },\n 'Array, Object': function ArrayObject(s, options) {\n return s.map(_exactFraction);\n }\n });\n function unaryMinusNode(n) {\n return new OperatorNode('-', 'unaryMinus', [n]);\n }\n function _fractionToNode(f) {\n var n;\n var vn = f.s * f.n;\n if (vn < 0) {\n n = new OperatorNode('-', 'unaryMinus', [new ConstantNode(-vn)]);\n } else {\n n = new ConstantNode(vn);\n }\n if (f.d === 1) {\n return n;\n }\n return new OperatorNode('/', 'divide', [n, new ConstantNode(f.d)]);\n }\n\n /* Handles constant indexing of ArrayNodes, matrices, and ObjectNodes */\n function _foldAccessor(obj, index, options) {\n if (!isIndexNode(index)) {\n // don't know what to do with that...\n return new AccessorNode(_ensureNode(obj), _ensureNode(index));\n }\n if (isArrayNode(obj) || isMatrix(obj)) {\n var remainingDims = Array.from(index.dimensions);\n /* We will resolve constant indices one at a time, looking\n * just in the first or second dimensions because (a) arrays\n * of more than two dimensions are likely rare, and (b) pulling\n * out the third or higher dimension would be pretty intricate.\n * The price is that we miss simplifying [..3d array][x,y,1]\n */\n while (remainingDims.length > 0) {\n if (isConstantNode(remainingDims[0]) && typeof remainingDims[0].value !== 'string') {\n var first = _toNumber(remainingDims.shift().value, options);\n if (isArrayNode(obj)) {\n obj = obj.items[first - 1];\n } else {\n // matrix\n obj = obj.valueOf()[first - 1];\n if (obj instanceof Array) {\n obj = matrix(obj);\n }\n }\n } else if (remainingDims.length > 1 && isConstantNode(remainingDims[1]) && typeof remainingDims[1].value !== 'string') {\n var second = _toNumber(remainingDims[1].value, options);\n var tryItems = [];\n var fromItems = isArrayNode(obj) ? obj.items : obj.valueOf();\n for (var item of fromItems) {\n if (isArrayNode(item)) {\n tryItems.push(item.items[second - 1]);\n } else if (isMatrix(obj)) {\n tryItems.push(item[second - 1]);\n } else {\n break;\n }\n }\n if (tryItems.length === fromItems.length) {\n if (isArrayNode(obj)) {\n obj = new ArrayNode(tryItems);\n } else {\n // matrix\n obj = matrix(tryItems);\n }\n remainingDims.splice(1, 1);\n } else {\n // extracting slice along 2nd dimension failed, give up\n break;\n }\n } else {\n // neither 1st or 2nd dimension is constant, give up\n break;\n }\n }\n if (remainingDims.length === index.dimensions.length) {\n /* No successful constant indexing */\n return new AccessorNode(_ensureNode(obj), index);\n }\n if (remainingDims.length > 0) {\n /* Indexed some but not all dimensions */\n index = new IndexNode(remainingDims);\n return new AccessorNode(_ensureNode(obj), index);\n }\n /* All dimensions were constant, access completely resolved */\n return obj;\n }\n if (isObjectNode(obj) && index.dimensions.length === 1 && isConstantNode(index.dimensions[0])) {\n var key = index.dimensions[0].value;\n if (key in obj.properties) {\n return obj.properties[key];\n }\n return new ConstantNode(); // undefined\n }\n /* Don't know how to index this sort of obj, at least not with this index */\n return new AccessorNode(_ensureNode(obj), index);\n }\n\n /*\n * Create a binary tree from a list of Fractions and Nodes.\n * Tries to fold Fractions by evaluating them until the first Node in the list is hit, so\n * `args` should be sorted to have the Fractions at the start (if the operator is commutative).\n * @param args - list of Fractions and Nodes\n * @param fn - evaluator for the binary operation evaluator that accepts two Fractions\n * @param makeNode - creates a binary OperatorNode/FunctionNode from a list of child Nodes\n * if args.length is 1, returns args[0]\n * @return - Either a Node representing a binary expression or Fraction\n */\n function foldOp(fn, args, makeNode, options) {\n var first = args.shift();\n\n // In the following reduction, sofar always has one of the three following\n // forms: [NODE], [CONSTANT], or [NODE, CONSTANT]\n var reduction = args.reduce((sofar, next) => {\n if (!isNode(next)) {\n var last = sofar.pop();\n if (isNode(last)) {\n return [last, next];\n }\n // Two constants in a row, try to fold them into one\n try {\n sofar.push(_eval(fn, [last, next], options));\n return sofar;\n } catch (ignoreandcontinue) {\n sofar.push(last);\n // fall through to Node case\n }\n }\n\n // Encountered a Node, or failed folding --\n // collapse everything so far into a single tree:\n sofar.push(_ensureNode(sofar.pop()));\n var newtree = sofar.length === 1 ? sofar[0] : makeNode(sofar);\n return [makeNode([newtree, _ensureNode(next)])];\n }, [first]);\n if (reduction.length === 1) {\n return reduction[0];\n }\n // Might end up with a tree and a constant at the end:\n return makeNode([reduction[0], _toNode(reduction[1])]);\n }\n\n // destroys the original node and returns a folded one\n function foldFraction(node, options) {\n switch (node.type) {\n case 'SymbolNode':\n return node;\n case 'ConstantNode':\n switch (typeof node.value) {\n case 'number':\n return _toNumber(node.value, options);\n case 'bigint':\n return _toNumber(node.value, options);\n case 'string':\n return node.value;\n default:\n if (!isNaN(node.value)) return _toNumber(node.value, options);\n }\n return node;\n case 'FunctionNode':\n if (mathWithTransform[node.name] && mathWithTransform[node.name].rawArgs) {\n return node;\n }\n {\n // Process operators as OperatorNode\n var operatorFunctions = ['add', 'multiply'];\n if (!operatorFunctions.includes(node.name)) {\n var args = node.args.map(arg => foldFraction(arg, options));\n\n // If all args are numbers\n if (!args.some(isNode)) {\n try {\n return _eval(node.name, args, options);\n } catch (ignoreandcontinue) {}\n }\n\n // Size of a matrix does not depend on entries\n if (node.name === 'size' && args.length === 1 && isArrayNode(args[0])) {\n var sz = [];\n var section = args[0];\n while (isArrayNode(section)) {\n sz.push(section.items.length);\n section = section.items[0];\n }\n return matrix(sz);\n }\n\n // Convert all args to nodes and construct a symbolic function call\n return new FunctionNode(node.name, args.map(_ensureNode));\n } else {\n // treat as operator\n }\n }\n /* falls through */\n case 'OperatorNode':\n {\n var fn = node.fn.toString();\n var _args;\n var res;\n var makeNode = createMakeNodeFunction(node);\n if (isOperatorNode(node) && node.isUnary()) {\n _args = [foldFraction(node.args[0], options)];\n if (!isNode(_args[0])) {\n res = _eval(fn, _args, options);\n } else {\n res = makeNode(_args);\n }\n } else if (isAssociative(node, options.context)) {\n _args = allChildren(node, options.context);\n _args = _args.map(arg => foldFraction(arg, options));\n if (isCommutative(fn, options.context)) {\n // commutative binary operator\n var consts = [];\n var vars = [];\n for (var i = 0; i < _args.length; i++) {\n if (!isNode(_args[i])) {\n consts.push(_args[i]);\n } else {\n vars.push(_args[i]);\n }\n }\n if (consts.length > 1) {\n res = foldOp(fn, consts, makeNode, options);\n vars.unshift(res);\n res = foldOp(fn, vars, makeNode, options);\n } else {\n // we won't change the children order since it's not neccessary\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-commutative binary operator\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-associative binary operator\n _args = node.args.map(arg => foldFraction(arg, options));\n res = foldOp(fn, _args, makeNode, options);\n }\n return res;\n }\n case 'ParenthesisNode':\n // remove the uneccessary parenthesis\n return foldFraction(node.content, options);\n case 'AccessorNode':\n return _foldAccessor(foldFraction(node.object, options), foldFraction(node.index, options), options);\n case 'ArrayNode':\n {\n var foldItems = node.items.map(item => foldFraction(item, options));\n if (foldItems.some(isNode)) {\n return new ArrayNode(foldItems.map(_ensureNode));\n }\n /* All literals -- return a Matrix so we can operate on it */\n return matrix(foldItems);\n }\n case 'IndexNode':\n {\n return new IndexNode(node.dimensions.map(n => simplifyConstant(n, options)));\n }\n case 'ObjectNode':\n {\n var foldProps = {};\n for (var prop in node.properties) {\n foldProps[prop] = simplifyConstant(node.properties[prop], options);\n }\n return new ObjectNode(foldProps);\n }\n case 'AssignmentNode':\n /* falls through */\n case 'BlockNode':\n /* falls through */\n case 'FunctionAssignmentNode':\n /* falls through */\n case 'RangeNode':\n /* falls through */\n case 'ConditionalNode':\n /* falls through */\n default:\n throw new Error(\"Unimplemented node type in simplifyConstant: \".concat(node.type));\n }\n }\n return simplifyConstant;\n});", "import { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { getOperator } from '../../expression/operators.js';\nimport { createUtil } from './simplify/util.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'simplifyCore';\nvar dependencies = ['typed', 'parse', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createSimplifyCore = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n var node0 = new ConstantNode(0);\n var node1 = new ConstantNode(1);\n var nodeT = new ConstantNode(true);\n var nodeF = new ConstantNode(false);\n // test if a node will always have a boolean value (true/false)\n // not sure if this list is complete\n function isAlwaysBoolean(node) {\n return isOperatorNode(node) && ['and', 'not', 'or'].includes(node.op);\n }\n var {\n hasProperty,\n isCommutative\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n /**\n * simplifyCore() performs single pass simplification suitable for\n * applications requiring ultimate performance. To roughly summarize,\n * it handles cases along the lines of simplifyConstant() but where\n * knowledge of a single argument is sufficient to determine the value.\n * In contrast, simplify() extends simplifyCore() with additional passes\n * to provide deeper simplification (such as gathering like terms).\n *\n * Specifically, simplifyCore:\n *\n * * Converts all function calls with operator equivalents to their\n * operator forms.\n * * Removes operators or function calls that are guaranteed to have no\n * effect (such as unary '+').\n * * Removes double unary '-', '~', and 'not'\n * * Eliminates addition/subtraction of 0 and multiplication/division/powers\n * by 1 or 0.\n * * Converts addition of a negation into subtraction.\n * * Eliminates logical operations with constant true or false leading\n * arguments.\n * * Puts constants on the left of a product, if multiplication is\n * considered commutative by the options (which is the default)\n *\n * Syntax:\n *\n * math.simplifyCore(expr)\n * math.simplifyCore(expr, options)\n *\n * Examples:\n *\n * const f = math.parse('2 * 1 * x ^ (1 - 0)')\n * math.simplifyCore(f) // Node \"2 * x\"\n * math.simplify('2 * 1 * x ^ (1 - 0)', [math.simplifyCore]) // Node \"2 * x\"\n *\n * See also:\n *\n * simplify, simplifyConstant, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with basic simplifications applied\n */\n function _simplifyCore(nodeToSimplify) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var context = options ? options.context : undefined;\n if (hasProperty(nodeToSimplify, 'trivial', context)) {\n // This node does nothing if it has only one argument, so if so,\n // return that argument simplified\n if (isFunctionNode(nodeToSimplify) && nodeToSimplify.args.length === 1) {\n return _simplifyCore(nodeToSimplify.args[0], options);\n }\n // For other node types, we try the generic methods\n var simpChild = false;\n var childCount = 0;\n nodeToSimplify.forEach(c => {\n ++childCount;\n if (childCount === 1) {\n simpChild = _simplifyCore(c, options);\n }\n });\n if (childCount === 1) {\n return simpChild;\n }\n }\n var node = nodeToSimplify;\n if (isFunctionNode(node)) {\n var op = getOperator(node.name);\n if (op) {\n // Replace FunctionNode with a new OperatorNode\n if (node.args.length > 2 && hasProperty(node, 'associative', context)) {\n // unflatten into binary operations since that's what simplifyCore handles\n while (node.args.length > 2) {\n var last = node.args.pop();\n var seclast = node.args.pop();\n node.args.push(new OperatorNode(op, node.name, [last, seclast]));\n }\n }\n node = new OperatorNode(op, node.name, node.args);\n } else {\n return new FunctionNode(_simplifyCore(node.fn), node.args.map(n => _simplifyCore(n, options)));\n }\n }\n if (isOperatorNode(node) && node.isUnary()) {\n var a0 = _simplifyCore(node.args[0], options);\n if (node.op === '~') {\n // bitwise not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === '~') {\n return a0.args[0];\n }\n }\n if (node.op === 'not') {\n // logical not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === 'not') {\n // Has the effect of turning the argument into a boolean\n // So can only eliminate the double negation if\n // the inside is already boolean\n if (isAlwaysBoolean(a0.args[0])) {\n return a0.args[0];\n }\n }\n }\n var finish = true;\n if (node.op === '-') {\n // unary minus\n if (isOperatorNode(a0)) {\n if (a0.isBinary() && a0.fn === 'subtract') {\n node = new OperatorNode('-', 'subtract', [a0.args[1], a0.args[0]]);\n finish = false; // continue to process the new binary node\n }\n if (a0.isUnary() && a0.op === '-') {\n return a0.args[0];\n }\n }\n }\n if (finish) return new OperatorNode(node.op, node.fn, [a0]);\n }\n if (isOperatorNode(node) && node.isBinary()) {\n var _a = _simplifyCore(node.args[0], options);\n var a1 = _simplifyCore(node.args[1], options);\n if (node.op === '+') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return a1;\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n a1 = a1.args[0];\n node = new OperatorNode('-', 'subtract', [_a, a1]);\n }\n }\n if (node.op === '-') {\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n return _simplifyCore(new OperatorNode('+', 'add', [_a, a1.args[0]]), options);\n }\n if (isConstantNode(_a) && isZero(_a.value)) {\n return _simplifyCore(new OperatorNode('-', 'unaryMinus', [a1]));\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '*') {\n if (isConstantNode(_a)) {\n if (isZero(_a.value)) {\n return node0;\n } else if (equal(_a.value, 1)) {\n return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node0;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n if (isCommutative(node, context)) {\n return new OperatorNode(node.op, node.fn, [a1, _a], node.implicit); // constants on left\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1], node.implicit);\n }\n if (node.op === '/') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return node0;\n }\n if (isConstantNode(a1) && equal(a1.value, 1)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '^') {\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node1;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n }\n }\n if (node.op === 'and') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n if (isAlwaysBoolean(a1)) return a1;\n if (isConstantNode(a1)) {\n return a1.value ? nodeT : nodeF;\n }\n } else {\n return nodeF;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n if (isAlwaysBoolean(_a)) return _a;\n } else {\n return nodeF;\n }\n }\n }\n if (node.op === 'or') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(a1)) return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(_a)) return _a;\n }\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (isOperatorNode(node)) {\n return new OperatorNode(node.op, node.fn, node.args.map(a => _simplifyCore(a, options)));\n }\n if (isArrayNode(node)) {\n return new ArrayNode(node.items.map(n => _simplifyCore(n, options)));\n }\n if (isAccessorNode(node)) {\n return new AccessorNode(_simplifyCore(node.object, options), _simplifyCore(node.index, options));\n }\n if (isIndexNode(node)) {\n return new IndexNode(node.dimensions.map(n => _simplifyCore(n, options)));\n }\n if (isObjectNode(node)) {\n var newProps = {};\n for (var prop in node.properties) {\n newProps[prop] = _simplifyCore(node.properties[prop], options);\n }\n return new ObjectNode(newProps);\n }\n // cannot simplify\n return node;\n }\n return typed(name, {\n Node: _simplifyCore,\n 'Node,Object': _simplifyCore\n });\n});", "import { createMap } from '../../utils/map.js';\nimport { isFunctionNode, isNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'resolve';\nvar dependencies = ['typed', 'parse', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode'];\nexport var createResolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode\n } = _ref;\n /**\n * resolve(expr, scope) replaces variable nodes with their scoped values\n *\n * Syntax:\n *\n * math.resolve(expr, scope)\n *\n * Examples:\n *\n * math.resolve('x + y', {x:1, y:2}) // Node '1 + 2'\n * math.resolve(math.parse('x+y'), {x:1, y:2}) // Node '1 + 2'\n * math.simplify('x+y', {x:2, y: math.parse('x+x')}).toString() // \"6\"\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node | Node[]} node\n * The expression tree (or trees) to be simplified\n * @param {Object} scope\n * Scope specifying variables to be resolved\n * @return {Node | Node[]} Returns `node` with variables recursively substituted.\n * @throws {ReferenceError}\n * If there is a cyclic dependency among the variables in `scope`,\n * resolution is impossible and a ReferenceError is thrown.\n */\n function _resolve(node, scope) {\n var within = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();\n // note `within`:\n // `within` is not documented, since it is for internal cycle\n // detection only\n if (!scope) {\n return node;\n }\n if (isSymbolNode(node)) {\n if (within.has(node.name)) {\n var variables = Array.from(within).join(', ');\n throw new ReferenceError(\"recursive loop of variable definitions among {\".concat(variables, \"}\"));\n }\n var value = scope.get(node.name);\n if (isNode(value)) {\n var nextWithin = new Set(within);\n nextWithin.add(node.name);\n return _resolve(value, scope, nextWithin);\n } else if (typeof value === 'number') {\n return parse(String(value));\n } else if (value !== undefined) {\n return new ConstantNode(value);\n } else {\n return node;\n }\n } else if (isOperatorNode(node)) {\n var args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } else if (isParenthesisNode(node)) {\n return new ParenthesisNode(_resolve(node.content, scope, within));\n } else if (isFunctionNode(node)) {\n var _args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new FunctionNode(node.name, _args);\n }\n\n // Otherwise just recursively resolve any children (might also work\n // for some of the above special cases)\n return node.map(child => _resolve(child, scope, within));\n }\n return typed('resolve', {\n Node: _resolve,\n 'Node, Map | null | undefined': _resolve,\n 'Node, Object': (n, scope) => _resolve(n, createMap(scope)),\n // For arrays and matrices, we map `self` rather than `_resolve`\n // because resolve is fairly expensive anyway, and this way\n // we get nice error messages if one entry in the array has wrong type.\n 'Array | Matrix': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array | Matrix, null | undefined': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array, Object': typed.referTo('Array,Map', selfAM => (A, scope) => selfAM(A, createMap(scope))),\n 'Matrix, Object': typed.referTo('Matrix,Map', selfMM => (A, scope) => selfMM(A, createMap(scope))),\n 'Array | Matrix, Map': typed.referToSelf(self => (A, scope) => A.map(n => self(n, scope)))\n });\n});", "import { isConstantNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'symbolicEqual';\nvar dependencies = ['parse', 'simplify', 'typed', 'OperatorNode'];\nexport var createSymbolicEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n simplify,\n typed,\n OperatorNode\n } = _ref;\n /**\n * Attempts to determine if two expressions are symbolically equal, i.e.\n * one is the result of valid algebraic manipulations on the other.\n * Currently, this simply checks if the difference of the two expressions\n * simplifies down to 0. So there are two important caveats:\n * 1. whether two expressions are symbolically equal depends on the\n * manipulations allowed. Therefore, this function takes an optional\n * third argument, which are the options that control the behavior\n * as documented for the `simplify()` function.\n * 2. it is in general intractable to find the minimal simplification of\n * an arbitrarily complicated expression. So while a `true` value\n * of `symbolicEqual` ensures that the two expressions can be manipulated\n * to match each other, a `false` value does not absolutely rule this out.\n *\n * Syntax:\n *\n * math.symbolicEqual(expr1, expr2)\n * math.symbolicEqual(expr1, expr2, options)\n *\n * Examples:\n *\n * math.symbolicEqual('x*y', 'y*x') // Returns true\n * math.symbolicEqual('x*y', 'y*x', {context: {multiply: {commutative: false}}}) // Returns false\n * math.symbolicEqual('x/y', '(y*x^(-1))^(-1)') // Returns true\n * math.symbolicEqual('abs(x)','x') // Returns false\n * math.symbolicEqual('abs(x)','x', simplify.positiveContext) // Returns true\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node|string} expr1 The first expression to compare\n * @param {Node|string} expr2 The second expression to compare\n * @param {Object} [options] Optional option object, passed to simplify\n * @returns {boolean}\n * Returns true if a valid manipulation making the expressions equal\n * is found.\n */\n function _symbolicEqual(e1, e2) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var diff = new OperatorNode('-', 'subtract', [e1, e2]);\n var simplified = simplify(diff, {}, options);\n return isConstantNode(simplified) && !simplified.value;\n }\n return typed(name, {\n 'Node, Node': _symbolicEqual,\n 'Node, Node, Object': _symbolicEqual\n });\n});", "import { isConstantNode, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nvar name = 'derivative';\nvar dependencies = ['typed', 'config', 'parse', 'simplify', 'equal', 'isZero', 'numeric', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createDerivative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n parse,\n simplify,\n equal,\n isZero,\n numeric,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n /**\n * Takes the derivative of an expression expressed in parser Nodes.\n * The derivative will be taken over the supplied variable in the\n * second parameter. If there are multiple variables in the expression,\n * it will return a partial derivative.\n *\n * This uses rules of differentiation which can be found here:\n *\n * - [Differentiation rules (Wikipedia)](https://en.wikipedia.org/wiki/Differentiation_rules)\n *\n * Syntax:\n *\n * math.derivative(expr, variable)\n * math.derivative(expr, variable, options)\n *\n * Examples:\n *\n * math.derivative('x^2', 'x') // Node '2 * x'\n * math.derivative('x^2', 'x', {simplify: false}) // Node '2 * 1 * x ^ (2 - 1)'\n * math.derivative('sin(2x)', 'x')) // Node '2 * cos(2 * x)'\n * math.derivative('2*x', 'x').evaluate() // number 2\n * math.derivative('x^2', 'x').evaluate({x: 4}) // number 8\n * const f = math.parse('x^2')\n * const x = math.parse('x')\n * math.derivative(f, x) // Node {2 * x}\n *\n * See also:\n *\n * simplify, parse, evaluate\n *\n * @param {Node | string} expr The expression to differentiate\n * @param {SymbolNode | string} variable The variable over which to differentiate\n * @param {{simplify: boolean}} [options]\n * There is one option available, `simplify`, which\n * is true by default. When false, output will not\n * be simplified.\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n function plainDerivative(expr, variable) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n simplify: true\n };\n var constNodes = {};\n constTag(constNodes, expr, variable.name);\n var res = _derivative(expr, constNodes);\n return options.simplify ? simplify(res) : res;\n }\n typed.addConversion({\n from: 'identifier',\n to: 'SymbolNode',\n convert: parse\n });\n var derivative = typed(name, {\n 'Node, SymbolNode': plainDerivative,\n 'Node, SymbolNode, Object': plainDerivative\n\n /* TODO: implement and test syntax with order of derivatives -> implement as an option {order: number}\n 'Node, SymbolNode, ConstantNode': function (expr, variable, {order}) {\n let res = expr\n for (let i = 0; i < order; i++) {\n let constNodes = {}\n constTag(constNodes, expr, variable.name)\n res = _derivative(res, constNodes)\n }\n return res\n }\n */\n });\n typed.removeConversion({\n from: 'identifier',\n to: 'SymbolNode',\n convert: parse\n });\n derivative._simplify = true;\n derivative.toTex = function (deriv) {\n return _derivTex.apply(null, deriv.args);\n };\n\n // FIXME: move the toTex method of derivative to latex.js. Difficulty is that it relies on parse.\n // NOTE: the optional \"order\" parameter here is currently unused\n var _derivTex = typed('_derivTex', {\n 'Node, SymbolNode': function NodeSymbolNode(expr, x) {\n if (isConstantNode(expr) && typeOf(expr.value) === 'string') {\n return _derivTex(parse(expr.value).toString(), x.toString(), 1);\n } else {\n return _derivTex(expr.toTex(), x.toString(), 1);\n }\n },\n 'Node, ConstantNode': function NodeConstantNode(expr, x) {\n if (typeOf(x.value) === 'string') {\n return _derivTex(expr, parse(x.value));\n } else {\n throw new Error(\"The second parameter to 'derivative' is a non-string constant\");\n }\n },\n 'Node, SymbolNode, ConstantNode': function NodeSymbolNodeConstantNode(expr, x, order) {\n return _derivTex(expr.toString(), x.name, order.value);\n },\n 'string, string, number': function stringStringNumber(expr, x, order) {\n var d;\n if (order === 1) {\n d = '{d\\\\over d' + x + '}';\n } else {\n d = '{d^{' + order + '}\\\\over d' + x + '^{' + order + '}}';\n }\n return d + \"\\\\left[\".concat(expr, \"\\\\right]\");\n }\n });\n\n /**\n * Does a depth-first search on the expression tree to identify what Nodes\n * are constants (e.g. 2 + 2), and stores the ones that are constants in\n * constNodes. Classification is done as follows:\n *\n * 1. ConstantNodes are constants.\n * 2. If there exists a SymbolNode, of which we are differentiating over,\n * in the subtree it is not constant.\n *\n * @param {Object} constNodes Holds the nodes that are constant\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {string} varName Variable that we are differentiating\n * @return {boolean} if node is constant\n */\n // TODO: can we rewrite constTag into a pure function?\n var constTag = typed('constTag', {\n 'Object, ConstantNode, string': function ObjectConstantNodeString(constNodes, node) {\n constNodes[node] = true;\n return true;\n },\n 'Object, SymbolNode, string': function ObjectSymbolNodeString(constNodes, node, varName) {\n // Treat other variables like constants. For reasoning, see:\n // https://en.wikipedia.org/wiki/Partial_derivative\n if (node.name !== varName) {\n constNodes[node] = true;\n return true;\n }\n return false;\n },\n 'Object, ParenthesisNode, string': function ObjectParenthesisNodeString(constNodes, node, varName) {\n return constTag(constNodes, node.content, varName);\n },\n 'Object, FunctionAssignmentNode, string': function ObjectFunctionAssignmentNodeString(constNodes, node, varName) {\n if (!node.params.includes(varName)) {\n constNodes[node] = true;\n return true;\n }\n return constTag(constNodes, node.expr, varName);\n },\n 'Object, FunctionNode | OperatorNode, string': function ObjectFunctionNodeOperatorNodeString(constNodes, node, varName) {\n if (node.args.length > 0) {\n var isConst = constTag(constNodes, node.args[0], varName);\n for (var i = 1; i < node.args.length; ++i) {\n isConst = constTag(constNodes, node.args[i], varName) && isConst;\n }\n if (isConst) {\n constNodes[node] = true;\n return true;\n }\n }\n return false;\n }\n });\n\n /**\n * Applies differentiation rules.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} constNodes Holds the nodes that are constant\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n var _derivative = typed('_derivative', {\n 'ConstantNode, Object': function ConstantNodeObject(node) {\n return createConstantNode(0);\n },\n 'SymbolNode, Object': function SymbolNodeObject(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n return createConstantNode(1);\n },\n 'ParenthesisNode, Object': function ParenthesisNodeObject(node, constNodes) {\n return new ParenthesisNode(_derivative(node.content, constNodes));\n },\n 'FunctionAssignmentNode, Object': function FunctionAssignmentNodeObject(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n return _derivative(node.expr, constNodes);\n },\n 'FunctionNode, Object': function FunctionNodeObject(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n var arg0 = node.args[0];\n var arg1;\n var div = false; // is output a fraction?\n var negative = false; // is output negative?\n\n var funcDerivative;\n switch (node.name) {\n case 'cbrt':\n // d/dx(cbrt(x)) = 1 / (3x^(2/3))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(3), new OperatorNode('^', 'pow', [arg0, new OperatorNode('/', 'divide', [createConstantNode(2), createConstantNode(3)])])]);\n break;\n case 'sqrt':\n case 'nthRoot':\n // d/dx(sqrt(x)) = 1 / (2*sqrt(x))\n if (node.args.length === 1) {\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(2), new FunctionNode('sqrt', [arg0])]);\n } else if (node.args.length === 2) {\n // Rearrange from nthRoot(x, a) -> x^(1/a)\n arg1 = new OperatorNode('/', 'divide', [createConstantNode(1), node.args[1]]);\n\n // Is a variable?\n constNodes[arg1] = constNodes[node.args[1]];\n return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), constNodes);\n }\n break;\n case 'log10':\n arg1 = createConstantNode(10);\n /* fall through! */\n case 'log':\n if (!arg1 && node.args.length === 1) {\n // d/dx(log(x)) = 1 / x\n funcDerivative = arg0.clone();\n div = true;\n } else if (node.args.length === 1 && arg1 || node.args.length === 2 && constNodes[node.args[1]] !== undefined) {\n // d/dx(log(x, c)) = 1 / (x*ln(c))\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('log', [arg1 || node.args[1]])]);\n div = true;\n } else if (node.args.length === 2) {\n // d/dx(log(f(x), g(x))) = d/dx(log(f(x)) / log(g(x)))\n return _derivative(new OperatorNode('/', 'divide', [new FunctionNode('log', [arg0]), new FunctionNode('log', [node.args[1]])]), constNodes);\n }\n break;\n case 'pow':\n if (node.args.length === 2) {\n constNodes[arg1] = constNodes[node.args[1]];\n // Pass to pow operator node parser\n return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), constNodes);\n }\n break;\n case 'exp':\n // d/dx(e^x) = e^x\n funcDerivative = new FunctionNode('exp', [arg0.clone()]);\n break;\n case 'sin':\n // d/dx(sin(x)) = cos(x)\n funcDerivative = new FunctionNode('cos', [arg0.clone()]);\n break;\n case 'cos':\n // d/dx(cos(x)) = -sin(x)\n funcDerivative = new OperatorNode('-', 'unaryMinus', [new FunctionNode('sin', [arg0.clone()])]);\n break;\n case 'tan':\n // d/dx(tan(x)) = sec(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sec', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sec':\n // d/dx(sec(x)) = sec(x)tan(x)\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tan', [arg0.clone()])]);\n break;\n case 'csc':\n // d/dx(csc(x)) = -csc(x)cot(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('cot', [arg0.clone()])]);\n break;\n case 'cot':\n // d/dx(cot(x)) = -csc(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csc', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asin':\n // d/dx(asin(x)) = 1 / sqrt(1 - x^2)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'acos':\n // d/dx(acos(x)) = -1 / sqrt(1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'atan':\n // d/dx(atan(x)) = 1 / (x^2 + 1)\n div = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'asec':\n // d/dx(asec(x)) = 1 / (|x|*sqrt(x^2 - 1))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acsc':\n // d/dx(acsc(x)) = -1 / (|x|*sqrt(x^2 - 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acot':\n // d/dx(acot(x)) = -1 / (x^2 + 1)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'sinh':\n // d/dx(sinh(x)) = cosh(x)\n funcDerivative = new FunctionNode('cosh', [arg0.clone()]);\n break;\n case 'cosh':\n // d/dx(cosh(x)) = sinh(x)\n funcDerivative = new FunctionNode('sinh', [arg0.clone()]);\n break;\n case 'tanh':\n // d/dx(tanh(x)) = sech(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sech', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sech':\n // d/dx(sech(x)) = -sech(x)tanh(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tanh', [arg0.clone()])]);\n break;\n case 'csch':\n // d/dx(csch(x)) = -csch(x)coth(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('coth', [arg0.clone()])]);\n break;\n case 'coth':\n // d/dx(coth(x)) = -csch(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csch', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asinh':\n // d/dx(asinh(x)) = 1 / sqrt(x^2 + 1)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'acosh':\n // d/dx(acosh(x)) = 1 / sqrt(x^2 - 1); XXX potentially only for x >= 1 (the real spectrum)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'atanh':\n // d/dx(atanh(x)) = 1 / (1 - x^2)\n div = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'asech':\n // d/dx(asech(x)) = -1 / (x*sqrt(1 - x^2))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])])]);\n break;\n case 'acsch':\n // d/dx(acsch(x)) = -1 / (|x|*sqrt(x^2 + 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acoth':\n // d/dx(acoth(x)) = -1 / (1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'abs':\n // d/dx(abs(x)) = abs(x)/x\n funcDerivative = new OperatorNode('/', 'divide', [new FunctionNode(new SymbolNode('abs'), [arg0.clone()]), arg0.clone()]);\n break;\n case 'gamma': // Needs digamma function, d/dx(gamma(x)) = gamma(x)digamma(x)\n default:\n throw new Error('Cannot process function \"' + node.name + '\" in derivative: ' + 'the function is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n var op, func;\n if (div) {\n op = '/';\n func = 'divide';\n } else {\n op = '*';\n func = 'multiply';\n }\n\n /* Apply chain rule to all functions:\n F(x) = f(g(x))\n F'(x) = g'(x)*f'(g(x)) */\n var chainDerivative = _derivative(arg0, constNodes);\n if (negative) {\n chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative]);\n }\n return new OperatorNode(op, func, [chainDerivative, funcDerivative]);\n },\n 'OperatorNode, Object': function OperatorNodeObject(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n if (node.op === '+') {\n // d/dx(sum(f(x)) = sum(f'(x))\n return new OperatorNode(node.op, node.fn, node.args.map(function (arg) {\n return _derivative(arg, constNodes);\n }));\n }\n if (node.op === '-') {\n // d/dx(+/-f(x)) = +/-f'(x)\n if (node.isUnary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes)]);\n }\n\n // Linearity of differentiation, d/dx(f(x) +/- g(x)) = f'(x) +/- g'(x)\n if (node.isBinary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes), _derivative(node.args[1], constNodes)]);\n }\n }\n if (node.op === '*') {\n // d/dx(c*f(x)) = c*f'(x)\n var constantTerms = node.args.filter(function (arg) {\n return constNodes[arg] !== undefined;\n });\n if (constantTerms.length > 0) {\n var nonConstantTerms = node.args.filter(function (arg) {\n return constNodes[arg] === undefined;\n });\n var nonConstantNode = nonConstantTerms.length === 1 ? nonConstantTerms[0] : new OperatorNode('*', 'multiply', nonConstantTerms);\n var newArgs = constantTerms.concat(_derivative(nonConstantNode, constNodes));\n return new OperatorNode('*', 'multiply', newArgs);\n }\n\n // Product Rule, d/dx(f(x)*g(x)) = f'(x)*g(x) + f(x)*g'(x)\n return new OperatorNode('+', 'add', node.args.map(function (argOuter) {\n return new OperatorNode('*', 'multiply', node.args.map(function (argInner) {\n return argInner === argOuter ? _derivative(argInner, constNodes) : argInner.clone();\n }));\n }));\n }\n if (node.op === '/' && node.isBinary()) {\n var arg0 = node.args[0];\n var arg1 = node.args[1];\n\n // d/dx(f(x) / c) = f'(x) / c\n if (constNodes[arg1] !== undefined) {\n return new OperatorNode('/', 'divide', [_derivative(arg0, constNodes), arg1]);\n }\n\n // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2)\n if (constNodes[arg0] !== undefined) {\n return new OperatorNode('*', 'multiply', [new OperatorNode('-', 'unaryMinus', [arg0]), new OperatorNode('/', 'divide', [_derivative(arg1, constNodes), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])])]);\n }\n\n // Quotient rule, d/dx(f(x) / g(x)) = (f'(x)g(x) - f(x)g'(x)) / g(x)^2\n return new OperatorNode('/', 'divide', [new OperatorNode('-', 'subtract', [new OperatorNode('*', 'multiply', [_derivative(arg0, constNodes), arg1.clone()]), new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, constNodes)])]), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])]);\n }\n if (node.op === '^' && node.isBinary()) {\n var _arg = node.args[0];\n var _arg2 = node.args[1];\n if (constNodes[_arg] !== undefined) {\n // If is secretly constant; 0^f(x) = 1 (in JS), 1^f(x) = 1\n if (isConstantNode(_arg) && (isZero(_arg.value) || equal(_arg.value, 1))) {\n return createConstantNode(0);\n }\n\n // d/dx(c^f(x)) = c^f(x)*ln(c)*f'(x)\n return new OperatorNode('*', 'multiply', [node, new OperatorNode('*', 'multiply', [new FunctionNode('log', [_arg.clone()]), _derivative(_arg2.clone(), constNodes)])]);\n }\n if (constNodes[_arg2] !== undefined) {\n if (isConstantNode(_arg2)) {\n // If is secretly constant; f(x)^0 = 1 -> d/dx(1) = 0\n if (isZero(_arg2.value)) {\n return createConstantNode(0);\n }\n // Ignore exponent; f(x)^1 = f(x)\n if (equal(_arg2.value, 1)) {\n return _derivative(_arg, constNodes);\n }\n }\n\n // Elementary Power Rule, d/dx(f(x)^c) = c*f'(x)*f(x)^(c-1)\n var powMinusOne = new OperatorNode('^', 'pow', [_arg.clone(), new OperatorNode('-', 'subtract', [_arg2, createConstantNode(1)])]);\n return new OperatorNode('*', 'multiply', [_arg2.clone(), new OperatorNode('*', 'multiply', [_derivative(_arg, constNodes), powMinusOne])]);\n }\n\n // Functional Power Rule, d/dx(f^g) = f^g*[f'*(g/f) + g'ln(f)]\n return new OperatorNode('*', 'multiply', [new OperatorNode('^', 'pow', [_arg.clone(), _arg2.clone()]), new OperatorNode('+', 'add', [new OperatorNode('*', 'multiply', [_derivative(_arg, constNodes), new OperatorNode('/', 'divide', [_arg2.clone(), _arg.clone()])]), new OperatorNode('*', 'multiply', [_derivative(_arg2, constNodes), new FunctionNode('log', [_arg.clone()])])])]);\n }\n throw new Error('Cannot process operator \"' + node.op + '\" in derivative: ' + 'the operator is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n });\n\n /**\n * Helper function to create a constant node with a specific type\n * (number, BigNumber, Fraction)\n * @param {number} value\n * @param {string} [valueType]\n * @return {ConstantNode}\n */\n function createConstantNode(value, valueType) {\n return new ConstantNode(numeric(value, valueType || safeNumberType(String(value), config)));\n }\n return derivative;\n});", "import { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'rationalize';\nvar dependencies = ['config', 'typed', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'parse', 'simplifyConstant', 'simplifyCore', 'simplify', '?bignumber', '?fraction', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode', 'ParenthesisNode'];\nexport var createRationalize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n parse,\n simplifyConstant,\n simplifyCore,\n simplify,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode,\n ParenthesisNode\n } = _ref;\n /**\n * Transform a rationalizable expression in a rational fraction.\n * If rational fraction is one variable polynomial then converts\n * the numerator and denominator in canonical form, with decreasing\n * exponents, returning the coefficients of numerator.\n *\n * Syntax:\n *\n * math.rationalize(expr)\n * math.rationalize(expr, detailed)\n * math.rationalize(expr, scope)\n * math.rationalize(expr, scope, detailed)\n *\n * Examples:\n *\n * math.rationalize('sin(x)+y')\n * // Error: There is an unsolved function call\n * math.rationalize('2x/y - y/(x+1)')\n * // (2*x^2-y^2+2*x)/(x*y+y)\n * math.rationalize('(2x+1)^6')\n * // 64*x^6+192*x^5+240*x^4+160*x^3+60*x^2+12*x+1\n * math.rationalize('2x/( (2x-1) / (3x+2) ) - 5x/ ( (3x+4) / (2x^2-5) ) + 3')\n * // -20*x^4+28*x^3+104*x^2+6*x-12)/(6*x^2+5*x-4)\n * math.rationalize('x/(1-x)/(x-2)/(x-3)/(x-4) + 2x/ ( (1-2x)/(2-3x) )/ ((3-4x)/(4-5x) )') =\n * // (-30*x^7+344*x^6-1506*x^5+3200*x^4-3472*x^3+1846*x^2-381*x)/\n * // (-8*x^6+90*x^5-383*x^4+780*x^3-797*x^2+390*x-72)\n *\n * math.rationalize('x+x+x+y',{y:1}) // 3*x+1\n * math.rationalize('x+x+x+y',{}) // 3*x+y\n *\n * const ret = math.rationalize('x+x+x+y',{},true)\n * // ret.expression=3*x+y, ret.variables = [\"x\",\"y\"]\n * const ret = math.rationalize('-2+5x^2',{},true)\n * // ret.expression=5*x^2-2, ret.variables = [\"x\"], ret.coefficients=[-2,0,5]\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to check if is a polynomial expression\n * @param {Object|boolean} optional scope of expression or true for already evaluated rational expression at input\n * @param {Boolean} detailed optional True if return an object, false if return expression node (default)\n *\n * @return {Object | Node} The rational polynomial of `expr` or an object\n * `{expression, numerator, denominator, variables, coefficients}`, where\n * `expression` is a `Node` with the node simplified expression,\n * `numerator` is a `Node` with the simplified numerator of expression,\n * `denominator` is a `Node` or `boolean` with the simplified denominator or `false` (if there is no denominator),\n * `variables` is an array with variable names,\n * and `coefficients` is an array with coefficients of numerator sorted by increased exponent\n * {Expression Node} node simplified expression\n *\n */\n function _rationalize(expr) {\n var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var detailed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var setRules = rulesRationalize(); // Rules for change polynomial in near canonical form\n var polyRet = polynomial(expr, scope, true, setRules.firstRules); // Check if expression is a rationalizable polynomial\n var nVars = polyRet.variables.length;\n var noExactFractions = {\n exactFractions: false\n };\n var withExactFractions = {\n exactFractions: true\n };\n expr = polyRet.expression;\n if (nVars >= 1) {\n // If expression in not a constant\n expr = expandPower(expr); // First expand power of polynomials (cannot be made from rules!)\n var sBefore; // Previous expression\n var rules;\n var eDistrDiv = true;\n var redoInic = false;\n // Apply the initial rules, including succ div rules:\n expr = simplify(expr, setRules.firstRules, {}, noExactFractions);\n var s;\n while (true) {\n // Alternate applying successive division rules and distr.div.rules\n // until there are no more changes:\n rules = eDistrDiv ? setRules.distrDivRules : setRules.sucDivRules;\n expr = simplify(expr, rules, {}, withExactFractions);\n eDistrDiv = !eDistrDiv; // Swap between Distr.Div and Succ. Div. Rules\n\n s = expr.toString();\n if (s === sBefore) {\n break; // No changes : end of the loop\n }\n redoInic = true;\n sBefore = s;\n }\n if (redoInic) {\n // Apply first rules again without succ div rules (if there are changes)\n expr = simplify(expr, setRules.firstRulesAgain, {}, noExactFractions);\n }\n // Apply final rules:\n expr = simplify(expr, setRules.finalRules, {}, noExactFractions);\n } // NVars >= 1\n\n var coefficients = [];\n var retRationalize = {};\n if (expr.type === 'OperatorNode' && expr.isBinary() && expr.op === '/') {\n // Separate numerator from denominator\n if (nVars === 1) {\n expr.args[0] = polyToCanonical(expr.args[0], coefficients);\n expr.args[1] = polyToCanonical(expr.args[1]);\n }\n if (detailed) {\n retRationalize.numerator = expr.args[0];\n retRationalize.denominator = expr.args[1];\n }\n } else {\n if (nVars === 1) {\n expr = polyToCanonical(expr, coefficients);\n }\n if (detailed) {\n retRationalize.numerator = expr;\n retRationalize.denominator = null;\n }\n }\n // nVars\n\n if (!detailed) return expr;\n retRationalize.coefficients = coefficients;\n retRationalize.variables = polyRet.variables;\n retRationalize.expression = expr;\n return retRationalize;\n }\n return typed(name, {\n Node: _rationalize,\n 'Node, boolean': (expr, detailed) => _rationalize(expr, {}, detailed),\n 'Node, Object': _rationalize,\n 'Node, Object, boolean': _rationalize\n }); // end of typed rationalize\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * polynomial(expr,scope,extended, rules)\n *\n * @param {Node | string} expr The expression to simplify and check if is polynomial expression\n * @param {object} scope Optional scope for expression simplification\n * @param {boolean} extended Optional. Default is false. When true allows divide operator.\n * @param {array} rules Optional. Default is no rule.\n *\n *\n * @return {Object}\n * {Object} node: node simplified expression\n * {Array} variables: variable names\n */\n function polynomial(expr, scope, extended, rules) {\n var variables = [];\n var node = simplify(expr, rules, scope, {\n exactFractions: false\n }); // Resolves any variables and functions with all defined parameters\n extended = !!extended;\n var oper = '+-*' + (extended ? '/' : '');\n recPoly(node);\n var retFunc = {};\n retFunc.expression = node;\n retFunc.variables = variables;\n return retFunc;\n\n // -------------------------------------------------------------------------------------------------------\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * recPoly(node)\n *\n *\n * @param {Node} node The current sub tree expression in recursion\n *\n * @return nothing, throw an exception if error\n */\n function recPoly(node) {\n var tp = node.type; // node type\n if (tp === 'FunctionNode') {\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n if (node.op === '^') {\n // TODO: handle negative exponents like in '1/x^(-2)'\n if (node.args[1].type !== 'ConstantNode' || !isInteger(parseFloat(node.args[1].value))) {\n throw new Error('There is a non-integer exponent');\n } else {\n recPoly(node.args[0]);\n }\n } else {\n if (!oper.includes(node.op)) {\n throw new Error('Operator ' + node.op + ' invalid in polynomial expression');\n }\n for (var i = 0; i < node.args.length; i++) {\n recPoly(node.args[i]);\n }\n } // type of operator\n } else if (tp === 'SymbolNode') {\n var _name = node.name; // variable name\n var pos = variables.indexOf(_name);\n if (pos === -1) {\n // new variable in expression\n variables.push(_name);\n }\n } else if (tp === 'ParenthesisNode') {\n recPoly(node.content);\n } else if (tp !== 'ConstantNode') {\n throw new Error('type ' + tp + ' is not allowed in polynomial expression');\n }\n } // end of recPoly\n } // end of polynomial\n\n // ---------------------------------------------------------------------------------------\n /**\n * Return a rule set to rationalize an polynomial expression in rationalize\n *\n * Syntax:\n *\n * rulesRationalize()\n *\n * @return {array} rule set to rationalize an polynomial expression\n */\n function rulesRationalize() {\n var oldRules = [simplifyCore,\n // sCore\n {\n l: 'n+n',\n r: '2*n'\n }, {\n l: 'n+-n',\n r: '0'\n }, simplifyConstant,\n // sConstant\n {\n l: 'n*(n1^-1)',\n r: 'n/n1'\n }, {\n l: 'n*n1^-n2',\n r: 'n/n1^n2'\n }, {\n l: 'n1^-1',\n r: '1/n1'\n }, {\n l: 'n*(n1/n2)',\n r: '(n*n1)/n2'\n }, {\n l: '1*n',\n r: 'n'\n }];\n var rulesFirst = [{\n l: '(-n1)/(-n2)',\n r: 'n1/n2'\n },\n // Unary division\n {\n l: '(-n1)*(-n2)',\n r: 'n1*n2'\n },\n // Unary multiplication\n {\n l: 'n1--n2',\n r: 'n1+n2'\n },\n // '--' elimination\n {\n l: 'n1-n2',\n r: 'n1+(-n2)'\n },\n // Subtraction turn into add with un\uFFFDry minus\n {\n l: '(n1+n2)*n3',\n r: '(n1*n3 + n2*n3)'\n },\n // Distributive 1\n {\n l: 'n1*(n2+n3)',\n r: '(n1*n2+n1*n3)'\n },\n // Distributive 2\n {\n l: 'c1*n + c2*n',\n r: '(c1+c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n + n',\n r: '(c1+1)*n'\n },\n // Joining constants\n {\n l: 'c1*n - c2*n',\n r: '(c1-c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n - n',\n r: '(c1-1)*n'\n },\n // Joining constants\n {\n l: 'v/c',\n r: '(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: 'v/-c',\n r: '-(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: '-v*-c',\n r: 'c*v'\n },\n // Inversion constant and variable 1\n {\n l: '-v*c',\n r: '-c*v'\n },\n // Inversion constant and variable 2\n {\n l: 'v*-c',\n r: '-c*v'\n },\n // Inversion constant and variable 3\n {\n l: 'v*c',\n r: 'c*v'\n },\n // Inversion constant and variable 4\n {\n l: '-(-n1*n2)',\n r: '(n1*n2)'\n },\n // Unary propagation\n {\n l: '-(n1*n2)',\n r: '(-n1*n2)'\n },\n // Unary propagation\n {\n l: '-(-n1+n2)',\n r: '(n1-n2)'\n },\n // Unary propagation\n {\n l: '-(n1+n2)',\n r: '(-n1-n2)'\n },\n // Unary propagation\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n },\n // Power to Power\n {\n l: '-(-n1/n2)',\n r: '(n1/n2)'\n },\n // Division and Unary\n {\n l: '-(n1/n2)',\n r: '(-n1/n2)'\n }]; // Divisao and Unary\n\n var rulesDistrDiv = [{\n l: '(n1/n2 + n3/n4)',\n r: '((n1*n4 + n3*n2)/(n2*n4))'\n },\n // Sum of fractions\n {\n l: '(n1/n2 + n3)',\n r: '((n1 + n3*n2)/n2)'\n },\n // Sum fraction with number 1\n {\n l: '(n1 + n2/n3)',\n r: '((n1*n3 + n2)/n3)'\n }]; // Sum fraction with number 1\n\n var rulesSucDiv = [{\n l: '(n1/(n2/n3))',\n r: '((n1*n3)/n2)'\n },\n // Division simplification\n {\n l: '(n1/n2/n3)',\n r: '(n1/(n2*n3))'\n }];\n var setRules = {}; // rules set in 4 steps.\n\n // All rules => infinite loop\n // setRules.allRules =oldRules.concat(rulesFirst,rulesDistrDiv,rulesSucDiv)\n\n setRules.firstRules = oldRules.concat(rulesFirst, rulesSucDiv); // First rule set\n setRules.distrDivRules = rulesDistrDiv; // Just distr. div. rules\n setRules.sucDivRules = rulesSucDiv; // Jus succ. div. rules\n setRules.firstRulesAgain = oldRules.concat(rulesFirst); // Last rules set without succ. div.\n\n // Division simplification\n\n // Second rule set.\n // There is no aggregate expression with parentesis, but the only variable can be scattered.\n setRules.finalRules = [simplifyCore,\n // simplify.rules[0]\n {\n l: 'n*-n',\n r: '-n^2'\n },\n // Joining multiply with power 1\n {\n l: 'n*n',\n r: 'n^2'\n },\n // Joining multiply with power 2\n simplifyConstant,\n // simplify.rules[14] old 3rd index in oldRules\n {\n l: 'n*-n^n1',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 3\n {\n l: 'n*n^n1',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 4\n {\n l: 'n^n1*-n^n2',\n r: '-n^(n1+n2)'\n },\n // Joining multiply with power 5\n {\n l: 'n^n1*n^n2',\n r: 'n^(n1+n2)'\n },\n // Joining multiply with power 6\n {\n l: 'n^n1*-n',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 7\n {\n l: 'n^n1*n',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/-n',\n r: '-n^(n1-1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/n',\n r: 'n^(n1-1)'\n },\n // Joining division with power 1\n {\n l: 'n/-n^n1',\n r: '-n^(1-n1)'\n },\n // Joining division with power 2\n {\n l: 'n/n^n1',\n r: 'n^(1-n1)'\n },\n // Joining division with power 3\n {\n l: 'n^n1/-n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 4\n {\n l: 'n^n1/n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 5\n {\n l: 'n1+(-n2*n3)',\n r: 'n1-n2*n3'\n },\n // Solving useless parenthesis 1\n {\n l: 'v*(-c)',\n r: '-c*v'\n },\n // Solving useless unary 2\n {\n l: 'n1+-n2',\n r: 'n1-n2'\n },\n // Solving +- together (new!)\n {\n l: 'v*c',\n r: 'c*v'\n },\n // inversion constant with variable\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n } // Power to Power\n ];\n return setRules;\n } // End rulesRationalize\n\n // ---------------------------------------------------------------------------------------\n /**\n * Expand recursively a tree node for handling with expressions with exponents\n * (it's not for constants, symbols or functions with exponents)\n * PS: The other parameters are internal for recursion\n *\n * Syntax:\n *\n * expandPower(node)\n *\n * @param {Node} node Current expression node\n * @param {node} parent Parent current node inside the recursion\n * @param (int} Parent number of chid inside the rercursion\n *\n * @return {node} node expression with all powers expanded.\n */\n function expandPower(node, parent, indParent) {\n var tp = node.type;\n var internal = arguments.length > 1; // TRUE in internal calls\n\n if (tp === 'OperatorNode' && node.isBinary()) {\n var does = false;\n var val;\n if (node.op === '^') {\n // First operator: Parenthesis or UnaryMinus\n if ((node.args[0].type === 'ParenthesisNode' || node.args[0].type === 'OperatorNode') && node.args[1].type === 'ConstantNode') {\n // Second operator: Constant\n val = parseFloat(node.args[1].value);\n does = val >= 2 && isInteger(val);\n }\n }\n if (does) {\n // Exponent >= 2\n // Before:\n // operator A --> Subtree\n // parent pow\n // constant\n //\n if (val > 2) {\n // Exponent > 2,\n // AFTER: (exponent > 2)\n // operator A --> Subtree\n // parent *\n // deep clone (operator A --> Subtree\n // pow\n // constant - 1\n //\n var nEsqTopo = node.args[0];\n var nDirTopo = new OperatorNode('^', 'pow', [node.args[0].cloneDeep(), new ConstantNode(val - 1)]);\n node = new OperatorNode('*', 'multiply', [nEsqTopo, nDirTopo]);\n } else {\n // Expo = 2 - no power\n // AFTER: (exponent = 2)\n // operator A --> Subtree\n // parent oper\n // deep clone (operator A --> Subtree)\n //\n node = new OperatorNode('*', 'multiply', [node.args[0], node.args[0].cloneDeep()]);\n }\n if (internal) {\n // Change parent references in internal recursive calls\n if (indParent === 'content') {\n parent.content = node;\n } else {\n parent.args[indParent] = node;\n }\n }\n } // does\n } // binary OperatorNode\n\n if (tp === 'ParenthesisNode') {\n // Recursion\n expandPower(node.content, node, 'content');\n } else if (tp !== 'ConstantNode' && tp !== 'SymbolNode') {\n for (var i = 0; i < node.args.length; i++) {\n expandPower(node.args[i], node, i);\n }\n }\n if (!internal) {\n // return the root node\n return node;\n }\n } // End expandPower\n\n // ---------------------------------------------------------------------------------------\n /**\n * Auxilary function for rationalize\n * Convert near canonical polynomial in one variable in a canonical polynomial\n * with one term for each exponent in decreasing order\n *\n * Syntax:\n *\n * polyToCanonical(node [, coefficients])\n *\n * @param {Node | string} expr The near canonical polynomial expression to convert in a a canonical polynomial expression\n *\n * The string or tree expression needs to be at below syntax, with free spaces:\n * ( (^(-)? | [+-]? )cte (*)? var (^expo)? | cte )+\n * Where 'var' is one variable with any valid name\n * 'cte' are real numeric constants with any value. It can be omitted if equal than 1\n * 'expo' are integers greater than 0. It can be omitted if equal than 1.\n *\n * @param {array} coefficients Optional returns coefficients sorted by increased exponent\n *\n *\n * @return {node} new node tree with one variable polynomial or string error.\n */\n function polyToCanonical(node, coefficients) {\n if (coefficients === undefined) {\n coefficients = [];\n } // coefficients.\n\n coefficients[0] = 0; // index is the exponent\n var o = {};\n o.cte = 1;\n o.oper = '+';\n\n // fire: mark with * or ^ when finds * or ^ down tree, reset to \"\" with + and -.\n // It is used to deduce the exponent: 1 for *, 0 for \"\".\n o.fire = '';\n var maxExpo = 0; // maximum exponent\n var varname = ''; // variable name\n\n recurPol(node, null, o);\n maxExpo = coefficients.length - 1;\n var first = true;\n var no;\n for (var i = maxExpo; i >= 0; i--) {\n if (coefficients[i] === 0) continue;\n var n1 = new ConstantNode(first ? coefficients[i] : Math.abs(coefficients[i]));\n var op = coefficients[i] < 0 ? '-' : '+';\n if (i > 0) {\n // Is not a constant without variable\n var n2 = new SymbolNode(varname);\n if (i > 1) {\n var n3 = new ConstantNode(i);\n n2 = new OperatorNode('^', 'pow', [n2, n3]);\n }\n if (coefficients[i] === -1 && first) {\n n1 = new OperatorNode('-', 'unaryMinus', [n2]);\n } else if (Math.abs(coefficients[i]) === 1) {\n n1 = n2;\n } else {\n n1 = new OperatorNode('*', 'multiply', [n1, n2]);\n }\n }\n if (first) {\n no = n1;\n } else if (op === '+') {\n no = new OperatorNode('+', 'add', [no, n1]);\n } else {\n no = new OperatorNode('-', 'subtract', [no, n1]);\n }\n first = false;\n } // for\n\n if (first) {\n return new ConstantNode(0);\n } else {\n return no;\n }\n\n /**\n * Recursive auxilary function inside polyToCanonical for\n * converting expression in canonical form\n *\n * Syntax:\n *\n * recurPol(node, noPai, obj)\n *\n * @param {Node} node The current subpolynomial expression\n * @param {Node | Null} noPai The current parent node\n * @param {object} obj Object with many internal flags\n *\n * @return {} No return. If error, throws an exception\n */\n function recurPol(node, noPai, o) {\n var tp = node.type;\n if (tp === 'FunctionNode') {\n // ***** FunctionName *****\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n // ***** OperatorName *****\n if (!'+-*^'.includes(node.op)) throw new Error('Operator ' + node.op + ' invalid');\n if (noPai !== null) {\n // -(unary),^ : children of *,+,-\n if ((node.fn === 'unaryMinus' || node.fn === 'pow') && noPai.fn !== 'add' && noPai.fn !== 'subtract' && noPai.fn !== 'multiply') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+,* : children of +,-\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'multiply') && noPai.fn !== 'add' && noPai.fn !== 'subtract') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+ : first child\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'unaryMinus') && o.noFil !== 0) {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n } // Has parent\n\n // Firers: ^,* Old: ^,&,-(unary): firers\n if (node.op === '^' || node.op === '*') {\n o.fire = node.op;\n }\n for (var _i = 0; _i < node.args.length; _i++) {\n // +,-: reset fire\n if (node.fn === 'unaryMinus') o.oper = '-';\n if (node.op === '+' || node.fn === 'subtract') {\n o.fire = '';\n o.cte = 1; // default if there is no constant\n o.oper = _i === 0 ? '+' : node.op;\n }\n o.noFil = _i; // number of son\n recurPol(node.args[_i], node, o);\n } // for in children\n } else if (tp === 'SymbolNode') {\n // ***** SymbolName *****\n if (node.name !== varname && varname !== '') {\n throw new Error('There is more than one variable');\n }\n varname = node.name;\n if (noPai === null) {\n coefficients[1] = 1;\n return;\n }\n\n // ^: Symbol is First child\n if (noPai.op === '^' && o.noFil !== 0) {\n throw new Error('In power the variable should be the first parameter');\n }\n\n // *: Symbol is Second child\n if (noPai.op === '*' && o.noFil !== 1) {\n throw new Error('In multiply the variable should be the second parameter');\n }\n\n // Symbol: firers '',* => it means there is no exponent above, so it's 1 (cte * var)\n if (o.fire === '' || o.fire === '*') {\n if (maxExpo < 1) coefficients[1] = 0;\n coefficients[1] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(1, maxExpo);\n }\n } else if (tp === 'ConstantNode') {\n var valor = parseFloat(node.value);\n if (noPai === null) {\n coefficients[0] = valor;\n return;\n }\n if (noPai.op === '^') {\n // cte: second child of power\n if (o.noFil !== 1) throw new Error('Constant cannot be powered');\n if (!isInteger(valor) || valor <= 0) {\n throw new Error('Non-integer exponent is not allowed');\n }\n for (var _i2 = maxExpo + 1; _i2 < valor; _i2++) coefficients[_i2] = 0;\n if (valor > maxExpo) coefficients[valor] = 0;\n coefficients[valor] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(valor, maxExpo);\n return;\n }\n o.cte = valor;\n\n // Cte: firer '' => There is no exponent and no multiplication, so the exponent is 0.\n if (o.fire === '') {\n coefficients[0] += o.cte * (o.oper === '+' ? 1 : -1);\n }\n } else {\n throw new Error('Type ' + tp + ' is not allowed');\n }\n } // End of recurPol\n } // End of polyToCanonical\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'zpk2tf';\nvar dependencies = ['typed', 'add', 'multiply', 'Complex', 'number'];\nexport var createZpk2tf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n multiply,\n Complex,\n number\n } = _ref;\n /**\n * Compute the transfer function of a zero-pole-gain model.\n *\n * Syntax:\n * math.zpk2tf(z, p, k)\n *\n * Examples:\n * math.zpk2tf([1, 2], [-1, -2], 1) // returns [[1, -3, 2], [1, 3, 2]]\n *\n * See also:\n * freqz\n *\n * @param {Array} z Array of zeros values\n * @param {Array} p Array of poles values\n * @param {number} k Gain value\n * @return {Array} Two dimensional array containing the numerator (first row) and denominator (second row) polynomials\n *\n */\n return typed(name, {\n 'Array,Array,number': function ArrayArrayNumber(z, p, k) {\n return _zpk2tf(z, p, k);\n },\n 'Array,Array': function ArrayArray(z, p) {\n return _zpk2tf(z, p, 1);\n },\n 'Matrix,Matrix,number': function MatrixMatrixNumber(z, p, k) {\n return _zpk2tf(z.valueOf(), p.valueOf(), k);\n },\n 'Matrix,Matrix': function MatrixMatrix(z, p) {\n return _zpk2tf(z.valueOf(), p.valueOf(), 1);\n }\n });\n function _zpk2tf(z, p, k) {\n // if z is bignumber, convert it to number\n if (z.some(el => el.type === 'BigNumber')) {\n z = z.map(el => number(el));\n }\n // if p is bignumber, convert it to number\n if (p.some(el => el.type === 'BigNumber')) {\n p = p.map(el => number(el));\n }\n var num = [Complex(1, 0)];\n var den = [Complex(1, 0)];\n for (var i = 0; i < z.length; i++) {\n var zero = z[i];\n if (typeof zero === 'number') zero = Complex(zero, 0);\n num = _multiply(num, [Complex(1, 0), Complex(-zero.re, -zero.im)]);\n }\n for (var _i = 0; _i < p.length; _i++) {\n var pole = p[_i];\n if (typeof pole === 'number') pole = Complex(pole, 0);\n den = _multiply(den, [Complex(1, 0), Complex(-pole.re, -pole.im)]);\n }\n for (var _i2 = 0; _i2 < num.length; _i2++) {\n num[_i2] = multiply(num[_i2], k);\n }\n return [num, den];\n }\n function _multiply(a, b) {\n var c = [];\n for (var i = 0; i < a.length + b.length - 1; i++) {\n c[i] = Complex(0, 0);\n for (var j = 0; j < a.length; j++) {\n if (i - j >= 0 && i - j < b.length) {\n c[i] = add(c[i], multiply(a[j], b[i - j]));\n }\n }\n }\n return c;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'freqz';\nvar dependencies = ['typed', 'add', 'multiply', 'Complex', 'divide', 'matrix'];\nexport var createFreqz = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n multiply,\n Complex,\n divide,\n matrix\n } = _ref;\n /**\n * Calculates the frequency response of a filter given its numerator and denominator coefficients.\n *\n * Syntax:\n * math.freqz(b, a)\n * math.freqz(b, a, w)\n *\n * Examples:\n * math.freqz([1, 2], [1, 2, 3], 4) // returns { h: [0.5 + 0i, 0.4768589245763655 + 0.2861153547458193i, 0.25000000000000006 + 0.75i, -0.770976571635189 + 0.4625859429811135i], w: [0, 0.7853981633974483, 1.5707963267948966, 2.356194490192345 ] }\n * math.freqz([1, 2], [1, 2, 3], [0, 1]) // returns { h: [0.5 + 0i, 0.45436781 + 0.38598051i], w: [0, 1] }\n *\n * See also:\n * zpk2tf\n *\n * @param {Array.} b The numerator coefficients of the filter.\n * @param {Array.} a The denominator coefficients of the filter.\n * @param {Array.} [w] A vector of frequencies (in radians/sample) at which the frequency response is to be computed or the number of points to compute (if a number is not provided, the default is 512 points)\n * @returns {Object} An object with two properties: h, a vector containing the complex frequency response, and w, a vector containing the normalized frequencies (in radians/sample) at which the response was computed.\n *\n *\n */\n return typed(name, {\n 'Array, Array': function ArrayArray(b, a) {\n var w = createBins(512);\n return _freqz(b, a, w);\n },\n 'Array, Array, Array': function ArrayArrayArray(b, a, w) {\n return _freqz(b, a, w);\n },\n 'Array, Array, number': function ArrayArrayNumber(b, a, w) {\n if (w < 0) {\n throw new Error('w must be a positive number');\n }\n var w2 = createBins(w);\n return _freqz(b, a, w2);\n },\n 'Matrix, Matrix': function MatrixMatrix(b, a) {\n // console.log('here')\n var _w = createBins(512);\n var {\n w,\n h\n } = _freqz(b.valueOf(), a.valueOf(), _w);\n return {\n w: matrix(w),\n h: matrix(h)\n };\n },\n 'Matrix, Matrix, Matrix': function MatrixMatrixMatrix(b, a, w) {\n var {\n h\n } = _freqz(b.valueOf(), a.valueOf(), w.valueOf());\n return {\n h: matrix(h),\n w: matrix(w)\n };\n },\n 'Matrix, Matrix, number': function MatrixMatrixNumber(b, a, w) {\n if (w < 0) {\n throw new Error('w must be a positive number');\n }\n var _w = createBins(w);\n var {\n h\n } = _freqz(b.valueOf(), a.valueOf(), _w);\n return {\n h: matrix(h),\n w: matrix(_w)\n };\n }\n });\n function _freqz(b, a, w) {\n var num = [];\n var den = [];\n for (var i = 0; i < w.length; i++) {\n var sumNum = Complex(0, 0);\n var sumDen = Complex(0, 0);\n for (var j = 0; j < b.length; j++) {\n sumNum = add(sumNum, multiply(b[j], Complex(Math.cos(-j * w[i]), Math.sin(-j * w[i]))));\n }\n for (var _j = 0; _j < a.length; _j++) {\n sumDen = add(sumDen, multiply(a[_j], Complex(Math.cos(-_j * w[i]), Math.sin(-_j * w[i]))));\n }\n num.push(sumNum);\n den.push(sumDen);\n }\n var h = [];\n for (var _i = 0; _i < num.length; _i++) {\n h.push(divide(num[_i], den[_i]));\n }\n return {\n h,\n w\n };\n }\n function createBins(n) {\n var bins = [];\n for (var i = 0; i < n; i++) {\n bins.push(i / n * Math.PI);\n }\n return bins;\n }\n});", "import { factory } from '../utils/factory.js';\nvar name = 'reviver';\nvar dependencies = ['classes'];\nexport var createReviver = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n classes\n } = _ref;\n /**\n * Instantiate mathjs data types from their JSON representation\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the revived object\n */\n return function reviver(key, value) {\n var constructor = classes[value && value.mathjs];\n if (constructor && typeof constructor.fromJSON === 'function') {\n return constructor.fromJSON(value);\n }\n return value;\n };\n});", "import { factory } from '../utils/factory.js';\nvar name = 'replacer';\nvar dependencies = [];\nexport var createReplacer = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Stringify data types into their JSON representation.\n * Most data types can be serialized using their `.toJSON` method,\n * but not all, for example the number `Infinity`. For these cases you have\n * to use the replacer. Example usage:\n *\n * JSON.stringify([2, Infinity], math.replacer)\n *\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the replaced object\n */\n return function replacer(key, value) {\n // the numeric values Infinitiy, -Infinity, and NaN cannot be serialized to JSON\n if (typeof value === 'number' && (!isFinite(value) || isNaN(value))) {\n return {\n mathjs: 'number',\n value: String(value)\n };\n }\n if (typeof value === 'bigint') {\n return {\n mathjs: 'bigint',\n value: String(value)\n };\n }\n return value;\n };\n});", "import { factory } from './utils/factory.js';\nimport { version } from './version.js';\nimport { createBigNumberE, createBigNumberPhi, createBigNumberPi, createBigNumberTau } from './utils/bignumber/constants.js';\nimport { pi, tau, e, phi } from './plain/number/index.js';\nexport var createTrue = /* #__PURE__ */factory('true', [], () => true);\nexport var createFalse = /* #__PURE__ */factory('false', [], () => false);\nexport var createNull = /* #__PURE__ */factory('null', [], () => null);\nexport var createInfinity = /* #__PURE__ */recreateFactory('Infinity', ['config', '?BigNumber'], _ref => {\n var {\n config,\n BigNumber\n } = _ref;\n return config.number === 'BigNumber' ? new BigNumber(Infinity) : Infinity;\n});\nexport var createNaN = /* #__PURE__ */recreateFactory('NaN', ['config', '?BigNumber'], _ref2 => {\n var {\n config,\n BigNumber\n } = _ref2;\n return config.number === 'BigNumber' ? new BigNumber(NaN) : NaN;\n});\nexport var createPi = /* #__PURE__ */recreateFactory('pi', ['config', '?BigNumber'], _ref3 => {\n var {\n config,\n BigNumber\n } = _ref3;\n return config.number === 'BigNumber' ? createBigNumberPi(BigNumber) : pi;\n});\nexport var createTau = /* #__PURE__ */recreateFactory('tau', ['config', '?BigNumber'], _ref4 => {\n var {\n config,\n BigNumber\n } = _ref4;\n return config.number === 'BigNumber' ? createBigNumberTau(BigNumber) : tau;\n});\nexport var createE = /* #__PURE__ */recreateFactory('e', ['config', '?BigNumber'], _ref5 => {\n var {\n config,\n BigNumber\n } = _ref5;\n return config.number === 'BigNumber' ? createBigNumberE(BigNumber) : e;\n});\n\n// golden ratio, (1+sqrt(5))/2\nexport var createPhi = /* #__PURE__ */recreateFactory('phi', ['config', '?BigNumber'], _ref6 => {\n var {\n config,\n BigNumber\n } = _ref6;\n return config.number === 'BigNumber' ? createBigNumberPhi(BigNumber) : phi;\n});\nexport var createLN2 = /* #__PURE__ */recreateFactory('LN2', ['config', '?BigNumber'], _ref7 => {\n var {\n config,\n BigNumber\n } = _ref7;\n return config.number === 'BigNumber' ? new BigNumber(2).ln() : Math.LN2;\n});\nexport var createLN10 = /* #__PURE__ */recreateFactory('LN10', ['config', '?BigNumber'], _ref8 => {\n var {\n config,\n BigNumber\n } = _ref8;\n return config.number === 'BigNumber' ? new BigNumber(10).ln() : Math.LN10;\n});\nexport var createLOG2E = /* #__PURE__ */recreateFactory('LOG2E', ['config', '?BigNumber'], _ref9 => {\n var {\n config,\n BigNumber\n } = _ref9;\n return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(2).ln()) : Math.LOG2E;\n});\nexport var createLOG10E = /* #__PURE__ */recreateFactory('LOG10E', ['config', '?BigNumber'], _ref10 => {\n var {\n config,\n BigNumber\n } = _ref10;\n return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(10).ln()) : Math.LOG10E;\n});\nexport var createSQRT1_2 = /* #__PURE__ */recreateFactory(\n// eslint-disable-line camelcase\n'SQRT1_2', ['config', '?BigNumber'], _ref11 => {\n var {\n config,\n BigNumber\n } = _ref11;\n return config.number === 'BigNumber' ? new BigNumber('0.5').sqrt() : Math.SQRT1_2;\n});\nexport var createSQRT2 = /* #__PURE__ */recreateFactory('SQRT2', ['config', '?BigNumber'], _ref12 => {\n var {\n config,\n BigNumber\n } = _ref12;\n return config.number === 'BigNumber' ? new BigNumber(2).sqrt() : Math.SQRT2;\n});\nexport var createI = /* #__PURE__ */recreateFactory('i', ['Complex'], _ref13 => {\n var {\n Complex\n } = _ref13;\n return Complex.I;\n});\n\n// for backward compatibility with v5\nexport var createUppercasePi = /* #__PURE__ */factory('PI', ['pi'], _ref14 => {\n var {\n pi\n } = _ref14;\n return pi;\n});\nexport var createUppercaseE = /* #__PURE__ */factory('E', ['e'], _ref15 => {\n var {\n e\n } = _ref15;\n return e;\n});\nexport var createVersion = /* #__PURE__ */factory('version', [], () => version);\n\n// helper function to create a factory with a flag recreateOnConfigChange\n// idea: allow passing optional properties to be attached to the factory function as 4th argument?\nfunction recreateFactory(name, dependencies, create) {\n return factory(name, dependencies, create, {\n recreateOnConfigChange: true\n });\n}", "export var version = '13.0.0';\n// Note: This file is automatically generated when building math.js.\n// Changes made in this file will be overwritten.", "import { factory } from '../../utils/factory.js';\n\n// Source: https://en.wikipedia.org/wiki/Physical_constant\n\n// Universal constants\nexport var createSpeedOfLight = /* #__PURE__ */unitFactory('speedOfLight', '299792458', 'm s^-1');\nexport var createGravitationConstant = /* #__PURE__ */unitFactory('gravitationConstant', '6.67430e-11', 'm^3 kg^-1 s^-2');\nexport var createPlanckConstant = /* #__PURE__ */unitFactory('planckConstant', '6.62607015e-34', 'J s');\nexport var createReducedPlanckConstant = /* #__PURE__ */unitFactory('reducedPlanckConstant', '1.0545718176461565e-34', 'J s');\n\n// Electromagnetic constants\nexport var createMagneticConstant = /* #__PURE__ */unitFactory('magneticConstant', '1.25663706212e-6', 'N A^-2');\nexport var createElectricConstant = /* #__PURE__ */unitFactory('electricConstant', '8.8541878128e-12', 'F m^-1');\nexport var createVacuumImpedance = /* #__PURE__ */unitFactory('vacuumImpedance', '376.730313667', 'ohm');\nexport var createCoulomb = /* #__PURE__ */unitFactory('coulomb', '8.987551792261171e9', 'N m^2 C^-2');\nexport var createElementaryCharge = /* #__PURE__ */unitFactory('elementaryCharge', '1.602176634e-19', 'C');\nexport var createBohrMagneton = /* #__PURE__ */unitFactory('bohrMagneton', '9.2740100783e-24', 'J T^-1');\nexport var createConductanceQuantum = /* #__PURE__ */unitFactory('conductanceQuantum', '7.748091729863649e-5', 'S');\nexport var createInverseConductanceQuantum = /* #__PURE__ */unitFactory('inverseConductanceQuantum', '12906.403729652257', 'ohm');\nexport var createMagneticFluxQuantum = /* #__PURE__ */unitFactory('magneticFluxQuantum', '2.0678338484619295e-15', 'Wb');\nexport var createNuclearMagneton = /* #__PURE__ */unitFactory('nuclearMagneton', '5.0507837461e-27', 'J T^-1');\nexport var createKlitzing = /* #__PURE__ */unitFactory('klitzing', '25812.807459304513', 'ohm');\nexport var createJosephson = /* #__PURE__ */unitFactory('josephson', '4.835978484169836e14 Hz V', 'Hz V^-1'); // TODO: support for Hz needed\n\n// Atomic and nuclear constants\nexport var createBohrRadius = /* #__PURE__ */unitFactory('bohrRadius', '5.29177210903e-11', 'm');\nexport var createClassicalElectronRadius = /* #__PURE__ */unitFactory('classicalElectronRadius', '2.8179403262e-15', 'm');\nexport var createElectronMass = /* #__PURE__ */unitFactory('electronMass', '9.1093837015e-31', 'kg');\nexport var createFermiCoupling = /* #__PURE__ */unitFactory('fermiCoupling', '1.1663787e-5', 'GeV^-2');\nexport var createFineStructure = numberFactory('fineStructure', 7.2973525693e-3);\nexport var createHartreeEnergy = /* #__PURE__ */unitFactory('hartreeEnergy', '4.3597447222071e-18', 'J');\nexport var createProtonMass = /* #__PURE__ */unitFactory('protonMass', '1.67262192369e-27', 'kg');\nexport var createDeuteronMass = /* #__PURE__ */unitFactory('deuteronMass', '3.3435830926e-27', 'kg');\nexport var createNeutronMass = /* #__PURE__ */unitFactory('neutronMass', '1.6749271613e-27', 'kg');\nexport var createQuantumOfCirculation = /* #__PURE__ */unitFactory('quantumOfCirculation', '3.6369475516e-4', 'm^2 s^-1');\nexport var createRydberg = /* #__PURE__ */unitFactory('rydberg', '10973731.568160', 'm^-1');\nexport var createThomsonCrossSection = /* #__PURE__ */unitFactory('thomsonCrossSection', '6.6524587321e-29', 'm^2');\nexport var createWeakMixingAngle = numberFactory('weakMixingAngle', 0.22290);\nexport var createEfimovFactor = numberFactory('efimovFactor', 22.7);\n\n// Physico-chemical constants\nexport var createAtomicMass = /* #__PURE__ */unitFactory('atomicMass', '1.66053906660e-27', 'kg');\nexport var createAvogadro = /* #__PURE__ */unitFactory('avogadro', '6.02214076e23', 'mol^-1');\nexport var createBoltzmann = /* #__PURE__ */unitFactory('boltzmann', '1.380649e-23', 'J K^-1');\nexport var createFaraday = /* #__PURE__ */unitFactory('faraday', '96485.33212331001', 'C mol^-1');\nexport var createFirstRadiation = /* #__PURE__ */unitFactory('firstRadiation', '3.7417718521927573e-16', 'W m^2');\n// TODO spectralRadiance = 1.1910429723971881e-16 W m^2 sr^-1\nexport var createLoschmidt = /* #__PURE__ */unitFactory('loschmidt', '2.686780111798444e25', 'm^-3');\nexport var createGasConstant = /* #__PURE__ */unitFactory('gasConstant', '8.31446261815324', 'J K^-1 mol^-1');\nexport var createMolarPlanckConstant = /* #__PURE__ */unitFactory('molarPlanckConstant', '3.990312712893431e-10', 'J s mol^-1');\nexport var createMolarVolume = /* #__PURE__ */unitFactory('molarVolume', '0.022413969545014137', 'm^3 mol^-1');\nexport var createSackurTetrode = numberFactory('sackurTetrode', -1.16487052358);\nexport var createSecondRadiation = /* #__PURE__ */unitFactory('secondRadiation', '0.014387768775039337', 'm K');\nexport var createStefanBoltzmann = /* #__PURE__ */unitFactory('stefanBoltzmann', '5.67037441918443e-8', 'W m^-2 K^-4');\nexport var createWienDisplacement = /* #__PURE__ */unitFactory('wienDisplacement', '2.897771955e-3', 'm K');\n\n// Adopted values\nexport var createMolarMass = /* #__PURE__ */unitFactory('molarMass', '0.99999999965e-3', 'kg mol^-1');\nexport var createMolarMassC12 = /* #__PURE__ */unitFactory('molarMassC12', '11.9999999958e-3', 'kg mol^-1');\nexport var createGravity = /* #__PURE__ */unitFactory('gravity', '9.80665', 'm s^-2');\n// atm is defined in Unit.js\n\n// Natural units\nexport var createPlanckLength = /* #__PURE__ */unitFactory('planckLength', '1.616255e-35', 'm');\nexport var createPlanckMass = /* #__PURE__ */unitFactory('planckMass', '2.176435e-8', 'kg');\nexport var createPlanckTime = /* #__PURE__ */unitFactory('planckTime', '5.391245e-44', 's');\nexport var createPlanckCharge = /* #__PURE__ */unitFactory('planckCharge', '1.87554603778e-18', 'C');\nexport var createPlanckTemperature = /* #__PURE__ */unitFactory('planckTemperature', '1.416785e+32', 'K');\n\n// helper function to create a factory function which creates a physical constant,\n// a Unit with either a number value or a BigNumber value depending on the configuration\nfunction unitFactory(name, valueStr, unitStr) {\n var dependencies = ['config', 'Unit', 'BigNumber'];\n return factory(name, dependencies, _ref => {\n var {\n config,\n Unit,\n BigNumber\n } = _ref;\n // Note that we can parse into number or BigNumber.\n // We do not parse into Fractions as that doesn't make sense: we would lose precision of the values\n // Therefore we dont use Unit.parse()\n var value = config.number === 'BigNumber' ? new BigNumber(valueStr) : parseFloat(valueStr);\n var unit = new Unit(value, unitStr);\n unit.fixPrefix = true;\n return unit;\n });\n}\n\n// helper function to create a factory function which creates a numeric constant,\n// either a number or BigNumber depending on the configuration\nfunction numberFactory(name, value) {\n var dependencies = ['config', 'BigNumber'];\n return factory(name, dependencies, _ref2 => {\n var {\n config,\n BigNumber\n } = _ref2;\n return config.number === 'BigNumber' ? new BigNumber(value) : value;\n });\n}", "import { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createApply } from '../../function/matrix/apply.js';\nimport { isBigNumber, isNumber } from '../../utils/is.js';\nvar name = 'apply';\nvar dependencies = ['typed', 'isInteger'];\n\n/**\n * Attach a transform function to math.apply\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function apply\n * from one-based to zero based\n */\nexport var createApplyTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n var apply = createApply({\n typed,\n isInteger\n });\n\n // @see: comment of concat itself\n return typed('apply', {\n '...any': function any(args) {\n // change dim from one-based to zero-based\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n try {\n return apply.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createColumn } from '../../function/matrix/column.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'column';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createColumnTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var column = createColumn({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of column itself\n return typed('column', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return column.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { filter, filterRegExp } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nvar name = 'filter';\nvar dependencies = ['typed'];\nexport var createFilterTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.filter\n * Adds a property transform containing the transform function.\n *\n * This transform adds support for equations as test function for math.filter,\n * so you can do something like 'filter([3, -2, 5], x > 0)'.\n */\n function filterTransform(args, math, scope) {\n var x, callback;\n if (args[0]) {\n x = args[0].compile().evaluate(scope);\n }\n if (args[1]) {\n if (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1])) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = args[1].compile().evaluate(scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(args[1], math, scope);\n }\n }\n return filter(x, callback);\n }\n filterTransform.rawArgs = true;\n\n // one based version of function filter\n var filter = typed('filter', {\n 'Array, function': _filter,\n 'Matrix, function': function MatrixFunction(x, test) {\n return x.create(_filter(x.toArray(), test));\n },\n 'Array, RegExp': filterRegExp,\n 'Matrix, RegExp': function MatrixRegExp(x, test) {\n return x.create(filterRegExp(x.toArray(), test));\n }\n });\n return filterTransform;\n}, {\n isTransformFunction: true\n});\n\n/**\n * Filter values in a callback given a callback function\n *\n * !!! Passes a one-based index !!!\n *\n * @param {Array} x\n * @param {Function} callback\n * @return {Array} Returns the filtered array\n * @private\n */\nfunction _filter(x, callback) {\n return filter(x, function (value, index, array) {\n // invoke the callback function with the right number of arguments\n return applyCallback(callback, value, [index + 1], array, 'filter');\n });\n}", "import { isSymbolNode } from '../../../utils/is.js';\nimport { PartitionedMap } from '../../../utils/map.js';\n\n/**\n * Compile an inline expression like \"x > 0\"\n * @param {Node} expression\n * @param {Object} math\n * @param {Map} scope\n * @return {function} Returns a function with one argument which fills in the\n * undefined variable (like \"x\") and evaluates the expression\n */\nexport function compileInlineExpression(expression, math, scope) {\n // find an undefined symbol\n var symbol = expression.filter(function (node) {\n return isSymbolNode(node) && !(node.name in math) && !scope.has(node.name);\n })[0];\n if (!symbol) {\n throw new Error('No undefined variable found in inline expression \"' + expression + '\"');\n }\n\n // create a test function for this equation\n var name = symbol.name; // variable name\n var argsScope = new Map();\n var subScope = new PartitionedMap(scope, argsScope, new Set([name]));\n var eq = expression.compile();\n return function inlineExpression(x) {\n argsScope.set(name, x);\n return eq.evaluate(subScope);\n };\n}", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { forEach } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nvar name = 'forEach';\nvar dependencies = ['typed'];\nexport var createForEachTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.forEach\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n function forEachTransform(args, math, scope) {\n var x, callback;\n if (args[0]) {\n x = args[0].compile().evaluate(scope);\n }\n if (args[1]) {\n if (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1])) {\n // a function pointer, like forEach([3, -2, 5], myTestFunction)\n callback = args[1].compile().evaluate(scope);\n } else {\n // an expression like forEach([3, -2, 5], x > 0 ? callback1(x) : callback2(x) )\n callback = compileInlineExpression(args[1], math, scope);\n }\n }\n return _forEach(x, callback);\n }\n forEachTransform.rawArgs = true;\n\n // one-based version of forEach\n var _forEach = typed('forEach', {\n 'Array | Matrix, function': function ArrayMatrixFunction(array, callback) {\n var recurse = function recurse(value, index) {\n if (Array.isArray(value)) {\n forEach(value, function (child, i) {\n // we create a copy of the index array and append the new index value\n recurse(child, index.concat(i + 1)); // one based index, hence i+1\n });\n } else {\n // invoke the callback function with the right number of arguments\n return applyCallback(callback, value, index, array, 'forEach');\n }\n };\n recurse(array.valueOf(), []); // pass Array\n }\n });\n return forEachTransform;\n}, {\n isTransformFunction: true\n});", "import { isArray, isBigNumber, isMatrix, isNumber, isRange } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'index';\nvar dependencies = ['Index', 'getMatrixDataType'];\nexport var createIndexTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Index,\n getMatrixDataType\n } = _ref;\n /**\n * Attach a transform function to math.index\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n return function indexTransform() {\n var args = [];\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n var arg = arguments[i];\n\n // change from one-based to zero based, convert BigNumber to number and leave Array of Booleans as is\n if (isRange(arg)) {\n arg.start--;\n arg.end -= arg.step > 0 ? 0 : 2;\n } else if (arg && arg.isSet === true) {\n arg = arg.map(function (v) {\n return v - 1;\n });\n } else if (isArray(arg) || isMatrix(arg)) {\n if (getMatrixDataType(arg) !== 'boolean') {\n arg = arg.map(function (v) {\n return v - 1;\n });\n }\n } else if (isNumber(arg)) {\n arg--;\n } else if (isBigNumber(arg)) {\n arg = arg.toNumber() - 1;\n } else if (typeof arg === 'string') {\n // leave as is\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range');\n }\n args[i] = arg;\n }\n var res = new Index();\n Index.apply(res, args);\n return res;\n };\n}, {\n isTransformFunction: true\n});", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nvar name = 'map';\nvar dependencies = ['typed'];\nexport var createMapTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.map\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n function mapTransform(args, math, scope) {\n var x, callback;\n if (args[0]) {\n x = args[0].compile().evaluate(scope);\n }\n if (args[1]) {\n if (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1])) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = args[1].compile().evaluate(scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(args[1], math, scope);\n }\n }\n return map(x, callback);\n }\n mapTransform.rawArgs = true;\n\n // one-based version of map function\n var map = typed('map', {\n 'Array, function': function ArrayFunction(x, callback) {\n return _map(x, callback, x);\n },\n 'Matrix, function': function MatrixFunction(x, callback) {\n return x.create(_map(x.valueOf(), callback, x));\n }\n });\n return mapTransform;\n}, {\n isTransformFunction: true\n});\n\n/**\n * Map for a multidimensional array. One-based indexes\n * @param {Array} array\n * @param {function} callback\n * @param {Array} orig\n * @return {Array}\n * @private\n */\nfunction _map(array, callback, orig) {\n function recurse(value, index) {\n if (Array.isArray(value)) {\n return map(value, function (child, i) {\n // we create a copy of the index array and append the new index value\n return recurse(child, index.concat(i + 1)); // one based index, hence i + 1\n });\n } else {\n // invoke the (typed) callback function with the right number of arguments\n return applyCallback(callback, value, index, orig, 'map');\n }\n }\n return recurse(array, []);\n}", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMax } from '../../function/statistics/max.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'max';\nvar dependencies = ['typed', 'config', 'numeric', 'larger'];\nexport var createMaxTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n larger\n } = _ref;\n var max = createMax({\n typed,\n config,\n numeric,\n larger\n });\n\n /**\n * Attach a transform function to math.max\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function max\n * from one-based to zero based\n */\n return typed('max', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return max.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { isBigNumber, isCollection, isNumber } from '../../../utils/is.js';\n\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function lastDimToZeroBase(args) {\n if (args.length === 2 && isCollection(args[0])) {\n args = args.slice();\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n }\n return args;\n}", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMean } from '../../function/statistics/mean.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'mean';\nvar dependencies = ['typed', 'add', 'divide'];\nexport var createMeanTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide\n } = _ref;\n var mean = createMean({\n typed,\n add,\n divide\n });\n\n /**\n * Attach a transform function to math.mean\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function mean\n * from one-based to zero based\n */\n return typed('mean', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return mean.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMin } from '../../function/statistics/min.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'min';\nvar dependencies = ['typed', 'config', 'numeric', 'smaller'];\nexport var createMinTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n smaller\n } = _ref;\n var min = createMin({\n typed,\n config,\n numeric,\n smaller\n });\n\n /**\n * Attach a transform function to math.min\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function min\n * from one-based to zero based\n */\n return typed('min', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return min.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createRange } from '../../function/matrix/range.js';\nvar name = 'range';\nvar dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive'];\nexport var createRangeTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n } = _ref;\n var range = createRange({\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('range', {\n '...any': function any(args) {\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (typeof last !== 'boolean') {\n // append a parameter includeEnd=true\n args.push(true);\n }\n return range.apply(null, args);\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createRow } from '../../function/matrix/row.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'row';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createRowTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var row = createRow({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of row itself\n return typed('row', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return row.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSubset } from '../../function/matrix/subset.js';\nvar name = 'subset';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createSubsetTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var subset = createSubset({\n typed,\n matrix,\n zeros,\n add\n });\n\n /**\n * Attach a transform function to math.subset\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('subset', {\n '...any': function any(args) {\n try {\n return subset.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { isBigNumber, isNumber } from '../../utils/is.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createConcat } from '../../function/matrix/concat.js';\nvar name = 'concat';\nvar dependencies = ['typed', 'matrix', 'isInteger'];\nexport var createConcatTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isInteger\n } = _ref;\n var concat = createConcat({\n typed,\n matrix,\n isInteger\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function concat\n * from one-based to zero based\n */\n return typed('concat', {\n '...any': function any(args) {\n // change last argument from one-based to zero-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n } else if (isBigNumber(last)) {\n args[lastIndex] = last.minus(1);\n }\n try {\n return concat.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createDiff } from '../../function/matrix/diff.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'diff';\nvar dependencies = ['typed', 'matrix', 'subtract', 'number', 'bignumber'];\nexport var createDiffTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n number,\n bignumber\n } = _ref;\n var diff = createDiff({\n typed,\n matrix,\n subtract,\n number,\n bignumber\n });\n\n /**\n * Attach a transform function to math.diff\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return diff.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createStd } from '../../function/statistics/std.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'std';\nvar dependencies = ['typed', 'map', 'sqrt', 'variance'];\n\n/**\n * Attach a transform function to math.std\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createStdTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n map,\n sqrt,\n variance\n } = _ref;\n var std = createStd({\n typed,\n map,\n sqrt,\n variance\n });\n return typed('std', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return std.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSum } from '../../function/statistics/sum.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'sum';\nvar dependencies = ['typed', 'config', 'add', 'numeric'];\nexport var createSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n add,\n numeric\n } = _ref;\n var sum = createSum({\n typed,\n config,\n add,\n numeric\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return sum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createQuantileSeq } from '../../function/statistics/quantileSeq.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'quantileSeq';\nvar dependencies = ['typed', 'bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger'];\n\n/**\n * Attach a transform function to math.quantileSeq\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createQuantileSeqTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n } = _ref;\n var quantileSeq = createQuantileSeq({\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n });\n return typed('quantileSeq', {\n 'Array | Matrix, number | BigNumber': quantileSeq,\n 'Array | Matrix, number | BigNumber, number': (arr, prob, dim) => quantileSeq(arr, prob, dimToZeroBase(dim)),\n 'Array | Matrix, number | BigNumber, boolean': quantileSeq,\n 'Array | Matrix, number | BigNumber, boolean, number': (arr, prob, sorted, dim) => quantileSeq(arr, prob, sorted, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix': quantileSeq,\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => quantileSeq(data, prob, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix, boolean': quantileSeq,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => quantileSeq(data, prob, sorted, dimToZeroBase(dim))\n });\n function dimToZeroBase(dim) {\n // TODO: find a better way, maybe lastDimToZeroBase could apply to more cases.\n return lastDimToZeroBase([[], dim])[1];\n }\n}, {\n isTransformFunction: true\n});", "import { isBigNumber, isCollection, isNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createCumSum } from '../../function/statistics/cumsum.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'cumsum';\nvar dependencies = ['typed', 'add', 'unaryPlus'];\nexport var createCumSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n unaryPlus\n } = _ref;\n var cumsum = createCumSum({\n typed,\n add,\n unaryPlus\n });\n return typed(name, {\n '...any': function any(args) {\n // change last argument dim from one-based to zero-based\n if (args.length === 2 && isCollection(args[0])) {\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n }\n try {\n return cumsum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createVariance } from '../../function/statistics/variance.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'variance';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN'];\n\n/**\n * Attach a transform function to math.var\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function var\n * from one-based to zero based\n */\nexport var createVarianceTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n } = _ref;\n var variance = createVariance({\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return variance.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { createPrint } from '../../function/string/print.js';\nimport { factory } from '../../utils/factory.js';\nimport { printTemplate } from '../../utils/print.js';\nvar name = 'print';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createPrintTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var print = createPrint({\n typed,\n matrix,\n zeros,\n add\n });\n return typed(name, {\n 'string, Object | Array': function stringObjectArray(template, values) {\n return print(_convertTemplateToZeroBasedIndex(template), values);\n },\n 'string, Object | Array, number | Object': function stringObjectArrayNumberObject(template, values, options) {\n return print(_convertTemplateToZeroBasedIndex(template), values, options);\n }\n });\n function _convertTemplateToZeroBasedIndex(template) {\n return template.replace(printTemplate, x => {\n var parts = x.slice(1).split('.');\n var result = parts.map(function (part) {\n if (!isNaN(part) && part.length > 0) {\n return parseInt(part) - 1;\n } else {\n return part;\n }\n });\n return '$' + result.join('.');\n });\n }\n}, {\n isTransformFunction: true\n});", "import { createAnd } from '../../function/logical/and.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'and';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var and = createAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function andTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && !and(condition1, true)) {\n return false;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return and(condition1, condition2);\n }\n andTransform.rawArgs = true;\n return andTransform;\n}, {\n isTransformFunction: true\n});", "import { createOr } from '../../function/logical/or.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'or';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var or = createOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function orTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && or(condition1, false)) {\n return true;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return or(condition1, condition2);\n }\n orTransform.rawArgs = true;\n return orTransform;\n}, {\n isTransformFunction: true\n});", "import { createBitAnd } from '../../function/bitwise/bitAnd.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitAnd';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createBitAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var bitAnd = createBitAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function bitAndTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === 0 || condition1 === false) {\n return 0;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitAnd(condition1, condition2);\n }\n bitAndTransform.rawArgs = true;\n return bitAndTransform;\n}, {\n isTransformFunction: true\n});", "import { createBitOr } from '../../function/bitwise/bitOr.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitOr';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createBitOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var bitOr = createBitOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function bitOrTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === -1) {\n return -1;\n }\n if (condition1 === true) {\n return 1;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitOr(condition1, condition2);\n }\n bitOrTransform.rawArgs = true;\n return bitOrTransform;\n}, {\n isTransformFunction: true\n});", "/**\n * THIS FILE IS AUTO-GENERATED\n * DON'T MAKE CHANGES HERE\n */\nexport { absDependencies } from './dependenciesAny/dependenciesAbs.generated.js';\nexport { AccessorNodeDependencies } from './dependenciesAny/dependenciesAccessorNode.generated.js';\nexport { acosDependencies } from './dependenciesAny/dependenciesAcos.generated.js';\nexport { acoshDependencies } from './dependenciesAny/dependenciesAcosh.generated.js';\nexport { acotDependencies } from './dependenciesAny/dependenciesAcot.generated.js';\nexport { acothDependencies } from './dependenciesAny/dependenciesAcoth.generated.js';\nexport { acscDependencies } from './dependenciesAny/dependenciesAcsc.generated.js';\nexport { acschDependencies } from './dependenciesAny/dependenciesAcsch.generated.js';\nexport { addDependencies } from './dependenciesAny/dependenciesAdd.generated.js';\nexport { addScalarDependencies } from './dependenciesAny/dependenciesAddScalar.generated.js';\nexport { andDependencies } from './dependenciesAny/dependenciesAnd.generated.js';\nexport { andTransformDependencies } from './dependenciesAny/dependenciesAndTransform.generated.js';\nexport { applyDependencies } from './dependenciesAny/dependenciesApply.generated.js';\nexport { applyTransformDependencies } from './dependenciesAny/dependenciesApplyTransform.generated.js';\nexport { argDependencies } from './dependenciesAny/dependenciesArg.generated.js';\nexport { ArrayNodeDependencies } from './dependenciesAny/dependenciesArrayNode.generated.js';\nexport { asecDependencies } from './dependenciesAny/dependenciesAsec.generated.js';\nexport { asechDependencies } from './dependenciesAny/dependenciesAsech.generated.js';\nexport { asinDependencies } from './dependenciesAny/dependenciesAsin.generated.js';\nexport { asinhDependencies } from './dependenciesAny/dependenciesAsinh.generated.js';\nexport { AssignmentNodeDependencies } from './dependenciesAny/dependenciesAssignmentNode.generated.js';\nexport { atanDependencies } from './dependenciesAny/dependenciesAtan.generated.js';\nexport { atan2Dependencies } from './dependenciesAny/dependenciesAtan2.generated.js';\nexport { atanhDependencies } from './dependenciesAny/dependenciesAtanh.generated.js';\nexport { atomicMassDependencies } from './dependenciesAny/dependenciesAtomicMass.generated.js';\nexport { avogadroDependencies } from './dependenciesAny/dependenciesAvogadro.generated.js';\nexport { bellNumbersDependencies } from './dependenciesAny/dependenciesBellNumbers.generated.js';\nexport { BigNumberDependencies } from './dependenciesAny/dependenciesBigNumberClass.generated.js';\nexport { bigintDependencies } from './dependenciesAny/dependenciesBigint.generated.js';\nexport { bignumberDependencies } from './dependenciesAny/dependenciesBignumber.generated.js';\nexport { binDependencies } from './dependenciesAny/dependenciesBin.generated.js';\nexport { bitAndDependencies } from './dependenciesAny/dependenciesBitAnd.generated.js';\nexport { bitAndTransformDependencies } from './dependenciesAny/dependenciesBitAndTransform.generated.js';\nexport { bitNotDependencies } from './dependenciesAny/dependenciesBitNot.generated.js';\nexport { bitOrDependencies } from './dependenciesAny/dependenciesBitOr.generated.js';\nexport { bitOrTransformDependencies } from './dependenciesAny/dependenciesBitOrTransform.generated.js';\nexport { bitXorDependencies } from './dependenciesAny/dependenciesBitXor.generated.js';\nexport { BlockNodeDependencies } from './dependenciesAny/dependenciesBlockNode.generated.js';\nexport { bohrMagnetonDependencies } from './dependenciesAny/dependenciesBohrMagneton.generated.js';\nexport { bohrRadiusDependencies } from './dependenciesAny/dependenciesBohrRadius.generated.js';\nexport { boltzmannDependencies } from './dependenciesAny/dependenciesBoltzmann.generated.js';\nexport { booleanDependencies } from './dependenciesAny/dependenciesBoolean.generated.js';\nexport { catalanDependencies } from './dependenciesAny/dependenciesCatalan.generated.js';\nexport { cbrtDependencies } from './dependenciesAny/dependenciesCbrt.generated.js';\nexport { ceilDependencies } from './dependenciesAny/dependenciesCeil.generated.js';\nexport { chainDependencies } from './dependenciesAny/dependenciesChain.generated.js';\nexport { ChainDependencies } from './dependenciesAny/dependenciesChainClass.generated.js';\nexport { classicalElectronRadiusDependencies } from './dependenciesAny/dependenciesClassicalElectronRadius.generated.js';\nexport { cloneDependencies } from './dependenciesAny/dependenciesClone.generated.js';\nexport { columnDependencies } from './dependenciesAny/dependenciesColumn.generated.js';\nexport { columnTransformDependencies } from './dependenciesAny/dependenciesColumnTransform.generated.js';\nexport { combinationsDependencies } from './dependenciesAny/dependenciesCombinations.generated.js';\nexport { combinationsWithRepDependencies } from './dependenciesAny/dependenciesCombinationsWithRep.generated.js';\nexport { compareDependencies } from './dependenciesAny/dependenciesCompare.generated.js';\nexport { compareNaturalDependencies } from './dependenciesAny/dependenciesCompareNatural.generated.js';\nexport { compareTextDependencies } from './dependenciesAny/dependenciesCompareText.generated.js';\nexport { compileDependencies } from './dependenciesAny/dependenciesCompile.generated.js';\nexport { complexDependencies } from './dependenciesAny/dependenciesComplex.generated.js';\nexport { ComplexDependencies } from './dependenciesAny/dependenciesComplexClass.generated.js';\nexport { compositionDependencies } from './dependenciesAny/dependenciesComposition.generated.js';\nexport { concatDependencies } from './dependenciesAny/dependenciesConcat.generated.js';\nexport { concatTransformDependencies } from './dependenciesAny/dependenciesConcatTransform.generated.js';\nexport { ConditionalNodeDependencies } from './dependenciesAny/dependenciesConditionalNode.generated.js';\nexport { conductanceQuantumDependencies } from './dependenciesAny/dependenciesConductanceQuantum.generated.js';\nexport { conjDependencies } from './dependenciesAny/dependenciesConj.generated.js';\nexport { ConstantNodeDependencies } from './dependenciesAny/dependenciesConstantNode.generated.js';\nexport { corrDependencies } from './dependenciesAny/dependenciesCorr.generated.js';\nexport { cosDependencies } from './dependenciesAny/dependenciesCos.generated.js';\nexport { coshDependencies } from './dependenciesAny/dependenciesCosh.generated.js';\nexport { cotDependencies } from './dependenciesAny/dependenciesCot.generated.js';\nexport { cothDependencies } from './dependenciesAny/dependenciesCoth.generated.js';\nexport { coulombDependencies } from './dependenciesAny/dependenciesCoulomb.generated.js';\nexport { countDependencies } from './dependenciesAny/dependenciesCount.generated.js';\nexport { createUnitDependencies } from './dependenciesAny/dependenciesCreateUnit.generated.js';\nexport { crossDependencies } from './dependenciesAny/dependenciesCross.generated.js';\nexport { cscDependencies } from './dependenciesAny/dependenciesCsc.generated.js';\nexport { cschDependencies } from './dependenciesAny/dependenciesCsch.generated.js';\nexport { ctransposeDependencies } from './dependenciesAny/dependenciesCtranspose.generated.js';\nexport { cubeDependencies } from './dependenciesAny/dependenciesCube.generated.js';\nexport { cumsumDependencies } from './dependenciesAny/dependenciesCumSum.generated.js';\nexport { cumsumTransformDependencies } from './dependenciesAny/dependenciesCumSumTransform.generated.js';\nexport { deepEqualDependencies } from './dependenciesAny/dependenciesDeepEqual.generated.js';\nexport { DenseMatrixDependencies } from './dependenciesAny/dependenciesDenseMatrixClass.generated.js';\nexport { derivativeDependencies } from './dependenciesAny/dependenciesDerivative.generated.js';\nexport { detDependencies } from './dependenciesAny/dependenciesDet.generated.js';\nexport { deuteronMassDependencies } from './dependenciesAny/dependenciesDeuteronMass.generated.js';\nexport { diagDependencies } from './dependenciesAny/dependenciesDiag.generated.js';\nexport { diffDependencies } from './dependenciesAny/dependenciesDiff.generated.js';\nexport { diffTransformDependencies } from './dependenciesAny/dependenciesDiffTransform.generated.js';\nexport { distanceDependencies } from './dependenciesAny/dependenciesDistance.generated.js';\nexport { divideDependencies } from './dependenciesAny/dependenciesDivide.generated.js';\nexport { divideScalarDependencies } from './dependenciesAny/dependenciesDivideScalar.generated.js';\nexport { dotDependencies } from './dependenciesAny/dependenciesDot.generated.js';\nexport { dotDivideDependencies } from './dependenciesAny/dependenciesDotDivide.generated.js';\nexport { dotMultiplyDependencies } from './dependenciesAny/dependenciesDotMultiply.generated.js';\nexport { dotPowDependencies } from './dependenciesAny/dependenciesDotPow.generated.js';\nexport { eDependencies } from './dependenciesAny/dependenciesE.generated.js';\nexport { efimovFactorDependencies } from './dependenciesAny/dependenciesEfimovFactor.generated.js';\nexport { eigsDependencies } from './dependenciesAny/dependenciesEigs.generated.js';\nexport { electricConstantDependencies } from './dependenciesAny/dependenciesElectricConstant.generated.js';\nexport { electronMassDependencies } from './dependenciesAny/dependenciesElectronMass.generated.js';\nexport { elementaryChargeDependencies } from './dependenciesAny/dependenciesElementaryCharge.generated.js';\nexport { equalDependencies } from './dependenciesAny/dependenciesEqual.generated.js';\nexport { equalScalarDependencies } from './dependenciesAny/dependenciesEqualScalar.generated.js';\nexport { equalTextDependencies } from './dependenciesAny/dependenciesEqualText.generated.js';\nexport { erfDependencies } from './dependenciesAny/dependenciesErf.generated.js';\nexport { evaluateDependencies } from './dependenciesAny/dependenciesEvaluate.generated.js';\nexport { expDependencies } from './dependenciesAny/dependenciesExp.generated.js';\nexport { expmDependencies } from './dependenciesAny/dependenciesExpm.generated.js';\nexport { expm1Dependencies } from './dependenciesAny/dependenciesExpm1.generated.js';\nexport { factorialDependencies } from './dependenciesAny/dependenciesFactorial.generated.js';\nexport { falseDependencies } from './dependenciesAny/dependenciesFalse.generated.js';\nexport { faradayDependencies } from './dependenciesAny/dependenciesFaraday.generated.js';\nexport { fermiCouplingDependencies } from './dependenciesAny/dependenciesFermiCoupling.generated.js';\nexport { fftDependencies } from './dependenciesAny/dependenciesFft.generated.js';\nexport { FibonacciHeapDependencies } from './dependenciesAny/dependenciesFibonacciHeapClass.generated.js';\nexport { filterDependencies } from './dependenciesAny/dependenciesFilter.generated.js';\nexport { filterTransformDependencies } from './dependenciesAny/dependenciesFilterTransform.generated.js';\nexport { fineStructureDependencies } from './dependenciesAny/dependenciesFineStructure.generated.js';\nexport { firstRadiationDependencies } from './dependenciesAny/dependenciesFirstRadiation.generated.js';\nexport { fixDependencies } from './dependenciesAny/dependenciesFix.generated.js';\nexport { flattenDependencies } from './dependenciesAny/dependenciesFlatten.generated.js';\nexport { floorDependencies } from './dependenciesAny/dependenciesFloor.generated.js';\nexport { forEachDependencies } from './dependenciesAny/dependenciesForEach.generated.js';\nexport { forEachTransformDependencies } from './dependenciesAny/dependenciesForEachTransform.generated.js';\nexport { formatDependencies } from './dependenciesAny/dependenciesFormat.generated.js';\nexport { fractionDependencies } from './dependenciesAny/dependenciesFraction.generated.js';\nexport { FractionDependencies } from './dependenciesAny/dependenciesFractionClass.generated.js';\nexport { freqzDependencies } from './dependenciesAny/dependenciesFreqz.generated.js';\nexport { FunctionAssignmentNodeDependencies } from './dependenciesAny/dependenciesFunctionAssignmentNode.generated.js';\nexport { FunctionNodeDependencies } from './dependenciesAny/dependenciesFunctionNode.generated.js';\nexport { gammaDependencies } from './dependenciesAny/dependenciesGamma.generated.js';\nexport { gasConstantDependencies } from './dependenciesAny/dependenciesGasConstant.generated.js';\nexport { gcdDependencies } from './dependenciesAny/dependenciesGcd.generated.js';\nexport { getMatrixDataTypeDependencies } from './dependenciesAny/dependenciesGetMatrixDataType.generated.js';\nexport { gravitationConstantDependencies } from './dependenciesAny/dependenciesGravitationConstant.generated.js';\nexport { gravityDependencies } from './dependenciesAny/dependenciesGravity.generated.js';\nexport { hartreeEnergyDependencies } from './dependenciesAny/dependenciesHartreeEnergy.generated.js';\nexport { hasNumericValueDependencies } from './dependenciesAny/dependenciesHasNumericValue.generated.js';\nexport { helpDependencies } from './dependenciesAny/dependenciesHelp.generated.js';\nexport { HelpDependencies } from './dependenciesAny/dependenciesHelpClass.generated.js';\nexport { hexDependencies } from './dependenciesAny/dependenciesHex.generated.js';\nexport { hypotDependencies } from './dependenciesAny/dependenciesHypot.generated.js';\nexport { iDependencies } from './dependenciesAny/dependenciesI.generated.js';\nexport { identityDependencies } from './dependenciesAny/dependenciesIdentity.generated.js';\nexport { ifftDependencies } from './dependenciesAny/dependenciesIfft.generated.js';\nexport { imDependencies } from './dependenciesAny/dependenciesIm.generated.js';\nexport { ImmutableDenseMatrixDependencies } from './dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js';\nexport { indexDependencies } from './dependenciesAny/dependenciesIndex.generated.js';\nexport { IndexDependencies } from './dependenciesAny/dependenciesIndexClass.generated.js';\nexport { IndexNodeDependencies } from './dependenciesAny/dependenciesIndexNode.generated.js';\nexport { indexTransformDependencies } from './dependenciesAny/dependenciesIndexTransform.generated.js';\nexport { InfinityDependencies } from './dependenciesAny/dependenciesInfinity.generated.js';\nexport { intersectDependencies } from './dependenciesAny/dependenciesIntersect.generated.js';\nexport { invDependencies } from './dependenciesAny/dependenciesInv.generated.js';\nexport { inverseConductanceQuantumDependencies } from './dependenciesAny/dependenciesInverseConductanceQuantum.generated.js';\nexport { invmodDependencies } from './dependenciesAny/dependenciesInvmod.generated.js';\nexport { isIntegerDependencies } from './dependenciesAny/dependenciesIsInteger.generated.js';\nexport { isNaNDependencies } from './dependenciesAny/dependenciesIsNaN.generated.js';\nexport { isNegativeDependencies } from './dependenciesAny/dependenciesIsNegative.generated.js';\nexport { isNumericDependencies } from './dependenciesAny/dependenciesIsNumeric.generated.js';\nexport { isPositiveDependencies } from './dependenciesAny/dependenciesIsPositive.generated.js';\nexport { isPrimeDependencies } from './dependenciesAny/dependenciesIsPrime.generated.js';\nexport { isZeroDependencies } from './dependenciesAny/dependenciesIsZero.generated.js';\nexport { kldivergenceDependencies } from './dependenciesAny/dependenciesKldivergence.generated.js';\nexport { klitzingDependencies } from './dependenciesAny/dependenciesKlitzing.generated.js';\nexport { kronDependencies } from './dependenciesAny/dependenciesKron.generated.js';\nexport { LN10Dependencies } from './dependenciesAny/dependenciesLN10.generated.js';\nexport { LN2Dependencies } from './dependenciesAny/dependenciesLN2.generated.js';\nexport { LOG10EDependencies } from './dependenciesAny/dependenciesLOG10E.generated.js';\nexport { LOG2EDependencies } from './dependenciesAny/dependenciesLOG2E.generated.js';\nexport { largerDependencies } from './dependenciesAny/dependenciesLarger.generated.js';\nexport { largerEqDependencies } from './dependenciesAny/dependenciesLargerEq.generated.js';\nexport { lcmDependencies } from './dependenciesAny/dependenciesLcm.generated.js';\nexport { leafCountDependencies } from './dependenciesAny/dependenciesLeafCount.generated.js';\nexport { leftShiftDependencies } from './dependenciesAny/dependenciesLeftShift.generated.js';\nexport { lgammaDependencies } from './dependenciesAny/dependenciesLgamma.generated.js';\nexport { logDependencies } from './dependenciesAny/dependenciesLog.generated.js';\nexport { log10Dependencies } from './dependenciesAny/dependenciesLog10.generated.js';\nexport { log1pDependencies } from './dependenciesAny/dependenciesLog1p.generated.js';\nexport { log2Dependencies } from './dependenciesAny/dependenciesLog2.generated.js';\nexport { loschmidtDependencies } from './dependenciesAny/dependenciesLoschmidt.generated.js';\nexport { lsolveDependencies } from './dependenciesAny/dependenciesLsolve.generated.js';\nexport { lsolveAllDependencies } from './dependenciesAny/dependenciesLsolveAll.generated.js';\nexport { lupDependencies } from './dependenciesAny/dependenciesLup.generated.js';\nexport { lusolveDependencies } from './dependenciesAny/dependenciesLusolve.generated.js';\nexport { lyapDependencies } from './dependenciesAny/dependenciesLyap.generated.js';\nexport { madDependencies } from './dependenciesAny/dependenciesMad.generated.js';\nexport { magneticConstantDependencies } from './dependenciesAny/dependenciesMagneticConstant.generated.js';\nexport { magneticFluxQuantumDependencies } from './dependenciesAny/dependenciesMagneticFluxQuantum.generated.js';\nexport { mapDependencies } from './dependenciesAny/dependenciesMap.generated.js';\nexport { mapTransformDependencies } from './dependenciesAny/dependenciesMapTransform.generated.js';\nexport { matrixDependencies } from './dependenciesAny/dependenciesMatrix.generated.js';\nexport { MatrixDependencies } from './dependenciesAny/dependenciesMatrixClass.generated.js';\nexport { matrixFromColumnsDependencies } from './dependenciesAny/dependenciesMatrixFromColumns.generated.js';\nexport { matrixFromFunctionDependencies } from './dependenciesAny/dependenciesMatrixFromFunction.generated.js';\nexport { matrixFromRowsDependencies } from './dependenciesAny/dependenciesMatrixFromRows.generated.js';\nexport { maxDependencies } from './dependenciesAny/dependenciesMax.generated.js';\nexport { maxTransformDependencies } from './dependenciesAny/dependenciesMaxTransform.generated.js';\nexport { meanDependencies } from './dependenciesAny/dependenciesMean.generated.js';\nexport { meanTransformDependencies } from './dependenciesAny/dependenciesMeanTransform.generated.js';\nexport { medianDependencies } from './dependenciesAny/dependenciesMedian.generated.js';\nexport { minDependencies } from './dependenciesAny/dependenciesMin.generated.js';\nexport { minTransformDependencies } from './dependenciesAny/dependenciesMinTransform.generated.js';\nexport { modDependencies } from './dependenciesAny/dependenciesMod.generated.js';\nexport { modeDependencies } from './dependenciesAny/dependenciesMode.generated.js';\nexport { molarMassDependencies } from './dependenciesAny/dependenciesMolarMass.generated.js';\nexport { molarMassC12Dependencies } from './dependenciesAny/dependenciesMolarMassC12.generated.js';\nexport { molarPlanckConstantDependencies } from './dependenciesAny/dependenciesMolarPlanckConstant.generated.js';\nexport { molarVolumeDependencies } from './dependenciesAny/dependenciesMolarVolume.generated.js';\nexport { multinomialDependencies } from './dependenciesAny/dependenciesMultinomial.generated.js';\nexport { multiplyDependencies } from './dependenciesAny/dependenciesMultiply.generated.js';\nexport { multiplyScalarDependencies } from './dependenciesAny/dependenciesMultiplyScalar.generated.js';\nexport { NaNDependencies } from './dependenciesAny/dependenciesNaN.generated.js';\nexport { neutronMassDependencies } from './dependenciesAny/dependenciesNeutronMass.generated.js';\nexport { NodeDependencies } from './dependenciesAny/dependenciesNode.generated.js';\nexport { normDependencies } from './dependenciesAny/dependenciesNorm.generated.js';\nexport { notDependencies } from './dependenciesAny/dependenciesNot.generated.js';\nexport { nthRootDependencies } from './dependenciesAny/dependenciesNthRoot.generated.js';\nexport { nthRootsDependencies } from './dependenciesAny/dependenciesNthRoots.generated.js';\nexport { nuclearMagnetonDependencies } from './dependenciesAny/dependenciesNuclearMagneton.generated.js';\nexport { nullDependencies } from './dependenciesAny/dependenciesNull.generated.js';\nexport { numberDependencies } from './dependenciesAny/dependenciesNumber.generated.js';\nexport { numericDependencies } from './dependenciesAny/dependenciesNumeric.generated.js';\nexport { ObjectNodeDependencies } from './dependenciesAny/dependenciesObjectNode.generated.js';\nexport { octDependencies } from './dependenciesAny/dependenciesOct.generated.js';\nexport { onesDependencies } from './dependenciesAny/dependenciesOnes.generated.js';\nexport { OperatorNodeDependencies } from './dependenciesAny/dependenciesOperatorNode.generated.js';\nexport { orDependencies } from './dependenciesAny/dependenciesOr.generated.js';\nexport { orTransformDependencies } from './dependenciesAny/dependenciesOrTransform.generated.js';\nexport { ParenthesisNodeDependencies } from './dependenciesAny/dependenciesParenthesisNode.generated.js';\nexport { parseDependencies } from './dependenciesAny/dependenciesParse.generated.js';\nexport { parserDependencies } from './dependenciesAny/dependenciesParser.generated.js';\nexport { ParserDependencies } from './dependenciesAny/dependenciesParserClass.generated.js';\nexport { partitionSelectDependencies } from './dependenciesAny/dependenciesPartitionSelect.generated.js';\nexport { permutationsDependencies } from './dependenciesAny/dependenciesPermutations.generated.js';\nexport { phiDependencies } from './dependenciesAny/dependenciesPhi.generated.js';\nexport { piDependencies } from './dependenciesAny/dependenciesPi.generated.js';\nexport { pickRandomDependencies } from './dependenciesAny/dependenciesPickRandom.generated.js';\nexport { pinvDependencies } from './dependenciesAny/dependenciesPinv.generated.js';\nexport { planckChargeDependencies } from './dependenciesAny/dependenciesPlanckCharge.generated.js';\nexport { planckConstantDependencies } from './dependenciesAny/dependenciesPlanckConstant.generated.js';\nexport { planckLengthDependencies } from './dependenciesAny/dependenciesPlanckLength.generated.js';\nexport { planckMassDependencies } from './dependenciesAny/dependenciesPlanckMass.generated.js';\nexport { planckTemperatureDependencies } from './dependenciesAny/dependenciesPlanckTemperature.generated.js';\nexport { planckTimeDependencies } from './dependenciesAny/dependenciesPlanckTime.generated.js';\nexport { polynomialRootDependencies } from './dependenciesAny/dependenciesPolynomialRoot.generated.js';\nexport { powDependencies } from './dependenciesAny/dependenciesPow.generated.js';\nexport { printDependencies } from './dependenciesAny/dependenciesPrint.generated.js';\nexport { printTransformDependencies } from './dependenciesAny/dependenciesPrintTransform.generated.js';\nexport { prodDependencies } from './dependenciesAny/dependenciesProd.generated.js';\nexport { protonMassDependencies } from './dependenciesAny/dependenciesProtonMass.generated.js';\nexport { qrDependencies } from './dependenciesAny/dependenciesQr.generated.js';\nexport { quantileSeqDependencies } from './dependenciesAny/dependenciesQuantileSeq.generated.js';\nexport { quantileSeqTransformDependencies } from './dependenciesAny/dependenciesQuantileSeqTransform.generated.js';\nexport { quantumOfCirculationDependencies } from './dependenciesAny/dependenciesQuantumOfCirculation.generated.js';\nexport { randomDependencies } from './dependenciesAny/dependenciesRandom.generated.js';\nexport { randomIntDependencies } from './dependenciesAny/dependenciesRandomInt.generated.js';\nexport { rangeDependencies } from './dependenciesAny/dependenciesRange.generated.js';\nexport { RangeDependencies } from './dependenciesAny/dependenciesRangeClass.generated.js';\nexport { RangeNodeDependencies } from './dependenciesAny/dependenciesRangeNode.generated.js';\nexport { rangeTransformDependencies } from './dependenciesAny/dependenciesRangeTransform.generated.js';\nexport { rationalizeDependencies } from './dependenciesAny/dependenciesRationalize.generated.js';\nexport { reDependencies } from './dependenciesAny/dependenciesRe.generated.js';\nexport { reducedPlanckConstantDependencies } from './dependenciesAny/dependenciesReducedPlanckConstant.generated.js';\nexport { RelationalNodeDependencies } from './dependenciesAny/dependenciesRelationalNode.generated.js';\nexport { replacerDependencies } from './dependenciesAny/dependenciesReplacer.generated.js';\nexport { reshapeDependencies } from './dependenciesAny/dependenciesReshape.generated.js';\nexport { resizeDependencies } from './dependenciesAny/dependenciesResize.generated.js';\nexport { resolveDependencies } from './dependenciesAny/dependenciesResolve.generated.js';\nexport { ResultSetDependencies } from './dependenciesAny/dependenciesResultSet.generated.js';\nexport { reviverDependencies } from './dependenciesAny/dependenciesReviver.generated.js';\nexport { rightArithShiftDependencies } from './dependenciesAny/dependenciesRightArithShift.generated.js';\nexport { rightLogShiftDependencies } from './dependenciesAny/dependenciesRightLogShift.generated.js';\nexport { rotateDependencies } from './dependenciesAny/dependenciesRotate.generated.js';\nexport { rotationMatrixDependencies } from './dependenciesAny/dependenciesRotationMatrix.generated.js';\nexport { roundDependencies } from './dependenciesAny/dependenciesRound.generated.js';\nexport { rowDependencies } from './dependenciesAny/dependenciesRow.generated.js';\nexport { rowTransformDependencies } from './dependenciesAny/dependenciesRowTransform.generated.js';\nexport { rydbergDependencies } from './dependenciesAny/dependenciesRydberg.generated.js';\nexport { SQRT1_2Dependencies } from './dependenciesAny/dependenciesSQRT1_2.generated.js'; // eslint-disable-line camelcase\nexport { SQRT2Dependencies } from './dependenciesAny/dependenciesSQRT2.generated.js';\nexport { sackurTetrodeDependencies } from './dependenciesAny/dependenciesSackurTetrode.generated.js';\nexport { schurDependencies } from './dependenciesAny/dependenciesSchur.generated.js';\nexport { secDependencies } from './dependenciesAny/dependenciesSec.generated.js';\nexport { sechDependencies } from './dependenciesAny/dependenciesSech.generated.js';\nexport { secondRadiationDependencies } from './dependenciesAny/dependenciesSecondRadiation.generated.js';\nexport { setCartesianDependencies } from './dependenciesAny/dependenciesSetCartesian.generated.js';\nexport { setDifferenceDependencies } from './dependenciesAny/dependenciesSetDifference.generated.js';\nexport { setDistinctDependencies } from './dependenciesAny/dependenciesSetDistinct.generated.js';\nexport { setIntersectDependencies } from './dependenciesAny/dependenciesSetIntersect.generated.js';\nexport { setIsSubsetDependencies } from './dependenciesAny/dependenciesSetIsSubset.generated.js';\nexport { setMultiplicityDependencies } from './dependenciesAny/dependenciesSetMultiplicity.generated.js';\nexport { setPowersetDependencies } from './dependenciesAny/dependenciesSetPowerset.generated.js';\nexport { setSizeDependencies } from './dependenciesAny/dependenciesSetSize.generated.js';\nexport { setSymDifferenceDependencies } from './dependenciesAny/dependenciesSetSymDifference.generated.js';\nexport { setUnionDependencies } from './dependenciesAny/dependenciesSetUnion.generated.js';\nexport { signDependencies } from './dependenciesAny/dependenciesSign.generated.js';\nexport { simplifyDependencies } from './dependenciesAny/dependenciesSimplify.generated.js';\nexport { simplifyConstantDependencies } from './dependenciesAny/dependenciesSimplifyConstant.generated.js';\nexport { simplifyCoreDependencies } from './dependenciesAny/dependenciesSimplifyCore.generated.js';\nexport { sinDependencies } from './dependenciesAny/dependenciesSin.generated.js';\nexport { sinhDependencies } from './dependenciesAny/dependenciesSinh.generated.js';\nexport { sizeDependencies } from './dependenciesAny/dependenciesSize.generated.js';\nexport { sluDependencies } from './dependenciesAny/dependenciesSlu.generated.js';\nexport { smallerDependencies } from './dependenciesAny/dependenciesSmaller.generated.js';\nexport { smallerEqDependencies } from './dependenciesAny/dependenciesSmallerEq.generated.js';\nexport { solveODEDependencies } from './dependenciesAny/dependenciesSolveODE.generated.js';\nexport { sortDependencies } from './dependenciesAny/dependenciesSort.generated.js';\nexport { SpaDependencies } from './dependenciesAny/dependenciesSpaClass.generated.js';\nexport { sparseDependencies } from './dependenciesAny/dependenciesSparse.generated.js';\nexport { SparseMatrixDependencies } from './dependenciesAny/dependenciesSparseMatrixClass.generated.js';\nexport { speedOfLightDependencies } from './dependenciesAny/dependenciesSpeedOfLight.generated.js';\nexport { splitUnitDependencies } from './dependenciesAny/dependenciesSplitUnit.generated.js';\nexport { sqrtDependencies } from './dependenciesAny/dependenciesSqrt.generated.js';\nexport { sqrtmDependencies } from './dependenciesAny/dependenciesSqrtm.generated.js';\nexport { squareDependencies } from './dependenciesAny/dependenciesSquare.generated.js';\nexport { squeezeDependencies } from './dependenciesAny/dependenciesSqueeze.generated.js';\nexport { stdDependencies } from './dependenciesAny/dependenciesStd.generated.js';\nexport { stdTransformDependencies } from './dependenciesAny/dependenciesStdTransform.generated.js';\nexport { stefanBoltzmannDependencies } from './dependenciesAny/dependenciesStefanBoltzmann.generated.js';\nexport { stirlingS2Dependencies } from './dependenciesAny/dependenciesStirlingS2.generated.js';\nexport { stringDependencies } from './dependenciesAny/dependenciesString.generated.js';\nexport { subsetDependencies } from './dependenciesAny/dependenciesSubset.generated.js';\nexport { subsetTransformDependencies } from './dependenciesAny/dependenciesSubsetTransform.generated.js';\nexport { subtractDependencies } from './dependenciesAny/dependenciesSubtract.generated.js';\nexport { subtractScalarDependencies } from './dependenciesAny/dependenciesSubtractScalar.generated.js';\nexport { sumDependencies } from './dependenciesAny/dependenciesSum.generated.js';\nexport { sumTransformDependencies } from './dependenciesAny/dependenciesSumTransform.generated.js';\nexport { sylvesterDependencies } from './dependenciesAny/dependenciesSylvester.generated.js';\nexport { SymbolNodeDependencies } from './dependenciesAny/dependenciesSymbolNode.generated.js';\nexport { symbolicEqualDependencies } from './dependenciesAny/dependenciesSymbolicEqual.generated.js';\nexport { tanDependencies } from './dependenciesAny/dependenciesTan.generated.js';\nexport { tanhDependencies } from './dependenciesAny/dependenciesTanh.generated.js';\nexport { tauDependencies } from './dependenciesAny/dependenciesTau.generated.js';\nexport { thomsonCrossSectionDependencies } from './dependenciesAny/dependenciesThomsonCrossSection.generated.js';\nexport { toDependencies } from './dependenciesAny/dependenciesTo.generated.js';\nexport { traceDependencies } from './dependenciesAny/dependenciesTrace.generated.js';\nexport { transposeDependencies } from './dependenciesAny/dependenciesTranspose.generated.js';\nexport { trueDependencies } from './dependenciesAny/dependenciesTrue.generated.js';\nexport { typeOfDependencies } from './dependenciesAny/dependenciesTypeOf.generated.js';\nexport { typedDependencies } from './dependenciesAny/dependenciesTyped.generated.js';\nexport { unaryMinusDependencies } from './dependenciesAny/dependenciesUnaryMinus.generated.js';\nexport { unaryPlusDependencies } from './dependenciesAny/dependenciesUnaryPlus.generated.js';\nexport { unequalDependencies } from './dependenciesAny/dependenciesUnequal.generated.js';\nexport { UnitDependencies } from './dependenciesAny/dependenciesUnitClass.generated.js';\nexport { unitDependencies } from './dependenciesAny/dependenciesUnitFunction.generated.js';\nexport { EDependencies } from './dependenciesAny/dependenciesUppercaseE.generated.js';\nexport { PIDependencies } from './dependenciesAny/dependenciesUppercasePi.generated.js';\nexport { usolveDependencies } from './dependenciesAny/dependenciesUsolve.generated.js';\nexport { usolveAllDependencies } from './dependenciesAny/dependenciesUsolveAll.generated.js';\nexport { vacuumImpedanceDependencies } from './dependenciesAny/dependenciesVacuumImpedance.generated.js';\nexport { varianceDependencies } from './dependenciesAny/dependenciesVariance.generated.js';\nexport { varianceTransformDependencies } from './dependenciesAny/dependenciesVarianceTransform.generated.js';\nexport { versionDependencies } from './dependenciesAny/dependenciesVersion.generated.js';\nexport { weakMixingAngleDependencies } from './dependenciesAny/dependenciesWeakMixingAngle.generated.js';\nexport { wienDisplacementDependencies } from './dependenciesAny/dependenciesWienDisplacement.generated.js';\nexport { xgcdDependencies } from './dependenciesAny/dependenciesXgcd.generated.js';\nexport { xorDependencies } from './dependenciesAny/dependenciesXor.generated.js';\nexport { zerosDependencies } from './dependenciesAny/dependenciesZeros.generated.js';\nexport { zetaDependencies } from './dependenciesAny/dependenciesZeta.generated.js';\nexport { zpk2tfDependencies } from './dependenciesAny/dependenciesZpk2tf.generated.js';\nexport { all } from './allFactoriesAny.js';", "// creating all factories here in a separate file is needed to get tree-shaking working\nimport * as allFactories from '../factoriesAny.js';\nexport var all = allFactories;", "import _extends from \"@babel/runtime/helpers/extends\";\nimport typedFunction from 'typed-function';\nimport { deepFlatten, isLegacyFactory } from '../utils/object.js';\nimport * as emitter from './../utils/emitter.js';\nimport { importFactory } from './function/import.js';\nimport { configFactory } from './function/config.js';\nimport { factory, isFactory } from '../utils/factory.js';\nimport { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigNumber, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMatrix, isNode, isNull, isNumber, isObject, isObjectNode, isOperatorNode, isParenthesisNode, isRange, isRangeNode, isRelationalNode, isRegExp, isResultSet, isSparseMatrix, isString, isSymbolNode, isUndefined, isUnit, isBigInt } from '../utils/is.js';\nimport { ArgumentsError } from '../error/ArgumentsError.js';\nimport { DimensionError } from '../error/DimensionError.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { DEFAULT_CONFIG } from './config.js';\n\n/**\n * Create a mathjs instance from given factory functions and optionally config\n *\n * Usage:\n *\n * const mathjs1 = create({ createAdd, createMultiply, ...})\n * const config = { number: 'BigNumber' }\n * const mathjs2 = create(all, config)\n *\n * @param {Object} [factories] An object with factory functions\n * The object can contain nested objects,\n * all nested objects will be flattened.\n * @param {Object} [config] Available options:\n * {number} relTol\n * Minimum relative difference between two\n * compared values, used by all comparison functions.\n * {number} absTol\n * Minimum absolute difference between two\n * compared values, used by all comparison functions.\n * {string} matrix\n * A string 'Matrix' (default) or 'Array'.\n * {string} number\n * A string 'number' (default), 'BigNumber', or 'Fraction'\n * {number} precision\n * The number of significant digits for BigNumbers.\n * Not applicable for Numbers.\n * {boolean} predictable\n * Predictable output type of functions. When true,\n * output type depends only on the input types. When\n * false (default), output type can vary depending\n * on input values. For example `math.sqrt(-4)`\n * returns `complex('2i')` when predictable is false, and\n * returns `NaN` when true.\n * {string} randomSeed\n * Random seed for seeded pseudo random number generator.\n * Set to null to randomly seed.\n * @returns {Object} Returns a bare-bone math.js instance containing\n * functions:\n * - `import` to add new functions\n * - `config` to change configuration\n * - `on`, `off`, `once`, `emit` for events\n */\nexport function create(factories, config) {\n var configInternal = _extends({}, DEFAULT_CONFIG, config);\n\n // simple test for ES5 support\n if (typeof Object.create !== 'function') {\n throw new Error('ES5 not supported by this JavaScript engine. ' + 'Please load the es5-shim and es5-sham library for compatibility.');\n }\n\n // create the mathjs instance\n var math = emitter.mixin({\n // only here for backward compatibility for legacy factory functions\n isNumber,\n isComplex,\n isBigNumber,\n isBigInt,\n isFraction,\n isUnit,\n isString,\n isArray,\n isMatrix,\n isCollection,\n isDenseMatrix,\n isSparseMatrix,\n isRange,\n isIndex,\n isBoolean,\n isResultSet,\n isHelp,\n isFunction,\n isDate,\n isRegExp,\n isObject,\n isNull,\n isUndefined,\n isAccessorNode,\n isArrayNode,\n isAssignmentNode,\n isBlockNode,\n isConditionalNode,\n isConstantNode,\n isFunctionAssignmentNode,\n isFunctionNode,\n isIndexNode,\n isNode,\n isObjectNode,\n isOperatorNode,\n isParenthesisNode,\n isRangeNode,\n isRelationalNode,\n isSymbolNode,\n isChain\n });\n\n // load config function and apply provided config\n math.config = configFactory(configInternal, math.emit);\n math.expression = {\n transform: {},\n mathWithTransform: {\n config: math.config\n }\n };\n\n // cached factories and instances used by function load\n var legacyFactories = [];\n var legacyInstances = [];\n\n /**\n * Load a function or data type from a factory.\n * If the function or data type already exists, the existing instance is\n * returned.\n * @param {Function} factory\n * @returns {*}\n */\n function load(factory) {\n if (isFactory(factory)) {\n return factory(math);\n }\n var firstProperty = factory[Object.keys(factory)[0]];\n if (isFactory(firstProperty)) {\n return firstProperty(math);\n }\n if (!isLegacyFactory(factory)) {\n console.warn('Factory object with properties `type`, `name`, and `factory` expected', factory);\n throw new Error('Factory object with properties `type`, `name`, and `factory` expected');\n }\n var index = legacyFactories.indexOf(factory);\n var instance;\n if (index === -1) {\n // doesn't yet exist\n if (factory.math === true) {\n // pass with math namespace\n instance = factory.factory(math.type, configInternal, load, math.typed, math);\n } else {\n instance = factory.factory(math.type, configInternal, load, math.typed);\n }\n\n // append to the cache\n legacyFactories.push(factory);\n legacyInstances.push(instance);\n } else {\n // already existing function, return the cached instance\n instance = legacyInstances[index];\n }\n return instance;\n }\n var importedFactories = {};\n\n // load the import function\n function lazyTyped() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return math.typed.apply(math.typed, args);\n }\n lazyTyped.isTypedFunction = typedFunction.isTypedFunction;\n var internalImport = importFactory(lazyTyped, load, math, importedFactories);\n math.import = internalImport;\n\n // listen for changes in config, import all functions again when changed\n // TODO: move this listener into the import function?\n math.on('config', () => {\n Object.values(importedFactories).forEach(factory => {\n if (factory && factory.meta && factory.meta.recreateOnConfigChange) {\n // FIXME: only re-create when the current instance is the same as was initially created\n // FIXME: delete the functions/constants before importing them again?\n internalImport(factory, {\n override: true\n });\n }\n });\n });\n\n // the create function exposed on the mathjs instance is bound to\n // the factory functions passed before\n math.create = create.bind(null, factories);\n\n // export factory function\n math.factory = factory;\n\n // import the factory functions like createAdd as an array instead of object,\n // else they will get a different naming (`createAdd` instead of `add`).\n math.import(Object.values(deepFlatten(factories)));\n math.ArgumentsError = ArgumentsError;\n math.DimensionError = DimensionError;\n math.IndexError = IndexError;\n return math;\n}", "import Emitter from 'tiny-emitter';\n\n/**\n * Extend given object with emitter functions `on`, `off`, `once`, `emit`\n * @param {Object} obj\n * @return {Object} obj\n */\nexport function mixin(obj) {\n // create event emitter\n var emitter = new Emitter();\n\n // bind methods to obj (we don't want to expose the emitter.e Array...)\n obj.on = emitter.on.bind(emitter);\n obj.off = emitter.off.bind(emitter);\n obj.once = emitter.once.bind(emitter);\n obj.emit = emitter.emit.bind(emitter);\n return obj;\n}", "import { isBigNumber, isComplex, isFraction, isMatrix, isUnit } from '../../utils/is.js';\nimport { isFactory, stripOptionalNotation } from '../../utils/factory.js';\nimport { hasOwnProperty, lazy } from '../../utils/object.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nexport function importFactory(typed, load, math, importedFactories) {\n /**\n * Import functions from an object or a module.\n *\n * This function is only available on a mathjs instance created using `create`.\n *\n * Syntax:\n *\n * math.import(functions)\n * math.import(functions, options)\n *\n * Where:\n *\n * - `functions: Object`\n * An object with functions or factories to be imported.\n * - `options: Object` An object with import options. Available options:\n * - `override: boolean`\n * If true, existing functions will be overwritten. False by default.\n * - `silent: boolean`\n * If true, the function will not throw errors on duplicates or invalid\n * types. False by default.\n * - `wrap: boolean`\n * If true, the functions will be wrapped in a wrapper function\n * which converts data types like Matrix to primitive data types like Array.\n * The wrapper is needed when extending math.js with libraries which do not\n * support these data type. False by default.\n *\n * Examples:\n *\n * import { create, all } from 'mathjs'\n * import * as numbers from 'numbers'\n *\n * // create a mathjs instance\n * const math = create(all)\n *\n * // define new functions and variables\n * math.import({\n * myvalue: 42,\n * hello: function (name) {\n * return 'hello, ' + name + '!'\n * }\n * })\n *\n * // use the imported function and variable\n * math.myvalue * 2 // 84\n * math.hello('user') // 'hello, user!'\n *\n * // import the npm module 'numbers'\n * // (must be installed first with `npm install numbers`)\n * math.import(numbers, {wrap: true})\n *\n * math.fibonacci(7) // returns 13\n *\n * @param {Object | Array} functions Object with functions to be imported.\n * @param {Object} [options] Import options.\n */\n function mathImport(functions, options) {\n var num = arguments.length;\n if (num !== 1 && num !== 2) {\n throw new ArgumentsError('import', num, 1, 2);\n }\n if (!options) {\n options = {};\n }\n function flattenImports(flatValues, value, name) {\n if (Array.isArray(value)) {\n value.forEach(item => flattenImports(flatValues, item));\n } else if (typeof value === 'object') {\n for (var _name in value) {\n if (hasOwnProperty(value, _name)) {\n flattenImports(flatValues, value[_name], _name);\n }\n }\n } else if (isFactory(value) || name !== undefined) {\n var flatName = isFactory(value) ? isTransformFunctionFactory(value) ? value.fn + '.transform' // TODO: this is ugly\n : value.fn : name;\n\n // we allow importing the same function twice if it points to the same implementation\n if (hasOwnProperty(flatValues, flatName) && flatValues[flatName] !== value && !options.silent) {\n throw new Error('Cannot import \"' + flatName + '\" twice');\n }\n flatValues[flatName] = value;\n } else {\n if (!options.silent) {\n throw new TypeError('Factory, Object, or Array expected');\n }\n }\n }\n var flatValues = {};\n flattenImports(flatValues, functions);\n for (var name in flatValues) {\n if (hasOwnProperty(flatValues, name)) {\n // console.log('import', name)\n var value = flatValues[name];\n if (isFactory(value)) {\n // we ignore name here and enforce the name of the factory\n // maybe at some point we do want to allow overriding it\n // in that case we can implement an option overrideFactoryNames: true\n _importFactory(value, options);\n } else if (isSupportedType(value)) {\n _import(name, value, options);\n } else {\n if (!options.silent) {\n throw new TypeError('Factory, Object, or Array expected');\n }\n }\n }\n }\n }\n\n /**\n * Add a property to the math namespace\n * @param {string} name\n * @param {*} value\n * @param {Object} options See import for a description of the options\n * @private\n */\n function _import(name, value, options) {\n // TODO: refactor this function, it's to complicated and contains duplicate code\n if (options.wrap && typeof value === 'function') {\n // create a wrapper around the function\n value = _wrap(value);\n }\n\n // turn a plain function with a typed-function signature into a typed-function\n if (hasTypedFunctionSignature(value)) {\n value = typed(name, {\n [value.signature]: value\n });\n }\n if (typed.isTypedFunction(math[name]) && typed.isTypedFunction(value)) {\n if (options.override) {\n // give the typed function the right name\n value = typed(name, value.signatures);\n } else {\n // merge the existing and typed function\n value = typed(math[name], value);\n }\n math[name] = value;\n delete importedFactories[name];\n _importTransform(name, value);\n math.emit('import', name, function resolver() {\n return value;\n });\n return;\n }\n if (math[name] === undefined || options.override) {\n math[name] = value;\n delete importedFactories[name];\n _importTransform(name, value);\n math.emit('import', name, function resolver() {\n return value;\n });\n return;\n }\n if (!options.silent) {\n throw new Error('Cannot import \"' + name + '\": already exists');\n }\n }\n function _importTransform(name, value) {\n if (value && typeof value.transform === 'function') {\n math.expression.transform[name] = value.transform;\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = value.transform;\n }\n } else {\n // remove existing transform\n delete math.expression.transform[name];\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = value;\n }\n }\n }\n function _deleteTransform(name) {\n delete math.expression.transform[name];\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = math[name];\n } else {\n delete math.expression.mathWithTransform[name];\n }\n }\n\n /**\n * Create a wrapper a round an function which converts the arguments\n * to their primitive values (like convert a Matrix to Array)\n * @param {Function} fn\n * @return {Function} Returns the wrapped function\n * @private\n */\n function _wrap(fn) {\n var wrapper = function wrapper() {\n var args = [];\n for (var i = 0, len = arguments.length; i < len; i++) {\n var arg = arguments[i];\n args[i] = arg && arg.valueOf();\n }\n return fn.apply(math, args);\n };\n if (fn.transform) {\n wrapper.transform = fn.transform;\n }\n return wrapper;\n }\n\n /**\n * Import an instance of a factory into math.js\n * @param {function(scope: object)} factory\n * @param {Object} options See import for a description of the options\n * @param {string} [name=factory.name] Optional custom name\n * @private\n */\n function _importFactory(factory, options) {\n var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : factory.fn;\n if (name.includes('.')) {\n throw new Error('Factory name should not contain a nested path. ' + 'Name: ' + JSON.stringify(name));\n }\n var namespace = isTransformFunctionFactory(factory) ? math.expression.transform : math;\n var existingTransform = (name in math.expression.transform);\n var existing = hasOwnProperty(namespace, name) ? namespace[name] : undefined;\n var resolver = function resolver() {\n // collect all dependencies, handle finding both functions and classes and other special cases\n var dependencies = {};\n factory.dependencies.map(stripOptionalNotation).forEach(dependency => {\n if (dependency.includes('.')) {\n throw new Error('Factory dependency should not contain a nested path. ' + 'Name: ' + JSON.stringify(dependency));\n }\n if (dependency === 'math') {\n dependencies.math = math;\n } else if (dependency === 'mathWithTransform') {\n dependencies.mathWithTransform = math.expression.mathWithTransform;\n } else if (dependency === 'classes') {\n // special case for json reviver\n dependencies.classes = math;\n } else {\n dependencies[dependency] = math[dependency];\n }\n });\n var instance = /* #__PURE__ */factory(dependencies);\n if (instance && typeof instance.transform === 'function') {\n throw new Error('Transforms cannot be attached to factory functions. ' + 'Please create a separate function for it with export const path = \"expression.transform\"');\n }\n if (existing === undefined || options.override) {\n return instance;\n }\n if (typed.isTypedFunction(existing) && typed.isTypedFunction(instance)) {\n // merge the existing and new typed function\n return typed(existing, instance);\n }\n if (options.silent) {\n // keep existing, ignore imported function\n return existing;\n } else {\n throw new Error('Cannot import \"' + name + '\": already exists');\n }\n };\n\n // TODO: add unit test with non-lazy factory\n if (!factory.meta || factory.meta.lazy !== false) {\n lazy(namespace, name, resolver);\n\n // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two)\n if (existing && existingTransform) {\n _deleteTransform(name);\n } else {\n if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) {\n lazy(math.expression.mathWithTransform, name, () => namespace[name]);\n }\n }\n } else {\n namespace[name] = resolver();\n\n // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two)\n if (existing && existingTransform) {\n _deleteTransform(name);\n } else {\n if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) {\n lazy(math.expression.mathWithTransform, name, () => namespace[name]);\n }\n }\n }\n\n // TODO: improve factories, store a list with imports instead which can be re-played\n importedFactories[name] = factory;\n math.emit('import', name, resolver);\n }\n\n /**\n * Check whether given object is a type which can be imported\n * @param {Function | number | string | boolean | null | Unit | Complex} object\n * @return {boolean}\n * @private\n */\n function isSupportedType(object) {\n return typeof object === 'function' || typeof object === 'number' || typeof object === 'string' || typeof object === 'boolean' || object === null || isUnit(object) || isComplex(object) || isBigNumber(object) || isFraction(object) || isMatrix(object) || Array.isArray(object);\n }\n function hasTypedFunctionSignature(fn) {\n return typeof fn === 'function' && typeof fn.signature === 'string';\n }\n function allowedInExpressions(name) {\n return !hasOwnProperty(unsafe, name);\n }\n function factoryAllowedInExpressions(factory) {\n return !factory.fn.includes('.') &&\n // FIXME: make checking on path redundant, check on meta data instead\n !hasOwnProperty(unsafe, factory.fn) && (!factory.meta || !factory.meta.isClass);\n }\n function isTransformFunctionFactory(factory) {\n return factory !== undefined && factory.meta !== undefined && factory.meta.isTransformFunction === true || false;\n }\n\n // namespaces and functions not available in the parser for safety reasons\n var unsafe = {\n expression: true,\n type: true,\n docs: true,\n error: true,\n json: true,\n chain: true // chain method not supported. Note that there is a unit chain too.\n };\n return mathImport;\n}", "import jStat from 'jstat';\nimport bessel from 'bessel';\n\nconst nil = new Error('#NULL!');\nconst div0 = new Error('#DIV/0!');\nconst value = new Error('#VALUE!');\nconst ref = new Error('#REF!');\nconst name = new Error('#NAME?');\nconst num = new Error('#NUM!');\nconst na = new Error('#N/A');\nconst error = new Error('#ERROR!');\nconst data = new Error('#GETTING_DATA');\n\nvar errors = /*#__PURE__*/Object.freeze({\n __proto__: null,\n data: data,\n div0: div0,\n error: error,\n na: na,\n name: name,\n nil: nil,\n num: num,\n ref: ref,\n value: value\n});\n\nconst defaultOperator = '=';\nconst validSymbols = ['>', '>=', '<', '<=', '=', '<>'];\nconst _TOKEN_TYPE_OPERATOR = 'operator';\nconst _TOKEN_TYPE_LITERAL = 'literal';\nconst SUPPORTED_TOKENS = [_TOKEN_TYPE_OPERATOR, _TOKEN_TYPE_LITERAL];\n\nconst TOKEN_TYPE_OPERATOR = _TOKEN_TYPE_OPERATOR;\nconst TOKEN_TYPE_LITERAL = _TOKEN_TYPE_LITERAL;\n\n/**\n * Create token which describe passed symbol/value.\n *\n * @param {String} value Value/Symbol to describe.\n * @param {String} type Type of the token 'operator' or 'literal'.\n * @return {Object}\n */\nfunction createToken(value, type) {\n if (SUPPORTED_TOKENS.indexOf(type) === -1) {\n throw new Error('Unsupported token type: ' + type)\n }\n\n return {\n value: value,\n type: type\n }\n}\n\n/**\n * Tries to cast numeric values to their type passed as a string.\n *\n * @param {*} value\n * @return {*}\n */\nfunction castValueToCorrectType(value) {\n if (typeof value !== 'string') {\n return value\n }\n\n if (/^\\d+(\\.\\d+)?$/.test(value)) {\n value = value.indexOf('.') === -1 ? parseInt(value, 10) : parseFloat(value);\n }\n\n return value\n}\n\n/**\n * Generate stream of tokens from passed expression.\n *\n * @param {String} expression\n * @return {String[]}\n */\nfunction tokenizeExpression(expression) {\n const expressionLength = expression.length;\n const tokens = [];\n let cursorIndex = 0;\n let processedValue = '';\n let processedSymbol = '';\n\n while (cursorIndex < expressionLength) {\n const char = expression.charAt(cursorIndex);\n\n switch (char) {\n case '>':\n case '<':\n case '=':\n processedSymbol = processedSymbol + char;\n\n if (processedValue.length > 0) {\n tokens.push(processedValue);\n processedValue = '';\n }\n\n break\n default:\n if (processedSymbol.length > 0) {\n tokens.push(processedSymbol);\n processedSymbol = '';\n }\n\n processedValue = processedValue + char;\n break\n }\n\n cursorIndex++;\n }\n\n if (processedValue.length > 0) {\n tokens.push(processedValue);\n }\n\n if (processedSymbol.length > 0) {\n tokens.push(processedSymbol);\n }\n\n return tokens\n}\n\n/**\n * Analyze and convert tokens to an object which describes their meaning.\n *\n * @param {String[]} tokens\n * @return {Object[]}\n */\nfunction analyzeTokens(tokens) {\n let literalValue = '';\n const analyzedTokens = [];\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (i === 0 && validSymbols.indexOf(token) >= 0) {\n analyzedTokens.push(createToken(token, TOKEN_TYPE_OPERATOR));\n } else {\n literalValue += token;\n }\n }\n\n if (literalValue.length > 0) {\n analyzedTokens.push(createToken(castValueToCorrectType(literalValue), TOKEN_TYPE_LITERAL));\n }\n\n if (analyzedTokens.length > 0 && analyzedTokens[0].type !== TOKEN_TYPE_OPERATOR) {\n analyzedTokens.unshift(createToken(defaultOperator, TOKEN_TYPE_OPERATOR));\n }\n\n return analyzedTokens\n}\n\n/**\n * Compute/Evaluate an expression passed as an array of tokens.\n *\n * @param {Object[]} tokens\n * @return {Boolean}\n */\nfunction computeExpression(tokens) {\n const values = [];\n let operator;\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n switch (token.type) {\n case TOKEN_TYPE_OPERATOR:\n operator = token.value;\n break\n case TOKEN_TYPE_LITERAL:\n values.push(token.value);\n break\n }\n }\n\n return evaluate(values, operator)\n}\n\n/**\n * Evaluate values based on passed math operator.\n *\n * @param {*} values\n * @param {String} operator\n * @return {Boolean}\n */\nfunction evaluate(values, operator) {\n let result = false;\n\n switch (operator) {\n case '>':\n result = values[0] > values[1];\n break\n case '>=':\n result = values[0] >= values[1];\n break\n case '<':\n result = values[0] < values[1];\n break\n case '<=':\n result = values[0] <= values[1];\n break\n case '=':\n result = values[0] == values[1];\n break\n case '<>':\n result = values[0] != values[1];\n break\n }\n\n return result\n}\n\nfunction parse(expression) {\n return analyzeTokens(tokenizeExpression(expression))\n}\n\nconst compute = computeExpression;\n\n// Arrays\nfunction argsToArray(args) {\n const result = [];\n\n arrayEach(args, (value) => {\n result.push(value);\n });\n\n return result\n}\n\nfunction arrayEach(array, iteratee) {\n let index = -1;\n const length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break\n }\n }\n\n return array\n}\n\nfunction arrayValuesToNumbers(arr) {\n let n = arr.length;\n let el;\n\n while (n--) {\n el = arr[n];\n\n if (typeof el === 'number') {\n continue\n }\n\n if (el === true) {\n arr[n] = 1;\n continue\n }\n\n if (el === false) {\n arr[n] = 0;\n continue\n }\n\n if (typeof el === 'string') {\n const number = parseNumber(el);\n\n arr[n] = number instanceof Error ? 0 : number;\n }\n }\n\n return arr\n}\n\nfunction fillMatrix(matrix, fill_value) {\n if (!matrix) {\n return value\n }\n\n if (!matrix.every((el) => Array.isArray(el)) || matrix.length === 0) {\n matrix = [[...matrix]];\n }\n\n matrix.map((arr, i) => {\n arr.map((a, j) => {\n if (!a) {\n matrix[i][j] = 0;\n }\n });\n });\n\n const longestArrayIndex = matrix.reduce((acc, arr, i) => (arr.length > matrix[acc].length ? i : acc), 0);\n const longestArrayLength = matrix[longestArrayIndex].length;\n\n return matrix.map((el) => [...el, ...Array(longestArrayLength - el.length).fill(fill_value ? fill_value : 0)])\n}\n\nfunction flatten() {\n let result;\n\n if (arguments.length === 1) {\n const argument = arguments[0];\n result = isArrayLike(argument) ? argsToArray.apply(null, arguments) : [argument];\n } else {\n result = Array.from(arguments);\n }\n\n while (!isFlat(result)) {\n result = flattenShallow(result);\n }\n\n return result\n}\n\nfunction flattenShallow(array) {\n if (!array || !array.reduce) {\n return [array]\n }\n\n return array.reduce((a, b) => {\n const aIsArray = Array.isArray(a);\n const bIsArray = Array.isArray(b);\n\n if (aIsArray && bIsArray) {\n return a.concat(b)\n }\n\n if (aIsArray) {\n a.push(b);\n\n return a\n }\n\n if (bIsArray) {\n return [a].concat(b)\n }\n\n return [a, b]\n })\n}\n\nfunction initial(array, idx) {\n idx = idx || 1;\n\n if (!array || typeof array.slice !== 'function') {\n return array\n }\n\n return array.slice(0, array.length - idx)\n}\n\nfunction isArrayLike(a) {\n return a != null && typeof a.length === 'number' && typeof a !== 'string'\n}\n\nfunction isFlat(array) {\n if (!array) {\n return false\n }\n\n for (let i = 0; i < array.length; ++i) {\n if (Array.isArray(array[i])) {\n return false\n }\n }\n\n return true\n}\n\nfunction rest(array, idx) {\n idx = idx || 1;\n\n if (!array || typeof array.slice !== 'function') {\n return array\n }\n\n return array.slice(idx)\n}\n\nfunction transpose(matrix) {\n if (!matrix) {\n return value\n }\n\n return matrix[0].map((col, i) => matrix.map((row) => row[i]))\n}\n\n// Databases\nfunction findField(database, title) {\n let index = null;\n\n arrayEach(database, (value, i) => {\n if (value[0] === title) {\n index = i;\n\n return false\n }\n });\n\n // Return error if the input field title is incorrect\n if (index == null) {\n return value\n }\n\n return index\n}\n\n// Errors\nfunction anyError() {\n for (let n = 0; n < arguments.length; n++) {\n if (arguments[n] instanceof Error) {\n return arguments[n]\n }\n }\n\n return undefined\n}\n\nfunction anyIsError() {\n let n = arguments.length;\n\n while (n--) {\n if (arguments[n] instanceof Error) {\n return true\n }\n }\n\n return false\n}\n\n// Numbers\nfunction cleanFloat(number) {\n const power = 1e14;\n\n return Math.round(number * power) / power\n}\n\nfunction numbers() {\n const possibleNumbers = flatten.apply(null, arguments);\n\n return possibleNumbers.filter((el) => typeof el === 'number')\n}\n\nfunction serialNumberToDate(serial) {\n if (serial < 60) {\n serial += 1;\n }\n\n const utc_days = Math.floor(serial - 25569);\n const utc_value = utc_days * 86400;\n const date_info = new Date(utc_value * 1000);\n const fractional_day = serial - Math.floor(serial) + 0.0000001;\n\n let total_seconds = Math.floor(86400 * fractional_day);\n\n const seconds = total_seconds % 60;\n\n total_seconds -= seconds;\n\n const hours = Math.floor(total_seconds / (60 * 60));\n const minutes = Math.floor(total_seconds / 60) % 60;\n let days = date_info.getUTCDate();\n let month = date_info.getUTCMonth();\n\n if (serial >= 60 && serial < 61) {\n days = 29;\n month = 1;\n }\n\n return new Date(date_info.getUTCFullYear(), month, days, hours, minutes, seconds)\n}\n\n// Parsers\nfunction parseBool(bool) {\n if (typeof bool === 'boolean') {\n return bool\n }\n\n if (bool instanceof Error) {\n return bool\n }\n\n if (typeof bool === 'number') {\n return bool !== 0\n }\n\n if (typeof bool === 'string') {\n const up = bool.toUpperCase();\n\n if (up === 'TRUE') {\n return true\n }\n\n if (up === 'FALSE') {\n return false\n }\n }\n\n if (bool instanceof Date && !isNaN(bool)) {\n return true\n }\n\n return value\n}\n\nfunction parseDate(date) {\n if (!isNaN(date)) {\n if (date instanceof Date) {\n return new Date(date)\n }\n\n const d = parseFloat(date);\n\n if (d < 0 || d >= 2958466) {\n return num\n }\n\n return serialNumberToDate(d)\n }\n\n if (typeof date === 'string') {\n date = /(\\d{4})-(\\d\\d?)-(\\d\\d?)$/.test(date) ? new Date(date + 'T00:00:00.000') : new Date(date);\n\n if (!isNaN(date)) {\n return date\n }\n }\n\n return value\n}\n\nfunction parseDateArray(arr) {\n let len = arr.length;\n let parsed;\n\n while (len--) {\n parsed = parseDate(arr[len]);\n\n if (parsed === value) {\n return parsed\n }\n\n arr[len] = parsed;\n }\n\n return arr\n}\n\nfunction parseNumber(string) {\n if (string instanceof Error) {\n return string\n }\n\n if (string === undefined || string === null) {\n return 0\n }\n\n if (typeof string === 'boolean') {\n string = +string;\n }\n\n if (!isNaN(string) && string !== '') {\n return parseFloat(string)\n }\n\n return value\n}\n\nfunction parseNumberArray(arr) {\n let len;\n\n if (!arr || (len = arr.length) === 0) {\n return value\n }\n\n let parsed;\n\n while (len--) {\n if (arr[len] instanceof Error) {\n return arr[len]\n }\n\n parsed = parseNumber(arr[len]);\n\n if (parsed instanceof Error) {\n return parsed\n }\n\n arr[len] = parsed;\n }\n\n return arr\n}\n\nfunction parseString(string) {\n if (string instanceof Error) {\n return string\n }\n\n if (string === undefined || string === null) {\n return ''\n }\n\n return string.toString()\n}\n\n// Strings\nfunction anyIsString() {\n let n = arguments.length;\n\n while (n--) {\n if (typeof arguments[n] === 'string') {\n return true\n }\n }\n\n return false\n}\n\n// Misc\n//Filters values from a given range based on multiple criteria.\n//Returns an array containing the values that satisfy all the specified criteria.\nfunction applyCriteria() {\n const args = argsToArray(arguments);\n const range = parseNumberArray(flatten(args.shift()));\n if (range instanceof Error) {\n return range\n }\n\n const criterias = args;\n const criteriaLength = criterias.length / 2;\n\n for (let i = 0; i < criteriaLength; i++) {\n criterias[i * 2] = flatten(criterias[i * 2]);\n }\n\n let values = [];\n\n for (let i = 0; i < range.length; i++) {\n let isMetCondition = false;\n\n for (let j = 0; j < criteriaLength; j++) {\n const valueToTest = criterias[j * 2][i];\n const criteria = criterias[j * 2 + 1];\n const isWildcard = criteria === void 0 || criteria === '*';\n let computedResult = false;\n\n if (isWildcard) {\n computedResult = true;\n } else {\n const tokenizedCriteria = parse(criteria + '');\n const tokens = [createToken(valueToTest, TOKEN_TYPE_LITERAL)].concat(\n tokenizedCriteria\n );\n\n computedResult = compute(tokens);\n }\n\n // Criterias are calculated as AND so any `false` breaks the loop as unmeet condition\n if (!computedResult) {\n isMetCondition = false;\n break\n }\n\n isMetCondition = true;\n }\n\n if (isMetCondition) {\n values.push(range[i]);\n }\n }\n return values\n}\n\nfunction isDefined(arg) {\n return arg !== undefined && arg !== null\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns information about the formatting, location, or contents of a value.\n *\n * Category: Information\n *\n * @returns\n */\nfunction CELL() {\n throw new Error('CELL is not implemented')\n}\n\nconst ERROR = {};\n\nERROR.TYPE = (error_val) => {\n switch (error_val) {\n case nil:\n return 1\n case div0:\n return 2\n case value:\n return 3\n case ref:\n return 4\n case name:\n return 5\n case num:\n return 6\n case na:\n return 7\n case data:\n return 8\n }\n\n return na\n};\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns information about the current operating environment.\n *\n * Category: Information\n *\n * @returns\n */\nfunction INFO() {\n throw new Error('INFO is not implemented')\n}\n\n/**\n * Returns TRUE if the value is blank.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISBLANK(value) {\n return value === null\n}\n\n/**\n * Returns TRUE if the value is any error value except #N/A.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISERR(value$1) {\n return (\n [value, ref, div0, num, name, nil].indexOf(value$1) >= 0 ||\n (typeof value$1 === 'number' && (isNaN(value$1) || !isFinite(value$1)))\n )\n}\n\n/**\n * Returns TRUE if the value is any error value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISERROR(value) {\n return ISERR(value) || value === na\n}\n\n/**\n * Returns TRUE if the number is even.\n *\n * Category: Information\n *\n * @param {*} number The value to test. If number is not an integer, it is truncated.\n * @returns\n */\nfunction ISEVEN(number) {\n return !(Math.floor(Math.abs(number)) & 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns TRUE if there is a reference to a value that contains a formula.\n *\n * Category: Information\n *\n * @param {*} reference Reference is a reference to the value you want to test. Reference can be a value reference, a formula, or a name that refers to a value.\n * @returns\n */\nfunction ISFORMULA() {\n throw new Error('ISFORMULA is not implemented')\n}\n\n/**\n * Returns TRUE if the value is a logical value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISLOGICAL(value) {\n return value === true || value === false\n}\n\n/**\n * Returns TRUE if the value is the #N/A error value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNA(value) {\n return value === na\n}\n\n/**\n * Returns TRUE if the value is not text.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNONTEXT(value) {\n return typeof value !== 'string'\n}\n\n/**\n * Returns TRUE if the value is a number.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNUMBER(value) {\n return typeof value === 'number' && !isNaN(value) && isFinite(value)\n}\n\n/**\n * Returns TRUE if the number is odd.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISODD(value) {\n return !!(Math.floor(Math.abs(value)) & 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns TRUE if the value is a reference.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISREF() {\n throw new Error('ISREF is not implemented')\n}\n\n/**\n * Returns TRUE if the value is text.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISTEXT(value) {\n return typeof value === 'string'\n}\n\n/**\n * Returns a value converted to a number.\n *\n * Category: Information\n *\n * @param {*} value The value you want converted. N converts values listed in the following table.\n * @returns\n */\nfunction N(value) {\n if (ISNUMBER(value)) {\n return value\n }\n\n if (value instanceof Date) {\n return value.getTime()\n }\n\n if (value === true) {\n return 1\n }\n\n if (value === false) {\n return 0\n }\n\n if (ISERROR(value)) {\n return value\n }\n\n return 0\n}\n\n/**\n * Returns the error value #N/A.\n *\n * Category: Information\n *\n * @returns\n */\nfunction NA() {\n return na\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the sheet number of the referenced sheet.\n *\n * Category: Information\n *\n * @param {*} value Optional. Value is the name of a sheet or a reference for which you want the sheet number. If value is omitted, SHEET returns the number of the sheet that contains the function.\n * @returns\n */\nfunction SHEET() {\n throw new Error('SHEET is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of sheets in a reference.\n *\n * Category: Information\n *\n * @param {*} reference Optional. Reference is a reference for which you want to know the number of sheets it contains. If Reference is omitted, SHEETS returns the number of sheets in the workbook that contains the function.\n * @returns\n */\nfunction SHEETS() {\n throw new Error('SHEETS is not implemented')\n}\n\n/**\n * Returns a number indicating the data type of a value.\n *\n * Category: Information\n *\n * @param {*} value Can be any Microsoft Excel value, such as a number, text, logical value, and so on.\n * @returns\n */\nfunction TYPE(value) {\n if (ISNUMBER(value)) {\n return 1\n }\n\n if (ISTEXT(value)) {\n return 2\n }\n\n if (ISLOGICAL(value)) {\n return 4\n }\n\n if (ISERROR(value)) {\n return 16\n }\n\n if (Array.isArray(value)) {\n return 64\n }\n}\n\n/**\n * Chooses a value from a list of values.\n *\n * Category: Lookup and reference\n *\n * @param {*} index_num Specifies which value argument is selected. Index_num must be a number between 1 and 254, or a formula or reference to a value containing a number between 1 and 254. If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on. If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value. If index_num is a fraction, it is truncated to the lowest integer before being used.\n - If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on.\n - If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value.\n - If index_num is a fraction, it is truncated to the lowest integer before being used.\n * @param {*} args value1, value2, ... Value 1 is required, subsequent values are optional. 1 to 254 value arguments from which CHOOSE selects a value or an action to perform based on index_num. The arguments can be numbers, value references, defined names, formulas, functions, or text.\n * @returns\n */\nfunction CHOOSE() {\n if (arguments.length < 2) {\n return na\n }\n\n const index = arguments[0];\n\n if (index < 1 || index > 254) {\n return value\n }\n\n if (arguments.length < index + 1) {\n return value\n }\n\n return arguments[index]\n}\n\n/**\n * Returns the column number of a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} reference the value or range of values for which you want to return the column number.\n * @param {*} index\n * @returns\n */\nfunction COLUMN(reference, index) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (index < 0) {\n return num\n }\n\n if (!(reference instanceof Array) || typeof index !== 'number') {\n return value\n }\n\n if (reference.length === 0) {\n return undefined\n }\n\n return jStat.col(reference, index)\n}\n\n/**\n * Returns the number of columns in a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array or array formula, or a reference to a range of values for which you want the number of columns.\n * @returns\n */\nfunction COLUMNS(array) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (!(array instanceof Array)) {\n return value\n }\n\n if (array.length === 0) {\n return 0\n }\n\n return jStat.cols(array)\n}\n\n/**\n * Looks in the top row of an array and returns the value of the indicated value.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value to be found in the first row of the table. Lookup_value can be a value, a reference, or a text string.\n * @param {*} table_array A table of information in which data is looked up. Use a reference to a range or a range name.\n * @param {*} row_index_num The row number in table_array from which the matching value will be returned. A row_index_num of 1 returns the first row value in table_array, a row_index_num of 2 returns the second row value in table_array, and so on. If row_index_num is less than 1, HLOOKUP returns the #VALUE! error value; if row_index_num is greater than the number of rows on table_array, HLOOKUP returns the #REF! error value.\n * @param {*} range_lookup Optional. A logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.\n * @returns\n */\nfunction HLOOKUP(lookup_value, table_array, row_index_num, range_lookup) {\n return VLOOKUP(lookup_value, transpose(table_array), row_index_num, range_lookup)\n}\n\n/**\n * Uses an index to choose a value from a reference or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} array A range of values or an array constant.\n - If array contains only one row or column, the corresponding row_num or column_num argument is optional.\n - If array has more than one row and more than one column, and only row_num or column_num is used, INDEX returns an array of the entire row or column in array.\n * @param {*} row_num Required, unless column_num is present. Selects the row in array from which to return a value. If row_num is omitted, column_num is required.\n * @param {*} column_num Optional. Selects the column in array from which to return a value. If column_num is omitted, row_num is required.\n * @returns\n */\nfunction INDEX(array, row_num, column_num) {\n const someError = anyError(array, row_num, column_num);\n\n if (someError) {\n return someError\n }\n\n if (!Array.isArray(array)) {\n return value\n }\n\n const isOneDimensionRange = array.length > 0 && !Array.isArray(array[0]);\n\n if (isOneDimensionRange && !column_num) {\n column_num = row_num;\n row_num = 1;\n } else {\n column_num = column_num || 1;\n row_num = row_num || 1;\n }\n\n if (column_num < 0 || row_num < 0) {\n return value\n }\n\n if (isOneDimensionRange && row_num === 1 && column_num <= array.length) {\n return array[column_num - 1]\n } else if (row_num <= array.length && column_num <= array[row_num - 1].length) {\n return array[row_num - 1][column_num - 1]\n }\n\n return ref\n}\n\n/**\n * Looks up values in a vector or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value A value that LOOKUP searches for in an array. The lookup_value argument can be a number, text, a logical value, or a name or reference that refers to a value.\n - If LOOKUP can't find the value of lookup_value, it uses the largest value in the array that is less than or equal to lookup_value.\n - If the value of lookup_value is smaller than the smallest value in the first row or column (depending on the array dimensions), LOOKUP returns the #N/A error value.\n * @param {*} array A range of values that contains text, numbers, or logical values that you want to compare with lookup_value. The array form of LOOKUP is very similar to the HLOOKUP and VLOOKUP functions. The difference is that HLOOKUP searches for the value of lookup_value in the first row, VLOOKUP searches in the first column, and LOOKUP searches according to the dimensions of array.\n* @param {*} result_array Optional. A range that contains only one row or column. The result_array argument must be the same size as lookup_value. It has to be the same size.\n * @returns\n */\nfunction LOOKUP(lookup_value, array, result_array) {\n array = flatten(array);\n result_array = result_array ? flatten(result_array) : array;\n\n const isNumberLookup = typeof lookup_value === 'number';\n let result = na;\n\n for (let i = 0; i < array.length; i++) {\n if (array[i] === lookup_value) {\n return result_array[i]\n } else if (\n (isNumberLookup && array[i] <= lookup_value) ||\n (typeof array[i] === 'string' && array[i].localeCompare(lookup_value) < 0)\n ) {\n result = result_array[i];\n } else if (isNumberLookup && array[i] > lookup_value) {\n return result\n }\n }\n\n return result\n}\n\n/**\n * Looks up values in a reference or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value that you want to match in lookup_array. For example, when you look up someone's number in a telephone book, you are using the person's name as the lookup value, but the telephone number is the value you want.The lookup_value argument can be a value (number, text, or logical value) or a value reference to a number, text, or logical value.\n * @param {*} lookup_array The range of values being searched.\n * @param {*} match_type Optional. The number -1, 0, or 1. The match_type argument specifies how Excel matches lookup_value with values in lookup_array. The default value for this argument is 1.\n * @returns\n */\nfunction MATCH(lookup_value, lookup_array, match_type) {\n if ((!lookup_value && lookup_value !== 0) || !lookup_array) {\n return na\n }\n\n if (arguments.length === 2) {\n match_type = 1;\n }\n\n lookup_array = flatten(lookup_array);\n\n if (!(lookup_array instanceof Array)) {\n return na\n }\n\n if (match_type !== -1 && match_type !== 0 && match_type !== 1) {\n return na\n }\n\n let index;\n let indexValue;\n\n for (let idx = 0; idx < lookup_array.length; idx++) {\n if (match_type === 1) {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n } else if (lookup_array[idx] < lookup_value) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n } else if (lookup_array[idx] > indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n }\n }\n } else if (match_type === 0) {\n if (typeof lookup_value === 'string' && typeof lookup_array[idx] === 'string') {\n const lookupValueStr = lookup_value\n .toLowerCase()\n .replace(/\\?/g, '.')\n .replace(/\\*/g, '.*')\n .replace(/~/g, '\\\\')\n .replace(/\\+/g, '\\\\+')\n .replace(/\\(/g, '\\\\(')\n .replace(/\\)/g, '\\\\)')\n .replace(/\\[/g, '\\\\[')\n .replace(/\\]/g, '\\\\]');\n\n const regex = new RegExp('^' + lookupValueStr + '$');\n\n if (regex.test(lookup_array[idx].toLowerCase())) {\n return idx + 1\n }\n } else {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n }\n }\n } else if (match_type === -1) {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n } else if (lookup_array[idx] > lookup_value) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n } else if (lookup_array[idx] < indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n }\n }\n }\n }\n\n return index || na\n}\n\n/**\n * Returns the number of rows in a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array, an array formula, or a reference to a range of values for which you want the number of rows.\n * @returns\n */\nfunction ROWS(array) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (!(array instanceof Array)) {\n return value\n }\n\n if (array.length === 0) {\n return 0\n }\n\n return jStat.rows(array)\n}\n/**\n * Returns a sorted array of the elements in an array. The returned array is the same shape as the provided array argument.\n *\n * Category: Lookup and reference\n *\n * @param {*} array Array to sort\n * @param {*} sort_index Optional. A number indicating the row or column to sort by\n * @param {*} sort_order Optional. A number indicating the desired sort order; 1 for ascending order (default), -1 for descending order\n * @param {*} by_col Optional. A logical value indicating the desired sort direction; FALSE to sort by row (default), TRUE to sort by column\n * @returns\n */\nfunction SORT(array, sort_index = 1, sort_order = 1, by_col = false) {\n if (!array || !Array.isArray(array)) {\n return na\n }\n\n if (array.length === 0) {\n return 0\n }\n\n sort_index = parseNumber(sort_index);\n if (!sort_index || sort_index < 1) {\n return value\n }\n\n sort_order = parseNumber(sort_order);\n if (sort_order !== 1 && sort_order !== -1) {\n return value\n }\n\n by_col = parseBool(by_col);\n if (typeof by_col !== 'boolean') {\n return name\n }\n\n const sortArray = (arr) =>\n arr.sort((a, b) => {\n a = parseString(a[sort_index - 1]);\n b = parseString(b[sort_index - 1]);\n\n return sort_order === 1 ? (a < b ? sort_order * -1 : sort_order) : a > b ? sort_order : sort_order * -1\n });\n\n const matrix = fillMatrix(array);\n const result = by_col ? transpose(matrix) : matrix;\n\n return sort_index >= 1 && sort_index <= result[0].length\n ? by_col\n ? transpose(sortArray(result))\n : sortArray(result)\n : value\n}\n\n/**\n * Returns the transpose of an array.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array or range of values on a worksheet that you want to transpose. The transpose of an array is created by using the first row of the array as the first column of the new array, the second row of the array as the second column of the new array, and so on. If you're not sure of how to enter an array formula, see Create an array formula.\n * @returns\n */\nfunction TRANSPOSE(array) {\n if (!array) {\n return na\n }\n\n const matrix = fillMatrix(array);\n\n return transpose(matrix)\n}\n\n/**\n * Returns a list of unique values in a list or range.\n *\n * Category: Lookup and reference\n *\n * @returns\n */\nfunction UNIQUE() {\n const result = [];\n\n for (let i = 0; i < arguments.length; ++i) {\n let hasElement = false;\n const element = arguments[i];\n\n // Check if we've already seen this element.\n\n for (let j = 0; j < result.length; ++j) {\n hasElement = result[j] === element;\n\n if (hasElement) {\n break\n }\n }\n\n // If we did not find it, add it to the result.\n if (!hasElement) {\n result.push(element);\n }\n }\n\n return result\n}\n\n/**\n * Looks in the first column of an array and moves across the row to return the value of a value.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value to be found in the first row of the table. Lookup_value can be a value, a reference, or a text string.\n * @param {*} table_array A table of information in which data is looked up. Use a reference to a range or a range name.\n * @param {*} col_index_num The row number in table_array from which the matching value will be returned. A row_index_num of 1 returns the first row value in table_array, a row_index_num of 2 returns the second row value in table_array, and so on. If row_index_num is less than 1, HLOOKUP returns the #VALUE! error value; if row_index_num is greater than the number of rows on table_array, HLOOKUP returns the #REF! error value.\n * @param {*} range_lookup Optional. A logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.\n * @returns\n */\nfunction VLOOKUP(lookup_value, table_array, col_index_num, range_lookup) {\n if (!table_array || !col_index_num) {\n return na\n }\n\n range_lookup = !(range_lookup === 0 || range_lookup === false);\n\n let result = na;\n let exactMatchOnly = false;\n\n const isNumberLookup = typeof lookup_value === 'number';\n const lookupValue = typeof lookup_value === 'string' ? lookup_value.toLowerCase() : lookup_value;\n\n for (let i = 0; i < table_array.length; i++) {\n const row = table_array[i];\n const rowValue = typeof row[0] === 'string' ? row[0].toLowerCase() : row[0];\n\n if (rowValue === lookupValue) {\n result = col_index_num < row.length + 1 ? row[col_index_num - 1] : ref;\n break\n } else if (\n !exactMatchOnly &&\n ((isNumberLookup && range_lookup && rowValue <= lookup_value) ||\n (range_lookup && typeof rowValue === 'string' && rowValue.localeCompare(lookup_value) < 0))\n ) {\n result = col_index_num < row.length + 1 ? row[col_index_num - 1] : ref;\n }\n\n if (isNumberLookup && rowValue > lookup_value) {\n exactMatchOnly = true;\n }\n }\n\n return result\n}\n\nconst SQRT2PI = 2.5066282746310002;\n\n/**\n * Returns the average of the absolute deviations of data points from their mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want the average of the absolute deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction AVEDEV() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return num\n }\n\n const range = parseNumberArray(flatArgumentsDefined);\n\n if (range instanceof Error) {\n return range\n }\n\n return jStat.sum(jStat(range).subtract(jStat.mean(range)).abs()[0]) / range.length\n}\n\n/**\n * Returns the average of its arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ...Numbers, value references or ranges for which you want the average.\n * @returns\n */\nfunction AVERAGE() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return div0\n }\n\n const someError = anyError.apply(undefined, flatArgumentsDefined);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArgumentsDefined);\n const n = range.length;\n let sum = 0;\n let count = 0;\n let result;\n\n for (let i = 0; i < n; i++) {\n sum += range[i];\n count += 1;\n }\n\n result = sum / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the average of its arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values, ranges of values, or values for which you want the average.\n * @returns\n */\nfunction AVERAGEA() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return div0\n }\n\n const someError = anyError.apply(undefined, flatArgumentsDefined);\n\n if (someError) {\n return someError\n }\n\n const range = flatArgumentsDefined;\n const n = range.length;\n let sum = 0;\n let count = 0;\n let result;\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sum += el;\n }\n\n if (el === true) {\n sum++;\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n result = sum / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the average (arithmetic mean) of all the values in a range that meet a given criteria.\n *\n * Category: Statistical\n *\n * @param {*} range One or more values to average, including numbers or names, arrays, or references that contain numbers.\n * @param {*} criteria The criteria in the form of a number, expression, value reference, or text that defines which values are averaged.\n * @param {*} average_range Optional. The actual set of values to average. If omitted, range is used.\n * @returns\n */\nfunction AVERAGEIF(range, criteria, average_range) {\n if (arguments.length <= 1) {\n return na\n }\n\n average_range = average_range || range;\n const flatAverageRange = flatten(average_range);\n const flatAverageRangeDefined = flatAverageRange.filter(isDefined);\n average_range = parseNumberArray(flatAverageRangeDefined);\n\n range = flatten(range);\n\n if (average_range instanceof Error) {\n return average_range\n }\n\n let average_count = 0;\n let result = 0;\n const isWildcard = criteria === void 0 || criteria === '*';\n const tokenizedCriteria = isWildcard ? null : parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n\n if (isWildcard) {\n result += average_range[i];\n average_count++;\n } else {\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n if (compute(tokens)) {\n result += average_range[i];\n average_count++;\n }\n }\n }\n\n return result / average_count\n}\n\n/**\n * Returns the average (arithmetic mean) of all values that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @param {*} args One or more values to average, including numbers or names, arrays, or references that contain numbers.\n * @returns\n */\nfunction AVERAGEIFS() {\n // Does not work with multi dimensional ranges yet!\n // http://office.microsoft.com/en-001/excel-help/averageifs-function-HA010047493.aspx\n const values = applyCriteria(...arguments);\n const result = values.reduce((acc, value) => acc + value, 0);\n const average = result / values.length;\n\n return isNaN(average) ? 0 : average\n}\n\nconst BETA = {};\n\n/**\n * Returns the beta cumulative distribution function.\n *\n * Category: Statistical\n *\n * @param {*} x The value between A and B at which to evaluate the function\n * @param {*} alpha A parameter of the distribution.\n * @param {*} beta A parameter of the distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, BETA.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @param {*} a Optional. A lower bound to the interval of x.\n * @param {*} b Optional. An upper bound to the interval of x.\n * @returns\n */\nBETA.DIST = function (x, alpha, beta, cumulative, a, b) {\n if (arguments.length < 4) {\n return value\n }\n\n a = a === undefined ? 0 : a;\n b = b === undefined ? 1 : b;\n\n x = parseNumber(x);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n a = parseNumber(a);\n b = parseNumber(b);\n\n if (anyIsError(x, alpha, beta, a, b)) {\n return value\n }\n\n x = (x - a) / (b - a);\n\n return cumulative ? jStat.beta.cdf(x, alpha, beta) : jStat.beta.pdf(x, alpha, beta)\n};\n\n/**\n * Returns the inverse of the cumulative distribution function for a specified beta distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the beta distribution.\n * @param {*} alpha A parameter of the distribution.\n * @param {*} beta A parameter the distribution.\n * @param {*} a Optional. A lower bound to the interval of x.\n * @param {*} b Optional. An upper bound to the interval of x.\n * @returns\n */\nBETA.INV = (probability, alpha, beta, a, b) => {\n a = a === undefined ? 0 : a;\n b = b === undefined ? 1 : b;\n probability = parseNumber(probability);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n a = parseNumber(a);\n b = parseNumber(b);\n\n if (anyIsError(probability, alpha, beta, a, b)) {\n return value\n }\n\n return jStat.beta.inv(probability, alpha, beta) * (b - a) + a\n};\n\nconst BINOM = {};\n\n/**\n * Returns the individual term binomial distribution probability.\n *\n * Category: Statistical\n *\n * @param {*} number_s The number of successes in trials.\n * @param {*} trials The number of independent trials.\n * @param {*} probability_s The probability of success on each trial.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, then BINOM.DIST returns the cumulative distribution function, which is the probability that there are at most number_s successes; if FALSE, it returns the probability mass function, which is the probability that there are number_s successes.\n * @returns\n */\nBINOM.DIST = (number_s, trials, probability_s, cumulative) => {\n number_s = parseNumber(number_s);\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n cumulative = parseNumber(cumulative);\n\n if (anyIsError(number_s, trials, probability_s, cumulative)) {\n return value\n }\n\n return cumulative\n ? jStat.binomial.cdf(number_s, trials, probability_s)\n : jStat.binomial.pdf(number_s, trials, probability_s)\n};\n\n/**\n * Returns the probability of a trial result using a binomial distribution.\n *\n * Category: Statistical\n *\n * @param {*} trials The number of independent trials. Must be greater than or equal to 0.\n * @param {*} probability_s The probability of success in each trial. Must be greater than or equal to 0 and less than or equal to 1.\n * @param {*} number_s The number of successes in trials. Must be greater than or equal to 0 and less than or equal to Trials.\n * @param {*} number_s2 Optional. If provided, returns the probability that the number of successful trials will fall between Number_s and number_s2. Must be greater than or equal to Number_s and less than or equal to Trials.\n * @returns\n */\nBINOM.DIST.RANGE = (trials, probability_s, number_s, number_s2) => {\n number_s2 = number_s2 === undefined ? number_s : number_s2;\n\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n number_s = parseNumber(number_s);\n number_s2 = parseNumber(number_s2);\n\n if (anyIsError(trials, probability_s, number_s, number_s2)) {\n return value\n }\n\n let result = 0;\n\n for (let i = number_s; i <= number_s2; i++) {\n result += COMBIN(trials, i) * Math.pow(probability_s, i) * Math.pow(1 - probability_s, trials - i);\n }\n\n return result\n};\n\n/**\n * Returns the smallest value for which the cumulative binomial distribution is less than or equal to a criterion value.\n *\n * Category: Statistical\n *\n * @param {*} trials The number of Bernoulli trials.\n * @param {*} probability_s The probability of a success on each trial.\n * @param {*} alpha The criterion value.\n * @returns\n */\nBINOM.INV = (trials, probability_s, alpha) => {\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n alpha = parseNumber(alpha);\n\n if (anyIsError(trials, probability_s, alpha)) {\n return value\n }\n\n let x = 0;\n\n while (x <= trials) {\n if (jStat.binomial.cdf(x, trials, probability_s) >= alpha) {\n return x\n }\n\n x++;\n }\n};\n\nconst CHISQ = {};\n\n/**\n * Returns the cumulative beta probability density function.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, CHISQ.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nCHISQ.DIST = (x, deg_freedom, cumulative) => {\n x = parseNumber(x);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(x, deg_freedom)) {\n return value\n }\n\n return cumulative ? jStat.chisquare.cdf(x, deg_freedom) : jStat.chisquare.pdf(x, deg_freedom)\n};\n\n/**\n * Returns the one-tailed probability of the chi-squared distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.DIST.RT = (x, deg_freedom) => {\n if (!x | !deg_freedom) {\n return na\n }\n\n if (x < 1 || deg_freedom > Math.pow(10, 10)) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return 1 - jStat.chisquare.cdf(x, deg_freedom)\n};\n\n/**\n * Returns the cumulative beta probability density function.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the chi-squared distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.INV = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return jStat.chisquare.inv(probability, deg_freedom)\n};\n\n/**\n * Returns the inverse of the one-tailed probability of the chi-squared distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the chi-squared distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.INV.RT = (probability, deg_freedom) => {\n if (!probability | !deg_freedom) {\n return na\n }\n\n if (probability < 0 || probability > 1 || deg_freedom < 1 || deg_freedom > Math.pow(10, 10)) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return jStat.chisquare.inv(1.0 - probability, deg_freedom)\n};\n\n/**\n * Returns the test for independence.\n *\n * Category: Statistical\n *\n * @param {*} actual_range The range of data that contains observations to test against expected values.\n * @param {*} expected_range The range of data that contains the ratio of the product of row totals and column totals to the grand total.\n * @returns\n */\nCHISQ.TEST = function (actual_range, expected_range) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (!(actual_range instanceof Array) || !(expected_range instanceof Array)) {\n return value\n }\n\n if (actual_range.length !== expected_range.length) {\n return value\n }\n\n if (actual_range[0] && expected_range[0] && actual_range[0].length !== expected_range[0].length) {\n return value\n }\n\n const row = actual_range.length;\n let tmp, i, j;\n\n // Convert single-dimension array into two-dimension array\n\n for (i = 0; i < row; i++) {\n if (!(actual_range[i] instanceof Array)) {\n tmp = actual_range[i];\n actual_range[i] = [];\n actual_range[i].push(tmp);\n }\n\n if (!(expected_range[i] instanceof Array)) {\n tmp = expected_range[i];\n expected_range[i] = [];\n expected_range[i].push(tmp);\n }\n }\n\n const col = actual_range[0].length;\n const dof = col === 1 ? row - 1 : (row - 1) * (col - 1);\n let xsqr = 0;\n const Pi = Math.PI;\n\n for (i = 0; i < row; i++) {\n for (j = 0; j < col; j++) {\n xsqr += Math.pow(actual_range[i][j] - expected_range[i][j], 2) / expected_range[i][j];\n }\n }\n\n // Get independency by X square and its degree of freedom\n function ChiSq(xsqr, dof) {\n let p = Math.exp(-0.5 * xsqr);\n\n if (dof % 2 === 1) {\n p = p * Math.sqrt((2 * xsqr) / Pi);\n }\n\n let k = dof;\n\n while (k >= 2) {\n p = (p * xsqr) / k;\n k = k - 2;\n }\n\n let t = p;\n let a = dof;\n\n while (t > 0.0000000001 * p) {\n a = a + 2;\n t = (t * xsqr) / a;\n p = p + t;\n }\n\n return 1 - p\n }\n\n return Math.round(ChiSq(xsqr, dof) * 1000000) / 1000000\n};\n\nconst CONFIDENCE = {};\n\n/**\n * Returns the confidence interval for a population mean.\n *\n * Category: Statistical\n *\n * @param {*} alpha The significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%, or in other words, an alpha of 0.05 indicates a 95 percent confidence level.\n * @param {*} standard_dev The population standard deviation for the data range and is assumed to be known.\n * @param {*} size The sample size.\n * @returns\n */\nCONFIDENCE.NORM = (alpha, standard_dev, size) => {\n alpha = parseNumber(alpha);\n standard_dev = parseNumber(standard_dev);\n size = parseNumber(size);\n\n if (anyIsError(alpha, standard_dev, size)) {\n return value\n }\n\n return jStat.normalci(1, alpha, standard_dev, size)[1] - 1\n};\n\n/**\n * Returns the confidence interval for a population mean, using a Student's t distribution.\n *\n * Category: Statistical\n *\n * @param {*} alpha The significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%, or in other words, an alpha of 0.05 indicates a 95 percent confidence level.\n * @param {*} standard_dev The population standard deviation for the data range and is assumed to be known.\n * @param {*} size The sample size.\n * @returns\n */\nCONFIDENCE.T = (alpha, standard_dev, size) => {\n alpha = parseNumber(alpha);\n standard_dev = parseNumber(standard_dev);\n size = parseNumber(size);\n\n if (anyIsError(alpha, standard_dev, size)) {\n return value\n }\n\n return jStat.tci(1, alpha, standard_dev, size)[1] - 1\n};\n\n/**\n * Returns the correlation coefficient between two data sets.\n *\n * Category: Statistical\n *\n * @param {*} array1 A range of value values.\n * @param {*} array2 A second range of value values.\n * @returns\n */\nfunction CORREL(array1, array2) {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n return jStat.corrcoeff(array1, array2)\n}\n\n/**\n * Counts how many numbers are in the list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args Cell reference, or range within which you want to count numbers.count numbers.\n * @returns\n */\nfunction COUNT() {\n const flatArguments = flatten(arguments);\n\n return numbers(flatArguments).length\n}\n\n/**\n * Counts how many values are in the list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args Arguments representing the values that you want to count.\n * @returns\n */\nfunction COUNTA() {\n const flatArguments = flatten(arguments);\n\n return flatArguments.length - COUNTBLANK(flatArguments)\n}\n\n/**\n * Counts the number of blank values within a range.\n *\n * Category: Statistical\n *\n * @param {*} args The range from which you want to count the blank values.\n * @returns\n */\nfunction COUNTBLANK() {\n const range = flatten(arguments);\n let blanks = 0;\n let element;\n\n for (let i = 0; i < range.length; i++) {\n element = range[i];\n\n if (element === undefined || element === null || element === '') {\n blanks++;\n }\n }\n\n return blanks\n}\n\n/**\n * Counts the number of values within a range that meet the given criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction COUNTIF(range, criteria) {\n range = flatten(range);\n\n const isWildcard = criteria === void 0 || criteria === '*';\n\n if (isWildcard) {\n return range.length\n }\n\n let matches = 0;\n const tokenizedCriteria = parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n if (compute(tokens)) {\n matches++;\n }\n }\n\n return matches\n}\n\n/**\n * Counts the number of values within a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @param {*} args Range in which to evaluate the associated criteria.\n * @returns\n */\nfunction COUNTIFS() {\n const args = argsToArray(arguments);\n const results = new Array(flatten(args[0]).length);\n\n for (let i = 0; i < results.length; i++) {\n results[i] = true;\n }\n\n for (let i = 0; i < args.length; i += 2) {\n const range = flatten(args[i]);\n const criteria = args[i + 1];\n const isWildcard = criteria === void 0 || criteria === '*';\n\n if (!isWildcard) {\n const tokenizedCriteria = parse(criteria + '');\n\n for (let j = 0; j < range.length; j++) {\n const value = range[j];\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n results[j] = results[j] && compute(tokens);\n }\n }\n }\n\n let result = 0;\n\n for (let i = 0; i < results.length; i++) {\n if (results[i]) {\n result++;\n }\n }\n\n return result\n}\n\nconst COVARIANCE = {};\n\n/**\n * Returns covariance, the average of the products of paired deviations.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first value range of integers.\n * @param {*} array2 The second value range of integers.\n * @returns\n */\nCOVARIANCE.P = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n const mean1 = jStat.mean(array1);\n const mean2 = jStat.mean(array2);\n let result = 0;\n const n = array1.length;\n\n for (let i = 0; i < n; i++) {\n result += (array1[i] - mean1) * (array2[i] - mean2);\n }\n\n return result / n\n};\n\n/**\n * Returns the sample covariance, the average of the products deviations for each data point pair in two data sets.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first value range of integers.\n * @param {*} array2 The second value range of integers.\n * @returns\n */\nCOVARIANCE.S = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n return jStat.covariance(array1, array2)\n};\n\n/**\n * Returns the sum of squares of deviations.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the sum of squared deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction DEVSQ() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n let result = 0;\n\n for (let i = 0; i < range.length; i++) {\n result += Math.pow(range[i] - mean, 2);\n }\n\n return result\n}\n\nconst EXPON = {};\n\n/**\n * Returns the exponential distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value of the function.\n * @param {*} lambda The parameter value.\n * @param {*} cumulative A logical value that indicates which form of the exponential function to provide. If cumulative is TRUE, EXPON.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nEXPON.DIST = (x, lambda, cumulative) => {\n x = parseNumber(x);\n lambda = parseNumber(lambda);\n\n if (anyIsError(x, lambda)) {\n return value\n }\n\n return cumulative ? jStat.exponential.cdf(x, lambda) : jStat.exponential.pdf(x, lambda)\n};\n\nconst F = {};\n\n/**\n * Returns the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, F.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nF.DIST = (x, deg_freedom1, deg_freedom2, cumulative) => {\n x = parseNumber(x);\n deg_freedom1 = parseNumber(deg_freedom1);\n deg_freedom2 = parseNumber(deg_freedom2);\n\n if (anyIsError(x, deg_freedom1, deg_freedom2)) {\n return value\n }\n\n return cumulative\n ? jStat.centralF.cdf(x, deg_freedom1, deg_freedom2)\n : jStat.centralF.pdf(x, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.DIST.RT = function (x, deg_freedom1, deg_freedom2) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (x < 0 || deg_freedom1 < 1 || deg_freedom2 < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom1 !== 'number' || typeof deg_freedom2 !== 'number') {\n return value\n }\n\n return 1 - jStat.centralF.cdf(x, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the inverse of the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the F cumulative distribution.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.INV = (probability, deg_freedom1, deg_freedom2) => {\n probability = parseNumber(probability);\n deg_freedom1 = parseNumber(deg_freedom1);\n deg_freedom2 = parseNumber(deg_freedom2);\n\n if (anyIsError(probability, deg_freedom1, deg_freedom2)) {\n return value\n }\n\n if (probability <= 0.0 || probability > 1.0) {\n return num\n }\n\n return jStat.centralF.inv(probability, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the inverse of the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the F cumulative distribution.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.INV.RT = function (probability, deg_freedom1, deg_freedom2) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (\n probability < 0 ||\n probability > 1 ||\n deg_freedom1 < 1 ||\n deg_freedom1 > Math.pow(10, 10) ||\n deg_freedom2 < 1 ||\n deg_freedom2 > Math.pow(10, 10)\n ) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof deg_freedom1 !== 'number' || typeof deg_freedom2 !== 'number') {\n return value\n }\n\n return jStat.centralF.inv(1.0 - probability, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the result of an F-test.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first array or range of data.\n * @param {*} array2 The second array or range of data.\n * @returns\n */\nF.TEST = (array1, array2) => {\n if (!array1 || !array2) {\n return na\n }\n\n if (!(array1 instanceof Array) || !(array2 instanceof Array)) {\n return na\n }\n\n if (array1.length < 2 || array2.length < 2) {\n return div0\n }\n\n const sumOfSquares = (values, x1) => {\n let sum = 0;\n\n for (let i = 0; i < values.length; i++) {\n sum += Math.pow(values[i] - x1, 2);\n }\n\n return sum\n };\n\n const x1 = SUM(array1) / array1.length;\n const x2 = SUM(array2) / array2.length;\n const sum1 = sumOfSquares(array1, x1) / (array1.length - 1);\n const sum2 = sumOfSquares(array2, x2) / (array2.length - 1);\n\n return sum1 / sum2\n};\n\n/**\n * Returns the Fisher transformation.\n *\n * Category: Statistical\n *\n * @param {*} x A numeric value for which you want the transformation.\n * @returns\n */\nfunction FISHER(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return x\n }\n\n return Math.log((1 + x) / (1 - x)) / 2\n}\n\n/**\n * Returns the inverse of the Fisher transformation.\n *\n * Category: Statistical\n *\n * @param {*} y The value for which you want to perform the inverse of the transformation.\n * @returns\n */\nfunction FISHERINV(y) {\n y = parseNumber(y);\n\n if (y instanceof Error) {\n return y\n }\n\n const e2y = Math.exp(2 * y);\n\n return (e2y - 1) / (e2y + 1)\n}\n\n/**\n * Returns a value along a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} x The data point for which you want to predict a value.\n * @param {*} known_ys The dependent array or range of data.\n * @param {*} known_xs The independent array or range of data.\n * @returns\n */\nfunction FORECAST(x, known_ys, known_xs) {\n x = parseNumber(x);\n known_ys = parseNumberArray(flatten(known_ys));\n known_xs = parseNumberArray(flatten(known_xs));\n\n if (anyIsError(x, known_ys, known_xs)) {\n return value\n }\n\n const xmean = jStat.mean(known_xs);\n const ymean = jStat.mean(known_ys);\n const n = known_xs.length;\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_xs[i] - xmean) * (known_ys[i] - ymean);\n den += Math.pow(known_xs[i] - xmean, 2);\n }\n\n const b = num / den;\n const a = ymean - b * xmean;\n\n return a + b * x\n}\n\n/**\n * Returns a frequency distribution as a vertical array.\n *\n * Category: Statistical\n *\n * @param {*} data_array An array of or reference to a set of values for which you want to count frequencies. If data_array contains no values, FREQUENCY returns an array of zeros.\n * @param {*} bins_array An array of or reference to intervals into which you want to group the values in data_array. If bins_array contains no values, FREQUENCY returns the number of elements in data_array.\n * @returns\n */\nfunction FREQUENCY(data_array, bins_array) {\n data_array = parseNumberArray(flatten(data_array));\n bins_array = parseNumberArray(flatten(bins_array));\n\n if (anyIsError(data_array, bins_array)) {\n return value\n }\n\n const n = data_array.length;\n const b = bins_array.length;\n const r = [];\n\n for (let i = 0; i <= b; i++) {\n r[i] = 0;\n\n for (let j = 0; j < n; j++) {\n if (i === 0) {\n if (data_array[j] <= bins_array[0]) {\n r[0] += 1;\n }\n } else if (i < b) {\n if (data_array[j] > bins_array[i - 1] && data_array[j] <= bins_array[i]) {\n r[i] += 1;\n }\n } else if (i === b) {\n if (data_array[j] > bins_array[b - 1]) {\n r[b] += 1;\n }\n }\n }\n }\n\n return r\n}\n\n/**\n * Returns the Gamma function value.\n *\n * Category: Statistical\n *\n * @param {*} number Returns a number.\n * @returns\n */\nfunction GAMMA(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n if (parseInt(number, 10) === number && number < 0) {\n return num\n }\n\n return jStat.gammafn(number)\n}\n\n/**\n * Returns the gamma distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution. If beta = 1, GAMMA.DIST returns the standard gamma distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, GAMMA.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nGAMMA.DIST = function (value$1, alpha, beta, cumulative) {\n if (arguments.length !== 4) {\n return na\n }\n\n if (value$1 < 0 || alpha <= 0 || beta <= 0) {\n return value\n }\n\n if (typeof value$1 !== 'number' || typeof alpha !== 'number' || typeof beta !== 'number') {\n return value\n }\n\n return cumulative ? jStat.gamma.cdf(value$1, alpha, beta, true) : jStat.gamma.pdf(value$1, alpha, beta, false)\n};\n\n/**\n * Returns the inverse of the gamma cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the gamma distribution.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution. If beta = 1, GAMMA.INV returns the standard gamma distribution.\n * @returns\n */\nGAMMA.INV = function (probability, alpha, beta) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (probability < 0 || probability > 1 || alpha <= 0 || beta <= 0) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof alpha !== 'number' || typeof beta !== 'number') {\n return value\n }\n\n return jStat.gamma.inv(probability, alpha, beta)\n};\n\n/**\n * Returns the natural logarithm of the gamma function, \u0393(x).\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want to calculate GAMMALN.\n * @returns\n */\nfunction GAMMALN(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return x\n }\n\n return jStat.gammaln(x)\n}\n\n/**\n * Returns the natural logarithm of the gamma function, \u0393(x).\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want to calculate GAMMALN.PRECISE.\n * @returns\n */\nGAMMALN.PRECISE = function (x) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (x <= 0) {\n return num\n }\n\n if (typeof x !== 'number') {\n return value\n }\n\n return jStat.gammaln(x)\n};\n\n/**\n * Returns 0.5 less than the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} z Returns a number.\n * @returns\n */\nfunction GAUSS(z) {\n z = parseNumber(z);\n\n if (z instanceof Error) {\n return z\n }\n\n return jStat.normal.cdf(z, 0, 1) - 0.5\n}\n\n/**\n * Returns the geometric mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction GEOMEAN() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n return jStat.geomean(args)\n}\n\n/**\n * Returns values along an exponential trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values you already know in the relationship y = b*m^x.\n - If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.\n - If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.\n - If any of the numbers in known_y's is 0 or negative, GROWTH returns the #NUM! error value.\n * @param {*} known_x Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.\n - The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @param {*} new_x Optional. Are new x-values for which you want GROWTH to return corresponding y-values.\n - new_x's must include a column (or row) for each independent variable, just as known_x's does. So, if known_y's is in a single column, known_x's and new_x's must have the same number of columns. If known_y's is in a single row, known_x's and new_x's must have the same number of rows.\n - If new_x's is omitted, it is assumed to be the same as known_x's.\n - If both known_x's and new_x's are omitted, they are assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @param {*} use_const Optional. A logical value specifying whether to force the constant b to equal 1. If const is TRUE or omitted, b is calculated normally. If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.\n - If const is TRUE or omitted, b is calculated normally.\n - If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.\n * @returns\n */\nfunction GROWTH(known_y, known_x, new_x, use_const) {\n // Credits: Ilmari Karonen (http://stackoverflow.com/questions/14161990/how-to-implement-growth-function-in-javascript)\n known_y = parseNumberArray(flatten(known_y));\n\n if (known_y instanceof Error) {\n return known_y\n }\n\n // Default values for optional parameters:\n let i;\n\n if (known_x === undefined) {\n known_x = [];\n\n for (i = 1; i <= known_y.length; i++) {\n known_x.push(i);\n }\n }\n\n if (new_x === undefined) {\n new_x = known_x;\n }\n\n known_x = parseNumberArray(flatten(known_x));\n new_x = parseNumberArray(flatten(new_x));\n\n if (anyIsError(known_x, new_x)) {\n return value\n }\n\n if (use_const === undefined) {\n use_const = true;\n }\n\n // Calculate sums over the data:\n const n = known_y.length;\n let avg_x = 0;\n let avg_y = 0;\n let avg_xy = 0;\n let avg_xx = 0;\n\n for (i = 0; i < n; i++) {\n const x = known_x[i];\n const y = Math.log(known_y[i]);\n avg_x += x;\n avg_y += y;\n avg_xy += x * y;\n avg_xx += x * x;\n }\n\n avg_x /= n;\n avg_y /= n;\n avg_xy /= n;\n avg_xx /= n;\n\n // Compute linear regression coefficients:\n let beta;\n let alpha;\n\n if (use_const) {\n beta = (avg_xy - avg_x * avg_y) / (avg_xx - avg_x * avg_x);\n alpha = avg_y - beta * avg_x;\n } else {\n beta = avg_xy / avg_xx;\n alpha = 0;\n }\n\n // Compute and return result array:\n const new_y = [];\n\n for (i = 0; i < new_x.length; i++) {\n new_y.push(Math.exp(alpha + beta * new_x[i]));\n }\n\n return new_y\n}\n\n/**\n * Returns the harmonic mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction HARMEAN() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n den += 1 / range[i];\n }\n\n return n / den\n}\n\nconst HYPGEOM = {};\n\n/**\n * Returns the hypergeometric distribution.\n *\n * Category: Statistical\n *\n * @param {*} sample_s The number of successes in the sample.\n * @param {*} number_sample The size of the sample.\n * @param {*} population_s The number of successes in the population.\n * @param {*} number_pop The population size.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, then HYPGEOM.DIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.\n * @returns\n */\nHYPGEOM.DIST = (sample_s, number_sample, population_s, number_pop, cumulative) => {\n sample_s = parseNumber(sample_s);\n number_sample = parseNumber(number_sample);\n population_s = parseNumber(population_s);\n number_pop = parseNumber(number_pop);\n\n if (anyIsError(sample_s, number_sample, population_s, number_pop)) {\n return value\n }\n\n function pdf(x, n, M, N) {\n return (COMBIN(M, x) * COMBIN(N - M, n - x)) / COMBIN(N, n)\n }\n\n function cdf(x, n, M, N) {\n let result = 0;\n\n for (let i = 0; i <= x; i++) {\n result += pdf(i, n, M, N);\n }\n\n return result\n }\n\n return cumulative\n ? cdf(sample_s, number_sample, population_s, number_pop)\n : pdf(sample_s, number_sample, population_s, number_pop)\n};\n\n/**\n * Returns the intercept of the linear regression line.\n *\n * Category: Statistical\n *\n * @param {*} known_y The dependent set of observations or data.\n * @param {*} known_x The independent set of observations or data.\n * @returns\n */\nfunction INTERCEPT(known_y, known_x) {\n known_y = parseNumberArray(known_y);\n known_x = parseNumberArray(known_x);\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n if (known_y.length !== known_x.length) {\n return na\n }\n\n return FORECAST(0, known_y, known_x)\n}\n\n/**\n * Returns the kurtosis of a data set.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate kurtosis. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction KURT() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n let sigma = 0;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 4);\n }\n\n sigma = sigma / Math.pow(jStat.stdev(range, true), 4);\n\n return ((n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3))) * sigma - (3 * (n - 1) * (n - 1)) / ((n - 2) * (n - 3))\n}\n\n/**\n * Returns the k-th largest value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data for which you want to determine the k-th largest value.\n * @param {*} k The position (from the largest) in the array or value range of data to return.\n * @returns\n */\nfunction LARGE(array, k) {\n const someError = anyError.apply(undefined, array);\n\n if (someError) {\n return someError\n }\n\n if (anyIsError(k)) {\n return k\n }\n\n array = numbers(flatten(array));\n k = parseNumber(k);\n\n if (k < 0 || array.length < k) {\n return value\n }\n\n return array.sort((a, b) => b - a)[k - 1]\n}\n\n/**\n * Returns the parameters of a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values that you already know in the relationship y = mx + b.\n - If the range of known_y's is in a single column, each column of known_x's is interpreted as a separate variable.\n - If the range of known_y's is contained in a single row, each row of known_x's is interpreted as a separate variable.\n * @param {*} known_x Optional. A set of x-values that you may already know in the relationship y = mx + b.\n - The range of known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @returns\n */\nfunction LINEST(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const ymean = jStat.mean(known_y);\n const xmean = jStat.mean(known_x);\n const n = known_x.length;\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n const m = num / den;\n const b = ymean - m * xmean;\n\n return [m, b]\n}\n\n// According to Microsoft:\n// http://office.microsoft.com/en-us/starter-help/logest-function-HP010342665.aspx\n// LOGEST returns are based on the following linear model:\n// ln y = x1 ln m1 + ... + xn ln mn + ln b\n/**\n * Returns the parameters of an exponential trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values you already know in the relationship y = b*m^x.\n - If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.\n - If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.\n * @param {*} known_x Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.\n - The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a range of values with a height of one row or a width of one column (which is also known as a vector).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @returns\n */\nfunction LOGEST(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n if (known_y.length !== known_x.length) {\n return value\n }\n\n for (let i = 0; i < known_y.length; i++) {\n known_y[i] = Math.log(known_y[i]);\n }\n\n const result = LINEST(known_y, known_x);\n result[0] = Math.round(Math.exp(result[0]) * 1000000) / 1000000;\n result[1] = Math.round(Math.exp(result[1]) * 1000000) / 1000000;\n\n return result\n}\n\nconst LOGNORM = {};\n\n/**\n * Returns the cumulative lognormal distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} mean The mean of ln(x).\n * @param {*} standard_dev The standard deviation of ln(x).\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, LOGNORM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nLOGNORM.DIST = (x, mean, standard_dev, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n return cumulative ? jStat.lognormal.cdf(x, mean, standard_dev) : jStat.lognormal.pdf(x, mean, standard_dev)\n};\n\n/**\n * Returns the inverse of the lognormal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the lognormal distribution.\n * @param {*} mean The mean of ln(x).\n * @param {*} standard_dev The standard deviation of ln(x).\n * @returns\n */\nLOGNORM.INV = (probability, mean, standard_dev) => {\n probability = parseNumber(probability);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(probability, mean, standard_dev)) {\n return value\n }\n\n return jStat.lognormal.inv(probability, mean, standard_dev)\n};\n\n/**\n * Returns the maximum value in a list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 numbers for which you want to find the maximum value.\n * @returns\n */\nfunction MAX() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArguments);\n\n return range.length === 0 ? 0 : Math.max.apply(Math, range)\n}\n\n/**\n * Returns the maximum value in a list of arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2,... Number arguments 2 to 255 for which you want to find the largest value.\n * @returns\n */\nfunction MAXA() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n let range = arrayValuesToNumbers(flatArguments);\n range = range.map((value) => (value === undefined || value === null ? 0 : value));\n\n return range.length === 0 ? 0 : Math.max.apply(Math, range)\n}\n\n/**\n * Returns the maximum of all values in a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction MAXIFS() {\n const values = applyCriteria(...arguments);\n return values.length === 0 ? 0 : Math.max.apply(Math, values)\n}\n\n/**\n * Returns the median of the given numbers.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 numbers for which you want the median.\n * @returns\n */\nfunction MEDIAN() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = arrayValuesToNumbers(flatArguments);\n let result = jStat.median(range);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the minimum value in a list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is optional, subsequent numbers are optional. 1 to 255 numbers for which you want to find the minimum value.\n * @returns\n */\nfunction MIN() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArguments);\n\n return range.length === 0 ? 0 : Math.min.apply(Math, range)\n}\n\n/**\n * Returns the smallest value in a list of arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values for which you want to find the smallest value.\n * @returns\n */\nfunction MINA() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n let range = arrayValuesToNumbers(flatArguments);\n range = range.map((value) => (value === undefined || value === null ? 0 : value));\n\n return range.length === 0 ? 0 : Math.min.apply(Math, range)\n}\n\n/**\n * Returns the minimum of all values in a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction MINIFS() {\n const values = applyCriteria(...arguments);\n return values.length === 0 ? 0 : Math.min.apply(Math, values)\n}\n\nconst MODE = {};\n\n/**\n * Returns a vertical array of the most frequently occurring, or repetitive values in an array or range of data.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nMODE.MULT = function () {\n // Credits: Ro\u00F6na\u00E4n\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n const count = {};\n let maxItems = [];\n let max = 0;\n let currentItem;\n\n for (let i = 0; i < n; i++) {\n currentItem = range[i];\n count[currentItem] = count[currentItem] ? count[currentItem] + 1 : 1;\n\n if (count[currentItem] > max) {\n max = count[currentItem];\n maxItems = [];\n }\n\n if (count[currentItem] === max) {\n maxItems[maxItems.length] = currentItem;\n }\n }\n\n return maxItems\n};\n\n/**\n * Returns the most common value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Arguments 2 to 254 for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nMODE.SNGL = function () {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n return MODE.MULT(range).sort((a, b) => a - b)[0]\n};\n\nconst NEGBINOM = {};\n\n/**\n * Returns the negative binomial distribution.\n *\n * Category: Statistical\n *\n * @param {*} number_f The number of failures.\n * @param {*} number_s The threshold number of successes.\n * @param {*} probability_s The probability of a success.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, NEGBINOM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nNEGBINOM.DIST = (number_f, number_s, probability_s, cumulative) => {\n number_f = parseNumber(number_f);\n number_s = parseNumber(number_s);\n probability_s = parseNumber(probability_s);\n\n if (anyIsError(number_f, number_s, probability_s)) {\n return value\n }\n\n return cumulative\n ? jStat.negbin.cdf(number_f, number_s, probability_s)\n : jStat.negbin.pdf(number_f, number_s, probability_s)\n};\n\nconst NORM = {};\n\n/**\n * Returns the normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want the distribution.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, NORM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nNORM.DIST = (x, mean, standard_dev, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n if (standard_dev <= 0) {\n return num\n }\n\n // Return normal distribution computed by jStat [http://jstat.org]\n return cumulative ? jStat.normal.cdf(x, mean, standard_dev) : jStat.normal.pdf(x, mean, standard_dev)\n};\n\n/**\n * Returns the inverse of the normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability corresponding to the normal distribution.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @returns\n */\nNORM.INV = (probability, mean, standard_dev) => {\n probability = parseNumber(probability);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(probability, mean, standard_dev)) {\n return value\n }\n\n return jStat.normal.inv(probability, mean, standard_dev)\n};\n\nNORM.S = {};\n\n/**\n * Returns the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} z The value for which you want the distribution.\n * @param {*} cumulative Cumulative is a logical value that determines the form of the function. If cumulative is TRUE, NORMS.DIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.\n * @returns\n */\nNORM.S.DIST = (z, cumulative) => {\n z = parseNumber(z);\n\n if (z instanceof Error) {\n return value\n }\n\n return cumulative ? jStat.normal.cdf(z, 0, 1) : jStat.normal.pdf(z, 0, 1)\n};\n\n/**\n * Returns the inverse of the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability corresponding to the normal distribution.\n * @returns\n */\nNORM.S.INV = (probability) => {\n probability = parseNumber(probability);\n\n if (probability instanceof Error) {\n return value\n }\n\n return jStat.normal.inv(probability, 0, 1)\n};\n\n/**\n * Returns the Pearson product moment correlation coefficient.\n *\n * Category: Statistical\n *\n * @param {*} array1 A set of independent values.\n * @param {*} array2 A set of dependent values.\n * @returns\n */\nfunction PEARSON(array1, array2) {\n array2 = parseNumberArray(flatten(array2));\n array1 = parseNumberArray(flatten(array1));\n\n if (anyIsError(array2, array1)) {\n return value\n }\n\n const xmean = jStat.mean(array1);\n const ymean = jStat.mean(array2);\n const n = array1.length;\n let num = 0;\n let den1 = 0;\n let den2 = 0;\n\n for (let i = 0; i < n; i++) {\n num += (array1[i] - xmean) * (array2[i] - ymean);\n den1 += Math.pow(array1[i] - xmean, 2);\n den2 += Math.pow(array2[i] - ymean, 2);\n }\n\n return num / Math.sqrt(den1 * den2)\n}\n\nconst PERCENTILE = {};\n\n/**\n * Returns the k-th percentile of values in a range, where k is in the range 0..1, exclusive.\n *\n * Category: Statistical\n *\n * @returns\n */\nPERCENTILE.EXC = (array, k) => {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n const n = array.length;\n\n if (k < 1 / (n + 1) || k > 1 - 1 / (n + 1)) {\n return num\n }\n\n const l = k * (n + 1) - 1;\n const fl = Math.floor(l);\n\n return cleanFloat(l === fl ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]))\n};\n\n/**\n * Returns the k-th percentile of values in a range.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data that defines relative standing.\n * @param {*} k The percentile value in the range 0..1, inclusive.\n * @returns\n */\nPERCENTILE.INC = (array, k) => {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n const n = array.length;\n const l = k * (n - 1);\n const fl = Math.floor(l);\n\n return cleanFloat(l === fl ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]))\n};\n\nconst PERCENTRANK = {};\n\n/**\n * Returns the rank of a value in a data set as a percentage (0..1, exclusive) of the data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data with numeric values that defines relative standing\n * @param {*} x The value for which you want to know the rank.\n * @param {*} significance Optional. A value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK.EXC uses three digits (0.xxx).\n * @returns\n */\nPERCENTRANK.EXC = (array, x, significance) => {\n significance = significance === undefined ? 3 : significance;\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n significance = parseNumber(significance);\n\n if (anyIsError(array, x, significance)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n const uniques = UNIQUE.apply(null, array);\n const n = array.length;\n const m = uniques.length;\n const power = Math.pow(10, significance);\n let result = 0;\n let match = false;\n let i = 0;\n\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = (array.indexOf(uniques[i]) + 1) / (n + 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + 1 + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n + 1);\n match = true;\n }\n\n i++;\n }\n\n return Math.floor(result * power) / power\n};\n\n/**\n * Returns the percentage rank of a value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data with numeric values that defines relative standing.\n * @param {*} x The value for which you want to know the rank.\n * @param {*} significance Optional. A value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK.INC uses three digits (0.xxx).\n * @returns\n */\nPERCENTRANK.INC = (array, x, significance) => {\n significance = significance === undefined ? 3 : significance;\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n significance = parseNumber(significance);\n\n if (anyIsError(array, x, significance)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n const uniques = UNIQUE.apply(null, array);\n const n = array.length;\n const m = uniques.length;\n const power = Math.pow(10, significance);\n let result = 0;\n let match = false;\n let i = 0;\n\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = array.indexOf(uniques[i]) / (n - 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n - 1);\n match = true;\n }\n\n i++;\n }\n\n return Math.floor(result * power) / power\n};\n\n/**\n * Returns the number of permutations for a given number of objects.\n *\n * Category: Statistical\n *\n * @param {*} number An integer that describes the number of objects.\n * @param {*} number_chosen An integer that describes the number of objects in each permutation.\n * @returns\n */\nfunction PERMUT(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n\n if (anyIsError(number, number_chosen)) {\n return value\n }\n\n return FACT(number) / FACT(number - number_chosen)\n}\n\n/**\n * Returns the number of permutations for a given number of objects (with repetitions) that can be selected from the total objects.\n *\n * Category: Statistical\n *\n * @param {*} number An integer that describes the total number of objects.\n * @param {*} number_chosen An integer that describes the number of objects in each permutation.\n * @returns\n */\nfunction PERMUTATIONA(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n\n if (anyIsError(number, number_chosen)) {\n return value\n }\n\n return Math.pow(number, number_chosen)\n}\n\n/**\n * Returns the value of the density function for a standard normal distribution.\n *\n * Category: Statistical\n *\n * @param {*} x X is the number for which you want the density of the standard normal distribution.\n * @returns\n */\nfunction PHI(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return value\n }\n\n return Math.exp(-0.5 * x * x) / SQRT2PI\n}\n\nconst POISSON = {};\n\n/**\n * Returns the Poisson distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The number of events.\n * @param {*} mean The expected numeric value.\n * @param {*} cumulative A logical value that determines the form of the probability distribution returned. If cumulative is TRUE, POISSON.DIST returns the cumulative Poisson probability that the number of random events occurring will be between zero and x inclusive; if FALSE, it returns the Poisson probability mass function that the number of events occurring will be exactly x.\n * @returns\n */\nPOISSON.DIST = (x, mean, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n\n if (anyIsError(x, mean)) {\n return value\n }\n\n return cumulative ? jStat.poisson.cdf(x, mean) : jStat.poisson.pdf(x, mean)\n};\n\n/**\n * Returns the probability that values in a range are between two limits.\n *\n * Category: Statistical\n *\n * @param {*} x_range The range of numeric values of x with which there are associated probabilities.\n * @param {*} prob_range A set of probabilities associated with values in x_range.\n * @param {*} lower_limit Optional. The lower bound on the value for which you want a probability.\n * @param {*} upper_limit Optional. The optional upper bound on the value for which you want a probability.\n * @returns\n */\nfunction PROB(x_range, prob_range, lower_limit, upper_limit) {\n if (lower_limit === undefined) {\n return 0\n }\n\n upper_limit = upper_limit === undefined ? lower_limit : upper_limit;\n\n x_range = parseNumberArray(flatten(x_range));\n prob_range = parseNumberArray(flatten(prob_range));\n lower_limit = parseNumber(lower_limit);\n upper_limit = parseNumber(upper_limit);\n\n if (anyIsError(x_range, prob_range, lower_limit, upper_limit)) {\n return value\n }\n\n if (lower_limit === upper_limit) {\n return x_range.indexOf(lower_limit) >= 0 ? prob_range[x_range.indexOf(lower_limit)] : 0\n }\n\n const sorted = x_range.sort((a, b) => a - b);\n const n = sorted.length;\n let result = 0;\n\n for (let i = 0; i < n; i++) {\n if (sorted[i] >= lower_limit && sorted[i] <= upper_limit) {\n result += prob_range[x_range.indexOf(sorted[i])];\n }\n }\n\n return result\n}\n\nconst QUARTILE = {};\n\n/**\n * Returns the quartile of the data set, based on percentile values from 0..1, exclusive.\n *\n * Category: Statistical\n *\n * @param {*} array The array or value range of numeric values for which you want the quartile value.\n * @param {*} quart Indicates which value to return.\n * @returns\n */\nQUARTILE.EXC = (range, quart) => {\n range = parseNumberArray(flatten(range));\n quart = parseNumber(quart);\n\n if (anyIsError(range, quart)) {\n return value\n }\n\n switch (quart) {\n case 1:\n return PERCENTILE.EXC(range, 0.25)\n case 2:\n return PERCENTILE.EXC(range, 0.5)\n case 3:\n return PERCENTILE.EXC(range, 0.75)\n default:\n return num\n }\n};\n\n/**\n * Returns the quartile of a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or value range of numeric values for which you want the quartile value.\n * @param {*} quart Indicates which value to return.\n * @returns\n */\nQUARTILE.INC = (range, quart) => {\n range = parseNumberArray(flatten(range));\n quart = parseNumber(quart);\n\n if (anyIsError(range, quart)) {\n return value\n }\n\n switch (quart) {\n case 1:\n return PERCENTILE.INC(range, 0.25)\n case 2:\n return PERCENTILE.INC(range, 0.5)\n case 3:\n return PERCENTILE.INC(range, 0.75)\n default:\n return num\n }\n};\n\nconst RANK = {};\n\n/**\n * Returns the rank of a number in a list of numbers.\n *\n * Category: Statistical\n *\n * @param {*} number The number whose rank you want to find.\n * @param {*} ref An array of, or a reference to, a list of numbers. Nonnumeric values in Ref are ignored.\n * @param {*} order Optional. A number specifying how to rank number.\n * @returns\n */\nRANK.AVG = (number, ref, order) => {\n number = parseNumber(number);\n ref = parseNumberArray(flatten(ref));\n\n if (anyIsError(number, ref)) {\n return value\n }\n\n ref = flatten(ref);\n order = order || false;\n const sort = order ? (a, b) => a - b : (a, b) => b - a;\n ref = ref.sort(sort);\n\n const length = ref.length;\n let count = 0;\n\n for (let i = 0; i < length; i++) {\n if (ref[i] === number) {\n count++;\n }\n }\n\n return count > 1 ? (2 * ref.indexOf(number) + count + 1) / 2 : ref.indexOf(number) + 1\n};\n\n/**\n * Returns the rank of a number in a list of numbers.\n *\n * Category: Statistical\n *\n * @param {*} number The number whose rank you want to find.\n * @param {*} ref An array of, or a reference to, a list of numbers. Non-numeric values in Ref are ignored.\n * @param {*} order Optional. A number specifying how to rank number.\n * @returns\n */\nRANK.EQ = (number, ref, order) => {\n number = parseNumber(number);\n ref = parseNumberArray(flatten(ref));\n\n if (anyIsError(number, ref)) {\n return value\n }\n\n order = order || false;\n const sort = order ? (a, b) => a - b : (a, b) => b - a;\n ref = ref.sort(sort);\n\n return ref.indexOf(number) + 1\n};\n\n/**\n * Returns the row number of a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} reference the value or range of values for which you want the row number.\n * @param {*} index\n * @returns\n */\nfunction ROW(reference, index) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (index < 0) {\n return num\n }\n\n if (!(reference instanceof Array) || typeof index !== 'number') {\n return value\n }\n\n if (reference.length === 0) {\n return undefined\n }\n\n return jStat.row(reference, index)\n}\n\n/**\n * Returns the square of the Pearson product moment correlation coefficient.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or range of data points.\n * @param {*} known_x An array or range of data points.\n * @returns\n */\nfunction RSQ(known_y, known_x) {\n // no need to flatten here, PEARSON will take care of that\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n return Math.pow(PEARSON(known_y, known_x), 2)\n}\n\n/**\n * Returns the skewness of a distribution.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate skewness. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction SKEW() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n let sigma = 0;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 3);\n }\n\n return (n * sigma) / ((n - 1) * (n - 2) * Math.pow(jStat.stdev(range, true), 3))\n}\n\n/**\n * Returns the skewness of a distribution based on a population.\n *\n * Category: Statistical\n *\n * @returns\n */\nSKEW.P = function () {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n let m2 = 0;\n let m3 = 0;\n\n for (let i = 0; i < n; i++) {\n m3 += Math.pow(range[i] - mean, 3);\n m2 += Math.pow(range[i] - mean, 2);\n }\n\n m3 = m3 / n;\n m2 = m2 / n;\n\n return m3 / Math.pow(m2, 3 / 2)\n};\n\n/**\n * Returns the slope of the linear regression line.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or value range of numeric dependent data points.\n * @param {*} known_x The set of independent data points.\n * @returns\n */\nfunction SLOPE(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const xmean = jStat.mean(known_x);\n const ymean = jStat.mean(known_y);\n const n = known_x.length;\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n return num / den\n}\n\n/**\n * Returns the k-th smallest value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array An array or range of numerical data for which you want to determine the k-th smallest value.\n * @param {*} k The position (from the smallest) in the array or range of data to return.\n * @returns\n */\nfunction SMALL(array, k) {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return array\n }\n\n return array.sort((a, b) => a - b)[k - 1]\n}\n\n/**\n * Returns a normalized value.\n *\n * Category: Statistical\n *\n * @param {*} x The value you want to normalize.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @returns\n */\nfunction STANDARDIZE(x, mean, standard_dev) {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n return (x - mean) / standard_dev\n}\n\nconst STDEV = {};\n\n/**\n * Calculates standard deviation based on the entire population.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nSTDEV.P = function () {\n const v = VAR.P.apply(this, arguments);\n let result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n};\n\n/**\n * Estimates standard deviation based on a sample.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nSTDEV.S = function () {\n const v = VAR.S.apply(this, arguments);\n const result = Math.sqrt(v);\n\n return result\n};\n\n/**\n * Estimates standard deviation based on a sample, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction STDEVA() {\n const v = VARA.apply(this, arguments);\n const result = Math.sqrt(v);\n\n return result\n}\n\n/**\n * Calculates standard deviation based on the entire population, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction STDEVPA() {\n const v = VARPA.apply(this, arguments);\n let result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the standard error of the predicted y-value for each x in the regression.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or range of dependent data points.\n * @param {*} known_x An array or range of independent data points.\n * @returns\n */\nfunction STEYX(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const xmean = jStat.mean(known_x);\n const ymean = jStat.mean(known_y);\n const n = known_x.length;\n let lft = 0;\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n lft += Math.pow(known_y[i] - ymean, 2);\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n return Math.sqrt((lft - (num * num) / den) / (n - 2))\n}\n\nconst T$1 = {};\n\n/**\n * Returns the Percentage Points (probability) for the Student t-distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, T.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nT$1.DIST = (x, deg_freedom, cumulative) => {\n if (cumulative !== 1 && cumulative !== 2) {\n return num\n }\n\n return cumulative === 1 ? T$1.DIST.RT(x, deg_freedom) : T$1.DIST['2T'](x, deg_freedom)\n};\n\n/**\n * Returns the Percentage Points (probability) for the Student t-distribution\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution.\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @returns\n */\nT$1.DIST['2T'] = function (x, deg_freedom) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (x < 0 || deg_freedom < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return (1 - jStat.studentt.cdf(x, deg_freedom)) * 2\n};\n\n/**\n * Returns the Student's t-distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution.\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @returns\n */\nT$1.DIST.RT = function (x, deg_freedom) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (x < 0 || deg_freedom < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return 1 - jStat.studentt.cdf(x, deg_freedom)\n};\n\n/**\n * Returns the t-value of the Student's t-distribution as a function of the probability and the degrees of freedom.\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the Student's t-distribution.\n * @param {*} deg_freedom The number of degrees of freedom with which to characterize the distribution.\n * @returns\n */\nT$1.INV = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return jStat.studentt.inv(probability, deg_freedom)\n};\n\n/**\n * Returns the inverse of the Student's t-distribution\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the Student's t-distribution.\n * @param {*} deg_freedom The number of degrees of freedom with which to characterize the distribution.\n * @returns\n */\nT$1.INV['2T'] = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (probability <= 0 || probability > 1 || deg_freedom < 1) {\n return num\n }\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return Math.abs(jStat.studentt.inv(probability / 2, deg_freedom))\n};\n\n// The algorithm can be found here:\n// http://www.chem.uoa.gr/applets/AppletTtest/Appl_Ttest2.html\n/**\n * Returns the probability associated with a Student's t-test.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first data set.\n * @param {*} array2 The second data set.\n * @returns\n */\nT$1.TEST = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n const mean_x = jStat.mean(array1);\n const mean_y = jStat.mean(array2);\n let s_x = 0;\n let s_y = 0;\n let i;\n\n for (i = 0; i < array1.length; i++) {\n s_x += Math.pow(array1[i] - mean_x, 2);\n }\n\n for (i = 0; i < array2.length; i++) {\n s_y += Math.pow(array2[i] - mean_y, 2);\n }\n\n s_x = s_x / (array1.length - 1);\n s_y = s_y / (array2.length - 1);\n\n const t = Math.abs(mean_x - mean_y) / Math.sqrt(s_x / array1.length + s_y / array2.length);\n\n return T$1.DIST['2T'](t, array1.length + array2.length - 2)\n};\n\n/**\n * Returns values along a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} known_ys The set of y-values you already know in the relationship y = mx + b\n * @param {*} known_xs An optional set of x-values that you may already know in the relationship y = mx + b\n * @param {*} new_xs Optional. New x-values for which you want TREND to return corresponding y-values.\n * @returns\n */\nfunction TREND(known_ys, known_xs, new_xs) {\n known_ys = parseNumberArray(flatten(known_ys));\n known_xs = parseNumberArray(flatten(known_xs));\n new_xs = parseNumberArray(flatten(new_xs));\n\n if (anyIsError(known_ys, known_xs, new_xs)) {\n return value\n }\n\n const linest = LINEST(known_ys, known_xs);\n const m = linest[0];\n const b = linest[1];\n const result = [];\n\n new_xs.forEach((x) => {\n result.push(m * x + b);\n });\n\n return result\n}\n\n/**\n * Returns the mean of the interior of a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of values to trim and average.\n * @param {*} percent The fractional number of data points to exclude from the calculation. For example, if percent = 0.2, 4 points are trimmed from a data set of 20 points (20 x 0.2): 2 from the top and 2 from the bottom of the set.\n * @returns\n */\nfunction TRIMMEAN(range, percent) {\n range = parseNumberArray(flatten(range));\n percent = parseNumber(percent);\n\n if (anyIsError(range, percent)) {\n return value\n }\n\n const trim = FLOOR(range.length * percent, 2) / 2;\n\n return jStat.mean(\n initial(\n rest(\n range.sort((a, b) => a - b),\n trim\n ),\n trim\n )\n )\n}\n\nconst VAR = {};\n\n/**\n * Calculates variance based on the entire population.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a population.\n * @returns\n */\nVAR.P = function () {\n const range = numbers(flatten(arguments));\n const n = range.length;\n let sigma = 0;\n const mean = AVERAGE(range);\n let result;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n\n result = sigma / n;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n};\n\n/**\n * Estimates variance based on a sample.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a sample of a population.\n * @returns\n */\nVAR.S = function () {\n const range = numbers(flatten(arguments));\n const n = range.length;\n let sigma = 0;\n const mean = AVERAGE(range);\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n\n return sigma / (n - 1)\n};\n\n/**\n * Estimates variance based on a sample, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a sample of a population.\n * @returns\n */\nfunction VARA() {\n const range = flatten(arguments);\n const n = range.length;\n let sigma = 0;\n let count = 0;\n const mean = AVERAGEA(range);\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n return sigma / (count - 1)\n}\n\n/**\n * Calculates variance based on the entire population, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a population.\n * @returns\n */\nfunction VARPA() {\n const range = flatten(arguments);\n const n = range.length;\n let sigma = 0;\n let count = 0;\n const mean = AVERAGEA(range);\n let result;\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n result = sigma / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\nconst WEIBULL = {};\n\n/**\n * Returns the Weibull distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution.\n * @param {*} cumulative Determines the form of the function.\n * @returns\n */\nWEIBULL.DIST = (x, alpha, beta, cumulative) => {\n x = parseNumber(x);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n\n if (anyIsError(x, alpha, beta)) {\n return value\n }\n\n return cumulative\n ? 1 - Math.exp(-Math.pow(x / beta, alpha))\n : (Math.pow(x, alpha - 1) * Math.exp(-Math.pow(x / beta, alpha)) * alpha) / Math.pow(beta, alpha)\n};\n\nconst Z = {};\n\n/**\n * Returns the one-tailed probability-value of a z-test.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data against which to test x.\n * @param {*} x The value to test.\n * @param {*} sigma Optional. The population (known) standard deviation. If omitted, the sample standard deviation is used.\n * @returns\n */\nZ.TEST = (array, x, sigma) => {\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n\n if (anyIsError(array, x)) {\n return value\n }\n\n sigma = sigma || STDEV.S(array);\n const n = array.length;\n\n return 1 - NORM.S.DIST((AVERAGE(array) - x) / (sigma / Math.sqrt(n)), true)\n};\n\n/**\n * Returns the absolute value of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The real number of which you want the absolute value.\n * @returns\n */\nfunction ABS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const result = Math.abs(number);\n\n return result\n}\n\n/**\n * Returns the arccosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The cosine of the angle you want and must be from -1 to 1.\n * @returns\n */\nfunction ACOS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.acos(number);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the inverse hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number equal to or greater than 1.\n * @returns\n */\nfunction ACOSH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.log(number + Math.sqrt(number * number - 1));\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the arccotangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Number is the cotangent of the angle you want. This must be a real number.\n * @returns\n */\nfunction ACOT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const result = Math.atan(1 / number);\n\n return result\n}\n\n/**\n * Returns the hyperbolic arccotangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The absolute value of Number must be greater than 1.\n * @returns\n */\nfunction ACOTH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = 0.5 * Math.log((number + 1) / (number - 1));\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n// TODO: use options\n/**\n * Returns an aggregate in a list or database.\n *\n * Category: Math and trigonometry\n *\n * @param {*} function_num A number 1 to 19 that specifies which function to use.\n * @param {*} options A numerical value that determines which values to ignore in the evaluation range for the function. Note: The function will not ignore hidden rows, nested subtotals or nested aggregates if the array argument includes a calculation, for example: =AGGREGATE(14,3,A1:A100*(A1:A100>0),1)\n * @param {*} ref1 The first numeric argument for functions that take multiple numeric arguments for which you want the aggregate value.\n * @param {*} ref2 Optional. Numeric arguments 2 to 253 for which you want the aggregate value. For functions that take an array, ref1 is an array, an array formula, or a reference to a range of values for which you want the aggregate value. Ref2 is a second argument that is required for certain functions.\n * @returns\n */\nfunction AGGREGATE(function_num, options, ref1, ref2) {\n function_num = parseNumber(function_num);\n options = parseNumber(function_num);\n\n if (anyIsError(function_num, options)) {\n return value\n }\n\n switch (function_num) {\n case 1:\n return AVERAGE(ref1)\n case 2:\n return COUNT(ref1)\n case 3:\n return COUNTA(ref1)\n case 4:\n return MAX(ref1)\n case 5:\n return MIN(ref1)\n case 6:\n return PRODUCT(ref1)\n case 7:\n return STDEV.S(ref1)\n case 8:\n return STDEV.P(ref1)\n case 9:\n return SUM(ref1)\n case 10:\n return VAR.S(ref1)\n case 11:\n return VAR.P(ref1)\n case 12:\n return MEDIAN(ref1)\n case 13:\n return MODE.SNGL(ref1)\n case 14:\n return LARGE(ref1, ref2)\n case 15:\n return SMALL(ref1, ref2)\n case 16:\n return PERCENTILE.INC(ref1, ref2)\n case 17:\n return QUARTILE.INC(ref1, ref2)\n case 18:\n return PERCENTILE.EXC(ref1, ref2)\n case 19:\n return QUARTILE.EXC(ref1, ref2)\n }\n}\n\n/**\n * Converts a Roman number to Arabic, as a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} text A string enclosed in quotation marks, an empty string (\"\"), or a reference to a value containing text.\n * @returns\n */\nfunction ARABIC(text) {\n if (text === undefined || text === null) {\n return 0\n }\n\n if (text instanceof Error) {\n return text\n }\n\n // Credits: Rafa? Kukawski\n if (!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(text)) {\n return value\n }\n\n let r = 0;\n text.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g, (i) => {\n r += {\n M: 1000,\n CM: 900,\n D: 500,\n CD: 400,\n C: 100,\n XC: 90,\n L: 50,\n XL: 40,\n X: 10,\n IX: 9,\n V: 5,\n IV: 4,\n I: 1\n }[i];\n });\n\n return r\n}\n\n/**\n * Returns the arcsine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The sine of the angle you want and must be from -1 to 1.\n * @returns\n */\nfunction ASIN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.asin(number);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the inverse hyperbolic sine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction ASINH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.log(number + Math.sqrt(number * number + 1))\n}\n\n/**\n * Returns the arctangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The tangent of the angle you want.\n * @returns\n */\nfunction ATAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.atan(number)\n}\n\n/**\n * Returns the arctangent from x- and y-coordinates.\n *\n * Category: Math and trigonometry\n *\n * @param {*} x_num The x-coordinate of the point.\n * @param {*} y_num The y-coordinate of the point.\n * @returns\n */\nfunction ATAN2(x_num, y_num) {\n x_num = parseNumber(x_num);\n y_num = parseNumber(y_num);\n const anyError$1 = anyError(x_num, y_num);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return Math.atan2(x_num, y_num)\n}\n\n/**\n * Returns the inverse hyperbolic tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number between 1 and -1.\n * @returns\n */\nfunction ATANH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.log((1 + number) / (1 - number)) / 2;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Converts a number into a text representation with the given radix (base).\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number that you want to convert. Must be an integer greater than or equal to 0 and less than 2^53.\n * @param {*} radix The base radix that you want to convert the number into. Must be an integer greater than or equal to 2 and less than or equal to 36.\n * @param {*} min_length Optional. The minimum length of the returned string. Must be an integer greater than or equal to 0.\n * @returns\n */\nfunction BASE(number, radix, min_length) {\n number = parseNumber(number);\n radix = parseNumber(radix);\n min_length = parseNumber(min_length);\n const anyError$1 = anyError(number, radix, min_length);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (radix === 0) {\n return num\n }\n\n const result = number.toString(radix);\n\n return new Array(Math.max(min_length + 1 - result.length, 0)).join('0') + result\n}\n\n/**\n * Rounds a number to the nearest integer or to the nearest multiple of significance.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value you want to round.\n * @param {*} significance The multiple to which you want to round.\n * @param {*} mode Optional. For negative numbers, controls whether Number is rounded toward or away from zero.\n * @returns\n */\nfunction CEILING(number, significance, mode) {\n number = parseNumber(number);\n significance = parseNumber(significance);\n mode = parseNumber(mode);\n const anyError$1 = anyError(number, significance, mode);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n significance = Math.abs(significance);\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n if (number >= 0) {\n return ROUND(Math.ceil(number / significance) * significance, precision)\n } else {\n if (mode === 0) {\n return -ROUND(Math.floor(Math.abs(number) / significance) * significance, precision)\n } else {\n return -ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision)\n }\n }\n}\n\nCEILING.MATH = CEILING;\n\nCEILING.PRECISE = CEILING;\n\n/**\n * Returns the number of combinations for a given number of objects.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number of items.\n * @param {*} number_chosen The number of items in each combination.\n * @returns\n */\nfunction COMBIN(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n const anyError$1 = anyError(number, number_chosen);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number < number_chosen) {\n return num\n }\n\n return FACT(number) / (FACT(number_chosen) * FACT(number - number_chosen))\n}\n\n/**\n * Returns the number of combinations with repetitions for a given number of items.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Must be greater than or equal to 0, and greater than or equal to Number_chosen. Non-integer values are truncated.\n * @param {*} number_chosen Must be greater than or equal to 0. Non-integer values are truncated.\n * @returns\n */\nfunction COMBINA(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n const anyError$1 = anyError(number, number_chosen);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number < number_chosen) {\n return num\n }\n\n return number === 0 && number_chosen === 0 ? 1 : COMBIN(number + number_chosen - 1, number - 1)\n}\n\n/**\n * Returns the cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the cosine.\n * @returns\n */\nfunction COS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.cos(number)\n}\n\n/**\n * Returns the hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number for which you want to find the hyperbolic cosine.\n * @returns\n */\nfunction COSH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return (Math.exp(number) + Math.exp(-number)) / 2\n}\n\n/**\n * Returns the hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the cotangent.\n * @returns\n */\nfunction COT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 1 / Math.tan(number)\n}\n\n/**\n * Returns the cotangent of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction COTH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n const e2 = Math.exp(2 * number);\n\n return (e2 + 1) / (e2 - 1)\n}\n\n/**\n * Returns the cosecant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction CSC(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 1 / Math.sin(number)\n}\n\n/**\n * Returns the hyperbolic cosecant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction CSCH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 2 / (Math.exp(number) - Math.exp(-number))\n}\n\n/**\n * Converts a text representation of a number in a given base into a decimal number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} text\n * @param {*} radix Radix must be an integer.\n * @returns\n */\nfunction DECIMAL(text, radix) {\n if (arguments.length < 2) {\n return na\n }\n\n text = text || '0';\n radix = parseNumber(radix);\n const anyError$1 = anyError(text, radix);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (radix === 0) {\n return num\n }\n\n const result = parseInt(text, radix);\n\n if (isNaN(result)) {\n return num\n }\n\n return result\n}\n\n/**\n * Converts radians to degrees.\n *\n * Category: Math and trigonometry\n *\n * @param {*} angle The angle in radians that you want to convert.\n * @returns\n */\nfunction DEGREES(angle) {\n angle = parseNumber(angle);\n\n if (angle instanceof Error) {\n return angle\n }\n\n return (angle * 180) / Math.PI\n}\n\n/**\n * Rounds a number up to the nearest even integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to round.\n * @returns\n */\nfunction EVEN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return CEILING(number, -2, -1)\n}\n\n/**\n * Returns e raised to the power of a given number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The exponent applied to the base e.\n * @returns\n */\nfunction EXP(number) {\n if (arguments.length < 1) {\n return na\n }\n\n if (arguments.length > 1) {\n return error\n }\n\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n number = Math.exp(number);\n\n return number\n}\n\nconst MEMOIZED_FACT = [];\n/**\n * Returns the factorial of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The nonnegative number for which you want the factorial. If number is not an integer, it is truncated.\n * @returns\n */\nfunction FACT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const n = Math.floor(number);\n\n if (n === 0 || n === 1) {\n return 1\n } else if (MEMOIZED_FACT[n] > 0) {\n return MEMOIZED_FACT[n]\n } else {\n MEMOIZED_FACT[n] = FACT(n - 1) * n;\n\n return MEMOIZED_FACT[n]\n }\n}\n\n/**\n * Returns the double factorial of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value for which to return the double factorial. If number is not an integer, it is truncated.\n * @returns\n */\nfunction FACTDOUBLE(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const n = Math.floor(number);\n\n return n <= 0 ? 1 : n * FACTDOUBLE(n - 2)\n}\n\n/**\n * Rounds a number down, toward zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The numeric value you want to round.\n * @param {*} significance The multiple to which you want to round.\n * @returns\n */\nfunction FLOOR(number, significance) {\n number = parseNumber(number);\n significance = parseNumber(significance);\n const anyError$1 = anyError(number, significance);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n if (!(number >= 0 && significance > 0) && !(number <= 0 && significance < 0)) {\n return num\n }\n\n significance = Math.abs(significance);\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n return number >= 0\n ? ROUND(Math.floor(number / significance) * significance, precision)\n : -ROUND(Math.ceil(Math.abs(number) / significance), precision)\n}\n\n// TODO: Verify\n\n/**\n * Rounds a number down, to the nearest integer or to the nearest multiple of significance.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number to be rounded down.\n * @param {*} significance Optional. The multiple to which you want to round.\n * @param {*} mode Optional. The direction (toward or away from 0) to round negative numbers.\n * @returns\n */\nFLOOR.MATH = (number, significance, mode) => {\n if (significance instanceof Error) {\n return significance\n }\n\n significance = significance === undefined ? 0 : significance;\n\n number = parseNumber(number);\n significance = parseNumber(significance);\n mode = parseNumber(mode);\n const anyError$1 = anyError(number, significance, mode);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n significance = significance ? Math.abs(significance) : 1;\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n if (number >= 0) {\n return ROUND(Math.floor(number / significance) * significance, precision)\n } else if (mode === 0 || mode === undefined) {\n return -ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision)\n }\n\n return -ROUND(Math.floor(Math.abs(number) / significance) * significance, precision)\n};\n\n// Deprecated\n\n/**\n * Rounds a number the nearest integer or to the nearest multiple of significance. Regardless of the sign of the number, the number is rounded up.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to be rounded.\n * @param {*} significance Optional. The multiple to which number is to be rounded. If significance is omitted, its default value is 1.\n * @returns\n */\nFLOOR.PRECISE = FLOOR['MATH'];\n\n// adapted http://rosettacode.org/wiki/Greatest_common_divisor#JavaScript\n/**\n * Returns the greatest common divisor.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 values. If any value is not an integer, it is truncated.\n * @returns\n */\nfunction GCD() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n const r0 = range[0];\n let x = r0 < 0 ? -r0 : r0;\n\n for (let i = 1; i < n; i++) {\n const ri = range[i];\n let y = ri < 0 ? -ri : ri;\n\n while (x && y) {\n if (x > y) {\n x %= y;\n } else {\n y %= x;\n }\n }\n\n x += y;\n }\n\n return x\n}\n\n/**\n * Rounds a number down to the nearest integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The real number you want to round down to an integer.\n * @returns\n */\nfunction INT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.floor(number)\n}\n\n// TODO: verify\nconst ISO = {\n CEILING: CEILING\n};\n\n/**\n * Returns the least common multiple.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2,... Number1 is required, subsequent numbers are optional. 1 to 255 values for which you want the least common multiple. If value is not an integer, it is truncated.\n * @returns\n */\nfunction LCM() {\n // Credits: Jonas Raoni Soares Silva\n const o = parseNumberArray(flatten(arguments));\n\n if (o instanceof Error) {\n return o\n }\n\n for (var i, j, n, d, r = 1; (n = o.pop()) !== undefined; ) {\n if (n === 0) {\n return 0\n }\n\n while (n > 1) {\n if (n % 2) {\n for (i = 3, j = Math.floor(Math.sqrt(n)); i <= j && n % i; i += 2) {\n // empty\n }\n\n d = i <= j ? i : n;\n } else {\n d = 2;\n }\n\n for (n /= d, r *= d, i = o.length; i; o[--i] % d === 0 && (o[i] /= d) === 1 && o.splice(i, 1)) {\n // empty\n }\n }\n }\n\n return r\n}\n\n/**\n * Returns the natural logarithm of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the natural logarithm.\n * @returns\n */\nfunction LN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n return Math.log(number)\n}\n\n/**\n * Returns the logarithm of a number to a specified base.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the logarithm.\n * @param {*} base Optional. The base of the logarithm. If base is omitted, it is assumed to be 10.\n * @returns\n */\nfunction LOG(number, base) {\n number = parseNumber(number);\n base = parseNumber(base);\n const anyError$1 = anyError(number, base);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number === 0 || base === 0) {\n return num\n }\n\n return Math.log(number) / Math.log(base)\n}\n\n/**\n * Returns the base-10 logarithm of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the base-10 logarithm.\n * @returns\n */\nfunction LOG10(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n return Math.log(number) / Math.log(10)\n}\n\n/**\n * Returns the matrix product of two arrays. The result is an array with the same number of rows as array1 and the same number of columns as array2.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array1 Required. 1st array you want to multiply.\n * @param {*} array2 Required. 2nd array you want to multiply.\n * @returns\n */\nfunction MMULT(array1, array2) {\n if (\n //Arguments are not arrays\n !Array.isArray(array1) ||\n !Array.isArray(array2) ||\n // There are empty arrays\n array1.some((el) => !el.length) ||\n array2.some((el) => !el.length) ||\n // Not all array elements are numbers\n flattenShallow(array1).some((el) => typeof el !== 'number') ||\n flattenShallow(array2).some((el) => typeof el !== 'number') ||\n // Number of columns in array1 is different from the number of rows in array2\n array1[0].length !== array2.length\n ) {\n return value\n }\n\n const matrix = Array(array1.length)\n .fill(0)\n .map(() => Array(array2[0].length).fill(0));\n\n return matrix.map((row, i) => row.map((_, j) => array1[i].reduce((sum, el, k) => sum + el * array2[k][j], 0)))\n}\n\n/**\n * Returns the remainder from division.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number for which you want to find the remainder.\n * @param {*} divisor The number by which you want to divide number.\n * @returns\n */\nfunction MOD(number, divisor) {\n number = parseNumber(number);\n divisor = parseNumber(divisor);\n const anyError$1 = anyError(number, divisor);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (divisor === 0) {\n return div0\n }\n\n let modulus = Math.abs(number % divisor);\n modulus = number < 0 ? divisor - modulus : modulus;\n\n return divisor > 0 ? modulus : -modulus\n}\n\n/**\n * Returns a number rounded to the desired multiple.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to round.\n * @param {*} multiple The multiple to which you want to round number.\n * @returns\n */\nfunction MROUND(number, multiple) {\n number = parseNumber(number);\n multiple = parseNumber(multiple);\n const anyError$1 = anyError(number, multiple);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number * multiple === 0) {\n return 0\n }\n\n if (number * multiple < 0) {\n return num\n }\n\n return Math.round(number / multiple) * multiple\n}\n\n/**\n * Returns the multinomial of a set of numbers.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 values for which you want the multinomial.\n * @returns\n */\nfunction MULTINOMIAL() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n let sum = 0;\n let divisor = 1;\n\n for (let i = 0; i < args.length; i++) {\n sum += args[i];\n divisor *= FACT(args[i]);\n }\n\n return FACT(sum) / divisor\n}\n\n/**\n * Returns the unit matrix for the specified dimension.\n *\n * Category: Math and trigonometry\n *\n * @param {*} dimension Required. Dimension is an integer specifying the dimension of the unit matrix that you want to return. It returns an array. The dimension has to be greater than zero.\n * @returns\n */\nfunction MUNIT(dimension) {\n if (arguments.length > 1) {\n return na\n }\n\n dimension = parseInt(dimension);\n\n if (!dimension || dimension <= 0) {\n return value\n }\n\n return Array(dimension)\n .fill(0)\n .map(() => Array(dimension).fill(0))\n .map((el, i) => {\n el[i] = 1;\n return el\n })\n}\n\n/**\n * Rounds a number up to the nearest odd integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number: The value to round.\n * @returns\n */\nfunction ODD(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let temp = Math.ceil(Math.abs(number));\n temp = temp & 1 ? temp : temp + 1;\n\n return number >= 0 ? temp : -temp\n}\n\n/**\n * Returns the value of pi.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction PI() {\n return Math.PI\n}\n\n/**\n * Returns the result of a number raised to a power.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The base number. It can be any real number.\n * @param {*} power The exponent to which the base number is raised.\n * @returns\n */\nfunction POWER(number, power) {\n number = parseNumber(number);\n power = parseNumber(power);\n const anyError$1 = anyError(number, power);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number === 0 && power === 0) {\n return num\n }\n\n const result = Math.pow(number, power);\n\n if (isNaN(result)) {\n return num\n }\n\n return result\n}\n\n/**\n * Multiplies its arguments.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number1 The first number or range that you want to multiply.\n * @param {*} args number2, ... Optional. Additional numbers or ranges that you want to multiply, up to a maximum of 255 arguments.\n * @returns\n */\nfunction PRODUCT() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter((arg) => arg !== undefined && arg !== null);\n\n if (flatArgumentsDefined.length === 0) {\n return 0\n }\n\n const args = parseNumberArray(flatArgumentsDefined);\n\n if (args instanceof Error) {\n return args\n }\n\n let result = 1;\n\n for (let i = 0; i < args.length; i++) {\n result *= args[i];\n }\n\n return result\n}\n\n/**\n * Returns the integer portion of a division.\n *\n * Category: Math and trigonometry\n *\n * @param {*} numerator The dividend.\n * @param {*} denominator The divisor.\n * @returns\n */\nfunction QUOTIENT(numerator, denominator) {\n numerator = parseNumber(numerator);\n denominator = parseNumber(denominator);\n const anyError$1 = anyError(numerator, denominator);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return parseInt(numerator / denominator, 10)\n}\n\n/**\n * Converts degrees to radians.\n *\n * Category: Math and trigonometry\n *\n * @param {*} angle An angle in degrees that you want to convert.\n * @returns\n */\nfunction RADIANS(angle) {\n angle = parseNumber(angle);\n\n if (angle instanceof Error) {\n return angle\n }\n\n return (angle * Math.PI) / 180\n}\n\n/**\n * Returns a random number between 0 and 1.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction RAND() {\n return Math.random()\n}\n\n/**\n * Returns a random number between the numbers you specify.\n *\n * Category: Math and trigonometry\n *\n * @param {*} bottom The smallest integer RANDBETWEEN will return.\n * @param {*} top The largest integer RANDBETWEEN will return.\n * @returns\n */\nfunction RANDBETWEEN(bottom, top) {\n bottom = parseNumber(bottom);\n top = parseNumber(top);\n const anyError$1 = anyError(bottom, top);\n\n if (anyError$1) {\n return anyError$1\n }\n // Creative Commons Attribution 3.0 License\n // Copyright (c) 2012 eqcode\n\n return bottom + Math.ceil((top - bottom + 1) * Math.random()) - 1\n}\n\n// TODO\n/**\n * Converts an arabic numeral to roman, as text.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The Arabic numeral you want converted.\n * @returns\n */\nfunction ROMAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // The MIT License\n // Copyright (c) 2008 Steven Levithan\n const digits = String(number).split('');\n const key = [\n '',\n 'C',\n 'CC',\n 'CCC',\n 'CD',\n 'D',\n 'DC',\n 'DCC',\n 'DCCC',\n 'CM',\n '',\n 'X',\n 'XX',\n 'XXX',\n 'XL',\n 'L',\n 'LX',\n 'LXX',\n 'LXXX',\n 'XC',\n '',\n 'I',\n 'II',\n 'III',\n 'IV',\n 'V',\n 'VI',\n 'VII',\n 'VIII',\n 'IX'\n ];\n let roman = '';\n let i = 3;\n\n while (i--) {\n roman = (key[+digits.pop() + i * 10] || '') + roman;\n }\n\n return new Array(+digits.join('') + 1).join('M') + roman\n}\n\n/**\n * Rounds a number to a specified number of digits.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number that you want to round.\n * @param {*} num_digits The number of digits to which you want to round the number argument.\n * @returns\n */\nfunction ROUND(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return Number(Math.round(Number(number + 'e' + num_digits)) + 'e' + num_digits * -1)\n}\n\n/**\n * Rounds a number down, toward zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number that you want rounded down.\n * @param {*} num_digits The number of digits to which you want to round number.\n * @returns\n */\nfunction ROUNDDOWN(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.floor(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Rounds a number up, away from zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number that you want rounded up.\n * @param {*} num_digits The number of digits to which you want to round number.\n * @returns\n */\nfunction ROUNDUP(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.ceil(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Returns the secant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the secant.\n * @returns\n */\nfunction SEC(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return 1 / Math.cos(number)\n}\n\n/**\n * Returns the hyperbolic secant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the hyperbolic secant.\n * @returns\n */\nfunction SECH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return 2 / (Math.exp(number) + Math.exp(-number))\n}\n\n/**\n * Returns the sum of a power series based on the formula.\n *\n * Category: Math and trigonometry\n *\n * @param {*} x The input value to the power series.\n * @param {*} n The initial power to which you want to raise x.\n * @param {*} m The step by which to increase n for each term in the series.\n * @param {*} coefficients A set of coefficients by which each successive power of x is multiplied. The number of values in coefficients determines the number of terms in the power series. For example, if there are three values in coefficients, then there will be three terms in the power series.\n * @returns\n */\nfunction SERIESSUM(x, n, m, coefficients) {\n x = parseNumber(x);\n n = parseNumber(n);\n m = parseNumber(m);\n coefficients = parseNumberArray(coefficients);\n\n if (anyIsError(x, n, m, coefficients)) {\n return value\n }\n\n let result = coefficients[0] * Math.pow(x, n);\n\n for (let i = 1; i < coefficients.length; i++) {\n result += coefficients[i] * Math.pow(x, n + i * m);\n }\n\n return result\n}\n\n/**\n * Returns the sign of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction SIGN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number < 0) {\n return -1\n } else if (number === 0) {\n return 0\n } else {\n return 1\n }\n}\n\n/**\n * Returns the sine of the given angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the sine.\n * @returns\n */\nfunction SIN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.sin(number)\n}\n\n/**\n * Returns the hyperbolic sine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction SINH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return (Math.exp(number) - Math.exp(-number)) / 2\n}\n\n/**\n * Returns a positive square root.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number for which you want the square root.\n * @returns\n */\nfunction SQRT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number < 0) {\n return num\n }\n\n return Math.sqrt(number)\n}\n\n/**\n * Returns the square root of (number * pi).\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number by which pi is multiplied.\n * @returns\n */\nfunction SQRTPI(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.sqrt(number * Math.PI)\n}\n\n/**\n * Returns a subtotal in a list or database.\n *\n * Category: Math and trigonometry\n *\n * @param {*} function_num The number 1-11 or 101-111 that specifies the function to use for the subtotal. 1-11 includes manually-hidden rows, while 101-111 excludes them; filtered-out values are always excluded.\n * @param {*} ref1 The first named range or reference for which you want the subtotal.\n * @returns\n */\nfunction SUBTOTAL(function_num, ref1) {\n function_num = parseNumber(function_num);\n\n if (function_num instanceof Error) {\n return function_num\n }\n\n switch (function_num) {\n case 1:\n return AVERAGE(ref1)\n case 2:\n return COUNT(ref1)\n case 3:\n return COUNTA(ref1)\n case 4:\n return MAX(ref1)\n case 5:\n return MIN(ref1)\n case 6:\n return PRODUCT(ref1)\n case 7:\n return STDEV.S(ref1)\n case 8:\n return STDEV.P(ref1)\n case 9:\n return SUM(ref1)\n case 10:\n return VAR.S(ref1)\n case 11:\n return VAR.P(ref1)\n // no hidden values for us\n case 101:\n return AVERAGE(ref1)\n case 102:\n return COUNT(ref1)\n case 103:\n return COUNTA(ref1)\n case 104:\n return MAX(ref1)\n case 105:\n return MIN(ref1)\n case 106:\n return PRODUCT(ref1)\n case 107:\n return STDEV.S(ref1)\n case 108:\n return STDEV.P(ref1)\n case 109:\n return SUM(ref1)\n case 110:\n return VAR.S(ref1)\n case 111:\n return VAR.P(ref1)\n }\n}\n\n/**\n * Adds its arguments.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUM() {\n let result = 0;\n\n arrayEach(argsToArray(arguments), (value) => {\n if (result instanceof Error) {\n return false\n } else if (value instanceof Error) {\n result = value;\n } else if (typeof value === 'number') {\n result += value;\n } else if (typeof value === 'string') {\n const parsed = parseFloat(value);\n\n !isNaN(parsed) && (result += parsed);\n } else if (Array.isArray(value)) {\n const inner_result = SUM.apply(null, value);\n\n if (inner_result instanceof Error) {\n result = inner_result;\n } else {\n result += inner_result;\n }\n }\n });\n\n return result\n}\n\n/**\n * Adds the values specified by a given criteria.\n *\n * Category: Math and trigonometry\n *\n * @param {*} range The range of values that you want evaluated by criteria. Cells in each range must be numbers or names, arrays, or references that contain numbers. Blank and text values are ignored.\n * @param {*} criteria The criteria in the form of a number, expression, a value reference, text, or a function that defines which values will be added.\n * @param {*} sum_range Optional. The actual values to add, if you want to add values other than those specified in the range argument. If the sum_range argument is omitted, Excel adds the values that are specified in the range argument (the same values to which the criteria is applied). Sum_range should be the same size and shape as range. If it isn't, performance may suffer, and the formula will sum a range of values that starts with the first value in sum_range but has the same dimensions as range.\n * @returns\n */\nfunction SUMIF(range, criteria, sum_range) {\n range = flatten(range);\n\n sum_range = sum_range ? flatten(sum_range) : range;\n\n if (range instanceof Error) {\n return range\n }\n\n if (criteria === undefined || criteria === null || criteria instanceof Error) {\n return 0\n }\n\n let result = 0;\n const isWildcard = criteria === '*';\n const tokenizedCriteria = isWildcard ? null : parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n const sumValue = sum_range[i];\n\n if (isWildcard) {\n result += value;\n } else {\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n result += compute(tokens) ? sumValue : 0;\n }\n }\n\n return result\n}\n\n/**\n * Adds the values in a range that meet multiple criteria.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUMIFS() {\n const values = applyCriteria(...arguments);\n return SUM(values)\n}\n\n/**\n * Returns the sum of the products of corresponding array components.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUMPRODUCT() {\n if (!arguments || arguments.length === 0) {\n return value\n }\n\n const arrays = arguments.length + 1;\n let result = 0;\n let product;\n let k;\n let _i;\n let _ij;\n\n for (let i = 0; i < arguments[0].length; i++) {\n if (!(arguments[0][i] instanceof Array)) {\n product = 1;\n\n for (k = 1; k < arrays; k++) {\n const _i_arg = arguments[k - 1][i];\n\n if (_i_arg instanceof Error) {\n return _i_arg\n }\n\n _i = parseNumber(_i_arg);\n\n if (_i instanceof Error) {\n return _i\n }\n\n product *= _i;\n }\n\n result += product;\n } else {\n for (let j = 0; j < arguments[0][i].length; j++) {\n product = 1;\n\n for (k = 1; k < arrays; k++) {\n const _ij_arg = arguments[k - 1][i][j];\n\n if (_ij_arg instanceof Error) {\n return _ij_arg\n }\n\n _ij = parseNumber(_ij_arg);\n\n if (_ij instanceof Error) {\n return _ij\n }\n\n product *= _ij;\n }\n\n result += product;\n }\n }\n }\n\n return result\n}\n\n/**\n * Returns the sum of the squares of the arguments.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want the sum of the squares. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction SUMSQ() {\n const numbers = parseNumberArray(flatten(arguments));\n\n if (numbers instanceof Error) {\n return numbers\n }\n\n let result = 0;\n const length = numbers.length;\n\n for (let i = 0; i < length; i++) {\n result += ISNUMBER(numbers[i]) ? numbers[i] * numbers[i] : 0;\n }\n\n return result\n}\n\n/**\n * Returns the sum of the difference of squares of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMX2MY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n\n for (let i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] - array_y[i] * array_y[i];\n }\n\n return result\n}\n\n/**\n * Returns the sum of the sum of squares of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMX2PY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n for (let i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] + array_y[i] * array_y[i];\n }\n\n return result\n}\n\n/**\n * Returns the sum of squares of differences of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMXMY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n array_x = flatten(array_x);\n array_y = flatten(array_y);\n\n for (let i = 0; i < array_x.length; i++) {\n result += Math.pow(array_x[i] - array_y[i], 2);\n }\n\n return result\n}\n\n/**\n * Returns the tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the tangent.\n * @returns\n */\nfunction TAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.tan(number)\n}\n\n/**\n * Returns the hyperbolic tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction TANH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const e2 = Math.exp(2 * number);\n\n return (e2 - 1) / (e2 + 1)\n}\n\n/**\n * Truncates a number to an integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number you want to truncate.\n * @param {*} num_digits Optional. A number specifying the precision of the truncation. The default value for num_digits is 0 (zero).\n * @returns\n */\nfunction TRUNC(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.floor(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Following functions are part of Formula.js only and not found in Excel.\n * Purpose of these functions is to implement an Excel like behaviour for fundamental math symbols such as +, -, /, *, etc.\n */\n\n/**\n * Formula.js only.\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction ADD(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 + num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} dividend\n * @param {*} divisor\n * @returns\n */\nfunction DIVIDE(dividend, divisor) {\n if (arguments.length !== 2) {\n return na\n }\n\n dividend = parseNumber(dividend);\n divisor = parseNumber(divisor);\n const anyError$1 = anyError(dividend, divisor);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (divisor === 0) {\n return div0\n }\n\n return dividend / divisor\n}\n\n/**\n * Formula.js only\n *\n * @param {*} value1\n * @param {*} value2\n * @returns\n */\nfunction EQ(value1, value2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (value1 instanceof Error) {\n return value1\n }\n\n if (value2 instanceof Error) {\n return value2\n }\n\n if (value1 === null) {\n value1 = undefined;\n }\n\n if (value2 === null) {\n value2 = undefined;\n }\n\n return value1 === value2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction GT(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (num1 instanceof Error) {\n return num1\n }\n\n if (num2 instanceof Error) {\n return num2\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 > num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction GTE(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 >= num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction LT(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 < num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction LTE(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 <= num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction MINUS(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 - num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} factor1\n * @param {*} factor2\n * @returns\n */\nfunction MULTIPLY(factor1, factor2) {\n if (arguments.length !== 2) {\n return na\n }\n\n factor1 = parseNumber(factor1);\n factor2 = parseNumber(factor2);\n const anyError$1 = anyError(factor1, factor2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return factor1 * factor2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} value1\n * @param {*} value2\n * @returns\n */\nfunction NE(value1, value2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (value1 instanceof Error) {\n return value1\n }\n\n if (value2 instanceof Error) {\n return value2\n }\n\n if (value1 === null) {\n value1 = undefined;\n }\n\n if (value2 === null) {\n value2 = undefined;\n }\n\n return value1 !== value2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} base\n * @param {*} exponent\n * @returns\n */\nfunction POW(base, exponent) {\n if (arguments.length !== 2) {\n return na\n }\n\n return POWER(base, exponent)\n}\n\nvar symbols = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ADD: ADD,\n DIVIDE: DIVIDE,\n EQ: EQ,\n GT: GT,\n GTE: GTE,\n LT: LT,\n LTE: LTE,\n MINUS: MINUS,\n MULTIPLY: MULTIPLY,\n NE: NE,\n POW: POW\n});\n\nconst d1900 = new Date(Date.UTC(1900, 0, 1));\nconst WEEK_STARTS = [\n undefined,\n 0,\n 1,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 0\n];\nconst WEEK_TYPES = [\n [],\n [1, 2, 3, 4, 5, 6, 7],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 0, 1, 2, 3, 4, 5],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 7, 1, 2, 3, 4, 5],\n [5, 6, 7, 1, 2, 3, 4],\n [4, 5, 6, 7, 1, 2, 3],\n [3, 4, 5, 6, 7, 1, 2],\n [2, 3, 4, 5, 6, 7, 1],\n [1, 2, 3, 4, 5, 6, 7]\n];\nconst WEEKEND_TYPES = [\n [],\n [6, 0],\n [0, 1],\n [1, 2],\n [2, 3],\n [3, 4],\n [4, 5],\n [5, 6],\n undefined,\n undefined,\n undefined,\n [0, 0],\n [1, 1],\n [2, 2],\n [3, 3],\n [4, 4],\n [5, 5],\n [6, 6]\n];\n\n/**\n * Returns the serial number of a particular date.\n *\n * Category: Date and time\n *\n * @param {*} year Year\n * @param {*} month Month\n * @param {*} day Day\n * @returns\n */\nfunction DATE(year, month, day) {\n let result;\n\n year = parseNumber(year);\n month = parseNumber(month);\n day = parseNumber(day);\n\n if (anyIsError(year, month, day)) {\n result = value;\n } else {\n result = new Date(year, month - 1, day);\n\n if (result.getFullYear() < 0) {\n result = num;\n }\n }\n\n return result\n}\n\n/**\n * Calculates the number of days, months, or years between two dates. This function is useful in formulas where you need to calculate an age.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the first, or starting date of a given period.\n * @param {*} end_date A date that represents the last, or ending, date of the period.\n * @param {*} unit The type of information that you want returned, where:\n - \"Y\": The number of complete years in the period.\n - \"M\": The number of complete months in the period.\n - \"D\": The number of days in the period.\n - \"MD\": The difference between the days in start_date and end_date. The months and years of the dates are ignored.\n - \"YM\": The difference between the months in start_date and end_date. The days and years of the dates are ignored\n - \"YD\": The difference between the days of start_date and end_date. The years of the dates are ignored.\n * @returns\n */\nfunction DATEDIF(start_date, end_date, unit) {\n unit = unit.toUpperCase();\n start_date = parseDate(start_date);\n end_date = parseDate(end_date);\n\n const start_date_year = start_date.getFullYear();\n const start_date_month = start_date.getMonth();\n const start_date_day = start_date.getDate();\n const end_date_year = end_date.getFullYear();\n const end_date_month = end_date.getMonth();\n const end_date_day = end_date.getDate();\n\n let result;\n\n switch (unit) {\n case 'Y':\n result = Math.floor(YEARFRAC(start_date, end_date));\n break\n case 'D':\n result = DAYS(end_date, start_date);\n break\n case 'M':\n result = end_date_month - start_date_month + 12 * (end_date_year - start_date_year);\n\n if (end_date_day < start_date_day) {\n result--;\n }\n\n break\n case 'MD':\n if (start_date_day <= end_date_day) {\n result = end_date_day - start_date_day;\n } else {\n if (end_date_month === 0) {\n start_date.setFullYear(end_date_year - 1);\n start_date.setMonth(12);\n } else {\n start_date.setFullYear(end_date_year);\n start_date.setMonth(end_date_month - 1);\n }\n\n result = DAYS(end_date, start_date);\n }\n\n break\n case 'YM':\n result = end_date_month - start_date_month + 12 * (end_date_year - start_date_year);\n\n if (end_date_day < start_date_day) {\n result--;\n }\n\n result = result % 12;\n break\n case 'YD':\n if (end_date_month > start_date_month || (end_date_month === start_date_month && end_date_day < start_date_day)) {\n start_date.setFullYear(end_date_year);\n } else {\n start_date.setFullYear(end_date_year - 1);\n }\n\n result = DAYS(end_date, start_date);\n break\n }\n\n return result\n}\n\n/**\n * Converts a date in the form of text to a serial number.\n *\n * Category: Date and time\n *\n * @param {*} date_text Text that represents a date in an Excel date format, or a reference to a value that contains text that represents a date in an Excel date format.\n * @returns\n */\nfunction DATEVALUE(date_text) {\n if (typeof date_text !== 'string') {\n return value\n }\n\n const date = Date.parse(date_text);\n\n if (isNaN(date)) {\n return value\n }\n\n return new Date(date_text)\n}\n\n/**\n * Converts a serial number to a day of the month.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the day you are trying to find.\n * @returns\n */\nfunction DAY(serial_number) {\n const date = parseDate(serial_number);\n\n if (date instanceof Error) {\n return date\n }\n\n return date.getDate()\n}\n\nfunction startOfDay(date) {\n const newDate = new Date(date);\n newDate.setHours(0, 0, 0, 0);\n\n return newDate\n}\n\n/**\n * Returns the number of days between two dates.\n *\n * Category: Date and time\n *\n * @param {*} end_date Start_date and End_date are the two dates between which you want to know the number of days.\n * @param {*} start_date Start_date and End_date are the two dates between which you want to know the number of days.\n * @returns\n */\nfunction DAYS(end_date, start_date) {\n end_date = parseDate(end_date);\n start_date = parseDate(start_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n return serial(startOfDay(end_date)) - serial(startOfDay(start_date))\n}\n\n/**\n * Calculates the number of days between two dates based on a 360-day year.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date. If start_date occurs after end_date, the DAYS360 function returns a negative number.\n * @param {*} end_date A date that represents the end date.\n * @param {*} method Optional. A logical value that specifies whether to use the U.S. or European method in the calculation.\n * @returns\n */\nfunction DAYS360(start_date, end_date, method) {\n method = parseBool(method || 'false');\n start_date = parseDate(start_date);\n end_date = parseDate(end_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n if (method instanceof Error) {\n return method\n }\n\n const sm = start_date.getMonth();\n let em = end_date.getMonth();\n let sd, ed;\n\n if (method) {\n sd = start_date.getDate() === 31 ? 30 : start_date.getDate();\n ed = end_date.getDate() === 31 ? 30 : end_date.getDate();\n } else {\n const smd = new Date(start_date.getFullYear(), sm + 1, 0).getDate();\n const emd = new Date(end_date.getFullYear(), em + 1, 0).getDate();\n sd = start_date.getDate() === smd ? 30 : start_date.getDate();\n\n if (end_date.getDate() === emd) {\n if (sd < 30) {\n em++;\n ed = 1;\n } else {\n ed = 30;\n }\n } else {\n ed = end_date.getDate();\n }\n }\n\n return 360 * (end_date.getFullYear() - start_date.getFullYear()) + 30 * (em - sm) + (ed - sd)\n}\n\n/**\n * Returns the serial number of the date that is the indicated number of months before or after the start date.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} months The number of months before or after start_date. A positive value for months yields a future date; a negative value yields a past date.\n * @returns\n */\nfunction EDATE(start_date, months) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (isNaN(months)) {\n return value\n }\n\n // store the day and temporarily set to 1, which is safe\n let storedDay = start_date.getDate();\n start_date.setDate(1);\n\n months = parseInt(months, 10);\n start_date.setMonth(start_date.getMonth() + months);\n\n let targetMonth = start_date.getMonth();\n\n // if storedDay > 28 then we need to check end-of-month scenarios\n if (storedDay > 28) {\n let daysInTargetMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][targetMonth];\n\n // if target month is February, check for a leap year\n let targetYear = start_date.getFullYear();\n if (targetMonth === 1 && ((targetYear % 4 === 0 && targetYear % 100 !== 0) || targetYear % 400 === 0)) {\n daysInTargetMonth = 29;\n }\n storedDay = Math.min(storedDay, daysInTargetMonth);\n }\n\n start_date.setDate(storedDay);\n\n return start_date\n}\n\n/**\n * Returns the serial number of the last day of the month before or after a specified number of months.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the starting date.\n * @param {*} months The number of months before or after start_date. A positive value for months yields a future date; a negative value yields a past date.\n * @returns\n */\nfunction EOMONTH(start_date, months) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (isNaN(months)) {\n return value\n }\n\n months = parseInt(months, 10);\n\n return new Date(start_date.getFullYear(), start_date.getMonth() + months + 1, 0)\n}\n\n/**\n * Converts a serial number to an hour.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the hour you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction HOUR(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getHours()\n}\n\n/**\n * Returns the number of the ISO week number of the year for a given date.\n *\n * Category: Date and time\n *\n * @param {*} date Date is the date-time code used by Excel for date and time calculation.\n * @returns\n */\nfunction ISOWEEKNUM(date) {\n date = parseDate(date);\n\n if (date instanceof Error) {\n return date\n }\n\n date = startOfDay(date);\n date.setDate(date.getDate() + 4 - (date.getDay() || 7));\n const yearStart = new Date(date.getFullYear(), 0, 1);\n\n return Math.ceil(((date - yearStart) / 86400000 + 1) / 7)\n}\n\n/**\n * Converts a serial number to a minute.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the minute you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction MINUTE(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getMinutes()\n}\n\n/**\n * Converts a serial number to a month.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the month you are trying to find.\n * @returns\n */\nfunction MONTH(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getMonth() + 1\n}\n\n/**\n * Returns the number of whole workdays between two dates.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} end_date A date that represents the end date.\n * @param {*} holidays Optional. An optional range of one or more dates to exclude from the working calendar, such as state and federal holidays and floating holidays. The list can be either a range of values that contains the dates or an array constant of the serial numbers that represent the dates.\n * @returns\n */\nfunction NETWORKDAYS(start_date, end_date, holidays) {\n return NETWORKDAYS.INTL(start_date, end_date, 1, holidays)\n}\n\n/**\n * Returns the number of whole workdays between two dates using parameters to indicate which and how many days are weekend days.\n *\n * Category: Date and time\n *\n * @param {*} start_date The date for from which the difference is to be computed. The start_date can be earlier than, the same as, or later than the end_date.\n * @param {*} end_date The date for to which the difference is to be computed.\n * @param {*} weekend Optional. Indicates the days of the week that are weekend days and are not included in the number of whole working days between start_date and end_date. Weekend is a weekend number or string that specifies when weekends occur. Weekend number values indicate the following weekend days:\n * @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.\n * @returns\n */\nNETWORKDAYS.INTL = (start_date, end_date, weekend, holidays) => {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n end_date = parseDate(end_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n let isMask = false;\n const maskDays = [];\n const maskIndex = [1, 2, 3, 4, 5, 6, 0];\n const maskRegex = new RegExp('^[0|1]{7}$');\n\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else if (typeof weekend === 'string' && maskRegex.test(weekend)) {\n isMask = true;\n weekend = weekend.split('');\n\n for (let i = 0; i < weekend.length; i++) {\n if (weekend[i] === '1') {\n maskDays.push(maskIndex[i]);\n }\n }\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n\n if (!(weekend instanceof Array)) {\n return value\n }\n\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n\n for (let i = 0; i < holidays.length; i++) {\n const h = parseDate(holidays[i]);\n\n if (h instanceof Error) {\n return h\n }\n\n holidays[i] = h;\n }\n\n const days = Math.round((end_date - start_date) / (1000 * 60 * 60 * 24)) + 1;\n let total = days;\n const day = start_date;\n\n for (let i = 0; i < days; i++) {\n const d = new Date().getTimezoneOffset() > 0 ? day.getUTCDay() : day.getDay();\n let dec = isMask ? maskDays.includes(d) : d === weekend[0] || d === weekend[1];\n\n for (let j = 0; j < holidays.length; j++) {\n const holiday = holidays[j];\n\n if (\n holiday.getDate() === day.getDate() &&\n holiday.getMonth() === day.getMonth() &&\n holiday.getFullYear() === day.getFullYear()\n ) {\n dec = true;\n break\n }\n }\n\n if (dec) {\n total--;\n }\n\n day.setDate(day.getDate() + 1);\n }\n\n return total\n};\n\n/**\n * Returns the serial number of the current date and time.\n *\n * Category: Date and time\n *\n * @returns\n */\nfunction NOW() {\n return new Date()\n}\n\n/**\n * Converts a serial number to a second.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the seconds you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction SECOND(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getSeconds()\n}\n\n/**\n * Returns the serial number of a particular time.\n *\n * Category: Date and time\n *\n * @param {*} hour A number from 0 (zero) to 32767 representing the hour. Any value greater than 23 will be divided by 24 and the remainder will be treated as the hour value. For example, TIME(27,0,0) = TIME(3,0,0) = .125 or 3:00 AM.\n * @param {*} minute A number from 0 to 32767 representing the minute. Any value greater than 59 will be converted to hours and minutes. For example, TIME(0,750,0) = TIME(12,30,0) = .520833 or 12:30 PM.\n * @param {*} second A number from 0 to 32767 representing the second. Any value greater than 59 will be converted to hours, minutes, and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148 or 12:33:20 AM\n * @returns\n */\nfunction TIME(hour, minute, second) {\n hour = parseNumber(hour);\n minute = parseNumber(minute);\n second = parseNumber(second);\n\n if (anyIsError(hour, minute, second)) {\n return value\n }\n\n if (hour < 0 || minute < 0 || second < 0) {\n return num\n }\n\n return (3600 * hour + 60 * minute + second) / 86400\n}\n\n/**\n * Converts a time in the form of text to a serial number.\n *\n * Category: Date and time\n *\n * @param {*} time_text A text string that represents a time in any one of the Microsoft Excel time formats; for example, \"6:45 PM\" and \"18:45\" text strings within quotation marks that represent time.\n * @returns\n */\nfunction TIMEVALUE(time_text) {\n time_text = parseDate(time_text);\n\n if (time_text instanceof Error) {\n return time_text\n }\n\n return (3600 * time_text.getHours() + 60 * time_text.getMinutes() + time_text.getSeconds()) / 86400\n}\n\n/**\n * Returns the serial number of today's date.\n *\n * Category: Date and time\n *\n * @returns\n */\nfunction TODAY() {\n return startOfDay(new Date())\n}\n\n/**\n * Converts a serial number to a day of the week.\n *\n * Category: Date and time\n *\n * @param {*} serial_number A sequential number that represents the date of the day you are trying to find.\n * @param {*} return_type Optional. A number that determines the type of return value.\n * @returns\n */\nfunction WEEKDAY(serial_number, return_type) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n if (return_type === undefined) {\n return_type = 1;\n }\n\n const day = serial_number.getDay();\n\n return WEEK_TYPES[return_type][day]\n}\n\n/**\n * Converts a serial number to a number representing where the week falls numerically with a year.\n *\n * Category: Date and time\n *\n * @param {*} serial_number A date within the week.\n * @param {*} return_type Optional. A number that determines on which day the week begins. The default is 1.\n * @returns\n */\nfunction WEEKNUM(serial_number, return_type) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n if (return_type === undefined) {\n return_type = 1;\n }\n\n if (return_type === 21) {\n return ISOWEEKNUM(serial_number)\n }\n\n const week_start = WEEK_STARTS[return_type];\n let jan = new Date(serial_number.getFullYear(), 0, 1);\n const inc = jan.getDay() < week_start ? 1 : 0;\n jan -= Math.abs(jan.getDay() - week_start) * 24 * 60 * 60 * 1000;\n\n return Math.floor((serial_number - jan) / (1000 * 60 * 60 * 24) / 7 + 1) + inc\n}\n\n/**\n * Returns the serial number of the date before or after a specified number of workdays.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} days The number of nonweekend and nonholiday days before or after start_date. A positive value for days yields a future date; a negative value yields a past date.\n * @param {*} holidays Optional. An optional list of one or more dates to exclude from the working calendar, such as state and federal holidays and floating holidays. The list can be either a range of values that contain the dates or an array constant of the serial numbers that represent the dates.\n * @returns\n */\nfunction WORKDAY(start_date, days, holidays) {\n return WORKDAY.INTL(start_date, days, 1, holidays)\n}\n\n/**\n * Returns the serial number of the date before or after a specified number of workdays using parameters to indicate which and how many days are weekend days.\n *\n * Category: Date and time\n *\n * @param {*} start_date The start date, truncated to integer.\n * @param {*} days The number of workdays before or after the start_date. A positive value yields a future date; a negative value yields a past date; a zero value yields the start_date. Day-offset is truncated to an integer.\n * @param {*} weekend Optional. Indicates the days of the week that are weekend days and are not considered working days. Weekend is a weekend number or string that specifies when weekends occur. Weekend number values indicate the following weekend days:\n * @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. Holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.\n * @returns\n */\nWORKDAY.INTL = (start_date, days, weekend, holidays) => {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n days = parseNumber(days);\n\n if (days instanceof Error) {\n return days\n }\n\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n\n if (!(weekend instanceof Array)) {\n return value\n }\n\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n\n for (let i = 0; i < holidays.length; i++) {\n const h = parseDate(holidays[i]);\n\n if (h instanceof Error) {\n return h\n }\n\n holidays[i] = h;\n }\n\n let d = 0;\n\n const sign = Math.sign(days);\n\n while (d < days * sign) {\n start_date.setDate(start_date.getDate() + sign);\n\n const day = start_date.getDay();\n\n if (day === weekend[0] || day === weekend[1]) {\n continue\n }\n\n for (let j = 0; j < holidays.length; j++) {\n const holiday = holidays[j];\n\n if (\n holiday.getDate() === start_date.getDate() &&\n holiday.getMonth() === start_date.getMonth() &&\n holiday.getFullYear() === start_date.getFullYear()\n ) {\n d--;\n break\n }\n }\n\n d++;\n }\n\n // EXCEL does not recognize dates before 1900.\n if (start_date.getFullYear() < 1900) {\n return value\n }\n\n return start_date\n};\n\n/**\n * Converts a serial number to a year.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the year you want to find.\n * @returns\n */\nfunction YEAR(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getFullYear()\n}\n\nfunction isLeapYear(year) {\n return new Date(year, 1, 29).getMonth() === 1\n}\n\n// TODO : Use DAYS ?\nfunction daysBetween(start_date, end_date) {\n return Math.ceil((end_date - start_date) / 1000 / 60 / 60 / 24)\n}\n\n/**\n * Returns the year fraction representing the number of whole days between start_date and end_date.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} end_date A date that represents the end date.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YEARFRAC(start_date, end_date, basis) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n end_date = parseDate(end_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n basis = basis || 0;\n let sd = start_date.getDate();\n const sm = start_date.getMonth() + 1;\n const sy = start_date.getFullYear();\n let ed = end_date.getDate();\n const em = end_date.getMonth() + 1;\n const ey = end_date.getFullYear();\n\n switch (basis) {\n case 0:\n // US (NASD) 30/360\n if (sd === 31 && ed === 31) {\n sd = 30;\n ed = 30;\n } else if (sd === 31) {\n sd = 30;\n } else if (sd === 30 && ed === 31) {\n ed = 30;\n }\n\n return (ed + em * 30 + ey * 360 - (sd + sm * 30 + sy * 360)) / 360\n case 1: {\n // Actual/actual\n const feb29Between = (date1, date2) => {\n const year1 = date1.getFullYear();\n const mar1year1 = new Date(year1, 2, 1);\n\n if (isLeapYear(year1) && date1 < mar1year1 && date2 >= mar1year1) {\n return true\n }\n\n const year2 = date2.getFullYear();\n const mar1year2 = new Date(year2, 2, 1);\n\n return isLeapYear(year2) && date2 >= mar1year2 && date1 < mar1year2\n };\n\n let ylength = 365;\n\n if (sy === ey || (sy + 1 === ey && (sm > em || (sm === em && sd >= ed)))) {\n if ((sy === ey && isLeapYear(sy)) || feb29Between(start_date, end_date) || (em === 1 && ed === 29)) {\n ylength = 366;\n }\n\n return daysBetween(start_date, end_date) / ylength\n }\n\n const years = ey - sy + 1;\n const days = (new Date(ey + 1, 0, 1) - new Date(sy, 0, 1)) / 1000 / 60 / 60 / 24;\n const average = days / years;\n\n return daysBetween(start_date, end_date) / average\n }\n\n case 2:\n // Actual/360\n\n return daysBetween(start_date, end_date) / 360\n case 3:\n // Actual/365\n\n return daysBetween(start_date, end_date) / 365\n case 4:\n // European 30/360\n\n return (ed + em * 30 + ey * 360 - (sd + sm * 30 + sy * 360)) / 360\n }\n}\n\nfunction serial(date) {\n const addOn = date > -2203891200000 ? 2 : 1;\n\n return Math.ceil((date - d1900) / 86400000) + addOn\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Changes full-width (double-byte) English letters or katakana within a character string to half-width (single-byte) characters.\n *\n * Category: Text\n *\n * @param {*} text The text or a reference to a value that contains the text you want to change. If text does not contain any full-width letters, text is not changed.\n * @returns\n */\nfunction ASC() {\n throw new Error('ASC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Converts a number to text, using the \u00DF (baht) currency format.\n *\n * Category: Text\n *\n * @param {*} number A number you want to convert to text, or a reference to a value containing a number, or a formula that evaluates to a number.\n * @returns\n */\nfunction BAHTTEXT() {\n throw new Error('BAHTTEXT is not implemented')\n}\n\n/**\n * Returns the character specified by the code number.\n *\n * Category: Text\n *\n * @param {*} number A number between 1 and 255 specifying which character you want. The character is from the character set used by your computer. Note: Excel for the web supports only CHAR(9), CHAR(10), CHAR(13), and CHAR(32) and above.\n * @returns\n */\nfunction CHAR(number) {\n number = parseNumber(number);\n\n if (number === 0) {\n return value\n }\n\n if (number instanceof Error) {\n return number\n }\n\n return String.fromCharCode(number)\n}\n\n/**\n * Removes all nonprintable characters from text.\n *\n * Category: Text\n *\n * @param {*} text Any worksheet information from which you want to remove nonprintable characters.\n * @returns\n */\nfunction CLEAN(text) {\n if (anyIsError(text)) {\n return text\n }\n\n text = text || '';\n const re = /[\\0-\\x1F]/g;\n\n return text.replace(re, '')\n}\n\n/**\n * Returns a numeric code for the first character in a text string.\n *\n * Category: Text\n *\n * @param {*} text The text for which you want the code of the first character.\n * @returns\n */\nfunction CODE(text) {\n if (anyIsError(text)) {\n return text\n }\n\n text = text || '';\n let result = text.charCodeAt(0);\n\n if (isNaN(result)) {\n result = value;\n }\n\n return result\n}\n\n/**\n * Joins several text items into one text item.\n *\n * Category: Text\n *\n * @returns\n */\nfunction CONCATENATE() {\n const args = flatten(arguments);\n const someError = anyError.apply(undefined, args);\n\n if (someError) {\n return someError\n }\n\n let trueFound = 0;\n\n while ((trueFound = args.indexOf(true)) > -1) {\n args[trueFound] = 'TRUE';\n }\n\n let falseFound = 0;\n\n while ((falseFound = args.indexOf(false)) > -1) {\n args[falseFound] = 'FALSE';\n }\n\n return args.join('')\n}\n\nconst CONCAT = CONCATENATE;\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Changes half-width (single-byte) English letters or katakana within a character string to full-width (double-byte) characters.\n *\n * Category: Text\n *\n * @param {*} text The text or a reference to a value that contains the text you want to change. If text does not contain any half-width English letters or katakana, text is not changed.\n * @returns\n */\nfunction DBCS() {\n throw new Error('DBCS is not implemented')\n}\n\n/**\n * Converts a number to text, using the $ (dollar) currency format.\n *\n * Category: Text\n *\n * @param {*} number A number, a reference to a value containing a number, or a formula that evaluates to a number.\n * @param {*} decimals Optional. The number of digits to the right of the decimal point. If this is negative, the number is rounded to the left of the decimal point. If you omit decimals, it is assumed to be 2.\n * @returns\n */\nfunction DOLLAR(number, decimals = 2) {\n number = parseNumber(number);\n if (isNaN(number)) {\n return value\n }\n\n number = ROUND(number, decimals);\n\n const options = {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits: decimals >= 0 ? decimals : 0,\n maximumFractionDigits: decimals >= 0 ? decimals : 0\n };\n\n const formattedNumber = number.toLocaleString('en-US', options);\n\n if (number < 0) {\n return '$(' + formattedNumber.slice(2) + ')'\n }\n\n return formattedNumber\n}\n\n/**\n * Checks to see if two text values are identical.\n *\n * Category: Text\n *\n * @param {*} text1 The first text string.\n * @param {*} text2 The second text string.\n * @returns\n */\nfunction EXACT(text1, text2) {\n if (arguments.length !== 2) {\n return na\n }\n\n const someError = anyError(text1, text2);\n\n if (someError) {\n return someError\n }\n\n text1 = parseString(text1);\n text2 = parseString(text2);\n\n return text1 === text2\n}\n\n/**\n * Locate one text string within a second text string, and return the number of the starting position of the first text string from the first character of the second text string.\n *\n * Category: Text\n *\n * @param {*} find_text The text you want to find.\n * @param {*} within_text The text containing the text you want to find.\n * @param {*} start_num Optional. Specifies the character at which to start the search. The first character in within_text is character number 1. If you omit start_num, it is assumed to be 1.\n * @returns\n */\nfunction FIND(find_text, within_text, start_num) {\n if (arguments.length < 2) {\n return na\n }\n\n find_text = parseString(find_text);\n within_text = parseString(within_text);\n start_num = start_num === undefined ? 0 : start_num;\n const found_index = within_text.indexOf(find_text, start_num - 1);\n\n if (found_index === -1) {\n return value\n }\n\n return found_index + 1\n}\n\n/**\n * Formats a number as text with a fixed number of decimals.\n *\n * Category: Text\n *\n * @param {*} number The number you want to round and convert to text.\n * @param {*} decimals Optional. The number of digits to the right of the decimal point.\n * @param {*} no_commas Optional. A logical value that, if TRUE, prevents FIXED from including commas in the returned text.\n * @returns\n */\nfunction FIXED(number, decimals = 2, no_commas = false) {\n number = parseNumber(number);\n if (isNaN(number)) {\n return value\n }\n\n decimals = parseNumber(decimals);\n if (isNaN(decimals)) {\n return value\n }\n\n if (decimals < 0) {\n const factor = Math.pow(10, -decimals);\n number = Math.round(number / factor) * factor;\n } else {\n number = number.toFixed(decimals);\n }\n\n if (no_commas) {\n number = number.toString().replace(/,/g, '');\n } else {\n const parts = number.toString().split('.');\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+$)/g, ',');\n number = parts.join('.');\n }\n\n return number\n}\n\n/**\n * Returns the leftmost characters from a text value.\n *\n * Category: Text\n *\n * @param {*} text The text string that contains the characters you want to extract.\n * @param {*} num_chars Optional. Specifies the number of characters you want LEFT to extract.\n * @returns\n */\nfunction LEFT(text, num_chars) {\n const someError = anyError(text, num_chars);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n num_chars = num_chars === undefined ? 1 : num_chars;\n num_chars = parseNumber(num_chars);\n\n if (num_chars instanceof Error || typeof text !== 'string') {\n return value\n }\n\n return text.substring(0, num_chars)\n}\n\n/**\n * Returns the number of characters in a text string\n *\n * Category: Text\n *\n * @param {*} text The text whose length you want to find. Spaces count as characters.\n * @returns\n */\nfunction LEN(text) {\n if (arguments.length === 0) {\n return error\n }\n\n if (text instanceof Error) {\n return text\n }\n\n if (Array.isArray(text)) {\n return value\n }\n\n const textAsString = parseString(text);\n\n return textAsString.length\n}\n\n/**\n * Converts text to lowercase.\n *\n * Category: Text\n *\n * @param {*} text The text you want to convert to lowercase. LOWER does not change characters in text that are not letters.\n * @returns\n */\nfunction LOWER(text) {\n if (arguments.length !== 1) {\n return value\n }\n\n text = parseString(text);\n\n if (anyIsError(text)) {\n return text\n }\n\n return text.toLowerCase()\n}\n\n/**\n * Returns a specific number of characters from a text string starting at the position you specify\n *\n * Category: Text\n *\n * @param {*} text The text string containing the characters you want to extract.\n * @param {*} start_num The position of the first character you want to extract in text. The first character in text has start_num 1, and so on.\n * @param {*} num_chars Specifies the number of characters you want MID to return from text.\n * @returns\n */\nfunction MID(text, start_num, num_chars) {\n if (start_num === undefined || start_num === null) {\n return value\n }\n\n start_num = parseNumber(start_num);\n num_chars = parseNumber(num_chars);\n\n if (anyIsError(start_num, num_chars) || typeof text !== 'string') {\n return num_chars\n }\n\n const begin = start_num - 1;\n const end = begin + num_chars;\n\n return text.substring(begin, end)\n}\n\n// TODO\n/**\n * Converts text to number in a locale-independent manner.\n *\n * Category: Text\n *\n * @param {*} text The text to convert to a number.\n * @param {*} decimal_separator Optional. The character used to separate the integer and fractional part of the result.\n * @param {*} group_separator Optional. The character used to separate groupings of numbers, such as thousands from hundreds and millions from thousands.\n * @returns\n */\nfunction NUMBERVALUE(text, decimal_separator, group_separator) {\n text = isDefined(text) ? text : '';\n\n if (typeof text === 'number') {\n return text\n }\n\n if (typeof text !== 'string') {\n return na\n }\n\n decimal_separator = typeof decimal_separator === 'undefined' ? '.' : decimal_separator;\n group_separator = typeof group_separator === 'undefined' ? ',' : group_separator;\n\n return Number(text.replace(decimal_separator, '.').replace(group_separator, ''))\n}\n\n// TODO\n/**\n * -- Not implemented --\n */\nfunction PRONETIC() {\n throw new Error('PRONETIC is not implemented')\n}\n\n/**\n * Capitalizes the first letter in each word of a text value.\n *\n * Category: Text\n *\n * @param {*} text Text enclosed in quotation marks, a formula that returns text, or a reference to a value containing the text you want to partially capitalize.\n * @returns\n */\nfunction PROPER(text) {\n if (anyIsError(text)) {\n return text\n }\n\n if (isNaN(text) && typeof text === 'number') {\n return value\n }\n\n text = parseString(text);\n\n return text.replace(/\\w\\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase())\n}\n\n/**\n * Replaces characters within text\n *\n * Category: Text\n *\n * @param {*} old_text Text in which you want to replace some characters.\n * @param {*} num_chars The number of characters in old_text that you want REPLACE to replace with new_text.\n * @param {*} length he number of characters in old_text that you want REPLACEB to replace with new_text.\n * @param {*} new_text he text that will replace characters in old_text.\n * @returns\n */\nfunction REPLACE(old_text, num_chars, length, new_text) {\n num_chars = parseNumber(num_chars);\n length = parseNumber(length);\n\n if (anyIsError(num_chars, length) || typeof old_text !== 'string' || typeof new_text !== 'string') {\n return value\n }\n\n return old_text.substr(0, num_chars - 1) + new_text + old_text.substr(num_chars - 1 + length)\n}\n\n/**\n * Repeats text a given number of times.\n *\n * Category: Text\n *\n * @param {*} text The text you want to repeat.\n * @param {*} number_times A positive number specifying the number of times to repeat text.\n * @returns\n */\nfunction REPT(text, number_times) {\n const someError = anyError(text, number_times);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n number_times = parseNumber(number_times);\n\n if (number_times instanceof Error) {\n return number_times\n }\n\n return new Array(number_times + 1).join(text)\n}\n\n/**\n * Returns the rightmost characters from a text value\n *\n * Category: Text\n *\n * @param {*} text The text string containing the characters you want to extract.\n * @param {*} num_chars Optional. Specifies the number of characters you want RIGHT to extract.\n * @returns\n */\nfunction RIGHT(text, num_chars) {\n const someError = anyError(text, num_chars);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n num_chars = num_chars === undefined ? 1 : num_chars;\n num_chars = parseNumber(num_chars);\n\n if (num_chars instanceof Error) {\n return num_chars\n }\n\n return text.substring(text.length - num_chars)\n}\n\n/**\n * Finds one text value within another (not case-sensitive)\n *\n * Category: Text\n *\n * @param {*} find_text The text that you want to find.\n * @param {*} within_text The text in which you want to search for the value of the find_text argument.\n * @param {*} start_num Optional. The character number in the within_text argument at which you want to start searching.\n * @returns\n */\nfunction SEARCH(find_text, within_text, start_num) {\n let foundAt;\n\n if (typeof find_text !== 'string' || typeof within_text !== 'string') {\n return value\n }\n\n start_num = start_num === undefined ? 0 : start_num;\n foundAt = within_text.toLowerCase().indexOf(find_text.toLowerCase(), start_num - 1) + 1;\n\n return foundAt === 0 ? value : foundAt\n}\n\n/**\n * Substitutes new text for old text in a text string.\n *\n * Category: Text\n *\n * @param {*} text The text or the reference to a value containing text for which you want to substitute characters.\n * @param {*} old_text The text you want to replace.\n * @param {*} new_text The text you want to replace old_text with.\n * @param {*} instance_num Optional. Specifies which occurrence of old_text you want to replace with new_text. If you specify instance_num, only that instance of old_text is replaced. Otherwise, every occurrence of old_text in text is changed to new_text.\n * @returns\n */\nfunction SUBSTITUTE(text, old_text, new_text, instance_num) {\n if (arguments.length < 3) {\n return na\n }\n\n if (!text || !old_text) {\n return text\n } else if (instance_num === undefined) {\n return text.split(old_text).join(new_text)\n } else {\n instance_num = Math.floor(Number(instance_num));\n\n if (Number.isNaN(instance_num) || instance_num <= 0) {\n return value\n }\n\n let index = 0;\n let i = 0;\n\n while (index > -1 && text.indexOf(old_text, index) > -1) {\n index = text.indexOf(old_text, index + 1);\n i++;\n\n if (index > -1 && i === instance_num) {\n return text.substring(0, index) + new_text + text.substring(index + old_text.length)\n }\n }\n\n return text\n }\n}\n\n/**\n * Converts its arguments to text.\n *\n * Category: Text\n *\n * @param {*} value The value you want to test.\n * @returns\n */\nfunction T(value) {\n if (value instanceof Error) {\n return value\n }\n\n return typeof value === 'string' ? value : ''\n}\n\n/**\n * Formats a number and converts it to text.\n *\n * Category: Text\n *\n * @param {*} value A numeric value that you want to be converted into text.\n * @param {*} format_text A text string that defines the formatting that you want to be applied to the supplied value.\n * @returns\n */\nfunction TEXT(value$1, format_text) {\n if (value$1 === undefined || value$1 instanceof Error || format_text instanceof Error) {\n return na\n }\n\n if (value$1 instanceof Date) {\n return value$1.toISOString().slice(0, 10)\n }\n\n if (format_text === undefined || format_text === null) {\n return ''\n }\n\n if (typeof format_text === 'number') {\n return String(format_text)\n }\n\n if (typeof format_text !== 'string') {\n return value\n }\n\n const currencySymbol = format_text.startsWith('$') ? '$' : '';\n const isPercent = format_text.endsWith('%');\n format_text = format_text.replace(/%/g, '').replace(/\\$/g, '');\n\n // count all 0s after the decimal point\n const decimalPlaces = format_text.includes('.') ? format_text.split('.')[1].match(/0/g).length : 0;\n\n const noCommas = !format_text.includes(',');\n\n if (isPercent) {\n value$1 = value$1 * 100;\n }\n\n value$1 = FIXED(value$1, decimalPlaces, noCommas);\n\n if (value$1.startsWith('-')) {\n value$1 = value$1.replace('-', '');\n value$1 = '-' + currencySymbol + value$1;\n } else {\n value$1 = currencySymbol + value$1;\n }\n\n if (isPercent) {\n value$1 = value$1 + '%';\n }\n\n return value$1\n}\n\n/**\n * Combines the text from multiple ranges and/or strings.\n *\n * Category: Text\n * @param {*} delimiter A text string, either empty, or one or more characters enclosed by double quotes, or a reference to a valid text string. If a number is supplied, it will be treated as text.\n * @param {*} ignore_empty If TRUE, ignores empty values.\n * @param {*} args Text item to be joined. A text string, or array of strings, such as a range of values.\n * @returns\n */\nfunction TEXTJOIN(delimiter, ignore_empty, ...args) {\n if (typeof ignore_empty !== 'boolean') {\n ignore_empty = parseBool(ignore_empty);\n }\n\n if (arguments.length < 3) {\n return na\n }\n\n delimiter = delimiter !== null && delimiter !== undefined ? delimiter : '';\n\n let flatArgs = flatten(args);\n let textToJoin = ignore_empty ? flatArgs.filter((text) => text) : flatArgs;\n\n if (Array.isArray(delimiter)) {\n delimiter = flatten(delimiter);\n\n let chunks = textToJoin.map((item) => [item]);\n let index = 0;\n\n for (let i = 0; i < chunks.length - 1; i++) {\n chunks[i].push(delimiter[index]);\n index++;\n\n if (index === delimiter.length) {\n index = 0;\n }\n }\n\n textToJoin = flatten(chunks);\n\n return textToJoin.join('')\n }\n\n return textToJoin.join(delimiter)\n}\n\n/**\n * Removes spaces from text.\n *\n * Category: Text\n *\n * @param {*} text The text from which you want spaces removed.\n * @returns\n */\nfunction TRIM(text) {\n text = parseString(text);\n\n if (text instanceof Error) {\n return text\n }\n\n return text.replace(/\\s+/g, ' ').trim()\n}\n\nconst UNICHAR = CHAR;\n\nconst UNICODE = CODE;\n\n/**\n * Converts text to uppercase.\n *\n * Category: Text\n *\n * @param {*} text The text you want converted to uppercase. Text can be a reference or text string.\n * @returns\n */\nfunction UPPER(text) {\n text = parseString(text);\n\n if (text instanceof Error) {\n return text\n }\n\n return text.toUpperCase()\n}\n\n/**\n * Converts a text argument to a number.\n *\n * Category: Text\n *\n * @param {*} text The text enclosed in quotation marks or a reference to a value containing the text you want to convert.\n * @returns\n */\nfunction VALUE(text) {\n const anyError$1 = anyError(text);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (typeof text === 'number') {\n return text\n }\n\n if (!isDefined(text)) {\n text = '';\n }\n\n if (typeof text !== 'string') {\n return value\n }\n\n const isPercent = /(%)$/.test(text) || /^(%)/.test(text);\n text = text.replace(/^[^0-9-]{0,3}/, '');\n text = text.replace(/[^0-9]{0,3}$/, '');\n text = text.replace(/[ ,]/g, '');\n\n if (text === '') {\n return 0\n }\n\n let output = Number(text);\n\n if (isNaN(output)) {\n return value\n }\n\n output = output || 0;\n\n if (isPercent) {\n output = output * 0.01;\n }\n\n return output\n}\n\nfunction isValidBinaryNumber(number) {\n return /^[01]{1,10}$/.test(number)\n}\n\n/**\n * Returns the modified Bessel function In(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the Bessel function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELI(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besseli(x, n)\n}\n\n/**\n * Returns the Bessel function Jn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the Bessel function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELJ(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besselj(x, n)\n}\n\n/**\n * Returns the modified Bessel function Kn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELK(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besselk(x, n)\n}\n\n/**\n * Returns the Bessel function Yn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELY(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.bessely(x, n)\n}\n\n/**\n * Converts a binary number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction BIN2DEC(number) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Convert binary number to decimal\n const result = parseInt(number, 2);\n\n // Handle negative numbers\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return parseInt(stringified.substring(1), 2) - 512\n } else {\n return result\n }\n}\n\n/**\n * Converts a binary number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, BIN2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction BIN2HEX(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1099511627264 + parseInt(stringified.substring(1), 2)).toString(16)\n }\n\n // Convert binary number to hexadecimal\n const result = parseInt(number, 2).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a binary number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, BIN2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction BIN2OCT(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1073741312 + parseInt(stringified.substring(1), 2)).toString(8)\n }\n\n // Convert binary number to octal\n const result = parseInt(number, 2).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Returns a 'Bitwise And' of two numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be in decimal form and greater than or equal to 0.\n * @param {*} number2 Must be in decimal form and greater than or equal to 0.\n * @returns\n */\nfunction BITAND(number1, number2) {\n // Return error if either number is a non-numeric value\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise AND of two numbers\n return number1 & number2\n}\n\n/**\n * Returns a value number shifted left by shift_amount bits.\n *\n * Category: Engineering\n *\n * @param {*} number Number must be an integer greater than or equal to 0.\n * @param {*} shift_amount Shift_amount must be an integer.\n * @returns\n */\nfunction BITLSHIFT(number, shift_amount) {\n number = parseNumber(number);\n shift_amount = parseNumber(shift_amount);\n\n if (anyIsError(number, shift_amount)) {\n return value\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return num\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return num\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return num\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift_amount) > 53) {\n return num\n }\n\n // Return number shifted by shift bits to the left or to the right if shift is negative\n return shift_amount >= 0 ? number << shift_amount : number >> -shift_amount\n}\n\n/**\n * Returns a bitwise OR of 2 numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be in decimal form and greater than or equal to 0.\n * @param {*} number2 Must be in decimal form and greater than or equal to 0.\n * @returns\n */\nfunction BITOR(number1, number2) {\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise OR of two numbers\n return number1 | number2\n}\n\n/**\n * Returns a value number shifted right by shift_amount bits.\n *\n * Category: Engineering\n *\n * @param {*} number Must be an integer greater than or equal to 0.\n * @param {*} shift_amount Must be an integer.\n * @returns\n */\nfunction BITRSHIFT(number, shift_amount) {\n number = parseNumber(number);\n shift_amount = parseNumber(shift_amount);\n\n if (anyIsError(number, shift_amount)) {\n return value\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return num\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return num\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return num\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift_amount) > 53) {\n return num\n }\n\n // Return number shifted by shift bits to the right or to the left if shift is negative\n return shift_amount >= 0 ? number >> shift_amount : number << -shift_amount\n}\n\n/**\n * Returns a bitwise 'Exclusive Or' of two numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be greater than or equal to 0.\n * @param {*} number2 Must be greater than or equal to 0.\n * @returns\n */\nfunction BITXOR(number1, number2) {\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise XOR of two numbers\n return number1 ^ number2\n}\n\n/**\n * Converts real and imaginary coefficients into a complex number.\n *\n * Category: Engineering\n *\n * @param {*} real_num The real coefficient of the complex number.\n * @param {*} i_num The imaginary coefficient of the complex number.\n * @param {*} suffix Optional. The suffix for the imaginary component of the complex number. If omitted, suffix is assumed to be \"i\".\n * @returns\n */\nfunction COMPLEX(real_num, i_num, suffix) {\n real_num = parseNumber(real_num);\n i_num = parseNumber(i_num);\n\n if (anyIsError(real_num, i_num)) {\n return real_num\n }\n\n // Set suffix\n suffix = suffix === undefined ? 'i' : suffix;\n\n // Return error if suffix is neither \"i\" nor \"j\"\n if (suffix !== 'i' && suffix !== 'j') {\n return value\n }\n\n // Return complex number\n if (real_num === 0 && i_num === 0) {\n return 0\n } else if (real_num === 0) {\n return i_num === 1 ? suffix : i_num.toString() + suffix\n } else if (i_num === 0) {\n return real_num.toString()\n } else {\n const sign = i_num > 0 ? '+' : '';\n return real_num.toString() + sign + (i_num === 1 ? suffix : i_num.toString() + suffix)\n }\n}\n\n/**\n * Converts a number from one measurement system to another.\n *\n * Category: Engineering\n *\n * @param {*} number is the value in from_units to convert.\n * @param {*} from_unit is the units for number.\n * @param {*} to_unit is the units for the result. CONVERT accepts the following text values (in quotation marks) for from_unit and to_unit.\n * @returns\n */\nfunction CONVERT(number, from_unit, to_unit) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // List of units supported by CONVERT and units defined by the International System of Units\n // [Name, Symbol, Alternate symbols, Quantity, ISU, CONVERT, Conversion ratio]\n const units = [\n ['a.u. of action', '?', null, 'action', false, false, 1.05457168181818e-34],\n ['a.u. of charge', 'e', null, 'electric_charge', false, false, 1.60217653141414e-19],\n ['a.u. of energy', 'Eh', null, 'energy', false, false, 4.35974417757576e-18],\n ['a.u. of length', 'a?', null, 'length', false, false, 5.29177210818182e-11],\n ['a.u. of mass', 'm?', null, 'mass', false, false, 9.10938261616162e-31],\n ['a.u. of time', '?/Eh', null, 'time', false, false, 2.41888432650516e-17],\n ['admiralty knot', 'admkn', null, 'speed', false, true, 0.514773333],\n ['ampere', 'A', null, 'electric_current', true, false, 1],\n ['ampere per meter', 'A/m', null, 'magnetic_field_intensity', true, false, 1],\n ['\u00E5ngstr\u00F6m', '\u00C5', ['ang'], 'length', false, true, 1e-10],\n ['are', 'ar', null, 'area', false, true, 100],\n ['astronomical unit', 'ua', null, 'length', false, false, 1.49597870691667e-11],\n ['bar', 'bar', null, 'pressure', false, false, 100000],\n ['barn', 'b', null, 'area', false, false, 1e-28],\n ['becquerel', 'Bq', null, 'radioactivity', true, false, 1],\n ['bit', 'bit', ['b'], 'information', false, true, 1],\n ['btu', 'BTU', ['btu'], 'energy', false, true, 1055.05585262],\n ['byte', 'byte', null, 'information', false, true, 8],\n ['candela', 'cd', null, 'luminous_intensity', true, false, 1],\n ['candela per square metre', 'cd/m?', null, 'luminance', true, false, 1],\n ['coulomb', 'C', null, 'electric_charge', true, false, 1],\n ['cubic \u00E5ngstr\u00F6m', 'ang3', ['ang^3'], 'volume', false, true, 1e-30],\n ['cubic foot', 'ft3', ['ft^3'], 'volume', false, true, 0.028316846592],\n ['cubic inch', 'in3', ['in^3'], 'volume', false, true, 0.000016387064],\n ['cubic light-year', 'ly3', ['ly^3'], 'volume', false, true, 8.46786664623715e-47],\n ['cubic metre', 'm3', ['m^3'], 'volume', true, true, 1],\n ['cubic mile', 'mi3', ['mi^3'], 'volume', false, true, 4168181825.44058],\n ['cubic nautical mile', 'Nmi3', ['Nmi^3'], 'volume', false, true, 6352182208],\n ['cubic Pica', 'Pica3', ['Picapt3', 'Pica^3', 'Picapt^3'], 'volume', false, true, 7.58660370370369e-8],\n ['cubic yard', 'yd3', ['yd^3'], 'volume', false, true, 0.764554857984],\n ['cup', 'cup', null, 'volume', false, true, 0.0002365882365],\n ['dalton', 'Da', ['u'], 'mass', false, false, 1.66053886282828e-27],\n ['day', 'd', ['day'], 'time', false, true, 86400],\n ['degree', '\u00B0', null, 'angle', false, false, 0.0174532925199433],\n ['degrees Rankine', 'Rank', null, 'temperature', false, true, 0.555555555555556],\n ['dyne', 'dyn', ['dy'], 'force', false, true, 0.00001],\n ['electronvolt', 'eV', ['ev'], 'energy', false, true, 1.60217656514141],\n ['ell', 'ell', null, 'length', false, true, 1.143],\n ['erg', 'erg', ['e'], 'energy', false, true, 1e-7],\n ['farad', 'F', null, 'electric_capacitance', true, false, 1],\n ['fluid ounce', 'oz', null, 'volume', false, true, 0.0000295735295625],\n ['foot', 'ft', null, 'length', false, true, 0.3048],\n ['foot-pound', 'flb', null, 'energy', false, true, 1.3558179483314],\n ['gal', 'Gal', null, 'acceleration', false, false, 0.01],\n ['gallon', 'gal', null, 'volume', false, true, 0.003785411784],\n ['gauss', 'G', ['ga'], 'magnetic_flux_density', false, true, 1],\n ['grain', 'grain', null, 'mass', false, true, 0.0000647989],\n ['gram', 'g', null, 'mass', false, true, 0.001],\n ['gray', 'Gy', null, 'absorbed_dose', true, false, 1],\n ['gross registered ton', 'GRT', ['regton'], 'volume', false, true, 2.8316846592],\n ['hectare', 'ha', null, 'area', false, true, 10000],\n ['henry', 'H', null, 'inductance', true, false, 1],\n ['hertz', 'Hz', null, 'frequency', true, false, 1],\n ['horsepower', 'HP', ['h'], 'power', false, true, 745.69987158227],\n ['horsepower-hour', 'HPh', ['hh', 'hph'], 'energy', false, true, 2684519.538],\n ['hour', 'h', ['hr'], 'time', false, true, 3600],\n ['imperial gallon (U.K.)', 'uk_gal', null, 'volume', false, true, 0.00454609],\n ['imperial hundredweight', 'lcwt', ['uk_cwt', 'hweight'], 'mass', false, true, 50.802345],\n ['imperial quart (U.K)', 'uk_qt', null, 'volume', false, true, 0.0011365225],\n ['imperial ton', 'brton', ['uk_ton', 'LTON'], 'mass', false, true, 1016.046909],\n ['inch', 'in', null, 'length', false, true, 0.0254],\n ['international acre', 'uk_acre', null, 'area', false, true, 4046.8564224],\n ['IT calorie', 'cal', null, 'energy', false, true, 4.1868],\n ['joule', 'J', null, 'energy', true, true, 1],\n ['katal', 'kat', null, 'catalytic_activity', true, false, 1],\n ['kelvin', 'K', ['kel'], 'temperature', true, true, 1],\n ['kilogram', 'kg', null, 'mass', true, true, 1],\n ['knot', 'kn', null, 'speed', false, true, 0.514444444444444],\n ['light-year', 'ly', null, 'length', false, true, 9460730472580800],\n ['litre', 'L', ['l', 'lt'], 'volume', false, true, 0.001],\n ['lumen', 'lm', null, 'luminous_flux', true, false, 1],\n ['lux', 'lx', null, 'illuminance', true, false, 1],\n ['maxwell', 'Mx', null, 'magnetic_flux', false, false, 1e-18],\n ['measurement ton', 'MTON', null, 'volume', false, true, 1.13267386368],\n ['meter per hour', 'm/h', ['m/hr'], 'speed', false, true, 0.00027777777777778],\n ['meter per second', 'm/s', ['m/sec'], 'speed', true, true, 1],\n ['meter per second squared', 'm?s??', null, 'acceleration', true, false, 1],\n ['parsec', 'pc', ['parsec'], 'length', false, true, 30856775814671900],\n ['meter squared per second', 'm?/s', null, 'kinematic_viscosity', true, false, 1],\n ['metre', 'm', null, 'length', true, true, 1],\n ['miles per hour', 'mph', null, 'speed', false, true, 0.44704],\n ['millimetre of mercury', 'mmHg', null, 'pressure', false, false, 133.322],\n ['minute', '?', null, 'angle', false, false, 0.000290888208665722],\n ['minute', 'min', ['mn'], 'time', false, true, 60],\n ['modern teaspoon', 'tspm', null, 'volume', false, true, 0.000005],\n ['mole', 'mol', null, 'amount_of_substance', true, false, 1],\n ['morgen', 'Morgen', null, 'area', false, true, 2500],\n ['n.u. of action', '?', null, 'action', false, false, 1.05457168181818e-34],\n ['n.u. of mass', 'm?', null, 'mass', false, false, 9.10938261616162e-31],\n ['n.u. of speed', 'c?', null, 'speed', false, false, 299792458],\n ['n.u. of time', '?/(me?c??)', null, 'time', false, false, 1.28808866778687e-21],\n ['nautical mile', 'M', ['Nmi'], 'length', false, true, 1852],\n ['newton', 'N', null, 'force', true, true, 1],\n ['\u0153rsted', 'Oe ', null, 'magnetic_field_intensity', false, false, 79.5774715459477],\n ['ohm', '\u03A9', null, 'electric_resistance', true, false, 1],\n ['ounce mass', 'ozm', null, 'mass', false, true, 0.028349523125],\n ['pascal', 'Pa', null, 'pressure', true, false, 1],\n ['pascal second', 'Pa?s', null, 'dynamic_viscosity', true, false, 1],\n ['pferdest\u00E4rke', 'PS', null, 'power', false, true, 735.49875],\n ['phot', 'ph', null, 'illuminance', false, false, 0.0001],\n ['pica (1/6 inch)', 'pica', null, 'length', false, true, 0.00035277777777778],\n ['pica (1/72 inch)', 'Pica', ['Picapt'], 'length', false, true, 0.00423333333333333],\n ['poise', 'P', null, 'dynamic_viscosity', false, false, 0.1],\n ['pond', 'pond', null, 'force', false, true, 0.00980665],\n ['pound force', 'lbf', null, 'force', false, true, 4.4482216152605],\n ['pound mass', 'lbm', null, 'mass', false, true, 0.45359237],\n ['quart', 'qt', null, 'volume', false, true, 0.000946352946],\n ['radian', 'rad', null, 'angle', true, false, 1],\n ['second', '?', null, 'angle', false, false, 0.00000484813681109536],\n ['second', 's', ['sec'], 'time', true, true, 1],\n ['short hundredweight', 'cwt', ['shweight'], 'mass', false, true, 45.359237],\n ['siemens', 'S', null, 'electrical_conductance', true, false, 1],\n ['sievert', 'Sv', null, 'equivalent_dose', true, false, 1],\n ['slug', 'sg', null, 'mass', false, true, 14.59390294],\n ['square \u00E5ngstr\u00F6m', 'ang2', ['ang^2'], 'area', false, true, 1e-20],\n ['square foot', 'ft2', ['ft^2'], 'area', false, true, 0.09290304],\n ['square inch', 'in2', ['in^2'], 'area', false, true, 0.00064516],\n ['square light-year', 'ly2', ['ly^2'], 'area', false, true, 8.95054210748189e31],\n ['square meter', 'm?', null, 'area', true, true, 1],\n ['square mile', 'mi2', ['mi^2'], 'area', false, true, 2589988.110336],\n ['square nautical mile', 'Nmi2', ['Nmi^2'], 'area', false, true, 3429904],\n ['square Pica', 'Pica2', ['Picapt2', 'Pica^2', 'Picapt^2'], 'area', false, true, 0.00001792111111111],\n ['square yard', 'yd2', ['yd^2'], 'area', false, true, 0.83612736],\n ['statute mile', 'mi', null, 'length', false, true, 1609.344],\n ['steradian', 'sr', null, 'solid_angle', true, false, 1],\n ['stilb', 'sb', null, 'luminance', false, false, 0.0001],\n ['stokes', 'St', null, 'kinematic_viscosity', false, false, 0.0001],\n ['stone', 'stone', null, 'mass', false, true, 6.35029318],\n ['tablespoon', 'tbs', null, 'volume', false, true, 0.0000147868],\n ['teaspoon', 'tsp', null, 'volume', false, true, 0.00000492892],\n ['tesla', 'T', null, 'magnetic_flux_density', true, true, 1],\n ['thermodynamic calorie', 'c', null, 'energy', false, true, 4.184],\n ['ton', 'ton', null, 'mass', false, true, 907.18474],\n ['tonne', 't', null, 'mass', false, false, 1000],\n ['U.K. pint', 'uk_pt', null, 'volume', false, true, 0.00056826125],\n ['U.S. bushel', 'bushel', null, 'volume', false, true, 0.03523907],\n ['U.S. oil barrel', 'barrel', null, 'volume', false, true, 0.158987295],\n ['U.S. pint', 'pt', ['us_pt'], 'volume', false, true, 0.000473176473],\n ['U.S. survey mile', 'survey_mi', null, 'length', false, true, 1609.347219],\n ['U.S. survey/statute acre', 'us_acre', null, 'area', false, true, 4046.87261],\n ['volt', 'V', null, 'voltage', true, false, 1],\n ['watt', 'W', null, 'power', true, true, 1],\n ['watt-hour', 'Wh', ['wh'], 'energy', false, true, 3600],\n ['weber', 'Wb', null, 'magnetic_flux', true, false, 1],\n ['yard', 'yd', null, 'length', false, true, 0.9144],\n ['year', 'yr', null, 'time', false, true, 31557600]\n ];\n\n // Binary prefixes\n // [Name, Prefix power of 2 value, Previx value, Abbreviation, Derived from]\n const binary_prefixes = {\n Yi: ['yobi', 80, 1208925819614629174706176, 'Yi', 'yotta'],\n Zi: ['zebi', 70, 1180591620717411303424, 'Zi', 'zetta'],\n Ei: ['exbi', 60, 1152921504606846976, 'Ei', 'exa'],\n Pi: ['pebi', 50, 1125899906842624, 'Pi', 'peta'],\n Ti: ['tebi', 40, 1099511627776, 'Ti', 'tera'],\n Gi: ['gibi', 30, 1073741824, 'Gi', 'giga'],\n Mi: ['mebi', 20, 1048576, 'Mi', 'mega'],\n ki: ['kibi', 10, 1024, 'ki', 'kilo']\n };\n\n // Unit prefixes\n // [Name, Multiplier, Abbreviation]\n const unit_prefixes = {\n Y: ['yotta', 1e24, 'Y'],\n Z: ['zetta', 1e21, 'Z'],\n E: ['exa', 1e18, 'E'],\n P: ['peta', 1e15, 'P'],\n T: ['tera', 1e12, 'T'],\n G: ['giga', 1e9, 'G'],\n M: ['mega', 1e6, 'M'],\n k: ['kilo', 1e3, 'k'],\n h: ['hecto', 1e2, 'h'],\n e: ['dekao', 1e1, 'e'],\n d: ['deci', 1e-1, 'd'],\n c: ['centi', 1e-2, 'c'],\n m: ['milli', 1e-3, 'm'],\n u: ['micro', 1e-6, 'u'],\n n: ['nano', 1e-9, 'n'],\n p: ['pico', 1e-12, 'p'],\n f: ['femto', 1e-15, 'f'],\n a: ['atto', 1e-18, 'a'],\n z: ['zepto', 1e-21, 'z'],\n y: ['yocto', 1e-24, 'y']\n };\n\n // Initialize units and multipliers\n let from = null;\n let to = null;\n let base_from_unit = from_unit;\n let base_to_unit = to_unit;\n let from_multiplier = 1;\n let to_multiplier = 1;\n let alt;\n\n // Lookup from and to units\n for (let i = 0; i < units.length; i++) {\n alt = units[i][2] === null ? [] : units[i][2];\n\n if (units[i][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[i];\n }\n\n if (units[i][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[i];\n }\n }\n\n // Lookup from prefix\n if (from === null) {\n const from_binary_prefix = binary_prefixes[from_unit.substring(0, 2)];\n let from_unit_prefix = unit_prefixes[from_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (from_unit.substring(0, 2) === 'da') {\n from_unit_prefix = ['dekao', 1e1, 'da'];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (from_binary_prefix) {\n from_multiplier = from_binary_prefix[2];\n base_from_unit = from_unit.substring(2);\n } else if (from_unit_prefix) {\n from_multiplier = from_unit_prefix[1];\n base_from_unit = from_unit.substring(from_unit_prefix[2].length);\n }\n\n // Lookup from unit\n for (let j = 0; j < units.length; j++) {\n alt = units[j][2] === null ? [] : units[j][2];\n\n if (units[j][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[j];\n }\n }\n }\n\n // Lookup to prefix\n if (to === null) {\n const to_binary_prefix = binary_prefixes[to_unit.substring(0, 2)];\n let to_unit_prefix = unit_prefixes[to_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (to_unit.substring(0, 2) === 'da') {\n to_unit_prefix = ['dekao', 1e1, 'da'];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (to_binary_prefix) {\n to_multiplier = to_binary_prefix[2];\n base_to_unit = to_unit.substring(2);\n } else if (to_unit_prefix) {\n to_multiplier = to_unit_prefix[1];\n base_to_unit = to_unit.substring(to_unit_prefix[2].length);\n }\n\n // Lookup to unit\n for (let k = 0; k < units.length; k++) {\n alt = units[k][2] === null ? [] : units[k][2];\n\n if (units[k][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[k];\n }\n }\n }\n\n // Return error if a unit does not exist\n if (from === null || to === null) {\n return na\n }\n\n // Return error if units represent different quantities\n if (from[3] !== to[3]) {\n return na\n }\n\n // Return converted number\n return (number * from[6] * from_multiplier) / (to[6] * to_multiplier)\n}\n\n/**\n * Converts a decimal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, valid place values are ignored and DEC2BIN returns a 10-character (10-bit) binary number in which the most significant bit is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2BIN(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -512, or is greater than 511\n if (!/^-?[0-9]{1,3}$/.test(number) || number < -512 || number > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (number < 0) {\n return '1' + REPT('0', 9 - (512 + number).toString(2).length) + (512 + number).toString(2)\n }\n\n // Convert decimal number to binary\n const result = parseInt(number, 10).toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a decimal number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, places is ignored and DEC2HEX returns a 10-character (40-bit) hexadecimal number in which the most significant bit is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2HEX(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,12}$/.test(number) || number < -549755813888 || number > 549755813887) {\n return num\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n if (number < 0) {\n return (1099511627776 + number).toString(16)\n }\n\n // Convert decimal number to hexadecimal\n const result = parseInt(number, 10).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a decimal number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, places is ignored and DEC2OCT returns a 10-character (30-bit) octal number in which the most significant bit is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2OCT(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,9}$/.test(number) || number < -536870912 || number > 536870911) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (number < 0) {\n return (1073741824 + number).toString(8)\n }\n\n // Convert decimal number to octal\n const result = parseInt(number, 10).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Tests whether two values are equal.\n *\n * Category: Engineering\n *\n * @param {*} number1 The first number.\n * @param {*} number2 Optional. The second number. If omitted, number2 is assumed to be zero.\n * @returns\n */\nfunction DELTA(number1, number2) {\n // Set number2 to zero if undefined\n number2 = number2 === undefined ? 0 : number2;\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return delta\n return number1 === number2 ? 1 : 0\n}\n\n// TODO: why is upper_bound not used ? The excel documentation has no examples with upper_bound\n/**\n * Returns the error function.\n *\n * Category: Engineering\n *\n * @param {*} lower_limit The lower bound for integrating ERF.\n * @param {*} upper_limit Optional. The upper bound for integrating ERF. If omitted, ERF integrates between zero and lower_limit.\n * @returns\n */\nfunction ERF(lower_limit, upper_limit) {\n // Set number2 to zero if undefined\n upper_limit = upper_limit === undefined ? 0 : upper_limit;\n\n lower_limit = parseNumber(lower_limit);\n upper_limit = parseNumber(upper_limit);\n\n if (anyIsError(lower_limit, upper_limit)) {\n return value\n }\n\n return jStat.erf(lower_limit)\n}\n\n// TODO\n\n/**\n * -- Not implemented --\n *\n * Returns the error function.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERF.PRECISE.\n * @returns\n */\nERF.PRECISE = () => {\n throw new Error('ERF.PRECISE is not implemented')\n};\n\n/**\n * Returns the complementary error function.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERFC.\n * @returns\n */\nfunction ERFC(x) {\n // Return error if x is not a number\n if (isNaN(x)) {\n return value\n }\n\n return jStat.erfc(x)\n}\n\n// TODO\n\n/**\n * -- Not implemented --\n *\n * Returns the complementary ERF function integrated between x and infinity.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERFC.PRECISE.\n * @returns\n */\nERFC.PRECISE = () => {\n throw new Error('ERFC.PRECISE is not implemented')\n};\n\n/**\n * Tests whether a number is greater than a threshold value.\n *\n * Category: Engineering\n *\n * @param {*} number The value to test against step.\n * @param {*} step Optional. The threshold value. If you omit a value for step, GESTEP uses zero.\n * @returns\n */\nfunction GESTEP(number, step) {\n step = step || 0;\n number = parseNumber(number);\n\n if (anyIsError(step, number)) {\n return number\n }\n\n // Return delta\n return number >= step ? 1 : 0\n}\n\n/**\n * Converts a hexadecimal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters. The most significant bit of number is the sign bit (40th bit from the right). The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, HEX2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction HEX2BIN(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Check if number is negative\n const negative = !!(number.length === 10 && number.substring(0, 1).toLowerCase() === 'f');\n\n // Convert hexadecimal number to decimal\n const decimal = negative ? parseInt(number, 16) - 1099511627776 : parseInt(number, 16);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2)\n }\n\n // Convert decimal number to binary\n const result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a hexadecimal number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters (40 bits). The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction HEX2DEC(number) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert hexadecimal number to decimal\n const decimal = parseInt(number, 16);\n\n // Return decimal number\n return decimal >= 549755813888 ? decimal - 1099511627776 : decimal\n}\n\n/**\n * Converts a hexadecimal number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, HEX2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction HEX2OCT(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert hexadecimal number to decimal\n const decimal = parseInt(number, 16);\n\n // Return error if number is positive and greater than 0x1fffffff (536870911)\n if (decimal > 536870911 && decimal < 1098974756864) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 1098974756864) {\n return (decimal - 1098437885952).toString(8)\n }\n\n // Convert decimal number to octal\n const result = decimal.toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Returns the absolute value (modulus) of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the absolute value.\n * @returns\n */\nfunction IMABS(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return absolute value of complex number\n return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))\n}\n\n/**\n * Returns the imaginary coefficient of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the imaginary coefficient.\n * @returns\n */\nfunction IMAGINARY(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return value\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0\n }\n\n // Handle special cases\n if (['i', 'j'].indexOf(inumber) >= 0) {\n return 1\n }\n\n // Force string type\n inumber = inumber + '';\n\n // Normalize imaginary coefficient\n inumber = inumber.replace('+i', '+1i').replace('-i', '-1i').replace('+j', '+1j').replace('-j', '-1j');\n\n // Lookup sign\n let plus = inumber.indexOf('+');\n let minus = inumber.indexOf('-');\n\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n const last = inumber.substring(inumber.length - 1, inumber.length);\n const unit = last === 'i' || last === 'j';\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return num\n }\n\n // Return imaginary coefficient of complex number\n if (plus >= 0) {\n return isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(plus + 1, inumber.length - 1))\n } else {\n return isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))\n ? num\n : -Number(inumber.substring(minus + 1, inumber.length - 1))\n }\n } else {\n if (unit) {\n return isNaN(inumber.substring(0, inumber.length - 1)) ? num : inumber.substring(0, inumber.length - 1)\n } else {\n return isNaN(inumber) ? num : 0\n }\n }\n}\n\n/**\n * Returns the argument theta, an angle expressed in radians.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the argument .\n * @returns\n */\nfunction IMARGUMENT(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return error if inumber is equal to zero\n if (x === 0 && y === 0) {\n return div0\n }\n\n // Return PI/2 if x is equal to zero and y is positive\n if (x === 0 && y > 0) {\n return Math.PI / 2\n }\n\n // Return -PI/2 if x is equal to zero and y is negative\n if (x === 0 && y < 0) {\n return -Math.PI / 2\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x > 0) {\n return 0\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x < 0) {\n return -Math.PI\n }\n\n // Return argument of complex number\n if (x > 0) {\n return Math.atan(y / x)\n } else if (x < 0 && y >= 0) {\n return Math.atan(y / x) + Math.PI\n } else {\n return Math.atan(y / x) - Math.PI\n }\n}\n\n/**\n * Returns the complex conjugate of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the conjugate.\n * @returns\n */\nfunction IMCONJUGATE(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return conjugate of complex number\n return y !== 0 ? COMPLEX(x, -y, unit) : inumber\n}\n\n/**\n * Returns the cosine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cosine.\n * @returns\n */\nfunction IMCOS(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return cosine of complex number\n return COMPLEX(\n (Math.cos(x) * (Math.exp(y) + Math.exp(-y))) / 2,\n (-Math.sin(x) * (Math.exp(y) - Math.exp(-y))) / 2,\n unit\n )\n}\n\n/**\n * Returns the hyperbolic cosine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic cosine.\n * @returns\n */\nfunction IMCOSH(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return hyperbolic cosine of complex number\n return COMPLEX(\n (Math.cos(y) * (Math.exp(x) + Math.exp(-x))) / 2,\n (Math.sin(y) * (Math.exp(x) - Math.exp(-x))) / 2,\n unit\n )\n}\n\n/**\n * Returns the cotangent of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cotangent.\n * @returns\n */\nfunction IMCOT(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return cotangent of complex number\n return IMDIV(IMCOS(inumber), IMSIN(inumber))\n}\n\n/**\n * Returns the quotient of two complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} inumber1 The complex numerator or dividend.\n * @param {*} inumber2 The complex denominator or divisor.\n * @returns\n */\nfunction IMDIV(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const a = IMREAL(inumber1);\n const b = IMAGINARY(inumber1);\n const c = IMREAL(inumber2);\n const d = IMAGINARY(inumber2);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Lookup imaginary unit\n const unit1 = inumber1.substring(inumber1.length - 1);\n const unit2 = inumber2.substring(inumber2.length - 1);\n let unit = 'i';\n\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return error if inumber2 is null\n if (c === 0 && d === 0) {\n return num\n }\n\n // Return exponential of complex number\n const den = c * c + d * d;\n return COMPLEX((a * c + b * d) / den, (b * c - a * d) / den, unit)\n}\n\n/**\n * Returns the exponential of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the exponential.\n * @returns\n */\nfunction IMEXP(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n const e = Math.exp(x);\n return COMPLEX(e * Math.cos(y), e * Math.sin(y), unit)\n}\n\n/**\n * Returns the natural logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the natural logarithm.\n * @returns\n */\nfunction IMLN(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)), Math.atan(y / x), unit)\n}\n\n/**\n * Returns the base-10 logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the common logarithm.\n * @returns\n */\nfunction IMLOG10(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(10), Math.atan(y / x) / Math.log(10), unit)\n}\n\n/**\n * Returns the base-2 logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the base-2 logarithm.\n * @returns\n */\nfunction IMLOG2(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(2), Math.atan(y / x) / Math.log(2), unit)\n}\n\n/**\n * Returns a complex number raised to an integer power.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number you want to raise to a power.\n * @param {*} number The power to which you want to raise the complex number.\n * @returns\n */\nfunction IMPOWER(inumber, number) {\n number = parseNumber(number);\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(number, x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Calculate power of modulus\n const p = Math.pow(IMABS(inumber), number);\n\n // Calculate argument\n const t = IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return COMPLEX(p * Math.cos(number * t), p * Math.sin(number * t), unit)\n}\n\n/**\n * Returns the product of complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} args inumber1, [inumber2], \u2026 Inumber1 is required, subsequent inumbers are not. 1 to 255 complex numbers to multiply.\n * @returns\n */\nfunction IMPRODUCT() {\n // Initialize result\n let result = arguments[0];\n\n if (!arguments.length) {\n return value\n }\n\n // Loop on all numbers\n for (let i = 1; i < arguments.length; i++) {\n // Lookup coefficients of two complex numbers\n const a = IMREAL(result);\n const b = IMAGINARY(result);\n const c = IMREAL(arguments[i]);\n const d = IMAGINARY(arguments[i]);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Complute product of two complex numbers\n result = COMPLEX(a * c - b * d, a * d + b * c);\n }\n\n // Return product of complex numbers\n return result\n}\n\n/**\n * Returns the real coefficient of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the real coefficient.\n * @returns\n */\nfunction IMREAL(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return value\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0\n }\n\n // Handle special cases\n if (['i', '+i', '1i', '+1i', '-i', '-1i', 'j', '+j', '1j', '+1j', '-j', '-1j'].indexOf(inumber) >= 0) {\n return 0\n }\n\n // Force String type\n inumber = inumber + '';\n\n // Lookup sign\n let plus = inumber.indexOf('+');\n let minus = inumber.indexOf('-');\n\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n const last = inumber.substring(inumber.length - 1, inumber.length);\n const unit = last === 'i' || last === 'j';\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return num\n }\n\n // Return real coefficient of complex number\n if (plus >= 0) {\n return isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(0, plus))\n } else {\n return isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(0, minus))\n }\n } else {\n if (unit) {\n return isNaN(inumber.substring(0, inumber.length - 1)) ? num : 0\n } else {\n return isNaN(inumber) ? num : inumber\n }\n }\n}\n\n/**\n * Returns the secant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the secant.\n * @returns\n */\nfunction IMSEC(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return secant of complex number\n return IMDIV('1', IMCOS(inumber))\n}\n\n/**\n * Returns the hyperbolic secant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic secant.\n * @returns\n */\nfunction IMSECH(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return hyperbolic secant of complex number\n return IMDIV('1', IMCOSH(inumber))\n}\n\n/**\n * Returns the sine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the sine.\n * @returns\n */\nfunction IMSIN(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return sine of complex number\n return COMPLEX(\n (Math.sin(x) * (Math.exp(y) + Math.exp(-y))) / 2,\n (Math.cos(x) * (Math.exp(y) - Math.exp(-y))) / 2,\n unit\n )\n}\n\n/**\n * Returns the hyperbolic sine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic sine.\n * @returns\n */\nfunction IMSINH(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return hyperbolic sine of complex number\n return COMPLEX(\n (Math.cos(y) * (Math.exp(x) - Math.exp(-x))) / 2,\n (Math.sin(y) * (Math.exp(x) + Math.exp(-x))) / 2,\n unit\n )\n}\n\n/**\n * Returns the square root of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the square root.\n * @returns\n */\nfunction IMSQRT(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Calculate power of modulus\n const s = Math.sqrt(IMABS(inumber));\n\n // Calculate argument\n const t = IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return COMPLEX(s * Math.cos(t / 2), s * Math.sin(t / 2), unit)\n}\n\n/**\n * Returns the cosecant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cosecant.\n * @returns\n */\nfunction IMCSC(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return num\n }\n\n // Return cosecant of complex number\n return IMDIV('1', IMSIN(inumber))\n}\n\n/**\n * Returns the hyperbolic cosecant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic cosecant.\n * @returns\n */\nfunction IMCSCH(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return num\n }\n\n // Return hyperbolic cosecant of complex number\n return IMDIV('1', IMSINH(inumber))\n}\n\n/**\n * Returns the difference between two complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} inumber1 The complex number from which to subtract inumber2.\n * @param {*} inumber2 The complex number to subtract from inumber1.\n * @returns\n */\nfunction IMSUB(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const a = IMREAL(inumber1);\n const b = IMAGINARY(inumber1);\n const c = IMREAL(inumber2);\n const d = IMAGINARY(inumber2);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Lookup imaginary unit\n const unit1 = inumber1.substring(inumber1.length - 1);\n const unit2 = inumber2.substring(inumber2.length - 1);\n let unit = 'i';\n\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return _ of two complex numbers\n return COMPLEX(a - c, b - d, unit)\n}\n\n/**\n * Returns the sum of complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} args inumber1, [inumber2], ... Inumber1 is required, subsequent numbers are not. 1 to 255 complex numbers to add.\n * @returns\n */\nfunction IMSUM() {\n if (!arguments.length) {\n return value\n }\n\n const args = flatten(arguments);\n\n // Initialize result\n let result = args[0];\n\n // Loop on all numbers\n for (let i = 1; i < args.length; i++) {\n // Lookup coefficients of two complex numbers\n const a = IMREAL(result);\n const b = IMAGINARY(result);\n const c = IMREAL(args[i]);\n const d = IMAGINARY(args[i]);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Complute product of two complex numbers\n result = COMPLEX(a + c, b + d);\n }\n\n // Return sum of complex numbers\n return result\n}\n\n/**\n * Returns the tangent of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the tangent.\n * @returns\n */\nfunction IMTAN(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return tangent of complex number\n return IMDIV(IMSIN(inumber), IMCOS(inumber))\n}\n\n/**\n * Converts an octal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, OCT2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction OCT2BIN(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Check if number is negative\n const negative = !!(number.length === 10 && number.substring(0, 1) === '7');\n\n // Convert octal number to decimal\n const decimal = negative ? parseInt(number, 8) - 1073741824 : parseInt(number, 8);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2)\n }\n\n // Convert decimal number to binary\n const result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts an octal number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction OCT2DEC(number) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert octal number to decimal\n const decimal = parseInt(number, 8);\n\n // Return decimal number\n return decimal >= 536870912 ? decimal - 1073741824 : decimal\n}\n\n/**\n * Converts an octal number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, OCT2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction OCT2HEX(number, places) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert octal number to decimal\n const decimal = parseInt(number, 8);\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 536870912) {\n return 'ff' + (decimal + 3221225472).toString(16)\n }\n\n // Convert decimal number to hexadecimal\n const result = decimal.toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\nconst BETADIST = BETA.DIST;\nconst BETAINV = BETA.INV;\nconst BINOMDIST = BINOM.DIST;\nconst CEILINGMATH = CEILING.MATH;\nconst CEILINGPRECISE = CEILING.PRECISE;\nconst CHIDIST = CHISQ.DIST;\nconst CHIDISTRT = CHISQ.DIST.RT;\nconst CHIINV = CHISQ.INV;\nconst CHIINVRT = CHISQ.INV.RT;\nconst CHITEST = CHISQ.TEST;\nconst COVAR = COVARIANCE.P;\nconst COVARIANCEP = COVARIANCE.P;\nconst COVARIANCES = COVARIANCE.S;\nconst CRITBINOM = BINOM.INV;\nconst ERFCPRECISE = ERFC.PRECISE;\nconst ERFPRECISE = ERF.PRECISE;\nconst EXPONDIST = EXPON.DIST;\nconst FDIST = F.DIST;\nconst FDISTRT = F.DIST.RT;\nconst FINV = F.INV;\nconst FINVRT = F.INV.RT;\nconst FLOORMATH = FLOOR.MATH;\nconst FLOORPRECISE = FLOOR.PRECISE;\nconst FTEST = F.TEST;\nconst GAMMADIST = GAMMA.DIST;\nconst GAMMAINV = GAMMA.INV;\nconst GAMMALNPRECISE = GAMMALN.PRECISE;\nconst HYPGEOMDIST = HYPGEOM.DIST;\nconst LOGINV = LOGNORM.INV;\nconst LOGNORMDIST = LOGNORM.DIST;\nconst LOGNORMINV = LOGNORM.INV;\nconst MODEMULT = MODE.MULT;\nconst MODESNGL = MODE.SNGL;\nconst NEGBINOMDIST = NEGBINOM.DIST;\nconst NETWORKDAYSINTL = NETWORKDAYS.INTL;\nconst NORMDIST = NORM.DIST;\nconst NORMINV = NORM.INV;\nconst NORMSDIST = NORM.S.DIST;\nconst NORMSINV = NORM.S.INV;\nconst PERCENTILEEXC = PERCENTILE.EXC;\nconst PERCENTILEINC = PERCENTILE.INC;\nconst PERCENTRANKEXC = PERCENTRANK.EXC;\nconst PERCENTRANKINC = PERCENTRANK.INC;\nconst POISSONDIST = POISSON.DIST;\nconst QUARTILEEXC = QUARTILE.EXC;\nconst QUARTILEINC = QUARTILE.INC;\nconst RANKAVG = RANK.AVG;\nconst RANKEQ = RANK.EQ;\nconst SKEWP = SKEW.P;\nconst STDEVP = STDEV.P;\nconst STDEVS = STDEV.S;\nconst TDIST = T$1.DIST;\nconst TDISTRT = T$1.DIST.RT;\nconst TINV = T$1.INV;\nconst TTEST = T$1.TEST;\nconst VARP = VAR.P;\nconst VARS = VAR.S;\nconst WEIBULLDIST = WEIBULL.DIST;\nconst WORKDAYINTL = WORKDAY.INTL;\nconst ZTEST = Z.TEST;\n\nfunction compact(array) {\n const result = [];\n\n arrayEach(array, (value) => {\n if (value) {\n result.push(value);\n }\n });\n\n return result\n}\n\nfunction findResultIndex(database, criterias) {\n const matches = {};\n\n for (let i = 1; i < database[0].length; ++i) {\n matches[i] = true;\n }\n\n let maxCriteriaLength = criterias[0].length;\n\n for (let i = 1; i < criterias.length; ++i) {\n if (criterias[i].length > maxCriteriaLength) {\n maxCriteriaLength = criterias[i].length;\n }\n }\n\n for (let k = 1; k < database.length; ++k) {\n for (let l = 1; l < database[k].length; ++l) {\n let currentCriteriaResult = false;\n let hasMatchingCriteria = false;\n\n for (let j = 0; j < criterias.length; ++j) {\n const criteria = criterias[j];\n\n if (criteria.length < maxCriteriaLength) {\n continue\n }\n\n const criteriaField = criteria[0];\n\n if (database[k][0] !== criteriaField) {\n continue\n }\n\n hasMatchingCriteria = true;\n\n for (let p = 1; p < criteria.length; ++p) {\n if (!currentCriteriaResult) {\n const isWildcard = criteria[p] === void 0 || criteria[p] === '*';\n\n if (isWildcard) {\n currentCriteriaResult = true;\n } else {\n const tokenizedCriteria = parse(criteria[p] + '');\n const tokens = [createToken(database[k][l], TOKEN_TYPE_LITERAL)].concat(\n tokenizedCriteria\n );\n\n currentCriteriaResult = compute(tokens);\n }\n }\n }\n }\n\n if (hasMatchingCriteria) {\n matches[l] = matches[l] && currentCriteriaResult;\n }\n }\n }\n\n const result = [];\n\n for (let n = 0; n < database[0].length; ++n) {\n if (matches[n]) {\n result.push(n - 1);\n }\n }\n\n return result\n}\n\n// Database functions\n/**\n * Returns the average of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database Range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria Range of values that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DAVERAGE(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let sum = 0;\n\n arrayEach(resultIndexes, (value) => {\n sum += targetFields[value];\n });\n\n return resultIndexes.length === 0 ? div0 : sum / resultIndexes.length\n}\n\n/**\n * Counts the values that contain numbers in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as the argument includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DCOUNT(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return COUNT(targetValues)\n}\n\n/**\n * Counts nonblank values in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Optional. Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DCOUNTA(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return COUNTA(targetValues)\n}\n\n/**\n * Extracts from a database a single record that matches the specified criteria.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DGET(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n // Return error if no record meets the criteria\n if (resultIndexes.length === 0) {\n return value\n }\n // Returns the #NUM! error value because more than one record meets the\n // criteria\n if (resultIndexes.length > 1) {\n return num\n }\n\n return targetFields[resultIndexes[0]]\n}\n\n/**\n * Returns the maximum value from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DMAX(database, field, criteria) {\n // Return error if field is not a number and not a string\n\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let maxValue = targetFields[resultIndexes[0]];\n\n arrayEach(resultIndexes, (value) => {\n if (maxValue < targetFields[value]) {\n maxValue = targetFields[value];\n }\n });\n\n return maxValue\n}\n\n/**\n * Returns the minimum value from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DMIN(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let minValue = targetFields[resultIndexes[0]];\n\n arrayEach(resultIndexes, (value) => {\n if (minValue > targetFields[value]) {\n minValue = targetFields[value];\n }\n });\n\n return minValue\n}\n\n/**\n * Multiplies the values in a particular field of records that match the criteria in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DPRODUCT(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n targetValues = compact(targetValues);\n\n let result = 1;\n\n arrayEach(targetValues, (value) => {\n result *= value;\n });\n\n return result\n}\n\n/**\n * Estimates the standard deviation based on a sample of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSTDEV(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n targetValues = compact(targetValues);\n\n return STDEV.S(targetValues)\n}\n\n/**\n * Calculates the standard deviation based on the entire population of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSTDEVP(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n targetValues = compact(targetValues);\n\n return STDEV.P(targetValues)\n}\n\n/**\n * Adds the numbers in the field column of records in the database that match the criteria.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria Is the range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSUM(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return SUM(targetValues)\n}\n\n/**\n * Estimates variance based on a sample from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DVAR(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return VAR.S(targetValues)\n}\n\n/**\n * Calculates variance based on the entire population of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DVARP(database, field, criteria) {\n // Return error if field is not a number and not a string\n\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return VAR.P(targetValues)\n}\n\nfunction validDate(d) {\n return d && d.getTime && !isNaN(d.getTime())\n}\n\nfunction ensureDate(d) {\n return d instanceof Date ? d : new Date(d)\n}\n\n// Calculate last coupon date before settlement\nfunction lastCoupDateBeforeSettlement(settlement, maturity, frequency) {\n let date = parseDate(maturity);\n date.setFullYear(settlement.getFullYear());\n\n if (date < settlement) {\n date.setFullYear(date.getFullYear() + 1);\n }\n\n // Adjust the date based on the coupon frequency until date is later than settlement\n while (date > settlement) {\n date.setMonth(date.getMonth() + -12 / frequency);\n }\n\n return date\n}\n\nfunction validateFrequency(frequency) {\n frequency = parseNumber(frequency);\n\n // Return error if frequency is neither 1, 2, or 4\n if ([1, 2, 4].indexOf(frequency) === -1) {\n return num\n }\n\n return frequency\n}\n\nfunction validateBasis(basis) {\n basis = parseNumber(basis);\n\n // Return error if basis is neither 0, 1, 2, 3, or 4\n if ([0, 1, 2, 3, 4].indexOf(basis) === -1) {\n return num\n }\n\n return basis\n}\n\n/**\n * Returns the accrued interest for a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} issue The security's issue date.\n * @param {*} first_interest The security's first interest date.\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} par The security's par value. If you omit par, ACCRINT uses $1,000.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @param {*} calc_method Optional. Not implemented in formulajs. A logical value that specifies the way to calculate the total accrued interest when the date of settlement is later than the date of first_interest. A value of TRUE (1) returns the total accrued interest from issue to settlement. A value of FALSE (0) returns the accrued interest from first_interest to settlement. If you do not enter the argument, it defaults to TRUE.\n * @returns\n */\nfunction ACCRINT(issue, first_interest, settlement, rate, par, frequency, basis) {\n // Return error if either date is invalid\n issue = ensureDate(issue);\n first_interest = ensureDate(first_interest);\n settlement = ensureDate(settlement);\n frequency = validateFrequency(frequency);\n basis = validateBasis(basis);\n\n if (anyError(frequency, basis)) {\n return num\n }\n\n if (!validDate(issue) || !validDate(first_interest) || !validDate(settlement)) {\n return value\n }\n\n // Return error if either rate or par are lower than or equal to zero\n if (rate <= 0 || par <= 0) {\n return num\n }\n\n // Return error if settlement is before or equal to issue\n if (settlement <= issue) {\n return num\n }\n\n // Set default values\n par = par || 0;\n basis = basis || 0;\n\n // Compute accrued interest\n return par * rate * YEARFRAC(issue, settlement, basis)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the accrued interest for a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} issue The security's issue date.\n * @param {*} settlement The security's maturity date.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} par The security's par value. If you omit par, ACCRINTM uses $1,000.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ACCRINTM() {\n throw new Error('ACCRINTM is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation for each accounting period by using a depreciation coefficient.\n *\n * Category: Financial\n *\n * @param {*} cost The cost of the asset.\n * @param {*} date_purchased The date of the purchase of the asset.\n * @param {*} first_period The date of the end of the first period.\n * @param {*} salvage The salvage value at the end of the life of the asset.\n * @param {*} period The period.\n * @param {*} rate The rate of depreciation.\n * @param {*} basis Optional. The year basis to be used.\n * @returns\n */\nfunction AMORDEGRC() {\n throw new Error('AMORDEGRC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation for each accounting period.\n *\n * Category: Financial\n *\n * @param {*} cost The cost of the asset.\n * @param {*} date_purchased The date of the purchase of the asset.\n * @param {*} first_period The date of the end of the first period.\n * @param {*} salvage The salvage value at the end of the life of the asset.\n * @param {*} period The period.\n * @param {*} rate The rate of depreciation.\n * @param {*} basis Optional. The year basis to be used.\n * @returns\n */\nfunction AMORLINC() {\n throw new Error('AMORLINC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of days from the beginning of the coupon period to the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYBS() {\n throw new Error('COUPDAYBS is not implemented')\n}\n\n/**\n *\n * Returns the number of days in the coupon period that contains the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYS(settlement, maturity, frequency, basis) {\n basis = validateBasis(basis);\n frequency = validateFrequency(frequency);\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n\n if (anyError(settlement, maturity)) {\n return value\n }\n\n if (anyError(frequency, basis) || settlement >= maturity) {\n return num\n }\n\n if (basis === 1) {\n let date = lastCoupDateBeforeSettlement(settlement, maturity, frequency);\n let nextDate = parseDate(date);\n\n // Set month of the nextDate to the next coupon month\n nextDate.setMonth(nextDate.getMonth() + 12 / frequency);\n\n return DATEDIF(date, nextDate, 'D')\n }\n\n let numOfDays;\n\n switch (basis) {\n case 0:\n case 2:\n case 4:\n numOfDays = 360;\n break\n case 3:\n numOfDays = 365;\n break\n default:\n return num\n }\n\n return numOfDays / frequency\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of days from the settlement date to the next coupon date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYSNC() {\n throw new Error('COUPDAYSNC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the next coupon date after the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPNCD() {\n throw new Error('COUPNCD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of coupons payable between the settlement date and maturity date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPNUM() {\n throw new Error('COUPNUM is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the previous coupon date before the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPPCD() {\n throw new Error('COUPPCD is not implemented')\n}\n\n/**\n * Returns the cumulative interest paid between two periods.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate.\n * @param {*} nper The total number of payment periods.\n * @param {*} pv The present value.\n * @param {*} start_period The first period in the calculation. Payment periods are numbered beginning with 1.\n * @param {*} end_period The last period in the calculation.\n * @param {*} type The timing of the payment.\n * @returns\n */\nfunction CUMIPMT(rate, nper, pv, start_period, end_period, type) {\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, nper, pv)) {\n return value\n }\n\n if (rate <= 0 || nper <= 0 || pv <= 0) {\n return num\n }\n\n if (start_period < 1 || end_period < 1 || start_period > end_period) {\n return num\n }\n\n if (type !== 0 && type !== 1) {\n return num\n }\n\n const payment = PMT(rate, nper, pv, 0, type);\n let interest = 0;\n\n if (start_period === 1) {\n if (type === 0) {\n interest = -pv;\n }\n\n start_period++;\n }\n\n for (let i = start_period; i <= end_period; i++) {\n interest += type === 1 ? FV(rate, i - 2, payment, pv, 1) - payment : FV(rate, i - 1, payment, pv, 0);\n }\n\n interest *= rate;\n\n return interest\n}\n\n/**\n * Returns the cumulative principal paid on a loan between two periods.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate.\n * @param {*} nper The total number of payment periods.\n * @param {*} pv The present value.\n * @param {*} start_period The first period in the calculation. Payment periods are numbered beginning with 1.\n * @param {*} end_period The last period in the calculation.\n * @param {*} type The timing of the payment.\n * @returns\n */\nfunction CUMPRINC(rate, nper, pv, start_period, end, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, nper, pv)) {\n return value\n }\n\n // Return error if either rate, nper, or value are lower than or equal to zero\n if (rate <= 0 || nper <= 0 || pv <= 0) {\n return num\n }\n\n // Return error if start < 1, end < 1, or start > end\n if (start_period < 1 || end < 1 || start_period > end) {\n return num\n }\n\n // Return error if type is neither 0 nor 1\n if (type !== 0 && type !== 1) {\n return num\n }\n\n // Compute cumulative principal\n const payment = PMT(rate, nper, pv, 0, type);\n let principal = 0;\n\n if (start_period === 1) {\n principal = type === 0 ? payment + pv * rate : payment;\n\n start_period++;\n }\n\n for (let i = start_period; i <= end; i++) {\n principal +=\n type > 0\n ? payment - (FV(rate, i - 2, payment, pv, 1) - payment) * rate\n : payment - FV(rate, i - 1, payment, pv, 0) * rate;\n }\n\n // Return cumulative principal\n return principal\n}\n\n/**\n * Returns the depreciation of an asset for a specified period by using the fixed-declining balance method.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).\n * @param {*} period The period for which you want to calculate the depreciation. Period must use the same units as life.\n * @param {*} month Optional. The number of months in the first year. If month is omitted, it is assumed to be 12.\n * @returns\n */\nfunction DB(cost, salvage, life, period, month) {\n // Initialize month\n month = month === undefined ? 12 : month;\n\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n period = parseNumber(period);\n month = parseNumber(month);\n\n if (anyIsError(cost, salvage, life, period, month)) {\n return value\n }\n\n // Return error if any of the parameters is negative\n if (cost < 0 || salvage < 0 || life < 0 || period < 0) {\n return num\n }\n\n // Return error if month is not an integer between 1 and 12\n if ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].indexOf(month) === -1) {\n return num\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return num\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0\n }\n\n // Rate is rounded to three decimals places\n const rate = (1 - Math.pow(salvage / cost, 1 / life)).toFixed(3);\n\n // Compute initial depreciation\n const initial = (cost * rate * month) / 12;\n\n // Compute total depreciation\n let total = initial;\n let current = 0;\n const ceiling = period === life ? life - 1 : period;\n\n for (let i = 2; i <= ceiling; i++) {\n current = (cost - total) * rate;\n total += current;\n }\n\n // Depreciation for the first and last periods are special cases\n if (period === 1) {\n // First period\n return initial\n } else if (period === life) {\n // Last period\n\n return (cost - total) * rate\n } else {\n return current\n }\n}\n\n/**\n * Returns the depreciation of an asset for a specified period by using the double-declining balance method or some other method that you specify.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset). This value can be 0.\n * @param {*} life The number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).\n * @param {*} period The period for which you want to calculate the depreciation. Period must use the same units as life.\n * @param {*} factor Optional. The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method).\n * @returns\n */\nfunction DDB(cost, salvage, life, period, factor) {\n // Initialize factor\n factor = factor === undefined ? 2 : factor;\n\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n period = parseNumber(period);\n factor = parseNumber(factor);\n\n if (anyIsError(cost, salvage, life, period, factor)) {\n return value\n }\n\n // Return error if any of the parameters is negative or if factor is null\n if (cost < 0 || salvage < 0 || life < 0 || period < 0 || factor <= 0) {\n return num\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return num\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0\n }\n\n // Compute depreciation\n let total = 0;\n let current = 0;\n\n for (let i = 1; i <= period; i++) {\n current = Math.min((cost - total) * (factor / life), cost - salvage - total);\n total += current;\n }\n\n // Return depreciation\n return current\n}\n\n/**\n * Returns the discount rate for a security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction DISC(settlement, maturity, pr, redemption, basis) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n pr = parseNumber(pr);\n redemption = parseNumber(redemption);\n basis = parseNumber(basis);\n\n basis = basis || 0;\n\n if (anyIsError(settlement, maturity, pr, redemption, basis)) {\n return value\n }\n\n if (pr <= 0 || redemption <= 0) {\n return num\n }\n\n if (settlement >= maturity) {\n return value\n }\n\n let basisVal, diff;\n switch (basis) {\n case 0:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, false);\n break\n case 1:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 2:\n basisVal = 360;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 3:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 4:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, true);\n break\n default:\n return num\n }\n\n return (((redemption - pr) / redemption) * basisVal) / diff\n}\n\n/**\n * Converts a dollar price, expressed as a fraction, into a dollar price, expressed as a decimal number.\n *\n * Category: Financial\n *\n * @param {*} fractional_dollar A number expressed as an integer part and a fraction part, separated by a decimal symbol.\n * @param {*} fraction The integer to use in the denominator of the fraction.\n * @returns\n */\nfunction DOLLARDE(fractional_dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n fractional_dollar = parseNumber(fractional_dollar);\n fraction = parseNumber(fraction);\n\n if (anyIsError(fractional_dollar, fraction)) {\n return value\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return num\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return div0\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n let result = parseInt(fractional_dollar, 10);\n\n // Add decimal part\n result += ((fractional_dollar % 1) * Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN10))) / fraction;\n\n // Round result\n const power = Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN2) + 1);\n result = Math.round(result * power) / power;\n\n // Return converted dollar price\n return result\n}\n\n/**\n * Converts a dollar price, expressed as a decimal number, into a dollar price, expressed as a fraction.\n *\n * Category: Financial\n *\n * @param {*} decimal_dollar A decimal number.\n * @param {*} fraction The integer to use in the denominator of a fraction.\n * @returns\n */\nfunction DOLLARFR(decimal_dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n decimal_dollar = parseNumber(decimal_dollar);\n fraction = parseNumber(fraction);\n\n if (anyIsError(decimal_dollar, fraction)) {\n return value\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return num\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return div0\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n let result = parseInt(decimal_dollar, 10);\n\n // Add decimal part\n result += (decimal_dollar % 1) * Math.pow(10, -Math.ceil(Math.log(fraction) / Math.LN10)) * fraction;\n\n // Return converted dollar price\n return result\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual duration of a security with periodic interest payments.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} coupon The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction DURATION() {\n throw new Error('DURATION is not implemented')\n}\n\n/**\n * Returns the effective annual interest rate.\n *\n * Category: Financial\n *\n * @param {*} nominal_rate The nominal interest rate.\n * @param {*} npery The number of compounding periods per year.\n * @returns\n */\nfunction EFFECT(nominal_rate, npery) {\n nominal_rate = parseNumber(nominal_rate);\n npery = parseNumber(npery);\n\n if (anyIsError(nominal_rate, npery)) {\n return value\n }\n\n // Return error if rate <=0 or periods < 1\n if (nominal_rate <= 0 || npery < 1) {\n return num\n }\n\n // Truncate periods if it is not an integer\n npery = parseInt(npery, 10);\n\n // Return effective annual interest rate\n return Math.pow(1 + nominal_rate / npery, npery) - 1\n}\n\n/**\n * Returns the future value of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pmt The payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes. If pmt is omitted, you must include the pv argument.\n * @param {*} pv Optional. The present value, or the lump-sum amount that a series of future payments is worth right now. If pv is omitted, it is assumed to be 0 (zero), and you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.\n * @returns\n */\nfunction FV(rate, nper, payment, value$1, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n value$1 = value$1 || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n payment = parseNumber(payment);\n value$1 = parseNumber(value$1);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, payment, value$1, type)) {\n return value\n }\n\n // Return future value\n let result;\n\n if (rate === 0) {\n result = value$1 + payment * nper;\n } else {\n const term = Math.pow(1 + rate, nper);\n\n result =\n type === 1\n ? value$1 * term + (payment * (1 + rate) * (term - 1)) / rate\n : value$1 * term + (payment * (term - 1)) / rate;\n }\n\n return -result\n}\n\n/**\n * Returns the future value of an initial principal after applying a series of compound interest rates.\n *\n * Category: Financial\n *\n * @param {*} principal The present value.\n * @param {*} schedule An array of interest rates to apply.\n * @returns\n */\nfunction FVSCHEDULE(principal, schedule) {\n principal = parseNumber(principal);\n schedule = parseNumberArray(flatten(schedule));\n\n if (anyIsError(principal, schedule)) {\n return value\n }\n\n const n = schedule.length;\n let future = principal;\n\n // Apply all interests in schedule\n\n for (let i = 0; i < n; i++) {\n // Apply scheduled interest\n future *= 1 + schedule[i];\n }\n\n // Return future value\n return future\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the interest rate for a fully invested security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} investment The amount invested in the security.\n * @param {*} redemption The amount to be received at maturity.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction INTRATE() {\n throw new Error('INTRATE is not implemented')\n}\n\n/**\n * Returns the interest payment for an investment for a given period.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} per The period for which you want to find the interest and must be in the range 1 to nper.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pv The present value, or the lump-sum amount that a series of future payments is worth right now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.\n * @returns\n */\nfunction IPMT(rate, per, nper, pv, fv, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n per = parseNumber(per);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, per, nper, pv, fv, type)) {\n return value\n }\n\n // Compute payment\n const payment = PMT(rate, nper, pv, fv, type);\n\n // Compute interest\n let interest =\n per === 1\n ? type === 1\n ? 0\n : -pv\n : type === 1\n ? FV(rate, per - 2, payment, pv, 1) - payment\n : FV(rate, per - 1, payment, pv, 0);\n\n // Return interest\n return interest * rate\n}\n\n/**\n * Returns the internal rate of return for a series of cash flows.\n *\n * Category: Financial\n *\n * @param {*} values An array or a reference to values that contain numbers for which you want to calculate the internal rate of return.\n - Values must contain at least one positive value and one negative value to calculate the internal rate of return.\n - IRR uses the order of values to interpret the order of cash flows. Be sure to enter your payment and income values in the sequence you want.\n - If an array or reference argument contains text, logical values, or empty values, those values are ignored.\n * @param {*} guess Optional. A number that you guess is close to the result of IRR.\n - Microsoft Excel uses an iterative technique for calculating IRR. Starting with guess, IRR cycles through the calculation until the result is accurate within 0.00001 percent. If IRR can't find a result that works after 20 tries, the #NUM! error value is returned.\n - In most cases you do not need to provide guess for the IRR calculation. If guess is omitted, it is assumed to be 0.1 (10 percent).\n - If IRR gives the #NUM! error value, or if the result is not close to what you expected, try again with a different value for guess.\n * @returns\n */\nfunction IRR(values, guess) {\n // Credits: algorithm inspired by Apache OpenOffice\n guess = guess || 0;\n\n values = parseNumberArray(flatten(values));\n guess = parseNumber(guess);\n\n if (anyIsError(values, guess)) {\n return value\n }\n\n // Calculates the resulting amount\n const irrResult = (values, dates, rate) => {\n const r = rate + 1;\n let result = values[0];\n\n for (let i = 1; i < values.length; i++) {\n result += values[i] / Math.pow(r, (dates[i] - dates[0]) / 365);\n }\n\n return result\n };\n\n // Calculates the first derivation\n const irrResultDeriv = (values, dates, rate) => {\n const r = rate + 1;\n let result = 0;\n\n for (let i = 1; i < values.length; i++) {\n const frac = (dates[i] - dates[0]) / 365;\n result -= (frac * values[i]) / Math.pow(r, frac + 1);\n }\n\n return result\n };\n\n // Initialize dates and check that values contains at least one positive value and one negative value\n const dates = [];\n let positive = false;\n let negative = false;\n\n for (let i = 0; i < values.length; i++) {\n dates[i] = i === 0 ? 0 : dates[i - 1] + 365;\n\n if (values[i] > 0) {\n positive = true;\n }\n\n if (values[i] < 0) {\n negative = true;\n }\n }\n\n // Return error if values does not contain at least one positive value and one negative value\n if (!positive || !negative) {\n return num\n }\n\n // Initialize guess and resultRate\n guess = guess === undefined ? 0.1 : guess;\n let resultRate = guess;\n\n // Set maximum epsilon for end of iteration\n const epsMax = 1e-10;\n\n // Implement Newton's method\n let newRate, epsRate, resultValue;\n let contLoop = true;\n do {\n resultValue = irrResult(values, dates, resultRate);\n newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n epsRate = Math.abs(newRate - resultRate);\n resultRate = newRate;\n contLoop = epsRate > epsMax && Math.abs(resultValue) > epsMax;\n } while (contLoop)\n\n // Return internal rate of return\n return resultRate\n}\n\n/**\n * Calculates the interest paid during a specific period of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate for the investment.\n * @param {*} per The period for which you want to find the interest, and must be between 1 and Nper.\n * @param {*} nper The total number of payment periods for the investment.\n * @param {*} pv The present value of the investment. For a loan, Pv is the loan amount.\n *\n * @returns\n */\nfunction ISPMT(rate, per, nper, pv) {\n rate = parseNumber(rate);\n per = parseNumber(per);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, per, nper, pv)) {\n return value\n }\n\n // Return interest\n return pv * rate * (per / nper - 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the Macauley modified duration for a security with an assumed par value of $100.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} coupon The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction MDURATION() {\n throw new Error('MDURATION is not implemented')\n}\n\n/**\n * Returns the internal rate of return where positive and negative cash flows are financed at different rates.\n *\n * Category: Financial\n *\n * @param {*} values An array or a reference to values that contain numbers. These numbers represent a series of payments (negative values) and income (positive values) occurring at regular periods.\n - Values must contain at least one positive value and one negative value to calculate the modified internal rate of return. Otherwise, MIRR returns the #DIV/0! error value.\n - If an array or reference argument contains text, logical values, or empty values, those values are ignored; however, values with the value zero are included.\n * @param {*} finance_rate The interest rate you pay on the money used in the cash flows.\n * @param {*} reinvest_rate The interest rate you receive on the cash flows as you reinvest them.\n * @returns\n */\nfunction MIRR(values, finance_rate, reinvest_rate) {\n values = parseNumberArray(flatten(values));\n finance_rate = parseNumber(finance_rate);\n reinvest_rate = parseNumber(reinvest_rate);\n\n if (anyIsError(values, finance_rate, reinvest_rate)) {\n return value\n }\n\n // Initialize number of values\n const n = values.length;\n\n // Lookup payments (negative values) and incomes (positive values)\n const payments = [];\n const incomes = [];\n\n for (let i = 0; i < n; i++) {\n if (values[i] < 0) {\n payments.push(values[i]);\n } else {\n incomes.push(values[i]);\n }\n }\n\n // Return modified internal rate of return\n const num = -NPV(reinvest_rate, incomes) * Math.pow(1 + reinvest_rate, n - 1);\n const den = NPV(finance_rate, payments) * (1 + finance_rate);\n\n return Math.pow(num / den, 1 / (n - 1)) - 1\n}\n\n/**\n * Returns the annual nominal interest rate.\n *\n * Category: Financial\n *\n * @param {*} effect_rate The effective interest rate.\n * @param {*} npery The number of compounding periods per year.\n * @returns\n */\nfunction NOMINAL(effect_rate, npery) {\n effect_rate = parseNumber(effect_rate);\n npery = parseNumber(npery);\n\n if (anyIsError(effect_rate, npery)) {\n return value\n }\n\n // Return error if rate <=0 or periods < 1\n if (effect_rate <= 0 || npery < 1) {\n return num\n }\n\n // Truncate periods if it is not an integer\n npery = parseInt(npery, 10);\n\n // Return nominal annual interest rate\n return (Math.pow(effect_rate + 1, 1 / npery) - 1) * npery\n}\n\n/**\n * Returns the number of periods for an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} pmt The payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes.\n * @param {*} pv The present value, or the lump-sum amount that a series of future payments is worth right now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction NPER(rate, pmt, pv, fv, type) {\n type = type === undefined ? 0 : type;\n fv = fv === undefined ? 0 : fv;\n\n rate = parseNumber(rate);\n pmt = parseNumber(pmt);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, pmt, pv, fv, type)) {\n return value\n }\n\n if (rate === 0) {\n return -(pv + fv) / pmt\n } else {\n const num = pmt * (1 + rate * type) - fv * rate;\n const den = pv * rate + pmt * (1 + rate * type);\n\n return Math.log(num / den) / Math.log(1 + rate)\n }\n}\n\n/**\n * Returns the net present value of an investment based on a series of periodic cash flows and a discount rate.\n *\n * Category: Financial\n *\n * @param {*} rate The rate of discount over the length of one period.\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 254 arguments representing the payments and income.\n - value1, value2, ... must be equally spaced in time and occur at the end of each period.\n - NPV uses the order of value1, value2, ... to interpret the order of cash flows. Be sure to enter your payment and income values in the correct sequence.\n - Arguments that are empty values, logical values, or text representations of numbers, error values, or text that cannot be translated into numbers are ignored.\n - If an argument is an array or reference, only numbers in that array or reference are counted. Empty values, logical values, text, or error values in the array or reference are ignored.\n * @returns\n */\nfunction NPV() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n // Lookup rate\n const rate = args[0];\n\n // Initialize net present value\n let value = 0;\n\n // Loop on all values\n for (let j = 1; j < args.length; j++) {\n value += args[j] / Math.pow(1 + rate, j);\n }\n\n // Return net present value\n return value\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security with an odd first period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date.\n * @param {*} first_coupon The security's first coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDFPRICE() {\n throw new Error('ODDFPRICE is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield of a security with an odd first period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date.\n * @param {*} first_coupon The security's first coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} pr The security's price.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDFYIELD() {\n throw new Error('ODDFYIELD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security with an odd last period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} last_interest The security's last coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDLPRICE() {\n throw new Error('ODDLPRICE is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield of a security with an odd last period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} last_interest The security's last coupon date.\n * @param {*} rate The security's interest rate\n * @param {*} pr The security's price.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDLYIELD() {\n throw new Error('ODDLYIELD is not implemented')\n}\n\n/**\n * Returns the number of periods required by an investment to reach a specified value.\n *\n * Category: Financial\n *\n * @param {*} rate Rate is the interest rate per period.\n * @param {*} pv Pv is the present value of the investment.\n * @param {*} fv Fv is the desired future value of the investment.\n * @returns\n */\nfunction PDURATION(rate, pv, fv) {\n rate = parseNumber(rate);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n\n if (anyIsError(rate, pv, fv)) {\n return value\n }\n\n // Return error if rate <=0\n if (rate <= 0) {\n return num\n }\n\n // Return number of periods\n return (Math.log(fv) - Math.log(pv)) / Math.log(1 + rate)\n}\n\n/**\n * Returns the periodic payment for an annuity.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate for the loan.\n * @param {*} nper The total number of payments for the loan.\n * @param {*} pv The present value, or the total amount that a series of future payments is worth now; also known as the principal.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.\n * @param {*} type Optional. The number 0 (zero) or 1 and indicates when payments are due.\n * @returns\n */\nfunction PMT(rate, nper, pv, fv, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, pv, fv, type)) {\n return value\n }\n\n // Return payment\n let result;\n\n if (rate === 0) {\n result = (pv + fv) / nper;\n } else {\n const term = Math.pow(1 + rate, nper);\n\n result =\n type === 1\n ? ((fv * rate) / (term - 1) + (pv * rate) / (1 - 1 / term)) / (1 + rate)\n : (fv * rate) / (term - 1) + (pv * rate) / (1 - 1 / term);\n }\n\n return -result\n}\n\n/**\n * Returns the payment on the principal for an investment for a given period.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} per Specifies the period and must be in the range 1 to nper.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pv The present value \u2014 the total amount that a series of future payments is worth now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction PPMT(rate, per, nper, pv, fv, type) {\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, pv, fv, type)) {\n return value\n }\n\n return PMT(rate, nper, pv, fv, type) - IPMT(rate, per, nper, pv, fv, type)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICE() {\n throw new Error('PRICE is not implemented')\n}\n\n/**\n * Returns the price per $100 face value of a discounted security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} discount The security's discount rate.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICEDISC(settlement, maturity, discount, redemption, basis) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n redemption = parseNumber(redemption);\n basis = parseNumber(basis);\n\n basis = basis || 0;\n\n if (anyIsError(settlement, maturity, discount, redemption, basis)) {\n return value\n }\n\n if (discount <= 0 || redemption <= 0) {\n return num\n }\n\n if (settlement >= maturity) {\n return value\n }\n\n let basisVal, diff;\n switch (basis) {\n case 0:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, false);\n break\n case 1:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 2:\n basisVal = 360;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 3:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 4:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, true);\n break\n default:\n return num\n }\n\n return redemption - (discount * redemption * diff) / basisVal\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date, expressed as a serial date number.\n * @param {*} rate The security's interest rate at date of issue.\n * @param {*} yld The security's annual yield.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICEMAT() {\n throw new Error('PRICEMAT is not implemented')\n}\n\n/**\n * Returns the present value of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period. For example, if you obtain an automobile loan at a 10 percent annual interest rate and make monthly payments, your interest rate per month is 10%/12, or 0.83%. You would enter 10%/12, or 0.83%, or 0.0083, into the formula as the rate.\n * @param {*} nper The total number of payment periods in an annuity. For example, if you get a four-year car loan and make monthly payments, your loan has 4*12 (or 48) periods. You would enter 48 into the formula for nper.\n * @param {*} pmt The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. For example, the monthly payments on a $10,000, four-year car loan at 12 percent are $263.33. You would enter -263.33 into the formula as the pmt. If pmt is omitted, you must include the fv argument.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). For example, if you want to save $50,000 to pay for a special project in 18 years, then $50,000 is the future value. You could then make a conservative guess at an interest rate and determine how much you must save each month. If fv is omitted, you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction PV(rate, per, pmt, fv, type) {\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n per = parseNumber(per);\n pmt = parseNumber(pmt);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, per, pmt, fv, type)) {\n return value\n }\n\n // Return present value\n return rate === 0\n ? -pmt * per - fv\n : (((1 - Math.pow(1 + rate, per)) / rate) * pmt * (1 + rate * type) - fv) / Math.pow(1 + rate, per)\n}\n\n/**\n * Returns the interest rate per period of an annuity.\n *\n * Category: Financial\n *\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pmt The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. If pmt is omitted, you must include the fv argument.\n * @param {*} pv The present value \u2014 the total amount that a series of future payments is worth now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). If fv is omitted, you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @param {*} guess Optional. Your guess for what the rate will be. If you omit guess, it is assumed to be 10 percent. If RATE does not converge, try different values for guess. RATE usually converges if guess is between 0 and 1.\n - If you omit guess, it is assumed to be 10 percent.\n - If RATE does not converge, try different values for guess. RATE usually converges if guess is between 0 and 1.\n * @returns\n */\nfunction RATE(nper, pmt, pv, fv, type, guess) {\n guess = guess === undefined ? 0.01 : guess;\n fv = fv === undefined ? 0 : fv;\n type = type === undefined ? 0 : type;\n\n nper = parseNumber(nper);\n pmt = parseNumber(pmt);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n guess = parseNumber(guess);\n\n if (anyIsError(nper, pmt, pv, fv, type, guess)) {\n return value\n }\n\n const epsMax = 1e-10;\n const iterMax = 20;\n let rate = guess;\n\n type = type ? 1 : 0;\n\n for (let i = 0; i < iterMax; i++) {\n if (rate <= -1) {\n return num\n }\n\n let y, f;\n\n if (Math.abs(rate) < epsMax) {\n y = pv * (1 + nper * rate) + pmt * (1 + rate * type) * nper + fv;\n } else {\n f = Math.pow(1 + rate, nper);\n y = pv * f + pmt * (1 / rate + type) * (f - 1) + fv;\n }\n\n if (Math.abs(y) < epsMax) {\n return rate\n }\n\n let dy;\n\n if (Math.abs(rate) < epsMax) {\n dy = pv * nper + pmt * type * nper;\n } else {\n f = Math.pow(1 + rate, nper);\n const df = nper * Math.pow(1 + rate, nper - 1);\n dy = pv * df + pmt * (1 / rate + type) * df + pmt * (-1 / (rate * rate)) * (f - 1);\n }\n\n rate -= y / dy;\n }\n\n return rate\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the amount received at maturity for a fully invested security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} investment The amount invested in the security.\n * @param {*} discount The security's discount rate.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction RECEIVED() {\n throw new Error('RECEIVED is not implemented')\n}\n\n/**\n * Returns an equivalent interest rate for the growth of an investment.\n *\n * Category: Financial\n *\n * @param {*} nper Nper is the number of periods for the investment.\n * @param {*} pv Pv is the present value of the investment.\n * @param {*} fv Fv is the future value of the investment.\n * @returns\n */\nfunction RRI(nper, pv, fv) {\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n\n if (anyIsError(nper, pv, fv)) {\n return value\n }\n\n // Return error if nper or present is equal to 0 (zero)\n if (nper === 0 || pv === 0) {\n return num\n }\n\n // Return equivalent interest rate\n return Math.pow(fv / pv, 1 / nper) - 1\n}\n\n/**\n * Returns the straight-line depreciation of an asset for one period.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @returns\n */\nfunction SLN(cost, salvage, life) {\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n\n if (anyIsError(cost, salvage, life)) {\n return value\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return num\n }\n\n // Return straight-line depreciation\n return (cost - salvage) / life\n}\n\n/**\n * Returns the sum-of-years' digits depreciation of an asset for a specified period.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @param {*} per The period and must use the same units as life.\n * @returns\n */\nfunction SYD(cost, salvage, life, per) {\n // Return error if any of the parameters is not a number\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n per = parseNumber(per);\n\n if (anyIsError(cost, salvage, life, per)) {\n return value\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return num\n }\n\n // Return error if period is lower than 1 or greater than life\n if (per < 1 || per > life) {\n return num\n }\n\n // Truncate period if it is not an integer\n per = parseInt(per, 10);\n\n // Return straight-line depreciation\n return ((cost - salvage) * (life - per + 1) * 2) / (life * (life + 1))\n}\n\n/**\n * Returns the bond-equivalent yield for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} discount The Treasury bill's discount rate.\n * @returns\n */\nfunction TBILLEQ(settlement, maturity, discount) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n\n if (anyIsError(settlement, maturity, discount)) {\n return value\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return (365 * discount) / (360 - discount * DAYS360(settlement, maturity, false))\n}\n\n/**\n * Returns the price per $100 face value for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} discount The Treasury bill's discount rate.\n * @returns\n */\nfunction TBILLPRICE(settlement, maturity, discount) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n\n if (anyIsError(settlement, maturity, discount)) {\n return value\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return 100 * (1 - (discount * DAYS360(settlement, maturity, false)) / 360)\n}\n\n/**\n * Returns the yield for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} pr The Treasury bill's price per $100 face value.\n * @returns\n */\nfunction TBILLYIELD(settlement, maturity, pr) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n pr = parseNumber(pr);\n\n if (anyIsError(settlement, maturity, pr)) {\n return value\n }\n\n // Return error if price is lower than or equal to zero\n if (pr <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return ((100 - pr) * 360) / (pr * DAYS360(settlement, maturity, false))\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation of an asset for a specified or partial period by using a declining balance method.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset). This value can be 0.\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @param {*} start_period The starting period for which you want to calculate the depreciation. Start_period must use the same units as life.\n * @param {*} end_period The ending period for which you want to calculate the depreciation. End_period must use the same units as life.\n * @param {*} factor Optional. The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method). Change factor if you do not want to use the double-declining balance method. For a description of the double-declining balance method, see DDB.\n * @param {*} no_switch Optional. A logical value specifying whether to switch to straight-line depreciation when depreciation is greater than the declining balance calculation.\n - If no_switch is TRUE, Microsoft Excel does not switch to straight-line depreciation even when the depreciation is greater than the declining balance calculation.\n - If no_switch is FALSE or omitted, Excel switches to straight-line depreciation when depreciation is greater than the declining balance calculation.\n * @returns\n */\nfunction VDB() {\n throw new Error('VDB is not implemented')\n}\n\n/**\n * Returns the internal rate of return for a schedule of cash flows that is not necessarily periodic.\n *\n * Category: Financial\n *\n * @param {*} values A series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive and one negative value.\n * @param {*} dates A schedule of payment dates that corresponds to the cash flow payments. Dates may occur in any order. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text. .\n * @param {*} guess Optional. A number that you guess is close to the result of XIRR.\n * @returns\n */\nfunction XIRR(values, dates, guess) {\n // Credits: algorithm inspired by Apache OpenOffice\n values = parseNumberArray(flatten(values));\n dates = parseDateArray(flatten(dates));\n guess = parseNumber(guess);\n\n if (anyIsError(values, dates, guess)) {\n return value\n }\n\n // Calculates the resulting amount\n const irrResult = (values, dates, rate) => {\n const r = rate + 1;\n let result = values[0];\n\n for (let i = 1; i < values.length; i++) {\n result += values[i] / Math.pow(r, DAYS(dates[i], dates[0]) / 365);\n }\n\n return result\n };\n\n // Calculates the first derivation\n const irrResultDeriv = (values, dates, rate) => {\n const r = rate + 1;\n let result = 0;\n\n for (let i = 1; i < values.length; i++) {\n const frac = DAYS(dates[i], dates[0]) / 365;\n result -= (frac * values[i]) / Math.pow(r, frac + 1);\n }\n\n return result\n };\n\n // Check that values contains at least one positive value and one negative value\n let positive = false;\n let negative = false;\n\n for (let i = 0; i < values.length; i++) {\n if (values[i] > 0) {\n positive = true;\n }\n\n if (values[i] < 0) {\n negative = true;\n }\n }\n\n // Return error if values does not contain at least one positive value and one negative value\n if (!positive || !negative) {\n return num\n }\n\n // Initialize guess and resultRate\n guess = guess || 0.1;\n let resultRate = guess;\n\n // Set maximum epsilon for end of iteration\n const epsMax = 1e-10;\n\n // Implement Newton's method\n let newRate, epsRate, resultValue;\n let contLoop = true;\n\n do {\n resultValue = irrResult(values, dates, resultRate);\n newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n epsRate = Math.abs(newRate - resultRate);\n resultRate = newRate;\n contLoop = epsRate > epsMax && Math.abs(resultValue) > epsMax;\n } while (contLoop)\n\n // Return internal rate of return\n return resultRate\n}\n\n/**\n * Returns the net present value for a schedule of cash flows that is not necessarily periodic.\n *\n * Category: Financial\n *\n * @param {*} rate The discount rate to apply to the cash flows.\n * @param {*} values A series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive value and one negative value.\n * @param {*} dates A schedule of payment dates that corresponds to the cash flow payments. The first payment date indicates the beginning of the schedule of payments. All other dates must be later than this date, but they may occur in any order.\n * @returns\n */\nfunction XNPV(rate, values, dates) {\n rate = parseNumber(rate);\n values = parseNumberArray(flatten(values));\n dates = parseDateArray(flatten(dates));\n\n if (anyIsError(rate, values, dates)) {\n return value\n }\n\n let result = 0;\n\n for (let i = 0; i < values.length; i++) {\n result += values[i] / Math.pow(1 + rate, DAYS(dates[i], dates[0]) / 365);\n }\n\n return result\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield on a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELD() {\n throw new Error('YIELD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual yield for a discounted security; for example, a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELDDISC() {\n throw new Error('YIELDDISC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual yield of a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date, expressed as a serial date number.\n * @param {*} rate The security's interest rate at date of issue.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELDMAT() {\n throw new Error('YIELDMAT is not implemented')\n}\n\n/**\n * Returns TRUE if all of its arguments are TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction AND() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = true;\n }\n\n if (!args[i]) {\n result = false;\n }\n }\n\n return result\n}\n\n/**\n * Returns the logical value FALSE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction FALSE() {\n return false\n}\n\n/**\n * Specifies a logical test to perform.\n *\n * Category: Logical\n *\n * @param {*} logical_test\n * @param {*} value_if_true\n * @param {*} value_if_false\n *\n * @returns\n */\nfunction IF(logical_test, value_if_true, value_if_false) {\n if (logical_test instanceof Error) {\n return logical_test\n }\n\n value_if_true = arguments.length >= 2 ? value_if_true : true;\n\n if (value_if_true === undefined || value_if_true === null) {\n value_if_true = 0;\n }\n\n value_if_false = arguments.length === 3 ? value_if_false : false;\n\n if (value_if_false === undefined || value_if_false === null) {\n value_if_false = 0;\n }\n\n return logical_test ? value_if_true : value_if_false\n}\n\n/**\n * Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction IFS() {\n for (let i = 0; i < arguments.length / 2; i++) {\n if (arguments[i * 2]) {\n return arguments[i * 2 + 1]\n }\n }\n\n return na\n}\n\n/**\n * Returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula.\n *\n * Category: Logical\n *\n * @param {*} value The argument that is checked for an error.\n * @param {*} value_if_error The value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.\n * @returns\n */\nfunction IFERROR(value, value_if_error) {\n if (ISERROR(value)) {\n return value_if_error\n }\n\n return value\n}\n\n/**\n * Returns the value you specify if the expression resolves to #N/A, otherwise returns the result of the expression.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction IFNA(value, value_if_na) {\n return value === na ? value_if_na : value\n}\n\n/**\n * Reverses the logic of its argument.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction NOT(logical) {\n if (typeof logical === 'string') {\n return value\n }\n\n if (logical instanceof Error) {\n return logical\n }\n\n return !logical\n}\n\n/**\n * Returns TRUE if any argument is TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction OR() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = false;\n }\n\n if (args[i]) {\n result = true;\n }\n }\n\n return result\n}\n\n/**\n * Returns the logical value TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction TRUE() {\n return true\n}\n\n/**\n * Returns a logical exclusive OR of all arguments.\n *\n * Category: Logical\n *\n * @param {*} args logical1, logical2,\u2026 Logical 1 is required, subsequent logical values are optional. 1 to 254 conditions you want to test that can be either TRUE or FALSE, and can be logical values, arrays, or references.\n * @returns\n */\nfunction XOR() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = 0;\n }\n\n if (args[i]) {\n result++;\n }\n }\n\n if (result === value) {\n return result\n }\n\n return !!(Math.floor(Math.abs(result)) & 1)\n}\n\n/**\n * Evaluates an expression against a list of values and returns the result corresponding to the first matching value. If there is no match, an optional default value may be returned.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction SWITCH() {\n let result;\n\n if (arguments.length > 0) {\n const targetValue = arguments[0];\n const argc = arguments.length - 1;\n const switchCount = Math.floor(argc / 2);\n let switchSatisfied = false;\n const hasDefaultClause = argc % 2 !== 0;\n const defaultClause = argc % 2 === 0 ? null : arguments[arguments.length - 1];\n\n if (switchCount) {\n for (let index = 0; index < switchCount; index++) {\n if (targetValue === arguments[index * 2 + 1]) {\n result = arguments[index * 2 + 2];\n switchSatisfied = true;\n break\n }\n }\n }\n\n if (!switchSatisfied) {\n result = hasDefaultClause ? defaultClause : na;\n }\n } else {\n result = value;\n }\n\n return result\n}\n\nconst utils = { errors, symbols };\n\nexport { ABS, ACCRINT, ACCRINTM, ACOS, ACOSH, ACOT, ACOTH, AGGREGATE, AMORDEGRC, AMORLINC, AND, ARABIC, ASC, ASIN, ASINH, ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, AVERAGEIFS, BAHTTEXT, BASE, BESSELI, BESSELJ, BESSELK, BESSELY, BETA, BETADIST, BETAINV, BIN2DEC, BIN2HEX, BIN2OCT, BINOM, BINOMDIST, BITAND, BITLSHIFT, BITOR, BITRSHIFT, BITXOR, CEILING, CEILINGMATH, CEILINGPRECISE, CELL, CHAR, CHIDIST, CHIDISTRT, CHIINV, CHIINVRT, CHISQ, CHITEST, CHOOSE, CLEAN, CODE, COLUMN, COLUMNS, COMBIN, COMBINA, COMPLEX, CONCAT, CONCATENATE, CONFIDENCE, CONVERT, CORREL, COS, COSH, COT, COTH, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, COUPDAYBS, COUPDAYS, COUPDAYSNC, COUPNCD, COUPNUM, COUPPCD, COVAR, COVARIANCE, COVARIANCEP, COVARIANCES, CRITBINOM, CSC, CSCH, CUMIPMT, CUMPRINC, DATE, DATEDIF, DATEVALUE, DAVERAGE, DAY, DAYS, DAYS360, DB, DBCS, DCOUNT, DCOUNTA, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DECIMAL, DEGREES, DELTA, DEVSQ, DGET, DISC, DMAX, DMIN, DOLLAR, DOLLARDE, DOLLARFR, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DURATION, DVAR, DVARP, EDATE, EFFECT, EOMONTH, ERF, ERFC, ERFCPRECISE, ERFPRECISE, ERROR, EVEN, EXACT, EXP, EXPON, EXPONDIST, F, FACT, FACTDOUBLE, FALSE, FDIST, FDISTRT, FIND, FINV, FINVRT, FISHER, FISHERINV, FIXED, FLOOR, FLOORMATH, FLOORPRECISE, FORECAST, FREQUENCY, FTEST, FV, FVSCHEDULE, GAMMA, GAMMADIST, GAMMAINV, GAMMALN, GAMMALNPRECISE, GAUSS, GCD, GEOMEAN, GESTEP, GROWTH, HARMEAN, HEX2BIN, HEX2DEC, HEX2OCT, HLOOKUP, HOUR, HYPGEOM, HYPGEOMDIST, IF, IFERROR, IFNA, IFS, IMABS, IMAGINARY, IMARGUMENT, IMCONJUGATE, IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMDIV, IMEXP, IMLN, IMLOG10, IMLOG2, IMPOWER, IMPRODUCT, IMREAL, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN, INDEX, INFO, INT, INTERCEPT, INTRATE, IPMT, IRR, ISBLANK, ISERR, ISERROR, ISEVEN, ISFORMULA, ISLOGICAL, ISNA, ISNONTEXT, ISNUMBER, ISO, ISODD, ISOWEEKNUM, ISPMT, ISREF, ISTEXT, KURT, LARGE, LCM, LEFT, LEN, LINEST, LN, LOG, LOG10, LOGEST, LOGINV, LOGNORM, LOGNORMDIST, LOGNORMINV, LOOKUP, LOWER, MATCH, MAX, MAXA, MAXIFS, MDURATION, MEDIAN, MID, MIN, MINA, MINIFS, MINUTE, MIRR, MMULT, MOD, MODE, MODEMULT, MODESNGL, MONTH, MROUND, MULTINOMIAL, MUNIT, N, NA, NEGBINOM, NEGBINOMDIST, NETWORKDAYS, NETWORKDAYSINTL, NOMINAL, NORM, NORMDIST, NORMINV, NORMSDIST, NORMSINV, NOT, NOW, NPER, NPV, NUMBERVALUE, OCT2BIN, OCT2DEC, OCT2HEX, ODD, ODDFPRICE, ODDFYIELD, ODDLPRICE, ODDLYIELD, OR, PDURATION, PEARSON, PERCENTILE, PERCENTILEEXC, PERCENTILEINC, PERCENTRANK, PERCENTRANKEXC, PERCENTRANKINC, PERMUT, PERMUTATIONA, PHI, PI, PMT, POISSON, POISSONDIST, POWER, PPMT, PRICE, PRICEDISC, PRICEMAT, PROB, PRODUCT, PRONETIC, PROPER, PV, QUARTILE, QUARTILEEXC, QUARTILEINC, QUOTIENT, RADIANS, RAND, RANDBETWEEN, RANK, RANKAVG, RANKEQ, RATE, RECEIVED, REPLACE, REPT, RIGHT, ROMAN, ROUND, ROUNDDOWN, ROUNDUP, ROW, ROWS, RRI, RSQ, SEARCH, SEC, SECH, SECOND, SERIESSUM, SHEET, SHEETS, SIGN, SIN, SINH, SKEW, SKEWP, SLN, SLOPE, SMALL, SORT, SQRT, SQRTPI, STANDARDIZE, STDEV, STDEVA, STDEVP, STDEVPA, STDEVS, STEYX, SUBSTITUTE, SUBTOTAL, SUM, SUMIF, SUMIFS, SUMPRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, SUMXMY2, SWITCH, SYD, T, TAN, TANH, TBILLEQ, TBILLPRICE, TBILLYIELD, TDIST, TDISTRT, TEXT, TEXTJOIN, TIME, TIMEVALUE, TINV, TODAY, TRANSPOSE, TREND, TRIM, TRIMMEAN, TRUE, TRUNC, TTEST, TYPE, UNICHAR, UNICODE, UNIQUE, UPPER, VALUE, VAR, VARA, VARP, VARPA, VARS, VDB, VLOOKUP, WEEKDAY, WEEKNUM, WEIBULL, WEIBULLDIST, WORKDAY, WORKDAYINTL, XIRR, XNPV, XOR, YEAR, YEARFRAC, YIELD, YIELDDISC, YIELDMAT, Z, ZTEST, utils };\n", "import { $, app, store } from './common'\nimport { cm } from './editor'\nimport { calculate, math } from './eval'\nimport { notify } from './modal'\n\nmath.createUnit('USD', { aliases: ['usd'] })\n\n/** Get exchange rates. */\nexport function getRates() {\n const url = 'https://www.floatrates.com/widget/1030/cfc5515dfc13ada8d7b0e50b8143d55f/usd.json'\n\n if (navigator.onLine) {\n $('#lastUpdated').innerHTML = '
    '\n\n fetch(url)\n .then((response) => response.json())\n .then((rates) => {\n const dups = ['cup']\n\n app.currencyRates = rates\n\n Object.keys(rates).forEach((currency) => {\n math.createUnit(\n rates[currency].code,\n {\n aliases: [dups.includes(rates[currency].code.toLowerCase()) ? '' : rates[currency].code.toLowerCase()],\n definition: math.unit(rates[currency].inverseRate + 'USD')\n },\n { override: true }\n )\n\n store.set('rateDate', rates[currency].date)\n })\n\n $('#lastUpdated').innerHTML = store.get('rateDate')\n\n cm.setOption('mode', app.settings.syntax ? 'numara' : 'plain')\n\n calculate()\n })\n .catch((error) => {\n $('#lastUpdated').innerHTML = 'n/a'\n\n notify('Failed to get exchange rates (' + error + ')', 'warning')\n })\n } else {\n $('#lastUpdated').innerHTML = 'No internet connection.'\n\n notify('No internet connection. Could not update exchange rates.', 'warning')\n }\n}\n", "import {\n createIcons,\n AlertCircle,\n ArrowUpDown,\n Braces,\n Circle,\n Copy,\n CornerDownRight,\n Dot,\n Download,\n EllipsisVertical,\n Eraser,\n Info,\n ListRestart,\n PanelLeft,\n PanelLeftClose,\n Plus,\n Printer,\n Scaling,\n Settings,\n Trash,\n UndoDot,\n Upload\n} from 'lucide'\n\nconst iconList = {\n AlertCircle,\n ArrowUpDown,\n Braces,\n Circle,\n Copy,\n CornerDownRight,\n Dot,\n Download,\n EllipsisVertical,\n Eraser,\n Info,\n ListRestart,\n PanelLeft,\n PanelLeftClose,\n Plus,\n Printer,\n Scaling,\n Settings,\n Trash,\n UndoDot,\n Upload\n}\n\n/** Generate app icons. */\nexport const generateIcons = () => {\n createIcons({ icons: iconList })\n}\n", "import { IconNode, IconNodeChild, SVGProps } from './types';\n\n/**\n * Creates a new HTMLElement from icon node\n * @param {string} tag\n * @param {object} attrs\n * @param {array} children\n * @returns {HTMLElement}\n */\nconst createElement = (tag: string, attrs: SVGProps, children: IconNodeChild[] = []) => {\n const element = document.createElementNS('http://www.w3.org/2000/svg', tag);\n\n Object.keys(attrs).forEach((name) => {\n element.setAttribute(name, String(attrs[name]));\n });\n\n if (children.length) {\n children.forEach((child) => {\n const childElement = createElement(...child);\n\n element.appendChild(childElement);\n });\n }\n\n return element;\n};\n\n/**\n * Creates a new HTMLElement from icon node\n * @param {[tag: string, attrs: object, children: array]} iconNode\n * @returns {HTMLElement}\n */\nexport default ([tag, attrs, children]: IconNode) => createElement(tag, attrs, children);\n", "import createElement from './createElement';\nimport { Icons } from './types';\n\nexport type CustomAttrs = { [attr: string]: any };\n\n/**\n * Get the attributes of an HTML element.\n * @param {HTMLElement} element\n * @returns {Object}\n */\nexport const getAttrs = (element: Element): Record =>\n Array.from(element.attributes).reduce>((attrs, attr) => {\n attrs[attr.name] = attr.value;\n return attrs;\n }, {});\n\n/**\n * Gets the classNames of an attributes Object.\n * @param {Object} attrs\n * @returns {Array}\n */\nexport const getClassNames = (attrs: Record | string): string | string[] => {\n if (typeof attrs === 'string') return attrs;\n if (!attrs || !attrs.class) return '';\n if (attrs.class && typeof attrs.class === 'string') {\n return attrs.class.split(' ');\n }\n if (attrs.class && Array.isArray(attrs.class)) {\n return attrs.class;\n }\n return '';\n};\n\n/**\n * Combines the classNames of array of classNames to a String\n * @param {array} arrayOfClassnames\n * @returns {string}\n */\nexport const combineClassNames = (arrayOfClassnames: (string | Record)[]) => {\n const classNameArray = arrayOfClassnames.flatMap(getClassNames);\n\n return classNameArray\n .map((classItem) => classItem.trim())\n .filter(Boolean)\n .filter((value, index, self) => self.indexOf(value) === index)\n .join(' ');\n};\n\nconst toPascalCase = (string: string): string =>\n string.replace(/(\\w)(\\w*)(_|-|\\s*)/g, (g0, g1, g2) => g1.toUpperCase() + g2.toLowerCase());\n\ninterface ReplaceElementOptions {\n nameAttr: string;\n icons: Icons;\n attrs: Record;\n}\n\n/**\n * ReplaceElement, replaces the given element with the created icon.\n * @param {HTMLElement} element\n * @param {{ nameAttr: string, icons: object, attrs: object }} options: { nameAttr, icons, attrs }\n * @returns {Function}\n */\nconst replaceElement = (element: Element, { nameAttr, icons, attrs }: ReplaceElementOptions) => {\n const iconName = element.getAttribute(nameAttr);\n\n if (iconName == null) return;\n\n const ComponentName = toPascalCase(iconName);\n\n const iconNode = icons[ComponentName];\n\n if (!iconNode) {\n return console.warn(\n `${element.outerHTML} icon name was not found in the provided icons object.`,\n );\n }\n\n const elementAttrs = getAttrs(element);\n const [tag, iconAttributes, children] = iconNode;\n\n const iconAttrs = {\n ...iconAttributes,\n 'data-lucide': iconName,\n ...attrs,\n ...elementAttrs,\n };\n\n const classNames = combineClassNames(['lucide', `lucide-${iconName}`, elementAttrs, attrs]);\n\n if (classNames) {\n Object.assign(iconAttrs, {\n class: classNames,\n });\n }\n\n const svgElement = createElement([tag, iconAttrs, children]);\n\n return element.parentNode?.replaceChild(svgElement, element);\n};\n\nexport default replaceElement;\n", "import { SVGProps } from './types';\n\nconst defaultAttributes: SVGProps = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n};\n\nexport default defaultAttributes;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name arrow-up-down\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjEgMTYtNCA0LTQtNCIgLz4KICA8cGF0aCBkPSJNMTcgMjBWNCIgLz4KICA8cGF0aCBkPSJtMyA4IDQtNCA0IDQiIC8+CiAgPHBhdGggZD0iTTcgNHYxNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-up-down\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst ArrowUpDown: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'm21 16-4 4-4-4' }],\n ['path', { d: 'M17 20V4' }],\n ['path', { d: 'm3 8 4-4 4 4' }],\n ['path', { d: 'M7 4v16' }],\n ],\n];\n\nexport default ArrowUpDown;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name braces\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAzSDdhMiAyIDAgMCAwLTIgMnY1YTIgMiAwIDAgMS0yIDIgMiAyIDAgMCAxIDIgMnY1YzAgMS4xLjkgMiAyIDJoMSIgLz4KICA8cGF0aCBkPSJNMTYgMjFoMWEyIDIgMCAwIDAgMi0ydi01YzAtMS4xLjktMiAyLTJhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMC0yLTJoLTEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/braces\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Braces: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1' }],\n ['path', { d: 'M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1' }],\n ],\n];\n\nexport default Braces;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name circle-alert\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8bGluZSB4MT0iMTIiIHgyPSIxMiIgeTE9IjgiIHkyPSIxMiIgLz4KICA8bGluZSB4MT0iMTIiIHgyPSIxMi4wMSIgeTE9IjE2IiB5Mj0iMTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/circle-alert\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst CircleAlert: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['line', { x1: '12', x2: '12', y1: '8', y2: '12' }],\n ['line', { x1: '12', x2: '12.01', y1: '16', y2: '16' }],\n ],\n];\n\nexport default CircleAlert;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name circle\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/circle\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Circle: IconNode = ['svg', defaultAttributes, [['circle', { cx: '12', cy: '12', r: '10' }]]];\n\nexport default Circle;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name copy\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHg9IjgiIHk9IjgiIHJ4PSIyIiByeT0iMiIgLz4KICA8cGF0aCBkPSJNNCAxNmMtMS4xIDAtMi0uOS0yLTJWNGMwLTEuMS45LTIgMi0yaDEwYzEuMSAwIDIgLjkgMiAyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/copy\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Copy: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' }],\n ],\n];\n\nexport default Copy;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name corner-down-right\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIxNSAxMCAyMCAxNSAxNSAyMCIgLz4KICA8cGF0aCBkPSJNNCA0djdhNCA0IDAgMCAwIDQgNGgxMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/corner-down-right\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst CornerDownRight: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['polyline', { points: '15 10 20 15 15 20' }],\n ['path', { d: 'M4 4v7a4 4 0 0 0 4 4h12' }],\n ],\n];\n\nexport default CornerDownRight;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name dot\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMi4xIiBjeT0iMTIuMSIgcj0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/dot\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Dot: IconNode = ['svg', defaultAttributes, [['circle', { cx: '12.1', cy: '12.1', r: '1' }]]];\n\nexport default Dot;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name download\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTV2NGEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtNCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSI3IDEwIDEyIDE1IDE3IDEwIiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMTUiIHkyPSIzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/download\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Download: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],\n ['polyline', { points: '7 10 12 15 17 10' }],\n ['line', { x1: '12', x2: '12', y1: '15', y2: '3' }],\n ],\n];\n\nexport default Download;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name ellipsis-vertical\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxIiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iNSIgcj0iMSIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjE5IiByPSIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/ellipsis-vertical\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst EllipsisVertical: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '1' }],\n ['circle', { cx: '12', cy: '5', r: '1' }],\n ['circle', { cx: '12', cy: '19', r: '1' }],\n ],\n];\n\nexport default EllipsisVertical;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name eraser\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNyAyMS00LjMtNC4zYy0xLTEtMS0yLjUgMC0zLjRsOS42LTkuNmMxLTEgMi41LTEgMy40IDBsNS42IDUuNmMxIDEgMSAyLjUgMCAzLjRMMTMgMjEiIC8+CiAgPHBhdGggZD0iTTIyIDIxSDciIC8+CiAgPHBhdGggZD0ibTUgMTEgOSA5IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/eraser\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Eraser: IconNode = [\n 'svg',\n defaultAttributes,\n [\n [\n 'path',\n { d: 'm7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21' },\n ],\n ['path', { d: 'M22 21H7' }],\n ['path', { d: 'm5 11 9 9' }],\n ],\n];\n\nexport default Eraser;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name info\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJNMTIgMTZ2LTQiIC8+CiAgPHBhdGggZD0iTTEyIDhoLjAxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/info\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Info: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['path', { d: 'M12 16v-4' }],\n ['path', { d: 'M12 8h.01' }],\n ],\n];\n\nexport default Info;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name list-restart\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgNkgzIiAvPgogIDxwYXRoIGQ9Ik03IDEySDMiIC8+CiAgPHBhdGggZD0iTTcgMThIMyIgLz4KICA8cGF0aCBkPSJNMTIgMThhNSA1IDAgMCAwIDktMyA0LjUgNC41IDAgMCAwLTQuNS00LjVjLTEuMzMgMC0yLjU0LjU0LTMuNDEgMS40MUwxMSAxNCIgLz4KICA8cGF0aCBkPSJNMTEgMTB2NGg0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/list-restart\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst ListRestart: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 6H3' }],\n ['path', { d: 'M7 12H3' }],\n ['path', { d: 'M7 18H3' }],\n ['path', { d: 'M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14' }],\n ['path', { d: 'M11 10v4h4' }],\n ],\n];\n\nexport default ListRestart;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name panel-left-close\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik05IDN2MTgiIC8+CiAgPHBhdGggZD0ibTE2IDE1LTMtMyAzLTMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/panel-left-close\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst PanelLeftClose: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2' }],\n ['path', { d: 'M9 3v18' }],\n ['path', { d: 'm16 15-3-3 3-3' }],\n ],\n];\n\nexport default PanelLeftClose;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name panel-left\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik05IDN2MTgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/panel-left\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst PanelLeft: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2' }],\n ['path', { d: 'M9 3v18' }],\n ],\n];\n\nexport default PanelLeft;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name plus\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAxMmgxNCIgLz4KICA8cGF0aCBkPSJNMTIgNXYxNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/plus\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Plus: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M5 12h14' }],\n ['path', { d: 'M12 5v14' }],\n ],\n];\n\nexport default Plus;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name printer\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAxOEg0YTIgMiAwIDAgMS0yLTJ2LTVhMiAyIDAgMCAxIDItMmgxNmEyIDIgMCAwIDEgMiAydjVhMiAyIDAgMCAxLTIgMmgtMiIgLz4KICA8cGF0aCBkPSJNNiA5VjNhMSAxIDAgMCAxIDEtMWgxMGExIDEgMCAwIDEgMSAxdjYiIC8+CiAgPHJlY3QgeD0iNiIgeT0iMTQiIHdpZHRoPSIxMiIgaGVpZ2h0PSI4IiByeD0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/printer\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Printer: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2' }],\n ['path', { d: 'M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6' }],\n ['rect', { x: '6', y: '14', width: '12', height: '8', rx: '1' }],\n ],\n];\n\nexport default Printer;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name scaling\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgM0g1YTIgMiAwIDAgMC0yIDJ2MTRhMiAyIDAgMCAwIDIgMmgxNGEyIDIgMCAwIDAgMi0ydi03IiAvPgogIDxwYXRoIGQ9Ik0xNCAxNUg5di01IiAvPgogIDxwYXRoIGQ9Ik0xNiAzaDV2NSIgLz4KICA8cGF0aCBkPSJNMjEgMyA5IDE1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/scaling\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Scaling: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7' }],\n ['path', { d: 'M14 15H9v-5' }],\n ['path', { d: 'M16 3h5v5' }],\n ['path', { d: 'M21 3 9 15' }],\n ],\n];\n\nexport default Scaling;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name settings\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIuMjIgMmgtLjQ0YTIgMiAwIDAgMC0yIDJ2LjE4YTIgMiAwIDAgMS0xIDEuNzNsLS40My4yNWEyIDIgMCAwIDEtMiAwbC0uMTUtLjA4YTIgMiAwIDAgMC0yLjczLjczbC0uMjIuMzhhMiAyIDAgMCAwIC43MyAyLjczbC4xNS4xYTIgMiAwIDAgMSAxIDEuNzJ2LjUxYTIgMiAwIDAgMS0xIDEuNzRsLS4xNS4wOWEyIDIgMCAwIDAtLjczIDIuNzNsLjIyLjM4YTIgMiAwIDAgMCAyLjczLjczbC4xNS0uMDhhMiAyIDAgMCAxIDIgMGwuNDMuMjVhMiAyIDAgMCAxIDEgMS43M1YyMGEyIDIgMCAwIDAgMiAyaC40NGEyIDIgMCAwIDAgMi0ydi0uMThhMiAyIDAgMCAxIDEtMS43M2wuNDMtLjI1YTIgMiAwIDAgMSAyIDBsLjE1LjA4YTIgMiAwIDAgMCAyLjczLS43M2wuMjItLjM5YTIgMiAwIDAgMC0uNzMtMi43M2wtLjE1LS4wOGEyIDIgMCAwIDEtMS0xLjc0di0uNWEyIDIgMCAwIDEgMS0xLjc0bC4xNS0uMDlhMiAyIDAgMCAwIC43My0yLjczbC0uMjItLjM4YTIgMiAwIDAgMC0yLjczLS43M2wtLjE1LjA4YTIgMiAwIDAgMS0yIDBsLS40My0uMjVhMiAyIDAgMCAxLTEtMS43M1Y0YTIgMiAwIDAgMC0yLTJ6IiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/settings\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Settings: IconNode = [\n 'svg',\n defaultAttributes,\n [\n [\n 'path',\n {\n d: 'M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z',\n },\n ],\n ['circle', { cx: '12', cy: '12', r: '3' }],\n ],\n];\n\nexport default Settings;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name trash\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyA2aDE4IiAvPgogIDxwYXRoIGQ9Ik0xOSA2djE0YzAgMS0xIDItMiAySDdjLTEgMC0yLTEtMi0yVjYiIC8+CiAgPHBhdGggZD0iTTggNlY0YzAtMSAxLTIgMi0yaDRjMSAwIDIgMSAyIDJ2MiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/trash\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Trash: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M3 6h18' }],\n ['path', { d: 'M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6' }],\n ['path', { d: 'M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2' }],\n ],\n];\n\nexport default Trash;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name undo-dot\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjE3IiByPSIxIiAvPgogIDxwYXRoIGQ9Ik0zIDd2Nmg2IiAvPgogIDxwYXRoIGQ9Ik0yMSAxN2E5IDkgMCAwIDAtOS05IDkgOSAwIDAgMC02IDIuM0wzIDEzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/undo-dot\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst UndoDot: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '17', r: '1' }],\n ['path', { d: 'M3 7v6h6' }],\n ['path', { d: 'M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13' }],\n ],\n];\n\nexport default UndoDot;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name upload\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTV2NGEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtNCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4IiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMyIgeTI9IjE1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/upload\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Upload: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],\n ['polyline', { points: '17 8 12 3 7 8' }],\n ['line', { x1: '12', x2: '12', y1: '3', y2: '15' }],\n ],\n];\n\nexport default Upload;\n", "import replaceElement from './replaceElement';\nimport * as iconAndAliases from './iconsAndAliases';\n\n/**\n * Replaces all elements with matching nameAttr with the defined icons\n * @param {{ icons?: object, nameAttr?: string, attrs?: object }} options\n */\nconst createIcons = ({ icons = {}, nameAttr = 'data-lucide', attrs = {} } = {}) => {\n if (!Object.values(icons).length) {\n throw new Error(\n \"Please provide an icons object.\\nIf you want to use all the icons you can import it like:\\n `import { createIcons, icons } from 'lucide';\\nlucide.createIcons({icons});`\",\n );\n }\n\n if (typeof document === 'undefined') {\n throw new Error('`createIcons()` only works in a browser environment.');\n }\n\n const elementsToReplace = document.querySelectorAll(`[${nameAttr}]`);\n Array.from(elementsToReplace).forEach((element) =>\n replaceElement(element, { nameAttr, icons, attrs }),\n );\n\n /** @todo: remove this block in v1.0 */\n if (nameAttr === 'data-lucide') {\n const deprecatedElements = document.querySelectorAll('[icon-name]');\n if (deprecatedElements.length > 0) {\n console.warn(\n '[Lucide] Some icons were found with the now deprecated icon-name attribute. These will still be replaced for backwards compatibility, but will no longer be supported in v1.0 and you should switch to data-lucide',\n );\n Array.from(deprecatedElements).forEach((element) =>\n replaceElement(element, { nameAttr: 'icon-name', icons, attrs }),\n );\n }\n }\n};\n\nexport { createIcons };\n\n/*\n Create Element function export.\n*/\nexport { default as createElement } from './createElement';\n\n/*\n Icons exports.\n*/\nexport { iconAndAliases as icons };\nexport * from './icons';\nexport * from './aliases';\n\n/*\n Types exports.\n*/\nexport * from './types';\n", "import { $, app, store } from './common'\nimport { math } from './eval'\n\nimport { productName } from './../../package.json'\n\nimport functionPlot from 'function-plot'\n\n/** Plot function. */\nexport function plot() {\n $('#plotTitle').innerHTML = app.plotFunction\n\n const f = math.simplify(app.plotFunction.split('=')[1], app.mathScope).toString()\n\n let domain = math.abs(math.evaluate(f, { x: 0 })) * 2\n\n if (domain === Infinity || domain === 0) {\n domain = 10\n }\n\n const xDomain = app.activePlot ? app.activePlot.meta.xScale.domain() : [-domain, domain]\n const yDomain = app.activePlot ? app.activePlot.meta.yScale.domain() : [-domain, domain]\n\n app.activePlot = functionPlot.default({\n data: [\n {\n derivative: app.settings.plotDerivative\n ? { fn: math.derivative(f, 'x').toString(), updateOnMouseMove: true }\n : false,\n fn: f,\n graphType: 'polyline',\n sampler: 'builtIn'\n }\n ],\n grid: app.settings.plotGrid,\n height: $('#plot').clientHeight,\n target: '#plot',\n tip: {\n xLine: app.settings.plotCross,\n yLine: app.settings.plotCross\n },\n width: $('#plot').clientWidth,\n xAxis: { domain: xDomain },\n yAxis: { domain: yDomain }\n })\n}\n\n$('#plotCrossModal').addEventListener('click', () => {\n app.settings.plotCross = $('#plotCrossModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#plotDerivativeModal').addEventListener('click', () => {\n app.settings.plotDerivative = $('#plotDerivativeModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#plotGridModal').addEventListener('click', () => {\n app.settings.plotGrid = $('#plotGridModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#exportPlot').addEventListener('click', () => {\n $('.function-plot').setAttribute('xmlns', 'http://www.w3.org/2000/svg')\n\n const fileName = productName + ' Plot ' + app.plotFunction\n const preface = '\\r\\n'\n const svgData = $('.function-plot').outerHTML\n const svgBlob = new Blob([preface, svgData], { type: 'image/svg+xml;charset=utf-8' })\n const downloadLink = document.createElement('a')\n\n downloadLink.href = URL.createObjectURL(svgBlob)\n downloadLink.download = fileName\n downloadLink.click()\n\n setTimeout(() => URL.revokeObjectURL(downloadLink.href), 60000)\n})\n\n$('#resetPlot').addEventListener('click', () => {\n app.activePlot = null\n\n plot()\n})\n", "{\n \"name\": \"numara\",\n \"productName\": \"Numara\",\n \"description\": \"Numara Calculator\",\n \"version\": \"5.1.3\",\n \"author\": {\n \"name\": \"Timur Atalay\",\n \"email\": \"mail@numara.io\",\n \"url\": \"https://numara.io\"\n },\n \"license\": \"MIT\",\n \"homepage\": \"https://github.com/bornova/numara-calculator\",\n \"main\": \"src/main.js\",\n \"type\": \"module\",\n \"scripts\": {\n \"prebuild\": \"npm run prettier && npm run lint\",\n \"build\": \"node build.js\",\n \"dist\": \"npm run build && electron-builder\",\n \"lint\": \"eslint .\",\n \"lint:fix\": \"eslint --fix .\",\n \"prettier\": \"prettier --check .\",\n \"prettier:fix\": \"prettier --write .\",\n \"publish\": \"npm run build && electron-builder --x64 --arm64 -p always\",\n \"test\": \"npm run build && electron .\",\n \"wiki\": \"node src/misc/wiki.js\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.2.0\",\n \"@formulajs/formulajs\": \"^4.4.4\",\n \"codemirror\": \"^5.65.16\",\n \"deep-diff\": \"^1.0.2\",\n \"electron\": \"^30.1.0\",\n \"electron-builder\": \"^24.13.3\",\n \"esbuild\": \"^0.21.5\",\n \"esbuild-plugin-polyfill-node\": \"^0.3.0\",\n \"eslint\": \"^9.4.0\",\n \"fs-extra\": \"^11.2.0\",\n \"function-plot\": \"^1.24.4\",\n \"lucide\": \"^0.394.0\",\n \"luxon\": \"^3.4.4\",\n \"mathjs\": \"^13.0.0\",\n \"mousetrap\": \"^1.6.5\",\n \"mousetrap-global-bind\": \"^1.1.0\",\n \"prettier\": \"^3.3.1\",\n \"uikit\": \"^3.21.5\"\n },\n \"dependencies\": {\n \"electron-log\": \"^5.1.5\",\n \"electron-store\": \"^9.0.0\",\n \"electron-updater\": \"^6.2.1\"\n }\n}\n", "import { $, $all, app, store } from './common'\nimport { cm, udfInput, uduInput } from './editor'\nimport { calculate, math } from './eval'\nimport { getRates } from './forex'\nimport { generateIcons } from './icons'\nimport { confirm, showError } from './modal'\nimport { checkLocale, checkSize, isElectron } from './utils'\n\nimport DeepDiff from 'deep-diff'\n\n/** Show/hide Defaults link. */\nfunction checkDefaults() {\n $('#defaultSettingsButton').style.display = DeepDiff.diff(app.settings, settings.defaults) ? 'inline' : 'none'\n}\n\n/** Show warning if big number option is selected. */\nfunction bigNumberWarning() {\n $('#bigNumWarn').style.display = app.settings.numericOutput === 'BigNumber' ? 'inline-block' : 'none'\n}\n\n/** Show warning if locale uses comma as decimal point separator. */\nfunction localeWarning() {\n $('#localeWarn').style.display = checkLocale() ? 'inline-block' : 'none'\n}\n\n/** Check for app settings modifications. */\nfunction checkMods(key) {\n $('#' + key + 'Mod').style.display = app.settings[key] !== settings.defaults[key] ? 'inline-block' : 'none'\n}\n\n/** Check for app settings schema changes. */\nfunction checkSchema() {\n DeepDiff.observableDiff(app.settings, settings.defaults, (d) => {\n if (d.kind !== 'E') {\n DeepDiff.applyChange(app.settings, settings.defaults, d)\n\n store.set('settings', app.settings)\n }\n })\n}\n\nexport const settings = {\n /** Default settings. */\n defaults: {\n alwaysOnTop: false,\n autocomplete: true,\n closeBrackets: true,\n contPrevLine: true,\n copyThouSep: false,\n currency: true,\n dateDay: false,\n divider: true,\n expLower: '-12',\n expUpper: '12',\n fontSize: '1.1rem',\n fontWeight: '400',\n inputWidth: 60,\n keywordTips: true,\n lineErrors: true,\n lineHeight: '2em',\n lineNumbers: true,\n lineWrap: true,\n locale: 'system',\n matchBrackets: true,\n matrixType: 'Matrix',\n notation: 'auto',\n notifyDuration: '5000',\n notifyLocation: 'bottom-center',\n numericOutput: 'number',\n plotCross: false,\n plotDerivative: false,\n plotGrid: false,\n precision: '4',\n predictable: false,\n rulers: false,\n syntax: true,\n theme: 'system',\n thouSep: true\n },\n\n /** Initialize settings. */\n initialize: () => {\n app.settings = store.get('settings')\n\n if (app.settings) {\n checkSchema()\n } else {\n app.settings = app.settings = JSON.parse(JSON.stringify(settings.defaults))\n\n store.set('settings', settings.defaults)\n }\n\n settings.apply()\n\n $all('.settingItem').forEach((item) => {\n const span = document.createElement('span')\n const icon = document.createElement('span')\n\n icon.setAttribute('data-lucide', 'dot')\n\n span.setAttribute('id', item.getAttribute('id') + 'Mod')\n span.setAttribute('class', item.getAttribute('type') === 'checkbox' ? 'settingModToggle' : 'settingMod')\n\n span.appendChild(icon)\n\n span.addEventListener('click', () => {\n const key = item.getAttribute('id')\n\n app.settings[key] = settings.defaults[key]\n\n settings.prep()\n settings.save()\n settings.apply()\n })\n\n if (item.getAttribute('type') === 'checkbox') {\n item.parentElement.before(span)\n } else {\n item.before(span)\n }\n\n generateIcons()\n })\n },\n\n /** Prepare settings dialog items. */\n prep: () => {\n const locales = [\n ['System', 'system'],\n ['Chinese (PRC)', 'zh-CN'],\n ['English (Canada)', 'en-CA'],\n ['English (UK)', 'en-GB'],\n ['English (US)', 'en-US'],\n ['French (France)', 'fr-FR'],\n ['German (Germany)', 'de-DE'],\n ['Italian (Italy)', 'it-IT'],\n ['Japanese (Japan)', 'ja-JP'],\n ['Portuguese (Brazil)', 'pt-BR'],\n ['Russian (Russia)', 'ru-RU'],\n ['Spanish (Mexico)', 'es-MX'],\n ['Spanish (Spain)', 'es-ES'],\n ['Turkish (Turkey)', 'tr-TR']\n ]\n\n const matrixTypes = ['Matrix', 'Array']\n const numericOutputs = ['number', 'BigNumber', 'Fraction']\n const notations = ['auto', 'engineering', 'exponential', 'fixed', '-', 'bin', 'hex', 'oct']\n\n $('#locale').innerHTML = ''\n\n for (const l of locales) {\n $('#locale').innerHTML += ``\n }\n\n $('#precision-label').innerHTML = app.settings.precision\n $('#expLower-label').innerHTML = app.settings.expLower\n $('#expUpper-label').innerHTML = app.settings.expUpper\n\n $('#numericOutput').innerHTML = ''\n\n for (const n of numericOutputs) {\n $('#numericOutput').innerHTML += ``\n }\n\n $('#notation').innerHTML = ''\n\n for (const n of notations) {\n $('#notation').innerHTML +=\n n === '-'\n ? ''\n : ``\n }\n\n $('#matrixType').innerHTML = ''\n\n for (const m of matrixTypes) {\n $('#matrixType').innerHTML += ``\n }\n\n $('#lastUpdated').innerHTML = app.settings.currency ? store.get('rateDate') : ''\n $('#currencyUpdate').style.visibility = app.settings.currency ? 'visible' : 'hidden'\n\n Object.keys(app.settings).forEach((key) => {\n const el = $('#' + key)\n\n if (el) {\n if (el.getAttribute('type') === 'checkbox') {\n el.checked = app.settings[key]\n } else {\n el.value = app.settings[key]\n }\n\n checkMods(key)\n }\n })\n\n checkSize()\n checkDefaults()\n localeWarning()\n bigNumberWarning()\n\n settings.toggleSubs()\n },\n\n /** Apply settings. */\n apply: () => {\n const appTheme =\n app.settings.theme === 'system'\n ? isElectron\n ? numara.isDark()\n ? 'dark'\n : 'light'\n : 'light'\n : app.settings.theme === 'light'\n ? 'light'\n : 'dark'\n\n $('#style').setAttribute('href', 'css/' + appTheme + '.css')\n $('#numaraLogo').setAttribute('src', 'assets/logo-' + appTheme + '.png')\n\n const udfuTheme =\n app.settings.theme === 'system'\n ? isElectron\n ? numara.isDark()\n ? 'material-darker'\n : 'default'\n : 'default'\n : app.settings.theme === 'light'\n ? 'default'\n : 'material-darker'\n\n udfInput.setOption('theme', udfuTheme)\n uduInput.setOption('theme', udfuTheme)\n\n if (isElectron) {\n numara.setTheme(app.settings.theme)\n numara.setOnTop(app.settings.alwaysOnTop)\n }\n\n const elements = $all('.panelFont, .input .CodeMirror')\n\n for (const el of elements) {\n el.style.fontSize = app.settings.fontSize\n el.style.fontWeight = app.settings.fontWeight\n el.style.setProperty('line-height', app.settings.lineHeight, 'important')\n }\n\n $('#input').style.width = (app.settings.divider ? app.settings.inputWidth : settings.defaults.inputWidth) + '%'\n $('#panelDivider').style.display = app.settings.divider ? 'block' : 'none'\n $('#output').style.textAlign = app.settings.divider ? 'left' : 'right'\n\n cm.setOption('mode', app.settings.syntax ? 'numara' : 'plain')\n cm.setOption('lineNumbers', app.settings.lineNumbers)\n cm.setOption('lineWrapping', app.settings.lineWrap)\n cm.setOption('matchBrackets', app.settings.syntax && app.settings.matchBrackets ? { maxScanLines: 1 } : false)\n cm.setOption('autoCloseBrackets', app.settings.closeBrackets)\n\n math.config({\n matrix: app.settings.matrixType,\n number: app.settings.numericOutput,\n predictable: app.settings.predictable\n })\n\n setTimeout(calculate, 10)\n },\n\n /** Save settings to local storage. */\n save: () => {\n Object.keys(app.settings).forEach((key) => {\n const el = $('#' + key)\n\n if (el) {\n app.settings[key] = el.getAttribute('type') === 'checkbox' ? el.checked : el.value\n\n checkMods(key)\n }\n })\n\n if (!$('#currency').checked) {\n localStorage.removeItem('rateDate')\n\n app.currencyRates = {}\n }\n\n $('#currencyUpdate').style.visibility = $('#currency').checked ? 'visible' : 'hidden'\n\n if (!store.get('rateDate') && app.settings.currency) {\n getRates()\n }\n\n checkDefaults()\n localeWarning()\n bigNumberWarning()\n\n settings.toggleSubs()\n\n store.set('settings', app.settings)\n },\n\n /** Toggle settings sliders to enabled/disabled based on parent setting. */\n toggleSubs: () => {\n $('#expUpper').disabled = app.settings.notation !== 'auto'\n $('#expLower').disabled = app.settings.notation !== 'auto'\n $('#keywordTips').disabled = !app.settings.syntax\n $('#matchBrackets').disabled = !app.settings.syntax\n $('#copyThouSep').disabled = !app.settings.thouSep\n\n $('#expUpper').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#expLower').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#keywordTips').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#matchBrackets').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#copyThouSep').parentNode.style.opacity = app.settings.thouSep ? '1' : '0.5'\n\n $('#expUpperMod').style.pointerEvents = app.settings.notation === 'auto' ? 'auto' : 'none'\n $('#expLowerMod').style.pointerEvents = app.settings.notation === 'auto' ? 'auto' : 'none'\n $('#keywordTipsMod').style.pointerEvents = app.settings.syntax ? 'auto' : 'none'\n $('#matchBracketsMod').style.pointerEvents = app.settings.syntax ? 'auto' : 'none'\n $('#copyThouSepMod').style.pointerEvents = app.settings.thouSep ? 'auto' : 'none'\n\n $('#expUpperMod').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#expLowerMod').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#keywordTipsMod').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#matchBracketsMod').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#copyThouSepMod').parentNode.style.opacity = app.settings.thouSep ? '1' : '0.5'\n }\n}\n\n$('#defaultSettingsButton').addEventListener('click', () => {\n confirm('All settings will revert back to defaults.', () => {\n app.settings = JSON.parse(JSON.stringify(settings.defaults))\n\n store.set('settings', app.settings)\n\n settings.prep()\n settings.save()\n settings.apply()\n })\n})\n\n$('#dialog-settings-reset').addEventListener('click', () => {\n confirm('All user settings and data will be lost.', () => {\n if (isElectron) {\n numara.resetApp()\n } else {\n localStorage.clear()\n location.reload()\n }\n })\n})\n\nif (isElectron) {\n $('#resetSizeButton').addEventListener('click', numara.resetSize)\n}\n\n$('#localeWarn').addEventListener('click', () => {\n showError(\n 'Caution: Locale',\n `Your locale (${app.settings.locale}) uses comma (,) as decimal separator. Therefore, you must use semicolon (;) as argument separator when using functions.

    Ex. sum(1;3) // 4`\n )\n})\n\n$('#bigNumWarn').addEventListener('click', () => {\n showError(\n 'Caution: BigNumber Limitations',\n `Using the BigNumber may break function plotting and is not compatible with some math functions. \n It may also cause unexpected behavior and affect overall performance.

    \n Read more on BigNumbers`\n )\n})\n\n$('#precision').addEventListener('input', () => {\n $('#precision-label').innerHTML = $('#precision').value\n})\n\n$('#expLower').addEventListener('input', () => {\n $('#expLower-label').innerHTML = $('#expLower').value\n})\n\n$('#expUpper').addEventListener('input', () => {\n $('#expUpper-label').innerHTML = $('#expUpper').value\n})\n\n$all('.settingItem').forEach((el) => {\n el.addEventListener('change', () => {\n settings.save()\n settings.apply()\n })\n})\n", "import { $, $all, app, store } from './common'\nimport { cm } from './editor'\nimport { generateIcons } from './icons'\nimport { confirm, notify, showModal } from './modal'\nimport { isElectron } from './utils'\n\nimport { DateTime } from 'luxon'\n\nimport UIkit from 'uikit'\n\n/** Migrate old saved calculations to pages */\nexport function migrateSaved() {\n const saved = store.get('saved')\n const pages = store.get('pages')\n\n if (saved) {\n Object.entries(saved).forEach(([id, val]) => {\n pages.push({ id, name: val[0], data: val[1] })\n })\n\n store.set('pages', pages)\n\n localStorage.removeItem('saved')\n }\n}\n\n/** Get page name/number to use */\nexport function getPageName() {\n const pages = store.get('pages')\n\n let pageNo = 1\n\n if (pages) {\n const regex = new RegExp(/\\b(Page \\d+)$\\b/)\n const pageNos = pages\n .filter((page) => regex.test(page.name.trim()))\n .map((page) => +page.name.split(' ')[1])\n .sort((a, b) => a - b)\n\n const max = Math.max(...pageNos)\n\n if (pageNos[0] === 1) {\n for (let i = 0; i < max; i++) {\n if (pageNos[i + 1] !== pageNos[i] + 1) {\n pageNo = pageNos[i] + 1\n break\n }\n }\n }\n }\n\n return 'Page ' + pageNo\n}\n\n/** Get last page from store */\nexport const lastPage = () => store.get('lastPage')\n\n/** Populate the page list in side bar */\nexport function populatePages() {\n const pages = store.get('pages')\n\n if (!pages || pages.length === 0) {\n defaultPage()\n }\n\n $('#pageList').innerHTML = ''\n\n pages.forEach((page) => {\n const pageListItem = document.createElement('div')\n\n pageListItem.id = page.id\n pageListItem.classList.add(\n 'pageListItem',\n 'uk-flex-middle',\n app.activePage === page.id ? 'activePage' : 'inactivePage'\n )\n pageListItem.innerHTML = `\n
    \n
    ${page.name}
    \n
    ${DateTime.fromFormat(page.id, 'yyyyMMddHHmmssSSS').toFormat('FF')}
    \n
    \n
    \n \n
    \n
    Rename
    \n
    Duplicate
    \n
    Delete
    \n
    \n
    \n `\n\n pageListItem.addEventListener('click', (event) => {\n if (event.target.parentNode.dataset.action === 'load') {\n loadPage(page.id)\n\n UIkit.offcanvas('#sidePanel').hide()\n }\n\n switch (event.target.dataset.action) {\n case 'rename':\n UIkit.dropdown(event.target.parentNode).hide(0)\n renamePage(page.id)\n break\n case 'delete':\n deletePage(page.id)\n break\n case 'duplicate':\n duplicatePage(page.id)\n break\n }\n })\n\n $('#pageList').appendChild(pageListItem)\n })\n\n generateIcons()\n}\n\n/**\n * Load page\n *\n * @param {*} pageId Id of the page to load\n */\nexport function loadPage(pageId) {\n const page = store.get('pages').find((page) => page.id === pageId)\n const cursor = page.cursor\n\n app.activePage = pageId\n\n store.set('lastPage', pageId)\n\n $('#pageName').innerHTML = page.name\n $('#pageName').title = page.name\n\n cm.setValue(page.data)\n\n if (page.history) {\n cm.setHistory(page.history)\n }\n\n cm.execCommand('goLineEnd')\n\n if (cursor) {\n cm.setCursor(cursor)\n cm.scrollIntoView(cursor)\n }\n\n populatePages()\n}\n\n/** Generate default page */\nexport function defaultPage() {\n const pageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pageName = getPageName()\n\n store.set('pages', [{ id: pageId, name: pageName, data: store.get('input') || '' }])\n\n localStorage.removeItem('input')\n\n loadPage(pageId)\n}\n\n/**\n * Create new page\n *\n * @param {boolean} isImport Is the new page imported? true | false\n */\nexport function newPage(isImport) {\n const pageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pages = store.get('pages')\n const pageName =\n $('#newPageTitleInput').value.replace(/<|>/g, '').trim() || (isImport ? 'Imported page' : getPageName())\n\n const pageNames = pages.map((p) => p.name)\n\n if (pageNames.includes(pageName)) {\n notify(`\"${pageName}\" already exists. Please choose a different page name.`, 'danger')\n return\n }\n\n app.activePage = pageId\n\n pages.push({ id: pageId, name: pageName, data: '' })\n\n store.set('pages', pages)\n store.set('lastPage', pageId)\n\n cm.setValue('')\n\n populatePages()\n\n $('#pageName').innerHTML = pageName\n\n UIkit.modal('#dialog-newPage').hide()\n}\n\n/**\n * Delete page\n *\n * @param {*} pageId Id of the page to delete\n */\nexport function deletePage(pageId) {\n let pages = store.get('pages')\n\n confirm('\"' + pages.find((page) => page.id === pageId).name + '\" will be deleted.', () => {\n pages = pages.filter((page) => page.id !== pageId)\n\n store.set('pages', pages)\n\n if (pages.length === 0) {\n defaultPage()\n } else if (pageId === app.activePage) {\n loadPage(pages.pop().id)\n }\n\n populatePages()\n })\n}\n\n/**\n * Rename page\n *\n * @param {*} pageId Id of the page to rename\n */\nexport function renamePage(pageId) {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === pageId)\n\n $('#renamePageTitleInput').value = page.name\n\n showModal('#dialog-renamePage')\n\n function rename() {\n page.name = $('#renamePageTitleInput').value.replace(/<|>/g, '').trim() || getPageName()\n\n store.set('pages', pages)\n\n populatePages()\n\n $('#pageName').innerHTML = page.name\n\n UIkit.modal('#dialog-renamePage').hide()\n\n $('#dialog-renamePage-save').removeEventListener('click', rename)\n }\n\n $('#dialog-renamePage-save').addEventListener('click', rename)\n}\n\n/**\n * Duplicate page\n *\n * @param {*} pageId Id of the page to duplicate\n */\nexport function duplicatePage(pageId) {\n const dupPageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pages = store.get('pages')\n const dupPage = pages.find((page) => page.id === pageId)\n const dupPageData = dupPage.data\n const dupPageName = dupPage.name + ' (copy)'\n\n app.activePage = dupPageId\n\n pages.push({ id: dupPageId, name: dupPageName, data: dupPageData })\n\n store.set('pages', pages)\n\n loadPage(dupPageId)\n}\n\n/** Sort page list */\nexport function sortPages(by) {\n const pages = store.get('pages')\n\n let sortedPages\n\n switch (by) {\n case 'oldnew':\n sortedPages = pages.sort((a, b) => a.id - b.id)\n break\n case 'newold':\n sortedPages = pages.sort((a, b) => b.id - a.id)\n break\n case 'az':\n sortedPages = pages.sort((a, b) => a.name.localeCompare(b.name))\n break\n case 'za':\n sortedPages = pages.sort((a, b) => b.name.localeCompare(a.name))\n break\n }\n\n store.set('pages', sortedPages)\n\n populatePages()\n\n UIkit.dropdown('#sortDropdown').hide(0)\n}\n\n/** Sort page list after drag */\nexport function pageOrder() {\n const pages = store.get('pages')\n const pageList = $all('#pageList > div')\n const orderedPages = [...pageList].map((el) => pages.find((page) => page.id === el.getAttribute('id')))\n\n store.set('pages', orderedPages)\n}\n\nexport function deleteAllPages() {\n confirm('All pages will be deleted permanently.', () => {\n store.set('pages', [])\n\n defaultPage()\n\n populatePages()\n })\n}\n\nfunction newPageDialog() {\n $('#newPageTitleInput').value = ''\n $('#newPageTitleInput').focus()\n\n showModal('#dialog-newPage')\n}\n\n$('#newPageButton').addEventListener('click', newPageDialog)\n\n$('#newPageButtonSP').addEventListener('click', newPageDialog)\n\n$('#dialog-newPage-save').addEventListener('click', () => {\n newPage(false)\n})\n\n$('#newPageTitleInput').addEventListener('keyup', (event) => {\n if (event.key === 'Enter' || event.keyCode === 13) {\n $('#dialog-newPage-save').click()\n }\n})\n\n$('#deleteAllPagesButton').addEventListener('click', deleteAllPages)\n\n$('#renamePageTitleInput').addEventListener('keyup', (event) => {\n if (event.key === 'Enter' || event.keyCode === 13) {\n $('#dialog-renamePage-save').click()\n }\n})\n\n$('#sortOldNew').addEventListener('click', () => {\n sortPages('oldnew')\n})\n\n$('#sortNewOld').addEventListener('click', () => {\n sortPages('newold')\n})\n\n$('#sortAZ').addEventListener('click', () => {\n sortPages('az')\n})\n\n$('#sortZA').addEventListener('click', () => {\n sortPages('za')\n})\n\n$('#closeSidePanelButton').addEventListener('click', () => {\n UIkit.offcanvas('#sidePanel').hide()\n})\n\n$('#printButton').addEventListener('click', () => {\n window.print()\n})\n\nif (isElectron) {\n // Import calculations from file\n $('#importButton').addEventListener('click', numara.import)\n\n numara.importData((event, data, msg) => {\n newPage(true)\n\n cm.setValue(data)\n\n notify(msg, 'success')\n })\n\n numara.importDataError((event, error) => {\n notify(error, 'danger')\n })\n\n numara.main.import(numara.import)\n\n // Export calculations to file\n $('#exportButton').addEventListener('click', () => {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === app.activePage).name\n numara.export(page, cm.getValue())\n })\n\n numara.exportData((event, msg) => {\n notify(msg, 'success')\n })\n\n numara.exportDataError((event, error) => {\n notify(error, 'danger')\n })\n\n numara.main.export(() => {\n numara.export($('#newPageTitleInput').value, cm.getValue())\n })\n\n // Print window from main\n numara.main.print(() => {\n UIkit.offcanvas('#sidePanel').hide()\n\n window.print()\n })\n} else {\n $all('#exportButton, #importButton, #spDivider').forEach((el) => el.remove())\n}\n", "import { $, app, store } from './common'\nimport { udfInput, uduInput } from './editor'\nimport { calculate } from './eval'\nimport { showError } from './modal'\n\nimport UIkit from 'uikit'\n\n/**\n * User defined functions and units.\n *\n * @param {*} input User defined function or unit to apply.\n * @param {string} type 'func' | 'unit'\n */\nexport function applyUdfu(input, type) {\n try {\n const loadUD =\n type === 'func'\n ? new Function(`'use strict'; let window; let numara; math.import({${input}}, {override: true})`)\n : new Function(`'use strict'; let window; let numara; math.createUnit({${input}}, {override: true})`)\n\n loadUD()\n\n const UDFunc = new Function(`'use strict'; return {${input}}`)\n\n for (const f in UDFunc()) {\n app[type === 'func' ? 'udfList' : 'uduList'].push(f)\n }\n\n store.set(type === 'func' ? 'udf' : 'udu', input)\n\n calculate()\n\n UIkit.modal('#dialog-udfu').hide()\n } catch (error) {\n showError(error.name, error.message)\n }\n}\n\n$('#dialog-udfu-save-f').addEventListener('click', () => {\n applyUdfu(udfInput.getValue().trim(), 'func')\n})\n\n$('#dialog-udfu-save-u').addEventListener('click', () => {\n applyUdfu(uduInput.getValue().trim(), 'unit')\n})\n", "/**\r\n * adds a bindGlobal method to Mousetrap that allows you to\r\n * bind specific keyboard shortcuts that will still work\r\n * inside a text input field\r\n *\r\n * usage:\r\n * Mousetrap.bindGlobal('ctrl+s', _saveChanges);\r\n */\r\n/* global Mousetrap:true */\r\n(function(Mousetrap) {\r\n var _globalCallbacks = {};\r\n var _originalStopCallback = Mousetrap.prototype.stopCallback;\r\n\r\n Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {\r\n var self = this;\r\n\r\n if (self.paused) {\r\n return true;\r\n }\r\n\r\n if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {\r\n return false;\r\n }\r\n\r\n return _originalStopCallback.call(self, e, element, combo);\r\n };\r\n\r\n Mousetrap.prototype.bindGlobal = function(keys, callback, action) {\r\n var self = this;\r\n self.bind(keys, callback, action);\r\n\r\n if (keys instanceof Array) {\r\n for (var i = 0; i < keys.length; i++) {\r\n _globalCallbacks[keys[i]] = true;\r\n }\r\n return;\r\n }\r\n\r\n _globalCallbacks[keys] = true;\r\n };\r\n\t\r\n\tMousetrap.prototype.unbindGlobal = function(keys, action) {\r\n\t\tvar self = this;\r\n\t\tself.unbind(keys, action);\r\n\r\n\t\tif (keys instanceof Array) {\r\n\t\t\tfor (var i = 0; i < keys.length; i++) {\r\n\t\t\t\t_globalCallbacks[keys[i]] = false;\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t_globalCallbacks[keys] = false;\r\n\t};\r\n\r\n Mousetrap.init();\r\n}) (Mousetrap);\r\n"], - "mappings": ";;;;;;;;;irBAAA,IAAAA,EAAAC,GAAA,QCwDA,SAASC,IAAKC,EAAKC,EAAO,CACxB,KAAK,IAAMD,EACX,KAAK,MAAQC,CACf,CA6GA,SAASC,GAAOC,EAAmB,CACjC,IAAIC,EAAU,KAAK,OAAO,KAAK,IAAI,EAAIC,GAAa,IAAI,GAAK,IAAI,EAC7DC,EAAYD,GAAa,IAAI,EAAI,KACjCE,EAAU,KAAK,MAAMD,CAAS,EAAIF,EAClCI,EAAc,KAAK,MAAOF,EAAY,EAAK,GAAG,EAClD,OAAIH,IACFI,EAAUA,EAAUJ,EAAkB,CAAC,EACvCK,EAAcA,EAAcL,EAAkB,CAAC,EAC3CK,EAAc,IAChBD,IACAC,GAAeC,KAGZ,CAACF,EAASC,CAAW,CAC9B,CAtLA,IAmEIE,IAmFAL,GAKEM,GAYFF,GAvKJG,GAAAC,GAAA,KAAAC,IAAAC,IAAAH,IA4DAb,IAAK,UAAU,IAAM,UAAY,CAC/B,KAAK,IAAI,MAAM,KAAM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ADIC,GAAU,EACLC,GAAM,EAAGA,GAAMtC,GAAI,OAAQsC,KAClCD,GAAU/H,EAAU+H,GAASrC,GAAIsC,EAAG,EAAE,KAAK,EAE7C,OAAIxH,EAAMuH,GAAS,KAAK,KAAK,IAC3B1G,GAAE,MAAQ,GAEZqE,GAAI,KAAKrE,EAAC,EACHqE,EACT,EACA,IAAIuC,EAAW,CACb,KAAM,CACJ,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,CACF,EACA,MAAO,CACL,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,GACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,GACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,KAAM,CACJ,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,GACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,IAAK,CACH,KAAM,MACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,OAAQ,CACN,KAAM,SACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,GACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,IACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,OAAQ,CACN,KAAM,SACN,MAAO,MACP,WAAY,EACd,CACF,EACA,QAAS,CACP,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,MAAO,CACL,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,gBAAiB,CACf,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,CACF,EACA,iBAAkB,CAChB,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,I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AGA,IAAII,GAAsB,CACxB,KAAM,GACN,MAAO,GACP,EAAG,GACH,EAAG,GACH,SAAU,GACV,IAAK,GACL,KAAM,GACN,MAAO,GACP,OAAQ,GACR,IAAK,GACL,IAAK,GACL,GAAI,GACJ,QAAS,GACT,MAAO,GACP,IAAK,EAIP,EAWAV,GAAS,MAAQ,CAAC3B,EAQlB,CACE,EAAG,SACH,EAAG,GACL,EAIA,CACE,EAAG,gBAEH,SAAU,CACR,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,WAEH,SAAU,CACR,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,uBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,EACA,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,uBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,EACA,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,uBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,EACA,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,WACH,EAAG,QACL,EAAG,CACD,EAAG,KACH,EAAG,UACL,EAEA,CACE,EAAG,iBACH,EAAG,oBACH,OAAQ,EACV,EAEA,CACE,EAAG,UACH,EAAG,UACL,EAEA,CACE,EAAG,OACH,EAAG,SACL,EAAG,CACD,EAAG,8BACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,oCACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAEA,CACE,EAAG,iCACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAEA,CACE,EAAG,4BACH,EAAG,8BACL,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,MACH,EAAG,KACL,EAAG,CACD,EAAG,uBACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,2BACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAKAD,EAIA,CACE,EAAG,aACH,SAAU,CACR,IAAK,CACH,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,OACH,EAAG,GACL,EAAG,CACD,EAAG,YACH,EAAG,UACL,EAEA,CACE,EAAG,gBACH,EAAG,YACL,EAEA,CACE,EAAG,2BACH,EAAG,+BACL,EAAG,CACD,EAAG,2BACH,EAAG,+BACL,EAEA,CACE,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8BACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,uBACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,EACA,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8DACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8DACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,YACH,EAAG,UACL,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAGA,EAIH,CACE,EAAG,qBACH,SAAU,CACR,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,qBAEH,SAAU,CACR,SAAU,CACR,MAAO,EACT,EACA,SAAU,CACR,YAAa,EACf,CACF,CACF,EAEA,CACE,EAAG,iBACH,SAAU,CACR,IAAK,CACH,YA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,UACzB,CAAC,EAED,OAAO,iBAAiB,aAAc,IAAM,CAC1C3D,GAAE,YAAY,EAAE,OAAO,CACzB,CAAC", - "names": ["init_dirname", "__esmMin", "Item", "fun", "array", "hrtime", "previousTimestamp", "baseNow", "_performance", "clocktime", "seconds", "nanoseconds", "nanoPerSec", "env", "nowOffset", "init_process", "__esmMin", "init_dirname", "init_buffer", "time", "diff", "init_process", "__esmMin", "dew$2", "_dewExec$2", "exports$3", "byteLength", "toByteArray", "fromByteArray", "lookup", "revLookup", "Arr", "code", "len", "getLens", "b64", "validLen", "placeHoldersLen", "lens", "_byteLength", "tmp", "arr", "curByte", "i", "tripletToBase64", "num", "encodeChunk", "uint8", "start", "end", "output", "extraBytes", "parts", "maxChunkLength", "len2", "dew$1", "_dewExec$1", "exports$2", "buffer", "offset", "isLE", "mLen", "nBytes", "e", "m", "eLen", "eMax", "eBias", "nBits", "d", "s", "value", "c", "rt", "dew", "_dewExec", "exports$1", "base64", "ieee754", "customInspectSymbol", "Buffer", "SlowBuffer", "K_MAX_LENGTH", "typedArraySupport", "proto", "createBuffer", "length", "buf", "arg", "encodingOrOffset", "allocUnsafe", "from", "fromString", "fromArrayView", "isInstance", "fromArrayBuffer", "valueOf", "b", "fromObject", "assertSize", "size", "alloc", "fill", "encoding", "checked", "string", "actual", "fromArrayLike", "array", "arrayView", "copy", "byteOffset", "obj", "numberIsNaN", "a", "x", "y", "list", "pos", "mustMatch", "loweredCase", "utf8ToBytes", "base64ToBytes", "slowToString", "hexSlice", "utf8Slice", "asciiSlice", "latin1Slice", "base64Slice", "utf16leSlice", "swap", "n", "str", "max", "target", "thisStart", "thisEnd", "thisCopy", "targetCopy", "bidirectionalIndexOf", "val", "dir", "arrayIndexOf", "indexSize", "arrLength", "valLength", "read", "foundIndex", "found", "j", "hexWrite", "remaining", "strLen", "parsed", "utf8Write", "blitBuffer", "asciiWrite", "asciiToBytes", "base64Write", "ucs2Write", "utf16leToBytes", "res", "firstByte", "codePoint", "bytesPerSequence", "secondByte", "thirdByte", "fourthByte", "tempCodePoint", "decodeCodePointsArray", "MAX_ARGUMENTS_LENGTH", "codePoints", "ret", "out", "hexSliceLookupTable", "bytes", "newBuf", "checkOffset", "ext", "noAssert", "mul", "defineBigIntMethod", "validateNumber", "first", "last", "boundsError", "lo", "hi", "checkInt", "min", "maxBytes", "wrtBigUInt64LE", "checkIntBI", "wrtBigUInt64BE", "limit", "sub", "checkIEEE754", "writeFloat", "littleEndian", "writeDouble", "targetStart", "errors", "E", "sym", "getMessage", "Base", "name", "range", "input", "msg", "received", "addNumericalSeparator", "checkBounds", "type", "INVALID_BASE64_RE", "base64clean", "units", "leadSurrogate", "byteArray", "src", "dst", "alphabet", "table", "i16", "fn", "BufferBigIntNotDefined", "exports", "INSPECT_MAX_BYTES", "kMaxLength", "init_buffer", "__esmMin", "init_dirname", "init_process", "init_buffer", "__esmMin", "require_uikit", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "factory", "hasOwnProperty", "toString", "hasOwn", "obj", "key", "hyphenateRe", "hyphenate", "memoize", "str", "camelizeRe", "camelize", "_", "c", "ucfirst", "startsWith", "search", "_a", "endsWith", "includes", "findIndex", "array", "predicate", "isArray", "toArray", "assign", "isFunction", "isObject", "isPlainObject", "isWindow", "isDocument", "nodeType", "isNode", "isElement", "isBoolean", "value", "isString", "isNumber", "isNumeric", "isEmpty", "isUndefined", "toBoolean", "toNumber", "number", "toFloat", "toNode", "element", "toNodes", "toWindow", "document", "isEqual", "other", "each", "val", "swap", "a", "b", "match", "last", "cb", "sortBy", "prop", "propA", "propB", "sumBy", "iteratee", "sum", "item", "uniqueBy", "seen", "check", "pick", "props", "res", "clamp", "min", "max", "noop", "intersectRect", "rects", "minProp", "maxProp", "pointInRect", "point", "rect", "ratio", "dimensions", "aProp", "contain", "maxDimensions", "cover$1", "Dimensions", "getIndex", "i", "elements", "current", "finite", "length", "fn", "cache", "args", "addClass", "classes", "node", "add", "toClasses", "cls", "hasClass", "removeClass", "remove", "replaceClass", "oldClass", "newClass", "toggleClass", "force", "cls2", "attr", "name", "el", "removeAttr", "hasAttr", "element2", "data", "attribute", "inBrowser", "isRtl", "hasTouch", "hasPointerEvents", "pointerDown$1", "pointerMove$1", "pointerUp$1", "pointerEnter", "pointerLeave", "pointerCancel", "voidElements", "isVoidElement", "isVisibleFn", "isVisible", "selInput", "isInput", "matches", "selFocusable", "isFocusable", "parent", "filter$1", "selector", "parents", "children", "children2", "index", "ref", "isSameSiteAnchor", "part", "getTargetedElement", "hash", "ownerDocument", "id", "query", "context", "find", "getContext", "queryAll", "findAll", "_query", "parseSelector", "addStarRe", "splitSelectorRe", "trailingCommaRe", "isContextSelector", "selectors", "sel", "parsePositionSelector", "index2", "queryFn", "parsed", "_doQuery", "isSingle", "positionSel", "ctx", "domPath", "names", "escape", "tagName", "css", "on", "targets", "types", "listener", "useCapture", "getArgs", "detail", "selfFilter", "delegate", "type", "target", "off", "once", "condition", "off2", "e", "result", "trigger", "event", "detail2", "toEventTargets", "createEvent", "bubbles", "cancelable", "isEventTarget", "toEventTarget", "isTouch", "getEventPos", "_b", "x", "y", "cssNumber", "property", "priority", "propName", "style", "prefix", "prefixedName", "clsTransition", "transitionEnd", "transitionCanceled", "transition$1", "duration", "timing", "resolve", "reject", "timer", "Transition", "clsAnimation", "animationEnd", "animationCanceled", "animate$2", "animation", "origin", "out", "Animation", "ready", "isTag", "tagNames", "empty", "$", "html", "parent2", "html2", "append", "prepend", "applyFn", "before", "after", "nodes", "fragment", "unwrapSingle", "remove$1", "wrapAll", "structure", "wrapInner", "unwrap", "self", "singleTagRe", "container", "apply", "next", "isHtml", "$$", "dirs$1", "dimensions$1", "height", "width", "offset", "coordinates", "currentOffset", "scrollY", "scrollX", "offsetBy", "dir", "position", "top", "left", "body", "documentElement", "offsetParent", "parentOffset", "offsetPosition", "offset2", "win", "dimension", "doc", "boxModelAdjust", "sizing", "prop2", "flipPosition", "pos", "toPx", "offsetDim", "parseCalc", "value2", "unit", "parseUnit", "percent", "getViewportHeight", "calcRe", "calc", "unitRe$1", "base", "vh", "vhEl", "fastdom", "read", "write", "clear", "flush", "reads", "writes", "task", "scheduleFlush", "scheduled", "runTasks", "tasks", "MouseTracker", "p", "right", "bottom", "prevPosition", "path", "diagonal", "intersection", "intersect", "x1", "y1", "x2", "y2", "x3", "y3", "x4", "y4", "denominator", "ua", "observeIntersection", "options", "intersecting", "observer", "entries", "observer2", "entry", "hasResizeObserver", "observeResize", "observe$1", "cb2", "observeViewportResize", "observeMutation", "Observer", "play", "isIFrame", "call", "isHTML5", "pause", "mute", "isVideo", "isYoutube", "isVimeo", "cmd", "enableApi", "post", "stateKey", "counter", "youtube", "vimeo", "poller", "isInView", "offsetTop", "offsetLeft", "overflowParents", "offsetViewport", "scrollIntoView", "parents2", "scrollParents", "scrollElement", "scrollTop", "scrollHeight", "offsetHeight", "viewport", "maxScroll", "elHeight", "elTop", "scrollTo", "targetEl", "scroll", "getDuration", "start", "isScrollingElement", "scrollingElement", "targetTop", "prev", "frames", "step", "ease", "diff", "getCoveringElement", "dist", "k", "scrolledOver", "startOffset", "endOffset", "scrollParent", "viewportHeight", "elementOffsetTop", "end", "scrollable", "scrollEl", "ancestors", "fixedIndex", "window", "viewportElement", "scale", "subpixel", "coverEl", "hasPosition", "zIndex", "dirs", "positionAt", "getPosition", "attachTo", "boundary", "viewportOffset", "placement", "getViewport$2", "isWithin", "attach", "flip", "scrollArea", "getScrollArea", "applyOffset", "newPos", "flipAxis", "targetDim", "elOffset", "targetOffset", "moveBy", "dim", "getIntersectionArea", "commonScrollParents", "axis", "area", "positionA", "positionB", "flipAttach", "flipOffset", "flipAttachAxis", "newAttach", "util", "Class", "units", "countdown", "timespan", "getTimeSpan", "digits", "digit", "date", "total", "strats", "concatStrat", "parentVal", "childVal", "vm", "mergeFnData", "vm2", "defaultStrat", "mergeOptions", "child", "mixin", "mergeKey", "parseOptions", "options2", "option", "coerce$1", "toList", "listRe", "initUpdates", "instance", "prependUpdate", "update", "clearUpdateData", "callUpdate", "runUpdates", "events", "resize", "observe", "mutation", "lazyload", "preload", "el2", "isIntersecting", "handler", "scroll$1", "toScrollTargets", "swipe", "e2", "swipeDirection", "observe2", "emit", "Margin", "$el", "getRows", "rows", "row", "sorted", "withOffset", "getOffset", "offsetCurrent", "j", "offsetCurrent2", "offsetWidth", "slide", "action", "awaitFrame", "currentProps", "getProps$1", "targetProps", "targetStyle", "targetPropsTo", "propsTo", "propsFrom", "getTransitionProps", "attrsTo", "transitions", "resetProps", "opacity", "getPositionWithMargin", "from", "clsLeave", "clsEnter", "fade", "stagger", "transitionIndex", "propsIn", "propsOut", "wrapIndexFn", "leaveFn", "getTransitionNodes", "enterFn", "oldHeight", "newHeight", "transitionNodes", "awaitTimeout", "waitTransitionend", "timeout", "Animate", "keyMap", "filter", "attrItem", "toggles", "actives", "toggle", "button", "findButton", "list", "prevState", "newState", "mergeState", "isEqualState", "state", "animate", "matchFilter", "filterFn", "applyState", "getFilter", "attr2", "stateA", "stateB", "sort", "order", "sortItems", "group", "stateFilter", "stateSort", "stateOrder", "prevented", "preventBackgroundScroll", "offMove", "clientHeight", "Container", "Togglable", "transition", "show", "promise", "toggleInstant", "toggleTransition", "toggleAnimation", "done", "toggled", "changed", "_toggle", "velocity", "mode", "startProp", "dimProp", "marginProp", "marginStartProp", "currentDim", "inProgress", "prevProps", "currentMargin", "marginStart", "endDim", "wrapper", "endProps", "cmp", "active$1", "Modal", "selPanel", "bgClose", "selClose", "defaultPrevented", "modal", "handlers", "preventBackgroundFocus", "listenForBackgroundClose$1", "listenForEscClose$1", "animate$1", "transitionElement", "toMs", "time", "newTarget", "Animations$2", "translate", "translated", "scale3d", "Transitioner$1", "easing", "withResolvers", "percent2", "linear", "triggerUpdate", "props2", "I18n", "params", "_c", "SliderAutoplay", "autoplay", "pointerOptions", "pointerUpOptions", "pointerDown", "pointerMove", "pointerUp", "preventClick", "SliderDrag", "selList", "hasSelectableText", "distance", "slides", "prevIndex", "dis", "nextIndex", "getDistance", "edge", "itemShown", "dirChange", "initWatches", "watches", "watch", "registerWatch", "runWatches", "values", "immediate", "initComputed", "computed", "registerComputed", "mutationOptions", "_computed", "$props", "initComputedUpdates", "resetComputed", "disconnectComputedUpdates", "initEvents", "registerEvent", "unbindEvents", "unbind", "capture", "passive", "initObservers", "registerObservable", "registerObserver", "disconnectObservers", "observable", "targets2", "updateTargets", "initProps", "$options", "getProps", "methods", "opts", "data$1", "getAttributes", "attributes", "initPropsObserver", "records", "attributeName", "callHook", "hook", "callConnected", "callDisconnected", "uid", "init$1", "normalizeData", "initData", "initMethods", "data2", "App", "PREFIX", "DATA", "components$2", "component", "createComponent", "opt", "Component", "init", "getComponent", "getComponents", "attachToElement", "detachFromElement", "globalApi", "plugin", "component2", "Super", "Sub", "parentEl", "updateElement", "components", "instanceApi", "removeEl", "generateId", "SliderNav", "selNav", "nav", "items", "ariaLabel", "ariaControls", "selNavItem", "parallax", "keyCode", "active", "easeOutQuad", "easeOutQuart", "Slider", "speedUp", "stack", "queueIndex", "reset", "getDirection", "transitioner", "Slideshow", "Animations2", "Animations$1", "LightboxPanel", "close", "closeLabel", "src", "alt", "poster", "attrs", "iframeAttrs", "img", "createEl", "video", "content", "tag", "lightbox", "install$3", "toItem", "source", "UIkit", "Lightbox", "notification", "install$2", "posClass", "containerAttr", "margin", "removeFn", "Media", "media", "toMedia", "getMaxPathLength", "stroke", "transformFn", "colorFn", "cssPropFn", "strokeFn", "backgroundFn", "keys", "Parallax", "fillObject", "properties", "stops", "css2", "getUnit", "transformFn2", "stop", "parseStops", "getValue", "getCssValue", "parseColor", "getStop", "color", "bgProps", "backgroundCoverFn", "positions", "getBackgroundPos", "setBackgroundPosFn", "dimImage", "getBackgroundImageDimensions", "dimEl", "down", "overflow", "loading", "image", "toDimensions", "nullIndex", "leftPercent", "targetPercent", "unitRe", "defaultUnit", "keys2", "getOffsetElement", "viewport2", "SliderParallax", "parallaxTarget", "slidePercent", "triggerShow", "triggerShown", "triggerHide", "triggerHidden", "useTriggers", "clsSlideActive", "SliderReactive", "SliderPreload", "Transitioner", "center", "getLeft", "to", "getWidth", "itemIn", "itemOut", "isActive", "isIn", "isOut", "translateIn", "getElLeft", "nextActives", "inView", "temp", "centerEl", "getMax", "listLeft", "listWidth", "listRight", "slideLeft", "slideRight", "slider", "isFinite", "lft", "enabled", "sets", "slideWidth", "avgWidth", "slideIndex", "currentIndex", "activeClasses", "focusable", "currentLeft", "scrollDist", "slideDist", "getMaxElWidth", "listHalf", "slidesInView", "nextSlide", "slide2", "sliderParallax", "getCurrentPercent", "Animations", "slideshow", "sortable", "handle", "handles", "placeholder", "findTarget", "previous", "insertTarget", "findInsertTarget", "appendDrag", "trackScroll", "throttle", "untrackScroll", "clsPlaceholder", "clsItem", "sortable2", "trackTimer", "height2", "clone", "sameList", "isHorizontal", "placeholderRect", "sameRow", "linesIntersect", "pointerPos", "lengthProp", "endProp", "single", "isHorizontal2", "rectA", "rectB", "lineA", "lineB", "throttled", "Position", "restoreScrollPosition", "storeScrollPosition", "elDim", "tooltip", "makeFocusable", "delay", "title", "parseProps", "titleAttr", "align", "getAlignment", "upload", "transfer", "files", "file", "match$1", "chunks", "chunk", "files2", "xhr", "ajax", "env", "xhr2", "pattern", "size", "url", "send", "header", "components$1", "boot", "connect", "applyChildListMutation", "applyAttributeMutation", "addedNodes", "removedNodes", "disconnect", "getComponentName", "components2", "Accordion", "isOpen", "hide", "keepScrollPosition", "activeItems", "hide2", "transition2", "currentHeight", "endHeight", "frame", "alert", "Video", "isPlaying", "videoEl", "cover", "getPositionedParent", "useObjectFit", "intrinsic", "coverHeight", "coverWidth", "coverDim", "drop", "boundaryX", "boundaryY", "targetX", "targetY", "createToggleComponent", "listenForResize", "listenForEscClose", "listenForBackgroundClose", "listenForScroll", "listenForScrollClose", "viewports", "getViewport$1", "maxWidth", "positionOffset", "Dropnav", "dropbarAnchor", "dropbar", "clsDrop", "dropdowns", "active2", "handleNavItemNavigation", "dropContainer", "adjustHeight", "maxBottom", "formCustom", "input", "grid", "parallaxJustify", "masonry", "positionedAbsolute", "gutter", "getGutter", "columns", "translates", "applyMasonry", "transpose", "columnHeights", "column", "scrollColumns", "parallaxStart", "parallaxEnd", "hgt", "padding", "scrolled", "rowHeights", "push", "heightMatch", "elements2", "heights", "getHeight", "heightPlaceholder", "heightViewport", "expand", "minHeight", "box", "offsetTopEl", "closeIcon", "closeLarge", "dropParentIcon", "marker", "navParentIconLarge", "navParentIcon", "navbarParentIcon", "navbarToggleIcon", "overlayIcon", "paginationNext", "paginationPrevious", "searchIcon", "searchLarge", "searchMedium", "slidenavNextLarge", "slidenavNext", "slidenavPreviousLarge", "slidenavPrevious", "spinner", "totop", "Svg", "svg", "insertSVG", "applyWidthAndHeight", "root", "equals", "viewBox", "applyAttributes", "applyAnimation", "parseSVG", "loadSVG", "icon", "parseSymbols", "stringToSvg", "symbolRe", "symbols", "string", "icons", "Icon", "install$1", "getIcon", "IconComponent", "NavParentIcon", "Search", "isToggle", "label", "Spinner", "ButtonComponent", "Slidenav", "NavbarToggleIcon", "Close", "Marker", "Totop", "PaginationNext", "PaginationPrevious", "added", "svg2", "name2", "aliases", "applyRtl", "isImg", "setSrcAttrs", "getImageFromElement", "parentNode", "setSourceProps", "srcProps", "sourceEl", "sources", "wrapInPicture", "parseSources", "picture", "inverse", "findTargetColor", "checkVisibility", "leader", "fill", "install", "dialog", "message", "openDialog", "i18n", "tmpl", "hideFn", "submitFn", "clsNavbarTransparent", "navbar", "justify", "containers", "awaitMacroTask", "offcanvas", "clsFlip", "overlay", "clsOverlay", "clsMode", "clsSidebarAnimation", "clsContainerAnimation", "swiping", "suppressUserScale", "resumeUserScale", "getViewport", "overflowAuto", "selContainer", "selContent", "responsive", "registerClick", "unregisterClick", "instances", "clickHandler", "clsInView", "scrollspy", "inview", "removeAnimationClasses", "scrollspyNav", "closest", "links", "sticky", "selTarget", "coerce", "height$1", "preventTransition", "dynamicViewport", "maxScrollHeight", "referenceElement", "offset$1", "topOffset", "parseProp", "prevScroll", "prevDir", "overflowScroll", "scroll2", "isScrollUpdate", "initTimestamp", "below", "now", "offsetParentTop", "propOffset", "refElement", "clsTransitionDisable", "selDisabled", "Switcher", "connects", "connectChildren", "isVertical", "itemNav", "tab", "KEY_SPACE", "expanded", "m", "link", "mediaObj", "leaving", "isLeaving", "ok", "notOk", "undef", "NOT_TYPED_FUNCTION", "create", "isPlainObject", "x", "_types", "anyType", "typeMap", "typeList", "nConversions", "typed", "findType", "typeName", "type", "message", "name", "otherName", "addTypes", "types", "beforeSpec", "beforeIndex", "newTypes", "i", "affectedTypes", "clear", "clearConversions", "findTypeNames", "value", "matches", "isTypedFunction", "entity", "findSignature", "fn", "signature", "options", "exact", "stringSignature", "params", "parseSignature", "canonicalSignature", "stringifyParams", "match", "nParams", "remainingSignatures", "want", "filteredSignatures", "possibility", "have", "getParamAtIndex", "haveTypes", "paramTypeSet", "wtype", "candidate", "find", "convert", "conversions", "separator", "p", "parseParam", "param", "restParam", "typeDefs", "s", "hasAny", "paramName", "expandParam", "typeNames", "t", "matchingConversions", "availableConversions", "newName", "convertibleTypes", "conversion", "rawSignature", "rawParams", "parsedParam", "hasRestParam", "last", "compileTest", "test0", "test1", "tests", "compileTests", "initial", "varIndex", "lastTest", "testRestParam", "args", "index", "getTypeSetAtIndex", "isExactType", "mergeExpectedParams", "signatures", "typeSet", "paramSet", "createError", "err", "expected", "_name", "matchingSignatures", "nextMatchingDefs", "test", "actualTypes", "lengths", "maxLength", "argTypes", "getLowestTypeIndex", "min", "getLowestConversionIndex", "compareParams", "param1", "param2", "typeDiff", "convDiff", "compareSignatures", "signature1", "signature2", "pars1", "pars2", "last1", "last2", "hasRest1", "hasRest2", "any1", "conv1", "par", "any2", "conv2", "lengthCriterion", "comparisons", "tc", "thisComparison", "c", "t1", "t2", "knownTypes", "newMatch", "compileArgsPreprocessing", "fnConvert", "compiledConversions", "compileArgConversion", "fnPreprocess", "offset", "slice", "conversion0", "conversion1", "arg", "splitParams", "_splitParams", "paramsSoFar", "resultingParams", "exactTypes", "flatMap", "nextParam", "conflicting", "params1", "params2", "ii", "typeSet1", "typeSet2", "overlap", "len1", "len2", "restParam1", "restParam2", "clearResolutions", "functionList", "isReferToSelf", "referToSelf", "isReferTo", "makeReferTo", "collectResolutions", "references", "signatureMap", "resolvedReferences", "reference", "resolution", "resolveReferences", "self", "resolvedFunctions", "isResolved", "leftUnresolved", "nothingResolved", "validateDeprecatedThis", "signaturesMap", "deprecatedThisRegex", "createTypedFunction", "rawSignaturesMap", "parsedParams", "originalFunctions", "preliminarySignatures", "pp", "functionIndex", "conversionParams", "sp", "spName", "theTypedFn", "internalSignatureMap", "ok0", "ok1", "ok2", "ok3", "ok4", "ok5", "allOk", "test00", "test10", "test20", "test30", "test40", "test50", "test01", "test11", "test21", "test31", "test41", "test51", "fn0", "fn1", "fn2", "fn3", "fn4", "fn5", "len0", "len3", "len4", "len5", "iStart", "iEnd", "fns", "generic", "arg0", "arg1", "_onMismatch", "arr", "start", "end", "findInArray", "callback", "referTo", "objectOrFn", "checkName", "nameSoFar", "getObjectName", "obj", "key", "mergeSignatures", "dest", "source", "saveTyped", "maybeName", "named", "allSignatures", "item", "theseSignatures", "thisName", "beforeObjectTest", "before", "_validateConversion", "to", "existing", "other", "existingConversion", "tf", "argList", "sigs", "typedFunction", "require_complex", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "root", "cosh", "x", "sinh", "cosm1", "b", "xx", "hypot", "y", "a", "parser_exit", "logHypot", "_a", "_b", "parse", "z", "Complex", "tokens", "plus", "minus", "i", "c", "abs", "d", "t", "arg", "loh", "r", "re", "im", "tmp", "t1", "t2", "res", "noIM", "oneMinus", "onePlus", "temp", "places", "ret", "require_naturalSort", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "naturalSort", "a", "b", "re", "sre", "dre", "hre", "ore", "i", "s", "x", "y", "xN", "yN", "xD", "yD", "oFxNcL", "oFyNcL", "cLoc", "numS", "require_dist", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "_extends", "target", "i", "source", "key", "defaultEscapes", "formatEscapes", "defaultEscapeMapFn", "str", "_ref", "_ref$preserveFormatti", "preserveFormatting", "_ref$escapeMapFn", "escapeMapFn", "runningStr", "result", "escapes", "escapeKeys", "_loop", "specialCharFound", "index", "require_alea", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "Alea", "seed", "me", "mash", "Mash", "t", "copy", "f", "impl", "opts", "xg", "state", "prng", "n", "data", "i", "h", "require_xor128", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "XorGen", "seed", "me", "strseed", "t", "k", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xorwow", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "XorGen", "seed", "me", "strseed", "t", "k", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xorshift7", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "XorGen", "seed", "me", "X", "i", "t", "v", "w", "init", "j", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xor4096", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "XorGen", "seed", "me", "w", "X", "i", "t", "v", "init", "j", "limit", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_tychei", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "XorGen", "seed", "me", "strseed", "b", "c", "d", "a", "k", "copy", "f", "t", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "empty_exports", "__export", "empty_default", "init_empty", "__esmMin", "init_dirname", "init_buffer", "init_process", "require_seedrandom", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "pool", "math", "width", "chunks", "digits", "rngname", "startdenom", "significance", "overflow", "mask", "nodecrypto", "seedrandom", "seed", "options", "callback", "key", "shortseed", "mixkey", "flatten", "tostring", "autoseed", "arc4", "ARC4", "prng", "n", "d", "x", "is_math_call", "state", "copy", "t", "keylen", "me", "i", "j", "s", "count", "r", "f", "obj", "depth", "result", "typ", "prop", "stringseed", "smear", "out", "browser", "plugins", "a", "require_seedrandom", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "alea", "xor128", "xorwow", "xorshift7", "xor4096", "tychei", "sr", "require_tiny_emitter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "E", "name", "callback", "ctx", "e", "self", "listener", "data", "evtArr", "i", "len", "evts", "liveEvents", "require_jstat", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "window", "factory", "jStat", "Math", "undefined", "concat", "slice", "toString", "calcRdx", "n", "m", "val", "isArray", "arg", "isFunction", "isNumber", "num", "toVector", "arr", "args", "i", "fn", "obj", "j", "index", "submat", "ind", "column", "a", "nrow", "res", "row", "objArr", "rows", "cols", "func", "toAlter", "ncol", "col", "retZero", "retOne", "retIdent", "size", "min", "max", "length", "hival", "step", "current", "cnt", "start", "end", "rl", "_slice", "list", "rcSlice", "colSlice", "rowSlice", "A", "B", "nl", "ml", "diagArray", "mat", "t", "jProto", "funcs", "passfunc", "self", "results", "ascNum", "b", "clip", "sum", "mean", "tmp", "prod", "low", "high", "hash", "_arr", "logs", "meanOfLogs", "arrlen", "diffs", "arrLen", "distinctNumbers", "numberCounts", "number", "sortedDistinctNumbers", "numberRanks", "currentRank", "count", "first", "last", "rank", "maxCount", "numMaxCount", "mode_arr", "flag", "sumsqerr", "samples", "dev", "median", "quantilesArray", "alphap", "betap", "sortedArray", "quantileVals", "p", "aleph", "k", "gamma", "exclusive", "realIndex", "frac", "score", "kind", "counter", "len", "strict", "value", "binCnt", "binWidth", "bins", "arr1", "arr2", "u", "v", "arr1Len", "sq_dev", "mu", "sigma", "skewSum", "fullbool", "tmpthis", "callbackFunction", "argsToPass", "curriedFunction", "vector", "x", "cof", "ser", "xx", "y", "x0", "x2", "xp", "gl", "gl0", "q", "fact", "xden", "xnum", "z", "yi", "aln", "ap", "del", "c", "d", "h", "ITMAX", "an", "fpmin", "qab", "qap", "qam", "m2", "aa", "a1", "EPS", "gln", "err", "pp", "lna1", "afac", "isneg", "dd", "ty", "b1", "lna", "lnb", "al", "w", "bt", "shape", "oalph", "a2", "newthis", "vals", "fnfunc", "alpha", "beta", "df1", "df2", "f", "x1", "local", "scale", "dof", "rate", "ncp", "tol", "min_iterations", "flip", "prob", "lastvalue", "std", "dof2", "betinc", "eps", "a0", "b0", "m9", "c9", "betacdf", "s", "r", "N", "scaledPDF", "samplesDone", "scaledCDF", "factor", "l", "sumarr", "L", "lam", "U", "V", "slam", "loglam", "invalpha", "vr", "us", "laplaceSign", "tukeyWprob", "rr", "cc", "nleg", "ihalf", "C1", "C2", "C3", "bb", "wlar", "wincr1", "wincr2", "xleg", "aleg", "qsqz", "pr_w", "wincr", "blb", "binc", "bub", "einsum", "cc1", "wi", "elsum", "jj", "ac", "qexpo", "pplus", "pminus", "rinsum", "tukeyQinv", "p0", "q0", "p1", "q1", "p2", "q2", "p3", "q3", "p4", "q4", "c1", "c2", "c3", "c4", "c5", "vmax", "ps", "nmeans", "df", "nlegq", "ihalfq", "eps1", "eps2", "dhaf", "dquar", "deigh", "dlarg", "ulen1", "ulen2", "ulen3", "ulen4", "xlegq", "alegq", "f2", "f2lf", "f21", "ff4", "ulen", "ans", "otsum", "twa1", "t1", "wprb", "rotsum", "maxiter", "valx0", "valx1", "iter", "xabs", "push", "isUsable", "nrescols", "rescols", "left", "right", "nnorm", "newarr", "result", "det", "determinant", "submatrix", "sign", "maug", "pivot", "temp", "y2", "maxrow", "parts", "matrix_mode", "R", "T", "xv", "xk", "range", "qr2", "R_I", "I", "Aj", "cAi", "Ij", "cIi", "qr_solve", "array_mode", "QR", "Q", "attrs", "Q1", "R1", "RI", "Q2", "condition", "e", "ev", "maxim", "theta", "t_j", "u_j", "order", "k1", "k2", "u_j1", "k3", "k4", "h1", "g", "X", "pos", "h_min", "y1", "F", "dF", "dl", "temp1", "D", "temp2", "Y", "Bt", "C", "Vt", "sides", "zscore", "tscore", "expVar", "sample", "sampMean", "sampSampMean", "tmpargs", "unexpVar", "anovafscore", "fscore", "mean1", "mean2", "n1", "n2", "sd", "qscore", "arrays", "means", "change", "pvalue", "differenceOfProportions", "pooled", "se", "sub_regress", "exog", "var_count", "modelList", "endog_index", "exog_index", "ols", "endog", "nobs", "df_model", "df_resid", "coef", "predict", "resid", "ybar", "SSE", "SSR", "SST", "R2", "t_test", "model", "subModelList", "sigmaHat", "seBetaHat", "mod", "tStatistic", "pValue", "leftppf", "interval95", "F_test", "F_statistic", "fcdf", "ols_wrap", "ttest", "ftest", "adjust_R2", "matrixRows", "array", "jMat", "pass", "jMatX", "jMatY", "innerinv", "xtransp", "next", "compile", "jMatYBar", "yAverage", "covar", "sds", "ts", "inner", "yBar", "ssr", "sse", "sst", "require_bessel", "__commonJSMin", "exports", "init_dirname", "init_buffer", "init_process", "BESSEL", "factory", "module", "M", "_horner", "arr", "v", "i", "z", "_bessel_iter", "x", "n", "f0", "f1", "sign", "tdx", "f2", "o", "_bessel_wrap", "bessel0", "bessel1", "name", "nonzero", "b0", "b1", "besselj", "W", "b0_a1a", "b0_a2a", "b0_a1b", "b0_a2b", "a", "a1", "a2", "y", "xx", "b1_a1a", "b1_a2a", "b1_a1b", "b1_a2b", "ret", "m", "jsum", "bjp", "sum", "bj", "bjm", "tox", "j", "bessely", "besseli", "b0_a", "b0_b", "b1_a", "b1_b", "bip", "bi", "bim", "besselk", "require_codemirror", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "factory", "userAgent", "platform", "gecko", "ie_upto10", "ie_11up", "edge", "ie", "ie_version", "webkit", "qtwebkit", "chrome", "chrome_version", "presto", "safari", "mac_geMountainLion", "phantom", "ios", "android", "mobile", "mac", "chromeOS", "windows", "presto_version", "flipCtrlCmd", "captureRightClick", "classTest", "cls", "rmClass", "node", "current", "match", "after", "removeChildren", "e", "count", "removeChildrenAndAdd", "parent", "elt", "tag", "content", "className", "style", "i", "eltP", "range", "start", "end", "endNode", "r", "contains", "child", "activeElt", "rootNode", "doc", "activeElement", "addClass", "joinClasses", "a", "b", "as", "selectInput", "cm", "root", "element", "win", "bind", "f", "args", "copyObj", "obj", "target", "overwrite", "prop", "countColumn", "string", "tabSize", "startIndex", "startValue", "n", "nextTab", "Delayed", "self", "ms", "time", "indexOf", "array", "scrollerGap", "Pass", "sel_dontScroll", "sel_mouse", "sel_move", "findColumn", "goal", "pos", "col", "skipped", "spaceStrs", "spaceStr", "lst", "arr", "map", "out", "insertSorted", "value", "score", "priority", "nothing", "createObj", "base", "props", "inst", "nonASCIISingleCaseWordChar", "isWordCharBasic", "ch", "isWordChar", "helper", "isEmpty", "extendingChars", "isExtendingChar", "skipExtendingChars", "str", "dir", "findFirst", "pred", "from", "to", "midF", "mid", "iterateBidiSections", "order", "found", "part", "bidiOther", "getBidiPartAt", "sticky", "cur", "bidiOrdering", "lowTypes", "arabicTypes", "charType", "code", "bidiRE", "isNeutral", "isStrong", "countsAsLeft", "countsAsNum", "BidiSpan", "level", "direction", "outerType", "len", "types", "i$1", "prev", "type", "i$2", "type$1", "i$3", "prev$1", "type$2", "i$4", "type$3", "replace", "j", "i$5", "cur$1", "type$4", "i$6", "end$1", "before", "replace$1", "j$1", "m", "i$7", "at", "isRTL", "j$2", "nstart", "getOrder", "line", "noHandlers", "on", "emitter", "getHandlers", "off", "index", "signal", "handlers", "signalDOMEvent", "override", "e_defaultPrevented", "signalCursorActivity", "set", "hasHandler", "eventMixin", "ctor", "e_preventDefault", "e_stopPropagation", "e_stop", "e_target", "e_button", "dragAndDrop", "div", "zwspSupported", "zeroWidthElement", "measure", "test", "badBidiRects", "hasBadBidiRects", "txt", "r0", "r1", "splitLinesAuto", "result", "l", "nl", "rt", "hasSelection", "te", "hasCopyEvent", "badZoomedRects", "hasBadZoomedRects", "normal", "fromRange", "modes", "mimeModes", "defineMode", "name", "mode", "defineMIME", "mime", "spec", "resolveMode", "getMode", "options", "mfactory", "modeObj", "modeExtensions", "exts", "prop$1", "extendMode", "properties", "copyState", "state", "nstate", "val", "innerMode", "info", "startState", "a1", "a2", "StringStream", "lineOracle", "ok", "pattern", "consume", "caseInsensitive", "cased", "substr", "inner", "oracle", "getLine", "chunk", "sz", "getBetween", "text", "getLines", "updateLineHeight", "height", "diff", "lineNo", "no", "lineAtHeight", "h", "outer", "lh", "isLine", "lineNumberFor", "Pos", "cmp", "equalCursorPos", "copyPos", "x", "maxPos", "minPos", "clipLine", "clipPos", "last", "clipToLen", "linelen", "clipPosArray", "SavedContext", "lookAhead", "Context", "saved", "copy", "highlightLine", "context", "forceToEnd", "st", "lineClasses", "runMode", "loop", "o", "overlay", "i_end", "getLineStyles", "updateFrontier", "getContextBefore", "resetState", "precise", "display", "findStartLine", "processLine", "startAt", "stream", "callBlankLine", "readToken", "Token", "takeToken", "asArray", "tokens", "extractLineClasses", "output", "lineClass", "flattenSpans", "curStart", "curStyle", "mName", "minindent", "minline", "lim", "search", "indented", "retreatFrontier", "sawReadOnlySpans", "sawCollapsedSpans", "seeReadOnlySpans", "seeCollapsedSpans", "MarkedSpan", "marker", "getMarkedSpanFor", "spans", "span", "removeMarkedSpan", "addMarkedSpan", "op", "inThisOp", "markedSpansBefore", "old", "startCh", "isInsert", "nw", "startsBefore", "endsAfter", "markedSpansAfter", "endCh", "stretchSpansOverChange", "change", "oldFirst", "oldLast", "first", "sameLine", "offset", "span$1", "found$1", "clearEmptySpans", "newMarkers", "gap", "gapMarkers", "removeReadOnlyRanges", "markers", "mark", "parts", "mk", "p", "newParts", "dfrom", "dto", "detachMarkedSpans", "attachMarkedSpans", "extraLeft", "extraRight", "compareCollapsedMarkers", "lenDiff", "aPos", "bPos", "fromCmp", "toCmp", "collapsedSpanAtSide", "sps", "sp", "collapsedSpanAtStart", "collapsedSpanAtEnd", "collapsedSpanAround", "conflictingCollapsedRange", "visualLine", "merged", "visualLineEnd", "visualLineContinued", "lines", "visualLineNo", "lineN", "vis", "visualLineEndNo", "lineIsHidden", "lineIsHiddenInner", "heightAtLine", "lineObj", "lineLength", "findMaxLine", "Line", "markedSpans", "estimateHeight", "updateLine", "estHeight", "cleanUpLine", "styleToClassCache", "styleToClassCacheWithMode", "interpretTokenStyle", "cache", "buildLineContent", "lineView", "builder", "buildToken", "buildTokenBadBidi", "allowFrontierUpdate", "insertLineContent", "defaultSpecialCharPlaceholder", "token", "startStyle", "endStyle", "css", "attributes", "displayText", "splitSpaces", "special", "mustWrap", "txt$1", "tabWidth", "fullStyle", "attr", "trailingBefore", "spaceBefore", "buildCollapsedSpan", "size", "ignoreWidget", "widget", "styles", "allText", "nextChange", "spanStyle", "spanEndStyle", "spanStartStyle", "collapsed", "foundBookmarks", "endStyles", "upto", "tokenText", "LineView", "buildViewArray", "nextPos", "view", "operationGroup", "pushOperation", "fireCallbacksForOps", "group", "callbacks", "finishOperation", "endCb", "orphanDelayedCallbacks", "signalLater", "list", "fireOrphanDelayed", "delayed", "updateLineForChanges", "dims", "updateLineText", "updateLineGutter", "updateLineClasses", "updateLineWidgets", "ensureLineWrapped", "updateLineBackground", "wrap", "getLineContent", "ext", "built", "textClass", "wrap$1", "gutterWrap", "k", "id", "isWidget", "next", "insertLineWidgets", "buildLineElement", "insertLineWidgetsFor", "allowAbove", "ws", "positionLineWidget", "width", "widgetHeight", "parentStyle", "eventInWidget", "paddingTop", "paddingVert", "paddingH", "data", "scrollGap", "displayWidth", "displayHeight", "ensureLineHeights", "rect", "wrapping", "curWidth", "heights", "rects", "mapFromLineView", "updateExternalMeasurement", "measureChar", "bias", "measureCharPrepared", "prepareMeasureForLine", "findViewForLine", "findViewIndex", "getDimensions", "prepared", "varHeight", "key", "measureCharInner", "nullRect", "nodeAndOffsetInLineMap", "collapse", "mStart", "mEnd", "getUsefulRect", "place", "maybeUpdateRectForZooming", "rSpan", "charWidth", "rtop", "rbot", "top", "bot", "scaleX", "scaleY", "clearLineMeasurementCacheFor", "clearLineMeasurementCache", "clearCaches", "pageScrollX", "pageScrollY", "widgetTopHeight", "ref", "widgets", "intoCoordSystem", "includeWidgets", "yOff", "lOff", "xOff", "fromCoordSystem", "coords", "left", "localBox", "lineSpaceBox", "charCoords", "cursorCoords", "preparedMeasure", "get", "right", "getBidi", "partPos", "invert", "other", "estimateCoords", "PosWithInfo", "outside", "xRel", "coordsChar", "y", "coordsCharInner", "rangeEnd", "wrappedLineExtent", "begin", "wrappedLineExtentChar", "targetTop", "boxIsAfter", "box", "ltr", "coordsBidiPartWrapped", "coordsBidiPart", "chAround", "boxAround", "baseX", "atLeft", "atStart", "_lineNo", "closestDist", "endX", "dist", "measureText", "textHeight", "anchor", "pre", "gutterLeft", "compensateForHScroll", "th", "perLine", "widgetsHeight", "estimateLineHeights", "est", "posFromMouse", "liberal", "forRect", "space", "colDiff", "regChange", "lendiff", "resetView", "cut", "viewCuttingPoint", "cut$1", "cutTop", "cutBot", "regLineChange", "oldN", "newN", "adjustView", "countDirtyView", "dirty", "updateSelection", "prepareSelection", "primary", "curFragment", "selFragment", "customCursor", "head", "drawSelectionCursor", "drawSelectionRange", "cursor", "charPos", "otherCursor", "cmpCoords", "fragment", "padding", "leftSide", "rightSide", "docLTR", "add", "bottom", "drawForLine", "fromArg", "toArg", "lineLen", "wrapX", "side", "extent", "fromPos", "toPos", "openStart", "openEnd", "openLeft", "openRight", "topLeft", "topRight", "botLeft", "botRight", "sFrom", "sTo", "fromLine", "toLine", "singleVLine", "leftEnd", "rightStart", "restartBlink", "onBlur", "ensureFocus", "onFocus", "delayBlurEvent", "updateHeightsInViewport", "prevBottom", "viewTop", "oldHeight", "mustScroll", "updateWidgetHeight", "chWidth", "w", "visibleLines", "viewport", "ensureFrom", "ensureTo", "maybeScrollWindow", "doScroll", "scrollNode", "scrollPosIntoView", "margin", "limit", "changed", "endCoords", "scrollPos", "calculateScrollPos", "startTop", "startLeft", "updateScrollTop", "setScrollLeft", "scrollIntoView", "snapMargin", "screentop", "screen", "docBottom", "atTop", "atBottom", "newTop", "gutterSpace", "screenleft", "screenw", "tooWide", "addToScrollTop", "resolveScrollToPos", "ensureCursorVisible", "scrollToCoords", "scrollToRange", "scrollToCoordsRange", "sPos", "updateDisplaySimple", "setScrollTop", "startWorker", "forceScroll", "isScroller", "alignHorizontally", "measureForScrollbars", "gutterW", "docH", "NativeScrollbars", "scroll", "vert", "horiz", "needsH", "needsV", "sWidth", "totalHeight", "totalWidth", "bar", "delay", "maybeDisable", "NullScrollbars", "updateScrollbars", "startWidth", "startHeight", "updateScrollbarsInner", "d", "sizes", "scrollbarModel", "initScrollbars", "axis", "nextOpId", "startOperation", "endOperation", "endOperations", "ops", "endOperation_R1", "endOperation_W1", "endOperation_R2", "endOperation_W2", "endOperation_finish", "maybeClipScrollbars", "DisplayUpdate", "updateDisplayIfNeeded", "takeFocus", "setDocumentHeight", "postUpdateDisplay", "hidden", "unhidden", "runInOp", "operation", "methodOp", "docMethodOp", "highlightWorker", "changedLines", "oldStyles", "highlighted", "oldCls", "newCls", "ischange", "force", "selectionSnapshot", "active", "sel", "restoreSelection", "snapshot", "update", "maybeUpdateLineNumberWidth", "different", "toUpdate", "selSnapshot", "patchDisplay", "barMeasure", "updateNumbersFrom", "lineNumbers", "container", "rm", "updateNumber", "updateGutterSpace", "comp", "align", "innerW", "getGutters", "gutters", "sawLineNumbers", "renderGutters", "specs", "gElt", "updateGutters", "Display", "input", "wheelSamples", "wheelPixelsPerUnit", "wheelEventDelta", "dx", "dy", "wheelEventPixels", "delta", "onScrollWheel", "pixelsPerUnit", "canScrollX", "canScrollY", "pixels", "movedX", "movedY", "sample", "Selection", "ranges", "primIndex", "here", "there", "Range", "normalizeSelection", "mayTouch", "prim", "inv", "simpleSelection", "changeEnd", "adjustForChange", "computeSelAfterChange", "offsetPos", "computeReplacedSel", "changes", "hint", "oldPrev", "newPrev", "loadMode", "resetModeState", "isWholeLineUpdate", "updateDoc", "spansFor", "linesFor", "firstLine", "lastLine", "lastText", "lastSpans", "nlines", "added", "added$1", "added$2", "linkedDocs", "sharedHistOnly", "propagate", "skip", "sharedHist", "rel", "shared", "attachDoc", "setDirectionClass", "directionChanged", "History", "historyChangeFromChange", "histChange", "attachLocalSpans", "clearSelectionEvents", "lastChangeEvent", "hist", "addChangeToHistory", "selAfter", "opId", "pushSelectionToHistory", "selectionEventCanBeMerged", "origin", "addSelectionToHistory", "dest", "existing", "removeClearedSpans", "getOldSpans", "mergeOldSpans", "stretched", "oldCur", "stretchCur", "copyHistoryArray", "events", "newGroup", "instantiateSel", "event", "newChanges", "extendRange", "extend", "posBefore", "extendSelection", "setSelection", "extendSelections", "heads", "newSel", "replaceOneSelection", "setSimpleSelection", "filterSelectionChange", "setSelectionReplaceHistory", "done", "setSelectionNoUndo", "setSelectionInner", "skipAtomicInSelection", "reCheckSelection", "mayClear", "newAnchor", "skipAtomic", "newHead", "skipAtomicInner", "oldPos", "preventCursorLeft", "preventCursorRight", "near", "movePos", "far", "selectAll", "filterChange", "makeChange", "ignoreReadOnly", "split", "makeChangeInner", "makeChangeSingleDoc", "rebased", "rebaseHist", "makeChangeFromHistory", "allowSelectionOnly", "suppress", "source", "antiChanges", "filter", "returned", "shiftDoc", "distance", "shift", "makeChangeSingleDocInEditor", "recomputeMaxLength", "checkWidthStart", "changesHandler", "changeHandler", "replaceRange", "assign", "rebaseHistSelSingle", "rebaseHistArray", "sub", "changeLine", "handle", "changeType", "LeafChunk", "BranchChunk", "children", "remaining", "leaf", "me", "spilled", "sibling", "myIndex", "used", "LineWidget", "opt", "adjustScrollWhenAboveVisible", "this$1", "oldH", "addLineWidget", "aboveVisible", "nextMarkerId", "TextMarker", "withOp", "min", "max", "visual", "dHeight", "markText", "markTextShared", "curLine", "updateMaxLine", "SharedTextMarker", "findSharedMarkers", "copySharedMarkers", "mFrom", "mTo", "subMark", "detachSharedMarkers", "linked", "subMarker", "nextDocId", "Doc", "lineSep", "dup", "undone", "forceSplit", "gen", "histData", "gutterID", "where", "realOpts", "sepSize", "copyHistory", "CodeMirror", "link", "splitIds", "lastDrop", "onDrop", "clearDragCursor", "files", "read", "markAsReadAndPasteIfAllFilesAreRead", "t", "readTextFromFile", "file", "reader", "text$1", "selected", "onDragStart", "img", "onDragOver", "frag", "forEachCodeMirror", "byClass", "editors", "globalsRegistered", "ensureGlobalHandlers", "registerGlobalHandlers", "resizeTimer", "onResize", "keyNames", "keyMap", "normalizeKeyName", "alt", "ctrl", "cmd", "mod", "normalizeKeyMap", "keymap", "keyname", "keys", "lookupKey", "getKeyMap", "isModifierKey", "addModifierNames", "noShift", "keyName", "deleteNearSelection", "compute", "kill", "toKill", "replaced", "moveCharLogically", "moveLogically", "endOfLine", "visually", "moveInStorageOrder", "prep", "moveVisually", "bidi", "mv", "getWrappedLineExtent", "searchInVisualLine", "getRes", "res", "nextCh", "commands", "leftPos", "rightPos", "lineStart", "lineStartSmart", "lineEnd", "spaces", "sels", "firstNonWS", "inWS", "doHandleBinding", "bound", "dropShift", "prevShift", "lookupKeyForEditor", "stopSeq", "dispatchKey", "seq", "dispatchKeyInner", "handleKeyBinding", "handleCharBinding", "lastStoppedKey", "onKeyDown", "handled", "showCrossHair", "lineDiv", "up", "onKeyUp", "onKeyPress", "keyCode", "charCode", "DOUBLECLICK_DELAY", "PastClick", "button", "lastClick", "lastDoubleClick", "clickRepeat", "now", "onMouseDown", "clickInGutter", "repeat", "handleMappedButton", "leftButtonDown", "configureMouse", "option", "behavior", "contained", "leftButtonStartDrag", "leftButtonSelect", "moved", "dragEnd", "mouseMove", "dragStart", "e2", "rangeForUnit", "unit", "ourRange", "ourIndex", "startSel", "lastPos", "extendTo", "startCol", "posCol", "oldRange", "ranges$1", "bidiSimplify", "editorSize", "counter", "curCount", "visible", "move", "anchorLine", "boundary", "headIndex", "usePart", "gutterEvent", "prevent", "mX", "mY", "lineBox", "g", "gutter", "onContextMenu", "contextMenuInGutter", "themeChanged", "Init", "defaults", "optionHandlers", "defineOptions", "deflt", "notOnInit", "newBreaks", "wrappingChanged", "integer", "dragDropChanged", "wasOn", "funcs", "toggle", "registerEventHandlers", "initHooks", "word", "touchFinished", "prevTouch", "finishTouch", "isMouseLikeTouchEvent", "touch", "farAway", "inp", "indentLine", "how", "aggressive", "curSpace", "curSpaceString", "indentation", "indentString", "pos$1", "lastCopied", "setLastCopied", "newLastCopied", "applyTextInput", "inserted", "deleted", "recent", "paste", "textLines", "multiPaste", "updateInput", "changeEvent", "triggerElectric", "handlePaste", "pasted", "copyableRanges", "lineRange", "disableBrowserMagic", "field", "spellcheck", "autocorrect", "autocapitalize", "hiddenTextarea", "addEditorMethods", "helpers", "maps", "overlays", "newRanges", "help", "vspace", "hspace", "amount", "findPosH", "goalColumn", "findPosV", "goals", "headPos", "startChar", "check", "scroller", "interpret", "phraseText", "phrases", "predicate", "origDir", "lineDir", "findNextLine", "moveOnce", "boundToLine", "astral", "sawType", "pageSize", "moveAmount", "ContentEditableInput", "belongsToInput", "onCopyCut", "kludge", "hadFocus", "label", "curAnchor", "domToPos", "curFocus", "posToDOM", "rng", "poll", "isInGutter", "fromIndex", "fromNode", "toIndex", "toNode", "newText", "domTextBetween", "oldText", "cutFront", "cutEnd", "oldTop", "maxCutFront", "newBot", "oldBot", "maxCutEnd", "chFrom", "chTo", "scan", "badPos", "bad", "closing", "extraLinebreak", "recognizeMarker", "close", "addText", "walk", "cmText", "markerID", "isBlock", "lineNode", "locateNodeInLineView", "wrapper", "textNode", "topNode", "find", "curNode", "dist$1", "TextareaInput", "prepareCopyCut", "_display", "opts", "wrapOff", "lineOff", "drawn", "typing", "missed", "prevInput", "same", "reset", "oldCSS", "oldWrapperCSS", "wrapperBox", "oldScrollY", "rehide", "prepareSelectAllHack", "extval", "mouseup", "fromTextArea", "textarea", "hasFocus", "save", "realSubmit", "form", "wrappedSubmit", "addLegacyProps", "dontDelegate", "method", "func", "require_javascript", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "config", "parserConfig", "indentUnit", "statementIndent", "jsonldMode", "jsonMode", "trackScope", "isTS", "wordRE", "keywords", "kw", "type", "A", "B", "C", "D", "operator", "atom", "isOperatorChar", "isJsonldKeyword", "readRegexp", "stream", "escaped", "next", "inSet", "content", "ret", "tp", "style", "cont", "tokenBase", "state", "ch", "tokenString", "tokenComment", "expressionAllowed", "tokenQuasi", "word", "quote", "maybeEnd", "brackets", "findFatArrow", "arrow", "m", "depth", "sawSomething", "pos", "bracket", "atomicTypes", "JSLexical", "indented", "column", "align", "prev", "info", "inScope", "varname", "v", "cx", "parseJS", "cc", "combinator", "expression", "statement", "pass", "i", "inList", "name", "list", "register", "newContext", "registerVarScoped", "Var", "context", "inner", "Context", "isModifier", "vars", "block", "defaultVars", "pushcontext", "pushblockcontext", "popcontext", "pushlex", "result", "indent", "outer", "poplex", "expect", "wanted", "exp", "value", "vardef", "parenExpr", "maybeexpression", "maybeelse", "functiondef", "forspec", "className", "enumdef", "typename", "typeexpr", "pattern", "maybelabel", "maybeCatchBinding", "afterExport", "afterImport", "funarg", "expressionInner", "expressionNoComma", "noComma", "body", "arrowBodyNoComma", "arrowBody", "commasep", "maybeop", "maybeoperatorNoComma", "maybeoperatorComma", "classExpression", "arrayLiteral", "contCommasep", "objprop", "quasi", "maybeTarget", "me", "expr", "property", "continueQuasi", "targetNoComma", "target", "maybeTypeArgs", "_", "getterSetter", "afterprop", "maybetype", "what", "end", "sep", "proceed", "lex", "maybetypeOrIn", "mayberettype", "isKW", "afterType", "typeprops", "typearg", "maybeReturnType", "quasiType", "typeprop", "functiondecl", "continueQuasiType", "typeparam", "maybeTypeDefault", "maybeAssign", "vardefCont", "eltpattern", "proppattern", "_type", "forspec1", "forspec2", "classNameAfter", "classBody", "classfield", "isInterface", "maybeFrom", "exportField", "importSpec", "maybeMoreImports", "maybeAs", "enummember", "isContinuedStatement", "textAfter", "backUp", "basecolumn", "firstChar", "lexical", "top", "c", "closing", "require_dialog", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "dialogDiv", "cm", "template", "bottom", "wrap", "dialog", "closeNotification", "newVal", "callback", "options", "closed", "me", "close", "inp", "button", "e", "evt", "callbacks", "buttons", "blurring", "i", "b", "doneTimer", "duration", "require_placeholder", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "cm", "val", "old", "prev", "onBlur", "onChange", "onComposition", "clearPlaceholder", "wrapper", "setPlaceholder", "elt", "placeHolder", "empty", "input", "isEmpty", "require_closebrackets", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "defaults", "Pos", "cm", "val", "old", "keyMap", "ensureBound", "getOption", "conf", "name", "handleBackspace", "handleEnter", "chars", "i", "ch", "key", "handler", "handleChar", "getConfig", "deflt", "mode", "pairs", "ranges", "around", "charsAround", "cur", "explode", "linesep", "moveSel", "line", "dir", "newRanges", "primary", "range", "pos", "contractSelection", "sel", "inverted", "closeBefore", "triples", "identical", "opening", "type", "curType", "next", "stringStartsAfter", "prev", "left", "right", "sels", "str", "token", "require_matchbrackets", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "ie_lt8", "Pos", "matching", "bracketRegex", "config", "findMatchingBracket", "cm", "where", "line", "pos", "afterCursor", "re", "match", "dir", "style", "found", "scanForBracket", "maxScanLen", "maxScanLines", "stack", "lineEnd", "lineNo", "end", "ch", "matchBrackets", "autoclear", "maxHighlightLen", "highlightNonMatching", "marks", "ranges", "i", "clear", "doMatchBrackets", "clearHighlighted", "val", "old", "oldConfig", "require_show_hint", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "HINT_ELEMENT_CLASS", "ACTIVE_HINT_ELEMENT_CLASS", "cm", "getHints", "options", "newOpts", "prop", "parseOptions", "selections", "i", "completion", "Completion", "self", "requestAnimationFrame", "fn", "cancelAnimationFrame", "data", "getText", "identStart", "pos", "line", "first", "myTick", "fetchHints", "picked", "Widget", "editor", "out", "defaultOptions", "buildKeyMap", "handle", "baseMap", "mac", "custom", "ourMap", "addBinding", "key", "val", "bound", "extra", "getHintElement", "hintsElement", "el", "widget", "ownerDocument", "parentWindow", "hints", "theme", "completions", "elt", "cur", "className", "container", "left", "top", "below", "offsetLeft", "offsetTop", "isContainerPositioned", "offsetParent", "offsetParentPosition", "bodyPosition", "winW", "winH", "box", "scrolls", "startScroll", "overlapY", "height", "spaceAbove", "overlapX", "node", "n", "avoidWrap", "closingOnBlur", "curScroll", "newTop", "point", "e", "t", "selectedHintRange", "input", "node1", "node2", "firstNode", "margin", "applicableHelpers", "helpers", "result", "hint", "callback", "resolveAutoHints", "words", "resolved", "app", "run", "token", "term", "from", "to", "found", "word", "require_jump_to_line", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "dialog", "cm", "text", "shortText", "deflt", "f", "getJumpDialog", "interpretLine", "string", "num", "cur", "posStr", "match", "line", "require_searchcursor", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "Pos", "regexpFlags", "regexp", "flags", "ensureFlags", "current", "target", "i", "maybeMultiline", "searchRegexpForward", "doc", "start", "line", "ch", "last", "string", "match", "searchRegexpForwardMultiline", "chunk", "curLine", "before", "inside", "startLine", "startCh", "lastMatchIn", "endMargin", "from", "newMatch", "end", "searchRegexpBackward", "first", "searchRegexpBackwardMultiline", "chunkSize", "doFold", "noFold", "str", "adjustPos", "orig", "folded", "pos", "foldFunc", "min", "max", "mid", "len", "searchStringForward", "query", "caseFold", "fold", "lines", "search", "found", "cutFrom", "endString", "lastLine", "searchStringBackward", "top", "topString", "SearchCursor", "options", "reverse", "head", "result", "newText", "origin", "ranges", "cur", "require_search", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "searchOverlay", "query", "caseInsensitive", "stream", "match", "SearchState", "getSearchState", "cm", "queryCaseInsensitive", "getSearchCursor", "pos", "persistentDialog", "text", "deflt", "onEnter", "onKeyDown", "clearSearch", "dialog", "shortText", "f", "confirmDialog", "fs", "parseString", "string", "ch", "parseQuery", "isRE", "startSearch", "state", "doSearch", "rev", "persistent", "immediate", "findNext", "q", "hiding", "searchNext", "event", "_", "to", "getQueryDialog", "keyName", "extra", "cmd", "callback", "cursor", "el", "tag", "attrs", "element", "key", "i", "child", "label", "getReplaceQueryDialog", "getReplacementQueryDialog", "getDoReplaceConfirm", "replaceAll", "replace", "all", "dialogText", "fragment", "advance", "start", "doReplace", "require_polyfills", "__commonJSMin", "init_dirname", "init_buffer", "init_process", "doc", "proto", "method", "native", "selectors", "id", "result", "constant_default", "x", "init_constant", "__esmMin", "init_dirname", "init_buffer", "init_process", "acos", "x", "pi", "asin", "halfPi", "abs", "atan2", "cos", "max", "min", "sin", "sqrt", "epsilon", "tau", "init_math", "__esmMin", "init_dirname", "init_buffer", "init_process", "append", "strings", "i", "n", "appendRound", "digits", "d", "k", "path", "Path", "pi", "tau", "epsilon", "tauEpsilon", "init_path", "__esmMin", "init_dirname", "init_buffer", "init_process", "x", "y", "x1", "y1", "x2", "y2", "r", "x0", "y0", "x21", "y21", "x01", "y01", "l01_2", "x20", "y20", "l21_2", "l20_2", "l21", "l01", "l", "t01", "t21", "a0", "a1", "ccw", "dx", "dy", "cw", "da", "w", "h", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_path", "withPath", "shape", "digits", "_", "d", "Path", "init_path", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "arcInnerRadius", "d", "arcOuterRadius", "arcStartAngle", "arcEndAngle", "arcPadAngle", "intersect", "x0", "y0", "x1", "y1", "x2", "y2", "x3", "y3", "x10", "y10", "x32", "y32", "t", "epsilon", "cornerTangents", "r1", "rc", "cw", "x01", "y01", "lo", "sqrt", "ox", "oy", "x11", "y11", "x00", "y00", "dx", "dy", "d2", "r", "D", "max", "cx0", "cy0", "cx1", "cy1", "dx0", "dy0", "dx1", "dy1", "arc_default", "innerRadius", "outerRadius", "cornerRadius", "constant_default", "padRadius", "startAngle", "endAngle", "padAngle", "context", "path", "withPath", "arc", "buffer", "r0", "a0", "halfPi", "a1", "da", "abs", "tau", "cos", "sin", "a01", "a11", "a00", "a10", "da0", "da1", "ap", "rp", "min", "rc0", "rc1", "t0", "t1", "p0", "asin", "p1", "oc", "pi", "ax", "ay", "bx", "by", "kc", "acos", "lc", "atan2", "a", "_", "init_arc", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_constant", "init_math", "init_path", "array_default", "x", "slice", "init_array", "__esmMin", "init_dirname", "init_buffer", "init_process", "Linear", "context", "linear_default", "init_linear", "__esmMin", "init_dirname", "init_buffer", "init_process", "x", "y", "x", "p", "y", "init_point", "__esmMin", "init_dirname", "init_buffer", "init_process", "line_default", "x", "y", "defined", "constant_default", "context", "curve", "linear_default", "output", "path", "withPath", "line", "data", "i", "n", "array_default", "d", "defined0", "buffer", "_", "init_line", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_constant", "init_linear", "init_path", "init_point", "area_default", "x0", "y0", "y1", "x1", "defined", "constant_default", "context", "curve", "linear_default", "output", "path", "withPath", "area", "x", "y", "data", "i", "j", "k", "n", "array_default", "d", "defined0", "buffer", "x0z", "y0z", "arealine", "line_default", "_", "init_area", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_constant", "init_linear", "init_line", "init_path", "init_point", "descending_default", "a", "b", "init_descending", "__esmMin", "init_dirname", "init_buffer", "init_process", "identity_default", "d", "init_identity", "__esmMin", "init_dirname", "init_buffer", "init_process", "pie_default", "value", "identity_default", "sortValues", "descending_default", "sort", "startAngle", "constant_default", "endAngle", "tau", "padAngle", "pie", "data", "i", "n", "array_default", "j", "k", "sum", "index", "arcs", "a0", "da", "a1", "p", "pa", "v", "_", "init_pie", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_constant", "init_descending", "init_identity", "init_math", "Radial", "curve", "curveRadial", "radial", "context", "curveRadialLinear", "init_radial", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_linear", "linear_default", "a", "r", "lineRadial", "l", "c", "_", "curveRadial", "lineRadial_default", "line_default", "curveRadialLinear", "init_lineRadial", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_radial", "init_line", "areaRadial_default", "a", "area_default", "curveRadialLinear", "c", "x0", "x1", "y0", "y1", "lineRadial", "_", "curveRadial", "init_areaRadial", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_radial", "init_area", "init_lineRadial", "pointRadial_default", "x", "y", "init_pointRadial", "__esmMin", "init_dirname", "init_buffer", "init_process", "bumpX", "context", "Bump", "bumpY", "bumpRadial", "BumpRadial", "init_bump", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_pointRadial", "x", "y", "p0", "pointRadial_default", "p1", "p2", "p3", "linkSource", "d", "linkTarget", "link", "curve", "source", "target", "x", "y", "context", "output", "path", "withPath", "buffer", "argv", "slice", "s", "t", "_", "constant_default", "linkHorizontal", "bumpX", "linkVertical", "bumpY", "linkRadial", "l", "bumpRadial", "init_link", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_constant", "init_bump", "init_path", "init_point", "sqrt3", "asterisk_default", "init_asterisk", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sqrt", "context", "size", "min", "t", "u", "circle_default", "init_circle", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "pi", "tau", "cross_default", "init_cross", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "tan30", "tan30_2", "diamond_default", "init_diamond", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sqrt", "context", "size", "y", "x", "diamond2_default", "init_diamond2", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "plus_default", "init_plus", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "min", "square_default", "init_square", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "w", "sqrt", "x", "square2_default", "init_square2", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "ka", "kr", "kx", "ky", "star_default", "init_star", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sin", "pi", "tau", "cos", "context", "size", "sqrt", "x", "y", "i", "a", "c", "s", "sqrt3", "triangle_default", "init_triangle", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sqrt", "context", "size", "y", "sqrt3", "triangle2_default", "init_triangle2", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sqrt", "context", "size", "s", "t", "u", "c", "s", "k", "a", "wye_default", "init_wye", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sqrt", "context", "size", "x0", "y0", "x1", "y1", "x2", "y2", "times_default", "init_times", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "min", "Symbol", "type", "size", "context", "path", "withPath", "symbol", "constant_default", "circle_default", "buffer", "_", "symbolsFill", "symbolsStroke", "init_symbol", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_constant", "init_path", "init_asterisk", "init_circle", "init_cross", "init_diamond", "init_diamond2", "init_plus", "init_square", "init_square2", "init_star", "init_triangle", "init_triangle2", "init_wye", "init_times", "cross_default", "diamond_default", "square_default", "star_default", "triangle_default", "wye_default", "plus_default", "times_default", "triangle2_default", "asterisk_default", "square2_default", "diamond2_default", "noop_default", "init_noop", "__esmMin", "init_dirname", "init_buffer", "init_process", "point", "that", "x", "y", "Basis", "context", "basis_default", "init_basis", "__esmMin", "init_dirname", "init_buffer", "init_process", "BasisClosed", "context", "basisClosed_default", "init_basisClosed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_noop", "init_basis", "noop_default", "x", "y", "point", "BasisOpen", "context", "basisOpen_default", "init_basisOpen", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_basis", "x", "y", "x0", "y0", "point", "Bundle", "context", "beta", "Basis", "bundle_default", "init_bundle", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_basis", "x", "y", "j", "x0", "y0", "dx", "dy", "i", "t", "custom", "bundle", "point", "that", "x", "y", "Cardinal", "context", "tension", "cardinal_default", "init_cardinal", "__esmMin", "init_dirname", "init_buffer", "init_process", "custom", "cardinal", "CardinalClosed", "context", "tension", "cardinalClosed_default", "init_cardinalClosed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_noop", "init_cardinal", "noop_default", "x", "y", "point", "custom", "cardinal", "CardinalOpen", "context", "tension", "cardinalOpen_default", "init_cardinalOpen", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_cardinal", "x", "y", "point", "custom", "cardinal", "point", "that", "x", "y", "x1", "y1", "x2", "y2", "epsilon", "a", "n", "b", "m", "CatmullRom", "context", "alpha", "catmullRom_default", "init_catmullRom", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "init_cardinal", "x23", "y23", "custom", "catmullRom", "Cardinal", "CatmullRomClosed", "context", "alpha", "catmullRomClosed_default", "init_catmullRomClosed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_cardinalClosed", "init_noop", "init_catmullRom", "noop_default", "x", "y", "x23", "y23", "point", "custom", "catmullRom", "CardinalClosed", "CatmullRomOpen", "context", "alpha", "catmullRomOpen_default", "init_catmullRomOpen", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_cardinalOpen", "init_catmullRom", "x", "y", "x23", "y23", "point", "custom", "catmullRom", "CardinalOpen", "LinearClosed", "context", "linearClosed_default", "init_linearClosed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_noop", "noop_default", "x", "y", "sign", "x", "slope3", "that", "x2", "y2", "h0", "h1", "s0", "s1", "p", "slope2", "h", "point", "t0", "t1", "x0", "y0", "x1", "y1", "dx", "MonotoneX", "context", "MonotoneY", "ReflectContext", "monotoneX", "monotoneY", "init_monotone", "__esmMin", "init_dirname", "init_buffer", "init_process", "y", "Natural", "context", "controlPoints", "x", "i", "n", "m", "a", "b", "r", "natural_default", "init_natural", "__esmMin", "init_dirname", "init_buffer", "init_process", "y", "px", "py", "i0", "i1", "Step", "context", "step_default", "stepBefore", "stepAfter", "init_step", "__esmMin", "init_dirname", "init_buffer", "init_process", "x", "y", "x1", "none_default", "series", "order", "n", "i", "j", "s0", "s1", "m", "init_none", "__esmMin", "init_dirname", "init_buffer", "init_process", "none_default", "series", "n", "o", "init_none", "__esmMin", "init_dirname", "init_buffer", "init_process", "stackValue", "d", "key", "stackSeries", "series", "stack_default", "keys", "constant_default", "order", "none_default", "offset", "value", "stack", "data", "sz", "i", "n", "j", "oz", "array_default", "_", "init_stack", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_constant", "init_none", "expand_default", "series", "order", "i", "j", "m", "y", "none_default", "init_expand", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "diverging_default", "series", "order", "n", "i", "j", "d", "dy", "yp", "yn", "m", "init_diverging", "__esmMin", "init_dirname", "init_buffer", "init_process", "silhouette_default", "series", "order", "n", "j", "s0", "m", "i", "y", "none_default", "init_silhouette", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "wiggle_default", "series", "order", "n", "m", "s0", "y", "j", "i", "s1", "s2", "si", "sij0", "sij1", "s3", "k", "sk", "skj0", "skj1", "none_default", "init_wiggle", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "appearance_default", "series", "peaks", "peak", "none_default", "a", "b", "i", "j", "vi", "vj", "init_appearance", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "ascending_default", "series", "sums", "sum", "none_default", "a", "b", "s", "i", "v", "init_ascending", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "descending_default", "series", "ascending_default", "init_descending", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_ascending", "insideOut_default", "series", "n", "i", "j", "sums", "sum", "order", "appearance_default", "top", "bottom", "tops", "bottoms", "init_insideOut", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_appearance", "init_ascending", "reverse_default", "series", "none_default", "init_reverse", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "src_exports", "__export", "arc_default", "area_default", "areaRadial_default", "basis_default", "basisClosed_default", "basisOpen_default", "bumpX", "bumpY", "bundle_default", "cardinal_default", "cardinalClosed_default", "cardinalOpen_default", "catmullRom_default", "catmullRomClosed_default", "catmullRomOpen_default", "linear_default", "linearClosed_default", "monotoneX", "monotoneY", "natural_default", "step_default", "stepAfter", "stepBefore", "line_default", "lineRadial_default", "link", "linkHorizontal", "linkRadial", "linkVertical", "pie_default", "pointRadial_default", "stack_default", "diverging_default", "expand_default", "none_default", "silhouette_default", "wiggle_default", "appearance_default", "ascending_default", "descending_default", "insideOut_default", "reverse_default", "Symbol", "asterisk_default", "circle_default", "cross_default", "diamond_default", "diamond2_default", "plus_default", "square_default", "square2_default", "star_default", "times_default", "triangle_default", "triangle2_default", "wye_default", "symbolsFill", "symbolsStroke", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_arc", "init_area", "init_line", "init_pie", "init_areaRadial", "init_lineRadial", "init_pointRadial", "init_link", "init_symbol", "init_asterisk", "init_circle", "init_cross", "init_diamond", "init_diamond2", "init_plus", "init_square", "init_square2", "init_star", "init_triangle", "init_triangle2", "init_wye", "init_times", "init_basisClosed", "init_basisOpen", "init_basis", "init_bump", "init_bundle", "init_cardinalClosed", "init_cardinalOpen", "init_cardinal", "init_catmullRomClosed", "init_catmullRomOpen", "init_catmullRom", "init_linearClosed", "init_linear", "init_monotone", "init_natural", "init_step", "init_stack", "init_expand", "init_diverging", "init_none", "init_silhouette", "init_wiggle", "init_appearance", "init_ascending", "init_descending", "init_insideOut", "init_reverse", "formatDecimal_default", "x", "formatDecimalParts", "p", "i", "coefficient", "init_formatDecimal", "__esmMin", "init_dirname", "init_buffer", "init_process", "exponent_default", "x", "formatDecimalParts", "init_exponent", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_formatDecimal", "formatGroup_default", "grouping", "thousands", "value", "width", "t", "j", "g", "length", "init_formatGroup", "__esmMin", "init_dirname", "init_buffer", "init_process", "formatNumerals_default", "numerals", "value", "i", "init_formatNumerals", "__esmMin", "init_dirname", "init_buffer", "init_process", "formatSpecifier", "specifier", "match", "re", "FormatSpecifier", "init_formatSpecifier", "__esmMin", "init_dirname", "init_buffer", "init_process", "formatTrim_default", "s", "out", "n", "i", "i0", "i1", "init_formatTrim", "__esmMin", "init_dirname", "init_buffer", "init_process", "formatPrefixAuto_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "i", "prefixExponent", "n", "init_formatPrefixAuto", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_formatDecimal", "formatRounded_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "init_formatRounded", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_formatDecimal", "formatTypes_default", "init_formatTypes", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_formatDecimal", "init_formatPrefixAuto", "init_formatRounded", "x", "p", "formatDecimal_default", "formatRounded_default", "formatPrefixAuto_default", "identity_default", "x", "init_identity", "__esmMin", "init_dirname", "init_buffer", "init_process", "locale_default", "locale", "group", "identity_default", "formatGroup_default", "map", "currencyPrefix", "currencySuffix", "decimal", "numerals", "formatNumerals_default", "percent", "minus", "nan", "newFormat", "specifier", "formatSpecifier", "fill", "align", "sign", "symbol", "zero", "width", "comma", "precision", "trim", "type", "formatTypes_default", "prefix", "suffix", "formatType", "maybeSuffix", "format", "value", "valuePrefix", "valueSuffix", "i", "n", "c", "valueNegative", "formatTrim_default", "prefixes", "prefixExponent", "length", "padding", "formatPrefix", "f", "e", "exponent_default", "k", "init_locale", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_exponent", "init_formatGroup", "init_formatNumerals", "init_formatSpecifier", "init_formatTrim", "init_formatTypes", "init_formatPrefixAuto", "init_identity", "defaultLocale", "definition", "locale", "locale_default", "format", "formatPrefix", "init_defaultLocale", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_locale", "precisionFixed_default", "step", "exponent_default", "init_precisionFixed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_exponent", "precisionPrefix_default", "step", "value", "exponent_default", "init_precisionPrefix", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_exponent", "precisionRound_default", "step", "max", "exponent_default", "init_precisionRound", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_exponent", "src_exports", "__export", "FormatSpecifier", "format", "defaultLocale", "locale_default", "formatPrefix", "formatSpecifier", "precisionFixed_default", "precisionPrefix_default", "precisionRound_default", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_defaultLocale", "init_locale", "init_formatSpecifier", "init_precisionFixed", "init_precisionPrefix", "init_precisionRound", "ascending", "a", "b", "init_ascending", "__esmMin", "init_dirname", "init_buffer", "init_process", "descending", "a", "b", "init_descending", "__esmMin", "init_dirname", "init_buffer", "init_process", "bisector", "f", "compare1", "compare2", "delta", "ascending", "d", "x", "descending", "zero", "left", "a", "lo", "hi", "mid", "right", "center", "i", "init_bisector", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_ascending", "init_descending", "number", "x", "numbers", "values", "valueof", "value", "index", "init_number", "__esmMin", "init_dirname", "init_buffer", "init_process", "ascendingBisect", "bisectRight", "bisectLeft", "bisectCenter", "bisect_default", "init_bisect", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_ascending", "init_bisector", "init_number", "bisector", "ascending", "number", "intern_get", "_intern", "_key", "value", "key", "intern_set", "intern_delete", "keyof", "InternMap", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "entries", "compareDefined", "compare", "ascending", "ascendingDefined", "a", "b", "x", "init_sort", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_ascending", "tickSpec", "start", "stop", "count", "step", "power", "error", "factor", "e10", "e5", "e2", "i1", "i2", "inc", "ticks", "reverse", "n", "i", "tickIncrement", "tickStep", "init_ticks", "__esmMin", "init_dirname", "init_buffer", "init_process", "max", "values", "valueof", "value", "index", "init_max", "__esmMin", "init_dirname", "init_buffer", "init_process", "min", "values", "valueof", "value", "index", "init_min", "__esmMin", "init_dirname", "init_buffer", "init_process", "quickselect", "array", "k", "left", "right", "compare", "ascendingDefined", "compareDefined", "n", "m", "z", "s", "sd", "newLeft", "newRight", "t", "i", "j", "swap", "init_quickselect", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_sort", "quantile", "values", "p", "valueof", "numbers", "min", "max", "i0", "value0", "quickselect", "value1", "quantileSorted", "number", "init_quantile", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_max", "init_min", "init_quickselect", "init_number", "range", "start", "stop", "step", "n", "i", "init_range", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_bisect", "init_ascending", "init_bisector", "init_quantile", "init_range", "init_ticks", "initRange", "domain", "range", "initInterpolator", "interpolator", "init_init", "__esmMin", "init_dirname", "init_buffer", "init_process", "ordinal", "index", "InternMap", "domain", "range", "unknown", "implicit", "scale", "d", "i", "_", "value", "initRange", "init_ordinal", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_init", "band", "scale", "ordinal", "domain", "ordinalRange", "r0", "r1", "step", "bandwidth", "round", "paddingInner", "paddingOuter", "align", "rescale", "n", "reverse", "start", "stop", "values", "range", "i", "_", "initRange", "pointish", "copy", "point", "init_band", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_init", "init_ordinal", "define_default", "constructor", "factory", "prototype", "extend", "parent", "definition", "key", "init_define", "__esmMin", "init_dirname", "init_buffer", "init_process", "Color", "color_formatHex", "color_formatHex8", "color_formatHsl", "hslConvert", "color_formatRgb", "color", "format", "m", "l", "reHex", "rgbn", "Rgb", "rgba", "reRgbInteger", "reRgbPercent", "reRgbaInteger", "reRgbaPercent", "reHslPercent", "hsla", "reHslaPercent", "named", "n", "r", "g", "b", "a", "rgbConvert", "o", "rgb", "opacity", "rgb_formatHex", "hex", "rgb_formatHex8", "rgb_formatRgb", "clampa", "clampi", "value", "h", "s", "Hsl", "min", "max", "hsl", "clamph", "clampt", "hsl2rgb", "m1", "m2", "darker", "brighter", "reI", "reN", "reP", "init_color", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_define", "define_default", "channels", "extend", "k", "radians", "degrees", "init_math", "__esmMin", "init_dirname", "init_buffer", "init_process", "labConvert", "o", "Lab", "Hcl", "hcl2lab", "Rgb", "rgbConvert", "r", "rgb2lrgb", "g", "b", "y", "xyz2lab", "Yn", "x", "z", "Xn", "Zn", "gray", "l", "opacity", "lab", "a", "t", "t3", "t2", "t0", "lab2xyz", "t1", "lrgb2rgb", "hclConvert", "h", "degrees", "lch", "c", "hcl", "radians", "K", "init_lab", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_define", "init_color", "init_math", "define_default", "extend", "Color", "k", "cubehelixConvert", "o", "Cubehelix", "Rgb", "rgbConvert", "r", "g", "b", "l", "BC_DA", "ED", "EB", "bl", "k", "E", "C", "D", "s", "h", "degrees", "cubehelix", "opacity", "A", "B", "init_cubehelix", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_define", "init_color", "init_math", "define_default", "extend", "Color", "brighter", "darker", "radians", "a", "cosh", "sinh", "src_exports", "__export", "color", "cubehelix", "gray", "hcl", "hsl", "lab", "lch", "rgb", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_color", "init_lab", "init_cubehelix", "basis", "t1", "v0", "v1", "v2", "v3", "t2", "t3", "basis_default", "values", "n", "t", "i", "init_basis", "__esmMin", "init_dirname", "init_buffer", "init_process", "basisClosed_default", "values", "n", "t", "i", "v0", "v1", "v2", "v3", "basis", "init_basisClosed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_basis", "constant_default", "init_constant", "__esmMin", "init_dirname", "init_buffer", "init_process", "x", "linear", "a", "d", "t", "exponential", "b", "y", "hue", "constant_default", "gamma", "nogamma", "init_color", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_constant", "rgbSpline", "spline", "colors", "n", "r", "g", "b", "i", "color", "rgb", "t", "rgb_default", "rgbBasis", "rgbBasisClosed", "init_rgb", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_basis", "init_basisClosed", "init_color", "rgbGamma", "y", "gamma", "start", "end", "opacity", "nogamma", "basis_default", "basisClosed_default", "numberArray_default", "a", "b", "n", "c", "t", "isNumberArray", "x", "init_numberArray", "__esmMin", "init_dirname", "init_buffer", "init_process", "array_default", "a", "b", "isNumberArray", "numberArray_default", "genericArray", "nb", "na", "x", "c", "i", "value_default", "t", "init_array", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_value", "init_numberArray", "date_default", "a", "b", "d", "t", "init_date", "__esmMin", "init_dirname", "init_buffer", "init_process", "number_default", "a", "b", "t", "init_number", "__esmMin", "init_dirname", "init_buffer", "init_process", "object_default", "a", "b", "i", "c", "k", "value_default", "t", "init_object", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_value", "zero", "b", "one", "string_default", "a", "bi", "reA", "reB", "am", "bm", "bs", "i", "s", "q", "number_default", "t", "o", "init_string", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_number", "value_default", "a", "b", "t", "c", "constant_default", "number_default", "color", "rgb_default", "string_default", "date_default", "isNumberArray", "numberArray_default", "genericArray", "object_default", "init_value", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_rgb", "init_array", "init_date", "init_number", "init_object", "init_string", "init_constant", "init_numberArray", "discrete_default", "range", "n", "t", "init_discrete", "__esmMin", "init_dirname", "init_buffer", "init_process", "hue_default", "a", "b", "i", "hue", "t", "x", "init_hue", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_color", "round_default", "a", "b", "t", "init_round", "__esmMin", "init_dirname", "init_buffer", "init_process", "decompose_default", "a", "b", "c", "d", "e", "f", "scaleX", "scaleY", "skewX", "degrees", "identity", "init_decompose", "__esmMin", "init_dirname", "init_buffer", "init_process", "parseCss", "value", "m", "identity", "decompose_default", "parseSvg", "svgNode", "init_parse", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_decompose", "interpolateTransform", "parse", "pxComma", "pxParen", "degParen", "pop", "translate", "xa", "ya", "xb", "yb", "s", "q", "i", "number_default", "rotate", "a", "b", "skewX", "scale", "t", "n", "o", "interpolateTransformCss", "interpolateTransformSvg", "init_transform", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_number", "init_parse", "parseCss", "parseSvg", "cosh", "x", "sinh", "tanh", "epsilon2", "zoom_default", "init_zoom", "__esmMin", "init_dirname", "init_buffer", "init_process", "zoomRho", "rho", "rho2", "rho4", "zoom", "p0", "p1", "ux0", "uy0", "w0", "ux1", "uy1", "w1", "dx", "dy", "d2", "i", "S", "t", "d1", "b0", "b1", "r0", "r1", "s", "coshr0", "u", "_", "_1", "_2", "_4", "hsl", "hue", "start", "end", "h", "s", "nogamma", "l", "opacity", "t", "hsl_default", "hslLong", "init_hsl", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_color", "lab", "start", "end", "l", "nogamma", "a", "b", "opacity", "t", "init_lab", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_color", "hcl", "hue", "start", "end", "h", "c", "nogamma", "l", "opacity", "t", "hcl_default", "hclLong", "init_hcl", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_color", "cubehelix", "hue", "cubehelixGamma", "y", "start", "end", "h", "s", "nogamma", "l", "opacity", "t", "cubehelix_default", "cubehelixLong", "init_cubehelix", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_color", "piecewise", "interpolate", "values", "value_default", "i", "v", "I", "t", "init_piecewise", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_value", "quantize_default", "interpolator", "n", "samples", "i", "init_quantize", "__esmMin", "init_dirname", "init_buffer", "init_process", "src_exports", "__export", "value_default", "array_default", "basis_default", "basisClosed_default", "cubehelix_default", "cubehelixLong", "date_default", "discrete_default", "hcl_default", "hclLong", "hsl_default", "hslLong", "hue_default", "lab", "number_default", "numberArray_default", "object_default", "rgb_default", "rgbBasis", "rgbBasisClosed", "round_default", "string_default", "interpolateTransformCss", "interpolateTransformSvg", "zoom_default", "piecewise", "quantize_default", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_value", "init_array", "init_basis", "init_basisClosed", "init_date", "init_discrete", "init_hue", "init_number", "init_numberArray", "init_object", "init_round", "init_string", "init_transform", "init_zoom", "init_rgb", "init_hsl", "init_lab", "init_hcl", "init_cubehelix", "init_piecewise", "init_quantize", "constants", "x", "init_constant", "__esmMin", "init_dirname", "init_buffer", "init_process", "number", "x", "init_number", "__esmMin", "init_dirname", "init_buffer", "init_process", "identity", "x", "normalize", "a", "b", "constants", "clamper", "t", "bimap", "domain", "range", "interpolate", "d0", "d1", "r0", "r1", "polymap", "j", "d", "r", "i", "bisect_default", "copy", "source", "target", "transformer", "unit", "value_default", "transform", "untransform", "unknown", "clamp", "piecewise", "output", "input", "rescale", "n", "scale", "y", "number_default", "_", "number", "round_default", "u", "continuous", "init_continuous", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_constant", "init_number", "tickFormat", "start", "stop", "count", "specifier", "step", "tickStep", "precision", "formatSpecifier", "value", "precisionPrefix_default", "formatPrefix", "precisionRound_default", "precisionFixed_default", "format", "init_tickFormat", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "linearish", "scale", "domain", "count", "d", "ticks", "specifier", "tickFormat", "i0", "i1", "start", "stop", "prestep", "step", "maxIter", "tickIncrement", "linear", "continuous", "copy", "initRange", "init_linear", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_continuous", "init_init", "init_tickFormat", "identity", "domain", "unknown", "scale", "x", "_", "number", "linearish", "init_identity", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_linear", "init_number", "nice", "domain", "interval", "i0", "i1", "x0", "x1", "t", "init_nice", "__esmMin", "init_dirname", "init_buffer", "init_process", "transformLog", "x", "transformExp", "transformLogn", "transformExpn", "pow10", "powp", "base", "logp", "reflect", "f", "k", "loggish", "transform", "scale", "domain", "logs", "pows", "rescale", "_", "count", "d", "u", "v", "r", "i", "j", "t", "n", "z", "ticks", "specifier", "formatSpecifier", "format", "nice", "log", "transformer", "copy", "initRange", "init_log", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_nice", "init_continuous", "init_init", "transformSymlog", "c", "x", "transformSymexp", "symlogish", "transform", "scale", "_", "linearish", "symlog", "transformer", "copy", "initRange", "init_symlog", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_linear", "init_continuous", "init_init", "transformPow", "exponent", "x", "transformSqrt", "transformSquare", "powish", "transform", "scale", "identity", "rescale", "_", "linearish", "pow", "transformer", "copy", "initRange", "sqrt", "init_pow", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_linear", "init_continuous", "init_init", "square", "x", "unsquare", "radial", "squared", "continuous", "range", "round", "unknown", "scale", "y", "_", "number", "initRange", "linearish", "init_radial", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_continuous", "init_init", "init_linear", "init_number", "quantile", "domain", "range", "thresholds", "unknown", "rescale", "i", "n", "quantileSorted", "scale", "x", "bisect_default", "y", "_", "d", "ascending", "initRange", "init_quantile", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_init", "quantize", "x0", "x1", "n", "domain", "range", "unknown", "scale", "x", "bisect_default", "rescale", "i", "_", "y", "initRange", "linearish", "init_quantize", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_linear", "init_init", "threshold", "domain", "range", "unknown", "scale", "x", "bisect_default", "_", "y", "i", "initRange", "init_threshold", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_init", "timeInterval", "floori", "offseti", "count", "field", "interval", "date", "d0", "d1", "step", "start", "stop", "range", "previous", "test", "end", "t0", "t1", "d", "init_interval", "__esmMin", "init_dirname", "init_buffer", "init_process", "millisecond", "milliseconds", "init_millisecond", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "k", "second", "seconds", "init_second", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "timeMinute", "timeMinutes", "utcMinute", "utcMinutes", "init_minute", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "timeHour", "timeHours", "utcHour", "utcHours", "init_hour", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "timeDay", "timeDays", "utcDay", "utcDays", "unixDay", "unixDays", "init_day", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "timeWeekday", "i", "timeInterval", "date", "step", "start", "end", "utcWeekday", "timeSunday", "timeMonday", "timeTuesday", "timeWednesday", "timeThursday", "timeFriday", "timeSaturday", "timeSundays", "timeMondays", "timeTuesdays", "timeWednesdays", "timeThursdays", "timeFridays", "timeSaturdays", "utcSunday", "utcMonday", "utcTuesday", "utcWednesday", "utcThursday", "utcFriday", "utcSaturday", "utcSundays", "utcMondays", "utcTuesdays", "utcWednesdays", "utcThursdays", "utcFridays", "utcSaturdays", "init_week", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeMonth", "timeMonths", "utcMonth", "utcMonths", "init_month", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "timeYear", "timeYears", "utcYear", "utcYears", "init_year", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "k", "ticker", "year", "month", "week", "day", "hour", "minute", "tickIntervals", "second", "ticks", "start", "stop", "count", "reverse", "interval", "tickInterval", "target", "i", "bisector", "step", "tickStep", "millisecond", "t", "utcTicks", "utcTickInterval", "timeTicks", "timeTickInterval", "init_ticks", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_millisecond", "init_second", "init_minute", "init_hour", "init_day", "init_week", "init_month", "init_year", "utcYear", "utcMonth", "utcSunday", "unixDay", "utcHour", "utcMinute", "timeYear", "timeMonth", "timeSunday", "timeDay", "timeHour", "timeMinute", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_second", "init_minute", "init_hour", "init_day", "init_week", "init_month", "init_year", "init_ticks", "localDate", "d", "date", "utcDate", "newDate", "y", "m", "formatLocale", "locale", "locale_dateTime", "locale_date", "locale_time", "locale_periods", "locale_weekdays", "locale_shortWeekdays", "locale_months", "locale_shortMonths", "periodRe", "formatRe", "periodLookup", "formatLookup", "weekdayRe", "weekdayLookup", "shortWeekdayRe", "shortWeekdayLookup", "monthRe", "monthLookup", "shortMonthRe", "shortMonthLookup", "formats", "formatShortWeekday", "formatWeekday", "formatShortMonth", "formatMonth", "formatDayOfMonth", "formatMicroseconds", "formatYearISO", "formatFullYearISO", "formatHour24", "formatHour12", "formatDayOfYear", "formatMilliseconds", "formatMonthNumber", "formatMinutes", "formatPeriod", "formatQuarter", "formatUnixTimestamp", "formatUnixTimestampSeconds", "formatSeconds", "formatWeekdayNumberMonday", "formatWeekNumberSunday", "formatWeekNumberISO", "formatWeekdayNumberSunday", "formatWeekNumberMonday", "formatYear", "formatFullYear", "formatZone", "formatLiteralPercent", "utcFormats", "formatUTCShortWeekday", "formatUTCWeekday", "formatUTCShortMonth", "formatUTCMonth", "formatUTCDayOfMonth", "formatUTCMicroseconds", "formatUTCYearISO", "formatUTCFullYearISO", "formatUTCHour24", "formatUTCHour12", "formatUTCDayOfYear", "formatUTCMilliseconds", "formatUTCMonthNumber", "formatUTCMinutes", "formatUTCPeriod", "formatUTCQuarter", "formatUTCSeconds", "formatUTCWeekdayNumberMonday", "formatUTCWeekNumberSunday", "formatUTCWeekNumberISO", "formatUTCWeekdayNumberSunday", "formatUTCWeekNumberMonday", "formatUTCYear", "formatUTCFullYear", "formatUTCZone", "parses", "parseShortWeekday", "parseWeekday", "parseShortMonth", "parseMonth", "parseLocaleDateTime", "parseDayOfMonth", "parseMicroseconds", "parseYear", "parseFullYear", "parseHour24", "parseDayOfYear", "parseMilliseconds", "parseMonthNumber", "parseMinutes", "parsePeriod", "parseQuarter", "parseUnixTimestamp", "parseUnixTimestampSeconds", "parseSeconds", "parseWeekdayNumberMonday", "parseWeekNumberSunday", "parseWeekNumberISO", "parseWeekdayNumberSunday", "parseWeekNumberMonday", "parseLocaleDate", "parseLocaleTime", "parseZone", "parseLiteralPercent", "newFormat", "specifier", "string", "i", "j", "n", "c", "pad", "format", "pads", "newParse", "Z", "parseSpecifier", "week", "day", "utcMonday", "utcDay", "timeMonday", "timeDay", "parse", "f", "p", "value", "fill", "width", "sign", "length", "requote", "s", "requoteRe", "names", "name", "numberRe", "percentRe", "timeYear", "timeSunday", "dISO", "timeThursday", "z", "utcYear", "dow", "utcSunday", "UTCdISO", "utcThursday", "init_locale", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "defaultLocale", "definition", "locale", "formatLocale", "timeFormat", "timeParse", "utcFormat", "utcParse", "init_defaultLocale", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_locale", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_defaultLocale", "date", "t", "number", "calendar", "ticks", "tickInterval", "year", "month", "week", "day", "hour", "minute", "second", "format", "scale", "continuous", "invert", "domain", "formatMillisecond", "formatSecond", "formatMinute", "formatHour", "formatDay", "formatWeek", "formatMonth", "formatYear", "tickFormat", "y", "_", "interval", "d", "count", "specifier", "nice", "copy", "time", "initRange", "timeTicks", "timeTickInterval", "timeYear", "timeMonth", "timeSunday", "timeDay", "timeHour", "timeMinute", "timeFormat", "init_time", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_continuous", "init_init", "init_nice", "utcTime", "initRange", "calendar", "utcTicks", "utcTickInterval", "utcYear", "utcMonth", "utcSunday", "utcDay", "utcHour", "utcMinute", "second", "utcFormat", "init_utcTime", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_time", "init_init", "transformer", "x0", "x1", "t0", "t1", "k10", "transform", "interpolator", "identity", "clamp", "unknown", "scale", "x", "_", "range", "interpolate", "r0", "r1", "value_default", "round_default", "t", "copy", "source", "target", "sequential", "linearish", "initInterpolator", "sequentialLog", "loggish", "sequentialSymlog", "symlogish", "sequentialPow", "powish", "sequentialSqrt", "init_sequential", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_continuous", "init_init", "init_linear", "init_log", "init_symlog", "init_pow", "sequentialQuantile", "domain", "interpolator", "identity", "scale", "x", "bisect_default", "_", "d", "ascending", "i", "quantile", "initInterpolator", "init_sequentialQuantile", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_continuous", "init_init", "transformer", "x0", "x1", "x2", "s", "t0", "t1", "t2", "k10", "k21", "interpolator", "identity", "transform", "clamp", "unknown", "scale", "x", "_", "range", "interpolate", "r0", "r1", "r2", "piecewise", "value_default", "round_default", "t", "diverging", "linearish", "copy", "initInterpolator", "divergingLog", "loggish", "divergingSymlog", "symlogish", "divergingPow", "powish", "divergingSqrt", "init_diverging", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_continuous", "init_init", "init_linear", "init_log", "init_sequential", "init_symlog", "init_pow", "src_exports", "__export", "band", "diverging", "divergingLog", "divergingPow", "divergingSqrt", "divergingSymlog", "identity", "implicit", "linear", "log", "ordinal", "point", "pow", "quantile", "quantize", "radial", "sequential", "sequentialLog", "sequentialPow", "sequentialQuantile", "sequentialSqrt", "sequentialSymlog", "sqrt", "symlog", "threshold", "time", "utcTime", "tickFormat", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_band", "init_identity", "init_linear", "init_log", "init_symlog", "init_ordinal", "init_pow", "init_radial", "init_quantile", "init_quantize", "init_threshold", "init_time", "init_utcTime", "init_sequential", "init_sequentialQuantile", "init_diverging", "init_tickFormat", "identity_default", "x", "init_identity", "__esmMin", "init_dirname", "init_buffer", "init_process", "translateX", "x", "translateY", "y", "number", "scale", "d", "center", "offset", "entering", "axis", "orient", "tickArguments", "tickValues", "tickFormat", "tickSizeInner", "tickSizeOuter", "tickPadding", "k", "top", "left", "right", "transform", "bottom", "context", "values", "format", "identity_default", "spacing", "range", "range0", "range1", "position", "selection", "path", "tick", "tickExit", "tickEnter", "line", "text", "epsilon", "p", "_", "axisTop", "axisRight", "axisBottom", "axisLeft", "init_axis", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_identity", "src_exports", "__export", "axisBottom", "axisLeft", "axisRight", "axisTop", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_axis", "dispatch", "i", "n", "_", "t", "Dispatch", "parseTypenames", "typenames", "types", "name", "get", "type", "c", "set", "callback", "noop", "dispatch_default", "init_dispatch", "__esmMin", "init_dirname", "init_buffer", "init_process", "typename", "T", "copy", "that", "args", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_dispatch", "xhtml", "namespaces_default", "init_namespaces", "__esmMin", "init_dirname", "init_buffer", "init_process", "namespace_default", "name", "prefix", "i", "namespaces_default", "init_namespace", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_namespaces", "creatorInherit", "name", "document", "uri", "xhtml", "creatorFixed", "fullname", "creator_default", "namespace_default", "init_creator", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_namespace", "init_namespaces", "none", "selector_default", "selector", "init_selector", "__esmMin", "init_dirname", "init_buffer", "init_process", "select_default", "select", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "Selection", "init_select", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "init_selector", "array", "x", "init_array", "__esmMin", "init_dirname", "init_buffer", "init_process", "empty", "selectorAll_default", "selector", "init_selectorAll", "__esmMin", "init_dirname", "init_buffer", "init_process", "arrayAll", "select", "array", "selectAll_default", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "Selection", "init_selectAll", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "init_array", "init_selectorAll", "matcher_default", "selector", "childMatcher", "node", "init_matcher", "__esmMin", "init_dirname", "init_buffer", "init_process", "childFind", "match", "find", "childFirst", "selectChild_default", "childMatcher", "init_selectChild", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_matcher", "children", "childrenFilter", "match", "filter", "selectChildren_default", "childMatcher", "init_selectChildren", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_matcher", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Selection", "init_filter", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "init_matcher", "sparse_default", "update", "init_sparse", "__esmMin", "init_dirname", "init_buffer", "init_process", "enter_default", "Selection", "sparse_default", "EnterNode", "parent", "datum", "init_enter", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_sparse", "init_selection", "child", "next", "selector", "constant_default", "x", "init_constant", "__esmMin", "init_dirname", "init_buffer", "init_process", "bindIndex", "parent", "group", "enter", "update", "exit", "data", "i", "node", "groupLength", "dataLength", "EnterNode", "bindKey", "key", "nodeByKeyValue", "keyValues", "keyValue", "datum", "data_default", "value", "bind", "parents", "groups", "constant_default", "m", "j", "arraylike", "enterGroup", "updateGroup", "exitGroup", "i0", "i1", "previous", "next", "Selection", "init_data", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "init_enter", "init_constant", "exit_default", "Selection", "sparse_default", "init_exit", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_sparse", "init_selection", "join_default", "onenter", "onupdate", "onexit", "enter", "update", "exit", "init_join", "__esmMin", "init_dirname", "init_buffer", "init_process", "merge_default", "context", "selection", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Selection", "init_merge", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "order_default", "groups", "j", "m", "group", "next", "node", "init_order", "__esmMin", "init_dirname", "init_buffer", "init_process", "sort_default", "compare", "ascending", "compareNode", "a", "b", "groups", "m", "sortgroups", "j", "group", "n", "sortgroup", "node", "i", "Selection", "init_sort", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "call_default", "callback", "init_call", "__esmMin", "init_dirname", "init_buffer", "init_process", "nodes_default", "init_nodes", "__esmMin", "init_dirname", "init_buffer", "init_process", "node_default", "groups", "j", "m", "group", "n", "node", "init_node", "__esmMin", "init_dirname", "init_buffer", "init_process", "size_default", "size", "node", "init_size", "__esmMin", "init_dirname", "init_buffer", "init_process", "empty_default", "init_empty", "__esmMin", "init_dirname", "init_buffer", "init_process", "each_default", "callback", "groups", "j", "m", "group", "i", "n", "node", "init_each", "__esmMin", "init_dirname", "init_buffer", "init_process", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "value", "attrConstantNS", "attrFunction", "v", "attrFunctionNS", "attr_default", "namespace_default", "node", "init_attr", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_namespace", "window_default", "node", "init_window", "__esmMin", "init_dirname", "init_buffer", "init_process", "styleRemove", "name", "styleConstant", "value", "priority", "styleFunction", "v", "style_default", "styleValue", "node", "window_default", "init_style", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_window", "propertyRemove", "name", "propertyConstant", "value", "propertyFunction", "v", "property_default", "init_property", "__esmMin", "init_dirname", "init_buffer", "init_process", "classArray", "string", "classList", "node", "ClassList", "classedAdd", "names", "list", "i", "n", "classedRemove", "classedTrue", "classedFalse", "classedFunction", "value", "classed_default", "name", "init_classed", "__esmMin", "init_dirname", "init_buffer", "init_process", "textRemove", "textConstant", "value", "textFunction", "v", "text_default", "init_text", "__esmMin", "init_dirname", "init_buffer", "init_process", "htmlRemove", "htmlConstant", "value", "htmlFunction", "v", "html_default", "init_html", "__esmMin", "init_dirname", "init_buffer", "init_process", "raise", "raise_default", "init_raise", "__esmMin", "init_dirname", "init_buffer", "init_process", "lower", "lower_default", "init_lower", "__esmMin", "init_dirname", "init_buffer", "init_process", "append_default", "name", "create", "creator_default", "init_append", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_creator", "constantNull", "insert_default", "name", "before", "create", "creator_default", "select", "selector_default", "init_insert", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_creator", "init_selector", "remove", "parent", "remove_default", "init_remove", "__esmMin", "init_dirname", "init_buffer", "init_process", "selection_cloneShallow", "clone", "parent", "selection_cloneDeep", "clone_default", "deep", "init_clone", "__esmMin", "init_dirname", "init_buffer", "init_process", "datum_default", "value", "init_datum", "__esmMin", "init_dirname", "init_buffer", "init_process", "contextListener", "listener", "event", "parseTypenames", "typenames", "name", "i", "onRemove", "typename", "on", "j", "m", "onAdd", "value", "options", "o", "on_default", "n", "t", "init_on", "__esmMin", "init_dirname", "init_buffer", "init_process", "dispatchEvent", "node", "type", "params", "window", "window_default", "event", "dispatchConstant", "dispatchFunction", "dispatch_default", "init_dispatch", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_window", "iterator_default", "groups", "j", "m", "group", "n", "node", "init_iterator", "__esmMin", "init_dirname", "init_buffer", "init_process", "Selection", "groups", "parents", "selection", "root", "selection_selection", "selection_default", "init_selection", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_select", "init_selectAll", "init_selectChild", "init_selectChildren", "init_filter", "init_data", "init_enter", "init_exit", "init_join", "init_merge", "init_order", "init_sort", "init_call", "init_nodes", "init_node", "init_size", "init_empty", "init_each", "init_attr", "init_style", "init_property", "init_classed", "init_text", "init_html", "init_raise", "init_lower", "init_append", "init_insert", "init_remove", "init_clone", "init_datum", "init_on", "init_dispatch", "init_iterator", "select_default", "selectAll_default", "selectChild_default", "selectChildren_default", "filter_default", "data_default", "enter_default", "exit_default", "join_default", "merge_default", "order_default", "sort_default", "call_default", "nodes_default", "node_default", "size_default", "empty_default", "each_default", "attr_default", "style_default", "property_default", "classed_default", "text_default", "html_default", "raise_default", "lower_default", "append_default", "insert_default", "remove_default", "clone_default", "datum_default", "on_default", "dispatch_default", "iterator_default", "select_default", "selector", "Selection", "root", "init_select", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "create_default", "name", "select_default", "creator_default", "init_create", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_creator", "init_select", "local", "Local", "nextId", "init_local", "__esmMin", "init_dirname", "init_buffer", "init_process", "node", "id", "value", "sourceEvent_default", "event", "sourceEvent", "init_sourceEvent", "__esmMin", "init_dirname", "init_buffer", "init_process", "pointer_default", "event", "node", "sourceEvent_default", "svg", "point", "rect", "init_pointer", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_sourceEvent", "pointers_default", "events", "node", "sourceEvent_default", "event", "pointer_default", "init_pointers", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_pointer", "init_sourceEvent", "selectAll_default", "selector", "Selection", "array", "root", "init_selectAll", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_selection", "src_exports", "__export", "create_default", "creator_default", "local", "matcher_default", "namespace_default", "namespaces_default", "pointer_default", "pointers_default", "select_default", "selectAll_default", "selection_default", "selector_default", "selectorAll_default", "styleValue", "window_default", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_create", "init_creator", "init_local", "init_matcher", "init_namespace", "init_namespaces", "init_pointer", "init_pointers", "init_select", "init_selectAll", "init_selection", "init_selector", "init_selectorAll", "init_style", "init_window", "noevent_default", "event", "nonpassivecapture", "init_noevent", "__esmMin", "init_dirname", "init_buffer", "init_process", "nodrag_default", "view", "root", "selection", "select_default", "noevent_default", "nonpassivecapture", "yesdrag", "noclick", "init_nodrag", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_noevent", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_nodrag", "now", "clockNow", "setFrame", "clearNow", "clock", "clockSkew", "Timer", "timer", "callback", "delay", "time", "t", "timerFlush", "frame", "taskHead", "e", "wake", "clockLast", "timeout", "nap", "poke", "pokeDelay", "t0", "t1", "t2", "taskTail", "sleep", "interval", "init_timer", "__esmMin", "init_dirname", "init_buffer", "init_process", "f", "timeout_default", "callback", "delay", "time", "t", "Timer", "elapsed", "init_timeout", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_timer", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_timer", "init_timeout", "schedule_default", "node", "name", "id", "index", "group", "timing", "schedules", "create", "emptyOn", "emptyTween", "CREATED", "init", "schedule", "get", "set", "STARTED", "self", "tween", "timer", "elapsed", "SCHEDULED", "start", "i", "j", "n", "o", "stop", "timeout_default", "RUNNING", "ENDED", "tick", "STARTING", "t", "ENDING", "init_schedule", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "dispatch_default", "interrupt_default", "node", "name", "schedules", "schedule", "active", "empty", "i", "STARTING", "ENDING", "ENDED", "init_interrupt", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "interrupt_default", "name", "init_interrupt", "__esmMin", "init_dirname", "init_buffer", "init_process", "tweenRemove", "id", "name", "tween0", "tween1", "schedule", "set", "tween", "i", "n", "tweenFunction", "value", "t", "tween_default", "get", "tweenValue", "transition", "node", "init_tween", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "interpolate_default", "a", "b", "c", "number_default", "color", "rgb_default", "string_default", "init_interpolate", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "interpolate", "value1", "string00", "string1", "interpolate0", "string0", "attrConstantNS", "attrFunction", "value", "string10", "attrFunctionNS", "attr_default", "namespace_default", "i", "interpolateTransformSvg", "interpolate_default", "tweenValue", "init_attr", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_tween", "init_interpolate", "attrInterpolate", "name", "i", "t", "attrInterpolateNS", "fullname", "attrTweenNS", "value", "t0", "i0", "tween", "attrTween", "attrTween_default", "key", "namespace_default", "init_attrTween", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "delayFunction", "id", "value", "init", "delayConstant", "delay_default", "get", "init_delay", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "durationFunction", "id", "value", "set", "durationConstant", "duration_default", "get", "init_duration", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "easeConstant", "id", "value", "set", "ease_default", "get", "init_ease", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "easeVarying", "id", "value", "v", "set", "easeVarying_default", "init_easeVarying", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Transition", "init_filter", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_transition", "merge_default", "transition", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Transition", "init_merge", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_transition", "start", "name", "i", "onFunction", "id", "listener", "on0", "on1", "sit", "init", "set", "schedule", "on", "on_default", "get", "init_on", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "removeFunction", "id", "parent", "i", "remove_default", "init_remove", "__esmMin", "init_dirname", "init_buffer", "init_process", "select_default", "select", "name", "id", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "schedule_default", "get", "Transition", "init_select", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_transition", "init_schedule", "selectAll_default", "select", "name", "id", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "children", "child", "inherit", "get", "k", "l", "schedule_default", "Transition", "init_selectAll", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_transition", "init_schedule", "selection_default", "Selection", "init_selection", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "styleNull", "name", "interpolate", "string00", "string10", "interpolate0", "string0", "styleValue", "string1", "styleRemove", "styleConstant", "value1", "styleFunction", "value", "styleMaybeRemove", "id", "on0", "on1", "listener0", "key", "event", "remove", "schedule", "set", "on", "listener", "style_default", "priority", "i", "interpolateTransformCss", "interpolate_default", "tweenValue", "init_style", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_schedule", "init_tween", "init_interpolate", "styleInterpolate", "name", "i", "priority", "t", "styleTween", "value", "i0", "tween", "styleTween_default", "key", "init_styleTween", "__esmMin", "init_dirname", "init_buffer", "init_process", "textConstant", "value", "textFunction", "value1", "text_default", "tweenValue", "init_text", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_tween", "textInterpolate", "i", "textTween", "value", "t0", "i0", "tween", "textTween_default", "key", "init_textTween", "__esmMin", "init_dirname", "init_buffer", "init_process", "transition_default", "name", "id0", "id1", "newId", "groups", "m", "j", "group", "n", "node", "i", "inherit", "get", "schedule_default", "Transition", "init_transition", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "end_default", "on0", "on1", "that", "id", "size", "resolve", "reject", "cancel", "end", "schedule", "set", "on", "init_end", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "Transition", "groups", "parents", "name", "id", "transition", "selection_default", "newId", "selection_prototype", "init_transition", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_attr", "init_attrTween", "init_delay", "init_duration", "init_ease", "init_easeVarying", "init_filter", "init_merge", "init_on", "init_remove", "init_select", "init_selectAll", "init_selection", "init_style", "init_styleTween", "init_text", "init_textTween", "init_tween", "init_end", "select_default", "selectAll_default", "filter_default", "merge_default", "transition_default", "on_default", "attr_default", "attrTween_default", "style_default", "styleTween_default", "text_default", "textTween_default", "remove_default", "tween_default", "delay_default", "duration_default", "ease_default", "easeVarying_default", "end_default", "cubicInOut", "t", "init_cubic", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_cubic", "inherit", "node", "id", "timing", "transition_default", "name", "Transition", "newId", "defaultTiming", "now", "groups", "m", "j", "group", "n", "i", "schedule_default", "init_transition", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "init_src", "cubicInOut", "init_selection", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_interrupt", "init_transition", "selection_default", "interrupt_default", "transition_default", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "init_interrupt", "constant_default", "init_constant", "__esmMin", "init_dirname", "init_buffer", "init_process", "x", "ZoomEvent", "type", "sourceEvent", "target", "transform", "dispatch", "init_event", "__esmMin", "init_dirname", "init_buffer", "init_process", "Transform", "k", "x", "y", "transform", "node", "identity", "init_transform", "__esmMin", "init_dirname", "init_buffer", "init_process", "point", "location", "nopropagation", "event", "noevent_default", "init_noevent", "__esmMin", "init_dirname", "init_buffer", "init_process", "defaultFilter", "event", "defaultExtent", "defaultTransform", "identity", "defaultWheelDelta", "defaultTouchable", "defaultConstrain", "transform", "extent", "translateExtent", "dx0", "dx1", "dy0", "dy1", "zoom_default", "filter", "constrain", "wheelDelta", "touchable", "scaleExtent", "duration", "interpolate", "listeners", "dispatch_default", "touchstarting", "touchfirst", "touchending", "touchDelay", "wheelDelay", "clickDistance2", "tapDistance", "zoom", "selection", "wheeled", "mousedowned", "dblclicked", "touchstarted", "touchmoved", "touchended", "collection", "point", "schedule", "gesture", "k", "p", "k0", "k1", "e", "t0", "p0", "centroid", "p1", "translate", "scale", "x", "y", "t", "Transform", "transition", "that", "args", "g", "w", "a", "b", "i", "l", "clean", "Gesture", "key", "type", "d", "select_default", "ZoomEvent", "pointer_default", "interrupt_default", "noevent_default", "wheelidled", "currentTarget", "v", "mousemoved", "mouseupped", "x0", "y0", "nodrag_default", "nopropagation", "dx", "dy", "yesdrag", "t1", "touches", "n", "started", "l0", "l1", "dp", "dl", "_", "constant_default", "value", "init_zoom", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_constant", "init_event", "init_transform", "init_noevent", "src_exports", "__export", "Transform", "zoom_default", "identity", "transform", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_zoom", "init_transform", "o", "u", "f", "v", "n", "r", "s", "a", "l", "h", "e", "t", "c", "p", "i", "y", "init_chunk_4bd36a8f", "__esmMin", "init_dirname", "init_buffer", "init_process", "events_exports", "__export", "EventEmitter", "y", "defaultMaxListeners", "init", "listenerCount", "on", "once", "init_events", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_chunk_4bd36a8f", "emitter", "event", "resolve", "reject", "eventListener", "args", "errorListener", "err", "unconsumedEventValues", "unconsumedPromises", "error", "finished", "iterator", "value", "p", "eventHandler", "errorHandler", "promise", "toError", "d3_shape_1", "d3_selection_1", "annotations", "options", "xScale", "yScale", "line", "d", "parentSelection", "selection", "enter", "yRange", "xRange", "path", "text", "exports", "d3_color_1", "Globals", "v", "registerGraphType", "graphType", "graphTypeBulder", "exports", "globals_1", "__importDefault", "utils", "lo", "hi", "n", "step", "_", "i", "x", "v", "axis", "range", "config", "option", "me", "value", "vMin", "vMax", "data", "index", "indexModLenColor", "exports", "require_token_type", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_Lexer", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "tokenType", "ESCAPES", "DELIMITERS", "isDigit", "c", "isIdentifier", "isWhitespace", "isDelimiter", "str", "isQuote", "Lexer", "message", "index", "error", "text", "c2", "c3", "nth", "current", "number", "quote", "string", "escape", "hex", "replacement", "require_Node", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "require_ConstantNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "SUPPORTED_TYPES", "ConstantNode", "value", "type", "require_OperatorNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "OperatorNode", "op", "args", "require_UnaryNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "UnaryNode", "op", "argument", "require_SymbolNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "SymbolNode", "name", "require_FunctionNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "FunctionNode", "name", "args", "require_ArrayNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "ArrayNode", "nodes", "require_ConditionalNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "ConditionalNode", "predicate", "truthy", "falsy", "require_AssignmentNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "AssignmentNode", "name", "expr", "require_BlockNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "BlockNode", "blocks", "require_Parser", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "tokenType", "Lexer", "ConstantNode", "OperatorNode", "UnaryNode", "SymbolNode", "FunctionNode", "ArrayNode", "ConditionalNode", "AssignmentNode", "BlockNode", "Parser", "first", "i", "text", "blocks", "left", "predicate", "truthy", "falsy", "op", "right", "current", "symbol", "node", "symbolToken", "name", "params", "token", "require_node", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_mr_parser", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_extend", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "hasOwn", "toStr", "defineProperty", "gOPD", "isArray", "arr", "isPlainObject", "obj", "hasOwnConstructor", "hasIsPrototypeOf", "key", "setProperty", "target", "options", "getProperty", "name", "extend", "src", "copy", "copyIsArray", "clone", "i", "length", "deep", "require_ArrayNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "self", "arr", "el", "arrString", "require_AssignmentNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "require_ConditionalNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "condition", "trueExpr", "falseExpr", "require_ConstantNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "require_FunctionNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "SymbolNode", "functionProxy", "node", "self", "method", "args", "arg", "require_Operators", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_OperatorNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Operators", "node", "namedOperator", "require_SymbolNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "id", "require_UnaryOperators", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_UnaryNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "UnaryOperators", "node", "namedOperator", "require_Interpreter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "extend", "types", "Interpreter", "owner", "options", "node", "test", "fn", "oldRaw", "require_CodeGenerator", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Parser", "Interpreter", "extend", "CodeGenerator", "options", "defs", "namespace", "symbol", "scope", "ns", "fn", "name", "defsCode", "code", "factoryCode", "factory", "self", "program", "statement", "require_math_codegen", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_adapter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "math", "a", "b", "res", "i", "root", "inv", "x", "require_eval", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "CodeGenerator", "math", "processScope", "scope", "k", "value", "expression", "require_built_in_math_eval", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_ArrayNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "self", "arr", "el", "arrString", "require_AssignmentNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "require_ConditionalNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "condition", "trueExpr", "falseExpr", "require_ConstantNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "require_FunctionNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "SymbolNode", "functionProxy", "node", "self", "method", "args", "arg", "require_Operators", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_OperatorNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Operators", "node", "namedOperator", "require_SymbolNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "id", "require_UnaryOperators", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_UnaryNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "UnaryOperators", "node", "namedOperator", "require_Interpreter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "extend", "types", "Interpreter", "owner", "options", "node", "test", "fn", "oldRaw", "require_CodeGenerator", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Parser", "Interpreter", "extend", "CodeGenerator", "options", "defs", "namespace", "self", "symbol", "scope", "ns", "applyFactoryIfNeeded", "value", "fn", "name", "defsCode", "code", "factoryCode", "factory", "program", "statement", "require_math_codegen", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "isInterval", "x", "exports", "isEmpty", "i", "isWhole", "isSingleton", "zeroIn", "hasValue", "value", "hasInterval", "y", "intervalsOverlap", "require_double", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "hasTypedArrays", "DOUBLE_VIEW", "UINT_VIEW", "toDoubleLE", "lo", "hi", "lowUintLE", "highUintLE", "n", "toDoubleBE", "lowUintBE", "highUintBE", "toDouble", "buffer", "lowUint", "highUint", "Buffer", "b", "require_nextafter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "doubleBits", "SMALLEST_DENORM", "UINT_MAX", "nextafter", "x", "y", "hi", "lo", "nextafter_1", "__importDefault", "identity", "v", "prev", "next", "toInteger", "x", "cache", "round", "y", "power", "exports", "utils", "__importStar", "round_1", "__importDefault", "_Interval", "__Interval", "lo", "hi", "Interval", "v", "exports", "bindNew", "Class", "_Class", "len", "rest", "key", "interval_1", "round_1", "__importDefault", "piLow", "piHigh", "constants", "exports", "utils", "__importStar", "equal", "x", "y", "exports", "EPS", "assert", "a", "message", "assertEps", "b", "almostEqual", "assertIncludes", "notEqual", "lessThan", "greaterThan", "lessEqualThan", "greaterEqualThan", "interval_1", "round_1", "__importDefault", "utils", "__importStar", "constants_1", "nonZero", "x", "y", "xl", "xh", "yl", "yh", "out", "exports", "positive", "v", "negative", "zero", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "division", "add", "x", "y", "exports", "subtract", "multiply", "xl", "xh", "yl", "yh", "out", "divide", "positive", "negative", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "fmod", "x", "y", "yb", "exports", "multiplicativeInverse", "pow", "power", "yl", "yh", "sqrt", "nthRoot", "n", "yp", "yn", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "exp", "x", "exports", "log", "l", "log10", "log2", "hull", "y", "badX", "badY", "intersection", "lo", "hi", "union", "difference", "width", "abs", "max", "min", "clone", "require_trigonometric", "__commonJSMin", "exports", "init_dirname", "init_buffer", "init_process", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "algebra", "misc", "onlyInfinity", "x", "handleNegative", "interval", "n", "cos", "cache", "pi2", "t", "cosv", "lo", "hi", "rlo", "rhi", "sin", "tan", "pi", "asin", "acos", "atan", "sinh", "cosh", "tanh", "interval_1", "exports", "round_1", "__importDefault", "constants_1", "relational", "__importStar", "arithmetic", "algebra", "trigonometric", "misc", "utils", "MixedInterval", "__exportStar", "require_adapter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "ns", "a", "b", "require_policies", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Interval", "require_eval", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "CodeGenerator", "Interval", "processScope", "scope", "k", "value", "expression", "require_interval_arithmetic_eval", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "built_in_math_eval_1", "__importDefault", "interval_arithmetic_eval_1", "samplers", "getMathJS", "mathJS", "generateEvaluator", "samplerName", "doCompile", "expression", "compiled", "compileIfPossible", "meta", "property", "hiddenProperty", "hiddenCompiled", "getCompiledExpression", "evaluate", "variables", "builtIn", "exports", "interval", "d3_shape_1", "d3_selection_1", "utils_1", "__importDefault", "globals_1", "eval_1", "mouseTip", "config", "x", "y", "MARGIN", "line", "d", "lineGenerator", "el", "data", "tipInnerJoin", "tipInnerEnter", "tip", "selection", "join", "tipEnter", "coordinates", "i", "minDist", "closestIndex", "meta", "xScale", "yScale", "width", "height", "x0", "y0", "range", "candidateY", "tDist", "clampX", "clampY", "color", "option", "exports", "interval_arithmetic_eval_1", "__importStar", "eval_1", "utils_1", "__importDefault", "interval1d", "samplerParams", "xCoords", "xScale", "yScale", "yMin", "yMax", "samples", "i", "x", "y", "prev", "next", "rectEps", "smallRect", "quadTree", "d", "sample", "midX", "midY", "east", "west", "north", "south", "interval2d", "xDomain", "yDomain", "sampler", "fnTypes", "exports", "utils_1", "__importDefault", "eval_1", "checkAsymptote", "d0", "d1", "d", "sign", "level", "n", "x0", "x1", "samples", "oldY", "oldX", "i", "x", "y", "deltaY", "split", "data", "yScale", "oldSign", "evalResult", "yMin", "yMax", "evalGroup", "deltaX", "yOld", "newSign", "check", "linear", "samplerParams", "allX", "yDomain", "parametric", "parametricRange", "tCoords", "t", "polar", "polarRange", "thetaSamples", "theta", "r", "points", "vector", "sampleParams", "sampler", "fnTypes", "exports", "globals_1", "__importDefault", "interval_1", "builtIn_1", "computeEndpoints", "scale", "d", "range", "start", "end", "evaluate", "chart", "samplerFn", "nSamples", "data", "exports", "d3_selection_1", "d3_shape_1", "utils_1", "__importDefault", "evaluate_1", "polyline", "chart", "plotLine", "selection", "d", "el", "index", "evaluatedData", "color", "innerSelection", "yRange", "yMax", "yMin", "diff", "y", "line", "area", "cls", "innerSelectionEnter", "path", "pathD", "k", "val", "exports", "d3_selection_1", "evaluate_1", "__importDefault", "utils_1", "interval", "chart", "minWidthHeight", "xScale", "yScale", "clampRange", "vLo", "vHi", "gLo", "gHi", "t", "hi", "lo", "line", "points", "closed", "path", "range", "minY", "maxY", "i", "length", "x", "y", "yLo", "yHi", "moveX", "viewportY", "plotLine", "selection", "d", "el", "index", "evaluatedData", "innerSelection", "cls", "innerSelectionEnter", "k", "val", "exports", "d3_selection_1", "d3_color_1", "utils_1", "__importDefault", "evaluate_1", "Scatter", "chart", "xScale", "yScale", "scatter", "selection", "d", "i", "j", "index", "color", "evaluatedData", "joined", "innerSelection", "cls", "innerSelectionEnter", "k", "val", "exports", "d3_selection_1", "d3_color_1", "utils_1", "__importDefault", "Text", "chart", "xScale", "yScale", "text", "selection", "d", "innerSelection", "innerSelectionEnter", "color", "k", "exports", "polyline_1", "__importDefault", "exports", "interval_1", "scatter_1", "text_1", "datumDefaults", "d", "exports", "d3_selection_1", "graph_types_1", "eval_1", "datum_defaults_1", "__importDefault", "utils_1", "derivative", "chart", "derivativeDatum", "computeLine", "d", "x0", "checkAutoUpdate", "self", "x", "selection", "el", "data", "innerSelection", "innerSelectionEnter", "exports", "d3_selection_1", "eval_1", "datum_defaults_1", "__importDefault", "graph_types_1", "utils_1", "secant", "chart", "secantDefaults", "computeSlope", "scope", "updateLine", "d", "x0", "x1", "setFn", "setMouseListener", "secantObject", "self", "x", "computeLines", "data", "i", "selection", "el", "innerSelection", "innerSelectionEnter", "exports", "d3_selection_1", "derivative_1", "__importDefault", "secant_1", "helpers", "chart", "helper", "selection", "el", "exports", "d3_shape_1", "d3_format_1", "d3_scale_1", "d3_axis_1", "d3_zoom_1", "d3_selection_1", "d3_interpolate_1", "events_1", "__importDefault", "annotations_1", "tip_1", "helpers_1", "datum_defaults_1", "globals_1", "getD3Scale", "type", "Chart", "_Chart", "options", "n", "letter", "cachedInstance", "cachedNode", "margin", "self", "integerFormat", "formatter", "d", "computeYScale", "xScale", "xDiff", "xDomain", "axis", "yDomain", "yLimit", "root", "tip", "selection", "canvas", "id", "defs", "canvasEnter", "xLabel", "xLabelEnter", "yLabel", "yLabelEnter", "content", "contentEnter", "yOrigin", "yOriginEnter", "xOrigin", "xOriginEnter", "graphs", "graphsEnter", "index", "ev", "event", "plugins", "plugin", "i", "instance", "prevInstance", "events", "coordinates", "transform", "xScaleClone", "yScaleClone", "x", "y", "meta", "title", "format", "text", "all", "mouse", "graph", "e", "args", "localArgs", "exports", "require_types", "__commonJSMin", "exports", "init_dirname", "init_buffer", "init_process", "chart_1", "exports", "globals_1", "__importStar", "graph_types_1", "$eval", "functionPlot", "options", "instance", "__exportStar", "eval_1", "graph_types_2", "require_deep_diff", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "root", "factory", "deepDiff", "_deepdiff", "validKinds", "inherits", "ctor", "superCtor", "Diff", "kind", "path", "DiffEdit", "origin", "value", "DiffNew", "DiffDeleted", "DiffArray", "index", "item", "arrayRemove", "arr", "from", "to", "rest", "realTypeOf", "subject", "type", "hashThisString", "string", "hash", "i", "char", "getOrderIndependentHash", "object", "accum", "arrayString", "key", "keyValueString", "stringToHash", "lhs", "rhs", "changes", "prefilter", "stack", "orderIndependent", "currentPath", "alt", "ltype", "rtype", "j", "k", "other", "ldefined", "rdefined", "a", "b", "akeys", "pkeys", "observableDiff", "observer", "orderIndependentDeepDiff", "accumulateDiff", "difference", "accumulateOrderIndependentDiff", "applyArrayChange", "change", "it", "u", "applyChange", "target", "source", "last", "revertArrayChange", "revertChange", "applyDiff", "filter", "onChange", "require_mousetrap", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "window", "document", "undefined", "_MAP", "_KEYCODE_MAP", "_SHIFT_MAP", "_SPECIAL_ALIASES", "_REVERSE_MAP", "i", "_addEvent", "object", "type", "callback", "_characterFromEvent", "e", "character", "_modifiersMatch", "modifiers1", "modifiers2", "_eventModifiers", "modifiers", "_preventDefault", "_stopPropagation", "_isModifier", "key", "_getReverseMap", "_pickBestAction", "action", "_keysFromString", "combination", "_getKeyInfo", "keys", "_belongsTo", "element", "ancestor", "Mousetrap", "targetElement", "self", "_sequenceLevels", "_resetTimer", "_ignoreNextKeyup", "_ignoreNextKeypress", "_nextExpectedAction", "_resetSequences", "doNotReset", "activeSequences", "_getMatches", "sequenceName", "level", "matches", "deleteCombo", "deleteSequence", "_fireCallback", "combo", "sequence", "callbacks", "maxLevel", "processedSequenceCallback", "ignoreThisKeypress", "_handleKeyEvent", "_resetSequenceTimer", "_bindSequence", "_increaseSequence", "nextAction", "_callbackAndReset", "isFinal", "wrappedCallback", "_bindSingle", "info", "combinations", "initialEventTarget", "documentMousetrap", "method", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "$", "selector", "$all", "store", "key", "value", "app", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "import_uikit", "showModal", "id", "UIkit", "showError", "title", "error", "$", "notify", "msg", "stat", "app", "confirm", "action", "yesAction", "event", "isMac", "isElectron", "checkLocale", "locale", "app", "checkSize", "$", "toggleMinMax", "checkUpdates", "notify", "event", "status", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "LuxonError", "InvalidDateTimeError", "reason", "InvalidIntervalError", "InvalidDurationError", "ConflictingSpecificationError", "InvalidUnitError", "unit", "InvalidArgumentError", "ZoneIsAbstractError", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "n", "s", "l", "DATE_SHORT", "DATE_MED", "DATE_MED_WITH_WEEKDAY", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED", "DATETIME_MED_WITH_SECONDS", "DATETIME_MED_WITH_WEEKDAY", "DATETIME_FULL", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE", "DATETIME_HUGE_WITH_SECONDS", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "Zone", "ZoneIsAbstractError", "ts", "opts", "format", "otherZone", "singleton", "SystemZone", "_SystemZone", "Zone", "ts", "format", "locale", "parseZoneInfo", "formatOffset", "otherZone", "init_dirname", "init_buffer", "init_process", "dtfCache", "makeDTF", "zone", "typeToPos", "hackyOffset", "dtf", "date", "formatted", "parsed", "fMonth", "fDay", "fYear", "fadOrBc", "fHour", "fMinute", "fSecond", "partsOffset", "filled", "type", "value", "pos", "isUndefined", "ianaZoneCache", "IANAZone", "_IANAZone", "Zone", "name", "s", "ts", "format", "locale", "parseZoneInfo", "formatOffset", "year", "month", "day", "adOrBc", "hour", "minute", "second", "asUTC", "objToLocalTS", "asTS", "over", "otherZone", "init_dirname", "init_buffer", "init_process", "intlLFCache", "getCachedLF", "locString", "opts", "key", "dtf", "intlDTCache", "getCachedDTF", "intlNumCache", "getCachedINF", "inf", "intlRelCache", "getCachedRTF", "base", "cacheKeyOpts", "sysLocaleCache", "systemLocale", "weekInfoCache", "getCachedWeekInfo", "data", "locale", "parseLocaleString", "localeStr", "xIndex", "uIndex", "options", "selectedStr", "smaller", "numberingSystem", "calendar", "intlConfigString", "outputCalendar", "mapMonths", "f", "ms", "i", "dt", "DateTime", "mapWeekdays", "listStuff", "loc", "length", "englishFn", "intlFn", "mode", "supportsFastNumbers", "PolyNumberFormatter", "intl", "forceSimple", "padTo", "floor", "otherOpts", "intlOpts", "fixed", "roundTo", "padStart", "PolyDateFormatter", "z", "gmtOffset", "offsetZ", "IANAZone", "value", "parts", "part", "offsetName", "PolyRelFormatter", "isEnglish", "hasRelative", "count", "unit", "formatRelativeTime", "fallbackWeekSettings", "Locale", "_Locale", "weekSettings", "defaultToEN", "specifiedLocale", "Settings", "localeR", "numberingSystemR", "outputCalendarR", "weekSettingsR", "validateWeekSettings", "numbering", "parsedLocale", "parsedNumberingSystem", "parsedOutputCalendar", "isActuallyEn", "hasNoWeirdness", "alts", "format", "months", "formatStr", "weekdays", "meridiems", "eras", "field", "df", "results", "matching", "m", "hasLocaleWeekInfo", "other", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "singleton", "FixedOffsetZone", "_FixedOffsetZone", "Zone", "offset", "s", "signedOffset", "formatOffset", "ts", "format", "otherZone", "init_dirname", "init_buffer", "init_process", "InvalidZone", "Zone", "zoneName", "normalizeZone", "input", "defaultZone", "offset", "isUndefined", "Zone", "isString", "lowered", "SystemZone", "FixedOffsetZone", "IANAZone", "isNumber", "InvalidZone", "now", "defaultZone", "defaultLocale", "defaultNumberingSystem", "defaultOutputCalendar", "twoDigitCutoffYear", "throwOnInvalid", "defaultWeekSettings", "Settings", "n", "zone", "normalizeZone", "SystemZone", "locale", "numberingSystem", "outputCalendar", "weekSettings", "validateWeekSettings", "cutoffYear", "Locale", "IANAZone", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "Invalid", "reason", "explanation", "nonLeapLadder", "leapLadder", "unitOutOfRange", "unit", "value", "Invalid", "dayOfWeek", "year", "month", "day", "d", "js", "computeOrdinal", "isLeapYear", "uncomputeOrdinal", "ordinal", "table", "month0", "i", "isoWeekdayToLocal", "isoWeekday", "startOfWeek", "gregorianToWeek", "gregObj", "minDaysInFirstWeek", "weekday", "weekNumber", "weekYear", "weeksInWeekYear", "timeObject", "weekToGregorian", "weekData", "weekdayOfJan4", "yearInDays", "daysInYear", "gregorianToOrdinal", "gregData", "ordinalToGregorian", "ordinalData", "usesLocalWeekValues", "obj", "loc", "isUndefined", "ConflictingSpecificationError", "hasInvalidWeekData", "validYear", "isInteger", "validWeek", "integerBetween", "validWeekday", "hasInvalidOrdinalData", "validOrdinal", "hasInvalidGregorianData", "validMonth", "validDay", "daysInMonth", "hasInvalidTimeData", "hour", "minute", "second", "millisecond", "validHour", "validMinute", "validSecond", "validMillisecond", "isUndefined", "o", "isNumber", "isInteger", "isString", "isDate", "hasRelative", "hasLocaleWeekInfo", "maybeArray", "thing", "bestBy", "arr", "by", "compare", "best", "next", "pair", "pick", "obj", "keys", "a", "k", "hasOwnProperty", "prop", "validateWeekSettings", "settings", "InvalidArgumentError", "integerBetween", "v", "bottom", "top", "floorMod", "x", "n", "padStart", "input", "isNeg", "padded", "parseInteger", "string", "parseFloating", "parseMillis", "fraction", "f", "roundTo", "number", "digits", "towardZero", "factor", "isLeapYear", "year", "daysInYear", "daysInMonth", "month", "modMonth", "modYear", "objToLocalTS", "d", "firstWeekOffset", "minDaysInFirstWeek", "startOfWeek", "isoWeekdayToLocal", "dayOfWeek", "weeksInWeekYear", "weekYear", "weekOffset", "weekOffsetNext", "untruncateYear", "Settings", "parseZoneInfo", "ts", "offsetFormat", "locale", "timeZone", "date", "intlOpts", "modified", "parsed", "m", "signedOffset", "offHourStr", "offMinuteStr", "offHour", "offMin", "offMinSigned", "asNumber", "value", "numericValue", "normalizeObject", "normalizer", "normalized", "u", "formatOffset", "offset", "format", "hours", "minutes", "sign", "timeObject", "monthsLong", "monthsShort", "monthsNarrow", "months", "length", "weekdaysLong", "weekdaysShort", "weekdaysNarrow", "weekdays", "meridiems", "erasLong", "erasShort", "erasNarrow", "eras", "meridiemForDateTime", "dt", "weekdayForDateTime", "monthForDateTime", "eraForDateTime", "formatRelativeTime", "unit", "count", "numeric", "narrow", "units", "lastable", "isDay", "isInPast", "fmtValue", "singular", "lilUnits", "fmtUnit", "stringifyTokens", "splits", "tokenToString", "s", "token", "macroTokenToFormatOpts", "DATE_SHORT", "DATE_MED", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_MED", "DATETIME_FULL", "DATETIME_HUGE", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED_WITH_SECONDS", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE_WITH_SECONDS", "Formatter", "_Formatter", "locale", "opts", "fmt", "current", "currentFull", "bracketed", "i", "c", "formatOpts", "dt", "interval", "n", "p", "padStart", "knownEnglish", "useDateTimeFormatter", "string", "extract", "formatOffset", "meridiem", "meridiemForDateTime", "month", "length", "standalone", "monthForDateTime", "weekday", "weekdayForDateTime", "maybeMacro", "era", "eraForDateTime", "dur", "tokenToField", "lildur", "mapped", "tokens", "realTokens", "found", "literal", "val", "collapsed", "t", "init_dirname", "init_buffer", "init_process", "ianaRegex", "combineRegexes", "regexes", "full", "f", "r", "combineExtractors", "extractors", "m", "mergedVals", "mergedZone", "cursor", "ex", "val", "zone", "next", "parse", "s", "patterns", "regex", "extractor", "simpleParse", "keys", "match", "ret", "parseInteger", "offsetRegex", "isoExtendedZone", "isoTimeBaseRegex", "isoTimeRegex", "isoTimeExtensionRegex", "isoYmdRegex", "isoWeekRegex", "isoOrdinalRegex", "extractISOWeekData", "extractISOOrdinalData", "sqlYmdRegex", "sqlTimeRegex", "sqlTimeExtensionRegex", "int", "pos", "fallback", "isUndefined", "extractISOYmd", "extractISOTime", "parseMillis", "extractISOOffset", "local", "fullOffset", "signedOffset", "FixedOffsetZone", "extractIANAZone", "IANAZone", "isoTimeOnly", "isoDuration", "extractISODuration", "yearStr", "monthStr", "weekStr", "dayStr", "hourStr", "minuteStr", "secondStr", "millisecondsStr", "hasNegativePrefix", "negativeSeconds", "maybeNegate", "num", "force", "parseFloating", "obsOffsets", "fromStrings", "weekdayStr", "result", "untruncateYear", "monthsShort", "weekdaysLong", "weekdaysShort", "rfc2822", "extractRFC2822", "obsOffset", "milOffset", "offHourStr", "offMinuteStr", "offset", "preprocessRFC2822", "rfc1123", "rfc850", "ascii", "extractRFC1123Or850", "extractASCII", "isoYmdWithTimeExtensionRegex", "isoWeekWithTimeExtensionRegex", "isoOrdinalWithTimeExtensionRegex", "isoTimeCombinedRegex", "extractISOYmdTimeAndOffset", "extractISOWeekTimeAndOffset", "extractISOOrdinalDateAndTime", "extractISOTimeAndOffset", "parseISODate", "parseRFC2822Date", "parseHTTPDate", "parseISODuration", "extractISOTimeOnly", "parseISOTimeOnly", "sqlYmdWithTimeExtensionRegex", "sqlTimeCombinedRegex", "extractISOTimeOffsetAndIANAZone", "parseSQL", "INVALID", "lowOrderMatrix", "casualMatrix", "daysInYearAccurate", "daysInMonthAccurate", "accurateMatrix", "orderedUnits", "reverseUnits", "clone", "dur", "alts", "clear", "conf", "Duration", "durationToMillis", "matrix", "vals", "sum", "unit", "normalizeValues", "factor", "previous", "current", "isUndefined", "previousVal", "conv", "rollUp", "fraction", "removeZeroes", "newVals", "key", "value", "_Duration", "config", "accurate", "Locale", "count", "opts", "obj", "InvalidArgumentError", "normalizeObject", "durationLike", "isNumber", "text", "parsed", "parseISODuration", "parseISOTimeOnly", "reason", "explanation", "invalid", "Invalid", "Settings", "InvalidDurationError", "normalized", "InvalidUnitError", "o", "fmt", "fmtOpts", "Formatter", "l", "val", "s", "roundTo", "millis", "DateTime", "duration", "result", "k", "hasOwnProperty", "fn", "asNumber", "values", "mixed", "locale", "numberingSystem", "conversionAccuracy", "units", "built", "accumulated", "lastUnit", "own", "ak", "i", "negated", "other", "eq", "v1", "v2", "u", "init_dirname", "init_buffer", "init_process", "INVALID", "validateStartEnd", "start", "end", "Interval", "_Interval", "config", "reason", "explanation", "InvalidArgumentError", "invalid", "Invalid", "Settings", "InvalidIntervalError", "builtStart", "friendlyDateTime", "builtEnd", "validateError", "duration", "dur", "Duration", "dt", "text", "opts", "s", "e", "startIsValid", "DateTime", "endIsValid", "o", "unit", "dateTime", "dateTimes", "sorted", "d", "a", "b", "results", "i", "added", "next", "idx", "x", "numberOfParts", "other", "intervals", "found", "final", "sofar", "current", "item", "currentCount", "ends", "flattened", "arr", "formatOpts", "DATE_SHORT", "Formatter", "dateFormat", "separator", "mapFn", "init_dirname", "init_buffer", "init_process", "Info", "zone", "Settings", "proto", "DateTime", "IANAZone", "input", "normalizeZone", "locale", "locObj", "Locale", "length", "numberingSystem", "outputCalendar", "hasRelative", "hasLocaleWeekInfo", "init_dirname", "init_buffer", "init_process", "dayDiff", "earlier", "later", "utcDayStart", "dt", "ms", "Duration", "highOrderDiffs", "cursor", "units", "differs", "b", "days", "results", "lowestOrder", "highWater", "unit", "differ", "diff_default", "opts", "remainingMillis", "lowerOrderUnits", "u", "duration", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "numberingSystems", "numberingSystemsUTF16", "hanidecChars", "parseDigits", "str", "value", "i", "code", "key", "min", "max", "digitRegex", "numberingSystem", "append", "MISSING_FTP", "intUnit", "regex", "post", "i", "s", "parseDigits", "NBSP", "spaceOrNBSP", "spaceOrNBSPRegExp", "fixListRegex", "stripInsensitivities", "oneOf", "strings", "startIndex", "offset", "groups", "h", "m", "signedOffset", "simple", "escapeToken", "value", "unitForToken", "token", "loc", "one", "digitRegex", "two", "three", "four", "six", "oneOrTwo", "oneToThree", "oneToSix", "oneToNine", "twoToFour", "fourToSix", "literal", "t", "unit", "untruncateYear", "partTypeStyleToTokenVal", "tokenForPart", "part", "formatOpts", "resolvedOpts", "type", "isSpace", "style", "actualType", "val", "buildRegex", "units", "u", "f", "r", "match", "input", "handlers", "matches", "all", "matchIndex", "hasOwnProperty", "dateTimeFromMatches", "toField", "zone", "specificOffset", "isUndefined", "IANAZone", "FixedOffsetZone", "parseMillis", "k", "dummyDateTimeCache", "getDummyDateTime", "DateTime", "maybeExpandMacroToken", "locale", "Formatter", "tokens", "formatOptsToTokens", "expandMacroTokens", "explainFromTokens", "format", "disqualifyingUnit", "regexString", "rawMatches", "result", "ConflictingSpecificationError", "parseFromTokens", "invalidReason", "df", "parts", "p", "INVALID", "MAX_DATE", "unsupportedZone", "zone", "Invalid", "possiblyCachedWeekData", "dt", "gregorianToWeek", "possiblyCachedLocalWeekData", "clone", "inst", "alts", "current", "DateTime", "fixOffset", "localTS", "o", "tz", "utcGuess", "o2", "o3", "tsToObj", "ts", "offset", "d", "objToTS", "obj", "objToLocalTS", "adjustTime", "dur", "oPre", "year", "month", "c", "daysInMonth", "millisToAdd", "Duration", "parseDataToDateTime", "parsed", "parsedZone", "opts", "format", "text", "specificOffset", "setZone", "interpretationZone", "toTechFormat", "allowZ", "Formatter", "Locale", "toISODate", "extended", "longFormat", "padStart", "toISOTime", "suppressSeconds", "suppressMilliseconds", "includeOffset", "extendedZone", "defaultUnitValues", "defaultWeekUnitValues", "defaultOrdinalUnitValues", "orderedUnits", "orderedWeekUnits", "orderedOrdinalUnits", "normalizeUnit", "unit", "normalized", "InvalidUnitError", "normalizeUnitWithLocalWeeks", "quickDT", "normalizeZone", "Settings", "loc", "tsNow", "isUndefined", "u", "invalid", "hasInvalidGregorianData", "hasInvalidTimeData", "offsetProvis", "diffRelative", "start", "end", "round", "roundTo", "differ", "count", "lastOpts", "argList", "args", "_DateTime", "config", "ot", "day", "hour", "minute", "second", "millisecond", "FixedOffsetZone", "date", "options", "isDate", "zoneToUse", "milliseconds", "isNumber", "InvalidArgumentError", "seconds", "normalizeObject", "minDaysInFirstWeek", "startOfWeek", "usesLocalWeekValues", "containsOrdinal", "containsGregorYear", "containsGregorMD", "containsGregor", "definiteWeekDef", "ConflictingSpecificationError", "useWeekData", "units", "defaultValues", "objNow", "gregorianToOrdinal", "foundFirst", "v", "higherOrderInvalid", "hasInvalidWeekData", "hasInvalidOrdinalData", "gregorian", "weekToGregorian", "ordinalToGregorian", "tsFinal", "offsetFinal", "vals", "parseISODate", "parseRFC2822Date", "parseHTTPDate", "fmt", "locale", "numberingSystem", "localeToUse", "parseFromTokens", "parseSQL", "reason", "explanation", "InvalidDateTimeError", "formatOpts", "localeOpts", "tokenList", "formatOptsToTokens", "t", "expandMacroTokens", "Info", "dayMs", "minuteMs", "oEarlier", "oLater", "o1", "ts1", "ts2", "c1", "c2", "isLeapYear", "daysInYear", "weeksInWeekYear", "calendar", "keepLocalTime", "keepCalendarTime", "newTS", "offsetGuess", "asObj", "outputCalendar", "values", "settingWeekStuff", "mixed", "duration", "useLocaleWeeks", "normalizedUnit", "weekday", "q", "DATE_SHORT", "ext", "includePrefix", "includeZone", "includeOffsetSpace", "base", "otherDateTime", "durOpts", "maybeArray", "otherIsLater", "earlier", "later", "diffed", "diff_default", "Interval", "inputMs", "adjustedToZone", "other", "padding", "dateTimes", "bestBy", "i", "explainFromTokens", "DATE_MED", "DATE_MED_WITH_WEEKDAY", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED", "DATETIME_MED_WITH_SECONDS", "DATETIME_MED_WITH_WEEKDAY", "DATETIME_FULL", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE", "DATETIME_HUGE_WITH_SECONDS", "friendlyDateTime", "dateTimeish", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "_extends", "n", "e", "t", "r", "init_dirname", "init_buffer", "init_process", "DEFAULT_CONFIG", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "isNumber", "x", "isBigNumber", "isBigInt", "isComplex", "isFraction", "isUnit", "isString", "isArray", "isMatrix", "isCollection", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isObject", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "rule2Node", "node", "isOperatorNode", "isFunctionAssignmentNode", "isFunctionNode", "isIndexNode", "isNode", "isObjectNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isChain", "typeOf", "clone", "x", "type", "value", "isBigNumber", "isObject", "mapObject", "object", "callback", "key", "hasOwnProperty", "extend", "a", "b", "prop", "deepExtend", "deepStrictEqual", "i", "len", "deepFlatten", "nestedObject", "flattenedObject", "_deepFlatten", "lazy", "object", "prop", "valueResolver", "_uninitialized", "_value", "value", "hasOwnProperty", "object", "property", "isLegacyFactory", "pickShallow", "object", "properties", "copy", "i", "key", "value", "MATRIX_OPTIONS", "NUMBER_OPTIONS", "configFactory", "config", "emit", "_config", "options", "optionsFix", "clone", "prev", "validateOption", "deepExtend", "curr", "changes", "DEFAULT_CONFIG", "key", "name", "values", "value", "factoriesAny_exports", "__export", "createAbs", "createAccessorNode", "createAcos", "createAcosh", "createAcot", "createAcoth", "createAcsc", "createAcsch", "createAdd", "createAddScalar", "createAnd", "createAndTransform", "createApply", "createApplyTransform", "createArg", "createArrayNode", "createAsec", "createAsech", "createAsin", "createAsinh", "createAssignmentNode", "createAtan", "createAtan2", "createAtanh", "createAtomicMass", "createAvogadro", "createBellNumbers", "createBigNumberClass", "createBigint", "createBignumber", "createBin", "createBitAnd", "createBitAndTransform", "createBitNot", "createBitOr", "createBitOrTransform", "createBitXor", "createBlockNode", "createBohrMagneton", "createBohrRadius", "createBoltzmann", "createBoolean", "createCatalan", "createCbrt", "createCeil", "createChain", "createChainClass", "createClassicalElectronRadius", "createClone", "createColumn", "createColumnTransform", "createCombinations", "createCombinationsWithRep", "createCompare", "createCompareNatural", "createCompareText", "createCompile", "createComplex", "createComplexClass", "createComposition", "createConcat", "createConcatTransform", "createConditionalNode", "createConductanceQuantum", "createConj", "createConstantNode", "createCorr", "createCos", "createCosh", "createCot", "createCoth", "createCoulomb", "createCount", "createCreateUnit", "createCross", "createCsc", "createCsch", "createCtranspose", "createCube", "createCumSum", "createCumSumTransform", "createDeepEqual", "createDenseMatrixClass", "createDerivative", "createDet", "createDeuteronMass", "createDiag", "createDiff", "createDiffTransform", "createDistance", "createDivide", "createDivideScalar", "createDot", "createDotDivide", "createDotMultiply", "createDotPow", "createE", "createEfimovFactor", "createEigs", "createElectricConstant", "createElectronMass", "createElementaryCharge", "createEqual", "createEqualScalar", "createEqualText", "createErf", "createEvaluate", "createExp", "createExpm", "createExpm1", "createFactorial", "createFalse", "createFaraday", "createFermiCoupling", "createFft", "createFibonacciHeapClass", "createFilter", "createFilterTransform", "createFineStructure", "createFirstRadiation", "createFix", "createFlatten", "createFloor", "createForEach", "createForEachTransform", "createFormat", "createFraction", "createFractionClass", "createFreqz", "createFunctionAssignmentNode", "createFunctionNode", "createGamma", "createGasConstant", "createGcd", "createGetMatrixDataType", "createGravitationConstant", "createGravity", "createHartreeEnergy", "createHasNumericValue", "createHelp", "createHelpClass", "createHex", "createHypot", "createI", "createIdentity", "createIfft", "createIm", "createImmutableDenseMatrixClass", "createIndex", "createIndexClass", "createIndexNode", "createIndexTransform", "createInfinity", "createIntersect", "createInv", "createInverseConductanceQuantum", "createInvmod", "createIsInteger", "createIsNaN", "createIsNegative", "createIsNumeric", "createIsPositive", "createIsPrime", "createIsZero", "createKldivergence", "createKlitzing", "createKron", "createLN10", "createLN2", "createLOG10E", "createLOG2E", "createLarger", "createLargerEq", "createLcm", "createLeafCount", "createLeftShift", "createLgamma", "createLog", "createLog10", "createLog1p", "createLog2", "createLoschmidt", "createLsolve", "createLsolveAll", "createLup", "createLusolve", "createLyap", "createMad", "createMagneticConstant", "createMagneticFluxQuantum", "createMap", "createMapTransform", "createMatrix", "createMatrixClass", "createMatrixFromColumns", "createMatrixFromFunction", "createMatrixFromRows", "createMax", "createMaxTransform", "createMean", "createMeanTransform", "createMedian", "createMin", "createMinTransform", "createMod", "createMode", "createMolarMass", "createMolarMassC12", "createMolarPlanckConstant", "createMolarVolume", "createMultinomial", "createMultiply", "createMultiplyScalar", "createNaN", "createNeutronMass", "createNode", "createNorm", "createNot", "createNthRoot", "createNthRoots", "createNuclearMagneton", "createNull", "createNumber", "createNumeric", "createObjectNode", "createOct", "createOnes", "createOperatorNode", "createOr", "createOrTransform", "createParenthesisNode", "createParse", "createParser", "createParserClass", "createPartitionSelect", "createPermutations", "createPhi", "createPi", "createPickRandom", "createPinv", "createPlanckCharge", "createPlanckConstant", "createPlanckLength", "createPlanckMass", "createPlanckTemperature", "createPlanckTime", "createPolynomialRoot", "createPow", "createPrint", "createPrintTransform", "createProd", "createProtonMass", "createQr", "createQuantileSeq", "createQuantileSeqTransform", "createQuantumOfCirculation", "createRandom", "createRandomInt", "createRange", "createRangeClass", "createRangeNode", "createRangeTransform", "createRationalize", "createRe", "createReducedPlanckConstant", "createRelationalNode", "createReplacer", "createReshape", "createResize", "createResolve", "createResultSet", "createReviver", "createRightArithShift", "createRightLogShift", "createRotate", "createRotationMatrix", "createRound", "createRow", "createRowTransform", "createRydberg", "createSQRT1_2", "createSQRT2", "createSackurTetrode", "createSchur", "createSec", "createSech", "createSecondRadiation", "createSetCartesian", "createSetDifference", "createSetDistinct", "createSetIntersect", "createSetIsSubset", "createSetMultiplicity", "createSetPowerset", "createSetSize", "createSetSymDifference", "createSetUnion", "createSign", "createSimplify", "createSimplifyConstant", "createSimplifyCore", "createSin", "createSinh", "createSize", "createSlu", "createSmaller", "createSmallerEq", "createSolveODE", "createSort", "createSpaClass", "createSparse", "createSparseMatrixClass", "createSpeedOfLight", "createSplitUnit", "createSqrt", "createSqrtm", "createSquare", "createSqueeze", "createStd", "createStdTransform", "createStefanBoltzmann", "createStirlingS2", "createString", "createSubset", "createSubsetTransform", "createSubtract", "createSubtractScalar", "createSum", "createSumTransform", "createSylvester", "createSymbolNode", "createSymbolicEqual", "createTan", "createTanh", "createTau", "createThomsonCrossSection", "createTo", "createTrace", "createTranspose", "createTrue", "createTypeOf", "createTyped", "createUnaryMinus", "createUnaryPlus", "createUnequal", "createUnitClass", "createUnitFunction", "createUppercaseE", "createUppercasePi", "createUsolve", "createUsolveAll", "createVacuumImpedance", "createVariance", "createVarianceTransform", "createVersion", "createWeakMixingAngle", "createWienDisplacement", "createXgcd", "createXor", "createZeros", "createZeta", "createZpk2tf", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "import_typed_function", "init_dirname", "init_buffer", "init_process", "isInteger", "value", "isIntegerStr", "str", "safeNumberType", "numberStr", "config", "sign", "x", "log2", "log10", "log1p", "cbrt", "negate", "result", "expm1", "formatNumberToBase", "n", "base", "size", "prefixes", "prefix", "suffix", "format", "options", "notation", "precision", "wordSize", "normalizeFormatOptions", "toFixed", "toExponential", "toEngineering", "toPrecision", "digits", "e", "isNumber", "isBigNumber", "isObject", "_toNumberOrThrow", "splitNumber", "match", "exponent", "dot", "coefficients", "zeros", "d", "split", "rounded", "roundDigits", "c", "newExp", "missingZeros", "i", "expDiff", "decimalIdx", "decimals", "decimalVal", "splitValue", "p", "pp", "first", "lowerExp", "_toNumberOrDefault", "upperExp", "removed", "length", "arr", "DBL_EPSILON", "nearlyEqual", "a", "b", "relTol", "absTol", "acosh", "asinh", "atanh", "cosh", "sinh", "tanh", "copysign", "y", "signx", "signy", "onError", "defaultValue", "init_dirname", "init_buffer", "init_process", "factory", "name", "dependencies", "create", "meta", "assertAndCreate", "scope", "deps", "pickShallow", "stripOptionalNotation", "assertDependencies", "isFactory", "obj", "assertDependencies", "name", "dependencies", "scope", "allDefined", "dependency", "isOptionalDependency", "missingDependencies", "d", "stripOptionalNotation", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "getSafeProperty", "object", "prop", "isPlainObject", "isSafeProperty", "isSafeMethod", "setSafeProperty", "value", "hasSafeProperty", "object", "prop", "isSafeProperty", "hasOwnProperty", "safeNativeProperties", "getSafeMethod", "method", "isSafeMethod", "safeNativeMethods", "isPlainObject", "ObjectWrappingMap", "object", "key", "getSafeProperty", "value", "setSafeProperty", "hasSafeProperty", "mapIterator", "callback", "PartitionedMap", "a", "b", "bKeys", "it", "n", "createEmptyMap", "createMap", "mapOrObject", "isMap", "isObject", "toObject", "map", "_createTyped2", "typedFunction", "dependencies", "createTyped", "factory", "_ref", "BigNumber", "Complex", "DenseMatrix", "Fraction", "typed", "isNumber", "isComplex", "isBigNumber", "isBigInt", "isFraction", "isUnit", "s", "isString", "isChain", "isArray", "isMatrix", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "isFunctionNode", "isFunctionAssignmentNode", "isIndexNode", "isNode", "isObjectNode", "isOperatorNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isMap", "isObject", "x", "throwNoBignumber", "digits", "throwNoComplex", "throwNoFraction", "f", "n", "array", "throwNoMatrix", "matrix", "name", "args", "signatures", "usualError", "isCollection", "sig", "err", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createResultSet", "factory", "ResultSet", "entries", "json", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "EXP_LIMIT", "MAX_DIGITS", "NUMERALS", "LN10", "PI", "DEFAULTS", "inexact", "quadrant", "external", "decimalError", "invalidArgument", "precisionLimitExceeded", "cryptoUnavailable", "tag", "mathfloor", "mathpow", "isBinary", "isHex", "isOctal", "isDecimal", "BASE", "LOG_BASE", "MAX_SAFE_INTEGER", "LN10_PRECISION", "PI_PRECISION", "P", "x", "finalise", "min", "max", "k", "Ctor", "y", "i", "j", "xdL", "ydL", "xd", "yd", "xs", "ys", "pr", "rm", "cosine", "toLessThanHalfPi", "m", "n", "r", "rep", "s", "sd", "t", "t3", "t3plusx", "digitsToString", "divide", "w", "d", "len", "one", "tinyPow", "taylorSeries", "cosh2_x", "d8", "sinh2_x", "d5", "d16", "d20", "halfPi", "getPi", "wpr", "xsd", "px", "x2", "base", "isBase10", "denominator", "inf", "num", "arg", "guard", "naturalLogarithm", "getLn10", "checkRoundingDigits", "e", "xe", "xLTy", "getBase10Exponent", "q", "naturalExponential", "carry", "z", "getPrecision", "sine", "rL", "toStringBinary", "dp", "checkInt32", "str", "finiteToString", "maxD", "d0", "d1", "d2", "n0", "n1", "yn", "intPow", "ws", "indexOfLastWord", "getZeroString", "repeating", "di", "rd", "convertBase", "baseIn", "baseOut", "arr", "arrL", "strL", "cos2x", "multiplyInteger", "temp", "compare", "a", "b", "aL", "bL", "subtract", "cmp", "logBase", "more", "prod", "prodL", "qd", "rem", "remL", "rem0", "xi", "xL", "yd0", "yL", "yz", "sign", "isTruncated", "digits", "roundUp", "xdi", "out", "isExp", "nonFiniteToString", "zs", "truncate", "isOdd", "maxOrMin", "args", "ltgt", "pow", "sum", "c", "c0", "numerator", "x1", "parseDecimal", "parseOther", "divisor", "isFloat", "p", "Decimal", "sin2_x", "isHyperbolic", "u", "isNeg", "pi", "abs", "acos", "acosh", "add", "asin", "asinh", "atan", "atanh", "atan2", "cbrt", "ceil", "clamp", "config", "obj", "v", "useDefaults", "ps", "cos", "cosh", "clone", "isDecimalInstance", "div", "exp", "floor", "hypot", "ln", "log", "log10", "log2", "mod", "mul", "random", "round", "sin", "sinh", "sqrt", "sub", "tan", "tanh", "trunc", "decimal_default", "name", "dependencies", "createBigNumberClass", "factory", "_ref", "on", "config", "BigNumber", "decimal_default", "json", "curr", "prev", "init_dirname", "init_buffer", "init_process", "import_complex", "name", "dependencies", "createComplexClass", "factory", "Complex", "options", "str", "im", "re", "strRe", "format", "strIm", "precision", "isNumber", "epsilon", "args", "arg", "phi", "isUnit", "json", "a", "b", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "MAX_CYCLE_LEN", "P", "assign", "n", "s", "InvalidParameter", "newFraction", "d", "DivisionByZero", "f", "Fraction", "a", "gcd", "factorize", "num", "factors", "i", "parse", "p1", "p2", "v", "w", "x", "y", "z", "A", "B", "C", "D", "N", "M", "NonIntegerParameter", "modpow", "b", "e", "m", "r", "cycleLen", "rem", "t", "cycleStart", "len", "rem1", "rem2", "places", "k", "eps", "thisABS", "cont", "excludeWhole", "whole", "str", "res", "dec", "cycLen", "cycOff", "name", "dependencies", "createFractionClass", "factory", "Fraction", "json", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRangeClass", "factory", "Range", "start", "end", "step", "hasStart", "hasEnd", "hasStep", "isBigNumber", "str", "args", "nums", "arg", "invalid", "num", "len", "diff", "sign", "size", "callback", "x", "i", "array", "value", "index", "obj", "options", "format", "json", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatrixClass", "factory", "Matrix", "data", "datatype", "index", "replacement", "defaultValue", "value", "size", "callback", "skipZeros", "options", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "formatBigNumberToBase", "n", "base", "size", "BigNumberCtor", "big2", "suffix", "isInteger", "format", "value", "options", "notation", "precision", "wordSize", "normalizeFormatOptions", "toFixed", "toExponential", "toEngineering", "lowerExp", "_toNumberOrDefault", "upperExp", "str", "rounded", "exp", "digits", "e", "newExp", "valueWithoutExp", "valueStr", "BigNumber", "defaultValue", "isNumber", "isBigNumber", "endsWith", "text", "search", "start", "end", "format", "value", "options", "result", "_format", "isBigNumber", "looksLikeFraction", "formatArray", "isString", "stringify", "entries", "key", "escaped", "i", "c", "controlCharacters", "escape", "array", "str", "len", "compareText", "x", "y", "typeOf", "init_dirname", "init_buffer", "init_process", "DimensionError", "actual", "expected", "relation", "init_dirname", "init_buffer", "init_process", "IndexError", "index", "min", "max", "arraySize", "x", "s", "_validate", "array", "size", "dim", "i", "len", "DimensionError", "dimNext", "child", "validate", "isScalar", "validateIndexSourceSize", "value", "index", "valueSize", "sourceSize", "sourceDim", "validateIndex", "length", "isNumber", "isInteger", "IndexError", "isEmptyIndex", "dimension", "isArray", "isString", "resize", "defaultValue", "format", "isBigNumber", "_defaultValue", "_resize", "elem", "oldLen", "newLen", "minLen", "reshape", "sizes", "flatArray", "flatten", "currentLength", "processSizesWildcard", "newLength", "product", "_reshape", "e", "processedSizes", "WILDCARD", "wildCardIndex", "isMoreThanOneWildcard", "hasWildcard", "canReplaceWildcard", "prev", "curr", "tmpArray", "tmpArray2", "sizeIndex", "squeeze", "dims", "_squeeze", "ii", "next", "unsqueeze", "outer", "_unsqueeze", "d", "flat", "callback", "map", "forEach", "filter", "filterRegExp", "regexp", "entry", "join", "separator", "identify", "a", "b", "count", "generalize", "getArrayDataType", "typeOf", "type", "item", "_isArray", "itemType", "concatRecursive", "a", "b", "concatDim", "dim", "DimensionError", "c", "i", "concat", "arrays", "A", "B", "broadcastSizes", "_len", "sizes", "_key", "dimensions", "s", "N", "sizeMax", "size", "j", "n", "_i", "checkBroadcastingRules", "toSize", "broadcastTo", "array", "Asize", "arraySize", "deepStrictEqual", "broadcastedSize", "paddedSize", "clone", "reshape", "stretch", "stretch", "arrayToStretch", "sizeToStretch", "dimToStretch", "concat", "clone", "array", "_extends", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "lruQueue", "limit", "size", "base", "queue", "map", "index", "del", "id", "oldIndex", "nuIndex", "memoize", "fn", "hasher", "limit", "lruQueue", "args", "i", "hash", "newVal", "maxArgumentCount", "fn", "args", "signature", "count", "name", "dependencies", "createDenseMatrixClass", "factory", "_ref", "Matrix", "DenseMatrix", "data", "datatype", "isString", "isMatrix", "clone", "isArray", "validate", "preprocess", "arraySize", "typeOf", "getArrayDataType", "index", "replacement", "defaultValue", "_get", "_set", "DimensionError", "x", "validateIndex", "i", "ii", "indexI", "value", "size", "_fit", "matrix", "isIndex", "isScalar", "min", "max", "_getSubmatrix", "dims", "dim", "last", "range", "child", "submatrix", "iSize", "sSize", "deepStrictEqual", "broadcastTo", "outer", "unsqueeze", "_setSubmatrix", "dataIndex", "subIndex", "copy", "isCollection", "sizeArray", "m", "_resize", "v", "resize", "reshape", "currentLength", "length", "processSizesWildcard", "newSize", "changed", "callback", "me", "args", "maxArgumentCount", "recurse", "result", "s", "row", "_this", "_loop", "col", "options", "format", "k", "isBigNumber", "isNumber", "isInteger", "kSuper", "kSub", "rows", "columns", "n", "_value", "ms", "d", "json", "j", "vi", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createClone", "factory", "_ref", "typed", "clone", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "_switch", "mat", "I", "J", "i", "j", "ret", "tmp", "containsCollections", "array", "i", "isCollection", "deepForEach", "callback", "isMatrix", "ii", "value", "deepMap", "skipZeros", "x", "reduce", "mat", "dim", "size", "arraySize", "IndexError", "_reduce", "ret", "val", "tran", "_switch", "scatter", "a", "j", "w", "u", "mark", "cindex", "f", "inverse", "update", "avalues", "aindex", "aptr", "k", "k0", "k1", "name", "dependencies", "createIsInteger", "factory", "_ref", "typed", "isInteger", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "n1", "n2", "absNumber", "a", "addNumber", "b", "subtractNumber", "multiplyNumber", "divideNumber", "unaryMinusNumber", "x", "unaryPlusNumber", "cbrtNumber", "cbrt", "cubeNumber", "expNumber", "expm1Number", "expm1", "gcdNumber", "isInteger", "lcmNumber", "t", "prod", "logNumber", "y", "log10Number", "log10", "log2Number", "log2", "log1pNumber", "log1p", "modNumber", "nthRootNumber", "root", "inv", "signNumber", "sign", "sqrtNumber", "squareNumber", "xgcdNumber", "q", "r", "lastx", "lasty", "res", "powNumber", "roundNumber", "value", "decimals", "toFixed", "normNumber", "init_dirname", "init_buffer", "init_process", "n1", "n2", "bitAndNumber", "x", "y", "isInteger", "bitNotNumber", "bitOrNumber", "bitXorNumber", "leftShiftNumber", "rightArithShiftNumber", "rightLogShiftNumber", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "product", "i", "n", "half", "combinationsNumber", "n", "k", "isInteger", "nMinusk", "answer", "firstnumerator", "nextdivisor", "lastdivisor", "nextnumerator", "product", "init_dirname", "init_buffer", "init_process", "pi", "tau", "e", "phi", "init_dirname", "init_buffer", "init_process", "n1", "n2", "notNumber", "x", "orNumber", "y", "xorNumber", "andNumber", "init_dirname", "init_buffer", "init_process", "gammaNumber", "n", "x", "isInteger", "product", "twoN", "threeN", "fourN", "fiveN", "gammaP", "i", "t", "gammaG", "lnSqrt2PI", "lgammaG", "lgammaN", "lgammaSeries", "lgammaNumber", "base", "sum", "init_dirname", "init_buffer", "init_process", "n1", "n2", "acosNumber", "x", "acoshNumber", "acosh", "acotNumber", "acothNumber", "acscNumber", "acschNumber", "xInv", "asecNumber", "asechNumber", "ret", "asinNumber", "asinhNumber", "asinh", "atanNumber", "atan2Number", "y", "atanhNumber", "atanh", "cosNumber", "coshNumber", "cosh", "cotNumber", "cothNumber", "e", "cscNumber", "cschNumber", "sign", "secNumber", "sechNumber", "sinNumber", "sinhNumber", "sinh", "tanNumber", "tanhNumber", "tanh", "init_dirname", "init_buffer", "init_process", "n1", "isIntegerNumber", "x", "isInteger", "isNegativeNumber", "isPositiveNumber", "isZeroNumber", "isNaNNumber", "init_dirname", "init_buffer", "init_process", "nearlyEqual", "a", "b", "relTol", "absTol", "name", "dependencies", "createIsNegative", "factory", "_ref", "typed", "config", "x", "nearlyEqual", "isNegativeNumber", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsNumeric", "factory", "_ref", "typed", "self", "x", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createHasNumericValue", "factory", "_ref", "typed", "isNumeric", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsPositive", "factory", "_ref", "typed", "config", "x", "nearlyEqual", "isPositiveNumber", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsZero", "factory", "_ref", "typed", "equalScalar", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsNaN", "factory", "_ref", "typed", "isNaNNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTypeOf", "factory", "_ref", "typed", "typeOf", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "complexEquals", "x", "y", "relTol", "absTol", "nearlyEqual", "init_dirname", "init_buffer", "init_process", "createCompareUnits", "factory", "_ref", "typed", "self", "x", "y", "name", "dependencies", "createEqualScalar", "factory", "_ref", "typed", "config", "compareUnits", "createCompareUnits", "x", "y", "nearlyEqual", "complexEquals", "createEqualScalarNumber", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSparseMatrixClass", "factory", "_ref", "typed", "equalScalar", "Matrix", "SparseMatrix", "data", "datatype", "isString", "isMatrix", "_createFromMatrix", "isArray", "_createFromArray", "typeOf", "matrix", "source", "clone", "rows", "columns", "eq", "zero", "j", "i", "row", "v", "getArrayDataType", "index", "replacement", "defaultValue", "_getsubset", "_setsubset", "idx", "isIndex", "isScalar", "size", "DimensionError", "ii", "k", "kk", "min", "max", "validateIndex", "mvalues", "mindex", "mptr", "w", "pv", "r", "values", "ptr", "submatrix", "iSize", "sSize", "arraySize", "outer", "unsqueeze", "deepStrictEqual", "range", "dataIndex", "subIndex", "firstDimensionRange", "secondDimensionRange", "firstDataIndex", "firstSubIndex", "secondDataIndex", "secondSubIndex", "_getValueIndex", "_resize", "_remove", "_insert", "top", "bottom", "x", "copy", "isCollection", "sizeArray", "value", "isNumber", "isInteger", "format", "m", "ins", "c", "n", "p", "d", "k0", "k1", "sizes", "currentLength", "processSizesWildcard", "newLength", "colIndex", "rowIndex", "_i", "r1", "c1", "flat", "_i2", "h", "_i3", "_j", "callback", "skipZeros", "me", "args", "maxArgumentCount", "invoke", "_map", "minRow", "maxRow", "minColumn", "maxColumn", "y", "_values", "_k", "_i4", "_i5", "_k2", "_i6", "_i7", "_toArray", "a", "options", "density", "str", "isBigNumber", "kSuper", "kSub", "json", "s", "_value", "ms", "kx", "ky", "vx", "vy", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "getNonDecimalNumberParts", "input", "nonDecimalWithRadixMatch", "radix", "integerPart", "fractionalPart", "makeNumberFromNonDecimalParts", "parts", "n", "f", "i", "digitValue", "result", "createNumber", "factory", "_ref", "typed", "number", "x", "nonDecimalNumberParts", "size", "wordSizeSuffixMatch", "num", "self", "clone", "unit", "valuelessUnit", "deepMap", "json", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBigint", "factory", "_ref", "typed", "bigint", "x", "self", "deepMap", "json", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createString", "factory", "_ref", "typed", "format", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBoolean", "factory", "_ref", "typed", "x", "lcase", "num", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBignumber", "factory", "_ref", "typed", "BigNumber", "x", "wordSizeSuffixMatch", "size", "n", "twoPowSize", "twoPowSizeSubOne", "self", "clone", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createComplex", "factory", "_ref", "typed", "Complex", "x", "re", "im", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFraction", "factory", "_ref", "typed", "Fraction", "x", "numerator", "denominator", "self", "clone", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatrix", "factory", "_ref", "typed", "Matrix", "DenseMatrix", "SparseMatrix", "_create", "format", "datatype", "data", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatrixFromFunction", "factory", "_ref", "typed", "matrix", "isZero", "size", "fn", "format", "datatype", "_create", "m", "_", "index", "val", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatrixFromRows", "factory", "_ref", "typed", "matrix", "flatten", "size", "arr", "_createArray", "m", "N", "checkVectorTypeAndReturnLength", "result", "row", "rowLength", "vec", "s", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatrixFromColumns", "factory", "_ref", "typed", "matrix", "flatten", "size", "arr", "_createArray", "m", "N", "checkVectorTypeAndReturnLength", "result", "i", "col", "colLength", "f", "_i", "vec", "s", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSplitUnit", "factory", "_ref", "typed", "unit", "parts", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUnaryMinus", "factory", "_ref", "typed", "unaryMinusNumber", "x", "self", "res", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUnaryPlus", "factory", "_ref", "typed", "config", "numeric", "unaryPlusNumber", "x", "self", "deepMap", "safeNumberType", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAbs", "factory", "_ref", "typed", "absNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createApply", "factory", "_ref", "typed", "isInteger", "mat", "dim", "callback", "size", "arraySize", "IndexError", "isMatrix", "_apply", "i", "ret", "tran", "_switch", "I", "J", "j", "tmp", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAddScalar", "factory", "_ref", "typed", "addNumber", "x", "y", "self", "res", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSubtractScalar", "factory", "_ref", "typed", "subtractNumber", "x", "y", "self", "res", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCbrt", "factory", "_ref", "config", "typed", "isNegative", "unaryMinus", "matrix", "Complex", "BigNumber", "Fraction", "cbrtNumber", "_cbrtComplex", "x", "_cbrtUnit", "allRoots", "arg3", "abs", "principal", "all", "isComplex", "result", "negate", "third", "isBigNumber", "isFraction", "_result", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo11xS0s", "factory", "_ref", "typed", "equalScalar", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "j", "k0", "k1", "k", "i", "v", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo12xSfs", "factory", "_ref", "typed", "DenseMatrix", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "cf", "cdata", "x", "w", "j", "mark", "k0", "k1", "k", "r", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo14xDs", "factory", "_ref", "typed", "a", "b", "callback", "inverse", "adata", "asize", "adt", "dt", "cf", "cdata", "_iterate", "clone", "f", "level", "s", "n", "av", "bv", "cv", "i", "j", "name", "dependencies", "createCeilNumber", "factory", "_ref", "typed", "config", "round", "x", "nearlyEqual", "n", "number", "exponent", "result", "createCeil", "_ref2", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "ceilNumber", "decimal_default", "self", "deepMap", "i", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCube", "factory", "_ref", "typed", "cubeNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createExp", "factory", "_ref", "typed", "expNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createExpm1", "factory", "_ref", "typed", "_Complex", "expm1Number", "x", "r", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFixNumber", "factory", "_ref", "typed", "ceil", "floor", "x", "n", "createFix", "_ref2", "_Complex", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "fixNumber", "bn", "self", "deepMap", "i", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFloorNumber", "factory", "_ref", "typed", "config", "round", "x", "nearlyEqual", "n", "number", "exponent", "result", "createFloor", "_ref2", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "floorNumber", "decimal_default", "self", "deepMap", "i", "y", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo02xDS0", "factory", "_ref", "typed", "equalScalar", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "j", "k0", "k1", "k", "i", "cij", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo03xDSf", "factory", "_ref", "typed", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "zero", "cf", "cdata", "z", "x", "w", "j", "mark", "k0", "k1", "k", "i", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo05xSfSf", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "xa", "xb", "wa", "wb", "i", "j", "k", "k1", "mark", "wai", "wbi", "va", "vb", "vc", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo13xDD", "factory", "_ref", "typed", "a", "b", "callback", "adata", "asize", "adt", "bdata", "bsize", "bdt", "csize", "DimensionError", "s", "dt", "cf", "cdata", "_iterate", "f", "level", "n", "av", "bv", "cv", "i", "j", "init_dirname", "init_buffer", "init_process", "name", "dependancies", "createBroadcast", "factory", "_ref", "concat", "A", "B", "N", "dim", "i", "sizeA", "_padLeft", "sizeB", "sizeMax", "checkBroadcastingRules", "AA", "BB", "_dim", "_stretch", "shape", "filler", "arrayToStretch", "sizeToStretch", "dimToStretch", "name", "dependencies", "createMatrixAlgorithmSuite", "factory", "_ref", "typed", "matrix", "concat", "matAlgo13xDD", "createMatAlgo13xDD", "matAlgo14xDs", "createMatAlgo14xDs", "broadcast", "createBroadcast", "options", "elop", "SD", "matrixSignatures", "x", "y", "self", "scalar", "Ds", "sS", "extend", "name", "dependencies", "createMod", "factory", "_ref", "typed", "config", "round", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "floor", "createFloor", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "_modNumber", "x", "y", "m", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo01xDSid", "factory", "_ref", "typed", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "cf", "i", "j", "cdata", "x", "w", "mark", "k0", "k1", "k", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo04xSidSid", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "xa", "xb", "wa", "wb", "i", "j", "k", "k0", "k1", "mark", "v", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo10xSids", "factory", "_ref", "typed", "DenseMatrix", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "cf", "cdata", "x", "w", "j", "mark", "k0", "k1", "k", "r", "i", "init_dirname", "init_buffer", "init_process", "ArgumentsError", "fn", "count", "min", "max", "name", "dependencies", "gcdTypes", "gcdManyTypesSignature", "is1d", "array", "element", "createGcd", "factory", "_ref", "typed", "matrix", "config", "round", "equalScalar", "zeros", "BigNumber", "DenseMatrix", "concat", "mod", "createMod", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "_gcdNumber", "_gcdBigNumber", "x", "y", "self", "a", "b", "args", "res", "i", "ArgumentsError", "isInteger", "r", "zero", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo06xS0S0", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "asize", "adt", "bvalues", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "u", "j", "mark", "scatter", "k", "i", "v", "p", "r", "name", "dependencies", "createLcm", "factory", "_ref", "typed", "matrix", "equalScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "lcmTypes", "lcmManySignature", "self", "a", "args", "res", "i", "lcmNumber", "_lcmBigNumber", "x", "y", "b", "prod", "t", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLog10", "factory", "_ref", "typed", "config", "_Complex", "x", "log10Number", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLog2", "factory", "_ref", "typed", "config", "Complex", "x", "log2Number", "_log2Complex", "self", "deepMap", "newX", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMultiplyScalar", "factory", "_ref", "typed", "multiplyNumber", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMultiply", "factory", "_ref", "typed", "matrix", "addScalar", "multiplyScalar", "equalScalar", "dot", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "_validateMatrixDimensions", "size1", "size2", "_multiplyVectorVector", "a", "b", "n", "_multiplyVectorMatrix", "_multiplyVectorDenseMatrix", "adata", "asize", "adt", "bdata", "bsize", "bdt", "alength", "bcolumns", "dt", "af", "mf", "c", "j", "sum", "i", "_multiplyMatrixVector", "_multiplyDenseMatrixVector", "_multiplySparseMatrixVector", "_multiplyMatrixMatrix", "_multiplyDenseMatrixDenseMatrix", "_multiplyDenseMatrixSparseMatrix", "_multiplySparseMatrixDenseMatrix", "_multiplySparseMatrixSparseMatrix", "arows", "acolumns", "row", "x", "bvalues", "bindex", "bptr", "eq", "zero", "cvalues", "cindex", "cptr", "jb", "kb0", "kb1", "last", "mark", "cij", "kb", "ib", "avalues", "aindex", "aptr", "brows", "w", "vbi", "ka0", "ka1", "ka", "ia", "p1", "p", "ic", "vbij", "p0", "values", "selfMM", "y", "arraySize", "m", "isMatrix", "xsize", "ysize", "self", "rest", "result", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createNthRoot", "factory", "_ref", "typed", "matrix", "equalScalar", "_BigNumber", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "complexErr", "nthRootNumber", "_bigNthRoot", "selfDn", "x", "selfSn", "self", "y", "selfDS", "a", "root", "precision", "Big", "zero", "one", "inv", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSign", "factory", "_ref", "typed", "_BigNumber", "complex", "_Fraction", "signNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSqrt", "factory", "_ref", "config", "typed", "Complex", "_sqrtNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSquare", "factory", "_ref", "typed", "squareNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSubtract", "factory", "_ref", "typed", "matrix", "equalScalar", "subtractScalar", "unaryMinus", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createXgcd", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "a", "b", "res", "xgcdNumber", "_xgcdBigNumber", "t", "q", "r", "zero", "one", "lastx", "y", "lasty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createInvmod", "factory", "_ref", "typed", "config", "BigNumber", "xgcd", "equal", "smaller", "mod", "add", "isInteger", "invmod", "a", "b", "res", "gcd", "inv", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo09xS0Sf", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "i", "j", "k", "k0", "k1", "mark", "vb", "vc", "name", "dependencies", "createDotMultiply", "factory", "_ref", "typed", "matrix", "equalScalar", "multiplyScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo09xS0Sf", "createMatAlgo09xS0Sf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "bitAndBigNumber", "x", "y", "BigNumber", "bitwise", "a", "b", "bitNotBigNumber", "prevPrec", "result", "bitOrBigNumber", "negOne", "func", "xBits", "yBits", "xSign", "ySign", "decCoefficientToBinaryString", "i", "_i", "minBits", "maxBits", "minSign", "shortLen", "longLen", "expFuncVal", "outVal", "twoPower", "two", "s", "z", "j", "xe", "str", "strL", "arr", "_i2", "arrL", "_j", "bitXor", "leftShiftBigNumber", "rightArithShiftBigNumber", "name", "dependencies", "createBitAnd", "factory", "_ref", "typed", "matrix", "equalScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitAndNumber", "bitAndBigNumber", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBitNot", "factory", "_ref", "typed", "bitNotNumber", "bitNotBigNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBitOr", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitOrNumber", "bitOrBigNumber", "x", "y", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo07xSSf", "factory", "_ref", "typed", "DenseMatrix", "a", "b", "callback", "asize", "adt", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "zero", "cf", "i", "j", "cdata", "xa", "xb", "wa", "wb", "mark", "_scatter", "va", "vb", "m", "w", "x", "values", "index", "ptr", "k", "k1", "name", "dependencies", "createBitXor", "factory", "_ref", "typed", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitXorNumber", "bitXor", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createArg", "factory", "_ref", "typed", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createConj", "factory", "_ref", "typed", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIm", "factory", "_ref", "typed", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRe", "factory", "_ref", "typed", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createNot", "factory", "_ref", "typed", "notNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createOr", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "orNumber", "x", "y", "self", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createXor", "factory", "_ref", "typed", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "xorNumber", "x", "y", "self", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createConcat", "factory", "_ref", "typed", "matrix", "isInteger", "args", "i", "len", "dim", "prevDim", "asMatrix", "matrices", "arg", "isMatrix", "isNumber", "isBigNumber", "IndexError", "m", "clone", "size", "arraySize", "DimensionError", "res", "concat", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createColumn", "factory", "_ref", "typed", "Index", "matrix", "range", "_column", "value", "column", "clone", "validateIndex", "rowRange", "index", "result", "isMatrix", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCount", "factory", "_ref", "typed", "size", "prod", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCross", "factory", "_ref", "typed", "matrix", "subtract", "multiply", "x", "y", "_cross", "highestDimension", "arraySize", "squeeze", "xSize", "ySize", "product", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDiag", "factory", "_ref", "typed", "matrix", "DenseMatrix", "SparseMatrix", "x", "_diag", "arraySize", "k", "format", "size", "isInteger", "kSuper", "kSub", "_createDiagonalMatrix", "_getDiagonal", "l", "ms", "m", "s", "isMatrix", "dm", "n", "vector", "i", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "import_typed_function", "applyCallback", "callback", "value", "index", "array", "mappingFnName", "typed", "args3", "signature3", "tryWithArgs", "args2", "signature2", "args1", "signature1", "signature", "args", "err", "_err$data", "argsDesc", "typeOf", "name", "dependencies", "createFilter", "factory", "_ref", "typed", "_filterCallback", "x", "test", "filterRegExp", "callback", "filter", "value", "index", "array", "applyCallback", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFlatten", "factory", "_ref", "typed", "matrix", "x", "flatten", "flat", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createForEach", "factory", "_ref", "typed", "_forEach", "x", "callback", "array", "recurse", "value", "index", "forEach", "child", "i", "applyCallback", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createGetMatrixDataType", "factory", "_ref", "typed", "x", "getArrayDataType", "typeOf", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIdentity", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "DenseMatrix", "SparseMatrix", "format", "rows", "_identity", "cols", "size", "_identityVector", "Big", "isBigNumber", "isInteger", "one", "defaultValue", "res", "resize", "minimum", "d", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createKron", "factory", "_ref", "typed", "matrix", "multiplyScalar", "x", "y", "_kron", "a", "b", "arraySize", "t", "r", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMap", "factory", "_ref", "typed", "_map", "x", "callback", "array", "recurse", "value", "index", "child", "i", "applyCallback", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDiff", "factory", "_ref", "typed", "matrix", "subtract", "number", "arr", "isMatrix", "_diff", "dim", "isInteger", "_recursive", "selfAn", "selfMn", "result", "element", "size", "i", "_ElementDiff", "obj1", "obj2", "obj1IsArray", "obj2IsArray", "_ArrayDiff", "arr1", "arr2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createOnes", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "_ones", "size", "last", "format", "hasBigNumbers", "_normalize", "defaultValue", "_validate", "m", "arr", "resize", "value", "index", "isBigNumber", "isInteger", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "noBignumber", "noFraction", "noMatrix", "name", "dependencies", "createRange", "factory", "_ref", "typed", "config", "matrix", "bignumber", "smaller", "smallerEq", "larger", "largerEq", "add", "isPositive", "_strRange", "start", "end", "_out", "_range", "step", "includeEnd", "BigNumber", "arr", "noMatrix", "str", "r", "_parse", "noBignumber", "array", "ongoing", "x", "args", "nums", "arg", "invalid", "num", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createReshape", "factory", "_ref", "typed", "isInteger", "x", "sizes", "size", "reshape", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createResize", "factory", "_ref", "config", "matrix", "x", "size", "defaultValue", "ArgumentsError", "isMatrix", "isBigNumber", "value", "_resizeString", "asMatrix", "clone", "res", "resize", "str", "defaultChar", "DimensionError", "len", "isInteger", "format", "i", "ii", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRotate", "factory", "_ref", "typed", "multiply", "rotationMatrix", "w", "theta", "_validateSize", "matrixRes", "v", "expectedSize", "actualSize", "arraySize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRotationMatrix", "factory", "_ref", "typed", "config", "multiplyScalar", "addScalar", "unaryMinus", "norm", "BigNumber", "matrix", "DenseMatrix", "SparseMatrix", "cos", "sin", "format", "theta", "_rotationMatrix2x2", "v", "matrixV", "_validateVector", "_rotationMatrix3x3", "storageType", "Big", "isBigNumber", "minusOne", "cosTheta", "sinTheta", "data", "_convertToFormat", "size", "_mul", "array", "p", "curr", "normV", "one", "vx", "vy", "vz", "c", "oneMinusC", "s", "r11", "r12", "r13", "r21", "r22", "r23", "r31", "r32", "r33", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRow", "factory", "_ref", "typed", "Index", "matrix", "range", "_row", "value", "row", "clone", "validateIndex", "columnRange", "index", "result", "isMatrix", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSize", "factory", "_ref", "typed", "config", "matrix", "x", "arraySize", "noMatrix", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSqueeze", "factory", "_ref", "typed", "matrix", "x", "squeeze", "clone", "res", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSubset", "factory", "_ref", "typed", "matrix", "zeros", "add", "value", "index", "isEmptyIndex", "validateIndexSourceSize", "subsetRef", "subsetResult", "_getObjectProperty", "_getSubstring", "replacement", "defaultValue", "_broadcastReplacement", "_setSubstring", "_setObjectProperty", "indexSize", "d", "str", "isIndex", "DimensionError", "strLen", "validateIndex", "range", "substr", "v", "len", "chars", "i", "_i", "_len", "object", "key", "getSafeProperty", "updated", "clone", "setSafeProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTranspose", "factory", "_ref", "typed", "matrix", "x", "transposeMatrix", "clone", "size", "c", "rows", "columns", "format", "_denseTranspose", "_sparseTranspose", "m", "data", "transposed", "transposedRow", "j", "i", "values", "index", "ptr", "cvalues", "cindex", "cptr", "p", "l", "sum", "k0", "k1", "k", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCtranspose", "factory", "_ref", "typed", "transpose", "conj", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createZeros", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "_zeros", "size", "last", "format", "hasBigNumbers", "_normalize", "defaultValue", "_validate", "m", "arr", "resize", "value", "index", "isBigNumber", "isInteger", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFft", "factory", "_ref", "typed", "matrix", "addScalar", "multiplyScalar", "divideScalar", "exp", "tau", "I", "dotDivide", "conj", "pow", "ceil", "log2", "_ndFft", "arr", "size", "arraySize", "_fft", "_1dFft", "slice", "dim", "_", "i", "_transpose", "j", "_czt", "n", "w", "chirp", "N2", "xp", "ichirp", "fftXp", "fftIchirp", "fftProduct", "ifftProduct", "ret", "_i", "len", "k", "p", "q", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIfft", "factory", "_ref", "typed", "fft", "dotDivide", "conj", "arr", "size", "isMatrix", "arraySize", "acc", "curr", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "_typeof", "o", "init_dirname", "init_buffer", "init_process", "toPrimitive", "t", "r", "_typeof", "e", "i", "toPropertyKey", "t", "i", "toPrimitive", "_typeof", "_defineProperty", "r", "t", "toPropertyKey", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createSolveODE", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "max", "map", "abs", "isPositive", "isNegative", "larger", "smaller", "matrix", "bignumber", "unaryMinus", "_rk", "butcherTableau", "f", "tspan", "y0", "options", "wrongTSpan", "isNumOrBig", "isUnit", "t0", "tf", "isForwards", "firstStep", "maxStep", "minStep", "timeVars", "x", "steps", "tol", "minDelta", "maxDelta", "maxIter", "hasBigNumbers", "isBigNumber", "a", "c", "b", "bp", "h", "y", "deltaB", "n", "iter", "ongoing", "_createOngoing", "trimStep", "_createTrimStep", "k", "i", "TE", "X", "delta", "_rk23", "_rk45", "_solveODE", "opt", "method", "methods", "methodOptions", "methodsWithQuotes", "availableMethodsString", "outOfBounds", "next", "isNumber", "_matrixSolveODE", "T", "sol", "Y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createErf", "factory", "_ref", "typed", "x", "y", "MAX_NUM", "sign", "THRESH", "erf1", "erfc2", "erfc3", "self", "n", "deepMap", "ysq", "xnum", "P", "xden", "i", "Q", "result", "del", "SQRPI", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createZeta", "factory", "_ref", "typed", "config", "multiply", "pow", "divide", "factorial", "equal", "smallerEq", "isNegative", "gamma", "sin", "subtract", "add", "Complex", "_BigNumber", "pi", "s", "zetaNumeric", "value", "zetaComplex", "createValue", "determineDigits", "zeta", "getRe", "n", "f", "c", "d", "k", "S", "j", "factor", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMode", "factory", "_ref", "typed", "isNaN", "isNumeric", "_mode", "args", "values", "flatten", "num", "count", "mode", "max", "i", "value", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "improveErrorMessage", "err", "fnName", "value", "details", "typeOf", "name", "dependencies", "createProd", "factory", "_ref", "typed", "config", "multiplyScalar", "numeric", "_prod", "array", "dim", "args", "prod", "deepForEach", "value", "err", "improveErrorMessage", "safeNumberType", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFormat", "factory", "_ref", "typed", "format", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBin", "factory", "_ref", "typed", "format", "n", "wordSize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createOct", "factory", "_ref", "typed", "format", "n", "wordSize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createHex", "factory", "_ref", "typed", "format", "n", "wordSize", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "printTemplate", "name", "dependencies", "createPrint", "factory", "_ref", "typed", "_print", "template", "values", "options", "printTemplate", "original", "key", "keys", "value", "k", "isString", "format", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTo", "factory", "_ref", "typed", "matrix", "concat", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "x", "unit", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsPrime", "factory", "_ref", "typed", "x", "i", "modPow", "base", "exponent", "modulus", "accumulator", "Decimal", "r", "d", "bases", "max", "_i", "_i2", "a", "adn", "_i3", "_x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createNumeric", "factory", "_ref", "_number", "bignumber", "fraction", "validInputTypes", "validOutputTypes", "x", "noBignumber", "noFraction", "value", "outputType", "check", "inputType", "typeOf", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDivideScalar", "factory", "_ref", "typed", "numeric", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPow", "factory", "_ref", "typed", "config", "identity", "multiply", "matrix", "inv", "number", "fraction", "Complex", "_pow", "x", "y", "result", "_powArray", "_powMatrix", "isInteger", "yFrac", "yNum", "powNumber", "s", "arraySize", "error", "res", "px", "init_dirname", "init_buffer", "init_process", "NO_INT", "name", "dependencies", "createRound", "factory", "_ref", "typed", "config", "matrix", "equalScalar", "zeros", "_BigNumber", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "toExponent", "epsilon", "splitNumber", "xEpsilon", "roundNumber", "xSelected", "nearlyEqual", "n", "epsilonExponent", "_n", "self", "unit", "valueless", "deepMap", "value", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLog", "factory", "_ref", "typed", "config", "divideScalar", "Complex", "x", "logNumber", "self", "base", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLog1p", "factory", "_ref", "typed", "config", "divideScalar", "log", "Complex", "x", "log1p", "_log1pComplex", "y", "self", "deepMap", "base", "xRe1p", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createNthRoots", "factory", "_ref", "typed", "config", "divideScalar", "Complex", "_calculateExactResult", "val", "_nthComplexRoots", "a", "root", "aIsNumeric", "offset", "arg", "abs", "roots", "r", "k", "halfPiFactor", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDotPow", "factory", "_ref", "typed", "equalScalar", "matrix", "pow", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "powScalarSignatures", "signature", "powScalar", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDotDivide", "factory", "_ref", "typed", "matrix", "equalScalar", "divideScalar", "DenseMatrix", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "createSolveValidation", "_ref", "DenseMatrix", "m", "b", "copy", "mSize", "format", "rows", "columns", "data", "isMatrix", "bSize", "bdata", "i", "isDenseMatrix", "_i", "isSparseMatrix", "_i2", "values", "index", "ptr", "k1", "k", "_i3", "isArray", "bsize", "arraySize", "_i4", "_i5", "name", "dependencies", "createLsolve", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseForwardSubstitution", "_denseForwardSubstitution", "a", "r", "bdata", "rows", "columns", "x", "mdata", "j", "bj", "xj", "vjj", "i", "values", "index", "ptr", "jValues", "jIndices", "firstIndex", "lastIndex", "k", "_k", "l", "_i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUsolve", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseBackwardSubstitution", "_denseBackwardSubstitution", "a", "r", "bdata", "rows", "columns", "x", "mdata", "j", "bj", "xj", "vjj", "i", "values", "index", "ptr", "jValues", "jIndices", "firstIndex", "lastIndex", "k", "_k", "_lastIndex", "_i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLsolveAll", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseForwardSubstitution", "_denseForwardSubstitution", "a", "R", "r", "b_", "B", "e", "M", "rows", "columns", "i", "L", "k", "bNew", "_j", "j", "x", "values", "index", "ptr", "iValues", "iIndices", "firstIndex", "lastIndex", "Mii", "J", "_j3", "_lastIndex2", "_J2", "_j2", "_lastIndex", "_J", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUsolveAll", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseBackwardSubstitution", "_denseBackwardSubstitution", "a", "R", "r", "b_", "B", "e", "M", "rows", "columns", "i", "L", "k", "bNew", "_j", "j", "x", "values", "index", "ptr", "iValues", "iIndices", "firstIndex", "lastIndex", "Mii", "J", "_j3", "_lastIndex2", "_J2", "_j2", "_lastIndex", "_J", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo08xS0Sid", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "k", "k0", "k1", "i", "j", "mark", "v", "init_dirname", "init_buffer", "init_process", "createUseMatrixForArrayScalar", "factory", "_ref", "typed", "matrix", "selfDn", "x", "y", "selfDB", "selfnD", "selfBD", "name", "dependencies", "createLeftShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "leftShiftNumber", "leftShiftBigNumber", "x", "y", "self", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRightArithShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "rightArithShiftNumber", "rightArithShiftBigNumber", "x", "y", "self", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRightLogShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "rightLogShiftNumber", "self", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAnd", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "andNumber", "y", "self", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCompare", "factory", "_ref", "typed", "config", "equalScalar", "matrix", "BigNumber", "Fraction", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createCompareNumber", "x", "y", "nearlyEqual", "_ref2", "init_dirname", "init_buffer", "init_process", "import_javascript_natural_sort", "name", "dependencies", "createCompareNatural", "factory", "_ref", "typed", "compare", "compareBooleans", "_compareNatural", "x", "y", "typeX", "typeOf", "typeY", "c", "naturalSort", "matTypes", "compareMatricesAndArrays", "compareComplexNumbers", "compareArrays", "compareObjects", "compareNatural", "isSparseMatrix", "isDenseMatrix", "i", "ii", "v", "keysX", "keysY", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "compareText", "createCompareText", "factory", "_ref", "typed", "matrix", "concat", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createEqual", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "createEqualNumber", "_ref2", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createEqualText", "factory", "_ref", "typed", "compareText", "isZero", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSmaller", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createSmallerNumber", "x", "y", "nearlyEqual", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSmallerEq", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createSmallerEqNumber", "x", "y", "nearlyEqual", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLarger", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createLargerNumber", "x", "y", "nearlyEqual", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLargerEq", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createLargerEqNumber", "x", "y", "nearlyEqual", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDeepEqual", "factory", "_ref", "typed", "equal", "x", "y", "_deepEqual", "len", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUnequal", "factory", "_ref", "typed", "config", "equalScalar", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "createUnequalNumber", "_unequal", "x", "y", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPartitionSelect", "factory", "_ref", "typed", "isNumeric", "isNaN", "compare", "asc", "desc", "a", "b", "x", "k", "_partitionSelect", "isInteger", "isMatrix", "size", "quickSelect", "arr", "i", "from", "to", "r", "w", "pivot", "tmp", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSort", "factory", "_ref", "typed", "matrix", "compare", "compareNatural", "compareAsc", "compareDesc", "a", "b", "x", "_arrayIsVector", "_matrixIsVector", "_comparator", "order", "array", "arraySize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMax", "factory", "_ref", "typed", "config", "numeric", "larger", "_max", "array", "dim", "reduce", "_largest", "args", "containsCollections", "x", "y", "err", "improveErrorMessage", "res", "deepForEach", "value", "safeNumberType", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMin", "factory", "_ref", "typed", "config", "numeric", "smaller", "_min", "array", "dim", "reduce", "_smallest", "args", "containsCollections", "x", "y", "err", "improveErrorMessage", "min", "deepForEach", "value", "safeNumberType", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createImmutableDenseMatrixClass", "factory", "_ref", "smaller", "DenseMatrix", "ImmutableDenseMatrix", "data", "datatype", "isString", "isMatrix", "isArray", "matrix", "typeOf", "index", "m", "clone", "json", "v", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIndexClass", "factory", "_ref", "ImmutableDenseMatrix", "getMatrixDataType", "Index", "ranges", "i", "ii", "arg", "argIsArray", "isArray", "argIsMatrix", "isMatrix", "sourceSize", "isRange", "m", "_createImmutableMatrix", "_booleansArrayToNumbersForIndex", "size", "isInteger", "index", "clone", "d", "values", "range", "callback", "dim", "array", "dimension", "strings", "json", "booleanArrayIndex", "indexOfNumbers", "bool", "idx", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFibonacciHeapClass", "factory", "_ref", "smaller", "larger", "oneOverLogPhi", "FibonacciHeap", "key", "value", "node", "minimum", "numberOfChildren", "tempRight", "_findMinimumNode", "_decreaseKey", "parent", "_cut", "_cascadingCut", "_linkNodes", "size", "arraySize", "array", "numRoots", "x", "y", "d", "next", "temp", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSpaClass", "factory", "_ref", "addScalar", "equalScalar", "FibonacciHeap", "Spa", "i", "v", "node", "from", "to", "callback", "heap", "values", "nodes", "n", "j", "nodei", "nodej", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "createBigNumberE", "memoize", "BigNumber", "hasher", "createBigNumberPhi", "createBigNumberPi", "createBigNumberTau", "args", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createUnitClass", "factory", "_ref", "on", "config", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "pow", "abs", "fix", "round", "equal", "isNumeric", "format", "_number", "Complex", "_BigNumber", "_Fraction", "toNumber", "Unit", "value", "valuelessUnit", "isComplex", "BASE_DIMENSIONS", "x", "u", "isUnit", "_extends", "text", "index", "c", "skipWhitespace", "next", "isDigitDot", "isDigit", "revert", "oldIndex", "parseNumber", "number", "tentativeNumber", "tentativeIndex", "parseUnit", "unitName", "firstC", "parseCharacter", "toFind", "str", "options", "unit", "powerMultiplierCurrent", "expectingUnit", "valueStr", "powerMultiplierStack", "powerMultiplierStackProduct", "uStr", "oldC", "res", "_findUnit", "power", "p", "i", "baseDim", "UNIT_SYSTEMS", "clone", "hasOwnProperty", "typeOf", "convert", "unitValue", "unitPrefixValue", "unitPower", "prefixValue", "memoize", "UNITS", "prefix", "_name", "endsWith", "_unit", "prefixLen", "prefixName", "_prefix", "args", "base", "BASE_UNITS", "other", "_other", "_i", "inverted", "valThis", "valOther", "getNumericIfUnitless", "numerator", "_i2", "_i3", "ret", "nominalOffset", "unitOffset", "thisUnitValue", "thisNominalOffset", "thisUnitOffset", "otherUnitValue", "otherNominalOffset", "otherUnitOffset", "json", "_json$unit", "proposedUnitList", "matchingBase", "key", "currentUnitSystem", "matchingUnit", "missingBaseDim", "strNum", "strDen", "nNum", "nDen", "_i4", "simp", "isImaginary", "unitStr", "absValue", "absUnitValue", "bestPrefix", "bestDiff", "prefixes", "diff", "parts", "xNumeric", "xRounded", "xFixed", "isNearlyEqual", "y", "testSum", "_i5", "PREFIXES", "BASE_UNIT_NONE", "UNIT_NONE", "ALIASES", "calculateAngleValues", "pi", "createBigNumberPi", "curr", "prev", "_key", "type", "_key2", "_name2", "_unit2", "alias", "_key3", "assertUnitNameIsValid", "obj", "_key4", "lastUnit", "_key5", "defUnit", "aliases", "offset", "definition", "baseName", "ex", "newUnit", "anyMatch", "_i7", "match", "j", "_newBaseUnit", "b", "newBaseUnit", "_i6", "_i8", "aliasName", "_alias", "_key6", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUnitFunction", "factory", "_ref", "typed", "Unit", "x", "value", "unit", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSparse", "factory", "_ref", "typed", "SparseMatrix", "datatype", "data", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCreateUnit", "factory", "_ref", "typed", "Unit", "obj", "options", "def", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcos", "factory", "_ref", "typed", "config", "Complex", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcosh", "factory", "_ref", "typed", "config", "Complex", "x", "acoshNumber", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcot", "factory", "_ref", "typed", "_BigNumber", "acotNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcoth", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "acothNumber", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcsc", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "acscNumber", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcsch", "factory", "_ref", "typed", "_BigNumber", "acschNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAsec", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "asecNumber", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAsech", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "xInv", "asechNumber", "ret", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAsin", "factory", "_ref", "typed", "config", "Complex", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAsinh", "factory", "_ref", "typed", "asinhNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAtan", "factory", "_ref", "typed", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAtan2", "factory", "_ref", "typed", "matrix", "equalScalar", "BigNumber", "DenseMatrix", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo09xS0Sf", "createMatAlgo09xS0Sf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "y", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAtanh", "factory", "_ref", "typed", "config", "Complex", "x", "atanhNumber", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "createTrigUnit", "factory", "_ref", "typed", "self", "x", "name", "dependencies", "createCos", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCosh", "factory", "_ref", "typed", "cosh", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCot", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "cotNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCoth", "factory", "_ref", "typed", "_BigNumber", "cothNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCsc", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "cscNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCsch", "factory", "_ref", "typed", "_BigNumber", "cschNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSec", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "secNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSech", "factory", "_ref", "typed", "_BigNumber", "sechNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSin", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSinh", "factory", "_ref", "typed", "sinhNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTan", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTanh", "factory", "_ref", "typed", "tanh", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetCartesian", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "b1", "flatten", "b2", "i", "j", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetDifference", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "flatten", "b1", "identify", "b2", "inb2", "i", "j", "generalize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetDistinct", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "result", "b", "flatten", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetIntersect", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "b1", "identify", "flatten", "b2", "i", "j", "generalize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetIsSubset", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "a1", "a2", "b1", "identify", "flatten", "b2", "inb2", "i", "j", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetMultiplicity", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "e", "b", "flatten", "count", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetPowerset", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "a", "b", "flatten", "result", "number", "_subset", "_sort", "array", "bitarray", "i", "temp", "j", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetSize", "factory", "_ref", "typed", "compareNatural", "a", "flatten", "unique", "b", "count", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetSymDifference", "factory", "_ref", "typed", "size", "concat", "subset", "setDifference", "Index", "a1", "a2", "flatten", "b1", "b2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetUnion", "factory", "_ref", "typed", "size", "concat", "subset", "setIntersect", "setSymDifference", "Index", "a1", "a2", "flatten", "b1", "b2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAdd", "factory", "_ref", "typed", "matrix", "addScalar", "equalScalar", "DenseMatrix", "SparseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "self", "y", "rest", "result", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createHypot", "factory", "_ref", "typed", "abs", "addScalar", "divideScalar", "multiplyScalar", "sqrt", "smaller", "isPositive", "_hypot", "M", "flatten", "args", "result", "largest", "i", "isComplex", "value", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createNorm", "factory", "_ref", "typed", "abs", "add", "pow", "conj", "sqrt", "multiply", "equalScalar", "larger", "smaller", "matrix", "ctranspose", "eigs", "x", "_norm", "p", "_vectorNormPlusInfinity", "pinf", "value", "v", "_vectorNormMinusInfinity", "ninf", "_vectorNorm", "n", "_matrixNormFrobenius", "fro", "index", "_matrixNormOne", "c", "maxc", "j", "cj", "_matrixNormTwo", "sizeX", "tx", "squaredX", "eigenVals", "rho", "_matrixNormInfinity", "r", "maxr", "i", "ri", "_matrixNorm", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDot", "factory", "_ref", "typed", "addScalar", "multiplyScalar", "conj", "size", "_denseDot", "_sparseDot", "_validateDim", "x", "y", "xSize", "_size", "ySize", "xLen", "yLen", "a", "b", "N", "adata", "isMatrix", "adt", "bdata", "bdt", "aIsColumn", "bIsColumn", "add", "mul", "dt", "c", "i", "_c", "_i", "_c2", "_i2", "_c3", "_i3", "xindex", "xvalues", "yindex", "yvalues", "j", "I", "J", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTrace", "factory", "_ref", "typed", "matrix", "add", "x", "_denseTrace", "_sparseTrace", "clone", "m", "size", "data", "format", "rows", "cols", "sum", "i", "values", "index", "ptr", "columns", "j", "k0", "k1", "k", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIndex", "factory", "_ref", "typed", "Index", "args", "ranges", "arg", "isBigNumber", "isArray", "isMatrix", "elem", "res", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "keywords", "name", "dependencies", "createNode", "factory", "_ref", "mathWithTransform", "_validateScope", "scope", "symbol", "keywords", "Node", "expr", "args", "context", "evaluate", "s", "createMap", "math", "argNames", "callback", "node", "isNode", "_traverse", "child", "path", "parent", "_transform", "replacement", "nodes", "other", "deepStrictEqual", "options", "customString", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "errorTransform", "err", "IndexError", "accessFactory", "_ref", "subset", "object", "index", "getSafeProperty", "err", "errorTransform", "name", "dependencies", "createAccessorNode", "factory", "_ref", "subset", "Node", "access", "accessFactory", "needParenthesis", "node", "isAccessorNode", "isArrayNode", "isConstantNode", "isFunctionNode", "isObjectNode", "isParenthesisNode", "isSymbolNode", "AccessorNode", "object", "index", "isNode", "isIndexNode", "math", "argNames", "evalObject", "evalIndex", "prop", "scope", "args", "context", "getSafeProperty", "callback", "options", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createArrayNode", "factory", "_ref", "Node", "ArrayNode", "items", "isNode", "math", "argNames", "evalItems", "map", "item", "asMatrix", "matrix", "scope", "args", "context", "evalItem", "callback", "i", "node", "options", "json", "itemsToTex", "nested", "mixedItems", "isArrayNode", "itemsFormRow", "itemSep", "itemsTex", "_defineProperty", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "assignFactory", "_ref", "subset", "matrix", "object", "index", "value", "result", "item", "setSafeProperty", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "properties", "unwrapParen", "_node", "parenthesis", "node", "isParenthesisNode", "getPrecedence", "implicit", "parent", "identifier", "precedence", "i", "leftArg", "isConstantNode", "rule2Node", "getAssociativity", "index", "property", "hasOwnProperty", "isAssociativeWith", "nodeA", "nodeB", "a", "b", "identifierA", "identifierB", "getOperator", "fn", "group", "name", "dependencies", "createAssignmentNode", "factory", "_ref", "subset", "matrix", "Node", "access", "accessFactory", "assign", "assignFactory", "needParenthesis", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "exprPrecedence", "AssignmentNode", "object", "index", "value", "isSymbolNode", "isAccessorNode", "isIndexNode", "isNode", "math", "argNames", "evalObject", "evalIndex", "evalValue", "prop", "scope", "args", "context", "setSafeProperty", "childObject", "evalParentObject", "parentProp", "parent", "getSafeProperty", "evalParentIndex", "parentIndex", "callback", "options", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBlockNode", "factory", "_ref", "ResultSet", "Node", "BlockNode", "blocks", "block", "node", "visible", "isNode", "math", "argNames", "evalBlocks", "map", "scope", "args", "context", "results", "forEach", "result", "callback", "i", "options", "param", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createConditionalNode", "factory", "_ref", "Node", "testCondition", "condition", "isBigNumber", "isComplex", "isUnit", "typeOf", "ConditionalNode", "trueExpr", "falseExpr", "isNode", "math", "argNames", "evalCondition", "evalTrueExpr", "evalFalseExpr", "scope", "args", "context", "callback", "options", "parenthesis", "precedence", "getPrecedence", "conditionPrecedence", "truePrecedence", "falsePrecedence", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "import_escape_latex", "latexSymbols", "latexOperators", "latexFunctions", "node", "options", "defaultTemplate", "latexUnits", "escapeLatex", "string", "escapeLatexLib", "toSymbol", "name", "isUnit", "hasOwnProperty", "name", "dependencies", "createConstantNode", "factory", "_ref", "Node", "ConstantNode", "value", "math", "argNames", "callback", "options", "format", "typeOf", "json", "type", "escapeLatex", "finite", "index", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFunctionAssignmentNode", "factory", "_ref", "typed", "Node", "needParenthesis", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "exprPrecedence", "FunctionAssignmentNode", "params", "expr", "isNode", "keywords", "paramNames", "param", "_name", "math", "argNames", "childArgNames", "forEach", "evalExpr", "signature", "join", "syntax", "scope", "args", "context", "signatures", "childArgs", "i", "fn", "callback", "options", "types", "index", "json", "escape", "toSymbol", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIndexNode", "factory", "_ref", "Node", "size", "IndexNode", "dimensions", "dotNotation", "isNode", "math", "argNames", "evalDimensions", "map", "dimension", "i", "needsEnd", "node", "childArgNames", "_evalDimension", "scope", "args", "context", "isMatrix", "isArray", "isString", "typeOf", "s", "childArgs", "index", "getSafeProperty", "evalDimension", "callback", "isConstantNode", "options", "json", "escape", "range", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createObjectNode", "factory", "_ref", "Node", "ObjectNode", "properties", "key", "isNode", "math", "argNames", "evalEntries", "hasOwnProperty", "stringifiedKey", "stringify", "parsedKey", "prop", "getSafeProperty", "scope", "args", "context", "obj", "_key", "callback", "options", "entries", "json", "escape", "tex", "_defineProperty", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "createSubScope", "parentScope", "args", "PartitionedMap", "ObjectWrappingMap", "name", "dependencies", "createOperatorNode", "factory", "_ref", "Node", "startsWithConstant", "expr", "parenthesis", "curNode", "isParenthesisNode", "isConstantNode", "isOperatorNode", "calculateNecessaryParentheses", "root", "implicit", "args", "latex", "precedence", "getPrecedence", "associativity", "getAssociativity", "arg", "result", "operandPrecedence", "operandIdentifier", "rootIdentifier", "properties", "lhsParens", "lhsPrecedence", "assocWithLhs", "isAssociativeWith", "rhsParens", "rhsPrecedence", "assocWithRhs", "_rootIdentifier", "lhsIdentifier", "rhsIdentifier", "argPrecedence", "assocWithArg", "argAssociativity", "i", "OperatorNode", "op", "fn", "isPercentage", "isNode", "math", "argNames", "isSafeMethod", "getSafeProperty", "evalArgs", "map", "rawArgs", "scope", "context", "createSubScope", "evalArg0", "_evalArg", "evalArg1", "evalArg", "callback", "options", "parens", "assoc", "operand", "opIsNamed", "lhs", "rhs", "stringifiedArgs", "index", "json", "escape", "latexOperators", "lhsTex", "rhsTex", "texifiedArgs", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createParenthesisNode", "factory", "_ref", "Node", "ParenthesisNode", "content", "isNode", "math", "argNames", "callback", "options", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRangeNode", "factory", "_ref", "Node", "calculateNecessaryParentheses", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "parens", "startPrecedence", "stepPrecedence", "endPrecedence", "RangeNode", "start", "end", "step", "isNode", "endSymbols", "isSymbolNode", "math", "argNames", "range", "evalStart", "evalEnd", "evalStep", "scope", "args", "context", "callback", "options", "str", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRelationalNode", "factory", "_ref", "Node", "operatorMap", "RelationalNode", "conditionals", "params", "math", "argNames", "self", "compiled", "p", "scope", "args", "context", "evalLhs", "evalRhs", "i", "condFn", "getSafeProperty", "callback", "n", "options", "parenthesis", "precedence", "getPrecedence", "paramStrings", "index", "paramPrecedence", "ret", "json", "escape", "latexOperators", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSymbolNode", "factory", "_ref", "math", "Unit", "Node", "isValuelessUnit", "SymbolNode", "argNames", "scope", "args", "context", "getSafeProperty", "isUnit", "callback", "options", "escape", "json", "symbol", "toSymbol", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFunctionNode", "factory", "_ref", "_FunctionNode", "math", "Node", "SymbolNode", "strin", "entity", "format", "expandTemplate", "template", "node", "options", "latex", "regex", "inputPos", "match", "property", "isNode", "arg", "index", "FunctionNode", "fn", "args", "argNames", "evalArgs", "isSymbolNode", "_name", "_rawArgs", "scope", "context", "getSafeProperty", "createSubScope", "values", "evalArg", "isRaw", "resolveFn", "value", "rawArgs", "evalArg0", "evalArg1", "isAccessorNode", "isIndexNode", "evalObject", "prop", "_rawArgs2", "object", "getSafeMethod", "fnExpr", "evalFn", "_rawArgs3", "callback", "i", "customString", "hasOwnProperty", "isFunctionAssignmentNode", "escape", "customTex", "latexConverter", "latexFunctions", "customToTex", "defaultTemplate", "_defineProperty", "json", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createParse", "factory", "_ref", "typed", "numeric", "config", "AccessorNode", "ArrayNode", "AssignmentNode", "BlockNode", "ConditionalNode", "ConstantNode", "FunctionAssignmentNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "RangeNode", "RelationalNode", "SymbolNode", "parse", "expression", "parseStart", "expressions", "parseMultiple", "options", "extraNodes", "deepMap", "elem", "TOKENTYPE", "DELIMITERS", "NAMED_DELIMITERS", "CONSTANTS", "NUMERIC_CONSTANTS", "ESCAPE_CHARACTERS", "initialState", "currentString", "state", "length", "currentCharacter", "next", "prevCharacter", "nextCharacter", "getToken", "c1", "c2", "c3", "_c", "createSyntaxError", "hasOwnProperty", "getTokenSkipNewline", "openParams", "closeParams", "c", "cPrev", "cNext", "high", "low", "nestingLevel", "_extends", "node", "parseBlock", "createError", "blocks", "visible", "parseAssignment", "args", "value", "valid", "parseConditional", "isSymbolNode", "isAccessorNode", "isFunctionNode", "arg", "index", "parseLogicalOr", "prev", "condition", "trueExpr", "falseExpr", "parseLogicalXor", "parseLogicalAnd", "parseBitwiseOr", "parseBitwiseXor", "parseBitwiseAnd", "parseRelational", "params", "parseShift", "conditionals", "operators", "cond", "fn", "parseConversion", "parseRange", "parseAddSubtract", "parseMultiplyDivide", "rightNode", "last", "parseImplicitMultiplication", "parseRule2", "isConstantNode", "isOperatorNode", "parseModulusPercentage", "tokenStates", "rule2Node", "parseUnary", "parsePow", "parseLeftHandOperators", "parseCustomNodes", "parseAccessors", "CustomNode", "parseSymbol", "parseString", "types", "isPropertyName", "dotNotation", "str", "parseStringToken", "parseMatrix", "quote", "char", "escapeChar", "unicode", "array", "rows", "cols", "row", "parseRow", "r", "parseObject", "len", "key", "properties", "parseNumber", "numberStr", "numericType", "safeNumberType", "parseParentheses", "parseEnd", "col", "message", "error", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCompile", "factory", "_ref", "typed", "parse", "expr", "deepMap", "entry", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createEvaluate", "factory", "_ref", "typed", "parse", "expr", "scope", "createEmptyMap", "deepMap", "entry", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createParserClass", "factory", "_ref", "evaluate", "Parser", "createEmptyMap", "expr", "toObject", "value", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createParser", "factory", "_ref", "typed", "Parser", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLup", "factory", "_ref", "typed", "matrix", "abs", "addScalar", "divideScalar", "multiplyScalar", "subtractScalar", "larger", "equalScalar", "unaryMinus", "DenseMatrix", "SparseMatrix", "Spa", "m", "_denseLUP", "_sparseLUP", "a", "r", "rows", "columns", "n", "data", "clone", "ldata", "lsize", "udata", "usize", "i", "j", "k", "p", "min", "s", "pi", "pabsv", "vjj", "v", "absv", "vij", "l", "u", "pv", "values", "index", "ptr", "lvalues", "lindex", "lptr", "uvalues", "uindex", "uptr", "pvCo", "pvOc", "swapIndeces", "x", "y", "kx", "ky", "_loop", "spa", "k0", "k1", "vkj", "vik", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createQr", "factory", "_ref", "typed", "matrix", "zeros", "identity", "isZero", "equal", "sign", "sqrt", "conj", "unaryMinus", "addScalar", "divideScalar", "multiplyScalar", "subtractScalar", "complex", "_extends", "m", "_denseQR", "_sparseQR", "a", "r", "_denseQRimpl", "rows", "cols", "Q", "Qdata", "Rdata", "i", "j", "k", "w", "pivot", "sgn", "conjSgn", "alphaSquared", "alpha", "u1", "tau", "s", "ret", "zero", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csPermute", "a", "pinv", "q", "values", "avalues", "aindex", "aptr", "asize", "adt", "m", "n", "cvalues", "cindex", "cptr", "nz", "k", "j", "t0", "t1", "t", "r", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csTdfs", "j", "k", "w", "head", "next", "post", "stack", "top", "p", "i", "csPost", "parent", "n", "k", "j", "post", "w", "head", "next", "stack", "csTdfs", "init_dirname", "init_buffer", "init_process", "csEtree", "a", "ata", "aindex", "aptr", "asize", "m", "n", "parent", "w", "ancestor", "prev", "i", "inext", "k", "p0", "p1", "p", "r", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csFkeep", "a", "callback", "other", "avalues", "aindex", "aptr", "asize", "n", "nz", "j", "p", "init_dirname", "init_buffer", "init_process", "csFlip", "i", "name", "dependencies", "createCsAmd", "factory", "_ref", "add", "multiply", "transpose", "order", "a", "asize", "m", "n", "lemax", "dense", "cm", "_createTargetMatrix", "csFkeep", "_diag", "cindex", "cptr", "cnz", "P", "W", "len", "nv", "next", "head", "elen", "degree", "w", "hhead", "last", "mark", "_initializeQuotientGraph", "nel", "_initializeDegreeLists", "mindeg", "i", "j", "k", "k1", "k2", "e", "pj", "ln", "nvi", "pk", "eln", "p1", "p2", "pn", "h", "d", "elenk", "nvk", "dk", "p", "pk1", "pk2", "csFlip", "_wclear", "wnvi", "dext", "p3", "p4", "nvj", "jlast", "ok", "csTdfs", "at", "tindex", "tptr", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csLeaf", "i", "j", "w", "first", "maxfirst", "prevleaf", "ancestor", "s", "sparent", "jleaf", "q", "jprev", "name", "dependencies", "createCsCounts", "factory", "_ref", "transpose", "a", "parent", "post", "ata", "asize", "m", "n", "i", "j", "k", "J", "p", "p0", "p1", "s", "w", "ancestor", "maxfirst", "prevleaf", "first", "head", "next", "colcount", "at", "tindex", "tptr", "r", "csLeaf", "name", "dependencies", "createCsSqr", "factory", "_ref", "add", "multiply", "transpose", "csAmd", "createCsAmd", "csCounts", "createCsCounts", "order", "a", "qr", "aptr", "asize", "n", "k", "s", "c", "csPermute", "csEtree", "post", "csPost", "_vcount", "aindex", "m", "parent", "pinv", "leftmost", "w", "next", "head", "tail", "nque", "i", "p", "p0", "p1", "pa", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csMarked", "w", "j", "init_dirname", "init_buffer", "init_process", "csMark", "w", "j", "csFlip", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csUnflip", "i", "csFlip", "csDfs", "j", "g", "top", "xi", "pinv", "index", "ptr", "size", "n", "i", "p", "p2", "head", "jnew", "csMarked", "csMark", "csUnflip", "done", "csReach", "g", "b", "k", "xi", "pinv", "gptr", "gsize", "bindex", "bptr", "n", "p", "p0", "p1", "top", "i", "csMarked", "csDfs", "csMark", "name", "dependencies", "createCsSpsolve", "factory", "_ref", "divideScalar", "multiply", "subtract", "g", "b", "k", "xi", "x", "pinv", "lo", "gvalues", "gindex", "gptr", "gsize", "n", "bvalues", "bindex", "bptr", "p", "p0", "p1", "q", "top", "csReach", "px", "j", "J", "i", "name", "dependencies", "createCsLu", "factory", "_ref", "abs", "divideScalar", "multiply", "subtract", "larger", "largerEq", "SparseMatrix", "csSpsolve", "createCsSpsolve", "m", "s", "tol", "size", "n", "q", "lnz", "unz", "lvalues", "lindex", "lptr", "L", "uvalues", "uindex", "uptr", "U", "pinv", "i", "p", "x", "xi", "k", "col", "top", "ipiv", "a", "xabs", "pivot", "name", "dependencies", "createSlu", "factory", "_ref", "typed", "abs", "add", "multiply", "transpose", "divideScalar", "subtract", "larger", "largerEq", "SparseMatrix", "csSqr", "createCsSqr", "csLu", "createCsLu", "a", "order", "threshold", "isInteger", "s", "f", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csIpvec", "p", "b", "k", "x", "name", "dependencies", "createLusolve", "factory", "_ref", "typed", "matrix", "lup", "slu", "usolve", "lsolve", "DenseMatrix", "solveValidation", "createSolveValidation", "a", "b", "d", "x", "_lusolve", "order", "threshold", "_toMatrix", "isMatrix", "isArray", "l", "u", "p", "q", "csIpvec", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPolynomialRoot", "factory", "_ref", "typed", "isZero", "equalScalar", "add", "subtract", "multiply", "divide", "sqrt", "unaryMinus", "cbrt", "typeOf", "im", "re", "constant", "restCoeffs", "coeffs", "c", "b", "a", "denom", "d1", "d2", "discriminant", "d", "_c", "_b", "_a", "_denom", "D0_1", "D0_2", "D1_1", "D1_2", "Delta0", "Delta1", "discriminant1", "discriminant2", "Ccubed", "allRoots", "rawRoots", "C", "r", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createHelpClass", "factory", "_ref", "evaluate", "Help", "doc", "desc", "configChanged", "originalConfig", "scope", "newConfig", "i", "expr", "res", "e", "isHelp", "format", "obj", "clone", "json", "prop", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createChainClass", "factory", "_ref", "on", "math", "typed", "Chain", "value", "isChain", "format", "json", "createProxy", "fn", "chainify", "createLazyProxy", "resolver", "lazy", "args", "i", "sigObject", "arg0", "arg1", "_loop", "_name", "hasOwnProperty", "excludedNames", "path", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "eDocs", "init_dirname", "init_buffer", "init_process", "falseDocs", "init_dirname", "init_buffer", "init_process", "iDocs", "init_dirname", "init_buffer", "init_process", "InfinityDocs", "init_dirname", "init_buffer", "init_process", "LN10Docs", "init_dirname", "init_buffer", "init_process", "LN2Docs", "init_dirname", "init_buffer", "init_process", "LOG10EDocs", "init_dirname", "init_buffer", "init_process", "LOG2EDocs", "init_dirname", "init_buffer", "init_process", "NaNDocs", "init_dirname", "init_buffer", "init_process", "nullDocs", "init_dirname", "init_buffer", "init_process", "phiDocs", "init_dirname", "init_buffer", "init_process", "piDocs", "init_dirname", "init_buffer", "init_process", "SQRT12Docs", "init_dirname", "init_buffer", "init_process", "SQRT2Docs", "init_dirname", "init_buffer", "init_process", "tauDocs", "init_dirname", "init_buffer", "init_process", "trueDocs", "init_dirname", "init_buffer", "init_process", "versionDocs", "init_dirname", "init_buffer", "init_process", "bignumberDocs", "init_dirname", "init_buffer", "init_process", "bigintDocs", "init_dirname", "init_buffer", "init_process", "booleanDocs", "init_dirname", "init_buffer", "init_process", "complexDocs", "init_dirname", "init_buffer", "init_process", "createUnitDocs", "init_dirname", "init_buffer", "init_process", "fractionDocs", "init_dirname", "init_buffer", "init_process", "indexDocs", "init_dirname", "init_buffer", "init_process", "matrixDocs", "init_dirname", "init_buffer", "init_process", "numberDocs", "init_dirname", "init_buffer", "init_process", "sparseDocs", "init_dirname", "init_buffer", "init_process", "splitUnitDocs", "init_dirname", "init_buffer", "init_process", "stringDocs", "init_dirname", "init_buffer", "init_process", "unitDocs", "init_dirname", "init_buffer", "init_process", "configDocs", "init_dirname", "init_buffer", "init_process", "importDocs", "init_dirname", "init_buffer", "init_process", "typedDocs", "init_dirname", "init_buffer", "init_process", "derivativeDocs", "init_dirname", "init_buffer", "init_process", "leafCountDocs", "init_dirname", "init_buffer", "init_process", "lsolveDocs", "init_dirname", "init_buffer", "init_process", "lsolveAllDocs", "init_dirname", "init_buffer", "init_process", "lupDocs", "init_dirname", "init_buffer", "init_process", "lusolveDocs", "init_dirname", "init_buffer", "init_process", "polynomialRootDocs", "init_dirname", "init_buffer", "init_process", "qrDocs", "init_dirname", "init_buffer", "init_process", "rationalizeDocs", "init_dirname", "init_buffer", "init_process", "resolveDocs", "init_dirname", "init_buffer", "init_process", "simplifyDocs", "init_dirname", "init_buffer", "init_process", "simplifyConstantDocs", "init_dirname", "init_buffer", "init_process", "simplifyCoreDocs", "init_dirname", "init_buffer", "init_process", "sluDocs", "init_dirname", "init_buffer", "init_process", "symbolicEqualDocs", "init_dirname", "init_buffer", "init_process", "usolveDocs", "init_dirname", "init_buffer", "init_process", "usolveAllDocs", "init_dirname", "init_buffer", "init_process", "absDocs", "init_dirname", "init_buffer", "init_process", "addDocs", "init_dirname", "init_buffer", "init_process", "cbrtDocs", "init_dirname", "init_buffer", "init_process", "ceilDocs", "init_dirname", "init_buffer", "init_process", "cubeDocs", "init_dirname", "init_buffer", "init_process", "divideDocs", "init_dirname", "init_buffer", "init_process", "dotDivideDocs", "init_dirname", "init_buffer", "init_process", "dotMultiplyDocs", "init_dirname", "init_buffer", "init_process", "dotPowDocs", "init_dirname", "init_buffer", "init_process", "expDocs", "init_dirname", "init_buffer", "init_process", "expmDocs", "init_dirname", "init_buffer", "init_process", "expm1Docs", "init_dirname", "init_buffer", "init_process", "fixDocs", "init_dirname", "init_buffer", "init_process", "floorDocs", "init_dirname", "init_buffer", "init_process", "gcdDocs", "init_dirname", "init_buffer", "init_process", "hypotDocs", "init_dirname", "init_buffer", "init_process", "invmodDocs", "init_dirname", "init_buffer", "init_process", "lcmDocs", "init_dirname", "init_buffer", "init_process", "logDocs", "init_dirname", "init_buffer", "init_process", "log10Docs", "init_dirname", "init_buffer", "init_process", "log1pDocs", "init_dirname", "init_buffer", "init_process", "log2Docs", "init_dirname", "init_buffer", "init_process", "modDocs", "init_dirname", "init_buffer", "init_process", "multiplyDocs", "init_dirname", "init_buffer", "init_process", "normDocs", "init_dirname", "init_buffer", "init_process", "nthRootDocs", "init_dirname", "init_buffer", "init_process", "nthRootsDocs", "init_dirname", "init_buffer", "init_process", "powDocs", "init_dirname", "init_buffer", "init_process", "roundDocs", "init_dirname", "init_buffer", "init_process", "signDocs", "init_dirname", "init_buffer", "init_process", "sqrtDocs", "init_dirname", "init_buffer", "init_process", "sqrtmDocs", "init_dirname", "init_buffer", "init_process", "sylvesterDocs", "init_dirname", "init_buffer", "init_process", "schurDocs", "init_dirname", "init_buffer", "init_process", "lyapDocs", "init_dirname", "init_buffer", "init_process", "squareDocs", "init_dirname", "init_buffer", "init_process", "subtractDocs", "init_dirname", "init_buffer", "init_process", "unaryMinusDocs", "init_dirname", "init_buffer", "init_process", "unaryPlusDocs", "init_dirname", "init_buffer", "init_process", "xgcdDocs", "init_dirname", "init_buffer", "init_process", "bitAndDocs", "init_dirname", "init_buffer", "init_process", "bitNotDocs", "init_dirname", "init_buffer", "init_process", "bitOrDocs", "init_dirname", "init_buffer", "init_process", "bitXorDocs", "init_dirname", "init_buffer", "init_process", "leftShiftDocs", "init_dirname", "init_buffer", "init_process", "rightArithShiftDocs", "init_dirname", "init_buffer", "init_process", "rightLogShiftDocs", "init_dirname", "init_buffer", "init_process", "bellNumbersDocs", "init_dirname", "init_buffer", "init_process", "catalanDocs", "init_dirname", "init_buffer", "init_process", "compositionDocs", "init_dirname", "init_buffer", "init_process", "stirlingS2Docs", "init_dirname", "init_buffer", "init_process", "argDocs", "init_dirname", "init_buffer", "init_process", "conjDocs", "init_dirname", "init_buffer", "init_process", "imDocs", "init_dirname", "init_buffer", "init_process", "reDocs", "init_dirname", "init_buffer", "init_process", "evaluateDocs", "init_dirname", "init_buffer", "init_process", "helpDocs", "init_dirname", "init_buffer", "init_process", "distanceDocs", "init_dirname", "init_buffer", "init_process", "intersectDocs", "init_dirname", "init_buffer", "init_process", "andDocs", "init_dirname", "init_buffer", "init_process", "notDocs", "init_dirname", "init_buffer", "init_process", "orDocs", "init_dirname", "init_buffer", "init_process", "xorDocs", "init_dirname", "init_buffer", "init_process", "columnDocs", "init_dirname", "init_buffer", "init_process", "concatDocs", "init_dirname", "init_buffer", "init_process", "countDocs", "init_dirname", "init_buffer", "init_process", "crossDocs", "init_dirname", "init_buffer", "init_process", "ctransposeDocs", "init_dirname", "init_buffer", "init_process", "detDocs", "init_dirname", "init_buffer", "init_process", "diagDocs", "init_dirname", "init_buffer", "init_process", "diffDocs", "init_dirname", "init_buffer", "init_process", "dotDocs", "init_dirname", "init_buffer", "init_process", "eigsDocs", "init_dirname", "init_buffer", "init_process", "filterDocs", "init_dirname", "init_buffer", "init_process", "flattenDocs", "init_dirname", "init_buffer", "init_process", "forEachDocs", "init_dirname", "init_buffer", "init_process", "getMatrixDataTypeDocs", "init_dirname", "init_buffer", "init_process", "identityDocs", "init_dirname", "init_buffer", "init_process", "invDocs", "init_dirname", "init_buffer", "init_process", "pinvDocs", "init_dirname", "init_buffer", "init_process", "kronDocs", "init_dirname", "init_buffer", "init_process", "mapDocs", "init_dirname", "init_buffer", "init_process", "matrixFromColumnsDocs", "init_dirname", "init_buffer", "init_process", "matrixFromFunctionDocs", "init_dirname", "init_buffer", "init_process", "matrixFromRowsDocs", "init_dirname", "init_buffer", "init_process", "onesDocs", "init_dirname", "init_buffer", "init_process", "partitionSelectDocs", "init_dirname", "init_buffer", "init_process", "rangeDocs", "init_dirname", "init_buffer", "init_process", "reshapeDocs", "init_dirname", "init_buffer", "init_process", "resizeDocs", "init_dirname", "init_buffer", "init_process", "rotateDocs", "init_dirname", "init_buffer", "init_process", "rotationMatrixDocs", "init_dirname", "init_buffer", "init_process", "rowDocs", "init_dirname", "init_buffer", "init_process", "sizeDocs", "init_dirname", "init_buffer", "init_process", "sortDocs", "init_dirname", "init_buffer", "init_process", "squeezeDocs", "init_dirname", "init_buffer", "init_process", "subsetDocs", "init_dirname", "init_buffer", "init_process", "traceDocs", "init_dirname", "init_buffer", "init_process", "transposeDocs", "init_dirname", "init_buffer", "init_process", "zerosDocs", "init_dirname", "init_buffer", "init_process", "fftDocs", "init_dirname", "init_buffer", "init_process", "ifftDocs", "init_dirname", "init_buffer", "init_process", "combinationsDocs", "init_dirname", "init_buffer", "init_process", "combinationsWithRepDocs", "init_dirname", "init_buffer", "init_process", "factorialDocs", "init_dirname", "init_buffer", "init_process", "gammaDocs", "init_dirname", "init_buffer", "init_process", "lgammaDocs", "init_dirname", "init_buffer", "init_process", "kldivergenceDocs", "init_dirname", "init_buffer", "init_process", "multinomialDocs", "init_dirname", "init_buffer", "init_process", "permutationsDocs", "init_dirname", "init_buffer", "init_process", "pickRandomDocs", "init_dirname", "init_buffer", "init_process", "randomDocs", "init_dirname", "init_buffer", "init_process", "randomIntDocs", "init_dirname", "init_buffer", "init_process", "compareDocs", "init_dirname", "init_buffer", "init_process", "compareNaturalDocs", "init_dirname", "init_buffer", "init_process", "compareTextDocs", "init_dirname", "init_buffer", "init_process", "deepEqualDocs", "init_dirname", "init_buffer", "init_process", "equalDocs", "init_dirname", "init_buffer", "init_process", "equalTextDocs", "init_dirname", "init_buffer", "init_process", "largerDocs", "init_dirname", "init_buffer", "init_process", "largerEqDocs", "init_dirname", "init_buffer", "init_process", "smallerDocs", "init_dirname", "init_buffer", "init_process", "smallerEqDocs", "init_dirname", "init_buffer", "init_process", "unequalDocs", "init_dirname", "init_buffer", "init_process", "setCartesianDocs", "init_dirname", "init_buffer", "init_process", "setDifferenceDocs", "init_dirname", "init_buffer", "init_process", "setDistinctDocs", "init_dirname", "init_buffer", "init_process", "setIntersectDocs", "init_dirname", "init_buffer", "init_process", "setIsSubsetDocs", "init_dirname", "init_buffer", "init_process", "setMultiplicityDocs", "init_dirname", "init_buffer", "init_process", "setPowersetDocs", "init_dirname", "init_buffer", "init_process", "setSizeDocs", "init_dirname", "init_buffer", "init_process", "setSymDifferenceDocs", "init_dirname", "init_buffer", "init_process", "setUnionDocs", "init_dirname", "init_buffer", "init_process", "zpk2tfDocs", "init_dirname", "init_buffer", "init_process", "freqzDocs", "init_dirname", "init_buffer", "init_process", "erfDocs", "init_dirname", "init_buffer", "init_process", "zetaDocs", "init_dirname", "init_buffer", "init_process", "madDocs", "init_dirname", "init_buffer", "init_process", "maxDocs", "init_dirname", "init_buffer", "init_process", "meanDocs", "init_dirname", "init_buffer", "init_process", "medianDocs", "init_dirname", "init_buffer", "init_process", "minDocs", "init_dirname", "init_buffer", "init_process", "modeDocs", "init_dirname", "init_buffer", "init_process", "prodDocs", "init_dirname", "init_buffer", "init_process", "quantileSeqDocs", "init_dirname", "init_buffer", "init_process", "stdDocs", "init_dirname", "init_buffer", "init_process", "cumSumDocs", "init_dirname", "init_buffer", "init_process", "sumDocs", "init_dirname", "init_buffer", "init_process", "varianceDocs", "init_dirname", "init_buffer", "init_process", "corrDocs", "init_dirname", "init_buffer", "init_process", "acosDocs", "init_dirname", "init_buffer", "init_process", "acoshDocs", "init_dirname", "init_buffer", "init_process", "acotDocs", "init_dirname", "init_buffer", "init_process", "acothDocs", "init_dirname", "init_buffer", "init_process", "acscDocs", "init_dirname", "init_buffer", "init_process", "acschDocs", "init_dirname", "init_buffer", "init_process", "asecDocs", "init_dirname", "init_buffer", "init_process", "asechDocs", "init_dirname", "init_buffer", "init_process", "asinDocs", "init_dirname", "init_buffer", "init_process", "asinhDocs", "init_dirname", "init_buffer", "init_process", "atanDocs", "init_dirname", "init_buffer", "init_process", "atan2Docs", "init_dirname", "init_buffer", "init_process", "atanhDocs", "init_dirname", "init_buffer", "init_process", "cosDocs", "init_dirname", "init_buffer", "init_process", "coshDocs", "init_dirname", "init_buffer", "init_process", "cotDocs", "init_dirname", "init_buffer", "init_process", "cothDocs", "init_dirname", "init_buffer", "init_process", "cscDocs", "init_dirname", "init_buffer", "init_process", "cschDocs", "init_dirname", "init_buffer", "init_process", "secDocs", "init_dirname", "init_buffer", "init_process", "sechDocs", "init_dirname", "init_buffer", "init_process", "sinDocs", "init_dirname", "init_buffer", "init_process", "sinhDocs", "init_dirname", "init_buffer", "init_process", "tanDocs", "init_dirname", "init_buffer", "init_process", "tanhDocs", "init_dirname", "init_buffer", "init_process", "toDocs", "init_dirname", "init_buffer", "init_process", "binDocs", "init_dirname", "init_buffer", "init_process", "cloneDocs", "init_dirname", "init_buffer", "init_process", "formatDocs", "init_dirname", "init_buffer", "init_process", "hasNumericValueDocs", "init_dirname", "init_buffer", "init_process", "hexDocs", "init_dirname", "init_buffer", "init_process", "isIntegerDocs", "init_dirname", "init_buffer", "init_process", "isNaNDocs", "init_dirname", "init_buffer", "init_process", "isNegativeDocs", "init_dirname", "init_buffer", "init_process", "isNumericDocs", "init_dirname", "init_buffer", "init_process", "isPositiveDocs", "init_dirname", "init_buffer", "init_process", "isPrimeDocs", "init_dirname", "init_buffer", "init_process", "isZeroDocs", "init_dirname", "init_buffer", "init_process", "numericDocs", "init_dirname", "init_buffer", "init_process", "octDocs", "init_dirname", "init_buffer", "init_process", "printDocs", "init_dirname", "init_buffer", "init_process", "typeOfDocs", "init_dirname", "init_buffer", "init_process", "solveODEDocs", "embeddedDocs", "bignumberDocs", "bigintDocs", "booleanDocs", "complexDocs", "createUnitDocs", "fractionDocs", "indexDocs", "matrixDocs", "numberDocs", "sparseDocs", "splitUnitDocs", "stringDocs", "unitDocs", "eDocs", "falseDocs", "iDocs", "InfinityDocs", "LN2Docs", "LN10Docs", "LOG2EDocs", "LOG10EDocs", "NaNDocs", "nullDocs", "piDocs", "phiDocs", "SQRT12Docs", "SQRT2Docs", "tauDocs", "trueDocs", "versionDocs", "derivativeDocs", "lsolveDocs", "lsolveAllDocs", "lupDocs", "lusolveDocs", "leafCountDocs", "polynomialRootDocs", "resolveDocs", "simplifyDocs", "simplifyConstantDocs", "simplifyCoreDocs", "symbolicEqualDocs", "rationalizeDocs", "sluDocs", "usolveDocs", "usolveAllDocs", "qrDocs", "absDocs", "addDocs", "cbrtDocs", "ceilDocs", "cubeDocs", "divideDocs", "dotDivideDocs", "dotMultiplyDocs", "dotPowDocs", "expDocs", "expmDocs", "expm1Docs", "fixDocs", "floorDocs", "gcdDocs", "hypotDocs", "lcmDocs", "logDocs", "log2Docs", "log1pDocs", "log10Docs", "modDocs", "multiplyDocs", "normDocs", "nthRootDocs", "nthRootsDocs", "powDocs", "roundDocs", "signDocs", "sqrtDocs", "sqrtmDocs", "squareDocs", "subtractDocs", "unaryMinusDocs", "unaryPlusDocs", "xgcdDocs", "invmodDocs", "bitAndDocs", "bitNotDocs", "bitOrDocs", "bitXorDocs", "leftShiftDocs", "rightArithShiftDocs", "rightLogShiftDocs", "bellNumbersDocs", "catalanDocs", "compositionDocs", "stirlingS2Docs", "configDocs", "importDocs", "typedDocs", "argDocs", "conjDocs", "reDocs", "imDocs", "evaluateDocs", "helpDocs", "distanceDocs", "intersectDocs", "andDocs", "notDocs", "orDocs", "xorDocs", "concatDocs", "countDocs", "crossDocs", "columnDocs", "ctransposeDocs", "detDocs", "diagDocs", "diffDocs", "dotDocs", "getMatrixDataTypeDocs", "identityDocs", "filterDocs", "flattenDocs", "forEachDocs", "invDocs", "pinvDocs", "eigsDocs", "kronDocs", "matrixFromFunctionDocs", "matrixFromRowsDocs", "matrixFromColumnsDocs", "mapDocs", "onesDocs", "partitionSelectDocs", "rangeDocs", "resizeDocs", "reshapeDocs", "rotateDocs", "rotationMatrixDocs", "rowDocs", "sizeDocs", "sortDocs", "squeezeDocs", "subsetDocs", "traceDocs", "transposeDocs", "zerosDocs", "fftDocs", "ifftDocs", "sylvesterDocs", "schurDocs", "lyapDocs", "solveODEDocs", "combinationsDocs", "combinationsWithRepDocs", "factorialDocs", "gammaDocs", "kldivergenceDocs", "lgammaDocs", "multinomialDocs", "permutationsDocs", "pickRandomDocs", "randomDocs", "randomIntDocs", "compareDocs", "compareNaturalDocs", "compareTextDocs", "deepEqualDocs", "equalDocs", "equalTextDocs", "largerDocs", "largerEqDocs", "smallerDocs", "smallerEqDocs", "unequalDocs", "setCartesianDocs", "setDifferenceDocs", "setDistinctDocs", "setIntersectDocs", "setIsSubsetDocs", "setMultiplicityDocs", "setPowersetDocs", "setSizeDocs", "setSymDifferenceDocs", "setUnionDocs", "zpk2tfDocs", "freqzDocs", "erfDocs", "zetaDocs", "cumSumDocs", "madDocs", "maxDocs", "meanDocs", "medianDocs", "minDocs", "modeDocs", "prodDocs", "quantileSeqDocs", "stdDocs", "sumDocs", "varianceDocs", "corrDocs", "acosDocs", "acoshDocs", "acotDocs", "acothDocs", "acscDocs", "acschDocs", "asecDocs", "asechDocs", "asinDocs", "asinhDocs", "atanDocs", "atanhDocs", "atan2Docs", "cosDocs", "coshDocs", "cotDocs", "cothDocs", "cscDocs", "cschDocs", "secDocs", "sechDocs", "sinDocs", "sinhDocs", "tanDocs", "tanhDocs", "toDocs", "cloneDocs", "formatDocs", "binDocs", "octDocs", "hexDocs", "isNaNDocs", "isIntegerDocs", "isNegativeDocs", "isNumericDocs", "hasNumericValueDocs", "isPositiveDocs", "isPrimeDocs", "isZeroDocs", "printDocs", "typeOfDocs", "numericDocs", "name", "dependencies", "createHelp", "factory", "_ref", "typed", "mathWithTransform", "Help", "search", "prop", "searchName", "hasOwnProperty", "doc", "getSafeProperty", "embeddedDocs", "searchText", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createChain", "factory", "_ref", "typed", "Chain", "value", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDet", "factory", "_ref", "typed", "matrix", "subtractScalar", "multiply", "divideScalar", "isZero", "unaryMinus", "x", "clone", "size", "isMatrix", "format", "rows", "cols", "_det", "negated", "rowIndices", "_", "i", "k", "k_", "_k", "piv", "piv_", "i_", "j", "det", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createInv", "factory", "_ref", "typed", "matrix", "divideScalar", "addScalar", "multiply", "unaryMinus", "det", "identity", "abs", "x", "size", "isMatrix", "arraySize", "format", "rows", "cols", "_inv", "mat", "r", "s", "f", "value", "temp", "d", "A", "B", "c", "ABig", "rBig", "Ac", "Bc", "Ar", "Br", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPinv", "factory", "_ref", "typed", "matrix", "inv", "deepEqual", "equal", "dotDivide", "dot", "ctranspose", "divideScalar", "multiply", "add", "Complex", "x", "size", "isMatrix", "arraySize", "_isZeros", "rows", "cols", "err", "_pinv", "format", "clone", "mat", "C", "F", "_rankFact", "Cpinv", "Fpinv", "_rref", "M", "lead", "r", "i", "_isZero", "val", "j", "_i", "_j", "rref", "_", "arr", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "createComplexEigs", "_ref", "addScalar", "subtract", "flatten", "multiply", "multiplyScalar", "divideScalar", "sqrt", "abs", "bignumber", "diag", "size", "reshape", "inv", "qr", "usolve", "usolveAll", "equal", "complex", "larger", "smaller", "matrixFromColumns", "dot", "complexEigs", "arr", "N", "prec", "type", "findVectors", "R", "balance", "reduceToHessenberg", "values", "C", "iterateUntilTriangular", "eigenvectors", "findEigenvectors", "big", "cplx", "realzero", "one", "realone", "radix", "radixSq", "Rdiag", "last", "i", "colNorm", "rowNorm", "j", "f", "c", "rowDivRadix", "rowMulRadix", "condition", "g", "_j", "zero", "maxIndex", "max", "el", "tmp1", "_j2", "tmp2", "tmp3", "_j3", "n", "k", "_k", "_k2", "A", "clone", "lambdas", "Sdiag", "Qtotal", "Qpartial", "lastConvergenceBefore", "Q", "_i", "inflateMatrix", "_i2", "ll", "eigenvalues2x2", "jordanBase2x2", "_i3", "a", "b", "err", "blockDiag", "Cinv", "U", "uniqueValues", "multiplicities", "lambda", "indexOf", "vectors", "len", "E", "_loop", "_i4", "S", "solutions", "approxVec", "inverseIterate", "correction", "v", "d", "trA", "detA", "x", "y", "l1", "l2", "na", "nd", "_i5", "M", "I", "sub", "_i6", "fn", "orthog", "largeNum", "randomOrthogonalVector", "norm", "orthogonalComplement", "normalize", "_", "vectorShape", "w", "init_dirname", "init_buffer", "init_process", "createRealSymmetric", "_ref", "config", "addScalar", "subtract", "abs", "atan", "cos", "sin", "multiplyScalar", "inv", "bignumber", "multiply", "add", "main", "arr", "N", "prec", "type", "computeVectors", "diag", "diagBig", "x", "precision", "e0", "psi", "Sij", "i", "Vab", "getAij", "_i", "j", "getTheta", "x1", "Sij1", "Ei", "_i2", "sorting", "clone", "getAijBig", "_i3", "getThetaBig", "x1Big", "Sij1Big", "_i4", "aii", "ajj", "aij", "denom", "theta", "c", "s", "Ski", "Skj", "k", "_k", "_k2", "Hij", "c2", "s2", "Aki", "Akj", "csHij", "Aii", "Ajj", "_k3", "_k4", "Mij", "maxMij", "maxIJ", "E", "S", "values", "vecs", "minID", "minE", "_k5", "eigenvectors", "vector", "name", "dependencies", "createEigs", "factory", "_ref", "config", "typed", "matrix", "addScalar", "subtract", "equal", "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", "doRealSymmetric", "createRealSymmetric", "doComplexEigs", "createComplexEigs", "x", "doEigs", "prec", "opts", "mat", "useOpts", "_extends", "_opts$precision", "computeVectors", "result", "computeValuesAndVectors", "_ref2", "value", "vector", "arr", "asize", "format", "N", "isReal", "coerceReal", "isSymmetric", "_type", "coerceTypes", "type", "i", "j", "hasNumber", "hasBig", "hasComplex", "el", "isNumber", "isFraction", "isBigNumber", "isComplex", "typeOf", "_i", "_j", "_i2", "_j2", "_i3", "_j3", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createExpm", "factory", "_ref", "typed", "abs", "add", "identity", "inv", "multiply", "A", "size", "format", "n", "eps", "infNorm", "infinityNorm", "params", "findParams", "q", "j", "Apos", "N", "D", "factor", "AposToI", "alternate", "i", "R", "_i", "isSparseMatrix", "rowSum", "maxSearchSize", "k", "errorEstimate", "qfac", "twoqfac", "_i2", "twoqp1fac", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSqrtm", "factory", "_ref", "typed", "abs", "add", "multiply", "map", "sqrt", "subtract", "inv", "size", "max", "identity", "_maxIterations", "_tolerance", "_denmanBeavers", "A", "error", "iterations", "Y", "Z", "Yk", "isMatrix", "arraySize", "format", "rows", "cols", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSylvester", "factory", "_ref", "typed", "schur", "matrixFromColumns", "matrix", "multiply", "range", "concat", "transpose", "index", "subset", "add", "subtract", "identity", "lusolve", "abs", "_sylvester", "A", "B", "C", "n", "m", "sA", "F", "U", "sB", "G", "V", "D", "all", "y", "hc", "a", "b", "vc", "k", "RHS", "j", "gkk", "gmk", "gkm", "gmm", "LHS", "yAux", "_RHS", "_j", "_gkk", "_LHS", "Y", "X", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSchur", "factory", "_ref", "typed", "matrix", "identity", "multiply", "qr", "norm", "subtract", "X", "r", "_schur", "n", "A", "U", "k", "A0", "QR", "Q", "R", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLyap", "factory", "_ref", "typed", "matrix", "sylvester", "multiply", "transpose", "A", "Q", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDivide", "factory", "_ref", "typed", "matrix", "multiply", "equalScalar", "divideScalar", "inv", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "extend", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDistance", "factory", "_ref", "typed", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "deepEqual", "sqrt", "abs", "x", "y", "z", "_2d", "xCoeff", "yCoeff", "constant", "_distancePointLine2D", "_objectToArray", "_3d", "_parametricLine", "_distancePointLine3D", "_containsOnlyNumbers", "_euclideanDistance", "arr", "_pairwise", "_distancePairwise", "_isNumber", "a", "isBigNumber", "o", "keys", "i", "aI", "b", "c", "num", "den", "x0", "y0", "z0", "vectorSize", "result", "diff", "pointA", "pointB", "j", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIntersect", "factory", "_ref", "typed", "config", "abs", "add", "addScalar", "matrix", "multiply", "multiplyScalar", "divideScalar", "subtract", "smaller", "equalScalar", "flatten", "isZero", "isNumeric", "_AAA", "_AAAA", "x", "y", "plane", "arr", "w", "z", "_coerceArr", "_3d", "_4d", "_intersectLinePlane", "_2d", "_intersect2d", "_intersect3d", "el", "p1a", "p1b", "p2a", "p2b", "o1", "o2", "d1", "d2", "det", "d20o11", "d21o10", "d20o21", "d21o20", "t", "_intersect3dHelper", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "add1", "add2", "add3", "x1", "y1", "z1", "x2", "y2", "z2", "x3", "y3", "z3", "x4", "y4", "z4", "d1343", "d4321", "d1321", "d4343", "d2121", "numerator", "denominator", "ta", "tb", "pax", "pay", "paz", "pbx", "pby", "pbz", "x1x", "x2x", "y1y", "y2y", "z1z", "z2z", "px", "py", "pz", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSum", "factory", "_ref", "typed", "config", "add", "numeric", "_sum", "_nsumDim", "args", "containsCollections", "array", "sum", "deepForEach", "value", "err", "improveErrorMessage", "safeNumberType", "dim", "reduce", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCumSum", "factory", "_ref", "typed", "add", "unaryPlus", "_cumsum", "matrix", "_ncumSumDim", "dim", "args", "containsCollections", "array", "_cumsummap", "err", "improveErrorMessage", "sums", "i", "size", "arraySize", "IndexError", "_cumsumDimensional", "mat", "ret", "tran", "initialValue", "_switch", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMean", "factory", "_ref", "typed", "add", "divide", "_mean", "_nmeanDim", "args", "containsCollections", "array", "dim", "sum", "reduce", "arraySize", "err", "improveErrorMessage", "num", "deepForEach", "value", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMedian", "factory", "_ref", "typed", "add", "divide", "compare", "partitionSelect", "_median", "array", "flatten", "num", "mid", "right", "left", "i", "middle2", "m", "middle", "err", "improveErrorMessage", "value", "dim", "args", "containsCollections", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMad", "factory", "_ref", "typed", "abs", "map", "median", "subtract", "_mad", "args", "array", "flatten", "med", "value", "err", "improveErrorMessage", "init_dirname", "init_buffer", "init_process", "DEFAULT_NORMALIZATION", "name", "dependencies", "createVariance", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "apply", "isNaN", "array", "_var", "dim", "_varDim", "args", "normalization", "sum", "num", "deepForEach", "value", "err", "improveErrorMessage", "mean", "diff", "zero", "isBigNumber", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createQuantileSeq", "factory", "_ref", "typed", "bignumber", "add", "subtract", "divide", "multiply", "partitionSelect", "compare", "isInteger", "smaller", "smallerEq", "larger", "apply", "createApply", "data", "p", "_quantileSeqProbNumber", "prob", "dim", "_quantileSeqDim", "sorted", "_quantileSeqProbCollection", "fn", "x", "probOrN", "probArr", "dataArr", "isNumber", "_quantileSeq", "nPlusOne", "i", "probOrNArr", "array", "flat", "flatten", "len", "index", "integerPart", "fracPart", "left", "right", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createStd", "factory", "_ref", "typed", "map", "sqrt", "variance", "_std", "args", "array", "normalization", "v", "isCollection", "err", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCorr", "factory", "_ref", "typed", "matrix", "sqrt", "sum", "add", "subtract", "multiply", "pow", "divide", "A", "B", "_corr", "res", "correlations", "i", "correlation", "n", "sumX", "sumY", "sumXY", "acc", "x", "index", "sumXSquare", "sumYSquare", "y", "numerator", "denominator", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCombinations", "factory", "_ref", "typed", "combinationsNumber", "k", "BigNumber", "result", "i", "nMinusk", "one", "isPositiveInteger", "n", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCombinationsWithRep", "factory", "_ref", "typed", "k", "isInteger", "_prodrange", "product", "prodrange", "BigNumber", "result", "i", "one", "nMinusOne", "isPositiveInteger", "n", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createGamma", "factory", "_ref", "typed", "config", "multiplyScalar", "pow", "_BigNumber", "Complex", "gammaComplex", "n", "gammaNumber", "_t", "r", "x", "gammaP", "i", "gammaPval", "t", "gammaG", "twoPiSqrt", "tpow", "expt", "bigFactorial", "precision", "Big", "p", "prod", "sum", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLgamma", "factory", "_ref", "Complex", "typed", "SMALL_RE", "SMALL_IM", "coeffs", "lgammaNumber", "lgammaComplex", "n", "TWOPI", "LOGPI", "REFLECTION", "lgammaStirling", "tmp", "copysign", "a", "b", "lgammaRecurrence", "z", "leftPart", "lnSqrt2PI", "rz", "rzz", "r", "s", "i", "rightPart", "signflips", "sb", "shiftprod", "nsb", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFactorial", "factory", "_ref", "typed", "gamma", "n", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createKldivergence", "factory", "_ref", "typed", "matrix", "divide", "sum", "multiply", "map", "dotDivide", "log", "isNumeric", "q", "p", "_kldiv", "plength", "qlength", "sumq", "sump", "qnorm", "pnorm", "result", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMultinomial", "factory", "_ref", "typed", "add", "divide", "multiply", "factorial", "isInteger", "isPositive", "a", "sum", "denom", "deepForEach", "ai", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPermutations", "factory", "_ref", "typed", "factorial", "n", "k", "isInteger", "product", "result", "i", "isPositiveInteger", "one", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "import_seedrandom", "singletonRandom", "seedrandom", "createRng", "randomSeed", "random", "setSeed", "seed", "rng", "name", "dependencies", "createPickRandom", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "possibles", "_pickRandom", "options", "number", "weights", "_ref2", "elementWise", "single", "createMatrix", "isMatrix", "flatten", "totalWeights", "i", "len", "isNumber", "length", "result", "pick", "randKey", "_i", "_len", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "randomMatrix", "size", "random", "data", "i", "length", "_i", "_length", "name", "dependencies", "createRandom", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "_random", "max", "min", "size", "_randomMatrix", "res", "randomMatrix", "isMatrix", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRandomInt", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "_randomInt", "max", "min", "size", "_randomIntMatrix", "res", "randomMatrix", "isMatrix", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createStirlingS2", "factory", "_ref", "typed", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "pow", "factorial", "combinations", "isNegative", "isInteger", "number", "bignumber", "larger", "smallCache", "bigCache", "n", "k", "big", "isNumber", "cache", "make", "nn", "nk", "m", "row", "prev", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBellNumbers", "factory", "_ref", "typed", "addScalar", "isNegative", "isInteger", "stirlingS2", "n", "result", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCatalan", "factory", "_ref", "typed", "addScalar", "divideScalar", "multiplyScalar", "combinations", "isNegative", "isInteger", "n", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createComposition", "factory", "_ref", "typed", "addScalar", "combinations", "isPositive", "isNegative", "isInteger", "larger", "n", "k", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLeafCount", "factory", "_ref", "parse", "typed", "countLeaves", "node", "count", "n", "expr", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "isNumericNode", "x", "isConstantNode", "isOperatorNode", "isConstantExpression", "isFunctionNode", "isParenthesisNode", "init_dirname", "init_buffer", "init_process", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createUtil", "factory", "_ref", "FunctionNode", "OperatorNode", "SymbolNode", "T", "F", "defaultName", "defaultContext", "realContext", "positiveContext", "hasProperty", "nodeOrName", "property", "context", "isOperatorNode", "isFunctionNode", "isParenthesisNode", "hasOwnProperty", "properties", "_properties", "_properties2", "isCommutative", "node", "isAssociative", "mergeContext", "primary", "secondary", "merged", "prop", "flatten", "allChildren", "i", "op", "children", "findChildren", "child", "unflattenr", "makeNode", "createMakeNodeFunction", "l", "curnode", "unflattenl", "args", "err", "name", "dependencies", "createSimplify", "factory", "_ref", "config", "typed", "parse", "add", "subtract", "multiply", "divide", "pow", "isZero", "equal", "resolve", "simplifyConstant", "simplifyCore", "fraction", "bignumber", "mathWithTransform", "matrix", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "hasProperty", "isCommutative", "isAssociative", "mergeContext", "flatten", "unflattenr", "unflattenl", "createMakeNodeFunction", "defaultContext", "realContext", "positiveContext", "createUtil", "createMap", "simplify", "_simplify", "expr", "scope", "options", "removeParens", "node", "path", "parent", "isParenthesisNode", "SUPPORTED_CONSTANTS", "_canonicalizeRule", "ruleObject", "context", "newRule", "lr", "prop", "nonCommutative", "leftExpandsym", "_getExpandPlaceholderSymbol", "makeNode", "expandsym", "_buildRules", "rules", "ruleSet", "i", "rule", "ruleType", "_lastsym", "createEmptyMap", "debug", "res", "visited", "str", "laststr", "rulestr", "applyRule", "newstr", "mapRule", "nodes", "resNodes", "newNode", "symbol", "property", "mergedContext", "newArgs", "newContent", "newItems", "newObj", "newIndex", "newDims", "changed", "newProps", "repl", "matches", "_ruleMatch", "implicit", "hasOwnProperty", "getSplits", "right", "rightArgs", "_i", "left", "mergeMatch", "match1", "match2", "key", "_exactMatch", "_key", "combineChildMatches", "list1", "list2", "merged", "i1", "i2", "mergeChildMatches", "childMatches", "sets", "uniqueSets", "unique", "s", "isSplit", "childMatch", "leftMatch", "rightMatch", "splits", "splitMatches", "_i2", "matchSet", "isConstantNode", "isSymbolNode", "isNumericNode", "isConstantExpression", "p", "q", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSimplifyConstant", "factory", "_ref", "typed", "config", "mathWithTransform", "matrix", "fraction", "bignumber", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "SymbolNode", "isCommutative", "isAssociative", "allChildren", "createMakeNodeFunction", "createUtil", "simplifyConstant", "node", "_ensureNode", "foldFraction", "expr", "options", "_removeFractions", "thing", "isFraction", "isMatrix", "_eval", "fnname", "args", "_toNumber", "_toNode", "_fractionToNode", "n", "unaryMinusNode", "s", "m", "e", "isNode", "_exactFraction", "exactFractions", "f", "fractionsLimit", "numericType", "safeNumberType", "noBignumber", "noFraction", "vn", "_foldAccessor", "obj", "index", "isIndexNode", "isArrayNode", "remainingDims", "isConstantNode", "first", "second", "tryItems", "fromItems", "item", "isObjectNode", "key", "foldOp", "fn", "makeNode", "reduction", "sofar", "next", "last", "newtree", "operatorFunctions", "arg", "sz", "section", "_args", "res", "isOperatorNode", "consts", "vars", "i", "foldItems", "foldProps", "prop", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSimplifyCore", "factory", "_ref", "typed", "parse", "equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "node0", "node1", "nodeT", "nodeF", "isAlwaysBoolean", "node", "isOperatorNode", "hasProperty", "isCommutative", "createUtil", "_simplifyCore", "nodeToSimplify", "options", "context", "isFunctionNode", "simpChild", "childCount", "c", "op", "getOperator", "last", "seclast", "n", "a0", "finish", "_a", "a1", "isConstantNode", "a", "isArrayNode", "isAccessorNode", "isIndexNode", "isObjectNode", "newProps", "prop", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createResolve", "factory", "_ref", "typed", "parse", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "_resolve", "node", "scope", "within", "isSymbolNode", "variables", "value", "isNode", "nextWithin", "isOperatorNode", "args", "arg", "isParenthesisNode", "isFunctionNode", "_args", "child", "n", "createMap", "self", "A", "selfAM", "selfMM", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSymbolicEqual", "factory", "_ref", "parse", "simplify", "typed", "OperatorNode", "_symbolicEqual", "e1", "e2", "options", "diff", "simplified", "isConstantNode", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDerivative", "factory", "_ref", "typed", "config", "parse", "simplify", "equal", "isZero", "numeric", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "plainDerivative", "expr", "variable", "options", "constNodes", "constTag", "res", "_derivative", "derivative", "deriv", "_derivTex", "x", "isConstantNode", "typeOf", "order", "d", "node", "varName", "isConst", "i", "createConstantNode", "arg0", "arg1", "div", "negative", "funcDerivative", "op", "func", "chainDerivative", "arg", "constantTerms", "nonConstantTerms", "nonConstantNode", "newArgs", "argOuter", "argInner", "_arg", "_arg2", "powMinusOne", "value", "valueType", "safeNumberType", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRationalize", "factory", "_ref", "config", "typed", "equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "parse", "simplifyConstant", "simplifyCore", "simplify", "fraction", "bignumber", "mathWithTransform", "matrix", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "SymbolNode", "ParenthesisNode", "_rationalize", "expr", "scope", "detailed", "setRules", "rulesRationalize", "polyRet", "polynomial", "nVars", "noExactFractions", "withExactFractions", "expandPower", "sBefore", "rules", "eDistrDiv", "redoInic", "s", "coefficients", "retRationalize", "polyToCanonical", "extended", "variables", "node", "oper", "recPoly", "retFunc", "tp", "isInteger", "i", "_name", "pos", "oldRules", "rulesFirst", "rulesDistrDiv", "rulesSucDiv", "parent", "indParent", "internal", "does", "val", "nEsqTopo", "nDirTopo", "o", "maxExpo", "varname", "recurPol", "first", "no", "n1", "op", "n2", "n3", "noPai", "_i", "valor", "_i2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createZpk2tf", "factory", "_ref", "typed", "add", "multiply", "Complex", "number", "z", "p", "k", "_zpk2tf", "el", "num", "den", "i", "zero", "_multiply", "_i", "pole", "_i2", "b", "c", "j", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFreqz", "factory", "_ref", "typed", "add", "multiply", "Complex", "divide", "matrix", "b", "a", "w", "createBins", "_freqz", "w2", "_w", "h", "num", "den", "i", "sumNum", "sumDen", "j", "_j", "_i", "n", "bins", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createReviver", "factory", "_ref", "classes", "key", "value", "constructor", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createReplacer", "factory", "key", "value", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "version", "createTrue", "factory", "createFalse", "createNull", "createInfinity", "recreateFactory", "_ref", "config", "BigNumber", "createNaN", "_ref2", "createPi", "_ref3", "createBigNumberPi", "pi", "createTau", "_ref4", "createBigNumberTau", "tau", "createE", "_ref5", "createBigNumberE", "e", "createPhi", "_ref6", "createBigNumberPhi", "phi", "createLN2", "_ref7", "createLN10", "_ref8", "createLOG2E", "_ref9", "createLOG10E", "_ref10", "createSQRT1_2", "_ref11", "createSQRT2", "_ref12", "createI", "_ref13", "Complex", "createUppercasePi", "_ref14", "createUppercaseE", "_ref15", "createVersion", "version", "name", "dependencies", "create", "init_dirname", "init_buffer", "init_process", "createSpeedOfLight", "unitFactory", "createGravitationConstant", "createPlanckConstant", "createReducedPlanckConstant", "createMagneticConstant", "createElectricConstant", "createVacuumImpedance", "createCoulomb", "createElementaryCharge", "createBohrMagneton", "createConductanceQuantum", "createInverseConductanceQuantum", "createMagneticFluxQuantum", "createNuclearMagneton", "createKlitzing", "createBohrRadius", "unitFactory", "createClassicalElectronRadius", "createElectronMass", "createFermiCoupling", "createFineStructure", "numberFactory", "createHartreeEnergy", "createProtonMass", "createDeuteronMass", "createNeutronMass", "createQuantumOfCirculation", "createRydberg", "createThomsonCrossSection", "createWeakMixingAngle", "createEfimovFactor", "createAtomicMass", "createAvogadro", "createBoltzmann", "createFaraday", "createFirstRadiation", "createLoschmidt", "createGasConstant", "createMolarPlanckConstant", "createMolarVolume", "createSackurTetrode", "createSecondRadiation", "createStefanBoltzmann", "createWienDisplacement", "createMolarMass", "createMolarMassC12", "createGravity", "createPlanckLength", "createPlanckMass", "createPlanckTime", "createPlanckCharge", "createPlanckTemperature", "name", "valueStr", "unitStr", "dependencies", "factory", "_ref", "config", "Unit", "BigNumber", "value", "unit", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createApplyTransform", "factory", "_ref", "typed", "isInteger", "apply", "createApply", "args", "dim", "isNumber", "isBigNumber", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createColumnTransform", "factory", "_ref", "typed", "Index", "matrix", "range", "column", "createColumn", "args", "lastIndex", "last", "isNumber", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "compileInlineExpression", "expression", "math", "scope", "symbol", "node", "isSymbolNode", "name", "argsScope", "subScope", "PartitionedMap", "eq", "x", "name", "dependencies", "createFilterTransform", "factory", "_ref", "typed", "filterTransform", "args", "math", "scope", "x", "callback", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "filter", "_filter", "test", "filterRegExp", "value", "index", "array", "applyCallback", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createForEachTransform", "factory", "_ref", "typed", "forEachTransform", "args", "math", "scope", "x", "callback", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "_forEach", "array", "recurse", "value", "index", "forEach", "child", "i", "applyCallback", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIndexTransform", "factory", "_ref", "Index", "getMatrixDataType", "args", "i", "ii", "arg", "isRange", "v", "isArray", "isMatrix", "isNumber", "isBigNumber", "res", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMapTransform", "factory", "_ref", "typed", "mapTransform", "args", "math", "scope", "x", "callback", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "map", "_map", "array", "orig", "recurse", "value", "index", "child", "i", "applyCallback", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "lastDimToZeroBase", "args", "isCollection", "dim", "isNumber", "isBigNumber", "name", "dependencies", "createMaxTransform", "factory", "_ref", "typed", "config", "numeric", "larger", "max", "createMax", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMeanTransform", "factory", "_ref", "typed", "add", "divide", "mean", "createMean", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMinTransform", "factory", "_ref", "typed", "config", "numeric", "smaller", "min", "createMin", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRangeTransform", "factory", "_ref", "typed", "config", "matrix", "bignumber", "smaller", "smallerEq", "larger", "largerEq", "add", "isPositive", "range", "createRange", "args", "lastIndex", "last", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRowTransform", "factory", "_ref", "typed", "Index", "matrix", "range", "row", "createRow", "args", "lastIndex", "last", "isNumber", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSubsetTransform", "factory", "_ref", "typed", "matrix", "zeros", "add", "subset", "createSubset", "args", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createConcatTransform", "factory", "_ref", "typed", "matrix", "isInteger", "concat", "createConcat", "args", "lastIndex", "last", "isNumber", "isBigNumber", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDiffTransform", "factory", "_ref", "typed", "matrix", "subtract", "number", "bignumber", "diff", "createDiff", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createStdTransform", "factory", "_ref", "typed", "map", "sqrt", "variance", "std", "createStd", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSumTransform", "factory", "_ref", "typed", "config", "add", "numeric", "sum", "createSum", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createQuantileSeqTransform", "factory", "_ref", "typed", "bignumber", "add", "subtract", "divide", "multiply", "partitionSelect", "compare", "isInteger", "smaller", "smallerEq", "larger", "quantileSeq", "createQuantileSeq", "arr", "prob", "dim", "dimToZeroBase", "sorted", "data", "lastDimToZeroBase", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCumSumTransform", "factory", "_ref", "typed", "add", "unaryPlus", "cumsum", "createCumSum", "args", "isCollection", "dim", "isNumber", "isBigNumber", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createVarianceTransform", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "apply", "isNaN", "variance", "createVariance", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPrintTransform", "factory", "_ref", "typed", "matrix", "zeros", "add", "print", "createPrint", "template", "values", "_convertTemplateToZeroBasedIndex", "options", "printTemplate", "x", "parts", "result", "part", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAndTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "and", "createAnd", "andTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createOrTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "or", "createOr", "orTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBitAndTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "bitAnd", "createBitAnd", "bitAndTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBitOrTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "bitOr", "createBitOr", "bitOrTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "all", "factoriesAny_exports", "init_dirname", "init_buffer", "init_process", "import_typed_function", "init_dirname", "init_buffer", "init_process", "import_tiny_emitter", "mixin", "obj", "emitter", "Emitter", "init_dirname", "init_buffer", "init_process", "importFactory", "typed", "load", "math", "importedFactories", "mathImport", "functions", "options", "num", "ArgumentsError", "flattenImports", "flatValues", "value", "name", "item", "_name", "hasOwnProperty", "isFactory", "flatName", "isTransformFunctionFactory", "_importFactory", "isSupportedType", "_import", "_wrap", "hasTypedFunctionSignature", "_importTransform", "allowedInExpressions", "_deleteTransform", "fn", "wrapper", "args", "i", "len", "arg", "factory", "namespace", "existingTransform", "existing", "resolver", "dependencies", "stripOptionalNotation", "dependency", "instance", "lazy", "factoryAllowedInExpressions", "object", "isUnit", "isComplex", "isBigNumber", "isFraction", "isMatrix", "unsafe", "create", "factories", "config", "configInternal", "_extends", "DEFAULT_CONFIG", "math", "mixin", "isNumber", "isComplex", "isBigNumber", "isBigInt", "isFraction", "isUnit", "isString", "isArray", "isMatrix", "isCollection", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isObject", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "isFunctionAssignmentNode", "isFunctionNode", "isIndexNode", "isNode", "isObjectNode", "isOperatorNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isChain", "configFactory", "legacyFactories", "legacyInstances", "load", "factory", "isFactory", "firstProperty", "isLegacyFactory", "index", "instance", "importedFactories", "lazyTyped", "_len", "args", "_key", "typedFunction", "internalImport", "importFactory", "deepFlatten", "ArgumentsError", "DimensionError", "IndexError", "esm_exports", "__export", "ABS", "ACCRINT", "ACCRINTM", "ACOS", "ACOSH", "ACOT", "ACOTH", "AGGREGATE", "AMORDEGRC", "AMORLINC", "AND", "ARABIC", "ASC", "ASIN", "ASINH", "ATAN", "ATAN2", "ATANH", "AVEDEV", "AVERAGE", "AVERAGEA", "AVERAGEIF", "AVERAGEIFS", "BAHTTEXT", "BASE", "BESSELI", "BESSELJ", "BESSELK", "BESSELY", "BETA", "BETADIST", "BETAINV", "BIN2DEC", "BIN2HEX", "BIN2OCT", "BINOM", "BINOMDIST", "BITAND", "BITLSHIFT", "BITOR", "BITRSHIFT", "BITXOR", "CEILING", "CEILINGMATH", "CEILINGPRECISE", "CELL", "CHAR", "CHIDIST", "CHIDISTRT", "CHIINV", "CHIINVRT", "CHISQ", "CHITEST", "CHOOSE", "CLEAN", "CODE", "COLUMN", "COLUMNS", "COMBIN", "COMBINA", "COMPLEX", "CONCAT", "CONCATENATE", "CONFIDENCE", "CONVERT", "CORREL", "COS", "COSH", "COT", "COTH", "COUNT", "COUNTA", "COUNTBLANK", "COUNTIF", "COUNTIFS", "COUPDAYBS", "COUPDAYS", "COUPDAYSNC", "COUPNCD", "COUPNUM", "COUPPCD", "COVAR", "COVARIANCE", "COVARIANCEP", "COVARIANCES", "CRITBINOM", "CSC", "CSCH", "CUMIPMT", "CUMPRINC", "DATE", "DATEDIF", "DATEVALUE", "DAVERAGE", "DAY", "DAYS", "DAYS360", "DB", "DBCS", "DCOUNT", "DCOUNTA", "DDB", "DEC2BIN", "DEC2HEX", "DEC2OCT", "DECIMAL", "DEGREES", "DELTA", "DEVSQ", "DGET", "DISC", "DMAX", "DMIN", "DOLLAR", "DOLLARDE", "DOLLARFR", "DPRODUCT", "DSTDEV", "DSTDEVP", "DSUM", "DURATION", "DVAR", "DVARP", "EDATE", "EFFECT", "EOMONTH", "ERF", "ERFC", "ERFCPRECISE", "ERFPRECISE", "ERROR", "EVEN", "EXACT", "EXP", "EXPON", "EXPONDIST", "F", "FACT", "FACTDOUBLE", "FALSE", "FDIST", "FDISTRT", "FIND", "FINV", "FINVRT", "FISHER", "FISHERINV", "FIXED", "FLOOR", "FLOORMATH", "FLOORPRECISE", "FORECAST", "FREQUENCY", "FTEST", "FV", "FVSCHEDULE", "GAMMA", "GAMMADIST", "GAMMAINV", "GAMMALN", "GAMMALNPRECISE", "GAUSS", "GCD", "GEOMEAN", "GESTEP", "GROWTH", "HARMEAN", "HEX2BIN", "HEX2DEC", "HEX2OCT", "HLOOKUP", "HOUR", "HYPGEOM", "HYPGEOMDIST", "IF", "IFERROR", "IFNA", "IFS", "IMABS", "IMAGINARY", "IMARGUMENT", "IMCONJUGATE", "IMCOS", "IMCOSH", "IMCOT", "IMCSC", "IMCSCH", "IMDIV", "IMEXP", "IMLN", "IMLOG10", "IMLOG2", "IMPOWER", "IMPRODUCT", "IMREAL", "IMSEC", "IMSECH", "IMSIN", "IMSINH", "IMSQRT", "IMSUB", "IMSUM", "IMTAN", "INDEX", "INFO", "INT", "INTERCEPT", "INTRATE", "IPMT", "IRR", "ISBLANK", "ISERR", "ISERROR", "ISEVEN", "ISFORMULA", "ISLOGICAL", "ISNA", "ISNONTEXT", "ISNUMBER", "ISO", "ISODD", "ISOWEEKNUM", "ISPMT", "ISREF", "ISTEXT", "KURT", "LARGE", "LCM", "LEFT", "LEN", "LINEST", "LN", "LOG", "LOG10", "LOGEST", "LOGINV", "LOGNORM", "LOGNORMDIST", "LOGNORMINV", "LOOKUP", "LOWER", "MATCH", "MAX", "MAXA", "MAXIFS", "MDURATION", "MEDIAN", "MID", "MIN", "MINA", "MINIFS", "MINUTE", "MIRR", "MMULT", "MOD", "MODE", "MODEMULT", "MODESNGL", "MONTH", "MROUND", "MULTINOMIAL", "MUNIT", "N", "NA", "NEGBINOM", "NEGBINOMDIST", "NETWORKDAYS", "NETWORKDAYSINTL", "NOMINAL", "NORM", "NORMDIST", "NORMINV", "NORMSDIST", "NORMSINV", "NOT", "NOW", "NPER", "NPV", "NUMBERVALUE", "OCT2BIN", "OCT2DEC", "OCT2HEX", "ODD", "ODDFPRICE", "ODDFYIELD", "ODDLPRICE", "ODDLYIELD", "OR", "PDURATION", "PEARSON", "PERCENTILE", "PERCENTILEEXC", "PERCENTILEINC", "PERCENTRANK", "PERCENTRANKEXC", "PERCENTRANKINC", "PERMUT", "PERMUTATIONA", "PHI", "PI", "PMT", "POISSON", "POISSONDIST", "POWER", "PPMT", "PRICE", "PRICEDISC", "PRICEMAT", "PROB", "PRODUCT", "PRONETIC", "PROPER", "PV", "QUARTILE", "QUARTILEEXC", "QUARTILEINC", "QUOTIENT", "RADIANS", "RAND", "RANDBETWEEN", "RANK", "RANKAVG", "RANKEQ", "RATE", "RECEIVED", "REPLACE", "REPT", "RIGHT", "ROMAN", "ROUND", "ROUNDDOWN", "ROUNDUP", "ROW", "ROWS", "RRI", "RSQ", "SEARCH", "SEC", "SECH", "SECOND", "SERIESSUM", "SHEET", "SHEETS", "SIGN", "SIN", "SINH", "SKEW", "SKEWP", "SLN", "SLOPE", "SMALL", "SORT", "SQRT", "SQRTPI", "STANDARDIZE", "STDEV", "STDEVA", "STDEVP", "STDEVPA", "STDEVS", "STEYX", "SUBSTITUTE", "SUBTOTAL", "SUM", "SUMIF", "SUMIFS", "SUMPRODUCT", "SUMSQ", "SUMX2MY2", "SUMX2PY2", "SUMXMY2", "SWITCH", "SYD", "T", "TAN", "TANH", "TBILLEQ", "TBILLPRICE", "TBILLYIELD", "TDIST", "TDISTRT", "TEXT", "TEXTJOIN", "TIME", "TIMEVALUE", "TINV", "TODAY", "TRANSPOSE", "TREND", "TRIM", "TRIMMEAN", "TRUE", "TRUNC", "TTEST", "TYPE", "UNICHAR", "UNICODE", "UNIQUE", "UPPER", "VALUE", "VAR", "VARA", "VARP", "VARPA", "VARS", "VDB", "VLOOKUP", "WEEKDAY", "WEEKNUM", "WEIBULL", "WEIBULLDIST", "WORKDAY", "WORKDAYINTL", "XIRR", "XNPV", "XOR", "YEAR", "YEARFRAC", "YIELD", "YIELDDISC", "YIELDMAT", "Z", "ZTEST", "utils", "init_dirname", "init_buffer", "init_process", "import_jstat", "import_bessel", "nil", "div0", "value", "ref", "name", "num", "na", "error", "data", "errors", "defaultOperator", "validSymbols", "_TOKEN_TYPE_OPERATOR", "_TOKEN_TYPE_LITERAL", "SUPPORTED_TOKENS", "TOKEN_TYPE_OPERATOR", "TOKEN_TYPE_LITERAL", "createToken", "type", "castValueToCorrectType", "tokenizeExpression", "expression", "expressionLength", "tokens", "cursorIndex", "processedValue", "processedSymbol", "char", "analyzeTokens", "literalValue", "analyzedTokens", "i", "token", "computeExpression", "values", "operator", "evaluate", "result", "parse", "compute", "argsToArray", "args", "arrayEach", "array", "iteratee", "index", "length", "arrayValuesToNumbers", "arr", "n", "el", "number", "parseNumber", "fillMatrix", "matrix", "fill_value", "a", "j", "longestArrayIndex", "acc", "longestArrayLength", "flatten", "argument", "isArrayLike", "isFlat", "flattenShallow", "b", "aIsArray", "bIsArray", "initial", "idx", "rest", "transpose", "col", "row", "findField", "database", "title", "anyError", "anyIsError", "cleanFloat", "numbers", "serialNumberToDate", "serial", "utc_value", "date_info", "fractional_day", "total_seconds", "seconds", "hours", "minutes", "days", "month", "parseBool", "bool", "up", "parseDate", "date", "d", "parseDateArray", "len", "parsed", "string", "parseNumberArray", "parseString", "anyIsString", "applyCriteria", "range", "criterias", "criteriaLength", "isMetCondition", "valueToTest", "criteria", "isWildcard", "computedResult", "tokenizedCriteria", "isDefined", "arg", "error_val", "value$1", "reference", "jStat", "lookup_value", "table_array", "row_index_num", "range_lookup", "row_num", "column_num", "someError", "isOneDimensionRange", "result_array", "isNumberLookup", "lookup_array", "match_type", "indexValue", "lookupValueStr", "sort_index", "sort_order", "by_col", "sortArray", "hasElement", "element", "col_index_num", "exactMatchOnly", "lookupValue", "rowValue", "SQRT2PI", "flatArgumentsDefined", "sum", "count", "average_range", "flatAverageRangeDefined", "average_count", "average", "x", "alpha", "beta", "cumulative", "probability", "number_s", "trials", "probability_s", "number_s2", "deg_freedom", "actual_range", "expected_range", "tmp", "dof", "xsqr", "Pi", "ChiSq", "p", "k", "t", "standard_dev", "size", "array1", "array2", "flatArguments", "blanks", "matches", "results", "mean1", "mean2", "mean", "lambda", "deg_freedom1", "deg_freedom2", "sumOfSquares", "x1", "x2", "sum1", "sum2", "y", "e2y", "known_ys", "known_xs", "xmean", "ymean", "den", "data_array", "bins_array", "r", "z", "known_y", "known_x", "new_x", "use_const", "avg_x", "avg_y", "avg_xy", "avg_xx", "new_y", "sample_s", "number_sample", "population_s", "number_pop", "pdf", "M", "cdf", "sigma", "m", "maxItems", "max", "currentItem", "number_f", "den1", "den2", "l", "fl", "significance", "uniques", "power", "match", "number_chosen", "x_range", "prob_range", "lower_limit", "upper_limit", "sorted", "quart", "order", "sort", "m2", "m3", "v", "lft", "T$1", "mean_x", "mean_y", "s_x", "s_y", "new_xs", "linest", "percent", "trim", "function_num", "options", "ref1", "ref2", "text", "x_num", "y_num", "anyError$1", "radix", "min_length", "mode", "precision", "e2", "angle", "MEMOIZED_FACT", "r0", "ri", "o", "base", "_", "divisor", "modulus", "multiple", "dimension", "temp", "numerator", "denominator", "bottom", "top", "digits", "key", "roman", "num_digits", "coefficients", "inner_result", "sum_range", "sumValue", "arrays", "product", "_i", "_ij", "_ij_arg", "_i_arg", "array_x", "array_y", "ADD", "num1", "num2", "DIVIDE", "dividend", "EQ", "value1", "value2", "GT", "GTE", "LT", "LTE", "MINUS", "MULTIPLY", "factor1", "factor2", "NE", "POW", "exponent", "symbols", "d1900", "WEEK_STARTS", "WEEK_TYPES", "WEEKEND_TYPES", "year", "day", "start_date", "end_date", "unit", "start_date_year", "start_date_month", "start_date_day", "end_date_year", "end_date_month", "end_date_day", "date_text", "serial_number", "startOfDay", "newDate", "method", "sm", "em", "sd", "ed", "smd", "emd", "months", "storedDay", "targetMonth", "daysInTargetMonth", "targetYear", "yearStart", "holidays", "weekend", "isMask", "maskDays", "maskIndex", "maskRegex", "total", "dec", "holiday", "hour", "minute", "second", "time_text", "return_type", "week_start", "jan", "inc", "h", "sign", "isLeapYear", "daysBetween", "basis", "sy", "ey", "feb29Between", "date1", "date2", "year1", "mar1year1", "year2", "mar1year2", "ylength", "years", "addOn", "re", "trueFound", "falseFound", "decimals", "formattedNumber", "text1", "text2", "find_text", "within_text", "start_num", "found_index", "no_commas", "factor", "parts", "num_chars", "begin", "end", "decimal_separator", "group_separator", "txt", "old_text", "new_text", "number_times", "foundAt", "instance_num", "format_text", "currencySymbol", "isPercent", "decimalPlaces", "noCommas", "delimiter", "ignore_empty", "flatArgs", "textToJoin", "chunks", "item", "output", "isValidBinaryNumber", "bessel", "stringified", "places", "number1", "number2", "shift_amount", "real_num", "i_num", "suffix", "from_unit", "to_unit", "units", "binary_prefixes", "unit_prefixes", "from", "to", "base_from_unit", "base_to_unit", "from_multiplier", "to_multiplier", "alt", "from_binary_prefix", "from_unit_prefix", "to_binary_prefix", "to_unit_prefix", "step", "negative", "decimal", "inumber", "plus", "minus", "last", "inumber1", "inumber2", "c", "unit1", "unit2", "e", "s", "compact", "findResultIndex", "maxCriteriaLength", "currentCriteriaResult", "hasMatchingCriteria", "criteriaField", "field", "resultIndexes", "targetFields", "targetValues", "maxValue", "minValue", "validDate", "ensureDate", "lastCoupDateBeforeSettlement", "settlement", "maturity", "frequency", "validateFrequency", "validateBasis", "issue", "first_interest", "rate", "par", "nextDate", "numOfDays", "nper", "pv", "start_period", "end_period", "payment", "interest", "principal", "cost", "salvage", "life", "period", "current", "ceiling", "pr", "redemption", "basisVal", "diff", "fractional_dollar", "fraction", "decimal_dollar", "nominal_rate", "npery", "term", "schedule", "future", "per", "fv", "guess", "irrResult", "dates", "irrResultDeriv", "frac", "positive", "resultRate", "epsMax", "newRate", "epsRate", "resultValue", "contLoop", "finance_rate", "reinvest_rate", "payments", "incomes", "effect_rate", "pmt", "discount", "iterMax", "f", "dy", "df", "logical_test", "value_if_true", "value_if_false", "value_if_error", "value_if_na", "logical", "targetValue", "argc", "switchCount", "switchSatisfied", "hasDefaultClause", "defaultClause", "math", "create", "all", "esm_exports", "nowFormat", "nowDayFormat", "todayFormat", "todayDayFormat", "calculate", "app", "cm", "answers", "answerCopy", "avgs", "totals", "subtotals", "dateTime", "DateTime", "$", "cmLine", "cmLineNo", "lineNo", "answer", "line", "checkLocale", "match", "evaluate", "answerCopyInit", "formatAnswer", "plotAns", "error", "pages", "store", "page", "dateTimeReg", "lineDate", "lineDateRight", "locale", "lineDateNow", "lineDateToday", "lineDateTime", "rightOfDate", "durHrs", "pcntOfReg", "pcntOfValReg", "stripAnswer", "separator", "a", "b", "digits", "import_uikit", "import_codemirror", "import_javascript", "import_dialog", "import_placeholder", "import_closebrackets", "import_matchbrackets", "import_show_hint", "import_jump_to_line", "import_search", "import_searchcursor", "cm", "CodeMirror", "$", "udOptions", "udfInput", "uduInput", "stream", "cmStream", "app", "math", "esm_exports", "val", "par", "numaraHints", "scopeList", "scope", "f", "editor", "cmCursor", "cmCursorLine", "start", "end", "curWord", "curWordRegex", "text", "a", "b", "calculate", "line", "cmLineNo", "activeLine", "ttPos", "el", "funcs", "$all", "obj", "UIkit", "udfs", "udus", "u", "currencies", "c", "currency", "currencyName", "units", "constants", "vars", "v", "varTooltip", "formatAnswer", "lineNos", "ln", "scopeTooltip", "s", "excel", "x", "pages", "store", "page", "inputContext", "index", "cm", "line", "answer", "$", "isEmpty", "isLine", "isSelection", "isMultiLine", "hasAnswer", "outputContext", "event", "textboxContext", "copyLine", "notify", "copyAnswer", "withLines", "copiedText", "copyAllLines", "copyAllAnswers", "copiedOutputs", "copyAll", "copiedCalc", "isElectron", "udfInput", "uduInput", "$all", "el", "init_dirname", "init_buffer", "init_process", "math", "getRates", "url", "$", "response", "rates", "dups", "app", "currency", "store", "cm", "calculate", "error", "notify", "init_dirname", "init_buffer", "init_process", "createElement", "tag", "attrs", "children", "element", "name", "child", "childElement", "createElement$1", "getAttrs", "element", "attrs", "attr", "getClassNames", "combineClassNames", "arrayOfClassnames", "classItem", "value", "index", "self", "toPascalCase", "string", "g0", "g1", "g2", "replaceElement", "nameAttr", "icons", "iconName", "ComponentName", "iconNode", "elementAttrs", "tag", "iconAttributes", "children", "iconAttrs", "classNames", "svgElement", "createElement$1", "defaultAttributes", "ArrowUpDown", "defaultAttributes", "Braces", "defaultAttributes", "CircleAlert", "defaultAttributes", "Circle", "defaultAttributes", "Copy", "defaultAttributes", "CornerDownRight", "defaultAttributes", "Dot", "defaultAttributes", "Download", "defaultAttributes", "EllipsisVertical", "defaultAttributes", "Eraser", "defaultAttributes", "Info", "defaultAttributes", "ListRestart", "defaultAttributes", "PanelLeftClose", "defaultAttributes", "PanelLeft", "defaultAttributes", "Plus", "defaultAttributes", "Printer", "defaultAttributes", "Scaling", "defaultAttributes", "Settings", "defaultAttributes", "Trash", "defaultAttributes", "UndoDot", "defaultAttributes", "Upload", "defaultAttributes", "createIcons", "icons", "nameAttr", "attrs", "elementsToReplace", "element", "replaceElement", "deprecatedElements", "iconList", "CircleAlert", "ArrowUpDown", "Braces", "Circle", "Copy", "CornerDownRight", "Dot", "Download", "EllipsisVertical", "Eraser", "Info", "ListRestart", "PanelLeft", "PanelLeftClose", "Plus", "Printer", "Scaling", "Settings", "Trash", "UndoDot", "Upload", "generateIcons", "createIcons", "init_dirname", "init_buffer", "init_process", "name", "productName", "description", "version", "author", "homepage", "import_function_plot", "plot", "$", "app", "f", "math", "domain", "xDomain", "yDomain", "functionPlot", "store", "fileName", "productName", "preface", "svgData", "svgBlob", "downloadLink", "init_dirname", "init_buffer", "init_process", "import_deep_diff", "checkDefaults", "$", "DeepDiff", "app", "settings", "bigNumberWarning", "localeWarning", "checkLocale", "checkMods", "key", "checkSchema", "d", "store", "$all", "item", "span", "icon", "generateIcons", "locales", "matrixTypes", "numericOutputs", "notations", "l", "n", "m", "el", "checkSize", "appTheme", "isElectron", "udfuTheme", "udfInput", "uduInput", "elements", "cm", "math", "calculate", "getRates", "confirm", "showError", "init_dirname", "init_buffer", "init_process", "import_uikit", "migrateSaved", "saved", "store", "pages", "id", "val", "getPageName", "pageNo", "regex", "pageNos", "page", "a", "b", "max", "i", "lastPage", "populatePages", "defaultPage", "$", "pageListItem", "app", "DateTime", "event", "loadPage", "UIkit", "renamePage", "deletePage", "duplicatePage", "generateIcons", "pageId", "cursor", "cm", "pageName", "newPage", "isImport", "p", "notify", "confirm", "showModal", "rename", "dupPageId", "dupPage", "dupPageData", "dupPageName", "sortPages", "by", "sortedPages", "pageOrder", "orderedPages", "$all", "el", "deleteAllPages", "newPageDialog", "isElectron", "data", "msg", "error", "init_dirname", "init_buffer", "init_process", "import_uikit", "applyUdfu", "input", "type", "UDFunc", "f", "app", "store", "calculate", "UIkit", "error", "showError", "$", "udfInput", "uduInput", "import_uikit", "import_mousetrap", "init_dirname", "init_buffer", "init_process", "Mousetrap", "_globalCallbacks", "_originalStopCallback", "e", "element", "combo", "sequence", "self", "keys", "callback", "action", "i", "description", "$", "DateTime", "author", "isElectron", "version", "homepage", "settings", "isMac", "name", "event", "isMax", "toggleMinMax", "generateIcons", "app", "getRates", "store", "lastPage", "loadPage", "defaultPage", "migrateSaved", "applyUdfu", "populatePages", "cm", "calculate", "copyAll", "showModal", "notify", "func", "plot", "error", "showError", "sels", "resizeDelay", "isResizing", "panel", "divider", "dividerTooltip", "offset", "iWidth", "inputWidth", "UIkit", "udf", "udu", "udfInput", "uduInput", "pageOrder", "getPageName", "windowResizeDelay", "checkSize", "inputScroll", "outputScroll", "inputPanel", "outputPanel", "traps", "button", "command", "Mousetrap", "$all", "checkUpdates", "printArea", "line", "lineNo", "input", "answer", "row"] + "sourcesContent": ["export const __dirname = \"/\";\n", "function unimplemented(name) {\r\n throw new Error('Node.js process ' + name + ' is not supported by JSPM core outside of Node.js');\r\n}\r\n\r\nvar queue = [];\r\nvar draining = false;\r\nvar currentQueue;\r\nvar queueIndex = -1;\r\n\r\nfunction cleanUpNextTick() {\r\n if (!draining || !currentQueue)\r\n return;\r\n draining = false;\r\n if (currentQueue.length) {\r\n queue = currentQueue.concat(queue);\r\n }\r\n else {\r\n queueIndex = -1;\r\n }\r\n if (queue.length)\r\n drainQueue();\r\n}\r\n\r\nfunction drainQueue() {\r\n if (draining)\r\n return;\r\n var timeout = setTimeout(cleanUpNextTick, 0);\r\n draining = true;\r\n\r\n var len = queue.length;\r\n while(len) {\r\n currentQueue = queue;\r\n queue = [];\r\n while (++queueIndex < len) {\r\n if (currentQueue)\r\n currentQueue[queueIndex].run();\r\n }\r\n queueIndex = -1;\r\n len = queue.length;\r\n }\r\n currentQueue = null;\r\n draining = false;\r\n clearTimeout(timeout);\r\n}\r\n\r\nfunction nextTick (fun) {\r\n var args = new Array(arguments.length - 1);\r\n if (arguments.length > 1) {\r\n for (var i = 1; i < arguments.length; i++)\r\n args[i - 1] = arguments[i];\r\n }\r\n queue.push(new Item(fun, args));\r\n if (queue.length === 1 && !draining)\r\n setTimeout(drainQueue, 0);\r\n}\r\n// v8 likes predictible objects\r\nfunction Item(fun, array) {\r\n this.fun = fun;\r\n this.array = array;\r\n}\r\nItem.prototype.run = function () {\r\n this.fun.apply(null, this.array);\r\n};\r\n\r\nvar title = 'browser';\r\nvar arch = 'x64';\r\nvar platform = 'browser';\r\nvar env = {\r\n PATH: '/usr/bin',\r\n LANG: navigator.language + '.UTF-8',\r\n PWD: '/',\r\n HOME: '/home',\r\n TMP: '/tmp',\r\n};\r\nvar argv = ['/usr/bin/node'];\r\nvar execArgv = [];\r\nvar version = 'v16.8.0';\r\nvar versions = {};\r\n\r\nvar emitWarning = function(message, type) {\r\n console.warn((type ? (type + ': ') : '') + message);\r\n};\r\n\r\nvar binding = function(name) { unimplemented('binding'); };\r\n\r\nvar umask = function(mask) { return 0; };\r\n\r\nvar cwd = function() { return '/'; };\r\nvar chdir = function(dir) {};\r\n\r\nvar release = {\r\n name: 'node',\r\n sourceUrl: '',\r\n headersUrl: '',\r\n libUrl: '',\r\n};\r\n\r\nfunction noop() {}\r\n\r\nvar _rawDebug = noop;\r\nvar moduleLoadList = [];\r\nfunction _linkedBinding(name) { unimplemented('_linkedBinding'); }\r\nvar domain = {};\r\nvar _exiting = false;\r\nvar config = {};\r\nfunction dlopen(name) { unimplemented('dlopen'); }\r\nfunction _getActiveRequests() { return []; }\r\nfunction _getActiveHandles() { return []; }\r\nvar reallyExit = noop;\r\nvar _kill = noop;\r\nvar cpuUsage = function() { return {}; };\r\nvar resourceUsage = cpuUsage;\r\nvar memoryUsage = cpuUsage;\r\nvar kill = noop;\r\nvar exit = noop;\r\nvar openStdin = noop;\r\nvar allowedNodeEnvironmentFlags = {};\r\nfunction assert(condition, message) {\r\n if (!condition) throw new Error(message || 'assertion error');\r\n}\r\nvar features = {\r\n inspector: false,\r\n debug: false,\r\n uv: false,\r\n ipv6: false,\r\n tls_alpn: false,\r\n tls_sni: false,\r\n tls_ocsp: false,\r\n tls: false,\r\n cached_builtins: true,\r\n};\r\nvar _fatalExceptions = noop;\r\nvar setUncaughtExceptionCaptureCallback = noop;\r\nfunction hasUncaughtExceptionCaptureCallback() { return false; }var _tickCallback = noop;\r\nvar _debugProcess = noop;\r\nvar _debugEnd = noop;\r\nvar _startProfilerIdleNotifier = noop;\r\nvar _stopProfilerIdleNotifier = noop;\r\nvar stdout = undefined;\r\nvar stderr = undefined;\r\nvar stdin = undefined;\r\nvar abort = noop;\r\nvar pid = 2;\r\nvar ppid = 1;\r\nvar execPath = '/bin/usr/node';\r\nvar debugPort = 9229;\r\nvar argv0 = 'node';\r\nvar _preload_modules = [];\r\nvar setSourceMapsEnabled = noop;\r\n\r\nvar _performance = {\r\n now: typeof performance !== 'undefined' ? performance.now.bind(performance) : undefined,\r\n timing: typeof performance !== 'undefined' ? performance.timing : undefined,\r\n};\r\nif (_performance.now === undefined) {\r\n var nowOffset = Date.now();\r\n\r\n if (_performance.timing && _performance.timing.navigationStart) {\r\n nowOffset = _performance.timing.navigationStart;\r\n }\r\n _performance.now = () => Date.now() - nowOffset;\r\n}\r\n\r\nfunction uptime() {\r\n return _performance.now() / 1000;\r\n}\r\n\r\nvar nanoPerSec = 1000000000;\r\nfunction hrtime(previousTimestamp) {\r\n var baseNow = Math.floor((Date.now() - _performance.now()) * 1e-3);\r\n var clocktime = _performance.now() * 1e-3;\r\n var seconds = Math.floor(clocktime) + baseNow;\r\n var nanoseconds = Math.floor((clocktime % 1) * 1e9);\r\n if (previousTimestamp) {\r\n seconds = seconds - previousTimestamp[0];\r\n nanoseconds = nanoseconds - previousTimestamp[1];\r\n if (nanoseconds < 0) {\r\n seconds--;\r\n nanoseconds += nanoPerSec;\r\n }\r\n }\r\n return [seconds, nanoseconds];\r\n}hrtime.bigint = function(time) {\r\n var diff = hrtime(time);\r\n if (typeof BigInt === 'undefined') {\r\n return diff[0] * nanoPerSec + diff[1];\r\n }\r\n return BigInt(diff[0] * nanoPerSec) + BigInt(diff[1]);\r\n};\r\n\r\nvar _maxListeners = 10;\r\nvar _events = {};\r\nvar _eventsCount = 0;\r\nfunction on () { return process }var addListener = on;\r\nvar once = on;\r\nvar off = on;\r\nvar removeListener = on;\r\nvar removeAllListeners = on;\r\nvar emit = noop;\r\nvar prependListener = on;\r\nvar prependOnceListener = on;\r\nfunction listeners (name) { return []; }\r\nvar process = {\r\n version,\r\n versions,\r\n arch,\r\n platform,\r\n release,\r\n _rawDebug,\r\n moduleLoadList,\r\n binding,\r\n _linkedBinding,\r\n _events,\r\n _eventsCount,\r\n _maxListeners,\r\n on,\r\n addListener,\r\n once,\r\n off,\r\n removeListener,\r\n removeAllListeners,\r\n emit,\r\n prependListener,\r\n prependOnceListener,\r\n listeners,\r\n domain,\r\n _exiting,\r\n config,\r\n dlopen,\r\n uptime,\r\n _getActiveRequests,\r\n _getActiveHandles,\r\n reallyExit,\r\n _kill,\r\n cpuUsage,\r\n resourceUsage,\r\n memoryUsage,\r\n kill,\r\n exit,\r\n openStdin,\r\n allowedNodeEnvironmentFlags,\r\n assert,\r\n features,\r\n _fatalExceptions,\r\n setUncaughtExceptionCaptureCallback,\r\n hasUncaughtExceptionCaptureCallback,\r\n emitWarning,\r\n nextTick,\r\n _tickCallback,\r\n _debugProcess,\r\n _debugEnd,\r\n _startProfilerIdleNotifier,\r\n _stopProfilerIdleNotifier,\r\n stdout,\r\n stdin,\r\n stderr,\r\n abort,\r\n umask,\r\n chdir,\r\n cwd,\r\n env,\r\n title,\r\n argv,\r\n execArgv,\r\n pid,\r\n ppid,\r\n execPath,\r\n debugPort,\r\n hrtime,\r\n argv0,\r\n _preload_modules,\r\n setSourceMapsEnabled,\r\n};\n\nexport { _debugEnd, _debugProcess, _events, _eventsCount, _exiting, _fatalExceptions, _getActiveHandles, _getActiveRequests, _kill, _linkedBinding, _maxListeners, _preload_modules, _rawDebug, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, _tickCallback, abort, addListener, allowedNodeEnvironmentFlags, arch, argv, argv0, assert, binding, chdir, config, cpuUsage, cwd, debugPort, process as default, dlopen, domain, emit, emitWarning, env, execArgv, execPath, exit, features, hasUncaughtExceptionCaptureCallback, hrtime, kill, listeners, memoryUsage, moduleLoadList, nextTick, off, on, once, openStdin, pid, platform, ppid, prependListener, prependOnceListener, reallyExit, release, removeAllListeners, removeListener, resourceUsage, setSourceMapsEnabled, setUncaughtExceptionCaptureCallback, stderr, stdin, stdout, title, umask, uptime, version, versions };\n", "export * as process from \"process\";\n", "var exports$3 = {},\n _dewExec$2 = false;\nfunction dew$2() {\n if (_dewExec$2) return exports$3;\n _dewExec$2 = true;\n exports$3.byteLength = byteLength;\n exports$3.toByteArray = toByteArray;\n exports$3.fromByteArray = fromByteArray;\n var lookup = [];\n var revLookup = [];\n var Arr = typeof Uint8Array !== \"undefined\" ? Uint8Array : Array;\n var code = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n for (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i];\n revLookup[code.charCodeAt(i)] = i;\n } // Support decoding URL-safe base64 strings, as Node.js does.\n // See: https://en.wikipedia.org/wiki/Base64#URL_applications\n\n\n revLookup[\"-\".charCodeAt(0)] = 62;\n revLookup[\"_\".charCodeAt(0)] = 63;\n\n function getLens(b64) {\n var len = b64.length;\n\n if (len % 4 > 0) {\n throw new Error(\"Invalid string. Length must be a multiple of 4\");\n } // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n\n\n var validLen = b64.indexOf(\"=\");\n if (validLen === -1) validLen = len;\n var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;\n return [validLen, placeHoldersLen];\n } // base64 is 4/3 + up to two characters of the original data\n\n\n function byteLength(b64) {\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n\n function _byteLength(b64, validLen, placeHoldersLen) {\n return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;\n }\n\n function toByteArray(b64) {\n var tmp;\n var lens = getLens(b64);\n var validLen = lens[0];\n var placeHoldersLen = lens[1];\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));\n var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars\n\n var len = placeHoldersLen > 0 ? validLen - 4 : validLen;\n var i;\n\n for (i = 0; i < len; i += 4) {\n tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];\n arr[curByte++] = tmp >> 16 & 255;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n\n if (placeHoldersLen === 2) {\n tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;\n arr[curByte++] = tmp & 255;\n }\n\n if (placeHoldersLen === 1) {\n tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;\n arr[curByte++] = tmp >> 8 & 255;\n arr[curByte++] = tmp & 255;\n }\n\n return arr;\n }\n\n function tripletToBase64(num) {\n return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];\n }\n\n function encodeChunk(uint8, start, end) {\n var tmp;\n var output = [];\n\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);\n output.push(tripletToBase64(tmp));\n }\n\n return output.join(\"\");\n }\n\n function fromByteArray(uint8) {\n var tmp;\n var len = uint8.length;\n var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n\n var parts = [];\n var maxChunkLength = 16383; // must be multiple of 3\n // go through the array every three bytes, we'll deal with trailing stuff later\n\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n } // pad the end with zeros, but make sure to not forget the extra bytes\n\n\n if (extraBytes === 1) {\n tmp = uint8[len - 1];\n parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + \"==\");\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1];\n parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + \"=\");\n }\n\n return parts.join(\"\");\n }\n\n return exports$3;\n}\n\nvar exports$2 = {},\n _dewExec$1 = false;\nfunction dew$1() {\n if (_dewExec$1) return exports$2;\n _dewExec$1 = true;\n\n /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\n exports$2.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = -7;\n var i = isLE ? nBytes - 1 : 0;\n var d = isLE ? -1 : 1;\n var s = buffer[offset + i];\n i += d;\n e = s & (1 << -nBits) - 1;\n s >>= -nBits;\n nBits += eLen;\n\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : (s ? -1 : 1) * Infinity;\n } else {\n m = m + Math.pow(2, mLen);\n e = e - eBias;\n }\n\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\n };\n\n exports$2.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;\n var i = isLE ? 0 : nBytes - 1;\n var d = isLE ? 1 : -1;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n value = Math.abs(value);\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0;\n e = eMax;\n } else {\n e = Math.floor(Math.log(value) / Math.LN2);\n\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * Math.pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {}\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128;\n };\n\n return exports$2;\n}\n\nvar exports$1 = {},\n _dewExec = false;\nfunction dew() {\n if (_dewExec) return exports$1;\n _dewExec = true;\n\n const base64 = dew$2();\n\n const ieee754 = dew$1();\n\n const customInspectSymbol = typeof Symbol === \"function\" && typeof Symbol[\"for\"] === \"function\" ? Symbol[\"for\"](\"nodejs.util.inspect.custom\") // eslint-disable-line dot-notation\n : null;\n exports$1.Buffer = Buffer;\n exports$1.SlowBuffer = SlowBuffer;\n exports$1.INSPECT_MAX_BYTES = 50;\n const K_MAX_LENGTH = 2147483647;\n exports$1.kMaxLength = K_MAX_LENGTH;\n /**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\n\n Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport();\n\n if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(\"This browser lacks typed array (Uint8Array) support which is required by \" + \"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.\");\n }\n\n function typedArraySupport() {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1);\n const proto = {\n foo: function () {\n return 42;\n }\n };\n Object.setPrototypeOf(proto, Uint8Array.prototype);\n Object.setPrototypeOf(arr, proto);\n return arr.foo() === 42;\n } catch (e) {\n return false;\n }\n }\n\n Object.defineProperty(Buffer.prototype, \"parent\", {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined;\n return this.buffer;\n }\n });\n Object.defineProperty(Buffer.prototype, \"offset\", {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined;\n return this.byteOffset;\n }\n });\n\n function createBuffer(length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError(\"The value \\\"\" + length + \"\\\" is invalid for option \\\"size\\\"\");\n } // Return an augmented `Uint8Array` instance\n\n\n const buf = new Uint8Array(length);\n Object.setPrototypeOf(buf, Buffer.prototype);\n return buf;\n }\n /**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\n\n function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === \"number\") {\n if (typeof encodingOrOffset === \"string\") {\n throw new TypeError(\"The \\\"string\\\" argument must be of type string. Received type number\");\n }\n\n return allocUnsafe(arg);\n }\n\n return from(arg, encodingOrOffset, length);\n }\n\n Buffer.poolSize = 8192; // not used by this implementation\n\n function from(value, encodingOrOffset, length) {\n if (typeof value === \"string\") {\n return fromString(value, encodingOrOffset);\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value);\n }\n\n if (value == null) {\n throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, \" + \"or Array-like Object. Received type \" + typeof value);\n }\n\n if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n\n if (typeof SharedArrayBuffer !== \"undefined\" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length);\n }\n\n if (typeof value === \"number\") {\n throw new TypeError(\"The \\\"value\\\" argument must not be of type number. Received type number\");\n }\n\n const valueOf = value.valueOf && value.valueOf();\n\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length);\n }\n\n const b = fromObject(value);\n if (b) return b;\n\n if (typeof Symbol !== \"undefined\" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === \"function\") {\n return Buffer.from(value[Symbol.toPrimitive](\"string\"), encodingOrOffset, length);\n }\n\n throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, \" + \"or Array-like Object. Received type \" + typeof value);\n }\n /**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\n\n\n Buffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length);\n }; // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n // https://github.com/feross/buffer/pull/148\n\n\n Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype);\n Object.setPrototypeOf(Buffer, Uint8Array);\n\n function assertSize(size) {\n if (typeof size !== \"number\") {\n throw new TypeError(\"\\\"size\\\" argument must be of type number\");\n } else if (size < 0) {\n throw new RangeError(\"The value \\\"\" + size + \"\\\" is invalid for option \\\"size\\\"\");\n }\n }\n\n function alloc(size, fill, encoding) {\n assertSize(size);\n\n if (size <= 0) {\n return createBuffer(size);\n }\n\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === \"string\" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);\n }\n\n return createBuffer(size);\n }\n /**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\n\n\n Buffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding);\n };\n\n function allocUnsafe(size) {\n assertSize(size);\n return createBuffer(size < 0 ? 0 : checked(size) | 0);\n }\n /**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\n\n\n Buffer.allocUnsafe = function (size) {\n return allocUnsafe(size);\n };\n /**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\n\n\n Buffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size);\n };\n\n function fromString(string, encoding) {\n if (typeof encoding !== \"string\" || encoding === \"\") {\n encoding = \"utf8\";\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError(\"Unknown encoding: \" + encoding);\n }\n\n const length = byteLength(string, encoding) | 0;\n let buf = createBuffer(length);\n const actual = buf.write(string, encoding);\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual);\n }\n\n return buf;\n }\n\n function fromArrayLike(array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0;\n const buf = createBuffer(length);\n\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255;\n }\n\n return buf;\n }\n\n function fromArrayView(arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView);\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);\n }\n\n return fromArrayLike(arrayView);\n }\n\n function fromArrayBuffer(array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError(\"\\\"offset\\\" is outside of buffer bounds\");\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError(\"\\\"length\\\" is outside of buffer bounds\");\n }\n\n let buf;\n\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array);\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset);\n } else {\n buf = new Uint8Array(array, byteOffset, length);\n } // Return an augmented `Uint8Array` instance\n\n\n Object.setPrototypeOf(buf, Buffer.prototype);\n return buf;\n }\n\n function fromObject(obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0;\n const buf = createBuffer(len);\n\n if (buf.length === 0) {\n return buf;\n }\n\n obj.copy(buf, 0, 0, len);\n return buf;\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== \"number\" || numberIsNaN(obj.length)) {\n return createBuffer(0);\n }\n\n return fromArrayLike(obj);\n }\n\n if (obj.type === \"Buffer\" && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data);\n }\n }\n\n function checked(length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError(\"Attempt to allocate Buffer larger than maximum \" + \"size: 0x\" + K_MAX_LENGTH.toString(16) + \" bytes\");\n }\n\n return length | 0;\n }\n\n function SlowBuffer(length) {\n if (+length != length) {\n // eslint-disable-line eqeqeq\n length = 0;\n }\n\n return Buffer.alloc(+length);\n }\n\n Buffer.isBuffer = function isBuffer(b) {\n return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false\n };\n\n Buffer.compare = function compare(a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength);\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength);\n\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\"The \\\"buf1\\\", \\\"buf2\\\" arguments must be one of type Buffer or Uint8Array\");\n }\n\n if (a === b) return 0;\n let x = a.length;\n let y = b.length;\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n };\n\n Buffer.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case \"hex\":\n case \"utf8\":\n case \"utf-8\":\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n case \"base64\":\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return true;\n\n default:\n return false;\n }\n };\n\n Buffer.concat = function concat(list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError(\"\\\"list\\\" argument must be an Array of Buffers\");\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0);\n }\n\n let i;\n\n if (length === undefined) {\n length = 0;\n\n for (i = 0; i < list.length; ++i) {\n length += list[i].length;\n }\n }\n\n const buffer = Buffer.allocUnsafe(length);\n let pos = 0;\n\n for (i = 0; i < list.length; ++i) {\n let buf = list[i];\n\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf);\n buf.copy(buffer, pos);\n } else {\n Uint8Array.prototype.set.call(buffer, buf, pos);\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError(\"\\\"list\\\" argument must be an Array of Buffers\");\n } else {\n buf.copy(buffer, pos);\n }\n\n pos += buf.length;\n }\n\n return buffer;\n };\n\n function byteLength(string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length;\n }\n\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength;\n }\n\n if (typeof string !== \"string\") {\n throw new TypeError(\"The \\\"string\\\" argument must be one of type string, Buffer, or ArrayBuffer. \" + \"Received type \" + typeof string);\n }\n\n const len = string.length;\n const mustMatch = arguments.length > 2 && arguments[2] === true;\n if (!mustMatch && len === 0) return 0; // Use a for loop to avoid recursion\n\n let loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n return len;\n\n case \"utf8\":\n case \"utf-8\":\n return utf8ToBytes(string).length;\n\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return len * 2;\n\n case \"hex\":\n return len >>> 1;\n\n case \"base64\":\n return base64ToBytes(string).length;\n\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8\n }\n\n encoding = (\"\" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n }\n\n Buffer.byteLength = byteLength;\n\n function slowToString(encoding, start, end) {\n let loweredCase = false; // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n\n if (start === undefined || start < 0) {\n start = 0;\n } // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n\n\n if (start > this.length) {\n return \"\";\n }\n\n if (end === undefined || end > this.length) {\n end = this.length;\n }\n\n if (end <= 0) {\n return \"\";\n } // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n\n\n end >>>= 0;\n start >>>= 0;\n\n if (end <= start) {\n return \"\";\n }\n\n if (!encoding) encoding = \"utf8\";\n\n while (true) {\n switch (encoding) {\n case \"hex\":\n return hexSlice(this, start, end);\n\n case \"utf8\":\n case \"utf-8\":\n return utf8Slice(this, start, end);\n\n case \"ascii\":\n return asciiSlice(this, start, end);\n\n case \"latin1\":\n case \"binary\":\n return latin1Slice(this, start, end);\n\n case \"base64\":\n return base64Slice(this, start, end);\n\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return utf16leSlice(this, start, end);\n\n default:\n if (loweredCase) throw new TypeError(\"Unknown encoding: \" + encoding);\n encoding = (encoding + \"\").toLowerCase();\n loweredCase = true;\n }\n }\n } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n // to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n // reliably in a browserify context because there could be multiple different\n // copies of the 'buffer' package in use. This method works even for Buffer\n // instances that were created from another copy of the `buffer` package.\n // See: https://github.com/feross/buffer/issues/154\n\n\n Buffer.prototype._isBuffer = true;\n\n function swap(b, n, m) {\n const i = b[n];\n b[n] = b[m];\n b[m] = i;\n }\n\n Buffer.prototype.swap16 = function swap16() {\n const len = this.length;\n\n if (len % 2 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 16-bits\");\n }\n\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1);\n }\n\n return this;\n };\n\n Buffer.prototype.swap32 = function swap32() {\n const len = this.length;\n\n if (len % 4 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 32-bits\");\n }\n\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3);\n swap(this, i + 1, i + 2);\n }\n\n return this;\n };\n\n Buffer.prototype.swap64 = function swap64() {\n const len = this.length;\n\n if (len % 8 !== 0) {\n throw new RangeError(\"Buffer size must be a multiple of 64-bits\");\n }\n\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7);\n swap(this, i + 1, i + 6);\n swap(this, i + 2, i + 5);\n swap(this, i + 3, i + 4);\n }\n\n return this;\n };\n\n Buffer.prototype.toString = function toString() {\n const length = this.length;\n if (length === 0) return \"\";\n if (arguments.length === 0) return utf8Slice(this, 0, length);\n return slowToString.apply(this, arguments);\n };\n\n Buffer.prototype.toLocaleString = Buffer.prototype.toString;\n\n Buffer.prototype.equals = function equals(b) {\n if (!Buffer.isBuffer(b)) throw new TypeError(\"Argument must be a Buffer\");\n if (this === b) return true;\n return Buffer.compare(this, b) === 0;\n };\n\n Buffer.prototype.inspect = function inspect() {\n let str = \"\";\n const max = exports$1.INSPECT_MAX_BYTES;\n str = this.toString(\"hex\", 0, max).replace(/(.{2})/g, \"$1 \").trim();\n if (this.length > max) str += \" ... \";\n return \"\";\n };\n\n if (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect;\n }\n\n Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength);\n }\n\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\"The \\\"target\\\" argument must be one of type Buffer or Uint8Array. \" + \"Received type \" + typeof target);\n }\n\n if (start === undefined) {\n start = 0;\n }\n\n if (end === undefined) {\n end = target ? target.length : 0;\n }\n\n if (thisStart === undefined) {\n thisStart = 0;\n }\n\n if (thisEnd === undefined) {\n thisEnd = this.length;\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError(\"out of range index\");\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0;\n }\n\n if (thisStart >= thisEnd) {\n return -1;\n }\n\n if (start >= end) {\n return 1;\n }\n\n start >>>= 0;\n end >>>= 0;\n thisStart >>>= 0;\n thisEnd >>>= 0;\n if (this === target) return 0;\n let x = thisEnd - thisStart;\n let y = end - start;\n const len = Math.min(x, y);\n const thisCopy = this.slice(thisStart, thisEnd);\n const targetCopy = target.slice(start, end);\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i];\n y = targetCopy[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n // OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n //\n // Arguments:\n // - buffer - a Buffer to search\n // - val - a string, Buffer, or number\n // - byteOffset - an index into `buffer`; will be clamped to an int32\n // - encoding - an optional encoding, relevant is val is a string\n // - dir - true for indexOf, false for lastIndexOf\n\n\n function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === \"string\") {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 2147483647) {\n byteOffset = 2147483647;\n } else if (byteOffset < -2147483648) {\n byteOffset = -2147483648;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === \"string\") {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === \"number\") {\n val = val & 255; // Search for a byte value [0-255]\n\n if (typeof Uint8Array.prototype.indexOf === \"function\") {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError(\"val must be string, number or Buffer\");\n }\n\n function arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n let indexSize = 1;\n let arrLength = arr.length;\n let valLength = val.length;\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase();\n\n if (encoding === \"ucs2\" || encoding === \"ucs-2\" || encoding === \"utf16le\" || encoding === \"utf-16le\") {\n if (arr.length < 2 || val.length < 2) {\n return -1;\n }\n\n indexSize = 2;\n arrLength /= 2;\n valLength /= 2;\n byteOffset /= 2;\n }\n }\n\n function read(buf, i) {\n if (indexSize === 1) {\n return buf[i];\n } else {\n return buf.readUInt16BE(i * indexSize);\n }\n }\n\n let i;\n\n if (dir) {\n let foundIndex = -1;\n\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i;\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;\n } else {\n if (foundIndex !== -1) i -= i - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;\n\n for (i = byteOffset; i >= 0; i--) {\n let found = true;\n\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false;\n break;\n }\n }\n\n if (found) return i;\n }\n }\n\n return -1;\n }\n\n Buffer.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1;\n };\n\n Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true);\n };\n\n Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false);\n };\n\n function hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0;\n const remaining = buf.length - offset;\n\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n\n if (length > remaining) {\n length = remaining;\n }\n }\n\n const strLen = string.length;\n\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n\n let i;\n\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16);\n if (numberIsNaN(parsed)) return i;\n buf[offset + i] = parsed;\n }\n\n return i;\n }\n\n function utf8Write(buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);\n }\n\n function asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length);\n }\n\n function base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length);\n }\n\n function ucs2Write(buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);\n }\n\n Buffer.prototype.write = function write(string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = \"utf8\";\n length = this.length;\n offset = 0; // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === \"string\") {\n encoding = offset;\n length = this.length;\n offset = 0; // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0;\n\n if (isFinite(length)) {\n length = length >>> 0;\n if (encoding === undefined) encoding = \"utf8\";\n } else {\n encoding = length;\n length = undefined;\n }\n } else {\n throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");\n }\n\n const remaining = this.length - offset;\n if (length === undefined || length > remaining) length = remaining;\n\n if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {\n throw new RangeError(\"Attempt to write outside buffer bounds\");\n }\n\n if (!encoding) encoding = \"utf8\";\n let loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case \"hex\":\n return hexWrite(this, string, offset, length);\n\n case \"utf8\":\n case \"utf-8\":\n return utf8Write(this, string, offset, length);\n\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n return asciiWrite(this, string, offset, length);\n\n case \"base64\":\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length);\n\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return ucs2Write(this, string, offset, length);\n\n default:\n if (loweredCase) throw new TypeError(\"Unknown encoding: \" + encoding);\n encoding = (\"\" + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n };\n\n Buffer.prototype.toJSON = function toJSON() {\n return {\n type: \"Buffer\",\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n };\n\n function base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf);\n } else {\n return base64.fromByteArray(buf.slice(start, end));\n }\n }\n\n function utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end);\n const res = [];\n let i = start;\n\n while (i < end) {\n const firstByte = buf[i];\n let codePoint = null;\n let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint;\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 128) {\n codePoint = firstByte;\n }\n\n break;\n\n case 2:\n secondByte = buf[i + 1];\n\n if ((secondByte & 192) === 128) {\n tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;\n\n if (tempCodePoint > 127) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 3:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;\n\n if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 4:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n fourthByte = buf[i + 3];\n\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;\n\n if (tempCodePoint > 65535 && tempCodePoint < 1114112) {\n codePoint = tempCodePoint;\n }\n }\n\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 65533;\n bytesPerSequence = 1;\n } else if (codePoint > 65535) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 65536;\n res.push(codePoint >>> 10 & 1023 | 55296);\n codePoint = 56320 | codePoint & 1023;\n }\n\n res.push(codePoint);\n i += bytesPerSequence;\n }\n\n return decodeCodePointsArray(res);\n } // Based on http://stackoverflow.com/a/22747272/680742, the browser with\n // the lowest limit is Chrome, with 0x10000 args.\n // We go 1 magnitude less, for safety\n\n\n const MAX_ARGUMENTS_LENGTH = 4096;\n\n function decodeCodePointsArray(codePoints) {\n const len = codePoints.length;\n\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints); // avoid extra slice()\n } // Decode in chunks to avoid \"call stack size exceeded\".\n\n\n let res = \"\";\n let i = 0;\n\n while (i < len) {\n res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));\n }\n\n return res;\n }\n\n function asciiSlice(buf, start, end) {\n let ret = \"\";\n end = Math.min(buf.length, end);\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 127);\n }\n\n return ret;\n }\n\n function latin1Slice(buf, start, end) {\n let ret = \"\";\n end = Math.min(buf.length, end);\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i]);\n }\n\n return ret;\n }\n\n function hexSlice(buf, start, end) {\n const len = buf.length;\n if (!start || start < 0) start = 0;\n if (!end || end < 0 || end > len) end = len;\n let out = \"\";\n\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]];\n }\n\n return out;\n }\n\n function utf16leSlice(buf, start, end) {\n const bytes = buf.slice(start, end);\n let res = \"\"; // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);\n }\n\n return res;\n }\n\n Buffer.prototype.slice = function slice(start, end) {\n const len = this.length;\n start = ~~start;\n end = end === undefined ? len : ~~end;\n\n if (start < 0) {\n start += len;\n if (start < 0) start = 0;\n } else if (start > len) {\n start = len;\n }\n\n if (end < 0) {\n end += len;\n if (end < 0) end = 0;\n } else if (end > len) {\n end = len;\n }\n\n if (end < start) end = start;\n const newBuf = this.subarray(start, end); // Return an augmented `Uint8Array` instance\n\n Object.setPrototypeOf(newBuf, Buffer.prototype);\n return newBuf;\n };\n /*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\n\n\n function checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0) throw new RangeError(\"offset is not uint\");\n if (offset + ext > length) throw new RangeError(\"Trying to access beyond buffer length\");\n }\n\n Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n let val = this[offset];\n let mul = 1;\n let i = 0;\n\n while (++i < byteLength && (mul *= 256)) {\n val += this[offset + i] * mul;\n }\n\n return val;\n };\n\n Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n\n let val = this[offset + --byteLength];\n let mul = 1;\n\n while (byteLength > 0 && (mul *= 256)) {\n val += this[offset + --byteLength] * mul;\n }\n\n return val;\n };\n\n Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n return this[offset];\n };\n\n Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] | this[offset + 1] << 8;\n };\n\n Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] << 8 | this[offset + 1];\n };\n\n Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;\n };\n\n Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);\n };\n\n Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;\n const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;\n return BigInt(lo) + (BigInt(hi) << BigInt(32));\n });\n Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;\n return (BigInt(hi) << BigInt(32)) + BigInt(lo);\n });\n\n Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n let val = this[offset];\n let mul = 1;\n let i = 0;\n\n while (++i < byteLength && (mul *= 256)) {\n val += this[offset + i] * mul;\n }\n\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n };\n\n Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n let i = byteLength;\n let mul = 1;\n let val = this[offset + --i];\n\n while (i > 0 && (mul *= 256)) {\n val += this[offset + --i] * mul;\n }\n\n mul *= 128;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n };\n\n Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 1, this.length);\n if (!(this[offset] & 128)) return this[offset];\n return (255 - this[offset] + 1) * -1;\n };\n\n Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset] | this[offset + 1] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n\n Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 2, this.length);\n const val = this[offset + 1] | this[offset] << 8;\n return val & 32768 ? val | 4294901760 : val;\n };\n\n Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;\n };\n\n Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];\n };\n\n Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); // Overflow\n\n return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);\n });\n Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {\n offset = offset >>> 0;\n validateNumber(offset, \"offset\");\n const first = this[offset];\n const last = this[offset + 7];\n\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8);\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];\n return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);\n });\n\n Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, true, 23, 4);\n };\n\n Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, false, 23, 4);\n };\n\n Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, true, 52, 8);\n };\n\n Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n offset = offset >>> 0;\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, false, 52, 8);\n };\n\n function checkInt(buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError(\"\\\"buffer\\\" argument must be a Buffer instance\");\n if (value > max || value < min) throw new RangeError(\"\\\"value\\\" argument is out of bounds\");\n if (offset + ext > buf.length) throw new RangeError(\"Index out of range\");\n }\n\n Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n let mul = 1;\n let i = 0;\n this[offset] = value & 255;\n\n while (++i < byteLength && (mul *= 256)) {\n this[offset + i] = value / mul & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n let i = byteLength - 1;\n let mul = 1;\n this[offset + i] = value & 255;\n\n while (--i >= 0 && (mul *= 256)) {\n this[offset + i] = value / mul & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 255, 0);\n this[offset] = value & 255;\n return offset + 1;\n };\n\n Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n\n Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n\n Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset + 3] = value >>> 24;\n this[offset + 2] = value >>> 16;\n this[offset + 1] = value >>> 8;\n this[offset] = value & 255;\n return offset + 4;\n };\n\n Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n\n function wrtBigUInt64LE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo = Number(value & BigInt(4294967295));\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n lo = lo >> 8;\n buf[offset++] = lo;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n hi = hi >> 8;\n buf[offset++] = hi;\n return offset;\n }\n\n function wrtBigUInt64BE(buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7);\n let lo = Number(value & BigInt(4294967295));\n buf[offset + 7] = lo;\n lo = lo >> 8;\n buf[offset + 6] = lo;\n lo = lo >> 8;\n buf[offset + 5] = lo;\n lo = lo >> 8;\n buf[offset + 4] = lo;\n let hi = Number(value >> BigInt(32) & BigInt(4294967295));\n buf[offset + 3] = hi;\n hi = hi >> 8;\n buf[offset + 2] = hi;\n hi = hi >> 8;\n buf[offset + 1] = hi;\n hi = hi >> 8;\n buf[offset] = hi;\n return offset + 8;\n }\n\n Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt(\"0xffffffffffffffff\"));\n });\n Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt(\"0xffffffffffffffff\"));\n });\n\n Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n let i = 0;\n let mul = 1;\n let sub = 0;\n this[offset] = value & 255;\n\n while (++i < byteLength && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n const limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n let i = byteLength - 1;\n let mul = 1;\n let sub = 0;\n this[offset + i] = value & 255;\n\n while (--i >= 0 && (mul *= 256)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 255;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 1, 127, -128);\n if (value < 0) value = 255 + value + 1;\n this[offset] = value & 255;\n return offset + 1;\n };\n\n Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n return offset + 2;\n };\n\n Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);\n this[offset] = value >>> 8;\n this[offset + 1] = value & 255;\n return offset + 2;\n };\n\n Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n this[offset] = value & 255;\n this[offset + 1] = value >>> 8;\n this[offset + 2] = value >>> 16;\n this[offset + 3] = value >>> 24;\n return offset + 4;\n };\n\n Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset >>> 0;\n if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);\n if (value < 0) value = 4294967295 + value + 1;\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 255;\n return offset + 4;\n };\n\n Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt(\"0x8000000000000000\"), BigInt(\"0x7fffffffffffffff\"));\n });\n Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt(\"0x8000000000000000\"), BigInt(\"0x7fffffffffffffff\"));\n });\n\n function checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError(\"Index out of range\");\n if (offset < 0) throw new RangeError(\"Index out of range\");\n }\n\n function writeFloat(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 23, 4);\n return offset + 4;\n }\n\n Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert);\n };\n\n Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert);\n };\n\n function writeDouble(buf, value, offset, littleEndian, noAssert) {\n value = +value;\n offset = offset >>> 0;\n\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 52, 8);\n return offset + 8;\n }\n\n Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert);\n };\n\n Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert);\n }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\n\n\n Buffer.prototype.copy = function copy(target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError(\"argument should be a Buffer\");\n if (!start) start = 0;\n if (!end && end !== 0) end = this.length;\n if (targetStart >= target.length) targetStart = target.length;\n if (!targetStart) targetStart = 0;\n if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done\n\n if (end === start) return 0;\n if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions\n\n if (targetStart < 0) {\n throw new RangeError(\"targetStart out of bounds\");\n }\n\n if (start < 0 || start >= this.length) throw new RangeError(\"Index out of range\");\n if (end < 0) throw new RangeError(\"sourceEnd out of bounds\"); // Are we oob?\n\n if (end > this.length) end = this.length;\n\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start;\n }\n\n const len = end - start;\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === \"function\") {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end);\n } else {\n Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart);\n }\n\n return len;\n }; // Usage:\n // buffer.fill(number[, offset[, end]])\n // buffer.fill(buffer[, offset[, end]])\n // buffer.fill(string[, offset[, end]][, encoding])\n\n\n Buffer.prototype.fill = function fill(val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === \"string\") {\n if (typeof start === \"string\") {\n encoding = start;\n start = 0;\n end = this.length;\n } else if (typeof end === \"string\") {\n encoding = end;\n end = this.length;\n }\n\n if (encoding !== undefined && typeof encoding !== \"string\") {\n throw new TypeError(\"encoding must be a string\");\n }\n\n if (typeof encoding === \"string\" && !Buffer.isEncoding(encoding)) {\n throw new TypeError(\"Unknown encoding: \" + encoding);\n }\n\n if (val.length === 1) {\n const code = val.charCodeAt(0);\n\n if (encoding === \"utf8\" && code < 128 || encoding === \"latin1\") {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code;\n }\n }\n } else if (typeof val === \"number\") {\n val = val & 255;\n } else if (typeof val === \"boolean\") {\n val = Number(val);\n } // Invalid ranges are not set to a default, so can range check early.\n\n\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError(\"Out of range index\");\n }\n\n if (end <= start) {\n return this;\n }\n\n start = start >>> 0;\n end = end === undefined ? this.length : end >>> 0;\n if (!val) val = 0;\n let i;\n\n if (typeof val === \"number\") {\n for (i = start; i < end; ++i) {\n this[i] = val;\n }\n } else {\n const bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding);\n const len = bytes.length;\n\n if (len === 0) {\n throw new TypeError(\"The value \\\"\" + val + \"\\\" is invalid for argument \\\"value\\\"\");\n }\n\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len];\n }\n }\n\n return this;\n }; // CUSTOM ERRORS\n // =============\n // Simplified versions from Node, changed for Buffer-only usage\n\n\n const errors = {};\n\n function E(sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor() {\n super();\n Object.defineProperty(this, \"message\", {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n }); // Add the error code to the name to include it in the stack trace.\n\n this.name = `${this.name} [${sym}]`; // Access the stack to generate the error message including the error code\n // from the name.\n\n this.stack; // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n\n delete this.name;\n }\n\n get code() {\n return sym;\n }\n\n set code(value) {\n Object.defineProperty(this, \"code\", {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n });\n }\n\n toString() {\n return `${this.name} [${sym}]: ${this.message}`;\n }\n\n };\n }\n\n E(\"ERR_BUFFER_OUT_OF_BOUNDS\", function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`;\n }\n\n return \"Attempt to access memory outside buffer bounds\";\n }, RangeError);\n E(\"ERR_INVALID_ARG_TYPE\", function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`;\n }, TypeError);\n E(\"ERR_OUT_OF_RANGE\", function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`;\n let received = input;\n\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input));\n } else if (typeof input === \"bigint\") {\n received = String(input);\n\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received);\n }\n\n received += \"n\";\n }\n\n msg += ` It must be ${range}. Received ${received}`;\n return msg;\n }, RangeError);\n\n function addNumericalSeparator(val) {\n let res = \"\";\n let i = val.length;\n const start = val[0] === \"-\" ? 1 : 0;\n\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`;\n }\n\n return `${val.slice(0, i)}${res}`;\n } // CHECK FUNCTIONS\n // ===============\n\n\n function checkBounds(buf, offset, byteLength) {\n validateNumber(offset, \"offset\");\n\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1));\n }\n }\n\n function checkIntBI(value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === \"bigint\" ? \"n\" : \"\";\n let range;\n\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`;\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + `${(byteLength + 1) * 8 - 1}${n}`;\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`;\n }\n\n throw new errors.ERR_OUT_OF_RANGE(\"value\", range, value);\n }\n\n checkBounds(buf, offset, byteLength);\n }\n\n function validateNumber(value, name) {\n if (typeof value !== \"number\") {\n throw new errors.ERR_INVALID_ARG_TYPE(name, \"number\", value);\n }\n }\n\n function boundsError(value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type);\n throw new errors.ERR_OUT_OF_RANGE(type || \"offset\", \"an integer\", value);\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || \"offset\", `>= ${type ? 1 : 0} and <= ${length}`, value);\n } // HELPER FUNCTIONS\n // ================\n\n\n const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;\n\n function base64clean(str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split(\"=\")[0]; // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n\n str = str.trim().replace(INVALID_BASE64_RE, \"\"); // Node converts strings with length < 2 to ''\n\n if (str.length < 2) return \"\"; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n\n while (str.length % 4 !== 0) {\n str = str + \"=\";\n }\n\n return str;\n }\n\n function utf8ToBytes(string, units) {\n units = units || Infinity;\n let codePoint;\n const length = string.length;\n let leadSurrogate = null;\n const bytes = [];\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i); // is surrogate component\n\n if (codePoint > 55295 && codePoint < 57344) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 56319) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n continue;\n } // valid lead\n\n\n leadSurrogate = codePoint;\n continue;\n } // 2 leads in a row\n\n\n if (codePoint < 56320) {\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n leadSurrogate = codePoint;\n continue;\n } // valid surrogate pair\n\n\n codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(239, 191, 189);\n }\n\n leadSurrogate = null; // encode utf8\n\n if (codePoint < 128) {\n if ((units -= 1) < 0) break;\n bytes.push(codePoint);\n } else if (codePoint < 2048) {\n if ((units -= 2) < 0) break;\n bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128);\n } else if (codePoint < 65536) {\n if ((units -= 3) < 0) break;\n bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);\n } else if (codePoint < 1114112) {\n if ((units -= 4) < 0) break;\n bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);\n } else {\n throw new Error(\"Invalid code point\");\n }\n }\n\n return bytes;\n }\n\n function asciiToBytes(str) {\n const byteArray = [];\n\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 255);\n }\n\n return byteArray;\n }\n\n function utf16leToBytes(str, units) {\n let c, hi, lo;\n const byteArray = [];\n\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break;\n c = str.charCodeAt(i);\n hi = c >> 8;\n lo = c % 256;\n byteArray.push(lo);\n byteArray.push(hi);\n }\n\n return byteArray;\n }\n\n function base64ToBytes(str) {\n return base64.toByteArray(base64clean(str));\n }\n\n function blitBuffer(src, dst, offset, length) {\n let i;\n\n for (i = 0; i < length; ++i) {\n if (i + offset >= dst.length || i >= src.length) break;\n dst[i + offset] = src[i];\n }\n\n return i;\n } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n // the `instanceof` check but they should be treated as of that type.\n // See: https://github.com/feross/buffer/issues/166\n\n\n function isInstance(obj, type) {\n return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;\n }\n\n function numberIsNaN(obj) {\n // For IE11 support\n return obj !== obj; // eslint-disable-line no-self-compare\n } // Create lookup table for `toString('hex')`\n // See: https://github.com/feross/buffer/issues/219\n\n\n const hexSliceLookupTable = function () {\n const alphabet = \"0123456789abcdef\";\n const table = new Array(256);\n\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16;\n\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j];\n }\n }\n\n return table;\n }(); // Return not function with Error if BigInt not supported\n\n\n function defineBigIntMethod(fn) {\n return typeof BigInt === \"undefined\" ? BufferBigIntNotDefined : fn;\n }\n\n function BufferBigIntNotDefined() {\n throw new Error(\"BigInt not supported\");\n }\n\n return exports$1;\n}\n\nconst exports = dew();\nexports['Buffer']; exports['SlowBuffer']; exports['INSPECT_MAX_BYTES']; exports['kMaxLength'];\n\nvar Buffer = exports.Buffer;\r\nvar INSPECT_MAX_BYTES = exports.INSPECT_MAX_BYTES;\r\nvar kMaxLength = exports.kMaxLength;\n\nexport { Buffer, INSPECT_MAX_BYTES, exports as default, kMaxLength };\n", "export { Buffer } from \"buffer\";\n", "/*! UIkit 3.21.5 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define('uikit', factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.UIkit = factory());\n})(this, (function () { 'use strict';\n\n const { hasOwnProperty, toString } = Object.prototype;\n function hasOwn(obj, key) {\n return hasOwnProperty.call(obj, key);\n }\n const hyphenateRe = /\\B([A-Z])/g;\n const hyphenate = memoize((str) => str.replace(hyphenateRe, \"-$1\").toLowerCase());\n const camelizeRe = /-(\\w)/g;\n const camelize = memoize(\n (str) => (str.charAt(0).toLowerCase() + str.slice(1)).replace(camelizeRe, (_, c) => c.toUpperCase())\n );\n const ucfirst = memoize((str) => str.charAt(0).toUpperCase() + str.slice(1));\n function startsWith(str, search) {\n var _a;\n return (_a = str == null ? void 0 : str.startsWith) == null ? void 0 : _a.call(str, search);\n }\n function endsWith(str, search) {\n var _a;\n return (_a = str == null ? void 0 : str.endsWith) == null ? void 0 : _a.call(str, search);\n }\n function includes(obj, search) {\n var _a;\n return (_a = obj == null ? void 0 : obj.includes) == null ? void 0 : _a.call(obj, search);\n }\n function findIndex(array, predicate) {\n var _a;\n return (_a = array == null ? void 0 : array.findIndex) == null ? void 0 : _a.call(array, predicate);\n }\n const { isArray, from: toArray } = Array;\n const { assign } = Object;\n function isFunction(obj) {\n return typeof obj === \"function\";\n }\n function isObject(obj) {\n return obj !== null && typeof obj === \"object\";\n }\n function isPlainObject(obj) {\n return toString.call(obj) === \"[object Object]\";\n }\n function isWindow(obj) {\n return isObject(obj) && obj === obj.window;\n }\n function isDocument(obj) {\n return nodeType(obj) === 9;\n }\n function isNode(obj) {\n return nodeType(obj) >= 1;\n }\n function isElement(obj) {\n return nodeType(obj) === 1;\n }\n function nodeType(obj) {\n return !isWindow(obj) && isObject(obj) && obj.nodeType;\n }\n function isBoolean(value) {\n return typeof value === \"boolean\";\n }\n function isString(value) {\n return typeof value === \"string\";\n }\n function isNumber(value) {\n return typeof value === \"number\";\n }\n function isNumeric(value) {\n return isNumber(value) || isString(value) && !isNaN(value - parseFloat(value));\n }\n function isEmpty(obj) {\n return !(isArray(obj) ? obj.length : isObject(obj) ? Object.keys(obj).length : false);\n }\n function isUndefined(value) {\n return value === void 0;\n }\n function toBoolean(value) {\n return isBoolean(value) ? value : value === \"true\" || value === \"1\" || value === \"\" ? true : value === \"false\" || value === \"0\" ? false : value;\n }\n function toNumber(value) {\n const number = Number(value);\n return isNaN(number) ? false : number;\n }\n function toFloat(value) {\n return parseFloat(value) || 0;\n }\n function toNode(element) {\n return element && toNodes(element)[0];\n }\n function toNodes(element) {\n return isNode(element) ? [element] : Array.from(element || []).filter(isNode);\n }\n function toWindow(element) {\n if (isWindow(element)) {\n return element;\n }\n element = toNode(element);\n const document = isDocument(element) ? element : element == null ? void 0 : element.ownerDocument;\n return (document == null ? void 0 : document.defaultView) || window;\n }\n function isEqual(value, other) {\n return value === other || isObject(value) && isObject(other) && Object.keys(value).length === Object.keys(other).length && each(value, (val, key) => val === other[key]);\n }\n function swap(value, a, b) {\n return value.replace(new RegExp(`${a}|${b}`, \"g\"), (match) => match === a ? b : a);\n }\n function last(array) {\n return array[array.length - 1];\n }\n function each(obj, cb) {\n for (const key in obj) {\n if (false === cb(obj[key], key)) {\n return false;\n }\n }\n return true;\n }\n function sortBy(array, prop) {\n return array.slice().sort(\n ({ [prop]: propA = 0 }, { [prop]: propB = 0 }) => propA > propB ? 1 : propB > propA ? -1 : 0\n );\n }\n function sumBy(array, iteratee) {\n return array.reduce(\n (sum, item) => sum + toFloat(isFunction(iteratee) ? iteratee(item) : item[iteratee]),\n 0\n );\n }\n function uniqueBy(array, prop) {\n const seen = /* @__PURE__ */ new Set();\n return array.filter(({ [prop]: check }) => seen.has(check) ? false : seen.add(check));\n }\n function pick(obj, props) {\n return props.reduce((res, prop) => ({ ...res, [prop]: obj[prop] }), {});\n }\n function clamp(number, min = 0, max = 1) {\n return Math.min(Math.max(toNumber(number) || 0, min), max);\n }\n function noop() {\n }\n function intersectRect(...rects) {\n return [\n [\"bottom\", \"top\"],\n [\"right\", \"left\"]\n ].every(\n ([minProp, maxProp]) => Math.min(...rects.map(({ [minProp]: min }) => min)) - Math.max(...rects.map(({ [maxProp]: max }) => max)) > 0\n );\n }\n function pointInRect(point, rect) {\n return point.x <= rect.right && point.x >= rect.left && point.y <= rect.bottom && point.y >= rect.top;\n }\n function ratio(dimensions, prop, value) {\n const aProp = prop === \"width\" ? \"height\" : \"width\";\n return {\n [aProp]: dimensions[prop] ? Math.round(value * dimensions[aProp] / dimensions[prop]) : dimensions[aProp],\n [prop]: value\n };\n }\n function contain(dimensions, maxDimensions) {\n dimensions = { ...dimensions };\n for (const prop in dimensions) {\n dimensions = dimensions[prop] > maxDimensions[prop] ? ratio(dimensions, prop, maxDimensions[prop]) : dimensions;\n }\n return dimensions;\n }\n function cover$1(dimensions, maxDimensions) {\n dimensions = contain(dimensions, maxDimensions);\n for (const prop in dimensions) {\n dimensions = dimensions[prop] < maxDimensions[prop] ? ratio(dimensions, prop, maxDimensions[prop]) : dimensions;\n }\n return dimensions;\n }\n const Dimensions = { ratio, contain, cover: cover$1 };\n function getIndex(i, elements, current = 0, finite = false) {\n elements = toNodes(elements);\n const { length } = elements;\n if (!length) {\n return -1;\n }\n i = isNumeric(i) ? toNumber(i) : i === \"next\" ? current + 1 : i === \"previous\" ? current - 1 : i === \"last\" ? length - 1 : elements.indexOf(toNode(i));\n if (finite) {\n return clamp(i, 0, length - 1);\n }\n i %= length;\n return i < 0 ? i + length : i;\n }\n function memoize(fn) {\n const cache = /* @__PURE__ */ Object.create(null);\n return (key, ...args) => cache[key] || (cache[key] = fn(key, ...args));\n }\n\n function addClass(element, ...classes) {\n for (const node of toNodes(element)) {\n const add = toClasses(classes).filter((cls) => !hasClass(node, cls));\n if (add.length) {\n node.classList.add(...add);\n }\n }\n }\n function removeClass(element, ...classes) {\n for (const node of toNodes(element)) {\n const remove = toClasses(classes).filter((cls) => hasClass(node, cls));\n if (remove.length) {\n node.classList.remove(...remove);\n }\n }\n }\n function replaceClass(element, oldClass, newClass) {\n newClass = toClasses(newClass);\n oldClass = toClasses(oldClass).filter((cls) => !includes(newClass, cls));\n removeClass(element, oldClass);\n addClass(element, newClass);\n }\n function hasClass(element, cls) {\n [cls] = toClasses(cls);\n return toNodes(element).some((node) => node.classList.contains(cls));\n }\n function toggleClass(element, cls, force) {\n const classes = toClasses(cls);\n if (!isUndefined(force)) {\n force = !!force;\n }\n for (const node of toNodes(element)) {\n for (const cls2 of classes) {\n node.classList.toggle(cls2, force);\n }\n }\n }\n function toClasses(str) {\n return str ? isArray(str) ? str.map(toClasses).flat() : String(str).split(\" \").filter(Boolean) : [];\n }\n\n function attr(element, name, value) {\n var _a;\n if (isObject(name)) {\n for (const key in name) {\n attr(element, key, name[key]);\n }\n return;\n }\n if (isUndefined(value)) {\n return (_a = toNode(element)) == null ? void 0 : _a.getAttribute(name);\n } else {\n for (const el of toNodes(element)) {\n if (isFunction(value)) {\n value = value.call(el, attr(el, name));\n }\n if (value === null) {\n removeAttr(el, name);\n } else {\n el.setAttribute(name, value);\n }\n }\n }\n }\n function hasAttr(element, name) {\n return toNodes(element).some((element2) => element2.hasAttribute(name));\n }\n function removeAttr(element, name) {\n toNodes(element).forEach((element2) => element2.removeAttribute(name));\n }\n function data(element, attribute) {\n for (const name of [attribute, `data-${attribute}`]) {\n if (hasAttr(element, name)) {\n return attr(element, name);\n }\n }\n }\n\n const inBrowser = typeof window !== \"undefined\";\n const isRtl = inBrowser && document.dir === \"rtl\";\n const hasTouch = inBrowser && \"ontouchstart\" in window;\n const hasPointerEvents = inBrowser && window.PointerEvent;\n const pointerDown$1 = hasPointerEvents ? \"pointerdown\" : hasTouch ? \"touchstart\" : \"mousedown\";\n const pointerMove$1 = hasPointerEvents ? \"pointermove\" : hasTouch ? \"touchmove\" : \"mousemove\";\n const pointerUp$1 = hasPointerEvents ? \"pointerup\" : hasTouch ? \"touchend\" : \"mouseup\";\n const pointerEnter = hasPointerEvents ? \"pointerenter\" : hasTouch ? \"\" : \"mouseenter\";\n const pointerLeave = hasPointerEvents ? \"pointerleave\" : hasTouch ? \"\" : \"mouseleave\";\n const pointerCancel = hasPointerEvents ? \"pointercancel\" : \"touchcancel\";\n\n const voidElements = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true\n };\n function isVoidElement(element) {\n return toNodes(element).some((element2) => voidElements[element2.tagName.toLowerCase()]);\n }\n const isVisibleFn = inBrowser && Element.prototype.checkVisibility || function() {\n return this.offsetWidth || this.offsetHeight || this.getClientRects().length;\n };\n function isVisible(element) {\n return toNodes(element).some((element2) => isVisibleFn.call(element2));\n }\n const selInput = \"input,select,textarea,button\";\n function isInput(element) {\n return toNodes(element).some((element2) => matches(element2, selInput));\n }\n const selFocusable = `${selInput},a[href],[tabindex]`;\n function isFocusable(element) {\n return matches(element, selFocusable);\n }\n function parent(element) {\n var _a;\n return (_a = toNode(element)) == null ? void 0 : _a.parentElement;\n }\n function filter$1(element, selector) {\n return toNodes(element).filter((element2) => matches(element2, selector));\n }\n function matches(element, selector) {\n return toNodes(element).some((element2) => element2.matches(selector));\n }\n function parents(element, selector) {\n const elements = [];\n while (element = parent(element)) {\n if (!selector || matches(element, selector)) {\n elements.push(element);\n }\n }\n return elements;\n }\n function children(element, selector) {\n element = toNode(element);\n const children2 = element ? toArray(element.children) : [];\n return selector ? filter$1(children2, selector) : children2;\n }\n function index(element, ref) {\n return ref ? toNodes(element).indexOf(toNode(ref)) : children(parent(element)).indexOf(element);\n }\n function isSameSiteAnchor(el) {\n el = toNode(el);\n return el && [\"origin\", \"pathname\", \"search\"].every((part) => el[part] === location[part]);\n }\n function getTargetedElement(el) {\n if (isSameSiteAnchor(el)) {\n const { hash, ownerDocument } = toNode(el);\n const id = decodeURIComponent(hash).slice(1);\n return ownerDocument.getElementById(id) || ownerDocument.getElementsByName(id)[0];\n }\n }\n\n function query(selector, context) {\n return find(selector, getContext(selector, context));\n }\n function queryAll(selector, context) {\n return findAll(selector, getContext(selector, context));\n }\n function find(selector, context) {\n return toNode(_query(selector, toNode(context), \"querySelector\"));\n }\n function findAll(selector, context) {\n return toNodes(_query(selector, toNode(context), \"querySelectorAll\"));\n }\n function getContext(selector, context = document) {\n return isString(selector) && parseSelector(selector).isContextSelector || isDocument(context) ? context : context.ownerDocument;\n }\n const addStarRe = /([!>+~-])(?=\\s+[!>+~-]|\\s*$)/g;\n const splitSelectorRe = /.*?[^\\\\](?![^(]*\\))(?:,|$)/g;\n const trailingCommaRe = /\\s*,$/;\n const parseSelector = memoize((selector) => {\n var _a;\n selector = selector.replace(addStarRe, \"$1 *\");\n let isContextSelector = false;\n const selectors = [];\n for (let sel of (_a = selector.match(splitSelectorRe)) != null ? _a : []) {\n sel = sel.replace(trailingCommaRe, \"\").trim();\n isContextSelector || (isContextSelector = [\"!\", \"+\", \"~\", \"-\", \">\"].includes(sel[0]));\n selectors.push(sel);\n }\n return {\n selector: selectors.join(\",\"),\n selectors,\n isContextSelector\n };\n });\n const parsePositionSelector = memoize((selector) => {\n selector = selector.slice(1).trim();\n const index2 = selector.indexOf(\" \");\n return ~index2 ? [selector.slice(0, index2), selector.slice(index2 + 1)] : [selector, \"\"];\n });\n function _query(selector, context = document, queryFn) {\n if (!selector || !isString(selector)) {\n return selector;\n }\n const parsed = parseSelector(selector);\n if (!parsed.isContextSelector) {\n return _doQuery(context, queryFn, parsed.selector);\n }\n selector = \"\";\n const isSingle = parsed.selectors.length === 1;\n for (let sel of parsed.selectors) {\n let positionSel;\n let ctx = context;\n if (sel[0] === \"!\") {\n [positionSel, sel] = parsePositionSelector(sel);\n ctx = context.parentElement.closest(positionSel);\n if (!sel && isSingle) {\n return ctx;\n }\n }\n if (ctx && sel[0] === \"-\") {\n [positionSel, sel] = parsePositionSelector(sel);\n ctx = ctx.previousElementSibling;\n ctx = matches(ctx, positionSel) ? ctx : null;\n if (!sel && isSingle) {\n return ctx;\n }\n }\n if (!ctx) {\n continue;\n }\n if (isSingle) {\n if (sel[0] === \"~\" || sel[0] === \"+\") {\n sel = `:scope > :nth-child(${index(ctx) + 1}) ${sel}`;\n ctx = ctx.parentElement;\n } else if (sel[0] === \">\") {\n sel = `:scope ${sel}`;\n }\n return _doQuery(ctx, queryFn, sel);\n }\n selector += `${selector ? \",\" : \"\"}${domPath(ctx)} ${sel}`;\n }\n if (!isDocument(context)) {\n context = context.ownerDocument;\n }\n return _doQuery(context, queryFn, selector);\n }\n function _doQuery(context, queryFn, selector) {\n try {\n return context[queryFn](selector);\n } catch (e) {\n return null;\n }\n }\n function domPath(element) {\n const names = [];\n while (element.parentNode) {\n const id = attr(element, \"id\");\n if (id) {\n names.unshift(`#${escape(id)}`);\n break;\n } else {\n let { tagName } = element;\n if (tagName !== \"HTML\") {\n tagName += `:nth-child(${index(element) + 1})`;\n }\n names.unshift(tagName);\n element = element.parentNode;\n }\n }\n return names.join(\" > \");\n }\n function escape(css) {\n return isString(css) ? CSS.escape(css) : \"\";\n }\n\n function on(...args) {\n let [targets, types, selector, listener, useCapture = false] = getArgs(args);\n if (listener.length > 1) {\n listener = detail(listener);\n }\n if (useCapture == null ? void 0 : useCapture.self) {\n listener = selfFilter(listener);\n }\n if (selector) {\n listener = delegate(selector, listener);\n }\n for (const type of types) {\n for (const target of targets) {\n target.addEventListener(type, listener, useCapture);\n }\n }\n return () => off(targets, types, listener, useCapture);\n }\n function off(...args) {\n let [targets, types, , listener, useCapture = false] = getArgs(args);\n for (const type of types) {\n for (const target of targets) {\n target.removeEventListener(type, listener, useCapture);\n }\n }\n }\n function once(...args) {\n const [element, types, selector, listener, useCapture = false, condition] = getArgs(args);\n const off2 = on(\n element,\n types,\n selector,\n (e) => {\n const result = !condition || condition(e);\n if (result) {\n off2();\n listener(e, result);\n }\n },\n useCapture\n );\n return off2;\n }\n function trigger(targets, event, detail2) {\n return toEventTargets(targets).every(\n (target) => target.dispatchEvent(createEvent(event, true, true, detail2))\n );\n }\n function createEvent(e, bubbles = true, cancelable = false, detail2) {\n if (isString(e)) {\n e = new CustomEvent(e, { bubbles, cancelable, detail: detail2 });\n }\n return e;\n }\n function getArgs(args) {\n args[0] = toEventTargets(args[0]);\n if (isString(args[1])) {\n args[1] = args[1].split(\" \");\n }\n if (isFunction(args[2])) {\n args.splice(2, 0, false);\n }\n return args;\n }\n function delegate(selector, listener) {\n return (e) => {\n const current = selector[0] === \">\" ? findAll(selector, e.currentTarget).reverse().find((element) => element.contains(e.target)) : e.target.closest(selector);\n if (current) {\n e.current = current;\n listener.call(this, e);\n delete e.current;\n }\n };\n }\n function detail(listener) {\n return (e) => isArray(e.detail) ? listener(e, ...e.detail) : listener(e);\n }\n function selfFilter(listener) {\n return function(e) {\n if (e.target === e.currentTarget || e.target === e.current) {\n return listener.call(null, e);\n }\n };\n }\n function isEventTarget(target) {\n return target && \"addEventListener\" in target;\n }\n function toEventTarget(target) {\n return isEventTarget(target) ? target : toNode(target);\n }\n function toEventTargets(target) {\n return isArray(target) ? target.map(toEventTarget).filter(Boolean) : isString(target) ? findAll(target) : isEventTarget(target) ? [target] : toNodes(target);\n }\n function isTouch(e) {\n return e.pointerType === \"touch\" || !!e.touches;\n }\n function getEventPos(e) {\n var _a, _b;\n const { clientX: x, clientY: y } = ((_a = e.touches) == null ? void 0 : _a[0]) || ((_b = e.changedTouches) == null ? void 0 : _b[0]) || e;\n return { x, y };\n }\n\n const cssNumber = {\n \"animation-iteration-count\": true,\n \"column-count\": true,\n \"fill-opacity\": true,\n \"flex-grow\": true,\n \"flex-shrink\": true,\n \"font-weight\": true,\n \"line-height\": true,\n opacity: true,\n order: true,\n orphans: true,\n \"stroke-dasharray\": true,\n \"stroke-dashoffset\": true,\n widows: true,\n \"z-index\": true,\n zoom: true\n };\n function css(element, property, value, priority) {\n const elements = toNodes(element);\n for (const element2 of elements) {\n if (isString(property)) {\n property = propName(property);\n if (isUndefined(value)) {\n return getComputedStyle(element2).getPropertyValue(property);\n } else {\n element2.style.setProperty(\n property,\n isNumeric(value) && !cssNumber[property] ? `${value}px` : value || isNumber(value) ? value : \"\",\n priority\n );\n }\n } else if (isArray(property)) {\n const props = {};\n for (const prop of property) {\n props[prop] = css(element2, prop);\n }\n return props;\n } else if (isObject(property)) {\n for (const prop in property) {\n css(element2, prop, property[prop], value);\n }\n }\n }\n return elements[0];\n }\n const propName = memoize((name) => {\n if (startsWith(name, \"--\")) {\n return name;\n }\n name = hyphenate(name);\n const { style } = document.documentElement;\n if (name in style) {\n return name;\n }\n for (const prefix of [\"webkit\", \"moz\"]) {\n const prefixedName = `-${prefix}-${name}`;\n if (prefixedName in style) {\n return prefixedName;\n }\n }\n });\n\n const clsTransition = \"uk-transition\";\n const transitionEnd = \"transitionend\";\n const transitionCanceled = \"transitioncanceled\";\n function transition$1(element, props, duration = 400, timing = \"linear\") {\n duration = Math.round(duration);\n return Promise.all(\n toNodes(element).map(\n (element2) => new Promise((resolve, reject) => {\n for (const name in props) {\n css(element2, name);\n }\n const timer = setTimeout(() => trigger(element2, transitionEnd), duration);\n once(\n element2,\n [transitionEnd, transitionCanceled],\n ({ type }) => {\n clearTimeout(timer);\n removeClass(element2, clsTransition);\n css(element2, {\n transitionProperty: \"\",\n transitionDuration: \"\",\n transitionTimingFunction: \"\"\n });\n type === transitionCanceled ? reject() : resolve(element2);\n },\n { self: true }\n );\n addClass(element2, clsTransition);\n css(element2, {\n transitionProperty: Object.keys(props).map(propName).join(\",\"),\n transitionDuration: `${duration}ms`,\n transitionTimingFunction: timing,\n ...props\n });\n })\n )\n );\n }\n const Transition = {\n start: transition$1,\n async stop(element) {\n trigger(element, transitionEnd);\n await Promise.resolve();\n },\n async cancel(element) {\n trigger(element, transitionCanceled);\n await Promise.resolve();\n },\n inProgress(element) {\n return hasClass(element, clsTransition);\n }\n };\n const clsAnimation = \"uk-animation\";\n const animationEnd = \"animationend\";\n const animationCanceled = \"animationcanceled\";\n function animate$2(element, animation, duration = 200, origin, out) {\n return Promise.all(\n toNodes(element).map(\n (element2) => new Promise((resolve, reject) => {\n if (hasClass(element2, clsAnimation)) {\n trigger(element2, animationCanceled);\n }\n const classes = [\n animation,\n clsAnimation,\n `${clsAnimation}-${out ? \"leave\" : \"enter\"}`,\n origin && `uk-transform-origin-${origin}`,\n out && `${clsAnimation}-reverse`\n ];\n const timer = setTimeout(() => trigger(element2, animationEnd), duration);\n once(\n element2,\n [animationEnd, animationCanceled],\n ({ type }) => {\n clearTimeout(timer);\n type === animationCanceled ? reject() : resolve(element2);\n css(element2, \"animationDuration\", \"\");\n removeClass(element2, classes);\n },\n { self: true }\n );\n css(element2, \"animationDuration\", `${duration}ms`);\n addClass(element2, classes);\n })\n )\n );\n }\n const Animation = {\n in: animate$2,\n out(element, animation, duration, origin) {\n return animate$2(element, animation, duration, origin, true);\n },\n inProgress(element) {\n return hasClass(element, clsAnimation);\n },\n cancel(element) {\n trigger(element, animationCanceled);\n }\n };\n\n function ready(fn) {\n if (document.readyState !== \"loading\") {\n fn();\n return;\n }\n once(document, \"DOMContentLoaded\", fn);\n }\n function isTag(element, ...tagNames) {\n return tagNames.some((tagName) => {\n var _a;\n return ((_a = element == null ? void 0 : element.tagName) == null ? void 0 : _a.toLowerCase()) === tagName.toLowerCase();\n });\n }\n function empty(element) {\n element = $(element);\n element.innerHTML = \"\";\n return element;\n }\n function html(parent2, html2) {\n return isUndefined(html2) ? $(parent2).innerHTML : append(empty(parent2), html2);\n }\n const prepend = applyFn(\"prepend\");\n const append = applyFn(\"append\");\n const before = applyFn(\"before\");\n const after = applyFn(\"after\");\n function applyFn(fn) {\n return function(ref, element) {\n var _a;\n const nodes = toNodes(isString(element) ? fragment(element) : element);\n (_a = $(ref)) == null ? void 0 : _a[fn](...nodes);\n return unwrapSingle(nodes);\n };\n }\n function remove$1(element) {\n toNodes(element).forEach((element2) => element2.remove());\n }\n function wrapAll(element, structure) {\n structure = toNode(before(element, structure));\n while (structure.firstElementChild) {\n structure = structure.firstElementChild;\n }\n append(structure, element);\n return structure;\n }\n function wrapInner(element, structure) {\n return toNodes(\n toNodes(element).map(\n (element2) => element2.hasChildNodes() ? wrapAll(toArray(element2.childNodes), structure) : append(element2, structure)\n )\n );\n }\n function unwrap(element) {\n toNodes(element).map(parent).filter((value, index, self) => self.indexOf(value) === index).forEach((parent2) => parent2.replaceWith(...parent2.childNodes));\n }\n const singleTagRe = /^<(\\w+)\\s*\\/?>(?:<\\/\\1>)?$/;\n function fragment(html2) {\n const matches = singleTagRe.exec(html2);\n if (matches) {\n return document.createElement(matches[1]);\n }\n const container = document.createElement(\"template\");\n container.innerHTML = html2.trim();\n return unwrapSingle(container.content.childNodes);\n }\n function unwrapSingle(nodes) {\n return nodes.length > 1 ? nodes : nodes[0];\n }\n function apply(node, fn) {\n if (!isElement(node)) {\n return;\n }\n fn(node);\n node = node.firstElementChild;\n while (node) {\n const next = node.nextElementSibling;\n apply(node, fn);\n node = next;\n }\n }\n function $(selector, context) {\n return isHtml(selector) ? toNode(fragment(selector)) : find(selector, context);\n }\n function $$(selector, context) {\n return isHtml(selector) ? toNodes(fragment(selector)) : findAll(selector, context);\n }\n function isHtml(str) {\n return isString(str) && startsWith(str.trim(), \"<\");\n }\n\n const dirs$1 = {\n width: [\"left\", \"right\"],\n height: [\"top\", \"bottom\"]\n };\n function dimensions$1(element) {\n const rect = isElement(element) ? toNode(element).getBoundingClientRect() : { height: height(element), width: width(element), top: 0, left: 0 };\n return {\n height: rect.height,\n width: rect.width,\n top: rect.top,\n left: rect.left,\n bottom: rect.top + rect.height,\n right: rect.left + rect.width\n };\n }\n function offset(element, coordinates) {\n if (coordinates) {\n css(element, { left: 0, top: 0 });\n }\n const currentOffset = dimensions$1(element);\n if (element) {\n const { scrollY, scrollX } = toWindow(element);\n const offsetBy = { height: scrollY, width: scrollX };\n for (const dir in dirs$1) {\n for (const prop of dirs$1[dir]) {\n currentOffset[prop] += offsetBy[dir];\n }\n }\n }\n if (!coordinates) {\n return currentOffset;\n }\n for (const prop of [\"left\", \"top\"]) {\n css(element, prop, coordinates[prop] - currentOffset[prop]);\n }\n }\n function position(element) {\n let { top, left } = offset(element);\n const {\n ownerDocument: { body, documentElement },\n offsetParent\n } = toNode(element);\n let parent = offsetParent || documentElement;\n while (parent && (parent === body || parent === documentElement) && css(parent, \"position\") === \"static\") {\n parent = parent.parentNode;\n }\n if (isElement(parent)) {\n const parentOffset = offset(parent);\n top -= parentOffset.top + toFloat(css(parent, \"borderTopWidth\"));\n left -= parentOffset.left + toFloat(css(parent, \"borderLeftWidth\"));\n }\n return {\n top: top - toFloat(css(element, \"marginTop\")),\n left: left - toFloat(css(element, \"marginLeft\"))\n };\n }\n function offsetPosition(element) {\n element = toNode(element);\n const offset2 = [element.offsetTop, element.offsetLeft];\n while (element = element.offsetParent) {\n offset2[0] += element.offsetTop + toFloat(css(element, `borderTopWidth`));\n offset2[1] += element.offsetLeft + toFloat(css(element, `borderLeftWidth`));\n if (css(element, \"position\") === \"fixed\") {\n const win = toWindow(element);\n offset2[0] += win.scrollY;\n offset2[1] += win.scrollX;\n return offset2;\n }\n }\n return offset2;\n }\n const height = dimension(\"height\");\n const width = dimension(\"width\");\n function dimension(prop) {\n const propName = ucfirst(prop);\n return (element, value) => {\n if (isUndefined(value)) {\n if (isWindow(element)) {\n return element[`inner${propName}`];\n }\n if (isDocument(element)) {\n const doc = element.documentElement;\n return Math.max(doc[`offset${propName}`], doc[`scroll${propName}`]);\n }\n element = toNode(element);\n value = css(element, prop);\n value = value === \"auto\" ? element[`offset${propName}`] : toFloat(value) || 0;\n return value - boxModelAdjust(element, prop);\n } else {\n return css(\n element,\n prop,\n !value && value !== 0 ? \"\" : +value + boxModelAdjust(element, prop) + \"px\"\n );\n }\n };\n }\n function boxModelAdjust(element, prop, sizing = \"border-box\") {\n return css(element, \"boxSizing\") === sizing ? sumBy(\n dirs$1[prop].map(ucfirst),\n (prop2) => toFloat(css(element, `padding${prop2}`)) + toFloat(css(element, `border${prop2}Width`))\n ) : 0;\n }\n function flipPosition(pos) {\n for (const dir in dirs$1) {\n for (const i in dirs$1[dir]) {\n if (dirs$1[dir][i] === pos) {\n return dirs$1[dir][1 - i];\n }\n }\n }\n return pos;\n }\n function toPx(value, property = \"width\", element = window, offsetDim = false) {\n if (!isString(value)) {\n return toFloat(value);\n }\n return sumBy(parseCalc(value), (value2) => {\n const unit = parseUnit(value2);\n return unit ? percent(\n unit === \"vh\" ? getViewportHeight() : unit === \"vw\" ? width(toWindow(element)) : offsetDim ? element[`offset${ucfirst(property)}`] : dimensions$1(element)[property],\n value2\n ) : value2;\n });\n }\n const calcRe = /-?\\d+(?:\\.\\d+)?(?:v[wh]|%|px)?/g;\n const parseCalc = memoize((calc) => calc.toString().replace(/\\s/g, \"\").match(calcRe) || []);\n const unitRe$1 = /(?:v[hw]|%)$/;\n const parseUnit = memoize((str) => (str.match(unitRe$1) || [])[0]);\n function percent(base, value) {\n return base * toFloat(value) / 100;\n }\n let vh;\n let vhEl;\n function getViewportHeight() {\n if (vh) {\n return vh;\n }\n if (!vhEl) {\n vhEl = $(\"
    \");\n css(vhEl, {\n height: \"100vh\",\n position: \"fixed\"\n });\n on(window, \"resize\", () => vh = null);\n }\n append(document.body, vhEl);\n vh = vhEl.clientHeight;\n remove$1(vhEl);\n return vh;\n }\n\n const fastdom = { read, write, clear, flush };\n const reads = [];\n const writes = [];\n function read(task) {\n reads.push(task);\n scheduleFlush();\n return task;\n }\n function write(task) {\n writes.push(task);\n scheduleFlush();\n return task;\n }\n function clear(task) {\n remove(reads, task);\n remove(writes, task);\n }\n let scheduled = false;\n function flush() {\n runTasks(reads);\n runTasks(writes.splice(0));\n scheduled = false;\n if (reads.length || writes.length) {\n scheduleFlush();\n }\n }\n function scheduleFlush() {\n if (!scheduled) {\n scheduled = true;\n queueMicrotask(flush);\n }\n }\n function runTasks(tasks) {\n let task;\n while (task = tasks.shift()) {\n try {\n task();\n } catch (e) {\n console.error(e);\n }\n }\n }\n function remove(array, item) {\n const index = array.indexOf(item);\n return ~index && array.splice(index, 1);\n }\n\n class MouseTracker {\n init() {\n this.positions = [];\n let position;\n this.unbind = on(document, \"mousemove\", (e) => position = getEventPos(e));\n this.interval = setInterval(() => {\n if (!position) {\n return;\n }\n this.positions.push(position);\n if (this.positions.length > 5) {\n this.positions.shift();\n }\n }, 50);\n }\n cancel() {\n var _a;\n (_a = this.unbind) == null ? void 0 : _a.call(this);\n clearInterval(this.interval);\n }\n movesTo(target) {\n if (!this.positions || this.positions.length < 2) {\n return false;\n }\n const p = dimensions$1(target);\n const { left, right, top, bottom } = p;\n const [prevPosition] = this.positions;\n const position = last(this.positions);\n const path = [prevPosition, position];\n if (pointInRect(position, p)) {\n return false;\n }\n const diagonals = [\n [\n { x: left, y: top },\n { x: right, y: bottom }\n ],\n [\n { x: left, y: bottom },\n { x: right, y: top }\n ]\n ];\n return diagonals.some((diagonal) => {\n const intersection = intersect(path, diagonal);\n return intersection && pointInRect(intersection, p);\n });\n }\n }\n function intersect([{ x: x1, y: y1 }, { x: x2, y: y2 }], [{ x: x3, y: y3 }, { x: x4, y: y4 }]) {\n const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n if (denominator === 0) {\n return false;\n }\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n if (ua < 0) {\n return false;\n }\n return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };\n }\n\n function observeIntersection(targets, cb, options = {}, { intersecting = true } = {}) {\n const observer = new IntersectionObserver(\n intersecting ? (entries, observer2) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n cb(entries, observer2);\n }\n } : cb,\n options\n );\n for (const el of toNodes(targets)) {\n observer.observe(el);\n }\n return observer;\n }\n const hasResizeObserver = inBrowser && window.ResizeObserver;\n function observeResize(targets, cb, options = { box: \"border-box\" }) {\n if (hasResizeObserver) {\n return observe$1(ResizeObserver, targets, cb, options);\n }\n const off = [on(window, \"load resize\", cb), on(document, \"loadedmetadata load\", cb, true)];\n return { disconnect: () => off.map((cb2) => cb2()) };\n }\n function observeViewportResize(cb) {\n return { disconnect: on([window, window.visualViewport], \"resize\", cb) };\n }\n function observeMutation(targets, cb, options) {\n return observe$1(MutationObserver, targets, cb, options);\n }\n function observe$1(Observer, targets, cb, options) {\n const observer = new Observer(cb);\n for (const el of toNodes(targets)) {\n observer.observe(el, options);\n }\n return observer;\n }\n\n function play(el) {\n if (isIFrame(el)) {\n call(el, { func: \"playVideo\", method: \"play\" });\n }\n if (isHTML5(el)) {\n el.play();\n }\n }\n function pause(el) {\n if (isIFrame(el)) {\n call(el, { func: \"pauseVideo\", method: \"pause\" });\n }\n if (isHTML5(el)) {\n el.pause();\n }\n }\n function mute(el) {\n if (isIFrame(el)) {\n call(el, { func: \"mute\", method: \"setVolume\", value: 0 });\n }\n if (isHTML5(el)) {\n el.muted = true;\n }\n }\n function isVideo(el) {\n return isHTML5(el) || isIFrame(el);\n }\n function isHTML5(el) {\n return isTag(el, \"video\");\n }\n function isIFrame(el) {\n return isTag(el, \"iframe\") && (isYoutube(el) || isVimeo(el));\n }\n function isYoutube(el) {\n return !!el.src.match(\n /\\/\\/.*?youtube(-nocookie)?\\.[a-z]+\\/(watch\\?v=[^&\\s]+|embed)|youtu\\.be\\/.*/\n );\n }\n function isVimeo(el) {\n return !!el.src.match(/vimeo\\.com\\/video\\/.*/);\n }\n async function call(el, cmd) {\n await enableApi(el);\n post(el, cmd);\n }\n function post(el, cmd) {\n el.contentWindow.postMessage(JSON.stringify({ event: \"command\", ...cmd }), \"*\");\n }\n const stateKey = \"_ukPlayer\";\n let counter = 0;\n function enableApi(el) {\n if (el[stateKey]) {\n return el[stateKey];\n }\n const youtube = isYoutube(el);\n const vimeo = isVimeo(el);\n const id = ++counter;\n let poller;\n return el[stateKey] = new Promise((resolve) => {\n youtube && once(el, \"load\", () => {\n const listener = () => post(el, { event: \"listening\", id });\n poller = setInterval(listener, 100);\n listener();\n });\n once(window, \"message\", resolve, false, ({ data }) => {\n try {\n data = JSON.parse(data);\n return youtube && (data == null ? void 0 : data.id) === id && data.event === \"onReady\" || vimeo && Number(data == null ? void 0 : data.player_id) === id;\n } catch (e) {\n }\n });\n el.src = `${el.src}${includes(el.src, \"?\") ? \"&\" : \"?\"}${youtube ? \"enablejsapi=1\" : `api=1&player_id=${id}`}`;\n }).then(() => clearInterval(poller));\n }\n\n function isInView(element, offsetTop = 0, offsetLeft = 0) {\n if (!isVisible(element)) {\n return false;\n }\n return intersectRect(\n ...overflowParents(element).map((parent2) => {\n const { top, left, bottom, right } = offsetViewport(parent2);\n return {\n top: top - offsetTop,\n left: left - offsetLeft,\n bottom: bottom + offsetTop,\n right: right + offsetLeft\n };\n }).concat(offset(element))\n );\n }\n function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {\n const parents2 = isVisible(element) ? scrollParents(element, false, [\"hidden\"]) : [];\n return parents2.reduce(\n (fn, scrollElement, i) => {\n const { scrollTop, scrollHeight, offsetHeight } = scrollElement;\n const viewport = offsetViewport(scrollElement);\n const maxScroll = scrollHeight - viewport.height;\n const { height: elHeight, top: elTop } = parents2[i - 1] ? offsetViewport(parents2[i - 1]) : offset(element);\n let top = Math.ceil(elTop - viewport.top - offsetBy + scrollTop);\n if (offsetBy > 0 && offsetHeight < elHeight + offsetBy) {\n top += offsetBy;\n } else {\n offsetBy = 0;\n }\n if (top > maxScroll) {\n offsetBy -= top - maxScroll;\n top = maxScroll;\n } else if (top < 0) {\n offsetBy -= top;\n top = 0;\n }\n return () => scrollTo(scrollElement, top - scrollTop, element, maxScroll).then(fn);\n },\n () => Promise.resolve()\n )();\n function scrollTo(element2, top, targetEl, maxScroll) {\n return new Promise((resolve) => {\n const scroll = element2.scrollTop;\n const duration = getDuration(Math.abs(top));\n const start = Date.now();\n const isScrollingElement = scrollingElement(element2) === element2;\n const targetTop = offset(targetEl).top + (isScrollingElement ? 0 : scroll);\n let prev = 0;\n let frames = 15;\n (function step() {\n const percent = ease(clamp((Date.now() - start) / duration));\n let diff = 0;\n if (parents2[0] === element2 && scroll + top < maxScroll) {\n diff = offset(targetEl).top + (isScrollingElement ? 0 : element2.scrollTop) - targetTop - dimensions$1(getCoveringElement(targetEl)).height;\n }\n element2.scrollTop = scroll + (top + diff) * percent;\n if (percent === 1 && (prev === diff || !frames--)) {\n resolve();\n } else {\n prev = diff;\n requestAnimationFrame(step);\n }\n })();\n });\n }\n function getDuration(dist) {\n return 40 * Math.pow(dist, 0.375);\n }\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n }\n function scrolledOver(element, startOffset = 0, endOffset = 0) {\n if (!isVisible(element)) {\n return 0;\n }\n const scrollElement = scrollParent(element, true);\n const { scrollHeight, scrollTop } = scrollElement;\n const { height: viewportHeight } = offsetViewport(scrollElement);\n const maxScroll = scrollHeight - viewportHeight;\n const elementOffsetTop = offsetPosition(element)[0] - offsetPosition(scrollElement)[0];\n const start = Math.max(0, elementOffsetTop - viewportHeight + startOffset);\n const end = Math.min(maxScroll, elementOffsetTop + element.offsetHeight - endOffset);\n return start < end ? clamp((scrollTop - start) / (end - start)) : 1;\n }\n function scrollParents(element, scrollable = false, props = []) {\n const scrollEl = scrollingElement(element);\n let ancestors = parents(element).reverse();\n ancestors = ancestors.slice(ancestors.indexOf(scrollEl) + 1);\n const fixedIndex = findIndex(ancestors, (el) => css(el, \"position\") === \"fixed\");\n if (~fixedIndex) {\n ancestors = ancestors.slice(fixedIndex);\n }\n return [scrollEl].concat(\n ancestors.filter(\n (parent2) => css(parent2, \"overflow\").split(\" \").some((prop) => includes([\"auto\", \"scroll\", ...props], prop)) && (!scrollable || parent2.scrollHeight > offsetViewport(parent2).height)\n )\n ).reverse();\n }\n function scrollParent(...args) {\n return scrollParents(...args)[0];\n }\n function overflowParents(element) {\n return scrollParents(element, false, [\"hidden\", \"clip\"]);\n }\n function offsetViewport(scrollElement) {\n const window = toWindow(scrollElement);\n let viewportElement = scrollElement === scrollingElement(scrollElement) ? window : scrollElement;\n if (isWindow(viewportElement) && window.visualViewport) {\n let { height, width, scale, pageTop: top, pageLeft: left } = window.visualViewport;\n height = Math.round(height * scale);\n width = Math.round(width * scale);\n return { height, width, top, left, bottom: top + height, right: left + width };\n }\n let rect = offset(viewportElement);\n if (css(viewportElement, \"display\") === \"inline\") {\n return rect;\n }\n for (let [prop, dir, start, end] of [\n [\"width\", \"x\", \"left\", \"right\"],\n [\"height\", \"y\", \"top\", \"bottom\"]\n ]) {\n if (isWindow(viewportElement)) {\n viewportElement = viewportElement.document;\n } else {\n rect[start] += toFloat(css(viewportElement, `border-${start}-width`));\n }\n const subpixel = rect[prop] % 1;\n rect[prop] = rect[dir] = viewportElement[`client${ucfirst(prop)}`] - (subpixel ? subpixel < 0.5 ? -subpixel : 1 - subpixel : 0);\n rect[end] = rect[prop] + rect[start];\n }\n return rect;\n }\n function getCoveringElement(target) {\n const { left, width, top } = dimensions$1(target);\n for (const position of top ? [0, top] : [0]) {\n let coverEl;\n for (const el of toWindow(target).document.elementsFromPoint(left + width / 2, position)) {\n if (!el.contains(target) && // If e.g. Offcanvas is not yet closed\n !hasClass(el, \"uk-togglable-leave\") && (hasPosition(el, \"fixed\") && zIndex(\n parents(target).reverse().find(\n (parent2) => !parent2.contains(el) && !hasPosition(parent2, \"static\")\n )\n ) < zIndex(el) || hasPosition(el, \"sticky\") && parent(el).contains(target)) && (!coverEl || dimensions$1(coverEl).height < dimensions$1(el).height)) {\n coverEl = el;\n }\n }\n if (coverEl) {\n return coverEl;\n }\n }\n }\n function zIndex(element) {\n return toFloat(css(element, \"zIndex\"));\n }\n function hasPosition(element, position) {\n return css(element, \"position\") === position;\n }\n function scrollingElement(element) {\n return toWindow(element).document.scrollingElement;\n }\n\n const dirs = [\n [\"width\", \"x\", \"left\", \"right\"],\n [\"height\", \"y\", \"top\", \"bottom\"]\n ];\n function positionAt(element, target, options) {\n options = {\n attach: {\n element: [\"left\", \"top\"],\n target: [\"left\", \"top\"],\n ...options.attach\n },\n offset: [0, 0],\n placement: [],\n ...options\n };\n if (!isArray(target)) {\n target = [target, target];\n }\n offset(element, getPosition(element, target, options));\n }\n function getPosition(element, target, options) {\n const position = attachTo(element, target, options);\n const { boundary, viewportOffset = 0, placement } = options;\n let offsetPosition = position;\n for (const [i, [prop, , start, end]] of Object.entries(dirs)) {\n const viewport = getViewport$2(element, target[i], viewportOffset, boundary, i);\n if (isWithin(position, viewport, i)) {\n continue;\n }\n let offsetBy = 0;\n if (placement[i] === \"flip\") {\n const attach = options.attach.target[i];\n if (attach === end && position[end] <= viewport[end] || attach === start && position[start] >= viewport[start]) {\n continue;\n }\n offsetBy = flip(element, target, options, i)[start] - position[start];\n const scrollArea = getScrollArea(element, target[i], viewportOffset, i);\n if (!isWithin(applyOffset(position, offsetBy, i), scrollArea, i)) {\n if (isWithin(position, scrollArea, i)) {\n continue;\n }\n if (options.recursion) {\n return false;\n }\n const newPos = flipAxis(element, target, options);\n if (newPos && isWithin(newPos, scrollArea, 1 - i)) {\n return newPos;\n }\n continue;\n }\n } else if (placement[i] === \"shift\") {\n const targetDim = offset(target[i]);\n const { offset: elOffset } = options;\n offsetBy = clamp(\n clamp(position[start], viewport[start], viewport[end] - position[prop]),\n targetDim[start] - position[prop] + elOffset[i],\n targetDim[end] - elOffset[i]\n ) - position[start];\n }\n offsetPosition = applyOffset(offsetPosition, offsetBy, i);\n }\n return offsetPosition;\n }\n function attachTo(element, target, options) {\n let { attach, offset: offsetBy } = {\n attach: {\n element: [\"left\", \"top\"],\n target: [\"left\", \"top\"],\n ...options.attach\n },\n offset: [0, 0],\n ...options\n };\n let elOffset = offset(element);\n for (const [i, [prop, , start, end]] of Object.entries(dirs)) {\n const targetOffset = attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);\n elOffset = applyOffset(\n elOffset,\n targetOffset[start] - elOffset[start] + moveBy(attach.target[i], end, targetOffset[prop]) - moveBy(attach.element[i], end, elOffset[prop]) + +offsetBy[i],\n i\n );\n }\n return elOffset;\n }\n function applyOffset(position, offset2, i) {\n const [, dir, start, end] = dirs[i];\n const newPos = { ...position };\n newPos[start] = position[dir] = position[start] + offset2;\n newPos[end] += offset2;\n return newPos;\n }\n function moveBy(attach, end, dim) {\n return attach === \"center\" ? dim / 2 : attach === end ? dim : 0;\n }\n function getViewport$2(element, target, viewportOffset, boundary, i) {\n let viewport = getIntersectionArea(...commonScrollParents(element, target).map(offsetViewport));\n if (viewportOffset) {\n viewport[dirs[i][2]] += viewportOffset;\n viewport[dirs[i][3]] -= viewportOffset;\n }\n if (boundary) {\n viewport = getIntersectionArea(\n viewport,\n offset(isArray(boundary) ? boundary[i] : boundary)\n );\n }\n return viewport;\n }\n function getScrollArea(element, target, viewportOffset, i) {\n const [prop, axis, start, end] = dirs[i];\n const [scrollElement] = commonScrollParents(element, target);\n const viewport = offsetViewport(scrollElement);\n if ([\"auto\", \"scroll\"].includes(css(scrollElement, `overflow-${axis}`))) {\n viewport[start] -= scrollElement[`scroll${ucfirst(start)}`];\n viewport[end] = viewport[start] + scrollElement[`scroll${ucfirst(prop)}`];\n }\n viewport[start] += viewportOffset;\n viewport[end] -= viewportOffset;\n return viewport;\n }\n function commonScrollParents(element, target) {\n return overflowParents(target).filter((parent) => parent.contains(element));\n }\n function getIntersectionArea(...rects) {\n let area = {};\n for (const rect of rects) {\n for (const [, , start, end] of dirs) {\n area[start] = Math.max(area[start] || 0, rect[start]);\n area[end] = Math.min(...[area[end], rect[end]].filter(Boolean));\n }\n }\n return area;\n }\n function isWithin(positionA, positionB, i) {\n const [, , start, end] = dirs[i];\n return positionA[start] >= positionB[start] && positionA[end] <= positionB[end];\n }\n function flip(element, target, { offset: offset2, attach }, i) {\n return attachTo(element, target, {\n attach: {\n element: flipAttach(attach.element, i),\n target: flipAttach(attach.target, i)\n },\n offset: flipOffset(offset2, i)\n });\n }\n function flipAxis(element, target, options) {\n return getPosition(element, target, {\n ...options,\n attach: {\n element: options.attach.element.map(flipAttachAxis).reverse(),\n target: options.attach.target.map(flipAttachAxis).reverse()\n },\n offset: options.offset.reverse(),\n placement: options.placement.reverse(),\n recursion: true\n });\n }\n function flipAttach(attach, i) {\n const newAttach = [...attach];\n const index = dirs[i].indexOf(attach[i]);\n if (~index) {\n newAttach[i] = dirs[i][1 - index % 2 + 2];\n }\n return newAttach;\n }\n function flipAttachAxis(prop) {\n for (let i = 0; i < dirs.length; i++) {\n const index = dirs[i].indexOf(prop);\n if (~index) {\n return dirs[1 - i][index % 2 + 2];\n }\n }\n }\n function flipOffset(offset2, i) {\n offset2 = [...offset2];\n offset2[i] *= -1;\n return offset2;\n }\n\n var util = /*#__PURE__*/Object.freeze({\n __proto__: null,\n $: $,\n $$: $$,\n Animation: Animation,\n Dimensions: Dimensions,\n MouseTracker: MouseTracker,\n Transition: Transition,\n addClass: addClass,\n after: after,\n append: append,\n apply: apply,\n assign: assign,\n attr: attr,\n before: before,\n boxModelAdjust: boxModelAdjust,\n camelize: camelize,\n children: children,\n clamp: clamp,\n createEvent: createEvent,\n css: css,\n data: data,\n dimensions: dimensions$1,\n each: each,\n empty: empty,\n endsWith: endsWith,\n escape: escape,\n fastdom: fastdom,\n filter: filter$1,\n find: find,\n findAll: findAll,\n findIndex: findIndex,\n flipPosition: flipPosition,\n fragment: fragment,\n getCoveringElement: getCoveringElement,\n getEventPos: getEventPos,\n getIndex: getIndex,\n getTargetedElement: getTargetedElement,\n hasAttr: hasAttr,\n hasClass: hasClass,\n hasOwn: hasOwn,\n hasTouch: hasTouch,\n height: height,\n html: html,\n hyphenate: hyphenate,\n inBrowser: inBrowser,\n includes: includes,\n index: index,\n intersectRect: intersectRect,\n isArray: isArray,\n isBoolean: isBoolean,\n isDocument: isDocument,\n isElement: isElement,\n isEmpty: isEmpty,\n isEqual: isEqual,\n isFocusable: isFocusable,\n isFunction: isFunction,\n isInView: isInView,\n isInput: isInput,\n isNode: isNode,\n isNumber: isNumber,\n isNumeric: isNumeric,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isRtl: isRtl,\n isSameSiteAnchor: isSameSiteAnchor,\n isString: isString,\n isTag: isTag,\n isTouch: isTouch,\n isUndefined: isUndefined,\n isVideo: isVideo,\n isVisible: isVisible,\n isVoidElement: isVoidElement,\n isWindow: isWindow,\n last: last,\n matches: matches,\n memoize: memoize,\n mute: mute,\n noop: noop,\n observeIntersection: observeIntersection,\n observeMutation: observeMutation,\n observeResize: observeResize,\n observeViewportResize: observeViewportResize,\n off: off,\n offset: offset,\n offsetPosition: offsetPosition,\n offsetViewport: offsetViewport,\n on: on,\n once: once,\n overflowParents: overflowParents,\n parent: parent,\n parents: parents,\n pause: pause,\n pick: pick,\n play: play,\n pointInRect: pointInRect,\n pointerCancel: pointerCancel,\n pointerDown: pointerDown$1,\n pointerEnter: pointerEnter,\n pointerLeave: pointerLeave,\n pointerMove: pointerMove$1,\n pointerUp: pointerUp$1,\n position: position,\n positionAt: positionAt,\n prepend: prepend,\n propName: propName,\n query: query,\n queryAll: queryAll,\n ready: ready,\n remove: remove$1,\n removeAttr: removeAttr,\n removeClass: removeClass,\n replaceClass: replaceClass,\n scrollIntoView: scrollIntoView,\n scrollParent: scrollParent,\n scrollParents: scrollParents,\n scrolledOver: scrolledOver,\n selFocusable: selFocusable,\n selInput: selInput,\n sortBy: sortBy,\n startsWith: startsWith,\n sumBy: sumBy,\n swap: swap,\n toArray: toArray,\n toBoolean: toBoolean,\n toEventTargets: toEventTargets,\n toFloat: toFloat,\n toNode: toNode,\n toNodes: toNodes,\n toNumber: toNumber,\n toPx: toPx,\n toWindow: toWindow,\n toggleClass: toggleClass,\n trigger: trigger,\n ucfirst: ucfirst,\n uniqueBy: uniqueBy,\n unwrap: unwrap,\n width: width,\n wrapAll: wrapAll,\n wrapInner: wrapInner\n });\n\n var Class = {\n connected() {\n addClass(this.$el, this.$options.id);\n }\n };\n\n const units = [\"days\", \"hours\", \"minutes\", \"seconds\"];\n var countdown = {\n mixins: [Class],\n props: {\n date: String,\n clsWrapper: String,\n role: String\n },\n data: {\n date: \"\",\n clsWrapper: \".uk-countdown-%unit%\",\n role: \"timer\"\n },\n connected() {\n attr(this.$el, \"role\", this.role);\n this.date = toFloat(Date.parse(this.$props.date));\n this.end = false;\n this.start();\n },\n disconnected() {\n this.stop();\n },\n events: {\n name: \"visibilitychange\",\n el: () => document,\n handler() {\n if (document.hidden) {\n this.stop();\n } else {\n this.start();\n }\n }\n },\n methods: {\n start() {\n this.stop();\n this.update();\n if (!this.timer) {\n trigger(this.$el, \"countdownstart\");\n this.timer = setInterval(this.update, 1e3);\n }\n },\n stop() {\n if (this.timer) {\n clearInterval(this.timer);\n trigger(this.$el, \"countdownstop\");\n this.timer = null;\n }\n },\n update() {\n const timespan = getTimeSpan(this.date);\n if (!timespan.total) {\n this.stop();\n if (!this.end) {\n trigger(this.$el, \"countdownend\");\n this.end = true;\n }\n }\n for (const unit of units) {\n const el = $(this.clsWrapper.replace(\"%unit%\", unit), this.$el);\n if (!el) {\n continue;\n }\n let digits = Math.trunc(timespan[unit]).toString().padStart(2, \"0\");\n if (el.textContent !== digits) {\n digits = digits.split(\"\");\n if (digits.length !== el.children.length) {\n html(el, digits.map(() => \"\").join(\"\"));\n }\n digits.forEach((digit, i) => el.children[i].textContent = digit);\n }\n }\n }\n }\n };\n function getTimeSpan(date) {\n const total = Math.max(0, date - Date.now()) / 1e3;\n return {\n total,\n seconds: total % 60,\n minutes: total / 60 % 60,\n hours: total / 60 / 60 % 24,\n days: total / 60 / 60 / 24\n };\n }\n\n const strats = {};\n strats.events = strats.watch = strats.observe = strats.created = strats.beforeConnect = strats.connected = strats.beforeDisconnect = strats.disconnected = strats.destroy = concatStrat;\n strats.args = function(parentVal, childVal) {\n return childVal !== false && concatStrat(childVal || parentVal);\n };\n strats.update = function(parentVal, childVal) {\n return sortBy(\n concatStrat(parentVal, isFunction(childVal) ? { read: childVal } : childVal),\n \"order\"\n );\n };\n strats.props = function(parentVal, childVal) {\n if (isArray(childVal)) {\n const value = {};\n for (const key of childVal) {\n value[key] = String;\n }\n childVal = value;\n }\n return strats.methods(parentVal, childVal);\n };\n strats.computed = strats.methods = function(parentVal, childVal) {\n return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;\n };\n strats.i18n = strats.data = function(parentVal, childVal, vm) {\n if (!vm) {\n if (!childVal) {\n return parentVal;\n }\n if (!parentVal) {\n return childVal;\n }\n return function(vm2) {\n return mergeFnData(parentVal, childVal, vm2);\n };\n }\n return mergeFnData(parentVal, childVal, vm);\n };\n function mergeFnData(parentVal, childVal, vm) {\n return strats.computed(\n isFunction(parentVal) ? parentVal.call(vm, vm) : parentVal,\n isFunction(childVal) ? childVal.call(vm, vm) : childVal\n );\n }\n function concatStrat(parentVal, childVal) {\n parentVal = parentVal && !isArray(parentVal) ? [parentVal] : parentVal;\n return childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;\n }\n function defaultStrat(parentVal, childVal) {\n return isUndefined(childVal) ? parentVal : childVal;\n }\n function mergeOptions(parent, child, vm) {\n const options = {};\n if (isFunction(child)) {\n child = child.options;\n }\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n if (child.mixins) {\n for (const mixin of child.mixins) {\n parent = mergeOptions(parent, mixin, vm);\n }\n }\n for (const key in parent) {\n mergeKey(key);\n }\n for (const key in child) {\n if (!hasOwn(parent, key)) {\n mergeKey(key);\n }\n }\n function mergeKey(key) {\n options[key] = (strats[key] || defaultStrat)(parent[key], child[key], vm);\n }\n return options;\n }\n function parseOptions(options, args = []) {\n try {\n return options ? startsWith(options, \"{\") ? JSON.parse(options) : args.length && !includes(options, \":\") ? { [args[0]]: options } : options.split(\";\").reduce((options2, option) => {\n const [key, value] = option.split(/:(.*)/);\n if (key && !isUndefined(value)) {\n options2[key.trim()] = value.trim();\n }\n return options2;\n }, {}) : {};\n } catch (e) {\n return {};\n }\n }\n function coerce$1(type, value) {\n if (type === Boolean) {\n return toBoolean(value);\n } else if (type === Number) {\n return toNumber(value);\n } else if (type === \"list\") {\n return toList(value);\n } else if (type === Object && isString(value)) {\n return parseOptions(value);\n }\n return type ? type(value) : value;\n }\n const listRe = /,(?![^(]*\\))/;\n function toList(value) {\n return isArray(value) ? value : isString(value) ? value.split(listRe).map((value2) => isNumeric(value2) ? toNumber(value2) : toBoolean(value2.trim())) : [value];\n }\n\n function initUpdates(instance) {\n instance._data = {};\n instance._updates = [...instance.$options.update || []];\n }\n function prependUpdate(instance, update) {\n instance._updates.unshift(update);\n }\n function clearUpdateData(instance) {\n instance._data = null;\n }\n function callUpdate(instance, e = \"update\") {\n if (!instance._connected) {\n return;\n }\n if (!instance._updates.length) {\n return;\n }\n if (!instance._queued) {\n instance._queued = /* @__PURE__ */ new Set();\n fastdom.read(() => {\n if (instance._connected) {\n runUpdates(instance, instance._queued);\n }\n instance._queued = null;\n });\n }\n instance._queued.add(e.type || e);\n }\n function runUpdates(instance, types) {\n for (const { read, write, events = [] } of instance._updates) {\n if (!types.has(\"update\") && !events.some((type) => types.has(type))) {\n continue;\n }\n let result;\n if (read) {\n result = read.call(instance, instance._data, types);\n if (result && isPlainObject(result)) {\n assign(instance._data, result);\n }\n }\n if (write && result !== false) {\n fastdom.write(() => {\n if (instance._connected) {\n write.call(instance, instance._data, types);\n }\n });\n }\n }\n }\n\n function resize(options) {\n return observe(observeResize, options, \"resize\");\n }\n function intersection(options) {\n return observe(observeIntersection, options);\n }\n function mutation(options) {\n return observe(observeMutation, options);\n }\n function lazyload(options = {}) {\n return intersection({\n handler: function(entries, observer) {\n const { targets = this.$el, preload = 5 } = options;\n for (const el of toNodes(isFunction(targets) ? targets(this) : targets)) {\n $$('[loading=\"lazy\"]', el).slice(0, preload - 1).forEach((el2) => removeAttr(el2, \"loading\"));\n }\n for (const el of entries.filter(({ isIntersecting }) => isIntersecting).map(({ target }) => target)) {\n observer.unobserve(el);\n }\n },\n ...options\n });\n }\n function viewport(options) {\n return observe((target, handler) => observeViewportResize(handler), options, \"resize\");\n }\n function scroll$1(options) {\n return observe(\n (target, handler) => ({\n disconnect: on(toScrollTargets(target), \"scroll\", handler, { passive: true })\n }),\n options,\n \"scroll\"\n );\n }\n function swipe(options) {\n return {\n observe(target, handler) {\n return {\n observe: noop,\n unobserve: noop,\n disconnect: on(target, pointerDown$1, handler, { passive: true })\n };\n },\n handler(e) {\n if (!isTouch(e)) {\n return;\n }\n const pos = getEventPos(e);\n const target = \"tagName\" in e.target ? e.target : parent(e.target);\n once(document, `${pointerUp$1} ${pointerCancel} scroll`, (e2) => {\n const { x, y } = getEventPos(e2);\n if (e2.type !== \"scroll\" && target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {\n setTimeout(() => {\n trigger(target, \"swipe\");\n trigger(target, `swipe${swipeDirection(pos.x, pos.y, x, y)}`);\n });\n }\n });\n },\n ...options\n };\n }\n function observe(observe2, options, emit) {\n return {\n observe: observe2,\n handler() {\n callUpdate(this, emit);\n },\n ...options\n };\n }\n function swipeDirection(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? x1 - x2 > 0 ? \"Left\" : \"Right\" : y1 - y2 > 0 ? \"Up\" : \"Down\";\n }\n function toScrollTargets(elements) {\n return toNodes(elements).map((node) => {\n const { ownerDocument } = node;\n const parent2 = scrollParent(node, true);\n return parent2 === ownerDocument.scrollingElement ? ownerDocument : parent2;\n });\n }\n\n var Margin = {\n props: {\n margin: String,\n firstColumn: Boolean\n },\n data: {\n margin: \"uk-margin-small-top\",\n firstColumn: \"uk-first-column\"\n },\n observe: [\n mutation({\n options: {\n childList: true\n }\n }),\n mutation({\n options: {\n attributes: true,\n attributeFilter: [\"style\"]\n },\n target: ({ $el }) => [$el, ...children($el)]\n }),\n resize({\n target: ({ $el }) => [$el, ...children($el)]\n })\n ],\n update: {\n read() {\n return {\n rows: getRows(children(this.$el))\n };\n },\n write({ rows }) {\n for (const row of rows) {\n for (const el of row) {\n toggleClass(el, this.margin, rows[0] !== row);\n toggleClass(el, this.firstColumn, row[isRtl ? row.length - 1 : 0] === el);\n }\n }\n },\n events: [\"resize\"]\n }\n };\n function getRows(elements) {\n const sorted = [[]];\n const withOffset = elements.some(\n (el, i) => i && elements[i - 1].offsetParent !== el.offsetParent\n );\n for (const el of elements) {\n if (!isVisible(el)) {\n continue;\n }\n const offset = getOffset(el, withOffset);\n for (let i = sorted.length - 1; i >= 0; i--) {\n const current = sorted[i];\n if (!current[0]) {\n current.push(el);\n break;\n }\n const offsetCurrent = getOffset(current[0], withOffset);\n if (offset.top >= offsetCurrent.bottom - 1 && offset.top !== offsetCurrent.top) {\n sorted.push([el]);\n break;\n }\n if (offset.bottom - 1 > offsetCurrent.top || offset.top === offsetCurrent.top) {\n let j = current.length - 1;\n for (; j >= 0; j--) {\n const offsetCurrent2 = getOffset(current[j], withOffset);\n if (offset.left >= offsetCurrent2.left) {\n break;\n }\n }\n current.splice(j + 1, 0, el);\n break;\n }\n if (i === 0) {\n sorted.unshift([el]);\n break;\n }\n }\n }\n return sorted;\n }\n function getOffset(element, offset = false) {\n let { offsetTop, offsetLeft, offsetHeight, offsetWidth } = element;\n if (offset) {\n [offsetTop, offsetLeft] = offsetPosition(element);\n }\n return {\n top: offsetTop,\n left: offsetLeft,\n bottom: offsetTop + offsetHeight,\n right: offsetLeft + offsetWidth\n };\n }\n\n async function slide(action, target, duration) {\n await awaitFrame();\n let nodes = children(target);\n const currentProps = nodes.map((el) => getProps$1(el, true));\n const targetProps = { ...css(target, [\"height\", \"padding\"]), display: \"block\" };\n const targets = nodes.concat(target);\n await Promise.all(targets.map(Transition.cancel));\n css(targets, \"transitionProperty\", \"none\");\n await action();\n nodes = nodes.concat(children(target).filter((el) => !includes(nodes, el)));\n await Promise.resolve();\n css(targets, \"transitionProperty\", \"\");\n const targetStyle = attr(target, \"style\");\n const targetPropsTo = css(target, [\"height\", \"padding\"]);\n const [propsTo, propsFrom] = getTransitionProps(target, nodes, currentProps);\n const attrsTo = nodes.map((el) => ({ style: attr(el, \"style\") }));\n nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));\n css(target, targetProps);\n trigger(target, \"scroll\");\n await awaitFrame();\n const transitions = nodes.map((el, i) => parent(el) === target && Transition.start(el, propsTo[i], duration, \"ease\")).concat(Transition.start(target, targetPropsTo, duration, \"ease\"));\n try {\n await Promise.all(transitions);\n nodes.forEach((el, i) => {\n attr(el, attrsTo[i]);\n if (parent(el) === target) {\n css(el, \"display\", propsTo[i].opacity === 0 ? \"none\" : \"\");\n }\n });\n attr(target, \"style\", targetStyle);\n } catch (e) {\n attr(nodes, \"style\", \"\");\n resetProps(target, targetProps);\n }\n }\n function getProps$1(el, opacity) {\n const zIndex = css(el, \"zIndex\");\n return isVisible(el) ? {\n display: \"\",\n opacity: opacity ? css(el, \"opacity\") : \"0\",\n pointerEvents: \"none\",\n position: \"absolute\",\n zIndex: zIndex === \"auto\" ? index(el) : zIndex,\n ...getPositionWithMargin(el)\n } : false;\n }\n function getTransitionProps(target, nodes, currentProps) {\n const propsTo = nodes.map(\n (el, i) => parent(el) && i in currentProps ? currentProps[i] ? isVisible(el) ? getPositionWithMargin(el) : { opacity: 0 } : { opacity: isVisible(el) ? 1 : 0 } : false\n );\n const propsFrom = propsTo.map((props, i) => {\n const from = parent(nodes[i]) === target && (currentProps[i] || getProps$1(nodes[i]));\n if (!from) {\n return false;\n }\n if (!props) {\n delete from.opacity;\n } else if (!(\"opacity\" in props)) {\n const { opacity } = from;\n if (opacity % 1) {\n props.opacity = 1;\n } else {\n delete from.opacity;\n }\n }\n return from;\n });\n return [propsTo, propsFrom];\n }\n function resetProps(el, props) {\n for (const prop in props) {\n css(el, prop, \"\");\n }\n }\n function getPositionWithMargin(el) {\n const { height, width } = dimensions$1(el);\n return {\n height,\n width,\n transform: \"\",\n ...position(el),\n ...css(el, [\"marginTop\", \"marginLeft\"])\n };\n }\n function awaitFrame() {\n return new Promise((resolve) => requestAnimationFrame(resolve));\n }\n\n const clsLeave = \"uk-transition-leave\";\n const clsEnter = \"uk-transition-enter\";\n function fade(action, target, duration, stagger = 0) {\n const index = transitionIndex(target, true);\n const propsIn = { opacity: 1 };\n const propsOut = { opacity: 0 };\n const wrapIndexFn = (fn) => () => index === transitionIndex(target) ? fn() : Promise.reject();\n const leaveFn = wrapIndexFn(async () => {\n addClass(target, clsLeave);\n await Promise.all(\n getTransitionNodes(target).map(\n (child, i) => new Promise(\n (resolve) => setTimeout(\n () => Transition.start(child, propsOut, duration / 2, \"ease\").then(\n resolve\n ),\n i * stagger\n )\n )\n )\n );\n removeClass(target, clsLeave);\n });\n const enterFn = wrapIndexFn(async () => {\n const oldHeight = height(target);\n addClass(target, clsEnter);\n action();\n css(children(target), { opacity: 0 });\n await awaitFrame();\n const nodes = children(target);\n const newHeight = height(target);\n css(target, \"alignContent\", \"flex-start\");\n height(target, oldHeight);\n const transitionNodes = getTransitionNodes(target);\n css(nodes, propsOut);\n const transitions = transitionNodes.map(async (child, i) => {\n await awaitTimeout(i * stagger);\n await Transition.start(child, propsIn, duration / 2, \"ease\");\n });\n if (oldHeight !== newHeight) {\n transitions.push(\n Transition.start(\n target,\n { height: newHeight },\n duration / 2 + transitionNodes.length * stagger,\n \"ease\"\n )\n );\n }\n await Promise.all(transitions).then(() => {\n removeClass(target, clsEnter);\n if (index === transitionIndex(target)) {\n css(target, { height: \"\", alignContent: \"\" });\n css(nodes, { opacity: \"\" });\n delete target.dataset.transition;\n }\n });\n });\n return hasClass(target, clsLeave) ? waitTransitionend(target).then(enterFn) : hasClass(target, clsEnter) ? waitTransitionend(target).then(leaveFn).then(enterFn) : leaveFn().then(enterFn);\n }\n function transitionIndex(target, next) {\n if (next) {\n target.dataset.transition = 1 + transitionIndex(target);\n }\n return toNumber(target.dataset.transition) || 0;\n }\n function waitTransitionend(target) {\n return Promise.all(\n children(target).filter(Transition.inProgress).map(\n (el) => new Promise((resolve) => once(el, \"transitionend transitioncanceled\", resolve))\n )\n );\n }\n function getTransitionNodes(target) {\n return getRows(children(target)).flat().filter(isVisible);\n }\n function awaitTimeout(timeout) {\n return new Promise((resolve) => setTimeout(resolve, timeout));\n }\n\n var Animate = {\n props: {\n duration: Number,\n animation: Boolean\n },\n data: {\n duration: 150,\n animation: \"slide\"\n },\n methods: {\n animate(action, target = this.$el) {\n const name = this.animation;\n const animationFn = name === \"fade\" ? fade : name === \"delayed-fade\" ? (...args) => fade(...args, 40) : name ? slide : () => {\n action();\n return Promise.resolve();\n };\n return animationFn(action, target, this.duration).catch(noop);\n }\n }\n };\n\n const keyMap = {\n TAB: 9,\n ESC: 27,\n SPACE: 32,\n END: 35,\n HOME: 36,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40\n };\n\n var filter = {\n mixins: [Animate],\n args: \"target\",\n props: {\n target: String,\n selActive: Boolean\n },\n data: {\n target: \"\",\n selActive: false,\n attrItem: \"uk-filter-control\",\n cls: \"uk-active\",\n duration: 250\n },\n computed: {\n children: ({ target }, $el) => $$(`${target} > *`, $el),\n toggles: ({ attrItem }, $el) => $$(`[${attrItem}],[data-${attrItem}]`, $el)\n },\n watch: {\n toggles(toggles) {\n this.updateState();\n const actives = $$(this.selActive, this.$el);\n for (const toggle of toggles) {\n if (this.selActive !== false) {\n toggleClass(toggle, this.cls, includes(actives, toggle));\n }\n const button = findButton(toggle);\n if (isTag(button, \"a\")) {\n attr(button, \"role\", \"button\");\n }\n }\n },\n children(list, prev) {\n if (prev) {\n this.updateState();\n }\n }\n },\n events: {\n name: \"click keydown\",\n delegate: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n handler(e) {\n if (e.type === \"keydown\" && e.keyCode !== keyMap.SPACE) {\n return;\n }\n if (e.target.closest(\"a,button\")) {\n e.preventDefault();\n this.apply(e.current);\n }\n }\n },\n methods: {\n apply(el) {\n const prevState = this.getState();\n const newState = mergeState(el, this.attrItem, this.getState());\n if (!isEqualState(prevState, newState)) {\n this.setState(newState);\n }\n },\n getState() {\n return this.toggles.filter((item) => hasClass(item, this.cls)).reduce((state, el) => mergeState(el, this.attrItem, state), {\n filter: { \"\": \"\" },\n sort: []\n });\n },\n async setState(state, animate = true) {\n state = { filter: { \"\": \"\" }, sort: [], ...state };\n trigger(this.$el, \"beforeFilter\", [this, state]);\n for (const toggle of this.toggles) {\n toggleClass(toggle, this.cls, matchFilter(toggle, this.attrItem, state));\n }\n await Promise.all(\n $$(this.target, this.$el).map((target) => {\n const filterFn = () => applyState(state, target, children(target));\n return animate ? this.animate(filterFn, target) : filterFn();\n })\n );\n trigger(this.$el, \"afterFilter\", [this]);\n },\n updateState() {\n fastdom.write(() => this.setState(this.getState(), false));\n }\n }\n };\n function getFilter(el, attr2) {\n return parseOptions(data(el, attr2), [\"filter\"]);\n }\n function isEqualState(stateA, stateB) {\n return [\"filter\", \"sort\"].every((prop) => isEqual(stateA[prop], stateB[prop]));\n }\n function applyState(state, target, children) {\n const selector = Object.values(state.filter).join(\"\");\n for (const el of children) {\n css(el, \"display\", selector && !matches(el, selector) ? \"none\" : \"\");\n }\n const [sort, order] = state.sort;\n if (sort) {\n const sorted = sortItems(children, sort, order);\n if (!isEqual(sorted, children)) {\n append(target, sorted);\n }\n }\n }\n function mergeState(el, attr2, state) {\n const { filter, group, sort, order = \"asc\" } = getFilter(el, attr2);\n if (filter || isUndefined(sort)) {\n if (group) {\n if (filter) {\n delete state.filter[\"\"];\n state.filter[group] = filter;\n } else {\n delete state.filter[group];\n if (isEmpty(state.filter) || \"\" in state.filter) {\n state.filter = { \"\": filter || \"\" };\n }\n }\n } else {\n state.filter = { \"\": filter || \"\" };\n }\n }\n if (!isUndefined(sort)) {\n state.sort = [sort, order];\n }\n return state;\n }\n function matchFilter(el, attr2, { filter: stateFilter = { \"\": \"\" }, sort: [stateSort, stateOrder] }) {\n const { filter = \"\", group = \"\", sort, order = \"asc\" } = getFilter(el, attr2);\n return isUndefined(sort) ? group in stateFilter && filter === stateFilter[group] || !filter && group && !(group in stateFilter) && !stateFilter[\"\"] : stateSort === sort && stateOrder === order;\n }\n function sortItems(nodes, sort, order) {\n return [...nodes].sort(\n (a, b) => data(a, sort).localeCompare(data(b, sort), void 0, { numeric: true }) * (order === \"asc\" || -1)\n );\n }\n function findButton(el) {\n return $(\"a,button\", el) || el;\n }\n\n let prevented;\n function preventBackgroundScroll(el) {\n const off = on(\n el,\n \"touchstart\",\n (e) => {\n if (e.targetTouches.length !== 1 || matches(e.target, 'input[type=\"range\"')) {\n return;\n }\n let prev = getEventPos(e).y;\n const offMove = on(\n el,\n \"touchmove\",\n (e2) => {\n const pos = getEventPos(e2).y;\n if (pos === prev) {\n return;\n }\n prev = pos;\n if (!scrollParents(e2.target).some((scrollParent) => {\n if (!el.contains(scrollParent)) {\n return false;\n }\n let { scrollHeight, clientHeight } = scrollParent;\n return clientHeight < scrollHeight;\n })) {\n e2.preventDefault();\n }\n },\n { passive: false }\n );\n once(el, \"scroll touchend touchcanel\", offMove, { capture: true });\n },\n { passive: true }\n );\n if (prevented) {\n return off;\n }\n prevented = true;\n const { scrollingElement } = document;\n css(scrollingElement, {\n overflowY: CSS.supports(\"overflow\", \"clip\") ? \"clip\" : \"hidden\",\n touchAction: \"none\",\n paddingRight: width(window) - scrollingElement.clientWidth || \"\"\n });\n return () => {\n prevented = false;\n off();\n css(scrollingElement, { overflowY: \"\", touchAction: \"\", paddingRight: \"\" });\n };\n }\n\n var Container = {\n props: {\n container: Boolean\n },\n data: {\n container: true\n },\n computed: {\n container({ container }) {\n return container === true && this.$container || container && $(container);\n }\n }\n };\n\n var Togglable = {\n props: {\n cls: Boolean,\n animation: \"list\",\n duration: Number,\n velocity: Number,\n origin: String,\n transition: String\n },\n data: {\n cls: false,\n animation: [false],\n duration: 200,\n velocity: 0.2,\n origin: false,\n transition: \"ease\",\n clsEnter: \"uk-togglable-enter\",\n clsLeave: \"uk-togglable-leave\"\n },\n computed: {\n hasAnimation: ({ animation }) => !!animation[0],\n hasTransition: ({ animation }) => [\"slide\", \"reveal\"].some((transition) => startsWith(animation[0], transition))\n },\n methods: {\n async toggleElement(targets, toggle, animate) {\n try {\n await Promise.all(\n toNodes(targets).map((el) => {\n const show = isBoolean(toggle) ? toggle : !this.isToggled(el);\n if (!trigger(el, `before${show ? \"show\" : \"hide\"}`, [this])) {\n return Promise.reject();\n }\n const promise = (isFunction(animate) ? animate : animate === false || !this.hasAnimation ? toggleInstant : this.hasTransition ? toggleTransition : toggleAnimation)(el, show, this);\n const cls = show ? this.clsEnter : this.clsLeave;\n addClass(el, cls);\n trigger(el, show ? \"show\" : \"hide\", [this]);\n const done = () => {\n removeClass(el, cls);\n trigger(el, show ? \"shown\" : \"hidden\", [this]);\n };\n return promise ? promise.then(done, () => {\n removeClass(el, cls);\n return Promise.reject();\n }) : done();\n })\n );\n return true;\n } catch (e) {\n return false;\n }\n },\n isToggled(el = this.$el) {\n el = toNode(el);\n return hasClass(el, this.clsEnter) ? true : hasClass(el, this.clsLeave) ? false : this.cls ? hasClass(el, this.cls.split(\" \")[0]) : isVisible(el);\n },\n _toggle(el, toggled) {\n if (!el) {\n return;\n }\n toggled = Boolean(toggled);\n let changed;\n if (this.cls) {\n changed = includes(this.cls, \" \") || toggled !== hasClass(el, this.cls);\n changed && toggleClass(el, this.cls, includes(this.cls, \" \") ? void 0 : toggled);\n } else {\n changed = toggled === el.hidden;\n changed && (el.hidden = !toggled);\n }\n $$(\"[autofocus]\", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());\n if (changed) {\n trigger(el, \"toggled\", [toggled, this]);\n }\n }\n }\n };\n function toggleInstant(el, show, { _toggle }) {\n Animation.cancel(el);\n Transition.cancel(el);\n return _toggle(el, show);\n }\n async function toggleTransition(el, show, { animation, duration, velocity, transition, _toggle }) {\n var _a;\n const [mode = \"reveal\", startProp = \"top\"] = ((_a = animation[0]) == null ? void 0 : _a.split(\"-\")) || [];\n const dirs = [\n [\"left\", \"right\"],\n [\"top\", \"bottom\"]\n ];\n const dir = dirs[includes(dirs[0], startProp) ? 0 : 1];\n const end = dir[1] === startProp;\n const props = [\"width\", \"height\"];\n const dimProp = props[dirs.indexOf(dir)];\n const marginProp = `margin-${dir[0]}`;\n const marginStartProp = `margin-${startProp}`;\n let currentDim = dimensions$1(el)[dimProp];\n const inProgress = Transition.inProgress(el);\n await Transition.cancel(el);\n if (show) {\n _toggle(el, true);\n }\n const prevProps = Object.fromEntries(\n [\n \"padding\",\n \"border\",\n \"width\",\n \"height\",\n \"minWidth\",\n \"minHeight\",\n \"overflowY\",\n \"overflowX\",\n marginProp,\n marginStartProp\n ].map((key) => [key, el.style[key]])\n );\n const dim = dimensions$1(el);\n const currentMargin = toFloat(css(el, marginProp));\n const marginStart = toFloat(css(el, marginStartProp));\n const endDim = dim[dimProp] + marginStart;\n if (!inProgress && !show) {\n currentDim += marginStart;\n }\n const [wrapper] = wrapInner(el, \"
    \");\n css(wrapper, {\n boxSizing: \"border-box\",\n height: dim.height,\n width: dim.width,\n ...css(el, [\n \"overflow\",\n \"padding\",\n \"borderTop\",\n \"borderRight\",\n \"borderBottom\",\n \"borderLeft\",\n \"borderImage\",\n marginStartProp\n ])\n });\n css(el, {\n padding: 0,\n border: 0,\n minWidth: 0,\n minHeight: 0,\n [marginStartProp]: 0,\n width: dim.width,\n height: dim.height,\n overflow: \"hidden\",\n [dimProp]: currentDim\n });\n const percent = currentDim / endDim;\n duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);\n const endProps = { [dimProp]: show ? endDim : 0 };\n if (end) {\n css(el, marginProp, endDim - currentDim + currentMargin);\n endProps[marginProp] = show ? currentMargin : endDim + currentMargin;\n }\n if (!end ^ mode === \"reveal\") {\n css(wrapper, marginProp, -endDim + currentDim);\n Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);\n }\n try {\n await Transition.start(el, endProps, duration, transition);\n } finally {\n css(el, prevProps);\n unwrap(wrapper.firstChild);\n if (!show) {\n _toggle(el, false);\n }\n }\n }\n function toggleAnimation(el, show, cmp) {\n const { animation, duration, _toggle } = cmp;\n if (show) {\n _toggle(el, true);\n return Animation.in(el, animation[0], duration, cmp.origin);\n }\n return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(\n () => _toggle(el, false)\n );\n }\n\n const active$1 = [];\n var Modal = {\n mixins: [Class, Container, Togglable],\n props: {\n selPanel: String,\n selClose: String,\n escClose: Boolean,\n bgClose: Boolean,\n stack: Boolean,\n role: String\n },\n data: {\n cls: \"uk-open\",\n escClose: true,\n bgClose: true,\n overlay: true,\n stack: false,\n role: \"dialog\"\n },\n computed: {\n panel: ({ selPanel }, $el) => $(selPanel, $el),\n transitionElement() {\n return this.panel;\n },\n bgClose({ bgClose }) {\n return bgClose && this.panel;\n }\n },\n connected() {\n attr(this.panel || this.$el, \"role\", this.role);\n if (this.overlay) {\n attr(this.panel || this.$el, \"aria-modal\", true);\n }\n },\n beforeDisconnect() {\n if (includes(active$1, this)) {\n this.toggleElement(this.$el, false, false);\n }\n },\n events: [\n {\n name: \"click\",\n delegate: ({ selClose }) => `${selClose},a[href*=\"#\"]`,\n handler(e) {\n const { current, defaultPrevented } = e;\n const { hash } = current;\n if (!defaultPrevented && hash && isSameSiteAnchor(current) && !this.$el.contains($(hash))) {\n this.hide();\n } else if (matches(current, this.selClose)) {\n e.preventDefault();\n this.hide();\n }\n }\n },\n {\n name: \"toggle\",\n self: true,\n handler(e) {\n if (e.defaultPrevented) {\n return;\n }\n e.preventDefault();\n if (this.isToggled() === includes(active$1, this)) {\n this.toggle();\n }\n }\n },\n {\n name: \"beforeshow\",\n self: true,\n handler(e) {\n if (includes(active$1, this)) {\n return false;\n }\n if (!this.stack && active$1.length) {\n Promise.all(active$1.map((modal) => modal.hide())).then(this.show);\n e.preventDefault();\n } else {\n active$1.push(this);\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (this.stack) {\n css(this.$el, \"zIndex\", toFloat(css(this.$el, \"zIndex\")) + active$1.length);\n }\n const handlers = [\n this.overlay && preventBackgroundFocus(this),\n this.overlay && preventBackgroundScroll(this.$el),\n this.bgClose && listenForBackgroundClose$1(this),\n this.escClose && listenForEscClose$1(this)\n ];\n once(\n this.$el,\n \"hidden\",\n () => handlers.forEach((handler) => handler && handler()),\n { self: true }\n );\n addClass(document.documentElement, this.clsPage);\n }\n },\n {\n name: \"shown\",\n self: true,\n handler() {\n if (!isFocusable(this.$el)) {\n attr(this.$el, \"tabindex\", \"-1\");\n }\n if (!matches(this.$el, \":focus-within\")) {\n this.$el.focus();\n }\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n if (includes(active$1, this)) {\n active$1.splice(active$1.indexOf(this), 1);\n }\n css(this.$el, \"zIndex\", \"\");\n if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {\n removeClass(document.documentElement, this.clsPage);\n }\n }\n }\n ],\n methods: {\n toggle() {\n return this.isToggled() ? this.hide() : this.show();\n },\n show() {\n if (this.container && parent(this.$el) !== this.container) {\n append(this.container, this.$el);\n return new Promise(\n (resolve) => requestAnimationFrame(() => this.show().then(resolve))\n );\n }\n return this.toggleElement(this.$el, true, animate$1);\n },\n hide() {\n return this.toggleElement(this.$el, false, animate$1);\n }\n }\n };\n function animate$1(el, show, { transitionElement, _toggle }) {\n return new Promise(\n (resolve, reject) => once(el, \"show hide\", () => {\n var _a;\n (_a = el._reject) == null ? void 0 : _a.call(el);\n el._reject = reject;\n _toggle(el, show);\n const off = once(\n transitionElement,\n \"transitionstart\",\n () => {\n once(transitionElement, \"transitionend transitioncancel\", resolve, {\n self: true\n });\n clearTimeout(timer);\n },\n { self: true }\n );\n const timer = setTimeout(\n () => {\n off();\n resolve();\n },\n toMs(css(transitionElement, \"transitionDuration\"))\n );\n })\n ).then(() => delete el._reject);\n }\n function toMs(time) {\n return time ? endsWith(time, \"ms\") ? toFloat(time) : toFloat(time) * 1e3 : 0;\n }\n function preventBackgroundFocus(modal) {\n return on(document, \"focusin\", (e) => {\n if (last(active$1) === modal && !modal.$el.contains(e.target)) {\n modal.$el.focus();\n }\n });\n }\n function listenForBackgroundClose$1(modal) {\n return on(document, pointerDown$1, ({ target }) => {\n if (last(active$1) !== modal || modal.overlay && !modal.$el.contains(target) || modal.panel.contains(target)) {\n return;\n }\n once(\n document,\n `${pointerUp$1} ${pointerCancel} scroll`,\n ({ defaultPrevented, type, target: newTarget }) => {\n if (!defaultPrevented && type === pointerUp$1 && target === newTarget) {\n modal.hide();\n }\n },\n true\n );\n });\n }\n function listenForEscClose$1(modal) {\n return on(document, \"keydown\", (e) => {\n if (e.keyCode === 27 && last(active$1) === modal) {\n modal.hide();\n }\n });\n }\n\n var Animations$2 = {\n slide: {\n show(dir) {\n return [{ transform: translate(dir * -100) }, { transform: translate() }];\n },\n percent(current) {\n return translated(current);\n },\n translate(percent, dir) {\n return [\n { transform: translate(dir * -100 * percent) },\n { transform: translate(dir * 100 * (1 - percent)) }\n ];\n }\n }\n };\n function translated(el) {\n return Math.abs(new DOMMatrix(css(el, \"transform\")).m41 / el.offsetWidth);\n }\n function translate(value = 0, unit = \"%\") {\n value += value ? unit : \"\";\n return `translate3d(${value}, 0, 0)`;\n }\n function scale3d(value) {\n return `scale3d(${value}, ${value}, 1)`;\n }\n\n function Transitioner$1(prev, next, dir, { animation, easing }) {\n const { percent, translate, show = noop } = animation;\n const props = show(dir);\n const { promise, resolve } = withResolvers();\n return {\n dir,\n show(duration, percent2 = 0, linear) {\n const timing = linear ? \"linear\" : easing;\n duration -= Math.round(duration * clamp(percent2, -1, 1));\n this.translate(percent2);\n triggerUpdate(next, \"itemin\", { percent: percent2, duration, timing, dir });\n triggerUpdate(prev, \"itemout\", { percent: 1 - percent2, duration, timing, dir });\n Promise.all([\n Transition.start(next, props[1], duration, timing),\n Transition.start(prev, props[0], duration, timing)\n ]).then(() => {\n this.reset();\n resolve();\n }, noop);\n return promise;\n },\n cancel() {\n return Transition.cancel([next, prev]);\n },\n reset() {\n for (const prop in props[0]) {\n css([next, prev], prop, \"\");\n }\n },\n async forward(duration, percent2 = this.percent()) {\n await this.cancel();\n return this.show(duration, percent2, true);\n },\n translate(percent2) {\n this.reset();\n const props2 = translate(percent2, dir);\n css(next, props2[1]);\n css(prev, props2[0]);\n triggerUpdate(next, \"itemtranslatein\", { percent: percent2, dir });\n triggerUpdate(prev, \"itemtranslateout\", { percent: 1 - percent2, dir });\n },\n percent() {\n return percent(prev || next, next, dir);\n },\n getDistance() {\n return prev == null ? void 0 : prev.offsetWidth;\n }\n };\n }\n function triggerUpdate(el, type, data) {\n trigger(el, createEvent(type, false, false, data));\n }\n function withResolvers() {\n let resolve;\n return { promise: new Promise((res) => resolve = res), resolve };\n }\n\n var I18n = {\n props: {\n i18n: Object\n },\n data: {\n i18n: null\n },\n methods: {\n t(key, ...params) {\n var _a, _b, _c;\n let i = 0;\n return ((_c = ((_a = this.i18n) == null ? void 0 : _a[key]) || ((_b = this.$options.i18n) == null ? void 0 : _b[key])) == null ? void 0 : _c.replace(\n /%s/g,\n () => params[i++] || \"\"\n )) || \"\";\n }\n }\n };\n\n var SliderAutoplay = {\n props: {\n autoplay: Boolean,\n autoplayInterval: Number,\n pauseOnHover: Boolean\n },\n data: {\n autoplay: false,\n autoplayInterval: 7e3,\n pauseOnHover: true\n },\n connected() {\n attr(this.list, \"aria-live\", this.autoplay ? \"off\" : \"polite\");\n this.autoplay && this.startAutoplay();\n },\n disconnected() {\n this.stopAutoplay();\n },\n update() {\n attr(this.slides, \"tabindex\", \"-1\");\n },\n events: [\n {\n name: \"visibilitychange\",\n el: () => document,\n filter: ({ autoplay }) => autoplay,\n handler() {\n if (document.hidden) {\n this.stopAutoplay();\n } else {\n this.startAutoplay();\n }\n }\n }\n ],\n methods: {\n startAutoplay() {\n this.stopAutoplay();\n this.interval = setInterval(() => {\n if (!(this.stack.length || this.draggable && matches(this.$el, \":focus-within\") && !matches(this.$el, \":focus\") || this.pauseOnHover && matches(this.$el, \":hover\"))) {\n this.show(\"next\");\n }\n }, this.autoplayInterval);\n },\n stopAutoplay() {\n clearInterval(this.interval);\n }\n }\n };\n\n const pointerOptions = { passive: false, capture: true };\n const pointerUpOptions = { passive: true, capture: true };\n const pointerDown = \"touchstart mousedown\";\n const pointerMove = \"touchmove mousemove\";\n const pointerUp = \"touchend touchcancel mouseup click input scroll\";\n const preventClick = (e) => e.preventDefault();\n var SliderDrag = {\n props: {\n draggable: Boolean\n },\n data: {\n draggable: true,\n threshold: 10\n },\n created() {\n for (const key of [\"start\", \"move\", \"end\"]) {\n const fn = this[key];\n this[key] = (e) => {\n const pos = getEventPos(e).x * (isRtl ? -1 : 1);\n this.prevPos = pos === this.pos ? this.prevPos : this.pos;\n this.pos = pos;\n fn(e);\n };\n }\n },\n events: [\n {\n name: pointerDown,\n passive: true,\n delegate: ({ selList }) => `${selList} > *`,\n handler(e) {\n if (!this.draggable || this.parallax || !isTouch(e) && hasSelectableText(e.target) || e.target.closest(selInput) || e.button > 0 || this.length < 2) {\n return;\n }\n this.start(e);\n }\n },\n {\n name: \"dragstart\",\n handler(e) {\n e.preventDefault();\n }\n },\n {\n // iOS workaround for slider stopping if swiping fast\n name: pointerMove,\n el: ({ list }) => list,\n handler: noop,\n ...pointerOptions\n }\n ],\n methods: {\n start() {\n this.drag = this.pos;\n if (this._transitioner) {\n this.percent = this._transitioner.percent();\n this.drag += this._transitioner.getDistance() * this.percent * this.dir;\n this._transitioner.cancel();\n this._transitioner.translate(this.percent);\n this.dragging = true;\n this.stack = [];\n } else {\n this.prevIndex = this.index;\n }\n on(document, pointerMove, this.move, pointerOptions);\n on(document, pointerUp, this.end, pointerUpOptions);\n css(this.list, \"userSelect\", \"none\");\n },\n move(e) {\n const distance = this.pos - this.drag;\n if (distance === 0 || this.prevPos === this.pos || !this.dragging && Math.abs(distance) < this.threshold) {\n return;\n }\n if (!this.dragging) {\n on(this.list, \"click\", preventClick, pointerOptions);\n }\n e.cancelable && e.preventDefault();\n this.dragging = true;\n this.dir = distance < 0 ? 1 : -1;\n let { slides, prevIndex } = this;\n let dis = Math.abs(distance);\n let nextIndex = this.getIndex(prevIndex + this.dir);\n let width = getDistance.call(this, prevIndex, nextIndex);\n while (nextIndex !== prevIndex && dis > width) {\n this.drag -= width * this.dir;\n prevIndex = nextIndex;\n dis -= width;\n nextIndex = this.getIndex(prevIndex + this.dir);\n width = getDistance.call(this, prevIndex, nextIndex);\n }\n this.percent = dis / width;\n const prev = slides[prevIndex];\n const next = slides[nextIndex];\n const changed = this.index !== nextIndex;\n const edge = prevIndex === nextIndex;\n let itemShown;\n for (const i of [this.index, this.prevIndex]) {\n if (!includes([nextIndex, prevIndex], i)) {\n trigger(slides[i], \"itemhidden\", [this]);\n if (edge) {\n itemShown = true;\n this.prevIndex = prevIndex;\n }\n }\n }\n if (this.index === prevIndex && this.prevIndex !== prevIndex || itemShown) {\n trigger(slides[this.index], \"itemshown\", [this]);\n }\n if (changed) {\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (!edge) {\n trigger(prev, \"beforeitemhide\", [this]);\n trigger(prev, \"itemhide\", [this]);\n }\n trigger(next, \"beforeitemshow\", [this]);\n trigger(next, \"itemshow\", [this]);\n }\n this._transitioner = this._translate(Math.abs(this.percent), prev, !edge && next);\n },\n end() {\n off(document, pointerMove, this.move, pointerOptions);\n off(document, pointerUp, this.end, pointerUpOptions);\n if (this.dragging) {\n this.dragging = null;\n if (this.index === this.prevIndex) {\n this.percent = 1 - this.percent;\n this.dir *= -1;\n this._show(false, this.index, true);\n this._transitioner = null;\n } else {\n const dirChange = (isRtl ? this.dir * (isRtl ? 1 : -1) : this.dir) < 0 === this.prevPos > this.pos;\n this.index = dirChange ? this.index : this.prevIndex;\n if (dirChange) {\n this.percent = 1 - this.percent;\n }\n this.show(\n this.dir > 0 && !dirChange || this.dir < 0 && dirChange ? \"next\" : \"previous\",\n true\n );\n }\n }\n setTimeout(() => off(this.list, \"click\", preventClick, pointerOptions));\n css(this.list, { userSelect: \"\" });\n this.drag = this.percent = null;\n }\n }\n };\n function getDistance(prev, next) {\n return this._getTransitioner(prev, prev !== next && next).getDistance() || this.slides[prev].offsetWidth;\n }\n function hasSelectableText(el) {\n return css(el, \"userSelect\") !== \"none\" && toArray(el.childNodes).some((el2) => el2.nodeType === 3 && el2.textContent.trim());\n }\n\n function initWatches(instance) {\n instance._watches = [];\n for (const watches of instance.$options.watch || []) {\n for (const [name, watch] of Object.entries(watches)) {\n registerWatch(instance, watch, name);\n }\n }\n instance._initial = true;\n }\n function registerWatch(instance, watch, name) {\n instance._watches.push({\n name,\n ...isPlainObject(watch) ? watch : { handler: watch }\n });\n }\n function runWatches(instance, values) {\n for (const { name, handler, immediate = true } of instance._watches) {\n if (instance._initial && immediate || hasOwn(values, name) && !isEqual(values[name], instance[name])) {\n handler.call(instance, instance[name], values[name]);\n }\n }\n instance._initial = false;\n }\n\n function initComputed(instance) {\n const { computed } = instance.$options;\n instance._computed = {};\n if (computed) {\n for (const key in computed) {\n registerComputed(instance, key, computed[key]);\n }\n }\n }\n const mutationOptions = { subtree: true, childList: true };\n function registerComputed(instance, key, cb) {\n instance._hasComputed = true;\n Object.defineProperty(instance, key, {\n enumerable: true,\n get() {\n const { _computed, $props, $el } = instance;\n if (!hasOwn(_computed, key)) {\n _computed[key] = (cb.get || cb).call(instance, $props, $el);\n if (cb.observe && instance._computedObserver) {\n const selector = cb.observe.call(instance, $props);\n instance._computedObserver.observe(\n [\"~\", \"+\", \"-\"].includes(selector[0]) ? $el.parentElement : $el.getRootNode(),\n mutationOptions\n );\n }\n }\n return _computed[key];\n },\n set(value) {\n const { _computed } = instance;\n _computed[key] = cb.set ? cb.set.call(instance, value) : value;\n if (isUndefined(_computed[key])) {\n delete _computed[key];\n }\n }\n });\n }\n function initComputedUpdates(instance) {\n if (!instance._hasComputed) {\n return;\n }\n prependUpdate(instance, {\n read: () => runWatches(instance, resetComputed(instance)),\n events: [\"resize\", \"computed\"]\n });\n instance._computedObserver = observeMutation(\n instance.$el,\n () => callUpdate(instance, \"computed\"),\n mutationOptions\n );\n }\n function disconnectComputedUpdates(instance) {\n var _a;\n (_a = instance._computedObserver) == null ? void 0 : _a.disconnect();\n delete instance._computedObserver;\n resetComputed(instance);\n }\n function resetComputed(instance) {\n const values = { ...instance._computed };\n instance._computed = {};\n return values;\n }\n\n function initEvents(instance) {\n instance._events = [];\n for (const event of instance.$options.events || []) {\n if (hasOwn(event, \"handler\")) {\n registerEvent(instance, event);\n } else {\n for (const key in event) {\n registerEvent(instance, event[key], key);\n }\n }\n }\n }\n function unbindEvents(instance) {\n instance._events.forEach((unbind) => unbind());\n delete instance._events;\n }\n function registerEvent(instance, event, key) {\n let { name, el, handler, capture, passive, delegate, filter, self } = isPlainObject(event) ? event : { name: key, handler: event };\n el = isFunction(el) ? el.call(instance, instance) : el || instance.$el;\n if (!el || isArray(el) && !el.length || filter && !filter.call(instance, instance)) {\n return;\n }\n instance._events.push(\n on(\n el,\n name,\n delegate ? isString(delegate) ? delegate : delegate.call(instance, instance) : null,\n isString(handler) ? instance[handler] : handler.bind(instance),\n { passive, capture, self }\n )\n );\n }\n\n function initObservers(instance) {\n instance._observers = [];\n for (const observer of instance.$options.observe || []) {\n registerObservable(instance, observer);\n }\n }\n function registerObserver(instance, ...observer) {\n instance._observers.push(...observer);\n }\n function disconnectObservers(instance) {\n for (const observer of instance._observers) {\n observer.disconnect();\n }\n }\n function registerObservable(instance, observable) {\n let { observe, target = instance.$el, handler, options, filter, args } = observable;\n if (filter && !filter.call(instance, instance)) {\n return;\n }\n const key = `_observe${instance._observers.length}`;\n if (isFunction(target) && !hasOwn(instance, key)) {\n registerComputed(instance, key, () => {\n const targets2 = target.call(instance, instance);\n return isArray(targets2) ? toNodes(targets2) : targets2;\n });\n }\n handler = isString(handler) ? instance[handler] : handler.bind(instance);\n if (isFunction(options)) {\n options = options.call(instance, instance);\n }\n const targets = hasOwn(instance, key) ? instance[key] : target;\n const observer = observe(targets, handler, options, args);\n if (isFunction(target) && isArray(instance[key])) {\n registerWatch(\n instance,\n { handler: updateTargets(observer, options), immediate: false },\n key\n );\n }\n registerObserver(instance, observer);\n }\n function updateTargets(observer, options) {\n return (targets, prev) => {\n for (const target of prev) {\n if (!includes(targets, target)) {\n if (observer.unobserve) {\n observer.unobserve(target);\n } else if (observer.observe) {\n observer.disconnect();\n }\n }\n }\n for (const target of targets) {\n if (!includes(prev, target) || !observer.unobserve) {\n observer.observe(target, options);\n }\n }\n };\n }\n\n function initProps(instance) {\n const { $options, $props } = instance;\n const props = getProps($options);\n assign($props, props);\n const { computed, methods } = $options;\n for (let key in $props) {\n if (key in props && (!computed || !hasOwn(computed, key)) && (!methods || !hasOwn(methods, key))) {\n instance[key] = $props[key];\n }\n }\n }\n function getProps(opts) {\n const data$1 = {};\n const { args = [], props = {}, el, id } = opts;\n if (!props) {\n return data$1;\n }\n for (const key in props) {\n const prop = hyphenate(key);\n let value = data(el, prop);\n if (isUndefined(value)) {\n continue;\n }\n value = props[key] === Boolean && value === \"\" ? true : coerce$1(props[key], value);\n if (prop === \"target\" && startsWith(value, \"_\")) {\n continue;\n }\n data$1[key] = value;\n }\n const options = parseOptions(data(el, id), args);\n for (const key in options) {\n const prop = camelize(key);\n if (!isUndefined(props[prop])) {\n data$1[prop] = coerce$1(props[prop], options[key]);\n }\n }\n return data$1;\n }\n const getAttributes = memoize((id, props) => {\n const attributes = Object.keys(props);\n const filter = attributes.concat(id).map((key) => [hyphenate(key), `data-${hyphenate(key)}`]).flat();\n return { attributes, filter };\n });\n function initPropsObserver(instance) {\n const { $options, $props } = instance;\n const { id, props, el } = $options;\n if (!props) {\n return;\n }\n const { attributes, filter } = getAttributes(id, props);\n const observer = new MutationObserver((records) => {\n const data = getProps($options);\n if (records.some(({ attributeName }) => {\n const prop = attributeName.replace(\"data-\", \"\");\n return (prop === id ? attributes : [camelize(prop), camelize(attributeName)]).some(\n (prop2) => !isUndefined(data[prop2]) && data[prop2] !== $props[prop2]\n );\n })) {\n instance.$reset();\n }\n });\n observer.observe(el, {\n attributes: true,\n attributeFilter: filter\n });\n registerObserver(instance, observer);\n }\n\n function callHook(instance, hook) {\n var _a;\n (_a = instance.$options[hook]) == null ? void 0 : _a.forEach((handler) => handler.call(instance));\n }\n function callConnected(instance) {\n if (instance._connected) {\n return;\n }\n initProps(instance);\n callHook(instance, \"beforeConnect\");\n instance._connected = true;\n initEvents(instance);\n initUpdates(instance);\n initWatches(instance);\n initObservers(instance);\n initPropsObserver(instance);\n initComputedUpdates(instance);\n callHook(instance, \"connected\");\n callUpdate(instance);\n }\n function callDisconnected(instance) {\n if (!instance._connected) {\n return;\n }\n callHook(instance, \"beforeDisconnect\");\n unbindEvents(instance);\n clearUpdateData(instance);\n disconnectObservers(instance);\n disconnectComputedUpdates(instance);\n callHook(instance, \"disconnected\");\n instance._connected = false;\n }\n\n let uid = 0;\n function init$1(instance, options = {}) {\n options.data = normalizeData(options, instance.constructor.options);\n instance.$options = mergeOptions(instance.constructor.options, options, instance);\n instance.$props = {};\n instance._uid = uid++;\n initData(instance);\n initMethods(instance);\n initComputed(instance);\n callHook(instance, \"created\");\n if (options.el) {\n instance.$mount(options.el);\n }\n }\n function initData(instance) {\n const { data = {} } = instance.$options;\n for (const key in data) {\n instance.$props[key] = instance[key] = data[key];\n }\n }\n function initMethods(instance) {\n const { methods } = instance.$options;\n if (methods) {\n for (const key in methods) {\n instance[key] = methods[key].bind(instance);\n }\n }\n }\n function normalizeData({ data = {} }, { args = [], props = {} }) {\n if (isArray(data)) {\n data = data.slice(0, args.length).reduce((data2, value, index) => {\n if (isPlainObject(value)) {\n assign(data2, value);\n } else {\n data2[args[index]] = value;\n }\n return data2;\n }, {});\n }\n for (const key in data) {\n if (isUndefined(data[key])) {\n delete data[key];\n } else if (props[key]) {\n data[key] = coerce$1(props[key], data[key]);\n }\n }\n return data;\n }\n\n const App = function(options) {\n init$1(this, options);\n };\n App.util = util;\n App.options = {};\n App.version = \"3.21.5\";\n\n const PREFIX = \"uk-\";\n const DATA = \"__uikit__\";\n const components$2 = {};\n function component(name, options) {\n var _a, _b;\n const id = PREFIX + hyphenate(name);\n if (!options) {\n if (!components$2[id].options) {\n components$2[id] = App.extend(components$2[id]);\n }\n return components$2[id];\n }\n name = camelize(name);\n App[name] = (element, data) => createComponent(name, element, data);\n const opt = (_a = options.options) != null ? _a : { ...options };\n opt.id = id;\n opt.name = name;\n (_b = opt.install) == null ? void 0 : _b.call(opt, App, opt, name);\n if (App._initialized && !opt.functional) {\n requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));\n }\n return components$2[id] = opt;\n }\n function createComponent(name, element, data, ...args) {\n const Component = component(name);\n return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? findAll(element).map(init)[0] : init();\n function init(element2) {\n const instance = getComponent(element2, name);\n if (instance) {\n if (data) {\n instance.$destroy();\n } else {\n return instance;\n }\n }\n return new Component({ el: element2, data });\n }\n }\n function getComponents(element) {\n return (element == null ? void 0 : element[DATA]) || {};\n }\n function getComponent(element, name) {\n return getComponents(element)[name];\n }\n function attachToElement(element, instance) {\n if (!element[DATA]) {\n element[DATA] = {};\n }\n element[DATA][instance.$options.name] = instance;\n }\n function detachFromElement(element, instance) {\n var _a;\n (_a = element[DATA]) == null ? true : delete _a[instance.$options.name];\n if (isEmpty(element[DATA])) {\n delete element[DATA];\n }\n }\n\n function globalApi(App) {\n App.component = component;\n App.getComponents = getComponents;\n App.getComponent = getComponent;\n App.update = update;\n App.use = function(plugin) {\n if (plugin.installed) {\n return;\n }\n plugin.call(null, this);\n plugin.installed = true;\n return this;\n };\n App.mixin = function(mixin, component2) {\n component2 = (isString(component2) ? this.component(component2) : component2) || this;\n component2.options = mergeOptions(component2.options, mixin);\n };\n App.extend = function(options) {\n options || (options = {});\n const Super = this;\n const Sub = function UIkitComponent(options2) {\n init$1(this, options2);\n };\n Sub.prototype = Object.create(Super.prototype);\n Sub.prototype.constructor = Sub;\n Sub.options = mergeOptions(Super.options, options);\n Sub.super = Super;\n Sub.extend = Super.extend;\n return Sub;\n };\n let container;\n Object.defineProperty(App, \"container\", {\n get() {\n return container || document.body;\n },\n set(element) {\n container = $(element);\n }\n });\n }\n function update(element, e) {\n element = element ? toNode(element) : document.body;\n for (const parentEl of parents(element).reverse()) {\n updateElement(parentEl, e);\n }\n apply(element, (element2) => updateElement(element2, e));\n }\n function updateElement(element, e) {\n const components = getComponents(element);\n for (const name in components) {\n callUpdate(components[name], e);\n }\n }\n\n function instanceApi(App) {\n App.prototype.$mount = function(el) {\n const instance = this;\n attachToElement(el, instance);\n instance.$options.el = el;\n if (document.contains(el)) {\n callConnected(instance);\n }\n };\n App.prototype.$destroy = function(removeEl = false) {\n const instance = this;\n const { el } = instance.$options;\n if (el) {\n callDisconnected(instance);\n }\n callHook(instance, \"destroy\");\n detachFromElement(el, instance);\n if (removeEl) {\n remove$1(instance.$el);\n }\n };\n App.prototype.$create = createComponent;\n App.prototype.$emit = function(e) {\n callUpdate(this, e);\n };\n App.prototype.$update = function(element = this.$el, e) {\n update(element, e);\n };\n App.prototype.$reset = function() {\n callDisconnected(this);\n callConnected(this);\n };\n App.prototype.$getComponent = getComponent;\n Object.defineProperties(App.prototype, {\n $el: {\n get() {\n return this.$options.el;\n }\n },\n $container: Object.getOwnPropertyDescriptor(App, \"container\")\n });\n }\n let id = 1;\n function generateId(instance, el = null) {\n return (el == null ? void 0 : el.id) || `${instance.$options.id}-${id++}`;\n }\n\n var SliderNav = {\n i18n: {\n next: \"Next slide\",\n previous: \"Previous slide\",\n slideX: \"Slide %s\",\n slideLabel: \"%s of %s\",\n role: \"String\"\n },\n data: {\n selNav: false,\n role: \"region\"\n },\n computed: {\n nav: ({ selNav }, $el) => $(selNav, $el),\n navChildren() {\n return children(this.nav);\n },\n selNavItem: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n navItems(_, $el) {\n return $$(this.selNavItem, $el);\n }\n },\n watch: {\n nav(nav, prev) {\n attr(nav, \"role\", \"tablist\");\n this.padNavitems();\n if (prev) {\n this.$emit();\n }\n },\n list(list) {\n if (isTag(list, \"ul\")) {\n attr(list, \"role\", \"presentation\");\n }\n },\n navChildren(children2) {\n attr(children2, \"role\", \"presentation\");\n this.padNavitems();\n this.updateNav();\n },\n navItems(items) {\n for (const el of items) {\n const cmd = data(el, this.attrItem);\n const button = $(\"a,button\", el) || el;\n let ariaLabel;\n let ariaControls = null;\n if (isNumeric(cmd)) {\n const item = toNumber(cmd);\n const slide = this.slides[item];\n if (slide) {\n if (!slide.id) {\n slide.id = generateId(this, slide);\n }\n ariaControls = slide.id;\n }\n ariaLabel = this.t(\"slideX\", toFloat(cmd) + 1);\n attr(button, \"role\", \"tab\");\n } else {\n if (this.list) {\n if (!this.list.id) {\n this.list.id = generateId(this, this.list);\n }\n ariaControls = this.list.id;\n }\n ariaLabel = this.t(cmd);\n }\n attr(button, {\n \"aria-controls\": ariaControls,\n \"aria-label\": attr(button, \"aria-label\") || ariaLabel\n });\n }\n },\n slides(slides) {\n slides.forEach(\n (slide, i) => attr(slide, {\n role: this.nav ? \"tabpanel\" : \"group\",\n \"aria-label\": this.t(\"slideLabel\", i + 1, this.length),\n \"aria-roledescription\": this.nav ? null : \"slide\"\n })\n );\n this.padNavitems();\n }\n },\n connected() {\n attr(this.$el, {\n role: this.role,\n \"aria-roledescription\": \"carousel\"\n });\n },\n update: [\n {\n write() {\n this.navItems.concat(this.nav).forEach((el) => el && (el.hidden = !this.maxIndex));\n this.updateNav();\n },\n events: [\"resize\"]\n }\n ],\n events: [\n {\n name: \"click keydown\",\n delegate: ({ selNavItem }) => selNavItem,\n filter: ({ parallax }) => !parallax,\n handler(e) {\n if (e.target.closest(\"a,button\") && (e.type === \"click\" || e.keyCode === keyMap.SPACE)) {\n e.preventDefault();\n this.show(data(e.current, this.attrItem));\n }\n }\n },\n {\n name: \"itemshow\",\n handler: \"updateNav\"\n },\n {\n name: \"keydown\",\n delegate: ({ selNavItem }) => selNavItem,\n filter: ({ parallax }) => !parallax,\n handler(e) {\n const { current, keyCode } = e;\n const cmd = data(current, this.attrItem);\n if (!isNumeric(cmd)) {\n return;\n }\n let i = keyCode === keyMap.HOME ? 0 : keyCode === keyMap.END ? \"last\" : keyCode === keyMap.LEFT ? \"previous\" : keyCode === keyMap.RIGHT ? \"next\" : -1;\n if (~i) {\n e.preventDefault();\n this.show(i);\n }\n }\n }\n ],\n methods: {\n updateNav() {\n const index = this.getValidIndex();\n for (const el of this.navItems) {\n const cmd = data(el, this.attrItem);\n const button = $(\"a,button\", el) || el;\n if (isNumeric(cmd)) {\n const item = toNumber(cmd);\n const active = item === index;\n toggleClass(el, this.clsActive, active);\n toggleClass(button, \"uk-disabled\", this.parallax);\n attr(button, {\n \"aria-selected\": active,\n tabindex: active && !this.parallax ? null : -1\n });\n if (active && button && matches(parent(el), \":focus-within\")) {\n button.focus();\n }\n } else {\n toggleClass(\n el,\n \"uk-invisible\",\n this.finite && (cmd === \"previous\" && index === 0 || cmd === \"next\" && index >= this.maxIndex)\n );\n }\n }\n },\n padNavitems() {\n if (!this.nav) {\n return;\n }\n const children2 = [];\n for (let i = 0; i < this.length; i++) {\n const attr2 = `${this.attrItem}=\"${i}\"`;\n children2[i] = this.navChildren.findLast((el) => el.matches(`[${attr2}]`)) || $(`
  • `);\n }\n if (!isEqual(children2, this.navChildren)) {\n html(this.nav, children2);\n }\n }\n }\n };\n\n const easeOutQuad = \"cubic-bezier(0.25, 0.46, 0.45, 0.94)\";\n const easeOutQuart = \"cubic-bezier(0.165, 0.84, 0.44, 1)\";\n var Slider = {\n mixins: [SliderAutoplay, SliderDrag, SliderNav, I18n],\n props: {\n clsActivated: String,\n easing: String,\n index: Number,\n finite: Boolean,\n velocity: Number\n },\n data: () => ({\n easing: \"ease\",\n finite: false,\n velocity: 1,\n index: 0,\n prevIndex: -1,\n stack: [],\n percent: 0,\n clsActive: \"uk-active\",\n clsActivated: \"\",\n clsEnter: \"uk-slide-enter\",\n clsLeave: \"uk-slide-leave\",\n clsSlideActive: \"uk-slide-active\",\n Transitioner: false,\n transitionOptions: {}\n }),\n connected() {\n this.prevIndex = -1;\n this.index = this.getValidIndex(this.$props.index);\n this.stack = [];\n },\n disconnected() {\n removeClass(this.slides, this.clsActive);\n },\n computed: {\n duration: ({ velocity }, $el) => speedUp($el.offsetWidth / velocity),\n list: ({ selList }, $el) => $(selList, $el),\n maxIndex() {\n return this.length - 1;\n },\n slides() {\n return children(this.list);\n },\n length() {\n return this.slides.length;\n }\n },\n watch: {\n slides(slides, prev) {\n if (prev) {\n this.$emit();\n }\n }\n },\n events: {\n itemshow({ target }) {\n addClass(target, this.clsEnter, this.clsSlideActive);\n },\n itemshown({ target }) {\n removeClass(target, this.clsEnter);\n },\n itemhide({ target }) {\n addClass(target, this.clsLeave);\n },\n itemhidden({ target }) {\n removeClass(target, this.clsLeave, this.clsSlideActive);\n }\n },\n methods: {\n show(index, force = false) {\n var _a;\n if (this.dragging || !this.length || this.parallax) {\n return;\n }\n const { stack } = this;\n const queueIndex = force ? 0 : stack.length;\n const reset = () => {\n stack.splice(queueIndex, 1);\n if (stack.length) {\n this.show(stack.shift(), true);\n }\n };\n stack[force ? \"unshift\" : \"push\"](index);\n if (!force && stack.length > 1) {\n if (stack.length === 2) {\n (_a = this._transitioner) == null ? void 0 : _a.forward(Math.min(this.duration, 200));\n }\n return;\n }\n const prevIndex = this.getIndex(this.index);\n const prev = hasClass(this.slides, this.clsActive) && this.slides[prevIndex];\n const nextIndex = this.getIndex(index, this.index);\n const next = this.slides[nextIndex];\n if (prev === next) {\n reset();\n return;\n }\n this.dir = getDirection(index, prevIndex);\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (prev && !trigger(prev, \"beforeitemhide\", [this]) || !trigger(next, \"beforeitemshow\", [this, prev])) {\n this.index = this.prevIndex;\n reset();\n return;\n }\n const promise = this._show(prev, next, force).then(() => {\n prev && trigger(prev, \"itemhidden\", [this]);\n trigger(next, \"itemshown\", [this]);\n stack.shift();\n this._transitioner = null;\n if (stack.length) {\n requestAnimationFrame(() => stack.length && this.show(stack.shift(), true));\n }\n });\n prev && trigger(prev, \"itemhide\", [this]);\n trigger(next, \"itemshow\", [this]);\n return promise;\n },\n getIndex(index = this.index, prev = this.index) {\n return clamp(\n getIndex(index, this.slides, prev, this.finite),\n 0,\n Math.max(0, this.maxIndex)\n );\n },\n getValidIndex(index = this.index, prevIndex = this.prevIndex) {\n return this.getIndex(index, prevIndex);\n },\n async _show(prev, next, force) {\n this._transitioner = this._getTransitioner(prev, next, this.dir, {\n easing: force ? next.offsetWidth < 600 ? easeOutQuad : easeOutQuart : this.easing,\n ...this.transitionOptions\n });\n if (!force && !prev) {\n this._translate(1);\n return;\n }\n const { length } = this.stack;\n return this._transitioner[length > 1 ? \"forward\" : \"show\"](\n length > 1 ? Math.min(this.duration, 75 + 75 / (length - 1)) : this.duration,\n this.percent\n );\n },\n _translate(percent, prev = this.prevIndex, next = this.index) {\n const transitioner = this._getTransitioner(prev === next ? false : prev, next);\n transitioner.translate(percent);\n return transitioner;\n },\n _getTransitioner(prev = this.prevIndex, next = this.index, dir = this.dir || 1, options = this.transitionOptions) {\n return new this.Transitioner(\n isNumber(prev) ? this.slides[prev] : prev,\n isNumber(next) ? this.slides[next] : next,\n dir * (isRtl ? -1 : 1),\n options\n );\n }\n }\n };\n function getDirection(index, prevIndex) {\n return index === \"next\" ? 1 : index === \"previous\" ? -1 : index < prevIndex ? -1 : 1;\n }\n function speedUp(x) {\n return 0.5 * x + 300;\n }\n\n var Slideshow = {\n mixins: [Slider],\n props: {\n animation: String\n },\n data: {\n animation: \"slide\",\n clsActivated: \"uk-transition-active\",\n Animations: Animations$2,\n Transitioner: Transitioner$1\n },\n computed: {\n animation({ animation, Animations: Animations2 }) {\n return { ...Animations2[animation] || Animations2.slide, name: animation };\n },\n transitionOptions() {\n return { animation: this.animation };\n }\n },\n observe: resize(),\n events: {\n beforeitemshow({ target }) {\n addClass(target, this.clsActive);\n },\n itemshown({ target }) {\n addClass(target, this.clsActivated);\n },\n itemhidden({ target }) {\n removeClass(target, this.clsActive, this.clsActivated);\n }\n }\n };\n\n var Animations$1 = {\n ...Animations$2,\n fade: {\n show() {\n return [{ opacity: 0 }, { opacity: 1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [{ opacity: 1 - percent }, { opacity: percent }];\n }\n },\n scale: {\n show() {\n return [\n { opacity: 0, transform: scale3d(1 - 0.2) },\n { opacity: 1, transform: scale3d(1) }\n ];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [\n { opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },\n { opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }\n ];\n }\n }\n };\n\n var LightboxPanel = {\n mixins: [Modal, Slideshow],\n functional: true,\n props: {\n delayControls: Number,\n preload: Number,\n videoAutoplay: Boolean,\n template: String\n },\n data: () => ({\n preload: 1,\n videoAutoplay: false,\n delayControls: 3e3,\n items: [],\n cls: \"uk-open\",\n clsPage: \"uk-lightbox-page\",\n selList: \".uk-lightbox-items\",\n attrItem: \"uk-lightbox-item\",\n selClose: \".uk-close-large\",\n selCaption: \".uk-lightbox-caption\",\n pauseOnHover: false,\n velocity: 2,\n Animations: Animations$1,\n template: `
    `\n }),\n created() {\n const $el = $(this.template);\n const list = $(this.selList, $el);\n this.items.forEach(() => append(list, \"
    \"));\n const close = $(\"[uk-close]\", $el);\n const closeLabel = this.t(\"close\");\n if (close && closeLabel) {\n close.dataset.i18n = JSON.stringify({ label: closeLabel });\n }\n this.$mount(append(this.container, $el));\n },\n events: [\n {\n name: `${pointerMove$1} ${pointerDown$1} keydown`,\n handler: \"showControls\"\n },\n {\n name: \"click\",\n self: true,\n delegate: ({ selList }) => `${selList} > *`,\n handler(e) {\n if (!e.defaultPrevented) {\n this.hide();\n }\n }\n },\n {\n name: \"shown\",\n self: true,\n handler: \"showControls\"\n },\n {\n name: \"hide\",\n self: true,\n handler() {\n this.hideControls();\n removeClass(this.slides, this.clsActive);\n Transition.stop(this.slides);\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n this.$destroy(true);\n }\n },\n {\n name: \"keyup\",\n el: () => document,\n handler({ keyCode }) {\n if (!this.isToggled(this.$el) || !this.draggable) {\n return;\n }\n let i = -1;\n if (keyCode === keyMap.LEFT) {\n i = \"previous\";\n } else if (keyCode === keyMap.RIGHT) {\n i = \"next\";\n } else if (keyCode === keyMap.HOME) {\n i = 0;\n } else if (keyCode === keyMap.END) {\n i = \"last\";\n }\n if (~i) {\n this.show(i);\n }\n }\n },\n {\n name: \"beforeitemshow\",\n handler(e) {\n if (this.isToggled()) {\n return;\n }\n this.draggable = false;\n e.preventDefault();\n this.toggleElement(this.$el, true, false);\n this.animation = Animations$1[\"scale\"];\n removeClass(e.target, this.clsActive);\n this.stack.splice(1, 0, this.index);\n }\n },\n {\n name: \"itemshow\",\n handler() {\n html($(this.selCaption, this.$el), this.getItem().caption || \"\");\n for (let j = -this.preload; j <= this.preload; j++) {\n this.loadItem(this.index + j);\n }\n }\n },\n {\n name: \"itemshown\",\n handler() {\n this.draggable = this.$props.draggable;\n }\n },\n {\n name: \"itemload\",\n async handler(_, item) {\n const { source: src, type, alt = \"\", poster, attrs = {} } = item;\n this.setItem(item, \"\");\n if (!src) {\n return;\n }\n let matches;\n const iframeAttrs = {\n allowfullscreen: \"\",\n style: \"max-width: 100%; box-sizing: border-box;\",\n \"uk-responsive\": \"\",\n \"uk-video\": `${this.videoAutoplay}`\n };\n if (type === \"image\" || src.match(/\\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\\?)/i)) {\n const img = createEl(\"img\", { src, alt, ...attrs });\n on(img, \"load\", () => this.setItem(item, img));\n on(img, \"error\", () => this.setError(item));\n } else if (type === \"video\" || src.match(/\\.(mp4|webm|ogv)($|\\?)/i)) {\n const video = createEl(\"video\", {\n src,\n poster,\n controls: \"\",\n playsinline: \"\",\n \"uk-video\": `${this.videoAutoplay}`,\n ...attrs\n });\n on(video, \"loadedmetadata\", () => this.setItem(item, video));\n on(video, \"error\", () => this.setError(item));\n } else if (type === \"iframe\" || src.match(/\\.(html|php)($|\\?)/i)) {\n this.setItem(\n item,\n createEl(\"iframe\", {\n src,\n allowfullscreen: \"\",\n class: \"uk-lightbox-iframe\",\n ...attrs\n })\n );\n } else if (matches = src.match(\n /\\/\\/(?:.*?youtube(-nocookie)?\\..*?(?:[?&]v=|\\/shorts\\/)|youtu\\.be\\/)([\\w-]{11})[&?]?(.*)?/\n )) {\n this.setItem(\n item,\n createEl(\"iframe\", {\n src: `https://www.youtube${matches[1] || \"\"}.com/embed/${matches[2]}${matches[3] ? `?${matches[3]}` : \"\"}`,\n width: 1920,\n height: 1080,\n ...iframeAttrs,\n ...attrs\n })\n );\n } else if (matches = src.match(/\\/\\/.*?vimeo\\.[a-z]+\\/(\\d+)[&?]?(.*)?/)) {\n try {\n const { height, width } = await (await fetch(\n `https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(\n src\n )}`,\n { credentials: \"omit\" }\n )).json();\n this.setItem(\n item,\n createEl(\"iframe\", {\n src: `https://player.vimeo.com/video/${matches[1]}${matches[2] ? `?${matches[2]}` : \"\"}`,\n width,\n height,\n ...iframeAttrs,\n ...attrs\n })\n );\n } catch (e) {\n this.setError(item);\n }\n }\n }\n }\n ],\n methods: {\n loadItem(index = this.index) {\n const item = this.getItem(index);\n if (!this.getSlide(item).childElementCount) {\n trigger(this.$el, \"itemload\", [item]);\n }\n },\n getItem(index = this.index) {\n return this.items[getIndex(index, this.slides)];\n },\n setItem(item, content) {\n trigger(this.$el, \"itemloaded\", [this, html(this.getSlide(item), content)]);\n },\n getSlide(item) {\n return this.slides[this.items.indexOf(item)];\n },\n setError(item) {\n this.setItem(item, '');\n },\n showControls() {\n clearTimeout(this.controlsTimer);\n this.controlsTimer = setTimeout(this.hideControls, this.delayControls);\n addClass(this.$el, \"uk-active\", \"uk-transition-active\");\n },\n hideControls() {\n removeClass(this.$el, \"uk-active\", \"uk-transition-active\");\n }\n }\n };\n function createEl(tag, attrs) {\n const el = fragment(`<${tag}>`);\n attr(el, attrs);\n return el;\n }\n\n var lightbox = {\n install: install$3,\n props: { toggle: String },\n data: { toggle: \"a\" },\n computed: {\n toggles: ({ toggle }, $el) => $$(toggle, $el)\n },\n watch: {\n toggles(toggles) {\n this.hide();\n for (const toggle of toggles) {\n if (isTag(toggle, \"a\")) {\n attr(toggle, \"role\", \"button\");\n }\n }\n }\n },\n disconnected() {\n this.hide();\n },\n events: {\n name: \"click\",\n delegate: ({ toggle }) => `${toggle}:not(.uk-disabled)`,\n handler(e) {\n if (!e.defaultPrevented) {\n e.preventDefault();\n this.show(e.current);\n }\n }\n },\n methods: {\n show(index) {\n const items = uniqueBy(this.toggles.map(toItem), \"source\");\n if (isElement(index)) {\n const { source } = toItem(index);\n index = findIndex(items, ({ source: src }) => source === src);\n }\n this.panel = this.panel || this.$create(\"lightboxPanel\", { ...this.$props, items });\n on(this.panel.$el, \"hidden\", () => this.panel = null);\n return this.panel.show(index);\n },\n hide() {\n var _a;\n return (_a = this.panel) == null ? void 0 : _a.hide();\n }\n }\n };\n function install$3(UIkit, Lightbox) {\n if (!UIkit.lightboxPanel) {\n UIkit.component(\"lightboxPanel\", LightboxPanel);\n }\n assign(Lightbox.props, UIkit.component(\"lightboxPanel\").options.props);\n }\n function toItem(el) {\n const item = {};\n for (const attr2 of [\"href\", \"caption\", \"type\", \"poster\", \"alt\", \"attrs\"]) {\n item[attr2 === \"href\" ? \"source\" : attr2] = data(el, attr2);\n }\n item.attrs = parseOptions(item.attrs);\n return item;\n }\n\n var notification = {\n mixins: [Container],\n functional: true,\n args: [\"message\", \"status\"],\n data: {\n message: \"\",\n status: \"\",\n timeout: 5e3,\n group: \"\",\n pos: \"top-center\",\n clsContainer: \"uk-notification\",\n clsClose: \"uk-notification-close\",\n clsMsg: \"uk-notification-message\"\n },\n install: install$2,\n computed: {\n marginProp: ({ pos }) => `margin-${pos.match(/[a-z]+(?=-)/)[0]}`,\n startProps() {\n return { opacity: 0, [this.marginProp]: -this.$el.offsetHeight };\n }\n },\n created() {\n const posClass = `${this.clsContainer}-${this.pos}`;\n const containerAttr = `data-${this.clsContainer}-container`;\n const container = $(`.${posClass}[${containerAttr}]`, this.container) || append(\n this.container,\n `
    `\n );\n this.$mount(\n append(\n container,\n `
    ${this.message}
    `\n )\n );\n },\n async connected() {\n const margin = toFloat(css(this.$el, this.marginProp));\n await Transition.start(css(this.$el, this.startProps), {\n opacity: 1,\n [this.marginProp]: margin\n });\n if (this.timeout) {\n this.timer = setTimeout(this.close, this.timeout);\n }\n },\n events: {\n click(e) {\n if (e.target.closest('a[href=\"#\"],a[href=\"\"]')) {\n e.preventDefault();\n }\n this.close();\n },\n [pointerEnter]() {\n if (this.timer) {\n clearTimeout(this.timer);\n }\n },\n [pointerLeave]() {\n if (this.timeout) {\n this.timer = setTimeout(this.close, this.timeout);\n }\n }\n },\n methods: {\n async close(immediate) {\n const removeFn = (el) => {\n const container = parent(el);\n trigger(el, \"close\", [this]);\n remove$1(el);\n if (!(container == null ? void 0 : container.hasChildNodes())) {\n remove$1(container);\n }\n };\n if (this.timer) {\n clearTimeout(this.timer);\n }\n if (!immediate) {\n await Transition.start(this.$el, this.startProps);\n }\n removeFn(this.$el);\n }\n }\n };\n function install$2(UIkit) {\n UIkit.notification.closeAll = function(group, immediate) {\n apply(document.body, (el) => {\n const notification = UIkit.getComponent(el, \"notification\");\n if (notification && (!group || group === notification.group)) {\n notification.close(immediate);\n }\n });\n };\n }\n\n var Media = {\n props: {\n media: Boolean\n },\n data: {\n media: false\n },\n connected() {\n const media = toMedia(this.media, this.$el);\n this.matchMedia = true;\n if (media) {\n this.mediaObj = window.matchMedia(media);\n const handler = () => {\n this.matchMedia = this.mediaObj.matches;\n trigger(this.$el, createEvent(\"mediachange\", false, true, [this.mediaObj]));\n };\n this.offMediaObj = on(this.mediaObj, \"change\", () => {\n handler();\n this.$emit(\"resize\");\n });\n handler();\n }\n },\n disconnected() {\n var _a;\n (_a = this.offMediaObj) == null ? void 0 : _a.call(this);\n }\n };\n function toMedia(value, element) {\n if (isString(value)) {\n if (startsWith(value, \"@\")) {\n value = toFloat(css(element, `--uk-breakpoint-${value.slice(1)}`));\n } else if (isNaN(value)) {\n return value;\n }\n }\n return value && isNumeric(value) ? `(min-width: ${value}px)` : \"\";\n }\n\n function getMaxPathLength(el) {\n return isVisible(el) ? Math.ceil(Math.max(0, ...$$(\"[stroke]\", el).map((stroke) => stroke.getTotalLength()))) : 0;\n }\n\n const props = {\n x: transformFn,\n y: transformFn,\n rotate: transformFn,\n scale: transformFn,\n color: colorFn,\n backgroundColor: colorFn,\n borderColor: colorFn,\n blur: filterFn,\n hue: filterFn,\n fopacity: filterFn,\n grayscale: filterFn,\n invert: filterFn,\n saturate: filterFn,\n sepia: filterFn,\n opacity: cssPropFn,\n stroke: strokeFn,\n bgx: backgroundFn,\n bgy: backgroundFn\n };\n const { keys } = Object;\n var Parallax = {\n mixins: [Media],\n props: fillObject(keys(props), \"list\"),\n data: fillObject(keys(props), void 0),\n computed: {\n props(properties, $el) {\n const stops = {};\n for (const prop in properties) {\n if (prop in props && !isUndefined(properties[prop])) {\n stops[prop] = properties[prop].slice();\n }\n }\n const result = {};\n for (const prop in stops) {\n result[prop] = props[prop](prop, $el, stops[prop], stops);\n }\n return result;\n }\n },\n events: {\n load() {\n this.$emit();\n }\n },\n methods: {\n reset() {\n for (const prop in this.getCss(0)) {\n css(this.$el, prop, \"\");\n }\n },\n getCss(percent) {\n const css2 = {};\n for (const prop in this.props) {\n this.props[prop](css2, clamp(percent));\n }\n css2.willChange = Object.keys(css2).map(propName).join(\",\");\n return css2;\n }\n }\n };\n function transformFn(prop, el, stops) {\n let unit = getUnit(stops) || { x: \"px\", y: \"px\", rotate: \"deg\" }[prop] || \"\";\n let transformFn2;\n if (prop === \"x\" || prop === \"y\") {\n prop = `translate${ucfirst(prop)}`;\n transformFn2 = (stop) => toFloat(toFloat(stop).toFixed(unit === \"px\" ? 0 : 6));\n } else if (prop === \"scale\") {\n unit = \"\";\n transformFn2 = (stop) => {\n var _a;\n return getUnit([stop]) ? toPx(stop, \"width\", el, true) / el[`offset${((_a = stop.endsWith) == null ? void 0 : _a.call(stop, \"vh\")) ? \"Height\" : \"Width\"}`] : toFloat(stop);\n };\n }\n if (stops.length === 1) {\n stops.unshift(prop === \"scale\" ? 1 : 0);\n }\n stops = parseStops(stops, transformFn2);\n return (css2, percent) => {\n css2.transform = `${css2.transform || \"\"} ${prop}(${getValue(stops, percent)}${unit})`;\n };\n }\n function colorFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(getCssValue(el, prop, \"\"));\n }\n stops = parseStops(stops, (stop) => parseColor(el, stop));\n return (css2, percent) => {\n const [start, end, p] = getStop(stops, percent);\n const value = start.map((value2, i) => {\n value2 += p * (end[i] - value2);\n return i === 3 ? toFloat(value2) : parseInt(value2, 10);\n }).join(\",\");\n css2[prop] = `rgba(${value})`;\n };\n }\n function parseColor(el, color) {\n return getCssValue(el, \"color\", color).split(/[(),]/g).slice(1, -1).concat(1).slice(0, 4).map(toFloat);\n }\n function filterFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const unit = getUnit(stops) || { blur: \"px\", hue: \"deg\" }[prop] || \"%\";\n prop = { fopacity: \"opacity\", hue: \"hue-rotate\" }[prop] || prop;\n stops = parseStops(stops);\n return (css2, percent) => {\n const value = getValue(stops, percent);\n css2.filter = `${css2.filter || \"\"} ${prop}(${value + unit})`;\n };\n }\n function cssPropFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(getCssValue(el, prop, \"\"));\n }\n stops = parseStops(stops);\n return (css2, percent) => {\n css2[prop] = getValue(stops, percent);\n };\n }\n function strokeFn(prop, el, stops) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const unit = getUnit(stops);\n const length = getMaxPathLength(el);\n stops = parseStops(stops.reverse(), (stop) => {\n stop = toFloat(stop);\n return unit === \"%\" ? stop * length / 100 : stop;\n });\n if (!stops.some(([value]) => value)) {\n return noop;\n }\n css(el, \"strokeDasharray\", length);\n return (css2, percent) => {\n css2.strokeDashoffset = getValue(stops, percent);\n };\n }\n function backgroundFn(prop, el, stops, props2) {\n if (stops.length === 1) {\n stops.unshift(0);\n }\n const attr = prop === \"bgy\" ? \"height\" : \"width\";\n props2[prop] = parseStops(stops, (stop) => toPx(stop, attr, el));\n const bgProps = [\"bgx\", \"bgy\"].filter((prop2) => prop2 in props2);\n if (bgProps.length === 2 && prop === \"bgx\") {\n return noop;\n }\n if (getCssValue(el, \"backgroundSize\", \"\") === \"cover\") {\n return backgroundCoverFn(prop, el, stops, props2);\n }\n const positions = {};\n for (const prop2 of bgProps) {\n positions[prop2] = getBackgroundPos(el, prop2);\n }\n return setBackgroundPosFn(bgProps, positions, props2);\n }\n function backgroundCoverFn(prop, el, stops, props2) {\n const dimImage = getBackgroundImageDimensions(el);\n if (!dimImage.width) {\n return noop;\n }\n const dimEl = {\n width: el.offsetWidth,\n height: el.offsetHeight\n };\n const bgProps = [\"bgx\", \"bgy\"].filter((prop2) => prop2 in props2);\n const positions = {};\n for (const prop2 of bgProps) {\n const values = props2[prop2].map(([value]) => value);\n const min = Math.min(...values);\n const max = Math.max(...values);\n const down = values.indexOf(min) < values.indexOf(max);\n const diff = max - min;\n positions[prop2] = `${(down ? -diff : 0) - (down ? min : max)}px`;\n dimEl[prop2 === \"bgy\" ? \"height\" : \"width\"] += diff;\n }\n const dim = Dimensions.cover(dimImage, dimEl);\n for (const prop2 of bgProps) {\n const attr = prop2 === \"bgy\" ? \"height\" : \"width\";\n const overflow = dim[attr] - dimEl[attr];\n positions[prop2] = `max(${getBackgroundPos(el, prop2)},-${overflow}px) + ${positions[prop2]}`;\n }\n const fn = setBackgroundPosFn(bgProps, positions, props2);\n return (css2, percent) => {\n fn(css2, percent);\n css2.backgroundSize = `${dim.width}px ${dim.height}px`;\n css2.backgroundRepeat = \"no-repeat\";\n };\n }\n function getBackgroundPos(el, prop) {\n return getCssValue(el, `background-position-${prop.slice(-1)}`, \"\");\n }\n function setBackgroundPosFn(bgProps, positions, props2) {\n return function(css2, percent) {\n for (const prop of bgProps) {\n const value = getValue(props2[prop], percent);\n css2[`background-position-${prop.slice(-1)}`] = `calc(${positions[prop]} + ${value}px)`;\n }\n };\n }\n const loading = {};\n const dimensions = {};\n function getBackgroundImageDimensions(el) {\n const src = css(el, \"backgroundImage\").replace(/^none|url\\([\"']?(.+?)[\"']?\\)$/, \"$1\");\n if (dimensions[src]) {\n return dimensions[src];\n }\n const image = new Image();\n if (src) {\n image.src = src;\n if (!image.naturalWidth && !loading[src]) {\n once(image, \"error load\", () => {\n dimensions[src] = toDimensions(image);\n trigger(el, createEvent(\"load\", false));\n });\n loading[src] = true;\n return toDimensions(image);\n }\n }\n return dimensions[src] = toDimensions(image);\n }\n function toDimensions(image) {\n return {\n width: image.naturalWidth,\n height: image.naturalHeight\n };\n }\n function parseStops(stops, fn = toFloat) {\n const result = [];\n const { length } = stops;\n let nullIndex = 0;\n for (let i = 0; i < length; i++) {\n let [value, percent] = isString(stops[i]) ? stops[i].trim().split(/ (?![^(]*\\))/) : [stops[i]];\n value = fn(value);\n percent = percent ? toFloat(percent) / 100 : null;\n if (i === 0) {\n if (percent === null) {\n percent = 0;\n } else if (percent) {\n result.push([value, 0]);\n }\n } else if (i === length - 1) {\n if (percent === null) {\n percent = 1;\n } else if (percent !== 1) {\n result.push([value, percent]);\n percent = 1;\n }\n }\n result.push([value, percent]);\n if (percent === null) {\n nullIndex++;\n } else if (nullIndex) {\n const leftPercent = result[i - nullIndex - 1][1];\n const p = (percent - leftPercent) / (nullIndex + 1);\n for (let j = nullIndex; j > 0; j--) {\n result[i - j][1] = leftPercent + p * (nullIndex - j + 1);\n }\n nullIndex = 0;\n }\n }\n return result;\n }\n function getStop(stops, percent) {\n const index = findIndex(stops.slice(1), ([, targetPercent]) => percent <= targetPercent) + 1;\n return [\n stops[index - 1][0],\n stops[index][0],\n (percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])\n ];\n }\n function getValue(stops, percent) {\n const [start, end, p] = getStop(stops, percent);\n return start + Math.abs(start - end) * p * (start < end ? 1 : -1);\n }\n const unitRe = /^-?\\d+(?:\\.\\d+)?(\\S+)?/;\n function getUnit(stops, defaultUnit) {\n var _a;\n for (const stop of stops) {\n const match = (_a = stop.match) == null ? void 0 : _a.call(stop, unitRe);\n if (match) {\n return match[1];\n }\n }\n return defaultUnit;\n }\n function getCssValue(el, prop, value) {\n const prev = el.style[prop];\n const val = css(css(el, prop, value), prop);\n el.style[prop] = prev;\n return val;\n }\n function fillObject(keys2, value) {\n return keys2.reduce((data, prop) => {\n data[prop] = value;\n return data;\n }, {});\n }\n function ease(percent, easing) {\n return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, 1 - easing);\n }\n\n var parallax = {\n mixins: [Parallax],\n props: {\n target: String,\n viewport: Number,\n // Deprecated\n easing: Number,\n start: String,\n end: String\n },\n data: {\n target: false,\n viewport: 1,\n easing: 1,\n start: 0,\n end: 0\n },\n computed: {\n target: ({ target }, $el) => getOffsetElement(target && query(target, $el) || $el),\n start({ start }) {\n return toPx(start, \"height\", this.target, true);\n },\n end({ end, viewport: viewport2 }) {\n return toPx(\n end || (viewport2 = (1 - viewport2) * 100) && `${viewport2}vh+${viewport2}%`,\n \"height\",\n this.target,\n true\n );\n }\n },\n observe: [\n viewport(),\n scroll$1({ target: ({ target }) => target }),\n resize({ target: ({ $el, target }) => [$el, target, scrollParent(target, true)] })\n ],\n update: {\n read({ percent }, types) {\n if (!types.has(\"scroll\")) {\n percent = false;\n }\n if (!isVisible(this.$el)) {\n return false;\n }\n if (!this.matchMedia) {\n return;\n }\n const prev = percent;\n percent = ease(scrolledOver(this.target, this.start, this.end), this.easing);\n return {\n percent,\n style: prev === percent ? false : this.getCss(percent)\n };\n },\n write({ style }) {\n if (!this.matchMedia) {\n this.reset();\n return;\n }\n style && css(this.$el, style);\n },\n events: [\"scroll\", \"resize\"]\n }\n };\n function getOffsetElement(el) {\n return el ? \"offsetTop\" in el ? el : getOffsetElement(parent(el)) : document.documentElement;\n }\n\n var SliderParallax = {\n props: {\n parallax: Boolean,\n parallaxTarget: Boolean,\n parallaxStart: String,\n parallaxEnd: String,\n parallaxEasing: Number\n },\n data: {\n parallax: false,\n parallaxTarget: false,\n parallaxStart: 0,\n parallaxEnd: 0,\n parallaxEasing: 0\n },\n observe: [\n resize({\n target: ({ $el, parallaxTarget }) => [$el, parallaxTarget],\n filter: ({ parallax }) => parallax\n }),\n scroll$1({ filter: ({ parallax }) => parallax })\n ],\n computed: {\n parallaxTarget({ parallaxTarget }, $el) {\n return parallaxTarget && query(parallaxTarget, $el) || this.list;\n }\n },\n update: {\n read() {\n if (!this.parallax) {\n return false;\n }\n const target = this.parallaxTarget;\n if (!target) {\n return false;\n }\n const start = toPx(this.parallaxStart, \"height\", target, true);\n const end = toPx(this.parallaxEnd, \"height\", target, true);\n const percent = ease(scrolledOver(target, start, end), this.parallaxEasing);\n return { parallax: this.getIndexAt(percent) };\n },\n write({ parallax }) {\n const [prevIndex, slidePercent] = parallax;\n const nextIndex = this.getValidIndex(prevIndex + Math.ceil(slidePercent));\n const prev = this.slides[prevIndex];\n const next = this.slides[nextIndex];\n const { triggerShow, triggerShown, triggerHide, triggerHidden } = useTriggers(this);\n if (~this.prevIndex) {\n for (const i of /* @__PURE__ */ new Set([this.index, this.prevIndex])) {\n if (!includes([nextIndex, prevIndex], i)) {\n triggerHide(this.slides[i]);\n triggerHidden(this.slides[i]);\n }\n }\n }\n const changed = this.prevIndex !== prevIndex || this.index !== nextIndex;\n this.dir = 1;\n this.prevIndex = prevIndex;\n this.index = nextIndex;\n if (prev !== next) {\n triggerHide(prev);\n }\n triggerShow(next);\n if (changed) {\n triggerShown(prev);\n }\n this._translate(prev === next ? 1 : slidePercent, prev, next);\n },\n events: [\"scroll\", \"resize\"]\n },\n methods: {\n getIndexAt(percent) {\n const index = percent * (this.length - 1);\n return [Math.floor(index), index % 1];\n }\n }\n };\n function useTriggers(cmp) {\n const { clsSlideActive, clsEnter, clsLeave } = cmp;\n return { triggerShow, triggerShown, triggerHide, triggerHidden };\n function triggerShow(el) {\n if (hasClass(el, clsLeave)) {\n triggerHide(el);\n triggerHidden(el);\n }\n if (!hasClass(el, clsSlideActive)) {\n trigger(el, \"beforeitemshow\", [cmp]);\n trigger(el, \"itemshow\", [cmp]);\n }\n }\n function triggerShown(el) {\n if (hasClass(el, clsEnter)) {\n trigger(el, \"itemshown\", [cmp]);\n }\n }\n function triggerHide(el) {\n if (!hasClass(el, clsSlideActive)) {\n triggerShow(el);\n }\n if (hasClass(el, clsEnter)) {\n triggerShown(el);\n }\n if (!hasClass(el, clsLeave)) {\n trigger(el, \"beforeitemhide\", [cmp]);\n trigger(el, \"itemhide\", [cmp]);\n }\n }\n function triggerHidden(el) {\n if (hasClass(el, clsLeave)) {\n trigger(el, \"itemhidden\", [cmp]);\n }\n }\n }\n\n var SliderReactive = {\n update: {\n write() {\n if (this.stack.length || this.dragging || this.parallax) {\n return;\n }\n const index = this.getValidIndex();\n if (!~this.prevIndex || this.index !== index) {\n this.show(index);\n } else {\n this._translate(1);\n }\n },\n events: [\"resize\"]\n }\n };\n\n var SliderPreload = {\n observe: lazyload({\n target: ({ slides }) => slides,\n targets: (instance) => instance.getAdjacentSlides()\n }),\n methods: {\n getAdjacentSlides() {\n return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);\n }\n }\n };\n\n function Transitioner(prev, next, dir, { center, easing, list }) {\n const from = prev ? getLeft(prev, list, center) : getLeft(next, list, center) + dimensions$1(next).width * dir;\n const to = next ? getLeft(next, list, center) : from + dimensions$1(prev).width * dir * (isRtl ? -1 : 1);\n const { promise, resolve } = withResolvers();\n return {\n dir,\n show(duration, percent = 0, linear) {\n const timing = linear ? \"linear\" : easing;\n duration -= Math.round(duration * clamp(percent, -1, 1));\n css(list, \"transitionProperty\", \"none\");\n this.translate(percent);\n css(list, \"transitionProperty\", \"\");\n percent = prev ? percent : clamp(percent, 0, 1);\n triggerUpdate(this.getItemIn(), \"itemin\", { percent, duration, timing, dir });\n prev && triggerUpdate(this.getItemIn(true), \"itemout\", {\n percent: 1 - percent,\n duration,\n timing,\n dir\n });\n Transition.start(\n list,\n { transform: translate(-to * (isRtl ? -1 : 1), \"px\") },\n duration,\n timing\n ).then(resolve, noop);\n return promise;\n },\n cancel() {\n return Transition.cancel(list);\n },\n reset() {\n css(list, \"transform\", \"\");\n },\n async forward(duration, percent = this.percent()) {\n await this.cancel();\n return this.show(duration, percent, true);\n },\n translate(percent) {\n if (percent === this.percent()) {\n return;\n }\n const distance = this.getDistance() * dir * (isRtl ? -1 : 1);\n css(\n list,\n \"transform\",\n translate(\n clamp(\n -to + (distance - distance * percent),\n -getWidth(list),\n dimensions$1(list).width\n ) * (isRtl ? -1 : 1),\n \"px\"\n )\n );\n const actives = this.getActives();\n const itemIn = this.getItemIn();\n const itemOut = this.getItemIn(true);\n percent = prev ? clamp(percent, -1, 1) : 0;\n for (const slide of children(list)) {\n const isActive = includes(actives, slide);\n const isIn = slide === itemIn;\n const isOut = slide === itemOut;\n const translateIn = isIn || !isOut && (isActive || dir * (isRtl ? -1 : 1) === -1 ^ getElLeft(slide, list) > getElLeft(prev || next));\n triggerUpdate(slide, `itemtranslate${translateIn ? \"in\" : \"out\"}`, {\n dir,\n percent: isOut ? 1 - percent : isIn ? percent : isActive ? 1 : 0\n });\n }\n },\n percent() {\n return Math.abs(\n (new DOMMatrix(css(list, \"transform\")).m41 * (isRtl ? -1 : 1) + from) / (to - from)\n );\n },\n getDistance() {\n return Math.abs(to - from);\n },\n getItemIn(out = false) {\n let actives = this.getActives();\n let nextActives = inView(list, getLeft(next || prev, list, center));\n if (out) {\n const temp = actives;\n actives = nextActives;\n nextActives = temp;\n }\n return nextActives[findIndex(nextActives, (el) => !includes(actives, el))];\n },\n getActives() {\n return inView(list, getLeft(prev || next, list, center));\n }\n };\n }\n function getLeft(el, list, center) {\n const left = getElLeft(el, list);\n return center ? left - centerEl(el, list) : Math.min(left, getMax(list));\n }\n function getMax(list) {\n return Math.max(0, getWidth(list) - dimensions$1(list).width);\n }\n function getWidth(list, index) {\n return sumBy(children(list).slice(0, index), (el) => dimensions$1(el).width);\n }\n function centerEl(el, list) {\n return dimensions$1(list).width / 2 - dimensions$1(el).width / 2;\n }\n function getElLeft(el, list) {\n return el && (position(el).left + (isRtl ? dimensions$1(el).width - dimensions$1(list).width : 0)) * (isRtl ? -1 : 1) || 0;\n }\n function inView(list, listLeft) {\n listLeft -= 1;\n const listWidth = dimensions$1(list).width;\n const listRight = listLeft + listWidth + 2;\n return children(list).filter((slide) => {\n const slideLeft = getElLeft(slide, list);\n const slideRight = slideLeft + Math.min(dimensions$1(slide).width, listWidth);\n return slideLeft >= listLeft && slideRight <= listRight;\n });\n }\n\n var slider = {\n mixins: [Class, Slider, SliderReactive, SliderParallax, SliderPreload],\n props: {\n center: Boolean,\n sets: Boolean,\n active: String\n },\n data: {\n center: false,\n sets: false,\n attrItem: \"uk-slider-item\",\n selList: \".uk-slider-items\",\n selNav: \".uk-slider-nav\",\n clsContainer: \"uk-slider-container\",\n active: \"all\",\n Transitioner\n },\n computed: {\n finite({ finite }) {\n return finite || isFinite(this.list, this.center);\n },\n maxIndex() {\n if (!this.finite || this.center && !this.sets) {\n return this.length - 1;\n }\n if (this.center) {\n return last(this.sets);\n }\n let lft = 0;\n const max = getMax(this.list);\n const index = findIndex(this.slides, (el) => {\n if (lft >= max) {\n return true;\n }\n lft += dimensions$1(el).width;\n });\n return ~index ? index : this.length - 1;\n },\n sets({ sets: enabled }) {\n if (!enabled || this.parallax) {\n return;\n }\n let left = 0;\n const sets = [];\n const width = dimensions$1(this.list).width;\n for (let i = 0; i < this.length; i++) {\n const slideWidth = dimensions$1(this.slides[i]).width;\n if (left + slideWidth > width) {\n left = 0;\n }\n if (this.center) {\n if (left < width / 2 && left + slideWidth + dimensions$1(this.slides[getIndex(i + 1, this.slides)]).width / 2 > width / 2) {\n sets.push(i);\n left = width / 2 - slideWidth / 2;\n }\n } else if (left === 0) {\n sets.push(Math.min(i, this.maxIndex));\n }\n left += slideWidth;\n }\n if (sets.length) {\n return sets;\n }\n },\n transitionOptions() {\n return {\n center: this.center,\n list: this.list\n };\n },\n slides() {\n return children(this.list).filter(isVisible);\n }\n },\n connected() {\n toggleClass(this.$el, this.clsContainer, !$(`.${this.clsContainer}`, this.$el));\n },\n observe: resize({\n target: ({ slides, $el }) => [$el, ...slides]\n }),\n update: {\n write() {\n for (const el of this.navItems) {\n const index = toNumber(data(el, this.attrItem));\n if (index !== false) {\n el.hidden = !this.maxIndex || index > this.maxIndex || this.sets && !includes(this.sets, index);\n }\n }\n this.reorder();\n if (!this.parallax) {\n this._translate(1);\n }\n this.updateActiveClasses();\n },\n events: [\"resize\"]\n },\n events: {\n beforeitemshow(e) {\n if (!this.dragging && this.sets && this.stack.length < 2 && !includes(this.sets, this.index)) {\n this.index = this.getValidIndex();\n }\n const diff = Math.abs(\n this.index - this.prevIndex + (this.dir > 0 && this.index < this.prevIndex || this.dir < 0 && this.index > this.prevIndex ? (this.maxIndex + 1) * this.dir : 0)\n );\n if (!this.dragging && diff > 1) {\n for (let i = 0; i < diff; i++) {\n this.stack.splice(1, 0, this.dir > 0 ? \"next\" : \"previous\");\n }\n e.preventDefault();\n return;\n }\n const index = this.dir < 0 || !this.slides[this.prevIndex] ? this.index : this.prevIndex;\n const avgWidth = getWidth(this.list) / this.length;\n this.duration = speedUp(avgWidth / this.velocity) * (dimensions$1(this.slides[index]).width / avgWidth);\n this.reorder();\n },\n itemshow() {\n if (~this.prevIndex) {\n addClass(this._getTransitioner().getItemIn(), this.clsActive);\n }\n this.updateActiveClasses(this.prevIndex);\n },\n itemshown() {\n this.updateActiveClasses();\n }\n },\n methods: {\n reorder() {\n if (this.finite) {\n css(this.slides, \"order\", \"\");\n return;\n }\n const index = this.dir > 0 && this.slides[this.prevIndex] ? this.prevIndex : this.index;\n this.slides.forEach(\n (slide, i) => css(\n slide,\n \"order\",\n this.dir > 0 && i < index ? 1 : this.dir < 0 && i >= this.index ? -1 : \"\"\n )\n );\n if (!this.center || !this.length) {\n return;\n }\n const next = this.slides[index];\n let width = dimensions$1(this.list).width / 2 - dimensions$1(next).width / 2;\n let j = 0;\n while (width > 0) {\n const slideIndex = this.getIndex(--j + index, index);\n const slide = this.slides[slideIndex];\n css(slide, \"order\", slideIndex > index ? -2 : -1);\n width -= dimensions$1(slide).width;\n }\n },\n updateActiveClasses(currentIndex = this.index) {\n let actives = this._getTransitioner(currentIndex).getActives();\n if (this.active !== \"all\") {\n actives = [this.slides[this.getValidIndex(currentIndex)]];\n }\n const activeClasses = [\n this.clsActive,\n !this.sets || includes(this.sets, toFloat(this.index)) ? this.clsActivated : \"\"\n ];\n for (const slide of this.slides) {\n const active = includes(actives, slide);\n toggleClass(slide, activeClasses, active);\n attr(slide, \"aria-hidden\", !active);\n for (const focusable of $$(selFocusable, slide)) {\n if (!hasOwn(focusable, \"_tabindex\")) {\n focusable._tabindex = attr(focusable, \"tabindex\");\n }\n attr(focusable, \"tabindex\", active ? focusable._tabindex : -1);\n }\n }\n },\n getValidIndex(index = this.index, prevIndex = this.prevIndex) {\n index = this.getIndex(index, prevIndex);\n if (!this.sets) {\n return index;\n }\n let prev;\n do {\n if (includes(this.sets, index)) {\n return index;\n }\n prev = index;\n index = this.getIndex(index + this.dir, prevIndex);\n } while (index !== prev);\n return index;\n },\n getAdjacentSlides() {\n const { width } = dimensions$1(this.list);\n const left = -width;\n const right = width * 2;\n const slideWidth = dimensions$1(this.slides[this.index]).width;\n const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;\n const slides = /* @__PURE__ */ new Set();\n for (const i of [-1, 1]) {\n let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);\n let j = 0;\n do {\n const slide = this.slides[this.getIndex(this.index + i + j++ * i)];\n currentLeft += dimensions$1(slide).width * i;\n slides.add(slide);\n } while (this.length > j && currentLeft > left && currentLeft < right);\n }\n return Array.from(slides);\n },\n getIndexAt(percent) {\n let index = -1;\n const scrollDist = this.center ? getWidth(this.list) - (dimensions$1(this.slides[0]).width / 2 + dimensions$1(last(this.slides)).width / 2) : getWidth(this.list, this.maxIndex);\n let dist = percent * scrollDist;\n let slidePercent = 0;\n do {\n const slideWidth = dimensions$1(this.slides[++index]).width;\n const slideDist = this.center ? slideWidth / 2 + dimensions$1(this.slides[index + 1]).width / 2 : slideWidth;\n slidePercent = dist / slideDist % 1;\n dist -= slideDist;\n } while (dist >= 0 && index < this.maxIndex);\n return [index, slidePercent];\n }\n }\n };\n function isFinite(list, center) {\n if (!list || list.length < 2) {\n return true;\n }\n const { width: listWidth } = dimensions$1(list);\n if (!center) {\n return Math.ceil(getWidth(list)) < Math.trunc(listWidth + getMaxElWidth(list));\n }\n const slides = children(list);\n const listHalf = Math.trunc(listWidth / 2);\n for (const index in slides) {\n const slide = slides[index];\n const slideWidth = dimensions$1(slide).width;\n const slidesInView = /* @__PURE__ */ new Set([slide]);\n let diff = 0;\n for (const i of [-1, 1]) {\n let left = slideWidth / 2;\n let j = 0;\n while (left < listHalf) {\n const nextSlide = slides[getIndex(+index + i + j++ * i, slides)];\n if (slidesInView.has(nextSlide)) {\n return true;\n }\n left += dimensions$1(nextSlide).width;\n slidesInView.add(nextSlide);\n }\n diff = Math.max(\n diff,\n slideWidth / 2 + dimensions$1(slides[getIndex(+index + i, slides)]).width / 2 - (left - listHalf)\n );\n }\n if (Math.trunc(diff) > sumBy(\n slides.filter((slide2) => !slidesInView.has(slide2)),\n (slide2) => dimensions$1(slide2).width\n )) {\n return true;\n }\n }\n return false;\n }\n function getMaxElWidth(list) {\n return Math.max(0, ...children(list).map((el) => dimensions$1(el).width));\n }\n\n var sliderParallax = {\n mixins: [Parallax],\n beforeConnect() {\n this.item = this.$el.closest(`.${this.$options.id.replace(\"parallax\", \"items\")} > *`);\n },\n disconnected() {\n this.item = null;\n },\n events: [\n {\n name: \"itemin itemout\",\n self: true,\n el: ({ item }) => item,\n handler({ type, detail: { percent, duration, timing, dir } }) {\n fastdom.read(() => {\n if (!this.matchMedia) {\n return;\n }\n const propsFrom = this.getCss(getCurrentPercent(type, dir, percent));\n const propsTo = this.getCss(isIn(type) ? 0.5 : dir > 0 ? 1 : 0);\n fastdom.write(() => {\n css(this.$el, propsFrom);\n Transition.start(this.$el, propsTo, duration, timing).catch(noop);\n });\n });\n }\n },\n {\n name: \"transitioncanceled transitionend\",\n self: true,\n el: ({ item }) => item,\n handler() {\n Transition.cancel(this.$el);\n }\n },\n {\n name: \"itemtranslatein itemtranslateout\",\n self: true,\n el: ({ item }) => item,\n handler({ type, detail: { percent, dir } }) {\n fastdom.read(() => {\n if (!this.matchMedia) {\n this.reset();\n return;\n }\n const props = this.getCss(getCurrentPercent(type, dir, percent));\n fastdom.write(() => css(this.$el, props));\n });\n }\n }\n ]\n };\n function isIn(type) {\n return endsWith(type, \"in\");\n }\n function getCurrentPercent(type, dir, percent) {\n percent /= 2;\n return isIn(type) ^ dir < 0 ? percent : 1 - percent;\n }\n\n var Animations = {\n ...Animations$2,\n fade: {\n show() {\n return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [{ opacity: 1 - percent, zIndex: 0 }, { zIndex: -1 }];\n }\n },\n scale: {\n show() {\n return [{ opacity: 0, transform: scale3d(1 + 0.5), zIndex: 0 }, { zIndex: -1 }];\n },\n percent(current) {\n return 1 - css(current, \"opacity\");\n },\n translate(percent) {\n return [\n { opacity: 1 - percent, transform: scale3d(1 + 0.5 * percent), zIndex: 0 },\n { zIndex: -1 }\n ];\n }\n },\n pull: {\n show(dir) {\n return dir < 0 ? [\n { transform: translate(30), zIndex: -1 },\n { transform: translate(), zIndex: 0 }\n ] : [\n { transform: translate(-100), zIndex: 0 },\n { transform: translate(), zIndex: -1 }\n ];\n },\n percent(current, next, dir) {\n return dir < 0 ? 1 - translated(next) : translated(current);\n },\n translate(percent, dir) {\n return dir < 0 ? [\n { transform: translate(30 * percent), zIndex: -1 },\n { transform: translate(-100 * (1 - percent)), zIndex: 0 }\n ] : [\n { transform: translate(-percent * 100), zIndex: 0 },\n { transform: translate(30 * (1 - percent)), zIndex: -1 }\n ];\n }\n },\n push: {\n show(dir) {\n return dir < 0 ? [\n { transform: translate(100), zIndex: 0 },\n { transform: translate(), zIndex: -1 }\n ] : [\n { transform: translate(-30), zIndex: -1 },\n { transform: translate(), zIndex: 0 }\n ];\n },\n percent(current, next, dir) {\n return dir > 0 ? 1 - translated(next) : translated(current);\n },\n translate(percent, dir) {\n return dir < 0 ? [\n { transform: translate(percent * 100), zIndex: 0 },\n { transform: translate(-30 * (1 - percent)), zIndex: -1 }\n ] : [\n { transform: translate(-30 * percent), zIndex: -1 },\n { transform: translate(100 * (1 - percent)), zIndex: 0 }\n ];\n }\n }\n };\n\n var slideshow = {\n mixins: [Class, Slideshow, SliderReactive, SliderParallax, SliderPreload],\n props: {\n ratio: String,\n minHeight: String,\n maxHeight: String\n },\n data: {\n ratio: \"16:9\",\n minHeight: void 0,\n maxHeight: void 0,\n selList: \".uk-slideshow-items\",\n attrItem: \"uk-slideshow-item\",\n selNav: \".uk-slideshow-nav\",\n Animations\n },\n watch: {\n list(list) {\n css(list, {\n aspectRatio: this.ratio ? this.ratio.replace(\":\", \"/\") : void 0,\n minHeight: this.minHeight,\n maxHeight: this.maxHeight,\n minWidth: \"100%\",\n maxWidth: \"100%\"\n });\n }\n },\n methods: {\n getAdjacentSlides() {\n return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);\n }\n }\n };\n\n var sortable = {\n mixins: [Class, Animate],\n props: {\n group: String,\n threshold: Number,\n clsItem: String,\n clsPlaceholder: String,\n clsDrag: String,\n clsDragState: String,\n clsBase: String,\n clsNoDrag: String,\n clsEmpty: String,\n clsCustom: String,\n handle: String\n },\n data: {\n group: false,\n threshold: 5,\n clsItem: \"uk-sortable-item\",\n clsPlaceholder: \"uk-sortable-placeholder\",\n clsDrag: \"uk-sortable-drag\",\n clsDragState: \"uk-drag\",\n clsBase: \"uk-sortable\",\n clsNoDrag: \"uk-sortable-nodrag\",\n clsEmpty: \"uk-sortable-empty\",\n clsCustom: \"\",\n handle: false,\n pos: {}\n },\n events: {\n name: pointerDown$1,\n passive: false,\n handler: \"init\"\n },\n computed: {\n target: (_, $el) => ($el.tBodies || [$el])[0],\n items() {\n return children(this.target);\n },\n isEmpty() {\n return !this.items.length;\n },\n handles({ handle }, $el) {\n return handle ? $$(handle, $el) : this.items;\n }\n },\n watch: {\n isEmpty(empty) {\n toggleClass(this.target, this.clsEmpty, empty);\n },\n handles(handles, prev) {\n css(prev, { touchAction: \"\", userSelect: \"\" });\n css(handles, { touchAction: \"none\", userSelect: \"none\" });\n }\n },\n update: {\n write(data) {\n if (!this.drag || !parent(this.placeholder)) {\n return;\n }\n const {\n pos: { x, y },\n origin: { offsetTop, offsetLeft },\n placeholder\n } = this;\n css(this.drag, {\n top: y - offsetTop,\n left: x - offsetLeft\n });\n const sortable = this.getSortable(document.elementFromPoint(x, y));\n if (!sortable) {\n return;\n }\n const { items } = sortable;\n if (items.some(Transition.inProgress)) {\n return;\n }\n const target = findTarget(items, { x, y });\n if (items.length && (!target || target === placeholder)) {\n return;\n }\n const previous = this.getSortable(placeholder);\n const insertTarget = findInsertTarget(\n sortable.target,\n target,\n placeholder,\n x,\n y,\n sortable === previous && data.moved !== target\n );\n if (insertTarget === false) {\n return;\n }\n if (insertTarget && placeholder === insertTarget) {\n return;\n }\n if (sortable !== previous) {\n previous.remove(placeholder);\n data.moved = target;\n } else {\n delete data.moved;\n }\n sortable.insert(placeholder, insertTarget);\n this.touched.add(sortable);\n },\n events: [\"move\"]\n },\n methods: {\n init(e) {\n const { target, button, defaultPrevented } = e;\n const [placeholder] = this.items.filter((el) => el.contains(target));\n if (!placeholder || defaultPrevented || button > 0 || isInput(target) || target.closest(`.${this.clsNoDrag}`) || this.handle && !target.closest(this.handle)) {\n return;\n }\n e.preventDefault();\n this.pos = getEventPos(e);\n this.touched = /* @__PURE__ */ new Set([this]);\n this.placeholder = placeholder;\n this.origin = { target, index: index(placeholder), ...this.pos };\n on(document, pointerMove$1, this.move);\n on(document, pointerUp$1, this.end);\n if (!this.threshold) {\n this.start(e);\n }\n },\n start(e) {\n this.drag = appendDrag(this.$container, this.placeholder);\n const { left, top } = dimensions$1(this.placeholder);\n assign(this.origin, { offsetLeft: this.pos.x - left, offsetTop: this.pos.y - top });\n addClass(this.drag, this.clsDrag, this.clsCustom);\n addClass(this.placeholder, this.clsPlaceholder);\n addClass(this.items, this.clsItem);\n addClass(document.documentElement, this.clsDragState);\n trigger(this.$el, \"start\", [this, this.placeholder]);\n trackScroll(this.pos);\n this.move(e);\n },\n move: throttle(function(e) {\n assign(this.pos, getEventPos(e));\n if (!this.drag && (Math.abs(this.pos.x - this.origin.x) > this.threshold || Math.abs(this.pos.y - this.origin.y) > this.threshold)) {\n this.start(e);\n }\n this.$emit(\"move\");\n }),\n end() {\n off(document, pointerMove$1, this.move);\n off(document, pointerUp$1, this.end);\n if (!this.drag) {\n return;\n }\n untrackScroll();\n const sortable = this.getSortable(this.placeholder);\n if (this === sortable) {\n if (this.origin.index !== index(this.placeholder)) {\n trigger(this.$el, \"moved\", [this, this.placeholder]);\n }\n } else {\n trigger(sortable.$el, \"added\", [sortable, this.placeholder]);\n trigger(this.$el, \"removed\", [this, this.placeholder]);\n }\n trigger(this.$el, \"stop\", [this, this.placeholder]);\n remove$1(this.drag);\n this.drag = null;\n for (const { clsPlaceholder, clsItem } of this.touched) {\n for (const sortable2 of this.touched) {\n removeClass(sortable2.items, clsPlaceholder, clsItem);\n }\n }\n this.touched = null;\n removeClass(document.documentElement, this.clsDragState);\n },\n insert(element, target) {\n addClass(this.items, this.clsItem);\n if (target && target.previousElementSibling !== element) {\n this.animate(() => before(target, element));\n } else if (!target && this.target.lastElementChild !== element) {\n this.animate(() => append(this.target, element));\n }\n },\n remove(element) {\n if (this.target.contains(element)) {\n this.animate(() => remove$1(element));\n }\n },\n getSortable(element) {\n do {\n const sortable = this.$getComponent(element, \"sortable\");\n if (sortable && (sortable === this || this.group !== false && sortable.group === this.group)) {\n return sortable;\n }\n } while (element = parent(element));\n }\n }\n };\n let trackTimer;\n function trackScroll(pos) {\n let last = Date.now();\n trackTimer = setInterval(() => {\n let { x, y } = pos;\n y += document.scrollingElement.scrollTop;\n const dist = (Date.now() - last) * 0.3;\n last = Date.now();\n scrollParents(document.elementFromPoint(x, pos.y)).reverse().some((scrollEl) => {\n let { scrollTop: scroll, scrollHeight } = scrollEl;\n const { top, bottom, height: height2 } = offsetViewport(scrollEl);\n if (top < y && top + 35 > y) {\n scroll -= dist;\n } else if (bottom > y && bottom - 35 < y) {\n scroll += dist;\n } else {\n return;\n }\n if (scroll > 0 && scroll < scrollHeight - height2) {\n scrollEl.scrollTop = scroll;\n return true;\n }\n });\n }, 15);\n }\n function untrackScroll() {\n clearInterval(trackTimer);\n }\n function appendDrag(container, element) {\n let clone;\n if (isTag(element, \"li\", \"tr\")) {\n clone = $(\"
    \");\n append(clone, element.cloneNode(true).children);\n for (const attribute of element.getAttributeNames()) {\n attr(clone, attribute, element.getAttribute(attribute));\n }\n } else {\n clone = element.cloneNode(true);\n }\n append(container, clone);\n css(clone, \"margin\", \"0\", \"important\");\n css(clone, {\n boxSizing: \"border-box\",\n width: element.offsetWidth,\n height: element.offsetHeight,\n padding: css(element, \"padding\")\n });\n height(clone.firstElementChild, height(element.firstElementChild));\n return clone;\n }\n function findTarget(items, point) {\n return items[findIndex(items, (item) => pointInRect(point, dimensions$1(item)))];\n }\n function findInsertTarget(list, target, placeholder, x, y, sameList) {\n if (!children(list).length) {\n return;\n }\n const rect = dimensions$1(target);\n if (!sameList) {\n if (!isHorizontal(list, placeholder)) {\n return y < rect.top + rect.height / 2 ? target : target.nextElementSibling;\n }\n return target;\n }\n const placeholderRect = dimensions$1(placeholder);\n const sameRow = linesIntersect(\n [rect.top, rect.bottom],\n [placeholderRect.top, placeholderRect.bottom]\n );\n const [pointerPos, lengthProp, startProp, endProp] = sameRow ? [x, \"width\", \"left\", \"right\"] : [y, \"height\", \"top\", \"bottom\"];\n const diff = placeholderRect[lengthProp] < rect[lengthProp] ? rect[lengthProp] - placeholderRect[lengthProp] : 0;\n if (placeholderRect[startProp] < rect[startProp]) {\n if (diff && pointerPos < rect[startProp] + diff) {\n return false;\n }\n return target.nextElementSibling;\n }\n if (diff && pointerPos > rect[endProp] - diff) {\n return false;\n }\n return target;\n }\n function isHorizontal(list, placeholder) {\n const single = children(list).length === 1;\n if (single) {\n append(list, placeholder);\n }\n const items = children(list);\n const isHorizontal2 = items.some((el, i) => {\n const rectA = dimensions$1(el);\n return items.slice(i + 1).some((el2) => {\n const rectB = dimensions$1(el2);\n return !linesIntersect([rectA.left, rectA.right], [rectB.left, rectB.right]);\n });\n });\n if (single) {\n remove$1(placeholder);\n }\n return isHorizontal2;\n }\n function linesIntersect(lineA, lineB) {\n return lineA[1] > lineB[0] && lineB[1] > lineA[0];\n }\n function throttle(fn) {\n let throttled;\n return function(...args) {\n if (!throttled) {\n throttled = true;\n fn.call(this, ...args);\n requestAnimationFrame(() => throttled = false);\n }\n };\n }\n\n var Position = {\n props: {\n pos: String,\n offset: Boolean,\n flip: Boolean,\n shift: Boolean,\n inset: Boolean\n },\n data: {\n pos: `bottom-${isRtl ? \"right\" : \"left\"}`,\n offset: false,\n flip: true,\n shift: true,\n inset: false\n },\n connected() {\n this.pos = this.$props.pos.split(\"-\").concat(\"center\").slice(0, 2);\n [this.dir, this.align] = this.pos;\n this.axis = includes([\"top\", \"bottom\"], this.dir) ? \"y\" : \"x\";\n },\n methods: {\n positionAt(element, target, boundary) {\n let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];\n const placement = [this.flip && \"flip\", this.shift && \"shift\"];\n const attach = {\n element: [this.inset ? this.dir : flipPosition(this.dir), this.align],\n target: [this.dir, this.align]\n };\n if (this.axis === \"y\") {\n for (const prop in attach) {\n attach[prop].reverse();\n }\n offset.reverse();\n placement.reverse();\n }\n const restoreScrollPosition = storeScrollPosition(element);\n const elDim = dimensions$1(element);\n css(element, { top: -elDim.height, left: -elDim.width });\n positionAt(element, target, {\n attach,\n offset,\n boundary,\n placement,\n viewportOffset: this.getViewportOffset(element)\n });\n restoreScrollPosition();\n },\n getPositionOffset(element = this.$el) {\n return toPx(\n this.offset === false ? css(element, \"--uk-position-offset\") : this.offset,\n this.axis === \"x\" ? \"width\" : \"height\",\n element\n ) * (includes([\"left\", \"top\"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);\n },\n getShiftOffset(element = this.$el) {\n return this.align === \"center\" ? 0 : toPx(\n css(element, \"--uk-position-shift-offset\"),\n this.axis === \"y\" ? \"width\" : \"height\",\n element\n ) * (includes([\"left\", \"top\"], this.align) ? 1 : -1);\n },\n getViewportOffset(element) {\n return toPx(css(element, \"--uk-position-viewport-offset\"));\n }\n }\n };\n function storeScrollPosition(element) {\n const scrollElement = scrollParent(element);\n const { scrollTop } = scrollElement;\n return () => {\n if (scrollTop !== scrollElement.scrollTop) {\n scrollElement.scrollTop = scrollTop;\n }\n };\n }\n\n var tooltip = {\n mixins: [Container, Togglable, Position],\n data: {\n pos: \"top\",\n animation: [\"uk-animation-scale-up\"],\n duration: 100,\n cls: \"uk-active\"\n },\n connected() {\n makeFocusable(this.$el);\n },\n disconnected() {\n this.hide();\n },\n methods: {\n show() {\n if (this.isToggled(this.tooltip || null)) {\n return;\n }\n const { delay = 0, title } = parseProps(this.$options);\n if (!title) {\n return;\n }\n const titleAttr = attr(this.$el, \"title\");\n const off = on(this.$el, [\"blur\", pointerLeave], (e) => !isTouch(e) && this.hide());\n this.reset = () => {\n attr(this.$el, { title: titleAttr, \"aria-describedby\": null });\n off();\n };\n const id = generateId(this);\n attr(this.$el, { title: null, \"aria-describedby\": id });\n clearTimeout(this.showTimer);\n this.showTimer = setTimeout(() => this._show(title, id), delay);\n },\n async hide() {\n var _a;\n if (matches(this.$el, \"input:focus\")) {\n return;\n }\n clearTimeout(this.showTimer);\n if (this.isToggled(this.tooltip || null)) {\n await this.toggleElement(this.tooltip, false, false);\n }\n (_a = this.reset) == null ? void 0 : _a.call(this);\n remove$1(this.tooltip);\n this.tooltip = null;\n },\n async _show(title, id) {\n this.tooltip = append(\n this.container,\n `
    ${title}
    `\n );\n on(this.tooltip, \"toggled\", (e, toggled) => {\n if (!toggled) {\n return;\n }\n const update = () => this.positionAt(this.tooltip, this.$el);\n update();\n const [dir, align] = getAlignment(this.tooltip, this.$el, this.pos);\n this.origin = this.axis === \"y\" ? `${flipPosition(dir)}-${align}` : `${align}-${flipPosition(dir)}`;\n const handlers = [\n once(\n document,\n `keydown ${pointerDown$1}`,\n this.hide,\n false,\n (e2) => e2.type === pointerDown$1 && !this.$el.contains(e2.target) || e2.type === \"keydown\" && e2.keyCode === keyMap.ESC\n ),\n on([document, ...overflowParents(this.$el)], \"scroll\", update, {\n passive: true\n })\n ];\n once(this.tooltip, \"hide\", () => handlers.forEach((handler) => handler()), {\n self: true\n });\n });\n if (!await this.toggleElement(this.tooltip, true)) {\n this.hide();\n }\n }\n },\n events: {\n // Clicking a button does not give it focus on all browsers and platforms\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus\n [`focus ${pointerEnter} ${pointerDown$1}`](e) {\n if (!isTouch(e) || e.type === pointerDown$1) {\n this.show();\n }\n }\n }\n };\n function makeFocusable(el) {\n if (!isFocusable(el)) {\n attr(el, \"tabindex\", \"0\");\n }\n }\n function getAlignment(el, target, [dir, align]) {\n const elOffset = offset(el);\n const targetOffset = offset(target);\n const properties = [\n [\"left\", \"right\"],\n [\"top\", \"bottom\"]\n ];\n for (const props2 of properties) {\n if (elOffset[props2[0]] >= targetOffset[props2[1]]) {\n dir = props2[1];\n break;\n }\n if (elOffset[props2[1]] <= targetOffset[props2[0]]) {\n dir = props2[0];\n break;\n }\n }\n const props = includes(properties[0], dir) ? properties[1] : properties[0];\n align = props.find((prop) => elOffset[prop] === targetOffset[prop]) || \"center\";\n return [dir, align];\n }\n function parseProps(options) {\n const { el, id, data: data$1 } = options;\n return [\"delay\", \"title\"].reduce((obj, key) => ({ [key]: data(el, key), ...obj }), {\n ...parseOptions(data(el, id), [\"title\"]),\n ...data$1\n });\n }\n\n var upload = {\n mixins: [I18n],\n i18n: {\n invalidMime: \"Invalid File Type: %s\",\n invalidName: \"Invalid File Name: %s\",\n invalidSize: \"Invalid File Size: %s Kilobytes Max\"\n },\n props: {\n allow: String,\n clsDragover: String,\n concurrent: Number,\n maxSize: Number,\n method: String,\n mime: String,\n multiple: Boolean,\n name: String,\n params: Object,\n type: String,\n url: String\n },\n data: {\n allow: false,\n clsDragover: \"uk-dragover\",\n concurrent: 1,\n maxSize: 0,\n method: \"POST\",\n mime: false,\n multiple: false,\n name: \"files[]\",\n params: {},\n type: \"\",\n url: \"\",\n abort: noop,\n beforeAll: noop,\n beforeSend: noop,\n complete: noop,\n completeAll: noop,\n error: noop,\n fail: noop,\n load: noop,\n loadEnd: noop,\n loadStart: noop,\n progress: noop\n },\n events: {\n change(e) {\n if (!matches(e.target, 'input[type=\"file\"]')) {\n return;\n }\n e.preventDefault();\n if (e.target.files) {\n this.upload(e.target.files);\n }\n e.target.value = \"\";\n },\n drop(e) {\n stop(e);\n const transfer = e.dataTransfer;\n if (!(transfer == null ? void 0 : transfer.files)) {\n return;\n }\n removeClass(this.$el, this.clsDragover);\n this.upload(transfer.files);\n },\n dragenter(e) {\n stop(e);\n },\n dragover(e) {\n stop(e);\n addClass(this.$el, this.clsDragover);\n },\n dragleave(e) {\n stop(e);\n removeClass(this.$el, this.clsDragover);\n }\n },\n methods: {\n async upload(files) {\n files = toArray(files);\n if (!files.length) {\n return;\n }\n trigger(this.$el, \"upload\", [files]);\n for (const file of files) {\n if (this.maxSize && this.maxSize * 1e3 < file.size) {\n this.fail(this.t(\"invalidSize\", this.maxSize));\n return;\n }\n if (this.allow && !match$1(this.allow, file.name)) {\n this.fail(this.t(\"invalidName\", this.allow));\n return;\n }\n if (this.mime && !match$1(this.mime, file.type)) {\n this.fail(this.t(\"invalidMime\", this.mime));\n return;\n }\n }\n if (!this.multiple) {\n files = files.slice(0, 1);\n }\n this.beforeAll(this, files);\n const chunks = chunk(files, this.concurrent);\n const upload = async (files2) => {\n const data = new FormData();\n files2.forEach((file) => data.append(this.name, file));\n for (const key in this.params) {\n data.append(key, this.params[key]);\n }\n try {\n const xhr = await ajax(this.url, {\n data,\n method: this.method,\n responseType: this.type,\n beforeSend: (env) => {\n const { xhr: xhr2 } = env;\n on(xhr2.upload, \"progress\", this.progress);\n for (const type of [\"loadStart\", \"load\", \"loadEnd\", \"abort\"]) {\n on(xhr2, type.toLowerCase(), this[type]);\n }\n return this.beforeSend(env);\n }\n });\n this.complete(xhr);\n if (chunks.length) {\n await upload(chunks.shift());\n } else {\n this.completeAll(xhr);\n }\n } catch (e) {\n this.error(e);\n }\n };\n await upload(chunks.shift());\n }\n }\n };\n function match$1(pattern, path) {\n return path.match(\n new RegExp(\n `^${pattern.replace(/\\//g, \"\\\\/\").replace(/\\*\\*/g, \"(\\\\/[^\\\\/]+)*\").replace(/\\*/g, \"[^\\\\/]+\").replace(/((?!\\\\))\\?/g, \"$1.\")}$`,\n \"i\"\n )\n );\n }\n function chunk(files, size) {\n const chunks = [];\n for (let i = 0; i < files.length; i += size) {\n chunks.push(files.slice(i, i + size));\n }\n return chunks;\n }\n function stop(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n async function ajax(url, options) {\n const env = {\n data: null,\n method: \"GET\",\n headers: {},\n xhr: new XMLHttpRequest(),\n beforeSend: noop,\n responseType: \"\",\n ...options\n };\n await env.beforeSend(env);\n return send(url, env);\n }\n function send(url, env) {\n return new Promise((resolve, reject) => {\n const { xhr } = env;\n for (const prop in env) {\n if (prop in xhr) {\n try {\n xhr[prop] = env[prop];\n } catch (e) {\n }\n }\n }\n xhr.open(env.method.toUpperCase(), url);\n for (const header in env.headers) {\n xhr.setRequestHeader(header, env.headers[header]);\n }\n on(xhr, \"load\", () => {\n if (xhr.status === 0 || xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {\n resolve(xhr);\n } else {\n reject(\n assign(Error(xhr.statusText), {\n xhr,\n status: xhr.status\n })\n );\n }\n });\n on(xhr, \"error\", () => reject(assign(Error(\"Network Error\"), { xhr })));\n on(xhr, \"timeout\", () => reject(assign(Error(\"Network Timeout\"), { xhr })));\n xhr.send(env.data);\n });\n }\n\n var components$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Countdown: countdown,\n Filter: filter,\n Lightbox: lightbox,\n LightboxPanel: LightboxPanel,\n Notification: notification,\n Parallax: parallax,\n Slider: slider,\n SliderParallax: sliderParallax,\n Slideshow: slideshow,\n SlideshowParallax: sliderParallax,\n Sortable: sortable,\n Tooltip: tooltip,\n Upload: upload\n });\n\n function boot(App) {\n if (inBrowser && window.MutationObserver) {\n if (document.body) {\n requestAnimationFrame(() => init(App));\n } else {\n new MutationObserver((records, observer) => {\n if (document.body) {\n init(App);\n observer.disconnect();\n }\n }).observe(document.documentElement, { childList: true });\n }\n }\n }\n function init(App) {\n trigger(document, \"uikit:init\", App);\n if (document.body) {\n apply(document.body, connect);\n }\n new MutationObserver((records) => records.forEach(applyChildListMutation)).observe(document, {\n subtree: true,\n childList: true\n });\n new MutationObserver((records) => records.forEach(applyAttributeMutation)).observe(document, {\n subtree: true,\n attributes: true\n });\n App._initialized = true;\n }\n function applyChildListMutation({ addedNodes, removedNodes }) {\n for (const node of addedNodes) {\n apply(node, connect);\n }\n for (const node of removedNodes) {\n apply(node, disconnect);\n }\n }\n function applyAttributeMutation({ target, attributeName }) {\n var _a;\n const name = getComponentName(attributeName);\n if (name) {\n if (hasAttr(target, attributeName)) {\n createComponent(name, target);\n } else {\n (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();\n }\n }\n }\n function connect(node) {\n const components2 = getComponents(node);\n for (const name in components2) {\n callConnected(components2[name]);\n }\n for (const attributeName of node.getAttributeNames()) {\n const name = getComponentName(attributeName);\n name && createComponent(name, node);\n }\n }\n function disconnect(node) {\n const components2 = getComponents(node);\n for (const name in components2) {\n callDisconnected(components2[name]);\n }\n }\n function getComponentName(attribute) {\n if (startsWith(attribute, \"data-\")) {\n attribute = attribute.slice(5);\n }\n const cmp = components$2[attribute];\n return cmp && (cmp.options || cmp).name;\n }\n\n globalApi(App);\n instanceApi(App);\n\n var Accordion = {\n mixins: [Class, Togglable],\n props: {\n animation: Boolean,\n targets: String,\n active: null,\n collapsible: Boolean,\n multiple: Boolean,\n toggle: String,\n content: String,\n offset: Number\n },\n data: {\n targets: \"> *\",\n active: false,\n animation: true,\n collapsible: true,\n multiple: false,\n clsOpen: \"uk-open\",\n toggle: \"> .uk-accordion-title\",\n content: \"> .uk-accordion-content\",\n offset: 0\n },\n computed: {\n items: ({ targets }, $el) => $$(targets, $el),\n toggles({ toggle }) {\n return this.items.map((item) => $(toggle, item));\n },\n contents({ content }) {\n return this.items.map((item) => {\n var _a;\n return ((_a = item._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, item);\n });\n }\n },\n watch: {\n items(items, prev) {\n if (prev || hasClass(items, this.clsOpen)) {\n return;\n }\n const active = this.active !== false && items[Number(this.active)] || !this.collapsible && items[0];\n if (active) {\n this.toggle(active, false);\n }\n },\n toggles() {\n this.$emit();\n },\n contents(items) {\n for (const el of items) {\n const isOpen = hasClass(\n this.items.find((item) => item.contains(el)),\n this.clsOpen\n );\n hide(el, !isOpen);\n }\n this.$emit();\n }\n },\n observe: lazyload(),\n events: [\n {\n name: \"click keydown\",\n delegate: ({ targets, $props }) => `${targets} ${$props.toggle}`,\n async handler(e) {\n var _a;\n if (e.type === \"keydown\" && e.keyCode !== keyMap.SPACE) {\n return;\n }\n e.preventDefault();\n (_a = this._off) == null ? void 0 : _a.call(this);\n this._off = keepScrollPosition(e.target);\n await this.toggle(index(this.toggles, e.current));\n this._off();\n }\n },\n {\n name: \"shown hidden\",\n self: true,\n delegate: ({ targets }) => targets,\n handler() {\n this.$emit();\n }\n }\n ],\n update() {\n const activeItems = filter$1(this.items, `.${this.clsOpen}`);\n for (const index2 in this.items) {\n const toggle = this.toggles[index2];\n const content = this.contents[index2];\n if (!toggle || !content) {\n continue;\n }\n toggle.id = generateId(this, toggle);\n content.id = generateId(this, content);\n const active = includes(activeItems, this.items[index2]);\n attr(toggle, {\n role: isTag(toggle, \"a\") ? \"button\" : null,\n \"aria-controls\": content.id,\n \"aria-expanded\": active,\n \"aria-disabled\": !this.collapsible && activeItems.length < 2 && active\n });\n attr(content, { role: \"region\", \"aria-labelledby\": toggle.id });\n if (isTag(content, \"ul\")) {\n attr(children(content), \"role\", \"presentation\");\n }\n }\n },\n methods: {\n toggle(item, animate) {\n item = this.items[getIndex(item, this.items)];\n let items = [item];\n const activeItems = filter$1(this.items, `.${this.clsOpen}`);\n if (!this.multiple && !includes(activeItems, items[0])) {\n items = items.concat(activeItems);\n }\n if (!this.collapsible && activeItems.length < 2 && includes(activeItems, item)) {\n return;\n }\n return Promise.all(\n items.map(\n (el) => this.toggleElement(el, !includes(activeItems, el), (el2, show) => {\n toggleClass(el2, this.clsOpen, show);\n if (animate === false || !this.animation) {\n hide($(this.content, el2), !show);\n return;\n }\n return transition(el2, show, this);\n })\n )\n );\n }\n }\n };\n function hide(el, hide2) {\n el && (el.hidden = hide2);\n }\n async function transition(el, show, { content, duration, velocity, transition: transition2 }) {\n var _a;\n content = ((_a = el._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, el);\n if (!el._wrapper) {\n el._wrapper = wrapAll(content, \"
    \");\n }\n const wrapper = el._wrapper;\n css(wrapper, \"overflow\", \"hidden\");\n const currentHeight = toFloat(css(wrapper, \"height\"));\n await Transition.cancel(wrapper);\n hide(content, false);\n const endHeight = sumBy([\"marginTop\", \"marginBottom\"], (prop) => css(content, prop)) + dimensions$1(content).height;\n const percent = currentHeight / endHeight;\n duration = (velocity * endHeight + duration) * (show ? 1 - percent : percent);\n css(wrapper, \"height\", currentHeight);\n await Transition.start(wrapper, { height: show ? endHeight : 0 }, duration, transition2);\n unwrap(content);\n delete el._wrapper;\n if (!show) {\n hide(content, true);\n }\n }\n function keepScrollPosition(el) {\n const scrollElement = scrollParent(el, true);\n let frame;\n (function scroll() {\n frame = requestAnimationFrame(() => {\n const { top } = dimensions$1(el);\n if (top < 0) {\n scrollElement.scrollTop += top;\n }\n scroll();\n });\n })();\n return () => requestAnimationFrame(() => cancelAnimationFrame(frame));\n }\n\n var alert = {\n mixins: [Class, Togglable],\n args: \"animation\",\n props: {\n animation: Boolean,\n close: String\n },\n data: {\n animation: true,\n selClose: \".uk-alert-close\",\n duration: 150\n },\n events: {\n name: \"click\",\n delegate: ({ selClose }) => selClose,\n handler(e) {\n e.preventDefault();\n this.close();\n }\n },\n methods: {\n async close() {\n await this.toggleElement(this.$el, false, animate);\n this.$destroy(true);\n }\n }\n };\n function animate(el, show, { duration, transition, velocity }) {\n const height = toFloat(css(el, \"height\"));\n css(el, \"height\", height);\n return Transition.start(\n el,\n {\n height: 0,\n marginTop: 0,\n marginBottom: 0,\n paddingTop: 0,\n paddingBottom: 0,\n borderTop: 0,\n borderBottom: 0,\n opacity: 0\n },\n velocity * height + duration,\n transition\n );\n }\n\n var Video = {\n args: \"autoplay\",\n props: {\n automute: Boolean,\n autoplay: Boolean\n },\n data: {\n automute: false,\n autoplay: true\n },\n beforeConnect() {\n if (this.autoplay === \"inview\" && !hasAttr(this.$el, \"preload\")) {\n this.$el.preload = \"none\";\n }\n if (isTag(this.$el, \"iframe\") && !hasAttr(this.$el, \"allow\")) {\n this.$el.allow = \"autoplay\";\n }\n if (this.autoplay === \"hover\") {\n if (isTag(this.$el, \"video\")) {\n this.$el.tabindex = 0;\n } else {\n this.autoplay = true;\n }\n }\n if (this.automute) {\n mute(this.$el);\n }\n },\n events: [\n {\n name: `${pointerEnter} focusin`,\n filter: ({ autoplay }) => includes(autoplay, \"hover\"),\n handler(e) {\n if (!isTouch(e) || !isPlaying(this.$el)) {\n play(this.$el);\n } else {\n pause(this.$el);\n }\n }\n },\n {\n name: `${pointerLeave} focusout`,\n filter: ({ autoplay }) => includes(autoplay, \"hover\"),\n handler(e) {\n if (!isTouch(e)) {\n pause(this.$el);\n }\n }\n }\n ],\n observe: [\n intersection({\n filter: ({ $el, autoplay }) => autoplay && autoplay !== \"hover\" && isVideo($el),\n handler([{ isIntersecting }]) {\n if (!document.fullscreenElement) {\n if (isIntersecting) {\n play(this.$el);\n } else {\n pause(this.$el);\n }\n }\n },\n args: { intersecting: false },\n options: ({ $el, autoplay }) => ({ root: autoplay === \"inview\" ? null : parent($el) })\n })\n ]\n };\n function isPlaying(videoEl) {\n return !videoEl.paused && !videoEl.ended;\n }\n\n var cover = {\n mixins: [Video],\n props: {\n width: Number,\n height: Number\n },\n data: {\n automute: true\n },\n created() {\n this.useObjectFit = isTag(this.$el, \"img\", \"video\");\n },\n observe: resize({\n target: ({ $el }) => getPositionedParent($el) || parent($el),\n filter: ({ useObjectFit }) => !useObjectFit\n }),\n update: {\n read() {\n if (this.useObjectFit) {\n return false;\n }\n const { ratio, cover } = Dimensions;\n const { $el, width, height } = this;\n let dim = { width, height };\n if (!width || !height) {\n const intrinsic = {\n width: $el.naturalWidth || $el.videoWidth || $el.clientWidth,\n height: $el.naturalHeight || $el.videoHeight || $el.clientHeight\n };\n if (width) {\n dim = ratio(intrinsic, \"width\", width);\n } else if (height) {\n dim = ratio(intrinsic, \"height\", height);\n } else {\n dim = intrinsic;\n }\n }\n const { offsetHeight: coverHeight, offsetWidth: coverWidth } = getPositionedParent($el) || parent($el);\n const coverDim = cover(dim, { width: coverWidth, height: coverHeight });\n if (!coverDim.width || !coverDim.height) {\n return false;\n }\n return coverDim;\n },\n write({ height, width }) {\n css(this.$el, { height, width });\n },\n events: [\"resize\"]\n }\n };\n function getPositionedParent(el) {\n while (el = parent(el)) {\n if (css(el, \"position\") !== \"static\") {\n return el;\n }\n }\n }\n\n let active;\n var drop = {\n mixins: [Container, Position, Togglable],\n args: \"pos\",\n props: {\n mode: \"list\",\n toggle: Boolean,\n boundary: Boolean,\n boundaryX: Boolean,\n boundaryY: Boolean,\n target: Boolean,\n targetX: Boolean,\n targetY: Boolean,\n stretch: Boolean,\n delayShow: Number,\n delayHide: Number,\n autoUpdate: Boolean,\n clsDrop: String,\n animateOut: Boolean,\n bgScroll: Boolean,\n closeOnScroll: Boolean\n },\n data: {\n mode: [\"click\", \"hover\"],\n toggle: \"- *\",\n boundary: false,\n boundaryX: false,\n boundaryY: false,\n target: false,\n targetX: false,\n targetY: false,\n stretch: false,\n delayShow: 0,\n delayHide: 800,\n autoUpdate: true,\n clsDrop: false,\n animateOut: false,\n bgScroll: true,\n animation: [\"uk-animation-fade\"],\n cls: \"uk-open\",\n container: false,\n closeOnScroll: false\n },\n computed: {\n boundary({ boundary, boundaryX, boundaryY }, $el) {\n return [\n query(boundaryX || boundary, $el) || window,\n query(boundaryY || boundary, $el) || window\n ];\n },\n target({ target, targetX, targetY }, $el) {\n targetX || (targetX = target || this.targetEl);\n targetY || (targetY = target || this.targetEl);\n return [\n targetX === true ? window : query(targetX, $el),\n targetY === true ? window : query(targetY, $el)\n ];\n }\n },\n created() {\n this.tracker = new MouseTracker();\n },\n beforeConnect() {\n this.clsDrop = this.$props.clsDrop || this.$options.id;\n },\n connected() {\n addClass(this.$el, \"uk-drop\", this.clsDrop);\n if (this.toggle && !this.targetEl) {\n this.targetEl = createToggleComponent(this);\n }\n this._style = pick(this.$el.style, [\"width\", \"height\"]);\n },\n disconnected() {\n if (this.isActive()) {\n this.hide(false);\n active = null;\n }\n css(this.$el, this._style);\n },\n events: [\n {\n name: \"click\",\n delegate: () => \".uk-drop-close\",\n handler(e) {\n e.preventDefault();\n this.hide(false);\n }\n },\n {\n name: \"click\",\n delegate: () => 'a[href*=\"#\"]',\n handler({ defaultPrevented, current }) {\n const { hash } = current;\n if (!defaultPrevented && hash && isSameSiteAnchor(current) && !this.$el.contains($(hash))) {\n this.hide(false);\n }\n }\n },\n {\n name: \"beforescroll\",\n handler() {\n this.hide(false);\n }\n },\n {\n name: \"toggle\",\n self: true,\n handler(e, toggle) {\n e.preventDefault();\n if (this.isToggled()) {\n this.hide(false);\n } else {\n this.show(toggle == null ? void 0 : toggle.$el, false);\n }\n }\n },\n {\n name: \"toggleshow\",\n self: true,\n handler(e, toggle) {\n e.preventDefault();\n this.show(toggle == null ? void 0 : toggle.$el);\n }\n },\n {\n name: \"togglehide\",\n self: true,\n handler(e) {\n e.preventDefault();\n if (!matches(this.$el, \":focus,:hover\")) {\n this.hide();\n }\n }\n },\n {\n name: `${pointerEnter} focusin`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (!isTouch(e)) {\n this.clearTimers();\n }\n }\n },\n {\n name: `${pointerLeave} focusout`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (!isTouch(e) && e.relatedTarget) {\n this.hide();\n }\n }\n },\n {\n name: \"toggled\",\n self: true,\n handler(e, toggled) {\n if (toggled) {\n this.clearTimers();\n this.position();\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n active = this;\n this.tracker.init();\n attr(this.targetEl, \"aria-expanded\", true);\n const handlers = [\n listenForResize(this),\n listenForEscClose(this),\n listenForBackgroundClose(this),\n this.autoUpdate && listenForScroll(this),\n this.closeOnScroll && listenForScrollClose(this)\n ];\n once(this.$el, \"hide\", () => handlers.forEach((handler) => handler && handler()), {\n self: true\n });\n if (!this.bgScroll) {\n once(this.$el, \"hidden\", preventBackgroundScroll(this.$el), { self: true });\n }\n }\n },\n {\n name: \"beforehide\",\n self: true,\n handler: \"clearTimers\"\n },\n {\n name: \"hide\",\n handler({ target }) {\n if (this.$el !== target) {\n active = active === null && this.$el.contains(target) && this.isToggled() ? this : active;\n return;\n }\n active = this.isActive() ? null : active;\n this.tracker.cancel();\n attr(this.targetEl, \"aria-expanded\", null);\n }\n }\n ],\n update: {\n write() {\n if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {\n this.position();\n }\n }\n },\n methods: {\n show(target = this.targetEl, delay = true) {\n if (this.isToggled() && target && this.targetEl && target !== this.targetEl) {\n this.hide(false, false);\n }\n this.targetEl = target;\n this.clearTimers();\n if (this.isActive()) {\n return;\n }\n if (active) {\n if (delay && active.isDelaying()) {\n this.showTimer = setTimeout(() => matches(target, \":hover\") && this.show(), 10);\n return;\n }\n let prev;\n while (active && prev !== active && !active.$el.contains(this.$el)) {\n prev = active;\n active.hide(false, false);\n }\n }\n if (this.container && parent(this.$el) !== this.container) {\n append(this.container, this.$el);\n }\n this.showTimer = setTimeout(\n () => this.toggleElement(this.$el, true),\n delay && this.delayShow || 0\n );\n },\n hide(delay = true, animate = true) {\n const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);\n this.clearTimers();\n this.isDelayedHide = delay;\n if (delay && this.isDelaying()) {\n this.hideTimer = setTimeout(this.hide, 50);\n } else if (delay && this.delayHide) {\n this.hideTimer = setTimeout(hide, this.delayHide);\n } else {\n hide();\n }\n },\n clearTimers() {\n clearTimeout(this.showTimer);\n clearTimeout(this.hideTimer);\n this.showTimer = null;\n this.hideTimer = null;\n },\n isActive() {\n return active === this;\n },\n isDelaying() {\n return [this.$el, ...$$(\".uk-drop\", this.$el)].some((el) => this.tracker.movesTo(el));\n },\n position() {\n removeClass(this.$el, \"uk-drop-stack\");\n css(this.$el, this._style);\n this.$el.hidden = true;\n const viewports = this.target.map((target) => getViewport$1(this.$el, target));\n const viewportOffset = this.getViewportOffset(this.$el);\n const dirs = [\n [0, [\"x\", \"width\", \"left\", \"right\"]],\n [1, [\"y\", \"height\", \"top\", \"bottom\"]]\n ];\n for (const [i, [axis, prop]] of dirs) {\n if (this.axis !== axis && includes([axis, true], this.stretch)) {\n css(this.$el, {\n [prop]: Math.min(\n offset(this.boundary[i])[prop],\n viewports[i][prop] - 2 * viewportOffset\n ),\n [`overflow-${axis}`]: \"auto\"\n });\n }\n }\n const maxWidth = viewports[0].width - 2 * viewportOffset;\n this.$el.hidden = false;\n css(this.$el, \"maxWidth\", \"\");\n if (this.$el.offsetWidth > maxWidth) {\n addClass(this.$el, \"uk-drop-stack\");\n }\n css(this.$el, \"maxWidth\", maxWidth);\n this.positionAt(this.$el, this.target, this.boundary);\n for (const [i, [axis, prop, start, end]] of dirs) {\n if (this.axis === axis && includes([axis, true], this.stretch)) {\n const positionOffset = Math.abs(this.getPositionOffset());\n const targetOffset = offset(this.target[i]);\n const elOffset = offset(this.$el);\n css(this.$el, {\n [prop]: (targetOffset[start] > elOffset[start] ? targetOffset[this.inset ? end : start] - Math.max(\n offset(this.boundary[i])[start],\n viewports[i][start] + viewportOffset\n ) : Math.min(\n offset(this.boundary[i])[end],\n viewports[i][end] - viewportOffset\n ) - targetOffset[this.inset ? start : end]) - positionOffset,\n [`overflow-${axis}`]: \"auto\"\n });\n this.positionAt(this.$el, this.target, this.boundary);\n }\n }\n }\n }\n };\n function getViewport$1(el, target) {\n return offsetViewport(overflowParents(target).find((parent2) => parent2.contains(el)));\n }\n function createToggleComponent(drop) {\n const { $el } = drop.$create(\"toggle\", query(drop.toggle, drop.$el), {\n target: drop.$el,\n mode: drop.mode\n });\n attr($el, \"aria-haspopup\", true);\n return $el;\n }\n function listenForResize(drop) {\n const update = () => drop.$emit();\n const off = [\n observeViewportResize(update),\n observeResize(overflowParents(drop.$el).concat(drop.target), update)\n ];\n return () => off.map((observer) => observer.disconnect());\n }\n function listenForScroll(drop, fn = () => drop.$emit()) {\n return on([document, ...overflowParents(drop.$el)], \"scroll\", fn, {\n passive: true\n });\n }\n function listenForEscClose(drop) {\n return on(document, \"keydown\", (e) => {\n if (e.keyCode === keyMap.ESC) {\n drop.hide(false);\n }\n });\n }\n function listenForScrollClose(drop) {\n return listenForScroll(drop, () => drop.hide(false));\n }\n function listenForBackgroundClose(drop) {\n return on(document, pointerDown$1, ({ target }) => {\n if (drop.$el.contains(target)) {\n return;\n }\n once(\n document,\n `${pointerUp$1} ${pointerCancel} scroll`,\n ({ defaultPrevented, type, target: newTarget }) => {\n var _a;\n if (!defaultPrevented && type === pointerUp$1 && target === newTarget && !((_a = drop.targetEl) == null ? void 0 : _a.contains(target))) {\n drop.hide(false);\n }\n },\n true\n );\n });\n }\n\n var Dropnav = {\n mixins: [Class, Container],\n props: {\n align: String,\n clsDrop: String,\n boundary: Boolean,\n dropbar: Boolean,\n dropbarAnchor: Boolean,\n duration: Number,\n mode: Boolean,\n offset: Boolean,\n stretch: Boolean,\n delayShow: Boolean,\n delayHide: Boolean,\n target: Boolean,\n targetX: Boolean,\n targetY: Boolean,\n animation: Boolean,\n animateOut: Boolean,\n closeOnScroll: Boolean\n },\n data: {\n align: isRtl ? \"right\" : \"left\",\n clsDrop: \"uk-dropdown\",\n clsDropbar: \"uk-dropnav-dropbar\",\n boundary: true,\n dropbar: false,\n dropbarAnchor: false,\n duration: 200,\n container: false,\n selNavItem: \"> li > a, > ul > li > a\"\n },\n computed: {\n dropbarAnchor: ({ dropbarAnchor }, $el) => query(dropbarAnchor, $el) || $el,\n dropbar({ dropbar }) {\n if (!dropbar) {\n return null;\n }\n dropbar = this._dropbar || query(dropbar, this.$el) || $(`+ .${this.clsDropbar}`, this.$el);\n return dropbar ? dropbar : this._dropbar = $(\"
    \");\n },\n dropContainer(_, $el) {\n return this.container || $el;\n },\n dropdowns({ clsDrop }, $el) {\n var _a;\n const dropdowns = $$(`.${clsDrop}`, $el);\n if (this.dropContainer !== $el) {\n for (const el of $$(`.${clsDrop}`, this.dropContainer)) {\n const target = (_a = this.getDropdown(el)) == null ? void 0 : _a.targetEl;\n if (!includes(dropdowns, el) && target && this.$el.contains(target)) {\n dropdowns.push(el);\n }\n }\n }\n return dropdowns;\n },\n items({ selNavItem }, $el) {\n return $$(selNavItem, $el);\n }\n },\n watch: {\n dropbar(dropbar) {\n addClass(\n dropbar,\n \"uk-dropbar\",\n \"uk-dropbar-top\",\n this.clsDropbar,\n `uk-${this.$options.name}-dropbar`\n );\n },\n dropdowns() {\n this.initializeDropdowns();\n }\n },\n connected() {\n this.initializeDropdowns();\n },\n disconnected() {\n remove$1(this._dropbar);\n delete this._dropbar;\n },\n events: [\n {\n name: \"mouseover focusin\",\n delegate: ({ selNavItem }) => selNavItem,\n handler({ current }) {\n const active2 = this.getActive();\n if (active2 && includes(active2.mode, \"hover\") && active2.targetEl && !current.contains(active2.targetEl) && !active2.isDelaying()) {\n active2.hide(false);\n }\n }\n },\n {\n name: \"keydown\",\n self: true,\n delegate: ({ selNavItem }) => selNavItem,\n handler(e) {\n var _a;\n const { current, keyCode } = e;\n const active2 = this.getActive();\n if (keyCode === keyMap.DOWN && (active2 == null ? void 0 : active2.targetEl) === current) {\n e.preventDefault();\n (_a = $(selFocusable, active2.$el)) == null ? void 0 : _a.focus();\n }\n handleNavItemNavigation(e, this.items, active2);\n }\n },\n {\n name: \"keydown\",\n el: ({ dropContainer }) => dropContainer,\n delegate: ({ clsDrop }) => `.${clsDrop}`,\n handler(e) {\n var _a;\n const { current, keyCode, target } = e;\n if (isInput(target) || !includes(this.dropdowns, current)) {\n return;\n }\n const active2 = this.getActive();\n let next = -1;\n if (keyCode === keyMap.HOME) {\n next = 0;\n } else if (keyCode === keyMap.END) {\n next = \"last\";\n } else if (keyCode === keyMap.UP) {\n next = \"previous\";\n } else if (keyCode === keyMap.DOWN) {\n next = \"next\";\n } else if (keyCode === keyMap.ESC) {\n (_a = active2.targetEl) == null ? void 0 : _a.focus();\n }\n if (~next) {\n e.preventDefault();\n const elements = $$(selFocusable, current);\n elements[getIndex(\n next,\n elements,\n findIndex(elements, (el) => matches(el, \":focus\"))\n )].focus();\n }\n handleNavItemNavigation(e, this.items, active2);\n }\n },\n {\n name: \"mouseleave\",\n el: ({ dropbar }) => dropbar,\n filter: ({ dropbar }) => dropbar,\n handler() {\n const active2 = this.getActive();\n if (active2 && includes(active2.mode, \"hover\") && !this.dropdowns.some((el) => matches(el, \":hover\"))) {\n active2.hide();\n }\n }\n },\n {\n name: \"beforeshow\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n if (!this.isDropbarDrop(target)) {\n return;\n }\n if (this.dropbar.previousElementSibling !== this.dropbarAnchor) {\n after(this.dropbarAnchor, this.dropbar);\n }\n addClass(target, `${this.clsDrop}-dropbar`);\n }\n },\n {\n name: \"show\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n if (!this.isDropbarDrop(target)) {\n return;\n }\n const drop = this.getDropdown(target);\n const adjustHeight = () => {\n const maxBottom = Math.max(\n ...parents(target, `.${this.clsDrop}`).concat(target).map((el) => offset(el).bottom)\n );\n offset(this.dropbar, {\n left: offset(this.dropbar).left,\n top: this.getDropbarOffset(drop.getPositionOffset())\n });\n this.transitionTo(\n maxBottom - offset(this.dropbar).top + toFloat(css(target, \"marginBottom\")),\n target\n );\n };\n this._observer = observeResize([drop.$el, ...drop.target], adjustHeight);\n adjustHeight();\n }\n },\n {\n name: \"beforehide\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler(e) {\n const active2 = this.getActive();\n if (matches(this.dropbar, \":hover\") && active2.$el === e.target && this.isDropbarDrop(active2.$el) && includes(active2.mode, \"hover\") && active2.isDelayedHide && !this.items.some((el) => active2.targetEl !== el && matches(el, \":focus\"))) {\n e.preventDefault();\n }\n }\n },\n {\n name: \"hide\",\n el: ({ dropContainer }) => dropContainer,\n filter: ({ dropbar }) => dropbar,\n handler({ target }) {\n var _a;\n if (!this.isDropbarDrop(target)) {\n return;\n }\n (_a = this._observer) == null ? void 0 : _a.disconnect();\n const active2 = this.getActive();\n if (!active2 || active2.$el === target) {\n this.transitionTo(0);\n }\n }\n }\n ],\n methods: {\n getActive() {\n var _a;\n return includes(this.dropdowns, (_a = active) == null ? void 0 : _a.$el) && active;\n },\n async transitionTo(newHeight, el) {\n const { dropbar } = this;\n const oldHeight = height(dropbar);\n el = oldHeight < newHeight && el;\n await Transition.cancel([el, dropbar]);\n if (el) {\n const diff = offset(el).top - offset(dropbar).top - oldHeight;\n if (diff > 0) {\n css(el, \"transitionDelay\", `${diff / newHeight * this.duration}ms`);\n }\n }\n css(el, \"clipPath\", `polygon(0 0,100% 0,100% ${oldHeight}px,0 ${oldHeight}px)`);\n height(dropbar, oldHeight);\n await Promise.all([\n Transition.start(dropbar, { height: newHeight }, this.duration),\n Transition.start(\n el,\n { clipPath: `polygon(0 0,100% 0,100% ${newHeight}px,0 ${newHeight}px)` },\n this.duration\n ).finally(() => css(el, { clipPath: \"\", transitionDelay: \"\" }))\n ]).catch(noop);\n },\n getDropdown(el) {\n return this.$getComponent(el, \"drop\") || this.$getComponent(el, \"dropdown\");\n },\n isDropbarDrop(el) {\n return includes(this.dropdowns, el) && hasClass(el, this.clsDrop);\n },\n getDropbarOffset(offsetTop) {\n const { $el, target, targetY } = this;\n const { top, height: height2 } = offset(query(targetY || target || $el, $el));\n return top + height2 + offsetTop;\n },\n initializeDropdowns() {\n this.$create(\n \"drop\",\n this.dropdowns.filter((el) => !this.getDropdown(el)),\n {\n ...this.$props,\n flip: false,\n shift: true,\n pos: `bottom-${this.align}`,\n boundary: this.boundary === true ? this.$el : this.boundary\n }\n );\n }\n }\n };\n function handleNavItemNavigation(e, toggles, active2) {\n var _a, _b, _c;\n const { current, keyCode } = e;\n let next = -1;\n if (keyCode === keyMap.HOME) {\n next = 0;\n } else if (keyCode === keyMap.END) {\n next = \"last\";\n } else if (keyCode === keyMap.LEFT) {\n next = \"previous\";\n } else if (keyCode === keyMap.RIGHT) {\n next = \"next\";\n } else if (keyCode === keyMap.TAB) {\n (_a = active2.targetEl) == null ? void 0 : _a.focus();\n (_b = active2.hide) == null ? void 0 : _b.call(active2, false);\n }\n if (~next) {\n e.preventDefault();\n (_c = active2.hide) == null ? void 0 : _c.call(active2, false);\n toggles[getIndex(next, toggles, toggles.indexOf(active2.targetEl || current))].focus();\n }\n }\n\n var formCustom = {\n mixins: [Class],\n args: \"target\",\n props: {\n target: Boolean\n },\n data: {\n target: false\n },\n computed: {\n input: (_, $el) => $(selInput, $el),\n state() {\n return this.input.nextElementSibling;\n },\n target({ target }, $el) {\n return target && (target === true && parent(this.input) === $el && this.input.nextElementSibling || $(target, $el));\n }\n },\n update() {\n var _a;\n const { target, input } = this;\n if (!target) {\n return;\n }\n let option;\n const prop = isInput(target) ? \"value\" : \"textContent\";\n const prev = target[prop];\n const value = ((_a = input.files) == null ? void 0 : _a[0]) ? input.files[0].name : matches(input, \"select\") && (option = $$(\"option\", input).filter((el) => el.selected)[0]) ? option.textContent : input.value;\n if (prev !== value) {\n target[prop] = value;\n }\n },\n events: [\n {\n name: \"change\",\n handler() {\n this.$emit();\n }\n },\n {\n name: \"reset\",\n el: ({ $el }) => $el.closest(\"form\"),\n handler() {\n this.$emit();\n }\n }\n ]\n };\n\n var grid = {\n extends: Margin,\n mixins: [Class],\n name: \"grid\",\n props: {\n masonry: Boolean,\n parallax: String,\n parallaxStart: String,\n parallaxEnd: String,\n parallaxJustify: Boolean\n },\n data: {\n margin: \"uk-grid-margin\",\n clsStack: \"uk-grid-stack\",\n masonry: false,\n parallax: 0,\n parallaxStart: 0,\n parallaxEnd: 0,\n parallaxJustify: false\n },\n connected() {\n this.masonry && addClass(this.$el, \"uk-flex-top\", \"uk-flex-wrap-top\");\n },\n observe: scroll$1({ filter: ({ parallax, parallaxJustify }) => parallax || parallaxJustify }),\n update: [\n {\n write({ rows }) {\n toggleClass(this.$el, this.clsStack, !rows.some((row) => row.length > 1));\n },\n events: [\"resize\"]\n },\n {\n read(data) {\n const { rows } = data;\n let { masonry, parallax, parallaxJustify, margin } = this;\n parallax = Math.max(0, toPx(parallax));\n if (!(masonry || parallax || parallaxJustify) || positionedAbsolute(rows) || rows[0].some(\n (el, i) => rows.some((row) => row[i] && row[i].offsetWidth !== el.offsetWidth)\n )) {\n return data.translates = data.scrollColumns = false;\n }\n let gutter = getGutter(rows, margin);\n let columns;\n let translates;\n if (masonry) {\n [columns, translates] = applyMasonry(rows, gutter, masonry === \"next\");\n } else {\n columns = transpose(rows);\n }\n const columnHeights = columns.map(\n (column) => sumBy(column, \"offsetHeight\") + gutter * (column.length - 1)\n );\n const height = Math.max(0, ...columnHeights);\n let scrollColumns;\n let parallaxStart;\n let parallaxEnd;\n if (parallax || parallaxJustify) {\n scrollColumns = columnHeights.map(\n (hgt, i) => parallaxJustify ? height - hgt + parallax : parallax / (i % 2 || 8)\n );\n if (!parallaxJustify) {\n parallax = Math.max(\n ...columnHeights.map((hgt, i) => hgt + scrollColumns[i] - height)\n );\n }\n parallaxStart = toPx(this.parallaxStart, \"height\", this.$el, true);\n parallaxEnd = toPx(this.parallaxEnd, \"height\", this.$el, true);\n }\n return {\n columns,\n translates,\n scrollColumns,\n parallaxStart,\n parallaxEnd,\n padding: parallax,\n height: translates ? height : \"\"\n };\n },\n write({ height, padding }) {\n css(this.$el, \"paddingBottom\", padding || \"\");\n height !== false && css(this.$el, \"height\", height);\n },\n events: [\"resize\"]\n },\n {\n read({ rows, scrollColumns, parallaxStart, parallaxEnd }) {\n return {\n scrolled: scrollColumns && !positionedAbsolute(rows) ? scrolledOver(this.$el, parallaxStart, parallaxEnd) : false\n };\n },\n write({ columns, scrolled, scrollColumns, translates }) {\n if (!scrolled && !translates) {\n return;\n }\n columns.forEach(\n (column, i) => column.forEach((el, j) => {\n let [x, y] = translates && translates[i][j] || [0, 0];\n if (scrolled) {\n y += scrolled * scrollColumns[i];\n }\n css(el, \"transform\", `translate(${x}px, ${y}px)`);\n })\n );\n },\n events: [\"scroll\", \"resize\"]\n }\n ]\n };\n function positionedAbsolute(rows) {\n return rows.flat().some((el) => css(el, \"position\") === \"absolute\");\n }\n function applyMasonry(rows, gutter, next) {\n const columns = [];\n const translates = [];\n const columnHeights = Array(rows[0].length).fill(0);\n let rowHeights = 0;\n for (let row of rows) {\n if (isRtl) {\n row = row.reverse();\n }\n let height = 0;\n for (const j in row) {\n const { offsetWidth, offsetHeight } = row[j];\n const index = next ? j : columnHeights.indexOf(Math.min(...columnHeights));\n push(columns, index, row[j]);\n push(translates, index, [\n (index - j) * offsetWidth * (isRtl ? -1 : 1),\n columnHeights[index] - rowHeights\n ]);\n columnHeights[index] += offsetHeight + gutter;\n height = Math.max(height, offsetHeight);\n }\n rowHeights += height + gutter;\n }\n return [columns, translates];\n }\n function getGutter(rows, cls) {\n const node = rows.flat().find((el) => hasClass(el, cls));\n return toFloat(node ? css(node, \"marginTop\") : css(rows[0][0], \"paddingLeft\"));\n }\n function transpose(rows) {\n const columns = [];\n for (const row of rows) {\n for (const i in row) {\n push(columns, i, row[i]);\n }\n }\n return columns;\n }\n function push(array, index, value) {\n if (!array[index]) {\n array[index] = [];\n }\n array[index].push(value);\n }\n\n var heightMatch = {\n args: \"target\",\n props: {\n target: String,\n row: Boolean\n },\n data: {\n target: \"> *\",\n row: true\n },\n computed: {\n elements: ({ target }, $el) => $$(target, $el)\n },\n observe: resize({\n target: ({ $el, elements }) => elements.reduce((elements2, el) => elements2.concat(el, ...el.children), [$el])\n }),\n events: {\n // Hidden elements may change height when fonts load\n name: \"loadingdone\",\n el: () => document.fonts,\n handler() {\n this.$emit(\"resize\");\n }\n },\n update: {\n read() {\n return {\n rows: (this.row ? getRows(this.elements) : [this.elements]).map(match)\n };\n },\n write({ rows }) {\n for (const { heights, elements } of rows) {\n elements.forEach((el, i) => css(el, \"minHeight\", heights[i]));\n }\n },\n events: [\"resize\"]\n }\n };\n function match(elements) {\n if (elements.length < 2) {\n return { heights: [\"\"], elements };\n }\n let heights = elements.map(getHeight);\n const max = Math.max(...heights);\n return {\n heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? \"\" : max),\n elements\n };\n }\n function getHeight(element) {\n const style = pick(element.style, [\"display\", \"minHeight\"]);\n if (!isVisible(element)) {\n css(element, \"display\", \"block\", \"important\");\n }\n css(element, \"minHeight\", \"\");\n const height = dimensions$1(element).height - boxModelAdjust(element, \"height\", \"content-box\");\n css(element, style);\n return height;\n }\n\n var heightPlaceholder = {\n args: \"target\",\n props: {\n target: String\n },\n data: {\n target: \"\"\n },\n computed: {\n target: {\n get: ({ target }, $el) => query(target, $el),\n observe: ({ target }) => target\n }\n },\n observe: resize({ target: ({ target }) => target }),\n update: {\n read() {\n return this.target ? { height: this.target.offsetHeight } : false;\n },\n write({ height }) {\n css(this.$el, { minHeight: height });\n },\n events: [\"resize\"]\n }\n };\n\n var heightViewport = {\n props: {\n expand: Boolean,\n offsetTop: Boolean,\n offsetBottom: Boolean,\n minHeight: Number\n },\n data: {\n expand: false,\n offsetTop: false,\n offsetBottom: false,\n minHeight: 0\n },\n // check for offsetTop change\n observe: [\n viewport({ filter: ({ expand }) => expand }),\n resize({ target: ({ $el }) => scrollParents($el) })\n ],\n update: {\n read() {\n if (!isVisible(this.$el)) {\n return false;\n }\n let minHeight = \"\";\n const box = boxModelAdjust(this.$el, \"height\", \"content-box\");\n const { body, scrollingElement } = document;\n const scrollElement = scrollParent(this.$el);\n const { height: viewportHeight } = offsetViewport(\n scrollElement === body ? scrollingElement : scrollElement\n );\n const isScrollingElement = scrollingElement === scrollElement || body === scrollElement;\n minHeight = `calc(${isScrollingElement ? \"100vh\" : `${viewportHeight}px`}`;\n if (this.expand) {\n const diff = dimensions$1(scrollElement).height - dimensions$1(this.$el).height;\n minHeight += ` - ${diff}px`;\n } else {\n if (this.offsetTop) {\n if (isScrollingElement) {\n const offsetTopEl = this.offsetTop === true ? this.$el : query(this.offsetTop, this.$el);\n const { top } = offset(offsetTopEl);\n minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : \"\";\n } else {\n minHeight += ` - ${boxModelAdjust(scrollElement, \"height\", css(scrollElement, \"boxSizing\"))}px`;\n }\n }\n if (this.offsetBottom === true) {\n minHeight += ` - ${dimensions$1(this.$el.nextElementSibling).height}px`;\n } else if (isNumeric(this.offsetBottom)) {\n minHeight += ` - ${this.offsetBottom}vh`;\n } else if (this.offsetBottom && endsWith(this.offsetBottom, \"px\")) {\n minHeight += ` - ${toFloat(this.offsetBottom)}px`;\n } else if (isString(this.offsetBottom)) {\n minHeight += ` - ${dimensions$1(query(this.offsetBottom, this.$el)).height}px`;\n }\n }\n minHeight += `${box ? ` - ${box}px` : \"\"})`;\n return { minHeight };\n },\n write({ minHeight }) {\n css(this.$el, \"minHeight\", `max(${this.minHeight || 0}px, ${minHeight})`);\n },\n events: [\"resize\"]\n }\n };\n\n var closeIcon = \"\";\n\n var closeLarge = \"\";\n\n var dropParentIcon = \"\";\n\n var marker = \"\";\n\n var navParentIconLarge = \"\";\n\n var navParentIcon = \"\";\n\n var navbarParentIcon = \"\";\n\n var navbarToggleIcon = \"\";\n\n var overlayIcon = \"\";\n\n var paginationNext = \"\";\n\n var paginationPrevious = \"\";\n\n var searchIcon = \"\";\n\n var searchLarge = \"\";\n\n var searchMedium = \"\";\n\n var slidenavNextLarge = \"\";\n\n var slidenavNext = \"\";\n\n var slidenavPreviousLarge = \"\";\n\n var slidenavPrevious = \"\";\n\n var spinner = \"\";\n\n var totop = \"\";\n\n var Svg = {\n args: \"src\",\n props: {\n width: Number,\n height: Number,\n ratio: Number\n },\n data: {\n ratio: 1\n },\n connected() {\n this.svg = this.getSvg().then((el) => {\n if (!this._connected) {\n return;\n }\n const svg = insertSVG(el, this.$el);\n if (this.svgEl && svg !== this.svgEl) {\n remove$1(this.svgEl);\n }\n applyWidthAndHeight.call(this, svg, el);\n return this.svgEl = svg;\n }, noop);\n },\n disconnected() {\n this.svg.then((svg) => {\n if (this._connected) {\n return;\n }\n if (isVoidElement(this.$el)) {\n this.$el.hidden = false;\n }\n remove$1(svg);\n this.svgEl = null;\n });\n this.svg = null;\n },\n methods: {\n async getSvg() {\n }\n }\n };\n function insertSVG(el, root) {\n if (isVoidElement(root) || isTag(root, \"canvas\")) {\n root.hidden = true;\n const next = root.nextElementSibling;\n return equals(el, next) ? next : after(root, el);\n }\n const last = root.lastElementChild;\n return equals(el, last) ? last : append(root, el);\n }\n function equals(el, other) {\n return isTag(el, \"svg\") && isTag(other, \"svg\") && el.innerHTML === other.innerHTML;\n }\n function applyWidthAndHeight(el, ref) {\n const props = [\"width\", \"height\"];\n let dimensions = props.map((prop) => this[prop]);\n if (!dimensions.some((val) => val)) {\n dimensions = props.map((prop) => attr(ref, prop));\n }\n const viewBox = attr(ref, \"viewBox\");\n if (viewBox && !dimensions.some((val) => val)) {\n dimensions = viewBox.split(\" \").slice(2);\n }\n dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));\n }\n\n var svg = {\n mixins: [Svg],\n args: \"src\",\n props: {\n src: String,\n icon: String,\n attributes: \"list\",\n strokeAnimation: Boolean\n },\n data: {\n strokeAnimation: false\n },\n observe: [\n mutation({\n async handler() {\n const svg = await this.svg;\n if (svg) {\n applyAttributes.call(this, svg);\n }\n },\n options: {\n attributes: true,\n attributeFilter: [\"id\", \"class\", \"style\"]\n }\n })\n ],\n async connected() {\n if (includes(this.src, \"#\")) {\n [this.src, this.icon] = this.src.split(\"#\");\n }\n const svg = await this.svg;\n if (svg) {\n applyAttributes.call(this, svg);\n if (this.strokeAnimation) {\n applyAnimation(svg);\n }\n }\n },\n methods: {\n async getSvg() {\n if (isTag(this.$el, \"img\") && !this.$el.complete && this.$el.loading === \"lazy\") {\n await new Promise((resolve) => once(this.$el, \"load\", resolve));\n }\n return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject(\"SVG not found.\");\n }\n }\n };\n function applyAttributes(el) {\n const { $el } = this;\n addClass(el, attr($el, \"class\"), \"uk-svg\");\n for (let i = 0; i < $el.style.length; i++) {\n const prop = $el.style[i];\n css(el, prop, css($el, prop));\n }\n for (const attribute in this.attributes) {\n const [prop, value] = this.attributes[attribute].split(\":\", 2);\n attr(el, prop, value);\n }\n if (!this.$el.id) {\n removeAttr(el, \"id\");\n }\n }\n const loadSVG = memoize(async (src) => {\n if (src) {\n if (startsWith(src, \"data:\")) {\n return decodeURIComponent(src.split(\",\")[1]);\n } else {\n return (await fetch(src)).text();\n }\n } else {\n return Promise.reject();\n }\n });\n function parseSVG(svg, icon) {\n if (icon && includes(svg, \"/g;\n const parseSymbols = memoize(function(svg) {\n const symbols = {};\n symbolRe.lastIndex = 0;\n let match;\n while (match = symbolRe.exec(svg)) {\n symbols[match[3]] = ``;\n }\n return symbols;\n });\n function applyAnimation(el) {\n const length = getMaxPathLength(el);\n if (length) {\n css(el, \"--uk-animation-stroke\", length);\n }\n }\n function stringToSvg(string) {\n const container = document.createElement(\"template\");\n container.innerHTML = string;\n return container.content.firstElementChild;\n }\n\n const icons = {\n spinner,\n totop,\n marker,\n \"close-icon\": closeIcon,\n \"close-large\": closeLarge,\n \"drop-parent-icon\": dropParentIcon,\n \"nav-parent-icon\": navParentIcon,\n \"nav-parent-icon-large\": navParentIconLarge,\n \"navbar-parent-icon\": navbarParentIcon,\n \"navbar-toggle-icon\": navbarToggleIcon,\n \"overlay-icon\": overlayIcon,\n \"pagination-next\": paginationNext,\n \"pagination-previous\": paginationPrevious,\n \"search-icon\": searchIcon,\n \"search-medium\": searchMedium,\n \"search-large\": searchLarge,\n \"search-toggle-icon\": searchIcon,\n \"slidenav-next\": slidenavNext,\n \"slidenav-next-large\": slidenavNextLarge,\n \"slidenav-previous\": slidenavPrevious,\n \"slidenav-previous-large\": slidenavPreviousLarge\n };\n const Icon = {\n install: install$1,\n mixins: [Svg],\n args: \"icon\",\n props: { icon: String },\n isIcon: true,\n beforeConnect() {\n addClass(this.$el, \"uk-icon\");\n },\n methods: {\n async getSvg() {\n const icon = getIcon(this.icon);\n if (!icon) {\n throw \"Icon not found.\";\n }\n return icon;\n }\n }\n };\n const IconComponent = {\n args: false,\n extends: Icon,\n data: (vm) => ({\n icon: hyphenate(vm.constructor.options.name)\n }),\n beforeConnect() {\n addClass(this.$el, this.$options.id);\n }\n };\n const NavParentIcon = {\n extends: IconComponent,\n beforeConnect() {\n const icon = this.$props.icon;\n this.icon = this.$el.closest(\".uk-nav-primary\") ? `${icon}-large` : icon;\n }\n };\n const Search = {\n extends: IconComponent,\n mixins: [I18n],\n i18n: { toggle: \"Open Search\", submit: \"Submit Search\" },\n beforeConnect() {\n const isToggle = hasClass(this.$el, \"uk-search-toggle\") || hasClass(this.$el, \"uk-navbar-toggle\");\n this.icon = isToggle ? \"search-toggle-icon\" : hasClass(this.$el, \"uk-search-icon\") && this.$el.closest(\".uk-search-large\") ? \"search-large\" : this.$el.closest(\".uk-search-medium\") ? \"search-medium\" : this.$props.icon;\n if (hasAttr(this.$el, \"aria-label\")) {\n return;\n }\n if (isToggle) {\n const label = this.t(\"toggle\");\n attr(this.$el, \"aria-label\", label);\n } else {\n const button = this.$el.closest(\"a,button\");\n if (button) {\n const label = this.t(\"submit\");\n attr(button, \"aria-label\", label);\n }\n }\n }\n };\n const Spinner = {\n extends: IconComponent,\n beforeConnect() {\n attr(this.$el, \"role\", \"status\");\n },\n methods: {\n async getSvg() {\n const icon = await Icon.methods.getSvg.call(this);\n if (this.ratio !== 1) {\n css($(\"circle\", icon), \"strokeWidth\", 1 / this.ratio);\n }\n return icon;\n }\n }\n };\n const ButtonComponent = {\n extends: IconComponent,\n mixins: [I18n],\n beforeConnect() {\n const button = this.$el.closest(\"a,button\");\n attr(button, \"role\", this.role !== null && isTag(button, \"a\") ? \"button\" : this.role);\n const label = this.t(\"label\");\n if (label && !hasAttr(button, \"aria-label\")) {\n attr(button, \"aria-label\", label);\n }\n }\n };\n const Slidenav = {\n extends: ButtonComponent,\n beforeConnect() {\n addClass(this.$el, \"uk-slidenav\");\n const icon = this.$props.icon;\n this.icon = hasClass(this.$el, \"uk-slidenav-large\") ? `${icon}-large` : icon;\n }\n };\n const NavbarToggleIcon = {\n extends: ButtonComponent,\n i18n: { label: \"Open menu\" }\n };\n const Close = {\n extends: ButtonComponent,\n i18n: { label: \"Close\" },\n beforeConnect() {\n this.icon = `close-${hasClass(this.$el, \"uk-close-large\") ? \"large\" : \"icon\"}`;\n }\n };\n const Marker = {\n extends: ButtonComponent,\n i18n: { label: \"Open\" }\n };\n const Totop = {\n extends: ButtonComponent,\n i18n: { label: \"Back to top\" }\n };\n const PaginationNext = {\n extends: ButtonComponent,\n i18n: { label: \"Next page\" },\n data: { role: null }\n };\n const PaginationPrevious = {\n extends: ButtonComponent,\n i18n: { label: \"Previous page\" },\n data: { role: null }\n };\n const parsed = {};\n function install$1(UIkit) {\n UIkit.icon.add = (name, svg) => {\n const added = isString(name) ? { [name]: svg } : name;\n each(added, (svg2, name2) => {\n icons[name2] = svg2;\n delete parsed[name2];\n });\n if (UIkit._initialized) {\n apply(\n document.body,\n (el) => each(UIkit.getComponents(el), (cmp) => {\n cmp.$options.isIcon && cmp.icon in added && cmp.$reset();\n })\n );\n }\n };\n }\n const aliases = { twitter: \"x\" };\n function getIcon(icon) {\n icon = aliases[icon] || icon;\n if (!icons[icon]) {\n return null;\n }\n if (!parsed[icon]) {\n parsed[icon] = stringToSvg(icons[applyRtl(icon)] || icons[icon]);\n }\n return parsed[icon].cloneNode(true);\n }\n function applyRtl(icon) {\n return isRtl ? swap(swap(icon, \"left\", \"right\"), \"previous\", \"next\") : icon;\n }\n\n var img = {\n args: \"dataSrc\",\n props: {\n dataSrc: String,\n sources: String,\n margin: String,\n target: String,\n loading: String\n },\n data: {\n dataSrc: \"\",\n sources: false,\n margin: \"50%\",\n target: false,\n loading: \"lazy\"\n },\n connected() {\n if (this.loading !== \"lazy\") {\n this.load();\n } else if (isImg(this.$el)) {\n this.$el.loading = \"lazy\";\n setSrcAttrs(this.$el);\n }\n },\n disconnected() {\n if (this.img) {\n this.img.onload = \"\";\n }\n delete this.img;\n },\n observe: intersection({\n handler(entries, observer) {\n this.load();\n observer.disconnect();\n },\n options: ({ margin }) => ({ rootMargin: margin }),\n filter: ({ loading }) => loading === \"lazy\",\n target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el\n }),\n methods: {\n load() {\n if (this.img) {\n return this.img;\n }\n const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);\n removeAttr(image, \"loading\");\n setSrcAttrs(this.$el, image.currentSrc);\n return this.img = image;\n }\n }\n };\n function setSrcAttrs(el, src) {\n if (isImg(el)) {\n const parentNode = parent(el);\n const elements = isTag(parentNode, \"picture\") ? children(parentNode) : [el];\n elements.forEach((el2) => setSourceProps(el2, el2));\n } else if (src) {\n const change = !includes(el.style.backgroundImage, src);\n if (change) {\n css(el, \"backgroundImage\", `url(${escape(src)})`);\n trigger(el, createEvent(\"load\", false));\n }\n }\n }\n const srcProps = [\"data-src\", \"data-srcset\", \"sizes\"];\n function setSourceProps(sourceEl, targetEl) {\n for (const prop of srcProps) {\n const value = data(sourceEl, prop);\n if (value) {\n attr(targetEl, prop.replace(/^(data-)+/, \"\"), value);\n }\n }\n }\n function getImageFromElement(el, src, sources) {\n const img = new Image();\n wrapInPicture(img, sources);\n setSourceProps(el, img);\n img.onload = () => {\n setSrcAttrs(el, img.currentSrc);\n };\n attr(img, \"src\", src);\n return img;\n }\n function wrapInPicture(img, sources) {\n sources = parseSources(sources);\n if (sources.length) {\n const picture = fragment(\"\");\n for (const attrs of sources) {\n const source = fragment(\"\");\n attr(source, attrs);\n append(picture, source);\n }\n append(picture, img);\n }\n }\n function parseSources(sources) {\n if (!sources) {\n return [];\n }\n if (startsWith(sources, \"[\")) {\n try {\n sources = JSON.parse(sources);\n } catch (e) {\n sources = [];\n }\n } else {\n sources = parseOptions(sources);\n }\n if (!isArray(sources)) {\n sources = [sources];\n }\n return sources.filter((source) => !isEmpty(source));\n }\n function isImg(el) {\n return isTag(el, \"img\");\n }\n\n var inverse = {\n props: {\n target: String,\n selActive: String\n },\n data: {\n target: false,\n selActive: false\n },\n computed: {\n target: ({ target }, $el) => target ? $$(target, $el) : $el\n },\n observe: [\n intersection({\n handler(entries) {\n this.isIntersecting = entries.some(({ isIntersecting }) => isIntersecting);\n this.$emit();\n },\n target: ({ target }) => target,\n args: { intersecting: false }\n }),\n mutation({\n target: ({ target }) => target,\n options: { attributes: true, attributeFilter: [\"class\"], attributeOldValue: true }\n }),\n {\n target: ({ target }) => target,\n observe: (target, handler) => {\n const observer = observeResize(\n [...toNodes(target), document.documentElement],\n handler\n );\n const listener = [\n on(document, \"scroll itemshown itemhidden\", handler, {\n passive: true,\n capture: true\n }),\n on(document, \"show hide transitionstart\", (e) => {\n handler();\n return observer.observe(e.target);\n }),\n on(document, \"shown hidden transitionend transitioncancel\", (e) => {\n handler();\n return observer.unobserve(e.target);\n })\n ];\n return {\n observe: observer.observe.bind(observer),\n unobserve: observer.unobserve.bind(observer),\n disconnect() {\n observer.disconnect();\n listener.map((off) => off());\n }\n };\n },\n handler() {\n this.$emit();\n }\n }\n ],\n update: {\n read() {\n if (!this.isIntersecting) {\n return false;\n }\n for (const target of toNodes(this.target)) {\n let color = !this.selActive || matches(target, this.selActive) ? findTargetColor(target) : \"\";\n if (color !== false) {\n replaceClass(target, \"uk-light uk-dark\", color);\n }\n }\n }\n }\n };\n function findTargetColor(target) {\n const dim = dimensions$1(target);\n const viewport = dimensions$1(window);\n if (!intersectRect(dim, viewport)) {\n return false;\n }\n const { left, top, height, width } = dim;\n let last;\n for (const percent of [0.25, 0.5, 0.75]) {\n const elements = target.ownerDocument.elementsFromPoint(\n Math.max(0, Math.min(left + width * percent, viewport.width - 1)),\n Math.max(0, Math.min(top + height / 2, viewport.height - 1))\n );\n for (const element of elements) {\n if (target.contains(element) || !checkVisibility(element) || element.closest('[class*=\"-leave\"]') && elements.some((el) => element !== el && matches(el, '[class*=\"-enter\"]'))) {\n continue;\n }\n const color = css(element, \"--uk-inverse\");\n if (color) {\n if (color === last) {\n return `uk-${color}`;\n }\n last = color;\n break;\n }\n }\n }\n return last ? `uk-${last}` : \"\";\n }\n function checkVisibility(element) {\n if (css(element, \"visibility\") !== \"visible\") {\n return false;\n }\n while (element) {\n if (css(element, \"opacity\") === \"0\") {\n return false;\n }\n element = parent(element);\n }\n return true;\n }\n\n var leader = {\n mixins: [Class, Media],\n props: {\n fill: String\n },\n data: {\n fill: \"\",\n clsWrapper: \"uk-leader-fill\",\n clsHide: \"uk-leader-hide\",\n attrFill: \"data-fill\"\n },\n computed: {\n fill: ({ fill }, $el) => fill || css($el, \"--uk-leader-fill-content\")\n },\n connected() {\n [this.wrapper] = wrapInner(this.$el, ``);\n },\n disconnected() {\n unwrap(this.wrapper.childNodes);\n },\n observe: resize(),\n update: {\n read() {\n const width = Math.trunc(this.$el.offsetWidth / 2);\n return {\n width,\n fill: this.fill,\n hide: !this.matchMedia\n };\n },\n write({ width, fill, hide }) {\n toggleClass(this.wrapper, this.clsHide, hide);\n attr(this.wrapper, this.attrFill, new Array(width).join(fill));\n },\n events: [\"resize\"]\n }\n };\n\n var modal = {\n install,\n mixins: [Modal],\n data: {\n clsPage: \"uk-modal-page\",\n selPanel: \".uk-modal-dialog\",\n selClose: \".uk-modal-close, .uk-modal-close-default, .uk-modal-close-outside, .uk-modal-close-full\"\n },\n events: [\n {\n name: \"fullscreenchange webkitendfullscreen\",\n capture: true,\n handler(e) {\n if (isTag(e.target, \"video\") && this.isToggled() && !document.fullscreenElement) {\n this.hide();\n }\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (hasClass(this.panel, \"uk-margin-auto-vertical\")) {\n addClass(this.$el, \"uk-flex\");\n } else {\n css(this.$el, \"display\", \"block\");\n }\n height(this.$el);\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n css(this.$el, \"display\", \"\");\n removeClass(this.$el, \"uk-flex\");\n }\n }\n ]\n };\n function install({ modal }) {\n modal.dialog = function(content, options) {\n const dialog = modal($(`
    ${content}
    `), {\n stack: true,\n role: \"alertdialog\",\n ...options\n });\n dialog.show();\n on(\n dialog.$el,\n \"hidden\",\n async () => {\n await Promise.resolve();\n dialog.$destroy(true);\n },\n { self: true }\n );\n return dialog;\n };\n modal.alert = function(message, options) {\n return openDialog(\n ({ i18n }) => `
    ${isString(message) ? message : html(message)}
    `,\n options\n );\n };\n modal.confirm = function(message, options) {\n return openDialog(\n ({ i18n }) => `
    ${isString(message) ? message : html(message)}
    `,\n options,\n () => Promise.reject()\n );\n };\n modal.prompt = function(message, value, options) {\n const promise = openDialog(\n ({ i18n }) => `
    `,\n options,\n () => null,\n () => input.value\n );\n const { $el } = promise.dialog;\n const input = $(\"input\", $el);\n input.value = value || \"\";\n on($el, \"show\", () => input.select());\n return promise;\n };\n modal.i18n = {\n ok: \"Ok\",\n cancel: \"Cancel\"\n };\n function openDialog(tmpl, options, hideFn = noop, submitFn = noop) {\n options = {\n bgClose: false,\n escClose: true,\n ...options,\n i18n: { ...modal.i18n, ...options == null ? void 0 : options.i18n }\n };\n const dialog = modal.dialog(tmpl(options), options);\n return assign(\n new Promise((resolve) => {\n const off = on(dialog.$el, \"hide\", () => resolve(hideFn()));\n on(dialog.$el, \"submit\", \"form\", (e) => {\n e.preventDefault();\n resolve(submitFn(dialog));\n off();\n dialog.hide();\n });\n }),\n { dialog }\n );\n }\n }\n\n var nav = {\n extends: Accordion,\n data: {\n targets: \"> .uk-parent\",\n toggle: \"> a\",\n content: \"> ul\"\n }\n };\n\n const clsNavbarTransparent = \"uk-navbar-transparent\";\n var navbar = {\n extends: Dropnav,\n props: {\n dropbarTransparentMode: Boolean\n },\n data: {\n clsDrop: \"uk-navbar-dropdown\",\n selNavItem: \".uk-navbar-nav > li > a,a.uk-navbar-item,button.uk-navbar-item,.uk-navbar-item a,.uk-navbar-item button,.uk-navbar-toggle\",\n // Simplify with :where() selector once browser target is Safari 14+\n dropbarTransparentMode: false\n },\n computed: {\n navbarContainer: (_, $el) => $el.closest(\".uk-navbar-container\")\n },\n watch: {\n items() {\n const justify = hasClass(this.$el, \"uk-navbar-justify\");\n const containers = $$(\".uk-navbar-nav, .uk-navbar-left, .uk-navbar-right\", this.$el);\n for (const container of containers) {\n const items = justify ? $$(\".uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle\", container).length : \"\";\n css(container, \"flexGrow\", items);\n }\n }\n },\n events: [\n {\n name: \"show\",\n el: ({ dropContainer }) => dropContainer,\n handler({ target }) {\n if (this.getTransparentMode(target) === \"remove\" && hasClass(this.navbarContainer, clsNavbarTransparent)) {\n removeClass(this.navbarContainer, clsNavbarTransparent);\n this._transparent = true;\n }\n }\n },\n {\n name: \"hide\",\n el: ({ dropContainer }) => dropContainer,\n async handler() {\n await awaitMacroTask();\n if (!this.getActive() && this._transparent) {\n addClass(this.navbarContainer, clsNavbarTransparent);\n this._transparent = null;\n }\n }\n }\n ],\n methods: {\n getTransparentMode(el) {\n if (!this.navbarContainer) {\n return;\n }\n if (this.dropbar && this.isDropbarDrop(el)) {\n return this.dropbarTransparentMode;\n }\n const drop = this.getDropdown(el);\n if (drop && hasClass(el, \"uk-dropbar\")) {\n return drop.inset ? \"behind\" : \"remove\";\n }\n },\n getDropbarOffset(offsetTop) {\n const { top, height } = offset(this.navbarContainer);\n return top + (this.dropbarTransparentMode === \"behind\" ? 0 : height + offsetTop);\n }\n }\n };\n function awaitMacroTask() {\n return new Promise((resolve) => setTimeout(resolve));\n }\n\n var offcanvas = {\n mixins: [Modal],\n args: \"mode\",\n props: {\n mode: String,\n flip: Boolean,\n overlay: Boolean,\n swiping: Boolean\n },\n data: {\n mode: \"slide\",\n flip: false,\n overlay: false,\n clsPage: \"uk-offcanvas-page\",\n clsContainer: \"uk-offcanvas-container\",\n selPanel: \".uk-offcanvas-bar\",\n clsFlip: \"uk-offcanvas-flip\",\n clsContainerAnimation: \"uk-offcanvas-container-animation\",\n clsSidebarAnimation: \"uk-offcanvas-bar-animation\",\n clsMode: \"uk-offcanvas\",\n clsOverlay: \"uk-offcanvas-overlay\",\n selClose: \".uk-offcanvas-close\",\n container: false,\n swiping: true\n },\n computed: {\n clsFlip: ({ flip, clsFlip }) => flip ? clsFlip : \"\",\n clsOverlay: ({ overlay, clsOverlay }) => overlay ? clsOverlay : \"\",\n clsMode: ({ mode, clsMode }) => `${clsMode}-${mode}`,\n clsSidebarAnimation: ({ mode, clsSidebarAnimation }) => mode === \"none\" || mode === \"reveal\" ? \"\" : clsSidebarAnimation,\n clsContainerAnimation: ({ mode, clsContainerAnimation }) => mode !== \"push\" && mode !== \"reveal\" ? \"\" : clsContainerAnimation,\n transitionElement({ mode }) {\n return mode === \"reveal\" ? parent(this.panel) : this.panel;\n }\n },\n observe: swipe({ filter: ({ swiping }) => swiping }),\n update: {\n read() {\n if (this.isToggled() && !isVisible(this.$el)) {\n this.hide();\n }\n },\n events: [\"resize\"]\n },\n events: [\n {\n name: \"touchmove\",\n self: true,\n passive: false,\n filter: ({ overlay }) => overlay,\n handler(e) {\n e.cancelable && e.preventDefault();\n }\n },\n {\n name: \"show\",\n self: true,\n handler() {\n if (this.mode === \"reveal\" && !hasClass(parent(this.panel), this.clsMode)) {\n wrapAll(this.panel, \"
    \");\n addClass(parent(this.panel), this.clsMode);\n }\n const { body, scrollingElement } = document;\n addClass(body, this.clsContainer, this.clsFlip);\n css(body, \"touch-action\", \"pan-y pinch-zoom\");\n css(this.$el, \"display\", \"block\");\n css(this.panel, \"maxWidth\", scrollingElement.clientWidth);\n addClass(this.$el, this.clsOverlay);\n addClass(\n this.panel,\n this.clsSidebarAnimation,\n this.mode === \"reveal\" ? \"\" : this.clsMode\n );\n height(body);\n addClass(body, this.clsContainerAnimation);\n this.clsContainerAnimation && suppressUserScale();\n }\n },\n {\n name: \"hide\",\n self: true,\n handler() {\n removeClass(document.body, this.clsContainerAnimation);\n css(document.body, \"touch-action\", \"\");\n }\n },\n {\n name: \"hidden\",\n self: true,\n handler() {\n this.clsContainerAnimation && resumeUserScale();\n if (this.mode === \"reveal\") {\n unwrap(this.panel);\n }\n removeClass(this.panel, this.clsSidebarAnimation, this.clsMode);\n removeClass(this.$el, this.clsOverlay);\n css(this.$el, \"display\", \"\");\n css(this.panel, \"maxWidth\", \"\");\n removeClass(document.body, this.clsContainer, this.clsFlip);\n }\n },\n {\n name: \"swipeLeft swipeRight\",\n handler(e) {\n if (this.isToggled() && endsWith(e.type, \"Left\") ^ this.flip) {\n this.hide();\n }\n }\n }\n ]\n };\n function suppressUserScale() {\n getViewport().content += \",user-scalable=0\";\n }\n function resumeUserScale() {\n const viewport = getViewport();\n viewport.content = viewport.content.replace(/,user-scalable=0$/, \"\");\n }\n function getViewport() {\n return $('meta[name=\"viewport\"]', document.head) || append(document.head, '');\n }\n\n var overflowAuto = {\n mixins: [Class],\n props: {\n selContainer: String,\n selContent: String,\n minHeight: Number\n },\n data: {\n selContainer: \".uk-modal\",\n selContent: \".uk-modal-dialog\",\n minHeight: 150\n },\n computed: {\n container: ({ selContainer }, $el) => $el.closest(selContainer),\n content: ({ selContent }, $el) => $el.closest(selContent)\n },\n observe: resize({\n target: ({ container, content }) => [container, content]\n }),\n update: {\n read() {\n if (!this.content || !this.container || !isVisible(this.$el)) {\n return false;\n }\n return {\n max: Math.max(\n this.minHeight,\n height(this.container) - (dimensions$1(this.content).height - height(this.$el))\n )\n };\n },\n write({ max }) {\n css(this.$el, { minHeight: this.minHeight, maxHeight: max });\n },\n events: [\"resize\"]\n }\n };\n\n var responsive = {\n props: [\"width\", \"height\"],\n connected() {\n addClass(this.$el, \"uk-responsive-width\");\n css(this.$el, \"aspectRatio\", `${this.width}/${this.height}`);\n }\n };\n\n var scroll = {\n props: {\n offset: Number\n },\n data: {\n offset: 0\n },\n connected() {\n registerClick(this);\n },\n disconnected() {\n unregisterClick(this);\n },\n methods: {\n async scrollTo(el) {\n el = el && $(el) || document.body;\n if (trigger(this.$el, \"beforescroll\", [this, el])) {\n await scrollIntoView(el, { offset: this.offset });\n trigger(this.$el, \"scrolled\", [this, el]);\n }\n }\n }\n };\n const instances = /* @__PURE__ */ new Set();\n function registerClick(cmp) {\n if (!instances.size) {\n on(document, \"click\", clickHandler);\n }\n instances.add(cmp);\n }\n function unregisterClick(cmp) {\n instances.delete(cmp);\n if (!instances.size) {\n off(document, \"click\", clickHandler);\n }\n }\n function clickHandler(e) {\n if (e.defaultPrevented) {\n return;\n }\n for (const instance of instances) {\n if (instance.$el.contains(e.target) && isSameSiteAnchor(instance.$el)) {\n e.preventDefault();\n if (window.location.href !== instance.$el.href) {\n window.history.pushState({}, \"\", instance.$el.href);\n }\n instance.scrollTo(getTargetedElement(instance.$el));\n }\n }\n }\n\n const clsInView = \"uk-scrollspy-inview\";\n var scrollspy = {\n args: \"cls\",\n props: {\n cls: String,\n target: String,\n hidden: Boolean,\n margin: String,\n repeat: Boolean,\n delay: Number\n },\n data: () => ({\n cls: \"\",\n target: false,\n hidden: true,\n margin: \"-1px\",\n repeat: false,\n delay: 0\n }),\n computed: {\n elements: ({ target }, $el) => target ? $$(target, $el) : [$el]\n },\n watch: {\n elements(elements) {\n if (this.hidden) {\n css(filter$1(elements, `:not(.${clsInView})`), \"opacity\", 0);\n }\n }\n },\n connected() {\n this.elementData = /* @__PURE__ */ new Map();\n },\n disconnected() {\n for (const [el, state] of this.elementData.entries()) {\n removeClass(el, clsInView, (state == null ? void 0 : state.cls) || \"\");\n }\n delete this.elementData;\n },\n observe: intersection({\n target: ({ elements }) => elements,\n handler(records) {\n const elements = this.elementData;\n for (const { target: el, isIntersecting } of records) {\n if (!elements.has(el)) {\n elements.set(el, {\n cls: data(el, \"uk-scrollspy-class\") || this.cls\n });\n }\n const state = elements.get(el);\n if (!this.repeat && state.show) {\n continue;\n }\n state.show = isIntersecting;\n }\n this.$emit();\n },\n options: ({ margin }) => ({ rootMargin: margin }),\n args: { intersecting: false }\n }),\n update: [\n {\n write(data) {\n for (const [el, state] of this.elementData.entries()) {\n if (state.show && !state.inview && !state.queued) {\n state.queued = true;\n data.promise = (data.promise || Promise.resolve()).then(() => new Promise((resolve) => setTimeout(resolve, this.delay))).then(() => {\n this.toggle(el, true);\n setTimeout(() => {\n state.queued = false;\n this.$emit();\n }, 300);\n });\n } else if (!state.show && state.inview && !state.queued && this.repeat) {\n this.toggle(el, false);\n }\n }\n }\n }\n ],\n methods: {\n toggle(el, inview) {\n var _a, _b;\n const state = (_a = this.elementData) == null ? void 0 : _a.get(el);\n if (!state) {\n return;\n }\n (_b = state.off) == null ? void 0 : _b.call(state);\n css(el, \"opacity\", !inview && this.hidden ? 0 : \"\");\n toggleClass(el, clsInView, inview);\n toggleClass(el, state.cls);\n let match;\n if (match = state.cls.match(/\\buk-animation-[\\w-]+/g)) {\n const removeAnimationClasses = () => removeClass(el, match);\n if (inview) {\n state.off = once(el, \"animationcancel animationend\", removeAnimationClasses, {\n self: true\n });\n } else {\n removeAnimationClasses();\n }\n }\n trigger(el, inview ? \"inview\" : \"outview\");\n state.inview = inview;\n }\n }\n };\n\n var scrollspyNav = {\n props: {\n cls: String,\n closest: Boolean,\n scroll: Boolean,\n target: String,\n offset: Number\n },\n data: {\n cls: \"uk-active\",\n closest: false,\n scroll: false,\n target: \"a[href]\",\n offset: 0\n },\n computed: {\n links: ({ target }, $el) => $$(target, $el).filter((el) => isSameSiteAnchor(el)),\n elements({ closest }) {\n return this.links.map((el) => el.closest(closest || \"*\"));\n }\n },\n watch: {\n links(links) {\n if (this.scroll) {\n this.$create(\"scroll\", links, { offset: this.offset });\n }\n }\n },\n observe: [intersection(), scroll$1()],\n update: [\n {\n read() {\n const targets = this.links.map((el) => getTargetedElement(el) || el.ownerDocument);\n const { length } = targets;\n if (!length || !isVisible(this.$el)) {\n return false;\n }\n const scrollElement = scrollParent(targets, true);\n const { scrollTop, scrollHeight } = scrollElement;\n const viewport = offsetViewport(scrollElement);\n const max = scrollHeight - viewport.height;\n let active = false;\n if (scrollTop >= max) {\n active = length - 1;\n } else {\n const offsetBy = this.offset + dimensions$1(getCoveringElement()).height + viewport.height * 0.1;\n for (let i = 0; i < targets.length; i++) {\n if (offset(targets[i]).top - viewport.top - offsetBy > 0) {\n break;\n }\n active = +i;\n }\n }\n return { active };\n },\n write({ active }) {\n const changed = active !== false && !hasClass(this.elements[active], this.cls);\n this.links.forEach((el) => el.blur());\n for (let i = 0; i < this.elements.length; i++) {\n toggleClass(this.elements[i], this.cls, +i === active);\n }\n if (changed) {\n trigger(this.$el, \"active\", [active, this.elements[active]]);\n }\n },\n events: [\"scroll\", \"resize\"]\n }\n ]\n };\n\n var sticky = {\n mixins: [Class, Media],\n props: {\n position: String,\n top: null,\n bottom: null,\n start: null,\n end: null,\n offset: String,\n overflowFlip: Boolean,\n animation: String,\n clsActive: String,\n clsInactive: String,\n clsFixed: String,\n clsBelow: String,\n selTarget: String,\n showOnUp: Boolean,\n targetOffset: Number\n },\n data: {\n position: \"top\",\n top: false,\n bottom: false,\n start: false,\n end: false,\n offset: 0,\n overflowFlip: false,\n animation: \"\",\n clsActive: \"uk-active\",\n clsInactive: \"\",\n clsFixed: \"uk-sticky-fixed\",\n clsBelow: \"uk-sticky-below\",\n selTarget: \"\",\n showOnUp: false,\n targetOffset: false\n },\n computed: {\n target: ({ selTarget }, $el) => selTarget && $(selTarget, $el) || $el\n },\n connected() {\n this.start = coerce(this.start || this.top);\n this.end = coerce(this.end || this.bottom);\n this.placeholder = $(\"+ .uk-sticky-placeholder\", this.$el) || $('
    ');\n this.isFixed = false;\n this.setActive(false);\n },\n beforeDisconnect() {\n if (this.isFixed) {\n this.hide();\n removeClass(this.target, this.clsInactive);\n }\n reset(this.$el);\n remove$1(this.placeholder);\n this.placeholder = null;\n },\n observe: [\n viewport(),\n scroll$1({ target: () => document.scrollingElement }),\n resize({\n target: ({ $el }) => [$el, parent($el), document.scrollingElement],\n handler(entries) {\n this.$emit(\n this._data.resized && entries.some(({ target }) => target === parent(this.$el)) ? \"update\" : \"resize\"\n );\n this._data.resized = true;\n }\n })\n ],\n events: [\n {\n name: \"load hashchange popstate\",\n el: () => window,\n filter: ({ targetOffset }) => targetOffset !== false,\n handler() {\n const { scrollingElement } = document;\n if (!location.hash || scrollingElement.scrollTop === 0) {\n return;\n }\n setTimeout(() => {\n const targetOffset = offset($(location.hash));\n const elOffset = offset(this.$el);\n if (this.isFixed && intersectRect(targetOffset, elOffset)) {\n scrollingElement.scrollTop = Math.ceil(\n targetOffset.top - elOffset.height - toPx(this.targetOffset, \"height\", this.placeholder) - toPx(this.offset, \"height\", this.placeholder)\n );\n }\n });\n }\n }\n ],\n update: [\n {\n read({ height: height$1, width, margin, sticky }, types) {\n this.inactive = !this.matchMedia || !isVisible(this.$el) || !this.$el.offsetHeight;\n if (this.inactive) {\n return;\n }\n const hide = this.isFixed && types.has(\"update\");\n if (hide) {\n preventTransition(this.target);\n this.hide();\n }\n if (!this.active) {\n ({ height: height$1, width } = dimensions$1(this.$el));\n margin = css(this.$el, \"margin\");\n }\n if (hide) {\n this.show();\n }\n const viewport2 = toPx(\"100vh\", \"height\");\n const dynamicViewport = height(window);\n const maxScrollHeight = Math.max(\n 0,\n document.scrollingElement.scrollHeight - viewport2\n );\n let position = this.position;\n if (this.overflowFlip && height$1 > viewport2) {\n position = position === \"top\" ? \"bottom\" : \"top\";\n }\n const referenceElement = this.isFixed ? this.placeholder : this.$el;\n let offset$1 = toPx(this.offset, \"height\", sticky ? this.$el : referenceElement);\n if (position === \"bottom\" && (height$1 < dynamicViewport || this.overflowFlip)) {\n offset$1 += dynamicViewport - height$1;\n }\n const overflow = this.overflowFlip ? 0 : Math.max(0, height$1 + offset$1 - viewport2);\n const topOffset = offset(referenceElement).top;\n const elHeight = dimensions$1(this.$el).height;\n const start = (this.start === false ? topOffset : parseProp(this.start, this.$el, topOffset)) - offset$1;\n const end = this.end === false ? maxScrollHeight : Math.min(\n maxScrollHeight,\n parseProp(this.end, this.$el, topOffset + height$1, true) - elHeight - offset$1 + overflow\n );\n sticky = maxScrollHeight && !this.showOnUp && start + offset$1 === topOffset && end === Math.min(\n maxScrollHeight,\n parseProp(true, this.$el, 0, true) - elHeight - offset$1 + overflow\n ) && css(parent(this.$el), \"overflowY\") === \"visible\";\n return {\n start,\n end,\n offset: offset$1,\n overflow,\n height: height$1,\n elHeight,\n width,\n margin,\n top: offsetPosition(referenceElement)[0],\n sticky,\n viewport: viewport2,\n maxScrollHeight\n };\n },\n write({ height, width, margin, offset, sticky }) {\n if (this.inactive || sticky || !this.isFixed) {\n reset(this.$el);\n }\n if (this.inactive) {\n return;\n }\n if (sticky) {\n height = width = margin = 0;\n css(this.$el, { position: \"sticky\", top: offset });\n }\n const { placeholder } = this;\n css(placeholder, { height, width, margin });\n if (parent(placeholder) !== parent(this.$el) || sticky ^ index(placeholder) < index(this.$el)) {\n (sticky ? before : after)(this.$el, placeholder);\n placeholder.hidden = true;\n }\n },\n events: [\"resize\"]\n },\n {\n read({\n scroll: prevScroll = 0,\n dir: prevDir = \"down\",\n overflow,\n overflowScroll = 0,\n start,\n end,\n elHeight,\n height,\n sticky,\n maxScrollHeight\n }) {\n const scroll2 = Math.min(document.scrollingElement.scrollTop, maxScrollHeight);\n const dir = prevScroll <= scroll2 ? \"down\" : \"up\";\n const referenceElement = this.isFixed ? this.placeholder : this.$el;\n return {\n dir,\n prevDir,\n scroll: scroll2,\n prevScroll,\n below: scroll2 > offset(referenceElement).top + (sticky ? Math.min(height, elHeight) : height),\n offsetParentTop: offset(referenceElement.offsetParent).top,\n overflowScroll: clamp(\n overflowScroll + clamp(scroll2, start, end) - clamp(prevScroll, start, end),\n 0,\n overflow\n )\n };\n },\n write(data, types) {\n const isScrollUpdate = types.has(\"scroll\");\n const {\n initTimestamp = 0,\n dir,\n prevDir,\n scroll: scroll2,\n prevScroll = 0,\n top,\n start,\n below\n } = data;\n if (scroll2 < 0 || scroll2 === prevScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {\n return;\n }\n const now = Date.now();\n if (now - initTimestamp > 300 || dir !== prevDir) {\n data.initScroll = scroll2;\n data.initTimestamp = now;\n }\n if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll2) <= 30 && Math.abs(prevScroll - scroll2) <= 10) {\n return;\n }\n if (this.inactive || scroll2 < start || this.showOnUp && (scroll2 <= start || dir === \"down\" && isScrollUpdate || dir === \"up\" && !this.isFixed && !below)) {\n if (!this.isFixed) {\n if (Animation.inProgress(this.$el) && top > scroll2) {\n Animation.cancel(this.$el);\n this.hide();\n }\n return;\n }\n if (this.animation && below) {\n if (hasClass(this.$el, \"uk-animation-leave\")) {\n return;\n }\n Animation.out(this.$el, this.animation).then(() => this.hide(), noop);\n } else {\n this.hide();\n }\n } else if (this.isFixed) {\n this.update();\n } else if (this.animation && below) {\n this.show();\n Animation.in(this.$el, this.animation).catch(noop);\n } else {\n preventTransition(this.target);\n this.show();\n }\n },\n events: [\"resize\", \"resizeViewport\", \"scroll\"]\n }\n ],\n methods: {\n show() {\n this.isFixed = true;\n this.update();\n this.placeholder.hidden = false;\n },\n hide() {\n const { offset, sticky } = this._data;\n this.setActive(false);\n removeClass(this.$el, this.clsFixed, this.clsBelow);\n if (sticky) {\n css(this.$el, \"top\", offset);\n } else {\n css(this.$el, {\n position: \"\",\n top: \"\",\n width: \"\",\n marginTop: \"\"\n });\n }\n this.placeholder.hidden = true;\n this.isFixed = false;\n },\n update() {\n let {\n width,\n scroll: scroll2 = 0,\n overflow,\n overflowScroll = 0,\n start,\n end,\n offset,\n offsetParentTop,\n sticky,\n below\n } = this._data;\n const active = start !== 0 || scroll2 > start;\n if (!sticky) {\n let position = \"fixed\";\n if (scroll2 > end) {\n offset += end - offsetParentTop + overflowScroll - overflow;\n position = \"absolute\";\n }\n css(this.$el, { position, width, marginTop: 0 }, \"important\");\n }\n css(this.$el, \"top\", offset - overflowScroll);\n this.setActive(active);\n toggleClass(this.$el, this.clsBelow, below);\n addClass(this.$el, this.clsFixed);\n },\n setActive(active) {\n const prev = this.active;\n this.active = active;\n if (active) {\n replaceClass(this.target, this.clsInactive, this.clsActive);\n prev !== active && trigger(this.$el, \"active\");\n } else {\n replaceClass(this.target, this.clsActive, this.clsInactive);\n if (prev !== active) {\n preventTransition(this.target);\n trigger(this.$el, \"inactive\");\n }\n }\n }\n }\n };\n function parseProp(value, el, propOffset, padding) {\n if (!value) {\n return 0;\n }\n if (isNumeric(value) || isString(value) && value.match(/^-?\\d/)) {\n return propOffset + toPx(value, \"height\", el, true);\n } else {\n const refElement = value === true ? parent(el) : query(value, el);\n return offset(refElement).bottom - (padding && (refElement == null ? void 0 : refElement.contains(el)) ? toFloat(css(refElement, \"paddingBottom\")) : 0);\n }\n }\n function coerce(value) {\n if (value === \"true\") {\n return true;\n } else if (value === \"false\") {\n return false;\n }\n return value;\n }\n function reset(el) {\n css(el, { position: \"\", top: \"\", marginTop: \"\", width: \"\" });\n }\n const clsTransitionDisable = \"uk-transition-disable\";\n function preventTransition(element) {\n if (!hasClass(element, clsTransitionDisable)) {\n addClass(element, clsTransitionDisable);\n requestAnimationFrame(() => removeClass(element, clsTransitionDisable));\n }\n }\n\n const selDisabled = \".uk-disabled *, .uk-disabled, [disabled]\";\n var Switcher = {\n mixins: [Togglable],\n args: \"connect\",\n props: {\n connect: String,\n toggle: String,\n itemNav: String,\n active: Number,\n followFocus: Boolean,\n swiping: Boolean\n },\n data: {\n connect: \"~.uk-switcher\",\n toggle: \"> * > :first-child\",\n itemNav: false,\n active: 0,\n cls: \"uk-active\",\n attrItem: \"uk-switcher-item\",\n selVertical: \".uk-nav\",\n followFocus: false,\n swiping: true\n },\n computed: {\n connects: {\n get: ({ connect }, $el) => queryAll(connect, $el),\n observe: ({ connect }) => connect\n },\n connectChildren() {\n return this.connects.map((el) => children(el)).flat();\n },\n toggles: ({ toggle }, $el) => $$(toggle, $el),\n children(_, $el) {\n return children($el).filter(\n (child) => this.toggles.some((toggle) => child.contains(toggle))\n );\n }\n },\n watch: {\n connects(connects) {\n if (this.swiping) {\n css(connects, \"touchAction\", \"pan-y pinch-zoom\");\n }\n this.$emit();\n },\n connectChildren() {\n let index = Math.max(0, this.index());\n for (const el of this.connects) {\n children(el).forEach((child, i) => toggleClass(child, this.cls, i === index));\n }\n this.$emit();\n },\n toggles(toggles) {\n this.$emit();\n const active = this.index();\n this.show(~active ? active : toggles[this.active] || toggles[0]);\n }\n },\n connected() {\n attr(this.$el, \"role\", \"tablist\");\n },\n observe: [\n lazyload({ targets: ({ connectChildren }) => connectChildren }),\n swipe({ target: ({ connects }) => connects, filter: ({ swiping }) => swiping })\n ],\n events: [\n {\n name: \"click keydown\",\n delegate: ({ toggle }) => toggle,\n handler(e) {\n if (!matches(e.current, selDisabled) && (e.type === \"click\" || e.keyCode === keyMap.SPACE)) {\n e.preventDefault();\n this.show(e.current);\n }\n }\n },\n {\n name: \"keydown\",\n delegate: ({ toggle }) => toggle,\n handler(e) {\n const { current, keyCode } = e;\n const isVertical = matches(this.$el, this.selVertical);\n let i = keyCode === keyMap.HOME ? 0 : keyCode === keyMap.END ? \"last\" : keyCode === keyMap.LEFT && !isVertical || keyCode === keyMap.UP && isVertical ? \"previous\" : keyCode === keyMap.RIGHT && !isVertical || keyCode === keyMap.DOWN && isVertical ? \"next\" : -1;\n if (~i) {\n e.preventDefault();\n const toggles = this.toggles.filter((el) => !matches(el, selDisabled));\n const next = toggles[getIndex(i, toggles, toggles.indexOf(current))];\n next.focus();\n if (this.followFocus) {\n this.show(next);\n }\n }\n }\n },\n {\n name: \"click\",\n el: ({ $el, connects, itemNav }) => connects.concat(itemNav ? queryAll(itemNav, $el) : []),\n delegate: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,\n handler(e) {\n if (e.target.closest(\"a,button\")) {\n e.preventDefault();\n this.show(data(e.current, this.attrItem));\n }\n }\n },\n {\n name: \"swipeRight swipeLeft\",\n filter: ({ swiping }) => swiping,\n el: ({ connects }) => connects,\n handler({ type }) {\n this.show(endsWith(type, \"Left\") ? \"next\" : \"previous\");\n }\n }\n ],\n update() {\n var _a;\n for (const el of this.connects) {\n if (isTag(el, \"ul\")) {\n attr(el, \"role\", \"presentation\");\n }\n }\n attr(children(this.$el), \"role\", \"presentation\");\n for (const index in this.toggles) {\n const toggle = this.toggles[index];\n const item = (_a = this.connects[0]) == null ? void 0 : _a.children[index];\n attr(toggle, \"role\", \"tab\");\n if (!item) {\n continue;\n }\n toggle.id = generateId(this, toggle);\n item.id = generateId(this, item);\n attr(toggle, \"aria-controls\", item.id);\n attr(item, { role: \"tabpanel\", \"aria-labelledby\": toggle.id });\n }\n attr(this.$el, \"aria-orientation\", matches(this.$el, this.selVertical) ? \"vertical\" : null);\n },\n methods: {\n index() {\n return findIndex(this.children, (el) => hasClass(el, this.cls));\n },\n show(item) {\n const toggles = this.toggles.filter((el) => !matches(el, selDisabled));\n const prev = this.index();\n const next = getIndex(\n !isNode(item) || includes(toggles, item) ? item : 0,\n toggles,\n getIndex(this.toggles[prev], toggles)\n );\n const active = getIndex(toggles[next], this.toggles);\n this.children.forEach((child, i) => {\n toggleClass(child, this.cls, active === i);\n attr(this.toggles[i], {\n \"aria-selected\": active === i,\n tabindex: active === i ? null : -1\n });\n });\n const animate = prev >= 0 && prev !== next;\n this.connects.forEach(async ({ children: children2 }) => {\n const actives = toArray(children2).filter(\n (child, i) => i !== active && hasClass(child, this.cls)\n );\n if (await this.toggleElement(actives, false, animate)) {\n await this.toggleElement(children2[active], true, animate);\n }\n });\n }\n }\n };\n\n var tab = {\n mixins: [Class],\n extends: Switcher,\n props: {\n media: Boolean\n },\n data: {\n media: 960,\n attrItem: \"uk-tab-item\",\n selVertical: \".uk-tab-left,.uk-tab-right\"\n },\n connected() {\n const cls = hasClass(this.$el, \"uk-tab-left\") ? \"uk-tab-left\" : hasClass(this.$el, \"uk-tab-right\") ? \"uk-tab-right\" : false;\n if (cls) {\n this.$create(\"toggle\", this.$el, { cls, mode: \"media\", media: this.media });\n }\n }\n };\n\n const KEY_SPACE = 32;\n var toggle = {\n mixins: [Media, Togglable],\n args: \"target\",\n props: {\n href: String,\n target: null,\n mode: \"list\",\n queued: Boolean\n },\n data: {\n href: false,\n target: false,\n mode: \"click\",\n queued: true\n },\n computed: {\n target: {\n get: ({ target }, $el) => {\n target = queryAll(target || $el.hash, $el);\n return target.length ? target : [$el];\n },\n observe: ({ target }) => target\n }\n },\n connected() {\n if (!includes(this.mode, \"media\")) {\n if (!isFocusable(this.$el)) {\n attr(this.$el, \"tabindex\", \"0\");\n }\n if (!this.cls && isTag(this.$el, \"a\")) {\n attr(this.$el, \"role\", \"button\");\n }\n }\n },\n observe: lazyload({ targets: ({ target }) => target }),\n events: [\n {\n name: pointerDown$1,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n this._preventClick = null;\n if (!isTouch(e) || isBoolean(this._showState) || this.$el.disabled) {\n return;\n }\n trigger(this.$el, \"focus\");\n once(\n document,\n pointerDown$1,\n () => trigger(this.$el, \"blur\"),\n true,\n (e2) => !this.$el.contains(e2.target)\n );\n if (includes(this.mode, \"click\")) {\n this._preventClick = true;\n }\n }\n },\n {\n // mouseenter mouseleave are added because of Firefox bug,\n // where pointerleave is triggered immediately after pointerenter on scroll\n name: `mouseenter mouseleave ${pointerEnter} ${pointerLeave} focus blur`,\n filter: ({ mode }) => includes(mode, \"hover\"),\n handler(e) {\n if (isTouch(e) || this.$el.disabled) {\n return;\n }\n const show = includes([\"mouseenter\", pointerEnter, \"focus\"], e.type);\n const expanded = this.isToggled(this.target);\n if (!show && (!isBoolean(this._showState) || e.type !== \"blur\" && matches(this.$el, \":focus\") || e.type === \"blur\" && matches(this.$el, \":hover\"))) {\n if (expanded === this._showState) {\n this._showState = null;\n }\n return;\n }\n if (show && isBoolean(this._showState) && expanded !== this._showState) {\n return;\n }\n this._showState = show ? expanded : null;\n this.toggle(`toggle${show ? \"show\" : \"hide\"}`);\n }\n },\n {\n name: \"keydown\",\n filter: ({ $el, mode }) => includes(mode, \"click\") && !isTag($el, \"input\"),\n handler(e) {\n if (e.keyCode === KEY_SPACE) {\n e.preventDefault();\n this.$el.click();\n }\n }\n },\n {\n name: \"click\",\n filter: ({ mode }) => [\"click\", \"hover\"].some((m) => includes(mode, m)),\n handler(e) {\n let link;\n if (this._preventClick || e.target.closest('a[href=\"#\"], a[href=\"\"]') || (link = e.target.closest(\"a[href]\")) && (!this.isToggled(this.target) || link.hash && matches(this.target, link.hash))) {\n e.preventDefault();\n }\n if (!this._preventClick && includes(this.mode, \"click\")) {\n this.toggle();\n }\n }\n },\n {\n name: \"mediachange\",\n filter: ({ mode }) => includes(mode, \"media\"),\n el: ({ target }) => target,\n handler(e, mediaObj) {\n if (mediaObj.matches ^ this.isToggled(this.target)) {\n this.toggle();\n }\n }\n }\n ],\n methods: {\n async toggle(type) {\n if (!trigger(this.target, type || \"toggle\", [this])) {\n return;\n }\n if (hasAttr(this.$el, \"aria-expanded\")) {\n attr(this.$el, \"aria-expanded\", !this.isToggled(this.target));\n }\n if (!this.queued) {\n return this.toggleElement(this.target);\n }\n const leaving = this.target.filter((el) => hasClass(el, this.clsLeave));\n if (leaving.length) {\n for (const el of this.target) {\n const isLeaving = includes(leaving, el);\n this.toggleElement(el, isLeaving, isLeaving);\n }\n return;\n }\n const toggled = this.target.filter(this.isToggled);\n if (await this.toggleElement(toggled, false)) {\n await this.toggleElement(\n this.target.filter((el) => !includes(toggled, el)),\n true\n );\n }\n }\n }\n };\n\n var components = /*#__PURE__*/Object.freeze({\n __proto__: null,\n Accordion: Accordion,\n Alert: alert,\n Close: Close,\n Cover: cover,\n Drop: drop,\n DropParentIcon: IconComponent,\n Dropdown: drop,\n Dropnav: Dropnav,\n FormCustom: formCustom,\n Grid: grid,\n HeightMatch: heightMatch,\n HeightPlaceholder: heightPlaceholder,\n HeightViewport: heightViewport,\n Icon: Icon,\n Img: img,\n Inverse: inverse,\n Leader: leader,\n Margin: Margin,\n Marker: Marker,\n Modal: modal,\n Nav: nav,\n NavParentIcon: NavParentIcon,\n Navbar: navbar,\n NavbarParentIcon: IconComponent,\n NavbarToggleIcon: NavbarToggleIcon,\n Offcanvas: offcanvas,\n OverflowAuto: overflowAuto,\n OverlayIcon: IconComponent,\n PaginationNext: PaginationNext,\n PaginationPrevious: PaginationPrevious,\n Responsive: responsive,\n Scroll: scroll,\n Scrollspy: scrollspy,\n ScrollspyNav: scrollspyNav,\n SearchIcon: Search,\n SlidenavNext: Slidenav,\n SlidenavPrevious: Slidenav,\n Spinner: Spinner,\n Sticky: sticky,\n Svg: svg,\n Switcher: Switcher,\n Tab: tab,\n Toggle: toggle,\n Totop: Totop,\n Video: Video\n });\n\n each(components, (component, name) => App.component(name, component));\n boot(App);\n\n each(components$1, (component, name) => App.component(name, component));\n\n return App;\n\n}));\n", "function ok() {\n return true;\n}\nfunction notOk() {\n return false;\n}\nfunction undef() {\n return undefined;\n}\nconst NOT_TYPED_FUNCTION = 'Argument is not a typed-function.';\n\n/**\n * @typedef {{\n * params: Param[],\n * fn: function,\n * test: function,\n * implementation: function\n * }} Signature\n *\n * @typedef {{\n * types: Type[],\n * hasAny: boolean,\n * hasConversion: boolean,\n * restParam: boolean\n * }} Param\n *\n * @typedef {{\n * name: string,\n * typeIndex: number,\n * test: function,\n * isAny: boolean,\n * conversion?: ConversionDef,\n * conversionIndex: number,\n * }} Type\n *\n * @typedef {{\n * from: string,\n * to: string,\n * convert: function (*) : *\n * }} ConversionDef\n *\n * @typedef {{\n * name: string,\n * test: function(*) : boolean,\n * isAny?: boolean\n * }} TypeDef\n */\n\n/**\n * @returns {() => function}\n */\nfunction create() {\n // data type tests\n\n /**\n * Returns true if the argument is a non-null \"plain\" object\n */\n function isPlainObject(x) {\n return typeof x === 'object' && x !== null && x.constructor === Object;\n }\n const _types = [{\n name: 'number',\n test: function (x) {\n return typeof x === 'number';\n }\n }, {\n name: 'string',\n test: function (x) {\n return typeof x === 'string';\n }\n }, {\n name: 'boolean',\n test: function (x) {\n return typeof x === 'boolean';\n }\n }, {\n name: 'Function',\n test: function (x) {\n return typeof x === 'function';\n }\n }, {\n name: 'Array',\n test: Array.isArray\n }, {\n name: 'Date',\n test: function (x) {\n return x instanceof Date;\n }\n }, {\n name: 'RegExp',\n test: function (x) {\n return x instanceof RegExp;\n }\n }, {\n name: 'Object',\n test: isPlainObject\n }, {\n name: 'null',\n test: function (x) {\n return x === null;\n }\n }, {\n name: 'undefined',\n test: function (x) {\n return x === undefined;\n }\n }];\n const anyType = {\n name: 'any',\n test: ok,\n isAny: true\n };\n\n // Data structures to track the types. As these are local variables in\n // create(), each typed universe will get its own copy, but the variables\n // will only be accessible through the (closures of the) functions supplied\n // as properties of the typed object, not directly.\n // These will be initialized in clear() below\n let typeMap; // primary store of all types\n let typeList; // Array of just type names, for the sake of ordering\n\n // And similar data structures for the type conversions:\n let nConversions = 0;\n // the actual conversions are stored on a property of the destination types\n\n // This is a temporary object, will be replaced with a function at the end\n let typed = {\n createCount: 0\n };\n\n /**\n * Takes a type name and returns the corresponding official type object\n * for that type.\n *\n * @param {string} typeName\n * @returns {TypeDef} type\n */\n function findType(typeName) {\n const type = typeMap.get(typeName);\n if (type) {\n return type;\n }\n // Remainder is error handling\n let message = 'Unknown type \"' + typeName + '\"';\n const name = typeName.toLowerCase();\n let otherName;\n for (otherName of typeList) {\n if (otherName.toLowerCase() === name) {\n message += '. Did you mean \"' + otherName + '\" ?';\n break;\n }\n }\n throw new TypeError(message);\n }\n\n /**\n * Adds an array `types` of type definitions to this typed instance.\n * Each type definition should be an object with properties:\n * 'name' - a string giving the name of the type; 'test' - function\n * returning a boolean that tests membership in the type; and optionally\n * 'isAny' - true only for the 'any' type.\n *\n * The second optional argument, `before`, gives the name of a type that\n * these types should be added before. The new types are added in the\n * order specified.\n * @param {TypeDef[]} types\n * @param {string | boolean} [beforeSpec='any'] before\n */\n function addTypes(types) {\n let beforeSpec = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any';\n const beforeIndex = beforeSpec ? findType(beforeSpec).index : typeList.length;\n const newTypes = [];\n for (let i = 0; i < types.length; ++i) {\n if (!types[i] || typeof types[i].name !== 'string' || typeof types[i].test !== 'function') {\n throw new TypeError('Object with properties {name: string, test: function} expected');\n }\n const typeName = types[i].name;\n if (typeMap.has(typeName)) {\n throw new TypeError('Duplicate type name \"' + typeName + '\"');\n }\n newTypes.push(typeName);\n typeMap.set(typeName, {\n name: typeName,\n test: types[i].test,\n isAny: types[i].isAny,\n index: beforeIndex + i,\n conversionsTo: [] // Newly added type can't have any conversions to it\n });\n }\n // update the typeList\n const affectedTypes = typeList.slice(beforeIndex);\n typeList = typeList.slice(0, beforeIndex).concat(newTypes).concat(affectedTypes);\n // Fix the indices\n for (let i = beforeIndex + newTypes.length; i < typeList.length; ++i) {\n typeMap.get(typeList[i]).index = i;\n }\n }\n\n /**\n * Removes all types and conversions from this typed instance.\n * May cause previously constructed typed-functions to throw\n * strange errors when they are called with types that do not\n * match any of their signatures.\n */\n function clear() {\n typeMap = new Map();\n typeList = [];\n nConversions = 0;\n addTypes([anyType], false);\n }\n\n // initialize the types to the default list\n clear();\n addTypes(_types);\n\n /**\n * Removes all conversions, leaving the types alone.\n */\n function clearConversions() {\n let typeName;\n for (typeName of typeList) {\n typeMap.get(typeName).conversionsTo = [];\n }\n nConversions = 0;\n }\n\n /**\n * Find the type names that match a value.\n * @param {*} value\n * @return {string[]} Array of names of types for which\n * the type test matches the value.\n */\n function findTypeNames(value) {\n const matches = typeList.filter(name => {\n const type = typeMap.get(name);\n return !type.isAny && type.test(value);\n });\n if (matches.length) {\n return matches;\n }\n return ['any'];\n }\n\n /**\n * Check if an entity is a typed function created by any instance\n * @param {any} entity\n * @returns {boolean}\n */\n function isTypedFunction(entity) {\n return entity && typeof entity === 'function' && '_typedFunctionData' in entity;\n }\n\n /**\n * Find a specific signature from a (composed) typed function, for example:\n *\n * typed.findSignature(fn, ['number', 'string'])\n * typed.findSignature(fn, 'number, string')\n * typed.findSignature(fn, 'number,string', {exact: true})\n *\n * This function findSignature will by default return the best match to\n * the given signature, possibly employing type conversions.\n *\n * The (optional) third argument is a plain object giving options\n * controlling the signature search. Currently the only implemented\n * option is `exact`: if specified as true (default is false), only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Note that a (possibly different) type matching\n * `any`, or one or more instances of TYPE matching `...TYPE` are\n * considered exact matches in this regard, as no conversions are used.\n *\n * This function returns a \"signature\" object, as does `typed.resolve()`,\n * which is a plain object with four keys: `params` (the array of parameters\n * for this signature), `fn` (the originally supplied function for this\n * signature), `test` (a generated function that determines if an argument\n * list matches this signature, and `implementation` (the function to call\n * on a matching argument list, that performs conversions if necessary and\n * then calls the originally supplied function).\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature search as documented\n * @return {{ params: Param[], fn: function, test: function, implementation: function }}\n * Returns the matching signature, or throws an error when no signature\n * is found.\n */\n function findSignature(fn, signature, options) {\n if (!isTypedFunction(fn)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n\n // Canonicalize input\n const exact = options && options.exact;\n const stringSignature = Array.isArray(signature) ? signature.join(',') : signature;\n const params = parseSignature(stringSignature);\n const canonicalSignature = stringifyParams(params);\n\n // First hope we get lucky and exactly match a signature\n if (!exact || canonicalSignature in fn.signatures) {\n // OK, we can check the internal signatures\n const match = fn._typedFunctionData.signatureMap.get(canonicalSignature);\n if (match) {\n return match;\n }\n }\n\n // Oh well, we did not; so we have to go back and check the parameters\n // one by one, in order to catch things like `any` and rest params.\n // Note here we can assume there is at least one parameter, because\n // the empty signature would have matched successfully above.\n const nParams = params.length;\n let remainingSignatures;\n if (exact) {\n remainingSignatures = [];\n let name;\n for (name in fn.signatures) {\n remainingSignatures.push(fn._typedFunctionData.signatureMap.get(name));\n }\n } else {\n remainingSignatures = fn._typedFunctionData.signatures;\n }\n for (let i = 0; i < nParams; ++i) {\n const want = params[i];\n const filteredSignatures = [];\n let possibility;\n for (possibility of remainingSignatures) {\n const have = getParamAtIndex(possibility.params, i);\n if (!have || want.restParam && !have.restParam) {\n continue;\n }\n if (!have.hasAny) {\n // have to check all of the wanted types are available\n const haveTypes = paramTypeSet(have);\n if (want.types.some(wtype => !haveTypes.has(wtype.name))) {\n continue;\n }\n }\n // OK, this looks good\n filteredSignatures.push(possibility);\n }\n remainingSignatures = filteredSignatures;\n if (remainingSignatures.length === 0) break;\n }\n // Return the first remaining signature that was totally matched:\n let candidate;\n for (candidate of remainingSignatures) {\n if (candidate.params.length <= nParams) {\n return candidate;\n }\n }\n throw new TypeError('Signature not found (signature: ' + (fn.name || 'unnamed') + '(' + stringifyParams(params, ', ') + '))');\n }\n\n /**\n * Find the proper function to call for a specific signature from\n * a (composed) typed function, for example:\n *\n * typed.find(fn, ['number', 'string'])\n * typed.find(fn, 'number, string')\n * typed.find(fn, 'number,string', {exact: true})\n *\n * This function find will by default return the best match to\n * the given signature, possibly employing type conversions (and returning\n * a function that will perform those conversions as needed). The\n * (optional) third argument is a plain object giving options contolling\n * the signature search. Currently only the option `exact` is implemented,\n * which defaults to \"false\". If `exact` is specified as true, then only\n * exact matches will be returned (i.e. signatures for which `fn` was\n * directly defined). Uses of `any` and `...TYPE` are considered exact if\n * no conversions are necessary to apply the corresponding function.\n *\n * @param {Function} fn A typed-function\n * @param {string | string[]} signature\n * Signature to be found, can be an array or a comma separated string.\n * @param {object} options Controls the signature match as documented\n * @return {function}\n * Returns the function to call for the given signature, or throws an\n * error if no match is found.\n */\n function find(fn, signature, options) {\n return findSignature(fn, signature, options).implementation;\n }\n\n /**\n * Convert a given value to another data type, specified by type name.\n *\n * @param {*} value\n * @param {string} typeName\n */\n function convert(value, typeName) {\n // check conversion is needed\n const type = findType(typeName);\n if (type.test(value)) {\n return value;\n }\n const conversions = type.conversionsTo;\n if (conversions.length === 0) {\n throw new Error('There are no conversions to ' + typeName + ' defined.');\n }\n for (let i = 0; i < conversions.length; i++) {\n const fromType = findType(conversions[i].from);\n if (fromType.test(value)) {\n return conversions[i].convert(value);\n }\n }\n throw new Error('Cannot convert ' + value + ' to ' + typeName);\n }\n\n /**\n * Stringify parameters in a normalized way\n * @param {Param[]} params\n * @param {string} [','] separator\n * @return {string}\n */\n function stringifyParams(params) {\n let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';\n return params.map(p => p.name).join(separator);\n }\n\n /**\n * Parse a parameter, like \"...number | boolean\"\n * @param {string} param\n * @return {Param} param\n */\n function parseParam(param) {\n const restParam = param.indexOf('...') === 0;\n const types = !restParam ? param : param.length > 3 ? param.slice(3) : 'any';\n const typeDefs = types.split('|').map(s => findType(s.trim()));\n let hasAny = false;\n let paramName = restParam ? '...' : '';\n const exactTypes = typeDefs.map(function (type) {\n hasAny = type.isAny || hasAny;\n paramName += type.name + '|';\n return {\n name: type.name,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion: null,\n conversionIndex: -1\n };\n });\n return {\n types: exactTypes,\n name: paramName.slice(0, -1),\n // remove trailing '|' from above\n hasAny,\n hasConversion: false,\n restParam\n };\n }\n\n /**\n * Expands a parsed parameter with the types available from currently\n * defined conversions.\n * @param {Param} param\n * @return {Param} param\n */\n function expandParam(param) {\n const typeNames = param.types.map(t => t.name);\n const matchingConversions = availableConversions(typeNames);\n let hasAny = param.hasAny;\n let newName = param.name;\n const convertibleTypes = matchingConversions.map(function (conversion) {\n const type = findType(conversion.from);\n hasAny = type.isAny || hasAny;\n newName += '|' + conversion.from;\n return {\n name: conversion.from,\n typeIndex: type.index,\n test: type.test,\n isAny: type.isAny,\n conversion,\n conversionIndex: conversion.index\n };\n });\n return {\n types: param.types.concat(convertibleTypes),\n name: newName,\n hasAny,\n hasConversion: convertibleTypes.length > 0,\n restParam: param.restParam\n };\n }\n\n /**\n * Return the set of type names in a parameter.\n * Caches the result for efficiency\n *\n * @param {Param} param\n * @return {Set} typenames\n */\n function paramTypeSet(param) {\n if (!param.typeSet) {\n param.typeSet = new Set();\n param.types.forEach(type => param.typeSet.add(type.name));\n }\n return param.typeSet;\n }\n\n /**\n * Parse a signature with comma separated parameters,\n * like \"number | boolean, ...string\"\n *\n * @param {string} signature\n * @return {Param[]} params\n */\n function parseSignature(rawSignature) {\n const params = [];\n if (typeof rawSignature !== 'string') {\n throw new TypeError('Signatures must be strings');\n }\n const signature = rawSignature.trim();\n if (signature === '') {\n return params;\n }\n const rawParams = signature.split(',');\n for (let i = 0; i < rawParams.length; ++i) {\n const parsedParam = parseParam(rawParams[i].trim());\n if (parsedParam.restParam && i !== rawParams.length - 1) {\n throw new SyntaxError('Unexpected rest parameter \"' + rawParams[i] + '\": ' + 'only allowed for the last parameter');\n }\n // if invalid, short-circuit (all the types may have been filtered)\n if (parsedParam.types.length === 0) {\n return null;\n }\n params.push(parsedParam);\n }\n return params;\n }\n\n /**\n * Test whether a set of params contains a restParam\n * @param {Param[]} params\n * @return {boolean} Returns true when the last parameter is a restParam\n */\n function hasRestParam(params) {\n const param = last(params);\n return param ? param.restParam : false;\n }\n\n /**\n * Create a type test for a single parameter, which can have one or multiple\n * types.\n * @param {Param} param\n * @return {function(x: *) : boolean} Returns a test function\n */\n function compileTest(param) {\n if (!param || param.types.length === 0) {\n // nothing to do\n return ok;\n } else if (param.types.length === 1) {\n return findType(param.types[0].name).test;\n } else if (param.types.length === 2) {\n const test0 = findType(param.types[0].name).test;\n const test1 = findType(param.types[1].name).test;\n return function or(x) {\n return test0(x) || test1(x);\n };\n } else {\n // param.types.length > 2\n const tests = param.types.map(function (type) {\n return findType(type.name).test;\n });\n return function or(x) {\n for (let i = 0; i < tests.length; i++) {\n if (tests[i](x)) {\n return true;\n }\n }\n return false;\n };\n }\n }\n\n /**\n * Create a test for all parameters of a signature\n * @param {Param[]} params\n * @return {function(args: Array<*>) : boolean}\n */\n function compileTests(params) {\n let tests, test0, test1;\n if (hasRestParam(params)) {\n // variable arguments like '...number'\n tests = initial(params).map(compileTest);\n const varIndex = tests.length;\n const lastTest = compileTest(last(params));\n const testRestParam = function (args) {\n for (let i = varIndex; i < args.length; i++) {\n if (!lastTest(args[i])) {\n return false;\n }\n }\n return true;\n };\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return testRestParam(args) && args.length >= varIndex + 1;\n };\n } else {\n // no variable arguments\n if (params.length === 0) {\n return function testArgs(args) {\n return args.length === 0;\n };\n } else if (params.length === 1) {\n test0 = compileTest(params[0]);\n return function testArgs(args) {\n return test0(args[0]) && args.length === 1;\n };\n } else if (params.length === 2) {\n test0 = compileTest(params[0]);\n test1 = compileTest(params[1]);\n return function testArgs(args) {\n return test0(args[0]) && test1(args[1]) && args.length === 2;\n };\n } else {\n // arguments.length > 2\n tests = params.map(compileTest);\n return function testArgs(args) {\n for (let i = 0; i < tests.length; i++) {\n if (!tests[i](args[i])) {\n return false;\n }\n }\n return args.length === tests.length;\n };\n }\n }\n }\n\n /**\n * Find the parameter at a specific index of a Params list.\n * Handles rest parameters.\n * @param {Param[]} params\n * @param {number} index\n * @return {Param | null} Returns the matching parameter when found,\n * null otherwise.\n */\n function getParamAtIndex(params, index) {\n return index < params.length ? params[index] : hasRestParam(params) ? last(params) : null;\n }\n\n /**\n * Get all type names of a parameter\n * @param {Params[]} params\n * @param {number} index\n * @return {string[]} Returns an array with type names\n */\n function getTypeSetAtIndex(params, index) {\n const param = getParamAtIndex(params, index);\n if (!param) {\n return new Set();\n }\n return paramTypeSet(param);\n }\n\n /**\n * Test whether a type is an exact type or conversion\n * @param {Type} type\n * @return {boolean} Returns true when\n */\n function isExactType(type) {\n return type.conversion === null || type.conversion === undefined;\n }\n\n /**\n * Helper function for creating error messages: create an array with\n * all available types on a specific argument index.\n * @param {Signature[]} signatures\n * @param {number} index\n * @return {string[]} Returns an array with available types\n */\n function mergeExpectedParams(signatures, index) {\n const typeSet = new Set();\n signatures.forEach(signature => {\n const paramSet = getTypeSetAtIndex(signature.params, index);\n let name;\n for (name of paramSet) {\n typeSet.add(name);\n }\n });\n return typeSet.has('any') ? ['any'] : Array.from(typeSet);\n }\n\n /**\n * Create\n * @param {string} name The name of the function\n * @param {array.<*>} args The actual arguments passed to the function\n * @param {Signature[]} signatures A list with available signatures\n * @return {TypeError} Returns a type error with additional data\n * attached to it in the property `data`\n */\n function createError(name, args, signatures) {\n let err, expected;\n const _name = name || 'unnamed';\n\n // test for wrong type at some index\n let matchingSignatures = signatures;\n let index;\n for (index = 0; index < args.length; index++) {\n const nextMatchingDefs = [];\n matchingSignatures.forEach(signature => {\n const param = getParamAtIndex(signature.params, index);\n const test = compileTest(param);\n if ((index < signature.params.length || hasRestParam(signature.params)) && test(args[index])) {\n nextMatchingDefs.push(signature);\n }\n });\n if (nextMatchingDefs.length === 0) {\n // no matching signatures anymore, throw error \"wrong type\"\n expected = mergeExpectedParams(matchingSignatures, index);\n if (expected.length > 0) {\n const actualTypes = findTypeNames(args[index]);\n err = new TypeError('Unexpected type of argument in function ' + _name + ' (expected: ' + expected.join(' or ') + ', actual: ' + actualTypes.join(' | ') + ', index: ' + index + ')');\n err.data = {\n category: 'wrongType',\n fn: _name,\n index,\n actual: actualTypes,\n expected\n };\n return err;\n }\n } else {\n matchingSignatures = nextMatchingDefs;\n }\n }\n\n // test for too few arguments\n const lengths = matchingSignatures.map(function (signature) {\n return hasRestParam(signature.params) ? Infinity : signature.params.length;\n });\n if (args.length < Math.min.apply(null, lengths)) {\n expected = mergeExpectedParams(matchingSignatures, index);\n err = new TypeError('Too few arguments in function ' + _name + ' (expected: ' + expected.join(' or ') + ', index: ' + args.length + ')');\n err.data = {\n category: 'tooFewArgs',\n fn: _name,\n index: args.length,\n expected\n };\n return err;\n }\n\n // test for too many arguments\n const maxLength = Math.max.apply(null, lengths);\n if (args.length > maxLength) {\n err = new TypeError('Too many arguments in function ' + _name + ' (expected: ' + maxLength + ', actual: ' + args.length + ')');\n err.data = {\n category: 'tooManyArgs',\n fn: _name,\n index: args.length,\n expectedLength: maxLength\n };\n return err;\n }\n\n // Generic error\n const argTypes = [];\n for (let i = 0; i < args.length; ++i) {\n argTypes.push(findTypeNames(args[i]).join('|'));\n }\n err = new TypeError('Arguments of type \"' + argTypes.join(', ') + '\" do not match any of the defined signatures of function ' + _name + '.');\n err.data = {\n category: 'mismatch',\n actual: argTypes\n };\n return err;\n }\n\n /**\n * Find the lowest index of all exact types of a parameter (no conversions)\n * @param {Param} param\n * @return {number} Returns the index of the lowest type in typed.types\n */\n function getLowestTypeIndex(param) {\n let min = typeList.length + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].typeIndex);\n }\n }\n return min;\n }\n\n /**\n * Find the lowest index of the conversion of all types of the parameter\n * having a conversion\n * @param {Param} param\n * @return {number} Returns the lowest index of the conversions of this type\n */\n function getLowestConversionIndex(param) {\n let min = nConversions + 1;\n for (let i = 0; i < param.types.length; i++) {\n if (!isExactType(param.types[i])) {\n min = Math.min(min, param.types[i].conversionIndex);\n }\n }\n return min;\n }\n\n /**\n * Compare two params\n * @param {Param} param1\n * @param {Param} param2\n * @return {number} returns -1 when param1 must get a lower\n * index than param2, 1 when the opposite,\n * or zero when both are equal\n */\n function compareParams(param1, param2) {\n // We compare a number of metrics on a param in turn:\n // 1) 'any' parameters are the least preferred\n if (param1.hasAny) {\n if (!param2.hasAny) {\n return 1;\n }\n } else if (param2.hasAny) {\n return -1;\n }\n\n // 2) Prefer non-rest to rest parameters\n if (param1.restParam) {\n if (!param2.restParam) {\n return 1;\n }\n } else if (param2.restParam) {\n return -1;\n }\n\n // 3) Prefer exact type match to conversions\n if (param1.hasConversion) {\n if (!param2.hasConversion) {\n return 1;\n }\n } else if (param2.hasConversion) {\n return -1;\n }\n\n // 4) Prefer lower type index:\n const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2);\n if (typeDiff < 0) {\n return -1;\n }\n if (typeDiff > 0) {\n return 1;\n }\n\n // 5) Prefer lower conversion index\n const convDiff = getLowestConversionIndex(param1) - getLowestConversionIndex(param2);\n if (convDiff < 0) {\n return -1;\n }\n if (convDiff > 0) {\n return 1;\n }\n\n // Don't have a basis for preference\n return 0;\n }\n\n /**\n * Compare two signatures\n * @param {Signature} signature1\n * @param {Signature} signature2\n * @return {number} returns a negative number when param1 must get a lower\n * index than param2, a positive number when the opposite,\n * or zero when both are equal\n */\n function compareSignatures(signature1, signature2) {\n const pars1 = signature1.params;\n const pars2 = signature2.params;\n const last1 = last(pars1);\n const last2 = last(pars2);\n const hasRest1 = hasRestParam(pars1);\n const hasRest2 = hasRestParam(pars2);\n // We compare a number of metrics on signatures in turn:\n // 1) An \"any rest param\" is least preferred\n if (hasRest1 && last1.hasAny) {\n if (!hasRest2 || !last2.hasAny) {\n return 1;\n }\n } else if (hasRest2 && last2.hasAny) {\n return -1;\n }\n\n // 2) Minimize the number of 'any' parameters\n let any1 = 0;\n let conv1 = 0;\n let par;\n for (par of pars1) {\n if (par.hasAny) ++any1;\n if (par.hasConversion) ++conv1;\n }\n let any2 = 0;\n let conv2 = 0;\n for (par of pars2) {\n if (par.hasAny) ++any2;\n if (par.hasConversion) ++conv2;\n }\n if (any1 !== any2) {\n return any1 - any2;\n }\n\n // 3) A conversion rest param is less preferred\n if (hasRest1 && last1.hasConversion) {\n if (!hasRest2 || !last2.hasConversion) {\n return 1;\n }\n } else if (hasRest2 && last2.hasConversion) {\n return -1;\n }\n\n // 4) Minimize the number of conversions\n if (conv1 !== conv2) {\n return conv1 - conv2;\n }\n\n // 5) Prefer no rest param\n if (hasRest1) {\n if (!hasRest2) {\n return 1;\n }\n } else if (hasRest2) {\n return -1;\n }\n\n // 6) Prefer shorter with rest param, longer without\n const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -1 : 1);\n if (lengthCriterion !== 0) {\n return lengthCriterion;\n }\n\n // Signatures are identical in each of the above metrics.\n // In particular, they are the same length.\n // We can therefore compare the parameters one by one.\n // First we count which signature has more preferred parameters.\n const comparisons = [];\n let tc = 0;\n for (let i = 0; i < pars1.length; ++i) {\n const thisComparison = compareParams(pars1[i], pars2[i]);\n comparisons.push(thisComparison);\n tc += thisComparison;\n }\n if (tc !== 0) {\n return tc;\n }\n\n // They have the same number of preferred parameters, so go by the\n // earliest parameter in which we have a preference.\n // In other words, dispatch is driven somewhat more by earlier\n // parameters than later ones.\n let c;\n for (c of comparisons) {\n if (c !== 0) {\n return c;\n }\n }\n\n // It's a tossup:\n return 0;\n }\n\n /**\n * Produce a list of all conversions from distinct types to one of\n * the given types.\n *\n * @param {string[]} typeNames\n * @return {ConversionDef[]} Returns the conversions that are available\n * resulting in any given type (if any)\n */\n function availableConversions(typeNames) {\n if (typeNames.length === 0) {\n return [];\n }\n const types = typeNames.map(findType);\n if (typeNames.length > 1) {\n types.sort((t1, t2) => t1.index - t2.index);\n }\n let matches = types[0].conversionsTo;\n if (typeNames.length === 1) {\n return matches;\n }\n matches = matches.concat([]); // shallow copy the matches\n // Since the types are now in index order, we just want the first\n // occurrence of any from type:\n const knownTypes = new Set(typeNames);\n for (let i = 1; i < types.length; ++i) {\n let newMatch;\n for (newMatch of types[i].conversionsTo) {\n if (!knownTypes.has(newMatch.from)) {\n matches.push(newMatch);\n knownTypes.add(newMatch.from);\n }\n }\n }\n return matches;\n }\n\n /**\n * Preprocess arguments before calling the original function:\n * - if needed convert the parameters\n * - in case of rest parameters, move the rest parameters into an Array\n * @param {Param[]} params\n * @param {function} fn\n * @return {function} Returns a wrapped function\n */\n function compileArgsPreprocessing(params, fn) {\n let fnConvert = fn;\n\n // TODO: can we make this wrapper function smarter/simpler?\n\n if (params.some(p => p.hasConversion)) {\n const restParam = hasRestParam(params);\n const compiledConversions = params.map(compileArgConversion);\n fnConvert = function convertArgs() {\n const args = [];\n const last = restParam ? arguments.length - 1 : arguments.length;\n for (let i = 0; i < last; i++) {\n args[i] = compiledConversions[i](arguments[i]);\n }\n if (restParam) {\n args[last] = arguments[last].map(compiledConversions[last]);\n }\n return fn.apply(this, args);\n };\n }\n let fnPreprocess = fnConvert;\n if (hasRestParam(params)) {\n const offset = params.length - 1;\n fnPreprocess = function preprocessRestParams() {\n return fnConvert.apply(this, slice(arguments, 0, offset).concat([slice(arguments, offset)]));\n };\n }\n return fnPreprocess;\n }\n\n /**\n * Compile conversion for a parameter to the right type\n * @param {Param} param\n * @return {function} Returns the wrapped function that will convert arguments\n *\n */\n function compileArgConversion(param) {\n let test0, test1, conversion0, conversion1;\n const tests = [];\n const conversions = [];\n param.types.forEach(function (type) {\n if (type.conversion) {\n tests.push(findType(type.conversion.from).test);\n conversions.push(type.conversion.convert);\n }\n });\n\n // create optimized conversion functions depending on the number of conversions\n switch (conversions.length) {\n case 0:\n return function convertArg(arg) {\n return arg;\n };\n case 1:\n test0 = tests[0];\n conversion0 = conversions[0];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n return arg;\n };\n case 2:\n test0 = tests[0];\n test1 = tests[1];\n conversion0 = conversions[0];\n conversion1 = conversions[1];\n return function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n if (test1(arg)) {\n return conversion1(arg);\n }\n return arg;\n };\n default:\n return function convertArg(arg) {\n for (let i = 0; i < conversions.length; i++) {\n if (tests[i](arg)) {\n return conversions[i](arg);\n }\n }\n return arg;\n };\n }\n }\n\n /**\n * Split params with union types in to separate params.\n *\n * For example:\n *\n * splitParams([['Array', 'Object'], ['string', 'RegExp'])\n * // returns:\n * // [\n * // ['Array', 'string'],\n * // ['Array', 'RegExp'],\n * // ['Object', 'string'],\n * // ['Object', 'RegExp']\n * // ]\n *\n * @param {Param[]} params\n * @return {Param[]}\n */\n function splitParams(params) {\n function _splitParams(params, index, paramsSoFar) {\n if (index < params.length) {\n const param = params[index];\n let resultingParams = [];\n if (param.restParam) {\n // split the types of a rest parameter in two:\n // one with only exact types, and one with exact types and conversions\n const exactTypes = param.types.filter(isExactType);\n if (exactTypes.length < param.types.length) {\n resultingParams.push({\n types: exactTypes,\n name: '...' + exactTypes.map(t => t.name).join('|'),\n hasAny: exactTypes.some(t => t.isAny),\n hasConversion: false,\n restParam: true\n });\n }\n resultingParams.push(param);\n } else {\n // split all the types of a regular parameter into one type per param\n resultingParams = param.types.map(function (type) {\n return {\n types: [type],\n name: type.name,\n hasAny: type.isAny,\n hasConversion: type.conversion,\n restParam: false\n };\n });\n }\n\n // recurse over the groups with types\n return flatMap(resultingParams, function (nextParam) {\n return _splitParams(params, index + 1, paramsSoFar.concat([nextParam]));\n });\n } else {\n // we've reached the end of the parameters.\n return [paramsSoFar];\n }\n }\n return _splitParams(params, 0, []);\n }\n\n /**\n * Test whether two param lists represent conflicting signatures\n * @param {Param[]} params1\n * @param {Param[]} params2\n * @return {boolean} Returns true when the signatures conflict, false otherwise.\n */\n function conflicting(params1, params2) {\n const ii = Math.max(params1.length, params2.length);\n for (let i = 0; i < ii; i++) {\n const typeSet1 = getTypeSetAtIndex(params1, i);\n const typeSet2 = getTypeSetAtIndex(params2, i);\n let overlap = false;\n let name;\n for (name of typeSet2) {\n if (typeSet1.has(name)) {\n overlap = true;\n break;\n }\n }\n if (!overlap) {\n return false;\n }\n }\n const len1 = params1.length;\n const len2 = params2.length;\n const restParam1 = hasRestParam(params1);\n const restParam2 = hasRestParam(params2);\n return restParam1 ? restParam2 ? len1 === len2 : len2 >= len1 : restParam2 ? len1 >= len2 : len1 === len2;\n }\n\n /**\n * Helper function for `resolveReferences` that returns a copy of\n * functionList wihe any prior resolutions cleared out, in case we are\n * recycling signatures from a prior typed function construction.\n *\n * @param {Array.} functionList\n * @return {Array.}\n */\n function clearResolutions(functionList) {\n return functionList.map(fn => {\n if (isReferToSelf(fn)) {\n return referToSelf(fn.referToSelf.callback);\n }\n if (isReferTo(fn)) {\n return makeReferTo(fn.referTo.references, fn.referTo.callback);\n }\n return fn;\n });\n }\n\n /**\n * Take a list of references, a list of functions functionList, and a\n * signatureMap indexing signatures into functionList, and return\n * the list of resolutions, or a false-y value if they don't all\n * resolve in a valid way (yet).\n *\n * @param {string[]} references\n * @param {Array} signatureMap\n * @return {function[] | false} resolutions\n */\n function collectResolutions(references, functionList, signatureMap) {\n const resolvedReferences = [];\n let reference;\n for (reference of references) {\n let resolution = signatureMap[reference];\n if (typeof resolution !== 'number') {\n throw new TypeError('No definition for referenced signature \"' + reference + '\"');\n }\n resolution = functionList[resolution];\n if (typeof resolution !== 'function') {\n return false;\n }\n resolvedReferences.push(resolution);\n }\n return resolvedReferences;\n }\n\n /**\n * Resolve any references in the functionList for the typed function\n * itself. The signatureMap tells which index in the functionList a\n * given signature should be mapped to (for use in resolving typed.referTo)\n * and self provides the destions of a typed.referToSelf.\n *\n * @param {Array} functionList\n * @param {Object.} signatureMap\n * @param {function} self The typed-function itself\n * @return {Array} The list of resolved functions\n */\n function resolveReferences(functionList, signatureMap, self) {\n const resolvedFunctions = clearResolutions(functionList);\n const isResolved = new Array(resolvedFunctions.length).fill(false);\n let leftUnresolved = true;\n while (leftUnresolved) {\n leftUnresolved = false;\n let nothingResolved = true;\n for (let i = 0; i < resolvedFunctions.length; ++i) {\n if (isResolved[i]) continue;\n const fn = resolvedFunctions[i];\n if (isReferToSelf(fn)) {\n resolvedFunctions[i] = fn.referToSelf.callback(self);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referToSelf = fn.referToSelf;\n isResolved[i] = true;\n nothingResolved = false;\n } else if (isReferTo(fn)) {\n const resolvedReferences = collectResolutions(fn.referTo.references, resolvedFunctions, signatureMap);\n if (resolvedReferences) {\n resolvedFunctions[i] = fn.referTo.callback.apply(this, resolvedReferences);\n // Preserve reference in case signature is reused someday:\n resolvedFunctions[i].referTo = fn.referTo;\n isResolved[i] = true;\n nothingResolved = false;\n } else {\n leftUnresolved = true;\n }\n }\n }\n if (nothingResolved && leftUnresolved) {\n throw new SyntaxError('Circular reference detected in resolving typed.referTo');\n }\n }\n return resolvedFunctions;\n }\n\n /**\n * Validate whether any of the function bodies contains a self-reference\n * usage like `this(...)` or `this.signatures`. This self-referencing is\n * deprecated since typed-function v3. It has been replaced with\n * the functions typed.referTo and typed.referToSelf.\n * @param {Object.} signaturesMap\n */\n function validateDeprecatedThis(signaturesMap) {\n // TODO: remove this deprecation warning logic some day (it's introduced in v3)\n\n // match occurrences like 'this(' and 'this.signatures'\n const deprecatedThisRegex = /\\bthis(\\(|\\.signatures\\b)/;\n Object.keys(signaturesMap).forEach(signature => {\n const fn = signaturesMap[signature];\n if (deprecatedThisRegex.test(fn.toString())) {\n throw new SyntaxError('Using `this` to self-reference a function ' + 'is deprecated since typed-function@3. ' + 'Use typed.referTo and typed.referToSelf instead.');\n }\n });\n }\n\n /**\n * Create a typed function\n * @param {String} name The name for the typed function\n * @param {Object.} rawSignaturesMap\n * An object with one or\n * multiple signatures as key, and the\n * function corresponding to the\n * signature as value.\n * @return {function} Returns the created typed function.\n */\n function createTypedFunction(name, rawSignaturesMap) {\n typed.createCount++;\n if (Object.keys(rawSignaturesMap).length === 0) {\n throw new SyntaxError('No signatures provided');\n }\n if (typed.warnAgainstDeprecatedThis) {\n validateDeprecatedThis(rawSignaturesMap);\n }\n\n // Main processing loop for signatures\n const parsedParams = [];\n const originalFunctions = [];\n const signaturesMap = {};\n const preliminarySignatures = []; // may have duplicates from conversions\n let signature;\n for (signature in rawSignaturesMap) {\n // A) Protect against polluted Object prototype:\n if (!Object.prototype.hasOwnProperty.call(rawSignaturesMap, signature)) {\n continue;\n }\n // B) Parse the signature\n const params = parseSignature(signature);\n if (!params) continue;\n // C) Check for conflicts\n parsedParams.forEach(function (pp) {\n if (conflicting(pp, params)) {\n throw new TypeError('Conflicting signatures \"' + stringifyParams(pp) + '\" and \"' + stringifyParams(params) + '\".');\n }\n });\n parsedParams.push(params);\n // D) Store the provided function and add conversions\n const functionIndex = originalFunctions.length;\n originalFunctions.push(rawSignaturesMap[signature]);\n const conversionParams = params.map(expandParam);\n // E) Split the signatures and collect them up\n let sp;\n for (sp of splitParams(conversionParams)) {\n const spName = stringifyParams(sp);\n preliminarySignatures.push({\n params: sp,\n name: spName,\n fn: functionIndex\n });\n if (sp.every(p => !p.hasConversion)) {\n signaturesMap[spName] = functionIndex;\n }\n }\n }\n preliminarySignatures.sort(compareSignatures);\n\n // Note the forward reference to theTypedFn\n const resolvedFunctions = resolveReferences(originalFunctions, signaturesMap, theTypedFn);\n\n // Fill in the proper function for each signature\n let s;\n for (s in signaturesMap) {\n if (Object.prototype.hasOwnProperty.call(signaturesMap, s)) {\n signaturesMap[s] = resolvedFunctions[signaturesMap[s]];\n }\n }\n const signatures = [];\n const internalSignatureMap = new Map(); // benchmarks faster than object\n for (s of preliminarySignatures) {\n // Note it's only safe to eliminate duplicates like this\n // _after_ the signature sorting step above; otherwise we might\n // remove the wrong one.\n if (!internalSignatureMap.has(s.name)) {\n s.fn = resolvedFunctions[s.fn];\n signatures.push(s);\n internalSignatureMap.set(s.name, s);\n }\n }\n\n // we create a highly optimized checks for the first couple of signatures with max 2 arguments\n const ok0 = signatures[0] && signatures[0].params.length <= 2 && !hasRestParam(signatures[0].params);\n const ok1 = signatures[1] && signatures[1].params.length <= 2 && !hasRestParam(signatures[1].params);\n const ok2 = signatures[2] && signatures[2].params.length <= 2 && !hasRestParam(signatures[2].params);\n const ok3 = signatures[3] && signatures[3].params.length <= 2 && !hasRestParam(signatures[3].params);\n const ok4 = signatures[4] && signatures[4].params.length <= 2 && !hasRestParam(signatures[4].params);\n const ok5 = signatures[5] && signatures[5].params.length <= 2 && !hasRestParam(signatures[5].params);\n const allOk = ok0 && ok1 && ok2 && ok3 && ok4 && ok5;\n\n // compile the tests\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].test = compileTests(signatures[i].params);\n }\n const test00 = ok0 ? compileTest(signatures[0].params[0]) : notOk;\n const test10 = ok1 ? compileTest(signatures[1].params[0]) : notOk;\n const test20 = ok2 ? compileTest(signatures[2].params[0]) : notOk;\n const test30 = ok3 ? compileTest(signatures[3].params[0]) : notOk;\n const test40 = ok4 ? compileTest(signatures[4].params[0]) : notOk;\n const test50 = ok5 ? compileTest(signatures[5].params[0]) : notOk;\n const test01 = ok0 ? compileTest(signatures[0].params[1]) : notOk;\n const test11 = ok1 ? compileTest(signatures[1].params[1]) : notOk;\n const test21 = ok2 ? compileTest(signatures[2].params[1]) : notOk;\n const test31 = ok3 ? compileTest(signatures[3].params[1]) : notOk;\n const test41 = ok4 ? compileTest(signatures[4].params[1]) : notOk;\n const test51 = ok5 ? compileTest(signatures[5].params[1]) : notOk;\n\n // compile the functions\n for (let i = 0; i < signatures.length; ++i) {\n signatures[i].implementation = compileArgsPreprocessing(signatures[i].params, signatures[i].fn);\n }\n const fn0 = ok0 ? signatures[0].implementation : undef;\n const fn1 = ok1 ? signatures[1].implementation : undef;\n const fn2 = ok2 ? signatures[2].implementation : undef;\n const fn3 = ok3 ? signatures[3].implementation : undef;\n const fn4 = ok4 ? signatures[4].implementation : undef;\n const fn5 = ok5 ? signatures[5].implementation : undef;\n const len0 = ok0 ? signatures[0].params.length : -1;\n const len1 = ok1 ? signatures[1].params.length : -1;\n const len2 = ok2 ? signatures[2].params.length : -1;\n const len3 = ok3 ? signatures[3].params.length : -1;\n const len4 = ok4 ? signatures[4].params.length : -1;\n const len5 = ok5 ? signatures[5].params.length : -1;\n\n // simple and generic, but also slow\n const iStart = allOk ? 6 : 0;\n const iEnd = signatures.length;\n // de-reference ahead for execution speed:\n const tests = signatures.map(s => s.test);\n const fns = signatures.map(s => s.implementation);\n const generic = function generic() {\n 'use strict';\n\n for (let i = iStart; i < iEnd; i++) {\n if (tests[i](arguments)) {\n return fns[i].apply(this, arguments);\n }\n }\n return typed.onMismatch(name, arguments, signatures);\n };\n\n // create the typed function\n // fast, specialized version. Falls back to the slower, generic one if needed\n function theTypedFn(arg0, arg1) {\n 'use strict';\n\n if (arguments.length === len0 && test00(arg0) && test01(arg1)) {\n return fn0.apply(this, arguments);\n }\n if (arguments.length === len1 && test10(arg0) && test11(arg1)) {\n return fn1.apply(this, arguments);\n }\n if (arguments.length === len2 && test20(arg0) && test21(arg1)) {\n return fn2.apply(this, arguments);\n }\n if (arguments.length === len3 && test30(arg0) && test31(arg1)) {\n return fn3.apply(this, arguments);\n }\n if (arguments.length === len4 && test40(arg0) && test41(arg1)) {\n return fn4.apply(this, arguments);\n }\n if (arguments.length === len5 && test50(arg0) && test51(arg1)) {\n return fn5.apply(this, arguments);\n }\n return generic.apply(this, arguments);\n }\n\n // attach name the typed function\n try {\n Object.defineProperty(theTypedFn, 'name', {\n value: name\n });\n } catch (err) {\n // old browsers do not support Object.defineProperty and some don't support setting the name property\n // the function name is not essential for the functioning, it's mostly useful for debugging,\n // so it's fine to have unnamed functions.\n }\n\n // attach signatures to the function.\n // This property is close to the original collection of signatures\n // used to create the typed-function, just with unions split:\n theTypedFn.signatures = signaturesMap;\n\n // Store internal data for functions like resolve, find, etc.\n // Also serves as the flag that this is a typed-function\n theTypedFn._typedFunctionData = {\n signatures,\n signatureMap: internalSignatureMap\n };\n return theTypedFn;\n }\n\n /**\n * Action to take on mismatch\n * @param {string} name Name of function that was attempted to be called\n * @param {Array} args Actual arguments to the call\n * @param {Array} signatures Known signatures of the named typed-function\n */\n function _onMismatch(name, args, signatures) {\n throw createError(name, args, signatures);\n }\n\n /**\n * Return all but the last items of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {Array}\n */\n function initial(arr) {\n return slice(arr, 0, arr.length - 1);\n }\n\n /**\n * return the last item of an array or function Arguments\n * @param {Array | Arguments} arr\n * @return {*}\n */\n function last(arr) {\n return arr[arr.length - 1];\n }\n\n /**\n * Slice an array or function Arguments\n * @param {Array | Arguments | IArguments} arr\n * @param {number} start\n * @param {number} [end]\n * @return {Array}\n */\n function slice(arr, start, end) {\n return Array.prototype.slice.call(arr, start, end);\n }\n\n /**\n * Return the first item from an array for which test(arr[i]) returns true\n * @param {Array} arr\n * @param {function} test\n * @return {* | undefined} Returns the first matching item\n * or undefined when there is no match\n */\n function findInArray(arr, test) {\n for (let i = 0; i < arr.length; i++) {\n if (test(arr[i])) {\n return arr[i];\n }\n }\n return undefined;\n }\n\n /**\n * Flat map the result invoking a callback for every item in an array.\n * https://gist.github.com/samgiles/762ee337dff48623e729\n * @param {Array} arr\n * @param {function} callback\n * @return {Array}\n */\n function flatMap(arr, callback) {\n return Array.prototype.concat.apply([], arr.map(callback));\n }\n\n /**\n * Create a reference callback to one or multiple signatures\n *\n * Syntax:\n *\n * typed.referTo(signature1, signature2, ..., function callback(fn1, fn2, ...) {\n * // ...\n * })\n *\n * @returns {{referTo: {references: string[], callback}}}\n */\n function referTo() {\n const references = initial(arguments).map(s => stringifyParams(parseSignature(s)));\n const callback = last(arguments);\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as last argument');\n }\n return makeReferTo(references, callback);\n }\n function makeReferTo(references, callback) {\n return {\n referTo: {\n references,\n callback\n }\n };\n }\n\n /**\n * Create a reference callback to the typed-function itself\n *\n * @param {(self: function) => function} callback\n * @returns {{referToSelf: { callback: function }}}\n */\n function referToSelf(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('Callback function expected as first argument');\n }\n return {\n referToSelf: {\n callback\n }\n };\n }\n\n /**\n * Test whether something is a referTo object, holding a list with reference\n * signatures and a callback.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferTo(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referTo === 'object' && Array.isArray(objectOrFn.referTo.references) && typeof objectOrFn.referTo.callback === 'function';\n }\n\n /**\n * Test whether something is a referToSelf object, holding a callback where\n * to pass `self`.\n *\n * @param {Object | function} objectOrFn\n * @returns {boolean}\n */\n function isReferToSelf(objectOrFn) {\n return objectOrFn && typeof objectOrFn.referToSelf === 'object' && typeof objectOrFn.referToSelf.callback === 'function';\n }\n\n /**\n * Check if name is (A) new, (B) a match, or (C) a mismatch; and throw\n * an error in case (C).\n *\n * @param { string | undefined } nameSoFar\n * @param { string | undefined } newName\n * @returns { string } updated name\n */\n function checkName(nameSoFar, newName) {\n if (!nameSoFar) {\n return newName;\n }\n if (newName && newName !== nameSoFar) {\n const err = new Error('Function names do not match (expected: ' + nameSoFar + ', actual: ' + newName + ')');\n err.data = {\n actual: newName,\n expected: nameSoFar\n };\n throw err;\n }\n return nameSoFar;\n }\n\n /**\n * Retrieve the implied name from an object with signature keys\n * and function values, checking whether all value names match\n *\n * @param { {string: function} } obj\n */\n function getObjectName(obj) {\n let name;\n for (const key in obj) {\n // Only pay attention to own properties, and only if their values\n // are typed functions or functions with a signature property\n if (Object.prototype.hasOwnProperty.call(obj, key) && (isTypedFunction(obj[key]) || typeof obj[key].signature === 'string')) {\n name = checkName(name, obj[key].name);\n }\n }\n return name;\n }\n\n /**\n * Copy all of the signatures from the second argument into the first,\n * which is modified by side effect, checking for conflicts\n *\n * @param {Object.} dest\n * @param {Object.} source\n */\n function mergeSignatures(dest, source) {\n let key;\n for (key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (key in dest) {\n if (source[key] !== dest[key]) {\n const err = new Error('Signature \"' + key + '\" is defined twice');\n err.data = {\n signature: key,\n sourceFunction: source[key],\n destFunction: dest[key]\n };\n throw err;\n }\n // else: both signatures point to the same function, that's fine\n }\n dest[key] = source[key];\n }\n }\n }\n const saveTyped = typed;\n\n /**\n * Originally the main function was a typed function itself, but then\n * it might not be able to generate error messages if the client\n * replaced the type system with different names.\n *\n * Main entry: typed([name], functions/objects with signatures...)\n *\n * Assembles and returns a new typed-function from the given items\n * that provide signatures and implementations, each of which may be\n * * a plain object mapping (string) signatures to implementing functions,\n * * a previously constructed typed function, or\n * * any other single function with a string-valued property `signature`.\n * The name of the resulting typed-function will be given by the\n * string-valued name argument if present, or if not, by the name\n * of any of the arguments that have one, as long as any that do are\n * consistent with each other. If no name is specified, the name will be\n * an empty string.\n *\n * @param {string} maybeName [optional]\n * @param {(function|object)[]} signature providers\n * @returns {typed-function}\n */\n typed = function (maybeName) {\n const named = typeof maybeName === 'string';\n const start = named ? 1 : 0;\n let name = named ? maybeName : '';\n const allSignatures = {};\n for (let i = start; i < arguments.length; ++i) {\n const item = arguments[i];\n let theseSignatures = {};\n let thisName;\n if (typeof item === 'function') {\n thisName = item.name;\n if (typeof item.signature === 'string') {\n // Case 1: Ordinary function with a string 'signature' property\n theseSignatures[item.signature] = item;\n } else if (isTypedFunction(item)) {\n // Case 2: Existing typed function\n theseSignatures = item.signatures;\n }\n } else if (isPlainObject(item)) {\n // Case 3: Plain object, assume keys = signatures, values = functions\n theseSignatures = item;\n if (!named) {\n thisName = getObjectName(item);\n }\n }\n if (Object.keys(theseSignatures).length === 0) {\n const err = new TypeError('Argument to \\'typed\\' at index ' + i + ' is not a (typed) function, ' + 'nor an object with signatures as keys and functions as values.');\n err.data = {\n index: i,\n argument: item\n };\n throw err;\n }\n if (!named) {\n name = checkName(name, thisName);\n }\n mergeSignatures(allSignatures, theseSignatures);\n }\n return createTypedFunction(name || '', allSignatures);\n };\n typed.create = create;\n typed.createCount = saveTyped.createCount;\n typed.onMismatch = _onMismatch;\n typed.throwMismatchError = _onMismatch;\n typed.createError = createError;\n typed.clear = clear;\n typed.clearConversions = clearConversions;\n typed.addTypes = addTypes;\n typed._findType = findType; // For unit testing only\n typed.referTo = referTo;\n typed.referToSelf = referToSelf;\n typed.convert = convert;\n typed.findSignature = findSignature;\n typed.find = find;\n typed.isTypedFunction = isTypedFunction;\n typed.warnAgainstDeprecatedThis = true;\n\n /**\n * add a type (convenience wrapper for typed.addTypes)\n * @param {{name: string, test: function}} type\n * @param {boolean} [beforeObjectTest=true]\n * If true, the new test will be inserted before\n * the test with name 'Object' (if any), since\n * tests for Object match Array and classes too.\n */\n typed.addType = function (type, beforeObjectTest) {\n let before = 'any';\n if (beforeObjectTest !== false && typeMap.has('Object')) {\n before = 'Object';\n }\n typed.addTypes([type], before);\n };\n\n /**\n * Verify that the ConversionDef conversion has a valid format.\n *\n * @param {conversionDef} conversion\n * @return {void}\n * @throws {TypeError|SyntaxError}\n */\n function _validateConversion(conversion) {\n if (!conversion || typeof conversion.from !== 'string' || typeof conversion.to !== 'string' || typeof conversion.convert !== 'function') {\n throw new TypeError('Object with properties {from: string, to: string, convert: function} expected');\n }\n if (conversion.to === conversion.from) {\n throw new SyntaxError('Illegal to define conversion from \"' + conversion.from + '\" to itself.');\n }\n }\n\n /**\n * Add a conversion\n *\n * @param {ConversionDef} conversion\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversion = function (conversion) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n override: false\n };\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existing = to.conversionsTo.find(other => other.from === conversion.from);\n if (existing) {\n if (options && options.override) {\n typed.removeConversion({\n from: existing.from,\n to: conversion.to,\n convert: existing.convert\n });\n } else {\n throw new Error('There is already a conversion from \"' + conversion.from + '\" to \"' + to.name + '\"');\n }\n }\n to.conversionsTo.push({\n from: conversion.from,\n convert: conversion.convert,\n index: nConversions++\n });\n };\n\n /**\n * Convenience wrapper to call addConversion on each conversion in a list.\n *\n * @param {ConversionDef[]} conversions\n * @param {{override: boolean}} [options]\n * @returns {void}\n * @throws {TypeError}\n */\n typed.addConversions = function (conversions, options) {\n conversions.forEach(conversion => typed.addConversion(conversion, options));\n };\n\n /**\n * Remove the specified conversion. The format is the same as for\n * addConversion, and the convert function must match or an error\n * is thrown.\n *\n * @param {{from: string, to: string, convert: function}} conversion\n * @returns {void}\n * @throws {TypeError|SyntaxError|Error}\n */\n typed.removeConversion = function (conversion) {\n _validateConversion(conversion);\n const to = findType(conversion.to);\n const existingConversion = findInArray(to.conversionsTo, c => c.from === conversion.from);\n if (!existingConversion) {\n throw new Error('Attempt to remove nonexistent conversion from ' + conversion.from + ' to ' + conversion.to);\n }\n if (existingConversion.convert !== conversion.convert) {\n throw new Error('Conversion to remove does not match existing conversion');\n }\n const index = to.conversionsTo.indexOf(existingConversion);\n to.conversionsTo.splice(index, 1);\n };\n\n /**\n * Produce the specific signature that a typed function\n * will execute on the given arguments. Here, a \"signature\" is an\n * object with properties 'params', 'test', 'fn', and 'implementation'.\n * This last property is a function that converts params as necessary\n * and then calls 'fn'. Returns null if there is no matching signature.\n * @param {typed-function} tf\n * @param {any[]} argList\n * @returns {{params: string, test: function, fn: function, implementation: function}}\n */\n typed.resolve = function (tf, argList) {\n if (!isTypedFunction(tf)) {\n throw new TypeError(NOT_TYPED_FUNCTION);\n }\n const sigs = tf._typedFunctionData.signatures;\n for (let i = 0; i < sigs.length; ++i) {\n if (sigs[i].test(argList)) {\n return sigs[i];\n }\n }\n return null;\n };\n return typed;\n}\nexport default create();\n//# sourceMappingURL=typed-function.mjs.map", "/**\n * @license Complex.js v2.1.1 12/05/2020\n *\n * Copyright (c) 2020, Robert Eisele (robert@xarg.org)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n **/\n\n/**\n *\n * This class allows the manipulation of complex numbers.\n * You can pass a complex number in different formats. Either as object, double, string or two integer parameters.\n *\n * Object form\n * { re: , im: }\n * { arg: , abs: }\n * { phi: , r: }\n *\n * Array / Vector form\n * [ real, imaginary ]\n *\n * Double form\n * 99.3 - Single double value\n *\n * String form\n * '23.1337' - Simple real number\n * '15+3i' - a simple complex number\n * '3-i' - a simple complex number\n *\n * Example:\n *\n * var c = new Complex('99.3+8i');\n * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2);\n *\n */\n\n(function(root) {\n\n 'use strict';\n\n var cosh = Math.cosh || function(x) {\n return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5;\n };\n\n var sinh = Math.sinh || function(x) {\n return Math.abs(x) < 1e-9 ? x : (Math.exp(x) - Math.exp(-x)) * 0.5;\n };\n\n /**\n * Calculates cos(x) - 1 using Taylor series if x is small (-\u00BC\u03C0 \u2264 x \u2264 \u00BC\u03C0).\n *\n * @param {number} x\n * @returns {number} cos(x) - 1\n */\n var cosm1 = function(x) {\n\n var b = Math.PI / 4;\n if (-b > x || x > b) {\n return Math.cos(x) - 1.0;\n }\n\n /* Calculate horner form of polynomial of taylor series in Q\n var fac = 1, alt = 1, pol = {};\n for (var i = 0; i <= 16; i++) {\n fac*= i || 1;\n if (i % 2 == 0) {\n pol[i] = new Fraction(1, alt * fac);\n alt = -alt;\n }\n }\n console.log(new Polynomial(pol).toHorner()); // (((((((1/20922789888000x^2-1/87178291200)x^2+1/479001600)x^2-1/3628800)x^2+1/40320)x^2-1/720)x^2+1/24)x^2-1/2)x^2+1\n */\n\n var xx = x * x;\n return xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx * (\n xx / 20922789888000\n - 1 / 87178291200)\n + 1 / 479001600)\n - 1 / 3628800)\n + 1 / 40320)\n - 1 / 720)\n + 1 / 24)\n - 1 / 2);\n };\n\n var hypot = function(x, y) {\n\n var a = Math.abs(x);\n var b = Math.abs(y);\n\n if (a < 3000 && b < 3000) {\n return Math.sqrt(a * a + b * b);\n }\n\n if (a < b) {\n a = b;\n b = x / y;\n } else {\n b = y / x;\n }\n return a * Math.sqrt(1 + b * b);\n };\n\n var parser_exit = function() {\n throw SyntaxError('Invalid Param');\n };\n\n /**\n * Calculates log(sqrt(a^2+b^2)) in a way to avoid overflows\n *\n * @param {number} a\n * @param {number} b\n * @returns {number}\n */\n function logHypot(a, b) {\n\n var _a = Math.abs(a);\n var _b = Math.abs(b);\n\n if (a === 0) {\n return Math.log(_b);\n }\n\n if (b === 0) {\n return Math.log(_a);\n }\n\n if (_a < 3000 && _b < 3000) {\n return Math.log(a * a + b * b) * 0.5;\n }\n\n /* I got 4 ideas to compute this property without overflow:\n *\n * Testing 1000000 times with random samples for a,b \u2208 [1, 1000000000] against a big decimal library to get an error estimate\n *\n * 1. Only eliminate the square root: (OVERALL ERROR: 3.9122483030951116e-11)\n\n Math.log(a * a + b * b) / 2\n\n *\n *\n * 2. Try to use the non-overflowing pythagoras: (OVERALL ERROR: 8.889760039210159e-10)\n\n var fn = function(a, b) {\n a = Math.abs(a);\n b = Math.abs(b);\n var t = Math.min(a, b);\n a = Math.max(a, b);\n t = t / a;\n\n return Math.log(a) + Math.log(1 + t * t) / 2;\n };\n\n * 3. Abuse the identity cos(atan(y/x) = x / sqrt(x^2+y^2): (OVERALL ERROR: 3.4780178737037204e-10)\n\n Math.log(a / Math.cos(Math.atan2(b, a)))\n\n * 4. Use 3. and apply log rules: (OVERALL ERROR: 1.2014087502620896e-9)\n\n Math.log(a) - Math.log(Math.cos(Math.atan2(b, a)))\n\n */\n\n a = a / 2;\n b = b / 2;\n\n return 0.5 * Math.log(a * a + b * b) + Math.LN2;\n }\n\n var parse = function(a, b) {\n\n var z = { 're': 0, 'im': 0 };\n\n if (a === undefined || a === null) {\n z['re'] =\n z['im'] = 0;\n } else if (b !== undefined) {\n z['re'] = a;\n z['im'] = b;\n } else\n switch (typeof a) {\n\n case 'object':\n\n if ('im' in a && 're' in a) {\n z['re'] = a['re'];\n z['im'] = a['im'];\n } else if ('abs' in a && 'arg' in a) {\n if (!Number.isFinite(a['abs']) && Number.isFinite(a['arg'])) {\n return Complex['INFINITY'];\n }\n z['re'] = a['abs'] * Math.cos(a['arg']);\n z['im'] = a['abs'] * Math.sin(a['arg']);\n } else if ('r' in a && 'phi' in a) {\n if (!Number.isFinite(a['r']) && Number.isFinite(a['phi'])) {\n return Complex['INFINITY'];\n }\n z['re'] = a['r'] * Math.cos(a['phi']);\n z['im'] = a['r'] * Math.sin(a['phi']);\n } else if (a.length === 2) { // Quick array check\n z['re'] = a[0];\n z['im'] = a[1];\n } else {\n parser_exit();\n }\n break;\n\n case 'string':\n\n z['im'] = /* void */\n z['re'] = 0;\n\n var tokens = a.match(/\\d+\\.?\\d*e[+-]?\\d+|\\d+\\.?\\d*|\\.\\d+|./g);\n var plus = 1;\n var minus = 0;\n\n if (tokens === null) {\n parser_exit();\n }\n\n for (var i = 0; i < tokens.length; i++) {\n\n var c = tokens[i];\n\n if (c === ' ' || c === '\\t' || c === '\\n') {\n /* void */\n } else if (c === '+') {\n plus++;\n } else if (c === '-') {\n minus++;\n } else if (c === 'i' || c === 'I') {\n\n if (plus + minus === 0) {\n parser_exit();\n }\n\n if (tokens[i + 1] !== ' ' && !isNaN(tokens[i + 1])) {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + tokens[i + 1]);\n i++;\n } else {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + '1');\n }\n plus = minus = 0;\n\n } else {\n\n if (plus + minus === 0 || isNaN(c)) {\n parser_exit();\n }\n\n if (tokens[i + 1] === 'i' || tokens[i + 1] === 'I') {\n z['im'] += parseFloat((minus % 2 ? '-' : '') + c);\n i++;\n } else {\n z['re'] += parseFloat((minus % 2 ? '-' : '') + c);\n }\n plus = minus = 0;\n }\n }\n\n // Still something on the stack\n if (plus + minus > 0) {\n parser_exit();\n }\n break;\n\n case 'number':\n z['im'] = 0;\n z['re'] = a;\n break;\n\n default:\n parser_exit();\n }\n\n if (isNaN(z['re']) || isNaN(z['im'])) {\n // If a calculation is NaN, we treat it as NaN and don't throw\n //parser_exit();\n }\n\n return z;\n };\n\n /**\n * @constructor\n * @returns {Complex}\n */\n function Complex(a, b) {\n\n if (!(this instanceof Complex)) {\n return new Complex(a, b);\n }\n\n var z = parse(a, b);\n\n this['re'] = z['re'];\n this['im'] = z['im'];\n }\n\n Complex.prototype = {\n\n 're': 0,\n 'im': 0,\n\n /**\n * Calculates the sign of a complex number, which is a normalized complex\n *\n * @returns {Complex}\n */\n 'sign': function() {\n\n var abs = this['abs']();\n\n return new Complex(\n this['re'] / abs,\n this['im'] / abs);\n },\n\n /**\n * Adds two complex numbers\n *\n * @returns {Complex}\n */\n 'add': function(a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity + Infinity = NaN\n if (this['isInfinite']() && z['isInfinite']()) {\n return Complex['NAN'];\n }\n\n // Infinity + z = Infinity { where z != Infinity }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n return new Complex(\n this['re'] + z['re'],\n this['im'] + z['im']);\n },\n\n /**\n * Subtracts two complex numbers\n *\n * @returns {Complex}\n */\n 'sub': function(a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity - Infinity = NaN\n if (this['isInfinite']() && z['isInfinite']()) {\n return Complex['NAN'];\n }\n\n // Infinity - z = Infinity { where z != Infinity }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n return new Complex(\n this['re'] - z['re'],\n this['im'] - z['im']);\n },\n\n /**\n * Multiplies two complex numbers\n *\n * @returns {Complex}\n */\n 'mul': function(a, b) {\n\n var z = new Complex(a, b);\n\n // Infinity * 0 = NaN\n if ((this['isInfinite']() && z['isZero']()) || (this['isZero']() && z['isInfinite']())) {\n return Complex['NAN'];\n }\n\n // Infinity * z = Infinity { where z != 0 }\n if (this['isInfinite']() || z['isInfinite']()) {\n return Complex['INFINITY'];\n }\n\n // Short circuit for real values\n if (z['im'] === 0 && this['im'] === 0) {\n return new Complex(this['re'] * z['re'], 0);\n }\n\n return new Complex(\n this['re'] * z['re'] - this['im'] * z['im'],\n this['re'] * z['im'] + this['im'] * z['re']);\n },\n\n /**\n * Divides two complex numbers\n *\n * @returns {Complex}\n */\n 'div': function(a, b) {\n\n var z = new Complex(a, b);\n\n // 0 / 0 = NaN and Infinity / Infinity = NaN\n if ((this['isZero']() && z['isZero']()) || (this['isInfinite']() && z['isInfinite']())) {\n return Complex['NAN'];\n }\n\n // Infinity / 0 = Infinity\n if (this['isInfinite']() || z['isZero']()) {\n return Complex['INFINITY'];\n }\n\n // 0 / Infinity = 0\n if (this['isZero']() || z['isInfinite']()) {\n return Complex['ZERO'];\n }\n\n a = this['re'];\n b = this['im'];\n\n var c = z['re'];\n var d = z['im'];\n var t, x;\n\n if (0 === d) {\n // Divisor is real\n return new Complex(a / c, b / c);\n }\n\n if (Math.abs(c) < Math.abs(d)) {\n\n x = c / d;\n t = c * x + d;\n\n return new Complex(\n (a * x + b) / t,\n (b * x - a) / t);\n\n } else {\n\n x = d / c;\n t = d * x + c;\n\n return new Complex(\n (a + b * x) / t,\n (b - a * x) / t);\n }\n },\n\n /**\n * Calculate the power of two complex numbers\n *\n * @returns {Complex}\n */\n 'pow': function(a, b) {\n\n var z = new Complex(a, b);\n\n a = this['re'];\n b = this['im'];\n\n if (z['isZero']()) {\n return Complex['ONE'];\n }\n\n // If the exponent is real\n if (z['im'] === 0) {\n\n if (b === 0 && a > 0) {\n\n return new Complex(Math.pow(a, z['re']), 0);\n\n } else if (a === 0) { // If base is fully imaginary\n\n switch ((z['re'] % 4 + 4) % 4) {\n case 0:\n return new Complex(Math.pow(b, z['re']), 0);\n case 1:\n return new Complex(0, Math.pow(b, z['re']));\n case 2:\n return new Complex(-Math.pow(b, z['re']), 0);\n case 3:\n return new Complex(0, -Math.pow(b, z['re']));\n }\n }\n }\n\n /* I couldn't find a good formula, so here is a derivation and optimization\n *\n * z_1^z_2 = (a + bi)^(c + di)\n * = exp((c + di) * log(a + bi)\n * = pow(a^2 + b^2, (c + di) / 2) * exp(i(c + di)atan2(b, a))\n * =>...\n * Re = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * cos(d * log(a^2 + b^2) / 2 + c * atan2(b, a))\n * Im = (pow(a^2 + b^2, c / 2) * exp(-d * atan2(b, a))) * sin(d * log(a^2 + b^2) / 2 + c * atan2(b, a))\n *\n * =>...\n * Re = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * cos(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a))\n * Im = exp(c * log(sqrt(a^2 + b^2)) - d * atan2(b, a)) * sin(d * log(sqrt(a^2 + b^2)) + c * atan2(b, a))\n *\n * =>\n * Re = exp(c * logsq2 - d * arg(z_1)) * cos(d * logsq2 + c * arg(z_1))\n * Im = exp(c * logsq2 - d * arg(z_1)) * sin(d * logsq2 + c * arg(z_1))\n *\n */\n\n if (a === 0 && b === 0 && z['re'] > 0 && z['im'] >= 0) {\n return Complex['ZERO'];\n }\n\n var arg = Math.atan2(b, a);\n var loh = logHypot(a, b);\n\n a = Math.exp(z['re'] * loh - z['im'] * arg);\n b = z['im'] * loh + z['re'] * arg;\n return new Complex(\n a * Math.cos(b),\n a * Math.sin(b));\n },\n\n /**\n * Calculate the complex square root\n *\n * @returns {Complex}\n */\n 'sqrt': function() {\n\n var a = this['re'];\n var b = this['im'];\n var r = this['abs']();\n\n var re, im;\n\n if (a >= 0) {\n\n if (b === 0) {\n return new Complex(Math.sqrt(a), 0);\n }\n\n re = 0.5 * Math.sqrt(2.0 * (r + a));\n } else {\n re = Math.abs(b) / Math.sqrt(2 * (r - a));\n }\n\n if (a <= 0) {\n im = 0.5 * Math.sqrt(2.0 * (r - a));\n } else {\n im = Math.abs(b) / Math.sqrt(2 * (r + a));\n }\n\n return new Complex(re, b < 0 ? -im : im);\n },\n\n /**\n * Calculate the complex exponent\n *\n * @returns {Complex}\n */\n 'exp': function() {\n\n var tmp = Math.exp(this['re']);\n\n if (this['im'] === 0) {\n //return new Complex(tmp, 0);\n }\n return new Complex(\n tmp * Math.cos(this['im']),\n tmp * Math.sin(this['im']));\n },\n\n /**\n * Calculate the complex exponent and subtracts one.\n *\n * This may be more accurate than `Complex(x).exp().sub(1)` if\n * `x` is small.\n *\n * @returns {Complex}\n */\n 'expm1': function() {\n\n /**\n * exp(a + i*b) - 1\n = exp(a) * (cos(b) + j*sin(b)) - 1\n = expm1(a)*cos(b) + cosm1(b) + j*exp(a)*sin(b)\n */\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.expm1(a) * Math.cos(b) + cosm1(b),\n Math.exp(a) * Math.sin(b));\n },\n\n /**\n * Calculate the natural log\n *\n * @returns {Complex}\n */\n 'log': function() {\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0 && a > 0) {\n //return new Complex(Math.log(a), 0);\n }\n\n return new Complex(\n logHypot(a, b),\n Math.atan2(b, a));\n },\n\n /**\n * Calculate the magnitude of the complex number\n *\n * @returns {number}\n */\n 'abs': function() {\n\n return hypot(this['re'], this['im']);\n },\n\n /**\n * Calculate the angle of the complex number\n *\n * @returns {number}\n */\n 'arg': function() {\n\n return Math.atan2(this['im'], this['re']);\n },\n\n /**\n * Calculate the sine of the complex number\n *\n * @returns {Complex}\n */\n 'sin': function() {\n\n // sin(z) = ( e^iz - e^-iz ) / 2i \n // = sin(a)cosh(b) + i cos(a)sinh(b)\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.sin(a) * cosh(b),\n Math.cos(a) * sinh(b));\n },\n\n /**\n * Calculate the cosine\n *\n * @returns {Complex}\n */\n 'cos': function() {\n\n // cos(z) = ( e^iz + e^-iz ) / 2 \n // = cos(a)cosh(b) - i sin(a)sinh(b)\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n Math.cos(a) * cosh(b),\n -Math.sin(a) * sinh(b));\n },\n\n /**\n * Calculate the tangent\n *\n * @returns {Complex}\n */\n 'tan': function() {\n\n // tan(z) = sin(z) / cos(z) \n // = ( e^iz - e^-iz ) / ( i( e^iz + e^-iz ) )\n // = ( e^2iz - 1 ) / i( e^2iz + 1 )\n // = ( sin(2a) + i sinh(2b) ) / ( cos(2a) + cosh(2b) )\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = Math.cos(a) + cosh(b);\n\n return new Complex(\n Math.sin(a) / d,\n sinh(b) / d);\n },\n\n /**\n * Calculate the cotangent\n *\n * @returns {Complex}\n */\n 'cot': function() {\n\n // cot(c) = i(e^(ci) + e^(-ci)) / (e^(ci) - e^(-ci))\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = Math.cos(a) - cosh(b);\n\n return new Complex(\n -Math.sin(a) / d,\n sinh(b) / d);\n },\n\n /**\n * Calculate the secant\n *\n * @returns {Complex}\n */\n 'sec': function() {\n\n // sec(c) = 2 / (e^(ci) + e^(-ci))\n\n var a = this['re'];\n var b = this['im'];\n var d = 0.5 * cosh(2 * b) + 0.5 * Math.cos(2 * a);\n\n return new Complex(\n Math.cos(a) * cosh(b) / d,\n Math.sin(a) * sinh(b) / d);\n },\n\n /**\n * Calculate the cosecans\n *\n * @returns {Complex}\n */\n 'csc': function() {\n\n // csc(c) = 2i / (e^(ci) - e^(-ci))\n\n var a = this['re'];\n var b = this['im'];\n var d = 0.5 * cosh(2 * b) - 0.5 * Math.cos(2 * a);\n\n return new Complex(\n Math.sin(a) * cosh(b) / d,\n -Math.cos(a) * sinh(b) / d);\n },\n\n /**\n * Calculate the complex arcus sinus\n *\n * @returns {Complex}\n */\n 'asin': function() {\n\n // asin(c) = -i * log(ci + sqrt(1 - c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n var t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n var t2 = new Complex(\n t1['re'] - b,\n t1['im'] + a)['log']();\n\n return new Complex(t2['im'], -t2['re']);\n },\n\n /**\n * Calculate the complex arcus cosinus\n *\n * @returns {Complex}\n */\n 'acos': function() {\n\n // acos(c) = i * log(c - i * sqrt(1 - c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n var t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n var t2 = new Complex(\n t1['re'] - b,\n t1['im'] + a)['log']();\n\n return new Complex(Math.PI / 2 - t2['im'], t2['re']);\n },\n\n /**\n * Calculate the complex arcus tangent\n *\n * @returns {Complex}\n */\n 'atan': function() {\n\n // atan(c) = i / 2 log((i + x) / (i - x))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0) {\n\n if (b === 1) {\n return new Complex(0, Infinity);\n }\n\n if (b === -1) {\n return new Complex(0, -Infinity);\n }\n }\n\n var d = a * a + (1.0 - b) * (1.0 - b);\n\n var t1 = new Complex(\n (1 - b * b - a * a) / d,\n -2 * a / d).log();\n\n return new Complex(-0.5 * t1['im'], 0.5 * t1['re']);\n },\n\n /**\n * Calculate the complex arcus cotangent\n *\n * @returns {Complex}\n */\n 'acot': function() {\n\n // acot(c) = i / 2 log((c - i) / (c + i))\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0) {\n return new Complex(Math.atan2(1, a), 0);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).atan()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).atan();\n },\n\n /**\n * Calculate the complex arcus secant\n *\n * @returns {Complex}\n */\n 'asec': function() {\n\n // asec(c) = -i * log(1 / c + sqrt(1 - i / c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Infinity);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).acos()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).acos();\n },\n\n /**\n * Calculate the complex arcus cosecans\n *\n * @returns {Complex}\n */\n 'acsc': function() {\n\n // acsc(c) = -i * log(i / c + sqrt(1 - 1 / c^2))\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(Math.PI / 2, Infinity);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).asin()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).asin();\n },\n\n /**\n * Calculate the complex sinh\n *\n * @returns {Complex}\n */\n 'sinh': function() {\n\n // sinh(c) = (e^c - e^-c) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n sinh(a) * Math.cos(b),\n cosh(a) * Math.sin(b));\n },\n\n /**\n * Calculate the complex cosh\n *\n * @returns {Complex}\n */\n 'cosh': function() {\n\n // cosh(c) = (e^c + e^-c) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n return new Complex(\n cosh(a) * Math.cos(b),\n sinh(a) * Math.sin(b));\n },\n\n /**\n * Calculate the complex tanh\n *\n * @returns {Complex}\n */\n 'tanh': function() {\n\n // tanh(c) = (e^c - e^-c) / (e^c + e^-c)\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = cosh(a) + Math.cos(b);\n\n return new Complex(\n sinh(a) / d,\n Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex coth\n *\n * @returns {Complex}\n */\n 'coth': function() {\n\n // coth(c) = (e^c + e^-c) / (e^c - e^-c)\n\n var a = 2 * this['re'];\n var b = 2 * this['im'];\n var d = cosh(a) - Math.cos(b);\n\n return new Complex(\n sinh(a) / d,\n -Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex coth\n *\n * @returns {Complex}\n */\n 'csch': function() {\n\n // csch(c) = 2 / (e^c - e^-c)\n\n var a = this['re'];\n var b = this['im'];\n var d = Math.cos(2 * b) - cosh(2 * a);\n\n return new Complex(\n -2 * sinh(a) * Math.cos(b) / d,\n 2 * cosh(a) * Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex sech\n *\n * @returns {Complex}\n */\n 'sech': function() {\n\n // sech(c) = 2 / (e^c + e^-c)\n\n var a = this['re'];\n var b = this['im'];\n var d = Math.cos(2 * b) + cosh(2 * a);\n\n return new Complex(\n 2 * cosh(a) * Math.cos(b) / d,\n -2 * sinh(a) * Math.sin(b) / d);\n },\n\n /**\n * Calculate the complex asinh\n *\n * @returns {Complex}\n */\n 'asinh': function() {\n\n // asinh(c) = log(c + sqrt(c^2 + 1))\n\n var tmp = this['im'];\n this['im'] = -this['re'];\n this['re'] = tmp;\n var res = this['asin']();\n\n this['re'] = -this['im'];\n this['im'] = tmp;\n tmp = res['re'];\n\n res['re'] = -res['im'];\n res['im'] = tmp;\n return res;\n },\n\n /**\n * Calculate the complex acosh\n *\n * @returns {Complex}\n */\n 'acosh': function() {\n\n // acosh(c) = log(c + sqrt(c^2 - 1))\n\n var res = this['acos']();\n if (res['im'] <= 0) {\n var tmp = res['re'];\n res['re'] = -res['im'];\n res['im'] = tmp;\n } else {\n var tmp = res['im'];\n res['im'] = -res['re'];\n res['re'] = tmp;\n }\n return res;\n },\n\n /**\n * Calculate the complex atanh\n *\n * @returns {Complex}\n */\n 'atanh': function() {\n\n // atanh(c) = log((1+c) / (1-c)) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n var noIM = a > 1 && b === 0;\n var oneMinus = 1 - a;\n var onePlus = 1 + a;\n var d = oneMinus * oneMinus + b * b;\n\n var x = (d !== 0)\n ? new Complex(\n (onePlus * oneMinus - b * b) / d,\n (b * oneMinus + onePlus * b) / d)\n : new Complex(\n (a !== -1) ? (a / 0) : 0,\n (b !== 0) ? (b / 0) : 0);\n\n var temp = x['re'];\n x['re'] = logHypot(x['re'], x['im']) / 2;\n x['im'] = Math.atan2(x['im'], temp) / 2;\n if (noIM) {\n x['im'] = -x['im'];\n }\n return x;\n },\n\n /**\n * Calculate the complex acoth\n *\n * @returns {Complex}\n */\n 'acoth': function() {\n\n // acoth(c) = log((c+1) / (c-1)) / 2\n\n var a = this['re'];\n var b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Math.PI / 2);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).atanh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).atanh();\n },\n\n /**\n * Calculate the complex acsch\n *\n * @returns {Complex}\n */\n 'acsch': function() {\n\n // acsch(c) = log((1+sqrt(1+c^2))/c)\n\n var a = this['re'];\n var b = this['im'];\n\n if (b === 0) {\n\n return new Complex(\n (a !== 0)\n ? Math.log(a + Math.sqrt(a * a + 1))\n : Infinity, 0);\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).asinh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).asinh();\n },\n\n /**\n * Calculate the complex asech\n *\n * @returns {Complex}\n */\n 'asech': function() {\n\n // asech(c) = log((1+sqrt(1-c^2))/c)\n\n var a = this['re'];\n var b = this['im'];\n\n if (this['isZero']()) {\n return Complex['INFINITY'];\n }\n\n var d = a * a + b * b;\n return (d !== 0)\n ? new Complex(\n a / d,\n -b / d).acosh()\n : new Complex(\n (a !== 0) ? a / 0 : 0,\n (b !== 0) ? -b / 0 : 0).acosh();\n },\n\n /**\n * Calculate the complex inverse 1/z\n *\n * @returns {Complex}\n */\n 'inverse': function() {\n\n // 1 / 0 = Infinity and 1 / Infinity = 0\n if (this['isZero']()) {\n return Complex['INFINITY'];\n }\n\n if (this['isInfinite']()) {\n return Complex['ZERO'];\n }\n\n var a = this['re'];\n var b = this['im'];\n\n var d = a * a + b * b;\n\n return new Complex(a / d, -b / d);\n },\n\n /**\n * Returns the complex conjugate\n *\n * @returns {Complex}\n */\n 'conjugate': function() {\n\n return new Complex(this['re'], -this['im']);\n },\n\n /**\n * Gets the negated complex number\n *\n * @returns {Complex}\n */\n 'neg': function() {\n\n return new Complex(-this['re'], -this['im']);\n },\n\n /**\n * Ceils the actual complex number\n *\n * @returns {Complex}\n */\n 'ceil': function(places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.ceil(this['re'] * places) / places,\n Math.ceil(this['im'] * places) / places);\n },\n\n /**\n * Floors the actual complex number\n *\n * @returns {Complex}\n */\n 'floor': function(places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.floor(this['re'] * places) / places,\n Math.floor(this['im'] * places) / places);\n },\n\n /**\n * Ceils the actual complex number\n *\n * @returns {Complex}\n */\n 'round': function(places) {\n\n places = Math.pow(10, places || 0);\n\n return new Complex(\n Math.round(this['re'] * places) / places,\n Math.round(this['im'] * places) / places);\n },\n\n /**\n * Compares two complex numbers\n *\n * **Note:** new Complex(Infinity).equals(Infinity) === false\n *\n * @returns {boolean}\n */\n 'equals': function(a, b) {\n\n var z = new Complex(a, b);\n\n return Math.abs(z['re'] - this['re']) <= Complex['EPSILON'] &&\n Math.abs(z['im'] - this['im']) <= Complex['EPSILON'];\n },\n\n /**\n * Clones the actual object\n *\n * @returns {Complex}\n */\n 'clone': function() {\n\n return new Complex(this['re'], this['im']);\n },\n\n /**\n * Gets a string of the actual complex number\n *\n * @returns {string}\n */\n 'toString': function() {\n\n var a = this['re'];\n var b = this['im'];\n var ret = \"\";\n\n if (this['isNaN']()) {\n return 'NaN';\n }\n\n if (this['isInfinite']()) {\n return 'Infinity';\n }\n\n if (Math.abs(a) < Complex['EPSILON']) {\n a = 0;\n }\n\n if (Math.abs(b) < Complex['EPSILON']) {\n b = 0;\n }\n\n // If is real number\n if (b === 0) {\n return ret + a;\n }\n\n if (a !== 0) {\n ret += a;\n ret += \" \";\n if (b < 0) {\n b = -b;\n ret += \"-\";\n } else {\n ret += \"+\";\n }\n ret += \" \";\n } else if (b < 0) {\n b = -b;\n ret += \"-\";\n }\n\n if (1 !== b) { // b is the absolute imaginary part\n ret += b;\n }\n return ret + \"i\";\n },\n\n /**\n * Returns the actual number as a vector\n *\n * @returns {Array}\n */\n 'toVector': function() {\n\n return [this['re'], this['im']];\n },\n\n /**\n * Returns the actual real value of the current object\n *\n * @returns {number|null}\n */\n 'valueOf': function() {\n\n if (this['im'] === 0) {\n return this['re'];\n }\n return null;\n },\n\n /**\n * Determines whether a complex number is not on the Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isNaN': function() {\n return isNaN(this['re']) || isNaN(this['im']);\n },\n\n /**\n * Determines whether or not a complex number is at the zero pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isZero': function() {\n return this['im'] === 0 && this['re'] === 0;\n },\n\n /**\n * Determines whether a complex number is not at the infinity pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isFinite': function() {\n return isFinite(this['re']) && isFinite(this['im']);\n },\n\n /**\n * Determines whether or not a complex number is at the infinity pole of the\n * Riemann sphere.\n *\n * @returns {boolean}\n */\n 'isInfinite': function() {\n return !(this['isNaN']() || this['isFinite']());\n }\n };\n\n Complex['ZERO'] = new Complex(0, 0);\n Complex['ONE'] = new Complex(1, 0);\n Complex['I'] = new Complex(0, 1);\n Complex['PI'] = new Complex(Math.PI, 0);\n Complex['E'] = new Complex(Math.E, 0);\n Complex['INFINITY'] = new Complex(Infinity, Infinity);\n Complex['NAN'] = new Complex(NaN, NaN);\n Complex['EPSILON'] = 1e-15;\n\n if (typeof define === 'function' && define['amd']) {\n define([], function() {\n return Complex;\n });\n } else if (typeof exports === 'object') {\n Object.defineProperty(Complex, \"__esModule\", { 'value': true });\n Complex['default'] = Complex;\n Complex['Complex'] = Complex;\n module['exports'] = Complex;\n } else {\n root['Complex'] = Complex;\n }\n\n})(this);\n", "/*\r\n * Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license\r\n * Author: Jim Palmer (based on chunking idea from Dave Koelle)\r\n */\r\n/*jshint unused:false */\r\nmodule.exports = function naturalSort (a, b) {\r\n\t\"use strict\";\r\n\tvar re = /(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,\r\n\t\tsre = /(^[ ]*|[ ]*$)/g,\r\n\t\tdre = /(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,\r\n\t\thre = /^0x[0-9a-f]+$/i,\r\n\t\tore = /^0/,\r\n\t\ti = function(s) { return naturalSort.insensitive && ('' + s).toLowerCase() || '' + s; },\r\n\t\t// convert all to strings strip whitespace\r\n\t\tx = i(a).replace(sre, '') || '',\r\n\t\ty = i(b).replace(sre, '') || '',\r\n\t\t// chunk/tokenize\r\n\t\txN = x.replace(re, '\\0$1\\0').replace(/\\0$/,'').replace(/^\\0/,'').split('\\0'),\r\n\t\tyN = y.replace(re, '\\0$1\\0').replace(/\\0$/,'').replace(/^\\0/,'').split('\\0'),\r\n\t\t// numeric, hex or date detection\r\n\t\txD = parseInt(x.match(hre), 16) || (xN.length !== 1 && x.match(dre) && Date.parse(x)),\r\n\t\tyD = parseInt(y.match(hre), 16) || xD && y.match(dre) && Date.parse(y) || null,\r\n\t\toFxNcL, oFyNcL;\r\n\t// first try and sort Hex codes or Dates\r\n\tif (yD) {\r\n\t\tif ( xD < yD ) { return -1; }\r\n\t\telse if ( xD > yD ) { return 1; }\r\n\t}\r\n\t// natural sorting through split numeric strings and default strings\r\n\tfor(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {\r\n\t\t// find floats not starting with '0', string or 0 if not defined (Clint Priest)\r\n\t\toFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;\r\n\t\toFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;\r\n\t\t// handle numeric vs string comparison - number < string - (Kyle Adams)\r\n\t\tif (isNaN(oFxNcL) !== isNaN(oFyNcL)) { return (isNaN(oFxNcL)) ? 1 : -1; }\r\n\t\t// rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'\r\n\t\telse if (typeof oFxNcL !== typeof oFyNcL) {\r\n\t\t\toFxNcL += '';\r\n\t\t\toFyNcL += '';\r\n\t\t}\r\n\t\tif (oFxNcL < oFyNcL) { return -1; }\r\n\t\tif (oFxNcL > oFyNcL) { return 1; }\r\n\t}\r\n\treturn 0;\r\n};\r\n", "\"use strict\";\n\n// Map the characters to escape to their escaped values. The list is derived\n// from http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar defaultEscapes = {\n \"{\": \"\\\\{\",\n \"}\": \"\\\\}\",\n \"\\\\\": \"\\\\textbackslash{}\",\n \"#\": \"\\\\#\",\n $: \"\\\\$\",\n \"%\": \"\\\\%\",\n \"&\": \"\\\\&\",\n \"^\": \"\\\\textasciicircum{}\",\n _: \"\\\\_\",\n \"~\": \"\\\\textasciitilde{}\"\n};\nvar formatEscapes = {\n \"\\u2013\": \"\\\\--\",\n \"\\u2014\": \"\\\\---\",\n \" \": \"~\",\n \"\\t\": \"\\\\qquad{}\",\n \"\\r\\n\": \"\\\\newline{}\",\n \"\\n\": \"\\\\newline{}\"\n};\n\nvar defaultEscapeMapFn = function defaultEscapeMapFn(defaultEscapes, formatEscapes) {\n return _extends({}, defaultEscapes, formatEscapes);\n};\n\n/**\n * Escape a string to be used in LaTeX documents.\n * @param {string} str the string to be escaped.\n * @param {boolean} params.preserveFormatting whether formatting escapes should\n * be performed (default: false).\n * @param {function} params.escapeMapFn the function to modify the escape maps.\n * @return {string} the escaped string, ready to be used in LaTeX.\n */\nmodule.exports = function (str) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$preserveFormatti = _ref.preserveFormatting,\n preserveFormatting = _ref$preserveFormatti === undefined ? false : _ref$preserveFormatti,\n _ref$escapeMapFn = _ref.escapeMapFn,\n escapeMapFn = _ref$escapeMapFn === undefined ? defaultEscapeMapFn : _ref$escapeMapFn;\n\n var runningStr = String(str);\n var result = \"\";\n\n var escapes = escapeMapFn(_extends({}, defaultEscapes), preserveFormatting ? _extends({}, formatEscapes) : {});\n var escapeKeys = Object.keys(escapes); // as it is reused later on\n\n // Algorithm: Go through the string character by character, if it matches\n // with one of the special characters then we'll replace it with the escaped\n // version.\n\n var _loop = function _loop() {\n var specialCharFound = false;\n escapeKeys.forEach(function (key, index) {\n if (specialCharFound) {\n return;\n }\n if (runningStr.length >= key.length && runningStr.slice(0, key.length) === key) {\n result += escapes[escapeKeys[index]];\n runningStr = runningStr.slice(key.length, runningStr.length);\n specialCharFound = true;\n }\n });\n if (!specialCharFound) {\n result += runningStr.slice(0, 1);\n runningStr = runningStr.slice(1, runningStr.length);\n }\n };\n\n while (runningStr) {\n _loop();\n }\n return result;\n};", "// A port of an algorithm by Johannes Baag\u00F8e , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baag\u00F8e \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = String(data);\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "// A Javascript implementaion of the \"xorshift7\" algorithm by\n// Fran\u00E7ois Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n", "// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n", "// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n", "export default {};\n", "/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (global, pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\n\nvar width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n} else {\n // When included as a plain script, set up Math.seedrandom global.\n math['seed' + rngname] = seedrandom;\n}\n\n\n// End anonymous scope, and pass initial values.\n})(\n // global: `self` in browsers (including strict mode and web workers),\n // otherwise `this` in Node and other environments\n (typeof self !== 'undefined') ? self : this,\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n", "// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baag\u00F8e.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by Fran\u00E7ois Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n", "function E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n", "(function (window, factory) {\n if (typeof exports === 'object') {\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n define(factory);\n } else {\n window.jStat = factory();\n }\n})(this, function () {\nvar jStat = (function(Math, undefined) {\n\n// For quick reference.\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\nvar toString = Object.prototype.toString;\n\n// Calculate correction for IEEE error\n// TODO: This calculation can be improved.\nfunction calcRdx(n, m) {\n var val = n > m ? n : m;\n return Math.pow(10,\n 17 - ~~(Math.log(((val > 0) ? val : -val)) * Math.LOG10E));\n}\n\n\nvar isArray = Array.isArray || function isArray(arg) {\n return toString.call(arg) === '[object Array]';\n};\n\n\nfunction isFunction(arg) {\n return toString.call(arg) === '[object Function]';\n}\n\n\nfunction isNumber(num) {\n return (typeof num === 'number') ? num - num === 0 : false;\n}\n\n\n// Converts the jStat matrix to vector.\nfunction toVector(arr) {\n return concat.apply([], arr);\n}\n\n\n// The one and only jStat constructor.\nfunction jStat() {\n return new jStat._init(arguments);\n}\n\n\n// TODO: Remove after all references in src files have been removed.\njStat.fn = jStat.prototype;\n\n\n// By separating the initializer from the constructor it's easier to handle\n// always returning a new instance whether \"new\" was used or not.\njStat._init = function _init(args) {\n // If first argument is an array, must be vector or matrix.\n if (isArray(args[0])) {\n // Check if matrix.\n if (isArray(args[0][0])) {\n // See if a mapping function was also passed.\n if (isFunction(args[1]))\n args[0] = jStat.map(args[0], args[1]);\n // Iterate over each is faster than this.push.apply(this, args[0].\n for (var i = 0; i < args[0].length; i++)\n this[i] = args[0][i];\n this.length = args[0].length;\n\n // Otherwise must be a vector.\n } else {\n this[0] = isFunction(args[1]) ? jStat.map(args[0], args[1]) : args[0];\n this.length = 1;\n }\n\n // If first argument is number, assume creation of sequence.\n } else if (isNumber(args[0])) {\n this[0] = jStat.seq.apply(null, args);\n this.length = 1;\n\n // Handle case when jStat object is passed to jStat.\n } else if (args[0] instanceof jStat) {\n // Duplicate the object and pass it back.\n return jStat(args[0].toArray());\n\n // Unexpected argument value, return empty jStat object.\n // TODO: This is strange behavior. Shouldn't this throw or some such to let\n // the user know they had bad arguments?\n } else {\n this[0] = [];\n this.length = 1;\n }\n\n return this;\n};\njStat._init.prototype = jStat.prototype;\njStat._init.constructor = jStat;\n\n\n// Utility functions.\n// TODO: for internal use only?\njStat.utils = {\n calcRdx: calcRdx,\n isArray: isArray,\n isFunction: isFunction,\n isNumber: isNumber,\n toVector: toVector\n};\n\n\njStat._random_fn = Math.random;\njStat.setRandom = function setRandom(fn) {\n if (typeof fn !== 'function')\n throw new TypeError('fn is not a function');\n jStat._random_fn = fn;\n};\n\n\n// Easily extend the jStat object.\n// TODO: is this seriously necessary?\njStat.extend = function extend(obj) {\n var i, j;\n\n if (arguments.length === 1) {\n for (j in obj)\n jStat[j] = obj[j];\n return this;\n }\n\n for (i = 1; i < arguments.length; i++) {\n for (j in arguments[i])\n obj[j] = arguments[i][j];\n }\n\n return obj;\n};\n\n\n// Returns the number of rows in the matrix.\njStat.rows = function rows(arr) {\n return arr.length || 1;\n};\n\n\n// Returns the number of columns in the matrix.\njStat.cols = function cols(arr) {\n return arr[0].length || 1;\n};\n\n\n// Returns the dimensions of the object { rows: i, cols: j }\njStat.dimensions = function dimensions(arr) {\n return {\n rows: jStat.rows(arr),\n cols: jStat.cols(arr)\n };\n};\n\n\n// Returns a specified row as a vector or return a sub matrix by pick some rows\njStat.row = function row(arr, index) {\n if (isArray(index)) {\n return index.map(function(i) {\n return jStat.row(arr, i);\n })\n }\n return arr[index];\n};\n\n\n// return row as array\n// rowa([[1,2],[3,4]],0) -> [1,2]\njStat.rowa = function rowa(arr, i) {\n return jStat.row(arr, i);\n};\n\n\n// Returns the specified column as a vector or return a sub matrix by pick some\n// columns\njStat.col = function col(arr, index) {\n if (isArray(index)) {\n var submat = jStat.arange(arr.length).map(function() {\n return new Array(index.length);\n });\n index.forEach(function(ind, i){\n jStat.arange(arr.length).forEach(function(j) {\n submat[j][i] = arr[j][ind];\n });\n });\n return submat;\n }\n var column = new Array(arr.length);\n for (var i = 0; i < arr.length; i++)\n column[i] = [arr[i][index]];\n return column;\n};\n\n\n// return column as array\n// cola([[1,2],[3,4]],0) -> [1,3]\njStat.cola = function cola(arr, i) {\n return jStat.col(arr, i).map(function(a){ return a[0] });\n};\n\n\n// Returns the diagonal of the matrix\njStat.diag = function diag(arr) {\n var nrow = jStat.rows(arr);\n var res = new Array(nrow);\n for (var row = 0; row < nrow; row++)\n res[row] = [arr[row][row]];\n return res;\n};\n\n\n// Returns the anti-diagonal of the matrix\njStat.antidiag = function antidiag(arr) {\n var nrow = jStat.rows(arr) - 1;\n var res = new Array(nrow);\n for (var i = 0; nrow >= 0; nrow--, i++)\n res[i] = [arr[i][nrow]];\n return res;\n};\n\n// Transpose a matrix or array.\njStat.transpose = function transpose(arr) {\n var obj = [];\n var objArr, rows, cols, j, i;\n\n // Make sure arr is in matrix format.\n if (!isArray(arr[0]))\n arr = [arr];\n\n rows = arr.length;\n cols = arr[0].length;\n\n for (i = 0; i < cols; i++) {\n objArr = new Array(rows);\n for (j = 0; j < rows; j++)\n objArr[j] = arr[j][i];\n obj.push(objArr);\n }\n\n // If obj is vector, return only single array.\n return obj.length === 1 ? obj[0] : obj;\n};\n\n\n// Map a function to an array or array of arrays.\n// \"toAlter\" is an internal variable.\njStat.map = function map(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n for (col = 0; col < ncol; col++)\n res[row][col] = func(arr[row][col], row, col);\n }\n\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Cumulatively combine the elements of an array or array of arrays using a function.\njStat.cumreduce = function cumreduce(arr, func, toAlter) {\n var row, nrow, ncol, res, col;\n\n if (!isArray(arr[0]))\n arr = [arr];\n\n nrow = arr.length;\n ncol = arr[0].length;\n res = toAlter ? arr : new Array(nrow);\n\n for (row = 0; row < nrow; row++) {\n // if the row doesn't exist, create it\n if (!res[row])\n res[row] = new Array(ncol);\n if (ncol > 0)\n res[row][0] = arr[row][0];\n for (col = 1; col < ncol; col++)\n res[row][col] = func(res[row][col-1], arr[row][col]);\n }\n return res.length === 1 ? res[0] : res;\n};\n\n\n// Destructively alter an array.\njStat.alter = function alter(arr, func) {\n return jStat.map(arr, func, true);\n};\n\n\n// Generate a rows x cols matrix according to the supplied function.\njStat.create = function create(rows, cols, func) {\n var res = new Array(rows);\n var i, j;\n\n if (isFunction(cols)) {\n func = cols;\n cols = rows;\n }\n\n for (i = 0; i < rows; i++) {\n res[i] = new Array(cols);\n for (j = 0; j < cols; j++)\n res[i][j] = func(i, j);\n }\n\n return res;\n};\n\n\nfunction retZero() { return 0; }\n\n\n// Generate a rows x cols matrix of zeros.\njStat.zeros = function zeros(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retZero);\n};\n\n\nfunction retOne() { return 1; }\n\n\n// Generate a rows x cols matrix of ones.\njStat.ones = function ones(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retOne);\n};\n\n\n// Generate a rows x cols matrix of uniformly random numbers.\njStat.rand = function rand(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, jStat._random_fn);\n};\n\n\nfunction retIdent(i, j) { return i === j ? 1 : 0; }\n\n\n// Generate an identity matrix of size row x cols.\njStat.identity = function identity(rows, cols) {\n if (!isNumber(cols))\n cols = rows;\n return jStat.create(rows, cols, retIdent);\n};\n\n\n// Tests whether a matrix is symmetric\njStat.symmetric = function symmetric(arr) {\n var size = arr.length;\n var row, col;\n\n if (arr.length !== arr[0].length)\n return false;\n\n for (row = 0; row < size; row++) {\n for (col = 0; col < size; col++)\n if (arr[col][row] !== arr[row][col])\n return false;\n }\n\n return true;\n};\n\n\n// Set all values to zero.\njStat.clear = function clear(arr) {\n return jStat.alter(arr, retZero);\n};\n\n\n// Generate sequence.\njStat.seq = function seq(min, max, length, func) {\n if (!isFunction(func))\n func = false;\n\n var arr = [];\n var hival = calcRdx(min, max);\n var step = (max * hival - min * hival) / ((length - 1) * hival);\n var current = min;\n var cnt;\n\n // Current is assigned using a technique to compensate for IEEE error.\n // TODO: Needs better implementation.\n for (cnt = 0;\n current <= max && cnt < length;\n cnt++, current = (min * hival + step * hival * cnt) / hival) {\n arr.push((func ? func(current, cnt) : current));\n }\n\n return arr;\n};\n\n\n// arange(5) -> [0,1,2,3,4]\n// arange(1,5) -> [1,2,3,4]\n// arange(5,1,-1) -> [5,4,3,2]\njStat.arange = function arange(start, end, step) {\n var rl = [];\n var i;\n step = step || 1;\n if (end === undefined) {\n end = start;\n start = 0;\n }\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(i);\n }\n } else {\n for (i = start; i > end; i += step) {\n rl.push(i);\n }\n }\n return rl;\n};\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// slice(A,{row:{end:2},col:{start:1}}) -> [[2,3],[5,6]]\n// slice(A,1,{start:1}) -> [5,6]\n// as numpy code A[:2,1:]\njStat.slice = (function(){\n function _slice(list, start, end, step) {\n // note it's not equal to range.map mode it's a bug\n var i;\n var rl = [];\n var length = list.length;\n if (start === undefined && end === undefined && step === undefined) {\n return jStat.copy(list);\n }\n\n start = start || 0;\n end = end || list.length;\n start = start >= 0 ? start : length + start;\n end = end >= 0 ? end : length + end;\n step = step || 1;\n if (start === end || step === 0) {\n return [];\n }\n if (start < end && step < 0) {\n return [];\n }\n if (start > end && step > 0) {\n return [];\n }\n if (step > 0) {\n for (i = start; i < end; i += step) {\n rl.push(list[i]);\n }\n } else {\n for (i = start; i > end;i += step) {\n rl.push(list[i]);\n }\n }\n return rl;\n }\n\n function slice(list, rcSlice) {\n var colSlice, rowSlice;\n rcSlice = rcSlice || {};\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return list[rcSlice.row][rcSlice.col];\n var row = jStat.rowa(list, rcSlice.row);\n colSlice = rcSlice.col || {};\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n }\n\n if (isNumber(rcSlice.col)) {\n var col = jStat.cola(list, rcSlice.col);\n rowSlice = rcSlice.row || {};\n return _slice(col, rowSlice.start, rowSlice.end, rowSlice.step);\n }\n\n rowSlice = rcSlice.row || {};\n colSlice = rcSlice.col || {};\n var rows = _slice(list, rowSlice.start, rowSlice.end, rowSlice.step);\n return rows.map(function(row) {\n return _slice(row, colSlice.start, colSlice.end, colSlice.step);\n });\n }\n\n return slice;\n}());\n\n\n// A=[[1,2,3],[4,5,6],[7,8,9]]\n// sliceAssign(A,{row:{start:1},col:{start:1}},[[0,0],[0,0]])\n// A=[[1,2,3],[4,0,0],[7,0,0]]\njStat.sliceAssign = function sliceAssign(A, rcSlice, B) {\n var nl, ml;\n if (isNumber(rcSlice.row)) {\n if (isNumber(rcSlice.col))\n return A[rcSlice.row][rcSlice.col] = B;\n rcSlice.col = rcSlice.col || {};\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n nl = jStat.arange(rcSlice.col.start,\n Math.min(A.length, rcSlice.col.end),\n rcSlice.col.step);\n var m = rcSlice.row;\n nl.forEach(function(n, i) {\n A[m][n] = B[i];\n });\n return A;\n }\n\n if (isNumber(rcSlice.col)) {\n rcSlice.row = rcSlice.row || {};\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n ml = jStat.arange(rcSlice.row.start,\n Math.min(A[0].length, rcSlice.row.end),\n rcSlice.row.step);\n var n = rcSlice.col;\n ml.forEach(function(m, j) {\n A[m][n] = B[j];\n });\n return A;\n }\n\n if (B[0].length === undefined) {\n B = [B];\n }\n rcSlice.row.start = rcSlice.row.start || 0;\n rcSlice.row.end = rcSlice.row.end || A.length;\n rcSlice.row.step = rcSlice.row.step || 1;\n rcSlice.col.start = rcSlice.col.start || 0;\n rcSlice.col.end = rcSlice.col.end || A[0].length;\n rcSlice.col.step = rcSlice.col.step || 1;\n ml = jStat.arange(rcSlice.row.start,\n Math.min(A.length, rcSlice.row.end),\n rcSlice.row.step);\n nl = jStat.arange(rcSlice.col.start,\n Math.min(A[0].length, rcSlice.col.end),\n rcSlice.col.step);\n ml.forEach(function(m, i) {\n nl.forEach(function(n, j) {\n A[m][n] = B[i][j];\n });\n });\n return A;\n};\n\n\n// [1,2,3] ->\n// [[1,0,0],[0,2,0],[0,0,3]]\njStat.diagonal = function diagonal(diagArray) {\n var mat = jStat.zeros(diagArray.length, diagArray.length);\n diagArray.forEach(function(t, i) {\n mat[i][i] = t;\n });\n return mat;\n};\n\n\n// return copy of A\njStat.copy = function copy(A) {\n return A.map(function(row) {\n if (isNumber(row))\n return row;\n return row.map(function(t) {\n return t;\n });\n });\n};\n\n\n// TODO: Go over this entire implementation. Seems a tragic waste of resources\n// doing all this work. Instead, and while ugly, use new Function() to generate\n// a custom function for each static method.\n\n// Quick reference.\nvar jProto = jStat.prototype;\n\n// Default length.\njProto.length = 0;\n\n// For internal use only.\n// TODO: Check if they're actually used, and if they are then rename them\n// to _*\njProto.push = Array.prototype.push;\njProto.sort = Array.prototype.sort;\njProto.splice = Array.prototype.splice;\njProto.slice = Array.prototype.slice;\n\n\n// Return a clean array.\njProto.toArray = function toArray() {\n return this.length > 1 ? slice.call(this) : slice.call(this)[0];\n};\n\n\n// Map a function to a matrix or vector.\njProto.map = function map(func, toAlter) {\n return jStat(jStat.map(this, func, toAlter));\n};\n\n\n// Cumulatively combine the elements of a matrix or vector using a function.\njProto.cumreduce = function cumreduce(func, toAlter) {\n return jStat(jStat.cumreduce(this, func, toAlter));\n};\n\n\n// Destructively alter an array.\njProto.alter = function alter(func) {\n jStat.alter(this, func);\n return this;\n};\n\n\n// Extend prototype with methods that have no argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(func) {\n var self = this,\n results;\n // Check for callback.\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self));\n });\n return this;\n }\n results = jStat[passfunc](this);\n return isArray(results) ? jStat(results) : results;\n };\n })(funcs[i]);\n})('transpose clear symmetric rows cols dimensions diag antidiag'.split(' '));\n\n\n// Extend prototype with methods that have one argument.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function(index, func) {\n var self = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(self, jProto[passfunc].call(self, index));\n });\n return this;\n }\n return jStat(jStat[passfunc](this, index));\n };\n })(funcs[i]);\n})('row col'.split(' '));\n\n\n// Extend prototype with simple shortcut methods.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function() {\n return jStat(jStat[passfunc].apply(null, arguments));\n };\n })(funcs[i]);\n})('create zeros ones rand identity'.split(' '));\n\n\n// Exposing jStat.\nreturn jStat;\n\n}(Math));\n(function(jStat, Math) {\n\nvar isFunction = jStat.utils.isFunction;\n\n// Ascending functions for sort\nfunction ascNum(a, b) { return a - b; }\n\nfunction clip(arg, min, max) {\n return Math.max(min, Math.min(arg, max));\n}\n\n\n// sum of an array\njStat.sum = function sum(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n\n// sum squared\njStat.sumsqrd = function sumsqrd(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i] * arr[i];\n return sum;\n};\n\n\n// sum of squared errors of prediction (SSE)\njStat.sumsqerr = function sumsqerr(arr) {\n var mean = jStat.mean(arr);\n var sum = 0;\n var i = arr.length;\n var tmp;\n while (--i >= 0) {\n tmp = arr[i] - mean;\n sum += tmp * tmp;\n }\n return sum;\n};\n\n// sum of an array in each row\njStat.sumrow = function sumrow(arr) {\n var sum = 0;\n var i = arr.length;\n while (--i >= 0)\n sum += arr[i];\n return sum;\n};\n\n// product of an array\njStat.product = function product(arr) {\n var prod = 1;\n var i = arr.length;\n while (--i >= 0)\n prod *= arr[i];\n return prod;\n};\n\n\n// minimum value of an array\njStat.min = function min(arr) {\n var low = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] < low)\n low = arr[i];\n return low;\n};\n\n\n// maximum value of an array\njStat.max = function max(arr) {\n var high = arr[0];\n var i = 0;\n while (++i < arr.length)\n if (arr[i] > high)\n high = arr[i];\n return high;\n};\n\n\n// unique values of an array\njStat.unique = function unique(arr) {\n var hash = {}, _arr = [];\n for(var i = 0; i < arr.length; i++) {\n if (!hash[arr[i]]) {\n hash[arr[i]] = true;\n _arr.push(arr[i]);\n }\n }\n return _arr;\n};\n\n\n// mean value of an array\njStat.mean = function mean(arr) {\n return jStat.sum(arr) / arr.length;\n};\n\n\n// mean squared error (MSE)\njStat.meansqerr = function meansqerr(arr) {\n return jStat.sumsqerr(arr) / arr.length;\n};\n\n\n// geometric mean of an array\njStat.geomean = function geomean(arr) {\n var logs = arr.map(Math.log)\n var meanOfLogs = jStat.mean(logs)\n return Math.exp(meanOfLogs)\n};\n\n\n// median of an array\njStat.median = function median(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n // check if array is even or odd, then return the appropriate\n return !(arrlen & 1)\n ? (_arr[(arrlen / 2) - 1 ] + _arr[(arrlen / 2)]) / 2\n : _arr[(arrlen / 2) | 0 ];\n};\n\n\n// cumulative sum of an array\njStat.cumsum = function cumsum(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a + b; });\n};\n\n\n// cumulative product of an array\njStat.cumprod = function cumprod(arr) {\n return jStat.cumreduce(arr, function (a, b) { return a * b; });\n};\n\n\n// successive differences of a sequence\njStat.diff = function diff(arr) {\n var diffs = [];\n var arrLen = arr.length;\n var i;\n for (i = 1; i < arrLen; i++)\n diffs.push(arr[i] - arr[i - 1]);\n return diffs;\n};\n\n\n// ranks of an array\njStat.rank = function (arr) {\n var i;\n var distinctNumbers = [];\n var numberCounts = {};\n for (i = 0; i < arr.length; i++) {\n var number = arr[i];\n if (numberCounts[number]) {\n numberCounts[number]++;\n } else {\n numberCounts[number] = 1;\n distinctNumbers.push(number);\n }\n }\n\n var sortedDistinctNumbers = distinctNumbers.sort(ascNum);\n var numberRanks = {};\n var currentRank = 1;\n for (i = 0; i < sortedDistinctNumbers.length; i++) {\n var number = sortedDistinctNumbers[i];\n var count = numberCounts[number];\n var first = currentRank;\n var last = currentRank + count - 1;\n var rank = (first + last) / 2;\n numberRanks[number] = rank;\n currentRank += count;\n }\n\n return arr.map(function (number) {\n return numberRanks[number];\n });\n};\n\n\n// mode of an array\n// if there are multiple modes of an array, return all of them\n// is this the appropriate way of handling it?\njStat.mode = function mode(arr) {\n var arrLen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n var count = 1;\n var maxCount = 0;\n var numMaxCount = 0;\n var mode_arr = [];\n var i;\n\n for (i = 0; i < arrLen; i++) {\n if (_arr[i] === _arr[i + 1]) {\n count++;\n } else {\n if (count > maxCount) {\n mode_arr = [_arr[i]];\n maxCount = count;\n numMaxCount = 0;\n }\n // are there multiple max counts\n else if (count === maxCount) {\n mode_arr.push(_arr[i]);\n numMaxCount++;\n }\n // resetting count for new value in array\n count = 1;\n }\n }\n\n return numMaxCount === 0 ? mode_arr[0] : mode_arr;\n};\n\n\n// range of an array\njStat.range = function range(arr) {\n return jStat.max(arr) - jStat.min(arr);\n};\n\n// variance of an array\n// flag = true indicates sample instead of population\njStat.variance = function variance(arr, flag) {\n return jStat.sumsqerr(arr) / (arr.length - (flag ? 1 : 0));\n};\n\n// pooled variance of an array of arrays\njStat.pooledvariance = function pooledvariance(arr) {\n var sumsqerr = arr.reduce(function (a, samples) {return a + jStat.sumsqerr(samples);}, 0);\n var count = arr.reduce(function (a, samples) {return a + samples.length;}, 0);\n return sumsqerr / (count - arr.length);\n};\n\n// deviation of an array\njStat.deviation = function (arr) {\n var mean = jStat.mean(arr);\n var arrlen = arr.length;\n var dev = new Array(arrlen);\n for (var i = 0; i < arrlen; i++) {\n dev[i] = arr[i] - mean;\n }\n return dev;\n};\n\n// standard deviation of an array\n// flag = true indicates sample instead of population\njStat.stdev = function stdev(arr, flag) {\n return Math.sqrt(jStat.variance(arr, flag));\n};\n\n// pooled standard deviation of an array of arrays\njStat.pooledstdev = function pooledstdev(arr) {\n return Math.sqrt(jStat.pooledvariance(arr));\n};\n\n// mean deviation (mean absolute deviation) of an array\njStat.meandev = function meandev(arr) {\n var mean = jStat.mean(arr);\n var a = [];\n for (var i = arr.length - 1; i >= 0; i--) {\n a.push(Math.abs(arr[i] - mean));\n }\n return jStat.mean(a);\n};\n\n\n// median deviation (median absolute deviation) of an array\njStat.meddev = function meddev(arr) {\n var median = jStat.median(arr);\n var a = [];\n for (var i = arr.length - 1; i >= 0; i--) {\n a.push(Math.abs(arr[i] - median));\n }\n return jStat.median(a);\n};\n\n\n// coefficient of variation\njStat.coeffvar = function coeffvar(arr) {\n return jStat.stdev(arr) / jStat.mean(arr);\n};\n\n\n// quartiles of an array\njStat.quartiles = function quartiles(arr) {\n var arrlen = arr.length;\n var _arr = arr.slice().sort(ascNum);\n return [\n _arr[ Math.round((arrlen) / 4) - 1 ],\n _arr[ Math.round((arrlen) / 2) - 1 ],\n _arr[ Math.round((arrlen) * 3 / 4) - 1 ]\n ];\n};\n\n\n// Arbitary quantiles of an array. Direct port of the scipy.stats\n// implementation by Pierre GF Gerard-Marchant.\njStat.quantiles = function quantiles(arr, quantilesArray, alphap, betap) {\n var sortedArray = arr.slice().sort(ascNum);\n var quantileVals = [quantilesArray.length];\n var n = arr.length;\n var i, p, m, aleph, k, gamma;\n\n if (typeof alphap === 'undefined')\n alphap = 3 / 8;\n if (typeof betap === 'undefined')\n betap = 3 / 8;\n\n for (i = 0; i < quantilesArray.length; i++) {\n p = quantilesArray[i];\n m = alphap + p * (1 - alphap - betap);\n aleph = n * p + m;\n k = Math.floor(clip(aleph, 1, n - 1));\n gamma = clip(aleph - k, 0, 1);\n quantileVals[i] = (1 - gamma) * sortedArray[k - 1] + gamma * sortedArray[k];\n }\n\n return quantileVals;\n};\n\n// Return the k-th percentile of values in a range, where k is in the range 0..1, inclusive.\n// Passing true for the exclusive parameter excludes both endpoints of the range.\njStat.percentile = function percentile(arr, k, exclusive) {\n var _arr = arr.slice().sort(ascNum);\n var realIndex = k * (_arr.length + (exclusive ? 1 : -1)) + (exclusive ? 0 : 1);\n var index = parseInt(realIndex);\n var frac = realIndex - index;\n if (index + 1 < _arr.length) {\n return _arr[index - 1] + frac * (_arr[index] - _arr[index - 1]);\n } else {\n return _arr[index - 1];\n }\n}\n\n// The percentile rank of score in a given array. Returns the percentage\n// of all values in the input array that are less than (kind='strict') or\n// less or equal than (kind='weak') score. Default is weak.\njStat.percentileOfScore = function percentileOfScore(arr, score, kind) {\n var counter = 0;\n var len = arr.length;\n var strict = false;\n var value, i;\n\n if (kind === 'strict')\n strict = true;\n\n for (i = 0; i < len; i++) {\n value = arr[i];\n if ((strict && value < score) ||\n (!strict && value <= score)) {\n counter++;\n }\n }\n\n return counter / len;\n};\n\n\n// Histogram (bin count) data\njStat.histogram = function histogram(arr, binCnt) {\n binCnt = binCnt || 4;\n var first = jStat.min(arr);\n var binWidth = (jStat.max(arr) - first) / binCnt;\n var len = arr.length;\n var bins = [];\n var i;\n\n for (i = 0; i < binCnt; i++)\n bins[i] = 0;\n for (i = 0; i < len; i++)\n bins[Math.min(Math.floor(((arr[i] - first) / binWidth)), binCnt - 1)] += 1;\n\n return bins;\n};\n\n\n// covariance of two arrays\njStat.covariance = function covariance(arr1, arr2) {\n var u = jStat.mean(arr1);\n var v = jStat.mean(arr2);\n var arr1Len = arr1.length;\n var sq_dev = new Array(arr1Len);\n var i;\n\n for (i = 0; i < arr1Len; i++)\n sq_dev[i] = (arr1[i] - u) * (arr2[i] - v);\n\n return jStat.sum(sq_dev) / (arr1Len - 1);\n};\n\n\n// (pearson's) population correlation coefficient, rho\njStat.corrcoeff = function corrcoeff(arr1, arr2) {\n return jStat.covariance(arr1, arr2) /\n jStat.stdev(arr1, 1) /\n jStat.stdev(arr2, 1);\n};\n\n // (spearman's) rank correlation coefficient, sp\njStat.spearmancoeff = function (arr1, arr2) {\n arr1 = jStat.rank(arr1);\n arr2 = jStat.rank(arr2);\n //return pearson's correlation of the ranks:\n return jStat.corrcoeff(arr1, arr2);\n}\n\n\n// statistical standardized moments (general form of skew/kurt)\njStat.stanMoment = function stanMoment(arr, n) {\n var mu = jStat.mean(arr);\n var sigma = jStat.stdev(arr);\n var len = arr.length;\n var skewSum = 0;\n\n for (var i = 0; i < len; i++)\n skewSum += Math.pow((arr[i] - mu) / sigma, n);\n\n return skewSum / arr.length;\n};\n\n// (pearson's) moment coefficient of skewness\njStat.skewness = function skewness(arr) {\n return jStat.stanMoment(arr, 3);\n};\n\n// (pearson's) (excess) kurtosis\njStat.kurtosis = function kurtosis(arr) {\n return jStat.stanMoment(arr, 4) - 3;\n};\n\n\nvar jProto = jStat.prototype;\n\n\n// Extend jProto with method for calculating cumulative sums and products.\n// This differs from the similar extension below as cumsum and cumprod should\n// not be run again in the case fullbool === true.\n// If a matrix is passed, automatically assume operation should be done on the\n// columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('cumsum cumprod').split(' '));\n\n\n// Extend jProto with methods which don't require arguments and work on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n // If a matrix is passed, automatically assume operation should be done on\n // the columns.\n jProto[passfunc] = function(fullbool, func) {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n // Assignment reassignation depending on how parameters were passed in.\n if (isFunction(fullbool)) {\n func = fullbool;\n fullbool = false;\n }\n // Check if a callback was passed with the function.\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));\n });\n return this;\n }\n // Check if matrix and run calculations.\n if (this.length > 1) {\n if (passfunc !== 'sumrow')\n tmpthis = fullbool === true ? this : this.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = jStat[passfunc](tmpthis[i]);\n return fullbool === true\n ? jStat[passfunc](jStat.utils.toVector(arr))\n : arr;\n }\n // Pass fullbool if only vector, not a matrix. for variance and stdev.\n return jStat[passfunc](this[0], fullbool);\n };\n })(funcs[i]);\n})(('sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr ' +\n 'geomean median diff rank mode range variance deviation stdev meandev ' +\n 'meddev coeffvar quartiles histogram skewness kurtosis').split(' '));\n\n\n// Extend jProto with functions that take arguments. Operations on matrices are\n// done on columns.\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jProto[passfunc] = function() {\n var arr = [];\n var i = 0;\n var tmpthis = this;\n var args = Array.prototype.slice.call(arguments);\n var callbackFunction;\n\n // If the last argument is a function, we assume it's a callback; we\n // strip the callback out and call the function again.\n if (isFunction(args[args.length - 1])) {\n callbackFunction = args[args.length - 1];\n var argsToPass = args.slice(0, args.length - 1);\n\n setTimeout(function() {\n callbackFunction.call(tmpthis,\n jProto[passfunc].apply(tmpthis, argsToPass));\n });\n return this;\n\n // Otherwise we curry the function args and call normally.\n } else {\n callbackFunction = undefined;\n var curriedFunction = function curriedFunction(vector) {\n return jStat[passfunc].apply(tmpthis, [vector].concat(args));\n }\n }\n\n // If this is a matrix, run column-by-column.\n if (this.length > 1) {\n tmpthis = tmpthis.transpose();\n for (; i < tmpthis.length; i++)\n arr[i] = curriedFunction(tmpthis[i]);\n return arr;\n }\n\n // Otherwise run on the vector.\n return curriedFunction(this[0]);\n };\n })(funcs[i]);\n})('quantiles percentileOfScore'.split(' '));\n\n}(jStat, Math));\n// Special functions //\n(function(jStat, Math) {\n\n// Log-gamma function\njStat.gammaln = function gammaln(x) {\n var j = 0;\n var cof = [\n 76.18009172947146, -86.50532032941677, 24.01409824083091,\n -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5\n ];\n var ser = 1.000000000190015;\n var xx, y, tmp;\n tmp = (y = xx = x) + 5.5;\n tmp -= (xx + 0.5) * Math.log(tmp);\n for (; j < 6; j++)\n ser += cof[j] / ++y;\n return Math.log(2.5066282746310005 * ser / xx) - tmp;\n};\n\n/*\n * log-gamma function to support poisson distribution sampling. The\n * algorithm comes from SPECFUN by Shanjie Zhang and Jianming Jin and their\n * book \"Computation of Special Functions\", 1996, John Wiley & Sons, Inc.\n */\njStat.loggam = function loggam(x) {\n var x0, x2, xp, gl, gl0;\n var k, n;\n\n var a = [8.333333333333333e-02, -2.777777777777778e-03,\n 7.936507936507937e-04, -5.952380952380952e-04,\n 8.417508417508418e-04, -1.917526917526918e-03,\n 6.410256410256410e-03, -2.955065359477124e-02,\n 1.796443723688307e-01, -1.39243221690590e+00];\n x0 = x;\n n = 0;\n if ((x == 1.0) || (x == 2.0)) {\n return 0.0;\n }\n if (x <= 7.0) {\n n = Math.floor(7 - x);\n x0 = x + n;\n }\n x2 = 1.0 / (x0 * x0);\n xp = 2 * Math.PI;\n gl0 = a[9];\n for (k = 8; k >= 0; k--) {\n gl0 *= x2;\n gl0 += a[k];\n }\n gl = gl0 / x0 + 0.5 * Math.log(xp) + (x0 - 0.5) * Math.log(x0) - x0;\n if (x <= 7.0) {\n for (k = 1; k <= n; k++) {\n gl -= Math.log(x0 - 1.0);\n x0 -= 1.0;\n }\n }\n return gl;\n}\n\n// gamma of x\njStat.gammafn = function gammafn(x) {\n var p = [-1.716185138865495, 24.76565080557592, -379.80425647094563,\n 629.3311553128184, 866.9662027904133, -31451.272968848367,\n -36144.413418691176, 66456.14382024054\n ];\n var q = [-30.8402300119739, 315.35062697960416, -1015.1563674902192,\n -3107.771671572311, 22538.118420980151, 4755.8462775278811,\n -134659.9598649693, -115132.2596755535];\n var fact = false;\n var n = 0;\n var xden = 0;\n var xnum = 0;\n var y = x;\n var i, z, yi, res;\n if (x > 171.6243769536076) {\n return Infinity;\n }\n if (y <= 0) {\n res = y % 1 + 3.6e-16;\n if (res) {\n fact = (!(y & 1) ? 1 : -1) * Math.PI / Math.sin(Math.PI * res);\n y = 1 - y;\n } else {\n return Infinity;\n }\n }\n yi = y;\n if (y < 1) {\n z = y++;\n } else {\n z = (y -= n = (y | 0) - 1) - 1;\n }\n for (i = 0; i < 8; ++i) {\n xnum = (xnum + p[i]) * z;\n xden = xden * z + q[i];\n }\n res = xnum / xden + 1;\n if (yi < y) {\n res /= yi;\n } else if (yi > y) {\n for (i = 0; i < n; ++i) {\n res *= y;\n y++;\n }\n }\n if (fact) {\n res = fact / res;\n }\n return res;\n};\n\n\n// lower incomplete gamma function, which is usually typeset with a\n// lower-case greek gamma as the function symbol\njStat.gammap = function gammap(a, x) {\n return jStat.lowRegGamma(a, x) * jStat.gammafn(a);\n};\n\n\n// The lower regularized incomplete gamma function, usually written P(a,x)\njStat.lowRegGamma = function lowRegGamma(a, x) {\n var aln = jStat.gammaln(a);\n var ap = a;\n var sum = 1 / a;\n var del = sum;\n var b = x + 1 - a;\n var c = 1 / 1.0e-30;\n var d = 1 / b;\n var h = d;\n var i = 1;\n // calculate maximum number of itterations required for a\n var ITMAX = -~(Math.log((a >= 1) ? a : 1 / a) * 8.5 + a * 0.4 + 17);\n var an;\n\n if (x < 0 || a <= 0) {\n return NaN;\n } else if (x < a + 1) {\n for (; i <= ITMAX; i++) {\n sum += del *= x / ++ap;\n }\n return (sum * Math.exp(-x + a * Math.log(x) - (aln)));\n }\n\n for (; i <= ITMAX; i++) {\n an = -i * (i - a);\n b += 2;\n d = an * d + b;\n c = b + an / c;\n d = 1 / d;\n h *= d * c;\n }\n\n return (1 - h * Math.exp(-x + a * Math.log(x) - (aln)));\n};\n\n// natural log factorial of n\njStat.factorialln = function factorialln(n) {\n return n < 0 ? NaN : jStat.gammaln(n + 1);\n};\n\n// factorial of n\njStat.factorial = function factorial(n) {\n return n < 0 ? NaN : jStat.gammafn(n + 1);\n};\n\n// combinations of n, m\njStat.combination = function combination(n, m) {\n // make sure n or m don't exceed the upper limit of usable values\n return (n > 170 || m > 170)\n ? Math.exp(jStat.combinationln(n, m))\n : (jStat.factorial(n) / jStat.factorial(m)) / jStat.factorial(n - m);\n};\n\n\njStat.combinationln = function combinationln(n, m){\n return jStat.factorialln(n) - jStat.factorialln(m) - jStat.factorialln(n - m);\n};\n\n\n// permutations of n, m\njStat.permutation = function permutation(n, m) {\n return jStat.factorial(n) / jStat.factorial(n - m);\n};\n\n\n// beta function\njStat.betafn = function betafn(x, y) {\n // ensure arguments are positive\n if (x <= 0 || y <= 0)\n return undefined;\n // make sure x + y doesn't exceed the upper limit of usable values\n return (x + y > 170)\n ? Math.exp(jStat.betaln(x, y))\n : jStat.gammafn(x) * jStat.gammafn(y) / jStat.gammafn(x + y);\n};\n\n\n// natural logarithm of beta function\njStat.betaln = function betaln(x, y) {\n return jStat.gammaln(x) + jStat.gammaln(y) - jStat.gammaln(x + y);\n};\n\n\n// Evaluates the continued fraction for incomplete beta function by modified\n// Lentz's method.\njStat.betacf = function betacf(x, a, b) {\n var fpmin = 1e-30;\n var m = 1;\n var qab = a + b;\n var qap = a + 1;\n var qam = a - 1;\n var c = 1;\n var d = 1 - qab * x / qap;\n var m2, aa, del, h;\n\n // These q's will be used in factors that occur in the coefficients\n if (Math.abs(d) < fpmin)\n d = fpmin;\n d = 1 / d;\n h = d;\n\n for (; m <= 100; m++) {\n m2 = 2 * m;\n aa = m * (b - m) * x / ((qam + m2) * (a + m2));\n // One step (the even one) of the recurrence\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n h *= d * c;\n aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2));\n // Next step of the recurrence (the odd one)\n d = 1 + aa * d;\n if (Math.abs(d) < fpmin)\n d = fpmin;\n c = 1 + aa / c;\n if (Math.abs(c) < fpmin)\n c = fpmin;\n d = 1 / d;\n del = d * c;\n h *= del;\n if (Math.abs(del - 1.0) < 3e-7)\n break;\n }\n\n return h;\n};\n\n\n// Returns the inverse of the lower regularized inomplete gamma function\njStat.gammapinv = function gammapinv(p, a) {\n var j = 0;\n var a1 = a - 1;\n var EPS = 1e-8;\n var gln = jStat.gammaln(a);\n var x, err, t, u, pp, lna1, afac;\n\n if (p >= 1)\n return Math.max(100, a + 100 * Math.sqrt(a));\n if (p <= 0)\n return 0;\n if (a > 1) {\n lna1 = Math.log(a1);\n afac = Math.exp(a1 * (lna1 - 1) - gln);\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t * (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n x = Math.max(1e-3,\n a * Math.pow(1 - 1 / (9 * a) - x / (3 * Math.sqrt(a)), 3));\n } else {\n t = 1 - a * (0.253 + a * 0.12);\n if (p < t)\n x = Math.pow(p / t, 1 / a);\n else\n x = 1 - Math.log(1 - (p - t) / (1 - t));\n }\n\n for(; j < 12; j++) {\n if (x <= 0)\n return 0;\n err = jStat.lowRegGamma(a, x) - p;\n if (a > 1)\n t = afac * Math.exp(-(x - a1) + a1 * (Math.log(x) - lna1));\n else\n t = Math.exp(-x + a1 * Math.log(x) - gln);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / x - 1))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (Math.abs(t) < EPS * x)\n break;\n }\n\n return x;\n};\n\n\n// Returns the error function erf(x)\njStat.erf = function erf(x) {\n var cof = [-1.3026537197817094, 6.4196979235649026e-1, 1.9476473204185836e-2,\n -9.561514786808631e-3, -9.46595344482036e-4, 3.66839497852761e-4,\n 4.2523324806907e-5, -2.0278578112534e-5, -1.624290004647e-6,\n 1.303655835580e-6, 1.5626441722e-8, -8.5238095915e-8,\n 6.529054439e-9, 5.059343495e-9, -9.91364156e-10,\n -2.27365122e-10, 9.6467911e-11, 2.394038e-12,\n -6.886027e-12, 8.94487e-13, 3.13092e-13,\n -1.12708e-13, 3.81e-16, 7.106e-15,\n -1.523e-15, -9.4e-17, 1.21e-16,\n -2.8e-17];\n var j = cof.length - 1;\n var isneg = false;\n var d = 0;\n var dd = 0;\n var t, ty, tmp, res;\n\n if (x < 0) {\n x = -x;\n isneg = true;\n }\n\n t = 2 / (2 + x);\n ty = 4 * t - 2;\n\n for(; j > 0; j--) {\n tmp = d;\n d = ty * d - dd + cof[j];\n dd = tmp;\n }\n\n res = t * Math.exp(-x * x + 0.5 * (cof[0] + ty * d) - dd);\n return isneg ? res - 1 : 1 - res;\n};\n\n\n// Returns the complmentary error function erfc(x)\njStat.erfc = function erfc(x) {\n return 1 - jStat.erf(x);\n};\n\n\n// Returns the inverse of the complementary error function\njStat.erfcinv = function erfcinv(p) {\n var j = 0;\n var x, err, t, pp;\n if (p >= 2)\n return -100;\n if (p <= 0)\n return 100;\n pp = (p < 1) ? p : 2 - p;\n t = Math.sqrt(-2 * Math.log(pp / 2));\n x = -0.70711 * ((2.30753 + t * 0.27061) /\n (1 + t * (0.99229 + t * 0.04481)) - t);\n for (; j < 2; j++) {\n err = jStat.erfc(x) - pp;\n x += err / (1.12837916709551257 * Math.exp(-x * x) - x * err);\n }\n return (p < 1) ? x : -x;\n};\n\n\n// Returns the inverse of the incomplete beta function\njStat.ibetainv = function ibetainv(p, a, b) {\n var EPS = 1e-8;\n var a1 = a - 1;\n var b1 = b - 1;\n var j = 0;\n var lna, lnb, pp, t, u, err, x, al, h, w, afac;\n if (p <= 0)\n return 0;\n if (p >= 1)\n return 1;\n if (a >= 1 && b >= 1) {\n pp = (p < 0.5) ? p : 1 - p;\n t = Math.sqrt(-2 * Math.log(pp));\n x = (2.30753 + t * 0.27061) / (1 + t* (0.99229 + t * 0.04481)) - t;\n if (p < 0.5)\n x = -x;\n al = (x * x - 3) / 6;\n h = 2 / (1 / (2 * a - 1) + 1 / (2 * b - 1));\n w = (x * Math.sqrt(al + h) / h) - (1 / (2 * b - 1) - 1 / (2 * a - 1)) *\n (al + 5 / 6 - 2 / (3 * h));\n x = a / (a + b * Math.exp(2 * w));\n } else {\n lna = Math.log(a / (a + b));\n lnb = Math.log(b / (a + b));\n t = Math.exp(a * lna) / a;\n u = Math.exp(b * lnb) / b;\n w = t + u;\n if (p < t / w)\n x = Math.pow(a * w * p, 1 / a);\n else\n x = 1 - Math.pow(b * w * (1 - p), 1 / b);\n }\n afac = -jStat.gammaln(a) - jStat.gammaln(b) + jStat.gammaln(a + b);\n for(; j < 10; j++) {\n if (x === 0 || x === 1)\n return x;\n err = jStat.ibeta(x, a, b) - p;\n t = Math.exp(a1 * Math.log(x) + b1 * Math.log(1 - x) + afac);\n u = err / t;\n x -= (t = u / (1 - 0.5 * Math.min(1, u * (a1 / x - b1 / (1 - x)))));\n if (x <= 0)\n x = 0.5 * (x + t);\n if (x >= 1)\n x = 0.5 * (x + t + 1);\n if (Math.abs(t) < EPS * x && j > 0)\n break;\n }\n return x;\n};\n\n\n// Returns the incomplete beta function I_x(a,b)\njStat.ibeta = function ibeta(x, a, b) {\n // Factors in front of the continued fraction.\n var bt = (x === 0 || x === 1) ? 0 :\n Math.exp(jStat.gammaln(a + b) - jStat.gammaln(a) -\n jStat.gammaln(b) + a * Math.log(x) + b *\n Math.log(1 - x));\n if (x < 0 || x > 1)\n return false;\n if (x < (a + 1) / (a + b + 2))\n // Use continued fraction directly.\n return bt * jStat.betacf(x, a, b) / a;\n // else use continued fraction after making the symmetry transformation.\n return 1 - bt * jStat.betacf(1 - x, b, a) / b;\n};\n\n\n// Returns a normal deviate (mu=0, sigma=1).\n// If n and m are specified it returns a object of normal deviates.\njStat.randn = function randn(n, m) {\n var u, v, x, y, q;\n if (!m)\n m = n;\n if (n)\n return jStat.create(n, m, function() { return jStat.randn(); });\n do {\n u = jStat._random_fn();\n v = 1.7156 * (jStat._random_fn() - 0.5);\n x = u - 0.449871;\n y = Math.abs(v) + 0.386595;\n q = x * x + y * (0.19600 * y - 0.25472 * x);\n } while (q > 0.27597 && (q > 0.27846 || v * v > -4 * Math.log(u) * u * u));\n return v / u;\n};\n\n\n// Returns a gamma deviate by the method of Marsaglia and Tsang.\njStat.randg = function randg(shape, n, m) {\n var oalph = shape;\n var a1, a2, u, v, x, mat;\n if (!m)\n m = n;\n if (!shape)\n shape = 1;\n if (n) {\n mat = jStat.zeros(n,m);\n mat.alter(function() { return jStat.randg(shape); });\n return mat;\n }\n if (shape < 1)\n shape += 1;\n a1 = shape - 1 / 3;\n a2 = 1 / Math.sqrt(9 * a1);\n do {\n do {\n x = jStat.randn();\n v = 1 + a2 * x;\n } while(v <= 0);\n v = v * v * v;\n u = jStat._random_fn();\n } while(u > 1 - 0.331 * Math.pow(x, 4) &&\n Math.log(u) > 0.5 * x*x + a1 * (1 - v + Math.log(v)));\n // alpha > 1\n if (shape == oalph)\n return a1 * v;\n // alpha < 1\n do {\n u = jStat._random_fn();\n } while(u === 0);\n return Math.pow(u, 1 / oalph) * a1 * v;\n};\n\n\n// making use of static methods on the instance\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(\n jStat.map(this, function(value) { return jStat[passfunc](value); }));\n }\n })(funcs[i]);\n})('gammaln gammafn factorial factorialln'.split(' '));\n\n\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function() {\n return jStat(jStat[passfunc].apply(null, arguments));\n };\n })(funcs[i]);\n})('randn'.split(' '));\n\n}(jStat, Math));\n(function(jStat, Math) {\n\n// generate all distribution instance methods\n(function(list) {\n for (var i = 0; i < list.length; i++) (function(func) {\n // distribution instance method\n jStat[func] = function f(a, b, c) {\n if (!(this instanceof f))\n return new f(a, b, c);\n this._a = a;\n this._b = b;\n this._c = c;\n return this;\n };\n // distribution method to be used on a jStat instance\n jStat.fn[func] = function(a, b, c) {\n var newthis = jStat[func](a, b, c);\n newthis.data = this;\n return newthis;\n };\n // sample instance method\n jStat[func].prototype.sample = function(arr) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (arr)\n return jStat.alter(arr, function() {\n return jStat[func].sample(a, b, c);\n });\n else\n return jStat[func].sample(a, b, c);\n };\n // generate the pdf, cdf and inv instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function(x) {\n var a = this._a;\n var b = this._b;\n var c = this._c;\n if (!x && x !== 0)\n x = this.data;\n if (typeof x !== 'number') {\n return jStat.fn.map.call(x, function(x) {\n return jStat[func][fnfunc](x, a, b, c);\n });\n }\n return jStat[func][fnfunc](x, a, b, c);\n };\n })(vals[i]);\n })('pdf cdf inv'.split(' '));\n // generate the mean, median, mode and variance instance methods\n (function(vals) {\n for (var i = 0; i < vals.length; i++) (function(fnfunc) {\n jStat[func].prototype[fnfunc] = function() {\n return jStat[func][fnfunc](this._a, this._b, this._c);\n };\n })(vals[i]);\n })('mean median mode variance'.split(' '));\n })(list[i]);\n})((\n 'beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy ' +\n 'laplace lognormal noncentralt normal pareto studentt weibull uniform ' +\n 'binomial negbin hypgeom poisson triangular tukey arcsine'\n).split(' '));\n\n\n\n// extend beta function with static methods\njStat.extend(jStat.beta, {\n pdf: function pdf(x, alpha, beta) {\n // PDF is zero outside the support\n if (x > 1 || x < 0)\n return 0;\n // PDF is one for the uniform case\n if (alpha == 1 && beta == 1)\n return 1;\n\n if (alpha < 512 && beta < 512) {\n return (Math.pow(x, alpha - 1) * Math.pow(1 - x, beta - 1)) /\n jStat.betafn(alpha, beta);\n } else {\n return Math.exp((alpha - 1) * Math.log(x) +\n (beta - 1) * Math.log(1 - x) -\n jStat.betaln(alpha, beta));\n }\n },\n\n cdf: function cdf(x, alpha, beta) {\n return (x > 1 || x < 0) ? (x > 1) * 1 : jStat.ibeta(x, alpha, beta);\n },\n\n inv: function inv(x, alpha, beta) {\n return jStat.ibetainv(x, alpha, beta);\n },\n\n mean: function mean(alpha, beta) {\n return alpha / (alpha + beta);\n },\n\n median: function median(alpha, beta) {\n return jStat.ibetainv(0.5, alpha, beta);\n },\n\n mode: function mode(alpha, beta) {\n return (alpha - 1 ) / ( alpha + beta - 2);\n },\n\n // return a random sample\n sample: function sample(alpha, beta) {\n var u = jStat.randg(alpha);\n return u / (u + jStat.randg(beta));\n },\n\n variance: function variance(alpha, beta) {\n return (alpha * beta) / (Math.pow(alpha + beta, 2) * (alpha + beta + 1));\n }\n});\n\n// extend F function with static methods\njStat.extend(jStat.centralF, {\n // This implementation of the pdf function avoids float overflow\n // See the way that R calculates this value:\n // https://svn.r-project.org/R/trunk/src/nmath/df.c\n pdf: function pdf(x, df1, df2) {\n var p, q, f;\n\n if (x < 0)\n return 0;\n\n if (df1 <= 2) {\n if (x === 0 && df1 < 2) {\n return Infinity;\n }\n if (x === 0 && df1 === 2) {\n return 1;\n }\n return (1 / jStat.betafn(df1 / 2, df2 / 2)) *\n Math.pow(df1 / df2, df1 / 2) *\n Math.pow(x, (df1/2) - 1) *\n Math.pow((1 + (df1 / df2) * x), -(df1 + df2) / 2);\n }\n\n p = (df1 * x) / (df2 + x * df1);\n q = df2 / (df2 + x * df1);\n f = df1 * q / 2.0;\n return f * jStat.binomial.pdf((df1 - 2) / 2, (df1 + df2 - 2) / 2, p);\n },\n\n cdf: function cdf(x, df1, df2) {\n if (x < 0)\n return 0;\n return jStat.ibeta((df1 * x) / (df1 * x + df2), df1 / 2, df2 / 2);\n },\n\n inv: function inv(x, df1, df2) {\n return df2 / (df1 * (1 / jStat.ibetainv(x, df1 / 2, df2 / 2) - 1));\n },\n\n mean: function mean(df1, df2) {\n return (df2 > 2) ? df2 / (df2 - 2) : undefined;\n },\n\n mode: function mode(df1, df2) {\n return (df1 > 2) ? (df2 * (df1 - 2)) / (df1 * (df2 + 2)) : undefined;\n },\n\n // return a random sample\n sample: function sample(df1, df2) {\n var x1 = jStat.randg(df1 / 2) * 2;\n var x2 = jStat.randg(df2 / 2) * 2;\n return (x1 / df1) / (x2 / df2);\n },\n\n variance: function variance(df1, df2) {\n if (df2 <= 4)\n return undefined;\n return 2 * df2 * df2 * (df1 + df2 - 2) /\n (df1 * (df2 - 2) * (df2 - 2) * (df2 - 4));\n }\n});\n\n\n// extend cauchy function with static methods\njStat.extend(jStat.cauchy, {\n pdf: function pdf(x, local, scale) {\n if (scale < 0) { return 0; }\n\n return (scale / (Math.pow(x - local, 2) + Math.pow(scale, 2))) / Math.PI;\n },\n\n cdf: function cdf(x, local, scale) {\n return Math.atan((x - local) / scale) / Math.PI + 0.5;\n },\n\n inv: function(p, local, scale) {\n return local + scale * Math.tan(Math.PI * (p - 0.5));\n },\n\n median: function median(local/*, scale*/) {\n return local;\n },\n\n mode: function mode(local/*, scale*/) {\n return local;\n },\n\n sample: function sample(local, scale) {\n return jStat.randn() *\n Math.sqrt(1 / (2 * jStat.randg(0.5))) * scale + local;\n }\n});\n\n\n\n// extend chisquare function with static methods\njStat.extend(jStat.chisquare, {\n pdf: function pdf(x, dof) {\n if (x < 0)\n return 0;\n return (x === 0 && dof === 2) ? 0.5 :\n Math.exp((dof / 2 - 1) * Math.log(x) - x / 2 - (dof / 2) *\n Math.log(2) - jStat.gammaln(dof / 2));\n },\n\n cdf: function cdf(x, dof) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(dof / 2, x / 2);\n },\n\n inv: function(p, dof) {\n return 2 * jStat.gammapinv(p, 0.5 * dof);\n },\n\n mean : function(dof) {\n return dof;\n },\n\n // TODO: this is an approximation (is there a better way?)\n median: function median(dof) {\n return dof * Math.pow(1 - (2 / (9 * dof)), 3);\n },\n\n mode: function mode(dof) {\n return (dof - 2 > 0) ? dof - 2 : 0;\n },\n\n sample: function sample(dof) {\n return jStat.randg(dof / 2) * 2;\n },\n\n variance: function variance(dof) {\n return 2 * dof;\n }\n});\n\n\n\n// extend exponential function with static methods\njStat.extend(jStat.exponential, {\n pdf: function pdf(x, rate) {\n return x < 0 ? 0 : rate * Math.exp(-rate * x);\n },\n\n cdf: function cdf(x, rate) {\n return x < 0 ? 0 : 1 - Math.exp(-rate * x);\n },\n\n inv: function(p, rate) {\n return -Math.log(1 - p) / rate;\n },\n\n mean : function(rate) {\n return 1 / rate;\n },\n\n median: function (rate) {\n return (1 / rate) * Math.log(2);\n },\n\n mode: function mode(/*rate*/) {\n return 0;\n },\n\n sample: function sample(rate) {\n return -1 / rate * Math.log(jStat._random_fn());\n },\n\n variance : function(rate) {\n return Math.pow(rate, -2);\n }\n});\n\n\n\n// extend gamma function with static methods\njStat.extend(jStat.gamma, {\n pdf: function pdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return (x === 0 && shape === 1) ? 1 / scale :\n Math.exp((shape - 1) * Math.log(x) - x / scale -\n jStat.gammaln(shape) - shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x < 0)\n return 0;\n return jStat.lowRegGamma(shape, x / scale);\n },\n\n inv: function(p, shape, scale) {\n return jStat.gammapinv(p, shape) * scale;\n },\n\n mean : function(shape, scale) {\n return shape * scale;\n },\n\n mode: function mode(shape, scale) {\n if(shape > 1) return (shape - 1) * scale;\n return undefined;\n },\n\n sample: function sample(shape, scale) {\n return jStat.randg(shape) * scale;\n },\n\n variance: function variance(shape, scale) {\n return shape * scale * scale;\n }\n});\n\n// extend inverse gamma function with static methods\njStat.extend(jStat.invgamma, {\n pdf: function pdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return Math.exp(-(shape + 1) * Math.log(x) - scale / x -\n jStat.gammaln(shape) + shape * Math.log(scale));\n },\n\n cdf: function cdf(x, shape, scale) {\n if (x <= 0)\n return 0;\n return 1 - jStat.lowRegGamma(shape, scale / x);\n },\n\n inv: function(p, shape, scale) {\n return scale / jStat.gammapinv(1 - p, shape);\n },\n\n mean : function(shape, scale) {\n return (shape > 1) ? scale / (shape - 1) : undefined;\n },\n\n mode: function mode(shape, scale) {\n return scale / (shape + 1);\n },\n\n sample: function sample(shape, scale) {\n return scale / jStat.randg(shape);\n },\n\n variance: function variance(shape, scale) {\n if (shape <= 2)\n return undefined;\n return scale * scale / ((shape - 1) * (shape - 1) * (shape - 2));\n }\n});\n\n\n// extend kumaraswamy function with static methods\njStat.extend(jStat.kumaraswamy, {\n pdf: function pdf(x, alpha, beta) {\n if (x === 0 && alpha === 1)\n return beta;\n else if (x === 1 && beta === 1)\n return alpha;\n return Math.exp(Math.log(alpha) + Math.log(beta) + (alpha - 1) *\n Math.log(x) + (beta - 1) *\n Math.log(1 - Math.pow(x, alpha)));\n },\n\n cdf: function cdf(x, alpha, beta) {\n if (x < 0)\n return 0;\n else if (x > 1)\n return 1;\n return (1 - Math.pow(1 - Math.pow(x, alpha), beta));\n },\n\n inv: function inv(p, alpha, beta) {\n return Math.pow(1 - Math.pow(1 - p, 1 / beta), 1 / alpha);\n },\n\n mean : function(alpha, beta) {\n return (beta * jStat.gammafn(1 + 1 / alpha) *\n jStat.gammafn(beta)) / (jStat.gammafn(1 + 1 / alpha + beta));\n },\n\n median: function median(alpha, beta) {\n return Math.pow(1 - Math.pow(2, -1 / beta), 1 / alpha);\n },\n\n mode: function mode(alpha, beta) {\n if (!(alpha >= 1 && beta >= 1 && (alpha !== 1 && beta !== 1)))\n return undefined;\n return Math.pow((alpha - 1) / (alpha * beta - 1), 1 / alpha);\n },\n\n variance: function variance(/*alpha, beta*/) {\n throw new Error('variance not yet implemented');\n // TODO: complete this\n }\n});\n\n\n\n// extend lognormal function with static methods\njStat.extend(jStat.lognormal, {\n pdf: function pdf(x, mu, sigma) {\n if (x <= 0)\n return 0;\n return Math.exp(-Math.log(x) - 0.5 * Math.log(2 * Math.PI) -\n Math.log(sigma) - Math.pow(Math.log(x) - mu, 2) /\n (2 * sigma * sigma));\n },\n\n cdf: function cdf(x, mu, sigma) {\n if (x < 0)\n return 0;\n return 0.5 +\n (0.5 * jStat.erf((Math.log(x) - mu) / Math.sqrt(2 * sigma * sigma)));\n },\n\n inv: function(p, mu, sigma) {\n return Math.exp(-1.41421356237309505 * sigma * jStat.erfcinv(2 * p) + mu);\n },\n\n mean: function mean(mu, sigma) {\n return Math.exp(mu + sigma * sigma / 2);\n },\n\n median: function median(mu/*, sigma*/) {\n return Math.exp(mu);\n },\n\n mode: function mode(mu, sigma) {\n return Math.exp(mu - sigma * sigma);\n },\n\n sample: function sample(mu, sigma) {\n return Math.exp(jStat.randn() * sigma + mu);\n },\n\n variance: function variance(mu, sigma) {\n return (Math.exp(sigma * sigma) - 1) * Math.exp(2 * mu + sigma * sigma);\n }\n});\n\n\n\n// extend noncentralt function with static methods\njStat.extend(jStat.noncentralt, {\n pdf: function pdf(x, dof, ncp) {\n var tol = 1e-14;\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.pdf(x, dof)\n\n if (Math.abs(x) < tol) { // different formula for x == 0\n return Math.exp(jStat.gammaln((dof + 1) / 2) - ncp * ncp / 2 -\n 0.5 * Math.log(Math.PI * dof) - jStat.gammaln(dof / 2));\n }\n\n // formula for x != 0\n return dof / x *\n (jStat.noncentralt.cdf(x * Math.sqrt(1 + 2 / dof), dof+2, ncp) -\n jStat.noncentralt.cdf(x, dof, ncp));\n },\n\n cdf: function cdf(x, dof, ncp) {\n var tol = 1e-14;\n var min_iterations = 200;\n\n if (Math.abs(ncp) < tol) // ncp approx 0; use student-t\n return jStat.studentt.cdf(x, dof);\n\n // turn negative x into positive and flip result afterwards\n var flip = false;\n if (x < 0) {\n flip = true;\n ncp = -ncp;\n }\n\n var prob = jStat.normal.cdf(-ncp, 0, 1);\n var value = tol + 1;\n // use value at last two steps to determine convergence\n var lastvalue = value;\n var y = x * x / (x * x + dof);\n var j = 0;\n var p = Math.exp(-ncp * ncp / 2);\n var q = Math.exp(-ncp * ncp / 2 - 0.5 * Math.log(2) -\n jStat.gammaln(3 / 2)) * ncp;\n while (j < min_iterations || lastvalue > tol || value > tol) {\n lastvalue = value;\n if (j > 0) {\n p *= (ncp * ncp) / (2 * j);\n q *= (ncp * ncp) / (2 * (j + 1 / 2));\n }\n value = p * jStat.beta.cdf(y, j + 0.5, dof / 2) +\n q * jStat.beta.cdf(y, j+1, dof/2);\n prob += 0.5 * value;\n j++;\n }\n\n return flip ? (1 - prob) : prob;\n }\n});\n\n\n// extend normal function with static methods\njStat.extend(jStat.normal, {\n pdf: function pdf(x, mean, std) {\n return Math.exp(-0.5 * Math.log(2 * Math.PI) -\n Math.log(std) - Math.pow(x - mean, 2) / (2 * std * std));\n },\n\n cdf: function cdf(x, mean, std) {\n return 0.5 * (1 + jStat.erf((x - mean) / Math.sqrt(2 * std * std)));\n },\n\n inv: function(p, mean, std) {\n return -1.41421356237309505 * std * jStat.erfcinv(2 * p) + mean;\n },\n\n mean : function(mean/*, std*/) {\n return mean;\n },\n\n median: function median(mean/*, std*/) {\n return mean;\n },\n\n mode: function (mean/*, std*/) {\n return mean;\n },\n\n sample: function sample(mean, std) {\n return jStat.randn() * std + mean;\n },\n\n variance : function(mean, std) {\n return std * std;\n }\n});\n\n\n\n// extend pareto function with static methods\njStat.extend(jStat.pareto, {\n pdf: function pdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return (shape * Math.pow(scale, shape)) / Math.pow(x, shape + 1);\n },\n\n cdf: function cdf(x, scale, shape) {\n if (x < scale)\n return 0;\n return 1 - Math.pow(scale / x, shape);\n },\n\n inv: function inv(p, scale, shape) {\n return scale / Math.pow(1 - p, 1 / shape);\n },\n\n mean: function mean(scale, shape) {\n if (shape <= 1)\n return undefined;\n return (shape * Math.pow(scale, shape)) / (shape - 1);\n },\n\n median: function median(scale, shape) {\n return scale * (shape * Math.SQRT2);\n },\n\n mode: function mode(scale/*, shape*/) {\n return scale;\n },\n\n variance : function(scale, shape) {\n if (shape <= 2)\n return undefined;\n return (scale*scale * shape) / (Math.pow(shape - 1, 2) * (shape - 2));\n }\n});\n\n\n\n// extend studentt function with static methods\njStat.extend(jStat.studentt, {\n pdf: function pdf(x, dof) {\n dof = dof > 1e100 ? 1e100 : dof;\n return (1/(Math.sqrt(dof) * jStat.betafn(0.5, dof/2))) *\n Math.pow(1 + ((x * x) / dof), -((dof + 1) / 2));\n },\n\n cdf: function cdf(x, dof) {\n var dof2 = dof / 2;\n return jStat.ibeta((x + Math.sqrt(x * x + dof)) /\n (2 * Math.sqrt(x * x + dof)), dof2, dof2);\n },\n\n inv: function(p, dof) {\n var x = jStat.ibetainv(2 * Math.min(p, 1 - p), 0.5 * dof, 0.5);\n x = Math.sqrt(dof * (1 - x) / x);\n return (p > 0.5) ? x : -x;\n },\n\n mean: function mean(dof) {\n return (dof > 1) ? 0 : undefined;\n },\n\n median: function median(/*dof*/) {\n return 0;\n },\n\n mode: function mode(/*dof*/) {\n return 0;\n },\n\n sample: function sample(dof) {\n return jStat.randn() * Math.sqrt(dof / (2 * jStat.randg(dof / 2)));\n },\n\n variance: function variance(dof) {\n return (dof > 2) ? dof / (dof - 2) : (dof > 1) ? Infinity : undefined;\n }\n});\n\n\n\n// extend weibull function with static methods\njStat.extend(jStat.weibull, {\n pdf: function pdf(x, scale, shape) {\n if (x < 0 || scale < 0 || shape < 0)\n return 0;\n return (shape / scale) * Math.pow((x / scale), (shape - 1)) *\n Math.exp(-(Math.pow((x / scale), shape)));\n },\n\n cdf: function cdf(x, scale, shape) {\n return x < 0 ? 0 : 1 - Math.exp(-Math.pow((x / scale), shape));\n },\n\n inv: function(p, scale, shape) {\n return scale * Math.pow(-Math.log(1 - p), 1 / shape);\n },\n\n mean : function(scale, shape) {\n return scale * jStat.gammafn(1 + 1 / shape);\n },\n\n median: function median(scale, shape) {\n return scale * Math.pow(Math.log(2), 1 / shape);\n },\n\n mode: function mode(scale, shape) {\n if (shape <= 1)\n return 0;\n return scale * Math.pow((shape - 1) / shape, 1 / shape);\n },\n\n sample: function sample(scale, shape) {\n return scale * Math.pow(-Math.log(jStat._random_fn()), 1 / shape);\n },\n\n variance: function variance(scale, shape) {\n return scale * scale * jStat.gammafn(1 + 2 / shape) -\n Math.pow(jStat.weibull.mean(scale, shape), 2);\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.uniform, {\n pdf: function pdf(x, a, b) {\n return (x < a || x > b) ? 0 : 1 / (b - a);\n },\n\n cdf: function cdf(x, a, b) {\n if (x < a)\n return 0;\n else if (x < b)\n return (x - a) / (b - a);\n return 1;\n },\n\n inv: function(p, a, b) {\n return a + (p * (b - a));\n },\n\n mean: function mean(a, b) {\n return 0.5 * (a + b);\n },\n\n median: function median(a, b) {\n return jStat.mean(a, b);\n },\n\n mode: function mode(/*a, b*/) {\n throw new Error('mode is not yet implemented');\n },\n\n sample: function sample(a, b) {\n return (a / 2 + b / 2) + (b / 2 - a / 2) * (2 * jStat._random_fn() - 1);\n },\n\n variance: function variance(a, b) {\n return Math.pow(b - a, 2) / 12;\n }\n});\n\n\n// Got this from http://www.math.ucla.edu/~tom/distributions/binomial.html\nfunction betinc(x, a, b, eps) {\n var a0 = 0;\n var b0 = 1;\n var a1 = 1;\n var b1 = 1;\n var m9 = 0;\n var a2 = 0;\n var c9;\n\n while (Math.abs((a1 - a2) / a1) > eps) {\n a2 = a1;\n c9 = -(a + m9) * (a + b + m9) * x / (a + 2 * m9) / (a + 2 * m9 + 1);\n a0 = a1 + c9 * a0;\n b0 = b1 + c9 * b0;\n m9 = m9 + 1;\n c9 = m9 * (b - m9) * x / (a + 2 * m9 - 1) / (a + 2 * m9);\n a1 = a0 + c9 * a1;\n b1 = b0 + c9 * b1;\n a0 = a0 / b1;\n b0 = b0 / b1;\n a1 = a1 / b1;\n b1 = 1;\n }\n\n return a1 / a;\n}\n\n\n// extend uniform function with static methods\njStat.extend(jStat.binomial, {\n pdf: function pdf(k, n, p) {\n return (p === 0 || p === 1) ?\n ((n * p) === k ? 1 : 0) :\n jStat.combination(n, k) * Math.pow(p, k) * Math.pow(1 - p, n - k);\n },\n\n cdf: function cdf(x, n, p) {\n var betacdf;\n var eps = 1e-10;\n\n if (x < 0)\n return 0;\n if (x >= n)\n return 1;\n if (p < 0 || p > 1 || n <= 0)\n return NaN;\n\n x = Math.floor(x);\n var z = p;\n var a = x + 1;\n var b = n - x;\n var s = a + b;\n var bt = Math.exp(jStat.gammaln(s) - jStat.gammaln(b) -\n jStat.gammaln(a) + a * Math.log(z) + b * Math.log(1 - z));\n\n if (z < (a + 1) / (s + 2))\n betacdf = bt * betinc(z, a, b, eps);\n else\n betacdf = 1 - bt * betinc(1 - z, b, a, eps);\n\n return Math.round((1 - betacdf) * (1 / eps)) / (1 / eps);\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.negbin, {\n pdf: function pdf(k, r, p) {\n if (k !== k >>> 0)\n return false;\n if (k < 0)\n return 0;\n return jStat.combination(k + r - 1, r - 1) *\n Math.pow(1 - p, k) * Math.pow(p, r);\n },\n\n cdf: function cdf(x, r, p) {\n var sum = 0,\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sum += jStat.negbin.pdf(k, r, p);\n }\n return sum;\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.hypgeom, {\n pdf: function pdf(k, N, m, n) {\n // Hypergeometric PDF.\n\n // A simplification of the CDF algorithm below.\n\n // k = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(k !== k | 0) {\n return false;\n } else if(k < 0 || k < m - (N - n)) {\n // It's impossible to have this few successes drawn.\n return 0;\n } else if(k > n || k > m) {\n // It's impossible to have this many successes drawn.\n return 0;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.pdf(N - m - n + k, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return jStat.hypgeom.pdf(n - k, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return jStat.hypgeom.pdf(m - k, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.pdf(k, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate product to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < k; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledPDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n scaledPDF *= 1 - (m / (N - samplesDone));\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledPDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledPDF));\n }\n },\n\n cdf: function cdf(x, N, m, n) {\n // Hypergeometric CDF.\n\n // This algorithm is due to Prof. Thomas S. Ferguson, ,\n // and comes from his hypergeometric test calculator at\n // .\n\n // x = number of successes drawn\n // N = population size\n // m = number of successes in population\n // n = number of items drawn from population\n\n if(x < 0 || x < m - (N - n)) {\n // It's impossible to have this few successes drawn or fewer.\n return 0;\n } else if(x >= n || x >= m) {\n // We will always have this many successes or fewer.\n return 1;\n } else if (m * 2 > N) {\n // More than half the population is successes.\n\n if(n * 2 > N) {\n // More than half the population is sampled.\n\n return jStat.hypgeom.cdf(N - m - n + x, N, N - m, N - n)\n } else {\n // Half or less of the population is sampled.\n\n return 1 - jStat.hypgeom.cdf(n - x - 1, N, N - m, n);\n }\n\n } else if(n * 2 > N) {\n // Half or less is successes.\n\n return 1 - jStat.hypgeom.cdf(m - x - 1, N, m, N - n);\n\n } else if(m < n) {\n // We want to have the number of things sampled to be less than the\n // successes available. So swap the definitions of successful and sampled.\n return jStat.hypgeom.cdf(x, N, n, m);\n } else {\n // If we get here, half or less of the population was sampled, half or\n // less of it was successes, and we had fewer sampled things than\n // successes. Now we can do this complicated iterative algorithm in an\n // efficient way.\n\n // The basic premise of the algorithm is that we partially normalize our\n // intermediate sum to keep it in a numerically good region, and then\n // finish the normalization at the end.\n\n // Holds the intermediate, scaled total CDF.\n var scaledCDF = 1;\n\n // This variable holds the scaled probability of the current number of\n // successes.\n var scaledPDF = 1;\n\n // This keeps track of how much we have normalized.\n var samplesDone = 0;\n\n for(var i = 0; i < x; i++) {\n // For every possible number of successes up to that observed...\n\n while(scaledCDF > 1 && samplesDone < n) {\n // Intermediate result is growing too big. Apply some of the\n // normalization to shrink everything.\n\n var factor = 1 - (m / (N - samplesDone));\n\n scaledPDF *= factor;\n scaledCDF *= factor;\n\n // Say we've normalized by this sample already.\n samplesDone++;\n }\n\n // Work out the partially-normalized hypergeometric PDF for the next\n // number of successes\n scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));\n\n // Add to the CDF answer.\n scaledCDF += scaledPDF;\n }\n\n for(; samplesDone < n; samplesDone++) {\n // Apply all the rest of the normalization\n scaledCDF *= 1 - (m / (N - samplesDone));\n }\n\n // Bound answer sanely before returning.\n return Math.min(1, Math.max(0, scaledCDF));\n }\n }\n});\n\n\n\n// extend uniform function with static methods\njStat.extend(jStat.poisson, {\n pdf: function pdf(k, l) {\n if (l < 0 || (k % 1) !== 0 || k < 0) {\n return 0;\n }\n\n return Math.pow(l, k) * Math.exp(-l) / jStat.factorial(k);\n },\n\n cdf: function cdf(x, l) {\n var sumarr = [],\n k = 0;\n if (x < 0) return 0;\n for (; k <= x; k++) {\n sumarr.push(jStat.poisson.pdf(k, l));\n }\n return jStat.sum(sumarr);\n },\n\n mean : function(l) {\n return l;\n },\n\n variance : function(l) {\n return l;\n },\n\n sampleSmall: function sampleSmall(l) {\n var p = 1, k = 0, L = Math.exp(-l);\n do {\n k++;\n p *= jStat._random_fn();\n } while (p > L);\n return k - 1;\n },\n\n sampleLarge: function sampleLarge(l) {\n var lam = l;\n var k;\n var U, V, slam, loglam, a, b, invalpha, vr, us;\n\n slam = Math.sqrt(lam);\n loglam = Math.log(lam);\n b = 0.931 + 2.53 * slam;\n a = -0.059 + 0.02483 * b;\n invalpha = 1.1239 + 1.1328 / (b - 3.4);\n vr = 0.9277 - 3.6224 / (b - 2);\n\n while (1) {\n U = Math.random() - 0.5;\n V = Math.random();\n us = 0.5 - Math.abs(U);\n k = Math.floor((2 * a / us + b) * U + lam + 0.43);\n if ((us >= 0.07) && (V <= vr)) {\n return k;\n }\n if ((k < 0) || ((us < 0.013) && (V > us))) {\n continue;\n }\n /* log(V) == log(0.0) ok here */\n /* if U==0.0 so that us==0.0, log is ok since always returns */\n if ((Math.log(V) + Math.log(invalpha) - Math.log(a / (us * us) + b)) <= (-lam + k * loglam - jStat.loggam(k + 1))) {\n return k;\n }\n }\n },\n\n sample: function sample(l) {\n if (l < 10)\n return this.sampleSmall(l);\n else\n return this.sampleLarge(l);\n }\n});\n\n// extend triangular function with static methods\njStat.extend(jStat.triangular, {\n pdf: function pdf(x, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (x < a || x > b) {\n return 0;\n } else if (x < c) {\n return (2 * (x - a)) / ((b - a) * (c - a));\n } else if (x === c) {\n return (2 / (b - a));\n } else { // x > c\n return (2 * (b - x)) / ((b - a) * (b - c));\n }\n }\n },\n\n cdf: function cdf(x, a, b, c) {\n if (b <= a || c < a || c > b)\n return NaN;\n if (x <= a)\n return 0;\n else if (x >= b)\n return 1;\n if (x <= c)\n return Math.pow(x - a, 2) / ((b - a) * (c - a));\n else // x > c\n return 1 - Math.pow(b - x, 2) / ((b - a) * (b - c));\n },\n\n inv: function inv(p, a, b, c) {\n if (b <= a || c < a || c > b) {\n return NaN;\n } else {\n if (p <= ((c - a) / (b - a))) {\n return a + (b - a) * Math.sqrt(p * ((c - a) / (b - a)));\n } else { // p > ((c - a) / (b - a))\n return a + (b - a) * (1 - Math.sqrt((1 - p) * (1 - ((c - a) / (b - a)))));\n }\n }\n },\n\n mean: function mean(a, b, c) {\n return (a + b + c) / 3;\n },\n\n median: function median(a, b, c) {\n if (c <= (a + b) / 2) {\n return b - Math.sqrt((b - a) * (b - c)) / Math.sqrt(2);\n } else if (c > (a + b) / 2) {\n return a + Math.sqrt((b - a) * (c - a)) / Math.sqrt(2);\n }\n },\n\n mode: function mode(a, b, c) {\n return c;\n },\n\n sample: function sample(a, b, c) {\n var u = jStat._random_fn();\n if (u < ((c - a) / (b - a)))\n return a + Math.sqrt(u * (b - a) * (c - a))\n return b - Math.sqrt((1 - u) * (b - a) * (b - c));\n },\n\n variance: function variance(a, b, c) {\n return (a * a + b * b + c * c - a * b - a * c - b * c) / 18;\n }\n});\n\n\n// extend arcsine function with static methods\njStat.extend(jStat.arcsine, {\n pdf: function pdf(x, a, b) {\n if (b <= a) return NaN;\n\n return (x <= a || x >= b) ? 0 :\n (2 / Math.PI) *\n Math.pow(Math.pow(b - a, 2) -\n Math.pow(2 * x - a - b, 2), -0.5);\n },\n\n cdf: function cdf(x, a, b) {\n if (x < a)\n return 0;\n else if (x < b)\n return (2 / Math.PI) * Math.asin(Math.sqrt((x - a)/(b - a)));\n return 1;\n },\n\n inv: function(p, a, b) {\n return a + (0.5 - 0.5 * Math.cos(Math.PI * p)) * (b - a);\n },\n\n mean: function mean(a, b) {\n if (b <= a) return NaN;\n return (a + b) / 2;\n },\n\n median: function median(a, b) {\n if (b <= a) return NaN;\n return (a + b) / 2;\n },\n\n mode: function mode(/*a, b*/) {\n throw new Error('mode is not yet implemented');\n },\n\n sample: function sample(a, b) {\n return ((a + b) / 2) + ((b - a) / 2) *\n Math.sin(2 * Math.PI * jStat.uniform.sample(0, 1));\n },\n\n variance: function variance(a, b) {\n if (b <= a) return NaN;\n return Math.pow(b - a, 2) / 8;\n }\n});\n\n\nfunction laplaceSign(x) { return x / Math.abs(x); }\n\njStat.extend(jStat.laplace, {\n pdf: function pdf(x, mu, b) {\n return (b <= 0) ? 0 : (Math.exp(-Math.abs(x - mu) / b)) / (2 * b);\n },\n\n cdf: function cdf(x, mu, b) {\n if (b <= 0) { return 0; }\n\n if(x < mu) {\n return 0.5 * Math.exp((x - mu) / b);\n } else {\n return 1 - 0.5 * Math.exp(- (x - mu) / b);\n }\n },\n\n mean: function(mu/*, b*/) {\n return mu;\n },\n\n median: function(mu/*, b*/) {\n return mu;\n },\n\n mode: function(mu/*, b*/) {\n return mu;\n },\n\n variance: function(mu, b) {\n return 2 * b * b;\n },\n\n sample: function sample(mu, b) {\n var u = jStat._random_fn() - 0.5;\n\n return mu - (b * laplaceSign(u) * Math.log(1 - (2 * Math.abs(u))));\n }\n});\n\nfunction tukeyWprob(w, rr, cc) {\n var nleg = 12;\n var ihalf = 6;\n\n var C1 = -30;\n var C2 = -50;\n var C3 = 60;\n var bb = 8;\n var wlar = 3;\n var wincr1 = 2;\n var wincr2 = 3;\n var xleg = [\n 0.981560634246719250690549090149,\n 0.904117256370474856678465866119,\n 0.769902674194304687036893833213,\n 0.587317954286617447296702418941,\n 0.367831498998180193752691536644,\n 0.125233408511468915472441369464\n ];\n var aleg = [\n 0.047175336386511827194615961485,\n 0.106939325995318430960254718194,\n 0.160078328543346226334652529543,\n 0.203167426723065921749064455810,\n 0.233492536538354808760849898925,\n 0.249147045813402785000562436043\n ];\n\n var qsqz = w * 0.5;\n\n // if w >= 16 then the integral lower bound (occurs for c=20)\n // is 0.99999999999995 so return a value of 1.\n\n if (qsqz >= bb)\n return 1.0;\n\n // find (f(w/2) - 1) ^ cc\n // (first term in integral of hartley's form).\n\n var pr_w = 2 * jStat.normal.cdf(qsqz, 0, 1, 1, 0) - 1; // erf(qsqz / M_SQRT2)\n // if pr_w ^ cc < 2e-22 then set pr_w = 0\n if (pr_w >= Math.exp(C2 / cc))\n pr_w = Math.pow(pr_w, cc);\n else\n pr_w = 0.0;\n\n // if w is large then the second component of the\n // integral is small, so fewer intervals are needed.\n\n var wincr;\n if (w > wlar)\n wincr = wincr1;\n else\n wincr = wincr2;\n\n // find the integral of second term of hartley's form\n // for the integral of the range for equal-length\n // intervals using legendre quadrature. limits of\n // integration are from (w/2, 8). two or three\n // equal-length intervals are used.\n\n // blb and bub are lower and upper limits of integration.\n\n var blb = qsqz;\n var binc = (bb - qsqz) / wincr;\n var bub = blb + binc;\n var einsum = 0.0;\n\n // integrate over each interval\n\n var cc1 = cc - 1.0;\n for (var wi = 1; wi <= wincr; wi++) {\n var elsum = 0.0;\n var a = 0.5 * (bub + blb);\n\n // legendre quadrature with order = nleg\n\n var b = 0.5 * (bub - blb);\n\n for (var jj = 1; jj <= nleg; jj++) {\n var j, xx;\n if (ihalf < jj) {\n j = (nleg - jj) + 1;\n xx = xleg[j-1];\n } else {\n j = jj;\n xx = -xleg[j-1];\n }\n var c = b * xx;\n var ac = a + c;\n\n // if exp(-qexpo/2) < 9e-14,\n // then doesn't contribute to integral\n\n var qexpo = ac * ac;\n if (qexpo > C3)\n break;\n\n var pplus = 2 * jStat.normal.cdf(ac, 0, 1, 1, 0);\n var pminus= 2 * jStat.normal.cdf(ac, w, 1, 1, 0);\n\n // if rinsum ^ (cc-1) < 9e-14,\n // then doesn't contribute to integral\n\n var rinsum = (pplus * 0.5) - (pminus * 0.5);\n if (rinsum >= Math.exp(C1 / cc1)) {\n rinsum = (aleg[j-1] * Math.exp(-(0.5 * qexpo))) * Math.pow(rinsum, cc1);\n elsum += rinsum;\n }\n }\n elsum *= (((2.0 * b) * cc) / Math.sqrt(2 * Math.PI));\n einsum += elsum;\n blb = bub;\n bub += binc;\n }\n\n // if pr_w ^ rr < 9e-14, then return 0\n pr_w += einsum;\n if (pr_w <= Math.exp(C1 / rr))\n return 0;\n\n pr_w = Math.pow(pr_w, rr);\n if (pr_w >= 1) // 1 was iMax was eps\n return 1;\n return pr_w;\n}\n\nfunction tukeyQinv(p, c, v) {\n var p0 = 0.322232421088;\n var q0 = 0.993484626060e-01;\n var p1 = -1.0;\n var q1 = 0.588581570495;\n var p2 = -0.342242088547;\n var q2 = 0.531103462366;\n var p3 = -0.204231210125;\n var q3 = 0.103537752850;\n var p4 = -0.453642210148e-04;\n var q4 = 0.38560700634e-02;\n var c1 = 0.8832;\n var c2 = 0.2368;\n var c3 = 1.214;\n var c4 = 1.208;\n var c5 = 1.4142;\n var vmax = 120.0;\n\n var ps = 0.5 - 0.5 * p;\n var yi = Math.sqrt(Math.log(1.0 / (ps * ps)));\n var t = yi + (((( yi * p4 + p3) * yi + p2) * yi + p1) * yi + p0)\n / (((( yi * q4 + q3) * yi + q2) * yi + q1) * yi + q0);\n if (v < vmax) t += (t * t * t + t) / v / 4.0;\n var q = c1 - c2 * t;\n if (v < vmax) q += -c3 / v + c4 * t / v;\n return t * (q * Math.log(c - 1.0) + c5);\n}\n\njStat.extend(jStat.tukey, {\n cdf: function cdf(q, nmeans, df) {\n // Identical implementation as the R ptukey() function as of commit 68947\n var rr = 1;\n var cc = nmeans;\n\n var nlegq = 16;\n var ihalfq = 8;\n\n var eps1 = -30.0;\n var eps2 = 1.0e-14;\n var dhaf = 100.0;\n var dquar = 800.0;\n var deigh = 5000.0;\n var dlarg = 25000.0;\n var ulen1 = 1.0;\n var ulen2 = 0.5;\n var ulen3 = 0.25;\n var ulen4 = 0.125;\n var xlegq = [\n 0.989400934991649932596154173450,\n 0.944575023073232576077988415535,\n 0.865631202387831743880467897712,\n 0.755404408355003033895101194847,\n 0.617876244402643748446671764049,\n 0.458016777657227386342419442984,\n 0.281603550779258913230460501460,\n 0.950125098376374401853193354250e-1\n ];\n var alegq = [\n 0.271524594117540948517805724560e-1,\n 0.622535239386478928628438369944e-1,\n 0.951585116824927848099251076022e-1,\n 0.124628971255533872052476282192,\n 0.149595988816576732081501730547,\n 0.169156519395002538189312079030,\n 0.182603415044923588866763667969,\n 0.189450610455068496285396723208\n ];\n\n if (q <= 0)\n return 0;\n\n // df must be > 1\n // there must be at least two values\n\n if (df < 2 || rr < 1 || cc < 2) return NaN;\n\n if (!Number.isFinite(q))\n return 1;\n\n if (df > dlarg)\n return tukeyWprob(q, rr, cc);\n\n // calculate leading constant\n\n var f2 = df * 0.5;\n var f2lf = ((f2 * Math.log(df)) - (df * Math.log(2))) - jStat.gammaln(f2);\n var f21 = f2 - 1.0;\n\n // integral is divided into unit, half-unit, quarter-unit, or\n // eighth-unit length intervals depending on the value of the\n // degrees of freedom.\n\n var ff4 = df * 0.25;\n var ulen;\n if (df <= dhaf) ulen = ulen1;\n else if (df <= dquar) ulen = ulen2;\n else if (df <= deigh) ulen = ulen3;\n else ulen = ulen4;\n\n f2lf += Math.log(ulen);\n\n // integrate over each subinterval\n\n var ans = 0.0;\n\n for (var i = 1; i <= 50; i++) {\n var otsum = 0.0;\n\n // legendre quadrature with order = nlegq\n // nodes (stored in xlegq) are symmetric around zero.\n\n var twa1 = (2 * i - 1) * ulen;\n\n for (var jj = 1; jj <= nlegq; jj++) {\n var j, t1;\n if (ihalfq < jj) {\n j = jj - ihalfq - 1;\n t1 = (f2lf + (f21 * Math.log(twa1 + (xlegq[j] * ulen))))\n - (((xlegq[j] * ulen) + twa1) * ff4);\n } else {\n j = jj - 1;\n t1 = (f2lf + (f21 * Math.log(twa1 - (xlegq[j] * ulen))))\n + (((xlegq[j] * ulen) - twa1) * ff4);\n }\n\n // if exp(t1) < 9e-14, then doesn't contribute to integral\n var qsqz;\n if (t1 >= eps1) {\n if (ihalfq < jj) {\n qsqz = q * Math.sqrt(((xlegq[j] * ulen) + twa1) * 0.5);\n } else {\n qsqz = q * Math.sqrt(((-(xlegq[j] * ulen)) + twa1) * 0.5);\n }\n\n // call wprob to find integral of range portion\n\n var wprb = tukeyWprob(qsqz, rr, cc);\n var rotsum = (wprb * alegq[j]) * Math.exp(t1);\n otsum += rotsum;\n }\n // end legendre integral for interval i\n // L200:\n }\n\n // if integral for interval i < 1e-14, then stop.\n // However, in order to avoid small area under left tail,\n // at least 1 / ulen intervals are calculated.\n if (i * ulen >= 1.0 && otsum <= eps2)\n break;\n\n // end of interval i\n // L330:\n\n ans += otsum;\n }\n\n if (otsum > eps2) { // not converged\n throw new Error('tukey.cdf failed to converge');\n }\n if (ans > 1)\n ans = 1;\n return ans;\n },\n\n inv: function(p, nmeans, df) {\n // Identical implementation as the R qtukey() function as of commit 68947\n var rr = 1;\n var cc = nmeans;\n\n var eps = 0.0001;\n var maxiter = 50;\n\n // df must be > 1 ; there must be at least two values\n if (df < 2 || rr < 1 || cc < 2) return NaN;\n\n if (p < 0 || p > 1) return NaN;\n if (p === 0) return 0;\n if (p === 1) return Infinity;\n\n // Initial value\n\n var x0 = tukeyQinv(p, cc, df);\n\n // Find prob(value < x0)\n\n var valx0 = jStat.tukey.cdf(x0, nmeans, df) - p;\n\n // Find the second iterate and prob(value < x1).\n // If the first iterate has probability value\n // exceeding p then second iterate is 1 less than\n // first iterate; otherwise it is 1 greater.\n\n var x1;\n if (valx0 > 0.0)\n x1 = Math.max(0.0, x0 - 1.0);\n else\n x1 = x0 + 1.0;\n var valx1 = jStat.tukey.cdf(x1, nmeans, df) - p;\n\n // Find new iterate\n\n var ans;\n for(var iter = 1; iter < maxiter; iter++) {\n ans = x1 - ((valx1 * (x1 - x0)) / (valx1 - valx0));\n valx0 = valx1;\n\n // New iterate must be >= 0\n\n x0 = x1;\n if (ans < 0.0) {\n ans = 0.0;\n valx1 = -p;\n }\n // Find prob(value < new iterate)\n\n valx1 = jStat.tukey.cdf(ans, nmeans, df) - p;\n x1 = ans;\n\n // If the difference between two successive\n // iterates is less than eps, stop\n\n var xabs = Math.abs(x1 - x0);\n if (xabs < eps)\n return ans;\n }\n\n throw new Error('tukey.inv failed to converge');\n }\n});\n\n}(jStat, Math));\n/* Provides functions for the solution of linear system of equations, integration, extrapolation,\n * interpolation, eigenvalue problems, differential equations and PCA analysis. */\n\n(function(jStat, Math) {\n\nvar push = Array.prototype.push;\nvar isArray = jStat.utils.isArray;\n\nfunction isUsable(arg) {\n return isArray(arg) || arg instanceof jStat;\n}\n\njStat.extend({\n\n // add a vector/matrix to a vector/matrix or scalar\n add: function add(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value + arg[row][col];\n });\n }\n return jStat.map(arr, function(value) { return value + arg; });\n },\n\n // subtract a vector or scalar from the vector\n subtract: function subtract(arr, arg) {\n // check if arg is a vector or scalar\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.map(arr, function(value, row, col) {\n return value - arg[row][col] || 0;\n });\n }\n return jStat.map(arr, function(value) { return value - arg; });\n },\n\n // matrix division\n divide: function divide(arr, arg) {\n if (isUsable(arg)) {\n if (!isUsable(arg[0])) arg = [ arg ];\n return jStat.multiply(arr, jStat.inv(arg));\n }\n return jStat.map(arr, function(value) { return value / arg; });\n },\n\n // matrix multiplication\n multiply: function multiply(arr, arg) {\n var row, col, nrescols, sum, nrow, ncol, res, rescols;\n // eg: arr = 2 arg = 3 -> 6 for res[0][0] statement closure\n if (arr.length === undefined && arg.length === undefined) {\n return arr * arg;\n }\n nrow = arr.length,\n ncol = arr[0].length,\n res = jStat.zeros(nrow, nrescols = (isUsable(arg)) ? arg[0].length : ncol),\n rescols = 0;\n if (isUsable(arg)) {\n for (; rescols < nrescols; rescols++) {\n for (row = 0; row < nrow; row++) {\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += arr[row][col] * arg[col][rescols];\n res[row][rescols] = sum;\n }\n }\n return (nrow === 1 && rescols === 1) ? res[0][0] : res;\n }\n return jStat.map(arr, function(value) { return value * arg; });\n },\n\n // outer([1,2,3],[4,5,6])\n // ===\n // [[1],[2],[3]] times [[4,5,6]]\n // ->\n // [[4,5,6],[8,10,12],[12,15,18]]\n outer:function outer(A, B) {\n return jStat.multiply(A.map(function(t){ return [t] }), [B]);\n },\n\n\n // Returns the dot product of two matricies\n dot: function dot(arr, arg) {\n if (!isUsable(arr[0])) arr = [ arr ];\n if (!isUsable(arg[0])) arg = [ arg ];\n // convert column to row vector\n var left = (arr[0].length === 1 && arr.length !== 1) ? jStat.transpose(arr) : arr,\n right = (arg[0].length === 1 && arg.length !== 1) ? jStat.transpose(arg) : arg,\n res = [],\n row = 0,\n nrow = left.length,\n ncol = left[0].length,\n sum, col;\n for (; row < nrow; row++) {\n res[row] = [];\n sum = 0;\n for (col = 0; col < ncol; col++)\n sum += left[row][col] * right[row][col];\n res[row] = sum;\n }\n return (res.length === 1) ? res[0] : res;\n },\n\n // raise every element by a scalar\n pow: function pow(arr, arg) {\n return jStat.map(arr, function(value) { return Math.pow(value, arg); });\n },\n\n // exponentiate every element\n exp: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.exp(value); });\n },\n\n // generate the natural log of every element\n log: function exp(arr) {\n return jStat.map(arr, function(value) { return Math.log(value); });\n },\n\n // generate the absolute values of the vector\n abs: function abs(arr) {\n return jStat.map(arr, function(value) { return Math.abs(value); });\n },\n\n // computes the p-norm of the vector\n // In the case that a matrix is passed, uses the first row as the vector\n norm: function norm(arr, p) {\n var nnorm = 0,\n i = 0;\n // check the p-value of the norm, and set for most common case\n if (isNaN(p)) p = 2;\n // check if multi-dimensional array, and make vector correction\n if (isUsable(arr[0])) arr = arr[0];\n // vector norm\n for (; i < arr.length; i++) {\n nnorm += Math.pow(Math.abs(arr[i]), p);\n }\n return Math.pow(nnorm, 1 / p);\n },\n\n // computes the angle between two vectors in rads\n // In case a matrix is passed, this uses the first row as the vector\n angle: function angle(arr, arg) {\n return Math.acos(jStat.dot(arr, arg) / (jStat.norm(arr) * jStat.norm(arg)));\n },\n\n // augment one matrix by another\n // Note: this function returns a matrix, not a jStat object\n aug: function aug(a, b) {\n var newarr = [];\n var i;\n for (i = 0; i < a.length; i++) {\n newarr.push(a[i].slice());\n }\n for (i = 0; i < newarr.length; i++) {\n push.apply(newarr[i], b[i]);\n }\n return newarr;\n },\n\n // The inv() function calculates the inverse of a matrix\n // Create the inverse by augmenting the matrix by the identity matrix of the\n // appropriate size, and then use G-J elimination on the augmented matrix.\n inv: function inv(a) {\n var rows = a.length;\n var cols = a[0].length;\n var b = jStat.identity(rows, cols);\n var c = jStat.gauss_jordan(a, b);\n var result = [];\n var i = 0;\n var j;\n\n //We need to copy the inverse portion to a new matrix to rid G-J artifacts\n for (; i < rows; i++) {\n result[i] = [];\n for (j = cols; j < c[0].length; j++)\n result[i][j - cols] = c[i][j];\n }\n return result;\n },\n\n // calculate the determinant of a matrix\n det: function det(a) {\n if (a.length === 2) {\n return a[0][0] * a[1][1] - a[0][1] * a[1][0];\n }\n\n var determinant = 0;\n for (var i = 0; i < a.length; i++) {\n // build a sub matrix without column `i`\n var submatrix = [];\n for (var row = 1; row < a.length; row++) {\n submatrix[row - 1] = [];\n for (var col = 0; col < a.length; col++) {\n if (col < i) {\n submatrix[row - 1][col] = a[row][col];\n } else if (col > i) {\n submatrix[row - 1][col - 1] = a[row][col];\n }\n }\n }\n\n // alternate between + and - between determinants\n var sign = i % 2 ? -1 : 1;\n determinant += det(submatrix) * a[0][i] * sign;\n }\n\n return determinant\n },\n\n gauss_elimination: function gauss_elimination(a, b) {\n var i = 0,\n j = 0,\n n = a.length,\n m = a[0].length,\n factor = 1,\n sum = 0,\n x = [],\n maug, pivot, temp, k;\n a = jStat.aug(a, b);\n maug = a[0].length;\n for(i = 0; i < n; i++) {\n pivot = a[i][i];\n j = i;\n for (k = i + 1; k < m; k++) {\n if (pivot < Math.abs(a[k][i])) {\n pivot = a[k][i];\n j = k;\n }\n }\n if (j != i) {\n for(k = 0; k < maug; k++) {\n temp = a[i][k];\n a[i][k] = a[j][k];\n a[j][k] = temp;\n }\n }\n for (j = i + 1; j < n; j++) {\n factor = a[j][i] / a[i][i];\n for(k = i; k < maug; k++) {\n a[j][k] = a[j][k] - factor * a[i][k];\n }\n }\n }\n for (i = n - 1; i >= 0; i--) {\n sum = 0;\n for (j = i + 1; j<= n - 1; j++) {\n sum = sum + x[j] * a[i][j];\n }\n x[i] =(a[i][maug - 1] - sum) / a[i][i];\n }\n return x;\n },\n\n gauss_jordan: function gauss_jordan(a, b) {\n var m = jStat.aug(a, b);\n var h = m.length;\n var w = m[0].length;\n var c = 0;\n var x, y, y2;\n // find max pivot\n for (y = 0; y < h; y++) {\n var maxrow = y;\n for (y2 = y+1; y2 < h; y2++) {\n if (Math.abs(m[y2][y]) > Math.abs(m[maxrow][y]))\n maxrow = y2;\n }\n var tmp = m[y];\n m[y] = m[maxrow];\n m[maxrow] = tmp\n for (y2 = y+1; y2 < h; y2++) {\n c = m[y2][y] / m[y][y];\n for (x = y; x < w; x++) {\n m[y2][x] -= m[y][x] * c;\n }\n }\n }\n // backsubstitute\n for (y = h-1; y >= 0; y--) {\n c = m[y][y];\n for (y2 = 0; y2 < y; y2++) {\n for (x = w-1; x > y-1; x--) {\n m[y2][x] -= m[y][x] * m[y2][y] / c;\n }\n }\n m[y][y] /= c;\n for (x = h; x < w; x++) {\n m[y][x] /= c;\n }\n }\n return m;\n },\n\n // solve equation\n // Ax=b\n // A is upper triangular matrix\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[1,2,3]\n // triaUpSolve(A,b) // -> [2.666,0.1666,1.666]\n // if you use matrix style\n // A=[[1,2,3],[0,4,5],[0,6,7]]\n // b=[[1],[2],[3]]\n // will return [[2.666],[0.1666],[1.666]]\n triaUpSolve: function triaUpSolve(A, b) {\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n var matrix_mode = false;\n\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n parts = jStat.arange(i + 1, size).map(function(j) {\n return x[j] * A[i][j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n });\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n triaLowSolve: function triaLowSolve(A, b) {\n // like to triaUpSolve but A is lower triangular matrix\n var size = A[0].length;\n var x = jStat.zeros(1, size)[0];\n var parts;\n\n var matrix_mode=false;\n if (b[0].length != undefined) {\n b = b.map(function(i){ return i[0] });\n matrix_mode = true;\n }\n\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(j) {\n return A[i][j] * x[j];\n });\n x[i] = (b[i] - jStat.sum(parts)) / A[i][i];\n })\n\n if (matrix_mode)\n return x.map(function(i){ return [i] });\n return x;\n },\n\n\n // A -> [L,U]\n // A=LU\n // L is lower triangular matrix\n // U is upper triangular matrix\n lu: function lu(A) {\n var size = A.length;\n //var L=jStat.diagonal(jStat.ones(1,size)[0]);\n var L = jStat.identity(size);\n var R = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(t) {\n R[0][t] = A[0][t];\n });\n jStat.arange(1, size).forEach(function(l) {\n jStat.arange(l).forEach(function(i) {\n parts = jStat.arange(i).map(function(jj) {\n return L[l][jj] * R[jj][i];\n });\n L[l][i] = (A[l][i] - jStat.sum(parts)) / R[i][i];\n });\n jStat.arange(l, size).forEach(function(j) {\n parts = jStat.arange(l).map(function(jj) {\n return L[l][jj] * R[jj][j];\n });\n R[l][j] = A[parts.length][j] - jStat.sum(parts);\n });\n });\n return [L, R];\n },\n\n // A -> T\n // A=TT'\n // T is lower triangular matrix\n cholesky: function cholesky(A) {\n var size = A.length;\n var T = jStat.zeros(A.length, A[0].length);\n var parts;\n jStat.arange(size).forEach(function(i) {\n parts = jStat.arange(i).map(function(t) {\n return Math.pow(T[i][t],2);\n });\n T[i][i] = Math.sqrt(A[i][i] - jStat.sum(parts));\n jStat.arange(i + 1, size).forEach(function(j) {\n parts = jStat.arange(i).map(function(t) {\n return T[i][t] * T[j][t];\n });\n T[j][i] = (A[i][j] - jStat.sum(parts)) / T[i][i];\n });\n });\n return T;\n },\n\n\n gauss_jacobi: function gauss_jacobi(a, b, x, r) {\n var i = 0;\n var j = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(d), jStat.add(l, u)), -1);\n c = jStat.multiply(jStat.inv(d), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk,xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n gauss_seidel: function gauss_seidel(a, b, x, r) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d, l)), u), -1);\n c = jStat.multiply(jStat.inv(jStat.add(d, l)), b);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i = i + 1;\n }\n return xk;\n },\n\n SOR: function SOR(a, b, x, r, w) {\n var i = 0;\n var n = a.length;\n var l = [];\n var u = [];\n var d = [];\n var j, xv, c, h, xk;\n for (; i < n; i++) {\n l[i] = [];\n u[i] = [];\n d[i] = [];\n for (j = 0; j < n; j++) {\n if (i > j) {\n l[i][j] = a[i][j];\n u[i][j] = d[i][j] = 0;\n } else if (i < j) {\n u[i][j] = a[i][j];\n l[i][j] = d[i][j] = 0;\n } else {\n d[i][j] = a[i][j];\n l[i][j] = u[i][j] = 0;\n }\n }\n }\n h = jStat.multiply(jStat.inv(jStat.add(d, jStat.multiply(l, w))),\n jStat.subtract(jStat.multiply(d, 1 - w),\n jStat.multiply(u, w)));\n c = jStat.multiply(jStat.multiply(jStat.inv(jStat.add(d,\n jStat.multiply(l, w))), b), w);\n xv = x;\n xk = jStat.add(jStat.multiply(h, x), c);\n i = 2;\n while (Math.abs(jStat.norm(jStat.subtract(xk, xv))) > r) {\n xv = xk;\n xk = jStat.add(jStat.multiply(h, xv), c);\n i++;\n }\n return xk;\n },\n\n householder: function householder(a) {\n var m = a.length;\n var n = a[0].length;\n var i = 0;\n var w = [];\n var p = [];\n var alpha, r, k, j, factor;\n for (; i < m - 1; i++) {\n alpha = 0;\n for (j = i + 1; j < n; j++)\n alpha += (a[j][i] * a[j][i]);\n factor = (a[i + 1][i] > 0) ? -1 : 1;\n alpha = factor * Math.sqrt(alpha);\n r = Math.sqrt((((alpha * alpha) - a[i + 1][i] * alpha) / 2));\n w = jStat.zeros(m, 1);\n w[i + 1][0] = (a[i + 1][i] - alpha) / (2 * r);\n for (k = i + 2; k < m; k++) w[k][0] = a[k][i] / (2 * r);\n p = jStat.subtract(jStat.identity(m, n),\n jStat.multiply(jStat.multiply(w, jStat.transpose(w)), 2));\n a = jStat.multiply(p, jStat.multiply(a, p));\n }\n return a;\n },\n\n // A -> [Q,R]\n // Q is orthogonal matrix\n // R is upper triangular\n QR: (function() {\n // x -> Q\n // find a orthogonal matrix Q st.\n // Qx=y\n // y is [||x||,0,0,...]\n\n // quick ref\n var sum = jStat.sum;\n var range = jStat.arange;\n\n function qr2(x) {\n // quick impletation\n // https://www.stat.wisc.edu/~larget/math496/qr.html\n\n var n = x.length;\n var p = x[0].length;\n\n var r = jStat.zeros(p, p);\n x = jStat.copy(x);\n\n var i,j,k;\n for(j = 0; j < p; j++){\n r[j][j] = Math.sqrt(sum(range(n).map(function(i){\n return x[i][j] * x[i][j];\n })));\n for(i = 0; i < n; i++){\n x[i][j] = x[i][j] / r[j][j];\n }\n for(k = j+1; k < p; k++){\n r[j][k] = sum(range(n).map(function(i){\n return x[i][j] * x[i][k];\n }));\n for(i = 0; i < n; i++){\n x[i][k] = x[i][k] - x[i][j]*r[j][k];\n }\n }\n }\n return [x, r];\n }\n\n return qr2;\n }()),\n\n lstsq: (function() {\n // solve least squard problem for Ax=b as QR decomposition way if b is\n // [[b1],[b2],[b3]] form will return [[x1],[x2],[x3]] array form solution\n // else b is [b1,b2,b3] form will return [x1,x2,x3] array form solution\n function R_I(A) {\n A = jStat.copy(A);\n var size = A.length;\n var I = jStat.identity(size);\n jStat.arange(size - 1, -1, -1).forEach(function(i) {\n jStat.sliceAssign(\n I, { row: i }, jStat.divide(jStat.slice(I, { row: i }), A[i][i]));\n jStat.sliceAssign(\n A, { row: i }, jStat.divide(jStat.slice(A, { row: i }), A[i][i]));\n jStat.arange(i).forEach(function(j) {\n var c = jStat.multiply(A[j][i], -1);\n var Aj = jStat.slice(A, { row: j });\n var cAi = jStat.multiply(jStat.slice(A, { row: i }), c);\n jStat.sliceAssign(A, { row: j }, jStat.add(Aj, cAi));\n var Ij = jStat.slice(I, { row: j });\n var cIi = jStat.multiply(jStat.slice(I, { row: i }), c);\n jStat.sliceAssign(I, { row: j }, jStat.add(Ij, cIi));\n })\n });\n return I;\n }\n\n function qr_solve(A, b){\n var array_mode = false;\n if (b[0].length === undefined) {\n // [c1,c2,c3] mode\n b = b.map(function(x){ return [x] });\n array_mode = true;\n }\n var QR = jStat.QR(A);\n var Q = QR[0];\n var R = QR[1];\n var attrs = A[0].length;\n var Q1 = jStat.slice(Q,{col:{end:attrs}});\n var R1 = jStat.slice(R,{row:{end:attrs}});\n var RI = R_I(R1);\n var Q2 = jStat.transpose(Q1);\n\n if(Q2[0].length === undefined){\n Q2 = [Q2]; // The confusing jStat.multifly implementation threat nature process again.\n }\n\n var x = jStat.multiply(jStat.multiply(RI, Q2), b);\n\n if(x.length === undefined){\n x = [[x]]; // The confusing jStat.multifly implementation threat nature process again.\n }\n\n\n if (array_mode)\n return x.map(function(i){ return i[0] });\n return x;\n }\n\n return qr_solve;\n }()),\n\n jacobi: function jacobi(a) {\n var condition = 1;\n var n = a.length;\n var e = jStat.identity(n, n);\n var ev = [];\n var b, i, j, p, q, maxim, theta, s;\n // condition === 1 only if tolerance is not reached\n while (condition === 1) {\n maxim = a[0][1];\n p = 0;\n q = 1;\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n if (i != j) {\n if (maxim < Math.abs(a[i][j])) {\n maxim = Math.abs(a[i][j]);\n p = i;\n q = j;\n }\n }\n }\n }\n if (a[p][p] === a[q][q])\n theta = (a[p][q] > 0) ? Math.PI / 4 : -Math.PI / 4;\n else\n theta = Math.atan(2 * a[p][q] / (a[p][p] - a[q][q])) / 2;\n s = jStat.identity(n, n);\n s[p][p] = Math.cos(theta);\n s[p][q] = -Math.sin(theta);\n s[q][p] = Math.sin(theta);\n s[q][q] = Math.cos(theta);\n // eigen vector matrix\n e = jStat.multiply(e, s);\n b = jStat.multiply(jStat.multiply(jStat.inv(s), a), s);\n a = b;\n condition = 0;\n for (i = 1; i < n; i++) {\n for (j = 1; j < n; j++) {\n if (i != j && Math.abs(a[i][j]) > 0.001) {\n condition = 1;\n }\n }\n }\n }\n for (i = 0; i < n; i++) ev.push(a[i][i]);\n //returns both the eigenvalue and eigenmatrix\n return [e, ev];\n },\n\n rungekutta: function rungekutta(f, h, p, t_j, u_j, order) {\n var k1, k2, u_j1, k3, k4;\n if (order === 2) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h, u_j + k1);\n u_j1 = u_j + (k1 + k2) / 2;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n if (order === 4) {\n while (t_j <= p) {\n k1 = h * f(t_j, u_j);\n k2 = h * f(t_j + h / 2, u_j + k1 / 2);\n k3 = h * f(t_j + h / 2, u_j + k2 / 2);\n k4 = h * f(t_j +h, u_j + k3);\n u_j1 = u_j + (k1 + 2 * k2 + 2 * k3 + k4) / 6;\n u_j = u_j1;\n t_j = t_j + h;\n }\n }\n return u_j;\n },\n\n romberg: function romberg(f, a, b, order) {\n var i = 0;\n var h = (b - a) / 2;\n var x = [];\n var h1 = [];\n var g = [];\n var m, a1, j, k, I;\n while (i < order / 2) {\n I = f(a);\n for (j = a, k = 0; j <= b; j = j + h, k++) x[k] = j;\n m = x.length;\n for (j = 1; j < m - 1; j++) {\n I += (((j % 2) !== 0) ? 4 : 2) * f(x[j]);\n }\n I = (h / 3) * (I + f(b));\n g[i] = I;\n h /= 2;\n i++;\n }\n a1 = g.length;\n m = 1;\n while (a1 !== 1) {\n for (j = 0; j < a1 - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a1 = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n richardson: function richardson(X, f, x, h) {\n function pos(X, x) {\n var i = 0;\n var n = X.length;\n var p;\n for (; i < n; i++)\n if (X[i] === x) p = i;\n return p;\n }\n var h_min = Math.abs(x - X[pos(X, x) + 1]);\n var i = 0;\n var g = [];\n var h1 = [];\n var y1, y2, m, a, j;\n while (h >= h_min) {\n y1 = pos(X, x + h);\n y2 = pos(X, x);\n g[i] = (f[y1] - 2 * f[y2] + f[2 * y2 - y1]) / (h * h);\n h /= 2;\n i++;\n }\n a = g.length;\n m = 1;\n while (a != 1) {\n for (j = 0; j < a - 1; j++)\n h1[j] = ((Math.pow(4, m)) * g[j + 1] - g[j]) / (Math.pow(4, m) - 1);\n a = h1.length;\n g = h1;\n h1 = [];\n m++;\n }\n return g;\n },\n\n simpson: function simpson(f, a, b, n) {\n var h = (b - a) / n;\n var I = f(a);\n var x = [];\n var j = a;\n var k = 0;\n var i = 1;\n var m;\n for (; j <= b; j = j + h, k++)\n x[k] = j;\n m = x.length;\n for (; i < m - 1; i++) {\n I += ((i % 2 !== 0) ? 4 : 2) * f(x[i]);\n }\n return (h / 3) * (I + f(b));\n },\n\n hermite: function hermite(X, F, dF, value) {\n var n = X.length;\n var p = 0;\n var i = 0;\n var l = [];\n var dl = [];\n var A = [];\n var B = [];\n var j;\n for (; i < n; i++) {\n l[i] = 1;\n for (j = 0; j < n; j++) {\n if (i != j) l[i] *= (value - X[j]) / (X[i] - X[j]);\n }\n dl[i] = 0;\n for (j = 0; j < n; j++) {\n if (i != j) dl[i] += 1 / (X [i] - X[j]);\n }\n A[i] = (1 - 2 * (value - X[i]) * dl[i]) * (l[i] * l[i]);\n B[i] = (value - X[i]) * (l[i] * l[i]);\n p += (A[i] * F[i] + B[i] * dF[i]);\n }\n return p;\n },\n\n lagrange: function lagrange(X, F, value) {\n var p = 0;\n var i = 0;\n var j, l;\n var n = X.length;\n for (; i < n; i++) {\n l = F[i];\n for (j = 0; j < n; j++) {\n // calculating the lagrange polynomial L_i\n if (i != j) l *= (value - X[j]) / (X[i] - X[j]);\n }\n // adding the lagrange polynomials found above\n p += l;\n }\n return p;\n },\n\n cubic_spline: function cubic_spline(X, F, value) {\n var n = X.length;\n var i = 0, j;\n var A = [];\n var B = [];\n var alpha = [];\n var c = [];\n var h = [];\n var b = [];\n var d = [];\n for (; i < n - 1; i++)\n h[i] = X[i + 1] - X[i];\n alpha[0] = 0;\n for (i = 1; i < n - 1; i++) {\n alpha[i] = (3 / h[i]) * (F[i + 1] - F[i]) -\n (3 / h[i-1]) * (F[i] - F[i-1]);\n }\n for (i = 1; i < n - 1; i++) {\n A[i] = [];\n B[i] = [];\n A[i][i-1] = h[i-1];\n A[i][i] = 2 * (h[i - 1] + h[i]);\n A[i][i+1] = h[i];\n B[i][0] = alpha[i];\n }\n c = jStat.multiply(jStat.inv(A), B);\n for (j = 0; j < n - 1; j++) {\n b[j] = (F[j + 1] - F[j]) / h[j] - h[j] * (c[j + 1][0] + 2 * c[j][0]) / 3;\n d[j] = (c[j + 1][0] - c[j][0]) / (3 * h[j]);\n }\n for (j = 0; j < n; j++) {\n if (X[j] > value) break;\n }\n j -= 1;\n return F[j] + (value - X[j]) * b[j] + jStat.sq(value-X[j]) *\n c[j] + (value - X[j]) * jStat.sq(value - X[j]) * d[j];\n },\n\n gauss_quadrature: function gauss_quadrature() {\n throw new Error('gauss_quadrature not yet implemented');\n },\n\n PCA: function PCA(X) {\n var m = X.length;\n var n = X[0].length;\n var i = 0;\n var j, temp1;\n var u = [];\n var D = [];\n var result = [];\n var temp2 = [];\n var Y = [];\n var Bt = [];\n var B = [];\n var C = [];\n var V = [];\n var Vt = [];\n for (i = 0; i < m; i++) {\n u[i] = jStat.sum(X[i]) / n;\n }\n for (i = 0; i < n; i++) {\n B[i] = [];\n for(j = 0; j < m; j++) {\n B[i][j] = X[j][i] - u[j];\n }\n }\n B = jStat.transpose(B);\n for (i = 0; i < m; i++) {\n C[i] = [];\n for (j = 0; j < m; j++) {\n C[i][j] = (jStat.dot([B[i]], [B[j]])) / (n - 1);\n }\n }\n result = jStat.jacobi(C);\n V = result[0];\n D = result[1];\n Vt = jStat.transpose(V);\n for (i = 0; i < D.length; i++) {\n for (j = i; j < D.length; j++) {\n if(D[i] < D[j]) {\n temp1 = D[i];\n D[i] = D[j];\n D[j] = temp1;\n temp2 = Vt[i];\n Vt[i] = Vt[j];\n Vt[j] = temp2;\n }\n }\n }\n Bt = jStat.transpose(B);\n for (i = 0; i < m; i++) {\n Y[i] = [];\n for (j = 0; j < Bt.length; j++) {\n Y[i][j] = jStat.dot([Vt[i]], [Bt[j]]);\n }\n }\n return [X, D, Vt, Y];\n }\n});\n\n// extend jStat.fn with methods that require one argument\n(function(funcs) {\n for (var i = 0; i < funcs.length; i++) (function(passfunc) {\n jStat.fn[passfunc] = function(arg, func) {\n var tmpthis = this;\n // check for callback\n if (func) {\n setTimeout(function() {\n func.call(tmpthis, jStat.fn[passfunc].call(tmpthis, arg));\n }, 15);\n return this;\n }\n if (typeof jStat[passfunc](this, arg) === 'number')\n return jStat[passfunc](this, arg);\n else\n return jStat(jStat[passfunc](this, arg));\n };\n }(funcs[i]));\n}('add divide multiply subtract dot pow exp log abs norm angle'.split(' ')));\n\n}(jStat, Math));\n(function(jStat, Math) {\n\nvar slice = [].slice;\nvar isNumber = jStat.utils.isNumber;\nvar isArray = jStat.utils.isArray;\n\n// flag==true denotes use of sample standard deviation\n// Z Statistics\njStat.extend({\n // 2 different parameter lists:\n // (value, mean, sd)\n // (value, array, flag)\n zscore: function zscore() {\n var args = slice.call(arguments);\n if (isNumber(args[1])) {\n return (args[0] - args[1]) / args[2];\n }\n return (args[0] - jStat.mean(args[1])) / jStat.stdev(args[1], args[2]);\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, sides)\n // (zscore, sides)\n // (value, array, sides, flag)\n ztest: function ztest() {\n var args = slice.call(arguments);\n var z;\n if (isArray(args[1])) {\n // (value, array, sides, flag)\n z = jStat.zscore(args[0],args[1],args[3]);\n return (args[2] === 1) ?\n (jStat.normal.cdf(-Math.abs(z), 0, 1)) :\n (jStat.normal.cdf(-Math.abs(z), 0, 1)*2);\n } else {\n if (args.length > 2) {\n // (value, mean, sd, sides)\n z = jStat.zscore(args[0],args[1],args[2]);\n return (args[3] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)* 2);\n } else {\n // (zscore, sides)\n z = args[0];\n return (args[1] === 1) ?\n (jStat.normal.cdf(-Math.abs(z),0,1)) :\n (jStat.normal.cdf(-Math.abs(z),0,1)*2);\n }\n }\n }\n});\n\njStat.extend(jStat.fn, {\n zscore: function zscore(value, flag) {\n return (value - this.mean()) / this.stdev(flag);\n },\n\n ztest: function ztest(value, sides, flag) {\n var zscore = Math.abs(this.zscore(value, flag));\n return (sides === 1) ?\n (jStat.normal.cdf(-zscore, 0, 1)) :\n (jStat.normal.cdf(-zscore, 0, 1) * 2);\n }\n});\n\n// T Statistics\njStat.extend({\n // 2 parameter lists\n // (value, mean, sd, n)\n // (value, array)\n tscore: function tscore() {\n var args = slice.call(arguments);\n return (args.length === 4) ?\n ((args[0] - args[1]) / (args[2] / Math.sqrt(args[3]))) :\n ((args[0] - jStat.mean(args[1])) /\n (jStat.stdev(args[1], true) / Math.sqrt(args[1].length)));\n },\n\n // 3 different paramter lists:\n // (value, mean, sd, n, sides)\n // (tscore, n, sides)\n // (value, array, sides)\n ttest: function ttest() {\n var args = slice.call(arguments);\n var tscore;\n if (args.length === 5) {\n tscore = Math.abs(jStat.tscore(args[0], args[1], args[2], args[3]));\n return (args[4] === 1) ?\n (jStat.studentt.cdf(-tscore, args[3]-1)) :\n (jStat.studentt.cdf(-tscore, args[3]-1)*2);\n }\n if (isNumber(args[1])) {\n tscore = Math.abs(args[0])\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1]-1)) :\n (jStat.studentt.cdf(-tscore, args[1]-1) * 2);\n }\n tscore = Math.abs(jStat.tscore(args[0], args[1]))\n return (args[2] == 1) ?\n (jStat.studentt.cdf(-tscore, args[1].length-1)) :\n (jStat.studentt.cdf(-tscore, args[1].length-1) * 2);\n }\n});\n\njStat.extend(jStat.fn, {\n tscore: function tscore(value) {\n return (value - this.mean()) / (this.stdev(true) / Math.sqrt(this.cols()));\n },\n\n ttest: function ttest(value, sides) {\n return (sides === 1) ?\n (1 - jStat.studentt.cdf(Math.abs(this.tscore(value)), this.cols()-1)) :\n (jStat.studentt.cdf(-Math.abs(this.tscore(value)), this.cols()-1)*2);\n }\n});\n\n// F Statistics\njStat.extend({\n // Paramter list is as follows:\n // (array1, array2, array3, ...)\n // or it is an array of arrays\n // array of arrays conversion\n anovafscore: function anovafscore() {\n var args = slice.call(arguments),\n expVar, sample, sampMean, sampSampMean, tmpargs, unexpVar, i, j;\n if (args.length === 1) {\n tmpargs = new Array(args[0].length);\n for (i = 0; i < args[0].length; i++) {\n tmpargs[i] = args[0][i];\n }\n args = tmpargs;\n }\n // Builds sample array\n sample = new Array();\n for (i = 0; i < args.length; i++) {\n sample = sample.concat(args[i]);\n }\n sampMean = jStat.mean(sample);\n // Computes the explained variance\n expVar = 0;\n for (i = 0; i < args.length; i++) {\n expVar = expVar + args[i].length * Math.pow(jStat.mean(args[i]) - sampMean, 2);\n }\n expVar /= (args.length - 1);\n // Computes unexplained variance\n unexpVar = 0;\n for (i = 0; i < args.length; i++) {\n sampSampMean = jStat.mean(args[i]);\n for (j = 0; j < args[i].length; j++) {\n unexpVar += Math.pow(args[i][j] - sampSampMean, 2);\n }\n }\n unexpVar /= (sample.length - args.length);\n return expVar / unexpVar;\n },\n\n // 2 different paramter setups\n // (array1, array2, array3, ...)\n // (anovafscore, df1, df2)\n anovaftest: function anovaftest() {\n var args = slice.call(arguments),\n df1, df2, n, i;\n if (isNumber(args[0])) {\n return 1 - jStat.centralF.cdf(args[0], args[1], args[2]);\n }\n var anovafscore = jStat.anovafscore(args);\n df1 = args.length - 1;\n n = 0;\n for (i = 0; i < args.length; i++) {\n n = n + args[i].length;\n }\n df2 = n - df1 - 1;\n return 1 - jStat.centralF.cdf(anovafscore, df1, df2);\n },\n\n ftest: function ftest(fscore, df1, df2) {\n return 1 - jStat.centralF.cdf(fscore, df1, df2);\n }\n});\n\njStat.extend(jStat.fn, {\n anovafscore: function anovafscore() {\n return jStat.anovafscore(this.toArray());\n },\n\n anovaftes: function anovaftes() {\n var n = 0;\n var i;\n for (i = 0; i < this.length; i++) {\n n = n + this[i].length;\n }\n return jStat.ftest(this.anovafscore(), this.length - 1, n - this.length);\n }\n});\n\n// Tukey's range test\njStat.extend({\n // 2 parameter lists\n // (mean1, mean2, n1, n2, sd)\n // (array1, array2, sd)\n qscore: function qscore() {\n var args = slice.call(arguments);\n var mean1, mean2, n1, n2, sd;\n if (isNumber(args[0])) {\n mean1 = args[0];\n mean2 = args[1];\n n1 = args[2];\n n2 = args[3];\n sd = args[4];\n } else {\n mean1 = jStat.mean(args[0]);\n mean2 = jStat.mean(args[1]);\n n1 = args[0].length;\n n2 = args[1].length;\n sd = args[2];\n }\n return Math.abs(mean1 - mean2) / (sd * Math.sqrt((1 / n1 + 1 / n2) / 2));\n },\n\n // 3 different parameter lists:\n // (qscore, n, k)\n // (mean1, mean2, n1, n2, sd, n, k)\n // (array1, array2, sd, n, k)\n qtest: function qtest() {\n var args = slice.call(arguments);\n\n var qscore;\n if (args.length === 3) {\n qscore = args[0];\n args = args.slice(1);\n } else if (args.length === 7) {\n qscore = jStat.qscore(args[0], args[1], args[2], args[3], args[4]);\n args = args.slice(5);\n } else {\n qscore = jStat.qscore(args[0], args[1], args[2]);\n args = args.slice(3);\n }\n\n var n = args[0];\n var k = args[1];\n\n return 1 - jStat.tukey.cdf(qscore, k, n - k);\n },\n\n tukeyhsd: function tukeyhsd(arrays) {\n var sd = jStat.pooledstdev(arrays);\n var means = arrays.map(function (arr) {return jStat.mean(arr);});\n var n = arrays.reduce(function (n, arr) {return n + arr.length;}, 0);\n\n var results = [];\n for (var i = 0; i < arrays.length; ++i) {\n for (var j = i + 1; j < arrays.length; ++j) {\n var p = jStat.qtest(means[i], means[j], arrays[i].length, arrays[j].length, sd, n, arrays.length);\n results.push([[i, j], p]);\n }\n }\n\n return results;\n }\n});\n\n// Error Bounds\njStat.extend({\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n normalci: function normalci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.normal.inv(args[1] / 2, 0, 1) *\n jStat.stdev(args[2]) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n // 2 different parameter setups\n // (value, alpha, sd, n)\n // (value, alpha, array)\n tci: function tci() {\n var args = slice.call(arguments),\n ans = new Array(2),\n change;\n if (args.length === 4) {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[3] - 1) *\n args[2] / Math.sqrt(args[3]));\n } else {\n change = Math.abs(jStat.studentt.inv(args[1] / 2, args[2].length - 1) *\n jStat.stdev(args[2], true) / Math.sqrt(args[2].length));\n }\n ans[0] = args[0] - change;\n ans[1] = args[0] + change;\n return ans;\n },\n\n significant: function significant(pvalue, alpha) {\n return pvalue < alpha;\n }\n});\n\njStat.extend(jStat.fn, {\n normalci: function normalci(value, alpha) {\n return jStat.normalci(value, alpha, this.toArray());\n },\n\n tci: function tci(value, alpha) {\n return jStat.tci(value, alpha, this.toArray());\n }\n});\n\n// internal method for calculating the z-score for a difference of proportions test\nfunction differenceOfProportions(p1, n1, p2, n2) {\n if (p1 > 1 || p2 > 1 || p1 <= 0 || p2 <= 0) {\n throw new Error(\"Proportions should be greater than 0 and less than 1\")\n }\n var pooled = (p1 * n1 + p2 * n2) / (n1 + n2);\n var se = Math.sqrt(pooled * (1 - pooled) * ((1/n1) + (1/n2)));\n return (p1 - p2) / se;\n}\n\n// Difference of Proportions\njStat.extend(jStat.fn, {\n oneSidedDifferenceOfProportions: function oneSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 1);\n },\n\n twoSidedDifferenceOfProportions: function twoSidedDifferenceOfProportions(p1, n1, p2, n2) {\n var z = differenceOfProportions(p1, n1, p2, n2);\n return jStat.ztest(z, 2);\n }\n});\n\n}(jStat, Math));\njStat.models = (function(){\n function sub_regress(exog) {\n var var_count = exog[0].length;\n var modelList = jStat.arange(var_count).map(function(endog_index) {\n var exog_index =\n jStat.arange(var_count).filter(function(i){return i!==endog_index});\n return ols(jStat.col(exog, endog_index).map(function(x){ return x[0] }),\n jStat.col(exog, exog_index))\n });\n return modelList;\n }\n\n // do OLS model regress\n // exog have include const columns ,it will not generate it .In fact, exog is\n // \"design matrix\" look at\n //https://en.wikipedia.org/wiki/Design_matrix\n function ols(endog, exog) {\n var nobs = endog.length;\n var df_model = exog[0].length - 1;\n var df_resid = nobs-df_model - 1;\n var coef = jStat.lstsq(exog, endog);\n var predict =\n jStat.multiply(exog, coef.map(function(x) { return [x] }))\n .map(function(p) { return p[0] });\n var resid = jStat.subtract(endog, predict);\n var ybar = jStat.mean(endog);\n // constant cause problem\n // var SST = jStat.sum(endog.map(function(y) {\n // return Math.pow(y-ybar,2);\n // }));\n var SSE = jStat.sum(predict.map(function(f) {\n return Math.pow(f - ybar, 2);\n }));\n var SSR = jStat.sum(endog.map(function(y, i) {\n return Math.pow(y - predict[i], 2);\n }));\n var SST = SSE + SSR;\n var R2 = (SSE / SST);\n return {\n exog:exog,\n endog:endog,\n nobs:nobs,\n df_model:df_model,\n df_resid:df_resid,\n coef:coef,\n predict:predict,\n resid:resid,\n ybar:ybar,\n SST:SST,\n SSE:SSE,\n SSR:SSR,\n R2:R2\n };\n }\n\n // H0: b_I=0\n // H1: b_I!=0\n function t_test(model) {\n var subModelList = sub_regress(model.exog);\n //var sigmaHat=jStat.stdev(model.resid);\n var sigmaHat = Math.sqrt(model.SSR / (model.df_resid));\n var seBetaHat = subModelList.map(function(mod) {\n var SST = mod.SST;\n var R2 = mod.R2;\n return sigmaHat / Math.sqrt(SST * (1 - R2));\n });\n var tStatistic = model.coef.map(function(coef, i) {\n return (coef - 0) / seBetaHat[i];\n });\n var pValue = tStatistic.map(function(t) {\n var leftppf = jStat.studentt.cdf(t, model.df_resid);\n return (leftppf > 0.5 ? 1 - leftppf : leftppf) * 2;\n });\n var c = jStat.studentt.inv(0.975, model.df_resid);\n var interval95 = model.coef.map(function(coef, i) {\n var d = c * seBetaHat[i];\n return [coef - d, coef + d];\n })\n return {\n se: seBetaHat,\n t: tStatistic,\n p: pValue,\n sigmaHat: sigmaHat,\n interval95: interval95\n };\n }\n\n function F_test(model) {\n var F_statistic =\n (model.R2 / model.df_model) / ((1 - model.R2) / model.df_resid);\n var fcdf = function(x, n1, n2) {\n return jStat.beta.cdf(x / (n2 / n1 + x), n1 / 2, n2 / 2)\n }\n var pvalue = 1 - fcdf(F_statistic, model.df_model, model.df_resid);\n return { F_statistic: F_statistic, pvalue: pvalue };\n }\n\n function ols_wrap(endog, exog) {\n var model = ols(endog,exog);\n var ttest = t_test(model);\n var ftest = F_test(model);\n // Provide the Wherry / Ezekiel / McNemar / Cohen Adjusted R^2\n // Which matches the 'adjusted R^2' provided by R's lm package\n var adjust_R2 =\n 1 - (1 - model.R2) * ((model.nobs - 1) / (model.df_resid));\n model.t = ttest;\n model.f = ftest;\n model.adjust_R2 = adjust_R2;\n return model;\n }\n\n return { ols: ols_wrap };\n})();\n//To regress, simply build X matrix\n//(append column of 1's) using\n//buildxmatrix and build the Y\n//matrix using buildymatrix\n//(simply the transpose)\n//and run regress.\n\n\n\n//Regressions\n\njStat.extend({\n buildxmatrix: function buildxmatrix(){\n //Parameters will be passed in as such\n //(array1,array2,array3,...)\n //as (x1,x2,x3,...)\n //needs to be (1,x1,x2,x3,...)\n var matrixRows = new Array(arguments.length);\n for(var i=0;i1){\n result = [];\n for (i = 0; i < A.rows(); i++) {\n result[i] = [];\n for (j = 0; j < B.cols(); j++) {\n sum = 0;\n for (k = 0; k < A.cols(); k++) {\n sum += A.toArray()[i][k] * B.toArray()[k][j];\n }\n result[i][j] = sum;\n }\n }\n return jStat(result);\n }\n result = [];\n for (i = 0; i < A.rows(); i++) {\n result[i] = [];\n for (j = 0; j < B.cols(); j++) {\n sum = 0;\n for (k = 0; k < A.cols(); k++) {\n sum += A.toArray()[i][k] * B.toArray()[j];\n }\n result[i][j] = sum;\n }\n }\n return jStat(result);\n }\n },\n\n //regress and regresst to be fixed\n\n regress: function regress(jMatX,jMatY){\n //print(\"regressin!\");\n //print(jMatX.toArray());\n var innerinv = jStat.xtranspxinv(jMatX);\n //print(innerinv);\n var xtransp = jMatX.transpose();\n var next = jStat.matrixmult(jStat(innerinv),xtransp);\n return jStat.matrixmult(next,jMatY);\n\n },\n\n regresst: function regresst(jMatX,jMatY,sides){\n var beta = jStat.regress(jMatX,jMatY);\n\n var compile = {};\n compile.anova = {};\n var jMatYBar = jStat.jMatYBar(jMatX, beta);\n compile.yBar = jMatYBar;\n var yAverage = jMatY.mean();\n compile.anova.residuals = jStat.residuals(jMatY, jMatYBar);\n\n compile.anova.ssr = jStat.ssr(jMatYBar, yAverage);\n compile.anova.msr = compile.anova.ssr / (jMatX[0].length - 1);\n\n compile.anova.sse = jStat.sse(jMatY, jMatYBar);\n compile.anova.mse =\n compile.anova.sse / (jMatY.length - (jMatX[0].length - 1) - 1);\n\n compile.anova.sst = jStat.sst(jMatY, yAverage);\n compile.anova.mst = compile.anova.sst / (jMatY.length - 1);\n\n compile.anova.r2 = 1 - (compile.anova.sse / compile.anova.sst);\n if (compile.anova.r2 < 0) compile.anova.r2 = 0;\n\n compile.anova.fratio = compile.anova.msr / compile.anova.mse;\n compile.anova.pvalue =\n jStat.anovaftest(compile.anova.fratio,\n jMatX[0].length - 1,\n jMatY.length - (jMatX[0].length - 1) - 1);\n\n compile.anova.rmse = Math.sqrt(compile.anova.mse);\n\n compile.anova.r2adj = 1 - (compile.anova.mse / compile.anova.mst);\n if (compile.anova.r2adj < 0) compile.anova.r2adj = 0;\n\n compile.stats = new Array(jMatX[0].length);\n var covar = jStat.xtranspxinv(jMatX);\n var sds, ts, ps;\n\n for(var i=0; i n) {\n ret = _bessel_iter(x, n, bessel0(x), bessel1(x),-1);\n } else {\n var m=2*M.floor((n+M.floor(M.sqrt(40*n)))/2);\n var jsum=false;\n var bjp=0.0, sum=0.0;\n var bj=1.0, bjm = 0.0;\n var tox = 2 / x;\n for (var j=m;j>0;j--) {\n bjm=j*tox*bj-bjp;\n bjp=bj;\n bj=bjm;\n if (M.abs(bj) > 1E10) {\n bj *= 1E-10;\n bjp *= 1E-10;\n ret *= 1E-10;\n sum *= 1E-10;\n }\n if (jsum) sum += bj;\n jsum=!jsum;\n if (j == n) ret=bjp;\n }\n sum=2.0*sum-bj;\n ret /= sum;\n }\n return ret;\n };\n})();\nvar bessely = (function() {\n var W = 0.636619772;\n\n var b0_a1a = [-2957821389.0, 7062834065.0, -512359803.6, 10879881.29, -86327.92757, 228.4622733].reverse();\n var b0_a2a = [40076544269.0, 745249964.8, 7189466.438, 47447.26470, 226.1030244, 1.0].reverse();\n var b0_a1b = [1.0, -0.1098628627e-2, 0.2734510407e-4, -0.2073370639e-5, 0.2093887211e-6].reverse();\n var b0_a2b = [-0.1562499995e-1, 0.1430488765e-3, -0.6911147651e-5, 0.7621095161e-6, -0.934945152e-7].reverse();\n\n function bessel0(x) {\n var a=0, a1=0, a2=0, y = x * x, xx = x - 0.785398164;\n if(x < 8) {\n a1 = _horner(b0_a1a, y);\n a2 = _horner(b0_a2a, y);\n a = a1/a2 + W * besselj(x,0) * M.log(x);\n } else {\n y = 64 / y;\n a1 = _horner(b0_a1b, y);\n a2 = _horner(b0_a2b, y);\n a = M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n var b1_a1a = [-0.4900604943e13, 0.1275274390e13, -0.5153438139e11, 0.7349264551e9, -0.4237922726e7, 0.8511937935e4].reverse();\n var b1_a2a = [0.2499580570e14, 0.4244419664e12, 0.3733650367e10, 0.2245904002e8, 0.1020426050e6, 0.3549632885e3, 1].reverse();\n var b1_a1b = [1.0, 0.183105e-2, -0.3516396496e-4, 0.2457520174e-5, -0.240337019e-6].reverse();\n var b1_a2b = [0.04687499995, -0.2002690873e-3, 0.8449199096e-5, -0.88228987e-6, 0.105787412e-6].reverse();\n\n function bessel1(x) {\n var a=0, a1=0, a2=0, y = x*x, xx = x - 2.356194491;\n if(x < 8) {\n a1 = x*_horner(b1_a1a, y);\n a2 = _horner(b1_a2a, y);\n a = a1/a2 + W * (besselj(x,1) * M.log(x) - 1 / x);\n } else {\n y = 64 / y;\n a1=_horner(b1_a1b, y);\n a2=_horner(b1_a2b, y);\n a=M.sqrt(W/x)*(M.sin(xx)*a1+M.cos(xx)*a2*8/x);\n }\n return a;\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELY', 1, -1);\n})();\nvar besseli = (function() {\n var b0_a = [1.0, 3.5156229, 3.0899424, 1.2067492, 0.2659732, 0.360768e-1, 0.45813e-2].reverse();\n var b0_b = [0.39894228, 0.1328592e-1, 0.225319e-2, -0.157565e-2, 0.916281e-2, -0.2057706e-1, 0.2635537e-1, -0.1647633e-1, 0.392377e-2].reverse();\n\n function bessel0(x) {\n if(x <= 3.75) return _horner(b0_a, x*x/(3.75*3.75));\n return M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b0_b, 3.75/M.abs(x));\n }\n\n var b1_a = [0.5, 0.87890594, 0.51498869, 0.15084934, 0.2658733e-1, 0.301532e-2, 0.32411e-3].reverse();\n var b1_b = [0.39894228, -0.3988024e-1, -0.362018e-2, 0.163801e-2, -0.1031555e-1, 0.2282967e-1, -0.2895312e-1, 0.1787654e-1, -0.420059e-2].reverse();\n\n function bessel1(x) {\n if(x < 3.75) return x * _horner(b1_a, x*x/(3.75*3.75));\n return (x < 0 ? -1 : 1) * M.exp(M.abs(x))/M.sqrt(M.abs(x))*_horner(b1_b, 3.75/M.abs(x));\n }\n\n return function besseli(x, n) {\n n = Math.round(n);\n if(n === 0) return bessel0(x);\n if(n === 1) return bessel1(x);\n if(n < 0) return NaN;\n if(M.abs(x) === 0) return 0;\n if(x == Infinity) return Infinity;\n\n var ret = 0.0, j, tox = 2 / M.abs(x), bip = 0.0, bi=1.0, bim=0.0;\n var m=2*M.round((n+M.round(M.sqrt(40*n)))/2);\n for (j=m;j>0;j--) {\n bim=j*tox*bi + bip;\n bip=bi; bi=bim;\n if (M.abs(bi) > 1E10) {\n bi *= 1E-10;\n bip *= 1E-10;\n ret *= 1E-10;\n }\n if(j == n) ret = bip;\n }\n ret *= besseli(x, 0) / bi;\n return x < 0 && (n%2) ? -ret : ret;\n };\n\n})();\n\nvar besselk = (function() {\n var b0_a = [-0.57721566, 0.42278420, 0.23069756, 0.3488590e-1, 0.262698e-2, 0.10750e-3, 0.74e-5].reverse();\n var b0_b = [1.25331414, -0.7832358e-1, 0.2189568e-1, -0.1062446e-1, 0.587872e-2, -0.251540e-2, 0.53208e-3].reverse();\n\n function bessel0(x) {\n if(x <= 2) return -M.log(x/2) * besseli(x,0) + _horner(b0_a, x*x/4);\n return M.exp(-x) / M.sqrt(x) * _horner(b0_b, 2/x);\n }\n\n var b1_a = [1.0, 0.15443144, -0.67278579, -0.18156897, -0.1919402e-1, -0.110404e-2, -0.4686e-4].reverse();\n var b1_b = [1.25331414, 0.23498619, -0.3655620e-1, 0.1504268e-1, -0.780353e-2, 0.325614e-2, -0.68245e-3].reverse();\n\n function bessel1(x) {\n if(x <= 2) return M.log(x/2) * besseli(x,1) + (1/x) * _horner(b1_a, x*x/4);\n return M.exp(-x)/M.sqrt(x)*_horner(b1_b, 2/x);\n }\n\n return _bessel_wrap(bessel0, bessel1, 'BESSELK', 2, 1);\n})();\nBESSEL.besselj = besselj;\nBESSEL.bessely = bessely;\nBESSEL.besseli = besseli;\nBESSEL.besselk = besselk;\n}));\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// This is CodeMirror (https://codemirror.net/5), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\/(\\d+)/.exec(userAgent);\n var chrome_version = chrome && +chrome[1];\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = safari && (/Mobile\\/\\w+/.test(userAgent) || navigator.maxTouchPoints > 2);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt(rootNode) {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var doc = rootNode.ownerDocument || rootNode;\n var activeElement;\n try {\n activeElement = rootNode.activeElement;\n } catch(e) {\n activeElement = doc.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function doc(cm) { return cm.display.wrapper.ownerDocument }\n\n function root(cm) {\n return rootNode(cm.display.wrapper)\n }\n\n function rootNode(element) {\n // Detect modern browsers (2017+).\n return element.getRootNode ? element.getRootNode() : element.ownerDocument\n }\n\n function win(cm) { return doc(cm).defaultView }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {\n this.id = null;\n this.f = null;\n this.time = 0;\n this.handler = bind(this.onTimeout, this);\n };\n Delayed.prototype.onTimeout = function (self) {\n self.id = 0;\n if (self.time <= +new Date) {\n self.f();\n } else {\n setTimeout(self.handler, self.time - +new Date);\n }\n };\n Delayed.prototype.set = function (ms, f) {\n this.f = f;\n var time = +new Date + ms;\n if (!this.id || time < this.time) {\n clearTimeout(this.id);\n this.id = setTimeout(this.handler, ms);\n this.time = time;\n }\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 50;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length, isRTL = direction == \"rtl\" ? 1 : 0;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n at += isRTL;\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers || (emitter._handlers = {});\n map[type] = (map[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers, arr = map && map[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range;\n try {range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\\\s)\" + lineClass[2] + \"(?:$|\\\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n\n // Add a span to a line.\n function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n gutterWrap.setAttribute(\"aria-hidden\", \"true\");\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n var isWidget = classTest(\"CodeMirror-linewidget\");\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (isWidget.test(node.className)) { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\" + (widget.className ? \" \" + widget.className : \"\"));\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\", \"CodeMirror-line-like\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i];\n mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX(doc) {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) }\n return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft\n }\n function pageScrollY(doc) {\n if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) }\n return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var ref = visualLine(lineObj);\n var widgets = ref.widgets;\n var height = 0;\n if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)\n { height += widgetHeight(widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY(doc(cm)));\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX(doc(cm)));\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX(doc(cm));\n top -= pageScrollY(doc(cm));\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = outside; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight; box.bottom += widgetHeight;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n var customCursor = cm.options.$customCursor;\n if (customCursor) { primary = true; }\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty();\n if (customCursor) {\n var head = customCursor(cm, range);\n if (head) { drawSelectionCursor(cm, head, curFragment); }\n } else if (collapsed || cm.options.showCursorWhenSelecting) {\n drawSelectionCursor(cm, range.head, curFragment);\n }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () {\n if (!cm.hasFocus()) { onBlur(cm); }\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.hasFocus()) {\n cm.display.input.focus();\n if (!cm.state.focused) { onFocus(cm); }\n }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n if (cm.state.focused) { onBlur(cm); }\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n var doc = display.wrapper.ownerDocument;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.scrollTop = 0;\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.visibility = this.vert.style.visibility = \"hidden\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.visibility = \"\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt != bar) { bar.style.visibility = \"hidden\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt(root(cm));\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt(root(cm));\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = win(cm).getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(rootNode(snapshot.activeElt))) { return }\n snapshot.activeElt.focus();\n if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&\n snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var doc = snapshot.activeElt.ownerDocument;\n var sel = doc.defaultView.getSelection(), range = doc.createRange();\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n } else if (first) {\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(display) {\n var width = display.gutters.offsetWidth;\n display.sizer.style.marginLeft = width + \"px\";\n // Send an event to consumers responding to changes in gutter width.\n signalLater(display, \"gutterChanged\", display);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }\n\n function getGutters(gutters, lineNumbers) {\n var result = [], sawLineNumbers = false;\n for (var i = 0; i < gutters.length; i++) {\n var name = gutters[i], style = null;\n if (typeof name != \"string\") { style = name.style; name = name.className; }\n if (name == \"CodeMirror-linenumbers\") {\n if (!lineNumbers) { continue }\n else { sawLineNumbers = true; }\n }\n result.push({className: name, style: style});\n }\n if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n return result\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }\n\n function updateGutters(cm) {\n renderGutters(cm.display);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input, options) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n // See #6982. FIXME remove when this has been fixed for a while in Chrome\n if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = \"inset(0px)\"; }\n\n // This attribute is respected by automatic translation systems such as Google Translate,\n // and may also be respected by tools used by human translators.\n d.wrapper.setAttribute('translate', 'no');\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n renderGutters(d);\n\n input.init(d);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n // On Chrome 102, viewport updates somehow stop wheel-based\n // scrolling. Turning off pointer events during the scroll seems\n // to avoid the issue.\n if (chrome && chrome_version == 102) {\n if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = \"none\"; }\n else { clearTimeout(cm.display.chromeScrollHack); }\n cm.display.chromeScrollHack = setTimeout(function () {\n cm.display.chromeScrollHack = null;\n cm.display.sizer.style.pointerEvents = \"\";\n }, 100);\n }\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n var pixelsPerUnit = wheelPixelsPerUnit;\n if (e.deltaMode === 0) {\n dx = e.deltaX;\n dy = e.deltaY;\n pixelsPerUnit = 1;\n }\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && pixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && pixelsPerUnit != null) {\n var pixels = dy * pixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20 && e.deltaMode !== 0) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n cm.options.direction = doc.direction;\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(prev) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = prev ? prev.undoDepth : Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption(\"readOnly\") != \"nocursor\")\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n\n // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n // is with selectLeft/Right\n var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? preventCursorRight : preventCursorLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? preventCursorLeft : preventCursorRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n\n if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))\n { doc.cantEdit = false; }\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n { if (op(this.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n if (lineSep === '') { return lines.join('') }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range.head; }\n else if (start == \"anchor\") { pos = range.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to(); }\n else { pos = range.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head || ranges[i].anchor)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {\n var this$1 = this;\n\n this.history = new History(this.history);\n linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);\n },\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) { continue }\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var markAsReadAndPasteIfAllFilesAreRead = function () {\n if (++read == n) {\n operation(cm, function () {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(\n text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));\n })();\n }\n };\n var readTextFromFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n var reader = new FileReader;\n reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };\n reader.onload = function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n text[i] = content;\n markAsReadAndPasteIfAllFilesAreRead();\n };\n reader.readAsText(file);\n };\n for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e$1){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 224: \"Mod\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\", \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\",\n \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\",\n \"Ctrl-T\": \"transposeChars\", \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Mod\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n if (cm.doc.direction == \"rtl\") { dir = -dir; }\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"codepoint\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(start.ch, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n cm.curOp.focus = activeElt(root(cm));\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)\n { document.execCommand(\"cut\"); }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n win(cm).focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(root(cm)); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n if (cm.state.delayingBlurEvent) {\n if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }\n else { delayBlurEvent(cm); }\n }\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if ((webkit && !safari) || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { return display.input.focus(); }, 20);\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n if (ie) { delayBlurEvent(cm); }\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt(root(cm));\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e$1) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.display.gutterSpecs[i];\n signal(cm, type, cm, line, gutter.className, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\u202d\\u202e\\u2066\\u2067\\u2069\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n updateGutters(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm, val) {\n cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n updateGutters(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm, val) {\n cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n updateGutters(cm);\n }, true);\n option(\"firstLineNumber\", 1, updateGutters, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n\n option(\"screenReaderLabel\", null, function (cm, val) {\n val = (val === '') ? null : val;\n cm.display.input.screenReaderLabelChanged(val);\n });\n\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input, options);\n display.wrapper.CodeMirror = this;\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(function () {\n if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }\n }, 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == textLines.join(\"\\n\"))\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus())\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", autocorrect ? \"on\" : \"off\");\n field.setAttribute(\"autocapitalize\", autocapitalize ? \"on\" : \"off\");\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){win(this).focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(root(this)) },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"codepoint\", \"char\", \"column\" (like char, but\n // doesn't cross line boundaries), \"word\" (across next word), or\n // \"group\" (to the start of next group of word or\n // non-word-non-whitespace chars). The visually param controls\n // whether, in right-to-left text, direction 1 means to move towards\n // the next index in the string, or towards the character to the right\n // of the current position. The resulting position will have a\n // hitSide=true property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n var lineDir = visually && doc.direction == \"rtl\" ? -dir : dir;\n function findNextLine() {\n var l = pos.line + lineDir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (unit == \"codepoint\") {\n var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));\n if (isNaN(ch)) {\n next = null;\n } else {\n var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;\n next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);\n }\n } else if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\" || unit == \"codepoint\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n div.contentEditable = true;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n function belongsToInput(e) {\n for (var t = e.target; t; t = t.parentNode) {\n if (t == div) { return true }\n if (/\\bCodeMirror-(?:line)?widget\\b/.test(t.className)) { break }\n }\n return false\n }\n\n on(div, \"paste\", function (e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n disableBrowserMagic(te);\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = activeElt(rootNode(div));\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.div.setAttribute('aria-label', label);\n } else {\n this.div.removeAttribute('aria-label');\n }\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = activeElt(rootNode(this.div)) == this.div;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor() || activeElt(rootNode(this.div)) != this.div)\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var this$1 = this;\n\n var input = this;\n if (this.selectionInEditor())\n { setTimeout(function () { return this$1.pollSelection(); }, 20); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find(0)))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n this.resetting = false;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n var opts = this.cm.options;\n disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);\n };\n\n TextareaInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.textarea.setAttribute('aria-label', label);\n } else {\n this.textarea.removeAttribute('aria-label');\n }\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing && typing) { return }\n var cm = this.cm;\n this.resetting = true;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n this.resetting = false;\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt(rootNode(this.textarea)) != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || this.resetting || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n this.textarea.readOnly = !!val;\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt(rootNode(textarea));\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, \u2026*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.65.16\";\n\n return CodeMirror;\n\n})));\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var trackScope = parserConfig.trackScope !== false\n var isTS = parserConfig.typescript;\n var wordRE = parserConfig.wordCharacters || /[\\w$\\xa1-\\uffff]/;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\"), D = kw(\"keyword d\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n return {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": D, \"break\": D, \"continue\": D, \"new\": kw(\"new\"), \"delete\": C, \"void\": C, \"throw\": C,\n \"debugger\": kw(\"debugger\"), \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C,\n \"await\": C\n };\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^@]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d[\\d_]*(?:[eE][+\\-]?[\\d_]+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.match(/^(?:x[\\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^[\\d_]*(?:n|(?:\\.[\\d_]*)?(?:[eE][+\\-]?[\\d_]+)?)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (expressionAllowed(stream, state, 1)) {\n readRegexp(stream);\n stream.match(/^\\b(([gimyus])(?![gimyus]*\\2))+\\b/);\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eat(\"=\");\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\" && stream.peek() == \"!\") {\n stream.skipToEnd();\n return ret(\"meta\", \"meta\");\n } else if (ch == \"#\" && stream.eatWhile(wordRE)) {\n return ret(\"variable\", \"property\")\n } else if (ch == \"<\" && stream.match(\"!--\") ||\n (ch == \"-\" && stream.match(\"->\") && !/\\S/.test(stream.string.slice(0, stream.start)))) {\n stream.skipToEnd()\n return ret(\"comment\", \"comment\")\n } else if (isOperatorChar.test(ch)) {\n if (ch != \">\" || !state.lexical || state.lexical.type != \">\") {\n if (stream.eat(\"=\")) {\n if (ch == \"!\" || ch == \"=\") stream.eat(\"=\")\n } else if (/[<>*+\\-|&?]/.test(ch)) {\n stream.eat(ch)\n if (ch == \">\") stream.eat(ch)\n }\n }\n if (ch == \"?\" && stream.eat(\".\")) return ret(\".\")\n return ret(\"operator\", \"operator\", stream.current());\n } else if (wordRE.test(ch)) {\n stream.eatWhile(wordRE);\n var word = stream.current()\n if (state.lastType != \".\") {\n if (keywords.propertyIsEnumerable(word)) {\n var kw = keywords[word]\n return ret(kw.type, kw.style, word)\n }\n if (word == \"async\" && stream.match(/^(\\s|\\/\\*([^*]|\\*(?!\\/))*?\\*\\/)*[\\[\\(\\w]/, false))\n return ret(\"async\", \"keyword\", word)\n }\n return ret(\"variable\", \"variable\", word)\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n if (isTS) { // Try to skip TypeScript return type declarations after the arguments\n var m = /:\\s*(?:\\w+(?:<[^>]*>|\\[\\])?|\\{[^}]*\\})\\s*$/.exec(stream.string.slice(stream.start, arrow))\n if (m) arrow = m.index\n }\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) { if (ch == \"(\") sawSomething = true; break; }\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (wordRE.test(ch)) {\n sawSomething = true;\n } else if (/[\"'\\/`]/.test(ch)) {\n for (;; --pos) {\n if (pos == 0) return\n var next = stream.string.charAt(pos - 1)\n if (next == ch && stream.string.charAt(pos - 2) != \"\\\\\") { pos--; break }\n }\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true,\n \"regexp\": true, \"this\": true, \"import\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n if (!trackScope) return false\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function inList(name, list) {\n for (var v = list; v; v = v.next) if (v.name == name) return true\n return false;\n }\n function register(varname) {\n var state = cx.state;\n cx.marked = \"def\";\n if (!trackScope) return\n if (state.context) {\n if (state.lexical.info == \"var\" && state.context && state.context.block) {\n // FIXME function decls are also not block scoped\n var newContext = registerVarScoped(varname, state.context)\n if (newContext != null) {\n state.context = newContext\n return\n }\n } else if (!inList(varname, state.localVars)) {\n state.localVars = new Var(varname, state.localVars)\n return\n }\n }\n // Fall through means this is global\n if (parserConfig.globalVars && !inList(varname, state.globalVars))\n state.globalVars = new Var(varname, state.globalVars)\n }\n function registerVarScoped(varname, context) {\n if (!context) {\n return null\n } else if (context.block) {\n var inner = registerVarScoped(varname, context.prev)\n if (!inner) return null\n if (inner == context.prev) return context\n return new Context(inner, context.vars, true)\n } else if (inList(varname, context.vars)) {\n return context\n } else {\n return new Context(context.prev, new Var(varname, context.vars), false)\n }\n }\n\n function isModifier(name) {\n return name == \"public\" || name == \"private\" || name == \"protected\" || name == \"abstract\" || name == \"readonly\"\n }\n\n // Combinators\n\n function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }\n function Var(name, next) { this.name = name; this.next = next }\n\n var defaultVars = new Var(\"this\", new Var(\"arguments\", null))\n function pushcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, false)\n cx.state.localVars = defaultVars\n }\n function pushblockcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, true)\n cx.state.localVars = null\n }\n pushcontext.lex = pushblockcontext.lex = true\n function popcontext() {\n cx.state.localVars = cx.state.context.vars\n cx.state.context = cx.state.context.prev\n }\n popcontext.lex = true\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n else for (var outer = state.lexical; outer && outer.type == \")\" && outer.align; outer = outer.prev)\n indent = outer.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\" || type == \"}\" || type == \")\" || type == \"]\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), parenExpr, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"keyword d\") return cx.stream.match(/^\\s*$/, false) ? cont() : cont(pushlex(\"stat\"), maybeexpression, expect(\";\"), poplex);\n if (type == \"debugger\") return cont(expect(\";\"));\n if (type == \"{\") return cont(pushlex(\"}\"), pushblockcontext, block, poplex, popcontext);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), parenExpr, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), pushblockcontext, forspec, statement, popcontext, poplex);\n if (type == \"class\" || (isTS && value == \"interface\")) {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\", type == \"class\" ? type : value), className, poplex)\n }\n if (type == \"variable\") {\n if (isTS && value == \"declare\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else if (isTS && (value == \"module\" || value == \"enum\" || value == \"type\") && cx.stream.match(/^\\s*\\w/, false)) {\n cx.marked = \"keyword\"\n if (value == \"enum\") return cont(enumdef);\n else if (value == \"type\") return cont(typename, expect(\"operator\"), typeexpr, expect(\";\"));\n else return cont(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), block, poplex, poplex)\n } else if (isTS && value == \"namespace\") {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\"), expression, statement, poplex)\n } else if (isTS && value == \"abstract\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else {\n return cont(pushlex(\"stat\"), maybelabel);\n }\n }\n if (type == \"switch\") return cont(pushlex(\"form\"), parenExpr, expect(\"{\"), pushlex(\"}\", \"switch\"), pushblockcontext,\n block, poplex, poplex, popcontext);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);\n if (type == \"export\") return cont(pushlex(\"stat\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"stat\"), afterImport, poplex);\n if (type == \"async\") return cont(statement)\n if (value == \"@\") return cont(expression, statement)\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function maybeCatchBinding(type) {\n if (type == \"(\") return cont(funarg, expect(\")\"))\n }\n function expression(type, value) {\n return expressionInner(type, value, false);\n }\n function expressionNoComma(type, value) {\n return expressionInner(type, value, true);\n }\n function parenExpr(type) {\n if (type != \"(\") return pass()\n return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex)\n }\n function expressionInner(type, value, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"class\" || (isTS && value == \"interface\")) { cx.marked = \"keyword\"; return cont(pushlex(\"form\"), classExpression, poplex); }\n if (type == \"keyword c\" || type == \"async\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") return pass(quasi, maybeop);\n if (type == \"new\") return cont(maybeTarget(noComma));\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(maybeexpression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (type == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value) || isTS && value == \"!\") return cont(me);\n if (isTS && value == \"<\" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\\s*\\(/, false))\n return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n if (isTS && value == \"as\") { cx.marked = \"keyword\"; return cont(typeexpr, me) }\n if (type == \"regexp\") {\n cx.state.lastType = cx.marked = \"operator\"\n cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)\n return cont(expr)\n }\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(maybeexpression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expressionNoComma);\n }\n function maybeTarget(noComma) {\n return function(type) {\n if (type == \".\") return cont(noComma ? targetNoComma : target);\n else if (type == \"variable\" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)\n else return pass(noComma ? expressionNoComma : expression);\n };\n }\n function target(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorComma); }\n }\n function targetNoComma(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorNoComma); }\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"async\") {\n cx.marked = \"property\";\n return cont(objprop);\n } else if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params\n if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\\s*:\\s*/, false)))\n cx.state.fatArrowAt = cx.stream.pos + m[0].length\n return cont(afterprop);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (cx.style + \" property\");\n return cont(afterprop);\n } else if (type == \"jsonld-keyword\") {\n return cont(afterprop);\n } else if (isTS && isModifier(value)) {\n cx.marked = \"keyword\"\n return cont(objprop)\n } else if (type == \"[\") {\n return cont(expression, maybetype, expect(\"]\"), afterprop);\n } else if (type == \"spread\") {\n return cont(expressionNoComma, afterprop);\n } else if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(objprop);\n } else if (type == \":\") {\n return pass(afterprop)\n }\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end, sep) {\n function proceed(type, value) {\n if (sep ? sep.indexOf(type) > -1 : type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(function(type, value) {\n if (type == end || value == end) return pass()\n return pass(what)\n }, proceed);\n }\n if (type == end || value == end) return cont();\n if (sep && sep.indexOf(\";\") > -1) return pass(what)\n return cont(expect(end));\n }\n return function(type, value) {\n if (type == end || value == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type, value) {\n if (isTS) {\n if (type == \":\") return cont(typeexpr);\n if (value == \"?\") return cont(maybetype);\n }\n }\n function maybetypeOrIn(type, value) {\n if (isTS && (type == \":\" || value == \"in\")) return cont(typeexpr)\n }\n function mayberettype(type) {\n if (isTS && type == \":\") {\n if (cx.stream.match(/^\\s*\\w+\\s+is\\b/, false)) return cont(expression, isKW, typeexpr)\n else return cont(typeexpr)\n }\n }\n function isKW(_, value) {\n if (value == \"is\") {\n cx.marked = \"keyword\"\n return cont()\n }\n }\n function typeexpr(type, value) {\n if (value == \"keyof\" || value == \"typeof\" || value == \"infer\" || value == \"readonly\") {\n cx.marked = \"keyword\"\n return cont(value == \"typeof\" ? expressionNoComma : typeexpr)\n }\n if (type == \"variable\" || value == \"void\") {\n cx.marked = \"type\"\n return cont(afterType)\n }\n if (value == \"|\" || value == \"&\") return cont(typeexpr)\n if (type == \"string\" || type == \"number\" || type == \"atom\") return cont(afterType);\n if (type == \"[\") return cont(pushlex(\"]\"), commasep(typeexpr, \"]\", \",\"), poplex, afterType)\n if (type == \"{\") return cont(pushlex(\"}\"), typeprops, poplex, afterType)\n if (type == \"(\") return cont(commasep(typearg, \")\"), maybeReturnType, afterType)\n if (type == \"<\") return cont(commasep(typeexpr, \">\"), typeexpr)\n if (type == \"quasi\") { return pass(quasiType, afterType); }\n }\n function maybeReturnType(type) {\n if (type == \"=>\") return cont(typeexpr)\n }\n function typeprops(type) {\n if (type.match(/[\\}\\)\\]]/)) return cont()\n if (type == \",\" || type == \";\") return cont(typeprops)\n return pass(typeprop, typeprops)\n }\n function typeprop(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\"\n return cont(typeprop)\n } else if (value == \"?\" || type == \"number\" || type == \"string\") {\n return cont(typeprop)\n } else if (type == \":\") {\n return cont(typeexpr)\n } else if (type == \"[\") {\n return cont(expect(\"variable\"), maybetypeOrIn, expect(\"]\"), typeprop)\n } else if (type == \"(\") {\n return pass(functiondecl, typeprop)\n } else if (!type.match(/[;\\}\\)\\],]/)) {\n return cont()\n }\n }\n function quasiType(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasiType);\n return cont(typeexpr, continueQuasiType);\n }\n function continueQuasiType(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasiType);\n }\n }\n function typearg(type, value) {\n if (type == \"variable\" && cx.stream.match(/^\\s*[?:]/, false) || value == \"?\") return cont(typearg)\n if (type == \":\") return cont(typeexpr)\n if (type == \"spread\") return cont(typearg)\n return pass(typeexpr)\n }\n function afterType(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n if (value == \"|\" || type == \".\" || value == \"&\") return cont(typeexpr)\n if (type == \"[\") return cont(typeexpr, expect(\"]\"), afterType)\n if (value == \"extends\" || value == \"implements\") { cx.marked = \"keyword\"; return cont(typeexpr) }\n if (value == \"?\") return cont(typeexpr, expect(\":\"), typeexpr)\n }\n function maybeTypeArgs(_, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n }\n function typeparam() {\n return pass(typeexpr, maybeTypeDefault)\n }\n function maybeTypeDefault(_, value) {\n if (value == \"=\") return cont(typeexpr)\n }\n function vardef(_, value) {\n if (value == \"enum\") {cx.marked = \"keyword\"; return cont(enumdef)}\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(pattern) }\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"spread\") return cont(pattern);\n if (type == \"[\") return contCommasep(eltpattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n if (type == \"spread\") return cont(pattern);\n if (type == \"}\") return pass();\n if (type == \"[\") return cont(expression, expect(']'), expect(':'), proppattern);\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function eltpattern() {\n return pass(pattern, maybeAssign)\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type, value) {\n if (value == \"await\") return cont(forspec);\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, forspec2);\n if (type == \"variable\") return cont(forspec2);\n return pass(forspec2)\n }\n function forspec2(type, value) {\n if (type == \")\") return cont()\n if (type == \";\") return cont(forspec2)\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression, forspec2) }\n return pass(expression, forspec2)\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, statement, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondef)\n }\n function functiondecl(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondecl);}\n if (type == \"variable\") {register(value); return cont(functiondecl);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondecl)\n }\n function typename(type, value) {\n if (type == \"keyword\" || type == \"variable\") {\n cx.marked = \"type\"\n return cont(typename)\n } else if (value == \"<\") {\n return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex)\n }\n }\n function funarg(type, value) {\n if (value == \"@\") cont(expression, funarg)\n if (type == \"spread\") return cont(funarg);\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(funarg); }\n if (isTS && type == \"this\") return cont(maybetype, maybeAssign)\n return pass(pattern, maybetype, maybeAssign);\n }\n function classExpression(type, value) {\n // Class expressions may have an optional name.\n if (type == \"variable\") return className(type, value);\n return classNameAfter(type, value);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, classNameAfter)\n if (value == \"extends\" || value == \"implements\" || (isTS && type == \",\")) {\n if (value == \"implements\") cx.marked = \"keyword\";\n return cont(isTS ? typeexpr : expression, classNameAfter);\n }\n if (type == \"{\") return cont(pushlex(\"}\"), classBody, poplex);\n }\n function classBody(type, value) {\n if (type == \"async\" ||\n (type == \"variable\" &&\n (value == \"static\" || value == \"get\" || value == \"set\" || (isTS && isModifier(value))) &&\n cx.stream.match(/^\\s+#?[\\w$\\xa1-\\uffff]/, false))) {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n return cont(classfield, classBody);\n }\n if (type == \"number\" || type == \"string\") return cont(classfield, classBody);\n if (type == \"[\")\n return cont(expression, maybetype, expect(\"]\"), classfield, classBody)\n if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (isTS && type == \"(\") return pass(functiondecl, classBody)\n if (type == \";\" || type == \",\") return cont(classBody);\n if (type == \"}\") return cont();\n if (value == \"@\") return cont(expression, classBody)\n }\n function classfield(type, value) {\n if (value == \"!\") return cont(classfield)\n if (value == \"?\") return cont(classfield)\n if (type == \":\") return cont(typeexpr, maybeAssign)\n if (value == \"=\") return cont(expressionNoComma)\n var context = cx.state.lexical.prev, isInterface = context && context.info == \"interface\"\n return pass(isInterface ? functiondecl : functiondef)\n }\n function afterExport(type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n if (type == \"{\") return cont(commasep(exportField, \"}\"), maybeFrom, expect(\";\"));\n return pass(statement);\n }\n function exportField(type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(expect(\"variable\")); }\n if (type == \"variable\") return pass(expressionNoComma, exportField);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n if (type == \"(\") return pass(expression);\n if (type == \".\") return pass(maybeoperatorComma);\n return pass(importSpec, maybeMoreImports, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n if (value == \"*\") cx.marked = \"keyword\";\n return cont(maybeAs);\n }\n function maybeMoreImports(type) {\n if (type == \",\") return cont(importSpec, maybeMoreImports)\n }\n function maybeAs(_type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(importSpec); }\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(commasep(expressionNoComma, \"]\"));\n }\n function enumdef() {\n return pass(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), commasep(enummember, \"}\"), poplex, poplex)\n }\n function enummember() {\n return pass(pattern, maybeAssign);\n }\n\n function isContinuedStatement(state, textAfter) {\n return state.lastType == \"operator\" || state.lastType == \",\" ||\n isOperatorChar.test(textAfter.charAt(0)) ||\n /[,.]/.test(textAfter.charAt(0));\n }\n\n function expressionAllowed(stream, state, backUp) {\n return state.tokenize == tokenBase &&\n /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\\[{}\\(,;:]|=>)$/.test(state.lastType) ||\n (state.lastType == \"quasi\" && /\\{\\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && new Context(null, null, false),\n indented: basecolumn || 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse && c != popcontext) break;\n }\n while ((lexical.type == \"stat\" || lexical.type == \"form\") &&\n (firstChar == \"}\" || ((top = state.cc[state.cc.length - 1]) &&\n (top == maybeoperatorComma || top == maybeoperatorNoComma) &&\n !/^[,\\.=+\\-*:?[\\(]/.test(textAfter))))\n lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info.length + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricInput: /^\\s*(?:case .*?:|default:|\\{|\\})$/,\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n blockCommentContinue: jsonMode ? null : \" * \",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode,\n\n expressionAllowed: expressionAllowed,\n\n skipExpression: function(state) {\n parseJS(state, \"atom\", \"atom\", \"true\", new CodeMirror.StringStream(\"\", 2, null))\n }\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/x-javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/x-json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/manifest+json\", { name: \"javascript\", json: true })\nCodeMirror.defineMIME(\"application/ld+json\", { name: \"javascript\", jsonld: true });\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Open simple dialogs on top of an editor. Relies on dialog.css.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n function dialogDiv(cm, template, bottom) {\n var wrap = cm.getWrapperElement();\n var dialog;\n dialog = wrap.appendChild(document.createElement(\"div\"));\n if (bottom)\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-bottom\";\n else\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-top\";\n\n if (typeof template == \"string\") {\n dialog.innerHTML = template;\n } else { // Assuming it's a detached DOM element.\n dialog.appendChild(template);\n }\n CodeMirror.addClass(wrap, 'dialog-opened');\n return dialog;\n }\n\n function closeNotification(cm, newVal) {\n if (cm.state.currentNotificationClose)\n cm.state.currentNotificationClose();\n cm.state.currentNotificationClose = newVal;\n }\n\n CodeMirror.defineExtension(\"openDialog\", function(template, callback, options) {\n if (!options) options = {};\n\n closeNotification(this, null);\n\n var dialog = dialogDiv(this, template, options.bottom);\n var closed = false, me = this;\n function close(newVal) {\n if (typeof newVal == 'string') {\n inp.value = newVal;\n } else {\n if (closed) return;\n closed = true;\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n me.focus();\n\n if (options.onClose) options.onClose(dialog);\n }\n }\n\n var inp = dialog.getElementsByTagName(\"input\")[0], button;\n if (inp) {\n inp.focus();\n\n if (options.value) {\n inp.value = options.value;\n if (options.selectValueOnOpen !== false) {\n inp.select();\n }\n }\n\n if (options.onInput)\n CodeMirror.on(inp, \"input\", function(e) { options.onInput(e, inp.value, close);});\n if (options.onKeyUp)\n CodeMirror.on(inp, \"keyup\", function(e) {options.onKeyUp(e, inp.value, close);});\n\n CodeMirror.on(inp, \"keydown\", function(e) {\n if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }\n if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {\n inp.blur();\n CodeMirror.e_stop(e);\n close();\n }\n if (e.keyCode == 13) callback(inp.value, e);\n });\n\n if (options.closeOnBlur !== false) CodeMirror.on(dialog, \"focusout\", function (evt) {\n if (evt.relatedTarget !== null) close();\n });\n } else if (button = dialog.getElementsByTagName(\"button\")[0]) {\n CodeMirror.on(button, \"click\", function() {\n close();\n me.focus();\n });\n\n if (options.closeOnBlur !== false) CodeMirror.on(button, \"blur\", close);\n\n button.focus();\n }\n return close;\n });\n\n CodeMirror.defineExtension(\"openConfirm\", function(template, callbacks, options) {\n closeNotification(this, null);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var buttons = dialog.getElementsByTagName(\"button\");\n var closed = false, me = this, blurring = 1;\n function close() {\n if (closed) return;\n closed = true;\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n me.focus();\n }\n buttons[0].focus();\n for (var i = 0; i < buttons.length; ++i) {\n var b = buttons[i];\n (function(callback) {\n CodeMirror.on(b, \"click\", function(e) {\n CodeMirror.e_preventDefault(e);\n close();\n if (callback) callback(me);\n });\n })(callbacks[i]);\n CodeMirror.on(b, \"blur\", function() {\n --blurring;\n setTimeout(function() { if (blurring <= 0) close(); }, 200);\n });\n CodeMirror.on(b, \"focus\", function() { ++blurring; });\n }\n });\n\n /*\n * openNotification\n * Opens a notification, that can be closed with an optional timer\n * (default 5000ms timer) and always closes on click.\n *\n * If a notification is opened while another is opened, it will close the\n * currently opened one and open the new one immediately.\n */\n CodeMirror.defineExtension(\"openNotification\", function(template, options) {\n closeNotification(this, close);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var closed = false, doneTimer;\n var duration = options && typeof options.duration !== \"undefined\" ? options.duration : 5000;\n\n function close() {\n if (closed) return;\n closed = true;\n clearTimeout(doneTimer);\n CodeMirror.rmClass(dialog.parentNode, 'dialog-opened');\n dialog.parentNode.removeChild(dialog);\n }\n\n CodeMirror.on(dialog, 'click', function(e) {\n CodeMirror.e_preventDefault(e);\n close();\n });\n\n if (duration)\n doneTimer = setTimeout(close, duration);\n\n return close;\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n CodeMirror.defineOption(\"placeholder\", \"\", function(cm, val, old) {\n var prev = old && old != CodeMirror.Init;\n if (val && !prev) {\n cm.on(\"blur\", onBlur);\n cm.on(\"change\", onChange);\n cm.on(\"swapDoc\", onChange);\n CodeMirror.on(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose = function() { onComposition(cm) })\n onChange(cm);\n } else if (!val && prev) {\n cm.off(\"blur\", onBlur);\n cm.off(\"change\", onChange);\n cm.off(\"swapDoc\", onChange);\n CodeMirror.off(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose)\n clearPlaceholder(cm);\n var wrapper = cm.getWrapperElement();\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\");\n }\n\n if (val && !cm.hasFocus()) onBlur(cm);\n });\n\n function clearPlaceholder(cm) {\n if (cm.state.placeholder) {\n cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);\n cm.state.placeholder = null;\n }\n }\n function setPlaceholder(cm) {\n clearPlaceholder(cm);\n var elt = cm.state.placeholder = document.createElement(\"pre\");\n elt.style.cssText = \"height: 0; overflow: visible\";\n elt.style.direction = cm.getOption(\"direction\");\n elt.className = \"CodeMirror-placeholder CodeMirror-line-like\";\n var placeHolder = cm.getOption(\"placeholder\")\n if (typeof placeHolder == \"string\") placeHolder = document.createTextNode(placeHolder)\n elt.appendChild(placeHolder)\n cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);\n }\n\n function onComposition(cm) {\n setTimeout(function() {\n var empty = false\n if (cm.lineCount() == 1) {\n var input = cm.getInputField()\n empty = input.nodeName == \"TEXTAREA\" ? !cm.getLine(0).length\n : !/[^\\u200b]/.test(input.querySelector(\".CodeMirror-line\").textContent)\n }\n if (empty) setPlaceholder(cm)\n else clearPlaceholder(cm)\n }, 20)\n }\n\n function onBlur(cm) {\n if (isEmpty(cm)) setPlaceholder(cm);\n }\n function onChange(cm) {\n var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\") + (empty ? \" CodeMirror-empty\" : \"\");\n\n if (empty) setPlaceholder(cm);\n else clearPlaceholder(cm);\n }\n\n function isEmpty(cm) {\n return (cm.lineCount() === 1) && (cm.getLine(0) === \"\");\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var defaults = {\n pairs: \"()[]{}''\\\"\\\"\",\n closeBefore: \")]}'\\\":;>\",\n triples: \"\",\n explode: \"[]{}\"\n };\n\n var Pos = CodeMirror.Pos;\n\n CodeMirror.defineOption(\"autoCloseBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.removeKeyMap(keyMap);\n cm.state.closeBrackets = null;\n }\n if (val) {\n ensureBound(getOption(val, \"pairs\"))\n cm.state.closeBrackets = val;\n cm.addKeyMap(keyMap);\n }\n });\n\n function getOption(conf, name) {\n if (name == \"pairs\" && typeof conf == \"string\") return conf;\n if (typeof conf == \"object\" && conf[name] != null) return conf[name];\n return defaults[name];\n }\n\n var keyMap = {Backspace: handleBackspace, Enter: handleEnter};\n function ensureBound(chars) {\n for (var i = 0; i < chars.length; i++) {\n var ch = chars.charAt(i), key = \"'\" + ch + \"'\"\n if (!keyMap[key]) keyMap[key] = handler(ch)\n }\n }\n ensureBound(defaults.pairs + \"`\")\n\n function handler(ch) {\n return function(cm) { return handleChar(cm, ch); };\n }\n\n function getConfig(cm) {\n var deflt = cm.state.closeBrackets;\n if (!deflt || deflt.override) return deflt;\n var mode = cm.getModeAt(cm.getCursor());\n return mode.closeBrackets || deflt;\n }\n\n function handleBackspace(cm) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n for (var i = ranges.length - 1; i >= 0; i--) {\n var cur = ranges[i].head;\n cm.replaceRange(\"\", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), \"+delete\");\n }\n }\n\n function handleEnter(cm) {\n var conf = getConfig(cm);\n var explode = conf && getOption(conf, \"explode\");\n if (!explode || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n cm.operation(function() {\n var linesep = cm.lineSeparator() || \"\\n\";\n cm.replaceSelection(linesep + linesep, null);\n moveSel(cm, -1)\n ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var line = ranges[i].head.line;\n cm.indentLine(line, null, true);\n cm.indentLine(line + 1, null, true);\n }\n });\n }\n\n function moveSel(cm, dir) {\n var newRanges = [], ranges = cm.listSelections(), primary = 0\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i]\n if (range.head == cm.getCursor()) primary = i\n var pos = range.head.ch || dir > 0 ? {line: range.head.line, ch: range.head.ch + dir} : {line: range.head.line - 1}\n newRanges.push({anchor: pos, head: pos})\n }\n cm.setSelections(newRanges, primary)\n }\n\n function contractSelection(sel) {\n var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;\n return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),\n head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};\n }\n\n function handleChar(cm, ch) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var pos = pairs.indexOf(ch);\n if (pos == -1) return CodeMirror.Pass;\n\n var closeBefore = getOption(conf,\"closeBefore\");\n\n var triples = getOption(conf, \"triples\");\n\n var identical = pairs.charAt(pos + 1) == ch;\n var ranges = cm.listSelections();\n var opening = pos % 2 == 0;\n\n var type;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], cur = range.head, curType;\n var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));\n if (opening && !range.empty()) {\n curType = \"surround\";\n } else if ((identical || !opening) && next == ch) {\n if (identical && stringStartsAfter(cm, cur))\n curType = \"both\";\n else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)\n curType = \"skipThree\";\n else\n curType = \"skip\";\n } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&\n cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) {\n if (cur.ch > 2 && /\\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass;\n curType = \"addFour\";\n } else if (identical) {\n var prev = cur.ch == 0 ? \" \" : cm.getRange(Pos(cur.line, cur.ch - 1), cur)\n if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = \"both\";\n else return CodeMirror.Pass;\n } else if (opening && (next.length === 0 || /\\s/.test(next) || closeBefore.indexOf(next) > -1)) {\n curType = \"both\";\n } else {\n return CodeMirror.Pass;\n }\n if (!type) type = curType;\n else if (type != curType) return CodeMirror.Pass;\n }\n\n var left = pos % 2 ? pairs.charAt(pos - 1) : ch;\n var right = pos % 2 ? ch : pairs.charAt(pos + 1);\n cm.operation(function() {\n if (type == \"skip\") {\n moveSel(cm, 1)\n } else if (type == \"skipThree\") {\n moveSel(cm, 3)\n } else if (type == \"surround\") {\n var sels = cm.getSelections();\n for (var i = 0; i < sels.length; i++)\n sels[i] = left + sels[i] + right;\n cm.replaceSelections(sels, \"around\");\n sels = cm.listSelections().slice();\n for (var i = 0; i < sels.length; i++)\n sels[i] = contractSelection(sels[i]);\n cm.setSelections(sels);\n } else if (type == \"both\") {\n cm.replaceSelection(left + right, null);\n cm.triggerElectric(left + right);\n moveSel(cm, -1)\n } else if (type == \"addFour\") {\n cm.replaceSelection(left + left + left + left, \"before\");\n moveSel(cm, 1)\n }\n });\n }\n\n function charsAround(cm, pos) {\n var str = cm.getRange(Pos(pos.line, pos.ch - 1),\n Pos(pos.line, pos.ch + 1));\n return str.length == 2 ? str : null;\n }\n\n function stringStartsAfter(cm, pos) {\n var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))\n return /\\bstring/.test(token.type) && token.start == pos.ch &&\n (pos.ch == 0 || !/\\bstring/.test(cm.getTokenTypeAt(pos)))\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var ie_lt8 = /MSIE \\d/.test(navigator.userAgent) &&\n (document.documentMode == null || document.documentMode < 8);\n\n var Pos = CodeMirror.Pos;\n\n var matching = {\"(\": \")>\", \")\": \"(<\", \"[\": \"]>\", \"]\": \"[<\", \"{\": \"}>\", \"}\": \"{<\", \"<\": \">>\", \">\": \"<<\"};\n\n function bracketRegex(config) {\n return config && config.bracketRegex || /[(){}[\\]]/\n }\n\n function findMatchingBracket(cm, where, config) {\n var line = cm.getLineHandle(where.line), pos = where.ch - 1;\n var afterCursor = config && config.afterCursor\n if (afterCursor == null)\n afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)\n var re = bracketRegex(config)\n\n // A cursor is defined as between two characters, but in in vim command mode\n // (i.e. not insert mode), the cursor is visually represented as a\n // highlighted box on top of the 2nd character. Otherwise, we allow matches\n // from before or after the cursor.\n var match = (!afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)]) ||\n re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)];\n if (!match) return null;\n var dir = match.charAt(1) == \">\" ? 1 : -1;\n if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;\n var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));\n\n var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config);\n if (found == null) return null;\n return {from: Pos(where.line, pos), to: found && found.pos,\n match: found && found.ch == match.charAt(0), forward: dir > 0};\n }\n\n // bracketRegex is used to specify which type of bracket to scan\n // should be a regexp, e.g. /[[\\]]/\n //\n // Note: If \"where\" is on an open bracket, then this bracket is ignored.\n //\n // Returns false when no bracket was found, null when it reached\n // maxScanLines and gave up\n function scanForBracket(cm, where, dir, style, config) {\n var maxScanLen = (config && config.maxScanLineLength) || 10000;\n var maxScanLines = (config && config.maxScanLines) || 1000;\n\n var stack = [];\n var re = bracketRegex(config)\n var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)\n : Math.max(cm.firstLine() - 1, where.line - maxScanLines);\n for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {\n var line = cm.getLine(lineNo);\n if (!line) continue;\n var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;\n if (line.length > maxScanLen) continue;\n if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);\n for (; pos != end; pos += dir) {\n var ch = line.charAt(pos);\n if (re.test(ch) && (style === undefined ||\n (cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || \"\") == (style || \"\"))) {\n var match = matching[ch];\n if (match && (match.charAt(1) == \">\") == (dir > 0)) stack.push(ch);\n else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};\n else stack.pop();\n }\n }\n }\n return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;\n }\n\n function matchBrackets(cm, autoclear, config) {\n // Disable brace matching in long lines, since it'll cause hugely slow updates\n var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000,\n highlightNonMatching = config && config.highlightNonMatching;\n var marks = [], ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);\n if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) {\n var style = match.match ? \"CodeMirror-matchingbracket\" : \"CodeMirror-nonmatchingbracket\";\n marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));\n if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)\n marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));\n }\n }\n\n if (marks.length) {\n // Kludge to work around the IE bug from issue #1193, where text\n // input stops going to the textarea whenever this fires.\n if (ie_lt8 && cm.state.focused) cm.focus();\n\n var clear = function() {\n cm.operation(function() {\n for (var i = 0; i < marks.length; i++) marks[i].clear();\n });\n };\n if (autoclear) setTimeout(clear, 800);\n else return clear;\n }\n }\n\n function doMatchBrackets(cm) {\n cm.operation(function() {\n if (cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);\n });\n }\n\n function clearHighlighted(cm) {\n if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n }\n\n CodeMirror.defineOption(\"matchBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.off(\"cursorActivity\", doMatchBrackets);\n cm.off(\"focus\", doMatchBrackets)\n cm.off(\"blur\", clearHighlighted)\n clearHighlighted(cm);\n }\n if (val) {\n cm.state.matchBrackets = typeof val == \"object\" ? val : {};\n cm.on(\"cursorActivity\", doMatchBrackets);\n cm.on(\"focus\", doMatchBrackets)\n cm.on(\"blur\", clearHighlighted)\n }\n });\n\n CodeMirror.defineExtension(\"matchBrackets\", function() {matchBrackets(this, true);});\n CodeMirror.defineExtension(\"findMatchingBracket\", function(pos, config, oldConfig){\n // Backwards-compatibility kludge\n if (oldConfig || typeof config == \"boolean\") {\n if (!oldConfig) {\n config = config ? {strict: true} : null\n } else {\n oldConfig.strict = config\n config = oldConfig\n }\n }\n return findMatchingBracket(this, pos, config)\n });\n CodeMirror.defineExtension(\"scanForBracket\", function(pos, dir, style, config){\n return scanForBracket(this, pos, dir, style, config);\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// declare global: DOMRect\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n CodeMirror.defineExtension(\"closeHint\", function() {\n if (this.state.completionActive) this.state.completionActive.close()\n })\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n if (this.options.updateOnCursorActivity) {\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n if (this.options.updateOnCursorActivity) {\n this.cm.off(\"cursorActivity\", this.activityFunc);\n }\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i], self = this;\n this.cm.operation(function() {\n if (completion.hint)\n completion.hint(self.cm, data, completion);\n else\n self.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n self.cm.scrollIntoView();\n });\n if (this.options.closeOnPick) {\n this.close();\n }\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var identStart = this.startPos;\n if(this.data) {\n identStart = this.data.from;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < identStart.ch || this.cm.somethingSelected() ||\n (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n\n var mac = /Mac/.test(navigator.platform);\n\n if (mac) {\n baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n }\n\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.id = \"cm-complete-\" + Math.floor(Math.random(1e6))\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n var ownerDocument = cm.getInputField().ownerDocument;\n var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n var hints = this.hints = ownerDocument.createElement(\"ul\");\n hints.setAttribute(\"role\", \"listbox\")\n hints.setAttribute(\"aria-expanded\", \"true\")\n hints.id = this.id\n var theme = completion.cm.options.theme;\n hints.className = \"CodeMirror-hints \" + theme;\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (i == this.selectedHint) elt.setAttribute(\"aria-selected\", \"true\")\n elt.id = this.id + \"-\" + i\n elt.setAttribute(\"role\", \"option\")\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var container = completion.options.container || ownerDocument.body;\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n var offsetLeft = 0, offsetTop = 0;\n if (container !== ownerDocument.body) {\n // We offset the cursor position because left and top are relative to the offsetParent's top left corner.\n var isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1;\n var offsetParent = isContainerPositioned ? container : container.offsetParent;\n var offsetParentPosition = offsetParent.getBoundingClientRect();\n var bodyPosition = ownerDocument.body.getBoundingClientRect();\n offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft);\n offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop);\n }\n hints.style.left = (left - offsetLeft) + \"px\";\n hints.style.top = (top - offsetTop) + \"px\";\n\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n container.appendChild(hints);\n cm.getInputField().setAttribute(\"aria-autocomplete\", \"list\")\n cm.getInputField().setAttribute(\"aria-owns\", this.id)\n cm.getInputField().setAttribute(\"aria-activedescendant\", this.id + \"-\" + this.selectedHint)\n\n var box = completion.options.moveOnOverlap ? hints.getBoundingClientRect() : new DOMRect();\n var scrolls = completion.options.paddingForScrollbar ? hints.scrollHeight > hints.clientHeight + 1 : false;\n\n // Compute in the timeout to avoid reflow on init\n var startScroll;\n setTimeout(function() { startScroll = cm.getScrollInfo(); });\n\n var overlapY = box.bottom - winH;\n if (overlapY > 0) { // Does not fit below\n var height = box.bottom - box.top, spaceAbove = box.top - (pos.bottom - pos.top) - 2\n if (winH - box.top < spaceAbove) { // More room at the top\n if (height > spaceAbove) hints.style.height = (height = spaceAbove) + \"px\";\n hints.style.top = ((top = pos.top - height) + offsetTop) + \"px\";\n below = false;\n } else {\n hints.style.height = (winH - box.top - 2) + \"px\";\n }\n }\n var overlapX = box.right - winW;\n if (scrolls) overlapX += cm.display.nativeBarWidth;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = Math.max(pos.left - overlapX - offsetLeft, 0)) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n if (!startScroll) startScroll = cm.getScrollInfo();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n // The first hint doesn't need to be scrolled to on init\n var selectedHintRange = this.getSelectedHintRange();\n if (selectedHintRange.from !== 0 || selectedHintRange.to !== 0) {\n this.scrollToActive();\n }\n\n CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n if (this.hints.parentNode) this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n var input = this.completion.cm.getInputField()\n input.removeAttribute(\"aria-activedescendant\")\n input.removeAttribute(\"aria-owns\")\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n if (node) {\n node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node.removeAttribute(\"aria-selected\")\n }\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n node.setAttribute(\"aria-selected\", \"true\")\n this.completion.cm.getInputField().setAttribute(\"aria-activedescendant\", node.id)\n this.scrollToActive()\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n scrollToActive: function() {\n var selectedHintRange = this.getSelectedHintRange();\n var node1 = this.hints.childNodes[selectedHintRange.from];\n var node2 = this.hints.childNodes[selectedHintRange.to];\n var firstNode = this.hints.firstChild;\n if (node1.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node1.offsetTop - firstNode.offsetTop;\n else if (node2.offsetTop + node2.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node2.offsetTop + node2.offsetHeight - this.hints.clientHeight + firstNode.offsetTop;\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n },\n\n getSelectedHintRange: function() {\n var margin = this.completion.options.scrollMargin || 0;\n return {\n from: Math.max(0, this.selectedHint - margin),\n to: Math.min(this.data.list.length - 1, this.selectedHint + margin),\n };\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n term = token.string.substr(0, cur.ch - token.start)\n } else {\n term = \"\"\n from = cur\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnPick: true,\n closeOnUnfocus: true,\n updateOnCursorActivity: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null,\n paddingForScrollbar: true,\n moveOnOverlap: true,\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Defines jumpToLine command. Uses dialog.js if present.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../dialog/dialog\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../dialog/dialog\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n // default search panel location\n CodeMirror.defineOption(\"search\", {bottom: false});\n\n function dialog(cm, text, shortText, deflt, f) {\n if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});\n else f(prompt(shortText, deflt));\n }\n\n function getJumpDialog(cm) {\n return cm.phrase(\"Jump to line:\") + ' ' + cm.phrase(\"(Use line:column or scroll% syntax)\") + '';\n }\n\n function interpretLine(cm, string) {\n var num = Number(string)\n if (/^[-+]/.test(string)) return cm.getCursor().line + num\n else return num - 1\n }\n\n CodeMirror.commands.jumpToLine = function(cm) {\n var cur = cm.getCursor();\n dialog(cm, getJumpDialog(cm), cm.phrase(\"Jump to line:\"), (cur.line + 1) + \":\" + cur.ch, function(posStr) {\n if (!posStr) return;\n\n var match;\n if (match = /^\\s*([\\+\\-]?\\d+)\\s*\\:\\s*(\\d+)\\s*$/.exec(posStr)) {\n cm.setCursor(interpretLine(cm, match[1]), Number(match[2]))\n } else if (match = /^\\s*([\\+\\-]?\\d+(\\.\\d+)?)\\%\\s*/.exec(posStr)) {\n var line = Math.round(cm.lineCount() * Number(match[1]) / 100);\n if (/^[-+]/.test(match[1])) line = cur.line + line + 1;\n cm.setCursor(line - 1, cur.ch);\n } else if (match = /^\\s*\\:?\\s*([\\+\\-]?\\d+)\\s*/.exec(posStr)) {\n cm.setCursor(interpretLine(cm, match[1]), cur.ch);\n }\n });\n };\n\n CodeMirror.keyMap[\"default\"][\"Alt-G\"] = \"jumpToLine\";\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"))\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod)\n else // Plain browser env\n mod(CodeMirror)\n})(function(CodeMirror) {\n \"use strict\"\n var Pos = CodeMirror.Pos\n\n function regexpFlags(regexp) {\n var flags = regexp.flags\n return flags != null ? flags : (regexp.ignoreCase ? \"i\" : \"\")\n + (regexp.global ? \"g\" : \"\")\n + (regexp.multiline ? \"m\" : \"\")\n }\n\n function ensureFlags(regexp, flags) {\n var current = regexpFlags(regexp), target = current\n for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1)\n target += flags.charAt(i)\n return current == target ? regexp : new RegExp(regexp.source, target)\n }\n\n function maybeMultiline(regexp) {\n return /\\\\s|\\\\n|\\n|\\\\W|\\\\D|\\[\\^/.test(regexp.source)\n }\n\n function searchRegexpForward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) {\n regexp.lastIndex = ch\n var string = doc.getLine(line), match = regexp.exec(string)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpForwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start)\n\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunk = 1\n for (var line = start.line, last = doc.lastLine(); line <= last;) {\n // This grows the search buffer in exponentially-sized chunks\n // between matches, so that nearby matches are fast and don't\n // require concatenating the whole document (in case we're\n // searching for something that has tons of matches), but at the\n // same time, the amount of retries is limited.\n for (var i = 0; i < chunk; i++) {\n if (line > last) break\n var curLine = doc.getLine(line++)\n string = string == null ? curLine : string + \"\\n\" + curLine\n }\n chunk = chunk * 2\n regexp.lastIndex = start.ch\n var match = regexp.exec(string)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = start.line + before.length - 1, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n function lastMatchIn(string, regexp, endMargin) {\n var match, from = 0\n while (from <= string.length) {\n regexp.lastIndex = from\n var newMatch = regexp.exec(string)\n if (!newMatch) break\n var end = newMatch.index + newMatch[0].length\n if (end > string.length - endMargin) break\n if (!match || end > match.index + match[0].length)\n match = newMatch\n from = newMatch.index + 1\n }\n return match\n }\n\n function searchRegexpBackward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) {\n var string = doc.getLine(line)\n var match = lastMatchIn(string, regexp, ch < 0 ? 0 : string.length - ch)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpBackwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpBackward(doc, regexp, start)\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunkSize = 1, endMargin = doc.getLine(start.line).length - start.ch\n for (var line = start.line, first = doc.firstLine(); line >= first;) {\n for (var i = 0; i < chunkSize && line >= first; i++) {\n var curLine = doc.getLine(line--)\n string = string == null ? curLine : curLine + \"\\n\" + string\n }\n chunkSize *= 2\n\n var match = lastMatchIn(string, regexp, endMargin)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = line + before.length, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n var doFold, noFold\n if (String.prototype.normalize) {\n doFold = function(str) { return str.normalize(\"NFD\").toLowerCase() }\n noFold = function(str) { return str.normalize(\"NFD\") }\n } else {\n doFold = function(str) { return str.toLowerCase() }\n noFold = function(str) { return str }\n }\n\n // Maps a position in a case-folded line back to a position in the original line\n // (compensating for codepoints increasing in number during folding)\n function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }\n\n function searchStringForward(doc, query, start, caseFold) {\n // Empty string would match anything and never progress, so we\n // define it to match nothing instead.\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) {\n var orig = doc.getLine(line).slice(ch), string = fold(orig)\n if (lines.length == 1) {\n var found = string.indexOf(lines[0])\n if (found == -1) continue search\n var start = adjustPos(orig, string, found, fold) + ch\n return {from: Pos(line, adjustPos(orig, string, found, fold) + ch),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch)}\n } else {\n var cutFrom = string.length - lines[0].length\n if (string.slice(cutFrom) != lines[0]) continue search\n for (var i = 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(line + i)) != lines[i]) continue search\n var end = doc.getLine(line + lines.length - 1), endString = fold(end), lastLine = lines[lines.length - 1]\n if (endString.slice(0, lastLine.length) != lastLine) continue search\n return {from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch),\n to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold))}\n }\n }\n }\n\n function searchStringBackward(doc, query, start, caseFold) {\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) {\n var orig = doc.getLine(line)\n if (ch > -1) orig = orig.slice(0, ch)\n var string = fold(orig)\n if (lines.length == 1) {\n var found = string.lastIndexOf(lines[0])\n if (found == -1) continue search\n return {from: Pos(line, adjustPos(orig, string, found, fold)),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold))}\n } else {\n var lastLine = lines[lines.length - 1]\n if (string.slice(0, lastLine.length) != lastLine) continue search\n for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(start + i)) != lines[i]) continue search\n var top = doc.getLine(line + 1 - lines.length), topString = fold(top)\n if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search\n return {from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)),\n to: Pos(line, adjustPos(orig, string, lastLine.length, fold))}\n }\n }\n }\n\n function SearchCursor(doc, query, pos, options) {\n this.atOccurrence = false\n this.afterEmptyMatch = false\n this.doc = doc\n pos = pos ? doc.clipPos(pos) : Pos(0, 0)\n this.pos = {from: pos, to: pos}\n\n var caseFold\n if (typeof options == \"object\") {\n caseFold = options.caseFold\n } else { // Backwards compat for when caseFold was the 4th argument\n caseFold = options\n options = null\n }\n\n if (typeof query == \"string\") {\n if (caseFold == null) caseFold = false\n this.matches = function(reverse, pos) {\n return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold)\n }\n } else {\n query = ensureFlags(query, \"gm\")\n if (!options || options.multiline !== false)\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos)\n }\n else\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos)\n }\n }\n }\n\n SearchCursor.prototype = {\n findNext: function() {return this.find(false)},\n findPrevious: function() {return this.find(true)},\n\n find: function(reverse) {\n var head = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);\n if (this.afterEmptyMatch && this.atOccurrence) {\n // do not return the same 0 width match twice\n head = Pos(head.line, head.ch)\n if (reverse) {\n head.ch--;\n if (head.ch < 0) {\n head.line--;\n head.ch = (this.doc.getLine(head.line) || \"\").length;\n }\n } else {\n head.ch++;\n if (head.ch > (this.doc.getLine(head.line) || \"\").length) {\n head.ch = 0;\n head.line++;\n }\n }\n if (CodeMirror.cmpPos(head, this.doc.clipPos(head)) != 0) {\n return this.atOccurrence = false\n }\n }\n var result = this.matches(reverse, head)\n this.afterEmptyMatch = result && CodeMirror.cmpPos(result.from, result.to) == 0\n\n if (result) {\n this.pos = result\n this.atOccurrence = true\n return this.pos.match || true\n } else {\n var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0)\n this.pos = {from: end, to: end}\n return this.atOccurrence = false\n }\n },\n\n from: function() {if (this.atOccurrence) return this.pos.from},\n to: function() {if (this.atOccurrence) return this.pos.to},\n\n replace: function(newText, origin) {\n if (!this.atOccurrence) return\n var lines = CodeMirror.splitLines(newText)\n this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin)\n this.pos.to = Pos(this.pos.from.line + lines.length - 1,\n lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0))\n }\n }\n\n CodeMirror.defineExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this.doc, query, pos, caseFold)\n })\n CodeMirror.defineDocExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this, query, pos, caseFold)\n })\n\n CodeMirror.defineExtension(\"selectMatches\", function(query, caseFold) {\n var ranges = []\n var cur = this.getSearchCursor(query, this.getCursor(\"from\"), caseFold)\n while (cur.findNext()) {\n if (CodeMirror.cmpPos(cur.to(), this.getCursor(\"to\")) > 0) break\n ranges.push({anchor: cur.from(), head: cur.to()})\n }\n if (ranges.length)\n this.setSelections(ranges, 0)\n })\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// Define search commands. Depends on dialog.js or another\n// implementation of the openDialog method.\n\n// Replace works a little oddly -- it will do the replace on the next\n// Ctrl-G (or whatever is bound to findNext) press. You prevent a\n// replace by making sure the match is no longer selected when hitting\n// Ctrl-G.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"./searchcursor\"), require(\"../dialog/dialog\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"./searchcursor\", \"../dialog/dialog\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n // default search panel location\n CodeMirror.defineOption(\"search\", {bottom: false});\n\n function searchOverlay(query, caseInsensitive) {\n if (typeof query == \"string\")\n query = new RegExp(query.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\"), caseInsensitive ? \"gi\" : \"g\");\n else if (!query.global)\n query = new RegExp(query.source, query.ignoreCase ? \"gi\" : \"g\");\n\n return {token: function(stream) {\n query.lastIndex = stream.pos;\n var match = query.exec(stream.string);\n if (match && match.index == stream.pos) {\n stream.pos += match[0].length || 1;\n return \"searching\";\n } else if (match) {\n stream.pos = match.index;\n } else {\n stream.skipToEnd();\n }\n }};\n }\n\n function SearchState() {\n this.posFrom = this.posTo = this.lastQuery = this.query = null;\n this.overlay = null;\n }\n\n function getSearchState(cm) {\n return cm.state.search || (cm.state.search = new SearchState());\n }\n\n function queryCaseInsensitive(query) {\n return typeof query == \"string\" && query == query.toLowerCase();\n }\n\n function getSearchCursor(cm, query, pos) {\n // Heuristic: if the query string is all lowercase, do a case insensitive search.\n return cm.getSearchCursor(query, pos, {caseFold: queryCaseInsensitive(query), multiline: true});\n }\n\n function persistentDialog(cm, text, deflt, onEnter, onKeyDown) {\n cm.openDialog(text, onEnter, {\n value: deflt,\n selectValueOnOpen: true,\n closeOnEnter: false,\n onClose: function() { clearSearch(cm); },\n onKeyDown: onKeyDown,\n bottom: cm.options.search.bottom\n });\n }\n\n function dialog(cm, text, shortText, deflt, f) {\n if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true, bottom: cm.options.search.bottom});\n else f(prompt(shortText, deflt));\n }\n\n function confirmDialog(cm, text, shortText, fs) {\n if (cm.openConfirm) cm.openConfirm(text, fs);\n else if (confirm(shortText)) fs[0]();\n }\n\n function parseString(string) {\n return string.replace(/\\\\([nrt\\\\])/g, function(match, ch) {\n if (ch == \"n\") return \"\\n\"\n if (ch == \"r\") return \"\\r\"\n if (ch == \"t\") return \"\\t\"\n if (ch == \"\\\\\") return \"\\\\\"\n return match\n })\n }\n\n function parseQuery(query) {\n var isRE = query.match(/^\\/(.*)\\/([a-z]*)$/);\n if (isRE) {\n try { query = new RegExp(isRE[1], isRE[2].indexOf(\"i\") == -1 ? \"\" : \"i\"); }\n catch(e) {} // Not a regular expression after all, do a string search\n } else {\n query = parseString(query)\n }\n if (typeof query == \"string\" ? query == \"\" : query.test(\"\"))\n query = /x^/;\n return query;\n }\n\n function startSearch(cm, state, query) {\n state.queryText = query;\n state.query = parseQuery(query);\n cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));\n state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));\n cm.addOverlay(state.overlay);\n if (cm.showMatchesOnScrollbar) {\n if (state.annotate) { state.annotate.clear(); state.annotate = null; }\n state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));\n }\n }\n\n function doSearch(cm, rev, persistent, immediate) {\n var state = getSearchState(cm);\n if (state.query) return findNext(cm, rev);\n var q = cm.getSelection() || state.lastQuery;\n if (q instanceof RegExp && q.source == \"x^\") q = null\n if (persistent && cm.openDialog) {\n var hiding = null\n var searchNext = function(query, event) {\n CodeMirror.e_stop(event);\n if (!query) return;\n if (query != state.queryText) {\n startSearch(cm, state, query);\n state.posFrom = state.posTo = cm.getCursor();\n }\n if (hiding) hiding.style.opacity = 1\n findNext(cm, event.shiftKey, function(_, to) {\n var dialog\n if (to.line < 3 && document.querySelector &&\n (dialog = cm.display.wrapper.querySelector(\".CodeMirror-dialog\")) &&\n dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, \"window\").top)\n (hiding = dialog).style.opacity = .4\n })\n };\n persistentDialog(cm, getQueryDialog(cm), q, searchNext, function(event, query) {\n var keyName = CodeMirror.keyName(event)\n var extra = cm.getOption('extraKeys'), cmd = (extra && extra[keyName]) || CodeMirror.keyMap[cm.getOption(\"keyMap\")][keyName]\n if (cmd == \"findNext\" || cmd == \"findPrev\" ||\n cmd == \"findPersistentNext\" || cmd == \"findPersistentPrev\") {\n CodeMirror.e_stop(event);\n startSearch(cm, getSearchState(cm), query);\n cm.execCommand(cmd);\n } else if (cmd == \"find\" || cmd == \"findPersistent\") {\n CodeMirror.e_stop(event);\n searchNext(query, event);\n }\n });\n if (immediate && q) {\n startSearch(cm, state, q);\n findNext(cm, rev);\n }\n } else {\n dialog(cm, getQueryDialog(cm), \"Search for:\", q, function(query) {\n if (query && !state.query) cm.operation(function() {\n startSearch(cm, state, query);\n state.posFrom = state.posTo = cm.getCursor();\n findNext(cm, rev);\n });\n });\n }\n }\n\n function findNext(cm, rev, callback) {cm.operation(function() {\n var state = getSearchState(cm);\n var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);\n if (!cursor.find(rev)) {\n cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));\n if (!cursor.find(rev)) return;\n }\n cm.setSelection(cursor.from(), cursor.to());\n cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20);\n state.posFrom = cursor.from(); state.posTo = cursor.to();\n if (callback) callback(cursor.from(), cursor.to())\n });}\n\n function clearSearch(cm) {cm.operation(function() {\n var state = getSearchState(cm);\n state.lastQuery = state.query;\n if (!state.query) return;\n state.query = state.queryText = null;\n cm.removeOverlay(state.overlay);\n if (state.annotate) { state.annotate.clear(); state.annotate = null; }\n });}\n\n function el(tag, attrs) {\n var element = tag ? document.createElement(tag) : document.createDocumentFragment();\n for (var key in attrs) {\n element[key] = attrs[key];\n }\n for (var i = 2; i < arguments.length; i++) {\n var child = arguments[i]\n element.appendChild(typeof child == \"string\" ? document.createTextNode(child) : child);\n }\n return element;\n }\n\n function getQueryDialog(cm) {\n var label = el(\"label\", {className: \"CodeMirror-search-label\"},\n cm.phrase(\"Search:\"),\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\",\n id: \"CodeMirror-search-field\"}));\n label.setAttribute(\"for\",\"CodeMirror-search-field\");\n return el(\"\", null, label, \" \",\n el(\"span\", {style: \"color: #666\", className: \"CodeMirror-search-hint\"},\n cm.phrase(\"(Use /re/ syntax for regexp search)\")));\n }\n function getReplaceQueryDialog(cm) {\n return el(\"\", null, \" \",\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\"}), \" \",\n el(\"span\", {style: \"color: #666\", className: \"CodeMirror-search-hint\"},\n cm.phrase(\"(Use /re/ syntax for regexp search)\")));\n }\n function getReplacementQueryDialog(cm) {\n return el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, cm.phrase(\"With:\")), \" \",\n el(\"input\", {type: \"text\", \"style\": \"width: 10em\", className: \"CodeMirror-search-field\"}));\n }\n function getDoReplaceConfirm(cm) {\n return el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, cm.phrase(\"Replace?\")), \" \",\n el(\"button\", {}, cm.phrase(\"Yes\")), \" \",\n el(\"button\", {}, cm.phrase(\"No\")), \" \",\n el(\"button\", {}, cm.phrase(\"All\")), \" \",\n el(\"button\", {}, cm.phrase(\"Stop\")));\n }\n\n function replaceAll(cm, query, text) {\n cm.operation(function() {\n for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {\n if (typeof query != \"string\") {\n var match = cm.getRange(cursor.from(), cursor.to()).match(query);\n cursor.replace(text.replace(/\\$(\\d)/g, function(_, i) {return match[i];}));\n } else cursor.replace(text);\n }\n });\n }\n\n function replace(cm, all) {\n if (cm.getOption(\"readOnly\")) return;\n var query = cm.getSelection() || getSearchState(cm).lastQuery;\n var dialogText = all ? cm.phrase(\"Replace all:\") : cm.phrase(\"Replace:\")\n var fragment = el(\"\", null,\n el(\"span\", {className: \"CodeMirror-search-label\"}, dialogText),\n getReplaceQueryDialog(cm))\n dialog(cm, fragment, dialogText, query, function(query) {\n if (!query) return;\n query = parseQuery(query);\n dialog(cm, getReplacementQueryDialog(cm), cm.phrase(\"Replace with:\"), \"\", function(text) {\n text = parseString(text)\n if (all) {\n replaceAll(cm, query, text)\n } else {\n clearSearch(cm);\n var cursor = getSearchCursor(cm, query, cm.getCursor(\"from\"));\n var advance = function() {\n var start = cursor.from(), match;\n if (!(match = cursor.findNext())) {\n cursor = getSearchCursor(cm, query);\n if (!(match = cursor.findNext()) ||\n (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;\n }\n cm.setSelection(cursor.from(), cursor.to());\n cm.scrollIntoView({from: cursor.from(), to: cursor.to()});\n confirmDialog(cm, getDoReplaceConfirm(cm), cm.phrase(\"Replace?\"),\n [function() {doReplace(match);}, advance,\n function() {replaceAll(cm, query, text)}]);\n };\n var doReplace = function(match) {\n cursor.replace(typeof query == \"string\" ? text :\n text.replace(/\\$(\\d)/g, function(_, i) {return match[i];}));\n advance();\n };\n advance();\n }\n });\n });\n }\n\n CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};\n CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);};\n CodeMirror.commands.findPersistentNext = function(cm) {doSearch(cm, false, true, true);};\n CodeMirror.commands.findPersistentPrev = function(cm) {doSearch(cm, true, true, true);};\n CodeMirror.commands.findNext = doSearch;\n CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};\n CodeMirror.commands.clearSearch = clearSearch;\n CodeMirror.commands.replace = replace;\n CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};\n});\n", null, "export default function(x) {\n return function constant() {\n return x;\n };\n}\n", "export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n", "const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We\u2019re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n", "export {Path, path, pathRound} from \"./path.js\";\n", "import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n", "import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 \u2265 r0, da1 \u2265 da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it\u2019s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector\u2019s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it\u2019s a circular sector?\n // Or perhaps it\u2019s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector\u2019s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n", "export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n", "function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n", "export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n", "export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n", "export default function(d) {\n return d;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n", "import curveLinear from \"./linear.js\";\n\nexport var curveRadialLinear = curveRadial(curveLinear);\n\nfunction Radial(curve) {\n this._curve = curve;\n}\n\nRadial.prototype = {\n areaStart: function() {\n this._curve.areaStart();\n },\n areaEnd: function() {\n this._curve.areaEnd();\n },\n lineStart: function() {\n this._curve.lineStart();\n },\n lineEnd: function() {\n this._curve.lineEnd();\n },\n point: function(a, r) {\n this._curve.point(r * Math.sin(a), r * -Math.cos(a));\n }\n};\n\nexport default function curveRadial(curve) {\n\n function radial(context) {\n return new Radial(curve(context));\n }\n\n radial._curve = curve;\n\n return radial;\n}\n", "import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport line from \"./line.js\";\n\nexport function lineRadial(l) {\n var c = l.curve;\n\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n\n l.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return l;\n}\n\nexport default function() {\n return lineRadial(line().curve(curveRadialLinear));\n}\n", "import curveRadial, {curveRadialLinear} from \"./curve/radial.js\";\nimport area from \"./area.js\";\nimport {lineRadial} from \"./lineRadial.js\";\n\nexport default function() {\n var a = area().curve(curveRadialLinear),\n c = a.curve,\n x0 = a.lineX0,\n x1 = a.lineX1,\n y0 = a.lineY0,\n y1 = a.lineY1;\n\n a.angle = a.x, delete a.x;\n a.startAngle = a.x0, delete a.x0;\n a.endAngle = a.x1, delete a.x1;\n a.radius = a.y, delete a.y;\n a.innerRadius = a.y0, delete a.y0;\n a.outerRadius = a.y1, delete a.y1;\n a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;\n a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;\n a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;\n a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;\n\n a.curve = function(_) {\n return arguments.length ? c(curveRadial(_)) : c()._curve;\n };\n\n return a;\n}\n", "export default function(x, y) {\n return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];\n}\n", "import pointRadial from \"../pointRadial.js\";\n\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);\n else this._context.moveTo(x, y);\n break;\n }\n case 1: this._point = 2; // falls through\n default: {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);\n else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nclass BumpRadial {\n constructor(context) {\n this._context = context;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {}\n point(x, y) {\n x = +x, y = +y;\n if (this._point === 0) {\n this._point = 1;\n } else {\n const p0 = pointRadial(this._x0, this._y0);\n const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);\n const p2 = pointRadial(x, this._y0);\n const p3 = pointRadial(x, y);\n this._context.moveTo(...p0);\n this._context.bezierCurveTo(...p1, ...p2, ...p3);\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nexport function bumpX(context) {\n return new Bump(context, true);\n}\n\nexport function bumpY(context) {\n return new Bump(context, false);\n}\n\nexport function bumpRadial(context) {\n return new BumpRadial(context);\n}\n", "import {slice} from \"./array.js\";\nimport constant from \"./constant.js\";\nimport {bumpX, bumpY, bumpRadial} from \"./curve/bump.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nexport function link(curve) {\n let source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null,\n output = null,\n path = withPath(link);\n\n function link() {\n let buffer;\n const argv = slice.call(arguments);\n const s = source.apply(this, argv);\n const t = target.apply(this, argv);\n if (context == null) output = curve(buffer = path());\n output.lineStart();\n argv[0] = s, output.point(+x.apply(this, argv), +y.apply(this, argv));\n argv[0] = t, output.point(+x.apply(this, argv), +y.apply(this, argv));\n output.lineEnd();\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), link) : context;\n };\n\n return link;\n}\n\nexport function linkHorizontal() {\n return link(bumpX);\n}\n\nexport function linkVertical() {\n return link(bumpY);\n}\n\nexport function linkRadial() {\n const l = link(bumpRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n", "import {min, sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;\n const t = r / 2;\n const u = t * sqrt3;\n context.moveTo(0, r);\n context.lineTo(0, -r);\n context.moveTo(-u, -t);\n context.lineTo(u, t);\n context.moveTo(-u, t);\n context.lineTo(u, -t);\n }\n};\n", "import {pi, sqrt, tau} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst tan30 = sqrt(1 / 3);\nconst tan30_2 = tan30 * 2;\n\nexport default {\n draw(context, size) {\n const y = sqrt(size / tan30_2);\n const x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size) * 0.62625;\n context.moveTo(0, -r);\n context.lineTo(r, 0);\n context.lineTo(0, r);\n context.lineTo(-r, 0);\n context.closePath();\n }\n};\n", "import {min, sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size - min(size / 7, 2)) * 0.87559;\n context.moveTo(-r, 0);\n context.lineTo(r, 0);\n context.moveTo(0, r);\n context.lineTo(0, -r);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const w = sqrt(size);\n const x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size) * 0.4431;\n context.moveTo(r, r);\n context.lineTo(r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, r);\n context.closePath();\n }\n};\n", "import {sin, cos, sqrt, pi, tau} from \"../math.js\";\n\nconst ka = 0.89081309152928522810;\nconst kr = sin(pi / 10) / sin(7 * pi / 10);\nconst kx = sin(tau / 10) * kr;\nconst ky = -cos(tau / 10) * kr;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size * ka);\n const x = kx * r;\n const y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (let i = 1; i < 5; ++i) {\n const a = tau * i / 5;\n const c = cos(a);\n const s = sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const y = -sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const s = sqrt(size) * 0.6824;\n const t = s / 2;\n const u = (s * sqrt3) / 2; // cos(Math.PI / 6)\n context.moveTo(0, -s);\n context.lineTo(u, t);\n context.lineTo(-u, t);\n context.closePath();\n }\n};\n", "import {sqrt} from \"../math.js\";\n\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / a);\n const x0 = r / 2, y0 = r * k;\n const x1 = x0, y1 = r * k + r;\n const x2 = -x1, y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n", "import {min, sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size - min(size / 6, 1.7)) * 0.6189;\n context.moveTo(-r, -r);\n context.lineTo(r, r);\n context.moveTo(-r, r);\n context.lineTo(r, -r);\n }\n};\n", "import constant from \"./constant.js\";\nimport {withPath} from \"./path.js\";\nimport asterisk from \"./symbol/asterisk.js\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport diamond2 from \"./symbol/diamond2.js\";\nimport plus from \"./symbol/plus.js\";\nimport square from \"./symbol/square.js\";\nimport square2 from \"./symbol/square2.js\";\nimport star from \"./symbol/star.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport triangle2 from \"./symbol/triangle2.js\";\nimport wye from \"./symbol/wye.js\";\nimport times from \"./symbol/times.js\";\n\n// These symbols are designed to be filled.\nexport const symbolsFill = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\n// These symbols are designed to be stroked (with a width of 1.5px and round caps).\nexport const symbolsStroke = [\n circle,\n plus,\n times,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null,\n path = withPath(symbol);\n\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n let buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n", "export default function() {}\n", "export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n", "import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n", "import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n", "import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n", "export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n", "import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n", "import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n", "function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic B\u00E9zier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n", "function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n", "function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n", "export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n", "export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n", "import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport offsetNone from \"./offset/none.js\";\nimport orderNone from \"./order/none.js\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nfunction stackSeries(key) {\n const series = [];\n series.key = key;\n return series;\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var sz = Array.from(keys.apply(this, arguments), stackSeries),\n i, n = sz.length, j = -1,\n oz;\n\n for (const d of data) {\n for (i = 0, ++j; i < n; ++i) {\n (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;\n }\n }\n\n for (i = 0, oz = array(order(sz)); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {\n for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;\n if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;\n }\n none(series, order);\n}\n", "export default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {\n for (yp = yn = 0, i = 0; i < n; ++i) {\n if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {\n d[0] = yp, d[1] = yp += dy;\n } else if (dy < 0) {\n d[1] = yn, d[0] = yn += dy;\n } else {\n d[0] = 0, d[1] = dy;\n }\n }\n }\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0)) return;\n for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {\n for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;\n s0[j][1] += s0[j][0] = -y / 2;\n }\n none(series, order);\n}\n", "import none from \"./none.js\";\n\nexport default function(series, order) {\n if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;\n for (var y = 0, j = 1, s0, m, n; j < m; ++j) {\n for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {\n var si = series[order[i]],\n sij0 = si[j][1] || 0,\n sij1 = si[j - 1][1] || 0,\n s3 = (sij0 - sij1) / 2;\n for (var k = 0; k < i; ++k) {\n var sk = series[order[k]],\n skj0 = sk[j][1] || 0,\n skj1 = sk[j - 1][1] || 0;\n s3 += skj0 - skj1;\n }\n s1 += sij0, s2 += s3 * sij0;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n if (s1) y -= s2 / s1;\n }\n s0[j - 1][1] += s0[j - 1][0] = y;\n none(series, order);\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n var peaks = series.map(peak);\n return none(series).sort(function(a, b) { return peaks[a] - peaks[b]; });\n}\n\nfunction peak(series) {\n var i = -1, j = 0, n = series.length, vi, vj = -Infinity;\n while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i;\n return j;\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n var sums = series.map(sum);\n return none(series).sort(function(a, b) { return sums[a] - sums[b]; });\n}\n\nexport function sum(series) {\n var s = 0, i = -1, n = series.length, v;\n while (++i < n) if (v = +series[i][1]) s += v;\n return s;\n}\n", "import ascending from \"./ascending.js\";\n\nexport default function(series) {\n return ascending(series).reverse();\n}\n", "import appearance from \"./appearance.js\";\nimport {sum} from \"./ascending.js\";\n\nexport default function(series) {\n var n = series.length,\n i,\n j,\n sums = series.map(sum),\n order = appearance(series),\n top = 0,\n bottom = 0,\n tops = [],\n bottoms = [];\n\n for (i = 0; i < n; ++i) {\n j = order[i];\n if (top < bottom) {\n top += sums[j];\n tops.push(j);\n } else {\n bottom += sums[j];\n bottoms.push(j);\n }\n }\n\n return bottoms.reverse().concat(tops);\n}\n", "import none from \"./none.js\";\n\nexport default function(series) {\n return none(series).reverse();\n}\n", "export {default as arc} from \"./arc.js\";\nexport {default as area} from \"./area.js\";\nexport {default as line} from \"./line.js\";\nexport {default as pie} from \"./pie.js\";\nexport {default as areaRadial, default as radialArea} from \"./areaRadial.js\"; // Note: radialArea is deprecated!\nexport {default as lineRadial, default as radialLine} from \"./lineRadial.js\"; // Note: radialLine is deprecated!\nexport {default as pointRadial} from \"./pointRadial.js\";\nexport {link, linkHorizontal, linkVertical, linkRadial} from \"./link.js\";\n\nexport {default as symbol, symbolsStroke, symbolsFill, symbolsFill as symbols} from \"./symbol.js\";\nexport {default as symbolAsterisk} from \"./symbol/asterisk.js\";\nexport {default as symbolCircle} from \"./symbol/circle.js\";\nexport {default as symbolCross} from \"./symbol/cross.js\";\nexport {default as symbolDiamond} from \"./symbol/diamond.js\";\nexport {default as symbolDiamond2} from \"./symbol/diamond2.js\";\nexport {default as symbolPlus} from \"./symbol/plus.js\";\nexport {default as symbolSquare} from \"./symbol/square.js\";\nexport {default as symbolSquare2} from \"./symbol/square2.js\";\nexport {default as symbolStar} from \"./symbol/star.js\";\nexport {default as symbolTriangle} from \"./symbol/triangle.js\";\nexport {default as symbolTriangle2} from \"./symbol/triangle2.js\";\nexport {default as symbolWye} from \"./symbol/wye.js\";\nexport {default as symbolTimes, default as symbolX} from \"./symbol/times.js\";\n\nexport {default as curveBasisClosed} from \"./curve/basisClosed.js\";\nexport {default as curveBasisOpen} from \"./curve/basisOpen.js\";\nexport {default as curveBasis} from \"./curve/basis.js\";\nexport {bumpX as curveBumpX, bumpY as curveBumpY} from \"./curve/bump.js\";\nexport {default as curveBundle} from \"./curve/bundle.js\";\nexport {default as curveCardinalClosed} from \"./curve/cardinalClosed.js\";\nexport {default as curveCardinalOpen} from \"./curve/cardinalOpen.js\";\nexport {default as curveCardinal} from \"./curve/cardinal.js\";\nexport {default as curveCatmullRomClosed} from \"./curve/catmullRomClosed.js\";\nexport {default as curveCatmullRomOpen} from \"./curve/catmullRomOpen.js\";\nexport {default as curveCatmullRom} from \"./curve/catmullRom.js\";\nexport {default as curveLinearClosed} from \"./curve/linearClosed.js\";\nexport {default as curveLinear} from \"./curve/linear.js\";\nexport {monotoneX as curveMonotoneX, monotoneY as curveMonotoneY} from \"./curve/monotone.js\";\nexport {default as curveNatural} from \"./curve/natural.js\";\nexport {default as curveStep, stepAfter as curveStepAfter, stepBefore as curveStepBefore} from \"./curve/step.js\";\n\nexport {default as stack} from \"./stack.js\";\nexport {default as stackOffsetExpand} from \"./offset/expand.js\";\nexport {default as stackOffsetDiverging} from \"./offset/diverging.js\";\nexport {default as stackOffsetNone} from \"./offset/none.js\";\nexport {default as stackOffsetSilhouette} from \"./offset/silhouette.js\";\nexport {default as stackOffsetWiggle} from \"./offset/wiggle.js\";\nexport {default as stackOrderAppearance} from \"./order/appearance.js\";\nexport {default as stackOrderAscending} from \"./order/ascending.js\";\nexport {default as stackOrderDescending} from \"./order/descending.js\";\nexport {default as stackOrderInsideOut} from \"./order/insideOut.js\";\nexport {default as stackOrderNone} from \"./order/none.js\";\nexport {default as stackOrderReverse} from \"./order/reverse.js\";\n", "export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, \u00B1Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n", "export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n", "export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n", "// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n", "// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n", "import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n", "export default function(x) {\n return x;\n}\n", "import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\u00B5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"\u2212\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer \u201Cvalue\u201D part that can be\n // grouped, and fractional or exponential \u201Csuffix\u201D part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n", "import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n", "export {default as formatDefaultLocale, format, formatPrefix} from \"./defaultLocale.js\";\nexport {default as formatLocale} from \"./locale.js\";\nexport {default as formatSpecifier, FormatSpecifier} from \"./formatSpecifier.js\";\nexport {default as precisionFixed} from \"./precisionFixed.js\";\nexport {default as precisionPrefix} from \"./precisionPrefix.js\";\nexport {default as precisionRound} from \"./precisionRound.js\";\n", "export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n", "import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can\u2019t do this\n // for a comparator (except for specific, known comparators) because we can\u2019t\n // tell if the comparator is symmetric, and an asymmetric comparator can\u2019t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n", "export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n", "import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n", "export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n", "import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n", "const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n", "export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n", "export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n", "import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n", "import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof = number) {\n if (isNaN(p = +p)) return;\n numbers = Float64Array.from(values, (_, i) => number(valueof(values[i], i, values)));\n if (p <= 0) return minIndex(numbers);\n if (p >= 1) return maxIndex(numbers);\n var numbers,\n index = Uint32Array.from(values, (_, i) => i),\n j = numbers.length - 1,\n i = Math.floor(j * p);\n quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j]));\n i = greatest(index.subarray(0, i + 1), (i) => numbers[i]);\n return i >= 0 ? i : -1;\n}\n", "export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n", "export {default as bisect, bisectRight, bisectLeft, bisectCenter} from \"./bisect.js\";\nexport {default as ascending} from \"./ascending.js\";\nexport {default as bisector} from \"./bisector.js\";\nexport {blur, blur2, blurImage} from \"./blur.js\";\nexport {default as count} from \"./count.js\";\nexport {default as cross} from \"./cross.js\";\nexport {default as cumsum} from \"./cumsum.js\";\nexport {default as descending} from \"./descending.js\";\nexport {default as deviation} from \"./deviation.js\";\nexport {default as extent} from \"./extent.js\";\nexport {Adder, fsum, fcumsum} from \"./fsum.js\";\nexport {default as group, flatGroup, flatRollup, groups, index, indexes, rollup, rollups} from \"./group.js\";\nexport {default as groupSort} from \"./groupSort.js\";\nexport {default as bin, default as histogram} from \"./bin.js\"; // Deprecated; use bin.\nexport {default as thresholdFreedmanDiaconis} from \"./threshold/freedmanDiaconis.js\";\nexport {default as thresholdScott} from \"./threshold/scott.js\";\nexport {default as thresholdSturges} from \"./threshold/sturges.js\";\nexport {default as max} from \"./max.js\";\nexport {default as maxIndex} from \"./maxIndex.js\";\nexport {default as mean} from \"./mean.js\";\nexport {default as median, medianIndex} from \"./median.js\";\nexport {default as merge} from \"./merge.js\";\nexport {default as min} from \"./min.js\";\nexport {default as minIndex} from \"./minIndex.js\";\nexport {default as mode} from \"./mode.js\";\nexport {default as nice} from \"./nice.js\";\nexport {default as pairs} from \"./pairs.js\";\nexport {default as permute} from \"./permute.js\";\nexport {default as quantile, quantileIndex, quantileSorted} from \"./quantile.js\";\nexport {default as quickselect} from \"./quickselect.js\";\nexport {default as range} from \"./range.js\";\nexport {default as rank} from \"./rank.js\";\nexport {default as least} from \"./least.js\";\nexport {default as leastIndex} from \"./leastIndex.js\";\nexport {default as greatest} from \"./greatest.js\";\nexport {default as greatestIndex} from \"./greatestIndex.js\";\nexport {default as scan} from \"./scan.js\"; // Deprecated; use leastIndex.\nexport {default as shuffle, shuffler} from \"./shuffle.js\";\nexport {default as sum} from \"./sum.js\";\nexport {default as ticks, tickIncrement, tickStep} from \"./ticks.js\";\nexport {default as transpose} from \"./transpose.js\";\nexport {default as variance} from \"./variance.js\";\nexport {default as zip} from \"./zip.js\";\nexport {default as every} from \"./every.js\";\nexport {default as some} from \"./some.js\";\nexport {default as filter} from \"./filter.js\";\nexport {default as map} from \"./map.js\";\nexport {default as reduce} from \"./reduce.js\";\nexport {default as reverse} from \"./reverse.js\";\nexport {default as sort} from \"./sort.js\";\nexport {default as difference} from \"./difference.js\";\nexport {default as disjoint} from \"./disjoint.js\";\nexport {default as intersection} from \"./intersection.js\";\nexport {default as subset} from \"./subset.js\";\nexport {default as superset} from \"./superset.js\";\nexport {default as union} from \"./union.js\";\nexport {InternMap, InternSet} from \"internmap\";\n", "export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n", "import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n", "import {range as sequence} from \"d3-array\";\nimport {initRange} from \"./init.js\";\nimport ordinal from \"./ordinal.js\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n", "export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n", "import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n", "export const radians = Math.PI / 180;\nexport const degrees = 180 / Math.PI;\n", "import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * degrees;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * radians;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb() {\n return hcl2lab(this).rgb();\n }\n}));\n", "import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n", "export {default as color, rgb, hsl} from \"./color.js\";\nexport {default as lab, hcl, lch, gray} from \"./lab.js\";\nexport {default as cubehelix} from \"./cubehelix.js\";\n", "export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n", "import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n", "export default x => () => x;\n", "import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n", "import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n", "export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n", "import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n", "export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n", "export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n", "import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n", "import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n", "import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n", "export default function(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n}\n", "import {hue} from \"./color.js\";\n\nexport default function(a, b) {\n var i = hue(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n}\n", "export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n", "var degrees = 180 / Math.PI;\n\nexport var identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n}\n", "import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n if (value == null) return identity;\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n value = value.matrix;\n return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n", "import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n", "var epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\nexport default (function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 \u2245 u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4);\n", "import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n", "import {lab as colorLab} from \"d3-color\";\nimport color from \"./color.js\";\n\nexport default function lab(start, end) {\n var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n a = color(start.a, end.a),\n b = color(start.b, end.b),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n", "import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n", "import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n", "import {default as value} from \"./value.js\";\n\nexport default function piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n", "export default function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n}\n", "export {default as interpolate} from \"./value.js\";\nexport {default as interpolateArray} from \"./array.js\";\nexport {default as interpolateBasis} from \"./basis.js\";\nexport {default as interpolateBasisClosed} from \"./basisClosed.js\";\nexport {default as interpolateDate} from \"./date.js\";\nexport {default as interpolateDiscrete} from \"./discrete.js\";\nexport {default as interpolateHue} from \"./hue.js\";\nexport {default as interpolateNumber} from \"./number.js\";\nexport {default as interpolateNumberArray} from \"./numberArray.js\";\nexport {default as interpolateObject} from \"./object.js\";\nexport {default as interpolateRound} from \"./round.js\";\nexport {default as interpolateString} from \"./string.js\";\nexport {interpolateTransformCss, interpolateTransformSvg} from \"./transform/index.js\";\nexport {default as interpolateZoom} from \"./zoom.js\";\nexport {default as interpolateRgb, rgbBasis as interpolateRgbBasis, rgbBasisClosed as interpolateRgbBasisClosed} from \"./rgb.js\";\nexport {default as interpolateHsl, hslLong as interpolateHslLong} from \"./hsl.js\";\nexport {default as interpolateLab} from \"./lab.js\";\nexport {default as interpolateHcl, hclLong as interpolateHclLong} from \"./hcl.js\";\nexport {default as interpolateCubehelix, cubehelixLong as interpolateCubehelixLong} from \"./cubehelix.js\";\nexport {default as piecewise} from \"./piecewise.js\";\nexport {default as quantize} from \"./quantize.js\";\n", "export default function constants(x) {\n return function() {\n return x;\n };\n}\n", "export default function number(x) {\n return +x;\n}\n", "import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n", "import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n", "import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n", "import {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nexport default function identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number) : [0, 1];\n\n return linearish(scale);\n}\n", "export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n", "import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n", "import {linearish} from \"./linear.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nexport function symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nexport default function symlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n", "import {linearish} from \"./linear.js\";\nimport {copy, identity, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nexport function powish(transform) {\n var scale = transform(identity, identity),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity, identity)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nexport default function pow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nexport function sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n", "import continuous from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nfunction square(x) {\n return Math.sign(x) * x * x;\n}\n\nfunction unsquare(x) {\n return Math.sign(x) * Math.sqrt(Math.abs(x));\n}\n\nexport default function radial() {\n var squared = continuous(),\n range = [0, 1],\n round = false,\n unknown;\n\n function scale(x) {\n var y = unsquare(squared(x));\n return isNaN(y) ? unknown : round ? Math.round(y) : y;\n }\n\n scale.invert = function(y) {\n return squared.invert(square(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (squared.domain(_), scale) : squared.domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (squared.range((range = Array.from(_, number)).map(square)), scale) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return scale.range(_).round(true);\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, scale) : round;\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (squared.clamp(_), scale) : squared.clamp();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return radial(squared.domain(), range)\n .round(round)\n .clamp(squared.clamp())\n .unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n", "import {ascending, bisect, quantileSorted as threshold} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n", "import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n", "import {bisect} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n", "const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n", "import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n", "import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n", "import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n", "import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n", "import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n", "export {\n timeInterval\n} from \"./interval.js\";\n\nexport {\n millisecond as utcMillisecond,\n milliseconds as utcMilliseconds,\n millisecond as timeMillisecond,\n milliseconds as timeMilliseconds\n} from \"./millisecond.js\";\n\nexport {\n second as utcSecond,\n seconds as utcSeconds,\n second as timeSecond,\n seconds as timeSeconds\n} from \"./second.js\";\n\nexport {\n timeMinute,\n timeMinutes,\n utcMinute,\n utcMinutes\n} from \"./minute.js\";\n\nexport {\n timeHour,\n timeHours,\n utcHour,\n utcHours\n} from \"./hour.js\";\n\nexport {\n timeDay,\n timeDays,\n utcDay,\n utcDays,\n unixDay,\n unixDays\n} from \"./day.js\";\n\nexport {\n timeSunday as timeWeek,\n timeSundays as timeWeeks,\n timeSunday,\n timeSundays,\n timeMonday,\n timeMondays,\n timeTuesday,\n timeTuesdays,\n timeWednesday,\n timeWednesdays,\n timeThursday,\n timeThursdays,\n timeFriday,\n timeFridays,\n timeSaturday,\n timeSaturdays,\n utcSunday as utcWeek,\n utcSundays as utcWeeks,\n utcSunday,\n utcSundays,\n utcMonday,\n utcMondays,\n utcTuesday,\n utcTuesdays,\n utcWednesday,\n utcWednesdays,\n utcThursday,\n utcThursdays,\n utcFriday,\n utcFridays,\n utcSaturday,\n utcSaturdays\n} from \"./week.js\";\n\nexport {\n timeMonth,\n timeMonths,\n utcMonth,\n utcMonths\n} from \"./month.js\";\n\nexport {\n timeYear,\n timeYears,\n utcYear,\n utcYears\n} from \"./year.js\";\n\nexport {\n utcTicks,\n utcTickInterval,\n timeTicks,\n timeTickInterval\n} from \"./ticks.js\";\n", "import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n", "import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n", "export {default as timeFormatDefaultLocale, timeFormat, timeParse, utcFormat, utcParse} from \"./defaultLocale.js\";\nexport {default as timeFormatLocale} from \"./locale.js\";\nexport {default as isoFormat} from \"./isoFormat.js\";\nexport {default as isoParse} from \"./isoParse.js\";\n", "import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n", "import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from \"d3-time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {calendar} from \"./time.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function utcTime() {\n return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n", "import {interpolate, interpolateRound} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport default function sequential() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialLog() {\n var scale = loggish(transformer()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n", "import {ascending, bisect, quantile} from \"d3-array\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\n\nexport default function sequentialQuantile() {\n var domain = [],\n interpolator = identity;\n\n function scale(x) {\n if (x != null && !isNaN(x = +x)) return interpolator((bisect(domain, x, 1) - 1) / (domain.length - 1));\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return scale;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.range = function() {\n return domain.map((d, i) => interpolator(i / (domain.length - 1)));\n };\n\n scale.quantiles = function(n) {\n return Array.from({length: n + 1}, (_, i) => quantile(domain, i / n));\n };\n\n scale.copy = function() {\n return sequentialQuantile(interpolator).domain(domain);\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n", "import {interpolate, interpolateRound, piecewise} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {copy} from \"./sequential.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nexport default function diverging() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n", "export {\n default as scaleBand,\n point as scalePoint\n} from \"./band.js\";\n\nexport {\n default as scaleIdentity\n} from \"./identity.js\";\n\nexport {\n default as scaleLinear\n} from \"./linear.js\";\n\nexport {\n default as scaleLog\n} from \"./log.js\";\n\nexport {\n default as scaleSymlog\n} from \"./symlog.js\";\n\nexport {\n default as scaleOrdinal,\n implicit as scaleImplicit\n} from \"./ordinal.js\";\n\nexport {\n default as scalePow,\n sqrt as scaleSqrt\n} from \"./pow.js\";\n\nexport {\n default as scaleRadial\n} from \"./radial.js\";\n\nexport {\n default as scaleQuantile\n} from \"./quantile.js\";\n\nexport {\n default as scaleQuantize\n} from \"./quantize.js\";\n\nexport {\n default as scaleThreshold\n} from \"./threshold.js\";\n\nexport {\n default as scaleTime\n} from \"./time.js\";\n\nexport {\n default as scaleUtc\n} from \"./utcTime.js\";\n\nexport {\n default as scaleSequential,\n sequentialLog as scaleSequentialLog,\n sequentialPow as scaleSequentialPow,\n sequentialSqrt as scaleSequentialSqrt,\n sequentialSymlog as scaleSequentialSymlog\n} from \"./sequential.js\";\n\nexport {\n default as scaleSequentialQuantile\n} from \"./sequentialQuantile.js\";\n\nexport {\n default as scaleDiverging,\n divergingLog as scaleDivergingLog,\n divergingPow as scaleDivergingPow,\n divergingSqrt as scaleDivergingSqrt,\n divergingSymlog as scaleDivergingSymlog\n} from \"./diverging.js\";\n\nexport {\n default as tickFormat\n} from \"./tickFormat.js\";\n", "export default function(x) {\n return x;\n}\n", "import identity from \"./identity.js\";\n\nvar top = 1,\n right = 2,\n bottom = 3,\n left = 4,\n epsilon = 1e-6;\n\nfunction translateX(x) {\n return \"translate(\" + x + \",0)\";\n}\n\nfunction translateY(y) {\n return \"translate(0,\" + y + \")\";\n}\n\nfunction number(scale) {\n return d => +scale(d);\n}\n\nfunction center(scale, offset) {\n offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;\n if (scale.round()) offset = Math.round(offset);\n return d => +scale(d) + offset;\n}\n\nfunction entering() {\n return !this.__axis;\n}\n\nfunction axis(orient, scale) {\n var tickArguments = [],\n tickValues = null,\n tickFormat = null,\n tickSizeInner = 6,\n tickSizeOuter = 6,\n tickPadding = 3,\n offset = typeof window !== \"undefined\" && window.devicePixelRatio > 1 ? 0 : 0.5,\n k = orient === top || orient === left ? -1 : 1,\n x = orient === left || orient === right ? \"x\" : \"y\",\n transform = orient === top || orient === bottom ? translateX : translateY;\n\n function axis(context) {\n var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,\n format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity) : tickFormat,\n spacing = Math.max(tickSizeInner, 0) + tickPadding,\n range = scale.range(),\n range0 = +range[0] + offset,\n range1 = +range[range.length - 1] + offset,\n position = (scale.bandwidth ? center : number)(scale.copy(), offset),\n selection = context.selection ? context.selection() : context,\n path = selection.selectAll(\".domain\").data([null]),\n tick = selection.selectAll(\".tick\").data(values, scale).order(),\n tickExit = tick.exit(),\n tickEnter = tick.enter().append(\"g\").attr(\"class\", \"tick\"),\n line = tick.select(\"line\"),\n text = tick.select(\"text\");\n\n path = path.merge(path.enter().insert(\"path\", \".tick\")\n .attr(\"class\", \"domain\")\n .attr(\"stroke\", \"currentColor\"));\n\n tick = tick.merge(tickEnter);\n\n line = line.merge(tickEnter.append(\"line\")\n .attr(\"stroke\", \"currentColor\")\n .attr(x + \"2\", k * tickSizeInner));\n\n text = text.merge(tickEnter.append(\"text\")\n .attr(\"fill\", \"currentColor\")\n .attr(x, k * spacing)\n .attr(\"dy\", orient === top ? \"0em\" : orient === bottom ? \"0.71em\" : \"0.32em\"));\n\n if (context !== selection) {\n path = path.transition(context);\n tick = tick.transition(context);\n line = line.transition(context);\n text = text.transition(context);\n\n tickExit = tickExit.transition(context)\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute(\"transform\"); });\n\n tickEnter\n .attr(\"opacity\", epsilon)\n .attr(\"transform\", function(d) { var p = this.parentNode.__axis; return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset); });\n }\n\n tickExit.remove();\n\n path\n .attr(\"d\", orient === left || orient === right\n ? (tickSizeOuter ? \"M\" + k * tickSizeOuter + \",\" + range0 + \"H\" + offset + \"V\" + range1 + \"H\" + k * tickSizeOuter : \"M\" + offset + \",\" + range0 + \"V\" + range1)\n : (tickSizeOuter ? \"M\" + range0 + \",\" + k * tickSizeOuter + \"V\" + offset + \"H\" + range1 + \"V\" + k * tickSizeOuter : \"M\" + range0 + \",\" + offset + \"H\" + range1));\n\n tick\n .attr(\"opacity\", 1)\n .attr(\"transform\", function(d) { return transform(position(d) + offset); });\n\n line\n .attr(x + \"2\", k * tickSizeInner);\n\n text\n .attr(x, k * spacing)\n .text(format);\n\n selection.filter(entering)\n .attr(\"fill\", \"none\")\n .attr(\"font-size\", 10)\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"text-anchor\", orient === right ? \"start\" : orient === left ? \"end\" : \"middle\");\n\n selection\n .each(function() { this.__axis = position; });\n }\n\n axis.scale = function(_) {\n return arguments.length ? (scale = _, axis) : scale;\n };\n\n axis.ticks = function() {\n return tickArguments = Array.from(arguments), axis;\n };\n\n axis.tickArguments = function(_) {\n return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis) : tickArguments.slice();\n };\n\n axis.tickValues = function(_) {\n return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis) : tickValues && tickValues.slice();\n };\n\n axis.tickFormat = function(_) {\n return arguments.length ? (tickFormat = _, axis) : tickFormat;\n };\n\n axis.tickSize = function(_) {\n return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeInner = function(_) {\n return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;\n };\n\n axis.tickSizeOuter = function(_) {\n return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;\n };\n\n axis.tickPadding = function(_) {\n return arguments.length ? (tickPadding = +_, axis) : tickPadding;\n };\n\n axis.offset = function(_) {\n return arguments.length ? (offset = +_, axis) : offset;\n };\n\n return axis;\n}\n\nexport function axisTop(scale) {\n return axis(top, scale);\n}\n\nexport function axisRight(scale) {\n return axis(right, scale);\n}\n\nexport function axisBottom(scale) {\n return axis(bottom, scale);\n}\n\nexport function axisLeft(scale) {\n return axis(left, scale);\n}\n", "export {\n axisTop,\n axisRight,\n axisBottom,\n axisLeft\n} from \"./axis.js\";\n", "var noop = {value: () => {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\nexport default dispatch;\n", "export {default as dispatch} from \"./dispatch.js\";\n", "export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n svg: \"http://www.w3.org/2000/svg\",\n xhtml: xhtml,\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n", "import namespaces from \"./namespaces.js\";\n\nexport default function(name) {\n var prefix = name += \"\", i = prefix.indexOf(\":\");\n if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n", "import namespace from \"./namespace.js\";\nimport {xhtml} from \"./namespaces.js\";\n\nfunction creatorInherit(name) {\n return function() {\n var document = this.ownerDocument,\n uri = this.namespaceURI;\n return uri === xhtml && document.documentElement.namespaceURI === xhtml\n ? document.createElement(name)\n : document.createElementNS(uri, name);\n };\n}\n\nfunction creatorFixed(fullname) {\n return function() {\n return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n };\n}\n\nexport default function(name) {\n var fullname = namespace(name);\n return (fullname.local\n ? creatorFixed\n : creatorInherit)(fullname);\n}\n", "function none() {}\n\nexport default function(selector) {\n return selector == null ? none : function() {\n return this.querySelector(selector);\n };\n}\n", "import {Selection} from \"./index.js\";\nimport selector from \"../selector.js\";\n\nexport default function(select) {\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n", "// Given something array like (or null), returns something that is strictly an\n// array. This is used to ensure that array-like objects passed to d3.selectAll\n// or selection.selectAll are converted into proper arrays when creating a\n// selection; we don\u2019t ever want to create a selection backed by a live\n// HTMLCollection or NodeList. However, note that selection.selectAll will use a\n// static NodeList as a group, since it safely derived from querySelectorAll.\nexport default function array(x) {\n return x == null ? [] : Array.isArray(x) ? x : Array.from(x);\n}\n", "function empty() {\n return [];\n}\n\nexport default function(selector) {\n return selector == null ? empty : function() {\n return this.querySelectorAll(selector);\n };\n}\n", "import {Selection} from \"./index.js\";\nimport array from \"../array.js\";\nimport selectorAll from \"../selectorAll.js\";\n\nfunction arrayAll(select) {\n return function() {\n return array(select.apply(this, arguments));\n };\n}\n\nexport default function(select) {\n if (typeof select === \"function\") select = arrayAll(select);\n else select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n subgroups.push(select.call(node, node.__data__, i, group));\n parents.push(node);\n }\n }\n }\n\n return new Selection(subgroups, parents);\n}\n", "export default function(selector) {\n return function() {\n return this.matches(selector);\n };\n}\n\nexport function childMatcher(selector) {\n return function(node) {\n return node.matches(selector);\n };\n}\n\n", "import {childMatcher} from \"../matcher.js\";\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n return function() {\n return find.call(this.children, match);\n };\n}\n\nfunction childFirst() {\n return this.firstElementChild;\n}\n\nexport default function(match) {\n return this.select(match == null ? childFirst\n : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {childMatcher} from \"../matcher.js\";\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n return Array.from(this.children);\n}\n\nfunction childrenFilter(match) {\n return function() {\n return filter.call(this.children, match);\n };\n}\n\nexport default function(match) {\n return this.selectAll(match == null ? children\n : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {Selection} from \"./index.js\";\nimport matcher from \"../matcher.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Selection(subgroups, this._parents);\n}\n", "export default function(update) {\n return new Array(update.length);\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n this.ownerDocument = parent.ownerDocument;\n this.namespaceURI = parent.namespaceURI;\n this._next = null;\n this._parent = parent;\n this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n constructor: EnterNode,\n appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n querySelector: function(selector) { return this._parent.querySelector(selector); },\n querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n", "export default function(x) {\n return function() {\n return x;\n };\n}\n", "import {Selection} from \"./index.js\";\nimport {EnterNode} from \"./enter.js\";\nimport constant from \"../constant.js\";\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n var i = 0,\n node,\n groupLength = group.length,\n dataLength = data.length;\n\n // Put any non-null nodes that fit into update.\n // Put any null nodes into enter.\n // Put any remaining data into enter.\n for (; i < dataLength; ++i) {\n if (node = group[i]) {\n node.__data__ = data[i];\n update[i] = node;\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Put any non-null nodes that don\u2019t fit into exit.\n for (; i < groupLength; ++i) {\n if (node = group[i]) {\n exit[i] = node;\n }\n }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n var i,\n node,\n nodeByKeyValue = new Map,\n groupLength = group.length,\n dataLength = data.length,\n keyValues = new Array(groupLength),\n keyValue;\n\n // Compute the key for each node.\n // If multiple nodes have the same key, the duplicates are added to exit.\n for (i = 0; i < groupLength; ++i) {\n if (node = group[i]) {\n keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n if (nodeByKeyValue.has(keyValue)) {\n exit[i] = node;\n } else {\n nodeByKeyValue.set(keyValue, node);\n }\n }\n }\n\n // Compute the key for each datum.\n // If there a node associated with this key, join and add it to update.\n // If there is not (or the key is a duplicate), add it to enter.\n for (i = 0; i < dataLength; ++i) {\n keyValue = key.call(parent, data[i], i, data) + \"\";\n if (node = nodeByKeyValue.get(keyValue)) {\n update[i] = node;\n node.__data__ = data[i];\n nodeByKeyValue.delete(keyValue);\n } else {\n enter[i] = new EnterNode(parent, data[i]);\n }\n }\n\n // Add any remaining nodes that were not bound to data to exit.\n for (i = 0; i < groupLength; ++i) {\n if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n exit[i] = node;\n }\n }\n}\n\nfunction datum(node) {\n return node.__data__;\n}\n\nexport default function(value, key) {\n if (!arguments.length) return Array.from(this, datum);\n\n var bind = key ? bindKey : bindIndex,\n parents = this._parents,\n groups = this._groups;\n\n if (typeof value !== \"function\") value = constant(value);\n\n for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n var parent = parents[j],\n group = groups[j],\n groupLength = group.length,\n data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),\n dataLength = data.length,\n enterGroup = enter[j] = new Array(dataLength),\n updateGroup = update[j] = new Array(dataLength),\n exitGroup = exit[j] = new Array(groupLength);\n\n bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n // Now connect the enter nodes to their following update node, such that\n // appendChild can insert the materialized enter node before this node,\n // rather than at the end of the parent node.\n for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n if (previous = enterGroup[i0]) {\n if (i0 >= i1) i1 = i0 + 1;\n while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n previous._next = next || null;\n }\n }\n }\n\n update = new Selection(update, parents);\n update._enter = enter;\n update._exit = exit;\n return update;\n}\n\n// Given some data, this returns an array-like view of it: an object that\n// exposes a length property and allows numeric indexing. Note that unlike\n// selectAll, this isn\u2019t worried about \u201Clive\u201D collections because the resulting\n// array will only be used briefly while data is being bound. (It is possible to\n// cause the data to change while iterating by using a key function, but please\n// don\u2019t; we\u2019d rather avoid a gratuitous copy.)\nfunction arraylike(data) {\n return typeof data === \"object\" && \"length\" in data\n ? data // Array, TypedArray, NodeList, array-like\n : Array.from(data); // Map, Set, iterable, string, or anything else\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n", "export default function(onenter, onupdate, onexit) {\n var enter = this.enter(), update = this, exit = this.exit();\n if (typeof onenter === \"function\") {\n enter = onenter(enter);\n if (enter) enter = enter.selection();\n } else {\n enter = enter.append(onenter + \"\");\n }\n if (onupdate != null) {\n update = onupdate(update);\n if (update) update = update.selection();\n }\n if (onexit == null) exit.remove(); else onexit(exit);\n return enter && update ? enter.merge(update).order() : update;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(context) {\n var selection = context.selection ? context.selection() : context;\n\n for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Selection(merges, this._parents);\n}\n", "export default function() {\n\n for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n if (node = group[i]) {\n if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n next = node;\n }\n }\n }\n\n return this;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(compare) {\n if (!compare) compare = ascending;\n\n function compareNode(a, b) {\n return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n }\n\n for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n sortgroup[i] = node;\n }\n }\n sortgroup.sort(compareNode);\n }\n\n return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function() {\n var callback = arguments[0];\n arguments[0] = this;\n callback.apply(null, arguments);\n return this;\n}\n", "export default function() {\n return Array.from(this);\n}\n", "export default function() {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n var node = group[i];\n if (node) return node;\n }\n }\n\n return null;\n}\n", "export default function() {\n let size = 0;\n for (const node of this) ++size; // eslint-disable-line no-unused-vars\n return size;\n}\n", "export default function() {\n return !this.node();\n}\n", "export default function(callback) {\n\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) callback.call(node, node.__data__, i, group);\n }\n }\n\n return this;\n}\n", "import namespace from \"../namespace.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, value) {\n return function() {\n this.setAttribute(name, value);\n };\n}\n\nfunction attrConstantNS(fullname, value) {\n return function() {\n this.setAttributeNS(fullname.space, fullname.local, value);\n };\n}\n\nfunction attrFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttribute(name);\n else this.setAttribute(name, v);\n };\n}\n\nfunction attrFunctionNS(fullname, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n else this.setAttributeNS(fullname.space, fullname.local, v);\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name);\n\n if (arguments.length < 2) {\n var node = this.node();\n return fullname.local\n ? node.getAttributeNS(fullname.space, fullname.local)\n : node.getAttribute(fullname);\n }\n\n return this.each((value == null\n ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)\n : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n", "export default function(node) {\n return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n || (node.document && node) // node is a Window\n || node.defaultView; // node is a Document\n}\n", "import defaultView from \"../window.js\";\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, value, priority) {\n return function() {\n this.style.setProperty(name, value, priority);\n };\n}\n\nfunction styleFunction(name, value, priority) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) this.style.removeProperty(name);\n else this.style.setProperty(name, v, priority);\n };\n}\n\nexport default function(name, value, priority) {\n return arguments.length > 1\n ? this.each((value == null\n ? styleRemove : typeof value === \"function\"\n ? styleFunction\n : styleConstant)(name, value, priority == null ? \"\" : priority))\n : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n return node.style.getPropertyValue(name)\n || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n", "function propertyRemove(name) {\n return function() {\n delete this[name];\n };\n}\n\nfunction propertyConstant(name, value) {\n return function() {\n this[name] = value;\n };\n}\n\nfunction propertyFunction(name, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (v == null) delete this[name];\n else this[name] = v;\n };\n}\n\nexport default function(name, value) {\n return arguments.length > 1\n ? this.each((value == null\n ? propertyRemove : typeof value === \"function\"\n ? propertyFunction\n : propertyConstant)(name, value))\n : this.node()[name];\n}\n", "function classArray(string) {\n return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n this._node = node;\n this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n add: function(name) {\n var i = this._names.indexOf(name);\n if (i < 0) {\n this._names.push(name);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n remove: function(name) {\n var i = this._names.indexOf(name);\n if (i >= 0) {\n this._names.splice(i, 1);\n this._node.setAttribute(\"class\", this._names.join(\" \"));\n }\n },\n contains: function(name) {\n return this._names.indexOf(name) >= 0;\n }\n};\n\nfunction classedAdd(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n var list = classList(node), i = -1, n = names.length;\n while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n return function() {\n classedAdd(this, names);\n };\n}\n\nfunction classedFalse(names) {\n return function() {\n classedRemove(this, names);\n };\n}\n\nfunction classedFunction(names, value) {\n return function() {\n (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n };\n}\n\nexport default function(name, value) {\n var names = classArray(name + \"\");\n\n if (arguments.length < 2) {\n var list = classList(this.node()), i = -1, n = names.length;\n while (++i < n) if (!list.contains(names[i])) return false;\n return true;\n }\n\n return this.each((typeof value === \"function\"\n ? classedFunction : value\n ? classedTrue\n : classedFalse)(names, value));\n}\n", "function textRemove() {\n this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.textContent = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? textRemove : (typeof value === \"function\"\n ? textFunction\n : textConstant)(value))\n : this.node().textContent;\n}\n", "function htmlRemove() {\n this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n return function() {\n this.innerHTML = value;\n };\n}\n\nfunction htmlFunction(value) {\n return function() {\n var v = value.apply(this, arguments);\n this.innerHTML = v == null ? \"\" : v;\n };\n}\n\nexport default function(value) {\n return arguments.length\n ? this.each(value == null\n ? htmlRemove : (typeof value === \"function\"\n ? htmlFunction\n : htmlConstant)(value))\n : this.node().innerHTML;\n}\n", "function raise() {\n if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n return this.each(raise);\n}\n", "function lower() {\n if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n return this.each(lower);\n}\n", "import creator from \"../creator.js\";\n\nexport default function(name) {\n var create = typeof name === \"function\" ? name : creator(name);\n return this.select(function() {\n return this.appendChild(create.apply(this, arguments));\n });\n}\n", "import creator from \"../creator.js\";\nimport selector from \"../selector.js\";\n\nfunction constantNull() {\n return null;\n}\n\nexport default function(name, before) {\n var create = typeof name === \"function\" ? name : creator(name),\n select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n return this.select(function() {\n return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n });\n}\n", "function remove() {\n var parent = this.parentNode;\n if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n return this.each(remove);\n}\n", "function selection_cloneShallow() {\n var clone = this.cloneNode(false), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n var clone = this.cloneNode(true), parent = this.parentNode;\n return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n", "export default function(value) {\n return arguments.length\n ? this.property(\"__data__\", value)\n : this.node().__data__;\n}\n", "function contextListener(listener) {\n return function(event) {\n listener.call(this, event, this.__data__);\n };\n}\n\nfunction parseTypenames(typenames) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n return {type: t, name: name};\n });\n}\n\nfunction onRemove(typename) {\n return function() {\n var on = this.__on;\n if (!on) return;\n for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n } else {\n on[++i] = o;\n }\n }\n if (++i) on.length = i;\n else delete this.__on;\n };\n}\n\nfunction onAdd(typename, value, options) {\n return function() {\n var on = this.__on, o, listener = contextListener(value);\n if (on) for (var j = 0, m = on.length; j < m; ++j) {\n if ((o = on[j]).type === typename.type && o.name === typename.name) {\n this.removeEventListener(o.type, o.listener, o.options);\n this.addEventListener(o.type, o.listener = listener, o.options = options);\n o.value = value;\n return;\n }\n }\n this.addEventListener(typename.type, listener, options);\n o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n if (!on) this.__on = [o];\n else on.push(o);\n };\n}\n\nexport default function(typename, value, options) {\n var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n if (arguments.length < 2) {\n var on = this.node().__on;\n if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n for (i = 0, o = on[j]; i < n; ++i) {\n if ((t = typenames[i]).type === o.type && t.name === o.name) {\n return o.value;\n }\n }\n }\n return;\n }\n\n on = value ? onAdd : onRemove;\n for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n return this;\n}\n", "import defaultView from \"../window.js\";\n\nfunction dispatchEvent(node, type, params) {\n var window = defaultView(node),\n event = window.CustomEvent;\n\n if (typeof event === \"function\") {\n event = new event(type, params);\n } else {\n event = window.document.createEvent(\"Event\");\n if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n else event.initEvent(type, false, false);\n }\n\n node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n return function() {\n return dispatchEvent(this, type, params);\n };\n}\n\nfunction dispatchFunction(type, params) {\n return function() {\n return dispatchEvent(this, type, params.apply(this, arguments));\n };\n}\n\nexport default function(type, params) {\n return this.each((typeof params === \"function\"\n ? dispatchFunction\n : dispatchConstant)(type, params));\n}\n", "export default function*() {\n for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n if (node = group[i]) yield node;\n }\n }\n}\n", "import selection_select from \"./select.js\";\nimport selection_selectAll from \"./selectAll.js\";\nimport selection_selectChild from \"./selectChild.js\";\nimport selection_selectChildren from \"./selectChildren.js\";\nimport selection_filter from \"./filter.js\";\nimport selection_data from \"./data.js\";\nimport selection_enter from \"./enter.js\";\nimport selection_exit from \"./exit.js\";\nimport selection_join from \"./join.js\";\nimport selection_merge from \"./merge.js\";\nimport selection_order from \"./order.js\";\nimport selection_sort from \"./sort.js\";\nimport selection_call from \"./call.js\";\nimport selection_nodes from \"./nodes.js\";\nimport selection_node from \"./node.js\";\nimport selection_size from \"./size.js\";\nimport selection_empty from \"./empty.js\";\nimport selection_each from \"./each.js\";\nimport selection_attr from \"./attr.js\";\nimport selection_style from \"./style.js\";\nimport selection_property from \"./property.js\";\nimport selection_classed from \"./classed.js\";\nimport selection_text from \"./text.js\";\nimport selection_html from \"./html.js\";\nimport selection_raise from \"./raise.js\";\nimport selection_lower from \"./lower.js\";\nimport selection_append from \"./append.js\";\nimport selection_insert from \"./insert.js\";\nimport selection_remove from \"./remove.js\";\nimport selection_clone from \"./clone.js\";\nimport selection_datum from \"./datum.js\";\nimport selection_on from \"./on.js\";\nimport selection_dispatch from \"./dispatch.js\";\nimport selection_iterator from \"./iterator.js\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n this._groups = groups;\n this._parents = parents;\n}\n\nfunction selection() {\n return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n return this;\n}\n\nSelection.prototype = selection.prototype = {\n constructor: Selection,\n select: selection_select,\n selectAll: selection_selectAll,\n selectChild: selection_selectChild,\n selectChildren: selection_selectChildren,\n filter: selection_filter,\n data: selection_data,\n enter: selection_enter,\n exit: selection_exit,\n join: selection_join,\n merge: selection_merge,\n selection: selection_selection,\n order: selection_order,\n sort: selection_sort,\n call: selection_call,\n nodes: selection_nodes,\n node: selection_node,\n size: selection_size,\n empty: selection_empty,\n each: selection_each,\n attr: selection_attr,\n style: selection_style,\n property: selection_property,\n classed: selection_classed,\n text: selection_text,\n html: selection_html,\n raise: selection_raise,\n lower: selection_lower,\n append: selection_append,\n insert: selection_insert,\n remove: selection_remove,\n clone: selection_clone,\n datum: selection_datum,\n on: selection_on,\n dispatch: selection_dispatch,\n [Symbol.iterator]: selection_iterator\n};\n\nexport default selection;\n", "import {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([[document.querySelector(selector)]], [document.documentElement])\n : new Selection([[selector]], root);\n}\n", "import creator from \"./creator.js\";\nimport select from \"./select.js\";\n\nexport default function(name) {\n return select(creator(name).call(document.documentElement));\n}\n", "var nextId = 0;\n\nexport default function local() {\n return new Local;\n}\n\nfunction Local() {\n this._ = \"@\" + (++nextId).toString(36);\n}\n\nLocal.prototype = local.prototype = {\n constructor: Local,\n get: function(node) {\n var id = this._;\n while (!(id in node)) if (!(node = node.parentNode)) return;\n return node[id];\n },\n set: function(node, value) {\n return node[this._] = value;\n },\n remove: function(node) {\n return this._ in node && delete node[this._];\n },\n toString: function() {\n return this._;\n }\n};\n", "export default function(event) {\n let sourceEvent;\n while (sourceEvent = event.sourceEvent) event = sourceEvent;\n return event;\n}\n", "import sourceEvent from \"./sourceEvent.js\";\n\nexport default function(event, node) {\n event = sourceEvent(event);\n if (node === undefined) node = event.currentTarget;\n if (node) {\n var svg = node.ownerSVGElement || node;\n if (svg.createSVGPoint) {\n var point = svg.createSVGPoint();\n point.x = event.clientX, point.y = event.clientY;\n point = point.matrixTransform(node.getScreenCTM().inverse());\n return [point.x, point.y];\n }\n if (node.getBoundingClientRect) {\n var rect = node.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n }\n }\n return [event.pageX, event.pageY];\n}\n", "import pointer from \"./pointer.js\";\nimport sourceEvent from \"./sourceEvent.js\";\n\nexport default function(events, node) {\n if (events.target) { // i.e., instanceof Event, not TouchList or iterable\n events = sourceEvent(events);\n if (node === undefined) node = events.currentTarget;\n events = events.touches || [events];\n }\n return Array.from(events, event => pointer(event, node));\n}\n", "import array from \"./array.js\";\nimport {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([document.querySelectorAll(selector)], [document.documentElement])\n : new Selection([array(selector)], root);\n}\n", "export {default as create} from \"./create.js\";\nexport {default as creator} from \"./creator.js\";\nexport {default as local} from \"./local.js\";\nexport {default as matcher} from \"./matcher.js\";\nexport {default as namespace} from \"./namespace.js\";\nexport {default as namespaces} from \"./namespaces.js\";\nexport {default as pointer} from \"./pointer.js\";\nexport {default as pointers} from \"./pointers.js\";\nexport {default as select} from \"./select.js\";\nexport {default as selectAll} from \"./selectAll.js\";\nexport {default as selection} from \"./selection/index.js\";\nexport {default as selector} from \"./selector.js\";\nexport {default as selectorAll} from \"./selectorAll.js\";\nexport {styleValue as style} from \"./selection/style.js\";\nexport {default as window} from \"./window.js\";\n", "// These are typically used in conjunction with noevent to ensure that we can\n// preventDefault on the event.\nexport const nonpassive = {passive: false};\nexport const nonpassivecapture = {capture: true, passive: false};\n\nexport function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n", "import {select} from \"d3-selection\";\nimport noevent, {nonpassivecapture} from \"./noevent.js\";\n\nexport default function(view) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", noevent, nonpassivecapture);\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", noevent, nonpassivecapture);\n } else {\n root.__noselect = root.style.MozUserSelect;\n root.style.MozUserSelect = \"none\";\n }\n}\n\nexport function yesdrag(view, noclick) {\n var root = view.document.documentElement,\n selection = select(view).on(\"dragstart.drag\", null);\n if (noclick) {\n selection.on(\"click.drag\", noevent, nonpassivecapture);\n setTimeout(function() { selection.on(\"click.drag\", null); }, 0);\n }\n if (\"onselectstart\" in root) {\n selection.on(\"selectstart.drag\", null);\n } else {\n root.style.MozUserSelect = root.__noselect;\n delete root.__noselect;\n }\n}\n", "export {default as drag} from \"./drag.js\";\nexport {default as dragDisable, yesdrag as dragEnable} from \"./nodrag.js\";\n", "var frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nexport function Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nexport function timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nexport function timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we\u2019ve set an alarm, if we haven\u2019t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n", "import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n var t = new Timer;\n delay = delay == null ? 0 : +delay;\n t.restart(elapsed => {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n}\n", "export {\n now,\n timer,\n timerFlush\n} from \"./timer.js\";\n\nexport {\n default as timeout\n} from \"./timeout.js\";\n\nexport {\n default as interval\n} from \"./interval.js\";\n", "import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n var schedules = node.__transition;\n if (!schedules) node.__transition = {};\n else if (id in schedules) return;\n create(node, id, {\n name: name,\n index: index, // For context during callback.\n group: group, // For context during callback.\n on: emptyOn,\n tween: emptyTween,\n time: timing.time,\n delay: timing.delay,\n duration: timing.duration,\n ease: timing.ease,\n timer: null,\n state: CREATED\n });\n}\n\nexport function init(node, id) {\n var schedule = get(node, id);\n if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n return schedule;\n}\n\nexport function set(node, id) {\n var schedule = get(node, id);\n if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n return schedule;\n}\n\nexport function get(node, id) {\n var schedule = node.__transition;\n if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n return schedule;\n}\n\nfunction create(node, id, self) {\n var schedules = node.__transition,\n tween;\n\n // Initialize the self timer when the transition is created.\n // Note the actual delay is not known until the first callback!\n schedules[id] = self;\n self.timer = timer(schedule, 0, self.time);\n\n function schedule(elapsed) {\n self.state = SCHEDULED;\n self.timer.restart(start, self.delay, self.time);\n\n // If the elapsed delay is less than our first sleep, start immediately.\n if (self.delay <= elapsed) start(elapsed - self.delay);\n }\n\n function start(elapsed) {\n var i, j, n, o;\n\n // If the state is not SCHEDULED, then we previously errored on start.\n if (self.state !== SCHEDULED) return stop();\n\n for (i in schedules) {\n o = schedules[i];\n if (o.name !== self.name) continue;\n\n // While this element already has a starting transition during this frame,\n // defer starting an interrupting transition until that transition has a\n // chance to tick (and possibly end); see d3/d3-transition#54!\n if (o.state === STARTED) return timeout(start);\n\n // Interrupt the active transition, if any.\n if (o.state === RUNNING) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n\n // Cancel any pre-empted transitions.\n else if (+i < id) {\n o.state = ENDED;\n o.timer.stop();\n o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n delete schedules[i];\n }\n }\n\n // Defer the first tick to end of the current frame; see d3/d3#1576.\n // Note the transition may be canceled after start and before the first tick!\n // Note this must be scheduled before the start event; see d3/d3-transition#16!\n // Assuming this is successful, subsequent callbacks go straight to tick.\n timeout(function() {\n if (self.state === STARTED) {\n self.state = RUNNING;\n self.timer.restart(tick, self.delay, self.time);\n tick(elapsed);\n }\n });\n\n // Dispatch the start event.\n // Note this must be done before the tween are initialized.\n self.state = STARTING;\n self.on.call(\"start\", node, node.__data__, self.index, self.group);\n if (self.state !== STARTING) return; // interrupted\n self.state = STARTED;\n\n // Initialize the tween, deleting null tween.\n tween = new Array(n = self.tween.length);\n for (i = 0, j = -1; i < n; ++i) {\n if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n tween[++j] = o;\n }\n }\n tween.length = j + 1;\n }\n\n function tick(elapsed) {\n var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n i = -1,\n n = tween.length;\n\n while (++i < n) {\n tween[i].call(node, t);\n }\n\n // Dispatch the end event.\n if (self.state === ENDING) {\n self.on.call(\"end\", node, node.__data__, self.index, self.group);\n stop();\n }\n }\n\n function stop() {\n self.state = ENDED;\n self.timer.stop();\n delete schedules[id];\n for (var i in schedules) return; // eslint-disable-line no-unused-vars\n delete node.__transition;\n }\n}\n", "import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n var schedules = node.__transition,\n schedule,\n active,\n empty = true,\n i;\n\n if (!schedules) return;\n\n name = name == null ? null : name + \"\";\n\n for (i in schedules) {\n if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n active = schedule.state > STARTING && schedule.state < ENDING;\n schedule.state = ENDED;\n schedule.timer.stop();\n schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n delete schedules[i];\n }\n\n if (empty) delete node.__transition;\n}\n", "import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n return this.each(function() {\n interrupt(this, name);\n });\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n var tween0, tween1;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we\u2019re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = tween0 = tween;\n for (var i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1 = tween1.slice();\n tween1.splice(i, 1);\n break;\n }\n }\n }\n\n schedule.tween = tween1;\n };\n}\n\nfunction tweenFunction(id, name, value) {\n var tween0, tween1;\n if (typeof value !== \"function\") throw new Error;\n return function() {\n var schedule = set(this, id),\n tween = schedule.tween;\n\n // If this node shared tween with the previous node,\n // just assign the updated shared tween and we\u2019re done!\n // Otherwise, copy-on-write.\n if (tween !== tween0) {\n tween1 = (tween0 = tween).slice();\n for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n if (tween1[i].name === name) {\n tween1[i] = t;\n break;\n }\n }\n if (i === n) tween1.push(t);\n }\n\n schedule.tween = tween1;\n };\n}\n\nexport default function(name, value) {\n var id = this._id;\n\n name += \"\";\n\n if (arguments.length < 2) {\n var tween = get(this.node(), id).tween;\n for (var i = 0, n = tween.length, t; i < n; ++i) {\n if ((t = tween[i]).name === name) {\n return t.value;\n }\n }\n return null;\n }\n\n return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n var id = transition._id;\n\n transition.each(function() {\n var schedule = set(this, id);\n (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n });\n\n return function(node) {\n return get(node, id).value[name];\n };\n}\n", "import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n var c;\n return (typeof b === \"number\" ? interpolateNumber\n : b instanceof color ? interpolateRgb\n : (c = color(b)) ? (b = c, interpolateRgb)\n : interpolateString)(a, b);\n}\n", "import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n return function() {\n this.removeAttribute(name);\n };\n}\n\nfunction attrRemoveNS(fullname) {\n return function() {\n this.removeAttributeNS(fullname.space, fullname.local);\n };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttribute(name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = this.getAttributeNS(fullname.space, fullname.local);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction attrFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttribute(name);\n string0 = this.getAttribute(name);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0, value1 = value(this), string1;\n if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n string0 = this.getAttributeNS(fullname.space, fullname.local);\n string1 = value1 + \"\";\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nexport default function(name, value) {\n var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n return this.attrTween(name, typeof value === \"function\"\n ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n", "import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n return function(t) {\n this.setAttribute(name, i.call(this, t));\n };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n return function(t) {\n this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n };\n}\n\nfunction attrTweenNS(fullname, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nfunction attrTween(name, value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value) {\n var key = \"attr.\" + name;\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n var fullname = namespace(name);\n return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n", "import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n return function() {\n init(this, id).delay = +value.apply(this, arguments);\n };\n}\n\nfunction delayConstant(id, value) {\n return value = +value, function() {\n init(this, id).delay = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? delayFunction\n : delayConstant)(id, value))\n : get(this.node(), id).delay;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n return function() {\n set(this, id).duration = +value.apply(this, arguments);\n };\n}\n\nfunction durationConstant(id, value) {\n return value = +value, function() {\n set(this, id).duration = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each((typeof value === \"function\"\n ? durationFunction\n : durationConstant)(id, value))\n : get(this.node(), id).duration;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n if (typeof value !== \"function\") throw new Error;\n return function() {\n set(this, id).ease = value;\n };\n}\n\nexport default function(value) {\n var id = this._id;\n\n return arguments.length\n ? this.each(easeConstant(id, value))\n : get(this.node(), id).ease;\n}\n", "import {set} from \"./schedule.js\";\n\nfunction easeVarying(id, value) {\n return function() {\n var v = value.apply(this, arguments);\n if (typeof v !== \"function\") throw new Error;\n set(this, id).ease = v;\n };\n}\n\nexport default function(value) {\n if (typeof value !== \"function\") throw new Error;\n return this.each(easeVarying(this._id, value));\n}\n", "import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n if (typeof match !== \"function\") match = matcher(match);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n subgroup.push(node);\n }\n }\n }\n\n return new Transition(subgroups, this._parents, this._name, this._id);\n}\n", "import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n if (transition._id !== this._id) throw new Error;\n\n for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n if (node = group0[i] || group1[i]) {\n merge[i] = node;\n }\n }\n }\n\n for (; j < m0; ++j) {\n merges[j] = groups0[j];\n }\n\n return new Transition(merges, this._parents, this._name, this._id);\n}\n", "import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n var i = t.indexOf(\".\");\n if (i >= 0) t = t.slice(0, i);\n return !t || t === \"start\";\n });\n}\n\nfunction onFunction(id, name, listener) {\n var on0, on1, sit = start(name) ? init : set;\n return function() {\n var schedule = sit(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, listener) {\n var id = this._id;\n\n return arguments.length < 2\n ? get(this.node(), id).on.on(name)\n : this.each(onFunction(id, name, listener));\n}\n", "function removeFunction(id) {\n return function() {\n var parent = this.parentNode;\n for (var i in this.__transition) if (+i !== id) return;\n if (parent) parent.removeChild(this);\n };\n}\n\nexport default function() {\n return this.on(\"end.remove\", removeFunction(this._id));\n}\n", "import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selector(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n subgroup[i] = subnode;\n schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n }\n }\n }\n\n return new Transition(subgroups, this._parents, name, id);\n}\n", "import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n var name = this._name,\n id = this._id;\n\n if (typeof select !== \"function\") select = selectorAll(select);\n\n for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n if (child = children[k]) {\n schedule(child, name, id, k, children, inherit);\n }\n }\n subgroups.push(children);\n parents.push(node);\n }\n }\n }\n\n return new Transition(subgroups, parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n return new Selection(this._groups, this._parents);\n}\n", "import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n string1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, string10 = string1);\n };\n}\n\nfunction styleRemove(name) {\n return function() {\n this.style.removeProperty(name);\n };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n var string00,\n string1 = value1 + \"\",\n interpolate0;\n return function() {\n var string0 = style(this, name);\n return string0 === string1 ? null\n : string0 === string00 ? interpolate0\n : interpolate0 = interpolate(string00 = string0, value1);\n };\n}\n\nfunction styleFunction(name, interpolate, value) {\n var string00,\n string10,\n interpolate0;\n return function() {\n var string0 = style(this, name),\n value1 = value(this),\n string1 = value1 + \"\";\n if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n return string0 === string1 ? null\n : string0 === string00 && string1 === string10 ? interpolate0\n : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n };\n}\n\nfunction styleMaybeRemove(id, name) {\n var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n return function() {\n var schedule = set(this, id),\n on = schedule.on,\n listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n schedule.on = on1;\n };\n}\n\nexport default function(name, value, priority) {\n var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n return value == null ? this\n .styleTween(name, styleNull(name, i))\n .on(\"end.style.\" + name, styleRemove(name))\n : typeof value === \"function\" ? this\n .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n .each(styleMaybeRemove(this._id, name))\n : this\n .styleTween(name, styleConstant(name, i, value), priority)\n .on(\"end.style.\" + name, null);\n}\n", "function styleInterpolate(name, i, priority) {\n return function(t) {\n this.style.setProperty(name, i.call(this, t), priority);\n };\n}\n\nfunction styleTween(name, value, priority) {\n var t, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n return t;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(name, value, priority) {\n var key = \"style.\" + (name += \"\");\n if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n", "import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n return function() {\n this.textContent = value;\n };\n}\n\nfunction textFunction(value) {\n return function() {\n var value1 = value(this);\n this.textContent = value1 == null ? \"\" : value1;\n };\n}\n\nexport default function(value) {\n return this.tween(\"text\", typeof value === \"function\"\n ? textFunction(tweenValue(this, \"text\", value))\n : textConstant(value == null ? \"\" : value + \"\"));\n}\n", "function textInterpolate(i) {\n return function(t) {\n this.textContent = i.call(this, t);\n };\n}\n\nfunction textTween(value) {\n var t0, i0;\n function tween() {\n var i = value.apply(this, arguments);\n if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n return t0;\n }\n tween._value = value;\n return tween;\n}\n\nexport default function(value) {\n var key = \"text\";\n if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n if (value == null) return this.tween(key, null);\n if (typeof value !== \"function\") throw new Error;\n return this.tween(key, textTween(value));\n}\n", "import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n var name = this._name,\n id0 = this._id,\n id1 = newId();\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n var inherit = get(node, id0);\n schedule(node, name, id1, i, group, {\n time: inherit.time + inherit.delay + inherit.duration,\n delay: 0,\n duration: inherit.duration,\n ease: inherit.ease\n });\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id1);\n}\n", "import {set} from \"./schedule.js\";\n\nexport default function() {\n var on0, on1, that = this, id = that._id, size = that.size();\n return new Promise(function(resolve, reject) {\n var cancel = {value: reject},\n end = {value: function() { if (--size === 0) resolve(); }};\n\n that.each(function() {\n var schedule = set(this, id),\n on = schedule.on;\n\n // If this node shared a dispatch with the previous node,\n // just assign the updated shared dispatch and we\u2019re done!\n // Otherwise, copy-on-write.\n if (on !== on0) {\n on1 = (on0 = on).copy();\n on1._.cancel.push(cancel);\n on1._.interrupt.push(cancel);\n on1._.end.push(end);\n }\n\n schedule.on = on1;\n });\n\n // The selection was empty, resolve end immediately\n if (size === 0) resolve();\n });\n}\n", "import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_easeVarying from \"./easeVarying.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n this._groups = groups;\n this._parents = parents;\n this._name = name;\n this._id = id;\n}\n\nexport default function transition(name) {\n return selection().transition(name);\n}\n\nexport function newId() {\n return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n constructor: Transition,\n select: transition_select,\n selectAll: transition_selectAll,\n selectChild: selection_prototype.selectChild,\n selectChildren: selection_prototype.selectChildren,\n filter: transition_filter,\n merge: transition_merge,\n selection: transition_selection,\n transition: transition_transition,\n call: selection_prototype.call,\n nodes: selection_prototype.nodes,\n node: selection_prototype.node,\n size: selection_prototype.size,\n empty: selection_prototype.empty,\n each: selection_prototype.each,\n on: transition_on,\n attr: transition_attr,\n attrTween: transition_attrTween,\n style: transition_style,\n styleTween: transition_styleTween,\n text: transition_text,\n textTween: transition_textTween,\n remove: transition_remove,\n tween: transition_tween,\n delay: transition_delay,\n duration: transition_duration,\n ease: transition_ease,\n easeVarying: transition_easeVarying,\n end: transition_end,\n [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n", "export function cubicIn(t) {\n return t * t * t;\n}\n\nexport function cubicOut(t) {\n return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n", "export {\n linear as easeLinear\n} from \"./linear.js\";\n\nexport {\n quadInOut as easeQuad,\n quadIn as easeQuadIn,\n quadOut as easeQuadOut,\n quadInOut as easeQuadInOut\n} from \"./quad.js\";\n\nexport {\n cubicInOut as easeCubic,\n cubicIn as easeCubicIn,\n cubicOut as easeCubicOut,\n cubicInOut as easeCubicInOut\n} from \"./cubic.js\";\n\nexport {\n polyInOut as easePoly,\n polyIn as easePolyIn,\n polyOut as easePolyOut,\n polyInOut as easePolyInOut\n} from \"./poly.js\";\n\nexport {\n sinInOut as easeSin,\n sinIn as easeSinIn,\n sinOut as easeSinOut,\n sinInOut as easeSinInOut\n} from \"./sin.js\";\n\nexport {\n expInOut as easeExp,\n expIn as easeExpIn,\n expOut as easeExpOut,\n expInOut as easeExpInOut\n} from \"./exp.js\";\n\nexport {\n circleInOut as easeCircle,\n circleIn as easeCircleIn,\n circleOut as easeCircleOut,\n circleInOut as easeCircleInOut\n} from \"./circle.js\";\n\nexport {\n bounceOut as easeBounce,\n bounceIn as easeBounceIn,\n bounceOut as easeBounceOut,\n bounceInOut as easeBounceInOut\n} from \"./bounce.js\";\n\nexport {\n backInOut as easeBack,\n backIn as easeBackIn,\n backOut as easeBackOut,\n backInOut as easeBackInOut\n} from \"./back.js\";\n\nexport {\n elasticOut as easeElastic,\n elasticIn as easeElasticIn,\n elasticOut as easeElasticOut,\n elasticInOut as easeElasticInOut\n} from \"./elastic.js\";\n", "import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n time: null, // Set on use.\n delay: 0,\n duration: 250,\n ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n var timing;\n while (!(timing = node.__transition) || !(timing = timing[id])) {\n if (!(node = node.parentNode)) {\n throw new Error(`transition ${id} not found`);\n }\n }\n return timing;\n}\n\nexport default function(name) {\n var id,\n timing;\n\n if (name instanceof Transition) {\n id = name._id, name = name._name;\n } else {\n id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n }\n\n for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n if (node = group[i]) {\n schedule(node, name, id, i, group, timing || inherit(node, id));\n }\n }\n }\n\n return new Transition(groups, this._parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n", "import \"./selection/index.js\";\nexport {default as transition} from \"./transition/index.js\";\nexport {default as active} from \"./active.js\";\nexport {default as interrupt} from \"./interrupt.js\";\n", "export default x => () => x;\n", "export default function ZoomEvent(type, {\n sourceEvent,\n target,\n transform,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n transform: {value: transform, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n", "export function Transform(k, x, y) {\n this.k = k;\n this.x = x;\n this.y = y;\n}\n\nTransform.prototype = {\n constructor: Transform,\n scale: function(k) {\n return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n },\n translate: function(x, y) {\n return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n },\n apply: function(point) {\n return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n },\n applyX: function(x) {\n return x * this.k + this.x;\n },\n applyY: function(y) {\n return y * this.k + this.y;\n },\n invert: function(location) {\n return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n },\n invertX: function(x) {\n return (x - this.x) / this.k;\n },\n invertY: function(y) {\n return (y - this.y) / this.k;\n },\n rescaleX: function(x) {\n return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n },\n rescaleY: function(y) {\n return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n },\n toString: function() {\n return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n return node.__zoom;\n}\n", "export function nopropagation(event) {\n event.stopImmediatePropagation();\n}\n\nexport default function(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n}\n", "import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolateZoom} from \"d3-interpolate\";\nimport {select, pointer} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport ZoomEvent from \"./event.js\";\nimport {Transform, identity} from \"./transform.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\n// Ignore right-click, since that should open the context menu.\n// except for pinch-to-zoom, which is sent as a wheel+ctrlKey event\nfunction defaultFilter(event) {\n return (!event.ctrlKey || event.type === 'wheel') && !event.button;\n}\n\nfunction defaultExtent() {\n var e = this;\n if (e instanceof SVGElement) {\n e = e.ownerSVGElement || e;\n if (e.hasAttribute(\"viewBox\")) {\n e = e.viewBox.baseVal;\n return [[e.x, e.y], [e.x + e.width, e.y + e.height]];\n }\n return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];\n }\n return [[0, 0], [e.clientWidth, e.clientHeight]];\n}\n\nfunction defaultTransform() {\n return this.__zoom || identity;\n}\n\nfunction defaultWheelDelta(event) {\n return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * (event.ctrlKey ? 10 : 1);\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nfunction defaultConstrain(transform, extent, translateExtent) {\n var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],\n dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],\n dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],\n dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];\n return transform.translate(\n dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),\n dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)\n );\n}\n\nexport default function() {\n var filter = defaultFilter,\n extent = defaultExtent,\n constrain = defaultConstrain,\n wheelDelta = defaultWheelDelta,\n touchable = defaultTouchable,\n scaleExtent = [0, Infinity],\n translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],\n duration = 250,\n interpolate = interpolateZoom,\n listeners = dispatch(\"start\", \"zoom\", \"end\"),\n touchstarting,\n touchfirst,\n touchending,\n touchDelay = 500,\n wheelDelay = 150,\n clickDistance2 = 0,\n tapDistance = 10;\n\n function zoom(selection) {\n selection\n .property(\"__zoom\", defaultTransform)\n .on(\"wheel.zoom\", wheeled, {passive: false})\n .on(\"mousedown.zoom\", mousedowned)\n .on(\"dblclick.zoom\", dblclicked)\n .filter(touchable)\n .on(\"touchstart.zoom\", touchstarted)\n .on(\"touchmove.zoom\", touchmoved)\n .on(\"touchend.zoom touchcancel.zoom\", touchended)\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n zoom.transform = function(collection, transform, point, event) {\n var selection = collection.selection ? collection.selection() : collection;\n selection.property(\"__zoom\", defaultTransform);\n if (collection !== selection) {\n schedule(collection, transform, point, event);\n } else {\n selection.interrupt().each(function() {\n gesture(this, arguments)\n .event(event)\n .start()\n .zoom(null, typeof transform === \"function\" ? transform.apply(this, arguments) : transform)\n .end();\n });\n }\n };\n\n zoom.scaleBy = function(selection, k, p, event) {\n zoom.scaleTo(selection, function() {\n var k0 = this.__zoom.k,\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return k0 * k1;\n }, p, event);\n };\n\n zoom.scaleTo = function(selection, k, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t0 = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p,\n p1 = t0.invert(p0),\n k1 = typeof k === \"function\" ? k.apply(this, arguments) : k;\n return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);\n }, p, event);\n };\n\n zoom.translateBy = function(selection, x, y, event) {\n zoom.transform(selection, function() {\n return constrain(this.__zoom.translate(\n typeof x === \"function\" ? x.apply(this, arguments) : x,\n typeof y === \"function\" ? y.apply(this, arguments) : y\n ), extent.apply(this, arguments), translateExtent);\n }, null, event);\n };\n\n zoom.translateTo = function(selection, x, y, p, event) {\n zoom.transform(selection, function() {\n var e = extent.apply(this, arguments),\n t = this.__zoom,\n p0 = p == null ? centroid(e) : typeof p === \"function\" ? p.apply(this, arguments) : p;\n return constrain(identity.translate(p0[0], p0[1]).scale(t.k).translate(\n typeof x === \"function\" ? -x.apply(this, arguments) : -x,\n typeof y === \"function\" ? -y.apply(this, arguments) : -y\n ), e, translateExtent);\n }, p, event);\n };\n\n function scale(transform, k) {\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));\n return k === transform.k ? transform : new Transform(k, transform.x, transform.y);\n }\n\n function translate(transform, p0, p1) {\n var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;\n return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);\n }\n\n function centroid(extent) {\n return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];\n }\n\n function schedule(transition, transform, point, event) {\n transition\n .on(\"start.zoom\", function() { gesture(this, arguments).event(event).start(); })\n .on(\"interrupt.zoom end.zoom\", function() { gesture(this, arguments).event(event).end(); })\n .tween(\"zoom\", function() {\n var that = this,\n args = arguments,\n g = gesture(that, args).event(event),\n e = extent.apply(that, args),\n p = point == null ? centroid(e) : typeof point === \"function\" ? point.apply(that, args) : point,\n w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),\n a = that.__zoom,\n b = typeof transform === \"function\" ? transform.apply(that, args) : transform,\n i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));\n return function(t) {\n if (t === 1) t = b; // Avoid rounding error on end.\n else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }\n g.zoom(null, t);\n };\n });\n }\n\n function gesture(that, args, clean) {\n return (!clean && that.__zooming) || new Gesture(that, args);\n }\n\n function Gesture(that, args) {\n this.that = that;\n this.args = args;\n this.active = 0;\n this.sourceEvent = null;\n this.extent = extent.apply(that, args);\n this.taps = 0;\n }\n\n Gesture.prototype = {\n event: function(event) {\n if (event) this.sourceEvent = event;\n return this;\n },\n start: function() {\n if (++this.active === 1) {\n this.that.__zooming = this;\n this.emit(\"start\");\n }\n return this;\n },\n zoom: function(key, transform) {\n if (this.mouse && key !== \"mouse\") this.mouse[1] = transform.invert(this.mouse[0]);\n if (this.touch0 && key !== \"touch\") this.touch0[1] = transform.invert(this.touch0[0]);\n if (this.touch1 && key !== \"touch\") this.touch1[1] = transform.invert(this.touch1[0]);\n this.that.__zoom = transform;\n this.emit(\"zoom\");\n return this;\n },\n end: function() {\n if (--this.active === 0) {\n delete this.that.__zooming;\n this.emit(\"end\");\n }\n return this;\n },\n emit: function(type) {\n var d = select(this.that).datum();\n listeners.call(\n type,\n this.that,\n new ZoomEvent(type, {\n sourceEvent: this.sourceEvent,\n target: zoom,\n type,\n transform: this.that.__zoom,\n dispatch: listeners\n }),\n d\n );\n }\n };\n\n function wheeled(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var g = gesture(this, args).event(event),\n t = this.__zoom,\n k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),\n p = pointer(event);\n\n // If the mouse is in the same location as before, reuse it.\n // If there were recent wheel events, reset the wheel idle timeout.\n if (g.wheel) {\n if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {\n g.mouse[1] = t.invert(g.mouse[0] = p);\n }\n clearTimeout(g.wheel);\n }\n\n // If this wheel event won\u2019t trigger a transform change, ignore it.\n else if (t.k === k) return;\n\n // Otherwise, capture the mouse point and location at the start.\n else {\n g.mouse = [p, t.invert(p)];\n interrupt(this);\n g.start();\n }\n\n noevent(event);\n g.wheel = setTimeout(wheelidled, wheelDelay);\n g.zoom(\"mouse\", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));\n\n function wheelidled() {\n g.wheel = null;\n g.end();\n }\n }\n\n function mousedowned(event, ...args) {\n if (touchending || !filter.apply(this, arguments)) return;\n var currentTarget = event.currentTarget,\n g = gesture(this, args, true).event(event),\n v = select(event.view).on(\"mousemove.zoom\", mousemoved, true).on(\"mouseup.zoom\", mouseupped, true),\n p = pointer(event, currentTarget),\n x0 = event.clientX,\n y0 = event.clientY;\n\n dragDisable(event.view);\n nopropagation(event);\n g.mouse = [p, this.__zoom.invert(p)];\n interrupt(this);\n g.start();\n\n function mousemoved(event) {\n noevent(event);\n if (!g.moved) {\n var dx = event.clientX - x0, dy = event.clientY - y0;\n g.moved = dx * dx + dy * dy > clickDistance2;\n }\n g.event(event)\n .zoom(\"mouse\", constrain(translate(g.that.__zoom, g.mouse[0] = pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent));\n }\n\n function mouseupped(event) {\n v.on(\"mousemove.zoom mouseup.zoom\", null);\n dragEnable(event.view, g.moved);\n noevent(event);\n g.event(event).end();\n }\n }\n\n function dblclicked(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var t0 = this.__zoom,\n p0 = pointer(event.changedTouches ? event.changedTouches[0] : event, this),\n p1 = t0.invert(p0),\n k1 = t0.k * (event.shiftKey ? 0.5 : 2),\n t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);\n\n noevent(event);\n if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0, event);\n else select(this).call(zoom.transform, t1, p0, event);\n }\n\n function touchstarted(event, ...args) {\n if (!filter.apply(this, arguments)) return;\n var touches = event.touches,\n n = touches.length,\n g = gesture(this, args, event.changedTouches.length === n).event(event),\n started, i, t, p;\n\n nopropagation(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = pointer(t, this);\n p = [p, this.__zoom.invert(p), t.identifier];\n if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;\n else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0;\n }\n\n if (touchstarting) touchstarting = clearTimeout(touchstarting);\n\n if (started) {\n if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay);\n interrupt(this);\n g.start();\n }\n }\n\n function touchmoved(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t, p, l;\n\n noevent(event);\n for (i = 0; i < n; ++i) {\n t = touches[i], p = pointer(t, this);\n if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;\n else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;\n }\n t = g.that.__zoom;\n if (g.touch1) {\n var p0 = g.touch0[0], l0 = g.touch0[1],\n p1 = g.touch1[0], l1 = g.touch1[1],\n dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,\n dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;\n t = scale(t, Math.sqrt(dp / dl));\n p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];\n l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];\n }\n else if (g.touch0) p = g.touch0[0], l = g.touch0[1];\n else return;\n\n g.zoom(\"touch\", constrain(translate(t, p, l), g.extent, translateExtent));\n }\n\n function touchended(event, ...args) {\n if (!this.__zooming) return;\n var g = gesture(this, args).event(event),\n touches = event.changedTouches,\n n = touches.length, i, t;\n\n nopropagation(event);\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, touchDelay);\n for (i = 0; i < n; ++i) {\n t = touches[i];\n if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;\n else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;\n }\n if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;\n if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);\n else {\n g.end();\n // If this was a dbltap, reroute to the (optional) dblclick.zoom handler.\n if (g.taps === 2) {\n t = pointer(t, this);\n if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {\n var p = select(this).on(\"dblclick.zoom\");\n if (p) p.apply(this, arguments);\n }\n }\n }\n }\n\n zoom.wheelDelta = function(_) {\n return arguments.length ? (wheelDelta = typeof _ === \"function\" ? _ : constant(+_), zoom) : wheelDelta;\n };\n\n zoom.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), zoom) : filter;\n };\n\n zoom.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), zoom) : touchable;\n };\n\n zoom.extent = function(_) {\n return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;\n };\n\n zoom.scaleExtent = function(_) {\n return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];\n };\n\n zoom.translateExtent = function(_) {\n return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];\n };\n\n zoom.constrain = function(_) {\n return arguments.length ? (constrain = _, zoom) : constrain;\n };\n\n zoom.duration = function(_) {\n return arguments.length ? (duration = +_, zoom) : duration;\n };\n\n zoom.interpolate = function(_) {\n return arguments.length ? (interpolate = _, zoom) : interpolate;\n };\n\n zoom.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? zoom : value;\n };\n\n zoom.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);\n };\n\n zoom.tapDistance = function(_) {\n return arguments.length ? (tapDistance = +_, zoom) : tapDistance;\n };\n\n return zoom;\n}\n", "export {default as zoom} from \"./zoom.js\";\nexport {default as zoomTransform, identity as zoomIdentity, Transform as ZoomTransform} from \"./transform.js\";\n", "var e,t,n=\"object\"==typeof Reflect?Reflect:null,r=n&&\"function\"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&\"function\"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this);}e=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function u(e){if(\"function\"!=typeof e)throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function v(e,t,n,r){var i,o,s,v;if(u(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit(\"newListener\",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if(\"function\"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=f(e))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error(\"Possible EventEmitter memory leak detected. \"+s.length+\" \"+String(t)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");a.name=\"MaxListenersExceededWarning\",a.emitter=e,a.type=t,a.count=s.length,v=a,console&&console.warn&&console.warn(v);}return e}function a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=a.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return [];var i=r[t];return void 0===i?[]:\"function\"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var u=new Error(\"Unhandled error.\"+(s?\" (\"+s.message+\")\":\"\"));throw u.context=s,u}var f=o[e];if(void 0===f)return !1;if(\"function\"==typeof f)r(f,this,t);else {var v=f.length,a=c(f,v);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():!function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return \"function\"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};var y=e;y.EventEmitter;y.defaultMaxListeners;y.init;y.listenerCount;\n\ny.EventEmitter;\ny.defaultMaxListeners;\ny.init;\ny.listenerCount;\n\nexport { y };\n", "import { y } from './chunk-4bd36a8f.js';\nexport { y as default } from './chunk-4bd36a8f.js';\n\n// https://github.com/denoland/deno_std/blob/d005433c709054af87aca54f57a446b4f7966f11/node/events.ts#L501-L638\r\ny.once = function (emitter, event) {\r\n return new Promise((resolve, reject) => {\r\n function eventListener(...args) {\r\n if (errorListener !== undefined) {\r\n emitter.removeListener('error', errorListener);\r\n }\r\n resolve(args);\r\n }\r\n let errorListener;\r\n if (event !== 'error') {\r\n // deno-lint-ignore no-explicit-any\r\n errorListener = (err) => {\r\n emitter.removeListener(name, eventListener);\r\n reject(err);\r\n };\r\n\r\n emitter.once('error', errorListener);\r\n }\r\n\r\n emitter.once(event, eventListener);\r\n });\r\n};\r\ny.on = function (emitter, event) {\r\n const unconsumedEventValues = [];\r\n const unconsumedPromises = [];\r\n let error = null;\r\n let finished = false;\r\n\r\n const iterator = {\r\n async next() {\r\n const value = unconsumedEventValues.shift();\r\n if (value) {\r\n return createIterResult(value, false);\r\n }\r\n\r\n if (error) {\r\n const p = Promise.reject(error);\r\n error = null;\r\n return p;\r\n }\r\n\r\n if (finished) {\r\n return createIterResult(undefined, true);\r\n }\r\n\r\n return new Promise((resolve, reject) => unconsumedPromises.push({ resolve, reject }));\r\n },\r\n async return() {\r\n emitter.removeListener(event, eventHandler);\r\n emitter.removeListener('error', errorHandler);\r\n finished = true;\r\n\r\n for (const promise of unconsumedPromises) {\r\n promise.resolve(createIterResult(undefined, true));\r\n }\r\n\r\n return createIterResult(undefined, true);\r\n },\r\n throw(err) {\r\n error = err;\r\n emitter.removeListener(event, eventHandler);\r\n emitter.removeListener('error', errorHandler);\r\n },\r\n [Symbol.asyncIterator]() {\r\n return this;\r\n },\r\n };\r\n\r\n emitter.on(event, eventHandler);\r\n emitter.on('error', errorHandler);\r\n\r\n return iterator;\r\n\r\n function eventHandler(...args) {\r\n const promise = unconsumedPromises.shift();\r\n if (promise) {\r\n promise.resolve(createIterResult(args, false));\r\n } else {\r\n unconsumedEventValues.push(args);\r\n }\r\n }\r\n\r\n function errorHandler(err) {\r\n finished = true;\r\n const toError = unconsumedPromises.shift();\r\n if (toError) {\r\n toError.reject(err);\r\n } else {\r\n error = err;\r\n }\r\n iterator.return();\r\n }\r\n};\r\nconst {\r\n EventEmitter,\r\n defaultMaxListeners,\r\n init,\r\n listenerCount,\r\n on,\r\n once,\r\n} = y;\n\nexport { EventEmitter, defaultMaxListeners, init, listenerCount, on, once };\n", null, null, null, "module.exports = {\n EOF: 0,\n DELIMITER: 1,\n NUMBER: 2,\n STRING: 3,\n SYMBOL: 4\n}\n", "// token types\nvar tokenType = require('./token-type')\n\nvar ESCAPES = {\n 'n': '\\n',\n 'f': '\\f',\n 'r': '\\r',\n 't': '\\t',\n 'v': '\\v',\n '\\'': '\\'',\n '\"': '\"'\n}\n\nvar DELIMITERS = {\n ',': true,\n '(': true,\n ')': true,\n '[': true,\n ']': true,\n ';': true,\n\n // unary\n '~': true,\n\n // factorial\n '!': true,\n\n // arithmetic operators\n '+': true,\n '-': true,\n '*': true,\n '/': true,\n '%': true,\n '^': true,\n '**': true, // python power like\n\n // misc operators\n '|': true, // bitwise or\n '&': true, // bitwise and\n '^|': true, // bitwise xor\n '=': true,\n ':': true,\n '?': true,\n\n '||': true, // logical or\n '&&': true, // logical and\n 'xor': true, // logical xor\n\n // relational\n '==': true,\n '!=': true,\n '===': true,\n '!==': true,\n '<': true,\n '>': true,\n '>=': true,\n '<=': true,\n\n // shifts\n '>>>': true,\n '<<': true,\n '>>': true\n}\n\n// helpers\n\nfunction isDigit (c) {\n return c >= '0' && c <= '9'\n}\n\nfunction isIdentifier (c) {\n return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||\n c === '$' || c === '_'\n}\n\nfunction isWhitespace (c) {\n return c === ' ' || c === '\\r' || c === '\\t' ||\n c === '\\n' || c === '\\v' || c === '\\u00A0'\n}\n\nfunction isDelimiter (str) {\n return DELIMITERS[str]\n}\n\nfunction isQuote (c) {\n return c === '\\'' || c === '\"'\n}\n\n// lexer\n\nfunction Lexer () {}\n\nLexer.prototype.throwError = function (message, index) {\n index = typeof index === 'undefined' ? this.index : index\n\n var error = new Error(message + ' at index ' + index)\n error.index = index\n error.description = message\n throw error\n}\n\nLexer.prototype.lex = function (text) {\n this.text = text\n this.index = 0\n this.tokens = []\n\n while (this.index < this.text.length) {\n // skip whitespaces\n while (isWhitespace(this.peek())) {\n this.consume()\n }\n var c = this.peek()\n var c2 = c + this.peek(1)\n var c3 = c2 + this.peek(2)\n\n // order\n // - delimiter of 3 characters\n // - delimiter of 2 characters\n // - delimiter of 1 character\n // - number\n // - variables, functions and named operators\n if (isDelimiter(c3)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c3\n })\n this.consume()\n this.consume()\n this.consume()\n } else if (isDelimiter(c2)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c2\n })\n this.consume()\n this.consume()\n } else if (isDelimiter(c)) {\n this.tokens.push({\n type: tokenType.DELIMITER,\n value: c\n })\n this.consume()\n } else if (isDigit(c) ||\n (c === '.' && isDigit(this.peek(1)))) {\n this.tokens.push({\n type: tokenType.NUMBER,\n value: this.readNumber()\n })\n } else if (isQuote(c)) {\n this.tokens.push({\n type: tokenType.STRING,\n value: this.readString()\n })\n } else if (isIdentifier(c)) {\n this.tokens.push({\n type: tokenType.SYMBOL,\n value: this.readIdentifier()\n })\n } else {\n this.throwError('unexpected character ' + c)\n }\n }\n\n // end token\n this.tokens.push({ type: tokenType.EOF })\n\n return this.tokens\n}\n\nLexer.prototype.peek = function (nth) {\n nth = nth || 0\n if (this.index + nth >= this.text.length) {\n return\n }\n return this.text.charAt(this.index + nth)\n}\n\nLexer.prototype.consume = function () {\n var current = this.peek()\n this.index += 1\n return current\n}\n\nLexer.prototype.readNumber = function () {\n var number = ''\n\n if (this.peek() === '.') {\n number += this.consume()\n if (!isDigit(this.peek())) {\n this.throwError('number expected')\n }\n } else {\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n if (this.peek() === '.') {\n number += this.consume()\n }\n }\n\n // numbers after the decimal dot\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n\n // exponent if available\n if ((this.peek() === 'e' || this.peek() === 'E')) {\n number += this.consume()\n\n if (!(isDigit(this.peek()) ||\n this.peek() === '+' ||\n this.peek() === '-')) {\n this.throwError()\n }\n\n if (this.peek() === '+' || this.peek() === '-') {\n number += this.consume()\n }\n\n if (!isDigit(this.peek())) {\n this.throwError('number expected')\n }\n\n while (isDigit(this.peek())) {\n number += this.consume()\n }\n }\n return number\n}\n\nLexer.prototype.readIdentifier = function () {\n var text = ''\n while (isIdentifier(this.peek()) || isDigit(this.peek())) {\n text += this.consume()\n }\n return text\n}\n\nLexer.prototype.readString = function () {\n var quote = this.consume()\n var string = ''\n var escape\n while (true) {\n var c = this.consume()\n if (!c) {\n this.throwError('string is not closed')\n }\n if (escape) {\n if (c === 'u') {\n var hex = this.text.substring(this.index + 1, this.index + 5)\n if (!hex.match(/[\\da-f]{4}/i)) {\n this.throwError('invalid unicode escape')\n }\n this.index += 4\n string += String.fromCharCode(parseInt(hex, 16))\n } else {\n var replacement = ESCAPES[c]\n if (replacement) {\n string += replacement\n } else {\n string += c\n }\n }\n escape = false\n } else if (c === quote) {\n break\n } else if (c === '\\\\') {\n escape = true\n } else {\n string += c\n }\n }\n return string\n}\n\nmodule.exports = Lexer\n", "function Node () {\n\n}\n\nNode.prototype.type = 'Node'\n\nmodule.exports = Node\n", "var Node = require('./Node')\n\nvar SUPPORTED_TYPES = {\n number: true,\n string: true,\n 'boolean': true,\n 'undefined': true,\n 'null': true\n}\n\nfunction ConstantNode (value, type) {\n if (!SUPPORTED_TYPES[type]) {\n throw Error('unsupported type \\'' + type + '\\'')\n }\n this.value = value\n this.valueType = type\n}\n\nConstantNode.prototype = Object.create(Node.prototype)\n\nConstantNode.prototype.type = 'ConstantNode'\n\nmodule.exports = ConstantNode\n", "var Node = require('./Node')\n\nfunction OperatorNode (op, args) {\n this.op = op\n this.args = args || []\n}\n\nOperatorNode.prototype = Object.create(Node.prototype)\n\nOperatorNode.prototype.type = 'OperatorNode'\n\nmodule.exports = OperatorNode\n", "var Node = require('./Node')\n\nfunction UnaryNode (op, argument) {\n this.op = op\n this.argument = argument\n}\n\nUnaryNode.prototype = Object.create(Node.prototype)\n\nUnaryNode.prototype.type = 'UnaryNode'\n\nmodule.exports = UnaryNode\n", "var Node = require('./Node')\n\nfunction SymbolNode (name) {\n this.name = name\n}\n\nSymbolNode.prototype = Object.create(Node.prototype)\n\nSymbolNode.prototype.type = 'SymbolNode'\n\nmodule.exports = SymbolNode\n", "var Node = require('./Node')\n\nfunction FunctionNode (name, args) {\n this.name = name\n this.args = args\n}\n\nFunctionNode.prototype = Object.create(Node.prototype)\n\nFunctionNode.prototype.type = 'FunctionNode'\n\nmodule.exports = FunctionNode\n", "var Node = require('./Node')\n\nfunction ArrayNode (nodes) {\n this.nodes = nodes\n}\n\nArrayNode.prototype = Object.create(Node.prototype)\n\nArrayNode.prototype.type = 'ArrayNode'\n\nmodule.exports = ArrayNode\n", "var Node = require('./Node')\n\nfunction ConditionalNode (predicate, truthy, falsy) {\n this.condition = predicate\n this.trueExpr = truthy\n this.falseExpr = falsy\n}\n\nConditionalNode.prototype = Object.create(Node.prototype)\n\nConditionalNode.prototype.type = 'ConditionalNode'\n\nmodule.exports = ConditionalNode\n", "var Node = require('./Node')\n\nfunction AssignmentNode (name, expr) {\n this.name = name\n this.expr = expr\n}\n\nAssignmentNode.prototype = Object.create(Node.prototype)\n\nAssignmentNode.prototype.type = 'AssignmentNode'\n\nmodule.exports = AssignmentNode\n", "var Node = require('./Node')\n\nfunction BlockNode (blocks) {\n this.blocks = blocks\n}\n\nBlockNode.prototype = Object.create(Node.prototype)\n\nBlockNode.prototype.type = 'BlockNode'\n\nmodule.exports = BlockNode\n", "var tokenType = require('./token-type')\n\nvar Lexer = require('./Lexer')\nvar ConstantNode = require('./node/ConstantNode')\nvar OperatorNode = require('./node/OperatorNode')\nvar UnaryNode = require('./node/UnaryNode')\nvar SymbolNode = require('./node/SymbolNode')\nvar FunctionNode = require('./node/FunctionNode')\nvar ArrayNode = require('./node/ArrayNode')\nvar ConditionalNode = require('./node/ConditionalNode')\nvar AssignmentNode = require('./node/AssignmentNode')\nvar BlockNode = require('./node/BlockNode')\n\n/**\n * Grammar DSL:\n *\n * program : block (; block)*\n *\n * block : assignment\n *\n * assignment : ternary\n * | symbol `=` assignment\n *\n * ternary : logicalOR\n * | logicalOR `?` ternary `:` ternary\n *\n * logicalOR : logicalXOR\n * | logicalXOR (`||`,`or`) logicalOR\n *\n * logicalXOR : logicalAND\n * : logicalAND `xor` logicalXOR\n *\n * logicalAND : bitwiseOR\n * | bitwiseOR (`&&`,`and`) logicalAND\n *\n * bitwiseOR : bitwiseXOR\n * | bitwiseXOR `|` bitwiseOR\n *\n * bitwiseXOR : bitwiseAND\n * | bitwiseAND `^|` bitwiseXOR\n *\n * bitwiseAND : relational\n * | relational `&` bitwiseAND\n *\n * relational : shift\n * | shift (`!=` | `==` | `>` | '<' | '<=' |'>=') shift)\n *\n * shift : additive\n * | additive (`>>` | `<<` | `>>>`) shift\n *\n * additive : multiplicative\n * | multiplicative (`+` | `-`) additive\n *\n * multiplicative : unary\n * | unary (`*` | `/` | `%`) unary\n * | unary symbol\n *\n * unary : pow\n * | (`-` | `+` | `~`) unary\n *\n * pow : factorial\n * | factorial (`^`, '**') unary\n *\n * factorial : symbol\n * | symbol (`!`)\n *\n * symbol : symbolToken\n * | symbolToken functionCall\n * | string\n *\n * functionCall : `(` `)`\n * | `(` ternary (, ternary)* `)`\n *\n * string : `'` (character)* `'`\n * : `\"` (character)* `\"`\n * | array\n *\n * array : `[` `]`\n * | `[` assignment (, assignment)* `]`\n * | number\n *\n * number : number-token\n * | parentheses\n *\n * parentheses : `(` assignment `)`\n * : end\n *\n * end : NULL\n *\n * @param {[type]} lexer [description]\n */\nfunction Parser () {\n this.lexer = new Lexer()\n this.tokens = null\n}\n\nParser.prototype.current = function () {\n return this.tokens[0]\n}\n\nParser.prototype.next = function () {\n return this.tokens[1]\n}\n\nParser.prototype.peek = function () {\n if (this.tokens.length) {\n var first = this.tokens[0]\n for (var i = 0; i < arguments.length; i += 1) {\n if (first.value === arguments[i]) {\n return true\n }\n }\n }\n}\n\nParser.prototype.consume = function (e) {\n return this.tokens.shift()\n}\n\nParser.prototype.expect = function (e) {\n if (!this.peek(e)) {\n throw Error('expected ' + e)\n }\n return this.consume()\n}\n\nParser.prototype.isEOF = function () {\n return this.current().type === tokenType.EOF\n}\n\nParser.prototype.parse = function (text) {\n this.tokens = this.lexer.lex(text)\n return this.program()\n}\n\nParser.prototype.program = function () {\n var blocks = []\n while (!this.isEOF()) {\n blocks.push(this.assignment())\n if (this.peek(';')) {\n this.consume()\n }\n }\n this.end()\n return new BlockNode(blocks)\n}\n\nParser.prototype.assignment = function () {\n var left = this.ternary()\n if (left instanceof SymbolNode && this.peek('=')) {\n this.consume()\n return new AssignmentNode(left.name, this.assignment())\n }\n return left\n}\n\nParser.prototype.ternary = function () {\n var predicate = this.logicalOR()\n if (this.peek('?')) {\n this.consume()\n var truthy = this.ternary()\n this.expect(':')\n var falsy = this.ternary()\n return new ConditionalNode(predicate, truthy, falsy)\n }\n return predicate\n}\n\nParser.prototype.logicalOR = function () {\n var left = this.logicalXOR()\n if (this.peek('||')) {\n var op = this.consume()\n var right = this.logicalOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.logicalXOR = function () {\n var left = this.logicalAND()\n if (this.current().value === 'xor') {\n var op = this.consume()\n var right = this.logicalXOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.logicalAND = function () {\n var left = this.bitwiseOR()\n if (this.peek('&&')) {\n var op = this.consume()\n var right = this.logicalAND()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseOR = function () {\n var left = this.bitwiseXOR()\n if (this.peek('|')) {\n var op = this.consume()\n var right = this.bitwiseOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseXOR = function () {\n var left = this.bitwiseAND()\n if (this.peek('^|')) {\n var op = this.consume()\n var right = this.bitwiseXOR()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.bitwiseAND = function () {\n var left = this.relational()\n if (this.peek('&')) {\n var op = this.consume()\n var right = this.bitwiseAND()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.relational = function () {\n var left = this.shift()\n if (this.peek('==', '===', '!=', '!==', '>=', '<=', '>', '<')) {\n var op = this.consume()\n var right = this.shift()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.shift = function () {\n var left = this.additive()\n if (this.peek('>>', '<<', '>>>')) {\n var op = this.consume()\n var right = this.shift()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.additive = function () {\n var left = this.multiplicative()\n while (this.peek('+', '-')) {\n var op = this.consume()\n left = new OperatorNode(op.value, [left, this.multiplicative()])\n }\n return left\n}\n\nParser.prototype.multiplicative = function () {\n var op, right\n var left = this.unary()\n while (this.peek('*', '/', '%')) {\n op = this.consume()\n left = new OperatorNode(op.value, [left, this.unary()])\n }\n\n // implicit multiplication\n // - 2 x\n // - 2(x)\n // - (2)2\n if (this.current().type === tokenType.SYMBOL ||\n this.peek('(') ||\n (!(left.type instanceof ConstantNode) && this.current().type === tokenType.NUMBER)\n ) {\n right = this.multiplicative()\n return new OperatorNode('*', [left, right])\n }\n\n return left\n}\n\nParser.prototype.unary = function () {\n if (this.peek('-', '+', '~')) {\n var op = this.consume()\n var right = this.unary()\n return new UnaryNode(op.value, right)\n }\n return this.pow()\n}\n\nParser.prototype.pow = function () {\n var left = this.factorial()\n if (this.peek('^', '**')) {\n var op = this.consume()\n var right = this.unary()\n return new OperatorNode(op.value, [left, right])\n }\n return left\n}\n\nParser.prototype.factorial = function () {\n var left = this.symbol()\n if (this.peek('!')) {\n var op = this.consume()\n return new OperatorNode(op.value, [left])\n }\n return left\n}\n\nParser.prototype.symbol = function () {\n var current = this.current()\n if (current.type === tokenType.SYMBOL) {\n var symbol = this.consume()\n var node = this.functionCall(symbol)\n return node\n }\n return this.string()\n}\n\nParser.prototype.functionCall = function (symbolToken) {\n var name = symbolToken.value\n if (this.peek('(')) {\n this.consume()\n var params = []\n while (!this.peek(')') && !this.isEOF()) {\n params.push(this.assignment())\n if (this.peek(',')) {\n this.consume()\n }\n }\n this.expect(')')\n return new FunctionNode(name, params)\n }\n return new SymbolNode(name)\n}\n\nParser.prototype.string = function () {\n if (this.current().type === tokenType.STRING) {\n return new ConstantNode(this.consume().value, 'string')\n }\n return this.array()\n}\n\nParser.prototype.array = function () {\n if (this.peek('[')) {\n this.consume()\n var params = []\n while (!this.peek(']') && !this.isEOF()) {\n params.push(this.assignment())\n if (this.peek(',')) {\n this.consume()\n }\n }\n this.expect(']')\n return new ArrayNode(params)\n }\n return this.number()\n}\n\nParser.prototype.number = function () {\n var token = this.current()\n if (token.type === tokenType.NUMBER) {\n return new ConstantNode(this.consume().value, 'number')\n }\n return this.parentheses()\n}\n\nParser.prototype.parentheses = function () {\n var token = this.current()\n if (token.value === '(') {\n this.consume()\n var left = this.assignment()\n this.expect(')')\n return left\n }\n return this.end()\n}\n\nParser.prototype.end = function () {\n var token = this.current()\n if (token.type !== tokenType.EOF) {\n throw Error('unexpected end of expression')\n }\n}\n\nmodule.exports = Parser\n", "module.exports = {\n ArrayNode: require('./ArrayNode'),\n AssignmentNode: require('./AssignmentNode'),\n BlockNode: require('./BlockNode'),\n ConditionalNode: require('./ConditionalNode'),\n ConstantNode: require('./ConstantNode'),\n FunctionNode: require('./FunctionNode'),\n Node: require('./Node'),\n OperatorNode: require('./OperatorNode'),\n SymbolNode: require('./SymbolNode'),\n UnaryNode: require('./UnaryNode')\n}\n", "/*\n * mr-parser\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n\n'use strict'\n\nmodule.exports.Lexer = require('./lib/Lexer')\nmodule.exports.Parser = require('./lib/Parser')\nmodule.exports.nodeTypes = require('./lib/node/')\n", "'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n", "'use strict'\nmodule.exports = function (node) {\n var self = this\n var arr = []\n this.rawify(this.options.rawArrayExpressionElements, function () {\n arr = node.nodes.map(function (el) {\n return self.next(el)\n })\n })\n var arrString = '[' + arr.join(',') + ']'\n\n if (this.options.raw) {\n return arrString\n }\n return this.options.factory + '(' + arrString + ')'\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n return 'scope[\"' + node.name + '\"] = ' + this.next(node.expr)\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var condition = '!!(' + this.next(node.condition) + ')'\n var trueExpr = this.next(node.trueExpr)\n var falseExpr = this.next(node.falseExpr)\n return '(' + condition + ' ? (' + trueExpr + ') : (' + falseExpr + ') )'\n}\n", "'use strict'\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.value\n }\n return this.options.factory + '(' + node.value + ')'\n}\n", "'use strict'\nvar SymbolNode = require('mr-parser').nodeTypes.SymbolNode\n\nvar functionProxy = function (node) {\n return '$$mathCodegen.functionProxy(' + this.next(new SymbolNode(node.name)) + ', \"' + node.name + '\")'\n}\n\nmodule.exports = function (node) {\n var self = this\n // wrap in a helper function to detect the type of symbol it must be a function\n // NOTE: if successful the wrapper returns the function itself\n // NOTE: node.name should be a symbol so that it's correctly represented as a string in SymbolNode\n var method = functionProxy.call(this, node)\n var args = []\n this.rawify(this.options.rawCallExpressionElements, function () {\n args = node.args.map(function (arg) {\n return self.next(arg)\n })\n })\n return method + '(' + args.join(', ') + ')'\n}\n\nmodule.exports.functionProxy = functionProxy\n", "'use strict'\n\nmodule.exports = {\n // arithmetic\n '+': 'add',\n '-': 'sub',\n '*': 'mul',\n '/': 'div',\n '^': 'pow',\n '%': 'mod',\n '!': 'factorial',\n\n // misc operators\n '|': 'bitwiseOR', // bitwise or\n '^|': 'bitwiseXOR', // bitwise xor\n '&': 'bitwiseAND', // bitwise and\n\n '||': 'logicalOR', // logical or\n 'xor': 'logicalXOR', // logical xor\n '&&': 'logicalAND', // logical and\n\n // comparison\n '<': 'lessThan',\n '>': 'greaterThan',\n '<=': 'lessEqualThan',\n '>=': 'greaterEqualThan',\n '===': 'strictlyEqual',\n '==': 'equal',\n '!==': 'strictlyNotEqual',\n '!=': 'notEqual',\n\n // shift\n '>>': 'shiftRight',\n '<<': 'shiftLeft',\n '>>>': 'unsignedRightShift'\n}\n", "'use strict'\n\nvar Operators = require('../misc/Operators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return ['(' + this.next(node.args[0]), node.op, this.next(node.args[1]) + ')'].join(' ')\n }\n\n var namedOperator = Operators[node.op]\n\n if (!namedOperator) {\n throw TypeError('unidentified operator')\n }\n\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: node.args\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var id = node.name\n return '$$mathCodegen.getProperty(\"' + id + '\", scope, ns)'\n}\n", "'use strict'\n\nmodule.exports = {\n '+': 'positive',\n '-': 'negative',\n '~': 'oneComplement'\n}\n", "'use strict'\n\nvar UnaryOperators = require('../misc/UnaryOperators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.op + this.next(node.argument)\n }\n\n if (!(node.op in UnaryOperators)) {\n throw new SyntaxError(node.op + ' not implemented')\n }\n\n var namedOperator = UnaryOperators[node.op]\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: [node.argument]\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\nvar extend = require('extend')\n\nvar types = {\n ArrayNode: require('./node/ArrayNode'),\n AssignmentNode: require('./node/AssignmentNode'),\n ConditionalNode: require('./node/ConditionalNode'),\n ConstantNode: require('./node/ConstantNode'),\n FunctionNode: require('./node/FunctionNode'),\n OperatorNode: require('./node/OperatorNode'),\n SymbolNode: require('./node/SymbolNode'),\n UnaryNode: require('./node/UnaryNode')\n}\n\nvar Interpreter = function (owner, options) {\n this.owner = owner\n this.options = extend({\n factory: 'ns.factory',\n raw: false,\n rawArrayExpressionElements: true,\n rawCallExpressionElements: false\n }, options)\n}\n\nextend(Interpreter.prototype, types)\n\n// main method which decides which expression to call\nInterpreter.prototype.next = function (node) {\n if (!(node.type in this)) {\n throw new TypeError('the node type ' + node.type + ' is not implemented')\n }\n return this[node.type](node)\n}\n\nInterpreter.prototype.rawify = function (test, fn) {\n var oldRaw = this.options.raw\n if (test) {\n this.options.raw = true\n }\n fn()\n if (test) {\n this.options.raw = oldRaw\n }\n}\n\nmodule.exports = Interpreter\n", "'use strict'\n\nvar Parser = require('mr-parser').Parser\nvar Interpreter = require('./Interpreter')\nvar extend = require('extend')\n\nfunction CodeGenerator (options, defs) {\n this.statements = []\n this.defs = defs || {}\n this.interpreter = new Interpreter(this, options)\n}\n\nCodeGenerator.prototype.setDefs = function (defs) {\n this.defs = extend(this.defs, defs)\n return this\n}\n\nCodeGenerator.prototype.compile = function (namespace) {\n if (!namespace || !(typeof namespace === 'object' || typeof namespace === 'function')) {\n throw TypeError('namespace must be an object')\n }\n if (typeof namespace.factory !== 'function') {\n throw TypeError('namespace.factory must be a function')\n }\n\n // definitions available in the function\n // each property under this.defs is mapped to local variables\n // e.g\n //\n // function (defs) {\n // var ns = defs['ns']\n // // code generated for the expression\n // }\n this.defs.ns = namespace\n this.defs.$$mathCodegen = {\n getProperty: function (symbol, scope, ns) {\n if (symbol in scope) {\n return scope[symbol]\n }\n if (symbol in ns) {\n return ns[symbol]\n }\n throw SyntaxError('symbol \"' + symbol + '\" is undefined')\n },\n functionProxy: function (fn, name) {\n if (typeof fn !== 'function') {\n throw SyntaxError('symbol \"' + name + '\" must be a function')\n }\n return fn\n }\n }\n this.defs.$$processScope = this.defs.$$processScope || function () {}\n\n var defsCode = Object.keys(this.defs).map(function (name) {\n return 'var ' + name + ' = defs[\"' + name + '\"]'\n })\n\n // statement join\n if (!this.statements.length) {\n throw Error('there are no statements saved in this generator, make sure you parse an expression before compiling it')\n }\n\n // last statement is always a return statement\n this.statements[this.statements.length - 1] = 'return ' + this.statements[this.statements.length - 1]\n\n var code = this.statements.join(';')\n var factoryCode = defsCode.join('\\n') + '\\n' + [\n 'return {',\n ' eval: function (scope) {',\n ' scope = scope || {}',\n ' $$processScope(scope)',\n ' ' + code,\n ' },',\n \" code: '\" + code + \"'\",\n '}'\n ].join('\\n')\n\n /* eslint-disable */\n var factory = new Function('defs', factoryCode)\n return factory(this.defs)\n /* eslint-enable */\n}\n\nCodeGenerator.prototype.parse = function (code) {\n var self = this\n var program = new Parser().parse(code)\n this.statements = program.blocks.map(function (statement) {\n return self.interpreter.next(statement)\n })\n return this\n}\n\nmodule.exports = CodeGenerator\n", "/*\n * math-codegen\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/CodeGenerator')\n", "'use strict'\nmodule.exports = function () {\n var math = Object.create(Math)\n\n math.factory = function (a) {\n if (typeof a !== 'number') {\n throw new TypeError('built-in math factory only accepts numbers')\n }\n return Number(a)\n }\n\n math.add = function (a, b) {\n return a + b\n }\n math.sub = function (a, b) {\n return a - b\n }\n math.mul = function (a, b) {\n return a * b\n }\n math.div = function (a, b) {\n return a / b\n }\n math.mod = function (a, b) {\n return a % b\n }\n math.factorial = function (a) {\n var res = 1\n for (var i = 2; i <= a; i += 1) {\n res *= i\n }\n return res\n }\n\n // taken from https://github.com/josdejong/mathjs/blob/master/lib/function/arithmetic/nthRoot.js\n math.nthRoot = function (a, root) {\n var inv = root < 0\n if (inv) {\n root = -root\n }\n\n if (root === 0) {\n throw new Error('Root must be non-zero')\n }\n if (a < 0 && (Math.abs(root) % 2 !== 1)) {\n throw new Error('Root must be odd when a is negative.')\n }\n\n // edge cases zero and infinity\n if (a === 0) {\n return 0\n }\n if (!isFinite(a)) {\n return inv ? 0 : a\n }\n\n var x = Math.pow(Math.abs(a), 1 / root)\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a < 0 ? -x : x\n return inv ? 1 / x : x\n }\n\n // logical\n math.logicalOR = function (a, b) {\n return a || b\n }\n math.logicalXOR = function (a, b) {\n /* eslint-disable */\n return a != b\n /* eslint-enable*/\n }\n math.logicalAND = function (a, b) {\n return a && b\n }\n\n // bitwise\n math.bitwiseOR = function (a, b) {\n /* eslint-disable */\n return a | b\n /* eslint-enable*/\n }\n math.bitwiseXOR = function (a, b) {\n /* eslint-disable */\n return a ^ b\n /* eslint-enable*/\n }\n math.bitwiseAND = function (a, b) {\n /* eslint-disable */\n return a & b\n /* eslint-enable*/\n }\n\n // relational\n math.lessThan = function (a, b) {\n return a < b\n }\n math.lessEqualThan = function (a, b) {\n return a <= b\n }\n math.greaterThan = function (a, b) {\n return a > b\n }\n math.greaterEqualThan = function (a, b) {\n return a >= b\n }\n math.equal = function (a, b) {\n /* eslint-disable */\n return a == b\n /* eslint-enable*/\n }\n math.strictlyEqual = function (a, b) {\n return a === b\n }\n math.notEqual = function (a, b) {\n /* eslint-disable */\n return a != b\n /* eslint-enable*/\n }\n math.strictlyNotEqual = function (a, b) {\n return a !== b\n }\n\n // shift\n math.shiftRight = function (a, b) {\n return (a >> b)\n }\n math.shiftLeft = function (a, b) {\n return (a << b)\n }\n math.unsignedRightShift = function (a, b) {\n return (a >>> b)\n }\n\n // unary\n math.negative = function (a) {\n return -a\n }\n math.positive = function (a) {\n return a\n }\n\n return math\n}\n", "'use strict'\n\nvar CodeGenerator = require('math-codegen')\nvar math = require('./adapter')()\n\nfunction processScope (scope) {\n Object.keys(scope).forEach(function (k) {\n var value = scope[k]\n scope[k] = math.factory(value)\n })\n}\n\nmodule.exports = function (expression) {\n return new CodeGenerator()\n .setDefs({\n $$processScope: processScope\n })\n .parse(expression)\n .compile(math)\n}\n\nmodule.exports.math = math\n", "/*\n * built-in-math-eval\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n\n'use strict'\n\nmodule.exports = require('./lib/eval')\n", "'use strict'\nmodule.exports = function (node) {\n var self = this\n var arr = []\n this.rawify(this.options.rawArrayExpressionElements, function () {\n arr = node.nodes.map(function (el) {\n return self.next(el)\n })\n })\n var arrString = '[' + arr.join(',') + ']'\n\n if (this.options.raw) {\n return arrString\n }\n return this.options.factory + '(' + arrString + ')'\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n return 'scope[\"' + node.name + '\"] = ' + this.next(node.expr)\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var condition = '!!(' + this.next(node.condition) + ')'\n var trueExpr = this.next(node.trueExpr)\n var falseExpr = this.next(node.falseExpr)\n return '(' + condition + ' ? (' + trueExpr + ') : (' + falseExpr + ') )'\n}\n", "'use strict'\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.value\n }\n return this.options.factory + '(' + node.value + ')'\n}\n", "'use strict'\nvar SymbolNode = require('mr-parser').nodeTypes.SymbolNode\n\nvar functionProxy = function (node) {\n return '$$mathCodegen.functionProxy(' + this.next(new SymbolNode(node.name)) + ', \"' + node.name + '\")'\n}\n\nmodule.exports = function (node) {\n var self = this\n // wrap in a helper function to detect the type of symbol it must be a function\n // NOTE: if successful the wrapper returns the function itself\n // NOTE: node.name should be a symbol so that it's correctly represented as a string in SymbolNode\n var method = functionProxy.call(this, node)\n var args = []\n this.rawify(this.options.rawCallExpressionElements, function () {\n args = node.args.map(function (arg) {\n return self.next(arg)\n })\n })\n return method + '(' + args.join(', ') + ')'\n}\n\nmodule.exports.functionProxy = functionProxy\n", "'use strict'\n\nmodule.exports = {\n // arithmetic\n '+': 'add',\n '-': 'sub',\n '*': 'mul',\n '/': 'div',\n '^': 'pow',\n '%': 'mod',\n '!': 'factorial',\n\n // misc operators\n '|': 'bitwiseOR', // bitwise or\n '^|': 'bitwiseXOR', // bitwise xor\n '&': 'bitwiseAND', // bitwise and\n\n '||': 'logicalOR', // logical or\n 'xor': 'logicalXOR', // logical xor\n '&&': 'logicalAND', // logical and\n\n // comparison\n '<': 'lessThan',\n '>': 'greaterThan',\n '<=': 'lessEqualThan',\n '>=': 'greaterEqualThan',\n '===': 'strictlyEqual',\n '==': 'equal',\n '!==': 'strictlyNotEqual',\n '!=': 'notEqual',\n\n // shift\n '>>': 'shiftRight',\n '<<': 'shiftLeft',\n '>>>': 'unsignedRightShift'\n}\n", "'use strict'\n\nvar Operators = require('../misc/Operators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return ['(' + this.next(node.args[0]), node.op, this.next(node.args[1]) + ')'].join(' ')\n }\n\n var namedOperator = Operators[node.op]\n\n if (!namedOperator) {\n throw TypeError('unidentified operator')\n }\n\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: node.args\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\n\nmodule.exports = function (node) {\n var id = node.name\n return '$$mathCodegen.getProperty(\"' + id + '\", scope, ns)'\n}\n", "'use strict'\n\nmodule.exports = {\n '+': 'positive',\n '-': 'negative',\n '~': 'oneComplement'\n}\n", "'use strict'\n\nvar UnaryOperators = require('../misc/UnaryOperators')\n\nmodule.exports = function (node) {\n if (this.options.raw) {\n return node.op + this.next(node.argument)\n }\n\n if (!(node.op in UnaryOperators)) {\n throw new SyntaxError(node.op + ' not implemented')\n }\n\n var namedOperator = UnaryOperators[node.op]\n /* eslint-disable new-cap */\n return this.FunctionNode({\n name: namedOperator,\n args: [node.argument]\n })\n /* eslint-enable new-cap */\n}\n", "'use strict'\nvar extend = require('extend')\n\nvar types = {\n ArrayNode: require('./node/ArrayNode'),\n AssignmentNode: require('./node/AssignmentNode'),\n ConditionalNode: require('./node/ConditionalNode'),\n ConstantNode: require('./node/ConstantNode'),\n FunctionNode: require('./node/FunctionNode'),\n OperatorNode: require('./node/OperatorNode'),\n SymbolNode: require('./node/SymbolNode'),\n UnaryNode: require('./node/UnaryNode')\n}\n\nvar Interpreter = function (owner, options) {\n this.owner = owner\n this.options = extend({\n factory: 'ns.factory',\n raw: false,\n rawArrayExpressionElements: true,\n rawCallExpressionElements: false,\n applyFactoryToScope: false\n }, options)\n}\n\nextend(Interpreter.prototype, types)\n\n// main method which decides which expression to call\nInterpreter.prototype.next = function (node) {\n if (!(node.type in this)) {\n throw new TypeError('the node type ' + node.type + ' is not implemented')\n }\n return this[node.type](node)\n}\n\nInterpreter.prototype.rawify = function (test, fn) {\n var oldRaw = this.options.raw\n if (test) {\n this.options.raw = true\n }\n fn()\n if (test) {\n this.options.raw = oldRaw\n }\n}\n\nmodule.exports = Interpreter\n", "'use strict'\n\nvar Parser = require('mr-parser').Parser\nvar Interpreter = require('./Interpreter')\nvar extend = require('extend')\n\nfunction CodeGenerator (options, defs) {\n this.statements = []\n this.defs = defs || {}\n this.interpreter = new Interpreter(this, options)\n}\n\nCodeGenerator.prototype.setDefs = function (defs) {\n this.defs = extend(this.defs, defs)\n return this\n}\n\nCodeGenerator.prototype.compile = function (namespace) {\n var self = this\n if (!namespace || !(typeof namespace === 'object' || typeof namespace === 'function')) {\n throw TypeError('namespace must be an object')\n }\n if (typeof namespace.factory !== 'function') {\n throw TypeError('namespace.factory must be a function')\n }\n\n // definitions available in the function\n // each property under this.defs is mapped to local variables\n // e.g\n //\n // function (defs) {\n // var ns = defs['ns']\n // // code generated for the expression\n // }\n this.defs.ns = namespace\n this.defs.$$mathCodegen = {\n getProperty: function (symbol, scope, ns) {\n function applyFactoryIfNeeded (value) {\n if (self.interpreter.options.applyFactoryToScope && typeof value !== 'function') {\n return ns.factory(value)\n }\n return value\n }\n\n if (symbol in scope) {\n return applyFactoryIfNeeded(scope[symbol])\n }\n if (symbol in ns) {\n return applyFactoryIfNeeded(ns[symbol])\n }\n throw SyntaxError('symbol \"' + symbol + '\" is undefined')\n },\n functionProxy: function (fn, name) {\n if (typeof fn !== 'function') {\n throw SyntaxError('symbol \"' + name + '\" must be a function')\n }\n return fn\n }\n }\n this.defs.$$processScope = this.defs.$$processScope || function () {}\n\n var defsCode = Object.keys(this.defs).map(function (name) {\n return 'var ' + name + ' = defs[\"' + name + '\"]'\n })\n\n // statement join\n if (!this.statements.length) {\n throw Error('there are no statements saved in this generator, make sure you parse an expression before compiling it')\n }\n\n // last statement is always a return statement\n this.statements[this.statements.length - 1] = 'return ' + this.statements[this.statements.length - 1]\n\n var code = this.statements.join(';')\n var factoryCode = defsCode.join('\\n') + '\\n' + [\n 'return {',\n ' eval: function (scope) {',\n ' scope = scope || {}',\n ' $$processScope(scope)',\n ' ' + code,\n ' },',\n \" code: '\" + code + \"'\",\n '}'\n ].join('\\n')\n\n /* eslint-disable */\n var factory = new Function('defs', factoryCode)\n return factory(this.defs)\n /* eslint-enable */\n}\n\nCodeGenerator.prototype.parse = function (code) {\n var self = this\n var program = new Parser().parse(code)\n this.statements = program.blocks.map(function (statement) {\n return self.interpreter.next(statement)\n })\n return this\n}\n\nmodule.exports = CodeGenerator\n", "/*\n * math-codegen\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/CodeGenerator')\n", null, "var hasTypedArrays = false\nif(typeof Float64Array !== \"undefined\") {\n var DOUBLE_VIEW = new Float64Array(1)\n , UINT_VIEW = new Uint32Array(DOUBLE_VIEW.buffer)\n DOUBLE_VIEW[0] = 1.0\n hasTypedArrays = true\n if(UINT_VIEW[1] === 0x3ff00000) {\n //Use little endian\n module.exports = function doubleBitsLE(n) {\n DOUBLE_VIEW[0] = n\n return [ UINT_VIEW[0], UINT_VIEW[1] ]\n }\n function toDoubleLE(lo, hi) {\n UINT_VIEW[0] = lo\n UINT_VIEW[1] = hi\n return DOUBLE_VIEW[0]\n }\n module.exports.pack = toDoubleLE\n function lowUintLE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[0]\n }\n module.exports.lo = lowUintLE\n function highUintLE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[1]\n }\n module.exports.hi = highUintLE\n } else if(UINT_VIEW[0] === 0x3ff00000) {\n //Use big endian\n module.exports = function doubleBitsBE(n) {\n DOUBLE_VIEW[0] = n\n return [ UINT_VIEW[1], UINT_VIEW[0] ]\n }\n function toDoubleBE(lo, hi) {\n UINT_VIEW[1] = lo\n UINT_VIEW[0] = hi\n return DOUBLE_VIEW[0]\n }\n module.exports.pack = toDoubleBE\n function lowUintBE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[1]\n }\n module.exports.lo = lowUintBE\n function highUintBE(n) {\n DOUBLE_VIEW[0] = n\n return UINT_VIEW[0]\n }\n module.exports.hi = highUintBE\n } else {\n hasTypedArrays = false\n }\n}\nif(!hasTypedArrays) {\n var buffer = new Buffer(8)\n module.exports = function doubleBits(n) {\n buffer.writeDoubleLE(n, 0, true)\n return [ buffer.readUInt32LE(0, true), buffer.readUInt32LE(4, true) ]\n }\n function toDouble(lo, hi) {\n buffer.writeUInt32LE(lo, 0, true)\n buffer.writeUInt32LE(hi, 4, true)\n return buffer.readDoubleLE(0, true)\n }\n module.exports.pack = toDouble \n function lowUint(n) {\n buffer.writeDoubleLE(n, 0, true)\n return buffer.readUInt32LE(0, true)\n }\n module.exports.lo = lowUint\n function highUint(n) {\n buffer.writeDoubleLE(n, 0, true)\n return buffer.readUInt32LE(4, true)\n }\n module.exports.hi = highUint\n}\n\nmodule.exports.sign = function(n) {\n return module.exports.hi(n) >>> 31\n}\n\nmodule.exports.exponent = function(n) {\n var b = module.exports.hi(n)\n return ((b<<1) >>> 21) - 1023\n}\n\nmodule.exports.fraction = function(n) {\n var lo = module.exports.lo(n)\n var hi = module.exports.hi(n)\n var b = hi & ((1<<20) - 1)\n if(hi & 0x7ff00000) {\n b += (1<<20)\n }\n return [lo, b]\n}\n\nmodule.exports.denormalized = function(n) {\n var hi = module.exports.hi(n)\n return !(hi & 0x7ff00000)\n}", "\"use strict\"\n\nvar doubleBits = require(\"double-bits\")\n\nvar SMALLEST_DENORM = Math.pow(2, -1074)\nvar UINT_MAX = (-1)>>>0\n\nmodule.exports = nextafter\n\nfunction nextafter(x, y) {\n if(isNaN(x) || isNaN(y)) {\n return NaN\n }\n if(x === y) {\n return x\n }\n if(x === 0) {\n if(y < 0) {\n return -SMALLEST_DENORM\n } else {\n return SMALLEST_DENORM\n }\n }\n var hi = doubleBits.hi(x)\n var lo = doubleBits.lo(x)\n if((y > x) === (x > 0)) {\n if(lo === UINT_MAX) {\n hi += 1\n lo = 0\n } else {\n lo += 1\n }\n } else {\n if(lo === 0) {\n lo = UINT_MAX\n hi -= 1\n } else {\n lo -= 1\n }\n }\n return doubleBits.pack(lo, hi)\n}", null, null, null, null, null, null, null, null, null, null, "'use strict'\nmodule.exports = function (ns) {\n // mod\n ns.mod = ns.fmod\n\n // relational\n ns.lessThan = ns.lt\n ns.lessEqualThan = ns.leq\n ns.greaterThan = ns.gt\n ns.greaterEqualThan = ns.geq\n\n ns.strictlyEqual = ns.equal\n ns.strictlyNotEqual = ns.notEqual\n\n ns.logicalAND = function (a, b) {\n return a && b\n }\n ns.logicalXOR = function (a, b) {\n return a ^ b\n }\n ns.logicalOR = function (a, b) {\n return a || b\n }\n}\n", "/**\n * Created by mauricio on 5/12/15.\n */\n'use strict'\nmodule.exports = function (Interval) {\n return {\n disableRounding: function () {\n Interval.round.disable()\n },\n\n enableRounding: function () {\n Interval.round.enable()\n }\n }\n}\n", "/**\n * Created by mauricio on 5/12/15.\n */\n'use strict'\n\nconst CodeGenerator = require('math-codegen')\nconst Interval = require('interval-arithmetic').default\nrequire('./adapter')(Interval)\n\nfunction processScope (scope) {\n Object.keys(scope).forEach(function (k) {\n const value = scope[k]\n if (typeof value === 'number' || Array.isArray(value)) {\n scope[k] = Interval.factory(value)\n } else if (typeof value === 'object' && 'lo' in value && 'hi' in value) {\n scope[k] = Interval.factory(value.lo, value.hi)\n }\n })\n}\n\nmodule.exports = function (expression) {\n return new CodeGenerator()\n .setDefs({\n $$processScope: processScope\n })\n .parse(expression)\n .compile(Interval)\n}\n\nmodule.exports.policies = require('./policies')(Interval)\nmodule.exports.Interval = Interval\n", "/*\n * interval-arithmetic-eval\n *\n * Copyright (c) 2015 Mauricio Poppe\n * Licensed under the MIT license.\n */\n'use strict'\nmodule.exports = require('./lib/eval')\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map", null, ";(function(root, factory) { // eslint-disable-line no-extra-semi\n var deepDiff = factory(root);\n // eslint-disable-next-line no-undef\n if (typeof define === 'function' && define.amd) {\n // AMD\n define('DeepDiff', function() { // eslint-disable-line no-undef\n return deepDiff;\n });\n } else if (typeof exports === 'object' || typeof navigator === 'object' && navigator.product.match(/ReactNative/i)) {\n // Node.js or ReactNative\n module.exports = deepDiff;\n } else {\n // Browser globals\n var _deepdiff = root.DeepDiff;\n deepDiff.noConflict = function() {\n if (root.DeepDiff === deepDiff) {\n root.DeepDiff = _deepdiff;\n }\n return deepDiff;\n };\n root.DeepDiff = deepDiff;\n }\n}(this, function(root) {\n var validKinds = ['N', 'E', 'A', 'D'];\n\n // nodejs compatible on server side and in the browser.\n function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n }\n\n function Diff(kind, path) {\n Object.defineProperty(this, 'kind', {\n value: kind,\n enumerable: true\n });\n if (path && path.length) {\n Object.defineProperty(this, 'path', {\n value: path,\n enumerable: true\n });\n }\n }\n\n function DiffEdit(path, origin, value) {\n DiffEdit.super_.call(this, 'E', path);\n Object.defineProperty(this, 'lhs', {\n value: origin,\n enumerable: true\n });\n Object.defineProperty(this, 'rhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffEdit, Diff);\n\n function DiffNew(path, value) {\n DiffNew.super_.call(this, 'N', path);\n Object.defineProperty(this, 'rhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffNew, Diff);\n\n function DiffDeleted(path, value) {\n DiffDeleted.super_.call(this, 'D', path);\n Object.defineProperty(this, 'lhs', {\n value: value,\n enumerable: true\n });\n }\n inherits(DiffDeleted, Diff);\n\n function DiffArray(path, index, item) {\n DiffArray.super_.call(this, 'A', path);\n Object.defineProperty(this, 'index', {\n value: index,\n enumerable: true\n });\n Object.defineProperty(this, 'item', {\n value: item,\n enumerable: true\n });\n }\n inherits(DiffArray, Diff);\n\n function arrayRemove(arr, from, to) {\n var rest = arr.slice((to || from) + 1 || arr.length);\n arr.length = from < 0 ? arr.length + from : from;\n arr.push.apply(arr, rest);\n return arr;\n }\n\n function realTypeOf(subject) {\n var type = typeof subject;\n if (type !== 'object') {\n return type;\n }\n\n if (subject === Math) {\n return 'math';\n } else if (subject === null) {\n return 'null';\n } else if (Array.isArray(subject)) {\n return 'array';\n } else if (Object.prototype.toString.call(subject) === '[object Date]') {\n return 'date';\n } else if (typeof subject.toString === 'function' && /^\\/.*\\//.test(subject.toString())) {\n return 'regexp';\n }\n return 'object';\n }\n\n // http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n function hashThisString(string) {\n var hash = 0;\n if (string.length === 0) { return hash; }\n for (var i = 0; i < string.length; i++) {\n var char = string.charCodeAt(i);\n hash = ((hash << 5) - hash) + char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return hash;\n }\n\n // Gets a hash of the given object in an array order-independent fashion\n // also object key order independent (easier since they can be alphabetized)\n function getOrderIndependentHash(object) {\n var accum = 0;\n var type = realTypeOf(object);\n\n if (type === 'array') {\n object.forEach(function (item) {\n // Addition is commutative so this is order indep\n accum += getOrderIndependentHash(item);\n });\n\n var arrayString = '[type: array, hash: ' + accum + ']';\n return accum + hashThisString(arrayString);\n }\n\n if (type === 'object') {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n var keyValueString = '[ type: object, key: ' + key + ', value hash: ' + getOrderIndependentHash(object[key]) + ']';\n accum += hashThisString(keyValueString);\n }\n }\n\n return accum;\n }\n\n // Non object, non array...should be good?\n var stringToHash = '[ type: ' + type + ' ; value: ' + object + ']';\n return accum + hashThisString(stringToHash);\n }\n\n function deepDiff(lhs, rhs, changes, prefilter, path, key, stack, orderIndependent) {\n changes = changes || [];\n path = path || [];\n stack = stack || [];\n var currentPath = path.slice(0);\n if (typeof key !== 'undefined' && key !== null) {\n if (prefilter) {\n if (typeof (prefilter) === 'function' && prefilter(currentPath, key)) {\n return;\n } else if (typeof (prefilter) === 'object') {\n if (prefilter.prefilter && prefilter.prefilter(currentPath, key)) {\n return;\n }\n if (prefilter.normalize) {\n var alt = prefilter.normalize(currentPath, key, lhs, rhs);\n if (alt) {\n lhs = alt[0];\n rhs = alt[1];\n }\n }\n }\n }\n currentPath.push(key);\n }\n\n // Use string comparison for regexes\n if (realTypeOf(lhs) === 'regexp' && realTypeOf(rhs) === 'regexp') {\n lhs = lhs.toString();\n rhs = rhs.toString();\n }\n\n var ltype = typeof lhs;\n var rtype = typeof rhs;\n var i, j, k, other;\n\n var ldefined = ltype !== 'undefined' ||\n (stack && (stack.length > 0) && stack[stack.length - 1].lhs &&\n Object.getOwnPropertyDescriptor(stack[stack.length - 1].lhs, key));\n var rdefined = rtype !== 'undefined' ||\n (stack && (stack.length > 0) && stack[stack.length - 1].rhs &&\n Object.getOwnPropertyDescriptor(stack[stack.length - 1].rhs, key));\n\n if (!ldefined && rdefined) {\n changes.push(new DiffNew(currentPath, rhs));\n } else if (!rdefined && ldefined) {\n changes.push(new DiffDeleted(currentPath, lhs));\n } else if (realTypeOf(lhs) !== realTypeOf(rhs)) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n } else if (realTypeOf(lhs) === 'date' && (lhs - rhs) !== 0) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n } else if (ltype === 'object' && lhs !== null && rhs !== null) {\n for (i = stack.length - 1; i > -1; --i) {\n if (stack[i].lhs === lhs) {\n other = true;\n break;\n }\n }\n if (!other) {\n stack.push({ lhs: lhs, rhs: rhs });\n if (Array.isArray(lhs)) {\n // If order doesn't matter, we need to sort our arrays\n if (orderIndependent) {\n lhs.sort(function (a, b) {\n return getOrderIndependentHash(a) - getOrderIndependentHash(b);\n });\n\n rhs.sort(function (a, b) {\n return getOrderIndependentHash(a) - getOrderIndependentHash(b);\n });\n }\n i = rhs.length - 1;\n j = lhs.length - 1;\n while (i > j) {\n changes.push(new DiffArray(currentPath, i, new DiffNew(undefined, rhs[i--])));\n }\n while (j > i) {\n changes.push(new DiffArray(currentPath, j, new DiffDeleted(undefined, lhs[j--])));\n }\n for (; i >= 0; --i) {\n deepDiff(lhs[i], rhs[i], changes, prefilter, currentPath, i, stack, orderIndependent);\n }\n } else {\n var akeys = Object.keys(lhs);\n var pkeys = Object.keys(rhs);\n for (i = 0; i < akeys.length; ++i) {\n k = akeys[i];\n other = pkeys.indexOf(k);\n if (other >= 0) {\n deepDiff(lhs[k], rhs[k], changes, prefilter, currentPath, k, stack, orderIndependent);\n pkeys[other] = null;\n } else {\n deepDiff(lhs[k], undefined, changes, prefilter, currentPath, k, stack, orderIndependent);\n }\n }\n for (i = 0; i < pkeys.length; ++i) {\n k = pkeys[i];\n if (k) {\n deepDiff(undefined, rhs[k], changes, prefilter, currentPath, k, stack, orderIndependent);\n }\n }\n }\n stack.length = stack.length - 1;\n } else if (lhs !== rhs) {\n // lhs is contains a cycle at this element and it differs from rhs\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n }\n } else if (lhs !== rhs) {\n if (!(ltype === 'number' && isNaN(lhs) && isNaN(rhs))) {\n changes.push(new DiffEdit(currentPath, lhs, rhs));\n }\n }\n }\n\n function observableDiff(lhs, rhs, observer, prefilter, orderIndependent) {\n var changes = [];\n deepDiff(lhs, rhs, changes, prefilter, null, null, null, orderIndependent);\n if (observer) {\n for (var i = 0; i < changes.length; ++i) {\n observer(changes[i]);\n }\n }\n return changes;\n }\n\n function orderIndependentDeepDiff(lhs, rhs, changes, prefilter, path, key, stack) {\n return deepDiff(lhs, rhs, changes, prefilter, path, key, stack, true);\n }\n\n function accumulateDiff(lhs, rhs, prefilter, accum) {\n var observer = (accum) ?\n function (difference) {\n if (difference) {\n accum.push(difference);\n }\n } : undefined;\n var changes = observableDiff(lhs, rhs, observer, prefilter);\n return (accum) ? accum : (changes.length) ? changes : undefined;\n }\n\n function accumulateOrderIndependentDiff(lhs, rhs, prefilter, accum) {\n var observer = (accum) ?\n function (difference) {\n if (difference) {\n accum.push(difference);\n }\n } : undefined;\n var changes = observableDiff(lhs, rhs, observer, prefilter, true);\n return (accum) ? accum : (changes.length) ? changes : undefined;\n }\n\n function applyArrayChange(arr, index, change) {\n if (change.path && change.path.length) {\n var it = arr[index],\n i, u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n applyArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n delete it[change.path[i]];\n break;\n case 'E':\n case 'N':\n it[change.path[i]] = change.rhs;\n break;\n }\n } else {\n switch (change.kind) {\n case 'A':\n applyArrayChange(arr[index], change.index, change.item);\n break;\n case 'D':\n arr = arrayRemove(arr, index);\n break;\n case 'E':\n case 'N':\n arr[index] = change.rhs;\n break;\n }\n }\n return arr;\n }\n\n function applyChange(target, source, change) {\n if (typeof change === 'undefined' && source && ~validKinds.indexOf(source.kind)) {\n change = source;\n }\n if (target && change && change.kind) {\n var it = target,\n i = -1,\n last = change.path ? change.path.length - 1 : 0;\n while (++i < last) {\n if (typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = (typeof change.path[i + 1] !== 'undefined' && typeof change.path[i + 1] === 'number') ? [] : {};\n }\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n if (change.path && typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = [];\n }\n applyArrayChange(change.path ? it[change.path[i]] : it, change.index, change.item);\n break;\n case 'D':\n delete it[change.path[i]];\n break;\n case 'E':\n case 'N':\n it[change.path[i]] = change.rhs;\n break;\n }\n }\n }\n\n function revertArrayChange(arr, index, change) {\n if (change.path && change.path.length) {\n // the structure of the object at the index has changed...\n var it = arr[index],\n i, u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n revertArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n it[change.path[i]] = change.lhs;\n break;\n case 'E':\n it[change.path[i]] = change.lhs;\n break;\n case 'N':\n delete it[change.path[i]];\n break;\n }\n } else {\n // the array item is different...\n switch (change.kind) {\n case 'A':\n revertArrayChange(arr[index], change.index, change.item);\n break;\n case 'D':\n arr[index] = change.lhs;\n break;\n case 'E':\n arr[index] = change.lhs;\n break;\n case 'N':\n arr = arrayRemove(arr, index);\n break;\n }\n }\n return arr;\n }\n\n function revertChange(target, source, change) {\n if (target && source && change && change.kind) {\n var it = target,\n i, u;\n u = change.path.length - 1;\n for (i = 0; i < u; i++) {\n if (typeof it[change.path[i]] === 'undefined') {\n it[change.path[i]] = {};\n }\n it = it[change.path[i]];\n }\n switch (change.kind) {\n case 'A':\n // Array was modified...\n // it will be an array...\n revertArrayChange(it[change.path[i]], change.index, change.item);\n break;\n case 'D':\n // Item was deleted...\n it[change.path[i]] = change.lhs;\n break;\n case 'E':\n // Item was edited...\n it[change.path[i]] = change.lhs;\n break;\n case 'N':\n // Item is new...\n delete it[change.path[i]];\n break;\n }\n }\n }\n\n function applyDiff(target, source, filter) {\n if (target && source) {\n var onChange = function (change) {\n if (!filter || filter(target, source, change)) {\n applyChange(target, source, change);\n }\n };\n observableDiff(target, source, onChange);\n }\n }\n\n Object.defineProperties(accumulateDiff, {\n\n diff: {\n value: accumulateDiff,\n enumerable: true\n },\n orderIndependentDiff: {\n value: accumulateOrderIndependentDiff,\n enumerable: true\n },\n observableDiff: {\n value: observableDiff,\n enumerable: true\n },\n orderIndependentObservableDiff: {\n value: orderIndependentDeepDiff,\n enumerable: true\n },\n orderIndepHash: {\n value: getOrderIndependentHash,\n enumerable: true\n },\n applyDiff: {\n value: applyDiff,\n enumerable: true\n },\n applyChange: {\n value: applyChange,\n enumerable: true\n },\n revertChange: {\n value: revertChange,\n enumerable: true\n },\n isConflict: {\n value: function () {\n return typeof $conflict !== 'undefined';\n },\n enumerable: true\n }\n });\n\n // hackish...\n accumulateDiff.DeepDiff = accumulateDiff;\n // ...but works with:\n // import DeepDiff from 'deep-diff'\n // import { DeepDiff } from 'deep-diff'\n // const DeepDiff = require('deep-diff');\n // const { DeepDiff } = require('deep-diff');\n\n if (root) {\n root.DeepDiff = accumulateDiff;\n }\n\n return accumulateDiff;\n}));\n", "/*global define:false */\n/**\n * Copyright 2012-2017 Craig Campbell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Mousetrap is a simple keyboard shortcut library for Javascript with\n * no external dependencies\n *\n * @version 1.6.5\n * @url craig.is/killing/mice\n */\n(function(window, document, undefined) {\n\n // Check if mousetrap is used inside browser, if not, return\n if (!window) {\n return;\n }\n\n /**\n * mapping of special keycodes to their corresponding keys\n *\n * everything in this dictionary cannot use keypress events\n * so it has to be here to map to the correct keycodes for\n * keyup/keydown events\n *\n * @type {Object}\n */\n var _MAP = {\n 8: 'backspace',\n 9: 'tab',\n 13: 'enter',\n 16: 'shift',\n 17: 'ctrl',\n 18: 'alt',\n 20: 'capslock',\n 27: 'esc',\n 32: 'space',\n 33: 'pageup',\n 34: 'pagedown',\n 35: 'end',\n 36: 'home',\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down',\n 45: 'ins',\n 46: 'del',\n 91: 'meta',\n 93: 'meta',\n 224: 'meta'\n };\n\n /**\n * mapping for special characters so they can support\n *\n * this dictionary is only used incase you want to bind a\n * keyup or keydown event to one of these keys\n *\n * @type {Object}\n */\n var _KEYCODE_MAP = {\n 106: '*',\n 107: '+',\n 109: '-',\n 110: '.',\n 111 : '/',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-',\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: '\\''\n };\n\n /**\n * this is a mapping of keys that require shift on a US keypad\n * back to the non shift equivelents\n *\n * this is so you can use keyup events with these keys\n *\n * note that this will only work reliably on US keyboards\n *\n * @type {Object}\n */\n var _SHIFT_MAP = {\n '~': '`',\n '!': '1',\n '@': '2',\n '#': '3',\n '$': '4',\n '%': '5',\n '^': '6',\n '&': '7',\n '*': '8',\n '(': '9',\n ')': '0',\n '_': '-',\n '+': '=',\n ':': ';',\n '\\\"': '\\'',\n '<': ',',\n '>': '.',\n '?': '/',\n '|': '\\\\'\n };\n\n /**\n * this is a list of special strings you can use to map\n * to modifier keys when you specify your keyboard shortcuts\n *\n * @type {Object}\n */\n var _SPECIAL_ALIASES = {\n 'option': 'alt',\n 'command': 'meta',\n 'return': 'enter',\n 'escape': 'esc',\n 'plus': '+',\n 'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'\n };\n\n /**\n * variable to store the flipped version of _MAP from above\n * needed to check if we should use keypress or not when no action\n * is specified\n *\n * @type {Object|undefined}\n */\n var _REVERSE_MAP;\n\n /**\n * loop through the f keys, f1 to f19 and add them to the map\n * programatically\n */\n for (var i = 1; i < 20; ++i) {\n _MAP[111 + i] = 'f' + i;\n }\n\n /**\n * loop through to map numbers on the numeric keypad\n */\n for (i = 0; i <= 9; ++i) {\n\n // This needs to use a string cause otherwise since 0 is falsey\n // mousetrap will never fire for numpad 0 pressed as part of a keydown\n // event.\n //\n // @see https://github.com/ccampbell/mousetrap/pull/258\n _MAP[i + 96] = i.toString();\n }\n\n /**\n * cross browser add event method\n *\n * @param {Element|HTMLDocument} object\n * @param {string} type\n * @param {Function} callback\n * @returns void\n */\n function _addEvent(object, type, callback) {\n if (object.addEventListener) {\n object.addEventListener(type, callback, false);\n return;\n }\n\n object.attachEvent('on' + type, callback);\n }\n\n /**\n * takes the event and returns the key character\n *\n * @param {Event} e\n * @return {string}\n */\n function _characterFromEvent(e) {\n\n // for keypress events we should return the character as is\n if (e.type == 'keypress') {\n var character = String.fromCharCode(e.which);\n\n // if the shift key is not pressed then it is safe to assume\n // that we want the character to be lowercase. this means if\n // you accidentally have caps lock on then your key bindings\n // will continue to work\n //\n // the only side effect that might not be desired is if you\n // bind something like 'A' cause you want to trigger an\n // event when capital A is pressed caps lock will no longer\n // trigger the event. shift+a will though.\n if (!e.shiftKey) {\n character = character.toLowerCase();\n }\n\n return character;\n }\n\n // for non keypress events the special maps are needed\n if (_MAP[e.which]) {\n return _MAP[e.which];\n }\n\n if (_KEYCODE_MAP[e.which]) {\n return _KEYCODE_MAP[e.which];\n }\n\n // if it is not in the special map\n\n // with keydown and keyup events the character seems to always\n // come in as an uppercase character whether you are pressing shift\n // or not. we should make sure it is always lowercase for comparisons\n return String.fromCharCode(e.which).toLowerCase();\n }\n\n /**\n * checks if two arrays are equal\n *\n * @param {Array} modifiers1\n * @param {Array} modifiers2\n * @returns {boolean}\n */\n function _modifiersMatch(modifiers1, modifiers2) {\n return modifiers1.sort().join(',') === modifiers2.sort().join(',');\n }\n\n /**\n * takes a key event and figures out what the modifiers are\n *\n * @param {Event} e\n * @returns {Array}\n */\n function _eventModifiers(e) {\n var modifiers = [];\n\n if (e.shiftKey) {\n modifiers.push('shift');\n }\n\n if (e.altKey) {\n modifiers.push('alt');\n }\n\n if (e.ctrlKey) {\n modifiers.push('ctrl');\n }\n\n if (e.metaKey) {\n modifiers.push('meta');\n }\n\n return modifiers;\n }\n\n /**\n * prevents default for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _preventDefault(e) {\n if (e.preventDefault) {\n e.preventDefault();\n return;\n }\n\n e.returnValue = false;\n }\n\n /**\n * stops propogation for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _stopPropagation(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n return;\n }\n\n e.cancelBubble = true;\n }\n\n /**\n * determines if the keycode specified is a modifier key or not\n *\n * @param {string} key\n * @returns {boolean}\n */\n function _isModifier(key) {\n return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';\n }\n\n /**\n * reverses the map lookup so that we can look for specific keys\n * to see what can and can't use keypress\n *\n * @return {Object}\n */\n function _getReverseMap() {\n if (!_REVERSE_MAP) {\n _REVERSE_MAP = {};\n for (var key in _MAP) {\n\n // pull out the numeric keypad from here cause keypress should\n // be able to detect the keys from the character\n if (key > 95 && key < 112) {\n continue;\n }\n\n if (_MAP.hasOwnProperty(key)) {\n _REVERSE_MAP[_MAP[key]] = key;\n }\n }\n }\n return _REVERSE_MAP;\n }\n\n /**\n * picks the best action based on the key combination\n *\n * @param {string} key - character for key\n * @param {Array} modifiers\n * @param {string=} action passed in\n */\n function _pickBestAction(key, modifiers, action) {\n\n // if no action was picked in we should try to pick the one\n // that we think would work best for this key\n if (!action) {\n action = _getReverseMap()[key] ? 'keydown' : 'keypress';\n }\n\n // modifier keys don't work as expected with keypress,\n // switch to keydown\n if (action == 'keypress' && modifiers.length) {\n action = 'keydown';\n }\n\n return action;\n }\n\n /**\n * Converts from a string key combination to an array\n *\n * @param {string} combination like \"command+shift+l\"\n * @return {Array}\n */\n function _keysFromString(combination) {\n if (combination === '+') {\n return ['+'];\n }\n\n combination = combination.replace(/\\+{2}/g, '+plus');\n return combination.split('+');\n }\n\n /**\n * Gets info for a specific key combination\n *\n * @param {string} combination key combination (\"command+s\" or \"a\" or \"*\")\n * @param {string=} action\n * @returns {Object}\n */\n function _getKeyInfo(combination, action) {\n var keys;\n var key;\n var i;\n var modifiers = [];\n\n // take the keys from this pattern and figure out what the actual\n // pattern is all about\n keys = _keysFromString(combination);\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n // normalize key names\n if (_SPECIAL_ALIASES[key]) {\n key = _SPECIAL_ALIASES[key];\n }\n\n // if this is not a keypress event then we should\n // be smart about using shift keys\n // this will only work for US keyboards however\n if (action && action != 'keypress' && _SHIFT_MAP[key]) {\n key = _SHIFT_MAP[key];\n modifiers.push('shift');\n }\n\n // if this key is a modifier then add it to the list of modifiers\n if (_isModifier(key)) {\n modifiers.push(key);\n }\n }\n\n // depending on what the key combination is\n // we will try to pick the best event for it\n action = _pickBestAction(key, modifiers, action);\n\n return {\n key: key,\n modifiers: modifiers,\n action: action\n };\n }\n\n function _belongsTo(element, ancestor) {\n if (element === null || element === document) {\n return false;\n }\n\n if (element === ancestor) {\n return true;\n }\n\n return _belongsTo(element.parentNode, ancestor);\n }\n\n function Mousetrap(targetElement) {\n var self = this;\n\n targetElement = targetElement || document;\n\n if (!(self instanceof Mousetrap)) {\n return new Mousetrap(targetElement);\n }\n\n /**\n * element to attach key events to\n *\n * @type {Element}\n */\n self.target = targetElement;\n\n /**\n * a list of all the callbacks setup via Mousetrap.bind()\n *\n * @type {Object}\n */\n self._callbacks = {};\n\n /**\n * direct map of string combinations to callbacks used for trigger()\n *\n * @type {Object}\n */\n self._directMap = {};\n\n /**\n * keeps track of what level each sequence is at since multiple\n * sequences can start out with the same sequence\n *\n * @type {Object}\n */\n var _sequenceLevels = {};\n\n /**\n * variable to store the setTimeout call\n *\n * @type {null|number}\n */\n var _resetTimer;\n\n /**\n * temporary state where we will ignore the next keyup\n *\n * @type {boolean|string}\n */\n var _ignoreNextKeyup = false;\n\n /**\n * temporary state where we will ignore the next keypress\n *\n * @type {boolean}\n */\n var _ignoreNextKeypress = false;\n\n /**\n * are we currently inside of a sequence?\n * type of action (\"keyup\" or \"keydown\" or \"keypress\") or false\n *\n * @type {boolean|string}\n */\n var _nextExpectedAction = false;\n\n /**\n * resets all sequence counters except for the ones passed in\n *\n * @param {Object} doNotReset\n * @returns void\n */\n function _resetSequences(doNotReset) {\n doNotReset = doNotReset || {};\n\n var activeSequences = false,\n key;\n\n for (key in _sequenceLevels) {\n if (doNotReset[key]) {\n activeSequences = true;\n continue;\n }\n _sequenceLevels[key] = 0;\n }\n\n if (!activeSequences) {\n _nextExpectedAction = false;\n }\n }\n\n /**\n * finds all callbacks that match based on the keycode, modifiers,\n * and action\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event|Object} e\n * @param {string=} sequenceName - name of the sequence we are looking for\n * @param {string=} combination\n * @param {number=} level\n * @returns {Array}\n */\n function _getMatches(character, modifiers, e, sequenceName, combination, level) {\n var i;\n var callback;\n var matches = [];\n var action = e.type;\n\n // if there are no events related to this keycode\n if (!self._callbacks[character]) {\n return [];\n }\n\n // if a modifier key is coming up on its own we should allow it\n if (action == 'keyup' && _isModifier(character)) {\n modifiers = [character];\n }\n\n // loop through all callbacks for the key that was pressed\n // and see if any of them match\n for (i = 0; i < self._callbacks[character].length; ++i) {\n callback = self._callbacks[character][i];\n\n // if a sequence name is not specified, but this is a sequence at\n // the wrong level then move onto the next match\n if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {\n continue;\n }\n\n // if the action we are looking for doesn't match the action we got\n // then we should keep going\n if (action != callback.action) {\n continue;\n }\n\n // if this is a keypress event and the meta key and control key\n // are not pressed that means that we need to only look at the\n // character, otherwise check the modifiers as well\n //\n // chrome will not fire a keypress if meta or control is down\n // safari will fire a keypress if meta or meta+shift is down\n // firefox will fire a keypress if meta or control is down\n if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) {\n\n // when you bind a combination or sequence a second time it\n // should overwrite the first one. if a sequenceName or\n // combination is specified in this call it does just that\n //\n // @todo make deleting its own method?\n var deleteCombo = !sequenceName && callback.combo == combination;\n var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;\n if (deleteCombo || deleteSequence) {\n self._callbacks[character].splice(i, 1);\n }\n\n matches.push(callback);\n }\n }\n\n return matches;\n }\n\n /**\n * actually calls the callback function\n *\n * if your callback function returns false this will use the jquery\n * convention - prevent default and stop propogation on the event\n *\n * @param {Function} callback\n * @param {Event} e\n * @returns void\n */\n function _fireCallback(callback, e, combo, sequence) {\n\n // if this event should not happen stop here\n if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {\n return;\n }\n\n if (callback(e, combo) === false) {\n _preventDefault(e);\n _stopPropagation(e);\n }\n }\n\n /**\n * handles a character key event\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event} e\n * @returns void\n */\n self._handleKey = function(character, modifiers, e) {\n var callbacks = _getMatches(character, modifiers, e);\n var i;\n var doNotReset = {};\n var maxLevel = 0;\n var processedSequenceCallback = false;\n\n // Calculate the maxLevel for sequences so we can only execute the longest callback sequence\n for (i = 0; i < callbacks.length; ++i) {\n if (callbacks[i].seq) {\n maxLevel = Math.max(maxLevel, callbacks[i].level);\n }\n }\n\n // loop through matching callbacks for this key event\n for (i = 0; i < callbacks.length; ++i) {\n\n // fire for all sequence callbacks\n // this is because if for example you have multiple sequences\n // bound such as \"g i\" and \"g t\" they both need to fire the\n // callback for matching g cause otherwise you can only ever\n // match the first one\n if (callbacks[i].seq) {\n\n // only fire callbacks for the maxLevel to prevent\n // subsequences from also firing\n //\n // for example 'a option b' should not cause 'option b' to fire\n // even though 'option b' is part of the other sequence\n //\n // any sequences that do not match here will be discarded\n // below by the _resetSequences call\n if (callbacks[i].level != maxLevel) {\n continue;\n }\n\n processedSequenceCallback = true;\n\n // keep a list of which sequences were matches for later\n doNotReset[callbacks[i].seq] = 1;\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);\n continue;\n }\n\n // if there were no sequence matches but we are still here\n // that means this is a regular match so we should fire that\n if (!processedSequenceCallback) {\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo);\n }\n }\n\n // if the key you pressed matches the type of sequence without\n // being a modifier (ie \"keyup\" or \"keypress\") then we should\n // reset all sequences that were not matched by this event\n //\n // this is so, for example, if you have the sequence \"h a t\" and you\n // type \"h e a r t\" it does not match. in this case the \"e\" will\n // cause the sequence to reset\n //\n // modifier keys are ignored because you can have a sequence\n // that contains modifiers such as \"enter ctrl+space\" and in most\n // cases the modifier key will be pressed before the next key\n //\n // also if you have a sequence such as \"ctrl+b a\" then pressing the\n // \"b\" key will trigger a \"keypress\" and a \"keydown\"\n //\n // the \"keydown\" is expected when there is a modifier, but the\n // \"keypress\" ends up matching the _nextExpectedAction since it occurs\n // after and that causes the sequence to reset\n //\n // we ignore keypresses in a sequence that directly follow a keydown\n // for the same character\n var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;\n if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {\n _resetSequences(doNotReset);\n }\n\n _ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';\n };\n\n /**\n * handles a keydown event\n *\n * @param {Event} e\n * @returns void\n */\n function _handleKeyEvent(e) {\n\n // normalize e.which for key events\n // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion\n if (typeof e.which !== 'number') {\n e.which = e.keyCode;\n }\n\n var character = _characterFromEvent(e);\n\n // no character found then stop\n if (!character) {\n return;\n }\n\n // need to use === for the character check because the character can be 0\n if (e.type == 'keyup' && _ignoreNextKeyup === character) {\n _ignoreNextKeyup = false;\n return;\n }\n\n self.handleKey(character, _eventModifiers(e), e);\n }\n\n /**\n * called to set a 1 second timeout on the specified sequence\n *\n * this is so after each key press in the sequence you have 1 second\n * to press the next key before you have to start over\n *\n * @returns void\n */\n function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }\n\n /**\n * binds a key sequence to an event\n *\n * @param {string} combo - combo specified in bind call\n * @param {Array} keys\n * @param {Function} callback\n * @param {string=} action\n * @returns void\n */\n function _bindSequence(combo, keys, callback, action) {\n\n // start off by adding a sequence level record for this combination\n // and setting the level to 0\n _sequenceLevels[combo] = 0;\n\n /**\n * callback to increase the sequence level for this sequence and reset\n * all other sequences that were active\n *\n * @param {string} nextAction\n * @returns {Function}\n */\n function _increaseSequence(nextAction) {\n return function() {\n _nextExpectedAction = nextAction;\n ++_sequenceLevels[combo];\n _resetSequenceTimer();\n };\n }\n\n /**\n * wraps the specified callback inside of another function in order\n * to reset all sequence counters as soon as this sequence is done\n *\n * @param {Event} e\n * @returns void\n */\n function _callbackAndReset(e) {\n _fireCallback(callback, e, combo);\n\n // we should ignore the next key up if the action is key down\n // or keypress. this is so if you finish a sequence and\n // release the key the final key will not trigger a keyup\n if (action !== 'keyup') {\n _ignoreNextKeyup = _characterFromEvent(e);\n }\n\n // weird race condition if a sequence ends with the key\n // another sequence begins with\n setTimeout(_resetSequences, 10);\n }\n\n // loop through keys one at a time and bind the appropriate callback\n // function. for any key leading up to the final one it should\n // increase the sequence. after the final, it should reset all sequences\n //\n // if an action is specified in the original bind call then that will\n // be used throughout. otherwise we will pass the action that the\n // next key in the sequence should match. this allows a sequence\n // to mix and match keypress and keydown events depending on which\n // ones are better suited to the key provided\n for (var i = 0; i < keys.length; ++i) {\n var isFinal = i + 1 === keys.length;\n var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);\n _bindSingle(keys[i], wrappedCallback, action, combo, i);\n }\n }\n\n /**\n * binds a single keyboard combination\n *\n * @param {string} combination\n * @param {Function} callback\n * @param {string=} action\n * @param {string=} sequenceName - name of sequence if part of sequence\n * @param {number=} level - what part of the sequence the command is\n * @returns void\n */\n function _bindSingle(combination, callback, action, sequenceName, level) {\n\n // store a direct mapped reference for use with Mousetrap.trigger\n self._directMap[combination + ':' + action] = callback;\n\n // make sure multiple spaces in a row become a single space\n combination = combination.replace(/\\s+/g, ' ');\n\n var sequence = combination.split(' ');\n var info;\n\n // if this pattern is a sequence of keys then run through this method\n // to reprocess each pattern one key at a time\n if (sequence.length > 1) {\n _bindSequence(combination, sequence, callback, action);\n return;\n }\n\n info = _getKeyInfo(combination, action);\n\n // make sure to initialize array if this is the first time\n // a callback is added for this key\n self._callbacks[info.key] = self._callbacks[info.key] || [];\n\n // remove an existing match if there is one\n _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);\n\n // add this call back to the array\n // if it is a sequence put it at the beginning\n // if not put it at the end\n //\n // this is important because the way these are processed expects\n // the sequence ones to come first\n self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({\n callback: callback,\n modifiers: info.modifiers,\n action: info.action,\n seq: sequenceName,\n level: level,\n combo: combination\n });\n }\n\n /**\n * binds multiple combinations to the same callback\n *\n * @param {Array} combinations\n * @param {Function} callback\n * @param {string|undefined} action\n * @returns void\n */\n self._bindMultiple = function(combinations, callback, action) {\n for (var i = 0; i < combinations.length; ++i) {\n _bindSingle(combinations[i], callback, action);\n }\n };\n\n // start!\n _addEvent(targetElement, 'keypress', _handleKeyEvent);\n _addEvent(targetElement, 'keydown', _handleKeyEvent);\n _addEvent(targetElement, 'keyup', _handleKeyEvent);\n }\n\n /**\n * binds an event to mousetrap\n *\n * can be a single key, a combination of keys separated with +,\n * an array of keys, or a sequence of keys separated by spaces\n *\n * be sure to list the modifier keys first to make sure that the\n * correct key ends up getting bound (the last key in the pattern)\n *\n * @param {string|Array} keys\n * @param {Function} callback\n * @param {string=} action - 'keypress', 'keydown', or 'keyup'\n * @returns void\n */\n Mousetrap.prototype.bind = function(keys, callback, action) {\n var self = this;\n keys = keys instanceof Array ? keys : [keys];\n self._bindMultiple.call(self, keys, callback, action);\n return self;\n };\n\n /**\n * unbinds an event to mousetrap\n *\n * the unbinding sets the callback function of the specified key combo\n * to an empty function and deletes the corresponding key in the\n * _directMap dict.\n *\n * TODO: actually remove this from the _callbacks dictionary instead\n * of binding an empty function\n *\n * the keycombo+action has to be exactly the same as\n * it was defined in the bind method\n *\n * @param {string|Array} keys\n * @param {string} action\n * @returns void\n */\n Mousetrap.prototype.unbind = function(keys, action) {\n var self = this;\n return self.bind.call(self, keys, function() {}, action);\n };\n\n /**\n * triggers an event that has already been bound\n *\n * @param {string} keys\n * @param {string=} action\n * @returns void\n */\n Mousetrap.prototype.trigger = function(keys, action) {\n var self = this;\n if (self._directMap[keys + ':' + action]) {\n self._directMap[keys + ':' + action]({}, keys);\n }\n return self;\n };\n\n /**\n * resets the library back to its initial state. this is useful\n * if you want to clear out the current keyboard shortcuts and bind\n * new ones - for example if you switch to another page\n *\n * @returns void\n */\n Mousetrap.prototype.reset = function() {\n var self = this;\n self._callbacks = {};\n self._directMap = {};\n return self;\n };\n\n /**\n * should we stop this event before firing off callbacks\n *\n * @param {Event} e\n * @param {Element} element\n * @return {boolean}\n */\n Mousetrap.prototype.stopCallback = function(e, element) {\n var self = this;\n\n // if the element has the class \"mousetrap\" then no need to stop\n if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {\n return false;\n }\n\n if (_belongsTo(element, self.target)) {\n return false;\n }\n\n // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,\n // not the initial event target in the shadow tree. Note that not all events cross the\n // shadow boundary.\n // For shadow trees with `mode: 'open'`, the initial event target is the first element in\n // the event\u2019s composed path. For shadow trees with `mode: 'closed'`, the initial event\n // target cannot be obtained.\n if ('composedPath' in e && typeof e.composedPath === 'function') {\n // For open shadow trees, update `element` so that the following check works.\n var initialEventTarget = e.composedPath()[0];\n if (initialEventTarget !== e.target) {\n element = initialEventTarget;\n }\n }\n\n // stop for input, select, and textarea\n return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;\n };\n\n /**\n * exposes _handleKey publicly so it can be overwritten by extensions\n */\n Mousetrap.prototype.handleKey = function() {\n var self = this;\n return self._handleKey.apply(self, arguments);\n };\n\n /**\n * allow custom key mappings\n */\n Mousetrap.addKeycodes = function(object) {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n _MAP[key] = object[key];\n }\n }\n _REVERSE_MAP = null;\n };\n\n /**\n * Init the global mousetrap functions\n *\n * This method is needed to allow the global mousetrap functions to work\n * now that mousetrap is a constructor function.\n */\n Mousetrap.init = function() {\n var documentMousetrap = Mousetrap(document);\n for (var method in documentMousetrap) {\n if (method.charAt(0) !== '_') {\n Mousetrap[method] = (function(method) {\n return function() {\n return documentMousetrap[method].apply(documentMousetrap, arguments);\n };\n } (method));\n }\n }\n };\n\n Mousetrap.init();\n\n // expose mousetrap to the global object\n window.Mousetrap = Mousetrap;\n\n // expose as a common js module\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Mousetrap;\n }\n\n // expose mousetrap as an AMD module\n if (typeof define === 'function' && define.amd) {\n define(function() {\n return Mousetrap;\n });\n }\n}) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);\n", "import { $, $all, app, store } from './common'\nimport { copyAll } from './context'\nimport { cm, udfInput, uduInput } from './editor'\nimport { calculate } from './eval'\nimport { getRates } from './forex'\nimport { generateIcons } from './icons'\nimport { notify, showError, showModal } from './modal'\nimport { plot } from './plot'\nimport { settings } from './settings'\nimport { defaultPage, lastPage, loadPage, migrateSaved, getPageName, pageOrder, populatePages } from './pages'\nimport { applyUdfu } from './userDefined'\nimport { checkSize, checkUpdates, isMac, isElectron, toggleMinMax } from './utils'\n\nimport { author, description, homepage, name, version } from './../../package.json'\n\nimport { DateTime } from 'luxon'\n\nimport UIkit from 'uikit'\n\nimport Mousetrap from 'mousetrap'\nimport 'mousetrap-global-bind'\n\n// Set app info\ndocument.title = description\n\n$('#dialog-about-copyright').innerHTML = `Copyright \u00A9\uFE0F ${DateTime.local().year} ${author.name}`\n$('#dialog-about-appVersion').innerHTML = isElectron\n ? `Version ${version}`\n : `Version ${version}\n `\n$('#gitLink').setAttribute('href', homepage)\n$('#webLink').setAttribute('href', author.url)\n$('#licenseLink').setAttribute('href', homepage + '/blob/master/LICENSE')\n$('#helpLink').setAttribute('href', homepage + '/wiki')\n\n// Set theme and maximize if needed\nif (isElectron) {\n numara.themeUpdate(settings.apply)\n numara.fullscreen()\n} else {\n // Register service worker\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register('./sw.js').catch(() => {\n console.log('Service worker registration failed.')\n })\n }\n}\n\n// Set headers\nif (isElectron && !isMac) {\n $('#header-mac').remove()\n $('#header-win').style.display = 'block'\n $('#header-win-title').innerHTML = name\n\n $('#max').style.display = numara.isMaximized() ? 'none' : 'block'\n $('#unmax').style.display = numara.isMaximized() ? 'block' : 'none'\n\n $('#min').addEventListener('click', numara.minimize)\n $('#max').addEventListener('click', numara.maximize)\n $('#unmax').addEventListener('click', numara.unmaximize)\n $('#close').addEventListener('click', numara.close)\n\n numara.isMax((event, isMax) => {\n $('#unmax').style.display = isMax ? 'block' : 'none'\n $('#max').style.display = isMax ? 'none' : 'block'\n })\n\n $('#header-win').addEventListener('dblclick', toggleMinMax)\n} else {\n $('#header-win').remove()\n $('#header-mac').style.display = 'block'\n $('#header-mac-title').innerHTML = name\n\n if (isElectron) {\n $('#header-mac').addEventListener('dblclick', toggleMinMax)\n }\n}\n\n// Generate app icons\ngenerateIcons()\n\n// Initialize settings\nsettings.initialize()\n\n// Get exchange rates\nif (app.settings.currency) {\n getRates()\n}\n\n// Set user defined values\nif (!store.get('pages')) {\n defaultPage()\n} else {\n app.activePage = lastPage()\n loadPage(lastPage())\n}\n\nmigrateSaved()\n\n// Set user defined values\nif (!store.get('udf')) {\n store.set('udf', '')\n}\n\nif (!store.get('udu')) {\n store.set('udu', '')\n}\n\napplyUdfu(store.get('udf'), 'func')\napplyUdfu(store.get('udu'), 'unit')\n\n// Populate saved calculation\npopulatePages()\n\n// Action buttons\n$('#clearButton').addEventListener('click', () => {\n if (cm.getValue() !== '') {\n cm.setValue('')\n cm.focus()\n\n calculate()\n }\n})\n\n$('#copyButton').addEventListener('click', () => {\n copyAll()\n})\n\n$('#udfuButton').addEventListener('click', () => {\n showModal('#dialog-udfu')\n})\n\n$('#settingsButton').addEventListener('click', () => {\n showModal('#dialog-settings')\n})\n\n$('#aboutButton').addEventListener('click', () => {\n showModal('#dialog-about')\n})\n\n// Output panel actions\n$('#output').addEventListener('click', (event) => {\n switch (event.target.className) {\n case 'answer':\n navigator.clipboard.writeText(event.target.dataset.copy)\n\n notify(`Copied '${event.target.dataset.copy}' to clipboard.`)\n\n break\n case 'plotButton': {\n const func = event.target.getAttribute('data-func')\n\n app.plotFunction = func.startsWith('line') ? app.mathScope[func] : func\n\n try {\n $('#plotCrossModal').checked = app.settings.plotCross\n $('#plotDerivativeModal').checked = app.settings.plotDerivative\n $('#plotGridModal').checked = app.settings.plotGrid\n\n plot()\n\n showModal('#dialog-plot')\n } catch (error) {\n showError('Error', error)\n }\n\n break\n }\n case 'lineError':\n showError('Error on Line ' + event.target.getAttribute('data-line'), event.target.getAttribute('data-error'))\n\n break\n }\n\n event.stopPropagation()\n})\n\n// Clear input selections when clicked in output panel\n$('#output').addEventListener('mousedown', () => {\n const sels = document.getElementsByClassName('CodeMirror-selected')\n\n while (sels[0]) {\n sels[0].classList.remove('CodeMirror-selected')\n }\n})\n\n// Panel resizer\nlet resizeDelay\nlet isResizing = false\n\nconst panel = $('#panel')\nconst divider = $('#panelDivider')\n\n// Set divider tooltip.\nconst dividerTooltip = () => {\n divider.title =\n $('#input').style.width === settings.defaults.inputWidth + '%' ? 'Drag to resize' : 'Double click to reset position'\n}\n\ndivider.addEventListener('dblclick', () => {\n app.settings.inputWidth = settings.defaults.inputWidth\n\n store.set('settings', app.settings)\n\n settings.apply()\n\n dividerTooltip()\n})\n\ndivider.addEventListener('mousedown', (event) => {\n isResizing = event.target === divider\n})\n\n$('#panel').addEventListener('mouseup', () => {\n isResizing = false\n})\n\n$('#panel').addEventListener('mousemove', (event) => {\n if (isResizing) {\n const offset = app.settings.lineNumbers ? 12 : 27\n const pointerRelativeXpos = event.clientX - panel.offsetLeft - offset\n const iWidth = (pointerRelativeXpos / panel.clientWidth) * 100\n const inputWidth = iWidth < 0 ? 0 : iWidth > 100 ? 100 : iWidth\n\n $('#input').style.width = inputWidth + '%'\n\n app.settings.inputWidth = inputWidth\n\n store.set('settings', app.settings)\n\n clearTimeout(resizeDelay)\n\n resizeDelay = setTimeout(calculate, 10)\n }\n\n dividerTooltip()\n})\n\n// Tooltip defaults\nUIkit.mixin({ data: { offset: 5 } }, 'tooltip')\n\n// Initiate settings dialog\nUIkit.util.on('#dialog-settings', 'beforeshow', settings.prep)\n\nUIkit.util.on('#setswitch', 'beforeshow', (event) => {\n event.stopPropagation()\n})\n\n// Prepare user defined dialog inputs\nUIkit.util.on('#dialog-udfu', 'shown', (event) => {\n if (event.target.id === 'dialog-udfu') {\n const udf = store.get('udf').trim()\n const udu = store.get('udu').trim()\n\n udfInput.setValue(udf)\n uduInput.setValue(udu)\n }\n})\n\n// Blur input when user defined switcher is shown\nUIkit.util.on('#udfuSwitcher', 'shown', () => {\n cm.getInputField().blur()\n})\n\n// Focus on input when dialog is closed\nUIkit.util.on('.modal', 'hidden', () => {\n setTimeout(() => {\n cm.focus()\n }, 100)\n})\n\n// Plot dialog\nUIkit.util.on('#dialog-plot', 'shown', plot)\nUIkit.util.on('#dialog-plot', 'hide', () => {\n app.activePlot = false\n})\n\n// Save page sort order after move\nUIkit.util.on('#pageList', 'moved', () => {\n pageOrder()\n populatePages()\n})\n\n// Save dialog title focus on shown\nUIkit.util.on('#dialog-newPage', 'shown', () => {\n $('#newPageTitleInput').setAttribute('placeholder', getPageName())\n $('#newPageTitleInput').focus()\n})\n\n// Focus rename input on show\nUIkit.util.on('#dialog-renamePage', 'shown', () => {\n setTimeout(() => {\n $('#renamePageTitleInput').focus()\n $('#renamePageTitleInput').select()\n }, 20)\n})\n\nUIkit.util.on('#sidePanel', 'hidden', () => {\n setTimeout(() => {\n cm.focus()\n }, 20)\n})\n\n// Prevent CM refresh if keydown\ndocument.addEventListener('keydown', (event) => {\n app.refreshCM = !event.repeat\n})\n\ndocument.addEventListener('keyup', () => {\n app.refreshCM = true\n})\n\n// Relayout plot on window resize\nlet windowResizeDelay\n\nwindow.addEventListener('resize', () => {\n if (app.activePlot && $('#dialog-plot').classList.contains('uk-open')) {\n plot()\n }\n\n clearTimeout(windowResizeDelay)\n\n windowResizeDelay = setTimeout(calculate, 10)\n\n checkSize()\n})\n\n// Sync scroll\nlet inputScroll = false\nlet outputScroll = false\n\nconst inputPanel = $('.CodeMirror-scroll')\nconst outputPanel = $('#output')\n\ninputPanel.addEventListener('scroll', () => {\n if (!inputScroll) {\n outputScroll = true\n\n outputPanel.scrollTop = inputPanel.scrollTop\n }\n\n inputScroll = false\n})\n\noutputPanel.addEventListener('scroll', () => {\n if (!outputScroll) {\n inputScroll = true\n\n inputPanel.scrollTop = outputPanel.scrollTop\n }\n\n outputScroll = false\n\n $('#scrollTop').style.display = outputPanel.scrollTop > 50 ? 'block' : 'none'\n})\n\n$('#scrollTop').addEventListener('click', () => {\n inputPanel.scrollTop = 0\n outputPanel.scrollTop = 0\n})\n\n// Mousetrap\nconst traps = {\n clearButton: ['command+d', 'ctrl+d'],\n exportButton: ['command+e', 'ctrl+e'],\n importButton: ['command+i', 'ctrl+i'],\n newPageButton: ['command+n', 'ctrl+n'],\n printButton: ['command+p', 'ctrl+p'],\n sidePanelButton: ['tab']\n}\n\nfor (const [button, command] of Object.entries(traps)) {\n Mousetrap.bindGlobal(command, (event) => {\n event.preventDefault()\n\n if ($all('.uk-open').length === 0) {\n $('#' + button).click()\n } else if ($('#sidePanel').classList.contains('uk-open') && !$('#dialog-newPage').classList.contains('uk-open')) {\n $('#closeSidePanelButton').click()\n }\n })\n}\n\n// Check for updates.\ncheckUpdates()\n\n// Restart button if update is installed\n$('#restartButton').addEventListener('click', () => {\n numara.updateApp()\n})\n\n// Developer Tools\nif (isElectron) {\n $('#dialog-about-appVersion').addEventListener('click', (event) => {\n if (event.detail === 9) {\n numara.openDevTools()\n }\n })\n}\n\n// Print\nwindow.addEventListener('beforeprint', () => {\n const printArea = document.createElement('div')\n\n printArea.setAttribute('id', 'printArea')\n printArea.className = 'printArea'\n printArea.innerHTML = `\n
    ${name}
    \n `\n\n document.body.appendChild(printArea)\n\n cm.eachLine((line) => {\n const lineNo = cm.getLineNumber(line)\n const input = cm.getLine(lineNo)\n const answer = $('#output').children[lineNo].innerText\n const row = `\n \n ${app.settings.lineNumbers ? '' : ''}\n \n \n `\n\n $('#printPagele').innerHTML += row\n })\n\n printArea.innerHTML += `
    ' + (lineNo + 1) + '${input}${answer}
    `\n})\n\nwindow.addEventListener('afterprint', () => {\n $('#printArea').remove()\n})\n", "/** Query DOM element that matches the selector. */\nexport const $ = (selector) => document.querySelector(selector)\n\n/** Query all DOM elements matching the selector. */\nexport const $all = (selector) => document.querySelectorAll(selector)\n\n/** Local storage. */\nexport const store = {\n /** Get value from local storage. */\n get: (key) => JSON.parse(localStorage.getItem(key)),\n /** Save value to local storage. */\n set: (key, value) => {\n localStorage.setItem(key, JSON.stringify(value))\n }\n}\n\n/** App globals. */\nexport const app = {\n activePlot: null,\n activePage: null,\n currencyRates: {},\n mathScope: {},\n plotFunction: null,\n refreshCM: true,\n settings: null,\n udfList: [],\n uduList: []\n}\n", "import { $, $all } from './common'\nimport { cm, udfInput, uduInput } from './editor'\nimport { notify } from './modal'\nimport { isElectron } from './utils'\n\n/** Main context menus */\nfunction inputContext() {\n setTimeout(() => {\n const index = cm.getCursor().line\n const line = cm.getLine(index)\n const answer = $('#output').children[index].innerText\n const isEmpty = cm.getValue() === ''\n const isLine = line.length > 0\n const isSelection = cm.somethingSelected()\n const isMultiLine =\n cm.listSelections().length > 1 || cm.listSelections()[0].anchor.line !== cm.listSelections()[0].head.line\n const hasAnswer = answer !== '' && answer !== 'Error' && answer !== 'Plot'\n\n numara.inputContextMenu(index, isEmpty, isLine, isSelection, isMultiLine, hasAnswer)\n }, 20)\n}\n\n/** Output panel context menu. */\nfunction outputContext(event) {\n const answer = event.srcElement.innerText\n const index = event.srcElement.dataset.line || event.srcElement.parentElement.dataset.line || cm.lastLine()\n const hasAnswer = index !== null && answer !== '' && answer !== 'Error' && answer !== 'Plot'\n const isEmpty = cm.getValue() === ''\n\n numara.outputContextMenu(index, isEmpty, hasAnswer)\n}\n\n/** Textbox context menu. */\nfunction textboxContext() {\n setTimeout(() => {\n numara.textboxContextMenu()\n }, 20)\n}\n\n/** Copy line answer. */\nfunction copyLine(event, index) {\n index = +index\n\n const line = cm.getLine(index).trim()\n\n navigator.clipboard.writeText(line).then(notify(`Copied Line ${index + 1} to clipboard.`))\n}\n\n/** Copy line answer. */\nfunction copyAnswer(event, index, withLines) {\n index = +index\n\n const line = cm.getLine(index).trim()\n const answer = $('#output').children[index].children[0].dataset.copy\n const copiedText = withLines ? `${line} = ${answer}` : `${answer}`\n\n navigator.clipboard\n .writeText(copiedText)\n .then(notify(withLines ? `Copied Line ${index + 1} with answer to clipboard.` : `Copied '${answer}' to clipboard.`))\n}\n\n/** Copy all inputs. */\nfunction copyAllLines() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n navigator.clipboard.writeText(cm.getValue()).then(notify('Copied all lines to clipboard.'))\n }\n}\n\n/** Copy all answers. */\nfunction copyAllAnswers() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n let copiedOutputs = ''\n\n cm.eachLine((line) => {\n const index = cm.getLineNumber(line)\n\n copiedOutputs += `${$('#output').children[index].innerText}\\n`\n })\n\n navigator.clipboard.writeText(copiedOutputs).then(notify('Copied all answers to clipboard.'))\n }\n}\n\n/** Copy page. */\nexport function copyAll() {\n if (cm.getValue() === '') {\n notify('Nothing to copy.')\n } else {\n let copiedCalc = ''\n\n cm.eachLine((line) => {\n const index = cm.getLineNumber(line)\n\n line = line.text.trim()\n\n copiedCalc += line\n ? line.match(/^(#|\\/\\/)/)\n ? `${line}\\n`\n : `${line} = ${$('#output').children[index].innerText}\\n`\n : '\\n'\n })\n\n navigator.clipboard.writeText(copiedCalc).then(notify('Copied page to clipboard.'))\n }\n}\n\n// Context menus\nif (isElectron) {\n cm.on('contextmenu', inputContext)\n\n udfInput.on('contextmenu', textboxContext)\n uduInput.on('contextmenu', textboxContext)\n\n $('#output').addEventListener('contextmenu', outputContext)\n\n $all('.textBox').forEach((el) => {\n el.addEventListener('contextmenu', textboxContext)\n })\n\n numara.copyLine(copyLine)\n numara.copyAnswer(copyAnswer)\n numara.copyLineWithAnswer(copyAnswer)\n numara.copyAllLines(copyAllLines)\n numara.copyAllAnswers(copyAllAnswers)\n numara.copyAll(copyAll)\n}\n", "import { $, $all, app, store } from './common'\nimport { calculate, formatAnswer, math } from './eval'\n\nimport * as formulajs from '@formulajs/formulajs'\n\nimport UIkit from 'uikit'\n\nimport CodeMirror from 'codemirror'\n\nimport 'codemirror/mode/javascript/javascript'\nimport 'codemirror/addon/dialog/dialog'\nimport 'codemirror/addon/display/placeholder'\nimport 'codemirror/addon/edit/closebrackets'\nimport 'codemirror/addon/edit/matchbrackets'\nimport 'codemirror/addon/hint/show-hint'\nimport 'codemirror/addon/search/jump-to-line'\nimport 'codemirror/addon/search/search'\nimport 'codemirror/addon/search/searchcursor'\n\n/** CodeMirror input panel. */\nexport const cm = CodeMirror.fromTextArea($('#inputArea'), {\n autofocus: true,\n extraKeys: { 'Ctrl-Space': 'autocomplete', Tab: () => {} },\n mode: 'numara',\n singleCursorHeightPerLine: false,\n smartIndent: false,\n theme: 'numara',\n viewportMargin: Infinity\n})\n\n// User defined functions and units editors\nconst udOptions = {\n autofocus: true,\n autoCloseBrackets: true,\n mode: 'javascript',\n singleCursorHeightPerLine: false,\n tabSize: 2\n}\n\nexport const udfInput = CodeMirror.fromTextArea($('#udfInput'), udOptions)\nexport const uduInput = CodeMirror.fromTextArea($('#uduInput'), udOptions)\n\n// Codemirror syntax templates\nCodeMirror.defineMode('numara', () => ({\n token: (stream) => {\n if (stream.match(/\\/\\/.*/) || stream.match(/#.*/)) {\n return 'comment'\n }\n\n if (stream.match(/\\d/)) {\n return 'number'\n }\n\n if (stream.match(/(?:\\+|-|\\*|\\/|,|;|\\.|:|@|~|=|>|<|&|\\||`|'|\\^|\\?|!|%)/)) {\n return 'operator'\n }\n\n stream.eatWhile(/\\w/)\n\n const cmStream = stream.current()\n\n if (app.settings.currency && (cmStream.toLowerCase() in app.currencyRates || cmStream.toLowerCase() === 'usd')) {\n return 'currency'\n }\n\n if (typeof math[cmStream] === 'function' && Object.getOwnPropertyNames(math[cmStream]).includes('signatures')) {\n return 'function'\n }\n\n if (app.udfList.includes(cmStream)) {\n return 'udf'\n }\n\n if (app.uduList.includes(cmStream)) {\n return 'udu'\n }\n\n if (cmStream.match(/\\b(?:_|ans|total|subtotal|avg|today|now)\\b/)) {\n return 'scope'\n }\n\n if (cmStream.match(/\\b(?:line\\d+)\\b/)) {\n return 'lineNo'\n }\n\n if (typeof formulajs[cmStream] === 'function') {\n return 'excel'\n }\n\n try {\n const val = math.evaluate(cmStream)\n const par = math.parse(cmStream)\n\n if (val.units && val) {\n return 'unit'\n }\n\n if (par.isSymbolNode && val) {\n return 'constant'\n }\n } catch {\n /** Ignore catch */\n }\n\n try {\n math.evaluate(cmStream)\n } catch {\n return 'variable'\n }\n\n stream.next()\n\n return 'space'\n }\n}))\n\nCodeMirror.defineMode('plain', () => ({\n token: (stream) => {\n stream.next()\n\n return 'text'\n }\n}))\n\n// Codemirror autocomplete hints\nconst numaraHints = []\n\nconst scopeList = [\n { text: '_', desc: 'Answer from last calculated line.' },\n { text: 'ans', desc: 'Answer from last calculated line.' },\n { text: 'avg', desc: 'Average of previous line values. Numbers only.' },\n { text: 'now', desc: 'Current date and time.' },\n { text: 'subtotal', desc: 'Total of all lines in previous block. Numbers only.' },\n { text: 'today', desc: 'Current date.' },\n { text: 'total', desc: 'Total of previous line values. Numbers only.' }\n]\n\nscopeList.forEach((scope) => {\n scope.className = 'cm-scope'\n numaraHints.push(scope)\n})\n\nObject.getOwnPropertyNames(math).forEach((f) => {\n if (typeof math[f] === 'function' && Object.getOwnPropertyNames(math[f]).includes('signatures')) {\n numaraHints.push({ text: f, className: 'cm-function' })\n }\n})\n\nObject.keys(formulajs).forEach((f) => {\n numaraHints.push({ text: 'xls.' + f, className: 'cm-excel' })\n})\n\nCodeMirror.registerHelper('hint', 'numaraHints', (editor) => {\n const cmCursor = editor.getCursor()\n const cmCursorLine = editor.getLine(cmCursor.line)\n\n let start = cmCursor.ch\n let end = start\n\n while (end < cmCursorLine.length && /[\\w.$]/.test(cmCursorLine.charAt(end))) {\n ++end\n }\n\n while (start && /[\\w.$]/.test(cmCursorLine.charAt(start - 1))) {\n --start\n }\n\n let curStr = cmCursorLine.slice(start, end)\n let curWord = start !== end && curStr\n\n const curWordRegex = new RegExp('^' + curWord, 'i')\n\n curWord = !curStr.endsWith('.') || curStr === 'xls.'\n\n return {\n list: !curWord\n ? []\n : numaraHints.filter(({ text }) => text.match(curWordRegex)).sort((a, b) => a.text.localeCompare(b.text)),\n from: CodeMirror.Pos(cmCursor.line, start),\n to: CodeMirror.Pos(cmCursor.line, end)\n }\n})\n\nCodeMirror.commands.autocomplete = (cm) => {\n CodeMirror.showHint(cm, CodeMirror.hint.numaraHints, {\n completeSingle: false,\n extraKeys: { Enter: 'newline', Tab: () => {} }\n })\n}\n\n// Codemirror handlers\ncm.on('changes', calculate)\n\ncm.on('inputRead', (cm) => {\n if (app.settings.autocomplete) {\n CodeMirror.commands.autocomplete(cm)\n }\n})\n\ncm.on('cursorActivity', (cm) => {\n cm.eachLine((line) => {\n const cmLineNo = cm.getLineNumber(line)\n const activeLine = cm.getCursor().line\n\n if (cmLineNo === activeLine) {\n cm.addLineClass(cmLineNo, 'gutter', 'activeLine')\n } else {\n cm.removeLineClass(cmLineNo, 'gutter', 'activeLine')\n }\n })\n})\n\nconst ttPos = (el) => (el.nodeName.toLowerCase() === 'li' ? 'right' : 'top-left')\n\ncm.on('update', () => {\n const funcs = $all('.cm-function')\n\n if (funcs.length > 0 && app.settings.keywordTips) {\n for (const f of funcs) {\n try {\n const obj = JSON.parse(JSON.stringify(math.help(f.innerText).toJSON()))\n\n UIkit.tooltip(f, {\n pos: ttPos(f),\n title: obj.description\n })\n } catch {\n UIkit.tooltip(f, {\n pos: ttPos(f),\n title: 'Description not available'\n })\n }\n }\n }\n\n const udfs = $all('.cm-udf')\n\n if (udfs.length > 0 && app.settings.keywordTips) {\n for (const f of udfs) {\n UIkit.tooltip(f, {\n pos: ttPos(f),\n title: 'User defined function'\n })\n }\n }\n\n const udus = $all('.cm-udu')\n\n if (udus.length > 0 && app.settings.keywordTips) {\n for (const u of udus) {\n UIkit.tooltip(u, {\n pos: ttPos(u),\n title: 'User defined unit'\n })\n }\n }\n\n const currencies = $all('.cm-currency')\n\n if (currencies.length > 0 && app.settings.keywordTips) {\n for (const c of currencies) {\n try {\n const currency = c.innerText.toLowerCase()\n const currencyName = currency === 'usd' ? 'U.S. Dollar' : app.currencyRates[currency].name\n\n UIkit.tooltip(c, {\n pos: ttPos(c),\n title: currencyName\n })\n } catch {\n UIkit.tooltip(c, {\n pos: ttPos(c),\n title: 'Description not available'\n })\n }\n }\n }\n\n const units = $all('.cm-unit')\n\n if (units.length > 0 && app.settings.keywordTips) {\n for (const u of units) {\n UIkit.tooltip(u, {\n pos: ttPos(u),\n title: `Unit '${u.innerText}'`\n })\n }\n }\n\n const constants = $all('.cm-constant')\n\n if (constants.length > 0 && app.settings.keywordTips) {\n for (const c of constants) {\n try {\n UIkit.tooltip(c, {\n pos: ttPos(c),\n title: math.help(c.innerText).doc.description + ' (Constant)'\n })\n } catch {\n /* No tooltip */\n }\n }\n }\n\n const vars = $all('.cm-variable')\n\n if (vars.length > 0 && app.settings.keywordTips) {\n for (const v of vars) {\n if (app.mathScope[v.innerText] && typeof app.mathScope[v.innerText] !== 'function') {\n let varTooltip\n\n try {\n varTooltip = formatAnswer(math.evaluate(v.innerText, app.mathScope))\n } catch {\n varTooltip = 'Undefined'\n }\n\n UIkit.tooltip(v, {\n pos: ttPos(v),\n title: varTooltip\n })\n }\n }\n }\n\n const lineNos = $all('.cm-lineNo')\n\n if (lineNos.length > 0 && app.settings.keywordTips) {\n for (const ln of lineNos) {\n let scopeTooltip\n\n try {\n scopeTooltip =\n typeof app.mathScope[ln.innerText] === 'function'\n ? 'Function'\n : formatAnswer(math.evaluate(ln.innerText, app.mathScope))\n } catch {\n scopeTooltip = 'Undefined'\n }\n\n UIkit.tooltip(ln, {\n pos: ttPos(ln),\n title: scopeTooltip\n })\n }\n }\n\n const scope = $all('.cm-scope')\n\n if (scope.length > 0 && app.settings.keywordTips) {\n for (const s of scope) {\n UIkit.tooltip(s, {\n pos: ttPos(s),\n title: scopeList.filter((scope) => s.innerText === scope.text)[0].desc\n })\n }\n }\n\n const excel = $all('.cm-excel')\n\n if (excel.length > 0 && app.settings.keywordTips) {\n for (const x of excel) {\n UIkit.tooltip(x, {\n pos: ttPos(x),\n title: 'Excel function'\n })\n }\n }\n})\n\ncm.on('cursorActivity', (cm) => {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id == app.activePage)\n\n page.cursor = cm.getCursor()\n\n store.set('pages', pages)\n})\n", "import { $, app, store } from './common'\nimport { cm } from './editor'\nimport { checkLocale } from './utils'\n\nimport { DateTime } from 'luxon'\nimport { all, create, factory } from 'mathjs'\n\nimport * as formulajs from '@formulajs/formulajs'\n\nexport const math = create(all)\n\n// Import Formula.js into MathJs\nmath.import(factory('xls', [], () => formulajs))\n\n// Expose math to global scope for use in function-plot.\nwindow.math = math\n\nconst nowFormat = 'D t'\nconst nowDayFormat = 'ccc, D t'\n\nconst todayFormat = 'D'\nconst todayDayFormat = 'ccc, D'\n\n/** Calculate answers. */\nexport function calculate() {\n if (app.refreshCM) {\n cm.refresh()\n }\n\n let answers = ''\n let answerCopy = ''\n\n const avgs = []\n const totals = []\n const subtotals = []\n\n const dateTime = DateTime.now().setLocale(app.settings.locale)\n\n app.mathScope = {}\n app.mathScope.now = dateTime.toFormat(app.settings.dateDay ? nowDayFormat : nowFormat)\n app.mathScope.today = dateTime.toFormat(app.settings.dateDay ? todayDayFormat : todayFormat)\n\n $('#clearButton').setAttribute('disabled', cm.getValue() === '')\n $('#copyButton').setAttribute('disabled', cm.getValue() === '')\n\n cm.eachLine((cmLine) => {\n const cmLineNo = cm.getLineNumber(cmLine)\n const lineNo = cmLineNo + 1\n\n let answer = ''\n let line = cmLine.text.trim().split('//')[0].split('#')[0]\n\n cm.removeLineClass(cmLine, 'gutter', 'lineNoError')\n\n if (app.settings.rulers) {\n cm.removeLineClass(cmLine, 'wrap', 'noRuler')\n cm.addLineClass(cmLine, 'wrap', 'ruler')\n } else {\n cm.removeLineClass(cmLine, 'wrap', 'ruler')\n cm.addLineClass(cmLine, 'wrap', 'noRuler')\n }\n\n if (line) {\n try {\n line =\n lineNo > 1 &&\n line.charAt(0).match(/[+\\-*/]/) &&\n cm.getLine(lineNo - 2).length > 0 &&\n app.settings.contPrevLine\n ? app.mathScope.ans + line\n : line\n\n if (checkLocale()) {\n line = line.replace(/[,;]/g, (match) => (match === ',' ? '.' : ','))\n }\n\n app.mathScope.avg = math.evaluate(avgs.length > 0 ? '(' + math.mean(avgs) + ')' : '0')\n app.mathScope.total = math.evaluate(totals.length > 0 ? '(' + totals.join('+') + ')' : '0')\n app.mathScope.subtotal = math.evaluate(subtotals.length > 0 ? '(' + subtotals.join('+') + ')' : '0')\n\n try {\n answer = math.evaluate(line, app.mathScope)\n } catch {\n answer = evaluate(line)\n }\n\n if (answer || answer === 0) {\n app.mathScope._ = answer\n app.mathScope.ans = answer\n app.mathScope['line' + lineNo] = answer\n\n if (typeof answer === 'number') {\n avgs.push(answer)\n totals.push(answer)\n subtotals.push(answer)\n }\n\n answer = math.format(answer, {\n notation: app.settings.notation,\n lowerExp: +app.settings.expLower,\n upperExp: +app.settings.expUpper\n })\n\n const answerCopyInit = answer\n\n answer = formatAnswer(answer, false)\n answerCopy = formatAnswer(answerCopyInit, true)\n\n if (answer.match(/\\w\\(x\\)/)) {\n const plotAns = (/\\w\\(x\\)$/.test(answer) && line !== 'ans' ? line : answer).replace(/\\s+/g, '')\n\n app.mathScope.ans = plotAns\n app.mathScope['line' + lineNo] = plotAns\n\n answer = `Plot`\n }\n } else {\n subtotals.length = 0\n\n answer = ''\n }\n } catch (error) {\n if (app.settings.lineErrors) {\n cm.addLineClass(cmLineNo, 'gutter', 'lineNoError')\n\n answer = `Error`\n }\n }\n } else {\n subtotals.length = 0\n }\n\n answers += `\n ${answer}\n
    `\n })\n\n $('#output').innerHTML = answers\n\n if (app.activePage) {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === app.activePage)\n\n page.data = cm.getValue()\n page.history = cm.getHistory()\n\n store.set('pages', pages)\n }\n}\n\n/** Secondary evaluate method to try if math.evaluate fails */\nfunction evaluate(line) {\n if (line.match(/:/)) {\n try {\n math.evaluate(line.split(':')[0])\n } catch {\n line = line.substring(line.indexOf(':') + 1)\n }\n }\n\n const dateTimeReg =\n /[+-] * .* *(millisecond|second|minute|hour|day|week|month|quarter|year|decade|century|centuries|millennium|millennia)s?/g\n\n if (line.match(dateTimeReg)) {\n line = line.replace('now', app.mathScope.now).replace('today', app.mathScope.today)\n\n const lineDate = line.replace(dateTimeReg, '').trim()\n const lineDateRight = line.replace(lineDate, '').trim()\n const locale = { locale: app.settings.locale }\n const lineDateNow = DateTime.fromFormat(lineDate, app.settings.dateDay ? nowDayFormat : nowFormat, locale)\n const lineDateToday = DateTime.fromFormat(lineDate, app.settings.dateDay ? todayDayFormat : todayFormat, locale)\n const lineDateTime = lineDateNow.isValid ? lineDateNow : lineDateToday.isValid ? lineDateToday : false\n const rightOfDate = String(math.evaluate(lineDateRight + ' to hours', app.mathScope))\n const durHrs = Number(rightOfDate.split(' ')[0])\n\n if (lineDateTime) {\n const dtLine = lineDateTime\n .plus({ hours: durHrs })\n .toFormat(\n lineDateNow.isValid\n ? app.settings.dateDay\n ? nowDayFormat\n : nowFormat\n : app.settings.dateDay\n ? todayDayFormat\n : todayFormat\n )\n\n line = `\"${dtLine}\"`\n } else {\n return 'Invalid Date'\n }\n }\n\n const pcntOfReg = /%[ ]*of[ ]*/g\n const pcntOfValReg = /[\\w.]*%[ ]*of[ ]*/g\n\n if (line.match(pcntOfValReg)) {\n line = line.replaceAll(pcntOfReg, '/100*')\n }\n\n return math.evaluate(line, app.mathScope)\n}\n\nfunction stripAnswer(answer) {\n let t = answer.length\n\n if (answer.charAt(0) === '\"') {\n answer = answer.substring(1, t--)\n }\n\n if (answer.charAt(--t) === '\"') {\n answer = answer.substring(0, t)\n }\n\n return answer\n}\n\n/**\n * Format answer.\n *\n * @param {*} answer Value to format.\n * @param {boolean} separator Include thousands separator - True|False\n * @returns\n */\nexport function formatAnswer(answer, separator) {\n answer = String(answer)\n\n if (['bin', 'hex', 'oct'].includes(app.settings.notation)) {\n return stripAnswer(answer)\n }\n\n const a = answer.trim().split(' ')[0]\n const b = answer.replace(a, '')\n const digits = {\n maximumFractionDigits: app.settings.precision,\n useGrouping: separator ? app.settings.copyThouSep : app.settings.thouSep\n }\n\n const formattedAnswer =\n !a.includes('e') && !isNaN(a)\n ? Number(a).toLocaleString(app.settings.locale, digits) + b\n : a.match(/e[+-]?\\d+/) && !isNaN(a.split('e')[0])\n ? Number(a.split('e')[0]).toLocaleString(app.settings.locale, digits) + 'e' + answer.split('e')[1]\n : stripAnswer(answer)\n\n return formattedAnswer\n}\n", "import { $, app } from './common'\nimport { notify } from './modal'\n\n/** Check if app is running on MacOS. */\nexport const isMac = navigator.userAgent.toLowerCase().includes('mac')\n\n/** Check if app is running in Electron. */\nexport const isElectron = navigator.userAgent.toLowerCase().includes('electron')\n\n/** Check user locale for thousands separator. */\nexport function checkLocale() {\n const locale =\n app.settings.locale === 'system'\n ? navigator.languages && navigator.languages.length\n ? navigator.languages[0]\n : navigator.language\n : app.settings.locale\n\n return (1.11).toLocaleString(locale).match(/[,]/)\n}\n\n/** Check window size. */\nexport function checkSize() {\n $('#resetSizeButton').style.display = isElectron\n ? numara.isResized() && !numara.isMaximized()\n ? 'block'\n : 'none'\n : 'none'\n}\n\n/** Minimize/maximize window. */\nexport function toggleMinMax() {\n if (numara.isMaximized()) {\n numara.unmaximize()\n } else {\n numara.maximize()\n }\n}\n\n/** Check for app updates */\nexport function checkUpdates() {\n if (isElectron) {\n numara.checkUpdate()\n\n numara.notifyUpdate(() => {\n notify(\n 'Updating Numara... View update status'\n )\n\n $('#notificationDot').style.display = 'block'\n })\n\n numara.updateStatus((event, status) => {\n if (status === 'ready') {\n $('#dialog-about-updateStatus').innerHTML = 'Restart Numara to finish updating.'\n $('#restartButton').style.display = 'inline-block'\n\n if (!$('#dialog-about').classList.contains('uk-open')) {\n notify(\n 'Restart Numara to finish updating. Restart Now'\n )\n }\n } else {\n $('#dialog-about-updateStatus').innerHTML = status\n }\n })\n }\n}\n", "import { $, app } from './common'\n\nimport UIkit from 'uikit'\n\n/**\n * Show modal dialog for given id.\n *\n * @param {string} id Modal Id.\n */\nexport function showModal(id) {\n UIkit.modal(id, { bgClose: false, stack: true }).show()\n}\n\n/**\n * Show error dialog.\n *\n * @param {string} title Title of dialog box.\n * @param {string} e Error message to show.\n */\nexport function showError(title, error) {\n UIkit.util.on('#dialog-error', 'beforeshow', () => {\n $('#errTitle').innerHTML = title\n $('#errMsg').innerHTML = error\n })\n\n showModal('#dialog-error')\n}\n\n/**\n * Show app notifications.\n *\n * @param {string} msg Notification to show.\n * @param {string} stat Notification status: primary | success | warning | danger\n */\nexport function notify(msg, stat) {\n UIkit.notification({\n message: msg,\n pos: app.settings.notifyLocation,\n status: stat || 'primary',\n timeout: +app.settings.notifyDuration\n })\n}\n\n/**\n * Show confirmation dialog.\n *\n * @param {string} msg Confirmation message to show.\n * @param {function} action Function to run upon selecting Yes.\n */\nexport function confirm(msg, action) {\n $('#confirmMsg').innerHTML = msg\n\n showModal('#dialog-confirm')\n\n const yesAction = (event) => {\n action()\n\n event.stopPropagation()\n\n UIkit.modal('#dialog-confirm').hide()\n\n $('#confirm-yes').removeEventListener('click', yesAction)\n }\n\n $('#confirm-yes').addEventListener('click', yesAction)\n\n UIkit.util.on('#dialog-confirm', 'hidden', () => {\n $('#confirm-yes').removeEventListener('click', yesAction)\n })\n}\n", "import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.4.4\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n", "import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 ao\u00FBt 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 d\u00EDa\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"ma\u00F1ana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n", "import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n", "// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n", "import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n", "import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n", "/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n", "/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n", "import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n", "import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n", "import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n", "import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n", "import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nlet weekInfoCache = {};\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache[locString];\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n weekInfoCache[locString] = data;\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\n\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n", "/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n", "import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n", "import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n", "import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n", "export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n", "import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n", "import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 \u2013 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 \u2013 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7\u20138 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 \u2013 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 \u2013 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' \u2013 '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" \u2013 \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n", "import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '\u0661'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabi\u02BB I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> '\u0627\u0644\u0627\u062B\u0646\u064A\u0646'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ '\u1014\u1036\u1014\u1000\u103A', '\u100A\u1014\u1031' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant J\u00E9sus-Christ', 'apr\u00E8s J\u00E9sus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n", "import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n", "import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport function explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n", "const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n", "// configuration\nexport { config } from './configReadonly.js';\n\n// functions and constants\nexport * from './pureFunctionsAny.generated.js';\nexport * from './impureFunctionsAny.generated.js';\nexport * from './typeChecks.js';\n\n// error classes\nexport { IndexError } from '../error/IndexError.js';\nexport { DimensionError } from '../error/DimensionError.js';\nexport { ArgumentsError } from '../error/ArgumentsError.js';\n\n// dependency groups\nexport * from './dependenciesAny.generated.js';\n\n// factory functions\nexport * from '../factoriesAny.js';\n\n// core\nexport { create } from '../core/create.js';\nexport { factory } from '../utils/factory.js';", "function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };", "export var DEFAULT_CONFIG = {\n // minimum relative difference between two compared values,\n // used by all comparison functions\n relTol: 1e-12,\n // minimum absolute difference between two compared values,\n // used by all comparison functions\n absTol: 1e-15,\n // type of default matrix output. Choose 'matrix' (default) or 'array'\n matrix: 'Matrix',\n // type of default number output. Choose 'number' (default) 'BigNumber', 'bigint', or 'Fraction'\n number: 'number',\n // type of fallback used for config { number: 'bigint' } when a value cannot be represented\n // in the configured numeric type. Choose 'number' (default) or 'BigNumber'.\n numberFallback: 'number',\n // number of significant digits in BigNumbers\n precision: 64,\n // predictable output type of functions. When true, output type depends only\n // on the input types. When false (default), output type can vary depending\n // on input values. For example `math.sqrt(-4)` returns `complex('2i')` when\n // predictable is false, and returns `NaN` when true.\n predictable: false,\n // random seed for seeded pseudo random number generation\n // null = randomly seed\n randomSeed: null\n};", "import { clone, deepExtend } from '../../utils/object.js';\nimport { DEFAULT_CONFIG } from '../config.js';\nexport var MATRIX_OPTIONS = ['Matrix', 'Array']; // valid values for option matrix\nexport var NUMBER_OPTIONS = ['number', 'BigNumber', 'Fraction']; // valid values for option number\n\nexport function configFactory(config, emit) {\n /**\n * Set configuration options for math.js, and get current options.\n * Will emit a 'config' event, with arguments (curr, prev, changes).\n *\n * This function is only available on a mathjs instance created using `create`.\n *\n * Syntax:\n *\n * math.config(config: Object): Object\n *\n * Examples:\n *\n *\n * import { create, all } from 'mathjs'\n *\n * // create a mathjs instance\n * const math = create(all)\n *\n * math.config().number // outputs 'number'\n * math.evaluate('0.4') // outputs number 0.4\n * math.config({number: 'Fraction'})\n * math.evaluate('0.4') // outputs Fraction 2/5\n *\n * @param {Object} [options] Available options:\n * {number} relTol\n * Minimum relative difference between two\n * compared values, used by all comparison functions.\n * {number} absTol\n * Minimum absolute difference between two\n * compared values, used by all comparison functions.\n * {string} matrix\n * A string 'Matrix' (default) or 'Array'.\n * {string} number\n * A string 'number' (default), 'BigNumber', 'bigint', or 'Fraction'\n * {number} precision\n * The number of significant digits for BigNumbers.\n * Not applicable for Numbers.\n * {string} parenthesis\n * How to display parentheses in LaTeX and string\n * output.\n * {string} randomSeed\n * Random seed for seeded pseudo random number generator.\n * Set to null to randomly seed.\n * @return {Object} Returns the current configuration\n */\n function _config(options) {\n if (options) {\n if (options.epsilon !== undefined) {\n // this if is only for backwards compatibility, it can be removed in the future.\n console.warn('Warning: The configuration option \"epsilon\" is deprecated. Use \"relTol\" and \"absTol\" instead.');\n var optionsFix = clone(options);\n optionsFix.relTol = options.epsilon;\n optionsFix.absTol = options.epsilon * 1e-3;\n delete optionsFix.epsilon;\n return _config(optionsFix);\n }\n var prev = clone(config);\n\n // validate some of the options\n validateOption(options, 'matrix', MATRIX_OPTIONS);\n validateOption(options, 'number', NUMBER_OPTIONS);\n\n // merge options\n deepExtend(config, options);\n var curr = clone(config);\n var changes = clone(options);\n\n // emit 'config' event\n emit('config', curr, prev, changes);\n return curr;\n } else {\n return clone(config);\n }\n }\n\n // attach the valid options to the function so they can be extended\n _config.MATRIX_OPTIONS = MATRIX_OPTIONS;\n _config.NUMBER_OPTIONS = NUMBER_OPTIONS;\n\n // attach the config properties as readonly properties to the config function\n Object.keys(DEFAULT_CONFIG).forEach(key => {\n Object.defineProperty(_config, key, {\n get: () => config[key],\n enumerable: true,\n configurable: true\n });\n });\n return _config;\n}\n\n/**\n * Validate an option\n * @param {Object} options Object with options\n * @param {string} name Name of the option to validate\n * @param {Array.} values Array with valid values for this option\n */\nfunction validateOption(options, name, values) {\n if (options[name] !== undefined && !values.includes(options[name])) {\n // unknown value\n console.warn('Warning: Unknown value \"' + options[name] + '\" for configuration option \"' + name + '\". ' + 'Available options: ' + values.map(value => JSON.stringify(value)).join(', ') + '.');\n }\n}", "import { isBigNumber, isObject } from './is.js';\n\n/**\n * Clone an object\n *\n * clone(x)\n *\n * Can clone any primitive type, array, and object.\n * If x has a function clone, this function will be invoked to clone the object.\n *\n * @param {*} x\n * @return {*} clone\n */\nexport function clone(x) {\n var type = typeof x;\n\n // immutable primitive types\n if (type === 'number' || type === 'bigint' || type === 'string' || type === 'boolean' || x === null || x === undefined) {\n return x;\n }\n\n // use clone function of the object when available\n if (typeof x.clone === 'function') {\n return x.clone();\n }\n\n // array\n if (Array.isArray(x)) {\n return x.map(function (value) {\n return clone(value);\n });\n }\n if (x instanceof Date) return new Date(x.valueOf());\n if (isBigNumber(x)) return x; // bignumbers are immutable\n\n // object\n if (isObject(x)) {\n return mapObject(x, clone);\n }\n throw new TypeError(\"Cannot clone: unknown type of value (value: \".concat(x, \")\"));\n}\n\n/**\n * Apply map to all properties of an object\n * @param {Object} object\n * @param {function} callback\n * @return {Object} Returns a copy of the object with mapped properties\n */\nexport function mapObject(object, callback) {\n var clone = {};\n for (var key in object) {\n if (hasOwnProperty(object, key)) {\n clone[key] = callback(object[key]);\n }\n }\n return clone;\n}\n\n/**\n * Extend object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @return {Object} a\n */\nexport function extend(a, b) {\n for (var prop in b) {\n if (hasOwnProperty(b, prop)) {\n a[prop] = b[prop];\n }\n }\n return a;\n}\n\n/**\n * Deep extend an object a with the properties of object b\n * @param {Object} a\n * @param {Object} b\n * @returns {Object}\n */\nexport function deepExtend(a, b) {\n // TODO: add support for Arrays to deepExtend\n if (Array.isArray(b)) {\n throw new TypeError('Arrays are not supported by deepExtend');\n }\n for (var prop in b) {\n // We check against prop not being in Object.prototype or Function.prototype\n // to prevent polluting for example Object.__proto__.\n if (hasOwnProperty(b, prop) && !(prop in Object.prototype) && !(prop in Function.prototype)) {\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n if (a[prop] && a[prop].constructor === Object) {\n deepExtend(a[prop], b[prop]);\n } else {\n a[prop] = b[prop];\n }\n } else if (Array.isArray(b[prop])) {\n throw new TypeError('Arrays are not supported by deepExtend');\n } else {\n a[prop] = b[prop];\n }\n }\n }\n return a;\n}\n\n/**\n * Deep test equality of all fields in two pairs of arrays or objects.\n * Compares values and functions strictly (ie. 2 is not the same as '2').\n * @param {Array | Object} a\n * @param {Array | Object} b\n * @returns {boolean}\n */\nexport function deepStrictEqual(a, b) {\n var prop, i, len;\n if (Array.isArray(a)) {\n if (!Array.isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (i = 0, len = a.length; i < len; i++) {\n if (!deepStrictEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n } else if (typeof a === 'function') {\n return a === b;\n } else if (a instanceof Object) {\n if (Array.isArray(b) || !(b instanceof Object)) {\n return false;\n }\n for (prop in a) {\n // noinspection JSUnfilteredForInLoop\n if (!(prop in b) || !deepStrictEqual(a[prop], b[prop])) {\n return false;\n }\n }\n for (prop in b) {\n // noinspection JSUnfilteredForInLoop\n if (!(prop in a)) {\n return false;\n }\n }\n return true;\n } else {\n return a === b;\n }\n}\n\n/**\n * Recursively flatten a nested object.\n * @param {Object} nestedObject\n * @return {Object} Returns the flattened object\n */\nexport function deepFlatten(nestedObject) {\n var flattenedObject = {};\n _deepFlatten(nestedObject, flattenedObject);\n return flattenedObject;\n}\n\n// helper function used by deepFlatten\nfunction _deepFlatten(nestedObject, flattenedObject) {\n for (var prop in nestedObject) {\n if (hasOwnProperty(nestedObject, prop)) {\n var value = nestedObject[prop];\n if (typeof value === 'object' && value !== null) {\n _deepFlatten(value, flattenedObject);\n } else {\n flattenedObject[prop] = value;\n }\n }\n }\n}\n\n/**\n * Test whether the current JavaScript engine supports Object.defineProperty\n * @returns {boolean} returns true if supported\n */\nexport function canDefineProperty() {\n // test needed for broken IE8 implementation\n try {\n if (Object.defineProperty) {\n Object.defineProperty({}, 'x', {\n get: function get() {\n return null;\n }\n });\n return true;\n }\n } catch (e) {}\n return false;\n}\n\n/**\n * Attach a lazy loading property to a constant.\n * The given function `fn` is called once when the property is first requested.\n *\n * @param {Object} object Object where to add the property\n * @param {string} prop Property name\n * @param {Function} valueResolver Function returning the property value. Called\n * without arguments.\n */\nexport function lazy(object, prop, valueResolver) {\n var _uninitialized = true;\n var _value;\n Object.defineProperty(object, prop, {\n get: function get() {\n if (_uninitialized) {\n _value = valueResolver();\n _uninitialized = false;\n }\n return _value;\n },\n set: function set(value) {\n _value = value;\n _uninitialized = false;\n },\n configurable: true,\n enumerable: true\n });\n}\n\n/**\n * Traverse a path into an object.\n * When a namespace is missing, it will be created\n * @param {Object} object\n * @param {string | string[]} path A dot separated string like 'name.space'\n * @return {Object} Returns the object at the end of the path\n */\nexport function traverse(object, path) {\n if (path && typeof path === 'string') {\n return traverse(object, path.split('.'));\n }\n var obj = object;\n if (path) {\n for (var i = 0; i < path.length; i++) {\n var key = path[i];\n if (!(key in obj)) {\n obj[key] = {};\n }\n obj = obj[key];\n }\n }\n return obj;\n}\n\n/**\n * A safe hasOwnProperty\n * @param {Object} object\n * @param {string} property\n */\nexport function hasOwnProperty(object, property) {\n return object && Object.hasOwnProperty.call(object, property);\n}\n\n/**\n * Test whether an object is a factory. a factory has fields:\n *\n * - factory: function (type: Object, config: Object, load: function, typed: function [, math: Object]) (required)\n * - name: string (optional)\n * - path: string A dot separated path (optional)\n * - math: boolean If true (false by default), the math namespace is passed\n * as fifth argument of the factory function\n *\n * @param {*} object\n * @returns {boolean}\n */\nexport function isLegacyFactory(object) {\n return object && typeof object.factory === 'function';\n}\n\n/**\n * Get a nested property from an object\n * @param {Object} object\n * @param {string | string[]} path\n * @returns {Object}\n */\nexport function get(object, path) {\n if (typeof path === 'string') {\n if (isPath(path)) {\n return get(object, path.split('.'));\n } else {\n return object[path];\n }\n }\n var child = object;\n for (var i = 0; i < path.length; i++) {\n var key = path[i];\n child = child ? child[key] : undefined;\n }\n return child;\n}\n\n/**\n * Set a nested property in an object\n * Mutates the object itself\n * If the path doesn't exist, it will be created\n * @param {Object} object\n * @param {string | string[]} path\n * @param {*} value\n * @returns {Object}\n */\nexport function set(object, path, value) {\n if (typeof path === 'string') {\n if (isPath(path)) {\n return set(object, path.split('.'), value);\n } else {\n object[path] = value;\n return object;\n }\n }\n var child = object;\n for (var i = 0; i < path.length - 1; i++) {\n var key = path[i];\n if (child[key] === undefined) {\n child[key] = {};\n }\n child = child[key];\n }\n if (path.length > 0) {\n var lastKey = path[path.length - 1];\n child[lastKey] = value;\n }\n return object;\n}\n\n/**\n * Create an object composed of the picked object properties\n * @param {Object} object\n * @param {string[]} properties\n * @param {function} [transform] Optional value to transform a value when picking it\n * @return {Object}\n */\nexport function pick(object, properties, transform) {\n var copy = {};\n for (var i = 0; i < properties.length; i++) {\n var key = properties[i];\n var value = get(object, key);\n if (value !== undefined) {\n set(copy, key, transform ? transform(value, key) : value);\n }\n }\n return copy;\n}\n\n/**\n * Shallow version of pick, creating an object composed of the picked object properties\n * but not for nested properties\n * @param {Object} object\n * @param {string[]} properties\n * @return {Object}\n */\nexport function pickShallow(object, properties) {\n var copy = {};\n for (var i = 0; i < properties.length; i++) {\n var key = properties[i];\n var value = object[key];\n if (value !== undefined) {\n copy[key] = value;\n }\n }\n return copy;\n}\n\n// helper function to test whether a string contains a path like 'user.name'\nfunction isPath(str) {\n return str.includes('.');\n}", "// type checks for all known types\n//\n// note that:\n//\n// - check by duck-typing on a property like `isUnit`, instead of checking instanceof.\n// instanceof cannot be used because that would not allow to pass data from\n// one instance of math.js to another since each has it's own instance of Unit.\n// - check the `isUnit` property via the constructor, so there will be no\n// matches for \"fake\" instances like plain objects with a property `isUnit`.\n// That is important for security reasons.\n// - It must not be possible to override the type checks used internally,\n// for security reasons, so these functions are not exposed in the expression\n// parser.\n\nexport function isNumber(x) {\n return typeof x === 'number';\n}\nexport function isBigNumber(x) {\n if (!x || typeof x !== 'object' || typeof x.constructor !== 'function') {\n return false;\n }\n if (x.isBigNumber === true && typeof x.constructor.prototype === 'object' && x.constructor.prototype.isBigNumber === true) {\n return true;\n }\n if (typeof x.constructor.isDecimal === 'function' && x.constructor.isDecimal(x) === true) {\n return true;\n }\n return false;\n}\nexport function isBigInt(x) {\n return typeof x === 'bigint';\n}\nexport function isComplex(x) {\n return x && typeof x === 'object' && Object.getPrototypeOf(x).isComplex === true || false;\n}\nexport function isFraction(x) {\n return x && typeof x === 'object' && Object.getPrototypeOf(x).isFraction === true || false;\n}\nexport function isUnit(x) {\n return x && x.constructor.prototype.isUnit === true || false;\n}\nexport function isString(x) {\n return typeof x === 'string';\n}\nexport var isArray = Array.isArray;\nexport function isMatrix(x) {\n return x && x.constructor.prototype.isMatrix === true || false;\n}\n\n/**\n * Test whether a value is a collection: an Array or Matrix\n * @param {*} x\n * @returns {boolean} isCollection\n */\nexport function isCollection(x) {\n return Array.isArray(x) || isMatrix(x);\n}\nexport function isDenseMatrix(x) {\n return x && x.isDenseMatrix && x.constructor.prototype.isMatrix === true || false;\n}\nexport function isSparseMatrix(x) {\n return x && x.isSparseMatrix && x.constructor.prototype.isMatrix === true || false;\n}\nexport function isRange(x) {\n return x && x.constructor.prototype.isRange === true || false;\n}\nexport function isIndex(x) {\n return x && x.constructor.prototype.isIndex === true || false;\n}\nexport function isBoolean(x) {\n return typeof x === 'boolean';\n}\nexport function isResultSet(x) {\n return x && x.constructor.prototype.isResultSet === true || false;\n}\nexport function isHelp(x) {\n return x && x.constructor.prototype.isHelp === true || false;\n}\nexport function isFunction(x) {\n return typeof x === 'function';\n}\nexport function isDate(x) {\n return x instanceof Date;\n}\nexport function isRegExp(x) {\n return x instanceof RegExp;\n}\nexport function isObject(x) {\n return !!(x && typeof x === 'object' && x.constructor === Object && !isComplex(x) && !isFraction(x));\n}\nexport function isNull(x) {\n return x === null;\n}\nexport function isUndefined(x) {\n return x === undefined;\n}\nexport function isAccessorNode(x) {\n return x && x.isAccessorNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isArrayNode(x) {\n return x && x.isArrayNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isAssignmentNode(x) {\n return x && x.isAssignmentNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isBlockNode(x) {\n return x && x.isBlockNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isConditionalNode(x) {\n return x && x.isConditionalNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isConstantNode(x) {\n return x && x.isConstantNode === true && x.constructor.prototype.isNode === true || false;\n}\n\n/* Very specialized: returns true for those nodes which in the numerator of\n a fraction means that the division in that fraction has precedence over implicit\n multiplication, e.g. -2/3 x parses as (-2/3) x and 3/4 x parses as (3/4) x but\n 6!/8 x parses as 6! / (8x). It is located here because it is shared between\n parse.js and OperatorNode.js (for parsing and printing, respectively).\n\n This should *not* be exported from mathjs, unlike most of the tests here.\n Its name does not start with 'is' to prevent utils/snapshot.js from thinking\n it should be exported.\n*/\nexport function rule2Node(node) {\n return isConstantNode(node) || isOperatorNode(node) && node.args.length === 1 && isConstantNode(node.args[0]) && '-+~'.includes(node.op);\n}\nexport function isFunctionAssignmentNode(x) {\n return x && x.isFunctionAssignmentNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isFunctionNode(x) {\n return x && x.isFunctionNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isIndexNode(x) {\n return x && x.isIndexNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isNode(x) {\n return x && x.isNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isObjectNode(x) {\n return x && x.isObjectNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isOperatorNode(x) {\n return x && x.isOperatorNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isParenthesisNode(x) {\n return x && x.isParenthesisNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isRangeNode(x) {\n return x && x.isRangeNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isRelationalNode(x) {\n return x && x.isRelationalNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isSymbolNode(x) {\n return x && x.isSymbolNode === true && x.constructor.prototype.isNode === true || false;\n}\nexport function isChain(x) {\n return x && x.constructor.prototype.isChain === true || false;\n}\nexport function typeOf(x) {\n var t = typeof x;\n if (t === 'object') {\n if (x === null) return 'null';\n if (isBigNumber(x)) return 'BigNumber'; // Special: weird mashup with Decimal\n if (x.constructor && x.constructor.name) return x.constructor.name;\n return 'Object'; // just in case\n }\n return t; // can be 'string', 'number', 'boolean', 'function', 'bigint', ...\n}", "export { createTyped } from './core/function/typed.js';\nexport { createResultSet } from './type/resultset/ResultSet.js';\nexport { createBigNumberClass } from './type/bignumber/BigNumber.js';\nexport { createComplexClass } from './type/complex/Complex.js';\nexport { createFractionClass } from './type/fraction/Fraction.js';\nexport { createRangeClass } from './type/matrix/Range.js';\nexport { createMatrixClass } from './type/matrix/Matrix.js';\nexport { createDenseMatrixClass } from './type/matrix/DenseMatrix.js';\nexport { createClone } from './function/utils/clone.js';\nexport { createIsInteger } from './function/utils/isInteger.js';\nexport { createIsNegative } from './function/utils/isNegative.js';\nexport { createIsNumeric } from './function/utils/isNumeric.js';\nexport { createHasNumericValue } from './function/utils/hasNumericValue.js';\nexport { createIsPositive } from './function/utils/isPositive.js';\nexport { createIsZero } from './function/utils/isZero.js';\nexport { createIsNaN } from './function/utils/isNaN.js';\nexport { createTypeOf } from './function/utils/typeOf.js';\nexport { createEqualScalar } from './function/relational/equalScalar.js';\nexport { createSparseMatrixClass } from './type/matrix/SparseMatrix.js';\nexport { createNumber } from './type/number.js';\nexport { createBigint } from './type/bigint.js';\nexport { createString } from './type/string.js';\nexport { createBoolean } from './type/boolean.js';\nexport { createBignumber } from './type/bignumber/function/bignumber.js';\nexport { createComplex } from './type/complex/function/complex.js';\nexport { createFraction } from './type/fraction/function/fraction.js';\nexport { createMatrix } from './type/matrix/function/matrix.js';\nexport { createMatrixFromFunction } from './function/matrix/matrixFromFunction.js';\nexport { createMatrixFromRows } from './function/matrix/matrixFromRows.js';\nexport { createMatrixFromColumns } from './function/matrix/matrixFromColumns.js';\nexport { createSplitUnit } from './type/unit/function/splitUnit.js';\nexport { createUnaryMinus } from './function/arithmetic/unaryMinus.js';\nexport { createUnaryPlus } from './function/arithmetic/unaryPlus.js';\nexport { createAbs } from './function/arithmetic/abs.js';\nexport { createApply } from './function/matrix/apply.js';\nexport { createAddScalar } from './function/arithmetic/addScalar.js';\nexport { createSubtractScalar } from './function/arithmetic/subtractScalar.js';\nexport { createCbrt } from './function/arithmetic/cbrt.js';\nexport { createCeil } from './function/arithmetic/ceil.js';\nexport { createCube } from './function/arithmetic/cube.js';\nexport { createExp } from './function/arithmetic/exp.js';\nexport { createExpm1 } from './function/arithmetic/expm1.js';\nexport { createFix } from './function/arithmetic/fix.js';\nexport { createFloor } from './function/arithmetic/floor.js';\nexport { createGcd } from './function/arithmetic/gcd.js';\nexport { createLcm } from './function/arithmetic/lcm.js';\nexport { createLog10 } from './function/arithmetic/log10.js';\nexport { createLog2 } from './function/arithmetic/log2.js';\nexport { createMod } from './function/arithmetic/mod.js';\nexport { createMultiplyScalar } from './function/arithmetic/multiplyScalar.js';\nexport { createMultiply } from './function/arithmetic/multiply.js';\nexport { createNthRoot } from './function/arithmetic/nthRoot.js';\nexport { createSign } from './function/arithmetic/sign.js';\nexport { createSqrt } from './function/arithmetic/sqrt.js';\nexport { createSquare } from './function/arithmetic/square.js';\nexport { createSubtract } from './function/arithmetic/subtract.js';\nexport { createXgcd } from './function/arithmetic/xgcd.js';\nexport { createInvmod } from './function/arithmetic/invmod.js';\nexport { createDotMultiply } from './function/arithmetic/dotMultiply.js';\nexport { createBitAnd } from './function/bitwise/bitAnd.js';\nexport { createBitNot } from './function/bitwise/bitNot.js';\nexport { createBitOr } from './function/bitwise/bitOr.js';\nexport { createBitXor } from './function/bitwise/bitXor.js';\nexport { createArg } from './function/complex/arg.js';\nexport { createConj } from './function/complex/conj.js';\nexport { createIm } from './function/complex/im.js';\nexport { createRe } from './function/complex/re.js';\nexport { createNot } from './function/logical/not.js';\nexport { createOr } from './function/logical/or.js';\nexport { createXor } from './function/logical/xor.js';\nexport { createConcat } from './function/matrix/concat.js';\nexport { createColumn } from './function/matrix/column.js';\nexport { createCount } from './function/matrix/count.js';\nexport { createCross } from './function/matrix/cross.js';\nexport { createDiag } from './function/matrix/diag.js';\nexport { createFilter } from './function/matrix/filter.js';\nexport { createFlatten } from './function/matrix/flatten.js';\nexport { createForEach } from './function/matrix/forEach.js';\nexport { createGetMatrixDataType } from './function/matrix/getMatrixDataType.js';\nexport { createIdentity } from './function/matrix/identity.js';\nexport { createKron } from './function/matrix/kron.js';\nexport { createMap } from './function/matrix/map.js';\nexport { createDiff } from './function/matrix/diff.js';\nexport { createOnes } from './function/matrix/ones.js';\nexport { createRange } from './function/matrix/range.js';\nexport { createReshape } from './function/matrix/reshape.js';\nexport { createResize } from './function/matrix/resize.js';\nexport { createRotate } from './function/matrix/rotate.js';\nexport { createRotationMatrix } from './function/matrix/rotationMatrix.js';\nexport { createRow } from './function/matrix/row.js';\nexport { createSize } from './function/matrix/size.js';\nexport { createSqueeze } from './function/matrix/squeeze.js';\nexport { createSubset } from './function/matrix/subset.js';\nexport { createTranspose } from './function/matrix/transpose.js';\nexport { createCtranspose } from './function/matrix/ctranspose.js';\nexport { createZeros } from './function/matrix/zeros.js';\nexport { createFft } from './function/matrix/fft.js';\nexport { createIfft } from './function/matrix/ifft.js';\nexport { createSolveODE } from './function/numeric/solveODE.js';\nexport { createErf } from './function/special/erf.js';\nexport { createZeta } from './function/special/zeta.js';\nexport { createMode } from './function/statistics/mode.js';\nexport { createProd } from './function/statistics/prod.js';\nexport { createFormat } from './function/string/format.js';\nexport { createBin } from './function/string/bin.js';\nexport { createOct } from './function/string/oct.js';\nexport { createHex } from './function/string/hex.js';\nexport { createPrint } from './function/string/print.js';\nexport { createTo } from './function/unit/to.js';\nexport { createIsPrime } from './function/utils/isPrime.js';\nexport { createNumeric } from './function/utils/numeric.js';\nexport { createDivideScalar } from './function/arithmetic/divideScalar.js';\nexport { createPow } from './function/arithmetic/pow.js';\nexport { createRound } from './function/arithmetic/round.js';\nexport { createLog } from './function/arithmetic/log.js';\nexport { createLog1p } from './function/arithmetic/log1p.js';\nexport { createNthRoots } from './function/arithmetic/nthRoots.js';\nexport { createDotPow } from './function/arithmetic/dotPow.js';\nexport { createDotDivide } from './function/arithmetic/dotDivide.js';\nexport { createLsolve } from './function/algebra/solver/lsolve.js';\nexport { createUsolve } from './function/algebra/solver/usolve.js';\nexport { createLsolveAll } from './function/algebra/solver/lsolveAll.js';\nexport { createUsolveAll } from './function/algebra/solver/usolveAll.js';\nexport { createLeftShift } from './function/bitwise/leftShift.js';\nexport { createRightArithShift } from './function/bitwise/rightArithShift.js';\nexport { createRightLogShift } from './function/bitwise/rightLogShift.js';\nexport { createAnd } from './function/logical/and.js';\nexport { createCompare } from './function/relational/compare.js';\nexport { createCompareNatural } from './function/relational/compareNatural.js';\nexport { createCompareText } from './function/relational/compareText.js';\nexport { createEqual } from './function/relational/equal.js';\nexport { createEqualText } from './function/relational/equalText.js';\nexport { createSmaller } from './function/relational/smaller.js';\nexport { createSmallerEq } from './function/relational/smallerEq.js';\nexport { createLarger } from './function/relational/larger.js';\nexport { createLargerEq } from './function/relational/largerEq.js';\nexport { createDeepEqual } from './function/relational/deepEqual.js';\nexport { createUnequal } from './function/relational/unequal.js';\nexport { createPartitionSelect } from './function/matrix/partitionSelect.js';\nexport { createSort } from './function/matrix/sort.js';\nexport { createMax } from './function/statistics/max.js';\nexport { createMin } from './function/statistics/min.js';\nexport { createImmutableDenseMatrixClass } from './type/matrix/ImmutableDenseMatrix.js';\nexport { createIndexClass } from './type/matrix/MatrixIndex.js';\nexport { createFibonacciHeapClass } from './type/matrix/FibonacciHeap.js';\nexport { createSpaClass } from './type/matrix/Spa.js';\nexport { createUnitClass } from './type/unit/Unit.js';\nexport { createUnitFunction } from './type/unit/function/unit.js';\nexport { createSparse } from './type/matrix/function/sparse.js';\nexport { createCreateUnit } from './type/unit/function/createUnit.js';\nexport { createAcos } from './function/trigonometry/acos.js';\nexport { createAcosh } from './function/trigonometry/acosh.js';\nexport { createAcot } from './function/trigonometry/acot.js';\nexport { createAcoth } from './function/trigonometry/acoth.js';\nexport { createAcsc } from './function/trigonometry/acsc.js';\nexport { createAcsch } from './function/trigonometry/acsch.js';\nexport { createAsec } from './function/trigonometry/asec.js';\nexport { createAsech } from './function/trigonometry/asech.js';\nexport { createAsin } from './function/trigonometry/asin.js';\nexport { createAsinh } from './function/trigonometry/asinh.js';\nexport { createAtan } from './function/trigonometry/atan.js';\nexport { createAtan2 } from './function/trigonometry/atan2.js';\nexport { createAtanh } from './function/trigonometry/atanh.js';\nexport { createCos } from './function/trigonometry/cos.js';\nexport { createCosh } from './function/trigonometry/cosh.js';\nexport { createCot } from './function/trigonometry/cot.js';\nexport { createCoth } from './function/trigonometry/coth.js';\nexport { createCsc } from './function/trigonometry/csc.js';\nexport { createCsch } from './function/trigonometry/csch.js';\nexport { createSec } from './function/trigonometry/sec.js';\nexport { createSech } from './function/trigonometry/sech.js';\nexport { createSin } from './function/trigonometry/sin.js';\nexport { createSinh } from './function/trigonometry/sinh.js';\nexport { createTan } from './function/trigonometry/tan.js';\nexport { createTanh } from './function/trigonometry/tanh.js';\nexport { createSetCartesian } from './function/set/setCartesian.js';\nexport { createSetDifference } from './function/set/setDifference.js';\nexport { createSetDistinct } from './function/set/setDistinct.js';\nexport { createSetIntersect } from './function/set/setIntersect.js';\nexport { createSetIsSubset } from './function/set/setIsSubset.js';\nexport { createSetMultiplicity } from './function/set/setMultiplicity.js';\nexport { createSetPowerset } from './function/set/setPowerset.js';\nexport { createSetSize } from './function/set/setSize.js';\nexport { createSetSymDifference } from './function/set/setSymDifference.js';\nexport { createSetUnion } from './function/set/setUnion.js';\nexport { createAdd } from './function/arithmetic/add.js';\nexport { createHypot } from './function/arithmetic/hypot.js';\nexport { createNorm } from './function/arithmetic/norm.js';\nexport { createDot } from './function/matrix/dot.js';\nexport { createTrace } from './function/matrix/trace.js';\nexport { createIndex } from './type/matrix/function/index.js';\nexport { createNode } from './expression/node/Node.js';\nexport { createAccessorNode } from './expression/node/AccessorNode.js';\nexport { createArrayNode } from './expression/node/ArrayNode.js';\nexport { createAssignmentNode } from './expression/node/AssignmentNode.js';\nexport { createBlockNode } from './expression/node/BlockNode.js';\nexport { createConditionalNode } from './expression/node/ConditionalNode.js';\nexport { createConstantNode } from './expression/node/ConstantNode.js';\nexport { createFunctionAssignmentNode } from './expression/node/FunctionAssignmentNode.js';\nexport { createIndexNode } from './expression/node/IndexNode.js';\nexport { createObjectNode } from './expression/node/ObjectNode.js';\nexport { createOperatorNode } from './expression/node/OperatorNode.js';\nexport { createParenthesisNode } from './expression/node/ParenthesisNode.js';\nexport { createRangeNode } from './expression/node/RangeNode.js';\nexport { createRelationalNode } from './expression/node/RelationalNode.js';\nexport { createSymbolNode } from './expression/node/SymbolNode.js';\nexport { createFunctionNode } from './expression/node/FunctionNode.js';\nexport { createParse } from './expression/parse.js';\nexport { createCompile } from './expression/function/compile.js';\nexport { createEvaluate } from './expression/function/evaluate.js';\nexport { createParserClass } from './expression/Parser.js';\nexport { createParser } from './expression/function/parser.js';\nexport { createLup } from './function/algebra/decomposition/lup.js';\nexport { createQr } from './function/algebra/decomposition/qr.js';\nexport { createSlu } from './function/algebra/decomposition/slu.js';\nexport { createLusolve } from './function/algebra/solver/lusolve.js';\nexport { createPolynomialRoot } from './function/algebra/polynomialRoot.js';\nexport { createHelpClass } from './expression/Help.js';\nexport { createChainClass } from './type/chain/Chain.js';\nexport { createHelp } from './expression/function/help.js';\nexport { createChain } from './type/chain/function/chain.js';\nexport { createDet } from './function/matrix/det.js';\nexport { createInv } from './function/matrix/inv.js';\nexport { createPinv } from './function/matrix/pinv.js';\nexport { createEigs } from './function/matrix/eigs.js';\nexport { createExpm } from './function/matrix/expm.js';\nexport { createSqrtm } from './function/matrix/sqrtm.js';\nexport { createSylvester } from './function/algebra/sylvester.js';\nexport { createSchur } from './function/algebra/decomposition/schur.js';\nexport { createLyap } from './function/algebra/lyap.js';\nexport { createDivide } from './function/arithmetic/divide.js';\nexport { createDistance } from './function/geometry/distance.js';\nexport { createIntersect } from './function/geometry/intersect.js';\nexport { createSum } from './function/statistics/sum.js';\nexport { createCumSum } from './function/statistics/cumsum.js';\nexport { createMean } from './function/statistics/mean.js';\nexport { createMedian } from './function/statistics/median.js';\nexport { createMad } from './function/statistics/mad.js';\nexport { createVariance } from './function/statistics/variance.js';\nexport { createQuantileSeq } from './function/statistics/quantileSeq.js';\nexport { createStd } from './function/statistics/std.js';\nexport { createCorr } from './function/statistics/corr.js';\nexport { createCombinations } from './function/probability/combinations.js';\nexport { createCombinationsWithRep } from './function/probability/combinationsWithRep.js';\nexport { createGamma } from './function/probability/gamma.js';\nexport { createLgamma } from './function/probability/lgamma.js';\nexport { createFactorial } from './function/probability/factorial.js';\nexport { createKldivergence } from './function/probability/kldivergence.js';\nexport { createMultinomial } from './function/probability/multinomial.js';\nexport { createPermutations } from './function/probability/permutations.js';\nexport { createPickRandom } from './function/probability/pickRandom.js';\nexport { createRandom } from './function/probability/random.js';\nexport { createRandomInt } from './function/probability/randomInt.js';\nexport { createStirlingS2 } from './function/combinatorics/stirlingS2.js';\nexport { createBellNumbers } from './function/combinatorics/bellNumbers.js';\nexport { createCatalan } from './function/combinatorics/catalan.js';\nexport { createComposition } from './function/combinatorics/composition.js';\nexport { createLeafCount } from './function/algebra/leafCount.js';\nexport { createSimplify } from './function/algebra/simplify.js';\nexport { createSimplifyConstant } from './function/algebra/simplifyConstant.js';\nexport { createSimplifyCore } from './function/algebra/simplifyCore.js';\nexport { createResolve } from './function/algebra/resolve.js';\nexport { createSymbolicEqual } from './function/algebra/symbolicEqual.js';\nexport { createDerivative } from './function/algebra/derivative.js';\nexport { createRationalize } from './function/algebra/rationalize.js';\nexport { createZpk2tf } from './function/signal/zpk2tf.js';\nexport { createFreqz } from './function/signal/freqz.js';\nexport { createReviver } from './json/reviver.js';\nexport { createReplacer } from './json/replacer.js';\nexport { createE, createUppercaseE, createFalse, createI, createInfinity, createLN10, createLN2, createLOG10E, createLOG2E, createNaN, createNull, createPhi, createPi, createUppercasePi, createSQRT1_2,\n// eslint-disable-line camelcase\ncreateSQRT2, createTau, createTrue, createVersion } from './constants.js';\nexport { createAtomicMass, createAvogadro, createBohrMagneton, createBohrRadius, createBoltzmann, createClassicalElectronRadius, createConductanceQuantum, createCoulomb, createDeuteronMass, createEfimovFactor, createElectricConstant, createElectronMass, createElementaryCharge, createFaraday, createFermiCoupling, createFineStructure, createFirstRadiation, createGasConstant, createGravitationConstant, createGravity, createHartreeEnergy, createInverseConductanceQuantum, createKlitzing, createLoschmidt, createMagneticConstant, createMagneticFluxQuantum, createMolarMass, createMolarMassC12, createMolarPlanckConstant, createMolarVolume, createNeutronMass, createNuclearMagneton, createPlanckCharge, createPlanckConstant, createPlanckLength, createPlanckMass, createPlanckTemperature, createPlanckTime, createProtonMass, createQuantumOfCirculation, createReducedPlanckConstant, createRydberg, createSackurTetrode, createSecondRadiation, createSpeedOfLight, createStefanBoltzmann, createThomsonCrossSection, createVacuumImpedance, createWeakMixingAngle, createWienDisplacement } from './type/unit/physicalConstants.js';\nexport { createApplyTransform } from './expression/transform/apply.transform.js';\nexport { createColumnTransform } from './expression/transform/column.transform.js';\nexport { createFilterTransform } from './expression/transform/filter.transform.js';\nexport { createForEachTransform } from './expression/transform/forEach.transform.js';\nexport { createIndexTransform } from './expression/transform/index.transform.js';\nexport { createMapTransform } from './expression/transform/map.transform.js';\nexport { createMaxTransform } from './expression/transform/max.transform.js';\nexport { createMeanTransform } from './expression/transform/mean.transform.js';\nexport { createMinTransform } from './expression/transform/min.transform.js';\nexport { createRangeTransform } from './expression/transform/range.transform.js';\nexport { createRowTransform } from './expression/transform/row.transform.js';\nexport { createSubsetTransform } from './expression/transform/subset.transform.js';\nexport { createConcatTransform } from './expression/transform/concat.transform.js';\nexport { createDiffTransform } from './expression/transform/diff.transform.js';\nexport { createStdTransform } from './expression/transform/std.transform.js';\nexport { createSumTransform } from './expression/transform/sum.transform.js';\nexport { createQuantileSeqTransform } from './expression/transform/quantileSeq.transform.js';\nexport { createCumSumTransform } from './expression/transform/cumsum.transform.js';\nexport { createVarianceTransform } from './expression/transform/variance.transform.js';\nexport { createPrintTransform } from './expression/transform/print.transform.js';\nexport { createAndTransform } from './expression/transform/and.transform.js';\nexport { createOrTransform } from './expression/transform/or.transform.js';\nexport { createBitAndTransform } from './expression/transform/bitAnd.transform.js';\nexport { createBitOrTransform } from './expression/transform/bitOr.transform.js';", "/**\n * Create a typed-function which checks the types of the arguments and\n * can match them against multiple provided signatures. The typed-function\n * automatically converts inputs in order to find a matching signature.\n * Typed functions throw informative errors in case of wrong input arguments.\n *\n * See the library [typed-function](https://github.com/josdejong/typed-function)\n * for detailed documentation.\n *\n * Syntax:\n *\n * math.typed(name, signatures) : function\n * math.typed(signatures) : function\n *\n * Examples:\n *\n * // create a typed function with multiple types per argument (type union)\n * const fn2 = typed({\n * 'number | boolean': function (b) {\n * return 'b is a number or boolean'\n * },\n * 'string, number | boolean': function (a, b) {\n * return 'a is a string, b is a number or boolean'\n * }\n * })\n *\n * // create a typed function with an any type argument\n * const log = typed({\n * 'string, any': function (event, data) {\n * console.log('event: ' + event + ', data: ' + JSON.stringify(data))\n * }\n * })\n *\n * @param {string} [name] Optional name for the typed-function\n * @param {Object} signatures Object with one or multiple function signatures\n * @returns {function} The created typed-function.\n */\n\nimport { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigNumber, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMatrix, isNode, isNull, isNumber, isObject, isObjectNode, isOperatorNode, isParenthesisNode, isRange, isRangeNode, isRelationalNode, isRegExp, isResultSet, isSparseMatrix, isString, isSymbolNode, isUndefined, isUnit, isBigInt } from '../../utils/is.js';\nimport typedFunction from 'typed-function';\nimport { digits } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { isMap } from '../../utils/map.js';\n\n// returns a new instance of typed-function\nvar _createTyped2 = function _createTyped() {\n // initially, return the original instance of typed-function\n // consecutively, return a new instance from typed.create.\n _createTyped2 = typedFunction.create;\n return typedFunction;\n};\nvar dependencies = ['?BigNumber', '?Complex', '?DenseMatrix', '?Fraction'];\n\n/**\n * Factory function for creating a new typed instance\n * @param {Object} dependencies Object with data types like Complex and BigNumber\n * @returns {Function}\n */\nexport var createTyped = /* #__PURE__ */factory('typed', dependencies, function createTyped(_ref) {\n var {\n BigNumber,\n Complex,\n DenseMatrix,\n Fraction\n } = _ref;\n // TODO: typed-function must be able to silently ignore signatures with unknown data types\n\n // get a new instance of typed-function\n var typed = _createTyped2();\n\n // define all types. The order of the types determines in which order function\n // arguments are type-checked (so for performance it's important to put the\n // most used types first).\n typed.clear();\n typed.addTypes([{\n name: 'number',\n test: isNumber\n }, {\n name: 'Complex',\n test: isComplex\n }, {\n name: 'BigNumber',\n test: isBigNumber\n }, {\n name: 'bigint',\n test: isBigInt\n }, {\n name: 'Fraction',\n test: isFraction\n }, {\n name: 'Unit',\n test: isUnit\n },\n // The following type matches a valid variable name, i.e., an alphanumeric\n // string starting with an alphabetic character. It is used (at least)\n // in the definition of the derivative() function, as the argument telling\n // what to differentiate over must (currently) be a variable.\n {\n name: 'identifier',\n test: s => isString && /^(?:[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-\\u1C88\\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-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\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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-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1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\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])(?:[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-\\u1C88\\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-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\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-\\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DA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9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F]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])*$/.test(s)\n }, {\n name: 'string',\n test: isString\n }, {\n name: 'Chain',\n test: isChain\n }, {\n name: 'Array',\n test: isArray\n }, {\n name: 'Matrix',\n test: isMatrix\n }, {\n name: 'DenseMatrix',\n test: isDenseMatrix\n }, {\n name: 'SparseMatrix',\n test: isSparseMatrix\n }, {\n name: 'Range',\n test: isRange\n }, {\n name: 'Index',\n test: isIndex\n }, {\n name: 'boolean',\n test: isBoolean\n }, {\n name: 'ResultSet',\n test: isResultSet\n }, {\n name: 'Help',\n test: isHelp\n }, {\n name: 'function',\n test: isFunction\n }, {\n name: 'Date',\n test: isDate\n }, {\n name: 'RegExp',\n test: isRegExp\n }, {\n name: 'null',\n test: isNull\n }, {\n name: 'undefined',\n test: isUndefined\n }, {\n name: 'AccessorNode',\n test: isAccessorNode\n }, {\n name: 'ArrayNode',\n test: isArrayNode\n }, {\n name: 'AssignmentNode',\n test: isAssignmentNode\n }, {\n name: 'BlockNode',\n test: isBlockNode\n }, {\n name: 'ConditionalNode',\n test: isConditionalNode\n }, {\n name: 'ConstantNode',\n test: isConstantNode\n }, {\n name: 'FunctionNode',\n test: isFunctionNode\n }, {\n name: 'FunctionAssignmentNode',\n test: isFunctionAssignmentNode\n }, {\n name: 'IndexNode',\n test: isIndexNode\n }, {\n name: 'Node',\n test: isNode\n }, {\n name: 'ObjectNode',\n test: isObjectNode\n }, {\n name: 'OperatorNode',\n test: isOperatorNode\n }, {\n name: 'ParenthesisNode',\n test: isParenthesisNode\n }, {\n name: 'RangeNode',\n test: isRangeNode\n }, {\n name: 'RelationalNode',\n test: isRelationalNode\n }, {\n name: 'SymbolNode',\n test: isSymbolNode\n }, {\n name: 'Map',\n test: isMap\n }, {\n name: 'Object',\n test: isObject\n } // order 'Object' last, it matches on other classes too\n ]);\n typed.addConversions([{\n from: 'number',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n\n // note: conversion from number to BigNumber can fail if x has >15 digits\n if (digits(x) > 15) {\n throw new TypeError('Cannot implicitly convert a number with >15 significant digits to BigNumber ' + '(value: ' + x + '). ' + 'Use function bignumber(x) to convert to BigNumber.');\n }\n return new BigNumber(x);\n }\n }, {\n from: 'number',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x, 0);\n }\n }, {\n from: 'BigNumber',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x.toNumber(), 0);\n }\n }, {\n from: 'bigint',\n to: 'number',\n convert: function convert(x) {\n if (x > Number.MAX_SAFE_INTEGER) {\n throw new TypeError('Cannot implicitly convert bigint to number: ' + 'value exceeds the max safe integer value (value: ' + x + ')');\n }\n return Number(x);\n }\n }, {\n from: 'bigint',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n return new BigNumber(x.toString());\n }\n }, {\n from: 'bigint',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n return new Fraction(x.toString());\n }\n }, {\n from: 'Fraction',\n to: 'BigNumber',\n convert: function convert(x) {\n 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.');\n }\n }, {\n from: 'Fraction',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n return new Complex(x.valueOf(), 0);\n }\n }, {\n from: 'number',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n var f = new Fraction(x);\n if (f.valueOf() !== x) {\n throw new TypeError('Cannot implicitly convert a number to a Fraction when there will be a loss of precision ' + '(value: ' + x + '). ' + 'Use function fraction(x) to convert to Fraction.');\n }\n return f;\n }\n }, {\n // FIXME: add conversion from Fraction to number, for example for `sqrt(fraction(1,3))`\n // from: 'Fraction',\n // to: 'number',\n // convert: function (x) {\n // return x.valueOf()\n // }\n // }, {\n from: 'string',\n to: 'number',\n convert: function convert(x) {\n var n = Number(x);\n if (isNaN(n)) {\n throw new Error('Cannot convert \"' + x + '\" to a number');\n }\n return n;\n }\n }, {\n from: 'string',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n try {\n return new BigNumber(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to BigNumber');\n }\n }\n }, {\n from: 'string',\n to: 'bigint',\n convert: function convert(x) {\n try {\n return BigInt(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to BigInt');\n }\n }\n }, {\n from: 'string',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n try {\n return new Fraction(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to Fraction');\n }\n }\n }, {\n from: 'string',\n to: 'Complex',\n convert: function convert(x) {\n if (!Complex) {\n throwNoComplex(x);\n }\n try {\n return new Complex(x);\n } catch (err) {\n throw new Error('Cannot convert \"' + x + '\" to Complex');\n }\n }\n }, {\n from: 'boolean',\n to: 'number',\n convert: function convert(x) {\n return +x;\n }\n }, {\n from: 'boolean',\n to: 'BigNumber',\n convert: function convert(x) {\n if (!BigNumber) {\n throwNoBignumber(x);\n }\n return new BigNumber(+x);\n }\n }, {\n from: 'boolean',\n to: 'bigint',\n convert: function convert(x) {\n return BigInt(+x);\n }\n }, {\n from: 'boolean',\n to: 'Fraction',\n convert: function convert(x) {\n if (!Fraction) {\n throwNoFraction(x);\n }\n return new Fraction(+x);\n }\n }, {\n from: 'boolean',\n to: 'string',\n convert: function convert(x) {\n return String(x);\n }\n }, {\n from: 'Array',\n to: 'Matrix',\n convert: function convert(array) {\n if (!DenseMatrix) {\n throwNoMatrix();\n }\n return new DenseMatrix(array);\n }\n }, {\n from: 'Matrix',\n to: 'Array',\n convert: function convert(matrix) {\n return matrix.valueOf();\n }\n }]);\n\n // Provide a suggestion on how to call a function elementwise\n // This was added primarily as guidance for the v10 -> v11 transition,\n // and could potentially be removed in the future if it no longer seems\n // to be helpful.\n typed.onMismatch = (name, args, signatures) => {\n var usualError = typed.createError(name, args, signatures);\n if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && isCollection(args[0]) &&\n // check if the function can be unary:\n signatures.some(sig => !sig.params.includes(','))) {\n var err = new TypeError(\"Function '\".concat(name, \"' doesn't apply to matrices. To call it \") + \"elementwise on a matrix 'M', try 'map(M, \".concat(name, \")'.\"));\n err.data = usualError.data;\n throw err;\n }\n throw usualError;\n };\n\n // Provide a suggestion on how to call a function elementwise\n // This was added primarily as guidance for the v10 -> v11 transition,\n // and could potentially be removed in the future if it no longer seems\n // to be helpful.\n typed.onMismatch = (name, args, signatures) => {\n var usualError = typed.createError(name, args, signatures);\n if (['wrongType', 'mismatch'].includes(usualError.data.category) && args.length === 1 && isCollection(args[0]) &&\n // check if the function can be unary:\n signatures.some(sig => !sig.params.includes(','))) {\n var err = new TypeError(\"Function '\".concat(name, \"' doesn't apply to matrices. To call it \") + \"elementwise on a matrix 'M', try 'map(M, \".concat(name, \")'.\"));\n err.data = usualError.data;\n throw err;\n }\n throw usualError;\n };\n return typed;\n});\nfunction throwNoBignumber(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a BigNumber: no class 'BigNumber' provided\"));\n}\nfunction throwNoComplex(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a Complex number: no class 'Complex' provided\"));\n}\nfunction throwNoMatrix() {\n throw new Error('Cannot convert array into a Matrix: no class \\'DenseMatrix\\' provided');\n}\nfunction throwNoFraction(x) {\n throw new Error(\"Cannot convert value \".concat(x, \" into a Fraction, no class 'Fraction' provided.\"));\n}", "import { isBigNumber, isNumber, isObject } from './is.js';\n\n/**\n * @typedef {{sign: '+' | '-' | '', coefficients: number[], exponent: number}} SplitValue\n */\n\n/**\n * Check if a number is integer\n * @param {number | boolean} value\n * @return {boolean} isInteger\n */\nexport function isInteger(value) {\n if (typeof value === 'boolean') {\n return true;\n }\n return isFinite(value) ? value === Math.round(value) : false;\n}\n\n/**\n * Check if a string contains an integer\n * @param {string} str\n * @return {boolean} isInteger\n */\nexport function isIntegerStr(str) {\n // regex matching strings like \"123\" and \"-123\"\n return /^-?\\d+$/.test(str);\n}\n\n/**\n * Ensure the number type is compatible with the provided value.\n * If not, return 'number' instead.\n *\n * For example:\n *\n * safeNumberType('2.3', { number: 'bigint', numberFallback: 'number' })\n *\n * will return 'number' and not 'bigint' because trying to create a bigint with\n * value 2.3 would throw an exception.\n *\n * @param {string} numberStr\n * @param {{\n * number: 'number' | 'BigNumber' | 'bigint' | 'Fraction'\n * numberFallback: 'number' | 'BigNumber'\n * }} config\n * @returns {'number' | 'BigNumber' | 'bigint' | 'Fraction'}\n */\nexport function safeNumberType(numberStr, config) {\n if (config.number === 'bigint' && !isIntegerStr(numberStr)) {\n return config.numberFallback;\n }\n return config.number;\n}\n\n/**\n * Calculate the sign of a number\n * @param {number} x\n * @returns {number}\n */\nexport var sign = Math.sign || function (x) {\n if (x > 0) {\n return 1;\n } else if (x < 0) {\n return -1;\n } else {\n return 0;\n }\n};\n\n/**\n * Calculate the base-2 logarithm of a number\n * @param {number} x\n * @returns {number}\n */\nexport var log2 = Math.log2 || function log2(x) {\n return Math.log(x) / Math.LN2;\n};\n\n/**\n * Calculate the base-10 logarithm of a number\n * @param {number} x\n * @returns {number}\n */\nexport var log10 = Math.log10 || function log10(x) {\n return Math.log(x) / Math.LN10;\n};\n\n/**\n * Calculate the natural logarithm of a number + 1\n * @param {number} x\n * @returns {number}\n */\nexport var log1p = Math.log1p || function (x) {\n return Math.log(x + 1);\n};\n\n/**\n * Calculate cubic root for a number\n *\n * Code from es6-shim.js:\n * https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1564-L1577\n *\n * @param {number} x\n * @returns {number} Returns the cubic root of x\n */\nexport var cbrt = Math.cbrt || function cbrt(x) {\n if (x === 0) {\n return x;\n }\n var negate = x < 0;\n var result;\n if (negate) {\n x = -x;\n }\n if (isFinite(x)) {\n result = Math.exp(Math.log(x) / 3);\n // from https://en.wikipedia.org/wiki/Cube_root#Numerical_methods\n result = (x / (result * result) + 2 * result) / 3;\n } else {\n result = x;\n }\n return negate ? -result : result;\n};\n\n/**\n * Calculates exponentiation minus 1\n * @param {number} x\n * @return {number} res\n */\nexport var expm1 = Math.expm1 || function expm1(x) {\n return x >= 2e-4 || x <= -2e-4 ? Math.exp(x) - 1 : x + x * x / 2 + x * x * x / 6;\n};\n\n/**\n * Formats a number in a given base\n * @param {number} n\n * @param {number} base\n * @param {number} size\n * @returns {string}\n */\nfunction formatNumberToBase(n, base, size) {\n var prefixes = {\n 2: '0b',\n 8: '0o',\n 16: '0x'\n };\n var prefix = prefixes[base];\n var suffix = '';\n if (size) {\n if (size < 1) {\n throw new Error('size must be in greater than 0');\n }\n if (!isInteger(size)) {\n throw new Error('size must be an integer');\n }\n if (n > 2 ** (size - 1) - 1 || n < -(2 ** (size - 1))) {\n throw new Error(\"Value must be in range [-2^\".concat(size - 1, \", 2^\").concat(size - 1, \"-1]\"));\n }\n if (!isInteger(n)) {\n throw new Error('Value must be an integer');\n }\n if (n < 0) {\n n = n + 2 ** size;\n }\n suffix = \"i\".concat(size);\n }\n var sign = '';\n if (n < 0) {\n n = -n;\n sign = '-';\n }\n return \"\".concat(sign).concat(prefix).concat(n.toString(base)).concat(suffix);\n}\n\n/**\n * Convert a number to a formatted string representation.\n *\n * Syntax:\n *\n * format(value)\n * format(value, options)\n * format(value, precision)\n * format(value, fn)\n *\n * Where:\n *\n * {number} value The value to be formatted\n * {Object} options An object with formatting options. Available options:\n * {string} notation\n * Number notation. Choose from:\n * 'fixed' Always use regular number notation.\n * For example '123.40' and '14000000'\n * 'exponential' Always use exponential notation.\n * For example '1.234e+2' and '1.4e+7'\n * 'engineering' Always use engineering notation.\n * For example '123.4e+0' and '14.0e+6'\n * 'auto' (default) Regular number notation for numbers\n * having an absolute value between\n * `lowerExp` and `upperExp` bounds, and\n * uses exponential notation elsewhere.\n * Lower bound is included, upper bound\n * is excluded.\n * For example '123.4' and '1.4e7'.\n * 'bin', 'oct, or\n * 'hex' Format the number using binary, octal,\n * or hexadecimal notation.\n * For example '0b1101' and '0x10fe'.\n * {number} wordSize The word size in bits to use for formatting\n * in binary, octal, or hexadecimal notation.\n * To be used only with 'bin', 'oct', or 'hex'\n * values for 'notation' option. When this option\n * is defined the value is formatted as a signed\n * twos complement integer of the given word size\n * and the size suffix is appended to the output.\n * For example\n * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'.\n * Default value is undefined.\n * {number} precision A number between 0 and 16 to round\n * the digits of the number.\n * In case of notations 'exponential',\n * 'engineering', and 'auto',\n * `precision` defines the total\n * number of significant digits returned.\n * In case of notation 'fixed',\n * `precision` defines the number of\n * significant digits after the decimal\n * point.\n * `precision` is undefined by default,\n * not rounding any digits.\n * {number} lowerExp Exponent determining the lower boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `-3`.\n * {number} upperExp Exponent determining the upper boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `5`.\n * {Function} fn A custom formatting function. Can be used to override the\n * built-in notations. Function `fn` is called with `value` as\n * parameter and must return a string. Is useful for example to\n * format all values inside a matrix in a particular way.\n *\n * Examples:\n *\n * format(6.4) // '6.4'\n * format(1240000) // '1.24e6'\n * format(1/3) // '0.3333333333333333'\n * format(1/3, 3) // '0.333'\n * format(21385, 2) // '21000'\n * format(12.071, {notation: 'fixed'}) // '12'\n * format(2.3, {notation: 'fixed', precision: 2}) // '2.30'\n * format(52.8, {notation: 'exponential'}) // '5.28e+1'\n * format(12345678, {notation: 'engineering'}) // '12.345678e+6'\n *\n * @param {number} value\n * @param {Object | Function | number} [options]\n * @return {string} str The formatted value\n */\nexport function format(value, options) {\n if (typeof options === 'function') {\n // handle format(value, fn)\n return options(value);\n }\n\n // handle special cases\n if (value === Infinity) {\n return 'Infinity';\n } else if (value === -Infinity) {\n return '-Infinity';\n } else if (isNaN(value)) {\n return 'NaN';\n }\n var {\n notation,\n precision,\n wordSize\n } = normalizeFormatOptions(options);\n\n // handle the various notations\n switch (notation) {\n case 'fixed':\n return toFixed(value, precision);\n case 'exponential':\n return toExponential(value, precision);\n case 'engineering':\n return toEngineering(value, precision);\n case 'bin':\n return formatNumberToBase(value, 2, wordSize);\n case 'oct':\n return formatNumberToBase(value, 8, wordSize);\n case 'hex':\n return formatNumberToBase(value, 16, wordSize);\n case 'auto':\n // remove trailing zeros after the decimal point\n return toPrecision(value, precision, options).replace(/((\\.\\d*?)(0+))($|e)/, function () {\n var digits = arguments[2];\n var e = arguments[4];\n return digits !== '.' ? digits + e : e;\n });\n default:\n throw new Error('Unknown notation \"' + notation + '\". ' + 'Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.');\n }\n}\n\n/**\n * Normalize format options into an object:\n * {\n * notation: string,\n * precision: number | undefined,\n * wordSize: number | undefined\n * }\n */\nexport function normalizeFormatOptions(options) {\n // default values for options\n var notation = 'auto';\n var precision;\n var wordSize;\n if (options !== undefined) {\n if (isNumber(options)) {\n precision = options;\n } else if (isBigNumber(options)) {\n precision = options.toNumber();\n } else if (isObject(options)) {\n if (options.precision !== undefined) {\n precision = _toNumberOrThrow(options.precision, () => {\n throw new Error('Option \"precision\" must be a number or BigNumber');\n });\n }\n if (options.wordSize !== undefined) {\n wordSize = _toNumberOrThrow(options.wordSize, () => {\n throw new Error('Option \"wordSize\" must be a number or BigNumber');\n });\n }\n if (options.notation) {\n notation = options.notation;\n }\n } else {\n throw new Error('Unsupported type of options, number, BigNumber, or object expected');\n }\n }\n return {\n notation,\n precision,\n wordSize\n };\n}\n\n/**\n * Split a number into sign, coefficients, and exponent\n * @param {number | string} value\n * @return {SplitValue}\n * Returns an object containing sign, coefficients, and exponent\n */\nexport function splitNumber(value) {\n // parse the input value\n var match = String(value).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/);\n if (!match) {\n throw new SyntaxError('Invalid number ' + value);\n }\n var sign = match[1];\n var digits = match[2];\n var exponent = parseFloat(match[4] || '0');\n var dot = digits.indexOf('.');\n exponent += dot !== -1 ? dot - 1 : digits.length - 1;\n var coefficients = digits.replace('.', '') // remove the dot (must be removed before removing leading zeros)\n .replace(/^0*/, function (zeros) {\n // remove leading zeros, add their count to the exponent\n exponent -= zeros.length;\n return '';\n }).replace(/0*$/, '') // remove trailing zeros\n .split('').map(function (d) {\n return parseInt(d);\n });\n if (coefficients.length === 0) {\n coefficients.push(0);\n exponent++;\n }\n return {\n sign,\n coefficients,\n exponent\n };\n}\n\n/**\n * Format a number in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3'\n * @param {number | string} value\n * @param {number} [precision] Optional number of significant figures to return.\n */\nexport function toEngineering(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n var split = splitNumber(value);\n var rounded = roundDigits(split, precision);\n var e = rounded.exponent;\n var c = rounded.coefficients;\n\n // find nearest lower multiple of 3 for exponent\n var newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3;\n if (isNumber(precision)) {\n // add zeroes to give correct sig figs\n while (precision > c.length || e - newExp + 1 > c.length) {\n c.push(0);\n }\n } else {\n // concatenate coefficients with necessary zeros\n // add zeros if necessary (for example: 1e+8 -> 100e+6)\n var missingZeros = Math.abs(e - newExp) - (c.length - 1);\n for (var i = 0; i < missingZeros; i++) {\n c.push(0);\n }\n }\n\n // find difference in exponents\n var expDiff = Math.abs(e - newExp);\n var decimalIdx = 1;\n\n // push decimal index over by expDiff times\n while (expDiff > 0) {\n decimalIdx++;\n expDiff--;\n }\n\n // if all coefficient values are zero after the decimal point and precision is unset, don't add a decimal value.\n // otherwise concat with the rest of the coefficients\n var decimals = c.slice(decimalIdx).join('');\n var decimalVal = isNumber(precision) && decimals.length || decimals.match(/[1-9]/) ? '.' + decimals : '';\n var str = c.slice(0, decimalIdx).join('') + decimalVal + 'e' + (e >= 0 ? '+' : '') + newExp.toString();\n return rounded.sign + str;\n}\n\n/**\n * Format a number with fixed notation.\n * @param {number | string} value\n * @param {number} [precision=undefined] Optional number of decimals after the\n * decimal point. null by default.\n */\nexport function toFixed(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n var splitValue = splitNumber(value);\n var rounded = typeof precision === 'number' ? roundDigits(splitValue, splitValue.exponent + 1 + precision) : splitValue;\n var c = rounded.coefficients;\n var p = rounded.exponent + 1; // exponent may have changed\n\n // append zeros if needed\n var pp = p + (precision || 0);\n if (c.length < pp) {\n c = c.concat(zeros(pp - c.length));\n }\n\n // prepend zeros if needed\n if (p < 0) {\n c = zeros(-p + 1).concat(c);\n p = 1;\n }\n\n // insert a dot if needed\n if (p < c.length) {\n c.splice(p, 0, p === 0 ? '0.' : '.');\n }\n return rounded.sign + c.join('');\n}\n\n/**\n * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3'\n * @param {number | string} value\n * @param {number} [precision] Number of digits in formatted output.\n * If not provided, the maximum available digits\n * is used.\n */\nexport function toExponential(value, precision) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n\n // round if needed, else create a clone\n var split = splitNumber(value);\n var rounded = precision ? roundDigits(split, precision) : split;\n var c = rounded.coefficients;\n var e = rounded.exponent;\n\n // append zeros if needed\n if (c.length < precision) {\n c = c.concat(zeros(precision - c.length));\n }\n\n // format as `C.CCCe+EEE` or `C.CCCe-EEE`\n var first = c.shift();\n return rounded.sign + first + (c.length > 0 ? '.' + c.join('') : '') + 'e' + (e >= 0 ? '+' : '') + e;\n}\n\n/**\n * Format a number with a certain precision\n * @param {number | string} value\n * @param {number} [precision=undefined] Optional number of digits.\n * @param {{lowerExp: number | undefined, upperExp: number | undefined}} [options]\n * By default:\n * lowerExp = -3 (incl)\n * upper = +5 (excl)\n * @return {string}\n */\nexport function toPrecision(value, precision, options) {\n if (isNaN(value) || !isFinite(value)) {\n return String(value);\n }\n\n // determine lower and upper bound for exponential notation.\n var lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3);\n var upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5);\n var split = splitNumber(value);\n var rounded = precision ? roundDigits(split, precision) : split;\n if (rounded.exponent < lowerExp || rounded.exponent >= upperExp) {\n // exponential notation\n return toExponential(value, precision);\n } else {\n var c = rounded.coefficients;\n var e = rounded.exponent;\n\n // append trailing zeros\n if (c.length < precision) {\n c = c.concat(zeros(precision - c.length));\n }\n\n // append trailing zeros\n // TODO: simplify the next statement\n c = c.concat(zeros(e - c.length + 1 + (c.length < precision ? precision - c.length : 0)));\n\n // prepend zeros\n c = zeros(-e).concat(c);\n var dot = e > 0 ? e : 0;\n if (dot < c.length - 1) {\n c.splice(dot + 1, 0, '.');\n }\n return rounded.sign + c.join('');\n }\n}\n\n/**\n * Round the number of digits of a number *\n * @param {SplitValue} split A value split with .splitNumber(value)\n * @param {number} precision A positive integer\n * @return {SplitValue}\n * Returns an object containing sign, coefficients, and exponent\n * with rounded digits\n */\nexport function roundDigits(split, precision) {\n // create a clone\n var rounded = {\n sign: split.sign,\n coefficients: split.coefficients,\n exponent: split.exponent\n };\n var c = rounded.coefficients;\n\n // prepend zeros if needed\n while (precision <= 0) {\n c.unshift(0);\n rounded.exponent++;\n precision++;\n }\n if (c.length > precision) {\n var removed = c.splice(precision, c.length - precision);\n if (removed[0] >= 5) {\n var i = precision - 1;\n c[i]++;\n while (c[i] === 10) {\n c.pop();\n if (i === 0) {\n c.unshift(0);\n rounded.exponent++;\n i++;\n }\n i--;\n c[i]++;\n }\n }\n }\n return rounded;\n}\n\n/**\n * Create an array filled with zeros.\n * @param {number} length\n * @return {Array}\n */\nfunction zeros(length) {\n var arr = [];\n for (var i = 0; i < length; i++) {\n arr.push(0);\n }\n return arr;\n}\n\n/**\n * Count the number of significant digits of a number.\n *\n * For example:\n * 2.34 returns 3\n * 0.0034 returns 2\n * 120.5e+30 returns 4\n *\n * @param {number} value\n * @return {number} digits Number of significant digits\n */\nexport function digits(value) {\n return value.toExponential().replace(/e.*$/, '') // remove exponential notation\n .replace(/^0\\.?0*|\\./, '') // remove decimal point and leading zeros\n .length;\n}\n\n/**\n * Minimum number added to one that makes the result different than one\n */\nexport var DBL_EPSILON = Number.EPSILON || 2.2204460492503130808472633361816E-16;\n\n/**\n * Compares two floating point numbers.\n * @param {number} a - First value to compare\n * @param {number} b - Second value to compare\n * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0.\n * @param {number} [absTol=1e-12] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0.\n * @return {boolean} whether the two numbers are nearly equal\n *\n * @throws {Error} If `relTol` is less than or equal to 0.\n * @throws {Error} If `absTol` is less than 0.\n *\n * @example\n * nearlyEqual(1.000000001, 1.0, 1e-8); // true\n * nearlyEqual(1.000000002, 1.0, 0); // false\n * nearlyEqual(1.0, 1.009, undefined, 0.01); // true\n * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true\n */\nexport function nearlyEqual(a, b) {\n var relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-8;\n var absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n if (relTol <= 0) {\n throw new Error('Relative tolerance must be greater than 0');\n }\n if (absTol < 0) {\n throw new Error('Absolute tolerance must be at least 0');\n }\n\n // NaN\n if (isNaN(a) || isNaN(b)) {\n return false;\n }\n if (!isFinite(a) || !isFinite(b)) {\n return a === b;\n }\n if (a === b) {\n return true;\n }\n\n // abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)\n return Math.abs(a - b) <= Math.max(relTol * Math.max(Math.abs(a), Math.abs(b)), absTol);\n}\n\n/**\n * Calculate the hyperbolic arccos of a number\n * @param {number} x\n * @return {number}\n */\nexport var acosh = Math.acosh || function (x) {\n return Math.log(Math.sqrt(x * x - 1) + x);\n};\nexport var asinh = Math.asinh || function (x) {\n return Math.log(Math.sqrt(x * x + 1) + x);\n};\n\n/**\n * Calculate the hyperbolic arctangent of a number\n * @param {number} x\n * @return {number}\n */\nexport var atanh = Math.atanh || function (x) {\n return Math.log((1 + x) / (1 - x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic cosine of a number\n * @param {number} x\n * @returns {number}\n */\nexport var cosh = Math.cosh || function (x) {\n return (Math.exp(x) + Math.exp(-x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic sine of a number\n * @param {number} x\n * @returns {number}\n */\nexport var sinh = Math.sinh || function (x) {\n return (Math.exp(x) - Math.exp(-x)) / 2;\n};\n\n/**\n * Calculate the hyperbolic tangent of a number\n * @param {number} x\n * @returns {number}\n */\nexport var tanh = Math.tanh || function (x) {\n var e = Math.exp(2 * x);\n return (e - 1) / (e + 1);\n};\n\n/**\n * Returns a value with the magnitude of x and the sign of y.\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\nexport function copysign(x, y) {\n var signx = x > 0 ? true : x < 0 ? false : 1 / x === Infinity;\n var signy = y > 0 ? true : y < 0 ? false : 1 / y === Infinity;\n return signx ^ signy ? -x : x;\n}\nfunction _toNumberOrThrow(value, onError) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n onError();\n }\n}\nfunction _toNumberOrDefault(value, defaultValue) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n return defaultValue;\n }\n}", "import { pickShallow } from './object.js';\n\n/**\n * Create a factory function, which can be used to inject dependencies.\n *\n * The created functions are memoized, a consecutive call of the factory\n * with the exact same inputs will return the same function instance.\n * The memoized cache is exposed on `factory.cache` and can be cleared\n * if needed.\n *\n * Example:\n *\n * const name = 'log'\n * const dependencies = ['config', 'typed', 'divideScalar', 'Complex']\n *\n * export const createLog = factory(name, dependencies, ({ typed, config, divideScalar, Complex }) => {\n * // ... create the function log here and return it\n * }\n *\n * @param {string} name Name of the function to be created\n * @param {string[]} dependencies The names of all required dependencies\n * @param {function} create Callback function called with an object with all dependencies\n * @param {Object} [meta] Optional object with meta information that will be attached\n * to the created factory function as property `meta`.\n * @returns {function}\n */\nexport function factory(name, dependencies, create, meta) {\n function assertAndCreate(scope) {\n // we only pass the requested dependencies to the factory function\n // to prevent functions to rely on dependencies that are not explicitly\n // requested.\n var deps = pickShallow(scope, dependencies.map(stripOptionalNotation));\n assertDependencies(name, dependencies, scope);\n return create(deps);\n }\n assertAndCreate.isFactory = true;\n assertAndCreate.fn = name;\n assertAndCreate.dependencies = dependencies.slice().sort();\n if (meta) {\n assertAndCreate.meta = meta;\n }\n return assertAndCreate;\n}\n\n/**\n * Sort all factories such that when loading in order, the dependencies are resolved.\n *\n * @param {Array} factories\n * @returns {Array} Returns a new array with the sorted factories.\n */\nexport function sortFactories(factories) {\n var factoriesByName = {};\n factories.forEach(factory => {\n factoriesByName[factory.fn] = factory;\n });\n function containsDependency(factory, dependency) {\n // TODO: detect circular references\n if (isFactory(factory)) {\n if (factory.dependencies.includes(dependency.fn || dependency.name)) {\n return true;\n }\n if (factory.dependencies.some(d => containsDependency(factoriesByName[d], dependency))) {\n return true;\n }\n }\n return false;\n }\n var sorted = [];\n function addFactory(factory) {\n var index = 0;\n while (index < sorted.length && !containsDependency(sorted[index], factory)) {\n index++;\n }\n sorted.splice(index, 0, factory);\n }\n\n // sort regular factory functions\n factories.filter(isFactory).forEach(addFactory);\n\n // sort legacy factory functions AFTER the regular factory functions\n factories.filter(factory => !isFactory(factory)).forEach(addFactory);\n return sorted;\n}\n\n// TODO: comment or cleanup if unused in the end\nexport function create(factories) {\n var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n sortFactories(factories).forEach(factory => factory(scope));\n return scope;\n}\n\n/**\n * Test whether an object is a factory. This is the case when it has\n * properties name, dependencies, and a function create.\n * @param {*} obj\n * @returns {boolean}\n */\nexport function isFactory(obj) {\n return typeof obj === 'function' && typeof obj.fn === 'string' && Array.isArray(obj.dependencies);\n}\n\n/**\n * Assert that all dependencies of a list with dependencies are available in the provided scope.\n *\n * Will throw an exception when there are dependencies missing.\n *\n * @param {string} name Name for the function to be created. Used to generate a useful error message\n * @param {string[]} dependencies\n * @param {Object} scope\n */\nexport function assertDependencies(name, dependencies, scope) {\n var allDefined = dependencies.filter(dependency => !isOptionalDependency(dependency)) // filter optionals\n .every(dependency => scope[dependency] !== undefined);\n if (!allDefined) {\n var missingDependencies = dependencies.filter(dependency => scope[dependency] === undefined);\n\n // TODO: create a custom error class for this, a MathjsError or something like that\n throw new Error(\"Cannot create function \\\"\".concat(name, \"\\\", \") + \"some dependencies are missing: \".concat(missingDependencies.map(d => \"\\\"\".concat(d, \"\\\"\")).join(', '), \".\"));\n }\n}\nexport function isOptionalDependency(dependency) {\n return dependency && dependency[0] === '?';\n}\nexport function stripOptionalNotation(dependency) {\n return dependency && dependency[0] === '?' ? dependency.slice(1) : dependency;\n}", "import { setSafeProperty, hasSafeProperty, getSafeProperty } from './customs.js';\nimport { isObject } from './is.js';\n\n/**\n * A map facade on a bare object.\n *\n * The small number of methods needed to implement a scope,\n * forwarding on to the SafeProperty functions. Over time, the codebase\n * will stop using this method, as all objects will be Maps, rather than\n * more security prone objects.\n */\nexport class ObjectWrappingMap {\n constructor(object) {\n this.wrappedObject = object;\n this[Symbol.iterator] = this.entries;\n }\n keys() {\n return Object.keys(this.wrappedObject).values();\n }\n get(key) {\n return getSafeProperty(this.wrappedObject, key);\n }\n set(key, value) {\n setSafeProperty(this.wrappedObject, key, value);\n return this;\n }\n has(key) {\n return hasSafeProperty(this.wrappedObject, key);\n }\n entries() {\n return mapIterator(this.keys(), key => [key, this.get(key)]);\n }\n forEach(callback) {\n for (var key of this.keys()) {\n callback(this.get(key), key, this);\n }\n }\n delete(key) {\n delete this.wrappedObject[key];\n }\n clear() {\n for (var key of this.keys()) {\n this.delete(key);\n }\n }\n get size() {\n return Object.keys(this.wrappedObject).length;\n }\n}\n\n/**\n * Create a map with two partitions: a and b.\n * The set with bKeys determines which keys/values are read/written to map b,\n * all other values are read/written to map a\n *\n * For example:\n *\n * const a = new Map()\n * const b = new Map()\n * const p = new PartitionedMap(a, b, new Set(['x', 'y']))\n *\n * In this case, values `x` and `y` are read/written to map `b`,\n * all other values are read/written to map `a`.\n */\nexport class PartitionedMap {\n /**\n * @param {Map} a\n * @param {Map} b\n * @param {Set} bKeys\n */\n constructor(a, b, bKeys) {\n this.a = a;\n this.b = b;\n this.bKeys = bKeys;\n this[Symbol.iterator] = this.entries;\n }\n get(key) {\n return this.bKeys.has(key) ? this.b.get(key) : this.a.get(key);\n }\n set(key, value) {\n if (this.bKeys.has(key)) {\n this.b.set(key, value);\n } else {\n this.a.set(key, value);\n }\n return this;\n }\n has(key) {\n return this.b.has(key) || this.a.has(key);\n }\n keys() {\n return new Set([...this.a.keys(), ...this.b.keys()])[Symbol.iterator]();\n }\n entries() {\n return mapIterator(this.keys(), key => [key, this.get(key)]);\n }\n forEach(callback) {\n for (var key of this.keys()) {\n callback(this.get(key), key, this);\n }\n }\n delete(key) {\n return this.bKeys.has(key) ? this.b.delete(key) : this.a.delete(key);\n }\n clear() {\n this.a.clear();\n this.b.clear();\n }\n get size() {\n return [...this.keys()].length;\n }\n}\n\n/**\n * Create a new iterator that maps over the provided iterator, applying a mapping function to each item\n */\nfunction mapIterator(it, callback) {\n return {\n next: () => {\n var n = it.next();\n return n.done ? n : {\n value: callback(n.value),\n done: false\n };\n }\n };\n}\n\n/**\n * Creates an empty map, or whatever your platform's polyfill is.\n *\n * @returns an empty Map or Map like object.\n */\nexport function createEmptyMap() {\n return new Map();\n}\n\n/**\n * Creates a Map from the given object.\n *\n * @param { Map | { [key: string]: unknown } | undefined } mapOrObject\n * @returns\n */\nexport function createMap(mapOrObject) {\n if (!mapOrObject) {\n return createEmptyMap();\n }\n if (isMap(mapOrObject)) {\n return mapOrObject;\n }\n if (isObject(mapOrObject)) {\n return new ObjectWrappingMap(mapOrObject);\n }\n throw new Error('createMap can create maps from objects or Maps');\n}\n\n/**\n * Unwraps a map into an object.\n *\n * @param {Map} map\n * @returns { [key: string]: unknown }\n */\nexport function toObject(map) {\n if (map instanceof ObjectWrappingMap) {\n return map.wrappedObject;\n }\n var object = {};\n for (var key of map.keys()) {\n var value = map.get(key);\n setSafeProperty(object, key, value);\n }\n return object;\n}\n\n/**\n * Returns `true` if the passed object appears to be a Map (i.e. duck typing).\n *\n * Methods looked for are `get`, `set`, `keys` and `has`.\n *\n * @param {Map | object} object\n * @returns\n */\nexport function isMap(object) {\n // We can use the fast instanceof, or a slower duck typing check.\n // The duck typing method needs to cover enough methods to not be confused with DenseMatrix.\n if (!object) {\n return false;\n }\n return object instanceof Map || object instanceof ObjectWrappingMap || typeof object.set === 'function' && typeof object.get === 'function' && typeof object.keys === 'function' && typeof object.has === 'function';\n}\n\n/**\n * Copies the contents of key-value pairs from each `objects` in to `map`.\n *\n * Object is `objects` can be a `Map` or object.\n *\n * This is the `Map` analog to `Object.assign`.\n */\nexport function assign(map) {\n for (var _len = arguments.length, objects = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n objects[_key - 1] = arguments[_key];\n }\n for (var args of objects) {\n if (!args) {\n continue;\n }\n if (isMap(args)) {\n for (var key of args.keys()) {\n map.set(key, args.get(key));\n }\n } else if (isObject(args)) {\n for (var _key2 of Object.keys(args)) {\n map.set(_key2, args[_key2]);\n }\n }\n }\n return map;\n}", "import { hasOwnProperty } from './object.js';\n\n/**\n * Get a property of a plain object\n * Throws an error in case the object is not a plain object or the\n * property is not defined on the object itself\n * @param {Object} object\n * @param {string} prop\n * @return {*} Returns the property value when safe\n */\nfunction getSafeProperty(object, prop) {\n // only allow getting safe properties of a plain object\n if (isPlainObject(object) && isSafeProperty(object, prop)) {\n return object[prop];\n }\n if (typeof object[prop] === 'function' && isSafeMethod(object, prop)) {\n throw new Error('Cannot access method \"' + prop + '\" as a property');\n }\n throw new Error('No access to property \"' + prop + '\"');\n}\n\n/**\n * Set a property on a plain object.\n * Throws an error in case the object is not a plain object or the\n * property would override an inherited property like .constructor or .toString\n * @param {Object} object\n * @param {string} prop\n * @param {*} value\n * @return {*} Returns the value\n */\n// TODO: merge this function into access.js?\nfunction setSafeProperty(object, prop, value) {\n // only allow setting safe properties of a plain object\n if (isPlainObject(object) && isSafeProperty(object, prop)) {\n object[prop] = value;\n return value;\n }\n throw new Error('No access to property \"' + prop + '\"');\n}\nfunction getSafeProperties(object) {\n return Object.keys(object).filter(prop => hasOwnProperty(object, prop));\n}\nfunction hasSafeProperty(object, prop) {\n return prop in object;\n}\n\n/**\n * Test whether a property is safe to use for an object.\n * For example .toString and .constructor are not safe\n * @param {string} prop\n * @return {boolean} Returns true when safe\n */\nfunction isSafeProperty(object, prop) {\n if (!object || typeof object !== 'object') {\n return false;\n }\n // SAFE: whitelisted\n // e.g length\n if (hasOwnProperty(safeNativeProperties, prop)) {\n return true;\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (prop in Object.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Object.prototype is a root object\n return false;\n }\n // UNSAFE: inherited from Function prototype\n // e.g call, apply\n if (prop in Function.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Function.prototype is a root object\n return false;\n }\n return true;\n}\n\n/**\n * Validate whether a method is safe.\n * Throws an error when that's not the case.\n * @param {Object} object\n * @param {string} method\n * @return {function} Returns the method when valid\n */\nfunction getSafeMethod(object, method) {\n if (!isSafeMethod(object, method)) {\n throw new Error('No access to method \"' + method + '\"');\n }\n return object[method];\n}\n\n/**\n * Check whether a method is safe.\n * Throws an error when that's not the case (for example for `constructor`).\n * @param {Object} object\n * @param {string} method\n * @return {boolean} Returns true when safe, false otherwise\n */\nfunction isSafeMethod(object, method) {\n if (object === null || object === undefined || typeof object[method] !== 'function') {\n return false;\n }\n // UNSAFE: ghosted\n // e.g overridden toString\n // Note that IE10 doesn't support __proto__ and we can't do this check there.\n if (hasOwnProperty(object, method) && Object.getPrototypeOf && method in Object.getPrototypeOf(object)) {\n return false;\n }\n // SAFE: whitelisted\n // e.g toString\n if (hasOwnProperty(safeNativeMethods, method)) {\n return true;\n }\n // UNSAFE: inherited from Object prototype\n // e.g constructor\n if (method in Object.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Object.prototype is a root object\n return false;\n }\n // UNSAFE: inherited from Function prototype\n // e.g call, apply\n if (method in Function.prototype) {\n // 'in' is used instead of hasOwnProperty for nodejs v0.10\n // which is inconsistent on root prototypes. It is safe\n // here because Function.prototype is a root object\n return false;\n }\n return true;\n}\nfunction isPlainObject(object) {\n return typeof object === 'object' && object && object.constructor === Object;\n}\nvar safeNativeProperties = {\n length: true,\n name: true\n};\nvar safeNativeMethods = {\n toString: true,\n valueOf: true,\n toLocaleString: true\n};\nexport { getSafeProperty };\nexport { setSafeProperty };\nexport { isSafeProperty };\nexport { hasSafeProperty };\nexport { getSafeProperties };\nexport { getSafeMethod };\nexport { isSafeMethod };\nexport { isPlainObject };", "import { factory } from '../../utils/factory.js';\nvar name = 'ResultSet';\nvar dependencies = [];\nexport var createResultSet = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * A ResultSet contains a list or results\n * @class ResultSet\n * @param {Array} entries\n * @constructor ResultSet\n */\n function ResultSet(entries) {\n if (!(this instanceof ResultSet)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.entries = entries || [];\n }\n\n /**\n * Attach type information\n */\n ResultSet.prototype.type = 'ResultSet';\n ResultSet.prototype.isResultSet = true;\n\n /**\n * Returns the array with results hold by this ResultSet\n * @memberof ResultSet\n * @returns {Array} entries\n */\n ResultSet.prototype.valueOf = function () {\n return this.entries;\n };\n\n /**\n * Returns the stringified results of the ResultSet\n * @memberof ResultSet\n * @returns {string} string\n */\n ResultSet.prototype.toString = function () {\n return '[' + this.entries.join(', ') + ']';\n };\n\n /**\n * Get a JSON representation of the ResultSet\n * @memberof ResultSet\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"ResultSet\", \"entries\": [...]}`\n */\n ResultSet.prototype.toJSON = function () {\n return {\n mathjs: 'ResultSet',\n entries: this.entries\n };\n };\n\n /**\n * Instantiate a ResultSet from a JSON object\n * @memberof ResultSet\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"ResultSet\", \"entries\": [...]}`\n * @return {ResultSet}\n */\n ResultSet.fromJSON = function (json) {\n return new ResultSet(json.entries);\n };\n return ResultSet;\n}, {\n isClass: true\n});", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'BigNumber';\nvar dependencies = ['?on', 'config'];\nexport var createBigNumberClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n config\n } = _ref;\n var BigNumber = Decimal.clone({\n precision: config.precision,\n modulo: Decimal.EUCLID\n });\n BigNumber.prototype = Object.create(BigNumber.prototype);\n\n /**\n * Attach type information\n */\n BigNumber.prototype.type = 'BigNumber';\n BigNumber.prototype.isBigNumber = true;\n\n /**\n * Get a JSON representation of a BigNumber containing\n * type information\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"BigNumber\", \"value\": \"0.2\"}`\n */\n BigNumber.prototype.toJSON = function () {\n return {\n mathjs: 'BigNumber',\n value: this.toString()\n };\n };\n\n /**\n * Instantiate a BigNumber from a JSON object\n * @param {Object} json a JSON object structured as:\n * `{\"mathjs\": \"BigNumber\", \"value\": \"0.2\"}`\n * @return {BigNumber}\n */\n BigNumber.fromJSON = function (json) {\n return new BigNumber(json.value);\n };\n if (on) {\n // listen for changed in the configuration, automatically apply changed precision\n on('config', function (curr, prev) {\n if (curr.precision !== prev.precision) {\n BigNumber.config({\n precision: curr.precision\n });\n }\n });\n }\n return BigNumber;\n}, {\n isClass: true\n});", "/*!\r\n * decimal.js v10.4.3\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js\r\n * Copyright (c) 2022 Michael Mclaughlin \r\n * MIT Licence\r\n */\r\n\r\n\r\n// ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The maximum exponent magnitude.\r\n // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.\r\nvar EXP_LIMIT = 9e15, // 0 to 9e15\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n // Base conversion alphabet.\r\n NUMERALS = '0123456789abcdef',\r\n\r\n // The natural logarithm of 10 (1025 digits).\r\n LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',\r\n\r\n // Pi (1025 digits).\r\n PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n DEFAULTS = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed at run-time using the `Decimal.config` method.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used when rounding to `precision`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 The IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.\r\n //\r\n // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian\r\n // division (9) are commonly used for the modulus operation. The other rounding modes can also\r\n // be used, but they may not give useful results.\r\n modulo: 1, // 0 to 9\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -EXP_LIMIT\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to EXP_LIMIT\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // JavaScript numbers: -324 (5e-324)\r\n minE: -EXP_LIMIT, // -1 to -EXP_LIMIT\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // JavaScript numbers: 308 (1.7976931348623157e+308)\r\n maxE: EXP_LIMIT, // 1 to EXP_LIMIT\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n crypto: false // true/false\r\n },\r\n\r\n\r\n// ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n inexact, quadrant,\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n precisionLimitExceeded = decimalError + 'Precision limit exceeded',\r\n cryptoUnavailable = decimalError + 'crypto unavailable',\r\n tag = '[object Decimal]',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isBinary = /^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,\r\n isHex = /^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,\r\n isOctal = /^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n\r\n LN10_PRECISION = LN10.length - 1,\r\n PI_PRECISION = PI.length - 1,\r\n\r\n // Decimal.prototype object\r\n P = { toStringTag: tag };\r\n\r\n\r\n// Decimal prototype methods\r\n\r\n\r\n/*\r\n * absoluteValue abs\r\n * ceil\r\n * clampedTo clamp\r\n * comparedTo cmp\r\n * cosine cos\r\n * cubeRoot cbrt\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy divToInt\r\n * equals eq\r\n * floor\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * hyperbolicCosine cosh\r\n * hyperbolicSine sinh\r\n * hyperbolicTangent tanh\r\n * inverseCosine acos\r\n * inverseHyperbolicCosine acosh\r\n * inverseHyperbolicSine asinh\r\n * inverseHyperbolicTangent atanh\r\n * inverseSine asin\r\n * inverseTangent atan\r\n * isFinite\r\n * isInteger isInt\r\n * isNaN\r\n * isNegative isNeg\r\n * isPositive isPos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * [maximum] [max]\r\n * [minimum] [min]\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * round\r\n * sine sin\r\n * squareRoot sqrt\r\n * tangent tan\r\n * times mul\r\n * toBinary\r\n * toDecimalPlaces toDP\r\n * toExponential\r\n * toFixed\r\n * toFraction\r\n * toHexadecimal toHex\r\n * toNearest\r\n * toNumber\r\n * toOctal\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits toSD\r\n * toString\r\n * truncated trunc\r\n * valueOf toJSON\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\nP.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s < 0) x.s = 1;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of positive Infinity.\r\n *\r\n */\r\nP.ceil = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal clamped to the range\r\n * delineated by `min` and `max`.\r\n *\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\nP.clampedTo = P.clamp = function (min, max) {\r\n var k,\r\n x = this,\r\n Ctor = x.constructor;\r\n min = new Ctor(min);\r\n max = new Ctor(max);\r\n if (!min.s || !max.s) return new Ctor(NaN);\r\n if (min.gt(max)) throw Error(invalidArgument + max);\r\n k = x.cmp(min);\r\n return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);\r\n};\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value,\r\n * NaN if the value of either Decimal is NaN.\r\n *\r\n */\r\nP.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this,\r\n xd = x.d,\r\n yd = (y = new x.constructor(y)).d,\r\n xs = x.s,\r\n ys = y.s;\r\n\r\n // Either NaN or \u00B1Infinity?\r\n if (!xd || !yd) {\r\n return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Either zero?\r\n if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;\r\n\r\n // Signs differ?\r\n if (xs !== ys) return xs;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;\r\n\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * cos(0) = 1\r\n * cos(-0) = 1\r\n * cos(Infinity) = NaN\r\n * cos(-Infinity) = NaN\r\n * cos(NaN) = NaN\r\n *\r\n */\r\nP.cosine = P.cos = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.d) return new Ctor(NaN);\r\n\r\n // cos(0) = cos(-0) = 1\r\n if (!x.d[0]) return new Ctor(1);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = cosine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n *\r\n * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * cbrt(0) = 0\r\n * cbrt(-0) = -0\r\n * cbrt(1) = 1\r\n * cbrt(-1) = -1\r\n * cbrt(N) = N\r\n * cbrt(-I) = -I\r\n * cbrt(I) = I\r\n *\r\n * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))\r\n *\r\n */\r\nP.cubeRoot = P.cbrt = function () {\r\n var e, m, n, r, rep, s, sd, t, t3, t3plusx,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = x.s * mathpow(x.s * x, 1 / 3);\r\n\r\n // Math.cbrt underflow/overflow?\r\n // Pass x to Math.pow as integer, then adjust the exponent of the result.\r\n if (!s || Math.abs(s) == 1 / 0) {\r\n n = digitsToString(x.d);\r\n e = x.e;\r\n\r\n // Adjust n exponent so it is a multiple of 3 away from x exponent.\r\n if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00');\r\n s = mathpow(n, 1 / 3);\r\n\r\n // Rarely, e may be one less than the result exponent value.\r\n e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n r.s = x.s;\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Halley's method.\r\n // TODO? Compare Newton's method.\r\n for (;;) {\r\n t = r;\r\n t3 = t.times(t).times(t);\r\n t3plusx = t3.plus(x);\r\n r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999\r\n // , i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\nP.decimalPlaces = P.dp = function () {\r\n var w,\r\n d = this.d,\r\n n = NaN;\r\n\r\n if (d) {\r\n w = d.length - 1;\r\n n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) n--;\r\n if (n < 0) n = 0;\r\n }\r\n\r\n return n;\r\n};\r\n\r\n\r\n/*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedToIntegerBy = P.divToInt = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\nP.equals = P.eq = function (y) {\r\n return this.cmp(y) === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of negative Infinity.\r\n *\r\n */\r\nP.floor = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 3);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\nP.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\nP.greaterThanOrEqualTo = P.gte = function (y) {\r\n var k = this.cmp(y);\r\n return k == 1 || k === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [1, Infinity]\r\n *\r\n * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...\r\n *\r\n * cosh(0) = 1\r\n * cosh(-0) = 1\r\n * cosh(Infinity) = Infinity\r\n * cosh(-Infinity) = Infinity\r\n * cosh(NaN) = NaN\r\n *\r\n * x time taken (ms) result\r\n * 1000 9 9.8503555700852349694e+433\r\n * 10000 25 4.4034091128314607936e+4342\r\n * 100000 171 1.4033316802130615897e+43429\r\n * 1000000 3817 1.5166076984010437725e+434294\r\n * 10000000 abandoned after 2 minute wait\r\n *\r\n * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))\r\n *\r\n */\r\nP.hyperbolicCosine = P.cosh = function () {\r\n var k, n, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor,\r\n one = new Ctor(1);\r\n\r\n if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);\r\n if (x.isZero()) return one;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1\r\n // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n // TODO? Estimation reused from cosine() and may not be optimal here.\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n n = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n n = '2.3283064365386962890625e-10';\r\n }\r\n\r\n x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);\r\n\r\n // Reverse argument reduction\r\n var cosh2_x,\r\n i = k,\r\n d8 = new Ctor(8);\r\n for (; i--;) {\r\n cosh2_x = x.times(x);\r\n x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));\r\n }\r\n\r\n return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...\r\n *\r\n * sinh(0) = 0\r\n * sinh(-0) = -0\r\n * sinh(Infinity) = Infinity\r\n * sinh(-Infinity) = -Infinity\r\n * sinh(NaN) = NaN\r\n *\r\n * x time taken (ms)\r\n * 10 2 ms\r\n * 100 5 ms\r\n * 1000 14 ms\r\n * 10000 82 ms\r\n * 100000 886 ms 1.4033316802130615897e+43429\r\n * 200000 2613 ms\r\n * 300000 5407 ms\r\n * 400000 8824 ms\r\n * 500000 13026 ms 8.7080643612718084129e+217146\r\n * 1000000 48543 ms\r\n *\r\n * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))\r\n *\r\n */\r\nP.hyperbolicSine = P.sinh = function () {\r\n var k, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n } else {\r\n\r\n // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))\r\n // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))\r\n // 3 multiplications and 1 addition\r\n\r\n // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))\r\n // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))\r\n // 4 multiplications and 2 additions\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n\r\n // Reverse argument reduction\r\n var sinh2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sinh2_x = x.times(x);\r\n x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));\r\n }\r\n }\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * tanh(x) = sinh(x) / cosh(x)\r\n *\r\n * tanh(0) = 0\r\n * tanh(-0) = -0\r\n * tanh(Infinity) = 1\r\n * tanh(-Infinity) = -1\r\n * tanh(NaN) = NaN\r\n *\r\n */\r\nP.hyperbolicTangent = P.tanh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(x.s);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 7;\r\n Ctor.rounding = 1;\r\n\r\n return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of\r\n * this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [0, pi]\r\n *\r\n * acos(x) = pi/2 - asin(x)\r\n *\r\n * acos(0) = pi/2\r\n * acos(-0) = pi/2\r\n * acos(1) = 0\r\n * acos(-1) = pi\r\n * acos(1/2) = pi/3\r\n * acos(-1/2) = 2*pi/3\r\n * acos(|x| > 1) = NaN\r\n * acos(NaN) = NaN\r\n *\r\n */\r\nP.inverseCosine = P.acos = function () {\r\n var halfPi,\r\n x = this,\r\n Ctor = x.constructor,\r\n k = x.abs().cmp(1),\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n return k === 0\r\n // |x| is 1\r\n ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)\r\n // |x| > 1 or x is NaN\r\n : new Ctor(NaN);\r\n }\r\n\r\n if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.asin();\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return halfPi.minus(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [1, Infinity]\r\n * Range: [0, Infinity]\r\n *\r\n * acosh(x) = ln(x + sqrt(x^2 - 1))\r\n *\r\n * acosh(x < 1) = NaN\r\n * acosh(NaN) = NaN\r\n * acosh(Infinity) = Infinity\r\n * acosh(-Infinity) = NaN\r\n * acosh(0) = NaN\r\n * acosh(-0) = NaN\r\n * acosh(1) = 0\r\n * acosh(-1) = NaN\r\n *\r\n */\r\nP.inverseHyperbolicCosine = P.acosh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);\r\n if (!x.isFinite()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).minus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * asinh(x) = ln(x + sqrt(x^2 + 1))\r\n *\r\n * asinh(NaN) = NaN\r\n * asinh(Infinity) = Infinity\r\n * asinh(-Infinity) = -Infinity\r\n * asinh(0) = 0\r\n * asinh(-0) = -0\r\n *\r\n */\r\nP.inverseHyperbolicSine = P.asinh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).plus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * atanh(x) = 0.5 * ln((1 + x) / (1 - x))\r\n *\r\n * atanh(|x| > 1) = NaN\r\n * atanh(NaN) = NaN\r\n * atanh(Infinity) = NaN\r\n * atanh(-Infinity) = NaN\r\n * atanh(0) = 0\r\n * atanh(-0) = -0\r\n * atanh(1) = Infinity\r\n * atanh(-1) = -Infinity\r\n *\r\n */\r\nP.inverseHyperbolicTangent = P.atanh = function () {\r\n var pr, rm, wpr, xsd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n xsd = x.sd();\r\n\r\n if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);\r\n\r\n Ctor.precision = wpr = xsd - x.e;\r\n\r\n x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);\r\n\r\n Ctor.precision = pr + 4;\r\n Ctor.rounding = 1;\r\n\r\n x = x.ln();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(0.5);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))\r\n *\r\n * asin(0) = 0\r\n * asin(-0) = -0\r\n * asin(1/2) = pi/6\r\n * asin(-1/2) = -pi/6\r\n * asin(1) = pi/2\r\n * asin(-1) = -pi/2\r\n * asin(|x| > 1) = NaN\r\n * asin(NaN) = NaN\r\n *\r\n * TODO? Compare performance of Taylor series.\r\n *\r\n */\r\nP.inverseSine = P.asin = function () {\r\n var halfPi, k,\r\n pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n k = x.abs().cmp(1);\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n\r\n // |x| is 1\r\n if (k === 0) {\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n halfPi.s = x.s;\r\n return halfPi;\r\n }\r\n\r\n // |x| > 1 or x is NaN\r\n return new Ctor(NaN);\r\n }\r\n\r\n // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n *\r\n * atan(0) = 0\r\n * atan(-0) = -0\r\n * atan(1) = pi/4\r\n * atan(-1) = -pi/4\r\n * atan(Infinity) = pi/2\r\n * atan(-Infinity) = -pi/2\r\n * atan(NaN) = NaN\r\n *\r\n */\r\nP.inverseTangent = P.atan = function () {\r\n var i, j, k, n, px, t, r, wpr, x2,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (!x.isFinite()) {\r\n if (!x.s) return new Ctor(NaN);\r\n if (pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.5);\r\n r.s = x.s;\r\n return r;\r\n }\r\n } else if (x.isZero()) {\r\n return new Ctor(x);\r\n } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.25);\r\n r.s = x.s;\r\n return r;\r\n }\r\n\r\n Ctor.precision = wpr = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);\r\n\r\n // Argument reduction\r\n // Ensure |x| < 0.42\r\n // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))\r\n\r\n k = Math.min(28, wpr / LOG_BASE + 2 | 0);\r\n\r\n for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));\r\n\r\n external = false;\r\n\r\n j = Math.ceil(wpr / LOG_BASE);\r\n n = 1;\r\n x2 = x.times(x);\r\n r = new Ctor(x);\r\n px = x;\r\n\r\n // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n for (; i !== -1;) {\r\n px = px.times(x2);\r\n t = r.minus(px.div(n += 2));\r\n\r\n px = px.times(x2);\r\n r = t.plus(px.div(n += 2));\r\n\r\n if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;);\r\n }\r\n\r\n if (k) r = r.times(2 << (k - 1));\r\n\r\n external = true;\r\n\r\n return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is a finite number, otherwise return false.\r\n *\r\n */\r\nP.isFinite = function () {\r\n return !!this.d;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\nP.isInteger = P.isInt = function () {\r\n return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is NaN, otherwise return false.\r\n *\r\n */\r\nP.isNaN = function () {\r\n return !this.s;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\nP.isNegative = P.isNeg = function () {\r\n return this.s < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\nP.isPositive = P.isPos = function () {\r\n return this.s > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is 0 or -0, otherwise return false.\r\n *\r\n */\r\nP.isZero = function () {\r\n return !!this.d && this.d[0] === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n};\r\n\r\n\r\n/*\r\n * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * If no base is specified, return log[10](arg).\r\n *\r\n * log[base](arg) = ln(arg) / ln(base)\r\n *\r\n * The result will always be correctly rounded if the base of the log is 10, and 'almost always'\r\n * otherwise:\r\n *\r\n * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen\r\n * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error\r\n * between the result and the correctly rounded result will be one ulp (unit in the last place).\r\n *\r\n * log[-b](a) = NaN\r\n * log[0](a) = NaN\r\n * log[1](a) = NaN\r\n * log[NaN](a) = NaN\r\n * log[Infinity](a) = NaN\r\n * log[b](0) = -Infinity\r\n * log[b](-0) = -Infinity\r\n * log[b](-a) = NaN\r\n * log[b](1) = 0\r\n * log[b](Infinity) = Infinity\r\n * log[b](NaN) = NaN\r\n *\r\n * [base] {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nP.logarithm = P.log = function (base) {\r\n var isBase10, d, denominator, k, inf, num, sd, r,\r\n arg = this,\r\n Ctor = arg.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding,\r\n guard = 5;\r\n\r\n // Default base is 10.\r\n if (base == null) {\r\n base = new Ctor(10);\r\n isBase10 = true;\r\n } else {\r\n base = new Ctor(base);\r\n d = base.d;\r\n\r\n // Return NaN if base is negative, or non-finite, or is 0 or 1.\r\n if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);\r\n\r\n isBase10 = base.eq(10);\r\n }\r\n\r\n d = arg.d;\r\n\r\n // Is arg negative, non-finite, 0 or 1?\r\n if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {\r\n return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);\r\n }\r\n\r\n // The result will have a non-terminating decimal expansion if base is 10 and arg is not an\r\n // integer power of 10.\r\n if (isBase10) {\r\n if (d.length > 1) {\r\n inf = true;\r\n } else {\r\n for (k = d[0]; k % 10 === 0;) k /= 10;\r\n inf = k !== 1;\r\n }\r\n }\r\n\r\n external = false;\r\n sd = pr + guard;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n\r\n // The result will have 5 rounding digits.\r\n r = divide(num, denominator, sd, 1);\r\n\r\n // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,\r\n // calculate 10 further digits.\r\n //\r\n // If the result is known to have an infinite decimal expansion, repeat this until it is clear\r\n // that the result is above or below the boundary. Otherwise, if after calculating the 10\r\n // further digits, the last 14 are nines, round up and assume the result is exact.\r\n // Also assume the result is exact if the last 14 are zero.\r\n //\r\n // Example of a result that will be incorrectly rounded:\r\n // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...\r\n // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it\r\n // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so\r\n // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal\r\n // place is still 2.6.\r\n if (checkRoundingDigits(r.d, k = pr, rm)) {\r\n\r\n do {\r\n sd += 10;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n r = divide(num, denominator, sd, 1);\r\n\r\n if (!inf) {\r\n\r\n // Check for 14 nines from the 2nd rounding digit, as the first may be 4.\r\n if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n\r\n break;\r\n }\r\n } while (checkRoundingDigits(r.d, k += 10, rm));\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.max = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'lt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.min = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'gt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.minus = P.sub = function (y) {\r\n var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return y negated if x is finite and y is \u00B1Infinity.\r\n else if (x.d) y.s = -y.s;\r\n\r\n // Return x if y is finite and x is \u00B1Infinity.\r\n // Return x if both are \u00B1Infinity with different signs.\r\n // Return NaN if both are \u00B1Infinity with the same sign.\r\n else y = new Ctor(y.d || x.s !== y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.plus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return y negated if x is zero and y is non-zero.\r\n if (yd[0]) y.s = -y.s;\r\n\r\n // Return x if y is zero and x is non-zero.\r\n else if (xd[0]) y = new Ctor(x);\r\n\r\n // Return zero if both are zero.\r\n // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.\r\n else return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n e = mathfloor(y.e / LOG_BASE);\r\n xe = mathfloor(x.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of\r\n // zeros needing to be prepended, but this can be avoided while still ensuring correct\r\n // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to `xd` if shorter.\r\n // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * The result depends on the modulo mode.\r\n *\r\n */\r\nP.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // Return NaN if x is \u00B1Infinity or NaN, or y is NaN or \u00B10.\r\n if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);\r\n\r\n // Return x if y is \u00B1Infinity or x is \u00B10.\r\n if (!y.d || x.d && !x.d[0]) {\r\n return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);\r\n }\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n\r\n if (Ctor.modulo == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // result = x - q * y where 0 <= result < abs(y)\r\n q = divide(x, y.abs(), 0, 3, 1);\r\n q.s *= y.s;\r\n } else {\r\n q = divide(x, y, 0, Ctor.modulo, 1);\r\n }\r\n\r\n q = q.times(y);\r\n\r\n external = true;\r\n\r\n return x.minus(q);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalExponential = P.exp = function () {\r\n return naturalExponential(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalLogarithm = P.ln = function () {\r\n return naturalLogarithm(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\nP.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.plus = P.add = function (y) {\r\n var carry, d, e, i, k, len, pr, rm, xd, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return x if y is finite and x is \u00B1Infinity.\r\n // Return x if both are \u00B1Infinity with the same sign.\r\n // Return NaN if both are \u00B1Infinity with different signs.\r\n // Return y if x is finite and y is \u00B1Infinity.\r\n else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.minus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!yd[0]) y = new Ctor(x);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n k = mathfloor(x.e / LOG_BASE);\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\nP.precision = P.sd = function (z) {\r\n var k,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n if (x.d) {\r\n k = getPrecision(x.d);\r\n if (z && x.e + 1 > k) k = x.e + 1;\r\n } else {\r\n k = NaN;\r\n }\r\n\r\n return k;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\nP.round = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n return finalise(new Ctor(x), x.e + 1, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n *\r\n * sin(0) = 0\r\n * sin(-0) = -0\r\n * sin(Infinity) = NaN\r\n * sin(-Infinity) = NaN\r\n * sin(NaN) = NaN\r\n *\r\n */\r\nP.sine = P.sin = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = sine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n */\r\nP.squareRoot = P.sqrt = function () {\r\n var m, n, sd, r, rep, t,\r\n x = this,\r\n d = x.d,\r\n e = x.e,\r\n s = x.s,\r\n Ctor = x.constructor;\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !d || !d[0]) {\r\n return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);\r\n }\r\n\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(d);\r\n\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * tan(0) = 0\r\n * tan(-0) = -0\r\n * tan(Infinity) = NaN\r\n * tan(-Infinity) = NaN\r\n * tan(NaN) = NaN\r\n *\r\n */\r\nP.tangent = P.tan = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n x = x.sin();\r\n x.s = 1;\r\n x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n y.s *= x.s;\r\n\r\n // If either is NaN, \u00B1Infinity or \u00B10...\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd\r\n\r\n // Return NaN if either is NaN.\r\n // Return NaN if x is \u00B10 and y is \u00B1Infinity, or y is \u00B10 and x is \u00B1Infinity.\r\n ? NaN\r\n\r\n // Return \u00B1Infinity if either is \u00B1Infinity.\r\n // Return \u00B10 if either is \u00B10.\r\n : !xd || !yd ? y.s / 0 : y.s * 0);\r\n }\r\n\r\n e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = getBase10Exponent(r, e);\r\n\r\n return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 2, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toBinary = function (sd, rm) {\r\n return toStringBinary(this, 2, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toDecimalPlaces = P.toDP = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return finalise(x, dp + x.e + 1, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), dp + 1, rm);\r\n str = finiteToString(x, true, dp + 1);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\nP.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = finalise(new Ctor(x), dp + x.e + 1, rm);\r\n str = finiteToString(y, false, dp + y.e + 1);\r\n }\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return an array representing the value of this Decimal as a simple fraction with an integer\r\n * numerator and an integer denominator.\r\n *\r\n * The denominator will be a positive non-zero value less than or equal to the specified maximum\r\n * denominator. If a maximum denominator is not specified, the denominator will be the lowest\r\n * value necessary to represent the number exactly.\r\n *\r\n * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity.\r\n *\r\n */\r\nP.toFraction = function (maxD) {\r\n var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r,\r\n x = this,\r\n xd = x.d,\r\n Ctor = x.constructor;\r\n\r\n if (!xd) return new Ctor(x);\r\n\r\n n1 = d0 = new Ctor(1);\r\n d1 = n0 = new Ctor(0);\r\n\r\n d = new Ctor(d1);\r\n e = d.e = getPrecision(xd) - x.e - 1;\r\n k = e % LOG_BASE;\r\n d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);\r\n\r\n if (maxD == null) {\r\n\r\n // d is 10**e, the minimum max-denominator needed.\r\n maxD = e > 0 ? d : n1;\r\n } else {\r\n n = new Ctor(maxD);\r\n if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);\r\n maxD = n.gt(d) ? (e > 0 ? d : n1) : n;\r\n }\r\n\r\n external = false;\r\n n = new Ctor(digitsToString(xd));\r\n pr = Ctor.precision;\r\n Ctor.precision = e = xd.length * LOG_BASE * 2;\r\n\r\n for (;;) {\r\n q = divide(n, d, 0, 1, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.cmp(maxD) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n d2 = n1;\r\n n1 = n0.plus(q.times(d2));\r\n n0 = d2;\r\n d2 = d;\r\n d = n.minus(q.times(d2));\r\n n = d2;\r\n }\r\n\r\n d2 = divide(maxD.minus(d0), d1, 0, 1, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1?\r\n r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1\r\n ? [n1, d1] : [n0, d0];\r\n\r\n Ctor.precision = pr;\r\n external = true;\r\n\r\n return r;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 16, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toHexadecimal = P.toHex = function (sd, rm) {\r\n return toStringBinary(this, 16, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding\r\n * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.\r\n *\r\n * The return value will always have the same sign as this Decimal, unless either this Decimal\r\n * or `y` is NaN, in which case the return value will be also be NaN.\r\n *\r\n * The return value is not affected by the value of `precision`.\r\n *\r\n * y {number|string|Decimal} The magnitude to round to a multiple of.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toNearest() rounding mode not an integer: {rm}'\r\n * 'toNearest() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toNearest = function (y, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n\r\n if (y == null) {\r\n\r\n // If x is not finite, return x.\r\n if (!x.d) return x;\r\n\r\n y = new Ctor(1);\r\n rm = Ctor.rounding;\r\n } else {\r\n y = new Ctor(y);\r\n if (rm === void 0) {\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(rm, 0, 8);\r\n }\r\n\r\n // If x is not finite, return x if y is not NaN, else NaN.\r\n if (!x.d) return y.s ? x : y;\r\n\r\n // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.\r\n if (!y.d) {\r\n if (y.s) y.s = x.s;\r\n return y;\r\n }\r\n }\r\n\r\n // If y is not zero, calculate the nearest multiple of y to x.\r\n if (y.d[0]) {\r\n external = false;\r\n x = divide(x, y, 0, rm, 1).times(y);\r\n external = true;\r\n finalise(x);\r\n\r\n // If y is zero, return zero with the sign of x.\r\n } else {\r\n y.s = x.s;\r\n x = y;\r\n }\r\n\r\n return x;\r\n};\r\n\r\n\r\n/*\r\n * Return the value of this Decimal converted to a number primitive.\r\n * Zero keeps its sign.\r\n *\r\n */\r\nP.toNumber = function () {\r\n return +this;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 8, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toOctal = function (sd, rm) {\r\n return toStringBinary(this, 8, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded\r\n * to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * ECMAScript compliant.\r\n *\r\n * pow(x, NaN) = NaN\r\n * pow(x, \u00B10) = 1\r\n\r\n * pow(NaN, non-zero) = NaN\r\n * pow(abs(x) > 1, +Infinity) = +Infinity\r\n * pow(abs(x) > 1, -Infinity) = +0\r\n * pow(abs(x) == 1, \u00B1Infinity) = NaN\r\n * pow(abs(x) < 1, +Infinity) = +0\r\n * pow(abs(x) < 1, -Infinity) = +Infinity\r\n * pow(+Infinity, y > 0) = +Infinity\r\n * pow(+Infinity, y < 0) = +0\r\n * pow(-Infinity, odd integer > 0) = -Infinity\r\n * pow(-Infinity, even integer > 0) = +Infinity\r\n * pow(-Infinity, odd integer < 0) = -0\r\n * pow(-Infinity, even integer < 0) = +0\r\n * pow(+0, y > 0) = +0\r\n * pow(+0, y < 0) = +Infinity\r\n * pow(-0, odd integer > 0) = -0\r\n * pow(-0, even integer > 0) = +0\r\n * pow(-0, odd integer < 0) = -Infinity\r\n * pow(-0, even integer < 0) = +Infinity\r\n * pow(finite x < 0, finite non-integer) = NaN\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the\r\n * probability of an incorrectly rounded result\r\n * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14\r\n * i.e. 1 in 250,000,000,000,000\r\n *\r\n * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).\r\n *\r\n * y {number|string|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\nP.toPower = P.pow = function (y) {\r\n var e, k, pr, r, rm, s,\r\n x = this,\r\n Ctor = x.constructor,\r\n yn = +(y = new Ctor(y));\r\n\r\n // Either \u00B1Infinity, NaN or \u00B10?\r\n if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));\r\n\r\n x = new Ctor(x);\r\n\r\n if (x.eq(1)) return x;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (y.eq(1)) return finalise(x, pr, rm);\r\n\r\n // y exponent\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = intPow(Ctor, x, k, pr);\r\n return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);\r\n }\r\n\r\n s = x.s;\r\n\r\n // if x is negative\r\n if (s < 0) {\r\n\r\n // if y is not an integer\r\n if (e < y.d.length - 1) return new Ctor(NaN);\r\n\r\n // Result is positive if x is negative and the last digit of integer y is even.\r\n if ((y.d[e] & 1) == 0) s = 1;\r\n\r\n // if x.eq(-1)\r\n if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {\r\n x.s = s;\r\n return x;\r\n }\r\n }\r\n\r\n // Estimate result exponent.\r\n // x^y = 10^e, where e = y * log10(x)\r\n // log10(x) = log10(x_significand) + x_exponent\r\n // log10(x_significand) = ln(x_significand) / ln(10)\r\n k = mathpow(+x, yn);\r\n e = k == 0 || !isFinite(k)\r\n ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1))\r\n : new Ctor(k + '').e;\r\n\r\n // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.\r\n\r\n // Overflow/underflow?\r\n if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);\r\n\r\n external = false;\r\n Ctor.rounding = x.s = 1;\r\n\r\n // Estimate the extra guard digits needed to ensure five correct rounding digits from\r\n // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):\r\n // new Decimal(2.32456).pow('2087987436534566.46411')\r\n // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815\r\n k = Math.min(12, (e + '').length);\r\n\r\n // r = x^y = exp(y*ln(x))\r\n r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);\r\n\r\n // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)\r\n if (r.d) {\r\n\r\n // Truncate to the required precision plus five rounding digits.\r\n r = finalise(r, pr + 5, 1);\r\n\r\n // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate\r\n // the result.\r\n if (checkRoundingDigits(r.d, pr, rm)) {\r\n e = pr + 10;\r\n\r\n // Truncate to the increased precision plus five rounding digits.\r\n r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);\r\n\r\n // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).\r\n if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n }\r\n }\r\n\r\n r.s = s;\r\n external = true;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toPrecision = function (sd, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), sd, rm);\r\n str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toSD() digits out of range: {sd}'\r\n * 'toSD() digits not an integer: {sd}'\r\n * 'toSD() rounding mode not an integer: {rm}'\r\n * 'toSD() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toSignificantDigits = P.toSD = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return finalise(new Ctor(x), sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\nP.toString = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.\r\n *\r\n */\r\nP.truncated = P.trunc = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 1);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n * Unlike `toString`, negative zero will include the minus sign.\r\n *\r\n */\r\nP.valueOf = P.toJSON = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() ? '-' + str : str;\r\n};\r\n\r\n\r\n// Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n/*\r\n * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,\r\n * finiteToString, naturalExponential, naturalLogarithm\r\n * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,\r\n * P.toPrecision, P.toSignificantDigits, toStringBinary, random\r\n * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm\r\n * convertBase toStringBinary, parseOther\r\n * cos P.cos\r\n * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,\r\n * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,\r\n * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,\r\n * taylorSeries, atan2, parseOther\r\n * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,\r\n * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,\r\n * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,\r\n * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,\r\n * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,\r\n * P.truncated, divide, getLn10, getPi, naturalExponential,\r\n * naturalLogarithm, ceil, floor, round, trunc\r\n * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,\r\n * toStringBinary\r\n * getBase10Exponent P.minus, P.plus, P.times, parseOther\r\n * getLn10 P.logarithm, naturalLogarithm\r\n * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2\r\n * getPrecision P.precision, P.toFraction\r\n * getZeroString digitsToString, finiteToString\r\n * intPow P.toPower, parseOther\r\n * isOdd toLessThanHalfPi\r\n * maxOrMin max, min\r\n * naturalExponential P.naturalExponential, P.toPower\r\n * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,\r\n * P.toPower, naturalExponential\r\n * nonFiniteToString finiteToString, toStringBinary\r\n * parseDecimal Decimal\r\n * parseOther Decimal\r\n * sin P.sin\r\n * taylorSeries P.cosh, P.sinh, cos, sin\r\n * toLessThanHalfPi P.cos, P.sin\r\n * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal\r\n * truncate intPow\r\n *\r\n * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,\r\n * naturalLogarithm, config, parseOther, random, Decimal\r\n */\r\n\r\n\r\nfunction digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n}\r\n\r\n\r\nfunction checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Check 5 rounding digits if `repeating` is null, 4 otherwise.\r\n * `repeating == null` if caller is `log` or `pow`,\r\n * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.\r\n */\r\nfunction checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n// Convert string of `baseIn` to an array of numbers of `baseOut`.\r\n// Eg. convertBase('255', 10, 16) returns [15, 15].\r\n// Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\r\nfunction convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n}\r\n\r\n\r\n/*\r\n * cos(x) = 1 - x^2/2! + x^4/4! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction cosine(Ctor, x) {\r\n var k, len, y;\r\n\r\n if (x.isZero()) return x;\r\n\r\n // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1\r\n // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n len = x.d.length;\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n y = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n y = '2.3283064365386962890625e-10';\r\n }\r\n\r\n Ctor.precision += k;\r\n\r\n x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));\r\n\r\n // Reverse argument reduction\r\n for (var i = k; i--;) {\r\n var cos2x = x.times(x);\r\n x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);\r\n }\r\n\r\n Ctor.precision -= k;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Perform division in the specified base.\r\n */\r\nvar divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k, base) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % base | 0;\r\n carry = temp / base | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, rm, dp, base) {\r\n var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0,\r\n yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(// Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :\r\n\r\n // Return \u00B10 if x is 0 or y is \u00B1Infinity, or return \u00B1Infinity as y is 0.\r\n xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);\r\n }\r\n\r\n if (base) {\r\n logBase = 1;\r\n e = x.e - y.e;\r\n } else {\r\n base = BASE;\r\n logBase = LOG_BASE;\r\n e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);\r\n }\r\n\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n // The digit array of a Decimal from toStringBinary may have trailing zeros.\r\n for (i = 0; yd[i] == (xd[i] || 0); i++);\r\n\r\n if (yd[i] > (xd[i] || 0)) e--;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else if (dp) {\r\n sd = pr + (x.e - y.e) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) {\r\n qd.push(1);\r\n more = true;\r\n } else {\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / logBase + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * base + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n more = k || i < xL;\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= base/2\r\n k = base / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k, base);\r\n xd = multiplyInteger(xd, k, base);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= base / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= base) k = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL, base);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL, base);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n\r\n more = rem[0] !== void 0;\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n }\r\n\r\n // logBase is 1 when divide is being used for base conversion.\r\n if (logBase == 1) {\r\n q.e = e;\r\n inexact = more;\r\n } else {\r\n\r\n // To calculate q.e, first get the number of digits of qd[0].\r\n for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;\r\n q.e = i + e * logBase - 1;\r\n\r\n finalise(q, dp ? pr + q.e + 1 : pr, rm, more);\r\n }\r\n\r\n return q;\r\n };\r\n})();\r\n\r\n\r\n/*\r\n * Round `x` to `sd` significant digits using rounding mode `rm`.\r\n * Check for over/under-flow.\r\n */\r\n function finalise(x, sd, rm, isTruncated) {\r\n var digits, i, j, k, rd, roundUp, w, xd, xdi,\r\n Ctor = x.constructor;\r\n\r\n // Don't round if sd is null or undefined.\r\n out: if (sd != null) {\r\n xd = x.d;\r\n\r\n // Infinity/NaN.\r\n if (!xd) return x;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd containing rd, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // digits: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;\r\n i = sd - digits;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / mathpow(10, digits - j - 1) % 10 | 0;\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) {\r\n if (isTruncated) {\r\n\r\n // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.\r\n for (; k++ <= xdi;) xd.push(0);\r\n w = rd = 0;\r\n digits = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (digits = 1; k >= 10; k /= 10) digits++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - digits.\r\n j = i - LOG_BASE + digits;\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;\r\n }\r\n }\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n isTruncated = isTruncated || sd < 0 ||\r\n xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));\r\n\r\n // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right\r\n // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression\r\n // will give 714.\r\n\r\n roundUp = rm < 4\r\n ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xd[0]) {\r\n xd.length = 0;\r\n if (roundUp) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xd[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (roundUp) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n\r\n // i will be the length of xd[0] before k is added.\r\n for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;\r\n j = xd[0] += k;\r\n for (k = 1; j >= 10; j /= 10) k++;\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xd[0] == BASE) xd[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n }\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > Ctor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < Ctor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // Ctor.underflow = true;\r\n } // else Ctor.underflow = false;\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\nfunction finiteToString(x, isExp, sd) {\r\n if (!x.isFinite()) return nonFiniteToString(x);\r\n var k,\r\n e = x.e,\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (x.e < 0 ? 'e' : 'e+') + x.e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return str;\r\n}\r\n\r\n\r\n// Calculate the base 10 exponent from the base 1e7 exponent.\r\nfunction getBase10Exponent(digits, e) {\r\n var w = digits[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for ( e *= LOG_BASE; w >= 10; w /= 10) e++;\r\n return e;\r\n}\r\n\r\n\r\nfunction getLn10(Ctor, sd, pr) {\r\n if (sd > LN10_PRECISION) {\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(precisionLimitExceeded);\r\n }\r\n return finalise(new Ctor(LN10), sd, 1, true);\r\n}\r\n\r\n\r\nfunction getPi(Ctor, sd, rm) {\r\n if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);\r\n return finalise(new Ctor(PI), sd, rm, true);\r\n}\r\n\r\n\r\nfunction getPrecision(digits) {\r\n var w = digits.length - 1,\r\n len = w * LOG_BASE + 1;\r\n\r\n w = digits[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) len--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = digits[0]; w >= 10; w /= 10) len++;\r\n }\r\n\r\n return len;\r\n}\r\n\r\n\r\nfunction getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an\r\n * integer of type number.\r\n *\r\n * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.\r\n *\r\n */\r\nfunction intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n}\r\n\r\n\r\nfunction isOdd(n) {\r\n return n.d[n.d.length - 1] & 1;\r\n}\r\n\r\n\r\n/*\r\n * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.\r\n */\r\nfunction maxOrMin(Ctor, args, ltgt) {\r\n var y,\r\n x = new Ctor(args[0]),\r\n i = 0;\r\n\r\n for (; ++i < args.length;) {\r\n y = new Ctor(args[i]);\r\n if (!y.s) {\r\n x = y;\r\n break;\r\n } else if (x[ltgt](y)) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000\r\n * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(Infinity) = Infinity\r\n * exp(-Infinity) = 0\r\n * exp(NaN) = NaN\r\n * exp(\u00B10) = 1\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n * The result will always be correctly rounded.\r\n *\r\n */\r\nfunction naturalExponential(x, sd) {\r\n var denominator, guard, j, pow, sum, t, wpr,\r\n rep = 0,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // 0/NaN/Infinity?\r\n if (!x.d || !x.d[0] || x.e > 17) {\r\n\r\n return new Ctor(x.d\r\n ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0\r\n : x.s ? x.s < 0 ? 0 : x : 0 / 0);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n // while abs(x) >= 0.1\r\n while (x.e > -2) {\r\n\r\n // x = x / 2^5\r\n x = x.times(t);\r\n k += 5;\r\n }\r\n\r\n // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision\r\n // necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(1);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = finalise(pow.times(x), wpr, 1);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n j = k;\r\n while (j--) sum = finalise(sum.times(sum), wpr, 1);\r\n\r\n // Check to see if the first 4 rounding digits are [49]999.\r\n // If so, repeat the summation with a higher precision, otherwise\r\n // e.g. with precision: 18, rounding: 1\r\n // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n\r\n if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += 10;\r\n denominator = pow = t = new Ctor(1);\r\n i = 0;\r\n rep++;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * ln(-n) = NaN\r\n * ln(0) = -Infinity\r\n * ln(-0) = -Infinity\r\n * ln(1) = 0\r\n * ln(Infinity) = Infinity\r\n * ln(-Infinity) = NaN\r\n * ln(NaN) = NaN\r\n *\r\n * ln(n) (n != 1) is non-terminating.\r\n *\r\n */\r\nfunction naturalLogarithm(y, sd) {\r\n var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // Is x negative or Infinity, NaN, 0 or 1?\r\n if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {\r\n return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n Ctor.precision = wpr += guard;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n\r\n if (Math.abs(e = x.e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = x.e;\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n Ctor.precision = pr;\r\n\r\n return sd == null ? finalise(x, pr, rm, external = true) : x;\r\n }\r\n\r\n // x1 is x reduced to a value near 1.\r\n x1 = x;\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = finalise(numerator.times(x2), wpr, 1);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction. Check that e is not 0 because, besides preventing an\r\n // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr, 1);\r\n\r\n // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n // been repeated previously) and the first 4 rounding digits 9999?\r\n // If so, restart the summation with a higher precision, otherwise\r\n // e.g. with precision: 12, rounding: 1\r\n // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += guard;\r\n t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = rep = 1;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n}\r\n\r\n\r\n// \u00B1Infinity, NaN.\r\nfunction nonFiniteToString(x) {\r\n // Unsigned.\r\n return String(x.s * x.s / 0);\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\nfunction parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.\r\n */\r\nfunction parseOther(x, str) {\r\n var base, Ctor, divisor, i, isFloat, len, p, xd, xe;\r\n\r\n if (str.indexOf('_') > -1) {\r\n str = str.replace(/(\\d)_(?=\\d)/g, '$1');\r\n if (isDecimal.test(str)) return parseDecimal(x, str);\r\n } else if (str === 'Infinity' || str === 'NaN') {\r\n if (!+str) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return x;\r\n }\r\n\r\n if (isHex.test(str)) {\r\n base = 16;\r\n str = str.toLowerCase();\r\n } else if (isBinary.test(str)) {\r\n base = 2;\r\n } else if (isOctal.test(str)) {\r\n base = 8;\r\n } else {\r\n throw Error(invalidArgument + str);\r\n }\r\n\r\n // Is there a binary exponent part?\r\n i = str.search(/p/i);\r\n\r\n if (i > 0) {\r\n p = +str.slice(i + 1);\r\n str = str.substring(2, i);\r\n } else {\r\n str = str.slice(2);\r\n }\r\n\r\n // Convert `str` as an integer then divide the result by `base` raised to a power such that the\r\n // fraction part will be restored.\r\n i = str.indexOf('.');\r\n isFloat = i >= 0;\r\n Ctor = x.constructor;\r\n\r\n if (isFloat) {\r\n str = str.replace('.', '');\r\n len = str.length;\r\n i = len - i;\r\n\r\n // log[10](16) = 1.2041... , log[10](88) = 1.9444....\r\n divisor = intPow(Ctor, new Ctor(base), i, i * 2);\r\n }\r\n\r\n xd = convertBase(str, base, BASE);\r\n xe = xd.length - 1;\r\n\r\n // Remove trailing zeros.\r\n for (i = xe; xd[i] === 0; --i) xd.pop();\r\n if (i < 0) return new Ctor(x.s * 0);\r\n x.e = getBase10Exponent(xd, xe);\r\n x.d = xd;\r\n external = false;\r\n\r\n // At what precision to perform the division to ensure exact conversion?\r\n // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)\r\n // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412\r\n // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.\r\n // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount\r\n // Therefore using 4 * the number of digits of str will always be enough.\r\n if (isFloat) x = divide(x, divisor, len * 4);\r\n\r\n // Multiply by the binary exponent part if present.\r\n if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));\r\n external = true;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction sine(Ctor, x) {\r\n var k,\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);\r\n }\r\n\r\n // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)\r\n // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)\r\n // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x);\r\n\r\n // Reverse argument reduction\r\n var sin2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sin2_x = x.times(x);\r\n x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n// Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.\r\nfunction taylorSeries(Ctor, n, x, y, isHyperbolic) {\r\n var j, t, u, x2,\r\n i = 1,\r\n pr = Ctor.precision,\r\n k = Math.ceil(pr / LOG_BASE);\r\n\r\n external = false;\r\n x2 = x.times(x);\r\n u = new Ctor(y);\r\n\r\n for (;;) {\r\n t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\r\n u = isHyperbolic ? y.plus(t) : y.minus(t);\r\n y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);\r\n t = u.plus(y);\r\n\r\n if (t.d[k] !== void 0) {\r\n for (j = k; t.d[j] === u.d[j] && j--;);\r\n if (j == -1) break;\r\n }\r\n\r\n j = u;\r\n u = y;\r\n y = t;\r\n t = j;\r\n i++;\r\n }\r\n\r\n external = true;\r\n t.d.length = k + 1;\r\n\r\n return t;\r\n}\r\n\r\n\r\n// Exponent e must be positive and non-zero.\r\nfunction tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n}\r\n\r\n\r\n// Return the absolute value of `x` reduced to less than or equal to half pi.\r\nfunction toLessThanHalfPi(Ctor, x) {\r\n var t,\r\n isNeg = x.s < 0,\r\n pi = getPi(Ctor, Ctor.precision, 1),\r\n halfPi = pi.times(0.5);\r\n\r\n x = x.abs();\r\n\r\n if (x.lte(halfPi)) {\r\n quadrant = isNeg ? 4 : 1;\r\n return x;\r\n }\r\n\r\n t = x.divToInt(pi);\r\n\r\n if (t.isZero()) {\r\n quadrant = isNeg ? 3 : 2;\r\n } else {\r\n x = x.minus(t.times(pi));\r\n\r\n // 0 <= x < pi\r\n if (x.lte(halfPi)) {\r\n quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1);\r\n return x;\r\n }\r\n\r\n quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2);\r\n }\r\n\r\n return x.minus(pi).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return the value of Decimal `x` as a string in base `baseOut`.\r\n *\r\n * If the optional `sd` argument is present include a binary exponent suffix.\r\n */\r\nfunction toStringBinary(x, baseOut, sd, rm) {\r\n var base, e, i, k, len, roundUp, str, xd, y,\r\n Ctor = x.constructor,\r\n isExp = sd !== void 0;\r\n\r\n if (isExp) {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n } else {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n }\r\n\r\n if (!x.isFinite()) {\r\n str = nonFiniteToString(x);\r\n } else {\r\n str = finiteToString(x);\r\n i = str.indexOf('.');\r\n\r\n // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:\r\n // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))\r\n // minBinaryExponent = floor(decimalExponent * log[2](10))\r\n // log[2](10) = 3.321928094887362347870319429489390175864\r\n\r\n if (isExp) {\r\n base = 2;\r\n if (baseOut == 16) {\r\n sd = sd * 4 - 3;\r\n } else if (baseOut == 8) {\r\n sd = sd * 3 - 2;\r\n }\r\n } else {\r\n base = baseOut;\r\n }\r\n\r\n // Convert the number as an integer then divide the result by its base raised to a power such\r\n // that the fraction part will be restored.\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n str = str.replace('.', '');\r\n y = new Ctor(1);\r\n y.e = str.length - i;\r\n y.d = convertBase(finiteToString(y), 10, base);\r\n y.e = y.d.length;\r\n }\r\n\r\n xd = convertBase(str, 10, base);\r\n e = len = xd.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] == 0;) xd.pop();\r\n\r\n if (!xd[0]) {\r\n str = isExp ? '0p+0' : '0';\r\n } else {\r\n if (i < 0) {\r\n e--;\r\n } else {\r\n x = new Ctor(x);\r\n x.d = xd;\r\n x.e = e;\r\n x = divide(x, y, sd, rm, 0, base);\r\n xd = x.d;\r\n e = x.e;\r\n roundUp = inexact;\r\n }\r\n\r\n // The rounding digit, i.e. the digit after the digit that may be rounded up.\r\n i = xd[sd];\r\n k = base / 2;\r\n roundUp = roundUp || xd[sd + 1] !== void 0;\r\n\r\n roundUp = rm < 4\r\n ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2))\r\n : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||\r\n rm === (x.s < 0 ? 8 : 7));\r\n\r\n xd.length = sd;\r\n\r\n if (roundUp) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (; ++xd[--sd] > base - 1;) {\r\n xd[sd] = 0;\r\n if (!sd) {\r\n ++e;\r\n xd.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n\r\n // Add binary exponent suffix?\r\n if (isExp) {\r\n if (len > 1) {\r\n if (baseOut == 16 || baseOut == 8) {\r\n i = baseOut == 16 ? 4 : 3;\r\n for (--len; len % i; len++) str += '0';\r\n xd = convertBase(str, base, baseOut);\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // xd[0] will always be be 1\r\n for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n } else {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n }\r\n\r\n str = str + (e < 0 ? 'p' : 'p+') + e;\r\n } else if (e < 0) {\r\n for (; ++e;) str = '0' + str;\r\n str = '0.' + str;\r\n } else {\r\n if (++e > len) for (e -= len; e-- ;) str += '0';\r\n else if (e < len) str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n}\r\n\r\n\r\n// Does not strip trailing zeros.\r\nfunction truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n}\r\n\r\n\r\n// Decimal methods\r\n\r\n\r\n/*\r\n * abs\r\n * acos\r\n * acosh\r\n * add\r\n * asin\r\n * asinh\r\n * atan\r\n * atanh\r\n * atan2\r\n * cbrt\r\n * ceil\r\n * clamp\r\n * clone\r\n * config\r\n * cos\r\n * cosh\r\n * div\r\n * exp\r\n * floor\r\n * hypot\r\n * ln\r\n * log\r\n * log2\r\n * log10\r\n * max\r\n * min\r\n * mod\r\n * mul\r\n * pow\r\n * random\r\n * round\r\n * set\r\n * sign\r\n * sin\r\n * sinh\r\n * sqrt\r\n * sub\r\n * sum\r\n * tan\r\n * tanh\r\n * trunc\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction abs(x) {\r\n return new this(x).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine in radians of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction acos(x) {\r\n return new this(x).acos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction acosh(x) {\r\n return new this(x).acosh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction add(x, y) {\r\n return new this(x).plus(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction asin(x) {\r\n return new this(x).asin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction asinh(x) {\r\n return new this(x).asinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction atan(x) {\r\n return new this(x).atan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction atanh(x) {\r\n return new this(x).atanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi\r\n * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi, pi]\r\n *\r\n * y {number|string|Decimal} The y-coordinate.\r\n * x {number|string|Decimal} The x-coordinate.\r\n *\r\n * atan2(\u00B10, -0) = \u00B1pi\r\n * atan2(\u00B10, +0) = \u00B10\r\n * atan2(\u00B10, -x) = \u00B1pi for x > 0\r\n * atan2(\u00B10, x) = \u00B10 for x > 0\r\n * atan2(-y, \u00B10) = -pi/2 for y > 0\r\n * atan2(y, \u00B10) = pi/2 for y > 0\r\n * atan2(\u00B1y, -Infinity) = \u00B1pi for finite y > 0\r\n * atan2(\u00B1y, +Infinity) = \u00B10 for finite y > 0\r\n * atan2(\u00B1Infinity, x) = \u00B1pi/2 for finite x\r\n * atan2(\u00B1Infinity, -Infinity) = \u00B13*pi/4\r\n * atan2(\u00B1Infinity, +Infinity) = \u00B1pi/4\r\n * atan2(NaN, x) = NaN\r\n * atan2(y, NaN) = NaN\r\n *\r\n */\r\nfunction atan2(y, x) {\r\n y = new this(y);\r\n x = new this(x);\r\n var r,\r\n pr = this.precision,\r\n rm = this.rounding,\r\n wpr = pr + 4;\r\n\r\n // Either NaN\r\n if (!y.s || !x.s) {\r\n r = new this(NaN);\r\n\r\n // Both \u00B1Infinity\r\n } else if (!y.d && !x.d) {\r\n r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);\r\n r.s = y.s;\r\n\r\n // x is \u00B1Infinity or y is \u00B10\r\n } else if (!x.d || y.isZero()) {\r\n r = x.s < 0 ? getPi(this, pr, rm) : new this(0);\r\n r.s = y.s;\r\n\r\n // y is \u00B1Infinity or x is \u00B10\r\n } else if (!y.d || x.isZero()) {\r\n r = getPi(this, wpr, 1).times(0.5);\r\n r.s = y.s;\r\n\r\n // Both non-zero and finite\r\n } else if (x.s < 0) {\r\n this.precision = wpr;\r\n this.rounding = 1;\r\n r = this.atan(divide(y, x, wpr, 1));\r\n x = getPi(this, wpr, 1);\r\n this.precision = pr;\r\n this.rounding = rm;\r\n r = y.s < 0 ? r.minus(x) : r.plus(x);\r\n } else {\r\n r = this.atan(divide(y, x, wpr, 1));\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction cbrt(x) {\r\n return new this(x).cbrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ceil(x) {\r\n return finalise(x = new this(x), x.e + 1, 2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.\r\n *\r\n * x {number|string|Decimal}\r\n * min {number|string|Decimal}\r\n * max {number|string|Decimal}\r\n *\r\n */\r\nfunction clamp(x, min, max) {\r\n return new this(x).clamp(min, max);\r\n}\r\n\r\n\r\n/*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n * maxE {number}\r\n * minE {number}\r\n * modulo {number}\r\n * crypto {boolean|number}\r\n * defaults {true}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\nfunction config(obj) {\r\n if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');\r\n var i, p, v,\r\n useDefaults = obj.defaults === true,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -EXP_LIMIT, 0,\r\n 'toExpPos', 0, EXP_LIMIT,\r\n 'maxE', 0, EXP_LIMIT,\r\n 'minE', -EXP_LIMIT, 0,\r\n 'modulo', 0, 9\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (v === true || v === false || v === 0 || v === 1) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n this[p] = true;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n } else {\r\n this[p] = false;\r\n }\r\n } else {\r\n throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n return this;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cos(x) {\r\n return new this(x).cos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cosh(x) {\r\n return new this(x).cosh();\r\n}\r\n\r\n\r\n/*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\nfunction clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * v {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(v) {\r\n var e, i, t,\r\n x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(v);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n // Duplicate.\r\n if (isDecimalInstance(v)) {\r\n x.s = v.s;\r\n\r\n if (external) {\r\n if (!v.d || v.e > Decimal.maxE) {\r\n\r\n // Infinity.\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (v.e < Decimal.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d.slice();\r\n }\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d ? v.d.slice() : v.d;\r\n }\r\n\r\n return;\r\n }\r\n\r\n t = typeof v;\r\n\r\n if (t === 'number') {\r\n if (v === 0) {\r\n x.s = 1 / v < 0 ? -1 : 1;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n if (v < 0) {\r\n v = -v;\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (v === ~~v && v < 1e7) {\r\n for (e = 0, i = v; i >= 10; i /= 10) e++;\r\n\r\n if (external) {\r\n if (e > Decimal.maxE) {\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (e < Decimal.minE) {\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n\r\n return;\r\n\r\n // Infinity, NaN.\r\n } else if (v * 0 !== 0) {\r\n if (!v) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return;\r\n }\r\n\r\n return parseDecimal(x, v.toString());\r\n\r\n } else if (t !== 'string') {\r\n throw Error(invalidArgument + v);\r\n }\r\n\r\n // Minus sign?\r\n if ((i = v.charCodeAt(0)) === 45) {\r\n v = v.slice(1);\r\n x.s = -1;\r\n } else {\r\n // Plus sign?\r\n if (i === 43) v = v.slice(1);\r\n x.s = 1;\r\n }\r\n\r\n return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n Decimal.EUCLID = 9;\r\n\r\n Decimal.config = Decimal.set = config;\r\n Decimal.clone = clone;\r\n Decimal.isDecimal = isDecimalInstance;\r\n\r\n Decimal.abs = abs;\r\n Decimal.acos = acos;\r\n Decimal.acosh = acosh; // ES6\r\n Decimal.add = add;\r\n Decimal.asin = asin;\r\n Decimal.asinh = asinh; // ES6\r\n Decimal.atan = atan;\r\n Decimal.atanh = atanh; // ES6\r\n Decimal.atan2 = atan2;\r\n Decimal.cbrt = cbrt; // ES6\r\n Decimal.ceil = ceil;\r\n Decimal.clamp = clamp;\r\n Decimal.cos = cos;\r\n Decimal.cosh = cosh; // ES6\r\n Decimal.div = div;\r\n Decimal.exp = exp;\r\n Decimal.floor = floor;\r\n Decimal.hypot = hypot; // ES6\r\n Decimal.ln = ln;\r\n Decimal.log = log;\r\n Decimal.log10 = log10; // ES6\r\n Decimal.log2 = log2; // ES6\r\n Decimal.max = max;\r\n Decimal.min = min;\r\n Decimal.mod = mod;\r\n Decimal.mul = mul;\r\n Decimal.pow = pow;\r\n Decimal.random = random;\r\n Decimal.round = round;\r\n Decimal.sign = sign; // ES6\r\n Decimal.sin = sin;\r\n Decimal.sinh = sinh; // ES6\r\n Decimal.sqrt = sqrt;\r\n Decimal.sub = sub;\r\n Decimal.sum = sum;\r\n Decimal.tan = tan;\r\n Decimal.tanh = tanh; // ES6\r\n Decimal.trunc = trunc; // ES6\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n if (obj.defaults !== true) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction div(x, y) {\r\n return new this(x).div(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The power to which to raise the base of the natural log.\r\n *\r\n */\r\nfunction exp(x) {\r\n return new this(x).exp();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction floor(x) {\r\n return finalise(x = new this(x), x.e + 1, 3);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction hypot() {\r\n var i, n,\r\n t = new this(0);\r\n\r\n external = false;\r\n\r\n for (i = 0; i < arguments.length;) {\r\n n = new this(arguments[i++]);\r\n if (!n.d) {\r\n if (n.s) {\r\n external = true;\r\n return new this(1 / 0);\r\n }\r\n t = n;\r\n } else if (t.d) {\r\n t = t.plus(n.times(n));\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return t.sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),\r\n * otherwise return false.\r\n *\r\n */\r\nfunction isDecimalInstance(obj) {\r\n return obj instanceof Decimal || obj && obj.toStringTag === tag || false;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ln(x) {\r\n return new this(x).ln();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base\r\n * is specified, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * log[y](x)\r\n *\r\n * x {number|string|Decimal} The argument of the logarithm.\r\n * y {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nfunction log(x, y) {\r\n return new this(x).log(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log2(x) {\r\n return new this(x).log(2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log10(x) {\r\n return new this(x).log(10);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction max() {\r\n return maxOrMin(this, arguments, 'lt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction min() {\r\n return maxOrMin(this, arguments, 'gt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mod(x, y) {\r\n return new this(x).mod(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mul(x, y) {\r\n return new this(x).mul(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The base.\r\n * y {number|string|Decimal} The exponent.\r\n *\r\n */\r\nfunction pow(x, y) {\r\n return new this(x).pow(y);\r\n}\r\n\r\n\r\n/*\r\n * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with\r\n * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros\r\n * are produced).\r\n *\r\n * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.\r\n *\r\n */\r\nfunction random(sd) {\r\n var d, e, k, n,\r\n i = 0,\r\n r = new this(1),\r\n rd = [];\r\n\r\n if (sd === void 0) sd = this.precision;\r\n else checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n k = Math.ceil(sd / LOG_BASE);\r\n\r\n if (!this.crypto) {\r\n for (; i < k;) rd[i++] = Math.random() * 1e7 | 0;\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n } else if (crypto.getRandomValues) {\r\n d = crypto.getRandomValues(new Uint32Array(k));\r\n\r\n for (; i < k;) {\r\n n = d[i];\r\n\r\n // 0 <= n < 4294967296\r\n // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).\r\n if (n >= 4.29e9) {\r\n d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\r\n } else {\r\n\r\n // 0 <= n <= 4289999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd[i++] = n % 1e7;\r\n }\r\n }\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n d = crypto.randomBytes(k *= 4);\r\n\r\n for (; i < k;) {\r\n\r\n // 0 <= n < 2147483648\r\n n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);\r\n\r\n // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).\r\n if (n >= 2.14e9) {\r\n crypto.randomBytes(4).copy(d, i);\r\n } else {\r\n\r\n // 0 <= n <= 2139999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd.push(n % 1e7);\r\n i += 4;\r\n }\r\n }\r\n\r\n i = k / 4;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n\r\n k = rd[--i];\r\n sd %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to sd.\r\n if (k && sd) {\r\n n = mathpow(10, LOG_BASE - sd);\r\n rd[i] = (k / n | 0) * n;\r\n }\r\n\r\n // Remove trailing words which are zero.\r\n for (; rd[i] === 0; i--) rd.pop();\r\n\r\n // Zero?\r\n if (i < 0) {\r\n e = 0;\r\n rd = [0];\r\n } else {\r\n e = -1;\r\n\r\n // Remove leading words which are zero and adjust exponent accordingly.\r\n for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\r\n\r\n // Count the digits of the first word of rd to determine leading zeros.\r\n for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\r\n\r\n // Adjust the exponent for leading zeros of the first word of rd.\r\n if (k < LOG_BASE) e -= LOG_BASE - k;\r\n }\r\n\r\n r.e = e;\r\n r.d = rd;\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.\r\n *\r\n * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction round(x) {\r\n return finalise(x = new this(x), x.e + 1, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if x > 0,\r\n * -1 if x < 0,\r\n * 0 if x is 0,\r\n * -0 if x is -0,\r\n * NaN otherwise\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sign(x) {\r\n x = new this(x);\r\n return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sin(x) {\r\n return new this(x).sin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sinh(x) {\r\n return new this(x).sinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sqrt(x) {\r\n return new this(x).sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction sub(x, y) {\r\n return new this(x).sub(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of the arguments, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * Only the result is rounded, not the intermediate calculations.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction sum() {\r\n var i = 0,\r\n args = arguments,\r\n x = new this(args[i]);\r\n\r\n external = false;\r\n for (; x.s && ++i < args.length;) x = x.plus(args[i]);\r\n external = true;\r\n\r\n return finalise(x, this.precision, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tan(x) {\r\n return new this(x).tan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tanh(x) {\r\n return new this(x).tanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` truncated to an integer.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction trunc(x) {\r\n return finalise(x = new this(x), x.e + 1, 1);\r\n}\r\n\r\n\r\nP[Symbol.for('nodejs.util.inspect.custom')] = P.toString;\r\nP[Symbol.toStringTag] = 'Decimal';\r\n\r\n// Create and configure initial Decimal constructor.\r\nexport var Decimal = P.constructor = clone(DEFAULTS);\r\n\r\n// Create the internal constants from their string values.\r\nLN10 = new Decimal(LN10);\r\nPI = new Decimal(PI);\r\n\r\nexport default Decimal;\r\n", "import Complex from 'complex.js';\nimport { format } from '../../utils/number.js';\nimport { isNumber, isUnit } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Complex';\nvar dependencies = [];\nexport var createComplexClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Attach type information\n */\n Object.defineProperty(Complex, 'name', {\n value: 'Complex'\n });\n Complex.prototype.constructor = Complex;\n Complex.prototype.type = 'Complex';\n Complex.prototype.isComplex = true;\n\n /**\n * Get a JSON representation of the complex number\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Complex\", \"re\": 2, \"im\": 3}`\n */\n Complex.prototype.toJSON = function () {\n return {\n mathjs: 'Complex',\n re: this.re,\n im: this.im\n };\n };\n\n /*\n * Return the value of the complex number in polar notation\n * The angle phi will be set in the interval of [-pi, pi].\n * @return {{r: number, phi: number}} Returns and object with properties r and phi.\n */\n Complex.prototype.toPolar = function () {\n return {\n r: this.abs(),\n phi: this.arg()\n };\n };\n\n /**\n * Get a string representation of the complex number,\n * with optional formatting options.\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @return {string} str\n */\n Complex.prototype.format = function (options) {\n var str = '';\n var im = this.im;\n var re = this.re;\n var strRe = format(this.re, options);\n var strIm = format(this.im, options);\n\n // round either re or im when smaller than the configured precision\n var precision = isNumber(options) ? options : options ? options.precision : null;\n if (precision !== null) {\n var epsilon = Math.pow(10, -precision);\n if (Math.abs(re / im) < epsilon) {\n re = 0;\n }\n if (Math.abs(im / re) < epsilon) {\n im = 0;\n }\n }\n if (im === 0) {\n // real value\n str = strRe;\n } else if (re === 0) {\n // purely complex value\n if (im === 1) {\n str = 'i';\n } else if (im === -1) {\n str = '-i';\n } else {\n str = strIm + 'i';\n }\n } else {\n // complex value\n if (im < 0) {\n if (im === -1) {\n str = strRe + ' - i';\n } else {\n str = strRe + ' - ' + strIm.substring(1) + 'i';\n }\n } else {\n if (im === 1) {\n str = strRe + ' + i';\n } else {\n str = strRe + ' + ' + strIm + 'i';\n }\n }\n }\n return str;\n };\n\n /**\n * Create a complex number from polar coordinates\n *\n * Usage:\n *\n * Complex.fromPolar(r: number, phi: number) : Complex\n * Complex.fromPolar({r: number, phi: number}) : Complex\n *\n * @param {*} args...\n * @return {Complex}\n */\n Complex.fromPolar = function (args) {\n switch (arguments.length) {\n case 1:\n {\n var arg = arguments[0];\n if (typeof arg === 'object') {\n return Complex(arg);\n } else {\n throw new TypeError('Input has to be an object with r and phi keys.');\n }\n }\n case 2:\n {\n var r = arguments[0];\n var phi = arguments[1];\n if (isNumber(r)) {\n if (isUnit(phi) && phi.hasBase('ANGLE')) {\n // convert unit to a number in radians\n phi = phi.toNumber('rad');\n }\n if (isNumber(phi)) {\n return new Complex({\n r,\n phi\n });\n }\n throw new TypeError('Phi is not a number nor an angle unit.');\n } else {\n throw new TypeError('Radius r is not a number.');\n }\n }\n default:\n throw new SyntaxError('Wrong number of arguments in function fromPolar');\n }\n };\n Complex.prototype.valueOf = Complex.prototype.toString;\n\n /**\n * Create a Complex number from a JSON object\n * @param {Object} json A JSON Object structured as\n * {\"mathjs\": \"Complex\", \"re\": 2, \"im\": 3}\n * All properties are optional, default values\n * for `re` and `im` are 0.\n * @return {Complex} Returns a new Complex number\n */\n Complex.fromJSON = function (json) {\n return new Complex(json);\n };\n\n /**\n * Compare two complex numbers, `a` and `b`:\n *\n * - Returns 1 when the real part of `a` is larger than the real part of `b`\n * - Returns -1 when the real part of `a` is smaller than the real part of `b`\n * - Returns 1 when the real parts are equal\n * and the imaginary part of `a` is larger than the imaginary part of `b`\n * - Returns -1 when the real parts are equal\n * and the imaginary part of `a` is smaller than the imaginary part of `b`\n * - Returns 0 when both real and imaginary parts are equal.\n *\n * @params {Complex} a\n * @params {Complex} b\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n Complex.compare = function (a, b) {\n if (a.re > b.re) {\n return 1;\n }\n if (a.re < b.re) {\n return -1;\n }\n if (a.im > b.im) {\n return 1;\n }\n if (a.im < b.im) {\n return -1;\n }\n return 0;\n };\n return Complex;\n}, {\n isClass: true\n});", "import Fraction from 'fraction.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Fraction';\nvar dependencies = [];\nexport var createFractionClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Attach type information\n */\n Object.defineProperty(Fraction, 'name', {\n value: 'Fraction'\n });\n Fraction.prototype.constructor = Fraction;\n Fraction.prototype.type = 'Fraction';\n Fraction.prototype.isFraction = true;\n\n /**\n * Get a JSON representation of a Fraction containing type information\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Fraction\", \"n\": 3, \"d\": 8}`\n */\n Fraction.prototype.toJSON = function () {\n return {\n mathjs: 'Fraction',\n n: this.s * this.n,\n d: this.d\n };\n };\n\n /**\n * Instantiate a Fraction from a JSON object\n * @param {Object} json a JSON object structured as:\n * `{\"mathjs\": \"Fraction\", \"n\": 3, \"d\": 8}`\n * @return {BigNumber}\n */\n Fraction.fromJSON = function (json) {\n return new Fraction(json);\n };\n return Fraction;\n}, {\n isClass: true\n});", "/**\n * @license Fraction.js v4.3.7 31/08/2023\n * https://www.xarg.org/2014/03/rational-numbers-in-javascript/\n *\n * Copyright (c) 2023, Robert Eisele (robert@raw.org)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n **/\n\n\n/**\n *\n * This class offers the possibility to calculate fractions.\n * You can pass a fraction in different formats. Either as array, as double, as string or as an integer.\n *\n * Array/Object form\n * [ 0 => , 1 => ]\n * [ n => , d => ]\n *\n * Integer form\n * - Single integer value\n *\n * Double form\n * - Single double value\n *\n * String form\n * 123.456 - a simple double\n * 123/456 - a string fraction\n * 123.'456' - a double with repeating decimal places\n * 123.(456) - synonym\n * 123.45'6' - a double with repeating last place\n * 123.45(6) - synonym\n *\n * Example:\n *\n * var f = new Fraction(\"9.4'31'\");\n * f.mul([-4, 3]).div(4.9);\n *\n */\n\n\n// Maximum search depth for cyclic rational numbers. 2000 should be more than enough.\n// Example: 1/7 = 0.(142857) has 6 repeating decimal places.\n// If MAX_CYCLE_LEN gets reduced, long cycles will not be detected and toString() only gets the first 10 digits\nvar MAX_CYCLE_LEN = 2000;\n\n// Parsed data to avoid calling \"new\" all the time\nvar P = {\n \"s\": 1,\n \"n\": 0,\n \"d\": 1\n};\n\nfunction assign(n, s) {\n\n if (isNaN(n = parseInt(n, 10))) {\n throw InvalidParameter();\n }\n return n * s;\n}\n\n// Creates a new Fraction internally without the need of the bulky constructor\nfunction newFraction(n, d) {\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n var f = Object.create(Fraction.prototype);\n f[\"s\"] = n < 0 ? -1 : 1;\n\n n = n < 0 ? -n : n;\n\n var a = gcd(n, d);\n\n f[\"n\"] = n / a;\n f[\"d\"] = d / a;\n return f;\n}\n\nfunction factorize(num) {\n\n var factors = {};\n\n var n = num;\n var i = 2;\n var s = 4;\n\n while (s <= n) {\n\n while (n % i === 0) {\n n/= i;\n factors[i] = (factors[i] || 0) + 1;\n }\n s+= 1 + 2 * i++;\n }\n\n if (n !== num) {\n if (n > 1)\n factors[n] = (factors[n] || 0) + 1;\n } else {\n factors[num] = (factors[num] || 0) + 1;\n }\n return factors;\n}\n\nvar parse = function(p1, p2) {\n\n var n = 0, d = 1, s = 1;\n var v = 0, w = 0, x = 0, y = 1, z = 1;\n\n var A = 0, B = 1;\n var C = 1, D = 1;\n\n var N = 10000000;\n var M;\n\n if (p1 === undefined || p1 === null) {\n /* void */\n } else if (p2 !== undefined) {\n n = p1;\n d = p2;\n s = n * d;\n\n if (n % 1 !== 0 || d % 1 !== 0) {\n throw NonIntegerParameter();\n }\n\n } else\n switch (typeof p1) {\n\n case \"object\":\n {\n if (\"d\" in p1 && \"n\" in p1) {\n n = p1[\"n\"];\n d = p1[\"d\"];\n if (\"s\" in p1)\n n*= p1[\"s\"];\n } else if (0 in p1) {\n n = p1[0];\n if (1 in p1)\n d = p1[1];\n } else {\n throw InvalidParameter();\n }\n s = n * d;\n break;\n }\n case \"number\":\n {\n if (p1 < 0) {\n s = p1;\n p1 = -p1;\n }\n\n if (p1 % 1 === 0) {\n n = p1;\n } else if (p1 > 0) { // check for != 0, scale would become NaN (log(0)), which converges really slow\n\n if (p1 >= 1) {\n z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10));\n p1/= z;\n }\n\n // Using Farey Sequences\n // http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/\n\n while (B <= N && D <= N) {\n M = (A + C) / (B + D);\n\n if (p1 === M) {\n if (B + D <= N) {\n n = A + C;\n d = B + D;\n } else if (D > B) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n break;\n\n } else {\n\n if (p1 > M) {\n A+= C;\n B+= D;\n } else {\n C+= A;\n D+= B;\n }\n\n if (B > N) {\n n = C;\n d = D;\n } else {\n n = A;\n d = B;\n }\n }\n }\n n*= z;\n } else if (isNaN(p1) || isNaN(p2)) {\n d = n = NaN;\n }\n break;\n }\n case \"string\":\n {\n B = p1.match(/\\d+|./g);\n\n if (B === null)\n throw InvalidParameter();\n\n if (B[A] === '-') {// Check for minus sign at the beginning\n s = -1;\n A++;\n } else if (B[A] === '+') {// Check for plus sign at the beginning\n A++;\n }\n\n if (B.length === A + 1) { // Check if it's just a simple number \"1234\"\n w = assign(B[A++], s);\n } else if (B[A + 1] === '.' || B[A] === '.') { // Check if it's a decimal number\n\n if (B[A] !== '.') { // Handle 0.5 and .5\n v = assign(B[A++], s);\n }\n A++;\n\n // Check for decimal places\n if (A + 1 === B.length || B[A + 1] === '(' && B[A + 3] === ')' || B[A + 1] === \"'\" && B[A + 3] === \"'\") {\n w = assign(B[A], s);\n y = Math.pow(10, B[A].length);\n A++;\n }\n\n // Check for repeating places\n if (B[A] === '(' && B[A + 2] === ')' || B[A] === \"'\" && B[A + 2] === \"'\") {\n x = assign(B[A + 1], s);\n z = Math.pow(10, B[A + 1].length) - 1;\n A+= 3;\n }\n\n } else if (B[A + 1] === '/' || B[A + 1] === ':') { // Check for a simple fraction \"123/456\" or \"123:456\"\n w = assign(B[A], s);\n y = assign(B[A + 2], 1);\n A+= 3;\n } else if (B[A + 3] === '/' && B[A + 1] === ' ') { // Check for a complex fraction \"123 1/2\"\n v = assign(B[A], s);\n w = assign(B[A + 2], s);\n y = assign(B[A + 4], 1);\n A+= 5;\n }\n\n if (B.length <= A) { // Check for more tokens on the stack\n d = y * z;\n s = /* void */\n n = x + d * v + z * w;\n break;\n }\n\n /* Fall through on error */\n }\n default:\n throw InvalidParameter();\n }\n\n if (d === 0) {\n throw DivisionByZero();\n }\n\n P[\"s\"] = s < 0 ? -1 : 1;\n P[\"n\"] = Math.abs(n);\n P[\"d\"] = Math.abs(d);\n};\n\nfunction modpow(b, e, m) {\n\n var r = 1;\n for (; e > 0; b = (b * b) % m, e >>= 1) {\n\n if (e & 1) {\n r = (r * b) % m;\n }\n }\n return r;\n}\n\n\nfunction cycleLen(n, d) {\n\n for (; d % 2 === 0;\n d/= 2) {\n }\n\n for (; d % 5 === 0;\n d/= 5) {\n }\n\n if (d === 1) // Catch non-cyclic numbers\n return 0;\n\n // If we would like to compute really large numbers quicker, we could make use of Fermat's little theorem:\n // 10^(d-1) % d == 1\n // However, we don't need such large numbers and MAX_CYCLE_LEN should be the capstone,\n // as we want to translate the numbers to strings.\n\n var rem = 10 % d;\n var t = 1;\n\n for (; rem !== 1; t++) {\n rem = rem * 10 % d;\n\n if (t > MAX_CYCLE_LEN)\n return 0; // Returning 0 here means that we don't print it as a cyclic number. It's likely that the answer is `d-1`\n }\n return t;\n}\n\n\nfunction cycleStart(n, d, len) {\n\n var rem1 = 1;\n var rem2 = modpow(10, len, d);\n\n for (var t = 0; t < 300; t++) { // s < ~log10(Number.MAX_VALUE)\n // Solve 10^s == 10^(s+t) (mod d)\n\n if (rem1 === rem2)\n return t;\n\n rem1 = rem1 * 10 % d;\n rem2 = rem2 * 10 % d;\n }\n return 0;\n}\n\nfunction gcd(a, b) {\n\n if (!a)\n return b;\n if (!b)\n return a;\n\n while (1) {\n a%= b;\n if (!a)\n return b;\n b%= a;\n if (!b)\n return a;\n }\n};\n\n/**\n * Module constructor\n *\n * @constructor\n * @param {number|Fraction=} a\n * @param {number=} b\n */\nexport default function Fraction(a, b) {\n\n parse(a, b);\n\n if (this instanceof Fraction) {\n a = gcd(P[\"d\"], P[\"n\"]); // Abuse variable a\n this[\"s\"] = P[\"s\"];\n this[\"n\"] = P[\"n\"] / a;\n this[\"d\"] = P[\"d\"] / a;\n } else {\n return newFraction(P['s'] * P['n'], P['d']);\n }\n}\n\nvar DivisionByZero = function() { return new Error(\"Division by Zero\"); };\nvar InvalidParameter = function() { return new Error(\"Invalid argument\"); };\nvar NonIntegerParameter = function() { return new Error(\"Parameters must be integer\"); };\n\nFraction.prototype = {\n\n \"s\": 1,\n \"n\": 0,\n \"d\": 1,\n\n /**\n * Calculates the absolute value\n *\n * Ex: new Fraction(-4).abs() => 4\n **/\n \"abs\": function() {\n\n return newFraction(this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Inverts the sign of the current fraction\n *\n * Ex: new Fraction(-4).neg() => 4\n **/\n \"neg\": function() {\n\n return newFraction(-this[\"s\"] * this[\"n\"], this[\"d\"]);\n },\n\n /**\n * Adds two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => 467 / 30\n **/\n \"add\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] + P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Subtracts two rational numbers\n *\n * Ex: new Fraction({n: 2, d: 3}).add(\"14.9\") => -427 / 30\n **/\n \"sub\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * this[\"d\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Multiplies two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").mul(3) => 5776 / 111\n **/\n \"mul\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"n\"],\n this[\"d\"] * P[\"d\"]\n );\n },\n\n /**\n * Divides two rational numbers\n *\n * Ex: new Fraction(\"-17.(345)\").inverse().div(3)\n **/\n \"div\": function(a, b) {\n\n parse(a, b);\n return newFraction(\n this[\"s\"] * P[\"s\"] * this[\"n\"] * P[\"d\"],\n this[\"d\"] * P[\"n\"]\n );\n },\n\n /**\n * Clones the actual object\n *\n * Ex: new Fraction(\"-17.(345)\").clone()\n **/\n \"clone\": function() {\n return newFraction(this['s'] * this['n'], this['d']);\n },\n\n /**\n * Calculates the modulo of two rational numbers - a more precise fmod\n *\n * Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6)\n **/\n \"mod\": function(a, b) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return new Fraction(NaN);\n }\n\n if (a === undefined) {\n return newFraction(this[\"s\"] * this[\"n\"] % this[\"d\"], 1);\n }\n\n parse(a, b);\n if (0 === P[\"n\"] && 0 === this[\"d\"]) {\n throw DivisionByZero();\n }\n\n /*\n * First silly attempt, kinda slow\n *\n return that[\"sub\"]({\n \"n\": num[\"n\"] * Math.floor((this.n / this.d) / (num.n / num.d)),\n \"d\": num[\"d\"],\n \"s\": this[\"s\"]\n });*/\n\n /*\n * New attempt: a1 / b1 = a2 / b2 * q + r\n * => b2 * a1 = a2 * b1 * q + b1 * b2 * r\n * => (b2 * a1 % a2 * b1) / (b1 * b2)\n */\n return newFraction(\n this[\"s\"] * (P[\"d\"] * this[\"n\"]) % (P[\"n\"] * this[\"d\"]),\n P[\"d\"] * this[\"d\"]\n );\n },\n\n /**\n * Calculates the fractional gcd of two rational numbers\n *\n * Ex: new Fraction(5,8).gcd(3,7) => 1/56\n */\n \"gcd\": function(a, b) {\n\n parse(a, b);\n\n // gcd(a / b, c / d) = gcd(a, c) / lcm(b, d)\n\n return newFraction(gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]), P[\"d\"] * this[\"d\"]);\n },\n\n /**\n * Calculates the fractional lcm of two rational numbers\n *\n * Ex: new Fraction(5,8).lcm(3,7) => 15\n */\n \"lcm\": function(a, b) {\n\n parse(a, b);\n\n // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d)\n\n if (P[\"n\"] === 0 && this[\"n\"] === 0) {\n return newFraction(0, 1);\n }\n return newFraction(P[\"n\"] * this[\"n\"], gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"d\"]));\n },\n\n /**\n * Calculates the ceil of a rational number\n *\n * Ex: new Fraction('4.(3)').ceil() => (5 / 1)\n **/\n \"ceil\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.ceil(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Calculates the floor of a rational number\n *\n * Ex: new Fraction('4.(3)').floor() => (4 / 1)\n **/\n \"floor\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.floor(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational number\n *\n * Ex: new Fraction('4.(3)').round() => (4 / 1)\n **/\n \"round\": function(places) {\n\n places = Math.pow(10, places || 0);\n\n if (isNaN(this[\"n\"]) || isNaN(this[\"d\"])) {\n return new Fraction(NaN);\n }\n return newFraction(Math.round(places * this[\"s\"] * this[\"n\"] / this[\"d\"]), places);\n },\n\n /**\n * Rounds a rational number to a multiple of another rational number\n *\n * Ex: new Fraction('0.9').roundTo(\"1/8\") => 7 / 8\n **/\n \"roundTo\": function(a, b) {\n\n /*\n k * x/y \u2264 a/b < (k+1) * x/y\n \u21D4 k \u2264 a/b / (x/y) < (k+1)\n \u21D4 k = floor(a/b * y/x)\n */\n\n parse(a, b);\n\n return newFraction(this['s'] * Math.round(this['n'] * P['d'] / (this['d'] * P['n'])) * P['n'], P['d']);\n },\n\n /**\n * Gets the inverse of the fraction, means numerator and denominator are exchanged\n *\n * Ex: new Fraction([-3, 4]).inverse() => -4 / 3\n **/\n \"inverse\": function() {\n\n return newFraction(this[\"s\"] * this[\"d\"], this[\"n\"]);\n },\n\n /**\n * Calculates the fraction to some rational exponent, if possible\n *\n * Ex: new Fraction(-1,2).pow(-3) => -8\n */\n \"pow\": function(a, b) {\n\n parse(a, b);\n\n // Trivial case when exp is an integer\n\n if (P['d'] === 1) {\n\n if (P['s'] < 0) {\n return newFraction(Math.pow(this['s'] * this[\"d\"], P['n']), Math.pow(this[\"n\"], P['n']));\n } else {\n return newFraction(Math.pow(this['s'] * this[\"n\"], P['n']), Math.pow(this[\"d\"], P['n']));\n }\n }\n\n // Negative roots become complex\n // (-a/b)^(c/d) = x\n // <=> (-1)^(c/d) * (a/b)^(c/d) = x\n // <=> (cos(pi) + i*sin(pi))^(c/d) * (a/b)^(c/d) = x # rotate 1 by 180\u00B0\n // <=> (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula in Q ( https://proofwiki.org/wiki/De_Moivre%27s_Formula/Rational_Index )\n // From which follows that only for c=0 the root is non-complex. c/d is a reduced fraction, so that sin(c/dpi)=0 occurs for d=1, which is handled by our trivial case.\n if (this['s'] < 0) return null;\n\n // Now prime factor n and d\n var N = factorize(this['n']);\n var D = factorize(this['d']);\n\n // Exponentiate and take root for n and d individually\n var n = 1;\n var d = 1;\n for (var k in N) {\n if (k === '1') continue;\n if (k === '0') {\n n = 0;\n break;\n }\n N[k]*= P['n'];\n\n if (N[k] % P['d'] === 0) {\n N[k]/= P['d'];\n } else return null;\n n*= Math.pow(k, N[k]);\n }\n\n for (var k in D) {\n if (k === '1') continue;\n D[k]*= P['n'];\n\n if (D[k] % P['d'] === 0) {\n D[k]/= P['d'];\n } else return null;\n d*= Math.pow(k, D[k]);\n }\n\n if (P['s'] < 0) {\n return newFraction(d, n);\n }\n return newFraction(n, d);\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"equals\": function(a, b) {\n\n parse(a, b);\n return this[\"s\"] * this[\"n\"] * P[\"d\"] === P[\"s\"] * P[\"n\"] * this[\"d\"]; // Same as compare() === 0\n },\n\n /**\n * Check if two rational numbers are the same\n *\n * Ex: new Fraction(19.6).equals([98, 5]);\n **/\n \"compare\": function(a, b) {\n\n parse(a, b);\n var t = (this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * P[\"n\"] * this[\"d\"]);\n return (0 < t) - (t < 0);\n },\n\n \"simplify\": function(eps) {\n\n if (isNaN(this['n']) || isNaN(this['d'])) {\n return this;\n }\n\n eps = eps || 0.001;\n\n var thisABS = this['abs']();\n var cont = thisABS['toContinued']();\n\n for (var i = 1; i < cont.length; i++) {\n\n var s = newFraction(cont[i - 1], 1);\n for (var k = i - 2; k >= 0; k--) {\n s = s['inverse']()['add'](cont[k]);\n }\n\n if (Math.abs(s['sub'](thisABS).valueOf()) < eps) {\n return s['mul'](this['s']);\n }\n }\n return this;\n },\n\n /**\n * Check if two rational numbers are divisible\n *\n * Ex: new Fraction(19.6).divisible(1.5);\n */\n \"divisible\": function(a, b) {\n\n parse(a, b);\n return !(!(P[\"n\"] * this[\"d\"]) || ((this[\"n\"] * P[\"d\"]) % (P[\"n\"] * this[\"d\"])));\n },\n\n /**\n * Returns a decimal representation of the fraction\n *\n * Ex: new Fraction(\"100.'91823'\").valueOf() => 100.91823918239183\n **/\n 'valueOf': function() {\n\n return this[\"s\"] * this[\"n\"] / this[\"d\"];\n },\n\n /**\n * Returns a string-fraction representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toFraction(true) => \"4 1/3\"\n **/\n 'toFraction': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n str+= \" \";\n n%= d;\n }\n\n str+= n;\n str+= '/';\n str+= d;\n }\n return str;\n },\n\n /**\n * Returns a latex representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toLatex() => \"\\frac{4}{3}\"\n **/\n 'toLatex': function(excludeWhole) {\n\n var whole, str = \"\";\n var n = this[\"n\"];\n var d = this[\"d\"];\n if (this[\"s\"] < 0) {\n str+= '-';\n }\n\n if (d === 1) {\n str+= n;\n } else {\n\n if (excludeWhole && (whole = Math.floor(n / d)) > 0) {\n str+= whole;\n n%= d;\n }\n\n str+= \"\\\\frac{\";\n str+= n;\n str+= '}{';\n str+= d;\n str+= '}';\n }\n return str;\n },\n\n /**\n * Returns an array of continued fraction elements\n *\n * Ex: new Fraction(\"7/8\").toContinued() => [0,1,7]\n */\n 'toContinued': function() {\n\n var t;\n var a = this['n'];\n var b = this['d'];\n var res = [];\n\n if (isNaN(a) || isNaN(b)) {\n return res;\n }\n\n do {\n res.push(Math.floor(a / b));\n t = a % b;\n a = b;\n b = t;\n } while (a !== 1);\n\n return res;\n },\n\n /**\n * Creates a string representation of a fraction with all digits\n *\n * Ex: new Fraction(\"100.'91823'\").toString() => \"100.(91823)\"\n **/\n 'toString': function(dec) {\n\n var N = this[\"n\"];\n var D = this[\"d\"];\n\n if (isNaN(N) || isNaN(D)) {\n return \"NaN\";\n }\n\n dec = dec || 15; // 15 = decimal places when no repetation\n\n var cycLen = cycleLen(N, D); // Cycle length\n var cycOff = cycleStart(N, D, cycLen); // Cycle start\n\n var str = this['s'] < 0 ? \"-\" : \"\";\n\n str+= N / D | 0;\n\n N%= D;\n N*= 10;\n\n if (N)\n str+= \".\";\n\n if (cycLen) {\n\n for (var i = cycOff; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \"(\";\n for (var i = cycLen; i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n str+= \")\";\n } else {\n for (var i = dec; N && i--;) {\n str+= N / D | 0;\n N%= D;\n N*= 10;\n }\n }\n return str;\n }\n};\n", "import { isBigNumber } from '../../utils/is.js';\nimport { format, sign } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Range';\nvar dependencies = [];\nexport var createRangeClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Create a range. A range has a start, step, and end, and contains functions\n * to iterate over the range.\n *\n * A range can be constructed as:\n *\n * const range = new Range(start, end)\n * const range = new Range(start, end, step)\n *\n * To get the result of the range:\n * range.forEach(function (x) {\n * console.log(x)\n * })\n * range.map(function (x) {\n * return math.sin(x)\n * })\n * range.toArray()\n *\n * Example usage:\n *\n * const c = new Range(2, 6) // 2:1:5\n * c.toArray() // [2, 3, 4, 5]\n * const d = new Range(2, -3, -1) // 2:-1:-2\n * d.toArray() // [2, 1, 0, -1, -2]\n *\n * @class Range\n * @constructor Range\n * @param {number} start included lower bound\n * @param {number} end excluded upper bound\n * @param {number} [step] step size, default value is 1\n */\n function Range(start, end, step) {\n if (!(this instanceof Range)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n var hasStart = start !== null && start !== undefined;\n var hasEnd = end !== null && end !== undefined;\n var hasStep = step !== null && step !== undefined;\n if (hasStart) {\n if (isBigNumber(start)) {\n start = start.toNumber();\n } else if (typeof start !== 'number') {\n throw new TypeError('Parameter start must be a number');\n }\n }\n if (hasEnd) {\n if (isBigNumber(end)) {\n end = end.toNumber();\n } else if (typeof end !== 'number') {\n throw new TypeError('Parameter end must be a number');\n }\n }\n if (hasStep) {\n if (isBigNumber(step)) {\n step = step.toNumber();\n } else if (typeof step !== 'number') {\n throw new TypeError('Parameter step must be a number');\n }\n }\n this.start = hasStart ? parseFloat(start) : 0;\n this.end = hasEnd ? parseFloat(end) : 0;\n this.step = hasStep ? parseFloat(step) : 1;\n }\n\n /**\n * Attach type information\n */\n Range.prototype.type = 'Range';\n Range.prototype.isRange = true;\n\n /**\n * Parse a string into a range,\n * The string contains the start, optional step, and end, separated by a colon.\n * If the string does not contain a valid range, null is returned.\n * For example str='0:2:11'.\n * @memberof Range\n * @param {string} str\n * @return {Range | null} range\n */\n Range.parse = function (str) {\n if (typeof str !== 'string') {\n return null;\n }\n var args = str.split(':');\n var nums = args.map(function (arg) {\n return parseFloat(arg);\n });\n var invalid = nums.some(function (num) {\n return isNaN(num);\n });\n if (invalid) {\n return null;\n }\n switch (nums.length) {\n case 2:\n return new Range(nums[0], nums[1]);\n case 3:\n return new Range(nums[0], nums[2], nums[1]);\n default:\n return null;\n }\n };\n\n /**\n * Create a clone of the range\n * @return {Range} clone\n */\n Range.prototype.clone = function () {\n return new Range(this.start, this.end, this.step);\n };\n\n /**\n * Retrieve the size of the range.\n * Returns an array containing one number, the number of elements in the range.\n * @memberof Range\n * @returns {number[]} size\n */\n Range.prototype.size = function () {\n var len = 0;\n var start = this.start;\n var step = this.step;\n var end = this.end;\n var diff = end - start;\n if (sign(step) === sign(diff)) {\n len = Math.ceil(diff / step);\n } else if (diff === 0) {\n len = 0;\n }\n if (isNaN(len)) {\n len = 0;\n }\n return [len];\n };\n\n /**\n * Calculate the minimum value in the range\n * @memberof Range\n * @return {number | undefined} min\n */\n Range.prototype.min = function () {\n var size = this.size()[0];\n if (size > 0) {\n if (this.step > 0) {\n // positive step\n return this.start;\n } else {\n // negative step\n return this.start + (size - 1) * this.step;\n }\n } else {\n return undefined;\n }\n };\n\n /**\n * Calculate the maximum value in the range\n * @memberof Range\n * @return {number | undefined} max\n */\n Range.prototype.max = function () {\n var size = this.size()[0];\n if (size > 0) {\n if (this.step > 0) {\n // positive step\n return this.start + (size - 1) * this.step;\n } else {\n // negative step\n return this.start;\n }\n } else {\n return undefined;\n }\n };\n\n /**\n * Execute a callback function for each value in the range.\n * @memberof Range\n * @param {function} callback The callback method is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Range being traversed.\n */\n Range.prototype.forEach = function (callback) {\n var x = this.start;\n var step = this.step;\n var end = this.end;\n var i = 0;\n if (step > 0) {\n while (x < end) {\n callback(x, [i], this);\n x += step;\n i++;\n }\n } else if (step < 0) {\n while (x > end) {\n callback(x, [i], this);\n x += step;\n i++;\n }\n }\n };\n\n /**\n * Execute a callback function for each value in the Range, and return the\n * results as an array\n * @memberof Range\n * @param {function} callback The callback method is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @returns {Array} array\n */\n Range.prototype.map = function (callback) {\n var array = [];\n this.forEach(function (value, index, obj) {\n array[index[0]] = callback(value, index, obj);\n });\n return array;\n };\n\n /**\n * Create an Array with a copy of the Ranges data\n * @memberof Range\n * @returns {Array} array\n */\n Range.prototype.toArray = function () {\n var array = [];\n this.forEach(function (value, index) {\n array[index[0]] = value;\n });\n return array;\n };\n\n /**\n * Get the primitive value of the Range, a one dimensional array\n * @memberof Range\n * @returns {Array} array\n */\n Range.prototype.valueOf = function () {\n // TODO: implement a caching mechanism for range.valueOf()\n return this.toArray();\n };\n\n /**\n * Get a string representation of the range, with optional formatting options.\n * Output is formatted as 'start:step:end', for example '2:6' or '0:0.2:11'\n * @memberof Range\n * @param {Object | number | function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n Range.prototype.format = function (options) {\n var str = format(this.start, options);\n if (this.step !== 1) {\n str += ':' + format(this.step, options);\n }\n str += ':' + format(this.end, options);\n return str;\n };\n\n /**\n * Get a string representation of the range.\n * @memberof Range\n * @returns {string}\n */\n Range.prototype.toString = function () {\n return this.format();\n };\n\n /**\n * Get a JSON representation of the range\n * @memberof Range\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Range\", \"start\": 2, \"end\": 4, \"step\": 1}`\n */\n Range.prototype.toJSON = function () {\n return {\n mathjs: 'Range',\n start: this.start,\n end: this.end,\n step: this.step\n };\n };\n\n /**\n * Instantiate a Range from a JSON object\n * @memberof Range\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Range\", \"start\": 2, \"end\": 4, \"step\": 1}`\n * @return {Range}\n */\n Range.fromJSON = function (json) {\n return new Range(json.start, json.end, json.step);\n };\n return Range;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'Matrix';\nvar dependencies = [];\nexport var createMatrixClass = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * @constructor Matrix\n *\n * A Matrix is a wrapper around an Array. A matrix can hold a multi dimensional\n * array. A matrix can be constructed as:\n *\n * let matrix = math.matrix(data)\n *\n * Matrix contains the functions to resize, get and set values, get the size,\n * clone the matrix and to convert the matrix to a vector, array, or scalar.\n * Furthermore, one can iterate over the matrix using map and forEach.\n * The internal Array of the Matrix can be accessed using the function valueOf.\n *\n * Example usage:\n *\n * let matrix = math.matrix([[1, 2], [3, 4]])\n * matix.size() // [2, 2]\n * matrix.resize([3, 2], 5)\n * matrix.valueOf() // [[1, 2], [3, 4], [5, 5]]\n * matrix.subset([1,2]) // 3 (indexes are zero-based)\n *\n */\n function Matrix() {\n if (!(this instanceof Matrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n }\n\n /**\n * Attach type information\n */\n Matrix.prototype.type = 'Matrix';\n Matrix.prototype.isMatrix = true;\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @return {string} The storage format.\n */\n Matrix.prototype.storage = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke storage on a Matrix interface');\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @return {string} The datatype.\n */\n Matrix.prototype.datatype = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke datatype on a Matrix interface');\n };\n\n /**\n * Create a new Matrix With the type of the current matrix instance\n * @param {Array | Object} data\n * @param {string} [datatype]\n */\n Matrix.prototype.create = function (data, datatype) {\n throw new Error('Cannot invoke create on a Matrix interface');\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n Matrix.prototype.subset = function (index, replacement, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke subset on a Matrix interface');\n };\n\n /**\n * Get a single element from the matrix.\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n Matrix.prototype.get = function (index) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke get on a Matrix interface');\n };\n\n /**\n * Replace a single element in the matrix.\n * @param {number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {Matrix} self\n */\n Matrix.prototype.set = function (index, value, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke set on a Matrix interface');\n };\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @param {number[]} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n Matrix.prototype.resize = function (size, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke resize on a Matrix interface');\n };\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * @param {number[]} size The new size the matrix should have.\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n Matrix.prototype.reshape = function (size, defaultValue) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke reshape on a Matrix interface');\n };\n\n /**\n * Create a clone of the matrix\n * @return {Matrix} clone\n */\n Matrix.prototype.clone = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke clone on a Matrix interface');\n };\n\n /**\n * Retrieve the size of the matrix.\n * @returns {number[]} size\n */\n Matrix.prototype.size = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke size on a Matrix interface');\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {Matrix} matrix\n */\n Matrix.prototype.map = function (callback, skipZeros) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke map on a Matrix interface');\n };\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n */\n Matrix.prototype.forEach = function (callback) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke forEach on a Matrix interface');\n };\n\n /**\n * Iterate over the matrix elements\n * @return {Iterable<{ value, index: number[] }>}\n */\n Matrix.prototype[Symbol.iterator] = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot iterate a Matrix interface');\n };\n\n /**\n * Create an Array with a copy of the data of the Matrix\n * @returns {Array} array\n */\n Matrix.prototype.toArray = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke toArray on a Matrix interface');\n };\n\n /**\n * Get the primitive value of the Matrix: a multidimensional array\n * @returns {Array} array\n */\n Matrix.prototype.valueOf = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke valueOf on a Matrix interface');\n };\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n Matrix.prototype.format = function (options) {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke format on a Matrix interface');\n };\n\n /**\n * Get a string representation of the matrix\n * @returns {string} str\n */\n Matrix.prototype.toString = function () {\n // must be implemented by each of the Matrix implementations\n throw new Error('Cannot invoke toString on a Matrix interface');\n };\n return Matrix;\n}, {\n isClass: true\n});", "import { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js';\nimport { arraySize, getArrayDataType, processSizesWildcard, reshape, resize, unsqueeze, validate, validateIndex, broadcastTo } from '../../utils/array.js';\nimport { format } from '../../utils/string.js';\nimport { isInteger } from '../../utils/number.js';\nimport { clone, deepStrictEqual } from '../../utils/object.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nimport { maxArgumentCount } from '../../utils/function.js';\nvar name = 'DenseMatrix';\nvar dependencies = ['Matrix'];\nexport var createDenseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Matrix\n } = _ref;\n /**\n * Dense Matrix implementation. A regular, dense matrix, supporting multi-dimensional matrices. This is the default matrix type.\n * @class DenseMatrix\n * @enum {{ value, index: number[] }}\n */\n function DenseMatrix(data, datatype) {\n if (!(this instanceof DenseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data)) {\n // check data is a DenseMatrix\n if (data.type === 'DenseMatrix') {\n // clone data & size\n this._data = clone(data._data);\n this._size = clone(data._size);\n this._datatype = datatype || data._datatype;\n } else {\n // build data from existing matrix\n this._data = data.toArray();\n this._size = data.size();\n this._datatype = datatype || data._datatype;\n }\n } else if (data && isArray(data.data) && isArray(data.size)) {\n // initialize fields from JSON representation\n this._data = data.data;\n this._size = data.size;\n // verify the dimensions of the array\n validate(this._data, this._size);\n this._datatype = datatype || data.datatype;\n } else if (isArray(data)) {\n // replace nested Matrices with Arrays\n this._data = preprocess(data);\n // get the dimensions of the array\n this._size = arraySize(this._data);\n // verify the dimensions of the array, TODO: compute size while processing array\n validate(this._data, this._size);\n // data type unknown\n this._datatype = datatype;\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._data = [];\n this._size = [0];\n this._datatype = datatype;\n }\n }\n DenseMatrix.prototype = new Matrix();\n\n /**\n * Create a new DenseMatrix\n */\n DenseMatrix.prototype.createDenseMatrix = function (data, datatype) {\n return new DenseMatrix(data, datatype);\n };\n\n /**\n * Attach type information\n */\n Object.defineProperty(DenseMatrix, 'name', {\n value: 'DenseMatrix'\n });\n DenseMatrix.prototype.constructor = DenseMatrix;\n DenseMatrix.prototype.type = 'DenseMatrix';\n DenseMatrix.prototype.isDenseMatrix = true;\n\n /**\n * Get the matrix type\n *\n * Usage:\n * const matrixType = matrix.getDataType() // retrieves the matrix type\n *\n * @memberOf DenseMatrix\n * @return {string} type information; if multiple types are found from the Matrix, it will return \"mixed\"\n */\n DenseMatrix.prototype.getDataType = function () {\n return getArrayDataType(this._data, typeOf);\n };\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @memberof DenseMatrix\n * @return {string} The storage format.\n */\n DenseMatrix.prototype.storage = function () {\n return 'dense';\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @memberof DenseMatrix\n * @return {string} The datatype.\n */\n DenseMatrix.prototype.datatype = function () {\n return this._datatype;\n };\n\n /**\n * Create a new DenseMatrix\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {string} [datatype]\n */\n DenseMatrix.prototype.create = function (data, datatype) {\n return new DenseMatrix(data, datatype);\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @memberof DenseMatrix\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n DenseMatrix.prototype.subset = function (index, replacement, defaultValue) {\n switch (arguments.length) {\n case 1:\n return _get(this, index);\n\n // intentional fall through\n case 2:\n case 3:\n return _set(this, index, replacement, defaultValue);\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n\n /**\n * Get a single element from the matrix.\n * @memberof DenseMatrix\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n DenseMatrix.prototype.get = function (index) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length !== this._size.length) {\n throw new DimensionError(index.length, this._size.length);\n }\n\n // check index\n for (var x = 0; x < index.length; x++) {\n validateIndex(index[x], this._size[x]);\n }\n var data = this._data;\n for (var i = 0, ii = index.length; i < ii; i++) {\n var indexI = index[i];\n validateIndex(indexI, data.length);\n data = data[indexI];\n }\n return data;\n };\n\n /**\n * Replace a single element in the matrix.\n * @memberof DenseMatrix\n * @param {number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {DenseMatrix} self\n */\n DenseMatrix.prototype.set = function (index, value, defaultValue) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length < this._size.length) {\n throw new DimensionError(index.length, this._size.length, '<');\n }\n var i, ii, indexI;\n\n // enlarge matrix when needed\n var size = index.map(function (i) {\n return i + 1;\n });\n _fit(this, size, defaultValue);\n\n // traverse over the dimensions\n var data = this._data;\n for (i = 0, ii = index.length - 1; i < ii; i++) {\n indexI = index[i];\n validateIndex(indexI, data.length);\n data = data[indexI];\n }\n\n // set new value\n indexI = index[index.length - 1];\n validateIndex(indexI, data.length);\n data[indexI] = value;\n return this;\n };\n\n /**\n * Get a submatrix of this matrix\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix\n * @param {Index} index Zero-based index\n * @private\n */\n function _get(matrix, index) {\n if (!isIndex(index)) {\n throw new TypeError('Invalid index');\n }\n var isScalar = index.isScalar();\n if (isScalar) {\n // return a scalar\n return matrix.get(index.min());\n } else {\n // validate dimensions\n var size = index.size();\n if (size.length !== matrix._size.length) {\n throw new DimensionError(size.length, matrix._size.length);\n }\n\n // validate if any of the ranges in the index is out of range\n var min = index.min();\n var max = index.max();\n for (var i = 0, ii = matrix._size.length; i < ii; i++) {\n validateIndex(min[i], matrix._size[i]);\n validateIndex(max[i], matrix._size[i]);\n }\n\n // retrieve submatrix\n // TODO: more efficient when creating an empty matrix and setting _data and _size manually\n return new DenseMatrix(_getSubmatrix(matrix._data, index, size.length, 0), matrix._datatype);\n }\n }\n\n /**\n * Recursively get a submatrix of a multi dimensional matrix.\n * Index is not checked for correct number or length of dimensions.\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {Index} index\n * @param {number} dims Total number of dimensions\n * @param {number} dim Current dimension\n * @return {Array} submatrix\n * @private\n */\n function _getSubmatrix(data, index, dims, dim) {\n var last = dim === dims - 1;\n var range = index.dimension(dim);\n if (last) {\n return range.map(function (i) {\n validateIndex(i, data.length);\n return data[i];\n }).valueOf();\n } else {\n return range.map(function (i) {\n validateIndex(i, data.length);\n var child = data[i];\n return _getSubmatrix(child, index, dims, dim + 1);\n }).valueOf();\n }\n }\n\n /**\n * Replace a submatrix in this matrix\n * Indexes are zero-based.\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix\n * @param {Index} index\n * @param {DenseMatrix | Array | *} submatrix\n * @param {*} defaultValue Default value, filled in on new entries when\n * the matrix is resized.\n * @return {DenseMatrix} matrix\n * @private\n */\n function _set(matrix, index, submatrix, defaultValue) {\n if (!index || index.isIndex !== true) {\n throw new TypeError('Invalid index');\n }\n\n // get index size and check whether the index contains a single value\n var iSize = index.size();\n var isScalar = index.isScalar();\n\n // calculate the size of the submatrix, and convert it into an Array if needed\n var sSize;\n if (isMatrix(submatrix)) {\n sSize = submatrix.size();\n submatrix = submatrix.valueOf();\n } else {\n sSize = arraySize(submatrix);\n }\n if (isScalar) {\n // set a scalar\n\n // check whether submatrix is a scalar\n if (sSize.length !== 0) {\n throw new TypeError('Scalar expected');\n }\n matrix.set(index.min(), submatrix, defaultValue);\n } else {\n // set a submatrix\n\n // broadcast submatrix\n if (!deepStrictEqual(sSize, iSize)) {\n try {\n if (sSize.length === 0) {\n submatrix = broadcastTo([submatrix], iSize);\n } else {\n submatrix = broadcastTo(submatrix, iSize);\n }\n sSize = arraySize(submatrix);\n } catch (_unused) {}\n }\n\n // validate dimensions\n if (iSize.length < matrix._size.length) {\n throw new DimensionError(iSize.length, matrix._size.length, '<');\n }\n if (sSize.length < iSize.length) {\n // calculate number of missing outer dimensions\n var i = 0;\n var outer = 0;\n while (iSize[i] === 1 && sSize[i] === 1) {\n i++;\n }\n while (iSize[i] === 1) {\n outer++;\n i++;\n }\n\n // unsqueeze both outer and inner dimensions\n submatrix = unsqueeze(submatrix, iSize.length, outer, sSize);\n }\n\n // check whether the size of the submatrix matches the index size\n if (!deepStrictEqual(iSize, sSize)) {\n throw new DimensionError(iSize, sSize, '>');\n }\n\n // enlarge matrix when needed\n var size = index.max().map(function (i) {\n return i + 1;\n });\n _fit(matrix, size, defaultValue);\n\n // insert the sub matrix\n var dims = iSize.length;\n var dim = 0;\n _setSubmatrix(matrix._data, index, submatrix, dims, dim);\n }\n return matrix;\n }\n\n /**\n * Replace a submatrix of a multi dimensional matrix.\n * @memberof DenseMatrix\n * @param {Array} data\n * @param {Index} index\n * @param {Array} submatrix\n * @param {number} dims Total number of dimensions\n * @param {number} dim\n * @private\n */\n function _setSubmatrix(data, index, submatrix, dims, dim) {\n var last = dim === dims - 1;\n var range = index.dimension(dim);\n if (last) {\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n data[dataIndex] = submatrix[subIndex[0]];\n });\n } else {\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n _setSubmatrix(data[dataIndex], index, submatrix[subIndex[0]], dims, dim + 1);\n });\n }\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @memberof DenseMatrix\n * @param {number[] || Matrix} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n DenseMatrix.prototype.resize = function (size, defaultValue, copy) {\n // validate arguments\n if (!isCollection(size)) {\n throw new TypeError('Array or Matrix expected');\n }\n\n // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector\n var sizeArray = size.valueOf().map(value => {\n return Array.isArray(value) && value.length === 1 ? value[0] : value;\n });\n\n // matrix to resize\n var m = copy ? this.clone() : this;\n // resize matrix\n return _resize(m, sizeArray, defaultValue);\n };\n function _resize(matrix, size, defaultValue) {\n // check size\n if (size.length === 0) {\n // first value in matrix\n var v = matrix._data;\n // go deep\n while (isArray(v)) {\n v = v[0];\n }\n return v;\n }\n // resize matrix\n matrix._size = size.slice(0); // copy the array\n matrix._data = resize(matrix._data, matrix._size, defaultValue);\n // return matrix\n return matrix;\n }\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * NOTE: This might be better suited to copy by default, instead of modifying\n * in place. For now, it operates in place to remain consistent with\n * resize().\n *\n * @memberof DenseMatrix\n * @param {number[]} size The new size the matrix should have.\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n DenseMatrix.prototype.reshape = function (size, copy) {\n var m = copy ? this.clone() : this;\n m._data = reshape(m._data, size);\n var currentLength = m._size.reduce((length, size) => length * size);\n m._size = processSizesWildcard(size, currentLength);\n return m;\n };\n\n /**\n * Enlarge the matrix when it is smaller than given size.\n * If the matrix is larger or equal sized, nothing is done.\n * @memberof DenseMatrix\n * @param {DenseMatrix} matrix The matrix to be resized\n * @param {number[]} size\n * @param {*} defaultValue Default value, filled in on new entries.\n * @private\n */\n function _fit(matrix, size, defaultValue) {\n var\n // copy the array\n newSize = matrix._size.slice(0);\n var changed = false;\n\n // add dimensions when needed\n while (newSize.length < size.length) {\n newSize.push(0);\n changed = true;\n }\n\n // enlarge size when needed\n for (var i = 0, ii = size.length; i < ii; i++) {\n if (size[i] > newSize[i]) {\n newSize[i] = size[i];\n changed = true;\n }\n }\n if (changed) {\n // resize only when size is changed\n _resize(matrix, newSize, defaultValue);\n }\n }\n\n /**\n * Create a clone of the matrix\n * @memberof DenseMatrix\n * @return {DenseMatrix} clone\n */\n DenseMatrix.prototype.clone = function () {\n var m = new DenseMatrix({\n data: clone(this._data),\n size: clone(this._size),\n datatype: this._datatype\n });\n return m;\n };\n\n /**\n * Retrieve the size of the matrix.\n * @memberof DenseMatrix\n * @returns {number[]} size\n */\n DenseMatrix.prototype.size = function () {\n return this._size.slice(0); // return a clone of _size\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n *\n * @return {DenseMatrix} matrix\n */\n DenseMatrix.prototype.map = function (callback) {\n // matrix instance\n var me = this;\n var args = maxArgumentCount(callback);\n var recurse = function recurse(value, index) {\n if (isArray(value)) {\n return value.map(function (child, i) {\n return recurse(child, index.concat(i));\n });\n } else {\n // invoke the callback function with the right number of arguments\n if (args === 1) {\n return callback(value);\n } else if (args === 2) {\n return callback(value, index);\n } else {\n // 3 or -1\n return callback(value, index, me);\n }\n }\n };\n\n // determine the new datatype when the original matrix has datatype defined\n // TODO: should be done in matrix constructor instead\n var data = recurse(this._data, []);\n var datatype = this._datatype !== undefined ? getArrayDataType(data, typeOf) : undefined;\n return new DenseMatrix(data, datatype);\n };\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @memberof DenseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n */\n DenseMatrix.prototype.forEach = function (callback) {\n // matrix instance\n var me = this;\n var recurse = function recurse(value, index) {\n if (isArray(value)) {\n value.forEach(function (child, i) {\n recurse(child, index.concat(i));\n });\n } else {\n callback(value, index, me);\n }\n };\n recurse(this._data, []);\n };\n\n /**\n * Iterate over the matrix elements\n * @return {Iterable<{ value, index: number[] }>}\n */\n DenseMatrix.prototype[Symbol.iterator] = function* () {\n var recurse = function* recurse(value, index) {\n if (isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n yield* recurse(value[i], index.concat(i));\n }\n } else {\n yield {\n value,\n index\n };\n }\n };\n yield* recurse(this._data, []);\n };\n\n /**\n * Returns an array containing the rows of a 2D matrix\n * @returns {Array}\n */\n DenseMatrix.prototype.rows = function () {\n var result = [];\n var s = this.size();\n if (s.length !== 2) {\n throw new TypeError('Rows can only be returned for a 2D matrix.');\n }\n var data = this._data;\n for (var row of data) {\n result.push(new DenseMatrix([row], this._datatype));\n }\n return result;\n };\n\n /**\n * Returns an array containing the columns of a 2D matrix\n * @returns {Array}\n */\n DenseMatrix.prototype.columns = function () {\n var _this = this;\n var result = [];\n var s = this.size();\n if (s.length !== 2) {\n throw new TypeError('Rows can only be returned for a 2D matrix.');\n }\n var data = this._data;\n var _loop = function _loop(i) {\n var col = data.map(row => [row[i]]);\n result.push(new DenseMatrix(col, _this._datatype));\n };\n for (var i = 0; i < s[1]; i++) {\n _loop(i);\n }\n return result;\n };\n\n /**\n * Create an Array with a copy of the data of the DenseMatrix\n * @memberof DenseMatrix\n * @returns {Array} array\n */\n DenseMatrix.prototype.toArray = function () {\n return clone(this._data);\n };\n\n /**\n * Get the primitive value of the DenseMatrix: a multidimensional array\n * @memberof DenseMatrix\n * @returns {Array} array\n */\n DenseMatrix.prototype.valueOf = function () {\n return this._data;\n };\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @memberof DenseMatrix\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n DenseMatrix.prototype.format = function (options) {\n return format(this._data, options);\n };\n\n /**\n * Get a string representation of the matrix\n * @memberof DenseMatrix\n * @returns {string} str\n */\n DenseMatrix.prototype.toString = function () {\n return format(this._data);\n };\n\n /**\n * Get a JSON representation of the matrix\n * @memberof DenseMatrix\n * @returns {Object}\n */\n DenseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'DenseMatrix',\n data: this._data,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Get the kth Matrix diagonal.\n *\n * @memberof DenseMatrix\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved.\n *\n * @returns {Matrix} The matrix with the diagonal values.\n */\n DenseMatrix.prototype.diagonal = function (k) {\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // number diagonal values\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // x is a matrix get diagonal from matrix\n var data = [];\n\n // loop rows\n for (var i = 0; i < n; i++) {\n data[i] = this._data[i + kSub][i + kSuper];\n }\n\n // create DenseMatrix\n return new DenseMatrix({\n data,\n size: [n],\n datatype: this._datatype\n });\n };\n\n /**\n * Create a diagonal matrix.\n *\n * @memberof DenseMatrix\n * @param {Array} size The matrix size.\n * @param {number | Matrix | Array } value The values for the diagonal.\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in.\n * @param {number} [defaultValue] The default value for non-diagonal\n * @param {string} [datatype] The datatype for the diagonal\n *\n * @returns {DenseMatrix}\n */\n DenseMatrix.diagonal = function (size, value, k, defaultValue) {\n if (!isArray(size)) {\n throw new TypeError('Array expected, size parameter');\n }\n if (size.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // map size & validate\n size = size.map(function (s) {\n // check it is a big number\n if (isBigNumber(s)) {\n // convert it\n s = s.toNumber();\n }\n // validate arguments\n if (!isNumber(s) || !isInteger(s) || s < 1) {\n throw new Error('Size values must be positive integers');\n }\n return s;\n });\n\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // number of non-zero items\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // value extraction function\n var _value;\n\n // check value\n if (isArray(value)) {\n // validate array\n if (value.length !== n) {\n // number of values in array must be n\n throw new Error('Invalid value array length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value[i];\n };\n } else if (isMatrix(value)) {\n // matrix size\n var ms = value.size();\n // validate matrix\n if (ms.length !== 1 || ms[0] !== n) {\n // number of values in array must be n\n throw new Error('Invalid matrix length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value.get([i]);\n };\n } else {\n // define function\n _value = function _value() {\n // return value\n return value;\n };\n }\n\n // discover default value if needed\n if (!defaultValue) {\n // check first value in array\n defaultValue = isBigNumber(_value(0)) ? _value(0).mul(0) // trick to create a BigNumber with value zero\n : 0;\n }\n\n // empty array\n var data = [];\n\n // check we need to resize array\n if (size.length > 0) {\n // resize array\n data = resize(data, size, defaultValue);\n // fill diagonal\n for (var d = 0; d < n; d++) {\n data[d + kSub][d + kSuper] = _value(d);\n }\n }\n\n // create DenseMatrix\n return new DenseMatrix({\n data,\n size: [rows, columns]\n });\n };\n\n /**\n * Generate a matrix from a JSON object\n * @memberof DenseMatrix\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"DenseMatrix\", data: [], size: []}`,\n * where mathjs is optional\n * @returns {DenseMatrix}\n */\n DenseMatrix.fromJSON = function (json) {\n return new DenseMatrix(json);\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @memberof DenseMatrix\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n DenseMatrix.prototype.swapRows = function (i, j) {\n // check index\n if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) {\n throw new Error('Row index must be positive integers');\n }\n // check dimensions\n if (this._size.length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n // validate index\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[0]);\n\n // swap rows\n DenseMatrix._swapRows(i, j, this._data);\n // return current instance\n return this;\n };\n\n /**\n * Swap rows i and j in Dense Matrix data structure.\n *\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n * @param {Array} data Matrix data\n */\n DenseMatrix._swapRows = function (i, j, data) {\n // swap values i <-> j\n var vi = data[i];\n data[i] = data[j];\n data[j] = vi;\n };\n\n /**\n * Preprocess data, which can be an Array or DenseMatrix with nested Arrays and\n * Matrices. Clones all (nested) Arrays, and replaces all nested Matrices with Arrays\n * @memberof DenseMatrix\n * @param {Array | Matrix} data\n * @return {Array} data\n */\n function preprocess(data) {\n if (isMatrix(data)) {\n return preprocess(data.valueOf());\n }\n if (isArray(data)) {\n return data.map(preprocess);\n }\n return data;\n }\n return DenseMatrix;\n}, {\n isClass: true\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { isInteger } from './number.js';\nimport { isNumber, isBigNumber, isArray, isString } from './is.js';\nimport { format } from './string.js';\nimport { DimensionError } from '../error/DimensionError.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { deepStrictEqual } from './object.js';\n\n/**\n * Calculate the size of a multi dimensional array.\n * This function checks the size of the first entry, it does not validate\n * whether all dimensions match. (use function `validate` for that)\n * @param {Array} x\n * @Return {Number[]} size\n */\nexport function arraySize(x) {\n var s = [];\n while (Array.isArray(x)) {\n s.push(x.length);\n x = x[0];\n }\n return s;\n}\n\n/**\n * Recursively validate whether each element in a multi dimensional array\n * has a size corresponding to the provided size array.\n * @param {Array} array Array to be validated\n * @param {number[]} size Array with the size of each dimension\n * @param {number} dim Current dimension\n * @throws DimensionError\n * @private\n */\nfunction _validate(array, size, dim) {\n var i;\n var len = array.length;\n if (len !== size[dim]) {\n throw new DimensionError(len, size[dim]);\n }\n if (dim < size.length - 1) {\n // recursively validate each child array\n var dimNext = dim + 1;\n for (i = 0; i < len; i++) {\n var child = array[i];\n if (!Array.isArray(child)) {\n throw new DimensionError(size.length - 1, size.length, '<');\n }\n _validate(array[i], size, dimNext);\n }\n } else {\n // last dimension. none of the childs may be an array\n for (i = 0; i < len; i++) {\n if (Array.isArray(array[i])) {\n throw new DimensionError(size.length + 1, size.length, '>');\n }\n }\n }\n}\n\n/**\n * Validate whether each element in a multi dimensional array has\n * a size corresponding to the provided size array.\n * @param {Array} array Array to be validated\n * @param {number[]} size Array with the size of each dimension\n * @throws DimensionError\n */\nexport function validate(array, size) {\n var isScalar = size.length === 0;\n if (isScalar) {\n // scalar\n if (Array.isArray(array)) {\n throw new DimensionError(array.length, 0);\n }\n } else {\n // array\n _validate(array, size, 0);\n }\n}\n\n/**\n * Validate whether the source of the index matches the size of the Array\n * @param {Array | Matrix} array Array to be validated\n * @param {Index} index Index with the source information to validate\n * @throws DimensionError\n */\nexport function validateIndexSourceSize(value, index) {\n var valueSize = value.isMatrix ? value._size : arraySize(value);\n var sourceSize = index._sourceSize;\n // checks if the source size is not null and matches the valueSize\n sourceSize.forEach((sourceDim, i) => {\n if (sourceDim !== null && sourceDim !== valueSize[i]) {\n throw new DimensionError(sourceDim, valueSize[i]);\n }\n });\n}\n\n/**\n * Test whether index is an integer number with index >= 0 and index < length\n * when length is provided\n * @param {number} index Zero-based index\n * @param {number} [length] Length of the array\n */\nexport function validateIndex(index, length) {\n if (index !== undefined) {\n if (!isNumber(index) || !isInteger(index)) {\n throw new TypeError('Index must be an integer (value: ' + index + ')');\n }\n if (index < 0 || typeof length === 'number' && index >= length) {\n throw new IndexError(index, length);\n }\n }\n}\n\n/**\n * Test if and index has empty values\n * @param {number} index Zero-based index\n */\nexport function isEmptyIndex(index) {\n for (var i = 0; i < index._dimensions.length; ++i) {\n var dimension = index._dimensions[i];\n if (dimension._data && isArray(dimension._data)) {\n if (dimension._size[0] === 0) {\n return true;\n }\n } else if (dimension.isRange) {\n if (dimension.start === dimension.end) {\n return true;\n }\n } else if (isString(dimension)) {\n if (dimension.length === 0) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * Resize a multi dimensional array. The resized array is returned.\n * @param {Array | number} array Array to be resized\n * @param {number[]} size Array with the size of each dimension\n * @param {*} [defaultValue=0] Value to be filled in in new entries,\n * zero by default. Specify for example `null`,\n * to clearly see entries that are not explicitly\n * set.\n * @return {Array} array The resized array\n */\nexport function resize(array, size, defaultValue) {\n // check the type of the arguments\n if (!Array.isArray(size)) {\n throw new TypeError('Array expected');\n }\n if (size.length === 0) {\n throw new Error('Resizing to scalar is not supported');\n }\n\n // check whether size contains positive integers\n size.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value < 0) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(size) + ')');\n }\n });\n\n // convert number to an array\n if (isNumber(array) || isBigNumber(array)) {\n array = [array];\n }\n\n // recursively resize the array\n var _defaultValue = defaultValue !== undefined ? defaultValue : 0;\n _resize(array, size, 0, _defaultValue);\n return array;\n}\n\n/**\n * Recursively resize a multi dimensional array\n * @param {Array} array Array to be resized\n * @param {number[]} size Array with the size of each dimension\n * @param {number} dim Current dimension\n * @param {*} [defaultValue] Value to be filled in in new entries,\n * undefined by default.\n * @private\n */\nfunction _resize(array, size, dim, defaultValue) {\n var i;\n var elem;\n var oldLen = array.length;\n var newLen = size[dim];\n var minLen = Math.min(oldLen, newLen);\n\n // apply new length\n array.length = newLen;\n if (dim < size.length - 1) {\n // non-last dimension\n var dimNext = dim + 1;\n\n // resize existing child arrays\n for (i = 0; i < minLen; i++) {\n // resize child array\n elem = array[i];\n if (!Array.isArray(elem)) {\n elem = [elem]; // add a dimension\n array[i] = elem;\n }\n _resize(elem, size, dimNext, defaultValue);\n }\n\n // create new child arrays\n for (i = minLen; i < newLen; i++) {\n // get child array\n elem = [];\n array[i] = elem;\n\n // resize new child array\n _resize(elem, size, dimNext, defaultValue);\n }\n } else {\n // last dimension\n\n // remove dimensions of existing values\n for (i = 0; i < minLen; i++) {\n while (Array.isArray(array[i])) {\n array[i] = array[i][0];\n }\n }\n\n // fill new elements with the default value\n for (i = minLen; i < newLen; i++) {\n array[i] = defaultValue;\n }\n }\n}\n\n/**\n * Re-shape a multi dimensional array to fit the specified dimensions\n * @param {Array} array Array to be reshaped\n * @param {number[]} sizes List of sizes for each dimension\n * @returns {Array} Array whose data has been formatted to fit the\n * specified dimensions\n *\n * @throws {DimensionError} If the product of the new dimension sizes does\n * not equal that of the old ones\n */\nexport function reshape(array, sizes) {\n var flatArray = flatten(array);\n var currentLength = flatArray.length;\n if (!Array.isArray(array) || !Array.isArray(sizes)) {\n throw new TypeError('Array expected');\n }\n if (sizes.length === 0) {\n throw new DimensionError(0, currentLength, '!=');\n }\n sizes = processSizesWildcard(sizes, currentLength);\n var newLength = product(sizes);\n if (currentLength !== newLength) {\n throw new DimensionError(newLength, currentLength, '!=');\n }\n try {\n return _reshape(flatArray, sizes);\n } catch (e) {\n if (e instanceof DimensionError) {\n throw new DimensionError(newLength, currentLength, '!=');\n }\n throw e;\n }\n}\n\n/**\n * Replaces the wildcard -1 in the sizes array.\n * @param {number[]} sizes List of sizes for each dimension. At most on wildcard.\n * @param {number} currentLength Number of elements in the array.\n * @throws {Error} If more than one wildcard or unable to replace it.\n * @returns {number[]} The sizes array with wildcard replaced.\n */\nexport function processSizesWildcard(sizes, currentLength) {\n var newLength = product(sizes);\n var processedSizes = sizes.slice();\n var WILDCARD = -1;\n var wildCardIndex = sizes.indexOf(WILDCARD);\n var isMoreThanOneWildcard = sizes.indexOf(WILDCARD, wildCardIndex + 1) >= 0;\n if (isMoreThanOneWildcard) {\n throw new Error('More than one wildcard in sizes');\n }\n var hasWildcard = wildCardIndex >= 0;\n var canReplaceWildcard = currentLength % newLength === 0;\n if (hasWildcard) {\n if (canReplaceWildcard) {\n processedSizes[wildCardIndex] = -currentLength / newLength;\n } else {\n throw new Error('Could not replace wildcard, since ' + currentLength + ' is no multiple of ' + -newLength);\n }\n }\n return processedSizes;\n}\n\n/**\n * Computes the product of all array elements.\n * @param {number[]} array Array of factors\n * @returns {number} Product of all elements\n */\nfunction product(array) {\n return array.reduce((prev, curr) => prev * curr, 1);\n}\n\n/**\n * Iteratively re-shape a multi dimensional array to fit the specified dimensions\n * @param {Array} array Array to be reshaped\n * @param {number[]} sizes List of sizes for each dimension\n * @returns {Array} Array whose data has been formatted to fit the\n * specified dimensions\n */\n\nfunction _reshape(array, sizes) {\n // testing if there are enough elements for the requested shape\n var tmpArray = array;\n var tmpArray2;\n // for each dimensions starting by the last one and ignoring the first one\n for (var sizeIndex = sizes.length - 1; sizeIndex > 0; sizeIndex--) {\n var size = sizes[sizeIndex];\n tmpArray2 = [];\n\n // aggregate the elements of the current tmpArray in elements of the requested size\n var length = tmpArray.length / size;\n for (var i = 0; i < length; i++) {\n tmpArray2.push(tmpArray.slice(i * size, (i + 1) * size));\n }\n // set it as the new tmpArray for the next loop turn or for return\n tmpArray = tmpArray2;\n }\n return tmpArray;\n}\n\n/**\n * Squeeze a multi dimensional array\n * @param {Array} array\n * @param {Array} [size]\n * @returns {Array} returns the array itself\n */\nexport function squeeze(array, size) {\n var s = size || arraySize(array);\n\n // squeeze outer dimensions\n while (Array.isArray(array) && array.length === 1) {\n array = array[0];\n s.shift();\n }\n\n // find the first dimension to be squeezed\n var dims = s.length;\n while (s[dims - 1] === 1) {\n dims--;\n }\n\n // squeeze inner dimensions\n if (dims < s.length) {\n array = _squeeze(array, dims, 0);\n s.length = dims;\n }\n return array;\n}\n\n/**\n * Recursively squeeze a multi dimensional array\n * @param {Array} array\n * @param {number} dims Required number of dimensions\n * @param {number} dim Current dimension\n * @returns {Array | *} Returns the squeezed array\n * @private\n */\nfunction _squeeze(array, dims, dim) {\n var i, ii;\n if (dim < dims) {\n var next = dim + 1;\n for (i = 0, ii = array.length; i < ii; i++) {\n array[i] = _squeeze(array[i], dims, next);\n }\n } else {\n while (Array.isArray(array)) {\n array = array[0];\n }\n }\n return array;\n}\n\n/**\n * Unsqueeze a multi dimensional array: add dimensions when missing\n *\n * Paramter `size` will be mutated to match the new, unqueezed matrix size.\n *\n * @param {Array} array\n * @param {number} dims Desired number of dimensions of the array\n * @param {number} [outer] Number of outer dimensions to be added\n * @param {Array} [size] Current size of array.\n * @returns {Array} returns the array itself\n * @private\n */\nexport function unsqueeze(array, dims, outer, size) {\n var s = size || arraySize(array);\n\n // unsqueeze outer dimensions\n if (outer) {\n for (var i = 0; i < outer; i++) {\n array = [array];\n s.unshift(1);\n }\n }\n\n // unsqueeze inner dimensions\n array = _unsqueeze(array, dims, 0);\n while (s.length < dims) {\n s.push(1);\n }\n return array;\n}\n\n/**\n * Recursively unsqueeze a multi dimensional array\n * @param {Array} array\n * @param {number} dims Required number of dimensions\n * @param {number} dim Current dimension\n * @returns {Array | *} Returns the squeezed array\n * @private\n */\nfunction _unsqueeze(array, dims, dim) {\n var i, ii;\n if (Array.isArray(array)) {\n var next = dim + 1;\n for (i = 0, ii = array.length; i < ii; i++) {\n array[i] = _unsqueeze(array[i], dims, next);\n }\n } else {\n for (var d = dim; d < dims; d++) {\n array = [array];\n }\n }\n return array;\n}\n/**\n * Flatten a multi dimensional array, put all elements in a one dimensional\n * array\n * @param {Array} array A multi dimensional array\n * @return {Array} The flattened array (1 dimensional)\n */\nexport function flatten(array) {\n if (!Array.isArray(array)) {\n // if not an array, return as is\n return array;\n }\n var flat = [];\n array.forEach(function callback(value) {\n if (Array.isArray(value)) {\n value.forEach(callback); // traverse through sub-arrays recursively\n } else {\n flat.push(value);\n }\n });\n return flat;\n}\n\n/**\n * A safe map\n * @param {Array} array\n * @param {function} callback\n */\nexport function map(array, callback) {\n return Array.prototype.map.call(array, callback);\n}\n\n/**\n * A safe forEach\n * @param {Array} array\n * @param {function} callback\n */\nexport function forEach(array, callback) {\n Array.prototype.forEach.call(array, callback);\n}\n\n/**\n * A safe filter\n * @param {Array} array\n * @param {function} callback\n */\nexport function filter(array, callback) {\n if (arraySize(array).length !== 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return Array.prototype.filter.call(array, callback);\n}\n\n/**\n * Filter values in a callback given a regular expression\n * @param {Array} array\n * @param {RegExp} regexp\n * @return {Array} Returns the filtered array\n * @private\n */\nexport function filterRegExp(array, regexp) {\n if (arraySize(array).length !== 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return Array.prototype.filter.call(array, entry => regexp.test(entry));\n}\n\n/**\n * A safe join\n * @param {Array} array\n * @param {string} separator\n */\nexport function join(array, separator) {\n return Array.prototype.join.call(array, separator);\n}\n\n/**\n * Assign a numeric identifier to every element of a sorted array\n * @param {Array} a An array\n * @return {Array} An array of objects containing the original value and its identifier\n */\nexport function identify(a) {\n if (!Array.isArray(a)) {\n throw new TypeError('Array input expected');\n }\n if (a.length === 0) {\n return a;\n }\n var b = [];\n var count = 0;\n b[0] = {\n value: a[0],\n identifier: 0\n };\n for (var i = 1; i < a.length; i++) {\n if (a[i] === a[i - 1]) {\n count++;\n } else {\n count = 0;\n }\n b.push({\n value: a[i],\n identifier: count\n });\n }\n return b;\n}\n\n/**\n * Remove the numeric identifier from the elements\n * @param {array} a An array\n * @return {array} An array of values without identifiers\n */\nexport function generalize(a) {\n if (!Array.isArray(a)) {\n throw new TypeError('Array input expected');\n }\n if (a.length === 0) {\n return a;\n }\n var b = [];\n for (var i = 0; i < a.length; i++) {\n b.push(a[i].value);\n }\n return b;\n}\n\n/**\n * Check the datatype of a given object\n * This is a low level implementation that should only be used by\n * parent Matrix classes such as SparseMatrix or DenseMatrix\n * This method does not validate Array Matrix shape\n * @param {Array} array\n * @param {function} typeOf Callback function to use to determine the type of a value\n * @return {string}\n */\nexport function getArrayDataType(array, typeOf) {\n var type; // to hold type info\n var length = 0; // to hold length value to ensure it has consistent sizes\n\n for (var i = 0; i < array.length; i++) {\n var item = array[i];\n var _isArray = Array.isArray(item);\n\n // Saving the target matrix row size\n if (i === 0 && _isArray) {\n length = item.length;\n }\n\n // If the current item is an array but the length does not equal the targetVectorSize\n if (_isArray && item.length !== length) {\n return undefined;\n }\n var itemType = _isArray ? getArrayDataType(item, typeOf) // recurse into a nested array\n : typeOf(item);\n if (type === undefined) {\n type = itemType; // first item\n } else if (type !== itemType) {\n return 'mixed';\n } else {\n // we're good, everything has the same type so far\n }\n }\n return type;\n}\n\n/**\n * Return the last item from an array\n * @param {array}\n * @returns {*}\n */\nexport function last(array) {\n return array[array.length - 1];\n}\n\n/**\n * Get all but the last element of array.\n * @param {array}\n * @returns {*}\n */\nexport function initial(array) {\n return array.slice(0, array.length - 1);\n}\n\n/**\n * Recursively concatenate two matrices.\n * The contents of the matrices is not cloned.\n * @param {Array} a Multi dimensional array\n * @param {Array} b Multi dimensional array\n * @param {number} concatDim The dimension on which to concatenate (zero-based)\n * @param {number} dim The current dim (zero-based)\n * @return {Array} c The concatenated matrix\n * @private\n */\nfunction concatRecursive(a, b, concatDim, dim) {\n if (dim < concatDim) {\n // recurse into next dimension\n if (a.length !== b.length) {\n throw new DimensionError(a.length, b.length);\n }\n var c = [];\n for (var i = 0; i < a.length; i++) {\n c[i] = concatRecursive(a[i], b[i], concatDim, dim + 1);\n }\n return c;\n } else {\n // concatenate this dimension\n return a.concat(b);\n }\n}\n\n/**\n * Concatenates many arrays in the specified direction\n * @param {...Array} arrays All the arrays to concatenate\n * @param {number} concatDim The dimension on which to concatenate (zero-based)\n * @returns\n*/\nexport function concat() {\n var arrays = Array.prototype.slice.call(arguments, 0, -1);\n var concatDim = Array.prototype.slice.call(arguments, -1);\n if (arrays.length === 1) {\n return arrays[0];\n }\n if (arrays.length > 1) {\n return arrays.slice(1).reduce(function (A, B) {\n return concatRecursive(A, B, concatDim, 0);\n }, arrays[0]);\n } else {\n throw new Error('Wrong number of arguments in function concat');\n }\n}\n\n/**\n * Receives two or more sizes and get's the broadcasted size for both.\n * @param {...number[]} sizes Sizes to broadcast together\n * @returns\n */\nexport function broadcastSizes() {\n for (var _len = arguments.length, sizes = new Array(_len), _key = 0; _key < _len; _key++) {\n sizes[_key] = arguments[_key];\n }\n var dimensions = sizes.map(s => s.length);\n var N = Math.max(...dimensions);\n var sizeMax = new Array(N).fill(null);\n // check for every size\n for (var i = 0; i < sizes.length; i++) {\n var size = sizes[i];\n var dim = dimensions[i];\n for (var j = 0; j < dim; j++) {\n var n = N - dim + j;\n if (size[j] > sizeMax[n]) {\n sizeMax[n] = size[j];\n }\n }\n }\n for (var _i = 0; _i < sizes.length; _i++) {\n checkBroadcastingRules(sizes[_i], sizeMax);\n }\n return sizeMax;\n}\n\n/**\n * Checks if it's possible to broadcast a size to another size\n * @param {number[]} size The size of the array to check\n * @param {number[]} toSize The size of the array to validate if it can be broadcasted to\n */\nexport function checkBroadcastingRules(size, toSize) {\n var N = toSize.length;\n var dim = size.length;\n for (var j = 0; j < dim; j++) {\n var n = N - dim + j;\n if (size[j] < toSize[n] && size[j] > 1 || size[j] > toSize[n]) {\n throw new Error(\"shape missmatch: missmatch is found in arg with shape (\".concat(size, \") not possible to broadcast dimension \").concat(dim, \" with size \").concat(size[j], \" to size \").concat(toSize[n]));\n }\n }\n}\n\n/**\n * Broadcasts a single array to a certain size\n * @param {array} array Array to be broadcasted\n * @param {number[]} toSize Size to broadcast the array\n * @returns The broadcasted array\n */\nexport function broadcastTo(array, toSize) {\n var Asize = arraySize(array);\n if (deepStrictEqual(Asize, toSize)) {\n return array;\n }\n checkBroadcastingRules(Asize, toSize);\n var broadcastedSize = broadcastSizes(Asize, toSize);\n var N = broadcastedSize.length;\n var paddedSize = [...Array(N - Asize.length).fill(1), ...Asize];\n var A = clone(array);\n // reshape A if needed to make it ready for concat\n if (Asize.length < N) {\n A = reshape(A, paddedSize);\n Asize = arraySize(A);\n }\n\n // stretches the array on each dimension to make it the same size as index\n for (var dim = 0; dim < N; dim++) {\n if (Asize[dim] < broadcastedSize[dim]) {\n A = stretch(A, broadcastedSize[dim], dim);\n Asize = arraySize(A);\n }\n }\n return A;\n}\n\n/**\n * Broadcasts arrays and returns the broadcasted arrays in an array\n * @param {...Array | any} arrays\n * @returns\n */\nexport function broadcastArrays() {\n for (var _len2 = arguments.length, arrays = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arrays[_key2] = arguments[_key2];\n }\n if (arrays.length === 0) {\n throw new Error('Insuficient number of argumnets in function broadcastArrays');\n }\n if (arrays.length === 1) {\n return arrays[0];\n }\n var sizes = arrays.map(function (array) {\n return arraySize(array);\n });\n var broadcastedSize = broadcastSizes(...sizes);\n var broadcastedArrays = [];\n arrays.forEach(function (array) {\n broadcastedArrays.push(broadcastTo(array, broadcastedSize));\n });\n return broadcastedArrays;\n}\n\n/**\n * stretches a matrix up to a certain size in a certain dimension\n * @param {Array} arrayToStretch\n * @param {number[]} sizeToStretch\n * @param {number} dimToStretch\n * @returns\n */\nexport function stretch(arrayToStretch, sizeToStretch, dimToStretch) {\n return concat(...Array(sizeToStretch).fill(arrayToStretch), dimToStretch);\n}\n\n/**\n * Deep clones a multidimensional array\n * @param {Array} array\n * @returns cloned array\n */\nexport function clone(array) {\n return _extends([], array);\n}", "import { isBigNumber, isString, typeOf } from './is.js';\nimport { format as formatNumber } from './number.js';\nimport { format as formatBigNumber } from './bignumber/formatter.js';\n\n/**\n * Check if a text ends with a certain string.\n * @param {string} text\n * @param {string} search\n */\nexport function endsWith(text, search) {\n var start = text.length - search.length;\n var end = text.length;\n return text.substring(start, end) === search;\n}\n\n/**\n * Format a value of any type into a string.\n *\n * Usage:\n * math.format(value)\n * math.format(value, precision)\n * math.format(value, options)\n *\n * When value is a function:\n *\n * - When the function has a property `syntax`, it returns this\n * syntax description.\n * - In other cases, a string `'function'` is returned.\n *\n * When `value` is an Object:\n *\n * - When the object contains a property `format` being a function, this\n * function is invoked as `value.format(options)` and the result is returned.\n * - When the object has its own `toString` method, this method is invoked\n * and the result is returned.\n * - In other cases the function will loop over all object properties and\n * return JSON object notation like '{\"a\": 2, \"b\": 3}'.\n *\n * Example usage:\n * math.format(2/7) // '0.2857142857142857'\n * math.format(math.pi, 3) // '3.14'\n * math.format(new Complex(2, 3)) // '2 + 3i'\n * math.format('hello') // '\"hello\"'\n *\n * @param {*} value Value to be stringified\n * @param {Object | number | Function} [options]\n * Formatting options. See src/utils/number.js:format for a\n * description of the available options controlling number output.\n * This generic \"format\" also supports the option property `truncate: NN`\n * giving the maximum number NN of characters to return (if there would\n * have been more, they are deleted and replaced by an ellipsis).\n * @return {string} str\n */\nexport function format(value, options) {\n var result = _format(value, options);\n if (options && typeof options === 'object' && 'truncate' in options && result.length > options.truncate) {\n return result.substring(0, options.truncate - 3) + '...';\n }\n return result;\n}\nfunction _format(value, options) {\n if (typeof value === 'number') {\n return formatNumber(value, options);\n }\n if (isBigNumber(value)) {\n return formatBigNumber(value, options);\n }\n\n // note: we use unsafe duck-typing here to check for Fractions, this is\n // ok here since we're only invoking toString or concatenating its values\n if (looksLikeFraction(value)) {\n if (!options || options.fraction !== 'decimal') {\n // output as ratio, like '1/3'\n return value.s * value.n + '/' + value.d;\n } else {\n // output as decimal, like '0.(3)'\n return value.toString();\n }\n }\n if (Array.isArray(value)) {\n return formatArray(value, options);\n }\n if (isString(value)) {\n return stringify(value);\n }\n if (typeof value === 'function') {\n return value.syntax ? String(value.syntax) : 'function';\n }\n if (value && typeof value === 'object') {\n if (typeof value.format === 'function') {\n return value.format(options);\n } else if (value && value.toString(options) !== {}.toString()) {\n // this object has a non-native toString method, use that one\n return value.toString(options);\n } else {\n var entries = Object.keys(value).map(key => {\n return stringify(key) + ': ' + format(value[key], options);\n });\n return '{' + entries.join(', ') + '}';\n }\n }\n return String(value);\n}\n\n/**\n * Stringify a value into a string enclosed in double quotes.\n * Unescaped double quotes and backslashes inside the value are escaped.\n * @param {*} value\n * @return {string}\n */\nexport function stringify(value) {\n var text = String(value);\n var escaped = '';\n var i = 0;\n while (i < text.length) {\n var c = text.charAt(i);\n escaped += c in controlCharacters ? controlCharacters[c] : c;\n i++;\n }\n return '\"' + escaped + '\"';\n}\nvar controlCharacters = {\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\',\n '\\b': '\\\\b',\n '\\f': '\\\\f',\n '\\n': '\\\\n',\n '\\r': '\\\\r',\n '\\t': '\\\\t'\n};\n\n/**\n * Escape special HTML characters\n * @param {*} value\n * @return {string}\n */\nexport function escape(value) {\n var text = String(value);\n text = text.replace(/&/g, '&').replace(/\"/g, '"').replace(/'/g, ''').replace(//g, '>');\n return text;\n}\n\n/**\n * Recursively format an n-dimensional matrix\n * Example output: \"[[1, 2], [3, 4]]\"\n * @param {Array} array\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\nfunction formatArray(array, options) {\n if (Array.isArray(array)) {\n var str = '[';\n var len = array.length;\n for (var i = 0; i < len; i++) {\n if (i !== 0) {\n str += ', ';\n }\n str += formatArray(array[i], options);\n }\n str += ']';\n return str;\n } else {\n return format(array, options);\n }\n}\n\n/**\n * Check whether a value looks like a Fraction (unsafe duck-type check)\n * @param {*} value\n * @return {boolean}\n */\nfunction looksLikeFraction(value) {\n return value && typeof value === 'object' && typeof value.s === 'number' && typeof value.n === 'number' && typeof value.d === 'number' || false;\n}\n\n/**\n * Compare two strings\n * @param {string} x\n * @param {string} y\n * @returns {number}\n */\nexport function compareText(x, y) {\n // we don't want to convert numbers to string, only accept string input\n if (!isString(x)) {\n throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + typeOf(x) + ', index: 0)');\n }\n if (!isString(y)) {\n throw new TypeError('Unexpected type of argument in function compareText ' + '(expected: string or Array or Matrix, actual: ' + typeOf(y) + ', index: 1)');\n }\n return x === y ? 0 : x > y ? 1 : -1;\n}", "import { isBigNumber, isNumber } from '../is.js';\nimport { isInteger, normalizeFormatOptions } from '../number.js';\n\n/**\n * Formats a BigNumber in a given base\n * @param {BigNumber} n\n * @param {number} base\n * @param {number} size\n * @returns {string}\n */\nfunction formatBigNumberToBase(n, base, size) {\n var BigNumberCtor = n.constructor;\n var big2 = new BigNumberCtor(2);\n var suffix = '';\n if (size) {\n if (size < 1) {\n throw new Error('size must be in greater than 0');\n }\n if (!isInteger(size)) {\n throw new Error('size must be an integer');\n }\n if (n.greaterThan(big2.pow(size - 1).sub(1)) || n.lessThan(big2.pow(size - 1).mul(-1))) {\n throw new Error(\"Value must be in range [-2^\".concat(size - 1, \", 2^\").concat(size - 1, \"-1]\"));\n }\n if (!n.isInteger()) {\n throw new Error('Value must be an integer');\n }\n if (n.lessThan(0)) {\n n = n.add(big2.pow(size));\n }\n suffix = \"i\".concat(size);\n }\n switch (base) {\n case 2:\n return \"\".concat(n.toBinary()).concat(suffix);\n case 8:\n return \"\".concat(n.toOctal()).concat(suffix);\n case 16:\n return \"\".concat(n.toHexadecimal()).concat(suffix);\n default:\n throw new Error(\"Base \".concat(base, \" not supported \"));\n }\n}\n\n/**\n * Convert a BigNumber to a formatted string representation.\n *\n * Syntax:\n *\n * format(value)\n * format(value, options)\n * format(value, precision)\n * format(value, fn)\n *\n * Where:\n *\n * {number} value The value to be formatted\n * {Object} options An object with formatting options. Available options:\n * {string} notation\n * Number notation. Choose from:\n * 'fixed' Always use regular number notation.\n * For example '123.40' and '14000000'\n * 'exponential' Always use exponential notation.\n * For example '1.234e+2' and '1.4e+7'\n * 'auto' (default) Regular number notation for numbers\n * having an absolute value between\n * `lower` and `upper` bounds, and uses\n * exponential notation elsewhere.\n * Lower bound is included, upper bound\n * is excluded.\n * For example '123.4' and '1.4e7'.\n * 'bin', 'oct, or\n * 'hex' Format the number using binary, octal,\n * or hexadecimal notation.\n * For example '0b1101' and '0x10fe'.\n * {number} wordSize The word size in bits to use for formatting\n * in binary, octal, or hexadecimal notation.\n * To be used only with 'bin', 'oct', or 'hex'\n * values for 'notation' option. When this option\n * is defined the value is formatted as a signed\n * twos complement integer of the given word size\n * and the size suffix is appended to the output.\n * For example\n * format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'.\n * Default value is undefined.\n * {number} precision A number between 0 and 16 to round\n * the digits of the number.\n * In case of notations 'exponential',\n * 'engineering', and 'auto',\n * `precision` defines the total\n * number of significant digits returned.\n * In case of notation 'fixed',\n * `precision` defines the number of\n * significant digits after the decimal\n * point.\n * `precision` is undefined by default.\n * {number} lowerExp Exponent determining the lower boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `-3`.\n * {number} upperExp Exponent determining the upper boundary\n * for formatting a value with an exponent\n * when `notation='auto`.\n * Default value is `5`.\n * {Function} fn A custom formatting function. Can be used to override the\n * built-in notations. Function `fn` is called with `value` as\n * parameter and must return a string. Is useful for example to\n * format all values inside a matrix in a particular way.\n *\n * Examples:\n *\n * format(6.4) // '6.4'\n * format(1240000) // '1.24e6'\n * format(1/3) // '0.3333333333333333'\n * format(1/3, 3) // '0.333'\n * format(21385, 2) // '21000'\n * format(12e8, {notation: 'fixed'}) // returns '1200000000'\n * format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000'\n * format(52.8, {notation: 'exponential'}) // returns '5.28e+1'\n * format(12400, {notation: 'engineering'}) // returns '12.400e+3'\n *\n * @param {BigNumber} value\n * @param {Object | Function | number | BigNumber} [options]\n * @return {string} str The formatted value\n */\nexport function format(value, options) {\n if (typeof options === 'function') {\n // handle format(value, fn)\n return options(value);\n }\n\n // handle special cases\n if (!value.isFinite()) {\n return value.isNaN() ? 'NaN' : value.gt(0) ? 'Infinity' : '-Infinity';\n }\n var {\n notation,\n precision,\n wordSize\n } = normalizeFormatOptions(options);\n\n // handle the various notations\n switch (notation) {\n case 'fixed':\n return toFixed(value, precision);\n case 'exponential':\n return toExponential(value, precision);\n case 'engineering':\n return toEngineering(value, precision);\n case 'bin':\n return formatBigNumberToBase(value, 2, wordSize);\n case 'oct':\n return formatBigNumberToBase(value, 8, wordSize);\n case 'hex':\n return formatBigNumberToBase(value, 16, wordSize);\n case 'auto':\n {\n // determine lower and upper bound for exponential notation.\n // TODO: implement support for upper and lower to be BigNumbers themselves\n var lowerExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.lowerExp, -3);\n var upperExp = _toNumberOrDefault(options === null || options === void 0 ? void 0 : options.upperExp, 5);\n\n // handle special case zero\n if (value.isZero()) return '0';\n\n // determine whether or not to output exponential notation\n var str;\n var rounded = value.toSignificantDigits(precision);\n var exp = rounded.e;\n if (exp >= lowerExp && exp < upperExp) {\n // normal number notation\n str = rounded.toFixed();\n } else {\n // exponential notation\n str = toExponential(value, precision);\n }\n\n // remove trailing zeros after the decimal point\n return str.replace(/((\\.\\d*?)(0+))($|e)/, function () {\n var digits = arguments[2];\n var e = arguments[4];\n return digits !== '.' ? digits + e : e;\n });\n }\n default:\n throw new Error('Unknown notation \"' + notation + '\". ' + 'Choose \"auto\", \"exponential\", \"fixed\", \"bin\", \"oct\", or \"hex.');\n }\n}\n\n/**\n * Format a BigNumber in engineering notation. Like '1.23e+6', '2.3e+0', '3.500e-3'\n * @param {BigNumber} value\n * @param {number} [precision] Optional number of significant figures to return.\n */\nexport function toEngineering(value, precision) {\n // find nearest lower multiple of 3 for exponent\n var e = value.e;\n var newExp = e % 3 === 0 ? e : e < 0 ? e - 3 - e % 3 : e - e % 3;\n\n // find difference in exponents, and calculate the value without exponent\n var valueWithoutExp = value.mul(Math.pow(10, -newExp));\n var valueStr = valueWithoutExp.toPrecision(precision);\n if (valueStr.includes('e')) {\n var BigNumber = value.constructor;\n valueStr = new BigNumber(valueStr).toFixed();\n }\n return valueStr + 'e' + (e >= 0 ? '+' : '') + newExp.toString();\n}\n\n/**\n * Format a number in exponential notation. Like '1.23e+5', '2.3e+0', '3.500e-3'\n * @param {BigNumber} value\n * @param {number} [precision] Number of digits in formatted output.\n * If not provided, the maximum available digits\n * is used.\n * @returns {string} str\n */\nexport function toExponential(value, precision) {\n if (precision !== undefined) {\n return value.toExponential(precision - 1); // Note the offset of one\n } else {\n return value.toExponential();\n }\n}\n\n/**\n * Format a number with fixed notation.\n * @param {BigNumber} value\n * @param {number} [precision=undefined] Optional number of decimals after the\n * decimal point. Undefined by default.\n */\nexport function toFixed(value, precision) {\n return value.toFixed(precision);\n}\nfunction _toNumberOrDefault(value, defaultValue) {\n if (isNumber(value)) {\n return value;\n } else if (isBigNumber(value)) {\n return value.toNumber();\n } else {\n return defaultValue;\n }\n}", "/**\n * Create a range error with the message:\n * 'Dimension mismatch ( != )'\n * @param {number | number[]} actual The actual size\n * @param {number | number[]} expected The expected size\n * @param {string} [relation='!='] Optional relation between actual\n * and expected size: '!=', '<', etc.\n * @extends RangeError\n */\nexport function DimensionError(actual, expected, relation) {\n if (!(this instanceof DimensionError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.actual = actual;\n this.expected = expected;\n this.relation = relation;\n this.message = 'Dimension mismatch (' + (Array.isArray(actual) ? '[' + actual.join(', ') + ']' : actual) + ' ' + (this.relation || '!=') + ' ' + (Array.isArray(expected) ? '[' + expected.join(', ') + ']' : expected) + ')';\n this.stack = new Error().stack;\n}\nDimensionError.prototype = new RangeError();\nDimensionError.prototype.constructor = RangeError;\nDimensionError.prototype.name = 'DimensionError';\nDimensionError.prototype.isDimensionError = true;", "/**\n * Create a range error with the message:\n * 'Index out of range (index < min)'\n * 'Index out of range (index < max)'\n *\n * @param {number} index The actual index\n * @param {number} [min=0] Minimum index (included)\n * @param {number} [max] Maximum index (excluded)\n * @extends RangeError\n */\nexport function IndexError(index, min, max) {\n if (!(this instanceof IndexError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.index = index;\n if (arguments.length < 3) {\n this.min = 0;\n this.max = min;\n } else {\n this.min = min;\n this.max = max;\n }\n if (this.min !== undefined && this.index < this.min) {\n this.message = 'Index out of range (' + this.index + ' < ' + this.min + ')';\n } else if (this.max !== undefined && this.index >= this.max) {\n this.message = 'Index out of range (' + this.index + ' > ' + (this.max - 1) + ')';\n } else {\n this.message = 'Index out of range (' + this.index + ')';\n }\n this.stack = new Error().stack;\n}\nIndexError.prototype = new RangeError();\nIndexError.prototype.constructor = RangeError;\nIndexError.prototype.name = 'IndexError';\nIndexError.prototype.isIndexError = true;", "// function utils\n\nimport { lruQueue } from './lruQueue.js';\n\n/**\n * Memoize a given function by caching the computed result.\n * The cache of a memoized function can be cleared by deleting the `cache`\n * property of the function.\n *\n * @param {function} fn The function to be memoized.\n * Must be a pure function.\n * @param {Object} [options]\n * @param {function(args: Array): string} [options.hasher]\n * A custom hash builder. Is JSON.stringify by default.\n * @param {number | undefined} [options.limit]\n * Maximum number of values that may be cached. Undefined indicates\n * unlimited (default)\n * @return {function} Returns the memoized function\n */\nexport function memoize(fn) {\n var {\n hasher,\n limit\n } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n limit = limit == null ? Number.POSITIVE_INFINITY : limit;\n hasher = hasher == null ? JSON.stringify : hasher;\n return function memoize() {\n if (typeof memoize.cache !== 'object') {\n memoize.cache = {\n values: new Map(),\n lru: lruQueue(limit || Number.POSITIVE_INFINITY)\n };\n }\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n var hash = hasher(args);\n if (memoize.cache.values.has(hash)) {\n memoize.cache.lru.hit(hash);\n return memoize.cache.values.get(hash);\n }\n var newVal = fn.apply(fn, args);\n memoize.cache.values.set(hash, newVal);\n memoize.cache.values.delete(memoize.cache.lru.hit(hash));\n return newVal;\n };\n}\n\n/**\n * Memoize a given function by caching all results and the arguments,\n * and comparing against the arguments of previous results before\n * executing again.\n * This is less performant than `memoize` which calculates a hash,\n * which is very fast to compare. Use `memoizeCompare` only when it is\n * not possible to create a unique serializable hash from the function\n * arguments.\n * The isEqual function must compare two sets of arguments\n * and return true when equal (can be a deep equality check for example).\n * @param {function} fn\n * @param {function(a: *, b: *) : boolean} isEqual\n * @returns {function}\n */\nexport function memoizeCompare(fn, isEqual) {\n var memoize = function memoize() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n for (var c = 0; c < memoize.cache.length; c++) {\n var cached = memoize.cache[c];\n if (isEqual(args, cached.args)) {\n // TODO: move this cache entry to the top so recently used entries move up?\n return cached.res;\n }\n }\n var res = fn.apply(fn, args);\n memoize.cache.unshift({\n args,\n res\n });\n return res;\n };\n memoize.cache = [];\n return memoize;\n}\n\n/**\n * Find the maximum number of arguments expected by a typed function.\n * @param {function} fn A typed function\n * @return {number} Returns the maximum number of expected arguments.\n * Returns -1 when no signatures where found on the function.\n */\nexport function maxArgumentCount(fn) {\n return Object.keys(fn.signatures || {}).reduce(function (args, signature) {\n var count = (signature.match(/,/g) || []).length + 1;\n return Math.max(args, count);\n }, -1);\n}", "// (c) 2018, Mariusz Nowak\n// SPDX-License-Identifier: ISC\n// Derived from https://github.com/medikoo/lru-queue\nexport function lruQueue(limit) {\n var size = 0;\n var base = 1;\n var queue = Object.create(null);\n var map = Object.create(null);\n var index = 0;\n var del = function del(id) {\n var oldIndex = map[id];\n if (!oldIndex) return;\n delete queue[oldIndex];\n delete map[id];\n --size;\n if (base !== oldIndex) return;\n if (!size) {\n index = 0;\n base = 1;\n return;\n }\n while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */}\n };\n limit = Math.abs(limit);\n return {\n hit: function hit(id) {\n var oldIndex = map[id];\n var nuIndex = ++index;\n queue[nuIndex] = id;\n map[id] = nuIndex;\n if (!oldIndex) {\n ++size;\n if (size <= limit) return undefined;\n id = queue[base];\n del(id);\n return id;\n }\n delete queue[oldIndex];\n if (base !== oldIndex) return undefined;\n while (!Object.prototype.hasOwnProperty.call(queue, ++base)) {/* empty */}\n return undefined;\n },\n delete: del,\n clear: function clear() {\n size = index = 0;\n base = 1;\n queue = Object.create(null);\n map = Object.create(null);\n }\n };\n}", "import { clone as objectClone } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'clone';\nvar dependencies = ['typed'];\nexport var createClone = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Clone an object. Will make a deep copy of the data.\n *\n * Syntax:\n *\n * math.clone(x)\n *\n * Examples:\n *\n * math.clone(3.5) // returns number 3.5\n * math.clone(math.complex('2-4i')) // returns Complex 2 - 4i\n * math.clone(math.unit(45, 'deg')) // returns Unit 45 deg\n * math.clone([[1, 2], [3, 4]]) // returns Array [[1, 2], [3, 4]]\n * math.clone(\"hello world\") // returns string \"hello world\"\n *\n * @param {*} x Object to be cloned\n * @return {*} A clone of object x\n */\n return typed(name, {\n any: objectClone\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { isInteger as isIntegerNumber } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isInteger';\nvar dependencies = ['typed'];\nexport var createIsInteger = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is an integer number.\n * The function supports `number`, `BigNumber`, and `Fraction`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isInteger(x)\n *\n * Examples:\n *\n * math.isInteger(2) // returns true\n * math.isInteger(0) // returns true\n * math.isInteger(0.5) // returns false\n * math.isInteger(math.bignumber(500)) // returns true\n * math.isInteger(math.fraction(4)) // returns true\n * math.isInteger('3') // returns true\n * math.isInteger([3, 0.5, -2]) // returns [true, false, true]\n * math.isInteger(math.complex('2-4i')) // throws an error\n *\n * See also:\n *\n * isNumeric, isPositive, isNegative, isZero\n *\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` contains a numeric, integer value.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: isIntegerNumber,\n // TODO: what to do with isInteger(add(0.1, 0.2)) ?\n\n BigNumber: function BigNumber(x) {\n return x.isInt();\n },\n bigint: function bigint(x) {\n return true;\n },\n Fraction: function Fraction(x) {\n return x.d === 1 && isFinite(x.n);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { isCollection, isMatrix } from './is.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { arraySize } from './array.js';\nimport { _switch } from './switch.js';\n\n/**\n * Test whether an array contains collections\n * @param {Array} array\n * @returns {boolean} Returns true when the array contains one or multiple\n * collections (Arrays or Matrices). Returns false otherwise.\n */\nexport function containsCollections(array) {\n for (var i = 0; i < array.length; i++) {\n if (isCollection(array[i])) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Recursively loop over all elements in a given multi dimensional array\n * and invoke the callback on each of the elements.\n * @param {Array | Matrix} array\n * @param {Function} callback The callback method is invoked with one\n * parameter: the current element in the array\n */\nexport function deepForEach(array, callback) {\n if (isMatrix(array)) {\n array = array.valueOf();\n }\n for (var i = 0, ii = array.length; i < ii; i++) {\n var value = array[i];\n if (Array.isArray(value)) {\n deepForEach(value, callback);\n } else {\n callback(value);\n }\n }\n}\n\n/**\n * Execute the callback function element wise for each element in array and any\n * nested array\n * Returns an array with the results\n * @param {Array | Matrix} array\n * @param {Function} callback The callback is called with two parameters:\n * value1 and value2, which contain the current\n * element of both arrays.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {Array | Matrix} res\n */\nexport function deepMap(array, callback, skipZeros) {\n if (array && typeof array.map === 'function') {\n // TODO: replace array.map with a for loop to improve performance\n return array.map(function (x) {\n return deepMap(x, callback, skipZeros);\n });\n } else {\n return callback(array);\n }\n}\n\n/**\n * Reduce a given matrix or array to a new matrix or\n * array with one less dimension, applying the given\n * callback in the selected dimension.\n * @param {Array | Matrix} mat\n * @param {number} dim\n * @param {Function} callback\n * @return {Array | Matrix} res\n */\nexport function reduce(mat, dim, callback) {\n var size = Array.isArray(mat) ? arraySize(mat) : mat.size();\n if (dim < 0 || dim >= size.length) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, size.length);\n }\n if (isMatrix(mat)) {\n return mat.create(_reduce(mat.valueOf(), dim, callback));\n } else {\n return _reduce(mat, dim, callback);\n }\n}\n\n/**\n * Recursively reduce a matrix\n * @param {Array} mat\n * @param {number} dim\n * @param {Function} callback\n * @returns {Array} ret\n * @private\n */\nfunction _reduce(mat, dim, callback) {\n var i, ret, val, tran;\n if (dim <= 0) {\n if (!Array.isArray(mat[0])) {\n val = mat[0];\n for (i = 1; i < mat.length; i++) {\n val = callback(val, mat[i]);\n }\n return val;\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _reduce(tran[i], dim - 1, callback);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _reduce(mat[i], dim - 1, callback);\n }\n return ret;\n }\n}\n\n// TODO: document function scatter\nexport function scatter(a, j, w, x, u, mark, cindex, f, inverse, update, value) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n\n // vars\n var k, k0, k1, i;\n\n // check we need to process values (pattern matrix)\n if (x) {\n // values in j\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check value exists in current j\n if (w[i] !== mark) {\n // i is new entry in j\n w[i] = mark;\n // add i to pattern of C\n cindex.push(i);\n // x(i) = A, check we need to call function this time\n if (update) {\n // copy value to workspace calling callback function\n x[i] = inverse ? f(avalues[k], value) : f(value, avalues[k]);\n // function was called on current row\n u[i] = mark;\n } else {\n // copy value to workspace\n x[i] = avalues[k];\n }\n } else {\n // i exists in C already\n x[i] = inverse ? f(avalues[k], x[i]) : f(x[i], avalues[k]);\n // function was called on current row\n u[i] = mark;\n }\n }\n } else {\n // values in j\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check value exists in current j\n if (w[i] !== mark) {\n // i is new entry in j\n w[i] = mark;\n // add i to pattern of C\n cindex.push(i);\n } else {\n // indicate function was called on current row\n u[i] = mark;\n }\n }\n }\n}", "/**\n * Transpose a matrix\n * @param {Array} mat\n * @returns {Array} ret\n * @private\n */\nexport function _switch(mat) {\n var I = mat.length;\n var J = mat[0].length;\n var i, j;\n var ret = [];\n for (j = 0; j < J; j++) {\n var tmp = [];\n for (i = 0; i < I; i++) {\n tmp.push(mat[i][j]);\n }\n ret.push(tmp);\n }\n return ret;\n}", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNegativeNumber } from '../../plain/number/index.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nvar name = 'isNegative';\nvar dependencies = ['typed', 'config'];\nexport var createIsNegative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config\n } = _ref;\n /**\n * Test whether a value is negative: smaller than zero.\n * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNegative(x)\n *\n * Examples:\n *\n * math.isNegative(3) // returns false\n * math.isNegative(-2) // returns true\n * math.isNegative(0) // returns false\n * math.isNegative(-0) // returns false\n * math.isNegative(math.bignumber(2)) // returns false\n * math.isNegative(math.fraction(-2, 5)) // returns true\n * math.isNegative('-2') // returns true\n * math.isNegative([2, 0, -3]) // returns [false, false, true]\n *\n * See also:\n *\n * isNumeric, isPositive, isZero, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isNegativeNumber(x),\n BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : x.isNeg() && !x.isZero() && !x.isNaN(),\n bigint: x => x < 0n,\n Fraction: x => x.s < 0,\n // It's enough to decide on the sign\n\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { cbrt, expm1, isInteger, log10, log1p, log2, sign, toFixed } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function absNumber(a) {\n return Math.abs(a);\n}\nabsNumber.signature = n1;\nexport function addNumber(a, b) {\n return a + b;\n}\naddNumber.signature = n2;\nexport function subtractNumber(a, b) {\n return a - b;\n}\nsubtractNumber.signature = n2;\nexport function multiplyNumber(a, b) {\n return a * b;\n}\nmultiplyNumber.signature = n2;\nexport function divideNumber(a, b) {\n return a / b;\n}\ndivideNumber.signature = n2;\nexport function unaryMinusNumber(x) {\n return -x;\n}\nunaryMinusNumber.signature = n1;\nexport function unaryPlusNumber(x) {\n return x;\n}\nunaryPlusNumber.signature = n1;\nexport function cbrtNumber(x) {\n return cbrt(x);\n}\ncbrtNumber.signature = n1;\nexport function cubeNumber(x) {\n return x * x * x;\n}\ncubeNumber.signature = n1;\nexport function expNumber(x) {\n return Math.exp(x);\n}\nexpNumber.signature = n1;\nexport function expm1Number(x) {\n return expm1(x);\n}\nexpm1Number.signature = n1;\n\n/**\n * Calculate gcd for numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the greatest common denominator of a and b\n */\nexport function gcdNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var r;\n while (b !== 0) {\n r = a % b;\n a = b;\n b = r;\n }\n return a < 0 ? -a : a;\n}\ngcdNumber.signature = n2;\n\n/**\n * Calculate lcm for two numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the least common multiple of a and b\n */\nexport function lcmNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function lcm must be integer numbers');\n }\n if (a === 0 || b === 0) {\n return 0;\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n // evaluate lcm here inline to reduce overhead\n var t;\n var prod = a * b;\n while (b !== 0) {\n t = b;\n b = a % t;\n a = t;\n }\n return Math.abs(prod / a);\n}\nlcmNumber.signature = n2;\n\n/**\n * Calculate the logarithm of a value, optionally to a given base.\n * @param {number} x\n * @param {number | null | undefined} base\n * @return {number}\n */\nexport function logNumber(x, y) {\n if (y) {\n return Math.log(x) / Math.log(y);\n }\n return Math.log(x);\n}\n\n/**\n * Calculate the 10-base logarithm of a number\n * @param {number} x\n * @return {number}\n */\nexport function log10Number(x) {\n return log10(x);\n}\nlog10Number.signature = n1;\n\n/**\n * Calculate the 2-base logarithm of a number\n * @param {number} x\n * @return {number}\n */\nexport function log2Number(x) {\n return log2(x);\n}\nlog2Number.signature = n1;\n\n/**\n * Calculate the natural logarithm of a `number+1`\n * @param {number} x\n * @returns {number}\n */\nexport function log1pNumber(x) {\n return log1p(x);\n}\nlog1pNumber.signature = n1;\n\n/**\n * Calculate the modulus of two numbers\n * @param {number} x\n * @param {number} y\n * @returns {number} res\n * @private\n */\nexport function modNumber(x, y) {\n // We don't use JavaScript's % operator here as this doesn't work\n // correctly for x < 0 and x === 0\n // see https://en.wikipedia.org/wiki/Modulo_operation\n return y === 0 ? x : x - y * Math.floor(x / y);\n}\nmodNumber.signature = n2;\n\n/**\n * Calculate the nth root of a, solve x^root == a\n * http://rosettacode.org/wiki/Nth_root#JavaScript\n * @param {number} a\n * @param {number} [2] root\n * @private\n */\nexport function nthRootNumber(a) {\n var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n var inv = root < 0;\n if (inv) {\n root = -root;\n }\n if (root === 0) {\n throw new Error('Root must be non-zero');\n }\n if (a < 0 && Math.abs(root) % 2 !== 1) {\n throw new Error('Root must be odd when a is negative.');\n }\n\n // edge cases zero and infinity\n if (a === 0) {\n return inv ? Infinity : 0;\n }\n if (!isFinite(a)) {\n return inv ? 0 : a;\n }\n var x = Math.pow(Math.abs(a), 1 / root);\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a < 0 ? -x : x;\n return inv ? 1 / x : x;\n\n // Very nice algorithm, but fails with nthRoot(-2, 3).\n // Newton's method has some well-known problems at times:\n // https://en.wikipedia.org/wiki/Newton%27s_method#Failure_analysis\n /*\n let x = 1 // Initial guess\n let xPrev = 1\n let i = 0\n const iMax = 10000\n do {\n const delta = (a / Math.pow(x, root - 1) - x) / root\n xPrev = x\n x = x + delta\n i++\n }\n while (xPrev !== x && i < iMax)\n if (xPrev !== x) {\n throw new Error('Function nthRoot failed to converge')\n }\n return inv ? 1 / x : x\n */\n}\nexport function signNumber(x) {\n return sign(x);\n}\nsignNumber.signature = n1;\nexport function sqrtNumber(x) {\n return Math.sqrt(x);\n}\nsqrtNumber.signature = n1;\nexport function squareNumber(x) {\n return x * x;\n}\nsquareNumber.signature = n1;\n\n/**\n * Calculate xgcd for two numbers\n * @param {number} a\n * @param {number} b\n * @return {number} result\n * @private\n */\nexport function xgcdNumber(a, b) {\n // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm\n var t; // used to swap two variables\n var q; // quotient\n var r; // remainder\n var x = 0;\n var lastx = 1;\n var y = 1;\n var lasty = 0;\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function xgcd must be integer numbers');\n }\n while (b) {\n q = Math.floor(a / b);\n r = a - q * b;\n t = x;\n x = lastx - q * x;\n lastx = t;\n t = y;\n y = lasty - q * y;\n lasty = t;\n a = b;\n b = r;\n }\n var res;\n if (a < 0) {\n res = [-a, -lastx, -lasty];\n } else {\n res = [a, a ? lastx : 0, lasty];\n }\n return res;\n}\nxgcdNumber.signature = n2;\n\n/**\n * Calculates the power of x to y, x^y, for two numbers.\n * @param {number} x\n * @param {number} y\n * @return {number} res\n */\nexport function powNumber(x, y) {\n // x^Infinity === 0 if -1 < x < 1\n // A real number 0 is returned instead of complex(0)\n if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) {\n return 0;\n }\n return Math.pow(x, y);\n}\npowNumber.signature = n2;\n\n/**\n * round a number to the given number of decimals, or to zero if decimals is\n * not provided\n * @param {number} value\n * @param {number} decimals number of decimals, between 0 and 15 (0 by default)\n * @return {number} roundedValue\n */\nexport function roundNumber(value) {\n var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n if (!isInteger(decimals) || decimals < 0 || decimals > 15) {\n throw new Error('Number of decimals in function round must be an integer from 0 to 15 inclusive');\n }\n return parseFloat(toFixed(value, decimals));\n}\n\n/**\n * Calculate the norm of a number, the absolute value.\n * @param {number} x\n * @return {number}\n */\nexport function normNumber(x) {\n return Math.abs(x);\n}\nnormNumber.signature = n1;", "import { isInteger } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function bitAndNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitAnd');\n }\n return x & y;\n}\nbitAndNumber.signature = n2;\nexport function bitNotNumber(x) {\n if (!isInteger(x)) {\n throw new Error('Integer expected in function bitNot');\n }\n return ~x;\n}\nbitNotNumber.signature = n1;\nexport function bitOrNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitOr');\n }\n return x | y;\n}\nbitOrNumber.signature = n2;\nexport function bitXorNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function bitXor');\n }\n return x ^ y;\n}\nbitXorNumber.signature = n2;\nexport function leftShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function leftShift');\n }\n return x << y;\n}\nleftShiftNumber.signature = n2;\nexport function rightArithShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function rightArithShift');\n }\n return x >> y;\n}\nrightArithShiftNumber.signature = n2;\nexport function rightLogShiftNumber(x, y) {\n if (!isInteger(x) || !isInteger(y)) {\n throw new Error('Integers expected in function rightLogShift');\n }\n return x >>> y;\n}\nrightLogShiftNumber.signature = n2;", "import { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nexport function combinationsNumber(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (k > n) {\n throw new TypeError('k must be less than or equal to n');\n }\n var nMinusk = n - k;\n var answer = 1;\n var firstnumerator = k < nMinusk ? nMinusk + 1 : k + 1;\n var nextdivisor = 2;\n var lastdivisor = k < nMinusk ? k : nMinusk;\n // balance multiplications and divisions to try to keep intermediate values\n // in exact-integer range as long as possible\n for (var nextnumerator = firstnumerator; nextnumerator <= n; ++nextnumerator) {\n answer *= nextnumerator;\n while (nextdivisor <= lastdivisor && answer % nextdivisor === 0) {\n answer /= nextdivisor;\n ++nextdivisor;\n }\n }\n // for big n, k, floating point may have caused weirdness in remainder\n if (nextdivisor <= lastdivisor) {\n answer /= product(nextdivisor, lastdivisor);\n }\n return answer;\n}\ncombinationsNumber.signature = 'number, number';", "/** @param {number} i\n * @param {number} n\n * @returns {number} product of i to n\n */\nexport function product(i, n) {\n if (n < i) {\n return 1;\n }\n if (n === i) {\n return n;\n }\n var half = n + i >> 1; // divide (n + i) by 2 and truncate to integer\n return product(i, half) * product(half + 1, n);\n}", "export var pi = Math.PI;\nexport var tau = 2 * Math.PI;\nexport var e = Math.E;\nexport var phi = 1.6180339887498948; // eslint-disable-line no-loss-of-precision", "var n1 = 'number';\nvar n2 = 'number, number';\nexport function notNumber(x) {\n return !x;\n}\nnotNumber.signature = n1;\nexport function orNumber(x, y) {\n return !!(x || y);\n}\norNumber.signature = n2;\nexport function xorNumber(x, y) {\n return !!x !== !!y;\n}\nxorNumber.signature = n2;\nexport function andNumber(x, y) {\n return !!(x && y);\n}\nandNumber.signature = n2;", "/* eslint-disable no-loss-of-precision */\n\nimport { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nexport function gammaNumber(n) {\n var x;\n if (isInteger(n)) {\n if (n <= 0) {\n return isFinite(n) ? Infinity : NaN;\n }\n if (n > 171) {\n return Infinity; // Will overflow\n }\n return product(1, n - 1);\n }\n if (n < 0.5) {\n return Math.PI / (Math.sin(Math.PI * n) * gammaNumber(1 - n));\n }\n if (n >= 171.35) {\n return Infinity; // will overflow\n }\n if (n > 85.0) {\n // Extended Stirling Approx\n var twoN = n * n;\n var threeN = twoN * n;\n var fourN = threeN * n;\n var fiveN = fourN * n;\n return Math.sqrt(2 * Math.PI / n) * Math.pow(n / Math.E, n) * (1 + 1 / (12 * n) + 1 / (288 * twoN) - 139 / (51840 * threeN) - 571 / (2488320 * fourN) + 163879 / (209018880 * fiveN) + 5246819 / (75246796800 * fiveN * n));\n }\n --n;\n x = gammaP[0];\n for (var i = 1; i < gammaP.length; ++i) {\n x += gammaP[i] / (n + i);\n }\n var t = n + gammaG + 0.5;\n return Math.sqrt(2 * Math.PI) * Math.pow(t, n + 0.5) * Math.exp(-t) * x;\n}\ngammaNumber.signature = 'number';\n\n// TODO: comment on the variables g and p\n\nexport var gammaG = 4.7421875;\nexport var gammaP = [0.99999999999999709182, 57.156235665862923517, -59.597960355475491248, 14.136097974741747174, -0.49191381609762019978, 0.33994649984811888699e-4, 0.46523628927048575665e-4, -0.98374475304879564677e-4, 0.15808870322491248884e-3, -0.21026444172410488319e-3, 0.21743961811521264320e-3, -0.16431810653676389022e-3, 0.84418223983852743293e-4, -0.26190838401581408670e-4, 0.36899182659531622704e-5];\n\n// lgamma implementation ref: https://mrob.com/pub/ries/lanczos-gamma.html#code\n\n// log(2 * pi) / 2\nexport var lnSqrt2PI = 0.91893853320467274178;\nexport var lgammaG = 5; // Lanczos parameter \"g\"\nexport var lgammaN = 7; // Range of coefficients \"n\"\n\nexport var lgammaSeries = [1.000000000190015, 76.18009172947146, -86.50532032941677, 24.01409824083091, -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5];\nexport function lgammaNumber(n) {\n if (n < 0) return NaN;\n if (n === 0) return Infinity;\n if (!isFinite(n)) return n;\n if (n < 0.5) {\n // Use Euler's reflection formula:\n // gamma(z) = PI / (sin(PI * z) * gamma(1 - z))\n return Math.log(Math.PI / Math.sin(Math.PI * n)) - lgammaNumber(1 - n);\n }\n\n // Compute the logarithm of the Gamma function using the Lanczos method\n\n n = n - 1;\n var base = n + lgammaG + 0.5; // Base of the Lanczos exponential\n var sum = lgammaSeries[0];\n\n // We start with the terms that have the smallest coefficients and largest denominator\n for (var i = lgammaN - 1; i >= 1; i--) {\n sum += lgammaSeries[i] / (n + i);\n }\n return lnSqrt2PI + (n + 0.5) * Math.log(base) - base + Math.log(sum);\n}\nlgammaNumber.signature = 'number';", "import { acosh, asinh, atanh, cosh, sign, sinh, tanh } from '../../utils/number.js';\nvar n1 = 'number';\nvar n2 = 'number, number';\nexport function acosNumber(x) {\n return Math.acos(x);\n}\nacosNumber.signature = n1;\nexport function acoshNumber(x) {\n return acosh(x);\n}\nacoshNumber.signature = n1;\nexport function acotNumber(x) {\n return Math.atan(1 / x);\n}\nacotNumber.signature = n1;\nexport function acothNumber(x) {\n return isFinite(x) ? (Math.log((x + 1) / x) + Math.log(x / (x - 1))) / 2 : 0;\n}\nacothNumber.signature = n1;\nexport function acscNumber(x) {\n return Math.asin(1 / x);\n}\nacscNumber.signature = n1;\nexport function acschNumber(x) {\n var xInv = 1 / x;\n return Math.log(xInv + Math.sqrt(xInv * xInv + 1));\n}\nacschNumber.signature = n1;\nexport function asecNumber(x) {\n return Math.acos(1 / x);\n}\nasecNumber.signature = n1;\nexport function asechNumber(x) {\n var xInv = 1 / x;\n var ret = Math.sqrt(xInv * xInv - 1);\n return Math.log(ret + xInv);\n}\nasechNumber.signature = n1;\nexport function asinNumber(x) {\n return Math.asin(x);\n}\nasinNumber.signature = n1;\nexport function asinhNumber(x) {\n return asinh(x);\n}\nasinhNumber.signature = n1;\nexport function atanNumber(x) {\n return Math.atan(x);\n}\natanNumber.signature = n1;\nexport function atan2Number(y, x) {\n return Math.atan2(y, x);\n}\natan2Number.signature = n2;\nexport function atanhNumber(x) {\n return atanh(x);\n}\natanhNumber.signature = n1;\nexport function cosNumber(x) {\n return Math.cos(x);\n}\ncosNumber.signature = n1;\nexport function coshNumber(x) {\n return cosh(x);\n}\ncoshNumber.signature = n1;\nexport function cotNumber(x) {\n return 1 / Math.tan(x);\n}\ncotNumber.signature = n1;\nexport function cothNumber(x) {\n var e = Math.exp(2 * x);\n return (e + 1) / (e - 1);\n}\ncothNumber.signature = n1;\nexport function cscNumber(x) {\n return 1 / Math.sin(x);\n}\ncscNumber.signature = n1;\nexport function cschNumber(x) {\n // consider values close to zero (+/-)\n if (x === 0) {\n return Number.POSITIVE_INFINITY;\n } else {\n return Math.abs(2 / (Math.exp(x) - Math.exp(-x))) * sign(x);\n }\n}\ncschNumber.signature = n1;\nexport function secNumber(x) {\n return 1 / Math.cos(x);\n}\nsecNumber.signature = n1;\nexport function sechNumber(x) {\n return 2 / (Math.exp(x) + Math.exp(-x));\n}\nsechNumber.signature = n1;\nexport function sinNumber(x) {\n return Math.sin(x);\n}\nsinNumber.signature = n1;\nexport function sinhNumber(x) {\n return sinh(x);\n}\nsinhNumber.signature = n1;\nexport function tanNumber(x) {\n return Math.tan(x);\n}\ntanNumber.signature = n1;\nexport function tanhNumber(x) {\n return tanh(x);\n}\ntanhNumber.signature = n1;", "import { isInteger } from '../../utils/number.js';\nvar n1 = 'number';\nexport function isIntegerNumber(x) {\n return isInteger(x);\n}\nisIntegerNumber.signature = n1;\nexport function isNegativeNumber(x) {\n return x < 0;\n}\nisNegativeNumber.signature = n1;\nexport function isPositiveNumber(x) {\n return x > 0;\n}\nisPositiveNumber.signature = n1;\nexport function isZeroNumber(x) {\n return x === 0;\n}\nisZeroNumber.signature = n1;\nexport function isNaNNumber(x) {\n return Number.isNaN(x);\n}\nisNaNNumber.signature = n1;", "/**\n * Compares two BigNumbers.\n * @param {BigNumber} a - First value to compare\n * @param {BigNumber} b - Second value to compare\n * @param {number} [relTol=1e-09] - The relative tolerance, indicating the maximum allowed difference relative to the larger absolute value. Must be greater than 0.\n * @param {number} [absTol=0] - The minimum absolute tolerance, useful for comparisons near zero. Must be at least 0.\n * @returns {boolean} whether the two numbers are nearly equal\n * @throws {Error} If `relTol` is less than or equal to 0.\n * @throws {Error} If `absTol` is less than 0.\n *\n * @example\n * nearlyEqual(1.000000001, 1.0, 1e-9); // true\n * nearlyEqual(1.000000002, 1.0, 0); // false\n * nearlyEqual(1.0, 1.009, undefined, 0.02); // true\n * nearlyEqual(0.000000001, 0.0, undefined, 1e-8); // true\n */\nexport function nearlyEqual(a, b) {\n var relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1e-9;\n var absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n if (relTol <= 0) {\n throw new Error('Relative tolerance must be greater than 0');\n }\n if (absTol < 0) {\n throw new Error('Absolute tolerance must be at least 0');\n }\n // NaN\n if (a.isNaN() || b.isNaN()) {\n return false;\n }\n if (!a.isFinite() || !b.isFinite()) {\n return a.eq(b);\n }\n // use \"==\" operator, handles infinities\n if (a.eq(b)) {\n return true;\n }\n // abs(a-b) <= max(relTol * max(abs(a), abs(b)), absTol)\n return a.minus(b).abs().lte(a.constructor.max(a.constructor.max(a.abs(), b.abs()).mul(relTol), absTol));\n}", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isNumeric';\nvar dependencies = ['typed'];\nexport var createIsNumeric = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is an numeric value.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNumeric(x)\n *\n * Examples:\n *\n * math.isNumeric(2) // returns true\n * math.isNumeric('2') // returns false\n * math.hasNumericValue('2') // returns true\n * math.isNumeric(0) // returns true\n * math.isNumeric(math.bignumber('42')) // returns true\n * math.isNumeric(math.bigint('42')) // returns true\n * math.isNumeric(math.fraction(4)) // returns true\n * math.isNumeric(math.complex('2-4i')) // returns false\n * math.isNumeric([2.3, 'foo', false]) // returns [true, false, true]\n *\n * See also:\n *\n * isZero, isPositive, isNegative, isInteger, hasNumericValue\n *\n * @param {*} x Value to be tested\n * @return {boolean} Returns true when `x` is a `number`, `BigNumber`,\n * `Fraction`, or `boolean`. Returns false for other types.\n * Throws an error in case of unknown types.\n */\n return typed(name, {\n 'number | BigNumber | bigint | Fraction | boolean': () => true,\n 'Complex | Unit | string | null | undefined | Node': () => false,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'hasNumericValue';\nvar dependencies = ['typed', 'isNumeric'];\nexport var createHasNumericValue = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNumeric\n } = _ref;\n /**\n * Test whether a value is an numeric value.\n *\n * In case of a string, true is returned if the string contains a numeric value.\n *\n * Syntax:\n *\n * math.hasNumericValue(x)\n *\n * Examples:\n *\n * math.hasNumericValue(2) // returns true\n * math.hasNumericValue('2') // returns true\n * math.isNumeric('2') // returns false\n * math.hasNumericValue(0) // returns true\n * math.hasNumericValue(math.bignumber('500')) // returns true\n * math.hasNumericValue(math.bigint('42')) // returns true\n * math.hasNumericValue(42n) // returns true\n * math.hasNumericValue(math.fraction(4)) // returns true\n * math.hasNumericValue(math.complex('2-4i')) // returns false\n * math.hasNumericValue(false) // returns true\n * math.hasNumericValue([2.3, 'foo', false]) // returns [true, false, true]\n *\n * See also:\n *\n * isZero, isPositive, isNegative, isInteger, isNumeric\n *\n * @param {*} x Value to be tested\n * @return {boolean} Returns true when `x` is a `number`, `BigNumber`,\n * `Fraction`, `Boolean`, or a `String` containing number. Returns false for other types.\n * Throws an error in case of unknown types.\n */\n return typed(name, {\n boolean: () => true,\n string: function string(x) {\n return x.trim().length > 0 && !isNaN(Number(x));\n },\n any: function any(x) {\n return isNumeric(x);\n }\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isPositiveNumber } from '../../plain/number/index.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nvar name = 'isPositive';\nvar dependencies = ['typed', 'config'];\nexport var createIsPositive = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config\n } = _ref;\n /**\n * Test whether a value is positive: larger than zero.\n * The function supports types `number`, `BigNumber`, `Fraction`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isPositive(x)\n *\n * Examples:\n *\n * math.isPositive(3) // returns true\n * math.isPositive(-2) // returns false\n * math.isPositive(0) // returns false\n * math.isPositive(-0) // returns false\n * math.isPositive(0.5) // returns true\n * math.isPositive(math.bignumber(2)) // returns true\n * math.isPositive(math.fraction(-2, 5)) // returns false\n * math.isPositive(math.fraction(1, 3)) // returns true\n * math.isPositive('2') // returns true\n * math.isPositive([2, 0, -3]) // returns [true, false, false]\n *\n * See also:\n *\n * isNumeric, isZero, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isPositiveNumber(x),\n BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : !x.isNeg() && !x.isZero() && !x.isNaN(),\n bigint: x => x > 0n,\n Fraction: x => x.s > 0 && x.n > 0,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isZero';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createIsZero = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Test whether a value is zero.\n * The function can check for zero for types `number`, `BigNumber`, `Fraction`,\n * `Complex`, and `Unit`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isZero(x)\n *\n * Examples:\n *\n * math.isZero(0) // returns true\n * math.isZero(2) // returns false\n * math.isZero(0.5) // returns false\n * math.isZero(math.bignumber(0)) // returns true\n * math.isZero(math.fraction(0)) // returns true\n * math.isZero(math.fraction(1,3)) // returns false\n * math.isZero(math.complex('2 - 4i')) // returns false\n * math.isZero(math.complex('0i')) // returns true\n * math.isZero('0') // returns true\n * math.isZero('2') // returns false\n * math.isZero([2, 0, -3]) // returns [false, true, false]\n *\n * See also:\n *\n * isNumeric, isPositive, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n 'number | BigNumber | Complex | Fraction': x => equalScalar(x, 0),\n bigint: x => x === 0n,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNaNNumber } from '../../plain/number/index.js';\nvar name = 'isNaN';\nvar dependencies = ['typed'];\nexport var createIsNaN = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is NaN (not a number).\n * The function supports types `number`, `BigNumber`, `Fraction`, `Unit` and `Complex`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isNaN(x)\n *\n * Examples:\n *\n * math.isNaN(3) // returns false\n * math.isNaN(NaN) // returns true\n * math.isNaN(0) // returns false\n * math.isNaN(math.bignumber(NaN)) // returns true\n * math.isNaN(math.bignumber(0)) // returns false\n * math.isNaN(math.fraction(-2, 5)) // returns false\n * math.isNaN('-2') // returns false\n * math.isNaN([2, 0, -3, NaN]) // returns [false, false, false, true]\n *\n * See also:\n *\n * isNumeric, isNegative, isPositive, isZero, isInteger\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is NaN.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: isNaNNumber,\n BigNumber: function BigNumber(x) {\n return x.isNaN();\n },\n bigint: function bigint(x) {\n return false;\n },\n Fraction: function Fraction(x) {\n return false;\n },\n Complex: function Complex(x) {\n return x.isNaN();\n },\n Unit: function Unit(x) {\n return Number.isNaN(x.value);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { typeOf as _typeOf } from '../../utils/is.js';\nvar name = 'typeOf';\nvar dependencies = ['typed'];\nexport var createTypeOf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Determine the type of an entity.\n *\n * Syntax:\n *\n * math.typeOf(x)\n *\n * Examples:\n *\n * // This list is intended to include all relevant types, for testing\n * // purposes:\n * math.typeOf(3.5) // returns 'number'\n * math.typeOf(42n) // returns 'bigint'\n * math.typeOf(math.complex('2-4i')) // returns 'Complex'\n * math.typeOf(math.unit('45 deg')) // returns 'Unit'\n * math.typeOf('hello world') // returns 'string'\n * math.typeOf(null) // returns 'null'\n * math.typeOf(true) // returns 'boolean'\n * math.typeOf([1, 2, 3]) // returns 'Array'\n * math.typeOf(new Date()) // returns 'Date'\n * math.typeOf(function () {}) // returns 'function'\n * math.typeOf({a: 2, b: 3}) // returns 'Object'\n * math.typeOf(/a regexp/) // returns 'RegExp'\n * math.typeOf(undefined) // returns 'undefined'\n * math.typeOf(math.bignumber('23e99')) // returns 'BigNumber'\n * math.typeOf(math.chain(2)) // returns 'Chain'\n * math.typeOf(math.fraction(1, 3)) // returns 'Fraction'\n * math.typeOf(math.help('sqrt')) // returns 'Help'\n * math.typeOf(math.index(1, 3)) // returns 'Index'\n * math.typeOf(math.matrix([[1],[3]])) // returns 'DenseMatrix'\n * math.typeOf(math.matrix([],'sparse')) // returns 'SparseMatrix'\n * math.typeOf(new math.Range(0, 10)) // returns 'Range'\n * math.typeOf(math.evaluate('a=2\\na')) // returns 'ResultSet'\n * math.typeOf(math.parse('A[2]')) // returns 'AccessorNode'\n * math.typeOf(math.parse('[1,2,3]')) // returns 'ArrayNode'\n * math.typeOf(math.parse('x=2')) // returns 'AssignmentNode'\n * math.typeOf(math.parse('a=2; b=3')) // returns 'BlockNode'\n * math.typeOf(math.parse('x<0?-1:1')) // returns 'ConditionalNode'\n * math.typeOf(math.parse('2.3')) // returns 'ConstantNode'\n * math.typeOf(math.parse('f(x)=x^2')) // returns 'FunctionAssignmentNode'\n * math.typeOf(math.parse('sqrt(4)')) // returns 'FunctionNode'\n * math.typeOf(math.parse('A[2]').index) // returns 'IndexNode'\n * math.typeOf(math.parse('{a:2}')) // returns 'ObjectNode'\n * math.typeOf(math.parse('(2+3)')) // returns 'ParenthesisNode'\n * math.typeOf(math.parse('1:10')) // returns 'RangeNode'\n * math.typeOf(math.parse('a {\n var {\n typed,\n config\n } = _ref;\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether two scalar values are nearly equal.\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Complex | Unit} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Complex} y Second value to compare\n * @return {boolean} Returns true when the compared values are equal, else returns false\n * @private\n */\n return typed(name, {\n 'boolean, boolean': function booleanBoolean(x, y) {\n return x === y;\n },\n 'number, number': function numberNumber(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.eq(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x === y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return x.equals(y);\n },\n 'Complex, Complex': function ComplexComplex(x, y) {\n return complexEquals(x, y, config.relTol, config.absTol);\n }\n }, compareUnits);\n});\nexport var createEqualScalarNumber = factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual } from './number.js';\n\n/**\n * Test whether two complex values are equal provided a given relTol and absTol.\n * Does not use or change the global Complex.EPSILON setting\n * @param {Complex} x - The first complex number for comparison.\n * @param {Complex} y - The second complex number for comparison.\n * @param {number} relTol - The relative tolerance for comparison.\n * @param {number} absTol - The absolute tolerance for comparison.\n * @returns {boolean} - Returns true if the two complex numbers are equal within the given tolerances, otherwise returns false.\n */\nexport function complexEquals(x, y, relTol, absTol) {\n return nearlyEqual(x.re, y.re, relTol, absTol) && nearlyEqual(x.im, y.im, relTol, absTol);\n}", "import { factory } from '../../utils/factory.js';\nexport var createCompareUnits = /* #__PURE__ */factory('compareUnits', ['typed'], _ref => {\n var {\n typed\n } = _ref;\n return {\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (!x.equalBase(y)) {\n throw new Error('Cannot compare units with different base');\n }\n return typed.find(self, [x.valueType(), y.valueType()])(x.value, y.value);\n })\n };\n});", "import { isArray, isBigNumber, isCollection, isIndex, isMatrix, isNumber, isString, typeOf } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { format } from '../../utils/string.js';\nimport { clone, deepStrictEqual } from '../../utils/object.js';\nimport { arraySize, getArrayDataType, processSizesWildcard, unsqueeze, validateIndex } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { maxArgumentCount } from '../../utils/function.js';\nvar name = 'SparseMatrix';\nvar dependencies = ['typed', 'equalScalar', 'Matrix'];\nexport var createSparseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar,\n Matrix\n } = _ref;\n /**\n * Sparse Matrix implementation. This type implements\n * a [Compressed Column Storage](https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_(CSC_or_CCS))\n * format for two-dimensional sparse matrices.\n * @class SparseMatrix\n */\n function SparseMatrix(data, datatype) {\n if (!(this instanceof SparseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data)) {\n // create from matrix\n _createFromMatrix(this, data, datatype);\n } else if (data && isArray(data.index) && isArray(data.ptr) && isArray(data.size)) {\n // initialize fields\n this._values = data.values;\n this._index = data.index;\n this._ptr = data.ptr;\n this._size = data.size;\n this._datatype = datatype || data.datatype;\n } else if (isArray(data)) {\n // create from array\n _createFromArray(this, data, datatype);\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._values = [];\n this._index = [];\n this._ptr = [0];\n this._size = [0, 0];\n this._datatype = datatype;\n }\n }\n function _createFromMatrix(matrix, source, datatype) {\n // check matrix type\n if (source.type === 'SparseMatrix') {\n // clone arrays\n matrix._values = source._values ? clone(source._values) : undefined;\n matrix._index = clone(source._index);\n matrix._ptr = clone(source._ptr);\n matrix._size = clone(source._size);\n matrix._datatype = datatype || source._datatype;\n } else {\n // build from matrix data\n _createFromArray(matrix, source.valueOf(), datatype || source._datatype);\n }\n }\n function _createFromArray(matrix, data, datatype) {\n // initialize fields\n matrix._values = [];\n matrix._index = [];\n matrix._ptr = [];\n matrix._datatype = datatype;\n // discover rows & columns, do not use math.size() to avoid looping array twice\n var rows = data.length;\n var columns = 0;\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, datatype);\n }\n\n // check we have rows (empty array)\n if (rows > 0) {\n // column index\n var j = 0;\n do {\n // store pointer to values index\n matrix._ptr.push(matrix._index.length);\n // loop rows\n for (var i = 0; i < rows; i++) {\n // current row\n var row = data[i];\n // check row is an array\n if (isArray(row)) {\n // update columns if needed (only on first column)\n if (j === 0 && columns < row.length) {\n columns = row.length;\n }\n // check row has column\n if (j < row.length) {\n // value\n var v = row[j];\n // check value != 0\n if (!eq(v, zero)) {\n // store value\n matrix._values.push(v);\n // index\n matrix._index.push(i);\n }\n }\n } else {\n // update columns if needed (only on first column)\n if (j === 0 && columns < 1) {\n columns = 1;\n }\n // check value != 0 (row is a scalar)\n if (!eq(row, zero)) {\n // store value\n matrix._values.push(row);\n // index\n matrix._index.push(i);\n }\n }\n }\n // increment index\n j++;\n } while (j < columns);\n }\n // store number of values in ptr\n matrix._ptr.push(matrix._index.length);\n // size\n matrix._size = [rows, columns];\n }\n SparseMatrix.prototype = new Matrix();\n\n /**\n * Create a new SparseMatrix\n */\n SparseMatrix.prototype.createSparseMatrix = function (data, datatype) {\n return new SparseMatrix(data, datatype);\n };\n\n /**\n * Attach type information\n */\n Object.defineProperty(SparseMatrix, 'name', {\n value: 'SparseMatrix'\n });\n SparseMatrix.prototype.constructor = SparseMatrix;\n SparseMatrix.prototype.type = 'SparseMatrix';\n SparseMatrix.prototype.isSparseMatrix = true;\n\n /**\n * Get the matrix type\n *\n * Usage:\n * const matrixType = matrix.getDataType() // retrieves the matrix type\n *\n * @memberOf SparseMatrix\n * @return {string} type information; if multiple types are found from the Matrix, it will return \"mixed\"\n */\n SparseMatrix.prototype.getDataType = function () {\n return getArrayDataType(this._values, typeOf);\n };\n\n /**\n * Get the storage format used by the matrix.\n *\n * Usage:\n * const format = matrix.storage() // retrieve storage format\n *\n * @memberof SparseMatrix\n * @return {string} The storage format.\n */\n SparseMatrix.prototype.storage = function () {\n return 'sparse';\n };\n\n /**\n * Get the datatype of the data stored in the matrix.\n *\n * Usage:\n * const format = matrix.datatype() // retrieve matrix datatype\n *\n * @memberof SparseMatrix\n * @return {string} The datatype.\n */\n SparseMatrix.prototype.datatype = function () {\n return this._datatype;\n };\n\n /**\n * Create a new SparseMatrix\n * @memberof SparseMatrix\n * @param {Array} data\n * @param {string} [datatype]\n */\n SparseMatrix.prototype.create = function (data, datatype) {\n return new SparseMatrix(data, datatype);\n };\n\n /**\n * Get the matrix density.\n *\n * Usage:\n * const density = matrix.density() // retrieve matrix density\n *\n * @memberof SparseMatrix\n * @return {number} The matrix density.\n */\n SparseMatrix.prototype.density = function () {\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n // calculate density\n return rows !== 0 && columns !== 0 ? this._index.length / (rows * columns) : 0;\n };\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @memberof SparseMatrix\n * @param {Index} index\n * @param {Array | Matrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n SparseMatrix.prototype.subset = function (index, replacement, defaultValue) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke subset on a Pattern only matrix');\n }\n\n // check arguments\n switch (arguments.length) {\n case 1:\n return _getsubset(this, index);\n\n // intentional fall through\n case 2:\n case 3:\n return _setsubset(this, index, replacement, defaultValue);\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n function _getsubset(matrix, idx) {\n // check idx\n if (!isIndex(idx)) {\n throw new TypeError('Invalid index');\n }\n var isScalar = idx.isScalar();\n if (isScalar) {\n // return a scalar\n return matrix.get(idx.min());\n }\n // validate dimensions\n var size = idx.size();\n if (size.length !== matrix._size.length) {\n throw new DimensionError(size.length, matrix._size.length);\n }\n\n // vars\n var i, ii, k, kk;\n\n // validate if any of the ranges in the index is out of range\n var min = idx.min();\n var max = idx.max();\n for (i = 0, ii = matrix._size.length; i < ii; i++) {\n validateIndex(min[i], matrix._size[i]);\n validateIndex(max[i], matrix._size[i]);\n }\n\n // matrix arrays\n var mvalues = matrix._values;\n var mindex = matrix._index;\n var mptr = matrix._ptr;\n\n // rows & columns dimensions for result matrix\n var rows = idx.dimension(0);\n var columns = idx.dimension(1);\n\n // workspace & permutation vector\n var w = [];\n var pv = [];\n\n // loop rows in resulting matrix\n rows.forEach(function (i, r) {\n // update permutation vector\n pv[i] = r[0];\n // mark i in workspace\n w[i] = true;\n });\n\n // result matrix arrays\n var values = mvalues ? [] : undefined;\n var index = [];\n var ptr = [];\n\n // loop columns in result matrix\n columns.forEach(function (j) {\n // update ptr\n ptr.push(index.length);\n // loop values in column j\n for (k = mptr[j], kk = mptr[j + 1]; k < kk; k++) {\n // row\n i = mindex[k];\n // check row is in result matrix\n if (w[i] === true) {\n // push index\n index.push(pv[i]);\n // check we need to process values\n if (values) {\n values.push(mvalues[k]);\n }\n }\n }\n });\n // update ptr\n ptr.push(index.length);\n\n // return matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size,\n datatype: matrix._datatype\n });\n }\n function _setsubset(matrix, index, submatrix, defaultValue) {\n // check index\n if (!index || index.isIndex !== true) {\n throw new TypeError('Invalid index');\n }\n\n // get index size and check whether the index contains a single value\n var iSize = index.size();\n var isScalar = index.isScalar();\n\n // calculate the size of the submatrix, and convert it into an Array if needed\n var sSize;\n if (isMatrix(submatrix)) {\n // submatrix size\n sSize = submatrix.size();\n // use array representation\n submatrix = submatrix.toArray();\n } else {\n // get submatrix size (array, scalar)\n sSize = arraySize(submatrix);\n }\n\n // check index is a scalar\n if (isScalar) {\n // verify submatrix is a scalar\n if (sSize.length !== 0) {\n throw new TypeError('Scalar expected');\n }\n // set value\n matrix.set(index.min(), submatrix, defaultValue);\n } else {\n // validate dimensions, index size must be one or two dimensions\n if (iSize.length !== 1 && iSize.length !== 2) {\n throw new DimensionError(iSize.length, matrix._size.length, '<');\n }\n\n // check submatrix and index have the same dimensions\n if (sSize.length < iSize.length) {\n // calculate number of missing outer dimensions\n var i = 0;\n var outer = 0;\n while (iSize[i] === 1 && sSize[i] === 1) {\n i++;\n }\n while (iSize[i] === 1) {\n outer++;\n i++;\n }\n // unsqueeze both outer and inner dimensions\n submatrix = unsqueeze(submatrix, iSize.length, outer, sSize);\n }\n\n // check whether the size of the submatrix matches the index size\n if (!deepStrictEqual(iSize, sSize)) {\n throw new DimensionError(iSize, sSize, '>');\n }\n\n // insert the sub matrix\n if (iSize.length === 1) {\n // if the replacement index only has 1 dimension, go trough each one and set its value\n var range = index.dimension(0);\n range.forEach(function (dataIndex, subIndex) {\n validateIndex(dataIndex);\n matrix.set([dataIndex, 0], submatrix[subIndex[0]], defaultValue);\n });\n } else {\n // if the replacement index has 2 dimensions, go through each one and set the value in the correct index\n var firstDimensionRange = index.dimension(0);\n var secondDimensionRange = index.dimension(1);\n firstDimensionRange.forEach(function (firstDataIndex, firstSubIndex) {\n validateIndex(firstDataIndex);\n secondDimensionRange.forEach(function (secondDataIndex, secondSubIndex) {\n validateIndex(secondDataIndex);\n matrix.set([firstDataIndex, secondDataIndex], submatrix[firstSubIndex[0]][secondSubIndex[0]], defaultValue);\n });\n });\n }\n }\n return matrix;\n }\n\n /**\n * Get a single element from the matrix.\n * @memberof SparseMatrix\n * @param {number[]} index Zero-based index\n * @return {*} value\n */\n SparseMatrix.prototype.get = function (index) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length !== this._size.length) {\n throw new DimensionError(index.length, this._size.length);\n }\n\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke get on a Pattern only matrix');\n }\n\n // row and column\n var i = index[0];\n var j = index[1];\n\n // check i, j are valid\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[1]);\n\n // find value index\n var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);\n // check k is prior to next column k and it is in the correct row\n if (k < this._ptr[j + 1] && this._index[k] === i) {\n return this._values[k];\n }\n return 0;\n };\n\n /**\n * Replace a single element in the matrix.\n * @memberof SparseMatrix\n * @param {number[]} index Zero-based index\n * @param {*} v\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be set to zero.\n * @return {SparseMatrix} self\n */\n SparseMatrix.prototype.set = function (index, v, defaultValue) {\n if (!isArray(index)) {\n throw new TypeError('Array expected');\n }\n if (index.length !== this._size.length) {\n throw new DimensionError(index.length, this._size.length);\n }\n\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke set on a Pattern only matrix');\n }\n\n // row and column\n var i = index[0];\n var j = index[1];\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(this._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [this._datatype, this._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, this._datatype);\n }\n\n // check we need to resize matrix\n if (i > rows - 1 || j > columns - 1) {\n // resize matrix\n _resize(this, Math.max(i + 1, rows), Math.max(j + 1, columns), defaultValue);\n // update rows & columns\n rows = this._size[0];\n columns = this._size[1];\n }\n\n // check i, j are valid\n validateIndex(i, rows);\n validateIndex(j, columns);\n\n // find value index\n var k = _getValueIndex(i, this._ptr[j], this._ptr[j + 1], this._index);\n // check k is prior to next column k and it is in the correct row\n if (k < this._ptr[j + 1] && this._index[k] === i) {\n // check value != 0\n if (!eq(v, zero)) {\n // update value\n this._values[k] = v;\n } else {\n // remove value from matrix\n _remove(k, j, this._values, this._index, this._ptr);\n }\n } else {\n if (!eq(v, zero)) {\n // insert value @ (i, j)\n _insert(k, i, j, v, this._values, this._index, this._ptr);\n }\n }\n return this;\n };\n function _getValueIndex(i, top, bottom, index) {\n // check row is on the bottom side\n if (bottom - top === 0) {\n return bottom;\n }\n // loop rows [top, bottom[\n for (var r = top; r < bottom; r++) {\n // check we found value index\n if (index[r] === i) {\n return r;\n }\n }\n // we did not find row\n return top;\n }\n function _remove(k, j, values, index, ptr) {\n // remove value @ k\n values.splice(k, 1);\n index.splice(k, 1);\n // update pointers\n for (var x = j + 1; x < ptr.length; x++) {\n ptr[x]--;\n }\n }\n function _insert(k, i, j, v, values, index, ptr) {\n // insert value\n values.splice(k, 0, v);\n // update row for k\n index.splice(k, 0, i);\n // update column pointers\n for (var x = j + 1; x < ptr.length; x++) {\n ptr[x]++;\n }\n }\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @memberof SparseMatrix\n * @param {number[] | Matrix} size The new size the matrix should have.\n * Since sparse matrices are always two-dimensional,\n * size must be two numbers in either an array or a matrix\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n SparseMatrix.prototype.resize = function (size, defaultValue, copy) {\n // validate arguments\n if (!isCollection(size)) {\n throw new TypeError('Array or Matrix expected');\n }\n\n // SparseMatrix input is always 2d, flatten this into 1d if it's indeed a vector\n var sizeArray = size.valueOf().map(value => {\n return Array.isArray(value) && value.length === 1 ? value[0] : value;\n });\n if (sizeArray.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // check sizes\n sizeArray.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value < 0) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(sizeArray) + ')');\n }\n });\n\n // matrix to resize\n var m = copy ? this.clone() : this;\n // resize matrix\n return _resize(m, sizeArray[0], sizeArray[1], defaultValue);\n };\n function _resize(matrix, rows, columns, defaultValue) {\n // value to insert at the time of growing matrix\n var value = defaultValue || 0;\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(matrix._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, matrix._datatype);\n // convert value to the same datatype\n value = typed.convert(value, matrix._datatype);\n }\n\n // should we insert the value?\n var ins = !eq(value, zero);\n\n // old columns and rows\n var r = matrix._size[0];\n var c = matrix._size[1];\n var i, j, k;\n\n // check we need to increase columns\n if (columns > c) {\n // loop new columns\n for (j = c; j < columns; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._values.length;\n // check we need to insert matrix._values\n if (ins) {\n // loop rows\n for (i = 0; i < r; i++) {\n // add new matrix._values\n matrix._values.push(value);\n // update matrix._index\n matrix._index.push(i);\n }\n }\n }\n // store number of matrix._values in matrix._ptr\n matrix._ptr[columns] = matrix._values.length;\n } else if (columns < c) {\n // truncate matrix._ptr\n matrix._ptr.splice(columns + 1, c - columns);\n // truncate matrix._values and matrix._index\n matrix._values.splice(matrix._ptr[columns], matrix._values.length);\n matrix._index.splice(matrix._ptr[columns], matrix._index.length);\n }\n // update columns\n c = columns;\n\n // check we need to increase rows\n if (rows > r) {\n // check we have to insert values\n if (ins) {\n // inserts\n var n = 0;\n // loop columns\n for (j = 0; j < c; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._ptr[j] + n;\n // where to insert matrix._values\n k = matrix._ptr[j + 1] + n;\n // pointer\n var p = 0;\n // loop new rows, initialize pointer\n for (i = r; i < rows; i++, p++) {\n // add value\n matrix._values.splice(k + p, 0, value);\n // update matrix._index\n matrix._index.splice(k + p, 0, i);\n // increment inserts\n n++;\n }\n }\n // store number of matrix._values in matrix._ptr\n matrix._ptr[c] = matrix._values.length;\n }\n } else if (rows < r) {\n // deletes\n var d = 0;\n // loop columns\n for (j = 0; j < c; j++) {\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._ptr[j] - d;\n // where matrix._values start for next column\n var k0 = matrix._ptr[j];\n var k1 = matrix._ptr[j + 1] - d;\n // loop matrix._index\n for (k = k0; k < k1; k++) {\n // row\n i = matrix._index[k];\n // check we need to delete value and matrix._index\n if (i > rows - 1) {\n // remove value\n matrix._values.splice(k, 1);\n // remove item from matrix._index\n matrix._index.splice(k, 1);\n // increase deletes\n d++;\n }\n }\n }\n // update matrix._ptr for current column\n matrix._ptr[j] = matrix._values.length;\n }\n // update matrix._size\n matrix._size[0] = rows;\n matrix._size[1] = columns;\n // return matrix\n return matrix;\n }\n\n /**\n * Reshape the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (reshape in place).\n *\n * NOTE: This might be better suited to copy by default, instead of modifying\n * in place. For now, it operates in place to remain consistent with\n * resize().\n *\n * @memberof SparseMatrix\n * @param {number[]} sizes The new size the matrix should have.\n * Since sparse matrices are always two-dimensional,\n * size must be two numbers in either an array or a matrix\n * @param {boolean} [copy] Return a reshaped copy of the matrix\n *\n * @return {Matrix} The reshaped matrix\n */\n SparseMatrix.prototype.reshape = function (sizes, copy) {\n // validate arguments\n if (!isArray(sizes)) {\n throw new TypeError('Array expected');\n }\n if (sizes.length !== 2) {\n throw new Error('Sparse matrices can only be reshaped in two dimensions');\n }\n\n // check sizes\n sizes.forEach(function (value) {\n if (!isNumber(value) || !isInteger(value) || value <= -2 || value === 0) {\n throw new TypeError('Invalid size, must contain positive integers or -1 ' + '(size: ' + format(sizes) + ')');\n }\n });\n var currentLength = this._size[0] * this._size[1];\n sizes = processSizesWildcard(sizes, currentLength);\n var newLength = sizes[0] * sizes[1];\n\n // m * n must not change\n if (currentLength !== newLength) {\n throw new Error('Reshaping sparse matrix will result in the wrong number of elements');\n }\n\n // matrix to reshape\n var m = copy ? this.clone() : this;\n\n // return unchanged if the same shape\n if (this._size[0] === sizes[0] && this._size[1] === sizes[1]) {\n return m;\n }\n\n // Convert to COO format (generate a column index)\n var colIndex = [];\n for (var i = 0; i < m._ptr.length; i++) {\n for (var j = 0; j < m._ptr[i + 1] - m._ptr[i]; j++) {\n colIndex.push(i);\n }\n }\n\n // Clone the values array\n var values = m._values.slice();\n\n // Clone the row index array\n var rowIndex = m._index.slice();\n\n // Transform the (row, column) indices\n for (var _i = 0; _i < m._index.length; _i++) {\n var r1 = rowIndex[_i];\n var c1 = colIndex[_i];\n var flat = r1 * m._size[1] + c1;\n colIndex[_i] = flat % sizes[1];\n rowIndex[_i] = Math.floor(flat / sizes[1]);\n }\n\n // Now reshaping is supposed to preserve the row-major order, BUT these sparse matrices are stored\n // in column-major order, so we have to reorder the value array now. One option is to use a multisort,\n // sorting several arrays based on some other array.\n\n // OR, we could easily just:\n\n // 1. Remove all values from the matrix\n m._values.length = 0;\n m._index.length = 0;\n m._ptr.length = sizes[1] + 1;\n m._size = sizes.slice();\n for (var _i2 = 0; _i2 < m._ptr.length; _i2++) {\n m._ptr[_i2] = 0;\n }\n\n // 2. Re-insert all elements in the proper order (simplified code from SparseMatrix.prototype.set)\n // This step is probably the most time-consuming\n for (var h = 0; h < values.length; h++) {\n var _i3 = rowIndex[h];\n var _j = colIndex[h];\n var v = values[h];\n var k = _getValueIndex(_i3, m._ptr[_j], m._ptr[_j + 1], m._index);\n _insert(k, _i3, _j, v, m._values, m._index, m._ptr);\n }\n\n // The value indices are inserted out of order, but apparently that's... still OK?\n\n return m;\n };\n\n /**\n * Create a clone of the matrix\n * @memberof SparseMatrix\n * @return {SparseMatrix} clone\n */\n SparseMatrix.prototype.clone = function () {\n var m = new SparseMatrix({\n values: this._values ? clone(this._values) : undefined,\n index: clone(this._index),\n ptr: clone(this._ptr),\n size: clone(this._size),\n datatype: this._datatype\n });\n return m;\n };\n\n /**\n * Retrieve the size of the matrix.\n * @memberof SparseMatrix\n * @returns {number[]} size\n */\n SparseMatrix.prototype.size = function () {\n return this._size.slice(0); // copy the Array\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on\n * each entry of the matrix.\n * @memberof SparseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n *\n * @return {SparseMatrix} matrix\n */\n SparseMatrix.prototype.map = function (callback, skipZeros) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke map on a Pattern only matrix');\n }\n // matrix instance\n var me = this;\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n // invoke callback\n var args = maxArgumentCount(callback);\n var invoke = function invoke(v, i, j) {\n // invoke callback\n if (args === 1) return callback(v);\n if (args === 2) return callback(v, [i, j]);\n return callback(v, [i, j], me);\n };\n // invoke _map\n return _map(this, 0, rows - 1, 0, columns - 1, invoke, skipZeros);\n };\n\n /**\n * Create a new matrix with the results of the callback function executed on the interval\n * [minRow..maxRow, minColumn..maxColumn].\n */\n function _map(matrix, minRow, maxRow, minColumn, maxColumn, callback, skipZeros) {\n // result arrays\n var values = [];\n var index = [];\n var ptr = [];\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(matrix._datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [matrix._datatype, matrix._datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, matrix._datatype);\n }\n\n // invoke callback\n var invoke = function invoke(v, x, y) {\n // invoke callback\n v = callback(v, x, y);\n // check value != 0\n if (!eq(v, zero)) {\n // store value\n values.push(v);\n // index\n index.push(x);\n }\n };\n // loop columns\n for (var j = minColumn; j <= maxColumn; j++) {\n // store pointer to values index\n ptr.push(values.length);\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = matrix._ptr[j];\n var k1 = matrix._ptr[j + 1];\n if (skipZeros) {\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = matrix._index[k];\n // check i is in range\n if (i >= minRow && i <= maxRow) {\n // value @ k\n invoke(matrix._values[k], i - minRow, j - minColumn);\n }\n }\n } else {\n // create a cache holding all defined values\n var _values = {};\n for (var _k = k0; _k < k1; _k++) {\n var _i4 = matrix._index[_k];\n _values[_i4] = matrix._values[_k];\n }\n\n // loop over all rows (indexes can be unordered so we can't use that),\n // and either read the value or zero\n for (var _i5 = minRow; _i5 <= maxRow; _i5++) {\n var value = _i5 in _values ? _values[_i5] : 0;\n invoke(value, _i5 - minRow, j - minColumn);\n }\n }\n }\n\n // store number of values in ptr\n ptr.push(values.length);\n // return sparse matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [maxRow - minRow + 1, maxColumn - minColumn + 1]\n });\n }\n\n /**\n * Execute a callback function on each entry of the matrix.\n * @memberof SparseMatrix\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix being traversed.\n * @param {boolean} [skipZeros] Invoke callback function for non-zero values only.\n * If false, the indices are guaranteed to be in order,\n * if true, the indices can be unordered.\n */\n SparseMatrix.prototype.forEach = function (callback, skipZeros) {\n // check it is a pattern matrix\n if (!this._values) {\n throw new Error('Cannot invoke forEach on a Pattern only matrix');\n }\n // matrix instance\n var me = this;\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n if (skipZeros) {\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n\n // value @ k\n callback(this._values[k], [i, j], me);\n }\n } else {\n // create a cache holding all defined values\n var values = {};\n for (var _k2 = k0; _k2 < k1; _k2++) {\n var _i6 = this._index[_k2];\n values[_i6] = this._values[_k2];\n }\n\n // loop over all rows (indexes can be unordered so we can't use that),\n // and either read the value or zero\n for (var _i7 = 0; _i7 < rows; _i7++) {\n var value = _i7 in values ? values[_i7] : 0;\n callback(value, [_i7, j], me);\n }\n }\n }\n };\n\n /**\n * Iterate over the matrix elements, skipping zeros\n * @return {Iterable<{ value, index: number[] }>}\n */\n SparseMatrix.prototype[Symbol.iterator] = function* () {\n if (!this._values) {\n throw new Error('Cannot iterate a Pattern only matrix');\n }\n var columns = this._size[1];\n for (var j = 0; j < columns; j++) {\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n yield {\n value: this._values[k],\n index: [i, j]\n };\n }\n }\n };\n\n /**\n * Create an Array with a copy of the data of the SparseMatrix\n * @memberof SparseMatrix\n * @returns {Array} array\n */\n SparseMatrix.prototype.toArray = function () {\n return _toArray(this._values, this._index, this._ptr, this._size, true);\n };\n\n /**\n * Get the primitive value of the SparseMatrix: a two dimensions array\n * @memberof SparseMatrix\n * @returns {Array} array\n */\n SparseMatrix.prototype.valueOf = function () {\n return _toArray(this._values, this._index, this._ptr, this._size, false);\n };\n function _toArray(values, index, ptr, size, copy) {\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n // result\n var a = [];\n // vars\n var i, j;\n // initialize array\n for (i = 0; i < rows; i++) {\n a[i] = [];\n for (j = 0; j < columns; j++) {\n a[i][j] = 0;\n }\n }\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n i = index[k];\n // set value (use one for pattern matrix)\n a[i][j] = values ? copy ? clone(values[k]) : values[k] : 1;\n }\n }\n return a;\n }\n\n /**\n * Get a string representation of the matrix, with optional formatting options.\n * @memberof SparseMatrix\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @returns {string} str\n */\n SparseMatrix.prototype.format = function (options) {\n // rows and columns\n var rows = this._size[0];\n var columns = this._size[1];\n // density\n var density = this.density();\n // rows & columns\n var str = 'Sparse Matrix [' + format(rows, options) + ' x ' + format(columns, options) + '] density: ' + format(density, options) + '\\n';\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = this._index[k];\n // append value\n str += '\\n (' + format(i, options) + ', ' + format(j, options) + ') ==> ' + (this._values ? format(this._values[k], options) : 'X');\n }\n }\n return str;\n };\n\n /**\n * Get a string representation of the matrix\n * @memberof SparseMatrix\n * @returns {string} str\n */\n SparseMatrix.prototype.toString = function () {\n return format(this.toArray());\n };\n\n /**\n * Get a JSON representation of the matrix\n * @memberof SparseMatrix\n * @returns {Object}\n */\n SparseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'SparseMatrix',\n values: this._values,\n index: this._index,\n ptr: this._ptr,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Get the kth Matrix diagonal.\n *\n * @memberof SparseMatrix\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will retrieved.\n *\n * @returns {Matrix} The matrix vector with the diagonal values.\n */\n SparseMatrix.prototype.diagonal = function (k) {\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows & columns\n var rows = this._size[0];\n var columns = this._size[1];\n\n // number diagonal values\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // diagonal arrays\n var values = [];\n var index = [];\n var ptr = [];\n // initial ptr value\n ptr[0] = 0;\n // loop columns\n for (var j = kSuper; j < columns && values.length < n; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = this._ptr[j];\n var k1 = this._ptr[j + 1];\n // loop x within [k0, k1[\n for (var x = k0; x < k1; x++) {\n // row index\n var i = this._index[x];\n // check row\n if (i === j - kSuper + kSub) {\n // value on this column\n values.push(this._values[x]);\n // store row\n index[values.length - 1] = i - kSub;\n // exit loop\n break;\n }\n }\n }\n // close ptr\n ptr.push(values.length);\n // return matrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [n, 1]\n });\n };\n\n /**\n * Generate a matrix from a JSON object\n * @memberof SparseMatrix\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SparseMatrix\", \"values\": [], \"index\": [], \"ptr\": [], \"size\": []}`,\n * where mathjs is optional\n * @returns {SparseMatrix}\n */\n SparseMatrix.fromJSON = function (json) {\n return new SparseMatrix(json);\n };\n\n /**\n * Create a diagonal matrix.\n *\n * @memberof SparseMatrix\n * @param {Array} size The matrix size.\n * @param {number | Array | Matrix } value The values for the diagonal.\n * @param {number | BigNumber} [k=0] The kth diagonal where the vector will be filled in.\n * @param {number} [defaultValue] The default value for non-diagonal\n * @param {string} [datatype] The Matrix datatype, values must be of this datatype.\n *\n * @returns {SparseMatrix}\n */\n SparseMatrix.diagonal = function (size, value, k, defaultValue, datatype) {\n if (!isArray(size)) {\n throw new TypeError('Array expected, size parameter');\n }\n if (size.length !== 2) {\n throw new Error('Only two dimensions matrix are supported');\n }\n\n // map size & validate\n size = size.map(function (s) {\n // check it is a big number\n if (isBigNumber(s)) {\n // convert it\n s = s.toNumber();\n }\n // validate arguments\n if (!isNumber(s) || !isInteger(s) || s < 1) {\n throw new Error('Size values must be positive integers');\n }\n return s;\n });\n\n // validate k if any\n if (k) {\n // convert BigNumber to a number\n if (isBigNumber(k)) {\n k = k.toNumber();\n }\n // is must be an integer\n if (!isNumber(k) || !isInteger(k)) {\n throw new TypeError('The parameter k must be an integer number');\n }\n } else {\n // default value\n k = 0;\n }\n\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n if (isString(datatype)) {\n // find signature that matches (datatype, datatype)\n eq = typed.find(equalScalar, [datatype, datatype]) || equalScalar;\n // convert 0 to the same datatype\n zero = typed.convert(0, datatype);\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // number of non-zero items\n var n = Math.min(rows - kSub, columns - kSuper);\n\n // value extraction function\n var _value;\n\n // check value\n if (isArray(value)) {\n // validate array\n if (value.length !== n) {\n // number of values in array must be n\n throw new Error('Invalid value array length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value[i];\n };\n } else if (isMatrix(value)) {\n // matrix size\n var ms = value.size();\n // validate matrix\n if (ms.length !== 1 || ms[0] !== n) {\n // number of values in array must be n\n throw new Error('Invalid matrix length');\n }\n // define function\n _value = function _value(i) {\n // return value @ i\n return value.get([i]);\n };\n } else {\n // define function\n _value = function _value() {\n // return value\n return value;\n };\n }\n\n // create arrays\n var values = [];\n var index = [];\n var ptr = [];\n\n // loop items\n for (var j = 0; j < columns; j++) {\n // number of rows with value\n ptr.push(values.length);\n // diagonal index\n var i = j - kSuper;\n // check we need to set diagonal value\n if (i >= 0 && i < n) {\n // get value @ i\n var v = _value(i);\n // check for zero\n if (!eq(v, zero)) {\n // column\n index.push(i + kSub);\n // add value\n values.push(v);\n }\n }\n }\n // last value should be number of values\n ptr.push(values.length);\n // create SparseMatrix\n return new SparseMatrix({\n values,\n index,\n ptr,\n size: [rows, columns]\n });\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @memberof SparseMatrix\n * @param {number} i Matrix row index 1\n * @param {number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n SparseMatrix.prototype.swapRows = function (i, j) {\n // check index\n if (!isNumber(i) || !isInteger(i) || !isNumber(j) || !isInteger(j)) {\n throw new Error('Row index must be positive integers');\n }\n // check dimensions\n if (this._size.length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n // validate index\n validateIndex(i, this._size[0]);\n validateIndex(j, this._size[0]);\n\n // swap rows\n SparseMatrix._swapRows(i, j, this._size[1], this._values, this._index, this._ptr);\n // return current instance\n return this;\n };\n\n /**\n * Loop rows with data in column j.\n *\n * @param {number} j Column\n * @param {Array} values Matrix values\n * @param {Array} index Matrix row indeces\n * @param {Array} ptr Matrix column pointers\n * @param {Function} callback Callback function invoked for every row in column j\n */\n SparseMatrix._forEachRow = function (j, values, index, ptr, callback) {\n // indeces for column j\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // loop\n for (var k = k0; k < k1; k++) {\n // invoke callback\n callback(index[k], values[k]);\n }\n };\n\n /**\n * Swap rows x and y in Sparse Matrix data structures.\n *\n * @param {number} x Matrix row index 1\n * @param {number} y Matrix row index 2\n * @param {number} columns Number of columns in matrix\n * @param {Array} values Matrix values\n * @param {Array} index Matrix row indeces\n * @param {Array} ptr Matrix column pointers\n */\n SparseMatrix._swapRows = function (x, y, columns, values, index, ptr) {\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // find value index @ x\n var kx = _getValueIndex(x, k0, k1, index);\n // find value index @ x\n var ky = _getValueIndex(y, k0, k1, index);\n // check both rows exist in matrix\n if (kx < k1 && ky < k1 && index[kx] === x && index[ky] === y) {\n // swap values (check for pattern matrix)\n if (values) {\n var v = values[kx];\n values[kx] = values[ky];\n values[ky] = v;\n }\n // next column\n continue;\n }\n // check x row exist & no y row\n if (kx < k1 && index[kx] === x && (ky >= k1 || index[ky] !== y)) {\n // value @ x (check for pattern matrix)\n var vx = values ? values[kx] : undefined;\n // insert value @ y\n index.splice(ky, 0, y);\n if (values) {\n values.splice(ky, 0, vx);\n }\n // remove value @ x (adjust array index if needed)\n index.splice(ky <= kx ? kx + 1 : kx, 1);\n if (values) {\n values.splice(ky <= kx ? kx + 1 : kx, 1);\n }\n // next column\n continue;\n }\n // check y row exist & no x row\n if (ky < k1 && index[ky] === y && (kx >= k1 || index[kx] !== x)) {\n // value @ y (check for pattern matrix)\n var vy = values ? values[ky] : undefined;\n // insert value @ x\n index.splice(kx, 0, x);\n if (values) {\n values.splice(kx, 0, vy);\n }\n // remove value @ y (adjust array index if needed)\n index.splice(kx <= ky ? ky + 1 : ky, 1);\n if (values) {\n values.splice(kx <= ky ? ky + 1 : ky, 1);\n }\n }\n }\n };\n return SparseMatrix;\n}, {\n isClass: true\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'number';\nvar dependencies = ['typed'];\n\n/**\n * Separates the radix, integer part, and fractional part of a non decimal number string\n * @param {string} input string to parse\n * @returns {object} the parts of the string or null if not a valid input\n */\nfunction getNonDecimalNumberParts(input) {\n var nonDecimalWithRadixMatch = input.match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/);\n if (nonDecimalWithRadixMatch) {\n var radix = {\n '0b': 2,\n '0o': 8,\n '0x': 16\n }[nonDecimalWithRadixMatch[1]];\n var integerPart = nonDecimalWithRadixMatch[2];\n var fractionalPart = nonDecimalWithRadixMatch[3];\n return {\n input,\n radix,\n integerPart,\n fractionalPart\n };\n } else {\n return null;\n }\n}\n\n/**\n * Makes a number from a radix, and integer part, and a fractional part\n * @param {parts} [x] parts of the number string (from getNonDecimalNumberParts)\n * @returns {number} the number\n */\nfunction makeNumberFromNonDecimalParts(parts) {\n var n = parseInt(parts.integerPart, parts.radix);\n var f = 0;\n for (var i = 0; i < parts.fractionalPart.length; i++) {\n var digitValue = parseInt(parts.fractionalPart[i], parts.radix);\n f += digitValue / Math.pow(parts.radix, i + 1);\n }\n var result = n + f;\n if (isNaN(result)) {\n throw new SyntaxError('String \"' + parts.input + '\" is not a valid number');\n }\n return result;\n}\nexport var createNumber = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a number or convert a string, boolean, or unit to a number.\n * When value is a matrix, all elements will be converted to number.\n *\n * Syntax:\n *\n * math.number(value)\n * math.number(unit, valuelessUnit)\n *\n * Examples:\n *\n * math.number(2) // returns number 2\n * math.number('7.2') // returns number 7.2\n * math.number(true) // returns number 1\n * math.number([true, false, true, true]) // returns [1, 0, 1, 1]\n * math.number(math.unit('52cm'), 'm') // returns 0.52\n *\n * See also:\n *\n * bignumber, bigint, boolean, numeric, complex, index, matrix, string, unit\n *\n * @param {string | number | BigNumber | Fraction | boolean | Array | Matrix | Unit | null} [value] Value to be converted\n * @param {Unit | string} [valuelessUnit] A valueless unit, used to convert a unit to a number\n * @return {number | Array | Matrix} The created number\n */\n var number = typed('number', {\n '': function _() {\n return 0;\n },\n number: function number(x) {\n return x;\n },\n string: function string(x) {\n if (x === 'NaN') return NaN;\n var nonDecimalNumberParts = getNonDecimalNumberParts(x);\n if (nonDecimalNumberParts) {\n return makeNumberFromNonDecimalParts(nonDecimalNumberParts);\n }\n var size = 0;\n var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);\n if (wordSizeSuffixMatch) {\n // x includes a size suffix like 0xffffi32, so we extract\n // the suffix and remove it from x\n size = Number(wordSizeSuffixMatch[2]);\n x = wordSizeSuffixMatch[1];\n }\n var num = Number(x);\n if (isNaN(num)) {\n throw new SyntaxError('String \"' + x + '\" is not a valid number');\n }\n if (wordSizeSuffixMatch) {\n // x is a signed bin, oct, or hex literal\n // num is the value of string x if x is interpreted as unsigned\n if (num > 2 ** size - 1) {\n // literal is too large for size suffix\n throw new SyntaxError(\"String \\\"\".concat(x, \"\\\" is out of range\"));\n }\n // check if the bit at index size - 1 is set and if so do the twos complement\n if (num >= 2 ** (size - 1)) {\n num = num - 2 ** size;\n }\n }\n return num;\n },\n BigNumber: function BigNumber(x) {\n return x.toNumber();\n },\n bigint: function bigint(x) {\n return Number(x);\n },\n Fraction: function Fraction(x) {\n return x.valueOf();\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n null: function _null(x) {\n return 0;\n },\n 'Unit, string | Unit': function UnitStringUnit(unit, valuelessUnit) {\n return unit.toNumber(valuelessUnit);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n // reviver function to parse a JSON object like:\n //\n // {\"mathjs\":\"number\",\"value\":\"2.3\"}\n //\n // into a number 2.3\n number.fromJSON = function (json) {\n return parseFloat(json.value);\n };\n return number;\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'bigint';\nvar dependencies = ['typed'];\nexport var createBigint = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a bigint or convert a string, boolean, or unit to a bigint.\n * When value is a matrix, all elements will be converted to bigint.\n *\n * Syntax:\n *\n * math.bigint(value)\n *\n * Examples:\n *\n * math.bigint(2) // returns 2n\n * math.bigint('123') // returns 123n\n * math.bigint(true) // returns 1n\n * math.bigint([true, false, true, true]) // returns [1n, 0n, 1n, 1n]\n *\n * See also:\n *\n * number, bignumber, boolean, complex, index, matrix, string, unit\n *\n * @param {string | number | BigNumber | bigint | Fraction | boolean | Array | Matrix | null} [value] Value to be converted\n * @return {bigint | Array | Matrix} The created bigint\n */\n var bigint = typed('bigint', {\n '': function _() {\n return 0n;\n },\n bigint: function bigint(x) {\n return x;\n },\n number: function number(x) {\n return BigInt(x.toFixed());\n },\n BigNumber: function BigNumber(x) {\n return BigInt(x.round().toString());\n },\n Fraction: function Fraction(x) {\n return BigInt(x.valueOf().toFixed());\n },\n 'string | boolean': function stringBoolean(x) {\n return BigInt(x);\n },\n null: function _null(x) {\n return 0n;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n // reviver function to parse a JSON object like:\n //\n // {\"mathjs\":\"bigint\",\"value\":\"123\"}\n //\n // into a bigint 123n\n bigint.fromJSON = function (json) {\n return BigInt(json.value);\n };\n return bigint;\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nimport { format } from '../utils/number.js';\nvar name = 'string';\nvar dependencies = ['typed'];\nexport var createString = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a string or convert any object into a string.\n * Elements of Arrays and Matrices are processed element wise.\n *\n * Syntax:\n *\n * math.string(value)\n *\n * Examples:\n *\n * math.string(4.2) // returns string '4.2'\n * math.string(math.complex(3, 2) // returns string '3 + 2i'\n *\n * const u = math.unit(5, 'km')\n * math.string(u.to('m')) // returns string '5000 m'\n *\n * math.string([true, false]) // returns ['true', 'false']\n *\n * See also:\n *\n * bignumber, boolean, complex, index, matrix, number, unit\n *\n * @param {* | Array | Matrix | null} [value] A value to convert to a string\n * @return {string | Array | Matrix} The created string\n */\n return typed(name, {\n '': function _() {\n return '';\n },\n number: format,\n null: function _null(x) {\n return 'null';\n },\n boolean: function boolean(x) {\n return x + '';\n },\n string: function string(x) {\n return x;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)),\n any: function any(x) {\n return String(x);\n }\n });\n});", "import { factory } from '../utils/factory.js';\nimport { deepMap } from '../utils/collection.js';\nvar name = 'boolean';\nvar dependencies = ['typed'];\nexport var createBoolean = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a boolean or convert a string or number to a boolean.\n * In case of a number, `true` is returned for non-zero numbers, and `false` in\n * case of zero.\n * Strings can be `'true'` or `'false'`, or can contain a number.\n * When value is a matrix, all elements will be converted to boolean.\n *\n * Syntax:\n *\n * math.boolean(x)\n *\n * Examples:\n *\n * math.boolean(0) // returns false\n * math.boolean(1) // returns true\n * math.boolean(-3) // returns true\n * math.boolean('true') // returns true\n * math.boolean('false') // returns false\n * math.boolean([1, 0, 1, 1]) // returns [true, false, true, true]\n *\n * See also:\n *\n * bignumber, complex, index, matrix, string, unit\n *\n * @param {string | number | boolean | Array | Matrix | null} value A value of any type\n * @return {boolean | Array | Matrix} The boolean value\n */\n return typed(name, {\n '': function _() {\n return false;\n },\n boolean: function boolean(x) {\n return x;\n },\n number: function number(x) {\n return !!x;\n },\n null: function _null(x) {\n return false;\n },\n BigNumber: function BigNumber(x) {\n return !x.isZero();\n },\n string: function string(x) {\n // try case insensitive\n var lcase = x.toLowerCase();\n if (lcase === 'true') {\n return true;\n } else if (lcase === 'false') {\n return false;\n }\n\n // test whether value is a valid number\n var num = Number(x);\n if (x !== '' && !isNaN(num)) {\n return !!num;\n }\n throw new Error('Cannot convert \"' + x + '\" to a boolean');\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'bignumber';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createBignumber = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber\n } = _ref;\n /**\n * Create a BigNumber, which can store numbers with arbitrary precision.\n * When a matrix is provided, all elements will be converted to BigNumber.\n *\n * Syntax:\n *\n * math.bignumber(x)\n *\n * Examples:\n *\n * 0.1 + 0.2 // returns number 0.30000000000000004\n * math.bignumber(0.1) + math.bignumber(0.2) // returns BigNumber 0.3\n *\n *\n * 7.2e500 // returns number Infinity\n * math.bignumber('7.2e500') // returns BigNumber 7.2e500\n *\n * See also:\n *\n * number, bigint, boolean, complex, index, matrix, string, unit\n *\n * @param {number | string | Fraction | BigNumber | bigint | Array | Matrix | boolean | null} [value] Value for the big number,\n * 0 by default.\n * @returns {BigNumber} The created bignumber\n */\n return typed('bignumber', {\n '': function _() {\n return new BigNumber(0);\n },\n number: function number(x) {\n // convert to string to prevent errors in case of >15 digits\n return new BigNumber(x + '');\n },\n string: function string(x) {\n var wordSizeSuffixMatch = x.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);\n if (wordSizeSuffixMatch) {\n // x has a word size suffix\n var size = wordSizeSuffixMatch[2];\n var n = BigNumber(wordSizeSuffixMatch[1]);\n var twoPowSize = new BigNumber(2).pow(Number(size));\n if (n.gt(twoPowSize.sub(1))) {\n throw new SyntaxError(\"String \\\"\".concat(x, \"\\\" is out of range\"));\n }\n var twoPowSizeSubOne = new BigNumber(2).pow(Number(size) - 1);\n if (n.gte(twoPowSizeSubOne)) {\n return n.sub(twoPowSize);\n } else {\n return n;\n }\n }\n return new BigNumber(x);\n },\n BigNumber: function BigNumber(x) {\n // we assume a BigNumber is immutable\n return x;\n },\n bigint: function bigint(x) {\n return new BigNumber(x.toString());\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n Fraction: function Fraction(x) {\n return new BigNumber(x.n).div(x.d).times(x.s);\n },\n null: function _null(x) {\n return new BigNumber(0);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'complex';\nvar dependencies = ['typed', 'Complex'];\nexport var createComplex = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Complex\n } = _ref;\n /**\n * Create a complex value or convert a value to a complex value.\n *\n * Syntax:\n *\n * math.complex() // creates a complex value with zero\n * // as real and imaginary part.\n * math.complex(re : number, im : string) // creates a complex value with provided\n * // values for real and imaginary part.\n * math.complex(re : number) // creates a complex value with provided\n * // real value and zero imaginary part.\n * math.complex(complex : Complex) // clones the provided complex value.\n * math.complex(arg : string) // parses a string into a complex value.\n * math.complex(array : Array) // converts the elements of the array\n * // or matrix element wise into a\n * // complex value.\n * math.complex({re: number, im: number}) // creates a complex value with provided\n * // values for real an imaginary part.\n * math.complex({r: number, phi: number}) // creates a complex value with provided\n * // polar coordinates\n *\n * Examples:\n *\n * const a = math.complex(3, -4) // a = Complex 3 - 4i\n * a.re = 5 // a = Complex 5 - 4i\n * const i = a.im // Number -4\n * const b = math.complex('2 + 6i') // Complex 2 + 6i\n * const c = math.complex() // Complex 0 + 0i\n * const d = math.add(a, b) // Complex 5 + 2i\n *\n * See also:\n *\n * bignumber, boolean, index, matrix, number, string, unit\n *\n * @param {* | Array | Matrix} [args]\n * Arguments specifying the real and imaginary part of the complex number\n * @return {Complex | Array | Matrix} Returns a complex value\n */\n return typed('complex', {\n '': function _() {\n return Complex.ZERO;\n },\n number: function number(x) {\n return new Complex(x, 0);\n },\n 'number, number': function numberNumber(re, im) {\n return new Complex(re, im);\n },\n // TODO: this signature should be redundant\n 'BigNumber, BigNumber': function BigNumberBigNumber(re, im) {\n return new Complex(re.toNumber(), im.toNumber());\n },\n Fraction: function Fraction(x) {\n return new Complex(x.valueOf(), 0);\n },\n Complex: function Complex(x) {\n return x.clone();\n },\n string: function string(x) {\n return Complex(x); // for example '2 + 3i'\n },\n null: function _null(x) {\n return Complex(0);\n },\n Object: function Object(x) {\n if ('re' in x && 'im' in x) {\n return new Complex(x.re, x.im);\n }\n if ('r' in x && 'phi' in x || 'abs' in x && 'arg' in x) {\n return new Complex(x);\n }\n throw new Error('Expected object with properties (re and im) or (r and phi) or (abs and arg)');\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'fraction';\nvar dependencies = ['typed', 'Fraction'];\nexport var createFraction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Fraction\n } = _ref;\n /**\n * Create a fraction or convert a value to a fraction.\n *\n * With one numeric argument, produces the closest rational approximation to the\n * input.\n * With two arguments, the first is the numerator and the second is the denominator,\n * and creates the corresponding fraction. Both numerator and denominator must be\n * integers.\n * With one object argument, looks for the integer numerator as the value of property\n * 'n' and the integer denominator as the value of property 'd'.\n * With a matrix argument, creates a matrix of the same shape with entries\n * converted into fractions.\n *\n * Syntax:\n * math.fraction(value)\n * math.fraction(numerator, denominator)\n * math.fraction({n: numerator, d: denominator})\n * math.fraction(matrix: Array | Matrix)\n *\n * Examples:\n *\n * math.fraction(6.283) // returns Fraction 6283/1000\n * math.fraction(1, 3) // returns Fraction 1/3\n * math.fraction('2/3') // returns Fraction 2/3\n * math.fraction({n: 2, d: 3}) // returns Fraction 2/3\n * math.fraction([0.2, 0.25, 1.25]) // returns Array [1/5, 1/4, 5/4]\n * math.fraction(4, 5.1) // throws Error: Parameters must be integer\n *\n * See also:\n *\n * bignumber, number, string, unit\n *\n * @param {number | string | Fraction | BigNumber | bigint | Unit | Array | Matrix} [args]\n * Arguments specifying the value, or numerator and denominator of\n * the fraction\n * @return {Fraction | Array | Matrix} Returns a fraction\n */\n return typed('fraction', {\n number: function number(x) {\n if (!isFinite(x) || isNaN(x)) {\n throw new Error(x + ' cannot be represented as a fraction');\n }\n return new Fraction(x);\n },\n string: function string(x) {\n return new Fraction(x);\n },\n 'number, number': function numberNumber(numerator, denominator) {\n return new Fraction(numerator, denominator);\n },\n null: function _null(x) {\n return new Fraction(0);\n },\n BigNumber: function BigNumber(x) {\n return new Fraction(x.toString());\n },\n bigint: function bigint(x) {\n return new Fraction(x.toString());\n },\n Fraction: function Fraction(x) {\n return x; // fractions are immutable\n },\n Unit: typed.referToSelf(self => x => {\n var clone = x.clone();\n clone.value = self(x.value);\n return clone;\n }),\n Object: function Object(x) {\n return new Fraction(x);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matrix';\nvar dependencies = ['typed', 'Matrix', 'DenseMatrix', 'SparseMatrix'];\nexport var createMatrix = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Matrix,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a Matrix. The function creates a new `math.Matrix` object from\n * an `Array`. A Matrix has utility functions to manipulate the data in the\n * matrix, like getting the size and getting or setting values in the matrix.\n * Supported storage formats are 'dense' and 'sparse'.\n *\n * Syntax:\n *\n * math.matrix() // creates an empty matrix using default storage format (dense).\n * math.matrix(data) // creates a matrix with initial data using default storage format (dense).\n * math.matrix('dense') // creates an empty matrix using the given storage format.\n * math.matrix(data, 'dense') // creates a matrix with initial data using the given storage format.\n * math.matrix(data, 'sparse') // creates a sparse matrix with initial data.\n * math.matrix(data, 'sparse', 'number') // creates a sparse matrix with initial data, number data type.\n *\n * Examples:\n *\n * let m = math.matrix([[1, 2], [3, 4]])\n * m.size() // Array [2, 2]\n * m.resize([3, 2], 5)\n * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]]\n * m.get([1, 0]) // number 3\n *\n * See also:\n *\n * bignumber, boolean, complex, index, number, string, unit, sparse\n *\n * @param {Array | Matrix} [data] A multi dimensional array\n * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'`\n * @param {string} [datatype] Type of the values\n *\n * @return {Matrix} The created matrix\n */\n return typed(name, {\n '': function _() {\n return _create([]);\n },\n string: function string(format) {\n return _create([], format);\n },\n 'string, string': function stringString(format, datatype) {\n return _create([], format, datatype);\n },\n Array: function Array(data) {\n return _create(data);\n },\n Matrix: function Matrix(data) {\n return _create(data, data.storage());\n },\n 'Array | Matrix, string': _create,\n 'Array | Matrix, string, string': _create\n });\n\n /**\n * Create a new Matrix with given storage format\n * @param {Array} data\n * @param {string} [format]\n * @param {string} [datatype]\n * @returns {Matrix} Returns a new Matrix\n * @private\n */\n function _create(data, format, datatype) {\n // get storage format constructor\n if (format === 'dense' || format === 'default' || format === undefined) {\n return new DenseMatrix(data, datatype);\n }\n if (format === 'sparse') {\n return new SparseMatrix(data, datatype);\n }\n throw new TypeError('Unknown matrix type ' + JSON.stringify(format) + '.');\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromFunction';\nvar dependencies = ['typed', 'matrix', 'isZero'];\nexport var createMatrixFromFunction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isZero\n } = _ref;\n /**\n * Create a matrix by evaluating a generating function at each index.\n * The simplest overload returns a multi-dimensional array as long as `size` is an array.\n * Passing `size` as a Matrix or specifying a `format` will result in returning a Matrix.\n *\n * Syntax:\n *\n * math.matrixFromFunction(size, fn)\n * math.matrixFromFunction(size, fn, format)\n * math.matrixFromFunction(size, fn, format, datatype)\n * math.matrixFromFunction(size, format, fn)\n * math.matrixFromFunction(size, format, datatype, fn)\n *\n * Examples:\n *\n * math.matrixFromFunction([3,3], i => i[0] - i[1]) // an antisymmetric matrix\n * math.matrixFromFunction([100, 100], 'sparse', i => i[0] - i[1] === 1 ? 4 : 0) // a sparse subdiagonal matrix\n * math.matrixFromFunction([5], i => math.random()) // a random vector\n *\n * See also:\n *\n * matrix, zeros\n *\n * @param {Array | Matrix} size The size of the matrix to be created\n * @param {function} fn Callback function invoked for every entry in the matrix\n * @param {string} [format] The Matrix storage format, either `'dense'` or `'sparse'`\n * @param {string} [datatype] Type of the values\n * @return {Array | Matrix} Returns the created matrix\n */\n return typed(name, {\n 'Array | Matrix, function, string, string': function ArrayMatrixFunctionStringString(size, fn, format, datatype) {\n return _create(size, fn, format, datatype);\n },\n 'Array | Matrix, function, string': function ArrayMatrixFunctionString(size, fn, format) {\n return _create(size, fn, format);\n },\n 'Matrix, function': function MatrixFunction(size, fn) {\n return _create(size, fn, 'dense');\n },\n 'Array, function': function ArrayFunction(size, fn) {\n return _create(size, fn, 'dense').toArray();\n },\n 'Array | Matrix, string, function': function ArrayMatrixStringFunction(size, format, fn) {\n return _create(size, fn, format);\n },\n 'Array | Matrix, string, string, function': function ArrayMatrixStringStringFunction(size, format, datatype, fn) {\n return _create(size, fn, format, datatype);\n }\n });\n function _create(size, fn, format, datatype) {\n var m;\n if (datatype !== undefined) {\n m = matrix(format, datatype);\n } else {\n m = matrix(format);\n }\n m.resize(size);\n m.forEach(function (_, index) {\n var val = fn(index);\n if (isZero(val)) return;\n m.set(index, val);\n });\n return m;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromRows';\nvar dependencies = ['typed', 'matrix', 'flatten', 'size'];\nexport var createMatrixFromRows = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n flatten,\n size\n } = _ref;\n /**\n * Create a dense matrix from vectors as individual rows.\n * If you pass column vectors, they will be transposed (but not conjugated!)\n *\n * Syntax:\n *\n * math.matrixFromRows(...arr)\n * math.matrixFromRows(row1, row2)\n * math.matrixFromRows(row1, row2, row3)\n *\n * Examples:\n *\n * math.matrixFromRows([1, 2, 3], [[4],[5],[6]])\n * math.matrixFromRows(...vectors)\n *\n * See also:\n *\n * matrix, matrixFromColumns, matrixFromFunction, zeros\n *\n * @param {... Array | Matrix} rows Multiple rows\n * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned\n */\n return typed(name, {\n '...Array': function Array(arr) {\n return _createArray(arr);\n },\n '...Matrix': function Matrix(arr) {\n return matrix(_createArray(arr.map(m => m.toArray())));\n }\n\n // TODO implement this properly for SparseMatrix\n });\n function _createArray(arr) {\n if (arr.length === 0) throw new TypeError('At least one row is needed to construct a matrix.');\n var N = checkVectorTypeAndReturnLength(arr[0]);\n var result = [];\n for (var row of arr) {\n var rowLength = checkVectorTypeAndReturnLength(row);\n if (rowLength !== N) {\n throw new TypeError('The vectors had different length: ' + (N | 0) + ' \u2260 ' + (rowLength | 0));\n }\n result.push(flatten(row));\n }\n return result;\n }\n function checkVectorTypeAndReturnLength(vec) {\n var s = size(vec);\n if (s.length === 1) {\n // 1D vector\n return s[0];\n } else if (s.length === 2) {\n // 2D vector\n if (s[0] === 1) {\n // row vector\n return s[1];\n } else if (s[1] === 1) {\n // col vector\n return s[0];\n } else {\n throw new TypeError('At least one of the arguments is not a vector.');\n }\n } else {\n throw new TypeError('Only one- or two-dimensional vectors are supported.');\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'matrixFromColumns';\nvar dependencies = ['typed', 'matrix', 'flatten', 'size'];\nexport var createMatrixFromColumns = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n flatten,\n size\n } = _ref;\n /**\n * Create a dense matrix from vectors as individual columns.\n * If you pass row vectors, they will be transposed (but not conjugated!)\n *\n * Syntax:\n *\n * math.matrixFromColumns(...arr)\n * math.matrixFromColumns(col1, col2)\n * math.matrixFromColumns(col1, col2, col3)\n *\n * Examples:\n *\n * math.matrixFromColumns([1, 2, 3], [[4],[5],[6]])\n * math.matrixFromColumns(...vectors)\n *\n * See also:\n *\n * matrix, matrixFromRows, matrixFromFunction, zeros\n *\n * @param {... Array | Matrix} cols Multiple columns\n * @return { number[][] | Matrix } if at least one of the arguments is an array, an array will be returned\n */\n return typed(name, {\n '...Array': function Array(arr) {\n return _createArray(arr);\n },\n '...Matrix': function Matrix(arr) {\n return matrix(_createArray(arr.map(m => m.toArray())));\n }\n\n // TODO implement this properly for SparseMatrix\n });\n function _createArray(arr) {\n if (arr.length === 0) throw new TypeError('At least one column is needed to construct a matrix.');\n var N = checkVectorTypeAndReturnLength(arr[0]);\n\n // create an array with empty rows\n var result = [];\n for (var i = 0; i < N; i++) {\n result[i] = [];\n }\n\n // loop columns\n for (var col of arr) {\n var colLength = checkVectorTypeAndReturnLength(col);\n if (colLength !== N) {\n throw new TypeError('The vectors had different length: ' + (N | 0) + ' \u2260 ' + (colLength | 0));\n }\n var f = flatten(col);\n\n // push a value to each row\n for (var _i = 0; _i < N; _i++) {\n result[_i].push(f[_i]);\n }\n }\n return result;\n }\n function checkVectorTypeAndReturnLength(vec) {\n var s = size(vec);\n if (s.length === 1) {\n // 1D vector\n return s[0];\n } else if (s.length === 2) {\n // 2D vector\n if (s[0] === 1) {\n // row vector\n return s[1];\n } else if (s[1] === 1) {\n // col vector\n return s[0];\n } else {\n throw new TypeError('At least one of the arguments is not a vector.');\n }\n } else {\n throw new TypeError('Only one- or two-dimensional vectors are supported.');\n }\n }\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'splitUnit';\nvar dependencies = ['typed'];\nexport var createSplitUnit = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Split a unit in an array of units whose sum is equal to the original unit.\n *\n * Syntax:\n *\n * math.splitUnit(unit: Unit, parts: Array.)\n *\n * Example:\n *\n * math.splitUnit(new Unit(1, 'm'), ['feet', 'inch'])\n * // [ 3 feet, 3.3700787401575 inch ]\n *\n * See also:\n *\n * unit\n *\n * @param {Array} [parts] An array of strings or valueless units.\n * @return {Array} An array of units.\n */\n return typed(name, {\n 'Unit, Array': function UnitArray(unit, parts) {\n return unit.splitUnit(parts);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { unaryMinusNumber } from '../../plain/number/index.js';\nvar name = 'unaryMinus';\nvar dependencies = ['typed'];\nexport var createUnaryMinus = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Inverse the sign of a value, apply a unary minus operation.\n *\n * For matrices, the function is evaluated element wise. Boolean values and\n * strings will be converted to a number. For complex numbers, both real and\n * complex value are inverted.\n *\n * Syntax:\n *\n * math.unaryMinus(x)\n *\n * Examples:\n *\n * math.unaryMinus(3.5) // returns -3.5\n * math.unaryMinus(-4.2) // returns 4.2\n *\n * See also:\n *\n * add, subtract, unaryPlus\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Number to be inverted.\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Returns the value with inverted sign.\n */\n return typed(name, {\n number: unaryMinusNumber,\n 'Complex | BigNumber | Fraction': x => x.neg(),\n bigint: x => -x,\n Unit: typed.referToSelf(self => x => {\n var res = x.clone();\n res.value = typed.find(self, res.valueType())(x.value);\n return res;\n }),\n // deep map collection, skip zeros since unaryMinus(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true))\n\n // TODO: add support for string\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { unaryPlusNumber } from '../../plain/number/index.js';\nimport { safeNumberType } from '../../utils/number.js';\nvar name = 'unaryPlus';\nvar dependencies = ['typed', 'config', 'numeric'];\nexport var createUnaryPlus = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric\n } = _ref;\n /**\n * Unary plus operation.\n * Boolean values and strings will be converted to a number, numeric values will be returned as is.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.unaryPlus(x)\n *\n * Examples:\n *\n * math.unaryPlus(3.5) // returns 3.5\n * math.unaryPlus(1) // returns 1\n *\n * See also:\n *\n * unaryMinus, add, subtract\n *\n * @param {number | BigNumber | bigint | Fraction | string | Complex | Unit | Array | Matrix} x\n * Input value\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix}\n * Returns the input value when numeric, converts to a number when input is non-numeric.\n */\n return typed(name, {\n number: unaryPlusNumber,\n Complex: function Complex(x) {\n return x; // complex numbers are immutable\n },\n BigNumber: function BigNumber(x) {\n return x; // bignumbers are immutable\n },\n bigint: function bigint(x) {\n return x;\n },\n Fraction: function Fraction(x) {\n return x; // fractions are immutable\n },\n Unit: function Unit(x) {\n return x.clone();\n },\n // deep map collection, skip zeros since unaryPlus(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)),\n boolean: function boolean(x) {\n return numeric(x ? 1 : 0, config.number);\n },\n string: function string(x) {\n return numeric(x, safeNumberType(x, config));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { absNumber } from '../../plain/number/index.js';\nvar name = 'abs';\nvar dependencies = ['typed'];\nexport var createAbs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the absolute value of a number. For matrices, the function is\n * evaluated element wise.\n *\n * Syntax:\n *\n * math.abs(x)\n *\n * Examples:\n *\n * math.abs(3.5) // returns number 3.5\n * math.abs(-4.2) // returns number 4.2\n *\n * math.abs([3, -5, -1, 0, 2]) // returns Array [3, 5, 1, 0, 2]\n *\n * See also:\n *\n * sign\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x\n * A number or matrix for which to get the absolute value\n * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit}\n * Absolute value of `x`\n */\n return typed(name, {\n number: absNumber,\n 'Complex | BigNumber | Fraction | Unit': x => x.abs(),\n bigint: x => x < 0n ? -x : x,\n // deep map collection, skip zeros since abs(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { arraySize } from '../../utils/array.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { IndexError } from '../../error/IndexError.js';\nvar name = 'apply';\nvar dependencies = ['typed', 'isInteger'];\nexport var createApply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n /**\n * Apply a function that maps an array to a scalar\n * along a given axis of a matrix or array.\n * Returns a new matrix or array with one less dimension than the input.\n *\n * Syntax:\n *\n * math.apply(A, dim, callback)\n *\n * Where:\n *\n * - `dim: number` is a zero-based dimension over which to concatenate the matrices.\n *\n * Examples:\n *\n * const A = [[1, 2], [3, 4]]\n * const sum = math.sum\n *\n * math.apply(A, 0, sum) // returns [4, 6]\n * math.apply(A, 1, sum) // returns [3, 7]\n *\n * See also:\n *\n * map, filter, forEach\n *\n * @param {Array | Matrix} array The input Matrix\n * @param {number} dim The dimension along which the callback is applied\n * @param {Function} callback The callback function that is applied. This Function\n * should take an array or 1-d matrix as an input and\n * return a number.\n * @return {Array | Matrix} res The residual matrix with the function applied over some dimension.\n */\n return typed(name, {\n 'Array | Matrix, number | BigNumber, function': function ArrayMatrixNumberBigNumberFunction(mat, dim, callback) {\n if (!isInteger(dim)) {\n throw new TypeError('Integer number expected for dimension');\n }\n var size = Array.isArray(mat) ? arraySize(mat) : mat.size();\n if (dim < 0 || dim >= size.length) {\n throw new IndexError(dim, size.length);\n }\n if (isMatrix(mat)) {\n return mat.create(_apply(mat.valueOf(), dim, callback));\n } else {\n return _apply(mat, dim, callback);\n }\n }\n });\n});\n\n/**\n * Recursively reduce a matrix\n * @param {Array} mat\n * @param {number} dim\n * @param {Function} callback\n * @returns {Array} ret\n * @private\n */\nfunction _apply(mat, dim, callback) {\n var i, ret, tran;\n if (dim <= 0) {\n if (!Array.isArray(mat[0])) {\n return callback(mat);\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _apply(tran[i], dim - 1, callback);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _apply(mat[i], dim - 1, callback);\n }\n return ret;\n }\n}\n\n/**\n * Transpose a matrix\n * @param {Array} mat\n * @returns {Array} ret\n * @private\n */\nfunction _switch(mat) {\n var I = mat.length;\n var J = mat[0].length;\n var i, j;\n var ret = [];\n for (j = 0; j < J; j++) {\n var tmp = [];\n for (i = 0; i < I; i++) {\n tmp.push(mat[i][j]);\n }\n ret.push(tmp);\n }\n return ret;\n}", "import { factory } from '../../utils/factory.js';\nimport { addNumber } from '../../plain/number/index.js';\nvar name = 'addScalar';\nvar dependencies = ['typed'];\nexport var createAddScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Add two scalar values, `x + y`.\n * This function is meant for internal use: it is used by the public function\n * `add`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to add\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to add\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Sum of `x` and `y`\n * @private\n */\n return typed(name, {\n 'number, number': addNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.add(y);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.plus(y);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x + y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return x.add(y);\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (x.value === null || x.value === undefined) {\n throw new Error('Parameter x contains a unit with undefined value');\n }\n if (y.value === null || y.value === undefined) {\n throw new Error('Parameter y contains a unit with undefined value');\n }\n if (!x.equalBase(y)) throw new Error('Units do not match');\n var res = x.clone();\n res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value);\n res.fixPrefix = false;\n return res;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { subtractNumber } from '../../plain/number/index.js';\nvar name = 'subtractScalar';\nvar dependencies = ['typed'];\nexport var createSubtractScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Subtract two scalar values, `x - y`.\n * This function is meant for internal use: it is used by the public function\n * `subtract`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to be subtracted from `x`\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Difference of `x` and `y`\n * @private\n */\n return typed(name, {\n 'number, number': subtractNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.sub(y);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.minus(y);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x - y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return x.sub(y);\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => {\n if (x.value === null || x.value === undefined) {\n throw new Error('Parameter x contains a unit with undefined value');\n }\n if (y.value === null || y.value === undefined) {\n throw new Error('Parameter y contains a unit with undefined value');\n }\n if (!x.equalBase(y)) throw new Error('Units do not match');\n var res = x.clone();\n res.value = typed.find(self, [res.valueType(), y.valueType()])(res.value, y.value);\n res.fixPrefix = false;\n return res;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isBigNumber, isComplex, isFraction } from '../../utils/is.js';\nimport { cbrtNumber } from '../../plain/number/index.js';\nvar name = 'cbrt';\nvar dependencies = ['config', 'typed', 'isNegative', 'unaryMinus', 'matrix', 'Complex', 'BigNumber', 'Fraction'];\nexport var createCbrt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n isNegative,\n unaryMinus,\n matrix,\n Complex,\n BigNumber,\n Fraction\n } = _ref;\n /**\n * Calculate the cubic root of a value.\n *\n * To avoid confusion with the matrix cube root, this function does not\n * apply to matrices. For a matrix, to take the cube root elementwise,\n * see the examples.\n *\n * Syntax:\n *\n * math.cbrt(x)\n * math.cbrt(x, allRoots)\n *\n * Examples:\n *\n * math.cbrt(27) // returns 3\n * math.cube(3) // returns 27\n * math.cbrt(-64) // returns -4\n * math.cbrt(math.unit('27 m^3')) // returns Unit 3 m\n * math.map([27, 64, 125], x => math.cbrt(x)) // returns [3, 4, 5]\n *\n * const x = math.complex('8i')\n * math.cbrt(x) // returns Complex 1.7320508075689 + i\n * math.cbrt(x, true) // returns Matrix [\n * // 1.7320508075689 + i\n * // -1.7320508075689 + i\n * // -2i\n * // ]\n *\n * See also:\n *\n * square, sqrt, cube\n *\n * @param {number | BigNumber | Complex | Unit} x\n * Value for which to calculate the cubic root.\n * @param {boolean} [allRoots] Optional, false by default. Only applicable\n * when `x` is a number or complex number. If true, all complex\n * roots are returned, if false (default) the principal root is\n * returned.\n * @return {number | BigNumber | Complex | Unit}\n * Returns the cubic root of `x`\n */\n return typed(name, {\n number: cbrtNumber,\n // note: signature 'number, boolean' is also supported,\n // created by typed as it knows how to convert number to Complex\n\n Complex: _cbrtComplex,\n 'Complex, boolean': _cbrtComplex,\n BigNumber: function BigNumber(x) {\n return x.cbrt();\n },\n Unit: _cbrtUnit\n });\n\n /**\n * Calculate the cubic root for a complex number\n * @param {Complex} x\n * @param {boolean} [allRoots] If true, the function will return an array\n * with all three roots. If false or undefined,\n * the principal root is returned.\n * @returns {Complex | Array. | Matrix.} Returns the cubic root(s) of x\n * @private\n */\n function _cbrtComplex(x, allRoots) {\n // https://www.wikiwand.com/en/Cube_root#/Complex_numbers\n\n var arg3 = x.arg() / 3;\n var abs = x.abs();\n\n // principal root:\n var principal = new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3).exp());\n if (allRoots) {\n var all = [principal, new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 + Math.PI * 2 / 3).exp()), new Complex(cbrtNumber(abs), 0).mul(new Complex(0, arg3 - Math.PI * 2 / 3).exp())];\n return config.matrix === 'Array' ? all : matrix(all);\n } else {\n return principal;\n }\n }\n\n /**\n * Calculate the cubic root for a Unit\n * @param {Unit} x\n * @return {Unit} Returns the cubic root of x\n * @private\n */\n function _cbrtUnit(x) {\n if (x.value && isComplex(x.value)) {\n var result = x.clone();\n result.value = 1.0;\n result = result.pow(1.0 / 3); // Compute the units\n result.value = _cbrtComplex(x.value); // Compute the value\n return result;\n } else {\n var negate = isNegative(x.value);\n if (negate) {\n x.value = unaryMinus(x.value);\n }\n\n // TODO: create a helper function for this\n var third;\n if (isBigNumber(x.value)) {\n third = new BigNumber(1).div(3);\n } else if (isFraction(x.value)) {\n third = new Fraction(1, 3);\n } else {\n third = 1 / 3;\n }\n var _result = x.pow(third);\n if (negate) {\n _result.value = unaryMinus(_result.value);\n }\n return _result;\n }\n }\n});", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'ceil';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createCeilNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => {\n var {\n typed,\n config,\n round\n } = _ref;\n return typed(name, {\n number: function number(x) {\n if (nearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return Math.ceil(x);\n }\n },\n 'number, number': function numberNumber(x, n) {\n if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n var [number, exponent] = \"\".concat(x, \"e\").split('e');\n var result = Math.ceil(Number(\"\".concat(number, \"e\").concat(Number(exponent) + n)));\n [number, exponent] = \"\".concat(result, \"e\").split('e');\n return Number(\"\".concat(number, \"e\").concat(Number(exponent) - n));\n }\n }\n });\n});\nexport var createCeil = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var ceilNumber = createCeilNumber({\n typed,\n config,\n round\n });\n /**\n * Round a value towards plus infinity\n * If `x` is complex, both real and imaginary part are rounded towards plus infinity.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.ceil(x)\n * math.ceil(x, n)\n *\n * Examples:\n *\n * math.ceil(3.2) // returns number 4\n * math.ceil(3.8) // returns number 4\n * math.ceil(-4.2) // returns number -4\n * math.ceil(-4.7) // returns number -4\n *\n * math.ceil(3.212, 2) // returns number 3.22\n * math.ceil(3.288, 2) // returns number 3.29\n * math.ceil(-4.212, 2) // returns number -4.21\n * math.ceil(-4.782, 2) // returns number -4.78\n *\n * const c = math.complex(3.24, -2.71)\n * math.ceil(c) // returns Complex 4 - 2i\n * math.ceil(c, 1) // returns Complex 3.3 - 2.7i\n *\n * math.ceil([3.2, 3.8, -4.7]) // returns Array [4, 4, -4]\n * math.ceil([3.21, 3.82, -4.71], 1) // returns Array [3.3, 3.9, -4.7]\n *\n * See also:\n *\n * floor, fix, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('ceil', {\n number: ceilNumber.signatures.number,\n 'number,number': ceilNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return x.ceil();\n },\n 'Complex, number': function ComplexNumber(x, n) {\n return x.ceil(n);\n },\n 'Complex, BigNumber': function ComplexBigNumber(x, n) {\n return x.ceil(n.toNumber());\n },\n BigNumber: function BigNumber(x) {\n if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return x.ceil();\n }\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, n) {\n if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_CEIL);\n }\n },\n Fraction: function Fraction(x) {\n return x.ceil();\n },\n 'Fraction, number': function FractionNumber(x, n) {\n return x.ceil(n);\n },\n 'Fraction, BigNumber': function FractionBigNumber(x, n) {\n return x.ceil(n.toNumber());\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo11xS0s';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo11xS0s = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked NZ times (number of nonzero items in S).\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo11xS0s(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // initialize ptr\n cptr[j] = cindex.length;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = aindex[k];\n // invoke callback\n var v = inverse ? cf(b, avalues[k]) : cf(avalues[k], b);\n // check value is zero\n if (!eq(v, zero)) {\n // push index & value\n cindex.push(i);\n cvalues.push(v);\n }\n }\n }\n // update ptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return s.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo12xSfs';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo12xSfs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked MxN times.\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 f(0, b) ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo12xSfs(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cdata = [];\n\n // workspaces\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var r = aindex[k];\n // update workspace\n x[r] = avalues[k];\n w[r] = mark;\n }\n // loop rows\n for (var i = 0; i < rows; i++) {\n // initialize C on first column\n if (j === 0) {\n // create row array\n cdata[i] = [];\n }\n // check sparse matrix has a value @ i,j\n if (w[i] === mark) {\n // invoke callback, update C\n cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b);\n } else {\n // dense matrix value @ i, j\n cdata[i][j] = inverse ? cf(b, 0) : cf(0, b);\n }\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { clone } from '../../../utils/object.js';\nvar name = 'matAlgo14xDs';\nvar dependencies = ['typed'];\nexport var createMatAlgo14xDs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, b).\n * Callback function invoked MxN times.\n *\n * C(i,j,...z) = f(Aij..z, b)\n *\n * @param {Matrix} a The DenseMatrix instance (A)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij..z,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Aij..z)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97659042\n */\n return function matAlgo14xDs(a, b, callback, inverse) {\n // a arrays\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype;\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // populate cdata, iterate through dimensions\n var cdata = asize.length > 0 ? _iterate(cf, 0, asize, asize[0], adata, b, inverse) : [];\n\n // c matrix\n return a.createDenseMatrix({\n data: cdata,\n size: clone(asize),\n datatype: dt\n });\n };\n\n // recursive function\n function _iterate(f, level, s, n, av, bv, inverse) {\n // initialize array for this level\n var cv = [];\n // check we reach the last level\n if (level === s.length - 1) {\n // loop arrays in last level\n for (var i = 0; i < n; i++) {\n // invoke callback and store value\n cv[i] = inverse ? f(bv, av[i]) : f(av[i], bv);\n }\n } else {\n // iterate current level\n for (var j = 0; j < n; j++) {\n // iterate next level\n cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv, inverse);\n }\n }\n return cv;\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { cubeNumber } from '../../plain/number/index.js';\nvar name = 'cube';\nvar dependencies = ['typed'];\nexport var createCube = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the cube of a value, `x * x * x`.\n * To avoid confusion with `pow(M,3)`, this function does not apply to matrices.\n * If you wish to cube every entry of a matrix, see the examples.\n *\n * Syntax:\n *\n * math.cube(x)\n *\n * Examples:\n *\n * math.cube(2) // returns number 8\n * math.pow(2, 3) // returns number 8\n * math.cube(4) // returns number 64\n * 4 * 4 * 4 // returns number 64\n *\n * math.map([1, 2, 3, 4], math.cube) // returns Array [1, 8, 27, 64]\n *\n * See also:\n *\n * multiply, square, pow, cbrt\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Number for which to calculate the cube\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Cube of x\n */\n return typed(name, {\n number: cubeNumber,\n Complex: function Complex(x) {\n return x.mul(x).mul(x); // Is faster than pow(x, 3)\n },\n BigNumber: function BigNumber(x) {\n return x.times(x).times(x);\n },\n bigint: function bigint(x) {\n return x * x * x;\n },\n Fraction: function Fraction(x) {\n return x.pow(3); // Is faster than mul()mul()mul()\n },\n Unit: function Unit(x) {\n return x.pow(3);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { expNumber } from '../../plain/number/index.js';\nvar name = 'exp';\nvar dependencies = ['typed'];\nexport var createExp = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the exponential of a value.\n * For matrices, if you want the matrix exponential of square matrix, use\n * the `expm` function; if you want to take the exponential of each element,\n * see the examples.\n *\n * Syntax:\n *\n * math.exp(x)\n *\n * Examples:\n *\n * math.exp(2) // returns number 7.3890560989306495\n * math.pow(math.e, 2) // returns number 7.3890560989306495\n * math.log(math.exp(2)) // returns number 2\n *\n * math.map([1, 2, 3], math.exp)\n * // returns Array [\n * // 2.718281828459045,\n * // 7.3890560989306495,\n * // 20.085536923187668\n * // ]\n *\n * See also:\n *\n * expm1, expm, log, pow\n *\n * @param {number | BigNumber | Complex} x A number to exponentiate\n * @return {number | BigNumber | Complex} Exponential of `x`\n */\n return typed(name, {\n number: expNumber,\n Complex: function Complex(x) {\n return x.exp();\n },\n BigNumber: function BigNumber(x) {\n return x.exp();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { expm1Number } from '../../plain/number/index.js';\nvar name = 'expm1';\nvar dependencies = ['typed', 'Complex'];\nexport var createExpm1 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Complex: _Complex\n } = _ref;\n /**\n * Calculate the value of subtracting 1 from the exponential value.\n * This function is more accurate than `math.exp(x)-1` when `x` is near 0\n * To avoid ambiguity with the matrix exponential `expm`, this function\n * does not operate on matrices; if you wish to apply it elementwise, see\n * the examples.\n *\n * Syntax:\n *\n * math.expm1(x)\n *\n * Examples:\n *\n * math.expm1(2) // returns number 6.38905609893065\n * math.pow(math.e, 2) - 1 // returns number 6.3890560989306495\n * math.expm1(1e-8) // returns number 1.0000000050000001e-8\n * math.exp(1e-8) - 1 // returns number 9.9999999392253e-9\n * math.log(math.expm1(2) + 1) // returns number 2\n *\n * math.map([1, 2, 3], math.expm1)\n * // returns Array [\n * // 1.718281828459045,\n * // 6.3890560989306495,\n * // 19.085536923187668\n * // ]\n *\n * See also:\n *\n * exp, expm, log, pow\n *\n * @param {number | BigNumber | Complex} x The number to exponentiate\n * @return {number | BigNumber | Complex} Exponential of `x`, minus one\n */\n return typed(name, {\n number: expm1Number,\n Complex: function Complex(x) {\n var r = Math.exp(x.re);\n return new _Complex(r * Math.cos(x.im) - 1, r * Math.sin(x.im));\n },\n BigNumber: function BigNumber(x) {\n return x.exp().minus(1);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'fix';\nvar dependencies = ['typed', 'Complex', 'matrix', 'ceil', 'floor', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createFixNumber = /* #__PURE__ */factory(name, ['typed', 'ceil', 'floor'], _ref => {\n var {\n typed,\n ceil,\n floor\n } = _ref;\n return typed(name, {\n number: function number(x) {\n return x > 0 ? floor(x) : ceil(x);\n },\n 'number, number': function numberNumber(x, n) {\n return x > 0 ? floor(x, n) : ceil(x, n);\n }\n });\n});\nexport var createFix = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n Complex: _Complex,\n matrix,\n ceil,\n floor,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var fixNumber = createFixNumber({\n typed,\n ceil,\n floor\n });\n /**\n * Round a value towards zero.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.fix(x)\n * math.fix(x,n)\n *\n * Examples:\n *\n * math.fix(3.2) // returns number 3\n * math.fix(3.8) // returns number 3\n * math.fix(-4.2) // returns number -4\n * math.fix(-4.7) // returns number -4\n *\n * math.fix(3.12, 1) // returns number 3.1\n * math.fix(3.18, 1) // returns number 3.1\n * math.fix(-4.12, 1) // returns number -4.1\n * math.fix(-4.17, 1) // returns number -4.1\n *\n * const c = math.complex(3.22, -2.78)\n * math.fix(c) // returns Complex 3 - 2i\n * math.fix(c, 1) // returns Complex 3.2 -2.7i\n *\n * math.fix([3.2, 3.8, -4.7]) // returns Array [3, 3, -4]\n * math.fix([3.2, 3.8, -4.7], 1) // returns Array [3.2, 3.8, -4.7]\n *\n * See also:\n *\n * ceil, floor, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('fix', {\n number: fixNumber.signatures.number,\n 'number, number | BigNumber': fixNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return new _Complex(x.re > 0 ? Math.floor(x.re) : Math.ceil(x.re), x.im > 0 ? Math.floor(x.im) : Math.ceil(x.im));\n },\n 'Complex, number': function ComplexNumber(x, n) {\n return new _Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n));\n },\n 'Complex, BigNumber': function ComplexBigNumber(x, bn) {\n var n = bn.toNumber();\n return new _Complex(x.re > 0 ? floor(x.re, n) : ceil(x.re, n), x.im > 0 ? floor(x.im, n) : ceil(x.im, n));\n },\n BigNumber: function BigNumber(x) {\n return x.isNegative() ? ceil(x) : floor(x);\n },\n 'BigNumber, number | BigNumber': function BigNumberNumberBigNumber(x, n) {\n return x.isNegative() ? ceil(x, n) : floor(x, n);\n },\n Fraction: function Fraction(x) {\n return x.s < 0 ? x.ceil() : x.floor();\n },\n 'Fraction, number | BigNumber': function FractionNumberBigNumber(x, n) {\n return x.s < 0 ? ceil(x, n) : floor(x, n);\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since fix(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array | Matrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since fix(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import Decimal from 'decimal.js';\nimport { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'floor';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix'];\nexport var createFloorNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => {\n var {\n typed,\n config,\n round\n } = _ref;\n return typed(name, {\n number: function number(x) {\n if (nearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return Math.floor(x);\n }\n },\n 'number, number': function numberNumber(x, n) {\n if (nearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n var [number, exponent] = \"\".concat(x, \"e\").split('e');\n var result = Math.floor(Number(\"\".concat(number, \"e\").concat(Number(exponent) + n)));\n [number, exponent] = \"\".concat(result, \"e\").split('e');\n return Number(\"\".concat(number, \"e\").concat(Number(exponent) - n));\n }\n }\n });\n});\nexport var createFloor = /* #__PURE__ */factory(name, dependencies, _ref2 => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n } = _ref2;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var floorNumber = createFloorNumber({\n typed,\n config,\n round\n });\n /**\n * Round a value towards minus infinity.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.floor(x)\n * math.floor(x, n)\n *\n * Examples:\n *\n * math.floor(3.2) // returns number 3\n * math.floor(3.8) // returns number 3\n * math.floor(-4.2) // returns number -5\n * math.floor(-4.7) // returns number -5\n *\n * math.floor(3.212, 2) // returns number 3.21\n * math.floor(3.288, 2) // returns number 3.28\n * math.floor(-4.212, 2) // returns number -4.22\n * math.floor(-4.782, 2) // returns number -4.79\n *\n * const c = math.complex(3.24, -2.71)\n * math.floor(c) // returns Complex 3 - 3i\n * math.floor(c, 1) // returns Complex 3.2 -2.8i\n *\n * math.floor([3.2, 3.8, -4.7]) // returns Array [3, 3, -5]\n * math.floor([3.21, 3.82, -4.71], 1) // returns Array [3.2, 3.8, -4.8]\n *\n * math.floor(math.tau, [2, 3]) // returns Array [6.28, 6.283]\n *\n * // Note that floor(array, array) currently not implemented.\n *\n * See also:\n *\n * ceil, fix, round\n *\n * @param {number | BigNumber | Fraction | Complex | Array | Matrix} x Number to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed('floor', {\n number: floorNumber.signatures.number,\n 'number,number': floorNumber.signatures['number,number'],\n Complex: function Complex(x) {\n return x.floor();\n },\n 'Complex, number': function ComplexNumber(x, n) {\n return x.floor(n);\n },\n 'Complex, BigNumber': function ComplexBigNumber(x, n) {\n return x.floor(n.toNumber());\n },\n BigNumber: function BigNumber(x) {\n if (bigNearlyEqual(x, round(x), config.relTol, config.absTol)) {\n return round(x);\n } else {\n return x.floor();\n }\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, n) {\n if (bigNearlyEqual(x, round(x, n), config.relTol, config.absTol)) {\n return round(x, n);\n } else {\n return x.toDecimalPlaces(n.toNumber(), Decimal.ROUND_FLOOR);\n }\n },\n Fraction: function Fraction(x) {\n return x.floor();\n },\n 'Fraction, number': function FractionNumber(x, n) {\n return x.floor(n);\n },\n 'Fraction, BigNumber': function FractionBigNumber(x, n) {\n return x.floor(n.toNumber());\n },\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since floor(0) = 0\n return deepMap(x, self, true);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, i => self(i, n), true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | Complex | Fraction | BigNumber, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n }),\n 'number | Complex | Fraction | BigNumber, Matrix': typed.referToSelf(self => (x, y) => {\n if (equalScalar(x, 0)) return zeros(y.size(), y.storage());\n if (y.storage() === 'dense') {\n return matAlgo14xDs(y, x, self, true);\n }\n return matAlgo12xSfs(y, x, self, true);\n })\n });\n});", "import { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMod } from './mod.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nvar name = 'gcd';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix', 'concat'];\nvar gcdTypes = 'number | BigNumber | Fraction | Matrix | Array';\nvar gcdManyTypesSignature = \"\".concat(gcdTypes, \", \").concat(gcdTypes, \", ...\").concat(gcdTypes);\nfunction is1d(array) {\n return !array.some(element => Array.isArray(element));\n}\nexport var createGcd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n config,\n round,\n equalScalar,\n zeros,\n BigNumber,\n DenseMatrix,\n concat\n } = _ref;\n var mod = createMod({\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n });\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the greatest common divisor for two or more values or arrays.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.gcd(a, b)\n * math.gcd(a, b, c, ...)\n *\n * Examples:\n *\n * math.gcd(8, 12) // returns 4\n * math.gcd(-4, 6) // returns 2\n * math.gcd(25, 15, -10) // returns 5\n *\n * math.gcd([8, -4], [12, 6]) // returns [4, 2]\n *\n * See also:\n *\n * lcm, xgcd\n *\n * @param {... number | BigNumber | Fraction | Array | Matrix} args Two or more integer numbers\n * @return {number | BigNumber | Fraction | Array | Matrix} The greatest common divisor\n */\n return typed(name, {\n 'number, number': _gcdNumber,\n 'BigNumber, BigNumber': _gcdBigNumber,\n 'Fraction, Fraction': (x, y) => x.gcd(y)\n }, matrixAlgorithmSuite({\n SS: matAlgo04xSidSid,\n DS: matAlgo01xDSid,\n Ss: matAlgo10xSids\n }), {\n [gcdManyTypesSignature]: typed.referToSelf(self => (a, b, args) => {\n var res = self(a, b);\n for (var i = 0; i < args.length; i++) {\n res = self(res, args[i]);\n }\n return res;\n }),\n Array: typed.referToSelf(self => array => {\n if (array.length === 1 && Array.isArray(array[0]) && is1d(array[0])) {\n return self(...array[0]);\n }\n if (is1d(array)) {\n return self(...array);\n }\n throw new ArgumentsError('gcd() supports only 1d matrices!');\n }),\n Matrix: typed.referToSelf(self => matrix => {\n return self(matrix.toArray());\n })\n });\n\n /**\n * Calculate gcd for numbers\n * @param {number} a\n * @param {number} b\n * @returns {number} Returns the greatest common denominator of a and b\n * @private\n */\n function _gcdNumber(a, b) {\n if (!isInteger(a) || !isInteger(b)) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var r;\n while (b !== 0) {\n r = mod(a, b);\n a = b;\n b = r;\n }\n return a < 0 ? -a : a;\n }\n\n /**\n * Calculate gcd for BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @returns {BigNumber} Returns greatest common denominator of a and b\n * @private\n */\n function _gcdBigNumber(a, b) {\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function gcd must be integer numbers');\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n var zero = new BigNumber(0);\n while (!b.isZero()) {\n var r = mod(a, b);\n a = b;\n b = r;\n }\n return a.lt(zero) ? a.neg() : a;\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { createFloor } from './floor.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'mod';\nvar dependencies = ['typed', 'config', 'round', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createMod = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var floor = createFloor({\n typed,\n config,\n round,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculates the modulus, the remainder of an integer division.\n *\n * For matrices, the function is evaluated element wise.\n *\n * The modulus is defined as:\n *\n * x - y * floor(x / y)\n *\n * See https://en.wikipedia.org/wiki/Modulo_operation.\n *\n * Syntax:\n *\n * math.mod(x, y)\n *\n * Examples:\n *\n * math.mod(8, 3) // returns 2\n * math.mod(11, 2) // returns 1\n *\n * function isOdd(x) {\n * return math.mod(x, 2) != 0\n * }\n *\n * isOdd(2) // returns false\n * isOdd(3) // returns true\n *\n * See also:\n *\n * divide\n *\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} x Dividend\n * @param {number | BigNumber | bigint | Fraction | Array | Matrix} y Divisor\n * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the remainder of `x` divided by `y`.\n */\n return typed(name, {\n 'number, number': _modNumber,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return y.isZero() ? x : x.sub(y.mul(floor(x.div(y))));\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n if (y === 0n) {\n return x;\n }\n if (x < 0) {\n var m = x % y;\n return m === 0n ? m : m + y;\n }\n return x % y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return y.equals(0) ? x : x.sub(y.mul(floor(x.div(y))));\n }\n }, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n\n /**\n * Calculate the modulus of two numbers\n * @param {number} x\n * @param {number} y\n * @returns {number} res\n * @private\n */\n function _modNumber(x, y) {\n // We don't use JavaScript's % operator here as this doesn't work\n // correctly for x < 0 and x === 0\n // see https://en.wikipedia.org/wiki/Modulo_operation\n\n // We use mathjs floor to handle errors associated with\n // precision float approximation\n return y === 0 ? x : x - y * floor(x / y);\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo02xDS0';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo02xDS0 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij).\n * Callback function invoked NNZ times (number of nonzero items in SparseMatrix).\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (S)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function matAlgo02xDS0(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result (SparseMatrix)\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // loop columns in b\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = bindex[k];\n // update C(i,j)\n var cij = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n // check for nonzero\n if (!eq(cij, zero)) {\n // push i & v\n cindex.push(i);\n cvalues.push(cij);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return sparseMatrix.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo03xDSf';\nvar dependencies = ['typed'];\nexport var createMatAlgo03xDSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over SparseMatrix items and invokes the callback function f(Dij, Sij).\n * Callback function invoked M*N times.\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 f(Dij, 0) ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (C)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function matAlgo03xDSf(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result (DenseMatrix)\n var cdata = [];\n\n // initialize dense matrix\n for (var z = 0; z < rows; z++) {\n // initialize row\n cdata[z] = [];\n }\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns in b\n for (var j = 0; j < columns; j++) {\n // column mark\n var mark = j + 1;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n var i = bindex[k];\n // update workspace\n x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n w[i] = mark;\n }\n // process workspace\n for (var y = 0; y < rows; y++) {\n // check we have a calculated value for current row\n if (w[y] === mark) {\n // use calculated value\n cdata[y][j] = x[y];\n } else {\n // calculate value\n cdata[y][j] = inverse ? cf(zero, adata[y][j]) : cf(adata[y][j], zero);\n }\n }\n }\n\n // return dense matrix\n return denseMatrix.createDenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo05xSfSf';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo05xSfSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 || B(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo05xSfSf(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var xa = cvalues ? [] : undefined;\n var xb = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // vars\n var i, j, k, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop values A(:,j)\n for (k = aptr[j], k1 = aptr[j + 1]; k < k1; k++) {\n // row\n i = aindex[k];\n // push index\n cindex.push(i);\n // update workspace\n wa[i] = mark;\n // check we need to process values\n if (xa) {\n xa[i] = avalues[k];\n }\n }\n // loop values B(:,j)\n for (k = bptr[j], k1 = bptr[j + 1]; k < k1; k++) {\n // row\n i = bindex[k];\n // check row existed in A\n if (wa[i] !== mark) {\n // push index\n cindex.push(i);\n }\n // update workspace\n wb[i] = mark;\n // check we need to process values\n if (xb) {\n xb[i] = bvalues[k];\n }\n }\n // check we need to process values (non pattern matrix)\n if (cvalues) {\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // marks\n var wai = wa[i];\n var wbi = wb[i];\n // check Aij or Bij are nonzero\n if (wai === mark || wbi === mark) {\n // matrix values @ i,j\n var va = wai === mark ? xa[i] : zero;\n var vb = wbi === mark ? xb[i] : zero;\n // Cij\n var vc = cf(va, vb);\n // check for zero\n if (!eq(vc, zero)) {\n // push value\n cvalues.push(vc);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { extend } from '../../../utils/object.js';\nimport { createMatAlgo13xDD } from './matAlgo13xDD.js';\nimport { createMatAlgo14xDs } from './matAlgo14xDs.js';\nimport { createBroadcast } from './broadcast.js';\nvar name = 'matrixAlgorithmSuite';\nvar dependencies = ['typed', 'matrix', 'concat'];\nexport var createMatrixAlgorithmSuite = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n concat\n } = _ref;\n var matAlgo13xDD = createMatAlgo13xDD({\n typed\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var broadcast = createBroadcast({\n concat\n });\n\n /**\n * Return a signatures object with the usual boilerplate of\n * matrix algorithms, based on a plain options object with the\n * following properties:\n * elop: function -- the elementwise operation to use, defaults to self\n * SS: function -- the algorithm to apply for two sparse matrices\n * DS: function -- the algorithm to apply for a dense and a sparse matrix\n * SD: function -- algo for a sparse and a dense; defaults to SD flipped\n * Ss: function -- the algorithm to apply for a sparse matrix and scalar\n * sS: function -- algo for scalar and sparse; defaults to Ss flipped\n * scalar: string -- typed-function type for scalars, defaults to 'any'\n *\n * If Ss is not specified, no matrix-scalar signatures are generated.\n *\n * @param {object} options\n * @return {Object} signatures\n */\n return function matrixAlgorithmSuite(options) {\n var elop = options.elop;\n var SD = options.SD || options.DS;\n var matrixSignatures;\n if (elop) {\n // First the dense ones\n matrixSignatures = {\n 'DenseMatrix, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(x, y), elop),\n 'Array, Array': (x, y) => matAlgo13xDD(...broadcast(matrix(x), matrix(y)), elop).valueOf(),\n 'Array, DenseMatrix': (x, y) => matAlgo13xDD(...broadcast(matrix(x), y), elop),\n 'DenseMatrix, Array': (x, y) => matAlgo13xDD(...broadcast(x, matrix(y)), elop)\n };\n // Now incorporate sparse matrices\n if (options.SS) {\n matrixSignatures['SparseMatrix, SparseMatrix'] = (x, y) => options.SS(...broadcast(x, y), elop, false);\n }\n if (options.DS) {\n matrixSignatures['DenseMatrix, SparseMatrix'] = (x, y) => options.DS(...broadcast(x, y), elop, false);\n matrixSignatures['Array, SparseMatrix'] = (x, y) => options.DS(...broadcast(matrix(x), y), elop, false);\n }\n if (SD) {\n matrixSignatures['SparseMatrix, DenseMatrix'] = (x, y) => SD(...broadcast(y, x), elop, true);\n matrixSignatures['SparseMatrix, Array'] = (x, y) => SD(...broadcast(matrix(y), x), elop, true);\n }\n } else {\n // No elop, use this\n // First the dense ones\n matrixSignatures = {\n 'DenseMatrix, DenseMatrix': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(x, y), self);\n }),\n 'Array, Array': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(matrix(x), matrix(y)), self).valueOf();\n }),\n 'Array, DenseMatrix': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(matrix(x), y), self);\n }),\n 'DenseMatrix, Array': typed.referToSelf(self => (x, y) => {\n return matAlgo13xDD(...broadcast(x, matrix(y)), self);\n })\n };\n // Now incorporate sparse matrices\n if (options.SS) {\n matrixSignatures['SparseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.SS(...broadcast(x, y), self, false);\n });\n }\n if (options.DS) {\n matrixSignatures['DenseMatrix, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.DS(...broadcast(x, y), self, false);\n });\n matrixSignatures['Array, SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return options.DS(...broadcast(matrix(x), y), self, false);\n });\n }\n if (SD) {\n matrixSignatures['SparseMatrix, DenseMatrix'] = typed.referToSelf(self => (x, y) => {\n return SD(...broadcast(y, x), self, true);\n });\n matrixSignatures['SparseMatrix, Array'] = typed.referToSelf(self => (x, y) => {\n return SD(...broadcast(matrix(y), x), self, true);\n });\n }\n }\n\n // Now add the scalars\n var scalar = options.scalar || 'any';\n var Ds = options.Ds || options.Ss;\n if (Ds) {\n if (elop) {\n matrixSignatures['DenseMatrix,' + scalar] = (x, y) => matAlgo14xDs(x, y, elop, false);\n matrixSignatures[scalar + ', DenseMatrix'] = (x, y) => matAlgo14xDs(y, x, elop, true);\n matrixSignatures['Array,' + scalar] = (x, y) => matAlgo14xDs(matrix(x), y, elop, false).valueOf();\n matrixSignatures[scalar + ', Array'] = (x, y) => matAlgo14xDs(matrix(y), x, elop, true).valueOf();\n } else {\n matrixSignatures['DenseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(x, y, self, false);\n });\n matrixSignatures[scalar + ', DenseMatrix'] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(y, x, self, true);\n });\n matrixSignatures['Array,' + scalar] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(matrix(x), y, self, false).valueOf();\n });\n matrixSignatures[scalar + ', Array'] = typed.referToSelf(self => (x, y) => {\n return matAlgo14xDs(matrix(y), x, self, true).valueOf();\n });\n }\n }\n var sS = options.sS !== undefined ? options.sS : options.Ss;\n if (elop) {\n if (options.Ss) {\n matrixSignatures['SparseMatrix,' + scalar] = (x, y) => options.Ss(x, y, elop, false);\n }\n if (sS) {\n matrixSignatures[scalar + ', SparseMatrix'] = (x, y) => sS(y, x, elop, true);\n }\n } else {\n if (options.Ss) {\n matrixSignatures['SparseMatrix,' + scalar] = typed.referToSelf(self => (x, y) => {\n return options.Ss(x, y, self, false);\n });\n }\n if (sS) {\n matrixSignatures[scalar + ', SparseMatrix'] = typed.referToSelf(self => (x, y) => {\n return sS(y, x, self, true);\n });\n }\n }\n // Also pull in the scalar signatures if the operator is a typed function\n if (elop && elop.signatures) {\n extend(matrixSignatures, elop.signatures);\n }\n return matrixSignatures;\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo13xDD';\nvar dependencies = ['typed'];\nexport var createMatAlgo13xDD = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over DenseMatrix items and invokes the callback function f(Aij..z, Bij..z).\n * Callback function invoked MxN times.\n *\n * C(i,j,...z) = f(Aij..z, Bij..z)\n *\n * @param {Matrix} a The DenseMatrix instance (A)\n * @param {Matrix} b The DenseMatrix instance (B)\n * @param {Function} callback The f(Aij..z,Bij..z) operation to invoke\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97658658\n */\n return function matAlgo13xDD(a, b, callback) {\n // a arrays\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype;\n // b arrays\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype;\n // c arrays\n var csize = [];\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // validate each one of the dimension sizes\n for (var s = 0; s < asize.length; s++) {\n // must match\n if (asize[s] !== bsize[s]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n // update dimension in c\n csize[s] = asize[s];\n }\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt) {\n // datatype\n dt = adt;\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // populate cdata, iterate through dimensions\n var cdata = csize.length > 0 ? _iterate(cf, 0, csize, csize[0], adata, bdata) : [];\n\n // c matrix\n return a.createDenseMatrix({\n data: cdata,\n size: csize,\n datatype: dt\n });\n };\n\n // recursive function\n function _iterate(f, level, s, n, av, bv) {\n // initialize array for this level\n var cv = [];\n // check we reach the last level\n if (level === s.length - 1) {\n // loop arrays in last level\n for (var i = 0; i < n; i++) {\n // invoke callback and store value\n cv[i] = f(av[i], bv[i]);\n }\n } else {\n // iterate current level\n for (var j = 0; j < n; j++) {\n // iterate next level\n cv[j] = _iterate(f, level + 1, s, s[level + 1], av[j], bv[j]);\n }\n }\n return cv;\n }\n});", "import { checkBroadcastingRules } from '../../../utils/array.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'broadcast';\nvar dependancies = ['concat'];\nexport var createBroadcast = /* #__PURE__ */factory(name, dependancies, _ref => {\n var {\n concat\n } = _ref;\n /**\n * Broadcasts two matrices, and return both in an array\n * It checks if it's possible with broadcasting rules\n *\n * @param {Matrix} A First Matrix\n * @param {Matrix} B Second Matrix\n *\n * @return {Matrix[]} [ broadcastedA, broadcastedB ]\n */\n return function (A, B) {\n var N = Math.max(A._size.length, B._size.length); // max number of dims\n if (A._size.length === B._size.length) {\n if (A._size.every((dim, i) => dim === B._size[i])) {\n // If matrices have the same size return them\n return [A, B];\n }\n }\n var sizeA = _padLeft(A._size, N, 0); // pad to the left to align dimensions to the right\n var sizeB = _padLeft(B._size, N, 0); // pad to the left to align dimensions to the right\n\n // calculate the max dimensions\n var sizeMax = [];\n for (var dim = 0; dim < N; dim++) {\n sizeMax[dim] = Math.max(sizeA[dim], sizeB[dim]);\n }\n\n // check if the broadcasting rules applyes for both matrices\n checkBroadcastingRules(sizeA, sizeMax);\n checkBroadcastingRules(sizeB, sizeMax);\n\n // reshape A or B if needed to make them ready for concat\n var AA = A.clone();\n var BB = B.clone();\n if (AA._size.length < N) {\n AA.reshape(_padLeft(AA._size, N, 1));\n } else if (BB._size.length < N) {\n BB.reshape(_padLeft(BB._size, N, 1));\n }\n\n // stretches the matrices on each dimension to make them the same size\n for (var _dim = 0; _dim < N; _dim++) {\n if (AA._size[_dim] < sizeMax[_dim]) {\n AA = _stretch(AA, sizeMax[_dim], _dim);\n }\n if (BB._size[_dim] < sizeMax[_dim]) {\n BB = _stretch(BB, sizeMax[_dim], _dim);\n }\n }\n\n // return the array with the two broadcasted matrices\n return [AA, BB];\n };\n function _padLeft(shape, N, filler) {\n // pads an array of dimensions with numbers to the left, unitl the number of dimensions is N\n return [...Array(N - shape.length).fill(filler), ...shape];\n }\n function _stretch(arrayToStretch, sizeToStretch, dimToStretch) {\n // stretches a matrix up to a certain size in a certain dimension\n return concat(...Array(sizeToStretch).fill(arrayToStretch), dimToStretch);\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo01xDSid';\nvar dependencies = ['typed'];\nexport var createMatAlgo01xDSid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterates over SparseMatrix nonzero items and invokes the callback function f(Dij, Sij).\n * Callback function invoked NNZ times (number of nonzero items in SparseMatrix).\n *\n *\n * \u250C f(Dij, Sij) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 Dij ; otherwise\n *\n *\n * @param {Matrix} denseMatrix The DenseMatrix instance (D)\n * @param {Matrix} sparseMatrix The SparseMatrix instance (S)\n * @param {Function} callback The f(Dij,Sij) operation to invoke, where Dij = DenseMatrix(i,j) and Sij = SparseMatrix(i,j)\n * @param {boolean} inverse A true value indicates callback should be invoked f(Sij,Dij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97477571\n */\n return function algorithm1(denseMatrix, sparseMatrix, callback, inverse) {\n // dense matrix arrays\n var adata = denseMatrix._data;\n var asize = denseMatrix._size;\n var adt = denseMatrix._datatype || denseMatrix.getDataType();\n // sparse matrix arrays\n var bvalues = sparseMatrix._values;\n var bindex = sparseMatrix._index;\n var bptr = sparseMatrix._ptr;\n var bsize = sparseMatrix._size;\n var bdt = sparseMatrix._datatype || sparseMatrix._data === undefined ? sparseMatrix._datatype : sparseMatrix.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!bvalues) {\n throw new Error('Cannot perform operation on Dense Matrix and Pattern Sparse Matrix');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // process data types\n var dt = typeof adt === 'string' && adt !== 'mixed' && adt === bdt ? adt : undefined;\n // callback function\n var cf = dt ? typed.find(callback, [dt, dt]) : callback;\n\n // vars\n var i, j;\n\n // result (DenseMatrix)\n var cdata = [];\n // initialize c\n for (i = 0; i < rows; i++) {\n cdata[i] = [];\n }\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns in b\n for (j = 0; j < columns; j++) {\n // column mark\n var mark = j + 1;\n // values in column j\n for (var k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // update workspace\n x[i] = inverse ? cf(bvalues[k], adata[i][j]) : cf(adata[i][j], bvalues[k]);\n // mark i as updated\n w[i] = mark;\n }\n // loop rows\n for (i = 0; i < rows; i++) {\n // check row is in workspace\n if (w[i] === mark) {\n // c[i][j] was already calculated\n cdata[i][j] = x[i];\n } else {\n // item does not exist in S\n cdata[i][j] = adata[i][j];\n }\n }\n }\n\n // return dense matrix\n return denseMatrix.createDenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === denseMatrix._datatype && bdt === sparseMatrix._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo04xSidSid';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo04xSidSid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524 A(i,j) ; A(i,j) !== 0 && B(i,j) === 0\n * \u2514 B(i,j) ; A(i,j) === 0\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo04xSidSid(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspace\n var xa = avalues && bvalues ? [] : undefined;\n var xb = avalues && bvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // vars\n var i, j, k, k0, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop A(:,j)\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // update c\n cindex.push(i);\n // update workspace\n wa[i] = mark;\n // check we need to process values\n if (xa) {\n xa[i] = avalues[k];\n }\n }\n // loop B(:,j)\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // check row exists in A\n if (wa[i] === mark) {\n // update record in xa @ i\n if (xa) {\n // invoke callback\n var v = cf(xa[i], bvalues[k]);\n // check for zero\n if (!eq(v, zero)) {\n // update workspace\n xa[i] = v;\n } else {\n // remove mark (index will be removed later)\n wa[i] = null;\n }\n }\n } else {\n // update c\n cindex.push(i);\n // update workspace\n wb[i] = mark;\n // check we need to process values\n if (xb) {\n xb[i] = bvalues[k];\n }\n }\n }\n // check we need to process values (non pattern matrix)\n if (xa && xb) {\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // check workspace has value @ i\n if (wa[i] === mark) {\n // push value (Aij != 0 || (Aij != 0 && Bij != 0))\n cvalues[k] = xa[i];\n // increment pointer\n k++;\n } else if (wb[i] === mark) {\n // push value (bij != 0)\n cvalues[k] = xb[i];\n // increment pointer\n k++;\n } else {\n // remove index @ k\n cindex.splice(k, 1);\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'matAlgo10xSids';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo10xSids = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n * Callback function invoked NZ times (number of nonzero items in S).\n *\n *\n * \u250C f(Sij, b) ; S(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 b ; otherwise\n *\n *\n * @param {Matrix} s The SparseMatrix instance (S)\n * @param {Scalar} b The Scalar value\n * @param {Function} callback The f(Aij,b) operation to invoke\n * @param {boolean} inverse A true value indicates callback should be invoked f(b,Sij)\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n */\n return function matAlgo10xSids(s, b, callback, inverse) {\n // sparse matrix arrays\n var avalues = s._values;\n var aindex = s._index;\n var aptr = s._ptr;\n var asize = s._size;\n var adt = s._datatype;\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string') {\n // datatype\n dt = adt;\n // convert b to the same datatype\n b = typed.convert(b, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cdata = [];\n\n // workspaces\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // values in j\n for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n var r = aindex[k];\n // update workspace\n x[r] = avalues[k];\n w[r] = mark;\n }\n // loop rows\n for (var i = 0; i < rows; i++) {\n // initialize C on first column\n if (j === 0) {\n // create row array\n cdata[i] = [];\n }\n // check sparse matrix has a value @ i,j\n if (w[i] === mark) {\n // invoke callback, update C\n cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b);\n } else {\n // dense matrix value @ i, j\n cdata[i][j] = b;\n }\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: dt\n });\n };\n});", "/**\n * Create a syntax error with the message:\n * 'Wrong number of arguments in function ( provided, - expected)'\n * @param {string} fn Function name\n * @param {number} count Actual argument count\n * @param {number} min Minimum required argument count\n * @param {number} [max] Maximum required argument count\n * @extends Error\n */\nexport function ArgumentsError(fn, count, min, max) {\n if (!(this instanceof ArgumentsError)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this.fn = fn;\n this.count = count;\n this.min = min;\n this.max = max;\n this.message = 'Wrong number of arguments in function ' + fn + ' (' + count + ' provided, ' + min + (max !== undefined && max !== null ? '-' + max : '') + ' expected)';\n this.stack = new Error().stack;\n}\nArgumentsError.prototype = new Error();\nArgumentsError.prototype.constructor = Error;\nArgumentsError.prototype.name = 'ArgumentsError';\nArgumentsError.prototype.isArgumentsError = true;", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { lcmNumber } from '../../plain/number/index.js';\nvar name = 'lcm';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'concat'];\nexport var createLcm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var lcmTypes = 'number | BigNumber | Fraction | Matrix | Array';\n var lcmManySignature = {};\n lcmManySignature[\"\".concat(lcmTypes, \", \").concat(lcmTypes, \", ...\").concat(lcmTypes)] = typed.referToSelf(self => (a, b, args) => {\n var res = self(a, b);\n for (var i = 0; i < args.length; i++) {\n res = self(res, args[i]);\n }\n return res;\n });\n\n /**\n * Calculate the least common multiple for two or more values or arrays.\n *\n * lcm is defined as:\n *\n * lcm(a, b) = abs(a * b) / gcd(a, b)\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.lcm(a, b)\n * math.lcm(a, b, c, ...)\n *\n * Examples:\n *\n * math.lcm(4, 6) // returns 12\n * math.lcm(6, 21) // returns 42\n * math.lcm(6, 21, 5) // returns 210\n *\n * math.lcm([4, 6], [6, 21]) // returns [12, 42]\n *\n * See also:\n *\n * gcd, xgcd\n *\n * @param {... number | BigNumber | Array | Matrix} args Two or more integer numbers\n * @return {number | BigNumber | Array | Matrix} The least common multiple\n */\n return typed(name, {\n 'number, number': lcmNumber,\n 'BigNumber, BigNumber': _lcmBigNumber,\n 'Fraction, Fraction': (x, y) => x.lcm(y)\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }), lcmManySignature);\n\n /**\n * Calculate lcm for two BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @returns {BigNumber} Returns the least common multiple of a and b\n * @private\n */\n function _lcmBigNumber(a, b) {\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function lcm must be integer numbers');\n }\n if (a.isZero()) {\n return a;\n }\n if (b.isZero()) {\n return b;\n }\n\n // https://en.wikipedia.org/wiki/Euclidean_algorithm\n // evaluate lcm here inline to reduce overhead\n var prod = a.times(b);\n while (!b.isZero()) {\n var t = b;\n b = a.mod(t);\n a = t;\n }\n return prod.div(a).abs();\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nimport { scatter } from '../../../utils/collection.js';\nvar name = 'matAlgo06xS0S0';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo06xS0S0 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked (Anz U Bnz) times, where Anz and Bnz are the nonzero elements in both matrices.\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo06xS0S0(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var x = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var w = [];\n // marks indicating value in a given row has been updated\n var u = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // scatter the values of A(:,j) into workspace\n scatter(a, j, w, x, u, mark, cindex, cf);\n // scatter the values of B(:,j) into workspace\n scatter(b, j, w, x, u, mark, cindex, cf);\n // check we need to process values (non pattern matrix)\n if (x) {\n // initialize first index in j\n var k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n var i = cindex[k];\n // check function was invoked on current row (Aij !=0 && Bij != 0)\n if (u[i] === mark) {\n // value @ i\n var v = x[i];\n // check for zero value\n if (!eq(v, zero)) {\n // push value\n cvalues.push(v);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n } else {\n // initialize first index in j\n var p = cptr[j];\n // loop index in j\n while (p < cindex.length) {\n // row\n var r = cindex[p];\n // check function was invoked on current row (Aij !=0 && Bij != 0)\n if (u[r] !== mark) {\n // remove value @ i, do not increment pointer\n cindex.splice(p, 1);\n } else {\n // increment pointer\n p++;\n }\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log10Number } from '../../plain/number/index.js';\nvar name = 'log10';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createLog10 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex: _Complex\n } = _ref;\n /**\n * Calculate the 10-base logarithm of a value. This is the same as calculating `log(x, 10)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log10(x)\n *\n * Examples:\n *\n * math.log10(0.00001) // returns -5\n * math.log10(10000) // returns 4\n * math.log(10000) / math.log(10) // returns 4\n * math.pow(10, 4) // returns 10000\n *\n * See also:\n *\n * exp, log, log1p, log2\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the 10-base logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return log10Number(x);\n } else {\n // negative value -> complex value computation\n return new _Complex(x, 0).log().div(Math.LN10);\n }\n },\n Complex: function Complex(x) {\n return new _Complex(x).log().div(Math.LN10);\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.log();\n } else {\n // downgrade to number, return Complex valued result\n return new _Complex(x.toNumber(), 0).log().div(Math.LN10);\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log2Number } from '../../plain/number/index.js';\nvar name = 'log2';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createLog2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log2(x)\n *\n * Examples:\n *\n * math.log2(0.03125) // returns -5\n * math.log2(16) // returns 4\n * math.log2(16) / math.log2(2) // returns 4\n * math.pow(2, 4) // returns 16\n *\n * See also:\n *\n * exp, log, log1p, log10\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the 2-base logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return log2Number(x);\n } else {\n // negative value -> complex value computation\n return _log2Complex(new Complex(x, 0));\n }\n },\n Complex: _log2Complex,\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.log(2);\n } else {\n // downgrade to number, return Complex valued result\n return _log2Complex(new Complex(x.toNumber(), 0));\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n\n /**\n * Calculate log2 for a complex value\n * @param {Complex} x\n * @returns {Complex}\n * @private\n */\n function _log2Complex(x) {\n var newX = Math.sqrt(x.re * x.re + x.im * x.im);\n return new Complex(Math.log2 ? Math.log2(newX) : Math.log(newX) / Math.LN2, Math.atan2(x.im, x.re) / Math.LN2);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { multiplyNumber } from '../../plain/number/index.js';\nvar name = 'multiplyScalar';\nvar dependencies = ['typed'];\nexport var createMultiplyScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Multiply two scalar values, `x * y`.\n * This function is meant for internal use: it is used by the public function\n * `multiply`\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x First value to multiply\n * @param {number | BigNumber | bigint | Fraction | Complex} y Second value to multiply\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Multiplication of `x` and `y`\n * @private\n */\n return typed('multiplyScalar', {\n 'number, number': multiplyNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.mul(y);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.times(y);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x * y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return x.mul(y);\n },\n 'number | Fraction | BigNumber | Complex, Unit': (x, y) => y.multiply(x),\n 'Unit, number | Fraction | BigNumber | Complex | Unit': (x, y) => x.multiply(y)\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'multiply';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'equalScalar', 'dot'];\nexport var createMultiply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n multiplyScalar,\n equalScalar,\n dot\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n function _validateMatrixDimensions(size1, size2) {\n // check left operand dimensions\n switch (size1.length) {\n case 1:\n // check size2\n switch (size2.length) {\n case 1:\n // Vector x Vector\n if (size1[0] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Vectors must have the same length');\n }\n break;\n case 2:\n // Vector x Matrix\n if (size1[0] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Vector length (' + size1[0] + ') must match Matrix rows (' + size2[0] + ')');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)');\n }\n break;\n case 2:\n // check size2\n switch (size2.length) {\n case 1:\n // Matrix x Vector\n if (size1[1] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Matrix columns (' + size1[1] + ') must match Vector length (' + size2[0] + ')');\n }\n break;\n case 2:\n // Matrix x Matrix\n if (size1[1] !== size2[0]) {\n // throw error\n throw new RangeError('Dimension mismatch in multiplication. Matrix A columns (' + size1[1] + ') must match Matrix B rows (' + size2[0] + ')');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix B has ' + size2.length + ' dimensions)');\n }\n break;\n default:\n throw new Error('Can only multiply a 1 or 2 dimensional matrix (Matrix A has ' + size1.length + ' dimensions)');\n }\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (N)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {number} Scalar value\n */\n function _multiplyVectorVector(a, b, n) {\n // check empty vector\n if (n === 0) {\n throw new Error('Cannot multiply two empty vectors');\n }\n return dot(a, b);\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (M)\n * @param {Matrix} b Matrix (MxN)\n *\n * @return {Matrix} Dense Vector (N)\n */\n function _multiplyVectorMatrix(a, b) {\n // process storage\n if (b.storage() !== 'dense') {\n throw new Error('Support for SparseMatrix not implemented');\n }\n return _multiplyVectorDenseMatrix(a, b);\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Dense Vector (M)\n * @param {Matrix} b Dense Matrix (MxN)\n *\n * @return {Matrix} Dense Vector (N)\n */\n function _multiplyVectorDenseMatrix(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var alength = asize[0];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix columns\n for (var j = 0; j < bcolumns; j++) {\n // sum (do not initialize it with zero)\n var sum = mf(adata[0], bdata[0][j]);\n // loop vector\n for (var i = 1; i < alength; i++) {\n // multiply & accumulate\n sum = af(sum, mf(adata[i], bdata[i][j]));\n }\n c[j] = sum;\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Matrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} Dense Vector (M)\n */\n var _multiplyMatrixVector = typed('_multiplyMatrixVector', {\n 'DenseMatrix, any': _multiplyDenseMatrixVector,\n 'SparseMatrix, any': _multiplySparseMatrixVector\n });\n\n /**\n * C = A * B\n *\n * @param {Matrix} a Matrix (MxN)\n * @param {Matrix} b Matrix (NxC)\n *\n * @return {Matrix} Matrix (MxC)\n */\n var _multiplyMatrixMatrix = typed('_multiplyMatrixMatrix', {\n 'DenseMatrix, DenseMatrix': _multiplyDenseMatrixDenseMatrix,\n 'DenseMatrix, SparseMatrix': _multiplyDenseMatrixSparseMatrix,\n 'SparseMatrix, DenseMatrix': _multiplySparseMatrixDenseMatrix,\n 'SparseMatrix, SparseMatrix': _multiplySparseMatrixSparseMatrix\n });\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} Dense Vector (M)\n */\n function _multiplyDenseMatrixVector(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = asize[0];\n var acolumns = asize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix a rows\n for (var i = 0; i < arows; i++) {\n // current row\n var row = adata[i];\n // sum (do not initialize it with zero)\n var sum = mf(row[0], bdata[0]);\n // loop matrix a columns\n for (var j = 1; j < acolumns; j++) {\n // multiply & accumulate\n sum = af(sum, mf(row[j], bdata[j]));\n }\n c[i] = sum;\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [arows],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b DenseMatrix (NxC)\n *\n * @return {Matrix} DenseMatrix (MxC)\n */\n function _multiplyDenseMatrixDenseMatrix(a, b) {\n // getDataType()\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b dense\n var bdata = b._data;\n var bsize = b._size;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = asize[0];\n var acolumns = asize[1];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var c = [];\n\n // loop matrix a rows\n for (var i = 0; i < arows; i++) {\n // current row\n var row = adata[i];\n // initialize row array\n c[i] = [];\n // loop matrix b columns\n for (var j = 0; j < bcolumns; j++) {\n // sum (avoid initializing sum to zero)\n var sum = mf(row[0], bdata[0][j]);\n // loop matrix a columns\n for (var x = 1; x < acolumns; x++) {\n // multiply & accumulate\n sum = af(sum, mf(row[x], bdata[x][j]));\n }\n c[i][j] = sum;\n }\n }\n\n // return matrix\n return a.createDenseMatrix({\n data: c,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a DenseMatrix (MxN)\n * @param {Matrix} b SparseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplyDenseMatrixSparseMatrix(a, b) {\n // a dense\n var adata = a._data;\n var asize = a._size;\n var adt = a._datatype || a.getDataType();\n // b sparse\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n // validate b matrix\n if (!bvalues) {\n throw new Error('Cannot multiply Dense Matrix times Pattern only Matrix');\n }\n // rows & columns\n var arows = asize[0];\n var bcolumns = bsize[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = b.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // indeces in column jb\n var kb0 = bptr[jb];\n var kb1 = bptr[jb + 1];\n // do not process column jb if no data exists\n if (kb1 > kb0) {\n // last row mark processed\n var last = 0;\n // loop a rows\n for (var i = 0; i < arows; i++) {\n // column mark\n var mark = i + 1;\n // C[i, jb]\n var cij = void 0;\n // values in b column j\n for (var kb = kb0; kb < kb1; kb++) {\n // row\n var ib = bindex[kb];\n // check value has been initialized\n if (last !== mark) {\n // first value in column jb\n cij = mf(adata[i][ib], bvalues[kb]);\n // update mark\n last = mark;\n } else {\n // accumulate value\n cij = af(cij, mf(adata[i][ib], bvalues[kb]));\n }\n }\n // check column has been processed and value != 0\n if (last === mark && !eq(cij, zero)) {\n // push row & value\n cindex.push(i);\n cvalues.push(cij);\n }\n }\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b Dense Vector (N)\n *\n * @return {Matrix} SparseMatrix (M, 1)\n */\n function _multiplySparseMatrixVector(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // validate a matrix\n if (!avalues) {\n throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix');\n }\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = a._size[0];\n var brows = b._size[0];\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // workspace\n var x = [];\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n\n // update ptr\n cptr[0] = 0;\n // rows in b\n for (var ib = 0; ib < brows; ib++) {\n // b[ib]\n var vbi = bdata[ib];\n // check b[ib] != 0, avoid loops\n if (!eq(vbi, zero)) {\n // A values & index in ib column\n for (var ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // a row\n var ia = aindex[ka];\n // check value exists in current j\n if (!w[ia]) {\n // ia is new entry in j\n w[ia] = true;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(vbi, avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(vbi, avalues[ka]));\n }\n }\n }\n }\n // copy values from x to column jb of c\n for (var p1 = cindex.length, p = 0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n // update ptr\n cptr[1] = cindex.length;\n\n // matrix to return\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, 1],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b DenseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplySparseMatrixDenseMatrix(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // validate a matrix\n if (!avalues) {\n throw new Error('Cannot multiply Pattern only Matrix times Dense Matrix');\n }\n // b dense\n var bdata = b._data;\n var bdt = b._datatype || b.getDataType();\n // rows & columns\n var arows = a._size[0];\n var brows = b._size[0];\n var bcolumns = b._size[1];\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n // equalScalar signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n }\n\n // result\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // workspace\n var x = [];\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // mark in workspace for current column\n var mark = jb + 1;\n // rows in jb\n for (var ib = 0; ib < brows; ib++) {\n // b[ib, jb]\n var vbij = bdata[ib][jb];\n // check b[ib, jb] != 0, avoid loops\n if (!eq(vbij, zero)) {\n // A values & index in ib column\n for (var ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // a row\n var ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(vbij, avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(vbij, avalues[ka]));\n }\n }\n }\n }\n // copy values from x to column jb of c\n for (var p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * C = A * B\n *\n * @param {Matrix} a SparseMatrix (MxN)\n * @param {Matrix} b SparseMatrix (NxC)\n *\n * @return {Matrix} SparseMatrix (MxC)\n */\n function _multiplySparseMatrixSparseMatrix(a, b) {\n // a sparse\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // b sparse\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // rows & columns\n var arows = a._size[0];\n var bcolumns = b._size[1];\n // flag indicating both matrices (a & b) contain data\n var values = avalues && bvalues;\n\n // datatype\n var dt;\n // addScalar signature to use\n var af = addScalar;\n // multiplyScalar signature to use\n var mf = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signatures that matches (dt, dt)\n af = typed.find(addScalar, [dt, dt]);\n mf = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // result\n var cvalues = values ? [] : undefined;\n var cindex = [];\n var cptr = [];\n // c matrix\n var c = a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [arows, bcolumns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n\n // workspace\n var x = values ? [] : undefined;\n // vector with marks indicating a value x[i] exists in a given column\n var w = [];\n // variables\n var ka, ka0, ka1, kb, kb0, kb1, ia, ib;\n // loop b columns\n for (var jb = 0; jb < bcolumns; jb++) {\n // update ptr\n cptr[jb] = cindex.length;\n // mark in workspace for current column\n var mark = jb + 1;\n // B values & index in j\n for (kb0 = bptr[jb], kb1 = bptr[jb + 1], kb = kb0; kb < kb1; kb++) {\n // b row\n ib = bindex[kb];\n // check we need to process values\n if (values) {\n // loop values in a[:,ib]\n for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // row\n ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n // x(ia) = A\n x[ia] = mf(bvalues[kb], avalues[ka]);\n } else {\n // i exists in C already\n x[ia] = af(x[ia], mf(bvalues[kb], avalues[ka]));\n }\n }\n } else {\n // loop values in a[:,ib]\n for (ka0 = aptr[ib], ka1 = aptr[ib + 1], ka = ka0; ka < ka1; ka++) {\n // row\n ia = aindex[ka];\n // check value exists in current j\n if (w[ia] !== mark) {\n // ia is new entry in j\n w[ia] = mark;\n // add i to pattern of C\n cindex.push(ia);\n }\n }\n }\n }\n // check we need to process matrix values (pattern matrix)\n if (values) {\n // copy values from x to column jb of c\n for (var p0 = cptr[jb], p1 = cindex.length, p = p0; p < p1; p++) {\n // row\n var ic = cindex[p];\n // copy value\n cvalues[p] = x[ic];\n }\n }\n }\n // update ptr\n cptr[bcolumns] = cindex.length;\n\n // return sparse matrix\n return c;\n }\n\n /**\n * Multiply two or more values, `x * y`.\n * For matrices, the matrix product is calculated.\n *\n * Syntax:\n *\n * math.multiply(x, y)\n * math.multiply(x, y, z, ...)\n *\n * Examples:\n *\n * math.multiply(4, 5.2) // returns number 20.8\n * math.multiply(2, 3, 4) // returns number 24\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(4, 1)\n * math.multiply(a, b) // returns Complex 5 + 14i\n *\n * const c = [[1, 2], [4, 3]]\n * const d = [[1, 2, 3], [3, -4, 7]]\n * math.multiply(c, d) // returns Array [[7, -6, 17], [13, -4, 33]]\n *\n * const e = math.unit('2.1 km')\n * math.multiply(3, e) // returns Unit 6.3 km\n *\n * See also:\n *\n * divide, prod, cross, dot\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to multiply\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to multiply\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y`\n */\n return typed(name, multiplyScalar, {\n // we extend the signatures of multiplyScalar with signatures dealing with matrices\n\n 'Array, Array': typed.referTo('Matrix, Matrix', selfMM => (x, y) => {\n // check dimensions\n _validateMatrixDimensions(arraySize(x), arraySize(y));\n\n // use dense matrix implementation\n var m = selfMM(matrix(x), matrix(y));\n // return array or scalar\n return isMatrix(m) ? m.valueOf() : m;\n }),\n 'Matrix, Matrix': function MatrixMatrix(x, y) {\n // dimensions\n var xsize = x.size();\n var ysize = y.size();\n\n // check dimensions\n _validateMatrixDimensions(xsize, ysize);\n\n // process dimensions\n if (xsize.length === 1) {\n // process y dimensions\n if (ysize.length === 1) {\n // Vector * Vector\n return _multiplyVectorVector(x, y, xsize[0]);\n }\n // Vector * Matrix\n return _multiplyVectorMatrix(x, y);\n }\n // process y dimensions\n if (ysize.length === 1) {\n // Matrix * Vector\n return _multiplyMatrixVector(x, y);\n }\n // Matrix * Matrix\n return _multiplyMatrixMatrix(x, y);\n },\n 'Matrix, Array': typed.referTo('Matrix,Matrix', selfMM => (x, y) => selfMM(x, matrix(y))),\n 'Array, Matrix': typed.referToSelf(self => (x, y) => {\n // use Matrix * Matrix implementation\n return self(matrix(x, y.storage()), y);\n }),\n 'SparseMatrix, any': function SparseMatrixAny(x, y) {\n return matAlgo11xS0s(x, y, multiplyScalar, false);\n },\n 'DenseMatrix, any': function DenseMatrixAny(x, y) {\n return matAlgo14xDs(x, y, multiplyScalar, false);\n },\n 'any, SparseMatrix': function anySparseMatrix(x, y) {\n return matAlgo11xS0s(y, x, multiplyScalar, true);\n },\n 'any, DenseMatrix': function anyDenseMatrix(x, y) {\n return matAlgo14xDs(y, x, multiplyScalar, true);\n },\n 'Array, any': function ArrayAny(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), y, multiplyScalar, false).valueOf();\n },\n 'any, Array': function anyArray(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(y), x, multiplyScalar, true).valueOf();\n },\n 'any, any': multiplyScalar,\n 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => {\n var result = self(x, y);\n for (var i = 0; i < rest.length; i++) {\n result = self(result, rest[i]);\n }\n return result;\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { nthRootNumber } from '../../plain/number/index.js';\nvar name = 'nthRoot';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'concat'];\nexport var createNthRoot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n BigNumber: _BigNumber,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the nth root of a value.\n * The principal nth root of a positive real number A, is the positive real\n * solution of the equation\n *\n * x^root = A\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.nthRoot(a)\n * math.nthRoot(a, root)\n *\n * Examples:\n *\n * math.nthRoot(9, 2) // returns 3 (since 3^2 == 9)\n * math.sqrt(9) // returns 3 (since 3^2 == 9)\n * math.nthRoot(64, 3) // returns 4 (since 4^3 == 64)\n *\n * See also:\n *\n * sqrt, pow\n *\n * @param {number | BigNumber | Array | Matrix | Complex} a\n * Value for which to calculate the nth root\n * @param {number | BigNumber} [root=2] The root.\n * @return {number | Complex | Array | Matrix} Returns the nth root of `a`\n */\n function complexErr() {\n throw new Error('Complex number not supported in function nthRoot. Use nthRoots instead.');\n }\n return typed(name, {\n number: nthRootNumber,\n 'number, number': nthRootNumber,\n BigNumber: x => _bigNthRoot(x, new _BigNumber(2)),\n 'BigNumber, BigNumber': _bigNthRoot,\n Complex: complexErr,\n 'Complex, number': complexErr,\n Array: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(matrix(x), 2).valueOf()),\n DenseMatrix: typed.referTo('DenseMatrix,number', selfDn => x => selfDn(x, 2)),\n SparseMatrix: typed.referTo('SparseMatrix,number', selfSn => x => selfSn(x, 2)),\n 'SparseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // sparse + sparse\n return matAlgo06xS0S0(x, y, self);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n }),\n 'DenseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // dense + sparse\n return matAlgo01xDSid(x, y, self, false);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n }),\n 'Array, SparseMatrix': typed.referTo('DenseMatrix,SparseMatrix', selfDS => (x, y) => selfDS(matrix(x), y)),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // density must be one (no zeros in matrix)\n if (y.density() === 1) {\n // sparse - scalar\n return matAlgo11xS0s(y, x, self, true);\n } else {\n // throw exception\n throw new Error('Root must be non-zero');\n }\n })\n }, matrixAlgorithmSuite({\n scalar: 'number | BigNumber',\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: false\n }));\n\n /**\n * Calculate the nth root of a for BigNumbers, solve x^root == a\n * https://rosettacode.org/wiki/Nth_root#JavaScript\n * @param {BigNumber} a\n * @param {BigNumber} root\n * @private\n */\n function _bigNthRoot(a, root) {\n var precision = _BigNumber.precision;\n var Big = _BigNumber.clone({\n precision: precision + 2\n });\n var zero = new _BigNumber(0);\n var one = new Big(1);\n var inv = root.isNegative();\n if (inv) {\n root = root.neg();\n }\n if (root.isZero()) {\n throw new Error('Root must be non-zero');\n }\n if (a.isNegative() && !root.abs().mod(2).equals(1)) {\n throw new Error('Root must be odd when a is negative.');\n }\n\n // edge cases zero and infinity\n if (a.isZero()) {\n return inv ? new Big(Infinity) : 0;\n }\n if (!a.isFinite()) {\n return inv ? zero : a;\n }\n var x = a.abs().pow(one.div(root));\n // If a < 0, we require that root is an odd integer,\n // so (-1) ^ (1/root) = -1\n x = a.isNeg() ? x.neg() : x;\n return new _BigNumber((inv ? one.div(x) : x).toPrecision(precision));\n }\n});\nexport var createNthRootNumber = /* #__PURE__ */factory(name, ['typed'], _ref2 => {\n var {\n typed\n } = _ref2;\n return typed(name, {\n number: nthRootNumber,\n 'number, number': nthRootNumber\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { signNumber } from '../../plain/number/index.js';\nvar name = 'sign';\nvar dependencies = ['typed', 'BigNumber', 'Fraction', 'complex'];\nexport var createSign = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber,\n complex,\n Fraction: _Fraction\n } = _ref;\n /**\n * Compute the sign of a value. The sign of a value x is:\n *\n * - 1 when x > 0\n * - -1 when x < 0\n * - 0 when x == 0\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.sign(x)\n *\n * Examples:\n *\n * math.sign(3.5) // returns 1\n * math.sign(-4.2) // returns -1\n * math.sign(0) // returns 0\n *\n * math.sign([3, 5, -2, 0, 2]) // returns [1, 1, -1, 0, 1]\n *\n * See also:\n *\n * abs\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit} x\n * The number for which to determine the sign\n * @return {number | BigNumber | bigint | Fraction | Complex | Array | Matrix | Unit}\n * The sign of `x`\n */\n return typed(name, {\n number: signNumber,\n Complex: function Complex(x) {\n return x.im === 0 ? complex(signNumber(x.re)) : x.sign();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(x.cmp(0));\n },\n bigint: function bigint(x) {\n return x > 0n ? 1n : x < 0n ? -1n : 0n;\n },\n Fraction: function Fraction(x) {\n return new _Fraction(x.s, 1);\n },\n // deep map collection, skip zeros since sign(0) = 0\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self, true)),\n Unit: typed.referToSelf(self => x => {\n if (!x._isDerived() && x.units[0].unit.offset !== 0) {\n throw new TypeError('sign is ambiguous for units with offset');\n }\n return typed.find(self, x.valueType())(x.value);\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'sqrt';\nvar dependencies = ['config', 'typed', 'Complex'];\nexport var createSqrt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n Complex\n } = _ref;\n /**\n * Calculate the square root of a value.\n *\n * For matrices, if you want the matrix square root of a square matrix,\n * use the `sqrtm` function. If you wish to apply `sqrt` elementwise to\n * a matrix M, use `math.map(M, math.sqrt)`.\n *\n * Syntax:\n *\n * math.sqrt(x)\n *\n * Examples:\n *\n * math.sqrt(25) // returns 5\n * math.square(5) // returns 25\n * math.sqrt(-4) // returns Complex 2i\n *\n * See also:\n *\n * square, multiply, cube, cbrt, sqrtm\n *\n * @param {number | BigNumber | Complex | Unit} x\n * Value for which to calculate the square root.\n * @return {number | BigNumber | Complex | Unit}\n * Returns the square root of `x`\n */\n return typed('sqrt', {\n number: _sqrtNumber,\n Complex: function Complex(x) {\n return x.sqrt();\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.sqrt();\n } else {\n // negative value -> downgrade to number to do complex value computation\n return _sqrtNumber(x.toNumber());\n }\n },\n Unit: function Unit(x) {\n // Someday will work for complex units when they are implemented\n return x.pow(0.5);\n }\n });\n\n /**\n * Calculate sqrt for a number\n * @param {number} x\n * @returns {number | Complex} Returns the square root of x\n * @private\n */\n function _sqrtNumber(x) {\n if (isNaN(x)) {\n return NaN;\n } else if (x >= 0 || config.predictable) {\n return Math.sqrt(x);\n } else {\n return new Complex(x, 0).sqrt();\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { squareNumber } from '../../plain/number/index.js';\nvar name = 'square';\nvar dependencies = ['typed'];\nexport var createSquare = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the square of a value, `x * x`.\n * To avoid confusion with multiplying a square matrix by itself,\n * this function does not apply to matrices. If you wish to square\n * every element of a matrix, see the examples.\n *\n * Syntax:\n *\n * math.square(x)\n *\n * Examples:\n *\n * math.square(2) // returns number 4\n * math.square(3) // returns number 9\n * math.pow(3, 2) // returns number 9\n * math.multiply(3, 3) // returns number 9\n *\n * math.map([1, 2, 3, 4], math.square) // returns Array [1, 4, 9, 16]\n *\n * See also:\n *\n * multiply, cube, sqrt, pow\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x\n * Number for which to calculate the square\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit}\n * Squared value\n */\n return typed(name, {\n number: squareNumber,\n Complex: function Complex(x) {\n return x.mul(x);\n },\n BigNumber: function BigNumber(x) {\n return x.times(x);\n },\n bigint: function bigint(x) {\n return x * x;\n },\n Fraction: function Fraction(x) {\n return x.mul(x);\n },\n Unit: function Unit(x) {\n return x.pow(2);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'subtract';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'subtractScalar', 'unaryMinus', 'DenseMatrix', 'concat'];\nexport var createSubtract = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n subtractScalar,\n unaryMinus,\n DenseMatrix,\n concat\n } = _ref;\n // TODO: split function subtract in two: subtract and subtractScalar\n\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Subtract two values, `x - y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.subtract(x, y)\n *\n * Examples:\n *\n * math.subtract(5.3, 2) // returns number 3.3\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(4, 1)\n * math.subtract(a, b) // returns Complex -2 + 2i\n *\n * math.subtract([5, 7, 4], 4) // returns Array [1, 3, 0]\n *\n * const c = math.unit('2.1 km')\n * const d = math.unit('500m')\n * math.subtract(c, d) // returns Unit 1.6 km\n *\n * See also:\n *\n * add\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Initial value\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Value to subtract from `x`\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Subtraction of `x` and `y`\n */\n return typed(name, {\n 'any, any': subtractScalar\n }, matrixAlgorithmSuite({\n elop: subtractScalar,\n SS: matAlgo05xSfSf,\n DS: matAlgo01xDSid,\n SD: matAlgo03xDSf,\n Ss: matAlgo12xSfs,\n sS: matAlgo10xSids\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { xgcdNumber } from '../../plain/number/index.js';\nvar name = 'xgcd';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createXgcd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Calculate the extended greatest common divisor for two values.\n * See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm.\n *\n * Syntax:\n *\n * math.xgcd(a, b)\n *\n * Examples:\n *\n * math.xgcd(8, 12) // returns [4, -1, 1]\n * math.gcd(8, 12) // returns 4\n * math.xgcd(36163, 21199) // returns [1247, -7, 12]\n *\n * See also:\n *\n * gcd, lcm\n *\n * @param {number | BigNumber} a An integer number\n * @param {number | BigNumber} b An integer number\n * @return {Array} Returns an array containing 3 integers `[div, m, n]`\n * where `div = gcd(a, b)` and `a*m + b*n = div`\n */\n return typed(name, {\n 'number, number': function numberNumber(a, b) {\n var res = xgcdNumber(a, b);\n return config.matrix === 'Array' ? res : matrix(res);\n },\n 'BigNumber, BigNumber': _xgcdBigNumber\n // TODO: implement support for Fraction\n });\n\n /**\n * Calculate xgcd for two BigNumbers\n * @param {BigNumber} a\n * @param {BigNumber} b\n * @return {BigNumber[]} result\n * @private\n */\n function _xgcdBigNumber(a, b) {\n // source: https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm\n var\n // used to swap two variables\n t;\n var\n // quotient\n q;\n var\n // remainder\n r;\n var zero = new BigNumber(0);\n var one = new BigNumber(1);\n var x = zero;\n var lastx = one;\n var y = one;\n var lasty = zero;\n if (!a.isInt() || !b.isInt()) {\n throw new Error('Parameters in function xgcd must be integer numbers');\n }\n while (!b.isZero()) {\n q = a.div(b).floor();\n r = a.mod(b);\n t = x;\n x = lastx.minus(q.times(x));\n lastx = t;\n t = y;\n y = lasty.minus(q.times(y));\n lasty = t;\n a = b;\n b = r;\n }\n var res;\n if (a.lt(zero)) {\n res = [a.neg(), lastx.neg(), lasty.neg()];\n } else {\n res = [a, !a.isZero() ? lastx : 0, lasty];\n }\n return config.matrix === 'Array' ? res : matrix(res);\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'invmod';\nvar dependencies = ['typed', 'config', 'BigNumber', 'xgcd', 'equal', 'smaller', 'mod', 'add', 'isInteger'];\nexport var createInvmod = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n BigNumber,\n xgcd,\n equal,\n smaller,\n mod,\n add,\n isInteger\n } = _ref;\n /**\n * Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation `ax \u2263 1 (mod b)`\n * See https://en.wikipedia.org/wiki/Modular_multiplicative_inverse.\n *\n * Syntax:\n *\n * math.invmod(a, b)\n *\n * Examples:\n *\n * math.invmod(8, 12) // returns NaN\n * math.invmod(7, 13) // returns 2\n * math.invmod(15151, 15122) // returns 10429\n *\n * See also:\n *\n * gcd, xgcd\n *\n * @param {number | BigNumber} a An integer number\n * @param {number | BigNumber} b An integer number\n * @return {number | BigNumber } Returns an integer number\n * where `invmod(a,b)*a \u2263 1 (mod b)`\n */\n return typed(name, {\n 'number, number': invmod,\n 'BigNumber, BigNumber': invmod\n });\n function invmod(a, b) {\n if (!isInteger(a) || !isInteger(b)) throw new Error('Parameters in function invmod must be integer numbers');\n a = mod(a, b);\n if (equal(b, 0)) throw new Error('Divisor must be non zero');\n var res = xgcd(a, b);\n res = res.valueOf();\n var [gcd, inv] = res;\n if (!equal(gcd, BigNumber(1))) return NaN;\n inv = mod(inv, b);\n if (smaller(inv, BigNumber(0))) inv = add(inv, b);\n return inv;\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotMultiply';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'multiplyScalar', 'concat'];\nexport var createDotMultiply = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n multiplyScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo09xS0Sf = createMatAlgo09xS0Sf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Multiply two matrices element wise. The function accepts both matrices and\n * scalar values.\n *\n * Syntax:\n *\n * math.dotMultiply(x, y)\n *\n * Examples:\n *\n * math.dotMultiply(2, 4) // returns 8\n *\n * a = [[9, 5], [6, 1]]\n * b = [[3, 2], [5, 2]]\n *\n * math.dotMultiply(a, b) // returns [[27, 10], [30, 2]]\n * math.multiply(a, b) // returns [[52, 28], [23, 14]]\n *\n * See also:\n *\n * multiply, divide, dotDivide\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Left hand value\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Right hand value\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Multiplication of `x` and `y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: multiplyScalar,\n SS: matAlgo09xS0Sf,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }));\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo09xS0Sf';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo09xS0Sf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and invokes the callback function f(Aij, Bij).\n * Callback function invoked NZA times, number of nonzero elements in A.\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0\n * C(i,j) = \u2524\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo09xS0Sf(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = avalues && bvalues ? [] : undefined;\n var cindex = [];\n var cptr = [];\n\n // workspaces\n var x = cvalues ? [] : undefined;\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // vars\n var i, j, k, k0, k1;\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // column mark\n var mark = j + 1;\n // check we need to process values\n if (x) {\n // loop B(:,j)\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // update workspace\n w[i] = mark;\n x[i] = bvalues[k];\n }\n }\n // loop A(:,j)\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // check we need to process values\n if (x) {\n // b value @ i,j\n var vb = w[i] === mark ? x[i] : zero;\n // invoke f\n var vc = cf(avalues[k], vb);\n // check zero value\n if (!eq(vc, zero)) {\n // push index\n cindex.push(i);\n // push value\n cvalues.push(vc);\n }\n } else {\n // push index\n cindex.push(i);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { bitAndBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitAndNumber } from '../../plain/number/index.js';\nvar name = 'bitAnd';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'concat'];\nexport var createBitAnd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise AND two values, `x & y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.bitAnd(x, y)\n *\n * Examples:\n *\n * math.bitAnd(53, 131) // returns number 1\n *\n * math.bitAnd([1, 12, 31], 42) // returns Array [0, 8, 10]\n *\n * See also:\n *\n * bitNot, bitOr, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to and\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to and\n * @return {number | BigNumber | bigint | Array | Matrix} AND of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitAndNumber,\n 'BigNumber, BigNumber': bitAndBigNumber,\n 'bigint, bigint': (x, y) => x & y\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0,\n Ss: matAlgo11xS0s\n }));\n});", "/**\n * Bitwise and for Bignumbers\n *\n * Special Cases:\n * N & n = N\n * n & 0 = 0\n * n & -1 = n\n * n & n = n\n * I & I = I\n * -I & -I = -I\n * I & -I = 0\n * I & n = n\n * I & -n = I\n * -I & n = 0\n * -I & -n = -I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` & `y`, is fully precise\n * @private\n */\nexport function bitAndBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitAnd');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.eq(-1) || x.eq(y)) {\n return x;\n }\n if (y.isZero() || x.eq(-1)) {\n return y;\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !y.isFinite()) {\n if (x.isNegative() === y.isNegative()) {\n return x;\n }\n return new BigNumber(0);\n }\n if (!x.isFinite()) {\n if (y.isNegative()) {\n return x;\n }\n if (x.isNegative()) {\n return new BigNumber(0);\n }\n return y;\n }\n if (!y.isFinite()) {\n if (x.isNegative()) {\n return y;\n }\n if (y.isNegative()) {\n return new BigNumber(0);\n }\n return x;\n }\n }\n return bitwise(x, y, function (a, b) {\n return a & b;\n });\n}\n\n/**\n * Bitwise not\n * @param {BigNumber} x\n * @return {BigNumber} Result of ~`x`, fully precise\n *\n */\nexport function bitNotBigNumber(x) {\n if (x.isFinite() && !x.isInteger()) {\n throw new Error('Integer expected in function bitNot');\n }\n var BigNumber = x.constructor;\n var prevPrec = BigNumber.precision;\n BigNumber.config({\n precision: 1E9\n });\n var result = x.plus(new BigNumber(1));\n result.s = -result.s || null;\n BigNumber.config({\n precision: prevPrec\n });\n return result;\n}\n\n/**\n * Bitwise OR for BigNumbers\n *\n * Special Cases:\n * N | n = N\n * n | 0 = n\n * n | -1 = -1\n * n | n = n\n * I | I = I\n * -I | -I = -I\n * I | -n = -1\n * I | -I = -1\n * I | n = I\n * -I | n = -I\n * -I | -n = -n\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` | `y`, fully precise\n */\nexport function bitOrBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitOr');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n var negOne = new BigNumber(-1);\n if (x.isZero() || y.eq(negOne) || x.eq(y)) {\n return y;\n }\n if (y.isZero() || x.eq(negOne)) {\n return x;\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !x.isNegative() && y.isNegative() || x.isNegative() && !y.isNegative() && !y.isFinite()) {\n return negOne;\n }\n if (x.isNegative() && y.isNegative()) {\n return x.isFinite() ? x : y;\n }\n return x.isFinite() ? y : x;\n }\n return bitwise(x, y, function (a, b) {\n return a | b;\n });\n}\n\n/**\n * Applies bitwise function to numbers\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @param {function (a, b)} func\n * @return {BigNumber}\n */\nexport function bitwise(x, y, func) {\n var BigNumber = x.constructor;\n var xBits, yBits;\n var xSign = +(x.s < 0);\n var ySign = +(y.s < 0);\n if (xSign) {\n xBits = decCoefficientToBinaryString(bitNotBigNumber(x));\n for (var i = 0; i < xBits.length; ++i) {\n xBits[i] ^= 1;\n }\n } else {\n xBits = decCoefficientToBinaryString(x);\n }\n if (ySign) {\n yBits = decCoefficientToBinaryString(bitNotBigNumber(y));\n for (var _i = 0; _i < yBits.length; ++_i) {\n yBits[_i] ^= 1;\n }\n } else {\n yBits = decCoefficientToBinaryString(y);\n }\n var minBits, maxBits, minSign;\n if (xBits.length <= yBits.length) {\n minBits = xBits;\n maxBits = yBits;\n minSign = xSign;\n } else {\n minBits = yBits;\n maxBits = xBits;\n minSign = ySign;\n }\n var shortLen = minBits.length;\n var longLen = maxBits.length;\n var expFuncVal = func(xSign, ySign) ^ 1;\n var outVal = new BigNumber(expFuncVal ^ 1);\n var twoPower = new BigNumber(1);\n var two = new BigNumber(2);\n var prevPrec = BigNumber.precision;\n BigNumber.config({\n precision: 1E9\n });\n while (shortLen > 0) {\n if (func(minBits[--shortLen], maxBits[--longLen]) === expFuncVal) {\n outVal = outVal.plus(twoPower);\n }\n twoPower = twoPower.times(two);\n }\n while (longLen > 0) {\n if (func(minSign, maxBits[--longLen]) === expFuncVal) {\n outVal = outVal.plus(twoPower);\n }\n twoPower = twoPower.times(two);\n }\n BigNumber.config({\n precision: prevPrec\n });\n if (expFuncVal === 0) {\n outVal.s = -outVal.s;\n }\n return outVal;\n}\n\n/* Extracted from decimal.js, and edited to specialize. */\nfunction decCoefficientToBinaryString(x) {\n // Convert to string\n var a = x.d; // array with digits\n var r = a[0] + '';\n for (var i = 1; i < a.length; ++i) {\n var s = a[i] + '';\n for (var z = 7 - s.length; z--;) {\n s = '0' + s;\n }\n r += s;\n }\n var j = r.length;\n while (r.charAt(j) === '0') {\n j--;\n }\n var xe = x.e;\n var str = r.slice(0, j + 1 || 1);\n var strL = str.length;\n if (xe > 0) {\n if (++xe > strL) {\n // Append zeros.\n xe -= strL;\n while (xe--) {\n str += '0';\n }\n } else if (xe < strL) {\n str = str.slice(0, xe) + '.' + str.slice(xe);\n }\n }\n\n // Convert from base 10 (decimal) to base 2\n var arr = [0];\n for (var _i2 = 0; _i2 < str.length;) {\n var arrL = arr.length;\n while (arrL--) {\n arr[arrL] *= 10;\n }\n arr[0] += parseInt(str.charAt(_i2++)); // convert to int\n for (var _j = 0; _j < arr.length; ++_j) {\n if (arr[_j] > 1) {\n if (arr[_j + 1] === null || arr[_j + 1] === undefined) {\n arr[_j + 1] = 0;\n }\n arr[_j + 1] += arr[_j] >> 1;\n arr[_j] &= 1;\n }\n }\n }\n return arr.reverse();\n}\n\n/**\n * Bitwise XOR for BigNumbers\n *\n * Special Cases:\n * N ^ n = N\n * n ^ 0 = n\n * n ^ n = 0\n * n ^ -1 = ~n\n * I ^ n = I\n * I ^ -n = -I\n * I ^ -I = -1\n * -I ^ n = -I\n * -I ^ -n = I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` ^ `y`, fully precise\n *\n */\nexport function bitXor(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function bitXor');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN()) {\n return new BigNumber(NaN);\n }\n if (x.isZero()) {\n return y;\n }\n if (y.isZero()) {\n return x;\n }\n if (x.eq(y)) {\n return new BigNumber(0);\n }\n var negOne = new BigNumber(-1);\n if (x.eq(negOne)) {\n return bitNotBigNumber(y);\n }\n if (y.eq(negOne)) {\n return bitNotBigNumber(x);\n }\n if (!x.isFinite() || !y.isFinite()) {\n if (!x.isFinite() && !y.isFinite()) {\n return negOne;\n }\n return new BigNumber(x.isNegative() === y.isNegative() ? Infinity : -Infinity);\n }\n return bitwise(x, y, function (a, b) {\n return a ^ b;\n });\n}\n\n/**\n * Bitwise left shift\n *\n * Special Cases:\n * n << -n = N\n * n << N = N\n * N << n = N\n * n << 0 = n\n * 0 << n = 0\n * I << I = N\n * I << n = I\n * n << I = I\n *\n * @param {BigNumber} x\n * @param {BigNumber} y\n * @return {BigNumber} Result of `x` << `y`\n *\n */\nexport function leftShiftBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function leftShift');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.isZero()) {\n return x;\n }\n if (!x.isFinite() && !y.isFinite()) {\n return new BigNumber(NaN);\n }\n\n // Math.pow(2, y) is fully precise for y < 55, and fast\n if (y.lt(55)) {\n return x.times(Math.pow(2, y.toNumber()) + '');\n }\n return x.times(new BigNumber(2).pow(y));\n}\n\n/*\n * Special Cases:\n * n >> -n = N\n * n >> N = N\n * N >> n = N\n * I >> I = N\n * n >> 0 = n\n * I >> n = I\n * -I >> n = -I\n * -I >> I = -I\n * n >> I = I\n * -n >> I = -1\n * 0 >> n = 0\n *\n * @param {BigNumber} value\n * @param {BigNumber} value\n * @return {BigNumber} Result of `x` >> `y`\n *\n */\nexport function rightArithShiftBigNumber(x, y) {\n if (x.isFinite() && !x.isInteger() || y.isFinite() && !y.isInteger()) {\n throw new Error('Integers expected in function rightArithShift');\n }\n var BigNumber = x.constructor;\n if (x.isNaN() || y.isNaN() || y.isNegative() && !y.isZero()) {\n return new BigNumber(NaN);\n }\n if (x.isZero() || y.isZero()) {\n return x;\n }\n if (!y.isFinite()) {\n if (x.isNegative()) {\n return new BigNumber(-1);\n }\n if (!x.isFinite()) {\n return new BigNumber(NaN);\n }\n return new BigNumber(0);\n }\n\n // Math.pow(2, y) is fully precise for y < 55, and fast\n if (y.lt(55)) {\n return x.div(Math.pow(2, y.toNumber()) + '').floor();\n }\n return x.div(new BigNumber(2).pow(y)).floor();\n}", "import { bitNotBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { bitNotNumber } from '../../plain/number/index.js';\nvar name = 'bitNot';\nvar dependencies = ['typed'];\nexport var createBitNot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Bitwise NOT value, `~x`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.bitNot(x)\n *\n * Examples:\n *\n * math.bitNot(1) // returns number -2\n *\n * math.bitNot([2, -3, 4]) // returns Array [-3, 2, -5]\n *\n * See also:\n *\n * bitAnd, bitOr, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to not\n * @return {number | BigNumber | bigint | Array | Matrix} NOT of `x`\n */\n return typed(name, {\n number: bitNotNumber,\n BigNumber: bitNotBigNumber,\n bigint: x => ~x,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { bitOrBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitOrNumber } from '../../plain/number/index.js';\nvar name = 'bitOr';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createBitOr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise OR two values, `x | y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the lowest print base.\n *\n * Syntax:\n *\n * math.bitOr(x, y)\n *\n * Examples:\n *\n * math.bitOr(1, 2) // returns number 3\n *\n * math.bitOr([1, 2, 3], 4) // returns Array [5, 6, 7]\n *\n * See also:\n *\n * bitAnd, bitNot, bitXor, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to or\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to or\n * @return {number | BigNumber | bigint | Array | Matrix} OR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitOrNumber,\n 'BigNumber, BigNumber': bitOrBigNumber,\n 'bigint, bigint': (x, y) => x | y\n }, matrixAlgorithmSuite({\n SS: matAlgo04xSidSid,\n DS: matAlgo01xDSid,\n Ss: matAlgo10xSids\n }));\n});", "import { bitXor as bigBitXor } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { bitXorNumber } from '../../plain/number/index.js';\nvar name = 'bitXor';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat'];\nexport var createBitXor = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Bitwise XOR two values, `x ^ y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.bitXor(x, y)\n *\n * Examples:\n *\n * math.bitXor(1, 2) // returns number 3\n *\n * math.bitXor([2, 3, 4], 4) // returns Array [6, 7, 0]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, leftShift, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x First value to xor\n * @param {number | BigNumber | bigint | Array | Matrix} y Second value to xor\n * @return {number | BigNumber | bigint | Array | Matrix} XOR of `x` and `y`\n */\n return typed(name, {\n 'number, number': bitXorNumber,\n 'BigNumber, BigNumber': bigBitXor,\n 'bigint, bigint': (x, y) => x ^ y\n }, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo07xSSf';\nvar dependencies = ['typed', 'DenseMatrix'];\nexport var createMatAlgo07xSSf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n DenseMatrix\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B items (zero and nonzero) and invokes the callback function f(Aij, Bij).\n * Callback function invoked MxN times.\n *\n * C(i,j) = f(Aij, Bij)\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} DenseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo07xSSf(a, b, callback) {\n // sparse matrix arrays\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // vars\n var i, j;\n\n // result arrays\n var cdata = [];\n // initialize c\n for (i = 0; i < rows; i++) {\n cdata[i] = [];\n }\n\n // workspaces\n var xa = [];\n var xb = [];\n // marks indicating we have a value in x for a given column\n var wa = [];\n var wb = [];\n\n // loop columns\n for (j = 0; j < columns; j++) {\n // columns mark\n var mark = j + 1;\n // scatter the values of A(:,j) into workspace\n _scatter(a, j, wa, xa, mark);\n // scatter the values of B(:,j) into workspace\n _scatter(b, j, wb, xb, mark);\n // loop rows\n for (i = 0; i < rows; i++) {\n // matrix values @ i,j\n var va = wa[i] === mark ? xa[i] : zero;\n var vb = wb[i] === mark ? xb[i] : zero;\n // invoke callback\n cdata[i][j] = cf(va, vb);\n }\n }\n\n // return dense matrix\n return new DenseMatrix({\n data: cdata,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n function _scatter(m, j, w, x, mark) {\n // a arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // loop values in column j\n for (var k = ptr[j], k1 = ptr[j + 1]; k < k1; k++) {\n // row\n var i = index[k];\n // update workspace\n w[i] = mark;\n x[i] = values[k];\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'arg';\nvar dependencies = ['typed'];\nexport var createArg = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the argument of a complex value.\n * For a complex number `a + bi`, the argument is computed as `atan2(b, a)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.arg(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 2)\n * math.arg(a) / math.pi // returns number 0.25\n *\n * const b = math.complex('2 + 3i')\n * math.arg(b) // returns number 0.982793723247329\n * math.atan2(3, 2) // returns number 0.982793723247329\n *\n * See also:\n *\n * re, im, conj, abs\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The argument of x\n */\n return typed(name, {\n number: function number(x) {\n return Math.atan2(0, x);\n },\n BigNumber: function BigNumber(x) {\n return x.constructor.atan2(0, x);\n },\n Complex: function Complex(x) {\n return x.arg();\n },\n // TODO: implement BigNumber support for function arg\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'conj';\nvar dependencies = ['typed'];\nexport var createConj = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the complex conjugate of a complex value.\n * If `x = a+bi`, the complex conjugate of `x` is `a - bi`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.conj(x)\n *\n * Examples:\n *\n * math.conj(math.complex('2 + 3i')) // returns Complex 2 - 3i\n * math.conj(math.complex('2 - 3i')) // returns Complex 2 + 3i\n * math.conj(math.complex('-5.2i')) // returns Complex 5.2i\n *\n * See also:\n *\n * re, im, arg, abs\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Complex | Array | Matrix}\n * The complex conjugate of x\n */\n return typed(name, {\n 'number | BigNumber | Fraction': x => x,\n Complex: x => x.conjugate(),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 'im';\nvar dependencies = ['typed'];\nexport var createIm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Get the imaginary part of a complex number.\n * For a complex number `a + bi`, the function returns `b`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.im(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 3)\n * math.re(a) // returns number 2\n * math.im(a) // returns number 3\n *\n * math.re(math.complex('-5.2i')) // returns number -5.2\n * math.re(math.complex(2.4)) // returns number 0\n *\n * See also:\n *\n * re, conj, abs, arg\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The imaginary part of x\n */\n return typed(name, {\n number: () => 0,\n 'BigNumber | Fraction': x => x.mul(0),\n Complex: x => x.im,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nvar name = 're';\nvar dependencies = ['typed'];\nexport var createRe = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Get the real part of a complex number.\n * For a complex number `a + bi`, the function returns `a`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.re(x)\n *\n * Examples:\n *\n * const a = math.complex(2, 3)\n * math.re(a) // returns number 2\n * math.im(a) // returns number 3\n *\n * math.re(math.complex('-5.2i')) // returns number 0\n * math.re(math.complex(2.4)) // returns number 2.4\n *\n * See also:\n *\n * im, conj, abs, arg\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Array | Matrix} The real part of x\n */\n return typed(name, {\n 'number | BigNumber | Fraction': x => x,\n Complex: x => x.re,\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { notNumber } from '../../plain/number/index.js';\nvar name = 'not';\nvar dependencies = ['typed'];\nexport var createNot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Logical `not`. Flips boolean value of a given parameter.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.not(x)\n *\n * Examples:\n *\n * math.not(2) // returns false\n * math.not(0) // returns true\n * math.not(true) // returns false\n *\n * a = [2, -7, 0]\n * math.not(a) // returns [false, false, true]\n *\n * See also:\n *\n * and, or, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @return {boolean | Array | Matrix}\n * Returns true when input is a zero or empty value.\n */\n return typed(name, {\n 'null | undefined': () => true,\n number: notNumber,\n Complex: function Complex(x) {\n return x.re === 0 && x.im === 0;\n },\n BigNumber: function BigNumber(x) {\n return x.isZero() || x.isNaN();\n },\n bigint: x => !x,\n Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { orNumber } from '../../plain/number/index.js';\nvar name = 'or';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createOr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `or`. Test if at least one value is defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.or(x, y)\n *\n * Examples:\n *\n * math.or(2, 4) // returns true\n *\n * a = [2, 5, 0]\n * b = [0, 22, 0]\n * c = 0\n *\n * math.or(a, b) // returns [true, true, false]\n * math.or(b, c) // returns [false, true, false]\n *\n * See also:\n *\n * and, not, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when one of the inputs is defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': orNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.re !== 0 || x.im !== 0 || y.re !== 0 || y.im !== 0;\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return !x.isZero() && !x.isNaN() || !y.isZero() && !y.isNaN();\n },\n 'bigint, bigint': orNumber,\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0))\n }, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { xorNumber } from '../../plain/number/index.js';\nvar name = 'xor';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat'];\nexport var createXor = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `xor`. Test whether one and only one value is defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.xor(x, y)\n *\n * Examples:\n *\n * math.xor(2, 4) // returns false\n *\n * a = [2, 0, 0]\n * b = [2, 7, 0]\n * c = 0\n *\n * math.xor(a, b) // returns [false, true, false]\n * math.xor(a, c) // returns [true, false, false]\n *\n * See also:\n *\n * and, not, or\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when one and only one input is defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': xorNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return (x.re !== 0 || x.im !== 0) !== (y.re !== 0 || y.im !== 0);\n },\n 'bigint, bigint': xorNumber,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return (!x.isZero() && !x.isNaN()) !== (!y.isZero() && !y.isNaN());\n },\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0))\n }, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});", "import { isBigNumber, isMatrix, isNumber } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { arraySize, concat as _concat } from '../../utils/array.js';\nimport { IndexError } from '../../error/IndexError.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'concat';\nvar dependencies = ['typed', 'matrix', 'isInteger'];\nexport var createConcat = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isInteger\n } = _ref;\n /**\n * Concatenate two or more matrices.\n *\n * Syntax:\n *\n * math.concat(A, B, C, ...)\n * math.concat(A, B, C, ..., dim)\n *\n * Where:\n *\n * - `dim: number` is a zero-based dimension over which to concatenate the matrices.\n * By default the last dimension of the matrices.\n *\n * Examples:\n *\n * const A = [[1, 2], [5, 6]]\n * const B = [[3, 4], [7, 8]]\n *\n * math.concat(A, B) // returns [[1, 2, 3, 4], [5, 6, 7, 8]]\n * math.concat(A, B, 0) // returns [[1, 2], [5, 6], [3, 4], [7, 8]]\n * math.concat('hello', ' ', 'world') // returns 'hello world'\n *\n * See also:\n *\n * size, squeeze, subset, transpose\n *\n * @param {... Array | Matrix} args Two or more matrices\n * @return {Array | Matrix} Concatenated matrix\n */\n return typed(name, {\n // TODO: change signature to '...Array | Matrix, dim?' when supported\n '...Array | Matrix | number | BigNumber': function ArrayMatrixNumberBigNumber(args) {\n var i;\n var len = args.length;\n var dim = -1; // zero-based dimension\n var prevDim;\n var asMatrix = false;\n var matrices = []; // contains multi dimensional arrays\n\n for (i = 0; i < len; i++) {\n var arg = args[i];\n\n // test whether we need to return a Matrix (if not we return an Array)\n if (isMatrix(arg)) {\n asMatrix = true;\n }\n if (isNumber(arg) || isBigNumber(arg)) {\n if (i !== len - 1) {\n throw new Error('Dimension must be specified as last argument');\n }\n\n // last argument contains the dimension on which to concatenate\n prevDim = dim;\n dim = arg.valueOf(); // change BigNumber to number\n\n if (!isInteger(dim)) {\n throw new TypeError('Integer number expected for dimension');\n }\n if (dim < 0 || i > 0 && dim > prevDim) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, prevDim + 1);\n }\n } else {\n // this is a matrix or array\n var m = clone(arg).valueOf();\n var size = arraySize(m);\n matrices[i] = m;\n prevDim = dim;\n dim = size.length - 1;\n\n // verify whether each of the matrices has the same number of dimensions\n if (i > 0 && dim !== prevDim) {\n throw new DimensionError(prevDim + 1, dim + 1);\n }\n }\n }\n if (matrices.length === 0) {\n throw new SyntaxError('At least one matrix expected');\n }\n var res = matrices.shift();\n while (matrices.length) {\n res = _concat(res, matrices.shift(), dim);\n }\n return asMatrix ? matrix(res) : res;\n },\n '...string': function string(args) {\n return args.join('');\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { validateIndex } from '../../utils/array.js';\nvar name = 'column';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\nexport var createColumn = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n /**\n * Return a column from a Matrix.\n *\n * Syntax:\n *\n * math.column(value, index)\n *\n * Example:\n *\n * // get a column\n * const d = [[1, 2], [3, 4]]\n * math.column(d, 1) // returns [[2], [4]]\n *\n * See also:\n *\n * row\n *\n * @param {Array | Matrix } value An array or matrix\n * @param {number} column The index of the column\n * @return {Array | Matrix} The retrieved column\n */\n return typed(name, {\n 'Matrix, number': _column,\n 'Array, number': function ArrayNumber(value, column) {\n return _column(matrix(clone(value)), column).valueOf();\n }\n });\n\n /**\n * Retrieve a column of a matrix\n * @param {Matrix } value A matrix\n * @param {number} column The index of the column\n * @return {Matrix} The retrieved column\n */\n function _column(value, column) {\n // check dimensions\n if (value.size().length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n validateIndex(column, value.size()[1]);\n var rowRange = range(0, value.size()[0]);\n var index = new Index(rowRange, column);\n var result = value.subset(index);\n return isMatrix(result) ? result : matrix([[result]]);\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'count';\nvar dependencies = ['typed', 'size', 'prod'];\nexport var createCount = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n prod\n } = _ref;\n /**\n * Count the number of elements of a matrix, array or string.\n *\n * Syntax:\n *\n * math.count(x)\n *\n * Examples:\n *\n * math.count('hello world') // returns 11\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.count(A) // returns 6\n * math.count(math.range(1,6)) // returns 5\n *\n * See also:\n *\n * size\n *\n * @param {string | Array | Matrix} x A matrix or string\n * @return {number} An integer with the elements in `x`.\n */\n return typed(name, {\n string: function string(x) {\n return x.length;\n },\n 'Matrix | Array': function MatrixArray(x) {\n return prod(size(x));\n }\n });\n});", "import { arraySize, squeeze } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'cross';\nvar dependencies = ['typed', 'matrix', 'subtract', 'multiply'];\nexport var createCross = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n multiply\n } = _ref;\n /**\n * Calculate the cross product for two vectors in three dimensional space.\n * The cross product of `A = [a1, a2, a3]` and `B = [b1, b2, b3]` is defined\n * as:\n *\n * cross(A, B) = [\n * a2 * b3 - a3 * b2,\n * a3 * b1 - a1 * b3,\n * a1 * b2 - a2 * b1\n * ]\n *\n * If one of the input vectors has a dimension greater than 1, the output\n * vector will be a 1x3 (2-dimensional) matrix.\n *\n * Syntax:\n *\n * math.cross(x, y)\n *\n * Examples:\n *\n * math.cross([1, 1, 0], [0, 1, 1]) // Returns [1, -1, 1]\n * math.cross([3, -3, 1], [4, 9, 2]) // Returns [-15, -2, 39]\n * math.cross([2, 3, 4], [5, 6, 7]) // Returns [-3, 6, -3]\n * math.cross([[1, 2, 3]], [[4], [5], [6]]) // Returns [[-3, 6, -3]]\n *\n * See also:\n *\n * dot, multiply\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {Array | Matrix} Returns the cross product of `x` and `y`\n */\n return typed(name, {\n 'Matrix, Matrix': function MatrixMatrix(x, y) {\n return matrix(_cross(x.toArray(), y.toArray()));\n },\n 'Matrix, Array': function MatrixArray(x, y) {\n return matrix(_cross(x.toArray(), y));\n },\n 'Array, Matrix': function ArrayMatrix(x, y) {\n return matrix(_cross(x, y.toArray()));\n },\n 'Array, Array': _cross\n });\n\n /**\n * Calculate the cross product for two arrays\n * @param {Array} x First vector\n * @param {Array} y Second vector\n * @returns {Array} Returns the cross product of x and y\n * @private\n */\n function _cross(x, y) {\n var highestDimension = Math.max(arraySize(x).length, arraySize(y).length);\n x = squeeze(x);\n y = squeeze(y);\n var xSize = arraySize(x);\n var ySize = arraySize(y);\n if (xSize.length !== 1 || ySize.length !== 1 || xSize[0] !== 3 || ySize[0] !== 3) {\n throw new RangeError('Vectors with length 3 expected ' + '(Size A = [' + xSize.join(', ') + '], B = [' + ySize.join(', ') + '])');\n }\n var product = [subtract(multiply(x[1], y[2]), multiply(x[2], y[1])), subtract(multiply(x[2], y[0]), multiply(x[0], y[2])), subtract(multiply(x[0], y[1]), multiply(x[1], y[0]))];\n if (highestDimension > 1) {\n return [product];\n } else {\n return product;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'diag';\nvar dependencies = ['typed', 'matrix', 'DenseMatrix', 'SparseMatrix'];\nexport var createDiag = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a diagonal matrix or retrieve the diagonal of a matrix\n *\n * When `x` is a vector, a matrix with vector `x` on the diagonal will be returned.\n * When `x` is a two dimensional matrix, the matrixes `k`th diagonal will be returned as vector.\n * When k is positive, the values are placed on the super diagonal.\n * When k is negative, the values are placed on the sub diagonal.\n *\n * Syntax:\n *\n * math.diag(X)\n * math.diag(X, format)\n * math.diag(X, k)\n * math.diag(X, k, format)\n *\n * Examples:\n *\n * // create a diagonal matrix\n * math.diag([1, 2, 3]) // returns [[1, 0, 0], [0, 2, 0], [0, 0, 3]]\n * math.diag([1, 2, 3], 1) // returns [[0, 1, 0, 0], [0, 0, 2, 0], [0, 0, 0, 3]]\n * math.diag([1, 2, 3], -1) // returns [[0, 0, 0], [1, 0, 0], [0, 2, 0], [0, 0, 3]]\n *\n * // retrieve the diagonal from a matrix\n * const a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\n * math.diag(a) // returns [1, 5, 9]\n *\n * See also:\n *\n * ones, zeros, identity\n *\n * @param {Matrix | Array} x A two dimensional matrix or a vector\n * @param {number | BigNumber} [k=0] The diagonal where the vector will be filled\n * in or retrieved.\n * @param {string} [format='dense'] The matrix storage format.\n *\n * @returns {Matrix | Array} Diagonal matrix from input vector, or diagonal from input matrix.\n */\n return typed(name, {\n // FIXME: simplify this huge amount of signatures as soon as typed-function supports optional arguments\n\n Array: function Array(x) {\n return _diag(x, 0, arraySize(x), null);\n },\n 'Array, number': function ArrayNumber(x, k) {\n return _diag(x, k, arraySize(x), null);\n },\n 'Array, BigNumber': function ArrayBigNumber(x, k) {\n return _diag(x, k.toNumber(), arraySize(x), null);\n },\n 'Array, string': function ArrayString(x, format) {\n return _diag(x, 0, arraySize(x), format);\n },\n 'Array, number, string': function ArrayNumberString(x, k, format) {\n return _diag(x, k, arraySize(x), format);\n },\n 'Array, BigNumber, string': function ArrayBigNumberString(x, k, format) {\n return _diag(x, k.toNumber(), arraySize(x), format);\n },\n Matrix: function Matrix(x) {\n return _diag(x, 0, x.size(), x.storage());\n },\n 'Matrix, number': function MatrixNumber(x, k) {\n return _diag(x, k, x.size(), x.storage());\n },\n 'Matrix, BigNumber': function MatrixBigNumber(x, k) {\n return _diag(x, k.toNumber(), x.size(), x.storage());\n },\n 'Matrix, string': function MatrixString(x, format) {\n return _diag(x, 0, x.size(), format);\n },\n 'Matrix, number, string': function MatrixNumberString(x, k, format) {\n return _diag(x, k, x.size(), format);\n },\n 'Matrix, BigNumber, string': function MatrixBigNumberString(x, k, format) {\n return _diag(x, k.toNumber(), x.size(), format);\n }\n });\n\n /**\n * Creeate diagonal matrix from a vector or vice versa\n * @param {Array | Matrix} x\n * @param {number} k\n * @param {string} format Storage format for matrix. If null,\n * an Array is returned\n * @returns {Array | Matrix}\n * @private\n */\n function _diag(x, k, size, format) {\n if (!isInteger(k)) {\n throw new TypeError('Second parameter in function diag must be an integer');\n }\n var kSuper = k > 0 ? k : 0;\n var kSub = k < 0 ? -k : 0;\n\n // check dimensions\n switch (size.length) {\n case 1:\n return _createDiagonalMatrix(x, k, format, size[0], kSub, kSuper);\n case 2:\n return _getDiagonal(x, k, format, size, kSub, kSuper);\n }\n throw new RangeError('Matrix for function diag must be 2 dimensional');\n }\n function _createDiagonalMatrix(x, k, format, l, kSub, kSuper) {\n // matrix size\n var ms = [l + kSub, l + kSuper];\n if (format && format !== 'sparse' && format !== 'dense') {\n throw new TypeError(\"Unknown matrix type \".concat(format, \"\\\"\"));\n }\n\n // create diagonal matrix\n var m = format === 'sparse' ? SparseMatrix.diagonal(ms, x, k) : DenseMatrix.diagonal(ms, x, k);\n // check we need to return a matrix\n return format !== null ? m : m.valueOf();\n }\n function _getDiagonal(x, k, format, s, kSub, kSuper) {\n // check x is a Matrix\n if (isMatrix(x)) {\n // get diagonal matrix\n var dm = x.diagonal(k);\n // check we need to return a matrix\n if (format !== null) {\n // check we need to change matrix format\n if (format !== dm.storage()) {\n return matrix(dm, format);\n }\n return dm;\n }\n return dm.valueOf();\n }\n // vector size\n var n = Math.min(s[0] - kSub, s[1] - kSuper);\n // diagonal values\n var vector = [];\n // loop diagonal\n for (var i = 0; i < n; i++) {\n vector[i] = x[i + kSub][i + kSuper];\n }\n // check we need to return a matrix\n return format !== null ? matrix(vector) : vector;\n }\n});", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { filter, filterRegExp } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'filter';\nvar dependencies = ['typed'];\nexport var createFilter = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Filter the items in an array or one dimensional matrix.\n *\n * Syntax:\n *\n * math.filter(x, test)\n *\n * Examples:\n *\n * function isPositive (x) {\n * return x > 0\n * }\n * math.filter([6, -2, -1, 4, 3], isPositive) // returns [6, 4, 3]\n *\n * math.filter([\"23\", \"foo\", \"100\", \"55\", \"bar\"], /[0-9]+/) // returns [\"23\", \"100\", \"55\"]\n *\n * See also:\n *\n * forEach, map, sort\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to filter\n * @param {Function | RegExp} test\n * A function or regular expression to test items.\n * All entries for which `test` returns true are returned.\n * When `test` is a function, it is invoked with three parameters:\n * the value of the element, the index of the element, and the\n * matrix/array being traversed. The function must return a boolean.\n * @return {Matrix | Array} Returns the filtered matrix.\n */\n return typed('filter', {\n 'Array, function': _filterCallback,\n 'Matrix, function': function MatrixFunction(x, test) {\n return x.create(_filterCallback(x.toArray(), test));\n },\n 'Array, RegExp': filterRegExp,\n 'Matrix, RegExp': function MatrixRegExp(x, test) {\n return x.create(filterRegExp(x.toArray(), test));\n }\n });\n});\n\n/**\n * Filter values in a callback given a callback function\n * @param {Array} x\n * @param {Function} callback\n * @return {Array} Returns the filtered array\n * @private\n */\nfunction _filterCallback(x, callback) {\n return filter(x, function (value, index, array) {\n // invoke the callback function with the right number of arguments\n return applyCallback(callback, value, [index], array, 'filter');\n });\n}", "import typed from 'typed-function';\nimport { typeOf as _typeOf } from './is.js';\n\n/**\n * Invoke a callback for functions like map and filter with a matching number of arguments\n * @param {function} callback\n * @param {any} value\n * @param {number | number[]} index\n * @param {Array} array\n * @param {string} mappingFnName The name of the function that is invoking these callbacks, for example \"map\" or \"filter\"\n * @returns {*}\n */\nexport function applyCallback(callback, value, index, array, mappingFnName) {\n if (typed.isTypedFunction(callback)) {\n // invoke the typed callback function with the matching number of arguments only\n\n var args3 = [value, index, array];\n var signature3 = typed.resolve(callback, args3);\n if (signature3) {\n return tryWithArgs(signature3.implementation, args3);\n }\n var args2 = [value, index];\n var signature2 = typed.resolve(callback, args2);\n if (signature2) {\n return tryWithArgs(signature2.implementation, args2);\n }\n var args1 = [value];\n var signature1 = typed.resolve(callback, args1);\n if (signature1) {\n return tryWithArgs(signature1.implementation, args1);\n }\n\n // fallback (will throw an exception)\n return tryWithArgs(callback, args3);\n } else {\n // A regular JavaScript function\n return callback(value, index, array);\n }\n\n /**\n * @param {function} signature The selected signature of the typed-function\n * @param {Array} args List with arguments to apply to the selected signature\n * @returns {*} Returns the return value of the invoked signature\n * @throws {TypeError} Throws an error when no matching signature was found\n */\n function tryWithArgs(signature, args) {\n try {\n return signature.apply(signature, args);\n } catch (err) {\n var _err$data;\n // Enrich the error message so the user understands that it took place inside the callback function\n if (err instanceof TypeError && ((_err$data = err.data) === null || _err$data === void 0 ? void 0 : _err$data.category) === 'wrongType') {\n var argsDesc = [];\n argsDesc.push(\"value: \".concat(_typeOf(value)));\n if (args.length >= 2) {\n argsDesc.push(\"index: \".concat(_typeOf(index)));\n }\n if (args.length >= 3) {\n argsDesc.push(\"array: \".concat(_typeOf(array)));\n }\n throw new TypeError(\"Function \".concat(mappingFnName, \" cannot apply callback arguments \") + \"\".concat(callback.name, \"(\").concat(argsDesc.join(', '), \") at index \").concat(JSON.stringify(index)));\n } else {\n throw new TypeError(\"Function \".concat(mappingFnName, \" cannot apply callback arguments \") + \"to function \".concat(callback.name, \": \").concat(err.message));\n }\n }\n }\n}", "import { flatten as flattenArray } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'flatten';\nvar dependencies = ['typed', 'matrix'];\nexport var createFlatten = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix\n } = _ref;\n /**\n * Flatten a multidimensional matrix into a single dimensional matrix.\n * A new matrix is returned, the original matrix is left untouched.\n *\n * Syntax:\n *\n * math.flatten(x)\n *\n * Examples:\n *\n * math.flatten([[1,2], [3,4]]) // returns [1, 2, 3, 4]\n *\n * See also:\n *\n * concat, resize, size, squeeze\n *\n * @param {Matrix | Array} x Matrix to be flattened\n * @return {Matrix | Array} Returns the flattened matrix\n */\n return typed(name, {\n Array: function Array(x) {\n return flattenArray(x);\n },\n Matrix: function Matrix(x) {\n var flat = flattenArray(x.toArray());\n // TODO: return the same matrix type as x (Dense or Sparse Matrix)\n return matrix(flat);\n }\n });\n});", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { forEach as forEachArray } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'forEach';\nvar dependencies = ['typed'];\nexport var createForEach = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Iterate over all elements of a matrix/array, and executes the given callback function.\n *\n * Syntax:\n *\n * math.forEach(x, callback)\n *\n * Examples:\n *\n * math.forEach([1, 2, 3], function(value) {\n * console.log(value)\n * })\n * // outputs 1, 2, 3\n *\n * See also:\n *\n * filter, map, sort\n *\n * @param {Matrix | Array} x The matrix to iterate on.\n * @param {Function} callback The callback function is invoked with three\n * parameters: the value of the element, the index\n * of the element, and the Matrix/array being traversed.\n */\n return typed(name, {\n 'Array, function': _forEach,\n 'Matrix, function': function MatrixFunction(x, callback) {\n x.forEach(callback);\n }\n });\n});\n\n/**\n * forEach for a multidimensional array\n * @param {Array} array\n * @param {Function} callback\n * @private\n */\nfunction _forEach(array, callback) {\n var recurse = function recurse(value, index) {\n if (Array.isArray(value)) {\n forEachArray(value, function (child, i) {\n // we create a copy of the index array and append the new index value\n recurse(child, index.concat(i));\n });\n } else {\n // invoke the callback function with the right number of arguments\n return applyCallback(callback, value, index, array, 'forEach');\n }\n };\n recurse(array, []);\n}", "import { factory } from '../../utils/factory.js';\nimport { getArrayDataType } from '../../utils/array.js';\nimport { typeOf } from '../../utils/is.js';\nvar name = 'getMatrixDataType';\nvar dependencies = ['typed'];\nexport var createGetMatrixDataType = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Find the data type of all elements in a matrix or array,\n * for example 'number' if all items are a number and 'Complex' if all values\n * are complex numbers.\n * If a matrix contains more than one data type, it will return 'mixed'.\n *\n * Syntax:\n *\n * math.getMatrixDataType(x)\n *\n * Examples:\n *\n * const x = [ [1, 2, 3], [4, 5, 6] ]\n * const mixedX = [ [1, true], [2, 3] ]\n * const fractionX = [ [math.fraction(1, 3)], [math.fraction(1, 3)] ]\n * const unitX = [ [math.unit('5cm')], [math.unit('5cm')] ]\n * const bigNumberX = [ [math.bignumber(1)], [math.bignumber(0)] ]\n * const sparse = math.sparse(x)\n * const dense = math.matrix(x)\n * math.getMatrixDataType(x) // returns 'number'\n * math.getMatrixDataType(sparse) // returns 'number'\n * math.getMatrixDataType(dense) // returns 'number'\n * math.getMatrixDataType(mixedX) // returns 'mixed'\n * math.getMatrixDataType(fractionX) // returns 'Fraction'\n * math.getMatrixDataType(unitX) // returns 'Unit'\n * math.getMatrixDataType(bigNumberX) // return 'BigNumber'\n *\n * See also:\n * SparseMatrix, DenseMatrix\n *\n * @param {...Matrix | Array} x The Matrix with values.\n *\n * @return {string} A string representation of the matrix type\n */\n return typed(name, {\n Array: function Array(x) {\n return getArrayDataType(x, typeOf);\n },\n Matrix: function Matrix(x) {\n return x.getDataType();\n }\n });\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { resize } from '../../utils/array.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'identity';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix'];\nexport var createIdentity = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber,\n DenseMatrix,\n SparseMatrix\n } = _ref;\n /**\n * Create a 2-dimensional identity matrix with size m x n or n x n.\n * The matrix has ones on the diagonal and zeros elsewhere.\n *\n * Syntax:\n *\n * math.identity(n)\n * math.identity(n, format)\n * math.identity(m, n)\n * math.identity(m, n, format)\n * math.identity([m, n])\n * math.identity([m, n], format)\n *\n * Examples:\n *\n * math.identity(3) // returns [[1, 0, 0], [0, 1, 0], [0, 0, 1]]\n * math.identity(3, 2) // returns [[1, 0], [0, 1], [0, 0]]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.identity(math.size(A)) // returns [[1, 0, 0], [0, 1, 0]]\n *\n * See also:\n *\n * diag, ones, zeros, size, range\n *\n * @param {...number | Matrix | Array} size The size for the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Matrix | Array | number} A matrix with ones on the diagonal.\n */\n return typed(name, {\n '': function _() {\n return config.matrix === 'Matrix' ? matrix([]) : [];\n },\n string: function string(format) {\n return matrix(format);\n },\n 'number | BigNumber': function numberBigNumber(rows) {\n return _identity(rows, rows, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber, string': function numberBigNumberString(rows, format) {\n return _identity(rows, rows, format);\n },\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(rows, cols) {\n return _identity(rows, cols, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber, number | BigNumber, string': function numberBigNumberNumberBigNumberString(rows, cols, format) {\n return _identity(rows, cols, format);\n },\n Array: function Array(size) {\n return _identityVector(size);\n },\n 'Array, string': function ArrayString(size, format) {\n return _identityVector(size, format);\n },\n Matrix: function Matrix(size) {\n return _identityVector(size.valueOf(), size.storage());\n },\n 'Matrix, string': function MatrixString(size, format) {\n return _identityVector(size.valueOf(), format);\n }\n });\n function _identityVector(size, format) {\n switch (size.length) {\n case 0:\n return format ? matrix(format) : [];\n case 1:\n return _identity(size[0], size[0], format);\n case 2:\n return _identity(size[0], size[1], format);\n default:\n throw new Error('Vector containing two values expected');\n }\n }\n\n /**\n * Create an identity matrix\n * @param {number | BigNumber} rows\n * @param {number | BigNumber} cols\n * @param {string} [format]\n * @returns {Matrix}\n * @private\n */\n function _identity(rows, cols, format) {\n // BigNumber constructor with the right precision\n var Big = isBigNumber(rows) || isBigNumber(cols) ? BigNumber : null;\n if (isBigNumber(rows)) rows = rows.toNumber();\n if (isBigNumber(cols)) cols = cols.toNumber();\n if (!isInteger(rows) || rows < 1) {\n throw new Error('Parameters in function identity must be positive integers');\n }\n if (!isInteger(cols) || cols < 1) {\n throw new Error('Parameters in function identity must be positive integers');\n }\n var one = Big ? new BigNumber(1) : 1;\n var defaultValue = Big ? new Big(0) : 0;\n var size = [rows, cols];\n\n // check we need to return a matrix\n if (format) {\n // create diagonal matrix (use optimized implementation for storage format)\n if (format === 'sparse') {\n return SparseMatrix.diagonal(size, one, 0, defaultValue);\n }\n if (format === 'dense') {\n return DenseMatrix.diagonal(size, one, 0, defaultValue);\n }\n throw new TypeError(\"Unknown matrix type \\\"\".concat(format, \"\\\"\"));\n }\n\n // create and resize array\n var res = resize([], size, defaultValue);\n // fill in ones on the diagonal\n var minimum = rows < cols ? rows : cols;\n // fill diagonal\n for (var d = 0; d < minimum; d++) {\n res[d][d] = one;\n }\n return res;\n }\n});", "import { arraySize as size } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'kron';\nvar dependencies = ['typed', 'matrix', 'multiplyScalar'];\nexport var createKron = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n multiplyScalar\n } = _ref;\n /**\n * Calculates the kronecker product of 2 matrices or vectors.\n *\n * NOTE: If a one dimensional vector / matrix is given, it will be\n * wrapped so its two dimensions.\n * See the examples.\n *\n * Syntax:\n *\n * math.kron(x, y)\n *\n * Examples:\n *\n * math.kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])\n * // returns [ [ 1, 2, 0, 0 ], [ 3, 4, 0, 0 ], [ 0, 0, 1, 2 ], [ 0, 0, 3, 4 ] ]\n *\n * math.kron([1,1], [2,3,4])\n * // returns [ [ 2, 3, 4, 2, 3, 4 ] ]\n *\n * See also:\n *\n * multiply, dot, cross\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {Array | Matrix} Returns the kronecker product of `x` and `y`\n */\n return typed(name, {\n 'Matrix, Matrix': function MatrixMatrix(x, y) {\n return matrix(_kron(x.toArray(), y.toArray()));\n },\n 'Matrix, Array': function MatrixArray(x, y) {\n return matrix(_kron(x.toArray(), y));\n },\n 'Array, Matrix': function ArrayMatrix(x, y) {\n return matrix(_kron(x, y.toArray()));\n },\n 'Array, Array': _kron\n });\n\n /**\n * Calculate the kronecker product of two matrices / vectors\n * @param {Array} a First vector\n * @param {Array} b Second vector\n * @returns {Array} Returns the kronecker product of x and y\n * @private\n */\n function _kron(a, b) {\n // Deal with the dimensions of the matricies.\n if (size(a).length === 1) {\n // Wrap it in a 2D Matrix\n a = [a];\n }\n if (size(b).length === 1) {\n // Wrap it in a 2D Matrix\n b = [b];\n }\n if (size(a).length > 2 || size(b).length > 2) {\n throw new RangeError('Vectors with dimensions greater then 2 are not supported expected ' + '(Size x = ' + JSON.stringify(a.length) + ', y = ' + JSON.stringify(b.length) + ')');\n }\n var t = [];\n var r = [];\n return a.map(function (a) {\n return b.map(function (b) {\n r = [];\n t.push(r);\n return a.map(function (y) {\n return b.map(function (x) {\n return r.push(multiplyScalar(y, x));\n });\n });\n });\n }) && t;\n }\n});", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'map';\nvar dependencies = ['typed'];\nexport var createMap = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Create a new matrix or array with the results of a callback function executed on\n * each entry of a given matrix/array.\n *\n * For each entry of the input, the callback is invoked with three arguments:\n * the value of the entry, the index at which that entry occurs, and the full\n * matrix/array being traversed. Note that because the matrix/array might be\n * multidimensional, the \"index\" argument is always an array of numbers giving\n * the index in each dimension. This is true even for vectors: the \"index\"\n * argument is an array of length 1, rather than simply a number.\n *\n * Syntax:\n *\n * math.map(x, callback)\n *\n * Examples:\n *\n * math.map([1, 2, 3], function(value) {\n * return value * value\n * }) // returns [1, 4, 9]\n *\n * // The callback is normally called with three arguments:\n * // callback(value, index, Array)\n * // If you want to call with only one argument, use:\n * math.map([1, 2, 3], x => math.format(x)) // returns ['1', '2', '3']\n *\n * See also:\n *\n * filter, forEach, sort\n *\n * @param {Matrix | Array} x The input to iterate on.\n * @param {Function} callback\n * The function to call (as described above) on each entry of the input\n * @return {Matrix | array}\n * Transformed map of x; always has the same type and shape as x\n */\n return typed(name, {\n 'Array, function': _map,\n 'Matrix, function': function MatrixFunction(x, callback) {\n return x.map(callback);\n }\n });\n});\n\n/**\n * Map for a multi dimensional array\n * @param {Array} array\n * @param {Function} callback\n * @return {Array}\n * @private\n */\nfunction _map(array, callback) {\n var recurse = function recurse(value, index) {\n if (Array.isArray(value)) {\n return value.map(function (child, i) {\n // we create a copy of the index array and append the new index value\n return recurse(child, index.concat(i));\n });\n } else {\n // invoke the callback function with the right number of arguments\n return applyCallback(callback, value, index, array, 'map');\n }\n };\n return recurse(array, []);\n}", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'diff';\nvar dependencies = ['typed', 'matrix', 'subtract', 'number'];\nexport var createDiff = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n number\n } = _ref;\n /**\n * Create a new matrix or array of the difference between elements of the given array\n * The optional dim parameter lets you specify the dimension to evaluate the difference of\n * If no dimension parameter is passed it is assumed as dimension 0\n *\n * Dimension is zero-based in javascript and one-based in the parser and can be a number or bignumber\n * Arrays must be 'rectangular' meaning arrays like [1, 2]\n * If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays\n *\n * Syntax:\n *\n * math.diff(arr)\n * math.diff(arr, dim)\n *\n * Examples:\n *\n * const arr = [1, 2, 4, 7, 0]\n * math.diff(arr) // returns [1, 2, 3, -7] (no dimension passed so 0 is assumed)\n * math.diff(math.matrix(arr)) // returns Matrix [1, 2, 3, -7]\n *\n * const arr = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [9, 8, 7, 6, 4]]\n * math.diff(arr) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]]\n * math.diff(arr, 0) // returns [[0, 0, 0, 0, 0], [8, 6, 4, 2, -1]]\n * math.diff(arr, 1) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]]\n * math.diff(arr, math.bignumber(1)) // returns [[1, 1, 1, 1], [1, 1, 1, 1], [-1, -1, -1, -2]]\n *\n * math.diff(arr, 2) // throws RangeError as arr is 2 dimensional not 3\n * math.diff(arr, -1) // throws RangeError as negative dimensions are not allowed\n *\n * // These will all produce the same result\n * math.diff([[1, 2], [3, 4]])\n * math.diff([math.matrix([1, 2]), math.matrix([3, 4])])\n * math.diff([[1, 2], math.matrix([3, 4])])\n * math.diff([math.matrix([1, 2]), [3, 4]])\n * // They do not produce the same result as math.diff(math.matrix([[1, 2], [3, 4]])) as this returns a matrix\n *\n * See Also:\n *\n * sum\n * subtract\n * partitionSelect\n *\n * @param {Array | Matrix} arr An array or matrix\n * @param {number | BigNumber} dim Dimension\n * @return {Array | Matrix} Difference between array elements in given dimension\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(arr) {\n // No dimension specified => assume dimension 0\n if (isMatrix(arr)) {\n return matrix(_diff(arr.toArray()));\n } else {\n return _diff(arr);\n }\n },\n 'Array | Matrix, number': function ArrayMatrixNumber(arr, dim) {\n if (!isInteger(dim)) throw new RangeError('Dimension must be a whole number');\n if (isMatrix(arr)) {\n return matrix(_recursive(arr.toArray(), dim));\n } else {\n return _recursive(arr, dim);\n }\n },\n 'Array, BigNumber': typed.referTo('Array,number', selfAn => (arr, dim) => selfAn(arr, number(dim))),\n 'Matrix, BigNumber': typed.referTo('Matrix,number', selfMn => (arr, dim) => selfMn(arr, number(dim)))\n });\n\n /**\n * Recursively find the correct dimension in the array/matrix\n * Then Apply _diff to that dimension\n *\n * @param {Array} arr The array\n * @param {number} dim Dimension\n * @return {Array} resulting array\n */\n function _recursive(arr, dim) {\n if (isMatrix(arr)) {\n arr = arr.toArray(); // Makes sure arrays like [ matrix([0, 1]), matrix([1, 0]) ] are processed properly\n }\n if (!Array.isArray(arr)) {\n throw RangeError('Array/Matrix does not have that many dimensions');\n }\n if (dim > 0) {\n var result = [];\n arr.forEach(element => {\n result.push(_recursive(element, dim - 1));\n });\n return result;\n } else if (dim === 0) {\n return _diff(arr);\n } else {\n throw RangeError('Cannot have negative dimension');\n }\n }\n\n /**\n * Difference between elements in the array\n *\n * @param {Array} arr An array\n * @return {Array} resulting array\n */\n function _diff(arr) {\n var result = [];\n var size = arr.length;\n for (var i = 1; i < size; i++) {\n result.push(_ElementDiff(arr[i - 1], arr[i]));\n }\n return result;\n }\n\n /**\n * Difference between 2 objects\n *\n * @param {Object} obj1 First object\n * @param {Object} obj2 Second object\n * @return {Array} resulting array\n */\n function _ElementDiff(obj1, obj2) {\n // Convert matrices to arrays\n if (isMatrix(obj1)) obj1 = obj1.toArray();\n if (isMatrix(obj2)) obj2 = obj2.toArray();\n var obj1IsArray = Array.isArray(obj1);\n var obj2IsArray = Array.isArray(obj2);\n if (obj1IsArray && obj2IsArray) {\n return _ArrayDiff(obj1, obj2);\n }\n if (!obj1IsArray && !obj2IsArray) {\n return subtract(obj2, obj1); // Difference is (second - first) NOT (first - second)\n }\n throw TypeError('Cannot calculate difference between 1 array and 1 non-array');\n }\n\n /**\n * Difference of elements in 2 arrays\n *\n * @param {Array} arr1 Array 1\n * @param {Array} arr2 Array 2\n * @return {Array} resulting array\n */\n function _ArrayDiff(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n throw RangeError('Not all sub-arrays have the same length');\n }\n var result = [];\n var size = arr1.length;\n for (var i = 0; i < size; i++) {\n result.push(_ElementDiff(arr1[i], arr2[i]));\n }\n return result;\n }\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { resize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ones';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createOnes = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Create a matrix filled with ones. The created matrix can have one or\n * multiple dimensions.\n *\n * Syntax:\n *\n * math.ones(m)\n * math.ones(m, format)\n * math.ones(m, n)\n * math.ones(m, n, format)\n * math.ones([m, n])\n * math.ones([m, n], format)\n * math.ones([m, n, p, ...])\n * math.ones([m, n, p, ...], format)\n *\n * Examples:\n *\n * math.ones() // returns []\n * math.ones(3) // returns [1, 1, 1]\n * math.ones(3, 2) // returns [[1, 1], [1, 1], [1, 1]]\n * math.ones(3, 2, 'dense') // returns Dense Matrix [[1, 1], [1, 1], [1, 1]]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.ones(math.size(A)) // returns [[1, 1, 1], [1, 1, 1]]\n *\n * See also:\n *\n * zeros, identity, size, range\n *\n * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Array | Matrix | number} A matrix filled with ones\n */\n return typed('ones', {\n '': function _() {\n return config.matrix === 'Array' ? _ones([]) : _ones([], 'default');\n },\n // math.ones(m, n, p, ..., format)\n // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this\n '...number | BigNumber | string': function numberBigNumberString(size) {\n var last = size[size.length - 1];\n if (typeof last === 'string') {\n var format = size.pop();\n return _ones(size, format);\n } else if (config.matrix === 'Array') {\n return _ones(size);\n } else {\n return _ones(size, 'default');\n }\n },\n Array: _ones,\n Matrix: function Matrix(size) {\n var format = size.storage();\n return _ones(size.valueOf(), format);\n },\n 'Array | Matrix, string': function ArrayMatrixString(size, format) {\n return _ones(size.valueOf(), format);\n }\n });\n\n /**\n * Create an Array or Matrix with ones\n * @param {Array} size\n * @param {string} [format='default']\n * @return {Array | Matrix}\n * @private\n */\n function _ones(size, format) {\n var hasBigNumbers = _normalize(size);\n var defaultValue = hasBigNumbers ? new BigNumber(1) : 1;\n _validate(size);\n if (format) {\n // return a matrix\n var m = matrix(format);\n if (size.length > 0) {\n return m.resize(size, defaultValue);\n }\n return m;\n } else {\n // return an Array\n var arr = [];\n if (size.length > 0) {\n return resize(arr, size, defaultValue);\n }\n return arr;\n }\n }\n\n // replace BigNumbers with numbers, returns true if size contained BigNumbers\n function _normalize(size) {\n var hasBigNumbers = false;\n size.forEach(function (value, index, arr) {\n if (isBigNumber(value)) {\n hasBigNumbers = true;\n arr[index] = value.toNumber();\n }\n });\n return hasBigNumbers;\n }\n\n // validate arguments\n function _validate(size) {\n size.forEach(function (value) {\n if (typeof value !== 'number' || !isInteger(value) || value < 0) {\n throw new Error('Parameters in function ones must be positive integers');\n }\n });\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { noBignumber, noMatrix } from '../../utils/noop.js';\nvar name = 'range';\nvar dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive'];\nexport var createRange = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n } = _ref;\n /**\n * Create an array from a range.\n * By default, the range end is excluded. This can be customized by providing\n * an extra parameter `includeEnd`.\n *\n * Syntax:\n *\n * math.range(str [, includeEnd]) // Create a range from a string,\n * // where the string contains the\n * // start, optional step, and end,\n * // separated by a colon.\n * math.range(start, end [, includeEnd]) // Create a range with start and\n * // end and a step size of 1.\n * math.range(start, end, step [, includeEnd]) // Create a range with start, step,\n * // and end.\n *\n * Where:\n *\n * - `str: string`\n * A string 'start:end' or 'start:step:end'\n * - `start: {number | BigNumber | Unit}`\n * Start of the range\n * - `end: number | BigNumber | Unit`\n * End of the range, excluded by default, included when parameter includeEnd=true\n * - `step: number | BigNumber | Unit`\n * Step size. Default value is 1.\n * - `includeEnd: boolean`\n * Option to specify whether to include the end or not. False by default.\n *\n * Examples:\n *\n * math.range(2, 6) // [2, 3, 4, 5]\n * math.range(2, -3, -1) // [2, 1, 0, -1, -2]\n * math.range('2:1:6') // [2, 3, 4, 5]\n * math.range(2, 6, true) // [2, 3, 4, 5, 6]\n * math.range(math.unit(2, 'm'), math.unit(-3, 'm'), math.unit(-1, 'm')) // [2 m, 1 m, 0 m , -1 m, -2 m]\n *\n * See also:\n *\n * ones, zeros, size, subset\n *\n * @param {*} args Parameters describing the ranges `start`, `end`, and optional `step`.\n * @return {Array | Matrix} range\n */\n return typed(name, {\n // TODO: simplify signatures when typed-function supports default values and optional arguments\n\n // TODO: a number or boolean should not be converted to string here\n string: _strRange,\n 'string, boolean': _strRange,\n 'number, number': function numberNumber(start, end) {\n return _out(_range(start, end, 1, false));\n },\n 'number, number, number': function numberNumberNumber(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'number, number, boolean': function numberNumberBoolean(start, end, includeEnd) {\n return _out(_range(start, end, 1, includeEnd));\n },\n 'number, number, number, boolean': function numberNumberNumberBoolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(start, end) {\n var BigNumber = start.constructor;\n return _out(_range(start, end, new BigNumber(1), false));\n },\n 'BigNumber, BigNumber, BigNumber': function BigNumberBigNumberBigNumber(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'BigNumber, BigNumber, boolean': function BigNumberBigNumberBoolean(start, end, includeEnd) {\n var BigNumber = start.constructor;\n return _out(_range(start, end, new BigNumber(1), includeEnd));\n },\n 'BigNumber, BigNumber, BigNumber, boolean': function BigNumberBigNumberBigNumberBoolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n },\n 'Unit, Unit, Unit': function UnitUnitUnit(start, end, step) {\n return _out(_range(start, end, step, false));\n },\n 'Unit, Unit, Unit, boolean': function UnitUnitUnitBoolean(start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd));\n }\n });\n function _out(arr) {\n if (config.matrix === 'Matrix') {\n return matrix ? matrix(arr) : noMatrix();\n }\n return arr;\n }\n function _strRange(str, includeEnd) {\n var r = _parse(str);\n if (!r) {\n throw new SyntaxError('String \"' + str + '\" is no valid range');\n }\n if (config.number === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return _out(_range(bignumber(r.start), bignumber(r.end), bignumber(r.step)), includeEnd);\n } else {\n return _out(_range(r.start, r.end, r.step, includeEnd));\n }\n }\n\n /**\n * Create a range with numbers or BigNumbers\n * @param {number | BigNumber | Unit} start\n * @param {number | BigNumber | Unit} end\n * @param {number | BigNumber | Unit} step\n * @param {boolean} includeEnd\n * @returns {Array} range\n * @private\n */\n function _range(start, end, step, includeEnd) {\n var array = [];\n var ongoing = isPositive(step) ? includeEnd ? smallerEq : smaller : includeEnd ? largerEq : larger;\n var x = start;\n while (ongoing(x, end)) {\n array.push(x);\n x = add(x, step);\n }\n return array;\n }\n\n /**\n * Parse a string into a range,\n * The string contains the start, optional step, and end, separated by a colon.\n * If the string does not contain a valid range, null is returned.\n * For example str='0:2:11'.\n * @param {string} str\n * @return {{start: number, end: number, step: number} | null} range Object containing properties start, end, step\n * @private\n */\n function _parse(str) {\n var args = str.split(':');\n\n // number\n var nums = args.map(function (arg) {\n // use Number and not parseFloat as Number returns NaN on invalid garbage in the string\n return Number(arg);\n });\n var invalid = nums.some(function (num) {\n return isNaN(num);\n });\n if (invalid) {\n return null;\n }\n switch (nums.length) {\n case 2:\n return {\n start: nums[0],\n end: nums[1],\n step: 1\n };\n case 3:\n return {\n start: nums[0],\n end: nums[2],\n step: nums[1]\n };\n default:\n return null;\n }\n }\n});", "export function noBignumber() {\n throw new Error('No \"bignumber\" implementation available');\n}\nexport function noFraction() {\n throw new Error('No \"fraction\" implementation available');\n}\nexport function noMatrix() {\n throw new Error('No \"matrix\" implementation available');\n}\nexport function noIndex() {\n throw new Error('No \"index\" implementation available');\n}\nexport function noSubset() {\n throw new Error('No \"matrix\" implementation available');\n}", "import { reshape as arrayReshape } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'reshape';\nvar dependencies = ['typed', 'isInteger', 'matrix'];\nexport var createReshape = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n /**\n * Reshape a multi dimensional array to fit the specified dimensions\n *\n * Syntax:\n *\n * math.reshape(x, sizes)\n *\n * Examples:\n *\n * math.reshape([1, 2, 3, 4, 5, 6], [2, 3])\n * // returns Array [[1, 2, 3], [4, 5, 6]]\n *\n * math.reshape([[1, 2], [3, 4]], [1, 4])\n * // returns Array [[1, 2, 3, 4]]\n *\n * math.reshape([[1, 2], [3, 4]], [4])\n * // returns Array [1, 2, 3, 4]\n *\n * const x = math.matrix([1, 2, 3, 4, 5, 6, 7, 8])\n * math.reshape(x, [2, 2, 2])\n * // returns Matrix [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]\n *\n * math.reshape([1, 2, 3, 4], [-1, 2])\n * // returns Matrix [[1, 2], [3, 4]]\n *\n * See also:\n *\n * size, squeeze, resize\n *\n * @param {Array | Matrix | *} x Matrix to be reshaped\n * @param {number[]} sizes One dimensional array with integral sizes for\n * each dimension. One -1 is allowed as wildcard,\n * which calculates this dimension automatically.\n *\n * @return {* | Array | Matrix} A reshaped clone of matrix `x`\n *\n * @throws {TypeError} If `sizes` does not contain solely integers\n * @throws {DimensionError} If the product of the new dimension sizes does\n * not equal that of the old ones\n */\n return typed(name, {\n 'Matrix, Array': function MatrixArray(x, sizes) {\n return x.reshape(sizes, true);\n },\n 'Array, Array': function ArrayArray(x, sizes) {\n sizes.forEach(function (size) {\n if (!isInteger(size)) {\n throw new TypeError('Invalid size for dimension: ' + size);\n }\n });\n return arrayReshape(x, sizes);\n }\n });\n});", "import { isBigNumber, isMatrix } from '../../utils/is.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nimport { isInteger } from '../../utils/number.js';\nimport { format } from '../../utils/string.js';\nimport { clone } from '../../utils/object.js';\nimport { resize as arrayResize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'resize';\nvar dependencies = ['config', 'matrix'];\nexport var createResize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n matrix\n } = _ref;\n /**\n * Resize a matrix\n *\n * Syntax:\n *\n * math.resize(x, size)\n * math.resize(x, size, defaultValue)\n *\n * Examples:\n *\n * math.resize([1, 2, 3, 4, 5], [3]) // returns Array [1, 2, 3]\n * math.resize([1, 2, 3], [5], 0) // returns Array [1, 2, 3, 0, 0]\n * math.resize(2, [2, 3], 0) // returns Matrix [[2, 0, 0], [0, 0, 0]]\n * math.resize(\"hello\", [8], \"!\") // returns string 'hello!!!'\n *\n * See also:\n *\n * size, squeeze, subset, reshape\n *\n * @param {Array | Matrix | *} x Matrix to be resized\n * @param {Array | Matrix} size One dimensional array with numbers\n * @param {number | string} [defaultValue=0] Zero by default, except in\n * case of a string, in that case\n * defaultValue = ' '\n * @return {* | Array | Matrix} A resized clone of matrix `x`\n */\n // TODO: rework resize to a typed-function\n return function resize(x, size, defaultValue) {\n if (arguments.length !== 2 && arguments.length !== 3) {\n throw new ArgumentsError('resize', arguments.length, 2, 3);\n }\n if (isMatrix(size)) {\n size = size.valueOf(); // get Array\n }\n if (isBigNumber(size[0])) {\n // convert bignumbers to numbers\n size = size.map(function (value) {\n return !isBigNumber(value) ? value : value.toNumber();\n });\n }\n\n // check x is a Matrix\n if (isMatrix(x)) {\n // use optimized matrix implementation, return copy\n return x.resize(size, defaultValue, true);\n }\n if (typeof x === 'string') {\n // resize string\n return _resizeString(x, size, defaultValue);\n }\n\n // check result should be a matrix\n var asMatrix = Array.isArray(x) ? false : config.matrix !== 'Array';\n if (size.length === 0) {\n // output a scalar\n while (Array.isArray(x)) {\n x = x[0];\n }\n return clone(x);\n } else {\n // output an array/matrix\n if (!Array.isArray(x)) {\n x = [x];\n }\n x = clone(x);\n var res = arrayResize(x, size, defaultValue);\n return asMatrix ? matrix(res) : res;\n }\n };\n\n /**\n * Resize a string\n * @param {string} str\n * @param {number[]} size\n * @param {string} [defaultChar=' ']\n * @private\n */\n function _resizeString(str, size, defaultChar) {\n if (defaultChar !== undefined) {\n if (typeof defaultChar !== 'string' || defaultChar.length !== 1) {\n throw new TypeError('Single character expected as defaultValue');\n }\n } else {\n defaultChar = ' ';\n }\n if (size.length !== 1) {\n throw new DimensionError(size.length, 1);\n }\n var len = size[0];\n if (typeof len !== 'number' || !isInteger(len)) {\n throw new TypeError('Invalid size, must contain positive integers ' + '(size: ' + format(size) + ')');\n }\n if (str.length > len) {\n return str.substring(0, len);\n } else if (str.length < len) {\n var res = str;\n for (var i = 0, ii = len - str.length; i < ii; i++) {\n res += defaultChar;\n }\n return res;\n } else {\n return str;\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { arraySize } from '../../utils/array.js';\nvar name = 'rotate';\nvar dependencies = ['typed', 'multiply', 'rotationMatrix'];\nexport var createRotate = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n multiply,\n rotationMatrix\n } = _ref;\n /**\n * Rotate a vector of size 1x2 counter-clockwise by a given angle\n * Rotate a vector of size 1x3 counter-clockwise by a given angle around the given axis\n *\n * Syntax:\n *\n * math.rotate(w, theta)\n * math.rotate(w, theta, v)\n *\n * Examples:\n *\n * math.rotate([11, 12], math.pi / 2) // returns [-12, 11]\n * math.rotate(matrix([11, 12]), math.pi / 2) // returns [-12, 11]\n *\n * math.rotate([1, 0, 0], unit('90deg'), [0, 0, 1]) // returns [0, 1, 0]\n * math.rotate(matrix([1, 0, 0]), unit('90deg'), [0, 0, 1]) // returns Matrix [0, 1, 0]\n *\n * math.rotate([1, 0], math.complex(1 + i)) // returns [cos(1 + i) - sin(1 + i), sin(1 + i) + cos(1 + i)]\n *\n * See also:\n *\n * matrix, rotationMatrix\n *\n * @param {Array | Matrix} w Vector to rotate\n * @param {number | BigNumber | Complex | Unit} theta Rotation angle\n * @param {Array | Matrix} [v] Rotation axis\n * @return {Array | Matrix} Multiplication of the rotation matrix and w\n */\n return typed(name, {\n 'Array , number | BigNumber | Complex | Unit': function ArrayNumberBigNumberComplexUnit(w, theta) {\n _validateSize(w, 2);\n var matrixRes = multiply(rotationMatrix(theta), w);\n return matrixRes.toArray();\n },\n 'Matrix , number | BigNumber | Complex | Unit': function MatrixNumberBigNumberComplexUnit(w, theta) {\n _validateSize(w, 2);\n return multiply(rotationMatrix(theta), w);\n },\n 'Array, number | BigNumber | Complex | Unit, Array | Matrix': function ArrayNumberBigNumberComplexUnitArrayMatrix(w, theta, v) {\n _validateSize(w, 3);\n var matrixRes = multiply(rotationMatrix(theta, v), w);\n return matrixRes;\n },\n 'Matrix, number | BigNumber | Complex | Unit, Array | Matrix': function MatrixNumberBigNumberComplexUnitArrayMatrix(w, theta, v) {\n _validateSize(w, 3);\n return multiply(rotationMatrix(theta, v), w);\n }\n });\n function _validateSize(v, expectedSize) {\n var actualSize = Array.isArray(v) ? arraySize(v) : v.size();\n if (actualSize.length > 2) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n if (actualSize.length === 2 && actualSize[1] !== 1) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n if (actualSize[0] !== expectedSize) {\n throw new RangeError(\"Vector must be of dimensions 1x\".concat(expectedSize));\n }\n }\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'rotationMatrix';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'addScalar', 'unaryMinus', 'norm', 'matrix', 'BigNumber', 'DenseMatrix', 'SparseMatrix', 'cos', 'sin'];\nexport var createRotationMatrix = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n addScalar,\n unaryMinus,\n norm,\n BigNumber,\n matrix,\n DenseMatrix,\n SparseMatrix,\n cos,\n sin\n } = _ref;\n /**\n * Create a 2-dimensional counter-clockwise rotation matrix (2x2) for a given angle (expressed in radians).\n * Create a 2-dimensional counter-clockwise rotation matrix (3x3) by a given angle (expressed in radians) around a given axis (1x3).\n *\n * Syntax:\n *\n * math.rotationMatrix(theta)\n * math.rotationMatrix(theta, format)\n * math.rotationMatrix(theta, [v])\n * math.rotationMatrix(theta, [v], format)\n *\n * Examples:\n *\n * math.rotationMatrix(math.pi / 2) // returns [[0, -1], [1, 0]]\n * math.rotationMatrix(math.bignumber(1)) // returns [[bignumber(cos(1)), bignumber(-sin(1))], [bignumber(sin(1)), bignumber(cos(1))]]\n * math.rotationMatrix(math.complex(1 + i)) // returns [[cos(1 + i), -sin(1 + i)], [sin(1 + i), cos(1 + i)]]\n * math.rotationMatrix(math.unit('1rad')) // returns [[cos(1), -sin(1)], [sin(1), cos(1)]]\n *\n * math.rotationMatrix(math.pi / 2, [0, 1, 0]) // returns [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]\n * math.rotationMatrix(math.pi / 2, matrix([0, 1, 0])) // returns matrix([[0, 0, 1], [0, 1, 0], [-1, 0, 0]])\n *\n *\n * See also:\n *\n * matrix, cos, sin\n *\n *\n * @param {number | BigNumber | Complex | Unit} theta Rotation angle\n * @param {Array | Matrix} [v] Rotation axis\n * @param {string} [format] Result Matrix storage format\n * @return {Array | Matrix} Rotation matrix\n */\n\n return typed(name, {\n '': function _() {\n return config.matrix === 'Matrix' ? matrix([]) : [];\n },\n string: function string(format) {\n return matrix(format);\n },\n 'number | BigNumber | Complex | Unit': function numberBigNumberComplexUnit(theta) {\n return _rotationMatrix2x2(theta, config.matrix === 'Matrix' ? 'dense' : undefined);\n },\n 'number | BigNumber | Complex | Unit, string': function numberBigNumberComplexUnitString(theta, format) {\n return _rotationMatrix2x2(theta, format);\n },\n 'number | BigNumber | Complex | Unit, Array': function numberBigNumberComplexUnitArray(theta, v) {\n var matrixV = matrix(v);\n _validateVector(matrixV);\n return _rotationMatrix3x3(theta, matrixV, undefined);\n },\n 'number | BigNumber | Complex | Unit, Matrix': function numberBigNumberComplexUnitMatrix(theta, v) {\n _validateVector(v);\n var storageType = v.storage() || (config.matrix === 'Matrix' ? 'dense' : undefined);\n return _rotationMatrix3x3(theta, v, storageType);\n },\n 'number | BigNumber | Complex | Unit, Array, string': function numberBigNumberComplexUnitArrayString(theta, v, format) {\n var matrixV = matrix(v);\n _validateVector(matrixV);\n return _rotationMatrix3x3(theta, matrixV, format);\n },\n 'number | BigNumber | Complex | Unit, Matrix, string': function numberBigNumberComplexUnitMatrixString(theta, v, format) {\n _validateVector(v);\n return _rotationMatrix3x3(theta, v, format);\n }\n });\n\n /**\n * Returns 2x2 matrix of 2D rotation of angle theta\n *\n * @param {number | BigNumber | Complex | Unit} theta The rotation angle\n * @param {string} format The result Matrix storage format\n * @returns {Matrix}\n * @private\n */\n function _rotationMatrix2x2(theta, format) {\n var Big = isBigNumber(theta);\n var minusOne = Big ? new BigNumber(-1) : -1;\n var cosTheta = cos(theta);\n var sinTheta = sin(theta);\n var data = [[cosTheta, multiplyScalar(minusOne, sinTheta)], [sinTheta, cosTheta]];\n return _convertToFormat(data, format);\n }\n function _validateVector(v) {\n var size = v.size();\n if (size.length < 1 || size[0] !== 3) {\n throw new RangeError('Vector must be of dimensions 1x3');\n }\n }\n function _mul(array) {\n return array.reduce((p, curr) => multiplyScalar(p, curr));\n }\n function _convertToFormat(data, format) {\n if (format) {\n if (format === 'sparse') {\n return new SparseMatrix(data);\n }\n if (format === 'dense') {\n return new DenseMatrix(data);\n }\n throw new TypeError(\"Unknown matrix type \\\"\".concat(format, \"\\\"\"));\n }\n return data;\n }\n\n /**\n * Returns a 3x3 matrix of rotation of angle theta around vector v\n *\n * @param {number | BigNumber | Complex | Unit} theta The rotation angle\n * @param {Matrix} v The rotation axis vector\n * @param {string} format The storage format of the resulting matrix\n * @returns {Matrix}\n * @private\n */\n function _rotationMatrix3x3(theta, v, format) {\n var normV = norm(v);\n if (normV === 0) {\n throw new RangeError('Rotation around zero vector');\n }\n var Big = isBigNumber(theta) ? BigNumber : null;\n var one = Big ? new Big(1) : 1;\n var minusOne = Big ? new Big(-1) : -1;\n var vx = Big ? new Big(v.get([0]) / normV) : v.get([0]) / normV;\n var vy = Big ? new Big(v.get([1]) / normV) : v.get([1]) / normV;\n var vz = Big ? new Big(v.get([2]) / normV) : v.get([2]) / normV;\n var c = cos(theta);\n var oneMinusC = addScalar(one, unaryMinus(c));\n var s = sin(theta);\n var r11 = addScalar(c, _mul([vx, vx, oneMinusC]));\n var r12 = addScalar(_mul([vx, vy, oneMinusC]), _mul([minusOne, vz, s]));\n var r13 = addScalar(_mul([vx, vz, oneMinusC]), _mul([vy, s]));\n var r21 = addScalar(_mul([vx, vy, oneMinusC]), _mul([vz, s]));\n var r22 = addScalar(c, _mul([vy, vy, oneMinusC]));\n var r23 = addScalar(_mul([vy, vz, oneMinusC]), _mul([minusOne, vx, s]));\n var r31 = addScalar(_mul([vx, vz, oneMinusC]), _mul([minusOne, vy, s]));\n var r32 = addScalar(_mul([vy, vz, oneMinusC]), _mul([vx, s]));\n var r33 = addScalar(c, _mul([vz, vz, oneMinusC]));\n var data = [[r11, r12, r13], [r21, r22, r23], [r31, r32, r33]];\n return _convertToFormat(data, format);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { validateIndex } from '../../utils/array.js';\nvar name = 'row';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\nexport var createRow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n /**\n * Return a row from a Matrix.\n *\n * Syntax:\n *\n * math.row(value, index)\n *\n * Example:\n *\n * // get a row\n * const d = [[1, 2], [3, 4]]\n * math.row(d, 1) // returns [[3, 4]]\n *\n * See also:\n *\n * column\n *\n * @param {Array | Matrix } value An array or matrix\n * @param {number} row The index of the row\n * @return {Array | Matrix} The retrieved row\n */\n return typed(name, {\n 'Matrix, number': _row,\n 'Array, number': function ArrayNumber(value, row) {\n return _row(matrix(clone(value)), row).valueOf();\n }\n });\n\n /**\n * Retrieve a row of a matrix\n * @param {Matrix } value A matrix\n * @param {number} row The index of the row\n * @return {Matrix} The retrieved row\n */\n function _row(value, row) {\n // check dimensions\n if (value.size().length !== 2) {\n throw new Error('Only two dimensional matrix is supported');\n }\n validateIndex(row, value.size()[0]);\n var columnRange = range(0, value.size()[1]);\n var index = new Index(row, columnRange);\n var result = value.subset(index);\n return isMatrix(result) ? result : matrix([[result]]);\n }\n});", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { noMatrix } from '../../utils/noop.js';\nvar name = 'size';\nvar dependencies = ['typed', 'config', '?matrix'];\nexport var createSize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix\n } = _ref;\n /**\n * Calculate the size of a matrix or scalar.\n *\n * Syntax:\n *\n * math.size(x)\n *\n * Examples:\n *\n * math.size(2.3) // returns []\n * math.size('hello world') // returns [11]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.size(A) // returns [2, 3]\n * math.size(math.range(1,6)) // returns [5]\n *\n * See also:\n *\n * count, resize, squeeze, subset\n *\n * @param {boolean | number | Complex | Unit | string | Array | Matrix} x A matrix\n * @return {Array | Matrix} A vector with size of `x`.\n */\n return typed(name, {\n Matrix: function Matrix(x) {\n return x.create(x.size());\n },\n Array: arraySize,\n string: function string(x) {\n return config.matrix === 'Array' ? [x.length] : matrix([x.length]);\n },\n 'number | Complex | BigNumber | Unit | boolean | null': function numberComplexBigNumberUnitBooleanNull(x) {\n // scalar\n return config.matrix === 'Array' ? [] : matrix ? matrix([]) : noMatrix();\n }\n });\n});", "import { clone } from '../../utils/object.js';\nimport { squeeze as arraySqueeze } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'squeeze';\nvar dependencies = ['typed', 'matrix'];\nexport var createSqueeze = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix\n } = _ref;\n /**\n * Squeeze a matrix, remove inner and outer singleton dimensions from a matrix.\n *\n * Syntax:\n *\n * math.squeeze(x)\n *\n * Examples:\n *\n * math.squeeze([3]) // returns 3\n * math.squeeze([[3]]) // returns 3\n *\n * const A = math.zeros(3, 1) // returns [[0], [0], [0]] (size 3x1)\n * math.squeeze(A) // returns [0, 0, 0] (size 3)\n *\n * const B = math.zeros(1, 3) // returns [[0, 0, 0]] (size 1x3)\n * math.squeeze(B) // returns [0, 0, 0] (size 3)\n *\n * // only inner and outer dimensions are removed\n * const C = math.zeros(2, 1, 3) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3)\n * math.squeeze(C) // returns [[[0, 0, 0]], [[0, 0, 0]]] (size 2x1x3)\n *\n * See also:\n *\n * subset\n *\n * @param {Matrix | Array} x Matrix to be squeezed\n * @return {Matrix | Array} Squeezed matrix\n */\n return typed(name, {\n Array: function Array(x) {\n return arraySqueeze(clone(x));\n },\n Matrix: function Matrix(x) {\n var res = arraySqueeze(x.toArray());\n // FIXME: return the same type of matrix as the input\n return Array.isArray(res) ? matrix(res) : res;\n },\n any: function any(x) {\n // scalar\n return clone(x);\n }\n });\n});", "import { isIndex } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { isEmptyIndex, validateIndex, validateIndexSourceSize } from '../../utils/array.js';\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js';\nimport { DimensionError } from '../../error/DimensionError.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'subset';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createSubset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n /**\n * Get or set a subset of a matrix or string.\n *\n * Syntax:\n * math.subset(value, index) // retrieve a subset\n * math.subset(value, index, replacement [, defaultValue]) // replace a subset\n *\n * Examples:\n *\n * // get a subset\n * const d = [[1, 2], [3, 4]]\n * math.subset(d, math.index(1, 0)) // returns 3\n * math.subset(d, math.index([0, 1], 1)) // returns [[2], [4]]\n * math.subset(d, math.index([false, true], 0)) // returns [[3]]\n *\n * // replace a subset\n * const e = []\n * const f = math.subset(e, math.index(0, [0, 2]), [5, 6]) // f = [[5, 0, 6]]\n * const g = math.subset(f, math.index(1, 1), 7, 0) // g = [[5, 0, 6], [0, 7, 0]]\n * math.subset(g, math.index([false, true], 1), 8) // returns [[5, 0, 6], [0, 8, 0]]\n *\n * // get submatrix using ranges\n * const M = [\n * [1,2,3],\n * [4,5,6],\n * [7,8,9]\n * ]\n * math.subset(M, math.index(math.range(0,2), math.range(0,3))) // [[1, 2, 3], [4, 5, 6]]\n *\n * See also:\n *\n * size, resize, squeeze, index\n *\n * @param {Array | Matrix | string} matrix An array, matrix, or string\n * @param {Index} index\n * For each dimension of the target, specifies an index or a list of\n * indices to fetch or set. `subset` uses the cartesian product of\n * the indices specified in each dimension.\n * @param {*} [replacement] An array, matrix, or scalar.\n * If provided, the subset is replaced with replacement.\n * If not provided, the subset is returned\n * @param {*} [defaultValue=undefined] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * math.matrix elements will be left undefined.\n * @return {Array | Matrix | string} Either the retrieved subset or the updated matrix.\n */\n\n return typed(name, {\n // get subset\n 'Matrix, Index': function MatrixIndex(value, index) {\n if (isEmptyIndex(index)) {\n return matrix();\n }\n validateIndexSourceSize(value, index);\n return value.subset(index);\n },\n 'Array, Index': typed.referTo('Matrix, Index', function (subsetRef) {\n return function (value, index) {\n var subsetResult = subsetRef(matrix(value), index);\n return index.isScalar() ? subsetResult : subsetResult.valueOf();\n };\n }),\n 'Object, Index': _getObjectProperty,\n 'string, Index': _getSubstring,\n // set subset\n 'Matrix, Index, any, any': function MatrixIndexAnyAny(value, index, replacement, defaultValue) {\n if (isEmptyIndex(index)) {\n return value;\n }\n validateIndexSourceSize(value, index);\n return value.clone().subset(index, _broadcastReplacement(replacement, index), defaultValue);\n },\n 'Array, Index, any, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement, defaultValue) {\n var subsetResult = subsetRef(matrix(value), index, replacement, defaultValue);\n return subsetResult.isMatrix ? subsetResult.valueOf() : subsetResult;\n };\n }),\n 'Array, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement) {\n return subsetRef(matrix(value), index, replacement, undefined).valueOf();\n };\n }),\n 'Matrix, Index, any': typed.referTo('Matrix, Index, any, any', function (subsetRef) {\n return function (value, index, replacement) {\n return subsetRef(value, index, replacement, undefined);\n };\n }),\n 'string, Index, string': _setSubstring,\n 'string, Index, string, string': _setSubstring,\n 'Object, Index, any': _setObjectProperty\n });\n\n /**\n * Broadcasts a replacment value to be the same size as index\n * @param {number | BigNumber | Array | Matrix} replacement Replacement value to try to broadcast\n * @param {*} index Index value\n * @returns broadcasted replacement that matches the size of index\n */\n\n function _broadcastReplacement(replacement, index) {\n if (typeof replacement === 'string') {\n throw new Error('can\\'t boradcast a string');\n }\n if (index._isScalar) {\n return replacement;\n }\n var indexSize = index.size();\n if (indexSize.every(d => d > 0)) {\n try {\n return add(replacement, zeros(indexSize));\n } catch (error) {\n return replacement;\n }\n } else {\n return replacement;\n }\n }\n});\n\n/**\n * Retrieve a subset of a string\n * @param {string} str string from which to get a substring\n * @param {Index} index An index or list of indices (character positions)\n * @returns {string} substring\n * @private\n */\nfunction _getSubstring(str, index) {\n if (!isIndex(index)) {\n // TODO: better error message\n throw new TypeError('Index expected');\n }\n if (isEmptyIndex(index)) {\n return '';\n }\n validateIndexSourceSize(Array.from(str), index);\n if (index.size().length !== 1) {\n throw new DimensionError(index.size().length, 1);\n }\n\n // validate whether the range is out of range\n var strLen = str.length;\n validateIndex(index.min()[0], strLen);\n validateIndex(index.max()[0], strLen);\n var range = index.dimension(0);\n var substr = '';\n range.forEach(function (v) {\n substr += str.charAt(v);\n });\n return substr;\n}\n\n/**\n * Replace a substring in a string\n * @param {string} str string to be replaced\n * @param {Index} index An index or list of indices (character positions)\n * @param {string} replacement Replacement string\n * @param {string} [defaultValue] Default value to be used when resizing\n * the string. is ' ' by default\n * @returns {string} result\n * @private\n */\nfunction _setSubstring(str, index, replacement, defaultValue) {\n if (!index || index.isIndex !== true) {\n // TODO: better error message\n throw new TypeError('Index expected');\n }\n if (isEmptyIndex(index)) {\n return str;\n }\n validateIndexSourceSize(Array.from(str), index);\n if (index.size().length !== 1) {\n throw new DimensionError(index.size().length, 1);\n }\n if (defaultValue !== undefined) {\n if (typeof defaultValue !== 'string' || defaultValue.length !== 1) {\n throw new TypeError('Single character expected as defaultValue');\n }\n } else {\n defaultValue = ' ';\n }\n var range = index.dimension(0);\n var len = range.size()[0];\n if (len !== replacement.length) {\n throw new DimensionError(range.size()[0], replacement.length);\n }\n\n // validate whether the range is out of range\n var strLen = str.length;\n validateIndex(index.min()[0]);\n validateIndex(index.max()[0]);\n\n // copy the string into an array with characters\n var chars = [];\n for (var i = 0; i < strLen; i++) {\n chars[i] = str.charAt(i);\n }\n range.forEach(function (v, i) {\n chars[v] = replacement.charAt(i[0]);\n });\n\n // initialize undefined characters with a space\n if (chars.length > strLen) {\n for (var _i = strLen - 1, _len = chars.length; _i < _len; _i++) {\n if (!chars[_i]) {\n chars[_i] = defaultValue;\n }\n }\n }\n return chars.join('');\n}\n\n/**\n * Retrieve a property from an object\n * @param {Object} object\n * @param {Index} index\n * @return {*} Returns the value of the property\n * @private\n */\nfunction _getObjectProperty(object, index) {\n if (isEmptyIndex(index)) {\n return undefined;\n }\n if (index.size().length !== 1) {\n throw new DimensionError(index.size(), 1);\n }\n var key = index.dimension(0);\n if (typeof key !== 'string') {\n throw new TypeError('String expected as index to retrieve an object property');\n }\n return getSafeProperty(object, key);\n}\n\n/**\n * Set a property on an object\n * @param {Object} object\n * @param {Index} index\n * @param {*} replacement\n * @return {*} Returns the updated object\n * @private\n */\nfunction _setObjectProperty(object, index, replacement) {\n if (isEmptyIndex(index)) {\n return object;\n }\n if (index.size().length !== 1) {\n throw new DimensionError(index.size(), 1);\n }\n var key = index.dimension(0);\n if (typeof key !== 'string') {\n throw new TypeError('String expected as index to retrieve an object property');\n }\n\n // clone the object, and apply the property to the clone\n var updated = clone(object);\n setSafeProperty(updated, key, replacement);\n return updated;\n}", "import { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'transpose';\nvar dependencies = ['typed', 'matrix'];\nexport var createTranspose = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix\n } = _ref;\n /**\n * Transpose a matrix. All values of the matrix are reflected over its\n * main diagonal. Only applicable to two dimensional matrices containing\n * a vector (i.e. having size `[1,n]` or `[n,1]`). One dimensional\n * vectors and scalars return the input unchanged.\n *\n * Syntax:\n *\n * math.transpose(x)\n *\n * Examples:\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.transpose(A) // returns [[1, 4], [2, 5], [3, 6]]\n *\n * See also:\n *\n * diag, inv, subset, squeeze\n *\n * @param {Array | Matrix} x Matrix to be transposed\n * @return {Array | Matrix} The transposed matrix\n */\n return typed(name, {\n Array: x => transposeMatrix(matrix(x)).valueOf(),\n Matrix: transposeMatrix,\n any: clone // scalars\n });\n function transposeMatrix(x) {\n // matrix size\n var size = x.size();\n\n // result\n var c;\n\n // process dimensions\n switch (size.length) {\n case 1:\n // vector\n c = x.clone();\n break;\n case 2:\n {\n // rows and columns\n var rows = size[0];\n var columns = size[1];\n\n // check columns\n if (columns === 0) {\n // throw exception\n throw new RangeError('Cannot transpose a 2D matrix with no columns (size: ' + format(size) + ')');\n }\n\n // process storage format\n switch (x.storage()) {\n case 'dense':\n c = _denseTranspose(x, rows, columns);\n break;\n case 'sparse':\n c = _sparseTranspose(x, rows, columns);\n break;\n }\n }\n break;\n default:\n // multi dimensional\n throw new RangeError('Matrix must be a vector or two dimensional (size: ' + format(size) + ')');\n }\n return c;\n }\n function _denseTranspose(m, rows, columns) {\n // matrix array\n var data = m._data;\n // transposed matrix data\n var transposed = [];\n var transposedRow;\n // loop columns\n for (var j = 0; j < columns; j++) {\n // initialize row\n transposedRow = transposed[j] = [];\n // loop rows\n for (var i = 0; i < rows; i++) {\n // set data\n transposedRow[i] = clone(data[i][j]);\n }\n }\n // return matrix\n return m.createDenseMatrix({\n data: transposed,\n size: [columns, rows],\n datatype: m._datatype\n });\n }\n function _sparseTranspose(m, rows, columns) {\n // matrix arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // result matrices\n var cvalues = values ? [] : undefined;\n var cindex = [];\n var cptr = [];\n // row counts\n var w = [];\n for (var x = 0; x < rows; x++) {\n w[x] = 0;\n }\n // vars\n var p, l, j;\n // loop values in matrix\n for (p = 0, l = index.length; p < l; p++) {\n // number of values in row\n w[index[p]]++;\n }\n // cumulative sum\n var sum = 0;\n // initialize cptr with the cummulative sum of row counts\n for (var i = 0; i < rows; i++) {\n // update cptr\n cptr.push(sum);\n // update sum\n sum += w[i];\n // update w\n w[i] = cptr[i];\n }\n // update cptr\n cptr.push(sum);\n // loop columns\n for (j = 0; j < columns; j++) {\n // values & index in column\n for (var k0 = ptr[j], k1 = ptr[j + 1], k = k0; k < k1; k++) {\n // C values & index\n var q = w[index[k]]++;\n // C[j, i] = A[i, j]\n cindex[q] = j;\n // check we need to process values (pattern matrix)\n if (values) {\n cvalues[q] = clone(values[k]);\n }\n }\n }\n // return matrix\n return m.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [columns, rows],\n datatype: m._datatype\n });\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'ctranspose';\nvar dependencies = ['typed', 'transpose', 'conj'];\nexport var createCtranspose = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n transpose,\n conj\n } = _ref;\n /**\n * Transpose and complex conjugate a matrix. All values of the matrix are\n * reflected over its main diagonal and then the complex conjugate is\n * taken. This is equivalent to complex conjugation for scalars and\n * vectors.\n *\n * Syntax:\n *\n * math.ctranspose(x)\n *\n * Examples:\n *\n * const A = [[1, 2, 3], [4, 5, math.complex(6,7)]]\n * math.ctranspose(A) // returns [[1, 4], [2, 5], [3, {re:6,im:7}]]\n *\n * See also:\n *\n * transpose, diag, inv, subset, squeeze\n *\n * @param {Array | Matrix} x Matrix to be ctransposed\n * @return {Array | Matrix} The ctransposed matrix\n */\n return typed(name, {\n any: function any(x) {\n return conj(transpose(x));\n }\n });\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { resize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'zeros';\nvar dependencies = ['typed', 'config', 'matrix', 'BigNumber'];\nexport var createZeros = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n BigNumber\n } = _ref;\n /**\n * Create a matrix filled with zeros. The created matrix can have one or\n * multiple dimensions.\n *\n * Syntax:\n *\n * math.zeros(m)\n * math.zeros(m, format)\n * math.zeros(m, n)\n * math.zeros(m, n, format)\n * math.zeros([m, n])\n * math.zeros([m, n], format)\n *\n * Examples:\n *\n * math.zeros() // returns []\n * math.zeros(3) // returns [0, 0, 0]\n * math.zeros(3, 2) // returns [[0, 0], [0, 0], [0, 0]]\n * math.zeros(3, 'dense') // returns [0, 0, 0]\n *\n * const A = [[1, 2, 3], [4, 5, 6]]\n * math.zeros(math.size(A)) // returns [[0, 0, 0], [0, 0, 0]]\n *\n * See also:\n *\n * ones, identity, size, range\n *\n * @param {...(number|BigNumber) | Array} size The size of each dimension of the matrix\n * @param {string} [format] The Matrix storage format\n *\n * @return {Array | Matrix} A matrix filled with zeros\n */\n return typed(name, {\n '': function _() {\n return config.matrix === 'Array' ? _zeros([]) : _zeros([], 'default');\n },\n // math.zeros(m, n, p, ..., format)\n // TODO: more accurate signature '...number | BigNumber, string' as soon as typed-function supports this\n '...number | BigNumber | string': function numberBigNumberString(size) {\n var last = size[size.length - 1];\n if (typeof last === 'string') {\n var format = size.pop();\n return _zeros(size, format);\n } else if (config.matrix === 'Array') {\n return _zeros(size);\n } else {\n return _zeros(size, 'default');\n }\n },\n Array: _zeros,\n Matrix: function Matrix(size) {\n var format = size.storage();\n return _zeros(size.valueOf(), format);\n },\n 'Array | Matrix, string': function ArrayMatrixString(size, format) {\n return _zeros(size.valueOf(), format);\n }\n });\n\n /**\n * Create an Array or Matrix with zeros\n * @param {Array} size\n * @param {string} [format='default']\n * @return {Array | Matrix}\n * @private\n */\n function _zeros(size, format) {\n var hasBigNumbers = _normalize(size);\n var defaultValue = hasBigNumbers ? new BigNumber(0) : 0;\n _validate(size);\n if (format) {\n // return a matrix\n var m = matrix(format);\n if (size.length > 0) {\n return m.resize(size, defaultValue);\n }\n return m;\n } else {\n // return an Array\n var arr = [];\n if (size.length > 0) {\n return resize(arr, size, defaultValue);\n }\n return arr;\n }\n }\n\n // replace BigNumbers with numbers, returns true if size contained BigNumbers\n function _normalize(size) {\n var hasBigNumbers = false;\n size.forEach(function (value, index, arr) {\n if (isBigNumber(value)) {\n hasBigNumbers = true;\n arr[index] = value.toNumber();\n }\n });\n return hasBigNumbers;\n }\n\n // validate arguments\n function _validate(size) {\n size.forEach(function (value) {\n if (typeof value !== 'number' || !isInteger(value) || value < 0) {\n throw new Error('Parameters in function zeros must be positive integers');\n }\n });\n }\n});\n\n// TODO: zeros contains almost the same code as ones. Reuse this?", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'fft';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'multiplyScalar', 'divideScalar', 'exp', 'tau', 'i', 'dotDivide', 'conj', 'pow', 'ceil', 'log2'];\nexport var createFft = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n multiplyScalar,\n divideScalar,\n exp,\n tau,\n i: I,\n dotDivide,\n conj,\n pow,\n ceil,\n log2\n } = _ref;\n /**\n * Calculate N-dimensional fourier transform\n *\n * Syntax:\n *\n * math.fft(arr)\n *\n * Examples:\n *\n * math.fft([[1, 0], [1, 0]]) // returns [[{re:2, im:0}, {re:2, im:0}], [{re:0, im:0}, {re:0, im:0}]]\n *\n *\n * See Also:\n *\n * ifft\n *\n * @param {Array | Matrix} arr An array or matrix\n * @return {Array | Matrix} N-dimensional fourier transformation of the array\n */\n return typed(name, {\n Array: _ndFft,\n Matrix: function Matrix(matrix) {\n return matrix.create(_ndFft(matrix.toArray()));\n }\n });\n\n /**\n * Perform an N-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _ndFft(arr) {\n var size = arraySize(arr);\n if (size.length === 1) return _fft(arr, size[0]);\n // ndFft along dimension 1,...,N-1 then 1dFft along dimension 0\n return _1dFft(arr.map(slice => _ndFft(slice, size.slice(1))), 0);\n }\n\n /**\n * Perform an 1-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @param {number} dim dimension of the array to perform on\n * @return {Array} resulting array\n */\n function _1dFft(arr, dim) {\n var size = arraySize(arr);\n if (dim !== 0) return new Array(size[0]).fill(0).map((_, i) => _1dFft(arr[i], dim - 1));\n if (size.length === 1) return _fft(arr);\n function _transpose(arr) {\n // Swap first 2 dimensions\n var size = arraySize(arr);\n return new Array(size[1]).fill(0).map((_, j) => new Array(size[0]).fill(0).map((_, i) => arr[i][j]));\n }\n return _transpose(_1dFft(_transpose(arr), 1));\n }\n /**\n * Perform an 1-dimensional non-power-of-2 Fourier transform using Chirp-Z Transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _czt(arr) {\n var n = arr.length;\n var w = exp(divideScalar(multiplyScalar(-1, multiplyScalar(I, tau)), n));\n var chirp = [];\n for (var i = 1 - n; i < n; i++) {\n chirp.push(pow(w, divideScalar(pow(i, 2), 2)));\n }\n var N2 = pow(2, ceil(log2(n + n - 1)));\n var xp = [...new Array(n).fill(0).map((_, i) => multiplyScalar(arr[i], chirp[n - 1 + i])), ...new Array(N2 - n).fill(0)];\n var ichirp = [...new Array(n + n - 1).fill(0).map((_, i) => divideScalar(1, chirp[i])), ...new Array(N2 - (n + n - 1)).fill(0)];\n var fftXp = _fft(xp);\n var fftIchirp = _fft(ichirp);\n var fftProduct = new Array(N2).fill(0).map((_, i) => multiplyScalar(fftXp[i], fftIchirp[i]));\n var ifftProduct = dotDivide(conj(_ndFft(conj(fftProduct))), N2);\n var ret = [];\n for (var _i = n - 1; _i < n + n - 1; _i++) {\n ret.push(multiplyScalar(ifftProduct[_i], chirp[_i]));\n }\n return ret;\n }\n /**\n * Perform an 1-dimensional Fourier transform\n *\n * @param {Array} arr The array\n * @return {Array} resulting array\n */\n function _fft(arr) {\n var len = arr.length;\n if (len === 1) return [arr[0]];\n if (len % 2 === 0) {\n var ret = [..._fft(arr.filter((_, i) => i % 2 === 0), len / 2), ..._fft(arr.filter((_, i) => i % 2 === 1), len / 2)];\n for (var k = 0; k < len / 2; k++) {\n var p = ret[k];\n var q = multiplyScalar(ret[k + len / 2], exp(multiplyScalar(multiplyScalar(tau, I), divideScalar(-k, len))));\n ret[k] = addScalar(p, q);\n ret[k + len / 2] = addScalar(p, multiplyScalar(-1, q));\n }\n return ret;\n } else {\n // use chirp-z transform for non-power-of-2 FFT\n return _czt(arr);\n }\n // throw new Error('Can only calculate FFT of power-of-two size')\n }\n});", "import { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'ifft';\nvar dependencies = ['typed', 'fft', 'dotDivide', 'conj'];\nexport var createIfft = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n fft,\n dotDivide,\n conj\n } = _ref;\n /**\n * Calculate N-dimensional inverse fourier transform\n *\n * Syntax:\n *\n * math.ifft(arr)\n *\n * Examples:\n *\n * math.ifft([[2, 2], [0, 0]]) // returns [[{re:1, im:0}, {re:0, im:0}], [{re:1, im:0}, {re:0, im:0}]]\n *\n * See Also:\n *\n * fft\n *\n * @param {Array | Matrix} arr An array or matrix\n * @return {Array | Matrix} N-dimensional fourier transformation of the array\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(arr) {\n var size = isMatrix(arr) ? arr.size() : arraySize(arr);\n return dotDivide(conj(fft(conj(arr))), size.reduce((acc, curr) => acc * curr, 1));\n }\n });\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isUnit, isNumber, isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'solveODE';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'max', 'map', 'abs', 'isPositive', 'isNegative', 'larger', 'smaller', 'matrix', 'bignumber', 'unaryMinus'];\nexport var createSolveODE = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n max,\n map,\n abs,\n isPositive,\n isNegative,\n larger,\n smaller,\n matrix,\n bignumber,\n unaryMinus\n } = _ref;\n /**\n * Numerical Integration of Ordinary Differential Equations\n *\n * Two variable step methods are provided:\n * - \"RK23\": Bogacki\u2013Shampine method\n * - \"RK45\": Dormand-Prince method RK5(4)7M (default)\n *\n * The arguments are expected as follows.\n *\n * - `func` should be the forcing function `f(t, y)`\n * - `tspan` should be a vector of two numbers or units `[tStart, tEnd]`\n * - `y0` the initial state values, should be a scalar or a flat array\n * - `options` should be an object with the following information:\n * - `method` ('RK45'): ['RK23', 'RK45']\n * - `tol` (1e-3): Numeric tolerance of the method, the solver keeps the error estimates less than this value\n * - `firstStep`: Initial step size\n * - `minStep`: minimum step size of the method\n * - `maxStep`: maximum step size of the method\n * - `minDelta` (0.2): minimum ratio of change for the step\n * - `maxDelta` (5): maximum ratio of change for the step\n * - `maxIter` (1e4): maximum number of iterations\n *\n * The returned value is an object with `{t, y}` please note that even though `t` means time, it can represent any other independant variable like `x`:\n * - `t` an array of size `[n]`\n * - `y` the states array can be in two ways\n * - **if `y0` is a scalar:** returns an array-like of size `[n]`\n * - **if `y0` is a flat array-like of size [m]:** returns an array like of size `[n, m]`\n *\n * Syntax:\n *\n * math.solveODE(func, tspan, y0)\n * math.solveODE(func, tspan, y0, options)\n *\n * Examples:\n *\n * function func(t, y) {return y}\n * const tspan = [0, 4]\n * const y0 = 1\n * math.solveODE(func, tspan, y0)\n * math.solveODE(func, tspan, [1, 2])\n * math.solveODE(func, tspan, y0, { method:\"RK23\", maxStep:0.1 })\n *\n * See also:\n *\n * derivative, simplifyCore\n *\n * @param {function} func The forcing function f(t,y)\n * @param {Array | Matrix} tspan The time span\n * @param {number | BigNumber | Unit | Array | Matrix} y0 The initial value\n * @param {Object} [options] Optional configuration options\n * @return {Object} Return an object with t and y values as arrays\n */\n\n function _rk(butcherTableau) {\n // generates an adaptive runge kutta method from it's butcher tableau\n\n return function (f, tspan, y0, options) {\n // adaptive runge kutta methods\n var wrongTSpan = !(tspan.length === 2 && (tspan.every(isNumOrBig) || tspan.every(isUnit)));\n if (wrongTSpan) {\n throw new Error('\"tspan\" must be an Array of two numeric values or two units [tStart, tEnd]');\n }\n var t0 = tspan[0]; // initial time\n var tf = tspan[1]; // final time\n var isForwards = larger(tf, t0);\n var firstStep = options.firstStep;\n if (firstStep !== undefined && !isPositive(firstStep)) {\n throw new Error('\"firstStep\" must be positive');\n }\n var maxStep = options.maxStep;\n if (maxStep !== undefined && !isPositive(maxStep)) {\n throw new Error('\"maxStep\" must be positive');\n }\n var minStep = options.minStep;\n if (minStep && isNegative(minStep)) {\n throw new Error('\"minStep\" must be positive or zero');\n }\n var timeVars = [t0, tf, firstStep, minStep, maxStep].filter(x => x !== undefined);\n if (!(timeVars.every(isNumOrBig) || timeVars.every(isUnit))) {\n throw new Error('Inconsistent type of \"t\" dependant variables');\n }\n var steps = 1; // divide time in this number of steps\n var tol = options.tol ? options.tol : 1e-4; // define a tolerance (must be an option)\n var minDelta = options.minDelta ? options.minDelta : 0.2;\n var maxDelta = options.maxDelta ? options.maxDelta : 5;\n var maxIter = options.maxIter ? options.maxIter : 10000; // stop inifite evaluation if something goes wrong\n var hasBigNumbers = [t0, tf, ...y0, maxStep, minStep].some(isBigNumber);\n var [a, c, b, bp] = hasBigNumbers ? [bignumber(butcherTableau.a), bignumber(butcherTableau.c), bignumber(butcherTableau.b), bignumber(butcherTableau.bp)] : [butcherTableau.a, butcherTableau.c, butcherTableau.b, butcherTableau.bp];\n var h = firstStep ? isForwards ? firstStep : unaryMinus(firstStep) : divide(subtract(tf, t0), steps); // define the first step size\n var t = [t0]; // start the time array\n var y = [y0]; // start the solution array\n\n var deltaB = subtract(b, bp); // b - bp\n\n var n = 0;\n var iter = 0;\n var ongoing = _createOngoing(isForwards);\n var trimStep = _createTrimStep(isForwards);\n // iterate unitil it reaches either the final time or maximum iterations\n while (ongoing(t[n], tf)) {\n var k = [];\n\n // trim the time step so that it doesn't overshoot\n h = trimStep(t[n], tf, h);\n\n // calculate the first value of k\n k.push(f(t[n], y[n]));\n\n // calculate the rest of the values of k\n for (var i = 1; i < c.length; ++i) {\n k.push(f(add(t[n], multiply(c[i], h)), add(y[n], multiply(h, a[i], k))));\n }\n\n // estimate the error by comparing solutions of different orders\n var TE = max(abs(map(multiply(deltaB, k), X => isUnit(X) ? X.value : X)));\n if (TE < tol && tol / TE > 1 / 4) {\n // push solution if within tol\n t.push(add(t[n], h));\n y.push(add(y[n], multiply(h, b, k)));\n n++;\n }\n\n // estimate the delta value that will affect the step size\n var delta = 0.84 * (tol / TE) ** (1 / 5);\n if (smaller(delta, minDelta)) {\n delta = minDelta;\n } else if (larger(delta, maxDelta)) {\n delta = maxDelta;\n }\n delta = hasBigNumbers ? bignumber(delta) : delta;\n h = multiply(h, delta);\n if (maxStep && larger(abs(h), maxStep)) {\n h = isForwards ? maxStep : unaryMinus(maxStep);\n } else if (minStep && smaller(abs(h), minStep)) {\n h = isForwards ? minStep : unaryMinus(minStep);\n }\n iter++;\n if (iter > maxIter) {\n throw new Error('Maximum number of iterations reached, try changing options');\n }\n }\n return {\n t,\n y\n };\n };\n }\n function _rk23(f, tspan, y0, options) {\n // Bogacki\u2013Shampine method\n\n // Define the butcher table\n var a = [[], [1 / 2], [0, 3 / 4], [2 / 9, 1 / 3, 4 / 9]];\n var c = [null, 1 / 2, 3 / 4, 1];\n var b = [2 / 9, 1 / 3, 4 / 9, 0];\n var bp = [7 / 24, 1 / 4, 1 / 3, 1 / 8];\n var butcherTableau = {\n a,\n c,\n b,\n bp\n };\n\n // Solve an adaptive step size rk method\n return _rk(butcherTableau)(f, tspan, y0, options);\n }\n function _rk45(f, tspan, y0, options) {\n // Dormand Prince method\n\n // Define the butcher tableau\n var a = [[], [1 / 5], [3 / 40, 9 / 40], [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]];\n var c = [null, 1 / 5, 3 / 10, 4 / 5, 8 / 9, 1, 1];\n var b = [35 / 384, 0, 500 / 1113, 125 / 192, -2187 / 6784, 11 / 84, 0];\n var bp = [5179 / 57600, 0, 7571 / 16695, 393 / 640, -92097 / 339200, 187 / 2100, 1 / 40];\n var butcherTableau = {\n a,\n c,\n b,\n bp\n };\n\n // Solve an adaptive step size rk method\n return _rk(butcherTableau)(f, tspan, y0, options);\n }\n function _solveODE(f, tspan, y0, opt) {\n var method = opt.method ? opt.method : 'RK45';\n var methods = {\n RK23: _rk23,\n RK45: _rk45\n };\n if (method.toUpperCase() in methods) {\n var methodOptions = _objectSpread({}, opt); // clone the options object\n delete methodOptions.method; // delete the method as it won't be needed\n return methods[method.toUpperCase()](f, tspan, y0, methodOptions);\n } else {\n // throw an error indicating there is no such method\n var methodsWithQuotes = Object.keys(methods).map(x => \"\\\"\".concat(x, \"\\\"\"));\n // generates a string of methods like: \"BDF\", \"RK23\" and \"RK45\"\n var availableMethodsString = \"\".concat(methodsWithQuotes.slice(0, -1).join(', '), \" and \").concat(methodsWithQuotes.slice(-1));\n throw new Error(\"Unavailable method \\\"\".concat(method, \"\\\". Available methods are \").concat(availableMethodsString));\n }\n }\n function _createOngoing(isForwards) {\n // returns the correct function to test if it's still iterating\n return isForwards ? smaller : larger;\n }\n function _createTrimStep(isForwards) {\n var outOfBounds = isForwards ? larger : smaller;\n return function (t, tf, h) {\n var next = add(t, h);\n return outOfBounds(next, tf) ? subtract(tf, t) : h;\n };\n }\n function isNumOrBig(x) {\n // checks if it's a number or bignumber\n return isBigNumber(x) || isNumber(x);\n }\n function _matrixSolveODE(f, T, y0, options) {\n // receives matrices and returns matrices\n var sol = _solveODE(f, T.toArray(), y0.toArray(), options);\n return {\n t: matrix(sol.t),\n y: matrix(sol.y)\n };\n }\n return typed('solveODE', {\n 'function, Array, Array, Object': _solveODE,\n 'function, Matrix, Matrix, Object': _matrixSolveODE,\n 'function, Array, Array': (f, T, y0) => _solveODE(f, T, y0, {}),\n 'function, Matrix, Matrix': (f, T, y0) => _matrixSolveODE(f, T, y0, {}),\n 'function, Array, number | BigNumber | Unit': (f, T, y0) => {\n var sol = _solveODE(f, T, [y0], {});\n return {\n t: sol.t,\n y: sol.y.map(Y => Y[0])\n };\n },\n 'function, Matrix, number | BigNumber | Unit': (f, T, y0) => {\n var sol = _solveODE(f, T.toArray(), [y0], {});\n return {\n t: matrix(sol.t),\n y: matrix(sol.y.map(Y => Y[0]))\n };\n },\n 'function, Array, number | BigNumber | Unit, Object': (f, T, y0, options) => {\n var sol = _solveODE(f, T, [y0], options);\n return {\n t: sol.t,\n y: sol.y.map(Y => Y[0])\n };\n },\n 'function, Matrix, number | BigNumber | Unit, Object': (f, T, y0, options) => {\n var sol = _solveODE(f, T.toArray(), [y0], options);\n return {\n t: matrix(sol.t),\n y: matrix(sol.y.map(Y => Y[0]))\n };\n }\n });\n});", "import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };", "import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };", "function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };", "import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };", "/* eslint-disable no-loss-of-precision */\n\nimport { deepMap } from '../../utils/collection.js';\nimport { sign } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'erf';\nvar dependencies = ['typed'];\nexport var createErf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the erf function of a value using a rational Chebyshev\n * approximations for different intervals of x.\n *\n * This is a translation of W. J. Cody's Fortran implementation from 1987\n * ( https://www.netlib.org/specfun/erf ). See the AMS publication\n * \"Rational Chebyshev Approximations for the Error Function\" by W. J. Cody\n * for an explanation of this process.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.erf(x)\n *\n * Examples:\n *\n * math.erf(0.2) // returns 0.22270258921047847\n * math.erf(-0.5) // returns -0.5204998778130465\n * math.erf(4) // returns 0.9999999845827421\n *\n * See also:\n * zeta\n *\n * @param {number | Array | Matrix} x A real number\n * @return {number | Array | Matrix} The erf of `x`\n */\n return typed('name', {\n number: function number(x) {\n var y = Math.abs(x);\n if (y >= MAX_NUM) {\n return sign(x);\n }\n if (y <= THRESH) {\n return sign(x) * erf1(y);\n }\n if (y <= 4.0) {\n return sign(x) * (1 - erfc2(y));\n }\n return sign(x) * (1 - erfc3(y));\n },\n 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self))\n\n // TODO: For complex numbers, use the approximation for the Faddeeva function\n // from \"More Efficient Computation of the Complex Error Function\" (AMS)\n });\n\n /**\n * Approximates the error function erf() for x <= 0.46875 using this function:\n * n\n * erf(x) = x * sum (p_j * x^(2j)) / (q_j * x^(2j))\n * j=0\n */\n function erf1(y) {\n var ysq = y * y;\n var xnum = P[0][4] * ysq;\n var xden = ysq;\n var i;\n for (i = 0; i < 3; i += 1) {\n xnum = (xnum + P[0][i]) * ysq;\n xden = (xden + Q[0][i]) * ysq;\n }\n return y * (xnum + P[0][3]) / (xden + Q[0][3]);\n }\n\n /**\n * Approximates the complement of the error function erfc() for\n * 0.46875 <= x <= 4.0 using this function:\n * n\n * erfc(x) = e^(-x^2) * sum (p_j * x^j) / (q_j * x^j)\n * j=0\n */\n function erfc2(y) {\n var xnum = P[1][8] * y;\n var xden = y;\n var i;\n for (i = 0; i < 7; i += 1) {\n xnum = (xnum + P[1][i]) * y;\n xden = (xden + Q[1][i]) * y;\n }\n var result = (xnum + P[1][7]) / (xden + Q[1][7]);\n var ysq = parseInt(y * 16) / 16;\n var del = (y - ysq) * (y + ysq);\n return Math.exp(-ysq * ysq) * Math.exp(-del) * result;\n }\n\n /**\n * Approximates the complement of the error function erfc() for x > 4.0 using\n * this function:\n *\n * erfc(x) = (e^(-x^2) / x) * [ 1/sqrt(pi) +\n * n\n * 1/(x^2) * sum (p_j * x^(-2j)) / (q_j * x^(-2j)) ]\n * j=0\n */\n function erfc3(y) {\n var ysq = 1 / (y * y);\n var xnum = P[2][5] * ysq;\n var xden = ysq;\n var i;\n for (i = 0; i < 4; i += 1) {\n xnum = (xnum + P[2][i]) * ysq;\n xden = (xden + Q[2][i]) * ysq;\n }\n var result = ysq * (xnum + P[2][4]) / (xden + Q[2][4]);\n result = (SQRPI - result) / y;\n ysq = parseInt(y * 16) / 16;\n var del = (y - ysq) * (y + ysq);\n return Math.exp(-ysq * ysq) * Math.exp(-del) * result;\n }\n});\n\n/**\n * Upper bound for the first approximation interval, 0 <= x <= THRESH\n * @constant\n */\nvar THRESH = 0.46875;\n\n/**\n * Constant used by W. J. Cody's Fortran77 implementation to denote sqrt(pi)\n * @constant\n */\nvar SQRPI = 5.6418958354775628695e-1;\n\n/**\n * Coefficients for each term of the numerator sum (p_j) for each approximation\n * interval (see W. J. Cody's paper for more details)\n * @constant\n */\nvar P = [[3.16112374387056560e00, 1.13864154151050156e02, 3.77485237685302021e02, 3.20937758913846947e03, 1.85777706184603153e-1], [5.64188496988670089e-1, 8.88314979438837594e00, 6.61191906371416295e01, 2.98635138197400131e02, 8.81952221241769090e02, 1.71204761263407058e03, 2.05107837782607147e03, 1.23033935479799725e03, 2.15311535474403846e-8], [3.05326634961232344e-1, 3.60344899949804439e-1, 1.25781726111229246e-1, 1.60837851487422766e-2, 6.58749161529837803e-4, 1.63153871373020978e-2]];\n\n/**\n * Coefficients for each term of the denominator sum (q_j) for each approximation\n * interval (see W. J. Cody's paper for more details)\n * @constant\n */\nvar Q = [[2.36012909523441209e01, 2.44024637934444173e02, 1.28261652607737228e03, 2.84423683343917062e03], [1.57449261107098347e01, 1.17693950891312499e02, 5.37181101862009858e02, 1.62138957456669019e03, 3.29079923573345963e03, 4.36261909014324716e03, 3.43936767414372164e03, 1.23033935480374942e03], [2.56852019228982242e00, 1.87295284992346047e00, 5.27905102951428412e-1, 6.05183413124413191e-2, 2.33520497626869185e-3]];\n\n/**\n * Maximum/minimum safe numbers to input to erf() (in ES6+, this number is\n * Number.[MAX|MIN]_SAFE_INTEGER). erf() for all numbers beyond this limit will\n * return 1\n */\nvar MAX_NUM = Math.pow(2, 53);", "import { factory } from '../../utils/factory.js';\nvar name = 'zeta';\nvar dependencies = ['typed', 'config', 'multiply', 'pow', 'divide', 'factorial', 'equal', 'smallerEq', 'isNegative', 'gamma', 'sin', 'subtract', 'add', '?Complex', '?BigNumber', 'pi'];\nexport var createZeta = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiply,\n pow,\n divide,\n factorial,\n equal,\n smallerEq,\n isNegative,\n gamma,\n sin,\n subtract,\n add,\n Complex,\n BigNumber: _BigNumber,\n pi\n } = _ref;\n /**\n * Compute the Riemann Zeta function of a value using an infinite series for\n * all of the complex plane using Riemann's Functional equation.\n *\n * Based off the paper by Xavier Gourdon and Pascal Sebah\n * ( http://numbers.computation.free.fr/Constants/Miscellaneous/zetaevaluations.pdf )\n *\n * Implementation and slight modification by Anik Patel\n *\n * Note: the implementation is accurate up to about 6 digits.\n *\n * Syntax:\n *\n * math.zeta(n)\n *\n * Examples:\n *\n * math.zeta(5) // returns 1.0369277551433895\n * math.zeta(-0.5) // returns -0.2078862249773449\n * math.zeta(math.i) // returns 0.0033002236853253153 - 0.4181554491413212i\n *\n * See also:\n * erf\n *\n * @param {number | Complex | BigNumber} s A Real, Complex or BigNumber parameter to the Riemann Zeta Function\n * @return {number | Complex | BigNumber} The Riemann Zeta of `s`\n */\n return typed(name, {\n number: s => zetaNumeric(s, value => value, () => 20),\n BigNumber: s => zetaNumeric(s, value => new _BigNumber(value), () => {\n // relTol is for example 1e-12. Extract the positive exponent 12 from that\n return Math.abs(Math.log10(config.relTol));\n }),\n Complex: zetaComplex\n });\n\n /**\n * @param {number | BigNumber} s\n * @param {(value: number) => number | BigNumber} createValue\n * @param {(value: number | BigNumber | Complex) => number} determineDigits\n * @returns {number | BigNumber}\n */\n function zetaNumeric(s, createValue, determineDigits) {\n if (equal(s, 0)) {\n return createValue(-0.5);\n }\n if (equal(s, 1)) {\n return createValue(NaN);\n }\n if (!isFinite(s)) {\n return isNegative(s) ? createValue(NaN) : createValue(1);\n }\n return zeta(s, createValue, determineDigits, s => s);\n }\n\n /**\n * @param {Complex} s\n * @returns {Complex}\n */\n function zetaComplex(s) {\n if (s.re === 0 && s.im === 0) {\n return new Complex(-0.5);\n }\n if (s.re === 1) {\n return new Complex(NaN, NaN);\n }\n if (s.re === Infinity && s.im === 0) {\n return new Complex(1);\n }\n if (s.im === Infinity || s.re === -Infinity) {\n return new Complex(NaN, NaN);\n }\n return zeta(s, value => value, s => Math.round(1.3 * 15 + 0.9 * Math.abs(s.im)), s => s.re);\n }\n\n /**\n * @param {number | BigNumber | Complex} s\n * @param {(value: number) => number | BigNumber | Complex} createValue\n * @param {(value: number | BigNumber | Complex) => number} determineDigits\n * @param {(value: number | BigNumber | Complex) => number} getRe\n * @returns {*|number}\n */\n function zeta(s, createValue, determineDigits, getRe) {\n var n = determineDigits(s);\n if (getRe(s) > -(n - 1) / 2) {\n return f(s, createValue(n), createValue);\n } else {\n // Function Equation for reflection to x < 1\n var c = multiply(pow(2, s), pow(createValue(pi), subtract(s, 1)));\n c = multiply(c, sin(multiply(divide(createValue(pi), 2), s)));\n c = multiply(c, gamma(subtract(1, s)));\n return multiply(c, zeta(subtract(1, s), createValue, determineDigits, getRe));\n }\n }\n\n /**\n * Calculate a portion of the sum\n * @param {number | BigNumber} k a positive integer\n * @param {number | BigNumber} n a positive integer\n * @return {number} the portion of the sum\n **/\n function d(k, n) {\n var S = k;\n for (var j = k; smallerEq(j, n); j = add(j, 1)) {\n var factor = divide(multiply(factorial(add(n, subtract(j, 1))), pow(4, j)), multiply(factorial(subtract(n, j)), factorial(multiply(2, j))));\n S = add(S, factor);\n }\n return multiply(n, S);\n }\n\n /**\n * Calculate the positive Riemann Zeta function\n * @param {number} s a real or complex number with s.re > 1\n * @param {number} n a positive integer\n * @param {(number) => number | BigNumber | Complex} createValue\n * @return {number} Riemann Zeta of s\n **/\n function f(s, n, createValue) {\n var c = divide(1, multiply(d(createValue(0), n), subtract(1, pow(2, subtract(1, s)))));\n var S = createValue(0);\n for (var k = createValue(1); smallerEq(k, n); k = add(k, 1)) {\n S = add(S, divide(multiply((-1) ** (k - 1), d(k, n)), pow(k, s)));\n }\n return multiply(c, S);\n }\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'mode';\nvar dependencies = ['typed', 'isNaN', 'isNumeric'];\nexport var createMode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNaN,\n isNumeric\n } = _ref;\n /**\n * Computes the mode of a set of numbers or a list with values(numbers or characters).\n * If there are multiple modes, it returns a list of those values.\n *\n * Syntax:\n *\n * math.mode(a, b, c, ...)\n * math.mode(A)\n *\n * Examples:\n *\n * math.mode(2, 1, 4, 3, 1) // returns [1]\n * math.mode([1, 2.7, 3.2, 4, 2.7]) // returns [2.7]\n * math.mode(1, 4, 6, 1, 6) // returns [1, 6]\n * math.mode('a','a','b','c') // returns [\"a\"]\n * math.mode(1, 1.5, 'abc') // returns [1, 1.5, \"abc\"]\n *\n * See also:\n *\n * median,\n * mean\n *\n * @param {... *} args A single matrix\n * @return {*} The mode of all values\n */\n return typed(name, {\n 'Array | Matrix': _mode,\n '...': function _(args) {\n return _mode(args);\n }\n });\n\n /**\n * Calculates the mode in an 1-dimensional array\n * @param {Array} values\n * @return {Array} mode\n * @private\n */\n function _mode(values) {\n values = flatten(values.valueOf());\n var num = values.length;\n if (num === 0) {\n throw new Error('Cannot calculate mode of an empty array');\n }\n var count = {};\n var mode = [];\n var max = 0;\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n if (isNumeric(value) && isNaN(value)) {\n throw new Error('Cannot calculate mode of an array containing NaN values');\n }\n if (!(value in count)) {\n count[value] = 0;\n }\n count[value]++;\n if (count[value] === max) {\n mode.push(value);\n } else if (count[value] > max) {\n max = count[value];\n mode = [value];\n }\n }\n return mode;\n }\n});", "import { deepForEach } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'prod';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'numeric'];\nexport var createProd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n numeric\n } = _ref;\n /**\n * Compute the product of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the sum of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.prod(a, b, c, ...)\n * math.prod(A)\n *\n * Examples:\n *\n * math.multiply(2, 3) // returns 6\n * math.prod(2, 3) // returns 6\n * math.prod(2, 3, 4) // returns 24\n * math.prod([2, 3, 4]) // returns 24\n * math.prod([[2, 5], [4, 3]]) // returns 120\n *\n * See also:\n *\n * mean, median, min, max, sum, std, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The product of all values\n */\n return typed(name, {\n // prod([a, b, c, d, ...])\n 'Array | Matrix': _prod,\n // prod([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function ArrayMatrixNumberBigNumber(array, dim) {\n // TODO: implement prod(A, dim)\n throw new Error('prod(A, dim) is not yet supported');\n // return reduce(arguments[0], arguments[1], math.prod)\n },\n // prod(a, b, c, d, ...)\n '...': function _(args) {\n return _prod(args);\n }\n });\n\n /**\n * Recursively calculate the product of an n-dimensional array\n * @param {Array} array\n * @return {number} prod\n * @private\n */\n function _prod(array) {\n var prod;\n deepForEach(array, function (value) {\n try {\n prod = prod === undefined ? value : multiplyScalar(prod, value);\n } catch (err) {\n throw improveErrorMessage(err, 'prod', value);\n }\n });\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof prod === 'string') {\n prod = numeric(prod, safeNumberType(prod, config));\n }\n if (prod === undefined) {\n throw new Error('Cannot calculate prod of an empty array');\n }\n return prod;\n }\n});", "import { typeOf } from '../../../utils/is.js';\n\n/**\n * Improve error messages for statistics functions. Errors are typically\n * thrown in an internally used function like larger, causing the error\n * not to mention the function (like max) which is actually used by the user.\n *\n * @param {Error} err\n * @param {String} fnName\n * @param {*} [value]\n * @return {Error}\n */\nexport function improveErrorMessage(err, fnName, value) {\n // TODO: add information with the index (also needs transform in expression parser)\n var details;\n if (String(err).includes('Unexpected type')) {\n details = arguments.length > 2 ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')' : ' (type: ' + err.data.actual + ')';\n return new TypeError('Cannot calculate ' + fnName + ', unexpected type of argument' + details);\n }\n if (String(err).includes('complex numbers')) {\n details = arguments.length > 2 ? ' (type: ' + typeOf(value) + ', value: ' + JSON.stringify(value) + ')' : '';\n return new TypeError('Cannot calculate ' + fnName + ', no ordering relation is defined for complex numbers' + details);\n }\n return err;\n}", "import { format as formatString } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'format';\nvar dependencies = ['typed'];\nexport var createFormat = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Format a value of any type into a string.\n *\n * Syntax:\n *\n * math.format(value)\n * math.format(value, options)\n * math.format(value, precision)\n * math.format(value, callback)\n *\n * Where:\n *\n * - `value: *`\n * The value to be formatted\n * - `options: Object`\n * An object with formatting options. Available options:\n * - `notation: string`\n * Number notation. Choose from:\n * - `'fixed'`\n * Always use regular number notation.\n * For example `'123.40'` and `'14000000'`\n * - `'exponential'`\n * Always use exponential notation.\n * For example `'1.234e+2'` and `'1.4e+7'`\n * - `'engineering'`\n * Always use engineering notation: always have exponential notation,\n * and select the exponent to be a multiple of `3`.\n * For example `'123.4e+0'` and `'14.0e+6'`\n * - `'auto'` (default)\n * Regular number notation for numbers having an absolute value between\n * `lower` and `upper` bounds, and uses exponential notation elsewhere.\n * Lower bound is included, upper bound is excluded.\n * For example `'123.4'` and `'1.4e7'`.\n * - `'bin'`, `'oct'`, or `'hex'`\n * Format the number using binary, octal, or hexadecimal notation.\n * For example `'0b1101'` and `'0x10fe'`.\n * - `wordSize: number | BigNumber`\n * The word size in bits to use for formatting in binary, octal, or\n * hexadecimal notation. To be used only with `'bin'`, `'oct'`, or `'hex'`\n * values for `notation` option. When this option is defined the value\n * is formatted as a signed twos complement integer of the given word\n * size and the size suffix is appended to the output.\n * For example `format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'`.\n * Default value is undefined.\n * - `precision: number | BigNumber`\n * Limit the number of digits of the formatted value.\n * For regular numbers, must be a number between `0` and `16`.\n * For bignumbers, the maximum depends on the configured precision,\n * see function `config()`.\n * In case of notations `'exponential'`, `'engineering'`, and `'auto'`,\n * `precision` defines the total number of significant digits returned.\n * In case of notation `'fixed'`, `precision` defines the number of\n * significant digits after the decimal point.\n * `precision` is undefined by default.\n * - `lowerExp: number`\n * Exponent determining the lower boundary for formatting a value with\n * an exponent when `notation='auto'`. Default value is `-3`.\n * - `upperExp: number`\n * Exponent determining the upper boundary for formatting a value with\n * an exponent when `notation='auto'`. Default value is `5`.\n * - `fraction: string`. Available values: `'ratio'` (default) or `'decimal'`.\n * For example `format(fraction(1, 3))` will output `'1/3'` when `'ratio'`\n * is configured, and will output `'0.(3)'` when `'decimal'` is configured.\n * - `truncate: number`. Specifies the maximum allowed length of the\n * returned string. If it had been longer, the excess characters\n * are deleted and replaced with `'...'`.\n * - `callback: function`\n * A custom formatting function, invoked for all numeric elements in `value`,\n * for example all elements of a matrix, or the real and imaginary\n * parts of a complex number. This callback can be used to override the\n * built-in numeric notation with any type of formatting. Function `callback`\n * is called with `value` as parameter and must return a string.\n *\n * When `value` is an Object:\n *\n * - When the object contains a property `format` being a function, this function\n * is invoked as `value.format(options)` and the result is returned.\n * - When the object has its own `toString` method, this method is invoked\n * and the result is returned.\n * - In other cases the function will loop over all object properties and\n * return JSON object notation like '{\"a\": 2, \"b\": 3}'.\n *\n * When value is a function:\n *\n * - When the function has a property `syntax`, it returns this\n * syntax description.\n * - In other cases, a string `'function'` is returned.\n *\n * Examples:\n *\n * math.format(6.4) // returns '6.4'\n * math.format(1240000) // returns '1.24e+6'\n * math.format(1/3) // returns '0.3333333333333333'\n * math.format(1/3, 3) // returns '0.333'\n * math.format(21385, 2) // returns '21000'\n * math.format(12e8, {notation: 'fixed'}) // returns '1200000000'\n * math.format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000'\n * math.format(52.8, {notation: 'exponential'}) // returns '5.28e+1'\n * math.format(12400, {notation: 'engineering'}) // returns '12.4e+3'\n * math.format(2000, {lowerExp: -2, upperExp: 2}) // returns '2e+3'\n *\n * function formatCurrency(value) {\n * // return currency notation with two digits:\n * return '$' + value.toFixed(2)\n *\n * // you could also use math.format inside the callback:\n * // return '$' + math.format(value, {notation: 'fixed', precision: 2})\n * }\n * math.format([2.1, 3, 0.016], formatCurrency) // returns '[$2.10, $3.00, $0.02]'\n *\n * See also:\n *\n * print\n *\n * @param {*} value Value to be stringified\n * @param {Object | Function | number} [options] Formatting options\n * @return {string} The formatted value\n */\n return typed(name, {\n any: formatString,\n 'any, Object | function | number | BigNumber': formatString\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'bin';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as binary.\n *\n * Syntax:\n *\n * math.bin(value)\n *\n * Examples:\n *\n * //the following outputs \"0b10\"\n * math.bin(2)\n *\n * See also:\n *\n * oct\n * hex\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\nexport var createBin = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function numberBigNumber(n) {\n return format(n, {\n notation: 'bin'\n });\n },\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(n, wordSize) {\n return format(n, {\n notation: 'bin',\n wordSize\n });\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'oct';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as octal.\n *\n * Syntax:\n *\n * math.oct(value)\n *\n * Examples:\n *\n * //the following outputs \"0o70\"\n * math.oct(56)\n *\n * See also:\n *\n * bin\n * hex\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\n\nexport var createOct = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function numberBigNumber(n) {\n return format(n, {\n notation: 'oct'\n });\n },\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(n, wordSize) {\n return format(n, {\n notation: 'oct',\n wordSize\n });\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'hex';\nvar dependencies = ['typed', 'format'];\n\n/**\n * Format a number as hexadecimal.\n *\n * Syntax:\n *\n * math.hex(value)\n *\n * Examples:\n *\n * math.hex(240) // returns \"0xF0\"\n *\n * See also:\n *\n * oct\n * bin\n *\n * @param {number | BigNumber} value Value to be stringified\n * @param {number | BigNumber} wordSize Optional word size (see `format`)\n * @return {string} The formatted value\n */\nexport var createHex = factory(name, dependencies, _ref => {\n var {\n typed,\n format\n } = _ref;\n return typed(name, {\n 'number | BigNumber': function numberBigNumber(n) {\n return format(n, {\n notation: 'hex'\n });\n },\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(n, wordSize) {\n return format(n, {\n notation: 'hex',\n wordSize\n });\n }\n });\n});", "import { format } from '../../utils/string.js';\nimport { isString } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { printTemplate } from '../../utils/print.js';\nvar name = 'print';\nvar dependencies = ['typed'];\nexport var createPrint = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Interpolate values into a string template.\n *\n * Syntax:\n *\n * math.print(template, values)\n * math.print(template, values, precision)\n * math.print(template, values, options)\n *\n * Example usage:\n *\n * // the following outputs: 'Lucy is 5 years old'\n * math.print('Lucy is $age years old', {age: 5})\n *\n * // the following outputs: 'The value of pi is 3.141592654'\n * math.print('The value of pi is $pi', {pi: math.pi}, 10)\n *\n * // the following outputs: 'hello Mary! The date is 2013-03-23'\n * math.print('Hello $user.name! The date is $date', {\n * user: {\n * name: 'Mary',\n * },\n * date: new Date(2013, 2, 23).toISOString().substring(0, 10)\n * })\n *\n * // the following outputs: 'My favorite fruits are apples and bananas !'\n * math.print('My favorite fruits are $0 and $1 !', [\n * 'apples',\n * 'bananas'\n * ])\n *\n * See also:\n *\n * format\n *\n * @param {string} template A string containing variable placeholders.\n * @param {Object | Array | Matrix} values An object or array containing variables\n * which will be filled in in the template.\n * @param {number | Object} [options] Formatting options,\n * or the number of digits to format numbers.\n * See function math.format for a description\n * of all options.\n * @return {string} Interpolated string\n */\n return typed(name, {\n // note: Matrix will be converted automatically to an Array\n 'string, Object | Array': _print,\n 'string, Object | Array, number | Object': _print\n });\n});\n\n/**\n * Interpolate values into a string template.\n * @param {string} template\n * @param {Object} values\n * @param {number | Object} [options]\n * @returns {string} Interpolated string\n * @private\n */\nfunction _print(template, values, options) {\n return template.replace(printTemplate, function (original, key) {\n var keys = key.split('.');\n var value = values[keys.shift()];\n if (value !== undefined && value.isMatrix) {\n value = value.toArray();\n }\n while (keys.length && value !== undefined) {\n var k = keys.shift();\n value = k ? value[k] : value + '.';\n }\n if (value !== undefined) {\n if (!isString(value)) {\n return format(value, options);\n } else {\n return value;\n }\n }\n return original;\n });\n}", "export var printTemplate = /\\$([\\w.]+)/g;", "import { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'to';\nvar dependencies = ['typed', 'matrix', 'concat'];\nexport var createTo = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n concat\n } = _ref;\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Change the unit of a value.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.to(x, unit)\n *\n * Examples:\n *\n * math.to(math.unit('2 inch'), 'cm') // returns Unit 5.08 cm\n * math.to(math.unit('2 inch'), math.unit('cm')) // returns Unit 5.08 cm\n * math.to(math.unit(16, 'bytes'), 'bits') // returns Unit 128 bits\n *\n * See also:\n *\n * unit\n *\n * @param {Unit | Array | Matrix} x The unit to be converted.\n * @param {Unit | Array | Matrix} unit New unit. Can be a string like \"cm\"\n * or a unit without value.\n * @return {Unit | Array | Matrix} value with changed, fixed unit.\n */\n return typed(name, {\n 'Unit, Unit | string': (x, unit) => x.to(unit)\n }, matrixAlgorithmSuite({\n Ds: true\n }));\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'isPrime';\nvar dependencies = ['typed'];\nexport var createIsPrime = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Test whether a value is prime: has no divisors other than itself and one.\n * The function supports type `number`, `bignumber`.\n *\n * The function is evaluated element-wise in case of Array or Matrix input.\n *\n * Syntax:\n *\n * math.isPrime(x)\n *\n * Examples:\n *\n * math.isPrime(3) // returns true\n * math.isPrime(-2) // returns false\n * math.isPrime(0) // returns false\n * math.isPrime(-0) // returns false\n * math.isPrime(0.5) // returns false\n * math.isPrime('2') // returns true\n * math.isPrime([2, 17, 100]) // returns [true, true, false]\n *\n * See also:\n *\n * isNumeric, isZero, isNegative, isInteger\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is larger than zero.\n * Throws an error in case of an unknown data type.\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 3) {\n return x > 1;\n }\n if (x % 2 === 0 || x % 3 === 0) {\n return false;\n }\n for (var i = 5; i * i <= x; i += 6) {\n if (x % i === 0 || x % (i + 2) === 0) {\n return false;\n }\n }\n return true;\n },\n bigint: function bigint(x) {\n if (x <= 3n) {\n return x > 1n;\n }\n if (x % 2n === 0n || x % 3n === 0n) {\n return false;\n }\n for (var i = 5n; i * i <= x; i += 6n) {\n if (x % i === 0n || x % (i + 2n) === 0n) {\n return false;\n }\n }\n return true;\n },\n BigNumber: function BigNumber(n) {\n if (n.lte(3)) return n.gt(1);\n if (n.mod(2).eq(0) || n.mod(3).eq(0)) return false;\n if (n.lt(Math.pow(2, 32))) {\n var x = n.toNumber();\n for (var i = 5; i * i <= x; i += 6) {\n if (x % i === 0 || x % (i + 2) === 0) {\n return false;\n }\n }\n return true;\n }\n function modPow(base, exponent, modulus) {\n // exponent can be huge, use non-recursive variant\n var accumulator = 1;\n while (!exponent.eq(0)) {\n if (exponent.mod(2).eq(0)) {\n exponent = exponent.div(2);\n base = base.mul(base).mod(modulus);\n } else {\n exponent = exponent.sub(1);\n accumulator = base.mul(accumulator).mod(modulus);\n }\n }\n return accumulator;\n }\n\n // https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Deterministic_variants\n var Decimal = n.constructor.clone({\n precision: n.toFixed(0).length * 2\n });\n n = new Decimal(n);\n var r = 0;\n var d = n.sub(1);\n while (d.mod(2).eq(0)) {\n d = d.div(2);\n r += 1;\n }\n var bases = null;\n // https://en.wikipedia.org/wiki/Miller\u2013Rabin_primality_test#Testing_against_small_sets_of_bases\n if (n.lt('3317044064679887385961981')) {\n bases = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41].filter(x => x < n);\n } else {\n var max = Math.min(n.toNumber() - 2, Math.floor(2 * Math.pow(n.toFixed(0).length * Math.log(10), 2)));\n bases = [];\n for (var _i = 2; _i <= max; _i += 1) {\n bases.push(max);\n }\n }\n for (var _i2 = 0; _i2 < bases.length; _i2 += 1) {\n var a = bases[_i2];\n var adn = modPow(n.sub(n).add(a), d, n);\n if (!adn.eq(1)) {\n for (var _i3 = 0, _x = adn; !_x.eq(n.sub(1)); _i3 += 1, _x = _x.mul(_x).mod(n)) {\n if (_i3 === r - 1) {\n return false;\n }\n }\n }\n }\n return true;\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { noBignumber, noFraction } from '../../utils/noop.js';\nvar name = 'numeric';\nvar dependencies = ['number', '?bignumber', '?fraction'];\nexport var createNumeric = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n number: _number,\n bignumber,\n fraction\n } = _ref;\n var validInputTypes = {\n string: true,\n number: true,\n BigNumber: true,\n Fraction: true\n };\n\n // Load the conversion functions for each output type\n var validOutputTypes = {\n number: x => _number(x),\n BigNumber: bignumber ? x => bignumber(x) : noBignumber,\n bigint: x => BigInt(x),\n Fraction: fraction ? x => fraction(x) : noFraction\n };\n\n /**\n * Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.\n *\n * Syntax:\n *\n * math.numeric(x)\n *\n * Examples:\n *\n * math.numeric('4') // returns 4\n * math.numeric('4', 'number') // returns 4\n * math.numeric('4', 'bigint') // returns 4n\n * math.numeric('4', 'BigNumber') // returns BigNumber 4\n * math.numeric('4', 'Fraction') // returns Fraction 4\n * math.numeric(4, 'Fraction') // returns Fraction 4\n * math.numeric(math.fraction(2, 5), 'number') // returns 0.4\n *\n * See also:\n *\n * number, fraction, bignumber, bigint, string, format\n *\n * @param {string | number | BigNumber | bigint | Fraction } value\n * A numeric value or a string containing a numeric value\n * @param {string} outputType\n * Desired numeric output type.\n * Available values: 'number', 'BigNumber', or 'Fraction'\n * @return {number | BigNumber | bigint | Fraction}\n * Returns an instance of the numeric in the requested type\n */\n return function numeric(value) {\n var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'number';\n var check = arguments.length > 2 ? arguments[2] : undefined;\n if (check !== undefined) {\n throw new SyntaxError('numeric() takes one or two arguments');\n }\n var inputType = typeOf(value);\n if (!(inputType in validInputTypes)) {\n throw new TypeError('Cannot convert ' + value + ' of type \"' + inputType + '\"; valid input types are ' + Object.keys(validInputTypes).join(', '));\n }\n if (!(outputType in validOutputTypes)) {\n throw new TypeError('Cannot convert ' + value + ' to type \"' + outputType + '\"; valid output types are ' + Object.keys(validOutputTypes).join(', '));\n }\n if (outputType === inputType) {\n return value;\n } else {\n return validOutputTypes[outputType](value);\n }\n };\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'divideScalar';\nvar dependencies = ['typed', 'numeric'];\nexport var createDivideScalar = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n numeric\n } = _ref;\n /**\n * Divide two scalar values, `x / y`.\n * This function is meant for internal use: it is used by the public functions\n * `divide` and `inv`.\n *\n * This function does not support collections (Array or Matrix).\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit} x Numerator\n * @param {number | BigNumber | bigint | Fraction | Complex} y Denominator\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit} Quotient, `x / y`\n * @private\n */\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return x / y;\n },\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.div(y);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.div(y);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x / y;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return x.div(y);\n },\n 'Unit, number | Complex | Fraction | BigNumber | Unit': (x, y) => x.divide(y),\n 'number | Fraction | Complex | BigNumber, Unit': (x, y) => y.divideInto(x)\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { arraySize as size } from '../../utils/array.js';\nimport { powNumber } from '../../plain/number/index.js';\nvar name = 'pow';\nvar dependencies = ['typed', 'config', 'identity', 'multiply', 'matrix', 'inv', 'fraction', 'number', 'Complex'];\nexport var createPow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n identity,\n multiply,\n matrix,\n inv,\n number,\n fraction,\n Complex\n } = _ref;\n /**\n * Calculates the power of x to y, `x ^ y`.\n *\n * Matrix exponentiation is supported for square matrices `x` and integers `y`:\n * when `y` is nonnegative, `x` may be any square matrix; and when `y` is\n * negative, `x` must be invertible, and then this function returns\n * inv(x)^(-y).\n *\n * For cubic roots of negative numbers, the function returns the principal\n * root by default. In order to let the function return the real root,\n * math.js can be configured with `math.config({predictable: true})`.\n * To retrieve all cubic roots of a value, use `math.cbrt(x, true)`.\n *\n * Syntax:\n *\n * math.pow(x, y)\n *\n * Examples:\n *\n * math.pow(2, 3) // returns number 8\n *\n * const a = math.complex(2, 3)\n * math.pow(a, 2) // returns Complex -5 + 12i\n *\n * const b = [[1, 2], [4, 3]]\n * math.pow(b, 2) // returns Array [[9, 8], [16, 17]]\n *\n * const c = [[1, 2], [4, 3]]\n * math.pow(c, -1) // returns Array [[-0.6, 0.4], [0.8, -0.2]]\n *\n * See also:\n *\n * multiply, sqrt, cbrt, nthRoot\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | bigint | Complex} y The exponent\n * @return {number | BigNumber | bigint | Complex | Array | Matrix} The value of `x` to the power `y`\n */\n return typed(name, {\n 'number, number': _pow,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return x.pow(y);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n if (y.isInteger() || x >= 0 || config.predictable) {\n return x.pow(y);\n } else {\n return new Complex(x.toNumber(), 0).pow(y.toNumber(), 0);\n }\n },\n 'bigint, bigint': (x, y) => x ** y,\n 'Fraction, Fraction': function FractionFraction(x, y) {\n var result = x.pow(y);\n if (result != null) {\n return result;\n }\n if (config.predictable) {\n throw new Error('Result of pow is non-rational and cannot be expressed as a fraction');\n } else {\n return _pow(x.valueOf(), y.valueOf());\n }\n },\n 'Array, number': _powArray,\n 'Array, BigNumber': function ArrayBigNumber(x, y) {\n return _powArray(x, y.toNumber());\n },\n 'Matrix, number': _powMatrix,\n 'Matrix, BigNumber': function MatrixBigNumber(x, y) {\n return _powMatrix(x, y.toNumber());\n },\n 'Unit, number | BigNumber': function UnitNumberBigNumber(x, y) {\n return x.pow(y);\n }\n });\n\n /**\n * Calculates the power of x to y, x^y, for two numbers.\n * @param {number} x\n * @param {number} y\n * @return {number | Complex} res\n * @private\n */\n function _pow(x, y) {\n // Alternatively could define a 'realmode' config option or something, but\n // 'predictable' will work for now\n if (config.predictable && !isInteger(y) && x < 0) {\n // Check to see if y can be represented as a fraction\n try {\n var yFrac = fraction(y);\n var yNum = number(yFrac);\n if (y === yNum || Math.abs((y - yNum) / y) < 1e-14) {\n if (yFrac.d % 2 === 1) {\n return (yFrac.n % 2 === 0 ? 1 : -1) * Math.pow(-x, y);\n }\n }\n } catch (ex) {\n // fraction() throws an error if y is Infinity, etc.\n }\n\n // Unable to express y as a fraction, so continue on\n }\n\n // **for predictable mode** x^Infinity === NaN if x < -1\n // N.B. this behavour is different from `Math.pow` which gives\n // (-2)^Infinity === Infinity\n if (config.predictable && (x < -1 && y === Infinity || x > -1 && x < 0 && y === -Infinity)) {\n return NaN;\n }\n if (isInteger(y) || x >= 0 || config.predictable) {\n return powNumber(x, y);\n } else {\n // TODO: the following infinity checks are duplicated from powNumber. Deduplicate this somehow\n\n // x^Infinity === 0 if -1 < x < 1\n // A real number 0 is returned instead of complex(0)\n if (x * x < 1 && y === Infinity || x * x > 1 && y === -Infinity) {\n return 0;\n }\n return new Complex(x, 0).pow(y, 0);\n }\n }\n\n /**\n * Calculate the power of a 2d array\n * @param {Array} x must be a 2 dimensional, square matrix\n * @param {number} y a integer value (positive if `x` is not invertible)\n * @returns {Array}\n * @private\n */\n function _powArray(x, y) {\n if (!isInteger(y)) {\n throw new TypeError('For A^b, b must be an integer (value is ' + y + ')');\n }\n // verify that A is a 2 dimensional square matrix\n var s = size(x);\n if (s.length !== 2) {\n throw new Error('For A^b, A must be 2 dimensional (A has ' + s.length + ' dimensions)');\n }\n if (s[0] !== s[1]) {\n throw new Error('For A^b, A must be square (size is ' + s[0] + 'x' + s[1] + ')');\n }\n if (y < 0) {\n try {\n return _powArray(inv(x), -y);\n } catch (error) {\n if (error.message === 'Cannot calculate inverse, determinant is zero') {\n throw new TypeError('For A^b, when A is not invertible, b must be a positive integer (value is ' + y + ')');\n }\n throw error;\n }\n }\n var res = identity(s[0]).valueOf();\n var px = x;\n while (y >= 1) {\n if ((y & 1) === 1) {\n res = multiply(px, res);\n }\n y >>= 1;\n px = multiply(px, px);\n }\n return res;\n }\n\n /**\n * Calculate the power of a 2d matrix\n * @param {Matrix} x must be a 2 dimensional, square matrix\n * @param {number} y a positive, integer value\n * @returns {Matrix}\n * @private\n */\n function _powMatrix(x, y) {\n return matrix(_powArray(x.valueOf(), y));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { nearlyEqual, splitNumber } from '../../utils/number.js';\nimport { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { roundNumber } from '../../plain/number/index.js';\nvar NO_INT = 'Number of decimals in function round must be an integer';\nvar name = 'round';\nvar dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'zeros', 'BigNumber', 'DenseMatrix'];\nexport var createRound = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n equalScalar,\n zeros,\n BigNumber: _BigNumber,\n DenseMatrix\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n function toExponent(epsilon) {\n return Math.abs(splitNumber(epsilon).exponent);\n }\n\n /**\n * Round a value towards the nearest rounded value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.round(x)\n * math.round(x, n)\n * math.round(unit, valuelessUnit)\n * math.round(unit, n, valuelessUnit)\n *\n * Examples:\n *\n * math.round(3.22) // returns number 3\n * math.round(3.82) // returns number 4\n * math.round(-4.2) // returns number -4\n * math.round(-4.7) // returns number -5\n * math.round(3.22, 1) // returns number 3.2\n * math.round(3.88, 1) // returns number 3.9\n * math.round(-4.21, 1) // returns number -4.2\n * math.round(-4.71, 1) // returns number -4.7\n * math.round(math.pi, 3) // returns number 3.142\n * math.round(123.45678, 2) // returns number 123.46\n *\n * const c = math.complex(3.2, -2.7)\n * math.round(c) // returns Complex 3 - 3i\n *\n * const unit = math.unit('3.241 cm')\n * const cm = math.unit('cm')\n * const mm = math.unit('mm')\n * math.round(unit, 1, cm) // returns Unit 3.2 cm\n * math.round(unit, 1, mm) // returns Unit 32.4 mm\n *\n * math.round([3.2, 3.8, -4.7]) // returns Array [3, 4, -5]\n *\n * See also:\n *\n * ceil, fix, floor\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Value to be rounded\n * @param {number | BigNumber | Array} [n=0] Number of decimals\n * @param {Unit} [valuelessUnit] A valueless unit\n * @return {number | BigNumber | Fraction | Complex | Array | Matrix} Rounded value\n */\n return typed(name, {\n number: function number(x) {\n // Handle round off errors by first rounding to relTol precision\n var xEpsilon = roundNumber(x, toExponent(config.relTol));\n var xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return roundNumber(xSelected);\n },\n 'number, number': function numberNumber(x, n) {\n // Same as number: unless user specifies more decimals than relTol\n var epsilonExponent = toExponent(config.relTol);\n if (n >= epsilonExponent) {\n return roundNumber(x, n);\n }\n var xEpsilon = roundNumber(x, epsilonExponent);\n var xSelected = nearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return roundNumber(xSelected, n);\n },\n 'number, BigNumber': function numberBigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n return new _BigNumber(x).toDecimalPlaces(n.toNumber());\n },\n Complex: function Complex(x) {\n return x.round();\n },\n 'Complex, number': function ComplexNumber(x, n) {\n if (n % 1) {\n throw new TypeError(NO_INT);\n }\n return x.round(n);\n },\n 'Complex, BigNumber': function ComplexBigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n var _n = n.toNumber();\n return x.round(_n);\n },\n BigNumber: function BigNumber(x) {\n // Handle round off errors by first rounding to relTol precision\n var xEpsilon = new _BigNumber(x).toDecimalPlaces(toExponent(config.relTol));\n var xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return xSelected.toDecimalPlaces(0);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n\n // Same as BigNumber: unless user specifies more decimals than relTol\n var epsilonExponent = toExponent(config.relTol);\n if (n >= epsilonExponent) {\n return x.toDecimalPlaces(n.toNumber());\n }\n var xEpsilon = x.toDecimalPlaces(epsilonExponent);\n var xSelected = bigNearlyEqual(x, xEpsilon, config.relTol, config.absTol) ? xEpsilon : x;\n return xSelected.toDecimalPlaces(n.toNumber());\n },\n Fraction: function Fraction(x) {\n return x.round();\n },\n 'Fraction, number': function FractionNumber(x, n) {\n if (n % 1) {\n throw new TypeError(NO_INT);\n }\n return x.round(n);\n },\n 'Fraction, BigNumber': function FractionBigNumber(x, n) {\n if (!n.isInteger()) {\n throw new TypeError(NO_INT);\n }\n return x.round(n.toNumber());\n },\n 'Unit, number, Unit': typed.referToSelf(self => function (x, n, unit) {\n var valueless = x.toNumeric(unit);\n return unit.multiply(self(valueless, n));\n }),\n 'Unit, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)),\n 'Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)),\n 'Array | Matrix, number, Unit': typed.referToSelf(self => (x, n, unit) => {\n // deep map collection, skip zeros since round(0) = 0\n return deepMap(x, value => self(value, n, unit), true);\n }),\n 'Array | Matrix, BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => self(x, n.toNumber(), unit)),\n 'Array | Matrix, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)),\n 'Array | Matrix': typed.referToSelf(self => x => {\n // deep map collection, skip zeros since round(0) = 0\n return deepMap(x, self, true);\n }),\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n return matAlgo11xS0s(x, n, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, n) => {\n return matAlgo14xDs(x, n, self, false);\n }),\n 'Array, number | BigNumber': typed.referToSelf(self => (x, n) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), n, self, false).valueOf();\n }),\n 'number | Complex | BigNumber | Fraction, SparseMatrix': typed.referToSelf(self => (x, n) => {\n // check scalar is zero\n if (equalScalar(x, 0)) {\n // do not execute algorithm, result will be a zero matrix\n return zeros(n.size(), n.storage());\n }\n return matAlgo12xSfs(n, x, self, true);\n }),\n 'number | Complex | BigNumber | Fraction, DenseMatrix': typed.referToSelf(self => (x, n) => {\n // check scalar is zero\n if (equalScalar(x, 0)) {\n // do not execute algorithm, result will be a zero matrix\n return zeros(n.size(), n.storage());\n }\n return matAlgo14xDs(n, x, self, true);\n }),\n 'number | Complex | BigNumber | Fraction, Array': typed.referToSelf(self => (x, n) => {\n // use matrix implementation\n return matAlgo14xDs(matrix(n), x, self, true).valueOf();\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { logNumber } from '../../plain/number/index.js';\nvar name = 'log';\nvar dependencies = ['config', 'typed', 'divideScalar', 'Complex'];\nexport var createLog = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n Complex\n } = _ref;\n /**\n * Calculate the logarithm of a value.\n *\n * To avoid confusion with the matrix logarithm, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.log(x)\n * math.log(x, base)\n *\n * Examples:\n *\n * math.log(3.5) // returns 1.252762968495368\n * math.exp(math.log(2.4)) // returns 2.4\n *\n * math.pow(10, 4) // returns 10000\n * math.log(10000, 10) // returns 4\n * math.log(10000) / math.log(10) // returns 4\n *\n * math.log(1024, 2) // returns 10\n * math.pow(2, 10) // returns 1024\n *\n * See also:\n *\n * exp, log2, log10, log1p\n *\n * @param {number | BigNumber | Complex} x\n * Value for which to calculate the logarithm.\n * @param {number | BigNumber | Complex} [base=e]\n * Optional base for the logarithm. If not provided, the natural\n * logarithm of `x` is calculated.\n * @return {number | BigNumber | Complex}\n * Returns the logarithm of `x`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 0 || config.predictable) {\n return logNumber(x);\n } else {\n // negative value -> complex value computation\n return new Complex(x, 0).log();\n }\n },\n Complex: function Complex(x) {\n return x.log();\n },\n BigNumber: function BigNumber(x) {\n if (!x.isNegative() || config.predictable) {\n return x.ln();\n } else {\n // downgrade to number, return Complex valued result\n return new Complex(x.toNumber(), 0).log();\n }\n },\n 'any, any': typed.referToSelf(self => (x, base) => {\n // calculate logarithm for a specified base, log(x, base)\n return divideScalar(self(x), self(base));\n })\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { deepMap } from '../../utils/collection.js';\nimport { log1p as _log1p } from '../../utils/number.js';\nvar name = 'log1p';\nvar dependencies = ['typed', 'config', 'divideScalar', 'log', 'Complex'];\nexport var createLog1p = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n log,\n Complex\n } = _ref;\n /**\n * Calculate the logarithm of a `value+1`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.log1p(x)\n * math.log1p(x, base)\n *\n * Examples:\n *\n * math.log1p(2.5) // returns 1.252762968495368\n * math.exp(math.log1p(1.4)) // returns 2.4\n *\n * math.pow(10, 4) // returns 10000\n * math.log1p(9999, 10) // returns 4\n * math.log1p(9999) / math.log(10) // returns 4\n *\n * See also:\n *\n * exp, log, log2, log10\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the logarithm of `x+1`.\n * @param {number | BigNumber | Complex} [base=e]\n * Optional base for the logarithm. If not provided, the natural\n * logarithm of `x+1` is calculated.\n * @return {number | BigNumber | Complex | Array | Matrix}\n * Returns the logarithm of `x+1`\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 || config.predictable) {\n return _log1p(x);\n } else {\n // negative value -> complex value computation\n return _log1pComplex(new Complex(x, 0));\n }\n },\n Complex: _log1pComplex,\n BigNumber: function BigNumber(x) {\n var y = x.plus(1);\n if (!y.isNegative() || config.predictable) {\n return y.ln();\n } else {\n // downgrade to number, return Complex valued result\n return _log1pComplex(new Complex(x.toNumber(), 0));\n }\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)),\n 'any, any': typed.referToSelf(self => (x, base) => {\n // calculate logarithm for a specified base, log1p(x, base)\n return divideScalar(self(x), log(base));\n })\n });\n\n /**\n * Calculate the natural logarithm of a complex number + 1\n * @param {Complex} x\n * @returns {Complex}\n * @private\n */\n function _log1pComplex(x) {\n var xRe1p = x.re + 1;\n return new Complex(Math.log(Math.sqrt(xRe1p * xRe1p + x.im * x.im)), Math.atan2(x.im, xRe1p));\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'nthRoots';\nvar dependencies = ['config', 'typed', 'divideScalar', 'Complex'];\nexport var createNthRoots = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n divideScalar,\n Complex\n } = _ref;\n /**\n * Each function here returns a real multiple of i as a Complex value.\n * @param {number} val\n * @return {Complex} val, i*val, -val or -i*val for index 0, 1, 2, 3\n */\n // This is used to fix float artifacts for zero-valued components.\n var _calculateExactResult = [function realPos(val) {\n return new Complex(val, 0);\n }, function imagPos(val) {\n return new Complex(0, val);\n }, function realNeg(val) {\n return new Complex(-val, 0);\n }, function imagNeg(val) {\n return new Complex(0, -val);\n }];\n\n /**\n * Calculate the nth root of a Complex Number a using De Movire's Theorem.\n * @param {Complex} a\n * @param {number} root\n * @return {Array} array of n Complex Roots\n */\n function _nthComplexRoots(a, root) {\n if (root < 0) throw new Error('Root must be greater than zero');\n if (root === 0) throw new Error('Root must be non-zero');\n if (root % 1 !== 0) throw new Error('Root must be an integer');\n if (a === 0 || a.abs() === 0) return [new Complex(0, 0)];\n var aIsNumeric = typeof a === 'number';\n var offset;\n // determine the offset (argument of a)/(pi/2)\n if (aIsNumeric || a.re === 0 || a.im === 0) {\n if (aIsNumeric) {\n offset = 2 * +(a < 0); // numeric value on the real axis\n } else if (a.im === 0) {\n offset = 2 * +(a.re < 0); // complex value on the real axis\n } else {\n offset = 2 * +(a.im < 0) + 1; // complex value on the imaginary axis\n }\n }\n var arg = a.arg();\n var abs = a.abs();\n var roots = [];\n var r = Math.pow(abs, 1 / root);\n for (var k = 0; k < root; k++) {\n var halfPiFactor = (offset + 4 * k) / root;\n /**\n * If (offset + 4*k)/root is an integral multiple of pi/2\n * then we can produce a more exact result.\n */\n if (halfPiFactor === Math.round(halfPiFactor)) {\n roots.push(_calculateExactResult[halfPiFactor % 4](r));\n continue;\n }\n roots.push(new Complex({\n r,\n phi: (arg + 2 * Math.PI * k) / root\n }));\n }\n return roots;\n }\n\n /**\n * Calculate the nth roots of a value.\n * An nth root of a positive real number A,\n * is a positive real solution of the equation \"x^root = A\".\n * This function returns an array of complex values.\n *\n * Syntax:\n *\n * math.nthRoots(x)\n * math.nthRoots(x, root)\n *\n * Examples:\n *\n * math.nthRoots(1)\n * // returns [\n * // {re: 1, im: 0},\n * // {re: -1, im: 0}\n * // ]\n * math.nthRoots(1, 3)\n * // returns [\n * // { re: 1, im: 0 },\n * // { re: -0.4999999999999998, im: 0.8660254037844387 },\n * // { re: -0.5000000000000004, im: -0.8660254037844385 }\n * // ]\n *\n * See also:\n *\n * nthRoot, pow, sqrt\n *\n * @param {number | BigNumber | Fraction | Complex} x Number to be rounded\n * @param {number} [root=2] Optional root, default value is 2\n * @return {number | BigNumber | Fraction | Complex} Returns the nth roots\n */\n return typed(name, {\n Complex: function Complex(x) {\n return _nthComplexRoots(x, 2);\n },\n 'Complex, number': _nthComplexRoots\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotPow';\nvar dependencies = ['typed', 'equalScalar', 'matrix', 'pow', 'DenseMatrix', 'concat'];\nexport var createDotPow = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar,\n matrix,\n pow,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var powScalarSignatures = {};\n for (var signature in pow.signatures) {\n if (Object.prototype.hasOwnProperty.call(pow.signatures, signature)) {\n if (!signature.includes('Matrix') && !signature.includes('Array')) {\n powScalarSignatures[signature] = pow.signatures[signature];\n }\n }\n }\n var powScalar = typed(powScalarSignatures);\n\n /**\n * Calculates the power of x to y element wise.\n *\n * Syntax:\n *\n * math.dotPow(x, y)\n *\n * Examples:\n *\n * math.dotPow(2, 3) // returns number 8\n *\n * const a = [[1, 2], [4, 3]]\n * math.dotPow(a, 2) // returns Array [[1, 4], [16, 9]]\n * math.pow(a, 2) // returns Array [[9, 8], [16, 17]]\n *\n * See also:\n *\n * pow, sqrt, multiply\n *\n * @param {number | BigNumber | Complex | Unit | Array | Matrix} x The base\n * @param {number | BigNumber | Complex | Unit | Array | Matrix} y The exponent\n * @return {number | BigNumber | Complex | Unit | Array | Matrix} The value of `x` to the power `y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: powScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'dotDivide';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'divideScalar', 'DenseMatrix', 'concat'];\nexport var createDotDivide = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n divideScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Divide two matrices element wise. The function accepts both matrices and\n * scalar values.\n *\n * Syntax:\n *\n * math.dotDivide(x, y)\n *\n * Examples:\n *\n * math.dotDivide(2, 4) // returns 0.5\n *\n * a = [[9, 5], [6, 1]]\n * b = [[3, 2], [5, 2]]\n *\n * math.dotDivide(a, b) // returns [[3, 2.5], [1.2, 0.5]]\n * math.divide(a, b) // returns [[1.75, 0.75], [-1.75, 2.25]]\n *\n * See also:\n *\n * divide, multiply, dotMultiply\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Denominator\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} Quotient, `x ./ y`\n */\n return typed(name, matrixAlgorithmSuite({\n elop: divideScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'lsolve';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createLsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds one solution of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix. Throws an error if there's no solution.\n *\n * `L * x = b`\n *\n * Syntax:\n *\n * math.lsolve(L, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = lsolve(a, b) // [[-5.5], [20]]\n *\n * See also:\n *\n * lsolveAll, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} L A N x N matrix or array (L)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix | Array} A column vector with the linear system solution (x)\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrixArrayMatrix(m, b) {\n return _sparseForwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrixArrayMatrix(m, b) {\n return _denseForwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function ArrayArrayMatrix(a, b) {\n var m = matrix(a);\n var r = _denseForwardSubstitution(m, b);\n return r.valueOf();\n }\n });\n function _denseForwardSubstitution(m, b) {\n // validate matrix and vector, return copy of column vector b\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // result\n var x = [];\n var mdata = m._data;\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n var bj = bdata[j][0] || 0;\n var xj = void 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = mdata[j][j];\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n xj = divideScalar(bj, vjj);\n\n // loop rows\n for (var i = j + 1; i < rows; i++) {\n bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];\n }\n } else {\n // degenerate row, we can choose any value\n xj = 0;\n }\n x[j] = [xj];\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n function _sparseForwardSubstitution(m, b) {\n // validate matrix and vector, return copy of column vector b\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // result\n var x = [];\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n var bj = bdata[j][0] || 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = 0;\n // matrix values & indices (column j)\n var jValues = [];\n var jIndices = [];\n\n // first and last index in the column\n var firstIndex = ptr[j];\n var lastIndex = ptr[j + 1];\n\n // values in column, find value at [j, j]\n for (var k = firstIndex; k < lastIndex; k++) {\n var i = index[k];\n\n // check row (rows are not sorted!)\n if (i === j) {\n vjj = values[k];\n } else if (i > j) {\n // store lower triangular\n jValues.push(values[k]);\n jIndices.push(i);\n }\n }\n\n // at this point we must have a value in vjj\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n var xj = divideScalar(bj, vjj);\n for (var _k = 0, l = jIndices.length; _k < l; _k++) {\n var _i = jIndices[_k];\n bdata[_i] = [subtractScalar(bdata[_i][0] || 0, multiplyScalar(xj, jValues[_k]))];\n }\n x[j] = [xj];\n } else {\n // degenerate row, we can choose any value\n x[j] = [0];\n }\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n});", "import { isArray, isMatrix, isDenseMatrix, isSparseMatrix } from '../../../../utils/is.js';\nimport { arraySize } from '../../../../utils/array.js';\nimport { format } from '../../../../utils/string.js';\nexport function createSolveValidation(_ref) {\n var {\n DenseMatrix\n } = _ref;\n /**\n * Validates matrix and column vector b for backward/forward substitution algorithms.\n *\n * @param {Matrix} m An N x N matrix\n * @param {Array | Matrix} b A column vector\n * @param {Boolean} copy Return a copy of vector b\n *\n * @return {DenseMatrix} Dense column vector b\n */\n return function solveValidation(m, b, copy) {\n var mSize = m.size();\n if (mSize.length !== 2) {\n throw new RangeError('Matrix must be two dimensional (size: ' + format(mSize) + ')');\n }\n var rows = mSize[0];\n var columns = mSize[1];\n if (rows !== columns) {\n throw new RangeError('Matrix must be square (size: ' + format(mSize) + ')');\n }\n var data = [];\n if (isMatrix(b)) {\n var bSize = b.size();\n var bdata = b._data;\n\n // 1-dim vector\n if (bSize.length === 1) {\n if (bSize[0] !== rows) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var i = 0; i < rows; i++) {\n data[i] = [bdata[i]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n\n // 2-dim column\n if (bSize.length === 2) {\n if (bSize[0] !== rows || bSize[1] !== 1) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n if (isDenseMatrix(b)) {\n if (copy) {\n data = [];\n for (var _i = 0; _i < rows; _i++) {\n data[_i] = [bdata[_i][0]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n return b;\n }\n if (isSparseMatrix(b)) {\n for (var _i2 = 0; _i2 < rows; _i2++) {\n data[_i2] = [0];\n }\n var values = b._values;\n var index = b._index;\n var ptr = b._ptr;\n for (var k1 = ptr[1], k = ptr[0]; k < k1; k++) {\n var _i3 = index[k];\n data[_i3][0] = values[k];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1],\n datatype: b._datatype\n });\n }\n }\n throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.');\n }\n if (isArray(b)) {\n var bsize = arraySize(b);\n if (bsize.length === 1) {\n if (bsize[0] !== rows) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var _i4 = 0; _i4 < rows; _i4++) {\n data[_i4] = [b[_i4]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1]\n });\n }\n if (bsize.length === 2) {\n if (bsize[0] !== rows || bsize[1] !== 1) {\n throw new RangeError('Dimension mismatch. Matrix columns must match vector length.');\n }\n for (var _i5 = 0; _i5 < rows; _i5++) {\n data[_i5] = [b[_i5][0]];\n }\n return new DenseMatrix({\n data,\n size: [rows, 1]\n });\n }\n throw new RangeError('Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.');\n }\n };\n}", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'usolve';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createUsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds one solution of a linear equation system by backward substitution. Matrix must be an upper triangular matrix. Throws an error if there's no solution.\n *\n * `U * x = b`\n *\n * Syntax:\n *\n * math.usolve(U, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = usolve(a, b) // [[8], [9]]\n *\n * See also:\n *\n * usolveAll, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} U A N x N matrix or array (U)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix | Array} A column vector with the linear system solution (x)\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrixArrayMatrix(m, b) {\n return _sparseBackwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrixArrayMatrix(m, b) {\n return _denseBackwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function ArrayArrayMatrix(a, b) {\n var m = matrix(a);\n var r = _denseBackwardSubstitution(m, b);\n return r.valueOf();\n }\n });\n function _denseBackwardSubstitution(m, b) {\n // make b into a column vector\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // result\n var x = [];\n var mdata = m._data;\n // loop columns backwards\n for (var j = columns - 1; j >= 0; j--) {\n // b[j]\n var bj = bdata[j][0] || 0;\n // x[j]\n var xj = void 0;\n if (!equalScalar(bj, 0)) {\n // value at [j, j]\n var vjj = mdata[j][j];\n if (equalScalar(vjj, 0)) {\n // system cannot be solved\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n xj = divideScalar(bj, vjj);\n\n // loop rows\n for (var i = j - 1; i >= 0; i--) {\n // update copy of b\n bdata[i] = [subtractScalar(bdata[i][0] || 0, multiplyScalar(xj, mdata[i][j]))];\n }\n } else {\n // zero value at j\n xj = 0;\n }\n // update x\n x[j] = [xj];\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n function _sparseBackwardSubstitution(m, b) {\n // make b into a column vector\n b = solveValidation(m, b, true);\n var bdata = b._data;\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // result\n var x = [];\n\n // loop columns backwards\n for (var j = columns - 1; j >= 0; j--) {\n var bj = bdata[j][0] || 0;\n if (!equalScalar(bj, 0)) {\n // non-degenerate row, find solution\n\n var vjj = 0;\n\n // upper triangular matrix values & index (column j)\n var jValues = [];\n var jIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[j];\n var lastIndex = ptr[j + 1];\n\n // values in column, find value at [j, j], loop backwards\n for (var k = lastIndex - 1; k >= firstIndex; k--) {\n var i = index[k];\n\n // check row (rows are not sorted!)\n if (i === j) {\n vjj = values[k];\n } else if (i < j) {\n // store upper triangular\n jValues.push(values[k]);\n jIndices.push(i);\n }\n }\n\n // at this point we must have a value in vjj\n if (equalScalar(vjj, 0)) {\n throw new Error('Linear system cannot be solved since matrix is singular');\n }\n var xj = divideScalar(bj, vjj);\n for (var _k = 0, _lastIndex = jIndices.length; _k < _lastIndex; _k++) {\n var _i = jIndices[_k];\n bdata[_i] = [subtractScalar(bdata[_i][0], multiplyScalar(xj, jValues[_k]))];\n }\n x[j] = [xj];\n } else {\n // degenerate row, we can choose any value\n x[j] = [0];\n }\n }\n return new DenseMatrix({\n data: x,\n size: [rows, 1]\n });\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'lsolveAll';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createLsolveAll = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds all solutions of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix.\n *\n * `L * x = b`\n *\n * Syntax:\n *\n * math.lsolveAll(L, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = lsolveAll(a, b) // [ [[-5.5], [20]] ]\n *\n * See also:\n *\n * lsolve, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} L A N x N matrix or array (L)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrixArrayMatrix(m, b) {\n return _sparseForwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrixArrayMatrix(m, b) {\n return _denseForwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function ArrayArrayMatrix(a, b) {\n var m = matrix(a);\n var R = _denseForwardSubstitution(m, b);\n return R.map(r => r.valueOf());\n }\n });\n function _denseForwardSubstitution(m, b_) {\n // the algorithm is derived from\n // https://www.overleaf.com/read/csvgqdxggyjv\n\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var M = m._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // loop columns\n for (var i = 0; i < columns; i++) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n if (!equalScalar(M[i][i], 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], M[i][i]);\n for (var j = i + 1; j < columns; j++) {\n // b[j] -= b[i] * M[j,i]\n b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j = i + 1; _j < columns; _j++) {\n bNew[_j] = subtractScalar(bNew[_j], M[_j][i]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n function _sparseForwardSubstitution(m, b_) {\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // loop columns\n for (var i = 0; i < columns; i++) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n\n // values & indices (column i)\n var iValues = [];\n var iIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[i];\n var lastIndex = ptr[i + 1];\n\n // find the value at [i, i]\n var Mii = 0;\n for (var j = firstIndex; j < lastIndex; j++) {\n var J = index[j];\n // check row\n if (J === i) {\n Mii = values[j];\n } else if (J > i) {\n // store lower triangular\n iValues.push(values[j]);\n iIndices.push(J);\n }\n }\n if (!equalScalar(Mii, 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], Mii);\n for (var _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) {\n var _J = iIndices[_j2];\n b[_J] = subtractScalar(b[_J], multiplyScalar(b[i], iValues[_j2]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) {\n var _J2 = iIndices[_j3];\n bNew[_J2] = subtractScalar(bNew[_J2], iValues[_j3]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n});", "import { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nvar name = 'usolveAll';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'equalScalar', 'DenseMatrix'];\nexport var createUsolveAll = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n equalScalar,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Finds all solutions of a linear equation system by backward substitution. Matrix must be an upper triangular matrix.\n *\n * `U * x = b`\n *\n * Syntax:\n *\n * math.usolveAll(U, b)\n *\n * Examples:\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = usolveAll(a, b) // [ [[8], [9]] ]\n *\n * See also:\n *\n * usolve, lup, slu, usolve, lusolve\n *\n * @param {Matrix, Array} U A N x N matrix or array (U)\n * @param {Matrix, Array} b A column vector with the b values\n *\n * @return {DenseMatrix[] | Array[]} An array of affine-independent column vectors (x) that solve the linear system\n */\n return typed(name, {\n 'SparseMatrix, Array | Matrix': function SparseMatrixArrayMatrix(m, b) {\n return _sparseBackwardSubstitution(m, b);\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrixArrayMatrix(m, b) {\n return _denseBackwardSubstitution(m, b);\n },\n 'Array, Array | Matrix': function ArrayArrayMatrix(a, b) {\n var m = matrix(a);\n var R = _denseBackwardSubstitution(m, b);\n return R.map(r => r.valueOf());\n }\n });\n function _denseBackwardSubstitution(m, b_) {\n // the algorithm is derived from\n // https://www.overleaf.com/read/csvgqdxggyjv\n\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var M = m._data;\n var rows = m._size[0];\n var columns = m._size[1];\n\n // loop columns backwards\n for (var i = columns - 1; i >= 0; i--) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n if (!equalScalar(M[i][i], 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], M[i][i]);\n for (var j = i - 1; j >= 0; j--) {\n // b[j] -= b[i] * M[j,i]\n b[j] = subtractScalar(b[j], multiplyScalar(b[i], M[j][i]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n for (var _j = i - 1; _j >= 0; _j--) {\n bNew[_j] = subtractScalar(bNew[_j], M[_j][i]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n function _sparseBackwardSubstitution(m, b_) {\n // array of right-hand sides\n var B = [solveValidation(m, b_, true)._data.map(e => e[0])];\n var rows = m._size[0];\n var columns = m._size[1];\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n\n // loop columns backwards\n for (var i = columns - 1; i >= 0; i--) {\n var L = B.length;\n\n // loop right-hand sides\n for (var k = 0; k < L; k++) {\n var b = B[k];\n\n // values & indices (column i)\n var iValues = [];\n var iIndices = [];\n\n // first & last indeces in column\n var firstIndex = ptr[i];\n var lastIndex = ptr[i + 1];\n\n // find the value at [i, i]\n var Mii = 0;\n for (var j = lastIndex - 1; j >= firstIndex; j--) {\n var J = index[j];\n // check row\n if (J === i) {\n Mii = values[j];\n } else if (J < i) {\n // store upper triangular\n iValues.push(values[j]);\n iIndices.push(J);\n }\n }\n if (!equalScalar(Mii, 0)) {\n // non-singular row\n\n b[i] = divideScalar(b[i], Mii);\n\n // loop upper triangular\n for (var _j2 = 0, _lastIndex = iIndices.length; _j2 < _lastIndex; _j2++) {\n var _J = iIndices[_j2];\n b[_J] = subtractScalar(b[_J], multiplyScalar(b[i], iValues[_j2]));\n }\n } else if (!equalScalar(b[i], 0)) {\n // singular row, nonzero RHS\n\n if (k === 0) {\n // There is no valid solution\n return [];\n } else {\n // This RHS is invalid but other solutions may still exist\n B.splice(k, 1);\n k -= 1;\n L -= 1;\n }\n } else if (k === 0) {\n // singular row, RHS is zero\n\n var bNew = [...b];\n bNew[i] = 1;\n\n // loop upper triangular\n for (var _j3 = 0, _lastIndex2 = iIndices.length; _j3 < _lastIndex2; _j3++) {\n var _J2 = iIndices[_j3];\n bNew[_J2] = subtractScalar(bNew[_J2], iValues[_j3]);\n }\n B.push(bNew);\n }\n }\n }\n return B.map(x => new DenseMatrix({\n data: x.map(e => [e]),\n size: [rows, 1]\n }));\n }\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nimport { leftShiftNumber } from '../../plain/number/index.js';\nimport { leftShiftBigNumber } from '../../utils/bignumber/bitwise.js';\nvar name = 'leftShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createLeftShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise left logical shift of a value x by y number of bits, `x << y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.leftShift(x, y)\n *\n * Examples:\n *\n * math.leftShift(1, 2) // returns number 4\n *\n * math.leftShift([1, 2, 4], 4) // returns Array [16, 32, 64]\n *\n * See also:\n *\n * leftShift, bitNot, bitOr, bitXor, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber | bigint} y Amount of shifts\n * @return {number | BigNumber | bigint | Array | Matrix} `x` shifted left `y` times\n */\n return typed(name, {\n 'number, number': leftShiftNumber,\n 'BigNumber, BigNumber': leftShiftBigNumber,\n 'bigint, bigint': (x, y) => x << y,\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { factory } from '../../../utils/factory.js';\nimport { DimensionError } from '../../../error/DimensionError.js';\nvar name = 'matAlgo08xS0Sid';\nvar dependencies = ['typed', 'equalScalar'];\nexport var createMatAlgo08xS0Sid = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equalScalar\n } = _ref;\n /**\n * Iterates over SparseMatrix A and SparseMatrix B nonzero items and invokes the callback function f(Aij, Bij).\n * Callback function invoked MAX(NNZA, NNZB) times\n *\n *\n * \u250C f(Aij, Bij) ; A(i,j) !== 0 && B(i,j) !== 0\n * C(i,j) = \u2524 A(i,j) ; A(i,j) !== 0 && B(i,j) === 0\n * \u2514 0 ; otherwise\n *\n *\n * @param {Matrix} a The SparseMatrix instance (A)\n * @param {Matrix} b The SparseMatrix instance (B)\n * @param {Function} callback The f(Aij,Bij) operation to invoke\n *\n * @return {Matrix} SparseMatrix (C)\n *\n * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294\n */\n return function matAlgo08xS0Sid(a, b, callback) {\n // sparse matrix arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();\n // sparse matrix arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n var bsize = b._size;\n var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();\n\n // validate dimensions\n if (asize.length !== bsize.length) {\n throw new DimensionError(asize.length, bsize.length);\n }\n\n // check rows & columns\n if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {\n throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');\n }\n\n // sparse matrix cannot be a Pattern matrix\n if (!avalues || !bvalues) {\n throw new Error('Cannot perform operation on Pattern Sparse Matrices');\n }\n\n // rows & columns\n var rows = asize[0];\n var columns = asize[1];\n\n // datatype\n var dt;\n // equal signature to use\n var eq = equalScalar;\n // zero value\n var zero = 0;\n // callback signature to use\n var cf = callback;\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n // datatype\n dt = adt;\n // find signature that matches (dt, dt)\n eq = typed.find(equalScalar, [dt, dt]);\n // convert 0 to the same datatype\n zero = typed.convert(0, dt);\n // callback\n cf = typed.find(callback, [dt, dt]);\n }\n\n // result arrays\n var cvalues = [];\n var cindex = [];\n var cptr = [];\n\n // workspace\n var x = [];\n // marks indicating we have a value in x for a given column\n var w = [];\n\n // vars\n var k, k0, k1, i;\n\n // loop columns\n for (var j = 0; j < columns; j++) {\n // update cptr\n cptr[j] = cindex.length;\n // columns mark\n var mark = j + 1;\n // loop values in a\n for (k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = aindex[k];\n // mark workspace\n w[i] = mark;\n // set value\n x[i] = avalues[k];\n // add index\n cindex.push(i);\n }\n // loop values in b\n for (k0 = bptr[j], k1 = bptr[j + 1], k = k0; k < k1; k++) {\n // row\n i = bindex[k];\n // check value exists in workspace\n if (w[i] === mark) {\n // evaluate callback\n x[i] = cf(x[i], bvalues[k]);\n }\n }\n // initialize first index in j\n k = cptr[j];\n // loop index in j\n while (k < cindex.length) {\n // row\n i = cindex[k];\n // value @ i\n var v = x[i];\n // check for zero value\n if (!eq(v, zero)) {\n // push value\n cvalues.push(v);\n // increment pointer\n k++;\n } else {\n // remove value @ i, do not increment pointer\n cindex.splice(k, 1);\n }\n }\n }\n // update cptr\n cptr[columns] = cindex.length;\n\n // return sparse matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [rows, columns],\n datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined\n });\n };\n});", "import { factory } from '../../utils/factory.js';\nexport var createUseMatrixForArrayScalar = /* #__PURE__ */factory('useMatrixForArrayScalar', ['typed', 'matrix'], _ref => {\n var {\n typed,\n matrix\n } = _ref;\n return {\n 'Array, number': typed.referTo('DenseMatrix, number', selfDn => (x, y) => selfDn(matrix(x), y).valueOf()),\n 'Array, BigNumber': typed.referTo('DenseMatrix, BigNumber', selfDB => (x, y) => selfDB(matrix(x), y).valueOf()),\n 'number, Array': typed.referTo('number, DenseMatrix', selfnD => (x, y) => selfnD(x, matrix(y)).valueOf()),\n 'BigNumber, Array': typed.referTo('BigNumber, DenseMatrix', selfBD => (x, y) => selfBD(x, matrix(y)).valueOf())\n };\n});", "import { rightArithShiftBigNumber } from '../../utils/bignumber/bitwise.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nimport { rightArithShiftNumber } from '../../plain/number/index.js';\nvar name = 'rightArithShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createRightArithShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise right arithmetic shift of a value x by y number of bits, `x >> y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.rightArithShift(x, y)\n *\n * Examples:\n *\n * math.rightArithShift(4, 2) // returns number 1\n *\n * math.rightArithShift([16, -32, 64], 4) // returns Array [1, -2, 4]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, bitXor, rightArithShift, rightLogShift\n *\n * @param {number | BigNumber | bigint | Array | Matrix} x Value to be shifted\n * @param {number | BigNumber | bigint} y Amount of shifts\n * @return {number | BigNumber | bigint | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n return typed(name, {\n 'number, number': rightArithShiftNumber,\n 'BigNumber, BigNumber': rightArithShiftBigNumber,\n 'bigint, bigint': (x, y) => x >> y,\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatAlgo08xS0Sid } from '../../type/matrix/utils/matAlgo08xS0Sid.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { rightLogShiftNumber } from '../../plain/number/index.js';\nimport { createUseMatrixForArrayScalar } from './useMatrixForArrayScalar.js';\nvar name = 'rightLogShift';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix', 'concat'];\nexport var createRightLogShift = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo08xS0Sid = createMatAlgo08xS0Sid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var useMatrixForArrayScalar = createUseMatrixForArrayScalar({\n typed,\n matrix\n });\n\n /**\n * Bitwise right logical shift of value x by y number of bits, `x >>> y`.\n * For matrices, the function is evaluated element wise.\n * For units, the function is evaluated on the best prefix base.\n *\n * Syntax:\n *\n * math.rightLogShift(x, y)\n *\n * Examples:\n *\n * math.rightLogShift(4, 2) // returns number 1\n *\n * math.rightLogShift([16, 32, 64], 4) // returns Array [1, 2, 4]\n *\n * See also:\n *\n * bitAnd, bitNot, bitOr, bitXor, leftShift, rightLogShift\n *\n * @param {number | Array | Matrix} x Value to be shifted\n * @param {number} y Amount of shifts\n * @return {number | Array | Matrix} `x` zero-filled shifted right `y` times\n */\n\n return typed(name, {\n 'number, number': rightLogShiftNumber,\n // 'BigNumber, BigNumber': ..., // TODO: implement BigNumber support for rightLogShift\n\n 'SparseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, number | BigNumber': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(y, 0)) {\n return x.clone();\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'number | BigNumber, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo10xSids(y, x, self, true);\n }),\n 'number | BigNumber, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (equalScalar(x, 0)) {\n return zeros(y.size(), y.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n })\n }, useMatrixForArrayScalar, matrixAlgorithmSuite({\n SS: matAlgo08xS0Sid,\n DS: matAlgo01xDSid,\n SD: matAlgo02xDS0\n }));\n});", "import { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nimport { createMatAlgo06xS0S0 } from '../../type/matrix/utils/matAlgo06xS0S0.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { andNumber } from '../../plain/number/index.js';\nvar name = 'and';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'not', 'concat'];\nexport var createAnd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo06xS0S0 = createMatAlgo06xS0S0({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Logical `and`. Test whether two values are both defined with a nonzero/nonempty value.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.and(x, y)\n *\n * Examples:\n *\n * math.and(2, 4) // returns true\n *\n * a = [2, 0, 0]\n * b = [3, 7, 0]\n * c = 0\n *\n * math.and(a, b) // returns [true, false, false]\n * math.and(a, c) // returns [false, false, false]\n *\n * See also:\n *\n * not, or, xor\n *\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} x First value to check\n * @param {number | BigNumber | bigint | Complex | Unit | Array | Matrix} y Second value to check\n * @return {boolean | Array | Matrix}\n * Returns true when both inputs are defined with a nonzero/nonempty value.\n */\n return typed(name, {\n 'number, number': andNumber,\n 'Complex, Complex': function ComplexComplex(x, y) {\n return (x.re !== 0 || x.im !== 0) && (y.re !== 0 || y.im !== 0);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return !x.isZero() && !y.isZero() && !x.isNaN() && !y.isNaN();\n },\n 'bigint, bigint': andNumber,\n 'Unit, Unit': typed.referToSelf(self => (x, y) => self(x.value || 0, y.value || 0)),\n 'SparseMatrix, any': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(y)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo11xS0s(x, y, self, false);\n }),\n 'DenseMatrix, any': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(y)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo14xDs(x, y, self, false);\n }),\n 'any, SparseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(x)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo11xS0s(y, x, self, true);\n }),\n 'any, DenseMatrix': typed.referToSelf(self => (x, y) => {\n // check scalar\n if (not(x)) {\n // return zero matrix\n return zeros(x.size(), x.storage());\n }\n return matAlgo14xDs(y, x, self, true);\n }),\n 'Array, any': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return self(matrix(x), y).valueOf();\n }),\n 'any, Array': typed.referToSelf(self => (x, y) => {\n // use matrix implementation\n return self(x, matrix(y)).valueOf();\n })\n }, matrixAlgorithmSuite({\n SS: matAlgo06xS0S0,\n DS: matAlgo02xDS0\n }));\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatAlgo05xSfSf } from '../../type/matrix/utils/matAlgo05xSfSf.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'compare';\nvar dependencies = ['typed', 'config', 'matrix', 'equalScalar', 'BigNumber', 'Fraction', 'DenseMatrix', 'concat'];\nexport var createCompare = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n equalScalar,\n matrix,\n BigNumber,\n Fraction,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo05xSfSf = createMatAlgo05xSfSf({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.\n *\n * x and y are considered equal when the relative difference between x and y\n * is smaller than the configured absTol and relTol. The function cannot be used to\n * compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.compare(x, y)\n *\n * Examples:\n *\n * math.compare(6, 1) // returns 1\n * math.compare(2, 3) // returns -1\n * math.compare(7, 7) // returns 0\n * math.compare('10', '2') // returns 1\n * math.compare('1000', '1e3') // returns 0\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('40 mm')\n * math.compare(a, b) // returns 1\n *\n * math.compare(2, [1, 2, 3]) // returns [1, 0, -1]\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, larger, largerEq, compareNatural, compareText\n *\n * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | Unit | string | Array | Matrix} y Second value to compare\n * @return {number | BigNumber | bigint | Fraction | Array | Matrix} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, createCompareNumber({\n typed,\n config\n }), {\n 'boolean, boolean': function booleanBoolean(x, y) {\n return x === y ? 0 : x > y ? 1 : -1;\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return bigNearlyEqual(x, y, config.relTol, config.absTol) ? new BigNumber(0) : new BigNumber(x.cmp(y));\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x === y ? 0n : x > y ? 1n : -1n;\n },\n 'Fraction, Fraction': function FractionFraction(x, y) {\n return new Fraction(x.compare(y));\n },\n 'Complex, Complex': function ComplexComplex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo05xSfSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createCompareNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return nearlyEqual(x, y, config.relTol, config.absTol) ? 0 : x > y ? 1 : -1;\n }\n });\n});", "import naturalSort from 'javascript-natural-sort';\nimport { isDenseMatrix, isSparseMatrix, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'compareNatural';\nvar dependencies = ['typed', 'compare'];\nexport var createCompareNatural = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compare\n } = _ref;\n var compareBooleans = compare.signatures['boolean,boolean'];\n\n /**\n * Compare two values of any type in a deterministic, natural way.\n *\n * For numeric values, the function works the same as `math.compare`.\n * For types of values that can't be compared mathematically,\n * the function compares in a natural way.\n *\n * For numeric values, x and y are considered equal when the relative\n * difference between x and y is smaller than the configured relTol and absTol.\n * The function cannot be used to compare values smaller than\n * approximately 2.22e-16.\n *\n * For Complex numbers, first the real parts are compared. If equal,\n * the imaginary parts are compared.\n *\n * Strings are compared with a natural sorting algorithm, which\n * orders strings in a \"logic\" way following some heuristics.\n * This differs from the function `compare`, which converts the string\n * into a numeric value and compares that. The function `compareText`\n * on the other hand compares text lexically.\n *\n * Arrays and Matrices are compared value by value until there is an\n * unequal pair of values encountered. Objects are compared by sorted\n * keys until the keys or their values are unequal.\n *\n * Syntax:\n *\n * math.compareNatural(x, y)\n *\n * Examples:\n *\n * math.compareNatural(6, 1) // returns 1\n * math.compareNatural(2, 3) // returns -1\n * math.compareNatural(7, 7) // returns 0\n *\n * math.compareNatural('10', '2') // returns 1\n * math.compareText('10', '2') // returns -1\n * math.compare('10', '2') // returns 1\n *\n * math.compareNatural('Answer: 10', 'Answer: 2') // returns 1\n * math.compareText('Answer: 10', 'Answer: 2') // returns -1\n * math.compare('Answer: 10', 'Answer: 2')\n * // Error: Cannot convert \"Answer: 10\" to a number\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('40 mm')\n * math.compareNatural(a, b) // returns 1\n *\n * const c = math.complex('2 + 3i')\n * const d = math.complex('2 + 4i')\n * math.compareNatural(c, d) // returns -1\n *\n * math.compareNatural([1, 2, 4], [1, 2, 3]) // returns 1\n * math.compareNatural([1, 2, 3], [1, 2]) // returns 1\n * math.compareNatural([1, 5], [1, 2, 3]) // returns 1\n * math.compareNatural([1, 2], [1, 2]) // returns 0\n *\n * math.compareNatural({a: 2}, {a: 4}) // returns -1\n *\n * See also:\n *\n * compare, compareText\n *\n * @param {*} x First value to compare\n * @param {*} y Second value to compare\n * @return {number} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, {\n 'any, any': _compareNatural\n }); // just to check # args\n\n function _compareNatural(x, y) {\n var typeX = typeOf(x);\n var typeY = typeOf(y);\n var c;\n\n // numeric types\n if ((typeX === 'number' || typeX === 'BigNumber' || typeX === 'Fraction') && (typeY === 'number' || typeY === 'BigNumber' || typeY === 'Fraction')) {\n c = compare(x, y);\n if (c.toString() !== '0') {\n // c can be number, BigNumber, or Fraction\n return c > 0 ? 1 : -1; // return a number\n } else {\n return naturalSort(typeX, typeY);\n }\n }\n\n // matrix types\n var matTypes = ['Array', 'DenseMatrix', 'SparseMatrix'];\n if (matTypes.includes(typeX) || matTypes.includes(typeY)) {\n c = compareMatricesAndArrays(_compareNatural, x, y);\n if (c !== 0) {\n return c;\n } else {\n return naturalSort(typeX, typeY);\n }\n }\n\n // in case of different types, order by name of type, i.e. 'BigNumber' < 'Complex'\n if (typeX !== typeY) {\n return naturalSort(typeX, typeY);\n }\n if (typeX === 'Complex') {\n return compareComplexNumbers(x, y);\n }\n if (typeX === 'Unit') {\n if (x.equalBase(y)) {\n return _compareNatural(x.value, y.value);\n }\n\n // compare by units\n return compareArrays(_compareNatural, x.formatUnits(), y.formatUnits());\n }\n if (typeX === 'boolean') {\n return compareBooleans(x, y);\n }\n if (typeX === 'string') {\n return naturalSort(x, y);\n }\n if (typeX === 'Object') {\n return compareObjects(_compareNatural, x, y);\n }\n if (typeX === 'null') {\n return 0;\n }\n if (typeX === 'undefined') {\n return 0;\n }\n\n // this should not occur...\n throw new TypeError('Unsupported type of value \"' + typeX + '\"');\n }\n\n /**\n * Compare mixed matrix/array types, by converting to same-shaped array.\n * This comparator is non-deterministic regarding input types.\n * @param {Array | SparseMatrix | DenseMatrix | *} x\n * @param {Array | SparseMatrix | DenseMatrix | *} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareMatricesAndArrays(compareNatural, x, y) {\n if (isSparseMatrix(x) && isSparseMatrix(y)) {\n return compareArrays(compareNatural, x.toJSON().values, y.toJSON().values);\n }\n if (isSparseMatrix(x)) {\n // note: convert to array is expensive\n return compareMatricesAndArrays(compareNatural, x.toArray(), y);\n }\n if (isSparseMatrix(y)) {\n // note: convert to array is expensive\n return compareMatricesAndArrays(compareNatural, x, y.toArray());\n }\n\n // convert DenseArray into Array\n if (isDenseMatrix(x)) {\n return compareMatricesAndArrays(compareNatural, x.toJSON().data, y);\n }\n if (isDenseMatrix(y)) {\n return compareMatricesAndArrays(compareNatural, x, y.toJSON().data);\n }\n\n // convert scalars to array\n if (!Array.isArray(x)) {\n return compareMatricesAndArrays(compareNatural, [x], y);\n }\n if (!Array.isArray(y)) {\n return compareMatricesAndArrays(compareNatural, x, [y]);\n }\n return compareArrays(compareNatural, x, y);\n }\n\n /**\n * Compare two Arrays\n *\n * - First, compares value by value\n * - Next, if all corresponding values are equal,\n * look at the length: longest array will be considered largest\n *\n * @param {Array} x\n * @param {Array} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareArrays(compareNatural, x, y) {\n // compare each value\n for (var i = 0, ii = Math.min(x.length, y.length); i < ii; i++) {\n var v = compareNatural(x[i], y[i]);\n if (v !== 0) {\n return v;\n }\n }\n\n // compare the size of the arrays\n if (x.length > y.length) {\n return 1;\n }\n if (x.length < y.length) {\n return -1;\n }\n\n // both Arrays have equal size and content\n return 0;\n }\n\n /**\n * Compare two objects\n *\n * - First, compare sorted property names\n * - Next, compare the property values\n *\n * @param {Object} x\n * @param {Object} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\n function compareObjects(compareNatural, x, y) {\n var keysX = Object.keys(x);\n var keysY = Object.keys(y);\n\n // compare keys\n keysX.sort(naturalSort);\n keysY.sort(naturalSort);\n var c = compareArrays(compareNatural, keysX, keysY);\n if (c !== 0) {\n return c;\n }\n\n // compare values\n for (var i = 0; i < keysX.length; i++) {\n var v = compareNatural(x[keysX[i]], y[keysY[i]]);\n if (v !== 0) {\n return v;\n }\n }\n return 0;\n }\n});\n\n/**\n * Compare two complex numbers, `x` and `y`:\n *\n * - First, compare the real values of `x` and `y`\n * - If equal, compare the imaginary values of `x` and `y`\n *\n * @params {Complex} x\n * @params {Complex} y\n * @returns {number} Returns the comparison result: -1, 0, or 1\n */\nfunction compareComplexNumbers(x, y) {\n if (x.re > y.re) {\n return 1;\n }\n if (x.re < y.re) {\n return -1;\n }\n if (x.im > y.im) {\n return 1;\n }\n if (x.im < y.im) {\n return -1;\n }\n return 0;\n}", "import { compareText as _compareText } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'compareText';\nvar dependencies = ['typed', 'matrix', 'concat'];\n_compareText.signature = 'any, any';\nexport var createCompareText = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n concat\n } = _ref;\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Compare two strings lexically. Comparison is case sensitive.\n * Returns 1 when x > y, -1 when x < y, and 0 when x == y.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.compareText(x, y)\n *\n * Examples:\n *\n * math.compareText('B', 'A') // returns 1\n * math.compareText('2', '10') // returns 1\n * math.compare('2', '10') // returns -1\n * math.compareNatural('2', '10') // returns -1\n *\n * math.compareText('B', ['A', 'B', 'C']) // returns [1, 0, -1]\n *\n * See also:\n *\n * equal, equalText, compare, compareNatural\n *\n * @param {string | Array | DenseMatrix} x First string to compare\n * @param {string | Array | DenseMatrix} y Second string to compare\n * @return {number | Array | DenseMatrix} Returns the result of the comparison:\n * 1 when x > y, -1 when x < y, and 0 when x == y.\n */\n return typed(name, _compareText, matrixAlgorithmSuite({\n elop: _compareText,\n Ds: true\n }));\n});\nexport var createCompareTextNumber = /* #__PURE__ */factory(name, ['typed'], _ref2 => {\n var {\n typed\n } = _ref2;\n return typed(name, _compareText);\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'equal';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Test whether two values are equal.\n *\n * The function tests whether the relative difference between x and y is\n * smaller than the configured relTol and absTol. The function cannot be used to\n * compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * In case of complex numbers, x.re must equal y.re, and x.im must equal y.im.\n *\n * Values `null` and `undefined` are compared strictly, thus `null` is only\n * equal to `null` and nothing else, and `undefined` is only equal to\n * `undefined` and nothing else. Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.equal(x, y)\n *\n * Examples:\n *\n * math.equal(2 + 2, 3) // returns false\n * math.equal(2 + 2, 4) // returns true\n *\n * const a = math.unit('50 cm')\n * const b = math.unit('5 m')\n * math.equal(a, b) // returns true\n *\n * const c = [2, 5, 1]\n * const d = [2, 7, 1]\n *\n * math.equal(c, d) // returns [true, false, true]\n * math.deepEqual(c, d) // returns false\n *\n * math.equal(\"1000\", \"1e3\") // returns true\n * math.equal(0, null) // returns false\n *\n * See also:\n *\n * unequal, smaller, smallerEq, larger, largerEq, compare, deepEqual, equalText\n *\n * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | boolean | Complex | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the compared values are equal, else returns false\n */\n return typed(name, createEqualNumber({\n typed,\n equalScalar\n }), matrixAlgorithmSuite({\n elop: equalScalar,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createEqualNumber = factory(name, ['typed', 'equalScalar'], _ref2 => {\n var {\n typed,\n equalScalar\n } = _ref2;\n return typed(name, {\n 'any, any': function anyAny(x, y) {\n // strict equality for null and undefined?\n if (x === null) {\n return y === null;\n }\n if (y === null) {\n return x === null;\n }\n if (x === undefined) {\n return y === undefined;\n }\n if (y === undefined) {\n return x === undefined;\n }\n return equalScalar(x, y);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'equalText';\nvar dependencies = ['typed', 'compareText', 'isZero'];\nexport var createEqualText = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compareText,\n isZero\n } = _ref;\n /**\n * Check equality of two strings. Comparison is case sensitive.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.equalText(x, y)\n *\n * Examples:\n *\n * math.equalText('Hello', 'Hello') // returns true\n * math.equalText('a', 'A') // returns false\n * math.equal('2e3', '2000') // returns true\n * math.equalText('2e3', '2000') // returns false\n *\n * math.equalText('B', ['A', 'B', 'C']) // returns [false, true, false]\n *\n * See also:\n *\n * equal, compareText, compare, compareNatural\n *\n * @param {string | Array | DenseMatrix} x First string to compare\n * @param {string | Array | DenseMatrix} y Second string to compare\n * @return {number | Array | DenseMatrix} Returns true if the values are equal, and false if not.\n */\n return typed(name, {\n 'any, any': function anyAny(x, y) {\n return isZero(compareText(x, y));\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'smaller';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createSmaller = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is smaller than y.\n *\n * The function returns true when x is smaller than y and the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.smaller(x, y)\n *\n * Examples:\n *\n * math.smaller(2, 3) // returns true\n * math.smaller(5, 2 * 2) // returns false\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('2 inch')\n * math.smaller(a, b) // returns true\n *\n * See also:\n *\n * equal, unequal, smallerEq, smaller, smallerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false\n */\n return typed(name, createSmallerNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x < y,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.lt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x < y,\n 'Fraction, Fraction': (x, y) => x.compare(y) === -1,\n 'Complex, Complex': function ComplexComplex(x, y) {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createSmallerNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return x < y && !nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'smallerEq';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createSmallerEq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is smaller or equal to y.\n *\n * The function returns true when x is smaller than y or the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.smallerEq(x, y)\n *\n * Examples:\n *\n * math.smaller(1 + 2, 3) // returns false\n * math.smallerEq(1 + 2, 3) // returns true\n *\n * See also:\n *\n * equal, unequal, smaller, larger, largerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is smaller than y, else returns false\n */\n return typed(name, createSmallerEqNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x <= y,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.lte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x <= y,\n 'Fraction, Fraction': (x, y) => x.compare(y) !== 1,\n 'Complex, Complex': function ComplexComplex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createSmallerEqNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return x <= y || nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'larger';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createLarger = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is larger than y.\n *\n * The function returns true when x is larger than y and the relative\n * difference between x and y is larger than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.larger(x, y)\n *\n * Examples:\n *\n * math.larger(2, 3) // returns false\n * math.larger(5, 2 + 2) // returns true\n *\n * const a = math.unit('5 cm')\n * const b = math.unit('2 inch')\n * math.larger(a, b) // returns false\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, largerEq, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is larger than y, else returns false\n */\n return typed(name, createLargerNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x > y,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.gt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': (x, y) => x > y,\n 'Fraction, Fraction': (x, y) => x.compare(y) === 1,\n 'Complex, Complex': function ComplexComplex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createLargerNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return x > y && !nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual.js';\nimport { nearlyEqual } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nimport { createCompareUnits } from './compareUnits.js';\nvar name = 'largerEq';\nvar dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];\nexport var createLargerEq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n var compareUnits = createCompareUnits({\n typed\n });\n\n /**\n * Test whether value x is larger or equal to y.\n *\n * The function returns true when x is larger than y or the relative\n * difference between x and y is smaller than the configured relTol and absTol. The\n * function cannot be used to compare values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.largerEq(x, y)\n *\n * Examples:\n *\n * math.larger(2, 1 + 1) // returns false\n * math.largerEq(2, 1 + 1) // returns true\n *\n * See also:\n *\n * equal, unequal, smaller, smallerEq, larger, compare\n *\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} x First value to compare\n * @param {number | BigNumber | bigint | Fraction | boolean | Unit | string | Array | Matrix} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the x is larger or equal to y, else returns false\n */\n return typed(name, createLargerEqNumber({\n typed,\n config\n }), {\n 'boolean, boolean': (x, y) => x >= y,\n 'BigNumber, BigNumber': function BigNumberBigNumber(x, y) {\n return x.gte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);\n },\n 'bigint, bigint': function bigintBigint(x, y) {\n return x >= y;\n },\n 'Fraction, Fraction': (x, y) => x.compare(y) !== -1,\n 'Complex, Complex': function ComplexComplex() {\n throw new TypeError('No ordering relation is defined for complex numbers');\n }\n }, compareUnits, matrixAlgorithmSuite({\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n});\nexport var createLargerEqNumber = /* #__PURE__ */factory(name, ['typed', 'config'], _ref2 => {\n var {\n typed,\n config\n } = _ref2;\n return typed(name, {\n 'number, number': function numberNumber(x, y) {\n return x >= y || nearlyEqual(x, y, config.relTol, config.absTol);\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'deepEqual';\nvar dependencies = ['typed', 'equal'];\nexport var createDeepEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n equal\n } = _ref;\n /**\n * Test element wise whether two matrices are equal.\n * The function accepts both matrices and scalar values.\n *\n * Strings are compared by their numerical value.\n *\n * Syntax:\n *\n * math.deepEqual(x, y)\n *\n * Examples:\n *\n * math.deepEqual(2, 4) // returns false\n *\n * a = [2, 5, 1]\n * b = [2, 7, 1]\n *\n * math.deepEqual(a, b) // returns false\n * math.equal(a, b) // returns [true, false, true]\n *\n * See also:\n *\n * equal, unequal\n *\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} x First matrix to compare\n * @param {number | BigNumber | Fraction | Complex | Unit | Array | Matrix} y Second matrix to compare\n * @return {number | BigNumber | Fraction | Complex | Unit | Array | Matrix}\n * Returns true when the input matrices have the same size and each of their elements is equal.\n */\n return typed(name, {\n 'any, any': function anyAny(x, y) {\n return _deepEqual(x.valueOf(), y.valueOf());\n }\n });\n\n /**\n * Test whether two arrays have the same size and all elements are equal\n * @param {Array | *} x\n * @param {Array | *} y\n * @return {boolean} Returns true if both arrays are deep equal\n */\n function _deepEqual(x, y) {\n if (Array.isArray(x)) {\n if (Array.isArray(y)) {\n var len = x.length;\n if (len !== y.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n if (!_deepEqual(x[i], y[i])) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n } else {\n if (Array.isArray(y)) {\n return false;\n } else {\n return equal(x, y);\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'unequal';\nvar dependencies = ['typed', 'config', 'equalScalar', 'matrix', 'DenseMatrix', 'concat'];\nexport var createUnequal = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n equalScalar,\n matrix,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo07xSSf = createMatAlgo07xSSf({\n typed,\n DenseMatrix\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Test whether two values are unequal.\n *\n * The function tests whether the relative difference between x and y is\n * larger than the configured relTol and absTol. The function cannot be used to compare\n * values smaller than approximately 2.22e-16.\n *\n * For matrices, the function is evaluated element wise.\n * In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im.\n * Strings are compared by their numerical value.\n *\n * Values `null` and `undefined` are compared strictly, thus `null` is unequal\n * with everything except `null`, and `undefined` is unequal with everything\n * except `undefined`.\n *\n * Syntax:\n *\n * math.unequal(x, y)\n *\n * Examples:\n *\n * math.unequal(2 + 2, 3) // returns true\n * math.unequal(2 + 2, 4) // returns false\n *\n * const a = math.unit('50 cm')\n * const b = math.unit('5 m')\n * math.unequal(a, b) // returns false\n *\n * const c = [2, 5, 1]\n * const d = [2, 7, 1]\n *\n * math.unequal(c, d) // returns [false, true, false]\n * math.deepEqual(c, d) // returns false\n *\n * math.unequal(0, null) // returns true\n * See also:\n *\n * equal, deepEqual, smaller, smallerEq, larger, largerEq, compare\n *\n * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} x First value to compare\n * @param {number | BigNumber | Fraction | boolean | Complex | Unit | string | Array | Matrix | undefined} y Second value to compare\n * @return {boolean | Array | Matrix} Returns true when the compared values are unequal, else returns false\n */\n return typed(name, createUnequalNumber({\n typed,\n equalScalar\n }), matrixAlgorithmSuite({\n elop: _unequal,\n SS: matAlgo07xSSf,\n DS: matAlgo03xDSf,\n Ss: matAlgo12xSfs\n }));\n function _unequal(x, y) {\n return !equalScalar(x, y);\n }\n});\nexport var createUnequalNumber = factory(name, ['typed', 'equalScalar'], _ref2 => {\n var {\n typed,\n equalScalar\n } = _ref2;\n return typed(name, {\n 'any, any': function anyAny(x, y) {\n // strict equality for null and undefined?\n if (x === null) {\n return y !== null;\n }\n if (y === null) {\n return x !== null;\n }\n if (x === undefined) {\n return y !== undefined;\n }\n if (y === undefined) {\n return x !== undefined;\n }\n return !equalScalar(x, y);\n }\n });\n});", "import { isMatrix } from '../../utils/is.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'partitionSelect';\nvar dependencies = ['typed', 'isNumeric', 'isNaN', 'compare'];\nexport var createPartitionSelect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isNumeric,\n isNaN,\n compare\n } = _ref;\n var asc = compare;\n var desc = (a, b) => -compare(a, b);\n\n /**\n * Partition-based selection of an array or 1D matrix.\n * Will find the kth smallest value, and mutates the input array.\n * Uses Quickselect.\n *\n * Syntax:\n *\n * math.partitionSelect(x, k)\n * math.partitionSelect(x, k, compare)\n *\n * Examples:\n *\n * math.partitionSelect([5, 10, 1], 2) // returns 10\n * math.partitionSelect(['C', 'B', 'A', 'D'], 1, math.compareText) // returns 'B'\n *\n * function sortByLength (a, b) {\n * return a.length - b.length\n * }\n * math.partitionSelect(['Langdon', 'Tom', 'Sara'], 2, sortByLength) // returns 'Langdon'\n *\n * // the input array is mutated\n * arr = [5, 2, 1]\n * math.partitionSelect(arr, 0) // returns 1, arr is now: [1, 2, 5]\n * math.partitionSelect(arr, 1, 'desc') // returns 2, arr is now: [5, 2, 1]\n *\n * See also:\n *\n * sort\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to sort\n * @param {Number} k The kth smallest value to be retrieved zero-based index\n * @param {Function | 'asc' | 'desc'} [compare='asc']\n * An optional comparator function. The function is called as\n * `compare(a, b)`, and must return 1 when a > b, -1 when a < b,\n * and 0 when a == b.\n * @return {*} Returns the kth lowest value.\n */\n return typed(name, {\n 'Array | Matrix, number': function ArrayMatrixNumber(x, k) {\n return _partitionSelect(x, k, asc);\n },\n 'Array | Matrix, number, string': function ArrayMatrixNumberString(x, k, compare) {\n if (compare === 'asc') {\n return _partitionSelect(x, k, asc);\n } else if (compare === 'desc') {\n return _partitionSelect(x, k, desc);\n } else {\n throw new Error('Compare string must be \"asc\" or \"desc\"');\n }\n },\n 'Array | Matrix, number, function': _partitionSelect\n });\n function _partitionSelect(x, k, compare) {\n if (!isInteger(k) || k < 0) {\n throw new Error('k must be a non-negative integer');\n }\n if (isMatrix(x)) {\n var size = x.size();\n if (size.length > 1) {\n throw new Error('Only one dimensional matrices supported');\n }\n return quickSelect(x.valueOf(), k, compare);\n }\n if (Array.isArray(x)) {\n return quickSelect(x, k, compare);\n }\n }\n\n /**\n * Quickselect algorithm.\n * Code adapted from:\n * https://blog.teamleadnet.com/2012/07/quick-select-algorithm-find-kth-element.html\n *\n * @param {Array} arr\n * @param {Number} k\n * @param {Function} compare\n * @private\n */\n function quickSelect(arr, k, compare) {\n if (k >= arr.length) {\n throw new Error('k out of bounds');\n }\n\n // check for NaN values since these can cause an infinite while loop\n for (var i = 0; i < arr.length; i++) {\n if (isNumeric(arr[i]) && isNaN(arr[i])) {\n return arr[i]; // return NaN\n }\n }\n var from = 0;\n var to = arr.length - 1;\n\n // if from == to we reached the kth element\n while (from < to) {\n var r = from;\n var w = to;\n var pivot = arr[Math.floor(Math.random() * (to - from + 1)) + from];\n\n // stop if the reader and writer meets\n while (r < w) {\n // arr[r] >= pivot\n if (compare(arr[r], pivot) >= 0) {\n // put the large values at the end\n var tmp = arr[w];\n arr[w] = arr[r];\n arr[r] = tmp;\n --w;\n } else {\n // the value is smaller than the pivot, skip\n ++r;\n }\n }\n\n // if we stepped up (r++) we need to step one down (arr[r] > pivot)\n if (compare(arr[r], pivot) > 0) {\n --r;\n }\n\n // the r pointer is on the end of the first k elements\n if (k <= r) {\n to = r;\n } else {\n from = r + 1;\n }\n }\n return arr[k];\n }\n});", "import { arraySize as size } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'sort';\nvar dependencies = ['typed', 'matrix', 'compare', 'compareNatural'];\nexport var createSort = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n compare,\n compareNatural\n } = _ref;\n var compareAsc = compare;\n var compareDesc = (a, b) => -compare(a, b);\n\n /**\n * Sort the items in a matrix.\n *\n * Syntax:\n *\n * math.sort(x)\n * math.sort(x, compare)\n *\n * Examples:\n *\n * math.sort([5, 10, 1]) // returns [1, 5, 10]\n * math.sort(['C', 'B', 'A', 'D'], math.compareNatural)\n * // returns ['A', 'B', 'C', 'D']\n *\n * function sortByLength (a, b) {\n * return a.length - b.length\n * }\n * math.sort(['Langdon', 'Tom', 'Sara'], sortByLength)\n * // returns ['Tom', 'Sara', 'Langdon']\n *\n * See also:\n *\n * filter, forEach, map, compare, compareNatural\n *\n * @param {Matrix | Array} x A one dimensional matrix or array to sort\n * @param {Function | 'asc' | 'desc' | 'natural'} [compare='asc']\n * An optional _comparator function or name. The function is called as\n * `compare(a, b)`, and must return 1 when a > b, -1 when a < b,\n * and 0 when a == b.\n * @return {Matrix | Array} Returns the sorted matrix.\n */\n return typed(name, {\n Array: function Array(x) {\n _arrayIsVector(x);\n return x.sort(compareAsc);\n },\n Matrix: function Matrix(x) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(compareAsc), x.storage());\n },\n 'Array, function': function ArrayFunction(x, _comparator) {\n _arrayIsVector(x);\n return x.sort(_comparator);\n },\n 'Matrix, function': function MatrixFunction(x, _comparator) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(_comparator), x.storage());\n },\n 'Array, string': function ArrayString(x, order) {\n _arrayIsVector(x);\n return x.sort(_comparator(order));\n },\n 'Matrix, string': function MatrixString(x, order) {\n _matrixIsVector(x);\n return matrix(x.toArray().sort(_comparator(order)), x.storage());\n }\n });\n\n /**\n * Get the comparator for given order ('asc', 'desc', 'natural')\n * @param {'asc' | 'desc' | 'natural'} order\n * @return {Function} Returns a _comparator function\n */\n function _comparator(order) {\n if (order === 'asc') {\n return compareAsc;\n } else if (order === 'desc') {\n return compareDesc;\n } else if (order === 'natural') {\n return compareNatural;\n } else {\n throw new Error('String \"asc\", \"desc\", or \"natural\" expected');\n }\n }\n\n /**\n * Validate whether an array is one dimensional\n * Throws an error when this is not the case\n * @param {Array} array\n * @private\n */\n function _arrayIsVector(array) {\n if (size(array).length !== 1) {\n throw new Error('One dimensional array expected');\n }\n }\n\n /**\n * Validate whether a matrix is one dimensional\n * Throws an error when this is not the case\n * @param {Matrix} matrix\n * @private\n */\n function _matrixIsVector(matrix) {\n if (matrix.size().length !== 1) {\n throw new Error('One dimensional matrix expected');\n }\n }\n});", "import { deepForEach, reduce, containsCollections } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'max';\nvar dependencies = ['typed', 'config', 'numeric', 'larger'];\nexport var createMax = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n larger\n } = _ref;\n /**\n * Compute the maximum value of a matrix or a list with values.\n * In case of a multidimensional array, the maximum of the flattened array\n * will be calculated. When `dim` is provided, the maximum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.max(a, b, c, ...)\n * math.max(A)\n * math.max(A, dimension)\n *\n * Examples:\n *\n * math.max(2, 1, 4, 3) // returns 4\n * math.max([2, 1, 4, 3]) // returns 4\n *\n * // maximum over a specified dimension (zero-based)\n * math.max([[2, 5], [4, 3], [1, 7]], 0) // returns [4, 7]\n * math.max([[2, 5], [4, 3], [1, 7]], 1) // returns [5, 4, 7]\n *\n * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1\n * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5\n *\n * See also:\n *\n * mean, median, min, prod, std, sum, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The maximum value\n */\n return typed(name, {\n // max([a, b, c, d, ...])\n 'Array | Matrix': _max,\n // max([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function ArrayMatrixNumberBigNumber(array, dim) {\n return reduce(array, dim.valueOf(), _largest);\n },\n // max(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function max');\n }\n return _max(args);\n }\n });\n\n /**\n * Return the largest of two values\n * @param {*} x\n * @param {*} y\n * @returns {*} Returns x when x is largest, or y when y is largest\n * @private\n */\n function _largest(x, y) {\n try {\n return larger(x, y) ? x : y;\n } catch (err) {\n throw improveErrorMessage(err, 'max', y);\n }\n }\n\n /**\n * Recursively calculate the maximum value in an n-dimensional array\n * @param {Array} array\n * @return {number} max\n * @private\n */\n function _max(array) {\n var res;\n deepForEach(array, function (value) {\n try {\n if (isNaN(value) && typeof value === 'number') {\n res = NaN;\n } else if (res === undefined || larger(value, res)) {\n res = value;\n }\n } catch (err) {\n throw improveErrorMessage(err, 'max', value);\n }\n });\n if (res === undefined) {\n throw new Error('Cannot calculate max of an empty array');\n }\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof res === 'string') {\n res = numeric(res, safeNumberType(res, config));\n }\n return res;\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'min';\nvar dependencies = ['typed', 'config', 'numeric', 'smaller'];\nexport var createMin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n smaller\n } = _ref;\n /**\n * Compute the minimum value of a matrix or a list of values.\n * In case of a multidimensional array, the minimum of the flattened array\n * will be calculated. When `dim` is provided, the minimum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.min(a, b, c, ...)\n * math.min(A)\n * math.min(A, dimension)\n *\n * Examples:\n *\n * math.min(2, 1, 4, 3) // returns 1\n * math.min([2, 1, 4, 3]) // returns 1\n *\n * // minimum over a specified dimension (zero-based)\n * math.min([[2, 5], [4, 3], [1, 7]], 0) // returns [1, 3]\n * math.min([[2, 5], [4, 3], [1, 7]], 1) // returns [2, 3, 1]\n *\n * math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1\n * math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5\n *\n * See also:\n *\n * mean, median, max, prod, std, sum, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The minimum value\n */\n return typed(name, {\n // min([a, b, c, d, ...])\n 'Array | Matrix': _min,\n // min([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function ArrayMatrixNumberBigNumber(array, dim) {\n return reduce(array, dim.valueOf(), _smallest);\n },\n // min(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function min');\n }\n return _min(args);\n }\n });\n\n /**\n * Return the smallest of two values\n * @param {*} x\n * @param {*} y\n * @returns {*} Returns x when x is smallest, or y when y is smallest\n * @private\n */\n function _smallest(x, y) {\n try {\n return smaller(x, y) ? x : y;\n } catch (err) {\n throw improveErrorMessage(err, 'min', y);\n }\n }\n\n /**\n * Recursively calculate the minimum value in an n-dimensional array\n * @param {Array} array\n * @return {number} min\n * @private\n */\n function _min(array) {\n var min;\n deepForEach(array, function (value) {\n try {\n if (isNaN(value) && typeof value === 'number') {\n min = NaN;\n } else if (min === undefined || smaller(value, min)) {\n min = value;\n }\n } catch (err) {\n throw improveErrorMessage(err, 'min', value);\n }\n });\n if (min === undefined) {\n throw new Error('Cannot calculate min of an empty array');\n }\n\n // make sure returning numeric value: parse a string into a numeric value\n if (typeof min === 'string') {\n min = numeric(min, safeNumberType(min, config));\n }\n return min;\n }\n});", "import { isArray, isMatrix, isString, typeOf } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ImmutableDenseMatrix';\nvar dependencies = ['smaller', 'DenseMatrix'];\nexport var createImmutableDenseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n smaller,\n DenseMatrix\n } = _ref;\n function ImmutableDenseMatrix(data, datatype) {\n if (!(this instanceof ImmutableDenseMatrix)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (datatype && !isString(datatype)) {\n throw new Error('Invalid datatype: ' + datatype);\n }\n if (isMatrix(data) || isArray(data)) {\n // use DenseMatrix implementation\n var matrix = new DenseMatrix(data, datatype);\n // internal structures\n this._data = matrix._data;\n this._size = matrix._size;\n this._datatype = matrix._datatype;\n this._min = null;\n this._max = null;\n } else if (data && isArray(data.data) && isArray(data.size)) {\n // initialize fields from JSON representation\n this._data = data.data;\n this._size = data.size;\n this._datatype = data.datatype;\n this._min = typeof data.min !== 'undefined' ? data.min : null;\n this._max = typeof data.max !== 'undefined' ? data.max : null;\n } else if (data) {\n // unsupported type\n throw new TypeError('Unsupported type of data (' + typeOf(data) + ')');\n } else {\n // nothing provided\n this._data = [];\n this._size = [0];\n this._datatype = datatype;\n this._min = null;\n this._max = null;\n }\n }\n ImmutableDenseMatrix.prototype = new DenseMatrix();\n\n /**\n * Attach type information\n */\n ImmutableDenseMatrix.prototype.type = 'ImmutableDenseMatrix';\n ImmutableDenseMatrix.prototype.isImmutableDenseMatrix = true;\n\n /**\n * Get a subset of the matrix, or replace a subset of the matrix.\n *\n * Usage:\n * const subset = matrix.subset(index) // retrieve subset\n * const value = matrix.subset(index, replacement) // replace subset\n *\n * @param {Index} index\n * @param {Array | ImmutableDenseMatrix | *} [replacement]\n * @param {*} [defaultValue=0] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be filled with zeros.\n */\n ImmutableDenseMatrix.prototype.subset = function (index) {\n switch (arguments.length) {\n case 1:\n {\n // use base implementation\n var m = DenseMatrix.prototype.subset.call(this, index);\n // check result is a matrix\n if (isMatrix(m)) {\n // return immutable matrix\n return new ImmutableDenseMatrix({\n data: m._data,\n size: m._size,\n datatype: m._datatype\n });\n }\n return m;\n }\n // intentional fall through\n case 2:\n case 3:\n throw new Error('Cannot invoke set subset on an Immutable Matrix instance');\n default:\n throw new SyntaxError('Wrong number of arguments');\n }\n };\n\n /**\n * Replace a single element in the matrix.\n * @param {Number[]} index Zero-based index\n * @param {*} value\n * @param {*} [defaultValue] Default value, filled in on new entries when\n * the matrix is resized. If not provided,\n * new matrix elements will be left undefined.\n * @return {ImmutableDenseMatrix} self\n */\n ImmutableDenseMatrix.prototype.set = function () {\n throw new Error('Cannot invoke set on an Immutable Matrix instance');\n };\n\n /**\n * Resize the matrix to the given size. Returns a copy of the matrix when\n * `copy=true`, otherwise return the matrix itself (resize in place).\n *\n * @param {Number[]} size The new size the matrix should have.\n * @param {*} [defaultValue=0] Default value, filled in on new entries.\n * If not provided, the matrix elements will\n * be filled with zeros.\n * @param {boolean} [copy] Return a resized copy of the matrix\n *\n * @return {Matrix} The resized matrix\n */\n ImmutableDenseMatrix.prototype.resize = function () {\n throw new Error('Cannot invoke resize on an Immutable Matrix instance');\n };\n\n /**\n * Disallows reshaping in favor of immutability.\n *\n * @throws {Error} Operation not allowed\n */\n ImmutableDenseMatrix.prototype.reshape = function () {\n throw new Error('Cannot invoke reshape on an Immutable Matrix instance');\n };\n\n /**\n * Create a clone of the matrix\n * @return {ImmutableDenseMatrix} clone\n */\n ImmutableDenseMatrix.prototype.clone = function () {\n return new ImmutableDenseMatrix({\n data: clone(this._data),\n size: clone(this._size),\n datatype: this._datatype\n });\n };\n\n /**\n * Get a JSON representation of the matrix\n * @returns {Object}\n */\n ImmutableDenseMatrix.prototype.toJSON = function () {\n return {\n mathjs: 'ImmutableDenseMatrix',\n data: this._data,\n size: this._size,\n datatype: this._datatype\n };\n };\n\n /**\n * Generate a matrix from a JSON object\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ImmutableDenseMatrix\", data: [], size: []}`,\n * where mathjs is optional\n * @returns {ImmutableDenseMatrix}\n */\n ImmutableDenseMatrix.fromJSON = function (json) {\n return new ImmutableDenseMatrix(json);\n };\n\n /**\n * Swap rows i and j in Matrix.\n *\n * @param {Number} i Matrix row index 1\n * @param {Number} j Matrix row index 2\n *\n * @return {Matrix} The matrix reference\n */\n ImmutableDenseMatrix.prototype.swapRows = function () {\n throw new Error('Cannot invoke swapRows on an Immutable Matrix instance');\n };\n\n /**\n * Calculate the minimum value in the set\n * @return {Number | undefined} min\n */\n ImmutableDenseMatrix.prototype.min = function () {\n // check min has been calculated before\n if (this._min === null) {\n // minimum\n var m = null;\n // compute min\n this.forEach(function (v) {\n if (m === null || smaller(v, m)) {\n m = v;\n }\n });\n this._min = m !== null ? m : undefined;\n }\n return this._min;\n };\n\n /**\n * Calculate the maximum value in the set\n * @return {Number | undefined} max\n */\n ImmutableDenseMatrix.prototype.max = function () {\n // check max has been calculated before\n if (this._max === null) {\n // maximum\n var m = null;\n // compute max\n this.forEach(function (v) {\n if (m === null || smaller(m, v)) {\n m = v;\n }\n });\n this._max = m !== null ? m : undefined;\n }\n return this._max;\n };\n return ImmutableDenseMatrix;\n}, {\n isClass: true\n});", "import { isArray, isMatrix, isRange } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Index';\nvar dependencies = ['ImmutableDenseMatrix', 'getMatrixDataType'];\nexport var createIndexClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n ImmutableDenseMatrix,\n getMatrixDataType\n } = _ref;\n /**\n * Create an index. An Index can store ranges and sets for multiple dimensions.\n * Matrix.get, Matrix.set, and math.subset accept an Index as input.\n *\n * Usage:\n * const index = new Index(range1, range2, matrix1, array1, ...)\n *\n * Where each parameter can be any of:\n * A number\n * A string (containing a name of an object property)\n * An instance of Range\n * An Array with the Set values\n * An Array with Booleans\n * A Matrix with the Set values\n * A Matrix with Booleans\n *\n * The parameters start, end, and step must be integer numbers.\n *\n * @class Index\n * @Constructor Index\n * @param {...*} ranges\n */\n function Index(ranges) {\n if (!(this instanceof Index)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n this._dimensions = [];\n this._sourceSize = [];\n this._isScalar = true;\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n var arg = arguments[i];\n var argIsArray = isArray(arg);\n var argIsMatrix = isMatrix(arg);\n var sourceSize = null;\n if (isRange(arg)) {\n this._dimensions.push(arg);\n this._isScalar = false;\n } else if (argIsArray || argIsMatrix) {\n // create matrix\n var m = void 0;\n if (getMatrixDataType(arg) === 'boolean') {\n if (argIsArray) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg).valueOf());\n if (argIsMatrix) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg._data).valueOf());\n sourceSize = arg.valueOf().length;\n } else {\n m = _createImmutableMatrix(arg.valueOf());\n }\n this._dimensions.push(m);\n // size\n var size = m.size();\n // scalar\n if (size.length !== 1 || size[0] !== 1 || sourceSize !== null) {\n this._isScalar = false;\n }\n } else if (typeof arg === 'number') {\n this._dimensions.push(_createImmutableMatrix([arg]));\n } else if (typeof arg === 'string') {\n // object property (arguments.count should be 1)\n this._dimensions.push(arg);\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range');\n }\n this._sourceSize.push(sourceSize);\n // TODO: implement support for wildcard '*'\n }\n }\n\n /**\n * Attach type information\n */\n Index.prototype.type = 'Index';\n Index.prototype.isIndex = true;\n function _createImmutableMatrix(arg) {\n // loop array elements\n for (var i = 0, l = arg.length; i < l; i++) {\n if (typeof arg[i] !== 'number' || !isInteger(arg[i])) {\n throw new TypeError('Index parameters must be positive integer numbers');\n }\n }\n // create matrix\n return new ImmutableDenseMatrix(arg);\n }\n\n /**\n * Create a clone of the index\n * @memberof Index\n * @return {Index} clone\n */\n Index.prototype.clone = function () {\n var index = new Index();\n index._dimensions = clone(this._dimensions);\n index._isScalar = this._isScalar;\n index._sourceSize = this._sourceSize;\n return index;\n };\n\n /**\n * Create an index from an array with ranges/numbers\n * @memberof Index\n * @param {Array.} ranges\n * @return {Index} index\n * @private\n */\n Index.create = function (ranges) {\n var index = new Index();\n Index.apply(index, ranges);\n return index;\n };\n\n /**\n * Retrieve the size of the index, the number of elements for each dimension.\n * @memberof Index\n * @returns {number[]} size\n */\n Index.prototype.size = function () {\n var size = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var d = this._dimensions[i];\n size[i] = typeof d === 'string' ? 1 : d.size()[0];\n }\n return size;\n };\n\n /**\n * Get the maximum value for each of the indexes ranges.\n * @memberof Index\n * @returns {number[]} max\n */\n Index.prototype.max = function () {\n var values = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var range = this._dimensions[i];\n values[i] = typeof range === 'string' ? range : range.max();\n }\n return values;\n };\n\n /**\n * Get the minimum value for each of the indexes ranges.\n * @memberof Index\n * @returns {number[]} min\n */\n Index.prototype.min = function () {\n var values = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var range = this._dimensions[i];\n values[i] = typeof range === 'string' ? range : range.min();\n }\n return values;\n };\n\n /**\n * Loop over each of the ranges of the index\n * @memberof Index\n * @param {Function} callback Called for each range with a Range as first\n * argument, the dimension as second, and the\n * index object as third.\n */\n Index.prototype.forEach = function (callback) {\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n callback(this._dimensions[i], i, this);\n }\n };\n\n /**\n * Retrieve the dimension for the given index\n * @memberof Index\n * @param {Number} dim Number of the dimension\n * @returns {Range | null} range\n */\n Index.prototype.dimension = function (dim) {\n return this._dimensions[dim] || null;\n };\n\n /**\n * Test whether this index contains an object property\n * @returns {boolean} Returns true if the index is an object property\n */\n Index.prototype.isObjectProperty = function () {\n return this._dimensions.length === 1 && typeof this._dimensions[0] === 'string';\n };\n\n /**\n * Returns the object property name when the Index holds a single object property,\n * else returns null\n * @returns {string | null}\n */\n Index.prototype.getObjectProperty = function () {\n return this.isObjectProperty() ? this._dimensions[0] : null;\n };\n\n /**\n * Test whether this index contains only a single value.\n *\n * This is the case when the index is created with only scalar values as ranges,\n * not for ranges resolving into a single value.\n * @memberof Index\n * @return {boolean} isScalar\n */\n Index.prototype.isScalar = function () {\n return this._isScalar;\n };\n\n /**\n * Expand the Index into an array.\n * For example new Index([0,3], [2,7]) returns [[0,1,2], [2,3,4,5,6]]\n * @memberof Index\n * @returns {Array} array\n */\n Index.prototype.toArray = function () {\n var array = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var dimension = this._dimensions[i];\n array.push(typeof dimension === 'string' ? dimension : dimension.toArray());\n }\n return array;\n };\n\n /**\n * Get the primitive value of the Index, a two dimensional array.\n * Equivalent to Index.toArray().\n * @memberof Index\n * @returns {Array} array\n */\n Index.prototype.valueOf = Index.prototype.toArray;\n\n /**\n * Get the string representation of the index, for example '[2:6]' or '[0:2:10, 4:7, [1,2,3]]'\n * @memberof Index\n * @returns {String} str\n */\n Index.prototype.toString = function () {\n var strings = [];\n for (var i = 0, ii = this._dimensions.length; i < ii; i++) {\n var dimension = this._dimensions[i];\n if (typeof dimension === 'string') {\n strings.push(JSON.stringify(dimension));\n } else {\n strings.push(dimension.toString());\n }\n }\n return '[' + strings.join(', ') + ']';\n };\n\n /**\n * Get a JSON representation of the Index\n * @memberof Index\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Index\", \"ranges\": [{\"mathjs\": \"Range\", start: 0, end: 10, step:1}, ...]}`\n */\n Index.prototype.toJSON = function () {\n return {\n mathjs: 'Index',\n dimensions: this._dimensions\n };\n };\n\n /**\n * Instantiate an Index from a JSON object\n * @memberof Index\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Index\", \"dimensions\": [{\"mathjs\": \"Range\", start: 0, end: 10, step:1}, ...]}`\n * @return {Index}\n */\n Index.fromJSON = function (json) {\n return Index.create(json.dimensions);\n };\n return Index;\n}, {\n isClass: true\n});\n\n/**\n * Receives an array of booleans and returns an array of Numbers for Index\n * @param {Array} booleanArrayIndex An array of booleans\n * @return {Array} A set of numbers ready for index\n */\nfunction _booleansArrayToNumbersForIndex(booleanArrayIndex) {\n // gets an array of booleans and returns an array of numbers\n var indexOfNumbers = [];\n booleanArrayIndex.forEach((bool, idx) => {\n if (bool) {\n indexOfNumbers.push(idx);\n }\n });\n return indexOfNumbers;\n}", "import { factory } from '../../utils/factory.js';\nvar name = 'FibonacciHeap';\nvar dependencies = ['smaller', 'larger'];\nexport var createFibonacciHeapClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n smaller,\n larger\n } = _ref;\n var oneOverLogPhi = 1.0 / Math.log((1.0 + Math.sqrt(5.0)) / 2.0);\n\n /**\n * Fibonacci Heap implementation, used interally for Matrix math.\n * @class FibonacciHeap\n * @constructor FibonacciHeap\n */\n function FibonacciHeap() {\n if (!(this instanceof FibonacciHeap)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // initialize fields\n this._minimum = null;\n this._size = 0;\n }\n\n /**\n * Attach type information\n */\n FibonacciHeap.prototype.type = 'FibonacciHeap';\n FibonacciHeap.prototype.isFibonacciHeap = true;\n\n /**\n * Inserts a new data element into the heap. No heap consolidation is\n * performed at this time, the new node is simply inserted into the root\n * list of this heap. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.insert = function (key, value) {\n // create node\n var node = {\n key,\n value,\n degree: 0\n };\n // check we have a node in the minimum\n if (this._minimum) {\n // minimum node\n var minimum = this._minimum;\n // update left & right of node\n node.left = minimum;\n node.right = minimum.right;\n minimum.right = node;\n node.right.left = node;\n // update minimum node in heap if needed\n if (smaller(key, minimum.key)) {\n // node has a smaller key, use it as minimum\n this._minimum = node;\n }\n } else {\n // set left & right\n node.left = node;\n node.right = node;\n // this is the first node\n this._minimum = node;\n }\n // increment number of nodes in heap\n this._size++;\n // return node\n return node;\n };\n\n /**\n * Returns the number of nodes in heap. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.size = function () {\n return this._size;\n };\n\n /**\n * Removes all elements from this heap.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.clear = function () {\n this._minimum = null;\n this._size = 0;\n };\n\n /**\n * Returns true if the heap is empty, otherwise false.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.isEmpty = function () {\n return this._size === 0;\n };\n\n /**\n * Extracts the node with minimum key from heap. Amortized running\n * time: O(log n).\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.extractMinimum = function () {\n // node to remove\n var node = this._minimum;\n // check we have a minimum\n if (node === null) {\n return node;\n }\n // current minimum\n var minimum = this._minimum;\n // get number of children\n var numberOfChildren = node.degree;\n // pointer to the first child\n var x = node.child;\n // for each child of node do...\n while (numberOfChildren > 0) {\n // store node in right side\n var tempRight = x.right;\n // remove x from child list\n x.left.right = x.right;\n x.right.left = x.left;\n // add x to root list of heap\n x.left = minimum;\n x.right = minimum.right;\n minimum.right = x;\n x.right.left = x;\n // set Parent[x] to null\n x.parent = null;\n x = tempRight;\n numberOfChildren--;\n }\n // remove node from root list of heap\n node.left.right = node.right;\n node.right.left = node.left;\n // update minimum\n if (node === node.right) {\n // empty\n minimum = null;\n } else {\n // update minimum\n minimum = node.right;\n // we need to update the pointer to the root with minimum key\n minimum = _findMinimumNode(minimum, this._size);\n }\n // decrement size of heap\n this._size--;\n // update minimum\n this._minimum = minimum;\n // return node\n return node;\n };\n\n /**\n * Removes a node from the heap given the reference to the node. The trees\n * in the heap will be consolidated, if necessary. This operation may fail\n * to remove the correct element if there are nodes with key value -Infinity.\n * Running time: O(log n) amortized.\n * @memberof FibonacciHeap\n */\n FibonacciHeap.prototype.remove = function (node) {\n // decrease key value\n this._minimum = _decreaseKey(this._minimum, node, -1);\n // remove the smallest\n this.extractMinimum();\n };\n\n /**\n * Decreases the key value for a heap node, given the new value to take on.\n * The structure of the heap may be changed and will not be consolidated.\n * Running time: O(1) amortized.\n * @memberof FibonacciHeap\n */\n function _decreaseKey(minimum, node, key) {\n // set node key\n node.key = key;\n // get parent node\n var parent = node.parent;\n if (parent && smaller(node.key, parent.key)) {\n // remove node from parent\n _cut(minimum, node, parent);\n // remove all nodes from parent to the root parent\n _cascadingCut(minimum, parent);\n }\n // update minimum node if needed\n if (smaller(node.key, minimum.key)) {\n minimum = node;\n }\n // return minimum\n return minimum;\n }\n\n /**\n * The reverse of the link operation: removes node from the child list of parent.\n * This method assumes that min is non-null. Running time: O(1).\n * @memberof FibonacciHeap\n */\n function _cut(minimum, node, parent) {\n // remove node from parent children and decrement Degree[parent]\n node.left.right = node.right;\n node.right.left = node.left;\n parent.degree--;\n // reset y.child if necessary\n if (parent.child === node) {\n parent.child = node.right;\n }\n // remove child if degree is 0\n if (parent.degree === 0) {\n parent.child = null;\n }\n // add node to root list of heap\n node.left = minimum;\n node.right = minimum.right;\n minimum.right = node;\n node.right.left = node;\n // set parent[node] to null\n node.parent = null;\n // set mark[node] to false\n node.mark = false;\n }\n\n /**\n * Performs a cascading cut operation. This cuts node from its parent and then\n * does the same for its parent, and so on up the tree.\n * Running time: O(log n); O(1) excluding the recursion.\n * @memberof FibonacciHeap\n */\n function _cascadingCut(minimum, node) {\n // store parent node\n var parent = node.parent;\n // if there's a parent...\n if (!parent) {\n return;\n }\n // if node is unmarked, set it marked\n if (!node.mark) {\n node.mark = true;\n } else {\n // it's marked, cut it from parent\n _cut(minimum, node, parent);\n // cut its parent as well\n _cascadingCut(parent);\n }\n }\n\n /**\n * Make the first node a child of the second one. Running time: O(1) actual.\n * @memberof FibonacciHeap\n */\n var _linkNodes = function _linkNodes(node, parent) {\n // remove node from root list of heap\n node.left.right = node.right;\n node.right.left = node.left;\n // make node a Child of parent\n node.parent = parent;\n if (!parent.child) {\n parent.child = node;\n node.right = node;\n node.left = node;\n } else {\n node.left = parent.child;\n node.right = parent.child.right;\n parent.child.right = node;\n node.right.left = node;\n }\n // increase degree[parent]\n parent.degree++;\n // set mark[node] false\n node.mark = false;\n };\n function _findMinimumNode(minimum, size) {\n // to find trees of the same degree efficiently we use an array of length O(log n) in which we keep a pointer to one root of each degree\n var arraySize = Math.floor(Math.log(size) * oneOverLogPhi) + 1;\n // create list with initial capacity\n var array = new Array(arraySize);\n // find the number of root nodes.\n var numRoots = 0;\n var x = minimum;\n if (x) {\n numRoots++;\n x = x.right;\n while (x !== minimum) {\n numRoots++;\n x = x.right;\n }\n }\n // vars\n var y;\n // For each node in root list do...\n while (numRoots > 0) {\n // access this node's degree..\n var d = x.degree;\n // get next node\n var next = x.right;\n // check if there is a node already in array with the same degree\n while (true) {\n // get node with the same degree is any\n y = array[d];\n if (!y) {\n break;\n }\n // make one node with the same degree a child of the other, do this based on the key value.\n if (larger(x.key, y.key)) {\n var temp = y;\n y = x;\n x = temp;\n }\n // make y a child of x\n _linkNodes(y, x);\n // we have handled this degree, go to next one.\n array[d] = null;\n d++;\n }\n // save this node for later when we might encounter another of the same degree.\n array[d] = x;\n // move forward through list.\n x = next;\n numRoots--;\n }\n // Set min to null (effectively losing the root list) and reconstruct the root list from the array entries in array[].\n minimum = null;\n // loop nodes in array\n for (var i = 0; i < arraySize; i++) {\n // get current node\n y = array[i];\n if (!y) {\n continue;\n }\n // check if we have a linked list\n if (minimum) {\n // First remove node from root list.\n y.left.right = y.right;\n y.right.left = y.left;\n // now add to root list, again.\n y.left = minimum;\n y.right = minimum.right;\n minimum.right = y;\n y.right.left = y;\n // check if this is a new min.\n if (smaller(y.key, minimum.key)) {\n minimum = y;\n }\n } else {\n minimum = y;\n }\n }\n return minimum;\n }\n return FibonacciHeap;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'Spa';\nvar dependencies = ['addScalar', 'equalScalar', 'FibonacciHeap'];\nexport var createSpaClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n addScalar,\n equalScalar,\n FibonacciHeap\n } = _ref;\n /**\n * An ordered Sparse Accumulator is a representation for a sparse vector that includes a dense array\n * of the vector elements and an ordered list of non-zero elements.\n */\n function Spa() {\n if (!(this instanceof Spa)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n // allocate vector, TODO use typed arrays\n this._values = [];\n this._heap = new FibonacciHeap();\n }\n\n /**\n * Attach type information\n */\n Spa.prototype.type = 'Spa';\n Spa.prototype.isSpa = true;\n\n /**\n * Set the value for index i.\n *\n * @param {number} i The index\n * @param {number | BigNumber | Complex} The value at index i\n */\n Spa.prototype.set = function (i, v) {\n // check we have a value @ i\n if (!this._values[i]) {\n // insert in heap\n var node = this._heap.insert(i, v);\n // set the value @ i\n this._values[i] = node;\n } else {\n // update the value @ i\n this._values[i].value = v;\n }\n };\n Spa.prototype.get = function (i) {\n var node = this._values[i];\n if (node) {\n return node.value;\n }\n return 0;\n };\n Spa.prototype.accumulate = function (i, v) {\n // node @ i\n var node = this._values[i];\n if (!node) {\n // insert in heap\n node = this._heap.insert(i, v);\n // initialize value\n this._values[i] = node;\n } else {\n // accumulate value\n node.value = addScalar(node.value, v);\n }\n };\n Spa.prototype.forEach = function (from, to, callback) {\n // references\n var heap = this._heap;\n var values = this._values;\n // nodes\n var nodes = [];\n // node with minimum key, save it\n var node = heap.extractMinimum();\n if (node) {\n nodes.push(node);\n }\n // extract nodes from heap (ordered)\n while (node && node.key <= to) {\n // check it is in range\n if (node.key >= from) {\n // check value is not zero\n if (!equalScalar(node.value, 0)) {\n // invoke callback\n callback(node.key, node.value, this);\n }\n }\n // extract next node, save it\n node = heap.extractMinimum();\n if (node) {\n nodes.push(node);\n }\n }\n // reinsert all nodes in heap\n for (var i = 0; i < nodes.length; i++) {\n // current node\n var n = nodes[i];\n // insert node in heap\n node = heap.insert(n.key, n.value);\n // update values\n values[node.key] = node;\n }\n };\n Spa.prototype.swap = function (i, j) {\n // node @ i and j\n var nodei = this._values[i];\n var nodej = this._values[j];\n // check we need to insert indeces\n if (!nodei && nodej) {\n // insert in heap\n nodei = this._heap.insert(i, nodej.value);\n // remove from heap\n this._heap.remove(nodej);\n // set values\n this._values[i] = nodei;\n this._values[j] = undefined;\n } else if (nodei && !nodej) {\n // insert in heap\n nodej = this._heap.insert(j, nodei.value);\n // remove from heap\n this._heap.remove(nodei);\n // set values\n this._values[j] = nodej;\n this._values[i] = undefined;\n } else if (nodei && nodej) {\n // swap values\n var v = nodei.value;\n nodei.value = nodej.value;\n nodej.value = v;\n }\n };\n return Spa;\n}, {\n isClass: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isComplex, isUnit, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { memoize } from '../../utils/function.js';\nimport { endsWith } from '../../utils/string.js';\nimport { clone, hasOwnProperty } from '../../utils/object.js';\nimport { createBigNumberPi as createPi } from '../../utils/bignumber/constants.js';\nvar name = 'Unit';\nvar dependencies = ['?on', 'config', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'abs', 'fix', 'round', 'equal', 'isNumeric', 'format', 'number', 'Complex', 'BigNumber', 'Fraction'];\nexport var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n config,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n pow,\n abs,\n fix,\n round,\n equal,\n isNumeric,\n format,\n number: _number,\n Complex,\n BigNumber: _BigNumber,\n Fraction: _Fraction\n } = _ref;\n var toNumber = _number;\n /**\n * A unit can be constructed in the following ways:\n *\n * const a = new Unit(value, valuelessUnit)\n * const b = new Unit(null, valuelessUnit)\n * const c = Unit.parse(str)\n *\n * Example usage:\n *\n * const a = new Unit(5, 'cm') // 50 mm\n * const b = Unit.parse('23 kg') // 23 kg\n * const c = math.in(a, new Unit(null, 'm') // 0.05 m\n * const d = new Unit(9.81, \"m/s^2\") // 9.81 m/s^2\n *\n * @class Unit\n * @constructor Unit\n * @param {number | BigNumber | Fraction | Complex | boolean} [value] A value like 5.2\n * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like \"cm\"\n */\n function Unit(value, valuelessUnit) {\n if (!(this instanceof Unit)) {\n throw new Error('Constructor must be called with the new operator');\n }\n if (!(value === null || value === undefined || isNumeric(value) || isComplex(value))) {\n throw new TypeError('First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined');\n }\n this.fixPrefix = false; // if true, function format will not search for the\n // best prefix but leave it as initially provided.\n // fixPrefix is set true by the method Unit.to\n\n // The justification behind this is that if the constructor is explicitly called,\n // the caller wishes the units to be returned exactly as supplied.\n this.skipAutomaticSimplification = true;\n if (valuelessUnit === undefined) {\n this.units = [];\n this.dimensions = BASE_DIMENSIONS.map(x => 0);\n } else if (typeof valuelessUnit === 'string') {\n var u = Unit.parse(valuelessUnit);\n this.units = u.units;\n this.dimensions = u.dimensions;\n } else if (isUnit(valuelessUnit) && valuelessUnit.value === null) {\n // clone from valuelessUnit\n this.fixPrefix = valuelessUnit.fixPrefix;\n this.skipAutomaticSimplification = valuelessUnit.skipAutomaticSimplification;\n this.dimensions = valuelessUnit.dimensions.slice(0);\n this.units = valuelessUnit.units.map(u => _extends({}, u));\n } else {\n throw new TypeError('Second parameter in Unit constructor must be a string or valueless Unit');\n }\n this.value = this._normalize(value);\n }\n\n /**\n * Attach type information\n */\n Object.defineProperty(Unit, 'name', {\n value: 'Unit'\n });\n Unit.prototype.constructor = Unit;\n Unit.prototype.type = 'Unit';\n Unit.prototype.isUnit = true;\n\n // private variables and functions for the Unit parser\n var text, index, c;\n function skipWhitespace() {\n while (c === ' ' || c === '\\t') {\n next();\n }\n }\n function isDigitDot(c) {\n return c >= '0' && c <= '9' || c === '.';\n }\n function isDigit(c) {\n return c >= '0' && c <= '9';\n }\n function next() {\n index++;\n c = text.charAt(index);\n }\n function revert(oldIndex) {\n index = oldIndex;\n c = text.charAt(index);\n }\n function parseNumber() {\n var number = '';\n var oldIndex = index;\n if (c === '+') {\n next();\n } else if (c === '-') {\n number += c;\n next();\n }\n if (!isDigitDot(c)) {\n // a + or - must be followed by a digit\n revert(oldIndex);\n return null;\n }\n\n // get number, can have a single dot\n if (c === '.') {\n number += c;\n next();\n if (!isDigit(c)) {\n // this is no legal number, it is just a dot\n revert(oldIndex);\n return null;\n }\n } else {\n while (isDigit(c)) {\n number += c;\n next();\n }\n if (c === '.') {\n number += c;\n next();\n }\n }\n while (isDigit(c)) {\n number += c;\n next();\n }\n\n // check for exponential notation like \"2.3e-4\" or \"1.23e50\"\n if (c === 'E' || c === 'e') {\n // The grammar branches here. This could either be part of an exponent or the start of a unit that begins with the letter e, such as \"4exabytes\"\n\n var tentativeNumber = '';\n var tentativeIndex = index;\n tentativeNumber += c;\n next();\n if (c === '+' || c === '-') {\n tentativeNumber += c;\n next();\n }\n\n // Scientific notation MUST be followed by an exponent (otherwise we assume it is not scientific notation)\n if (!isDigit(c)) {\n // The e or E must belong to something else, so return the number without the e or E.\n revert(tentativeIndex);\n return number;\n }\n\n // We can now safely say that this is scientific notation.\n number = number + tentativeNumber;\n while (isDigit(c)) {\n number += c;\n next();\n }\n }\n return number;\n }\n function parseUnit() {\n var unitName = '';\n\n // Alphanumeric characters only; matches [a-zA-Z0-9]\n while (isDigit(c) || Unit.isValidAlpha(c)) {\n unitName += c;\n next();\n }\n\n // Must begin with [a-zA-Z]\n var firstC = unitName.charAt(0);\n if (Unit.isValidAlpha(firstC)) {\n return unitName;\n } else {\n return null;\n }\n }\n function parseCharacter(toFind) {\n if (c === toFind) {\n next();\n return toFind;\n } else {\n return null;\n }\n }\n\n /**\n * Parse a string into a unit. The value of the unit is parsed as number,\n * BigNumber, or Fraction depending on the math.js config setting `number`.\n *\n * Throws an exception if the provided string does not contain a valid unit or\n * cannot be parsed.\n * @memberof Unit\n * @param {string} str A string like \"5.2 inch\", \"4e2 cm/s^2\"\n * @return {Unit} unit\n */\n Unit.parse = function (str, options) {\n options = options || {};\n text = str;\n index = -1;\n c = '';\n if (typeof text !== 'string') {\n throw new TypeError('Invalid argument in Unit.parse, string expected');\n }\n var unit = new Unit();\n unit.units = [];\n var powerMultiplierCurrent = 1;\n var expectingUnit = false;\n\n // A unit should follow this pattern:\n // [number] ...[ [*/] unit[^number] ]\n // unit[^number] ... [ [*/] unit[^number] ]\n\n // Rules:\n // number is any floating point number.\n // unit is any alphanumeric string beginning with an alpha. Units with names like e3 should be avoided because they look like the exponent of a floating point number!\n // The string may optionally begin with a number.\n // Each unit may optionally be followed by ^number.\n // Whitespace or a forward slash is recommended between consecutive units, although the following technically is parseable:\n // 2m^2kg/s^2\n // it is not good form. If a unit starts with e, then it could be confused as a floating point number:\n // 4erg\n\n next();\n skipWhitespace();\n\n // Optional number at the start of the string\n var valueStr = parseNumber();\n var value = null;\n if (valueStr) {\n if (config.number === 'BigNumber') {\n value = new _BigNumber(valueStr);\n } else if (config.number === 'Fraction') {\n try {\n // not all numbers can be turned in Fractions, for example very small numbers not\n value = new _Fraction(valueStr);\n } catch (err) {\n value = parseFloat(valueStr);\n }\n } else {\n // number\n value = parseFloat(valueStr);\n }\n skipWhitespace(); // Whitespace is not required here\n\n // handle multiplication or division right after the value, like '1/s'\n if (parseCharacter('*')) {\n powerMultiplierCurrent = 1;\n expectingUnit = true;\n } else if (parseCharacter('/')) {\n powerMultiplierCurrent = -1;\n expectingUnit = true;\n }\n }\n\n // Stack to keep track of powerMultipliers applied to each parentheses group\n var powerMultiplierStack = [];\n\n // Running product of all elements in powerMultiplierStack\n var powerMultiplierStackProduct = 1;\n while (true) {\n skipWhitespace();\n\n // Check for and consume opening parentheses, pushing powerMultiplierCurrent to the stack\n // A '(' will always appear directly before a unit.\n while (c === '(') {\n powerMultiplierStack.push(powerMultiplierCurrent);\n powerMultiplierStackProduct *= powerMultiplierCurrent;\n powerMultiplierCurrent = 1;\n next();\n skipWhitespace();\n }\n\n // Is there something here?\n var uStr = void 0;\n if (c) {\n var oldC = c;\n uStr = parseUnit();\n if (uStr === null) {\n throw new SyntaxError('Unexpected \"' + oldC + '\" in \"' + text + '\" at index ' + index.toString());\n }\n } else {\n // End of input.\n break;\n }\n\n // Verify the unit exists and get the prefix (if any)\n var res = _findUnit(uStr);\n if (res === null) {\n // Unit not found.\n throw new SyntaxError('Unit \"' + uStr + '\" not found.');\n }\n var power = powerMultiplierCurrent * powerMultiplierStackProduct;\n // Is there a \"^ number\"?\n skipWhitespace();\n if (parseCharacter('^')) {\n skipWhitespace();\n var p = parseNumber();\n if (p === null) {\n // No valid number found for the power!\n throw new SyntaxError('In \"' + str + '\", \"^\" must be followed by a floating-point number');\n }\n power *= p;\n }\n\n // Add the unit to the list\n unit.units.push({\n unit: res.unit,\n prefix: res.prefix,\n power\n });\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n unit.dimensions[i] += (res.unit.dimensions[i] || 0) * power;\n }\n\n // Check for and consume closing parentheses, popping from the stack.\n // A ')' will always follow a unit.\n skipWhitespace();\n while (c === ')') {\n if (powerMultiplierStack.length === 0) {\n throw new SyntaxError('Unmatched \")\" in \"' + text + '\" at index ' + index.toString());\n }\n powerMultiplierStackProduct /= powerMultiplierStack.pop();\n next();\n skipWhitespace();\n }\n\n // \"*\" and \"/\" should mean we are expecting something to come next.\n // Is there a forward slash? If so, negate powerMultiplierCurrent. The next unit or paren group is in the denominator.\n expectingUnit = false;\n if (parseCharacter('*')) {\n // explicit multiplication\n powerMultiplierCurrent = 1;\n expectingUnit = true;\n } else if (parseCharacter('/')) {\n // division\n powerMultiplierCurrent = -1;\n expectingUnit = true;\n } else {\n // implicit multiplication\n powerMultiplierCurrent = 1;\n }\n\n // Replace the unit into the auto unit system\n if (res.unit.base) {\n var baseDim = res.unit.base.key;\n UNIT_SYSTEMS.auto[baseDim] = {\n unit: res.unit,\n prefix: res.prefix\n };\n }\n }\n\n // Has the string been entirely consumed?\n skipWhitespace();\n if (c) {\n throw new SyntaxError('Could not parse: \"' + str + '\"');\n }\n\n // Is there a trailing slash?\n if (expectingUnit) {\n throw new SyntaxError('Trailing characters: \"' + str + '\"');\n }\n\n // Is the parentheses stack empty?\n if (powerMultiplierStack.length !== 0) {\n throw new SyntaxError('Unmatched \"(\" in \"' + text + '\"');\n }\n\n // Are there any units at all?\n if (unit.units.length === 0 && !options.allowNoUnits) {\n throw new SyntaxError('\"' + str + '\" contains no units');\n }\n unit.value = value !== undefined ? unit._normalize(value) : null;\n return unit;\n };\n\n /**\n * create a copy of this unit\n * @memberof Unit\n * @return {Unit} Returns a cloned version of the unit\n */\n Unit.prototype.clone = function () {\n var unit = new Unit();\n unit.fixPrefix = this.fixPrefix;\n unit.skipAutomaticSimplification = this.skipAutomaticSimplification;\n unit.value = clone(this.value);\n unit.dimensions = this.dimensions.slice(0);\n unit.units = [];\n for (var i = 0; i < this.units.length; i++) {\n unit.units[i] = {};\n for (var p in this.units[i]) {\n if (hasOwnProperty(this.units[i], p)) {\n unit.units[i][p] = this.units[i][p];\n }\n }\n }\n return unit;\n };\n\n /**\n * Return the type of the value of this unit\n *\n * @memberof Unit\n * @ return {string} type of the value of the unit\n */\n Unit.prototype.valueType = function () {\n return typeOf(this.value);\n };\n\n /**\n * Return whether the unit is derived (such as m/s, or cm^2, but not N)\n * @memberof Unit\n * @return {boolean} True if the unit is derived\n */\n Unit.prototype._isDerived = function () {\n if (this.units.length === 0) {\n return false;\n }\n return this.units.length > 1 || Math.abs(this.units[0].power - 1.0) > 1e-15;\n };\n\n /**\n * Normalize a value, based on its currently set unit(s)\n * @memberof Unit\n * @param {number | BigNumber | Fraction | boolean} value\n * @return {number | BigNumber | Fraction | boolean} normalized value\n * @private\n */\n Unit.prototype._normalize = function (value) {\n if (value === null || value === undefined || this.units.length === 0) {\n return value;\n }\n var res = value;\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n for (var i = 0; i < this.units.length; i++) {\n var unitValue = convert(this.units[i].unit.value);\n var unitPrefixValue = convert(this.units[i].prefix.value);\n var unitPower = convert(this.units[i].power);\n res = multiplyScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));\n }\n return res;\n };\n\n /**\n * Denormalize a value, based on its currently set unit(s)\n * @memberof Unit\n * @param {number} value\n * @param {number} [prefixValue] Optional prefix value to be used (ignored if this is a derived unit)\n * @return {number} denormalized value\n * @private\n */\n Unit.prototype._denormalize = function (value, prefixValue) {\n if (value === null || value === undefined || this.units.length === 0) {\n return value;\n }\n var res = value;\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n for (var i = 0; i < this.units.length; i++) {\n var unitValue = convert(this.units[i].unit.value);\n var unitPrefixValue = convert(this.units[i].prefix.value);\n var unitPower = convert(this.units[i].power);\n res = divideScalar(res, pow(multiplyScalar(unitValue, unitPrefixValue), unitPower));\n }\n return res;\n };\n\n /**\n * Find a unit from a string\n * @memberof Unit\n * @param {string} str A string like 'cm' or 'inch'\n * @returns {Object | null} result When found, an object with fields unit and\n * prefix is returned. Else, null is returned.\n * @private\n */\n var _findUnit = memoize(str => {\n // First, match units names exactly. For example, a user could define 'mm' as 10^-4 m, which is silly, but then we would want 'mm' to match the user-defined unit.\n if (hasOwnProperty(UNITS, str)) {\n var unit = UNITS[str];\n var prefix = unit.prefixes[''];\n return {\n unit,\n prefix\n };\n }\n for (var _name in UNITS) {\n if (hasOwnProperty(UNITS, _name)) {\n if (endsWith(str, _name)) {\n var _unit = UNITS[_name];\n var prefixLen = str.length - _name.length;\n var prefixName = str.substring(0, prefixLen);\n var _prefix = hasOwnProperty(_unit.prefixes, prefixName) ? _unit.prefixes[prefixName] : undefined;\n if (_prefix !== undefined) {\n // store unit, prefix, and value\n return {\n unit: _unit,\n prefix: _prefix\n };\n }\n }\n }\n }\n return null;\n }, {\n hasher: args => args[0],\n limit: 100\n });\n\n /**\n * Test if the given expression is a unit.\n * The unit can have a prefix but cannot have a value.\n * @memberof Unit\n * @param {string} name A string to be tested whether it is a value less unit.\n * The unit can have prefix, like \"cm\"\n * @return {boolean} true if the given string is a unit\n */\n Unit.isValuelessUnit = function (name) {\n return _findUnit(name) !== null;\n };\n\n /**\n * check if this unit has given base unit\n * If this unit is a derived unit, this will ALWAYS return false, since by definition base units are not derived.\n * @memberof Unit\n * @param {BASE_UNITS | string | undefined} base\n */\n Unit.prototype.hasBase = function (base) {\n if (typeof base === 'string') {\n base = BASE_UNITS[base];\n }\n if (!base) {\n return false;\n }\n\n // All dimensions must be the same\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n if (Math.abs((this.dimensions[i] || 0) - (base.dimensions[i] || 0)) > 1e-12) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * Check if this unit has a base or bases equal to another base or bases\n * For derived units, the exponent on each base also must match\n * @memberof Unit\n * @param {Unit} other\n * @return {boolean} true if equal base\n */\n Unit.prototype.equalBase = function (other) {\n // All dimensions must be the same\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n if (Math.abs((this.dimensions[i] || 0) - (other.dimensions[i] || 0)) > 1e-12) {\n return false;\n }\n }\n return true;\n };\n\n /**\n * Check if this unit equals another unit\n * @memberof Unit\n * @param {Unit} other\n * @return {boolean} true if both units are equal\n */\n Unit.prototype.equals = function (other) {\n return this.equalBase(other) && equal(this.value, other.value);\n };\n\n /**\n * Multiply this unit with another one or with a scalar\n * @memberof Unit\n * @param {Unit} other\n * @return {Unit} product of this unit and the other unit\n */\n Unit.prototype.multiply = function (_other) {\n var res = this.clone();\n var other = isUnit(_other) ? _other : new Unit(_other);\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) + (other.dimensions[i] || 0);\n }\n\n // Append other's units list onto res\n for (var _i = 0; _i < other.units.length; _i++) {\n // Make a shallow copy of every unit\n var inverted = _objectSpread({}, other.units[_i]);\n res.units.push(inverted);\n }\n\n // If at least one operand has a value, then the result should also have a value\n if (this.value !== null || other.value !== null) {\n var valThis = this.value === null ? this._normalize(1) : this.value;\n var valOther = other.value === null ? other._normalize(1) : other.value;\n res.value = multiplyScalar(valThis, valOther);\n } else {\n res.value = null;\n }\n if (isUnit(_other)) {\n res.skipAutomaticSimplification = false;\n }\n return getNumericIfUnitless(res);\n };\n\n /**\n * Divide a number by this unit\n *\n * @memberof Unit\n * @param {numeric} numerator\n * @param {unit} result of dividing numerator by this unit\n */\n Unit.prototype.divideInto = function (numerator) {\n return new Unit(numerator).divide(this);\n };\n\n /**\n * Divide this unit by another one\n * @memberof Unit\n * @param {Unit | numeric} other\n * @return {Unit} result of dividing this unit by the other unit\n */\n Unit.prototype.divide = function (_other) {\n var res = this.clone();\n var other = isUnit(_other) ? _other : new Unit(_other);\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) - (other.dimensions[i] || 0);\n }\n\n // Invert and append other's units list onto res\n for (var _i2 = 0; _i2 < other.units.length; _i2++) {\n // Make a shallow copy of every unit\n var inverted = _objectSpread(_objectSpread({}, other.units[_i2]), {}, {\n power: -other.units[_i2].power\n });\n res.units.push(inverted);\n }\n\n // If at least one operand has a value, the result should have a value\n if (this.value !== null || other.value !== null) {\n var valThis = this.value === null ? this._normalize(1) : this.value;\n var valOther = other.value === null ? other._normalize(1) : other.value;\n res.value = divideScalar(valThis, valOther);\n } else {\n res.value = null;\n }\n if (isUnit(_other)) {\n res.skipAutomaticSimplification = false;\n }\n return getNumericIfUnitless(res);\n };\n\n /**\n * Calculate the power of a unit\n * @memberof Unit\n * @param {number | Fraction | BigNumber} p\n * @returns {Unit} The result: this^p\n */\n Unit.prototype.pow = function (p) {\n var res = this.clone();\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n // Dimensions arrays may be of different lengths. Default to 0.\n res.dimensions[i] = (this.dimensions[i] || 0) * p;\n }\n\n // Adjust the power of each unit in the list\n for (var _i3 = 0; _i3 < res.units.length; _i3++) {\n res.units[_i3].power *= p;\n }\n if (res.value !== null) {\n res.value = pow(res.value, p);\n\n // only allow numeric output, we don't want to return a Complex number\n // if (!isNumeric(res.value)) {\n // res.value = NaN\n // }\n // Update: Complex supported now\n } else {\n res.value = null;\n }\n res.skipAutomaticSimplification = false;\n return getNumericIfUnitless(res);\n };\n\n /**\n * Return the numeric value of this unit if it is dimensionless, has a value, and config.predictable == false; or the original unit otherwise\n * @param {Unit} unit\n * @returns {number | Fraction | BigNumber | Unit} The numeric value of the unit if conditions are met, or the original unit otherwise\n */\n function getNumericIfUnitless(unit) {\n if (unit.equalBase(BASE_UNITS.NONE) && unit.value !== null && !config.predictable) {\n return unit.value;\n } else {\n return unit;\n }\n }\n\n /**\n * Calculate the absolute value of a unit\n * @memberof Unit\n * @param {number | Fraction | BigNumber} x\n * @returns {Unit} The result: |x|, absolute value of x\n */\n Unit.prototype.abs = function () {\n var ret = this.clone();\n if (ret.value !== null) {\n if (ret._isDerived() || ret.units.length === 0 || ret.units[0].unit.offset === 0) {\n ret.value = abs(ret.value);\n } else {\n // To give the correct, but unexpected, results for units with an offset.\n // For example, abs(-283.15 degC) = -263.15 degC !!!\n // We must take the offset into consideration here\n var convert = ret._numberConverter(); // convert to Fraction or BigNumber if needed\n var unitValue = convert(ret.units[0].unit.value);\n var nominalOffset = convert(ret.units[0].unit.offset);\n var unitOffset = multiplyScalar(unitValue, nominalOffset);\n ret.value = subtractScalar(abs(addScalar(ret.value, unitOffset)), unitOffset);\n }\n }\n for (var i in ret.units) {\n if (ret.units[i].unit.name === 'VA' || ret.units[i].unit.name === 'VAR') {\n ret.units[i].unit = UNITS.W;\n }\n }\n return ret;\n };\n\n /**\n * Convert the unit to a specific unit name.\n * @memberof Unit\n * @param {string | Unit} valuelessUnit A unit without value. Can have prefix, like \"cm\"\n * @returns {Unit} Returns a clone of the unit with a fixed prefix and unit.\n */\n Unit.prototype.to = function (valuelessUnit) {\n var value = this.value === null ? this._normalize(1) : this.value;\n var other;\n if (typeof valuelessUnit === 'string') {\n other = Unit.parse(valuelessUnit);\n } else if (isUnit(valuelessUnit)) {\n other = valuelessUnit.clone();\n } else {\n throw new Error('String or Unit expected as parameter');\n }\n if (!this.equalBase(other)) {\n throw new Error(\"Units do not match ('\".concat(other.toString(), \"' != '\").concat(this.toString(), \"')\"));\n }\n if (other.value !== null) {\n throw new Error('Cannot convert to a unit with a value');\n }\n if (this.value === null || this._isDerived() || this.units.length === 0 || other.units.length === 0 || this.units[0].unit.offset === other.units[0].unit.offset) {\n other.value = clone(value);\n } else {\n /* Need to adjust value by difference in offset to convert */\n var convert = Unit._getNumberConverter(typeOf(value)); // convert to Fraction or BigNumber if needed\n\n var thisUnitValue = this.units[0].unit.value;\n var thisNominalOffset = this.units[0].unit.offset;\n var thisUnitOffset = multiplyScalar(thisUnitValue, thisNominalOffset);\n var otherUnitValue = other.units[0].unit.value;\n var otherNominalOffset = other.units[0].unit.offset;\n var otherUnitOffset = multiplyScalar(otherUnitValue, otherNominalOffset);\n other.value = addScalar(value, convert(subtractScalar(thisUnitOffset, otherUnitOffset)));\n }\n other.fixPrefix = true;\n other.skipAutomaticSimplification = true;\n return other;\n };\n\n /**\n * Return the value of the unit when represented with given valueless unit\n * @memberof Unit\n * @param {string | Unit} valuelessUnit For example 'cm' or 'inch'\n * @return {number} Returns the unit value as number.\n */\n // TODO: deprecate Unit.toNumber? It's always better to use toNumeric\n Unit.prototype.toNumber = function (valuelessUnit) {\n return toNumber(this.toNumeric(valuelessUnit));\n };\n\n /**\n * Return the value of the unit in the original numeric type\n * @memberof Unit\n * @param {string | Unit} valuelessUnit For example 'cm' or 'inch'\n * @return {number | BigNumber | Fraction} Returns the unit value\n */\n Unit.prototype.toNumeric = function (valuelessUnit) {\n var other;\n if (valuelessUnit) {\n // Allow getting the numeric value without converting to a different unit\n other = this.to(valuelessUnit);\n } else {\n other = this.clone();\n }\n if (other._isDerived() || other.units.length === 0) {\n return other._denormalize(other.value);\n } else {\n return other._denormalize(other.value, other.units[0].prefix.value);\n }\n };\n\n /**\n * Get a string representation of the unit.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.toString = function () {\n return this.format();\n };\n\n /**\n * Get a JSON representation of the unit\n * @memberof Unit\n * @returns {Object} Returns a JSON object structured as:\n * `{\"mathjs\": \"Unit\", \"value\": 2, \"unit\": \"cm\", \"fixPrefix\": false}`\n */\n Unit.prototype.toJSON = function () {\n return {\n mathjs: 'Unit',\n value: this._denormalize(this.value),\n unit: this.units.length > 0 ? this.formatUnits() : null,\n fixPrefix: this.fixPrefix\n };\n };\n\n /**\n * Instantiate a Unit from a JSON object\n * @memberof Unit\n * @param {Object} json A JSON object structured as:\n * `{\"mathjs\": \"Unit\", \"value\": 2, \"unit\": \"cm\", \"fixPrefix\": false}`\n * @return {Unit}\n */\n Unit.fromJSON = function (json) {\n var _json$unit;\n var unit = new Unit(json.value, (_json$unit = json.unit) !== null && _json$unit !== void 0 ? _json$unit : undefined);\n unit.fixPrefix = json.fixPrefix || false;\n return unit;\n };\n\n /**\n * Returns the string representation of the unit.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.valueOf = Unit.prototype.toString;\n\n /**\n * Simplify this Unit's unit list and return a new Unit with the simplified list.\n * The returned Unit will contain a list of the \"best\" units for formatting.\n */\n Unit.prototype.simplify = function () {\n var ret = this.clone();\n var proposedUnitList = [];\n\n // Search for a matching base\n var matchingBase;\n for (var key in currentUnitSystem) {\n if (hasOwnProperty(currentUnitSystem, key)) {\n if (ret.hasBase(BASE_UNITS[key])) {\n matchingBase = key;\n break;\n }\n }\n }\n if (matchingBase === 'NONE') {\n ret.units = [];\n } else {\n var matchingUnit;\n if (matchingBase) {\n // Does the unit system have a matching unit?\n if (hasOwnProperty(currentUnitSystem, matchingBase)) {\n matchingUnit = currentUnitSystem[matchingBase];\n }\n }\n if (matchingUnit) {\n ret.units = [{\n unit: matchingUnit.unit,\n prefix: matchingUnit.prefix,\n power: 1.0\n }];\n } else {\n // Multiple units or units with powers are formatted like this:\n // 5 (kg m^2) / (s^3 mol)\n // Build an representation from the base units of the current unit system\n var missingBaseDim = false;\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n var baseDim = BASE_DIMENSIONS[i];\n if (Math.abs(ret.dimensions[i] || 0) > 1e-12) {\n if (hasOwnProperty(currentUnitSystem, baseDim)) {\n proposedUnitList.push({\n unit: currentUnitSystem[baseDim].unit,\n prefix: currentUnitSystem[baseDim].prefix,\n power: ret.dimensions[i] || 0\n });\n } else {\n missingBaseDim = true;\n }\n }\n }\n\n // Is the proposed unit list \"simpler\" than the existing one?\n if (proposedUnitList.length < ret.units.length && !missingBaseDim) {\n // Replace this unit list with the proposed list\n ret.units = proposedUnitList;\n }\n }\n }\n return ret;\n };\n\n /**\n * Returns a new Unit in the SI system with the same value as this one\n */\n Unit.prototype.toSI = function () {\n var ret = this.clone();\n var proposedUnitList = [];\n\n // Multiple units or units with powers are formatted like this:\n // 5 (kg m^2) / (s^3 mol)\n // Build an representation from the base units of the SI unit system\n for (var i = 0; i < BASE_DIMENSIONS.length; i++) {\n var baseDim = BASE_DIMENSIONS[i];\n if (Math.abs(ret.dimensions[i] || 0) > 1e-12) {\n if (hasOwnProperty(UNIT_SYSTEMS.si, baseDim)) {\n proposedUnitList.push({\n unit: UNIT_SYSTEMS.si[baseDim].unit,\n prefix: UNIT_SYSTEMS.si[baseDim].prefix,\n power: ret.dimensions[i] || 0\n });\n } else {\n throw new Error('Cannot express custom unit ' + baseDim + ' in SI units');\n }\n }\n }\n\n // Replace this unit list with the proposed list\n ret.units = proposedUnitList;\n ret.fixPrefix = true;\n ret.skipAutomaticSimplification = true;\n if (this.value !== null) {\n ret.value = null;\n return this.to(ret);\n }\n return ret;\n };\n\n /**\n * Get a string representation of the units of this Unit, without the value. The unit list is formatted as-is without first being simplified.\n * @memberof Unit\n * @return {string}\n */\n Unit.prototype.formatUnits = function () {\n var strNum = '';\n var strDen = '';\n var nNum = 0;\n var nDen = 0;\n for (var i = 0; i < this.units.length; i++) {\n if (this.units[i].power > 0) {\n nNum++;\n strNum += ' ' + this.units[i].prefix.name + this.units[i].unit.name;\n if (Math.abs(this.units[i].power - 1.0) > 1e-15) {\n strNum += '^' + this.units[i].power;\n }\n } else if (this.units[i].power < 0) {\n nDen++;\n }\n }\n if (nDen > 0) {\n for (var _i4 = 0; _i4 < this.units.length; _i4++) {\n if (this.units[_i4].power < 0) {\n if (nNum > 0) {\n strDen += ' ' + this.units[_i4].prefix.name + this.units[_i4].unit.name;\n if (Math.abs(this.units[_i4].power + 1.0) > 1e-15) {\n strDen += '^' + -this.units[_i4].power;\n }\n } else {\n strDen += ' ' + this.units[_i4].prefix.name + this.units[_i4].unit.name;\n strDen += '^' + this.units[_i4].power;\n }\n }\n }\n }\n // Remove leading \" \"\n strNum = strNum.substr(1);\n strDen = strDen.substr(1);\n\n // Add parans for better copy/paste back into evaluate, for example, or for better pretty print formatting\n if (nNum > 1 && nDen > 0) {\n strNum = '(' + strNum + ')';\n }\n if (nDen > 1 && nNum > 0) {\n strDen = '(' + strDen + ')';\n }\n var str = strNum;\n if (nNum > 0 && nDen > 0) {\n str += ' / ';\n }\n str += strDen;\n return str;\n };\n\n /**\n * Get a string representation of the Unit, with optional formatting options.\n * @memberof Unit\n * @param {Object | number | Function} [options] Formatting options. See\n * lib/utils/number:format for a\n * description of the available\n * options.\n * @return {string}\n */\n Unit.prototype.format = function (options) {\n // Simplfy the unit list, unless it is valueless or was created directly in the\n // constructor or as the result of to or toSI\n var simp = this.skipAutomaticSimplification || this.value === null ? this.clone() : this.simplify();\n\n // Apply some custom logic for handling VA and VAR. The goal is to express the value of the unit as a real value, if possible. Otherwise, use a real-valued unit instead of a complex-valued one.\n var isImaginary = false;\n if (typeof simp.value !== 'undefined' && simp.value !== null && isComplex(simp.value)) {\n // TODO: Make this better, for example, use relative magnitude of re and im rather than absolute\n isImaginary = Math.abs(simp.value.re) < 1e-14;\n }\n for (var i in simp.units) {\n if (hasOwnProperty(simp.units, i)) {\n if (simp.units[i].unit) {\n if (simp.units[i].unit.name === 'VA' && isImaginary) {\n simp.units[i].unit = UNITS.VAR;\n } else if (simp.units[i].unit.name === 'VAR' && !isImaginary) {\n simp.units[i].unit = UNITS.VA;\n }\n }\n }\n }\n\n // Now apply the best prefix\n // Units must have only one unit and not have the fixPrefix flag set\n if (simp.units.length === 1 && !simp.fixPrefix) {\n // Units must have integer powers, otherwise the prefix will change the\n // outputted value by not-an-integer-power-of-ten\n if (Math.abs(simp.units[0].power - Math.round(simp.units[0].power)) < 1e-14) {\n // Apply the best prefix\n simp.units[0].prefix = simp._bestPrefix();\n }\n }\n var value = simp._denormalize(simp.value);\n var str = simp.value !== null ? format(value, options || {}) : '';\n var unitStr = simp.formatUnits();\n if (simp.value && isComplex(simp.value)) {\n str = '(' + str + ')'; // Surround complex values with ( ) to enable better parsing\n }\n if (unitStr.length > 0 && str.length > 0) {\n str += ' ';\n }\n str += unitStr;\n return str;\n };\n\n /**\n * Calculate the best prefix using current value.\n * @memberof Unit\n * @returns {Object} prefix\n * @private\n */\n Unit.prototype._bestPrefix = function () {\n if (this.units.length !== 1) {\n throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!');\n }\n if (Math.abs(this.units[0].power - Math.round(this.units[0].power)) >= 1e-14) {\n throw new Error('Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!');\n }\n\n // find the best prefix value (resulting in the value of which\n // the absolute value of the log10 is closest to zero,\n // though with a little offset of 1.2 for nicer values: you get a\n // sequence 1mm 100mm 500mm 0.6m 1m 10m 100m 500m 0.6km 1km ...\n\n // Note: the units value can be any numeric type, but to find the best\n // prefix it's enough to work with limited precision of a regular number\n // Update: using mathjs abs since we also allow complex numbers\n var absValue = this.value !== null ? abs(this.value) : 0;\n var absUnitValue = abs(this.units[0].unit.value);\n var bestPrefix = this.units[0].prefix;\n if (absValue === 0) {\n return bestPrefix;\n }\n var power = this.units[0].power;\n var bestDiff = Math.log(absValue / Math.pow(bestPrefix.value * absUnitValue, power)) / Math.LN10 - 1.2;\n if (bestDiff > -2.200001 && bestDiff < 1.800001) return bestPrefix; // Allow the original prefix\n bestDiff = Math.abs(bestDiff);\n var prefixes = this.units[0].unit.prefixes;\n for (var p in prefixes) {\n if (hasOwnProperty(prefixes, p)) {\n var prefix = prefixes[p];\n if (prefix.scientific) {\n var diff = Math.abs(Math.log(absValue / Math.pow(prefix.value * absUnitValue, power)) / Math.LN10 - 1.2);\n if (diff < bestDiff || diff === bestDiff && prefix.name.length < bestPrefix.name.length) {\n // choose the prefix with the smallest diff, or if equal, choose the one\n // with the shortest name (can happen with SHORTLONG for example)\n bestPrefix = prefix;\n bestDiff = diff;\n }\n }\n }\n }\n return bestPrefix;\n };\n\n /**\n * Returns an array of units whose sum is equal to this unit\n * @memberof Unit\n * @param {Array} [parts] An array of strings or valueless units.\n *\n * Example:\n *\n * const u = new Unit(1, 'm')\n * u.splitUnit(['feet', 'inch'])\n * [ 3 feet, 3.3700787401575 inch ]\n *\n * @return {Array} An array of units.\n */\n Unit.prototype.splitUnit = function (parts) {\n var x = this.clone();\n var ret = [];\n for (var i = 0; i < parts.length; i++) {\n // Convert x to the requested unit\n x = x.to(parts[i]);\n if (i === parts.length - 1) break;\n\n // Get the numeric value of this unit\n var xNumeric = x.toNumeric();\n\n // Check to see if xNumeric is nearly equal to an integer,\n // since fix can incorrectly round down if there is round-off error\n var xRounded = round(xNumeric);\n var xFixed = void 0;\n var isNearlyEqual = equal(xRounded, xNumeric);\n if (isNearlyEqual) {\n xFixed = xRounded;\n } else {\n xFixed = fix(x.toNumeric());\n }\n var y = new Unit(xFixed, parts[i].toString());\n ret.push(y);\n x = subtractScalar(x, y);\n }\n\n // This little bit fixes a bug where the remainder should be 0 but is a little bit off.\n // But instead of comparing x, the remainder, with zero--we will compare the sum of\n // all the parts so far with the original value. If they are nearly equal,\n // we set the remainder to 0.\n var testSum = 0;\n for (var _i5 = 0; _i5 < ret.length; _i5++) {\n testSum = addScalar(testSum, ret[_i5].value);\n }\n if (equal(testSum, this.value)) {\n x.value = 0;\n }\n ret.push(x);\n return ret;\n };\n var PREFIXES = {\n NONE: {\n '': {\n name: '',\n value: 1,\n scientific: true\n }\n },\n SHORT: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e1,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e2,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e3,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e6,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e9,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e12,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e15,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e18,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e21,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e24,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e27,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e30,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-1,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-2,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-3,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-6,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-9,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-12,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-15,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-18,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-21,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-24,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-27,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-30,\n scientific: true\n }\n },\n LONG: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n deca: {\n name: 'deca',\n value: 1e1,\n scientific: false\n },\n hecto: {\n name: 'hecto',\n value: 1e2,\n scientific: false\n },\n kilo: {\n name: 'kilo',\n value: 1e3,\n scientific: true\n },\n mega: {\n name: 'mega',\n value: 1e6,\n scientific: true\n },\n giga: {\n name: 'giga',\n value: 1e9,\n scientific: true\n },\n tera: {\n name: 'tera',\n value: 1e12,\n scientific: true\n },\n peta: {\n name: 'peta',\n value: 1e15,\n scientific: true\n },\n exa: {\n name: 'exa',\n value: 1e18,\n scientific: true\n },\n zetta: {\n name: 'zetta',\n value: 1e21,\n scientific: true\n },\n yotta: {\n name: 'yotta',\n value: 1e24,\n scientific: true\n },\n ronna: {\n name: 'ronna',\n value: 1e27,\n scientific: true\n },\n quetta: {\n name: 'quetta',\n value: 1e30,\n scientific: true\n },\n deci: {\n name: 'deci',\n value: 1e-1,\n scientific: false\n },\n centi: {\n name: 'centi',\n value: 1e-2,\n scientific: false\n },\n milli: {\n name: 'milli',\n value: 1e-3,\n scientific: true\n },\n micro: {\n name: 'micro',\n value: 1e-6,\n scientific: true\n },\n nano: {\n name: 'nano',\n value: 1e-9,\n scientific: true\n },\n pico: {\n name: 'pico',\n value: 1e-12,\n scientific: true\n },\n femto: {\n name: 'femto',\n value: 1e-15,\n scientific: true\n },\n atto: {\n name: 'atto',\n value: 1e-18,\n scientific: true\n },\n zepto: {\n name: 'zepto',\n value: 1e-21,\n scientific: true\n },\n yocto: {\n name: 'yocto',\n value: 1e-24,\n scientific: true\n },\n ronto: {\n name: 'ronto',\n value: 1e-27,\n scientific: true\n },\n quecto: {\n name: 'quecto',\n value: 1e-30,\n scientific: true\n }\n },\n SQUARED: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e2,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e4,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e6,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e12,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e18,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e24,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e30,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e36,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e42,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e48,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e54,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e60,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-2,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-4,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-6,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-12,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-18,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-24,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-30,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-36,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-42,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-48,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-54,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-60,\n scientific: true\n }\n },\n CUBIC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n da: {\n name: 'da',\n value: 1e3,\n scientific: false\n },\n h: {\n name: 'h',\n value: 1e6,\n scientific: false\n },\n k: {\n name: 'k',\n value: 1e9,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e18,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e27,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e36,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e45,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e54,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e63,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e72,\n scientific: true\n },\n R: {\n name: 'R',\n value: 1e81,\n scientific: true\n },\n Q: {\n name: 'Q',\n value: 1e90,\n scientific: true\n },\n d: {\n name: 'd',\n value: 1e-3,\n scientific: false\n },\n c: {\n name: 'c',\n value: 1e-6,\n scientific: false\n },\n m: {\n name: 'm',\n value: 1e-9,\n scientific: true\n },\n u: {\n name: 'u',\n value: 1e-18,\n scientific: true\n },\n n: {\n name: 'n',\n value: 1e-27,\n scientific: true\n },\n p: {\n name: 'p',\n value: 1e-36,\n scientific: true\n },\n f: {\n name: 'f',\n value: 1e-45,\n scientific: true\n },\n a: {\n name: 'a',\n value: 1e-54,\n scientific: true\n },\n z: {\n name: 'z',\n value: 1e-63,\n scientific: true\n },\n y: {\n name: 'y',\n value: 1e-72,\n scientific: true\n },\n r: {\n name: 'r',\n value: 1e-81,\n scientific: true\n },\n q: {\n name: 'q',\n value: 1e-90,\n scientific: true\n }\n },\n BINARY_SHORT_SI: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n k: {\n name: 'k',\n value: 1e3,\n scientific: true\n },\n M: {\n name: 'M',\n value: 1e6,\n scientific: true\n },\n G: {\n name: 'G',\n value: 1e9,\n scientific: true\n },\n T: {\n name: 'T',\n value: 1e12,\n scientific: true\n },\n P: {\n name: 'P',\n value: 1e15,\n scientific: true\n },\n E: {\n name: 'E',\n value: 1e18,\n scientific: true\n },\n Z: {\n name: 'Z',\n value: 1e21,\n scientific: true\n },\n Y: {\n name: 'Y',\n value: 1e24,\n scientific: true\n }\n },\n BINARY_SHORT_IEC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n Ki: {\n name: 'Ki',\n value: 1024,\n scientific: true\n },\n Mi: {\n name: 'Mi',\n value: Math.pow(1024, 2),\n scientific: true\n },\n Gi: {\n name: 'Gi',\n value: Math.pow(1024, 3),\n scientific: true\n },\n Ti: {\n name: 'Ti',\n value: Math.pow(1024, 4),\n scientific: true\n },\n Pi: {\n name: 'Pi',\n value: Math.pow(1024, 5),\n scientific: true\n },\n Ei: {\n name: 'Ei',\n value: Math.pow(1024, 6),\n scientific: true\n },\n Zi: {\n name: 'Zi',\n value: Math.pow(1024, 7),\n scientific: true\n },\n Yi: {\n name: 'Yi',\n value: Math.pow(1024, 8),\n scientific: true\n }\n },\n BINARY_LONG_SI: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n kilo: {\n name: 'kilo',\n value: 1e3,\n scientific: true\n },\n mega: {\n name: 'mega',\n value: 1e6,\n scientific: true\n },\n giga: {\n name: 'giga',\n value: 1e9,\n scientific: true\n },\n tera: {\n name: 'tera',\n value: 1e12,\n scientific: true\n },\n peta: {\n name: 'peta',\n value: 1e15,\n scientific: true\n },\n exa: {\n name: 'exa',\n value: 1e18,\n scientific: true\n },\n zetta: {\n name: 'zetta',\n value: 1e21,\n scientific: true\n },\n yotta: {\n name: 'yotta',\n value: 1e24,\n scientific: true\n }\n },\n BINARY_LONG_IEC: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n kibi: {\n name: 'kibi',\n value: 1024,\n scientific: true\n },\n mebi: {\n name: 'mebi',\n value: Math.pow(1024, 2),\n scientific: true\n },\n gibi: {\n name: 'gibi',\n value: Math.pow(1024, 3),\n scientific: true\n },\n tebi: {\n name: 'tebi',\n value: Math.pow(1024, 4),\n scientific: true\n },\n pebi: {\n name: 'pebi',\n value: Math.pow(1024, 5),\n scientific: true\n },\n exi: {\n name: 'exi',\n value: Math.pow(1024, 6),\n scientific: true\n },\n zebi: {\n name: 'zebi',\n value: Math.pow(1024, 7),\n scientific: true\n },\n yobi: {\n name: 'yobi',\n value: Math.pow(1024, 8),\n scientific: true\n }\n },\n BTU: {\n '': {\n name: '',\n value: 1,\n scientific: true\n },\n MM: {\n name: 'MM',\n value: 1e6,\n scientific: true\n }\n }\n };\n PREFIXES.SHORTLONG = _extends({}, PREFIXES.SHORT, PREFIXES.LONG);\n PREFIXES.BINARY_SHORT = _extends({}, PREFIXES.BINARY_SHORT_SI, PREFIXES.BINARY_SHORT_IEC);\n PREFIXES.BINARY_LONG = _extends({}, PREFIXES.BINARY_LONG_SI, PREFIXES.BINARY_LONG_IEC);\n\n /* Internally, each unit is represented by a value and a dimension array. The elements of the dimensions array have the following meaning:\n * Index Dimension\n * ----- ---------\n * 0 Length\n * 1 Mass\n * 2 Time\n * 3 Current\n * 4 Temperature\n * 5 Luminous intensity\n * 6 Amount of substance\n * 7 Angle\n * 8 Bit (digital)\n * For example, the unit \"298.15 K\" is a pure temperature and would have a value of 298.15 and a dimension array of [0, 0, 0, 0, 1, 0, 0, 0, 0]. The unit \"1 cal / (gm \u00B0C)\" can be written in terms of the 9 fundamental dimensions as [length^2] / ([time^2] * [temperature]), and would a value of (after conversion to SI) 4184.0 and a dimensions array of [2, 0, -2, 0, -1, 0, 0, 0, 0].\n *\n */\n\n var BASE_DIMENSIONS = ['MASS', 'LENGTH', 'TIME', 'CURRENT', 'TEMPERATURE', 'LUMINOUS_INTENSITY', 'AMOUNT_OF_SUBSTANCE', 'ANGLE', 'BIT'];\n var BASE_UNITS = {\n NONE: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 0]\n },\n MASS: {\n dimensions: [1, 0, 0, 0, 0, 0, 0, 0, 0]\n },\n LENGTH: {\n dimensions: [0, 1, 0, 0, 0, 0, 0, 0, 0]\n },\n TIME: {\n dimensions: [0, 0, 1, 0, 0, 0, 0, 0, 0]\n },\n CURRENT: {\n dimensions: [0, 0, 0, 1, 0, 0, 0, 0, 0]\n },\n TEMPERATURE: {\n dimensions: [0, 0, 0, 0, 1, 0, 0, 0, 0]\n },\n LUMINOUS_INTENSITY: {\n dimensions: [0, 0, 0, 0, 0, 1, 0, 0, 0]\n },\n AMOUNT_OF_SUBSTANCE: {\n dimensions: [0, 0, 0, 0, 0, 0, 1, 0, 0]\n },\n FORCE: {\n dimensions: [1, 1, -2, 0, 0, 0, 0, 0, 0]\n },\n SURFACE: {\n dimensions: [0, 2, 0, 0, 0, 0, 0, 0, 0]\n },\n VOLUME: {\n dimensions: [0, 3, 0, 0, 0, 0, 0, 0, 0]\n },\n ENERGY: {\n dimensions: [1, 2, -2, 0, 0, 0, 0, 0, 0]\n },\n POWER: {\n dimensions: [1, 2, -3, 0, 0, 0, 0, 0, 0]\n },\n PRESSURE: {\n dimensions: [1, -1, -2, 0, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CHARGE: {\n dimensions: [0, 0, 1, 1, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CAPACITANCE: {\n dimensions: [-1, -2, 4, 2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_POTENTIAL: {\n dimensions: [1, 2, -3, -1, 0, 0, 0, 0, 0]\n },\n ELECTRIC_RESISTANCE: {\n dimensions: [1, 2, -3, -2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_INDUCTANCE: {\n dimensions: [1, 2, -2, -2, 0, 0, 0, 0, 0]\n },\n ELECTRIC_CONDUCTANCE: {\n dimensions: [-1, -2, 3, 2, 0, 0, 0, 0, 0]\n },\n MAGNETIC_FLUX: {\n dimensions: [1, 2, -2, -1, 0, 0, 0, 0, 0]\n },\n MAGNETIC_FLUX_DENSITY: {\n dimensions: [1, 0, -2, -1, 0, 0, 0, 0, 0]\n },\n FREQUENCY: {\n dimensions: [0, 0, -1, 0, 0, 0, 0, 0, 0]\n },\n ANGLE: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 1, 0]\n },\n BIT: {\n dimensions: [0, 0, 0, 0, 0, 0, 0, 0, 1]\n }\n };\n for (var key in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, key)) {\n BASE_UNITS[key].key = key;\n }\n }\n var BASE_UNIT_NONE = {};\n var UNIT_NONE = {\n name: '',\n base: BASE_UNIT_NONE,\n value: 1,\n offset: 0,\n dimensions: BASE_DIMENSIONS.map(x => 0)\n };\n var UNITS = {\n // length\n meter: {\n name: 'meter',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n inch: {\n name: 'inch',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0254,\n offset: 0\n },\n foot: {\n name: 'foot',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.3048,\n offset: 0\n },\n yard: {\n name: 'yard',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.9144,\n offset: 0\n },\n mile: {\n name: 'mile',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1609.344,\n offset: 0\n },\n link: {\n name: 'link',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.201168,\n offset: 0\n },\n rod: {\n name: 'rod',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 5.0292,\n offset: 0\n },\n chain: {\n name: 'chain',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 20.1168,\n offset: 0\n },\n angstrom: {\n name: 'angstrom',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1e-10,\n offset: 0\n },\n m: {\n name: 'm',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n in: {\n name: 'in',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0254,\n offset: 0\n },\n ft: {\n name: 'ft',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.3048,\n offset: 0\n },\n yd: {\n name: 'yd',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.9144,\n offset: 0\n },\n mi: {\n name: 'mi',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 1609.344,\n offset: 0\n },\n li: {\n name: 'li',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.201168,\n offset: 0\n },\n rd: {\n name: 'rd',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 5.029210,\n offset: 0\n },\n ch: {\n name: 'ch',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 20.1168,\n offset: 0\n },\n mil: {\n name: 'mil',\n base: BASE_UNITS.LENGTH,\n prefixes: PREFIXES.NONE,\n value: 0.0000254,\n offset: 0\n },\n // 1/1000 inch\n\n // Surface\n m2: {\n name: 'm2',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.SQUARED,\n value: 1,\n offset: 0\n },\n sqin: {\n name: 'sqin',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.00064516,\n offset: 0\n },\n // 645.16 mm2\n sqft: {\n name: 'sqft',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.09290304,\n offset: 0\n },\n // 0.09290304 m2\n sqyd: {\n name: 'sqyd',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 0.83612736,\n offset: 0\n },\n // 0.83612736 m2\n sqmi: {\n name: 'sqmi',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 2589988.110336,\n offset: 0\n },\n // 2.589988110336 km2\n sqrd: {\n name: 'sqrd',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 25.29295,\n offset: 0\n },\n // 25.29295 m2\n sqch: {\n name: 'sqch',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 404.6873,\n offset: 0\n },\n // 404.6873 m2\n sqmil: {\n name: 'sqmil',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 6.4516e-10,\n offset: 0\n },\n // 6.4516 * 10^-10 m2\n acre: {\n name: 'acre',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 4046.86,\n offset: 0\n },\n // 4046.86 m2\n hectare: {\n name: 'hectare',\n base: BASE_UNITS.SURFACE,\n prefixes: PREFIXES.NONE,\n value: 10000,\n offset: 0\n },\n // 10000 m2\n\n // Volume\n m3: {\n name: 'm3',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.CUBIC,\n value: 1,\n offset: 0\n },\n L: {\n name: 'L',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n // litre\n l: {\n name: 'l',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n // litre\n litre: {\n name: 'litre',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.LONG,\n value: 0.001,\n offset: 0\n },\n cuin: {\n name: 'cuin',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 1.6387064e-5,\n offset: 0\n },\n // 1.6387064e-5 m3\n cuft: {\n name: 'cuft',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.028316846592,\n offset: 0\n },\n // 28.316 846 592 L\n cuyd: {\n name: 'cuyd',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.764554857984,\n offset: 0\n },\n // 764.554 857 984 L\n teaspoon: {\n name: 'teaspoon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000005,\n offset: 0\n },\n // 5 mL\n tablespoon: {\n name: 'tablespoon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.000015,\n offset: 0\n },\n // 15 mL\n // {name: 'cup', base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 0.000240, offset: 0}, // 240 mL // not possible, we have already another cup\n drop: {\n name: 'drop',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 5e-8,\n offset: 0\n },\n // 0.05 mL = 5e-8 m3\n gtt: {\n name: 'gtt',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 5e-8,\n offset: 0\n },\n // 0.05 mL = 5e-8 m3\n\n // Liquid volume\n minim: {\n name: 'minim',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.00000006161152,\n offset: 0\n },\n // 0.06161152 mL\n fluiddram: {\n name: 'fluiddram',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0000036966911,\n offset: 0\n },\n // 3.696691 mL\n fluidounce: {\n name: 'fluidounce',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.00002957353,\n offset: 0\n },\n // 29.57353 mL\n gill: {\n name: 'gill',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0001182941,\n offset: 0\n },\n // 118.2941 mL\n cc: {\n name: 'cc',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 1e-6,\n offset: 0\n },\n // 1e-6 L\n cup: {\n name: 'cup',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0002365882,\n offset: 0\n },\n // 236.5882 mL\n pint: {\n name: 'pint',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0004731765,\n offset: 0\n },\n // 473.1765 mL\n quart: {\n name: 'quart',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0009463529,\n offset: 0\n },\n // 946.3529 mL\n gallon: {\n name: 'gallon',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.003785412,\n offset: 0\n },\n // 3.785412 L\n beerbarrel: {\n name: 'beerbarrel',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.1173478,\n offset: 0\n },\n // 117.3478 L\n oilbarrel: {\n name: 'oilbarrel',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.1589873,\n offset: 0\n },\n // 158.9873 L\n hogshead: {\n name: 'hogshead',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.2384810,\n offset: 0\n },\n // 238.4810 L\n\n // {name: 'min', base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 0.00000006161152, offset: 0}, // 0.06161152 mL // min is already in use as minute\n fldr: {\n name: 'fldr',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0000036966911,\n offset: 0\n },\n // 3.696691 mL\n floz: {\n name: 'floz',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.00002957353,\n offset: 0\n },\n // 29.57353 mL\n gi: {\n name: 'gi',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0001182941,\n offset: 0\n },\n // 118.2941 mL\n cp: {\n name: 'cp',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0002365882,\n offset: 0\n },\n // 236.5882 mL\n pt: {\n name: 'pt',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0004731765,\n offset: 0\n },\n // 473.1765 mL\n qt: {\n name: 'qt',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.0009463529,\n offset: 0\n },\n // 946.3529 mL\n gal: {\n name: 'gal',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.003785412,\n offset: 0\n },\n // 3.785412 L\n bbl: {\n name: 'bbl',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.1173478,\n offset: 0\n },\n // 117.3478 L\n obl: {\n name: 'obl',\n base: BASE_UNITS.VOLUME,\n prefixes: PREFIXES.NONE,\n value: 0.1589873,\n offset: 0\n },\n // 158.9873 L\n // {name: 'hogshead', base: BASE_UNITS.VOLUME, prefixes: PREFIXES.NONE, value: 0.2384810, offset: 0}, // 238.4810 L // TODO: hh?\n\n // Mass\n g: {\n name: 'g',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 0.001,\n offset: 0\n },\n gram: {\n name: 'gram',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.LONG,\n value: 0.001,\n offset: 0\n },\n ton: {\n name: 'ton',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 907.18474,\n offset: 0\n },\n t: {\n name: 't',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.SHORT,\n value: 1000,\n offset: 0\n },\n tonne: {\n name: 'tonne',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.LONG,\n value: 1000,\n offset: 0\n },\n grain: {\n name: 'grain',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 64.79891e-6,\n offset: 0\n },\n dram: {\n name: 'dram',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 1.7718451953125e-3,\n offset: 0\n },\n ounce: {\n name: 'ounce',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 28.349523125e-3,\n offset: 0\n },\n poundmass: {\n name: 'poundmass',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 453.59237e-3,\n offset: 0\n },\n hundredweight: {\n name: 'hundredweight',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 45.359237,\n offset: 0\n },\n stick: {\n name: 'stick',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 115e-3,\n offset: 0\n },\n stone: {\n name: 'stone',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 6.35029318,\n offset: 0\n },\n gr: {\n name: 'gr',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 64.79891e-6,\n offset: 0\n },\n dr: {\n name: 'dr',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 1.7718451953125e-3,\n offset: 0\n },\n oz: {\n name: 'oz',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 28.349523125e-3,\n offset: 0\n },\n lbm: {\n name: 'lbm',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 453.59237e-3,\n offset: 0\n },\n cwt: {\n name: 'cwt',\n base: BASE_UNITS.MASS,\n prefixes: PREFIXES.NONE,\n value: 45.359237,\n offset: 0\n },\n // Time\n s: {\n name: 's',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n min: {\n name: 'min',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 60,\n offset: 0\n },\n h: {\n name: 'h',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3600,\n offset: 0\n },\n second: {\n name: 'second',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n sec: {\n name: 'sec',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n minute: {\n name: 'minute',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 60,\n offset: 0\n },\n hour: {\n name: 'hour',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3600,\n offset: 0\n },\n day: {\n name: 'day',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 86400,\n offset: 0\n },\n week: {\n name: 'week',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 7 * 86400,\n offset: 0\n },\n month: {\n name: 'month',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 2629800,\n // 1/12th of Julian year\n offset: 0\n },\n year: {\n name: 'year',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 31557600,\n // Julian year\n offset: 0\n },\n decade: {\n name: 'decade',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 315576000,\n // Julian decade\n offset: 0\n },\n century: {\n name: 'century',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 3155760000,\n // Julian century\n offset: 0\n },\n millennium: {\n name: 'millennium',\n base: BASE_UNITS.TIME,\n prefixes: PREFIXES.NONE,\n value: 31557600000,\n // Julian millennium\n offset: 0\n },\n // Frequency\n hertz: {\n name: 'Hertz',\n base: BASE_UNITS.FREQUENCY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0,\n reciprocal: true\n },\n Hz: {\n name: 'Hz',\n base: BASE_UNITS.FREQUENCY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0,\n reciprocal: true\n },\n // Angle\n rad: {\n name: 'rad',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n radian: {\n name: 'radian',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // deg = rad / (2*pi) * 360 = rad / 0.017453292519943295769236907684888\n deg: {\n name: 'deg',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n degree: {\n name: 'degree',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // grad = rad / (2*pi) * 400 = rad / 0.015707963267948966192313216916399\n grad: {\n name: 'grad',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.SHORT,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n gradian: {\n name: 'gradian',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.LONG,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // cycle = rad / (2*pi) = rad / 6.2831853071795864769252867665793\n cycle: {\n name: 'cycle',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // arcsec = rad / (3600 * (360 / 2 * pi)) = rad / 0.0000048481368110953599358991410235795\n arcsec: {\n name: 'arcsec',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // arcmin = rad / (60 * (360 / 2 * pi)) = rad / 0.00029088820866572159615394846141477\n arcmin: {\n name: 'arcmin',\n base: BASE_UNITS.ANGLE,\n prefixes: PREFIXES.NONE,\n value: null,\n // will be filled in by calculateAngleValues()\n offset: 0\n },\n // Electric current\n A: {\n name: 'A',\n base: BASE_UNITS.CURRENT,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n ampere: {\n name: 'ampere',\n base: BASE_UNITS.CURRENT,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // Temperature\n // K(C) = \u00B0C + 273.15\n // K(F) = (\u00B0F + 459.67) * (5 / 9)\n // K(R) = \u00B0R * (5 / 9)\n K: {\n name: 'K',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n degC: {\n name: 'degC',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 273.15\n },\n degF: {\n name: 'degF',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: new _Fraction(5, 9),\n offset: 459.67\n },\n degR: {\n name: 'degR',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.SHORT,\n value: new _Fraction(5, 9),\n offset: 0\n },\n kelvin: {\n name: 'kelvin',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n celsius: {\n name: 'celsius',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 273.15\n },\n fahrenheit: {\n name: 'fahrenheit',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: new _Fraction(5, 9),\n offset: 459.67\n },\n rankine: {\n name: 'rankine',\n base: BASE_UNITS.TEMPERATURE,\n prefixes: PREFIXES.LONG,\n value: new _Fraction(5, 9),\n offset: 0\n },\n // amount of substance\n mol: {\n name: 'mol',\n base: BASE_UNITS.AMOUNT_OF_SUBSTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n mole: {\n name: 'mole',\n base: BASE_UNITS.AMOUNT_OF_SUBSTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // luminous intensity\n cd: {\n name: 'cd',\n base: BASE_UNITS.LUMINOUS_INTENSITY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n candela: {\n name: 'candela',\n base: BASE_UNITS.LUMINOUS_INTENSITY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n // TODO: units STERADIAN\n // {name: 'sr', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0},\n // {name: 'steradian', base: BASE_UNITS.STERADIAN, prefixes: PREFIXES.NONE, value: 1, offset: 0},\n\n // Force\n N: {\n name: 'N',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n newton: {\n name: 'newton',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n dyn: {\n name: 'dyn',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.SHORT,\n value: 0.00001,\n offset: 0\n },\n dyne: {\n name: 'dyne',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 0.00001,\n offset: 0\n },\n lbf: {\n name: 'lbf',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 4.4482216152605,\n offset: 0\n },\n poundforce: {\n name: 'poundforce',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 4.4482216152605,\n offset: 0\n },\n kip: {\n name: 'kip',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.LONG,\n value: 4448.2216,\n offset: 0\n },\n kilogramforce: {\n name: 'kilogramforce',\n base: BASE_UNITS.FORCE,\n prefixes: PREFIXES.NONE,\n value: 9.80665,\n offset: 0\n },\n // Energy\n J: {\n name: 'J',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n joule: {\n name: 'joule',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n erg: {\n name: 'erg',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORTLONG,\n // Both kiloerg and kerg are acceptable\n value: 1e-7,\n offset: 0\n },\n Wh: {\n name: 'Wh',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 3600,\n offset: 0\n },\n BTU: {\n name: 'BTU',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.BTU,\n value: 1055.05585262,\n offset: 0\n },\n eV: {\n name: 'eV',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.SHORT,\n value: 1.602176565e-19,\n offset: 0\n },\n electronvolt: {\n name: 'electronvolt',\n base: BASE_UNITS.ENERGY,\n prefixes: PREFIXES.LONG,\n value: 1.602176565e-19,\n offset: 0\n },\n // Power\n W: {\n name: 'W',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n watt: {\n name: 'watt',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n hp: {\n name: 'hp',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.NONE,\n value: 745.6998715386,\n offset: 0\n },\n // Electrical power units\n VAR: {\n name: 'VAR',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: Complex.I,\n offset: 0\n },\n VA: {\n name: 'VA',\n base: BASE_UNITS.POWER,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Pressure\n Pa: {\n name: 'Pa',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n psi: {\n name: 'psi',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 6894.75729276459,\n offset: 0\n },\n atm: {\n name: 'atm',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 101325,\n offset: 0\n },\n bar: {\n name: 'bar',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.SHORTLONG,\n value: 100000,\n offset: 0\n },\n torr: {\n name: 'torr',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 133.322,\n offset: 0\n },\n mmHg: {\n name: 'mmHg',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 133.322,\n offset: 0\n },\n mmH2O: {\n name: 'mmH2O',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 9.80665,\n offset: 0\n },\n cmH2O: {\n name: 'cmH2O',\n base: BASE_UNITS.PRESSURE,\n prefixes: PREFIXES.NONE,\n value: 98.0665,\n offset: 0\n },\n // Electric charge\n coulomb: {\n name: 'coulomb',\n base: BASE_UNITS.ELECTRIC_CHARGE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n C: {\n name: 'C',\n base: BASE_UNITS.ELECTRIC_CHARGE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric capacitance\n farad: {\n name: 'farad',\n base: BASE_UNITS.ELECTRIC_CAPACITANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n F: {\n name: 'F',\n base: BASE_UNITS.ELECTRIC_CAPACITANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric potential\n volt: {\n name: 'volt',\n base: BASE_UNITS.ELECTRIC_POTENTIAL,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n V: {\n name: 'V',\n base: BASE_UNITS.ELECTRIC_POTENTIAL,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric resistance\n ohm: {\n name: 'ohm',\n base: BASE_UNITS.ELECTRIC_RESISTANCE,\n prefixes: PREFIXES.SHORTLONG,\n // Both Mohm and megaohm are acceptable\n value: 1,\n offset: 0\n },\n /*\n * Unicode breaks in browsers if charset is not specified\n \u03A9: {\n name: '\u03A9',\n base: BASE_UNITS.ELECTRIC_RESISTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n */\n // Electric inductance\n henry: {\n name: 'henry',\n base: BASE_UNITS.ELECTRIC_INDUCTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n H: {\n name: 'H',\n base: BASE_UNITS.ELECTRIC_INDUCTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Electric conductance\n siemens: {\n name: 'siemens',\n base: BASE_UNITS.ELECTRIC_CONDUCTANCE,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n S: {\n name: 'S',\n base: BASE_UNITS.ELECTRIC_CONDUCTANCE,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Magnetic flux\n weber: {\n name: 'weber',\n base: BASE_UNITS.MAGNETIC_FLUX,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n Wb: {\n name: 'Wb',\n base: BASE_UNITS.MAGNETIC_FLUX,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Magnetic flux density\n tesla: {\n name: 'tesla',\n base: BASE_UNITS.MAGNETIC_FLUX_DENSITY,\n prefixes: PREFIXES.LONG,\n value: 1,\n offset: 0\n },\n T: {\n name: 'T',\n base: BASE_UNITS.MAGNETIC_FLUX_DENSITY,\n prefixes: PREFIXES.SHORT,\n value: 1,\n offset: 0\n },\n // Binary\n b: {\n name: 'b',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_SHORT,\n value: 1,\n offset: 0\n },\n bits: {\n name: 'bits',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_LONG,\n value: 1,\n offset: 0\n },\n B: {\n name: 'B',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_SHORT,\n value: 8,\n offset: 0\n },\n bytes: {\n name: 'bytes',\n base: BASE_UNITS.BIT,\n prefixes: PREFIXES.BINARY_LONG,\n value: 8,\n offset: 0\n }\n };\n\n // aliases (formerly plurals)\n // note that ALIASES is only used at creation to create more entries in UNITS by copying the aliased units\n var ALIASES = {\n meters: 'meter',\n inches: 'inch',\n feet: 'foot',\n yards: 'yard',\n miles: 'mile',\n links: 'link',\n rods: 'rod',\n chains: 'chain',\n angstroms: 'angstrom',\n lt: 'l',\n litres: 'litre',\n liter: 'litre',\n liters: 'litre',\n teaspoons: 'teaspoon',\n tablespoons: 'tablespoon',\n minims: 'minim',\n fluiddrams: 'fluiddram',\n fluidounces: 'fluidounce',\n gills: 'gill',\n cups: 'cup',\n pints: 'pint',\n quarts: 'quart',\n gallons: 'gallon',\n beerbarrels: 'beerbarrel',\n oilbarrels: 'oilbarrel',\n hogsheads: 'hogshead',\n gtts: 'gtt',\n grams: 'gram',\n tons: 'ton',\n tonnes: 'tonne',\n grains: 'grain',\n drams: 'dram',\n ounces: 'ounce',\n poundmasses: 'poundmass',\n hundredweights: 'hundredweight',\n sticks: 'stick',\n lb: 'lbm',\n lbs: 'lbm',\n kips: 'kip',\n kgf: 'kilogramforce',\n acres: 'acre',\n hectares: 'hectare',\n sqfeet: 'sqft',\n sqyard: 'sqyd',\n sqmile: 'sqmi',\n sqmiles: 'sqmi',\n mmhg: 'mmHg',\n mmh2o: 'mmH2O',\n cmh2o: 'cmH2O',\n seconds: 'second',\n secs: 'second',\n minutes: 'minute',\n mins: 'minute',\n hours: 'hour',\n hr: 'hour',\n hrs: 'hour',\n days: 'day',\n weeks: 'week',\n months: 'month',\n years: 'year',\n decades: 'decade',\n centuries: 'century',\n millennia: 'millennium',\n hertz: 'hertz',\n radians: 'radian',\n degrees: 'degree',\n gradians: 'gradian',\n cycles: 'cycle',\n arcsecond: 'arcsec',\n arcseconds: 'arcsec',\n arcminute: 'arcmin',\n arcminutes: 'arcmin',\n BTUs: 'BTU',\n watts: 'watt',\n joules: 'joule',\n amperes: 'ampere',\n amps: 'ampere',\n amp: 'ampere',\n coulombs: 'coulomb',\n volts: 'volt',\n ohms: 'ohm',\n farads: 'farad',\n webers: 'weber',\n teslas: 'tesla',\n electronvolts: 'electronvolt',\n moles: 'mole',\n bit: 'bits',\n byte: 'bytes'\n };\n\n /**\n * Calculate the values for the angle units.\n * Value is calculated as number or BigNumber depending on the configuration\n * @param {{number: 'number' | 'BigNumber'}} config\n */\n function calculateAngleValues(config) {\n if (config.number === 'BigNumber') {\n var pi = createPi(_BigNumber);\n UNITS.rad.value = new _BigNumber(1);\n UNITS.deg.value = pi.div(180); // 2 * pi / 360\n UNITS.grad.value = pi.div(200); // 2 * pi / 400\n UNITS.cycle.value = pi.times(2); // 2 * pi\n UNITS.arcsec.value = pi.div(648000); // 2 * pi / 360 / 3600\n UNITS.arcmin.value = pi.div(10800); // 2 * pi / 360 / 60\n } else {\n // number\n UNITS.rad.value = 1;\n UNITS.deg.value = Math.PI / 180; // 2 * pi / 360\n UNITS.grad.value = Math.PI / 200; // 2 * pi / 400\n UNITS.cycle.value = Math.PI * 2; // 2 * pi\n UNITS.arcsec.value = Math.PI / 648000; // 2 * pi / 360 / 3600\n UNITS.arcmin.value = Math.PI / 10800; // 2 * pi / 360 / 60\n }\n\n // copy to the full names of the angles\n UNITS.radian.value = UNITS.rad.value;\n UNITS.degree.value = UNITS.deg.value;\n UNITS.gradian.value = UNITS.grad.value;\n }\n\n // apply the angle values now\n calculateAngleValues(config);\n if (on) {\n // recalculate the values on change of configuration\n on('config', function (curr, prev) {\n if (curr.number !== prev.number) {\n calculateAngleValues(curr);\n }\n });\n }\n\n /**\n * A unit system is a set of dimensionally independent base units plus a set of derived units, formed by multiplication and division of the base units, that are by convention used with the unit system.\n * A user perhaps could issue a command to select a preferred unit system, or use the default (see below).\n * Auto unit system: The default unit system is updated on the fly anytime a unit is parsed. The corresponding unit in the default unit system is updated, so that answers are given in the same units the user supplies.\n */\n var UNIT_SYSTEMS = {\n si: {\n // Base units\n NONE: {\n unit: UNIT_NONE,\n prefix: PREFIXES.NONE['']\n },\n LENGTH: {\n unit: UNITS.m,\n prefix: PREFIXES.SHORT['']\n },\n MASS: {\n unit: UNITS.g,\n prefix: PREFIXES.SHORT.k\n },\n TIME: {\n unit: UNITS.s,\n prefix: PREFIXES.SHORT['']\n },\n CURRENT: {\n unit: UNITS.A,\n prefix: PREFIXES.SHORT['']\n },\n TEMPERATURE: {\n unit: UNITS.K,\n prefix: PREFIXES.SHORT['']\n },\n LUMINOUS_INTENSITY: {\n unit: UNITS.cd,\n prefix: PREFIXES.SHORT['']\n },\n AMOUNT_OF_SUBSTANCE: {\n unit: UNITS.mol,\n prefix: PREFIXES.SHORT['']\n },\n ANGLE: {\n unit: UNITS.rad,\n prefix: PREFIXES.SHORT['']\n },\n BIT: {\n unit: UNITS.bits,\n prefix: PREFIXES.SHORT['']\n },\n // Derived units\n FORCE: {\n unit: UNITS.N,\n prefix: PREFIXES.SHORT['']\n },\n ENERGY: {\n unit: UNITS.J,\n prefix: PREFIXES.SHORT['']\n },\n POWER: {\n unit: UNITS.W,\n prefix: PREFIXES.SHORT['']\n },\n PRESSURE: {\n unit: UNITS.Pa,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CHARGE: {\n unit: UNITS.C,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CAPACITANCE: {\n unit: UNITS.F,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_POTENTIAL: {\n unit: UNITS.V,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_RESISTANCE: {\n unit: UNITS.ohm,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_INDUCTANCE: {\n unit: UNITS.H,\n prefix: PREFIXES.SHORT['']\n },\n ELECTRIC_CONDUCTANCE: {\n unit: UNITS.S,\n prefix: PREFIXES.SHORT['']\n },\n MAGNETIC_FLUX: {\n unit: UNITS.Wb,\n prefix: PREFIXES.SHORT['']\n },\n MAGNETIC_FLUX_DENSITY: {\n unit: UNITS.T,\n prefix: PREFIXES.SHORT['']\n },\n FREQUENCY: {\n unit: UNITS.Hz,\n prefix: PREFIXES.SHORT['']\n }\n }\n };\n\n // Clone to create the other unit systems\n UNIT_SYSTEMS.cgs = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n UNIT_SYSTEMS.cgs.LENGTH = {\n unit: UNITS.m,\n prefix: PREFIXES.SHORT.c\n };\n UNIT_SYSTEMS.cgs.MASS = {\n unit: UNITS.g,\n prefix: PREFIXES.SHORT['']\n };\n UNIT_SYSTEMS.cgs.FORCE = {\n unit: UNITS.dyn,\n prefix: PREFIXES.SHORT['']\n };\n UNIT_SYSTEMS.cgs.ENERGY = {\n unit: UNITS.erg,\n prefix: PREFIXES.NONE['']\n };\n // there are wholly 4 unique cgs systems for electricity and magnetism,\n // so let's not worry about it unless somebody complains\n\n UNIT_SYSTEMS.us = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n UNIT_SYSTEMS.us.LENGTH = {\n unit: UNITS.ft,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.MASS = {\n unit: UNITS.lbm,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.TEMPERATURE = {\n unit: UNITS.degF,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.FORCE = {\n unit: UNITS.lbf,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.ENERGY = {\n unit: UNITS.BTU,\n prefix: PREFIXES.BTU['']\n };\n UNIT_SYSTEMS.us.POWER = {\n unit: UNITS.hp,\n prefix: PREFIXES.NONE['']\n };\n UNIT_SYSTEMS.us.PRESSURE = {\n unit: UNITS.psi,\n prefix: PREFIXES.NONE['']\n };\n\n // Add additional unit systems here.\n\n // Choose a unit system to seed the auto unit system.\n UNIT_SYSTEMS.auto = JSON.parse(JSON.stringify(UNIT_SYSTEMS.si));\n\n // Set the current unit system\n var currentUnitSystem = UNIT_SYSTEMS.auto;\n\n /**\n * Set a unit system for formatting derived units.\n * @param {string} [name] The name of the unit system.\n */\n Unit.setUnitSystem = function (name) {\n if (hasOwnProperty(UNIT_SYSTEMS, name)) {\n currentUnitSystem = UNIT_SYSTEMS[name];\n } else {\n throw new Error('Unit system ' + name + ' does not exist. Choices are: ' + Object.keys(UNIT_SYSTEMS).join(', '));\n }\n };\n\n /**\n * Return the current unit system.\n * @return {string} The current unit system.\n */\n Unit.getUnitSystem = function () {\n for (var _key in UNIT_SYSTEMS) {\n if (hasOwnProperty(UNIT_SYSTEMS, _key)) {\n if (UNIT_SYSTEMS[_key] === currentUnitSystem) {\n return _key;\n }\n }\n }\n };\n\n /**\n * Converters to convert from number to an other numeric type like BigNumber\n * or Fraction\n */\n Unit.typeConverters = {\n BigNumber: function BigNumber(x) {\n if (x !== null && x !== void 0 && x.isFraction) return new _BigNumber(x.n).div(x.d).times(x.s);\n return new _BigNumber(x + ''); // stringify to prevent constructor error\n },\n Fraction: function Fraction(x) {\n return new _Fraction(x);\n },\n Complex: function Complex(x) {\n return x;\n },\n number: function number(x) {\n if (x !== null && x !== void 0 && x.isFraction) return _number(x);\n return x;\n }\n };\n\n /**\n * Retrieve the right converter function corresponding with this unit's\n * value\n *\n * @memberof Unit\n * @return {Function}\n */\n Unit.prototype._numberConverter = function () {\n var convert = Unit.typeConverters[this.valueType()];\n if (convert) {\n return convert;\n }\n throw new TypeError('Unsupported Unit value type \"' + this.valueType() + '\"');\n };\n\n /**\n * Retrieve the right convertor function corresponding with the type\n * of provided exampleValue.\n *\n * @param {string} type A string 'number', 'BigNumber', or 'Fraction'\n * In case of an unknown type,\n * @return {Function}\n */\n Unit._getNumberConverter = function (type) {\n if (!Unit.typeConverters[type]) {\n throw new TypeError('Unsupported type \"' + type + '\"');\n }\n return Unit.typeConverters[type];\n };\n\n // Add dimensions to each built-in unit\n for (var _key2 in UNITS) {\n if (hasOwnProperty(UNITS, _key2)) {\n var unit = UNITS[_key2];\n unit.dimensions = unit.base.dimensions;\n }\n }\n\n // Create aliases\n for (var _name2 in ALIASES) {\n if (hasOwnProperty(ALIASES, _name2)) {\n var _unit2 = UNITS[ALIASES[_name2]];\n var alias = {};\n for (var _key3 in _unit2) {\n if (hasOwnProperty(_unit2, _key3)) {\n alias[_key3] = _unit2[_key3];\n }\n }\n alias.name = _name2;\n UNITS[_name2] = alias;\n }\n }\n\n /**\n * Checks if a character is a valid latin letter (upper or lower case).\n * Note that this function can be overridden, for example to allow support of other alphabets.\n * @param {string} c Tested character\n */\n Unit.isValidAlpha = function isValidAlpha(c) {\n return /^[a-zA-Z]$/.test(c);\n };\n function assertUnitNameIsValid(name) {\n for (var i = 0; i < name.length; i++) {\n c = name.charAt(i);\n if (i === 0 && !Unit.isValidAlpha(c)) {\n throw new Error('Invalid unit name (must begin with alpha character): \"' + name + '\"');\n }\n if (i > 0 && !(Unit.isValidAlpha(c) || isDigit(c))) {\n throw new Error('Invalid unit name (only alphanumeric characters are allowed): \"' + name + '\"');\n }\n }\n }\n\n /**\n * Wrapper around createUnitSingle.\n * Example:\n * createUnit({\n * foo: { },\n * bar: {\n * definition: 'kg/foo',\n * aliases: ['ba', 'barr', 'bars'],\n * offset: 200\n * },\n * baz: '4 bar'\n * },\n * {\n * override: true\n * })\n * @param {object} obj Object map. Each key becomes a unit which is defined by its value.\n * @param {object} options\n */\n Unit.createUnit = function (obj, options) {\n if (typeof obj !== 'object') {\n throw new TypeError(\"createUnit expects first parameter to be of type 'Object'\");\n }\n\n // Remove all units and aliases we are overriding\n if (options && options.override) {\n for (var _key4 in obj) {\n if (hasOwnProperty(obj, _key4)) {\n Unit.deleteUnit(_key4);\n }\n if (obj[_key4].aliases) {\n for (var i = 0; i < obj[_key4].aliases.length; i++) {\n Unit.deleteUnit(obj[_key4].aliases[i]);\n }\n }\n }\n }\n\n // TODO: traverse multiple times until all units have been added\n var lastUnit;\n for (var _key5 in obj) {\n if (hasOwnProperty(obj, _key5)) {\n lastUnit = Unit.createUnitSingle(_key5, obj[_key5]);\n }\n }\n return lastUnit;\n };\n\n /**\n * Create a user-defined unit and register it with the Unit type.\n * Example:\n * createUnitSingle('knot', '0.514444444 m/s')\n * createUnitSingle('acre', new Unit(43560, 'ft^2'))\n *\n * @param {string} name The name of the new unit. Must be unique. Example: 'knot'\n * @param {string, Unit, Object} definition Definition of the unit in terms\n * of existing units. For example, '0.514444444 m / s'. Can be a Unit, a string,\n * or an Object. If an Object, may have the following properties:\n * - definition {string|Unit} The definition of this unit.\n * - prefixes {string} \"none\", \"short\", \"long\", \"binary_short\", or \"binary_long\".\n * The default is \"none\".\n * - aliases {Array} Array of strings. Example: ['knots', 'kt', 'kts']\n * - offset {Numeric} An offset to apply when converting from the unit. For\n * example, the offset for celsius is 273.15 and the offset for farhenheit\n * is 459.67. Default is 0.\n * - baseName {string} If the unit's dimension does not match that of any other\n * base unit, the name of the newly create base unit. Otherwise, this property\n * has no effect.\n *\n * @return {Unit}\n */\n Unit.createUnitSingle = function (name, obj) {\n if (typeof obj === 'undefined' || obj === null) {\n obj = {};\n }\n if (typeof name !== 'string') {\n throw new TypeError(\"createUnitSingle expects first parameter to be of type 'string'\");\n }\n\n // Check collisions with existing units\n if (hasOwnProperty(UNITS, name)) {\n throw new Error('Cannot create unit \"' + name + '\": a unit with that name already exists');\n }\n\n // TODO: Validate name for collisions with other built-in functions (like abs or cos, for example), and for acceptable variable names. For example, '42' is probably not a valid unit. Nor is '%', since it is also an operator.\n\n assertUnitNameIsValid(name);\n var defUnit = null; // The Unit from which the new unit will be created.\n var aliases = [];\n var offset = 0;\n var definition;\n var prefixes;\n var baseName;\n if (obj && obj.type === 'Unit') {\n defUnit = obj.clone();\n } else if (typeof obj === 'string') {\n if (obj !== '') {\n definition = obj;\n }\n } else if (typeof obj === 'object') {\n definition = obj.definition;\n prefixes = obj.prefixes;\n offset = obj.offset;\n baseName = obj.baseName;\n if (obj.aliases) {\n aliases = obj.aliases.valueOf(); // aliases could be a Matrix, so convert to Array\n }\n } else {\n throw new TypeError('Cannot create unit \"' + name + '\" from \"' + obj.toString() + '\": expecting \"string\" or \"Unit\" or \"Object\"');\n }\n if (aliases) {\n for (var i = 0; i < aliases.length; i++) {\n if (hasOwnProperty(UNITS, aliases[i])) {\n throw new Error('Cannot create alias \"' + aliases[i] + '\": a unit with that name already exists');\n }\n }\n }\n if (definition && typeof definition === 'string' && !defUnit) {\n try {\n defUnit = Unit.parse(definition, {\n allowNoUnits: true\n });\n } catch (ex) {\n ex.message = 'Could not create unit \"' + name + '\" from \"' + definition + '\": ' + ex.message;\n throw ex;\n }\n } else if (definition && definition.type === 'Unit') {\n defUnit = definition.clone();\n }\n aliases = aliases || [];\n offset = offset || 0;\n if (prefixes && prefixes.toUpperCase) {\n prefixes = PREFIXES[prefixes.toUpperCase()] || PREFIXES.NONE;\n } else {\n prefixes = PREFIXES.NONE;\n }\n\n // If defUnit is null, it is because the user did not\n // specify a defintion. So create a new base dimension.\n var newUnit = {};\n if (!defUnit) {\n // Add a new base dimension\n baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo\n if (BASE_DIMENSIONS.indexOf(baseName) >= 0) {\n throw new Error('Cannot create new base unit \"' + name + '\": a base unit with that name already exists (and cannot be overridden)');\n }\n BASE_DIMENSIONS.push(baseName);\n\n // Push 0 onto existing base units\n for (var b in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, b)) {\n BASE_UNITS[b].dimensions[BASE_DIMENSIONS.length - 1] = 0;\n }\n }\n\n // Add the new base unit\n var newBaseUnit = {\n dimensions: []\n };\n for (var _i6 = 0; _i6 < BASE_DIMENSIONS.length; _i6++) {\n newBaseUnit.dimensions[_i6] = 0;\n }\n newBaseUnit.dimensions[BASE_DIMENSIONS.length - 1] = 1;\n newBaseUnit.key = baseName;\n BASE_UNITS[baseName] = newBaseUnit;\n newUnit = {\n name,\n value: 1,\n dimensions: BASE_UNITS[baseName].dimensions.slice(0),\n prefixes,\n offset,\n base: BASE_UNITS[baseName]\n };\n currentUnitSystem[baseName] = {\n unit: newUnit,\n prefix: PREFIXES.NONE['']\n };\n } else {\n newUnit = {\n name,\n value: defUnit.value,\n dimensions: defUnit.dimensions.slice(0),\n prefixes,\n offset\n };\n\n // Create a new base if no matching base exists\n var anyMatch = false;\n for (var _i7 in BASE_UNITS) {\n if (hasOwnProperty(BASE_UNITS, _i7)) {\n var match = true;\n for (var j = 0; j < BASE_DIMENSIONS.length; j++) {\n if (Math.abs((newUnit.dimensions[j] || 0) - (BASE_UNITS[_i7].dimensions[j] || 0)) > 1e-12) {\n match = false;\n break;\n }\n }\n if (match) {\n anyMatch = true;\n newUnit.base = BASE_UNITS[_i7];\n break;\n }\n }\n }\n if (!anyMatch) {\n baseName = baseName || name + '_STUFF'; // foo --> foo_STUFF, or the essence of foo\n // Add the new base unit\n var _newBaseUnit = {\n dimensions: defUnit.dimensions.slice(0)\n };\n _newBaseUnit.key = baseName;\n BASE_UNITS[baseName] = _newBaseUnit;\n currentUnitSystem[baseName] = {\n unit: newUnit,\n prefix: PREFIXES.NONE['']\n };\n newUnit.base = BASE_UNITS[baseName];\n }\n }\n Unit.UNITS[name] = newUnit;\n for (var _i8 = 0; _i8 < aliases.length; _i8++) {\n var aliasName = aliases[_i8];\n var _alias = {};\n for (var _key6 in newUnit) {\n if (hasOwnProperty(newUnit, _key6)) {\n _alias[_key6] = newUnit[_key6];\n }\n }\n _alias.name = aliasName;\n Unit.UNITS[aliasName] = _alias;\n }\n\n // delete the memoization cache because we created a new unit\n delete _findUnit.cache;\n return new Unit(null, name);\n };\n Unit.deleteUnit = function (name) {\n delete Unit.UNITS[name];\n\n // delete the memoization cache because we deleted a unit\n delete _findUnit.cache;\n };\n\n // expose arrays with prefixes, dimensions, units, systems\n Unit.PREFIXES = PREFIXES;\n Unit.BASE_DIMENSIONS = BASE_DIMENSIONS;\n Unit.BASE_UNITS = BASE_UNITS;\n Unit.UNIT_SYSTEMS = UNIT_SYSTEMS;\n Unit.UNITS = UNITS;\n return Unit;\n}, {\n isClass: true\n});", "import { memoize } from '../function.js';\n\n/**\n * Calculate BigNumber e\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns e\n */\nexport var createBigNumberE = memoize(function (BigNumber) {\n return new BigNumber(1).exp();\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber golden ratio, phi = (1+sqrt(5))/2\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns phi\n */\nexport var createBigNumberPhi = memoize(function (BigNumber) {\n return new BigNumber(1).plus(new BigNumber(5).sqrt()).div(2);\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber pi.\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns pi\n */\nexport var createBigNumberPi = memoize(function (BigNumber) {\n return BigNumber.acos(-1);\n}, {\n hasher\n});\n\n/**\n * Calculate BigNumber tau, tau = 2 * pi\n * @param {function} BigNumber BigNumber constructor\n * @returns {BigNumber} Returns tau\n */\nexport var createBigNumberTau = memoize(function (BigNumber) {\n return createBigNumberPi(BigNumber).times(2);\n}, {\n hasher\n});\n\n/**\n * Create a hash for a BigNumber constructor function. The created has is\n * the configured precision\n * @param {Array} args Supposed to contain a single entry with\n * a BigNumber constructor\n * @return {number} precision\n * @private\n */\nfunction hasher(args) {\n return args[0].precision;\n}", "import { factory } from '../../../utils/factory.js';\nimport { deepMap } from '../../../utils/collection.js';\nvar name = 'unit';\nvar dependencies = ['typed', 'Unit'];\n\n// This function is named createUnitFunction to prevent a naming conflict with createUnit\nexport var createUnitFunction = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Unit\n } = _ref;\n /**\n * Create a unit. Depending on the passed arguments, the function\n * will create and return a new math.Unit object.\n * When a matrix is provided, all elements will be converted to units.\n *\n * Syntax:\n *\n * math.unit(unit : string)\n * math.unit(value : number, valuelessUnit : Unit)\n * math.unit(value : number, valuelessUnit : string)\n *\n * Examples:\n *\n * const kph = math.unit('km/h') // returns Unit km/h (valueless)\n * const v = math.unit(25, kph) // returns Unit 25 km/h\n * const a = math.unit(5, 'cm') // returns Unit 50 mm\n * const b = math.unit('23 kg') // returns Unit 23 kg\n * a.to('m') // returns Unit 0.05 m\n *\n * See also:\n *\n * bignumber, boolean, complex, index, matrix, number, string, createUnit\n *\n * @param {* | Array | Matrix} args A number and unit.\n * @return {Unit | Array | Matrix} The created unit\n */\n\n return typed(name, {\n Unit: function Unit(x) {\n return x.clone();\n },\n string: function string(x) {\n if (Unit.isValuelessUnit(x)) {\n return new Unit(null, x); // a pure unit\n }\n return Unit.parse(x, {\n allowNoUnits: true\n }); // a unit with value, like '5cm'\n },\n 'number | BigNumber | Fraction | Complex, string | Unit': function numberBigNumberFractionComplexStringUnit(value, unit) {\n return new Unit(value, unit);\n },\n 'number | BigNumber | Fraction': function numberBigNumberFraction(value) {\n // dimensionless\n return new Unit(value);\n },\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'sparse';\nvar dependencies = ['typed', 'SparseMatrix'];\nexport var createSparse = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n SparseMatrix\n } = _ref;\n /**\n * Create a Sparse Matrix. The function creates a new `math.Matrix` object from\n * an `Array`. A Matrix has utility functions to manipulate the data in the\n * matrix, like getting the size and getting or setting values in the matrix.\n * Note that a Sparse Matrix is always 2-dimensional, so for example if\n * you create one from a plain array of _n_ numbers, you get an _n_ by 1\n * Sparse \"column vector\".\n *\n * Syntax:\n *\n * math.sparse() // creates an empty sparse matrix.\n * math.sparse(data) // creates a sparse matrix with initial data.\n * math.sparse(data, 'number') // creates a sparse matrix with initial data, number datatype.\n *\n * Examples:\n *\n * let m = math.sparse([[1, 2], [3, 4]])\n * m.size() // Array [2, 2]\n * m.resize([3, 2], 5)\n * m.valueOf() // Array [[1, 2], [3, 4], [5, 5]]\n * m.get([1, 0]) // number 3\n * let v = math.sparse([0, 0, 1])\n * v.size() // Array [3, 1]\n * v.get([2, 0]) // number 1\n *\n * See also:\n *\n * bignumber, boolean, complex, index, number, string, unit, matrix\n *\n * @param {Array | Matrix} [data] A two dimensional array\n *\n * @return {Matrix} The created matrix\n */\n return typed(name, {\n '': function _() {\n return new SparseMatrix([]);\n },\n string: function string(datatype) {\n return new SparseMatrix([], datatype);\n },\n 'Array | Matrix': function ArrayMatrix(data) {\n return new SparseMatrix(data);\n },\n 'Array | Matrix, string': function ArrayMatrixString(data, datatype) {\n return new SparseMatrix(data, datatype);\n }\n });\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'createUnit';\nvar dependencies = ['typed', 'Unit'];\nexport var createCreateUnit = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Unit\n } = _ref;\n /**\n * Create a user-defined unit and register it with the Unit type.\n *\n * Syntax:\n *\n * math.createUnit({\n * baseUnit1: {\n * aliases: [string, ...]\n * prefixes: object\n * },\n * unit2: {\n * definition: string,\n * aliases: [string, ...]\n * prefixes: object,\n * offset: number\n * },\n * unit3: string // Shortcut\n * })\n *\n * // Another shortcut:\n * math.createUnit(string, unit : string, [object])\n *\n * Examples:\n *\n * math.createUnit('foo')\n * math.createUnit('knot', {definition: '0.514444444 m/s', aliases: ['knots', 'kt', 'kts']})\n * math.createUnit('mph', '1 mile/hour')\n * math.createUnit('km', math.unit(1000, 'm'))\n *\n * @param {string} name The name of the new unit. Must be unique. Example: 'knot'\n * @param {string, UnitDefinition, Unit} definition Definition of the unit in terms of existing units. For example, '0.514444444 m / s'.\n * @param {Object} options (optional) An object containing any of the following properties:\n * - `prefixes {string}` \"none\", \"short\", \"long\", \"binary_short\", or \"binary_long\". The default is \"none\".\n * - `aliases {Array}` Array of strings. Example: ['knots', 'kt', 'kts']\n * - `offset {Numeric}` An offset to apply when converting from the unit. For example, the offset for celsius is 273.15. Default is 0.\n *\n * See also:\n *\n * unit\n *\n * @return {Unit} The new unit\n */\n return typed(name, {\n // General function signature. First parameter is an object where each property is the definition of a new unit. The object keys are the unit names and the values are the definitions. The values can be objects, strings, or Units. If a property is an empty object or an empty string, a new base unit is created. The second parameter is the options.\n 'Object, Object': function ObjectObject(obj, options) {\n return Unit.createUnit(obj, options);\n },\n // Same as above but without the options.\n Object: function Object(obj) {\n return Unit.createUnit(obj, {});\n },\n // Shortcut method for creating one unit.\n 'string, Unit | string | Object, Object': function stringUnitStringObjectObject(name, def, options) {\n var obj = {};\n obj[name] = def;\n return Unit.createUnit(obj, options);\n },\n // Same as above but without the options.\n 'string, Unit | string | Object': function stringUnitStringObject(name, def) {\n var obj = {};\n obj[name] = def;\n return Unit.createUnit(obj, {});\n },\n // Without a definition, creates a base unit.\n string: function string(name) {\n var obj = {};\n obj[name] = {};\n return Unit.createUnit(obj, {});\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'acos';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAcos = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the inverse cosine of a value.\n *\n * To avoid confusion with the matrix arccosine, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acos(x)\n *\n * Examples:\n *\n * math.acos(0.5) // returns number 1.0471975511965979\n * math.acos(math.cos(1.5)) // returns number 1.5\n *\n * math.acos(2) // returns Complex 0 + 1.3169578969248166 i\n *\n * See also:\n *\n * cos, atan, asin\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc cosine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 && x <= 1 || config.predictable) {\n return Math.acos(x);\n } else {\n return new Complex(x, 0).acos();\n }\n },\n Complex: function Complex(x) {\n return x.acos();\n },\n BigNumber: function BigNumber(x) {\n return x.acos();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acoshNumber } from '../../plain/number/index.js';\nvar name = 'acosh';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAcosh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the hyperbolic arccos of a value,\n * defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.acosh(x)\n *\n * Examples:\n *\n * math.acosh(1.5) // returns 0.9624236501192069\n *\n * See also:\n *\n * cosh, asinh, atanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccosine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 1 || config.predictable) {\n return acoshNumber(x);\n }\n if (x <= -1) {\n return new Complex(Math.log(Math.sqrt(x * x - 1) - x), Math.PI);\n }\n return new Complex(x, 0).acosh();\n },\n Complex: function Complex(x) {\n return x.acosh();\n },\n BigNumber: function BigNumber(x) {\n return x.acosh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acotNumber } from '../../plain/number/index.js';\nvar name = 'acot';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createAcot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse cotangent of a value, defined as `acot(x) = atan(1/x)`.\n *\n * To avoid confusion with the matrix arccotanget, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acot(x)\n *\n * Examples:\n *\n * math.acot(0.5) // returns number 1.1071487177940904\n * math.acot(2) // returns number 0.4636476090008061\n * math.acot(math.cot(1.5)) // returns number 1.5\n *\n * See also:\n *\n * cot, atan\n *\n * @param {number | BigNumber| Complex} x Function input\n * @return {number | BigNumber| Complex} The arc cotangent of x\n */\n return typed(name, {\n number: acotNumber,\n Complex: function Complex(x) {\n return x.acot();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).atan();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acothNumber } from '../../plain/number/index.js';\nvar name = 'acoth';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAcoth = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic arccotangent of a value,\n * defined as `acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.\n *\n * To avoid confusion with the matrix hyperbolic arccotangent, this\n * function does not apply to matrices.\n *\n * Syntax:\n *\n * math.acoth(x)\n *\n * Examples:\n *\n * math.acoth(0.5) // returns 0.8047189562170503\n *\n * See also:\n *\n * acsch, asech\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccotangent of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= 1 || x <= -1 || config.predictable) {\n return acothNumber(x);\n }\n return new Complex(x, 0).acoth();\n },\n Complex: function Complex(x) {\n return x.acoth();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).atanh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acscNumber } from '../../plain/number/index.js';\nvar name = 'acsc';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAcsc = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse cosecant of a value, defined as `acsc(x) = asin(1/x)`.\n *\n * To avoid confusion with the matrix arccosecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.acsc(x)\n *\n * Examples:\n *\n * math.acsc(2) // returns 0.5235987755982989\n * math.acsc(0.5) // returns Complex 1.5707963267948966 -1.3169578969248166i\n * math.acsc(math.csc(1.5)) // returns number ~1.5\n *\n * See also:\n *\n * csc, asin, asec\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc cosecant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= -1 || x >= 1 || config.predictable) {\n return acscNumber(x);\n }\n return new Complex(x, 0).acsc();\n },\n Complex: function Complex(x) {\n return x.acsc();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).asin();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { acschNumber } from '../../plain/number/index.js';\nvar name = 'acsch';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createAcsch = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic arccosecant of a value,\n * defined as `acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1))`.\n *\n * To avoid confusion with the matrix hyperbolic arccosecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.acsch(x)\n *\n * Examples:\n *\n * math.acsch(0.5) // returns 1.4436354751788103\n *\n * See also:\n *\n * asech, acoth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arccosecant of x\n */\n return typed(name, {\n number: acschNumber,\n Complex: function Complex(x) {\n return x.acsch();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).asinh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asecNumber } from '../../plain/number/index.js';\nvar name = 'asec';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAsec = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the inverse secant of a value. Defined as `asec(x) = acos(1/x)`.\n *\n * To avoid confusion with the matrix arcsecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.asec(x)\n *\n * Examples:\n *\n * math.asec(2) // returns 1.0471975511965979\n * math.asec(math.sec(1.5)) // returns 1.5\n *\n * math.asec(0.5) // returns Complex 0 + 1.3169578969248166i\n *\n * See also:\n *\n * acos, acot, acsc\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc secant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= -1 || x >= 1 || config.predictable) {\n return asecNumber(x);\n }\n return new Complex(x, 0).asec();\n },\n Complex: function Complex(x) {\n return x.asec();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).acos();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asechNumber } from '../../plain/number/index.js';\nvar name = 'asech';\nvar dependencies = ['typed', 'config', 'Complex', 'BigNumber'];\nexport var createAsech = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic arcsecant of a value,\n * defined as `asech(x) = acosh(1/x) = ln(sqrt(1/x^2 - 1) + 1/x)`.\n *\n * To avoid confusion with the matrix hyperbolic arcsecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.asech(x)\n *\n * Examples:\n *\n * math.asech(0.5) // returns 1.3169578969248166\n *\n * See also:\n *\n * acsch, acoth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arcsecant of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 1 && x >= -1 || config.predictable) {\n var xInv = 1 / x;\n if (xInv > 0 || config.predictable) {\n return asechNumber(x);\n }\n var ret = Math.sqrt(xInv * xInv - 1);\n return new Complex(Math.log(ret - xInv), Math.PI);\n }\n return new Complex(x, 0).asech();\n },\n Complex: function Complex(x) {\n return x.asech();\n },\n BigNumber: function BigNumber(x) {\n return new _BigNumber(1).div(x).acosh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'asin';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAsin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the inverse sine of a value.\n *\n * To avoid confusion with the matric arcsine, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.asin(x)\n *\n * Examples:\n *\n * math.asin(0.5) // returns number 0.5235987755982989\n * math.asin(math.sin(1.5)) // returns number ~1.5\n *\n * math.asin(2) // returns Complex 1.5707963267948966 -1.3169578969248166i\n *\n * See also:\n *\n * sin, atan, acos\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc sine of x\n */\n return typed(name, {\n number: function number(x) {\n if (x >= -1 && x <= 1 || config.predictable) {\n return Math.asin(x);\n } else {\n return new Complex(x, 0).asin();\n }\n },\n Complex: function Complex(x) {\n return x.asin();\n },\n BigNumber: function BigNumber(x) {\n return x.asin();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { asinhNumber } from '../../plain/number/index.js';\nvar name = 'asinh';\nvar dependencies = ['typed'];\nexport var createAsinh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic arcsine of a value,\n * defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.\n *\n * To avoid confusion with the matrix hyperbolic arcsine, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.asinh(x)\n *\n * Examples:\n *\n * math.asinh(0.5) // returns 0.48121182505960347\n *\n * See also:\n *\n * acosh, atanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arcsine of x\n */\n return typed('asinh', {\n number: asinhNumber,\n Complex: function Complex(x) {\n return x.asinh();\n },\n BigNumber: function BigNumber(x) {\n return x.asinh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'atan';\nvar dependencies = ['typed'];\nexport var createAtan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the inverse tangent of a value.\n *\n * To avoid confusion with matrix arctangent, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.atan(x)\n *\n * Examples:\n *\n * math.atan(0.5) // returns number 0.4636476090008061\n * math.atan(2) // returns number 1.1071487177940904\n * math.atan(math.tan(1.5)) // returns number 1.5\n *\n * See also:\n *\n * tan, asin, acos\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} The arc tangent of x\n */\n return typed('atan', {\n number: function number(x) {\n return Math.atan(x);\n },\n Complex: function Complex(x) {\n return x.atan();\n },\n BigNumber: function BigNumber(x) {\n return x.atan();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo02xDS0 } from '../../type/matrix/utils/matAlgo02xDS0.js';\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js';\nimport { createMatAlgo09xS0Sf } from '../../type/matrix/utils/matAlgo09xS0Sf.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'atan2';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'BigNumber', 'DenseMatrix', 'concat'];\nexport var createAtan2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n BigNumber,\n DenseMatrix,\n concat\n } = _ref;\n var matAlgo02xDS0 = createMatAlgo02xDS0({\n typed,\n equalScalar\n });\n var matAlgo03xDSf = createMatAlgo03xDSf({\n typed\n });\n var matAlgo09xS0Sf = createMatAlgo09xS0Sf({\n typed,\n equalScalar\n });\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo12xSfs = createMatAlgo12xSfs({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n\n /**\n * Calculate the inverse tangent function with two arguments, y/x.\n * By providing two arguments, the right quadrant of the computed angle can be\n * determined.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.atan2(y, x)\n *\n * Examples:\n *\n * math.atan2(2, 2) / math.pi // returns number 0.25\n *\n * const angle = math.unit(60, 'deg') // returns Unit 60 deg\n * const x = math.cos(angle)\n * const y = math.sin(angle)\n *\n * math.atan(2) // returns number 1.1071487177940904\n *\n * See also:\n *\n * tan, atan, sin, cos\n *\n * @param {number | Array | Matrix} y Second dimension\n * @param {number | Array | Matrix} x First dimension\n * @return {number | Array | Matrix} Four-quadrant inverse tangent\n */\n return typed(name, {\n 'number, number': Math.atan2,\n // Complex numbers doesn't seem to have a reasonable implementation of\n // atan2(). Even Matlab removed the support, after they only calculated\n // the atan only on base of the real part of the numbers and ignored\n // the imaginary.\n\n 'BigNumber, BigNumber': (y, x) => BigNumber.atan2(y, x)\n }, matrixAlgorithmSuite({\n scalar: 'number | BigNumber',\n SS: matAlgo09xS0Sf,\n DS: matAlgo03xDSf,\n SD: matAlgo02xDS0,\n Ss: matAlgo11xS0s,\n sS: matAlgo12xSfs\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { atanhNumber } from '../../plain/number/index.js';\nvar name = 'atanh';\nvar dependencies = ['typed', 'config', 'Complex'];\nexport var createAtanh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n Complex\n } = _ref;\n /**\n * Calculate the hyperbolic arctangent of a value,\n * defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.\n *\n * To avoid confusion with the matrix hyperbolic arctangent, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.atanh(x)\n *\n * Examples:\n *\n * math.atanh(0.5) // returns 0.5493061443340549\n *\n * See also:\n *\n * acosh, asinh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic arctangent of x\n */\n return typed(name, {\n number: function number(x) {\n if (x <= 1 && x >= -1 || config.predictable) {\n return atanhNumber(x);\n }\n return new Complex(x, 0).atanh();\n },\n Complex: function Complex(x) {\n return x.atanh();\n },\n BigNumber: function BigNumber(x) {\n return x.atanh();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'cos';\nvar dependencies = ['typed'];\nexport var createCos = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cosine of a value.\n *\n * To avoid confusion with the matrix cosine, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.cos(x)\n *\n * Examples:\n *\n * math.cos(2) // returns number -0.4161468365471422\n * math.cos(math.pi / 4) // returns number 0.7071067811865475\n * math.cos(math.unit(180, 'deg')) // returns number -1\n * math.cos(math.unit(60, 'deg')) // returns number 0.5\n *\n * const angle = 0.2\n * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1\n *\n * See also:\n *\n * cos, tan\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Cosine of x\n */\n return typed(name, {\n number: Math.cos,\n 'Complex | BigNumber': x => x.cos()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nexport var createTrigUnit = /* #__PURE__ */factory('trigUnit', ['typed'], _ref => {\n var {\n typed\n } = _ref;\n return {\n Unit: typed.referToSelf(self => x => {\n if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) {\n throw new TypeError('Unit in function cot is no angle');\n }\n return typed.find(self, x.valueType())(x.value);\n })\n };\n});", "import { factory } from '../../utils/factory.js';\nimport { cosh as coshNumber } from '../../utils/number.js';\nvar name = 'cosh';\nvar dependencies = ['typed'];\nexport var createCosh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic cosine of a value,\n * defined as `cosh(x) = 1/2 * (exp(x) + exp(-x))`.\n *\n * To avoid confusion with the matrix hyperbolic cosine, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.cosh(x)\n *\n * Examples:\n *\n * math.cosh(0.5) // returns number 1.1276259652063807\n *\n * See also:\n *\n * sinh, tanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cosine of x\n */\n return typed(name, {\n number: coshNumber,\n 'Complex | BigNumber': x => x.cosh()\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { cotNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'cot';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cotangent of a value. Defined as `cot(x) = 1 / tan(x)`.\n *\n * To avoid confusion with the matrix cotangent, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.cot(x)\n *\n * Examples:\n *\n * math.cot(2) // returns number -0.45765755436028577\n * 1 / math.tan(2) // returns number -0.45765755436028577\n *\n * See also:\n *\n * tan, sec, csc\n *\n * @param {number | Complex | Unit | Array | Matrix} x Function input\n * @return {number | Complex | Array | Matrix} Cotangent of x\n */\n return typed(name, {\n number: cotNumber,\n Complex: x => x.cot(),\n BigNumber: x => new _BigNumber(1).div(x.tan())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { cothNumber } from '../../plain/number/index.js';\nvar name = 'coth';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCoth = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic cotangent of a value,\n * defined as `coth(x) = 1 / tanh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic cotangent, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.coth(x)\n *\n * Examples:\n *\n * // coth(x) = 1 / tanh(x)\n * math.coth(2) // returns 1.0373147207275482\n * 1 / math.tanh(2) // returns 1.0373147207275482\n *\n * See also:\n *\n * sinh, tanh, cosh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cotangent of x\n */\n return typed(name, {\n number: cothNumber,\n Complex: x => x.coth(),\n BigNumber: x => new _BigNumber(1).div(x.tanh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { cscNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'csc';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCsc = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the cosecant of a value, defined as `csc(x) = 1/sin(x)`.\n *\n * To avoid confusion with the matrix cosecant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.csc(x)\n *\n * Examples:\n *\n * math.csc(2) // returns number 1.099750170294617\n * 1 / math.sin(2) // returns number 1.099750170294617\n *\n * See also:\n *\n * sin, sec, cot\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Cosecant of x\n */\n return typed(name, {\n number: cscNumber,\n Complex: x => x.csc(),\n BigNumber: x => new _BigNumber(1).div(x.sin())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { cschNumber } from '../../plain/number/index.js';\nvar name = 'csch';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createCsch = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic cosecant of a value,\n * defined as `csch(x) = 1 / sinh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic cosecant, this function\n * does not apply to matrices.\n *\n * Syntax:\n *\n * math.csch(x)\n *\n * Examples:\n *\n * // csch(x) = 1/ sinh(x)\n * math.csch(0.5) // returns 1.9190347513349437\n * 1 / math.sinh(0.5) // returns 1.9190347513349437\n *\n * See also:\n *\n * sinh, sech, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic cosecant of x\n */\n return typed(name, {\n number: cschNumber,\n Complex: x => x.csch(),\n BigNumber: x => new _BigNumber(1).div(x.sinh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { secNumber } from '../../plain/number/index.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'sec';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createSec = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the secant of a value, defined as `sec(x) = 1/cos(x)`.\n *\n * To avoid confusion with the matrix secant, this function does not\n * apply to matrices.\n *\n * Syntax:\n *\n * math.sec(x)\n *\n * Examples:\n *\n * math.sec(2) // returns number -2.4029979617223822\n * 1 / math.cos(2) // returns number -2.4029979617223822\n *\n * See also:\n *\n * cos, csc, cot\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Secant of x\n */\n return typed(name, {\n number: secNumber,\n Complex: x => x.sec(),\n BigNumber: x => new _BigNumber(1).div(x.cos())\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { sechNumber } from '../../plain/number/index.js';\nvar name = 'sech';\nvar dependencies = ['typed', 'BigNumber'];\nexport var createSech = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n BigNumber: _BigNumber\n } = _ref;\n /**\n * Calculate the hyperbolic secant of a value,\n * defined as `sech(x) = 1 / cosh(x)`.\n *\n * To avoid confusion with the matrix hyperbolic secant, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.sech(x)\n *\n * Examples:\n *\n * // sech(x) = 1/ cosh(x)\n * math.sech(0.5) // returns 0.886818883970074\n * 1 / math.cosh(0.5) // returns 0.886818883970074\n *\n * See also:\n *\n * cosh, csch, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic secant of x\n */\n return typed(name, {\n number: sechNumber,\n Complex: x => x.sech(),\n BigNumber: x => new _BigNumber(1).div(x.cosh())\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'sin';\nvar dependencies = ['typed'];\nexport var createSin = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the sine of a value.\n *\n * To avoid confusion with the matrix sine, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.sin(x)\n *\n * Examples:\n *\n * math.sin(2) // returns number 0.9092974268256813\n * math.sin(math.pi / 4) // returns number 0.7071067811865475\n * math.sin(math.unit(90, 'deg')) // returns number 1\n * math.sin(math.unit(30, 'deg')) // returns number 0.5\n *\n * const angle = 0.2\n * math.pow(math.sin(angle), 2) + math.pow(math.cos(angle), 2) // returns number ~1\n *\n * See also:\n *\n * cos, tan\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Sine of x\n */\n return typed(name, {\n number: Math.sin,\n 'Complex | BigNumber': x => x.sin()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { sinhNumber } from '../../plain/number/index.js';\nvar name = 'sinh';\nvar dependencies = ['typed'];\nexport var createSinh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic sine of a value,\n * defined as `sinh(x) = 1/2 * (exp(x) - exp(-x))`.\n *\n * To avoid confusion with the matrix hyperbolic sine, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.sinh(x)\n *\n * Examples:\n *\n * math.sinh(0.5) // returns number 0.5210953054937474\n *\n * See also:\n *\n * cosh, tanh\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic sine of x\n */\n return typed(name, {\n number: sinhNumber,\n 'Complex | BigNumber': x => x.sinh()\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createTrigUnit } from './trigUnit.js';\nvar name = 'tan';\nvar dependencies = ['typed'];\nexport var createTan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n var trigUnit = createTrigUnit({\n typed\n });\n\n /**\n * Calculate the tangent of a value. `tan(x)` is equal to `sin(x) / cos(x)`.\n *\n * To avoid confusion with the matrix tangent, this function does not apply\n * to matrices.\n *\n * Syntax:\n *\n * math.tan(x)\n *\n * Examples:\n *\n * math.tan(0.5) // returns number 0.5463024898437905\n * math.sin(0.5) / math.cos(0.5) // returns number 0.5463024898437905\n * math.tan(math.pi / 4) // returns number 1\n * math.tan(math.unit(45, 'deg')) // returns number 1\n *\n * See also:\n *\n * atan, sin, cos\n *\n * @param {number | BigNumber | Complex | Unit} x Function input\n * @return {number | BigNumber | Complex} Tangent of x\n */\n return typed(name, {\n number: Math.tan,\n 'Complex | BigNumber': x => x.tan()\n }, trigUnit);\n});", "import { factory } from '../../utils/factory.js';\nimport { tanh as _tanh } from '../../utils/number.js';\nvar name = 'tanh';\nvar dependencies = ['typed'];\nexport var createTanh = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Calculate the hyperbolic tangent of a value,\n * defined as `tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1)`.\n *\n * To avoid confusion with matrix hyperbolic tangent, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.tanh(x)\n *\n * Examples:\n *\n * // tanh(x) = sinh(x) / cosh(x) = 1 / coth(x)\n * math.tanh(0.5) // returns 0.46211715726000974\n * math.sinh(0.5) / math.cosh(0.5) // returns 0.46211715726000974\n * 1 / math.coth(0.5) // returns 0.46211715726000974\n *\n * See also:\n *\n * sinh, cosh, coth\n *\n * @param {number | BigNumber | Complex} x Function input\n * @return {number | BigNumber | Complex} Hyperbolic tangent of x\n */\n return typed('tanh', {\n number: _tanh,\n 'Complex | BigNumber': x => x.tanh()\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setCartesian';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetCartesian = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the cartesian product of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays\n * and the values will be sorted in ascending order before the operation.\n *\n * Syntax:\n *\n * math.setCartesian(set1, set2)\n *\n * Examples:\n *\n * math.setCartesian([1, 2], [3, 4]) // returns [[1, 3], [1, 4], [2, 3], [2, 4]]\n * math.setCartesian([4, 3], [2, 1]) // returns [[3, 1], [3, 2], [4, 1], [4, 2]]\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference, setPowerset\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The cartesian product of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n var result = [];\n if (subset(size(a1), new Index(0)) !== 0 && subset(size(a2), new Index(0)) !== 0) {\n // if any of them is empty, return empty\n var b1 = flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural);\n var b2 = flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural);\n result = [];\n for (var i = 0; i < b1.length; i++) {\n for (var j = 0; j < b2.length; j++) {\n result.push([b1[i], b2[j]]);\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return result;\n }\n // return a matrix otherwise\n return new DenseMatrix(result);\n }\n });\n});", "import { flatten, generalize, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setDifference';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetDifference = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the difference of two (multi)sets: every element of set1, that is not the element of set2.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setDifference(set1, set2)\n *\n * Examples:\n *\n * math.setDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2]\n * math.setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2]\n *\n * See also:\n *\n * setUnion, setIntersect, setSymDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The difference of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n var result;\n if (subset(size(a1), new Index(0)) === 0) {\n // empty-anything=empty\n result = [];\n } else if (subset(size(a2), new Index(0)) === 0) {\n // anything-empty=anything\n return flatten(a1.toArray());\n } else {\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n result = [];\n var inb2;\n for (var i = 0; i < b1.length; i++) {\n inb2 = false;\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n inb2 = true;\n break;\n }\n }\n if (!inb2) {\n result.push(b1[i]);\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return generalize(result);\n }\n // return a matrix otherwise\n return new DenseMatrix(generalize(result));\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setDistinct';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetDistinct = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Collect the distinct elements of a multiset.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setDistinct(set)\n *\n * Examples:\n *\n * math.setDistinct([1, 1, 1, 2, 2, 3]) // returns [1, 2, 3]\n *\n * See also:\n *\n * setMultiplicity\n *\n * @param {Array | Matrix} a A multiset\n * @return {Array | Matrix} A set containing the distinc elements of the multiset\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(a) {\n var result;\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return empty\n result = [];\n } else {\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n result = [];\n result.push(b[0]);\n for (var i = 1; i < b.length; i++) {\n if (compareNatural(b[i], b[i - 1]) !== 0) {\n result.push(b[i]);\n }\n }\n }\n // return an array, if the input was an array\n if (Array.isArray(a)) {\n return result;\n }\n // return a matrix otherwise\n return new DenseMatrix(result);\n }\n });\n});", "import { flatten, generalize, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setIntersect';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index', 'DenseMatrix'];\nexport var createSetIntersect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index,\n DenseMatrix\n } = _ref;\n /**\n * Create the intersection of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setIntersect(set1, set2)\n *\n * Examples:\n *\n * math.setIntersect([1, 2, 3, 4], [3, 4, 5, 6]) // returns [3, 4]\n * math.setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [3, 4]\n *\n * See also:\n *\n * setUnion, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The intersection of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n var result;\n if (subset(size(a1), new Index(0)) === 0 || subset(size(a2), new Index(0)) === 0) {\n // of any of them is empty, return empty\n result = [];\n } else {\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n result = [];\n for (var i = 0; i < b1.length; i++) {\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n result.push(b1[i]);\n break;\n }\n }\n }\n }\n // return an array, if both inputs were arrays\n if (Array.isArray(a1) && Array.isArray(a2)) {\n return generalize(result);\n }\n // return a matrix otherwise\n return new DenseMatrix(generalize(result));\n }\n });\n});", "import { flatten, identify } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setIsSubset';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetIsSubset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Check whether a (multi)set is a subset of another (multi)set. (Every element of set1 is the element of set2.)\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setIsSubset(set1, set2)\n *\n * Examples:\n *\n * math.setIsSubset([1, 2], [3, 4, 5, 6]) // returns false\n * math.setIsSubset([3, 4], [3, 4, 5, 6]) // returns true\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {boolean} Returns true when a1 is a subset of a2, returns false otherwise\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // empty is a subset of anything\n return true;\n } else if (subset(size(a2), new Index(0)) === 0) {\n // anything is not a subset of empty\n return false;\n }\n var b1 = identify(flatten(Array.isArray(a1) ? a1 : a1.toArray()).sort(compareNatural));\n var b2 = identify(flatten(Array.isArray(a2) ? a2 : a2.toArray()).sort(compareNatural));\n var inb2;\n for (var i = 0; i < b1.length; i++) {\n inb2 = false;\n for (var j = 0; j < b2.length; j++) {\n if (compareNatural(b1[i].value, b2[j].value) === 0 && b1[i].identifier === b2[j].identifier) {\n // the identifier is always a decimal int\n inb2 = true;\n break;\n }\n }\n if (inb2 === false) {\n return false;\n }\n }\n return true;\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setMultiplicity';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetMultiplicity = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Count the multiplicity of an element in a multiset.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setMultiplicity(element, set)\n *\n * Examples:\n *\n * math.setMultiplicity(1, [1, 2, 2, 4]) // returns 1\n * math.setMultiplicity(2, [1, 2, 2, 4]) // returns 2\n *\n * See also:\n *\n * setDistinct, setSize\n *\n * @param {number | BigNumber | Fraction | Complex} e An element in the multiset\n * @param {Array | Matrix} a A multiset\n * @return {number} The number of how many times the multiset contains the element\n */\n return typed(name, {\n 'number | BigNumber | Fraction | Complex, Array | Matrix': function numberBigNumberFractionComplexArrayMatrix(e, a) {\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return 0\n return 0;\n }\n var b = flatten(Array.isArray(a) ? a : a.toArray());\n var count = 0;\n for (var i = 0; i < b.length; i++) {\n if (compareNatural(b[i], e) === 0) {\n count++;\n }\n }\n return count;\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setPowerset';\nvar dependencies = ['typed', 'size', 'subset', 'compareNatural', 'Index'];\nexport var createSetPowerset = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n subset,\n compareNatural,\n Index\n } = _ref;\n /**\n * Create the powerset of a (multi)set. (The powerset contains very possible subsets of a (multi)set.)\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setPowerset(set)\n *\n * Examples:\n *\n * math.setPowerset([1, 2, 3]) // returns [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]\n *\n * See also:\n *\n * setCartesian\n *\n * @param {Array | Matrix} a A (multi)set\n * @return {Array} The powerset of the (multi)set\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(a) {\n if (subset(size(a), new Index(0)) === 0) {\n // if empty, return empty\n return [];\n }\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n var result = [];\n var number = 0;\n while (number.toString(2).length <= b.length) {\n result.push(_subset(b, number.toString(2).split('').reverse()));\n number++;\n }\n // can not return a matrix, because of the different size of the subarrays\n return _sort(result);\n }\n });\n\n // create subset\n function _subset(array, bitarray) {\n var result = [];\n for (var i = 0; i < bitarray.length; i++) {\n if (bitarray[i] === '1') {\n result.push(array[i]);\n }\n }\n return result;\n }\n\n // sort subsests by length\n function _sort(array) {\n var temp = [];\n for (var i = array.length - 1; i > 0; i--) {\n for (var j = 0; j < i; j++) {\n if (array[j].length > array[j + 1].length) {\n temp = array[j];\n array[j] = array[j + 1];\n array[j + 1] = temp;\n }\n }\n }\n return array;\n }\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setSize';\nvar dependencies = ['typed', 'compareNatural'];\nexport var createSetSize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n compareNatural\n } = _ref;\n /**\n * Count the number of elements of a (multi)set. When a second parameter is 'true', count only the unique values.\n * A multi-dimension array will be converted to a single-dimension array before the operation.\n *\n * Syntax:\n *\n * math.setSize(set)\n * math.setSize(set, unique)\n *\n * Examples:\n *\n * math.setSize([1, 2, 2, 4]) // returns 4\n * math.setSize([1, 2, 2, 4], true) // returns 3\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a A multiset\n * @param {boolean} [unique] If true, only the unique values are counted. False by default\n * @return {number} The number of elements of the (multi)set\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(a) {\n return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;\n },\n 'Array | Matrix, boolean': function ArrayMatrixBoolean(a, unique) {\n if (unique === false || a.length === 0) {\n return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;\n } else {\n var b = flatten(Array.isArray(a) ? a : a.toArray()).sort(compareNatural);\n var count = 1;\n for (var i = 1; i < b.length; i++) {\n if (compareNatural(b[i], b[i - 1]) !== 0) {\n count++;\n }\n }\n return count;\n }\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setSymDifference';\nvar dependencies = ['typed', 'size', 'concat', 'subset', 'setDifference', 'Index'];\nexport var createSetSymDifference = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n concat,\n subset,\n setDifference,\n Index\n } = _ref;\n /**\n * Create the symmetric difference of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setSymDifference(set1, set2)\n *\n * Examples:\n *\n * math.setSymDifference([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 5, 6]\n * math.setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 5, 6]\n *\n * See also:\n *\n * setUnion, setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The symmetric difference of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // if any of them is empty, return the other one\n return flatten(a2);\n } else if (subset(size(a2), new Index(0)) === 0) {\n return flatten(a1);\n }\n var b1 = flatten(a1);\n var b2 = flatten(a2);\n return concat(setDifference(b1, b2), setDifference(b2, b1));\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'setUnion';\nvar dependencies = ['typed', 'size', 'concat', 'subset', 'setIntersect', 'setSymDifference', 'Index'];\nexport var createSetUnion = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n size,\n concat,\n subset,\n setIntersect,\n setSymDifference,\n Index\n } = _ref;\n /**\n * Create the union of two (multi)sets.\n * Multi-dimension arrays will be converted to single-dimension arrays before the operation.\n *\n * Syntax:\n *\n * math.setUnion(set1, set2)\n *\n * Examples:\n *\n * math.setUnion([1, 2, 3, 4], [3, 4, 5, 6]) // returns [1, 2, 3, 4, 5, 6]\n * math.setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [1, 2, 3, 4, 5, 6]\n *\n * See also:\n *\n * setIntersect, setDifference\n *\n * @param {Array | Matrix} a1 A (multi)set\n * @param {Array | Matrix} a2 A (multi)set\n * @return {Array | Matrix} The union of two (multi)sets\n */\n return typed(name, {\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(a1, a2) {\n if (subset(size(a1), new Index(0)) === 0) {\n // if any of them is empty, return the other one\n return flatten(a2);\n } else if (subset(size(a2), new Index(0)) === 0) {\n return flatten(a1);\n }\n var b1 = flatten(a1);\n var b2 = flatten(a2);\n return concat(setSymDifference(b1, b2), setIntersect(b1, b2));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { createMatAlgo01xDSid } from '../../type/matrix/utils/matAlgo01xDSid.js';\nimport { createMatAlgo04xSidSid } from '../../type/matrix/utils/matAlgo04xSidSid.js';\nimport { createMatAlgo10xSids } from '../../type/matrix/utils/matAlgo10xSids.js';\nimport { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';\nvar name = 'add';\nvar dependencies = ['typed', 'matrix', 'addScalar', 'equalScalar', 'DenseMatrix', 'SparseMatrix', 'concat'];\nexport var createAdd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n addScalar,\n equalScalar,\n DenseMatrix,\n SparseMatrix,\n concat\n } = _ref;\n var matAlgo01xDSid = createMatAlgo01xDSid({\n typed\n });\n var matAlgo04xSidSid = createMatAlgo04xSidSid({\n typed,\n equalScalar\n });\n var matAlgo10xSids = createMatAlgo10xSids({\n typed,\n DenseMatrix\n });\n var matrixAlgorithmSuite = createMatrixAlgorithmSuite({\n typed,\n matrix,\n concat\n });\n /**\n * Add two or more values, `x + y`.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.add(x, y)\n * math.add(x, y, z, ...)\n *\n * Examples:\n *\n * math.add(2, 3) // returns number 5\n * math.add(2, 3, 4) // returns number 9\n *\n * const a = math.complex(2, 3)\n * const b = math.complex(-4, 1)\n * math.add(a, b) // returns Complex -2 + 4i\n *\n * math.add([1, 2, 3], 4) // returns Array [5, 6, 7]\n *\n * const c = math.unit('5 cm')\n * const d = math.unit('2.1 mm')\n * math.add(c, d) // returns Unit 52.1 mm\n *\n * math.add(\"2.3\", \"4\") // returns number 6.3\n *\n * See also:\n *\n * subtract, sum\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to add\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to add\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Sum of `x` and `y`\n */\n return typed(name, {\n 'any, any': addScalar,\n 'any, any, ...any': typed.referToSelf(self => (x, y, rest) => {\n var result = self(x, y);\n for (var i = 0; i < rest.length; i++) {\n result = self(result, rest[i]);\n }\n return result;\n })\n }, matrixAlgorithmSuite({\n elop: addScalar,\n DS: matAlgo01xDSid,\n SS: matAlgo04xSidSid,\n Ss: matAlgo10xSids\n }));\n});", "import { factory } from '../../utils/factory.js';\nimport { flatten } from '../../utils/array.js';\nimport { isComplex } from '../../utils/is.js';\nvar name = 'hypot';\nvar dependencies = ['typed', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'sqrt', 'smaller', 'isPositive'];\nexport var createHypot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n addScalar,\n divideScalar,\n multiplyScalar,\n sqrt,\n smaller,\n isPositive\n } = _ref;\n /**\n * Calculate the hypotenusa of a list with values. The hypotenusa is defined as:\n *\n * hypot(a, b, c, ...) = sqrt(a^2 + b^2 + c^2 + ...)\n *\n * For matrix input, the hypotenusa is calculated for all values in the matrix.\n *\n * Syntax:\n *\n * math.hypot(a, b, ...)\n * math.hypot([a, b, c, ...])\n *\n * Examples:\n *\n * math.hypot(3, 4) // 5\n * math.hypot(3, 4, 5) // 7.0710678118654755\n * math.hypot([3, 4, 5]) // 7.0710678118654755\n * math.hypot(-2) // 2\n *\n * See also:\n *\n * abs, norm\n *\n * @param {... number | BigNumber | Array | Matrix} args A list with numeric values or an Array or Matrix.\n * Matrix and Array input is flattened and returns a\n * single number for the whole matrix.\n * @return {number | BigNumber} Returns the hypothenusa of the input values.\n */\n return typed(name, {\n '... number | BigNumber': _hypot,\n Array: _hypot,\n Matrix: M => _hypot(flatten(M.toArray()))\n });\n\n /**\n * Calculate the hypotenusa for an Array with values\n * @param {Array.} args\n * @return {number | BigNumber} Returns the result\n * @private\n */\n function _hypot(args) {\n // code based on `hypot` from es6-shim:\n // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1619-L1633\n var result = 0;\n var largest = 0;\n for (var i = 0; i < args.length; i++) {\n if (isComplex(args[i])) {\n throw new TypeError('Unexpected type of argument to hypot');\n }\n var value = abs(args[i]);\n if (smaller(largest, value)) {\n result = multiplyScalar(result, multiplyScalar(divideScalar(largest, value), divideScalar(largest, value)));\n result = addScalar(result, 1);\n largest = value;\n } else {\n result = addScalar(result, isPositive(value) ? multiplyScalar(divideScalar(value, largest), divideScalar(value, largest)) : value);\n }\n }\n return multiplyScalar(largest, sqrt(result));\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'norm';\nvar dependencies = ['typed', 'abs', 'add', 'pow', 'conj', 'sqrt', 'multiply', 'equalScalar', 'larger', 'smaller', 'matrix', 'ctranspose', 'eigs'];\nexport var createNorm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n pow,\n conj,\n sqrt,\n multiply,\n equalScalar,\n larger,\n smaller,\n matrix,\n ctranspose,\n eigs\n } = _ref;\n /**\n * Calculate the norm of a number, vector or matrix.\n *\n * The second parameter p is optional. If not provided, it defaults to 2.\n *\n * Syntax:\n *\n * math.norm(x)\n * math.norm(x, p)\n *\n * Examples:\n *\n * math.abs(-3.5) // returns 3.5\n * math.norm(-3.5) // returns 3.5\n *\n * math.norm(math.complex(3, -4)) // returns 5\n *\n * math.norm([1, 2, -3], Infinity) // returns 3\n * math.norm([1, 2, -3], -Infinity) // returns 1\n *\n * math.norm([3, 4], 2) // returns 5\n *\n * math.norm([[1, 2], [3, 4]], 1) // returns 6\n * math.norm([[1, 2], [3, 4]], 'inf') // returns 7\n * math.norm([[1, 2], [3, 4]], 'fro') // returns 5.477225575051661\n *\n * See also:\n *\n * abs, hypot\n *\n * @param {number | BigNumber | Complex | Array | Matrix} x\n * Value for which to calculate the norm\n * @param {number | BigNumber | string} [p=2]\n * Vector space.\n * Supported numbers include Infinity and -Infinity.\n * Supported strings are: 'inf', '-inf', and 'fro' (The Frobenius norm)\n * @return {number | BigNumber} the p-norm\n */\n return typed(name, {\n number: Math.abs,\n Complex: function Complex(x) {\n return x.abs();\n },\n BigNumber: function BigNumber(x) {\n // norm(x) = abs(x)\n return x.abs();\n },\n boolean: function boolean(x) {\n // norm(x) = abs(x)\n return Math.abs(x);\n },\n Array: function Array(x) {\n return _norm(matrix(x), 2);\n },\n Matrix: function Matrix(x) {\n return _norm(x, 2);\n },\n 'Array, number | BigNumber | string': function ArrayNumberBigNumberString(x, p) {\n return _norm(matrix(x), p);\n },\n 'Matrix, number | BigNumber | string': function MatrixNumberBigNumberString(x, p) {\n return _norm(x, p);\n }\n });\n\n /**\n * Calculate the plus infinity norm for a vector\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNormPlusInfinity(x) {\n // norm(x, Infinity) = max(abs(x))\n var pinf = 0;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n var v = abs(value);\n if (larger(v, pinf)) {\n pinf = v;\n }\n }, true);\n return pinf;\n }\n\n /**\n * Calculate the minus infinity norm for a vector\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNormMinusInfinity(x) {\n // norm(x, -Infinity) = min(abs(x))\n var ninf;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n var v = abs(value);\n if (!ninf || smaller(v, ninf)) {\n ninf = v;\n }\n }, true);\n return ninf || 0;\n }\n\n /**\n * Calculate the norm for a vector\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _vectorNorm(x, p) {\n // check p\n if (p === Number.POSITIVE_INFINITY || p === 'inf') {\n return _vectorNormPlusInfinity(x);\n }\n if (p === Number.NEGATIVE_INFINITY || p === '-inf') {\n return _vectorNormMinusInfinity(x);\n }\n if (p === 'fro') {\n return _norm(x, 2);\n }\n if (typeof p === 'number' && !isNaN(p)) {\n // check p != 0\n if (!equalScalar(p, 0)) {\n // norm(x, p) = sum(abs(xi) ^ p) ^ 1/p\n var n = 0;\n // skip zeros since abs(0) === 0\n x.forEach(function (value) {\n n = add(pow(abs(value), p), n);\n }, true);\n return pow(n, 1 / p);\n }\n return Number.POSITIVE_INFINITY;\n }\n // invalid parameter value\n throw new Error('Unsupported parameter value');\n }\n\n /**\n * Calculate the Frobenius norm for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormFrobenius(x) {\n // norm(x) = sqrt(sum(diag(x'x)))\n var fro = 0;\n x.forEach(function (value, index) {\n fro = add(fro, multiply(value, conj(value)));\n });\n return abs(sqrt(fro));\n }\n\n /**\n * Calculate the norm L1 for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormOne(x) {\n // norm(x) = the largest column sum\n var c = [];\n // result\n var maxc = 0;\n // skip zeros since abs(0) == 0\n x.forEach(function (value, index) {\n var j = index[1];\n var cj = add(c[j] || 0, abs(value));\n if (larger(cj, maxc)) {\n maxc = cj;\n }\n c[j] = cj;\n }, true);\n return maxc;\n }\n\n /**\n * Calculate the norm L2 for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormTwo(x) {\n // norm(x) = sqrt( max eigenvalue of A*.A)\n var sizeX = x.size();\n if (sizeX[0] !== sizeX[1]) {\n throw new RangeError('Invalid matrix dimensions');\n }\n var tx = ctranspose(x);\n var squaredX = multiply(tx, x);\n var eigenVals = eigs(squaredX).values.toArray();\n var rho = eigenVals[eigenVals.length - 1];\n return abs(sqrt(rho));\n }\n\n /**\n * Calculate the infinity norm for a matrix\n * @param {Matrix} x\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNormInfinity(x) {\n // norm(x) = the largest row sum\n var r = [];\n // result\n var maxr = 0;\n // skip zeros since abs(0) == 0\n x.forEach(function (value, index) {\n var i = index[0];\n var ri = add(r[i] || 0, abs(value));\n if (larger(ri, maxr)) {\n maxr = ri;\n }\n r[i] = ri;\n }, true);\n return maxr;\n }\n\n /**\n * Calculate the norm for a 2D Matrix (M*N)\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _matrixNorm(x, p) {\n // check p\n if (p === 1) {\n return _matrixNormOne(x);\n }\n if (p === Number.POSITIVE_INFINITY || p === 'inf') {\n return _matrixNormInfinity(x);\n }\n if (p === 'fro') {\n return _matrixNormFrobenius(x);\n }\n if (p === 2) {\n return _matrixNormTwo(x);\n } // invalid parameter value\n\n throw new Error('Unsupported parameter value ' + p);\n }\n\n /**\n * Calculate the norm for an array\n * @param {Matrix} x\n * @param {number | string} p\n * @returns {number} Returns the norm\n * @private\n */\n function _norm(x, p) {\n // size\n var sizeX = x.size();\n\n // check if it is a vector\n if (sizeX.length === 1) {\n return _vectorNorm(x, p);\n }\n // MxN matrix\n if (sizeX.length === 2) {\n if (sizeX[0] && sizeX[1]) {\n return _matrixNorm(x, p);\n } else {\n throw new RangeError('Invalid matrix dimensions');\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'dot';\nvar dependencies = ['typed', 'addScalar', 'multiplyScalar', 'conj', 'size'];\nexport var createDot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n multiplyScalar,\n conj,\n size\n } = _ref;\n /**\n * Calculate the dot product of two vectors. The dot product of\n * `A = [a1, a2, ..., an]` and `B = [b1, b2, ..., bn]` is defined as:\n *\n * dot(A, B) = conj(a1) * b1 + conj(a2) * b2 + ... + conj(an) * bn\n *\n * Syntax:\n *\n * math.dot(x, y)\n *\n * Examples:\n *\n * math.dot([2, 4, 1], [2, 2, 3]) // returns number 15\n * math.multiply([2, 4, 1], [2, 2, 3]) // returns number 15\n *\n * See also:\n *\n * multiply, cross\n *\n * @param {Array | Matrix} x First vector\n * @param {Array | Matrix} y Second vector\n * @return {number} Returns the dot product of `x` and `y`\n */\n return typed(name, {\n 'Array | DenseMatrix, Array | DenseMatrix': _denseDot,\n 'SparseMatrix, SparseMatrix': _sparseDot\n });\n function _validateDim(x, y) {\n var xSize = _size(x);\n var ySize = _size(y);\n var xLen, yLen;\n if (xSize.length === 1) {\n xLen = xSize[0];\n } else if (xSize.length === 2 && xSize[1] === 1) {\n xLen = xSize[0];\n } else {\n throw new RangeError('Expected a column vector, instead got a matrix of size (' + xSize.join(', ') + ')');\n }\n if (ySize.length === 1) {\n yLen = ySize[0];\n } else if (ySize.length === 2 && ySize[1] === 1) {\n yLen = ySize[0];\n } else {\n throw new RangeError('Expected a column vector, instead got a matrix of size (' + ySize.join(', ') + ')');\n }\n if (xLen !== yLen) throw new RangeError('Vectors must have equal length (' + xLen + ' != ' + yLen + ')');\n if (xLen === 0) throw new RangeError('Cannot calculate the dot product of empty vectors');\n return xLen;\n }\n function _denseDot(a, b) {\n var N = _validateDim(a, b);\n var adata = isMatrix(a) ? a._data : a;\n var adt = isMatrix(a) ? a._datatype || a.getDataType() : undefined;\n var bdata = isMatrix(b) ? b._data : b;\n var bdt = isMatrix(b) ? b._datatype || b.getDataType() : undefined;\n\n // are these 2-dimensional column vectors? (as opposed to 1-dimensional vectors)\n var aIsColumn = _size(a).length === 2;\n var bIsColumn = _size(b).length === 2;\n var add = addScalar;\n var mul = multiplyScalar;\n\n // process data types\n if (adt && bdt && adt === bdt && typeof adt === 'string' && adt !== 'mixed') {\n var dt = adt;\n // find signatures that matches (dt, dt)\n add = typed.find(addScalar, [dt, dt]);\n mul = typed.find(multiplyScalar, [dt, dt]);\n }\n\n // both vectors 1-dimensional\n if (!aIsColumn && !bIsColumn) {\n var c = mul(conj(adata[0]), bdata[0]);\n for (var i = 1; i < N; i++) {\n c = add(c, mul(conj(adata[i]), bdata[i]));\n }\n return c;\n }\n\n // a is 1-dim, b is column\n if (!aIsColumn && bIsColumn) {\n var _c = mul(conj(adata[0]), bdata[0][0]);\n for (var _i = 1; _i < N; _i++) {\n _c = add(_c, mul(conj(adata[_i]), bdata[_i][0]));\n }\n return _c;\n }\n\n // a is column, b is 1-dim\n if (aIsColumn && !bIsColumn) {\n var _c2 = mul(conj(adata[0][0]), bdata[0]);\n for (var _i2 = 1; _i2 < N; _i2++) {\n _c2 = add(_c2, mul(conj(adata[_i2][0]), bdata[_i2]));\n }\n return _c2;\n }\n\n // both vectors are column\n if (aIsColumn && bIsColumn) {\n var _c3 = mul(conj(adata[0][0]), bdata[0][0]);\n for (var _i3 = 1; _i3 < N; _i3++) {\n _c3 = add(_c3, mul(conj(adata[_i3][0]), bdata[_i3][0]));\n }\n return _c3;\n }\n }\n function _sparseDot(x, y) {\n _validateDim(x, y);\n var xindex = x._index;\n var xvalues = x._values;\n var yindex = y._index;\n var yvalues = y._values;\n\n // TODO optimize add & mul using datatype\n var c = 0;\n var add = addScalar;\n var mul = multiplyScalar;\n var i = 0;\n var j = 0;\n while (i < xindex.length && j < yindex.length) {\n var I = xindex[i];\n var J = yindex[j];\n if (I < J) {\n i++;\n continue;\n }\n if (I > J) {\n j++;\n continue;\n }\n if (I === J) {\n c = add(c, mul(xvalues[i], yvalues[j]));\n i++;\n j++;\n }\n }\n return c;\n }\n\n // TODO remove this once #1771 is fixed\n function _size(x) {\n return isMatrix(x) ? x.size() : size(x);\n }\n});", "import { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'trace';\nvar dependencies = ['typed', 'matrix', 'add'];\nexport var createTrace = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n add\n } = _ref;\n /**\n * Calculate the trace of a matrix: the sum of the elements on the main\n * diagonal of a square matrix.\n *\n * Syntax:\n *\n * math.trace(x)\n *\n * Examples:\n *\n * math.trace([[1, 2], [3, 4]]) // returns 5\n *\n * const A = [\n * [1, 2, 3],\n * [-1, 2, 3],\n * [2, 0, 3]\n * ]\n * math.trace(A) // returns 6\n *\n * See also:\n *\n * diag\n *\n * @param {Array | Matrix} x A matrix\n *\n * @return {number} The trace of `x`\n */\n return typed('trace', {\n Array: function _arrayTrace(x) {\n // use dense matrix implementation\n return _denseTrace(matrix(x));\n },\n SparseMatrix: _sparseTrace,\n DenseMatrix: _denseTrace,\n any: clone\n });\n function _denseTrace(m) {\n // matrix size & data\n var size = m._size;\n var data = m._data;\n\n // process dimensions\n switch (size.length) {\n case 1:\n // vector\n if (size[0] === 1) {\n // return data[0]\n return clone(data[0]);\n }\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n case 2:\n {\n // two dimensional\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n // calulate sum\n var sum = 0;\n // loop diagonal\n for (var i = 0; i < rows; i++) {\n sum = add(sum, data[i][i]);\n }\n // return trace\n return sum;\n } else {\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional\n throw new RangeError('Matrix must be two dimensional (size: ' + format(size) + ')');\n }\n }\n function _sparseTrace(m) {\n // matrix arrays\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n var size = m._size;\n // check dimensions\n var rows = size[0];\n var columns = size[1];\n // matrix must be square\n if (rows === columns) {\n // calulate sum\n var sum = 0;\n // check we have data (avoid looping columns)\n if (values.length > 0) {\n // loop columns\n for (var j = 0; j < columns; j++) {\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // loop k within [k0, k1[\n for (var k = k0; k < k1; k++) {\n // row index\n var i = index[k];\n // check row\n if (i === j) {\n // accumulate value\n sum = add(sum, values[k]);\n // exit loop\n break;\n }\n if (i > j) {\n // exit loop, no value on the diagonal for column j\n break;\n }\n }\n }\n }\n // return trace\n return sum;\n }\n throw new RangeError('Matrix must be square (size: ' + format(size) + ')');\n }\n});", "import { isBigNumber, isMatrix, isArray } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'index';\nvar dependencies = ['typed', 'Index'];\nexport var createIndex = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index\n } = _ref;\n /**\n * Create an index. An Index can store ranges having start, step, and end\n * for multiple dimensions.\n * Matrix.get, Matrix.set, and math.subset accept an Index as input.\n *\n * Syntax:\n *\n * math.index(range1, range2, ...)\n *\n * Where each range can be any of:\n *\n * - A number\n * - A string for getting/setting an object property\n * - An instance of `Range`\n * - A one-dimensional Array or a Matrix with numbers or booleans\n *\n * Indexes must be zero-based, integer numbers.\n *\n * Examples:\n *\n * const b = [1, 2, 3, 4, 5]\n * math.subset(b, math.index([1, 2, 3])) // returns [2, 3, 4]\n * math.subset(b, math.index([false, true, true, true, false])) // returns [2, 3, 4]\n *\n * const a = math.matrix([[1, 2], [3, 4]])\n * a.subset(math.index(0, 1)) // returns 2\n * a.subset(math.index(0, [false, true])) // returns 2\n *\n * See also:\n *\n * bignumber, boolean, complex, matrix, number, string, unit\n *\n * @param {...*} ranges Zero or more ranges or numbers.\n * @return {Index} Returns the created index\n */\n return typed(name, {\n '...number | string | BigNumber | Range | Array | Matrix': function numberStringBigNumberRangeArrayMatrix(args) {\n var ranges = args.map(function (arg) {\n if (isBigNumber(arg)) {\n return arg.toNumber(); // convert BigNumber to Number\n } else if (isArray(arg) || isMatrix(arg)) {\n return arg.map(function (elem) {\n // convert BigNumber to Number\n return isBigNumber(elem) ? elem.toNumber() : elem;\n });\n } else {\n return arg;\n }\n });\n var res = new Index();\n Index.apply(res, ranges);\n return res;\n }\n });\n});", "import { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { deepStrictEqual } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMap } from '../../utils/map.js';\nvar name = 'Node';\nvar dependencies = ['mathWithTransform'];\nexport var createNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n mathWithTransform\n } = _ref;\n /**\n * Validate the symbol names of a scope.\n * Throws an error when the scope contains an illegal symbol.\n * @param {Object} scope\n */\n function _validateScope(scope) {\n for (var symbol of [...keywords]) {\n if (scope.has(symbol)) {\n throw new Error('Scope contains an illegal symbol, \"' + symbol + '\" is a reserved keyword');\n }\n }\n }\n class Node {\n get type() {\n return 'Node';\n }\n get isNode() {\n return true;\n }\n\n /**\n * Evaluate the node\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} Returns the result\n */\n evaluate(scope) {\n return this.compile().evaluate(scope);\n }\n\n /**\n * Compile the node into an optimized, evauatable JavaScript function\n * @return {{evaluate: function([Object])}} object\n * Returns an object with a function 'evaluate',\n * which can be invoked as expr.evaluate([scope: Object]),\n * where scope is an optional object with\n * variables.\n */\n compile() {\n var expr = this._compile(mathWithTransform, {});\n var args = {};\n var context = null;\n function evaluate(scope) {\n var s = createMap(scope);\n _validateScope(s);\n return expr(s, args, context);\n }\n return {\n evaluate\n };\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n throw new Error('Method _compile must be implemented by type ' + this.type);\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run forEach on a Node interface');\n }\n\n /**\n * Create a new Node whose children are the results of calling the\n * provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run map on a Node interface');\n }\n\n /**\n * Validate whether an object is a Node, for use with map\n * @param {Node} node\n * @returns {Node} Returns the input if it's a node, else throws an Error\n * @protected\n */\n _ifNode(node) {\n if (!isNode(node)) {\n throw new TypeError('Callback function must return a Node');\n }\n return node;\n }\n\n /**\n * Recursively traverse all nodes in a node tree. Executes given callback for\n * this node and each of its child nodes.\n * @param {function(node: Node, path: string, parent: Node)} callback\n * A callback called for every node in the node tree.\n */\n traverse(callback) {\n // execute callback for itself\n // eslint-disable-next-line\n callback(this, null, null);\n\n // recursively traverse over all children of a node\n function _traverse(node, callback) {\n node.forEach(function (child, path, parent) {\n callback(child, path, parent);\n _traverse(child, callback);\n });\n }\n _traverse(this, callback);\n }\n\n /**\n * Recursively transform a node tree via a transform function.\n *\n * For example, to replace all nodes of type SymbolNode having name 'x' with\n * a ConstantNode with value 2:\n *\n * const res = Node.transform(function (node, path, parent) {\n * if (node && node.isSymbolNode) && (node.name === 'x')) {\n * return new ConstantNode(2)\n * }\n * else {\n * return node\n * }\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A mapping function accepting a node, and returning\n * a replacement for the node or the original node. The \"signature\"\n * of the callback must be:\n * callback(node: Node, index: string, parent: Node) : Node\n * @return {Node} Returns the original node or its replacement\n */\n transform(callback) {\n function _transform(child, path, parent) {\n var replacement = callback(child, path, parent);\n if (replacement !== child) {\n // stop iterating when the node is replaced\n return replacement;\n }\n return child.map(_transform);\n }\n return _transform(this, null, null);\n }\n\n /**\n * Find any node in the node tree matching given filter function. For\n * example, to find all nodes of type SymbolNode having name 'x':\n *\n * const results = Node.filter(function (node) {\n * return (node && node.isSymbolNode) && (node.name === 'x')\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A test function returning true when a node matches, and false\n * otherwise. Function signature:\n * callback(node: Node, index: string, parent: Node) : boolean\n * @return {Node[]} nodes\n * An array with nodes matching given filter criteria\n */\n filter(callback) {\n var nodes = [];\n this.traverse(function (node, path, parent) {\n if (callback(node, path, parent)) {\n nodes.push(node);\n }\n });\n return nodes;\n }\n\n /**\n * Create a shallow clone of this node\n * @return {Node}\n */\n clone() {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot clone a Node interface');\n }\n\n /**\n * Create a deep clone of this node\n * @return {Node}\n */\n cloneDeep() {\n return this.map(function (node) {\n return node.cloneDeep();\n });\n }\n\n /**\n * Deep compare this node with another node.\n * @param {Node} other\n * @return {boolean} Returns true when both nodes are of the same type and\n * contain the same values (as do their childs)\n */\n equals(other) {\n return other ? this.type === other.type && deepStrictEqual(this, other) : false;\n }\n\n /**\n * Get string representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toString(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toString(options);\n }\n\n /**\n * Internal function to generate the string output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toString() {\n // must be implemented by each of the Node implementations\n throw new Error('_toString not implemented for ' + this.type);\n }\n\n /**\n * Get a JSON representation of the node\n * Both .toJSON() and the static .fromJSON(json) should be implemented by all\n * implementations of Node\n * @returns {Object}\n */\n toJSON() {\n throw new Error('Cannot serialize object: toJSON not implemented by ' + this.type);\n }\n\n /**\n * Get HTML representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\" or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toHTML(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toHTML(options);\n }\n\n /**\n * Internal function to generate the HTML output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toHTML() {\n // must be implemented by each of the Node implementations\n throw new Error('_toHTML not implemented for ' + this.type);\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toTex(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toTex(options);\n }\n\n /**\n * Internal function to generate the LaTeX output.\n * This has to be implemented by every Node\n *\n * @param {Object} [options]\n * @throws {Error}\n */\n _toTex(options) {\n // must be implemented by each of the Node implementations\n throw new Error('_toTex not implemented for ' + this.type);\n }\n\n /**\n * Helper used by `to...` functions.\n */\n _getCustomString(options) {\n if (options && typeof options === 'object') {\n switch (typeof options.handler) {\n case 'object':\n case 'undefined':\n return;\n case 'function':\n return options.handler(this, options);\n default:\n throw new TypeError('Object or function expected as callback');\n }\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type;\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} node\n **/\n getContent() {\n return this;\n }\n }\n return Node;\n}, {\n isClass: true,\n isNode: true\n});", "// Reserved keywords not allowed to use in the parser\nexport var keywords = new Set(['end']);", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isNode, isObjectNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nvar name = 'AccessorNode';\nvar dependencies = ['subset', 'Node'];\nexport var createAccessorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n\n /**\n * Are parenthesis needed?\n * @private\n */\n function needParenthesis(node) {\n // TODO: maybe make a method on the nodes which tells whether they need parenthesis?\n return !(isAccessorNode(node) || isArrayNode(node) || isConstantNode(node) || isFunctionNode(node) || isObjectNode(node) || isParenthesisNode(node) || isSymbolNode(node));\n }\n class AccessorNode extends Node {\n /**\n * @constructor AccessorNode\n * @extends {Node}\n * Access an object property or get a matrix subset\n *\n * @param {Node} object The object from which to retrieve\n * a property or subset.\n * @param {IndexNode} index IndexNode containing ranges\n */\n constructor(object, index) {\n super();\n if (!isNode(object)) {\n throw new TypeError('Node expected for parameter \"object\"');\n }\n if (!isIndexNode(index)) {\n throw new TypeError('IndexNode expected for parameter \"index\"');\n }\n this.object = object;\n this.index = index;\n }\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAccessorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index._compile(math, argNames);\n if (this.index.isObjectProperty()) {\n var prop = this.index.getObjectProperty();\n return function evalAccessorNode(scope, args, context) {\n // get a property from an object evaluated using the scope.\n return getSafeProperty(evalObject(scope, args, context), prop);\n };\n } else {\n return function evalAccessorNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n // we pass just object here instead of context:\n var index = evalIndex(scope, args, object);\n return access(object, index);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n callback(this.index, 'index', this);\n }\n\n /**\n * Create a new AccessorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AccessorNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new AccessorNode(this._ifNode(callback(this.object, 'object', this)), this._ifNode(callback(this.index, 'index', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AccessorNode}\n */\n clone() {\n return new AccessorNode(this.object, this.index);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n if (needParenthesis(this.object)) {\n object = '(' + object + ')';\n }\n return object + this.index.toString(options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n if (needParenthesis(this.object)) {\n object = '(' + object + ')';\n }\n return object + this.index.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n if (needParenthesis(this.object)) {\n object = '\\\\left(\\' + object + \\'\\\\right)';\n }\n return object + this.index.toTex(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index\n };\n }\n\n /**\n * Instantiate an AccessorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AccessorNode\", object: ..., index: ...}`,\n * where mathjs is optional\n * @returns {AccessorNode}\n */\n static fromJSON(json) {\n return new AccessorNode(json.object, json.index);\n }\n }\n _defineProperty(AccessorNode, \"name\", name);\n return AccessorNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { getSafeProperty } from '../../../utils/customs.js';\nexport function accessFactory(_ref) {\n var {\n subset\n } = _ref;\n /**\n * Retrieve part of an object:\n *\n * - Retrieve a property from an object\n * - Retrieve a part of a string\n * - Retrieve a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @return {Object | Array | Matrix | string} Returns the subset\n */\n return function access(object, index) {\n try {\n if (Array.isArray(object)) {\n return subset(object, index);\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index);\n } else if (typeof object === 'string') {\n // TODO: move getStringSubset into a separate util file, use that\n return subset(object, index);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw new TypeError('Cannot apply a numeric index as object property');\n }\n return getSafeProperty(object, index.getObjectProperty());\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}", "import { IndexError } from '../../../error/IndexError.js';\n\n/**\n * Transform zero-based indices to one-based indices in errors\n * @param {Error} err\n * @returns {Error | IndexError} Returns the transformed error\n */\nexport function errorTransform(err) {\n if (err && err.isIndexError) {\n return new IndexError(err.index + 1, err.min + 1, err.max !== undefined ? err.max + 1 : undefined);\n }\n return err;\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isArrayNode, isNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ArrayNode';\nvar dependencies = ['Node'];\nexport var createArrayNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ArrayNode extends Node {\n /**\n * @constructor ArrayNode\n * @extends {Node}\n * Holds an 1-dimensional array with items\n * @param {Node[]} [items] 1 dimensional array with items\n */\n constructor(items) {\n super();\n this.items = items || [];\n\n // validate input\n if (!Array.isArray(this.items) || !this.items.every(isNode)) {\n throw new TypeError('Array containing Nodes expected');\n }\n }\n get type() {\n return name;\n }\n get isArrayNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalItems = map(this.items, function (item) {\n return item._compile(math, argNames);\n });\n var asMatrix = math.config.matrix !== 'Array';\n if (asMatrix) {\n var matrix = math.matrix;\n return function evalArrayNode(scope, args, context) {\n return matrix(map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n }));\n };\n } else {\n return function evalArrayNode(scope, args, context) {\n return map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n });\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.items.length; i++) {\n var node = this.items[i];\n callback(node, 'items[' + i + ']', this);\n }\n }\n\n /**\n * Create a new ArrayNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ArrayNode} Returns a transformed copy of the node\n */\n map(callback) {\n var items = [];\n for (var i = 0; i < this.items.length; i++) {\n items[i] = this._ifNode(callback(this.items[i], 'items[' + i + ']', this));\n }\n return new ArrayNode(items);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ArrayNode}\n */\n clone() {\n return new ArrayNode(this.items.slice(0));\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var items = this.items.map(function (node) {\n return node.toString(options);\n });\n return '[' + items.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n items: this.items\n };\n }\n\n /**\n * Instantiate an ArrayNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ArrayNode\", items: [...]}`,\n * where mathjs is optional\n * @returns {ArrayNode}\n */\n static fromJSON(json) {\n return new ArrayNode(json.items);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var items = this.items.map(function (node) {\n return node.toHTML(options);\n });\n return '[' + items.join(',') + ']';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n function itemsToTex(items, nested) {\n var mixedItems = items.some(isArrayNode) && !items.every(isArrayNode);\n var itemsFormRow = nested || mixedItems;\n var itemSep = itemsFormRow ? '&' : '\\\\\\\\';\n var itemsTex = items.map(function (node) {\n if (node.items) {\n return itemsToTex(node.items, !nested);\n } else {\n return node.toTex(options);\n }\n }).join(itemSep);\n return mixedItems || !itemsFormRow || itemsFormRow && !nested ? '\\\\begin{bmatrix}' + itemsTex + '\\\\end{bmatrix}' : itemsTex;\n }\n return itemsToTex(this.items, false);\n }\n }\n _defineProperty(ArrayNode, \"name\", name);\n return ArrayNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nimport { assignFactory } from './utils/assign.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'AssignmentNode';\nvar dependencies = ['subset', '?matrix',\n// FIXME: should not be needed at all, should be handled by subset\n'Node'];\nexport var createAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n matrix,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n var assign = assignFactory({\n subset,\n matrix\n });\n\n /*\n * Is parenthesis needed?\n * @param {node} node\n * @param {string} [parenthesis='keep']\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n if (!parenthesis) {\n parenthesis = 'keep';\n }\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.value, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class AssignmentNode extends Node {\n /**\n * @constructor AssignmentNode\n * @extends {Node}\n *\n * Define a symbol, like `a=3.2`, update a property like `a.b=3.2`, or\n * replace a subset of a matrix like `A[2,2]=42`.\n *\n * Syntax:\n *\n * new AssignmentNode(symbol, value)\n * new AssignmentNode(object, index, value)\n *\n * Usage:\n *\n * new AssignmentNode(new SymbolNode('a'), new ConstantNode(2)) // a=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode('b'),\n * new ConstantNode(2)) // a.b=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode(1, 2),\n * new ConstantNode(3)) // a[1,2]=3\n *\n * @param {SymbolNode | AccessorNode} object\n * Object on which to assign a value\n * @param {IndexNode} [index=null]\n * Index, property name or matrix index. Optional. If not provided\n * and `object` is a SymbolNode, the property is assigned to the\n * global scope.\n * @param {Node} value\n * The value to be assigned\n */\n constructor(object, index, value) {\n super();\n this.object = object;\n this.index = value ? index : null;\n this.value = value || index;\n\n // validate input\n if (!isSymbolNode(object) && !isAccessorNode(object)) {\n throw new TypeError('SymbolNode or AccessorNode expected as \"object\"');\n }\n if (isSymbolNode(object) && object.name === 'end') {\n throw new Error('Cannot assign to symbol \"end\"');\n }\n if (this.index && !isIndexNode(this.index)) {\n // index is optional\n throw new TypeError('IndexNode expected as \"index\"');\n }\n if (!isNode(this.value)) {\n throw new TypeError('Node expected as \"value\"');\n }\n }\n\n // class name for typing purposes:\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index ? this.index._compile(math, argNames) : null;\n var evalValue = this.value._compile(math, argNames);\n var name = this.object.name;\n if (!this.index) {\n // apply a variable to the scope, for example `a=2`\n if (!isSymbolNode(this.object)) {\n throw new TypeError('SymbolNode expected as object');\n }\n return function evalAssignmentNode(scope, args, context) {\n var value = evalValue(scope, args, context);\n scope.set(name, value);\n return value;\n };\n } else if (this.index.isObjectProperty()) {\n // apply an object property for example `a.b=2`\n var prop = this.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n setSafeProperty(object, prop, value);\n return value;\n };\n } else if (isSymbolNode(this.object)) {\n // update a matrix subset, for example `a[2]=3`\n return function evalAssignmentNode(scope, args, context) {\n var childObject = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n scope.set(name, assign(childObject, index, value));\n return value;\n };\n } else {\n // isAccessorNode(node.object) === true\n // update a matrix subset, for example `a.b[2]=3`\n\n // we will not use the compile function of the AccessorNode, but\n // compile it ourselves here as we need the parent object of the\n // AccessorNode:\n // wee need to apply the updated object to parent object\n var evalParentObject = this.object.object._compile(math, argNames);\n if (this.object.index.isObjectProperty()) {\n var parentProp = this.object.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n var childObject = getSafeProperty(parent, parentProp);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n setSafeProperty(parent, parentProp, assign(childObject, index, value));\n return value;\n };\n } else {\n // if some parameters use the 'end' parameter, we need to calculate\n // the size\n var evalParentIndex = this.object.index._compile(math, argNames);\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n // Important: we pass parent instead of context:\n var parentIndex = evalParentIndex(scope, args, parent);\n var childObject = access(parent, parentIndex);\n // Important: we pass childObject instead of context\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n assign(parent, parentIndex, assign(childObject, index, value));\n return value;\n };\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n if (this.index) {\n callback(this.index, 'index', this);\n }\n callback(this.value, 'value', this);\n }\n\n /**\n * Create a new AssignmentNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var object = this._ifNode(callback(this.object, 'object', this));\n var index = this.index ? this._ifNode(callback(this.index, 'index', this)) : null;\n var value = this._ifNode(callback(this.value, 'value', this));\n return new AssignmentNode(object, index, value);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AssignmentNode}\n */\n clone() {\n return new AssignmentNode(this.object, this.index, this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n var index = this.index ? this.index.toString(options) : '';\n var value = this.value.toString(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '(' + value + ')';\n }\n return object + index + ' = ' + value;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index,\n value: this.value\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AssignmentNode\", object: ..., index: ..., value: ...}`,\n * where mathjs is optional\n * @returns {AssignmentNode}\n */\n static fromJSON(json) {\n return new AssignmentNode(json.object, json.index, json.value);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n var index = this.index ? this.index.toHTML(options) : '';\n var value = this.value.toHTML(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '(' + value + ')';\n }\n return object + index + '=' + value;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n var index = this.index ? this.index.toTex(options) : '';\n var value = this.value.toTex(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = \"\\\\left(\".concat(value, \"\\\\right)\");\n }\n return object + index + '=' + value;\n }\n }\n _defineProperty(AssignmentNode, \"name\", name);\n return AssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { setSafeProperty } from '../../../utils/customs.js';\nexport function assignFactory(_ref) {\n var {\n subset,\n matrix\n } = _ref;\n /**\n * Replace part of an object:\n *\n * - Assign a property to an object\n * - Replace a part of a string\n * - Replace a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @param {*} value\n * @return {Object | Array | Matrix | string} Returns the original object\n * except in case of a string\n */\n // TODO: change assign to return the value instead of the object\n return function assign(object, index, value) {\n try {\n if (Array.isArray(object)) {\n var result = matrix(object).subset(index, value).valueOf();\n\n // shallow copy all (updated) items into the original array\n result.forEach((item, index) => {\n object[index] = item;\n });\n return object;\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index, value);\n } else if (typeof object === 'string') {\n // TODO: move setStringSubset into a separate util file, use that\n return subset(object, index, value);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw TypeError('Cannot apply a numeric index as object property');\n }\n setSafeProperty(object, index.getObjectProperty(), value);\n return object;\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}", "// list of identifiers of nodes in order of their precedence\n// also contains information about left/right associativity\n// and which other operator the operator is associative with\n// Example:\n// addition is associative with addition and subtraction, because:\n// (a+b)+c=a+(b+c)\n// (a+b)-c=a+(b-c)\n//\n// postfix operators are left associative, prefix operators\n// are right associative\n//\n// It's also possible to set the following properties:\n// latexParens: if set to false, this node doesn't need to be enclosed\n// in parentheses when using LaTeX\n// latexLeftParens: if set to false, this !OperatorNode's!\n// left argument doesn't need to be enclosed\n// in parentheses\n// latexRightParens: the same for the right argument\nimport { hasOwnProperty } from '../utils/object.js';\nimport { isConstantNode, isParenthesisNode, rule2Node } from '../utils/is.js';\nexport var properties = [{\n // assignment\n AssignmentNode: {},\n FunctionAssignmentNode: {}\n}, {\n // conditional expression\n ConditionalNode: {\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // conditionals don't need parentheses in LaTeX because\n // they are 2 dimensional\n }\n}, {\n // logical or\n 'OperatorNode:or': {\n op: 'or',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical xor\n 'OperatorNode:xor': {\n op: 'xor',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical and\n 'OperatorNode:and': {\n op: 'and',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise or\n 'OperatorNode:bitOr': {\n op: '|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise xor\n 'OperatorNode:bitXor': {\n op: '^|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise and\n 'OperatorNode:bitAnd': {\n op: '&',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // relational operators\n 'OperatorNode:equal': {\n op: '==',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:unequal': {\n op: '!=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smaller': {\n op: '<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:larger': {\n op: '>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smallerEq': {\n op: '<=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:largerEq': {\n op: '>=',\n associativity: 'left',\n associativeWith: []\n },\n RelationalNode: {\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitshift operators\n 'OperatorNode:leftShift': {\n op: '<<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightArithShift': {\n op: '>>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightLogShift': {\n op: '>>>',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // unit conversion\n 'OperatorNode:to': {\n op: 'to',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // range\n RangeNode: {}\n}, {\n // addition, subtraction\n 'OperatorNode:add': {\n op: '+',\n associativity: 'left',\n associativeWith: ['OperatorNode:add', 'OperatorNode:subtract']\n },\n 'OperatorNode:subtract': {\n op: '-',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // multiply, divide, modulus\n 'OperatorNode:multiply': {\n op: '*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n },\n 'OperatorNode:divide': {\n op: '/',\n associativity: 'left',\n associativeWith: [],\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // fractions don't require parentheses because\n // they're 2 dimensional, so parens aren't needed\n // in LaTeX\n },\n 'OperatorNode:dotMultiply': {\n op: '.*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'OperatorNode:dotMultiply', 'OperatorNode:doDivide']\n },\n 'OperatorNode:dotDivide': {\n op: './',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:mod': {\n op: 'mod',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // Repeat multiplication for implicit multiplication\n 'OperatorNode:multiply': {\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n }\n}, {\n // unary prefix operators\n 'OperatorNode:unaryPlus': {\n op: '+',\n associativity: 'right'\n },\n 'OperatorNode:unaryMinus': {\n op: '-',\n associativity: 'right'\n },\n 'OperatorNode:bitNot': {\n op: '~',\n associativity: 'right'\n },\n 'OperatorNode:not': {\n op: 'not',\n associativity: 'right'\n }\n}, {\n // exponentiation\n 'OperatorNode:pow': {\n op: '^',\n associativity: 'right',\n associativeWith: [],\n latexRightParens: false\n // the exponent doesn't need parentheses in\n // LaTeX because it's 2 dimensional\n // (it's on top)\n },\n 'OperatorNode:dotPow': {\n op: '.^',\n associativity: 'right',\n associativeWith: []\n }\n}, {\n // factorial\n 'OperatorNode:factorial': {\n op: '!',\n associativity: 'left'\n }\n}, {\n // matrix transpose\n 'OperatorNode:ctranspose': {\n op: \"'\",\n associativity: 'left'\n }\n}];\n\n/**\n * Returns the first non-parenthesis internal node, but only\n * when the 'parenthesis' option is unset or auto.\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {Node}\n */\nfunction unwrapParen(_node, parenthesis) {\n if (!parenthesis || parenthesis !== 'auto') return _node;\n var node = _node;\n while (isParenthesisNode(node)) node = node.content;\n return node;\n}\n\n/**\n * Get the precedence of a Node.\n * Higher number for higher precedence, starting with 0.\n * Returns null if the precedence is undefined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @param {string} implicit\n * @param {Node} parent (for determining context for implicit multiplication)\n * @return {number | null}\n */\nexport function getPrecedence(_node, parenthesis, implicit, parent) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var precedence = null;\n for (var i = 0; i < properties.length; i++) {\n if (identifier in properties[i]) {\n precedence = i;\n break;\n }\n }\n // Bump up precedence of implicit multiplication, except when preceded\n // by a \"Rule 2\" fraction ( [unaryOp]constant / constant )\n if (identifier === 'OperatorNode:multiply' && node.implicit && implicit !== 'show') {\n var leftArg = unwrapParen(node.args[0], parenthesis);\n if (!(isConstantNode(leftArg) && parent && parent.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(parent.args[0], parenthesis))) && !(leftArg.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(leftArg.args[0], parenthesis)) && isConstantNode(unwrapParen(leftArg.args[1])))) {\n precedence += 1;\n }\n }\n return precedence;\n}\n\n/**\n * Get the associativity of an operator (left or right).\n * Returns a string containing 'left' or 'right' or null if\n * the associativity is not defined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {string|null}\n * @throws {Error}\n */\nexport function getAssociativity(_node, parenthesis) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var index = getPrecedence(node, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifier];\n if (hasOwnProperty(property, 'associativity')) {\n if (property.associativity === 'left') {\n return 'left';\n }\n if (property.associativity === 'right') {\n return 'right';\n }\n // associativity is invalid\n throw Error('\\'' + identifier + '\\' has the invalid associativity \\'' + property.associativity + '\\'.');\n }\n\n // associativity is undefined\n return null;\n}\n\n/**\n * Check if an operator is associative with another operator.\n * Returns either true or false or null if not defined.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @param {string} parenthesis\n * @return {boolean | null}\n */\nexport function isAssociativeWith(nodeA, nodeB, parenthesis) {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n var a = parenthesis !== 'keep' ? nodeA.getContent() : nodeA;\n var b = parenthesis !== 'keep' ? nodeA.getContent() : nodeB;\n var identifierA = a.getIdentifier();\n var identifierB = b.getIdentifier();\n var index = getPrecedence(a, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifierA];\n if (hasOwnProperty(property, 'associativeWith') && property.associativeWith instanceof Array) {\n for (var i = 0; i < property.associativeWith.length; i++) {\n if (property.associativeWith[i] === identifierB) {\n return true;\n }\n }\n return false;\n }\n\n // associativeWith is not defined\n return null;\n}\n\n/**\n * Get the operator associated with a function name.\n * Returns a string with the operator symbol, or null if the\n * input is not the name of a function associated with an\n * operator.\n *\n * @param {string} Function name\n * @return {string | null} Associated operator symbol, if any\n */\nexport function getOperator(fn) {\n var identifier = 'OperatorNode:' + fn;\n for (var group of properties) {\n if (identifier in group) {\n return group[identifier].op;\n }\n }\n return null;\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { forEach, map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'BlockNode';\nvar dependencies = ['ResultSet', 'Node'];\nexport var createBlockNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n ResultSet,\n Node\n } = _ref;\n class BlockNode extends Node {\n /**\n * @constructor BlockNode\n * @extends {Node}\n * Holds a set with blocks\n * @param {Array.<{node: Node} | {node: Node, visible: boolean}>} blocks\n * An array with blocks, where a block is constructed as an\n * Object with properties block, which is a Node, and visible,\n * which is a boolean. The property visible is optional and\n * is true by default\n */\n constructor(blocks) {\n super();\n // validate input, copy blocks\n if (!Array.isArray(blocks)) throw new Error('Array expected');\n this.blocks = blocks.map(function (block) {\n var node = block && block.node;\n var visible = block && block.visible !== undefined ? block.visible : true;\n if (!isNode(node)) throw new TypeError('Property \"node\" must be a Node');\n if (typeof visible !== 'boolean') {\n throw new TypeError('Property \"visible\" must be a boolean');\n }\n return {\n node,\n visible\n };\n });\n }\n get type() {\n return name;\n }\n get isBlockNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalBlocks = map(this.blocks, function (block) {\n return {\n evaluate: block.node._compile(math, argNames),\n visible: block.visible\n };\n });\n return function evalBlockNodes(scope, args, context) {\n var results = [];\n forEach(evalBlocks, function evalBlockNode(block) {\n var result = block.evaluate(scope, args, context);\n if (block.visible) {\n results.push(result);\n }\n });\n return new ResultSet(results);\n };\n }\n\n /**\n * Execute a callback for each of the child blocks of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.blocks.length; i++) {\n callback(this.blocks[i].node, 'blocks[' + i + '].node', this);\n }\n }\n\n /**\n * Create a new BlockNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {BlockNode} Returns a transformed copy of the node\n */\n map(callback) {\n var blocks = [];\n for (var i = 0; i < this.blocks.length; i++) {\n var block = this.blocks[i];\n var node = this._ifNode(callback(block.node, 'blocks[' + i + '].node', this));\n blocks[i] = {\n node,\n visible: block.visible\n };\n }\n return new BlockNode(blocks);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {BlockNode}\n */\n clone() {\n var blocks = this.blocks.map(function (block) {\n return {\n node: block.node,\n visible: block.visible\n };\n });\n return new BlockNode(blocks);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.blocks.map(function (param) {\n return param.node.toString(options) + (param.visible ? '' : ';');\n }).join('\\n');\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n blocks: this.blocks\n };\n }\n\n /**\n * Instantiate an BlockNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"BlockNode\", blocks: [{node: ..., visible: false}, ...]}`,\n * where mathjs is optional\n * @returns {BlockNode}\n */\n static fromJSON(json) {\n return new BlockNode(json.blocks);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n return this.blocks.map(function (param) {\n return param.node.toHTML(options) + (param.visible ? '' : ';');\n }).join('
    ');\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return this.blocks.map(function (param) {\n return param.node.toTex(options) + (param.visible ? '' : ';');\n }).join('\\\\;\\\\;\\n');\n }\n }\n _defineProperty(BlockNode, \"name\", name);\n return BlockNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isBigNumber, isComplex, isNode, isUnit, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'ConditionalNode';\nvar dependencies = ['Node'];\nexport var createConditionalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Test whether a condition is met\n * @param {*} condition\n * @returns {boolean} true if condition is true or non-zero, else false\n */\n function testCondition(condition) {\n if (typeof condition === 'number' || typeof condition === 'boolean' || typeof condition === 'string') {\n return !!condition;\n }\n if (condition) {\n if (isBigNumber(condition)) {\n return !condition.isZero();\n }\n if (isComplex(condition)) {\n return !!(condition.re || condition.im);\n }\n if (isUnit(condition)) {\n return !!condition.value;\n }\n }\n if (condition === null || condition === undefined) {\n return false;\n }\n throw new TypeError('Unsupported type of condition \"' + typeOf(condition) + '\"');\n }\n class ConditionalNode extends Node {\n /**\n * A lazy evaluating conditional operator: 'condition ? trueExpr : falseExpr'\n *\n * @param {Node} condition Condition, must result in a boolean\n * @param {Node} trueExpr Expression evaluated when condition is true\n * @param {Node} falseExpr Expression evaluated when condition is true\n *\n * @constructor ConditionalNode\n * @extends {Node}\n */\n constructor(condition, trueExpr, falseExpr) {\n super();\n if (!isNode(condition)) {\n throw new TypeError('Parameter condition must be a Node');\n }\n if (!isNode(trueExpr)) {\n throw new TypeError('Parameter trueExpr must be a Node');\n }\n if (!isNode(falseExpr)) {\n throw new TypeError('Parameter falseExpr must be a Node');\n }\n this.condition = condition;\n this.trueExpr = trueExpr;\n this.falseExpr = falseExpr;\n }\n get type() {\n return name;\n }\n get isConditionalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalCondition = this.condition._compile(math, argNames);\n var evalTrueExpr = this.trueExpr._compile(math, argNames);\n var evalFalseExpr = this.falseExpr._compile(math, argNames);\n return function evalConditionalNode(scope, args, context) {\n return testCondition(evalCondition(scope, args, context)) ? evalTrueExpr(scope, args, context) : evalFalseExpr(scope, args, context);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.condition, 'condition', this);\n callback(this.trueExpr, 'trueExpr', this);\n callback(this.falseExpr, 'falseExpr', this);\n }\n\n /**\n * Create a new ConditionalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ConditionalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new ConditionalNode(this._ifNode(callback(this.condition, 'condition', this)), this._ifNode(callback(this.trueExpr, 'trueExpr', this)), this._ifNode(callback(this.falseExpr, 'falseExpr', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConditionalNode}\n */\n clone() {\n return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toString(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '(' + condition + ')';\n }\n var trueExpr = this.trueExpr.toString(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '(' + trueExpr + ')';\n }\n var falseExpr = this.falseExpr.toString(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '(' + falseExpr + ')';\n }\n return condition + ' ? ' + trueExpr + ' : ' + falseExpr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n condition: this.condition,\n trueExpr: this.trueExpr,\n falseExpr: this.falseExpr\n };\n }\n\n /**\n * Instantiate an ConditionalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"ConditionalNode\",\n * \"condition\": ...,\n * \"trueExpr\": ...,\n * \"falseExpr\": ...}\n * ```\n * where mathjs is optional\n * @returns {ConditionalNode}\n */\n static fromJSON(json) {\n return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toHTML(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '(' + condition + ')';\n }\n var trueExpr = this.trueExpr.toHTML(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '(' + trueExpr + ')';\n }\n var falseExpr = this.falseExpr.toHTML(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '(' + falseExpr + ')';\n }\n return condition + '?' + trueExpr + ':' + falseExpr;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return '\\\\begin{cases} {' + this.trueExpr.toTex(options) + '}, &\\\\quad{\\\\text{if }\\\\;' + this.condition.toTex(options) + '}\\\\\\\\{' + this.falseExpr.toTex(options) + '}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}';\n }\n }\n _defineProperty(ConditionalNode, \"name\", name);\n return ConditionalNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { format } from '../../utils/string.js';\nimport { typeOf } from '../../utils/is.js';\nimport { escapeLatex } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ConstantNode';\nvar dependencies = ['Node'];\nexport var createConstantNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ConstantNode extends Node {\n /**\n * A ConstantNode holds a constant value like a number or string.\n *\n * Usage:\n *\n * new ConstantNode(2.3)\n * new ConstantNode('hello')\n *\n * @param {*} value Value can be any type (number, BigNumber, bigint, string, ...)\n * @constructor ConstantNode\n * @extends {Node}\n */\n constructor(value) {\n super();\n this.value = value;\n }\n get type() {\n return name;\n }\n get isConstantNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var value = this.value;\n return function evalConstantNode() {\n return value;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new ConstantNode with children produced by the given callback.\n * Trivial because there are no children.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ConstantNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConstantNode}\n */\n clone() {\n return new ConstantNode(this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n return format(this.value, options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var value = this._toString(options);\n switch (typeOf(this.value)) {\n case 'number':\n case 'bigint':\n case 'BigNumber':\n case 'Fraction':\n return '' + value + '';\n case 'string':\n return '' + value + '';\n case 'boolean':\n return '' + value + '';\n case 'null':\n return '' + value + '';\n case 'undefined':\n return '' + value + '';\n default:\n return '' + value + '';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n value: this.value\n };\n }\n\n /**\n * Instantiate a ConstantNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", value: 2.3}`,\n * where mathjs is optional\n * @returns {ConstantNode}\n */\n static fromJSON(json) {\n return new ConstantNode(json.value);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var value = this._toString(options);\n var type = typeOf(this.value);\n switch (type) {\n case 'string':\n return '\\\\mathtt{' + escapeLatex(value) + '}';\n case 'number':\n case 'BigNumber':\n {\n var finite = type === 'BigNumber' ? this.value.isFinite() : isFinite(this.value);\n if (!finite) {\n return this.value.valueOf() < 0 ? '-\\\\infty' : '\\\\infty';\n }\n var index = value.toLowerCase().indexOf('e');\n if (index !== -1) {\n return value.substring(0, index) + '\\\\cdot10^{' + value.substring(index + 1) + '}';\n }\n return value;\n }\n case 'bigint':\n {\n return value.toString();\n }\n case 'Fraction':\n return this.value.toLatex();\n default:\n return value;\n }\n }\n }\n _defineProperty(ConstantNode, \"name\", name);\n return ConstantNode;\n}, {\n isClass: true,\n isNode: true\n});", "/* eslint no-template-curly-in-string: \"off\" */\n\nimport escapeLatexLib from 'escape-latex';\nimport { hasOwnProperty } from './object.js';\nexport var latexSymbols = {\n // GREEK LETTERS\n Alpha: 'A',\n alpha: '\\\\alpha',\n Beta: 'B',\n beta: '\\\\beta',\n Gamma: '\\\\Gamma',\n gamma: '\\\\gamma',\n Delta: '\\\\Delta',\n delta: '\\\\delta',\n Epsilon: 'E',\n epsilon: '\\\\epsilon',\n varepsilon: '\\\\varepsilon',\n Zeta: 'Z',\n zeta: '\\\\zeta',\n Eta: 'H',\n eta: '\\\\eta',\n Theta: '\\\\Theta',\n theta: '\\\\theta',\n vartheta: '\\\\vartheta',\n Iota: 'I',\n iota: '\\\\iota',\n Kappa: 'K',\n kappa: '\\\\kappa',\n varkappa: '\\\\varkappa',\n Lambda: '\\\\Lambda',\n lambda: '\\\\lambda',\n Mu: 'M',\n mu: '\\\\mu',\n Nu: 'N',\n nu: '\\\\nu',\n Xi: '\\\\Xi',\n xi: '\\\\xi',\n Omicron: 'O',\n omicron: 'o',\n Pi: '\\\\Pi',\n pi: '\\\\pi',\n varpi: '\\\\varpi',\n Rho: 'P',\n rho: '\\\\rho',\n varrho: '\\\\varrho',\n Sigma: '\\\\Sigma',\n sigma: '\\\\sigma',\n varsigma: '\\\\varsigma',\n Tau: 'T',\n tau: '\\\\tau',\n Upsilon: '\\\\Upsilon',\n upsilon: '\\\\upsilon',\n Phi: '\\\\Phi',\n phi: '\\\\phi',\n varphi: '\\\\varphi',\n Chi: 'X',\n chi: '\\\\chi',\n Psi: '\\\\Psi',\n psi: '\\\\psi',\n Omega: '\\\\Omega',\n omega: '\\\\omega',\n // logic\n true: '\\\\mathrm{True}',\n false: '\\\\mathrm{False}',\n // other\n i: 'i',\n // TODO use \\i ??\n inf: '\\\\infty',\n Inf: '\\\\infty',\n infinity: '\\\\infty',\n Infinity: '\\\\infty',\n oo: '\\\\infty',\n lim: '\\\\lim',\n undefined: '\\\\mathbf{?}'\n};\nexport var latexOperators = {\n transpose: '^\\\\top',\n ctranspose: '^H',\n factorial: '!',\n pow: '^',\n dotPow: '.^\\\\wedge',\n // TODO find ideal solution\n unaryPlus: '+',\n unaryMinus: '-',\n bitNot: '\\\\~',\n // TODO find ideal solution\n not: '\\\\neg',\n multiply: '\\\\cdot',\n divide: '\\\\frac',\n // TODO how to handle that properly?\n dotMultiply: '.\\\\cdot',\n // TODO find ideal solution\n dotDivide: '.:',\n // TODO find ideal solution\n mod: '\\\\mod',\n add: '+',\n subtract: '-',\n to: '\\\\rightarrow',\n leftShift: '<<',\n rightArithShift: '>>',\n rightLogShift: '>>>',\n equal: '=',\n unequal: '\\\\neq',\n smaller: '<',\n larger: '>',\n smallerEq: '\\\\leq',\n largerEq: '\\\\geq',\n bitAnd: '\\\\&',\n bitXor: '\\\\underline{|}',\n bitOr: '|',\n and: '\\\\wedge',\n xor: '\\\\veebar',\n or: '\\\\vee'\n};\nexport var latexFunctions = {\n // arithmetic\n abs: {\n 1: '\\\\left|${args[0]}\\\\right|'\n },\n add: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.add, \"${args[1]}\\\\right)\")\n },\n cbrt: {\n 1: '\\\\sqrt[3]{${args[0]}}'\n },\n ceil: {\n 1: '\\\\left\\\\lceil${args[0]}\\\\right\\\\rceil'\n },\n cube: {\n 1: '\\\\left(${args[0]}\\\\right)^3'\n },\n divide: {\n 2: '\\\\frac{${args[0]}}{${args[1]}}'\n },\n dotDivide: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotDivide, \"${args[1]}\\\\right)\")\n },\n dotMultiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotMultiply, \"${args[1]}\\\\right)\")\n },\n dotPow: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotPow, \"${args[1]}\\\\right)\")\n },\n exp: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n expm1: \"\\\\left(e\".concat(latexOperators.pow, \"{${args[0]}}-1\\\\right)\"),\n fix: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n floor: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rfloor'\n },\n gcd: '\\\\gcd\\\\left(${args}\\\\right)',\n hypot: '\\\\hypot\\\\left(${args}\\\\right)',\n log: {\n 1: '\\\\ln\\\\left(${args[0]}\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}\\\\right)'\n },\n log10: {\n 1: '\\\\log_{10}\\\\left(${args[0]}\\\\right)'\n },\n log1p: {\n 1: '\\\\ln\\\\left(${args[0]}+1\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}+1\\\\right)'\n },\n log2: '\\\\log_{2}\\\\left(${args[0]}\\\\right)',\n mod: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.mod, \"${args[1]}\\\\right)\")\n },\n multiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.multiply, \"${args[1]}\\\\right)\")\n },\n norm: {\n 1: '\\\\left\\\\|${args[0]}\\\\right\\\\|',\n 2: undefined // use default template\n },\n nthRoot: {\n 2: '\\\\sqrt[${args[1]}]{${args[0]}}'\n },\n nthRoots: {\n 2: '\\\\{y : $y^{args[1]} = {${args[0]}}\\\\}'\n },\n pow: {\n 2: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.pow, \"{${args[1]}}\")\n },\n round: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rceil',\n 2: undefined // use default template\n },\n sign: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n sqrt: {\n 1: '\\\\sqrt{${args[0]}}'\n },\n square: {\n 1: '\\\\left(${args[0]}\\\\right)^2'\n },\n subtract: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.subtract, \"${args[1]}\\\\right)\")\n },\n unaryMinus: {\n 1: \"\".concat(latexOperators.unaryMinus, \"\\\\left(${args[0]}\\\\right)\")\n },\n unaryPlus: {\n 1: \"\".concat(latexOperators.unaryPlus, \"\\\\left(${args[0]}\\\\right)\")\n },\n // bitwise\n bitAnd: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitAnd, \"${args[1]}\\\\right)\")\n },\n bitNot: {\n 1: latexOperators.bitNot + '\\\\left(${args[0]}\\\\right)'\n },\n bitOr: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitOr, \"${args[1]}\\\\right)\")\n },\n bitXor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitXor, \"${args[1]}\\\\right)\")\n },\n leftShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.leftShift, \"${args[1]}\\\\right)\")\n },\n rightArithShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightArithShift, \"${args[1]}\\\\right)\")\n },\n rightLogShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightLogShift, \"${args[1]}\\\\right)\")\n },\n // combinatorics\n bellNumbers: {\n 1: '\\\\mathrm{B}_{${args[0]}}'\n },\n catalan: {\n 1: '\\\\mathrm{C}_{${args[0]}}'\n },\n stirlingS2: {\n 2: '\\\\mathrm{S}\\\\left(${args}\\\\right)'\n },\n // complex\n arg: {\n 1: '\\\\arg\\\\left(${args[0]}\\\\right)'\n },\n conj: {\n 1: '\\\\left(${args[0]}\\\\right)^*'\n },\n im: {\n 1: '\\\\Im\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n re: {\n 1: '\\\\Re\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n // logical\n and: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.and, \"${args[1]}\\\\right)\")\n },\n not: {\n 1: latexOperators.not + '\\\\left(${args[0]}\\\\right)'\n },\n or: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.or, \"${args[1]}\\\\right)\")\n },\n xor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.xor, \"${args[1]}\\\\right)\")\n },\n // matrix\n cross: {\n 2: '\\\\left(${args[0]}\\\\right)\\\\times\\\\left(${args[1]}\\\\right)'\n },\n ctranspose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.ctranspose)\n },\n det: {\n 1: '\\\\det\\\\left(${args[0]}\\\\right)'\n },\n dot: {\n 2: '\\\\left(${args[0]}\\\\cdot${args[1]}\\\\right)'\n },\n expm: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n inv: {\n 1: '\\\\left(${args[0]}\\\\right)^{-1}'\n },\n pinv: {\n 1: '\\\\left(${args[0]}\\\\right)^{+}'\n },\n sqrtm: {\n 1: \"{${args[0]}}\".concat(latexOperators.pow, \"{\\\\frac{1}{2}}\")\n },\n trace: {\n 1: '\\\\mathrm{tr}\\\\left(${args[0]}\\\\right)'\n },\n transpose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.transpose)\n },\n // probability\n combinations: {\n 2: '\\\\binom{${args[0]}}{${args[1]}}'\n },\n combinationsWithRep: {\n 2: '\\\\left(\\\\!\\\\!{\\\\binom{${args[0]}}{${args[1]}}}\\\\!\\\\!\\\\right)'\n },\n factorial: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.factorial)\n },\n gamma: {\n 1: '\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n lgamma: {\n 1: '\\\\ln\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n // relational\n equal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.equal, \"${args[1]}\\\\right)\")\n },\n larger: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.larger, \"${args[1]}\\\\right)\")\n },\n largerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.largerEq, \"${args[1]}\\\\right)\")\n },\n smaller: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smaller, \"${args[1]}\\\\right)\")\n },\n smallerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smallerEq, \"${args[1]}\\\\right)\")\n },\n unequal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.unequal, \"${args[1]}\\\\right)\")\n },\n // special\n erf: {\n 1: 'erf\\\\left(${args[0]}\\\\right)'\n },\n // statistics\n max: '\\\\max\\\\left(${args}\\\\right)',\n min: '\\\\min\\\\left(${args}\\\\right)',\n variance: '\\\\mathrm{Var}\\\\left(${args}\\\\right)',\n // trigonometry\n acos: {\n 1: '\\\\cos^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acosh: {\n 1: '\\\\cosh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acot: {\n 1: '\\\\cot^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acoth: {\n 1: '\\\\coth^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsc: {\n 1: '\\\\csc^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsch: {\n 1: '\\\\mathrm{csch}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asec: {\n 1: '\\\\sec^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asech: {\n 1: '\\\\mathrm{sech}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asin: {\n 1: '\\\\sin^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asinh: {\n 1: '\\\\sinh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan: {\n 1: '\\\\tan^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan2: {\n 2: '\\\\mathrm{atan2}\\\\left(${args}\\\\right)'\n },\n atanh: {\n 1: '\\\\tanh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n cos: {\n 1: '\\\\cos\\\\left(${args[0]}\\\\right)'\n },\n cosh: {\n 1: '\\\\cosh\\\\left(${args[0]}\\\\right)'\n },\n cot: {\n 1: '\\\\cot\\\\left(${args[0]}\\\\right)'\n },\n coth: {\n 1: '\\\\coth\\\\left(${args[0]}\\\\right)'\n },\n csc: {\n 1: '\\\\csc\\\\left(${args[0]}\\\\right)'\n },\n csch: {\n 1: '\\\\mathrm{csch}\\\\left(${args[0]}\\\\right)'\n },\n sec: {\n 1: '\\\\sec\\\\left(${args[0]}\\\\right)'\n },\n sech: {\n 1: '\\\\mathrm{sech}\\\\left(${args[0]}\\\\right)'\n },\n sin: {\n 1: '\\\\sin\\\\left(${args[0]}\\\\right)'\n },\n sinh: {\n 1: '\\\\sinh\\\\left(${args[0]}\\\\right)'\n },\n tan: {\n 1: '\\\\tan\\\\left(${args[0]}\\\\right)'\n },\n tanh: {\n 1: '\\\\tanh\\\\left(${args[0]}\\\\right)'\n },\n // unit\n to: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.to, \"${args[1]}\\\\right)\")\n },\n // utils\n numeric: function numeric(node, options) {\n // Not sure if this is strictly right but should work correctly for the vast majority of use cases.\n return node.args[0].toTex();\n },\n // type\n number: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n },\n string: {\n 0: '\\\\mathtt{\"\"}',\n 1: '\\\\mathrm{string}\\\\left(${args[0]}\\\\right)'\n },\n bignumber: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n bigint: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n complex: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: \"\\\\left(\\\\left(${args[0]}\\\\right)+\".concat(latexSymbols.i, \"\\\\cdot\\\\left(${args[1]}\\\\right)\\\\right)\")\n },\n matrix: {\n 0: '\\\\begin{bmatrix}\\\\end{bmatrix}',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(${args[0]}\\\\right)'\n },\n sparse: {\n 0: '\\\\begin{bsparse}\\\\end{bsparse}',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n unit: {\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n }\n};\nexport var defaultTemplate = '\\\\mathrm{${name}}\\\\left(${args}\\\\right)';\nvar latexUnits = {\n deg: '^\\\\circ'\n};\nexport function escapeLatex(string) {\n return escapeLatexLib(string, {\n preserveFormatting: true\n });\n}\n\n// @param {string} name\n// @param {boolean} isUnit\nexport function toSymbol(name, isUnit) {\n isUnit = typeof isUnit === 'undefined' ? false : isUnit;\n if (isUnit) {\n if (hasOwnProperty(latexUnits, name)) {\n return latexUnits[name];\n }\n return '\\\\mathrm{' + escapeLatex(name) + '}';\n }\n if (hasOwnProperty(latexSymbols, name)) {\n return latexSymbols[name];\n }\n return escapeLatex(name);\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { escape } from '../../utils/string.js';\nimport { forEach, join } from '../../utils/array.js';\nimport { toSymbol } from '../../utils/latex.js';\nimport { getPrecedence } from '../operators.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'FunctionAssignmentNode';\nvar dependencies = ['typed', 'Node'];\nexport var createFunctionAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Node\n } = _ref;\n /**\n * Is parenthesis needed?\n * @param {Node} node\n * @param {Object} parenthesis\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.expr, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class FunctionAssignmentNode extends Node {\n /**\n * @constructor FunctionAssignmentNode\n * @extends {Node}\n * Function assignment\n *\n * @param {string} name Function name\n * @param {string[] | Array.<{name: string, type: string}>} params\n * Array with function parameter names, or an\n * array with objects containing the name\n * and type of the parameter\n * @param {Node} expr The function expression\n */\n constructor(name, params, expr) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Array containing strings or objects expected for parameter \"params\"');\n }\n if (!isNode(expr)) {\n throw new TypeError('Node expected for parameter \"expr\"');\n }\n if (keywords.has(name)) {\n throw new Error('Illegal function name, \"' + name + '\" is a reserved keyword');\n }\n var paramNames = new Set();\n for (var param of params) {\n var _name = typeof param === 'string' ? param : param.name;\n if (paramNames.has(_name)) {\n throw new Error(\"Duplicate parameter name \\\"\".concat(_name, \"\\\"\"));\n } else {\n paramNames.add(_name);\n }\n }\n this.name = name;\n this.params = params.map(function (param) {\n return param && param.name || param;\n });\n this.types = params.map(function (param) {\n return param && param.type || 'any';\n });\n this.expr = expr;\n }\n get type() {\n return name;\n }\n get isFunctionAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var childArgNames = Object.create(argNames);\n forEach(this.params, function (param) {\n childArgNames[param] = true;\n });\n\n // compile the function expression with the child args\n var evalExpr = this.expr._compile(math, childArgNames);\n var name = this.name;\n var params = this.params;\n var signature = join(this.types, ',');\n var syntax = name + '(' + join(this.params, ', ') + ')';\n return function evalFunctionAssignmentNode(scope, args, context) {\n var signatures = {};\n signatures[signature] = function () {\n var childArgs = Object.create(args);\n for (var i = 0; i < params.length; i++) {\n childArgs[params[i]] = arguments[i];\n }\n return evalExpr(scope, childArgs, context);\n };\n var fn = typed(name, signatures);\n fn.syntax = syntax;\n scope.set(name, fn);\n return fn;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.expr, 'expr', this);\n }\n\n /**\n * Create a new FunctionAssignmentNode whose children are the results of\n * calling the provided callback function for each child of the original\n * node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionAssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var expr = this._ifNode(callback(this.expr, 'expr', this));\n return new FunctionAssignmentNode(this.name, this.params.slice(0), expr);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionAssignmentNode}\n */\n clone() {\n return new FunctionAssignmentNode(this.name, this.params.slice(0), this.expr);\n }\n\n /**\n * get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toString(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')';\n }\n return this.name + '(' + this.params.join(', ') + ') = ' + expr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n var types = this.types;\n return {\n mathjs: name,\n name: this.name,\n params: this.params.map(function (param, index) {\n return {\n name: param,\n type: types[index]\n };\n }),\n expr: this.expr\n };\n }\n\n /**\n * Instantiate an FunctionAssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"FunctionAssignmentNode\",\n * name: ..., params: ..., expr: ...}\n * ```\n * where mathjs is optional\n * @returns {FunctionAssignmentNode}\n */\n static fromJSON(json) {\n return new FunctionAssignmentNode(json.name, json.params, json.expr);\n }\n\n /**\n * get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var params = [];\n for (var i = 0; i < this.params.length; i++) {\n params.push('' + escape(this.params[i]) + '');\n }\n var expr = this.expr.toHTML(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')';\n }\n return '' + escape(this.name) + '' + '(' + params.join(',') + ')' + '=' + expr;\n }\n\n /**\n * get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toTex(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = \"\\\\left(\".concat(expr, \"\\\\right)\");\n }\n return '\\\\mathrm{' + this.name + '}\\\\left(' + this.params.map(toSymbol).join(',') + '\\\\right)=' + expr;\n }\n }\n _defineProperty(FunctionAssignmentNode, \"name\", name);\n return FunctionAssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { map } from '../../utils/array.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isArray, isConstantNode, isMatrix, isNode, isString, typeOf } from '../../utils/is.js';\nimport { escape } from '../../utils/string.js';\nvar name = 'IndexNode';\nvar dependencies = ['Node', 'size'];\nexport var createIndexNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node,\n size\n } = _ref;\n class IndexNode extends Node {\n /**\n * @constructor IndexNode\n * @extends Node\n *\n * Describes a subset of a matrix or an object property.\n * Cannot be used on its own, needs to be used within an AccessorNode or\n * AssignmentNode.\n *\n * @param {Node[]} dimensions\n * @param {boolean} [dotNotation=false]\n * Optional property describing whether this index was written using dot\n * notation like `a.b`, or using bracket notation like `a[\"b\"]`\n * (which is the default). This property is used for string conversion.\n */\n constructor(dimensions, dotNotation) {\n super();\n this.dimensions = dimensions;\n this.dotNotation = dotNotation || false;\n\n // validate input\n if (!Array.isArray(dimensions) || !dimensions.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"dimensions\"');\n }\n if (this.dotNotation && !this.isObjectProperty()) {\n throw new Error('dotNotation only applicable for object properties');\n }\n }\n get type() {\n return name;\n }\n get isIndexNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // TODO: implement support for bignumber (currently bignumbers are silently\n // reduced to numbers when changing the value to zero-based)\n\n // TODO: Optimization: when the range values are ConstantNodes,\n // we can beforehand resolve the zero-based value\n\n // optimization for a simple object property\n var evalDimensions = map(this.dimensions, function (dimension, i) {\n var needsEnd = dimension.filter(node => node.isSymbolNode && node.name === 'end').length > 0;\n if (needsEnd) {\n // SymbolNode 'end' is used inside the index,\n // like in `A[end]` or `A[end - 2]`\n var childArgNames = Object.create(argNames);\n childArgNames.end = true;\n var _evalDimension = dimension._compile(math, childArgNames);\n return function evalDimension(scope, args, context) {\n if (!isMatrix(context) && !isArray(context) && !isString(context)) {\n throw new TypeError('Cannot resolve \"end\": ' + 'context must be a Matrix, Array, or string but is ' + typeOf(context));\n }\n var s = size(context).valueOf();\n var childArgs = Object.create(args);\n childArgs.end = s[i];\n return _evalDimension(scope, childArgs, context);\n };\n } else {\n // SymbolNode `end` not used\n return dimension._compile(math, argNames);\n }\n });\n var index = getSafeProperty(math, 'index');\n return function evalIndexNode(scope, args, context) {\n var dimensions = map(evalDimensions, function (evalDimension) {\n return evalDimension(scope, args, context);\n });\n return index(...dimensions);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.dimensions.length; i++) {\n callback(this.dimensions[i], 'dimensions[' + i + ']', this);\n }\n }\n\n /**\n * Create a new IndexNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {IndexNode} Returns a transformed copy of the node\n */\n map(callback) {\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this._ifNode(callback(this.dimensions[i], 'dimensions[' + i + ']', this));\n }\n return new IndexNode(dimensions, this.dotNotation);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {IndexNode}\n */\n clone() {\n return new IndexNode(this.dimensions.slice(0), this.dotNotation);\n }\n\n /**\n * Test whether this IndexNode contains a single property name\n * @return {boolean}\n */\n isObjectProperty() {\n return this.dimensions.length === 1 && isConstantNode(this.dimensions[0]) && typeof this.dimensions[0].value === 'string';\n }\n\n /**\n * Returns the property name if IndexNode contains a property.\n * If not, returns null.\n * @return {string | null}\n */\n getObjectProperty() {\n return this.isObjectProperty() ? this.dimensions[0].value : null;\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n // format the parameters like \"[1, 0:5]\"\n return this.dotNotation ? '.' + this.getObjectProperty() : '[' + this.dimensions.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n dimensions: this.dimensions,\n dotNotation: this.dotNotation\n };\n }\n\n /**\n * Instantiate an IndexNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"IndexNode\", dimensions: [...], dotNotation: false}`,\n * where mathjs is optional\n * @returns {IndexNode}\n */\n static fromJSON(json) {\n return new IndexNode(json.dimensions, json.dotNotation);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n // format the parameters like \"[1, 0:5]\"\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this.dimensions[i].toHTML();\n }\n if (this.dotNotation) {\n return '.' + '' + escape(this.getObjectProperty()) + '';\n } else {\n return '[' + dimensions.join(',') + ']';\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var dimensions = this.dimensions.map(function (range) {\n return range.toTex(options);\n });\n return this.dotNotation ? '.' + this.getObjectProperty() + '' : '_{' + dimensions.join(',') + '}';\n }\n }\n _defineProperty(IndexNode, \"name\", name);\n return IndexNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNode } from '../../utils/is.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { escape, stringify } from '../../utils/string.js';\nvar name = 'ObjectNode';\nvar dependencies = ['Node'];\nexport var createObjectNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ObjectNode extends Node {\n /**\n * @constructor ObjectNode\n * @extends {Node}\n * Holds an object with keys/values\n * @param {Object.} [properties] object with key/value pairs\n */\n constructor(properties) {\n super();\n this.properties = properties || {};\n\n // validate input\n if (properties) {\n if (!(typeof properties === 'object') || !Object.keys(properties).every(function (key) {\n return isNode(properties[key]);\n })) {\n throw new TypeError('Object containing Nodes expected');\n }\n }\n }\n get type() {\n return name;\n }\n get isObjectNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalEntries = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n // we stringify/parse the key here to resolve unicode characters,\n // so you cannot create a key like {\"co\\\\u006Estructor\": null}\n var stringifiedKey = stringify(key);\n var parsedKey = JSON.parse(stringifiedKey);\n var prop = getSafeProperty(this.properties, key);\n evalEntries[parsedKey] = prop._compile(math, argNames);\n }\n }\n return function evalObjectNode(scope, args, context) {\n var obj = {};\n for (var _key in evalEntries) {\n if (hasOwnProperty(evalEntries, _key)) {\n obj[_key] = evalEntries[_key](scope, args, context);\n }\n }\n return obj;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n callback(this.properties[key], 'properties[' + stringify(key) + ']', this);\n }\n }\n }\n\n /**\n * Create a new ObjectNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ObjectNode} Returns a transformed copy of the node\n */\n map(callback) {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this._ifNode(callback(this.properties[key], 'properties[' + stringify(key) + ']', this));\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ObjectNode}\n */\n clone() {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this.properties[key];\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push(stringify(key) + ': ' + this.properties[key].toString(options));\n }\n }\n return '{' + entries.join(', ') + '}';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n properties: this.properties\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ObjectNode\", \"properties\": {...}}`,\n * where mathjs is optional\n * @returns {ObjectNode}\n */\n static fromJSON(json) {\n return new ObjectNode(json.properties);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('' + escape(key) + '' + '' + ':' + this.properties[key].toHTML(options));\n }\n }\n return '{' + entries.join(',') + '}';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('\\\\mathbf{' + key + ':} & ' + this.properties[key].toTex(options) + '\\\\\\\\');\n }\n }\n var tex = '\\\\left\\\\{\\\\begin{array}{ll}' + entries.join('\\n') + '\\\\end{array}\\\\right\\\\}';\n return tex;\n }\n }\n _defineProperty(ObjectNode, \"name\", name);\n return ObjectNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isConstantNode, isOperatorNode, isParenthesisNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty, isSafeMethod } from '../../utils/customs.js';\nimport { getAssociativity, getPrecedence, isAssociativeWith, properties } from '../operators.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'OperatorNode';\nvar dependencies = ['Node'];\nexport var createOperatorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Returns true if the expression starts with a constant, under\n * the current parenthesization:\n * @param {Node} expression\n * @param {string} parenthesis\n * @return {boolean}\n */\n function startsWithConstant(expr, parenthesis) {\n var curNode = expr;\n if (parenthesis === 'auto') {\n while (isParenthesisNode(curNode)) curNode = curNode.content;\n }\n if (isConstantNode(curNode)) return true;\n if (isOperatorNode(curNode)) {\n return startsWithConstant(curNode.args[0], parenthesis);\n }\n return false;\n }\n\n /**\n * Calculate which parentheses are necessary. Gets an OperatorNode\n * (which is the root of the tree) and an Array of Nodes\n * (this.args) and returns an array where 'true' means that an argument\n * has to be enclosed in parentheses whereas 'false' means the opposite.\n *\n * @param {OperatorNode} root\n * @param {string} parenthesis\n * @param {Node[]} args\n * @param {boolean} latex\n * @return {boolean[]}\n * @private\n */\n function calculateNecessaryParentheses(root, parenthesis, implicit, args, latex) {\n // precedence of the root OperatorNode\n var precedence = getPrecedence(root, parenthesis, implicit);\n var associativity = getAssociativity(root, parenthesis);\n if (parenthesis === 'all' || args.length > 2 && root.getIdentifier() !== 'OperatorNode:add' && root.getIdentifier() !== 'OperatorNode:multiply') {\n return args.map(function (arg) {\n switch (arg.getContent().type) {\n // Nodes that don't need extra parentheses\n case 'ArrayNode':\n case 'ConstantNode':\n case 'SymbolNode':\n case 'ParenthesisNode':\n return false;\n default:\n return true;\n }\n });\n }\n var result;\n switch (args.length) {\n case 0:\n result = [];\n break;\n case 1:\n // unary operators\n {\n // precedence of the operand\n var operandPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex && operandPrecedence !== null) {\n var operandIdentifier;\n var rootIdentifier;\n if (parenthesis === 'keep') {\n operandIdentifier = args[0].getIdentifier();\n rootIdentifier = root.getIdentifier();\n } else {\n // Ignore Parenthesis Nodes when not in 'keep' mode\n operandIdentifier = args[0].getContent().getIdentifier();\n rootIdentifier = root.getContent().getIdentifier();\n }\n if (properties[precedence][rootIdentifier].latexLeftParens === false) {\n result = [false];\n break;\n }\n if (properties[operandPrecedence][operandIdentifier].latexParens === false) {\n result = [false];\n break;\n }\n }\n if (operandPrecedence === null) {\n // if the operand has no defined precedence, no parens are needed\n result = [false];\n break;\n }\n if (operandPrecedence <= precedence) {\n // if the operands precedence is lower, parens are needed\n result = [true];\n break;\n }\n\n // otherwise, no parens needed\n result = [false];\n }\n break;\n case 2:\n // binary operators\n {\n var lhsParens; // left hand side needs parenthesis?\n // precedence of the left hand side\n var lhsPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n // is the root node associative with the left hand side\n var assocWithLhs = isAssociativeWith(root, args[0], parenthesis);\n if (lhsPrecedence === null) {\n // if the left hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n lhsParens = false;\n } else if (lhsPrecedence === precedence && associativity === 'right' && !assocWithLhs) {\n // In case of equal precedence, if the root node is left associative\n // parens are **never** necessary for the left hand side.\n // If it is right associative however, parens are necessary\n // if the root node isn't associative with the left hand side\n lhsParens = true;\n } else if (lhsPrecedence < precedence) {\n lhsParens = true;\n } else {\n lhsParens = false;\n }\n var rhsParens; // right hand side needs parenthesis?\n // precedence of the right hand side\n var rhsPrecedence = getPrecedence(args[1], parenthesis, implicit, root);\n // is the root node associative with the right hand side?\n var assocWithRhs = isAssociativeWith(root, args[1], parenthesis);\n if (rhsPrecedence === null) {\n // if the right hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n rhsParens = false;\n } else if (rhsPrecedence === precedence && associativity === 'left' && !assocWithRhs) {\n // In case of equal precedence, if the root node is right associative\n // parens are **never** necessary for the right hand side.\n // If it is left associative however, parens are necessary\n // if the root node isn't associative with the right hand side\n rhsParens = true;\n } else if (rhsPrecedence < precedence) {\n rhsParens = true;\n } else {\n rhsParens = false;\n }\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex) {\n var _rootIdentifier;\n var lhsIdentifier;\n var rhsIdentifier;\n if (parenthesis === 'keep') {\n _rootIdentifier = root.getIdentifier();\n lhsIdentifier = root.args[0].getIdentifier();\n rhsIdentifier = root.args[1].getIdentifier();\n } else {\n // Ignore ParenthesisNodes when not in 'keep' mode\n _rootIdentifier = root.getContent().getIdentifier();\n lhsIdentifier = root.args[0].getContent().getIdentifier();\n rhsIdentifier = root.args[1].getContent().getIdentifier();\n }\n if (lhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexLeftParens === false) {\n lhsParens = false;\n }\n if (properties[lhsPrecedence][lhsIdentifier].latexParens === false) {\n lhsParens = false;\n }\n }\n if (rhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexRightParens === false) {\n rhsParens = false;\n }\n if (properties[rhsPrecedence][rhsIdentifier].latexParens === false) {\n rhsParens = false;\n }\n }\n }\n result = [lhsParens, rhsParens];\n }\n break;\n default:\n if (root.getIdentifier() === 'OperatorNode:add' || root.getIdentifier() === 'OperatorNode:multiply') {\n result = args.map(function (arg) {\n var argPrecedence = getPrecedence(arg, parenthesis, implicit, root);\n var assocWithArg = isAssociativeWith(root, arg, parenthesis);\n var argAssociativity = getAssociativity(arg, parenthesis);\n if (argPrecedence === null) {\n // if the argument has no defined precedence, no parens are needed\n return false;\n } else if (precedence === argPrecedence && associativity === argAssociativity && !assocWithArg) {\n return true;\n } else if (argPrecedence < precedence) {\n return true;\n }\n return false;\n });\n }\n break;\n }\n\n // Handles an edge case of parentheses with implicit multiplication\n // of ConstantNode.\n // In that case, parenthesize ConstantNodes that follow an unparenthesized\n // expression, even though they normally wouldn't be printed.\n if (args.length >= 2 && root.getIdentifier() === 'OperatorNode:multiply' && root.implicit && parenthesis !== 'all' && implicit === 'hide') {\n for (var i = 1; i < result.length; ++i) {\n if (startsWithConstant(args[i], parenthesis) && !result[i - 1] && (parenthesis !== 'keep' || !isParenthesisNode(args[i - 1]))) {\n result[i] = true;\n }\n }\n }\n return result;\n }\n class OperatorNode extends Node {\n /**\n * @constructor OperatorNode\n * @extends {Node}\n * An operator with two arguments, like 2+3\n *\n * @param {string} op Operator name, for example '+'\n * @param {string} fn Function name, for example 'add'\n * @param {Node[]} args Operator arguments\n * @param {boolean} [implicit] Is this an implicit multiplication?\n * @param {boolean} [isPercentage] Is this an percentage Operation?\n */\n constructor(op, fn, args, implicit, isPercentage) {\n super();\n // validate input\n if (typeof op !== 'string') {\n throw new TypeError('string expected for parameter \"op\"');\n }\n if (typeof fn !== 'string') {\n throw new TypeError('string expected for parameter \"fn\"');\n }\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n this.implicit = implicit === true;\n this.isPercentage = isPercentage === true;\n this.op = op;\n this.fn = fn;\n this.args = args || [];\n }\n get type() {\n return name;\n }\n get isOperatorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // validate fn\n if (typeof this.fn !== 'string' || !isSafeMethod(math, this.fn)) {\n if (!math[this.fn]) {\n throw new Error('Function ' + this.fn + ' missing in provided namespace \"math\"');\n } else {\n throw new Error('No access to function \"' + this.fn + '\"');\n }\n }\n var fn = getSafeProperty(math, this.fn);\n var evalArgs = map(this.args, function (arg) {\n return arg._compile(math, argNames);\n });\n if (typeof fn === 'function' && fn.rawArgs === true) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalOperatorNode(scope, args, context) {\n return fn(rawArgs, math, createSubScope(scope, args));\n };\n } else if (evalArgs.length === 1) {\n var evalArg0 = evalArgs[0];\n return function evalOperatorNode(scope, args, context) {\n return fn(evalArg0(scope, args, context));\n };\n } else if (evalArgs.length === 2) {\n var _evalArg = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return function evalOperatorNode(scope, args, context) {\n return fn(_evalArg(scope, args, context), evalArg1(scope, args, context));\n };\n } else {\n return function evalOperatorNode(scope, args, context) {\n return fn.apply(null, map(evalArgs, function (evalArg) {\n return evalArg(scope, args, context);\n }));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new OperatorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new OperatorNode(this.op, this.fn, args, this.implicit, this.isPercentage);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {OperatorNode}\n */\n clone() {\n return new OperatorNode(this.op, this.fn, this.args.slice(0), this.implicit, this.isPercentage);\n }\n\n /**\n * Check whether this is an unary OperatorNode:\n * has exactly one argument, like `-a`.\n * @return {boolean}\n * Returns true when an unary operator node, false otherwise.\n */\n isUnary() {\n return this.args.length === 1;\n }\n\n /**\n * Check whether this is a binary OperatorNode:\n * has exactly two arguments, like `a + b`.\n * @return {boolean}\n * Returns true when a binary operator node, false otherwise.\n */\n isBinary() {\n return this.args.length === 2;\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toString(options);\n if (parens[0]) {\n operand = '(' + operand + ')';\n }\n\n // for example for \"not\", we want a space between operand and argument\n var opIsNamed = /[a-zA-Z]+/.test(this.op);\n if (assoc === 'right') {\n // prefix operator\n return this.op + (opIsNamed ? ' ' : '') + operand;\n } else if (assoc === 'left') {\n // postfix\n return operand + (opIsNamed ? ' ' : '') + this.op;\n }\n\n // fall back to postfix\n return operand + this.op;\n } else if (args.length === 2) {\n var lhs = args[0].toString(options); // left hand side\n var rhs = args[1].toString(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '(' + lhs + ')';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '(' + rhs + ')';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + ' ' + rhs;\n }\n return lhs + ' ' + this.op + ' ' + rhs;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toString(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '(' + arg + ')';\n }\n return arg;\n });\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join(' ');\n }\n return stringifiedArgs.join(' ' + this.op + ' ');\n } else {\n // fallback to formatting as a function call\n return this.fn + '(' + this.args.join(', ') + ')';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n op: this.op,\n fn: this.fn,\n args: this.args,\n implicit: this.implicit,\n isPercentage: this.isPercentage\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"OperatorNode\",\n * \"op\": \"+\", \"fn\": \"add\", \"args\": [...],\n * \"implicit\": false,\n * \"isPercentage\":false}\n * ```\n * where mathjs is optional\n * @returns {OperatorNode}\n */\n static fromJSON(json) {\n return new OperatorNode(json.op, json.fn, json.args, json.implicit, json.isPercentage);\n }\n\n /**\n * Get HTML representation.\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toHTML(options);\n if (parens[0]) {\n operand = '(' + operand + ')';\n }\n if (assoc === 'right') {\n // prefix operator\n return '' + escape(this.op) + '' + operand;\n } else {\n // postfix when assoc === 'left' or undefined\n return operand + '' + escape(this.op) + '';\n }\n } else if (args.length === 2) {\n // binary operatoes\n var lhs = args[0].toHTML(options); // left hand side\n var rhs = args[1].toHTML(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '(' + lhs + ')';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '(' + rhs + ')';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + '' + rhs;\n }\n return lhs + '' + escape(this.op) + '' + rhs;\n } else {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toHTML(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '(' + arg + ')';\n }\n return arg;\n });\n if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join('');\n }\n return stringifiedArgs.join('' + escape(this.op) + '');\n } else {\n // fallback to formatting as a function call\n return '' + escape(this.fn) + '' + '(' + stringifiedArgs.join(',') + ')';\n }\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, true);\n var op = latexOperators[this.fn];\n op = typeof op === 'undefined' ? this.op : op; // fall back to using this.op\n\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toTex(options);\n if (parens[0]) {\n operand = \"\\\\left(\".concat(operand, \"\\\\right)\");\n }\n if (assoc === 'right') {\n // prefix operator\n return op + operand;\n } else if (assoc === 'left') {\n // postfix operator\n return operand + op;\n }\n\n // fall back to postfix\n return operand + op;\n } else if (args.length === 2) {\n // binary operators\n var lhs = args[0]; // left hand side\n var lhsTex = lhs.toTex(options);\n if (parens[0]) {\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n var rhs = args[1]; // right hand side\n var rhsTex = rhs.toTex(options);\n if (parens[1]) {\n rhsTex = \"\\\\left(\".concat(rhsTex, \"\\\\right)\");\n }\n\n // handle some exceptions (due to the way LaTeX works)\n var lhsIdentifier;\n if (parenthesis === 'keep') {\n lhsIdentifier = lhs.getIdentifier();\n } else {\n // Ignore ParenthesisNodes if in 'keep' mode\n lhsIdentifier = lhs.getContent().getIdentifier();\n }\n switch (this.getIdentifier()) {\n case 'OperatorNode:divide':\n // op contains '\\\\frac' at this point\n return op + '{' + lhsTex + '}' + '{' + rhsTex + '}';\n case 'OperatorNode:pow':\n lhsTex = '{' + lhsTex + '}';\n rhsTex = '{' + rhsTex + '}';\n switch (lhsIdentifier) {\n case 'ConditionalNode': //\n case 'OperatorNode:divide':\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n break;\n case 'OperatorNode:multiply':\n if (this.implicit && implicit === 'hide') {\n return lhsTex + '~' + rhsTex;\n }\n }\n return lhsTex + op + rhsTex;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var texifiedArgs = args.map(function (arg, index) {\n arg = arg.toTex(options);\n if (parens[index]) {\n arg = \"\\\\left(\".concat(arg, \"\\\\right)\");\n }\n return arg;\n });\n if (this.getIdentifier() === 'OperatorNode:multiply' && this.implicit && implicit === 'hide') {\n return texifiedArgs.join('~');\n }\n return texifiedArgs.join(op);\n } else {\n // fall back to formatting as a function call\n // as this is a fallback, it doesn't use\n // fancy function names\n return '\\\\mathrm{' + this.fn + '}\\\\left(' + args.map(function (arg) {\n return arg.toTex(options);\n }).join(',') + '\\\\right)';\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.fn;\n }\n }\n _defineProperty(OperatorNode, \"name\", name);\n return OperatorNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { ObjectWrappingMap, PartitionedMap } from './map.js';\n\n/**\n * Create a new scope which can access the parent scope,\n * but does not affect it when written. This is suitable for variable definitions\n * within a block node, or function definition.\n *\n * If parent scope has a createSubScope method, it delegates to that. Otherwise,\n * creates an empty map, and copies the parent scope to it, adding in\n * the remaining `args`.\n *\n * @param {Map} parentScope\n * @param {Object} args\n * @returns {PartitionedMap}\n */\nexport function createSubScope(parentScope, args) {\n return new PartitionedMap(parentScope, new ObjectWrappingMap(args), new Set(Object.keys(args)));\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ParenthesisNode';\nvar dependencies = ['Node'];\nexport var createParenthesisNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ParenthesisNode extends Node {\n /**\n * @constructor ParenthesisNode\n * @extends {Node}\n * A parenthesis node describes manual parenthesis from the user input\n * @param {Node} content\n * @extends {Node}\n */\n constructor(content) {\n super();\n // validate input\n if (!isNode(content)) {\n throw new TypeError('Node expected for parameter \"content\"');\n }\n this.content = content;\n }\n get type() {\n return name;\n }\n get isParenthesisNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n return this.content._compile(math, argNames);\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} content\n * @override\n **/\n getContent() {\n return this.content.getContent();\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.content, 'content', this);\n }\n\n /**\n * Create a new ParenthesisNode whose child is the result of calling\n * the provided callback function on the child of this node.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ParenthesisNode} Returns a clone of the node\n */\n map(callback) {\n var content = callback(this.content, 'content', this);\n return new ParenthesisNode(content);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ParenthesisNode}\n */\n clone() {\n return new ParenthesisNode(this.content);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '(' + this.content.toString(options) + ')';\n }\n return this.content.toString(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n content: this.content\n };\n }\n\n /**\n * Instantiate an ParenthesisNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ParenthesisNode\", \"content\": ...}`,\n * where mathjs is optional\n * @returns {ParenthesisNode}\n */\n static fromJSON(json) {\n return new ParenthesisNode(json.content);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '(' + this.content.toHTML(options) + ')';\n }\n return this.content.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return \"\\\\left(\".concat(this.content.toTex(options), \"\\\\right)\");\n }\n return this.content.toTex(options);\n }\n }\n _defineProperty(ParenthesisNode, \"name\", name);\n return ParenthesisNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'RangeNode';\nvar dependencies = ['Node'];\nexport var createRangeNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Calculate the necessary parentheses\n * @param {Node} node\n * @param {string} parenthesis\n * @param {string} implicit\n * @return {Object} parentheses\n * @private\n */\n function calculateNecessaryParentheses(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var parens = {};\n var startPrecedence = getPrecedence(node.start, parenthesis, implicit);\n parens.start = startPrecedence !== null && startPrecedence <= precedence || parenthesis === 'all';\n if (node.step) {\n var stepPrecedence = getPrecedence(node.step, parenthesis, implicit);\n parens.step = stepPrecedence !== null && stepPrecedence <= precedence || parenthesis === 'all';\n }\n var endPrecedence = getPrecedence(node.end, parenthesis, implicit);\n parens.end = endPrecedence !== null && endPrecedence <= precedence || parenthesis === 'all';\n return parens;\n }\n class RangeNode extends Node {\n /**\n * @constructor RangeNode\n * @extends {Node}\n * create a range\n * @param {Node} start included lower-bound\n * @param {Node} end included upper-bound\n * @param {Node} [step] optional step\n */\n constructor(start, end, step) {\n super();\n // validate inputs\n if (!isNode(start)) throw new TypeError('Node expected');\n if (!isNode(end)) throw new TypeError('Node expected');\n if (step && !isNode(step)) throw new TypeError('Node expected');\n if (arguments.length > 3) throw new Error('Too many arguments');\n this.start = start; // included lower-bound\n this.end = end; // included upper-bound\n this.step = step || null; // optional step\n }\n get type() {\n return name;\n }\n get isRangeNode() {\n return true;\n }\n\n /**\n * Check whether the RangeNode needs the `end` symbol to be defined.\n * This end is the size of the Matrix in current dimension.\n * @return {boolean}\n */\n needsEnd() {\n // find all `end` symbols in this RangeNode\n var endSymbols = this.filter(function (node) {\n return isSymbolNode(node) && node.name === 'end';\n });\n return endSymbols.length > 0;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var range = math.range;\n var evalStart = this.start._compile(math, argNames);\n var evalEnd = this.end._compile(math, argNames);\n if (this.step) {\n var evalStep = this.step._compile(math, argNames);\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context), evalStep(scope, args, context));\n };\n } else {\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.start, 'start', this);\n callback(this.end, 'end', this);\n if (this.step) {\n callback(this.step, 'step', this);\n }\n }\n\n /**\n * Create a new RangeNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RangeNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RangeNode(this._ifNode(callback(this.start, 'start', this)), this._ifNode(callback(this.end, 'end', this)), this.step && this._ifNode(callback(this.step, 'step', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RangeNode}\n */\n clone() {\n return new RangeNode(this.start, this.end, this.step && this.step);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toString(options);\n if (parens.start) {\n start = '(' + start + ')';\n }\n str = start;\n if (this.step) {\n var step = this.step.toString(options);\n if (parens.step) {\n step = '(' + step + ')';\n }\n str += ':' + step;\n }\n var end = this.end.toString(options);\n if (parens.end) {\n end = '(' + end + ')';\n }\n str += ':' + end;\n return str;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n start: this.start,\n end: this.end,\n step: this.step\n };\n }\n\n /**\n * Instantiate an RangeNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RangeNode\", \"start\": ..., \"end\": ..., \"step\": ...}`,\n * where mathjs is optional\n * @returns {RangeNode}\n */\n static fromJSON(json) {\n return new RangeNode(json.start, json.end, json.step);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toHTML(options);\n if (parens.start) {\n start = '(' + start + ')';\n }\n str = start;\n if (this.step) {\n var step = this.step.toHTML(options);\n if (parens.step) {\n step = '(' + step + ')';\n }\n str += ':' + step;\n }\n var end = this.end.toHTML(options);\n if (parens.end) {\n end = '(' + end + ')';\n }\n str += ':' + end;\n return str;\n }\n\n /**\n * Get LaTeX representation\n * @params {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n var str = this.start.toTex(options);\n if (parens.start) {\n str = \"\\\\left(\".concat(str, \"\\\\right)\");\n }\n if (this.step) {\n var step = this.step.toTex(options);\n if (parens.step) {\n step = \"\\\\left(\".concat(step, \"\\\\right)\");\n }\n str += ':' + step;\n }\n var end = this.end.toTex(options);\n if (parens.end) {\n end = \"\\\\left(\".concat(end, \"\\\\right)\");\n }\n str += ':' + end;\n return str;\n }\n }\n _defineProperty(RangeNode, \"name\", name);\n return RangeNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getPrecedence } from '../operators.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'RelationalNode';\nvar dependencies = ['Node'];\nexport var createRelationalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n var operatorMap = {\n equal: '==',\n unequal: '!=',\n smaller: '<',\n larger: '>',\n smallerEq: '<=',\n largerEq: '>='\n };\n class RelationalNode extends Node {\n /**\n * A node representing a chained conditional expression, such as 'x > y > z'\n *\n * @param {String[]} conditionals\n * An array of conditional operators used to compare the parameters\n * @param {Node[]} params\n * The parameters that will be compared\n *\n * @constructor RelationalNode\n * @extends {Node}\n */\n constructor(conditionals, params) {\n super();\n if (!Array.isArray(conditionals)) {\n throw new TypeError('Parameter conditionals must be an array');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Parameter params must be an array');\n }\n if (conditionals.length !== params.length - 1) {\n throw new TypeError('Parameter params must contain exactly one more element ' + 'than parameter conditionals');\n }\n this.conditionals = conditionals;\n this.params = params;\n }\n get type() {\n return name;\n }\n get isRelationalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var self = this;\n var compiled = this.params.map(p => p._compile(math, argNames));\n return function evalRelationalNode(scope, args, context) {\n var evalLhs;\n var evalRhs = compiled[0](scope, args, context);\n for (var i = 0; i < self.conditionals.length; i++) {\n evalLhs = evalRhs;\n evalRhs = compiled[i + 1](scope, args, context);\n var condFn = getSafeProperty(math, self.conditionals[i]);\n if (!condFn(evalLhs, evalRhs)) {\n return false;\n }\n }\n return true;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n this.params.forEach((n, i) => callback(n, 'params[' + i + ']', this), this);\n }\n\n /**\n * Create a new RelationalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RelationalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RelationalNode(this.conditionals.slice(), this.params.map((n, i) => this._ifNode(callback(n, 'params[' + i + ']', this)), this));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RelationalNode}\n */\n clone() {\n return new RelationalNode(this.conditionals, this.params);\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toString(options) + ')' : p.toString(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += ' ' + operatorMap[this.conditionals[i]];\n ret += ' ' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n conditionals: this.conditionals,\n params: this.params\n };\n }\n\n /**\n * Instantiate a RelationalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RelationalNode\", \"conditionals\": ..., \"params\": ...}`,\n * where mathjs is optional\n * @returns {RelationalNode}\n */\n static fromJSON(json) {\n return new RelationalNode(json.conditionals, json.params);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toHTML(options) + ')' : p.toHTML(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += '' + escape(operatorMap[this.conditionals[i]]) + '' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '\\\\left(' + p.toTex(options) + '\\right)' : p.toTex(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += latexOperators[this.conditionals[i]] + paramStrings[i + 1];\n }\n return ret;\n }\n }\n _defineProperty(RelationalNode, \"name\", name);\n return RelationalNode;\n}, {\n isClass: true,\n isNode: true\n});", "import { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { toSymbol } from '../../utils/latex.js';\nvar name = 'SymbolNode';\nvar dependencies = ['math', '?Unit', 'Node'];\nexport var createSymbolNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n math,\n Unit,\n Node\n } = _ref;\n /**\n * Check whether some name is a valueless unit like \"inch\".\n * @param {string} name\n * @return {boolean}\n */\n function isValuelessUnit(name) {\n return Unit ? Unit.isValuelessUnit(name) : false;\n }\n class SymbolNode extends Node {\n /**\n * @constructor SymbolNode\n * @extends {Node}\n * A symbol node can hold and resolve a symbol\n * @param {string} name\n * @extends {Node}\n */\n constructor(name) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n this.name = name;\n }\n get type() {\n return 'SymbolNode';\n }\n get isSymbolNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var name = this.name;\n if (argNames[name] === true) {\n // this is a FunctionAssignment argument\n // (like an x when inside the expression of a function\n // assignment `f(x) = ...`)\n return function (scope, args, context) {\n return getSafeProperty(args, name);\n };\n } else if (name in math) {\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : getSafeProperty(math, name);\n };\n } else {\n var isUnit = isValuelessUnit(name);\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : isUnit ? new Unit(null, name) : SymbolNode.onUndefinedSymbol(name);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new SymbolNode with children produced by the given callback.\n * Trivial since a SymbolNode has no children\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {SymbolNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Throws an error 'Undefined symbol {name}'\n * @param {string} name\n */\n static onUndefinedSymbol(name) {\n throw new Error('Undefined symbol ' + name);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {SymbolNode}\n */\n clone() {\n return new SymbolNode(this.name);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.name;\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var name = escape(this.name);\n if (name === 'true' || name === 'false') {\n return '' + name + '';\n } else if (name === 'i') {\n return '' + name + '';\n } else if (name === 'Infinity') {\n return '' + name + '';\n } else if (name === 'NaN') {\n return '' + name + '';\n } else if (name === 'null') {\n return '' + name + '';\n } else if (name === 'undefined') {\n return '' + name + '';\n }\n return '' + name + '';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: 'SymbolNode',\n name: this.name\n };\n }\n\n /**\n * Instantiate a SymbolNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", name: \"x\"}`,\n * where mathjs is optional\n * @returns {SymbolNode}\n */\n static fromJSON(json) {\n return new SymbolNode(json.name);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n var isUnit = false;\n if (typeof math[this.name] === 'undefined' && isValuelessUnit(this.name)) {\n isUnit = true;\n }\n var symbol = toSymbol(this.name, isUnit);\n if (symbol[0] === '\\\\') {\n // no space needed if the symbol starts with '\\'\n return symbol;\n }\n // the space prevents symbols from breaking stuff like '\\cdot'\n // if it's written right before the symbol\n return ' ' + symbol;\n }\n }\n return SymbolNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isFunctionAssignmentNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { escape, format } from '../../utils/string.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { getSafeProperty, getSafeMethod } from '../../utils/customs.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { factory } from '../../utils/factory.js';\nimport { defaultTemplate, latexFunctions } from '../../utils/latex.js';\nvar name = 'FunctionNode';\nvar dependencies = ['math', 'Node', 'SymbolNode'];\nexport var createFunctionNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var _FunctionNode;\n var {\n math,\n Node,\n SymbolNode\n } = _ref;\n /* format to fixed length */\n var strin = entity => format(entity, {\n truncate: 78\n });\n\n /*\n * Expand a LaTeX template\n *\n * @param {string} template\n * @param {Node} node\n * @param {Object} options\n * @private\n **/\n function expandTemplate(template, node, options) {\n var latex = '';\n\n // Match everything of the form ${identifier} or ${identifier[2]} or $$\n // while submatching identifier and 2 (in the second case)\n var regex = /\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi;\n var inputPos = 0; // position in the input string\n var match;\n while ((match = regex.exec(template)) !== null) {\n // go through all matches\n // add everything in front of the match to the LaTeX string\n latex += template.substring(inputPos, match.index);\n inputPos = match.index;\n if (match[0] === '$$') {\n // escaped dollar sign\n latex += '$';\n inputPos++;\n } else {\n // template parameter\n inputPos += match[0].length;\n var property = node[match[1]];\n if (!property) {\n throw new ReferenceError('Template: Property ' + match[1] + ' does not exist.');\n }\n if (match[2] === undefined) {\n // no square brackets\n switch (typeof property) {\n case 'string':\n latex += property;\n break;\n case 'object':\n if (isNode(property)) {\n latex += property.toTex(options);\n } else if (Array.isArray(property)) {\n // make array of Nodes into comma separated list\n latex += property.map(function (arg, index) {\n if (isNode(arg)) {\n return arg.toTex(options);\n }\n throw new TypeError('Template: ' + match[1] + '[' + index + '] is not a Node.');\n }).join(',');\n } else {\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n break;\n default:\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n } else {\n // with square brackets\n if (isNode(property[match[2]] && property[match[2]])) {\n latex += property[match[2]].toTex(options);\n } else {\n throw new TypeError('Template: ' + match[1] + '[' + match[2] + '] is not a Node.');\n }\n }\n }\n }\n latex += template.slice(inputPos); // append rest of the template\n\n return latex;\n }\n class FunctionNode extends Node {\n /**\n * @constructor FunctionNode\n * @extends {./Node}\n * invoke a list with arguments on a node\n * @param {./Node | string} fn\n * Item resolving to a function on which to invoke\n * the arguments, typically a SymboNode or AccessorNode\n * @param {./Node[]} args\n */\n constructor(fn, args) {\n super();\n if (typeof fn === 'string') {\n fn = new SymbolNode(fn);\n }\n\n // validate input\n if (!isNode(fn)) throw new TypeError('Node expected as parameter \"fn\"');\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n this.fn = fn;\n this.args = args || [];\n }\n\n // readonly property name\n get name() {\n return this.fn.name || '';\n }\n get type() {\n return name;\n }\n get isFunctionNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // compile arguments\n var evalArgs = this.args.map(arg => arg._compile(math, argNames));\n if (isSymbolNode(this.fn)) {\n var _name = this.fn.name;\n if (!argNames[_name]) {\n // we can statically determine whether the function\n // has the rawArgs property\n var fn = _name in math ? getSafeProperty(math, _name) : undefined;\n var isRaw = typeof fn === 'function' && fn.rawArgs === true;\n var resolveFn = scope => {\n var value;\n if (scope.has(_name)) {\n value = scope.get(_name);\n } else if (_name in math) {\n value = getSafeProperty(math, _name);\n } else {\n return FunctionNode.onUndefinedFunction(_name);\n }\n if (typeof value === 'function') {\n return value;\n }\n throw new TypeError(\"'\".concat(_name, \"' is not a function; its value is:\\n \").concat(strin(value)));\n };\n if (isRaw) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n return fn(rawArgs, math, createSubScope(scope, args));\n };\n } else {\n // \"regular\" evaluation\n switch (evalArgs.length) {\n case 0:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n return fn();\n };\n case 1:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var evalArg0 = evalArgs[0];\n return fn(evalArg0(scope, args, context));\n };\n case 2:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var evalArg0 = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return fn(evalArg0(scope, args, context), evalArg1(scope, args, context));\n };\n default:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn(...values);\n };\n }\n }\n } else {\n // the function symbol is an argName\n var _rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = getSafeProperty(args, _name);\n if (typeof fn !== 'function') {\n throw new TypeError(\"Argument '\".concat(_name, \"' was not a function; received: \").concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs, math, createSubScope(scope, args));\n } else {\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n } else if (isAccessorNode(this.fn) && isIndexNode(this.fn.index) && this.fn.index.isObjectProperty()) {\n // execute the function with the right context:\n // the object of the AccessorNode\n\n var evalObject = this.fn.object._compile(math, argNames);\n var prop = this.fn.index.getObjectProperty();\n var _rawArgs2 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n var fn = getSafeMethod(object, prop);\n if (fn !== null && fn !== void 0 && fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs2, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(object, values);\n }\n };\n } else {\n // node.fn.isAccessorNode && !node.fn.index.isObjectProperty()\n // we have to dynamically determine whether the function has the\n // rawArgs property\n var fnExpr = this.fn.toString();\n var evalFn = this.fn._compile(math, argNames);\n var _rawArgs3 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = evalFn(scope, args, context);\n if (typeof fn !== 'function') {\n throw new TypeError(\"Expression '\".concat(fnExpr, \"' did not evaluate to a function; value is:\") + \"\\n \".concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs3, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.fn, 'fn', this);\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new FunctionNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionNode} Returns a transformed copy of the node\n */\n map(callback) {\n var fn = this._ifNode(callback(this.fn, 'fn', this));\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new FunctionNode(fn, args);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionNode}\n */\n clone() {\n return new FunctionNode(this.fn, this.args.slice(0));\n }\n\n /**\n * Throws an error 'Undefined function {name}'\n * @param {string} name\n */\n\n /**\n * Get string representation. (wrapper function)\n * This overrides parts of Node's toString function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toString\n * function.\n *\n * @param {Object} options\n * @return {string} str\n * @override\n */\n toString(options) {\n var customString;\n var name = this.fn.toString(options);\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, name)) {\n // callback is a map of callback functions\n customString = options.handler[name](this, options);\n }\n if (typeof customString !== 'undefined') {\n return customString;\n }\n\n // fall back to Node's toString\n return super.toString(options);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var args = this.args.map(function (arg) {\n return arg.toString(options);\n });\n var fn = isFunctionAssignmentNode(this.fn) ? '(' + this.fn.toString(options) + ')' : this.fn.toString(options);\n\n // format the arguments like \"add(2, 4.2)\"\n return fn + '(' + args.join(', ') + ')';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n fn: this.fn,\n args: this.args\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"FunctionNode\", fn: ..., args: ...}`,\n * where mathjs is optional\n * @returns {FunctionNode}\n */\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var args = this.args.map(function (arg) {\n return arg.toHTML(options);\n });\n\n // format the arguments like \"add(2, 4.2)\"\n return '' + escape(this.fn) + '(' + args.join(',') + ')';\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n * This overrides parts of Node's toTex function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toTex\n * function.\n *\n * @param {Object} options\n * @return {string}\n */\n toTex(options) {\n var customTex;\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, this.name)) {\n // callback is a map of callback functions\n customTex = options.handler[this.name](this, options);\n }\n if (typeof customTex !== 'undefined') {\n return customTex;\n }\n\n // fall back to Node's toTex\n return super.toTex(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var args = this.args.map(function (arg) {\n // get LaTeX of the arguments\n return arg.toTex(options);\n });\n var latexConverter;\n if (latexFunctions[this.name]) {\n latexConverter = latexFunctions[this.name];\n }\n\n // toTex property on the function itself\n if (math[this.name] && (typeof math[this.name].toTex === 'function' || typeof math[this.name].toTex === 'object' || typeof math[this.name].toTex === 'string')) {\n // .toTex is a callback function\n latexConverter = math[this.name].toTex;\n }\n var customToTex;\n switch (typeof latexConverter) {\n case 'function':\n // a callback function\n customToTex = latexConverter(this, options);\n break;\n case 'string':\n // a template string\n customToTex = expandTemplate(latexConverter, this, options);\n break;\n case 'object':\n // an object with different \"converters\" for different\n // numbers of arguments\n switch (typeof latexConverter[args.length]) {\n case 'function':\n customToTex = latexConverter[args.length](this, options);\n break;\n case 'string':\n customToTex = expandTemplate(latexConverter[args.length], this, options);\n break;\n }\n }\n if (typeof customToTex !== 'undefined') {\n return customToTex;\n }\n return expandTemplate(defaultTemplate, this, options);\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.name;\n }\n }\n _FunctionNode = FunctionNode;\n _defineProperty(FunctionNode, \"name\", name);\n _defineProperty(FunctionNode, \"onUndefinedFunction\", function (name) {\n throw new Error('Undefined function ' + name);\n });\n _defineProperty(FunctionNode, \"fromJSON\", function (json) {\n return new _FunctionNode(json.fn, json.args);\n });\n return FunctionNode;\n}, {\n isClass: true,\n isNode: true\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../utils/factory.js';\nimport { isAccessorNode, isConstantNode, isFunctionNode, isOperatorNode, isSymbolNode, rule2Node } from '../utils/is.js';\nimport { deepMap } from '../utils/collection.js';\nimport { safeNumberType } from '../utils/number.js';\nimport { hasOwnProperty } from '../utils/object.js';\nvar name = 'parse';\nvar dependencies = ['typed', 'numeric', 'config', 'AccessorNode', 'ArrayNode', 'AssignmentNode', 'BlockNode', 'ConditionalNode', 'ConstantNode', 'FunctionAssignmentNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'RangeNode', 'RelationalNode', 'SymbolNode'];\nexport var createParse = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n numeric,\n config,\n AccessorNode,\n ArrayNode,\n AssignmentNode,\n BlockNode,\n ConditionalNode,\n ConstantNode,\n FunctionAssignmentNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n RangeNode,\n RelationalNode,\n SymbolNode\n } = _ref;\n /**\n * Parse an expression. Returns a node tree, which can be evaluated by\n * invoking node.evaluate().\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.parse(expr)\n * math.parse(expr, options)\n * math.parse([expr1, expr2, expr3, ...])\n * math.parse([expr1, expr2, expr3, ...], options)\n *\n * Example:\n *\n * const node1 = math.parse('sqrt(3^2 + 4^2)')\n * node1.compile().evaluate() // 5\n *\n * let scope = {a:3, b:4}\n * const node2 = math.parse('a * b') // 12\n * const code2 = node2.compile()\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.parse(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].compile().evaluate() // 12\n *\n * See also:\n *\n * evaluate, compile\n *\n * @param {string | string[] | Matrix} expr Expression to be parsed\n * @param {{nodes: Object}} [options] Available options:\n * - `nodes` a set of custom nodes\n * @return {Node | Node[]} node\n * @throws {Error}\n */\n var parse = typed(name, {\n string: function string(expression) {\n return parseStart(expression, {});\n },\n 'Array | Matrix': function ArrayMatrix(expressions) {\n return parseMultiple(expressions, {});\n },\n 'string, Object': function stringObject(expression, options) {\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n return parseStart(expression, extraNodes);\n },\n 'Array | Matrix, Object': parseMultiple\n });\n function parseMultiple(expressions) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n\n // parse an array or matrix with expressions\n return deepMap(expressions, function (elem) {\n if (typeof elem !== 'string') throw new TypeError('String expected');\n return parseStart(elem, extraNodes);\n });\n }\n\n // token types enumeration\n var TOKENTYPE = {\n NULL: 0,\n DELIMITER: 1,\n NUMBER: 2,\n SYMBOL: 3,\n UNKNOWN: 4\n };\n\n // map with all delimiters\n var DELIMITERS = {\n ',': true,\n '(': true,\n ')': true,\n '[': true,\n ']': true,\n '{': true,\n '}': true,\n '\"': true,\n '\\'': true,\n ';': true,\n '+': true,\n '-': true,\n '*': true,\n '.*': true,\n '/': true,\n './': true,\n '%': true,\n '^': true,\n '.^': true,\n '~': true,\n '!': true,\n '&': true,\n '|': true,\n '^|': true,\n '=': true,\n ':': true,\n '?': true,\n '==': true,\n '!=': true,\n '<': true,\n '>': true,\n '<=': true,\n '>=': true,\n '<<': true,\n '>>': true,\n '>>>': true\n };\n\n // map with all named delimiters\n var NAMED_DELIMITERS = {\n mod: true,\n to: true,\n in: true,\n and: true,\n xor: true,\n or: true,\n not: true\n };\n var CONSTANTS = {\n true: true,\n false: false,\n null: null,\n undefined\n };\n var NUMERIC_CONSTANTS = ['NaN', 'Infinity'];\n var ESCAPE_CHARACTERS = {\n '\"': '\"',\n \"'\": \"'\",\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t'\n // note that \\u is handled separately in parseStringToken()\n };\n function initialState() {\n return {\n extraNodes: {},\n // current extra nodes, must be careful not to mutate\n expression: '',\n // current expression\n comment: '',\n // last parsed comment\n index: 0,\n // current index in expr\n token: '',\n // current token\n tokenType: TOKENTYPE.NULL,\n // type of the token\n nestingLevel: 0,\n // level of nesting inside parameters, used to ignore newline characters\n conditionalLevel: null // when a conditional is being parsed, the level of the conditional is stored here\n };\n }\n\n /**\n * View upto `length` characters of the expression starting at the current character.\n *\n * @param {Object} state\n * @param {number} [length=1] Number of characters to view\n * @returns {string}\n * @private\n */\n function currentString(state, length) {\n return state.expression.substr(state.index, length);\n }\n\n /**\n * View the current character. Returns '' if end of expression is reached.\n *\n * @param {Object} state\n * @returns {string}\n * @private\n */\n function currentCharacter(state) {\n return currentString(state, 1);\n }\n\n /**\n * Get the next character from the expression.\n * The character is stored into the char c. If the end of the expression is\n * reached, the function puts an empty string in c.\n * @private\n */\n function next(state) {\n state.index++;\n }\n\n /**\n * Preview the previous character from the expression.\n * @return {string} cNext\n * @private\n */\n function prevCharacter(state) {\n return state.expression.charAt(state.index - 1);\n }\n\n /**\n * Preview the next character from the expression.\n * @return {string} cNext\n * @private\n */\n function nextCharacter(state) {\n return state.expression.charAt(state.index + 1);\n }\n\n /**\n * Get next token in the current string expr.\n * The token and token type are available as token and tokenType\n * @private\n */\n function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = '';\n\n // skip over ignored characters:\n while (true) {\n // comments:\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n }\n // whitespace: space, tab, and newline when inside parameters\n if (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } else {\n break;\n }\n }\n\n // check for end of expression\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 2 characters\n if (c2.length === 2 && DELIMITERS[c2]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER;\n\n // check for binary, octal, or hex\n var _c = currentString(state, 2);\n if (_c === '0b' || _c === '0o' || _c === '0x') {\n state.token += currentCharacter(state);\n next(state);\n state.token += currentCharacter(state);\n next(state);\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.';\n next(state);\n // get the digits after the radix\n while (parse.isHexDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i';\n next(state);\n // get the word size\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n return;\n }\n\n // get number, can have a single dot\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n }\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (nextCharacter(state) === '.') {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (hasOwnProperty(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n state.tokenType = TOKENTYPE.UNKNOWN;\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }\n\n /**\n * Get next token and skip newline tokens\n */\n function getTokenSkipNewline(state) {\n do {\n getToken(state);\n } while (state.token === '\\n'); // eslint-disable-line no-unmodified-loop-condition\n }\n\n /**\n * Open parameters.\n * New line characters will be ignored until closeParams(state) is called\n */\n function openParams(state) {\n state.nestingLevel++;\n }\n\n /**\n * Close parameters.\n * New line characters will no longer be ignored\n */\n function closeParams(state) {\n state.nestingLevel--;\n }\n\n /**\n * Checks whether the current character `c` is a valid alpha character:\n *\n * - A latin letter (upper or lower case) Ascii: a-z, A-Z\n * - An underscore Ascii: _\n * - A dollar sign Ascii: $\n * - A latin letter with accents Unicode: \\u00C0 - \\u02AF\n * - A greek letter Unicode: \\u0370 - \\u03FF\n * - A mathematical alphanumeric symbol Unicode: \\u{1D400} - \\u{1D7FF} excluding invalid code points\n *\n * The previous and next characters are needed to determine whether\n * this character is part of a unicode surrogate pair.\n *\n * @param {string} c Current character in the expression\n * @param {string} cPrev Previous character\n * @param {string} cNext Next character\n * @return {boolean}\n */\n parse.isAlpha = function isAlpha(c, cPrev, cNext) {\n return parse.isValidLatinOrGreek(c) || parse.isValidMathSymbol(c, cNext) || parse.isValidMathSymbol(cPrev, c);\n };\n\n /**\n * Test whether a character is a valid latin, greek, or letter-like character\n * @param {string} c\n * @return {boolean}\n */\n parse.isValidLatinOrGreek = function isValidLatinOrGreek(c) {\n return /^[a-zA-Z_$\\u00C0-\\u02AF\\u0370-\\u03FF\\u2100-\\u214F]$/.test(c);\n };\n\n /**\n * Test whether two given 16 bit characters form a surrogate pair of a\n * unicode math symbol.\n *\n * https://unicode-table.com/en/\n * https://www.wikiwand.com/en/Mathematical_operators_and_symbols_in_Unicode\n *\n * Note: In ES6 will be unicode aware:\n * https://stackoverflow.com/questions/280712/javascript-unicode-regexes\n * https://mathiasbynens.be/notes/es6-unicode-regex\n *\n * @param {string} high\n * @param {string} low\n * @return {boolean}\n */\n parse.isValidMathSymbol = function isValidMathSymbol(high, low) {\n return /^[\\uD835]$/.test(high) && /^[\\uDC00-\\uDFFF]$/.test(low) && /^[^\\uDC55\\uDC9D\\uDCA0\\uDCA1\\uDCA3\\uDCA4\\uDCA7\\uDCA8\\uDCAD\\uDCBA\\uDCBC\\uDCC4\\uDD06\\uDD0B\\uDD0C\\uDD15\\uDD1D\\uDD3A\\uDD3F\\uDD45\\uDD47-\\uDD49\\uDD51\\uDEA6\\uDEA7\\uDFCC\\uDFCD]$/.test(low);\n };\n\n /**\n * Check whether given character c is a white space character: space, tab, or enter\n * @param {string} c\n * @param {number} nestingLevel\n * @return {boolean}\n */\n parse.isWhitespace = function isWhitespace(c, nestingLevel) {\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n return c === ' ' || c === '\\t' || c === '\\n' && nestingLevel > 0;\n };\n\n /**\n * Test whether the character c is a decimal mark (dot).\n * This is the case when it's not the start of a delimiter '.*', './', or '.^'\n * @param {string} c\n * @param {string} cNext\n * @return {boolean}\n */\n parse.isDecimalMark = function isDecimalMark(c, cNext) {\n return c === '.' && cNext !== '/' && cNext !== '*' && cNext !== '^';\n };\n\n /**\n * checks if the given char c is a digit or dot\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigitDot = function isDigitDot(c) {\n return c >= '0' && c <= '9' || c === '.';\n };\n\n /**\n * checks if the given char c is a digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigit = function isDigit(c) {\n return c >= '0' && c <= '9';\n };\n\n /**\n * checks if the given char c is a hex digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isHexDigit = function isHexDigit(c) {\n return c >= '0' && c <= '9' || c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F';\n };\n\n /**\n * Start of the parse levels below, in order of precedence\n * @return {Node} node\n * @private\n */\n function parseStart(expression, extraNodes) {\n var state = initialState();\n _extends(state, {\n expression,\n extraNodes\n });\n getToken(state);\n var node = parseBlock(state);\n\n // check for garbage at the end of the expression\n // an expression ends with a empty character '' and tokenType DELIMITER\n if (state.token !== '') {\n if (state.tokenType === TOKENTYPE.DELIMITER) {\n // user entered a not existing operator like \"//\"\n\n // TODO: give hints for aliases, for example with \"<>\" give as hint \" did you mean !== ?\"\n throw createError(state, 'Unexpected operator ' + state.token);\n } else {\n throw createSyntaxError(state, 'Unexpected part \"' + state.token + '\"');\n }\n }\n return node;\n }\n\n /**\n * Parse a block with expressions. Expressions can be separated by a newline\n * character '\\n', or by a semicolon ';'. In case of a semicolon, no output\n * of the preceding line is returned.\n * @return {Node} node\n * @private\n */\n function parseBlock(state) {\n var node;\n var blocks = [];\n var visible;\n if (state.token !== '' && state.token !== '\\n' && state.token !== ';') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n\n // TODO: simplify this loop\n while (state.token === '\\n' || state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n if (blocks.length === 0 && node) {\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n getToken(state);\n if (state.token !== '\\n' && state.token !== ';' && state.token !== '') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n }\n if (blocks.length > 0) {\n return new BlockNode(blocks);\n } else {\n if (!node) {\n node = new ConstantNode(undefined);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n return node;\n }\n }\n\n /**\n * Assignment of a function or variable,\n * - can be a variable like 'a=2.3'\n * - or a updating an existing variable like 'matrix(2,3:5)=[6,7,8]'\n * - defining a function like 'f(x) = x^2'\n * @return {Node} node\n * @private\n */\n function parseAssignment(state) {\n var name, args, value, valid;\n var node = parseConditional(state);\n if (state.token === '=') {\n if (isSymbolNode(node)) {\n // parse a variable assignment like 'a = 2/3'\n name = node.name;\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(new SymbolNode(name), value);\n } else if (isAccessorNode(node)) {\n // parse a matrix subset assignment like 'A[1,2] = 4'\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(node.object, node.index, value);\n } else if (isFunctionNode(node) && isSymbolNode(node.fn)) {\n // parse function assignment like 'f(x) = x^2'\n valid = true;\n args = [];\n name = node.name;\n node.args.forEach(function (arg, index) {\n if (isSymbolNode(arg)) {\n args[index] = arg.name;\n } else {\n valid = false;\n }\n });\n if (valid) {\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new FunctionAssignmentNode(name, args, value);\n }\n }\n throw createSyntaxError(state, 'Invalid left hand side of assignment operator =');\n }\n return node;\n }\n\n /**\n * conditional operation\n *\n * condition ? truePart : falsePart\n *\n * Note: conditional operator is right-associative\n *\n * @return {Node} node\n * @private\n */\n function parseConditional(state) {\n var node = parseLogicalOr(state);\n while (state.token === '?') {\n // eslint-disable-line no-unmodified-loop-condition\n // set a conditional level, the range operator will be ignored as long\n // as conditionalLevel === state.nestingLevel.\n var prev = state.conditionalLevel;\n state.conditionalLevel = state.nestingLevel;\n getTokenSkipNewline(state);\n var condition = node;\n var trueExpr = parseAssignment(state);\n if (state.token !== ':') throw createSyntaxError(state, 'False part of conditional expression expected');\n state.conditionalLevel = null;\n getTokenSkipNewline(state);\n var falseExpr = parseAssignment(state); // Note: check for conditional operator again, right associativity\n\n node = new ConditionalNode(condition, trueExpr, falseExpr);\n\n // restore the previous conditional level\n state.conditionalLevel = prev;\n }\n return node;\n }\n\n /**\n * logical or, 'x or y'\n * @return {Node} node\n * @private\n */\n function parseLogicalOr(state) {\n var node = parseLogicalXor(state);\n while (state.token === 'or') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('or', 'or', [node, parseLogicalXor(state)]);\n }\n return node;\n }\n\n /**\n * logical exclusive or, 'x xor y'\n * @return {Node} node\n * @private\n */\n function parseLogicalXor(state) {\n var node = parseLogicalAnd(state);\n while (state.token === 'xor') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('xor', 'xor', [node, parseLogicalAnd(state)]);\n }\n return node;\n }\n\n /**\n * logical and, 'x and y'\n * @return {Node} node\n * @private\n */\n function parseLogicalAnd(state) {\n var node = parseBitwiseOr(state);\n while (state.token === 'and') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('and', 'and', [node, parseBitwiseOr(state)]);\n }\n return node;\n }\n\n /**\n * bitwise or, 'x | y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseOr(state) {\n var node = parseBitwiseXor(state);\n while (state.token === '|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('|', 'bitOr', [node, parseBitwiseXor(state)]);\n }\n return node;\n }\n\n /**\n * bitwise exclusive or (xor), 'x ^| y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseXor(state) {\n var node = parseBitwiseAnd(state);\n while (state.token === '^|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('^|', 'bitXor', [node, parseBitwiseAnd(state)]);\n }\n return node;\n }\n\n /**\n * bitwise and, 'x & y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseAnd(state) {\n var node = parseRelational(state);\n while (state.token === '&') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('&', 'bitAnd', [node, parseRelational(state)]);\n }\n return node;\n }\n\n /**\n * Parse a chained conditional, like 'a > b >= c'\n * @return {Node} node\n */\n function parseRelational(state) {\n var params = [parseShift(state)];\n var conditionals = [];\n var operators = {\n '==': 'equal',\n '!=': 'unequal',\n '<': 'smaller',\n '>': 'larger',\n '<=': 'smallerEq',\n '>=': 'largerEq'\n };\n while (hasOwnProperty(operators, state.token)) {\n // eslint-disable-line no-unmodified-loop-condition\n var cond = {\n name: state.token,\n fn: operators[state.token]\n };\n conditionals.push(cond);\n getTokenSkipNewline(state);\n params.push(parseShift(state));\n }\n if (params.length === 1) {\n return params[0];\n } else if (params.length === 2) {\n return new OperatorNode(conditionals[0].name, conditionals[0].fn, params);\n } else {\n return new RelationalNode(conditionals.map(c => c.fn), params);\n }\n }\n\n /**\n * Bitwise left shift, bitwise right arithmetic shift, bitwise right logical shift\n * @return {Node} node\n * @private\n */\n function parseShift(state) {\n var node, name, fn, params;\n node = parseConversion(state);\n var operators = {\n '<<': 'leftShift',\n '>>': 'rightArithShift',\n '>>>': 'rightLogShift'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n params = [node, parseConversion(state)];\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * conversion operators 'to' and 'in'\n * @return {Node} node\n * @private\n */\n function parseConversion(state) {\n var node, name, fn, params;\n node = parseRange(state);\n var operators = {\n to: 'to',\n in: 'to' // alias of 'to'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n if (name === 'in' && state.token === '') {\n // end of expression -> this is the unit 'in' ('inch')\n node = new OperatorNode('*', 'multiply', [node, new SymbolNode('in')], true);\n } else {\n // operator 'a to b' or 'a in b'\n params = [node, parseRange(state)];\n node = new OperatorNode(name, fn, params);\n }\n }\n return node;\n }\n\n /**\n * parse range, \"start:end\", \"start:step:end\", \":\", \"start:\", \":end\", etc\n * @return {Node} node\n * @private\n */\n function parseRange(state) {\n var node;\n var params = [];\n if (state.token === ':') {\n // implicit start=1 (one-based)\n node = new ConstantNode(1);\n } else {\n // explicit start\n node = parseAddSubtract(state);\n }\n if (state.token === ':' && state.conditionalLevel !== state.nestingLevel) {\n // we ignore the range operator when a conditional operator is being processed on the same level\n params.push(node);\n\n // parse step and end\n while (state.token === ':' && params.length < 3) {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n if (state.token === ')' || state.token === ']' || state.token === ',' || state.token === '') {\n // implicit end\n params.push(new SymbolNode('end'));\n } else {\n // explicit end\n params.push(parseAddSubtract(state));\n }\n }\n if (params.length === 3) {\n // params = [start, step, end]\n node = new RangeNode(params[0], params[2], params[1]); // start, end, step\n } else {\n // length === 2\n // params = [start, end]\n node = new RangeNode(params[0], params[1]); // start, end\n }\n }\n return node;\n }\n\n /**\n * add or subtract\n * @return {Node} node\n * @private\n */\n function parseAddSubtract(state) {\n var node, name, fn, params;\n node = parseMultiplyDivide(state);\n var operators = {\n '+': 'add',\n '-': 'subtract'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n var rightNode = parseMultiplyDivide(state);\n if (rightNode.isPercentage) {\n params = [node, new OperatorNode('*', 'multiply', [node, rightNode])];\n } else {\n params = [node, rightNode];\n }\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * multiply, divide\n * @return {Node} node\n * @private\n */\n function parseMultiplyDivide(state) {\n var node, last, name, fn;\n node = parseImplicitMultiplication(state);\n last = node;\n var operators = {\n '*': 'multiply',\n '.*': 'dotMultiply',\n '/': 'divide',\n './': 'dotDivide'\n };\n while (true) {\n if (hasOwnProperty(operators, state.token)) {\n // explicit operators\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n last = parseImplicitMultiplication(state);\n node = new OperatorNode(name, fn, [node, last]);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * implicit multiplication\n * @return {Node} node\n * @private\n */\n function parseImplicitMultiplication(state) {\n var node, last;\n node = parseRule2(state);\n last = node;\n while (true) {\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === 'in' && isConstantNode(node) || state.tokenType === TOKENTYPE.NUMBER && !isConstantNode(last) && (!isOperatorNode(last) || last.op === '!') || state.token === '(') {\n // parse implicit multiplication\n //\n // symbol: implicit multiplication like '2a', '(2+3)a', 'a b'\n // number: implicit multiplication like '(2+3)2'\n // parenthesis: implicit multiplication like '2(3+4)', '(3+4)(1+2)'\n last = parseRule2(state);\n node = new OperatorNode('*', 'multiply', [node, last], true /* implicit */);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * Infamous \"rule 2\" as described in https://github.com/josdejong/mathjs/issues/792#issuecomment-361065370\n * And as amended in https://github.com/josdejong/mathjs/issues/2370#issuecomment-1054052164\n * Explicit division gets higher precedence than implicit multiplication\n * when the division matches this pattern:\n * [unaryPrefixOp]?[number] / [number] [symbol]\n * @return {Node} node\n * @private\n */\n function parseRule2(state) {\n var node = parseModulusPercentage(state);\n var last = node;\n var tokenStates = [];\n while (true) {\n // Match the \"number /\" part of the pattern \"number / number symbol\"\n if (state.token === '/' && rule2Node(last)) {\n // Look ahead to see if the next token is a number\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"number / number\" part of the pattern\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // Look ahead again\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"symbol\" part of the pattern, or a left parenthesis\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === '(') {\n // We've matched the pattern \"number / number symbol\".\n // Rewind once and build the \"number / number\" node; the symbol will be consumed later\n _extends(state, tokenStates.pop());\n tokenStates.pop();\n last = parseModulusPercentage(state);\n node = new OperatorNode('/', 'divide', [node, last]);\n } else {\n // Not a match, so rewind\n tokenStates.pop();\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n // Not a match, so rewind\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * modulus and percentage\n * @return {Node} node\n * @private\n */\n function parseModulusPercentage(state) {\n var node, name, fn, params;\n node = parseUnary(state);\n var operators = {\n '%': 'mod',\n mod: 'mod'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n if (name === '%' && state.tokenType === TOKENTYPE.DELIMITER && state.token !== '(') {\n // If the expression contains only %, then treat that as /100\n node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true);\n } else {\n params = [node, parseUnary(state)];\n node = new OperatorNode(name, fn, params);\n }\n }\n return node;\n }\n\n /**\n * Unary plus and minus, and logical and bitwise not\n * @return {Node} node\n * @private\n */\n function parseUnary(state) {\n var name, params, fn;\n var operators = {\n '-': 'unaryMinus',\n '+': 'unaryPlus',\n '~': 'bitNot',\n not: 'not'\n };\n if (hasOwnProperty(operators, state.token)) {\n fn = operators[state.token];\n name = state.token;\n getTokenSkipNewline(state);\n params = [parseUnary(state)];\n return new OperatorNode(name, fn, params);\n }\n return parsePow(state);\n }\n\n /**\n * power\n * Note: power operator is right associative\n * @return {Node} node\n * @private\n */\n function parsePow(state) {\n var node, name, fn, params;\n node = parseLeftHandOperators(state);\n if (state.token === '^' || state.token === '.^') {\n name = state.token;\n fn = name === '^' ? 'pow' : 'dotPow';\n getTokenSkipNewline(state);\n params = [node, parseUnary(state)]; // Go back to unary, we can have '2^-3'\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * Left hand operators: factorial x!, ctranspose x'\n * @return {Node} node\n * @private\n */\n function parseLeftHandOperators(state) {\n var node, name, fn, params;\n node = parseCustomNodes(state);\n var operators = {\n '!': 'factorial',\n '\\'': 'ctranspose'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getToken(state);\n params = [node];\n node = new OperatorNode(name, fn, params);\n node = parseAccessors(state, node);\n }\n return node;\n }\n\n /**\n * Parse a custom node handler. A node handler can be used to process\n * nodes in a custom way, for example for handling a plot.\n *\n * A handler must be passed as second argument of the parse function.\n * - must extend math.Node\n * - must contain a function _compile(defs: Object) : string\n * - must contain a function find(filter: Object) : Node[]\n * - must contain a function toString() : string\n * - the constructor is called with a single argument containing all parameters\n *\n * For example:\n *\n * nodes = {\n * 'plot': PlotHandler\n * }\n *\n * The constructor of the handler is called as:\n *\n * node = new PlotHandler(params)\n *\n * The handler will be invoked when evaluating an expression like:\n *\n * node = math.parse('plot(sin(x), x)', nodes)\n *\n * @return {Node} node\n * @private\n */\n function parseCustomNodes(state) {\n var params = [];\n if (state.tokenType === TOKENTYPE.SYMBOL && hasOwnProperty(state.extraNodes, state.token)) {\n var CustomNode = state.extraNodes[state.token];\n getToken(state);\n\n // parse parameters\n if (state.token === '(') {\n params = [];\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n }\n\n // create a new custom node\n // noinspection JSValidateTypes\n return new CustomNode(params);\n }\n return parseSymbol(state);\n }\n\n /**\n * parse symbols: functions, variables, constants, units\n * @return {Node} node\n * @private\n */\n function parseSymbol(state) {\n var node, name;\n if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n name = state.token;\n getToken(state);\n if (hasOwnProperty(CONSTANTS, name)) {\n // true, false, null, ...\n node = new ConstantNode(CONSTANTS[name]);\n } else if (NUMERIC_CONSTANTS.includes(name)) {\n // NaN, Infinity\n node = new ConstantNode(numeric(name, 'number'));\n } else {\n node = new SymbolNode(name);\n }\n\n // parse function parameters and matrix index\n node = parseAccessors(state, node);\n return node;\n }\n return parseString(state);\n }\n\n /**\n * parse accessors:\n * - function invocation in round brackets (...), for example sqrt(2)\n * - index enclosed in square brackets [...], for example A[2,3]\n * - dot notation for properties, like foo.bar\n * @param {Object} state\n * @param {Node} node Node on which to apply the parameters. If there\n * are no parameters in the expression, the node\n * itself is returned\n * @param {string[]} [types] Filter the types of notations\n * can be ['(', '[', '.']\n * @return {Node} node\n * @private\n */\n function parseAccessors(state, node, types) {\n var params;\n while ((state.token === '(' || state.token === '[' || state.token === '.') && (!types || types.includes(state.token))) {\n // eslint-disable-line no-unmodified-loop-condition\n params = [];\n if (state.token === '(') {\n if (isSymbolNode(node) || isAccessorNode(node)) {\n // function invocation like fn(2, 3) or obj.fn(2, 3)\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new FunctionNode(node, params);\n } else {\n // implicit multiplication like (2+3)(4+5) or sqrt(2)(1+2)\n // don't parse it here but let it be handled by parseImplicitMultiplication\n // with correct precedence\n return node;\n }\n } else if (state.token === '[') {\n // index notation like variable[2, 3]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'Parenthesis ] expected');\n }\n closeParams(state);\n getToken(state);\n node = new AccessorNode(node, new IndexNode(params));\n } else {\n // dot notation like variable.prop\n getToken(state);\n var isPropertyName = state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS;\n if (!isPropertyName) {\n throw createSyntaxError(state, 'Property name expected after dot');\n }\n params.push(new ConstantNode(state.token));\n getToken(state);\n var dotNotation = true;\n node = new AccessorNode(node, new IndexNode(params, dotNotation));\n }\n }\n return node;\n }\n\n /**\n * Parse a single or double quoted string.\n * @return {Node} node\n * @private\n */\n function parseString(state) {\n var node, str;\n if (state.token === '\"' || state.token === \"'\") {\n str = parseStringToken(state, state.token);\n\n // create constant\n node = new ConstantNode(str);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseMatrix(state);\n }\n\n /**\n * Parse a string surrounded by single or double quotes\n * @param {Object} state\n * @param {\"'\" | \"\\\"\"} quote\n * @return {string}\n */\n function parseStringToken(state, quote) {\n var str = '';\n while (currentCharacter(state) !== '' && currentCharacter(state) !== quote) {\n if (currentCharacter(state) === '\\\\') {\n next(state);\n var char = currentCharacter(state);\n var escapeChar = ESCAPE_CHARACTERS[char];\n if (escapeChar !== undefined) {\n // an escaped control character like \\\" or \\n\n str += escapeChar;\n state.index += 1;\n } else if (char === 'u') {\n // escaped unicode character\n var unicode = state.expression.slice(state.index + 1, state.index + 5);\n if (/^[0-9A-Fa-f]{4}$/.test(unicode)) {\n // test whether the string holds four hexadecimal values\n str += String.fromCharCode(parseInt(unicode, 16));\n state.index += 5;\n } else {\n throw createSyntaxError(state, \"Invalid unicode character \\\\u\".concat(unicode));\n }\n } else {\n throw createSyntaxError(state, \"Bad escape character \\\\\".concat(char));\n }\n } else {\n // any regular character\n str += currentCharacter(state);\n next(state);\n }\n }\n getToken(state);\n if (state.token !== quote) {\n throw createSyntaxError(state, \"End of string \".concat(quote, \" expected\"));\n }\n getToken(state);\n return str;\n }\n\n /**\n * parse the matrix\n * @return {Node} node\n * @private\n */\n function parseMatrix(state) {\n var array, params, rows, cols;\n if (state.token === '[') {\n // matrix [...]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n // this is a non-empty matrix\n var row = parseRow(state);\n if (state.token === ';') {\n // 2 dimensional array\n rows = 1;\n params = [row];\n\n // the rows of the matrix are separated by dot-comma's\n while (state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n if (state.token !== ']') {\n params[rows] = parseRow(state);\n rows++;\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n\n // check if the number of columns matches in all rows\n cols = params[0].items.length;\n for (var r = 1; r < rows; r++) {\n if (params[r].items.length !== cols) {\n throw createError(state, 'Column dimensions mismatch ' + '(' + params[r].items.length + ' !== ' + cols + ')');\n }\n }\n array = new ArrayNode(params);\n } else {\n // 1 dimensional vector\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n array = row;\n }\n } else {\n // this is an empty matrix \"[ ]\"\n closeParams(state);\n getToken(state);\n array = new ArrayNode([]);\n }\n return parseAccessors(state, array);\n }\n return parseObject(state);\n }\n\n /**\n * Parse a single comma-separated row from a matrix, like 'a, b, c'\n * @return {ArrayNode} node\n */\n function parseRow(state) {\n var params = [parseAssignment(state)];\n var len = 1;\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n\n // parse expression\n if (state.token !== ']' && state.token !== ';') {\n params[len] = parseAssignment(state);\n len++;\n }\n }\n return new ArrayNode(params);\n }\n\n /**\n * parse an object, enclosed in angle brackets{...}, for example {value: 2}\n * @return {Node} node\n * @private\n */\n function parseObject(state) {\n if (state.token === '{') {\n openParams(state);\n var key;\n var properties = {};\n do {\n getToken(state);\n if (state.token !== '}') {\n // parse key\n if (state.token === '\"' || state.token === \"'\") {\n key = parseStringToken(state, state.token);\n } else if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n key = state.token;\n getToken(state);\n } else {\n throw createSyntaxError(state, 'Symbol or string expected as object key');\n }\n\n // parse key/value separator\n if (state.token !== ':') {\n throw createSyntaxError(state, 'Colon : expected after object key');\n }\n getToken(state);\n\n // parse key\n properties[key] = parseAssignment(state);\n }\n } while (state.token === ','); // eslint-disable-line no-unmodified-loop-condition\n\n if (state.token !== '}') {\n throw createSyntaxError(state, 'Comma , or bracket } expected after object value');\n }\n closeParams(state);\n getToken(state);\n var node = new ObjectNode(properties);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseNumber(state);\n }\n\n /**\n * parse a number\n * @return {Node} node\n * @private\n */\n function parseNumber(state) {\n var numberStr;\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // this is a number\n numberStr = state.token;\n getToken(state);\n var numericType = safeNumberType(numberStr, config);\n var value = numeric(numberStr, numericType);\n return new ConstantNode(value);\n }\n return parseParentheses(state);\n }\n\n /**\n * parentheses\n * @return {Node} node\n * @private\n */\n function parseParentheses(state) {\n var node;\n\n // check if it is a parenthesized expression\n if (state.token === '(') {\n // parentheses (...)\n openParams(state);\n getToken(state);\n node = parseAssignment(state); // start again\n\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new ParenthesisNode(node);\n node = parseAccessors(state, node);\n return node;\n }\n return parseEnd(state);\n }\n\n /**\n * Evaluated when the expression is not yet ended but expected to end\n * @return {Node} res\n * @private\n */\n function parseEnd(state) {\n if (state.token === '') {\n // syntax error or unexpected end of expression\n throw createSyntaxError(state, 'Unexpected end of expression');\n } else {\n throw createSyntaxError(state, 'Value expected');\n }\n }\n\n /**\n * Shortcut for getting the current row value (one based)\n * Returns the line of the currently handled expression\n * @private\n */\n /* TODO: implement keeping track on the row number\n function row () {\n return null\n }\n */\n\n /**\n * Shortcut for getting the current col value (one based)\n * Returns the column (position) where the last state.token starts\n * @private\n */\n function col(state) {\n return state.index - state.token.length + 1;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {SyntaxError} instantiated error\n * @private\n */\n function createSyntaxError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {Error} instantiated error\n * @private\n */\n function createError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n // Now that we can parse, automatically convert strings to Nodes by parsing\n typed.addConversion({\n from: 'string',\n to: 'Node',\n convert: parse\n });\n return parse;\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'compile';\nvar dependencies = ['typed', 'parse'];\nexport var createCompile = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Parse and compile an expression.\n * Returns a an object with a function `evaluate([scope])` to evaluate the\n * compiled expression.\n *\n * Syntax:\n *\n * math.compile(expr) // returns one node\n * math.compile([expr1, expr2, expr3, ...]) // returns an array with nodes\n *\n * Examples:\n *\n * const code1 = math.compile('sqrt(3^2 + 4^2)')\n * code1.evaluate() // 5\n *\n * let scope = {a: 3, b: 4}\n * const code2 = math.compile('a * b') // 12\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.compile(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].evaluate() // 12\n *\n * See also:\n *\n * parse, evaluate\n *\n * @param {string | string[] | Array | Matrix} expr\n * The expression to be compiled\n * @return {{evaluate: Function} | Array.<{evaluate: Function}>} code\n * An object with the compiled expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n return parse(expr).compile();\n },\n 'Array | Matrix': function ArrayMatrix(expr) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile();\n });\n }\n });\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { createEmptyMap } from '../../utils/map.js';\nvar name = 'evaluate';\nvar dependencies = ['typed', 'parse'];\nexport var createEvaluate = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Evaluate an expression.\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.evaluate(expr)\n * math.evaluate(expr, scope)\n * math.evaluate([expr1, expr2, expr3, ...])\n * math.evaluate([expr1, expr2, expr3, ...], scope)\n *\n * Example:\n *\n * math.evaluate('(2+3)/4') // 1.25\n * math.evaluate('sqrt(3^2 + 4^2)') // 5\n * math.evaluate('sqrt(-4)') // 2i\n * math.evaluate(['a=3', 'b=4', 'a*b']) // [3, 4, 12]\n *\n * let scope = {a:3, b:4}\n * math.evaluate('a * b', scope) // 12\n *\n * See also:\n *\n * parse, compile\n *\n * @param {string | string[] | Matrix} expr The expression to be evaluated\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} The result of the expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n var scope = createEmptyMap();\n return parse(expr).compile().evaluate(scope);\n },\n 'string, Map | Object': function stringMapObject(expr, scope) {\n return parse(expr).compile().evaluate(scope);\n },\n 'Array | Matrix': function ArrayMatrix(expr) {\n var scope = createEmptyMap();\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n },\n 'Array | Matrix, Map | Object': function ArrayMatrixMapObject(expr, scope) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n }\n });\n});", "import { factory } from '../utils/factory.js';\nimport { createEmptyMap, toObject } from '../utils/map.js';\nvar name = 'Parser';\nvar dependencies = ['evaluate'];\nexport var createParserClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate\n } = _ref;\n /**\n * @constructor Parser\n * Parser contains methods to evaluate or parse expressions, and has a number\n * of convenience methods to get, set, and remove variables from memory. Parser\n * keeps a scope containing variables in memory, which is used for all\n * evaluations.\n *\n * Methods:\n * const result = parser.evaluate(expr) // evaluate an expression\n * const value = parser.get(name) // retrieve a variable from the parser\n * const values = parser.getAll() // retrieve all defined variables\n * parser.set(name, value) // set a variable in the parser\n * parser.remove(name) // clear a variable from the\n * // parsers scope\n * parser.clear() // clear the parsers scope\n *\n * Example usage:\n * const parser = new Parser()\n * // Note: there is a convenience method which can be used instead:\n * // const parser = new math.parser()\n *\n * // evaluate expressions\n * parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * parser.evaluate('sqrt(-4)') // 2i\n * parser.evaluate('2 inch in cm') // 5.08 cm\n * parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n */\n function Parser() {\n if (!(this instanceof Parser)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n Object.defineProperty(this, 'scope', {\n value: createEmptyMap(),\n writable: false\n });\n }\n\n /**\n * Attach type information\n */\n Parser.prototype.type = 'Parser';\n Parser.prototype.isParser = true;\n\n /**\n * Parse and evaluate the given expression\n * @param {string | string[]} expr A string containing an expression,\n * for example \"2+3\", or a list with expressions\n * @return {*} result The result, or undefined when the expression was empty\n * @throws {Error}\n */\n Parser.prototype.evaluate = function (expr) {\n // TODO: validate arguments\n return evaluate(expr, this.scope);\n };\n\n /**\n * Get a variable (a function or variable) by name from the parsers scope.\n * Returns undefined when not found\n * @param {string} name\n * @return {* | undefined} value\n */\n Parser.prototype.get = function (name) {\n // TODO: validate arguments\n if (this.scope.has(name)) {\n return this.scope.get(name);\n }\n };\n\n /**\n * Get a map with all defined variables\n * @return {Object} values\n */\n Parser.prototype.getAll = function () {\n return toObject(this.scope);\n };\n\n /**\n * Get a map with all defined variables\n * @return {Map} values\n */\n Parser.prototype.getAllAsMap = function () {\n return this.scope;\n };\n\n /**\n * Set a symbol (a function or variable) by name from the parsers scope.\n * @param {string} name\n * @param {* | undefined} value\n */\n Parser.prototype.set = function (name, value) {\n this.scope.set(name, value);\n return value;\n };\n\n /**\n * Remove a variable from the parsers scope\n * @param {string} name\n */\n Parser.prototype.remove = function (name) {\n this.scope.delete(name);\n };\n\n /**\n * Clear the scope with variables and functions\n */\n Parser.prototype.clear = function () {\n this.scope.clear();\n };\n return Parser;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'parser';\nvar dependencies = ['typed', 'Parser'];\nexport var createParser = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Parser\n } = _ref;\n /**\n * Create a parser. The function creates a new `math.Parser` object.\n *\n * Syntax:\n *\n * math.parser()\n *\n * Examples:\n *\n * const parser = new math.parser()\n *\n * // evaluate expressions\n * const a = parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * const b = parser.evaluate('sqrt(-4)') // 2i\n * const c = parser.evaluate('2 inch in cm') // 5.08 cm\n * const d = parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n * See also:\n *\n * evaluate, compile, parse\n *\n * @return {Parser} Parser\n */\n return typed(name, {\n '': function _() {\n return new Parser();\n }\n });\n});", "import { clone } from '../../../utils/object.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'lup';\nvar dependencies = ['typed', 'matrix', 'abs', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'larger', 'equalScalar', 'unaryMinus', 'DenseMatrix', 'SparseMatrix', 'Spa'];\nexport var createLup = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n abs,\n addScalar,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n larger,\n equalScalar,\n unaryMinus,\n DenseMatrix,\n SparseMatrix,\n Spa\n } = _ref;\n /**\n * Calculate the Matrix LU decomposition with partial pivoting. Matrix `A` is decomposed in two matrices (`L`, `U`) and a\n * row permutation vector `p` where `A[p,:] = L * U`\n *\n * Syntax:\n *\n * math.lup(A)\n *\n * Example:\n *\n * const m = [[2, 1], [1, 4]]\n * const r = math.lup(m)\n * // r = {\n * // L: [[1, 0], [0.5, 1]],\n * // U: [[2, 1], [0, 3.5]],\n * // P: [0, 1]\n * // }\n *\n * See also:\n *\n * slu, lsolve, lusolve, usolve\n *\n * @param {Matrix | Array} A A two dimensional matrix or array for which to get the LUP decomposition.\n *\n * @return {{L: Array | Matrix, U: Array | Matrix, P: Array.}} The lower triangular matrix, the upper triangular matrix and the permutation matrix.\n */\n return typed(name, {\n DenseMatrix: function DenseMatrix(m) {\n return _denseLUP(m);\n },\n SparseMatrix: function SparseMatrix(m) {\n return _sparseLUP(m);\n },\n Array: function Array(a) {\n // create dense matrix from array\n var m = matrix(a);\n // lup, use matrix implementation\n var r = _denseLUP(m);\n // result\n return {\n L: r.L.valueOf(),\n U: r.U.valueOf(),\n p: r.p\n };\n }\n });\n function _denseLUP(m) {\n // rows & columns\n var rows = m._size[0];\n var columns = m._size[1];\n // minimum rows and columns\n var n = Math.min(rows, columns);\n // matrix array, clone original data\n var data = clone(m._data);\n // l matrix arrays\n var ldata = [];\n var lsize = [rows, n];\n // u matrix arrays\n var udata = [];\n var usize = [n, columns];\n // vars\n var i, j, k;\n // permutation vector\n var p = [];\n for (i = 0; i < rows; i++) {\n p[i] = i;\n }\n // loop columns\n for (j = 0; j < columns; j++) {\n // skip first column in upper triangular matrix\n if (j > 0) {\n // loop rows\n for (i = 0; i < rows; i++) {\n // min i,j\n var min = Math.min(i, j);\n // v[i, j]\n var s = 0;\n // loop up to min\n for (k = 0; k < min; k++) {\n // s = l[i, k] - data[k, j]\n s = addScalar(s, multiplyScalar(data[i][k], data[k][j]));\n }\n data[i][j] = subtractScalar(data[i][j], s);\n }\n }\n // row with larger value in cvector, row >= j\n var pi = j;\n var pabsv = 0;\n var vjj = 0;\n // loop rows\n for (i = j; i < rows; i++) {\n // data @ i, j\n var v = data[i][j];\n // absolute value\n var absv = abs(v);\n // value is greater than pivote value\n if (larger(absv, pabsv)) {\n // store row\n pi = i;\n // update max value\n pabsv = absv;\n // value @ [j, j]\n vjj = v;\n }\n }\n // swap rows (j <-> pi)\n if (j !== pi) {\n // swap values j <-> pi in p\n p[j] = [p[pi], p[pi] = p[j]][0];\n // swap j <-> pi in data\n DenseMatrix._swapRows(j, pi, data);\n }\n // check column is in lower triangular matrix\n if (j < rows) {\n // loop rows (lower triangular matrix)\n for (i = j + 1; i < rows; i++) {\n // value @ i, j\n var vij = data[i][j];\n if (!equalScalar(vij, 0)) {\n // update data\n data[i][j] = divideScalar(data[i][j], vjj);\n }\n }\n }\n }\n // loop columns\n for (j = 0; j < columns; j++) {\n // loop rows\n for (i = 0; i < rows; i++) {\n // initialize row in arrays\n if (j === 0) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i] = [];\n }\n // L\n ldata[i] = [];\n }\n // check we are in the upper triangular matrix\n if (i < j) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = data[i][j];\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = 0;\n }\n continue;\n }\n // diagonal value\n if (i === j) {\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = data[i][j];\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = 1;\n }\n continue;\n }\n // check row exists in upper triangular matrix\n if (i < columns) {\n // U\n udata[i][j] = 0;\n }\n // check column exists in lower triangular matrix\n if (j < rows) {\n // L\n ldata[i][j] = data[i][j];\n }\n }\n }\n // l matrix\n var l = new DenseMatrix({\n data: ldata,\n size: lsize\n });\n // u matrix\n var u = new DenseMatrix({\n data: udata,\n size: usize\n });\n // p vector\n var pv = [];\n for (i = 0, n = p.length; i < n; i++) {\n pv[p[i]] = i;\n }\n // return matrices\n return {\n L: l,\n U: u,\n p: pv,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\nP: ' + this.p;\n }\n };\n }\n function _sparseLUP(m) {\n // rows & columns\n var rows = m._size[0];\n var columns = m._size[1];\n // minimum rows and columns\n var n = Math.min(rows, columns);\n // matrix arrays (will not be modified, thanks to permutation vector)\n var values = m._values;\n var index = m._index;\n var ptr = m._ptr;\n // l matrix arrays\n var lvalues = [];\n var lindex = [];\n var lptr = [];\n var lsize = [rows, n];\n // u matrix arrays\n var uvalues = [];\n var uindex = [];\n var uptr = [];\n var usize = [n, columns];\n // vars\n var i, j, k;\n // permutation vectors, (current index -> original index) and (original index -> current index)\n var pvCo = [];\n var pvOc = [];\n for (i = 0; i < rows; i++) {\n pvCo[i] = i;\n pvOc[i] = i;\n }\n // swap indices in permutation vectors (condition x < y)!\n var swapIndeces = function swapIndeces(x, y) {\n // find pv indeces getting data from x and y\n var kx = pvOc[x];\n var ky = pvOc[y];\n // update permutation vector current -> original\n pvCo[kx] = y;\n pvCo[ky] = x;\n // update permutation vector original -> current\n pvOc[x] = ky;\n pvOc[y] = kx;\n };\n // loop columns\n var _loop = function _loop() {\n // sparse accumulator\n var spa = new Spa();\n // check lower triangular matrix has a value @ column j\n if (j < rows) {\n // update ptr\n lptr.push(lvalues.length);\n // first value in j column for lower triangular matrix\n lvalues.push(1);\n lindex.push(j);\n }\n // update ptr\n uptr.push(uvalues.length);\n // k0 <= k < k1 where k0 = _ptr[j] && k1 = _ptr[j+1]\n var k0 = ptr[j];\n var k1 = ptr[j + 1];\n // copy column j into sparse accumulator\n for (k = k0; k < k1; k++) {\n // row\n i = index[k];\n // copy column values into sparse accumulator (use permutation vector)\n spa.set(pvCo[i], values[k]);\n }\n // skip first column in upper triangular matrix\n if (j > 0) {\n // loop rows in column j (above diagonal)\n spa.forEach(0, j - 1, function (k, vkj) {\n // loop rows in column k (L)\n SparseMatrix._forEachRow(k, lvalues, lindex, lptr, function (i, vik) {\n // check row is below k\n if (i > k) {\n // update spa value\n spa.accumulate(i, unaryMinus(multiplyScalar(vik, vkj)));\n }\n });\n });\n }\n // row with larger value in spa, row >= j\n var pi = j;\n var vjj = spa.get(j);\n var pabsv = abs(vjj);\n // loop values in spa (order by row, below diagonal)\n spa.forEach(j + 1, rows - 1, function (x, v) {\n // absolute value\n var absv = abs(v);\n // value is greater than pivote value\n if (larger(absv, pabsv)) {\n // store row\n pi = x;\n // update max value\n pabsv = absv;\n // value @ [j, j]\n vjj = v;\n }\n });\n // swap rows (j <-> pi)\n if (j !== pi) {\n // swap values j <-> pi in L\n SparseMatrix._swapRows(j, pi, lsize[1], lvalues, lindex, lptr);\n // swap values j <-> pi in U\n SparseMatrix._swapRows(j, pi, usize[1], uvalues, uindex, uptr);\n // swap values in spa\n spa.swap(j, pi);\n // update permutation vector (swap values @ j, pi)\n swapIndeces(j, pi);\n }\n // loop values in spa (order by row)\n spa.forEach(0, rows - 1, function (x, v) {\n // check we are above diagonal\n if (x <= j) {\n // update upper triangular matrix\n uvalues.push(v);\n uindex.push(x);\n } else {\n // update value\n v = divideScalar(v, vjj);\n // check value is non zero\n if (!equalScalar(v, 0)) {\n // update lower triangular matrix\n lvalues.push(v);\n lindex.push(x);\n }\n }\n });\n };\n for (j = 0; j < columns; j++) {\n _loop();\n }\n // update ptrs\n uptr.push(uvalues.length);\n lptr.push(lvalues.length);\n\n // return matrices\n return {\n L: new SparseMatrix({\n values: lvalues,\n index: lindex,\n ptr: lptr,\n size: lsize\n }),\n U: new SparseMatrix({\n values: uvalues,\n index: uindex,\n ptr: uptr,\n size: usize\n }),\n p: pvCo,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\nP: ' + this.p;\n }\n };\n }\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../../../utils/factory.js';\nvar name = 'qr';\nvar dependencies = ['typed', 'matrix', 'zeros', 'identity', 'isZero', 'equal', 'sign', 'sqrt', 'conj', 'unaryMinus', 'addScalar', 'divideScalar', 'multiplyScalar', 'subtractScalar', 'complex'];\nexport var createQr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n identity,\n isZero,\n equal,\n sign,\n sqrt,\n conj,\n unaryMinus,\n addScalar,\n divideScalar,\n multiplyScalar,\n subtractScalar,\n complex\n } = _ref;\n /**\n * Calculate the Matrix QR decomposition. Matrix `A` is decomposed in\n * two matrices (`Q`, `R`) where `Q` is an\n * orthogonal matrix and `R` is an upper triangular matrix.\n *\n * Syntax:\n *\n * math.qr(A)\n *\n * Example:\n *\n * const m = [\n * [1, -1, 4],\n * [1, 4, -2],\n * [1, 4, 2],\n * [1, -1, 0]\n * ]\n * const result = math.qr(m)\n * // r = {\n * // Q: [\n * // [0.5, -0.5, 0.5],\n * // [0.5, 0.5, -0.5],\n * // [0.5, 0.5, 0.5],\n * // [0.5, -0.5, -0.5],\n * // ],\n * // R: [\n * // [2, 3, 2],\n * // [0, 5, -2],\n * // [0, 0, 4],\n * // [0, 0, 0]\n * // ]\n * // }\n *\n * See also:\n *\n * lup, lusolve\n *\n * @param {Matrix | Array} A A two dimensional matrix or array\n * for which to get the QR decomposition.\n *\n * @return {{Q: Array | Matrix, R: Array | Matrix}} Q: the orthogonal\n * matrix and R: the upper triangular matrix\n */\n return _extends(typed(name, {\n DenseMatrix: function DenseMatrix(m) {\n return _denseQR(m);\n },\n SparseMatrix: function SparseMatrix(m) {\n return _sparseQR(m);\n },\n Array: function Array(a) {\n // create dense matrix from array\n var m = matrix(a);\n // lup, use matrix implementation\n var r = _denseQR(m);\n // result\n return {\n Q: r.Q.valueOf(),\n R: r.R.valueOf()\n };\n }\n }), {\n _denseQRimpl\n });\n function _denseQRimpl(m) {\n // rows & columns (m x n)\n var rows = m._size[0]; // m\n var cols = m._size[1]; // n\n\n var Q = identity([rows], 'dense');\n var Qdata = Q._data;\n var R = m.clone();\n var Rdata = R._data;\n\n // vars\n var i, j, k;\n var w = zeros([rows], '');\n for (k = 0; k < Math.min(cols, rows); ++k) {\n /*\n * **k-th Household matrix**\n *\n * The matrix I - 2*v*transpose(v)\n * x = first column of A\n * x1 = first element of x\n * alpha = x1 / |x1| * |x|\n * e1 = tranpose([1, 0, 0, ...])\n * u = x - alpha * e1\n * v = u / |u|\n *\n * Household matrix = I - 2 * v * tranpose(v)\n *\n * * Initially Q = I and R = A.\n * * Household matrix is a reflection in a plane normal to v which\n * will zero out all but the top right element in R.\n * * Appplying reflection to both Q and R will not change product.\n * * Repeat this process on the (1,1) minor to get R as an upper\n * triangular matrix.\n * * Reflections leave the magnitude of the columns of Q unchanged\n * so Q remains othoganal.\n *\n */\n\n var pivot = Rdata[k][k];\n var sgn = unaryMinus(equal(pivot, 0) ? 1 : sign(pivot));\n var conjSgn = conj(sgn);\n var alphaSquared = 0;\n for (i = k; i < rows; i++) {\n alphaSquared = addScalar(alphaSquared, multiplyScalar(Rdata[i][k], conj(Rdata[i][k])));\n }\n var alpha = multiplyScalar(sgn, sqrt(alphaSquared));\n if (!isZero(alpha)) {\n // first element in vector u\n var u1 = subtractScalar(pivot, alpha);\n\n // w = v * u1 / |u| (only elements k to (rows-1) are used)\n w[k] = 1;\n for (i = k + 1; i < rows; i++) {\n w[i] = divideScalar(Rdata[i][k], u1);\n }\n\n // tau = - conj(u1 / alpha)\n var tau = unaryMinus(conj(divideScalar(u1, alpha)));\n var s = void 0;\n\n /*\n * tau and w have been choosen so that\n *\n * 2 * v * tranpose(v) = tau * w * tranpose(w)\n */\n\n /*\n * -- calculate R = R - tau * w * tranpose(w) * R --\n * Only do calculation with rows k to (rows-1)\n * Additionally columns 0 to (k-1) will not be changed by this\n * multiplication so do not bother recalculating them\n */\n for (j = k; j < cols; j++) {\n s = 0.0;\n\n // calculate jth element of [tranpose(w) * R]\n for (i = k; i < rows; i++) {\n s = addScalar(s, multiplyScalar(conj(w[i]), Rdata[i][j]));\n }\n\n // calculate the jth element of [tau * transpose(w) * R]\n s = multiplyScalar(s, tau);\n for (i = k; i < rows; i++) {\n Rdata[i][j] = multiplyScalar(subtractScalar(Rdata[i][j], multiplyScalar(w[i], s)), conjSgn);\n }\n }\n /*\n * -- calculate Q = Q - tau * Q * w * transpose(w) --\n * Q is a square matrix (rows x rows)\n * Only do calculation with columns k to (rows-1)\n * Additionally rows 0 to (k-1) will not be changed by this\n * multiplication so do not bother recalculating them\n */\n for (i = 0; i < rows; i++) {\n s = 0.0;\n\n // calculate ith element of [Q * w]\n for (j = k; j < rows; j++) {\n s = addScalar(s, multiplyScalar(Qdata[i][j], w[j]));\n }\n\n // calculate the ith element of [tau * Q * w]\n s = multiplyScalar(s, tau);\n for (j = k; j < rows; ++j) {\n Qdata[i][j] = divideScalar(subtractScalar(Qdata[i][j], multiplyScalar(s, conj(w[j]))), conjSgn);\n }\n }\n }\n }\n\n // return matrices\n return {\n Q,\n R,\n toString: function toString() {\n return 'Q: ' + this.Q.toString() + '\\nR: ' + this.R.toString();\n }\n };\n }\n function _denseQR(m) {\n var ret = _denseQRimpl(m);\n var Rdata = ret.R._data;\n if (m._data.length > 0) {\n var zero = Rdata[0][0].type === 'Complex' ? complex(0) : 0;\n for (var i = 0; i < Rdata.length; ++i) {\n for (var j = 0; j < i && j < (Rdata[0] || []).length; ++j) {\n Rdata[i][j] = zero;\n }\n }\n }\n return ret;\n }\n function _sparseQR(m) {\n throw new Error('qr not implemented for sparse matrices yet');\n }\n});", "import { isInteger } from '../../../utils/number.js';\nimport { factory } from '../../../utils/factory.js';\nimport { createCsSqr } from '../sparse/csSqr.js';\nimport { createCsLu } from '../sparse/csLu.js';\nvar name = 'slu';\nvar dependencies = ['typed', 'abs', 'add', 'multiply', 'transpose', 'divideScalar', 'subtract', 'larger', 'largerEq', 'SparseMatrix'];\nexport var createSlu = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n multiply,\n transpose,\n divideScalar,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n } = _ref;\n var csSqr = createCsSqr({\n add,\n multiply,\n transpose\n });\n var csLu = createCsLu({\n abs,\n divideScalar,\n multiply,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n });\n\n /**\n * Calculate the Sparse Matrix LU decomposition with full pivoting. Sparse Matrix `A` is decomposed in two matrices (`L`, `U`) and two permutation vectors (`pinv`, `q`) where\n *\n * `P * A * Q = L * U`\n *\n * Syntax:\n *\n * math.slu(A, order, threshold)\n *\n * Examples:\n *\n * const A = math.sparse([[4,3], [6, 3]])\n * math.slu(A, 1, 0.001)\n * // returns:\n * // {\n * // L: [[1, 0], [1.5, 1]]\n * // U: [[4, 3], [0, -1.5]]\n * // p: [0, 1]\n * // q: [0, 1]\n * // }\n *\n * See also:\n *\n * lup, lsolve, usolve, lusolve\n *\n * @param {SparseMatrix} A A two dimensional sparse matrix for which to get the LU decomposition.\n * @param {Number} order The Symbolic Ordering and Analysis order:\n * 0 - Natural ordering, no permutation vector q is returned\n * 1 - Matrix must be square, symbolic ordering and analisis is performed on M = A + A'\n * 2 - Symbolic ordering and analisis is performed on M = A' * A. Dense columns from A' are dropped, A recreated from A'.\n * This is appropriatefor LU factorization of unsymmetric matrices.\n * 3 - Symbolic ordering and analisis is performed on M = A' * A. This is best used for LU factorization is matrix M has no dense rows.\n * A dense row is a row with more than 10*sqr(columns) entries.\n * @param {Number} threshold Partial pivoting threshold (1 for partial pivoting)\n *\n * @return {Object} The lower triangular matrix, the upper triangular matrix and the permutation vectors.\n */\n return typed(name, {\n 'SparseMatrix, number, number': function SparseMatrixNumberNumber(a, order, threshold) {\n // verify order\n if (!isInteger(order) || order < 0 || order > 3) {\n throw new Error('Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]');\n }\n // verify threshold\n if (threshold < 0 || threshold > 1) {\n throw new Error('Partial pivoting threshold must be a number from 0 to 1');\n }\n\n // perform symbolic ordering and analysis\n var s = csSqr(order, a, false);\n\n // perform lu decomposition\n var f = csLu(a, s, threshold);\n\n // return decomposition\n return {\n L: f.L,\n U: f.U,\n p: f.pinv,\n q: s.q,\n toString: function toString() {\n return 'L: ' + this.L.toString() + '\\nU: ' + this.U.toString() + '\\np: ' + this.p.toString() + (this.q ? '\\nq: ' + this.q.toString() : '') + '\\n';\n }\n };\n }\n });\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csPermute } from './csPermute.js';\nimport { csPost } from './csPost.js';\nimport { csEtree } from './csEtree.js';\nimport { createCsAmd } from './csAmd.js';\nimport { createCsCounts } from './csCounts.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'csSqr';\nvar dependencies = ['add', 'multiply', 'transpose'];\nexport var createCsSqr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n add,\n multiply,\n transpose\n } = _ref;\n var csAmd = createCsAmd({\n add,\n multiply,\n transpose\n });\n var csCounts = createCsCounts({\n transpose\n });\n\n /**\n * Symbolic ordering and analysis for QR and LU decompositions.\n *\n * @param {Number} order The ordering strategy (see csAmd for more details)\n * @param {Matrix} a The A matrix\n * @param {boolean} qr Symbolic ordering and analysis for QR decomposition (true) or\n * symbolic ordering and analysis for LU decomposition (false)\n *\n * @return {Object} The Symbolic ordering and analysis for matrix A\n */\n return function csSqr(order, a, qr) {\n // a arrays\n var aptr = a._ptr;\n var asize = a._size;\n // columns\n var n = asize[1];\n // vars\n var k;\n // symbolic analysis result\n var s = {};\n // fill-reducing ordering\n s.q = csAmd(order, a);\n // validate results\n if (order && !s.q) {\n return null;\n }\n // QR symbolic analysis\n if (qr) {\n // apply permutations if needed\n var c = order ? csPermute(a, null, s.q, 0) : a;\n // etree of C'*C, where C=A(:,q)\n s.parent = csEtree(c, 1);\n // post order elimination tree\n var post = csPost(s.parent, n);\n // col counts chol(C'*C)\n s.cp = csCounts(c, s.parent, post, 1);\n // check we have everything needed to calculate number of nonzero elements\n if (c && s.parent && s.cp && _vcount(c, s)) {\n // calculate number of nonzero elements\n for (s.unz = 0, k = 0; k < n; k++) {\n s.unz += s.cp[k];\n }\n }\n } else {\n // for LU factorization only, guess nnz(L) and nnz(U)\n s.unz = 4 * aptr[n] + n;\n s.lnz = s.unz;\n }\n // return result S\n return s;\n };\n\n /**\n * Compute nnz(V) = s.lnz, s.pinv, s.leftmost, s.m2 from A and s.parent\n */\n function _vcount(a, s) {\n // a arrays\n var aptr = a._ptr;\n var aindex = a._index;\n var asize = a._size;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n // initialize s arrays\n s.pinv = []; // (m + n)\n s.leftmost = []; // (m)\n // vars\n var parent = s.parent;\n var pinv = s.pinv;\n var leftmost = s.leftmost;\n // workspace, next: first m entries, head: next n entries, tail: next n entries, nque: next n entries\n var w = []; // (m + 3 * n)\n var next = 0;\n var head = m;\n var tail = m + n;\n var nque = m + 2 * n;\n // vars\n var i, k, p, p0, p1;\n // initialize w\n for (k = 0; k < n; k++) {\n // queue k is empty\n w[head + k] = -1;\n w[tail + k] = -1;\n w[nque + k] = 0;\n }\n // initialize row arrays\n for (i = 0; i < m; i++) {\n leftmost[i] = -1;\n }\n // loop columns backwards\n for (k = n - 1; k >= 0; k--) {\n // values & index for column k\n for (p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // leftmost[i] = min(find(A(i,:)))\n leftmost[aindex[p]] = k;\n }\n }\n // scan rows in reverse order\n for (i = m - 1; i >= 0; i--) {\n // row i is not yet ordered\n pinv[i] = -1;\n k = leftmost[i];\n // check row i is empty\n if (k === -1) {\n continue;\n }\n // first row in queue k\n if (w[nque + k]++ === 0) {\n w[tail + k] = i;\n }\n // put i at head of queue k\n w[next + i] = w[head + k];\n w[head + k] = i;\n }\n s.lnz = 0;\n s.m2 = m;\n // find row permutation and nnz(V)\n for (k = 0; k < n; k++) {\n // remove row i from queue k\n i = w[head + k];\n // count V(k,k) as nonzero\n s.lnz++;\n // add a fictitious row\n if (i < 0) {\n i = s.m2++;\n }\n // associate row i with V(:,k)\n pinv[i] = k;\n // skip if V(k+1:m,k) is empty\n if (--nque[k] <= 0) {\n continue;\n }\n // nque[k] is nnz (V(k+1:m,k))\n s.lnz += w[nque + k];\n // move all rows to parent of k\n var pa = parent[k];\n if (pa !== -1) {\n if (w[nque + pa] === 0) {\n w[tail + pa] = w[tail + k];\n }\n w[next + w[tail + k]] = w[head + pa];\n w[head + pa] = w[next + i];\n w[nque + pa] += w[nque + k];\n }\n }\n for (i = 0; i < m; i++) {\n if (pinv[i] < 0) {\n pinv[i] = k++;\n }\n }\n return true;\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Permutes a sparse matrix C = P * A * Q\n *\n * @param {SparseMatrix} a The Matrix A\n * @param {Array} pinv The row permutation vector\n * @param {Array} q The column permutation vector\n * @param {boolean} values Create a pattern matrix (false), values and pattern otherwise\n *\n * @return {Matrix} C = P * A * Q, null on error\n */\nexport function csPermute(a, pinv, q, values) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n var adt = a._datatype;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n // c arrays\n var cvalues = values && a._values ? [] : null;\n var cindex = []; // (aptr[n])\n var cptr = []; // (n + 1)\n // initialize vars\n var nz = 0;\n // loop columns\n for (var k = 0; k < n; k++) {\n // column k of C is column q[k] of A\n cptr[k] = nz;\n // apply column permutation\n var j = q ? q[k] : k;\n // loop values in column j of A\n for (var t0 = aptr[j], t1 = aptr[j + 1], t = t0; t < t1; t++) {\n // row i of A is row pinv[i] of C\n var r = pinv ? pinv[aindex[t]] : aindex[t];\n // index\n cindex[nz] = r;\n // check we need to populate values\n if (cvalues) {\n cvalues[nz] = avalues[t];\n }\n // increment number of nonzero elements\n nz++;\n }\n }\n // finalize the last column of C\n cptr[n] = nz;\n // return C matrix\n return a.createSparseMatrix({\n values: cvalues,\n index: cindex,\n ptr: cptr,\n size: [m, n],\n datatype: adt\n });\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csTdfs } from './csTdfs.js';\n\n/**\n * Post order a tree of forest\n *\n * @param {Array} parent The tree or forest\n * @param {Number} n Number of columns\n */\nexport function csPost(parent, n) {\n // check inputs\n if (!parent) {\n return null;\n }\n // vars\n var k = 0;\n var j;\n // allocate result\n var post = []; // (n)\n // workspace, head: first n entries, next: next n entries, stack: last n entries\n var w = []; // (3 * n)\n var head = 0;\n var next = n;\n var stack = 2 * n;\n // initialize workspace\n for (j = 0; j < n; j++) {\n // empty linked lists\n w[head + j] = -1;\n }\n // traverse nodes in reverse order\n for (j = n - 1; j >= 0; j--) {\n // check j is a root\n if (parent[j] === -1) {\n continue;\n }\n // add j to list of its parent\n w[next + j] = w[head + parent[j]];\n w[head + parent[j]] = j;\n }\n // loop nodes\n for (j = 0; j < n; j++) {\n // skip j if it is not a root\n if (parent[j] !== -1) {\n continue;\n }\n // depth-first search\n k = csTdfs(j, k, w, head, next, post, stack);\n }\n return post;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Depth-first search and postorder of a tree rooted at node j\n *\n * @param {Number} j The tree node\n * @param {Number} k\n * @param {Array} w The workspace array\n * @param {Number} head The index offset within the workspace for the head array\n * @param {Number} next The index offset within the workspace for the next array\n * @param {Array} post The post ordering array\n * @param {Number} stack The index offset within the workspace for the stack array\n */\nexport function csTdfs(j, k, w, head, next, post, stack) {\n // variables\n var top = 0;\n // place j on the stack\n w[stack] = j;\n // while (stack is not empty)\n while (top >= 0) {\n // p = top of stack\n var p = w[stack + top];\n // i = youngest child of p\n var i = w[head + p];\n if (i === -1) {\n // p has no unordered children left\n top--;\n // node p is the kth postordered node\n post[k++] = p;\n } else {\n // remove i from children of p\n w[head + p] = w[next + i];\n // increment top\n ++top;\n // start dfs on child node i\n w[stack + top] = i;\n }\n }\n return k;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Computes the elimination tree of Matrix A (using triu(A)) or the\n * elimination tree of A'A without forming A'A.\n *\n * @param {Matrix} a The A Matrix\n * @param {boolean} ata A value of true the function computes the etree of A'A\n */\nexport function csEtree(a, ata) {\n // check inputs\n if (!a) {\n return null;\n }\n // a arrays\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n // rows & columns\n var m = asize[0];\n var n = asize[1];\n\n // allocate result\n var parent = []; // (n)\n\n // allocate workspace\n var w = []; // (n + (ata ? m : 0))\n var ancestor = 0; // first n entries in w\n var prev = n; // last m entries (ata = true)\n\n var i, inext;\n\n // check we are calculating A'A\n if (ata) {\n // initialize workspace\n for (i = 0; i < m; i++) {\n w[prev + i] = -1;\n }\n }\n // loop columns\n for (var k = 0; k < n; k++) {\n // node k has no parent yet\n parent[k] = -1;\n // nor does k have an ancestor\n w[ancestor + k] = -1;\n // values in column k\n for (var p0 = aptr[k], p1 = aptr[k + 1], p = p0; p < p1; p++) {\n // row\n var r = aindex[p];\n // node\n i = ata ? w[prev + r] : r;\n // traverse from i to k\n for (; i !== -1 && i < k; i = inext) {\n // inext = ancestor of i\n inext = w[ancestor + i];\n // path compression\n w[ancestor + i] = k;\n // check no anc., parent is k\n if (inext === -1) {\n parent[i] = k;\n }\n }\n if (ata) {\n w[prev + r] = k;\n }\n }\n }\n return parent;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { factory } from '../../../utils/factory.js';\nimport { csFkeep } from './csFkeep.js';\nimport { csFlip } from './csFlip.js';\nimport { csTdfs } from './csTdfs.js';\nvar name = 'csAmd';\nvar dependencies = ['add', 'multiply', 'transpose'];\nexport var createCsAmd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n add,\n multiply,\n transpose\n } = _ref;\n /**\n * Approximate minimum degree ordering. The minimum degree algorithm is a widely used\n * heuristic for finding a permutation P so that P*A*P' has fewer nonzeros in its factorization\n * than A. It is a gready method that selects the sparsest pivot row and column during the course\n * of a right looking sparse Cholesky factorization.\n *\n * @param {Number} order 0: Natural, 1: Cholesky, 2: LU, 3: QR\n * @param {Matrix} m Sparse Matrix\n */\n return function csAmd(order, a) {\n // check input parameters\n if (!a || order <= 0 || order > 3) {\n return null;\n }\n // a matrix arrays\n var asize = a._size;\n // rows and columns\n var m = asize[0];\n var n = asize[1];\n // initialize vars\n var lemax = 0;\n // dense threshold\n var dense = Math.max(16, 10 * Math.sqrt(n));\n dense = Math.min(n - 2, dense);\n // create target matrix C\n var cm = _createTargetMatrix(order, a, m, n, dense);\n // drop diagonal entries\n csFkeep(cm, _diag, null);\n // C matrix arrays\n var cindex = cm._index;\n var cptr = cm._ptr;\n\n // number of nonzero elements in C\n var cnz = cptr[n];\n\n // allocate result (n+1)\n var P = [];\n\n // create workspace (8 * (n + 1))\n var W = [];\n var len = 0; // first n + 1 entries\n var nv = n + 1; // next n + 1 entries\n var next = 2 * (n + 1); // next n + 1 entries\n var head = 3 * (n + 1); // next n + 1 entries\n var elen = 4 * (n + 1); // next n + 1 entries\n var degree = 5 * (n + 1); // next n + 1 entries\n var w = 6 * (n + 1); // next n + 1 entries\n var hhead = 7 * (n + 1); // last n + 1 entries\n\n // use P as workspace for last\n var last = P;\n\n // initialize quotient graph\n var mark = _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree);\n\n // initialize degree lists\n var nel = _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next);\n\n // minimum degree node\n var mindeg = 0;\n\n // vars\n var i, j, k, k1, k2, e, pj, ln, nvi, pk, eln, p1, p2, pn, h, d;\n\n // while (selecting pivots) do\n while (nel < n) {\n // select node of minimum approximate degree. amd() is now ready to start eliminating the graph. It first\n // finds a node k of minimum degree and removes it from its degree list. The variable nel keeps track of thow\n // many nodes have been eliminated.\n for (k = -1; mindeg < n && (k = W[head + mindeg]) === -1; mindeg++);\n if (W[next + k] !== -1) {\n last[W[next + k]] = -1;\n }\n // remove k from degree list\n W[head + mindeg] = W[next + k];\n // elenk = |Ek|\n var elenk = W[elen + k];\n // # of nodes k represents\n var nvk = W[nv + k];\n // W[nv + k] nodes of A eliminated\n nel += nvk;\n\n // Construct a new element. The new element Lk is constructed in place if |Ek| = 0. nv[i] is\n // negated for all nodes i in Lk to flag them as members of this set. Each node i is removed from the\n // degree lists. All elements e in Ek are absorved into element k.\n var dk = 0;\n // flag k as in Lk\n W[nv + k] = -nvk;\n var p = cptr[k];\n // do in place if W[elen + k] === 0\n var pk1 = elenk === 0 ? p : cnz;\n var pk2 = pk1;\n for (k1 = 1; k1 <= elenk + 1; k1++) {\n if (k1 > elenk) {\n // search the nodes in k\n e = k;\n // list of nodes starts at cindex[pj]\n pj = p;\n // length of list of nodes in k\n ln = W[len + k] - elenk;\n } else {\n // search the nodes in e\n e = cindex[p++];\n pj = cptr[e];\n // length of list of nodes in e\n ln = W[len + e];\n }\n for (k2 = 1; k2 <= ln; k2++) {\n i = cindex[pj++];\n // check node i dead, or seen\n if ((nvi = W[nv + i]) <= 0) {\n continue;\n }\n // W[degree + Lk] += size of node i\n dk += nvi;\n // negate W[nv + i] to denote i in Lk\n W[nv + i] = -nvi;\n // place i in Lk\n cindex[pk2++] = i;\n if (W[next + i] !== -1) {\n last[W[next + i]] = last[i];\n }\n // check we need to remove i from degree list\n if (last[i] !== -1) {\n W[next + last[i]] = W[next + i];\n } else {\n W[head + W[degree + i]] = W[next + i];\n }\n }\n if (e !== k) {\n // absorb e into k\n cptr[e] = csFlip(k);\n // e is now a dead element\n W[w + e] = 0;\n }\n }\n // cindex[cnz...nzmax] is free\n if (elenk !== 0) {\n cnz = pk2;\n }\n // external degree of k - |Lk\\i|\n W[degree + k] = dk;\n // element k is in cindex[pk1..pk2-1]\n cptr[k] = pk1;\n W[len + k] = pk2 - pk1;\n // k is now an element\n W[elen + k] = -2;\n\n // Find set differences. The scan1 function now computes the set differences |Le \\ Lk| for all elements e. At the start of the\n // scan, no entry in the w array is greater than or equal to mark.\n\n // clear w if necessary\n mark = _wclear(mark, lemax, W, w, n);\n // scan 1: find |Le\\Lk|\n for (pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check if W[elen + i] empty, skip it\n if ((eln = W[elen + i]) <= 0) {\n continue;\n }\n // W[nv + i] was negated\n nvi = -W[nv + i];\n var wnvi = mark - nvi;\n // scan Ei\n for (p = cptr[i], p1 = cptr[i] + eln - 1; p <= p1; p++) {\n e = cindex[p];\n if (W[w + e] >= mark) {\n // decrement |Le\\Lk|\n W[w + e] -= nvi;\n } else if (W[w + e] !== 0) {\n // ensure e is a live element, 1st time e seen in scan 1\n W[w + e] = W[degree + e] + wnvi;\n }\n }\n }\n\n // degree update\n // The second pass computes the approximate degree di, prunes the sets Ei and Ai, and computes a hash\n // function h(i) for all nodes in Lk.\n\n // scan2: degree update\n for (pk = pk1; pk < pk2; pk++) {\n // consider node i in Lk\n i = cindex[pk];\n p1 = cptr[i];\n p2 = p1 + W[elen + i] - 1;\n pn = p1;\n // scan Ei\n for (h = 0, d = 0, p = p1; p <= p2; p++) {\n e = cindex[p];\n // check e is an unabsorbed element\n if (W[w + e] !== 0) {\n // dext = |Le\\Lk|\n var dext = W[w + e] - mark;\n if (dext > 0) {\n // sum up the set differences\n d += dext;\n // keep e in Ei\n cindex[pn++] = e;\n // compute the hash of node i\n h += e;\n } else {\n // aggressive absorb. e->k\n cptr[e] = csFlip(k);\n // e is a dead element\n W[w + e] = 0;\n }\n }\n }\n // W[elen + i] = |Ei|\n W[elen + i] = pn - p1 + 1;\n var p3 = pn;\n var p4 = p1 + W[len + i];\n // prune edges in Ai\n for (p = p2 + 1; p < p4; p++) {\n j = cindex[p];\n // check node j dead or in Lk\n var nvj = W[nv + j];\n if (nvj <= 0) {\n continue;\n }\n // degree(i) += |j|\n d += nvj;\n // place j in node list of i\n cindex[pn++] = j;\n // compute hash for node i\n h += j;\n }\n // check for mass elimination\n if (d === 0) {\n // absorb i into k\n cptr[i] = csFlip(k);\n nvi = -W[nv + i];\n // |Lk| -= |i|\n dk -= nvi;\n // |k| += W[nv + i]\n nvk += nvi;\n nel += nvi;\n W[nv + i] = 0;\n // node i is dead\n W[elen + i] = -1;\n } else {\n // update degree(i)\n W[degree + i] = Math.min(W[degree + i], d);\n // move first node to end\n cindex[pn] = cindex[p3];\n // move 1st el. to end of Ei\n cindex[p3] = cindex[p1];\n // add k as 1st element in of Ei\n cindex[p1] = k;\n // new len of adj. list of node i\n W[len + i] = pn - p1 + 1;\n // finalize hash of i\n h = (h < 0 ? -h : h) % n;\n // place i in hash bucket\n W[next + i] = W[hhead + h];\n W[hhead + h] = i;\n // save hash of i in last[i]\n last[i] = h;\n }\n }\n // finalize |Lk|\n W[degree + k] = dk;\n lemax = Math.max(lemax, dk);\n // clear w\n mark = _wclear(mark + lemax, lemax, W, w, n);\n\n // Supernode detection. Supernode detection relies on the hash function h(i) computed for each node i.\n // If two nodes have identical adjacency lists, their hash functions wil be identical.\n for (pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check i is dead, skip it\n if (W[nv + i] >= 0) {\n continue;\n }\n // scan hash bucket of node i\n h = last[i];\n i = W[hhead + h];\n // hash bucket will be empty\n W[hhead + h] = -1;\n for (; i !== -1 && W[next + i] !== -1; i = W[next + i], mark++) {\n ln = W[len + i];\n eln = W[elen + i];\n for (p = cptr[i] + 1; p <= cptr[i] + ln - 1; p++) {\n W[w + cindex[p]] = mark;\n }\n var jlast = i;\n // compare i with all j\n for (j = W[next + i]; j !== -1;) {\n var ok = W[len + j] === ln && W[elen + j] === eln;\n for (p = cptr[j] + 1; ok && p <= cptr[j] + ln - 1; p++) {\n // compare i and j\n if (W[w + cindex[p]] !== mark) {\n ok = 0;\n }\n }\n // check i and j are identical\n if (ok) {\n // absorb j into i\n cptr[j] = csFlip(i);\n W[nv + i] += W[nv + j];\n W[nv + j] = 0;\n // node j is dead\n W[elen + j] = -1;\n // delete j from hash bucket\n j = W[next + j];\n W[next + jlast] = j;\n } else {\n // j and i are different\n jlast = j;\n j = W[next + j];\n }\n }\n }\n }\n\n // Finalize new element. The elimination of node k is nearly complete. All nodes i in Lk are scanned one last time.\n // Node i is removed from Lk if it is dead. The flagged status of nv[i] is cleared.\n for (p = pk1, pk = pk1; pk < pk2; pk++) {\n i = cindex[pk];\n // check i is dead, skip it\n if ((nvi = -W[nv + i]) <= 0) {\n continue;\n }\n // restore W[nv + i]\n W[nv + i] = nvi;\n // compute external degree(i)\n d = W[degree + i] + dk - nvi;\n d = Math.min(d, n - nel - nvi);\n if (W[head + d] !== -1) {\n last[W[head + d]] = i;\n }\n // put i back in degree list\n W[next + i] = W[head + d];\n last[i] = -1;\n W[head + d] = i;\n // find new minimum degree\n mindeg = Math.min(mindeg, d);\n W[degree + i] = d;\n // place i in Lk\n cindex[p++] = i;\n }\n // # nodes absorbed into k\n W[nv + k] = nvk;\n // length of adj list of element k\n if ((W[len + k] = p - pk1) === 0) {\n // k is a root of the tree\n cptr[k] = -1;\n // k is now a dead element\n W[w + k] = 0;\n }\n if (elenk !== 0) {\n // free unused space in Lk\n cnz = p;\n }\n }\n\n // Postordering. The elimination is complete, but no permutation has been computed. All that is left\n // of the graph is the assembly tree (ptr) and a set of dead nodes and elements (i is a dead node if\n // nv[i] is zero and a dead element if nv[i] > 0). It is from this information only that the final permutation\n // is computed. The tree is restored by unflipping all of ptr.\n\n // fix assembly tree\n for (i = 0; i < n; i++) {\n cptr[i] = csFlip(cptr[i]);\n }\n for (j = 0; j <= n; j++) {\n W[head + j] = -1;\n }\n // place unordered nodes in lists\n for (j = n; j >= 0; j--) {\n // skip if j is an element\n if (W[nv + j] > 0) {\n continue;\n }\n // place j in list of its parent\n W[next + j] = W[head + cptr[j]];\n W[head + cptr[j]] = j;\n }\n // place elements in lists\n for (e = n; e >= 0; e--) {\n // skip unless e is an element\n if (W[nv + e] <= 0) {\n continue;\n }\n if (cptr[e] !== -1) {\n // place e in list of its parent\n W[next + e] = W[head + cptr[e]];\n W[head + cptr[e]] = e;\n }\n }\n // postorder the assembly tree\n for (k = 0, i = 0; i <= n; i++) {\n if (cptr[i] === -1) {\n k = csTdfs(i, k, W, head, next, P, w);\n }\n }\n // remove last item in array\n P.splice(P.length - 1, 1);\n // return P\n return P;\n };\n\n /**\n * Creates the matrix that will be used by the approximate minimum degree ordering algorithm. The function accepts the matrix M as input and returns a permutation\n * vector P. The amd algorithm operates on a symmetrix matrix, so one of three symmetric matrices is formed.\n *\n * Order: 0\n * A natural ordering P=null matrix is returned.\n *\n * Order: 1\n * Matrix must be square. This is appropriate for a Cholesky or LU factorization.\n * P = M + M'\n *\n * Order: 2\n * Dense columns from M' are dropped, M recreated from M'. This is appropriatefor LU factorization of unsymmetric matrices.\n * P = M' * M\n *\n * Order: 3\n * This is best used for QR factorization or LU factorization is matrix M has no dense rows. A dense row is a row with more than 10*sqr(columns) entries.\n * P = M' * M\n */\n function _createTargetMatrix(order, a, m, n, dense) {\n // compute A'\n var at = transpose(a);\n\n // check order = 1, matrix must be square\n if (order === 1 && n === m) {\n // C = A + A'\n return add(a, at);\n }\n\n // check order = 2, drop dense columns from M'\n if (order === 2) {\n // transpose arrays\n var tindex = at._index;\n var tptr = at._ptr;\n // new column index\n var p2 = 0;\n // loop A' columns (rows)\n for (var j = 0; j < m; j++) {\n // column j of AT starts here\n var p = tptr[j];\n // new column j starts here\n tptr[j] = p2;\n // skip dense col j\n if (tptr[j + 1] - p > dense) {\n continue;\n }\n // map rows in column j of A\n for (var p1 = tptr[j + 1]; p < p1; p++) {\n tindex[p2++] = tindex[p];\n }\n }\n // finalize AT\n tptr[m] = p2;\n // recreate A from new transpose matrix\n a = transpose(at);\n // use A' * A\n return multiply(at, a);\n }\n\n // use A' * A, square or rectangular matrix\n return multiply(at, a);\n }\n\n /**\n * Initialize quotient graph. There are four kind of nodes and elements that must be represented:\n *\n * - A live node is a node i (or a supernode) that has not been selected as a pivot nad has not been merged into another supernode.\n * - A dead node i is one that has been removed from the graph, having been absorved into r = flip(ptr[i]).\n * - A live element e is one that is in the graph, having been formed when node e was selected as the pivot.\n * - A dead element e is one that has benn absorved into a subsequent element s = flip(ptr[e]).\n */\n function _initializeQuotientGraph(n, cptr, W, len, head, last, next, hhead, nv, w, elen, degree) {\n // Initialize quotient graph\n for (var k = 0; k < n; k++) {\n W[len + k] = cptr[k + 1] - cptr[k];\n }\n W[len + n] = 0;\n // initialize workspace\n for (var i = 0; i <= n; i++) {\n // degree list i is empty\n W[head + i] = -1;\n last[i] = -1;\n W[next + i] = -1;\n // hash list i is empty\n W[hhead + i] = -1;\n // node i is just one node\n W[nv + i] = 1;\n // node i is alive\n W[w + i] = 1;\n // Ek of node i is empty\n W[elen + i] = 0;\n // degree of node i\n W[degree + i] = W[len + i];\n }\n // clear w\n var mark = _wclear(0, 0, W, w, n);\n // n is a dead element\n W[elen + n] = -2;\n // n is a root of assembly tree\n cptr[n] = -1;\n // n is a dead element\n W[w + n] = 0;\n // return mark\n return mark;\n }\n\n /**\n * Initialize degree lists. Each node is placed in its degree lists. Nodes of zero degree are eliminated immediately. Nodes with\n * degree >= dense are alsol eliminated and merged into a placeholder node n, a dead element. Thes nodes will appera last in the\n * output permutation p.\n */\n function _initializeDegreeLists(n, cptr, W, degree, elen, w, dense, nv, head, last, next) {\n // result\n var nel = 0;\n // loop columns\n for (var i = 0; i < n; i++) {\n // degree @ i\n var d = W[degree + i];\n // check node i is empty\n if (d === 0) {\n // element i is dead\n W[elen + i] = -2;\n nel++;\n // i is a root of assembly tree\n cptr[i] = -1;\n W[w + i] = 0;\n } else if (d > dense) {\n // absorb i into element n\n W[nv + i] = 0;\n // node i is dead\n W[elen + i] = -1;\n nel++;\n cptr[i] = csFlip(n);\n W[nv + n]++;\n } else {\n var h = W[head + d];\n if (h !== -1) {\n last[h] = i;\n }\n // put node i in degree list d\n W[next + i] = W[head + d];\n W[head + d] = i;\n }\n }\n return nel;\n }\n function _wclear(mark, lemax, W, w, n) {\n if (mark < 2 || mark + lemax < 0) {\n for (var k = 0; k < n; k++) {\n if (W[w + k] !== 0) {\n W[w + k] = 1;\n }\n }\n mark = 2;\n }\n // at this point, W [0..n-1] < mark holds\n return mark;\n }\n function _diag(i, j) {\n return i !== j;\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Keeps entries in the matrix when the callback function returns true, removes the entry otherwise\n *\n * @param {Matrix} a The sparse matrix\n * @param {function} callback The callback function, function will be invoked with the following args:\n * - The entry row\n * - The entry column\n * - The entry value\n * - The state parameter\n * @param {any} other The state\n *\n * @return The number of nonzero elements in the matrix\n */\nexport function csFkeep(a, callback, other) {\n // a arrays\n var avalues = a._values;\n var aindex = a._index;\n var aptr = a._ptr;\n var asize = a._size;\n // columns\n var n = asize[1];\n // nonzero items\n var nz = 0;\n // loop columns\n for (var j = 0; j < n; j++) {\n // get current location of col j\n var p = aptr[j];\n // record new location of col j\n aptr[j] = nz;\n for (; p < aptr[j + 1]; p++) {\n // check we need to keep this item\n if (callback(aindex[p], j, avalues ? avalues[p] : 1, other)) {\n // keep A(i,j)\n aindex[nz] = aindex[p];\n // check we need to process values (pattern only)\n if (avalues) {\n avalues[nz] = avalues[p];\n }\n // increment nonzero items\n nz++;\n }\n }\n }\n // finalize A\n aptr[n] = nz;\n // trim arrays\n aindex.splice(nz, aindex.length - nz);\n // check we need to process values (pattern only)\n if (avalues) {\n avalues.splice(nz, avalues.length - nz);\n }\n // return number of nonzero items\n return nz;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * This function \"flips\" its input about the integer -1.\n *\n * @param {Number} i The value to flip\n */\nexport function csFlip(i) {\n // flip the value\n return -i - 2;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { factory } from '../../../utils/factory.js';\nimport { csLeaf } from './csLeaf.js';\nvar name = 'csCounts';\nvar dependencies = ['transpose'];\nexport var createCsCounts = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n transpose\n } = _ref;\n /**\n * Computes the column counts using the upper triangular part of A.\n * It transposes A internally, none of the input parameters are modified.\n *\n * @param {Matrix} a The sparse matrix A\n *\n * @param {Matrix} ata Count the columns of A'A instead\n *\n * @return An array of size n of the column counts or null on error\n */\n return function (a, parent, post, ata) {\n // check inputs\n if (!a || !parent || !post) {\n return null;\n }\n // a matrix arrays\n var asize = a._size;\n // rows and columns\n var m = asize[0];\n var n = asize[1];\n // variables\n var i, j, k, J, p, p0, p1;\n\n // workspace size\n var s = 4 * n + (ata ? n + m + 1 : 0);\n // allocate workspace\n var w = []; // (s)\n var ancestor = 0; // first n entries\n var maxfirst = n; // next n entries\n var prevleaf = 2 * n; // next n entries\n var first = 3 * n; // next n entries\n var head = 4 * n; // next n + 1 entries (used when ata is true)\n var next = 5 * n + 1; // last entries in workspace\n // clear workspace w[0..s-1]\n for (k = 0; k < s; k++) {\n w[k] = -1;\n }\n\n // allocate result\n var colcount = []; // (n)\n\n // AT = A'\n var at = transpose(a);\n // at arrays\n var tindex = at._index;\n var tptr = at._ptr;\n\n // find w[first + j]\n for (k = 0; k < n; k++) {\n j = post[k];\n // colcount[j]=1 if j is a leaf\n colcount[j] = w[first + j] === -1 ? 1 : 0;\n for (; j !== -1 && w[first + j] === -1; j = parent[j]) {\n w[first + j] = k;\n }\n }\n\n // initialize ata if needed\n if (ata) {\n // invert post\n for (k = 0; k < n; k++) {\n w[post[k]] = k;\n }\n // loop rows (columns in AT)\n for (i = 0; i < m; i++) {\n // values in column i of AT\n for (k = n, p0 = tptr[i], p1 = tptr[i + 1], p = p0; p < p1; p++) {\n k = Math.min(k, w[tindex[p]]);\n }\n // place row i in linked list k\n w[next + i] = w[head + k];\n w[head + k] = i;\n }\n }\n\n // each node in its own set\n for (i = 0; i < n; i++) {\n w[ancestor + i] = i;\n }\n for (k = 0; k < n; k++) {\n // j is the kth node in postordered etree\n j = post[k];\n // check j is not a root\n if (parent[j] !== -1) {\n colcount[parent[j]]--;\n }\n\n // J=j for LL'=A case\n for (J = ata ? w[head + k] : j; J !== -1; J = ata ? w[next + J] : -1) {\n for (p = tptr[J]; p < tptr[J + 1]; p++) {\n i = tindex[p];\n var r = csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor);\n // check A(i,j) is in skeleton\n if (r.jleaf >= 1) {\n colcount[j]++;\n }\n // check account for overlap in q\n if (r.jleaf === 2) {\n colcount[r.q]--;\n }\n }\n }\n if (parent[j] !== -1) {\n w[ancestor + j] = parent[j];\n }\n }\n // sum up colcount's of each child\n for (j = 0; j < n; j++) {\n if (parent[j] !== -1) {\n colcount[parent[j]] += colcount[j];\n }\n }\n return colcount;\n };\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * This function determines if j is a leaf of the ith row subtree.\n * Consider A(i,j), node j in ith row subtree and return lca(jprev,j)\n *\n * @param {Number} i The ith row subtree\n * @param {Number} j The node to test\n * @param {Array} w The workspace array\n * @param {Number} first The index offset within the workspace for the first array\n * @param {Number} maxfirst The index offset within the workspace for the maxfirst array\n * @param {Number} prevleaf The index offset within the workspace for the prevleaf array\n * @param {Number} ancestor The index offset within the workspace for the ancestor array\n *\n * @return {Object}\n */\nexport function csLeaf(i, j, w, first, maxfirst, prevleaf, ancestor) {\n var s, sparent;\n\n // our result\n var jleaf = 0;\n var q;\n\n // check j is a leaf\n if (i <= j || w[first + j] <= w[maxfirst + i]) {\n return -1;\n }\n // update max first[j] seen so far\n w[maxfirst + i] = w[first + j];\n // jprev = previous leaf of ith subtree\n var jprev = w[prevleaf + i];\n w[prevleaf + i] = j;\n\n // check j is first or subsequent leaf\n if (jprev === -1) {\n // 1st leaf, q = root of ith subtree\n jleaf = 1;\n q = i;\n } else {\n // update jleaf\n jleaf = 2;\n // q = least common ancester (jprev,j)\n for (q = jprev; q !== w[ancestor + q]; q = w[ancestor + q]);\n for (s = jprev; s !== q; s = sparent) {\n // path compression\n sparent = w[ancestor + s];\n w[ancestor + s] = q;\n }\n }\n return {\n jleaf,\n q\n };\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { factory } from '../../../utils/factory.js';\nimport { createCsSpsolve } from './csSpsolve.js';\nvar name = 'csLu';\nvar dependencies = ['abs', 'divideScalar', 'multiply', 'subtract', 'larger', 'largerEq', 'SparseMatrix'];\nexport var createCsLu = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n abs,\n divideScalar,\n multiply,\n subtract,\n larger,\n largerEq,\n SparseMatrix\n } = _ref;\n var csSpsolve = createCsSpsolve({\n divideScalar,\n multiply,\n subtract\n });\n\n /**\n * Computes the numeric LU factorization of the sparse matrix A. Implements a Left-looking LU factorization\n * algorithm that computes L and U one column at a tume. At the kth step, it access columns 1 to k-1 of L\n * and column k of A. Given the fill-reducing column ordering q (see parameter s) computes L, U and pinv so\n * L * U = A(p, q), where p is the inverse of pinv.\n *\n * @param {Matrix} m The A Matrix to factorize\n * @param {Object} s The symbolic analysis from csSqr(). Provides the fill-reducing\n * column ordering q\n * @param {Number} tol Partial pivoting threshold (1 for partial pivoting)\n *\n * @return {Number} The numeric LU factorization of A or null\n */\n return function csLu(m, s, tol) {\n // validate input\n if (!m) {\n return null;\n }\n // m arrays\n var size = m._size;\n // columns\n var n = size[1];\n // symbolic analysis result\n var q;\n var lnz = 100;\n var unz = 100;\n // update symbolic analysis parameters\n if (s) {\n q = s.q;\n lnz = s.lnz || lnz;\n unz = s.unz || unz;\n }\n // L arrays\n var lvalues = []; // (lnz)\n var lindex = []; // (lnz)\n var lptr = []; // (n + 1)\n // L\n var L = new SparseMatrix({\n values: lvalues,\n index: lindex,\n ptr: lptr,\n size: [n, n]\n });\n // U arrays\n var uvalues = []; // (unz)\n var uindex = []; // (unz)\n var uptr = []; // (n + 1)\n // U\n var U = new SparseMatrix({\n values: uvalues,\n index: uindex,\n ptr: uptr,\n size: [n, n]\n });\n // inverse of permutation vector\n var pinv = []; // (n)\n // vars\n var i, p;\n // allocate arrays\n var x = []; // (n)\n var xi = []; // (2 * n)\n // initialize variables\n for (i = 0; i < n; i++) {\n // clear workspace\n x[i] = 0;\n // no rows pivotal yet\n pinv[i] = -1;\n // no cols of L yet\n lptr[i + 1] = 0;\n }\n // reset number of nonzero elements in L and U\n lnz = 0;\n unz = 0;\n // compute L(:,k) and U(:,k)\n for (var k = 0; k < n; k++) {\n // update ptr\n lptr[k] = lnz;\n uptr[k] = unz;\n // apply column permutations if needed\n var col = q ? q[k] : k;\n // solve triangular system, x = L\\A(:,col)\n var top = csSpsolve(L, m, col, xi, x, pinv, 1);\n // find pivot\n var ipiv = -1;\n var a = -1;\n // loop xi[] from top -> n\n for (p = top; p < n; p++) {\n // x[i] is nonzero\n i = xi[p];\n // check row i is not yet pivotal\n if (pinv[i] < 0) {\n // absolute value of x[i]\n var xabs = abs(x[i]);\n // check absoulte value is greater than pivot value\n if (larger(xabs, a)) {\n // largest pivot candidate so far\n a = xabs;\n ipiv = i;\n }\n } else {\n // x(i) is the entry U(pinv[i],k)\n uindex[unz] = pinv[i];\n uvalues[unz++] = x[i];\n }\n }\n // validate we found a valid pivot\n if (ipiv === -1 || a <= 0) {\n return null;\n }\n // update actual pivot column, give preference to diagonal value\n if (pinv[col] < 0 && largerEq(abs(x[col]), multiply(a, tol))) {\n ipiv = col;\n }\n // the chosen pivot\n var pivot = x[ipiv];\n // last entry in U(:,k) is U(k,k)\n uindex[unz] = k;\n uvalues[unz++] = pivot;\n // ipiv is the kth pivot row\n pinv[ipiv] = k;\n // first entry in L(:,k) is L(k,k) = 1\n lindex[lnz] = ipiv;\n lvalues[lnz++] = 1;\n // L(k+1:n,k) = x / pivot\n for (p = top; p < n; p++) {\n // row\n i = xi[p];\n // check x(i) is an entry in L(:,k)\n if (pinv[i] < 0) {\n // save unpermuted row in L\n lindex[lnz] = i;\n // scale pivot column\n lvalues[lnz++] = divideScalar(x[i], pivot);\n }\n // x[0..n-1] = 0 for next k\n x[i] = 0;\n }\n }\n // update ptr\n lptr[n] = lnz;\n uptr[n] = unz;\n // fix row indices of L for final pinv\n for (p = 0; p < lnz; p++) {\n lindex[p] = pinv[lindex[p]];\n }\n // trim arrays\n lvalues.splice(lnz, lvalues.length - lnz);\n lindex.splice(lnz, lindex.length - lnz);\n uvalues.splice(unz, uvalues.length - unz);\n uindex.splice(unz, uindex.length - unz);\n // return LU factor\n return {\n L,\n U,\n pinv\n };\n };\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csReach } from './csReach.js';\nimport { factory } from '../../../utils/factory.js';\nvar name = 'csSpsolve';\nvar dependencies = ['divideScalar', 'multiply', 'subtract'];\nexport var createCsSpsolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n divideScalar,\n multiply,\n subtract\n } = _ref;\n /**\n * The function csSpsolve() computes the solution to G * x = bk, where bk is the\n * kth column of B. When lo is true, the function assumes G = L is lower triangular with the\n * diagonal entry as the first entry in each column. When lo is true, the function assumes G = U\n * is upper triangular with the diagonal entry as the last entry in each column.\n *\n * @param {Matrix} g The G matrix\n * @param {Matrix} b The B matrix\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} x The soluton to the linear system G * x = b\n * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b\n * @param {boolean} lo The lower (true) upper triangular (false) flag\n *\n * @return {Number} The index for the nonzero pattern\n */\n return function csSpsolve(g, b, k, xi, x, pinv, lo) {\n // g arrays\n var gvalues = g._values;\n var gindex = g._index;\n var gptr = g._ptr;\n var gsize = g._size;\n // columns\n var n = gsize[1];\n // b arrays\n var bvalues = b._values;\n var bindex = b._index;\n var bptr = b._ptr;\n // vars\n var p, p0, p1, q;\n // xi[top..n-1] = csReach(B(:,k))\n var top = csReach(g, b, k, xi, pinv);\n // clear x\n for (p = top; p < n; p++) {\n x[xi[p]] = 0;\n }\n // scatter b\n for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) {\n x[bindex[p]] = bvalues[p];\n }\n // loop columns\n for (var px = top; px < n; px++) {\n // x array index for px\n var j = xi[px];\n // apply permutation vector (U x = b), j maps to column J of G\n var J = pinv ? pinv[j] : j;\n // check column J is empty\n if (J < 0) {\n continue;\n }\n // column value indeces in G, p0 <= p < p1\n p0 = gptr[J];\n p1 = gptr[J + 1];\n // x(j) /= G(j,j)\n x[j] = divideScalar(x[j], gvalues[lo ? p0 : p1 - 1]);\n // first entry L(j,j)\n p = lo ? p0 + 1 : p0;\n q = lo ? p1 : p1 - 1;\n // loop\n for (; p < q; p++) {\n // row\n var i = gindex[p];\n // x(i) -= G(i,j) * x(j)\n x[i] = subtract(x[i], multiply(gvalues[p], x[j]));\n }\n }\n // return top of stack\n return top;\n };\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { csMarked } from './csMarked.js';\nimport { csMark } from './csMark.js';\nimport { csDfs } from './csDfs.js';\n\n/**\n * The csReach function computes X = Reach(B), where B is the nonzero pattern of the n-by-1\n * sparse column of vector b. The function returns the set of nodes reachable from any node in B. The\n * nonzero pattern xi of the solution x to the sparse linear system Lx=b is given by X=Reach(B).\n *\n * @param {Matrix} g The G matrix\n * @param {Matrix} b The B matrix\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} pinv The inverse row permutation vector\n *\n * @return {Number} The index for the nonzero pattern\n */\nexport function csReach(g, b, k, xi, pinv) {\n // g arrays\n var gptr = g._ptr;\n var gsize = g._size;\n // b arrays\n var bindex = b._index;\n var bptr = b._ptr;\n // columns\n var n = gsize[1];\n // vars\n var p, p0, p1;\n // initialize top\n var top = n;\n // loop column indeces in B\n for (p0 = bptr[k], p1 = bptr[k + 1], p = p0; p < p1; p++) {\n // node i\n var i = bindex[p];\n // check node i is marked\n if (!csMarked(gptr, i)) {\n // start a dfs at unmarked node i\n top = csDfs(i, g, top, xi, pinv);\n }\n }\n // loop columns from top -> n - 1\n for (p = top; p < n; p++) {\n // restore G\n csMark(gptr, xi[p]);\n }\n return top;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Checks if the node at w[j] is marked\n *\n * @param {Array} w The array\n * @param {Number} j The array index\n */\nexport function csMarked(w, j) {\n // check node is marked\n return w[j] < 0;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\nimport { csFlip } from './csFlip.js';\n\n/**\n * Marks the node at w[j]\n *\n * @param {Array} w The array\n * @param {Number} j The array index\n */\nexport function csMark(w, j) {\n // mark w[j]\n w[j] = csFlip(w[j]);\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csMarked } from './csMarked.js';\nimport { csMark } from './csMark.js';\nimport { csUnflip } from './csUnflip.js';\n\n/**\n * Depth-first search computes the nonzero pattern xi of the directed graph G (Matrix) starting\n * at nodes in B (see csReach()).\n *\n * @param {Number} j The starting node for the DFS algorithm\n * @param {Matrix} g The G matrix to search, ptr array modified, then restored\n * @param {Number} top Start index in stack xi[top..n-1]\n * @param {Number} k The kth column in B\n * @param {Array} xi The nonzero pattern xi[top] .. xi[n - 1], an array of size = 2 * n\n * The first n entries is the nonzero pattern, the last n entries is the stack\n * @param {Array} pinv The inverse row permutation vector, must be null for L * x = b\n *\n * @return {Number} New value of top\n */\nexport function csDfs(j, g, top, xi, pinv) {\n // g arrays\n var index = g._index;\n var ptr = g._ptr;\n var size = g._size;\n // columns\n var n = size[1];\n // vars\n var i, p, p2;\n // initialize head\n var head = 0;\n // initialize the recursion stack\n xi[0] = j;\n // loop\n while (head >= 0) {\n // get j from the top of the recursion stack\n j = xi[head];\n // apply permutation vector\n var jnew = pinv ? pinv[j] : j;\n // check node j is marked\n if (!csMarked(ptr, j)) {\n // mark node j as visited\n csMark(ptr, j);\n // update stack (last n entries in xi)\n xi[n + head] = jnew < 0 ? 0 : csUnflip(ptr[jnew]);\n }\n // node j done if no unvisited neighbors\n var done = 1;\n // examine all neighbors of j, stack (last n entries in xi)\n for (p = xi[n + head], p2 = jnew < 0 ? 0 : csUnflip(ptr[jnew + 1]); p < p2; p++) {\n // consider neighbor node i\n i = index[p];\n // check we have visited node i, skip it\n if (csMarked(ptr, i)) {\n continue;\n }\n // pause depth-first search of node j, update stack (last n entries in xi)\n xi[n + head] = p;\n // start dfs at node i\n xi[++head] = i;\n // node j is not done\n done = 0;\n // break, to start dfs(i)\n break;\n }\n // check depth-first search at node j is done\n if (done) {\n // remove j from the recursion stack\n head--;\n // and place in the output stack\n xi[--top] = j;\n }\n }\n return top;\n}", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\nimport { csFlip } from './csFlip.js';\n\n/**\n * Flips the value if it is negative of returns the same value otherwise.\n *\n * @param {Number} i The value to flip\n */\nexport function csUnflip(i) {\n // flip the value if it is negative\n return i < 0 ? csFlip(i) : i;\n}", "import { isArray, isMatrix } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nimport { createSolveValidation } from './utils/solveValidation.js';\nimport { csIpvec } from '../sparse/csIpvec.js';\nvar name = 'lusolve';\nvar dependencies = ['typed', 'matrix', 'lup', 'slu', 'usolve', 'lsolve', 'DenseMatrix'];\nexport var createLusolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n lup,\n slu,\n usolve,\n lsolve,\n DenseMatrix\n } = _ref;\n var solveValidation = createSolveValidation({\n DenseMatrix\n });\n\n /**\n * Solves the linear system `A * x = b` where `A` is an [n x n] matrix and `b` is a [n] column vector.\n *\n * Syntax:\n *\n * math.lusolve(A, b) // returns column vector with the solution to the linear system A * x = b\n * math.lusolve(lup, b) // returns column vector with the solution to the linear system A * x = b, lup = math.lup(A)\n *\n * Examples:\n *\n * const m = [[1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 3, 0], [0, 0, 0, 4]]\n *\n * const x = math.lusolve(m, [-1, -1, -1, -1]) // x = [[-1], [-0.5], [-1/3], [-0.25]]\n *\n * const f = math.lup(m)\n * const x1 = math.lusolve(f, [-1, -1, -1, -1]) // x1 = [[-1], [-0.5], [-1/3], [-0.25]]\n * const x2 = math.lusolve(f, [1, 2, 1, -1]) // x2 = [[1], [1], [1/3], [-0.25]]\n *\n * const a = [[-2, 3], [2, 1]]\n * const b = [11, 9]\n * const x = math.lusolve(a, b) // [[2], [5]]\n *\n * See also:\n *\n * lup, slu, lsolve, usolve\n *\n * @param {Matrix | Array | Object} A Invertible Matrix or the Matrix LU decomposition\n * @param {Matrix | Array} b Column Vector\n * @param {number} [order] The Symbolic Ordering and Analysis order, see slu for details. Matrix must be a SparseMatrix\n * @param {Number} [threshold] Partial pivoting threshold (1 for partial pivoting), see slu for details. Matrix must be a SparseMatrix.\n *\n * @return {DenseMatrix | Array} Column vector with the solution to the linear system A * x = b\n */\n return typed(name, {\n 'Array, Array | Matrix': function ArrayArrayMatrix(a, b) {\n a = matrix(a);\n var d = lup(a);\n var x = _lusolve(d.L, d.U, d.p, null, b);\n return x.valueOf();\n },\n 'DenseMatrix, Array | Matrix': function DenseMatrixArrayMatrix(a, b) {\n var d = lup(a);\n return _lusolve(d.L, d.U, d.p, null, b);\n },\n 'SparseMatrix, Array | Matrix': function SparseMatrixArrayMatrix(a, b) {\n var d = lup(a);\n return _lusolve(d.L, d.U, d.p, null, b);\n },\n 'SparseMatrix, Array | Matrix, number, number': function SparseMatrixArrayMatrixNumberNumber(a, b, order, threshold) {\n var d = slu(a, order, threshold);\n return _lusolve(d.L, d.U, d.p, d.q, b);\n },\n 'Object, Array | Matrix': function ObjectArrayMatrix(d, b) {\n return _lusolve(d.L, d.U, d.p, d.q, b);\n }\n });\n function _toMatrix(a) {\n if (isMatrix(a)) {\n return a;\n }\n if (isArray(a)) {\n return matrix(a);\n }\n throw new TypeError('Invalid Matrix LU decomposition');\n }\n function _lusolve(l, u, p, q, b) {\n // verify decomposition\n l = _toMatrix(l);\n u = _toMatrix(u);\n\n // apply row permutations if needed (b is a DenseMatrix)\n if (p) {\n b = solveValidation(l, b, true);\n b._data = csIpvec(p, b._data);\n }\n\n // use forward substitution to resolve L * y = b\n var y = lsolve(l, b);\n // use backward substitution to resolve U * x = y\n var x = usolve(u, y);\n\n // apply column permutations if needed (x is a DenseMatrix)\n if (q) {\n x._data = csIpvec(q, x._data);\n }\n return x;\n }\n});", "// Copyright (c) 2006-2024, Timothy A. Davis, All Rights Reserved.\n// SPDX-License-Identifier: LGPL-2.1+\n// https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/CSparse/Source\n\n/**\n * Permutes a vector; x = P'b. In MATLAB notation, x(p)=b.\n *\n * @param {Array} p The permutation vector of length n. null value denotes identity\n * @param {Array} b The input vector\n *\n * @return {Array} The output vector x = P'b\n */\nexport function csIpvec(p, b) {\n // vars\n var k;\n var n = b.length;\n var x = [];\n // check permutation vector was provided, p = null denotes identity\n if (p) {\n // loop vector\n for (k = 0; k < n; k++) {\n // apply permutation\n x[p[k]] = b[k];\n }\n } else {\n // loop vector\n for (k = 0; k < n; k++) {\n // x[i] = b[i]\n x[k] = b[k];\n }\n }\n return x;\n}", "import { factory } from '../../utils/factory.js';\nvar name = 'polynomialRoot';\nvar dependencies = ['typed', 'isZero', 'equalScalar', 'add', 'subtract', 'multiply', 'divide', 'sqrt', 'unaryMinus', 'cbrt', 'typeOf', 'im', 're'];\nexport var createPolynomialRoot = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isZero,\n equalScalar,\n add,\n subtract,\n multiply,\n divide,\n sqrt,\n unaryMinus,\n cbrt,\n typeOf,\n im,\n re\n } = _ref;\n /**\n * Finds the numerical values of the distinct roots of a polynomial with real or complex coefficients.\n * Currently operates only on linear, quadratic, and cubic polynomials using the standard\n * formulas for the roots.\n *\n * Syntax:\n *\n * math.polynomialRoot(constant, linearCoeff, quadraticCoeff, cubicCoeff)\n *\n * Examples:\n * // linear\n * math.polynomialRoot(6, 3) // [-2]\n * math.polynomialRoot(math.complex(6,3), 3) // [-2 - i]\n * math.polynomialRoot(math.complex(6,3), math.complex(2,1)) // [-3 + 0i]\n * // quadratic\n * math.polynomialRoot(2, -3, 1) // [2, 1]\n * math.polynomialRoot(8, 8, 2) // [-2]\n * math.polynomialRoot(-2, 0, 1) // [1.4142135623730951, -1.4142135623730951]\n * math.polynomialRoot(2, -2, 1) // [1 + i, 1 - i]\n * math.polynomialRoot(math.complex(1,3), math.complex(-3, -2), 1) // [2 + i, 1 + i]\n * // cubic\n * math.polynomialRoot(-6, 11, -6, 1) // [1, 3, 2]\n * math.polynomialRoot(-8, 0, 0, 1) // [-1 - 1.7320508075688774i, 2, -1 + 1.7320508075688774i]\n * math.polynomialRoot(0, 8, 8, 2) // [0, -2]\n * math.polynomialRoot(1, 1, 1, 1) // [-1 + 0i, 0 - i, 0 + i]\n *\n * See also:\n * cbrt, sqrt\n *\n * @param {... number | Complex} coeffs\n * The coefficients of the polynomial, starting with with the constant coefficent, followed\n * by the linear coefficient and subsequent coefficients of increasing powers.\n * @return {Array} The distinct roots of the polynomial\n */\n\n return typed(name, {\n 'number|Complex, ...number|Complex': (constant, restCoeffs) => {\n var coeffs = [constant, ...restCoeffs];\n while (coeffs.length > 0 && isZero(coeffs[coeffs.length - 1])) {\n coeffs.pop();\n }\n if (coeffs.length < 2) {\n throw new RangeError(\"Polynomial [\".concat(constant, \", \").concat(restCoeffs, \"] must have a non-zero non-constant coefficient\"));\n }\n switch (coeffs.length) {\n case 2:\n // linear\n return [unaryMinus(divide(coeffs[0], coeffs[1]))];\n case 3:\n {\n // quadratic\n var [c, b, a] = coeffs;\n var denom = multiply(2, a);\n var d1 = multiply(b, b);\n var d2 = multiply(4, a, c);\n if (equalScalar(d1, d2)) return [divide(unaryMinus(b), denom)];\n var discriminant = sqrt(subtract(d1, d2));\n return [divide(subtract(discriminant, b), denom), divide(subtract(unaryMinus(discriminant), b), denom)];\n }\n case 4:\n {\n // cubic, cf. https://en.wikipedia.org/wiki/Cubic_equation\n var [d, _c, _b, _a] = coeffs;\n var _denom = unaryMinus(multiply(3, _a));\n var D0_1 = multiply(_b, _b);\n var D0_2 = multiply(3, _a, _c);\n var D1_1 = add(multiply(2, _b, _b, _b), multiply(27, _a, _a, d));\n var D1_2 = multiply(9, _a, _b, _c);\n if (equalScalar(D0_1, D0_2) && equalScalar(D1_1, D1_2)) {\n return [divide(_b, _denom)];\n }\n var Delta0 = subtract(D0_1, D0_2);\n var Delta1 = subtract(D1_1, D1_2);\n var discriminant1 = add(multiply(18, _a, _b, _c, d), multiply(_b, _b, _c, _c));\n var discriminant2 = add(multiply(4, _b, _b, _b, d), multiply(4, _a, _c, _c, _c), multiply(27, _a, _a, d, d));\n if (equalScalar(discriminant1, discriminant2)) {\n return [divide(subtract(multiply(4, _a, _b, _c), add(multiply(9, _a, _a, d), multiply(_b, _b, _b))), multiply(_a, Delta0)),\n // simple root\n divide(subtract(multiply(9, _a, d), multiply(_b, _c)), multiply(2, Delta0)) // double root\n ];\n }\n // OK, we have three distinct roots\n var Ccubed;\n if (equalScalar(D0_1, D0_2)) {\n Ccubed = Delta1;\n } else {\n Ccubed = divide(add(Delta1, sqrt(subtract(multiply(Delta1, Delta1), multiply(4, Delta0, Delta0, Delta0)))), 2);\n }\n var allRoots = true;\n var rawRoots = cbrt(Ccubed, allRoots).toArray().map(C => divide(add(_b, C, divide(Delta0, C)), _denom));\n return rawRoots.map(r => {\n if (typeOf(r) === 'Complex' && equalScalar(re(r), re(r) + im(r))) {\n return re(r);\n }\n return r;\n });\n }\n default:\n throw new RangeError(\"only implemented for cubic or lower-order polynomials, not \".concat(coeffs));\n }\n }\n });\n});", "import { isHelp } from '../utils/is.js';\nimport { clone } from '../utils/object.js';\nimport { format } from '../utils/string.js';\nimport { factory } from '../utils/factory.js';\nvar name = 'Help';\nvar dependencies = ['evaluate'];\nexport var createHelpClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate\n } = _ref;\n /**\n * Documentation object\n * @param {Object} doc Object containing properties:\n * {string} name\n * {string} category\n * {string} description\n * {string[]} syntax\n * {string[]} examples\n * {string[]} seealso\n * @constructor\n */\n function Help(doc) {\n if (!(this instanceof Help)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (!doc) throw new Error('Argument \"doc\" missing');\n this.doc = doc;\n }\n\n /**\n * Attach type information\n */\n Help.prototype.type = 'Help';\n Help.prototype.isHelp = true;\n\n /**\n * Generate a string representation of the Help object\n * @return {string} Returns a string\n * @private\n */\n Help.prototype.toString = function () {\n var doc = this.doc || {};\n var desc = '\\n';\n if (doc.name) {\n desc += 'Name: ' + doc.name + '\\n\\n';\n }\n if (doc.category) {\n desc += 'Category: ' + doc.category + '\\n\\n';\n }\n if (doc.description) {\n desc += 'Description:\\n ' + doc.description + '\\n\\n';\n }\n if (doc.syntax) {\n desc += 'Syntax:\\n ' + doc.syntax.join('\\n ') + '\\n\\n';\n }\n if (doc.examples) {\n desc += 'Examples:\\n';\n\n // after evaluating the examples, we restore config in case the examples\n // did change the config.\n var configChanged = false;\n var originalConfig = evaluate('config()');\n var scope = {\n config: newConfig => {\n configChanged = true;\n return evaluate('config(newConfig)', {\n newConfig\n });\n }\n };\n for (var i = 0; i < doc.examples.length; i++) {\n var expr = doc.examples[i];\n desc += ' ' + expr + '\\n';\n var res = void 0;\n try {\n // note: res can be undefined when `expr` is an empty string\n res = evaluate(expr, scope);\n } catch (e) {\n res = e;\n }\n if (res !== undefined && !isHelp(res)) {\n desc += ' ' + format(res, {\n precision: 14\n }) + '\\n';\n }\n }\n desc += '\\n';\n if (configChanged) {\n evaluate('config(originalConfig)', {\n originalConfig\n });\n }\n }\n if (doc.mayThrow && doc.mayThrow.length) {\n desc += 'Throws: ' + doc.mayThrow.join(', ') + '\\n\\n';\n }\n if (doc.seealso && doc.seealso.length) {\n desc += 'See also: ' + doc.seealso.join(', ') + '\\n';\n }\n return desc;\n };\n\n /**\n * Export the help object to JSON\n */\n Help.prototype.toJSON = function () {\n var obj = clone(this.doc);\n obj.mathjs = 'Help';\n return obj;\n };\n\n /**\n * Instantiate a Help object from a JSON object\n * @param {Object} json\n * @returns {Help} Returns a new Help object\n */\n Help.fromJSON = function (json) {\n var doc = {};\n Object.keys(json).filter(prop => prop !== 'mathjs').forEach(prop => {\n doc[prop] = json[prop];\n });\n return new Help(doc);\n };\n\n /**\n * Returns a string representation of the Help object\n */\n Help.prototype.valueOf = Help.prototype.toString;\n return Help;\n}, {\n isClass: true\n});", "import { isChain } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { hasOwnProperty, lazy } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Chain';\nvar dependencies = ['?on', 'math', 'typed'];\nexport var createChainClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n math,\n typed\n } = _ref;\n /**\n * @constructor Chain\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing chain.done(), which will return\n * the final value.\n *\n * The Chain has a number of special functions:\n * - done() Finalize the chained operation and return the\n * chain's value.\n * - valueOf() The same as done()\n * - toString() Returns a string representation of the chain's value.\n *\n * @param {*} [value]\n */\n function Chain(value) {\n if (!(this instanceof Chain)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (isChain(value)) {\n this.value = value.value;\n } else {\n this.value = value;\n }\n }\n\n /**\n * Attach type information\n */\n Chain.prototype.type = 'Chain';\n Chain.prototype.isChain = true;\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method valueOf()\n * @returns {*} value\n */\n Chain.prototype.done = function () {\n return this.value;\n };\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method done()\n * @returns {*} value\n */\n Chain.prototype.valueOf = function () {\n return this.value;\n };\n\n /**\n * Get a string representation of the value in the chain\n * @returns {string}\n */\n Chain.prototype.toString = function () {\n return format(this.value);\n };\n\n /**\n * Get a JSON representation of the chain\n * @returns {Object}\n */\n Chain.prototype.toJSON = function () {\n return {\n mathjs: 'Chain',\n value: this.value\n };\n };\n\n /**\n * Instantiate a Chain from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"Chain\", value: ...}`,\n * where mathjs is optional\n * @returns {Chain}\n */\n Chain.fromJSON = function (json) {\n return new Chain(json.value);\n };\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {Function} fn The function to be proxied\n * If fn is no function, it is silently ignored.\n * @private\n */\n function createProxy(name, fn) {\n if (typeof fn === 'function') {\n Chain.prototype[name] = chainify(fn);\n }\n }\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {function} resolver The function resolving with the\n * function to be proxied\n * @private\n */\n function createLazyProxy(name, resolver) {\n lazy(Chain.prototype, name, function outerResolver() {\n var fn = resolver();\n if (typeof fn === 'function') {\n return chainify(fn);\n }\n return undefined; // if not a function, ignore\n });\n }\n\n /**\n * Make a function chainable\n * @param {function} fn\n * @return {Function} chain function\n * @private\n */\n function chainify(fn) {\n return function () {\n // Here, `this` will be the context of a Chain instance\n if (arguments.length === 0) {\n return new Chain(fn(this.value));\n }\n var args = [this.value];\n for (var i = 0; i < arguments.length; i++) {\n args[i + 1] = arguments[i];\n }\n if (typed.isTypedFunction(fn)) {\n var sigObject = typed.resolve(fn, args);\n // We want to detect if a rest parameter has matched across the\n // value in the chain and the current arguments of this call.\n // That is the case if and only if the matching signature has\n // exactly one parameter (which then must be a rest parameter\n // as it is matching at least two actual arguments).\n if (sigObject.params.length === 1) {\n throw new Error('chain function ' + fn.name + ' cannot match rest parameter between chain value and additional arguments.');\n }\n return new Chain(sigObject.implementation.apply(fn, args));\n }\n return new Chain(fn.apply(fn, args));\n };\n }\n\n /**\n * Create a proxy for a single method, or an object with multiple methods.\n * Example usage:\n *\n * Chain.createProxy('add', function add (x, y) {...})\n * Chain.createProxy({\n * add: function add (x, y) {...},\n * subtract: function subtract (x, y) {...}\n * }\n *\n * @param {string | Object} arg0 A name (string), or an object with\n * functions\n * @param {*} [arg1] A function, when arg0 is a name\n */\n Chain.createProxy = function (arg0, arg1) {\n if (typeof arg0 === 'string') {\n // createProxy(name, value)\n createProxy(arg0, arg1);\n } else {\n var _loop = function _loop(_name) {\n if (hasOwnProperty(arg0, _name) && excludedNames[_name] === undefined) {\n createLazyProxy(_name, () => arg0[_name]);\n }\n };\n // createProxy(values)\n for (var _name in arg0) {\n _loop(_name);\n }\n }\n };\n var excludedNames = {\n expression: true,\n docs: true,\n type: true,\n classes: true,\n json: true,\n error: true,\n isChain: true // conflicts with the property isChain of a Chain instance\n };\n\n // create proxy for everything that is in math.js\n Chain.createProxy(math);\n\n // register on the import event, automatically add a proxy for every imported function.\n if (on) {\n on('import', function (name, resolver, path) {\n if (!path) {\n // an imported function (not a data type or something special)\n createLazyProxy(name, resolver);\n }\n });\n }\n return Chain;\n}, {\n isClass: true\n});", "import { factory } from '../../utils/factory.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { embeddedDocs } from '../embeddedDocs/embeddedDocs.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nvar name = 'help';\nvar dependencies = ['typed', 'mathWithTransform', 'Help'];\nexport var createHelp = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n mathWithTransform,\n Help\n } = _ref;\n /**\n * Retrieve help on a function or data type.\n * Help files are retrieved from the embedded documentation in math.docs.\n *\n * Syntax:\n *\n * math.help(search)\n *\n * Examples:\n *\n * console.log(math.help('sin').toString())\n * console.log(math.help(math.add).toString())\n * console.log(math.help(math.add).toJSON())\n *\n * @param {Function | string | Object} search A function or function name\n * for which to get help\n * @return {Help} A help object\n */\n return typed(name, {\n any: function any(search) {\n var prop;\n var searchName = search;\n if (typeof search !== 'string') {\n for (prop in mathWithTransform) {\n // search in functions and constants\n if (hasOwnProperty(mathWithTransform, prop) && search === mathWithTransform[prop]) {\n searchName = prop;\n break;\n }\n }\n\n /* TODO: implement help for data types\n if (!text) {\n // search data type\n for (prop in math.type) {\n if (hasOwnProperty(math, prop)) {\n if (search === math.type[prop]) {\n text = prop\n break\n }\n }\n }\n }\n */\n }\n var doc = getSafeProperty(embeddedDocs, searchName);\n if (!doc) {\n var searchText = typeof searchName === 'function' ? searchName.name : searchName;\n throw new Error('No documentation found on \"' + searchText + '\"');\n }\n return new Help(doc);\n }\n });\n});", "import { eDocs } from './constants/e.js';\nimport { falseDocs } from './constants/false.js';\nimport { iDocs } from './constants/i.js';\nimport { InfinityDocs } from './constants/Infinity.js';\nimport { LN10Docs } from './constants/LN10.js';\nimport { LN2Docs } from './constants/LN2.js';\nimport { LOG10EDocs } from './constants/LOG10E.js';\nimport { LOG2EDocs } from './constants/LOG2E.js';\nimport { NaNDocs } from './constants/NaN.js';\nimport { nullDocs } from './constants/null.js';\nimport { phiDocs } from './constants/phi.js';\nimport { piDocs } from './constants/pi.js';\nimport { SQRT12Docs } from './constants/SQRT1_2.js';\nimport { SQRT2Docs } from './constants/SQRT2.js';\nimport { tauDocs } from './constants/tau.js';\nimport { trueDocs } from './constants/true.js';\nimport { versionDocs } from './constants/version.js';\nimport { bignumberDocs } from './construction/bignumber.js';\nimport { bigintDocs } from './construction/bigint.js';\nimport { booleanDocs } from './construction/boolean.js';\nimport { complexDocs } from './construction/complex.js';\nimport { createUnitDocs } from './construction/createUnit.js';\nimport { fractionDocs } from './construction/fraction.js';\nimport { indexDocs } from './construction/index.js';\nimport { matrixDocs } from './construction/matrix.js';\nimport { numberDocs } from './construction/number.js';\nimport { sparseDocs } from './construction/sparse.js';\nimport { splitUnitDocs } from './construction/splitUnit.js';\nimport { stringDocs } from './construction/string.js';\nimport { unitDocs } from './construction/unit.js';\nimport { configDocs } from './core/config.js';\nimport { importDocs } from './core/import.js';\nimport { typedDocs } from './core/typed.js';\nimport { derivativeDocs } from './function/algebra/derivative.js';\nimport { leafCountDocs } from './function/algebra/leafCount.js';\nimport { lsolveDocs } from './function/algebra/lsolve.js';\nimport { lsolveAllDocs } from './function/algebra/lsolveAll.js';\nimport { lupDocs } from './function/algebra/lup.js';\nimport { lusolveDocs } from './function/algebra/lusolve.js';\nimport { polynomialRootDocs } from './function/algebra/polynomialRoot.js';\nimport { qrDocs } from './function/algebra/qr.js';\nimport { rationalizeDocs } from './function/algebra/rationalize.js';\nimport { resolveDocs } from './function/algebra/resolve.js';\nimport { simplifyDocs } from './function/algebra/simplify.js';\nimport { simplifyConstantDocs } from './function/algebra/simplifyConstant.js';\nimport { simplifyCoreDocs } from './function/algebra/simplifyCore.js';\nimport { sluDocs } from './function/algebra/slu.js';\nimport { symbolicEqualDocs } from './function/algebra/symbolicEqual.js';\nimport { usolveDocs } from './function/algebra/usolve.js';\nimport { usolveAllDocs } from './function/algebra/usolveAll.js';\nimport { absDocs } from './function/arithmetic/abs.js';\nimport { addDocs } from './function/arithmetic/add.js';\nimport { cbrtDocs } from './function/arithmetic/cbrt.js';\nimport { ceilDocs } from './function/arithmetic/ceil.js';\nimport { cubeDocs } from './function/arithmetic/cube.js';\nimport { divideDocs } from './function/arithmetic/divide.js';\nimport { dotDivideDocs } from './function/arithmetic/dotDivide.js';\nimport { dotMultiplyDocs } from './function/arithmetic/dotMultiply.js';\nimport { dotPowDocs } from './function/arithmetic/dotPow.js';\nimport { expDocs } from './function/arithmetic/exp.js';\nimport { expmDocs } from './function/arithmetic/expm.js';\nimport { expm1Docs } from './function/arithmetic/expm1.js';\nimport { fixDocs } from './function/arithmetic/fix.js';\nimport { floorDocs } from './function/arithmetic/floor.js';\nimport { gcdDocs } from './function/arithmetic/gcd.js';\nimport { hypotDocs } from './function/arithmetic/hypot.js';\nimport { invmodDocs } from './function/arithmetic/invmod.js';\nimport { lcmDocs } from './function/arithmetic/lcm.js';\nimport { logDocs } from './function/arithmetic/log.js';\nimport { log10Docs } from './function/arithmetic/log10.js';\nimport { log1pDocs } from './function/arithmetic/log1p.js';\nimport { log2Docs } from './function/arithmetic/log2.js';\nimport { modDocs } from './function/arithmetic/mod.js';\nimport { multiplyDocs } from './function/arithmetic/multiply.js';\nimport { normDocs } from './function/arithmetic/norm.js';\nimport { nthRootDocs } from './function/arithmetic/nthRoot.js';\nimport { nthRootsDocs } from './function/arithmetic/nthRoots.js';\nimport { powDocs } from './function/arithmetic/pow.js';\nimport { roundDocs } from './function/arithmetic/round.js';\nimport { signDocs } from './function/arithmetic/sign.js';\nimport { sqrtDocs } from './function/arithmetic/sqrt.js';\nimport { sqrtmDocs } from './function/arithmetic/sqrtm.js';\nimport { sylvesterDocs } from './function/algebra/sylvester.js';\nimport { schurDocs } from './function/algebra/schur.js';\nimport { lyapDocs } from './function/algebra/lyap.js';\nimport { squareDocs } from './function/arithmetic/square.js';\nimport { subtractDocs } from './function/arithmetic/subtract.js';\nimport { unaryMinusDocs } from './function/arithmetic/unaryMinus.js';\nimport { unaryPlusDocs } from './function/arithmetic/unaryPlus.js';\nimport { xgcdDocs } from './function/arithmetic/xgcd.js';\nimport { bitAndDocs } from './function/bitwise/bitAnd.js';\nimport { bitNotDocs } from './function/bitwise/bitNot.js';\nimport { bitOrDocs } from './function/bitwise/bitOr.js';\nimport { bitXorDocs } from './function/bitwise/bitXor.js';\nimport { leftShiftDocs } from './function/bitwise/leftShift.js';\nimport { rightArithShiftDocs } from './function/bitwise/rightArithShift.js';\nimport { rightLogShiftDocs } from './function/bitwise/rightLogShift.js';\nimport { bellNumbersDocs } from './function/combinatorics/bellNumbers.js';\nimport { catalanDocs } from './function/combinatorics/catalan.js';\nimport { compositionDocs } from './function/combinatorics/composition.js';\nimport { stirlingS2Docs } from './function/combinatorics/stirlingS2.js';\nimport { argDocs } from './function/complex/arg.js';\nimport { conjDocs } from './function/complex/conj.js';\nimport { imDocs } from './function/complex/im.js';\nimport { reDocs } from './function/complex/re.js';\nimport { evaluateDocs } from './function/expression/evaluate.js';\nimport { helpDocs } from './function/expression/help.js';\nimport { distanceDocs } from './function/geometry/distance.js';\nimport { intersectDocs } from './function/geometry/intersect.js';\nimport { andDocs } from './function/logical/and.js';\nimport { notDocs } from './function/logical/not.js';\nimport { orDocs } from './function/logical/or.js';\nimport { xorDocs } from './function/logical/xor.js';\nimport { columnDocs } from './function/matrix/column.js';\nimport { concatDocs } from './function/matrix/concat.js';\nimport { countDocs } from './function/matrix/count.js';\nimport { crossDocs } from './function/matrix/cross.js';\nimport { ctransposeDocs } from './function/matrix/ctranspose.js';\nimport { detDocs } from './function/matrix/det.js';\nimport { diagDocs } from './function/matrix/diag.js';\nimport { diffDocs } from './function/matrix/diff.js';\nimport { dotDocs } from './function/matrix/dot.js';\nimport { eigsDocs } from './function/matrix/eigs.js';\nimport { filterDocs } from './function/matrix/filter.js';\nimport { flattenDocs } from './function/matrix/flatten.js';\nimport { forEachDocs } from './function/matrix/forEach.js';\nimport { getMatrixDataTypeDocs } from './function/matrix/getMatrixDataType.js';\nimport { identityDocs } from './function/matrix/identity.js';\nimport { invDocs } from './function/matrix/inv.js';\nimport { pinvDocs } from './function/matrix/pinv.js';\nimport { kronDocs } from './function/matrix/kron.js';\nimport { mapDocs } from './function/matrix/map.js';\nimport { matrixFromColumnsDocs } from './function/matrix/matrixFromColumns.js';\nimport { matrixFromFunctionDocs } from './function/matrix/matrixFromFunction.js';\nimport { matrixFromRowsDocs } from './function/matrix/matrixFromRows.js';\nimport { onesDocs } from './function/matrix/ones.js';\nimport { partitionSelectDocs } from './function/matrix/partitionSelect.js';\nimport { rangeDocs } from './function/matrix/range.js';\nimport { reshapeDocs } from './function/matrix/reshape.js';\nimport { resizeDocs } from './function/matrix/resize.js';\nimport { rotateDocs } from './function/matrix/rotate.js';\nimport { rotationMatrixDocs } from './function/matrix/rotationMatrix.js';\nimport { rowDocs } from './function/matrix/row.js';\nimport { sizeDocs } from './function/matrix/size.js';\nimport { sortDocs } from './function/matrix/sort.js';\nimport { squeezeDocs } from './function/matrix/squeeze.js';\nimport { subsetDocs } from './function/matrix/subset.js';\nimport { traceDocs } from './function/matrix/trace.js';\nimport { transposeDocs } from './function/matrix/transpose.js';\nimport { zerosDocs } from './function/matrix/zeros.js';\nimport { fftDocs } from './function/matrix/fft.js';\nimport { ifftDocs } from './function/matrix/ifft.js';\nimport { combinationsDocs } from './function/probability/combinations.js';\nimport { combinationsWithRepDocs } from './function/probability/combinationsWithRep.js';\nimport { factorialDocs } from './function/probability/factorial.js';\nimport { gammaDocs } from './function/probability/gamma.js';\nimport { lgammaDocs } from './function/probability/lgamma.js';\nimport { kldivergenceDocs } from './function/probability/kldivergence.js';\nimport { multinomialDocs } from './function/probability/multinomial.js';\nimport { permutationsDocs } from './function/probability/permutations.js';\nimport { pickRandomDocs } from './function/probability/pickRandom.js';\nimport { randomDocs } from './function/probability/random.js';\nimport { randomIntDocs } from './function/probability/randomInt.js';\nimport { compareDocs } from './function/relational/compare.js';\nimport { compareNaturalDocs } from './function/relational/compareNatural.js';\nimport { compareTextDocs } from './function/relational/compareText.js';\nimport { deepEqualDocs } from './function/relational/deepEqual.js';\nimport { equalDocs } from './function/relational/equal.js';\nimport { equalTextDocs } from './function/relational/equalText.js';\nimport { largerDocs } from './function/relational/larger.js';\nimport { largerEqDocs } from './function/relational/largerEq.js';\nimport { smallerDocs } from './function/relational/smaller.js';\nimport { smallerEqDocs } from './function/relational/smallerEq.js';\nimport { unequalDocs } from './function/relational/unequal.js';\nimport { setCartesianDocs } from './function/set/setCartesian.js';\nimport { setDifferenceDocs } from './function/set/setDifference.js';\nimport { setDistinctDocs } from './function/set/setDistinct.js';\nimport { setIntersectDocs } from './function/set/setIntersect.js';\nimport { setIsSubsetDocs } from './function/set/setIsSubset.js';\nimport { setMultiplicityDocs } from './function/set/setMultiplicity.js';\nimport { setPowersetDocs } from './function/set/setPowerset.js';\nimport { setSizeDocs } from './function/set/setSize.js';\nimport { setSymDifferenceDocs } from './function/set/setSymDifference.js';\nimport { setUnionDocs } from './function/set/setUnion.js';\nimport { zpk2tfDocs } from './function/signal/zpk2tf.js';\nimport { freqzDocs } from './function/signal/freqz.js';\nimport { erfDocs } from './function/special/erf.js';\nimport { zetaDocs } from './function/special/zeta.js';\nimport { madDocs } from './function/statistics/mad.js';\nimport { maxDocs } from './function/statistics/max.js';\nimport { meanDocs } from './function/statistics/mean.js';\nimport { medianDocs } from './function/statistics/median.js';\nimport { minDocs } from './function/statistics/min.js';\nimport { modeDocs } from './function/statistics/mode.js';\nimport { prodDocs } from './function/statistics/prod.js';\nimport { quantileSeqDocs } from './function/statistics/quantileSeq.js';\nimport { stdDocs } from './function/statistics/std.js';\nimport { cumSumDocs } from './function/statistics/cumsum.js';\nimport { sumDocs } from './function/statistics/sum.js';\nimport { varianceDocs } from './function/statistics/variance.js';\nimport { corrDocs } from './function/statistics/corr.js';\nimport { acosDocs } from './function/trigonometry/acos.js';\nimport { acoshDocs } from './function/trigonometry/acosh.js';\nimport { acotDocs } from './function/trigonometry/acot.js';\nimport { acothDocs } from './function/trigonometry/acoth.js';\nimport { acscDocs } from './function/trigonometry/acsc.js';\nimport { acschDocs } from './function/trigonometry/acsch.js';\nimport { asecDocs } from './function/trigonometry/asec.js';\nimport { asechDocs } from './function/trigonometry/asech.js';\nimport { asinDocs } from './function/trigonometry/asin.js';\nimport { asinhDocs } from './function/trigonometry/asinh.js';\nimport { atanDocs } from './function/trigonometry/atan.js';\nimport { atan2Docs } from './function/trigonometry/atan2.js';\nimport { atanhDocs } from './function/trigonometry/atanh.js';\nimport { cosDocs } from './function/trigonometry/cos.js';\nimport { coshDocs } from './function/trigonometry/cosh.js';\nimport { cotDocs } from './function/trigonometry/cot.js';\nimport { cothDocs } from './function/trigonometry/coth.js';\nimport { cscDocs } from './function/trigonometry/csc.js';\nimport { cschDocs } from './function/trigonometry/csch.js';\nimport { secDocs } from './function/trigonometry/sec.js';\nimport { sechDocs } from './function/trigonometry/sech.js';\nimport { sinDocs } from './function/trigonometry/sin.js';\nimport { sinhDocs } from './function/trigonometry/sinh.js';\nimport { tanDocs } from './function/trigonometry/tan.js';\nimport { tanhDocs } from './function/trigonometry/tanh.js';\nimport { toDocs } from './function/units/to.js';\nimport { binDocs } from './function/utils/bin.js';\nimport { cloneDocs } from './function/utils/clone.js';\nimport { formatDocs } from './function/utils/format.js';\nimport { hasNumericValueDocs } from './function/utils/hasNumericValue.js';\nimport { hexDocs } from './function/utils/hex.js';\nimport { isIntegerDocs } from './function/utils/isInteger.js';\nimport { isNaNDocs } from './function/utils/isNaN.js';\nimport { isNegativeDocs } from './function/utils/isNegative.js';\nimport { isNumericDocs } from './function/utils/isNumeric.js';\nimport { isPositiveDocs } from './function/utils/isPositive.js';\nimport { isPrimeDocs } from './function/utils/isPrime.js';\nimport { isZeroDocs } from './function/utils/isZero.js';\nimport { numericDocs } from './function/utils/numeric.js';\nimport { octDocs } from './function/utils/oct.js';\nimport { printDocs } from './function/utils/print.js';\nimport { typeOfDocs } from './function/utils/typeOf.js';\nimport { solveODEDocs } from './function/numeric/solveODE.js';\nexport var embeddedDocs = {\n // construction functions\n bignumber: bignumberDocs,\n bigint: bigintDocs,\n boolean: booleanDocs,\n complex: complexDocs,\n createUnit: createUnitDocs,\n fraction: fractionDocs,\n index: indexDocs,\n matrix: matrixDocs,\n number: numberDocs,\n sparse: sparseDocs,\n splitUnit: splitUnitDocs,\n string: stringDocs,\n unit: unitDocs,\n // constants\n e: eDocs,\n E: eDocs,\n false: falseDocs,\n i: iDocs,\n Infinity: InfinityDocs,\n LN2: LN2Docs,\n LN10: LN10Docs,\n LOG2E: LOG2EDocs,\n LOG10E: LOG10EDocs,\n NaN: NaNDocs,\n null: nullDocs,\n pi: piDocs,\n PI: piDocs,\n phi: phiDocs,\n SQRT1_2: SQRT12Docs,\n SQRT2: SQRT2Docs,\n tau: tauDocs,\n true: trueDocs,\n version: versionDocs,\n // physical constants\n // TODO: more detailed docs for physical constants\n speedOfLight: {\n description: 'Speed of light in vacuum',\n examples: ['speedOfLight']\n },\n gravitationConstant: {\n description: 'Newtonian constant of gravitation',\n examples: ['gravitationConstant']\n },\n planckConstant: {\n description: 'Planck constant',\n examples: ['planckConstant']\n },\n reducedPlanckConstant: {\n description: 'Reduced Planck constant',\n examples: ['reducedPlanckConstant']\n },\n magneticConstant: {\n description: 'Magnetic constant (vacuum permeability)',\n examples: ['magneticConstant']\n },\n electricConstant: {\n description: 'Electric constant (vacuum permeability)',\n examples: ['electricConstant']\n },\n vacuumImpedance: {\n description: 'Characteristic impedance of vacuum',\n examples: ['vacuumImpedance']\n },\n coulomb: {\n description: 'Coulomb\\'s constant',\n examples: ['coulomb']\n },\n elementaryCharge: {\n description: 'Elementary charge',\n examples: ['elementaryCharge']\n },\n bohrMagneton: {\n description: 'Borh magneton',\n examples: ['bohrMagneton']\n },\n conductanceQuantum: {\n description: 'Conductance quantum',\n examples: ['conductanceQuantum']\n },\n inverseConductanceQuantum: {\n description: 'Inverse conductance quantum',\n examples: ['inverseConductanceQuantum']\n },\n // josephson: {description: 'Josephson constant', examples: ['josephson']},\n magneticFluxQuantum: {\n description: 'Magnetic flux quantum',\n examples: ['magneticFluxQuantum']\n },\n nuclearMagneton: {\n description: 'Nuclear magneton',\n examples: ['nuclearMagneton']\n },\n klitzing: {\n description: 'Von Klitzing constant',\n examples: ['klitzing']\n },\n bohrRadius: {\n description: 'Borh radius',\n examples: ['bohrRadius']\n },\n classicalElectronRadius: {\n description: 'Classical electron radius',\n examples: ['classicalElectronRadius']\n },\n electronMass: {\n description: 'Electron mass',\n examples: ['electronMass']\n },\n fermiCoupling: {\n description: 'Fermi coupling constant',\n examples: ['fermiCoupling']\n },\n fineStructure: {\n description: 'Fine-structure constant',\n examples: ['fineStructure']\n },\n hartreeEnergy: {\n description: 'Hartree energy',\n examples: ['hartreeEnergy']\n },\n protonMass: {\n description: 'Proton mass',\n examples: ['protonMass']\n },\n deuteronMass: {\n description: 'Deuteron Mass',\n examples: ['deuteronMass']\n },\n neutronMass: {\n description: 'Neutron mass',\n examples: ['neutronMass']\n },\n quantumOfCirculation: {\n description: 'Quantum of circulation',\n examples: ['quantumOfCirculation']\n },\n rydberg: {\n description: 'Rydberg constant',\n examples: ['rydberg']\n },\n thomsonCrossSection: {\n description: 'Thomson cross section',\n examples: ['thomsonCrossSection']\n },\n weakMixingAngle: {\n description: 'Weak mixing angle',\n examples: ['weakMixingAngle']\n },\n efimovFactor: {\n description: 'Efimov factor',\n examples: ['efimovFactor']\n },\n atomicMass: {\n description: 'Atomic mass constant',\n examples: ['atomicMass']\n },\n avogadro: {\n description: 'Avogadro\\'s number',\n examples: ['avogadro']\n },\n boltzmann: {\n description: 'Boltzmann constant',\n examples: ['boltzmann']\n },\n faraday: {\n description: 'Faraday constant',\n examples: ['faraday']\n },\n firstRadiation: {\n description: 'First radiation constant',\n examples: ['firstRadiation']\n },\n loschmidt: {\n description: 'Loschmidt constant at T=273.15 K and p=101.325 kPa',\n examples: ['loschmidt']\n },\n gasConstant: {\n description: 'Gas constant',\n examples: ['gasConstant']\n },\n molarPlanckConstant: {\n description: 'Molar Planck constant',\n examples: ['molarPlanckConstant']\n },\n molarVolume: {\n description: 'Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa',\n examples: ['molarVolume']\n },\n sackurTetrode: {\n description: 'Sackur-Tetrode constant at T=1 K and p=101.325 kPa',\n examples: ['sackurTetrode']\n },\n secondRadiation: {\n description: 'Second radiation constant',\n examples: ['secondRadiation']\n },\n stefanBoltzmann: {\n description: 'Stefan-Boltzmann constant',\n examples: ['stefanBoltzmann']\n },\n wienDisplacement: {\n description: 'Wien displacement law constant',\n examples: ['wienDisplacement']\n },\n // spectralRadiance: {description: 'First radiation constant for spectral radiance', examples: ['spectralRadiance']},\n\n molarMass: {\n description: 'Molar mass constant',\n examples: ['molarMass']\n },\n molarMassC12: {\n description: 'Molar mass constant of carbon-12',\n examples: ['molarMassC12']\n },\n gravity: {\n description: 'Standard acceleration of gravity (standard acceleration of free-fall on Earth)',\n examples: ['gravity']\n },\n planckLength: {\n description: 'Planck length',\n examples: ['planckLength']\n },\n planckMass: {\n description: 'Planck mass',\n examples: ['planckMass']\n },\n planckTime: {\n description: 'Planck time',\n examples: ['planckTime']\n },\n planckCharge: {\n description: 'Planck charge',\n examples: ['planckCharge']\n },\n planckTemperature: {\n description: 'Planck temperature',\n examples: ['planckTemperature']\n },\n // functions - algebra\n derivative: derivativeDocs,\n lsolve: lsolveDocs,\n lsolveAll: lsolveAllDocs,\n lup: lupDocs,\n lusolve: lusolveDocs,\n leafCount: leafCountDocs,\n polynomialRoot: polynomialRootDocs,\n resolve: resolveDocs,\n simplify: simplifyDocs,\n simplifyConstant: simplifyConstantDocs,\n simplifyCore: simplifyCoreDocs,\n symbolicEqual: symbolicEqualDocs,\n rationalize: rationalizeDocs,\n slu: sluDocs,\n usolve: usolveDocs,\n usolveAll: usolveAllDocs,\n qr: qrDocs,\n // functions - arithmetic\n abs: absDocs,\n add: addDocs,\n cbrt: cbrtDocs,\n ceil: ceilDocs,\n cube: cubeDocs,\n divide: divideDocs,\n dotDivide: dotDivideDocs,\n dotMultiply: dotMultiplyDocs,\n dotPow: dotPowDocs,\n exp: expDocs,\n expm: expmDocs,\n expm1: expm1Docs,\n fix: fixDocs,\n floor: floorDocs,\n gcd: gcdDocs,\n hypot: hypotDocs,\n lcm: lcmDocs,\n log: logDocs,\n log2: log2Docs,\n log1p: log1pDocs,\n log10: log10Docs,\n mod: modDocs,\n multiply: multiplyDocs,\n norm: normDocs,\n nthRoot: nthRootDocs,\n nthRoots: nthRootsDocs,\n pow: powDocs,\n round: roundDocs,\n sign: signDocs,\n sqrt: sqrtDocs,\n sqrtm: sqrtmDocs,\n square: squareDocs,\n subtract: subtractDocs,\n unaryMinus: unaryMinusDocs,\n unaryPlus: unaryPlusDocs,\n xgcd: xgcdDocs,\n invmod: invmodDocs,\n // functions - bitwise\n bitAnd: bitAndDocs,\n bitNot: bitNotDocs,\n bitOr: bitOrDocs,\n bitXor: bitXorDocs,\n leftShift: leftShiftDocs,\n rightArithShift: rightArithShiftDocs,\n rightLogShift: rightLogShiftDocs,\n // functions - combinatorics\n bellNumbers: bellNumbersDocs,\n catalan: catalanDocs,\n composition: compositionDocs,\n stirlingS2: stirlingS2Docs,\n // functions - core\n config: configDocs,\n import: importDocs,\n typed: typedDocs,\n // functions - complex\n arg: argDocs,\n conj: conjDocs,\n re: reDocs,\n im: imDocs,\n // functions - expression\n evaluate: evaluateDocs,\n help: helpDocs,\n // functions - geometry\n distance: distanceDocs,\n intersect: intersectDocs,\n // functions - logical\n and: andDocs,\n not: notDocs,\n or: orDocs,\n xor: xorDocs,\n // functions - matrix\n concat: concatDocs,\n count: countDocs,\n cross: crossDocs,\n column: columnDocs,\n ctranspose: ctransposeDocs,\n det: detDocs,\n diag: diagDocs,\n diff: diffDocs,\n dot: dotDocs,\n getMatrixDataType: getMatrixDataTypeDocs,\n identity: identityDocs,\n filter: filterDocs,\n flatten: flattenDocs,\n forEach: forEachDocs,\n inv: invDocs,\n pinv: pinvDocs,\n eigs: eigsDocs,\n kron: kronDocs,\n matrixFromFunction: matrixFromFunctionDocs,\n matrixFromRows: matrixFromRowsDocs,\n matrixFromColumns: matrixFromColumnsDocs,\n map: mapDocs,\n ones: onesDocs,\n partitionSelect: partitionSelectDocs,\n range: rangeDocs,\n resize: resizeDocs,\n reshape: reshapeDocs,\n rotate: rotateDocs,\n rotationMatrix: rotationMatrixDocs,\n row: rowDocs,\n size: sizeDocs,\n sort: sortDocs,\n squeeze: squeezeDocs,\n subset: subsetDocs,\n trace: traceDocs,\n transpose: transposeDocs,\n zeros: zerosDocs,\n fft: fftDocs,\n ifft: ifftDocs,\n sylvester: sylvesterDocs,\n schur: schurDocs,\n lyap: lyapDocs,\n // functions - numeric\n solveODE: solveODEDocs,\n // functions - probability\n combinations: combinationsDocs,\n combinationsWithRep: combinationsWithRepDocs,\n // distribution: distributionDocs,\n factorial: factorialDocs,\n gamma: gammaDocs,\n kldivergence: kldivergenceDocs,\n lgamma: lgammaDocs,\n multinomial: multinomialDocs,\n permutations: permutationsDocs,\n pickRandom: pickRandomDocs,\n random: randomDocs,\n randomInt: randomIntDocs,\n // functions - relational\n compare: compareDocs,\n compareNatural: compareNaturalDocs,\n compareText: compareTextDocs,\n deepEqual: deepEqualDocs,\n equal: equalDocs,\n equalText: equalTextDocs,\n larger: largerDocs,\n largerEq: largerEqDocs,\n smaller: smallerDocs,\n smallerEq: smallerEqDocs,\n unequal: unequalDocs,\n // functions - set\n setCartesian: setCartesianDocs,\n setDifference: setDifferenceDocs,\n setDistinct: setDistinctDocs,\n setIntersect: setIntersectDocs,\n setIsSubset: setIsSubsetDocs,\n setMultiplicity: setMultiplicityDocs,\n setPowerset: setPowersetDocs,\n setSize: setSizeDocs,\n setSymDifference: setSymDifferenceDocs,\n setUnion: setUnionDocs,\n // functions - signal\n zpk2tf: zpk2tfDocs,\n freqz: freqzDocs,\n // functions - special\n erf: erfDocs,\n zeta: zetaDocs,\n // functions - statistics\n cumsum: cumSumDocs,\n mad: madDocs,\n max: maxDocs,\n mean: meanDocs,\n median: medianDocs,\n min: minDocs,\n mode: modeDocs,\n prod: prodDocs,\n quantileSeq: quantileSeqDocs,\n std: stdDocs,\n sum: sumDocs,\n variance: varianceDocs,\n corr: corrDocs,\n // functions - trigonometry\n acos: acosDocs,\n acosh: acoshDocs,\n acot: acotDocs,\n acoth: acothDocs,\n acsc: acscDocs,\n acsch: acschDocs,\n asec: asecDocs,\n asech: asechDocs,\n asin: asinDocs,\n asinh: asinhDocs,\n atan: atanDocs,\n atanh: atanhDocs,\n atan2: atan2Docs,\n cos: cosDocs,\n cosh: coshDocs,\n cot: cotDocs,\n coth: cothDocs,\n csc: cscDocs,\n csch: cschDocs,\n sec: secDocs,\n sech: sechDocs,\n sin: sinDocs,\n sinh: sinhDocs,\n tan: tanDocs,\n tanh: tanhDocs,\n // functions - units\n to: toDocs,\n // functions - utils\n clone: cloneDocs,\n format: formatDocs,\n bin: binDocs,\n oct: octDocs,\n hex: hexDocs,\n isNaN: isNaNDocs,\n isInteger: isIntegerDocs,\n isNegative: isNegativeDocs,\n isNumeric: isNumericDocs,\n hasNumericValue: hasNumericValueDocs,\n isPositive: isPositiveDocs,\n isPrime: isPrimeDocs,\n isZero: isZeroDocs,\n print: printDocs,\n typeOf: typeOfDocs,\n numeric: numericDocs\n};", "export var eDocs = {\n name: 'e',\n category: 'Constants',\n syntax: ['e'],\n description: 'Euler\\'s number, the base of the natural logarithm. Approximately equal to 2.71828',\n examples: ['e', 'e ^ 2', 'exp(2)', 'log(e)'],\n seealso: ['exp']\n};", "export var falseDocs = {\n name: 'false',\n category: 'Constants',\n syntax: ['false'],\n description: 'Boolean value false',\n examples: ['false'],\n seealso: ['true']\n};", "export var iDocs = {\n name: 'i',\n category: 'Constants',\n syntax: ['i'],\n 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.',\n examples: ['i', 'i * i', 'sqrt(-1)'],\n seealso: []\n};", "export var InfinityDocs = {\n name: 'Infinity',\n category: 'Constants',\n syntax: ['Infinity'],\n description: 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.',\n examples: ['Infinity', '1 / 0'],\n seealso: []\n};", "export var LN10Docs = {\n name: 'LN10',\n category: 'Constants',\n syntax: ['LN10'],\n description: 'Returns the natural logarithm of 10, approximately equal to 2.302',\n examples: ['LN10', 'log(10)'],\n seealso: []\n};", "export var LN2Docs = {\n name: 'LN2',\n category: 'Constants',\n syntax: ['LN2'],\n description: 'Returns the natural logarithm of 2, approximately equal to 0.693',\n examples: ['LN2', 'log(2)'],\n seealso: []\n};", "export var LOG10EDocs = {\n name: 'LOG10E',\n category: 'Constants',\n syntax: ['LOG10E'],\n description: 'Returns the base-10 logarithm of E, approximately equal to 0.434',\n examples: ['LOG10E', 'log(e, 10)'],\n seealso: []\n};", "export var LOG2EDocs = {\n name: 'LOG2E',\n category: 'Constants',\n syntax: ['LOG2E'],\n description: 'Returns the base-2 logarithm of E, approximately equal to 1.442',\n examples: ['LOG2E', 'log(e, 2)'],\n seealso: []\n};", "export var NaNDocs = {\n name: 'NaN',\n category: 'Constants',\n syntax: ['NaN'],\n description: 'Not a number',\n examples: ['NaN', '0 / 0'],\n seealso: []\n};", "export var nullDocs = {\n name: 'null',\n category: 'Constants',\n syntax: ['null'],\n description: 'Value null',\n examples: ['null'],\n seealso: ['true', 'false']\n};", "export var phiDocs = {\n name: 'phi',\n category: 'Constants',\n syntax: ['phi'],\n 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...',\n examples: ['phi'],\n seealso: []\n};", "export var piDocs = {\n name: 'pi',\n category: 'Constants',\n syntax: ['pi'],\n 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',\n examples: ['pi', 'sin(pi/2)'],\n seealso: ['tau']\n};", "export var SQRT12Docs = {\n name: 'SQRT1_2',\n category: 'Constants',\n syntax: ['SQRT1_2'],\n description: 'Returns the square root of 1/2, approximately equal to 0.707',\n examples: ['SQRT1_2', 'sqrt(1/2)'],\n seealso: []\n};", "export var SQRT2Docs = {\n name: 'SQRT2',\n category: 'Constants',\n syntax: ['SQRT2'],\n description: 'Returns the square root of 2, approximately equal to 1.414',\n examples: ['SQRT2', 'sqrt(2)'],\n seealso: []\n};", "export var tauDocs = {\n name: 'tau',\n category: 'Constants',\n syntax: ['tau'],\n description: 'Tau is the ratio constant of a circle\\'s circumference to radius, equal to 2 * pi, approximately 6.2832.',\n examples: ['tau', '2 * pi'],\n seealso: ['pi']\n};", "export var trueDocs = {\n name: 'true',\n category: 'Constants',\n syntax: ['true'],\n description: 'Boolean value true',\n examples: ['true'],\n seealso: ['false']\n};", "export var versionDocs = {\n name: 'version',\n category: 'Constants',\n syntax: ['version'],\n description: 'A string with the version number of math.js',\n examples: ['version'],\n seealso: []\n};", "export var bignumberDocs = {\n name: 'bignumber',\n category: 'Construction',\n syntax: ['bignumber(x)'],\n description: 'Create a big number from a number or string.',\n examples: ['0.1 + 0.2', 'bignumber(0.1) + bignumber(0.2)', 'bignumber(\"7.2\")', 'bignumber(\"7.2e500\")', 'bignumber([0.1, 0.2, 0.3])'],\n seealso: ['boolean', 'bigint', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var bigintDocs = {\n name: 'bigint',\n category: 'Construction',\n syntax: ['bigint(x)'],\n description: 'Create a bigint, an integer with an arbitrary number of digits, from a number or string.',\n examples: ['123123123123123123 # a large number will lose digits', 'bigint(\"123123123123123123\")', 'bignumber([\"1\", \"3\", \"5\"])'],\n seealso: ['boolean', 'bignumber', 'number', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var booleanDocs = {\n name: 'boolean',\n category: 'Construction',\n syntax: ['x', 'boolean(x)'],\n description: 'Convert a string or number into a boolean.',\n examples: ['boolean(0)', 'boolean(1)', 'boolean(3)', 'boolean(\"true\")', 'boolean(\"false\")', 'boolean([1, 0, 1, 1])'],\n seealso: ['bignumber', 'complex', 'index', 'matrix', 'number', 'string', 'unit']\n};", "export var complexDocs = {\n name: 'complex',\n category: 'Construction',\n syntax: ['complex()', 'complex(re, im)', 'complex(string)'],\n description: 'Create a complex number.',\n examples: ['complex()', 'complex(2, 3)', 'complex(\"7 - 2i\")'],\n seealso: ['bignumber', 'boolean', 'index', 'matrix', 'number', 'string', 'unit']\n};", "export var createUnitDocs = {\n name: 'createUnit',\n category: 'Construction',\n syntax: ['createUnit(definitions)', 'createUnit(name, definition)'],\n description: 'Create a user-defined unit and register it with the Unit type.',\n examples: ['createUnit(\"foo\")', 'createUnit(\"knot\", {definition: \"0.514444444 m/s\", aliases: [\"knots\", \"kt\", \"kts\"]})', 'createUnit(\"mph\", \"1 mile/hour\")'],\n seealso: ['unit', 'splitUnit']\n};", "export var fractionDocs = {\n name: 'fraction',\n category: 'Construction',\n syntax: ['fraction(num)', 'fraction(matrix)', 'fraction(num,den)', 'fraction({n: num, d: den})'],\n description: 'Create a fraction from a number or from integer numerator and denominator.',\n examples: ['fraction(0.125)', 'fraction(1, 3) + fraction(2, 5)', 'fraction({n: 333, d: 53})', 'fraction([sqrt(9), sqrt(10), sqrt(11)])'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'string', 'unit']\n};", "export var indexDocs = {\n name: 'index',\n category: 'Construction',\n syntax: ['[start]', '[start:end]', '[start:step:end]', '[start1, start 2, ...]', '[start1:end1, start2:end2, ...]', '[start1:step1:end1, start2:step2:end2, ...]'],\n description: 'Create an index to get or replace a subset of a matrix',\n 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]'],\n seealso: ['bignumber', 'boolean', 'complex', 'matrix,', 'number', 'range', 'string', 'unit']\n};", "export var matrixDocs = {\n name: 'matrix',\n category: 'Construction',\n syntax: ['[]', '[a1, b1, ...; a2, b2, ...]', 'matrix()', 'matrix(\"dense\")', 'matrix([...])'],\n description: 'Create a matrix.',\n 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\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'sparse']\n};", "export var numberDocs = {\n name: 'number',\n category: 'Construction',\n syntax: ['x', 'number(x)', 'number(unit, valuelessUnit)'],\n description: 'Create a number or convert a string or boolean into a number.',\n examples: ['2', '2e3', '4.05', 'number(2)', 'number(\"7.2\")', 'number(true)', 'number([true, false, true, true])', 'number(unit(\"52cm\"), \"m\")'],\n seealso: ['bignumber', 'bigint', 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};", "export var sparseDocs = {\n name: 'sparse',\n category: 'Construction',\n syntax: ['sparse()', 'sparse([a1, b1, ...; a1, b2, ...])', 'sparse([a1, b1, ...; a1, b2, ...], \"number\")'],\n description: 'Create a sparse matrix.',\n examples: ['sparse()', 'sparse([3, 4; 5, 6])', 'sparse([3, 0; 5, 0], \"number\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'matrix']\n};", "export var splitUnitDocs = {\n name: 'splitUnit',\n category: 'Construction',\n syntax: ['splitUnit(unit: Unit, parts: Unit[])'],\n description: 'Split a unit in an array of units whose sum is equal to the original unit.',\n examples: ['splitUnit(1 m, [\"feet\", \"inch\"])'],\n seealso: ['unit', 'createUnit']\n};", "export var stringDocs = {\n name: 'string',\n category: 'Construction',\n syntax: ['\"text\"', 'string(x)'],\n description: 'Create a string or convert a value to a string',\n examples: ['\"Hello World!\"', 'string(4.2)', 'string(3 + 2i)'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'unit']\n};", "export var unitDocs = {\n name: 'unit',\n category: 'Construction',\n syntax: ['value unit', 'unit(value, unit)', 'unit(string)'],\n description: 'Create a unit.',\n examples: ['5.5 mm', '3 inch', 'unit(7.1, \"kilogram\")', 'unit(\"23 deg\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'string']\n};", "export var configDocs = {\n name: 'config',\n category: 'Core',\n syntax: ['config()', 'config(options)'],\n description: 'Get configuration or change configuration.',\n examples: ['config()', '1/3 + 1/4', 'config({number: \"Fraction\"})', '1/3 + 1/4'],\n seealso: []\n};", "export var importDocs = {\n name: 'import',\n category: 'Core',\n syntax: ['import(functions)', 'import(functions, options)'],\n description: 'Import functions or constants from an object.',\n examples: ['import({myFn: f(x)=x^2, myConstant: 32 })', 'myFn(2)', 'myConstant'],\n seealso: []\n};", "export var typedDocs = {\n name: 'typed',\n category: 'Core',\n syntax: ['typed(signatures)', 'typed(name, signatures)'],\n description: 'Create a typed function.',\n examples: ['double = typed({ \"number\": f(x)=x+x, \"string\": f(x)=concat(x,x) })', 'double(2)', 'double(\"hello\")'],\n seealso: []\n};", "export var derivativeDocs = {\n name: 'derivative',\n category: 'Algebra',\n syntax: ['derivative(expr, variable)', 'derivative(expr, variable, {simplify: boolean})'],\n 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.',\n 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})'],\n seealso: ['simplify', 'parse', 'evaluate']\n};", "export var leafCountDocs = {\n name: 'leafCount',\n category: 'Algebra',\n syntax: ['leafCount(expr)'],\n description: 'Computes the number of leaves in the parse tree of the given expression',\n examples: ['leafCount(\"e^(i*pi)-1\")', 'leafCount(parse(\"{a: 22/7, b: 10^(1/2)}\"))'],\n seealso: ['simplify']\n};", "export var lsolveDocs = {\n name: 'lsolve',\n category: 'Algebra',\n syntax: ['x=lsolve(L, b)'],\n 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.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolveAll', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};", "export var lsolveAllDocs = {\n name: 'lsolveAll',\n category: 'Algebra',\n syntax: ['x=lsolveAll(L, b)'],\n 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.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolve', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};", "export var lupDocs = {\n name: 'lup',\n category: 'Algebra',\n syntax: ['lup(m)'],\n description: 'Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U',\n examples: ['lup([[2, 1], [1, 4]])', 'lup(matrix([[2, 1], [1, 4]]))', 'lup(sparse([[2, 1], [1, 4]]))'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'slu', 'qr']\n};", "export var lusolveDocs = {\n name: 'lusolve',\n category: 'Algebra',\n syntax: ['x=lusolve(A, b)', 'x=lusolve(lu, b)'],\n description: 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lusolve(a, b)'],\n seealso: ['lup', 'slu', 'lsolve', 'usolve', 'matrix', 'sparse']\n};", "export var polynomialRootDocs = {\n name: 'polynomialRoot',\n category: 'Algebra',\n syntax: ['x=polynomialRoot(-6, 3)', 'x=polynomialRoot(4, -4, 1)', 'x=polynomialRoot(-8, 12, -6, 1)'],\n description: 'Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.',\n examples: ['a = polynomialRoot(-6, 11, -6, 1)'],\n seealso: ['cbrt', 'sqrt']\n};", "export var qrDocs = {\n name: 'qr',\n category: 'Algebra',\n syntax: ['qr(A)'],\n 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.',\n examples: ['qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])'],\n seealso: ['lup', 'slu', 'matrix']\n};", "export var rationalizeDocs = {\n name: 'rationalize',\n category: 'Algebra',\n syntax: ['rationalize(expr)', 'rationalize(expr, scope)', 'rationalize(expr, scope, detailed)'],\n 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.',\n examples: ['rationalize(\"2x/y - y/(x+1)\")', 'rationalize(\"2x/y - y/(x+1)\", true)'],\n seealso: ['simplify']\n};", "export var resolveDocs = {\n name: 'resolve',\n category: 'Algebra',\n syntax: ['resolve(node, scope)'],\n description: 'Recursively substitute variables in an expression tree.',\n 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\") })'],\n seealso: ['simplify', 'evaluate'],\n mayThrow: ['ReferenceError']\n};", "export var simplifyDocs = {\n name: 'simplify',\n category: 'Algebra',\n syntax: ['simplify(expr)', 'simplify(expr, rules)'],\n description: 'Simplify an expression tree.',\n examples: ['simplify(\"3 + 2 / 4\")', 'simplify(\"2x + x\")', 'f = parse(\"x * (x + 2 + x)\")', 'simplified = simplify(f)', 'simplified.evaluate({x: 2})'],\n seealso: ['simplifyCore', 'derivative', 'evaluate', 'parse', 'rationalize', 'resolve']\n};", "export var simplifyConstantDocs = {\n name: 'simplifyConstant',\n category: 'Algebra',\n syntax: ['simplifyConstant(expr)', 'simplifyConstant(expr, options)'],\n description: 'Replace constant subexpressions of node with their values.',\n examples: ['simplifyConstant(\"(3-3)*x\")', 'simplifyConstant(parse(\"z-cos(tau/8)\"))'],\n seealso: ['simplify', 'simplifyCore', 'evaluate']\n};", "export var simplifyCoreDocs = {\n name: 'simplifyCore',\n category: 'Algebra',\n syntax: ['simplifyCore(node)'],\n description: 'Perform simple one-pass simplifications on an expression tree.',\n examples: ['simplifyCore(parse(\"0*x\"))', 'simplifyCore(parse(\"(x+0)*2\"))'],\n seealso: ['simplify', 'simplifyConstant', 'evaluate']\n};", "export var sluDocs = {\n name: 'slu',\n category: 'Algebra',\n syntax: ['slu(A, order, threshold)'],\n 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',\n 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)'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'lup', 'qr']\n};", "export var symbolicEqualDocs = {\n name: 'symbolicEqual',\n category: 'Algebra',\n syntax: ['symbolicEqual(expr1, expr2)', 'symbolicEqual(expr1, expr2, options)'],\n description: 'Returns true if the difference of the expressions simplifies to 0',\n examples: ['symbolicEqual(\"x*y\",\"y*x\")', 'symbolicEqual(\"abs(x^2)\", \"x^2\")', 'symbolicEqual(\"abs(x)\", \"x\", {context: {abs: {trivial: true}}})'],\n seealso: ['simplify', 'evaluate']\n};", "export var usolveDocs = {\n name: 'usolve',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n 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.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolveAll', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};", "export var usolveAllDocs = {\n name: 'usolveAll',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n 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.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolve', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};", "export var absDocs = {\n name: 'abs',\n category: 'Arithmetic',\n syntax: ['abs(x)'],\n description: 'Compute the absolute value.',\n examples: ['abs(3.5)', 'abs(-4.2)'],\n seealso: ['sign']\n};", "export var addDocs = {\n name: 'add',\n category: 'Operators',\n syntax: ['x + y', 'add(x, y)'],\n description: 'Add two values.',\n examples: ['a = 2.1 + 3.6', 'a - 3.6', '3 + 2i', '3 cm + 2 inch', '\"2.3\" + \"4\"'],\n seealso: ['subtract']\n};", "export var cbrtDocs = {\n name: 'cbrt',\n category: 'Arithmetic',\n syntax: ['cbrt(x)', 'cbrt(x, allRoots)'],\n 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',\n examples: ['cbrt(64)', 'cube(4)', 'cbrt(-8)', 'cbrt(2 + 3i)', 'cbrt(8i)', 'cbrt(8i, true)', 'cbrt(27 m^3)'],\n seealso: ['square', 'sqrt', 'cube', 'multiply']\n};", "export var ceilDocs = {\n name: 'ceil',\n category: 'Arithmetic',\n syntax: ['ceil(x)'],\n description: 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.',\n examples: ['ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)'],\n seealso: ['floor', 'fix', 'round']\n};", "export var cubeDocs = {\n name: 'cube',\n category: 'Arithmetic',\n syntax: ['cube(x)'],\n description: 'Compute the cube of a value. The cube of x is x * x * x.',\n examples: ['cube(2)', '2^3', '2 * 2 * 2'],\n seealso: ['multiply', 'square', 'pow']\n};", "export var divideDocs = {\n name: 'divide',\n category: 'Operators',\n syntax: ['x / y', 'divide(x, y)'],\n description: 'Divide two values.',\n examples: ['a = 2 / 3', 'a * 3', '4.5 / 2', '3 + 4 / 2', '(3 + 4) / 2', '18 km / 4.5'],\n seealso: ['multiply']\n};", "export var dotDivideDocs = {\n name: 'dotDivide',\n category: 'Operators',\n syntax: ['x ./ y', 'dotDivide(x, y)'],\n description: 'Divide two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a ./ b'],\n seealso: ['multiply', 'dotMultiply', 'divide']\n};", "export var dotMultiplyDocs = {\n name: 'dotMultiply',\n category: 'Operators',\n syntax: ['x .* y', 'dotMultiply(x, y)'],\n description: 'Multiply two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a .* b'],\n seealso: ['multiply', 'divide', 'dotDivide']\n};", "export var dotPowDocs = {\n name: 'dotPow',\n category: 'Operators',\n syntax: ['x .^ y', 'dotPow(x, y)'],\n description: 'Calculates the power of x to y element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a .^ 2'],\n seealso: ['pow']\n};", "export var expDocs = {\n name: 'exp',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n description: 'Calculate the exponent of a value.',\n 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'],\n seealso: ['expm', 'expm1', 'pow', 'log']\n};", "export var expmDocs = {\n name: 'expm',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n 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.',\n examples: ['expm([[0,2],[0,0]])'],\n seealso: ['exp']\n};", "export var expm1Docs = {\n name: 'expm1',\n category: 'Arithmetic',\n syntax: ['expm1(x)'],\n description: 'Calculate the value of subtracting 1 from the exponential value.',\n examples: ['expm1(2)', 'pow(e, 2) - 1', 'log(expm1(2) + 1)'],\n seealso: ['exp', 'pow', 'log']\n};", "export var fixDocs = {\n name: 'fix',\n category: 'Arithmetic',\n syntax: ['fix(x)'],\n description: 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.',\n examples: ['fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)'],\n seealso: ['ceil', 'floor', 'round']\n};", "export var floorDocs = {\n name: 'floor',\n category: 'Arithmetic',\n syntax: ['floor(x)'],\n description: 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.',\n examples: ['floor(3.2)', 'floor(3.8)', 'floor(-4.2)'],\n seealso: ['ceil', 'fix', 'round']\n};", "export var gcdDocs = {\n name: 'gcd',\n category: 'Arithmetic',\n syntax: ['gcd(a, b)', 'gcd(a, b, c, ...)'],\n description: 'Compute the greatest common divisor.',\n examples: ['gcd(8, 12)', 'gcd(-4, 6)', 'gcd(25, 15, -10)'],\n seealso: ['lcm', 'xgcd']\n};", "export var hypotDocs = {\n name: 'hypot',\n category: 'Arithmetic',\n syntax: ['hypot(a, b, c, ...)', 'hypot([a, b, c, ...])'],\n description: 'Calculate the hypotenusa of a list with values. ',\n examples: ['hypot(3, 4)', 'sqrt(3^2 + 4^2)', 'hypot(-2)', 'hypot([3, 4, 5])'],\n seealso: ['abs', 'norm']\n};", "export var invmodDocs = {\n name: 'invmod',\n category: 'Arithmetic',\n syntax: ['invmod(a, b)'],\n description: 'Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \u2263 1 (mod b)',\n examples: ['invmod(8, 12)', 'invmod(7, 13)', 'invmod(15151, 15122)'],\n seealso: ['gcd', 'xgcd']\n};", "export var lcmDocs = {\n name: 'lcm',\n category: 'Arithmetic',\n syntax: ['lcm(x, y)'],\n description: 'Compute the least common multiple.',\n examples: ['lcm(4, 6)', 'lcm(6, 21)', 'lcm(6, 21, 5)'],\n seealso: ['gcd']\n};", "export var logDocs = {\n name: 'log',\n category: 'Arithmetic',\n syntax: ['log(x)', 'log(x, base)'],\n 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).',\n 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'],\n seealso: ['exp', 'log1p', 'log2', 'log10']\n};", "export var log10Docs = {\n name: 'log10',\n category: 'Arithmetic',\n syntax: ['log10(x)'],\n description: 'Compute the 10-base logarithm of a value.',\n examples: ['log10(0.00001)', 'log10(10000)', '10 ^ 4', 'log(10000) / log(10)', 'log(10000, 10)'],\n seealso: ['exp', 'log']\n};", "export var log1pDocs = {\n name: 'log1p',\n category: 'Arithmetic',\n syntax: ['log1p(x)', 'log1p(x, base)'],\n description: 'Calculate the logarithm of a `value+1`',\n examples: ['log1p(2.5)', 'exp(log1p(1.4))', 'pow(10, 4)', 'log1p(9999, 10)', 'log1p(9999) / log(10)'],\n seealso: ['exp', 'log', 'log2', 'log10']\n};", "export var log2Docs = {\n name: 'log2',\n category: 'Arithmetic',\n syntax: ['log2(x)'],\n description: 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.',\n examples: ['log2(0.03125)', 'log2(16)', 'log2(16) / log2(2)', 'pow(2, 4)'],\n seealso: ['exp', 'log1p', 'log', 'log10']\n};", "export var modDocs = {\n name: 'mod',\n category: 'Operators',\n syntax: ['x % y', 'x mod y', 'mod(x, y)'],\n description: 'Calculates the modulus, the remainder of an integer division.',\n examples: ['7 % 3', '11 % 2', '10 mod 4', 'isOdd(x) = x % 2', 'isOdd(2)', 'isOdd(3)'],\n seealso: ['divide']\n};", "export var multiplyDocs = {\n name: 'multiply',\n category: 'Operators',\n syntax: ['x * y', 'multiply(x, y)'],\n description: 'multiply two values.',\n examples: ['a = 2.1 * 3.4', 'a / 3.4', '2 * 3 + 4', '2 * (3 + 4)', '3 * 2.1 km'],\n seealso: ['divide']\n};", "export var normDocs = {\n name: 'norm',\n category: 'Arithmetic',\n syntax: ['norm(x)', 'norm(x, p)'],\n description: 'Calculate the norm of a number, vector or matrix.',\n 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\")']\n};", "export var nthRootDocs = {\n name: 'nthRoot',\n category: 'Arithmetic',\n syntax: ['nthRoot(a)', 'nthRoot(a, root)'],\n 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\".',\n examples: ['4 ^ 3', 'nthRoot(64, 3)', 'nthRoot(9, 2)', 'sqrt(9)'],\n seealso: ['nthRoots', 'pow', 'sqrt']\n};", "export var nthRootsDocs = {\n name: 'nthRoots',\n category: 'Arithmetic',\n syntax: ['nthRoots(A)', 'nthRoots(A, root)'],\n 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.',\n examples: ['nthRoots(1)', 'nthRoots(1, 3)'],\n seealso: ['sqrt', 'pow', 'nthRoot']\n};", "export var powDocs = {\n name: 'pow',\n category: 'Operators',\n syntax: ['x ^ y', 'pow(x, y)'],\n description: 'Calculates the power of x to y, x^y.',\n examples: ['2^3', '2*2*2', '1 + e ^ (pi * i)', 'pow([[1, 2], [4, 3]], 2)', 'pow([[1, 2], [4, 3]], -1)'],\n seealso: ['multiply', 'nthRoot', 'nthRoots', 'sqrt']\n};", "export var roundDocs = {\n name: 'round',\n category: 'Arithmetic',\n syntax: ['round(x)', 'round(x, n)', 'round(unit, valuelessUnit)', 'round(unit, n, valuelessUnit)'],\n 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.',\n 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])'],\n seealso: ['ceil', 'floor', 'fix']\n};", "export var signDocs = {\n name: 'sign',\n category: 'Arithmetic',\n syntax: ['sign(x)'],\n description: 'Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.',\n examples: ['sign(3.5)', 'sign(-4.2)', 'sign(0)'],\n seealso: ['abs']\n};", "export var sqrtDocs = {\n name: 'sqrt',\n category: 'Arithmetic',\n syntax: ['sqrt(x)'],\n description: 'Compute the square root value. If x = y * y, then y is the square root of x.',\n examples: ['sqrt(25)', '5 * 5', 'sqrt(-1)'],\n seealso: ['square', 'sqrtm', 'multiply', 'nthRoot', 'nthRoots', 'pow']\n};", "export var sqrtmDocs = {\n name: 'sqrtm',\n category: 'Arithmetic',\n syntax: ['sqrtm(x)'],\n 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`.',\n examples: ['sqrtm([[33, 24], [48, 57]])'],\n seealso: ['sqrt', 'abs', 'square', 'multiply']\n};", "export var sylvesterDocs = {\n name: 'sylvester',\n category: 'Algebra',\n syntax: ['sylvester(A,B,C)'],\n description: 'Solves the real-valued Sylvester equation AX+XB=C for X',\n 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)'],\n seealso: ['schur', 'lyap']\n};", "export var schurDocs = {\n name: 'schur',\n category: 'Algebra',\n syntax: ['schur(A)'],\n description: 'Performs a real Schur decomposition of the real matrix A = UTU\\'',\n examples: ['schur([[1, 0], [-4, 3]])', 'A = [[1, 0], [-4, 3]]', 'schur(A)'],\n seealso: ['lyap', 'sylvester']\n};", "export var lyapDocs = {\n name: 'lyap',\n category: 'Algebra',\n syntax: ['lyap(A,Q)'],\n description: 'Solves the Continuous-time Lyapunov equation AP+PA\\'+Q=0 for P',\n examples: ['lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])', 'A = [[-2, 0], [1, -4]]', 'Q = [[3, 1], [1, 3]]', 'lyap(A,Q)'],\n seealso: ['schur', 'sylvester']\n};", "export var squareDocs = {\n name: 'square',\n category: 'Arithmetic',\n syntax: ['square(x)'],\n description: 'Compute the square of a value. The square of x is x * x.',\n examples: ['square(3)', 'sqrt(9)', '3^2', '3 * 3'],\n seealso: ['multiply', 'pow', 'sqrt', 'cube']\n};", "export var subtractDocs = {\n name: 'subtract',\n category: 'Operators',\n syntax: ['x - y', 'subtract(x, y)'],\n description: 'subtract two values.',\n examples: ['a = 5.3 - 2', 'a + 2', '2/3 - 1/6', '2 * 3 - 3', '2.1 km - 500m'],\n seealso: ['add']\n};", "export var unaryMinusDocs = {\n name: 'unaryMinus',\n category: 'Operators',\n syntax: ['-x', 'unaryMinus(x)'],\n description: 'Inverse the sign of a value. Converts booleans and strings to numbers.',\n examples: ['-4.5', '-(-5.6)', '-\"22\"'],\n seealso: ['add', 'subtract', 'unaryPlus']\n};", "export var unaryPlusDocs = {\n name: 'unaryPlus',\n category: 'Operators',\n syntax: ['+x', 'unaryPlus(x)'],\n description: 'Converts booleans and strings to numbers.',\n examples: ['+true', '+\"2\"'],\n seealso: ['add', 'subtract', 'unaryMinus']\n};", "export var xgcdDocs = {\n name: 'xgcd',\n category: 'Arithmetic',\n syntax: ['xgcd(a, b)'],\n 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.',\n examples: ['xgcd(8, 12)', 'gcd(8, 12)', 'xgcd(36163, 21199)'],\n seealso: ['gcd', 'lcm']\n};", "export var bitAndDocs = {\n name: 'bitAnd',\n category: 'Bitwise',\n syntax: ['x & y', 'bitAnd(x, y)'],\n 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',\n examples: ['5 & 3', 'bitAnd(53, 131)', '[1, 12, 31] & 42'],\n seealso: ['bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitNotDocs = {\n name: 'bitNot',\n category: 'Bitwise',\n syntax: ['~x', 'bitNot(x)'],\n 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.',\n examples: ['~1', '~2', 'bitNot([2, -3, 4])'],\n seealso: ['bitAnd', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitOrDocs = {\n name: 'bitOr',\n category: 'Bitwise',\n syntax: ['x | y', 'bitOr(x, y)'],\n 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.',\n examples: ['5 | 3', 'bitOr([1, 2, 3], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var bitXorDocs = {\n name: 'bitXor',\n category: 'Bitwise',\n syntax: ['bitXor(x, y)'],\n 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.',\n examples: ['bitOr(1, 2)', 'bitXor([2, 3, 4], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'leftShift', 'rightArithShift', 'rightLogShift']\n};", "export var leftShiftDocs = {\n name: 'leftShift',\n category: 'Bitwise',\n syntax: ['x << y', 'leftShift(x, y)'],\n description: 'Bitwise left logical shift of a value x by y number of bits.',\n examples: ['4 << 1', '8 >> 1'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'rightArithShift', 'rightLogShift']\n};", "export var rightArithShiftDocs = {\n name: 'rightArithShift',\n category: 'Bitwise',\n syntax: ['x >> y', 'rightArithShift(x, y)'],\n description: 'Bitwise right arithmetic shift of a value x by y number of bits.',\n examples: ['8 >> 1', '4 << 1', '-12 >> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightLogShift']\n};", "export var rightLogShiftDocs = {\n name: 'rightLogShift',\n category: 'Bitwise',\n syntax: ['x >>> y', 'rightLogShift(x, y)'],\n description: 'Bitwise right logical shift of a value x by y number of bits.',\n examples: ['8 >>> 1', '4 << 1', '-12 >>> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift']\n};", "export var bellNumbersDocs = {\n name: 'bellNumbers',\n category: 'Combinatorics',\n syntax: ['bellNumbers(n)'],\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.',\n examples: ['bellNumbers(3)', 'bellNumbers(8)'],\n seealso: ['stirlingS2']\n};", "export var catalanDocs = {\n name: 'catalan',\n category: 'Combinatorics',\n syntax: ['catalan(n)'],\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.',\n examples: ['catalan(3)', 'catalan(8)'],\n seealso: ['bellNumbers']\n};", "export var compositionDocs = {\n name: 'composition',\n category: 'Combinatorics',\n syntax: ['composition(n, k)'],\n description: 'The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.',\n examples: ['composition(5, 3)'],\n seealso: ['combinations']\n};", "export var stirlingS2Docs = {\n name: 'stirlingS2',\n category: 'Combinatorics',\n syntax: ['stirlingS2(n, k)'],\n 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.',\n examples: ['stirlingS2(5, 3)'],\n seealso: ['bellNumbers']\n};", "export var argDocs = {\n name: 'arg',\n category: 'Complex',\n syntax: ['arg(x)'],\n description: 'Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).',\n examples: ['arg(2 + 2i)', 'atan2(3, 2)', 'arg(2 + 3i)'],\n seealso: ['re', 'im', 'conj', 'abs']\n};", "export var conjDocs = {\n name: 'conj',\n category: 'Complex',\n syntax: ['conj(x)'],\n description: 'Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.',\n examples: ['conj(2 + 3i)', 'conj(2 - 3i)', 'conj(-5.2i)'],\n seealso: ['re', 'im', 'abs', 'arg']\n};", "export var imDocs = {\n name: 'im',\n category: 'Complex',\n syntax: ['im(x)'],\n description: 'Get the imaginary part of a complex number.',\n examples: ['im(2 + 3i)', 're(2 + 3i)', 'im(-5.2i)', 'im(2.4)'],\n seealso: ['re', 'conj', 'abs', 'arg']\n};", "export var reDocs = {\n name: 're',\n category: 'Complex',\n syntax: ['re(x)'],\n description: 'Get the real part of a complex number.',\n examples: ['re(2 + 3i)', 'im(2 + 3i)', 're(-5.2i)', 're(2.4)'],\n seealso: ['im', 'conj', 'abs', 'arg']\n};", "export var evaluateDocs = {\n name: 'evaluate',\n category: 'Expression',\n syntax: ['evaluate(expression)', 'evaluate(expression, scope)', 'evaluate([expr1, expr2, expr3, ...])', 'evaluate([expr1, expr2, expr3, ...], scope)'],\n description: 'Evaluate an expression or an array with expressions.',\n 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\"])'],\n seealso: []\n};", "export var helpDocs = {\n name: 'help',\n category: 'Expression',\n syntax: ['help(object)', 'help(string)'],\n description: 'Display documentation on a function or data type.',\n examples: ['help(sqrt)', 'help(\"complex\")'],\n seealso: []\n};", "export var distanceDocs = {\n name: 'distance',\n category: 'Geometry',\n syntax: ['distance([x1, y1], [x2, y2])', 'distance([[x1, y1], [x2, y2]])'],\n description: 'Calculates the Euclidean distance between two points.',\n examples: ['distance([0,0], [4,4])', 'distance([[0,0], [4,4]])'],\n seealso: []\n};", "export var intersectDocs = {\n name: 'intersect',\n category: 'Geometry',\n syntax: ['intersect(expr1, expr2, expr3, expr4)', 'intersect(expr1, expr2, expr3)'],\n description: 'Computes the intersection point of lines and/or planes.',\n examples: ['intersect([0, 0], [10, 10], [10, 0], [0, 10])', 'intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])'],\n seealso: []\n};", "export var andDocs = {\n name: 'and',\n category: 'Logical',\n syntax: ['x and y', 'and(x, y)'],\n description: 'Logical and. Test whether two values are both defined with a nonzero/nonempty value.',\n examples: ['true and false', 'true and true', '2 and 4'],\n seealso: ['not', 'or', 'xor']\n};", "export var notDocs = {\n name: 'not',\n category: 'Logical',\n syntax: ['not x', 'not(x)'],\n description: 'Logical not. Flips the boolean value of given argument.',\n examples: ['not true', 'not false', 'not 2', 'not 0'],\n seealso: ['and', 'or', 'xor']\n};", "export var orDocs = {\n name: 'or',\n category: 'Logical',\n syntax: ['x or y', 'or(x, y)'],\n description: 'Logical or. Test if at least one value is defined with a nonzero/nonempty value.',\n examples: ['true or false', 'false or false', '0 or 4'],\n seealso: ['not', 'and', 'xor']\n};", "export var xorDocs = {\n name: 'xor',\n category: 'Logical',\n syntax: ['x xor y', 'xor(x, y)'],\n description: 'Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.',\n examples: ['true xor false', 'false xor false', 'true xor true', '0 xor 4'],\n seealso: ['not', 'and', 'or']\n};", "export var columnDocs = {\n name: 'column',\n category: 'Matrix',\n syntax: ['column(x, index)'],\n description: 'Return a column from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'column(A, 1)', 'column(A, 2)'],\n seealso: ['row', 'matrixFromColumns']\n};", "export var concatDocs = {\n name: 'concat',\n category: 'Matrix',\n syntax: ['concat(A, B, C, ...)', 'concat(A, B, C, ..., dim)'],\n 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.',\n examples: ['A = [1, 2; 5, 6]', 'B = [3, 4; 7, 8]', 'concat(A, B)', 'concat(A, B, 1)', 'concat(A, B, 2)'],\n seealso: ['det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var countDocs = {\n name: 'count',\n category: 'Matrix',\n syntax: ['count(x)'],\n description: 'Count the number of elements of a matrix, array or string.',\n examples: ['a = [1, 2; 3, 4; 5, 6]', 'count(a)', 'size(a)', 'count(\"hello world\")'],\n seealso: ['size']\n};", "export var crossDocs = {\n name: 'cross',\n category: 'Matrix',\n syntax: ['cross(A, B)'],\n description: 'Calculate the cross product for two vectors in three dimensional space.',\n examples: ['cross([1, 1, 0], [0, 1, 1])', 'cross([3, -3, 1], [4, 9, 2])', 'cross([2, 3, 4], [5, 6, 7])'],\n seealso: ['multiply', 'dot']\n};", "export var ctransposeDocs = {\n name: 'ctranspose',\n category: 'Matrix',\n syntax: ['x\\'', 'ctranspose(x)'],\n description: 'Complex Conjugate and Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'ctranspose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};", "export var detDocs = {\n name: 'det',\n category: 'Matrix',\n syntax: ['det(x)'],\n description: 'Calculate the determinant of a matrix',\n examples: ['det([1, 2; 3, 4])', 'det([-2, 2, 3; -1, 1, 3; 2, 0, -1])'],\n seealso: ['concat', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var diagDocs = {\n name: 'diag',\n category: 'Matrix',\n syntax: ['diag(x)', 'diag(x, k)'],\n 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.',\n examples: ['diag(1:3)', 'diag(1:3, 1)', 'a = [1, 2, 3; 4, 5, 6; 7, 8, 9]', 'diag(a)'],\n seealso: ['concat', 'det', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var diffDocs = {\n name: 'diff',\n category: 'Matrix',\n syntax: ['diff(arr)', 'diff(arr, dim)'],\n description: ['Create a new matrix or array with the difference of the passed matrix or array.', 'Dim parameter is optional and used to indicant 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'],\n 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)'],\n seealso: ['subtract', 'partitionSelect']\n};", "export var dotDocs = {\n name: 'dot',\n category: 'Matrix',\n syntax: ['dot(A, B)', 'A * B'],\n 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',\n examples: ['dot([2, 4, 1], [2, 2, 3])', '[2, 4, 1] * [2, 2, 3]'],\n seealso: ['multiply', 'cross']\n};", "export var eigsDocs = {\n name: 'eigs',\n category: 'Matrix',\n syntax: ['eigs(x)'],\n description: 'Calculate the eigenvalues and optionally eigenvectors of a square matrix',\n examples: ['eigs([[5, 2.3], [2.3, 1]])', 'eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })'],\n seealso: ['inv']\n};", "export var filterDocs = {\n name: 'filter',\n category: 'Matrix',\n syntax: ['filter(x, test)'],\n description: 'Filter items in a matrix.',\n examples: ['isPositive(x) = x > 0', 'filter([6, -2, -1, 4, 3], isPositive)', 'filter([6, -2, 0, 1, 0], x != 0)'],\n seealso: ['sort', 'map', 'forEach']\n};", "export var flattenDocs = {\n name: 'flatten',\n category: 'Matrix',\n syntax: ['flatten(x)'],\n description: 'Flatten a multi dimensional matrix into a single dimensional matrix.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'size(a)', 'b = flatten(a)', 'size(b)'],\n seealso: ['concat', 'resize', 'size', 'squeeze']\n};", "export var forEachDocs = {\n name: 'forEach',\n category: 'Matrix',\n syntax: ['forEach(x, callback)'],\n description: 'Iterates over all elements of a matrix/array, and executes the given callback function.',\n examples: ['numberOfPets = {}', 'addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;', 'forEach([\"Dog\",\"Cat\",\"Cat\"], addPet)', 'numberOfPets'],\n seealso: ['map', 'sort', 'filter']\n};", "export var getMatrixDataTypeDocs = {\n name: 'getMatrixDataType',\n category: 'Matrix',\n syntax: ['getMatrixDataType(x)'],\n 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\".',\n examples: ['getMatrixDataType([1, 2, 3])', 'getMatrixDataType([[5 cm], [2 inch]])', 'getMatrixDataType([1, \"text\"])', 'getMatrixDataType([1, bignumber(4)])'],\n seealso: ['matrix', 'sparse', 'typeOf']\n};", "export var identityDocs = {\n name: 'identity',\n category: 'Matrix',\n syntax: ['identity(n)', 'identity(m, n)', 'identity([m, n])'],\n description: 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.',\n examples: ['identity(3)', 'identity(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'identity(size(a))'],\n seealso: ['concat', 'det', 'diag', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var invDocs = {\n name: 'inv',\n category: 'Matrix',\n syntax: ['inv(x)'],\n description: 'Calculate the inverse of a matrix',\n examples: ['inv([1, 2; 3, 4])', 'inv(4)', '1 / 4'],\n seealso: ['concat', 'det', 'diag', 'identity', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var pinvDocs = {\n name: 'pinv',\n category: 'Matrix',\n syntax: ['pinv(x)'],\n description: 'Calculate the Moore\u2013Penrose inverse of a matrix',\n examples: ['pinv([1, 2; 3, 4])', 'pinv([[1, 0], [0, 1], [0, 1]])', 'pinv(4)'],\n seealso: ['inv']\n};", "export var kronDocs = {\n name: 'kron',\n category: 'Matrix',\n syntax: ['kron(x, y)'],\n description: 'Calculates the kronecker product of 2 matrices or vectors.',\n examples: ['kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])', 'kron([1,1], [2,3,4])'],\n seealso: ['multiply', 'dot', 'cross']\n};", "export var mapDocs = {\n name: 'map',\n category: 'Matrix',\n syntax: ['map(x, callback)'],\n description: 'Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.',\n examples: ['map([1, 2, 3], square)'],\n seealso: ['filter', 'forEach']\n};", "export var matrixFromColumnsDocs = {\n name: 'matrixFromColumns',\n category: 'Matrix',\n syntax: ['matrixFromColumns(...arr)', 'matrixFromColumns(row1, row2)', 'matrixFromColumns(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual columns.',\n examples: ['matrixFromColumns([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromFunction', 'zeros']\n};", "export var matrixFromFunctionDocs = {\n name: 'matrixFromFunction',\n category: 'Matrix',\n syntax: ['matrixFromFunction(size, fn)', 'matrixFromFunction(size, fn, format)', 'matrixFromFunction(size, fn, format, datatype)', 'matrixFromFunction(size, format, fn)', 'matrixFromFunction(size, format, datatype, fn)'],\n description: 'Create a matrix by evaluating a generating function at each index.',\n 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)'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromColumns', 'zeros']\n};", "export var matrixFromRowsDocs = {\n name: 'matrixFromRows',\n category: 'Matrix',\n syntax: ['matrixFromRows(...arr)', 'matrixFromRows(row1, row2)', 'matrixFromRows(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual rows.',\n examples: ['matrixFromRows([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromColumns', 'matrixFromFunction', 'zeros']\n};", "export var onesDocs = {\n name: 'ones',\n category: 'Matrix',\n syntax: ['ones(m)', 'ones(m, n)', 'ones(m, n, p, ...)', 'ones([m])', 'ones([m, n])', 'ones([m, n, p, ...])'],\n description: 'Create a matrix containing ones.',\n examples: ['ones(3)', 'ones(3, 5)', 'ones([2,3]) * 4.5', 'a = [1, 2, 3; 4, 5, 6]', 'ones(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var partitionSelectDocs = {\n name: 'partitionSelect',\n category: 'Matrix',\n syntax: ['partitionSelect(x, k)', 'partitionSelect(x, k, compare)'],\n description: 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.',\n 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'],\n seealso: ['sort']\n};", "export var rangeDocs = {\n name: 'range',\n category: 'Type',\n syntax: ['start:end', 'start:step:end', 'range(start, end)', 'range(start, end, step)', 'range(string)'],\n description: 'Create a range. Lower bound of the range is included, upper bound is excluded.',\n 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]'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var reshapeDocs = {\n name: 'reshape',\n category: 'Matrix',\n syntax: ['reshape(x, sizes)'],\n description: 'Reshape a multi dimensional array to fit the specified dimensions.',\n 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])'],\n seealso: ['size', 'squeeze', 'resize']\n};", "export var resizeDocs = {\n name: 'resize',\n category: 'Matrix',\n syntax: ['resize(x, size)', 'resize(x, size, defaultValue)'],\n description: 'Resize a matrix.',\n 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], \"!\")'],\n seealso: ['size', 'subset', 'squeeze', 'reshape']\n};", "export var rotateDocs = {\n name: 'rotate',\n category: 'Matrix',\n syntax: ['rotate(w, theta)', 'rotate(w, theta, v)'],\n 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.',\n 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]))'],\n seealso: ['matrix', 'rotationMatrix']\n};", "export var rotationMatrixDocs = {\n name: 'rotationMatrix',\n category: 'Matrix',\n syntax: ['rotationMatrix(theta)', 'rotationMatrix(theta, v)', 'rotationMatrix(theta, v, format)'],\n 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.',\n examples: ['rotationMatrix(pi / 2)', 'rotationMatrix(unit(\"45deg\"), [0, 0, 1])', 'rotationMatrix(1, matrix([0, 0, 1]), \"sparse\")'],\n seealso: ['cos', 'sin']\n};", "export var rowDocs = {\n name: 'row',\n category: 'Matrix',\n syntax: ['row(x, index)'],\n description: 'Return a row from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'row(A, 1)', 'row(A, 2)'],\n seealso: ['column', 'matrixFromRows']\n};", "export var sizeDocs = {\n name: 'size',\n category: 'Matrix',\n syntax: ['size(x)'],\n description: 'Calculate the size of a matrix.',\n examples: ['size(2.3)', 'size(\"hello world\")', 'a = [1, 2; 3, 4; 5, 6]', 'size(a)', 'size(1:6)'],\n seealso: ['concat', 'count', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var sortDocs = {\n name: 'sort',\n category: 'Matrix',\n syntax: ['sort(x)', 'sort(x, compare)'],\n description: 'Sort the items in a matrix. Compare can be a string \"asc\", \"desc\", \"natural\", or a custom sort function.',\n 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\")'],\n seealso: ['map', 'filter', 'forEach']\n};", "export var squeezeDocs = {\n name: 'squeeze',\n category: 'Matrix',\n syntax: ['squeeze(x)'],\n description: 'Remove inner and outer singleton dimensions from a matrix.',\n examples: ['a = zeros(3,2,1)', 'size(squeeze(a))', 'b = zeros(1,1,3)', 'size(squeeze(b))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'subset', 'trace', 'transpose', 'zeros']\n};", "export var subsetDocs = {\n name: 'subset',\n category: 'Matrix',\n syntax: ['value(index)', 'value(index) = replacement', 'subset(value, [index])', 'subset(value, [index], replacement)'],\n 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.',\n 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'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'trace', 'transpose', 'zeros']\n};", "export var traceDocs = {\n name: 'trace',\n category: 'Matrix',\n syntax: ['trace(A)'],\n description: 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.',\n examples: ['A = [1, 2, 3; -1, 2, 3; 2, 0, 3]', 'trace(A)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros']\n};", "export var transposeDocs = {\n name: 'transpose',\n category: 'Matrix',\n syntax: ['x\\'', 'transpose(x)'],\n description: 'Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'transpose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};", "export var zerosDocs = {\n name: 'zeros',\n category: 'Matrix',\n syntax: ['zeros(m)', 'zeros(m, n)', 'zeros(m, n, p, ...)', 'zeros([m])', 'zeros([m, n])', 'zeros([m, n, p, ...])'],\n description: 'Create a matrix containing zeros.',\n examples: ['zeros(3)', 'zeros(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'zeros(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose']\n};", "export var fftDocs = {\n name: 'fft',\n category: 'Matrix',\n syntax: ['fft(x)'],\n description: 'Calculate N-dimensional fourier transform',\n examples: ['fft([[1, 0], [1, 0]])'],\n seealso: ['ifft']\n};", "export var ifftDocs = {\n name: 'ifft',\n category: 'Matrix',\n syntax: ['ifft(x)'],\n description: 'Calculate N-dimensional inverse fourier transform',\n examples: ['ifft([[2, 2], [0, 0]])'],\n seealso: ['fft']\n};", "export var combinationsDocs = {\n name: 'combinations',\n category: 'Probability',\n syntax: ['combinations(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time',\n examples: ['combinations(7, 5)'],\n seealso: ['combinationsWithRep', 'permutations', 'factorial']\n};", "export var combinationsWithRepDocs = {\n name: 'combinationsWithRep',\n category: 'Probability',\n syntax: ['combinationsWithRep(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time with replacements.',\n examples: ['combinationsWithRep(7, 5)'],\n seealso: ['combinations', 'permutations', 'factorial']\n};", "export var factorialDocs = {\n name: 'factorial',\n category: 'Probability',\n syntax: ['n!', 'factorial(n)'],\n description: 'Compute the factorial of a value',\n examples: ['5!', '5 * 4 * 3 * 2 * 1', '3!'],\n seealso: ['combinations', 'combinationsWithRep', 'permutations', 'gamma']\n};", "export var gammaDocs = {\n name: 'gamma',\n category: 'Probability',\n syntax: ['gamma(n)'],\n description: 'Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.',\n examples: ['gamma(4)', '3!', 'gamma(1/2)', 'sqrt(pi)'],\n seealso: ['factorial']\n};", "export var lgammaDocs = {\n name: 'lgamma',\n category: 'Probability',\n syntax: ['lgamma(n)'],\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.',\n examples: ['lgamma(4)', 'lgamma(1/2)', 'lgamma(i)', 'lgamma(complex(1.1, 2))'],\n seealso: ['gamma']\n};", "export var kldivergenceDocs = {\n name: 'kldivergence',\n category: 'Probability',\n syntax: ['kldivergence(x, y)'],\n description: 'Calculate the Kullback-Leibler (KL) divergence between two distributions.',\n examples: ['kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])'],\n seealso: []\n};", "export var multinomialDocs = {\n name: 'multinomial',\n category: 'Probability',\n syntax: ['multinomial(A)'],\n 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.',\n examples: ['multinomial([1, 2, 1])'],\n seealso: ['combinations', 'factorial']\n};", "export var permutationsDocs = {\n name: 'permutations',\n category: 'Probability',\n syntax: ['permutations(n)', 'permutations(n, k)'],\n description: 'Compute the number of permutations of n items taken k at a time',\n examples: ['permutations(5)', 'permutations(5, 3)'],\n seealso: ['combinations', 'combinationsWithRep', 'factorial']\n};", "export var pickRandomDocs = {\n name: 'pickRandom',\n category: 'Probability',\n syntax: ['pickRandom(array)', 'pickRandom(array, number)', 'pickRandom(array, weights)', 'pickRandom(array, number, weights)', 'pickRandom(array, weights, number)'],\n description: 'Pick a random entry from a given array.',\n 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)'],\n seealso: ['random', 'randomInt']\n};", "export var randomDocs = {\n name: 'random',\n category: 'Probability',\n syntax: ['random()', 'random(max)', 'random(min, max)', 'random(size)', 'random(size, max)', 'random(size, min, max)'],\n description: 'Return a random number.',\n examples: ['random()', 'random(10, 20)', 'random([2, 3])'],\n seealso: ['pickRandom', 'randomInt']\n};", "export var randomIntDocs = {\n name: 'randomInt',\n category: 'Probability',\n syntax: ['randomInt(max)', 'randomInt(min, max)', 'randomInt(size)', 'randomInt(size, max)', 'randomInt(size, min, max)'],\n description: 'Return a random integer number',\n examples: ['randomInt(10, 20)', 'randomInt([2, 3], 10)'],\n seealso: ['pickRandom', 'random']\n};", "export var compareDocs = {\n name: 'compare',\n category: 'Relational',\n syntax: ['compare(x, y)'],\n description: 'Compare two values. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compare(2, 3)', 'compare(3, 2)', 'compare(2, 2)', 'compare(5cm, 40mm)', 'compare(2, [1, 2, 3])'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compareNatural', 'compareText']\n};", "export var compareNaturalDocs = {\n name: 'compareNatural',\n category: 'Relational',\n syntax: ['compareNatural(x, y)'],\n 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.',\n 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})'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare', 'compareText']\n};", "export var compareTextDocs = {\n name: 'compareText',\n category: 'Relational',\n syntax: ['compareText(x, y)'],\n description: 'Compare two strings lexically. Comparison is case sensitive. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n 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\"])'],\n seealso: ['compare', 'compareNatural']\n};", "export var deepEqualDocs = {\n name: 'deepEqual',\n category: 'Relational',\n syntax: ['deepEqual(x, y)'],\n 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.',\n examples: ['deepEqual([1,3,4], [1,3,4])', 'deepEqual([1,3,4], [1,3])'],\n seealso: ['equal', 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare']\n};", "export var equalDocs = {\n name: 'equal',\n category: 'Relational',\n syntax: ['x == y', 'equal(x, y)'],\n description: 'Check equality of two values. Returns true if the values are equal, and false if not.',\n examples: ['2+2 == 3', '2+2 == 4', 'a = 3.2', 'b = 6-2.8', 'a == b', '50cm == 0.5m'],\n seealso: ['unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual', 'equalText']\n};", "export var equalTextDocs = {\n name: 'equalText',\n category: 'Relational',\n syntax: ['equalText(x, y)'],\n description: 'Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.',\n examples: ['equalText(\"Hello\", \"Hello\")', 'equalText(\"a\", \"A\")', 'equal(\"2e3\", \"2000\")', 'equalText(\"2e3\", \"2000\")', 'equalText(\"B\", [\"A\", \"B\", \"C\"])'],\n seealso: ['compare', 'compareNatural', 'compareText', 'equal']\n};", "export var largerDocs = {\n name: 'larger',\n category: 'Relational',\n syntax: ['x > y', 'larger(x, y)'],\n description: 'Check if value x is larger than y. Returns true if x is larger than y, and false if not.',\n examples: ['2 > 3', '5 > 2*2', 'a = 3.3', 'b = 6-2.8', '(a > b)', '(b < a)', '5 cm > 2 inch'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare']\n};", "export var largerEqDocs = {\n name: 'largerEq',\n category: 'Relational',\n syntax: ['x >= y', 'largerEq(x, y)'],\n 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.',\n examples: ['2 >= 1+1', '2 > 1+1', 'a = 3.2', 'b = 6-2.8', '(a >= b)'],\n seealso: ['equal', 'unequal', 'smallerEq', 'smaller', 'compare']\n};", "export var smallerDocs = {\n name: 'smaller',\n category: 'Relational',\n syntax: ['x < y', 'smaller(x, y)'],\n description: 'Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.',\n examples: ['2 < 3', '5 < 2*2', 'a = 3.3', 'b = 6-2.8', '(a < b)', '5 cm < 2 inch'],\n seealso: ['equal', 'unequal', 'larger', 'smallerEq', 'largerEq', 'compare']\n};", "export var smallerEqDocs = {\n name: 'smallerEq',\n category: 'Relational',\n syntax: ['x <= y', 'smallerEq(x, y)'],\n description: 'Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.',\n examples: ['2 <= 1+1', '2 < 1+1', 'a = 3.2', 'b = 6-2.8', '(a <= b)'],\n seealso: ['equal', 'unequal', 'larger', 'smaller', 'largerEq', 'compare']\n};", "export var unequalDocs = {\n name: 'unequal',\n category: 'Relational',\n syntax: ['x != y', 'unequal(x, y)'],\n description: 'Check unequality of two values. Returns true if the values are unequal, and false if they are equal.',\n examples: ['2+2 != 3', '2+2 != 4', 'a = 3.2', 'b = 6-2.8', 'a != b', '50cm != 0.5m', '5 cm != 2 inch'],\n seealso: ['equal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual']\n};", "export var setCartesianDocs = {\n name: 'setCartesian',\n category: 'Set',\n syntax: ['setCartesian(set1, set2)'],\n 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.',\n examples: ['setCartesian([1, 2], [3, 4])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference', 'setPowerset']\n};", "export var setDifferenceDocs = {\n name: 'setDifference',\n category: 'Set',\n syntax: ['setDifference(set1, set2)'],\n 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.',\n examples: ['setDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setSymDifference']\n};", "export var setDistinctDocs = {\n name: 'setDistinct',\n category: 'Set',\n syntax: ['setDistinct(set)'],\n description: 'Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setDistinct([1, 1, 1, 2, 2, 3])'],\n seealso: ['setMultiplicity']\n};", "export var setIntersectDocs = {\n name: 'setIntersect',\n category: 'Set',\n syntax: ['setIntersect(set1, set2)'],\n description: 'Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setIntersect([1, 2, 3, 4], [3, 4, 5, 6])', 'setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setDifference']\n};", "export var setIsSubsetDocs = {\n name: 'setIsSubset',\n category: 'Set',\n syntax: ['setIsSubset(set1, set2)'],\n 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.',\n examples: ['setIsSubset([1, 2], [3, 4, 5, 6])', 'setIsSubset([3, 4], [3, 4, 5, 6])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setMultiplicityDocs = {\n name: 'setMultiplicity',\n category: 'Set',\n syntax: ['setMultiplicity(element, set)'],\n 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.',\n examples: ['setMultiplicity(1, [1, 2, 2, 4])', 'setMultiplicity(2, [1, 2, 2, 4])'],\n seealso: ['setDistinct', 'setSize']\n};", "export var setPowersetDocs = {\n name: 'setPowerset',\n category: 'Set',\n syntax: ['setPowerset(set)'],\n 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.',\n examples: ['setPowerset([1, 2, 3])'],\n seealso: ['setCartesian']\n};", "export var setSizeDocs = {\n name: 'setSize',\n category: 'Set',\n syntax: ['setSize(set)', 'setSize(set, unique)'],\n 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.',\n examples: ['setSize([1, 2, 2, 4])', 'setSize([1, 2, 2, 4], true)'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setSymDifferenceDocs = {\n name: 'setSymDifference',\n category: 'Set',\n syntax: ['setSymDifference(set1, set2)'],\n description: 'Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};", "export var setUnionDocs = {\n name: 'setUnion',\n category: 'Set',\n syntax: ['setUnion(set1, set2)'],\n description: 'Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setUnion([1, 2, 3, 4], [3, 4, 5, 6])', 'setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setIntersect', 'setDifference']\n};", "export var zpk2tfDocs = {\n name: 'zpk2tf',\n category: 'Signal',\n syntax: ['zpk2tf(z, p, k)'],\n description: 'Compute the transfer function of a zero-pole-gain model.',\n examples: ['zpk2tf([1, 2], [-1, -2], 1)', 'zpk2tf([1, 2], [-1, -2])', 'zpk2tf([1 - 3i, 2 + 2i], [-1, -2])'],\n seealso: []\n};", "export var freqzDocs = {\n name: 'freqz',\n category: 'Signal',\n syntax: ['freqz(b, a)', 'freqz(b, a, w)'],\n description: 'Calculates the frequency response of a filter given its numerator and denominator coefficients.',\n examples: ['freqz([1, 2], [1, 2, 3])', 'freqz([1, 2], [1, 2, 3], [0, 1])', 'freqz([1, 2], [1, 2, 3], 512)'],\n seealso: []\n};", "export var erfDocs = {\n name: 'erf',\n category: 'Special',\n syntax: ['erf(x)'],\n description: 'Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x',\n examples: ['erf(0.2)', 'erf(-0.5)', 'erf(4)'],\n seealso: []\n};", "export var zetaDocs = {\n name: 'zeta',\n category: 'Special',\n syntax: ['zeta(s)'],\n description: 'Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane',\n examples: ['zeta(0.2)', 'zeta(-0.5)', 'zeta(4)'],\n seealso: []\n};", "export var madDocs = {\n name: 'mad',\n category: 'Statistics',\n syntax: ['mad(a, b, c, ...)', 'mad(A)'],\n 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.',\n examples: ['mad(10, 20, 30)', 'mad([1, 2, 3])'],\n seealso: ['mean', 'median', 'std', 'abs']\n};", "export var maxDocs = {\n name: 'max',\n category: 'Statistics',\n syntax: ['max(a, b, c, ...)', 'max(A)', 'max(A, dimension)'],\n description: 'Compute the maximum value of a list of values.',\n 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)'],\n seealso: ['mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var meanDocs = {\n name: 'mean',\n category: 'Statistics',\n syntax: ['mean(a, b, c, ...)', 'mean(A)', 'mean(A, dimension)'],\n description: 'Compute the arithmetic mean of a list of values.',\n 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])'],\n seealso: ['max', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var medianDocs = {\n name: 'median',\n category: 'Statistics',\n syntax: ['median(a, b, c, ...)', 'median(A)'],\n 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.',\n examples: ['median(5, 2, 7)', 'median([3, -1, 5, 7])'],\n seealso: ['max', 'mean', 'min', 'prod', 'std', 'sum', 'variance', 'quantileSeq']\n};", "export var minDocs = {\n name: 'min',\n category: 'Statistics',\n syntax: ['min(a, b, c, ...)', 'min(A)', 'min(A, dimension)'],\n description: 'Compute the minimum value of a list of values.',\n 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)'],\n seealso: ['max', 'mean', 'median', 'prod', 'std', 'sum', 'variance']\n};", "export var modeDocs = {\n name: 'mode',\n category: 'Statistics',\n syntax: ['mode(a, b, c, ...)', 'mode(A)', 'mode(A, a, b, B, c, ...)'],\n description: 'Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.',\n examples: ['mode(2, 1, 4, 3, 1)', 'mode([1, 2.7, 3.2, 4, 2.7])', 'mode(1, 4, 6, 1, 6)'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'std', 'sum', 'variance']\n};", "export var prodDocs = {\n name: 'prod',\n category: 'Statistics',\n syntax: ['prod(a, b, c, ...)', 'prod(A)'],\n description: 'Compute the product of all values.',\n examples: ['prod(2, 3, 4)', 'prod([2, 3, 4])', 'prod([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'std', 'sum', 'variance']\n};", "export var quantileSeqDocs = {\n name: 'quantileSeq',\n category: 'Statistics',\n syntax: ['quantileSeq(A, prob[, sorted])', 'quantileSeq(A, [prob1, prob2, ...][, sorted])', 'quantileSeq(A, N[, sorted])'],\n 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 probablity are: Number, BigNumber. \\n\\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.',\n 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)'],\n seealso: ['mean', 'median', 'min', 'max', 'prod', 'std', 'sum', 'variance']\n};", "export var stdDocs = {\n name: 'std',\n category: 'Statistics',\n syntax: ['std(a, b, c, ...)', 'std(A)', 'std(A, dimension)', 'std(A, normalization)', 'std(A, dimension, normalization)'],\n 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\".',\n 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])'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'sum', 'variance']\n};", "export var cumSumDocs = {\n name: 'cumsum',\n category: 'Statistics',\n syntax: ['cumsum(a, b, c, ...)', 'cumsum(A)'],\n description: 'Compute the cumulative sum of all values.',\n 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)'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var sumDocs = {\n name: 'sum',\n category: 'Statistics',\n syntax: ['sum(a, b, c, ...)', 'sum(A)', 'sum(A, dimension)'],\n description: 'Compute the sum of all values.',\n examples: ['sum(2, 3, 4, 1)', 'sum([2, 3, 4, 1])', 'sum([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};", "export var varianceDocs = {\n name: 'variance',\n category: 'Statistics',\n syntax: ['variance(a, b, c, ...)', 'variance(A)', 'variance(A, dimension)', 'variance(A, normalization)', 'variance(A, dimension, normalization)'],\n description: 'Compute the variance of all values. Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n 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])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};", "export var corrDocs = {\n name: 'corr',\n category: 'Statistics',\n syntax: ['corr(A,B)'],\n description: 'Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.',\n 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]]))'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};", "export var acosDocs = {\n name: 'acos',\n category: 'Trigonometry',\n syntax: ['acos(x)'],\n description: 'Compute the inverse cosine of a value in radians.',\n examples: ['acos(0.5)', 'acos(cos(2.3))'],\n seealso: ['cos', 'atan', 'asin']\n};", "export var acoshDocs = {\n name: 'acosh',\n category: 'Trigonometry',\n syntax: ['acosh(x)'],\n description: 'Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.',\n examples: ['acosh(1.5)'],\n seealso: ['cosh', 'asinh', 'atanh']\n};", "export var acotDocs = {\n name: 'acot',\n category: 'Trigonometry',\n syntax: ['acot(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acot(0.5)', 'acot(cot(0.5))', 'acot(2)'],\n seealso: ['cot', 'atan']\n};", "export var acothDocs = {\n name: 'acoth',\n category: 'Trigonometry',\n syntax: ['acoth(x)'],\n description: 'Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.',\n examples: ['acoth(2)', 'acoth(0.5)'],\n seealso: ['acsch', 'asech']\n};", "export var acscDocs = {\n name: 'acsc',\n category: 'Trigonometry',\n syntax: ['acsc(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acsc(2)', 'acsc(csc(0.5))', 'acsc(0.5)'],\n seealso: ['csc', 'asin', 'asec']\n};", "export var acschDocs = {\n name: 'acsch',\n category: 'Trigonometry',\n syntax: ['acsch(x)'],\n description: 'Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.',\n examples: ['acsch(0.5)'],\n seealso: ['asech', 'acoth']\n};", "export var asecDocs = {\n name: 'asec',\n category: 'Trigonometry',\n syntax: ['asec(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asec(0.5)', 'asec(sec(0.5))', 'asec(2)'],\n seealso: ['acos', 'acot', 'acsc']\n};", "export var asechDocs = {\n name: 'asech',\n category: 'Trigonometry',\n syntax: ['asech(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asech(0.5)'],\n seealso: ['acsch', 'acoth']\n};", "export var asinDocs = {\n name: 'asin',\n category: 'Trigonometry',\n syntax: ['asin(x)'],\n description: 'Compute the inverse sine of a value in radians.',\n examples: ['asin(0.5)', 'asin(sin(0.5))'],\n seealso: ['sin', 'acos', 'atan']\n};", "export var asinhDocs = {\n name: 'asinh',\n category: 'Trigonometry',\n syntax: ['asinh(x)'],\n description: 'Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.',\n examples: ['asinh(0.5)'],\n seealso: ['acosh', 'atanh']\n};", "export var atanDocs = {\n name: 'atan',\n category: 'Trigonometry',\n syntax: ['atan(x)'],\n description: 'Compute the inverse tangent of a value in radians.',\n examples: ['atan(0.5)', 'atan(tan(0.5))'],\n seealso: ['tan', 'acos', 'asin']\n};", "export var atan2Docs = {\n name: 'atan2',\n category: 'Trigonometry',\n syntax: ['atan2(y, x)'],\n description: 'Computes the principal value of the arc tangent of y/x in radians.',\n examples: ['atan2(2, 2) / pi', 'angle = 60 deg in rad', 'x = cos(angle)', 'y = sin(angle)', 'atan2(y, x)'],\n seealso: ['sin', 'cos', 'tan']\n};", "export var atanhDocs = {\n name: 'atanh',\n category: 'Trigonometry',\n syntax: ['atanh(x)'],\n description: 'Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.',\n examples: ['atanh(0.5)'],\n seealso: ['acosh', 'asinh']\n};", "export var cosDocs = {\n name: 'cos',\n category: 'Trigonometry',\n syntax: ['cos(x)'],\n description: 'Compute the cosine of x in radians.',\n examples: ['cos(2)', 'cos(pi / 4) ^ 2', 'cos(180 deg)', 'cos(60 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['acos', 'sin', 'tan']\n};", "export var coshDocs = {\n name: 'cosh',\n category: 'Trigonometry',\n syntax: ['cosh(x)'],\n description: 'Compute the hyperbolic cosine of x in radians.',\n examples: ['cosh(0.5)'],\n seealso: ['sinh', 'tanh', 'coth']\n};", "export var cotDocs = {\n name: 'cot',\n category: 'Trigonometry',\n syntax: ['cot(x)'],\n description: 'Compute the cotangent of x in radians. Defined as 1/tan(x)',\n examples: ['cot(2)', '1 / tan(2)'],\n seealso: ['sec', 'csc', 'tan']\n};", "export var cothDocs = {\n name: 'coth',\n category: 'Trigonometry',\n syntax: ['coth(x)'],\n description: 'Compute the hyperbolic cotangent of x in radians.',\n examples: ['coth(2)', '1 / tanh(2)'],\n seealso: ['sech', 'csch', 'tanh']\n};", "export var cscDocs = {\n name: 'csc',\n category: 'Trigonometry',\n syntax: ['csc(x)'],\n description: 'Compute the cosecant of x in radians. Defined as 1/sin(x)',\n examples: ['csc(2)', '1 / sin(2)'],\n seealso: ['sec', 'cot', 'sin']\n};", "export var cschDocs = {\n name: 'csch',\n category: 'Trigonometry',\n syntax: ['csch(x)'],\n description: 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)',\n examples: ['csch(2)', '1 / sinh(2)'],\n seealso: ['sech', 'coth', 'sinh']\n};", "export var secDocs = {\n name: 'sec',\n category: 'Trigonometry',\n syntax: ['sec(x)'],\n description: 'Compute the secant of x in radians. Defined as 1/cos(x)',\n examples: ['sec(2)', '1 / cos(2)'],\n seealso: ['cot', 'csc', 'cos']\n};", "export var sechDocs = {\n name: 'sech',\n category: 'Trigonometry',\n syntax: ['sech(x)'],\n description: 'Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)',\n examples: ['sech(2)', '1 / cosh(2)'],\n seealso: ['coth', 'csch', 'cosh']\n};", "export var sinDocs = {\n name: 'sin',\n category: 'Trigonometry',\n syntax: ['sin(x)'],\n description: 'Compute the sine of x in radians.',\n examples: ['sin(2)', 'sin(pi / 4) ^ 2', 'sin(90 deg)', 'sin(30 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['asin', 'cos', 'tan']\n};", "export var sinhDocs = {\n name: 'sinh',\n category: 'Trigonometry',\n syntax: ['sinh(x)'],\n description: 'Compute the hyperbolic sine of x in radians.',\n examples: ['sinh(0.5)'],\n seealso: ['cosh', 'tanh']\n};", "export var tanDocs = {\n name: 'tan',\n category: 'Trigonometry',\n syntax: ['tan(x)'],\n description: 'Compute the tangent of x in radians.',\n examples: ['tan(0.5)', 'sin(0.5) / cos(0.5)', 'tan(pi / 4)', 'tan(45 deg)'],\n seealso: ['atan', 'sin', 'cos']\n};", "export var tanhDocs = {\n name: 'tanh',\n category: 'Trigonometry',\n syntax: ['tanh(x)'],\n description: 'Compute the hyperbolic tangent of x in radians.',\n examples: ['tanh(0.5)', 'sinh(0.5) / cosh(0.5)'],\n seealso: ['sinh', 'cosh']\n};", "export var toDocs = {\n name: 'to',\n category: 'Units',\n syntax: ['x to unit', 'to(x, unit)'],\n description: 'Change the unit of a value.',\n examples: ['5 inch to cm', '3.2kg to g', '16 bytes in bits'],\n seealso: []\n};", "export var binDocs = {\n name: 'bin',\n category: 'Utils',\n syntax: ['bin(value)'],\n description: 'Format a number as binary',\n examples: ['bin(2)'],\n seealso: ['oct', 'hex']\n};", "export var cloneDocs = {\n name: 'clone',\n category: 'Utils',\n syntax: ['clone(x)'],\n description: 'Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices',\n examples: ['clone(3.5)', 'clone(2 - 4i)', 'clone(45 deg)', 'clone([1, 2; 3, 4])', 'clone(\"hello world\")'],\n seealso: []\n};", "export var formatDocs = {\n name: 'format',\n category: 'Utils',\n syntax: ['format(value)', 'format(value, precision)'],\n description: 'Format a value of any type as string.',\n examples: ['format(2.3)', 'format(3 - 4i)', 'format([])', 'format(pi, 3)'],\n seealso: ['print']\n};", "export var hasNumericValueDocs = {\n name: 'hasNumericValue',\n category: 'Utils',\n syntax: ['hasNumericValue(x)'],\n description: 'Test whether a value is an numeric value. ' + 'In case of a string, true is returned if the string contains a numeric value.',\n examples: ['hasNumericValue(2)', 'hasNumericValue(\"2\")', 'isNumeric(\"2\")', 'hasNumericValue(0)', 'hasNumericValue(bignumber(500))', 'hasNumericValue(fraction(0.125))', 'hasNumericValue(2 + 3i)', 'hasNumericValue([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric']\n};", "export var hexDocs = {\n name: 'hex',\n category: 'Utils',\n syntax: ['hex(value)'],\n description: 'Format a number as hexadecimal',\n examples: ['hex(240)'],\n seealso: ['bin', 'oct']\n};", "export var isIntegerDocs = {\n name: 'isInteger',\n category: 'Utils',\n syntax: ['isInteger(x)'],\n description: 'Test whether a value is an integer number.',\n examples: ['isInteger(2)', 'isInteger(3.5)', 'isInteger([3, 0.5, -2])'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNaNDocs = {\n name: 'isNaN',\n category: 'Utils',\n syntax: ['isNaN(x)'],\n description: 'Test whether a value is NaN (not a number)',\n examples: ['isNaN(2)', 'isNaN(0 / 0)', 'isNaN(NaN)', 'isNaN(Infinity)'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNegativeDocs = {\n name: 'isNegative',\n category: 'Utils',\n syntax: ['isNegative(x)'],\n description: 'Test whether a value is negative: smaller than zero.',\n examples: ['isNegative(2)', 'isNegative(0)', 'isNegative(-4)', 'isNegative([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isPositive', 'isZero']\n};", "export var isNumericDocs = {\n name: 'isNumeric',\n category: 'Utils',\n syntax: ['isNumeric(x)'],\n description: 'Test whether a value is a numeric value. ' + 'Returns true when the input is a number, BigNumber, Fraction, or boolean.',\n examples: ['isNumeric(2)', 'isNumeric(\"2\")', 'hasNumericValue(\"2\")', 'isNumeric(0)', 'isNumeric(bignumber(500))', 'isNumeric(fraction(0.125))', 'isNumeric(2 + 3i)', 'isNumeric([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue']\n};", "export var isPositiveDocs = {\n name: 'isPositive',\n category: 'Utils',\n syntax: ['isPositive(x)'],\n description: 'Test whether a value is positive: larger than zero.',\n examples: ['isPositive(2)', 'isPositive(0)', 'isPositive(-4)', 'isPositive([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};", "export var isPrimeDocs = {\n name: 'isPrime',\n category: 'Utils',\n syntax: ['isPrime(x)'],\n description: 'Test whether a value is prime: has no divisors other than itself and one.',\n examples: ['isPrime(3)', 'isPrime(-2)', 'isPrime([2, 17, 100])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};", "export var isZeroDocs = {\n name: 'isZero',\n category: 'Utils',\n syntax: ['isZero(x)'],\n description: 'Test whether a value is zero.',\n examples: ['isZero(2)', 'isZero(0)', 'isZero(-4)', 'isZero([3, 0, -2, 0])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isPositive']\n};", "export var numericDocs = {\n name: 'numeric',\n category: 'Utils',\n syntax: ['numeric(x)'],\n description: 'Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.',\n examples: ['numeric(\"4\")', 'numeric(\"4\", \"number\")', 'numeric(\"4\", \"bigint\")', 'numeric(\"4\", \"BigNumber\")', 'numeric(\"4\", \"Fraction\")', 'numeric(4, \"Fraction\")', 'numeric(fraction(2, 5), \"number\")'],\n seealso: ['number', 'bigint', 'fraction', 'bignumber', 'string', 'format']\n};", "export var octDocs = {\n name: 'oct',\n category: 'Utils',\n syntax: ['oct(value)'],\n description: 'Format a number as octal',\n examples: ['oct(56)'],\n seealso: ['bin', 'hex']\n};", "export var printDocs = {\n name: 'print',\n category: 'Utils',\n syntax: ['print(template, values)', 'print(template, values, precision)'],\n description: 'Interpolate values into a string template.',\n 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])'],\n seealso: ['format']\n};", "export var typeOfDocs = {\n name: 'typeOf',\n category: 'Utils',\n syntax: ['typeOf(x)'],\n description: 'Get the type of a variable.',\n examples: ['typeOf(3.5)', 'typeOf(2 - 4i)', 'typeOf(45 deg)', 'typeOf(\"hello world\")'],\n seealso: ['getMatrixDataType']\n};", "export var solveODEDocs = {\n name: 'solveODE',\n category: 'Numeric',\n syntax: ['solveODE(func, tspan, y0)', 'solveODE(func, tspan, y0, options)'],\n description: 'Numerical Integration of Ordinary Differential Equations.',\n 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 })'],\n seealso: ['derivative', 'simplifyCore']\n};", "import { factory } from '../../../utils/factory.js';\nvar name = 'chain';\nvar dependencies = ['typed', 'Chain'];\nexport var createChain = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Chain\n } = _ref;\n /**\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing `chain.done()`, which returns\n * the final value.\n *\n * The chain has a number of special functions:\n *\n * - `done()` Finalize the chain and return the chain's value.\n * - `valueOf()` The same as `done()`\n * - `toString()` Executes `math.format()` onto the chain's value, returning\n * a string representation of the value.\n *\n * Syntax:\n *\n * math.chain(value)\n *\n * Examples:\n *\n * math.chain(3)\n * .add(4)\n * .subtract(2)\n * .done() // 5\n *\n * math.chain( [[1, 2], [3, 4]] )\n * .subset(math.index(0, 0), 8)\n * .multiply(3)\n * .done() // [[24, 6], [9, 12]]\n *\n * @param {*} [value] A value of any type on which to start a chained operation.\n * @return {math.Chain} The created chain\n */\n return typed(name, {\n '': function _() {\n return new Chain();\n },\n any: function any(value) {\n return new Chain(value);\n }\n });\n});", "import { isMatrix } from '../../utils/is.js';\nimport { clone } from '../../utils/object.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'det';\nvar dependencies = ['typed', 'matrix', 'subtractScalar', 'multiply', 'divideScalar', 'isZero', 'unaryMinus'];\nexport var createDet = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtractScalar,\n multiply,\n divideScalar,\n isZero,\n unaryMinus\n } = _ref;\n /**\n * Calculate the determinant of a matrix.\n *\n * Syntax:\n *\n * math.det(x)\n *\n * Examples:\n *\n * math.det([[1, 2], [3, 4]]) // returns -2\n *\n * const A = [\n * [-2, 2, 3],\n * [-1, 1, 3],\n * [2, 0, -1]\n * ]\n * math.det(A) // returns 6\n *\n * See also:\n *\n * inv\n *\n * @param {Array | Matrix} x A matrix\n * @return {number} The determinant of `x`\n */\n return typed(name, {\n any: function any(x) {\n return clone(x);\n },\n 'Array | Matrix': function det(x) {\n var size;\n if (isMatrix(x)) {\n size = x.size();\n } else if (Array.isArray(x)) {\n x = matrix(x);\n size = x.size();\n } else {\n // a scalar\n size = [];\n }\n switch (size.length) {\n case 0:\n // scalar\n return clone(x);\n case 1:\n // vector\n if (size[0] === 1) {\n return clone(x.valueOf()[0]);\n }\n if (size[0] === 0) {\n return 1; // det of an empty matrix is per definition 1\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n {\n // two-dimensional array\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n return _det(x.clone().valueOf(), rows, cols);\n }\n if (cols === 0) {\n return 1; // det of an empty matrix is per definition 1\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n }\n });\n\n /**\n * Calculate the determinant of a matrix\n * @param {Array[]} matrix A square, two dimensional matrix\n * @param {number} rows Number of rows of the matrix (zero-based)\n * @param {number} cols Number of columns of the matrix (zero-based)\n * @returns {number} det\n * @private\n */\n function _det(matrix, rows, cols) {\n if (rows === 1) {\n // this is a 1 x 1 matrix\n return clone(matrix[0][0]);\n } else if (rows === 2) {\n // this is a 2 x 2 matrix\n // the determinant of [a11,a12;a21,a22] is det = a11*a22-a21*a12\n return subtractScalar(multiply(matrix[0][0], matrix[1][1]), multiply(matrix[1][0], matrix[0][1]));\n } else {\n // Bareiss algorithm\n // this algorithm have same complexity as LUP decomposition (O(n^3))\n // but it preserve precision of floating point more relative to the LUP decomposition\n var negated = false;\n var rowIndices = new Array(rows).fill(0).map((_, i) => i); // matrix index of row i\n for (var k = 0; k < rows; k++) {\n var k_ = rowIndices[k];\n if (isZero(matrix[k_][k])) {\n var _k = void 0;\n for (_k = k + 1; _k < rows; _k++) {\n if (!isZero(matrix[rowIndices[_k]][k])) {\n k_ = rowIndices[_k];\n rowIndices[_k] = rowIndices[k];\n rowIndices[k] = k_;\n negated = !negated;\n break;\n }\n }\n if (_k === rows) return matrix[k_][k]; // some zero of the type\n }\n var piv = matrix[k_][k];\n var piv_ = k === 0 ? 1 : matrix[rowIndices[k - 1]][k - 1];\n for (var i = k + 1; i < rows; i++) {\n var i_ = rowIndices[i];\n for (var j = k + 1; j < rows; j++) {\n matrix[i_][j] = divideScalar(subtractScalar(multiply(matrix[i_][j], piv), multiply(matrix[i_][k], matrix[k_][j])), piv_);\n }\n }\n }\n var det = matrix[rowIndices[rows - 1]][rows - 1];\n return negated ? unaryMinus(det) : det;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nvar name = 'inv';\nvar dependencies = ['typed', 'matrix', 'divideScalar', 'addScalar', 'multiply', 'unaryMinus', 'det', 'identity', 'abs'];\nexport var createInv = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divideScalar,\n addScalar,\n multiply,\n unaryMinus,\n det,\n identity,\n abs\n } = _ref;\n /**\n * Calculate the inverse of a square matrix.\n *\n * Syntax:\n *\n * math.inv(x)\n *\n * Examples:\n *\n * math.inv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]\n * math.inv(4) // returns 0.25\n * 1 / 4 // returns 0.25\n *\n * See also:\n *\n * det, transpose\n *\n * @param {number | Complex | Array | Matrix} x Matrix to be inversed\n * @return {number | Complex | Array | Matrix} The inverse of `x`.\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(x) {\n var size = isMatrix(x) ? x.size() : arraySize(x);\n switch (size.length) {\n case 1:\n // vector\n if (size[0] === 1) {\n if (isMatrix(x)) {\n return matrix([divideScalar(1, x.valueOf()[0])]);\n } else {\n return [divideScalar(1, x[0])];\n }\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n // two dimensional array\n {\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n if (isMatrix(x)) {\n return matrix(_inv(x.valueOf(), rows, cols), x.storage());\n } else {\n // return an Array\n return _inv(x, rows, cols);\n }\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n },\n any: function any(x) {\n // scalar\n return divideScalar(1, x); // FIXME: create a BigNumber one when configured for bignumbers\n }\n });\n\n /**\n * Calculate the inverse of a square matrix\n * @param {Array[]} mat A square matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns, must equal rows\n * @return {Array[]} inv Inverse matrix\n * @private\n */\n function _inv(mat, rows, cols) {\n var r, s, f, value, temp;\n if (rows === 1) {\n // this is a 1 x 1 matrix\n value = mat[0][0];\n if (value === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n return [[divideScalar(1, value)]];\n } else if (rows === 2) {\n // this is a 2 x 2 matrix\n var d = det(mat);\n if (d === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n return [[divideScalar(mat[1][1], d), divideScalar(unaryMinus(mat[0][1]), d)], [divideScalar(unaryMinus(mat[1][0]), d), divideScalar(mat[0][0], d)]];\n } else {\n // this is a matrix of 3 x 3 or larger\n // calculate inverse using gauss-jordan elimination\n // https://en.wikipedia.org/wiki/Gaussian_elimination\n // http://mathworld.wolfram.com/MatrixInverse.html\n // http://math.uww.edu/~mcfarlat/inverse.htm\n\n // make a copy of the matrix (only the arrays, not of the elements)\n var A = mat.concat();\n for (r = 0; r < rows; r++) {\n A[r] = A[r].concat();\n }\n\n // create an identity matrix which in the end will contain the\n // matrix inverse\n var B = identity(rows).valueOf();\n\n // loop over all columns, and perform row reductions\n for (var c = 0; c < cols; c++) {\n // Pivoting: Swap row c with row r, where row r contains the largest element A[r][c]\n var ABig = abs(A[c][c]);\n var rBig = c;\n r = c + 1;\n while (r < rows) {\n if (abs(A[r][c]) > ABig) {\n ABig = abs(A[r][c]);\n rBig = r;\n }\n r++;\n }\n if (ABig === 0) {\n throw Error('Cannot calculate inverse, determinant is zero');\n }\n r = rBig;\n if (r !== c) {\n temp = A[c];\n A[c] = A[r];\n A[r] = temp;\n temp = B[c];\n B[c] = B[r];\n B[r] = temp;\n }\n\n // eliminate non-zero values on the other rows at column c\n var Ac = A[c];\n var Bc = B[c];\n for (r = 0; r < rows; r++) {\n var Ar = A[r];\n var Br = B[r];\n if (r !== c) {\n // eliminate value at column c and row r\n if (Ar[c] !== 0) {\n f = divideScalar(unaryMinus(Ar[c]), Ac[c]);\n\n // add (f * row c) to row r to eliminate the value\n // at column c\n for (s = c; s < cols; s++) {\n Ar[s] = addScalar(Ar[s], multiply(f, Ac[s]));\n }\n for (s = 0; s < cols; s++) {\n Br[s] = addScalar(Br[s], multiply(f, Bc[s]));\n }\n }\n } else {\n // normalize value at Acc to 1,\n // divide each value on row r with the value at Acc\n f = Ac[c];\n for (s = c; s < cols; s++) {\n Ar[s] = divideScalar(Ar[s], f);\n }\n for (s = 0; s < cols; s++) {\n Br[s] = divideScalar(Br[s], f);\n }\n }\n }\n }\n return B;\n }\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nimport { clone } from '../../utils/object.js';\nvar name = 'pinv';\nvar dependencies = ['typed', 'matrix', 'inv', 'deepEqual', 'equal', 'dotDivide', 'dot', 'ctranspose', 'divideScalar', 'multiply', 'add', 'Complex'];\nexport var createPinv = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n inv,\n deepEqual,\n equal,\n dotDivide,\n dot,\n ctranspose,\n divideScalar,\n multiply,\n add,\n Complex\n } = _ref;\n /**\n * Calculate the Moore\u2013Penrose inverse of a matrix.\n *\n * Syntax:\n *\n * math.pinv(x)\n *\n * Examples:\n *\n * math.pinv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]\n * math.pinv([[1, 0], [0, 1], [0, 1]]) // returns [[1, 0, 0], [0, 0.5, 0.5]]\n * math.pinv(4) // returns 0.25\n *\n * See also:\n *\n * inv\n *\n * @param {number | Complex | Array | Matrix} x Matrix to be inversed\n * @return {number | Complex | Array | Matrix} The inverse of `x`.\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(x) {\n var size = isMatrix(x) ? x.size() : arraySize(x);\n switch (size.length) {\n case 1:\n // vector\n if (_isZeros(x)) return ctranspose(x); // null vector\n if (size[0] === 1) {\n return inv(x); // invertible matrix\n } else {\n return dotDivide(ctranspose(x), dot(x, x));\n }\n case 2:\n // two dimensional array\n {\n if (_isZeros(x)) return ctranspose(x); // zero matrixx\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n try {\n return inv(x); // invertible matrix\n } catch (err) {\n if (err instanceof Error && err.message.match(/Cannot calculate inverse, determinant is zero/)) {\n // Expected\n } else {\n throw err;\n }\n }\n }\n if (isMatrix(x)) {\n return matrix(_pinv(x.valueOf(), rows, cols), x.storage());\n } else {\n // return an Array\n return _pinv(x, rows, cols);\n }\n }\n default:\n // multi dimensional array\n throw new RangeError('Matrix must be two dimensional ' + '(size: ' + format(size) + ')');\n }\n },\n any: function any(x) {\n // scalar\n if (equal(x, 0)) return clone(x); // zero\n return divideScalar(1, x);\n }\n });\n\n /**\n * Calculate the Moore\u2013Penrose inverse of a matrix\n * @param {Array[]} mat A matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {Array[]} pinv Pseudoinverse matrix\n * @private\n */\n function _pinv(mat, rows, cols) {\n var {\n C,\n F\n } = _rankFact(mat, rows, cols); // TODO: Use SVD instead (may improve precision)\n var Cpinv = multiply(inv(multiply(ctranspose(C), C)), ctranspose(C));\n var Fpinv = multiply(ctranspose(F), inv(multiply(F, ctranspose(F))));\n return multiply(Fpinv, Cpinv);\n }\n\n /**\n * Calculate the reduced row echelon form of a matrix\n *\n * Modified from https://rosettacode.org/wiki/Reduced_row_echelon_form\n *\n * @param {Array[]} mat A matrix\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {Array[]} Reduced row echelon form\n * @private\n */\n function _rref(mat, rows, cols) {\n var M = clone(mat);\n var lead = 0;\n for (var r = 0; r < rows; r++) {\n if (cols <= lead) {\n return M;\n }\n var i = r;\n while (_isZero(M[i][lead])) {\n i++;\n if (rows === i) {\n i = r;\n lead++;\n if (cols === lead) {\n return M;\n }\n }\n }\n [M[i], M[r]] = [M[r], M[i]];\n var val = M[r][lead];\n for (var j = 0; j < cols; j++) {\n M[r][j] = dotDivide(M[r][j], val);\n }\n for (var _i = 0; _i < rows; _i++) {\n if (_i === r) continue;\n val = M[_i][lead];\n for (var _j = 0; _j < cols; _j++) {\n M[_i][_j] = add(M[_i][_j], multiply(-1, multiply(val, M[r][_j])));\n }\n }\n lead++;\n }\n return M;\n }\n\n /**\n * Calculate the rank factorization of a matrix\n *\n * @param {Array[]} mat A matrix (M)\n * @param {number} rows Number of rows\n * @param {number} cols Number of columns\n * @return {{C: Array, F: Array}} rank factorization where M = C F\n * @private\n */\n function _rankFact(mat, rows, cols) {\n var rref = _rref(mat, rows, cols);\n var C = mat.map((_, i) => _.filter((_, j) => j < rows && !_isZero(dot(rref[j], rref[j]))));\n var F = rref.filter((_, i) => !_isZero(dot(rref[i], rref[i])));\n return {\n C,\n F\n };\n }\n function _isZero(x) {\n return equal(add(x, Complex(1, 1)), add(0, Complex(1, 1)));\n }\n function _isZeros(arr) {\n return deepEqual(add(arr, Complex(1, 1)), add(multiply(arr, 0), Complex(1, 1)));\n }\n});", "import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../../utils/factory.js';\nimport { format } from '../../utils/string.js';\nimport { createComplexEigs } from './eigs/complexEigs.js';\nimport { createRealSymmetric } from './eigs/realSymmetric.js';\nimport { typeOf, isNumber, isBigNumber, isComplex, isFraction } from '../../utils/is.js';\nvar name = 'eigs';\n\n// The absolute state of math.js's dependency system:\nvar dependencies = ['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'];\nexport var createEigs = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n matrix,\n addScalar,\n subtract,\n equal,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n divideScalar,\n inv,\n bignumber,\n multiply,\n add,\n larger,\n column,\n flatten,\n number,\n complex,\n sqrt,\n diag,\n size,\n reshape,\n qr,\n usolve,\n usolveAll,\n im,\n re,\n smaller,\n matrixFromColumns,\n dot\n } = _ref;\n var doRealSymmetric = createRealSymmetric({\n config,\n addScalar,\n subtract,\n column,\n flatten,\n equal,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n inv,\n bignumber,\n complex,\n multiply,\n add\n });\n var doComplexEigs = createComplexEigs({\n config,\n addScalar,\n subtract,\n multiply,\n multiplyScalar,\n flatten,\n divideScalar,\n sqrt,\n abs,\n bignumber,\n diag,\n size,\n reshape,\n qr,\n inv,\n usolve,\n usolveAll,\n equal,\n complex,\n larger,\n smaller,\n matrixFromColumns,\n dot\n });\n\n /**\n * Compute eigenvalues and optionally eigenvectors of a square matrix.\n * The eigenvalues are sorted by their absolute value, ascending, and\n * returned as a vector in the `values` property of the returned project.\n * An eigenvalue with algebraic multiplicity k will be listed k times, so\n * that the returned `values` vector always has length equal to the size\n * of the input matrix.\n *\n * The `eigenvectors` property of the return value provides the eigenvectors.\n * It is an array of plain objects: the `value` property of each gives the\n * associated eigenvalue, and the `vector` property gives the eigenvector\n * itself. Note that the same `value` property will occur as many times in\n * the list provided by `eigenvectors` as the geometric multiplicity of\n * that value.\n *\n * If the algorithm fails to converge, it will throw an error \u2013\n * in that case, however, you may still find useful information\n * in `err.values` and `err.vectors`.\n *\n * Note that the 'precision' option does not directly specify the _accuracy_\n * of the returned eigenvalues. Rather, it determines how small an entry\n * of the iterative approximations to an upper triangular matrix must be\n * in order to be considered zero. The actual accuracy of the returned\n * eigenvalues may be greater or less than the precision, depending on the\n * conditioning of the matrix and how far apart or close the actual\n * eigenvalues are. Note that currently, relatively simple, \"traditional\"\n * methods of eigenvalue computation are being used; this is not a modern,\n * high-precision eigenvalue computation. That said, it should typically\n * produce fairly reasonable results.\n *\n * Syntax:\n *\n * math.eigs(x, [prec])\n * math.eigs(x, {options})\n *\n * Examples:\n *\n * const { eigs, multiply, column, transpose, matrixFromColumns } = math\n * const H = [[5, 2.3], [2.3, 1]]\n * const ans = eigs(H) // returns {values: [E1,E2...sorted], eigenvectors: [{value: E1, vector: v2}, {value: e, vector: v2}, ...]\n * const E = ans.values\n * const V = ans.eigenvectors\n * multiply(H, V[0].vector)) // returns multiply(E[0], V[0].vector))\n * const U = matrixFromColumns(...V.map(obj => obj.vector))\n * const UTxHxU = multiply(transpose(U), H, U) // diagonalizes H if possible\n * E[0] == UTxHxU[0][0] // returns true always\n *\n * // Compute only approximate eigenvalues:\n * const {values} = eigs(H, {eigenvectors: false, precision: 1e-6})\n *\n * See also:\n *\n * inv\n *\n * @param {Array | Matrix} x Matrix to be diagonalized\n *\n * @param {number | BigNumber | OptsObject} [opts] Object with keys `precision`, defaulting to config.relTol, and `eigenvectors`, defaulting to true and specifying whether to compute eigenvectors. If just a number, specifies precision.\n * @return {{values: Array|Matrix, eigenvectors?: Array}} Object containing an array of eigenvalues and an array of {value: number|BigNumber, vector: Array|Matrix} objects. The eigenvectors property is undefined if eigenvectors were not requested.\n *\n */\n return typed('eigs', {\n // The conversion to matrix in the first two implementations,\n // just to convert back to an array right away in\n // computeValuesAndVectors, is unfortunate, and should perhaps be\n // streamlined. It is done because the Matrix object carries some\n // type information about its entries, and so constructing the matrix\n // is a roundabout way of doing type detection.\n Array: function Array(x) {\n return doEigs(matrix(x));\n },\n 'Array, number|BigNumber': function ArrayNumberBigNumber(x, prec) {\n return doEigs(matrix(x), {\n precision: prec\n });\n },\n 'Array, Object'(x, opts) {\n return doEigs(matrix(x), opts);\n },\n Matrix: function Matrix(mat) {\n return doEigs(mat, {\n matricize: true\n });\n },\n 'Matrix, number|BigNumber': function MatrixNumberBigNumber(mat, prec) {\n return doEigs(mat, {\n precision: prec,\n matricize: true\n });\n },\n 'Matrix, Object': function MatrixObject(mat, opts) {\n var useOpts = {\n matricize: true\n };\n _extends(useOpts, opts);\n return doEigs(mat, useOpts);\n }\n });\n function doEigs(mat) {\n var _opts$precision;\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var computeVectors = 'eigenvectors' in opts ? opts.eigenvectors : true;\n var prec = (_opts$precision = opts.precision) !== null && _opts$precision !== void 0 ? _opts$precision : config.relTol;\n var result = computeValuesAndVectors(mat, prec, computeVectors);\n if (opts.matricize) {\n result.values = matrix(result.values);\n if (computeVectors) {\n result.eigenvectors = result.eigenvectors.map(_ref2 => {\n var {\n value,\n vector\n } = _ref2;\n return {\n value,\n vector: matrix(vector)\n };\n });\n }\n }\n if (computeVectors) {\n Object.defineProperty(result, 'vectors', {\n enumerable: false,\n // to make sure that the eigenvectors can still be\n // converted to string.\n get: () => {\n throw new Error('eigs(M).vectors replaced with eigs(M).eigenvectors');\n }\n });\n }\n return result;\n }\n function computeValuesAndVectors(mat, prec, computeVectors) {\n var arr = mat.toArray(); // NOTE: arr is guaranteed to be unaliased\n // and so safe to modify in place\n var asize = mat.size();\n if (asize.length !== 2 || asize[0] !== asize[1]) {\n throw new RangeError(\"Matrix must be square (size: \".concat(format(asize), \")\"));\n }\n var N = asize[0];\n if (isReal(arr, N, prec)) {\n coerceReal(arr, N); // modifies arr by side effect\n\n if (isSymmetric(arr, N, prec)) {\n var _type = coerceTypes(mat, arr, N); // modifies arr by side effect\n return doRealSymmetric(arr, N, prec, _type, computeVectors);\n }\n }\n var type = coerceTypes(mat, arr, N); // modifies arr by side effect\n return doComplexEigs(arr, N, prec, type, computeVectors);\n }\n\n /** @return {boolean} */\n function isSymmetric(arr, N, prec) {\n for (var i = 0; i < N; i++) {\n for (var j = i; j < N; j++) {\n // TODO proper comparison of bignum and frac\n if (larger(bignumber(abs(subtract(arr[i][j], arr[j][i]))), prec)) {\n return false;\n }\n }\n }\n return true;\n }\n\n /** @return {boolean} */\n function isReal(arr, N, prec) {\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n // TODO proper comparison of bignum and frac\n if (larger(bignumber(abs(im(arr[i][j]))), prec)) {\n return false;\n }\n }\n }\n return true;\n }\n function coerceReal(arr, N) {\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n arr[i][j] = re(arr[i][j]);\n }\n }\n }\n\n /** @return {'number' | 'BigNumber' | 'Complex'} */\n function coerceTypes(mat, arr, N) {\n /** @type {string} */\n var type = mat.datatype();\n if (type === 'number' || type === 'BigNumber' || type === 'Complex') {\n return type;\n }\n var hasNumber = false;\n var hasBig = false;\n var hasComplex = false;\n for (var i = 0; i < N; i++) {\n for (var j = 0; j < N; j++) {\n var el = arr[i][j];\n if (isNumber(el) || isFraction(el)) {\n hasNumber = true;\n } else if (isBigNumber(el)) {\n hasBig = true;\n } else if (isComplex(el)) {\n hasComplex = true;\n } else {\n throw TypeError('Unsupported type in Matrix: ' + typeOf(el));\n }\n }\n }\n if (hasBig && hasComplex) {\n console.warn('Complex BigNumbers not supported, this operation will lose precission.');\n }\n if (hasComplex) {\n for (var _i = 0; _i < N; _i++) {\n for (var _j = 0; _j < N; _j++) {\n arr[_i][_j] = complex(arr[_i][_j]);\n }\n }\n return 'Complex';\n }\n if (hasBig) {\n for (var _i2 = 0; _i2 < N; _i2++) {\n for (var _j2 = 0; _j2 < N; _j2++) {\n arr[_i2][_j2] = bignumber(arr[_i2][_j2]);\n }\n }\n return 'BigNumber';\n }\n if (hasNumber) {\n for (var _i3 = 0; _i3 < N; _i3++) {\n for (var _j3 = 0; _j3 < N; _j3++) {\n arr[_i3][_j3] = number(arr[_i3][_j3]);\n }\n }\n return 'number';\n } else {\n throw TypeError('Matrix contains unsupported types only.');\n }\n }\n});", "import { clone } from '../../../utils/object.js';\nexport function createComplexEigs(_ref) {\n var {\n addScalar,\n subtract,\n flatten,\n multiply,\n multiplyScalar,\n divideScalar,\n sqrt,\n abs,\n bignumber,\n diag,\n size,\n reshape,\n inv,\n qr,\n usolve,\n usolveAll,\n equal,\n complex,\n larger,\n smaller,\n matrixFromColumns,\n dot\n } = _ref;\n /**\n * @param {number[][]} arr the matrix to find eigenvalues of\n * @param {number} N size of the matrix\n * @param {number|BigNumber} prec precision, anything lower will be considered zero\n * @param {'number'|'BigNumber'|'Complex'} type\n * @param {boolean} findVectors should we find eigenvectors?\n *\n * @returns {{ values: number[], vectors: number[][] }}\n */\n function complexEigs(arr, N, prec, type) {\n var findVectors = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n // TODO check if any row/col are zero except the diagonal\n\n // make sure corresponding rows and columns have similar magnitude\n // important because of numerical stability\n // MODIFIES arr by side effect!\n var R = balance(arr, N, prec, type, findVectors);\n\n // R is the row transformation matrix\n // arr = A' = R A R^-1, A is the original matrix\n // (if findVectors is false, R is undefined)\n // (And so to return to original matrix: A = R^-1 arr R)\n\n // TODO if magnitudes of elements vary over many orders,\n // move greatest elements to the top left corner\n\n // using similarity transformations, reduce the matrix\n // to Hessenberg form (upper triangular plus one subdiagonal row)\n // updates the transformation matrix R with new row operationsq\n // MODIFIES arr by side effect!\n reduceToHessenberg(arr, N, prec, type, findVectors, R);\n // still true that original A = R^-1 arr R)\n\n // find eigenvalues\n var {\n values,\n C\n } = iterateUntilTriangular(arr, N, prec, type, findVectors);\n\n // values is the list of eigenvalues, C is the column\n // transformation matrix that transforms arr, the hessenberg\n // matrix, to upper triangular\n // (So U = C^-1 arr C and the relationship between current arr\n // and original A is unchanged.)\n\n if (findVectors) {\n var eigenvectors = findEigenvectors(arr, N, C, R, values, prec, type);\n return {\n values,\n eigenvectors\n };\n }\n return {\n values\n };\n }\n\n /**\n * @param {number[][]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {number[][]}\n */\n function balance(arr, N, prec, type, findVectors) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var realzero = big ? bignumber(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n var realone = big ? bignumber(1) : 1;\n\n // base of the floating-point arithmetic\n var radix = big ? bignumber(10) : 2;\n var radixSq = multiplyScalar(radix, radix);\n\n // the diagonal transformation matrix R\n var Rdiag;\n if (findVectors) {\n Rdiag = Array(N).fill(one);\n }\n\n // this isn't the only time we loop thru the matrix...\n var last = false;\n while (!last) {\n // ...haha I'm joking! unless...\n last = true;\n for (var i = 0; i < N; i++) {\n // compute the taxicab norm of i-th column and row\n // TODO optimize for complex numbers\n var colNorm = realzero;\n var rowNorm = realzero;\n for (var j = 0; j < N; j++) {\n if (i === j) continue;\n colNorm = addScalar(colNorm, abs(arr[j][i]));\n rowNorm = addScalar(rowNorm, abs(arr[i][j]));\n }\n if (!equal(colNorm, 0) && !equal(rowNorm, 0)) {\n // find integer power closest to balancing the matrix\n // (we want to scale only by integer powers of radix,\n // so that we don't lose any precision due to round-off)\n\n var f = realone;\n var c = colNorm;\n var rowDivRadix = divideScalar(rowNorm, radix);\n var rowMulRadix = multiplyScalar(rowNorm, radix);\n while (smaller(c, rowDivRadix)) {\n c = multiplyScalar(c, radixSq);\n f = multiplyScalar(f, radix);\n }\n while (larger(c, rowMulRadix)) {\n c = divideScalar(c, radixSq);\n f = divideScalar(f, radix);\n }\n\n // check whether balancing is needed\n // condition = (c + rowNorm) / f < 0.95 * (colNorm + rowNorm)\n var condition = smaller(divideScalar(addScalar(c, rowNorm), f), multiplyScalar(addScalar(colNorm, rowNorm), 0.95));\n\n // apply balancing similarity transformation\n if (condition) {\n // we should loop once again to check whether\n // another rebalancing is needed\n last = false;\n var g = divideScalar(1, f);\n for (var _j = 0; _j < N; _j++) {\n if (i === _j) {\n continue;\n }\n arr[i][_j] = multiplyScalar(arr[i][_j], g);\n arr[_j][i] = multiplyScalar(arr[_j][i], f);\n }\n\n // keep track of transformations\n if (findVectors) {\n Rdiag[i] = multiplyScalar(Rdiag[i], g);\n }\n }\n }\n }\n }\n\n // return the diagonal row transformation matrix\n return findVectors ? diag(Rdiag) : null;\n }\n\n /**\n * @param {number[][]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number'|'BigNumber'|'Complex'} type\n * @param {boolean} findVectors\n * @param {number[][]} R the row transformation matrix that will be modified\n */\n function reduceToHessenberg(arr, N, prec, type, findVectors, R) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n if (big) {\n prec = bignumber(prec);\n }\n for (var i = 0; i < N - 2; i++) {\n // Find the largest subdiag element in the i-th col\n\n var maxIndex = 0;\n var max = zero;\n for (var j = i + 1; j < N; j++) {\n var el = arr[j][i];\n if (smaller(abs(max), abs(el))) {\n max = el;\n maxIndex = j;\n }\n }\n\n // This col is pivoted, no need to do anything\n if (smaller(abs(max), prec)) {\n continue;\n }\n if (maxIndex !== i + 1) {\n // Interchange maxIndex-th and (i+1)-th row\n var tmp1 = arr[maxIndex];\n arr[maxIndex] = arr[i + 1];\n arr[i + 1] = tmp1;\n\n // Interchange maxIndex-th and (i+1)-th column\n for (var _j2 = 0; _j2 < N; _j2++) {\n var tmp2 = arr[_j2][maxIndex];\n arr[_j2][maxIndex] = arr[_j2][i + 1];\n arr[_j2][i + 1] = tmp2;\n }\n\n // keep track of transformations\n if (findVectors) {\n var tmp3 = R[maxIndex];\n R[maxIndex] = R[i + 1];\n R[i + 1] = tmp3;\n }\n }\n\n // Reduce following rows and columns\n for (var _j3 = i + 2; _j3 < N; _j3++) {\n var n = divideScalar(arr[_j3][i], max);\n if (n === 0) {\n continue;\n }\n\n // from j-th row subtract n-times (i+1)th row\n for (var k = 0; k < N; k++) {\n arr[_j3][k] = subtract(arr[_j3][k], multiplyScalar(n, arr[i + 1][k]));\n }\n\n // to (i+1)th column add n-times j-th column\n for (var _k = 0; _k < N; _k++) {\n arr[_k][i + 1] = addScalar(arr[_k][i + 1], multiplyScalar(n, arr[_k][_j3]));\n }\n\n // keep track of transformations\n if (findVectors) {\n for (var _k2 = 0; _k2 < N; _k2++) {\n R[_j3][_k2] = subtract(R[_j3][_k2], multiplyScalar(n, R[i + 1][_k2]));\n }\n }\n }\n }\n return R;\n }\n\n /**\n * @returns {{values: values, C: Matrix}}\n * @see Press, Wiliams: Numerical recipes in Fortran 77\n * @see https://en.wikipedia.org/wiki/QR_algorithm\n */\n function iterateUntilTriangular(A, N, prec, type, findVectors) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n if (big) {\n prec = bignumber(prec);\n }\n\n // The Francis Algorithm\n // The core idea of this algorithm is that doing successive\n // A' = QtAQ transformations will eventually converge to block-\n // upper-triangular with diagonal blocks either 1x1 or 2x2.\n // The Q here is the one from the QR decomposition, A = QR.\n // Since the eigenvalues of a block-upper-triangular matrix are\n // the eigenvalues of its diagonal blocks and we know how to find\n // eigenvalues of a 2x2 matrix, we know the eigenvalues of A.\n\n var arr = clone(A);\n\n // the list of converged eigenvalues\n var lambdas = [];\n\n // size of arr, which will get smaller as eigenvalues converge\n var n = N;\n\n // the diagonal of the block-diagonal matrix that turns\n // converged 2x2 matrices into upper triangular matrices\n var Sdiag = [];\n\n // N\u00D7N matrix describing the overall transformation done during the QR algorithm\n var Qtotal = findVectors ? diag(Array(N).fill(one)) : undefined;\n\n // nxn matrix describing the QR transformations done since last convergence\n var Qpartial = findVectors ? diag(Array(n).fill(one)) : undefined;\n\n // last eigenvalue converged before this many steps\n var lastConvergenceBefore = 0;\n while (lastConvergenceBefore <= 100) {\n lastConvergenceBefore += 1;\n\n // TODO if the convergence is slow, do something clever\n\n // Perform the factorization\n\n var k = arr[n - 1][n - 1]; // TODO this is apparently a somewhat\n // old-fashioned choice; ideally set close to an eigenvalue, or\n // perhaps better yet switch to the implicit QR version that is sometimes\n // specifically called the \"Francis algorithm\" that is alluded to\n // in the following TODO. (Or perhaps we switch to an independently\n // optimized third-party package for the linear algebra operations...)\n\n for (var i = 0; i < n; i++) {\n arr[i][i] = subtract(arr[i][i], k);\n }\n\n // TODO do an implicit QR transformation\n var {\n Q,\n R\n } = qr(arr);\n arr = multiply(R, Q);\n for (var _i = 0; _i < n; _i++) {\n arr[_i][_i] = addScalar(arr[_i][_i], k);\n }\n\n // keep track of transformations\n if (findVectors) {\n Qpartial = multiply(Qpartial, Q);\n }\n\n // The rightmost diagonal element converged to an eigenvalue\n if (n === 1 || smaller(abs(arr[n - 1][n - 2]), prec)) {\n lastConvergenceBefore = 0;\n lambdas.push(arr[n - 1][n - 1]);\n\n // keep track of transformations\n if (findVectors) {\n Sdiag.unshift([[1]]);\n inflateMatrix(Qpartial, N);\n Qtotal = multiply(Qtotal, Qpartial);\n if (n > 1) {\n Qpartial = diag(Array(n - 1).fill(one));\n }\n }\n\n // reduce the matrix size\n n -= 1;\n arr.pop();\n for (var _i2 = 0; _i2 < n; _i2++) {\n arr[_i2].pop();\n }\n\n // The rightmost diagonal 2x2 block converged\n } else if (n === 2 || smaller(abs(arr[n - 2][n - 3]), prec)) {\n lastConvergenceBefore = 0;\n var ll = eigenvalues2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1]);\n lambdas.push(...ll);\n\n // keep track of transformations\n if (findVectors) {\n Sdiag.unshift(jordanBase2x2(arr[n - 2][n - 2], arr[n - 2][n - 1], arr[n - 1][n - 2], arr[n - 1][n - 1], ll[0], ll[1], prec, type));\n inflateMatrix(Qpartial, N);\n Qtotal = multiply(Qtotal, Qpartial);\n if (n > 2) {\n Qpartial = diag(Array(n - 2).fill(one));\n }\n }\n\n // reduce the matrix size\n n -= 2;\n arr.pop();\n arr.pop();\n for (var _i3 = 0; _i3 < n; _i3++) {\n arr[_i3].pop();\n arr[_i3].pop();\n }\n }\n if (n === 0) {\n break;\n }\n }\n\n // standard sorting\n lambdas.sort((a, b) => +subtract(abs(a), abs(b)));\n\n // the algorithm didn't converge\n if (lastConvergenceBefore > 100) {\n var err = Error('The eigenvalues failed to converge. Only found these eigenvalues: ' + lambdas.join(', '));\n err.values = lambdas;\n err.vectors = [];\n throw err;\n }\n\n // combine the overall QR transformation Qtotal with the subsequent\n // transformation S that turns the diagonal 2x2 blocks to upper triangular\n var C = findVectors ? multiply(Qtotal, blockDiag(Sdiag, N)) : undefined;\n return {\n values: lambdas,\n C\n };\n }\n\n /**\n * @param {Matrix} A hessenberg-form matrix\n * @param {number} N size of A\n * @param {Matrix} C column transformation matrix that turns A into upper triangular\n * @param {Matrix} R similarity that turns original matrix into A\n * @param {number[]} values array of eigenvalues of A\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {number[][]} eigenvalues\n */\n function findEigenvectors(A, N, C, R, values, prec, type) {\n var Cinv = inv(C);\n var U = multiply(Cinv, A, C);\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n\n // turn values into a kind of \"multiset\"\n // this way it is easier to find eigenvectors\n var uniqueValues = [];\n var multiplicities = [];\n for (var lambda of values) {\n var i = indexOf(uniqueValues, lambda, equal);\n if (i === -1) {\n uniqueValues.push(lambda);\n multiplicities.push(1);\n } else {\n multiplicities[i] += 1;\n }\n }\n\n // find eigenvectors by solving U \u2212 lambdaE = 0\n // TODO replace with an iterative eigenvector algorithm\n // (this one might fail for imprecise eigenvalues)\n\n var vectors = [];\n var len = uniqueValues.length;\n var b = Array(N).fill(zero);\n var E = diag(Array(N).fill(one));\n var _loop = function _loop() {\n var lambda = uniqueValues[_i4];\n var S = subtract(U, multiply(lambda, E)); // the characteristic matrix\n\n var solutions = usolveAll(S, b);\n solutions.shift(); // ignore the null vector\n\n // looks like we missed something, try inverse iteration\n // But if that fails, just presume that the original matrix truly\n // was defective.\n while (solutions.length < multiplicities[_i4]) {\n var approxVec = inverseIterate(S, N, solutions, prec, type);\n if (approxVec === null) {\n break;\n } // no more vectors were found\n solutions.push(approxVec);\n }\n\n // Transform back into original array coordinates\n var correction = multiply(inv(R), C);\n solutions = solutions.map(v => multiply(correction, v));\n vectors.push(...solutions.map(v => ({\n value: lambda,\n vector: flatten(v)\n })));\n };\n for (var _i4 = 0; _i4 < len; _i4++) {\n _loop();\n }\n return vectors;\n }\n\n /**\n * Compute the eigenvalues of an 2x2 matrix\n * @return {[number,number]}\n */\n function eigenvalues2x2(a, b, c, d) {\n // lambda_+- = 1/2 trA +- 1/2 sqrt( tr^2 A - 4 detA )\n var trA = addScalar(a, d);\n var detA = subtract(multiplyScalar(a, d), multiplyScalar(b, c));\n var x = multiplyScalar(trA, 0.5);\n var y = multiplyScalar(sqrt(subtract(multiplyScalar(trA, trA), multiplyScalar(4, detA))), 0.5);\n return [addScalar(x, y), subtract(x, y)];\n }\n\n /**\n * For an 2x2 matrix compute the transformation matrix S,\n * so that SAS^-1 is an upper triangular matrix\n * @return {[[number,number],[number,number]]}\n * @see https://math.berkeley.edu/~ogus/old/Math_54-05/webfoils/jordan.pdf\n * @see http://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html\n */\n function jordanBase2x2(a, b, c, d, l1, l2, prec, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var zero = big ? bignumber(0) : cplx ? complex(0) : 0;\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n\n // matrix is already upper triangular\n // return an identity matrix\n if (smaller(abs(c), prec)) {\n return [[one, zero], [zero, one]];\n }\n\n // matrix is diagonalizable\n // return its eigenvectors as columns\n if (larger(abs(subtract(l1, l2)), prec)) {\n return [[subtract(l1, d), subtract(l2, d)], [c, c]];\n }\n\n // matrix is not diagonalizable\n // compute diagonal elements of N = A - lambdaI\n var na = subtract(a, l1);\n var nd = subtract(d, l1);\n\n // col(N,2) = 0 implies S = ( col(N,1), e_1 )\n // col(N,2) != 0 implies S = ( col(N,2), e_2 )\n\n if (smaller(abs(b), prec) && smaller(abs(nd), prec)) {\n return [[na, one], [c, zero]];\n } else {\n return [[b, zero], [nd, one]];\n }\n }\n\n /**\n * Enlarge the matrix from nxn to NxN, setting the new\n * elements to 1 on diagonal and 0 elsewhere\n */\n function inflateMatrix(arr, N) {\n // add columns\n for (var i = 0; i < arr.length; i++) {\n arr[i].push(...Array(N - arr[i].length).fill(0));\n }\n\n // add rows\n for (var _i5 = arr.length; _i5 < N; _i5++) {\n arr.push(Array(N).fill(0));\n arr[_i5][_i5] = 1;\n }\n return arr;\n }\n\n /**\n * Create a block-diagonal matrix with the given square matrices on the diagonal\n * @param {Matrix[] | number[][][]} arr array of matrices to be placed on the diagonal\n * @param {number} N the size of the resulting matrix\n */\n function blockDiag(arr, N) {\n var M = [];\n for (var i = 0; i < N; i++) {\n M[i] = Array(N).fill(0);\n }\n var I = 0;\n for (var sub of arr) {\n var n = sub.length;\n for (var _i6 = 0; _i6 < n; _i6++) {\n for (var j = 0; j < n; j++) {\n M[I + _i6][I + j] = sub[_i6][j];\n }\n }\n I += n;\n }\n return M;\n }\n\n /**\n * Finds the index of an element in an array using a custom equality function\n * @template T\n * @param {Array} arr array in which to search\n * @param {T} el the element to find\n * @param {function(T, T): boolean} fn the equality function, first argument is an element of `arr`, the second is always `el`\n * @returns {number} the index of `el`, or -1 when it's not in `arr`\n */\n function indexOf(arr, el, fn) {\n for (var i = 0; i < arr.length; i++) {\n if (fn(arr[i], el)) {\n return i;\n }\n }\n return -1;\n }\n\n /**\n * Provided a near-singular upper-triangular matrix A and a list of vectors,\n * finds an eigenvector of A with the smallest eigenvalue, which is orthogonal\n * to each vector in the list\n * @template T\n * @param {T[][]} A near-singular square matrix\n * @param {number} N dimension\n * @param {T[][]} orthog list of vectors\n * @param {number} prec epsilon\n * @param {'number'|'BigNumber'|'Complex'} type\n * @return {T[] | null} eigenvector\n *\n * @see Numerical Recipes for Fortran 77 \u2013 11.7 Eigenvalues or Eigenvectors by Inverse Iteration\n */\n function inverseIterate(A, N, orthog, prec, type) {\n var largeNum = type === 'BigNumber' ? bignumber(1000) : 1000;\n var b; // the vector\n\n // you better choose a random vector before I count to five\n var i = 0;\n for (; i < 5; ++i) {\n b = randomOrthogonalVector(N, orthog, type);\n try {\n b = usolve(A, b);\n } catch (_unused) {\n // That direction didn't work, likely because the original matrix\n // was defective. But still make the full number of tries...\n continue;\n }\n if (larger(norm(b), largeNum)) {\n break;\n }\n }\n if (i >= 5) {\n return null; // couldn't find any orthogonal vector in the image\n }\n\n // you better converge before I count to ten\n i = 0;\n while (true) {\n var c = usolve(A, b);\n if (smaller(norm(orthogonalComplement(b, [c])), prec)) {\n break;\n }\n if (++i >= 10) {\n return null;\n }\n b = normalize(c);\n }\n return b;\n }\n\n /**\n * Generates a random unit vector of dimension N, orthogonal to each vector in the list\n * @template T\n * @param {number} N dimension\n * @param {T[][]} orthog list of vectors\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {T[]} random vector\n */\n function randomOrthogonalVector(N, orthog, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n\n // generate random vector with the correct type\n var v = Array(N).fill(0).map(_ => 2 * Math.random() - 1);\n if (big) {\n v = v.map(n => bignumber(n));\n }\n if (cplx) {\n v = v.map(n => complex(n));\n }\n\n // project to orthogonal complement\n v = orthogonalComplement(v, orthog);\n\n // normalize\n return normalize(v, type);\n }\n\n /**\n * Project vector v to the orthogonal complement of an array of vectors\n */\n function orthogonalComplement(v, orthog) {\n var vectorShape = size(v);\n for (var w of orthog) {\n w = reshape(w, vectorShape); // make sure this is just a vector computation\n // v := v \u2212 (w, v)/|w|^2 w\n v = subtract(v, multiply(divideScalar(dot(w, v), dot(w, w)), w));\n }\n return v;\n }\n\n /**\n * Calculate the norm of a vector.\n * We can't use math.norm because factory can't handle circular dependency.\n * Seriously, I'm really fed up with factory.\n */\n function norm(v) {\n return abs(sqrt(dot(v, v)));\n }\n\n /**\n * Normalize a vector\n * @template T\n * @param {T[]} v\n * @param {'number'|'BigNumber'|'Complex'} type\n * @returns {T[]} normalized vec\n */\n function normalize(v, type) {\n var big = type === 'BigNumber';\n var cplx = type === 'Complex';\n var one = big ? bignumber(1) : cplx ? complex(1) : 1;\n return multiply(divideScalar(one, norm(v)), v);\n }\n return complexEigs;\n}", "import { clone } from '../../../utils/object.js';\nexport function createRealSymmetric(_ref) {\n var {\n config,\n addScalar,\n subtract,\n abs,\n atan,\n cos,\n sin,\n multiplyScalar,\n inv,\n bignumber,\n multiply,\n add\n } = _ref;\n /**\n * @param {number[] | BigNumber[]} arr\n * @param {number} N\n * @param {number} prec\n * @param {'number' | 'BigNumber'} type\n */\n function main(arr, N) {\n var prec = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : config.relTol;\n var type = arguments.length > 3 ? arguments[3] : undefined;\n var computeVectors = arguments.length > 4 ? arguments[4] : undefined;\n if (type === 'number') {\n return diag(arr, prec, computeVectors);\n }\n if (type === 'BigNumber') {\n return diagBig(arr, prec, computeVectors);\n }\n throw TypeError('Unsupported data type: ' + type);\n }\n\n // diagonalization implementation for number (efficient)\n function diag(x, precision, computeVectors) {\n var N = x.length;\n var e0 = Math.abs(precision / N);\n var psi;\n var Sij;\n if (computeVectors) {\n Sij = new Array(N);\n // Sij is Identity Matrix\n for (var i = 0; i < N; i++) {\n Sij[i] = Array(N).fill(0);\n Sij[i][i] = 1.0;\n }\n }\n // initial error\n var Vab = getAij(x);\n while (Math.abs(Vab[1]) >= Math.abs(e0)) {\n var _i = Vab[0][0];\n var j = Vab[0][1];\n psi = getTheta(x[_i][_i], x[j][j], x[_i][j]);\n x = x1(x, psi, _i, j);\n if (computeVectors) Sij = Sij1(Sij, psi, _i, j);\n Vab = getAij(x);\n }\n var Ei = Array(N).fill(0); // eigenvalues\n for (var _i2 = 0; _i2 < N; _i2++) {\n Ei[_i2] = x[_i2][_i2];\n }\n return sorting(clone(Ei), Sij, computeVectors);\n }\n\n // diagonalization implementation for bigNumber\n function diagBig(x, precision, computeVectors) {\n var N = x.length;\n var e0 = abs(precision / N);\n var psi;\n var Sij;\n if (computeVectors) {\n Sij = new Array(N);\n // Sij is Identity Matrix\n for (var i = 0; i < N; i++) {\n Sij[i] = Array(N).fill(0);\n Sij[i][i] = 1.0;\n }\n }\n // initial error\n var Vab = getAijBig(x);\n while (abs(Vab[1]) >= abs(e0)) {\n var _i3 = Vab[0][0];\n var j = Vab[0][1];\n psi = getThetaBig(x[_i3][_i3], x[j][j], x[_i3][j]);\n x = x1Big(x, psi, _i3, j);\n if (computeVectors) Sij = Sij1Big(Sij, psi, _i3, j);\n Vab = getAijBig(x);\n }\n var Ei = Array(N).fill(0); // eigenvalues\n for (var _i4 = 0; _i4 < N; _i4++) {\n Ei[_i4] = x[_i4][_i4];\n }\n // return [clone(Ei), clone(Sij)]\n return sorting(clone(Ei), Sij, computeVectors);\n }\n\n // get angle\n function getTheta(aii, ajj, aij) {\n var denom = ajj - aii;\n if (Math.abs(denom) <= config.relTol) {\n return Math.PI / 4.0;\n } else {\n return 0.5 * Math.atan(2.0 * aij / (ajj - aii));\n }\n }\n\n // get angle\n function getThetaBig(aii, ajj, aij) {\n var denom = subtract(ajj, aii);\n if (abs(denom) <= config.relTol) {\n return bignumber(-1).acos().div(4);\n } else {\n return multiplyScalar(0.5, atan(multiply(2.0, aij, inv(denom))));\n }\n }\n\n // update eigvec\n function Sij1(Sij, theta, i, j) {\n var N = Sij.length;\n var c = Math.cos(theta);\n var s = Math.sin(theta);\n var Ski = Array(N).fill(0);\n var Skj = Array(N).fill(0);\n for (var k = 0; k < N; k++) {\n Ski[k] = c * Sij[k][i] - s * Sij[k][j];\n Skj[k] = s * Sij[k][i] + c * Sij[k][j];\n }\n for (var _k = 0; _k < N; _k++) {\n Sij[_k][i] = Ski[_k];\n Sij[_k][j] = Skj[_k];\n }\n return Sij;\n }\n // update eigvec for overlap\n function Sij1Big(Sij, theta, i, j) {\n var N = Sij.length;\n var c = cos(theta);\n var s = sin(theta);\n var Ski = Array(N).fill(bignumber(0));\n var Skj = Array(N).fill(bignumber(0));\n for (var k = 0; k < N; k++) {\n Ski[k] = subtract(multiplyScalar(c, Sij[k][i]), multiplyScalar(s, Sij[k][j]));\n Skj[k] = addScalar(multiplyScalar(s, Sij[k][i]), multiplyScalar(c, Sij[k][j]));\n }\n for (var _k2 = 0; _k2 < N; _k2++) {\n Sij[_k2][i] = Ski[_k2];\n Sij[_k2][j] = Skj[_k2];\n }\n return Sij;\n }\n\n // update matrix\n function x1Big(Hij, theta, i, j) {\n var N = Hij.length;\n var c = bignumber(cos(theta));\n var s = bignumber(sin(theta));\n var c2 = multiplyScalar(c, c);\n var s2 = multiplyScalar(s, s);\n var Aki = Array(N).fill(bignumber(0));\n var Akj = Array(N).fill(bignumber(0));\n // 2cs Hij\n var csHij = multiply(bignumber(2), c, s, Hij[i][j]);\n // Aii\n var Aii = addScalar(subtract(multiplyScalar(c2, Hij[i][i]), csHij), multiplyScalar(s2, Hij[j][j]));\n var Ajj = add(multiplyScalar(s2, Hij[i][i]), csHij, multiplyScalar(c2, Hij[j][j]));\n // 0 to i\n for (var k = 0; k < N; k++) {\n Aki[k] = subtract(multiplyScalar(c, Hij[i][k]), multiplyScalar(s, Hij[j][k]));\n Akj[k] = addScalar(multiplyScalar(s, Hij[i][k]), multiplyScalar(c, Hij[j][k]));\n }\n // Modify Hij\n Hij[i][i] = Aii;\n Hij[j][j] = Ajj;\n Hij[i][j] = bignumber(0);\n Hij[j][i] = bignumber(0);\n // 0 to i\n for (var _k3 = 0; _k3 < N; _k3++) {\n if (_k3 !== i && _k3 !== j) {\n Hij[i][_k3] = Aki[_k3];\n Hij[_k3][i] = Aki[_k3];\n Hij[j][_k3] = Akj[_k3];\n Hij[_k3][j] = Akj[_k3];\n }\n }\n return Hij;\n }\n\n // update matrix\n function x1(Hij, theta, i, j) {\n var N = Hij.length;\n var c = Math.cos(theta);\n var s = Math.sin(theta);\n var c2 = c * c;\n var s2 = s * s;\n var Aki = Array(N).fill(0);\n var Akj = Array(N).fill(0);\n // Aii\n var Aii = c2 * Hij[i][i] - 2 * c * s * Hij[i][j] + s2 * Hij[j][j];\n var Ajj = s2 * Hij[i][i] + 2 * c * s * Hij[i][j] + c2 * Hij[j][j];\n // 0 to i\n for (var k = 0; k < N; k++) {\n Aki[k] = c * Hij[i][k] - s * Hij[j][k];\n Akj[k] = s * Hij[i][k] + c * Hij[j][k];\n }\n // Modify Hij\n Hij[i][i] = Aii;\n Hij[j][j] = Ajj;\n Hij[i][j] = 0;\n Hij[j][i] = 0;\n // 0 to i\n for (var _k4 = 0; _k4 < N; _k4++) {\n if (_k4 !== i && _k4 !== j) {\n Hij[i][_k4] = Aki[_k4];\n Hij[_k4][i] = Aki[_k4];\n Hij[j][_k4] = Akj[_k4];\n Hij[_k4][j] = Akj[_k4];\n }\n }\n return Hij;\n }\n\n // get max off-diagonal value from Upper Diagonal\n function getAij(Mij) {\n var N = Mij.length;\n var maxMij = 0;\n var maxIJ = [0, 1];\n for (var i = 0; i < N; i++) {\n for (var j = i + 1; j < N; j++) {\n if (Math.abs(maxMij) < Math.abs(Mij[i][j])) {\n maxMij = Math.abs(Mij[i][j]);\n maxIJ = [i, j];\n }\n }\n }\n return [maxIJ, maxMij];\n }\n\n // get max off-diagonal value from Upper Diagonal\n function getAijBig(Mij) {\n var N = Mij.length;\n var maxMij = 0;\n var maxIJ = [0, 1];\n for (var i = 0; i < N; i++) {\n for (var j = i + 1; j < N; j++) {\n if (abs(maxMij) < abs(Mij[i][j])) {\n maxMij = abs(Mij[i][j]);\n maxIJ = [i, j];\n }\n }\n }\n return [maxIJ, maxMij];\n }\n\n // sort results\n function sorting(E, S, computeVectors) {\n var N = E.length;\n var values = Array(N);\n var vecs;\n if (computeVectors) {\n vecs = Array(N);\n for (var k = 0; k < N; k++) {\n vecs[k] = Array(N);\n }\n }\n for (var i = 0; i < N; i++) {\n var minID = 0;\n var minE = E[0];\n for (var j = 0; j < E.length; j++) {\n if (abs(E[j]) < abs(minE)) {\n minID = j;\n minE = E[minID];\n }\n }\n values[i] = E.splice(minID, 1)[0];\n if (computeVectors) {\n for (var _k5 = 0; _k5 < N; _k5++) {\n vecs[i][_k5] = S[_k5][minID];\n S[_k5].splice(minID, 1);\n }\n }\n }\n if (!computeVectors) return {\n values\n };\n var eigenvectors = vecs.map((vector, i) => ({\n value: values[i],\n vector\n }));\n return {\n values,\n eigenvectors\n };\n }\n return main;\n}", "import { isSparseMatrix } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'expm';\nvar dependencies = ['typed', 'abs', 'add', 'identity', 'inv', 'multiply'];\nexport var createExpm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n identity,\n inv,\n multiply\n } = _ref;\n /**\n * Compute the matrix exponential, expm(A) = e^A. The matrix must be square.\n * Not to be confused with exp(a), which performs element-wise\n * exponentiation.\n *\n * The exponential is calculated using the Pad\u00E9 approximant with scaling and\n * squaring; see \"Nineteen Dubious Ways to Compute the Exponential of a\n * Matrix,\" by Moler and Van Loan.\n *\n * Syntax:\n *\n * math.expm(x)\n *\n * Examples:\n *\n * const A = [[0,2],[0,0]]\n * math.expm(A) // returns [[1,2],[0,1]]\n *\n * See also:\n *\n * exp\n *\n * @param {Matrix} x A square Matrix\n * @return {Matrix} The exponential of x\n */\n return typed(name, {\n Matrix: function Matrix(A) {\n // Check matrix size\n var size = A.size();\n if (size.length !== 2 || size[0] !== size[1]) {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n var n = size[0];\n\n // Desired accuracy of the approximant (The actual accuracy\n // will be affected by round-off error)\n var eps = 1e-15;\n\n // The Pad\u00E9 approximant is not so accurate when the values of A\n // are \"large\", so scale A by powers of two. Then compute the\n // exponential, and square the result repeatedly according to\n // the identity e^A = (e^(A/m))^m\n\n // Compute infinity-norm of A, ||A||, to see how \"big\" it is\n var infNorm = infinityNorm(A);\n\n // Find the optimal scaling factor and number of terms in the\n // Pad\u00E9 approximant to reach the desired accuracy\n var params = findParams(infNorm, eps);\n var q = params.q;\n var j = params.j;\n\n // The Pade approximation to e^A is:\n // Rqq(A) = Dqq(A) ^ -1 * Nqq(A)\n // where\n // Nqq(A) = sum(i=0, q, (2q-i)!p! / [ (2q)!i!(q-i)! ] A^i\n // Dqq(A) = sum(i=0, q, (2q-i)!q! / [ (2q)!i!(q-i)! ] (-A)^i\n\n // Scale A by 1 / 2^j\n var Apos = multiply(A, Math.pow(2, -j));\n\n // The i=0 term is just the identity matrix\n var N = identity(n);\n var D = identity(n);\n\n // Initialization (i=0)\n var factor = 1;\n\n // Initialization (i=1)\n var AposToI = Apos; // Cloning not necessary\n var alternate = -1;\n for (var i = 1; i <= q; i++) {\n if (i > 1) {\n AposToI = multiply(AposToI, Apos);\n alternate = -alternate;\n }\n factor = factor * (q - i + 1) / ((2 * q - i + 1) * i);\n N = add(N, multiply(factor, AposToI));\n D = add(D, multiply(factor * alternate, AposToI));\n }\n var R = multiply(inv(D), N);\n\n // Square j times\n for (var _i = 0; _i < j; _i++) {\n R = multiply(R, R);\n }\n return isSparseMatrix(A) ? A.createSparseMatrix(R) : R;\n }\n });\n function infinityNorm(A) {\n var n = A.size()[0];\n var infNorm = 0;\n for (var i = 0; i < n; i++) {\n var rowSum = 0;\n for (var j = 0; j < n; j++) {\n rowSum += abs(A.get([i, j]));\n }\n infNorm = Math.max(rowSum, infNorm);\n }\n return infNorm;\n }\n\n /**\n * Find the best parameters for the Pade approximant given\n * the matrix norm and desired accuracy. Returns the first acceptable\n * combination in order of increasing computational load.\n */\n function findParams(infNorm, eps) {\n var maxSearchSize = 30;\n for (var k = 0; k < maxSearchSize; k++) {\n for (var q = 0; q <= k; q++) {\n var j = k - q;\n if (errorEstimate(infNorm, q, j) < eps) {\n return {\n q,\n j\n };\n }\n }\n }\n throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)');\n }\n\n /**\n * Returns the estimated error of the Pade approximant for the given\n * parameters.\n */\n function errorEstimate(infNorm, q, j) {\n var qfac = 1;\n for (var i = 2; i <= q; i++) {\n qfac *= i;\n }\n var twoqfac = qfac;\n for (var _i2 = q + 1; _i2 <= 2 * q; _i2++) {\n twoqfac *= _i2;\n }\n var twoqp1fac = twoqfac * (2 * q + 1);\n return 8.0 * Math.pow(infNorm / Math.pow(2, j), 2 * q) * qfac * qfac / (twoqfac * twoqp1fac);\n }\n});", "import { isMatrix } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'sqrtm';\nvar dependencies = ['typed', 'abs', 'add', 'multiply', 'map', 'sqrt', 'subtract', 'inv', 'size', 'max', 'identity'];\nexport var createSqrtm = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n add,\n multiply,\n map,\n sqrt,\n subtract,\n inv,\n size,\n max,\n identity\n } = _ref;\n var _maxIterations = 1e3;\n var _tolerance = 1e-6;\n\n /**\n * Calculate the principal square root matrix using the Denman\u2013Beavers iterative method\n *\n * https://en.wikipedia.org/wiki/Square_root_of_a_matrix#By_Denman\u2013Beavers_iteration\n *\n * @param {Array | Matrix} A The square matrix `A`\n * @return {Array | Matrix} The principal square root of matrix `A`\n * @private\n */\n function _denmanBeavers(A) {\n var error;\n var iterations = 0;\n var Y = A;\n var Z = identity(size(A));\n do {\n var Yk = Y;\n Y = multiply(0.5, add(Yk, inv(Z)));\n Z = multiply(0.5, add(Z, inv(Yk)));\n error = max(abs(subtract(Y, Yk)));\n if (error > _tolerance && ++iterations > _maxIterations) {\n throw new Error('computing square root of matrix: iterative method could not converge');\n }\n } while (error > _tolerance);\n return Y;\n }\n\n /**\n * Calculate the principal square root of a square matrix.\n * The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.\n *\n * https://en.wikipedia.org/wiki/Square_root_of_a_matrix\n *\n * Syntax:\n *\n * math.sqrtm(A)\n *\n * Examples:\n *\n * math.sqrtm([[33, 24], [48, 57]]) // returns [[5, 2], [4, 7]]\n *\n * See also:\n *\n * sqrt, pow\n *\n * @param {Array | Matrix} A The square matrix `A`\n * @return {Array | Matrix} The principal square root of matrix `A`\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(A) {\n var size = isMatrix(A) ? A.size() : arraySize(A);\n switch (size.length) {\n case 1:\n // Single element Array | Matrix\n if (size[0] === 1) {\n return map(A, sqrt);\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n case 2:\n {\n // Two-dimensional Array | Matrix\n var rows = size[0];\n var cols = size[1];\n if (rows === cols) {\n return _denmanBeavers(A);\n } else {\n throw new RangeError('Matrix must be square ' + '(size: ' + format(size) + ')');\n }\n }\n default:\n // Multi dimensional array\n throw new RangeError('Matrix must be at most two dimensional ' + '(size: ' + format(size) + ')');\n }\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'sylvester';\nvar dependencies = ['typed', 'schur', 'matrixFromColumns', 'matrix', 'multiply', 'range', 'concat', 'transpose', 'index', 'subset', 'add', 'subtract', 'identity', 'lusolve', 'abs'];\nexport var createSylvester = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n schur,\n matrixFromColumns,\n matrix,\n multiply,\n range,\n concat,\n transpose,\n index,\n subset,\n add,\n subtract,\n identity,\n lusolve,\n abs\n } = _ref;\n /**\n *\n * Solves the real-valued Sylvester equation AX+XB=C for X, where A, B and C are\n * matrices of appropriate dimensions, being A and B squared. Notice that other\n * equivalent definitions for the Sylvester equation exist and this function\n * assumes the one presented in the original publication of the the Bartels-\n * Stewart algorithm, which is implemented by this function.\n * https://en.wikipedia.org/wiki/Sylvester_equation\n *\n * Syntax:\n *\n * math.sylvester(A, B, C)\n *\n * Examples:\n *\n * const A = [[-1, -2], [1, 1]]\n * const B = [[2, -1], [1, -2]]\n * const C = [[-3, 2], [3, 0]]\n * math.sylvester(A, B, C) // returns DenseMatrix [[-0.25, 0.25], [1.5, -1.25]]\n *\n * See also:\n *\n * schur, lyap\n *\n * @param {Matrix | Array} A Matrix A\n * @param {Matrix | Array} B Matrix B\n * @param {Matrix | Array} C Matrix C\n * @return {Matrix | Array} Matrix X, solving the Sylvester equation\n */\n return typed(name, {\n 'Matrix, Matrix, Matrix': _sylvester,\n 'Array, Matrix, Matrix': function ArrayMatrixMatrix(A, B, C) {\n return _sylvester(matrix(A), B, C);\n },\n 'Array, Array, Matrix': function ArrayArrayMatrix(A, B, C) {\n return _sylvester(matrix(A), matrix(B), C);\n },\n 'Array, Matrix, Array': function ArrayMatrixArray(A, B, C) {\n return _sylvester(matrix(A), B, matrix(C));\n },\n 'Matrix, Array, Matrix': function MatrixArrayMatrix(A, B, C) {\n return _sylvester(A, matrix(B), C);\n },\n 'Matrix, Array, Array': function MatrixArrayArray(A, B, C) {\n return _sylvester(A, matrix(B), matrix(C));\n },\n 'Matrix, Matrix, Array': function MatrixMatrixArray(A, B, C) {\n return _sylvester(A, B, matrix(C));\n },\n 'Array, Array, Array': function ArrayArrayArray(A, B, C) {\n return _sylvester(matrix(A), matrix(B), matrix(C)).toArray();\n }\n });\n function _sylvester(A, B, C) {\n var n = B.size()[0];\n var m = A.size()[0];\n var sA = schur(A);\n var F = sA.T;\n var U = sA.U;\n var sB = schur(multiply(-1, B));\n var G = sB.T;\n var V = sB.U;\n var D = multiply(multiply(transpose(U), C), V);\n var all = range(0, m);\n var y = [];\n var hc = (a, b) => concat(a, b, 1);\n var vc = (a, b) => concat(a, b, 0);\n for (var k = 0; k < n; k++) {\n if (k < n - 1 && abs(subset(G, index(k + 1, k))) > 1e-5) {\n var RHS = vc(subset(D, index(all, k)), subset(D, index(all, k + 1)));\n for (var j = 0; j < k; j++) {\n RHS = add(RHS, vc(multiply(y[j], subset(G, index(j, k))), multiply(y[j], subset(G, index(j, k + 1)))));\n }\n var gkk = multiply(identity(m), multiply(-1, subset(G, index(k, k))));\n var gmk = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k))));\n var gkm = multiply(identity(m), multiply(-1, subset(G, index(k, k + 1))));\n var gmm = multiply(identity(m), multiply(-1, subset(G, index(k + 1, k + 1))));\n var LHS = vc(hc(add(F, gkk), gmk), hc(gkm, add(F, gmm)));\n var yAux = lusolve(LHS, RHS);\n y[k] = yAux.subset(index(range(0, m), 0));\n y[k + 1] = yAux.subset(index(range(m, 2 * m), 0));\n k++;\n } else {\n var _RHS = subset(D, index(all, k));\n for (var _j = 0; _j < k; _j++) {\n _RHS = add(_RHS, multiply(y[_j], subset(G, index(_j, k))));\n }\n var _gkk = subset(G, index(k, k));\n var _LHS = subtract(F, multiply(_gkk, identity(m)));\n y[k] = lusolve(_LHS, _RHS);\n }\n }\n var Y = matrix(matrixFromColumns(...y));\n var X = multiply(U, multiply(Y, transpose(V)));\n return X;\n }\n});", "import { factory } from '../../../utils/factory.js';\nvar name = 'schur';\nvar dependencies = ['typed', 'matrix', 'identity', 'multiply', 'qr', 'norm', 'subtract'];\nexport var createSchur = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n identity,\n multiply,\n qr,\n norm,\n subtract\n } = _ref;\n /**\n *\n * Performs a real Schur decomposition of the real matrix A = UTU' where U is orthogonal\n * and T is upper quasi-triangular.\n * https://en.wikipedia.org/wiki/Schur_decomposition\n *\n * Syntax:\n *\n * math.schur(A)\n *\n * Examples:\n *\n * const A = [[1, 0], [-4, 3]]\n * math.schur(A) // returns {T: [[3, 4], [0, 1]], R: [[0, 1], [-1, 0]]}\n *\n * See also:\n *\n * sylvester, lyap, qr\n *\n * @param {Array | Matrix} A Matrix A\n * @return {{U: Array | Matrix, T: Array | Matrix}} Object containing both matrix U and T of the Schur Decomposition A=UTU'\n */\n return typed(name, {\n Array: function Array(X) {\n var r = _schur(matrix(X));\n return {\n U: r.U.valueOf(),\n T: r.T.valueOf()\n };\n },\n Matrix: function Matrix(X) {\n return _schur(X);\n }\n });\n function _schur(X) {\n var n = X.size()[0];\n var A = X;\n var U = identity(n);\n var k = 0;\n var A0;\n do {\n A0 = A;\n var QR = qr(A);\n var Q = QR.Q;\n var R = QR.R;\n A = multiply(R, Q);\n U = multiply(U, Q);\n if (k++ > 100) {\n break;\n }\n } while (norm(subtract(A, A0)) > 1e-4);\n return {\n U,\n T: A\n };\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'lyap';\nvar dependencies = ['typed', 'matrix', 'sylvester', 'multiply', 'transpose'];\nexport var createLyap = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n sylvester,\n multiply,\n transpose\n } = _ref;\n /**\n *\n * Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P, where\n * Q is an input matrix. When Q is symmetric, P is also symmetric. Notice\n * that different equivalent definitions exist for the Continuous-time\n * Lyapunov equation.\n * https://en.wikipedia.org/wiki/Lyapunov_equation\n *\n * Syntax:\n *\n * math.lyap(A, Q)\n *\n * Examples:\n *\n * const A = [[-2, 0], [1, -4]]\n * const Q = [[3, 1], [1, 3]]\n * const P = math.lyap(A, Q)\n *\n * See also:\n *\n * sylvester, schur\n *\n * @param {Matrix | Array} A Matrix A\n * @param {Matrix | Array} Q Matrix Q\n * @return {Matrix | Array} Matrix P solution to the Continuous-time Lyapunov equation AP+PA'=Q\n */\n return typed(name, {\n 'Matrix, Matrix': function MatrixMatrix(A, Q) {\n return sylvester(A, transpose(A), multiply(-1, Q));\n },\n 'Array, Matrix': function ArrayMatrix(A, Q) {\n return sylvester(matrix(A), transpose(matrix(A)), multiply(-1, Q));\n },\n 'Matrix, Array': function MatrixArray(A, Q) {\n return sylvester(A, transpose(matrix(A)), matrix(multiply(-1, Q)));\n },\n 'Array, Array': function ArrayArray(A, Q) {\n return sylvester(matrix(A), transpose(matrix(A)), matrix(multiply(-1, Q))).toArray();\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nimport { extend } from '../../utils/object.js';\nimport { createMatAlgo11xS0s } from '../../type/matrix/utils/matAlgo11xS0s.js';\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js';\nvar name = 'divide';\nvar dependencies = ['typed', 'matrix', 'multiply', 'equalScalar', 'divideScalar', 'inv'];\nexport var createDivide = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n multiply,\n equalScalar,\n divideScalar,\n inv\n } = _ref;\n var matAlgo11xS0s = createMatAlgo11xS0s({\n typed,\n equalScalar\n });\n var matAlgo14xDs = createMatAlgo14xDs({\n typed\n });\n\n /**\n * Divide two values, `x / y`.\n * To divide matrices, `x` is multiplied with the inverse of `y`: `x * inv(y)`.\n *\n * Syntax:\n *\n * math.divide(x, y)\n *\n * Examples:\n *\n * math.divide(2, 3) // returns number 0.6666666666666666\n *\n * const a = math.complex(5, 14)\n * const b = math.complex(4, 1)\n * math.divide(a, b) // returns Complex 2 + 3i\n *\n * const c = [[7, -6], [13, -4]]\n * const d = [[1, 2], [4, 3]]\n * math.divide(c, d) // returns Array [[-9, 4], [-11, 6]]\n *\n * const e = math.unit('18 km')\n * math.divide(e, 4.5) // returns Unit 4 km\n *\n * See also:\n *\n * multiply\n *\n * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x Numerator\n * @param {number | BigNumber | bigint | Fraction | Complex | Array | Matrix} y Denominator\n * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Quotient, `x / y`\n */\n return typed('divide', extend({\n // we extend the signatures of divideScalar with signatures dealing with matrices\n\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(x, y) {\n // TODO: implement matrix right division using pseudo inverse\n // https://www.mathworks.nl/help/matlab/ref/mrdivide.html\n // https://www.gnu.org/software/octave/doc/interpreter/Arithmetic-Ops.html\n // https://stackoverflow.com/questions/12263932/how-does-gnu-octave-matrix-division-work-getting-unexpected-behaviour\n return multiply(x, inv(y));\n },\n 'DenseMatrix, any': function DenseMatrixAny(x, y) {\n return matAlgo14xDs(x, y, divideScalar, false);\n },\n 'SparseMatrix, any': function SparseMatrixAny(x, y) {\n return matAlgo11xS0s(x, y, divideScalar, false);\n },\n 'Array, any': function ArrayAny(x, y) {\n // use matrix implementation\n return matAlgo14xDs(matrix(x), y, divideScalar, false).valueOf();\n },\n 'any, Array | Matrix': function anyArrayMatrix(x, y) {\n return multiply(x, inv(y));\n }\n }, divideScalar.signatures));\n});", "import { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'distance';\nvar dependencies = ['typed', 'addScalar', 'subtractScalar', 'divideScalar', 'multiplyScalar', 'deepEqual', 'sqrt', 'abs'];\nexport var createDistance = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n deepEqual,\n sqrt,\n abs\n } = _ref;\n /**\n * Calculates:\n * The eucledian distance between two points in N-dimensional spaces.\n * Distance between point and a line in 2 and 3 dimensional spaces.\n * Pairwise distance between a set of 2D or 3D points\n * NOTE:\n * When substituting coefficients of a line(a, b and c), use ax + by + c = 0 instead of ax + by = c\n * For parametric equation of a 3D line, x0, y0, z0, a, b, c are from: (x\u2212x0, y\u2212y0, z\u2212z0) = t(a, b, c)\n *\n * Syntax:\n *\n * math.distance([x1,y1], [x2,y2])\n * math.distance({pointOneX, pointOneY}, {pointTwoX, pointTwoY})\n * math.distance([x1,y1,z1], [x2,y2,z2])\n * math.distance({pointOneX, pointOneY, pointOneZ}, {pointTwoX, pointTwoY, pointTwoZ})\n * math.distance([x1,y1,z1,a1], [x2,y2,z2,a2])\n * math.distance([[x1,y1], [x2,y2], [x3,y3]])\n * math.distance([[x1,y1,z1], [x2,y2,z2], [x3,y3,z3]])\n * math.distance([pointX,pointY], [a,b,c])\n * math.distance([pointX,pointY], [lineOnePtX,lineOnePtY], [lineTwoPtX,lineTwoPtY])\n * math.distance({pointX, pointY}, {lineOnePtX, lineOnePtY}, {lineTwoPtX, lineTwoPtY})\n * math.distance([pointX,pointY,pointZ], [x0, y0, z0, a, b, c])\n * math.distance({pointX, pointY, pointZ}, {x0, y0, z0, a, b, c})\n *\n * Examples:\n * math.distance([0,0], [4,4]) // Returns 5.656854249492381\n * math.distance(\n * {pointOneX: 0, pointOneY: 0},\n * {pointTwoX: 10, pointTwoY: 10}) // Returns 14.142135623730951\n * math.distance([1, 0, 1], [4, -2, 2]) // Returns 3.7416573867739413\n * math.distance(\n * {pointOneX: 4, pointOneY: 5, pointOneZ: 8},\n * {pointTwoX: 2, pointTwoY: 7, pointTwoZ: 9}) // Returns 3\n * math.distance([1, 0, 1, 0], [0, -1, 0, -1]) // Returns 2\n * math.distance([[1, 2], [1, 2], [1, 3]]) // Returns [0, 1, 1]\n * math.distance([[1,2,4], [1,2,6], [8,1,3]]) // Returns [2, 7.14142842854285, 7.681145747868608]\n * math.distance([10, 10], [8, 1, 3]) // Returns 11.535230316796387\n * math.distance([0, 0], [3, 0], [0, 4]) // Returns 2.4\n * math.distance(\n * {pointX: 0, pointY: 0},\n * {lineOnePtX: 3, lineOnePtY: 0},\n * {lineTwoPtX: 0, lineTwoPtY: 4}) // Returns 2.4\n * math.distance([2, 3, 1], [1, 1, 2, 5, 0, 1]) // Returns 2.3204774044612857\n * math.distance(\n * {pointX: 2, pointY: 3, pointZ: 1},\n * {x0: 1, y0: 1, z0: 2, a: 5, b: 0, c: 1}) // Returns 2.3204774044612857\n *\n * @param {Array | Matrix | Object} x Co-ordinates of first point\n * @param {Array | Matrix | Object} y Co-ordinates of second point\n * @return {Number | BigNumber} Returns the distance from two/three points\n */\n return typed(name, {\n 'Array, Array, Array': function ArrayArrayArray(x, y, z) {\n // Point to Line 2D (x=Point, y=LinePoint1, z=LinePoint2)\n if (x.length === 2 && y.length === 2 && z.length === 2) {\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_2d(y)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument');\n }\n if (!_2d(z)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument');\n }\n if (deepEqual(y, z)) {\n throw new TypeError('LinePoint1 should not be same with LinePoint2');\n }\n var xCoeff = subtractScalar(z[1], y[1]);\n var yCoeff = subtractScalar(y[0], z[0]);\n var constant = subtractScalar(multiplyScalar(z[0], y[1]), multiplyScalar(y[0], z[1]));\n return _distancePointLine2D(x[0], x[1], xCoeff, yCoeff, constant);\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Object, Object, Object': function ObjectObjectObject(x, y, z) {\n if (Object.keys(x).length === 2 && Object.keys(y).length === 2 && Object.keys(z).length === 2) {\n if (!_2d(x)) {\n throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers');\n }\n if (!_2d(y)) {\n throw new TypeError('Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers');\n }\n if (!_2d(z)) {\n throw new TypeError('Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers');\n }\n if (deepEqual(_objectToArray(y), _objectToArray(z))) {\n throw new TypeError('LinePoint1 should not be same with LinePoint2');\n }\n if ('pointX' in x && 'pointY' in x && 'lineOnePtX' in y && 'lineOnePtY' in y && 'lineTwoPtX' in z && 'lineTwoPtY' in z) {\n var xCoeff = subtractScalar(z.lineTwoPtY, y.lineOnePtY);\n var yCoeff = subtractScalar(y.lineOnePtX, z.lineTwoPtX);\n var constant = subtractScalar(multiplyScalar(z.lineTwoPtX, y.lineOnePtY), multiplyScalar(y.lineOnePtX, z.lineTwoPtY));\n return _distancePointLine2D(x.pointX, x.pointY, xCoeff, yCoeff, constant);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Array, Array': function ArrayArray(x, y) {\n // Point to Line 2D (x=[pointX, pointY], y=[x-coeff, y-coeff, const])\n if (x.length === 2 && y.length === 3) {\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n return _distancePointLine2D(x[0], x[1], y[0], y[1], y[2]);\n } else if (x.length === 3 && y.length === 6) {\n // Point to Line 3D\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_parametricLine(y)) {\n throw new TypeError('Array with 6 numbers or BigNumbers expected for second argument');\n }\n return _distancePointLine3D(x[0], x[1], x[2], y[0], y[1], y[2], y[3], y[4], y[5]);\n } else if (x.length === y.length && x.length > 0) {\n // Point to Point N-dimensions\n if (!_containsOnlyNumbers(x)) {\n throw new TypeError('All values of an array should be numbers or BigNumbers');\n }\n if (!_containsOnlyNumbers(y)) {\n throw new TypeError('All values of an array should be numbers or BigNumbers');\n }\n return _euclideanDistance(x, y);\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n 'Object, Object': function ObjectObject(x, y) {\n if (Object.keys(x).length === 2 && Object.keys(y).length === 3) {\n if (!_2d(x)) {\n throw new TypeError('Values of pointX and pointY should be numbers or BigNumbers');\n }\n if (!_3d(y)) {\n throw new TypeError('Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers');\n }\n if ('pointX' in x && 'pointY' in x && 'xCoeffLine' in y && 'yCoeffLine' in y && 'constant' in y) {\n return _distancePointLine2D(x.pointX, x.pointY, y.xCoeffLine, y.yCoeffLine, y.constant);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 3 && Object.keys(y).length === 6) {\n // Point to Line 3D\n if (!_3d(x)) {\n throw new TypeError('Values of pointX, pointY and pointZ should be numbers or BigNumbers');\n }\n if (!_parametricLine(y)) {\n throw new TypeError('Values of x0, y0, z0, a, b and c should be numbers or BigNumbers');\n }\n if ('pointX' in x && 'pointY' in x && 'x0' in y && 'y0' in y && 'z0' in y && 'a' in y && 'b' in y && 'c' in y) {\n return _distancePointLine3D(x.pointX, x.pointY, x.pointZ, y.x0, y.y0, y.z0, y.a, y.b, y.c);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 2 && Object.keys(y).length === 2) {\n // Point to Point 2D\n if (!_2d(x)) {\n throw new TypeError('Values of pointOneX and pointOneY should be numbers or BigNumbers');\n }\n if (!_2d(y)) {\n throw new TypeError('Values of pointTwoX and pointTwoY should be numbers or BigNumbers');\n }\n if ('pointOneX' in x && 'pointOneY' in x && 'pointTwoX' in y && 'pointTwoY' in y) {\n return _euclideanDistance([x.pointOneX, x.pointOneY], [y.pointTwoX, y.pointTwoY]);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else if (Object.keys(x).length === 3 && Object.keys(y).length === 3) {\n // Point to Point 3D\n if (!_3d(x)) {\n throw new TypeError('Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers');\n }\n if (!_3d(y)) {\n throw new TypeError('Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers');\n }\n if ('pointOneX' in x && 'pointOneY' in x && 'pointOneZ' in x && 'pointTwoX' in y && 'pointTwoY' in y && 'pointTwoZ' in y) {\n return _euclideanDistance([x.pointOneX, x.pointOneY, x.pointOneZ], [y.pointTwoX, y.pointTwoY, y.pointTwoZ]);\n } else {\n throw new TypeError('Key names do not match');\n }\n } else {\n throw new TypeError('Invalid Arguments: Try again');\n }\n },\n Array: function Array(arr) {\n if (!_pairwise(arr)) {\n throw new TypeError('Incorrect array format entered for pairwise distance calculation');\n }\n return _distancePairwise(arr);\n }\n });\n function _isNumber(a) {\n // distance supports numbers and bignumbers\n return typeof a === 'number' || isBigNumber(a);\n }\n function _2d(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]);\n }\n function _3d(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]);\n }\n function _containsOnlyNumbers(a) {\n // checks if the number of arguments are correct in count and are valid (should be numbers)\n if (!Array.isArray(a)) {\n a = _objectToArray(a);\n }\n return a.every(_isNumber);\n }\n function _parametricLine(a) {\n if (a.constructor !== Array) {\n a = _objectToArray(a);\n }\n return _isNumber(a[0]) && _isNumber(a[1]) && _isNumber(a[2]) && _isNumber(a[3]) && _isNumber(a[4]) && _isNumber(a[5]);\n }\n function _objectToArray(o) {\n var keys = Object.keys(o);\n var a = [];\n for (var i = 0; i < keys.length; i++) {\n a.push(o[keys[i]]);\n }\n return a;\n }\n function _pairwise(a) {\n // checks for valid arguments passed to _distancePairwise(Array)\n if (a[0].length === 2 && _isNumber(a[0][0]) && _isNumber(a[0][1])) {\n if (a.some(aI => aI.length !== 2 || !_isNumber(aI[0]) || !_isNumber(aI[1]))) {\n return false;\n }\n } else if (a[0].length === 3 && _isNumber(a[0][0]) && _isNumber(a[0][1]) && _isNumber(a[0][2])) {\n if (a.some(aI => aI.length !== 3 || !_isNumber(aI[0]) || !_isNumber(aI[1]) || !_isNumber(aI[2]))) {\n return false;\n }\n } else {\n return false;\n }\n return true;\n }\n function _distancePointLine2D(x, y, a, b, c) {\n var num = abs(addScalar(addScalar(multiplyScalar(a, x), multiplyScalar(b, y)), c));\n var den = sqrt(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)));\n return divideScalar(num, den);\n }\n function _distancePointLine3D(x, y, z, x0, y0, z0, a, b, c) {\n var num = [subtractScalar(multiplyScalar(subtractScalar(y0, y), c), multiplyScalar(subtractScalar(z0, z), b)), subtractScalar(multiplyScalar(subtractScalar(z0, z), a), multiplyScalar(subtractScalar(x0, x), c)), subtractScalar(multiplyScalar(subtractScalar(x0, x), b), multiplyScalar(subtractScalar(y0, y), a))];\n num = sqrt(addScalar(addScalar(multiplyScalar(num[0], num[0]), multiplyScalar(num[1], num[1])), multiplyScalar(num[2], num[2])));\n var den = sqrt(addScalar(addScalar(multiplyScalar(a, a), multiplyScalar(b, b)), multiplyScalar(c, c)));\n return divideScalar(num, den);\n }\n function _euclideanDistance(x, y) {\n var vectorSize = x.length;\n var result = 0;\n var diff = 0;\n for (var i = 0; i < vectorSize; i++) {\n diff = subtractScalar(x[i], y[i]);\n result = addScalar(multiplyScalar(diff, diff), result);\n }\n return sqrt(result);\n }\n function _distancePairwise(a) {\n var result = [];\n var pointA = [];\n var pointB = [];\n for (var i = 0; i < a.length - 1; i++) {\n for (var j = i + 1; j < a.length; j++) {\n if (a[0].length === 2) {\n pointA = [a[i][0], a[i][1]];\n pointB = [a[j][0], a[j][1]];\n } else if (a[0].length === 3) {\n pointA = [a[i][0], a[i][1], a[i][2]];\n pointB = [a[j][0], a[j][1], a[j][2]];\n }\n result.push(_euclideanDistance(pointA, pointB));\n }\n }\n return result;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'intersect';\nvar dependencies = ['typed', 'config', 'abs', 'add', 'addScalar', 'matrix', 'multiply', 'multiplyScalar', 'divideScalar', 'subtract', 'smaller', 'equalScalar', 'flatten', 'isZero', 'isNumeric'];\nexport var createIntersect = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n abs,\n add,\n addScalar,\n matrix,\n multiply,\n multiplyScalar,\n divideScalar,\n subtract,\n smaller,\n equalScalar,\n flatten,\n isZero,\n isNumeric\n } = _ref;\n /**\n * Calculates the point of intersection of two lines in two or three dimensions\n * and of a line and a plane in three dimensions. The inputs are in the form of\n * arrays or 1 dimensional matrices. The line intersection functions return null\n * if the lines do not meet.\n *\n * Note: Fill the plane coefficients as `x + y + z = c` and not as `x + y + z + c = 0`.\n *\n * Syntax:\n *\n * math.intersect(endPoint1Line1, endPoint2Line1, endPoint1Line2, endPoint2Line2)\n * math.intersect(endPoint1, endPoint2, planeCoefficients)\n *\n * Examples:\n *\n * math.intersect([0, 0], [10, 10], [10, 0], [0, 10]) // Returns [5, 5]\n * math.intersect([0, 0, 0], [10, 10, 0], [10, 0, 0], [0, 10, 0]) // Returns [5, 5, 0]\n * math.intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6]) // Returns [7, -4, 3]\n *\n * @param {Array | Matrix} w Co-ordinates of first end-point of first line\n * @param {Array | Matrix} x Co-ordinates of second end-point of first line\n * @param {Array | Matrix} y Co-ordinates of first end-point of second line\n * OR Co-efficients of the plane's equation\n * @param {Array | Matrix} z Co-ordinates of second end-point of second line\n * OR undefined if the calculation is for line and plane\n * @return {Array} Returns the point of intersection of lines/lines-planes\n */\n return typed('intersect', {\n 'Array, Array, Array': _AAA,\n 'Array, Array, Array, Array': _AAAA,\n 'Matrix, Matrix, Matrix': function MatrixMatrixMatrix(x, y, plane) {\n var arr = _AAA(x.valueOf(), y.valueOf(), plane.valueOf());\n return arr === null ? null : matrix(arr);\n },\n 'Matrix, Matrix, Matrix, Matrix': function MatrixMatrixMatrixMatrix(w, x, y, z) {\n // TODO: output matrix type should match input matrix type\n var arr = _AAAA(w.valueOf(), x.valueOf(), y.valueOf(), z.valueOf());\n return arr === null ? null : matrix(arr);\n }\n });\n function _AAA(x, y, plane) {\n x = _coerceArr(x);\n y = _coerceArr(y);\n plane = _coerceArr(plane);\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n if (!_4d(plane)) {\n throw new TypeError('Array with 4 numbers expected as third argument');\n }\n return _intersectLinePlane(x[0], x[1], x[2], y[0], y[1], y[2], plane[0], plane[1], plane[2], plane[3]);\n }\n function _AAAA(w, x, y, z) {\n w = _coerceArr(w);\n x = _coerceArr(x);\n y = _coerceArr(y);\n z = _coerceArr(z);\n if (w.length === 2) {\n if (!_2d(w)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for first argument');\n }\n if (!_2d(x)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for second argument');\n }\n if (!_2d(y)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for third argument');\n }\n if (!_2d(z)) {\n throw new TypeError('Array with 2 numbers or BigNumbers expected for fourth argument');\n }\n return _intersect2d(w, x, y, z);\n } else if (w.length === 3) {\n if (!_3d(w)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for first argument');\n }\n if (!_3d(x)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for second argument');\n }\n if (!_3d(y)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for third argument');\n }\n if (!_3d(z)) {\n throw new TypeError('Array with 3 numbers or BigNumbers expected for fourth argument');\n }\n return _intersect3d(w[0], w[1], w[2], x[0], x[1], x[2], y[0], y[1], y[2], z[0], z[1], z[2]);\n } else {\n throw new TypeError('Arrays with two or thee dimensional points expected');\n }\n }\n\n /** Coerce row and column 2-dim arrays to 1-dim array */\n function _coerceArr(arr) {\n // row matrix\n if (arr.length === 1) return arr[0];\n\n // column matrix\n if (arr.length > 1 && Array.isArray(arr[0])) {\n if (arr.every(el => Array.isArray(el) && el.length === 1)) return flatten(arr);\n }\n return arr;\n }\n function _2d(x) {\n return x.length === 2 && isNumeric(x[0]) && isNumeric(x[1]);\n }\n function _3d(x) {\n return x.length === 3 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]);\n }\n function _4d(x) {\n return x.length === 4 && isNumeric(x[0]) && isNumeric(x[1]) && isNumeric(x[2]) && isNumeric(x[3]);\n }\n function _intersect2d(p1a, p1b, p2a, p2b) {\n var o1 = p1a;\n var o2 = p2a;\n var d1 = subtract(o1, p1b);\n var d2 = subtract(o2, p2b);\n var det = subtract(multiplyScalar(d1[0], d2[1]), multiplyScalar(d2[0], d1[1]));\n if (isZero(det)) return null;\n if (smaller(abs(det), config.relTol)) {\n return null;\n }\n var d20o11 = multiplyScalar(d2[0], o1[1]);\n var d21o10 = multiplyScalar(d2[1], o1[0]);\n var d20o21 = multiplyScalar(d2[0], o2[1]);\n var d21o20 = multiplyScalar(d2[1], o2[0]);\n var t = divideScalar(addScalar(subtract(subtract(d20o11, d21o10), d20o21), d21o20), det);\n return add(multiply(d1, t), o1);\n }\n function _intersect3dHelper(a, b, c, d, e, f, g, h, i, j, k, l) {\n // (a - b)*(c - d) + (e - f)*(g - h) + (i - j)*(k - l)\n var add1 = multiplyScalar(subtract(a, b), subtract(c, d));\n var add2 = multiplyScalar(subtract(e, f), subtract(g, h));\n var add3 = multiplyScalar(subtract(i, j), subtract(k, l));\n return addScalar(addScalar(add1, add2), add3);\n }\n function _intersect3d(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4) {\n var d1343 = _intersect3dHelper(x1, x3, x4, x3, y1, y3, y4, y3, z1, z3, z4, z3);\n var d4321 = _intersect3dHelper(x4, x3, x2, x1, y4, y3, y2, y1, z4, z3, z2, z1);\n var d1321 = _intersect3dHelper(x1, x3, x2, x1, y1, y3, y2, y1, z1, z3, z2, z1);\n var d4343 = _intersect3dHelper(x4, x3, x4, x3, y4, y3, y4, y3, z4, z3, z4, z3);\n var d2121 = _intersect3dHelper(x2, x1, x2, x1, y2, y1, y2, y1, z2, z1, z2, z1);\n var numerator = subtract(multiplyScalar(d1343, d4321), multiplyScalar(d1321, d4343));\n var denominator = subtract(multiplyScalar(d2121, d4343), multiplyScalar(d4321, d4321));\n if (isZero(denominator)) return null;\n var ta = divideScalar(numerator, denominator);\n var tb = divideScalar(addScalar(d1343, multiplyScalar(ta, d4321)), d4343);\n var pax = addScalar(x1, multiplyScalar(ta, subtract(x2, x1)));\n var pay = addScalar(y1, multiplyScalar(ta, subtract(y2, y1)));\n var paz = addScalar(z1, multiplyScalar(ta, subtract(z2, z1)));\n var pbx = addScalar(x3, multiplyScalar(tb, subtract(x4, x3)));\n var pby = addScalar(y3, multiplyScalar(tb, subtract(y4, y3)));\n var pbz = addScalar(z3, multiplyScalar(tb, subtract(z4, z3)));\n if (equalScalar(pax, pbx) && equalScalar(pay, pby) && equalScalar(paz, pbz)) {\n return [pax, pay, paz];\n } else {\n return null;\n }\n }\n function _intersectLinePlane(x1, y1, z1, x2, y2, z2, x, y, z, c) {\n var x1x = multiplyScalar(x1, x);\n var x2x = multiplyScalar(x2, x);\n var y1y = multiplyScalar(y1, y);\n var y2y = multiplyScalar(y2, y);\n var z1z = multiplyScalar(z1, z);\n var z2z = multiplyScalar(z2, z);\n var numerator = subtract(subtract(subtract(c, x1x), y1y), z1z);\n var denominator = subtract(subtract(subtract(addScalar(addScalar(x2x, y2y), z2z), x1x), y1y), z1z);\n var t = divideScalar(numerator, denominator);\n var px = addScalar(x1, multiplyScalar(t, subtract(x2, x1)));\n var py = addScalar(y1, multiplyScalar(t, subtract(y2, y1)));\n var pz = addScalar(z1, multiplyScalar(t, subtract(z2, z1)));\n return [px, py, pz];\n // TODO: Add cases when line is parallel to the plane:\n // (a) no intersection,\n // (b) line contained in plane\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'sum';\nvar dependencies = ['typed', 'config', 'add', 'numeric'];\nexport var createSum = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n add,\n numeric\n } = _ref;\n /**\n * Compute the sum of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the sum of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.sum(a, b, c, ...)\n * math.sum(A)\n * math.sum(A, dimension)\n *\n * Examples:\n *\n * math.sum(2, 1, 4, 3) // returns 10\n * math.sum([2, 1, 4, 3]) // returns 10\n * math.sum([[2, 5], [4, 3], [1, 7]]) // returns 22\n *\n * See also:\n *\n * mean, median, min, max, prod, std, variance, cumsum\n *\n * @param {... *} args A single matrix or multiple scalar values\n * @return {*} The sum of all values\n */\n return typed(name, {\n // sum([a, b, c, d, ...])\n 'Array | Matrix': _sum,\n // sum([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': _nsumDim,\n // sum(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function sum');\n }\n return _sum(args);\n }\n });\n\n /**\n * Recursively calculate the sum of an n-dimensional array\n * @param {Array | Matrix} array\n * @return {number} sum\n * @private\n */\n function _sum(array) {\n var sum;\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n } catch (err) {\n throw improveErrorMessage(err, 'sum', value);\n }\n });\n\n // make sure returning numeric value: parse a string into a numeric value\n if (sum === undefined) {\n sum = numeric(0, config.number);\n }\n if (typeof sum === 'string') {\n sum = numeric(sum, safeNumberType(sum, config));\n }\n return sum;\n }\n function _nsumDim(array, dim) {\n try {\n var sum = reduce(array, dim, add);\n return sum;\n } catch (err) {\n throw improveErrorMessage(err, 'sum');\n }\n }\n});", "import { containsCollections } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { _switch } from '../../utils/switch.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nimport { arraySize } from '../../utils/array.js';\nimport { IndexError } from '../../error/IndexError.js';\nvar name = 'cumsum';\nvar dependencies = ['typed', 'add', 'unaryPlus'];\nexport var createCumSum = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n unaryPlus\n } = _ref;\n /**\n * Compute the cumulative sum of a matrix or a list with values.\n * In case of a (multi dimensional) array or matrix, the cumulative sums\n * along a specified dimension (defaulting to the first) will be calculated.\n *\n * Syntax:\n *\n * math.cumsum(a, b, c, ...)\n * math.cumsum(A)\n *\n * Examples:\n *\n * math.cumsum(2, 1, 4, 3) // returns [2, 3, 7, 10]\n * math.cumsum([2, 1, 4, 3]) // returns [2, 3, 7, 10]\n * math.cumsum([[1, 2], [3, 4]]) // returns [[1, 2], [4, 6]]\n * math.cumsum([[1, 2], [3, 4]], 0) // returns [[1, 2], [4, 6]]\n * math.cumsum([[1, 2], [3, 4]], 1) // returns [[1, 3], [3, 7]]\n * math.cumsum([[2, 5], [4, 3], [1, 7]]) // returns [[2, 5], [6, 8], [7, 15]]\n *\n * See also:\n *\n * mean, median, min, max, prod, std, variance, sum\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The cumulative sum of all values\n */\n return typed(name, {\n // sum([a, b, c, d, ...])\n Array: _cumsum,\n Matrix: function Matrix(matrix) {\n return matrix.create(_cumsum(matrix.valueOf()));\n },\n // sum([a, b, c, d, ...], dim)\n 'Array, number | BigNumber': _ncumSumDim,\n 'Matrix, number | BigNumber': function MatrixNumberBigNumber(matrix, dim) {\n return matrix.create(_ncumSumDim(matrix.valueOf(), dim));\n },\n // cumsum(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('All values expected to be scalar in function cumsum');\n }\n return _cumsum(args);\n }\n });\n\n /**\n * Recursively calculate the cumulative sum of an n-dimensional array\n * @param {Array} array\n * @return {number} cumsum\n * @private\n */\n function _cumsum(array) {\n try {\n return _cumsummap(array);\n } catch (err) {\n throw improveErrorMessage(err, name);\n }\n }\n function _cumsummap(array) {\n if (array.length === 0) {\n return [];\n }\n var sums = [unaryPlus(array[0])]; // unaryPlus converts to number if need be\n for (var i = 1; i < array.length; ++i) {\n // Must use add below and not addScalar for the case of summing a\n // 2+-dimensional array along the 0th dimension (the row vectors,\n // or higher-d analogues, are literally added to each other).\n sums.push(add(sums[i - 1], array[i]));\n }\n return sums;\n }\n function _ncumSumDim(array, dim) {\n var size = arraySize(array);\n if (dim < 0 || dim >= size.length) {\n // TODO: would be more clear when throwing a DimensionError here\n throw new IndexError(dim, size.length);\n }\n try {\n return _cumsumDimensional(array, dim);\n } catch (err) {\n throw improveErrorMessage(err, name);\n }\n }\n\n /* Possible TODO: Refactor _reduce in collection.js to be able to work here as well */\n function _cumsumDimensional(mat, dim) {\n var i, ret, tran;\n if (dim <= 0) {\n var initialValue = mat[0][0];\n if (!Array.isArray(initialValue)) {\n return _cumsummap(mat);\n } else {\n tran = _switch(mat);\n ret = [];\n for (i = 0; i < tran.length; i++) {\n ret[i] = _cumsumDimensional(tran[i], dim - 1);\n }\n return ret;\n }\n } else {\n ret = [];\n for (i = 0; i < mat.length; i++) {\n ret[i] = _cumsumDimensional(mat[i], dim - 1);\n }\n return ret;\n }\n }\n});", "import { containsCollections, deepForEach, reduce } from '../../utils/collection.js';\nimport { arraySize } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'mean';\nvar dependencies = ['typed', 'add', 'divide'];\nexport var createMean = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide\n } = _ref;\n /**\n * Compute the mean value of matrix or a list with values.\n * In case of a multidimensional array, the mean of the flattened array\n * will be calculated. When `dim` is provided, the maximum over the selected\n * dimension will be calculated. Parameter `dim` is zero-based.\n *\n * Syntax:\n *\n * math.mean(a, b, c, ...)\n * math.mean(A)\n * math.mean(A, dimension)\n *\n * Examples:\n *\n * math.mean(2, 1, 4, 3) // returns 2.5\n * math.mean([1, 2.7, 3.2, 4]) // returns 2.725\n *\n * math.mean([[2, 5], [6, 3], [1, 7]], 0) // returns [3, 5]\n * math.mean([[2, 5], [6, 3], [1, 7]], 1) // returns [3.5, 4.5, 4]\n *\n * See also:\n *\n * median, min, max, sum, prod, std, variance\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The mean of all values\n */\n return typed(name, {\n // mean([a, b, c, d, ...])\n 'Array | Matrix': _mean,\n // mean([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': _nmeanDim,\n // mean(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function mean');\n }\n return _mean(args);\n }\n });\n\n /**\n * Calculate the mean value in an n-dimensional array, returning a\n * n-1 dimensional array\n * @param {Array} array\n * @param {number} dim\n * @return {number} mean\n * @private\n */\n function _nmeanDim(array, dim) {\n try {\n var sum = reduce(array, dim, add);\n var s = Array.isArray(array) ? arraySize(array) : array.size();\n return divide(sum, s[dim]);\n } catch (err) {\n throw improveErrorMessage(err, 'mean');\n }\n }\n\n /**\n * Recursively calculate the mean value in an n-dimensional array\n * @param {Array} array\n * @return {number} mean\n * @private\n */\n function _mean(array) {\n var sum;\n var num = 0;\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n num++;\n } catch (err) {\n throw improveErrorMessage(err, 'mean', value);\n }\n });\n if (num === 0) {\n throw new Error('Cannot calculate the mean of an empty array');\n }\n return divide(sum, num);\n }\n});", "import { containsCollections } from '../../utils/collection.js';\nimport { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'median';\nvar dependencies = ['typed', 'add', 'divide', 'compare', 'partitionSelect'];\nexport var createMedian = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide,\n compare,\n partitionSelect\n } = _ref;\n /**\n * Recursively calculate the median of an n-dimensional array\n * @param {Array} array\n * @return {Number} median\n * @private\n */\n function _median(array) {\n try {\n array = flatten(array.valueOf());\n var num = array.length;\n if (num === 0) {\n throw new Error('Cannot calculate median of an empty array');\n }\n if (num % 2 === 0) {\n // even: return the average of the two middle values\n var mid = num / 2 - 1;\n var right = partitionSelect(array, mid + 1);\n\n // array now partitioned at mid + 1, take max of left part\n var left = array[mid];\n for (var i = 0; i < mid; ++i) {\n if (compare(array[i], left) > 0) {\n left = array[i];\n }\n }\n return middle2(left, right);\n } else {\n // odd: return the middle value\n var m = partitionSelect(array, (num - 1) / 2);\n return middle(m);\n }\n } catch (err) {\n throw improveErrorMessage(err, 'median');\n }\n }\n\n // helper function to type check the middle value of the array\n var middle = typed({\n 'number | BigNumber | Complex | Unit': function numberBigNumberComplexUnit(value) {\n return value;\n }\n });\n\n // helper function to type check the two middle value of the array\n var middle2 = typed({\n 'number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit': function numberBigNumberComplexUnitNumberBigNumberComplexUnit(left, right) {\n return divide(add(left, right), 2);\n }\n });\n\n /**\n * Compute the median of a matrix or a list with values. The values are\n * sorted and the middle value is returned. In case of an even number of\n * values, the average of the two middle values is returned.\n * Supported types of values are: Number, BigNumber, Unit\n *\n * In case of a (multi dimensional) array or matrix, the median of all\n * elements will be calculated.\n *\n * Syntax:\n *\n * math.median(a, b, c, ...)\n * math.median(A)\n *\n * Examples:\n *\n * math.median(5, 2, 7) // returns 5\n * math.median([3, -1, 5, 7]) // returns 4\n *\n * See also:\n *\n * mean, min, max, sum, prod, std, variance, quantileSeq\n *\n * @param {... *} args A single matrix or or multiple scalar values\n * @return {*} The median\n */\n return typed(name, {\n // median([a, b, c, d, ...])\n 'Array | Matrix': _median,\n // median([a, b, c, d, ...], dim)\n 'Array | Matrix, number | BigNumber': function ArrayMatrixNumberBigNumber(array, dim) {\n // TODO: implement median(A, dim)\n throw new Error('median(A, dim) is not yet supported');\n // return reduce(arguments[0], arguments[1], ...)\n },\n // median(a, b, c, d, ...)\n '...': function _(args) {\n if (containsCollections(args)) {\n throw new TypeError('Scalar values expected in function median');\n }\n return _median(args);\n }\n });\n});", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar name = 'mad';\nvar dependencies = ['typed', 'abs', 'map', 'median', 'subtract'];\nexport var createMad = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n abs,\n map,\n median,\n subtract\n } = _ref;\n /**\n * Compute the median absolute deviation of a matrix or a list with values.\n * The median absolute deviation is defined as the median of the absolute\n * deviations from the median.\n *\n * Syntax:\n *\n * math.mad(a, b, c, ...)\n * math.mad(A)\n *\n * Examples:\n *\n * math.mad(10, 20, 30) // returns 10\n * math.mad([1, 2, 3]) // returns 1\n * math.mad([[1, 2, 3], [4, 5, 6]]) // returns 1.5\n *\n * See also:\n *\n * median, mean, std, abs\n *\n * @param {Array | Matrix} array\n * A single matrix or multiple scalar values.\n * @return {*} The median absolute deviation.\n */\n return typed(name, {\n // mad([a, b, c, d, ...])\n 'Array | Matrix': _mad,\n // mad(a, b, c, d, ...)\n '...': function _(args) {\n return _mad(args);\n }\n });\n function _mad(array) {\n array = flatten(array.valueOf());\n if (array.length === 0) {\n throw new Error('Cannot calculate median absolute deviation (mad) of an empty array');\n }\n try {\n var med = median(array);\n return median(map(array, function (value) {\n return abs(subtract(value, med));\n }));\n } catch (err) {\n if (err instanceof TypeError && err.message.includes('median')) {\n throw new TypeError(err.message.replace('median', 'mad'));\n } else {\n throw improveErrorMessage(err, 'mad');\n }\n }\n }\n});", "import { deepForEach } from '../../utils/collection.js';\nimport { isBigNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { improveErrorMessage } from './utils/improveErrorMessage.js';\nvar DEFAULT_NORMALIZATION = 'unbiased';\nvar name = 'variance';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN'];\nexport var createVariance = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n } = _ref;\n /**\n * Compute the variance of a matrix or a list with values.\n * In case of a multidimensional array or matrix, the variance over all\n * elements will be calculated.\n *\n * Additionally, it is possible to compute the variance along the rows\n * or columns of a matrix by specifying the dimension as the second argument.\n *\n * Optionally, the type of normalization can be specified as the final\n * parameter. The parameter `normalization` can be one of the following values:\n *\n * - 'unbiased' (default) The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n *\n *\n * Note that older browser may not like the variable name `var`. In that\n * case, the function can be called as `math['var'](...)` instead of\n * `math.var(...)`.\n *\n * Syntax:\n *\n * math.variance(a, b, c, ...)\n * math.variance(A)\n * math.variance(A, normalization)\n * math.variance(A, dimension)\n * math.variance(A, dimension, normalization)\n *\n * Examples:\n *\n * math.variance(2, 4, 6) // returns 4\n * math.variance([2, 4, 6, 8]) // returns 6.666666666666667\n * math.variance([2, 4, 6, 8], 'uncorrected') // returns 5\n * math.variance([2, 4, 6, 8], 'biased') // returns 4\n *\n * math.variance([[1, 2, 3], [4, 5, 6]]) // returns 3.5\n * math.variance([[1, 2, 3], [4, 6, 8]], 0) // returns [4.5, 8, 12.5]\n * math.variance([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 4]\n * math.variance([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.5, 2]\n *\n * See also:\n *\n * mean, median, max, min, prod, std, sum\n *\n * @param {Array | Matrix} array\n * A single matrix or or multiple scalar values\n * @param {string} [normalization='unbiased']\n * Determines how to normalize the variance.\n * Choose 'unbiased' (default), 'uncorrected', or 'biased'.\n * @param dimension {number | BigNumber}\n * Determines the axis to compute the variance for a matrix\n * @return {*} The variance\n */\n return typed(name, {\n // variance([a, b, c, d, ...])\n 'Array | Matrix': function ArrayMatrix(array) {\n return _var(array, DEFAULT_NORMALIZATION);\n },\n // variance([a, b, c, d, ...], normalization)\n 'Array | Matrix, string': _var,\n // variance([a, b, c, c, ...], dim)\n 'Array | Matrix, number | BigNumber': function ArrayMatrixNumberBigNumber(array, dim) {\n return _varDim(array, dim, DEFAULT_NORMALIZATION);\n },\n // variance([a, b, c, c, ...], dim, normalization)\n 'Array | Matrix, number | BigNumber, string': _varDim,\n // variance(a, b, c, d, ...)\n '...': function _(args) {\n return _var(args, DEFAULT_NORMALIZATION);\n }\n });\n\n /**\n * Recursively calculate the variance of an n-dimensional array\n * @param {Array} array\n * @param {string} normalization\n * Determines how to normalize the variance:\n * - 'unbiased' The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n * @return {number | BigNumber} variance\n * @private\n */\n function _var(array, normalization) {\n var sum;\n var num = 0;\n if (array.length === 0) {\n throw new SyntaxError('Function variance requires one or more parameters (0 provided)');\n }\n\n // calculate the mean and number of elements\n deepForEach(array, function (value) {\n try {\n sum = sum === undefined ? value : add(sum, value);\n num++;\n } catch (err) {\n throw improveErrorMessage(err, 'variance', value);\n }\n });\n if (num === 0) throw new Error('Cannot calculate variance of an empty array');\n var mean = divide(sum, num);\n\n // calculate the variance\n sum = undefined;\n deepForEach(array, function (value) {\n var diff = subtract(value, mean);\n sum = sum === undefined ? multiply(diff, diff) : add(sum, multiply(diff, diff));\n });\n if (isNaN(sum)) {\n return sum;\n }\n switch (normalization) {\n case 'uncorrected':\n return divide(sum, num);\n case 'biased':\n return divide(sum, num + 1);\n case 'unbiased':\n {\n var zero = isBigNumber(sum) ? sum.mul(0) : 0;\n return num === 1 ? zero : divide(sum, num - 1);\n }\n default:\n throw new Error('Unknown normalization \"' + normalization + '\". ' + 'Choose \"unbiased\" (default), \"uncorrected\", or \"biased\".');\n }\n }\n function _varDim(array, dim, normalization) {\n try {\n if (array.length === 0) {\n throw new SyntaxError('Function variance requires one or more parameters (0 provided)');\n }\n return apply(array, dim, x => _var(x, normalization));\n } catch (err) {\n throw improveErrorMessage(err, 'variance');\n }\n }\n});", "import { isNumber } from '../../utils/is.js';\nimport { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { createApply } from '../matrix/apply.js';\nvar name = 'quantileSeq';\nvar dependencies = ['typed', '?bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger'];\nexport var createQuantileSeq = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n } = _ref;\n var apply = createApply({\n typed,\n isInteger\n });\n\n /**\n * Compute the prob order quantile of a matrix or a list with values.\n * The sequence is sorted and the middle value is returned.\n * Supported types of sequence values are: Number, BigNumber, Unit\n * Supported types of probability are: Number, BigNumber\n *\n * In case of a multidimensional array or matrix, the prob order quantile\n * of all elements will be calculated.\n *\n * Syntax:\n *\n * math.quantileSeq(A, prob[, sorted])\n * math.quantileSeq(A, [prob1, prob2, ...][, sorted])\n * math.quantileSeq(A, N[, sorted])\n *\n * Examples:\n *\n * math.quantileSeq([3, -1, 5, 7], 0.5) // returns 4\n * math.quantileSeq([3, -1, 5, 7], [1/3, 2/3]) // returns [3, 5]\n * math.quantileSeq([3, -1, 5, 7], 2) // returns [3, 5]\n * math.quantileSeq([-1, 3, 5, 7], 0.5, true) // returns 4\n *\n * See also:\n *\n * median, mean, min, max, sum, prod, std, variance\n *\n * @param {Array, Matrix} data A single matrix or Array\n * @param {Number, BigNumber, Array} probOrN prob is the order of the quantile, while N is\n * the amount of evenly distributed steps of\n * probabilities; only one of these options can\n * be provided\n * @param {Boolean} sorted=false is data sorted in ascending order\n * @return {Number, BigNumber, Unit, Array} Quantile(s)\n */\n return typed(name, {\n 'Array | Matrix, number | BigNumber': (data, p) => _quantileSeqProbNumber(data, p, false),\n 'Array | Matrix, number | BigNumber, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbNumber),\n 'Array | Matrix, number | BigNumber, boolean': _quantileSeqProbNumber,\n 'Array | Matrix, number | BigNumber, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbNumber),\n 'Array | Matrix, Array | Matrix': (data, p) => _quantileSeqProbCollection(data, p, false),\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbCollection),\n 'Array | Matrix, Array | Matrix, boolean': _quantileSeqProbCollection,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbCollection)\n });\n function _quantileSeqDim(data, prob, sorted, dim, fn) {\n return apply(data, dim, x => fn(x, prob, sorted));\n }\n function _quantileSeqProbNumber(data, probOrN, sorted) {\n var probArr;\n var dataArr = data.valueOf();\n if (smaller(probOrN, 0)) {\n throw new Error('N/prob must be non-negative');\n }\n if (smallerEq(probOrN, 1)) {\n // quantileSeq([a, b, c, d, ...], prob[,sorted])\n return isNumber(probOrN) ? _quantileSeq(dataArr, probOrN, sorted) : bignumber(_quantileSeq(dataArr, probOrN, sorted));\n }\n if (larger(probOrN, 1)) {\n // quantileSeq([a, b, c, d, ...], N[,sorted])\n if (!isInteger(probOrN)) {\n throw new Error('N must be a positive integer');\n }\n\n // largest possible Array length is 2^32-1\n // 2^32 < 10^15, thus safe conversion guaranteed\n if (larger(probOrN, 4294967295)) {\n throw new Error('N must be less than or equal to 2^32-1, as that is the maximum length of an Array');\n }\n var nPlusOne = add(probOrN, 1);\n probArr = [];\n for (var i = 0; smaller(i, probOrN); i++) {\n var prob = divide(i + 1, nPlusOne);\n probArr.push(_quantileSeq(dataArr, prob, sorted));\n }\n return isNumber(probOrN) ? probArr : bignumber(probArr);\n }\n }\n\n /**\n * Calculate the prob order quantile of an n-dimensional array.\n *\n * @param {Array, Matrix} array\n * @param {Array, Matrix} prob\n * @param {Boolean} sorted\n * @return {Number, BigNumber, Unit} prob order quantile\n * @private\n */\n\n function _quantileSeqProbCollection(data, probOrN, sorted) {\n var dataArr = data.valueOf();\n // quantileSeq([a, b, c, d, ...], [prob1, prob2, ...][,sorted])\n var probOrNArr = probOrN.valueOf();\n var probArr = [];\n for (var i = 0; i < probOrNArr.length; ++i) {\n probArr.push(_quantileSeq(dataArr, probOrNArr[i], sorted));\n }\n return probArr;\n }\n\n /**\n * Calculate the prob order quantile of an n-dimensional array.\n *\n * @param {Array} array\n * @param {Number, BigNumber} prob\n * @param {Boolean} sorted\n * @return {Number, BigNumber, Unit} prob order quantile\n * @private\n */\n function _quantileSeq(array, prob, sorted) {\n var flat = flatten(array);\n var len = flat.length;\n if (len === 0) {\n throw new Error('Cannot calculate quantile of an empty sequence');\n }\n var index = isNumber(prob) ? prob * (len - 1) : prob.times(len - 1);\n var integerPart = isNumber(prob) ? Math.floor(index) : index.floor().toNumber();\n var fracPart = isNumber(prob) ? index % 1 : index.minus(integerPart);\n if (isInteger(index)) {\n return sorted ? flat[index] : partitionSelect(flat, isNumber(prob) ? index : index.valueOf());\n }\n var left;\n var right;\n if (sorted) {\n left = flat[integerPart];\n right = flat[integerPart + 1];\n } else {\n right = partitionSelect(flat, integerPart + 1);\n\n // max of partition is kth largest\n left = flat[integerPart];\n for (var i = 0; i < integerPart; ++i) {\n if (compare(flat[i], left) > 0) {\n left = flat[i];\n }\n }\n }\n // Q(prob) = (1-f)*A[floor(index)] + f*A[floor(index)+1]\n return add(multiply(left, subtract(1, fracPart)), multiply(right, fracPart));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'std';\nvar dependencies = ['typed', 'map', 'sqrt', 'variance'];\nexport var createStd = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n map,\n sqrt,\n variance\n } = _ref;\n /**\n * Compute the standard deviation of a matrix or a list with values.\n * The standard deviations is defined as the square root of the variance:\n * `std(A) = sqrt(variance(A))`.\n * In case of a (multi dimensional) array or matrix, the standard deviation\n * over all elements will be calculated by default, unless an axis is specified\n * in which case the standard deviation will be computed along that axis.\n *\n * Additionally, it is possible to compute the standard deviation along the rows\n * or columns of a matrix by specifying the dimension as the second argument.\n *\n * Optionally, the type of normalization can be specified as the final\n * parameter. The parameter `normalization` can be one of the following values:\n *\n * - 'unbiased' (default) The sum of squared errors is divided by (n - 1)\n * - 'uncorrected' The sum of squared errors is divided by n\n * - 'biased' The sum of squared errors is divided by (n + 1)\n *\n *\n * Syntax:\n *\n * math.std(a, b, c, ...)\n * math.std(A)\n * math.std(A, normalization)\n * math.std(A, dimension)\n * math.std(A, dimension, normalization)\n *\n * Examples:\n *\n * math.std(2, 4, 6) // returns 2\n * math.std([2, 4, 6, 8]) // returns 2.581988897471611\n * math.std([2, 4, 6, 8], 'uncorrected') // returns 2.23606797749979\n * math.std([2, 4, 6, 8], 'biased') // returns 2\n *\n * math.std([[1, 2, 3], [4, 5, 6]]) // returns 1.8708286933869707\n * math.std([[1, 2, 3], [4, 6, 8]], 0) // returns [2.1213203435596424, 2.8284271247461903, 3.5355339059327378]\n * math.std([[1, 2, 3], [4, 6, 8]], 1) // returns [1, 2]\n * math.std([[1, 2, 3], [4, 6, 8]], 1, 'biased') // returns [0.7071067811865476, 1.4142135623730951]\n *\n * See also:\n *\n * mean, median, max, min, prod, sum, variance\n *\n * @param {Array | Matrix} array\n * A single matrix or or multiple scalar values\n * @param {string} [normalization='unbiased']\n * Determines how to normalize the variance.\n * Choose 'unbiased' (default), 'uncorrected', or 'biased'.\n * @param dimension {number | BigNumber}\n * Determines the axis to compute the standard deviation for a matrix\n * @return {*} The standard deviation\n */\n return typed(name, {\n // std([a, b, c, d, ...])\n 'Array | Matrix': _std,\n // std([a, b, c, d, ...], normalization)\n 'Array | Matrix, string': _std,\n // std([a, b, c, c, ...], dim)\n 'Array | Matrix, number | BigNumber': _std,\n // std([a, b, c, c, ...], dim, normalization)\n 'Array | Matrix, number | BigNumber, string': _std,\n // std(a, b, c, d, ...)\n '...': function _(args) {\n return _std(args);\n }\n });\n function _std(array, normalization) {\n if (array.length === 0) {\n throw new SyntaxError('Function std requires one or more parameters (0 provided)');\n }\n try {\n var v = variance.apply(null, arguments);\n if (isCollection(v)) {\n return map(v, sqrt);\n } else {\n return sqrt(v);\n }\n } catch (err) {\n if (err instanceof TypeError && err.message.includes(' variance')) {\n throw new TypeError(err.message.replace(' variance', ' std'));\n } else {\n throw err;\n }\n }\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'corr';\nvar dependencies = ['typed', 'matrix', 'mean', 'sqrt', 'sum', 'add', 'subtract', 'multiply', 'pow', 'divide'];\nexport var createCorr = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n sqrt,\n sum,\n add,\n subtract,\n multiply,\n pow,\n divide\n } = _ref;\n /**\n * Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.\n *\n * Syntax:\n *\n * math.corr(A, B)\n *\n * Examples:\n *\n * math.corr([1, 2, 3, 4, 5], [4, 5, 6, 7, 8]) // returns 1\n * math.corr([1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]) //returns 0.9569941688503644\n * math.corr([[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]],[[1, 2.2, 3, 4.8, 5], [4, 5.3, 6.6, 7, 8]]) // returns [1,1]\n *\n * See also:\n *\n * median, mean, min, max, sum, prod, std, variance\n *\n * @param {Array | Matrix} A The first array or matrix to compute correlation coefficient\n * @param {Array | Matrix} B The second array or matrix to compute correlation coefficient\n * @return {*} The correlation coefficient\n */\n return typed(name, {\n 'Array, Array': function ArrayArray(A, B) {\n return _corr(A, B);\n },\n 'Matrix, Matrix': function MatrixMatrix(A, B) {\n var res = _corr(A.toArray(), B.toArray());\n return Array.isArray(res) ? matrix(res) : res;\n }\n });\n /**\n * Calculate the correlation coefficient between two arrays or matrices.\n * @param {Array | Matrix} A\n * @param {Array | Matrix} B\n * @return {*} correlation coefficient\n * @private\n */\n function _corr(A, B) {\n var correlations = [];\n if (Array.isArray(A[0]) && Array.isArray(B[0])) {\n if (A.length !== B.length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same length.');\n }\n for (var i = 0; i < A.length; i++) {\n if (A[i].length !== B[i].length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.');\n }\n correlations.push(correlation(A[i], B[i]));\n }\n return correlations;\n } else {\n if (A.length !== B.length) {\n throw new SyntaxError('Dimension mismatch. Array A and B must have the same number of elements.');\n }\n return correlation(A, B);\n }\n }\n function correlation(A, B) {\n var n = A.length;\n var sumX = sum(A);\n var sumY = sum(B);\n var sumXY = A.reduce((acc, x, index) => add(acc, multiply(x, B[index])), 0);\n var sumXSquare = sum(A.map(x => pow(x, 2)));\n var sumYSquare = sum(B.map(y => pow(y, 2)));\n var numerator = subtract(multiply(n, sumXY), multiply(sumX, sumY));\n var denominator = sqrt(multiply(subtract(multiply(n, sumXSquare), pow(sumX, 2)), subtract(multiply(n, sumYSquare), pow(sumY, 2))));\n return divide(numerator, denominator);\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { combinationsNumber } from '../../plain/number/combinations.js';\nvar name = 'combinations';\nvar dependencies = ['typed'];\nexport var createCombinations = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the number of ways of picking `k` unordered outcomes from `n`\n * possibilities.\n *\n * Combinations only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.combinations(n, k)\n *\n * Examples:\n *\n * math.combinations(7, 5) // returns 21\n *\n * See also:\n *\n * combinationsWithRep, permutations, factorial\n *\n * @param {number | BigNumber} n Total number of objects in the set\n * @param {number | BigNumber} k Number of objects in the subset\n * @return {number | BigNumber} Number of possible combinations.\n */\n return typed(name, {\n 'number, number': combinationsNumber,\n 'BigNumber, BigNumber': function BigNumberBigNumber(n, k) {\n var BigNumber = n.constructor;\n var result, i;\n var nMinusk = n.minus(k);\n var one = new BigNumber(1);\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function combinations');\n }\n if (k.gt(n)) {\n throw new TypeError('k must be less than n in function combinations');\n }\n result = one;\n if (k.lt(nMinusk)) {\n for (i = one; i.lte(nMinusk); i = i.plus(one)) {\n result = result.times(k.plus(i)).dividedBy(i);\n }\n } else {\n for (i = one; i.lte(k); i = i.plus(one)) {\n result = result.times(nMinusk.plus(i)).dividedBy(i);\n }\n }\n return result;\n }\n\n // TODO: implement support for collection in combinations\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import { factory } from '../../utils/factory.js';\nimport { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nvar name = 'combinationsWithRep';\nvar dependencies = ['typed'];\nexport var createCombinationsWithRep = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Compute the number of ways of picking `k` unordered outcomes from `n`\n * possibilities, allowing individual outcomes to be repeated more than once.\n *\n * CombinationsWithRep only takes integer arguments.\n * The following condition must be enforced: k <= n + k -1.\n *\n * Syntax:\n *\n * math.combinationsWithRep(n, k)\n *\n * Examples:\n *\n * math.combinationsWithRep(7, 5) // returns 462\n *\n * See also:\n *\n * combinations, permutations, factorial\n *\n * @param {number | BigNumber} n Total number of objects in the set\n * @param {number | BigNumber} k Number of objects in the subset\n * @return {number | BigNumber} Number of possible combinations with replacement.\n */\n return typed(name, {\n 'number, number': function numberNumber(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (n < 1) {\n throw new TypeError('k must be less than or equal to n + k - 1');\n }\n if (k < n - 1) {\n var _prodrange = product(n, n + k - 1);\n return _prodrange / product(1, k);\n }\n var prodrange = product(k + 1, n + k - 1);\n return prodrange / product(1, n - 1);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(n, k) {\n var BigNumber = n.constructor;\n var result, i;\n var one = new BigNumber(1);\n var nMinusOne = n.minus(one);\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function combinationsWithRep');\n }\n if (n.lt(one)) {\n throw new TypeError('k must be less than or equal to n + k - 1 in function combinationsWithRep');\n }\n result = one;\n if (k.lt(nMinusOne)) {\n for (i = one; i.lte(nMinusOne); i = i.plus(one)) {\n result = result.times(k.plus(i)).dividedBy(i);\n }\n } else {\n for (i = one; i.lte(k); i = i.plus(one)) {\n result = result.times(nMinusOne.plus(i)).dividedBy(i);\n }\n }\n return result;\n }\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import { factory } from '../../utils/factory.js';\nimport { gammaG, gammaNumber, gammaP } from '../../plain/number/index.js';\nvar name = 'gamma';\nvar dependencies = ['typed', 'config', 'multiplyScalar', 'pow', 'BigNumber', 'Complex'];\nexport var createGamma = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n multiplyScalar,\n pow,\n BigNumber: _BigNumber,\n Complex\n } = _ref;\n /**\n * Compute the gamma function of a value using Lanczos approximation for\n * small values, and an extended Stirling approximation for large values.\n *\n * To avoid confusion with the matrix Gamma function, this function does\n * not apply to matrices.\n *\n * Syntax:\n *\n * math.gamma(n)\n *\n * Examples:\n *\n * math.gamma(5) // returns 24\n * math.gamma(-0.5) // returns -3.5449077018110335\n * math.gamma(math.i) // returns -0.15494982830180973 - 0.49801566811835596i\n *\n * See also:\n *\n * combinations, factorial, permutations\n *\n * @param {number | BigNumber | Complex} n A real or complex number\n * @return {number | BigNumber | Complex} The gamma of `n`\n */\n\n function gammaComplex(n) {\n if (n.im === 0) {\n return gammaNumber(n.re);\n }\n\n // Lanczos approximation doesn't work well with real part lower than 0.5\n // So reflection formula is required\n if (n.re < 0.5) {\n // Euler's reflection formula\n // gamma(1-z) * gamma(z) = PI / sin(PI * z)\n // real part of Z should not be integer [sin(PI) == 0 -> 1/0 - undefined]\n // thanks to imperfect sin implementation sin(PI * n) != 0\n // we can safely use it anyway\n var _t = new Complex(1 - n.re, -n.im);\n var r = new Complex(Math.PI * n.re, Math.PI * n.im);\n return new Complex(Math.PI).div(r.sin()).div(gammaComplex(_t));\n }\n\n // Lanczos approximation\n // z -= 1\n n = new Complex(n.re - 1, n.im);\n\n // x = gammaPval[0]\n var x = new Complex(gammaP[0], 0);\n // for (i, gammaPval) in enumerate(gammaP):\n for (var i = 1; i < gammaP.length; ++i) {\n // x += gammaPval / (z + i)\n var gammaPval = new Complex(gammaP[i], 0);\n x = x.add(gammaPval.div(n.add(i)));\n }\n // t = z + gammaG + 0.5\n var t = new Complex(n.re + gammaG + 0.5, n.im);\n\n // y = sqrt(2 * pi) * t ** (z + 0.5) * exp(-t) * x\n var twoPiSqrt = Math.sqrt(2 * Math.PI);\n var tpow = t.pow(n.add(0.5));\n var expt = t.neg().exp();\n\n // y = [x] * [sqrt(2 * pi)] * [t ** (z + 0.5)] * [exp(-t)]\n return x.mul(twoPiSqrt).mul(tpow).mul(expt);\n }\n return typed(name, {\n number: gammaNumber,\n Complex: gammaComplex,\n BigNumber: function BigNumber(n) {\n if (n.isInteger()) {\n return n.isNegative() || n.isZero() ? new _BigNumber(Infinity) : bigFactorial(n.minus(1));\n }\n if (!n.isFinite()) {\n return new _BigNumber(n.isNegative() ? NaN : Infinity);\n }\n throw new Error('Integer BigNumber expected');\n }\n });\n\n /**\n * Calculate factorial for a BigNumber\n * @param {BigNumber} n\n * @returns {BigNumber} Returns the factorial of n\n */\n function bigFactorial(n) {\n if (n < 8) {\n return new _BigNumber([1, 1, 2, 6, 24, 120, 720, 5040][n]);\n }\n var precision = config.precision + (Math.log(n.toNumber()) | 0);\n var Big = _BigNumber.clone({\n precision\n });\n if (n % 2 === 1) {\n return n.times(bigFactorial(new _BigNumber(n - 1)));\n }\n var p = n;\n var prod = new Big(n);\n var sum = n.toNumber();\n while (p > 2) {\n p -= 2;\n sum += p;\n prod = prod.times(sum);\n }\n return new _BigNumber(prod.toPrecision(_BigNumber.precision));\n }\n});", "/* eslint-disable no-loss-of-precision */\n\n// References\n// ----------\n// [1] Hare, \"Computing the Principal Branch of log-Gamma\", Journal of Algorithms, 1997.\n// [2] https://math.stackexchange.com/questions/1338753/how-do-i-calculate-values-for-gamma-function-with-complex-arguments\n\nimport { lgammaNumber, lnSqrt2PI } from '../../plain/number/index.js';\nimport { factory } from '../../utils/factory.js';\nimport { copysign } from '../../utils/number.js';\nvar name = 'lgamma';\nvar dependencies = ['Complex', 'typed'];\nexport var createLgamma = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Complex,\n typed\n } = _ref;\n // Stirling series is non-convergent, we need to use the recurrence `lgamma(z) = lgamma(z+1) - log z` to get\n // sufficient accuracy.\n //\n // These two values are copied from Scipy implementation:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L37\n var SMALL_RE = 7;\n var SMALL_IM = 7;\n\n /**\n * The coefficients are B[2*n]/(2*n*(2*n - 1)) where B[2*n] is the (2*n)th Bernoulli number. See (1.1) in [1].\n *\n * If you cannot access the paper, can also get these values from the formula in [2].\n *\n * 1 / 12 = 0.00833333333333333333333333333333\n * 1 / 360 = 0.00277777777777777777777777777778\n * ...\n * 3617 / 133400 = 0.02955065359477124183006535947712\n */\n var coeffs = [-2.955065359477124183e-2, 6.4102564102564102564e-3, -1.9175269175269175269e-3, 8.4175084175084175084e-4, -5.952380952380952381e-4, 7.9365079365079365079e-4, -2.7777777777777777778e-3, 8.3333333333333333333e-2];\n\n /**\n * Logarithm of the gamma function for real, positive numbers and complex numbers,\n * using Lanczos approximation for numbers and Stirling series for complex numbers.\n *\n * Syntax:\n *\n * math.lgamma(n)\n *\n * Examples:\n *\n * math.lgamma(5) // returns 3.178053830347945\n * math.lgamma(0) // returns Infinity\n * math.lgamma(-0.5) // returns NaN\n * math.lgamma(math.i) // returns -0.6509231993018536 - 1.8724366472624294i\n *\n * See also:\n *\n * gamma\n *\n * @param {number | Complex} n A real or complex number\n * @return {number | Complex} The log gamma of `n`\n */\n return typed(name, {\n number: lgammaNumber,\n Complex: lgammaComplex,\n BigNumber: function BigNumber() {\n throw new Error(\"mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber\");\n }\n });\n function lgammaComplex(n) {\n var TWOPI = 6.2831853071795864769252842; // 2*pi\n var LOGPI = 1.1447298858494001741434262; // log(pi)\n\n var REFLECTION = 0.1;\n if (n.isNaN()) {\n return new Complex(NaN, NaN);\n } else if (n.im === 0) {\n return new Complex(lgammaNumber(n.re), 0);\n } else if (n.re >= SMALL_RE || Math.abs(n.im) >= SMALL_IM) {\n return lgammaStirling(n);\n } else if (n.re <= REFLECTION) {\n // Reflection formula. see Proposition 3.1 in [1]\n var tmp = copysign(TWOPI, n.im) * Math.floor(0.5 * n.re + 0.25);\n var a = n.mul(Math.PI).sin().log();\n var b = lgammaComplex(new Complex(1 - n.re, -n.im));\n return new Complex(LOGPI, tmp).sub(a).sub(b);\n } else if (n.im >= 0) {\n return lgammaRecurrence(n);\n } else {\n return lgammaRecurrence(n.conjugate()).conjugate();\n }\n }\n function lgammaStirling(z) {\n // formula ref in [2]\n // computation ref:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L101\n\n // left part\n\n // x (log(x) - 1) + 1/2 (log(2PI) - log(x))\n // => (x - 0.5) * log(x) - x + log(2PI) / 2\n var leftPart = z.sub(0.5).mul(z.log()).sub(z).add(lnSqrt2PI);\n\n // right part\n\n var rz = new Complex(1, 0).div(z);\n var rzz = rz.div(z);\n var a = coeffs[0];\n var b = coeffs[1];\n var r = 2 * rzz.re;\n var s = rzz.re * rzz.re + rzz.im * rzz.im;\n for (var i = 2; i < 8; i++) {\n var tmp = b;\n b = -s * a + coeffs[i];\n a = r * a + tmp;\n }\n var rightPart = rz.mul(rzz.mul(a).add(b));\n\n // plus left and right\n\n return leftPart.add(rightPart);\n }\n function lgammaRecurrence(z) {\n // computation ref:\n // https://github.com/scipy/scipy/blob/v1.8.0/scipy/special/_loggamma.pxd#L78\n\n var signflips = 0;\n var sb = 0;\n var shiftprod = z;\n z = z.add(1);\n while (z.re <= SMALL_RE) {\n shiftprod = shiftprod.mul(z);\n var nsb = shiftprod.im < 0 ? 1 : 0;\n if (nsb !== 0 && sb === 0) signflips++;\n sb = nsb;\n z = z.add(1);\n }\n return lgammaStirling(z).sub(shiftprod.log()).sub(new Complex(0, signflips * 2 * Math.PI * 1));\n }\n});", "import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'factorial';\nvar dependencies = ['typed', 'gamma'];\nexport var createFactorial = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n gamma\n } = _ref;\n /**\n * Compute the factorial of a value\n *\n * Factorial only supports an integer value as argument.\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.factorial(n)\n *\n * Examples:\n *\n * math.factorial(5) // returns 120\n * math.factorial(3) // returns 6\n *\n * See also:\n *\n * combinations, combinationsWithRep, gamma, permutations\n *\n * @param {number | BigNumber | Array | Matrix} n An integer number\n * @return {number | BigNumber | Array | Matrix} The factorial of `n`\n */\n return typed(name, {\n number: function number(n) {\n if (n < 0) {\n throw new Error('Value must be non-negative');\n }\n return gamma(n + 1);\n },\n BigNumber: function BigNumber(n) {\n if (n.isNegative()) {\n throw new Error('Value must be non-negative');\n }\n return gamma(n.plus(1));\n },\n 'Array | Matrix': typed.referToSelf(self => n => deepMap(n, self))\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'kldivergence';\nvar dependencies = ['typed', 'matrix', 'divide', 'sum', 'multiply', 'map', 'dotDivide', 'log', 'isNumeric'];\nexport var createKldivergence = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n divide,\n sum,\n multiply,\n map,\n dotDivide,\n log,\n isNumeric\n } = _ref;\n /**\n * Calculate the Kullback-Leibler (KL) divergence between two distributions\n *\n * Syntax:\n *\n * math.kldivergence(x, y)\n *\n * Examples:\n *\n * math.kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5]) //returns 0.24376698773121153\n *\n *\n * @param {Array | Matrix} q First vector\n * @param {Array | Matrix} p Second vector\n * @return {number} Returns distance between q and p\n */\n return typed(name, {\n 'Array, Array': function ArrayArray(q, p) {\n return _kldiv(matrix(q), matrix(p));\n },\n 'Matrix, Array': function MatrixArray(q, p) {\n return _kldiv(q, matrix(p));\n },\n 'Array, Matrix': function ArrayMatrix(q, p) {\n return _kldiv(matrix(q), p);\n },\n 'Matrix, Matrix': function MatrixMatrix(q, p) {\n return _kldiv(q, p);\n }\n });\n function _kldiv(q, p) {\n var plength = p.size().length;\n var qlength = q.size().length;\n if (plength > 1) {\n throw new Error('first object must be one dimensional');\n }\n if (qlength > 1) {\n throw new Error('second object must be one dimensional');\n }\n if (plength !== qlength) {\n throw new Error('Length of two vectors must be equal');\n }\n\n // Before calculation, apply normalization\n var sumq = sum(q);\n if (sumq === 0) {\n throw new Error('Sum of elements in first object must be non zero');\n }\n var sump = sum(p);\n if (sump === 0) {\n throw new Error('Sum of elements in second object must be non zero');\n }\n var qnorm = divide(q, sum(q));\n var pnorm = divide(p, sum(p));\n var result = sum(multiply(qnorm, map(dotDivide(qnorm, pnorm), x => log(x))));\n if (isNumeric(result)) {\n return result;\n } else {\n return Number.NaN;\n }\n }\n});", "import { deepForEach } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'multinomial';\nvar dependencies = ['typed', 'add', 'divide', 'multiply', 'factorial', 'isInteger', 'isPositive'];\nexport var createMultinomial = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide,\n multiply,\n factorial,\n isInteger,\n isPositive\n } = _ref;\n /**\n * Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities.\n *\n * multinomial takes one array of integers as an argument.\n * The following condition must be enforced: every ai <= 0\n *\n * Syntax:\n *\n * math.multinomial(a) // a is an array type\n *\n * Examples:\n *\n * math.multinomial([1,2,1]) // returns 12\n *\n * See also:\n *\n * combinations, factorial\n *\n * @param {number[] | BigNumber[]} a Integer numbers of objects in the subset\n * @return {Number | BigNumber} Multinomial coefficient.\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(a) {\n var sum = 0;\n var denom = 1;\n deepForEach(a, function (ai) {\n if (!isInteger(ai) || !isPositive(ai)) {\n throw new TypeError('Positive integer value expected in function multinomial');\n }\n sum = add(sum, ai);\n denom = multiply(denom, factorial(ai));\n });\n return divide(factorial(sum), denom);\n }\n });\n});", "import { isInteger } from '../../utils/number.js';\nimport { product } from '../../utils/product.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'permutations';\nvar dependencies = ['typed', 'factorial'];\nexport var createPermutations = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n factorial\n } = _ref;\n /**\n * Compute the number of ways of obtaining an ordered subset of `k` elements\n * from a set of `n` elements.\n *\n * Permutations only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.permutations(n)\n * math.permutations(n, k)\n *\n * Examples:\n *\n * math.permutations(5) // 120\n * math.permutations(5, 3) // 60\n *\n * See also:\n *\n * combinations, combinationsWithRep, factorial\n *\n * @param {number | BigNumber} n The number of objects in total\n * @param {number | BigNumber} [k] The number of objects in the subset\n * @return {number | BigNumber} The number of permutations\n */\n return typed(name, {\n 'number | BigNumber': factorial,\n 'number, number': function numberNumber(n, k) {\n if (!isInteger(n) || n < 0) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (!isInteger(k) || k < 0) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (k > n) {\n throw new TypeError('second argument k must be less than or equal to first argument n');\n }\n // Permute n objects, k at a time\n return product(n - k + 1, n);\n },\n 'BigNumber, BigNumber': function BigNumberBigNumber(n, k) {\n var result, i;\n if (!isPositiveInteger(n) || !isPositiveInteger(k)) {\n throw new TypeError('Positive integer value expected in function permutations');\n }\n if (k.gt(n)) {\n throw new TypeError('second argument k must be less than or equal to first argument n');\n }\n var one = n.mul(0).add(1);\n result = one;\n for (i = n.minus(k).plus(1); i.lte(n); i = i.plus(1)) {\n result = result.times(i);\n }\n return result;\n }\n\n // TODO: implement support for collection in permutations\n });\n});\n\n/**\n * Test whether BigNumber n is a positive integer\n * @param {BigNumber} n\n * @returns {boolean} isPositiveInteger\n */\nfunction isPositiveInteger(n) {\n return n.isInteger() && n.gte(0);\n}", "import { flatten } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isMatrix, isNumber } from '../../utils/is.js';\nimport { createRng } from './util/seededRNG.js';\nvar name = 'pickRandom';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createPickRandom = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Random pick one or more values from a one dimensional array.\n * Array elements are picked using a random function with uniform or weighted distribution.\n *\n * Syntax:\n *\n * math.pickRandom(array)\n * math.pickRandom(array, number)\n * math.pickRandom(array, weights)\n * math.pickRandom(array, number, weights)\n * math.pickRandom(array, weights, number)\n * math.pickRandom(array, { weights, number, elementWise })\n *\n * Examples:\n *\n * math.pickRandom([3, 6, 12, 2]) // returns one of the values in the array\n * math.pickRandom([3, 6, 12, 2], 2) // returns an array of two of the values in the array\n * math.pickRandom([3, 6, 12, 2], { number: 2 }) // returns an array of two of the values in the array\n * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1]) // returns one of the values in the array with weighted distribution\n * math.pickRandom([3, 6, 12, 2], 2, [1, 3, 2, 1]) // returns an array of two of the values in the array with weighted distribution\n * math.pickRandom([3, 6, 12, 2], [1, 3, 2, 1], 2) // returns an array of two of the values in the array with weighted distribution\n *\n * math.pickRandom([{x: 1.0, y: 2.0}, {x: 1.1, y: 2.0}], { elementWise: false })\n * // returns one of the items in the array\n *\n * See also:\n *\n * random, randomInt\n *\n * @param {Array | Matrix} array A one dimensional array\n * @param {Int} number An int or float\n * @param {Array | Matrix} weights An array of ints or floats\n * @return {number | Array} Returns a single random value from array when number is undefined.\n * Returns an array with the configured number of elements when number is defined.\n */\n return typed(name, {\n 'Array | Matrix': function ArrayMatrix(possibles) {\n return _pickRandom(possibles, {});\n },\n 'Array | Matrix, Object': function ArrayMatrixObject(possibles, options) {\n return _pickRandom(possibles, options);\n },\n 'Array | Matrix, number': function ArrayMatrixNumber(possibles, number) {\n return _pickRandom(possibles, {\n number\n });\n },\n 'Array | Matrix, Array | Matrix': function ArrayMatrixArrayMatrix(possibles, weights) {\n return _pickRandom(possibles, {\n weights\n });\n },\n 'Array | Matrix, Array | Matrix, number': function ArrayMatrixArrayMatrixNumber(possibles, weights, number) {\n return _pickRandom(possibles, {\n number,\n weights\n });\n },\n 'Array | Matrix, number, Array | Matrix': function ArrayMatrixNumberArrayMatrix(possibles, number, weights) {\n return _pickRandom(possibles, {\n number,\n weights\n });\n }\n });\n\n /**\n * @param {Array | Matrix} possibles\n * @param {{\n * number?: number,\n * weights?: Array | Matrix,\n * elementWise: boolean\n * }} options\n * @returns {number | Array}\n * @private\n */\n function _pickRandom(possibles, _ref2) {\n var {\n number,\n weights,\n elementWise = true\n } = _ref2;\n var single = typeof number === 'undefined';\n if (single) {\n number = 1;\n }\n var createMatrix = isMatrix(possibles) ? possibles.create : isMatrix(weights) ? weights.create : null;\n possibles = possibles.valueOf(); // get Array\n if (weights) {\n weights = weights.valueOf(); // get Array\n }\n if (elementWise === true) {\n possibles = flatten(possibles);\n weights = flatten(weights);\n }\n var totalWeights = 0;\n if (typeof weights !== 'undefined') {\n if (weights.length !== possibles.length) {\n throw new Error('Weights must have the same length as possibles');\n }\n for (var i = 0, len = weights.length; i < len; i++) {\n if (!isNumber(weights[i]) || weights[i] < 0) {\n throw new Error('Weights must be an array of positive numbers');\n }\n totalWeights += weights[i];\n }\n }\n var length = possibles.length;\n var result = [];\n var pick;\n while (result.length < number) {\n if (typeof weights === 'undefined') {\n pick = possibles[Math.floor(rng() * length)];\n } else {\n var randKey = rng() * totalWeights;\n for (var _i = 0, _len = possibles.length; _i < _len; _i++) {\n randKey -= weights[_i];\n if (randKey < 0) {\n pick = possibles[_i];\n break;\n }\n }\n }\n result.push(pick);\n }\n return single ? result[0] : createMatrix ? createMatrix(result) : result;\n }\n});", "import seedrandom from 'seedrandom';\nvar singletonRandom = /* #__PURE__ */seedrandom(Date.now());\nexport function createRng(randomSeed) {\n var random;\n\n // create a new random generator with given seed\n function setSeed(seed) {\n random = seed === null ? singletonRandom : seedrandom(String(seed));\n }\n\n // initialize a seeded pseudo random number generator with config's random seed\n setSeed(randomSeed);\n\n // wrapper function so the rng can be updated via generator\n function rng() {\n return random();\n }\n return rng;\n}", "import { factory } from '../../utils/factory.js';\nimport { isMatrix } from '../../utils/is.js';\nimport { createRng } from './util/seededRNG.js';\nimport { randomMatrix } from './util/randomMatrix.js';\nvar name = 'random';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createRandom = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Return a random number larger or equal to `min` and smaller than `max`\n * using a uniform distribution.\n *\n * Syntax:\n *\n * math.random() // generate a random number between 0 and 1\n * math.random(max) // generate a random number between 0 and max\n * math.random(min, max) // generate a random number between min and max\n * math.random(size) // generate a matrix with random numbers between 0 and 1\n * math.random(size, max) // generate a matrix with random numbers between 0 and max\n * math.random(size, min, max) // generate a matrix with random numbers between min and max\n *\n * Examples:\n *\n * math.random() // returns a random number between 0 and 1\n * math.random(100) // returns a random number between 0 and 100\n * math.random(30, 40) // returns a random number between 30 and 40\n * math.random([2, 3]) // returns a 2x3 matrix with random numbers between 0 and 1\n *\n * See also:\n *\n * randomInt, pickRandom\n *\n * @param {Array | Matrix} [size] If provided, an array or matrix with given\n * size and filled with random values is returned\n * @param {number} [min] Minimum boundary for the random value, included\n * @param {number} [max] Maximum boundary for the random value, excluded\n * @return {number | Array | Matrix} A random number\n */\n return typed(name, {\n '': () => _random(0, 1),\n number: max => _random(0, max),\n 'number, number': (min, max) => _random(min, max),\n 'Array | Matrix': size => _randomMatrix(size, 0, 1),\n 'Array | Matrix, number': (size, max) => _randomMatrix(size, 0, max),\n 'Array | Matrix, number, number': (size, min, max) => _randomMatrix(size, min, max)\n });\n function _randomMatrix(size, min, max) {\n var res = randomMatrix(size.valueOf(), () => _random(min, max));\n return isMatrix(size) ? size.create(res) : res;\n }\n function _random(min, max) {\n return min + rng() * (max - min);\n }\n});\n\n// number only implementation of random, no matrix support\n// TODO: there is quite some duplicate code in both createRandom and createRandomNumber, can we improve that?\nexport var createRandomNumber = /* #__PURE__ */factory(name, ['typed', 'config', '?on'], _ref2 => {\n var {\n typed,\n config,\n on,\n matrix\n } = _ref2;\n // seeded pseudo random number generator1\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n return typed(name, {\n '': () => _random(0, 1),\n number: max => _random(0, max),\n 'number, number': (min, max) => _random(min, max)\n });\n function _random(min, max) {\n return min + rng() * (max - min);\n }\n});", "/**\n * This is a util function for generating a random matrix recursively.\n * @param {number[]} size\n * @param {function} random\n * @returns {Array}\n */\nexport function randomMatrix(size, random) {\n var data = [];\n size = size.slice(0);\n if (size.length > 1) {\n for (var i = 0, length = size.shift(); i < length; i++) {\n data.push(randomMatrix(size, random));\n }\n } else {\n for (var _i = 0, _length = size.shift(); _i < _length; _i++) {\n data.push(random());\n }\n }\n return data;\n}", "import { factory } from '../../utils/factory.js';\nimport { randomMatrix } from './util/randomMatrix.js';\nimport { createRng } from './util/seededRNG.js';\nimport { isMatrix } from '../../utils/is.js';\nvar name = 'randomInt';\nvar dependencies = ['typed', 'config', '?on'];\nexport var createRandomInt = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n on\n } = _ref;\n // seeded pseudo random number generator\n var rng = createRng(config.randomSeed);\n if (on) {\n on('config', function (curr, prev) {\n if (curr.randomSeed !== prev.randomSeed) {\n rng = createRng(curr.randomSeed);\n }\n });\n }\n\n /**\n * Return a random integer number larger or equal to `min` and smaller than `max`\n * using a uniform distribution.\n *\n * Syntax:\n *\n * math.randomInt() // generate a random integer between 0 and 1\n * math.randomInt(max) // generate a random integer between 0 and max\n * math.randomInt(min, max) // generate a random integer between min and max\n * math.randomInt(size) // generate a matrix with random integer between 0 and 1\n * math.randomInt(size, max) // generate a matrix with random integer between 0 and max\n * math.randomInt(size, min, max) // generate a matrix with random integer between min and max\n *\n * Examples:\n *\n * math.randomInt(100) // returns a random integer between 0 and 100\n * math.randomInt(30, 40) // returns a random integer between 30 and 40\n * math.randomInt([2, 3]) // returns a 2x3 matrix with random integers between 0 and 1\n *\n * See also:\n *\n * random, pickRandom\n *\n * @param {Array | Matrix} [size] If provided, an array or matrix with given\n * size and filled with random values is returned\n * @param {number} [min] Minimum boundary for the random value, included\n * @param {number} [max] Maximum boundary for the random value, excluded\n * @return {number | Array | Matrix} A random integer value\n */\n return typed(name, {\n '': () => _randomInt(0, 1),\n number: max => _randomInt(0, max),\n 'number, number': (min, max) => _randomInt(min, max),\n 'Array | Matrix': size => _randomIntMatrix(size, 0, 1),\n 'Array | Matrix, number': (size, max) => _randomIntMatrix(size, 0, max),\n 'Array | Matrix, number, number': (size, min, max) => _randomIntMatrix(size, min, max)\n });\n function _randomIntMatrix(size, min, max) {\n var res = randomMatrix(size.valueOf(), () => _randomInt(min, max));\n return isMatrix(size) ? size.create(res) : res;\n }\n function _randomInt(min, max) {\n return Math.floor(min + rng() * (max - min));\n }\n});", "import { factory } from '../../utils/factory.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'stirlingS2';\nvar dependencies = ['typed', 'addScalar', 'subtractScalar', 'multiplyScalar', 'divideScalar', 'pow', 'factorial', 'combinations', 'isNegative', 'isInteger', 'number', '?bignumber', 'larger'];\nexport var createStirlingS2 = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n subtractScalar,\n multiplyScalar,\n divideScalar,\n pow,\n factorial,\n combinations,\n isNegative,\n isInteger,\n number,\n bignumber,\n larger\n } = _ref;\n var smallCache = [];\n var bigCache = [];\n /**\n * The Stirling numbers of the second kind, counts the number of ways to partition\n * a set of n labelled objects into k nonempty unlabelled subsets.\n * stirlingS2 only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * If n = k or k = 1 <= n, then s(n,k) = 1\n * If k = 0 < n, then s(n,k) = 0\n *\n * Note that if either n or k is supplied as a BigNumber, the result will be\n * as well.\n *\n * Syntax:\n *\n * math.stirlingS2(n, k)\n *\n * Examples:\n *\n * math.stirlingS2(5, 3) //returns 25\n *\n * See also:\n *\n * bellNumbers\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @param {Number | BigNumber} k Number of objects in the subset\n * @return {Number | BigNumber} S(n,k)\n */\n return typed(name, {\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(n, k) {\n if (!isInteger(n) || isNegative(n) || !isInteger(k) || isNegative(k)) {\n throw new TypeError('Non-negative integer value expected in function stirlingS2');\n } else if (larger(k, n)) {\n throw new TypeError('k must be less than or equal to n in function stirlingS2');\n }\n var big = !(isNumber(n) && isNumber(k));\n var cache = big ? bigCache : smallCache;\n var make = big ? bignumber : number;\n var nn = number(n);\n var nk = number(k);\n /* See if we already have the value: */\n if (cache[nn] && cache[nn].length > nk) {\n return cache[nn][nk];\n }\n /* Fill the cache */\n for (var m = 0; m <= nn; ++m) {\n if (!cache[m]) {\n cache[m] = [m === 0 ? make(1) : make(0)];\n }\n if (m === 0) continue;\n var row = cache[m];\n var prev = cache[m - 1];\n for (var i = row.length; i <= m && i <= nk; ++i) {\n if (i === m) {\n row[i] = 1;\n } else {\n row[i] = addScalar(multiplyScalar(make(i), prev[i]), prev[i - 1]);\n }\n }\n }\n return cache[nn][nk];\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'bellNumbers';\nvar dependencies = ['typed', 'addScalar', 'isNegative', 'isInteger', 'stirlingS2'];\nexport var createBellNumbers = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n isNegative,\n isInteger,\n stirlingS2\n } = _ref;\n /**\n * The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S.\n * bellNumbers only takes integer arguments.\n * The following condition must be enforced: n >= 0\n *\n * Syntax:\n *\n * math.bellNumbers(n)\n *\n * Examples:\n *\n * math.bellNumbers(3) // returns 5\n * math.bellNumbers(8) // returns 4140\n *\n * See also:\n *\n * stirlingS2\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @return {Number | BigNumber} B(n)\n */\n return typed(name, {\n 'number | BigNumber': function numberBigNumber(n) {\n if (!isInteger(n) || isNegative(n)) {\n throw new TypeError('Non-negative integer value expected in function bellNumbers');\n }\n\n // Sum (k=0, n) S(n,k).\n var result = 0;\n for (var i = 0; i <= n; i++) {\n result = addScalar(result, stirlingS2(n, i));\n }\n return result;\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'catalan';\nvar dependencies = ['typed', 'addScalar', 'divideScalar', 'multiplyScalar', 'combinations', 'isNegative', 'isInteger'];\nexport var createCatalan = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n divideScalar,\n multiplyScalar,\n combinations,\n isNegative,\n isInteger\n } = _ref;\n /**\n * The Catalan Numbers enumerate combinatorial structures of many different types.\n * catalan only takes integer arguments.\n * The following condition must be enforced: n >= 0\n *\n * Syntax:\n *\n * math.catalan(n)\n *\n * Examples:\n *\n * math.catalan(3) // returns 5\n * math.catalan(8) // returns 1430\n *\n * See also:\n *\n * bellNumbers\n *\n * @param {Number | BigNumber} n nth Catalan number\n * @return {Number | BigNumber} Cn(n)\n */\n return typed(name, {\n 'number | BigNumber': function numberBigNumber(n) {\n if (!isInteger(n) || isNegative(n)) {\n throw new TypeError('Non-negative integer value expected in function catalan');\n }\n return divideScalar(combinations(multiplyScalar(n, 2), n), addScalar(n, 1));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'composition';\nvar dependencies = ['typed', 'addScalar', 'combinations', 'isNegative', 'isPositive', 'isInteger', 'larger'];\nexport var createComposition = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n addScalar,\n combinations,\n isPositive,\n isNegative,\n isInteger,\n larger\n } = _ref;\n /**\n * The composition counts of n into k parts.\n *\n * composition only takes integer arguments.\n * The following condition must be enforced: k <= n.\n *\n * Syntax:\n *\n * math.composition(n, k)\n *\n * Examples:\n *\n * math.composition(5, 3) // returns 6\n *\n * See also:\n *\n * combinations\n *\n * @param {Number | BigNumber} n Total number of objects in the set\n * @param {Number | BigNumber} k Number of objects in the subset\n * @return {Number | BigNumber} Returns the composition counts of n into k parts.\n */\n return typed(name, {\n 'number | BigNumber, number | BigNumber': function numberBigNumberNumberBigNumber(n, k) {\n if (!isInteger(n) || !isPositive(n) || !isInteger(k) || !isPositive(k)) {\n throw new TypeError('Positive integer value expected in function composition');\n } else if (larger(k, n)) {\n throw new TypeError('k must be less than or equal to n in function composition');\n }\n return combinations(addScalar(n, -1), addScalar(k, -1));\n }\n });\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'leafCount';\nvar dependencies = ['parse', 'typed'];\nexport var createLeafCount = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n typed\n } = _ref;\n // This does the real work, but we don't have to recurse through\n // a typed call if we separate it out\n function countLeaves(node) {\n var count = 0;\n node.forEach(n => {\n count += countLeaves(n);\n });\n return count || 1;\n }\n\n /**\n * Gives the number of \"leaf nodes\" in the parse tree of the given expression\n * A leaf node is one that has no subexpressions, essentially either a\n * symbol or a constant. Note that `5!` has just one leaf, the '5'; the\n * unary factorial operator does not add a leaf. On the other hand,\n * function symbols do add leaves, so `sin(x)/cos(x)` has four leaves.\n *\n * The `simplify()` function should generally not increase the `leafCount()`\n * of an expression, although currently there is no guarantee that it never\n * does so. In many cases, `simplify()` reduces the leaf count.\n *\n * Syntax:\n *\n * math.leafCount(expr)\n *\n * Examples:\n *\n * math.leafCount('x') // 1\n * math.leafCount(math.parse('a*d-b*c')) // 4\n * math.leafCount('[a,b;c,d][0,1]') // 6\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to count the leaves of\n *\n * @return {number} The number of leaves of `expr`\n *\n */\n return typed(name, {\n Node: function Node(expr) {\n return countLeaves(expr);\n }\n });\n});", "import { isParenthesisNode } from '../../utils/is.js';\nimport { isConstantNode, isVariableNode, isNumericNode, isConstantExpression } from './simplify/wildcards.js';\nimport { factory } from '../../utils/factory.js';\nimport { createUtil } from './simplify/util.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { createEmptyMap, createMap } from '../../utils/map.js';\nvar name = 'simplify';\nvar dependencies = ['config', 'typed', 'parse', 'add', 'subtract', 'multiply', 'divide', 'pow', 'isZero', 'equal', 'resolve', 'simplifyConstant', 'simplifyCore', '?fraction', '?bignumber', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createSimplify = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n parse,\n add,\n subtract,\n multiply,\n divide,\n pow,\n isZero,\n equal,\n resolve,\n simplifyConstant,\n simplifyCore,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n var {\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n unflattenr,\n unflattenl,\n createMakeNodeFunction,\n defaultContext,\n realContext,\n positiveContext\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * Simplify an expression tree.\n *\n * A list of rules are applied to an expression, repeating over the list until\n * no further changes are made.\n * It's possible to pass a custom set of rules to the function as second\n * argument. A rule can be specified as an object, string, or function:\n *\n * const rules = [\n * { l: 'n1*n3 + n2*n3', r: '(n1+n2)*n3' },\n * 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n * function (node) {\n * // ... return a new node or return the node unchanged\n * return node\n * }\n * ]\n *\n * String and object rules consist of a left and right pattern. The left is\n * used to match against the expression and the right determines what matches\n * are replaced with. The main difference between a pattern and a normal\n * expression is that variables starting with the following characters are\n * interpreted as wildcards:\n *\n * - 'n' - Matches any node [Node]\n * - 'c' - Matches a constant literal (5 or 3.2) [ConstantNode]\n * - 'cl' - Matches a constant literal; same as c [ConstantNode]\n * - 'cd' - Matches a decimal literal (5 or -3.2) [ConstantNode or unaryMinus wrapping a ConstantNode]\n * - 'ce' - Matches a constant expression (-5 or \u221A3) [Expressions consisting of only ConstantNodes, functions, and operators]\n * - 'v' - Matches a variable; anything not matched by c (-5 or x) [Node that is not a ConstantNode]\n * - 'vl' - Matches a variable literal (x or y) [SymbolNode]\n * - 'vd' - Matches a non-decimal expression; anything not matched by cd (x or \u221A3) [Node that is not a ConstantNode or unaryMinus that is wrapping a ConstantNode]\n * - 've' - Matches a variable expression; anything not matched by ce (x or 2x) [Expressions that contain a SymbolNode or other non-constant term]\n *\n * The default list of rules is exposed on the function as `simplify.rules`\n * and can be used as a basis to built a set of custom rules. Note that since\n * the `simplifyCore` function is in the default list of rules, by default\n * simplify will convert any function calls in the expression that have\n * operator equivalents to their operator forms.\n *\n * To specify a rule as a string, separate the left and right pattern by '->'\n * When specifying a rule as an object, the following keys are meaningful:\n * - l - the left pattern\n * - r - the right pattern\n * - s - in lieu of l and r, the string form that is broken at -> to give them\n * - repeat - whether to repeat this rule until the expression stabilizes\n * - assuming - gives a context object, as in the 'context' option to\n * simplify. Every property in the context object must match the current\n * context in order, or else the rule will not be applied.\n * - imposeContext - gives a context object, as in the 'context' option to\n * simplify. Any settings specified will override the incoming context\n * for all matches of this rule.\n *\n * For more details on the theory, see:\n *\n * - [Strategies for simplifying math expressions (Stackoverflow)](https://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions)\n * - [Symbolic computation - Simplification (Wikipedia)](https://en.wikipedia.org/wiki/Symbolic_computation#Simplification)\n *\n * An optional `options` argument can be passed as last argument of `simplify`.\n * Currently available options (defaults in parentheses):\n * - `consoleDebug` (false): whether to write the expression being simplified\n * and any changes to it, along with the rule responsible, to console\n * - `context` (simplify.defaultContext): an object giving properties of\n * each operator, which determine what simplifications are allowed. The\n * currently meaningful properties are commutative, associative,\n * total (whether the operation is defined for all arguments), and\n * trivial (whether the operation applied to a single argument leaves\n * that argument unchanged). The default context is very permissive and\n * allows almost all simplifications. Only properties differing from\n * the default need to be specified; the default context is used as a\n * fallback. Additional contexts `simplify.realContext` and\n * `simplify.positiveContext` are supplied to cause simplify to perform\n * just simplifications guaranteed to preserve all values of the expression\n * assuming all variables and subexpressions are real numbers or\n * positive real numbers, respectively. (Note that these are in some cases\n * more restrictive than the default context; for example, the default\n * context will allow `x/x` to simplify to 1, whereas\n * `simplify.realContext` will not, as `0/0` is not equal to 1.)\n * - `exactFractions` (true): whether to try to convert all constants to\n * exact rational numbers.\n * - `fractionsLimit` (10000): when `exactFractions` is true, constants will\n * be expressed as fractions only when both numerator and denominator\n * are smaller than `fractionsLimit`.\n *\n * Syntax:\n *\n * math.simplify(expr)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules, scope)\n * math.simplify(expr, rules, scope, options)\n * math.simplify(expr, scope)\n * math.simplify(expr, scope, options)\n *\n * Examples:\n *\n * math.simplify('2 * 1 * x ^ (2 - 1)') // Node \"2 * x\"\n * math.simplify('2 * 3 * x', {x: 4}) // Node \"24\"\n * const f = math.parse('2 * 1 * x ^ (2 - 1)')\n * math.simplify(f) // Node \"2 * x\"\n * math.simplify('0.4 * x', {}, {exactFractions: true}) // Node \"x * 2 / 5\"\n * math.simplify('0.4 * x', {}, {exactFractions: false}) // Node \"0.4 * x\"\n *\n * See also:\n *\n * simplifyCore, derivative, evaluate, parse, rationalize, resolve\n *\n * @param {Node | string} expr\n * The expression to be simplified\n * @param {SimplifyRule[]} [rules]\n * Optional list with custom rules\n * @param {Object} [scope] Optional scope with variables\n * @param {SimplifyOptions} [options] Optional configuration settings\n * @return {Node} Returns the simplified form of `expr`\n */\n typed.addConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n var simplify = typed('simplify', {\n Node: _simplify,\n 'Node, Map': (expr, scope) => _simplify(expr, false, scope),\n 'Node, Map, Object': (expr, scope, options) => _simplify(expr, false, scope, options),\n 'Node, Array': _simplify,\n 'Node, Array, Map': _simplify,\n 'Node, Array, Map, Object': _simplify\n });\n typed.removeConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n simplify.defaultContext = defaultContext;\n simplify.realContext = realContext;\n simplify.positiveContext = positiveContext;\n function removeParens(node) {\n return node.transform(function (node, path, parent) {\n return isParenthesisNode(node) ? removeParens(node.content) : node;\n });\n }\n\n // All constants that are allowed in rules\n var SUPPORTED_CONSTANTS = {\n true: true,\n false: true,\n e: true,\n i: true,\n Infinity: true,\n LN2: true,\n LN10: true,\n LOG2E: true,\n LOG10E: true,\n NaN: true,\n phi: true,\n pi: true,\n SQRT1_2: true,\n SQRT2: true,\n tau: true\n // null: false,\n // undefined: false,\n // version: false,\n };\n\n // Array of strings, used to build the ruleSet.\n // Each l (left side) and r (right side) are parsed by\n // the expression parser into a node tree.\n // Left hand sides are matched to subtrees within the\n // expression to be parsed and replaced with the right\n // hand side.\n // TODO: Add support for constraints on constants (either in the form of a '=' expression or a callback [callback allows things like comparing symbols alphabetically])\n // To evaluate lhs constants for rhs constants, use: { l: 'c1+c2', r: 'c3', evaluate: 'c3 = c1 + c2' }. Multiple assignments are separated by ';' in block format.\n // It is possible to get into an infinite loop with conflicting rules\n simplify.rules = [simplifyCore,\n // { l: 'n+0', r: 'n' }, // simplifyCore\n // { l: 'n^0', r: '1' }, // simplifyCore\n // { l: '0*n', r: '0' }, // simplifyCore\n // { l: 'n/n', r: '1'}, // simplifyCore\n // { l: 'n^1', r: 'n' }, // simplifyCore\n // { l: '+n1', r:'n1' }, // simplifyCore\n // { l: 'n--n1', r:'n+n1' }, // simplifyCore\n {\n l: 'log(e)',\n r: '1'\n },\n // temporary rules\n // Note initially we tend constants to the right because like-term\n // collection prefers the left, and we would rather collect nonconstants\n {\n s: 'n-n1 -> n+-n1',\n // temporarily replace 'subtract' so we can further flatten the 'add' operator\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n-n -> 0',\n // partial alternative when we can't always subtract\n assuming: {\n subtract: {\n total: false\n }\n }\n }, {\n s: '-(cl*v) -> v * (-cl)',\n // make non-constant terms positive\n assuming: {\n multiply: {\n commutative: true\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(cl*v) -> (-cl) * v',\n // non-commutative version, part 1\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(v*cl) -> v * (-cl)',\n // non-commutative version, part 2\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n l: '-(n1/n2)',\n r: '-n1/n2'\n }, {\n l: '-v',\n r: 'v * (-1)'\n },\n // finish making non-constant terms positive\n {\n l: '(n1 + n2)*(-1)',\n r: 'n1*(-1) + n2*(-1)',\n repeat: true\n },\n // expand negations to achieve as much sign cancellation as possible\n {\n l: 'n/n1^n2',\n r: 'n*n1^-n2'\n },\n // temporarily replace 'divide' so we can further flatten the 'multiply' operator\n {\n l: 'n/n1',\n r: 'n*n1^-1'\n }, {\n s: '(n1*n2)^n3 -> n1^n3 * n2^n3',\n assuming: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: '(n1*n2)^(-1) -> n2^(-1) * n1^(-1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n },\n // expand nested exponentiation\n {\n s: '(n ^ n1) ^ n2 -> n ^ (n1 * n2)',\n assuming: {\n divide: {\n total: true\n }\n } // 1/(1/n) = n needs 1/n to exist\n },\n // collect like factors; into a sum, only do this for nonconstants\n {\n l: ' vd * ( vd * n1 + n2)',\n r: 'vd^2 * n1 + vd * n2'\n }, {\n s: ' vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2',\n assuming: {\n divide: {\n total: true\n }\n } // v*1/v = v^(1+-1) needs 1/v\n }, {\n s: 'vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n s: 'vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n l: 'n*n',\n r: 'n^2'\n }, {\n s: 'n * n^n1 -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n }\n } // n*1/n = n^(-1+1) needs 1/n\n }, {\n s: 'n^n1 * n^n2 -> n^(n1+n2)',\n assuming: {\n divide: {\n total: true\n }\n } // ditto for n^2*1/n^2\n },\n // Unfortunately, to deal with more complicated cancellations, it\n // becomes necessary to simplify constants twice per pass. It's not\n // terribly expensive compared to matching rules, so this should not\n // pose a performance problem.\n simplifyConstant,\n // First: before collecting like terms\n\n // collect like terms\n {\n s: 'n+n -> 2*n',\n assuming: {\n add: {\n total: true\n }\n } // 2 = 1 + 1 needs to exist\n }, {\n l: 'n+-n',\n r: '0'\n }, {\n l: 'vd*n + vd',\n r: 'vd*(n+1)'\n },\n // NOTE: leftmost position is special:\n {\n l: 'n3*n1 + n3*n2',\n r: 'n3*(n1+n2)'\n },\n // All sub-monomials tried there.\n {\n l: 'n3^(-n4)*n1 + n3 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+1) *n2)'\n }, {\n l: 'n3^(-n4)*n1 + n3^n5 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+n5)*n2)'\n },\n // noncommutative additional cases (term collection & factoring)\n {\n s: 'n*vd + vd -> (n+1)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'vd + n*vd -> (1+n)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n^n1 * n -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n l: 'n*cd + cd',\n r: '(n+1)*cd'\n }, {\n s: 'cd*n + cd -> cd*(n+1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'cd + cd*n -> cd*(1+n)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, simplifyConstant,\n // Second: before returning expressions to \"standard form\"\n\n // make factors positive (and undo 'make non-constant terms positive')\n {\n s: '(-n)*n1 -> -(n*n1)',\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n1*(-n) -> -(n1*n)',\n // in case * non-commutative\n assuming: {\n subtract: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n },\n // final ordering of constants\n {\n s: 'ce+ve -> ve+ce',\n assuming: {\n add: {\n commutative: true\n }\n },\n imposeContext: {\n add: {\n commutative: false\n }\n }\n }, {\n s: 'vd*cd -> cd*vd',\n assuming: {\n multiply: {\n commutative: true\n }\n },\n imposeContext: {\n multiply: {\n commutative: false\n }\n }\n },\n // undo temporary rules\n // { l: '(-1) * n', r: '-n' }, // #811 added test which proved this is redundant\n {\n l: 'n+-n1',\n r: 'n-n1'\n },\n // undo replace 'subtract'\n {\n l: 'n+-(n1)',\n r: 'n-(n1)'\n }, {\n s: 'n*(n1^-1) -> n/n1',\n // undo replace 'divide'; for * commutative\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n*n1^-n2 -> n/n1^n2',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n^-1 -> 1/n',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n l: 'n^1',\n r: 'n'\n },\n // can be produced by power cancellation\n {\n s: 'n*(n1/n2) -> (n*n1)/n2',\n // '*' before '/'\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n s: 'n-(n1+n2) -> n-n1-n2',\n // '-' before '+'\n assuming: {\n addition: {\n associative: true,\n commutative: true\n }\n }\n },\n // { l: '(n1/n2)/n3', r: 'n1/(n2*n3)' },\n // { l: '(n*n1)/(n*n2)', r: 'n1/n2' },\n\n // simplifyConstant can leave an extra factor of 1, which can always\n // be eliminated, since the identity always commutes\n {\n l: '1*n',\n r: 'n',\n imposeContext: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: 'n1/(n2/n3) -> (n1*n3)/n2',\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n l: 'n1/(-n2)',\n r: '-n1/n2'\n }];\n\n /**\n * Takes any rule object as allowed by the specification in simplify\n * and puts it in a standard form used by applyRule\n */\n function _canonicalizeRule(ruleObject, context) {\n var newRule = {};\n if (ruleObject.s) {\n var lr = ruleObject.s.split('->');\n if (lr.length === 2) {\n newRule.l = lr[0];\n newRule.r = lr[1];\n } else {\n throw SyntaxError('Could not parse rule: ' + ruleObject.s);\n }\n } else {\n newRule.l = ruleObject.l;\n newRule.r = ruleObject.r;\n }\n newRule.l = removeParens(parse(newRule.l));\n newRule.r = removeParens(parse(newRule.r));\n for (var prop of ['imposeContext', 'repeat', 'assuming']) {\n if (prop in ruleObject) {\n newRule[prop] = ruleObject[prop];\n }\n }\n if (ruleObject.evaluate) {\n newRule.evaluate = parse(ruleObject.evaluate);\n }\n if (isAssociative(newRule.l, context)) {\n var nonCommutative = !isCommutative(newRule.l, context);\n var leftExpandsym;\n // Gen. the LHS placeholder used in this NC-context specific expansion rules\n if (nonCommutative) leftExpandsym = _getExpandPlaceholderSymbol();\n var makeNode = createMakeNodeFunction(newRule.l);\n var expandsym = _getExpandPlaceholderSymbol();\n newRule.expanded = {};\n newRule.expanded.l = makeNode([newRule.l, expandsym]);\n // Push the expandsym into the deepest possible branch.\n // This helps to match the newRule against nodes returned from getSplits() later on.\n flatten(newRule.expanded.l, context);\n unflattenr(newRule.expanded.l, context);\n newRule.expanded.r = makeNode([newRule.r, expandsym]);\n\n // In and for a non-commutative context, attempting with yet additional expansion rules makes\n // way for more matches cases of multi-arg expressions; such that associative rules (such as\n // 'n*n -> n^2') can be applied to exprs. such as 'a * b * b' and 'a * b * b * a'.\n if (nonCommutative) {\n // 'Non-commutative' 1: LHS (placeholder) only\n newRule.expandedNC1 = {};\n newRule.expandedNC1.l = makeNode([leftExpandsym, newRule.l]);\n newRule.expandedNC1.r = makeNode([leftExpandsym, newRule.r]);\n // 'Non-commutative' 2: farmost LHS and RHS placeholders\n newRule.expandedNC2 = {};\n newRule.expandedNC2.l = makeNode([leftExpandsym, newRule.expanded.l]);\n newRule.expandedNC2.r = makeNode([leftExpandsym, newRule.expanded.r]);\n }\n }\n return newRule;\n }\n\n /**\n * Parse the string array of rules into nodes\n *\n * Example syntax for rules:\n *\n * Position constants to the left in a product:\n * { l: 'n1 * c1', r: 'c1 * n1' }\n * n1 is any Node, and c1 is a ConstantNode.\n *\n * Apply difference of squares formula:\n * { l: '(n1 - n2) * (n1 + n2)', r: 'n1^2 - n2^2' }\n * n1, n2 mean any Node.\n *\n * Short hand notation:\n * 'n1 * c1 -> c1 * n1'\n */\n function _buildRules(rules, context) {\n // Array of rules to be used to simplify expressions\n var ruleSet = [];\n for (var i = 0; i < rules.length; i++) {\n var rule = rules[i];\n var newRule = void 0;\n var ruleType = typeof rule;\n switch (ruleType) {\n case 'string':\n rule = {\n s: rule\n };\n /* falls through */\n case 'object':\n newRule = _canonicalizeRule(rule, context);\n break;\n case 'function':\n newRule = rule;\n break;\n default:\n throw TypeError('Unsupported type of rule: ' + ruleType);\n }\n // console.log('Adding rule: ' + rules[i])\n // console.log(newRule)\n ruleSet.push(newRule);\n }\n return ruleSet;\n }\n var _lastsym = 0;\n function _getExpandPlaceholderSymbol() {\n return new SymbolNode('_p' + _lastsym++);\n }\n function _simplify(expr, rules) {\n var scope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createEmptyMap();\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var debug = options.consoleDebug;\n rules = _buildRules(rules || simplify.rules, options.context);\n var res = resolve(expr, scope);\n res = removeParens(res);\n var visited = {};\n var str = res.toString({\n parenthesis: 'all'\n });\n while (!visited[str]) {\n visited[str] = true;\n _lastsym = 0; // counter for placeholder symbols\n var laststr = str;\n if (debug) console.log('Working on: ', str);\n for (var i = 0; i < rules.length; i++) {\n var rulestr = '';\n if (typeof rules[i] === 'function') {\n res = rules[i](res, options);\n if (debug) rulestr = rules[i].name;\n } else {\n flatten(res, options.context);\n res = applyRule(res, rules[i], options.context);\n if (debug) {\n rulestr = \"\".concat(rules[i].l.toString(), \" -> \").concat(rules[i].r.toString());\n }\n }\n if (debug) {\n var newstr = res.toString({\n parenthesis: 'all'\n });\n if (newstr !== laststr) {\n console.log('Applying', rulestr, 'produced', newstr);\n laststr = newstr;\n }\n }\n /* Use left-heavy binary tree internally,\n * since custom rule functions may expect it\n */\n unflattenl(res, options.context);\n }\n str = res.toString({\n parenthesis: 'all'\n });\n }\n return res;\n }\n function mapRule(nodes, rule, context) {\n var resNodes = nodes;\n if (nodes) {\n for (var i = 0; i < nodes.length; ++i) {\n var newNode = applyRule(nodes[i], rule, context);\n if (newNode !== nodes[i]) {\n if (resNodes === nodes) {\n resNodes = nodes.slice();\n }\n resNodes[i] = newNode;\n }\n }\n }\n return resNodes;\n }\n\n /**\n * Returns a simplfied form of node, or the original node if no simplification was possible.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object | Function} rule\n * @param {Object} context -- information about assumed properties of operators\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The simplified form of `expr`, or the original node if no simplification was possible.\n */\n function applyRule(node, rule, context) {\n // console.log('Entering applyRule(\"', rule.l.toString({parenthesis:'all'}), '->', rule.r.toString({parenthesis:'all'}), '\",', node.toString({parenthesis:'all'}),')')\n\n // check that the assumptions for this rule are satisfied by the current\n // context:\n if (rule.assuming) {\n for (var symbol in rule.assuming) {\n for (var property in rule.assuming[symbol]) {\n if (hasProperty(symbol, property, context) !== rule.assuming[symbol][property]) {\n return node;\n }\n }\n }\n }\n var mergedContext = mergeContext(rule.imposeContext, context);\n\n // Do not clone node unless we find a match\n var res = node;\n\n // First replace our child nodes with their simplified versions\n // If a child could not be simplified, applying the rule to it\n // will have no effect since the node is returned unchanged\n if (res instanceof OperatorNode || res instanceof FunctionNode) {\n var newArgs = mapRule(res.args, rule, context);\n if (newArgs !== res.args) {\n res = res.clone();\n res.args = newArgs;\n }\n } else if (res instanceof ParenthesisNode) {\n if (res.content) {\n var newContent = applyRule(res.content, rule, context);\n if (newContent !== res.content) {\n res = new ParenthesisNode(newContent);\n }\n }\n } else if (res instanceof ArrayNode) {\n var newItems = mapRule(res.items, rule, context);\n if (newItems !== res.items) {\n res = new ArrayNode(newItems);\n }\n } else if (res instanceof AccessorNode) {\n var newObj = res.object;\n if (res.object) {\n newObj = applyRule(res.object, rule, context);\n }\n var newIndex = res.index;\n if (res.index) {\n newIndex = applyRule(res.index, rule, context);\n }\n if (newObj !== res.object || newIndex !== res.index) {\n res = new AccessorNode(newObj, newIndex);\n }\n } else if (res instanceof IndexNode) {\n var newDims = mapRule(res.dimensions, rule, context);\n if (newDims !== res.dimensions) {\n res = new IndexNode(newDims);\n }\n } else if (res instanceof ObjectNode) {\n var changed = false;\n var newProps = {};\n for (var prop in res.properties) {\n newProps[prop] = applyRule(res.properties[prop], rule, context);\n if (newProps[prop] !== res.properties[prop]) {\n changed = true;\n }\n }\n if (changed) {\n res = new ObjectNode(newProps);\n }\n }\n\n // Try to match a rule against this node\n var repl = rule.r;\n var matches = _ruleMatch(rule.l, res, mergedContext)[0];\n\n // If the rule is associative operator, we can try matching it while allowing additional terms.\n // This allows us to match rules like 'n+n' to the expression '(1+x)+x' or even 'x+1+x' if the operator is commutative.\n if (!matches && rule.expanded) {\n repl = rule.expanded.r;\n matches = _ruleMatch(rule.expanded.l, res, mergedContext)[0];\n }\n // Additional, non-commutative context expansion-rules\n if (!matches && rule.expandedNC1) {\n repl = rule.expandedNC1.r;\n matches = _ruleMatch(rule.expandedNC1.l, res, mergedContext)[0];\n if (!matches) {\n // Existence of NC1 implies NC2\n repl = rule.expandedNC2.r;\n matches = _ruleMatch(rule.expandedNC2.l, res, mergedContext)[0];\n }\n }\n if (matches) {\n // const before = res.toString({parenthesis: 'all'})\n\n // Create a new node by cloning the rhs of the matched rule\n // we keep any implicit multiplication state if relevant\n var implicit = res.implicit;\n res = repl.clone();\n if (implicit && 'implicit' in repl) {\n res.implicit = true;\n }\n\n // Replace placeholders with their respective nodes without traversing deeper into the replaced nodes\n res = res.transform(function (node) {\n if (node.isSymbolNode && hasOwnProperty(matches.placeholders, node.name)) {\n return matches.placeholders[node.name].clone();\n } else {\n return node;\n }\n });\n\n // const after = res.toString({parenthesis: 'all'})\n // console.log('Simplified ' + before + ' to ' + after)\n }\n if (rule.repeat && res !== node) {\n res = applyRule(res, rule, context);\n }\n return res;\n }\n\n /**\n * Get (binary) combinations of a flattened binary node\n * e.g. +(node1, node2, node3) -> [\n * +(node1, +(node2, node3)),\n * +(node2, +(node1, node3)),\n * +(node3, +(node1, node2))]\n *\n */\n function getSplits(node, context) {\n var res = [];\n var right, rightArgs;\n var makeNode = createMakeNodeFunction(node);\n if (isCommutative(node, context)) {\n for (var i = 0; i < node.args.length; i++) {\n rightArgs = node.args.slice(0);\n rightArgs.splice(i, 1);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([node.args[i], right]));\n }\n } else {\n // Keep order, but try all parenthesizations\n for (var _i = 1; _i < node.args.length; _i++) {\n var left = node.args[0];\n if (_i > 1) {\n left = makeNode(node.args.slice(0, _i));\n }\n rightArgs = node.args.slice(_i);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([left, right]));\n }\n }\n return res;\n }\n\n /**\n * Returns the set union of two match-placeholders or null if there is a conflict.\n */\n function mergeMatch(match1, match2) {\n var res = {\n placeholders: {}\n };\n\n // Some matches may not have placeholders; this is OK\n if (!match1.placeholders && !match2.placeholders) {\n return res;\n } else if (!match1.placeholders) {\n return match2;\n } else if (!match2.placeholders) {\n return match1;\n }\n\n // Placeholders with the same key must match exactly\n for (var key in match1.placeholders) {\n if (hasOwnProperty(match1.placeholders, key)) {\n res.placeholders[key] = match1.placeholders[key];\n if (hasOwnProperty(match2.placeholders, key)) {\n if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) {\n return null;\n }\n }\n }\n }\n for (var _key in match2.placeholders) {\n if (hasOwnProperty(match2.placeholders, _key)) {\n res.placeholders[_key] = match2.placeholders[_key];\n }\n }\n return res;\n }\n\n /**\n * Combine two lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n */\n function combineChildMatches(list1, list2) {\n var res = [];\n if (list1.length === 0 || list2.length === 0) {\n return res;\n }\n var merged;\n for (var i1 = 0; i1 < list1.length; i1++) {\n for (var i2 = 0; i2 < list2.length; i2++) {\n merged = mergeMatch(list1[i1], list2[i2]);\n if (merged) {\n res.push(merged);\n }\n }\n }\n return res;\n }\n\n /**\n * Combine multiple lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n * Returns a list of unique matches.\n */\n function mergeChildMatches(childMatches) {\n if (childMatches.length === 0) {\n return childMatches;\n }\n var sets = childMatches.reduce(combineChildMatches);\n var uniqueSets = [];\n var unique = {};\n for (var i = 0; i < sets.length; i++) {\n var s = JSON.stringify(sets[i]);\n if (!unique[s]) {\n unique[s] = true;\n uniqueSets.push(sets[i]);\n }\n }\n return uniqueSets;\n }\n\n /**\n * Determines whether node matches rule.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} rule\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} context -- provides assumed properties of operators\n * @param {Boolean} isSplit -- whether we are in process of splitting an\n * n-ary operator node into possible binary combinations.\n * Defaults to false.\n * @return {Object} Information about the match, if it exists.\n */\n function _ruleMatch(rule, node, context, isSplit) {\n // console.log('Entering _ruleMatch(' + JSON.stringify(rule) + ', ' + JSON.stringify(node) + ')')\n // console.log('rule = ' + rule)\n // console.log('node = ' + node)\n\n // console.log('Entering _ruleMatch(', rule.toString({parenthesis:'all'}), ', ', node.toString({parenthesis:'all'}), ', ', context, ')')\n var res = [{\n placeholders: {}\n }];\n if (rule instanceof OperatorNode && node instanceof OperatorNode || rule instanceof FunctionNode && node instanceof FunctionNode) {\n // If the rule is an OperatorNode or a FunctionNode, then node must match exactly\n if (rule instanceof OperatorNode) {\n if (rule.op !== node.op || rule.fn !== node.fn) {\n return [];\n }\n } else if (rule instanceof FunctionNode) {\n if (rule.name !== node.name) {\n return [];\n }\n }\n\n // rule and node match. Search the children of rule and node.\n if (node.args.length === 1 && rule.args.length === 1 || !isAssociative(node, context) && node.args.length === rule.args.length || isSplit) {\n // Expect non-associative operators to match exactly,\n // except in any order if operator is commutative\n var childMatches = [];\n for (var i = 0; i < rule.args.length; i++) {\n var childMatch = _ruleMatch(rule.args[i], node.args[i], context);\n if (childMatch.length === 0) {\n // Child did not match, so stop searching immediately\n break;\n }\n // The child matched, so add the information returned from the child to our result\n childMatches.push(childMatch);\n }\n if (childMatches.length !== rule.args.length) {\n if (!isCommutative(node, context) ||\n // exact match in order needed\n rule.args.length === 1) {\n // nothing to commute\n return [];\n }\n if (rule.args.length > 2) {\n /* Need to generate all permutations and try them.\n * It's a bit complicated, and unlikely to come up since there\n * are very few ternary or higher operators. So punt for now.\n */\n throw new Error('permuting >2 commutative non-associative rule arguments not yet implemented');\n }\n /* Exactly two arguments, try them reversed */\n var leftMatch = _ruleMatch(rule.args[0], node.args[1], context);\n if (leftMatch.length === 0) {\n return [];\n }\n var rightMatch = _ruleMatch(rule.args[1], node.args[0], context);\n if (rightMatch.length === 0) {\n return [];\n }\n childMatches = [leftMatch, rightMatch];\n }\n res = mergeChildMatches(childMatches);\n } else if (node.args.length >= 2 && rule.args.length === 2) {\n // node is flattened, rule is not\n // Associative operators/functions can be split in different ways so we check if the rule\n // matches for each of them and return their union.\n var splits = getSplits(node, context);\n var splitMatches = [];\n for (var _i2 = 0; _i2 < splits.length; _i2++) {\n var matchSet = _ruleMatch(rule, splits[_i2], context, true); // recursing at the same tree depth here\n splitMatches = splitMatches.concat(matchSet);\n }\n return splitMatches;\n } else if (rule.args.length > 2) {\n throw Error('Unexpected non-binary associative function: ' + rule.toString());\n } else {\n // Incorrect number of arguments in rule and node, so no match\n return [];\n }\n } else if (rule instanceof SymbolNode) {\n // If the rule is a SymbolNode, then it carries a special meaning\n // according to the first one or two characters of the symbol node name.\n // These meanings are expalined in the documentation for simplify()\n if (rule.name.length === 0) {\n throw new Error('Symbol in rule has 0 length...!?');\n }\n if (SUPPORTED_CONSTANTS[rule.name]) {\n // built-in constant must match exactly\n if (rule.name !== node.name) {\n return [];\n }\n } else {\n // wildcards are composed of up to two alphabetic or underscore characters\n switch (rule.name[1] >= 'a' && rule.name[1] <= 'z' ? rule.name.substring(0, 2) : rule.name[0]) {\n case 'n':\n case '_p':\n // rule matches _anything_, so assign this node to the rule.name placeholder\n // Assign node to the rule.name placeholder.\n // Our parent will check for matches among placeholders.\n res[0].placeholders[rule.name] = node;\n break;\n case 'c':\n case 'cl':\n // rule matches a ConstantNode\n if (isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'v':\n // rule matches anything other than a ConstantNode\n if (!isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vl':\n // rule matches VariableNode\n if (isVariableNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'cd':\n // rule matches a ConstantNode or unaryMinus-wrapped ConstantNode\n if (isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vd':\n // rule matches anything other than a ConstantNode or unaryMinus-wrapped ConstantNode\n if (!isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'ce':\n // rule matches expressions that have a constant value\n if (isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 've':\n // rule matches expressions that do not have a constant value\n if (!isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n default:\n throw new Error('Invalid symbol in rule: ' + rule.name);\n }\n }\n } else if (rule instanceof ConstantNode) {\n // Literal constant must match exactly\n if (!equal(rule.value, node.value)) {\n return [];\n }\n } else {\n // Some other node was encountered which we aren't prepared for, so no match\n return [];\n }\n\n // It's a match!\n\n // console.log('_ruleMatch(' + rule.toString() + ', ' + node.toString() + ') found a match')\n return res;\n }\n\n /**\n * Determines whether p and q (and all their children nodes) are identical.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} p\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} q\n * @return {Object} Information about the match, if it exists.\n */\n function _exactMatch(p, q) {\n if (p instanceof ConstantNode && q instanceof ConstantNode) {\n if (!equal(p.value, q.value)) {\n return false;\n }\n } else if (p instanceof SymbolNode && q instanceof SymbolNode) {\n if (p.name !== q.name) {\n return false;\n }\n } else if (p instanceof OperatorNode && q instanceof OperatorNode || p instanceof FunctionNode && q instanceof FunctionNode) {\n if (p instanceof OperatorNode) {\n if (p.op !== q.op || p.fn !== q.fn) {\n return false;\n }\n } else if (p instanceof FunctionNode) {\n if (p.name !== q.name) {\n return false;\n }\n }\n if (p.args.length !== q.args.length) {\n return false;\n }\n for (var i = 0; i < p.args.length; i++) {\n if (!_exactMatch(p.args[i], q.args[i])) {\n return false;\n }\n }\n } else {\n return false;\n }\n return true;\n }\n return simplify;\n});", "import { isConstantNode, isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nexport { isConstantNode, isSymbolNode as isVariableNode } from '../../../utils/is.js';\nexport function isNumericNode(x) {\n return isConstantNode(x) || isOperatorNode(x) && x.isUnary() && isConstantNode(x.args[0]);\n}\nexport function isConstantExpression(x) {\n if (isConstantNode(x)) {\n // Basic Constant types\n return true;\n }\n if ((isFunctionNode(x) || isOperatorNode(x)) && x.args.every(isConstantExpression)) {\n // Can be constant depending on arguments\n return true;\n }\n if (isParenthesisNode(x) && isConstantExpression(x.content)) {\n // Parenthesis are transparent\n return true;\n }\n return false; // Probably missing some edge cases\n}", "import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nimport { hasOwnProperty } from '../../../utils/object.js';\nvar name = 'simplifyUtil';\nvar dependencies = ['FunctionNode', 'OperatorNode', 'SymbolNode'];\nexport var createUtil = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n FunctionNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n // TODO commutative/associative properties rely on the arguments\n // e.g. multiply is not commutative for matrices\n // The properties should be calculated from an argument to simplify, or possibly something in math.config\n // the other option is for typed() to specify a return type so that we can evaluate the type of arguments\n\n /* So that properties of an operator fit on one line: */\n var T = true;\n var F = false;\n var defaultName = 'defaultF';\n var defaultContext = {\n /* */add: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /**/unaryPlus: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */subtract: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */multiply: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */divide: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */paren: {\n trivial: T,\n total: T,\n commutative: T,\n associative: F\n },\n /* */defaultF: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n }\n };\n var realContext = {\n divide: {\n total: F\n },\n log: {\n total: F\n }\n };\n var positiveContext = {\n subtract: {\n total: F\n },\n abs: {\n trivial: T\n },\n log: {\n total: T\n }\n };\n function hasProperty(nodeOrName, property) {\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultContext;\n var name = defaultName;\n if (typeof nodeOrName === 'string') {\n name = nodeOrName;\n } else if (isOperatorNode(nodeOrName)) {\n name = nodeOrName.fn.toString();\n } else if (isFunctionNode(nodeOrName)) {\n name = nodeOrName.name;\n } else if (isParenthesisNode(nodeOrName)) {\n name = 'paren';\n }\n if (hasOwnProperty(context, name)) {\n var properties = context[name];\n if (hasOwnProperty(properties, property)) {\n return properties[property];\n }\n if (hasOwnProperty(defaultContext, name)) {\n return defaultContext[name][property];\n }\n }\n if (hasOwnProperty(context, defaultName)) {\n var _properties = context[defaultName];\n if (hasOwnProperty(_properties, property)) {\n return _properties[property];\n }\n return defaultContext[defaultName][property];\n }\n /* name not found in context and context has no global default */\n /* So use default context. */\n if (hasOwnProperty(defaultContext, name)) {\n var _properties2 = defaultContext[name];\n if (hasOwnProperty(_properties2, property)) {\n return _properties2[property];\n }\n }\n return defaultContext[defaultName][property];\n }\n function isCommutative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'commutative', context);\n }\n function isAssociative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'associative', context);\n }\n\n /**\n * Merge the given contexts, with primary overriding secondary\n * wherever they might conflict\n */\n function mergeContext(primary, secondary) {\n var merged = _objectSpread({}, primary);\n for (var prop in secondary) {\n if (hasOwnProperty(primary, prop)) {\n merged[prop] = _objectSpread(_objectSpread({}, secondary[prop]), primary[prop]);\n } else {\n merged[prop] = secondary[prop];\n }\n }\n return merged;\n }\n\n /**\n * Flatten all associative operators in an expression tree.\n * Assumes parentheses have already been removed.\n */\n function flatten(node, context) {\n if (!node.args || node.args.length === 0) {\n return node;\n }\n node.args = allChildren(node, context);\n for (var i = 0; i < node.args.length; i++) {\n flatten(node.args[i], context);\n }\n }\n\n /**\n * Get the children of a node as if it has been flattened.\n * TODO implement for FunctionNodes\n */\n function allChildren(node, context) {\n var op;\n var children = [];\n var findChildren = function findChildren(node) {\n for (var i = 0; i < node.args.length; i++) {\n var child = node.args[i];\n if (isOperatorNode(child) && op === child.op) {\n findChildren(child);\n } else {\n children.push(child);\n }\n }\n };\n if (isAssociative(node, context)) {\n op = node.op;\n findChildren(node);\n return children;\n } else {\n return node.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a right-heavy binary tree.\n */\n function unflattenr(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenr(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.pop();\n while (node.args.length > 0) {\n curnode = makeNode([node.args.pop(), curnode]);\n }\n node.args = curnode.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a left-heavy binary tree.\n */\n function unflattenl(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenl(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.shift();\n while (node.args.length > 0) {\n curnode = makeNode([curnode, node.args.shift()]);\n }\n node.args = curnode.args;\n }\n }\n function createMakeNodeFunction(node) {\n if (isOperatorNode(node)) {\n return function (args) {\n try {\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } catch (err) {\n console.error(err);\n return [];\n }\n };\n } else {\n return function (args) {\n return new FunctionNode(new SymbolNode(node.name), args);\n };\n }\n }\n return {\n createMakeNodeFunction,\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n allChildren,\n unflattenr,\n unflattenl,\n defaultContext,\n realContext,\n positiveContext\n };\n});", "import { isFraction, isMatrix, isNode, isArrayNode, isConstantNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { createUtil } from './simplify/util.js';\nimport { noBignumber, noFraction } from '../../utils/noop.js';\nvar name = 'simplifyConstant';\nvar dependencies = ['typed', 'config', 'mathWithTransform', 'matrix', '?fraction', '?bignumber', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode'];\nexport var createSimplifyConstant = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n mathWithTransform,\n matrix,\n fraction,\n bignumber,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n var {\n isCommutative,\n isAssociative,\n allChildren,\n createMakeNodeFunction\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * simplifyConstant() takes a mathjs expression (either a Node representing\n * a parse tree or a string which it parses to produce a node), and replaces\n * any subexpression of it consisting entirely of constants with the computed\n * value of that subexpression.\n *\n * Syntax:\n *\n * math.simplifyConstant(expr)\n * math.simplifyConstant(expr, options)\n *\n * Examples:\n *\n * math.simplifyConstant('x + 4*3/6') // Node \"x + 2\"\n * math.simplifyConstant('z cos(0)') // Node \"z 1\"\n * math.simplifyConstant('(5.2 + 1.08)t', {exactFractions: false}) // Node \"6.28 t\"\n *\n * See also:\n *\n * simplify, simplifyCore, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with constant subexpressions evaluated\n */\n var simplifyConstant = typed('simplifyConstant', {\n Node: node => _ensureNode(foldFraction(node, {})),\n 'Node, Object': function NodeObject(expr, options) {\n return _ensureNode(foldFraction(expr, options));\n }\n });\n function _removeFractions(thing) {\n if (isFraction(thing)) {\n return thing.valueOf();\n }\n if (thing instanceof Array) {\n return thing.map(_removeFractions);\n }\n if (isMatrix(thing)) {\n return matrix(_removeFractions(thing.valueOf()));\n }\n return thing;\n }\n function _eval(fnname, args, options) {\n try {\n return mathWithTransform[fnname].apply(null, args);\n } catch (ignore) {\n // sometimes the implicit type conversion causes the evaluation to fail, so we'll try again after removing Fractions\n args = args.map(_removeFractions);\n return _toNumber(mathWithTransform[fnname].apply(null, args), options);\n }\n }\n var _toNode = typed({\n Fraction: _fractionToNode,\n number: function number(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n BigNumber: function BigNumber(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n); // old parameters: (n.toString(), 'number')\n },\n bigint: function bigint(n) {\n if (n < 0n) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n Complex: function Complex(s) {\n throw new Error('Cannot convert Complex number to Node');\n },\n string: function string(s) {\n return new ConstantNode(s);\n },\n Matrix: function Matrix(m) {\n return new ArrayNode(m.valueOf().map(e => _toNode(e)));\n }\n });\n function _ensureNode(thing) {\n if (isNode(thing)) {\n return thing;\n }\n return _toNode(thing);\n }\n\n // convert a number to a fraction only if it can be expressed exactly,\n // and when both numerator and denominator are small enough\n function _exactFraction(n, options) {\n var exactFractions = options && options.exactFractions !== false;\n if (exactFractions && isFinite(n) && fraction) {\n var f = fraction(n);\n var fractionsLimit = options && typeof options.fractionsLimit === 'number' ? options.fractionsLimit : Infinity; // no limit by default\n\n if (f.valueOf() === n && f.n < fractionsLimit && f.d < fractionsLimit) {\n return f;\n }\n }\n return n;\n }\n\n // Convert numbers to a preferred number type in preference order: Fraction, number, Complex\n // BigNumbers are left alone\n var _toNumber = typed({\n 'string, Object': function stringObject(s, options) {\n var numericType = safeNumberType(s, config);\n if (numericType === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return bignumber(s);\n } else if (numericType === 'bigint') {\n return BigInt(s);\n } else if (numericType === 'Fraction') {\n if (fraction === undefined) {\n noFraction();\n }\n return fraction(s);\n } else {\n var n = parseFloat(s);\n return _exactFraction(n, options);\n }\n },\n 'Fraction, Object': function FractionObject(s, options) {\n return s;\n },\n // we don't need options here\n\n 'BigNumber, Object': function BigNumberObject(s, options) {\n return s;\n },\n // we don't need options here\n\n 'number, Object': function numberObject(s, options) {\n return _exactFraction(s, options);\n },\n 'bigint, Object': function bigintObject(s, options) {\n return s;\n },\n 'Complex, Object': function ComplexObject(s, options) {\n if (s.im !== 0) {\n return s;\n }\n return _exactFraction(s.re, options);\n },\n 'Matrix, Object': function MatrixObject(s, options) {\n return matrix(_exactFraction(s.valueOf()));\n },\n 'Array, Object': function ArrayObject(s, options) {\n return s.map(_exactFraction);\n }\n });\n function unaryMinusNode(n) {\n return new OperatorNode('-', 'unaryMinus', [n]);\n }\n function _fractionToNode(f) {\n var n;\n var vn = f.s * f.n;\n if (vn < 0) {\n n = new OperatorNode('-', 'unaryMinus', [new ConstantNode(-vn)]);\n } else {\n n = new ConstantNode(vn);\n }\n if (f.d === 1) {\n return n;\n }\n return new OperatorNode('/', 'divide', [n, new ConstantNode(f.d)]);\n }\n\n /* Handles constant indexing of ArrayNodes, matrices, and ObjectNodes */\n function _foldAccessor(obj, index, options) {\n if (!isIndexNode(index)) {\n // don't know what to do with that...\n return new AccessorNode(_ensureNode(obj), _ensureNode(index));\n }\n if (isArrayNode(obj) || isMatrix(obj)) {\n var remainingDims = Array.from(index.dimensions);\n /* We will resolve constant indices one at a time, looking\n * just in the first or second dimensions because (a) arrays\n * of more than two dimensions are likely rare, and (b) pulling\n * out the third or higher dimension would be pretty intricate.\n * The price is that we miss simplifying [..3d array][x,y,1]\n */\n while (remainingDims.length > 0) {\n if (isConstantNode(remainingDims[0]) && typeof remainingDims[0].value !== 'string') {\n var first = _toNumber(remainingDims.shift().value, options);\n if (isArrayNode(obj)) {\n obj = obj.items[first - 1];\n } else {\n // matrix\n obj = obj.valueOf()[first - 1];\n if (obj instanceof Array) {\n obj = matrix(obj);\n }\n }\n } else if (remainingDims.length > 1 && isConstantNode(remainingDims[1]) && typeof remainingDims[1].value !== 'string') {\n var second = _toNumber(remainingDims[1].value, options);\n var tryItems = [];\n var fromItems = isArrayNode(obj) ? obj.items : obj.valueOf();\n for (var item of fromItems) {\n if (isArrayNode(item)) {\n tryItems.push(item.items[second - 1]);\n } else if (isMatrix(obj)) {\n tryItems.push(item[second - 1]);\n } else {\n break;\n }\n }\n if (tryItems.length === fromItems.length) {\n if (isArrayNode(obj)) {\n obj = new ArrayNode(tryItems);\n } else {\n // matrix\n obj = matrix(tryItems);\n }\n remainingDims.splice(1, 1);\n } else {\n // extracting slice along 2nd dimension failed, give up\n break;\n }\n } else {\n // neither 1st or 2nd dimension is constant, give up\n break;\n }\n }\n if (remainingDims.length === index.dimensions.length) {\n /* No successful constant indexing */\n return new AccessorNode(_ensureNode(obj), index);\n }\n if (remainingDims.length > 0) {\n /* Indexed some but not all dimensions */\n index = new IndexNode(remainingDims);\n return new AccessorNode(_ensureNode(obj), index);\n }\n /* All dimensions were constant, access completely resolved */\n return obj;\n }\n if (isObjectNode(obj) && index.dimensions.length === 1 && isConstantNode(index.dimensions[0])) {\n var key = index.dimensions[0].value;\n if (key in obj.properties) {\n return obj.properties[key];\n }\n return new ConstantNode(); // undefined\n }\n /* Don't know how to index this sort of obj, at least not with this index */\n return new AccessorNode(_ensureNode(obj), index);\n }\n\n /*\n * Create a binary tree from a list of Fractions and Nodes.\n * Tries to fold Fractions by evaluating them until the first Node in the list is hit, so\n * `args` should be sorted to have the Fractions at the start (if the operator is commutative).\n * @param args - list of Fractions and Nodes\n * @param fn - evaluator for the binary operation evaluator that accepts two Fractions\n * @param makeNode - creates a binary OperatorNode/FunctionNode from a list of child Nodes\n * if args.length is 1, returns args[0]\n * @return - Either a Node representing a binary expression or Fraction\n */\n function foldOp(fn, args, makeNode, options) {\n var first = args.shift();\n\n // In the following reduction, sofar always has one of the three following\n // forms: [NODE], [CONSTANT], or [NODE, CONSTANT]\n var reduction = args.reduce((sofar, next) => {\n if (!isNode(next)) {\n var last = sofar.pop();\n if (isNode(last)) {\n return [last, next];\n }\n // Two constants in a row, try to fold them into one\n try {\n sofar.push(_eval(fn, [last, next], options));\n return sofar;\n } catch (ignoreandcontinue) {\n sofar.push(last);\n // fall through to Node case\n }\n }\n\n // Encountered a Node, or failed folding --\n // collapse everything so far into a single tree:\n sofar.push(_ensureNode(sofar.pop()));\n var newtree = sofar.length === 1 ? sofar[0] : makeNode(sofar);\n return [makeNode([newtree, _ensureNode(next)])];\n }, [first]);\n if (reduction.length === 1) {\n return reduction[0];\n }\n // Might end up with a tree and a constant at the end:\n return makeNode([reduction[0], _toNode(reduction[1])]);\n }\n\n // destroys the original node and returns a folded one\n function foldFraction(node, options) {\n switch (node.type) {\n case 'SymbolNode':\n return node;\n case 'ConstantNode':\n switch (typeof node.value) {\n case 'number':\n return _toNumber(node.value, options);\n case 'bigint':\n return _toNumber(node.value, options);\n case 'string':\n return node.value;\n default:\n if (!isNaN(node.value)) return _toNumber(node.value, options);\n }\n return node;\n case 'FunctionNode':\n if (mathWithTransform[node.name] && mathWithTransform[node.name].rawArgs) {\n return node;\n }\n {\n // Process operators as OperatorNode\n var operatorFunctions = ['add', 'multiply'];\n if (!operatorFunctions.includes(node.name)) {\n var args = node.args.map(arg => foldFraction(arg, options));\n\n // If all args are numbers\n if (!args.some(isNode)) {\n try {\n return _eval(node.name, args, options);\n } catch (ignoreandcontinue) {}\n }\n\n // Size of a matrix does not depend on entries\n if (node.name === 'size' && args.length === 1 && isArrayNode(args[0])) {\n var sz = [];\n var section = args[0];\n while (isArrayNode(section)) {\n sz.push(section.items.length);\n section = section.items[0];\n }\n return matrix(sz);\n }\n\n // Convert all args to nodes and construct a symbolic function call\n return new FunctionNode(node.name, args.map(_ensureNode));\n } else {\n // treat as operator\n }\n }\n /* falls through */\n case 'OperatorNode':\n {\n var fn = node.fn.toString();\n var _args;\n var res;\n var makeNode = createMakeNodeFunction(node);\n if (isOperatorNode(node) && node.isUnary()) {\n _args = [foldFraction(node.args[0], options)];\n if (!isNode(_args[0])) {\n res = _eval(fn, _args, options);\n } else {\n res = makeNode(_args);\n }\n } else if (isAssociative(node, options.context)) {\n _args = allChildren(node, options.context);\n _args = _args.map(arg => foldFraction(arg, options));\n if (isCommutative(fn, options.context)) {\n // commutative binary operator\n var consts = [];\n var vars = [];\n for (var i = 0; i < _args.length; i++) {\n if (!isNode(_args[i])) {\n consts.push(_args[i]);\n } else {\n vars.push(_args[i]);\n }\n }\n if (consts.length > 1) {\n res = foldOp(fn, consts, makeNode, options);\n vars.unshift(res);\n res = foldOp(fn, vars, makeNode, options);\n } else {\n // we won't change the children order since it's not neccessary\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-commutative binary operator\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-associative binary operator\n _args = node.args.map(arg => foldFraction(arg, options));\n res = foldOp(fn, _args, makeNode, options);\n }\n return res;\n }\n case 'ParenthesisNode':\n // remove the uneccessary parenthesis\n return foldFraction(node.content, options);\n case 'AccessorNode':\n return _foldAccessor(foldFraction(node.object, options), foldFraction(node.index, options), options);\n case 'ArrayNode':\n {\n var foldItems = node.items.map(item => foldFraction(item, options));\n if (foldItems.some(isNode)) {\n return new ArrayNode(foldItems.map(_ensureNode));\n }\n /* All literals -- return a Matrix so we can operate on it */\n return matrix(foldItems);\n }\n case 'IndexNode':\n {\n return new IndexNode(node.dimensions.map(n => simplifyConstant(n, options)));\n }\n case 'ObjectNode':\n {\n var foldProps = {};\n for (var prop in node.properties) {\n foldProps[prop] = simplifyConstant(node.properties[prop], options);\n }\n return new ObjectNode(foldProps);\n }\n case 'AssignmentNode':\n /* falls through */\n case 'BlockNode':\n /* falls through */\n case 'FunctionAssignmentNode':\n /* falls through */\n case 'RangeNode':\n /* falls through */\n case 'ConditionalNode':\n /* falls through */\n default:\n throw new Error(\"Unimplemented node type in simplifyConstant: \".concat(node.type));\n }\n }\n return simplifyConstant;\n});", "import { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { getOperator } from '../../expression/operators.js';\nimport { createUtil } from './simplify/util.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'simplifyCore';\nvar dependencies = ['typed', 'parse', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createSimplifyCore = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n var node0 = new ConstantNode(0);\n var node1 = new ConstantNode(1);\n var nodeT = new ConstantNode(true);\n var nodeF = new ConstantNode(false);\n // test if a node will always have a boolean value (true/false)\n // not sure if this list is complete\n function isAlwaysBoolean(node) {\n return isOperatorNode(node) && ['and', 'not', 'or'].includes(node.op);\n }\n var {\n hasProperty,\n isCommutative\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n /**\n * simplifyCore() performs single pass simplification suitable for\n * applications requiring ultimate performance. To roughly summarize,\n * it handles cases along the lines of simplifyConstant() but where\n * knowledge of a single argument is sufficient to determine the value.\n * In contrast, simplify() extends simplifyCore() with additional passes\n * to provide deeper simplification (such as gathering like terms).\n *\n * Specifically, simplifyCore:\n *\n * * Converts all function calls with operator equivalents to their\n * operator forms.\n * * Removes operators or function calls that are guaranteed to have no\n * effect (such as unary '+').\n * * Removes double unary '-', '~', and 'not'\n * * Eliminates addition/subtraction of 0 and multiplication/division/powers\n * by 1 or 0.\n * * Converts addition of a negation into subtraction.\n * * Eliminates logical operations with constant true or false leading\n * arguments.\n * * Puts constants on the left of a product, if multiplication is\n * considered commutative by the options (which is the default)\n *\n * Syntax:\n *\n * math.simplifyCore(expr)\n * math.simplifyCore(expr, options)\n *\n * Examples:\n *\n * const f = math.parse('2 * 1 * x ^ (1 - 0)')\n * math.simplifyCore(f) // Node \"2 * x\"\n * math.simplify('2 * 1 * x ^ (1 - 0)', [math.simplifyCore]) // Node \"2 * x\"\n *\n * See also:\n *\n * simplify, simplifyConstant, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with basic simplifications applied\n */\n function _simplifyCore(nodeToSimplify) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var context = options ? options.context : undefined;\n if (hasProperty(nodeToSimplify, 'trivial', context)) {\n // This node does nothing if it has only one argument, so if so,\n // return that argument simplified\n if (isFunctionNode(nodeToSimplify) && nodeToSimplify.args.length === 1) {\n return _simplifyCore(nodeToSimplify.args[0], options);\n }\n // For other node types, we try the generic methods\n var simpChild = false;\n var childCount = 0;\n nodeToSimplify.forEach(c => {\n ++childCount;\n if (childCount === 1) {\n simpChild = _simplifyCore(c, options);\n }\n });\n if (childCount === 1) {\n return simpChild;\n }\n }\n var node = nodeToSimplify;\n if (isFunctionNode(node)) {\n var op = getOperator(node.name);\n if (op) {\n // Replace FunctionNode with a new OperatorNode\n if (node.args.length > 2 && hasProperty(node, 'associative', context)) {\n // unflatten into binary operations since that's what simplifyCore handles\n while (node.args.length > 2) {\n var last = node.args.pop();\n var seclast = node.args.pop();\n node.args.push(new OperatorNode(op, node.name, [last, seclast]));\n }\n }\n node = new OperatorNode(op, node.name, node.args);\n } else {\n return new FunctionNode(_simplifyCore(node.fn), node.args.map(n => _simplifyCore(n, options)));\n }\n }\n if (isOperatorNode(node) && node.isUnary()) {\n var a0 = _simplifyCore(node.args[0], options);\n if (node.op === '~') {\n // bitwise not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === '~') {\n return a0.args[0];\n }\n }\n if (node.op === 'not') {\n // logical not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === 'not') {\n // Has the effect of turning the argument into a boolean\n // So can only eliminate the double negation if\n // the inside is already boolean\n if (isAlwaysBoolean(a0.args[0])) {\n return a0.args[0];\n }\n }\n }\n var finish = true;\n if (node.op === '-') {\n // unary minus\n if (isOperatorNode(a0)) {\n if (a0.isBinary() && a0.fn === 'subtract') {\n node = new OperatorNode('-', 'subtract', [a0.args[1], a0.args[0]]);\n finish = false; // continue to process the new binary node\n }\n if (a0.isUnary() && a0.op === '-') {\n return a0.args[0];\n }\n }\n }\n if (finish) return new OperatorNode(node.op, node.fn, [a0]);\n }\n if (isOperatorNode(node) && node.isBinary()) {\n var _a = _simplifyCore(node.args[0], options);\n var a1 = _simplifyCore(node.args[1], options);\n if (node.op === '+') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return a1;\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n a1 = a1.args[0];\n node = new OperatorNode('-', 'subtract', [_a, a1]);\n }\n }\n if (node.op === '-') {\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n return _simplifyCore(new OperatorNode('+', 'add', [_a, a1.args[0]]), options);\n }\n if (isConstantNode(_a) && isZero(_a.value)) {\n return _simplifyCore(new OperatorNode('-', 'unaryMinus', [a1]));\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '*') {\n if (isConstantNode(_a)) {\n if (isZero(_a.value)) {\n return node0;\n } else if (equal(_a.value, 1)) {\n return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node0;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n if (isCommutative(node, context)) {\n return new OperatorNode(node.op, node.fn, [a1, _a], node.implicit); // constants on left\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1], node.implicit);\n }\n if (node.op === '/') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return node0;\n }\n if (isConstantNode(a1) && equal(a1.value, 1)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '^') {\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node1;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n }\n }\n if (node.op === 'and') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n if (isAlwaysBoolean(a1)) return a1;\n if (isConstantNode(a1)) {\n return a1.value ? nodeT : nodeF;\n }\n } else {\n return nodeF;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n if (isAlwaysBoolean(_a)) return _a;\n } else {\n return nodeF;\n }\n }\n }\n if (node.op === 'or') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(a1)) return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(_a)) return _a;\n }\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (isOperatorNode(node)) {\n return new OperatorNode(node.op, node.fn, node.args.map(a => _simplifyCore(a, options)));\n }\n if (isArrayNode(node)) {\n return new ArrayNode(node.items.map(n => _simplifyCore(n, options)));\n }\n if (isAccessorNode(node)) {\n return new AccessorNode(_simplifyCore(node.object, options), _simplifyCore(node.index, options));\n }\n if (isIndexNode(node)) {\n return new IndexNode(node.dimensions.map(n => _simplifyCore(n, options)));\n }\n if (isObjectNode(node)) {\n var newProps = {};\n for (var prop in node.properties) {\n newProps[prop] = _simplifyCore(node.properties[prop], options);\n }\n return new ObjectNode(newProps);\n }\n // cannot simplify\n return node;\n }\n return typed(name, {\n Node: _simplifyCore,\n 'Node,Object': _simplifyCore\n });\n});", "import { createMap } from '../../utils/map.js';\nimport { isFunctionNode, isNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'resolve';\nvar dependencies = ['typed', 'parse', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode'];\nexport var createResolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode\n } = _ref;\n /**\n * resolve(expr, scope) replaces variable nodes with their scoped values\n *\n * Syntax:\n *\n * math.resolve(expr, scope)\n *\n * Examples:\n *\n * math.resolve('x + y', {x:1, y:2}) // Node '1 + 2'\n * math.resolve(math.parse('x+y'), {x:1, y:2}) // Node '1 + 2'\n * math.simplify('x+y', {x:2, y: math.parse('x+x')}).toString() // \"6\"\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node | Node[]} node\n * The expression tree (or trees) to be simplified\n * @param {Object} scope\n * Scope specifying variables to be resolved\n * @return {Node | Node[]} Returns `node` with variables recursively substituted.\n * @throws {ReferenceError}\n * If there is a cyclic dependency among the variables in `scope`,\n * resolution is impossible and a ReferenceError is thrown.\n */\n function _resolve(node, scope) {\n var within = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();\n // note `within`:\n // `within` is not documented, since it is for internal cycle\n // detection only\n if (!scope) {\n return node;\n }\n if (isSymbolNode(node)) {\n if (within.has(node.name)) {\n var variables = Array.from(within).join(', ');\n throw new ReferenceError(\"recursive loop of variable definitions among {\".concat(variables, \"}\"));\n }\n var value = scope.get(node.name);\n if (isNode(value)) {\n var nextWithin = new Set(within);\n nextWithin.add(node.name);\n return _resolve(value, scope, nextWithin);\n } else if (typeof value === 'number') {\n return parse(String(value));\n } else if (value !== undefined) {\n return new ConstantNode(value);\n } else {\n return node;\n }\n } else if (isOperatorNode(node)) {\n var args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } else if (isParenthesisNode(node)) {\n return new ParenthesisNode(_resolve(node.content, scope, within));\n } else if (isFunctionNode(node)) {\n var _args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new FunctionNode(node.name, _args);\n }\n\n // Otherwise just recursively resolve any children (might also work\n // for some of the above special cases)\n return node.map(child => _resolve(child, scope, within));\n }\n return typed('resolve', {\n Node: _resolve,\n 'Node, Map | null | undefined': _resolve,\n 'Node, Object': (n, scope) => _resolve(n, createMap(scope)),\n // For arrays and matrices, we map `self` rather than `_resolve`\n // because resolve is fairly expensive anyway, and this way\n // we get nice error messages if one entry in the array has wrong type.\n 'Array | Matrix': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array | Matrix, null | undefined': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array, Object': typed.referTo('Array,Map', selfAM => (A, scope) => selfAM(A, createMap(scope))),\n 'Matrix, Object': typed.referTo('Matrix,Map', selfMM => (A, scope) => selfMM(A, createMap(scope))),\n 'Array | Matrix, Map': typed.referToSelf(self => (A, scope) => A.map(n => self(n, scope)))\n });\n});", "import { isConstantNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'symbolicEqual';\nvar dependencies = ['parse', 'simplify', 'typed', 'OperatorNode'];\nexport var createSymbolicEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n simplify,\n typed,\n OperatorNode\n } = _ref;\n /**\n * Attempts to determine if two expressions are symbolically equal, i.e.\n * one is the result of valid algebraic manipulations on the other.\n * Currently, this simply checks if the difference of the two expressions\n * simplifies down to 0. So there are two important caveats:\n * 1. whether two expressions are symbolically equal depends on the\n * manipulations allowed. Therefore, this function takes an optional\n * third argument, which are the options that control the behavior\n * as documented for the `simplify()` function.\n * 2. it is in general intractable to find the minimal simplification of\n * an arbitrarily complicated expression. So while a `true` value\n * of `symbolicEqual` ensures that the two expressions can be manipulated\n * to match each other, a `false` value does not absolutely rule this out.\n *\n * Syntax:\n *\n * math.symbolicEqual(expr1, expr2)\n * math.symbolicEqual(expr1, expr2, options)\n *\n * Examples:\n *\n * math.symbolicEqual('x*y', 'y*x') // Returns true\n * math.symbolicEqual('x*y', 'y*x', {context: {multiply: {commutative: false}}}) // Returns false\n * math.symbolicEqual('x/y', '(y*x^(-1))^(-1)') // Returns true\n * math.symbolicEqual('abs(x)','x') // Returns false\n * math.symbolicEqual('abs(x)','x', simplify.positiveContext) // Returns true\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node|string} expr1 The first expression to compare\n * @param {Node|string} expr2 The second expression to compare\n * @param {Object} [options] Optional option object, passed to simplify\n * @returns {boolean}\n * Returns true if a valid manipulation making the expressions equal\n * is found.\n */\n function _symbolicEqual(e1, e2) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var diff = new OperatorNode('-', 'subtract', [e1, e2]);\n var simplified = simplify(diff, {}, options);\n return isConstantNode(simplified) && !simplified.value;\n }\n return typed(name, {\n 'Node, Node': _symbolicEqual,\n 'Node, Node, Object': _symbolicEqual\n });\n});", "import { isConstantNode, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nvar name = 'derivative';\nvar dependencies = ['typed', 'config', 'parse', 'simplify', 'equal', 'isZero', 'numeric', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createDerivative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n parse,\n simplify,\n equal,\n isZero,\n numeric,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n /**\n * Takes the derivative of an expression expressed in parser Nodes.\n * The derivative will be taken over the supplied variable in the\n * second parameter. If there are multiple variables in the expression,\n * it will return a partial derivative.\n *\n * This uses rules of differentiation which can be found here:\n *\n * - [Differentiation rules (Wikipedia)](https://en.wikipedia.org/wiki/Differentiation_rules)\n *\n * Syntax:\n *\n * math.derivative(expr, variable)\n * math.derivative(expr, variable, options)\n *\n * Examples:\n *\n * math.derivative('x^2', 'x') // Node '2 * x'\n * math.derivative('x^2', 'x', {simplify: false}) // Node '2 * 1 * x ^ (2 - 1)'\n * math.derivative('sin(2x)', 'x')) // Node '2 * cos(2 * x)'\n * math.derivative('2*x', 'x').evaluate() // number 2\n * math.derivative('x^2', 'x').evaluate({x: 4}) // number 8\n * const f = math.parse('x^2')\n * const x = math.parse('x')\n * math.derivative(f, x) // Node {2 * x}\n *\n * See also:\n *\n * simplify, parse, evaluate\n *\n * @param {Node | string} expr The expression to differentiate\n * @param {SymbolNode | string} variable The variable over which to differentiate\n * @param {{simplify: boolean}} [options]\n * There is one option available, `simplify`, which\n * is true by default. When false, output will not\n * be simplified.\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n function plainDerivative(expr, variable) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n simplify: true\n };\n var constNodes = {};\n constTag(constNodes, expr, variable.name);\n var res = _derivative(expr, constNodes);\n return options.simplify ? simplify(res) : res;\n }\n typed.addConversion({\n from: 'identifier',\n to: 'SymbolNode',\n convert: parse\n });\n var derivative = typed(name, {\n 'Node, SymbolNode': plainDerivative,\n 'Node, SymbolNode, Object': plainDerivative\n\n /* TODO: implement and test syntax with order of derivatives -> implement as an option {order: number}\n 'Node, SymbolNode, ConstantNode': function (expr, variable, {order}) {\n let res = expr\n for (let i = 0; i < order; i++) {\n let constNodes = {}\n constTag(constNodes, expr, variable.name)\n res = _derivative(res, constNodes)\n }\n return res\n }\n */\n });\n typed.removeConversion({\n from: 'identifier',\n to: 'SymbolNode',\n convert: parse\n });\n derivative._simplify = true;\n derivative.toTex = function (deriv) {\n return _derivTex.apply(null, deriv.args);\n };\n\n // FIXME: move the toTex method of derivative to latex.js. Difficulty is that it relies on parse.\n // NOTE: the optional \"order\" parameter here is currently unused\n var _derivTex = typed('_derivTex', {\n 'Node, SymbolNode': function NodeSymbolNode(expr, x) {\n if (isConstantNode(expr) && typeOf(expr.value) === 'string') {\n return _derivTex(parse(expr.value).toString(), x.toString(), 1);\n } else {\n return _derivTex(expr.toTex(), x.toString(), 1);\n }\n },\n 'Node, ConstantNode': function NodeConstantNode(expr, x) {\n if (typeOf(x.value) === 'string') {\n return _derivTex(expr, parse(x.value));\n } else {\n throw new Error(\"The second parameter to 'derivative' is a non-string constant\");\n }\n },\n 'Node, SymbolNode, ConstantNode': function NodeSymbolNodeConstantNode(expr, x, order) {\n return _derivTex(expr.toString(), x.name, order.value);\n },\n 'string, string, number': function stringStringNumber(expr, x, order) {\n var d;\n if (order === 1) {\n d = '{d\\\\over d' + x + '}';\n } else {\n d = '{d^{' + order + '}\\\\over d' + x + '^{' + order + '}}';\n }\n return d + \"\\\\left[\".concat(expr, \"\\\\right]\");\n }\n });\n\n /**\n * Does a depth-first search on the expression tree to identify what Nodes\n * are constants (e.g. 2 + 2), and stores the ones that are constants in\n * constNodes. Classification is done as follows:\n *\n * 1. ConstantNodes are constants.\n * 2. If there exists a SymbolNode, of which we are differentiating over,\n * in the subtree it is not constant.\n *\n * @param {Object} constNodes Holds the nodes that are constant\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {string} varName Variable that we are differentiating\n * @return {boolean} if node is constant\n */\n // TODO: can we rewrite constTag into a pure function?\n var constTag = typed('constTag', {\n 'Object, ConstantNode, string': function ObjectConstantNodeString(constNodes, node) {\n constNodes[node] = true;\n return true;\n },\n 'Object, SymbolNode, string': function ObjectSymbolNodeString(constNodes, node, varName) {\n // Treat other variables like constants. For reasoning, see:\n // https://en.wikipedia.org/wiki/Partial_derivative\n if (node.name !== varName) {\n constNodes[node] = true;\n return true;\n }\n return false;\n },\n 'Object, ParenthesisNode, string': function ObjectParenthesisNodeString(constNodes, node, varName) {\n return constTag(constNodes, node.content, varName);\n },\n 'Object, FunctionAssignmentNode, string': function ObjectFunctionAssignmentNodeString(constNodes, node, varName) {\n if (!node.params.includes(varName)) {\n constNodes[node] = true;\n return true;\n }\n return constTag(constNodes, node.expr, varName);\n },\n 'Object, FunctionNode | OperatorNode, string': function ObjectFunctionNodeOperatorNodeString(constNodes, node, varName) {\n if (node.args.length > 0) {\n var isConst = constTag(constNodes, node.args[0], varName);\n for (var i = 1; i < node.args.length; ++i) {\n isConst = constTag(constNodes, node.args[i], varName) && isConst;\n }\n if (isConst) {\n constNodes[node] = true;\n return true;\n }\n }\n return false;\n }\n });\n\n /**\n * Applies differentiation rules.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} constNodes Holds the nodes that are constant\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n var _derivative = typed('_derivative', {\n 'ConstantNode, Object': function ConstantNodeObject(node) {\n return createConstantNode(0);\n },\n 'SymbolNode, Object': function SymbolNodeObject(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n return createConstantNode(1);\n },\n 'ParenthesisNode, Object': function ParenthesisNodeObject(node, constNodes) {\n return new ParenthesisNode(_derivative(node.content, constNodes));\n },\n 'FunctionAssignmentNode, Object': function FunctionAssignmentNodeObject(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n return _derivative(node.expr, constNodes);\n },\n 'FunctionNode, Object': function FunctionNodeObject(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n var arg0 = node.args[0];\n var arg1;\n var div = false; // is output a fraction?\n var negative = false; // is output negative?\n\n var funcDerivative;\n switch (node.name) {\n case 'cbrt':\n // d/dx(cbrt(x)) = 1 / (3x^(2/3))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(3), new OperatorNode('^', 'pow', [arg0, new OperatorNode('/', 'divide', [createConstantNode(2), createConstantNode(3)])])]);\n break;\n case 'sqrt':\n case 'nthRoot':\n // d/dx(sqrt(x)) = 1 / (2*sqrt(x))\n if (node.args.length === 1) {\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(2), new FunctionNode('sqrt', [arg0])]);\n } else if (node.args.length === 2) {\n // Rearrange from nthRoot(x, a) -> x^(1/a)\n arg1 = new OperatorNode('/', 'divide', [createConstantNode(1), node.args[1]]);\n\n // Is a variable?\n constNodes[arg1] = constNodes[node.args[1]];\n return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), constNodes);\n }\n break;\n case 'log10':\n arg1 = createConstantNode(10);\n /* fall through! */\n case 'log':\n if (!arg1 && node.args.length === 1) {\n // d/dx(log(x)) = 1 / x\n funcDerivative = arg0.clone();\n div = true;\n } else if (node.args.length === 1 && arg1 || node.args.length === 2 && constNodes[node.args[1]] !== undefined) {\n // d/dx(log(x, c)) = 1 / (x*ln(c))\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('log', [arg1 || node.args[1]])]);\n div = true;\n } else if (node.args.length === 2) {\n // d/dx(log(f(x), g(x))) = d/dx(log(f(x)) / log(g(x)))\n return _derivative(new OperatorNode('/', 'divide', [new FunctionNode('log', [arg0]), new FunctionNode('log', [node.args[1]])]), constNodes);\n }\n break;\n case 'pow':\n if (node.args.length === 2) {\n constNodes[arg1] = constNodes[node.args[1]];\n // Pass to pow operator node parser\n return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), constNodes);\n }\n break;\n case 'exp':\n // d/dx(e^x) = e^x\n funcDerivative = new FunctionNode('exp', [arg0.clone()]);\n break;\n case 'sin':\n // d/dx(sin(x)) = cos(x)\n funcDerivative = new FunctionNode('cos', [arg0.clone()]);\n break;\n case 'cos':\n // d/dx(cos(x)) = -sin(x)\n funcDerivative = new OperatorNode('-', 'unaryMinus', [new FunctionNode('sin', [arg0.clone()])]);\n break;\n case 'tan':\n // d/dx(tan(x)) = sec(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sec', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sec':\n // d/dx(sec(x)) = sec(x)tan(x)\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tan', [arg0.clone()])]);\n break;\n case 'csc':\n // d/dx(csc(x)) = -csc(x)cot(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('cot', [arg0.clone()])]);\n break;\n case 'cot':\n // d/dx(cot(x)) = -csc(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csc', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asin':\n // d/dx(asin(x)) = 1 / sqrt(1 - x^2)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'acos':\n // d/dx(acos(x)) = -1 / sqrt(1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'atan':\n // d/dx(atan(x)) = 1 / (x^2 + 1)\n div = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'asec':\n // d/dx(asec(x)) = 1 / (|x|*sqrt(x^2 - 1))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acsc':\n // d/dx(acsc(x)) = -1 / (|x|*sqrt(x^2 - 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acot':\n // d/dx(acot(x)) = -1 / (x^2 + 1)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'sinh':\n // d/dx(sinh(x)) = cosh(x)\n funcDerivative = new FunctionNode('cosh', [arg0.clone()]);\n break;\n case 'cosh':\n // d/dx(cosh(x)) = sinh(x)\n funcDerivative = new FunctionNode('sinh', [arg0.clone()]);\n break;\n case 'tanh':\n // d/dx(tanh(x)) = sech(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sech', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sech':\n // d/dx(sech(x)) = -sech(x)tanh(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tanh', [arg0.clone()])]);\n break;\n case 'csch':\n // d/dx(csch(x)) = -csch(x)coth(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('coth', [arg0.clone()])]);\n break;\n case 'coth':\n // d/dx(coth(x)) = -csch(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csch', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asinh':\n // d/dx(asinh(x)) = 1 / sqrt(x^2 + 1)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'acosh':\n // d/dx(acosh(x)) = 1 / sqrt(x^2 - 1); XXX potentially only for x >= 1 (the real spectrum)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'atanh':\n // d/dx(atanh(x)) = 1 / (1 - x^2)\n div = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'asech':\n // d/dx(asech(x)) = -1 / (x*sqrt(1 - x^2))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])])]);\n break;\n case 'acsch':\n // d/dx(acsch(x)) = -1 / (|x|*sqrt(x^2 + 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acoth':\n // d/dx(acoth(x)) = -1 / (1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'abs':\n // d/dx(abs(x)) = abs(x)/x\n funcDerivative = new OperatorNode('/', 'divide', [new FunctionNode(new SymbolNode('abs'), [arg0.clone()]), arg0.clone()]);\n break;\n case 'gamma': // Needs digamma function, d/dx(gamma(x)) = gamma(x)digamma(x)\n default:\n throw new Error('Cannot process function \"' + node.name + '\" in derivative: ' + 'the function is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n var op, func;\n if (div) {\n op = '/';\n func = 'divide';\n } else {\n op = '*';\n func = 'multiply';\n }\n\n /* Apply chain rule to all functions:\n F(x) = f(g(x))\n F'(x) = g'(x)*f'(g(x)) */\n var chainDerivative = _derivative(arg0, constNodes);\n if (negative) {\n chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative]);\n }\n return new OperatorNode(op, func, [chainDerivative, funcDerivative]);\n },\n 'OperatorNode, Object': function OperatorNodeObject(node, constNodes) {\n if (constNodes[node] !== undefined) {\n return createConstantNode(0);\n }\n if (node.op === '+') {\n // d/dx(sum(f(x)) = sum(f'(x))\n return new OperatorNode(node.op, node.fn, node.args.map(function (arg) {\n return _derivative(arg, constNodes);\n }));\n }\n if (node.op === '-') {\n // d/dx(+/-f(x)) = +/-f'(x)\n if (node.isUnary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes)]);\n }\n\n // Linearity of differentiation, d/dx(f(x) +/- g(x)) = f'(x) +/- g'(x)\n if (node.isBinary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], constNodes), _derivative(node.args[1], constNodes)]);\n }\n }\n if (node.op === '*') {\n // d/dx(c*f(x)) = c*f'(x)\n var constantTerms = node.args.filter(function (arg) {\n return constNodes[arg] !== undefined;\n });\n if (constantTerms.length > 0) {\n var nonConstantTerms = node.args.filter(function (arg) {\n return constNodes[arg] === undefined;\n });\n var nonConstantNode = nonConstantTerms.length === 1 ? nonConstantTerms[0] : new OperatorNode('*', 'multiply', nonConstantTerms);\n var newArgs = constantTerms.concat(_derivative(nonConstantNode, constNodes));\n return new OperatorNode('*', 'multiply', newArgs);\n }\n\n // Product Rule, d/dx(f(x)*g(x)) = f'(x)*g(x) + f(x)*g'(x)\n return new OperatorNode('+', 'add', node.args.map(function (argOuter) {\n return new OperatorNode('*', 'multiply', node.args.map(function (argInner) {\n return argInner === argOuter ? _derivative(argInner, constNodes) : argInner.clone();\n }));\n }));\n }\n if (node.op === '/' && node.isBinary()) {\n var arg0 = node.args[0];\n var arg1 = node.args[1];\n\n // d/dx(f(x) / c) = f'(x) / c\n if (constNodes[arg1] !== undefined) {\n return new OperatorNode('/', 'divide', [_derivative(arg0, constNodes), arg1]);\n }\n\n // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2)\n if (constNodes[arg0] !== undefined) {\n return new OperatorNode('*', 'multiply', [new OperatorNode('-', 'unaryMinus', [arg0]), new OperatorNode('/', 'divide', [_derivative(arg1, constNodes), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])])]);\n }\n\n // Quotient rule, d/dx(f(x) / g(x)) = (f'(x)g(x) - f(x)g'(x)) / g(x)^2\n return new OperatorNode('/', 'divide', [new OperatorNode('-', 'subtract', [new OperatorNode('*', 'multiply', [_derivative(arg0, constNodes), arg1.clone()]), new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, constNodes)])]), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])]);\n }\n if (node.op === '^' && node.isBinary()) {\n var _arg = node.args[0];\n var _arg2 = node.args[1];\n if (constNodes[_arg] !== undefined) {\n // If is secretly constant; 0^f(x) = 1 (in JS), 1^f(x) = 1\n if (isConstantNode(_arg) && (isZero(_arg.value) || equal(_arg.value, 1))) {\n return createConstantNode(0);\n }\n\n // d/dx(c^f(x)) = c^f(x)*ln(c)*f'(x)\n return new OperatorNode('*', 'multiply', [node, new OperatorNode('*', 'multiply', [new FunctionNode('log', [_arg.clone()]), _derivative(_arg2.clone(), constNodes)])]);\n }\n if (constNodes[_arg2] !== undefined) {\n if (isConstantNode(_arg2)) {\n // If is secretly constant; f(x)^0 = 1 -> d/dx(1) = 0\n if (isZero(_arg2.value)) {\n return createConstantNode(0);\n }\n // Ignore exponent; f(x)^1 = f(x)\n if (equal(_arg2.value, 1)) {\n return _derivative(_arg, constNodes);\n }\n }\n\n // Elementary Power Rule, d/dx(f(x)^c) = c*f'(x)*f(x)^(c-1)\n var powMinusOne = new OperatorNode('^', 'pow', [_arg.clone(), new OperatorNode('-', 'subtract', [_arg2, createConstantNode(1)])]);\n return new OperatorNode('*', 'multiply', [_arg2.clone(), new OperatorNode('*', 'multiply', [_derivative(_arg, constNodes), powMinusOne])]);\n }\n\n // Functional Power Rule, d/dx(f^g) = f^g*[f'*(g/f) + g'ln(f)]\n return new OperatorNode('*', 'multiply', [new OperatorNode('^', 'pow', [_arg.clone(), _arg2.clone()]), new OperatorNode('+', 'add', [new OperatorNode('*', 'multiply', [_derivative(_arg, constNodes), new OperatorNode('/', 'divide', [_arg2.clone(), _arg.clone()])]), new OperatorNode('*', 'multiply', [_derivative(_arg2, constNodes), new FunctionNode('log', [_arg.clone()])])])]);\n }\n throw new Error('Cannot process operator \"' + node.op + '\" in derivative: ' + 'the operator is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n });\n\n /**\n * Helper function to create a constant node with a specific type\n * (number, BigNumber, Fraction)\n * @param {number} value\n * @param {string} [valueType]\n * @return {ConstantNode}\n */\n function createConstantNode(value, valueType) {\n return new ConstantNode(numeric(value, valueType || safeNumberType(String(value), config)));\n }\n return derivative;\n});", "import { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'rationalize';\nvar dependencies = ['config', 'typed', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'parse', 'simplifyConstant', 'simplifyCore', 'simplify', '?bignumber', '?fraction', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode', 'ParenthesisNode'];\nexport var createRationalize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n parse,\n simplifyConstant,\n simplifyCore,\n simplify,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode,\n ParenthesisNode\n } = _ref;\n /**\n * Transform a rationalizable expression in a rational fraction.\n * If rational fraction is one variable polynomial then converts\n * the numerator and denominator in canonical form, with decreasing\n * exponents, returning the coefficients of numerator.\n *\n * Syntax:\n *\n * math.rationalize(expr)\n * math.rationalize(expr, detailed)\n * math.rationalize(expr, scope)\n * math.rationalize(expr, scope, detailed)\n *\n * Examples:\n *\n * math.rationalize('sin(x)+y')\n * // Error: There is an unsolved function call\n * math.rationalize('2x/y - y/(x+1)')\n * // (2*x^2-y^2+2*x)/(x*y+y)\n * math.rationalize('(2x+1)^6')\n * // 64*x^6+192*x^5+240*x^4+160*x^3+60*x^2+12*x+1\n * math.rationalize('2x/( (2x-1) / (3x+2) ) - 5x/ ( (3x+4) / (2x^2-5) ) + 3')\n * // -20*x^4+28*x^3+104*x^2+6*x-12)/(6*x^2+5*x-4)\n * math.rationalize('x/(1-x)/(x-2)/(x-3)/(x-4) + 2x/ ( (1-2x)/(2-3x) )/ ((3-4x)/(4-5x) )') =\n * // (-30*x^7+344*x^6-1506*x^5+3200*x^4-3472*x^3+1846*x^2-381*x)/\n * // (-8*x^6+90*x^5-383*x^4+780*x^3-797*x^2+390*x-72)\n *\n * math.rationalize('x+x+x+y',{y:1}) // 3*x+1\n * math.rationalize('x+x+x+y',{}) // 3*x+y\n *\n * const ret = math.rationalize('x+x+x+y',{},true)\n * // ret.expression=3*x+y, ret.variables = [\"x\",\"y\"]\n * const ret = math.rationalize('-2+5x^2',{},true)\n * // ret.expression=5*x^2-2, ret.variables = [\"x\"], ret.coefficients=[-2,0,5]\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to check if is a polynomial expression\n * @param {Object|boolean} optional scope of expression or true for already evaluated rational expression at input\n * @param {Boolean} detailed optional True if return an object, false if return expression node (default)\n *\n * @return {Object | Node} The rational polynomial of `expr` or an object\n * `{expression, numerator, denominator, variables, coefficients}`, where\n * `expression` is a `Node` with the node simplified expression,\n * `numerator` is a `Node` with the simplified numerator of expression,\n * `denominator` is a `Node` or `boolean` with the simplified denominator or `false` (if there is no denominator),\n * `variables` is an array with variable names,\n * and `coefficients` is an array with coefficients of numerator sorted by increased exponent\n * {Expression Node} node simplified expression\n *\n */\n function _rationalize(expr) {\n var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var detailed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var setRules = rulesRationalize(); // Rules for change polynomial in near canonical form\n var polyRet = polynomial(expr, scope, true, setRules.firstRules); // Check if expression is a rationalizable polynomial\n var nVars = polyRet.variables.length;\n var noExactFractions = {\n exactFractions: false\n };\n var withExactFractions = {\n exactFractions: true\n };\n expr = polyRet.expression;\n if (nVars >= 1) {\n // If expression in not a constant\n expr = expandPower(expr); // First expand power of polynomials (cannot be made from rules!)\n var sBefore; // Previous expression\n var rules;\n var eDistrDiv = true;\n var redoInic = false;\n // Apply the initial rules, including succ div rules:\n expr = simplify(expr, setRules.firstRules, {}, noExactFractions);\n var s;\n while (true) {\n // Alternate applying successive division rules and distr.div.rules\n // until there are no more changes:\n rules = eDistrDiv ? setRules.distrDivRules : setRules.sucDivRules;\n expr = simplify(expr, rules, {}, withExactFractions);\n eDistrDiv = !eDistrDiv; // Swap between Distr.Div and Succ. Div. Rules\n\n s = expr.toString();\n if (s === sBefore) {\n break; // No changes : end of the loop\n }\n redoInic = true;\n sBefore = s;\n }\n if (redoInic) {\n // Apply first rules again without succ div rules (if there are changes)\n expr = simplify(expr, setRules.firstRulesAgain, {}, noExactFractions);\n }\n // Apply final rules:\n expr = simplify(expr, setRules.finalRules, {}, noExactFractions);\n } // NVars >= 1\n\n var coefficients = [];\n var retRationalize = {};\n if (expr.type === 'OperatorNode' && expr.isBinary() && expr.op === '/') {\n // Separate numerator from denominator\n if (nVars === 1) {\n expr.args[0] = polyToCanonical(expr.args[0], coefficients);\n expr.args[1] = polyToCanonical(expr.args[1]);\n }\n if (detailed) {\n retRationalize.numerator = expr.args[0];\n retRationalize.denominator = expr.args[1];\n }\n } else {\n if (nVars === 1) {\n expr = polyToCanonical(expr, coefficients);\n }\n if (detailed) {\n retRationalize.numerator = expr;\n retRationalize.denominator = null;\n }\n }\n // nVars\n\n if (!detailed) return expr;\n retRationalize.coefficients = coefficients;\n retRationalize.variables = polyRet.variables;\n retRationalize.expression = expr;\n return retRationalize;\n }\n return typed(name, {\n Node: _rationalize,\n 'Node, boolean': (expr, detailed) => _rationalize(expr, {}, detailed),\n 'Node, Object': _rationalize,\n 'Node, Object, boolean': _rationalize\n }); // end of typed rationalize\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * polynomial(expr,scope,extended, rules)\n *\n * @param {Node | string} expr The expression to simplify and check if is polynomial expression\n * @param {object} scope Optional scope for expression simplification\n * @param {boolean} extended Optional. Default is false. When true allows divide operator.\n * @param {array} rules Optional. Default is no rule.\n *\n *\n * @return {Object}\n * {Object} node: node simplified expression\n * {Array} variables: variable names\n */\n function polynomial(expr, scope, extended, rules) {\n var variables = [];\n var node = simplify(expr, rules, scope, {\n exactFractions: false\n }); // Resolves any variables and functions with all defined parameters\n extended = !!extended;\n var oper = '+-*' + (extended ? '/' : '');\n recPoly(node);\n var retFunc = {};\n retFunc.expression = node;\n retFunc.variables = variables;\n return retFunc;\n\n // -------------------------------------------------------------------------------------------------------\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * recPoly(node)\n *\n *\n * @param {Node} node The current sub tree expression in recursion\n *\n * @return nothing, throw an exception if error\n */\n function recPoly(node) {\n var tp = node.type; // node type\n if (tp === 'FunctionNode') {\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n if (node.op === '^') {\n // TODO: handle negative exponents like in '1/x^(-2)'\n if (node.args[1].type !== 'ConstantNode' || !isInteger(parseFloat(node.args[1].value))) {\n throw new Error('There is a non-integer exponent');\n } else {\n recPoly(node.args[0]);\n }\n } else {\n if (!oper.includes(node.op)) {\n throw new Error('Operator ' + node.op + ' invalid in polynomial expression');\n }\n for (var i = 0; i < node.args.length; i++) {\n recPoly(node.args[i]);\n }\n } // type of operator\n } else if (tp === 'SymbolNode') {\n var _name = node.name; // variable name\n var pos = variables.indexOf(_name);\n if (pos === -1) {\n // new variable in expression\n variables.push(_name);\n }\n } else if (tp === 'ParenthesisNode') {\n recPoly(node.content);\n } else if (tp !== 'ConstantNode') {\n throw new Error('type ' + tp + ' is not allowed in polynomial expression');\n }\n } // end of recPoly\n } // end of polynomial\n\n // ---------------------------------------------------------------------------------------\n /**\n * Return a rule set to rationalize an polynomial expression in rationalize\n *\n * Syntax:\n *\n * rulesRationalize()\n *\n * @return {array} rule set to rationalize an polynomial expression\n */\n function rulesRationalize() {\n var oldRules = [simplifyCore,\n // sCore\n {\n l: 'n+n',\n r: '2*n'\n }, {\n l: 'n+-n',\n r: '0'\n }, simplifyConstant,\n // sConstant\n {\n l: 'n*(n1^-1)',\n r: 'n/n1'\n }, {\n l: 'n*n1^-n2',\n r: 'n/n1^n2'\n }, {\n l: 'n1^-1',\n r: '1/n1'\n }, {\n l: 'n*(n1/n2)',\n r: '(n*n1)/n2'\n }, {\n l: '1*n',\n r: 'n'\n }];\n var rulesFirst = [{\n l: '(-n1)/(-n2)',\n r: 'n1/n2'\n },\n // Unary division\n {\n l: '(-n1)*(-n2)',\n r: 'n1*n2'\n },\n // Unary multiplication\n {\n l: 'n1--n2',\n r: 'n1+n2'\n },\n // '--' elimination\n {\n l: 'n1-n2',\n r: 'n1+(-n2)'\n },\n // Subtraction turn into add with un\uFFFDry minus\n {\n l: '(n1+n2)*n3',\n r: '(n1*n3 + n2*n3)'\n },\n // Distributive 1\n {\n l: 'n1*(n2+n3)',\n r: '(n1*n2+n1*n3)'\n },\n // Distributive 2\n {\n l: 'c1*n + c2*n',\n r: '(c1+c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n + n',\n r: '(c1+1)*n'\n },\n // Joining constants\n {\n l: 'c1*n - c2*n',\n r: '(c1-c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n - n',\n r: '(c1-1)*n'\n },\n // Joining constants\n {\n l: 'v/c',\n r: '(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: 'v/-c',\n r: '-(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: '-v*-c',\n r: 'c*v'\n },\n // Inversion constant and variable 1\n {\n l: '-v*c',\n r: '-c*v'\n },\n // Inversion constant and variable 2\n {\n l: 'v*-c',\n r: '-c*v'\n },\n // Inversion constant and variable 3\n {\n l: 'v*c',\n r: 'c*v'\n },\n // Inversion constant and variable 4\n {\n l: '-(-n1*n2)',\n r: '(n1*n2)'\n },\n // Unary propagation\n {\n l: '-(n1*n2)',\n r: '(-n1*n2)'\n },\n // Unary propagation\n {\n l: '-(-n1+n2)',\n r: '(n1-n2)'\n },\n // Unary propagation\n {\n l: '-(n1+n2)',\n r: '(-n1-n2)'\n },\n // Unary propagation\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n },\n // Power to Power\n {\n l: '-(-n1/n2)',\n r: '(n1/n2)'\n },\n // Division and Unary\n {\n l: '-(n1/n2)',\n r: '(-n1/n2)'\n }]; // Divisao and Unary\n\n var rulesDistrDiv = [{\n l: '(n1/n2 + n3/n4)',\n r: '((n1*n4 + n3*n2)/(n2*n4))'\n },\n // Sum of fractions\n {\n l: '(n1/n2 + n3)',\n r: '((n1 + n3*n2)/n2)'\n },\n // Sum fraction with number 1\n {\n l: '(n1 + n2/n3)',\n r: '((n1*n3 + n2)/n3)'\n }]; // Sum fraction with number 1\n\n var rulesSucDiv = [{\n l: '(n1/(n2/n3))',\n r: '((n1*n3)/n2)'\n },\n // Division simplification\n {\n l: '(n1/n2/n3)',\n r: '(n1/(n2*n3))'\n }];\n var setRules = {}; // rules set in 4 steps.\n\n // All rules => infinite loop\n // setRules.allRules =oldRules.concat(rulesFirst,rulesDistrDiv,rulesSucDiv)\n\n setRules.firstRules = oldRules.concat(rulesFirst, rulesSucDiv); // First rule set\n setRules.distrDivRules = rulesDistrDiv; // Just distr. div. rules\n setRules.sucDivRules = rulesSucDiv; // Jus succ. div. rules\n setRules.firstRulesAgain = oldRules.concat(rulesFirst); // Last rules set without succ. div.\n\n // Division simplification\n\n // Second rule set.\n // There is no aggregate expression with parentesis, but the only variable can be scattered.\n setRules.finalRules = [simplifyCore,\n // simplify.rules[0]\n {\n l: 'n*-n',\n r: '-n^2'\n },\n // Joining multiply with power 1\n {\n l: 'n*n',\n r: 'n^2'\n },\n // Joining multiply with power 2\n simplifyConstant,\n // simplify.rules[14] old 3rd index in oldRules\n {\n l: 'n*-n^n1',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 3\n {\n l: 'n*n^n1',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 4\n {\n l: 'n^n1*-n^n2',\n r: '-n^(n1+n2)'\n },\n // Joining multiply with power 5\n {\n l: 'n^n1*n^n2',\n r: 'n^(n1+n2)'\n },\n // Joining multiply with power 6\n {\n l: 'n^n1*-n',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 7\n {\n l: 'n^n1*n',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/-n',\n r: '-n^(n1-1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/n',\n r: 'n^(n1-1)'\n },\n // Joining division with power 1\n {\n l: 'n/-n^n1',\n r: '-n^(1-n1)'\n },\n // Joining division with power 2\n {\n l: 'n/n^n1',\n r: 'n^(1-n1)'\n },\n // Joining division with power 3\n {\n l: 'n^n1/-n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 4\n {\n l: 'n^n1/n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 5\n {\n l: 'n1+(-n2*n3)',\n r: 'n1-n2*n3'\n },\n // Solving useless parenthesis 1\n {\n l: 'v*(-c)',\n r: '-c*v'\n },\n // Solving useless unary 2\n {\n l: 'n1+-n2',\n r: 'n1-n2'\n },\n // Solving +- together (new!)\n {\n l: 'v*c',\n r: 'c*v'\n },\n // inversion constant with variable\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n } // Power to Power\n ];\n return setRules;\n } // End rulesRationalize\n\n // ---------------------------------------------------------------------------------------\n /**\n * Expand recursively a tree node for handling with expressions with exponents\n * (it's not for constants, symbols or functions with exponents)\n * PS: The other parameters are internal for recursion\n *\n * Syntax:\n *\n * expandPower(node)\n *\n * @param {Node} node Current expression node\n * @param {node} parent Parent current node inside the recursion\n * @param (int} Parent number of chid inside the rercursion\n *\n * @return {node} node expression with all powers expanded.\n */\n function expandPower(node, parent, indParent) {\n var tp = node.type;\n var internal = arguments.length > 1; // TRUE in internal calls\n\n if (tp === 'OperatorNode' && node.isBinary()) {\n var does = false;\n var val;\n if (node.op === '^') {\n // First operator: Parenthesis or UnaryMinus\n if ((node.args[0].type === 'ParenthesisNode' || node.args[0].type === 'OperatorNode') && node.args[1].type === 'ConstantNode') {\n // Second operator: Constant\n val = parseFloat(node.args[1].value);\n does = val >= 2 && isInteger(val);\n }\n }\n if (does) {\n // Exponent >= 2\n // Before:\n // operator A --> Subtree\n // parent pow\n // constant\n //\n if (val > 2) {\n // Exponent > 2,\n // AFTER: (exponent > 2)\n // operator A --> Subtree\n // parent *\n // deep clone (operator A --> Subtree\n // pow\n // constant - 1\n //\n var nEsqTopo = node.args[0];\n var nDirTopo = new OperatorNode('^', 'pow', [node.args[0].cloneDeep(), new ConstantNode(val - 1)]);\n node = new OperatorNode('*', 'multiply', [nEsqTopo, nDirTopo]);\n } else {\n // Expo = 2 - no power\n // AFTER: (exponent = 2)\n // operator A --> Subtree\n // parent oper\n // deep clone (operator A --> Subtree)\n //\n node = new OperatorNode('*', 'multiply', [node.args[0], node.args[0].cloneDeep()]);\n }\n if (internal) {\n // Change parent references in internal recursive calls\n if (indParent === 'content') {\n parent.content = node;\n } else {\n parent.args[indParent] = node;\n }\n }\n } // does\n } // binary OperatorNode\n\n if (tp === 'ParenthesisNode') {\n // Recursion\n expandPower(node.content, node, 'content');\n } else if (tp !== 'ConstantNode' && tp !== 'SymbolNode') {\n for (var i = 0; i < node.args.length; i++) {\n expandPower(node.args[i], node, i);\n }\n }\n if (!internal) {\n // return the root node\n return node;\n }\n } // End expandPower\n\n // ---------------------------------------------------------------------------------------\n /**\n * Auxilary function for rationalize\n * Convert near canonical polynomial in one variable in a canonical polynomial\n * with one term for each exponent in decreasing order\n *\n * Syntax:\n *\n * polyToCanonical(node [, coefficients])\n *\n * @param {Node | string} expr The near canonical polynomial expression to convert in a a canonical polynomial expression\n *\n * The string or tree expression needs to be at below syntax, with free spaces:\n * ( (^(-)? | [+-]? )cte (*)? var (^expo)? | cte )+\n * Where 'var' is one variable with any valid name\n * 'cte' are real numeric constants with any value. It can be omitted if equal than 1\n * 'expo' are integers greater than 0. It can be omitted if equal than 1.\n *\n * @param {array} coefficients Optional returns coefficients sorted by increased exponent\n *\n *\n * @return {node} new node tree with one variable polynomial or string error.\n */\n function polyToCanonical(node, coefficients) {\n if (coefficients === undefined) {\n coefficients = [];\n } // coefficients.\n\n coefficients[0] = 0; // index is the exponent\n var o = {};\n o.cte = 1;\n o.oper = '+';\n\n // fire: mark with * or ^ when finds * or ^ down tree, reset to \"\" with + and -.\n // It is used to deduce the exponent: 1 for *, 0 for \"\".\n o.fire = '';\n var maxExpo = 0; // maximum exponent\n var varname = ''; // variable name\n\n recurPol(node, null, o);\n maxExpo = coefficients.length - 1;\n var first = true;\n var no;\n for (var i = maxExpo; i >= 0; i--) {\n if (coefficients[i] === 0) continue;\n var n1 = new ConstantNode(first ? coefficients[i] : Math.abs(coefficients[i]));\n var op = coefficients[i] < 0 ? '-' : '+';\n if (i > 0) {\n // Is not a constant without variable\n var n2 = new SymbolNode(varname);\n if (i > 1) {\n var n3 = new ConstantNode(i);\n n2 = new OperatorNode('^', 'pow', [n2, n3]);\n }\n if (coefficients[i] === -1 && first) {\n n1 = new OperatorNode('-', 'unaryMinus', [n2]);\n } else if (Math.abs(coefficients[i]) === 1) {\n n1 = n2;\n } else {\n n1 = new OperatorNode('*', 'multiply', [n1, n2]);\n }\n }\n if (first) {\n no = n1;\n } else if (op === '+') {\n no = new OperatorNode('+', 'add', [no, n1]);\n } else {\n no = new OperatorNode('-', 'subtract', [no, n1]);\n }\n first = false;\n } // for\n\n if (first) {\n return new ConstantNode(0);\n } else {\n return no;\n }\n\n /**\n * Recursive auxilary function inside polyToCanonical for\n * converting expression in canonical form\n *\n * Syntax:\n *\n * recurPol(node, noPai, obj)\n *\n * @param {Node} node The current subpolynomial expression\n * @param {Node | Null} noPai The current parent node\n * @param {object} obj Object with many internal flags\n *\n * @return {} No return. If error, throws an exception\n */\n function recurPol(node, noPai, o) {\n var tp = node.type;\n if (tp === 'FunctionNode') {\n // ***** FunctionName *****\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n // ***** OperatorName *****\n if (!'+-*^'.includes(node.op)) throw new Error('Operator ' + node.op + ' invalid');\n if (noPai !== null) {\n // -(unary),^ : children of *,+,-\n if ((node.fn === 'unaryMinus' || node.fn === 'pow') && noPai.fn !== 'add' && noPai.fn !== 'subtract' && noPai.fn !== 'multiply') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+,* : children of +,-\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'multiply') && noPai.fn !== 'add' && noPai.fn !== 'subtract') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+ : first child\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'unaryMinus') && o.noFil !== 0) {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n } // Has parent\n\n // Firers: ^,* Old: ^,&,-(unary): firers\n if (node.op === '^' || node.op === '*') {\n o.fire = node.op;\n }\n for (var _i = 0; _i < node.args.length; _i++) {\n // +,-: reset fire\n if (node.fn === 'unaryMinus') o.oper = '-';\n if (node.op === '+' || node.fn === 'subtract') {\n o.fire = '';\n o.cte = 1; // default if there is no constant\n o.oper = _i === 0 ? '+' : node.op;\n }\n o.noFil = _i; // number of son\n recurPol(node.args[_i], node, o);\n } // for in children\n } else if (tp === 'SymbolNode') {\n // ***** SymbolName *****\n if (node.name !== varname && varname !== '') {\n throw new Error('There is more than one variable');\n }\n varname = node.name;\n if (noPai === null) {\n coefficients[1] = 1;\n return;\n }\n\n // ^: Symbol is First child\n if (noPai.op === '^' && o.noFil !== 0) {\n throw new Error('In power the variable should be the first parameter');\n }\n\n // *: Symbol is Second child\n if (noPai.op === '*' && o.noFil !== 1) {\n throw new Error('In multiply the variable should be the second parameter');\n }\n\n // Symbol: firers '',* => it means there is no exponent above, so it's 1 (cte * var)\n if (o.fire === '' || o.fire === '*') {\n if (maxExpo < 1) coefficients[1] = 0;\n coefficients[1] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(1, maxExpo);\n }\n } else if (tp === 'ConstantNode') {\n var valor = parseFloat(node.value);\n if (noPai === null) {\n coefficients[0] = valor;\n return;\n }\n if (noPai.op === '^') {\n // cte: second child of power\n if (o.noFil !== 1) throw new Error('Constant cannot be powered');\n if (!isInteger(valor) || valor <= 0) {\n throw new Error('Non-integer exponent is not allowed');\n }\n for (var _i2 = maxExpo + 1; _i2 < valor; _i2++) coefficients[_i2] = 0;\n if (valor > maxExpo) coefficients[valor] = 0;\n coefficients[valor] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(valor, maxExpo);\n return;\n }\n o.cte = valor;\n\n // Cte: firer '' => There is no exponent and no multiplication, so the exponent is 0.\n if (o.fire === '') {\n coefficients[0] += o.cte * (o.oper === '+' ? 1 : -1);\n }\n } else {\n throw new Error('Type ' + tp + ' is not allowed');\n }\n } // End of recurPol\n } // End of polyToCanonical\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'zpk2tf';\nvar dependencies = ['typed', 'add', 'multiply', 'Complex', 'number'];\nexport var createZpk2tf = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n multiply,\n Complex,\n number\n } = _ref;\n /**\n * Compute the transfer function of a zero-pole-gain model.\n *\n * Syntax:\n * math.zpk2tf(z, p, k)\n *\n * Examples:\n * math.zpk2tf([1, 2], [-1, -2], 1) // returns [[1, -3, 2], [1, 3, 2]]\n *\n * See also:\n * freqz\n *\n * @param {Array} z Array of zeros values\n * @param {Array} p Array of poles values\n * @param {number} k Gain value\n * @return {Array} Two dimensional array containing the numerator (first row) and denominator (second row) polynomials\n *\n */\n return typed(name, {\n 'Array,Array,number': function ArrayArrayNumber(z, p, k) {\n return _zpk2tf(z, p, k);\n },\n 'Array,Array': function ArrayArray(z, p) {\n return _zpk2tf(z, p, 1);\n },\n 'Matrix,Matrix,number': function MatrixMatrixNumber(z, p, k) {\n return _zpk2tf(z.valueOf(), p.valueOf(), k);\n },\n 'Matrix,Matrix': function MatrixMatrix(z, p) {\n return _zpk2tf(z.valueOf(), p.valueOf(), 1);\n }\n });\n function _zpk2tf(z, p, k) {\n // if z is bignumber, convert it to number\n if (z.some(el => el.type === 'BigNumber')) {\n z = z.map(el => number(el));\n }\n // if p is bignumber, convert it to number\n if (p.some(el => el.type === 'BigNumber')) {\n p = p.map(el => number(el));\n }\n var num = [Complex(1, 0)];\n var den = [Complex(1, 0)];\n for (var i = 0; i < z.length; i++) {\n var zero = z[i];\n if (typeof zero === 'number') zero = Complex(zero, 0);\n num = _multiply(num, [Complex(1, 0), Complex(-zero.re, -zero.im)]);\n }\n for (var _i = 0; _i < p.length; _i++) {\n var pole = p[_i];\n if (typeof pole === 'number') pole = Complex(pole, 0);\n den = _multiply(den, [Complex(1, 0), Complex(-pole.re, -pole.im)]);\n }\n for (var _i2 = 0; _i2 < num.length; _i2++) {\n num[_i2] = multiply(num[_i2], k);\n }\n return [num, den];\n }\n function _multiply(a, b) {\n var c = [];\n for (var i = 0; i < a.length + b.length - 1; i++) {\n c[i] = Complex(0, 0);\n for (var j = 0; j < a.length; j++) {\n if (i - j >= 0 && i - j < b.length) {\n c[i] = add(c[i], multiply(a[j], b[i - j]));\n }\n }\n }\n return c;\n }\n});", "import { factory } from '../../utils/factory.js';\nvar name = 'freqz';\nvar dependencies = ['typed', 'add', 'multiply', 'Complex', 'divide', 'matrix'];\nexport var createFreqz = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n multiply,\n Complex,\n divide,\n matrix\n } = _ref;\n /**\n * Calculates the frequency response of a filter given its numerator and denominator coefficients.\n *\n * Syntax:\n * math.freqz(b, a)\n * math.freqz(b, a, w)\n *\n * Examples:\n * math.freqz([1, 2], [1, 2, 3], 4) // returns { h: [0.5 + 0i, 0.4768589245763655 + 0.2861153547458193i, 0.25000000000000006 + 0.75i, -0.770976571635189 + 0.4625859429811135i], w: [0, 0.7853981633974483, 1.5707963267948966, 2.356194490192345 ] }\n * math.freqz([1, 2], [1, 2, 3], [0, 1]) // returns { h: [0.5 + 0i, 0.45436781 + 0.38598051i], w: [0, 1] }\n *\n * See also:\n * zpk2tf\n *\n * @param {Array.} b The numerator coefficients of the filter.\n * @param {Array.} a The denominator coefficients of the filter.\n * @param {Array.} [w] A vector of frequencies (in radians/sample) at which the frequency response is to be computed or the number of points to compute (if a number is not provided, the default is 512 points)\n * @returns {Object} An object with two properties: h, a vector containing the complex frequency response, and w, a vector containing the normalized frequencies (in radians/sample) at which the response was computed.\n *\n *\n */\n return typed(name, {\n 'Array, Array': function ArrayArray(b, a) {\n var w = createBins(512);\n return _freqz(b, a, w);\n },\n 'Array, Array, Array': function ArrayArrayArray(b, a, w) {\n return _freqz(b, a, w);\n },\n 'Array, Array, number': function ArrayArrayNumber(b, a, w) {\n if (w < 0) {\n throw new Error('w must be a positive number');\n }\n var w2 = createBins(w);\n return _freqz(b, a, w2);\n },\n 'Matrix, Matrix': function MatrixMatrix(b, a) {\n // console.log('here')\n var _w = createBins(512);\n var {\n w,\n h\n } = _freqz(b.valueOf(), a.valueOf(), _w);\n return {\n w: matrix(w),\n h: matrix(h)\n };\n },\n 'Matrix, Matrix, Matrix': function MatrixMatrixMatrix(b, a, w) {\n var {\n h\n } = _freqz(b.valueOf(), a.valueOf(), w.valueOf());\n return {\n h: matrix(h),\n w: matrix(w)\n };\n },\n 'Matrix, Matrix, number': function MatrixMatrixNumber(b, a, w) {\n if (w < 0) {\n throw new Error('w must be a positive number');\n }\n var _w = createBins(w);\n var {\n h\n } = _freqz(b.valueOf(), a.valueOf(), _w);\n return {\n h: matrix(h),\n w: matrix(_w)\n };\n }\n });\n function _freqz(b, a, w) {\n var num = [];\n var den = [];\n for (var i = 0; i < w.length; i++) {\n var sumNum = Complex(0, 0);\n var sumDen = Complex(0, 0);\n for (var j = 0; j < b.length; j++) {\n sumNum = add(sumNum, multiply(b[j], Complex(Math.cos(-j * w[i]), Math.sin(-j * w[i]))));\n }\n for (var _j = 0; _j < a.length; _j++) {\n sumDen = add(sumDen, multiply(a[_j], Complex(Math.cos(-_j * w[i]), Math.sin(-_j * w[i]))));\n }\n num.push(sumNum);\n den.push(sumDen);\n }\n var h = [];\n for (var _i = 0; _i < num.length; _i++) {\n h.push(divide(num[_i], den[_i]));\n }\n return {\n h,\n w\n };\n }\n function createBins(n) {\n var bins = [];\n for (var i = 0; i < n; i++) {\n bins.push(i / n * Math.PI);\n }\n return bins;\n }\n});", "import { factory } from '../utils/factory.js';\nvar name = 'reviver';\nvar dependencies = ['classes'];\nexport var createReviver = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n classes\n } = _ref;\n /**\n * Instantiate mathjs data types from their JSON representation\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the revived object\n */\n return function reviver(key, value) {\n var constructor = classes[value && value.mathjs];\n if (constructor && typeof constructor.fromJSON === 'function') {\n return constructor.fromJSON(value);\n }\n return value;\n };\n});", "import { factory } from '../utils/factory.js';\nvar name = 'replacer';\nvar dependencies = [];\nexport var createReplacer = /* #__PURE__ */factory(name, dependencies, () => {\n /**\n * Stringify data types into their JSON representation.\n * Most data types can be serialized using their `.toJSON` method,\n * but not all, for example the number `Infinity`. For these cases you have\n * to use the replacer. Example usage:\n *\n * JSON.stringify([2, Infinity], math.replacer)\n *\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the replaced object\n */\n return function replacer(key, value) {\n // the numeric values Infinitiy, -Infinity, and NaN cannot be serialized to JSON\n if (typeof value === 'number' && (!isFinite(value) || isNaN(value))) {\n return {\n mathjs: 'number',\n value: String(value)\n };\n }\n if (typeof value === 'bigint') {\n return {\n mathjs: 'bigint',\n value: String(value)\n };\n }\n return value;\n };\n});", "import { factory } from './utils/factory.js';\nimport { version } from './version.js';\nimport { createBigNumberE, createBigNumberPhi, createBigNumberPi, createBigNumberTau } from './utils/bignumber/constants.js';\nimport { pi, tau, e, phi } from './plain/number/index.js';\nexport var createTrue = /* #__PURE__ */factory('true', [], () => true);\nexport var createFalse = /* #__PURE__ */factory('false', [], () => false);\nexport var createNull = /* #__PURE__ */factory('null', [], () => null);\nexport var createInfinity = /* #__PURE__ */recreateFactory('Infinity', ['config', '?BigNumber'], _ref => {\n var {\n config,\n BigNumber\n } = _ref;\n return config.number === 'BigNumber' ? new BigNumber(Infinity) : Infinity;\n});\nexport var createNaN = /* #__PURE__ */recreateFactory('NaN', ['config', '?BigNumber'], _ref2 => {\n var {\n config,\n BigNumber\n } = _ref2;\n return config.number === 'BigNumber' ? new BigNumber(NaN) : NaN;\n});\nexport var createPi = /* #__PURE__ */recreateFactory('pi', ['config', '?BigNumber'], _ref3 => {\n var {\n config,\n BigNumber\n } = _ref3;\n return config.number === 'BigNumber' ? createBigNumberPi(BigNumber) : pi;\n});\nexport var createTau = /* #__PURE__ */recreateFactory('tau', ['config', '?BigNumber'], _ref4 => {\n var {\n config,\n BigNumber\n } = _ref4;\n return config.number === 'BigNumber' ? createBigNumberTau(BigNumber) : tau;\n});\nexport var createE = /* #__PURE__ */recreateFactory('e', ['config', '?BigNumber'], _ref5 => {\n var {\n config,\n BigNumber\n } = _ref5;\n return config.number === 'BigNumber' ? createBigNumberE(BigNumber) : e;\n});\n\n// golden ratio, (1+sqrt(5))/2\nexport var createPhi = /* #__PURE__ */recreateFactory('phi', ['config', '?BigNumber'], _ref6 => {\n var {\n config,\n BigNumber\n } = _ref6;\n return config.number === 'BigNumber' ? createBigNumberPhi(BigNumber) : phi;\n});\nexport var createLN2 = /* #__PURE__ */recreateFactory('LN2', ['config', '?BigNumber'], _ref7 => {\n var {\n config,\n BigNumber\n } = _ref7;\n return config.number === 'BigNumber' ? new BigNumber(2).ln() : Math.LN2;\n});\nexport var createLN10 = /* #__PURE__ */recreateFactory('LN10', ['config', '?BigNumber'], _ref8 => {\n var {\n config,\n BigNumber\n } = _ref8;\n return config.number === 'BigNumber' ? new BigNumber(10).ln() : Math.LN10;\n});\nexport var createLOG2E = /* #__PURE__ */recreateFactory('LOG2E', ['config', '?BigNumber'], _ref9 => {\n var {\n config,\n BigNumber\n } = _ref9;\n return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(2).ln()) : Math.LOG2E;\n});\nexport var createLOG10E = /* #__PURE__ */recreateFactory('LOG10E', ['config', '?BigNumber'], _ref10 => {\n var {\n config,\n BigNumber\n } = _ref10;\n return config.number === 'BigNumber' ? new BigNumber(1).div(new BigNumber(10).ln()) : Math.LOG10E;\n});\nexport var createSQRT1_2 = /* #__PURE__ */recreateFactory(\n// eslint-disable-line camelcase\n'SQRT1_2', ['config', '?BigNumber'], _ref11 => {\n var {\n config,\n BigNumber\n } = _ref11;\n return config.number === 'BigNumber' ? new BigNumber('0.5').sqrt() : Math.SQRT1_2;\n});\nexport var createSQRT2 = /* #__PURE__ */recreateFactory('SQRT2', ['config', '?BigNumber'], _ref12 => {\n var {\n config,\n BigNumber\n } = _ref12;\n return config.number === 'BigNumber' ? new BigNumber(2).sqrt() : Math.SQRT2;\n});\nexport var createI = /* #__PURE__ */recreateFactory('i', ['Complex'], _ref13 => {\n var {\n Complex\n } = _ref13;\n return Complex.I;\n});\n\n// for backward compatibility with v5\nexport var createUppercasePi = /* #__PURE__ */factory('PI', ['pi'], _ref14 => {\n var {\n pi\n } = _ref14;\n return pi;\n});\nexport var createUppercaseE = /* #__PURE__ */factory('E', ['e'], _ref15 => {\n var {\n e\n } = _ref15;\n return e;\n});\nexport var createVersion = /* #__PURE__ */factory('version', [], () => version);\n\n// helper function to create a factory with a flag recreateOnConfigChange\n// idea: allow passing optional properties to be attached to the factory function as 4th argument?\nfunction recreateFactory(name, dependencies, create) {\n return factory(name, dependencies, create, {\n recreateOnConfigChange: true\n });\n}", "export var version = '13.0.0';\n// Note: This file is automatically generated when building math.js.\n// Changes made in this file will be overwritten.", "import { factory } from '../../utils/factory.js';\n\n// Source: https://en.wikipedia.org/wiki/Physical_constant\n\n// Universal constants\nexport var createSpeedOfLight = /* #__PURE__ */unitFactory('speedOfLight', '299792458', 'm s^-1');\nexport var createGravitationConstant = /* #__PURE__ */unitFactory('gravitationConstant', '6.67430e-11', 'm^3 kg^-1 s^-2');\nexport var createPlanckConstant = /* #__PURE__ */unitFactory('planckConstant', '6.62607015e-34', 'J s');\nexport var createReducedPlanckConstant = /* #__PURE__ */unitFactory('reducedPlanckConstant', '1.0545718176461565e-34', 'J s');\n\n// Electromagnetic constants\nexport var createMagneticConstant = /* #__PURE__ */unitFactory('magneticConstant', '1.25663706212e-6', 'N A^-2');\nexport var createElectricConstant = /* #__PURE__ */unitFactory('electricConstant', '8.8541878128e-12', 'F m^-1');\nexport var createVacuumImpedance = /* #__PURE__ */unitFactory('vacuumImpedance', '376.730313667', 'ohm');\nexport var createCoulomb = /* #__PURE__ */unitFactory('coulomb', '8.987551792261171e9', 'N m^2 C^-2');\nexport var createElementaryCharge = /* #__PURE__ */unitFactory('elementaryCharge', '1.602176634e-19', 'C');\nexport var createBohrMagneton = /* #__PURE__ */unitFactory('bohrMagneton', '9.2740100783e-24', 'J T^-1');\nexport var createConductanceQuantum = /* #__PURE__ */unitFactory('conductanceQuantum', '7.748091729863649e-5', 'S');\nexport var createInverseConductanceQuantum = /* #__PURE__ */unitFactory('inverseConductanceQuantum', '12906.403729652257', 'ohm');\nexport var createMagneticFluxQuantum = /* #__PURE__ */unitFactory('magneticFluxQuantum', '2.0678338484619295e-15', 'Wb');\nexport var createNuclearMagneton = /* #__PURE__ */unitFactory('nuclearMagneton', '5.0507837461e-27', 'J T^-1');\nexport var createKlitzing = /* #__PURE__ */unitFactory('klitzing', '25812.807459304513', 'ohm');\nexport var createJosephson = /* #__PURE__ */unitFactory('josephson', '4.835978484169836e14 Hz V', 'Hz V^-1'); // TODO: support for Hz needed\n\n// Atomic and nuclear constants\nexport var createBohrRadius = /* #__PURE__ */unitFactory('bohrRadius', '5.29177210903e-11', 'm');\nexport var createClassicalElectronRadius = /* #__PURE__ */unitFactory('classicalElectronRadius', '2.8179403262e-15', 'm');\nexport var createElectronMass = /* #__PURE__ */unitFactory('electronMass', '9.1093837015e-31', 'kg');\nexport var createFermiCoupling = /* #__PURE__ */unitFactory('fermiCoupling', '1.1663787e-5', 'GeV^-2');\nexport var createFineStructure = numberFactory('fineStructure', 7.2973525693e-3);\nexport var createHartreeEnergy = /* #__PURE__ */unitFactory('hartreeEnergy', '4.3597447222071e-18', 'J');\nexport var createProtonMass = /* #__PURE__ */unitFactory('protonMass', '1.67262192369e-27', 'kg');\nexport var createDeuteronMass = /* #__PURE__ */unitFactory('deuteronMass', '3.3435830926e-27', 'kg');\nexport var createNeutronMass = /* #__PURE__ */unitFactory('neutronMass', '1.6749271613e-27', 'kg');\nexport var createQuantumOfCirculation = /* #__PURE__ */unitFactory('quantumOfCirculation', '3.6369475516e-4', 'm^2 s^-1');\nexport var createRydberg = /* #__PURE__ */unitFactory('rydberg', '10973731.568160', 'm^-1');\nexport var createThomsonCrossSection = /* #__PURE__ */unitFactory('thomsonCrossSection', '6.6524587321e-29', 'm^2');\nexport var createWeakMixingAngle = numberFactory('weakMixingAngle', 0.22290);\nexport var createEfimovFactor = numberFactory('efimovFactor', 22.7);\n\n// Physico-chemical constants\nexport var createAtomicMass = /* #__PURE__ */unitFactory('atomicMass', '1.66053906660e-27', 'kg');\nexport var createAvogadro = /* #__PURE__ */unitFactory('avogadro', '6.02214076e23', 'mol^-1');\nexport var createBoltzmann = /* #__PURE__ */unitFactory('boltzmann', '1.380649e-23', 'J K^-1');\nexport var createFaraday = /* #__PURE__ */unitFactory('faraday', '96485.33212331001', 'C mol^-1');\nexport var createFirstRadiation = /* #__PURE__ */unitFactory('firstRadiation', '3.7417718521927573e-16', 'W m^2');\n// TODO spectralRadiance = 1.1910429723971881e-16 W m^2 sr^-1\nexport var createLoschmidt = /* #__PURE__ */unitFactory('loschmidt', '2.686780111798444e25', 'm^-3');\nexport var createGasConstant = /* #__PURE__ */unitFactory('gasConstant', '8.31446261815324', 'J K^-1 mol^-1');\nexport var createMolarPlanckConstant = /* #__PURE__ */unitFactory('molarPlanckConstant', '3.990312712893431e-10', 'J s mol^-1');\nexport var createMolarVolume = /* #__PURE__ */unitFactory('molarVolume', '0.022413969545014137', 'm^3 mol^-1');\nexport var createSackurTetrode = numberFactory('sackurTetrode', -1.16487052358);\nexport var createSecondRadiation = /* #__PURE__ */unitFactory('secondRadiation', '0.014387768775039337', 'm K');\nexport var createStefanBoltzmann = /* #__PURE__ */unitFactory('stefanBoltzmann', '5.67037441918443e-8', 'W m^-2 K^-4');\nexport var createWienDisplacement = /* #__PURE__ */unitFactory('wienDisplacement', '2.897771955e-3', 'm K');\n\n// Adopted values\nexport var createMolarMass = /* #__PURE__ */unitFactory('molarMass', '0.99999999965e-3', 'kg mol^-1');\nexport var createMolarMassC12 = /* #__PURE__ */unitFactory('molarMassC12', '11.9999999958e-3', 'kg mol^-1');\nexport var createGravity = /* #__PURE__ */unitFactory('gravity', '9.80665', 'm s^-2');\n// atm is defined in Unit.js\n\n// Natural units\nexport var createPlanckLength = /* #__PURE__ */unitFactory('planckLength', '1.616255e-35', 'm');\nexport var createPlanckMass = /* #__PURE__ */unitFactory('planckMass', '2.176435e-8', 'kg');\nexport var createPlanckTime = /* #__PURE__ */unitFactory('planckTime', '5.391245e-44', 's');\nexport var createPlanckCharge = /* #__PURE__ */unitFactory('planckCharge', '1.87554603778e-18', 'C');\nexport var createPlanckTemperature = /* #__PURE__ */unitFactory('planckTemperature', '1.416785e+32', 'K');\n\n// helper function to create a factory function which creates a physical constant,\n// a Unit with either a number value or a BigNumber value depending on the configuration\nfunction unitFactory(name, valueStr, unitStr) {\n var dependencies = ['config', 'Unit', 'BigNumber'];\n return factory(name, dependencies, _ref => {\n var {\n config,\n Unit,\n BigNumber\n } = _ref;\n // Note that we can parse into number or BigNumber.\n // We do not parse into Fractions as that doesn't make sense: we would lose precision of the values\n // Therefore we dont use Unit.parse()\n var value = config.number === 'BigNumber' ? new BigNumber(valueStr) : parseFloat(valueStr);\n var unit = new Unit(value, unitStr);\n unit.fixPrefix = true;\n return unit;\n });\n}\n\n// helper function to create a factory function which creates a numeric constant,\n// either a number or BigNumber depending on the configuration\nfunction numberFactory(name, value) {\n var dependencies = ['config', 'BigNumber'];\n return factory(name, dependencies, _ref2 => {\n var {\n config,\n BigNumber\n } = _ref2;\n return config.number === 'BigNumber' ? new BigNumber(value) : value;\n });\n}", "import { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createApply } from '../../function/matrix/apply.js';\nimport { isBigNumber, isNumber } from '../../utils/is.js';\nvar name = 'apply';\nvar dependencies = ['typed', 'isInteger'];\n\n/**\n * Attach a transform function to math.apply\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function apply\n * from one-based to zero based\n */\nexport var createApplyTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n var apply = createApply({\n typed,\n isInteger\n });\n\n // @see: comment of concat itself\n return typed('apply', {\n '...any': function any(args) {\n // change dim from one-based to zero-based\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n try {\n return apply.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createColumn } from '../../function/matrix/column.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'column';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createColumnTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var column = createColumn({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of column itself\n return typed('column', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return column.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { filter, filterRegExp } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nvar name = 'filter';\nvar dependencies = ['typed'];\nexport var createFilterTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.filter\n * Adds a property transform containing the transform function.\n *\n * This transform adds support for equations as test function for math.filter,\n * so you can do something like 'filter([3, -2, 5], x > 0)'.\n */\n function filterTransform(args, math, scope) {\n var x, callback;\n if (args[0]) {\n x = args[0].compile().evaluate(scope);\n }\n if (args[1]) {\n if (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1])) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = args[1].compile().evaluate(scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(args[1], math, scope);\n }\n }\n return filter(x, callback);\n }\n filterTransform.rawArgs = true;\n\n // one based version of function filter\n var filter = typed('filter', {\n 'Array, function': _filter,\n 'Matrix, function': function MatrixFunction(x, test) {\n return x.create(_filter(x.toArray(), test));\n },\n 'Array, RegExp': filterRegExp,\n 'Matrix, RegExp': function MatrixRegExp(x, test) {\n return x.create(filterRegExp(x.toArray(), test));\n }\n });\n return filterTransform;\n}, {\n isTransformFunction: true\n});\n\n/**\n * Filter values in a callback given a callback function\n *\n * !!! Passes a one-based index !!!\n *\n * @param {Array} x\n * @param {Function} callback\n * @return {Array} Returns the filtered array\n * @private\n */\nfunction _filter(x, callback) {\n return filter(x, function (value, index, array) {\n // invoke the callback function with the right number of arguments\n return applyCallback(callback, value, [index + 1], array, 'filter');\n });\n}", "import { isSymbolNode } from '../../../utils/is.js';\nimport { PartitionedMap } from '../../../utils/map.js';\n\n/**\n * Compile an inline expression like \"x > 0\"\n * @param {Node} expression\n * @param {Object} math\n * @param {Map} scope\n * @return {function} Returns a function with one argument which fills in the\n * undefined variable (like \"x\") and evaluates the expression\n */\nexport function compileInlineExpression(expression, math, scope) {\n // find an undefined symbol\n var symbol = expression.filter(function (node) {\n return isSymbolNode(node) && !(node.name in math) && !scope.has(node.name);\n })[0];\n if (!symbol) {\n throw new Error('No undefined variable found in inline expression \"' + expression + '\"');\n }\n\n // create a test function for this equation\n var name = symbol.name; // variable name\n var argsScope = new Map();\n var subScope = new PartitionedMap(scope, argsScope, new Set([name]));\n var eq = expression.compile();\n return function inlineExpression(x) {\n argsScope.set(name, x);\n return eq.evaluate(subScope);\n };\n}", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { forEach } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nvar name = 'forEach';\nvar dependencies = ['typed'];\nexport var createForEachTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.forEach\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n function forEachTransform(args, math, scope) {\n var x, callback;\n if (args[0]) {\n x = args[0].compile().evaluate(scope);\n }\n if (args[1]) {\n if (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1])) {\n // a function pointer, like forEach([3, -2, 5], myTestFunction)\n callback = args[1].compile().evaluate(scope);\n } else {\n // an expression like forEach([3, -2, 5], x > 0 ? callback1(x) : callback2(x) )\n callback = compileInlineExpression(args[1], math, scope);\n }\n }\n return _forEach(x, callback);\n }\n forEachTransform.rawArgs = true;\n\n // one-based version of forEach\n var _forEach = typed('forEach', {\n 'Array | Matrix, function': function ArrayMatrixFunction(array, callback) {\n var recurse = function recurse(value, index) {\n if (Array.isArray(value)) {\n forEach(value, function (child, i) {\n // we create a copy of the index array and append the new index value\n recurse(child, index.concat(i + 1)); // one based index, hence i+1\n });\n } else {\n // invoke the callback function with the right number of arguments\n return applyCallback(callback, value, index, array, 'forEach');\n }\n };\n recurse(array.valueOf(), []); // pass Array\n }\n });\n return forEachTransform;\n}, {\n isTransformFunction: true\n});", "import { isArray, isBigNumber, isMatrix, isNumber, isRange } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'index';\nvar dependencies = ['Index', 'getMatrixDataType'];\nexport var createIndexTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Index,\n getMatrixDataType\n } = _ref;\n /**\n * Attach a transform function to math.index\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n return function indexTransform() {\n var args = [];\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n var arg = arguments[i];\n\n // change from one-based to zero based, convert BigNumber to number and leave Array of Booleans as is\n if (isRange(arg)) {\n arg.start--;\n arg.end -= arg.step > 0 ? 0 : 2;\n } else if (arg && arg.isSet === true) {\n arg = arg.map(function (v) {\n return v - 1;\n });\n } else if (isArray(arg) || isMatrix(arg)) {\n if (getMatrixDataType(arg) !== 'boolean') {\n arg = arg.map(function (v) {\n return v - 1;\n });\n }\n } else if (isNumber(arg)) {\n arg--;\n } else if (isBigNumber(arg)) {\n arg = arg.toNumber() - 1;\n } else if (typeof arg === 'string') {\n // leave as is\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, string, or Range');\n }\n args[i] = arg;\n }\n var res = new Index();\n Index.apply(res, args);\n return res;\n };\n}, {\n isTransformFunction: true\n});", "import { applyCallback } from '../../utils/applyCallback.js';\nimport { map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nvar name = 'map';\nvar dependencies = ['typed'];\nexport var createMapTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.map\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n function mapTransform(args, math, scope) {\n var x, callback;\n if (args[0]) {\n x = args[0].compile().evaluate(scope);\n }\n if (args[1]) {\n if (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1])) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = args[1].compile().evaluate(scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(args[1], math, scope);\n }\n }\n return map(x, callback);\n }\n mapTransform.rawArgs = true;\n\n // one-based version of map function\n var map = typed('map', {\n 'Array, function': function ArrayFunction(x, callback) {\n return _map(x, callback, x);\n },\n 'Matrix, function': function MatrixFunction(x, callback) {\n return x.create(_map(x.valueOf(), callback, x));\n }\n });\n return mapTransform;\n}, {\n isTransformFunction: true\n});\n\n/**\n * Map for a multidimensional array. One-based indexes\n * @param {Array} array\n * @param {function} callback\n * @param {Array} orig\n * @return {Array}\n * @private\n */\nfunction _map(array, callback, orig) {\n function recurse(value, index) {\n if (Array.isArray(value)) {\n return map(value, function (child, i) {\n // we create a copy of the index array and append the new index value\n return recurse(child, index.concat(i + 1)); // one based index, hence i + 1\n });\n } else {\n // invoke the (typed) callback function with the right number of arguments\n return applyCallback(callback, value, index, orig, 'map');\n }\n }\n return recurse(array, []);\n}", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMax } from '../../function/statistics/max.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'max';\nvar dependencies = ['typed', 'config', 'numeric', 'larger'];\nexport var createMaxTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n larger\n } = _ref;\n var max = createMax({\n typed,\n config,\n numeric,\n larger\n });\n\n /**\n * Attach a transform function to math.max\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function max\n * from one-based to zero based\n */\n return typed('max', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return max.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { isBigNumber, isCollection, isNumber } from '../../../utils/is.js';\n\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function lastDimToZeroBase(args) {\n if (args.length === 2 && isCollection(args[0])) {\n args = args.slice();\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n }\n return args;\n}", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMean } from '../../function/statistics/mean.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'mean';\nvar dependencies = ['typed', 'add', 'divide'];\nexport var createMeanTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide\n } = _ref;\n var mean = createMean({\n typed,\n add,\n divide\n });\n\n /**\n * Attach a transform function to math.mean\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function mean\n * from one-based to zero based\n */\n return typed('mean', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return mean.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMin } from '../../function/statistics/min.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'min';\nvar dependencies = ['typed', 'config', 'numeric', 'smaller'];\nexport var createMinTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n smaller\n } = _ref;\n var min = createMin({\n typed,\n config,\n numeric,\n smaller\n });\n\n /**\n * Attach a transform function to math.min\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function min\n * from one-based to zero based\n */\n return typed('min', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return min.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createRange } from '../../function/matrix/range.js';\nvar name = 'range';\nvar dependencies = ['typed', 'config', '?matrix', '?bignumber', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isPositive'];\nexport var createRangeTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n } = _ref;\n var range = createRange({\n typed,\n config,\n matrix,\n bignumber,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isPositive\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('range', {\n '...any': function any(args) {\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (typeof last !== 'boolean') {\n // append a parameter includeEnd=true\n args.push(true);\n }\n return range.apply(null, args);\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createRow } from '../../function/matrix/row.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'row';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createRowTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var row = createRow({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of row itself\n return typed('row', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return row.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSubset } from '../../function/matrix/subset.js';\nvar name = 'subset';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createSubsetTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var subset = createSubset({\n typed,\n matrix,\n zeros,\n add\n });\n\n /**\n * Attach a transform function to math.subset\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('subset', {\n '...any': function any(args) {\n try {\n return subset.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { isBigNumber, isNumber } from '../../utils/is.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createConcat } from '../../function/matrix/concat.js';\nvar name = 'concat';\nvar dependencies = ['typed', 'matrix', 'isInteger'];\nexport var createConcatTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isInteger\n } = _ref;\n var concat = createConcat({\n typed,\n matrix,\n isInteger\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function concat\n * from one-based to zero based\n */\n return typed('concat', {\n '...any': function any(args) {\n // change last argument from one-based to zero-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n } else if (isBigNumber(last)) {\n args[lastIndex] = last.minus(1);\n }\n try {\n return concat.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createDiff } from '../../function/matrix/diff.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'diff';\nvar dependencies = ['typed', 'matrix', 'subtract', 'number', 'bignumber'];\nexport var createDiffTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n number,\n bignumber\n } = _ref;\n var diff = createDiff({\n typed,\n matrix,\n subtract,\n number,\n bignumber\n });\n\n /**\n * Attach a transform function to math.diff\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return diff.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createStd } from '../../function/statistics/std.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'std';\nvar dependencies = ['typed', 'map', 'sqrt', 'variance'];\n\n/**\n * Attach a transform function to math.std\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createStdTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n map,\n sqrt,\n variance\n } = _ref;\n var std = createStd({\n typed,\n map,\n sqrt,\n variance\n });\n return typed('std', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return std.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSum } from '../../function/statistics/sum.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'sum';\nvar dependencies = ['typed', 'config', 'add', 'numeric'];\nexport var createSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n add,\n numeric\n } = _ref;\n var sum = createSum({\n typed,\n config,\n add,\n numeric\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return sum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { createQuantileSeq } from '../../function/statistics/quantileSeq.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'quantileSeq';\nvar dependencies = ['typed', 'bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger'];\n\n/**\n * Attach a transform function to math.quantileSeq\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createQuantileSeqTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n } = _ref;\n var quantileSeq = createQuantileSeq({\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger\n });\n return typed('quantileSeq', {\n 'Array | Matrix, number | BigNumber': quantileSeq,\n 'Array | Matrix, number | BigNumber, number': (arr, prob, dim) => quantileSeq(arr, prob, dimToZeroBase(dim)),\n 'Array | Matrix, number | BigNumber, boolean': quantileSeq,\n 'Array | Matrix, number | BigNumber, boolean, number': (arr, prob, sorted, dim) => quantileSeq(arr, prob, sorted, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix': quantileSeq,\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => quantileSeq(data, prob, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix, boolean': quantileSeq,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => quantileSeq(data, prob, sorted, dimToZeroBase(dim))\n });\n function dimToZeroBase(dim) {\n // TODO: find a better way, maybe lastDimToZeroBase could apply to more cases.\n return lastDimToZeroBase([[], dim])[1];\n }\n}, {\n isTransformFunction: true\n});", "import { isBigNumber, isCollection, isNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createCumSum } from '../../function/statistics/cumsum.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'cumsum';\nvar dependencies = ['typed', 'add', 'unaryPlus'];\nexport var createCumSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n unaryPlus\n } = _ref;\n var cumsum = createCumSum({\n typed,\n add,\n unaryPlus\n });\n return typed(name, {\n '...any': function any(args) {\n // change last argument dim from one-based to zero-based\n if (args.length === 2 && isCollection(args[0])) {\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n }\n try {\n return cumsum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createVariance } from '../../function/statistics/variance.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'variance';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'apply', 'isNaN'];\n\n/**\n * Attach a transform function to math.var\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function var\n * from one-based to zero based\n */\nexport var createVarianceTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n } = _ref;\n var variance = createVariance({\n typed,\n add,\n subtract,\n multiply,\n divide,\n apply,\n isNaN\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return variance.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});", "import { createPrint } from '../../function/string/print.js';\nimport { factory } from '../../utils/factory.js';\nimport { printTemplate } from '../../utils/print.js';\nvar name = 'print';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createPrintTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var print = createPrint({\n typed,\n matrix,\n zeros,\n add\n });\n return typed(name, {\n 'string, Object | Array': function stringObjectArray(template, values) {\n return print(_convertTemplateToZeroBasedIndex(template), values);\n },\n 'string, Object | Array, number | Object': function stringObjectArrayNumberObject(template, values, options) {\n return print(_convertTemplateToZeroBasedIndex(template), values, options);\n }\n });\n function _convertTemplateToZeroBasedIndex(template) {\n return template.replace(printTemplate, x => {\n var parts = x.slice(1).split('.');\n var result = parts.map(function (part) {\n if (!isNaN(part) && part.length > 0) {\n return parseInt(part) - 1;\n } else {\n return part;\n }\n });\n return '$' + result.join('.');\n });\n }\n}, {\n isTransformFunction: true\n});", "import { createAnd } from '../../function/logical/and.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'and';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var and = createAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function andTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && !and(condition1, true)) {\n return false;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return and(condition1, condition2);\n }\n andTransform.rawArgs = true;\n return andTransform;\n}, {\n isTransformFunction: true\n});", "import { createOr } from '../../function/logical/or.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'or';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var or = createOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function orTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && or(condition1, false)) {\n return true;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return or(condition1, condition2);\n }\n orTransform.rawArgs = true;\n return orTransform;\n}, {\n isTransformFunction: true\n});", "import { createBitAnd } from '../../function/bitwise/bitAnd.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitAnd';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createBitAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var bitAnd = createBitAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function bitAndTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === 0 || condition1 === false) {\n return 0;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitAnd(condition1, condition2);\n }\n bitAndTransform.rawArgs = true;\n return bitAndTransform;\n}, {\n isTransformFunction: true\n});", "import { createBitOr } from '../../function/bitwise/bitOr.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitOr';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createBitOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var bitOr = createBitOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function bitOrTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === -1) {\n return -1;\n }\n if (condition1 === true) {\n return 1;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitOr(condition1, condition2);\n }\n bitOrTransform.rawArgs = true;\n return bitOrTransform;\n}, {\n isTransformFunction: true\n});", "/**\n * THIS FILE IS AUTO-GENERATED\n * DON'T MAKE CHANGES HERE\n */\nexport { absDependencies } from './dependenciesAny/dependenciesAbs.generated.js';\nexport { AccessorNodeDependencies } from './dependenciesAny/dependenciesAccessorNode.generated.js';\nexport { acosDependencies } from './dependenciesAny/dependenciesAcos.generated.js';\nexport { acoshDependencies } from './dependenciesAny/dependenciesAcosh.generated.js';\nexport { acotDependencies } from './dependenciesAny/dependenciesAcot.generated.js';\nexport { acothDependencies } from './dependenciesAny/dependenciesAcoth.generated.js';\nexport { acscDependencies } from './dependenciesAny/dependenciesAcsc.generated.js';\nexport { acschDependencies } from './dependenciesAny/dependenciesAcsch.generated.js';\nexport { addDependencies } from './dependenciesAny/dependenciesAdd.generated.js';\nexport { addScalarDependencies } from './dependenciesAny/dependenciesAddScalar.generated.js';\nexport { andDependencies } from './dependenciesAny/dependenciesAnd.generated.js';\nexport { andTransformDependencies } from './dependenciesAny/dependenciesAndTransform.generated.js';\nexport { applyDependencies } from './dependenciesAny/dependenciesApply.generated.js';\nexport { applyTransformDependencies } from './dependenciesAny/dependenciesApplyTransform.generated.js';\nexport { argDependencies } from './dependenciesAny/dependenciesArg.generated.js';\nexport { ArrayNodeDependencies } from './dependenciesAny/dependenciesArrayNode.generated.js';\nexport { asecDependencies } from './dependenciesAny/dependenciesAsec.generated.js';\nexport { asechDependencies } from './dependenciesAny/dependenciesAsech.generated.js';\nexport { asinDependencies } from './dependenciesAny/dependenciesAsin.generated.js';\nexport { asinhDependencies } from './dependenciesAny/dependenciesAsinh.generated.js';\nexport { AssignmentNodeDependencies } from './dependenciesAny/dependenciesAssignmentNode.generated.js';\nexport { atanDependencies } from './dependenciesAny/dependenciesAtan.generated.js';\nexport { atan2Dependencies } from './dependenciesAny/dependenciesAtan2.generated.js';\nexport { atanhDependencies } from './dependenciesAny/dependenciesAtanh.generated.js';\nexport { atomicMassDependencies } from './dependenciesAny/dependenciesAtomicMass.generated.js';\nexport { avogadroDependencies } from './dependenciesAny/dependenciesAvogadro.generated.js';\nexport { bellNumbersDependencies } from './dependenciesAny/dependenciesBellNumbers.generated.js';\nexport { BigNumberDependencies } from './dependenciesAny/dependenciesBigNumberClass.generated.js';\nexport { bigintDependencies } from './dependenciesAny/dependenciesBigint.generated.js';\nexport { bignumberDependencies } from './dependenciesAny/dependenciesBignumber.generated.js';\nexport { binDependencies } from './dependenciesAny/dependenciesBin.generated.js';\nexport { bitAndDependencies } from './dependenciesAny/dependenciesBitAnd.generated.js';\nexport { bitAndTransformDependencies } from './dependenciesAny/dependenciesBitAndTransform.generated.js';\nexport { bitNotDependencies } from './dependenciesAny/dependenciesBitNot.generated.js';\nexport { bitOrDependencies } from './dependenciesAny/dependenciesBitOr.generated.js';\nexport { bitOrTransformDependencies } from './dependenciesAny/dependenciesBitOrTransform.generated.js';\nexport { bitXorDependencies } from './dependenciesAny/dependenciesBitXor.generated.js';\nexport { BlockNodeDependencies } from './dependenciesAny/dependenciesBlockNode.generated.js';\nexport { bohrMagnetonDependencies } from './dependenciesAny/dependenciesBohrMagneton.generated.js';\nexport { bohrRadiusDependencies } from './dependenciesAny/dependenciesBohrRadius.generated.js';\nexport { boltzmannDependencies } from './dependenciesAny/dependenciesBoltzmann.generated.js';\nexport { booleanDependencies } from './dependenciesAny/dependenciesBoolean.generated.js';\nexport { catalanDependencies } from './dependenciesAny/dependenciesCatalan.generated.js';\nexport { cbrtDependencies } from './dependenciesAny/dependenciesCbrt.generated.js';\nexport { ceilDependencies } from './dependenciesAny/dependenciesCeil.generated.js';\nexport { chainDependencies } from './dependenciesAny/dependenciesChain.generated.js';\nexport { ChainDependencies } from './dependenciesAny/dependenciesChainClass.generated.js';\nexport { classicalElectronRadiusDependencies } from './dependenciesAny/dependenciesClassicalElectronRadius.generated.js';\nexport { cloneDependencies } from './dependenciesAny/dependenciesClone.generated.js';\nexport { columnDependencies } from './dependenciesAny/dependenciesColumn.generated.js';\nexport { columnTransformDependencies } from './dependenciesAny/dependenciesColumnTransform.generated.js';\nexport { combinationsDependencies } from './dependenciesAny/dependenciesCombinations.generated.js';\nexport { combinationsWithRepDependencies } from './dependenciesAny/dependenciesCombinationsWithRep.generated.js';\nexport { compareDependencies } from './dependenciesAny/dependenciesCompare.generated.js';\nexport { compareNaturalDependencies } from './dependenciesAny/dependenciesCompareNatural.generated.js';\nexport { compareTextDependencies } from './dependenciesAny/dependenciesCompareText.generated.js';\nexport { compileDependencies } from './dependenciesAny/dependenciesCompile.generated.js';\nexport { complexDependencies } from './dependenciesAny/dependenciesComplex.generated.js';\nexport { ComplexDependencies } from './dependenciesAny/dependenciesComplexClass.generated.js';\nexport { compositionDependencies } from './dependenciesAny/dependenciesComposition.generated.js';\nexport { concatDependencies } from './dependenciesAny/dependenciesConcat.generated.js';\nexport { concatTransformDependencies } from './dependenciesAny/dependenciesConcatTransform.generated.js';\nexport { ConditionalNodeDependencies } from './dependenciesAny/dependenciesConditionalNode.generated.js';\nexport { conductanceQuantumDependencies } from './dependenciesAny/dependenciesConductanceQuantum.generated.js';\nexport { conjDependencies } from './dependenciesAny/dependenciesConj.generated.js';\nexport { ConstantNodeDependencies } from './dependenciesAny/dependenciesConstantNode.generated.js';\nexport { corrDependencies } from './dependenciesAny/dependenciesCorr.generated.js';\nexport { cosDependencies } from './dependenciesAny/dependenciesCos.generated.js';\nexport { coshDependencies } from './dependenciesAny/dependenciesCosh.generated.js';\nexport { cotDependencies } from './dependenciesAny/dependenciesCot.generated.js';\nexport { cothDependencies } from './dependenciesAny/dependenciesCoth.generated.js';\nexport { coulombDependencies } from './dependenciesAny/dependenciesCoulomb.generated.js';\nexport { countDependencies } from './dependenciesAny/dependenciesCount.generated.js';\nexport { createUnitDependencies } from './dependenciesAny/dependenciesCreateUnit.generated.js';\nexport { crossDependencies } from './dependenciesAny/dependenciesCross.generated.js';\nexport { cscDependencies } from './dependenciesAny/dependenciesCsc.generated.js';\nexport { cschDependencies } from './dependenciesAny/dependenciesCsch.generated.js';\nexport { ctransposeDependencies } from './dependenciesAny/dependenciesCtranspose.generated.js';\nexport { cubeDependencies } from './dependenciesAny/dependenciesCube.generated.js';\nexport { cumsumDependencies } from './dependenciesAny/dependenciesCumSum.generated.js';\nexport { cumsumTransformDependencies } from './dependenciesAny/dependenciesCumSumTransform.generated.js';\nexport { deepEqualDependencies } from './dependenciesAny/dependenciesDeepEqual.generated.js';\nexport { DenseMatrixDependencies } from './dependenciesAny/dependenciesDenseMatrixClass.generated.js';\nexport { derivativeDependencies } from './dependenciesAny/dependenciesDerivative.generated.js';\nexport { detDependencies } from './dependenciesAny/dependenciesDet.generated.js';\nexport { deuteronMassDependencies } from './dependenciesAny/dependenciesDeuteronMass.generated.js';\nexport { diagDependencies } from './dependenciesAny/dependenciesDiag.generated.js';\nexport { diffDependencies } from './dependenciesAny/dependenciesDiff.generated.js';\nexport { diffTransformDependencies } from './dependenciesAny/dependenciesDiffTransform.generated.js';\nexport { distanceDependencies } from './dependenciesAny/dependenciesDistance.generated.js';\nexport { divideDependencies } from './dependenciesAny/dependenciesDivide.generated.js';\nexport { divideScalarDependencies } from './dependenciesAny/dependenciesDivideScalar.generated.js';\nexport { dotDependencies } from './dependenciesAny/dependenciesDot.generated.js';\nexport { dotDivideDependencies } from './dependenciesAny/dependenciesDotDivide.generated.js';\nexport { dotMultiplyDependencies } from './dependenciesAny/dependenciesDotMultiply.generated.js';\nexport { dotPowDependencies } from './dependenciesAny/dependenciesDotPow.generated.js';\nexport { eDependencies } from './dependenciesAny/dependenciesE.generated.js';\nexport { efimovFactorDependencies } from './dependenciesAny/dependenciesEfimovFactor.generated.js';\nexport { eigsDependencies } from './dependenciesAny/dependenciesEigs.generated.js';\nexport { electricConstantDependencies } from './dependenciesAny/dependenciesElectricConstant.generated.js';\nexport { electronMassDependencies } from './dependenciesAny/dependenciesElectronMass.generated.js';\nexport { elementaryChargeDependencies } from './dependenciesAny/dependenciesElementaryCharge.generated.js';\nexport { equalDependencies } from './dependenciesAny/dependenciesEqual.generated.js';\nexport { equalScalarDependencies } from './dependenciesAny/dependenciesEqualScalar.generated.js';\nexport { equalTextDependencies } from './dependenciesAny/dependenciesEqualText.generated.js';\nexport { erfDependencies } from './dependenciesAny/dependenciesErf.generated.js';\nexport { evaluateDependencies } from './dependenciesAny/dependenciesEvaluate.generated.js';\nexport { expDependencies } from './dependenciesAny/dependenciesExp.generated.js';\nexport { expmDependencies } from './dependenciesAny/dependenciesExpm.generated.js';\nexport { expm1Dependencies } from './dependenciesAny/dependenciesExpm1.generated.js';\nexport { factorialDependencies } from './dependenciesAny/dependenciesFactorial.generated.js';\nexport { falseDependencies } from './dependenciesAny/dependenciesFalse.generated.js';\nexport { faradayDependencies } from './dependenciesAny/dependenciesFaraday.generated.js';\nexport { fermiCouplingDependencies } from './dependenciesAny/dependenciesFermiCoupling.generated.js';\nexport { fftDependencies } from './dependenciesAny/dependenciesFft.generated.js';\nexport { FibonacciHeapDependencies } from './dependenciesAny/dependenciesFibonacciHeapClass.generated.js';\nexport { filterDependencies } from './dependenciesAny/dependenciesFilter.generated.js';\nexport { filterTransformDependencies } from './dependenciesAny/dependenciesFilterTransform.generated.js';\nexport { fineStructureDependencies } from './dependenciesAny/dependenciesFineStructure.generated.js';\nexport { firstRadiationDependencies } from './dependenciesAny/dependenciesFirstRadiation.generated.js';\nexport { fixDependencies } from './dependenciesAny/dependenciesFix.generated.js';\nexport { flattenDependencies } from './dependenciesAny/dependenciesFlatten.generated.js';\nexport { floorDependencies } from './dependenciesAny/dependenciesFloor.generated.js';\nexport { forEachDependencies } from './dependenciesAny/dependenciesForEach.generated.js';\nexport { forEachTransformDependencies } from './dependenciesAny/dependenciesForEachTransform.generated.js';\nexport { formatDependencies } from './dependenciesAny/dependenciesFormat.generated.js';\nexport { fractionDependencies } from './dependenciesAny/dependenciesFraction.generated.js';\nexport { FractionDependencies } from './dependenciesAny/dependenciesFractionClass.generated.js';\nexport { freqzDependencies } from './dependenciesAny/dependenciesFreqz.generated.js';\nexport { FunctionAssignmentNodeDependencies } from './dependenciesAny/dependenciesFunctionAssignmentNode.generated.js';\nexport { FunctionNodeDependencies } from './dependenciesAny/dependenciesFunctionNode.generated.js';\nexport { gammaDependencies } from './dependenciesAny/dependenciesGamma.generated.js';\nexport { gasConstantDependencies } from './dependenciesAny/dependenciesGasConstant.generated.js';\nexport { gcdDependencies } from './dependenciesAny/dependenciesGcd.generated.js';\nexport { getMatrixDataTypeDependencies } from './dependenciesAny/dependenciesGetMatrixDataType.generated.js';\nexport { gravitationConstantDependencies } from './dependenciesAny/dependenciesGravitationConstant.generated.js';\nexport { gravityDependencies } from './dependenciesAny/dependenciesGravity.generated.js';\nexport { hartreeEnergyDependencies } from './dependenciesAny/dependenciesHartreeEnergy.generated.js';\nexport { hasNumericValueDependencies } from './dependenciesAny/dependenciesHasNumericValue.generated.js';\nexport { helpDependencies } from './dependenciesAny/dependenciesHelp.generated.js';\nexport { HelpDependencies } from './dependenciesAny/dependenciesHelpClass.generated.js';\nexport { hexDependencies } from './dependenciesAny/dependenciesHex.generated.js';\nexport { hypotDependencies } from './dependenciesAny/dependenciesHypot.generated.js';\nexport { iDependencies } from './dependenciesAny/dependenciesI.generated.js';\nexport { identityDependencies } from './dependenciesAny/dependenciesIdentity.generated.js';\nexport { ifftDependencies } from './dependenciesAny/dependenciesIfft.generated.js';\nexport { imDependencies } from './dependenciesAny/dependenciesIm.generated.js';\nexport { ImmutableDenseMatrixDependencies } from './dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js';\nexport { indexDependencies } from './dependenciesAny/dependenciesIndex.generated.js';\nexport { IndexDependencies } from './dependenciesAny/dependenciesIndexClass.generated.js';\nexport { IndexNodeDependencies } from './dependenciesAny/dependenciesIndexNode.generated.js';\nexport { indexTransformDependencies } from './dependenciesAny/dependenciesIndexTransform.generated.js';\nexport { InfinityDependencies } from './dependenciesAny/dependenciesInfinity.generated.js';\nexport { intersectDependencies } from './dependenciesAny/dependenciesIntersect.generated.js';\nexport { invDependencies } from './dependenciesAny/dependenciesInv.generated.js';\nexport { inverseConductanceQuantumDependencies } from './dependenciesAny/dependenciesInverseConductanceQuantum.generated.js';\nexport { invmodDependencies } from './dependenciesAny/dependenciesInvmod.generated.js';\nexport { isIntegerDependencies } from './dependenciesAny/dependenciesIsInteger.generated.js';\nexport { isNaNDependencies } from './dependenciesAny/dependenciesIsNaN.generated.js';\nexport { isNegativeDependencies } from './dependenciesAny/dependenciesIsNegative.generated.js';\nexport { isNumericDependencies } from './dependenciesAny/dependenciesIsNumeric.generated.js';\nexport { isPositiveDependencies } from './dependenciesAny/dependenciesIsPositive.generated.js';\nexport { isPrimeDependencies } from './dependenciesAny/dependenciesIsPrime.generated.js';\nexport { isZeroDependencies } from './dependenciesAny/dependenciesIsZero.generated.js';\nexport { kldivergenceDependencies } from './dependenciesAny/dependenciesKldivergence.generated.js';\nexport { klitzingDependencies } from './dependenciesAny/dependenciesKlitzing.generated.js';\nexport { kronDependencies } from './dependenciesAny/dependenciesKron.generated.js';\nexport { LN10Dependencies } from './dependenciesAny/dependenciesLN10.generated.js';\nexport { LN2Dependencies } from './dependenciesAny/dependenciesLN2.generated.js';\nexport { LOG10EDependencies } from './dependenciesAny/dependenciesLOG10E.generated.js';\nexport { LOG2EDependencies } from './dependenciesAny/dependenciesLOG2E.generated.js';\nexport { largerDependencies } from './dependenciesAny/dependenciesLarger.generated.js';\nexport { largerEqDependencies } from './dependenciesAny/dependenciesLargerEq.generated.js';\nexport { lcmDependencies } from './dependenciesAny/dependenciesLcm.generated.js';\nexport { leafCountDependencies } from './dependenciesAny/dependenciesLeafCount.generated.js';\nexport { leftShiftDependencies } from './dependenciesAny/dependenciesLeftShift.generated.js';\nexport { lgammaDependencies } from './dependenciesAny/dependenciesLgamma.generated.js';\nexport { logDependencies } from './dependenciesAny/dependenciesLog.generated.js';\nexport { log10Dependencies } from './dependenciesAny/dependenciesLog10.generated.js';\nexport { log1pDependencies } from './dependenciesAny/dependenciesLog1p.generated.js';\nexport { log2Dependencies } from './dependenciesAny/dependenciesLog2.generated.js';\nexport { loschmidtDependencies } from './dependenciesAny/dependenciesLoschmidt.generated.js';\nexport { lsolveDependencies } from './dependenciesAny/dependenciesLsolve.generated.js';\nexport { lsolveAllDependencies } from './dependenciesAny/dependenciesLsolveAll.generated.js';\nexport { lupDependencies } from './dependenciesAny/dependenciesLup.generated.js';\nexport { lusolveDependencies } from './dependenciesAny/dependenciesLusolve.generated.js';\nexport { lyapDependencies } from './dependenciesAny/dependenciesLyap.generated.js';\nexport { madDependencies } from './dependenciesAny/dependenciesMad.generated.js';\nexport { magneticConstantDependencies } from './dependenciesAny/dependenciesMagneticConstant.generated.js';\nexport { magneticFluxQuantumDependencies } from './dependenciesAny/dependenciesMagneticFluxQuantum.generated.js';\nexport { mapDependencies } from './dependenciesAny/dependenciesMap.generated.js';\nexport { mapTransformDependencies } from './dependenciesAny/dependenciesMapTransform.generated.js';\nexport { matrixDependencies } from './dependenciesAny/dependenciesMatrix.generated.js';\nexport { MatrixDependencies } from './dependenciesAny/dependenciesMatrixClass.generated.js';\nexport { matrixFromColumnsDependencies } from './dependenciesAny/dependenciesMatrixFromColumns.generated.js';\nexport { matrixFromFunctionDependencies } from './dependenciesAny/dependenciesMatrixFromFunction.generated.js';\nexport { matrixFromRowsDependencies } from './dependenciesAny/dependenciesMatrixFromRows.generated.js';\nexport { maxDependencies } from './dependenciesAny/dependenciesMax.generated.js';\nexport { maxTransformDependencies } from './dependenciesAny/dependenciesMaxTransform.generated.js';\nexport { meanDependencies } from './dependenciesAny/dependenciesMean.generated.js';\nexport { meanTransformDependencies } from './dependenciesAny/dependenciesMeanTransform.generated.js';\nexport { medianDependencies } from './dependenciesAny/dependenciesMedian.generated.js';\nexport { minDependencies } from './dependenciesAny/dependenciesMin.generated.js';\nexport { minTransformDependencies } from './dependenciesAny/dependenciesMinTransform.generated.js';\nexport { modDependencies } from './dependenciesAny/dependenciesMod.generated.js';\nexport { modeDependencies } from './dependenciesAny/dependenciesMode.generated.js';\nexport { molarMassDependencies } from './dependenciesAny/dependenciesMolarMass.generated.js';\nexport { molarMassC12Dependencies } from './dependenciesAny/dependenciesMolarMassC12.generated.js';\nexport { molarPlanckConstantDependencies } from './dependenciesAny/dependenciesMolarPlanckConstant.generated.js';\nexport { molarVolumeDependencies } from './dependenciesAny/dependenciesMolarVolume.generated.js';\nexport { multinomialDependencies } from './dependenciesAny/dependenciesMultinomial.generated.js';\nexport { multiplyDependencies } from './dependenciesAny/dependenciesMultiply.generated.js';\nexport { multiplyScalarDependencies } from './dependenciesAny/dependenciesMultiplyScalar.generated.js';\nexport { NaNDependencies } from './dependenciesAny/dependenciesNaN.generated.js';\nexport { neutronMassDependencies } from './dependenciesAny/dependenciesNeutronMass.generated.js';\nexport { NodeDependencies } from './dependenciesAny/dependenciesNode.generated.js';\nexport { normDependencies } from './dependenciesAny/dependenciesNorm.generated.js';\nexport { notDependencies } from './dependenciesAny/dependenciesNot.generated.js';\nexport { nthRootDependencies } from './dependenciesAny/dependenciesNthRoot.generated.js';\nexport { nthRootsDependencies } from './dependenciesAny/dependenciesNthRoots.generated.js';\nexport { nuclearMagnetonDependencies } from './dependenciesAny/dependenciesNuclearMagneton.generated.js';\nexport { nullDependencies } from './dependenciesAny/dependenciesNull.generated.js';\nexport { numberDependencies } from './dependenciesAny/dependenciesNumber.generated.js';\nexport { numericDependencies } from './dependenciesAny/dependenciesNumeric.generated.js';\nexport { ObjectNodeDependencies } from './dependenciesAny/dependenciesObjectNode.generated.js';\nexport { octDependencies } from './dependenciesAny/dependenciesOct.generated.js';\nexport { onesDependencies } from './dependenciesAny/dependenciesOnes.generated.js';\nexport { OperatorNodeDependencies } from './dependenciesAny/dependenciesOperatorNode.generated.js';\nexport { orDependencies } from './dependenciesAny/dependenciesOr.generated.js';\nexport { orTransformDependencies } from './dependenciesAny/dependenciesOrTransform.generated.js';\nexport { ParenthesisNodeDependencies } from './dependenciesAny/dependenciesParenthesisNode.generated.js';\nexport { parseDependencies } from './dependenciesAny/dependenciesParse.generated.js';\nexport { parserDependencies } from './dependenciesAny/dependenciesParser.generated.js';\nexport { ParserDependencies } from './dependenciesAny/dependenciesParserClass.generated.js';\nexport { partitionSelectDependencies } from './dependenciesAny/dependenciesPartitionSelect.generated.js';\nexport { permutationsDependencies } from './dependenciesAny/dependenciesPermutations.generated.js';\nexport { phiDependencies } from './dependenciesAny/dependenciesPhi.generated.js';\nexport { piDependencies } from './dependenciesAny/dependenciesPi.generated.js';\nexport { pickRandomDependencies } from './dependenciesAny/dependenciesPickRandom.generated.js';\nexport { pinvDependencies } from './dependenciesAny/dependenciesPinv.generated.js';\nexport { planckChargeDependencies } from './dependenciesAny/dependenciesPlanckCharge.generated.js';\nexport { planckConstantDependencies } from './dependenciesAny/dependenciesPlanckConstant.generated.js';\nexport { planckLengthDependencies } from './dependenciesAny/dependenciesPlanckLength.generated.js';\nexport { planckMassDependencies } from './dependenciesAny/dependenciesPlanckMass.generated.js';\nexport { planckTemperatureDependencies } from './dependenciesAny/dependenciesPlanckTemperature.generated.js';\nexport { planckTimeDependencies } from './dependenciesAny/dependenciesPlanckTime.generated.js';\nexport { polynomialRootDependencies } from './dependenciesAny/dependenciesPolynomialRoot.generated.js';\nexport { powDependencies } from './dependenciesAny/dependenciesPow.generated.js';\nexport { printDependencies } from './dependenciesAny/dependenciesPrint.generated.js';\nexport { printTransformDependencies } from './dependenciesAny/dependenciesPrintTransform.generated.js';\nexport { prodDependencies } from './dependenciesAny/dependenciesProd.generated.js';\nexport { protonMassDependencies } from './dependenciesAny/dependenciesProtonMass.generated.js';\nexport { qrDependencies } from './dependenciesAny/dependenciesQr.generated.js';\nexport { quantileSeqDependencies } from './dependenciesAny/dependenciesQuantileSeq.generated.js';\nexport { quantileSeqTransformDependencies } from './dependenciesAny/dependenciesQuantileSeqTransform.generated.js';\nexport { quantumOfCirculationDependencies } from './dependenciesAny/dependenciesQuantumOfCirculation.generated.js';\nexport { randomDependencies } from './dependenciesAny/dependenciesRandom.generated.js';\nexport { randomIntDependencies } from './dependenciesAny/dependenciesRandomInt.generated.js';\nexport { rangeDependencies } from './dependenciesAny/dependenciesRange.generated.js';\nexport { RangeDependencies } from './dependenciesAny/dependenciesRangeClass.generated.js';\nexport { RangeNodeDependencies } from './dependenciesAny/dependenciesRangeNode.generated.js';\nexport { rangeTransformDependencies } from './dependenciesAny/dependenciesRangeTransform.generated.js';\nexport { rationalizeDependencies } from './dependenciesAny/dependenciesRationalize.generated.js';\nexport { reDependencies } from './dependenciesAny/dependenciesRe.generated.js';\nexport { reducedPlanckConstantDependencies } from './dependenciesAny/dependenciesReducedPlanckConstant.generated.js';\nexport { RelationalNodeDependencies } from './dependenciesAny/dependenciesRelationalNode.generated.js';\nexport { replacerDependencies } from './dependenciesAny/dependenciesReplacer.generated.js';\nexport { reshapeDependencies } from './dependenciesAny/dependenciesReshape.generated.js';\nexport { resizeDependencies } from './dependenciesAny/dependenciesResize.generated.js';\nexport { resolveDependencies } from './dependenciesAny/dependenciesResolve.generated.js';\nexport { ResultSetDependencies } from './dependenciesAny/dependenciesResultSet.generated.js';\nexport { reviverDependencies } from './dependenciesAny/dependenciesReviver.generated.js';\nexport { rightArithShiftDependencies } from './dependenciesAny/dependenciesRightArithShift.generated.js';\nexport { rightLogShiftDependencies } from './dependenciesAny/dependenciesRightLogShift.generated.js';\nexport { rotateDependencies } from './dependenciesAny/dependenciesRotate.generated.js';\nexport { rotationMatrixDependencies } from './dependenciesAny/dependenciesRotationMatrix.generated.js';\nexport { roundDependencies } from './dependenciesAny/dependenciesRound.generated.js';\nexport { rowDependencies } from './dependenciesAny/dependenciesRow.generated.js';\nexport { rowTransformDependencies } from './dependenciesAny/dependenciesRowTransform.generated.js';\nexport { rydbergDependencies } from './dependenciesAny/dependenciesRydberg.generated.js';\nexport { SQRT1_2Dependencies } from './dependenciesAny/dependenciesSQRT1_2.generated.js'; // eslint-disable-line camelcase\nexport { SQRT2Dependencies } from './dependenciesAny/dependenciesSQRT2.generated.js';\nexport { sackurTetrodeDependencies } from './dependenciesAny/dependenciesSackurTetrode.generated.js';\nexport { schurDependencies } from './dependenciesAny/dependenciesSchur.generated.js';\nexport { secDependencies } from './dependenciesAny/dependenciesSec.generated.js';\nexport { sechDependencies } from './dependenciesAny/dependenciesSech.generated.js';\nexport { secondRadiationDependencies } from './dependenciesAny/dependenciesSecondRadiation.generated.js';\nexport { setCartesianDependencies } from './dependenciesAny/dependenciesSetCartesian.generated.js';\nexport { setDifferenceDependencies } from './dependenciesAny/dependenciesSetDifference.generated.js';\nexport { setDistinctDependencies } from './dependenciesAny/dependenciesSetDistinct.generated.js';\nexport { setIntersectDependencies } from './dependenciesAny/dependenciesSetIntersect.generated.js';\nexport { setIsSubsetDependencies } from './dependenciesAny/dependenciesSetIsSubset.generated.js';\nexport { setMultiplicityDependencies } from './dependenciesAny/dependenciesSetMultiplicity.generated.js';\nexport { setPowersetDependencies } from './dependenciesAny/dependenciesSetPowerset.generated.js';\nexport { setSizeDependencies } from './dependenciesAny/dependenciesSetSize.generated.js';\nexport { setSymDifferenceDependencies } from './dependenciesAny/dependenciesSetSymDifference.generated.js';\nexport { setUnionDependencies } from './dependenciesAny/dependenciesSetUnion.generated.js';\nexport { signDependencies } from './dependenciesAny/dependenciesSign.generated.js';\nexport { simplifyDependencies } from './dependenciesAny/dependenciesSimplify.generated.js';\nexport { simplifyConstantDependencies } from './dependenciesAny/dependenciesSimplifyConstant.generated.js';\nexport { simplifyCoreDependencies } from './dependenciesAny/dependenciesSimplifyCore.generated.js';\nexport { sinDependencies } from './dependenciesAny/dependenciesSin.generated.js';\nexport { sinhDependencies } from './dependenciesAny/dependenciesSinh.generated.js';\nexport { sizeDependencies } from './dependenciesAny/dependenciesSize.generated.js';\nexport { sluDependencies } from './dependenciesAny/dependenciesSlu.generated.js';\nexport { smallerDependencies } from './dependenciesAny/dependenciesSmaller.generated.js';\nexport { smallerEqDependencies } from './dependenciesAny/dependenciesSmallerEq.generated.js';\nexport { solveODEDependencies } from './dependenciesAny/dependenciesSolveODE.generated.js';\nexport { sortDependencies } from './dependenciesAny/dependenciesSort.generated.js';\nexport { SpaDependencies } from './dependenciesAny/dependenciesSpaClass.generated.js';\nexport { sparseDependencies } from './dependenciesAny/dependenciesSparse.generated.js';\nexport { SparseMatrixDependencies } from './dependenciesAny/dependenciesSparseMatrixClass.generated.js';\nexport { speedOfLightDependencies } from './dependenciesAny/dependenciesSpeedOfLight.generated.js';\nexport { splitUnitDependencies } from './dependenciesAny/dependenciesSplitUnit.generated.js';\nexport { sqrtDependencies } from './dependenciesAny/dependenciesSqrt.generated.js';\nexport { sqrtmDependencies } from './dependenciesAny/dependenciesSqrtm.generated.js';\nexport { squareDependencies } from './dependenciesAny/dependenciesSquare.generated.js';\nexport { squeezeDependencies } from './dependenciesAny/dependenciesSqueeze.generated.js';\nexport { stdDependencies } from './dependenciesAny/dependenciesStd.generated.js';\nexport { stdTransformDependencies } from './dependenciesAny/dependenciesStdTransform.generated.js';\nexport { stefanBoltzmannDependencies } from './dependenciesAny/dependenciesStefanBoltzmann.generated.js';\nexport { stirlingS2Dependencies } from './dependenciesAny/dependenciesStirlingS2.generated.js';\nexport { stringDependencies } from './dependenciesAny/dependenciesString.generated.js';\nexport { subsetDependencies } from './dependenciesAny/dependenciesSubset.generated.js';\nexport { subsetTransformDependencies } from './dependenciesAny/dependenciesSubsetTransform.generated.js';\nexport { subtractDependencies } from './dependenciesAny/dependenciesSubtract.generated.js';\nexport { subtractScalarDependencies } from './dependenciesAny/dependenciesSubtractScalar.generated.js';\nexport { sumDependencies } from './dependenciesAny/dependenciesSum.generated.js';\nexport { sumTransformDependencies } from './dependenciesAny/dependenciesSumTransform.generated.js';\nexport { sylvesterDependencies } from './dependenciesAny/dependenciesSylvester.generated.js';\nexport { SymbolNodeDependencies } from './dependenciesAny/dependenciesSymbolNode.generated.js';\nexport { symbolicEqualDependencies } from './dependenciesAny/dependenciesSymbolicEqual.generated.js';\nexport { tanDependencies } from './dependenciesAny/dependenciesTan.generated.js';\nexport { tanhDependencies } from './dependenciesAny/dependenciesTanh.generated.js';\nexport { tauDependencies } from './dependenciesAny/dependenciesTau.generated.js';\nexport { thomsonCrossSectionDependencies } from './dependenciesAny/dependenciesThomsonCrossSection.generated.js';\nexport { toDependencies } from './dependenciesAny/dependenciesTo.generated.js';\nexport { traceDependencies } from './dependenciesAny/dependenciesTrace.generated.js';\nexport { transposeDependencies } from './dependenciesAny/dependenciesTranspose.generated.js';\nexport { trueDependencies } from './dependenciesAny/dependenciesTrue.generated.js';\nexport { typeOfDependencies } from './dependenciesAny/dependenciesTypeOf.generated.js';\nexport { typedDependencies } from './dependenciesAny/dependenciesTyped.generated.js';\nexport { unaryMinusDependencies } from './dependenciesAny/dependenciesUnaryMinus.generated.js';\nexport { unaryPlusDependencies } from './dependenciesAny/dependenciesUnaryPlus.generated.js';\nexport { unequalDependencies } from './dependenciesAny/dependenciesUnequal.generated.js';\nexport { UnitDependencies } from './dependenciesAny/dependenciesUnitClass.generated.js';\nexport { unitDependencies } from './dependenciesAny/dependenciesUnitFunction.generated.js';\nexport { EDependencies } from './dependenciesAny/dependenciesUppercaseE.generated.js';\nexport { PIDependencies } from './dependenciesAny/dependenciesUppercasePi.generated.js';\nexport { usolveDependencies } from './dependenciesAny/dependenciesUsolve.generated.js';\nexport { usolveAllDependencies } from './dependenciesAny/dependenciesUsolveAll.generated.js';\nexport { vacuumImpedanceDependencies } from './dependenciesAny/dependenciesVacuumImpedance.generated.js';\nexport { varianceDependencies } from './dependenciesAny/dependenciesVariance.generated.js';\nexport { varianceTransformDependencies } from './dependenciesAny/dependenciesVarianceTransform.generated.js';\nexport { versionDependencies } from './dependenciesAny/dependenciesVersion.generated.js';\nexport { weakMixingAngleDependencies } from './dependenciesAny/dependenciesWeakMixingAngle.generated.js';\nexport { wienDisplacementDependencies } from './dependenciesAny/dependenciesWienDisplacement.generated.js';\nexport { xgcdDependencies } from './dependenciesAny/dependenciesXgcd.generated.js';\nexport { xorDependencies } from './dependenciesAny/dependenciesXor.generated.js';\nexport { zerosDependencies } from './dependenciesAny/dependenciesZeros.generated.js';\nexport { zetaDependencies } from './dependenciesAny/dependenciesZeta.generated.js';\nexport { zpk2tfDependencies } from './dependenciesAny/dependenciesZpk2tf.generated.js';\nexport { all } from './allFactoriesAny.js';", "// creating all factories here in a separate file is needed to get tree-shaking working\nimport * as allFactories from '../factoriesAny.js';\nexport var all = allFactories;", "import _extends from \"@babel/runtime/helpers/extends\";\nimport typedFunction from 'typed-function';\nimport { deepFlatten, isLegacyFactory } from '../utils/object.js';\nimport * as emitter from './../utils/emitter.js';\nimport { importFactory } from './function/import.js';\nimport { configFactory } from './function/config.js';\nimport { factory, isFactory } from '../utils/factory.js';\nimport { isAccessorNode, isArray, isArrayNode, isAssignmentNode, isBigNumber, isBlockNode, isBoolean, isChain, isCollection, isComplex, isConditionalNode, isConstantNode, isDate, isDenseMatrix, isFraction, isFunction, isFunctionAssignmentNode, isFunctionNode, isHelp, isIndex, isIndexNode, isMatrix, isNode, isNull, isNumber, isObject, isObjectNode, isOperatorNode, isParenthesisNode, isRange, isRangeNode, isRelationalNode, isRegExp, isResultSet, isSparseMatrix, isString, isSymbolNode, isUndefined, isUnit, isBigInt } from '../utils/is.js';\nimport { ArgumentsError } from '../error/ArgumentsError.js';\nimport { DimensionError } from '../error/DimensionError.js';\nimport { IndexError } from '../error/IndexError.js';\nimport { DEFAULT_CONFIG } from './config.js';\n\n/**\n * Create a mathjs instance from given factory functions and optionally config\n *\n * Usage:\n *\n * const mathjs1 = create({ createAdd, createMultiply, ...})\n * const config = { number: 'BigNumber' }\n * const mathjs2 = create(all, config)\n *\n * @param {Object} [factories] An object with factory functions\n * The object can contain nested objects,\n * all nested objects will be flattened.\n * @param {Object} [config] Available options:\n * {number} relTol\n * Minimum relative difference between two\n * compared values, used by all comparison functions.\n * {number} absTol\n * Minimum absolute difference between two\n * compared values, used by all comparison functions.\n * {string} matrix\n * A string 'Matrix' (default) or 'Array'.\n * {string} number\n * A string 'number' (default), 'BigNumber', or 'Fraction'\n * {number} precision\n * The number of significant digits for BigNumbers.\n * Not applicable for Numbers.\n * {boolean} predictable\n * Predictable output type of functions. When true,\n * output type depends only on the input types. When\n * false (default), output type can vary depending\n * on input values. For example `math.sqrt(-4)`\n * returns `complex('2i')` when predictable is false, and\n * returns `NaN` when true.\n * {string} randomSeed\n * Random seed for seeded pseudo random number generator.\n * Set to null to randomly seed.\n * @returns {Object} Returns a bare-bone math.js instance containing\n * functions:\n * - `import` to add new functions\n * - `config` to change configuration\n * - `on`, `off`, `once`, `emit` for events\n */\nexport function create(factories, config) {\n var configInternal = _extends({}, DEFAULT_CONFIG, config);\n\n // simple test for ES5 support\n if (typeof Object.create !== 'function') {\n throw new Error('ES5 not supported by this JavaScript engine. ' + 'Please load the es5-shim and es5-sham library for compatibility.');\n }\n\n // create the mathjs instance\n var math = emitter.mixin({\n // only here for backward compatibility for legacy factory functions\n isNumber,\n isComplex,\n isBigNumber,\n isBigInt,\n isFraction,\n isUnit,\n isString,\n isArray,\n isMatrix,\n isCollection,\n isDenseMatrix,\n isSparseMatrix,\n isRange,\n isIndex,\n isBoolean,\n isResultSet,\n isHelp,\n isFunction,\n isDate,\n isRegExp,\n isObject,\n isNull,\n isUndefined,\n isAccessorNode,\n isArrayNode,\n isAssignmentNode,\n isBlockNode,\n isConditionalNode,\n isConstantNode,\n isFunctionAssignmentNode,\n isFunctionNode,\n isIndexNode,\n isNode,\n isObjectNode,\n isOperatorNode,\n isParenthesisNode,\n isRangeNode,\n isRelationalNode,\n isSymbolNode,\n isChain\n });\n\n // load config function and apply provided config\n math.config = configFactory(configInternal, math.emit);\n math.expression = {\n transform: {},\n mathWithTransform: {\n config: math.config\n }\n };\n\n // cached factories and instances used by function load\n var legacyFactories = [];\n var legacyInstances = [];\n\n /**\n * Load a function or data type from a factory.\n * If the function or data type already exists, the existing instance is\n * returned.\n * @param {Function} factory\n * @returns {*}\n */\n function load(factory) {\n if (isFactory(factory)) {\n return factory(math);\n }\n var firstProperty = factory[Object.keys(factory)[0]];\n if (isFactory(firstProperty)) {\n return firstProperty(math);\n }\n if (!isLegacyFactory(factory)) {\n console.warn('Factory object with properties `type`, `name`, and `factory` expected', factory);\n throw new Error('Factory object with properties `type`, `name`, and `factory` expected');\n }\n var index = legacyFactories.indexOf(factory);\n var instance;\n if (index === -1) {\n // doesn't yet exist\n if (factory.math === true) {\n // pass with math namespace\n instance = factory.factory(math.type, configInternal, load, math.typed, math);\n } else {\n instance = factory.factory(math.type, configInternal, load, math.typed);\n }\n\n // append to the cache\n legacyFactories.push(factory);\n legacyInstances.push(instance);\n } else {\n // already existing function, return the cached instance\n instance = legacyInstances[index];\n }\n return instance;\n }\n var importedFactories = {};\n\n // load the import function\n function lazyTyped() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return math.typed.apply(math.typed, args);\n }\n lazyTyped.isTypedFunction = typedFunction.isTypedFunction;\n var internalImport = importFactory(lazyTyped, load, math, importedFactories);\n math.import = internalImport;\n\n // listen for changes in config, import all functions again when changed\n // TODO: move this listener into the import function?\n math.on('config', () => {\n Object.values(importedFactories).forEach(factory => {\n if (factory && factory.meta && factory.meta.recreateOnConfigChange) {\n // FIXME: only re-create when the current instance is the same as was initially created\n // FIXME: delete the functions/constants before importing them again?\n internalImport(factory, {\n override: true\n });\n }\n });\n });\n\n // the create function exposed on the mathjs instance is bound to\n // the factory functions passed before\n math.create = create.bind(null, factories);\n\n // export factory function\n math.factory = factory;\n\n // import the factory functions like createAdd as an array instead of object,\n // else they will get a different naming (`createAdd` instead of `add`).\n math.import(Object.values(deepFlatten(factories)));\n math.ArgumentsError = ArgumentsError;\n math.DimensionError = DimensionError;\n math.IndexError = IndexError;\n return math;\n}", "import Emitter from 'tiny-emitter';\n\n/**\n * Extend given object with emitter functions `on`, `off`, `once`, `emit`\n * @param {Object} obj\n * @return {Object} obj\n */\nexport function mixin(obj) {\n // create event emitter\n var emitter = new Emitter();\n\n // bind methods to obj (we don't want to expose the emitter.e Array...)\n obj.on = emitter.on.bind(emitter);\n obj.off = emitter.off.bind(emitter);\n obj.once = emitter.once.bind(emitter);\n obj.emit = emitter.emit.bind(emitter);\n return obj;\n}", "import { isBigNumber, isComplex, isFraction, isMatrix, isUnit } from '../../utils/is.js';\nimport { isFactory, stripOptionalNotation } from '../../utils/factory.js';\nimport { hasOwnProperty, lazy } from '../../utils/object.js';\nimport { ArgumentsError } from '../../error/ArgumentsError.js';\nexport function importFactory(typed, load, math, importedFactories) {\n /**\n * Import functions from an object or a module.\n *\n * This function is only available on a mathjs instance created using `create`.\n *\n * Syntax:\n *\n * math.import(functions)\n * math.import(functions, options)\n *\n * Where:\n *\n * - `functions: Object`\n * An object with functions or factories to be imported.\n * - `options: Object` An object with import options. Available options:\n * - `override: boolean`\n * If true, existing functions will be overwritten. False by default.\n * - `silent: boolean`\n * If true, the function will not throw errors on duplicates or invalid\n * types. False by default.\n * - `wrap: boolean`\n * If true, the functions will be wrapped in a wrapper function\n * which converts data types like Matrix to primitive data types like Array.\n * The wrapper is needed when extending math.js with libraries which do not\n * support these data type. False by default.\n *\n * Examples:\n *\n * import { create, all } from 'mathjs'\n * import * as numbers from 'numbers'\n *\n * // create a mathjs instance\n * const math = create(all)\n *\n * // define new functions and variables\n * math.import({\n * myvalue: 42,\n * hello: function (name) {\n * return 'hello, ' + name + '!'\n * }\n * })\n *\n * // use the imported function and variable\n * math.myvalue * 2 // 84\n * math.hello('user') // 'hello, user!'\n *\n * // import the npm module 'numbers'\n * // (must be installed first with `npm install numbers`)\n * math.import(numbers, {wrap: true})\n *\n * math.fibonacci(7) // returns 13\n *\n * @param {Object | Array} functions Object with functions to be imported.\n * @param {Object} [options] Import options.\n */\n function mathImport(functions, options) {\n var num = arguments.length;\n if (num !== 1 && num !== 2) {\n throw new ArgumentsError('import', num, 1, 2);\n }\n if (!options) {\n options = {};\n }\n function flattenImports(flatValues, value, name) {\n if (Array.isArray(value)) {\n value.forEach(item => flattenImports(flatValues, item));\n } else if (typeof value === 'object') {\n for (var _name in value) {\n if (hasOwnProperty(value, _name)) {\n flattenImports(flatValues, value[_name], _name);\n }\n }\n } else if (isFactory(value) || name !== undefined) {\n var flatName = isFactory(value) ? isTransformFunctionFactory(value) ? value.fn + '.transform' // TODO: this is ugly\n : value.fn : name;\n\n // we allow importing the same function twice if it points to the same implementation\n if (hasOwnProperty(flatValues, flatName) && flatValues[flatName] !== value && !options.silent) {\n throw new Error('Cannot import \"' + flatName + '\" twice');\n }\n flatValues[flatName] = value;\n } else {\n if (!options.silent) {\n throw new TypeError('Factory, Object, or Array expected');\n }\n }\n }\n var flatValues = {};\n flattenImports(flatValues, functions);\n for (var name in flatValues) {\n if (hasOwnProperty(flatValues, name)) {\n // console.log('import', name)\n var value = flatValues[name];\n if (isFactory(value)) {\n // we ignore name here and enforce the name of the factory\n // maybe at some point we do want to allow overriding it\n // in that case we can implement an option overrideFactoryNames: true\n _importFactory(value, options);\n } else if (isSupportedType(value)) {\n _import(name, value, options);\n } else {\n if (!options.silent) {\n throw new TypeError('Factory, Object, or Array expected');\n }\n }\n }\n }\n }\n\n /**\n * Add a property to the math namespace\n * @param {string} name\n * @param {*} value\n * @param {Object} options See import for a description of the options\n * @private\n */\n function _import(name, value, options) {\n // TODO: refactor this function, it's to complicated and contains duplicate code\n if (options.wrap && typeof value === 'function') {\n // create a wrapper around the function\n value = _wrap(value);\n }\n\n // turn a plain function with a typed-function signature into a typed-function\n if (hasTypedFunctionSignature(value)) {\n value = typed(name, {\n [value.signature]: value\n });\n }\n if (typed.isTypedFunction(math[name]) && typed.isTypedFunction(value)) {\n if (options.override) {\n // give the typed function the right name\n value = typed(name, value.signatures);\n } else {\n // merge the existing and typed function\n value = typed(math[name], value);\n }\n math[name] = value;\n delete importedFactories[name];\n _importTransform(name, value);\n math.emit('import', name, function resolver() {\n return value;\n });\n return;\n }\n if (math[name] === undefined || options.override) {\n math[name] = value;\n delete importedFactories[name];\n _importTransform(name, value);\n math.emit('import', name, function resolver() {\n return value;\n });\n return;\n }\n if (!options.silent) {\n throw new Error('Cannot import \"' + name + '\": already exists');\n }\n }\n function _importTransform(name, value) {\n if (value && typeof value.transform === 'function') {\n math.expression.transform[name] = value.transform;\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = value.transform;\n }\n } else {\n // remove existing transform\n delete math.expression.transform[name];\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = value;\n }\n }\n }\n function _deleteTransform(name) {\n delete math.expression.transform[name];\n if (allowedInExpressions(name)) {\n math.expression.mathWithTransform[name] = math[name];\n } else {\n delete math.expression.mathWithTransform[name];\n }\n }\n\n /**\n * Create a wrapper a round an function which converts the arguments\n * to their primitive values (like convert a Matrix to Array)\n * @param {Function} fn\n * @return {Function} Returns the wrapped function\n * @private\n */\n function _wrap(fn) {\n var wrapper = function wrapper() {\n var args = [];\n for (var i = 0, len = arguments.length; i < len; i++) {\n var arg = arguments[i];\n args[i] = arg && arg.valueOf();\n }\n return fn.apply(math, args);\n };\n if (fn.transform) {\n wrapper.transform = fn.transform;\n }\n return wrapper;\n }\n\n /**\n * Import an instance of a factory into math.js\n * @param {function(scope: object)} factory\n * @param {Object} options See import for a description of the options\n * @param {string} [name=factory.name] Optional custom name\n * @private\n */\n function _importFactory(factory, options) {\n var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : factory.fn;\n if (name.includes('.')) {\n throw new Error('Factory name should not contain a nested path. ' + 'Name: ' + JSON.stringify(name));\n }\n var namespace = isTransformFunctionFactory(factory) ? math.expression.transform : math;\n var existingTransform = (name in math.expression.transform);\n var existing = hasOwnProperty(namespace, name) ? namespace[name] : undefined;\n var resolver = function resolver() {\n // collect all dependencies, handle finding both functions and classes and other special cases\n var dependencies = {};\n factory.dependencies.map(stripOptionalNotation).forEach(dependency => {\n if (dependency.includes('.')) {\n throw new Error('Factory dependency should not contain a nested path. ' + 'Name: ' + JSON.stringify(dependency));\n }\n if (dependency === 'math') {\n dependencies.math = math;\n } else if (dependency === 'mathWithTransform') {\n dependencies.mathWithTransform = math.expression.mathWithTransform;\n } else if (dependency === 'classes') {\n // special case for json reviver\n dependencies.classes = math;\n } else {\n dependencies[dependency] = math[dependency];\n }\n });\n var instance = /* #__PURE__ */factory(dependencies);\n if (instance && typeof instance.transform === 'function') {\n throw new Error('Transforms cannot be attached to factory functions. ' + 'Please create a separate function for it with export const path = \"expression.transform\"');\n }\n if (existing === undefined || options.override) {\n return instance;\n }\n if (typed.isTypedFunction(existing) && typed.isTypedFunction(instance)) {\n // merge the existing and new typed function\n return typed(existing, instance);\n }\n if (options.silent) {\n // keep existing, ignore imported function\n return existing;\n } else {\n throw new Error('Cannot import \"' + name + '\": already exists');\n }\n };\n\n // TODO: add unit test with non-lazy factory\n if (!factory.meta || factory.meta.lazy !== false) {\n lazy(namespace, name, resolver);\n\n // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two)\n if (existing && existingTransform) {\n _deleteTransform(name);\n } else {\n if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) {\n lazy(math.expression.mathWithTransform, name, () => namespace[name]);\n }\n }\n } else {\n namespace[name] = resolver();\n\n // FIXME: remove the `if (existing &&` condition again. Can we make sure subset is loaded before subset.transform? (Name collision, and no dependencies between the two)\n if (existing && existingTransform) {\n _deleteTransform(name);\n } else {\n if (isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory)) {\n lazy(math.expression.mathWithTransform, name, () => namespace[name]);\n }\n }\n }\n\n // TODO: improve factories, store a list with imports instead which can be re-played\n importedFactories[name] = factory;\n math.emit('import', name, resolver);\n }\n\n /**\n * Check whether given object is a type which can be imported\n * @param {Function | number | string | boolean | null | Unit | Complex} object\n * @return {boolean}\n * @private\n */\n function isSupportedType(object) {\n return typeof object === 'function' || typeof object === 'number' || typeof object === 'string' || typeof object === 'boolean' || object === null || isUnit(object) || isComplex(object) || isBigNumber(object) || isFraction(object) || isMatrix(object) || Array.isArray(object);\n }\n function hasTypedFunctionSignature(fn) {\n return typeof fn === 'function' && typeof fn.signature === 'string';\n }\n function allowedInExpressions(name) {\n return !hasOwnProperty(unsafe, name);\n }\n function factoryAllowedInExpressions(factory) {\n return !factory.fn.includes('.') &&\n // FIXME: make checking on path redundant, check on meta data instead\n !hasOwnProperty(unsafe, factory.fn) && (!factory.meta || !factory.meta.isClass);\n }\n function isTransformFunctionFactory(factory) {\n return factory !== undefined && factory.meta !== undefined && factory.meta.isTransformFunction === true || false;\n }\n\n // namespaces and functions not available in the parser for safety reasons\n var unsafe = {\n expression: true,\n type: true,\n docs: true,\n error: true,\n json: true,\n chain: true // chain method not supported. Note that there is a unit chain too.\n };\n return mathImport;\n}", "import jStat from 'jstat';\nimport bessel from 'bessel';\n\nconst nil = new Error('#NULL!');\nconst div0 = new Error('#DIV/0!');\nconst value = new Error('#VALUE!');\nconst ref = new Error('#REF!');\nconst name = new Error('#NAME?');\nconst num = new Error('#NUM!');\nconst na = new Error('#N/A');\nconst error = new Error('#ERROR!');\nconst data = new Error('#GETTING_DATA');\n\nvar errors = /*#__PURE__*/Object.freeze({\n __proto__: null,\n data: data,\n div0: div0,\n error: error,\n na: na,\n name: name,\n nil: nil,\n num: num,\n ref: ref,\n value: value\n});\n\nconst defaultOperator = '=';\nconst validSymbols = ['>', '>=', '<', '<=', '=', '<>'];\nconst _TOKEN_TYPE_OPERATOR = 'operator';\nconst _TOKEN_TYPE_LITERAL = 'literal';\nconst SUPPORTED_TOKENS = [_TOKEN_TYPE_OPERATOR, _TOKEN_TYPE_LITERAL];\n\nconst TOKEN_TYPE_OPERATOR = _TOKEN_TYPE_OPERATOR;\nconst TOKEN_TYPE_LITERAL = _TOKEN_TYPE_LITERAL;\n\n/**\n * Create token which describe passed symbol/value.\n *\n * @param {String} value Value/Symbol to describe.\n * @param {String} type Type of the token 'operator' or 'literal'.\n * @return {Object}\n */\nfunction createToken(value, type) {\n if (SUPPORTED_TOKENS.indexOf(type) === -1) {\n throw new Error('Unsupported token type: ' + type)\n }\n\n return {\n value: value,\n type: type\n }\n}\n\n/**\n * Tries to cast numeric values to their type passed as a string.\n *\n * @param {*} value\n * @return {*}\n */\nfunction castValueToCorrectType(value) {\n if (typeof value !== 'string') {\n return value\n }\n\n if (/^\\d+(\\.\\d+)?$/.test(value)) {\n value = value.indexOf('.') === -1 ? parseInt(value, 10) : parseFloat(value);\n }\n\n return value\n}\n\n/**\n * Generate stream of tokens from passed expression.\n *\n * @param {String} expression\n * @return {String[]}\n */\nfunction tokenizeExpression(expression) {\n const expressionLength = expression.length;\n const tokens = [];\n let cursorIndex = 0;\n let processedValue = '';\n let processedSymbol = '';\n\n while (cursorIndex < expressionLength) {\n const char = expression.charAt(cursorIndex);\n\n switch (char) {\n case '>':\n case '<':\n case '=':\n processedSymbol = processedSymbol + char;\n\n if (processedValue.length > 0) {\n tokens.push(processedValue);\n processedValue = '';\n }\n\n break\n default:\n if (processedSymbol.length > 0) {\n tokens.push(processedSymbol);\n processedSymbol = '';\n }\n\n processedValue = processedValue + char;\n break\n }\n\n cursorIndex++;\n }\n\n if (processedValue.length > 0) {\n tokens.push(processedValue);\n }\n\n if (processedSymbol.length > 0) {\n tokens.push(processedSymbol);\n }\n\n return tokens\n}\n\n/**\n * Analyze and convert tokens to an object which describes their meaning.\n *\n * @param {String[]} tokens\n * @return {Object[]}\n */\nfunction analyzeTokens(tokens) {\n let literalValue = '';\n const analyzedTokens = [];\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (i === 0 && validSymbols.indexOf(token) >= 0) {\n analyzedTokens.push(createToken(token, TOKEN_TYPE_OPERATOR));\n } else {\n literalValue += token;\n }\n }\n\n if (literalValue.length > 0) {\n analyzedTokens.push(createToken(castValueToCorrectType(literalValue), TOKEN_TYPE_LITERAL));\n }\n\n if (analyzedTokens.length > 0 && analyzedTokens[0].type !== TOKEN_TYPE_OPERATOR) {\n analyzedTokens.unshift(createToken(defaultOperator, TOKEN_TYPE_OPERATOR));\n }\n\n return analyzedTokens\n}\n\n/**\n * Compute/Evaluate an expression passed as an array of tokens.\n *\n * @param {Object[]} tokens\n * @return {Boolean}\n */\nfunction computeExpression(tokens) {\n const values = [];\n let operator;\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n switch (token.type) {\n case TOKEN_TYPE_OPERATOR:\n operator = token.value;\n break\n case TOKEN_TYPE_LITERAL:\n values.push(token.value);\n break\n }\n }\n\n return evaluate(values, operator)\n}\n\n/**\n * Evaluate values based on passed math operator.\n *\n * @param {*} values\n * @param {String} operator\n * @return {Boolean}\n */\nfunction evaluate(values, operator) {\n let result = false;\n\n switch (operator) {\n case '>':\n result = values[0] > values[1];\n break\n case '>=':\n result = values[0] >= values[1];\n break\n case '<':\n result = values[0] < values[1];\n break\n case '<=':\n result = values[0] <= values[1];\n break\n case '=':\n result = values[0] == values[1];\n break\n case '<>':\n result = values[0] != values[1];\n break\n }\n\n return result\n}\n\nfunction parse(expression) {\n return analyzeTokens(tokenizeExpression(expression))\n}\n\nconst compute = computeExpression;\n\n// Arrays\nfunction argsToArray(args) {\n const result = [];\n\n arrayEach(args, (value) => {\n result.push(value);\n });\n\n return result\n}\n\nfunction arrayEach(array, iteratee) {\n let index = -1;\n const length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break\n }\n }\n\n return array\n}\n\nfunction arrayValuesToNumbers(arr) {\n let n = arr.length;\n let el;\n\n while (n--) {\n el = arr[n];\n\n if (typeof el === 'number') {\n continue\n }\n\n if (el === true) {\n arr[n] = 1;\n continue\n }\n\n if (el === false) {\n arr[n] = 0;\n continue\n }\n\n if (typeof el === 'string') {\n const number = parseNumber(el);\n\n arr[n] = number instanceof Error ? 0 : number;\n }\n }\n\n return arr\n}\n\nfunction fillMatrix(matrix, fill_value) {\n if (!matrix) {\n return value\n }\n\n if (!matrix.every((el) => Array.isArray(el)) || matrix.length === 0) {\n matrix = [[...matrix]];\n }\n\n matrix.map((arr, i) => {\n arr.map((a, j) => {\n if (!a) {\n matrix[i][j] = 0;\n }\n });\n });\n\n const longestArrayIndex = matrix.reduce((acc, arr, i) => (arr.length > matrix[acc].length ? i : acc), 0);\n const longestArrayLength = matrix[longestArrayIndex].length;\n\n return matrix.map((el) => [...el, ...Array(longestArrayLength - el.length).fill(fill_value ? fill_value : 0)])\n}\n\nfunction flatten() {\n let result;\n\n if (arguments.length === 1) {\n const argument = arguments[0];\n result = isArrayLike(argument) ? argsToArray.apply(null, arguments) : [argument];\n } else {\n result = Array.from(arguments);\n }\n\n while (!isFlat(result)) {\n result = flattenShallow(result);\n }\n\n return result\n}\n\nfunction flattenShallow(array) {\n if (!array || !array.reduce) {\n return [array]\n }\n\n return array.reduce((a, b) => {\n const aIsArray = Array.isArray(a);\n const bIsArray = Array.isArray(b);\n\n if (aIsArray && bIsArray) {\n return a.concat(b)\n }\n\n if (aIsArray) {\n a.push(b);\n\n return a\n }\n\n if (bIsArray) {\n return [a].concat(b)\n }\n\n return [a, b]\n })\n}\n\nfunction initial(array, idx) {\n idx = idx || 1;\n\n if (!array || typeof array.slice !== 'function') {\n return array\n }\n\n return array.slice(0, array.length - idx)\n}\n\nfunction isArrayLike(a) {\n return a != null && typeof a.length === 'number' && typeof a !== 'string'\n}\n\nfunction isFlat(array) {\n if (!array) {\n return false\n }\n\n for (let i = 0; i < array.length; ++i) {\n if (Array.isArray(array[i])) {\n return false\n }\n }\n\n return true\n}\n\nfunction rest(array, idx) {\n idx = idx || 1;\n\n if (!array || typeof array.slice !== 'function') {\n return array\n }\n\n return array.slice(idx)\n}\n\nfunction transpose(matrix) {\n if (!matrix) {\n return value\n }\n\n return matrix[0].map((col, i) => matrix.map((row) => row[i]))\n}\n\n// Databases\nfunction findField(database, title) {\n let index = null;\n\n arrayEach(database, (value, i) => {\n if (value[0] === title) {\n index = i;\n\n return false\n }\n });\n\n // Return error if the input field title is incorrect\n if (index == null) {\n return value\n }\n\n return index\n}\n\n// Errors\nfunction anyError() {\n for (let n = 0; n < arguments.length; n++) {\n if (arguments[n] instanceof Error) {\n return arguments[n]\n }\n }\n\n return undefined\n}\n\nfunction anyIsError() {\n let n = arguments.length;\n\n while (n--) {\n if (arguments[n] instanceof Error) {\n return true\n }\n }\n\n return false\n}\n\n// Numbers\nfunction cleanFloat(number) {\n const power = 1e14;\n\n return Math.round(number * power) / power\n}\n\nfunction numbers() {\n const possibleNumbers = flatten.apply(null, arguments);\n\n return possibleNumbers.filter((el) => typeof el === 'number')\n}\n\nfunction serialNumberToDate(serial) {\n if (serial < 60) {\n serial += 1;\n }\n\n const utc_days = Math.floor(serial - 25569);\n const utc_value = utc_days * 86400;\n const date_info = new Date(utc_value * 1000);\n const fractional_day = serial - Math.floor(serial) + 0.0000001;\n\n let total_seconds = Math.floor(86400 * fractional_day);\n\n const seconds = total_seconds % 60;\n\n total_seconds -= seconds;\n\n const hours = Math.floor(total_seconds / (60 * 60));\n const minutes = Math.floor(total_seconds / 60) % 60;\n let days = date_info.getUTCDate();\n let month = date_info.getUTCMonth();\n\n if (serial >= 60 && serial < 61) {\n days = 29;\n month = 1;\n }\n\n return new Date(date_info.getUTCFullYear(), month, days, hours, minutes, seconds)\n}\n\n// Parsers\nfunction parseBool(bool) {\n if (typeof bool === 'boolean') {\n return bool\n }\n\n if (bool instanceof Error) {\n return bool\n }\n\n if (typeof bool === 'number') {\n return bool !== 0\n }\n\n if (typeof bool === 'string') {\n const up = bool.toUpperCase();\n\n if (up === 'TRUE') {\n return true\n }\n\n if (up === 'FALSE') {\n return false\n }\n }\n\n if (bool instanceof Date && !isNaN(bool)) {\n return true\n }\n\n return value\n}\n\nfunction parseDate(date) {\n if (!isNaN(date)) {\n if (date instanceof Date) {\n return new Date(date)\n }\n\n const d = parseFloat(date);\n\n if (d < 0 || d >= 2958466) {\n return num\n }\n\n return serialNumberToDate(d)\n }\n\n if (typeof date === 'string') {\n date = /(\\d{4})-(\\d\\d?)-(\\d\\d?)$/.test(date) ? new Date(date + 'T00:00:00.000') : new Date(date);\n\n if (!isNaN(date)) {\n return date\n }\n }\n\n return value\n}\n\nfunction parseDateArray(arr) {\n let len = arr.length;\n let parsed;\n\n while (len--) {\n parsed = parseDate(arr[len]);\n\n if (parsed === value) {\n return parsed\n }\n\n arr[len] = parsed;\n }\n\n return arr\n}\n\nfunction parseNumber(string) {\n if (string instanceof Error) {\n return string\n }\n\n if (string === undefined || string === null) {\n return 0\n }\n\n if (typeof string === 'boolean') {\n string = +string;\n }\n\n if (!isNaN(string) && string !== '') {\n return parseFloat(string)\n }\n\n return value\n}\n\nfunction parseNumberArray(arr) {\n let len;\n\n if (!arr || (len = arr.length) === 0) {\n return value\n }\n\n let parsed;\n\n while (len--) {\n if (arr[len] instanceof Error) {\n return arr[len]\n }\n\n parsed = parseNumber(arr[len]);\n\n if (parsed instanceof Error) {\n return parsed\n }\n\n arr[len] = parsed;\n }\n\n return arr\n}\n\nfunction parseString(string) {\n if (string instanceof Error) {\n return string\n }\n\n if (string === undefined || string === null) {\n return ''\n }\n\n return string.toString()\n}\n\n// Strings\nfunction anyIsString() {\n let n = arguments.length;\n\n while (n--) {\n if (typeof arguments[n] === 'string') {\n return true\n }\n }\n\n return false\n}\n\n// Misc\n//Filters values from a given range based on multiple criteria.\n//Returns an array containing the values that satisfy all the specified criteria.\nfunction applyCriteria() {\n const args = argsToArray(arguments);\n const range = parseNumberArray(flatten(args.shift()));\n if (range instanceof Error) {\n return range\n }\n\n const criterias = args;\n const criteriaLength = criterias.length / 2;\n\n for (let i = 0; i < criteriaLength; i++) {\n criterias[i * 2] = flatten(criterias[i * 2]);\n }\n\n let values = [];\n\n for (let i = 0; i < range.length; i++) {\n let isMetCondition = false;\n\n for (let j = 0; j < criteriaLength; j++) {\n const valueToTest = criterias[j * 2][i];\n const criteria = criterias[j * 2 + 1];\n const isWildcard = criteria === void 0 || criteria === '*';\n let computedResult = false;\n\n if (isWildcard) {\n computedResult = true;\n } else {\n const tokenizedCriteria = parse(criteria + '');\n const tokens = [createToken(valueToTest, TOKEN_TYPE_LITERAL)].concat(\n tokenizedCriteria\n );\n\n computedResult = compute(tokens);\n }\n\n // Criterias are calculated as AND so any `false` breaks the loop as unmeet condition\n if (!computedResult) {\n isMetCondition = false;\n break\n }\n\n isMetCondition = true;\n }\n\n if (isMetCondition) {\n values.push(range[i]);\n }\n }\n return values\n}\n\nfunction isDefined(arg) {\n return arg !== undefined && arg !== null\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns information about the formatting, location, or contents of a value.\n *\n * Category: Information\n *\n * @returns\n */\nfunction CELL() {\n throw new Error('CELL is not implemented')\n}\n\nconst ERROR = {};\n\nERROR.TYPE = (error_val) => {\n switch (error_val) {\n case nil:\n return 1\n case div0:\n return 2\n case value:\n return 3\n case ref:\n return 4\n case name:\n return 5\n case num:\n return 6\n case na:\n return 7\n case data:\n return 8\n }\n\n return na\n};\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns information about the current operating environment.\n *\n * Category: Information\n *\n * @returns\n */\nfunction INFO() {\n throw new Error('INFO is not implemented')\n}\n\n/**\n * Returns TRUE if the value is blank.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISBLANK(value) {\n return value === null\n}\n\n/**\n * Returns TRUE if the value is any error value except #N/A.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISERR(value$1) {\n return (\n [value, ref, div0, num, name, nil].indexOf(value$1) >= 0 ||\n (typeof value$1 === 'number' && (isNaN(value$1) || !isFinite(value$1)))\n )\n}\n\n/**\n * Returns TRUE if the value is any error value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISERROR(value) {\n return ISERR(value) || value === na\n}\n\n/**\n * Returns TRUE if the number is even.\n *\n * Category: Information\n *\n * @param {*} number The value to test. If number is not an integer, it is truncated.\n * @returns\n */\nfunction ISEVEN(number) {\n return !(Math.floor(Math.abs(number)) & 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns TRUE if there is a reference to a value that contains a formula.\n *\n * Category: Information\n *\n * @param {*} reference Reference is a reference to the value you want to test. Reference can be a value reference, a formula, or a name that refers to a value.\n * @returns\n */\nfunction ISFORMULA() {\n throw new Error('ISFORMULA is not implemented')\n}\n\n/**\n * Returns TRUE if the value is a logical value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISLOGICAL(value) {\n return value === true || value === false\n}\n\n/**\n * Returns TRUE if the value is the #N/A error value.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNA(value) {\n return value === na\n}\n\n/**\n * Returns TRUE if the value is not text.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNONTEXT(value) {\n return typeof value !== 'string'\n}\n\n/**\n * Returns TRUE if the value is a number.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISNUMBER(value) {\n return typeof value === 'number' && !isNaN(value) && isFinite(value)\n}\n\n/**\n * Returns TRUE if the number is odd.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISODD(value) {\n return !!(Math.floor(Math.abs(value)) & 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns TRUE if the value is a reference.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISREF() {\n throw new Error('ISREF is not implemented')\n}\n\n/**\n * Returns TRUE if the value is text.\n *\n * Category: Information\n *\n * @param {*} value The value that you want tested. The value argument can be a blank (empty value), error, logical value, text, number, or reference value, or a name referring to any of these.\n * @returns\n */\nfunction ISTEXT(value) {\n return typeof value === 'string'\n}\n\n/**\n * Returns a value converted to a number.\n *\n * Category: Information\n *\n * @param {*} value The value you want converted. N converts values listed in the following table.\n * @returns\n */\nfunction N(value) {\n if (ISNUMBER(value)) {\n return value\n }\n\n if (value instanceof Date) {\n return value.getTime()\n }\n\n if (value === true) {\n return 1\n }\n\n if (value === false) {\n return 0\n }\n\n if (ISERROR(value)) {\n return value\n }\n\n return 0\n}\n\n/**\n * Returns the error value #N/A.\n *\n * Category: Information\n *\n * @returns\n */\nfunction NA() {\n return na\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the sheet number of the referenced sheet.\n *\n * Category: Information\n *\n * @param {*} value Optional. Value is the name of a sheet or a reference for which you want the sheet number. If value is omitted, SHEET returns the number of the sheet that contains the function.\n * @returns\n */\nfunction SHEET() {\n throw new Error('SHEET is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of sheets in a reference.\n *\n * Category: Information\n *\n * @param {*} reference Optional. Reference is a reference for which you want to know the number of sheets it contains. If Reference is omitted, SHEETS returns the number of sheets in the workbook that contains the function.\n * @returns\n */\nfunction SHEETS() {\n throw new Error('SHEETS is not implemented')\n}\n\n/**\n * Returns a number indicating the data type of a value.\n *\n * Category: Information\n *\n * @param {*} value Can be any Microsoft Excel value, such as a number, text, logical value, and so on.\n * @returns\n */\nfunction TYPE(value) {\n if (ISNUMBER(value)) {\n return 1\n }\n\n if (ISTEXT(value)) {\n return 2\n }\n\n if (ISLOGICAL(value)) {\n return 4\n }\n\n if (ISERROR(value)) {\n return 16\n }\n\n if (Array.isArray(value)) {\n return 64\n }\n}\n\n/**\n * Chooses a value from a list of values.\n *\n * Category: Lookup and reference\n *\n * @param {*} index_num Specifies which value argument is selected. Index_num must be a number between 1 and 254, or a formula or reference to a value containing a number between 1 and 254. If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on. If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value. If index_num is a fraction, it is truncated to the lowest integer before being used.\n - If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on.\n - If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value.\n - If index_num is a fraction, it is truncated to the lowest integer before being used.\n * @param {*} args value1, value2, ... Value 1 is required, subsequent values are optional. 1 to 254 value arguments from which CHOOSE selects a value or an action to perform based on index_num. The arguments can be numbers, value references, defined names, formulas, functions, or text.\n * @returns\n */\nfunction CHOOSE() {\n if (arguments.length < 2) {\n return na\n }\n\n const index = arguments[0];\n\n if (index < 1 || index > 254) {\n return value\n }\n\n if (arguments.length < index + 1) {\n return value\n }\n\n return arguments[index]\n}\n\n/**\n * Returns the column number of a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} reference the value or range of values for which you want to return the column number.\n * @param {*} index\n * @returns\n */\nfunction COLUMN(reference, index) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (index < 0) {\n return num\n }\n\n if (!(reference instanceof Array) || typeof index !== 'number') {\n return value\n }\n\n if (reference.length === 0) {\n return undefined\n }\n\n return jStat.col(reference, index)\n}\n\n/**\n * Returns the number of columns in a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array or array formula, or a reference to a range of values for which you want the number of columns.\n * @returns\n */\nfunction COLUMNS(array) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (!(array instanceof Array)) {\n return value\n }\n\n if (array.length === 0) {\n return 0\n }\n\n return jStat.cols(array)\n}\n\n/**\n * Looks in the top row of an array and returns the value of the indicated value.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value to be found in the first row of the table. Lookup_value can be a value, a reference, or a text string.\n * @param {*} table_array A table of information in which data is looked up. Use a reference to a range or a range name.\n * @param {*} row_index_num The row number in table_array from which the matching value will be returned. A row_index_num of 1 returns the first row value in table_array, a row_index_num of 2 returns the second row value in table_array, and so on. If row_index_num is less than 1, HLOOKUP returns the #VALUE! error value; if row_index_num is greater than the number of rows on table_array, HLOOKUP returns the #REF! error value.\n * @param {*} range_lookup Optional. A logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.\n * @returns\n */\nfunction HLOOKUP(lookup_value, table_array, row_index_num, range_lookup) {\n return VLOOKUP(lookup_value, transpose(table_array), row_index_num, range_lookup)\n}\n\n/**\n * Uses an index to choose a value from a reference or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} array A range of values or an array constant.\n - If array contains only one row or column, the corresponding row_num or column_num argument is optional.\n - If array has more than one row and more than one column, and only row_num or column_num is used, INDEX returns an array of the entire row or column in array.\n * @param {*} row_num Required, unless column_num is present. Selects the row in array from which to return a value. If row_num is omitted, column_num is required.\n * @param {*} column_num Optional. Selects the column in array from which to return a value. If column_num is omitted, row_num is required.\n * @returns\n */\nfunction INDEX(array, row_num, column_num) {\n const someError = anyError(array, row_num, column_num);\n\n if (someError) {\n return someError\n }\n\n if (!Array.isArray(array)) {\n return value\n }\n\n const isOneDimensionRange = array.length > 0 && !Array.isArray(array[0]);\n\n if (isOneDimensionRange && !column_num) {\n column_num = row_num;\n row_num = 1;\n } else {\n column_num = column_num || 1;\n row_num = row_num || 1;\n }\n\n if (column_num < 0 || row_num < 0) {\n return value\n }\n\n if (isOneDimensionRange && row_num === 1 && column_num <= array.length) {\n return array[column_num - 1]\n } else if (row_num <= array.length && column_num <= array[row_num - 1].length) {\n return array[row_num - 1][column_num - 1]\n }\n\n return ref\n}\n\n/**\n * Looks up values in a vector or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value A value that LOOKUP searches for in an array. The lookup_value argument can be a number, text, a logical value, or a name or reference that refers to a value.\n - If LOOKUP can't find the value of lookup_value, it uses the largest value in the array that is less than or equal to lookup_value.\n - If the value of lookup_value is smaller than the smallest value in the first row or column (depending on the array dimensions), LOOKUP returns the #N/A error value.\n * @param {*} array A range of values that contains text, numbers, or logical values that you want to compare with lookup_value. The array form of LOOKUP is very similar to the HLOOKUP and VLOOKUP functions. The difference is that HLOOKUP searches for the value of lookup_value in the first row, VLOOKUP searches in the first column, and LOOKUP searches according to the dimensions of array.\n* @param {*} result_array Optional. A range that contains only one row or column. The result_array argument must be the same size as lookup_value. It has to be the same size.\n * @returns\n */\nfunction LOOKUP(lookup_value, array, result_array) {\n array = flatten(array);\n result_array = result_array ? flatten(result_array) : array;\n\n const isNumberLookup = typeof lookup_value === 'number';\n let result = na;\n\n for (let i = 0; i < array.length; i++) {\n if (array[i] === lookup_value) {\n return result_array[i]\n } else if (\n (isNumberLookup && array[i] <= lookup_value) ||\n (typeof array[i] === 'string' && array[i].localeCompare(lookup_value) < 0)\n ) {\n result = result_array[i];\n } else if (isNumberLookup && array[i] > lookup_value) {\n return result\n }\n }\n\n return result\n}\n\n/**\n * Looks up values in a reference or array.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value that you want to match in lookup_array. For example, when you look up someone's number in a telephone book, you are using the person's name as the lookup value, but the telephone number is the value you want.The lookup_value argument can be a value (number, text, or logical value) or a value reference to a number, text, or logical value.\n * @param {*} lookup_array The range of values being searched.\n * @param {*} match_type Optional. The number -1, 0, or 1. The match_type argument specifies how Excel matches lookup_value with values in lookup_array. The default value for this argument is 1.\n * @returns\n */\nfunction MATCH(lookup_value, lookup_array, match_type) {\n if ((!lookup_value && lookup_value !== 0) || !lookup_array) {\n return na\n }\n\n if (arguments.length === 2) {\n match_type = 1;\n }\n\n lookup_array = flatten(lookup_array);\n\n if (!(lookup_array instanceof Array)) {\n return na\n }\n\n if (match_type !== -1 && match_type !== 0 && match_type !== 1) {\n return na\n }\n\n let index;\n let indexValue;\n\n for (let idx = 0; idx < lookup_array.length; idx++) {\n if (match_type === 1) {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n } else if (lookup_array[idx] < lookup_value) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n } else if (lookup_array[idx] > indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n }\n }\n } else if (match_type === 0) {\n if (typeof lookup_value === 'string' && typeof lookup_array[idx] === 'string') {\n const lookupValueStr = lookup_value\n .toLowerCase()\n .replace(/\\?/g, '.')\n .replace(/\\*/g, '.*')\n .replace(/~/g, '\\\\')\n .replace(/\\+/g, '\\\\+')\n .replace(/\\(/g, '\\\\(')\n .replace(/\\)/g, '\\\\)')\n .replace(/\\[/g, '\\\\[')\n .replace(/\\]/g, '\\\\]');\n\n const regex = new RegExp('^' + lookupValueStr + '$');\n\n if (regex.test(lookup_array[idx].toLowerCase())) {\n return idx + 1\n }\n } else {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n }\n }\n } else if (match_type === -1) {\n if (lookup_array[idx] === lookup_value) {\n return idx + 1\n } else if (lookup_array[idx] > lookup_value) {\n if (!indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n } else if (lookup_array[idx] < indexValue) {\n index = idx + 1;\n indexValue = lookup_array[idx];\n }\n }\n }\n }\n\n return index || na\n}\n\n/**\n * Returns the number of rows in a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array, an array formula, or a reference to a range of values for which you want the number of rows.\n * @returns\n */\nfunction ROWS(array) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (!(array instanceof Array)) {\n return value\n }\n\n if (array.length === 0) {\n return 0\n }\n\n return jStat.rows(array)\n}\n/**\n * Returns a sorted array of the elements in an array. The returned array is the same shape as the provided array argument.\n *\n * Category: Lookup and reference\n *\n * @param {*} array Array to sort\n * @param {*} sort_index Optional. A number indicating the row or column to sort by\n * @param {*} sort_order Optional. A number indicating the desired sort order; 1 for ascending order (default), -1 for descending order\n * @param {*} by_col Optional. A logical value indicating the desired sort direction; FALSE to sort by row (default), TRUE to sort by column\n * @returns\n */\nfunction SORT(array, sort_index = 1, sort_order = 1, by_col = false) {\n if (!array || !Array.isArray(array)) {\n return na\n }\n\n if (array.length === 0) {\n return 0\n }\n\n sort_index = parseNumber(sort_index);\n if (!sort_index || sort_index < 1) {\n return value\n }\n\n sort_order = parseNumber(sort_order);\n if (sort_order !== 1 && sort_order !== -1) {\n return value\n }\n\n by_col = parseBool(by_col);\n if (typeof by_col !== 'boolean') {\n return name\n }\n\n const sortArray = (arr) =>\n arr.sort((a, b) => {\n a = parseString(a[sort_index - 1]);\n b = parseString(b[sort_index - 1]);\n\n return sort_order === 1 ? (a < b ? sort_order * -1 : sort_order) : a > b ? sort_order : sort_order * -1\n });\n\n const matrix = fillMatrix(array);\n const result = by_col ? transpose(matrix) : matrix;\n\n return sort_index >= 1 && sort_index <= result[0].length\n ? by_col\n ? transpose(sortArray(result))\n : sortArray(result)\n : value\n}\n\n/**\n * Returns the transpose of an array.\n *\n * Category: Lookup and reference\n *\n * @param {*} array An array or range of values on a worksheet that you want to transpose. The transpose of an array is created by using the first row of the array as the first column of the new array, the second row of the array as the second column of the new array, and so on. If you're not sure of how to enter an array formula, see Create an array formula.\n * @returns\n */\nfunction TRANSPOSE(array) {\n if (!array) {\n return na\n }\n\n const matrix = fillMatrix(array);\n\n return transpose(matrix)\n}\n\n/**\n * Returns a list of unique values in a list or range.\n *\n * Category: Lookup and reference\n *\n * @returns\n */\nfunction UNIQUE() {\n const result = [];\n\n for (let i = 0; i < arguments.length; ++i) {\n let hasElement = false;\n const element = arguments[i];\n\n // Check if we've already seen this element.\n\n for (let j = 0; j < result.length; ++j) {\n hasElement = result[j] === element;\n\n if (hasElement) {\n break\n }\n }\n\n // If we did not find it, add it to the result.\n if (!hasElement) {\n result.push(element);\n }\n }\n\n return result\n}\n\n/**\n * Looks in the first column of an array and moves across the row to return the value of a value.\n *\n * Category: Lookup and reference\n *\n * @param {*} lookup_value The value to be found in the first row of the table. Lookup_value can be a value, a reference, or a text string.\n * @param {*} table_array A table of information in which data is looked up. Use a reference to a range or a range name.\n * @param {*} col_index_num The row number in table_array from which the matching value will be returned. A row_index_num of 1 returns the first row value in table_array, a row_index_num of 2 returns the second row value in table_array, and so on. If row_index_num is less than 1, HLOOKUP returns the #VALUE! error value; if row_index_num is greater than the number of rows on table_array, HLOOKUP returns the #REF! error value.\n * @param {*} range_lookup Optional. A logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.\n * @returns\n */\nfunction VLOOKUP(lookup_value, table_array, col_index_num, range_lookup) {\n if (!table_array || !col_index_num) {\n return na\n }\n\n range_lookup = !(range_lookup === 0 || range_lookup === false);\n\n let result = na;\n let exactMatchOnly = false;\n\n const isNumberLookup = typeof lookup_value === 'number';\n const lookupValue = typeof lookup_value === 'string' ? lookup_value.toLowerCase() : lookup_value;\n\n for (let i = 0; i < table_array.length; i++) {\n const row = table_array[i];\n const rowValue = typeof row[0] === 'string' ? row[0].toLowerCase() : row[0];\n\n if (rowValue === lookupValue) {\n result = col_index_num < row.length + 1 ? row[col_index_num - 1] : ref;\n break\n } else if (\n !exactMatchOnly &&\n ((isNumberLookup && range_lookup && rowValue <= lookup_value) ||\n (range_lookup && typeof rowValue === 'string' && rowValue.localeCompare(lookup_value) < 0))\n ) {\n result = col_index_num < row.length + 1 ? row[col_index_num - 1] : ref;\n }\n\n if (isNumberLookup && rowValue > lookup_value) {\n exactMatchOnly = true;\n }\n }\n\n return result\n}\n\nconst SQRT2PI = 2.5066282746310002;\n\n/**\n * Returns the average of the absolute deviations of data points from their mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want the average of the absolute deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction AVEDEV() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return num\n }\n\n const range = parseNumberArray(flatArgumentsDefined);\n\n if (range instanceof Error) {\n return range\n }\n\n return jStat.sum(jStat(range).subtract(jStat.mean(range)).abs()[0]) / range.length\n}\n\n/**\n * Returns the average of its arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ...Numbers, value references or ranges for which you want the average.\n * @returns\n */\nfunction AVERAGE() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return div0\n }\n\n const someError = anyError.apply(undefined, flatArgumentsDefined);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArgumentsDefined);\n const n = range.length;\n let sum = 0;\n let count = 0;\n let result;\n\n for (let i = 0; i < n; i++) {\n sum += range[i];\n count += 1;\n }\n\n result = sum / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the average of its arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values, ranges of values, or values for which you want the average.\n * @returns\n */\nfunction AVERAGEA() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter(isDefined);\n\n if (flatArgumentsDefined.length === 0) {\n return div0\n }\n\n const someError = anyError.apply(undefined, flatArgumentsDefined);\n\n if (someError) {\n return someError\n }\n\n const range = flatArgumentsDefined;\n const n = range.length;\n let sum = 0;\n let count = 0;\n let result;\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sum += el;\n }\n\n if (el === true) {\n sum++;\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n result = sum / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the average (arithmetic mean) of all the values in a range that meet a given criteria.\n *\n * Category: Statistical\n *\n * @param {*} range One or more values to average, including numbers or names, arrays, or references that contain numbers.\n * @param {*} criteria The criteria in the form of a number, expression, value reference, or text that defines which values are averaged.\n * @param {*} average_range Optional. The actual set of values to average. If omitted, range is used.\n * @returns\n */\nfunction AVERAGEIF(range, criteria, average_range) {\n if (arguments.length <= 1) {\n return na\n }\n\n average_range = average_range || range;\n const flatAverageRange = flatten(average_range);\n const flatAverageRangeDefined = flatAverageRange.filter(isDefined);\n average_range = parseNumberArray(flatAverageRangeDefined);\n\n range = flatten(range);\n\n if (average_range instanceof Error) {\n return average_range\n }\n\n let average_count = 0;\n let result = 0;\n const isWildcard = criteria === void 0 || criteria === '*';\n const tokenizedCriteria = isWildcard ? null : parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n\n if (isWildcard) {\n result += average_range[i];\n average_count++;\n } else {\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n if (compute(tokens)) {\n result += average_range[i];\n average_count++;\n }\n }\n }\n\n return result / average_count\n}\n\n/**\n * Returns the average (arithmetic mean) of all values that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @param {*} args One or more values to average, including numbers or names, arrays, or references that contain numbers.\n * @returns\n */\nfunction AVERAGEIFS() {\n // Does not work with multi dimensional ranges yet!\n // http://office.microsoft.com/en-001/excel-help/averageifs-function-HA010047493.aspx\n const values = applyCriteria(...arguments);\n const result = values.reduce((acc, value) => acc + value, 0);\n const average = result / values.length;\n\n return isNaN(average) ? 0 : average\n}\n\nconst BETA = {};\n\n/**\n * Returns the beta cumulative distribution function.\n *\n * Category: Statistical\n *\n * @param {*} x The value between A and B at which to evaluate the function\n * @param {*} alpha A parameter of the distribution.\n * @param {*} beta A parameter of the distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, BETA.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @param {*} a Optional. A lower bound to the interval of x.\n * @param {*} b Optional. An upper bound to the interval of x.\n * @returns\n */\nBETA.DIST = function (x, alpha, beta, cumulative, a, b) {\n if (arguments.length < 4) {\n return value\n }\n\n a = a === undefined ? 0 : a;\n b = b === undefined ? 1 : b;\n\n x = parseNumber(x);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n a = parseNumber(a);\n b = parseNumber(b);\n\n if (anyIsError(x, alpha, beta, a, b)) {\n return value\n }\n\n x = (x - a) / (b - a);\n\n return cumulative ? jStat.beta.cdf(x, alpha, beta) : jStat.beta.pdf(x, alpha, beta)\n};\n\n/**\n * Returns the inverse of the cumulative distribution function for a specified beta distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the beta distribution.\n * @param {*} alpha A parameter of the distribution.\n * @param {*} beta A parameter the distribution.\n * @param {*} a Optional. A lower bound to the interval of x.\n * @param {*} b Optional. An upper bound to the interval of x.\n * @returns\n */\nBETA.INV = (probability, alpha, beta, a, b) => {\n a = a === undefined ? 0 : a;\n b = b === undefined ? 1 : b;\n probability = parseNumber(probability);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n a = parseNumber(a);\n b = parseNumber(b);\n\n if (anyIsError(probability, alpha, beta, a, b)) {\n return value\n }\n\n return jStat.beta.inv(probability, alpha, beta) * (b - a) + a\n};\n\nconst BINOM = {};\n\n/**\n * Returns the individual term binomial distribution probability.\n *\n * Category: Statistical\n *\n * @param {*} number_s The number of successes in trials.\n * @param {*} trials The number of independent trials.\n * @param {*} probability_s The probability of success on each trial.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, then BINOM.DIST returns the cumulative distribution function, which is the probability that there are at most number_s successes; if FALSE, it returns the probability mass function, which is the probability that there are number_s successes.\n * @returns\n */\nBINOM.DIST = (number_s, trials, probability_s, cumulative) => {\n number_s = parseNumber(number_s);\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n cumulative = parseNumber(cumulative);\n\n if (anyIsError(number_s, trials, probability_s, cumulative)) {\n return value\n }\n\n return cumulative\n ? jStat.binomial.cdf(number_s, trials, probability_s)\n : jStat.binomial.pdf(number_s, trials, probability_s)\n};\n\n/**\n * Returns the probability of a trial result using a binomial distribution.\n *\n * Category: Statistical\n *\n * @param {*} trials The number of independent trials. Must be greater than or equal to 0.\n * @param {*} probability_s The probability of success in each trial. Must be greater than or equal to 0 and less than or equal to 1.\n * @param {*} number_s The number of successes in trials. Must be greater than or equal to 0 and less than or equal to Trials.\n * @param {*} number_s2 Optional. If provided, returns the probability that the number of successful trials will fall between Number_s and number_s2. Must be greater than or equal to Number_s and less than or equal to Trials.\n * @returns\n */\nBINOM.DIST.RANGE = (trials, probability_s, number_s, number_s2) => {\n number_s2 = number_s2 === undefined ? number_s : number_s2;\n\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n number_s = parseNumber(number_s);\n number_s2 = parseNumber(number_s2);\n\n if (anyIsError(trials, probability_s, number_s, number_s2)) {\n return value\n }\n\n let result = 0;\n\n for (let i = number_s; i <= number_s2; i++) {\n result += COMBIN(trials, i) * Math.pow(probability_s, i) * Math.pow(1 - probability_s, trials - i);\n }\n\n return result\n};\n\n/**\n * Returns the smallest value for which the cumulative binomial distribution is less than or equal to a criterion value.\n *\n * Category: Statistical\n *\n * @param {*} trials The number of Bernoulli trials.\n * @param {*} probability_s The probability of a success on each trial.\n * @param {*} alpha The criterion value.\n * @returns\n */\nBINOM.INV = (trials, probability_s, alpha) => {\n trials = parseNumber(trials);\n probability_s = parseNumber(probability_s);\n alpha = parseNumber(alpha);\n\n if (anyIsError(trials, probability_s, alpha)) {\n return value\n }\n\n let x = 0;\n\n while (x <= trials) {\n if (jStat.binomial.cdf(x, trials, probability_s) >= alpha) {\n return x\n }\n\n x++;\n }\n};\n\nconst CHISQ = {};\n\n/**\n * Returns the cumulative beta probability density function.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, CHISQ.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nCHISQ.DIST = (x, deg_freedom, cumulative) => {\n x = parseNumber(x);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(x, deg_freedom)) {\n return value\n }\n\n return cumulative ? jStat.chisquare.cdf(x, deg_freedom) : jStat.chisquare.pdf(x, deg_freedom)\n};\n\n/**\n * Returns the one-tailed probability of the chi-squared distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.DIST.RT = (x, deg_freedom) => {\n if (!x | !deg_freedom) {\n return na\n }\n\n if (x < 1 || deg_freedom > Math.pow(10, 10)) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return 1 - jStat.chisquare.cdf(x, deg_freedom)\n};\n\n/**\n * Returns the cumulative beta probability density function.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the chi-squared distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.INV = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return jStat.chisquare.inv(probability, deg_freedom)\n};\n\n/**\n * Returns the inverse of the one-tailed probability of the chi-squared distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the chi-squared distribution.\n * @param {*} deg_freedom The number of degrees of freedom.\n * @returns\n */\nCHISQ.INV.RT = (probability, deg_freedom) => {\n if (!probability | !deg_freedom) {\n return na\n }\n\n if (probability < 0 || probability > 1 || deg_freedom < 1 || deg_freedom > Math.pow(10, 10)) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return jStat.chisquare.inv(1.0 - probability, deg_freedom)\n};\n\n/**\n * Returns the test for independence.\n *\n * Category: Statistical\n *\n * @param {*} actual_range The range of data that contains observations to test against expected values.\n * @param {*} expected_range The range of data that contains the ratio of the product of row totals and column totals to the grand total.\n * @returns\n */\nCHISQ.TEST = function (actual_range, expected_range) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (!(actual_range instanceof Array) || !(expected_range instanceof Array)) {\n return value\n }\n\n if (actual_range.length !== expected_range.length) {\n return value\n }\n\n if (actual_range[0] && expected_range[0] && actual_range[0].length !== expected_range[0].length) {\n return value\n }\n\n const row = actual_range.length;\n let tmp, i, j;\n\n // Convert single-dimension array into two-dimension array\n\n for (i = 0; i < row; i++) {\n if (!(actual_range[i] instanceof Array)) {\n tmp = actual_range[i];\n actual_range[i] = [];\n actual_range[i].push(tmp);\n }\n\n if (!(expected_range[i] instanceof Array)) {\n tmp = expected_range[i];\n expected_range[i] = [];\n expected_range[i].push(tmp);\n }\n }\n\n const col = actual_range[0].length;\n const dof = col === 1 ? row - 1 : (row - 1) * (col - 1);\n let xsqr = 0;\n const Pi = Math.PI;\n\n for (i = 0; i < row; i++) {\n for (j = 0; j < col; j++) {\n xsqr += Math.pow(actual_range[i][j] - expected_range[i][j], 2) / expected_range[i][j];\n }\n }\n\n // Get independency by X square and its degree of freedom\n function ChiSq(xsqr, dof) {\n let p = Math.exp(-0.5 * xsqr);\n\n if (dof % 2 === 1) {\n p = p * Math.sqrt((2 * xsqr) / Pi);\n }\n\n let k = dof;\n\n while (k >= 2) {\n p = (p * xsqr) / k;\n k = k - 2;\n }\n\n let t = p;\n let a = dof;\n\n while (t > 0.0000000001 * p) {\n a = a + 2;\n t = (t * xsqr) / a;\n p = p + t;\n }\n\n return 1 - p\n }\n\n return Math.round(ChiSq(xsqr, dof) * 1000000) / 1000000\n};\n\nconst CONFIDENCE = {};\n\n/**\n * Returns the confidence interval for a population mean.\n *\n * Category: Statistical\n *\n * @param {*} alpha The significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%, or in other words, an alpha of 0.05 indicates a 95 percent confidence level.\n * @param {*} standard_dev The population standard deviation for the data range and is assumed to be known.\n * @param {*} size The sample size.\n * @returns\n */\nCONFIDENCE.NORM = (alpha, standard_dev, size) => {\n alpha = parseNumber(alpha);\n standard_dev = parseNumber(standard_dev);\n size = parseNumber(size);\n\n if (anyIsError(alpha, standard_dev, size)) {\n return value\n }\n\n return jStat.normalci(1, alpha, standard_dev, size)[1] - 1\n};\n\n/**\n * Returns the confidence interval for a population mean, using a Student's t distribution.\n *\n * Category: Statistical\n *\n * @param {*} alpha The significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%, or in other words, an alpha of 0.05 indicates a 95 percent confidence level.\n * @param {*} standard_dev The population standard deviation for the data range and is assumed to be known.\n * @param {*} size The sample size.\n * @returns\n */\nCONFIDENCE.T = (alpha, standard_dev, size) => {\n alpha = parseNumber(alpha);\n standard_dev = parseNumber(standard_dev);\n size = parseNumber(size);\n\n if (anyIsError(alpha, standard_dev, size)) {\n return value\n }\n\n return jStat.tci(1, alpha, standard_dev, size)[1] - 1\n};\n\n/**\n * Returns the correlation coefficient between two data sets.\n *\n * Category: Statistical\n *\n * @param {*} array1 A range of value values.\n * @param {*} array2 A second range of value values.\n * @returns\n */\nfunction CORREL(array1, array2) {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n return jStat.corrcoeff(array1, array2)\n}\n\n/**\n * Counts how many numbers are in the list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args Cell reference, or range within which you want to count numbers.count numbers.\n * @returns\n */\nfunction COUNT() {\n const flatArguments = flatten(arguments);\n\n return numbers(flatArguments).length\n}\n\n/**\n * Counts how many values are in the list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args Arguments representing the values that you want to count.\n * @returns\n */\nfunction COUNTA() {\n const flatArguments = flatten(arguments);\n\n return flatArguments.length - COUNTBLANK(flatArguments)\n}\n\n/**\n * Counts the number of blank values within a range.\n *\n * Category: Statistical\n *\n * @param {*} args The range from which you want to count the blank values.\n * @returns\n */\nfunction COUNTBLANK() {\n const range = flatten(arguments);\n let blanks = 0;\n let element;\n\n for (let i = 0; i < range.length; i++) {\n element = range[i];\n\n if (element === undefined || element === null || element === '') {\n blanks++;\n }\n }\n\n return blanks\n}\n\n/**\n * Counts the number of values within a range that meet the given criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction COUNTIF(range, criteria) {\n range = flatten(range);\n\n const isWildcard = criteria === void 0 || criteria === '*';\n\n if (isWildcard) {\n return range.length\n }\n\n let matches = 0;\n const tokenizedCriteria = parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n if (compute(tokens)) {\n matches++;\n }\n }\n\n return matches\n}\n\n/**\n * Counts the number of values within a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @param {*} args Range in which to evaluate the associated criteria.\n * @returns\n */\nfunction COUNTIFS() {\n const args = argsToArray(arguments);\n const results = new Array(flatten(args[0]).length);\n\n for (let i = 0; i < results.length; i++) {\n results[i] = true;\n }\n\n for (let i = 0; i < args.length; i += 2) {\n const range = flatten(args[i]);\n const criteria = args[i + 1];\n const isWildcard = criteria === void 0 || criteria === '*';\n\n if (!isWildcard) {\n const tokenizedCriteria = parse(criteria + '');\n\n for (let j = 0; j < range.length; j++) {\n const value = range[j];\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n results[j] = results[j] && compute(tokens);\n }\n }\n }\n\n let result = 0;\n\n for (let i = 0; i < results.length; i++) {\n if (results[i]) {\n result++;\n }\n }\n\n return result\n}\n\nconst COVARIANCE = {};\n\n/**\n * Returns covariance, the average of the products of paired deviations.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first value range of integers.\n * @param {*} array2 The second value range of integers.\n * @returns\n */\nCOVARIANCE.P = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n const mean1 = jStat.mean(array1);\n const mean2 = jStat.mean(array2);\n let result = 0;\n const n = array1.length;\n\n for (let i = 0; i < n; i++) {\n result += (array1[i] - mean1) * (array2[i] - mean2);\n }\n\n return result / n\n};\n\n/**\n * Returns the sample covariance, the average of the products deviations for each data point pair in two data sets.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first value range of integers.\n * @param {*} array2 The second value range of integers.\n * @returns\n */\nCOVARIANCE.S = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n return jStat.covariance(array1, array2)\n};\n\n/**\n * Returns the sum of squares of deviations.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the sum of squared deviations. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction DEVSQ() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n let result = 0;\n\n for (let i = 0; i < range.length; i++) {\n result += Math.pow(range[i] - mean, 2);\n }\n\n return result\n}\n\nconst EXPON = {};\n\n/**\n * Returns the exponential distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value of the function.\n * @param {*} lambda The parameter value.\n * @param {*} cumulative A logical value that indicates which form of the exponential function to provide. If cumulative is TRUE, EXPON.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nEXPON.DIST = (x, lambda, cumulative) => {\n x = parseNumber(x);\n lambda = parseNumber(lambda);\n\n if (anyIsError(x, lambda)) {\n return value\n }\n\n return cumulative ? jStat.exponential.cdf(x, lambda) : jStat.exponential.pdf(x, lambda)\n};\n\nconst F = {};\n\n/**\n * Returns the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, F.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nF.DIST = (x, deg_freedom1, deg_freedom2, cumulative) => {\n x = parseNumber(x);\n deg_freedom1 = parseNumber(deg_freedom1);\n deg_freedom2 = parseNumber(deg_freedom2);\n\n if (anyIsError(x, deg_freedom1, deg_freedom2)) {\n return value\n }\n\n return cumulative\n ? jStat.centralF.cdf(x, deg_freedom1, deg_freedom2)\n : jStat.centralF.pdf(x, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.DIST.RT = function (x, deg_freedom1, deg_freedom2) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (x < 0 || deg_freedom1 < 1 || deg_freedom2 < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom1 !== 'number' || typeof deg_freedom2 !== 'number') {\n return value\n }\n\n return 1 - jStat.centralF.cdf(x, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the inverse of the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the F cumulative distribution.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.INV = (probability, deg_freedom1, deg_freedom2) => {\n probability = parseNumber(probability);\n deg_freedom1 = parseNumber(deg_freedom1);\n deg_freedom2 = parseNumber(deg_freedom2);\n\n if (anyIsError(probability, deg_freedom1, deg_freedom2)) {\n return value\n }\n\n if (probability <= 0.0 || probability > 1.0) {\n return num\n }\n\n return jStat.centralF.inv(probability, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the inverse of the F probability distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the F cumulative distribution.\n * @param {*} deg_freedom1 The numerator degrees of freedom.\n * @param {*} deg_freedom2 The denominator degrees of freedom.\n * @returns\n */\nF.INV.RT = function (probability, deg_freedom1, deg_freedom2) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (\n probability < 0 ||\n probability > 1 ||\n deg_freedom1 < 1 ||\n deg_freedom1 > Math.pow(10, 10) ||\n deg_freedom2 < 1 ||\n deg_freedom2 > Math.pow(10, 10)\n ) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof deg_freedom1 !== 'number' || typeof deg_freedom2 !== 'number') {\n return value\n }\n\n return jStat.centralF.inv(1.0 - probability, deg_freedom1, deg_freedom2)\n};\n\n/**\n * Returns the result of an F-test.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first array or range of data.\n * @param {*} array2 The second array or range of data.\n * @returns\n */\nF.TEST = (array1, array2) => {\n if (!array1 || !array2) {\n return na\n }\n\n if (!(array1 instanceof Array) || !(array2 instanceof Array)) {\n return na\n }\n\n if (array1.length < 2 || array2.length < 2) {\n return div0\n }\n\n const sumOfSquares = (values, x1) => {\n let sum = 0;\n\n for (let i = 0; i < values.length; i++) {\n sum += Math.pow(values[i] - x1, 2);\n }\n\n return sum\n };\n\n const x1 = SUM(array1) / array1.length;\n const x2 = SUM(array2) / array2.length;\n const sum1 = sumOfSquares(array1, x1) / (array1.length - 1);\n const sum2 = sumOfSquares(array2, x2) / (array2.length - 1);\n\n return sum1 / sum2\n};\n\n/**\n * Returns the Fisher transformation.\n *\n * Category: Statistical\n *\n * @param {*} x A numeric value for which you want the transformation.\n * @returns\n */\nfunction FISHER(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return x\n }\n\n return Math.log((1 + x) / (1 - x)) / 2\n}\n\n/**\n * Returns the inverse of the Fisher transformation.\n *\n * Category: Statistical\n *\n * @param {*} y The value for which you want to perform the inverse of the transformation.\n * @returns\n */\nfunction FISHERINV(y) {\n y = parseNumber(y);\n\n if (y instanceof Error) {\n return y\n }\n\n const e2y = Math.exp(2 * y);\n\n return (e2y - 1) / (e2y + 1)\n}\n\n/**\n * Returns a value along a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} x The data point for which you want to predict a value.\n * @param {*} known_ys The dependent array or range of data.\n * @param {*} known_xs The independent array or range of data.\n * @returns\n */\nfunction FORECAST(x, known_ys, known_xs) {\n x = parseNumber(x);\n known_ys = parseNumberArray(flatten(known_ys));\n known_xs = parseNumberArray(flatten(known_xs));\n\n if (anyIsError(x, known_ys, known_xs)) {\n return value\n }\n\n const xmean = jStat.mean(known_xs);\n const ymean = jStat.mean(known_ys);\n const n = known_xs.length;\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_xs[i] - xmean) * (known_ys[i] - ymean);\n den += Math.pow(known_xs[i] - xmean, 2);\n }\n\n const b = num / den;\n const a = ymean - b * xmean;\n\n return a + b * x\n}\n\n/**\n * Returns a frequency distribution as a vertical array.\n *\n * Category: Statistical\n *\n * @param {*} data_array An array of or reference to a set of values for which you want to count frequencies. If data_array contains no values, FREQUENCY returns an array of zeros.\n * @param {*} bins_array An array of or reference to intervals into which you want to group the values in data_array. If bins_array contains no values, FREQUENCY returns the number of elements in data_array.\n * @returns\n */\nfunction FREQUENCY(data_array, bins_array) {\n data_array = parseNumberArray(flatten(data_array));\n bins_array = parseNumberArray(flatten(bins_array));\n\n if (anyIsError(data_array, bins_array)) {\n return value\n }\n\n const n = data_array.length;\n const b = bins_array.length;\n const r = [];\n\n for (let i = 0; i <= b; i++) {\n r[i] = 0;\n\n for (let j = 0; j < n; j++) {\n if (i === 0) {\n if (data_array[j] <= bins_array[0]) {\n r[0] += 1;\n }\n } else if (i < b) {\n if (data_array[j] > bins_array[i - 1] && data_array[j] <= bins_array[i]) {\n r[i] += 1;\n }\n } else if (i === b) {\n if (data_array[j] > bins_array[b - 1]) {\n r[b] += 1;\n }\n }\n }\n }\n\n return r\n}\n\n/**\n * Returns the Gamma function value.\n *\n * Category: Statistical\n *\n * @param {*} number Returns a number.\n * @returns\n */\nfunction GAMMA(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n if (parseInt(number, 10) === number && number < 0) {\n return num\n }\n\n return jStat.gammafn(number)\n}\n\n/**\n * Returns the gamma distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which you want to evaluate the distribution.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution. If beta = 1, GAMMA.DIST returns the standard gamma distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, GAMMA.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nGAMMA.DIST = function (value$1, alpha, beta, cumulative) {\n if (arguments.length !== 4) {\n return na\n }\n\n if (value$1 < 0 || alpha <= 0 || beta <= 0) {\n return value\n }\n\n if (typeof value$1 !== 'number' || typeof alpha !== 'number' || typeof beta !== 'number') {\n return value\n }\n\n return cumulative ? jStat.gamma.cdf(value$1, alpha, beta, true) : jStat.gamma.pdf(value$1, alpha, beta, false)\n};\n\n/**\n * Returns the inverse of the gamma cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the gamma distribution.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution. If beta = 1, GAMMA.INV returns the standard gamma distribution.\n * @returns\n */\nGAMMA.INV = function (probability, alpha, beta) {\n if (arguments.length !== 3) {\n return na\n }\n\n if (probability < 0 || probability > 1 || alpha <= 0 || beta <= 0) {\n return num\n }\n\n if (typeof probability !== 'number' || typeof alpha !== 'number' || typeof beta !== 'number') {\n return value\n }\n\n return jStat.gamma.inv(probability, alpha, beta)\n};\n\n/**\n * Returns the natural logarithm of the gamma function, \u0393(x).\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want to calculate GAMMALN.\n * @returns\n */\nfunction GAMMALN(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return x\n }\n\n return jStat.gammaln(x)\n}\n\n/**\n * Returns the natural logarithm of the gamma function, \u0393(x).\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want to calculate GAMMALN.PRECISE.\n * @returns\n */\nGAMMALN.PRECISE = function (x) {\n if (arguments.length !== 1) {\n return na\n }\n\n if (x <= 0) {\n return num\n }\n\n if (typeof x !== 'number') {\n return value\n }\n\n return jStat.gammaln(x)\n};\n\n/**\n * Returns 0.5 less than the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} z Returns a number.\n * @returns\n */\nfunction GAUSS(z) {\n z = parseNumber(z);\n\n if (z instanceof Error) {\n return z\n }\n\n return jStat.normal.cdf(z, 0, 1) - 0.5\n}\n\n/**\n * Returns the geometric mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction GEOMEAN() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n return jStat.geomean(args)\n}\n\n/**\n * Returns values along an exponential trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values you already know in the relationship y = b*m^x.\n - If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.\n - If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.\n - If any of the numbers in known_y's is 0 or negative, GROWTH returns the #NUM! error value.\n * @param {*} known_x Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.\n - The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @param {*} new_x Optional. Are new x-values for which you want GROWTH to return corresponding y-values.\n - new_x's must include a column (or row) for each independent variable, just as known_x's does. So, if known_y's is in a single column, known_x's and new_x's must have the same number of columns. If known_y's is in a single row, known_x's and new_x's must have the same number of rows.\n - If new_x's is omitted, it is assumed to be the same as known_x's.\n - If both known_x's and new_x's are omitted, they are assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @param {*} use_const Optional. A logical value specifying whether to force the constant b to equal 1. If const is TRUE or omitted, b is calculated normally. If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.\n - If const is TRUE or omitted, b is calculated normally.\n - If const is FALSE, b is set equal to 1 and the m-values are adjusted so that y = m^x.\n * @returns\n */\nfunction GROWTH(known_y, known_x, new_x, use_const) {\n // Credits: Ilmari Karonen (http://stackoverflow.com/questions/14161990/how-to-implement-growth-function-in-javascript)\n known_y = parseNumberArray(flatten(known_y));\n\n if (known_y instanceof Error) {\n return known_y\n }\n\n // Default values for optional parameters:\n let i;\n\n if (known_x === undefined) {\n known_x = [];\n\n for (i = 1; i <= known_y.length; i++) {\n known_x.push(i);\n }\n }\n\n if (new_x === undefined) {\n new_x = known_x;\n }\n\n known_x = parseNumberArray(flatten(known_x));\n new_x = parseNumberArray(flatten(new_x));\n\n if (anyIsError(known_x, new_x)) {\n return value\n }\n\n if (use_const === undefined) {\n use_const = true;\n }\n\n // Calculate sums over the data:\n const n = known_y.length;\n let avg_x = 0;\n let avg_y = 0;\n let avg_xy = 0;\n let avg_xx = 0;\n\n for (i = 0; i < n; i++) {\n const x = known_x[i];\n const y = Math.log(known_y[i]);\n avg_x += x;\n avg_y += y;\n avg_xy += x * y;\n avg_xx += x * x;\n }\n\n avg_x /= n;\n avg_y /= n;\n avg_xy /= n;\n avg_xx /= n;\n\n // Compute linear regression coefficients:\n let beta;\n let alpha;\n\n if (use_const) {\n beta = (avg_xy - avg_x * avg_y) / (avg_xx - avg_x * avg_x);\n alpha = avg_y - beta * avg_x;\n } else {\n beta = avg_xy / avg_xx;\n alpha = 0;\n }\n\n // Compute and return result array:\n const new_y = [];\n\n for (i = 0; i < new_x.length; i++) {\n new_y.push(Math.exp(alpha + beta * new_x[i]));\n }\n\n return new_y\n}\n\n/**\n * Returns the harmonic mean.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate the mean. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction HARMEAN() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n den += 1 / range[i];\n }\n\n return n / den\n}\n\nconst HYPGEOM = {};\n\n/**\n * Returns the hypergeometric distribution.\n *\n * Category: Statistical\n *\n * @param {*} sample_s The number of successes in the sample.\n * @param {*} number_sample The size of the sample.\n * @param {*} population_s The number of successes in the population.\n * @param {*} number_pop The population size.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, then HYPGEOM.DIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.\n * @returns\n */\nHYPGEOM.DIST = (sample_s, number_sample, population_s, number_pop, cumulative) => {\n sample_s = parseNumber(sample_s);\n number_sample = parseNumber(number_sample);\n population_s = parseNumber(population_s);\n number_pop = parseNumber(number_pop);\n\n if (anyIsError(sample_s, number_sample, population_s, number_pop)) {\n return value\n }\n\n function pdf(x, n, M, N) {\n return (COMBIN(M, x) * COMBIN(N - M, n - x)) / COMBIN(N, n)\n }\n\n function cdf(x, n, M, N) {\n let result = 0;\n\n for (let i = 0; i <= x; i++) {\n result += pdf(i, n, M, N);\n }\n\n return result\n }\n\n return cumulative\n ? cdf(sample_s, number_sample, population_s, number_pop)\n : pdf(sample_s, number_sample, population_s, number_pop)\n};\n\n/**\n * Returns the intercept of the linear regression line.\n *\n * Category: Statistical\n *\n * @param {*} known_y The dependent set of observations or data.\n * @param {*} known_x The independent set of observations or data.\n * @returns\n */\nfunction INTERCEPT(known_y, known_x) {\n known_y = parseNumberArray(known_y);\n known_x = parseNumberArray(known_x);\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n if (known_y.length !== known_x.length) {\n return na\n }\n\n return FORECAST(0, known_y, known_x)\n}\n\n/**\n * Returns the kurtosis of a data set.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate kurtosis. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction KURT() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n let sigma = 0;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 4);\n }\n\n sigma = sigma / Math.pow(jStat.stdev(range, true), 4);\n\n return ((n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3))) * sigma - (3 * (n - 1) * (n - 1)) / ((n - 2) * (n - 3))\n}\n\n/**\n * Returns the k-th largest value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data for which you want to determine the k-th largest value.\n * @param {*} k The position (from the largest) in the array or value range of data to return.\n * @returns\n */\nfunction LARGE(array, k) {\n const someError = anyError.apply(undefined, array);\n\n if (someError) {\n return someError\n }\n\n if (anyIsError(k)) {\n return k\n }\n\n array = numbers(flatten(array));\n k = parseNumber(k);\n\n if (k < 0 || array.length < k) {\n return value\n }\n\n return array.sort((a, b) => b - a)[k - 1]\n}\n\n/**\n * Returns the parameters of a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values that you already know in the relationship y = mx + b.\n - If the range of known_y's is in a single column, each column of known_x's is interpreted as a separate variable.\n - If the range of known_y's is contained in a single row, each row of known_x's is interpreted as a separate variable.\n * @param {*} known_x Optional. A set of x-values that you may already know in the relationship y = mx + b.\n - The range of known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @returns\n */\nfunction LINEST(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const ymean = jStat.mean(known_y);\n const xmean = jStat.mean(known_x);\n const n = known_x.length;\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n const m = num / den;\n const b = ymean - m * xmean;\n\n return [m, b]\n}\n\n// According to Microsoft:\n// http://office.microsoft.com/en-us/starter-help/logest-function-HP010342665.aspx\n// LOGEST returns are based on the following linear model:\n// ln y = x1 ln m1 + ... + xn ln mn + ln b\n/**\n * Returns the parameters of an exponential trend.\n *\n * Category: Statistical\n *\n * @param {*} known_y The set of y-values you already know in the relationship y = b*m^x.\n - If the array known_y's is in a single column, then each column of known_x's is interpreted as a separate variable.\n - If the array known_y's is in a single row, then each row of known_x's is interpreted as a separate variable.\n * @param {*} known_x Optional. An optional set of x-values that you may already know in the relationship y = b*m^x.\n - The array known_x's can include one or more sets of variables. If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known_y's must be a range of values with a height of one row or a width of one column (which is also known as a vector).\n - If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.\n * @returns\n */\nfunction LOGEST(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n if (known_y.length !== known_x.length) {\n return value\n }\n\n for (let i = 0; i < known_y.length; i++) {\n known_y[i] = Math.log(known_y[i]);\n }\n\n const result = LINEST(known_y, known_x);\n result[0] = Math.round(Math.exp(result[0]) * 1000000) / 1000000;\n result[1] = Math.round(Math.exp(result[1]) * 1000000) / 1000000;\n\n return result\n}\n\nconst LOGNORM = {};\n\n/**\n * Returns the cumulative lognormal distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} mean The mean of ln(x).\n * @param {*} standard_dev The standard deviation of ln(x).\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, LOGNORM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nLOGNORM.DIST = (x, mean, standard_dev, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n return cumulative ? jStat.lognormal.cdf(x, mean, standard_dev) : jStat.lognormal.pdf(x, mean, standard_dev)\n};\n\n/**\n * Returns the inverse of the lognormal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability associated with the lognormal distribution.\n * @param {*} mean The mean of ln(x).\n * @param {*} standard_dev The standard deviation of ln(x).\n * @returns\n */\nLOGNORM.INV = (probability, mean, standard_dev) => {\n probability = parseNumber(probability);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(probability, mean, standard_dev)) {\n return value\n }\n\n return jStat.lognormal.inv(probability, mean, standard_dev)\n};\n\n/**\n * Returns the maximum value in a list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 numbers for which you want to find the maximum value.\n * @returns\n */\nfunction MAX() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArguments);\n\n return range.length === 0 ? 0 : Math.max.apply(Math, range)\n}\n\n/**\n * Returns the maximum value in a list of arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2,... Number arguments 2 to 255 for which you want to find the largest value.\n * @returns\n */\nfunction MAXA() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n let range = arrayValuesToNumbers(flatArguments);\n range = range.map((value) => (value === undefined || value === null ? 0 : value));\n\n return range.length === 0 ? 0 : Math.max.apply(Math, range)\n}\n\n/**\n * Returns the maximum of all values in a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction MAXIFS() {\n const values = applyCriteria(...arguments);\n return values.length === 0 ? 0 : Math.max.apply(Math, values)\n}\n\n/**\n * Returns the median of the given numbers.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 numbers for which you want the median.\n * @returns\n */\nfunction MEDIAN() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = arrayValuesToNumbers(flatArguments);\n let result = jStat.median(range);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the minimum value in a list of arguments.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is optional, subsequent numbers are optional. 1 to 255 numbers for which you want to find the minimum value.\n * @returns\n */\nfunction MIN() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n const range = numbers(flatArguments);\n\n return range.length === 0 ? 0 : Math.min.apply(Math, range)\n}\n\n/**\n * Returns the smallest value in a list of arguments, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values for which you want to find the smallest value.\n * @returns\n */\nfunction MINA() {\n const flatArguments = flatten(arguments);\n const someError = anyError.apply(undefined, flatArguments);\n\n if (someError) {\n return someError\n }\n\n let range = arrayValuesToNumbers(flatArguments);\n range = range.map((value) => (value === undefined || value === null ? 0 : value));\n\n return range.length === 0 ? 0 : Math.min.apply(Math, range)\n}\n\n/**\n * Returns the minimum of all values in a range that meet multiple criteria.\n *\n * Category: Statistical\n *\n * @returns\n */\nfunction MINIFS() {\n const values = applyCriteria(...arguments);\n return values.length === 0 ? 0 : Math.min.apply(Math, values)\n}\n\nconst MODE = {};\n\n/**\n * Returns a vertical array of the most frequently occurring, or repetitive values in an array or range of data.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nMODE.MULT = function () {\n // Credits: Ro\u00F6na\u00E4n\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n const count = {};\n let maxItems = [];\n let max = 0;\n let currentItem;\n\n for (let i = 0; i < n; i++) {\n currentItem = range[i];\n count[currentItem] = count[currentItem] ? count[currentItem] + 1 : 1;\n\n if (count[currentItem] > max) {\n max = count[currentItem];\n maxItems = [];\n }\n\n if (count[currentItem] === max) {\n maxItems[maxItems.length] = currentItem;\n }\n }\n\n return maxItems\n};\n\n/**\n * Returns the most common value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Arguments 2 to 254 for which you want to calculate the mode. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nMODE.SNGL = function () {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n return MODE.MULT(range).sort((a, b) => a - b)[0]\n};\n\nconst NEGBINOM = {};\n\n/**\n * Returns the negative binomial distribution.\n *\n * Category: Statistical\n *\n * @param {*} number_f The number of failures.\n * @param {*} number_s The threshold number of successes.\n * @param {*} probability_s The probability of a success.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, NEGBINOM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nNEGBINOM.DIST = (number_f, number_s, probability_s, cumulative) => {\n number_f = parseNumber(number_f);\n number_s = parseNumber(number_s);\n probability_s = parseNumber(probability_s);\n\n if (anyIsError(number_f, number_s, probability_s)) {\n return value\n }\n\n return cumulative\n ? jStat.negbin.cdf(number_f, number_s, probability_s)\n : jStat.negbin.pdf(number_f, number_s, probability_s)\n};\n\nconst NORM = {};\n\n/**\n * Returns the normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value for which you want the distribution.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, NORM.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nNORM.DIST = (x, mean, standard_dev, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n if (standard_dev <= 0) {\n return num\n }\n\n // Return normal distribution computed by jStat [http://jstat.org]\n return cumulative ? jStat.normal.cdf(x, mean, standard_dev) : jStat.normal.pdf(x, mean, standard_dev)\n};\n\n/**\n * Returns the inverse of the normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability corresponding to the normal distribution.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @returns\n */\nNORM.INV = (probability, mean, standard_dev) => {\n probability = parseNumber(probability);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(probability, mean, standard_dev)) {\n return value\n }\n\n return jStat.normal.inv(probability, mean, standard_dev)\n};\n\nNORM.S = {};\n\n/**\n * Returns the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} z The value for which you want the distribution.\n * @param {*} cumulative Cumulative is a logical value that determines the form of the function. If cumulative is TRUE, NORMS.DIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.\n * @returns\n */\nNORM.S.DIST = (z, cumulative) => {\n z = parseNumber(z);\n\n if (z instanceof Error) {\n return value\n }\n\n return cumulative ? jStat.normal.cdf(z, 0, 1) : jStat.normal.pdf(z, 0, 1)\n};\n\n/**\n * Returns the inverse of the standard normal cumulative distribution.\n *\n * Category: Statistical\n *\n * @param {*} probability A probability corresponding to the normal distribution.\n * @returns\n */\nNORM.S.INV = (probability) => {\n probability = parseNumber(probability);\n\n if (probability instanceof Error) {\n return value\n }\n\n return jStat.normal.inv(probability, 0, 1)\n};\n\n/**\n * Returns the Pearson product moment correlation coefficient.\n *\n * Category: Statistical\n *\n * @param {*} array1 A set of independent values.\n * @param {*} array2 A set of dependent values.\n * @returns\n */\nfunction PEARSON(array1, array2) {\n array2 = parseNumberArray(flatten(array2));\n array1 = parseNumberArray(flatten(array1));\n\n if (anyIsError(array2, array1)) {\n return value\n }\n\n const xmean = jStat.mean(array1);\n const ymean = jStat.mean(array2);\n const n = array1.length;\n let num = 0;\n let den1 = 0;\n let den2 = 0;\n\n for (let i = 0; i < n; i++) {\n num += (array1[i] - xmean) * (array2[i] - ymean);\n den1 += Math.pow(array1[i] - xmean, 2);\n den2 += Math.pow(array2[i] - ymean, 2);\n }\n\n return num / Math.sqrt(den1 * den2)\n}\n\nconst PERCENTILE = {};\n\n/**\n * Returns the k-th percentile of values in a range, where k is in the range 0..1, exclusive.\n *\n * Category: Statistical\n *\n * @returns\n */\nPERCENTILE.EXC = (array, k) => {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n const n = array.length;\n\n if (k < 1 / (n + 1) || k > 1 - 1 / (n + 1)) {\n return num\n }\n\n const l = k * (n + 1) - 1;\n const fl = Math.floor(l);\n\n return cleanFloat(l === fl ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]))\n};\n\n/**\n * Returns the k-th percentile of values in a range.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data that defines relative standing.\n * @param {*} k The percentile value in the range 0..1, inclusive.\n * @returns\n */\nPERCENTILE.INC = (array, k) => {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n const n = array.length;\n const l = k * (n - 1);\n const fl = Math.floor(l);\n\n return cleanFloat(l === fl ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]))\n};\n\nconst PERCENTRANK = {};\n\n/**\n * Returns the rank of a value in a data set as a percentage (0..1, exclusive) of the data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data with numeric values that defines relative standing\n * @param {*} x The value for which you want to know the rank.\n * @param {*} significance Optional. A value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK.EXC uses three digits (0.xxx).\n * @returns\n */\nPERCENTRANK.EXC = (array, x, significance) => {\n significance = significance === undefined ? 3 : significance;\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n significance = parseNumber(significance);\n\n if (anyIsError(array, x, significance)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n const uniques = UNIQUE.apply(null, array);\n const n = array.length;\n const m = uniques.length;\n const power = Math.pow(10, significance);\n let result = 0;\n let match = false;\n let i = 0;\n\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = (array.indexOf(uniques[i]) + 1) / (n + 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + 1 + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n + 1);\n match = true;\n }\n\n i++;\n }\n\n return Math.floor(result * power) / power\n};\n\n/**\n * Returns the percentage rank of a value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data with numeric values that defines relative standing.\n * @param {*} x The value for which you want to know the rank.\n * @param {*} significance Optional. A value that identifies the number of significant digits for the returned percentage value. If omitted, PERCENTRANK.INC uses three digits (0.xxx).\n * @returns\n */\nPERCENTRANK.INC = (array, x, significance) => {\n significance = significance === undefined ? 3 : significance;\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n significance = parseNumber(significance);\n\n if (anyIsError(array, x, significance)) {\n return value\n }\n\n array = array.sort((a, b) => a - b);\n const uniques = UNIQUE.apply(null, array);\n const n = array.length;\n const m = uniques.length;\n const power = Math.pow(10, significance);\n let result = 0;\n let match = false;\n let i = 0;\n\n while (!match && i < m) {\n if (x === uniques[i]) {\n result = array.indexOf(uniques[i]) / (n - 1);\n match = true;\n } else if (x >= uniques[i] && (x < uniques[i + 1] || i === m - 1)) {\n result = (array.indexOf(uniques[i]) + (x - uniques[i]) / (uniques[i + 1] - uniques[i])) / (n - 1);\n match = true;\n }\n\n i++;\n }\n\n return Math.floor(result * power) / power\n};\n\n/**\n * Returns the number of permutations for a given number of objects.\n *\n * Category: Statistical\n *\n * @param {*} number An integer that describes the number of objects.\n * @param {*} number_chosen An integer that describes the number of objects in each permutation.\n * @returns\n */\nfunction PERMUT(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n\n if (anyIsError(number, number_chosen)) {\n return value\n }\n\n return FACT(number) / FACT(number - number_chosen)\n}\n\n/**\n * Returns the number of permutations for a given number of objects (with repetitions) that can be selected from the total objects.\n *\n * Category: Statistical\n *\n * @param {*} number An integer that describes the total number of objects.\n * @param {*} number_chosen An integer that describes the number of objects in each permutation.\n * @returns\n */\nfunction PERMUTATIONA(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n\n if (anyIsError(number, number_chosen)) {\n return value\n }\n\n return Math.pow(number, number_chosen)\n}\n\n/**\n * Returns the value of the density function for a standard normal distribution.\n *\n * Category: Statistical\n *\n * @param {*} x X is the number for which you want the density of the standard normal distribution.\n * @returns\n */\nfunction PHI(x) {\n x = parseNumber(x);\n\n if (x instanceof Error) {\n return value\n }\n\n return Math.exp(-0.5 * x * x) / SQRT2PI\n}\n\nconst POISSON = {};\n\n/**\n * Returns the Poisson distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The number of events.\n * @param {*} mean The expected numeric value.\n * @param {*} cumulative A logical value that determines the form of the probability distribution returned. If cumulative is TRUE, POISSON.DIST returns the cumulative Poisson probability that the number of random events occurring will be between zero and x inclusive; if FALSE, it returns the Poisson probability mass function that the number of events occurring will be exactly x.\n * @returns\n */\nPOISSON.DIST = (x, mean, cumulative) => {\n x = parseNumber(x);\n mean = parseNumber(mean);\n\n if (anyIsError(x, mean)) {\n return value\n }\n\n return cumulative ? jStat.poisson.cdf(x, mean) : jStat.poisson.pdf(x, mean)\n};\n\n/**\n * Returns the probability that values in a range are between two limits.\n *\n * Category: Statistical\n *\n * @param {*} x_range The range of numeric values of x with which there are associated probabilities.\n * @param {*} prob_range A set of probabilities associated with values in x_range.\n * @param {*} lower_limit Optional. The lower bound on the value for which you want a probability.\n * @param {*} upper_limit Optional. The optional upper bound on the value for which you want a probability.\n * @returns\n */\nfunction PROB(x_range, prob_range, lower_limit, upper_limit) {\n if (lower_limit === undefined) {\n return 0\n }\n\n upper_limit = upper_limit === undefined ? lower_limit : upper_limit;\n\n x_range = parseNumberArray(flatten(x_range));\n prob_range = parseNumberArray(flatten(prob_range));\n lower_limit = parseNumber(lower_limit);\n upper_limit = parseNumber(upper_limit);\n\n if (anyIsError(x_range, prob_range, lower_limit, upper_limit)) {\n return value\n }\n\n if (lower_limit === upper_limit) {\n return x_range.indexOf(lower_limit) >= 0 ? prob_range[x_range.indexOf(lower_limit)] : 0\n }\n\n const sorted = x_range.sort((a, b) => a - b);\n const n = sorted.length;\n let result = 0;\n\n for (let i = 0; i < n; i++) {\n if (sorted[i] >= lower_limit && sorted[i] <= upper_limit) {\n result += prob_range[x_range.indexOf(sorted[i])];\n }\n }\n\n return result\n}\n\nconst QUARTILE = {};\n\n/**\n * Returns the quartile of the data set, based on percentile values from 0..1, exclusive.\n *\n * Category: Statistical\n *\n * @param {*} array The array or value range of numeric values for which you want the quartile value.\n * @param {*} quart Indicates which value to return.\n * @returns\n */\nQUARTILE.EXC = (range, quart) => {\n range = parseNumberArray(flatten(range));\n quart = parseNumber(quart);\n\n if (anyIsError(range, quart)) {\n return value\n }\n\n switch (quart) {\n case 1:\n return PERCENTILE.EXC(range, 0.25)\n case 2:\n return PERCENTILE.EXC(range, 0.5)\n case 3:\n return PERCENTILE.EXC(range, 0.75)\n default:\n return num\n }\n};\n\n/**\n * Returns the quartile of a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or value range of numeric values for which you want the quartile value.\n * @param {*} quart Indicates which value to return.\n * @returns\n */\nQUARTILE.INC = (range, quart) => {\n range = parseNumberArray(flatten(range));\n quart = parseNumber(quart);\n\n if (anyIsError(range, quart)) {\n return value\n }\n\n switch (quart) {\n case 1:\n return PERCENTILE.INC(range, 0.25)\n case 2:\n return PERCENTILE.INC(range, 0.5)\n case 3:\n return PERCENTILE.INC(range, 0.75)\n default:\n return num\n }\n};\n\nconst RANK = {};\n\n/**\n * Returns the rank of a number in a list of numbers.\n *\n * Category: Statistical\n *\n * @param {*} number The number whose rank you want to find.\n * @param {*} ref An array of, or a reference to, a list of numbers. Nonnumeric values in Ref are ignored.\n * @param {*} order Optional. A number specifying how to rank number.\n * @returns\n */\nRANK.AVG = (number, ref, order) => {\n number = parseNumber(number);\n ref = parseNumberArray(flatten(ref));\n\n if (anyIsError(number, ref)) {\n return value\n }\n\n ref = flatten(ref);\n order = order || false;\n const sort = order ? (a, b) => a - b : (a, b) => b - a;\n ref = ref.sort(sort);\n\n const length = ref.length;\n let count = 0;\n\n for (let i = 0; i < length; i++) {\n if (ref[i] === number) {\n count++;\n }\n }\n\n return count > 1 ? (2 * ref.indexOf(number) + count + 1) / 2 : ref.indexOf(number) + 1\n};\n\n/**\n * Returns the rank of a number in a list of numbers.\n *\n * Category: Statistical\n *\n * @param {*} number The number whose rank you want to find.\n * @param {*} ref An array of, or a reference to, a list of numbers. Non-numeric values in Ref are ignored.\n * @param {*} order Optional. A number specifying how to rank number.\n * @returns\n */\nRANK.EQ = (number, ref, order) => {\n number = parseNumber(number);\n ref = parseNumberArray(flatten(ref));\n\n if (anyIsError(number, ref)) {\n return value\n }\n\n order = order || false;\n const sort = order ? (a, b) => a - b : (a, b) => b - a;\n ref = ref.sort(sort);\n\n return ref.indexOf(number) + 1\n};\n\n/**\n * Returns the row number of a reference.\n *\n * Category: Lookup and reference\n *\n * @param {*} reference the value or range of values for which you want the row number.\n * @param {*} index\n * @returns\n */\nfunction ROW(reference, index) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (index < 0) {\n return num\n }\n\n if (!(reference instanceof Array) || typeof index !== 'number') {\n return value\n }\n\n if (reference.length === 0) {\n return undefined\n }\n\n return jStat.row(reference, index)\n}\n\n/**\n * Returns the square of the Pearson product moment correlation coefficient.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or range of data points.\n * @param {*} known_x An array or range of data points.\n * @returns\n */\nfunction RSQ(known_y, known_x) {\n // no need to flatten here, PEARSON will take care of that\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n return Math.pow(PEARSON(known_y, known_x), 2)\n}\n\n/**\n * Returns the skewness of a distribution.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want to calculate skewness. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction SKEW() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n let sigma = 0;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 3);\n }\n\n return (n * sigma) / ((n - 1) * (n - 2) * Math.pow(jStat.stdev(range, true), 3))\n}\n\n/**\n * Returns the skewness of a distribution based on a population.\n *\n * Category: Statistical\n *\n * @returns\n */\nSKEW.P = function () {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const mean = jStat.mean(range);\n const n = range.length;\n let m2 = 0;\n let m3 = 0;\n\n for (let i = 0; i < n; i++) {\n m3 += Math.pow(range[i] - mean, 3);\n m2 += Math.pow(range[i] - mean, 2);\n }\n\n m3 = m3 / n;\n m2 = m2 / n;\n\n return m3 / Math.pow(m2, 3 / 2)\n};\n\n/**\n * Returns the slope of the linear regression line.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or value range of numeric dependent data points.\n * @param {*} known_x The set of independent data points.\n * @returns\n */\nfunction SLOPE(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const xmean = jStat.mean(known_x);\n const ymean = jStat.mean(known_y);\n const n = known_x.length;\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n return num / den\n}\n\n/**\n * Returns the k-th smallest value in a data set.\n *\n * Category: Statistical\n *\n * @param {*} array An array or range of numerical data for which you want to determine the k-th smallest value.\n * @param {*} k The position (from the smallest) in the array or range of data to return.\n * @returns\n */\nfunction SMALL(array, k) {\n array = parseNumberArray(flatten(array));\n k = parseNumber(k);\n\n if (anyIsError(array, k)) {\n return array\n }\n\n return array.sort((a, b) => a - b)[k - 1]\n}\n\n/**\n * Returns a normalized value.\n *\n * Category: Statistical\n *\n * @param {*} x The value you want to normalize.\n * @param {*} mean The arithmetic mean of the distribution.\n * @param {*} standard_dev The standard deviation of the distribution.\n * @returns\n */\nfunction STANDARDIZE(x, mean, standard_dev) {\n x = parseNumber(x);\n mean = parseNumber(mean);\n standard_dev = parseNumber(standard_dev);\n\n if (anyIsError(x, mean, standard_dev)) {\n return value\n }\n\n return (x - mean) / standard_dev\n}\n\nconst STDEV = {};\n\n/**\n * Calculates standard deviation based on the entire population.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nSTDEV.P = function () {\n const v = VAR.P.apply(this, arguments);\n let result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n};\n\n/**\n * Estimates standard deviation based on a sample.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nSTDEV.S = function () {\n const v = VAR.S.apply(this, arguments);\n const result = Math.sqrt(v);\n\n return result\n};\n\n/**\n * Estimates standard deviation based on a sample, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a sample of a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction STDEVA() {\n const v = VARA.apply(this, arguments);\n const result = Math.sqrt(v);\n\n return result\n}\n\n/**\n * Calculates standard deviation based on the entire population, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 values corresponding to a population. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction STDEVPA() {\n const v = VARPA.apply(this, arguments);\n let result = Math.sqrt(v);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the standard error of the predicted y-value for each x in the regression.\n *\n * Category: Statistical\n *\n * @param {*} known_y An array or range of dependent data points.\n * @param {*} known_x An array or range of independent data points.\n * @returns\n */\nfunction STEYX(known_y, known_x) {\n known_y = parseNumberArray(flatten(known_y));\n known_x = parseNumberArray(flatten(known_x));\n\n if (anyIsError(known_y, known_x)) {\n return value\n }\n\n const xmean = jStat.mean(known_x);\n const ymean = jStat.mean(known_y);\n const n = known_x.length;\n let lft = 0;\n let num = 0;\n let den = 0;\n\n for (let i = 0; i < n; i++) {\n lft += Math.pow(known_y[i] - ymean, 2);\n num += (known_x[i] - xmean) * (known_y[i] - ymean);\n den += Math.pow(known_x[i] - xmean, 2);\n }\n\n return Math.sqrt((lft - (num * num) / den) / (n - 2))\n}\n\nconst T$1 = {};\n\n/**\n * Returns the Percentage Points (probability) for the Student t-distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @param {*} cumulative A logical value that determines the form of the function. If cumulative is TRUE, T.DIST returns the cumulative distribution function; if FALSE, it returns the probability density function.\n * @returns\n */\nT$1.DIST = (x, deg_freedom, cumulative) => {\n if (cumulative !== 1 && cumulative !== 2) {\n return num\n }\n\n return cumulative === 1 ? T$1.DIST.RT(x, deg_freedom) : T$1.DIST['2T'](x, deg_freedom)\n};\n\n/**\n * Returns the Percentage Points (probability) for the Student t-distribution\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution.\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @returns\n */\nT$1.DIST['2T'] = function (x, deg_freedom) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (x < 0 || deg_freedom < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return (1 - jStat.studentt.cdf(x, deg_freedom)) * 2\n};\n\n/**\n * Returns the Student's t-distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The numeric value at which to evaluate the distribution.\n * @param {*} deg_freedom An integer indicating the number of degrees of freedom.\n * @returns\n */\nT$1.DIST.RT = function (x, deg_freedom) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (x < 0 || deg_freedom < 1) {\n return num\n }\n\n if (typeof x !== 'number' || typeof deg_freedom !== 'number') {\n return value\n }\n\n return 1 - jStat.studentt.cdf(x, deg_freedom)\n};\n\n/**\n * Returns the t-value of the Student's t-distribution as a function of the probability and the degrees of freedom.\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the Student's t-distribution.\n * @param {*} deg_freedom The number of degrees of freedom with which to characterize the distribution.\n * @returns\n */\nT$1.INV = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return jStat.studentt.inv(probability, deg_freedom)\n};\n\n/**\n * Returns the inverse of the Student's t-distribution\n *\n * Category: Statistical\n *\n * @param {*} probability The probability associated with the Student's t-distribution.\n * @param {*} deg_freedom The number of degrees of freedom with which to characterize the distribution.\n * @returns\n */\nT$1.INV['2T'] = (probability, deg_freedom) => {\n probability = parseNumber(probability);\n deg_freedom = parseNumber(deg_freedom);\n\n if (probability <= 0 || probability > 1 || deg_freedom < 1) {\n return num\n }\n\n if (anyIsError(probability, deg_freedom)) {\n return value\n }\n\n return Math.abs(jStat.studentt.inv(probability / 2, deg_freedom))\n};\n\n// The algorithm can be found here:\n// http://www.chem.uoa.gr/applets/AppletTtest/Appl_Ttest2.html\n/**\n * Returns the probability associated with a Student's t-test.\n *\n * Category: Statistical\n *\n * @param {*} array1 The first data set.\n * @param {*} array2 The second data set.\n * @returns\n */\nT$1.TEST = (array1, array2) => {\n array1 = parseNumberArray(flatten(array1));\n array2 = parseNumberArray(flatten(array2));\n\n if (anyIsError(array1, array2)) {\n return value\n }\n\n const mean_x = jStat.mean(array1);\n const mean_y = jStat.mean(array2);\n let s_x = 0;\n let s_y = 0;\n let i;\n\n for (i = 0; i < array1.length; i++) {\n s_x += Math.pow(array1[i] - mean_x, 2);\n }\n\n for (i = 0; i < array2.length; i++) {\n s_y += Math.pow(array2[i] - mean_y, 2);\n }\n\n s_x = s_x / (array1.length - 1);\n s_y = s_y / (array2.length - 1);\n\n const t = Math.abs(mean_x - mean_y) / Math.sqrt(s_x / array1.length + s_y / array2.length);\n\n return T$1.DIST['2T'](t, array1.length + array2.length - 2)\n};\n\n/**\n * Returns values along a linear trend.\n *\n * Category: Statistical\n *\n * @param {*} known_ys The set of y-values you already know in the relationship y = mx + b\n * @param {*} known_xs An optional set of x-values that you may already know in the relationship y = mx + b\n * @param {*} new_xs Optional. New x-values for which you want TREND to return corresponding y-values.\n * @returns\n */\nfunction TREND(known_ys, known_xs, new_xs) {\n known_ys = parseNumberArray(flatten(known_ys));\n known_xs = parseNumberArray(flatten(known_xs));\n new_xs = parseNumberArray(flatten(new_xs));\n\n if (anyIsError(known_ys, known_xs, new_xs)) {\n return value\n }\n\n const linest = LINEST(known_ys, known_xs);\n const m = linest[0];\n const b = linest[1];\n const result = [];\n\n new_xs.forEach((x) => {\n result.push(m * x + b);\n });\n\n return result\n}\n\n/**\n * Returns the mean of the interior of a data set.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of values to trim and average.\n * @param {*} percent The fractional number of data points to exclude from the calculation. For example, if percent = 0.2, 4 points are trimmed from a data set of 20 points (20 x 0.2): 2 from the top and 2 from the bottom of the set.\n * @returns\n */\nfunction TRIMMEAN(range, percent) {\n range = parseNumberArray(flatten(range));\n percent = parseNumber(percent);\n\n if (anyIsError(range, percent)) {\n return value\n }\n\n const trim = FLOOR(range.length * percent, 2) / 2;\n\n return jStat.mean(\n initial(\n rest(\n range.sort((a, b) => a - b),\n trim\n ),\n trim\n )\n )\n}\n\nconst VAR = {};\n\n/**\n * Calculates variance based on the entire population.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a population.\n * @returns\n */\nVAR.P = function () {\n const range = numbers(flatten(arguments));\n const n = range.length;\n let sigma = 0;\n const mean = AVERAGE(range);\n let result;\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n\n result = sigma / n;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n};\n\n/**\n * Estimates variance based on a sample.\n *\n * Category: Statistical\n *\n * @param {*} args number1, number2, ... Number arguments 2 to 254 corresponding to a sample of a population.\n * @returns\n */\nVAR.S = function () {\n const range = numbers(flatten(arguments));\n const n = range.length;\n let sigma = 0;\n const mean = AVERAGE(range);\n\n for (let i = 0; i < n; i++) {\n sigma += Math.pow(range[i] - mean, 2);\n }\n\n return sigma / (n - 1)\n};\n\n/**\n * Estimates variance based on a sample, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a sample of a population.\n * @returns\n */\nfunction VARA() {\n const range = flatten(arguments);\n const n = range.length;\n let sigma = 0;\n let count = 0;\n const mean = AVERAGEA(range);\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n return sigma / (count - 1)\n}\n\n/**\n * Calculates variance based on the entire population, including numbers, text, and logical values.\n *\n * Category: Statistical\n *\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 255 value arguments corresponding to a population.\n * @returns\n */\nfunction VARPA() {\n const range = flatten(arguments);\n const n = range.length;\n let sigma = 0;\n let count = 0;\n const mean = AVERAGEA(range);\n let result;\n\n for (let i = 0; i < n; i++) {\n const el = range[i];\n\n if (typeof el === 'number') {\n sigma += Math.pow(el - mean, 2);\n } else if (el === true) {\n sigma += Math.pow(1 - mean, 2);\n } else {\n sigma += Math.pow(0 - mean, 2);\n }\n\n if (el !== null) {\n count++;\n }\n }\n\n result = sigma / count;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\nconst WEIBULL = {};\n\n/**\n * Returns the Weibull distribution.\n *\n * Category: Statistical\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} alpha A parameter to the distribution.\n * @param {*} beta A parameter to the distribution.\n * @param {*} cumulative Determines the form of the function.\n * @returns\n */\nWEIBULL.DIST = (x, alpha, beta, cumulative) => {\n x = parseNumber(x);\n alpha = parseNumber(alpha);\n beta = parseNumber(beta);\n\n if (anyIsError(x, alpha, beta)) {\n return value\n }\n\n return cumulative\n ? 1 - Math.exp(-Math.pow(x / beta, alpha))\n : (Math.pow(x, alpha - 1) * Math.exp(-Math.pow(x / beta, alpha)) * alpha) / Math.pow(beta, alpha)\n};\n\nconst Z = {};\n\n/**\n * Returns the one-tailed probability-value of a z-test.\n *\n * Category: Statistical\n *\n * @param {*} array The array or range of data against which to test x.\n * @param {*} x The value to test.\n * @param {*} sigma Optional. The population (known) standard deviation. If omitted, the sample standard deviation is used.\n * @returns\n */\nZ.TEST = (array, x, sigma) => {\n array = parseNumberArray(flatten(array));\n x = parseNumber(x);\n\n if (anyIsError(array, x)) {\n return value\n }\n\n sigma = sigma || STDEV.S(array);\n const n = array.length;\n\n return 1 - NORM.S.DIST((AVERAGE(array) - x) / (sigma / Math.sqrt(n)), true)\n};\n\n/**\n * Returns the absolute value of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The real number of which you want the absolute value.\n * @returns\n */\nfunction ABS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const result = Math.abs(number);\n\n return result\n}\n\n/**\n * Returns the arccosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The cosine of the angle you want and must be from -1 to 1.\n * @returns\n */\nfunction ACOS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.acos(number);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the inverse hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number equal to or greater than 1.\n * @returns\n */\nfunction ACOSH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.log(number + Math.sqrt(number * number - 1));\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the arccotangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Number is the cotangent of the angle you want. This must be a real number.\n * @returns\n */\nfunction ACOT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const result = Math.atan(1 / number);\n\n return result\n}\n\n/**\n * Returns the hyperbolic arccotangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The absolute value of Number must be greater than 1.\n * @returns\n */\nfunction ACOTH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = 0.5 * Math.log((number + 1) / (number - 1));\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n// TODO: use options\n/**\n * Returns an aggregate in a list or database.\n *\n * Category: Math and trigonometry\n *\n * @param {*} function_num A number 1 to 19 that specifies which function to use.\n * @param {*} options A numerical value that determines which values to ignore in the evaluation range for the function. Note: The function will not ignore hidden rows, nested subtotals or nested aggregates if the array argument includes a calculation, for example: =AGGREGATE(14,3,A1:A100*(A1:A100>0),1)\n * @param {*} ref1 The first numeric argument for functions that take multiple numeric arguments for which you want the aggregate value.\n * @param {*} ref2 Optional. Numeric arguments 2 to 253 for which you want the aggregate value. For functions that take an array, ref1 is an array, an array formula, or a reference to a range of values for which you want the aggregate value. Ref2 is a second argument that is required for certain functions.\n * @returns\n */\nfunction AGGREGATE(function_num, options, ref1, ref2) {\n function_num = parseNumber(function_num);\n options = parseNumber(function_num);\n\n if (anyIsError(function_num, options)) {\n return value\n }\n\n switch (function_num) {\n case 1:\n return AVERAGE(ref1)\n case 2:\n return COUNT(ref1)\n case 3:\n return COUNTA(ref1)\n case 4:\n return MAX(ref1)\n case 5:\n return MIN(ref1)\n case 6:\n return PRODUCT(ref1)\n case 7:\n return STDEV.S(ref1)\n case 8:\n return STDEV.P(ref1)\n case 9:\n return SUM(ref1)\n case 10:\n return VAR.S(ref1)\n case 11:\n return VAR.P(ref1)\n case 12:\n return MEDIAN(ref1)\n case 13:\n return MODE.SNGL(ref1)\n case 14:\n return LARGE(ref1, ref2)\n case 15:\n return SMALL(ref1, ref2)\n case 16:\n return PERCENTILE.INC(ref1, ref2)\n case 17:\n return QUARTILE.INC(ref1, ref2)\n case 18:\n return PERCENTILE.EXC(ref1, ref2)\n case 19:\n return QUARTILE.EXC(ref1, ref2)\n }\n}\n\n/**\n * Converts a Roman number to Arabic, as a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} text A string enclosed in quotation marks, an empty string (\"\"), or a reference to a value containing text.\n * @returns\n */\nfunction ARABIC(text) {\n if (text === undefined || text === null) {\n return 0\n }\n\n if (text instanceof Error) {\n return text\n }\n\n // Credits: Rafa? Kukawski\n if (!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(text)) {\n return value\n }\n\n let r = 0;\n text.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g, (i) => {\n r += {\n M: 1000,\n CM: 900,\n D: 500,\n CD: 400,\n C: 100,\n XC: 90,\n L: 50,\n XL: 40,\n X: 10,\n IX: 9,\n V: 5,\n IV: 4,\n I: 1\n }[i];\n });\n\n return r\n}\n\n/**\n * Returns the arcsine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The sine of the angle you want and must be from -1 to 1.\n * @returns\n */\nfunction ASIN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.asin(number);\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Returns the inverse hyperbolic sine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction ASINH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.log(number + Math.sqrt(number * number + 1))\n}\n\n/**\n * Returns the arctangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The tangent of the angle you want.\n * @returns\n */\nfunction ATAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.atan(number)\n}\n\n/**\n * Returns the arctangent from x- and y-coordinates.\n *\n * Category: Math and trigonometry\n *\n * @param {*} x_num The x-coordinate of the point.\n * @param {*} y_num The y-coordinate of the point.\n * @returns\n */\nfunction ATAN2(x_num, y_num) {\n x_num = parseNumber(x_num);\n y_num = parseNumber(y_num);\n const anyError$1 = anyError(x_num, y_num);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return Math.atan2(x_num, y_num)\n}\n\n/**\n * Returns the inverse hyperbolic tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number between 1 and -1.\n * @returns\n */\nfunction ATANH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let result = Math.log((1 + number) / (1 - number)) / 2;\n\n if (isNaN(result)) {\n result = num;\n }\n\n return result\n}\n\n/**\n * Converts a number into a text representation with the given radix (base).\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number that you want to convert. Must be an integer greater than or equal to 0 and less than 2^53.\n * @param {*} radix The base radix that you want to convert the number into. Must be an integer greater than or equal to 2 and less than or equal to 36.\n * @param {*} min_length Optional. The minimum length of the returned string. Must be an integer greater than or equal to 0.\n * @returns\n */\nfunction BASE(number, radix, min_length) {\n number = parseNumber(number);\n radix = parseNumber(radix);\n min_length = parseNumber(min_length);\n const anyError$1 = anyError(number, radix, min_length);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (radix === 0) {\n return num\n }\n\n const result = number.toString(radix);\n\n return new Array(Math.max(min_length + 1 - result.length, 0)).join('0') + result\n}\n\n/**\n * Rounds a number to the nearest integer or to the nearest multiple of significance.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value you want to round.\n * @param {*} significance The multiple to which you want to round.\n * @param {*} mode Optional. For negative numbers, controls whether Number is rounded toward or away from zero.\n * @returns\n */\nfunction CEILING(number, significance, mode) {\n number = parseNumber(number);\n significance = parseNumber(significance);\n mode = parseNumber(mode);\n const anyError$1 = anyError(number, significance, mode);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n significance = Math.abs(significance);\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n if (number >= 0) {\n return ROUND(Math.ceil(number / significance) * significance, precision)\n } else {\n if (mode === 0) {\n return -ROUND(Math.floor(Math.abs(number) / significance) * significance, precision)\n } else {\n return -ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision)\n }\n }\n}\n\nCEILING.MATH = CEILING;\n\nCEILING.PRECISE = CEILING;\n\n/**\n * Returns the number of combinations for a given number of objects.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number of items.\n * @param {*} number_chosen The number of items in each combination.\n * @returns\n */\nfunction COMBIN(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n const anyError$1 = anyError(number, number_chosen);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number < number_chosen) {\n return num\n }\n\n return FACT(number) / (FACT(number_chosen) * FACT(number - number_chosen))\n}\n\n/**\n * Returns the number of combinations with repetitions for a given number of items.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Must be greater than or equal to 0, and greater than or equal to Number_chosen. Non-integer values are truncated.\n * @param {*} number_chosen Must be greater than or equal to 0. Non-integer values are truncated.\n * @returns\n */\nfunction COMBINA(number, number_chosen) {\n number = parseNumber(number);\n number_chosen = parseNumber(number_chosen);\n const anyError$1 = anyError(number, number_chosen);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number < number_chosen) {\n return num\n }\n\n return number === 0 && number_chosen === 0 ? 1 : COMBIN(number + number_chosen - 1, number - 1)\n}\n\n/**\n * Returns the cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the cosine.\n * @returns\n */\nfunction COS(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.cos(number)\n}\n\n/**\n * Returns the hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number for which you want to find the hyperbolic cosine.\n * @returns\n */\nfunction COSH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return (Math.exp(number) + Math.exp(-number)) / 2\n}\n\n/**\n * Returns the hyperbolic cosine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the cotangent.\n * @returns\n */\nfunction COT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 1 / Math.tan(number)\n}\n\n/**\n * Returns the cotangent of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction COTH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n const e2 = Math.exp(2 * number);\n\n return (e2 + 1) / (e2 - 1)\n}\n\n/**\n * Returns the cosecant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction CSC(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 1 / Math.sin(number)\n}\n\n/**\n * Returns the hyperbolic cosecant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number\n * @returns\n */\nfunction CSCH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return div0\n }\n\n return 2 / (Math.exp(number) - Math.exp(-number))\n}\n\n/**\n * Converts a text representation of a number in a given base into a decimal number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} text\n * @param {*} radix Radix must be an integer.\n * @returns\n */\nfunction DECIMAL(text, radix) {\n if (arguments.length < 2) {\n return na\n }\n\n text = text || '0';\n radix = parseNumber(radix);\n const anyError$1 = anyError(text, radix);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (radix === 0) {\n return num\n }\n\n const result = parseInt(text, radix);\n\n if (isNaN(result)) {\n return num\n }\n\n return result\n}\n\n/**\n * Converts radians to degrees.\n *\n * Category: Math and trigonometry\n *\n * @param {*} angle The angle in radians that you want to convert.\n * @returns\n */\nfunction DEGREES(angle) {\n angle = parseNumber(angle);\n\n if (angle instanceof Error) {\n return angle\n }\n\n return (angle * 180) / Math.PI\n}\n\n/**\n * Rounds a number up to the nearest even integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to round.\n * @returns\n */\nfunction EVEN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return CEILING(number, -2, -1)\n}\n\n/**\n * Returns e raised to the power of a given number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The exponent applied to the base e.\n * @returns\n */\nfunction EXP(number) {\n if (arguments.length < 1) {\n return na\n }\n\n if (arguments.length > 1) {\n return error\n }\n\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n number = Math.exp(number);\n\n return number\n}\n\nconst MEMOIZED_FACT = [];\n/**\n * Returns the factorial of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The nonnegative number for which you want the factorial. If number is not an integer, it is truncated.\n * @returns\n */\nfunction FACT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const n = Math.floor(number);\n\n if (n === 0 || n === 1) {\n return 1\n } else if (MEMOIZED_FACT[n] > 0) {\n return MEMOIZED_FACT[n]\n } else {\n MEMOIZED_FACT[n] = FACT(n - 1) * n;\n\n return MEMOIZED_FACT[n]\n }\n}\n\n/**\n * Returns the double factorial of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value for which to return the double factorial. If number is not an integer, it is truncated.\n * @returns\n */\nfunction FACTDOUBLE(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const n = Math.floor(number);\n\n return n <= 0 ? 1 : n * FACTDOUBLE(n - 2)\n}\n\n/**\n * Rounds a number down, toward zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The numeric value you want to round.\n * @param {*} significance The multiple to which you want to round.\n * @returns\n */\nfunction FLOOR(number, significance) {\n number = parseNumber(number);\n significance = parseNumber(significance);\n const anyError$1 = anyError(number, significance);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n if (!(number >= 0 && significance > 0) && !(number <= 0 && significance < 0)) {\n return num\n }\n\n significance = Math.abs(significance);\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n return number >= 0\n ? ROUND(Math.floor(number / significance) * significance, precision)\n : -ROUND(Math.ceil(Math.abs(number) / significance), precision)\n}\n\n// TODO: Verify\n\n/**\n * Rounds a number down, to the nearest integer or to the nearest multiple of significance.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number to be rounded down.\n * @param {*} significance Optional. The multiple to which you want to round.\n * @param {*} mode Optional. The direction (toward or away from 0) to round negative numbers.\n * @returns\n */\nFLOOR.MATH = (number, significance, mode) => {\n if (significance instanceof Error) {\n return significance\n }\n\n significance = significance === undefined ? 0 : significance;\n\n number = parseNumber(number);\n significance = parseNumber(significance);\n mode = parseNumber(mode);\n const anyError$1 = anyError(number, significance, mode);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (significance === 0) {\n return 0\n }\n\n significance = significance ? Math.abs(significance) : 1;\n const precision = -Math.floor(Math.log(significance) / Math.log(10));\n\n if (number >= 0) {\n return ROUND(Math.floor(number / significance) * significance, precision)\n } else if (mode === 0 || mode === undefined) {\n return -ROUND(Math.ceil(Math.abs(number) / significance) * significance, precision)\n }\n\n return -ROUND(Math.floor(Math.abs(number) / significance) * significance, precision)\n};\n\n// Deprecated\n\n/**\n * Rounds a number the nearest integer or to the nearest multiple of significance. Regardless of the sign of the number, the number is rounded up.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to be rounded.\n * @param {*} significance Optional. The multiple to which number is to be rounded. If significance is omitted, its default value is 1.\n * @returns\n */\nFLOOR.PRECISE = FLOOR['MATH'];\n\n// adapted http://rosettacode.org/wiki/Greatest_common_divisor#JavaScript\n/**\n * Returns the greatest common divisor.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 values. If any value is not an integer, it is truncated.\n * @returns\n */\nfunction GCD() {\n const range = parseNumberArray(flatten(arguments));\n\n if (range instanceof Error) {\n return range\n }\n\n const n = range.length;\n const r0 = range[0];\n let x = r0 < 0 ? -r0 : r0;\n\n for (let i = 1; i < n; i++) {\n const ri = range[i];\n let y = ri < 0 ? -ri : ri;\n\n while (x && y) {\n if (x > y) {\n x %= y;\n } else {\n y %= x;\n }\n }\n\n x += y;\n }\n\n return x\n}\n\n/**\n * Rounds a number down to the nearest integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The real number you want to round down to an integer.\n * @returns\n */\nfunction INT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.floor(number)\n}\n\n// TODO: verify\nconst ISO = {\n CEILING: CEILING\n};\n\n/**\n * Returns the least common multiple.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2,... Number1 is required, subsequent numbers are optional. 1 to 255 values for which you want the least common multiple. If value is not an integer, it is truncated.\n * @returns\n */\nfunction LCM() {\n // Credits: Jonas Raoni Soares Silva\n const o = parseNumberArray(flatten(arguments));\n\n if (o instanceof Error) {\n return o\n }\n\n for (var i, j, n, d, r = 1; (n = o.pop()) !== undefined; ) {\n if (n === 0) {\n return 0\n }\n\n while (n > 1) {\n if (n % 2) {\n for (i = 3, j = Math.floor(Math.sqrt(n)); i <= j && n % i; i += 2) {\n // empty\n }\n\n d = i <= j ? i : n;\n } else {\n d = 2;\n }\n\n for (n /= d, r *= d, i = o.length; i; o[--i] % d === 0 && (o[i] /= d) === 1 && o.splice(i, 1)) {\n // empty\n }\n }\n }\n\n return r\n}\n\n/**\n * Returns the natural logarithm of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the natural logarithm.\n * @returns\n */\nfunction LN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n return Math.log(number)\n}\n\n/**\n * Returns the logarithm of a number to a specified base.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the logarithm.\n * @param {*} base Optional. The base of the logarithm. If base is omitted, it is assumed to be 10.\n * @returns\n */\nfunction LOG(number, base) {\n number = parseNumber(number);\n base = parseNumber(base);\n const anyError$1 = anyError(number, base);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number === 0 || base === 0) {\n return num\n }\n\n return Math.log(number) / Math.log(base)\n}\n\n/**\n * Returns the base-10 logarithm of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The positive real number for which you want the base-10 logarithm.\n * @returns\n */\nfunction LOG10(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number === 0) {\n return num\n }\n\n return Math.log(number) / Math.log(10)\n}\n\n/**\n * Returns the matrix product of two arrays. The result is an array with the same number of rows as array1 and the same number of columns as array2.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array1 Required. 1st array you want to multiply.\n * @param {*} array2 Required. 2nd array you want to multiply.\n * @returns\n */\nfunction MMULT(array1, array2) {\n if (\n //Arguments are not arrays\n !Array.isArray(array1) ||\n !Array.isArray(array2) ||\n // There are empty arrays\n array1.some((el) => !el.length) ||\n array2.some((el) => !el.length) ||\n // Not all array elements are numbers\n flattenShallow(array1).some((el) => typeof el !== 'number') ||\n flattenShallow(array2).some((el) => typeof el !== 'number') ||\n // Number of columns in array1 is different from the number of rows in array2\n array1[0].length !== array2.length\n ) {\n return value\n }\n\n const matrix = Array(array1.length)\n .fill(0)\n .map(() => Array(array2[0].length).fill(0));\n\n return matrix.map((row, i) => row.map((_, j) => array1[i].reduce((sum, el, k) => sum + el * array2[k][j], 0)))\n}\n\n/**\n * Returns the remainder from division.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number for which you want to find the remainder.\n * @param {*} divisor The number by which you want to divide number.\n * @returns\n */\nfunction MOD(number, divisor) {\n number = parseNumber(number);\n divisor = parseNumber(divisor);\n const anyError$1 = anyError(number, divisor);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (divisor === 0) {\n return div0\n }\n\n let modulus = Math.abs(number % divisor);\n modulus = number < 0 ? divisor - modulus : modulus;\n\n return divisor > 0 ? modulus : -modulus\n}\n\n/**\n * Returns a number rounded to the desired multiple.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The value to round.\n * @param {*} multiple The multiple to which you want to round number.\n * @returns\n */\nfunction MROUND(number, multiple) {\n number = parseNumber(number);\n multiple = parseNumber(multiple);\n const anyError$1 = anyError(number, multiple);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number * multiple === 0) {\n return 0\n }\n\n if (number * multiple < 0) {\n return num\n }\n\n return Math.round(number / multiple) * multiple\n}\n\n/**\n * Returns the multinomial of a set of numbers.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 values for which you want the multinomial.\n * @returns\n */\nfunction MULTINOMIAL() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n let sum = 0;\n let divisor = 1;\n\n for (let i = 0; i < args.length; i++) {\n sum += args[i];\n divisor *= FACT(args[i]);\n }\n\n return FACT(sum) / divisor\n}\n\n/**\n * Returns the unit matrix for the specified dimension.\n *\n * Category: Math and trigonometry\n *\n * @param {*} dimension Required. Dimension is an integer specifying the dimension of the unit matrix that you want to return. It returns an array. The dimension has to be greater than zero.\n * @returns\n */\nfunction MUNIT(dimension) {\n if (arguments.length > 1) {\n return na\n }\n\n dimension = parseInt(dimension);\n\n if (!dimension || dimension <= 0) {\n return value\n }\n\n return Array(dimension)\n .fill(0)\n .map(() => Array(dimension).fill(0))\n .map((el, i) => {\n el[i] = 1;\n return el\n })\n}\n\n/**\n * Rounds a number up to the nearest odd integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number: The value to round.\n * @returns\n */\nfunction ODD(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n let temp = Math.ceil(Math.abs(number));\n temp = temp & 1 ? temp : temp + 1;\n\n return number >= 0 ? temp : -temp\n}\n\n/**\n * Returns the value of pi.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction PI() {\n return Math.PI\n}\n\n/**\n * Returns the result of a number raised to a power.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The base number. It can be any real number.\n * @param {*} power The exponent to which the base number is raised.\n * @returns\n */\nfunction POWER(number, power) {\n number = parseNumber(number);\n power = parseNumber(power);\n const anyError$1 = anyError(number, power);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (number === 0 && power === 0) {\n return num\n }\n\n const result = Math.pow(number, power);\n\n if (isNaN(result)) {\n return num\n }\n\n return result\n}\n\n/**\n * Multiplies its arguments.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number1 The first number or range that you want to multiply.\n * @param {*} args number2, ... Optional. Additional numbers or ranges that you want to multiply, up to a maximum of 255 arguments.\n * @returns\n */\nfunction PRODUCT() {\n const flatArguments = flatten(arguments);\n const flatArgumentsDefined = flatArguments.filter((arg) => arg !== undefined && arg !== null);\n\n if (flatArgumentsDefined.length === 0) {\n return 0\n }\n\n const args = parseNumberArray(flatArgumentsDefined);\n\n if (args instanceof Error) {\n return args\n }\n\n let result = 1;\n\n for (let i = 0; i < args.length; i++) {\n result *= args[i];\n }\n\n return result\n}\n\n/**\n * Returns the integer portion of a division.\n *\n * Category: Math and trigonometry\n *\n * @param {*} numerator The dividend.\n * @param {*} denominator The divisor.\n * @returns\n */\nfunction QUOTIENT(numerator, denominator) {\n numerator = parseNumber(numerator);\n denominator = parseNumber(denominator);\n const anyError$1 = anyError(numerator, denominator);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return parseInt(numerator / denominator, 10)\n}\n\n/**\n * Converts degrees to radians.\n *\n * Category: Math and trigonometry\n *\n * @param {*} angle An angle in degrees that you want to convert.\n * @returns\n */\nfunction RADIANS(angle) {\n angle = parseNumber(angle);\n\n if (angle instanceof Error) {\n return angle\n }\n\n return (angle * Math.PI) / 180\n}\n\n/**\n * Returns a random number between 0 and 1.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction RAND() {\n return Math.random()\n}\n\n/**\n * Returns a random number between the numbers you specify.\n *\n * Category: Math and trigonometry\n *\n * @param {*} bottom The smallest integer RANDBETWEEN will return.\n * @param {*} top The largest integer RANDBETWEEN will return.\n * @returns\n */\nfunction RANDBETWEEN(bottom, top) {\n bottom = parseNumber(bottom);\n top = parseNumber(top);\n const anyError$1 = anyError(bottom, top);\n\n if (anyError$1) {\n return anyError$1\n }\n // Creative Commons Attribution 3.0 License\n // Copyright (c) 2012 eqcode\n\n return bottom + Math.ceil((top - bottom + 1) * Math.random()) - 1\n}\n\n// TODO\n/**\n * Converts an arabic numeral to roman, as text.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The Arabic numeral you want converted.\n * @returns\n */\nfunction ROMAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // The MIT License\n // Copyright (c) 2008 Steven Levithan\n const digits = String(number).split('');\n const key = [\n '',\n 'C',\n 'CC',\n 'CCC',\n 'CD',\n 'D',\n 'DC',\n 'DCC',\n 'DCCC',\n 'CM',\n '',\n 'X',\n 'XX',\n 'XXX',\n 'XL',\n 'L',\n 'LX',\n 'LXX',\n 'LXXX',\n 'XC',\n '',\n 'I',\n 'II',\n 'III',\n 'IV',\n 'V',\n 'VI',\n 'VII',\n 'VIII',\n 'IX'\n ];\n let roman = '';\n let i = 3;\n\n while (i--) {\n roman = (key[+digits.pop() + i * 10] || '') + roman;\n }\n\n return new Array(+digits.join('') + 1).join('M') + roman\n}\n\n/**\n * Rounds a number to a specified number of digits.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number that you want to round.\n * @param {*} num_digits The number of digits to which you want to round the number argument.\n * @returns\n */\nfunction ROUND(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return Number(Math.round(Number(number + 'e' + num_digits)) + 'e' + num_digits * -1)\n}\n\n/**\n * Rounds a number down, toward zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number that you want rounded down.\n * @param {*} num_digits The number of digits to which you want to round number.\n * @returns\n */\nfunction ROUNDDOWN(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.floor(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Rounds a number up, away from zero.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number that you want rounded up.\n * @param {*} num_digits The number of digits to which you want to round number.\n * @returns\n */\nfunction ROUNDUP(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.ceil(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Returns the secant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the secant.\n * @returns\n */\nfunction SEC(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return 1 / Math.cos(number)\n}\n\n/**\n * Returns the hyperbolic secant of an angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the hyperbolic secant.\n * @returns\n */\nfunction SECH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return 2 / (Math.exp(number) + Math.exp(-number))\n}\n\n/**\n * Returns the sum of a power series based on the formula.\n *\n * Category: Math and trigonometry\n *\n * @param {*} x The input value to the power series.\n * @param {*} n The initial power to which you want to raise x.\n * @param {*} m The step by which to increase n for each term in the series.\n * @param {*} coefficients A set of coefficients by which each successive power of x is multiplied. The number of values in coefficients determines the number of terms in the power series. For example, if there are three values in coefficients, then there will be three terms in the power series.\n * @returns\n */\nfunction SERIESSUM(x, n, m, coefficients) {\n x = parseNumber(x);\n n = parseNumber(n);\n m = parseNumber(m);\n coefficients = parseNumberArray(coefficients);\n\n if (anyIsError(x, n, m, coefficients)) {\n return value\n }\n\n let result = coefficients[0] * Math.pow(x, n);\n\n for (let i = 1; i < coefficients.length; i++) {\n result += coefficients[i] * Math.pow(x, n + i * m);\n }\n\n return result\n}\n\n/**\n * Returns the sign of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction SIGN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number < 0) {\n return -1\n } else if (number === 0) {\n return 0\n } else {\n return 1\n }\n}\n\n/**\n * Returns the sine of the given angle.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the sine.\n * @returns\n */\nfunction SIN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.sin(number)\n}\n\n/**\n * Returns the hyperbolic sine of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction SINH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return (Math.exp(number) - Math.exp(-number)) / 2\n}\n\n/**\n * Returns a positive square root.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number for which you want the square root.\n * @returns\n */\nfunction SQRT(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n if (number < 0) {\n return num\n }\n\n return Math.sqrt(number)\n}\n\n/**\n * Returns the square root of (number * pi).\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number by which pi is multiplied.\n * @returns\n */\nfunction SQRTPI(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.sqrt(number * Math.PI)\n}\n\n/**\n * Returns a subtotal in a list or database.\n *\n * Category: Math and trigonometry\n *\n * @param {*} function_num The number 1-11 or 101-111 that specifies the function to use for the subtotal. 1-11 includes manually-hidden rows, while 101-111 excludes them; filtered-out values are always excluded.\n * @param {*} ref1 The first named range or reference for which you want the subtotal.\n * @returns\n */\nfunction SUBTOTAL(function_num, ref1) {\n function_num = parseNumber(function_num);\n\n if (function_num instanceof Error) {\n return function_num\n }\n\n switch (function_num) {\n case 1:\n return AVERAGE(ref1)\n case 2:\n return COUNT(ref1)\n case 3:\n return COUNTA(ref1)\n case 4:\n return MAX(ref1)\n case 5:\n return MIN(ref1)\n case 6:\n return PRODUCT(ref1)\n case 7:\n return STDEV.S(ref1)\n case 8:\n return STDEV.P(ref1)\n case 9:\n return SUM(ref1)\n case 10:\n return VAR.S(ref1)\n case 11:\n return VAR.P(ref1)\n // no hidden values for us\n case 101:\n return AVERAGE(ref1)\n case 102:\n return COUNT(ref1)\n case 103:\n return COUNTA(ref1)\n case 104:\n return MAX(ref1)\n case 105:\n return MIN(ref1)\n case 106:\n return PRODUCT(ref1)\n case 107:\n return STDEV.S(ref1)\n case 108:\n return STDEV.P(ref1)\n case 109:\n return SUM(ref1)\n case 110:\n return VAR.S(ref1)\n case 111:\n return VAR.P(ref1)\n }\n}\n\n/**\n * Adds its arguments.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUM() {\n let result = 0;\n\n arrayEach(argsToArray(arguments), (value) => {\n if (result instanceof Error) {\n return false\n } else if (value instanceof Error) {\n result = value;\n } else if (typeof value === 'number') {\n result += value;\n } else if (typeof value === 'string') {\n const parsed = parseFloat(value);\n\n !isNaN(parsed) && (result += parsed);\n } else if (Array.isArray(value)) {\n const inner_result = SUM.apply(null, value);\n\n if (inner_result instanceof Error) {\n result = inner_result;\n } else {\n result += inner_result;\n }\n }\n });\n\n return result\n}\n\n/**\n * Adds the values specified by a given criteria.\n *\n * Category: Math and trigonometry\n *\n * @param {*} range The range of values that you want evaluated by criteria. Cells in each range must be numbers or names, arrays, or references that contain numbers. Blank and text values are ignored.\n * @param {*} criteria The criteria in the form of a number, expression, a value reference, text, or a function that defines which values will be added.\n * @param {*} sum_range Optional. The actual values to add, if you want to add values other than those specified in the range argument. If the sum_range argument is omitted, Excel adds the values that are specified in the range argument (the same values to which the criteria is applied). Sum_range should be the same size and shape as range. If it isn't, performance may suffer, and the formula will sum a range of values that starts with the first value in sum_range but has the same dimensions as range.\n * @returns\n */\nfunction SUMIF(range, criteria, sum_range) {\n range = flatten(range);\n\n sum_range = sum_range ? flatten(sum_range) : range;\n\n if (range instanceof Error) {\n return range\n }\n\n if (criteria === undefined || criteria === null || criteria instanceof Error) {\n return 0\n }\n\n let result = 0;\n const isWildcard = criteria === '*';\n const tokenizedCriteria = isWildcard ? null : parse(criteria + '');\n\n for (let i = 0; i < range.length; i++) {\n const value = range[i];\n const sumValue = sum_range[i];\n\n if (isWildcard) {\n result += value;\n } else {\n const tokens = [createToken(value, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);\n\n result += compute(tokens) ? sumValue : 0;\n }\n }\n\n return result\n}\n\n/**\n * Adds the values in a range that meet multiple criteria.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUMIFS() {\n const values = applyCriteria(...arguments);\n return SUM(values)\n}\n\n/**\n * Returns the sum of the products of corresponding array components.\n *\n * Category: Math and trigonometry\n *\n * @returns\n */\nfunction SUMPRODUCT() {\n if (!arguments || arguments.length === 0) {\n return value\n }\n\n const arrays = arguments.length + 1;\n let result = 0;\n let product;\n let k;\n let _i;\n let _ij;\n\n for (let i = 0; i < arguments[0].length; i++) {\n if (!(arguments[0][i] instanceof Array)) {\n product = 1;\n\n for (k = 1; k < arrays; k++) {\n const _i_arg = arguments[k - 1][i];\n\n if (_i_arg instanceof Error) {\n return _i_arg\n }\n\n _i = parseNumber(_i_arg);\n\n if (_i instanceof Error) {\n return _i\n }\n\n product *= _i;\n }\n\n result += product;\n } else {\n for (let j = 0; j < arguments[0][i].length; j++) {\n product = 1;\n\n for (k = 1; k < arrays; k++) {\n const _ij_arg = arguments[k - 1][i][j];\n\n if (_ij_arg instanceof Error) {\n return _ij_arg\n }\n\n _ij = parseNumber(_ij_arg);\n\n if (_ij instanceof Error) {\n return _ij\n }\n\n product *= _ij;\n }\n\n result += product;\n }\n }\n }\n\n return result\n}\n\n/**\n * Returns the sum of the squares of the arguments.\n *\n * Category: Math and trigonometry\n *\n * @param {*} args number1, number2, ... Number1 is required, subsequent numbers are optional. 1 to 255 arguments for which you want the sum of the squares. You can also use a single array or a reference to an array instead of arguments separated by commas.\n * @returns\n */\nfunction SUMSQ() {\n const numbers = parseNumberArray(flatten(arguments));\n\n if (numbers instanceof Error) {\n return numbers\n }\n\n let result = 0;\n const length = numbers.length;\n\n for (let i = 0; i < length; i++) {\n result += ISNUMBER(numbers[i]) ? numbers[i] * numbers[i] : 0;\n }\n\n return result\n}\n\n/**\n * Returns the sum of the difference of squares of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMX2MY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n\n for (let i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] - array_y[i] * array_y[i];\n }\n\n return result\n}\n\n/**\n * Returns the sum of the sum of squares of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMX2PY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n for (let i = 0; i < array_x.length; i++) {\n result += array_x[i] * array_x[i] + array_y[i] * array_y[i];\n }\n\n return result\n}\n\n/**\n * Returns the sum of squares of differences of corresponding values in two arrays.\n *\n * Category: Math and trigonometry\n *\n * @param {*} array_x The first array or range of values.\n * @param {*} array_y The second array or range of values.\n * @returns\n */\nfunction SUMXMY2(array_x, array_y) {\n array_x = parseNumberArray(flatten(array_x));\n array_y = parseNumberArray(flatten(array_y));\n\n if (anyIsError(array_x, array_y)) {\n return value\n }\n\n let result = 0;\n array_x = flatten(array_x);\n array_y = flatten(array_y);\n\n for (let i = 0; i < array_x.length; i++) {\n result += Math.pow(array_x[i] - array_y[i], 2);\n }\n\n return result\n}\n\n/**\n * Returns the tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The angle in radians for which you want the tangent.\n * @returns\n */\nfunction TAN(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n return Math.tan(number)\n}\n\n/**\n * Returns the hyperbolic tangent of a number.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number Any real number.\n * @returns\n */\nfunction TANH(number) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n const e2 = Math.exp(2 * number);\n\n return (e2 - 1) / (e2 + 1)\n}\n\n/**\n * Truncates a number to an integer.\n *\n * Category: Math and trigonometry\n *\n * @param {*} number The number you want to truncate.\n * @param {*} num_digits Optional. A number specifying the precision of the truncation. The default value for num_digits is 0 (zero).\n * @returns\n */\nfunction TRUNC(number, num_digits) {\n number = parseNumber(number);\n num_digits = parseNumber(num_digits);\n const anyError$1 = anyError(number, num_digits);\n\n if (anyError$1) {\n return anyError$1\n }\n\n const sign = number > 0 ? 1 : -1;\n\n return (sign * Math.floor(Math.abs(number) * Math.pow(10, num_digits))) / Math.pow(10, num_digits)\n}\n\n/**\n * Following functions are part of Formula.js only and not found in Excel.\n * Purpose of these functions is to implement an Excel like behaviour for fundamental math symbols such as +, -, /, *, etc.\n */\n\n/**\n * Formula.js only.\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction ADD(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 + num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} dividend\n * @param {*} divisor\n * @returns\n */\nfunction DIVIDE(dividend, divisor) {\n if (arguments.length !== 2) {\n return na\n }\n\n dividend = parseNumber(dividend);\n divisor = parseNumber(divisor);\n const anyError$1 = anyError(dividend, divisor);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (divisor === 0) {\n return div0\n }\n\n return dividend / divisor\n}\n\n/**\n * Formula.js only\n *\n * @param {*} value1\n * @param {*} value2\n * @returns\n */\nfunction EQ(value1, value2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (value1 instanceof Error) {\n return value1\n }\n\n if (value2 instanceof Error) {\n return value2\n }\n\n if (value1 === null) {\n value1 = undefined;\n }\n\n if (value2 === null) {\n value2 = undefined;\n }\n\n return value1 === value2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction GT(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (num1 instanceof Error) {\n return num1\n }\n\n if (num2 instanceof Error) {\n return num2\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 > num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction GTE(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 >= num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction LT(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 < num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction LTE(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (anyIsString(num1, num2)) {\n num1 = parseString(num1);\n num2 = parseString(num2);\n } else {\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n }\n\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 <= num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} num1\n * @param {*} num2\n * @returns\n */\nfunction MINUS(num1, num2) {\n if (arguments.length !== 2) {\n return na\n }\n\n num1 = parseNumber(num1);\n num2 = parseNumber(num2);\n const anyError$1 = anyError(num1, num2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return num1 - num2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} factor1\n * @param {*} factor2\n * @returns\n */\nfunction MULTIPLY(factor1, factor2) {\n if (arguments.length !== 2) {\n return na\n }\n\n factor1 = parseNumber(factor1);\n factor2 = parseNumber(factor2);\n const anyError$1 = anyError(factor1, factor2);\n\n if (anyError$1) {\n return anyError$1\n }\n\n return factor1 * factor2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} value1\n * @param {*} value2\n * @returns\n */\nfunction NE(value1, value2) {\n if (arguments.length !== 2) {\n return na\n }\n\n if (value1 instanceof Error) {\n return value1\n }\n\n if (value2 instanceof Error) {\n return value2\n }\n\n if (value1 === null) {\n value1 = undefined;\n }\n\n if (value2 === null) {\n value2 = undefined;\n }\n\n return value1 !== value2\n}\n\n/**\n * Formula.js only\n *\n * @param {*} base\n * @param {*} exponent\n * @returns\n */\nfunction POW(base, exponent) {\n if (arguments.length !== 2) {\n return na\n }\n\n return POWER(base, exponent)\n}\n\nvar symbols = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ADD: ADD,\n DIVIDE: DIVIDE,\n EQ: EQ,\n GT: GT,\n GTE: GTE,\n LT: LT,\n LTE: LTE,\n MINUS: MINUS,\n MULTIPLY: MULTIPLY,\n NE: NE,\n POW: POW\n});\n\nconst d1900 = new Date(Date.UTC(1900, 0, 1));\nconst WEEK_STARTS = [\n undefined,\n 0,\n 1,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n undefined,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 0\n];\nconst WEEK_TYPES = [\n [],\n [1, 2, 3, 4, 5, 6, 7],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 0, 1, 2, 3, 4, 5],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [7, 1, 2, 3, 4, 5, 6],\n [6, 7, 1, 2, 3, 4, 5],\n [5, 6, 7, 1, 2, 3, 4],\n [4, 5, 6, 7, 1, 2, 3],\n [3, 4, 5, 6, 7, 1, 2],\n [2, 3, 4, 5, 6, 7, 1],\n [1, 2, 3, 4, 5, 6, 7]\n];\nconst WEEKEND_TYPES = [\n [],\n [6, 0],\n [0, 1],\n [1, 2],\n [2, 3],\n [3, 4],\n [4, 5],\n [5, 6],\n undefined,\n undefined,\n undefined,\n [0, 0],\n [1, 1],\n [2, 2],\n [3, 3],\n [4, 4],\n [5, 5],\n [6, 6]\n];\n\n/**\n * Returns the serial number of a particular date.\n *\n * Category: Date and time\n *\n * @param {*} year Year\n * @param {*} month Month\n * @param {*} day Day\n * @returns\n */\nfunction DATE(year, month, day) {\n let result;\n\n year = parseNumber(year);\n month = parseNumber(month);\n day = parseNumber(day);\n\n if (anyIsError(year, month, day)) {\n result = value;\n } else {\n result = new Date(year, month - 1, day);\n\n if (result.getFullYear() < 0) {\n result = num;\n }\n }\n\n return result\n}\n\n/**\n * Calculates the number of days, months, or years between two dates. This function is useful in formulas where you need to calculate an age.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the first, or starting date of a given period.\n * @param {*} end_date A date that represents the last, or ending, date of the period.\n * @param {*} unit The type of information that you want returned, where:\n - \"Y\": The number of complete years in the period.\n - \"M\": The number of complete months in the period.\n - \"D\": The number of days in the period.\n - \"MD\": The difference between the days in start_date and end_date. The months and years of the dates are ignored.\n - \"YM\": The difference between the months in start_date and end_date. The days and years of the dates are ignored\n - \"YD\": The difference between the days of start_date and end_date. The years of the dates are ignored.\n * @returns\n */\nfunction DATEDIF(start_date, end_date, unit) {\n unit = unit.toUpperCase();\n start_date = parseDate(start_date);\n end_date = parseDate(end_date);\n\n const start_date_year = start_date.getFullYear();\n const start_date_month = start_date.getMonth();\n const start_date_day = start_date.getDate();\n const end_date_year = end_date.getFullYear();\n const end_date_month = end_date.getMonth();\n const end_date_day = end_date.getDate();\n\n let result;\n\n switch (unit) {\n case 'Y':\n result = Math.floor(YEARFRAC(start_date, end_date));\n break\n case 'D':\n result = DAYS(end_date, start_date);\n break\n case 'M':\n result = end_date_month - start_date_month + 12 * (end_date_year - start_date_year);\n\n if (end_date_day < start_date_day) {\n result--;\n }\n\n break\n case 'MD':\n if (start_date_day <= end_date_day) {\n result = end_date_day - start_date_day;\n } else {\n if (end_date_month === 0) {\n start_date.setFullYear(end_date_year - 1);\n start_date.setMonth(12);\n } else {\n start_date.setFullYear(end_date_year);\n start_date.setMonth(end_date_month - 1);\n }\n\n result = DAYS(end_date, start_date);\n }\n\n break\n case 'YM':\n result = end_date_month - start_date_month + 12 * (end_date_year - start_date_year);\n\n if (end_date_day < start_date_day) {\n result--;\n }\n\n result = result % 12;\n break\n case 'YD':\n if (end_date_month > start_date_month || (end_date_month === start_date_month && end_date_day < start_date_day)) {\n start_date.setFullYear(end_date_year);\n } else {\n start_date.setFullYear(end_date_year - 1);\n }\n\n result = DAYS(end_date, start_date);\n break\n }\n\n return result\n}\n\n/**\n * Converts a date in the form of text to a serial number.\n *\n * Category: Date and time\n *\n * @param {*} date_text Text that represents a date in an Excel date format, or a reference to a value that contains text that represents a date in an Excel date format.\n * @returns\n */\nfunction DATEVALUE(date_text) {\n if (typeof date_text !== 'string') {\n return value\n }\n\n const date = Date.parse(date_text);\n\n if (isNaN(date)) {\n return value\n }\n\n return new Date(date_text)\n}\n\n/**\n * Converts a serial number to a day of the month.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the day you are trying to find.\n * @returns\n */\nfunction DAY(serial_number) {\n const date = parseDate(serial_number);\n\n if (date instanceof Error) {\n return date\n }\n\n return date.getDate()\n}\n\nfunction startOfDay(date) {\n const newDate = new Date(date);\n newDate.setHours(0, 0, 0, 0);\n\n return newDate\n}\n\n/**\n * Returns the number of days between two dates.\n *\n * Category: Date and time\n *\n * @param {*} end_date Start_date and End_date are the two dates between which you want to know the number of days.\n * @param {*} start_date Start_date and End_date are the two dates between which you want to know the number of days.\n * @returns\n */\nfunction DAYS(end_date, start_date) {\n end_date = parseDate(end_date);\n start_date = parseDate(start_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n return serial(startOfDay(end_date)) - serial(startOfDay(start_date))\n}\n\n/**\n * Calculates the number of days between two dates based on a 360-day year.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date. If start_date occurs after end_date, the DAYS360 function returns a negative number.\n * @param {*} end_date A date that represents the end date.\n * @param {*} method Optional. A logical value that specifies whether to use the U.S. or European method in the calculation.\n * @returns\n */\nfunction DAYS360(start_date, end_date, method) {\n method = parseBool(method || 'false');\n start_date = parseDate(start_date);\n end_date = parseDate(end_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n if (method instanceof Error) {\n return method\n }\n\n const sm = start_date.getMonth();\n let em = end_date.getMonth();\n let sd, ed;\n\n if (method) {\n sd = start_date.getDate() === 31 ? 30 : start_date.getDate();\n ed = end_date.getDate() === 31 ? 30 : end_date.getDate();\n } else {\n const smd = new Date(start_date.getFullYear(), sm + 1, 0).getDate();\n const emd = new Date(end_date.getFullYear(), em + 1, 0).getDate();\n sd = start_date.getDate() === smd ? 30 : start_date.getDate();\n\n if (end_date.getDate() === emd) {\n if (sd < 30) {\n em++;\n ed = 1;\n } else {\n ed = 30;\n }\n } else {\n ed = end_date.getDate();\n }\n }\n\n return 360 * (end_date.getFullYear() - start_date.getFullYear()) + 30 * (em - sm) + (ed - sd)\n}\n\n/**\n * Returns the serial number of the date that is the indicated number of months before or after the start date.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} months The number of months before or after start_date. A positive value for months yields a future date; a negative value yields a past date.\n * @returns\n */\nfunction EDATE(start_date, months) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (isNaN(months)) {\n return value\n }\n\n // store the day and temporarily set to 1, which is safe\n let storedDay = start_date.getDate();\n start_date.setDate(1);\n\n months = parseInt(months, 10);\n start_date.setMonth(start_date.getMonth() + months);\n\n let targetMonth = start_date.getMonth();\n\n // if storedDay > 28 then we need to check end-of-month scenarios\n if (storedDay > 28) {\n let daysInTargetMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][targetMonth];\n\n // if target month is February, check for a leap year\n let targetYear = start_date.getFullYear();\n if (targetMonth === 1 && ((targetYear % 4 === 0 && targetYear % 100 !== 0) || targetYear % 400 === 0)) {\n daysInTargetMonth = 29;\n }\n storedDay = Math.min(storedDay, daysInTargetMonth);\n }\n\n start_date.setDate(storedDay);\n\n return start_date\n}\n\n/**\n * Returns the serial number of the last day of the month before or after a specified number of months.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the starting date.\n * @param {*} months The number of months before or after start_date. A positive value for months yields a future date; a negative value yields a past date.\n * @returns\n */\nfunction EOMONTH(start_date, months) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n if (isNaN(months)) {\n return value\n }\n\n months = parseInt(months, 10);\n\n return new Date(start_date.getFullYear(), start_date.getMonth() + months + 1, 0)\n}\n\n/**\n * Converts a serial number to an hour.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the hour you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction HOUR(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getHours()\n}\n\n/**\n * Returns the number of the ISO week number of the year for a given date.\n *\n * Category: Date and time\n *\n * @param {*} date Date is the date-time code used by Excel for date and time calculation.\n * @returns\n */\nfunction ISOWEEKNUM(date) {\n date = parseDate(date);\n\n if (date instanceof Error) {\n return date\n }\n\n date = startOfDay(date);\n date.setDate(date.getDate() + 4 - (date.getDay() || 7));\n const yearStart = new Date(date.getFullYear(), 0, 1);\n\n return Math.ceil(((date - yearStart) / 86400000 + 1) / 7)\n}\n\n/**\n * Converts a serial number to a minute.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the minute you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction MINUTE(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getMinutes()\n}\n\n/**\n * Converts a serial number to a month.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the month you are trying to find.\n * @returns\n */\nfunction MONTH(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getMonth() + 1\n}\n\n/**\n * Returns the number of whole workdays between two dates.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} end_date A date that represents the end date.\n * @param {*} holidays Optional. An optional range of one or more dates to exclude from the working calendar, such as state and federal holidays and floating holidays. The list can be either a range of values that contains the dates or an array constant of the serial numbers that represent the dates.\n * @returns\n */\nfunction NETWORKDAYS(start_date, end_date, holidays) {\n return NETWORKDAYS.INTL(start_date, end_date, 1, holidays)\n}\n\n/**\n * Returns the number of whole workdays between two dates using parameters to indicate which and how many days are weekend days.\n *\n * Category: Date and time\n *\n * @param {*} start_date The date for from which the difference is to be computed. The start_date can be earlier than, the same as, or later than the end_date.\n * @param {*} end_date The date for to which the difference is to be computed.\n * @param {*} weekend Optional. Indicates the days of the week that are weekend days and are not included in the number of whole working days between start_date and end_date. Weekend is a weekend number or string that specifies when weekends occur. Weekend number values indicate the following weekend days:\n * @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.\n * @returns\n */\nNETWORKDAYS.INTL = (start_date, end_date, weekend, holidays) => {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n end_date = parseDate(end_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n let isMask = false;\n const maskDays = [];\n const maskIndex = [1, 2, 3, 4, 5, 6, 0];\n const maskRegex = new RegExp('^[0|1]{7}$');\n\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else if (typeof weekend === 'string' && maskRegex.test(weekend)) {\n isMask = true;\n weekend = weekend.split('');\n\n for (let i = 0; i < weekend.length; i++) {\n if (weekend[i] === '1') {\n maskDays.push(maskIndex[i]);\n }\n }\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n\n if (!(weekend instanceof Array)) {\n return value\n }\n\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n\n for (let i = 0; i < holidays.length; i++) {\n const h = parseDate(holidays[i]);\n\n if (h instanceof Error) {\n return h\n }\n\n holidays[i] = h;\n }\n\n const days = Math.round((end_date - start_date) / (1000 * 60 * 60 * 24)) + 1;\n let total = days;\n const day = start_date;\n\n for (let i = 0; i < days; i++) {\n const d = new Date().getTimezoneOffset() > 0 ? day.getUTCDay() : day.getDay();\n let dec = isMask ? maskDays.includes(d) : d === weekend[0] || d === weekend[1];\n\n for (let j = 0; j < holidays.length; j++) {\n const holiday = holidays[j];\n\n if (\n holiday.getDate() === day.getDate() &&\n holiday.getMonth() === day.getMonth() &&\n holiday.getFullYear() === day.getFullYear()\n ) {\n dec = true;\n break\n }\n }\n\n if (dec) {\n total--;\n }\n\n day.setDate(day.getDate() + 1);\n }\n\n return total\n};\n\n/**\n * Returns the serial number of the current date and time.\n *\n * Category: Date and time\n *\n * @returns\n */\nfunction NOW() {\n return new Date()\n}\n\n/**\n * Converts a serial number to a second.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The time that contains the seconds you want to find. Times may be entered as text strings within quotation marks (for example, \"6:45 PM\"), as decimal numbers (for example, 0.78125, which represents 6:45 PM), or as results of other formulas or functions (for example, TIMEVALUE(\"6:45 PM\")).\n * @returns\n */\nfunction SECOND(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getSeconds()\n}\n\n/**\n * Returns the serial number of a particular time.\n *\n * Category: Date and time\n *\n * @param {*} hour A number from 0 (zero) to 32767 representing the hour. Any value greater than 23 will be divided by 24 and the remainder will be treated as the hour value. For example, TIME(27,0,0) = TIME(3,0,0) = .125 or 3:00 AM.\n * @param {*} minute A number from 0 to 32767 representing the minute. Any value greater than 59 will be converted to hours and minutes. For example, TIME(0,750,0) = TIME(12,30,0) = .520833 or 12:30 PM.\n * @param {*} second A number from 0 to 32767 representing the second. Any value greater than 59 will be converted to hours, minutes, and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148 or 12:33:20 AM\n * @returns\n */\nfunction TIME(hour, minute, second) {\n hour = parseNumber(hour);\n minute = parseNumber(minute);\n second = parseNumber(second);\n\n if (anyIsError(hour, minute, second)) {\n return value\n }\n\n if (hour < 0 || minute < 0 || second < 0) {\n return num\n }\n\n return (3600 * hour + 60 * minute + second) / 86400\n}\n\n/**\n * Converts a time in the form of text to a serial number.\n *\n * Category: Date and time\n *\n * @param {*} time_text A text string that represents a time in any one of the Microsoft Excel time formats; for example, \"6:45 PM\" and \"18:45\" text strings within quotation marks that represent time.\n * @returns\n */\nfunction TIMEVALUE(time_text) {\n time_text = parseDate(time_text);\n\n if (time_text instanceof Error) {\n return time_text\n }\n\n return (3600 * time_text.getHours() + 60 * time_text.getMinutes() + time_text.getSeconds()) / 86400\n}\n\n/**\n * Returns the serial number of today's date.\n *\n * Category: Date and time\n *\n * @returns\n */\nfunction TODAY() {\n return startOfDay(new Date())\n}\n\n/**\n * Converts a serial number to a day of the week.\n *\n * Category: Date and time\n *\n * @param {*} serial_number A sequential number that represents the date of the day you are trying to find.\n * @param {*} return_type Optional. A number that determines the type of return value.\n * @returns\n */\nfunction WEEKDAY(serial_number, return_type) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n if (return_type === undefined) {\n return_type = 1;\n }\n\n const day = serial_number.getDay();\n\n return WEEK_TYPES[return_type][day]\n}\n\n/**\n * Converts a serial number to a number representing where the week falls numerically with a year.\n *\n * Category: Date and time\n *\n * @param {*} serial_number A date within the week.\n * @param {*} return_type Optional. A number that determines on which day the week begins. The default is 1.\n * @returns\n */\nfunction WEEKNUM(serial_number, return_type) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n if (return_type === undefined) {\n return_type = 1;\n }\n\n if (return_type === 21) {\n return ISOWEEKNUM(serial_number)\n }\n\n const week_start = WEEK_STARTS[return_type];\n let jan = new Date(serial_number.getFullYear(), 0, 1);\n const inc = jan.getDay() < week_start ? 1 : 0;\n jan -= Math.abs(jan.getDay() - week_start) * 24 * 60 * 60 * 1000;\n\n return Math.floor((serial_number - jan) / (1000 * 60 * 60 * 24) / 7 + 1) + inc\n}\n\n/**\n * Returns the serial number of the date before or after a specified number of workdays.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} days The number of nonweekend and nonholiday days before or after start_date. A positive value for days yields a future date; a negative value yields a past date.\n * @param {*} holidays Optional. An optional list of one or more dates to exclude from the working calendar, such as state and federal holidays and floating holidays. The list can be either a range of values that contain the dates or an array constant of the serial numbers that represent the dates.\n * @returns\n */\nfunction WORKDAY(start_date, days, holidays) {\n return WORKDAY.INTL(start_date, days, 1, holidays)\n}\n\n/**\n * Returns the serial number of the date before or after a specified number of workdays using parameters to indicate which and how many days are weekend days.\n *\n * Category: Date and time\n *\n * @param {*} start_date The start date, truncated to integer.\n * @param {*} days The number of workdays before or after the start_date. A positive value yields a future date; a negative value yields a past date; a zero value yields the start_date. Day-offset is truncated to an integer.\n * @param {*} weekend Optional. Indicates the days of the week that are weekend days and are not considered working days. Weekend is a weekend number or string that specifies when weekends occur. Weekend number values indicate the following weekend days:\n * @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. Holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.\n * @returns\n */\nWORKDAY.INTL = (start_date, days, weekend, holidays) => {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n days = parseNumber(days);\n\n if (days instanceof Error) {\n return days\n }\n\n if (weekend === undefined) {\n weekend = WEEKEND_TYPES[1];\n } else {\n weekend = WEEKEND_TYPES[weekend];\n }\n\n if (!(weekend instanceof Array)) {\n return value\n }\n\n if (holidays === undefined) {\n holidays = [];\n } else if (!(holidays instanceof Array)) {\n holidays = [holidays];\n }\n\n for (let i = 0; i < holidays.length; i++) {\n const h = parseDate(holidays[i]);\n\n if (h instanceof Error) {\n return h\n }\n\n holidays[i] = h;\n }\n\n let d = 0;\n\n const sign = Math.sign(days);\n\n while (d < days * sign) {\n start_date.setDate(start_date.getDate() + sign);\n\n const day = start_date.getDay();\n\n if (day === weekend[0] || day === weekend[1]) {\n continue\n }\n\n for (let j = 0; j < holidays.length; j++) {\n const holiday = holidays[j];\n\n if (\n holiday.getDate() === start_date.getDate() &&\n holiday.getMonth() === start_date.getMonth() &&\n holiday.getFullYear() === start_date.getFullYear()\n ) {\n d--;\n break\n }\n }\n\n d++;\n }\n\n // EXCEL does not recognize dates before 1900.\n if (start_date.getFullYear() < 1900) {\n return value\n }\n\n return start_date\n};\n\n/**\n * Converts a serial number to a year.\n *\n * Category: Date and time\n *\n * @param {*} serial_number The date of the year you want to find.\n * @returns\n */\nfunction YEAR(serial_number) {\n serial_number = parseDate(serial_number);\n\n if (serial_number instanceof Error) {\n return serial_number\n }\n\n return serial_number.getFullYear()\n}\n\nfunction isLeapYear(year) {\n return new Date(year, 1, 29).getMonth() === 1\n}\n\n// TODO : Use DAYS ?\nfunction daysBetween(start_date, end_date) {\n return Math.ceil((end_date - start_date) / 1000 / 60 / 60 / 24)\n}\n\n/**\n * Returns the year fraction representing the number of whole days between start_date and end_date.\n *\n * Category: Date and time\n *\n * @param {*} start_date A date that represents the start date.\n * @param {*} end_date A date that represents the end date.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YEARFRAC(start_date, end_date, basis) {\n start_date = parseDate(start_date);\n\n if (start_date instanceof Error) {\n return start_date\n }\n\n end_date = parseDate(end_date);\n\n if (end_date instanceof Error) {\n return end_date\n }\n\n basis = basis || 0;\n let sd = start_date.getDate();\n const sm = start_date.getMonth() + 1;\n const sy = start_date.getFullYear();\n let ed = end_date.getDate();\n const em = end_date.getMonth() + 1;\n const ey = end_date.getFullYear();\n\n switch (basis) {\n case 0:\n // US (NASD) 30/360\n if (sd === 31 && ed === 31) {\n sd = 30;\n ed = 30;\n } else if (sd === 31) {\n sd = 30;\n } else if (sd === 30 && ed === 31) {\n ed = 30;\n }\n\n return (ed + em * 30 + ey * 360 - (sd + sm * 30 + sy * 360)) / 360\n case 1: {\n // Actual/actual\n const feb29Between = (date1, date2) => {\n const year1 = date1.getFullYear();\n const mar1year1 = new Date(year1, 2, 1);\n\n if (isLeapYear(year1) && date1 < mar1year1 && date2 >= mar1year1) {\n return true\n }\n\n const year2 = date2.getFullYear();\n const mar1year2 = new Date(year2, 2, 1);\n\n return isLeapYear(year2) && date2 >= mar1year2 && date1 < mar1year2\n };\n\n let ylength = 365;\n\n if (sy === ey || (sy + 1 === ey && (sm > em || (sm === em && sd >= ed)))) {\n if ((sy === ey && isLeapYear(sy)) || feb29Between(start_date, end_date) || (em === 1 && ed === 29)) {\n ylength = 366;\n }\n\n return daysBetween(start_date, end_date) / ylength\n }\n\n const years = ey - sy + 1;\n const days = (new Date(ey + 1, 0, 1) - new Date(sy, 0, 1)) / 1000 / 60 / 60 / 24;\n const average = days / years;\n\n return daysBetween(start_date, end_date) / average\n }\n\n case 2:\n // Actual/360\n\n return daysBetween(start_date, end_date) / 360\n case 3:\n // Actual/365\n\n return daysBetween(start_date, end_date) / 365\n case 4:\n // European 30/360\n\n return (ed + em * 30 + ey * 360 - (sd + sm * 30 + sy * 360)) / 360\n }\n}\n\nfunction serial(date) {\n const addOn = date > -2203891200000 ? 2 : 1;\n\n return Math.ceil((date - d1900) / 86400000) + addOn\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Changes full-width (double-byte) English letters or katakana within a character string to half-width (single-byte) characters.\n *\n * Category: Text\n *\n * @param {*} text The text or a reference to a value that contains the text you want to change. If text does not contain any full-width letters, text is not changed.\n * @returns\n */\nfunction ASC() {\n throw new Error('ASC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Converts a number to text, using the \u00DF (baht) currency format.\n *\n * Category: Text\n *\n * @param {*} number A number you want to convert to text, or a reference to a value containing a number, or a formula that evaluates to a number.\n * @returns\n */\nfunction BAHTTEXT() {\n throw new Error('BAHTTEXT is not implemented')\n}\n\n/**\n * Returns the character specified by the code number.\n *\n * Category: Text\n *\n * @param {*} number A number between 1 and 255 specifying which character you want. The character is from the character set used by your computer. Note: Excel for the web supports only CHAR(9), CHAR(10), CHAR(13), and CHAR(32) and above.\n * @returns\n */\nfunction CHAR(number) {\n number = parseNumber(number);\n\n if (number === 0) {\n return value\n }\n\n if (number instanceof Error) {\n return number\n }\n\n return String.fromCharCode(number)\n}\n\n/**\n * Removes all nonprintable characters from text.\n *\n * Category: Text\n *\n * @param {*} text Any worksheet information from which you want to remove nonprintable characters.\n * @returns\n */\nfunction CLEAN(text) {\n if (anyIsError(text)) {\n return text\n }\n\n text = text || '';\n const re = /[\\0-\\x1F]/g;\n\n return text.replace(re, '')\n}\n\n/**\n * Returns a numeric code for the first character in a text string.\n *\n * Category: Text\n *\n * @param {*} text The text for which you want the code of the first character.\n * @returns\n */\nfunction CODE(text) {\n if (anyIsError(text)) {\n return text\n }\n\n text = text || '';\n let result = text.charCodeAt(0);\n\n if (isNaN(result)) {\n result = value;\n }\n\n return result\n}\n\n/**\n * Joins several text items into one text item.\n *\n * Category: Text\n *\n * @returns\n */\nfunction CONCATENATE() {\n const args = flatten(arguments);\n const someError = anyError.apply(undefined, args);\n\n if (someError) {\n return someError\n }\n\n let trueFound = 0;\n\n while ((trueFound = args.indexOf(true)) > -1) {\n args[trueFound] = 'TRUE';\n }\n\n let falseFound = 0;\n\n while ((falseFound = args.indexOf(false)) > -1) {\n args[falseFound] = 'FALSE';\n }\n\n return args.join('')\n}\n\nconst CONCAT = CONCATENATE;\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Changes half-width (single-byte) English letters or katakana within a character string to full-width (double-byte) characters.\n *\n * Category: Text\n *\n * @param {*} text The text or a reference to a value that contains the text you want to change. If text does not contain any half-width English letters or katakana, text is not changed.\n * @returns\n */\nfunction DBCS() {\n throw new Error('DBCS is not implemented')\n}\n\n/**\n * Converts a number to text, using the $ (dollar) currency format.\n *\n * Category: Text\n *\n * @param {*} number A number, a reference to a value containing a number, or a formula that evaluates to a number.\n * @param {*} decimals Optional. The number of digits to the right of the decimal point. If this is negative, the number is rounded to the left of the decimal point. If you omit decimals, it is assumed to be 2.\n * @returns\n */\nfunction DOLLAR(number, decimals = 2) {\n number = parseNumber(number);\n if (isNaN(number)) {\n return value\n }\n\n number = ROUND(number, decimals);\n\n const options = {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits: decimals >= 0 ? decimals : 0,\n maximumFractionDigits: decimals >= 0 ? decimals : 0\n };\n\n const formattedNumber = number.toLocaleString('en-US', options);\n\n if (number < 0) {\n return '$(' + formattedNumber.slice(2) + ')'\n }\n\n return formattedNumber\n}\n\n/**\n * Checks to see if two text values are identical.\n *\n * Category: Text\n *\n * @param {*} text1 The first text string.\n * @param {*} text2 The second text string.\n * @returns\n */\nfunction EXACT(text1, text2) {\n if (arguments.length !== 2) {\n return na\n }\n\n const someError = anyError(text1, text2);\n\n if (someError) {\n return someError\n }\n\n text1 = parseString(text1);\n text2 = parseString(text2);\n\n return text1 === text2\n}\n\n/**\n * Locate one text string within a second text string, and return the number of the starting position of the first text string from the first character of the second text string.\n *\n * Category: Text\n *\n * @param {*} find_text The text you want to find.\n * @param {*} within_text The text containing the text you want to find.\n * @param {*} start_num Optional. Specifies the character at which to start the search. The first character in within_text is character number 1. If you omit start_num, it is assumed to be 1.\n * @returns\n */\nfunction FIND(find_text, within_text, start_num) {\n if (arguments.length < 2) {\n return na\n }\n\n find_text = parseString(find_text);\n within_text = parseString(within_text);\n start_num = start_num === undefined ? 0 : start_num;\n const found_index = within_text.indexOf(find_text, start_num - 1);\n\n if (found_index === -1) {\n return value\n }\n\n return found_index + 1\n}\n\n/**\n * Formats a number as text with a fixed number of decimals.\n *\n * Category: Text\n *\n * @param {*} number The number you want to round and convert to text.\n * @param {*} decimals Optional. The number of digits to the right of the decimal point.\n * @param {*} no_commas Optional. A logical value that, if TRUE, prevents FIXED from including commas in the returned text.\n * @returns\n */\nfunction FIXED(number, decimals = 2, no_commas = false) {\n number = parseNumber(number);\n if (isNaN(number)) {\n return value\n }\n\n decimals = parseNumber(decimals);\n if (isNaN(decimals)) {\n return value\n }\n\n if (decimals < 0) {\n const factor = Math.pow(10, -decimals);\n number = Math.round(number / factor) * factor;\n } else {\n number = number.toFixed(decimals);\n }\n\n if (no_commas) {\n number = number.toString().replace(/,/g, '');\n } else {\n const parts = number.toString().split('.');\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+$)/g, ',');\n number = parts.join('.');\n }\n\n return number\n}\n\n/**\n * Returns the leftmost characters from a text value.\n *\n * Category: Text\n *\n * @param {*} text The text string that contains the characters you want to extract.\n * @param {*} num_chars Optional. Specifies the number of characters you want LEFT to extract.\n * @returns\n */\nfunction LEFT(text, num_chars) {\n const someError = anyError(text, num_chars);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n num_chars = num_chars === undefined ? 1 : num_chars;\n num_chars = parseNumber(num_chars);\n\n if (num_chars instanceof Error || typeof text !== 'string') {\n return value\n }\n\n return text.substring(0, num_chars)\n}\n\n/**\n * Returns the number of characters in a text string\n *\n * Category: Text\n *\n * @param {*} text The text whose length you want to find. Spaces count as characters.\n * @returns\n */\nfunction LEN(text) {\n if (arguments.length === 0) {\n return error\n }\n\n if (text instanceof Error) {\n return text\n }\n\n if (Array.isArray(text)) {\n return value\n }\n\n const textAsString = parseString(text);\n\n return textAsString.length\n}\n\n/**\n * Converts text to lowercase.\n *\n * Category: Text\n *\n * @param {*} text The text you want to convert to lowercase. LOWER does not change characters in text that are not letters.\n * @returns\n */\nfunction LOWER(text) {\n if (arguments.length !== 1) {\n return value\n }\n\n text = parseString(text);\n\n if (anyIsError(text)) {\n return text\n }\n\n return text.toLowerCase()\n}\n\n/**\n * Returns a specific number of characters from a text string starting at the position you specify\n *\n * Category: Text\n *\n * @param {*} text The text string containing the characters you want to extract.\n * @param {*} start_num The position of the first character you want to extract in text. The first character in text has start_num 1, and so on.\n * @param {*} num_chars Specifies the number of characters you want MID to return from text.\n * @returns\n */\nfunction MID(text, start_num, num_chars) {\n if (start_num === undefined || start_num === null) {\n return value\n }\n\n start_num = parseNumber(start_num);\n num_chars = parseNumber(num_chars);\n\n if (anyIsError(start_num, num_chars) || typeof text !== 'string') {\n return num_chars\n }\n\n const begin = start_num - 1;\n const end = begin + num_chars;\n\n return text.substring(begin, end)\n}\n\n// TODO\n/**\n * Converts text to number in a locale-independent manner.\n *\n * Category: Text\n *\n * @param {*} text The text to convert to a number.\n * @param {*} decimal_separator Optional. The character used to separate the integer and fractional part of the result.\n * @param {*} group_separator Optional. The character used to separate groupings of numbers, such as thousands from hundreds and millions from thousands.\n * @returns\n */\nfunction NUMBERVALUE(text, decimal_separator, group_separator) {\n text = isDefined(text) ? text : '';\n\n if (typeof text === 'number') {\n return text\n }\n\n if (typeof text !== 'string') {\n return na\n }\n\n decimal_separator = typeof decimal_separator === 'undefined' ? '.' : decimal_separator;\n group_separator = typeof group_separator === 'undefined' ? ',' : group_separator;\n\n return Number(text.replace(decimal_separator, '.').replace(group_separator, ''))\n}\n\n// TODO\n/**\n * -- Not implemented --\n */\nfunction PRONETIC() {\n throw new Error('PRONETIC is not implemented')\n}\n\n/**\n * Capitalizes the first letter in each word of a text value.\n *\n * Category: Text\n *\n * @param {*} text Text enclosed in quotation marks, a formula that returns text, or a reference to a value containing the text you want to partially capitalize.\n * @returns\n */\nfunction PROPER(text) {\n if (anyIsError(text)) {\n return text\n }\n\n if (isNaN(text) && typeof text === 'number') {\n return value\n }\n\n text = parseString(text);\n\n return text.replace(/\\w\\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase())\n}\n\n/**\n * Replaces characters within text\n *\n * Category: Text\n *\n * @param {*} old_text Text in which you want to replace some characters.\n * @param {*} num_chars The number of characters in old_text that you want REPLACE to replace with new_text.\n * @param {*} length he number of characters in old_text that you want REPLACEB to replace with new_text.\n * @param {*} new_text he text that will replace characters in old_text.\n * @returns\n */\nfunction REPLACE(old_text, num_chars, length, new_text) {\n num_chars = parseNumber(num_chars);\n length = parseNumber(length);\n\n if (anyIsError(num_chars, length) || typeof old_text !== 'string' || typeof new_text !== 'string') {\n return value\n }\n\n return old_text.substr(0, num_chars - 1) + new_text + old_text.substr(num_chars - 1 + length)\n}\n\n/**\n * Repeats text a given number of times.\n *\n * Category: Text\n *\n * @param {*} text The text you want to repeat.\n * @param {*} number_times A positive number specifying the number of times to repeat text.\n * @returns\n */\nfunction REPT(text, number_times) {\n const someError = anyError(text, number_times);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n number_times = parseNumber(number_times);\n\n if (number_times instanceof Error) {\n return number_times\n }\n\n return new Array(number_times + 1).join(text)\n}\n\n/**\n * Returns the rightmost characters from a text value\n *\n * Category: Text\n *\n * @param {*} text The text string containing the characters you want to extract.\n * @param {*} num_chars Optional. Specifies the number of characters you want RIGHT to extract.\n * @returns\n */\nfunction RIGHT(text, num_chars) {\n const someError = anyError(text, num_chars);\n\n if (someError) {\n return someError\n }\n\n text = parseString(text);\n num_chars = num_chars === undefined ? 1 : num_chars;\n num_chars = parseNumber(num_chars);\n\n if (num_chars instanceof Error) {\n return num_chars\n }\n\n return text.substring(text.length - num_chars)\n}\n\n/**\n * Finds one text value within another (not case-sensitive)\n *\n * Category: Text\n *\n * @param {*} find_text The text that you want to find.\n * @param {*} within_text The text in which you want to search for the value of the find_text argument.\n * @param {*} start_num Optional. The character number in the within_text argument at which you want to start searching.\n * @returns\n */\nfunction SEARCH(find_text, within_text, start_num) {\n let foundAt;\n\n if (typeof find_text !== 'string' || typeof within_text !== 'string') {\n return value\n }\n\n start_num = start_num === undefined ? 0 : start_num;\n foundAt = within_text.toLowerCase().indexOf(find_text.toLowerCase(), start_num - 1) + 1;\n\n return foundAt === 0 ? value : foundAt\n}\n\n/**\n * Substitutes new text for old text in a text string.\n *\n * Category: Text\n *\n * @param {*} text The text or the reference to a value containing text for which you want to substitute characters.\n * @param {*} old_text The text you want to replace.\n * @param {*} new_text The text you want to replace old_text with.\n * @param {*} instance_num Optional. Specifies which occurrence of old_text you want to replace with new_text. If you specify instance_num, only that instance of old_text is replaced. Otherwise, every occurrence of old_text in text is changed to new_text.\n * @returns\n */\nfunction SUBSTITUTE(text, old_text, new_text, instance_num) {\n if (arguments.length < 3) {\n return na\n }\n\n if (!text || !old_text) {\n return text\n } else if (instance_num === undefined) {\n return text.split(old_text).join(new_text)\n } else {\n instance_num = Math.floor(Number(instance_num));\n\n if (Number.isNaN(instance_num) || instance_num <= 0) {\n return value\n }\n\n let index = 0;\n let i = 0;\n\n while (index > -1 && text.indexOf(old_text, index) > -1) {\n index = text.indexOf(old_text, index + 1);\n i++;\n\n if (index > -1 && i === instance_num) {\n return text.substring(0, index) + new_text + text.substring(index + old_text.length)\n }\n }\n\n return text\n }\n}\n\n/**\n * Converts its arguments to text.\n *\n * Category: Text\n *\n * @param {*} value The value you want to test.\n * @returns\n */\nfunction T(value) {\n if (value instanceof Error) {\n return value\n }\n\n return typeof value === 'string' ? value : ''\n}\n\n/**\n * Formats a number and converts it to text.\n *\n * Category: Text\n *\n * @param {*} value A numeric value that you want to be converted into text.\n * @param {*} format_text A text string that defines the formatting that you want to be applied to the supplied value.\n * @returns\n */\nfunction TEXT(value$1, format_text) {\n if (value$1 === undefined || value$1 instanceof Error || format_text instanceof Error) {\n return na\n }\n\n if (value$1 instanceof Date) {\n return value$1.toISOString().slice(0, 10)\n }\n\n if (format_text === undefined || format_text === null) {\n return ''\n }\n\n if (typeof format_text === 'number') {\n return String(format_text)\n }\n\n if (typeof format_text !== 'string') {\n return value\n }\n\n const currencySymbol = format_text.startsWith('$') ? '$' : '';\n const isPercent = format_text.endsWith('%');\n format_text = format_text.replace(/%/g, '').replace(/\\$/g, '');\n\n // count all 0s after the decimal point\n const decimalPlaces = format_text.includes('.') ? format_text.split('.')[1].match(/0/g).length : 0;\n\n const noCommas = !format_text.includes(',');\n\n if (isPercent) {\n value$1 = value$1 * 100;\n }\n\n value$1 = FIXED(value$1, decimalPlaces, noCommas);\n\n if (value$1.startsWith('-')) {\n value$1 = value$1.replace('-', '');\n value$1 = '-' + currencySymbol + value$1;\n } else {\n value$1 = currencySymbol + value$1;\n }\n\n if (isPercent) {\n value$1 = value$1 + '%';\n }\n\n return value$1\n}\n\n/**\n * Combines the text from multiple ranges and/or strings.\n *\n * Category: Text\n * @param {*} delimiter A text string, either empty, or one or more characters enclosed by double quotes, or a reference to a valid text string. If a number is supplied, it will be treated as text.\n * @param {*} ignore_empty If TRUE, ignores empty values.\n * @param {*} args Text item to be joined. A text string, or array of strings, such as a range of values.\n * @returns\n */\nfunction TEXTJOIN(delimiter, ignore_empty, ...args) {\n if (typeof ignore_empty !== 'boolean') {\n ignore_empty = parseBool(ignore_empty);\n }\n\n if (arguments.length < 3) {\n return na\n }\n\n delimiter = delimiter !== null && delimiter !== undefined ? delimiter : '';\n\n let flatArgs = flatten(args);\n let textToJoin = ignore_empty ? flatArgs.filter((text) => text) : flatArgs;\n\n if (Array.isArray(delimiter)) {\n delimiter = flatten(delimiter);\n\n let chunks = textToJoin.map((item) => [item]);\n let index = 0;\n\n for (let i = 0; i < chunks.length - 1; i++) {\n chunks[i].push(delimiter[index]);\n index++;\n\n if (index === delimiter.length) {\n index = 0;\n }\n }\n\n textToJoin = flatten(chunks);\n\n return textToJoin.join('')\n }\n\n return textToJoin.join(delimiter)\n}\n\n/**\n * Removes spaces from text.\n *\n * Category: Text\n *\n * @param {*} text The text from which you want spaces removed.\n * @returns\n */\nfunction TRIM(text) {\n text = parseString(text);\n\n if (text instanceof Error) {\n return text\n }\n\n return text.replace(/\\s+/g, ' ').trim()\n}\n\nconst UNICHAR = CHAR;\n\nconst UNICODE = CODE;\n\n/**\n * Converts text to uppercase.\n *\n * Category: Text\n *\n * @param {*} text The text you want converted to uppercase. Text can be a reference or text string.\n * @returns\n */\nfunction UPPER(text) {\n text = parseString(text);\n\n if (text instanceof Error) {\n return text\n }\n\n return text.toUpperCase()\n}\n\n/**\n * Converts a text argument to a number.\n *\n * Category: Text\n *\n * @param {*} text The text enclosed in quotation marks or a reference to a value containing the text you want to convert.\n * @returns\n */\nfunction VALUE(text) {\n const anyError$1 = anyError(text);\n\n if (anyError$1) {\n return anyError$1\n }\n\n if (typeof text === 'number') {\n return text\n }\n\n if (!isDefined(text)) {\n text = '';\n }\n\n if (typeof text !== 'string') {\n return value\n }\n\n const isPercent = /(%)$/.test(text) || /^(%)/.test(text);\n text = text.replace(/^[^0-9-]{0,3}/, '');\n text = text.replace(/[^0-9]{0,3}$/, '');\n text = text.replace(/[ ,]/g, '');\n\n if (text === '') {\n return 0\n }\n\n let output = Number(text);\n\n if (isNaN(output)) {\n return value\n }\n\n output = output || 0;\n\n if (isPercent) {\n output = output * 0.01;\n }\n\n return output\n}\n\nfunction isValidBinaryNumber(number) {\n return /^[01]{1,10}$/.test(number)\n}\n\n/**\n * Returns the modified Bessel function In(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the Bessel function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELI(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besseli(x, n)\n}\n\n/**\n * Returns the Bessel function Jn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the Bessel function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELJ(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besselj(x, n)\n}\n\n/**\n * Returns the modified Bessel function Kn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELK(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.besselk(x, n)\n}\n\n/**\n * Returns the Bessel function Yn(x).\n *\n * Category: Engineering\n *\n * @param {*} x The value at which to evaluate the function.\n * @param {*} n The order of the function. If n is not an integer, it is truncated.\n * @returns\n */\nfunction BESSELY(x, n) {\n x = parseNumber(x);\n n = parseNumber(n);\n\n if (anyIsError(x, n)) {\n return value\n }\n\n return bessel.bessely(x, n)\n}\n\n/**\n * Converts a binary number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction BIN2DEC(number) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Convert binary number to decimal\n const result = parseInt(number, 2);\n\n // Handle negative numbers\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return parseInt(stringified.substring(1), 2) - 512\n } else {\n return result\n }\n}\n\n/**\n * Converts a binary number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, BIN2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction BIN2HEX(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1099511627264 + parseInt(stringified.substring(1), 2)).toString(16)\n }\n\n // Convert binary number to hexadecimal\n const result = parseInt(number, 2).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a binary number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, BIN2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction BIN2OCT(number, places) {\n // Return error if number is not binary or contains more than 10 characters (10 digits)\n if (!isValidBinaryNumber(number)) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n const stringified = number.toString();\n\n if (stringified.length === 10 && stringified.substring(0, 1) === '1') {\n return (1073741312 + parseInt(stringified.substring(1), 2)).toString(8)\n }\n\n // Convert binary number to octal\n const result = parseInt(number, 2).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Returns a 'Bitwise And' of two numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be in decimal form and greater than or equal to 0.\n * @param {*} number2 Must be in decimal form and greater than or equal to 0.\n * @returns\n */\nfunction BITAND(number1, number2) {\n // Return error if either number is a non-numeric value\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise AND of two numbers\n return number1 & number2\n}\n\n/**\n * Returns a value number shifted left by shift_amount bits.\n *\n * Category: Engineering\n *\n * @param {*} number Number must be an integer greater than or equal to 0.\n * @param {*} shift_amount Shift_amount must be an integer.\n * @returns\n */\nfunction BITLSHIFT(number, shift_amount) {\n number = parseNumber(number);\n shift_amount = parseNumber(shift_amount);\n\n if (anyIsError(number, shift_amount)) {\n return value\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return num\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return num\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return num\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift_amount) > 53) {\n return num\n }\n\n // Return number shifted by shift bits to the left or to the right if shift is negative\n return shift_amount >= 0 ? number << shift_amount : number >> -shift_amount\n}\n\n/**\n * Returns a bitwise OR of 2 numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be in decimal form and greater than or equal to 0.\n * @param {*} number2 Must be in decimal form and greater than or equal to 0.\n * @returns\n */\nfunction BITOR(number1, number2) {\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise OR of two numbers\n return number1 | number2\n}\n\n/**\n * Returns a value number shifted right by shift_amount bits.\n *\n * Category: Engineering\n *\n * @param {*} number Must be an integer greater than or equal to 0.\n * @param {*} shift_amount Must be an integer.\n * @returns\n */\nfunction BITRSHIFT(number, shift_amount) {\n number = parseNumber(number);\n shift_amount = parseNumber(shift_amount);\n\n if (anyIsError(number, shift_amount)) {\n return value\n }\n\n // Return error if number is less than 0\n if (number < 0) {\n return num\n }\n\n // Return error if number is a non-integer\n if (Math.floor(number) !== number) {\n return num\n }\n\n // Return error if number is greater than (2^48)-1\n if (number > 281474976710655) {\n return num\n }\n\n // Return error if the absolute value of shift is greater than 53\n if (Math.abs(shift_amount) > 53) {\n return num\n }\n\n // Return number shifted by shift bits to the right or to the left if shift is negative\n return shift_amount >= 0 ? number >> shift_amount : number << -shift_amount\n}\n\n/**\n * Returns a bitwise 'Exclusive Or' of two numbers.\n *\n * Category: Engineering\n *\n * @param {*} number1 Must be greater than or equal to 0.\n * @param {*} number2 Must be greater than or equal to 0.\n * @returns\n */\nfunction BITXOR(number1, number2) {\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return error if either number is less than 0\n if (number1 < 0 || number2 < 0) {\n return num\n }\n\n // Return error if either number is a non-integer\n if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {\n return num\n }\n\n // Return error if either number is greater than (2^48)-1\n if (number1 > 281474976710655 || number2 > 281474976710655) {\n return num\n }\n\n // Return bitwise XOR of two numbers\n return number1 ^ number2\n}\n\n/**\n * Converts real and imaginary coefficients into a complex number.\n *\n * Category: Engineering\n *\n * @param {*} real_num The real coefficient of the complex number.\n * @param {*} i_num The imaginary coefficient of the complex number.\n * @param {*} suffix Optional. The suffix for the imaginary component of the complex number. If omitted, suffix is assumed to be \"i\".\n * @returns\n */\nfunction COMPLEX(real_num, i_num, suffix) {\n real_num = parseNumber(real_num);\n i_num = parseNumber(i_num);\n\n if (anyIsError(real_num, i_num)) {\n return real_num\n }\n\n // Set suffix\n suffix = suffix === undefined ? 'i' : suffix;\n\n // Return error if suffix is neither \"i\" nor \"j\"\n if (suffix !== 'i' && suffix !== 'j') {\n return value\n }\n\n // Return complex number\n if (real_num === 0 && i_num === 0) {\n return 0\n } else if (real_num === 0) {\n return i_num === 1 ? suffix : i_num.toString() + suffix\n } else if (i_num === 0) {\n return real_num.toString()\n } else {\n const sign = i_num > 0 ? '+' : '';\n return real_num.toString() + sign + (i_num === 1 ? suffix : i_num.toString() + suffix)\n }\n}\n\n/**\n * Converts a number from one measurement system to another.\n *\n * Category: Engineering\n *\n * @param {*} number is the value in from_units to convert.\n * @param {*} from_unit is the units for number.\n * @param {*} to_unit is the units for the result. CONVERT accepts the following text values (in quotation marks) for from_unit and to_unit.\n * @returns\n */\nfunction CONVERT(number, from_unit, to_unit) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // List of units supported by CONVERT and units defined by the International System of Units\n // [Name, Symbol, Alternate symbols, Quantity, ISU, CONVERT, Conversion ratio]\n const units = [\n ['a.u. of action', '?', null, 'action', false, false, 1.05457168181818e-34],\n ['a.u. of charge', 'e', null, 'electric_charge', false, false, 1.60217653141414e-19],\n ['a.u. of energy', 'Eh', null, 'energy', false, false, 4.35974417757576e-18],\n ['a.u. of length', 'a?', null, 'length', false, false, 5.29177210818182e-11],\n ['a.u. of mass', 'm?', null, 'mass', false, false, 9.10938261616162e-31],\n ['a.u. of time', '?/Eh', null, 'time', false, false, 2.41888432650516e-17],\n ['admiralty knot', 'admkn', null, 'speed', false, true, 0.514773333],\n ['ampere', 'A', null, 'electric_current', true, false, 1],\n ['ampere per meter', 'A/m', null, 'magnetic_field_intensity', true, false, 1],\n ['\u00E5ngstr\u00F6m', '\u00C5', ['ang'], 'length', false, true, 1e-10],\n ['are', 'ar', null, 'area', false, true, 100],\n ['astronomical unit', 'ua', null, 'length', false, false, 1.49597870691667e-11],\n ['bar', 'bar', null, 'pressure', false, false, 100000],\n ['barn', 'b', null, 'area', false, false, 1e-28],\n ['becquerel', 'Bq', null, 'radioactivity', true, false, 1],\n ['bit', 'bit', ['b'], 'information', false, true, 1],\n ['btu', 'BTU', ['btu'], 'energy', false, true, 1055.05585262],\n ['byte', 'byte', null, 'information', false, true, 8],\n ['candela', 'cd', null, 'luminous_intensity', true, false, 1],\n ['candela per square metre', 'cd/m?', null, 'luminance', true, false, 1],\n ['coulomb', 'C', null, 'electric_charge', true, false, 1],\n ['cubic \u00E5ngstr\u00F6m', 'ang3', ['ang^3'], 'volume', false, true, 1e-30],\n ['cubic foot', 'ft3', ['ft^3'], 'volume', false, true, 0.028316846592],\n ['cubic inch', 'in3', ['in^3'], 'volume', false, true, 0.000016387064],\n ['cubic light-year', 'ly3', ['ly^3'], 'volume', false, true, 8.46786664623715e-47],\n ['cubic metre', 'm3', ['m^3'], 'volume', true, true, 1],\n ['cubic mile', 'mi3', ['mi^3'], 'volume', false, true, 4168181825.44058],\n ['cubic nautical mile', 'Nmi3', ['Nmi^3'], 'volume', false, true, 6352182208],\n ['cubic Pica', 'Pica3', ['Picapt3', 'Pica^3', 'Picapt^3'], 'volume', false, true, 7.58660370370369e-8],\n ['cubic yard', 'yd3', ['yd^3'], 'volume', false, true, 0.764554857984],\n ['cup', 'cup', null, 'volume', false, true, 0.0002365882365],\n ['dalton', 'Da', ['u'], 'mass', false, false, 1.66053886282828e-27],\n ['day', 'd', ['day'], 'time', false, true, 86400],\n ['degree', '\u00B0', null, 'angle', false, false, 0.0174532925199433],\n ['degrees Rankine', 'Rank', null, 'temperature', false, true, 0.555555555555556],\n ['dyne', 'dyn', ['dy'], 'force', false, true, 0.00001],\n ['electronvolt', 'eV', ['ev'], 'energy', false, true, 1.60217656514141],\n ['ell', 'ell', null, 'length', false, true, 1.143],\n ['erg', 'erg', ['e'], 'energy', false, true, 1e-7],\n ['farad', 'F', null, 'electric_capacitance', true, false, 1],\n ['fluid ounce', 'oz', null, 'volume', false, true, 0.0000295735295625],\n ['foot', 'ft', null, 'length', false, true, 0.3048],\n ['foot-pound', 'flb', null, 'energy', false, true, 1.3558179483314],\n ['gal', 'Gal', null, 'acceleration', false, false, 0.01],\n ['gallon', 'gal', null, 'volume', false, true, 0.003785411784],\n ['gauss', 'G', ['ga'], 'magnetic_flux_density', false, true, 1],\n ['grain', 'grain', null, 'mass', false, true, 0.0000647989],\n ['gram', 'g', null, 'mass', false, true, 0.001],\n ['gray', 'Gy', null, 'absorbed_dose', true, false, 1],\n ['gross registered ton', 'GRT', ['regton'], 'volume', false, true, 2.8316846592],\n ['hectare', 'ha', null, 'area', false, true, 10000],\n ['henry', 'H', null, 'inductance', true, false, 1],\n ['hertz', 'Hz', null, 'frequency', true, false, 1],\n ['horsepower', 'HP', ['h'], 'power', false, true, 745.69987158227],\n ['horsepower-hour', 'HPh', ['hh', 'hph'], 'energy', false, true, 2684519.538],\n ['hour', 'h', ['hr'], 'time', false, true, 3600],\n ['imperial gallon (U.K.)', 'uk_gal', null, 'volume', false, true, 0.00454609],\n ['imperial hundredweight', 'lcwt', ['uk_cwt', 'hweight'], 'mass', false, true, 50.802345],\n ['imperial quart (U.K)', 'uk_qt', null, 'volume', false, true, 0.0011365225],\n ['imperial ton', 'brton', ['uk_ton', 'LTON'], 'mass', false, true, 1016.046909],\n ['inch', 'in', null, 'length', false, true, 0.0254],\n ['international acre', 'uk_acre', null, 'area', false, true, 4046.8564224],\n ['IT calorie', 'cal', null, 'energy', false, true, 4.1868],\n ['joule', 'J', null, 'energy', true, true, 1],\n ['katal', 'kat', null, 'catalytic_activity', true, false, 1],\n ['kelvin', 'K', ['kel'], 'temperature', true, true, 1],\n ['kilogram', 'kg', null, 'mass', true, true, 1],\n ['knot', 'kn', null, 'speed', false, true, 0.514444444444444],\n ['light-year', 'ly', null, 'length', false, true, 9460730472580800],\n ['litre', 'L', ['l', 'lt'], 'volume', false, true, 0.001],\n ['lumen', 'lm', null, 'luminous_flux', true, false, 1],\n ['lux', 'lx', null, 'illuminance', true, false, 1],\n ['maxwell', 'Mx', null, 'magnetic_flux', false, false, 1e-18],\n ['measurement ton', 'MTON', null, 'volume', false, true, 1.13267386368],\n ['meter per hour', 'm/h', ['m/hr'], 'speed', false, true, 0.00027777777777778],\n ['meter per second', 'm/s', ['m/sec'], 'speed', true, true, 1],\n ['meter per second squared', 'm?s??', null, 'acceleration', true, false, 1],\n ['parsec', 'pc', ['parsec'], 'length', false, true, 30856775814671900],\n ['meter squared per second', 'm?/s', null, 'kinematic_viscosity', true, false, 1],\n ['metre', 'm', null, 'length', true, true, 1],\n ['miles per hour', 'mph', null, 'speed', false, true, 0.44704],\n ['millimetre of mercury', 'mmHg', null, 'pressure', false, false, 133.322],\n ['minute', '?', null, 'angle', false, false, 0.000290888208665722],\n ['minute', 'min', ['mn'], 'time', false, true, 60],\n ['modern teaspoon', 'tspm', null, 'volume', false, true, 0.000005],\n ['mole', 'mol', null, 'amount_of_substance', true, false, 1],\n ['morgen', 'Morgen', null, 'area', false, true, 2500],\n ['n.u. of action', '?', null, 'action', false, false, 1.05457168181818e-34],\n ['n.u. of mass', 'm?', null, 'mass', false, false, 9.10938261616162e-31],\n ['n.u. of speed', 'c?', null, 'speed', false, false, 299792458],\n ['n.u. of time', '?/(me?c??)', null, 'time', false, false, 1.28808866778687e-21],\n ['nautical mile', 'M', ['Nmi'], 'length', false, true, 1852],\n ['newton', 'N', null, 'force', true, true, 1],\n ['\u0153rsted', 'Oe ', null, 'magnetic_field_intensity', false, false, 79.5774715459477],\n ['ohm', '\u03A9', null, 'electric_resistance', true, false, 1],\n ['ounce mass', 'ozm', null, 'mass', false, true, 0.028349523125],\n ['pascal', 'Pa', null, 'pressure', true, false, 1],\n ['pascal second', 'Pa?s', null, 'dynamic_viscosity', true, false, 1],\n ['pferdest\u00E4rke', 'PS', null, 'power', false, true, 735.49875],\n ['phot', 'ph', null, 'illuminance', false, false, 0.0001],\n ['pica (1/6 inch)', 'pica', null, 'length', false, true, 0.00035277777777778],\n ['pica (1/72 inch)', 'Pica', ['Picapt'], 'length', false, true, 0.00423333333333333],\n ['poise', 'P', null, 'dynamic_viscosity', false, false, 0.1],\n ['pond', 'pond', null, 'force', false, true, 0.00980665],\n ['pound force', 'lbf', null, 'force', false, true, 4.4482216152605],\n ['pound mass', 'lbm', null, 'mass', false, true, 0.45359237],\n ['quart', 'qt', null, 'volume', false, true, 0.000946352946],\n ['radian', 'rad', null, 'angle', true, false, 1],\n ['second', '?', null, 'angle', false, false, 0.00000484813681109536],\n ['second', 's', ['sec'], 'time', true, true, 1],\n ['short hundredweight', 'cwt', ['shweight'], 'mass', false, true, 45.359237],\n ['siemens', 'S', null, 'electrical_conductance', true, false, 1],\n ['sievert', 'Sv', null, 'equivalent_dose', true, false, 1],\n ['slug', 'sg', null, 'mass', false, true, 14.59390294],\n ['square \u00E5ngstr\u00F6m', 'ang2', ['ang^2'], 'area', false, true, 1e-20],\n ['square foot', 'ft2', ['ft^2'], 'area', false, true, 0.09290304],\n ['square inch', 'in2', ['in^2'], 'area', false, true, 0.00064516],\n ['square light-year', 'ly2', ['ly^2'], 'area', false, true, 8.95054210748189e31],\n ['square meter', 'm?', null, 'area', true, true, 1],\n ['square mile', 'mi2', ['mi^2'], 'area', false, true, 2589988.110336],\n ['square nautical mile', 'Nmi2', ['Nmi^2'], 'area', false, true, 3429904],\n ['square Pica', 'Pica2', ['Picapt2', 'Pica^2', 'Picapt^2'], 'area', false, true, 0.00001792111111111],\n ['square yard', 'yd2', ['yd^2'], 'area', false, true, 0.83612736],\n ['statute mile', 'mi', null, 'length', false, true, 1609.344],\n ['steradian', 'sr', null, 'solid_angle', true, false, 1],\n ['stilb', 'sb', null, 'luminance', false, false, 0.0001],\n ['stokes', 'St', null, 'kinematic_viscosity', false, false, 0.0001],\n ['stone', 'stone', null, 'mass', false, true, 6.35029318],\n ['tablespoon', 'tbs', null, 'volume', false, true, 0.0000147868],\n ['teaspoon', 'tsp', null, 'volume', false, true, 0.00000492892],\n ['tesla', 'T', null, 'magnetic_flux_density', true, true, 1],\n ['thermodynamic calorie', 'c', null, 'energy', false, true, 4.184],\n ['ton', 'ton', null, 'mass', false, true, 907.18474],\n ['tonne', 't', null, 'mass', false, false, 1000],\n ['U.K. pint', 'uk_pt', null, 'volume', false, true, 0.00056826125],\n ['U.S. bushel', 'bushel', null, 'volume', false, true, 0.03523907],\n ['U.S. oil barrel', 'barrel', null, 'volume', false, true, 0.158987295],\n ['U.S. pint', 'pt', ['us_pt'], 'volume', false, true, 0.000473176473],\n ['U.S. survey mile', 'survey_mi', null, 'length', false, true, 1609.347219],\n ['U.S. survey/statute acre', 'us_acre', null, 'area', false, true, 4046.87261],\n ['volt', 'V', null, 'voltage', true, false, 1],\n ['watt', 'W', null, 'power', true, true, 1],\n ['watt-hour', 'Wh', ['wh'], 'energy', false, true, 3600],\n ['weber', 'Wb', null, 'magnetic_flux', true, false, 1],\n ['yard', 'yd', null, 'length', false, true, 0.9144],\n ['year', 'yr', null, 'time', false, true, 31557600]\n ];\n\n // Binary prefixes\n // [Name, Prefix power of 2 value, Previx value, Abbreviation, Derived from]\n const binary_prefixes = {\n Yi: ['yobi', 80, 1208925819614629174706176, 'Yi', 'yotta'],\n Zi: ['zebi', 70, 1180591620717411303424, 'Zi', 'zetta'],\n Ei: ['exbi', 60, 1152921504606846976, 'Ei', 'exa'],\n Pi: ['pebi', 50, 1125899906842624, 'Pi', 'peta'],\n Ti: ['tebi', 40, 1099511627776, 'Ti', 'tera'],\n Gi: ['gibi', 30, 1073741824, 'Gi', 'giga'],\n Mi: ['mebi', 20, 1048576, 'Mi', 'mega'],\n ki: ['kibi', 10, 1024, 'ki', 'kilo']\n };\n\n // Unit prefixes\n // [Name, Multiplier, Abbreviation]\n const unit_prefixes = {\n Y: ['yotta', 1e24, 'Y'],\n Z: ['zetta', 1e21, 'Z'],\n E: ['exa', 1e18, 'E'],\n P: ['peta', 1e15, 'P'],\n T: ['tera', 1e12, 'T'],\n G: ['giga', 1e9, 'G'],\n M: ['mega', 1e6, 'M'],\n k: ['kilo', 1e3, 'k'],\n h: ['hecto', 1e2, 'h'],\n e: ['dekao', 1e1, 'e'],\n d: ['deci', 1e-1, 'd'],\n c: ['centi', 1e-2, 'c'],\n m: ['milli', 1e-3, 'm'],\n u: ['micro', 1e-6, 'u'],\n n: ['nano', 1e-9, 'n'],\n p: ['pico', 1e-12, 'p'],\n f: ['femto', 1e-15, 'f'],\n a: ['atto', 1e-18, 'a'],\n z: ['zepto', 1e-21, 'z'],\n y: ['yocto', 1e-24, 'y']\n };\n\n // Initialize units and multipliers\n let from = null;\n let to = null;\n let base_from_unit = from_unit;\n let base_to_unit = to_unit;\n let from_multiplier = 1;\n let to_multiplier = 1;\n let alt;\n\n // Lookup from and to units\n for (let i = 0; i < units.length; i++) {\n alt = units[i][2] === null ? [] : units[i][2];\n\n if (units[i][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[i];\n }\n\n if (units[i][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[i];\n }\n }\n\n // Lookup from prefix\n if (from === null) {\n const from_binary_prefix = binary_prefixes[from_unit.substring(0, 2)];\n let from_unit_prefix = unit_prefixes[from_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (from_unit.substring(0, 2) === 'da') {\n from_unit_prefix = ['dekao', 1e1, 'da'];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (from_binary_prefix) {\n from_multiplier = from_binary_prefix[2];\n base_from_unit = from_unit.substring(2);\n } else if (from_unit_prefix) {\n from_multiplier = from_unit_prefix[1];\n base_from_unit = from_unit.substring(from_unit_prefix[2].length);\n }\n\n // Lookup from unit\n for (let j = 0; j < units.length; j++) {\n alt = units[j][2] === null ? [] : units[j][2];\n\n if (units[j][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {\n from = units[j];\n }\n }\n }\n\n // Lookup to prefix\n if (to === null) {\n const to_binary_prefix = binary_prefixes[to_unit.substring(0, 2)];\n let to_unit_prefix = unit_prefixes[to_unit.substring(0, 1)];\n\n // Handle dekao unit prefix (only unit prefix with two characters)\n if (to_unit.substring(0, 2) === 'da') {\n to_unit_prefix = ['dekao', 1e1, 'da'];\n }\n\n // Handle binary prefixes first (so that 'Yi' is processed before 'Y')\n if (to_binary_prefix) {\n to_multiplier = to_binary_prefix[2];\n base_to_unit = to_unit.substring(2);\n } else if (to_unit_prefix) {\n to_multiplier = to_unit_prefix[1];\n base_to_unit = to_unit.substring(to_unit_prefix[2].length);\n }\n\n // Lookup to unit\n for (let k = 0; k < units.length; k++) {\n alt = units[k][2] === null ? [] : units[k][2];\n\n if (units[k][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {\n to = units[k];\n }\n }\n }\n\n // Return error if a unit does not exist\n if (from === null || to === null) {\n return na\n }\n\n // Return error if units represent different quantities\n if (from[3] !== to[3]) {\n return na\n }\n\n // Return converted number\n return (number * from[6] * from_multiplier) / (to[6] * to_multiplier)\n}\n\n/**\n * Converts a decimal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, valid place values are ignored and DEC2BIN returns a 10-character (10-bit) binary number in which the most significant bit is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2BIN(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -512, or is greater than 511\n if (!/^-?[0-9]{1,3}$/.test(number) || number < -512 || number > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (number < 0) {\n return '1' + REPT('0', 9 - (512 + number).toString(2).length) + (512 + number).toString(2)\n }\n\n // Convert decimal number to binary\n const result = parseInt(number, 10).toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a decimal number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, places is ignored and DEC2HEX returns a 10-character (40-bit) hexadecimal number in which the most significant bit is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2HEX(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,12}$/.test(number) || number < -549755813888 || number > 549755813887) {\n return num\n }\n\n // Ignore places and return a 10-character hexadecimal number if number is negative\n if (number < 0) {\n return (1099511627776 + number).toString(16)\n }\n\n // Convert decimal number to hexadecimal\n const result = parseInt(number, 10).toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a decimal number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The decimal integer you want to convert. If number is negative, places is ignored and DEC2OCT returns a 10-character (30-bit) octal number in which the most significant bit is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, DEC2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction DEC2OCT(number, places) {\n number = parseNumber(number);\n\n if (number instanceof Error) {\n return number\n }\n\n // Return error if number is not decimal, is lower than -549755813888, or is greater than 549755813887\n if (!/^-?[0-9]{1,9}$/.test(number) || number < -536870912 || number > 536870911) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (number < 0) {\n return (1073741824 + number).toString(8)\n }\n\n // Convert decimal number to octal\n const result = parseInt(number, 10).toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Tests whether two values are equal.\n *\n * Category: Engineering\n *\n * @param {*} number1 The first number.\n * @param {*} number2 Optional. The second number. If omitted, number2 is assumed to be zero.\n * @returns\n */\nfunction DELTA(number1, number2) {\n // Set number2 to zero if undefined\n number2 = number2 === undefined ? 0 : number2;\n number1 = parseNumber(number1);\n number2 = parseNumber(number2);\n\n if (anyIsError(number1, number2)) {\n return value\n }\n\n // Return delta\n return number1 === number2 ? 1 : 0\n}\n\n// TODO: why is upper_bound not used ? The excel documentation has no examples with upper_bound\n/**\n * Returns the error function.\n *\n * Category: Engineering\n *\n * @param {*} lower_limit The lower bound for integrating ERF.\n * @param {*} upper_limit Optional. The upper bound for integrating ERF. If omitted, ERF integrates between zero and lower_limit.\n * @returns\n */\nfunction ERF(lower_limit, upper_limit) {\n // Set number2 to zero if undefined\n upper_limit = upper_limit === undefined ? 0 : upper_limit;\n\n lower_limit = parseNumber(lower_limit);\n upper_limit = parseNumber(upper_limit);\n\n if (anyIsError(lower_limit, upper_limit)) {\n return value\n }\n\n return jStat.erf(lower_limit)\n}\n\n// TODO\n\n/**\n * -- Not implemented --\n *\n * Returns the error function.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERF.PRECISE.\n * @returns\n */\nERF.PRECISE = () => {\n throw new Error('ERF.PRECISE is not implemented')\n};\n\n/**\n * Returns the complementary error function.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERFC.\n * @returns\n */\nfunction ERFC(x) {\n // Return error if x is not a number\n if (isNaN(x)) {\n return value\n }\n\n return jStat.erfc(x)\n}\n\n// TODO\n\n/**\n * -- Not implemented --\n *\n * Returns the complementary ERF function integrated between x and infinity.\n *\n * Category: Engineering\n *\n * @param {*} x The lower bound for integrating ERFC.PRECISE.\n * @returns\n */\nERFC.PRECISE = () => {\n throw new Error('ERFC.PRECISE is not implemented')\n};\n\n/**\n * Tests whether a number is greater than a threshold value.\n *\n * Category: Engineering\n *\n * @param {*} number The value to test against step.\n * @param {*} step Optional. The threshold value. If you omit a value for step, GESTEP uses zero.\n * @returns\n */\nfunction GESTEP(number, step) {\n step = step || 0;\n number = parseNumber(number);\n\n if (anyIsError(step, number)) {\n return number\n }\n\n // Return delta\n return number >= step ? 1 : 0\n}\n\n/**\n * Converts a hexadecimal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters. The most significant bit of number is the sign bit (40th bit from the right). The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, HEX2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction HEX2BIN(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Check if number is negative\n const negative = !!(number.length === 10 && number.substring(0, 1).toLowerCase() === 'f');\n\n // Convert hexadecimal number to decimal\n const decimal = negative ? parseInt(number, 16) - 1099511627776 : parseInt(number, 16);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2)\n }\n\n // Convert decimal number to binary\n const result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts a hexadecimal number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters (40 bits). The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction HEX2DEC(number) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert hexadecimal number to decimal\n const decimal = parseInt(number, 16);\n\n // Return decimal number\n return decimal >= 549755813888 ? decimal - 1099511627776 : decimal\n}\n\n/**\n * Converts a hexadecimal number to octal.\n *\n * Category: Engineering\n *\n * @param {*} number The hexadecimal number you want to convert. Number cannot contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, HEX2OCT uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction HEX2OCT(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert hexadecimal number to decimal\n const decimal = parseInt(number, 16);\n\n // Return error if number is positive and greater than 0x1fffffff (536870911)\n if (decimal > 536870911 && decimal < 1098974756864) {\n return num\n }\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 1098974756864) {\n return (decimal - 1098437885952).toString(8)\n }\n\n // Convert decimal number to octal\n const result = decimal.toString(8);\n\n // Return octal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Returns the absolute value (modulus) of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the absolute value.\n * @returns\n */\nfunction IMABS(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return absolute value of complex number\n return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))\n}\n\n/**\n * Returns the imaginary coefficient of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the imaginary coefficient.\n * @returns\n */\nfunction IMAGINARY(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return value\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0\n }\n\n // Handle special cases\n if (['i', 'j'].indexOf(inumber) >= 0) {\n return 1\n }\n\n // Force string type\n inumber = inumber + '';\n\n // Normalize imaginary coefficient\n inumber = inumber.replace('+i', '+1i').replace('-i', '-1i').replace('+j', '+1j').replace('-j', '-1j');\n\n // Lookup sign\n let plus = inumber.indexOf('+');\n let minus = inumber.indexOf('-');\n\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n const last = inumber.substring(inumber.length - 1, inumber.length);\n const unit = last === 'i' || last === 'j';\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return num\n }\n\n // Return imaginary coefficient of complex number\n if (plus >= 0) {\n return isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(plus + 1, inumber.length - 1))\n } else {\n return isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))\n ? num\n : -Number(inumber.substring(minus + 1, inumber.length - 1))\n }\n } else {\n if (unit) {\n return isNaN(inumber.substring(0, inumber.length - 1)) ? num : inumber.substring(0, inumber.length - 1)\n } else {\n return isNaN(inumber) ? num : 0\n }\n }\n}\n\n/**\n * Returns the argument theta, an angle expressed in radians.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the argument .\n * @returns\n */\nfunction IMARGUMENT(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return error if inumber is equal to zero\n if (x === 0 && y === 0) {\n return div0\n }\n\n // Return PI/2 if x is equal to zero and y is positive\n if (x === 0 && y > 0) {\n return Math.PI / 2\n }\n\n // Return -PI/2 if x is equal to zero and y is negative\n if (x === 0 && y < 0) {\n return -Math.PI / 2\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x > 0) {\n return 0\n }\n\n // Return zero if x is negative and y is equal to zero\n if (y === 0 && x < 0) {\n return -Math.PI\n }\n\n // Return argument of complex number\n if (x > 0) {\n return Math.atan(y / x)\n } else if (x < 0 && y >= 0) {\n return Math.atan(y / x) + Math.PI\n } else {\n return Math.atan(y / x) - Math.PI\n }\n}\n\n/**\n * Returns the complex conjugate of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the conjugate.\n * @returns\n */\nfunction IMCONJUGATE(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return conjugate of complex number\n return y !== 0 ? COMPLEX(x, -y, unit) : inumber\n}\n\n/**\n * Returns the cosine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cosine.\n * @returns\n */\nfunction IMCOS(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return cosine of complex number\n return COMPLEX(\n (Math.cos(x) * (Math.exp(y) + Math.exp(-y))) / 2,\n (-Math.sin(x) * (Math.exp(y) - Math.exp(-y))) / 2,\n unit\n )\n}\n\n/**\n * Returns the hyperbolic cosine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic cosine.\n * @returns\n */\nfunction IMCOSH(inumber) {\n // Lookup real and imaginary coefficients using exports.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return hyperbolic cosine of complex number\n return COMPLEX(\n (Math.cos(y) * (Math.exp(x) + Math.exp(-x))) / 2,\n (Math.sin(y) * (Math.exp(x) - Math.exp(-x))) / 2,\n unit\n )\n}\n\n/**\n * Returns the cotangent of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cotangent.\n * @returns\n */\nfunction IMCOT(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return cotangent of complex number\n return IMDIV(IMCOS(inumber), IMSIN(inumber))\n}\n\n/**\n * Returns the quotient of two complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} inumber1 The complex numerator or dividend.\n * @param {*} inumber2 The complex denominator or divisor.\n * @returns\n */\nfunction IMDIV(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const a = IMREAL(inumber1);\n const b = IMAGINARY(inumber1);\n const c = IMREAL(inumber2);\n const d = IMAGINARY(inumber2);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Lookup imaginary unit\n const unit1 = inumber1.substring(inumber1.length - 1);\n const unit2 = inumber2.substring(inumber2.length - 1);\n let unit = 'i';\n\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return error if inumber2 is null\n if (c === 0 && d === 0) {\n return num\n }\n\n // Return exponential of complex number\n const den = c * c + d * d;\n return COMPLEX((a * c + b * d) / den, (b * c - a * d) / den, unit)\n}\n\n/**\n * Returns the exponential of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the exponential.\n * @returns\n */\nfunction IMEXP(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n const e = Math.exp(x);\n return COMPLEX(e * Math.cos(y), e * Math.sin(y), unit)\n}\n\n/**\n * Returns the natural logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the natural logarithm.\n * @returns\n */\nfunction IMLN(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)), Math.atan(y / x), unit)\n}\n\n/**\n * Returns the base-10 logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the common logarithm.\n * @returns\n */\nfunction IMLOG10(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(10), Math.atan(y / x) / Math.log(10), unit)\n}\n\n/**\n * Returns the base-2 logarithm of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the base-2 logarithm.\n * @returns\n */\nfunction IMLOG2(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return exponential of complex number\n return COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(2), Math.atan(y / x) / Math.log(2), unit)\n}\n\n/**\n * Returns a complex number raised to an integer power.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number you want to raise to a power.\n * @param {*} number The power to which you want to raise the complex number.\n * @returns\n */\nfunction IMPOWER(inumber, number) {\n number = parseNumber(number);\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(number, x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Calculate power of modulus\n const p = Math.pow(IMABS(inumber), number);\n\n // Calculate argument\n const t = IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return COMPLEX(p * Math.cos(number * t), p * Math.sin(number * t), unit)\n}\n\n/**\n * Returns the product of complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} args inumber1, [inumber2], \u2026 Inumber1 is required, subsequent inumbers are not. 1 to 255 complex numbers to multiply.\n * @returns\n */\nfunction IMPRODUCT() {\n // Initialize result\n let result = arguments[0];\n\n if (!arguments.length) {\n return value\n }\n\n // Loop on all numbers\n for (let i = 1; i < arguments.length; i++) {\n // Lookup coefficients of two complex numbers\n const a = IMREAL(result);\n const b = IMAGINARY(result);\n const c = IMREAL(arguments[i]);\n const d = IMAGINARY(arguments[i]);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Complute product of two complex numbers\n result = COMPLEX(a * c - b * d, a * d + b * c);\n }\n\n // Return product of complex numbers\n return result\n}\n\n/**\n * Returns the real coefficient of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the real coefficient.\n * @returns\n */\nfunction IMREAL(inumber) {\n if (inumber === undefined || inumber === true || inumber === false) {\n return value\n }\n\n // Return 0 if inumber is equal to 0\n if (inumber === 0 || inumber === '0') {\n return 0\n }\n\n // Handle special cases\n if (['i', '+i', '1i', '+1i', '-i', '-1i', 'j', '+j', '1j', '+1j', '-j', '-1j'].indexOf(inumber) >= 0) {\n return 0\n }\n\n // Force String type\n inumber = inumber + '';\n\n // Lookup sign\n let plus = inumber.indexOf('+');\n let minus = inumber.indexOf('-');\n\n if (plus === 0) {\n plus = inumber.indexOf('+', 1);\n }\n\n if (minus === 0) {\n minus = inumber.indexOf('-', 1);\n }\n\n // Lookup imaginary unit\n const last = inumber.substring(inumber.length - 1, inumber.length);\n const unit = last === 'i' || last === 'j';\n\n if (plus >= 0 || minus >= 0) {\n // Return error if imaginary unit is neither i nor j\n if (!unit) {\n return num\n }\n\n // Return real coefficient of complex number\n if (plus >= 0) {\n return isNaN(inumber.substring(0, plus)) || isNaN(inumber.substring(plus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(0, plus))\n } else {\n return isNaN(inumber.substring(0, minus)) || isNaN(inumber.substring(minus + 1, inumber.length - 1))\n ? num\n : Number(inumber.substring(0, minus))\n }\n } else {\n if (unit) {\n return isNaN(inumber.substring(0, inumber.length - 1)) ? num : 0\n } else {\n return isNaN(inumber) ? num : inumber\n }\n }\n}\n\n/**\n * Returns the secant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the secant.\n * @returns\n */\nfunction IMSEC(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return secant of complex number\n return IMDIV('1', IMCOS(inumber))\n}\n\n/**\n * Returns the hyperbolic secant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic secant.\n * @returns\n */\nfunction IMSECH(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return hyperbolic secant of complex number\n return IMDIV('1', IMCOSH(inumber))\n}\n\n/**\n * Returns the sine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the sine.\n * @returns\n */\nfunction IMSIN(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return sine of complex number\n return COMPLEX(\n (Math.sin(x) * (Math.exp(y) + Math.exp(-y))) / 2,\n (Math.cos(x) * (Math.exp(y) - Math.exp(-y))) / 2,\n unit\n )\n}\n\n/**\n * Returns the hyperbolic sine of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic sine.\n * @returns\n */\nfunction IMSINH(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Return hyperbolic sine of complex number\n return COMPLEX(\n (Math.cos(y) * (Math.exp(x) - Math.exp(-x))) / 2,\n (Math.sin(y) * (Math.exp(x) + Math.exp(-x))) / 2,\n unit\n )\n}\n\n/**\n * Returns the square root of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the square root.\n * @returns\n */\nfunction IMSQRT(inumber) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Lookup imaginary unit\n let unit = inumber.substring(inumber.length - 1);\n unit = unit === 'i' || unit === 'j' ? unit : 'i';\n\n // Calculate power of modulus\n const s = Math.sqrt(IMABS(inumber));\n\n // Calculate argument\n const t = IMARGUMENT(inumber);\n\n // Return exponential of complex number\n return COMPLEX(s * Math.cos(t / 2), s * Math.sin(t / 2), unit)\n}\n\n/**\n * Returns the cosecant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the cosecant.\n * @returns\n */\nfunction IMCSC(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return num\n }\n\n // Return cosecant of complex number\n return IMDIV('1', IMSIN(inumber))\n}\n\n/**\n * Returns the hyperbolic cosecant of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the hyperbolic cosecant.\n * @returns\n */\nfunction IMCSCH(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n // Return error if either coefficient is not a number\n if (anyIsError(x, y)) {\n return num\n }\n\n // Return hyperbolic cosecant of complex number\n return IMDIV('1', IMSINH(inumber))\n}\n\n/**\n * Returns the difference between two complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} inumber1 The complex number from which to subtract inumber2.\n * @param {*} inumber2 The complex number to subtract from inumber1.\n * @returns\n */\nfunction IMSUB(inumber1, inumber2) {\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const a = IMREAL(inumber1);\n const b = IMAGINARY(inumber1);\n const c = IMREAL(inumber2);\n const d = IMAGINARY(inumber2);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Lookup imaginary unit\n const unit1 = inumber1.substring(inumber1.length - 1);\n const unit2 = inumber2.substring(inumber2.length - 1);\n let unit = 'i';\n\n if (unit1 === 'j') {\n unit = 'j';\n } else if (unit2 === 'j') {\n unit = 'j';\n }\n\n // Return _ of two complex numbers\n return COMPLEX(a - c, b - d, unit)\n}\n\n/**\n * Returns the sum of complex numbers.\n *\n * Category: Engineering\n *\n * @param {*} args inumber1, [inumber2], ... Inumber1 is required, subsequent numbers are not. 1 to 255 complex numbers to add.\n * @returns\n */\nfunction IMSUM() {\n if (!arguments.length) {\n return value\n }\n\n const args = flatten(arguments);\n\n // Initialize result\n let result = args[0];\n\n // Loop on all numbers\n for (let i = 1; i < args.length; i++) {\n // Lookup coefficients of two complex numbers\n const a = IMREAL(result);\n const b = IMAGINARY(result);\n const c = IMREAL(args[i]);\n const d = IMAGINARY(args[i]);\n\n if (anyIsError(a, b, c, d)) {\n return value\n }\n\n // Complute product of two complex numbers\n result = COMPLEX(a + c, b + d);\n }\n\n // Return sum of complex numbers\n return result\n}\n\n/**\n * Returns the tangent of a complex number.\n *\n * Category: Engineering\n *\n * @param {*} inumber A complex number for which you want the tangent.\n * @returns\n */\nfunction IMTAN(inumber) {\n // Return error if inumber is a logical value\n if (inumber === true || inumber === false) {\n return value\n }\n\n // Lookup real and imaginary coefficients using Formula.js [http://formulajs.org]\n const x = IMREAL(inumber);\n const y = IMAGINARY(inumber);\n\n if (anyIsError(x, y)) {\n return value\n }\n\n // Return tangent of complex number\n return IMDIV(IMSIN(inumber), IMCOS(inumber))\n}\n\n/**\n * Converts an octal number to binary.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, OCT2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction OCT2BIN(number, places) {\n // Return error if number is not hexadecimal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Check if number is negative\n const negative = !!(number.length === 10 && number.substring(0, 1) === '7');\n\n // Convert octal number to decimal\n const decimal = negative ? parseInt(number, 8) - 1073741824 : parseInt(number, 8);\n\n // Return error if number is lower than -512 or greater than 511\n if (decimal < -512 || decimal > 511) {\n return num\n }\n\n // Ignore places and return a 10-character binary number if number is negative\n if (negative) {\n return '1' + REPT('0', 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2)\n }\n\n // Convert decimal number to binary\n const result = decimal.toString(2);\n\n // Return binary number using the minimum number of characters necessary if places is undefined\n if (typeof places === 'undefined') {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\n/**\n * Converts an octal number to decimal.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @returns\n */\nfunction OCT2DEC(number) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert octal number to decimal\n const decimal = parseInt(number, 8);\n\n // Return decimal number\n return decimal >= 536870912 ? decimal - 1073741824 : decimal\n}\n\n/**\n * Converts an octal number to hexadecimal.\n *\n * Category: Engineering\n *\n * @param {*} number The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation.\n * @param {*} places Optional. The number of characters to use. If places is omitted, OCT2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).\n * @returns\n */\nfunction OCT2HEX(number, places) {\n // Return error if number is not octal or contains more than ten characters (10 digits)\n if (!/^[0-7]{1,10}$/.test(number)) {\n return num\n }\n\n // Convert octal number to decimal\n const decimal = parseInt(number, 8);\n\n // Ignore places and return a 10-character octal number if number is negative\n if (decimal >= 536870912) {\n return 'ff' + (decimal + 3221225472).toString(16)\n }\n\n // Convert decimal number to hexadecimal\n const result = decimal.toString(16);\n\n // Return hexadecimal number using the minimum number of characters necessary if places is undefined\n if (places === undefined) {\n return result\n } else {\n // Return error if places is nonnumeric\n if (isNaN(places)) {\n return value\n }\n\n // Return error if places is negative\n if (places < 0) {\n return num\n }\n\n // Truncate places in case it is not an integer\n places = Math.floor(places);\n\n // Pad return value with leading 0s (zeros) if necessary (using Underscore.string)\n return places >= result.length ? REPT('0', places - result.length) + result : num\n }\n}\n\nconst BETADIST = BETA.DIST;\nconst BETAINV = BETA.INV;\nconst BINOMDIST = BINOM.DIST;\nconst CEILINGMATH = CEILING.MATH;\nconst CEILINGPRECISE = CEILING.PRECISE;\nconst CHIDIST = CHISQ.DIST;\nconst CHIDISTRT = CHISQ.DIST.RT;\nconst CHIINV = CHISQ.INV;\nconst CHIINVRT = CHISQ.INV.RT;\nconst CHITEST = CHISQ.TEST;\nconst COVAR = COVARIANCE.P;\nconst COVARIANCEP = COVARIANCE.P;\nconst COVARIANCES = COVARIANCE.S;\nconst CRITBINOM = BINOM.INV;\nconst ERFCPRECISE = ERFC.PRECISE;\nconst ERFPRECISE = ERF.PRECISE;\nconst EXPONDIST = EXPON.DIST;\nconst FDIST = F.DIST;\nconst FDISTRT = F.DIST.RT;\nconst FINV = F.INV;\nconst FINVRT = F.INV.RT;\nconst FLOORMATH = FLOOR.MATH;\nconst FLOORPRECISE = FLOOR.PRECISE;\nconst FTEST = F.TEST;\nconst GAMMADIST = GAMMA.DIST;\nconst GAMMAINV = GAMMA.INV;\nconst GAMMALNPRECISE = GAMMALN.PRECISE;\nconst HYPGEOMDIST = HYPGEOM.DIST;\nconst LOGINV = LOGNORM.INV;\nconst LOGNORMDIST = LOGNORM.DIST;\nconst LOGNORMINV = LOGNORM.INV;\nconst MODEMULT = MODE.MULT;\nconst MODESNGL = MODE.SNGL;\nconst NEGBINOMDIST = NEGBINOM.DIST;\nconst NETWORKDAYSINTL = NETWORKDAYS.INTL;\nconst NORMDIST = NORM.DIST;\nconst NORMINV = NORM.INV;\nconst NORMSDIST = NORM.S.DIST;\nconst NORMSINV = NORM.S.INV;\nconst PERCENTILEEXC = PERCENTILE.EXC;\nconst PERCENTILEINC = PERCENTILE.INC;\nconst PERCENTRANKEXC = PERCENTRANK.EXC;\nconst PERCENTRANKINC = PERCENTRANK.INC;\nconst POISSONDIST = POISSON.DIST;\nconst QUARTILEEXC = QUARTILE.EXC;\nconst QUARTILEINC = QUARTILE.INC;\nconst RANKAVG = RANK.AVG;\nconst RANKEQ = RANK.EQ;\nconst SKEWP = SKEW.P;\nconst STDEVP = STDEV.P;\nconst STDEVS = STDEV.S;\nconst TDIST = T$1.DIST;\nconst TDISTRT = T$1.DIST.RT;\nconst TINV = T$1.INV;\nconst TTEST = T$1.TEST;\nconst VARP = VAR.P;\nconst VARS = VAR.S;\nconst WEIBULLDIST = WEIBULL.DIST;\nconst WORKDAYINTL = WORKDAY.INTL;\nconst ZTEST = Z.TEST;\n\nfunction compact(array) {\n const result = [];\n\n arrayEach(array, (value) => {\n if (value) {\n result.push(value);\n }\n });\n\n return result\n}\n\nfunction findResultIndex(database, criterias) {\n const matches = {};\n\n for (let i = 1; i < database[0].length; ++i) {\n matches[i] = true;\n }\n\n let maxCriteriaLength = criterias[0].length;\n\n for (let i = 1; i < criterias.length; ++i) {\n if (criterias[i].length > maxCriteriaLength) {\n maxCriteriaLength = criterias[i].length;\n }\n }\n\n for (let k = 1; k < database.length; ++k) {\n for (let l = 1; l < database[k].length; ++l) {\n let currentCriteriaResult = false;\n let hasMatchingCriteria = false;\n\n for (let j = 0; j < criterias.length; ++j) {\n const criteria = criterias[j];\n\n if (criteria.length < maxCriteriaLength) {\n continue\n }\n\n const criteriaField = criteria[0];\n\n if (database[k][0] !== criteriaField) {\n continue\n }\n\n hasMatchingCriteria = true;\n\n for (let p = 1; p < criteria.length; ++p) {\n if (!currentCriteriaResult) {\n const isWildcard = criteria[p] === void 0 || criteria[p] === '*';\n\n if (isWildcard) {\n currentCriteriaResult = true;\n } else {\n const tokenizedCriteria = parse(criteria[p] + '');\n const tokens = [createToken(database[k][l], TOKEN_TYPE_LITERAL)].concat(\n tokenizedCriteria\n );\n\n currentCriteriaResult = compute(tokens);\n }\n }\n }\n }\n\n if (hasMatchingCriteria) {\n matches[l] = matches[l] && currentCriteriaResult;\n }\n }\n }\n\n const result = [];\n\n for (let n = 0; n < database[0].length; ++n) {\n if (matches[n]) {\n result.push(n - 1);\n }\n }\n\n return result\n}\n\n// Database functions\n/**\n * Returns the average of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database Range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria Range of values that contains the conditions you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DAVERAGE(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let sum = 0;\n\n arrayEach(resultIndexes, (value) => {\n sum += targetFields[value];\n });\n\n return resultIndexes.length === 0 ? div0 : sum / resultIndexes.length\n}\n\n/**\n * Counts the values that contain numbers in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as the argument includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DCOUNT(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return COUNT(targetValues)\n}\n\n/**\n * Counts nonblank values in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Optional. Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DCOUNTA(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return COUNTA(targetValues)\n}\n\n/**\n * Extracts from a database a single record that matches the specified criteria.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DGET(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n // Return error if no record meets the criteria\n if (resultIndexes.length === 0) {\n return value\n }\n // Returns the #NUM! error value because more than one record meets the\n // criteria\n if (resultIndexes.length > 1) {\n return num\n }\n\n return targetFields[resultIndexes[0]]\n}\n\n/**\n * Returns the maximum value from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DMAX(database, field, criteria) {\n // Return error if field is not a number and not a string\n\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let maxValue = targetFields[resultIndexes[0]];\n\n arrayEach(resultIndexes, (value) => {\n if (maxValue < targetFields[value]) {\n maxValue = targetFields[value];\n }\n });\n\n return maxValue\n}\n\n/**\n * Returns the minimum value from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DMIN(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let minValue = targetFields[resultIndexes[0]];\n\n arrayEach(resultIndexes, (value) => {\n if (minValue > targetFields[value]) {\n minValue = targetFields[value];\n }\n });\n\n return minValue\n}\n\n/**\n * Multiplies the values in a particular field of records that match the criteria in a database.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DPRODUCT(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n targetValues = compact(targetValues);\n\n let result = 1;\n\n arrayEach(targetValues, (value) => {\n result *= value;\n });\n\n return result\n}\n\n/**\n * Estimates the standard deviation based on a sample of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSTDEV(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n targetValues = compact(targetValues);\n\n return STDEV.S(targetValues)\n}\n\n/**\n * Calculates the standard deviation based on the entire population of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSTDEVP(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n let targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n targetValues = compact(targetValues);\n\n return STDEV.P(targetValues)\n}\n\n/**\n * Adds the numbers in the field column of records in the database that match the criteria.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria Is the range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DSUM(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return SUM(targetValues)\n}\n\n/**\n * Estimates variance based on a sample from selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DVAR(database, field, criteria) {\n // Return error if field is not a number and not a string\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return VAR.S(targetValues)\n}\n\n/**\n * Calculates variance based on the entire population of selected database entries.\n *\n * Category: Database\n *\n * @param {*} database The range of values that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.\n * @param {*} field Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as \"Age\" or \"Yield,\" or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.\n * @param {*} criteria The range of values that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one value below the column label in which you specify a condition for the column.\n * @returns\n */\nfunction DVARP(database, field, criteria) {\n // Return error if field is not a number and not a string\n\n if (isNaN(field) && typeof field !== 'string') {\n return value\n }\n\n const resultIndexes = findResultIndex(database, criteria);\n let targetFields = [];\n\n if (typeof field === 'string') {\n const index = findField(database, field);\n targetFields = rest(database[index]);\n } else {\n targetFields = rest(database[field]);\n }\n\n const targetValues = [];\n\n arrayEach(resultIndexes, (value) => {\n targetValues.push(targetFields[value]);\n });\n\n return VAR.P(targetValues)\n}\n\nfunction validDate(d) {\n return d && d.getTime && !isNaN(d.getTime())\n}\n\nfunction ensureDate(d) {\n return d instanceof Date ? d : new Date(d)\n}\n\n// Calculate last coupon date before settlement\nfunction lastCoupDateBeforeSettlement(settlement, maturity, frequency) {\n let date = parseDate(maturity);\n date.setFullYear(settlement.getFullYear());\n\n if (date < settlement) {\n date.setFullYear(date.getFullYear() + 1);\n }\n\n // Adjust the date based on the coupon frequency until date is later than settlement\n while (date > settlement) {\n date.setMonth(date.getMonth() + -12 / frequency);\n }\n\n return date\n}\n\nfunction validateFrequency(frequency) {\n frequency = parseNumber(frequency);\n\n // Return error if frequency is neither 1, 2, or 4\n if ([1, 2, 4].indexOf(frequency) === -1) {\n return num\n }\n\n return frequency\n}\n\nfunction validateBasis(basis) {\n basis = parseNumber(basis);\n\n // Return error if basis is neither 0, 1, 2, 3, or 4\n if ([0, 1, 2, 3, 4].indexOf(basis) === -1) {\n return num\n }\n\n return basis\n}\n\n/**\n * Returns the accrued interest for a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} issue The security's issue date.\n * @param {*} first_interest The security's first interest date.\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} par The security's par value. If you omit par, ACCRINT uses $1,000.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @param {*} calc_method Optional. Not implemented in formulajs. A logical value that specifies the way to calculate the total accrued interest when the date of settlement is later than the date of first_interest. A value of TRUE (1) returns the total accrued interest from issue to settlement. A value of FALSE (0) returns the accrued interest from first_interest to settlement. If you do not enter the argument, it defaults to TRUE.\n * @returns\n */\nfunction ACCRINT(issue, first_interest, settlement, rate, par, frequency, basis) {\n // Return error if either date is invalid\n issue = ensureDate(issue);\n first_interest = ensureDate(first_interest);\n settlement = ensureDate(settlement);\n frequency = validateFrequency(frequency);\n basis = validateBasis(basis);\n\n if (anyError(frequency, basis)) {\n return num\n }\n\n if (!validDate(issue) || !validDate(first_interest) || !validDate(settlement)) {\n return value\n }\n\n // Return error if either rate or par are lower than or equal to zero\n if (rate <= 0 || par <= 0) {\n return num\n }\n\n // Return error if settlement is before or equal to issue\n if (settlement <= issue) {\n return num\n }\n\n // Set default values\n par = par || 0;\n basis = basis || 0;\n\n // Compute accrued interest\n return par * rate * YEARFRAC(issue, settlement, basis)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the accrued interest for a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} issue The security's issue date.\n * @param {*} settlement The security's maturity date.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} par The security's par value. If you omit par, ACCRINTM uses $1,000.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ACCRINTM() {\n throw new Error('ACCRINTM is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation for each accounting period by using a depreciation coefficient.\n *\n * Category: Financial\n *\n * @param {*} cost The cost of the asset.\n * @param {*} date_purchased The date of the purchase of the asset.\n * @param {*} first_period The date of the end of the first period.\n * @param {*} salvage The salvage value at the end of the life of the asset.\n * @param {*} period The period.\n * @param {*} rate The rate of depreciation.\n * @param {*} basis Optional. The year basis to be used.\n * @returns\n */\nfunction AMORDEGRC() {\n throw new Error('AMORDEGRC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation for each accounting period.\n *\n * Category: Financial\n *\n * @param {*} cost The cost of the asset.\n * @param {*} date_purchased The date of the purchase of the asset.\n * @param {*} first_period The date of the end of the first period.\n * @param {*} salvage The salvage value at the end of the life of the asset.\n * @param {*} period The period.\n * @param {*} rate The rate of depreciation.\n * @param {*} basis Optional. The year basis to be used.\n * @returns\n */\nfunction AMORLINC() {\n throw new Error('AMORLINC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of days from the beginning of the coupon period to the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYBS() {\n throw new Error('COUPDAYBS is not implemented')\n}\n\n/**\n *\n * Returns the number of days in the coupon period that contains the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYS(settlement, maturity, frequency, basis) {\n basis = validateBasis(basis);\n frequency = validateFrequency(frequency);\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n\n if (anyError(settlement, maturity)) {\n return value\n }\n\n if (anyError(frequency, basis) || settlement >= maturity) {\n return num\n }\n\n if (basis === 1) {\n let date = lastCoupDateBeforeSettlement(settlement, maturity, frequency);\n let nextDate = parseDate(date);\n\n // Set month of the nextDate to the next coupon month\n nextDate.setMonth(nextDate.getMonth() + 12 / frequency);\n\n return DATEDIF(date, nextDate, 'D')\n }\n\n let numOfDays;\n\n switch (basis) {\n case 0:\n case 2:\n case 4:\n numOfDays = 360;\n break\n case 3:\n numOfDays = 365;\n break\n default:\n return num\n }\n\n return numOfDays / frequency\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of days from the settlement date to the next coupon date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPDAYSNC() {\n throw new Error('COUPDAYSNC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the next coupon date after the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPNCD() {\n throw new Error('COUPNCD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the number of coupons payable between the settlement date and maturity date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPNUM() {\n throw new Error('COUPNUM is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the previous coupon date before the settlement date.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction COUPPCD() {\n throw new Error('COUPPCD is not implemented')\n}\n\n/**\n * Returns the cumulative interest paid between two periods.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate.\n * @param {*} nper The total number of payment periods.\n * @param {*} pv The present value.\n * @param {*} start_period The first period in the calculation. Payment periods are numbered beginning with 1.\n * @param {*} end_period The last period in the calculation.\n * @param {*} type The timing of the payment.\n * @returns\n */\nfunction CUMIPMT(rate, nper, pv, start_period, end_period, type) {\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, nper, pv)) {\n return value\n }\n\n if (rate <= 0 || nper <= 0 || pv <= 0) {\n return num\n }\n\n if (start_period < 1 || end_period < 1 || start_period > end_period) {\n return num\n }\n\n if (type !== 0 && type !== 1) {\n return num\n }\n\n const payment = PMT(rate, nper, pv, 0, type);\n let interest = 0;\n\n if (start_period === 1) {\n if (type === 0) {\n interest = -pv;\n }\n\n start_period++;\n }\n\n for (let i = start_period; i <= end_period; i++) {\n interest += type === 1 ? FV(rate, i - 2, payment, pv, 1) - payment : FV(rate, i - 1, payment, pv, 0);\n }\n\n interest *= rate;\n\n return interest\n}\n\n/**\n * Returns the cumulative principal paid on a loan between two periods.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate.\n * @param {*} nper The total number of payment periods.\n * @param {*} pv The present value.\n * @param {*} start_period The first period in the calculation. Payment periods are numbered beginning with 1.\n * @param {*} end_period The last period in the calculation.\n * @param {*} type The timing of the payment.\n * @returns\n */\nfunction CUMPRINC(rate, nper, pv, start_period, end, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n // Credits: Hannes Stiebitzhofer for the translations of function and variable names\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, nper, pv)) {\n return value\n }\n\n // Return error if either rate, nper, or value are lower than or equal to zero\n if (rate <= 0 || nper <= 0 || pv <= 0) {\n return num\n }\n\n // Return error if start < 1, end < 1, or start > end\n if (start_period < 1 || end < 1 || start_period > end) {\n return num\n }\n\n // Return error if type is neither 0 nor 1\n if (type !== 0 && type !== 1) {\n return num\n }\n\n // Compute cumulative principal\n const payment = PMT(rate, nper, pv, 0, type);\n let principal = 0;\n\n if (start_period === 1) {\n principal = type === 0 ? payment + pv * rate : payment;\n\n start_period++;\n }\n\n for (let i = start_period; i <= end; i++) {\n principal +=\n type > 0\n ? payment - (FV(rate, i - 2, payment, pv, 1) - payment) * rate\n : payment - FV(rate, i - 1, payment, pv, 0) * rate;\n }\n\n // Return cumulative principal\n return principal\n}\n\n/**\n * Returns the depreciation of an asset for a specified period by using the fixed-declining balance method.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).\n * @param {*} period The period for which you want to calculate the depreciation. Period must use the same units as life.\n * @param {*} month Optional. The number of months in the first year. If month is omitted, it is assumed to be 12.\n * @returns\n */\nfunction DB(cost, salvage, life, period, month) {\n // Initialize month\n month = month === undefined ? 12 : month;\n\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n period = parseNumber(period);\n month = parseNumber(month);\n\n if (anyIsError(cost, salvage, life, period, month)) {\n return value\n }\n\n // Return error if any of the parameters is negative\n if (cost < 0 || salvage < 0 || life < 0 || period < 0) {\n return num\n }\n\n // Return error if month is not an integer between 1 and 12\n if ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].indexOf(month) === -1) {\n return num\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return num\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0\n }\n\n // Rate is rounded to three decimals places\n const rate = (1 - Math.pow(salvage / cost, 1 / life)).toFixed(3);\n\n // Compute initial depreciation\n const initial = (cost * rate * month) / 12;\n\n // Compute total depreciation\n let total = initial;\n let current = 0;\n const ceiling = period === life ? life - 1 : period;\n\n for (let i = 2; i <= ceiling; i++) {\n current = (cost - total) * rate;\n total += current;\n }\n\n // Depreciation for the first and last periods are special cases\n if (period === 1) {\n // First period\n return initial\n } else if (period === life) {\n // Last period\n\n return (cost - total) * rate\n } else {\n return current\n }\n}\n\n/**\n * Returns the depreciation of an asset for a specified period by using the double-declining balance method or some other method that you specify.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset). This value can be 0.\n * @param {*} life The number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).\n * @param {*} period The period for which you want to calculate the depreciation. Period must use the same units as life.\n * @param {*} factor Optional. The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method).\n * @returns\n */\nfunction DDB(cost, salvage, life, period, factor) {\n // Initialize factor\n factor = factor === undefined ? 2 : factor;\n\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n period = parseNumber(period);\n factor = parseNumber(factor);\n\n if (anyIsError(cost, salvage, life, period, factor)) {\n return value\n }\n\n // Return error if any of the parameters is negative or if factor is null\n if (cost < 0 || salvage < 0 || life < 0 || period < 0 || factor <= 0) {\n return num\n }\n\n // Return error if period is greater than life\n if (period > life) {\n return num\n }\n\n // Return 0 (zero) if salvage is greater than or equal to cost\n if (salvage >= cost) {\n return 0\n }\n\n // Compute depreciation\n let total = 0;\n let current = 0;\n\n for (let i = 1; i <= period; i++) {\n current = Math.min((cost - total) * (factor / life), cost - salvage - total);\n total += current;\n }\n\n // Return depreciation\n return current\n}\n\n/**\n * Returns the discount rate for a security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction DISC(settlement, maturity, pr, redemption, basis) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n pr = parseNumber(pr);\n redemption = parseNumber(redemption);\n basis = parseNumber(basis);\n\n basis = basis || 0;\n\n if (anyIsError(settlement, maturity, pr, redemption, basis)) {\n return value\n }\n\n if (pr <= 0 || redemption <= 0) {\n return num\n }\n\n if (settlement >= maturity) {\n return value\n }\n\n let basisVal, diff;\n switch (basis) {\n case 0:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, false);\n break\n case 1:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 2:\n basisVal = 360;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 3:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 4:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, true);\n break\n default:\n return num\n }\n\n return (((redemption - pr) / redemption) * basisVal) / diff\n}\n\n/**\n * Converts a dollar price, expressed as a fraction, into a dollar price, expressed as a decimal number.\n *\n * Category: Financial\n *\n * @param {*} fractional_dollar A number expressed as an integer part and a fraction part, separated by a decimal symbol.\n * @param {*} fraction The integer to use in the denominator of the fraction.\n * @returns\n */\nfunction DOLLARDE(fractional_dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n fractional_dollar = parseNumber(fractional_dollar);\n fraction = parseNumber(fraction);\n\n if (anyIsError(fractional_dollar, fraction)) {\n return value\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return num\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return div0\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n let result = parseInt(fractional_dollar, 10);\n\n // Add decimal part\n result += ((fractional_dollar % 1) * Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN10))) / fraction;\n\n // Round result\n const power = Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN2) + 1);\n result = Math.round(result * power) / power;\n\n // Return converted dollar price\n return result\n}\n\n/**\n * Converts a dollar price, expressed as a decimal number, into a dollar price, expressed as a fraction.\n *\n * Category: Financial\n *\n * @param {*} decimal_dollar A decimal number.\n * @param {*} fraction The integer to use in the denominator of a fraction.\n * @returns\n */\nfunction DOLLARFR(decimal_dollar, fraction) {\n // Credits: algorithm inspired by Apache OpenOffice\n decimal_dollar = parseNumber(decimal_dollar);\n fraction = parseNumber(fraction);\n\n if (anyIsError(decimal_dollar, fraction)) {\n return value\n }\n\n // Return error if fraction is negative\n if (fraction < 0) {\n return num\n }\n\n // Return error if fraction is greater than or equal to 0 and less than 1\n if (fraction >= 0 && fraction < 1) {\n return div0\n }\n\n // Truncate fraction if it is not an integer\n fraction = parseInt(fraction, 10);\n\n // Compute integer part\n let result = parseInt(decimal_dollar, 10);\n\n // Add decimal part\n result += (decimal_dollar % 1) * Math.pow(10, -Math.ceil(Math.log(fraction) / Math.LN10)) * fraction;\n\n // Return converted dollar price\n return result\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual duration of a security with periodic interest payments.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} coupon The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction DURATION() {\n throw new Error('DURATION is not implemented')\n}\n\n/**\n * Returns the effective annual interest rate.\n *\n * Category: Financial\n *\n * @param {*} nominal_rate The nominal interest rate.\n * @param {*} npery The number of compounding periods per year.\n * @returns\n */\nfunction EFFECT(nominal_rate, npery) {\n nominal_rate = parseNumber(nominal_rate);\n npery = parseNumber(npery);\n\n if (anyIsError(nominal_rate, npery)) {\n return value\n }\n\n // Return error if rate <=0 or periods < 1\n if (nominal_rate <= 0 || npery < 1) {\n return num\n }\n\n // Truncate periods if it is not an integer\n npery = parseInt(npery, 10);\n\n // Return effective annual interest rate\n return Math.pow(1 + nominal_rate / npery, npery) - 1\n}\n\n/**\n * Returns the future value of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pmt The payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes. If pmt is omitted, you must include the pv argument.\n * @param {*} pv Optional. The present value, or the lump-sum amount that a series of future payments is worth right now. If pv is omitted, it is assumed to be 0 (zero), and you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.\n * @returns\n */\nfunction FV(rate, nper, payment, value$1, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n value$1 = value$1 || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n payment = parseNumber(payment);\n value$1 = parseNumber(value$1);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, payment, value$1, type)) {\n return value\n }\n\n // Return future value\n let result;\n\n if (rate === 0) {\n result = value$1 + payment * nper;\n } else {\n const term = Math.pow(1 + rate, nper);\n\n result =\n type === 1\n ? value$1 * term + (payment * (1 + rate) * (term - 1)) / rate\n : value$1 * term + (payment * (term - 1)) / rate;\n }\n\n return -result\n}\n\n/**\n * Returns the future value of an initial principal after applying a series of compound interest rates.\n *\n * Category: Financial\n *\n * @param {*} principal The present value.\n * @param {*} schedule An array of interest rates to apply.\n * @returns\n */\nfunction FVSCHEDULE(principal, schedule) {\n principal = parseNumber(principal);\n schedule = parseNumberArray(flatten(schedule));\n\n if (anyIsError(principal, schedule)) {\n return value\n }\n\n const n = schedule.length;\n let future = principal;\n\n // Apply all interests in schedule\n\n for (let i = 0; i < n; i++) {\n // Apply scheduled interest\n future *= 1 + schedule[i];\n }\n\n // Return future value\n return future\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the interest rate for a fully invested security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} investment The amount invested in the security.\n * @param {*} redemption The amount to be received at maturity.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction INTRATE() {\n throw new Error('INTRATE is not implemented')\n}\n\n/**\n * Returns the interest payment for an investment for a given period.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} per The period for which you want to find the interest and must be in the range 1 to nper.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pv The present value, or the lump-sum amount that a series of future payments is worth right now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.\n * @returns\n */\nfunction IPMT(rate, per, nper, pv, fv, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n per = parseNumber(per);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, per, nper, pv, fv, type)) {\n return value\n }\n\n // Compute payment\n const payment = PMT(rate, nper, pv, fv, type);\n\n // Compute interest\n let interest =\n per === 1\n ? type === 1\n ? 0\n : -pv\n : type === 1\n ? FV(rate, per - 2, payment, pv, 1) - payment\n : FV(rate, per - 1, payment, pv, 0);\n\n // Return interest\n return interest * rate\n}\n\n/**\n * Returns the internal rate of return for a series of cash flows.\n *\n * Category: Financial\n *\n * @param {*} values An array or a reference to values that contain numbers for which you want to calculate the internal rate of return.\n - Values must contain at least one positive value and one negative value to calculate the internal rate of return.\n - IRR uses the order of values to interpret the order of cash flows. Be sure to enter your payment and income values in the sequence you want.\n - If an array or reference argument contains text, logical values, or empty values, those values are ignored.\n * @param {*} guess Optional. A number that you guess is close to the result of IRR.\n - Microsoft Excel uses an iterative technique for calculating IRR. Starting with guess, IRR cycles through the calculation until the result is accurate within 0.00001 percent. If IRR can't find a result that works after 20 tries, the #NUM! error value is returned.\n - In most cases you do not need to provide guess for the IRR calculation. If guess is omitted, it is assumed to be 0.1 (10 percent).\n - If IRR gives the #NUM! error value, or if the result is not close to what you expected, try again with a different value for guess.\n * @returns\n */\nfunction IRR(values, guess) {\n // Credits: algorithm inspired by Apache OpenOffice\n guess = guess || 0;\n\n values = parseNumberArray(flatten(values));\n guess = parseNumber(guess);\n\n if (anyIsError(values, guess)) {\n return value\n }\n\n // Calculates the resulting amount\n const irrResult = (values, dates, rate) => {\n const r = rate + 1;\n let result = values[0];\n\n for (let i = 1; i < values.length; i++) {\n result += values[i] / Math.pow(r, (dates[i] - dates[0]) / 365);\n }\n\n return result\n };\n\n // Calculates the first derivation\n const irrResultDeriv = (values, dates, rate) => {\n const r = rate + 1;\n let result = 0;\n\n for (let i = 1; i < values.length; i++) {\n const frac = (dates[i] - dates[0]) / 365;\n result -= (frac * values[i]) / Math.pow(r, frac + 1);\n }\n\n return result\n };\n\n // Initialize dates and check that values contains at least one positive value and one negative value\n const dates = [];\n let positive = false;\n let negative = false;\n\n for (let i = 0; i < values.length; i++) {\n dates[i] = i === 0 ? 0 : dates[i - 1] + 365;\n\n if (values[i] > 0) {\n positive = true;\n }\n\n if (values[i] < 0) {\n negative = true;\n }\n }\n\n // Return error if values does not contain at least one positive value and one negative value\n if (!positive || !negative) {\n return num\n }\n\n // Initialize guess and resultRate\n guess = guess === undefined ? 0.1 : guess;\n let resultRate = guess;\n\n // Set maximum epsilon for end of iteration\n const epsMax = 1e-10;\n\n // Implement Newton's method\n let newRate, epsRate, resultValue;\n let contLoop = true;\n do {\n resultValue = irrResult(values, dates, resultRate);\n newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n epsRate = Math.abs(newRate - resultRate);\n resultRate = newRate;\n contLoop = epsRate > epsMax && Math.abs(resultValue) > epsMax;\n } while (contLoop)\n\n // Return internal rate of return\n return resultRate\n}\n\n/**\n * Calculates the interest paid during a specific period of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate for the investment.\n * @param {*} per The period for which you want to find the interest, and must be between 1 and Nper.\n * @param {*} nper The total number of payment periods for the investment.\n * @param {*} pv The present value of the investment. For a loan, Pv is the loan amount.\n *\n * @returns\n */\nfunction ISPMT(rate, per, nper, pv) {\n rate = parseNumber(rate);\n per = parseNumber(per);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n\n if (anyIsError(rate, per, nper, pv)) {\n return value\n }\n\n // Return interest\n return pv * rate * (per / nper - 1)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the Macauley modified duration for a security with an assumed par value of $100.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} coupon The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction MDURATION() {\n throw new Error('MDURATION is not implemented')\n}\n\n/**\n * Returns the internal rate of return where positive and negative cash flows are financed at different rates.\n *\n * Category: Financial\n *\n * @param {*} values An array or a reference to values that contain numbers. These numbers represent a series of payments (negative values) and income (positive values) occurring at regular periods.\n - Values must contain at least one positive value and one negative value to calculate the modified internal rate of return. Otherwise, MIRR returns the #DIV/0! error value.\n - If an array or reference argument contains text, logical values, or empty values, those values are ignored; however, values with the value zero are included.\n * @param {*} finance_rate The interest rate you pay on the money used in the cash flows.\n * @param {*} reinvest_rate The interest rate you receive on the cash flows as you reinvest them.\n * @returns\n */\nfunction MIRR(values, finance_rate, reinvest_rate) {\n values = parseNumberArray(flatten(values));\n finance_rate = parseNumber(finance_rate);\n reinvest_rate = parseNumber(reinvest_rate);\n\n if (anyIsError(values, finance_rate, reinvest_rate)) {\n return value\n }\n\n // Initialize number of values\n const n = values.length;\n\n // Lookup payments (negative values) and incomes (positive values)\n const payments = [];\n const incomes = [];\n\n for (let i = 0; i < n; i++) {\n if (values[i] < 0) {\n payments.push(values[i]);\n } else {\n incomes.push(values[i]);\n }\n }\n\n // Return modified internal rate of return\n const num = -NPV(reinvest_rate, incomes) * Math.pow(1 + reinvest_rate, n - 1);\n const den = NPV(finance_rate, payments) * (1 + finance_rate);\n\n return Math.pow(num / den, 1 / (n - 1)) - 1\n}\n\n/**\n * Returns the annual nominal interest rate.\n *\n * Category: Financial\n *\n * @param {*} effect_rate The effective interest rate.\n * @param {*} npery The number of compounding periods per year.\n * @returns\n */\nfunction NOMINAL(effect_rate, npery) {\n effect_rate = parseNumber(effect_rate);\n npery = parseNumber(npery);\n\n if (anyIsError(effect_rate, npery)) {\n return value\n }\n\n // Return error if rate <=0 or periods < 1\n if (effect_rate <= 0 || npery < 1) {\n return num\n }\n\n // Truncate periods if it is not an integer\n npery = parseInt(npery, 10);\n\n // Return nominal annual interest rate\n return (Math.pow(effect_rate + 1, 1 / npery) - 1) * npery\n}\n\n/**\n * Returns the number of periods for an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} pmt The payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes.\n * @param {*} pv The present value, or the lump-sum amount that a series of future payments is worth right now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0).\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction NPER(rate, pmt, pv, fv, type) {\n type = type === undefined ? 0 : type;\n fv = fv === undefined ? 0 : fv;\n\n rate = parseNumber(rate);\n pmt = parseNumber(pmt);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, pmt, pv, fv, type)) {\n return value\n }\n\n if (rate === 0) {\n return -(pv + fv) / pmt\n } else {\n const num = pmt * (1 + rate * type) - fv * rate;\n const den = pv * rate + pmt * (1 + rate * type);\n\n return Math.log(num / den) / Math.log(1 + rate)\n }\n}\n\n/**\n * Returns the net present value of an investment based on a series of periodic cash flows and a discount rate.\n *\n * Category: Financial\n *\n * @param {*} rate The rate of discount over the length of one period.\n * @param {*} args value1, value2, ... Value1 is required, subsequent values are optional. 1 to 254 arguments representing the payments and income.\n - value1, value2, ... must be equally spaced in time and occur at the end of each period.\n - NPV uses the order of value1, value2, ... to interpret the order of cash flows. Be sure to enter your payment and income values in the correct sequence.\n - Arguments that are empty values, logical values, or text representations of numbers, error values, or text that cannot be translated into numbers are ignored.\n - If an argument is an array or reference, only numbers in that array or reference are counted. Empty values, logical values, text, or error values in the array or reference are ignored.\n * @returns\n */\nfunction NPV() {\n const args = parseNumberArray(flatten(arguments));\n\n if (args instanceof Error) {\n return args\n }\n\n // Lookup rate\n const rate = args[0];\n\n // Initialize net present value\n let value = 0;\n\n // Loop on all values\n for (let j = 1; j < args.length; j++) {\n value += args[j] / Math.pow(1 + rate, j);\n }\n\n // Return net present value\n return value\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security with an odd first period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date.\n * @param {*} first_coupon The security's first coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDFPRICE() {\n throw new Error('ODDFPRICE is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield of a security with an odd first period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date.\n * @param {*} first_coupon The security's first coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} pr The security's price.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDFYIELD() {\n throw new Error('ODDFYIELD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security with an odd last period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} last_interest The security's last coupon date.\n * @param {*} rate The security's interest rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDLPRICE() {\n throw new Error('ODDLPRICE is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield of a security with an odd last period.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} last_interest The security's last coupon date.\n * @param {*} rate The security's interest rate\n * @param {*} pr The security's price.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction ODDLYIELD() {\n throw new Error('ODDLYIELD is not implemented')\n}\n\n/**\n * Returns the number of periods required by an investment to reach a specified value.\n *\n * Category: Financial\n *\n * @param {*} rate Rate is the interest rate per period.\n * @param {*} pv Pv is the present value of the investment.\n * @param {*} fv Fv is the desired future value of the investment.\n * @returns\n */\nfunction PDURATION(rate, pv, fv) {\n rate = parseNumber(rate);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n\n if (anyIsError(rate, pv, fv)) {\n return value\n }\n\n // Return error if rate <=0\n if (rate <= 0) {\n return num\n }\n\n // Return number of periods\n return (Math.log(fv) - Math.log(pv)) / Math.log(1 + rate)\n}\n\n/**\n * Returns the periodic payment for an annuity.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate for the loan.\n * @param {*} nper The total number of payments for the loan.\n * @param {*} pv The present value, or the total amount that a series of future payments is worth now; also known as the principal.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.\n * @param {*} type Optional. The number 0 (zero) or 1 and indicates when payments are due.\n * @returns\n */\nfunction PMT(rate, nper, pv, fv, type) {\n // Credits: algorithm inspired by Apache OpenOffice\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, pv, fv, type)) {\n return value\n }\n\n // Return payment\n let result;\n\n if (rate === 0) {\n result = (pv + fv) / nper;\n } else {\n const term = Math.pow(1 + rate, nper);\n\n result =\n type === 1\n ? ((fv * rate) / (term - 1) + (pv * rate) / (1 - 1 / term)) / (1 + rate)\n : (fv * rate) / (term - 1) + (pv * rate) / (1 - 1 / term);\n }\n\n return -result\n}\n\n/**\n * Returns the payment on the principal for an investment for a given period.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period.\n * @param {*} per Specifies the period and must be in the range 1 to nper.\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pv The present value \u2014 the total amount that a series of future payments is worth now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction PPMT(rate, per, nper, pv, fv, type) {\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, nper, pv, fv, type)) {\n return value\n }\n\n return PMT(rate, nper, pv, fv, type) - IPMT(rate, per, nper, pv, fv, type)\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} yld The security's annual yield.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICE() {\n throw new Error('PRICE is not implemented')\n}\n\n/**\n * Returns the price per $100 face value of a discounted security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} discount The security's discount rate.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICEDISC(settlement, maturity, discount, redemption, basis) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n redemption = parseNumber(redemption);\n basis = parseNumber(basis);\n\n basis = basis || 0;\n\n if (anyIsError(settlement, maturity, discount, redemption, basis)) {\n return value\n }\n\n if (discount <= 0 || redemption <= 0) {\n return num\n }\n\n if (settlement >= maturity) {\n return value\n }\n\n let basisVal, diff;\n switch (basis) {\n case 0:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, false);\n break\n case 1:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 2:\n basisVal = 360;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 3:\n basisVal = 365;\n diff = DATEDIF(settlement, maturity, 'D');\n break\n case 4:\n basisVal = 360;\n diff = DAYS360(settlement, maturity, true);\n break\n default:\n return num\n }\n\n return redemption - (discount * redemption * diff) / basisVal\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the price per $100 face value of a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date, expressed as a serial date number.\n * @param {*} rate The security's interest rate at date of issue.\n * @param {*} yld The security's annual yield.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction PRICEMAT() {\n throw new Error('PRICEMAT is not implemented')\n}\n\n/**\n * Returns the present value of an investment.\n *\n * Category: Financial\n *\n * @param {*} rate The interest rate per period. For example, if you obtain an automobile loan at a 10 percent annual interest rate and make monthly payments, your interest rate per month is 10%/12, or 0.83%. You would enter 10%/12, or 0.83%, or 0.0083, into the formula as the rate.\n * @param {*} nper The total number of payment periods in an annuity. For example, if you get a four-year car loan and make monthly payments, your loan has 4*12 (or 48) periods. You would enter 48 into the formula for nper.\n * @param {*} pmt The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. For example, the monthly payments on a $10,000, four-year car loan at 12 percent are $263.33. You would enter -263.33 into the formula as the pmt. If pmt is omitted, you must include the fv argument.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). For example, if you want to save $50,000 to pay for a special project in 18 years, then $50,000 is the future value. You could then make a conservative guess at an interest rate and determine how much you must save each month. If fv is omitted, you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @returns\n */\nfunction PV(rate, per, pmt, fv, type) {\n fv = fv || 0;\n type = type || 0;\n\n rate = parseNumber(rate);\n per = parseNumber(per);\n pmt = parseNumber(pmt);\n fv = parseNumber(fv);\n type = parseNumber(type);\n\n if (anyIsError(rate, per, pmt, fv, type)) {\n return value\n }\n\n // Return present value\n return rate === 0\n ? -pmt * per - fv\n : (((1 - Math.pow(1 + rate, per)) / rate) * pmt * (1 + rate * type) - fv) / Math.pow(1 + rate, per)\n}\n\n/**\n * Returns the interest rate per period of an annuity.\n *\n * Category: Financial\n *\n * @param {*} nper The total number of payment periods in an annuity.\n * @param {*} pmt The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. If pmt is omitted, you must include the fv argument.\n * @param {*} pv The present value \u2014 the total amount that a series of future payments is worth now.\n * @param {*} fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). If fv is omitted, you must include the pmt argument.\n * @param {*} type Optional. The number 0 or 1 and indicates when payments are due.\n * @param {*} guess Optional. Your guess for what the rate will be. If you omit guess, it is assumed to be 10 percent. If RATE does not converge, try different values for guess. RATE usually converges if guess is between 0 and 1.\n - If you omit guess, it is assumed to be 10 percent.\n - If RATE does not converge, try different values for guess. RATE usually converges if guess is between 0 and 1.\n * @returns\n */\nfunction RATE(nper, pmt, pv, fv, type, guess) {\n guess = guess === undefined ? 0.01 : guess;\n fv = fv === undefined ? 0 : fv;\n type = type === undefined ? 0 : type;\n\n nper = parseNumber(nper);\n pmt = parseNumber(pmt);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n type = parseNumber(type);\n guess = parseNumber(guess);\n\n if (anyIsError(nper, pmt, pv, fv, type, guess)) {\n return value\n }\n\n const epsMax = 1e-10;\n const iterMax = 20;\n let rate = guess;\n\n type = type ? 1 : 0;\n\n for (let i = 0; i < iterMax; i++) {\n if (rate <= -1) {\n return num\n }\n\n let y, f;\n\n if (Math.abs(rate) < epsMax) {\n y = pv * (1 + nper * rate) + pmt * (1 + rate * type) * nper + fv;\n } else {\n f = Math.pow(1 + rate, nper);\n y = pv * f + pmt * (1 / rate + type) * (f - 1) + fv;\n }\n\n if (Math.abs(y) < epsMax) {\n return rate\n }\n\n let dy;\n\n if (Math.abs(rate) < epsMax) {\n dy = pv * nper + pmt * type * nper;\n } else {\n f = Math.pow(1 + rate, nper);\n const df = nper * Math.pow(1 + rate, nper - 1);\n dy = pv * df + pmt * (1 / rate + type) * df + pmt * (-1 / (rate * rate)) * (f - 1);\n }\n\n rate -= y / dy;\n }\n\n return rate\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the amount received at maturity for a fully invested security.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} investment The amount invested in the security.\n * @param {*} discount The security's discount rate.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction RECEIVED() {\n throw new Error('RECEIVED is not implemented')\n}\n\n/**\n * Returns an equivalent interest rate for the growth of an investment.\n *\n * Category: Financial\n *\n * @param {*} nper Nper is the number of periods for the investment.\n * @param {*} pv Pv is the present value of the investment.\n * @param {*} fv Fv is the future value of the investment.\n * @returns\n */\nfunction RRI(nper, pv, fv) {\n nper = parseNumber(nper);\n pv = parseNumber(pv);\n fv = parseNumber(fv);\n\n if (anyIsError(nper, pv, fv)) {\n return value\n }\n\n // Return error if nper or present is equal to 0 (zero)\n if (nper === 0 || pv === 0) {\n return num\n }\n\n // Return equivalent interest rate\n return Math.pow(fv / pv, 1 / nper) - 1\n}\n\n/**\n * Returns the straight-line depreciation of an asset for one period.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @returns\n */\nfunction SLN(cost, salvage, life) {\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n\n if (anyIsError(cost, salvage, life)) {\n return value\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return num\n }\n\n // Return straight-line depreciation\n return (cost - salvage) / life\n}\n\n/**\n * Returns the sum-of-years' digits depreciation of an asset for a specified period.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset).\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @param {*} per The period and must use the same units as life.\n * @returns\n */\nfunction SYD(cost, salvage, life, per) {\n // Return error if any of the parameters is not a number\n cost = parseNumber(cost);\n salvage = parseNumber(salvage);\n life = parseNumber(life);\n per = parseNumber(per);\n\n if (anyIsError(cost, salvage, life, per)) {\n return value\n }\n\n // Return error if life equal to 0 (zero)\n if (life === 0) {\n return num\n }\n\n // Return error if period is lower than 1 or greater than life\n if (per < 1 || per > life) {\n return num\n }\n\n // Truncate period if it is not an integer\n per = parseInt(per, 10);\n\n // Return straight-line depreciation\n return ((cost - salvage) * (life - per + 1) * 2) / (life * (life + 1))\n}\n\n/**\n * Returns the bond-equivalent yield for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} discount The Treasury bill's discount rate.\n * @returns\n */\nfunction TBILLEQ(settlement, maturity, discount) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n\n if (anyIsError(settlement, maturity, discount)) {\n return value\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return (365 * discount) / (360 - discount * DAYS360(settlement, maturity, false))\n}\n\n/**\n * Returns the price per $100 face value for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} discount The Treasury bill's discount rate.\n * @returns\n */\nfunction TBILLPRICE(settlement, maturity, discount) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n discount = parseNumber(discount);\n\n if (anyIsError(settlement, maturity, discount)) {\n return value\n }\n\n // Return error if discount is lower than or equal to zero\n if (discount <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return 100 * (1 - (discount * DAYS360(settlement, maturity, false)) / 360)\n}\n\n/**\n * Returns the yield for a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The Treasury bill's settlement date. The security settlement date is the date after the issue date when the Treasury bill is traded to the buyer.\n * @param {*} maturity The Treasury bill's maturity date. The maturity date is the date when the Treasury bill expires.\n * @param {*} pr The Treasury bill's price per $100 face value.\n * @returns\n */\nfunction TBILLYIELD(settlement, maturity, pr) {\n settlement = parseDate(settlement);\n maturity = parseDate(maturity);\n pr = parseNumber(pr);\n\n if (anyIsError(settlement, maturity, pr)) {\n return value\n }\n\n // Return error if price is lower than or equal to zero\n if (pr <= 0) {\n return num\n }\n\n // Return error if settlement is greater than maturity\n if (settlement > maturity) {\n return num\n }\n\n // Return error if maturity is more than one year after settlement\n if (maturity - settlement > 365 * 24 * 60 * 60 * 1000) {\n return num\n }\n\n // Return bond-equivalent yield\n return ((100 - pr) * 360) / (pr * DAYS360(settlement, maturity, false))\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the depreciation of an asset for a specified or partial period by using a declining balance method.\n *\n * Category: Financial\n *\n * @param {*} cost The initial cost of the asset.\n * @param {*} salvage The value at the end of the depreciation (sometimes called the salvage value of the asset). This value can be 0.\n * @param {*} life The number of periods over which the asset is depreciated (sometimes called the useful life of the asset).\n * @param {*} start_period The starting period for which you want to calculate the depreciation. Start_period must use the same units as life.\n * @param {*} end_period The ending period for which you want to calculate the depreciation. End_period must use the same units as life.\n * @param {*} factor Optional. The rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method). Change factor if you do not want to use the double-declining balance method. For a description of the double-declining balance method, see DDB.\n * @param {*} no_switch Optional. A logical value specifying whether to switch to straight-line depreciation when depreciation is greater than the declining balance calculation.\n - If no_switch is TRUE, Microsoft Excel does not switch to straight-line depreciation even when the depreciation is greater than the declining balance calculation.\n - If no_switch is FALSE or omitted, Excel switches to straight-line depreciation when depreciation is greater than the declining balance calculation.\n * @returns\n */\nfunction VDB() {\n throw new Error('VDB is not implemented')\n}\n\n/**\n * Returns the internal rate of return for a schedule of cash flows that is not necessarily periodic.\n *\n * Category: Financial\n *\n * @param {*} values A series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive and one negative value.\n * @param {*} dates A schedule of payment dates that corresponds to the cash flow payments. Dates may occur in any order. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text. .\n * @param {*} guess Optional. A number that you guess is close to the result of XIRR.\n * @returns\n */\nfunction XIRR(values, dates, guess) {\n // Credits: algorithm inspired by Apache OpenOffice\n values = parseNumberArray(flatten(values));\n dates = parseDateArray(flatten(dates));\n guess = parseNumber(guess);\n\n if (anyIsError(values, dates, guess)) {\n return value\n }\n\n // Calculates the resulting amount\n const irrResult = (values, dates, rate) => {\n const r = rate + 1;\n let result = values[0];\n\n for (let i = 1; i < values.length; i++) {\n result += values[i] / Math.pow(r, DAYS(dates[i], dates[0]) / 365);\n }\n\n return result\n };\n\n // Calculates the first derivation\n const irrResultDeriv = (values, dates, rate) => {\n const r = rate + 1;\n let result = 0;\n\n for (let i = 1; i < values.length; i++) {\n const frac = DAYS(dates[i], dates[0]) / 365;\n result -= (frac * values[i]) / Math.pow(r, frac + 1);\n }\n\n return result\n };\n\n // Check that values contains at least one positive value and one negative value\n let positive = false;\n let negative = false;\n\n for (let i = 0; i < values.length; i++) {\n if (values[i] > 0) {\n positive = true;\n }\n\n if (values[i] < 0) {\n negative = true;\n }\n }\n\n // Return error if values does not contain at least one positive value and one negative value\n if (!positive || !negative) {\n return num\n }\n\n // Initialize guess and resultRate\n guess = guess || 0.1;\n let resultRate = guess;\n\n // Set maximum epsilon for end of iteration\n const epsMax = 1e-10;\n\n // Implement Newton's method\n let newRate, epsRate, resultValue;\n let contLoop = true;\n\n do {\n resultValue = irrResult(values, dates, resultRate);\n newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);\n epsRate = Math.abs(newRate - resultRate);\n resultRate = newRate;\n contLoop = epsRate > epsMax && Math.abs(resultValue) > epsMax;\n } while (contLoop)\n\n // Return internal rate of return\n return resultRate\n}\n\n/**\n * Returns the net present value for a schedule of cash flows that is not necessarily periodic.\n *\n * Category: Financial\n *\n * @param {*} rate The discount rate to apply to the cash flows.\n * @param {*} values A series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive value and one negative value.\n * @param {*} dates A schedule of payment dates that corresponds to the cash flow payments. The first payment date indicates the beginning of the schedule of payments. All other dates must be later than this date, but they may occur in any order.\n * @returns\n */\nfunction XNPV(rate, values, dates) {\n rate = parseNumber(rate);\n values = parseNumberArray(flatten(values));\n dates = parseDateArray(flatten(dates));\n\n if (anyIsError(rate, values, dates)) {\n return value\n }\n\n let result = 0;\n\n for (let i = 0; i < values.length; i++) {\n result += values[i] / Math.pow(1 + rate, DAYS(dates[i], dates[0]) / 365);\n }\n\n return result\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the yield on a security that pays periodic interest.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} rate The security's annual coupon rate.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} frequency The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELD() {\n throw new Error('YIELD is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual yield for a discounted security; for example, a Treasury bill.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} redemption The security's redemption value per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELDDISC() {\n throw new Error('YIELDDISC is not implemented')\n}\n\n// TODO\n/**\n * -- Not implemented --\n *\n * Returns the annual yield of a security that pays interest at maturity.\n *\n * Category: Financial\n *\n * @param {*} settlement The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer.\n * @param {*} maturity The security's maturity date. The maturity date is the date when the security expires.\n * @param {*} issue The security's issue date, expressed as a serial date number.\n * @param {*} rate The security's interest rate at date of issue.\n * @param {*} pr The security's price per $100 face value.\n * @param {*} basis Optional. The type of day count basis to use.\n * @returns\n */\nfunction YIELDMAT() {\n throw new Error('YIELDMAT is not implemented')\n}\n\n/**\n * Returns TRUE if all of its arguments are TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction AND() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = true;\n }\n\n if (!args[i]) {\n result = false;\n }\n }\n\n return result\n}\n\n/**\n * Returns the logical value FALSE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction FALSE() {\n return false\n}\n\n/**\n * Specifies a logical test to perform.\n *\n * Category: Logical\n *\n * @param {*} logical_test\n * @param {*} value_if_true\n * @param {*} value_if_false\n *\n * @returns\n */\nfunction IF(logical_test, value_if_true, value_if_false) {\n if (logical_test instanceof Error) {\n return logical_test\n }\n\n value_if_true = arguments.length >= 2 ? value_if_true : true;\n\n if (value_if_true === undefined || value_if_true === null) {\n value_if_true = 0;\n }\n\n value_if_false = arguments.length === 3 ? value_if_false : false;\n\n if (value_if_false === undefined || value_if_false === null) {\n value_if_false = 0;\n }\n\n return logical_test ? value_if_true : value_if_false\n}\n\n/**\n * Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction IFS() {\n for (let i = 0; i < arguments.length / 2; i++) {\n if (arguments[i * 2]) {\n return arguments[i * 2 + 1]\n }\n }\n\n return na\n}\n\n/**\n * Returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula.\n *\n * Category: Logical\n *\n * @param {*} value The argument that is checked for an error.\n * @param {*} value_if_error The value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.\n * @returns\n */\nfunction IFERROR(value, value_if_error) {\n if (ISERROR(value)) {\n return value_if_error\n }\n\n return value\n}\n\n/**\n * Returns the value you specify if the expression resolves to #N/A, otherwise returns the result of the expression.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction IFNA(value, value_if_na) {\n return value === na ? value_if_na : value\n}\n\n/**\n * Reverses the logic of its argument.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction NOT(logical) {\n if (typeof logical === 'string') {\n return value\n }\n\n if (logical instanceof Error) {\n return logical\n }\n\n return !logical\n}\n\n/**\n * Returns TRUE if any argument is TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction OR() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = false;\n }\n\n if (args[i]) {\n result = true;\n }\n }\n\n return result\n}\n\n/**\n * Returns the logical value TRUE.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction TRUE() {\n return true\n}\n\n/**\n * Returns a logical exclusive OR of all arguments.\n *\n * Category: Logical\n *\n * @param {*} args logical1, logical2,\u2026 Logical 1 is required, subsequent logical values are optional. 1 to 254 conditions you want to test that can be either TRUE or FALSE, and can be logical values, arrays, or references.\n * @returns\n */\nfunction XOR() {\n const args = flatten(arguments);\n let result = value;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] instanceof Error) {\n return args[i]\n }\n\n if (args[i] === undefined || args[i] === null || typeof args[i] === 'string') {\n continue\n }\n\n if (result === value) {\n result = 0;\n }\n\n if (args[i]) {\n result++;\n }\n }\n\n if (result === value) {\n return result\n }\n\n return !!(Math.floor(Math.abs(result)) & 1)\n}\n\n/**\n * Evaluates an expression against a list of values and returns the result corresponding to the first matching value. If there is no match, an optional default value may be returned.\n *\n * Category: Logical\n *\n * @returns\n */\nfunction SWITCH() {\n let result;\n\n if (arguments.length > 0) {\n const targetValue = arguments[0];\n const argc = arguments.length - 1;\n const switchCount = Math.floor(argc / 2);\n let switchSatisfied = false;\n const hasDefaultClause = argc % 2 !== 0;\n const defaultClause = argc % 2 === 0 ? null : arguments[arguments.length - 1];\n\n if (switchCount) {\n for (let index = 0; index < switchCount; index++) {\n if (targetValue === arguments[index * 2 + 1]) {\n result = arguments[index * 2 + 2];\n switchSatisfied = true;\n break\n }\n }\n }\n\n if (!switchSatisfied) {\n result = hasDefaultClause ? defaultClause : na;\n }\n } else {\n result = value;\n }\n\n return result\n}\n\nconst utils = { errors, symbols };\n\nexport { ABS, ACCRINT, ACCRINTM, ACOS, ACOSH, ACOT, ACOTH, AGGREGATE, AMORDEGRC, AMORLINC, AND, ARABIC, ASC, ASIN, ASINH, ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, AVERAGEIFS, BAHTTEXT, BASE, BESSELI, BESSELJ, BESSELK, BESSELY, BETA, BETADIST, BETAINV, BIN2DEC, BIN2HEX, BIN2OCT, BINOM, BINOMDIST, BITAND, BITLSHIFT, BITOR, BITRSHIFT, BITXOR, CEILING, CEILINGMATH, CEILINGPRECISE, CELL, CHAR, CHIDIST, CHIDISTRT, CHIINV, CHIINVRT, CHISQ, CHITEST, CHOOSE, CLEAN, CODE, COLUMN, COLUMNS, COMBIN, COMBINA, COMPLEX, CONCAT, CONCATENATE, CONFIDENCE, CONVERT, CORREL, COS, COSH, COT, COTH, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, COUPDAYBS, COUPDAYS, COUPDAYSNC, COUPNCD, COUPNUM, COUPPCD, COVAR, COVARIANCE, COVARIANCEP, COVARIANCES, CRITBINOM, CSC, CSCH, CUMIPMT, CUMPRINC, DATE, DATEDIF, DATEVALUE, DAVERAGE, DAY, DAYS, DAYS360, DB, DBCS, DCOUNT, DCOUNTA, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DECIMAL, DEGREES, DELTA, DEVSQ, DGET, DISC, DMAX, DMIN, DOLLAR, DOLLARDE, DOLLARFR, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DURATION, DVAR, DVARP, EDATE, EFFECT, EOMONTH, ERF, ERFC, ERFCPRECISE, ERFPRECISE, ERROR, EVEN, EXACT, EXP, EXPON, EXPONDIST, F, FACT, FACTDOUBLE, FALSE, FDIST, FDISTRT, FIND, FINV, FINVRT, FISHER, FISHERINV, FIXED, FLOOR, FLOORMATH, FLOORPRECISE, FORECAST, FREQUENCY, FTEST, FV, FVSCHEDULE, GAMMA, GAMMADIST, GAMMAINV, GAMMALN, GAMMALNPRECISE, GAUSS, GCD, GEOMEAN, GESTEP, GROWTH, HARMEAN, HEX2BIN, HEX2DEC, HEX2OCT, HLOOKUP, HOUR, HYPGEOM, HYPGEOMDIST, IF, IFERROR, IFNA, IFS, IMABS, IMAGINARY, IMARGUMENT, IMCONJUGATE, IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMDIV, IMEXP, IMLN, IMLOG10, IMLOG2, IMPOWER, IMPRODUCT, IMREAL, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN, INDEX, INFO, INT, INTERCEPT, INTRATE, IPMT, IRR, ISBLANK, ISERR, ISERROR, ISEVEN, ISFORMULA, ISLOGICAL, ISNA, ISNONTEXT, ISNUMBER, ISO, ISODD, ISOWEEKNUM, ISPMT, ISREF, ISTEXT, KURT, LARGE, LCM, LEFT, LEN, LINEST, LN, LOG, LOG10, LOGEST, LOGINV, LOGNORM, LOGNORMDIST, LOGNORMINV, LOOKUP, LOWER, MATCH, MAX, MAXA, MAXIFS, MDURATION, MEDIAN, MID, MIN, MINA, MINIFS, MINUTE, MIRR, MMULT, MOD, MODE, MODEMULT, MODESNGL, MONTH, MROUND, MULTINOMIAL, MUNIT, N, NA, NEGBINOM, NEGBINOMDIST, NETWORKDAYS, NETWORKDAYSINTL, NOMINAL, NORM, NORMDIST, NORMINV, NORMSDIST, NORMSINV, NOT, NOW, NPER, NPV, NUMBERVALUE, OCT2BIN, OCT2DEC, OCT2HEX, ODD, ODDFPRICE, ODDFYIELD, ODDLPRICE, ODDLYIELD, OR, PDURATION, PEARSON, PERCENTILE, PERCENTILEEXC, PERCENTILEINC, PERCENTRANK, PERCENTRANKEXC, PERCENTRANKINC, PERMUT, PERMUTATIONA, PHI, PI, PMT, POISSON, POISSONDIST, POWER, PPMT, PRICE, PRICEDISC, PRICEMAT, PROB, PRODUCT, PRONETIC, PROPER, PV, QUARTILE, QUARTILEEXC, QUARTILEINC, QUOTIENT, RADIANS, RAND, RANDBETWEEN, RANK, RANKAVG, RANKEQ, RATE, RECEIVED, REPLACE, REPT, RIGHT, ROMAN, ROUND, ROUNDDOWN, ROUNDUP, ROW, ROWS, RRI, RSQ, SEARCH, SEC, SECH, SECOND, SERIESSUM, SHEET, SHEETS, SIGN, SIN, SINH, SKEW, SKEWP, SLN, SLOPE, SMALL, SORT, SQRT, SQRTPI, STANDARDIZE, STDEV, STDEVA, STDEVP, STDEVPA, STDEVS, STEYX, SUBSTITUTE, SUBTOTAL, SUM, SUMIF, SUMIFS, SUMPRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, SUMXMY2, SWITCH, SYD, T, TAN, TANH, TBILLEQ, TBILLPRICE, TBILLYIELD, TDIST, TDISTRT, TEXT, TEXTJOIN, TIME, TIMEVALUE, TINV, TODAY, TRANSPOSE, TREND, TRIM, TRIMMEAN, TRUE, TRUNC, TTEST, TYPE, UNICHAR, UNICODE, UNIQUE, UPPER, VALUE, VAR, VARA, VARP, VARPA, VARS, VDB, VLOOKUP, WEEKDAY, WEEKNUM, WEIBULL, WEIBULLDIST, WORKDAY, WORKDAYINTL, XIRR, XNPV, XOR, YEAR, YEARFRAC, YIELD, YIELDDISC, YIELDMAT, Z, ZTEST, utils };\n", "import { $, app, store } from './common'\nimport { cm } from './editor'\nimport { calculate, math } from './eval'\nimport { notify } from './modal'\n\nmath.createUnit('USD', { aliases: ['usd'] })\n\n/** Get exchange rates. */\nexport function getRates() {\n const url = 'https://www.floatrates.com/widget/1030/cfc5515dfc13ada8d7b0e50b8143d55f/usd.json'\n\n if (navigator.onLine) {\n $('#lastUpdated').innerHTML = '
    '\n\n fetch(url)\n .then((response) => response.json())\n .then((rates) => {\n const dups = ['cup']\n\n app.currencyRates = rates\n\n Object.keys(rates).forEach((currency) => {\n math.createUnit(\n rates[currency].code,\n {\n aliases: [dups.includes(rates[currency].code.toLowerCase()) ? '' : rates[currency].code.toLowerCase()],\n definition: math.unit(rates[currency].inverseRate + 'USD')\n },\n { override: true }\n )\n\n store.set('rateDate', rates[currency].date)\n })\n\n $('#lastUpdated').innerHTML = store.get('rateDate')\n\n cm.setOption('mode', app.settings.syntax ? 'numara' : 'plain')\n\n calculate()\n })\n .catch((error) => {\n $('#lastUpdated').innerHTML = 'n/a'\n\n notify('Failed to get exchange rates (' + error + ')', 'warning')\n })\n } else {\n $('#lastUpdated').innerHTML = 'No internet connection.'\n\n notify('No internet connection. Could not update exchange rates.', 'warning')\n }\n}\n", "import {\n createIcons,\n AlertCircle,\n ArrowUpDown,\n Braces,\n Circle,\n Copy,\n CornerDownRight,\n Dot,\n Download,\n EllipsisVertical,\n Eraser,\n Info,\n ListRestart,\n PanelLeft,\n PanelLeftClose,\n Plus,\n Printer,\n Scaling,\n Settings,\n Trash,\n UndoDot,\n Upload\n} from 'lucide'\n\nconst iconList = {\n AlertCircle,\n ArrowUpDown,\n Braces,\n Circle,\n Copy,\n CornerDownRight,\n Dot,\n Download,\n EllipsisVertical,\n Eraser,\n Info,\n ListRestart,\n PanelLeft,\n PanelLeftClose,\n Plus,\n Printer,\n Scaling,\n Settings,\n Trash,\n UndoDot,\n Upload\n}\n\n/** Generate app icons. */\nexport const generateIcons = () => {\n createIcons({ icons: iconList })\n}\n", "import { IconNode, IconNodeChild, SVGProps } from './types';\n\n/**\n * Creates a new HTMLElement from icon node\n * @param {string} tag\n * @param {object} attrs\n * @param {array} children\n * @returns {HTMLElement}\n */\nconst createElement = (tag: string, attrs: SVGProps, children: IconNodeChild[] = []) => {\n const element = document.createElementNS('http://www.w3.org/2000/svg', tag);\n\n Object.keys(attrs).forEach((name) => {\n element.setAttribute(name, String(attrs[name]));\n });\n\n if (children.length) {\n children.forEach((child) => {\n const childElement = createElement(...child);\n\n element.appendChild(childElement);\n });\n }\n\n return element;\n};\n\n/**\n * Creates a new HTMLElement from icon node\n * @param {[tag: string, attrs: object, children: array]} iconNode\n * @returns {HTMLElement}\n */\nexport default ([tag, attrs, children]: IconNode) => createElement(tag, attrs, children);\n", "import createElement from './createElement';\nimport { Icons } from './types';\n\nexport type CustomAttrs = { [attr: string]: any };\n\n/**\n * Get the attributes of an HTML element.\n * @param {HTMLElement} element\n * @returns {Object}\n */\nexport const getAttrs = (element: Element): Record =>\n Array.from(element.attributes).reduce>((attrs, attr) => {\n attrs[attr.name] = attr.value;\n return attrs;\n }, {});\n\n/**\n * Gets the classNames of an attributes Object.\n * @param {Object} attrs\n * @returns {Array}\n */\nexport const getClassNames = (attrs: Record | string): string | string[] => {\n if (typeof attrs === 'string') return attrs;\n if (!attrs || !attrs.class) return '';\n if (attrs.class && typeof attrs.class === 'string') {\n return attrs.class.split(' ');\n }\n if (attrs.class && Array.isArray(attrs.class)) {\n return attrs.class;\n }\n return '';\n};\n\n/**\n * Combines the classNames of array of classNames to a String\n * @param {array} arrayOfClassnames\n * @returns {string}\n */\nexport const combineClassNames = (arrayOfClassnames: (string | Record)[]) => {\n const classNameArray = arrayOfClassnames.flatMap(getClassNames);\n\n return classNameArray\n .map((classItem) => classItem.trim())\n .filter(Boolean)\n .filter((value, index, self) => self.indexOf(value) === index)\n .join(' ');\n};\n\nconst toPascalCase = (string: string): string =>\n string.replace(/(\\w)(\\w*)(_|-|\\s*)/g, (g0, g1, g2) => g1.toUpperCase() + g2.toLowerCase());\n\ninterface ReplaceElementOptions {\n nameAttr: string;\n icons: Icons;\n attrs: Record;\n}\n\n/**\n * ReplaceElement, replaces the given element with the created icon.\n * @param {HTMLElement} element\n * @param {{ nameAttr: string, icons: object, attrs: object }} options: { nameAttr, icons, attrs }\n * @returns {Function}\n */\nconst replaceElement = (element: Element, { nameAttr, icons, attrs }: ReplaceElementOptions) => {\n const iconName = element.getAttribute(nameAttr);\n\n if (iconName == null) return;\n\n const ComponentName = toPascalCase(iconName);\n\n const iconNode = icons[ComponentName];\n\n if (!iconNode) {\n return console.warn(\n `${element.outerHTML} icon name was not found in the provided icons object.`,\n );\n }\n\n const elementAttrs = getAttrs(element);\n const [tag, iconAttributes, children] = iconNode;\n\n const iconAttrs = {\n ...iconAttributes,\n 'data-lucide': iconName,\n ...attrs,\n ...elementAttrs,\n };\n\n const classNames = combineClassNames(['lucide', `lucide-${iconName}`, elementAttrs, attrs]);\n\n if (classNames) {\n Object.assign(iconAttrs, {\n class: classNames,\n });\n }\n\n const svgElement = createElement([tag, iconAttrs, children]);\n\n return element.parentNode?.replaceChild(svgElement, element);\n};\n\nexport default replaceElement;\n", "import { SVGProps } from './types';\n\nconst defaultAttributes: SVGProps = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n};\n\nexport default defaultAttributes;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name arrow-up-down\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjEgMTYtNCA0LTQtNCIgLz4KICA8cGF0aCBkPSJNMTcgMjBWNCIgLz4KICA8cGF0aCBkPSJtMyA4IDQtNCA0IDQiIC8+CiAgPHBhdGggZD0iTTcgNHYxNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-up-down\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst ArrowUpDown: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'm21 16-4 4-4-4' }],\n ['path', { d: 'M17 20V4' }],\n ['path', { d: 'm3 8 4-4 4 4' }],\n ['path', { d: 'M7 4v16' }],\n ],\n];\n\nexport default ArrowUpDown;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name braces\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAzSDdhMiAyIDAgMCAwLTIgMnY1YTIgMiAwIDAgMS0yIDIgMiAyIDAgMCAxIDIgMnY1YzAgMS4xLjkgMiAyIDJoMSIgLz4KICA8cGF0aCBkPSJNMTYgMjFoMWEyIDIgMCAwIDAgMi0ydi01YzAtMS4xLjktMiAyLTJhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMC0yLTJoLTEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/braces\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Braces: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1' }],\n ['path', { d: 'M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1' }],\n ],\n];\n\nexport default Braces;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name circle-alert\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8bGluZSB4MT0iMTIiIHgyPSIxMiIgeTE9IjgiIHkyPSIxMiIgLz4KICA8bGluZSB4MT0iMTIiIHgyPSIxMi4wMSIgeTE9IjE2IiB5Mj0iMTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/circle-alert\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst CircleAlert: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['line', { x1: '12', x2: '12', y1: '8', y2: '12' }],\n ['line', { x1: '12', x2: '12.01', y1: '16', y2: '16' }],\n ],\n];\n\nexport default CircleAlert;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name circle\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/circle\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Circle: IconNode = ['svg', defaultAttributes, [['circle', { cx: '12', cy: '12', r: '10' }]]];\n\nexport default Circle;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name copy\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHg9IjgiIHk9IjgiIHJ4PSIyIiByeT0iMiIgLz4KICA8cGF0aCBkPSJNNCAxNmMtMS4xIDAtMi0uOS0yLTJWNGMwLTEuMS45LTIgMi0yaDEwYzEuMSAwIDIgLjkgMiAyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/copy\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Copy: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' }],\n ],\n];\n\nexport default Copy;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name corner-down-right\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIxNSAxMCAyMCAxNSAxNSAyMCIgLz4KICA8cGF0aCBkPSJNNCA0djdhNCA0IDAgMCAwIDQgNGgxMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/corner-down-right\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst CornerDownRight: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['polyline', { points: '15 10 20 15 15 20' }],\n ['path', { d: 'M4 4v7a4 4 0 0 0 4 4h12' }],\n ],\n];\n\nexport default CornerDownRight;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name dot\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMi4xIiBjeT0iMTIuMSIgcj0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/dot\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Dot: IconNode = ['svg', defaultAttributes, [['circle', { cx: '12.1', cy: '12.1', r: '1' }]]];\n\nexport default Dot;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name download\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTV2NGEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtNCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSI3IDEwIDEyIDE1IDE3IDEwIiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMTUiIHkyPSIzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/download\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Download: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],\n ['polyline', { points: '7 10 12 15 17 10' }],\n ['line', { x1: '12', x2: '12', y1: '15', y2: '3' }],\n ],\n];\n\nexport default Download;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name ellipsis-vertical\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxIiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iNSIgcj0iMSIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjE5IiByPSIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/ellipsis-vertical\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst EllipsisVertical: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '1' }],\n ['circle', { cx: '12', cy: '5', r: '1' }],\n ['circle', { cx: '12', cy: '19', r: '1' }],\n ],\n];\n\nexport default EllipsisVertical;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name eraser\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNyAyMS00LjMtNC4zYy0xLTEtMS0yLjUgMC0zLjRsOS42LTkuNmMxLTEgMi41LTEgMy40IDBsNS42IDUuNmMxIDEgMSAyLjUgMCAzLjRMMTMgMjEiIC8+CiAgPHBhdGggZD0iTTIyIDIxSDciIC8+CiAgPHBhdGggZD0ibTUgMTEgOSA5IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/eraser\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Eraser: IconNode = [\n 'svg',\n defaultAttributes,\n [\n [\n 'path',\n { d: 'm7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21' },\n ],\n ['path', { d: 'M22 21H7' }],\n ['path', { d: 'm5 11 9 9' }],\n ],\n];\n\nexport default Eraser;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name info\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJNMTIgMTZ2LTQiIC8+CiAgPHBhdGggZD0iTTEyIDhoLjAxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/info\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Info: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '12', r: '10' }],\n ['path', { d: 'M12 16v-4' }],\n ['path', { d: 'M12 8h.01' }],\n ],\n];\n\nexport default Info;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name list-restart\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgNkgzIiAvPgogIDxwYXRoIGQ9Ik03IDEySDMiIC8+CiAgPHBhdGggZD0iTTcgMThIMyIgLz4KICA8cGF0aCBkPSJNMTIgMThhNSA1IDAgMCAwIDktMyA0LjUgNC41IDAgMCAwLTQuNS00LjVjLTEuMzMgMC0yLjU0LjU0LTMuNDEgMS40MUwxMSAxNCIgLz4KICA8cGF0aCBkPSJNMTEgMTB2NGg0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/list-restart\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst ListRestart: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 6H3' }],\n ['path', { d: 'M7 12H3' }],\n ['path', { d: 'M7 18H3' }],\n ['path', { d: 'M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14' }],\n ['path', { d: 'M11 10v4h4' }],\n ],\n];\n\nexport default ListRestart;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name panel-left-close\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik05IDN2MTgiIC8+CiAgPHBhdGggZD0ibTE2IDE1LTMtMyAzLTMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/panel-left-close\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst PanelLeftClose: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2' }],\n ['path', { d: 'M9 3v18' }],\n ['path', { d: 'm16 15-3-3 3-3' }],\n ],\n];\n\nexport default PanelLeftClose;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name panel-left\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik05IDN2MTgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/panel-left\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst PanelLeft: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2' }],\n ['path', { d: 'M9 3v18' }],\n ],\n];\n\nexport default PanelLeft;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name plus\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAxMmgxNCIgLz4KICA8cGF0aCBkPSJNMTIgNXYxNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/plus\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Plus: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M5 12h14' }],\n ['path', { d: 'M12 5v14' }],\n ],\n];\n\nexport default Plus;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name printer\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAxOEg0YTIgMiAwIDAgMS0yLTJ2LTVhMiAyIDAgMCAxIDItMmgxNmEyIDIgMCAwIDEgMiAydjVhMiAyIDAgMCAxLTIgMmgtMiIgLz4KICA8cGF0aCBkPSJNNiA5VjNhMSAxIDAgMCAxIDEtMWgxMGExIDEgMCAwIDEgMSAxdjYiIC8+CiAgPHJlY3QgeD0iNiIgeT0iMTQiIHdpZHRoPSIxMiIgaGVpZ2h0PSI4IiByeD0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/printer\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Printer: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2' }],\n ['path', { d: 'M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6' }],\n ['rect', { x: '6', y: '14', width: '12', height: '8', rx: '1' }],\n ],\n];\n\nexport default Printer;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name scaling\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgM0g1YTIgMiAwIDAgMC0yIDJ2MTRhMiAyIDAgMCAwIDIgMmgxNGEyIDIgMCAwIDAgMi0ydi03IiAvPgogIDxwYXRoIGQ9Ik0xNCAxNUg5di01IiAvPgogIDxwYXRoIGQ9Ik0xNiAzaDV2NSIgLz4KICA8cGF0aCBkPSJNMjEgMyA5IDE1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/scaling\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Scaling: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7' }],\n ['path', { d: 'M14 15H9v-5' }],\n ['path', { d: 'M16 3h5v5' }],\n ['path', { d: 'M21 3 9 15' }],\n ],\n];\n\nexport default Scaling;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name settings\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIuMjIgMmgtLjQ0YTIgMiAwIDAgMC0yIDJ2LjE4YTIgMiAwIDAgMS0xIDEuNzNsLS40My4yNWEyIDIgMCAwIDEtMiAwbC0uMTUtLjA4YTIgMiAwIDAgMC0yLjczLjczbC0uMjIuMzhhMiAyIDAgMCAwIC43MyAyLjczbC4xNS4xYTIgMiAwIDAgMSAxIDEuNzJ2LjUxYTIgMiAwIDAgMS0xIDEuNzRsLS4xNS4wOWEyIDIgMCAwIDAtLjczIDIuNzNsLjIyLjM4YTIgMiAwIDAgMCAyLjczLjczbC4xNS0uMDhhMiAyIDAgMCAxIDIgMGwuNDMuMjVhMiAyIDAgMCAxIDEgMS43M1YyMGEyIDIgMCAwIDAgMiAyaC40NGEyIDIgMCAwIDAgMi0ydi0uMThhMiAyIDAgMCAxIDEtMS43M2wuNDMtLjI1YTIgMiAwIDAgMSAyIDBsLjE1LjA4YTIgMiAwIDAgMCAyLjczLS43M2wuMjItLjM5YTIgMiAwIDAgMC0uNzMtMi43M2wtLjE1LS4wOGEyIDIgMCAwIDEtMS0xLjc0di0uNWEyIDIgMCAwIDEgMS0xLjc0bC4xNS0uMDlhMiAyIDAgMCAwIC43My0yLjczbC0uMjItLjM4YTIgMiAwIDAgMC0yLjczLS43M2wtLjE1LjA4YTIgMiAwIDAgMS0yIDBsLS40My0uMjVhMiAyIDAgMCAxLTEtMS43M1Y0YTIgMiAwIDAgMC0yLTJ6IiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/settings\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Settings: IconNode = [\n 'svg',\n defaultAttributes,\n [\n [\n 'path',\n {\n d: 'M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z',\n },\n ],\n ['circle', { cx: '12', cy: '12', r: '3' }],\n ],\n];\n\nexport default Settings;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name trash\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyA2aDE4IiAvPgogIDxwYXRoIGQ9Ik0xOSA2djE0YzAgMS0xIDItMiAySDdjLTEgMC0yLTEtMi0yVjYiIC8+CiAgPHBhdGggZD0iTTggNlY0YzAtMSAxLTIgMi0yaDRjMSAwIDIgMSAyIDJ2MiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/trash\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Trash: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M3 6h18' }],\n ['path', { d: 'M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6' }],\n ['path', { d: 'M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2' }],\n ],\n];\n\nexport default Trash;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name undo-dot\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjE3IiByPSIxIiAvPgogIDxwYXRoIGQ9Ik0zIDd2Nmg2IiAvPgogIDxwYXRoIGQ9Ik0yMSAxN2E5IDkgMCAwIDAtOS05IDkgOSAwIDAgMC02IDIuM0wzIDEzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/undo-dot\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst UndoDot: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['circle', { cx: '12', cy: '17', r: '1' }],\n ['path', { d: 'M3 7v6h6' }],\n ['path', { d: 'M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13' }],\n ],\n];\n\nexport default UndoDot;\n", "import defaultAttributes from '../defaultAttributes';\nimport type { IconNode } from '../types';\n\n/**\n * @name upload\n * @description Lucide SVG icon node.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTV2NGEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtNCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4IiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMyIgeTI9IjE1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/upload\n * @see https://lucide.dev/guide/packages/lucide - Documentation\n *\n * @returns {Array}\n *\n */\nconst Upload: IconNode = [\n 'svg',\n defaultAttributes,\n [\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],\n ['polyline', { points: '17 8 12 3 7 8' }],\n ['line', { x1: '12', x2: '12', y1: '3', y2: '15' }],\n ],\n];\n\nexport default Upload;\n", "import replaceElement from './replaceElement';\nimport * as iconAndAliases from './iconsAndAliases';\n\n/**\n * Replaces all elements with matching nameAttr with the defined icons\n * @param {{ icons?: object, nameAttr?: string, attrs?: object }} options\n */\nconst createIcons = ({ icons = {}, nameAttr = 'data-lucide', attrs = {} } = {}) => {\n if (!Object.values(icons).length) {\n throw new Error(\n \"Please provide an icons object.\\nIf you want to use all the icons you can import it like:\\n `import { createIcons, icons } from 'lucide';\\nlucide.createIcons({icons});`\",\n );\n }\n\n if (typeof document === 'undefined') {\n throw new Error('`createIcons()` only works in a browser environment.');\n }\n\n const elementsToReplace = document.querySelectorAll(`[${nameAttr}]`);\n Array.from(elementsToReplace).forEach((element) =>\n replaceElement(element, { nameAttr, icons, attrs }),\n );\n\n /** @todo: remove this block in v1.0 */\n if (nameAttr === 'data-lucide') {\n const deprecatedElements = document.querySelectorAll('[icon-name]');\n if (deprecatedElements.length > 0) {\n console.warn(\n '[Lucide] Some icons were found with the now deprecated icon-name attribute. These will still be replaced for backwards compatibility, but will no longer be supported in v1.0 and you should switch to data-lucide',\n );\n Array.from(deprecatedElements).forEach((element) =>\n replaceElement(element, { nameAttr: 'icon-name', icons, attrs }),\n );\n }\n }\n};\n\nexport { createIcons };\n\n/*\n Create Element function export.\n*/\nexport { default as createElement } from './createElement';\n\n/*\n Icons exports.\n*/\nexport { iconAndAliases as icons };\nexport * from './icons';\nexport * from './aliases';\n\n/*\n Types exports.\n*/\nexport * from './types';\n", "import { $, app, store } from './common'\nimport { math } from './eval'\n\nimport { productName } from './../../package.json'\n\nimport functionPlot from 'function-plot'\n\n/** Plot function. */\nexport function plot() {\n $('#plotTitle').innerHTML = app.plotFunction\n\n const f = math.simplify(app.plotFunction.split('=')[1], app.mathScope).toString()\n\n let domain = math.abs(math.evaluate(f, { x: 0 })) * 2\n\n if (domain === Infinity || domain === 0) {\n domain = 10\n }\n\n const xDomain = app.activePlot ? app.activePlot.meta.xScale.domain() : [-domain, domain]\n const yDomain = app.activePlot ? app.activePlot.meta.yScale.domain() : [-domain, domain]\n\n app.activePlot = functionPlot.default({\n data: [\n {\n derivative: app.settings.plotDerivative\n ? { fn: math.derivative(f, 'x').toString(), updateOnMouseMove: true }\n : false,\n fn: f,\n graphType: 'polyline',\n sampler: 'builtIn'\n }\n ],\n grid: app.settings.plotGrid,\n height: $('#plot').clientHeight,\n target: '#plot',\n tip: {\n xLine: app.settings.plotCross,\n yLine: app.settings.plotCross\n },\n width: $('#plot').clientWidth,\n xAxis: { domain: xDomain },\n yAxis: { domain: yDomain }\n })\n}\n\n$('#plotCrossModal').addEventListener('click', () => {\n app.settings.plotCross = $('#plotCrossModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#plotDerivativeModal').addEventListener('click', () => {\n app.settings.plotDerivative = $('#plotDerivativeModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#plotGridModal').addEventListener('click', () => {\n app.settings.plotGrid = $('#plotGridModal').checked\n\n store.set('settings', app.settings)\n\n plot()\n})\n\n$('#exportPlot').addEventListener('click', () => {\n $('.function-plot').setAttribute('xmlns', 'http://www.w3.org/2000/svg')\n\n const fileName = productName + ' Plot ' + app.plotFunction\n const preface = '\\r\\n'\n const svgData = $('.function-plot').outerHTML\n const svgBlob = new Blob([preface, svgData], { type: 'image/svg+xml;charset=utf-8' })\n const downloadLink = document.createElement('a')\n\n downloadLink.href = URL.createObjectURL(svgBlob)\n downloadLink.download = fileName\n downloadLink.click()\n\n setTimeout(() => URL.revokeObjectURL(downloadLink.href), 60000)\n})\n\n$('#resetPlot').addEventListener('click', () => {\n app.activePlot = null\n\n plot()\n})\n", "{\n \"name\": \"numara\",\n \"productName\": \"Numara\",\n \"description\": \"Numara Calculator\",\n \"version\": \"5.2.0\",\n \"author\": {\n \"name\": \"Timur Atalay\",\n \"email\": \"mail@numara.io\",\n \"url\": \"https://numara.io\"\n },\n \"license\": \"MIT\",\n \"homepage\": \"https://github.com/bornova/numara-calculator\",\n \"main\": \"src/main.js\",\n \"type\": \"module\",\n \"scripts\": {\n \"prebuild\": \"npm run prettier && npm run lint\",\n \"build\": \"node build.js\",\n \"dist\": \"npm run build && electron-builder\",\n \"lint\": \"eslint .\",\n \"lint:fix\": \"eslint --fix .\",\n \"prettier\": \"prettier --check .\",\n \"prettier:fix\": \"prettier --write .\",\n \"publish\": \"npm run build && electron-builder --x64 --arm64 -p always\",\n \"test\": \"npm run build && electron .\",\n \"wiki\": \"node src/misc/wiki.js\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^9.2.0\",\n \"@formulajs/formulajs\": \"^4.4.4\",\n \"codemirror\": \"^5.65.16\",\n \"deep-diff\": \"^1.0.2\",\n \"electron\": \"^31.0.2\",\n \"electron-builder\": \"^24.13.3\",\n \"esbuild\": \"^0.21.5\",\n \"esbuild-plugin-polyfill-node\": \"^0.3.0\",\n \"eslint\": \"^9.5.0\",\n \"fs-extra\": \"^11.2.0\",\n \"function-plot\": \"^1.25.0\",\n \"lucide\": \"^0.394.0\",\n \"luxon\": \"^3.4.4\",\n \"mathjs\": \"^13.0.0\",\n \"mousetrap\": \"^1.6.5\",\n \"mousetrap-global-bind\": \"^1.1.0\",\n \"prettier\": \"^3.3.2\",\n \"uikit\": \"^3.21.5\"\n },\n \"dependencies\": {\n \"electron-log\": \"^5.1.5\",\n \"electron-store\": \"^10.0.0\",\n \"electron-updater\": \"^6.2.1\"\n }\n}\n", "import { $, $all, app, store } from './common'\nimport { cm, udfInput, uduInput } from './editor'\nimport { calculate, math } from './eval'\nimport { getRates } from './forex'\nimport { generateIcons } from './icons'\nimport { confirm, showError } from './modal'\nimport { checkLocale, checkSize, isElectron } from './utils'\n\nimport DeepDiff from 'deep-diff'\n\n/** Show/hide Defaults link. */\nfunction checkDefaults() {\n $('#defaultSettingsButton').style.display = DeepDiff.diff(app.settings, settings.defaults) ? 'inline' : 'none'\n}\n\n/** Show warning if big number option is selected. */\nfunction bigNumberWarning() {\n $('#bigNumWarn').style.display = app.settings.numericOutput === 'BigNumber' ? 'inline-block' : 'none'\n}\n\n/** Show warning if locale uses comma as decimal point separator. */\nfunction localeWarning() {\n $('#localeWarn').style.display = checkLocale() ? 'inline-block' : 'none'\n}\n\n/** Check for app settings modifications. */\nfunction checkMods(key) {\n $('#' + key + 'Mod').style.display = app.settings[key] !== settings.defaults[key] ? 'inline-block' : 'none'\n}\n\n/** Check for app settings schema changes. */\nfunction checkSchema() {\n DeepDiff.observableDiff(app.settings, settings.defaults, (d) => {\n if (d.kind !== 'E') {\n DeepDiff.applyChange(app.settings, settings.defaults, d)\n\n store.set('settings', app.settings)\n }\n })\n}\n\nexport const settings = {\n /** Default settings. */\n defaults: {\n alwaysOnTop: false,\n autocomplete: true,\n closeBrackets: true,\n contPrevLine: true,\n copyThouSep: false,\n currency: true,\n dateDay: false,\n divider: true,\n expLower: '-12',\n expUpper: '12',\n fontSize: '1.1rem',\n fontWeight: '400',\n inputWidth: 60,\n keywordTips: true,\n lineErrors: true,\n lineHeight: '2em',\n lineNumbers: true,\n lineWrap: true,\n locale: 'system',\n matchBrackets: true,\n matrixType: 'Matrix',\n notation: 'auto',\n notifyDuration: '5000',\n notifyLocation: 'bottom-center',\n numericOutput: 'number',\n plotCross: false,\n plotDerivative: false,\n plotGrid: false,\n precision: '4',\n predictable: false,\n rulers: false,\n syntax: true,\n theme: 'system',\n thouSep: true\n },\n\n /** Initialize settings. */\n initialize: () => {\n app.settings = store.get('settings')\n\n if (app.settings) {\n checkSchema()\n } else {\n app.settings = app.settings = JSON.parse(JSON.stringify(settings.defaults))\n\n store.set('settings', settings.defaults)\n }\n\n settings.apply()\n\n $all('.settingItem').forEach((item) => {\n const span = document.createElement('span')\n const icon = document.createElement('span')\n\n icon.setAttribute('data-lucide', 'dot')\n\n span.setAttribute('id', item.getAttribute('id') + 'Mod')\n span.setAttribute('class', item.getAttribute('type') === 'checkbox' ? 'settingModToggle' : 'settingMod')\n\n span.appendChild(icon)\n\n span.addEventListener('click', () => {\n const key = item.getAttribute('id')\n\n app.settings[key] = settings.defaults[key]\n\n settings.prep()\n settings.save()\n settings.apply()\n })\n\n if (item.getAttribute('type') === 'checkbox') {\n item.parentElement.before(span)\n } else {\n item.before(span)\n }\n\n generateIcons()\n })\n },\n\n /** Prepare settings dialog items. */\n prep: () => {\n const locales = [\n ['System', 'system'],\n ['Chinese (PRC)', 'zh-CN'],\n ['English (Canada)', 'en-CA'],\n ['English (UK)', 'en-GB'],\n ['English (US)', 'en-US'],\n ['French (France)', 'fr-FR'],\n ['German (Germany)', 'de-DE'],\n ['Italian (Italy)', 'it-IT'],\n ['Japanese (Japan)', 'ja-JP'],\n ['Portuguese (Brazil)', 'pt-BR'],\n ['Russian (Russia)', 'ru-RU'],\n ['Spanish (Mexico)', 'es-MX'],\n ['Spanish (Spain)', 'es-ES'],\n ['Turkish (Turkey)', 'tr-TR']\n ]\n\n const matrixTypes = ['Matrix', 'Array']\n const numericOutputs = ['number', 'BigNumber', 'Fraction']\n const notations = ['auto', 'engineering', 'exponential', 'fixed', '-', 'bin', 'hex', 'oct']\n\n $('#locale').innerHTML = ''\n\n for (const l of locales) {\n $('#locale').innerHTML += ``\n }\n\n $('#precision-label').innerHTML = app.settings.precision\n $('#expLower-label').innerHTML = app.settings.expLower\n $('#expUpper-label').innerHTML = app.settings.expUpper\n\n $('#numericOutput').innerHTML = ''\n\n for (const n of numericOutputs) {\n $('#numericOutput').innerHTML += ``\n }\n\n $('#notation').innerHTML = ''\n\n for (const n of notations) {\n $('#notation').innerHTML +=\n n === '-'\n ? ''\n : ``\n }\n\n $('#matrixType').innerHTML = ''\n\n for (const m of matrixTypes) {\n $('#matrixType').innerHTML += ``\n }\n\n $('#lastUpdated').innerHTML = app.settings.currency ? store.get('rateDate') : ''\n $('#currencyUpdate').style.visibility = app.settings.currency ? 'visible' : 'hidden'\n\n Object.keys(app.settings).forEach((key) => {\n const el = $('#' + key)\n\n if (el) {\n if (el.getAttribute('type') === 'checkbox') {\n el.checked = app.settings[key]\n } else {\n el.value = app.settings[key]\n }\n\n checkMods(key)\n }\n })\n\n checkSize()\n checkDefaults()\n localeWarning()\n bigNumberWarning()\n\n settings.toggleSubs()\n },\n\n /** Apply settings. */\n apply: () => {\n const appTheme =\n app.settings.theme === 'system'\n ? isElectron\n ? numara.isDark()\n ? 'dark'\n : 'light'\n : 'light'\n : app.settings.theme === 'light'\n ? 'light'\n : 'dark'\n\n $('#style').setAttribute('href', 'css/' + appTheme + '.css')\n $('#numaraLogo').setAttribute('src', 'assets/logo-' + appTheme + '.png')\n\n const udfuTheme =\n app.settings.theme === 'system'\n ? isElectron\n ? numara.isDark()\n ? 'material-darker'\n : 'default'\n : 'default'\n : app.settings.theme === 'light'\n ? 'default'\n : 'material-darker'\n\n udfInput.setOption('theme', udfuTheme)\n uduInput.setOption('theme', udfuTheme)\n\n if (isElectron) {\n numara.setTheme(app.settings.theme)\n numara.setOnTop(app.settings.alwaysOnTop)\n }\n\n const elements = $all('.panelFont, .input .CodeMirror')\n\n for (const el of elements) {\n el.style.fontSize = app.settings.fontSize\n el.style.fontWeight = app.settings.fontWeight\n el.style.setProperty('line-height', app.settings.lineHeight, 'important')\n }\n\n $('#input').style.width = (app.settings.divider ? app.settings.inputWidth : settings.defaults.inputWidth) + '%'\n $('#panelDivider').style.display = app.settings.divider ? 'block' : 'none'\n $('#output').style.textAlign = app.settings.divider ? 'left' : 'right'\n\n cm.setOption('mode', app.settings.syntax ? 'numara' : 'plain')\n cm.setOption('lineNumbers', app.settings.lineNumbers)\n cm.setOption('lineWrapping', app.settings.lineWrap)\n cm.setOption('matchBrackets', app.settings.syntax && app.settings.matchBrackets ? { maxScanLines: 1 } : false)\n cm.setOption('autoCloseBrackets', app.settings.closeBrackets)\n\n math.config({\n matrix: app.settings.matrixType,\n number: app.settings.numericOutput,\n predictable: app.settings.predictable\n })\n\n setTimeout(calculate, 10)\n },\n\n /** Save settings to local storage. */\n save: () => {\n Object.keys(app.settings).forEach((key) => {\n const el = $('#' + key)\n\n if (el) {\n app.settings[key] = el.getAttribute('type') === 'checkbox' ? el.checked : el.value\n\n checkMods(key)\n }\n })\n\n if (!$('#currency').checked) {\n localStorage.removeItem('rateDate')\n\n app.currencyRates = {}\n }\n\n $('#currencyUpdate').style.visibility = $('#currency').checked ? 'visible' : 'hidden'\n\n if (!store.get('rateDate') && app.settings.currency) {\n getRates()\n }\n\n checkDefaults()\n localeWarning()\n bigNumberWarning()\n\n settings.toggleSubs()\n\n store.set('settings', app.settings)\n },\n\n /** Toggle settings sliders to enabled/disabled based on parent setting. */\n toggleSubs: () => {\n $('#expUpper').disabled = app.settings.notation !== 'auto'\n $('#expLower').disabled = app.settings.notation !== 'auto'\n $('#keywordTips').disabled = !app.settings.syntax\n $('#matchBrackets').disabled = !app.settings.syntax\n $('#copyThouSep').disabled = !app.settings.thouSep\n\n $('#expUpper').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#expLower').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#keywordTips').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#matchBrackets').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#copyThouSep').parentNode.style.opacity = app.settings.thouSep ? '1' : '0.5'\n\n $('#expUpperMod').style.pointerEvents = app.settings.notation === 'auto' ? 'auto' : 'none'\n $('#expLowerMod').style.pointerEvents = app.settings.notation === 'auto' ? 'auto' : 'none'\n $('#keywordTipsMod').style.pointerEvents = app.settings.syntax ? 'auto' : 'none'\n $('#matchBracketsMod').style.pointerEvents = app.settings.syntax ? 'auto' : 'none'\n $('#copyThouSepMod').style.pointerEvents = app.settings.thouSep ? 'auto' : 'none'\n\n $('#expUpperMod').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#expLowerMod').parentNode.style.opacity = app.settings.notation === 'auto' ? '1' : '0.5'\n $('#keywordTipsMod').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#matchBracketsMod').parentNode.style.opacity = app.settings.syntax ? '1' : '0.5'\n $('#copyThouSepMod').parentNode.style.opacity = app.settings.thouSep ? '1' : '0.5'\n }\n}\n\n$('#defaultSettingsButton').addEventListener('click', () => {\n confirm('All settings will revert back to defaults.', () => {\n app.settings = JSON.parse(JSON.stringify(settings.defaults))\n\n store.set('settings', app.settings)\n\n settings.prep()\n settings.save()\n settings.apply()\n })\n})\n\n$('#dialog-settings-reset').addEventListener('click', () => {\n confirm('All user settings and data will be lost.', () => {\n if (isElectron) {\n numara.resetApp()\n } else {\n localStorage.clear()\n location.reload()\n }\n })\n})\n\nif (isElectron) {\n $('#resetSizeButton').addEventListener('click', numara.resetSize)\n}\n\n$('#localeWarn').addEventListener('click', () => {\n showError(\n 'Caution: Locale',\n `Your locale (${app.settings.locale}) uses comma (,) as decimal separator. Therefore, you must use semicolon (;) as argument separator when using functions.

    Ex. sum(1;3) // 4`\n )\n})\n\n$('#bigNumWarn').addEventListener('click', () => {\n showError(\n 'Caution: BigNumber Limitations',\n `Using the BigNumber may break function plotting and is not compatible with some math functions. \n It may also cause unexpected behavior and affect overall performance.

    \n Read more on BigNumbers`\n )\n})\n\n$('#precision').addEventListener('input', () => {\n $('#precision-label').innerHTML = $('#precision').value\n})\n\n$('#expLower').addEventListener('input', () => {\n $('#expLower-label').innerHTML = $('#expLower').value\n})\n\n$('#expUpper').addEventListener('input', () => {\n $('#expUpper-label').innerHTML = $('#expUpper').value\n})\n\n$all('.settingItem').forEach((el) => {\n el.addEventListener('change', () => {\n settings.save()\n settings.apply()\n })\n})\n", "import { $, $all, app, store } from './common'\nimport { cm } from './editor'\nimport { generateIcons } from './icons'\nimport { confirm, notify, showModal } from './modal'\nimport { isElectron } from './utils'\n\nimport { DateTime } from 'luxon'\n\nimport UIkit from 'uikit'\n\n/** Migrate old saved calculations to pages */\nexport function migrateSaved() {\n const saved = store.get('saved')\n const pages = store.get('pages')\n\n if (saved) {\n Object.entries(saved).forEach(([id, val]) => {\n pages.push({ id, name: val[0], data: val[1] })\n })\n\n store.set('pages', pages)\n\n localStorage.removeItem('saved')\n }\n}\n\n/** Get page name/number to use */\nexport function getPageName() {\n const pages = store.get('pages')\n\n let pageNo = 1\n\n if (pages) {\n const regex = new RegExp(/\\b(Page \\d+)$\\b/)\n const pageNos = pages\n .filter((page) => regex.test(page.name.trim()))\n .map((page) => +page.name.split(' ')[1])\n .sort((a, b) => a - b)\n\n const max = Math.max(...pageNos)\n\n if (pageNos[0] === 1) {\n for (let i = 0; i < max; i++) {\n if (pageNos[i + 1] !== pageNos[i] + 1) {\n pageNo = pageNos[i] + 1\n break\n }\n }\n }\n }\n\n return 'Page ' + pageNo\n}\n\n/** Get last page from store */\nexport const lastPage = () => store.get('lastPage')\n\n/** Populate the page list in side bar */\nexport function populatePages() {\n const pages = store.get('pages')\n\n if (!pages || pages.length === 0) {\n defaultPage()\n }\n\n $('#pageList').innerHTML = ''\n\n pages.forEach((page) => {\n const pageListItem = document.createElement('div')\n\n pageListItem.id = page.id\n pageListItem.classList.add(\n 'pageListItem',\n 'uk-flex-middle',\n app.activePage === page.id ? 'activePage' : 'inactivePage'\n )\n pageListItem.innerHTML = `\n
    \n
    ${page.name}
    \n
    ${DateTime.fromFormat(page.id, 'yyyyMMddHHmmssSSS').toFormat('FF')}
    \n
    \n
    \n \n
    \n
    Rename
    \n
    Duplicate
    \n
    Delete
    \n
    \n
    \n `\n\n pageListItem.addEventListener('click', (event) => {\n if (event.target.parentNode.dataset.action === 'load') {\n loadPage(page.id)\n\n UIkit.offcanvas('#sidePanel').hide()\n }\n\n switch (event.target.dataset.action) {\n case 'rename':\n UIkit.dropdown(event.target.parentNode).hide(0)\n renamePage(page.id)\n break\n case 'delete':\n deletePage(page.id)\n break\n case 'duplicate':\n duplicatePage(page.id)\n break\n }\n })\n\n $('#pageList').appendChild(pageListItem)\n })\n\n generateIcons()\n}\n\n/**\n * Load page\n *\n * @param {*} pageId Id of the page to load\n */\nexport function loadPage(pageId) {\n const page = store.get('pages').find((page) => page.id === pageId)\n const cursor = page.cursor\n\n app.activePage = pageId\n\n store.set('lastPage', pageId)\n\n $('#pageName').innerHTML = page.name\n $('#pageName').title = page.name\n\n cm.setValue(page.data)\n\n if (page.history) {\n cm.setHistory(page.history)\n }\n\n cm.execCommand('goLineEnd')\n\n if (cursor) {\n cm.setCursor(cursor)\n cm.scrollIntoView(cursor)\n }\n\n populatePages()\n}\n\n/** Generate default page */\nexport function defaultPage() {\n const pageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pageName = getPageName()\n\n store.set('pages', [{ id: pageId, name: pageName, data: store.get('input') || '' }])\n\n localStorage.removeItem('input')\n\n loadPage(pageId)\n}\n\n/**\n * Create new page\n *\n * @param {boolean} isImport Is the new page imported? true | false\n */\nexport function newPage(isImport) {\n const pageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pages = store.get('pages')\n const pageName =\n $('#newPageTitleInput').value.replace(/<|>/g, '').trim() || (isImport ? 'Imported page' : getPageName())\n\n const pageNames = pages.map((p) => p.name)\n\n if (pageNames.includes(pageName)) {\n notify(`\"${pageName}\" already exists. Please choose a different page name.`, 'danger')\n return\n }\n\n app.activePage = pageId\n\n pages.push({ id: pageId, name: pageName, data: '' })\n\n store.set('pages', pages)\n store.set('lastPage', pageId)\n\n cm.setValue('')\n\n populatePages()\n\n $('#pageName').innerHTML = pageName\n\n UIkit.modal('#dialog-newPage').hide()\n}\n\n/**\n * Delete page\n *\n * @param {*} pageId Id of the page to delete\n */\nexport function deletePage(pageId) {\n let pages = store.get('pages')\n\n confirm('\"' + pages.find((page) => page.id === pageId).name + '\" will be deleted.', () => {\n pages = pages.filter((page) => page.id !== pageId)\n\n store.set('pages', pages)\n\n if (pages.length === 0) {\n defaultPage()\n } else if (pageId === app.activePage) {\n loadPage(pages.pop().id)\n }\n\n populatePages()\n })\n}\n\n/**\n * Rename page\n *\n * @param {*} pageId Id of the page to rename\n */\nexport function renamePage(pageId) {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === pageId)\n\n $('#renamePageTitleInput').value = page.name\n\n showModal('#dialog-renamePage')\n\n function rename() {\n page.name = $('#renamePageTitleInput').value.replace(/<|>/g, '').trim() || getPageName()\n\n store.set('pages', pages)\n\n populatePages()\n\n $('#pageName').innerHTML = page.name\n\n UIkit.modal('#dialog-renamePage').hide()\n\n $('#dialog-renamePage-save').removeEventListener('click', rename)\n }\n\n $('#dialog-renamePage-save').addEventListener('click', rename)\n}\n\n/**\n * Duplicate page\n *\n * @param {*} pageId Id of the page to duplicate\n */\nexport function duplicatePage(pageId) {\n const dupPageId = DateTime.local().toFormat('yyyyMMddHHmmssSSS')\n const pages = store.get('pages')\n const dupPage = pages.find((page) => page.id === pageId)\n const dupPageData = dupPage.data\n const dupPageName = dupPage.name + ' (copy)'\n\n app.activePage = dupPageId\n\n pages.push({ id: dupPageId, name: dupPageName, data: dupPageData })\n\n store.set('pages', pages)\n\n loadPage(dupPageId)\n}\n\n/** Sort page list */\nexport function sortPages(by) {\n const pages = store.get('pages')\n\n let sortedPages\n\n switch (by) {\n case 'oldnew':\n sortedPages = pages.sort((a, b) => a.id - b.id)\n break\n case 'newold':\n sortedPages = pages.sort((a, b) => b.id - a.id)\n break\n case 'az':\n sortedPages = pages.sort((a, b) => a.name.localeCompare(b.name))\n break\n case 'za':\n sortedPages = pages.sort((a, b) => b.name.localeCompare(a.name))\n break\n }\n\n store.set('pages', sortedPages)\n\n populatePages()\n\n UIkit.dropdown('#sortDropdown').hide(0)\n}\n\n/** Sort page list after drag */\nexport function pageOrder() {\n const pages = store.get('pages')\n const pageList = $all('#pageList > div')\n const orderedPages = [...pageList].map((el) => pages.find((page) => page.id === el.getAttribute('id')))\n\n store.set('pages', orderedPages)\n}\n\nexport function deleteAllPages() {\n confirm('All pages will be deleted permanently.', () => {\n store.set('pages', [])\n\n defaultPage()\n\n populatePages()\n })\n}\n\nfunction newPageDialog() {\n $('#newPageTitleInput').value = ''\n $('#newPageTitleInput').focus()\n\n showModal('#dialog-newPage')\n}\n\n$('#newPageButton').addEventListener('click', newPageDialog)\n\n$('#newPageButtonSP').addEventListener('click', newPageDialog)\n\n$('#dialog-newPage-save').addEventListener('click', () => {\n newPage(false)\n})\n\n$('#newPageTitleInput').addEventListener('keyup', (event) => {\n if (event.key === 'Enter' || event.keyCode === 13) {\n $('#dialog-newPage-save').click()\n }\n})\n\n$('#deleteAllPagesButton').addEventListener('click', deleteAllPages)\n\n$('#renamePageTitleInput').addEventListener('keyup', (event) => {\n if (event.key === 'Enter' || event.keyCode === 13) {\n $('#dialog-renamePage-save').click()\n }\n})\n\n$('#sortOldNew').addEventListener('click', () => {\n sortPages('oldnew')\n})\n\n$('#sortNewOld').addEventListener('click', () => {\n sortPages('newold')\n})\n\n$('#sortAZ').addEventListener('click', () => {\n sortPages('az')\n})\n\n$('#sortZA').addEventListener('click', () => {\n sortPages('za')\n})\n\n$('#closeSidePanelButton').addEventListener('click', () => {\n UIkit.offcanvas('#sidePanel').hide()\n})\n\n$('#printButton').addEventListener('click', () => {\n window.print()\n})\n\nif (isElectron) {\n // Import calculations from file\n $('#importButton').addEventListener('click', numara.import)\n\n numara.importData((event, data, msg) => {\n newPage(true)\n\n cm.setValue(data)\n\n notify(msg, 'success')\n })\n\n numara.importDataError((event, error) => {\n notify(error, 'danger')\n })\n\n numara.main.import(numara.import)\n\n // Export calculations to file\n $('#exportButton').addEventListener('click', () => {\n const pages = store.get('pages')\n const page = pages.find((page) => page.id === app.activePage).name\n numara.export(page, cm.getValue())\n })\n\n numara.exportData((event, msg) => {\n notify(msg, 'success')\n })\n\n numara.exportDataError((event, error) => {\n notify(error, 'danger')\n })\n\n numara.main.export(() => {\n numara.export($('#newPageTitleInput').value, cm.getValue())\n })\n\n // Print window from main\n numara.main.print(() => {\n UIkit.offcanvas('#sidePanel').hide()\n\n window.print()\n })\n} else {\n $all('#exportButton, #importButton, #spDivider').forEach((el) => el.remove())\n}\n", "import { $, app, store } from './common'\nimport { udfInput, uduInput } from './editor'\nimport { showError } from './modal'\n\n/**\n * User defined functions and units.\n *\n * @param {*} input User defined function or unit to apply.\n * @param {string} type 'func' | 'unit'\n */\nexport function applyUdfu(input, type) {\n return new Promise(function (resolve, reject) {\n try {\n const loadUD =\n type === 'func'\n ? new Function(`'use strict'; let window; let numara; math.import({${input}}, {override: true})`)\n : new Function(`'use strict'; let window; let numara; math.createUnit({${input}}, {override: true})`)\n\n loadUD()\n\n const UDFunc = new Function(`'use strict'; return {${input}}`)\n\n for (const f in UDFunc()) {\n app[type === 'func' ? 'udfList' : 'uduList'].push(f)\n }\n\n store.set(type === 'func' ? 'udf' : 'udu', input)\n\n resolve()\n } catch (error) {\n reject(error)\n }\n })\n}\n\n$('#dialog-udfu-save-f').addEventListener('click', () => {\n applyUdfu(udfInput.getValue().trim(), 'func')\n .then(() => {\n location.reload()\n })\n .catch((error) => {\n showError(error.name, error.message)\n })\n})\n\n$('#dialog-udfu-save-u').addEventListener('click', () => {\n applyUdfu(uduInput.getValue().trim(), 'unit')\n .then(() => {\n location.reload()\n })\n .catch((error) => {\n showError(error.name, error.message)\n })\n})\n", "/**\r\n * adds a bindGlobal method to Mousetrap that allows you to\r\n * bind specific keyboard shortcuts that will still work\r\n * inside a text input field\r\n *\r\n * usage:\r\n * Mousetrap.bindGlobal('ctrl+s', _saveChanges);\r\n */\r\n/* global Mousetrap:true */\r\n(function(Mousetrap) {\r\n var _globalCallbacks = {};\r\n var _originalStopCallback = Mousetrap.prototype.stopCallback;\r\n\r\n Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {\r\n var self = this;\r\n\r\n if (self.paused) {\r\n return true;\r\n }\r\n\r\n if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {\r\n return false;\r\n }\r\n\r\n return _originalStopCallback.call(self, e, element, combo);\r\n };\r\n\r\n Mousetrap.prototype.bindGlobal = function(keys, callback, action) {\r\n var self = this;\r\n self.bind(keys, callback, action);\r\n\r\n if (keys instanceof Array) {\r\n for (var i = 0; i < keys.length; i++) {\r\n _globalCallbacks[keys[i]] = true;\r\n }\r\n return;\r\n }\r\n\r\n _globalCallbacks[keys] = true;\r\n };\r\n\t\r\n\tMousetrap.prototype.unbindGlobal = function(keys, action) {\r\n\t\tvar self = this;\r\n\t\tself.unbind(keys, action);\r\n\r\n\t\tif (keys instanceof Array) {\r\n\t\t\tfor (var i = 0; i < keys.length; i++) {\r\n\t\t\t\t_globalCallbacks[keys[i]] = false;\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t_globalCallbacks[keys] = false;\r\n\t};\r\n\r\n Mousetrap.init();\r\n}) (Mousetrap);\r\n"], + "mappings": ";;;;;;;;;irBAAA,IAAAA,EAAAC,GAAA,QCwDA,SAASC,IAAKC,EAAKC,EAAO,CACxB,KAAK,IAAMD,EACX,KAAK,MAAQC,CACf,CA6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,GAASrC,GAAIsC,EAAG,EAAE,KAAK,EAE7C,OAAIxH,EAAMuH,GAAS,KAAK,KAAK,IAC3B1G,GAAE,MAAQ,GAEZqE,GAAI,KAAKrE,EAAC,EACHqE,EACT,EACA,IAAIuC,EAAW,CACb,KAAM,CACJ,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,CACF,EACA,MAAO,CACL,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,GACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,GACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,KAAM,CACJ,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,GACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,IACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,IAAK,CACH,KAAM,MACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,OAAQ,CACN,KAAM,SACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,GACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,IACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,KACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,KAAM,CACJ,KAAM,OACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,MAAO,CACL,KAAM,QACN,MAAO,MACP,WAAY,EACd,EACA,OAAQ,CACN,KAAM,SACN,MAAO,MACP,WAAY,EACd,CACF,EACA,QAAS,CACP,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,MAAO,CACL,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,MACP,WAAY,EACd,CACF,EACA,gBAAiB,CACf,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,IACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,EACA,EAAG,CACD,KAAM,IACN,MAAO,KACP,WAAY,EACd,CACF,EACA,iBAAkB,CAChB,GAAI,CACF,KAAM,GACN,MAAO,EACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KACP,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAAI,KAAM,CAAC,EACvB,WAAY,EACd,EACA,GAAI,CACF,KAAM,KACN,MAAO,KAAK,IAA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,GACV,IAAK,GACL,KAAM,GACN,MAAO,GACP,OAAQ,GACR,IAAK,GACL,IAAK,GACL,GAAI,GACJ,QAAS,GACT,MAAO,GACP,IAAK,EAIP,EAWAV,GAAS,MAAQ,CAAC3B,EAQlB,CACE,EAAG,SACH,EAAG,GACL,EAIA,CACE,EAAG,gBAEH,SAAU,CACR,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,WAEH,SAAU,CACR,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,uBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,EACA,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,uBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,EACA,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,uBAEH,SAAU,CACR,SAAU,CACR,YAAa,EACf,EACA,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,WACH,EAAG,QACL,EAAG,CACD,EAAG,KACH,EAAG,UACL,EAEA,CACE,EAAG,iBACH,EAAG,oBACH,OAAQ,EACV,EAEA,CACE,EAAG,UACH,EAAG,UACL,EAEA,CACE,EAAG,OACH,EAAG,SACL,EAAG,CACD,EAAG,8BACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,oCACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAEA,CACE,EAAG,iCACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAEA,CACE,EAAG,4BACH,EAAG,8BACL,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,+DACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,MACH,EAAG,KACL,EAAG,CACD,EAAG,uBACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,2BACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,CACF,CACF,EAKAD,EAIA,CACE,EAAG,aACH,SAAU,CACR,IAAK,CACH,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,OACH,EAAG,GACL,EAAG,CACD,EAAG,YACH,EAAG,UACL,EAEA,CACE,EAAG,gBACH,EAAG,YACL,EAEA,CACE,EAAG,2BACH,EAAG,+BACL,EAAG,CACD,EAAG,2BACH,EAAG,+BACL,EAEA,CACE,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8BACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,uBACH,SAAU,CACR,OAAQ,CACN,MAAO,EACT,EACA,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8DACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,8DACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,YACH,EAAG,UACL,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAG,CACD,EAAG,wBACH,SAAU,CACR,SAAU,CACR,YAAa,EACf,CACF,CACF,EAAGA,EAIH,CACE,EAAG,qBACH,SAAU,CACR,SAAU,CACR,MAAO,EACT,CACF,CACF,EAAG,CACD,EAAG,qBAEH,SAAU,CACR,SAAU,CACR,MAAO,EACT,EACA,SAAU,CACR,YAAa,EACf,CACF,CACF,EAEA,CACE,EAAG,iBACH,SAAU,CACR,IAAK,CACH,YAAa,EACf,CACF,EACA,cAAe,CACb,IAAK,CACH,YAAa,EACf,CACF,CACF,EAAG,CACD,E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UAENnD,GAAI,SAAS,YAAc,gCAAkCgD,EAAS,GAAK,QAAU,EAAE;AAAA,2BACtEhD,GAAI,SAAS,UAAU,OAAOiD,CAAK;AAAA,gCAC9BjD,GAAI,SAAS,QAAU,OAAS,OAAO,KAAKkD,CAAM;AAAA,aAG9E/D,GAAE,cAAc,EAAE,WAAagE,CACjC,CAAC,EAEDL,EAAU,WAAa,UACzB,CAAC,EAED,OAAO,iBAAiB,aAAc,IAAM,CAC1C3D,GAAE,YAAY,EAAE,OAAO,CACzB,CAAC", + "names": ["init_dirname", "__esmMin", "Item", "fun", "array", "hrtime", "previousTimestamp", "baseNow", "_performance", "clocktime", "seconds", "nanoseconds", "nanoPerSec", "env", "nowOffset", "init_process", "__esmMin", "init_dirname", "init_buffer", "time", "diff", "init_process", "__esmMin", "dew$2", "_dewExec$2", "exports$3", "byteLength", "toByteArray", "fromByteArray", "lookup", "revLookup", "Arr", "code", "len", "getLens", "b64", "validLen", "placeHoldersLen", "lens", "_byteLength", "tmp", "arr", "curByte", "i", "tripletToBase64", "num", "encodeChunk", "uint8", "start", "end", "output", "extraBytes", "parts", "maxChunkLength", "len2", "dew$1", "_dewExec$1", "exports$2", "buffer", "offset", "isLE", "mLen", "nBytes", "e", "m", "eLen", "eMax", "eBias", "nBits", "d", "s", "value", "c", "rt", "dew", "_dewExec", "exports$1", "base64", "ieee754", "customInspectSymbol", "Buffer", "SlowBuffer", "K_MAX_LENGTH", "typedArraySupport", "proto", "createBuffer", "length", "buf", "arg", "encodingOrOffset", "allocUnsafe", "from", "fromString", "fromArrayView", "isInstance", "fromArrayBuffer", "valueOf", "b", "fromObject", "assertSize", "size", "alloc", "fill", "encoding", "checked", "string", "actual", "fromArrayLike", "array", "arrayView", "copy", "byteOffset", "obj", "numberIsNaN", "a", "x", "y", "list", "pos", "mustMatch", "loweredCase", "utf8ToBytes", "base64ToBytes", "slowToString", "hexSlice", "utf8Slice", "asciiSlice", "latin1Slice", "base64Slice", "utf16leSlice", "swap", "n", "str", "max", "target", "thisStart", "thisEnd", "thisCopy", "targetCopy", "bidirectionalIndexOf", "val", "dir", "arrayIndexOf", "indexSize", "arrLength", "valLength", "read", "foundIndex", "found", "j", "hexWrite", "remaining", "strLen", "parsed", "utf8Write", "blitBuffer", "asciiWrite", "asciiToBytes", "base64Write", "ucs2Write", "utf16leToBytes", "res", "firstByte", "codePoint", "bytesPerSequence", "secondByte", "thirdByte", "fourthByte", "tempCodePoint", "decodeCodePointsArray", "MAX_ARGUMENTS_LENGTH", "codePoints", "ret", "out", "hexSliceLookupTable", "bytes", "newBuf", "checkOffset", "ext", "noAssert", "mul", "defineBigIntMethod", "validateNumber", "first", "last", "boundsError", "lo", "hi", "checkInt", "min", "maxBytes", "wrtBigUInt64LE", "checkIntBI", "wrtBigUInt64BE", "limit", "sub", "checkIEEE754", "writeFloat", "littleEndian", "writeDouble", "targetStart", "errors", "E", "sym", "getMessage", "Base", "name", "range", "input", "msg", "received", "addNumericalSeparator", "checkBounds", "type", "INVALID_BASE64_RE", "base64clean", "units", "leadSurrogate", "byteArray", "src", "dst", "alphabet", "table", "i16", "fn", "BufferBigIntNotDefined", "exports", "INSPECT_MAX_BYTES", "kMaxLength", "init_buffer", "__esmMin", "init_dirname", "init_process", "init_buffer", "__esmMin", "require_uikit", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "factory", "hasOwnProperty", "toString", "hasOwn", "obj", "key", "hyphenateRe", "hyphenate", "memoize", "str", "camelizeRe", "camelize", "_", "c", "ucfirst", "startsWith", "search", "_a", "endsWith", "includes", "findIndex", "array", "predicate", "isArray", "toArray", "assign", "isFunction", "isObject", "isPlainObject", "isWindow", "isDocument", "nodeType", "isNode", "isElement", "isBoolean", "value", "isString", "isNumber", "isNumeric", "isEmpty", "isUndefined", "toBoolean", "toNumber", "number", "toFloat", "toNode", "element", "toNodes", "toWindow", "document", "isEqual", "other", "each", "val", "swap", "a", "b", "match", "last", "cb", "sortBy", "prop", "propA", "propB", "sumBy", "iteratee", "sum", "item", "uniqueBy", "seen", "check", "pick", "props", "res", "clamp", "min", "max", "noop", "intersectRect", "rects", "minProp", "maxProp", "pointInRect", "point", "rect", "ratio", "dimensions", "aProp", "contain", "maxDimensions", "cover$1", "Dimensions", "getIndex", "i", "elements", "current", "finite", "length", "fn", "cache", "args", "addClass", "classes", "node", "add", "toClasses", "cls", "hasClass", "removeClass", "remove", "replaceClass", "oldClass", "newClass", "toggleClass", "force", "cls2", "attr", "name", "el", "removeAttr", "hasAttr", "element2", "data", "attribute", "inBrowser", "isRtl", "hasTouch", "hasPointerEvents", "pointerDown$1", "pointerMove$1", "pointerUp$1", "pointerEnter", "pointerLeave", "pointerCancel", "voidElements", "isVoidElement", "isVisibleFn", "isVisible", "selInput", "isInput", "matches", "selFocusable", "isFocusable", "parent", "filter$1", "selector", "parents", "children", "children2", "index", "ref", "isSameSiteAnchor", "part", "getTargetedElement", "hash", "ownerDocument", "id", "query", "context", "find", "getContext", "queryAll", "findAll", "_query", "parseSelector", "addStarRe", "splitSelectorRe", "trailingCommaRe", "isContextSelector", "selectors", "sel", "parsePositionSelector", "index2", "queryFn", "parsed", "_doQuery", "isSingle", "positionSel", "ctx", "domPath", "names", "escape", "tagName", "css", "on", "targets", "types", "listener", "useCapture", "getArgs", "detail", "selfFilter", "delegate", "type", "target", "off", "once", "condition", "off2", "e", "result", "trigger", "event", "detail2", "toEventTargets", "createEvent", "bubbles", "cancelable", "isEventTarget", "toEventTarget", "isTouch", "getEventPos", "_b", "x", "y", "cssNumber", "property", "priority", "propName", "style", "prefix", "prefixedName", "clsTransition", "transitionEnd", "transitionCanceled", "transition$1", "duration", "timing", "resolve", "reject", "timer", "Transition", "clsAnimation", "animationEnd", "animationCanceled", "animate$2", "animation", "origin", "out", "Animation", "ready", "isTag", "tagNames", "empty", "$", "html", "parent2", "html2", "append", "prepend", "applyFn", "before", "after", "nodes", "fragment", "unwrapSingle", "remove$1", "wrapAll", "structure", "wrapInner", "unwrap", "self", "singleTagRe", "container", "apply", "next", "isHtml", "$$", "dirs$1", "dimensions$1", "height", "width", "offset", "coordinates", "currentOffset", "scrollY", "scrollX", "offsetBy", "dir", "position", "top", "left", "body", "documentElement", "offsetParent", "parentOffset", "offsetPosition", "offset2", "win", "dimension", "doc", "boxModelAdjust", "sizing", "prop2", "flipPosition", "pos", "toPx", "offsetDim", "parseCalc", "value2", "unit", "parseUnit", "percent", "getViewportHeight", "calcRe", "calc", "unitRe$1", "base", "vh", "vhEl", "fastdom", "read", "write", "clear", "flush", "reads", "writes", "task", "scheduleFlush", "scheduled", "runTasks", "tasks", "MouseTracker", "p", "right", "bottom", "prevPosition", "path", "diagonal", "intersection", "intersect", "x1", "y1", "x2", "y2", "x3", "y3", "x4", "y4", "denominator", "ua", "observeIntersection", "options", "intersecting", "observer", "entries", "observer2", "entry", "hasResizeObserver", "observeResize", "observe$1", "cb2", "observeViewportResize", "observeMutation", "Observer", "play", "isIFrame", "call", "isHTML5", "pause", "mute", "isVideo", "isYoutube", "isVimeo", "cmd", "enableApi", "post", "stateKey", "counter", "youtube", "vimeo", "poller", "isInView", "offsetTop", "offsetLeft", "overflowParents", "offsetViewport", "scrollIntoView", "parents2", "scrollParents", "scrollElement", "scrollTop", "scrollHeight", "offsetHeight", "viewport", "maxScroll", "elHeight", "elTop", "scrollTo", "targetEl", "scroll", "getDuration", "start", "isScrollingElement", "scrollingElement", "targetTop", "prev", "frames", "step", "ease", "diff", "getCoveringElement", "dist", "k", "scrolledOver", "startOffset", "endOffset", "scrollParent", "viewportHeight", "elementOffsetTop", "end", "scrollable", "scrollEl", "ancestors", "fixedIndex", "window", "viewportElement", "scale", "subpixel", "coverEl", "hasPosition", "zIndex", "dirs", "positionAt", "getPosition", "attachTo", "boundary", "viewportOffset", "placement", "getViewport$2", "isWithin", "attach", "flip", "scrollArea", "getScrollArea", "applyOffset", "newPos", "flipAxis", "targetDim", "elOffset", "targetOffset", "moveBy", "dim", "getIntersectionArea", "commonScrollParents", "axis", "area", "positionA", "positionB", "flipAttach", "flipOffset", "flipAttachAxis", "newAttach", "util", "Class", "units", "countdown", "timespan", "getTimeSpan", "digits", "digit", "date", "total", "strats", "concatStrat", "parentVal", "childVal", "vm", "mergeFnData", "vm2", "defaultStrat", "mergeOptions", "child", "mixin", "mergeKey", "parseOptions", "options2", "option", "coerce$1", "toList", "listRe", "initUpdates", "instance", "prependUpdate", "update", "clearUpdateData", "callUpdate", "runUpdates", "events", "resize", "observe", "mutation", "lazyload", "preload", "el2", "isIntersecting", "handler", "scroll$1", "toScrollTargets", "swipe", "e2", "swipeDirection", "observe2", "emit", "Margin", "$el", "getRows", "rows", "row", "sorted", "withOffset", "getOffset", "offsetCurrent", "j", "offsetCurrent2", "offsetWidth", "slide", "action", "awaitFrame", "currentProps", "getProps$1", "targetProps", "targetStyle", "targetPropsTo", "propsTo", "propsFrom", "getTransitionProps", "attrsTo", "transitions", "resetProps", "opacity", "getPositionWithMargin", "from", "clsLeave", "clsEnter", "fade", "stagger", "transitionIndex", "propsIn", "propsOut", "wrapIndexFn", "leaveFn", "getTransitionNodes", "enterFn", "oldHeight", "newHeight", "transitionNodes", "awaitTimeout", "waitTransitionend", "timeout", "Animate", "keyMap", "filter", "attrItem", "toggles", "actives", "toggle", "button", "findButton", "list", "prevState", "newState", "mergeState", "isEqualState", "state", "animate", "matchFilter", "filterFn", "applyState", "getFilter", "attr2", "stateA", "stateB", "sort", "order", "sortItems", "group", "stateFilter", "stateSort", "stateOrder", "prevented", "preventBackgroundScroll", "offMove", "clientHeight", "Container", "Togglable", "transition", "show", "promise", "toggleInstant", "toggleTransition", "toggleAnimation", "done", "toggled", "changed", "_toggle", "velocity", "mode", "startProp", "dimProp", "marginProp", "marginStartProp", "currentDim", "inProgress", "prevProps", "currentMargin", "marginStart", "endDim", "wrapper", "endProps", "cmp", "active$1", "Modal", "selPanel", "bgClose", "selClose", "defaultPrevented", "modal", "handlers", "preventBackgroundFocus", "listenForBackgroundClose$1", "listenForEscClose$1", "animate$1", "transitionElement", "toMs", "time", "newTarget", "Animations$2", "translate", "translated", "scale3d", "Transitioner$1", "easing", "withResolvers", "percent2", "linear", "triggerUpdate", "props2", "I18n", "params", "_c", "SliderAutoplay", "autoplay", "pointerOptions", "pointerUpOptions", "pointerDown", "pointerMove", "pointerUp", "preventClick", "SliderDrag", "selList", "hasSelectableText", "distance", "slides", "prevIndex", "dis", "nextIndex", "getDistance", "edge", "itemShown", "dirChange", "initWatches", "watches", "watch", "registerWatch", "runWatches", "values", "immediate", "initComputed", "computed", "registerComputed", "mutationOptions", "_computed", "$props", "initComputedUpdates", "resetComputed", "disconnectComputedUpdates", "initEvents", "registerEvent", "unbindEvents", "unbind", "capture", "passive", "initObservers", "registerObservable", "registerObserver", "disconnectObservers", "observable", "targets2", "updateTargets", "initProps", "$options", "getProps", "methods", "opts", "data$1", "getAttributes", "attributes", "initPropsObserver", "records", "attributeName", "callHook", "hook", "callConnected", "callDisconnected", "uid", "init$1", "normalizeData", "initData", "initMethods", "data2", "App", "PREFIX", "DATA", "components$2", "component", "createComponent", "opt", "Component", "init", "getComponent", "getComponents", "attachToElement", "detachFromElement", "globalApi", "plugin", "component2", "Super", "Sub", "parentEl", "updateElement", "components", "instanceApi", "removeEl", "generateId", "SliderNav", "selNav", "nav", "items", "ariaLabel", "ariaControls", "selNavItem", "parallax", "keyCode", "active", "easeOutQuad", "easeOutQuart", "Slider", "speedUp", "stack", "queueIndex", "reset", "getDirection", "transitioner", "Slideshow", "Animations2", "Animations$1", "LightboxPanel", "close", "closeLabel", "src", "alt", "poster", "attrs", "iframeAttrs", "img", "createEl", "video", "content", "tag", "lightbox", "install$3", "toItem", "source", "UIkit", "Lightbox", "notification", "install$2", "posClass", "containerAttr", "margin", "removeFn", "Media", "media", "toMedia", "getMaxPathLength", "stroke", "transformFn", "colorFn", "cssPropFn", "strokeFn", "backgroundFn", "keys", "Parallax", "fillObject", "properties", "stops", "css2", "getUnit", "transformFn2", "stop", "parseStops", "getValue", "getCssValue", "parseColor", "getStop", "color", "bgProps", "backgroundCoverFn", "positions", "getBackgroundPos", "setBackgroundPosFn", "dimImage", "getBackgroundImageDimensions", "dimEl", "down", "overflow", "loading", "image", "toDimensions", "nullIndex", "leftPercent", "targetPercent", "unitRe", "defaultUnit", "keys2", "getOffsetElement", "viewport2", "SliderParallax", "parallaxTarget", "slidePercent", "triggerShow", "triggerShown", "triggerHide", "triggerHidden", "useTriggers", "clsSlideActive", "SliderReactive", "SliderPreload", "Transitioner", "center", "getLeft", "to", "getWidth", "itemIn", "itemOut", "isActive", "isIn", "isOut", "translateIn", "getElLeft", "nextActives", "inView", "temp", "centerEl", "getMax", "listLeft", "listWidth", "listRight", "slideLeft", "slideRight", "slider", "isFinite", "lft", "enabled", "sets", "slideWidth", "avgWidth", "slideIndex", "currentIndex", "activeClasses", "focusable", "currentLeft", "scrollDist", "slideDist", "getMaxElWidth", "listHalf", "slidesInView", "nextSlide", "slide2", "sliderParallax", "getCurrentPercent", "Animations", "slideshow", "sortable", "handle", "handles", "placeholder", "findTarget", "previous", "insertTarget", "findInsertTarget", "appendDrag", "trackScroll", "throttle", "untrackScroll", "clsPlaceholder", "clsItem", "sortable2", "trackTimer", "height2", "clone", "sameList", "isHorizontal", "placeholderRect", "sameRow", "linesIntersect", "pointerPos", "lengthProp", "endProp", "single", "isHorizontal2", "rectA", "rectB", "lineA", "lineB", "throttled", "Position", "restoreScrollPosition", "storeScrollPosition", "elDim", "tooltip", "makeFocusable", "delay", "title", "parseProps", "titleAttr", "align", "getAlignment", "upload", "transfer", "files", "file", "match$1", "chunks", "chunk", "files2", "xhr", "ajax", "env", "xhr2", "pattern", "size", "url", "send", "header", "components$1", "boot", "connect", "applyChildListMutation", "applyAttributeMutation", "addedNodes", "removedNodes", "disconnect", "getComponentName", "components2", "Accordion", "isOpen", "hide", "keepScrollPosition", "activeItems", "hide2", "transition2", "currentHeight", "endHeight", "frame", "alert", "Video", "isPlaying", "videoEl", "cover", "getPositionedParent", "useObjectFit", "intrinsic", "coverHeight", "coverWidth", "coverDim", "drop", "boundaryX", "boundaryY", "targetX", "targetY", "createToggleComponent", "listenForResize", "listenForEscClose", "listenForBackgroundClose", "listenForScroll", "listenForScrollClose", "viewports", "getViewport$1", "maxWidth", "positionOffset", "Dropnav", "dropbarAnchor", "dropbar", "clsDrop", "dropdowns", "active2", "handleNavItemNavigation", "dropContainer", "adjustHeight", "maxBottom", "formCustom", "input", "grid", "parallaxJustify", "masonry", "positionedAbsolute", "gutter", "getGutter", "columns", "translates", "applyMasonry", "transpose", "columnHeights", "column", "scrollColumns", "parallaxStart", "parallaxEnd", "hgt", "padding", "scrolled", "rowHeights", "push", "heightMatch", "elements2", "heights", "getHeight", "heightPlaceholder", "heightViewport", "expand", "minHeight", "box", "offsetTopEl", "closeIcon", "closeLarge", "dropParentIcon", "marker", "navParentIconLarge", "navParentIcon", "navbarParentIcon", "navbarToggleIcon", "overlayIcon", "paginationNext", "paginationPrevious", "searchIcon", "searchLarge", "searchMedium", "slidenavNextLarge", "slidenavNext", "slidenavPreviousLarge", "slidenavPrevious", "spinner", "totop", "Svg", "svg", "insertSVG", "applyWidthAndHeight", "root", "equals", "viewBox", "applyAttributes", "applyAnimation", "parseSVG", "loadSVG", "icon", "parseSymbols", "stringToSvg", "symbolRe", "symbols", "string", "icons", "Icon", "install$1", "getIcon", "IconComponent", "NavParentIcon", "Search", "isToggle", "label", "Spinner", "ButtonComponent", "Slidenav", "NavbarToggleIcon", "Close", "Marker", "Totop", "PaginationNext", "PaginationPrevious", "added", "svg2", "name2", "aliases", "applyRtl", "isImg", "setSrcAttrs", "getImageFromElement", "parentNode", "setSourceProps", "srcProps", "sourceEl", "sources", "wrapInPicture", "parseSources", "picture", "inverse", "findTargetColor", "checkVisibility", "leader", "fill", "install", "dialog", "message", "openDialog", "i18n", "tmpl", "hideFn", "submitFn", "clsNavbarTransparent", "navbar", "justify", "containers", "awaitMacroTask", "offcanvas", "clsFlip", "overlay", "clsOverlay", "clsMode", "clsSidebarAnimation", "clsContainerAnimation", "swiping", "suppressUserScale", "resumeUserScale", "getViewport", "overflowAuto", "selContainer", "selContent", "responsive", "registerClick", "unregisterClick", "instances", "clickHandler", "clsInView", "scrollspy", "inview", "removeAnimationClasses", "scrollspyNav", "closest", "links", "sticky", "selTarget", "coerce", "height$1", "preventTransition", "dynamicViewport", "maxScrollHeight", "referenceElement", "offset$1", "topOffset", "parseProp", "prevScroll", "prevDir", "overflowScroll", "scroll2", "isScrollUpdate", "initTimestamp", "below", "now", "offsetParentTop", "propOffset", "refElement", "clsTransitionDisable", "selDisabled", "Switcher", "connects", "connectChildren", "isVertical", "itemNav", "tab", "KEY_SPACE", "expanded", "m", "link", "mediaObj", "leaving", "isLeaving", "ok", "notOk", "undef", "NOT_TYPED_FUNCTION", "create", "isPlainObject", "x", "_types", "anyType", "typeMap", "typeList", "nConversions", "typed", "findType", "typeName", "type", "message", "name", "otherName", "addTypes", "types", "beforeSpec", "beforeIndex", "newTypes", "i", "affectedTypes", "clear", "clearConversions", "findTypeNames", "value", "matches", "isTypedFunction", "entity", "findSignature", "fn", "signature", "options", "exact", "stringSignature", "params", "parseSignature", "canonicalSignature", "stringifyParams", "match", "nParams", "remainingSignatures", "want", "filteredSignatures", "possibility", "have", "getParamAtIndex", "haveTypes", "paramTypeSet", "wtype", "candidate", "find", "convert", "conversions", "separator", "p", "parseParam", "param", "restParam", "typeDefs", "s", "hasAny", "paramName", "expandParam", "typeNames", "t", "matchingConversions", "availableConversions", "newName", "convertibleTypes", "conversion", "rawSignature", "rawParams", "parsedParam", "hasRestParam", "last", "compileTest", "test0", "test1", "tests", "compileTests", "initial", "varIndex", "lastTest", "testRestParam", "args", "index", "getTypeSetAtIndex", "isExactType", "mergeExpectedParams", "signatures", "typeSet", "paramSet", "createError", "err", "expected", "_name", "matchingSignatures", "nextMatchingDefs", "test", "actualTypes", "lengths", "maxLength", "argTypes", "getLowestTypeIndex", "min", "getLowestConversionIndex", "compareParams", "param1", "param2", "typeDiff", "convDiff", "compareSignatures", "signature1", "signature2", "pars1", "pars2", "last1", "last2", "hasRest1", "hasRest2", "any1", "conv1", "par", "any2", "conv2", "lengthCriterion", "comparisons", "tc", "thisComparison", "c", "t1", "t2", "knownTypes", "newMatch", "compileArgsPreprocessing", "fnConvert", "compiledConversions", "compileArgConversion", "fnPreprocess", "offset", "slice", "conversion0", "conversion1", "arg", "splitParams", "_splitParams", "paramsSoFar", "resultingParams", "exactTypes", "flatMap", "nextParam", "conflicting", "params1", "params2", "ii", "typeSet1", "typeSet2", "overlap", "len1", "len2", "restParam1", "restParam2", "clearResolutions", "functionList", "isReferToSelf", "referToSelf", "isReferTo", "makeReferTo", "collectResolutions", "references", "signatureMap", "resolvedReferences", "reference", "resolution", "resolveReferences", "self", "resolvedFunctions", "isResolved", "leftUnresolved", "nothingResolved", "validateDeprecatedThis", "signaturesMap", "deprecatedThisRegex", "createTypedFunction", "rawSignaturesMap", "parsedParams", "originalFunctions", "preliminarySignatures", "pp", "functionIndex", "conversionParams", "sp", "spName", "theTypedFn", "internalSignatureMap", "ok0", "ok1", "ok2", "ok3", "ok4", "ok5", "allOk", "test00", "test10", "test20", "test30", "test40", "test50", "test01", "test11", "test21", "test31", "test41", "test51", "fn0", "fn1", "fn2", "fn3", "fn4", "fn5", "len0", "len3", "len4", "len5", "iStart", "iEnd", "fns", "generic", "arg0", "arg1", "_onMismatch", "arr", "start", "end", "findInArray", "callback", "referTo", "objectOrFn", "checkName", "nameSoFar", "getObjectName", "obj", "key", "mergeSignatures", "dest", "source", "saveTyped", "maybeName", "named", "allSignatures", "item", "theseSignatures", "thisName", "beforeObjectTest", "before", "_validateConversion", "to", "existing", "other", "existingConversion", "tf", "argList", "sigs", "typedFunction", "require_complex", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "root", "cosh", "x", "sinh", "cosm1", "b", "xx", "hypot", "y", "a", "parser_exit", "logHypot", "_a", "_b", "parse", "z", "Complex", "tokens", "plus", "minus", "i", "c", "abs", "d", "t", "arg", "loh", "r", "re", "im", "tmp", "t1", "t2", "res", "noIM", "oneMinus", "onePlus", "temp", "places", "ret", "require_naturalSort", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "naturalSort", "a", "b", "re", "sre", "dre", "hre", "ore", "i", "s", "x", "y", "xN", "yN", "xD", "yD", "oFxNcL", "oFyNcL", "cLoc", "numS", "require_dist", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "_extends", "target", "i", "source", "key", "defaultEscapes", "formatEscapes", "defaultEscapeMapFn", "str", "_ref", "_ref$preserveFormatti", "preserveFormatting", "_ref$escapeMapFn", "escapeMapFn", "runningStr", "result", "escapes", "escapeKeys", "_loop", "specialCharFound", "index", "require_alea", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "Alea", "seed", "me", "mash", "Mash", "t", "copy", "f", "impl", "opts", "xg", "state", "prng", "n", "data", "i", "h", "require_xor128", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "XorGen", "seed", "me", "strseed", "t", "k", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xorwow", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "XorGen", "seed", "me", "strseed", "t", "k", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xorshift7", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "XorGen", "seed", "me", "X", "i", "t", "v", "w", "init", "j", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_xor4096", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "XorGen", "seed", "me", "w", "X", "i", "t", "v", "init", "j", "limit", "copy", "f", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "require_tychei", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "define", "XorGen", "seed", "me", "strseed", "b", "c", "d", "a", "k", "copy", "f", "t", "impl", "opts", "xg", "state", "prng", "top", "bot", "result", "empty_exports", "__export", "empty_default", "init_empty", "__esmMin", "init_dirname", "init_buffer", "init_process", "require_seedrandom", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "pool", "math", "width", "chunks", "digits", "rngname", "startdenom", "significance", "overflow", "mask", "nodecrypto", "seedrandom", "seed", "options", "callback", "key", "shortseed", "mixkey", "flatten", "tostring", "autoseed", "arc4", "ARC4", "prng", "n", "d", "x", "is_math_call", "state", "copy", "t", "keylen", "me", "i", "j", "s", "count", "r", "f", "obj", "depth", "result", "typ", "prop", "stringseed", "smear", "out", "browser", "plugins", "a", "require_seedrandom", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "alea", "xor128", "xorwow", "xorshift7", "xor4096", "tychei", "sr", "require_tiny_emitter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "E", "name", "callback", "ctx", "e", "self", "listener", "data", "evtArr", "i", "len", "evts", "liveEvents", "require_jstat", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "window", "factory", "jStat", "Math", "undefined", "concat", "slice", "toString", "calcRdx", "n", "m", "val", "isArray", "arg", "isFunction", "isNumber", "num", "toVector", "arr", "args", "i", "fn", "obj", "j", "index", "submat", "ind", "column", "a", "nrow", "res", "row", "objArr", "rows", "cols", "func", "toAlter", "ncol", "col", "retZero", "retOne", "retIdent", "size", "min", "max", "length", "hival", "step", "current", "cnt", "start", "end", "rl", "_slice", "list", "rcSlice", "colSlice", "rowSlice", "A", "B", "nl", "ml", "diagArray", "mat", "t", "jProto", "funcs", "passfunc", "self", "results", "ascNum", "b", "clip", "sum", "mean", "tmp", "prod", "low", "high", "hash", "_arr", "logs", "meanOfLogs", "arrlen", "diffs", "arrLen", "distinctNumbers", "numberCounts", "number", "sortedDistinctNumbers", "numberRanks", "currentRank", "count", "first", "last", "rank", "maxCount", "numMaxCount", "mode_arr", "flag", "sumsqerr", "samples", "dev", "median", "quantilesArray", "alphap", "betap", "sortedArray", "quantileVals", "p", "aleph", "k", "gamma", "exclusive", "realIndex", "frac", "score", "kind", "counter", "len", "strict", "value", "binCnt", "binWidth", "bins", "arr1", "arr2", "u", "v", "arr1Len", "sq_dev", "mu", "sigma", "skewSum", "fullbool", "tmpthis", "callbackFunction", "argsToPass", "curriedFunction", "vector", "x", "cof", "ser", "xx", "y", "x0", "x2", "xp", "gl", "gl0", "q", "fact", "xden", "xnum", "z", "yi", "aln", "ap", "del", "c", "d", "h", "ITMAX", "an", "fpmin", "qab", "qap", "qam", "m2", "aa", "a1", "EPS", "gln", "err", "pp", "lna1", "afac", "isneg", "dd", "ty", "b1", "lna", "lnb", "al", "w", "bt", "shape", "oalph", "a2", "newthis", "vals", "fnfunc", "alpha", "beta", "df1", "df2", "f", "x1", "local", "scale", "dof", "rate", "ncp", "tol", "min_iterations", "flip", "prob", "lastvalue", "std", "dof2", "betinc", "eps", "a0", "b0", "m9", "c9", "betacdf", "s", "r", "N", "scaledPDF", "samplesDone", "scaledCDF", "factor", "l", "sumarr", "L", "lam", "U", "V", "slam", "loglam", "invalpha", "vr", "us", "laplaceSign", "tukeyWprob", "rr", "cc", "nleg", "ihalf", "C1", "C2", "C3", "bb", "wlar", "wincr1", "wincr2", "xleg", "aleg", "qsqz", "pr_w", "wincr", "blb", "binc", "bub", "einsum", "cc1", "wi", "elsum", "jj", "ac", "qexpo", "pplus", "pminus", "rinsum", "tukeyQinv", "p0", "q0", "p1", "q1", "p2", "q2", "p3", "q3", "p4", "q4", "c1", "c2", "c3", "c4", "c5", "vmax", "ps", "nmeans", "df", "nlegq", "ihalfq", "eps1", "eps2", "dhaf", "dquar", "deigh", "dlarg", "ulen1", "ulen2", "ulen3", "ulen4", "xlegq", "alegq", "f2", "f2lf", "f21", "ff4", "ulen", "ans", "otsum", "twa1", "t1", "wprb", "rotsum", "maxiter", "valx0", "valx1", "iter", "xabs", "push", "isUsable", "nrescols", "rescols", "left", "right", "nnorm", "newarr", "result", "det", "determinant", "submatrix", "sign", "maug", "pivot", "temp", "y2", "maxrow", "parts", "matrix_mode", "R", "T", "xv", "xk", "range", "qr2", "R_I", "I", "Aj", "cAi", "Ij", "cIi", "qr_solve", "array_mode", "QR", "Q", "attrs", "Q1", "R1", "RI", "Q2", "condition", "e", "ev", "maxim", "theta", "t_j", "u_j", "order", "k1", "k2", "u_j1", "k3", "k4", "h1", "g", "X", "pos", "h_min", "y1", "F", "dF", "dl", "temp1", "D", "temp2", "Y", "Bt", "C", "Vt", "sides", "zscore", "tscore", "expVar", "sample", "sampMean", "sampSampMean", "tmpargs", "unexpVar", "anovafscore", "fscore", "mean1", "mean2", "n1", "n2", "sd", "qscore", "arrays", "means", "change", "pvalue", "differenceOfProportions", "pooled", "se", "sub_regress", "exog", "var_count", "modelList", "endog_index", "exog_index", "ols", "endog", "nobs", "df_model", "df_resid", "coef", "predict", "resid", "ybar", "SSE", "SSR", "SST", "R2", "t_test", "model", "subModelList", "sigmaHat", "seBetaHat", "mod", "tStatistic", "pValue", "leftppf", "interval95", "F_test", "F_statistic", "fcdf", "ols_wrap", "ttest", "ftest", "adjust_R2", "matrixRows", "array", "jMat", "pass", "jMatX", "jMatY", "innerinv", "xtransp", "next", "compile", "jMatYBar", "yAverage", "covar", "sds", "ts", "inner", "yBar", "ssr", "sse", "sst", "require_bessel", "__commonJSMin", "exports", "init_dirname", "init_buffer", "init_process", "BESSEL", "factory", "module", "M", "_horner", "arr", "v", "i", "z", "_bessel_iter", "x", "n", "f0", "f1", "sign", "tdx", "f2", "o", "_bessel_wrap", "bessel0", "bessel1", "name", "nonzero", "b0", "b1", "besselj", "W", "b0_a1a", "b0_a2a", "b0_a1b", "b0_a2b", "a", "a1", "a2", "y", "xx", "b1_a1a", "b1_a2a", "b1_a1b", "b1_a2b", "ret", "m", "jsum", "bjp", "sum", "bj", "bjm", "tox", "j", "bessely", "besseli", "b0_a", "b0_b", "b1_a", "b1_b", "bip", "bi", "bim", "besselk", "require_codemirror", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "global", "factory", "userAgent", "platform", "gecko", "ie_upto10", "ie_11up", "edge", "ie", "ie_version", "webkit", "qtwebkit", "chrome", "chrome_version", "presto", "safari", "mac_geMountainLion", "phantom", "ios", "android", "mobile", "mac", "chromeOS", "windows", "presto_version", "flipCtrlCmd", "captureRightClick", "classTest", "cls", "rmClass", "node", "current", "match", "after", "removeChildren", "e", "count", "removeChildrenAndAdd", "parent", "elt", "tag", "content", "className", "style", "i", "eltP", "range", "start", "end", "endNode", "r", "contains", "child", "activeElt", "rootNode", "doc", "activeElement", "addClass", "joinClasses", "a", "b", "as", "selectInput", "cm", "root", "element", "win", "bind", "f", "args", "copyObj", "obj", "target", "overwrite", "prop", "countColumn", "string", "tabSize", "startIndex", "startValue", "n", "nextTab", "Delayed", "self", "ms", "time", "indexOf", "array", "scrollerGap", "Pass", "sel_dontScroll", "sel_mouse", "sel_move", "findColumn", "goal", "pos", "col", "skipped", "spaceStrs", "spaceStr", "lst", "arr", "map", "out", "insertSorted", "value", "score", "priority", "nothing", "createObj", "base", "props", "inst", "nonASCIISingleCaseWordChar", "isWordCharBasic", "ch", "isWordChar", "helper", "isEmpty", "extendingChars", "isExtendingChar", "skipExtendingChars", "str", "dir", "findFirst", "pred", "from", "to", "midF", "mid", "iterateBidiSections", "order", "found", "part", "bidiOther", "getBidiPartAt", "sticky", "cur", "bidiOrdering", "lowTypes", "arabicTypes", "charType", "code", "bidiRE", "isNeutral", "isStrong", "countsAsLeft", "countsAsNum", "BidiSpan", "level", "direction", "outerType", "len", "types", "i$1", "prev", "type", "i$2", "type$1", "i$3", "prev$1", "type$2", "i$4", "type$3", "replace", "j", "i$5", "cur$1", "type$4", "i$6", "end$1", "before", "replace$1", "j$1", "m", "i$7", "at", "isRTL", "j$2", "nstart", "getOrder", "line", "noHandlers", "on", "emitter", "getHandlers", "off", "index", "signal", "handlers", "signalDOMEvent", "override", "e_defaultPrevented", "signalCursorActivity", "set", "hasHandler", "eventMixin", "ctor", "e_preventDefault", "e_stopPropagation", "e_stop", "e_target", "e_button", "dragAndDrop", "div", "zwspSupported", "zeroWidthElement", "measure", "test", "badBidiRects", "hasBadBidiRects", "txt", "r0", "r1", "splitLinesAuto", "result", "l", "nl", "rt", "hasSelection", "te", "hasCopyEvent", "badZoomedRects", "hasBadZoomedRects", "normal", "fromRange", "modes", "mimeModes", "defineMode", "name", "mode", "defineMIME", "mime", "spec", "resolveMode", "getMode", "options", "mfactory", "modeObj", "modeExtensions", "exts", "prop$1", "extendMode", "properties", "copyState", "state", "nstate", "val", "innerMode", "info", "startState", "a1", "a2", "StringStream", "lineOracle", "ok", "pattern", "consume", "caseInsensitive", "cased", "substr", "inner", "oracle", "getLine", "chunk", "sz", "getBetween", "text", "getLines", "updateLineHeight", "height", "diff", "lineNo", "no", "lineAtHeight", "h", "outer", "lh", "isLine", "lineNumberFor", "Pos", "cmp", "equalCursorPos", "copyPos", "x", "maxPos", "minPos", "clipLine", "clipPos", "last", "clipToLen", "linelen", "clipPosArray", "SavedContext", "lookAhead", "Context", "saved", "copy", "highlightLine", "context", "forceToEnd", "st", "lineClasses", "runMode", "loop", "o", "overlay", "i_end", "getLineStyles", "updateFrontier", "getContextBefore", "resetState", "precise", "display", "findStartLine", "processLine", "startAt", "stream", "callBlankLine", "readToken", "Token", "takeToken", "asArray", "tokens", "extractLineClasses", "output", "lineClass", "flattenSpans", "curStart", "curStyle", "mName", "minindent", "minline", "lim", "search", "indented", "retreatFrontier", "sawReadOnlySpans", "sawCollapsedSpans", "seeReadOnlySpans", "seeCollapsedSpans", "MarkedSpan", "marker", "getMarkedSpanFor", "spans", "span", "removeMarkedSpan", "addMarkedSpan", "op", "inThisOp", "markedSpansBefore", "old", "startCh", "isInsert", "nw", "startsBefore", "endsAfter", "markedSpansAfter", "endCh", "stretchSpansOverChange", "change", "oldFirst", "oldLast", "first", "sameLine", "offset", "span$1", "found$1", "clearEmptySpans", "newMarkers", "gap", "gapMarkers", "removeReadOnlyRanges", "markers", "mark", "parts", "mk", "p", "newParts", "dfrom", "dto", "detachMarkedSpans", "attachMarkedSpans", "extraLeft", "extraRight", "compareCollapsedMarkers", "lenDiff", "aPos", "bPos", "fromCmp", "toCmp", "collapsedSpanAtSide", "sps", "sp", "collapsedSpanAtStart", "collapsedSpanAtEnd", "collapsedSpanAround", "conflictingCollapsedRange", "visualLine", "merged", "visualLineEnd", "visualLineContinued", "lines", "visualLineNo", "lineN", "vis", "visualLineEndNo", "lineIsHidden", "lineIsHiddenInner", "heightAtLine", "lineObj", "lineLength", "findMaxLine", "Line", "markedSpans", "estimateHeight", "updateLine", "estHeight", "cleanUpLine", "styleToClassCache", "styleToClassCacheWithMode", "interpretTokenStyle", "cache", "buildLineContent", "lineView", "builder", "buildToken", "buildTokenBadBidi", "allowFrontierUpdate", "insertLineContent", "defaultSpecialCharPlaceholder", "token", "startStyle", "endStyle", "css", "attributes", "displayText", "splitSpaces", "special", "mustWrap", "txt$1", "tabWidth", "fullStyle", "attr", "trailingBefore", "spaceBefore", "buildCollapsedSpan", "size", "ignoreWidget", "widget", "styles", "allText", "nextChange", "spanStyle", "spanEndStyle", "spanStartStyle", "collapsed", "foundBookmarks", "endStyles", "upto", "tokenText", "LineView", "buildViewArray", "nextPos", "view", "operationGroup", "pushOperation", "fireCallbacksForOps", "group", "callbacks", "finishOperation", "endCb", "orphanDelayedCallbacks", "signalLater", "list", "fireOrphanDelayed", "delayed", "updateLineForChanges", "dims", "updateLineText", "updateLineGutter", "updateLineClasses", "updateLineWidgets", "ensureLineWrapped", "updateLineBackground", "wrap", "getLineContent", "ext", "built", "textClass", "wrap$1", "gutterWrap", "k", "id", "isWidget", "next", "insertLineWidgets", "buildLineElement", "insertLineWidgetsFor", "allowAbove", "ws", "positionLineWidget", "width", "widgetHeight", "parentStyle", "eventInWidget", "paddingTop", "paddingVert", "paddingH", "data", "scrollGap", "displayWidth", "displayHeight", "ensureLineHeights", "rect", "wrapping", "curWidth", "heights", "rects", "mapFromLineView", "updateExternalMeasurement", "measureChar", "bias", "measureCharPrepared", "prepareMeasureForLine", "findViewForLine", "findViewIndex", "getDimensions", "prepared", "varHeight", "key", "measureCharInner", "nullRect", "nodeAndOffsetInLineMap", "collapse", "mStart", "mEnd", "getUsefulRect", "place", "maybeUpdateRectForZooming", "rSpan", "charWidth", "rtop", "rbot", "top", "bot", "scaleX", "scaleY", "clearLineMeasurementCacheFor", "clearLineMeasurementCache", "clearCaches", "pageScrollX", "pageScrollY", "widgetTopHeight", "ref", "widgets", "intoCoordSystem", "includeWidgets", "yOff", "lOff", "xOff", "fromCoordSystem", "coords", "left", "localBox", "lineSpaceBox", "charCoords", "cursorCoords", "preparedMeasure", "get", "right", "getBidi", "partPos", "invert", "other", "estimateCoords", "PosWithInfo", "outside", "xRel", "coordsChar", "y", "coordsCharInner", "rangeEnd", "wrappedLineExtent", "begin", "wrappedLineExtentChar", "targetTop", "boxIsAfter", "box", "ltr", "coordsBidiPartWrapped", "coordsBidiPart", "chAround", "boxAround", "baseX", "atLeft", "atStart", "_lineNo", "closestDist", "endX", "dist", "measureText", "textHeight", "anchor", "pre", "gutterLeft", "compensateForHScroll", "th", "perLine", "widgetsHeight", "estimateLineHeights", "est", "posFromMouse", "liberal", "forRect", "space", "colDiff", "regChange", "lendiff", "resetView", "cut", "viewCuttingPoint", "cut$1", "cutTop", "cutBot", "regLineChange", "oldN", "newN", "adjustView", "countDirtyView", "dirty", "updateSelection", "prepareSelection", "primary", "curFragment", "selFragment", "customCursor", "head", "drawSelectionCursor", "drawSelectionRange", "cursor", "charPos", "otherCursor", "cmpCoords", "fragment", "padding", "leftSide", "rightSide", "docLTR", "add", "bottom", "drawForLine", "fromArg", "toArg", "lineLen", "wrapX", "side", "extent", "fromPos", "toPos", "openStart", "openEnd", "openLeft", "openRight", "topLeft", "topRight", "botLeft", "botRight", "sFrom", "sTo", "fromLine", "toLine", "singleVLine", "leftEnd", "rightStart", "restartBlink", "onBlur", "ensureFocus", "onFocus", "delayBlurEvent", "updateHeightsInViewport", "prevBottom", "viewTop", "oldHeight", "mustScroll", "updateWidgetHeight", "chWidth", "w", "visibleLines", "viewport", "ensureFrom", "ensureTo", "maybeScrollWindow", "doScroll", "scrollNode", "scrollPosIntoView", "margin", "limit", "changed", "endCoords", "scrollPos", "calculateScrollPos", "startTop", "startLeft", "updateScrollTop", "setScrollLeft", "scrollIntoView", "snapMargin", "screentop", "screen", "docBottom", "atTop", "atBottom", "newTop", "gutterSpace", "screenleft", "screenw", "tooWide", "addToScrollTop", "resolveScrollToPos", "ensureCursorVisible", "scrollToCoords", "scrollToRange", "scrollToCoordsRange", "sPos", "updateDisplaySimple", "setScrollTop", "startWorker", "forceScroll", "isScroller", "alignHorizontally", "measureForScrollbars", "gutterW", "docH", "NativeScrollbars", "scroll", "vert", "horiz", "needsH", "needsV", "sWidth", "totalHeight", "totalWidth", "bar", "delay", "maybeDisable", "NullScrollbars", "updateScrollbars", "startWidth", "startHeight", "updateScrollbarsInner", "d", "sizes", "scrollbarModel", "initScrollbars", "axis", "nextOpId", "startOperation", "endOperation", "endOperations", "ops", "endOperation_R1", "endOperation_W1", "endOperation_R2", "endOperation_W2", "endOperation_finish", "maybeClipScrollbars", "DisplayUpdate", "updateDisplayIfNeeded", "takeFocus", "setDocumentHeight", "postUpdateDisplay", "hidden", "unhidden", "runInOp", "operation", "methodOp", "docMethodOp", "highlightWorker", "changedLines", "oldStyles", "highlighted", "oldCls", "newCls", "ischange", "force", "selectionSnapshot", "active", "sel", "restoreSelection", "snapshot", "update", "maybeUpdateLineNumberWidth", "different", "toUpdate", "selSnapshot", "patchDisplay", "barMeasure", "updateNumbersFrom", "lineNumbers", "container", "rm", "updateNumber", "updateGutterSpace", "comp", "align", "innerW", "getGutters", "gutters", "sawLineNumbers", "renderGutters", "specs", "gElt", "updateGutters", "Display", "input", "wheelSamples", "wheelPixelsPerUnit", "wheelEventDelta", "dx", "dy", "wheelEventPixels", "delta", "onScrollWheel", "pixelsPerUnit", "canScrollX", "canScrollY", "pixels", "movedX", "movedY", "sample", "Selection", "ranges", "primIndex", "here", "there", "Range", "normalizeSelection", "mayTouch", "prim", "inv", "simpleSelection", "changeEnd", "adjustForChange", "computeSelAfterChange", "offsetPos", "computeReplacedSel", "changes", "hint", "oldPrev", "newPrev", "loadMode", "resetModeState", "isWholeLineUpdate", "updateDoc", "spansFor", "linesFor", "firstLine", "lastLine", "lastText", "lastSpans", "nlines", "added", "added$1", "added$2", "linkedDocs", "sharedHistOnly", "propagate", "skip", "sharedHist", "rel", "shared", "attachDoc", "setDirectionClass", "directionChanged", "History", "historyChangeFromChange", "histChange", "attachLocalSpans", "clearSelectionEvents", "lastChangeEvent", "hist", "addChangeToHistory", "selAfter", "opId", "pushSelectionToHistory", "selectionEventCanBeMerged", "origin", "addSelectionToHistory", "dest", "existing", "removeClearedSpans", "getOldSpans", "mergeOldSpans", "stretched", "oldCur", "stretchCur", "copyHistoryArray", "events", "newGroup", "instantiateSel", "event", "newChanges", "extendRange", "extend", "posBefore", "extendSelection", "setSelection", "extendSelections", "heads", "newSel", "replaceOneSelection", "setSimpleSelection", "filterSelectionChange", "setSelectionReplaceHistory", "done", "setSelectionNoUndo", "setSelectionInner", "skipAtomicInSelection", "reCheckSelection", "mayClear", "newAnchor", "skipAtomic", "newHead", "skipAtomicInner", "oldPos", "preventCursorLeft", "preventCursorRight", "near", "movePos", "far", "selectAll", "filterChange", "makeChange", "ignoreReadOnly", "split", "makeChangeInner", "makeChangeSingleDoc", "rebased", "rebaseHist", "makeChangeFromHistory", "allowSelectionOnly", "suppress", "source", "antiChanges", "filter", "returned", "shiftDoc", "distance", "shift", "makeChangeSingleDocInEditor", "recomputeMaxLength", "checkWidthStart", "changesHandler", "changeHandler", "replaceRange", "assign", "rebaseHistSelSingle", "rebaseHistArray", "sub", "changeLine", "handle", "changeType", "LeafChunk", "BranchChunk", "children", "remaining", "leaf", "me", "spilled", "sibling", "myIndex", "used", "LineWidget", "opt", "adjustScrollWhenAboveVisible", "this$1", "oldH", "addLineWidget", "aboveVisible", "nextMarkerId", "TextMarker", "withOp", "min", "max", "visual", "dHeight", "markText", "markTextShared", "curLine", "updateMaxLine", "SharedTextMarker", "findSharedMarkers", "copySharedMarkers", "mFrom", "mTo", "subMark", "detachSharedMarkers", "linked", "subMarker", "nextDocId", "Doc", "lineSep", "dup", "undone", "forceSplit", "gen", "histData", "gutterID", "where", "realOpts", "sepSize", "copyHistory", "CodeMirror", "link", "splitIds", "lastDrop", "onDrop", "clearDragCursor", "files", "read", "markAsReadAndPasteIfAllFilesAreRead", "t", "readTextFromFile", "file", "reader", "text$1", "selected", "onDragStart", "img", "onDragOver", "frag", "forEachCodeMirror", "byClass", "editors", "globalsRegistered", "ensureGlobalHandlers", "registerGlobalHandlers", "resizeTimer", "onResize", "keyNames", "keyMap", "normalizeKeyName", "alt", "ctrl", "cmd", "mod", "normalizeKeyMap", "keymap", "keyname", "keys", "lookupKey", "getKeyMap", "isModifierKey", "addModifierNames", "noShift", "keyName", "deleteNearSelection", "compute", "kill", "toKill", "replaced", "moveCharLogically", "moveLogically", "endOfLine", "visually", "moveInStorageOrder", "prep", "moveVisually", "bidi", "mv", "getWrappedLineExtent", "searchInVisualLine", "getRes", "res", "nextCh", "commands", "leftPos", "rightPos", "lineStart", "lineStartSmart", "lineEnd", "spaces", "sels", "firstNonWS", "inWS", "doHandleBinding", "bound", "dropShift", "prevShift", "lookupKeyForEditor", "stopSeq", "dispatchKey", "seq", "dispatchKeyInner", "handleKeyBinding", "handleCharBinding", "lastStoppedKey", "onKeyDown", "handled", "showCrossHair", "lineDiv", "up", "onKeyUp", "onKeyPress", "keyCode", "charCode", "DOUBLECLICK_DELAY", "PastClick", "button", "lastClick", "lastDoubleClick", "clickRepeat", "now", "onMouseDown", "clickInGutter", "repeat", "handleMappedButton", "leftButtonDown", "configureMouse", "option", "behavior", "contained", "leftButtonStartDrag", "leftButtonSelect", "moved", "dragEnd", "mouseMove", "dragStart", "e2", "rangeForUnit", "unit", "ourRange", "ourIndex", "startSel", "lastPos", "extendTo", "startCol", "posCol", "oldRange", "ranges$1", "bidiSimplify", "editorSize", "counter", "curCount", "visible", "move", "anchorLine", "boundary", "headIndex", "usePart", "gutterEvent", "prevent", "mX", "mY", "lineBox", "g", "gutter", "onContextMenu", "contextMenuInGutter", "themeChanged", "Init", "defaults", "optionHandlers", "defineOptions", "deflt", "notOnInit", "newBreaks", "wrappingChanged", "integer", "dragDropChanged", "wasOn", "funcs", "toggle", "registerEventHandlers", "initHooks", "word", "touchFinished", "prevTouch", "finishTouch", "isMouseLikeTouchEvent", "touch", "farAway", "inp", "indentLine", "how", "aggressive", "curSpace", "curSpaceString", "indentation", "indentString", "pos$1", "lastCopied", "setLastCopied", "newLastCopied", "applyTextInput", "inserted", "deleted", "recent", "paste", "textLines", "multiPaste", "updateInput", "changeEvent", "triggerElectric", "handlePaste", "pasted", "copyableRanges", "lineRange", "disableBrowserMagic", "field", "spellcheck", "autocorrect", "autocapitalize", "hiddenTextarea", "addEditorMethods", "helpers", "maps", "overlays", "newRanges", "help", "vspace", "hspace", "amount", "findPosH", "goalColumn", "findPosV", "goals", "headPos", "startChar", "check", "scroller", "interpret", "phraseText", "phrases", "predicate", "origDir", "lineDir", "findNextLine", "moveOnce", "boundToLine", "astral", "sawType", "pageSize", "moveAmount", "ContentEditableInput", "belongsToInput", "onCopyCut", "kludge", "hadFocus", "label", "curAnchor", "domToPos", "curFocus", "posToDOM", "rng", "poll", "isInGutter", "fromIndex", "fromNode", "toIndex", "toNode", "newText", "domTextBetween", "oldText", "cutFront", "cutEnd", "oldTop", "maxCutFront", "newBot", "oldBot", "maxCutEnd", "chFrom", "chTo", "scan", "badPos", "bad", "closing", "extraLinebreak", "recognizeMarker", "close", "addText", "walk", "cmText", "markerID", "isBlock", "lineNode", "locateNodeInLineView", "wrapper", "textNode", "topNode", "find", "curNode", "dist$1", "TextareaInput", "prepareCopyCut", "_display", "opts", "wrapOff", "lineOff", "drawn", "typing", "missed", "prevInput", "same", "reset", "oldCSS", "oldWrapperCSS", "wrapperBox", "oldScrollY", "rehide", "prepareSelectAllHack", "extval", "mouseup", "fromTextArea", "textarea", "hasFocus", "save", "realSubmit", "form", "wrappedSubmit", "addLegacyProps", "dontDelegate", "method", "func", "require_javascript", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "config", "parserConfig", "indentUnit", "statementIndent", "jsonldMode", "jsonMode", "trackScope", "isTS", "wordRE", "keywords", "kw", "type", "A", "B", "C", "D", "operator", "atom", "isOperatorChar", "isJsonldKeyword", "readRegexp", "stream", "escaped", "next", "inSet", "content", "ret", "tp", "style", "cont", "tokenBase", "state", "ch", "tokenString", "tokenComment", "expressionAllowed", "tokenQuasi", "word", "quote", "maybeEnd", "brackets", "findFatArrow", "arrow", "m", "depth", "sawSomething", "pos", "bracket", "atomicTypes", "JSLexical", "indented", "column", "align", "prev", "info", "inScope", "varname", "v", "cx", "parseJS", "cc", "combinator", "expression", "statement", "pass", "i", "inList", "name", "list", "register", "newContext", "registerVarScoped", "Var", "context", "inner", "Context", "isModifier", "vars", "block", "defaultVars", "pushcontext", "pushblockcontext", "popcontext", "pushlex", "result", "indent", "outer", "poplex", "expect", "wanted", "exp", "value", "vardef", "parenExpr", "maybeexpression", "maybeelse", "functiondef", "forspec", "className", "enumdef", "typename", "typeexpr", "pattern", "maybelabel", "maybeCatchBinding", "afterExport", "afterImport", "funarg", "expressionInner", "expressionNoComma", "noComma", "body", "arrowBodyNoComma", "arrowBody", "commasep", "maybeop", "maybeoperatorNoComma", "maybeoperatorComma", "classExpression", "arrayLiteral", "contCommasep", "objprop", "quasi", "maybeTarget", "me", "expr", "property", "continueQuasi", "targetNoComma", "target", "maybeTypeArgs", "_", "getterSetter", "afterprop", "maybetype", "what", "end", "sep", "proceed", "lex", "maybetypeOrIn", "mayberettype", "isKW", "afterType", "typeprops", "typearg", "maybeReturnType", "quasiType", "typeprop", "functiondecl", "continueQuasiType", "typeparam", "maybeTypeDefault", "maybeAssign", "vardefCont", "eltpattern", "proppattern", "_type", "forspec1", "forspec2", "classNameAfter", "classBody", "classfield", "isInterface", "maybeFrom", "exportField", "importSpec", "maybeMoreImports", "maybeAs", "enummember", "isContinuedStatement", "textAfter", "backUp", "basecolumn", "firstChar", "lexical", "top", "c", "closing", "require_dialog", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "dialogDiv", "cm", "template", "bottom", "wrap", "dialog", "closeNotification", "newVal", "callback", "options", "closed", "me", "close", "inp", "button", "e", "evt", "callbacks", "buttons", "blurring", "i", "b", "doneTimer", "duration", "require_placeholder", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "cm", "val", "old", "prev", "onBlur", "onChange", "onComposition", "clearPlaceholder", "wrapper", "setPlaceholder", "elt", "placeHolder", "empty", "input", "isEmpty", "require_closebrackets", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "defaults", "Pos", "cm", "val", "old", "keyMap", "ensureBound", "getOption", "conf", "name", "handleBackspace", "handleEnter", "chars", "i", "ch", "key", "handler", "handleChar", "getConfig", "deflt", "mode", "pairs", "ranges", "around", "charsAround", "cur", "explode", "linesep", "moveSel", "line", "dir", "newRanges", "primary", "range", "pos", "contractSelection", "sel", "inverted", "closeBefore", "triples", "identical", "opening", "type", "curType", "next", "stringStartsAfter", "prev", "left", "right", "sels", "str", "token", "require_matchbrackets", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "ie_lt8", "Pos", "matching", "bracketRegex", "config", "findMatchingBracket", "cm", "where", "line", "pos", "afterCursor", "re", "match", "dir", "style", "found", "scanForBracket", "maxScanLen", "maxScanLines", "stack", "lineEnd", "lineNo", "end", "ch", "matchBrackets", "autoclear", "maxHighlightLen", "highlightNonMatching", "marks", "ranges", "i", "clear", "doMatchBrackets", "clearHighlighted", "val", "old", "oldConfig", "require_show_hint", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "HINT_ELEMENT_CLASS", "ACTIVE_HINT_ELEMENT_CLASS", "cm", "getHints", "options", "newOpts", "prop", "parseOptions", "selections", "i", "completion", "Completion", "self", "requestAnimationFrame", "fn", "cancelAnimationFrame", "data", "getText", "identStart", "pos", "line", "first", "myTick", "fetchHints", "picked", "Widget", "editor", "out", "defaultOptions", "buildKeyMap", "handle", "baseMap", "mac", "custom", "ourMap", "addBinding", "key", "val", "bound", "extra", "getHintElement", "hintsElement", "el", "widget", "ownerDocument", "parentWindow", "hints", "theme", "completions", "elt", "cur", "className", "container", "left", "top", "below", "offsetLeft", "offsetTop", "isContainerPositioned", "offsetParent", "offsetParentPosition", "bodyPosition", "winW", "winH", "box", "scrolls", "startScroll", "overlapY", "height", "spaceAbove", "overlapX", "node", "n", "avoidWrap", "closingOnBlur", "curScroll", "newTop", "point", "e", "t", "selectedHintRange", "input", "node1", "node2", "firstNode", "margin", "applicableHelpers", "helpers", "result", "hint", "callback", "resolveAutoHints", "words", "resolved", "app", "run", "token", "term", "from", "to", "found", "word", "require_jump_to_line", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "dialog", "cm", "text", "shortText", "deflt", "f", "getJumpDialog", "interpretLine", "string", "num", "cur", "posStr", "match", "line", "require_searchcursor", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "Pos", "regexpFlags", "regexp", "flags", "ensureFlags", "current", "target", "i", "maybeMultiline", "searchRegexpForward", "doc", "start", "line", "ch", "last", "string", "match", "searchRegexpForwardMultiline", "chunk", "curLine", "before", "inside", "startLine", "startCh", "lastMatchIn", "endMargin", "from", "newMatch", "end", "searchRegexpBackward", "first", "searchRegexpBackwardMultiline", "chunkSize", "doFold", "noFold", "str", "adjustPos", "orig", "folded", "pos", "foldFunc", "min", "max", "mid", "len", "searchStringForward", "query", "caseFold", "fold", "lines", "search", "found", "cutFrom", "endString", "lastLine", "searchStringBackward", "top", "topString", "SearchCursor", "options", "reverse", "head", "result", "newText", "origin", "ranges", "cur", "require_search", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "mod", "CodeMirror", "searchOverlay", "query", "caseInsensitive", "stream", "match", "SearchState", "getSearchState", "cm", "queryCaseInsensitive", "getSearchCursor", "pos", "persistentDialog", "text", "deflt", "onEnter", "onKeyDown", "clearSearch", "dialog", "shortText", "f", "confirmDialog", "fs", "parseString", "string", "ch", "parseQuery", "isRE", "startSearch", "state", "doSearch", "rev", "persistent", "immediate", "findNext", "q", "hiding", "searchNext", "event", "_", "to", "getQueryDialog", "keyName", "extra", "cmd", "callback", "cursor", "el", "tag", "attrs", "element", "key", "i", "child", "label", "getReplaceQueryDialog", "getReplacementQueryDialog", "getDoReplaceConfirm", "replaceAll", "replace", "all", "dialogText", "fragment", "advance", "start", "doReplace", "require_polyfills", "__commonJSMin", "init_dirname", "init_buffer", "init_process", "doc", "proto", "method", "native", "selectors", "id", "result", "constant_default", "x", "init_constant", "__esmMin", "init_dirname", "init_buffer", "init_process", "acos", "x", "pi", "asin", "halfPi", "abs", "atan2", "cos", "max", "min", "sin", "sqrt", "epsilon", "tau", "init_math", "__esmMin", "init_dirname", "init_buffer", "init_process", "append", "strings", "i", "n", "appendRound", "digits", "d", "k", "path", "Path", "pi", "tau", "epsilon", "tauEpsilon", "init_path", "__esmMin", "init_dirname", "init_buffer", "init_process", "x", "y", "x1", "y1", "x2", "y2", "r", "x0", "y0", "x21", "y21", "x01", "y01", "l01_2", "x20", "y20", "l21_2", "l20_2", "l21", "l01", "l", "t01", "t21", "a0", "a1", "ccw", "dx", "dy", "cw", "da", "w", "h", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_path", "withPath", "shape", "digits", "_", "d", "Path", "init_path", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "arcInnerRadius", "d", "arcOuterRadius", "arcStartAngle", "arcEndAngle", "arcPadAngle", "intersect", "x0", "y0", "x1", "y1", "x2", "y2", "x3", "y3", "x10", "y10", "x32", "y32", "t", "epsilon", "cornerTangents", "r1", "rc", "cw", "x01", "y01", "lo", "sqrt", "ox", "oy", "x11", "y11", "x00", "y00", "dx", "dy", "d2", "r", "D", "max", "cx0", "cy0", "cx1", "cy1", "dx0", "dy0", "dx1", "dy1", "arc_default", "innerRadius", "outerRadius", "cornerRadius", "constant_default", "padRadius", "startAngle", "endAngle", "padAngle", "context", "path", "withPath", "arc", "buffer", "r0", "a0", "halfPi", "a1", "da", "abs", "tau", "cos", "sin", "a01", "a11", "a00", "a10", "da0", "da1", "ap", "rp", "min", "rc0", "rc1", "t0", "t1", "p0", "asin", "p1", "oc", "pi", "ax", "ay", "bx", "by", "kc", "acos", "lc", "atan2", "a", "_", "init_arc", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_constant", "init_math", "init_path", "array_default", "x", "slice", "init_array", "__esmMin", "init_dirname", "init_buffer", "init_process", "Linear", "context", "linear_default", "init_linear", "__esmMin", "init_dirname", "init_buffer", "init_process", "x", "y", "x", "p", "y", "init_point", "__esmMin", "init_dirname", "init_buffer", "init_process", "line_default", "x", "y", "defined", "constant_default", "context", "curve", "linear_default", "output", "path", "withPath", "line", "data", "i", "n", "array_default", "d", "defined0", "buffer", "_", "init_line", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_constant", "init_linear", "init_path", "init_point", "area_default", "x0", "y0", "y1", "x1", "defined", "constant_default", "context", "curve", "linear_default", "output", "path", "withPath", "area", "x", "y", "data", "i", "j", "k", "n", "array_default", "d", "defined0", "buffer", "x0z", "y0z", "arealine", "line_default", "_", "init_area", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_constant", "init_linear", "init_line", "init_path", "init_point", "descending_default", "a", "b", "init_descending", "__esmMin", "init_dirname", "init_buffer", "init_process", "identity_default", "d", "init_identity", "__esmMin", "init_dirname", "init_buffer", "init_process", "pie_default", "value", "identity_default", "sortValues", "descending_default", "sort", "startAngle", "constant_default", "endAngle", "tau", "padAngle", "pie", "data", "i", "n", "array_default", "j", "k", "sum", "index", "arcs", "a0", "da", "a1", "p", "pa", "v", "_", "init_pie", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_constant", "init_descending", "init_identity", "init_math", "Radial", "curve", "curveRadial", "radial", "context", "curveRadialLinear", "init_radial", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_linear", "linear_default", "a", "r", "lineRadial", "l", "c", "_", "curveRadial", "lineRadial_default", "line_default", "curveRadialLinear", "init_lineRadial", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_radial", "init_line", "areaRadial_default", "a", "area_default", "curveRadialLinear", "c", "x0", "x1", "y0", "y1", "lineRadial", "_", "curveRadial", "init_areaRadial", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_radial", "init_area", "init_lineRadial", "pointRadial_default", "x", "y", "init_pointRadial", "__esmMin", "init_dirname", "init_buffer", "init_process", "bumpX", "context", "Bump", "bumpY", "bumpRadial", "BumpRadial", "init_bump", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_pointRadial", "x", "y", "p0", "pointRadial_default", "p1", "p2", "p3", "linkSource", "d", "linkTarget", "link", "curve", "source", "target", "x", "y", "context", "output", "path", "withPath", "buffer", "argv", "slice", "s", "t", "_", "constant_default", "linkHorizontal", "bumpX", "linkVertical", "bumpY", "linkRadial", "l", "bumpRadial", "init_link", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_constant", "init_bump", "init_path", "init_point", "sqrt3", "asterisk_default", "init_asterisk", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sqrt", "context", "size", "min", "t", "u", "circle_default", "init_circle", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "pi", "tau", "cross_default", "init_cross", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "tan30", "tan30_2", "diamond_default", "init_diamond", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sqrt", "context", "size", "y", "x", "diamond2_default", "init_diamond2", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "plus_default", "init_plus", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "min", "square_default", "init_square", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "w", "sqrt", "x", "square2_default", "init_square2", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "ka", "kr", "kx", "ky", "star_default", "init_star", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sin", "pi", "tau", "cos", "context", "size", "sqrt", "x", "y", "i", "a", "c", "s", "sqrt3", "triangle_default", "init_triangle", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sqrt", "context", "size", "y", "sqrt3", "triangle2_default", "init_triangle2", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sqrt", "context", "size", "s", "t", "u", "c", "s", "k", "a", "wye_default", "init_wye", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "sqrt", "context", "size", "x0", "y0", "x1", "y1", "x2", "y2", "times_default", "init_times", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "context", "size", "sqrt", "min", "Symbol", "type", "size", "context", "path", "withPath", "symbol", "constant_default", "circle_default", "buffer", "_", "symbolsFill", "symbolsStroke", "init_symbol", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_constant", "init_path", "init_asterisk", "init_circle", "init_cross", "init_diamond", "init_diamond2", "init_plus", "init_square", "init_square2", "init_star", "init_triangle", "init_triangle2", "init_wye", "init_times", "cross_default", "diamond_default", "square_default", "star_default", "triangle_default", "wye_default", "plus_default", "times_default", "triangle2_default", "asterisk_default", "square2_default", "diamond2_default", "noop_default", "init_noop", "__esmMin", "init_dirname", "init_buffer", "init_process", "point", "that", "x", "y", "Basis", "context", "basis_default", "init_basis", "__esmMin", "init_dirname", "init_buffer", "init_process", "BasisClosed", "context", "basisClosed_default", "init_basisClosed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_noop", "init_basis", "noop_default", "x", "y", "point", "BasisOpen", "context", "basisOpen_default", "init_basisOpen", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_basis", "x", "y", "x0", "y0", "point", "Bundle", "context", "beta", "Basis", "bundle_default", "init_bundle", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_basis", "x", "y", "j", "x0", "y0", "dx", "dy", "i", "t", "custom", "bundle", "point", "that", "x", "y", "Cardinal", "context", "tension", "cardinal_default", "init_cardinal", "__esmMin", "init_dirname", "init_buffer", "init_process", "custom", "cardinal", "CardinalClosed", "context", "tension", "cardinalClosed_default", "init_cardinalClosed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_noop", "init_cardinal", "noop_default", "x", "y", "point", "custom", "cardinal", "CardinalOpen", "context", "tension", "cardinalOpen_default", "init_cardinalOpen", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_cardinal", "x", "y", "point", "custom", "cardinal", "point", "that", "x", "y", "x1", "y1", "x2", "y2", "epsilon", "a", "n", "b", "m", "CatmullRom", "context", "alpha", "catmullRom_default", "init_catmullRom", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_math", "init_cardinal", "x23", "y23", "custom", "catmullRom", "Cardinal", "CatmullRomClosed", "context", "alpha", "catmullRomClosed_default", "init_catmullRomClosed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_cardinalClosed", "init_noop", "init_catmullRom", "noop_default", "x", "y", "x23", "y23", "point", "custom", "catmullRom", "CardinalClosed", "CatmullRomOpen", "context", "alpha", "catmullRomOpen_default", "init_catmullRomOpen", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_cardinalOpen", "init_catmullRom", "x", "y", "x23", "y23", "point", "custom", "catmullRom", "CardinalOpen", "LinearClosed", "context", "linearClosed_default", "init_linearClosed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_noop", "noop_default", "x", "y", "sign", "x", "slope3", "that", "x2", "y2", "h0", "h1", "s0", "s1", "p", "slope2", "h", "point", "t0", "t1", "x0", "y0", "x1", "y1", "dx", "MonotoneX", "context", "MonotoneY", "ReflectContext", "monotoneX", "monotoneY", "init_monotone", "__esmMin", "init_dirname", "init_buffer", "init_process", "y", "Natural", "context", "controlPoints", "x", "i", "n", "m", "a", "b", "r", "natural_default", "init_natural", "__esmMin", "init_dirname", "init_buffer", "init_process", "y", "px", "py", "i0", "i1", "Step", "context", "step_default", "stepBefore", "stepAfter", "init_step", "__esmMin", "init_dirname", "init_buffer", "init_process", "x", "y", "x1", "none_default", "series", "order", "n", "i", "j", "s0", "s1", "m", "init_none", "__esmMin", "init_dirname", "init_buffer", "init_process", "none_default", "series", "n", "o", "init_none", "__esmMin", "init_dirname", "init_buffer", "init_process", "stackValue", "d", "key", "stackSeries", "series", "stack_default", "keys", "constant_default", "order", "none_default", "offset", "value", "stack", "data", "sz", "i", "n", "j", "oz", "array_default", "_", "init_stack", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_constant", "init_none", "expand_default", "series", "order", "i", "j", "m", "y", "none_default", "init_expand", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "diverging_default", "series", "order", "n", "i", "j", "d", "dy", "yp", "yn", "m", "init_diverging", "__esmMin", "init_dirname", "init_buffer", "init_process", "silhouette_default", "series", "order", "n", "j", "s0", "m", "i", "y", "none_default", "init_silhouette", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "wiggle_default", "series", "order", "n", "m", "s0", "y", "j", "i", "s1", "s2", "si", "sij0", "sij1", "s3", "k", "sk", "skj0", "skj1", "none_default", "init_wiggle", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "appearance_default", "series", "peaks", "peak", "none_default", "a", "b", "i", "j", "vi", "vj", "init_appearance", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "ascending_default", "series", "sums", "sum", "none_default", "a", "b", "s", "i", "v", "init_ascending", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "descending_default", "series", "ascending_default", "init_descending", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_ascending", "insideOut_default", "series", "n", "i", "j", "sums", "sum", "order", "appearance_default", "top", "bottom", "tops", "bottoms", "init_insideOut", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_appearance", "init_ascending", "reverse_default", "series", "none_default", "init_reverse", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_none", "src_exports", "__export", "arc_default", "area_default", "areaRadial_default", "basis_default", "basisClosed_default", "basisOpen_default", "bumpX", "bumpY", "bundle_default", "cardinal_default", "cardinalClosed_default", "cardinalOpen_default", "catmullRom_default", "catmullRomClosed_default", "catmullRomOpen_default", "linear_default", "linearClosed_default", "monotoneX", "monotoneY", "natural_default", "step_default", "stepAfter", "stepBefore", "line_default", "lineRadial_default", "link", "linkHorizontal", "linkRadial", "linkVertical", "pie_default", "pointRadial_default", "stack_default", "diverging_default", "expand_default", "none_default", "silhouette_default", "wiggle_default", "appearance_default", "ascending_default", "descending_default", "insideOut_default", "reverse_default", "Symbol", "asterisk_default", "circle_default", "cross_default", "diamond_default", "diamond2_default", "plus_default", "square_default", "square2_default", "star_default", "times_default", "triangle_default", "triangle2_default", "wye_default", "symbolsFill", "symbolsStroke", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_arc", "init_area", "init_line", "init_pie", "init_areaRadial", "init_lineRadial", "init_pointRadial", "init_link", "init_symbol", "init_asterisk", "init_circle", "init_cross", "init_diamond", "init_diamond2", "init_plus", "init_square", "init_square2", "init_star", "init_triangle", "init_triangle2", "init_wye", "init_times", "init_basisClosed", "init_basisOpen", "init_basis", "init_bump", "init_bundle", "init_cardinalClosed", "init_cardinalOpen", "init_cardinal", "init_catmullRomClosed", "init_catmullRomOpen", "init_catmullRom", "init_linearClosed", "init_linear", "init_monotone", "init_natural", "init_step", "init_stack", "init_expand", "init_diverging", "init_none", "init_silhouette", "init_wiggle", "init_appearance", "init_ascending", "init_descending", "init_insideOut", "init_reverse", "formatDecimal_default", "x", "formatDecimalParts", "p", "i", "coefficient", "init_formatDecimal", "__esmMin", "init_dirname", "init_buffer", "init_process", "exponent_default", "x", "formatDecimalParts", "init_exponent", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_formatDecimal", "formatGroup_default", "grouping", "thousands", "value", "width", "t", "j", "g", "length", "init_formatGroup", "__esmMin", "init_dirname", "init_buffer", "init_process", "formatNumerals_default", "numerals", "value", "i", "init_formatNumerals", "__esmMin", "init_dirname", "init_buffer", "init_process", "formatSpecifier", "specifier", "match", "re", "FormatSpecifier", "init_formatSpecifier", "__esmMin", "init_dirname", "init_buffer", "init_process", "formatTrim_default", "s", "out", "n", "i", "i0", "i1", "init_formatTrim", "__esmMin", "init_dirname", "init_buffer", "init_process", "formatPrefixAuto_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "i", "prefixExponent", "n", "init_formatPrefixAuto", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_formatDecimal", "formatRounded_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "init_formatRounded", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_formatDecimal", "formatTypes_default", "init_formatTypes", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_formatDecimal", "init_formatPrefixAuto", "init_formatRounded", "x", "p", "formatDecimal_default", "formatRounded_default", "formatPrefixAuto_default", "identity_default", "x", "init_identity", "__esmMin", "init_dirname", "init_buffer", "init_process", "locale_default", "locale", "group", "identity_default", "formatGroup_default", "map", "currencyPrefix", "currencySuffix", "decimal", "numerals", "formatNumerals_default", "percent", "minus", "nan", "newFormat", "specifier", "formatSpecifier", "fill", "align", "sign", "symbol", "zero", "width", "comma", "precision", "trim", "type", "formatTypes_default", "prefix", "suffix", "formatType", "maybeSuffix", "format", "value", "valuePrefix", "valueSuffix", "i", "n", "c", "valueNegative", "formatTrim_default", "prefixes", "prefixExponent", "length", "padding", "formatPrefix", "f", "e", "exponent_default", "k", "init_locale", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_exponent", "init_formatGroup", "init_formatNumerals", "init_formatSpecifier", "init_formatTrim", "init_formatTypes", "init_formatPrefixAuto", "init_identity", "defaultLocale", "definition", "locale", "locale_default", "format", "formatPrefix", "init_defaultLocale", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_locale", "precisionFixed_default", "step", "exponent_default", "init_precisionFixed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_exponent", "precisionPrefix_default", "step", "value", "exponent_default", "init_precisionPrefix", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_exponent", "precisionRound_default", "step", "max", "exponent_default", "init_precisionRound", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_exponent", "src_exports", "__export", "FormatSpecifier", "format", "defaultLocale", "locale_default", "formatPrefix", "formatSpecifier", "precisionFixed_default", "precisionPrefix_default", "precisionRound_default", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_defaultLocale", "init_locale", "init_formatSpecifier", "init_precisionFixed", "init_precisionPrefix", "init_precisionRound", "ascending", "a", "b", "init_ascending", "__esmMin", "init_dirname", "init_buffer", "init_process", "descending", "a", "b", "init_descending", "__esmMin", "init_dirname", "init_buffer", "init_process", "bisector", "f", "compare1", "compare2", "delta", "ascending", "d", "x", "descending", "zero", "left", "a", "lo", "hi", "mid", "right", "center", "i", "init_bisector", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_ascending", "init_descending", "number", "x", "numbers", "values", "valueof", "value", "index", "init_number", "__esmMin", "init_dirname", "init_buffer", "init_process", "ascendingBisect", "bisectRight", "bisectLeft", "bisectCenter", "bisect_default", "init_bisect", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_ascending", "init_bisector", "init_number", "bisector", "ascending", "number", "intern_get", "_intern", "_key", "value", "key", "intern_set", "intern_delete", "keyof", "InternMap", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "entries", "compareDefined", "compare", "ascending", "ascendingDefined", "a", "b", "x", "init_sort", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_ascending", "tickSpec", "start", "stop", "count", "step", "power", "error", "factor", "e10", "e5", "e2", "i1", "i2", "inc", "ticks", "reverse", "n", "i", "tickIncrement", "tickStep", "init_ticks", "__esmMin", "init_dirname", "init_buffer", "init_process", "max", "values", "valueof", "value", "index", "init_max", "__esmMin", "init_dirname", "init_buffer", "init_process", "min", "values", "valueof", "value", "index", "init_min", "__esmMin", "init_dirname", "init_buffer", "init_process", "quickselect", "array", "k", "left", "right", "compare", "ascendingDefined", "compareDefined", "n", "m", "z", "s", "sd", "newLeft", "newRight", "t", "i", "j", "swap", "init_quickselect", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_sort", "quantile", "values", "p", "valueof", "numbers", "min", "max", "i0", "value0", "quickselect", "value1", "quantileSorted", "number", "init_quantile", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_max", "init_min", "init_quickselect", "init_number", "range", "start", "stop", "step", "n", "i", "init_range", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_bisect", "init_ascending", "init_bisector", "init_quantile", "init_range", "init_ticks", "initRange", "domain", "range", "initInterpolator", "interpolator", "init_init", "__esmMin", "init_dirname", "init_buffer", "init_process", "ordinal", "index", "InternMap", "domain", "range", "unknown", "implicit", "scale", "d", "i", "_", "value", "initRange", "init_ordinal", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_init", "band", "scale", "ordinal", "domain", "ordinalRange", "r0", "r1", "step", "bandwidth", "round", "paddingInner", "paddingOuter", "align", "rescale", "n", "reverse", "start", "stop", "values", "range", "i", "_", "initRange", "pointish", "copy", "point", "init_band", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_init", "init_ordinal", "define_default", "constructor", "factory", "prototype", "extend", "parent", "definition", "key", "init_define", "__esmMin", "init_dirname", "init_buffer", "init_process", "Color", "color_formatHex", "color_formatHex8", "color_formatHsl", "hslConvert", "color_formatRgb", "color", "format", "m", "l", "reHex", "rgbn", "Rgb", "rgba", "reRgbInteger", "reRgbPercent", "reRgbaInteger", "reRgbaPercent", "reHslPercent", "hsla", "reHslaPercent", "named", "n", "r", "g", "b", "a", "rgbConvert", "o", "rgb", "opacity", "rgb_formatHex", "hex", "rgb_formatHex8", "rgb_formatRgb", "clampa", "clampi", "value", "h", "s", "Hsl", "min", "max", "hsl", "clamph", "clampt", "hsl2rgb", "m1", "m2", "darker", "brighter", "reI", "reN", "reP", "init_color", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_define", "define_default", "channels", "extend", "k", "radians", "degrees", "init_math", "__esmMin", "init_dirname", "init_buffer", "init_process", "labConvert", "o", "Lab", "Hcl", "hcl2lab", "Rgb", "rgbConvert", "r", "rgb2lrgb", "g", "b", "y", "xyz2lab", "Yn", "x", "z", "Xn", "Zn", "gray", "l", "opacity", "lab", "a", "t", "t3", "t2", "t0", "lab2xyz", "t1", "lrgb2rgb", "hclConvert", "h", "degrees", "lch", "c", "hcl", "radians", "K", "init_lab", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_define", "init_color", "init_math", "define_default", "extend", "Color", "k", "cubehelixConvert", "o", "Cubehelix", "Rgb", "rgbConvert", "r", "g", "b", "l", "BC_DA", "ED", "EB", "bl", "k", "E", "C", "D", "s", "h", "degrees", "cubehelix", "opacity", "A", "B", "init_cubehelix", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_define", "init_color", "init_math", "define_default", "extend", "Color", "brighter", "darker", "radians", "a", "cosh", "sinh", "src_exports", "__export", "color", "cubehelix", "gray", "hcl", "hsl", "lab", "lch", "rgb", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_color", "init_lab", "init_cubehelix", "basis", "t1", "v0", "v1", "v2", "v3", "t2", "t3", "basis_default", "values", "n", "t", "i", "init_basis", "__esmMin", "init_dirname", "init_buffer", "init_process", "basisClosed_default", "values", "n", "t", "i", "v0", "v1", "v2", "v3", "basis", "init_basisClosed", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_basis", "constant_default", "init_constant", "__esmMin", "init_dirname", "init_buffer", "init_process", "x", "linear", "a", "d", "t", "exponential", "b", "y", "hue", "constant_default", "gamma", "nogamma", "init_color", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_constant", "rgbSpline", "spline", "colors", "n", "r", "g", "b", "i", "color", "rgb", "t", "rgb_default", "rgbBasis", "rgbBasisClosed", "init_rgb", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_basis", "init_basisClosed", "init_color", "rgbGamma", "y", "gamma", "start", "end", "opacity", "nogamma", "basis_default", "basisClosed_default", "numberArray_default", "a", "b", "n", "c", "t", "isNumberArray", "x", "init_numberArray", "__esmMin", "init_dirname", "init_buffer", "init_process", "array_default", "a", "b", "isNumberArray", "numberArray_default", "genericArray", "nb", "na", "x", "c", "i", "value_default", "t", "init_array", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_value", "init_numberArray", "date_default", "a", "b", "d", "t", "init_date", "__esmMin", "init_dirname", "init_buffer", "init_process", "number_default", "a", "b", "t", "init_number", "__esmMin", "init_dirname", "init_buffer", "init_process", "object_default", "a", "b", "i", "c", "k", "value_default", "t", "init_object", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_value", "zero", "b", "one", "string_default", "a", "bi", "reA", "reB", "am", "bm", "bs", "i", "s", "q", "number_default", "t", "o", "init_string", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_number", "value_default", "a", "b", "t", "c", "constant_default", "number_default", "color", "rgb_default", "string_default", "date_default", "isNumberArray", "numberArray_default", "genericArray", "object_default", "init_value", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_rgb", "init_array", "init_date", "init_number", "init_object", "init_string", "init_constant", "init_numberArray", "discrete_default", "range", "n", "t", "init_discrete", "__esmMin", "init_dirname", "init_buffer", "init_process", "hue_default", "a", "b", "i", "hue", "t", "x", "init_hue", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_color", "round_default", "a", "b", "t", "init_round", "__esmMin", "init_dirname", "init_buffer", "init_process", "decompose_default", "a", "b", "c", "d", "e", "f", "scaleX", "scaleY", "skewX", "degrees", "identity", "init_decompose", "__esmMin", "init_dirname", "init_buffer", "init_process", "parseCss", "value", "m", "identity", "decompose_default", "parseSvg", "svgNode", "init_parse", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_decompose", "interpolateTransform", "parse", "pxComma", "pxParen", "degParen", "pop", "translate", "xa", "ya", "xb", "yb", "s", "q", "i", "number_default", "rotate", "a", "b", "skewX", "scale", "t", "n", "o", "interpolateTransformCss", "interpolateTransformSvg", "init_transform", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_number", "init_parse", "parseCss", "parseSvg", "cosh", "x", "sinh", "tanh", "epsilon2", "zoom_default", "init_zoom", "__esmMin", "init_dirname", "init_buffer", "init_process", "zoomRho", "rho", "rho2", "rho4", "zoom", "p0", "p1", "ux0", "uy0", "w0", "ux1", "uy1", "w1", "dx", "dy", "d2", "i", "t", "d1", "b0", "b1", "r0", "r1", "s", "coshr0", "u", "_", "_1", "_2", "_4", "hsl", "hue", "start", "end", "h", "s", "nogamma", "l", "opacity", "t", "hsl_default", "hslLong", "init_hsl", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_color", "lab", "start", "end", "l", "nogamma", "a", "b", "opacity", "t", "init_lab", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_color", "hcl", "hue", "start", "end", "h", "c", "nogamma", "l", "opacity", "t", "hcl_default", "hclLong", "init_hcl", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_color", "cubehelix", "hue", "cubehelixGamma", "y", "start", "end", "h", "s", "nogamma", "l", "opacity", "t", "cubehelix_default", "cubehelixLong", "init_cubehelix", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_color", "piecewise", "interpolate", "values", "value_default", "i", "v", "I", "t", "init_piecewise", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_value", "quantize_default", "interpolator", "n", "samples", "i", "init_quantize", "__esmMin", "init_dirname", "init_buffer", "init_process", "src_exports", "__export", "value_default", "array_default", "basis_default", "basisClosed_default", "cubehelix_default", "cubehelixLong", "date_default", "discrete_default", "hcl_default", "hclLong", "hsl_default", "hslLong", "hue_default", "lab", "number_default", "numberArray_default", "object_default", "rgb_default", "rgbBasis", "rgbBasisClosed", "round_default", "string_default", "interpolateTransformCss", "interpolateTransformSvg", "zoom_default", "piecewise", "quantize_default", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_value", "init_array", "init_basis", "init_basisClosed", "init_date", "init_discrete", "init_hue", "init_number", "init_numberArray", "init_object", "init_round", "init_string", "init_transform", "init_zoom", "init_rgb", "init_hsl", "init_lab", "init_hcl", "init_cubehelix", "init_piecewise", "init_quantize", "constants", "x", "init_constant", "__esmMin", "init_dirname", "init_buffer", "init_process", "number", "x", "init_number", "__esmMin", "init_dirname", "init_buffer", "init_process", "identity", "x", "normalize", "a", "b", "constants", "clamper", "t", "bimap", "domain", "range", "interpolate", "d0", "d1", "r0", "r1", "polymap", "j", "d", "r", "i", "bisect_default", "copy", "source", "target", "transformer", "unit", "value_default", "transform", "untransform", "unknown", "clamp", "piecewise", "output", "input", "rescale", "n", "scale", "y", "number_default", "_", "number", "round_default", "u", "continuous", "init_continuous", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_constant", "init_number", "tickFormat", "start", "stop", "count", "specifier", "step", "tickStep", "precision", "formatSpecifier", "value", "precisionPrefix_default", "formatPrefix", "precisionRound_default", "precisionFixed_default", "format", "init_tickFormat", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "linearish", "scale", "domain", "count", "d", "ticks", "specifier", "tickFormat", "i0", "i1", "start", "stop", "prestep", "step", "maxIter", "tickIncrement", "linear", "continuous", "copy", "initRange", "init_linear", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_continuous", "init_init", "init_tickFormat", "identity", "domain", "unknown", "scale", "x", "_", "number", "linearish", "init_identity", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_linear", "init_number", "nice", "domain", "interval", "i0", "i1", "x0", "x1", "t", "init_nice", "__esmMin", "init_dirname", "init_buffer", "init_process", "transformLog", "x", "transformExp", "transformLogn", "transformExpn", "pow10", "powp", "base", "logp", "reflect", "f", "k", "loggish", "transform", "scale", "domain", "logs", "pows", "rescale", "_", "count", "d", "u", "v", "r", "i", "j", "t", "n", "z", "ticks", "specifier", "formatSpecifier", "format", "nice", "log", "transformer", "copy", "initRange", "init_log", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_nice", "init_continuous", "init_init", "transformSymlog", "c", "x", "transformSymexp", "symlogish", "transform", "scale", "_", "linearish", "symlog", "transformer", "copy", "initRange", "init_symlog", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_linear", "init_continuous", "init_init", "transformPow", "exponent", "x", "transformSqrt", "transformSquare", "powish", "transform", "scale", "identity", "rescale", "_", "linearish", "pow", "transformer", "copy", "initRange", "sqrt", "init_pow", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_linear", "init_continuous", "init_init", "square", "x", "unsquare", "radial", "squared", "continuous", "range", "round", "unknown", "scale", "y", "_", "number", "initRange", "linearish", "init_radial", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_continuous", "init_init", "init_linear", "init_number", "quantile", "domain", "range", "thresholds", "unknown", "rescale", "i", "n", "quantileSorted", "scale", "x", "bisect_default", "y", "_", "d", "ascending", "initRange", "init_quantile", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_init", "quantize", "x0", "x1", "n", "domain", "range", "unknown", "scale", "x", "bisect_default", "rescale", "i", "_", "y", "initRange", "linearish", "init_quantize", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_linear", "init_init", "threshold", "domain", "range", "unknown", "scale", "x", "bisect_default", "_", "y", "i", "initRange", "init_threshold", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_init", "timeInterval", "floori", "offseti", "count", "field", "interval", "date", "d0", "d1", "step", "start", "stop", "range", "previous", "test", "end", "t0", "t1", "d", "init_interval", "__esmMin", "init_dirname", "init_buffer", "init_process", "millisecond", "milliseconds", "init_millisecond", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "k", "second", "seconds", "init_second", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "timeMinute", "timeMinutes", "utcMinute", "utcMinutes", "init_minute", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "timeHour", "timeHours", "utcHour", "utcHours", "init_hour", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "timeDay", "timeDays", "utcDay", "utcDays", "unixDay", "unixDays", "init_day", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "timeWeekday", "i", "timeInterval", "date", "step", "start", "end", "utcWeekday", "timeSunday", "timeMonday", "timeTuesday", "timeWednesday", "timeThursday", "timeFriday", "timeSaturday", "timeSundays", "timeMondays", "timeTuesdays", "timeWednesdays", "timeThursdays", "timeFridays", "timeSaturdays", "utcSunday", "utcMonday", "utcTuesday", "utcWednesday", "utcThursday", "utcFriday", "utcSaturday", "utcSundays", "utcMondays", "utcTuesdays", "utcWednesdays", "utcThursdays", "utcFridays", "utcSaturdays", "init_week", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeMonth", "timeMonths", "utcMonth", "utcMonths", "init_month", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "timeYear", "timeYears", "utcYear", "utcYears", "init_year", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_interval", "timeInterval", "date", "step", "start", "end", "k", "ticker", "year", "month", "week", "day", "hour", "minute", "tickIntervals", "second", "ticks", "start", "stop", "count", "reverse", "interval", "tickInterval", "target", "i", "bisector", "step", "tickStep", "millisecond", "t", "utcTicks", "utcTickInterval", "timeTicks", "timeTickInterval", "init_ticks", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_millisecond", "init_second", "init_minute", "init_hour", "init_day", "init_week", "init_month", "init_year", "utcYear", "utcMonth", "utcSunday", "unixDay", "utcHour", "utcMinute", "timeYear", "timeMonth", "timeSunday", "timeDay", "timeHour", "timeMinute", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_second", "init_minute", "init_hour", "init_day", "init_week", "init_month", "init_year", "init_ticks", "localDate", "d", "date", "utcDate", "newDate", "y", "m", "formatLocale", "locale", "locale_dateTime", "locale_date", "locale_time", "locale_periods", "locale_weekdays", "locale_shortWeekdays", "locale_months", "locale_shortMonths", "periodRe", "formatRe", "periodLookup", "formatLookup", "weekdayRe", "weekdayLookup", "shortWeekdayRe", "shortWeekdayLookup", "monthRe", "monthLookup", "shortMonthRe", "shortMonthLookup", "formats", "formatShortWeekday", "formatWeekday", "formatShortMonth", "formatMonth", "formatDayOfMonth", "formatMicroseconds", "formatYearISO", "formatFullYearISO", "formatHour24", "formatHour12", "formatDayOfYear", "formatMilliseconds", "formatMonthNumber", "formatMinutes", "formatPeriod", "formatQuarter", "formatUnixTimestamp", "formatUnixTimestampSeconds", "formatSeconds", "formatWeekdayNumberMonday", "formatWeekNumberSunday", "formatWeekNumberISO", "formatWeekdayNumberSunday", "formatWeekNumberMonday", "formatYear", "formatFullYear", "formatZone", "formatLiteralPercent", "utcFormats", "formatUTCShortWeekday", "formatUTCWeekday", "formatUTCShortMonth", "formatUTCMonth", "formatUTCDayOfMonth", "formatUTCMicroseconds", "formatUTCYearISO", "formatUTCFullYearISO", "formatUTCHour24", "formatUTCHour12", "formatUTCDayOfYear", "formatUTCMilliseconds", "formatUTCMonthNumber", "formatUTCMinutes", "formatUTCPeriod", "formatUTCQuarter", "formatUTCSeconds", "formatUTCWeekdayNumberMonday", "formatUTCWeekNumberSunday", "formatUTCWeekNumberISO", "formatUTCWeekdayNumberSunday", "formatUTCWeekNumberMonday", "formatUTCYear", "formatUTCFullYear", "formatUTCZone", "parses", "parseShortWeekday", "parseWeekday", "parseShortMonth", "parseMonth", "parseLocaleDateTime", "parseDayOfMonth", "parseMicroseconds", "parseYear", "parseFullYear", "parseHour24", "parseDayOfYear", "parseMilliseconds", "parseMonthNumber", "parseMinutes", "parsePeriod", "parseQuarter", "parseUnixTimestamp", "parseUnixTimestampSeconds", "parseSeconds", "parseWeekdayNumberMonday", "parseWeekNumberSunday", "parseWeekNumberISO", "parseWeekdayNumberSunday", "parseWeekNumberMonday", "parseLocaleDate", "parseLocaleTime", "parseZone", "parseLiteralPercent", "newFormat", "specifier", "string", "i", "j", "n", "c", "pad", "format", "pads", "newParse", "Z", "parseSpecifier", "week", "day", "utcMonday", "utcDay", "timeMonday", "timeDay", "parse", "f", "p", "value", "fill", "width", "sign", "length", "requote", "s", "requoteRe", "names", "name", "numberRe", "percentRe", "timeYear", "timeSunday", "dISO", "timeThursday", "z", "utcYear", "dow", "utcSunday", "UTCdISO", "utcThursday", "init_locale", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "defaultLocale", "definition", "locale", "formatLocale", "timeFormat", "timeParse", "utcFormat", "utcParse", "init_defaultLocale", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_locale", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_defaultLocale", "date", "t", "number", "calendar", "ticks", "tickInterval", "year", "month", "week", "day", "hour", "minute", "second", "format", "scale", "continuous", "invert", "domain", "formatMillisecond", "formatSecond", "formatMinute", "formatHour", "formatDay", "formatWeek", "formatMonth", "formatYear", "tickFormat", "y", "_", "interval", "d", "count", "specifier", "nice", "copy", "time", "initRange", "timeTicks", "timeTickInterval", "timeYear", "timeMonth", "timeSunday", "timeDay", "timeHour", "timeMinute", "timeFormat", "init_time", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_continuous", "init_init", "init_nice", "utcTime", "initRange", "calendar", "utcTicks", "utcTickInterval", "utcYear", "utcMonth", "utcSunday", "utcDay", "utcHour", "utcMinute", "second", "utcFormat", "init_utcTime", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_time", "init_init", "transformer", "x0", "x1", "t0", "t1", "k10", "transform", "interpolator", "identity", "clamp", "unknown", "scale", "x", "_", "range", "interpolate", "r0", "r1", "value_default", "round_default", "t", "copy", "source", "target", "sequential", "linearish", "initInterpolator", "sequentialLog", "loggish", "sequentialSymlog", "symlogish", "sequentialPow", "powish", "sequentialSqrt", "init_sequential", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_continuous", "init_init", "init_linear", "init_log", "init_symlog", "init_pow", "sequentialQuantile", "domain", "interpolator", "identity", "scale", "x", "bisect_default", "_", "d", "ascending", "i", "quantile", "initInterpolator", "init_sequentialQuantile", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_continuous", "init_init", "transformer", "x0", "x1", "x2", "s", "t0", "t1", "t2", "k10", "k21", "interpolator", "identity", "transform", "clamp", "unknown", "scale", "x", "_", "range", "interpolate", "r0", "r1", "r2", "piecewise", "value_default", "round_default", "t", "diverging", "linearish", "copy", "initInterpolator", "divergingLog", "loggish", "divergingSymlog", "symlogish", "divergingPow", "powish", "divergingSqrt", "init_diverging", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_continuous", "init_init", "init_linear", "init_log", "init_sequential", "init_symlog", "init_pow", "src_exports", "__export", "band", "diverging", "divergingLog", "divergingPow", "divergingSqrt", "divergingSymlog", "identity", "implicit", "linear", "log", "ordinal", "point", "pow", "quantile", "quantize", "radial", "sequential", "sequentialLog", "sequentialPow", "sequentialQuantile", "sequentialSqrt", "sequentialSymlog", "sqrt", "symlog", "threshold", "time", "utcTime", "tickFormat", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_band", "init_identity", "init_linear", "init_log", "init_symlog", "init_ordinal", "init_pow", "init_radial", "init_quantile", "init_quantize", "init_threshold", "init_time", "init_utcTime", "init_sequential", "init_sequentialQuantile", "init_diverging", "init_tickFormat", "identity_default", "x", "init_identity", "__esmMin", "init_dirname", "init_buffer", "init_process", "translateX", "x", "translateY", "y", "number", "scale", "d", "center", "offset", "entering", "axis", "orient", "tickArguments", "tickValues", "tickFormat", "tickSizeInner", "tickSizeOuter", "tickPadding", "k", "top", "left", "right", "transform", "bottom", "context", "values", "format", "identity_default", "spacing", "range", "range0", "range1", "position", "selection", "path", "tick", "tickExit", "tickEnter", "line", "text", "epsilon", "p", "_", "axisTop", "axisRight", "axisBottom", "axisLeft", "init_axis", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_identity", "src_exports", "__export", "axisBottom", "axisLeft", "axisRight", "axisTop", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_axis", "dispatch", "i", "n", "_", "t", "Dispatch", "parseTypenames", "typenames", "types", "name", "get", "type", "c", "set", "callback", "noop", "dispatch_default", "init_dispatch", "__esmMin", "init_dirname", "init_buffer", "init_process", "typename", "T", "copy", "that", "args", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_dispatch", "xhtml", "namespaces_default", "init_namespaces", "__esmMin", "init_dirname", "init_buffer", "init_process", "namespace_default", "name", "prefix", "i", "namespaces_default", "init_namespace", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_namespaces", "creatorInherit", "name", "document", "uri", "xhtml", "creatorFixed", "fullname", "creator_default", "namespace_default", "init_creator", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_namespace", "init_namespaces", "none", "selector_default", "selector", "init_selector", "__esmMin", "init_dirname", "init_buffer", "init_process", "select_default", "select", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "Selection", "init_select", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "init_selector", "array", "x", "init_array", "__esmMin", "init_dirname", "init_buffer", "init_process", "empty", "selectorAll_default", "selector", "init_selectorAll", "__esmMin", "init_dirname", "init_buffer", "init_process", "arrayAll", "select", "array", "selectAll_default", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "Selection", "init_selectAll", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "init_array", "init_selectorAll", "matcher_default", "selector", "childMatcher", "node", "init_matcher", "__esmMin", "init_dirname", "init_buffer", "init_process", "childFind", "match", "find", "childFirst", "selectChild_default", "childMatcher", "init_selectChild", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_matcher", "children", "childrenFilter", "match", "filter", "selectChildren_default", "childMatcher", "init_selectChildren", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_matcher", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Selection", "init_filter", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "init_matcher", "sparse_default", "update", "init_sparse", "__esmMin", "init_dirname", "init_buffer", "init_process", "enter_default", "Selection", "sparse_default", "EnterNode", "parent", "datum", "init_enter", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_sparse", "init_selection", "child", "next", "selector", "constant_default", "x", "init_constant", "__esmMin", "init_dirname", "init_buffer", "init_process", "bindIndex", "parent", "group", "enter", "update", "exit", "data", "i", "node", "groupLength", "dataLength", "EnterNode", "bindKey", "key", "nodeByKeyValue", "keyValues", "keyValue", "datum", "data_default", "value", "bind", "parents", "groups", "constant_default", "m", "j", "arraylike", "enterGroup", "updateGroup", "exitGroup", "i0", "i1", "previous", "next", "Selection", "init_data", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "init_enter", "init_constant", "exit_default", "Selection", "sparse_default", "init_exit", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_sparse", "init_selection", "join_default", "onenter", "onupdate", "onexit", "enter", "update", "exit", "init_join", "__esmMin", "init_dirname", "init_buffer", "init_process", "merge_default", "context", "selection", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Selection", "init_merge", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "order_default", "groups", "j", "m", "group", "next", "node", "init_order", "__esmMin", "init_dirname", "init_buffer", "init_process", "sort_default", "compare", "ascending", "compareNode", "a", "b", "groups", "m", "sortgroups", "j", "group", "n", "sortgroup", "node", "i", "Selection", "init_sort", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "call_default", "callback", "init_call", "__esmMin", "init_dirname", "init_buffer", "init_process", "nodes_default", "init_nodes", "__esmMin", "init_dirname", "init_buffer", "init_process", "node_default", "groups", "j", "m", "group", "n", "node", "init_node", "__esmMin", "init_dirname", "init_buffer", "init_process", "size_default", "size", "node", "init_size", "__esmMin", "init_dirname", "init_buffer", "init_process", "empty_default", "init_empty", "__esmMin", "init_dirname", "init_buffer", "init_process", "each_default", "callback", "groups", "j", "m", "group", "i", "n", "node", "init_each", "__esmMin", "init_dirname", "init_buffer", "init_process", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "value", "attrConstantNS", "attrFunction", "v", "attrFunctionNS", "attr_default", "namespace_default", "node", "init_attr", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_namespace", "window_default", "node", "init_window", "__esmMin", "init_dirname", "init_buffer", "init_process", "styleRemove", "name", "styleConstant", "value", "priority", "styleFunction", "v", "style_default", "styleValue", "node", "window_default", "init_style", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_window", "propertyRemove", "name", "propertyConstant", "value", "propertyFunction", "v", "property_default", "init_property", "__esmMin", "init_dirname", "init_buffer", "init_process", "classArray", "string", "classList", "node", "ClassList", "classedAdd", "names", "list", "i", "n", "classedRemove", "classedTrue", "classedFalse", "classedFunction", "value", "classed_default", "name", "init_classed", "__esmMin", "init_dirname", "init_buffer", "init_process", "textRemove", "textConstant", "value", "textFunction", "v", "text_default", "init_text", "__esmMin", "init_dirname", "init_buffer", "init_process", "htmlRemove", "htmlConstant", "value", "htmlFunction", "v", "html_default", "init_html", "__esmMin", "init_dirname", "init_buffer", "init_process", "raise", "raise_default", "init_raise", "__esmMin", "init_dirname", "init_buffer", "init_process", "lower", "lower_default", "init_lower", "__esmMin", "init_dirname", "init_buffer", "init_process", "append_default", "name", "create", "creator_default", "init_append", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_creator", "constantNull", "insert_default", "name", "before", "create", "creator_default", "select", "selector_default", "init_insert", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_creator", "init_selector", "remove", "parent", "remove_default", "init_remove", "__esmMin", "init_dirname", "init_buffer", "init_process", "selection_cloneShallow", "clone", "parent", "selection_cloneDeep", "clone_default", "deep", "init_clone", "__esmMin", "init_dirname", "init_buffer", "init_process", "datum_default", "value", "init_datum", "__esmMin", "init_dirname", "init_buffer", "init_process", "contextListener", "listener", "event", "parseTypenames", "typenames", "name", "i", "onRemove", "typename", "on", "j", "m", "onAdd", "value", "options", "o", "on_default", "n", "t", "init_on", "__esmMin", "init_dirname", "init_buffer", "init_process", "dispatchEvent", "node", "type", "params", "window", "window_default", "event", "dispatchConstant", "dispatchFunction", "dispatch_default", "init_dispatch", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_window", "iterator_default", "groups", "j", "m", "group", "n", "node", "init_iterator", "__esmMin", "init_dirname", "init_buffer", "init_process", "Selection", "groups", "parents", "selection", "root", "selection_selection", "selection_default", "init_selection", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_select", "init_selectAll", "init_selectChild", "init_selectChildren", "init_filter", "init_data", "init_enter", "init_exit", "init_join", "init_merge", "init_order", "init_sort", "init_call", "init_nodes", "init_node", "init_size", "init_empty", "init_each", "init_attr", "init_style", "init_property", "init_classed", "init_text", "init_html", "init_raise", "init_lower", "init_append", "init_insert", "init_remove", "init_clone", "init_datum", "init_on", "init_dispatch", "init_iterator", "select_default", "selectAll_default", "selectChild_default", "selectChildren_default", "filter_default", "data_default", "enter_default", "exit_default", "join_default", "merge_default", "order_default", "sort_default", "call_default", "nodes_default", "node_default", "size_default", "empty_default", "each_default", "attr_default", "style_default", "property_default", "classed_default", "text_default", "html_default", "raise_default", "lower_default", "append_default", "insert_default", "remove_default", "clone_default", "datum_default", "on_default", "dispatch_default", "iterator_default", "select_default", "selector", "Selection", "root", "init_select", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "create_default", "name", "select_default", "creator_default", "init_create", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_creator", "init_select", "local", "Local", "nextId", "init_local", "__esmMin", "init_dirname", "init_buffer", "init_process", "node", "id", "value", "sourceEvent_default", "event", "sourceEvent", "init_sourceEvent", "__esmMin", "init_dirname", "init_buffer", "init_process", "pointer_default", "event", "node", "sourceEvent_default", "svg", "point", "rect", "init_pointer", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_sourceEvent", "pointers_default", "events", "node", "sourceEvent_default", "event", "pointer_default", "init_pointers", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_pointer", "init_sourceEvent", "selectAll_default", "selector", "Selection", "array", "root", "init_selectAll", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_array", "init_selection", "src_exports", "__export", "create_default", "creator_default", "local", "matcher_default", "namespace_default", "namespaces_default", "pointer_default", "pointers_default", "select_default", "selectAll_default", "selection_default", "selector_default", "selectorAll_default", "styleValue", "window_default", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_create", "init_creator", "init_local", "init_matcher", "init_namespace", "init_namespaces", "init_pointer", "init_pointers", "init_select", "init_selectAll", "init_selection", "init_selector", "init_selectorAll", "init_style", "init_window", "noevent_default", "event", "nonpassivecapture", "init_noevent", "__esmMin", "init_dirname", "init_buffer", "init_process", "nodrag_default", "view", "root", "selection", "select_default", "noevent_default", "nonpassivecapture", "yesdrag", "noclick", "init_nodrag", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_noevent", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_nodrag", "now", "clockNow", "setFrame", "clearNow", "clock", "clockSkew", "Timer", "timer", "callback", "delay", "time", "t", "timerFlush", "frame", "taskHead", "e", "wake", "clockLast", "timeout", "nap", "poke", "pokeDelay", "t0", "t1", "t2", "taskTail", "sleep", "interval", "init_timer", "__esmMin", "init_dirname", "init_buffer", "init_process", "f", "timeout_default", "callback", "delay", "time", "t", "Timer", "elapsed", "init_timeout", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_timer", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_timer", "init_timeout", "schedule_default", "node", "name", "id", "index", "group", "timing", "schedules", "create", "emptyOn", "emptyTween", "CREATED", "init", "schedule", "get", "set", "STARTED", "self", "tween", "timer", "elapsed", "SCHEDULED", "start", "i", "j", "n", "o", "stop", "timeout_default", "RUNNING", "ENDED", "tick", "STARTING", "t", "ENDING", "init_schedule", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "dispatch_default", "interrupt_default", "node", "name", "schedules", "schedule", "active", "empty", "i", "STARTING", "ENDING", "ENDED", "init_interrupt", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "interrupt_default", "name", "init_interrupt", "__esmMin", "init_dirname", "init_buffer", "init_process", "tweenRemove", "id", "name", "tween0", "tween1", "schedule", "set", "tween", "i", "n", "tweenFunction", "value", "t", "tween_default", "get", "tweenValue", "transition", "node", "init_tween", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "interpolate_default", "a", "b", "c", "number_default", "color", "rgb_default", "string_default", "init_interpolate", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "interpolate", "value1", "string00", "string1", "interpolate0", "string0", "attrConstantNS", "attrFunction", "value", "string10", "attrFunctionNS", "attr_default", "namespace_default", "i", "interpolateTransformSvg", "interpolate_default", "tweenValue", "init_attr", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_tween", "init_interpolate", "attrInterpolate", "name", "i", "t", "attrInterpolateNS", "fullname", "attrTweenNS", "value", "t0", "i0", "tween", "attrTween", "attrTween_default", "key", "namespace_default", "init_attrTween", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "delayFunction", "id", "value", "init", "delayConstant", "delay_default", "get", "init_delay", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "durationFunction", "id", "value", "set", "durationConstant", "duration_default", "get", "init_duration", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "easeConstant", "id", "value", "set", "ease_default", "get", "init_ease", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "easeVarying", "id", "value", "v", "set", "easeVarying_default", "init_easeVarying", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Transition", "init_filter", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_transition", "merge_default", "transition", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Transition", "init_merge", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_transition", "start", "name", "i", "onFunction", "id", "listener", "on0", "on1", "sit", "init", "set", "schedule", "on", "on_default", "get", "init_on", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "removeFunction", "id", "parent", "i", "remove_default", "init_remove", "__esmMin", "init_dirname", "init_buffer", "init_process", "select_default", "select", "name", "id", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "schedule_default", "get", "Transition", "init_select", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_transition", "init_schedule", "selectAll_default", "select", "name", "id", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "children", "child", "inherit", "get", "k", "l", "schedule_default", "Transition", "init_selectAll", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_transition", "init_schedule", "selection_default", "Selection", "init_selection", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "styleNull", "name", "interpolate", "string00", "string10", "interpolate0", "string0", "styleValue", "string1", "styleRemove", "styleConstant", "value1", "styleFunction", "value", "styleMaybeRemove", "id", "on0", "on1", "listener0", "key", "event", "remove", "schedule", "set", "on", "listener", "style_default", "priority", "i", "interpolateTransformCss", "interpolate_default", "tweenValue", "init_style", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_schedule", "init_tween", "init_interpolate", "styleInterpolate", "name", "i", "priority", "t", "styleTween", "value", "i0", "tween", "styleTween_default", "key", "init_styleTween", "__esmMin", "init_dirname", "init_buffer", "init_process", "textConstant", "value", "textFunction", "value1", "text_default", "tweenValue", "init_text", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_tween", "textInterpolate", "i", "textTween", "value", "t0", "i0", "tween", "textTween_default", "key", "init_textTween", "__esmMin", "init_dirname", "init_buffer", "init_process", "transition_default", "name", "id0", "id1", "newId", "groups", "m", "j", "group", "n", "node", "i", "inherit", "get", "schedule_default", "Transition", "init_transition", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "end_default", "on0", "on1", "that", "id", "size", "resolve", "reject", "cancel", "end", "schedule", "set", "on", "init_end", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "Transition", "groups", "parents", "name", "id", "transition", "selection_default", "newId", "selection_prototype", "init_transition", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_attr", "init_attrTween", "init_delay", "init_duration", "init_ease", "init_easeVarying", "init_filter", "init_merge", "init_on", "init_remove", "init_select", "init_selectAll", "init_selection", "init_style", "init_styleTween", "init_text", "init_textTween", "init_tween", "init_end", "select_default", "selectAll_default", "filter_default", "merge_default", "transition_default", "on_default", "attr_default", "attrTween_default", "style_default", "styleTween_default", "text_default", "textTween_default", "remove_default", "tween_default", "delay_default", "duration_default", "ease_default", "easeVarying_default", "end_default", "cubicInOut", "t", "init_cubic", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_cubic", "inherit", "node", "id", "timing", "transition_default", "name", "Transition", "newId", "defaultTiming", "now", "groups", "m", "j", "group", "n", "i", "schedule_default", "init_transition", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_schedule", "init_src", "cubicInOut", "init_selection", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_interrupt", "init_transition", "selection_default", "interrupt_default", "transition_default", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_selection", "init_interrupt", "constant_default", "init_constant", "__esmMin", "init_dirname", "init_buffer", "init_process", "x", "ZoomEvent", "type", "sourceEvent", "target", "transform", "dispatch", "init_event", "__esmMin", "init_dirname", "init_buffer", "init_process", "Transform", "k", "x", "y", "transform", "node", "identity", "init_transform", "__esmMin", "init_dirname", "init_buffer", "init_process", "point", "location", "nopropagation", "event", "noevent_default", "init_noevent", "__esmMin", "init_dirname", "init_buffer", "init_process", "defaultFilter", "event", "defaultExtent", "defaultTransform", "identity", "defaultWheelDelta", "defaultTouchable", "defaultConstrain", "transform", "extent", "translateExtent", "dx0", "dx1", "dy0", "dy1", "zoom_default", "filter", "constrain", "wheelDelta", "touchable", "scaleExtent", "duration", "interpolate", "listeners", "dispatch_default", "touchstarting", "touchfirst", "touchending", "touchDelay", "wheelDelay", "clickDistance2", "tapDistance", "zoom", "selection", "wheeled", "mousedowned", "dblclicked", "touchstarted", "touchmoved", "touchended", "collection", "point", "schedule", "gesture", "k", "p", "k0", "k1", "e", "t0", "p0", "centroid", "p1", "translate", "scale", "x", "y", "t", "Transform", "transition", "that", "args", "g", "w", "a", "b", "i", "l", "clean", "Gesture", "key", "type", "d", "select_default", "ZoomEvent", "pointer_default", "interrupt_default", "noevent_default", "wheelidled", "currentTarget", "v", "mousemoved", "mouseupped", "x0", "y0", "nodrag_default", "nopropagation", "dx", "dy", "yesdrag", "t1", "touches", "n", "started", "l0", "l1", "dp", "dl", "_", "constant_default", "value", "init_zoom", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_src", "init_constant", "init_event", "init_transform", "init_noevent", "src_exports", "__export", "Transform", "zoom_default", "identity", "transform", "init_src", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_zoom", "init_transform", "o", "u", "f", "v", "n", "r", "s", "a", "l", "h", "e", "t", "c", "p", "i", "y", "init_chunk_4bd36a8f", "__esmMin", "init_dirname", "init_buffer", "init_process", "events_exports", "__export", "EventEmitter", "y", "defaultMaxListeners", "init", "listenerCount", "on", "once", "init_events", "__esmMin", "init_dirname", "init_buffer", "init_process", "init_chunk_4bd36a8f", "emitter", "event", "resolve", "reject", "eventListener", "args", "errorListener", "err", "unconsumedEventValues", "unconsumedPromises", "error", "finished", "iterator", "value", "p", "eventHandler", "errorHandler", "promise", "toError", "d3_shape_1", "d3_selection_1", "annotations", "options", "xScale", "yScale", "line", "d", "parentSelection", "selection", "enter", "yRange", "xRange", "path", "text", "exports", "d3_color_1", "Globals", "v", "registerGraphType", "graphType", "graphTypeBulder", "exports", "globals_1", "__importDefault", "utils", "lo", "hi", "n", "step", "_", "i", "x", "v", "axis", "range", "config", "option", "me", "value", "vMin", "vMax", "data", "index", "indexModLenColor", "exports", "require_token_type", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_Lexer", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "tokenType", "ESCAPES", "DELIMITERS", "isDigit", "c", "isIdentifier", "isWhitespace", "isDelimiter", "str", "isQuote", "Lexer", "message", "index", "error", "text", "c2", "c3", "nth", "current", "number", "quote", "string", "escape", "hex", "replacement", "require_Node", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "require_ConstantNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "SUPPORTED_TYPES", "ConstantNode", "value", "type", "require_OperatorNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "OperatorNode", "op", "args", "require_UnaryNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "UnaryNode", "op", "argument", "require_SymbolNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "SymbolNode", "name", "require_FunctionNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "FunctionNode", "name", "args", "require_ArrayNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "ArrayNode", "nodes", "require_ConditionalNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "ConditionalNode", "predicate", "truthy", "falsy", "require_AssignmentNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "AssignmentNode", "name", "expr", "require_BlockNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Node", "BlockNode", "blocks", "require_Parser", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "tokenType", "Lexer", "ConstantNode", "OperatorNode", "UnaryNode", "SymbolNode", "FunctionNode", "ArrayNode", "ConditionalNode", "AssignmentNode", "BlockNode", "Parser", "first", "i", "text", "blocks", "left", "predicate", "truthy", "falsy", "op", "right", "current", "symbol", "node", "symbolToken", "name", "params", "token", "require_node", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_mr_parser", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_extend", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "hasOwn", "toStr", "defineProperty", "gOPD", "isArray", "arr", "isPlainObject", "obj", "hasOwnConstructor", "hasIsPrototypeOf", "key", "setProperty", "target", "options", "getProperty", "name", "extend", "src", "copy", "copyIsArray", "clone", "i", "length", "deep", "require_ArrayNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "self", "arr", "el", "arrString", "require_AssignmentNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "require_ConditionalNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "condition", "trueExpr", "falseExpr", "require_ConstantNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "require_FunctionNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "SymbolNode", "functionProxy", "node", "self", "method", "args", "arg", "require_Operators", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_OperatorNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Operators", "node", "namedOperator", "require_SymbolNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "id", "require_UnaryOperators", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_UnaryNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "UnaryOperators", "node", "namedOperator", "require_Interpreter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "extend", "types", "Interpreter", "owner", "options", "node", "test", "fn", "oldRaw", "require_CodeGenerator", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Parser", "Interpreter", "extend", "CodeGenerator", "options", "defs", "namespace", "symbol", "scope", "ns", "fn", "name", "defsCode", "code", "factoryCode", "factory", "self", "program", "statement", "require_math_codegen", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_adapter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "math", "a", "b", "res", "i", "root", "inv", "x", "require_eval", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "CodeGenerator", "math", "processScope", "scope", "k", "value", "expression", "require_built_in_math_eval", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_ArrayNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "self", "arr", "el", "arrString", "require_AssignmentNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "require_ConditionalNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "condition", "trueExpr", "falseExpr", "require_ConstantNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "require_FunctionNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "SymbolNode", "functionProxy", "node", "self", "method", "args", "arg", "require_Operators", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_OperatorNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Operators", "node", "namedOperator", "require_SymbolNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "node", "id", "require_UnaryOperators", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "require_UnaryNode", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "UnaryOperators", "node", "namedOperator", "require_Interpreter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "extend", "types", "Interpreter", "owner", "options", "node", "test", "fn", "oldRaw", "require_CodeGenerator", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Parser", "Interpreter", "extend", "CodeGenerator", "options", "defs", "namespace", "self", "symbol", "scope", "ns", "applyFactoryIfNeeded", "value", "fn", "name", "defsCode", "code", "factoryCode", "factory", "program", "statement", "require_math_codegen", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "isInterval", "x", "exports", "isEmpty", "i", "isWhole", "isSingleton", "zeroIn", "hasValue", "value", "hasInterval", "y", "intervalsOverlap", "require_double", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "hasTypedArrays", "DOUBLE_VIEW", "UINT_VIEW", "toDoubleLE", "lo", "hi", "lowUintLE", "highUintLE", "n", "toDoubleBE", "lowUintBE", "highUintBE", "toDouble", "buffer", "lowUint", "highUint", "Buffer", "b", "require_nextafter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "doubleBits", "SMALLEST_DENORM", "UINT_MAX", "nextafter", "x", "y", "hi", "lo", "nextafter_1", "__importDefault", "identity", "v", "prev", "next", "toInteger", "x", "cache", "round", "y", "power", "exports", "utils", "__importStar", "round_1", "__importDefault", "_Interval", "__Interval", "lo", "hi", "Interval", "v", "exports", "bindNew", "Class", "_Class", "len", "rest", "key", "interval_1", "round_1", "__importDefault", "piLow", "piHigh", "constants", "exports", "utils", "__importStar", "equal", "x", "y", "exports", "EPS", "assert", "a", "message", "assertEps", "b", "almostEqual", "assertIncludes", "notEqual", "lessThan", "greaterThan", "lessEqualThan", "greaterEqualThan", "interval_1", "round_1", "__importDefault", "utils", "__importStar", "constants_1", "nonZero", "x", "y", "xl", "xh", "yl", "yh", "out", "exports", "positive", "v", "negative", "zero", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "division", "add", "x", "y", "exports", "subtract", "multiply", "xl", "xh", "yl", "yh", "out", "divide", "positive", "negative", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "fmod", "x", "y", "yb", "exports", "multiplicativeInverse", "pow", "power", "yl", "yh", "sqrt", "nthRoot", "n", "yp", "yn", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "exp", "x", "exports", "log", "l", "log10", "log2", "hull", "y", "badX", "badY", "intersection", "lo", "hi", "union", "difference", "width", "abs", "max", "min", "clone", "require_trigonometric", "__commonJSMin", "exports", "init_dirname", "init_buffer", "init_process", "interval_1", "round_1", "__importDefault", "constants_1", "utils", "__importStar", "arithmetic", "algebra", "misc", "onlyInfinity", "x", "handleNegative", "interval", "n", "cos", "cache", "pi2", "t", "cosv", "lo", "hi", "rlo", "rhi", "sin", "tan", "pi", "asin", "acos", "atan", "sinh", "cosh", "tanh", "interval_1", "exports", "round_1", "__importDefault", "constants_1", "relational", "__importStar", "arithmetic", "algebra", "trigonometric", "misc", "utils", "MixedInterval", "__exportStar", "require_adapter", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "ns", "a", "b", "require_policies", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "Interval", "require_eval", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "CodeGenerator", "Interval", "processScope", "scope", "k", "value", "expression", "require_interval_arithmetic_eval", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "built_in_math_eval_1", "__importDefault", "interval_arithmetic_eval_1", "samplers", "getMathJS", "mathJS", "generateEvaluator", "samplerName", "doCompile", "expression", "compiled", "compileIfPossible", "meta", "property", "hiddenProperty", "hiddenCompiled", "getCompiledExpression", "evaluate", "variables", "builtIn", "exports", "interval", "d3_shape_1", "d3_selection_1", "utils_1", "__importDefault", "globals_1", "eval_1", "mouseTip", "config", "x", "y", "MARGIN", "line", "d", "lineGenerator", "el", "data", "tipInnerJoin", "tipInnerEnter", "tip", "selection", "join", "tipEnter", "coordinates", "i", "minDist", "closestIndex", "meta", "xScale", "yScale", "width", "height", "x0", "y0", "range", "candidateY", "tDist", "clampX", "clampY", "color", "option", "exports", "interval_arithmetic_eval_1", "__importStar", "eval_1", "utils_1", "__importDefault", "interval1d", "samplerParams", "xCoords", "xScale", "yScale", "yMin", "yMax", "samples", "i", "x", "y", "prev", "next", "rectEps", "smallRect", "quadTree", "d", "sample", "midX", "midY", "east", "west", "north", "south", "interval2d", "xDomain", "yDomain", "sampler", "fnTypes", "exports", "utils_1", "__importDefault", "eval_1", "checkAsymptote", "d0", "d1", "d", "sign", "level", "n", "x0", "x1", "samples", "oldY", "oldX", "i", "x", "deltaY", "split", "data", "yScale", "oldSign", "evalResult", "yMin", "yMax", "evalGroup", "deltaX", "yOld", "newSign", "check", "linear", "samplerParams", "allX", "yDomain", "y", "parametric", "parametricRange", "tCoords", "t", "polar", "polarRange", "thetaSamples", "theta", "r", "points", "vector", "sampleParams", "sampler", "fnTypes", "exports", "globals_1", "__importDefault", "interval_1", "builtIn_1", "computeEndpoints", "scale", "d", "range", "start", "end", "evaluate", "chart", "samplerFn", "nSamples", "data", "exports", "d3_selection_1", "d3_shape_1", "utils_1", "__importDefault", "evaluate_1", "polyline", "chart", "plotLine", "selection", "d", "el", "index", "evaluatedData", "color", "innerSelection", "yRange", "yMax", "yMin", "diff", "line", "area", "cls", "innerSelectionEnter", "path", "pathD", "k", "val", "exports", "d3_selection_1", "evaluate_1", "__importDefault", "utils_1", "interval", "chart", "minWidthHeight", "xScale", "yScale", "clampRange", "vLo", "vHi", "gLo", "gHi", "t", "hi", "lo", "line", "points", "closed", "path", "range", "minY", "maxY", "i", "length", "x", "y", "yLo", "yHi", "moveX", "viewportY", "plotLine", "selection", "d", "el", "index", "evaluatedData", "innerSelection", "cls", "innerSelectionEnter", "k", "val", "exports", "d3_selection_1", "d3_color_1", "utils_1", "__importDefault", "evaluate_1", "Scatter", "chart", "xScale", "yScale", "scatter", "selection", "d", "i", "j", "index", "color", "evaluatedData", "joined", "innerSelection", "cls", "innerSelectionEnter", "k", "val", "exports", "d3_selection_1", "d3_color_1", "utils_1", "__importDefault", "Text", "chart", "xScale", "yScale", "text", "selection", "d", "innerSelection", "innerSelectionEnter", "color", "k", "exports", "polyline_1", "__importDefault", "exports", "interval_1", "scatter_1", "text_1", "datumDefaults", "d", "exports", "d3_selection_1", "graph_types_1", "eval_1", "datum_defaults_1", "__importDefault", "utils_1", "derivative", "chart", "derivativeDatum", "computeLine", "d", "x0", "checkAutoUpdate", "self", "x", "selection", "el", "data", "innerSelection", "innerSelectionEnter", "exports", "d3_selection_1", "eval_1", "datum_defaults_1", "__importDefault", "graph_types_1", "utils_1", "secant", "chart", "secantDefaults", "computeSlope", "scope", "updateLine", "d", "x0", "x1", "setFn", "setMouseListener", "secantObject", "self", "x", "computeLines", "data", "i", "selection", "el", "innerSelection", "innerSelectionEnter", "exports", "d3_selection_1", "derivative_1", "__importDefault", "secant_1", "helpers", "chart", "helper", "selection", "el", "exports", "d3_shape_1", "d3_format_1", "d3_scale_1", "d3_axis_1", "d3_zoom_1", "d3_selection_1", "d3_interpolate_1", "events_1", "__importDefault", "annotations_1", "tip_1", "helpers_1", "datum_defaults_1", "globals_1", "getD3Scale", "type", "Chart", "_Chart", "options", "n", "letter", "cachedInstance", "cachedNode", "margin", "self", "integerFormat", "formatter", "d", "computeYScale", "xScale", "xDiff", "xDomain", "axis", "yDomain", "yLimit", "root", "tip", "selection", "canvas", "id", "defs", "canvasEnter", "xLabel", "xLabelEnter", "yLabel", "yLabelEnter", "content", "contentEnter", "yOrigin", "yOriginEnter", "xOrigin", "xOriginEnter", "graphs", "graphsEnter", "index", "ev", "event", "plugins", "plugin", "i", "instance", "yMin", "yMax", "yMid", "yTranslation", "xMin", "xMax", "xMid", "xTranslation", "prevInstance", "events", "coordinates", "transform", "xScaleClone", "yScaleClone", "x", "y", "meta", "title", "format", "text", "all", "mouse", "graph", "e", "args", "localArgs", "exports", "require_types", "__commonJSMin", "exports", "init_dirname", "init_buffer", "init_process", "chart_1", "exports", "globals_1", "__importStar", "graph_types_1", "$eval", "functionPlot", "options", "instance", "__exportStar", "eval_1", "graph_types_2", "require_deep_diff", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "root", "factory", "deepDiff", "_deepdiff", "validKinds", "inherits", "ctor", "superCtor", "Diff", "kind", "path", "DiffEdit", "origin", "value", "DiffNew", "DiffDeleted", "DiffArray", "index", "item", "arrayRemove", "arr", "from", "to", "rest", "realTypeOf", "subject", "type", "hashThisString", "string", "hash", "i", "char", "getOrderIndependentHash", "object", "accum", "arrayString", "key", "keyValueString", "stringToHash", "lhs", "rhs", "changes", "prefilter", "stack", "orderIndependent", "currentPath", "alt", "ltype", "rtype", "j", "k", "other", "ldefined", "rdefined", "a", "b", "akeys", "pkeys", "observableDiff", "observer", "orderIndependentDeepDiff", "accumulateDiff", "difference", "accumulateOrderIndependentDiff", "applyArrayChange", "change", "it", "u", "applyChange", "target", "source", "last", "revertArrayChange", "revertChange", "applyDiff", "filter", "onChange", "require_mousetrap", "__commonJSMin", "exports", "module", "init_dirname", "init_buffer", "init_process", "window", "document", "undefined", "_MAP", "_KEYCODE_MAP", "_SHIFT_MAP", "_SPECIAL_ALIASES", "_REVERSE_MAP", "i", "_addEvent", "object", "type", "callback", "_characterFromEvent", "e", "character", "_modifiersMatch", "modifiers1", "modifiers2", "_eventModifiers", "modifiers", "_preventDefault", "_stopPropagation", "_isModifier", "key", "_getReverseMap", "_pickBestAction", "action", "_keysFromString", "combination", "_getKeyInfo", "keys", "_belongsTo", "element", "ancestor", "Mousetrap", "targetElement", "self", "_sequenceLevels", "_resetTimer", "_ignoreNextKeyup", "_ignoreNextKeypress", "_nextExpectedAction", "_resetSequences", "doNotReset", "activeSequences", "_getMatches", "sequenceName", "level", "matches", "deleteCombo", "deleteSequence", "_fireCallback", "combo", "sequence", "callbacks", "maxLevel", "processedSequenceCallback", "ignoreThisKeypress", "_handleKeyEvent", "_resetSequenceTimer", "_bindSequence", "_increaseSequence", "nextAction", "_callbackAndReset", "isFinal", "wrappedCallback", "_bindSingle", "info", "combinations", "initialEventTarget", "documentMousetrap", "method", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "$", "selector", "$all", "store", "key", "value", "app", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "import_uikit", "showModal", "id", "UIkit", "showError", "title", "error", "$", "notify", "msg", "stat", "app", "confirm", "action", "yesAction", "event", "isMac", "isElectron", "checkLocale", "locale", "app", "checkSize", "$", "toggleMinMax", "checkUpdates", "notify", "event", "status", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "LuxonError", "InvalidDateTimeError", "reason", "InvalidIntervalError", "InvalidDurationError", "ConflictingSpecificationError", "InvalidUnitError", "unit", "InvalidArgumentError", "ZoneIsAbstractError", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "n", "s", "l", "DATE_SHORT", "DATE_MED", "DATE_MED_WITH_WEEKDAY", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED", "DATETIME_MED_WITH_SECONDS", "DATETIME_MED_WITH_WEEKDAY", "DATETIME_FULL", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE", "DATETIME_HUGE_WITH_SECONDS", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "Zone", "ZoneIsAbstractError", "ts", "opts", "format", "otherZone", "singleton", "SystemZone", "_SystemZone", "Zone", "ts", "format", "locale", "parseZoneInfo", "formatOffset", "otherZone", "init_dirname", "init_buffer", "init_process", "dtfCache", "makeDTF", "zone", "typeToPos", "hackyOffset", "dtf", "date", "formatted", "parsed", "fMonth", "fDay", "fYear", "fadOrBc", "fHour", "fMinute", "fSecond", "partsOffset", "filled", "type", "value", "pos", "isUndefined", "ianaZoneCache", "IANAZone", "_IANAZone", "Zone", "name", "s", "ts", "format", "locale", "parseZoneInfo", "formatOffset", "year", "month", "day", "adOrBc", "hour", "minute", "second", "asUTC", "objToLocalTS", "asTS", "over", "otherZone", "init_dirname", "init_buffer", "init_process", "intlLFCache", "getCachedLF", "locString", "opts", "key", "dtf", "intlDTCache", "getCachedDTF", "intlNumCache", "getCachedINF", "inf", "intlRelCache", "getCachedRTF", "base", "cacheKeyOpts", "sysLocaleCache", "systemLocale", "weekInfoCache", "getCachedWeekInfo", "data", "locale", "parseLocaleString", "localeStr", "xIndex", "uIndex", "options", "selectedStr", "smaller", "numberingSystem", "calendar", "intlConfigString", "outputCalendar", "mapMonths", "f", "ms", "i", "dt", "DateTime", "mapWeekdays", "listStuff", "loc", "length", "englishFn", "intlFn", "mode", "supportsFastNumbers", "PolyNumberFormatter", "intl", "forceSimple", "padTo", "floor", "otherOpts", "intlOpts", "fixed", "roundTo", "padStart", "PolyDateFormatter", "z", "gmtOffset", "offsetZ", "IANAZone", "value", "parts", "part", "offsetName", "PolyRelFormatter", "isEnglish", "hasRelative", "count", "unit", "formatRelativeTime", "fallbackWeekSettings", "Locale", "_Locale", "weekSettings", "defaultToEN", "specifiedLocale", "Settings", "localeR", "numberingSystemR", "outputCalendarR", "weekSettingsR", "validateWeekSettings", "numbering", "parsedLocale", "parsedNumberingSystem", "parsedOutputCalendar", "isActuallyEn", "hasNoWeirdness", "alts", "format", "months", "formatStr", "weekdays", "meridiems", "eras", "field", "df", "results", "matching", "m", "hasLocaleWeekInfo", "other", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "singleton", "FixedOffsetZone", "_FixedOffsetZone", "Zone", "offset", "s", "signedOffset", "formatOffset", "ts", "format", "otherZone", "init_dirname", "init_buffer", "init_process", "InvalidZone", "Zone", "zoneName", "normalizeZone", "input", "defaultZone", "offset", "isUndefined", "Zone", "isString", "lowered", "SystemZone", "FixedOffsetZone", "IANAZone", "isNumber", "InvalidZone", "now", "defaultZone", "defaultLocale", "defaultNumberingSystem", "defaultOutputCalendar", "twoDigitCutoffYear", "throwOnInvalid", "defaultWeekSettings", "Settings", "n", "zone", "normalizeZone", "SystemZone", "locale", "numberingSystem", "outputCalendar", "weekSettings", "validateWeekSettings", "cutoffYear", "Locale", "IANAZone", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "Invalid", "reason", "explanation", "nonLeapLadder", "leapLadder", "unitOutOfRange", "unit", "value", "Invalid", "dayOfWeek", "year", "month", "day", "d", "js", "computeOrdinal", "isLeapYear", "uncomputeOrdinal", "ordinal", "table", "month0", "i", "isoWeekdayToLocal", "isoWeekday", "startOfWeek", "gregorianToWeek", "gregObj", "minDaysInFirstWeek", "weekday", "weekNumber", "weekYear", "weeksInWeekYear", "timeObject", "weekToGregorian", "weekData", "weekdayOfJan4", "yearInDays", "daysInYear", "gregorianToOrdinal", "gregData", "ordinalToGregorian", "ordinalData", "usesLocalWeekValues", "obj", "loc", "isUndefined", "ConflictingSpecificationError", "hasInvalidWeekData", "validYear", "isInteger", "validWeek", "integerBetween", "validWeekday", "hasInvalidOrdinalData", "validOrdinal", "hasInvalidGregorianData", "validMonth", "validDay", "daysInMonth", "hasInvalidTimeData", "hour", "minute", "second", "millisecond", "validHour", "validMinute", "validSecond", "validMillisecond", "isUndefined", "o", "isNumber", "isInteger", "isString", "isDate", "hasRelative", "hasLocaleWeekInfo", "maybeArray", "thing", "bestBy", "arr", "by", "compare", "best", "next", "pair", "pick", "obj", "keys", "a", "k", "hasOwnProperty", "prop", "validateWeekSettings", "settings", "InvalidArgumentError", "integerBetween", "v", "bottom", "top", "floorMod", "x", "n", "padStart", "input", "isNeg", "padded", "parseInteger", "string", "parseFloating", "parseMillis", "fraction", "f", "roundTo", "number", "digits", "towardZero", "factor", "isLeapYear", "year", "daysInYear", "daysInMonth", "month", "modMonth", "modYear", "objToLocalTS", "d", "firstWeekOffset", "minDaysInFirstWeek", "startOfWeek", "isoWeekdayToLocal", "dayOfWeek", "weeksInWeekYear", "weekYear", "weekOffset", "weekOffsetNext", "untruncateYear", "Settings", "parseZoneInfo", "ts", "offsetFormat", "locale", "timeZone", "date", "intlOpts", "modified", "parsed", "m", "signedOffset", "offHourStr", "offMinuteStr", "offHour", "offMin", "offMinSigned", "asNumber", "value", "numericValue", "normalizeObject", "normalizer", "normalized", "u", "formatOffset", "offset", "format", "hours", "minutes", "sign", "timeObject", "monthsLong", "monthsShort", "monthsNarrow", "months", "length", "weekdaysLong", "weekdaysShort", "weekdaysNarrow", "weekdays", "meridiems", "erasLong", "erasShort", "erasNarrow", "eras", "meridiemForDateTime", "dt", "weekdayForDateTime", "monthForDateTime", "eraForDateTime", "formatRelativeTime", "unit", "count", "numeric", "narrow", "units", "lastable", "isDay", "isInPast", "fmtValue", "singular", "lilUnits", "fmtUnit", "stringifyTokens", "splits", "tokenToString", "s", "token", "macroTokenToFormatOpts", "DATE_SHORT", "DATE_MED", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_MED", "DATETIME_FULL", "DATETIME_HUGE", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED_WITH_SECONDS", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE_WITH_SECONDS", "Formatter", "_Formatter", "locale", "opts", "fmt", "current", "currentFull", "bracketed", "i", "c", "formatOpts", "dt", "interval", "n", "p", "padStart", "knownEnglish", "useDateTimeFormatter", "string", "extract", "formatOffset", "meridiem", "meridiemForDateTime", "month", "length", "standalone", "monthForDateTime", "weekday", "weekdayForDateTime", "maybeMacro", "era", "eraForDateTime", "dur", "tokenToField", "lildur", "mapped", "tokens", "realTokens", "found", "literal", "val", "collapsed", "t", "init_dirname", "init_buffer", "init_process", "ianaRegex", "combineRegexes", "regexes", "full", "f", "r", "combineExtractors", "extractors", "m", "mergedVals", "mergedZone", "cursor", "ex", "val", "zone", "next", "parse", "s", "patterns", "regex", "extractor", "simpleParse", "keys", "match", "ret", "parseInteger", "offsetRegex", "isoExtendedZone", "isoTimeBaseRegex", "isoTimeRegex", "isoTimeExtensionRegex", "isoYmdRegex", "isoWeekRegex", "isoOrdinalRegex", "extractISOWeekData", "extractISOOrdinalData", "sqlYmdRegex", "sqlTimeRegex", "sqlTimeExtensionRegex", "int", "pos", "fallback", "isUndefined", "extractISOYmd", "extractISOTime", "parseMillis", "extractISOOffset", "local", "fullOffset", "signedOffset", "FixedOffsetZone", "extractIANAZone", "IANAZone", "isoTimeOnly", "isoDuration", "extractISODuration", "yearStr", "monthStr", "weekStr", "dayStr", "hourStr", "minuteStr", "secondStr", "millisecondsStr", "hasNegativePrefix", "negativeSeconds", "maybeNegate", "num", "force", "parseFloating", "obsOffsets", "fromStrings", "weekdayStr", "result", "untruncateYear", "monthsShort", "weekdaysLong", "weekdaysShort", "rfc2822", "extractRFC2822", "obsOffset", "milOffset", "offHourStr", "offMinuteStr", "offset", "preprocessRFC2822", "rfc1123", "rfc850", "ascii", "extractRFC1123Or850", "extractASCII", "isoYmdWithTimeExtensionRegex", "isoWeekWithTimeExtensionRegex", "isoOrdinalWithTimeExtensionRegex", "isoTimeCombinedRegex", "extractISOYmdTimeAndOffset", "extractISOWeekTimeAndOffset", "extractISOOrdinalDateAndTime", "extractISOTimeAndOffset", "parseISODate", "parseRFC2822Date", "parseHTTPDate", "parseISODuration", "extractISOTimeOnly", "parseISOTimeOnly", "sqlYmdWithTimeExtensionRegex", "sqlTimeCombinedRegex", "extractISOTimeOffsetAndIANAZone", "parseSQL", "INVALID", "lowOrderMatrix", "casualMatrix", "daysInYearAccurate", "daysInMonthAccurate", "accurateMatrix", "orderedUnits", "reverseUnits", "clone", "dur", "alts", "clear", "conf", "Duration", "durationToMillis", "matrix", "vals", "sum", "unit", "normalizeValues", "factor", "previous", "current", "isUndefined", "previousVal", "conv", "rollUp", "fraction", "removeZeroes", "newVals", "key", "value", "_Duration", "config", "accurate", "Locale", "count", "opts", "obj", "InvalidArgumentError", "normalizeObject", "durationLike", "isNumber", "text", "parsed", "parseISODuration", "parseISOTimeOnly", "reason", "explanation", "invalid", "Invalid", "Settings", "InvalidDurationError", "normalized", "InvalidUnitError", "o", "fmt", "fmtOpts", "Formatter", "l", "val", "s", "roundTo", "millis", "DateTime", "duration", "result", "k", "hasOwnProperty", "fn", "asNumber", "values", "mixed", "locale", "numberingSystem", "conversionAccuracy", "units", "built", "accumulated", "lastUnit", "own", "ak", "i", "negated", "other", "eq", "v1", "v2", "u", "init_dirname", "init_buffer", "init_process", "INVALID", "validateStartEnd", "start", "end", "Interval", "_Interval", "config", "reason", "explanation", "InvalidArgumentError", "invalid", "Invalid", "Settings", "InvalidIntervalError", "builtStart", "friendlyDateTime", "builtEnd", "validateError", "duration", "dur", "Duration", "dt", "text", "opts", "s", "e", "startIsValid", "DateTime", "endIsValid", "o", "unit", "dateTime", "dateTimes", "sorted", "d", "a", "b", "results", "i", "added", "next", "idx", "x", "numberOfParts", "other", "intervals", "found", "final", "sofar", "current", "item", "currentCount", "ends", "flattened", "arr", "formatOpts", "DATE_SHORT", "Formatter", "dateFormat", "separator", "mapFn", "init_dirname", "init_buffer", "init_process", "Info", "zone", "Settings", "proto", "DateTime", "IANAZone", "input", "normalizeZone", "locale", "locObj", "Locale", "length", "numberingSystem", "outputCalendar", "hasRelative", "hasLocaleWeekInfo", "init_dirname", "init_buffer", "init_process", "dayDiff", "earlier", "later", "utcDayStart", "dt", "ms", "Duration", "highOrderDiffs", "cursor", "units", "differs", "b", "days", "results", "lowestOrder", "highWater", "unit", "differ", "diff_default", "opts", "remainingMillis", "lowerOrderUnits", "u", "duration", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "numberingSystems", "numberingSystemsUTF16", "hanidecChars", "parseDigits", "str", "value", "i", "code", "key", "min", "max", "digitRegex", "numberingSystem", "append", "MISSING_FTP", "intUnit", "regex", "post", "i", "s", "parseDigits", "NBSP", "spaceOrNBSP", "spaceOrNBSPRegExp", "fixListRegex", "stripInsensitivities", "oneOf", "strings", "startIndex", "offset", "groups", "h", "m", "signedOffset", "simple", "escapeToken", "value", "unitForToken", "token", "loc", "one", "digitRegex", "two", "three", "four", "six", "oneOrTwo", "oneToThree", "oneToSix", "oneToNine", "twoToFour", "fourToSix", "literal", "t", "unit", "untruncateYear", "partTypeStyleToTokenVal", "tokenForPart", "part", "formatOpts", "resolvedOpts", "type", "isSpace", "style", "actualType", "val", "buildRegex", "units", "u", "f", "r", "match", "input", "handlers", "matches", "all", "matchIndex", "hasOwnProperty", "dateTimeFromMatches", "toField", "zone", "specificOffset", "isUndefined", "IANAZone", "FixedOffsetZone", "parseMillis", "k", "dummyDateTimeCache", "getDummyDateTime", "DateTime", "maybeExpandMacroToken", "locale", "Formatter", "tokens", "formatOptsToTokens", "expandMacroTokens", "explainFromTokens", "format", "disqualifyingUnit", "regexString", "rawMatches", "result", "ConflictingSpecificationError", "parseFromTokens", "invalidReason", "df", "parts", "p", "INVALID", "MAX_DATE", "unsupportedZone", "zone", "Invalid", "possiblyCachedWeekData", "dt", "gregorianToWeek", "possiblyCachedLocalWeekData", "clone", "inst", "alts", "current", "DateTime", "fixOffset", "localTS", "o", "tz", "utcGuess", "o2", "o3", "tsToObj", "ts", "offset", "d", "objToTS", "obj", "objToLocalTS", "adjustTime", "dur", "oPre", "year", "month", "c", "daysInMonth", "millisToAdd", "Duration", "parseDataToDateTime", "parsed", "parsedZone", "opts", "format", "text", "specificOffset", "setZone", "interpretationZone", "toTechFormat", "allowZ", "Formatter", "Locale", "toISODate", "extended", "longFormat", "padStart", "toISOTime", "suppressSeconds", "suppressMilliseconds", "includeOffset", "extendedZone", "defaultUnitValues", "defaultWeekUnitValues", "defaultOrdinalUnitValues", "orderedUnits", "orderedWeekUnits", "orderedOrdinalUnits", "normalizeUnit", "unit", "normalized", "InvalidUnitError", "normalizeUnitWithLocalWeeks", "quickDT", "normalizeZone", "Settings", "loc", "tsNow", "isUndefined", "u", "invalid", "hasInvalidGregorianData", "hasInvalidTimeData", "offsetProvis", "diffRelative", "start", "end", "round", "roundTo", "differ", "count", "lastOpts", "argList", "args", "_DateTime", "config", "ot", "day", "hour", "minute", "second", "millisecond", "FixedOffsetZone", "date", "options", "isDate", "zoneToUse", "milliseconds", "isNumber", "InvalidArgumentError", "seconds", "normalizeObject", "minDaysInFirstWeek", "startOfWeek", "usesLocalWeekValues", "containsOrdinal", "containsGregorYear", "containsGregorMD", "containsGregor", "definiteWeekDef", "ConflictingSpecificationError", "useWeekData", "units", "defaultValues", "objNow", "gregorianToOrdinal", "foundFirst", "v", "higherOrderInvalid", "hasInvalidWeekData", "hasInvalidOrdinalData", "gregorian", "weekToGregorian", "ordinalToGregorian", "tsFinal", "offsetFinal", "vals", "parseISODate", "parseRFC2822Date", "parseHTTPDate", "fmt", "locale", "numberingSystem", "localeToUse", "parseFromTokens", "parseSQL", "reason", "explanation", "InvalidDateTimeError", "formatOpts", "localeOpts", "tokenList", "formatOptsToTokens", "t", "expandMacroTokens", "Info", "dayMs", "minuteMs", "oEarlier", "oLater", "o1", "ts1", "ts2", "c1", "c2", "isLeapYear", "daysInYear", "weeksInWeekYear", "calendar", "keepLocalTime", "keepCalendarTime", "newTS", "offsetGuess", "asObj", "outputCalendar", "values", "settingWeekStuff", "mixed", "duration", "useLocaleWeeks", "normalizedUnit", "weekday", "q", "DATE_SHORT", "ext", "includePrefix", "includeZone", "includeOffsetSpace", "base", "otherDateTime", "durOpts", "maybeArray", "otherIsLater", "earlier", "later", "diffed", "diff_default", "Interval", "inputMs", "adjustedToZone", "other", "padding", "dateTimes", "bestBy", "i", "explainFromTokens", "DATE_MED", "DATE_MED_WITH_WEEKDAY", "DATE_FULL", "DATE_HUGE", "TIME_SIMPLE", "TIME_WITH_SECONDS", "TIME_WITH_SHORT_OFFSET", "TIME_WITH_LONG_OFFSET", "TIME_24_SIMPLE", "TIME_24_WITH_SECONDS", "TIME_24_WITH_SHORT_OFFSET", "TIME_24_WITH_LONG_OFFSET", "DATETIME_SHORT", "DATETIME_SHORT_WITH_SECONDS", "DATETIME_MED", "DATETIME_MED_WITH_SECONDS", "DATETIME_MED_WITH_WEEKDAY", "DATETIME_FULL", "DATETIME_FULL_WITH_SECONDS", "DATETIME_HUGE", "DATETIME_HUGE_WITH_SECONDS", "friendlyDateTime", "dateTimeish", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "_extends", "n", "e", "t", "r", "init_dirname", "init_buffer", "init_process", "DEFAULT_CONFIG", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "isNumber", "x", "isBigNumber", "isBigInt", "isComplex", "isFraction", "isUnit", "isString", "isArray", "isMatrix", "isCollection", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isObject", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "rule2Node", "node", "isOperatorNode", "isFunctionAssignmentNode", "isFunctionNode", "isIndexNode", "isNode", "isObjectNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isChain", "typeOf", "clone", "x", "type", "value", "isBigNumber", "isObject", "mapObject", "object", "callback", "key", "hasOwnProperty", "extend", "a", "b", "prop", "deepExtend", "deepStrictEqual", "i", "len", "deepFlatten", "nestedObject", "flattenedObject", "_deepFlatten", "lazy", "object", "prop", "valueResolver", "_uninitialized", "_value", "value", "hasOwnProperty", "object", "property", "isLegacyFactory", "pickShallow", "object", "properties", "copy", "i", "key", "value", "MATRIX_OPTIONS", "NUMBER_OPTIONS", "configFactory", "config", "emit", "_config", "options", "optionsFix", "clone", "prev", "validateOption", "deepExtend", "curr", "changes", "DEFAULT_CONFIG", "key", "name", "values", "value", "factoriesAny_exports", "__export", "createAbs", "createAccessorNode", "createAcos", "createAcosh", "createAcot", "createAcoth", "createAcsc", "createAcsch", "createAdd", "createAddScalar", "createAnd", "createAndTransform", "createApply", "createApplyTransform", "createArg", "createArrayNode", "createAsec", "createAsech", "createAsin", "createAsinh", "createAssignmentNode", "createAtan", "createAtan2", "createAtanh", "createAtomicMass", "createAvogadro", "createBellNumbers", "createBigNumberClass", "createBigint", "createBignumber", "createBin", "createBitAnd", "createBitAndTransform", "createBitNot", "createBitOr", "createBitOrTransform", "createBitXor", "createBlockNode", "createBohrMagneton", "createBohrRadius", "createBoltzmann", "createBoolean", "createCatalan", "createCbrt", "createCeil", "createChain", "createChainClass", "createClassicalElectronRadius", "createClone", "createColumn", "createColumnTransform", "createCombinations", "createCombinationsWithRep", "createCompare", "createCompareNatural", "createCompareText", "createCompile", "createComplex", "createComplexClass", "createComposition", "createConcat", "createConcatTransform", "createConditionalNode", "createConductanceQuantum", "createConj", "createConstantNode", "createCorr", "createCos", "createCosh", "createCot", "createCoth", "createCoulomb", "createCount", "createCreateUnit", "createCross", "createCsc", "createCsch", "createCtranspose", "createCube", "createCumSum", "createCumSumTransform", "createDeepEqual", "createDenseMatrixClass", "createDerivative", "createDet", "createDeuteronMass", "createDiag", "createDiff", "createDiffTransform", "createDistance", "createDivide", "createDivideScalar", "createDot", "createDotDivide", "createDotMultiply", "createDotPow", "createE", "createEfimovFactor", "createEigs", "createElectricConstant", "createElectronMass", "createElementaryCharge", "createEqual", "createEqualScalar", "createEqualText", "createErf", "createEvaluate", "createExp", "createExpm", "createExpm1", "createFactorial", "createFalse", "createFaraday", "createFermiCoupling", "createFft", "createFibonacciHeapClass", "createFilter", "createFilterTransform", "createFineStructure", "createFirstRadiation", "createFix", "createFlatten", "createFloor", "createForEach", "createForEachTransform", "createFormat", "createFraction", "createFractionClass", "createFreqz", "createFunctionAssignmentNode", "createFunctionNode", "createGamma", "createGasConstant", "createGcd", "createGetMatrixDataType", "createGravitationConstant", "createGravity", "createHartreeEnergy", "createHasNumericValue", "createHelp", "createHelpClass", "createHex", "createHypot", "createI", "createIdentity", "createIfft", "createIm", "createImmutableDenseMatrixClass", "createIndex", "createIndexClass", "createIndexNode", "createIndexTransform", "createInfinity", "createIntersect", "createInv", "createInverseConductanceQuantum", "createInvmod", "createIsInteger", "createIsNaN", "createIsNegative", "createIsNumeric", "createIsPositive", "createIsPrime", "createIsZero", "createKldivergence", "createKlitzing", "createKron", "createLN10", "createLN2", "createLOG10E", "createLOG2E", "createLarger", "createLargerEq", "createLcm", "createLeafCount", "createLeftShift", "createLgamma", "createLog", "createLog10", "createLog1p", "createLog2", "createLoschmidt", "createLsolve", "createLsolveAll", "createLup", "createLusolve", "createLyap", "createMad", "createMagneticConstant", "createMagneticFluxQuantum", "createMap", "createMapTransform", "createMatrix", "createMatrixClass", "createMatrixFromColumns", "createMatrixFromFunction", "createMatrixFromRows", "createMax", "createMaxTransform", "createMean", "createMeanTransform", "createMedian", "createMin", "createMinTransform", "createMod", "createMode", "createMolarMass", "createMolarMassC12", "createMolarPlanckConstant", "createMolarVolume", "createMultinomial", "createMultiply", "createMultiplyScalar", "createNaN", "createNeutronMass", "createNode", "createNorm", "createNot", "createNthRoot", "createNthRoots", "createNuclearMagneton", "createNull", "createNumber", "createNumeric", "createObjectNode", "createOct", "createOnes", "createOperatorNode", "createOr", "createOrTransform", "createParenthesisNode", "createParse", "createParser", "createParserClass", "createPartitionSelect", "createPermutations", "createPhi", "createPi", "createPickRandom", "createPinv", "createPlanckCharge", "createPlanckConstant", "createPlanckLength", "createPlanckMass", "createPlanckTemperature", "createPlanckTime", "createPolynomialRoot", "createPow", "createPrint", "createPrintTransform", "createProd", "createProtonMass", "createQr", "createQuantileSeq", "createQuantileSeqTransform", "createQuantumOfCirculation", "createRandom", "createRandomInt", "createRange", "createRangeClass", "createRangeNode", "createRangeTransform", "createRationalize", "createRe", "createReducedPlanckConstant", "createRelationalNode", "createReplacer", "createReshape", "createResize", "createResolve", "createResultSet", "createReviver", "createRightArithShift", "createRightLogShift", "createRotate", "createRotationMatrix", "createRound", "createRow", "createRowTransform", "createRydberg", "createSQRT1_2", "createSQRT2", "createSackurTetrode", "createSchur", "createSec", "createSech", "createSecondRadiation", "createSetCartesian", "createSetDifference", "createSetDistinct", "createSetIntersect", "createSetIsSubset", "createSetMultiplicity", "createSetPowerset", "createSetSize", "createSetSymDifference", "createSetUnion", "createSign", "createSimplify", "createSimplifyConstant", "createSimplifyCore", "createSin", "createSinh", "createSize", "createSlu", "createSmaller", "createSmallerEq", "createSolveODE", "createSort", "createSpaClass", "createSparse", "createSparseMatrixClass", "createSpeedOfLight", "createSplitUnit", "createSqrt", "createSqrtm", "createSquare", "createSqueeze", "createStd", "createStdTransform", "createStefanBoltzmann", "createStirlingS2", "createString", "createSubset", "createSubsetTransform", "createSubtract", "createSubtractScalar", "createSum", "createSumTransform", "createSylvester", "createSymbolNode", "createSymbolicEqual", "createTan", "createTanh", "createTau", "createThomsonCrossSection", "createTo", "createTrace", "createTranspose", "createTrue", "createTypeOf", "createTyped", "createUnaryMinus", "createUnaryPlus", "createUnequal", "createUnitClass", "createUnitFunction", "createUppercaseE", "createUppercasePi", "createUsolve", "createUsolveAll", "createVacuumImpedance", "createVariance", "createVarianceTransform", "createVersion", "createWeakMixingAngle", "createWienDisplacement", "createXgcd", "createXor", "createZeros", "createZeta", "createZpk2tf", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "import_typed_function", "init_dirname", "init_buffer", "init_process", "isInteger", "value", "isIntegerStr", "str", "safeNumberType", "numberStr", "config", "sign", "x", "log2", "log10", "log1p", "cbrt", "negate", "result", "expm1", "formatNumberToBase", "n", "base", "size", "prefixes", "prefix", "suffix", "format", "options", "notation", "precision", "wordSize", "normalizeFormatOptions", "toFixed", "toExponential", "toEngineering", "toPrecision", "digits", "e", "isNumber", "isBigNumber", "isObject", "_toNumberOrThrow", "splitNumber", "match", "exponent", "dot", "coefficients", "zeros", "d", "split", "rounded", "roundDigits", "c", "newExp", "missingZeros", "i", "expDiff", "decimalIdx", "decimals", "decimalVal", "splitValue", "p", "pp", "first", "lowerExp", "_toNumberOrDefault", "upperExp", "removed", "length", "arr", "DBL_EPSILON", "nearlyEqual", "a", "b", "relTol", "absTol", "acosh", "asinh", "atanh", "cosh", "sinh", "tanh", "copysign", "y", "signx", "signy", "onError", "defaultValue", "init_dirname", "init_buffer", "init_process", "factory", "name", "dependencies", "create", "meta", "assertAndCreate", "scope", "deps", "pickShallow", "stripOptionalNotation", "assertDependencies", "isFactory", "obj", "assertDependencies", "name", "dependencies", "scope", "allDefined", "dependency", "isOptionalDependency", "missingDependencies", "d", "stripOptionalNotation", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "getSafeProperty", "object", "prop", "isPlainObject", "isSafeProperty", "isSafeMethod", "setSafeProperty", "value", "hasSafeProperty", "object", "prop", "isSafeProperty", "hasOwnProperty", "safeNativeProperties", "getSafeMethod", "method", "isSafeMethod", "safeNativeMethods", "isPlainObject", "ObjectWrappingMap", "object", "key", "getSafeProperty", "value", "setSafeProperty", "hasSafeProperty", "mapIterator", "callback", "PartitionedMap", "a", "b", "bKeys", "it", "n", "createEmptyMap", "createMap", "mapOrObject", "isMap", "isObject", "toObject", "map", "_createTyped2", "typedFunction", "dependencies", "createTyped", "factory", "_ref", "BigNumber", "Complex", "DenseMatrix", "Fraction", "typed", "isNumber", "isComplex", "isBigNumber", "isBigInt", "isFraction", "isUnit", "s", "isString", "isChain", "isArray", "isMatrix", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "isFunctionNode", "isFunctionAssignmentNode", "isIndexNode", "isNode", "isObjectNode", "isOperatorNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isMap", "isObject", "x", "throwNoBignumber", "digits", "throwNoComplex", "throwNoFraction", "f", "n", "array", "throwNoMatrix", "matrix", "name", "args", "signatures", "usualError", "isCollection", "sig", "err", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createResultSet", "factory", "ResultSet", "entries", "json", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "EXP_LIMIT", "MAX_DIGITS", "NUMERALS", "LN10", "PI", "DEFAULTS", "inexact", "quadrant", "external", "decimalError", "invalidArgument", "precisionLimitExceeded", "cryptoUnavailable", "tag", "mathfloor", "mathpow", "isBinary", "isHex", "isOctal", "isDecimal", "BASE", "LOG_BASE", "MAX_SAFE_INTEGER", "LN10_PRECISION", "PI_PRECISION", "P", "x", "finalise", "min", "max", "k", "Ctor", "y", "i", "j", "xdL", "ydL", "xd", "yd", "xs", "ys", "pr", "rm", "cosine", "toLessThanHalfPi", "m", "n", "r", "rep", "s", "sd", "t", "t3", "t3plusx", "digitsToString", "divide", "w", "d", "len", "one", "tinyPow", "taylorSeries", "cosh2_x", "d8", "sinh2_x", "d5", "d16", "d20", "halfPi", "getPi", "wpr", "xsd", "px", "x2", "base", "isBase10", "denominator", "inf", "num", "arg", "guard", "naturalLogarithm", "getLn10", "checkRoundingDigits", "e", "xe", "xLTy", "getBase10Exponent", "q", "naturalExponential", "carry", "z", "getPrecision", "sine", "rL", "toStringBinary", "dp", "checkInt32", "str", "finiteToString", "maxD", "d0", "d1", "d2", "n0", "n1", "yn", "intPow", "ws", "indexOfLastWord", "getZeroString", "repeating", "di", "rd", "convertBase", "baseIn", "baseOut", "arr", "arrL", "strL", "cos2x", "multiplyInteger", "temp", "compare", "a", "b", "aL", "bL", "subtract", "cmp", "logBase", "more", "prod", "prodL", "qd", "rem", "remL", "rem0", "xi", "xL", "yd0", "yL", "yz", "sign", "isTruncated", "digits", "roundUp", "xdi", "out", "isExp", "nonFiniteToString", "zs", "truncate", "isOdd", "maxOrMin", "args", "ltgt", "pow", "sum", "c", "c0", "numerator", "x1", "parseDecimal", "parseOther", "divisor", "isFloat", "p", "Decimal", "sin2_x", "isHyperbolic", "u", "isNeg", "pi", "abs", "acos", "acosh", "add", "asin", "asinh", "atan", "atanh", "atan2", "cbrt", "ceil", "clamp", "config", "obj", "v", "useDefaults", "ps", "cos", "cosh", "clone", "isDecimalInstance", "div", "exp", "floor", "hypot", "ln", "log", "log10", "log2", "mod", "mul", "random", "round", "sin", "sinh", "sqrt", "sub", "tan", "tanh", "trunc", "decimal_default", "name", "dependencies", "createBigNumberClass", "factory", "_ref", "on", "config", "BigNumber", "decimal_default", "json", "curr", "prev", "init_dirname", "init_buffer", "init_process", "import_complex", "name", "dependencies", "createComplexClass", "factory", "Complex", "options", "str", "im", "re", "strRe", "format", "strIm", "precision", "isNumber", "epsilon", "args", "arg", "phi", "isUnit", "json", "a", "b", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "MAX_CYCLE_LEN", "P", "assign", "n", "s", "InvalidParameter", "newFraction", "d", "DivisionByZero", "f", "Fraction", "a", "gcd", "factorize", "num", "factors", "i", "parse", "p1", "p2", "v", "w", "x", "y", "z", "A", "B", "C", "D", "N", "M", "NonIntegerParameter", "modpow", "b", "e", "m", "r", "cycleLen", "rem", "t", "cycleStart", "len", "rem1", "rem2", "places", "k", "eps", "thisABS", "cont", "excludeWhole", "whole", "str", "res", "dec", "cycLen", "cycOff", "name", "dependencies", "createFractionClass", "factory", "Fraction", "json", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRangeClass", "factory", "Range", "start", "end", "step", "hasStart", "hasEnd", "hasStep", "isBigNumber", "str", "args", "nums", "arg", "invalid", "num", "len", "diff", "sign", "size", "callback", "x", "i", "array", "value", "index", "obj", "options", "format", "json", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatrixClass", "factory", "Matrix", "data", "datatype", "index", "replacement", "defaultValue", "value", "size", "callback", "skipZeros", "options", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "formatBigNumberToBase", "n", "base", "size", "BigNumberCtor", "big2", "suffix", "isInteger", "format", "value", "options", "notation", "precision", "wordSize", "normalizeFormatOptions", "toFixed", "toExponential", "toEngineering", "lowerExp", "_toNumberOrDefault", "upperExp", "str", "rounded", "exp", "digits", "e", "newExp", "valueWithoutExp", "valueStr", "BigNumber", "defaultValue", "isNumber", "isBigNumber", "endsWith", "text", "search", "start", "end", "format", "value", "options", "result", "_format", "isBigNumber", "looksLikeFraction", "formatArray", "isString", "stringify", "entries", "key", "escaped", "i", "c", "controlCharacters", "escape", "array", "str", "len", "compareText", "x", "y", "typeOf", "init_dirname", "init_buffer", "init_process", "DimensionError", "actual", "expected", "relation", "init_dirname", "init_buffer", "init_process", "IndexError", "index", "min", "max", "arraySize", "x", "s", "_validate", "array", "size", "dim", "i", "len", "DimensionError", "dimNext", "child", "validate", "isScalar", "validateIndexSourceSize", "value", "index", "valueSize", "sourceSize", "sourceDim", "validateIndex", "length", "isNumber", "isInteger", "IndexError", "isEmptyIndex", "dimension", "isArray", "isString", "resize", "defaultValue", "format", "isBigNumber", "_defaultValue", "_resize", "elem", "oldLen", "newLen", "minLen", "reshape", "sizes", "flatArray", "flatten", "currentLength", "processSizesWildcard", "newLength", "product", "_reshape", "e", "processedSizes", "WILDCARD", "wildCardIndex", "isMoreThanOneWildcard", "hasWildcard", "canReplaceWildcard", "prev", "curr", "tmpArray", "tmpArray2", "sizeIndex", "squeeze", "dims", "_squeeze", "ii", "next", "unsqueeze", "outer", "_unsqueeze", "d", "flat", "callback", "map", "forEach", "filter", "filterRegExp", "regexp", "entry", "join", "separator", "identify", "a", "b", "count", "generalize", "getArrayDataType", "typeOf", "type", "item", "_isArray", "itemType", "concatRecursive", "a", "b", "concatDim", "dim", "DimensionError", "c", "i", "concat", "arrays", "A", "B", "broadcastSizes", "_len", "sizes", "_key", "dimensions", "s", "N", "sizeMax", "size", "j", "n", "_i", "checkBroadcastingRules", "toSize", "broadcastTo", "array", "Asize", "arraySize", "deepStrictEqual", "broadcastedSize", "paddedSize", "clone", "reshape", "stretch", "stretch", "arrayToStretch", "sizeToStretch", "dimToStretch", "concat", "clone", "array", "_extends", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "lruQueue", "limit", "size", "base", "queue", "map", "index", "del", "id", "oldIndex", "nuIndex", "memoize", "fn", "hasher", "limit", "lruQueue", "args", "i", "hash", "newVal", "maxArgumentCount", "fn", "args", "signature", "count", "name", "dependencies", "createDenseMatrixClass", "factory", "_ref", "Matrix", "DenseMatrix", "data", "datatype", "isString", "isMatrix", "clone", "isArray", "validate", "preprocess", "arraySize", "typeOf", "getArrayDataType", "index", "replacement", "defaultValue", "_get", "_set", "DimensionError", "x", "validateIndex", "i", "ii", "indexI", "value", "size", "_fit", "matrix", "isIndex", "isScalar", "min", "max", "_getSubmatrix", "dims", "dim", "last", "range", "child", "submatrix", "iSize", "sSize", "deepStrictEqual", "broadcastTo", "outer", "unsqueeze", "_setSubmatrix", "dataIndex", "subIndex", "copy", "isCollection", "sizeArray", "m", "_resize", "v", "resize", "reshape", "currentLength", "length", "processSizesWildcard", "newSize", "changed", "callback", "me", "args", "maxArgumentCount", "recurse", "result", "s", "row", "_this", "_loop", "col", "options", "format", "k", "isBigNumber", "isNumber", "isInteger", "kSuper", "kSub", "rows", "columns", "n", "_value", "ms", "d", "json", "j", "vi", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createClone", "factory", "_ref", "typed", "clone", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "_switch", "mat", "I", "J", "i", "j", "ret", "tmp", "containsCollections", "array", "i", "isCollection", "deepForEach", "callback", "isMatrix", "ii", "value", "deepMap", "skipZeros", "x", "reduce", "mat", "dim", "size", "arraySize", "IndexError", "_reduce", "ret", "val", "tran", "_switch", "scatter", "a", "j", "w", "u", "mark", "cindex", "f", "inverse", "update", "avalues", "aindex", "aptr", "k", "k0", "k1", "name", "dependencies", "createIsInteger", "factory", "_ref", "typed", "isInteger", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "n1", "n2", "absNumber", "a", "addNumber", "b", "subtractNumber", "multiplyNumber", "divideNumber", "unaryMinusNumber", "x", "unaryPlusNumber", "cbrtNumber", "cbrt", "cubeNumber", "expNumber", "expm1Number", "expm1", "gcdNumber", "isInteger", "lcmNumber", "t", "prod", "logNumber", "y", "log10Number", "log10", "log2Number", "log2", "log1pNumber", "log1p", "modNumber", "nthRootNumber", "root", "inv", "signNumber", "sign", "sqrtNumber", "squareNumber", "xgcdNumber", "q", "r", "lastx", "lasty", "res", "powNumber", "roundNumber", "value", "decimals", "toFixed", "normNumber", "init_dirname", "init_buffer", "init_process", "n1", "n2", "bitAndNumber", "x", "y", "isInteger", "bitNotNumber", "bitOrNumber", "bitXorNumber", "leftShiftNumber", "rightArithShiftNumber", "rightLogShiftNumber", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "product", "i", "n", "half", "combinationsNumber", "n", "k", "isInteger", "nMinusk", "answer", "firstnumerator", "nextdivisor", "lastdivisor", "nextnumerator", "product", "init_dirname", "init_buffer", "init_process", "pi", "tau", "e", "phi", "init_dirname", "init_buffer", "init_process", "n1", "n2", "notNumber", "x", "orNumber", "y", "xorNumber", "andNumber", "init_dirname", "init_buffer", "init_process", "gammaNumber", "n", "x", "isInteger", "product", "twoN", "threeN", "fourN", "fiveN", "gammaP", "i", "t", "gammaG", "lnSqrt2PI", "lgammaG", "lgammaN", "lgammaSeries", "lgammaNumber", "base", "sum", "init_dirname", "init_buffer", "init_process", "n1", "n2", "acosNumber", "x", "acoshNumber", "acosh", "acotNumber", "acothNumber", "acscNumber", "acschNumber", "xInv", "asecNumber", "asechNumber", "ret", "asinNumber", "asinhNumber", "asinh", "atanNumber", "atan2Number", "y", "atanhNumber", "atanh", "cosNumber", "coshNumber", "cosh", "cotNumber", "cothNumber", "e", "cscNumber", "cschNumber", "sign", "secNumber", "sechNumber", "sinNumber", "sinhNumber", "sinh", "tanNumber", "tanhNumber", "tanh", "init_dirname", "init_buffer", "init_process", "n1", "isIntegerNumber", "x", "isInteger", "isNegativeNumber", "isPositiveNumber", "isZeroNumber", "isNaNNumber", "init_dirname", "init_buffer", "init_process", "nearlyEqual", "a", "b", "relTol", "absTol", "name", "dependencies", "createIsNegative", "factory", "_ref", "typed", "config", "x", "nearlyEqual", "isNegativeNumber", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsNumeric", "factory", "_ref", "typed", "self", "x", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createHasNumericValue", "factory", "_ref", "typed", "isNumeric", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsPositive", "factory", "_ref", "typed", "config", "x", "nearlyEqual", "isPositiveNumber", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsZero", "factory", "_ref", "typed", "equalScalar", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsNaN", "factory", "_ref", "typed", "isNaNNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTypeOf", "factory", "_ref", "typed", "typeOf", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "complexEquals", "x", "y", "relTol", "absTol", "nearlyEqual", "init_dirname", "init_buffer", "init_process", "createCompareUnits", "factory", "_ref", "typed", "self", "x", "y", "name", "dependencies", "createEqualScalar", "factory", "_ref", "typed", "config", "compareUnits", "createCompareUnits", "x", "y", "nearlyEqual", "complexEquals", "createEqualScalarNumber", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSparseMatrixClass", "factory", "_ref", "typed", "equalScalar", "Matrix", "SparseMatrix", "data", "datatype", "isString", "isMatrix", "_createFromMatrix", "isArray", "_createFromArray", "typeOf", "matrix", "source", "clone", "rows", "columns", "eq", "zero", "j", "i", "row", "v", "getArrayDataType", "index", "replacement", "defaultValue", "_getsubset", "_setsubset", "idx", "isIndex", "isScalar", "size", "DimensionError", "ii", "k", "kk", "min", "max", "validateIndex", "mvalues", "mindex", "mptr", "w", "pv", "r", "values", "ptr", "submatrix", "iSize", "sSize", "arraySize", "outer", "unsqueeze", "deepStrictEqual", "range", "dataIndex", "subIndex", "firstDimensionRange", "secondDimensionRange", "firstDataIndex", "firstSubIndex", "secondDataIndex", "secondSubIndex", "_getValueIndex", "_resize", "_remove", "_insert", "top", "bottom", "x", "copy", "isCollection", "sizeArray", "value", "isNumber", "isInteger", "format", "m", "ins", "c", "n", "p", "d", "k0", "k1", "sizes", "currentLength", "processSizesWildcard", "newLength", "colIndex", "rowIndex", "_i", "r1", "c1", "flat", "_i2", "h", "_i3", "_j", "callback", "skipZeros", "me", "args", "maxArgumentCount", "invoke", "_map", "minRow", "maxRow", "minColumn", "maxColumn", "y", "_values", "_k", "_i4", "_i5", "_k2", "_i6", "_i7", "_toArray", "a", "options", "density", "str", "isBigNumber", "kSuper", "kSub", "json", "s", "_value", "ms", "kx", "ky", "vx", "vy", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "getNonDecimalNumberParts", "input", "nonDecimalWithRadixMatch", "radix", "integerPart", "fractionalPart", "makeNumberFromNonDecimalParts", "parts", "n", "f", "i", "digitValue", "result", "createNumber", "factory", "_ref", "typed", "number", "x", "nonDecimalNumberParts", "size", "wordSizeSuffixMatch", "num", "self", "clone", "unit", "valuelessUnit", "deepMap", "json", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBigint", "factory", "_ref", "typed", "bigint", "x", "self", "deepMap", "json", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createString", "factory", "_ref", "typed", "format", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBoolean", "factory", "_ref", "typed", "x", "lcase", "num", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBignumber", "factory", "_ref", "typed", "BigNumber", "x", "wordSizeSuffixMatch", "size", "n", "twoPowSize", "twoPowSizeSubOne", "self", "clone", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createComplex", "factory", "_ref", "typed", "Complex", "x", "re", "im", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFraction", "factory", "_ref", "typed", "Fraction", "x", "numerator", "denominator", "self", "clone", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatrix", "factory", "_ref", "typed", "Matrix", "DenseMatrix", "SparseMatrix", "_create", "format", "datatype", "data", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatrixFromFunction", "factory", "_ref", "typed", "matrix", "isZero", "size", "fn", "format", "datatype", "_create", "m", "_", "index", "val", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatrixFromRows", "factory", "_ref", "typed", "matrix", "flatten", "size", "arr", "_createArray", "m", "N", "checkVectorTypeAndReturnLength", "result", "row", "rowLength", "vec", "s", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatrixFromColumns", "factory", "_ref", "typed", "matrix", "flatten", "size", "arr", "_createArray", "m", "N", "checkVectorTypeAndReturnLength", "result", "i", "col", "colLength", "f", "_i", "vec", "s", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSplitUnit", "factory", "_ref", "typed", "unit", "parts", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUnaryMinus", "factory", "_ref", "typed", "unaryMinusNumber", "x", "self", "res", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUnaryPlus", "factory", "_ref", "typed", "config", "numeric", "unaryPlusNumber", "x", "self", "deepMap", "safeNumberType", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAbs", "factory", "_ref", "typed", "absNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createApply", "factory", "_ref", "typed", "isInteger", "mat", "dim", "callback", "size", "arraySize", "IndexError", "isMatrix", "_apply", "i", "ret", "tran", "_switch", "I", "J", "j", "tmp", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAddScalar", "factory", "_ref", "typed", "addNumber", "x", "y", "self", "res", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSubtractScalar", "factory", "_ref", "typed", "subtractNumber", "x", "y", "self", "res", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCbrt", "factory", "_ref", "config", "typed", "isNegative", "unaryMinus", "matrix", "Complex", "BigNumber", "Fraction", "cbrtNumber", "_cbrtComplex", "x", "_cbrtUnit", "allRoots", "arg3", "abs", "principal", "all", "isComplex", "result", "negate", "third", "isBigNumber", "isFraction", "_result", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo11xS0s", "factory", "_ref", "typed", "equalScalar", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "j", "k0", "k1", "k", "i", "v", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo12xSfs", "factory", "_ref", "typed", "DenseMatrix", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "cf", "cdata", "x", "w", "j", "mark", "k0", "k1", "k", "r", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo14xDs", "factory", "_ref", "typed", "a", "b", "callback", "inverse", "adata", "asize", "adt", "dt", "cf", "cdata", "_iterate", "clone", "f", "level", "s", "n", "av", "bv", "cv", "i", "j", "name", "dependencies", "createCeilNumber", "factory", "_ref", "typed", "config", "round", "x", "nearlyEqual", "n", "number", "exponent", "result", "createCeil", "_ref2", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "ceilNumber", "decimal_default", "self", "deepMap", "i", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCube", "factory", "_ref", "typed", "cubeNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createExp", "factory", "_ref", "typed", "expNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createExpm1", "factory", "_ref", "typed", "_Complex", "expm1Number", "x", "r", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFixNumber", "factory", "_ref", "typed", "ceil", "floor", "x", "n", "createFix", "_ref2", "_Complex", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "fixNumber", "bn", "self", "deepMap", "i", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFloorNumber", "factory", "_ref", "typed", "config", "round", "x", "nearlyEqual", "n", "number", "exponent", "result", "createFloor", "_ref2", "matrix", "equalScalar", "zeros", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "floorNumber", "decimal_default", "self", "deepMap", "i", "y", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo02xDS0", "factory", "_ref", "typed", "equalScalar", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "j", "k0", "k1", "k", "i", "cij", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo03xDSf", "factory", "_ref", "typed", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "zero", "cf", "cdata", "z", "x", "w", "j", "mark", "k0", "k1", "k", "i", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo05xSfSf", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "xa", "xb", "wa", "wb", "i", "j", "k", "k1", "mark", "wai", "wbi", "va", "vb", "vc", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo13xDD", "factory", "_ref", "typed", "a", "b", "callback", "adata", "asize", "adt", "bdata", "bsize", "bdt", "csize", "DimensionError", "s", "dt", "cf", "cdata", "_iterate", "f", "level", "n", "av", "bv", "cv", "i", "j", "init_dirname", "init_buffer", "init_process", "name", "dependancies", "createBroadcast", "factory", "_ref", "concat", "A", "B", "N", "dim", "i", "sizeA", "_padLeft", "sizeB", "sizeMax", "checkBroadcastingRules", "AA", "BB", "_dim", "_stretch", "shape", "filler", "arrayToStretch", "sizeToStretch", "dimToStretch", "name", "dependencies", "createMatrixAlgorithmSuite", "factory", "_ref", "typed", "matrix", "concat", "matAlgo13xDD", "createMatAlgo13xDD", "matAlgo14xDs", "createMatAlgo14xDs", "broadcast", "createBroadcast", "options", "elop", "SD", "matrixSignatures", "x", "y", "self", "scalar", "Ds", "sS", "extend", "name", "dependencies", "createMod", "factory", "_ref", "typed", "config", "round", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "floor", "createFloor", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "_modNumber", "x", "y", "m", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo01xDSid", "factory", "_ref", "typed", "denseMatrix", "sparseMatrix", "callback", "inverse", "adata", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "cf", "i", "j", "cdata", "x", "w", "mark", "k0", "k1", "k", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo04xSidSid", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "xa", "xb", "wa", "wb", "i", "j", "k", "k0", "k1", "mark", "v", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo10xSids", "factory", "_ref", "typed", "DenseMatrix", "s", "b", "callback", "inverse", "avalues", "aindex", "aptr", "asize", "adt", "rows", "columns", "dt", "cf", "cdata", "x", "w", "j", "mark", "k0", "k1", "k", "r", "i", "init_dirname", "init_buffer", "init_process", "ArgumentsError", "fn", "count", "min", "max", "name", "dependencies", "gcdTypes", "gcdManyTypesSignature", "is1d", "array", "element", "createGcd", "factory", "_ref", "typed", "matrix", "config", "round", "equalScalar", "zeros", "BigNumber", "DenseMatrix", "concat", "mod", "createMod", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "_gcdNumber", "_gcdBigNumber", "x", "y", "self", "a", "b", "args", "res", "i", "ArgumentsError", "isInteger", "r", "zero", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo06xS0S0", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "asize", "adt", "bvalues", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "u", "j", "mark", "scatter", "k", "i", "v", "p", "r", "name", "dependencies", "createLcm", "factory", "_ref", "typed", "matrix", "equalScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "lcmTypes", "lcmManySignature", "self", "a", "args", "res", "i", "lcmNumber", "_lcmBigNumber", "x", "b", "prod", "t", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLog10", "factory", "_ref", "typed", "config", "_Complex", "x", "log10Number", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLog2", "factory", "_ref", "typed", "config", "Complex", "x", "log2Number", "_log2Complex", "self", "deepMap", "newX", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMultiplyScalar", "factory", "_ref", "typed", "multiplyNumber", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMultiply", "factory", "_ref", "typed", "matrix", "addScalar", "multiplyScalar", "equalScalar", "dot", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "_validateMatrixDimensions", "size1", "size2", "_multiplyVectorVector", "a", "b", "n", "_multiplyVectorMatrix", "_multiplyVectorDenseMatrix", "adata", "asize", "adt", "bdata", "bsize", "bdt", "alength", "bcolumns", "dt", "af", "mf", "c", "j", "sum", "i", "_multiplyMatrixVector", "_multiplyDenseMatrixVector", "_multiplySparseMatrixVector", "_multiplyMatrixMatrix", "_multiplyDenseMatrixDenseMatrix", "_multiplyDenseMatrixSparseMatrix", "_multiplySparseMatrixDenseMatrix", "_multiplySparseMatrixSparseMatrix", "arows", "acolumns", "row", "x", "bvalues", "bindex", "bptr", "eq", "zero", "cvalues", "cindex", "cptr", "jb", "kb0", "kb1", "last", "mark", "cij", "kb", "ib", "avalues", "aindex", "aptr", "brows", "w", "vbi", "ka0", "ka1", "ka", "ia", "p1", "p", "ic", "vbij", "p0", "values", "selfMM", "y", "arraySize", "m", "isMatrix", "xsize", "ysize", "self", "rest", "result", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createNthRoot", "factory", "_ref", "typed", "matrix", "equalScalar", "_BigNumber", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "complexErr", "nthRootNumber", "x", "_bigNthRoot", "selfDn", "selfSn", "self", "y", "selfDS", "a", "root", "precision", "Big", "zero", "one", "inv", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSign", "factory", "_ref", "typed", "_BigNumber", "complex", "_Fraction", "signNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSqrt", "factory", "_ref", "config", "typed", "Complex", "_sqrtNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSquare", "factory", "_ref", "typed", "squareNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSubtract", "factory", "_ref", "typed", "matrix", "equalScalar", "subtractScalar", "unaryMinus", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createXgcd", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "a", "b", "res", "xgcdNumber", "_xgcdBigNumber", "t", "q", "r", "zero", "one", "x", "lastx", "y", "lasty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createInvmod", "factory", "_ref", "typed", "config", "BigNumber", "xgcd", "equal", "smaller", "mod", "add", "isInteger", "invmod", "a", "b", "res", "gcd", "inv", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo09xS0Sf", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "i", "j", "k", "k0", "k1", "mark", "vb", "vc", "name", "dependencies", "createDotMultiply", "factory", "_ref", "typed", "matrix", "equalScalar", "multiplyScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo09xS0Sf", "createMatAlgo09xS0Sf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "bitAndBigNumber", "x", "y", "BigNumber", "bitwise", "a", "b", "bitNotBigNumber", "prevPrec", "result", "bitOrBigNumber", "negOne", "func", "xBits", "yBits", "xSign", "ySign", "decCoefficientToBinaryString", "i", "_i", "minBits", "maxBits", "minSign", "shortLen", "longLen", "expFuncVal", "outVal", "twoPower", "two", "s", "z", "j", "xe", "str", "strL", "arr", "_i2", "arrL", "_j", "bitXor", "leftShiftBigNumber", "rightArithShiftBigNumber", "name", "dependencies", "createBitAnd", "factory", "_ref", "typed", "matrix", "equalScalar", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitAndNumber", "bitAndBigNumber", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBitNot", "factory", "_ref", "typed", "bitNotNumber", "bitNotBigNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBitOr", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitOrNumber", "bitOrBigNumber", "x", "y", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo07xSSf", "factory", "_ref", "typed", "DenseMatrix", "a", "b", "callback", "asize", "adt", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "zero", "cf", "i", "j", "cdata", "xa", "xb", "wa", "wb", "mark", "_scatter", "va", "vb", "m", "w", "x", "values", "index", "ptr", "k", "k1", "name", "dependencies", "createBitXor", "factory", "_ref", "typed", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "bitXorNumber", "bitXor", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createArg", "factory", "_ref", "typed", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createConj", "factory", "_ref", "typed", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIm", "factory", "_ref", "typed", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRe", "factory", "_ref", "typed", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createNot", "factory", "_ref", "typed", "notNumber", "x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createOr", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "orNumber", "x", "y", "self", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createXor", "factory", "_ref", "typed", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "xorNumber", "x", "y", "self", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createConcat", "factory", "_ref", "typed", "matrix", "isInteger", "args", "i", "len", "dim", "prevDim", "asMatrix", "matrices", "arg", "isMatrix", "isNumber", "isBigNumber", "IndexError", "m", "clone", "size", "arraySize", "DimensionError", "res", "concat", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createColumn", "factory", "_ref", "typed", "Index", "matrix", "range", "_column", "value", "column", "clone", "validateIndex", "rowRange", "index", "result", "isMatrix", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCount", "factory", "_ref", "typed", "size", "prod", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCross", "factory", "_ref", "typed", "matrix", "subtract", "multiply", "x", "y", "_cross", "highestDimension", "arraySize", "squeeze", "xSize", "ySize", "product", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDiag", "factory", "_ref", "typed", "matrix", "DenseMatrix", "SparseMatrix", "x", "_diag", "arraySize", "k", "format", "size", "isInteger", "kSuper", "kSub", "_createDiagonalMatrix", "_getDiagonal", "l", "ms", "m", "s", "isMatrix", "dm", "n", "vector", "i", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "import_typed_function", "applyCallback", "callback", "value", "index", "array", "mappingFnName", "typed", "args3", "signature3", "tryWithArgs", "args2", "signature2", "args1", "signature1", "signature", "args", "err", "_err$data", "argsDesc", "typeOf", "name", "dependencies", "createFilter", "factory", "_ref", "typed", "_filterCallback", "x", "test", "filterRegExp", "callback", "filter", "value", "index", "array", "applyCallback", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFlatten", "factory", "_ref", "typed", "matrix", "x", "flatten", "flat", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createForEach", "factory", "_ref", "typed", "_forEach", "x", "callback", "array", "recurse", "value", "index", "forEach", "child", "i", "applyCallback", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createGetMatrixDataType", "factory", "_ref", "typed", "x", "getArrayDataType", "typeOf", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIdentity", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "DenseMatrix", "SparseMatrix", "format", "rows", "_identity", "cols", "size", "_identityVector", "Big", "isBigNumber", "isInteger", "one", "defaultValue", "res", "resize", "minimum", "d", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createKron", "factory", "_ref", "typed", "matrix", "multiplyScalar", "x", "y", "_kron", "a", "b", "arraySize", "t", "r", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMap", "factory", "_ref", "typed", "_map", "x", "callback", "array", "recurse", "value", "index", "child", "i", "applyCallback", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDiff", "factory", "_ref", "typed", "matrix", "subtract", "number", "arr", "isMatrix", "_diff", "dim", "isInteger", "_recursive", "selfAn", "selfMn", "result", "element", "size", "i", "_ElementDiff", "obj1", "obj2", "obj1IsArray", "obj2IsArray", "_ArrayDiff", "arr1", "arr2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createOnes", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "_ones", "size", "last", "format", "hasBigNumbers", "_normalize", "defaultValue", "_validate", "m", "arr", "resize", "value", "index", "isBigNumber", "isInteger", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "noBignumber", "noFraction", "noMatrix", "name", "dependencies", "createRange", "factory", "_ref", "typed", "config", "matrix", "bignumber", "smaller", "smallerEq", "larger", "largerEq", "add", "isPositive", "_strRange", "start", "end", "_out", "_range", "step", "includeEnd", "BigNumber", "arr", "noMatrix", "str", "r", "_parse", "noBignumber", "array", "ongoing", "x", "args", "nums", "arg", "invalid", "num", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createReshape", "factory", "_ref", "typed", "isInteger", "x", "sizes", "size", "reshape", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createResize", "factory", "_ref", "config", "matrix", "x", "size", "defaultValue", "ArgumentsError", "isMatrix", "isBigNumber", "value", "_resizeString", "asMatrix", "clone", "res", "resize", "str", "defaultChar", "DimensionError", "len", "isInteger", "format", "i", "ii", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRotate", "factory", "_ref", "typed", "multiply", "rotationMatrix", "w", "theta", "_validateSize", "matrixRes", "v", "expectedSize", "actualSize", "arraySize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRotationMatrix", "factory", "_ref", "typed", "config", "multiplyScalar", "addScalar", "unaryMinus", "norm", "BigNumber", "matrix", "DenseMatrix", "SparseMatrix", "cos", "sin", "format", "theta", "_rotationMatrix2x2", "v", "matrixV", "_validateVector", "_rotationMatrix3x3", "storageType", "Big", "isBigNumber", "minusOne", "cosTheta", "sinTheta", "data", "_convertToFormat", "size", "_mul", "array", "p", "curr", "normV", "one", "vx", "vy", "vz", "c", "oneMinusC", "s", "r11", "r12", "r13", "r21", "r22", "r23", "r31", "r32", "r33", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRow", "factory", "_ref", "typed", "Index", "matrix", "range", "_row", "value", "row", "clone", "validateIndex", "columnRange", "index", "result", "isMatrix", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSize", "factory", "_ref", "typed", "config", "matrix", "x", "arraySize", "noMatrix", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSqueeze", "factory", "_ref", "typed", "matrix", "x", "squeeze", "clone", "res", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSubset", "factory", "_ref", "typed", "matrix", "zeros", "add", "value", "index", "isEmptyIndex", "validateIndexSourceSize", "subsetRef", "subsetResult", "_getObjectProperty", "_getSubstring", "replacement", "defaultValue", "_broadcastReplacement", "_setSubstring", "_setObjectProperty", "indexSize", "d", "str", "isIndex", "DimensionError", "strLen", "validateIndex", "range", "substr", "v", "len", "chars", "i", "_i", "_len", "object", "key", "getSafeProperty", "updated", "clone", "setSafeProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTranspose", "factory", "_ref", "typed", "matrix", "x", "transposeMatrix", "clone", "size", "c", "rows", "columns", "format", "_denseTranspose", "_sparseTranspose", "m", "data", "transposed", "transposedRow", "j", "i", "values", "index", "ptr", "cvalues", "cindex", "cptr", "p", "l", "sum", "k0", "k1", "k", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCtranspose", "factory", "_ref", "typed", "transpose", "conj", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createZeros", "factory", "_ref", "typed", "config", "matrix", "BigNumber", "_zeros", "size", "last", "format", "hasBigNumbers", "_normalize", "defaultValue", "_validate", "m", "arr", "resize", "value", "index", "isBigNumber", "isInteger", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFft", "factory", "_ref", "typed", "matrix", "addScalar", "multiplyScalar", "divideScalar", "exp", "tau", "I", "dotDivide", "conj", "pow", "ceil", "log2", "_ndFft", "arr", "size", "arraySize", "_fft", "_1dFft", "slice", "dim", "_", "i", "_transpose", "j", "_czt", "n", "w", "chirp", "N2", "xp", "ichirp", "fftXp", "fftIchirp", "fftProduct", "ifftProduct", "ret", "_i", "len", "k", "p", "q", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIfft", "factory", "_ref", "typed", "fft", "dotDivide", "conj", "arr", "size", "isMatrix", "arraySize", "acc", "curr", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "_typeof", "o", "init_dirname", "init_buffer", "init_process", "toPrimitive", "t", "r", "_typeof", "e", "i", "toPropertyKey", "t", "i", "toPrimitive", "_typeof", "_defineProperty", "r", "t", "toPropertyKey", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createSolveODE", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "max", "map", "abs", "isPositive", "isNegative", "larger", "smaller", "matrix", "bignumber", "unaryMinus", "_rk", "butcherTableau", "f", "tspan", "y0", "options", "wrongTSpan", "isNumOrBig", "isUnit", "t0", "tf", "isForwards", "firstStep", "maxStep", "minStep", "timeVars", "x", "steps", "tol", "minDelta", "maxDelta", "maxIter", "hasBigNumbers", "isBigNumber", "a", "c", "b", "bp", "h", "y", "deltaB", "n", "iter", "ongoing", "_createOngoing", "trimStep", "_createTrimStep", "k", "i", "TE", "X", "delta", "_rk23", "_rk45", "_solveODE", "opt", "method", "methods", "methodOptions", "methodsWithQuotes", "availableMethodsString", "outOfBounds", "next", "isNumber", "_matrixSolveODE", "T", "sol", "Y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createErf", "factory", "_ref", "typed", "x", "y", "MAX_NUM", "sign", "THRESH", "erf1", "erfc2", "erfc3", "self", "n", "deepMap", "ysq", "xnum", "P", "xden", "i", "Q", "result", "del", "SQRPI", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createZeta", "factory", "_ref", "typed", "config", "multiply", "pow", "divide", "factorial", "equal", "smallerEq", "isNegative", "gamma", "sin", "subtract", "add", "Complex", "_BigNumber", "pi", "s", "zetaNumeric", "value", "zetaComplex", "createValue", "determineDigits", "zeta", "getRe", "n", "f", "c", "d", "k", "S", "j", "factor", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMode", "factory", "_ref", "typed", "isNaN", "isNumeric", "_mode", "args", "values", "flatten", "num", "count", "mode", "max", "i", "value", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "improveErrorMessage", "err", "fnName", "value", "details", "typeOf", "name", "dependencies", "createProd", "factory", "_ref", "typed", "config", "multiplyScalar", "numeric", "_prod", "array", "dim", "args", "prod", "deepForEach", "value", "err", "improveErrorMessage", "safeNumberType", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFormat", "factory", "_ref", "typed", "format", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBin", "factory", "_ref", "typed", "format", "n", "wordSize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createOct", "factory", "_ref", "typed", "format", "n", "wordSize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createHex", "factory", "_ref", "typed", "format", "n", "wordSize", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "printTemplate", "name", "dependencies", "createPrint", "factory", "_ref", "typed", "_print", "template", "values", "options", "printTemplate", "original", "key", "keys", "value", "k", "isString", "format", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTo", "factory", "_ref", "typed", "matrix", "concat", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "x", "unit", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIsPrime", "factory", "_ref", "typed", "x", "i", "modPow", "base", "exponent", "modulus", "accumulator", "Decimal", "r", "d", "bases", "max", "_i", "_i2", "a", "adn", "_i3", "_x", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createNumeric", "factory", "_ref", "_number", "bignumber", "fraction", "validInputTypes", "validOutputTypes", "x", "noBignumber", "noFraction", "value", "outputType", "check", "inputType", "typeOf", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDivideScalar", "factory", "_ref", "typed", "numeric", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPow", "factory", "_ref", "typed", "config", "identity", "multiply", "matrix", "inv", "number", "fraction", "Complex", "_pow", "x", "y", "result", "_powArray", "_powMatrix", "isInteger", "yFrac", "yNum", "powNumber", "s", "arraySize", "error", "res", "px", "init_dirname", "init_buffer", "init_process", "NO_INT", "name", "dependencies", "createRound", "factory", "_ref", "typed", "config", "matrix", "equalScalar", "zeros", "_BigNumber", "DenseMatrix", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matAlgo14xDs", "createMatAlgo14xDs", "toExponent", "epsilon", "splitNumber", "x", "xEpsilon", "roundNumber", "xSelected", "nearlyEqual", "n", "epsilonExponent", "_n", "self", "unit", "valueless", "deepMap", "value", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLog", "factory", "_ref", "typed", "config", "divideScalar", "Complex", "x", "logNumber", "self", "base", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLog1p", "factory", "_ref", "typed", "config", "divideScalar", "log", "Complex", "x", "log1p", "_log1pComplex", "y", "self", "deepMap", "base", "xRe1p", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createNthRoots", "factory", "_ref", "typed", "config", "divideScalar", "Complex", "_calculateExactResult", "val", "_nthComplexRoots", "a", "root", "aIsNumeric", "offset", "arg", "abs", "roots", "r", "k", "halfPiFactor", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDotPow", "factory", "_ref", "typed", "equalScalar", "matrix", "pow", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "powScalarSignatures", "signature", "powScalar", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDotDivide", "factory", "_ref", "typed", "matrix", "equalScalar", "divideScalar", "DenseMatrix", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "createSolveValidation", "_ref", "DenseMatrix", "m", "b", "copy", "mSize", "format", "rows", "columns", "data", "isMatrix", "bSize", "bdata", "i", "isDenseMatrix", "_i", "isSparseMatrix", "_i2", "values", "index", "ptr", "k1", "k", "_i3", "isArray", "bsize", "arraySize", "_i4", "_i5", "name", "dependencies", "createLsolve", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseForwardSubstitution", "_denseForwardSubstitution", "a", "r", "bdata", "rows", "columns", "x", "mdata", "j", "bj", "xj", "vjj", "i", "values", "index", "ptr", "jValues", "jIndices", "firstIndex", "lastIndex", "k", "_k", "l", "_i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUsolve", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseBackwardSubstitution", "_denseBackwardSubstitution", "a", "r", "bdata", "rows", "columns", "x", "mdata", "j", "bj", "xj", "vjj", "i", "values", "index", "ptr", "jValues", "jIndices", "firstIndex", "lastIndex", "k", "_k", "_lastIndex", "_i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLsolveAll", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseForwardSubstitution", "_denseForwardSubstitution", "a", "R", "r", "b_", "B", "e", "M", "rows", "columns", "i", "L", "k", "bNew", "_j", "j", "x", "values", "index", "ptr", "iValues", "iIndices", "firstIndex", "lastIndex", "Mii", "J", "_j3", "_lastIndex2", "_J2", "_j2", "_lastIndex", "_J", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUsolveAll", "factory", "_ref", "typed", "matrix", "divideScalar", "multiplyScalar", "subtractScalar", "equalScalar", "DenseMatrix", "solveValidation", "createSolveValidation", "m", "b", "_sparseBackwardSubstitution", "_denseBackwardSubstitution", "a", "R", "r", "b_", "B", "e", "M", "rows", "columns", "i", "L", "k", "bNew", "_j", "j", "x", "values", "index", "ptr", "iValues", "iIndices", "firstIndex", "lastIndex", "Mii", "J", "_j3", "_lastIndex2", "_J2", "_j2", "_lastIndex", "_J", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMatAlgo08xS0Sid", "factory", "_ref", "typed", "equalScalar", "a", "b", "callback", "avalues", "aindex", "aptr", "asize", "adt", "bvalues", "bindex", "bptr", "bsize", "bdt", "DimensionError", "rows", "columns", "dt", "eq", "zero", "cf", "cvalues", "cindex", "cptr", "x", "w", "k", "k0", "k1", "i", "j", "mark", "v", "init_dirname", "init_buffer", "init_process", "createUseMatrixForArrayScalar", "factory", "_ref", "typed", "matrix", "selfDn", "x", "y", "selfDB", "selfnD", "selfBD", "name", "dependencies", "createLeftShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "leftShiftNumber", "leftShiftBigNumber", "x", "y", "self", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRightArithShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "rightArithShiftNumber", "rightArithShiftBigNumber", "x", "y", "self", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRightLogShift", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "DenseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo08xS0Sid", "createMatAlgo08xS0Sid", "matAlgo10xSids", "createMatAlgo10xSids", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "useMatrixForArrayScalar", "createUseMatrixForArrayScalar", "rightLogShiftNumber", "self", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAnd", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo06xS0S0", "createMatAlgo06xS0S0", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "andNumber", "x", "y", "self", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCompare", "factory", "_ref", "typed", "config", "equalScalar", "matrix", "BigNumber", "Fraction", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo05xSfSf", "createMatAlgo05xSfSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createCompareNumber", "x", "y", "nearlyEqual", "_ref2", "init_dirname", "init_buffer", "init_process", "import_javascript_natural_sort", "name", "dependencies", "createCompareNatural", "factory", "_ref", "typed", "compare", "compareBooleans", "_compareNatural", "x", "y", "typeX", "typeOf", "typeY", "c", "naturalSort", "matTypes", "compareMatricesAndArrays", "compareComplexNumbers", "compareArrays", "compareObjects", "compareNatural", "isSparseMatrix", "isDenseMatrix", "i", "ii", "v", "keysX", "keysY", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "compareText", "createCompareText", "factory", "_ref", "typed", "matrix", "concat", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createEqual", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "createEqualNumber", "_ref2", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createEqualText", "factory", "_ref", "typed", "compareText", "isZero", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSmaller", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createSmallerNumber", "x", "y", "nearlyEqual", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSmallerEq", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createSmallerEqNumber", "x", "y", "nearlyEqual", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLarger", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createLargerNumber", "x", "y", "nearlyEqual", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLargerEq", "factory", "_ref", "typed", "config", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "compareUnits", "createCompareUnits", "createLargerEqNumber", "x", "y", "nearlyEqual", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDeepEqual", "factory", "_ref", "typed", "equal", "x", "y", "_deepEqual", "len", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUnequal", "factory", "_ref", "typed", "config", "equalScalar", "matrix", "DenseMatrix", "concat", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo07xSSf", "createMatAlgo07xSSf", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "createUnequalNumber", "_unequal", "x", "_ref2", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPartitionSelect", "factory", "_ref", "typed", "isNumeric", "isNaN", "compare", "asc", "desc", "a", "b", "x", "k", "_partitionSelect", "isInteger", "isMatrix", "size", "quickSelect", "arr", "i", "from", "to", "r", "w", "pivot", "tmp", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSort", "factory", "_ref", "typed", "matrix", "compare", "compareNatural", "compareAsc", "compareDesc", "a", "b", "x", "_arrayIsVector", "_matrixIsVector", "_comparator", "order", "array", "arraySize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMax", "factory", "_ref", "typed", "config", "numeric", "larger", "_max", "array", "dim", "reduce", "_largest", "args", "containsCollections", "x", "y", "err", "improveErrorMessage", "res", "deepForEach", "value", "safeNumberType", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMin", "factory", "_ref", "typed", "config", "numeric", "smaller", "_min", "array", "dim", "reduce", "_smallest", "args", "containsCollections", "x", "y", "err", "improveErrorMessage", "min", "deepForEach", "value", "safeNumberType", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createImmutableDenseMatrixClass", "factory", "_ref", "smaller", "DenseMatrix", "ImmutableDenseMatrix", "data", "datatype", "isString", "isMatrix", "isArray", "matrix", "typeOf", "index", "m", "clone", "json", "v", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIndexClass", "factory", "_ref", "ImmutableDenseMatrix", "getMatrixDataType", "Index", "ranges", "i", "ii", "arg", "argIsArray", "isArray", "argIsMatrix", "isMatrix", "sourceSize", "isRange", "m", "_createImmutableMatrix", "_booleansArrayToNumbersForIndex", "size", "isInteger", "index", "clone", "d", "values", "range", "callback", "dim", "array", "dimension", "strings", "json", "booleanArrayIndex", "indexOfNumbers", "bool", "idx", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFibonacciHeapClass", "factory", "_ref", "smaller", "larger", "oneOverLogPhi", "FibonacciHeap", "key", "value", "node", "minimum", "numberOfChildren", "x", "tempRight", "_findMinimumNode", "_decreaseKey", "parent", "_cut", "_cascadingCut", "_linkNodes", "size", "arraySize", "array", "numRoots", "y", "d", "next", "temp", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSpaClass", "factory", "_ref", "addScalar", "equalScalar", "FibonacciHeap", "Spa", "i", "v", "node", "from", "to", "callback", "heap", "values", "nodes", "n", "j", "nodei", "nodej", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "createBigNumberE", "memoize", "BigNumber", "hasher", "createBigNumberPhi", "createBigNumberPi", "createBigNumberTau", "args", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createUnitClass", "factory", "_ref", "on", "config", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "pow", "abs", "fix", "round", "equal", "isNumeric", "format", "_number", "Complex", "_BigNumber", "_Fraction", "toNumber", "Unit", "value", "valuelessUnit", "isComplex", "BASE_DIMENSIONS", "x", "u", "isUnit", "_extends", "text", "index", "c", "skipWhitespace", "next", "isDigitDot", "isDigit", "revert", "oldIndex", "parseNumber", "number", "tentativeNumber", "tentativeIndex", "parseUnit", "unitName", "firstC", "parseCharacter", "toFind", "str", "options", "unit", "powerMultiplierCurrent", "expectingUnit", "valueStr", "powerMultiplierStack", "powerMultiplierStackProduct", "uStr", "oldC", "res", "_findUnit", "power", "p", "i", "baseDim", "UNIT_SYSTEMS", "clone", "hasOwnProperty", "typeOf", "convert", "unitValue", "unitPrefixValue", "unitPower", "prefixValue", "memoize", "UNITS", "prefix", "_name", "endsWith", "_unit", "prefixLen", "prefixName", "_prefix", "args", "base", "BASE_UNITS", "other", "_other", "_i", "inverted", "valThis", "valOther", "getNumericIfUnitless", "numerator", "_i2", "_i3", "ret", "nominalOffset", "unitOffset", "thisUnitValue", "thisNominalOffset", "thisUnitOffset", "otherUnitValue", "otherNominalOffset", "otherUnitOffset", "json", "_json$unit", "proposedUnitList", "matchingBase", "key", "currentUnitSystem", "matchingUnit", "missingBaseDim", "strNum", "strDen", "nNum", "nDen", "_i4", "simp", "isImaginary", "unitStr", "absValue", "absUnitValue", "bestPrefix", "bestDiff", "prefixes", "diff", "parts", "xNumeric", "xRounded", "xFixed", "isNearlyEqual", "y", "testSum", "_i5", "PREFIXES", "BASE_UNIT_NONE", "UNIT_NONE", "ALIASES", "calculateAngleValues", "pi", "createBigNumberPi", "curr", "prev", "_key", "type", "_key2", "_name2", "_unit2", "alias", "_key3", "assertUnitNameIsValid", "obj", "_key4", "lastUnit", "_key5", "defUnit", "aliases", "offset", "definition", "baseName", "ex", "newUnit", "anyMatch", "_i7", "match", "j", "_newBaseUnit", "b", "newBaseUnit", "_i6", "_i8", "aliasName", "_alias", "_key6", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createUnitFunction", "factory", "_ref", "typed", "Unit", "x", "value", "unit", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSparse", "factory", "_ref", "typed", "SparseMatrix", "datatype", "data", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCreateUnit", "factory", "_ref", "typed", "Unit", "obj", "options", "def", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcos", "factory", "_ref", "typed", "config", "Complex", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcosh", "factory", "_ref", "typed", "config", "Complex", "x", "acoshNumber", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcot", "factory", "_ref", "typed", "_BigNumber", "acotNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcoth", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "acothNumber", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcsc", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "acscNumber", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAcsch", "factory", "_ref", "typed", "_BigNumber", "acschNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAsec", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "asecNumber", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAsech", "factory", "_ref", "typed", "config", "Complex", "_BigNumber", "x", "xInv", "asechNumber", "ret", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAsin", "factory", "_ref", "typed", "config", "Complex", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAsinh", "factory", "_ref", "typed", "asinhNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAtan", "factory", "_ref", "typed", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAtan2", "factory", "_ref", "typed", "matrix", "equalScalar", "BigNumber", "DenseMatrix", "concat", "matAlgo02xDS0", "createMatAlgo02xDS0", "matAlgo03xDSf", "createMatAlgo03xDSf", "matAlgo09xS0Sf", "createMatAlgo09xS0Sf", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo12xSfs", "createMatAlgo12xSfs", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAtanh", "factory", "_ref", "typed", "config", "Complex", "x", "atanhNumber", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "createTrigUnit", "factory", "_ref", "typed", "self", "x", "name", "dependencies", "createCos", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCosh", "factory", "_ref", "typed", "cosh", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCot", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "cotNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCoth", "factory", "_ref", "typed", "_BigNumber", "cothNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCsc", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "cscNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCsch", "factory", "_ref", "typed", "_BigNumber", "cschNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSec", "factory", "_ref", "typed", "_BigNumber", "trigUnit", "createTrigUnit", "secNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSech", "factory", "_ref", "typed", "_BigNumber", "sechNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSin", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSinh", "factory", "_ref", "typed", "sinhNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTan", "factory", "_ref", "typed", "trigUnit", "createTrigUnit", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTanh", "factory", "_ref", "typed", "tanh", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetCartesian", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "b1", "flatten", "b2", "i", "j", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetDifference", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "flatten", "b1", "identify", "b2", "inb2", "i", "j", "generalize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetDistinct", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "result", "b", "flatten", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetIntersect", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "DenseMatrix", "a1", "a2", "result", "b1", "identify", "flatten", "b2", "i", "j", "generalize", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetIsSubset", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "a1", "a2", "b1", "identify", "flatten", "b2", "inb2", "i", "j", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetMultiplicity", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "e", "b", "flatten", "count", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetPowerset", "factory", "_ref", "typed", "size", "subset", "compareNatural", "Index", "a", "b", "flatten", "result", "number", "_subset", "_sort", "array", "bitarray", "i", "temp", "j", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetSize", "factory", "_ref", "typed", "compareNatural", "a", "flatten", "unique", "b", "count", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetSymDifference", "factory", "_ref", "typed", "size", "concat", "subset", "setDifference", "Index", "a1", "a2", "flatten", "b1", "b2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSetUnion", "factory", "_ref", "typed", "size", "concat", "subset", "setIntersect", "setSymDifference", "Index", "a1", "a2", "flatten", "b1", "b2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAdd", "factory", "_ref", "typed", "matrix", "addScalar", "equalScalar", "DenseMatrix", "SparseMatrix", "concat", "matAlgo01xDSid", "createMatAlgo01xDSid", "matAlgo04xSidSid", "createMatAlgo04xSidSid", "matAlgo10xSids", "createMatAlgo10xSids", "matrixAlgorithmSuite", "createMatrixAlgorithmSuite", "self", "x", "y", "rest", "result", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createHypot", "factory", "_ref", "typed", "abs", "addScalar", "divideScalar", "multiplyScalar", "sqrt", "smaller", "isPositive", "_hypot", "M", "flatten", "args", "result", "largest", "i", "isComplex", "value", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createNorm", "factory", "_ref", "typed", "abs", "add", "pow", "conj", "sqrt", "multiply", "equalScalar", "larger", "smaller", "matrix", "ctranspose", "eigs", "x", "_norm", "p", "_vectorNormPlusInfinity", "pinf", "value", "v", "_vectorNormMinusInfinity", "ninf", "_vectorNorm", "n", "_matrixNormFrobenius", "fro", "index", "_matrixNormOne", "c", "maxc", "j", "cj", "_matrixNormTwo", "sizeX", "tx", "squaredX", "eigenVals", "rho", "_matrixNormInfinity", "r", "maxr", "i", "ri", "_matrixNorm", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDot", "factory", "_ref", "typed", "addScalar", "multiplyScalar", "conj", "size", "_denseDot", "_sparseDot", "_validateDim", "x", "y", "xSize", "_size", "ySize", "xLen", "yLen", "a", "b", "N", "adata", "isMatrix", "adt", "bdata", "bdt", "aIsColumn", "bIsColumn", "add", "mul", "dt", "c", "i", "_c", "_i", "_c2", "_i2", "_c3", "_i3", "xindex", "xvalues", "yindex", "yvalues", "j", "I", "J", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createTrace", "factory", "_ref", "typed", "matrix", "add", "x", "_denseTrace", "_sparseTrace", "clone", "m", "size", "data", "format", "rows", "cols", "sum", "i", "values", "index", "ptr", "columns", "j", "k0", "k1", "k", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIndex", "factory", "_ref", "typed", "Index", "args", "ranges", "arg", "isBigNumber", "isArray", "isMatrix", "elem", "res", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "keywords", "name", "dependencies", "createNode", "factory", "_ref", "mathWithTransform", "_validateScope", "scope", "symbol", "keywords", "Node", "expr", "args", "context", "evaluate", "s", "createMap", "math", "argNames", "callback", "node", "isNode", "_traverse", "child", "path", "parent", "_transform", "replacement", "nodes", "other", "deepStrictEqual", "options", "customString", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "errorTransform", "err", "IndexError", "accessFactory", "_ref", "subset", "object", "index", "getSafeProperty", "err", "errorTransform", "name", "dependencies", "createAccessorNode", "factory", "_ref", "subset", "Node", "access", "accessFactory", "needParenthesis", "node", "isAccessorNode", "isArrayNode", "isConstantNode", "isFunctionNode", "isObjectNode", "isParenthesisNode", "isSymbolNode", "AccessorNode", "object", "index", "isNode", "isIndexNode", "math", "argNames", "evalObject", "evalIndex", "prop", "scope", "args", "context", "getSafeProperty", "callback", "options", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createArrayNode", "factory", "_ref", "Node", "ArrayNode", "items", "isNode", "math", "argNames", "evalItems", "map", "item", "asMatrix", "matrix", "scope", "args", "context", "evalItem", "callback", "i", "node", "options", "json", "itemsToTex", "nested", "mixedItems", "isArrayNode", "itemsFormRow", "itemSep", "itemsTex", "_defineProperty", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "assignFactory", "_ref", "subset", "matrix", "object", "index", "value", "result", "item", "setSafeProperty", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "properties", "unwrapParen", "_node", "parenthesis", "node", "isParenthesisNode", "getPrecedence", "implicit", "parent", "identifier", "precedence", "i", "leftArg", "isConstantNode", "rule2Node", "getAssociativity", "index", "property", "hasOwnProperty", "isAssociativeWith", "nodeA", "nodeB", "a", "b", "identifierA", "identifierB", "getOperator", "fn", "group", "name", "dependencies", "createAssignmentNode", "factory", "_ref", "subset", "matrix", "Node", "access", "accessFactory", "assign", "assignFactory", "needParenthesis", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "exprPrecedence", "AssignmentNode", "object", "index", "value", "isSymbolNode", "isAccessorNode", "isIndexNode", "isNode", "math", "argNames", "evalObject", "evalIndex", "evalValue", "prop", "scope", "args", "context", "setSafeProperty", "childObject", "evalParentObject", "parentProp", "parent", "getSafeProperty", "evalParentIndex", "parentIndex", "callback", "options", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBlockNode", "factory", "_ref", "ResultSet", "Node", "BlockNode", "blocks", "block", "node", "visible", "isNode", "math", "argNames", "evalBlocks", "map", "scope", "args", "context", "results", "forEach", "result", "callback", "i", "options", "param", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createConditionalNode", "factory", "_ref", "Node", "testCondition", "condition", "isBigNumber", "isComplex", "isUnit", "typeOf", "ConditionalNode", "trueExpr", "falseExpr", "isNode", "math", "argNames", "evalCondition", "evalTrueExpr", "evalFalseExpr", "scope", "args", "context", "callback", "options", "parenthesis", "precedence", "getPrecedence", "conditionPrecedence", "truePrecedence", "falsePrecedence", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "import_escape_latex", "latexSymbols", "latexOperators", "latexFunctions", "node", "options", "defaultTemplate", "latexUnits", "escapeLatex", "string", "escapeLatexLib", "toSymbol", "name", "isUnit", "hasOwnProperty", "name", "dependencies", "createConstantNode", "factory", "_ref", "Node", "ConstantNode", "value", "math", "argNames", "callback", "options", "format", "typeOf", "json", "type", "escapeLatex", "finite", "index", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFunctionAssignmentNode", "factory", "_ref", "typed", "Node", "needParenthesis", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "exprPrecedence", "FunctionAssignmentNode", "params", "expr", "isNode", "keywords", "paramNames", "param", "_name", "math", "argNames", "childArgNames", "forEach", "evalExpr", "signature", "join", "syntax", "scope", "args", "context", "signatures", "childArgs", "i", "fn", "callback", "options", "types", "index", "json", "escape", "toSymbol", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIndexNode", "factory", "_ref", "Node", "size", "IndexNode", "dimensions", "dotNotation", "isNode", "math", "argNames", "evalDimensions", "map", "dimension", "i", "needsEnd", "node", "childArgNames", "_evalDimension", "scope", "args", "context", "isMatrix", "isArray", "isString", "typeOf", "s", "childArgs", "index", "getSafeProperty", "evalDimension", "callback", "isConstantNode", "options", "json", "escape", "range", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createObjectNode", "factory", "_ref", "Node", "ObjectNode", "properties", "key", "isNode", "math", "argNames", "evalEntries", "hasOwnProperty", "stringifiedKey", "stringify", "parsedKey", "prop", "getSafeProperty", "scope", "args", "context", "obj", "_key", "callback", "options", "entries", "json", "escape", "tex", "_defineProperty", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "createSubScope", "parentScope", "args", "PartitionedMap", "ObjectWrappingMap", "name", "dependencies", "createOperatorNode", "factory", "_ref", "Node", "startsWithConstant", "expr", "parenthesis", "curNode", "isParenthesisNode", "isConstantNode", "isOperatorNode", "calculateNecessaryParentheses", "root", "implicit", "args", "latex", "precedence", "getPrecedence", "associativity", "getAssociativity", "arg", "result", "operandPrecedence", "operandIdentifier", "rootIdentifier", "properties", "lhsParens", "lhsPrecedence", "assocWithLhs", "isAssociativeWith", "rhsParens", "rhsPrecedence", "assocWithRhs", "_rootIdentifier", "lhsIdentifier", "rhsIdentifier", "argPrecedence", "assocWithArg", "argAssociativity", "i", "OperatorNode", "op", "fn", "isPercentage", "isNode", "math", "argNames", "isSafeMethod", "getSafeProperty", "evalArgs", "map", "rawArgs", "scope", "context", "createSubScope", "evalArg0", "_evalArg", "evalArg1", "evalArg", "callback", "options", "parens", "assoc", "operand", "opIsNamed", "lhs", "rhs", "stringifiedArgs", "index", "json", "escape", "latexOperators", "lhsTex", "rhsTex", "texifiedArgs", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createParenthesisNode", "factory", "_ref", "Node", "ParenthesisNode", "content", "isNode", "math", "argNames", "callback", "options", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRangeNode", "factory", "_ref", "Node", "calculateNecessaryParentheses", "node", "parenthesis", "implicit", "precedence", "getPrecedence", "parens", "startPrecedence", "stepPrecedence", "endPrecedence", "RangeNode", "start", "end", "step", "isNode", "endSymbols", "isSymbolNode", "math", "argNames", "range", "evalStart", "evalEnd", "evalStep", "scope", "args", "context", "callback", "options", "str", "json", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRelationalNode", "factory", "_ref", "Node", "operatorMap", "RelationalNode", "conditionals", "params", "math", "argNames", "self", "compiled", "p", "scope", "args", "context", "evalLhs", "evalRhs", "i", "condFn", "getSafeProperty", "callback", "n", "options", "parenthesis", "precedence", "getPrecedence", "paramStrings", "index", "paramPrecedence", "ret", "json", "escape", "latexOperators", "_defineProperty", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSymbolNode", "factory", "_ref", "math", "Unit", "Node", "isValuelessUnit", "SymbolNode", "argNames", "scope", "args", "context", "getSafeProperty", "isUnit", "callback", "options", "escape", "json", "symbol", "toSymbol", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFunctionNode", "factory", "_ref", "_FunctionNode", "math", "Node", "SymbolNode", "strin", "entity", "format", "expandTemplate", "template", "node", "options", "latex", "regex", "inputPos", "match", "property", "isNode", "arg", "index", "FunctionNode", "fn", "args", "argNames", "evalArgs", "isSymbolNode", "_name", "_rawArgs", "scope", "context", "getSafeProperty", "createSubScope", "values", "evalArg", "isRaw", "resolveFn", "value", "rawArgs", "evalArg0", "evalArg1", "isAccessorNode", "isIndexNode", "evalObject", "prop", "_rawArgs2", "object", "getSafeMethod", "fnExpr", "evalFn", "_rawArgs3", "callback", "i", "customString", "hasOwnProperty", "isFunctionAssignmentNode", "escape", "customTex", "latexConverter", "latexFunctions", "customToTex", "defaultTemplate", "_defineProperty", "json", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createParse", "factory", "_ref", "typed", "numeric", "config", "AccessorNode", "ArrayNode", "AssignmentNode", "BlockNode", "ConditionalNode", "ConstantNode", "FunctionAssignmentNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "RangeNode", "RelationalNode", "SymbolNode", "parse", "expression", "parseStart", "expressions", "parseMultiple", "options", "extraNodes", "deepMap", "elem", "TOKENTYPE", "DELIMITERS", "NAMED_DELIMITERS", "CONSTANTS", "NUMERIC_CONSTANTS", "ESCAPE_CHARACTERS", "initialState", "currentString", "state", "length", "currentCharacter", "next", "prevCharacter", "nextCharacter", "getToken", "c1", "c2", "c3", "_c", "createSyntaxError", "hasOwnProperty", "getTokenSkipNewline", "openParams", "closeParams", "c", "cPrev", "cNext", "high", "low", "nestingLevel", "_extends", "node", "parseBlock", "createError", "blocks", "visible", "parseAssignment", "args", "value", "valid", "parseConditional", "isSymbolNode", "isAccessorNode", "isFunctionNode", "arg", "index", "parseLogicalOr", "prev", "condition", "trueExpr", "falseExpr", "parseLogicalXor", "parseLogicalAnd", "parseBitwiseOr", "parseBitwiseXor", "parseBitwiseAnd", "parseRelational", "params", "parseShift", "conditionals", "operators", "cond", "fn", "parseConversion", "parseRange", "parseAddSubtract", "parseMultiplyDivide", "rightNode", "last", "parseImplicitMultiplication", "parseRule2", "isConstantNode", "isOperatorNode", "parseModulusPercentage", "tokenStates", "rule2Node", "parseUnary", "parsePow", "parseLeftHandOperators", "parseCustomNodes", "parseAccessors", "CustomNode", "parseSymbol", "parseString", "types", "isPropertyName", "dotNotation", "str", "parseStringToken", "parseMatrix", "quote", "char", "escapeChar", "unicode", "array", "rows", "cols", "row", "parseRow", "r", "parseObject", "len", "key", "properties", "parseNumber", "numberStr", "numericType", "safeNumberType", "parseParentheses", "parseEnd", "col", "message", "error", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCompile", "factory", "_ref", "typed", "parse", "expr", "deepMap", "entry", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createEvaluate", "factory", "_ref", "typed", "parse", "expr", "scope", "createEmptyMap", "deepMap", "entry", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createParserClass", "factory", "_ref", "evaluate", "Parser", "createEmptyMap", "expr", "toObject", "value", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createParser", "factory", "_ref", "typed", "Parser", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLup", "factory", "_ref", "typed", "matrix", "abs", "addScalar", "divideScalar", "multiplyScalar", "subtractScalar", "larger", "equalScalar", "unaryMinus", "DenseMatrix", "SparseMatrix", "Spa", "m", "_denseLUP", "_sparseLUP", "a", "r", "rows", "columns", "n", "data", "clone", "ldata", "lsize", "udata", "usize", "i", "j", "k", "p", "min", "s", "pi", "pabsv", "vjj", "v", "absv", "vij", "l", "u", "pv", "values", "index", "ptr", "lvalues", "lindex", "lptr", "uvalues", "uindex", "uptr", "pvCo", "pvOc", "swapIndeces", "x", "y", "kx", "ky", "_loop", "spa", "k0", "k1", "vkj", "vik", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createQr", "factory", "_ref", "typed", "matrix", "zeros", "identity", "isZero", "equal", "sign", "sqrt", "conj", "unaryMinus", "addScalar", "divideScalar", "multiplyScalar", "subtractScalar", "complex", "_extends", "m", "_denseQR", "_sparseQR", "a", "r", "_denseQRimpl", "rows", "cols", "Q", "Qdata", "Rdata", "i", "j", "k", "w", "pivot", "sgn", "conjSgn", "alphaSquared", "alpha", "u1", "tau", "s", "ret", "zero", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csPermute", "a", "pinv", "q", "values", "avalues", "aindex", "aptr", "asize", "adt", "m", "n", "cvalues", "cindex", "cptr", "nz", "k", "j", "t0", "t1", "t", "r", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csTdfs", "j", "k", "w", "head", "next", "post", "stack", "top", "p", "i", "csPost", "parent", "n", "k", "j", "post", "w", "head", "next", "stack", "csTdfs", "init_dirname", "init_buffer", "init_process", "csEtree", "a", "ata", "aindex", "aptr", "asize", "m", "n", "parent", "w", "ancestor", "prev", "i", "inext", "k", "p0", "p1", "p", "r", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csFkeep", "a", "callback", "other", "avalues", "aindex", "aptr", "asize", "n", "nz", "j", "p", "init_dirname", "init_buffer", "init_process", "csFlip", "i", "name", "dependencies", "createCsAmd", "factory", "_ref", "add", "multiply", "transpose", "order", "a", "asize", "m", "n", "lemax", "dense", "cm", "_createTargetMatrix", "csFkeep", "_diag", "cindex", "cptr", "cnz", "P", "W", "len", "nv", "next", "head", "elen", "degree", "w", "hhead", "last", "mark", "_initializeQuotientGraph", "nel", "_initializeDegreeLists", "mindeg", "i", "j", "k", "k1", "k2", "e", "pj", "ln", "nvi", "pk", "eln", "p1", "p2", "pn", "h", "d", "elenk", "nvk", "dk", "p", "pk1", "pk2", "csFlip", "_wclear", "wnvi", "dext", "p3", "p4", "nvj", "jlast", "ok", "csTdfs", "at", "tindex", "tptr", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csLeaf", "i", "j", "w", "first", "maxfirst", "prevleaf", "ancestor", "s", "sparent", "jleaf", "q", "jprev", "name", "dependencies", "createCsCounts", "factory", "_ref", "transpose", "a", "parent", "post", "ata", "asize", "m", "n", "i", "j", "k", "J", "p", "p0", "p1", "s", "w", "ancestor", "maxfirst", "prevleaf", "first", "head", "next", "colcount", "at", "tindex", "tptr", "r", "csLeaf", "name", "dependencies", "createCsSqr", "factory", "_ref", "add", "multiply", "transpose", "csAmd", "createCsAmd", "csCounts", "createCsCounts", "order", "a", "qr", "aptr", "asize", "n", "k", "s", "c", "csPermute", "csEtree", "post", "csPost", "_vcount", "aindex", "m", "parent", "pinv", "leftmost", "w", "next", "head", "tail", "nque", "i", "p", "p0", "p1", "pa", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csMarked", "w", "j", "init_dirname", "init_buffer", "init_process", "csMark", "w", "j", "csFlip", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csUnflip", "i", "csFlip", "csDfs", "j", "g", "top", "xi", "pinv", "index", "ptr", "size", "n", "i", "p", "p2", "head", "jnew", "csMarked", "csMark", "csUnflip", "done", "csReach", "g", "b", "k", "xi", "pinv", "gptr", "gsize", "bindex", "bptr", "n", "p", "p0", "p1", "top", "i", "csMarked", "csDfs", "csMark", "name", "dependencies", "createCsSpsolve", "factory", "_ref", "divideScalar", "multiply", "subtract", "g", "b", "k", "xi", "x", "pinv", "lo", "gvalues", "gindex", "gptr", "gsize", "n", "bvalues", "bindex", "bptr", "p", "p0", "p1", "q", "top", "csReach", "px", "j", "J", "i", "name", "dependencies", "createCsLu", "factory", "_ref", "abs", "divideScalar", "multiply", "subtract", "larger", "largerEq", "SparseMatrix", "csSpsolve", "createCsSpsolve", "m", "s", "tol", "size", "n", "q", "lnz", "unz", "lvalues", "lindex", "lptr", "L", "uvalues", "uindex", "uptr", "U", "pinv", "i", "p", "x", "xi", "k", "col", "top", "ipiv", "a", "xabs", "pivot", "name", "dependencies", "createSlu", "factory", "_ref", "typed", "abs", "add", "multiply", "transpose", "divideScalar", "subtract", "larger", "largerEq", "SparseMatrix", "csSqr", "createCsSqr", "csLu", "createCsLu", "a", "order", "threshold", "isInteger", "s", "f", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "csIpvec", "p", "b", "k", "x", "name", "dependencies", "createLusolve", "factory", "_ref", "typed", "matrix", "lup", "slu", "usolve", "lsolve", "DenseMatrix", "solveValidation", "createSolveValidation", "a", "b", "d", "x", "_lusolve", "order", "threshold", "_toMatrix", "isMatrix", "isArray", "l", "u", "p", "q", "csIpvec", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPolynomialRoot", "factory", "_ref", "typed", "isZero", "equalScalar", "add", "subtract", "multiply", "divide", "sqrt", "unaryMinus", "cbrt", "typeOf", "im", "re", "constant", "restCoeffs", "coeffs", "c", "b", "a", "denom", "d1", "d2", "discriminant", "d", "_c", "_b", "_a", "_denom", "D0_1", "D0_2", "D1_1", "D1_2", "Delta0", "Delta1", "discriminant1", "discriminant2", "Ccubed", "allRoots", "rawRoots", "C", "r", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createHelpClass", "factory", "_ref", "evaluate", "Help", "doc", "desc", "configChanged", "originalConfig", "scope", "newConfig", "i", "expr", "res", "e", "isHelp", "format", "obj", "clone", "json", "prop", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createChainClass", "factory", "_ref", "on", "math", "typed", "Chain", "value", "isChain", "format", "json", "createProxy", "fn", "chainify", "createLazyProxy", "resolver", "lazy", "args", "i", "sigObject", "arg0", "arg1", "_loop", "_name", "hasOwnProperty", "excludedNames", "path", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "eDocs", "init_dirname", "init_buffer", "init_process", "falseDocs", "init_dirname", "init_buffer", "init_process", "iDocs", "init_dirname", "init_buffer", "init_process", "InfinityDocs", "init_dirname", "init_buffer", "init_process", "LN10Docs", "init_dirname", "init_buffer", "init_process", "LN2Docs", "init_dirname", "init_buffer", "init_process", "LOG10EDocs", "init_dirname", "init_buffer", "init_process", "LOG2EDocs", "init_dirname", "init_buffer", "init_process", "NaNDocs", "init_dirname", "init_buffer", "init_process", "nullDocs", "init_dirname", "init_buffer", "init_process", "phiDocs", "init_dirname", "init_buffer", "init_process", "piDocs", "init_dirname", "init_buffer", "init_process", "SQRT12Docs", "init_dirname", "init_buffer", "init_process", "SQRT2Docs", "init_dirname", "init_buffer", "init_process", "tauDocs", "init_dirname", "init_buffer", "init_process", "trueDocs", "init_dirname", "init_buffer", "init_process", "versionDocs", "init_dirname", "init_buffer", "init_process", "bignumberDocs", "init_dirname", "init_buffer", "init_process", "bigintDocs", "init_dirname", "init_buffer", "init_process", "booleanDocs", "init_dirname", "init_buffer", "init_process", "complexDocs", "init_dirname", "init_buffer", "init_process", "createUnitDocs", "init_dirname", "init_buffer", "init_process", "fractionDocs", "init_dirname", "init_buffer", "init_process", "indexDocs", "init_dirname", "init_buffer", "init_process", "matrixDocs", "init_dirname", "init_buffer", "init_process", "numberDocs", "init_dirname", "init_buffer", "init_process", "sparseDocs", "init_dirname", "init_buffer", "init_process", "splitUnitDocs", "init_dirname", "init_buffer", "init_process", "stringDocs", "init_dirname", "init_buffer", "init_process", "unitDocs", "init_dirname", "init_buffer", "init_process", "configDocs", "init_dirname", "init_buffer", "init_process", "importDocs", "init_dirname", "init_buffer", "init_process", "typedDocs", "init_dirname", "init_buffer", "init_process", "derivativeDocs", "init_dirname", "init_buffer", "init_process", "leafCountDocs", "init_dirname", "init_buffer", "init_process", "lsolveDocs", "init_dirname", "init_buffer", "init_process", "lsolveAllDocs", "init_dirname", "init_buffer", "init_process", "lupDocs", "init_dirname", "init_buffer", "init_process", "lusolveDocs", "init_dirname", "init_buffer", "init_process", "polynomialRootDocs", "init_dirname", "init_buffer", "init_process", "qrDocs", "init_dirname", "init_buffer", "init_process", "rationalizeDocs", "init_dirname", "init_buffer", "init_process", "resolveDocs", "init_dirname", "init_buffer", "init_process", "simplifyDocs", "init_dirname", "init_buffer", "init_process", "simplifyConstantDocs", "init_dirname", "init_buffer", "init_process", "simplifyCoreDocs", "init_dirname", "init_buffer", "init_process", "sluDocs", "init_dirname", "init_buffer", "init_process", "symbolicEqualDocs", "init_dirname", "init_buffer", "init_process", "usolveDocs", "init_dirname", "init_buffer", "init_process", "usolveAllDocs", "init_dirname", "init_buffer", "init_process", "absDocs", "init_dirname", "init_buffer", "init_process", "addDocs", "init_dirname", "init_buffer", "init_process", "cbrtDocs", "init_dirname", "init_buffer", "init_process", "ceilDocs", "init_dirname", "init_buffer", "init_process", "cubeDocs", "init_dirname", "init_buffer", "init_process", "divideDocs", "init_dirname", "init_buffer", "init_process", "dotDivideDocs", "init_dirname", "init_buffer", "init_process", "dotMultiplyDocs", "init_dirname", "init_buffer", "init_process", "dotPowDocs", "init_dirname", "init_buffer", "init_process", "expDocs", "init_dirname", "init_buffer", "init_process", "expmDocs", "init_dirname", "init_buffer", "init_process", "expm1Docs", "init_dirname", "init_buffer", "init_process", "fixDocs", "init_dirname", "init_buffer", "init_process", "floorDocs", "init_dirname", "init_buffer", "init_process", "gcdDocs", "init_dirname", "init_buffer", "init_process", "hypotDocs", "init_dirname", "init_buffer", "init_process", "invmodDocs", "init_dirname", "init_buffer", "init_process", "lcmDocs", "init_dirname", "init_buffer", "init_process", "logDocs", "init_dirname", "init_buffer", "init_process", "log10Docs", "init_dirname", "init_buffer", "init_process", "log1pDocs", "init_dirname", "init_buffer", "init_process", "log2Docs", "init_dirname", "init_buffer", "init_process", "modDocs", "init_dirname", "init_buffer", "init_process", "multiplyDocs", "init_dirname", "init_buffer", "init_process", "normDocs", "init_dirname", "init_buffer", "init_process", "nthRootDocs", "init_dirname", "init_buffer", "init_process", "nthRootsDocs", "init_dirname", "init_buffer", "init_process", "powDocs", "init_dirname", "init_buffer", "init_process", "roundDocs", "init_dirname", "init_buffer", "init_process", "signDocs", "init_dirname", "init_buffer", "init_process", "sqrtDocs", "init_dirname", "init_buffer", "init_process", "sqrtmDocs", "init_dirname", "init_buffer", "init_process", "sylvesterDocs", "init_dirname", "init_buffer", "init_process", "schurDocs", "init_dirname", "init_buffer", "init_process", "lyapDocs", "init_dirname", "init_buffer", "init_process", "squareDocs", "init_dirname", "init_buffer", "init_process", "subtractDocs", "init_dirname", "init_buffer", "init_process", "unaryMinusDocs", "init_dirname", "init_buffer", "init_process", "unaryPlusDocs", "init_dirname", "init_buffer", "init_process", "xgcdDocs", "init_dirname", "init_buffer", "init_process", "bitAndDocs", "init_dirname", "init_buffer", "init_process", "bitNotDocs", "init_dirname", "init_buffer", "init_process", "bitOrDocs", "init_dirname", "init_buffer", "init_process", "bitXorDocs", "init_dirname", "init_buffer", "init_process", "leftShiftDocs", "init_dirname", "init_buffer", "init_process", "rightArithShiftDocs", "init_dirname", "init_buffer", "init_process", "rightLogShiftDocs", "init_dirname", "init_buffer", "init_process", "bellNumbersDocs", "init_dirname", "init_buffer", "init_process", "catalanDocs", "init_dirname", "init_buffer", "init_process", "compositionDocs", "init_dirname", "init_buffer", "init_process", "stirlingS2Docs", "init_dirname", "init_buffer", "init_process", "argDocs", "init_dirname", "init_buffer", "init_process", "conjDocs", "init_dirname", "init_buffer", "init_process", "imDocs", "init_dirname", "init_buffer", "init_process", "reDocs", "init_dirname", "init_buffer", "init_process", "evaluateDocs", "init_dirname", "init_buffer", "init_process", "helpDocs", "init_dirname", "init_buffer", "init_process", "distanceDocs", "init_dirname", "init_buffer", "init_process", "intersectDocs", "init_dirname", "init_buffer", "init_process", "andDocs", "init_dirname", "init_buffer", "init_process", "notDocs", "init_dirname", "init_buffer", "init_process", "orDocs", "init_dirname", "init_buffer", "init_process", "xorDocs", "init_dirname", "init_buffer", "init_process", "columnDocs", "init_dirname", "init_buffer", "init_process", "concatDocs", "init_dirname", "init_buffer", "init_process", "countDocs", "init_dirname", "init_buffer", "init_process", "crossDocs", "init_dirname", "init_buffer", "init_process", "ctransposeDocs", "init_dirname", "init_buffer", "init_process", "detDocs", "init_dirname", "init_buffer", "init_process", "diagDocs", "init_dirname", "init_buffer", "init_process", "diffDocs", "init_dirname", "init_buffer", "init_process", "dotDocs", "init_dirname", "init_buffer", "init_process", "eigsDocs", "init_dirname", "init_buffer", "init_process", "filterDocs", "init_dirname", "init_buffer", "init_process", "flattenDocs", "init_dirname", "init_buffer", "init_process", "forEachDocs", "init_dirname", "init_buffer", "init_process", "getMatrixDataTypeDocs", "init_dirname", "init_buffer", "init_process", "identityDocs", "init_dirname", "init_buffer", "init_process", "invDocs", "init_dirname", "init_buffer", "init_process", "pinvDocs", "init_dirname", "init_buffer", "init_process", "kronDocs", "init_dirname", "init_buffer", "init_process", "mapDocs", "init_dirname", "init_buffer", "init_process", "matrixFromColumnsDocs", "init_dirname", "init_buffer", "init_process", "matrixFromFunctionDocs", "init_dirname", "init_buffer", "init_process", "matrixFromRowsDocs", "init_dirname", "init_buffer", "init_process", "onesDocs", "init_dirname", "init_buffer", "init_process", "partitionSelectDocs", "init_dirname", "init_buffer", "init_process", "rangeDocs", "init_dirname", "init_buffer", "init_process", "reshapeDocs", "init_dirname", "init_buffer", "init_process", "resizeDocs", "init_dirname", "init_buffer", "init_process", "rotateDocs", "init_dirname", "init_buffer", "init_process", "rotationMatrixDocs", "init_dirname", "init_buffer", "init_process", "rowDocs", "init_dirname", "init_buffer", "init_process", "sizeDocs", "init_dirname", "init_buffer", "init_process", "sortDocs", "init_dirname", "init_buffer", "init_process", "squeezeDocs", "init_dirname", "init_buffer", "init_process", "subsetDocs", "init_dirname", "init_buffer", "init_process", "traceDocs", "init_dirname", "init_buffer", "init_process", "transposeDocs", "init_dirname", "init_buffer", "init_process", "zerosDocs", "init_dirname", "init_buffer", "init_process", "fftDocs", "init_dirname", "init_buffer", "init_process", "ifftDocs", "init_dirname", "init_buffer", "init_process", "combinationsDocs", "init_dirname", "init_buffer", "init_process", "combinationsWithRepDocs", "init_dirname", "init_buffer", "init_process", "factorialDocs", "init_dirname", "init_buffer", "init_process", "gammaDocs", "init_dirname", "init_buffer", "init_process", "lgammaDocs", "init_dirname", "init_buffer", "init_process", "kldivergenceDocs", "init_dirname", "init_buffer", "init_process", "multinomialDocs", "init_dirname", "init_buffer", "init_process", "permutationsDocs", "init_dirname", "init_buffer", "init_process", "pickRandomDocs", "init_dirname", "init_buffer", "init_process", "randomDocs", "init_dirname", "init_buffer", "init_process", "randomIntDocs", "init_dirname", "init_buffer", "init_process", "compareDocs", "init_dirname", "init_buffer", "init_process", "compareNaturalDocs", "init_dirname", "init_buffer", "init_process", "compareTextDocs", "init_dirname", "init_buffer", "init_process", "deepEqualDocs", "init_dirname", "init_buffer", "init_process", "equalDocs", "init_dirname", "init_buffer", "init_process", "equalTextDocs", "init_dirname", "init_buffer", "init_process", "largerDocs", "init_dirname", "init_buffer", "init_process", "largerEqDocs", "init_dirname", "init_buffer", "init_process", "smallerDocs", "init_dirname", "init_buffer", "init_process", "smallerEqDocs", "init_dirname", "init_buffer", "init_process", "unequalDocs", "init_dirname", "init_buffer", "init_process", "setCartesianDocs", "init_dirname", "init_buffer", "init_process", "setDifferenceDocs", "init_dirname", "init_buffer", "init_process", "setDistinctDocs", "init_dirname", "init_buffer", "init_process", "setIntersectDocs", "init_dirname", "init_buffer", "init_process", "setIsSubsetDocs", "init_dirname", "init_buffer", "init_process", "setMultiplicityDocs", "init_dirname", "init_buffer", "init_process", "setPowersetDocs", "init_dirname", "init_buffer", "init_process", "setSizeDocs", "init_dirname", "init_buffer", "init_process", "setSymDifferenceDocs", "init_dirname", "init_buffer", "init_process", "setUnionDocs", "init_dirname", "init_buffer", "init_process", "zpk2tfDocs", "init_dirname", "init_buffer", "init_process", "freqzDocs", "init_dirname", "init_buffer", "init_process", "erfDocs", "init_dirname", "init_buffer", "init_process", "zetaDocs", "init_dirname", "init_buffer", "init_process", "madDocs", "init_dirname", "init_buffer", "init_process", "maxDocs", "init_dirname", "init_buffer", "init_process", "meanDocs", "init_dirname", "init_buffer", "init_process", "medianDocs", "init_dirname", "init_buffer", "init_process", "minDocs", "init_dirname", "init_buffer", "init_process", "modeDocs", "init_dirname", "init_buffer", "init_process", "prodDocs", "init_dirname", "init_buffer", "init_process", "quantileSeqDocs", "init_dirname", "init_buffer", "init_process", "stdDocs", "init_dirname", "init_buffer", "init_process", "cumSumDocs", "init_dirname", "init_buffer", "init_process", "sumDocs", "init_dirname", "init_buffer", "init_process", "varianceDocs", "init_dirname", "init_buffer", "init_process", "corrDocs", "init_dirname", "init_buffer", "init_process", "acosDocs", "init_dirname", "init_buffer", "init_process", "acoshDocs", "init_dirname", "init_buffer", "init_process", "acotDocs", "init_dirname", "init_buffer", "init_process", "acothDocs", "init_dirname", "init_buffer", "init_process", "acscDocs", "init_dirname", "init_buffer", "init_process", "acschDocs", "init_dirname", "init_buffer", "init_process", "asecDocs", "init_dirname", "init_buffer", "init_process", "asechDocs", "init_dirname", "init_buffer", "init_process", "asinDocs", "init_dirname", "init_buffer", "init_process", "asinhDocs", "init_dirname", "init_buffer", "init_process", "atanDocs", "init_dirname", "init_buffer", "init_process", "atan2Docs", "init_dirname", "init_buffer", "init_process", "atanhDocs", "init_dirname", "init_buffer", "init_process", "cosDocs", "init_dirname", "init_buffer", "init_process", "coshDocs", "init_dirname", "init_buffer", "init_process", "cotDocs", "init_dirname", "init_buffer", "init_process", "cothDocs", "init_dirname", "init_buffer", "init_process", "cscDocs", "init_dirname", "init_buffer", "init_process", "cschDocs", "init_dirname", "init_buffer", "init_process", "secDocs", "init_dirname", "init_buffer", "init_process", "sechDocs", "init_dirname", "init_buffer", "init_process", "sinDocs", "init_dirname", "init_buffer", "init_process", "sinhDocs", "init_dirname", "init_buffer", "init_process", "tanDocs", "init_dirname", "init_buffer", "init_process", "tanhDocs", "init_dirname", "init_buffer", "init_process", "toDocs", "init_dirname", "init_buffer", "init_process", "binDocs", "init_dirname", "init_buffer", "init_process", "cloneDocs", "init_dirname", "init_buffer", "init_process", "formatDocs", "init_dirname", "init_buffer", "init_process", "hasNumericValueDocs", "init_dirname", "init_buffer", "init_process", "hexDocs", "init_dirname", "init_buffer", "init_process", "isIntegerDocs", "init_dirname", "init_buffer", "init_process", "isNaNDocs", "init_dirname", "init_buffer", "init_process", "isNegativeDocs", "init_dirname", "init_buffer", "init_process", "isNumericDocs", "init_dirname", "init_buffer", "init_process", "isPositiveDocs", "init_dirname", "init_buffer", "init_process", "isPrimeDocs", "init_dirname", "init_buffer", "init_process", "isZeroDocs", "init_dirname", "init_buffer", "init_process", "numericDocs", "init_dirname", "init_buffer", "init_process", "octDocs", "init_dirname", "init_buffer", "init_process", "printDocs", "init_dirname", "init_buffer", "init_process", "typeOfDocs", "init_dirname", "init_buffer", "init_process", "solveODEDocs", "embeddedDocs", "bignumberDocs", "bigintDocs", "booleanDocs", "complexDocs", "createUnitDocs", "fractionDocs", "indexDocs", "matrixDocs", "numberDocs", "sparseDocs", "splitUnitDocs", "stringDocs", "unitDocs", "eDocs", "falseDocs", "iDocs", "InfinityDocs", "LN2Docs", "LN10Docs", "LOG2EDocs", "LOG10EDocs", "NaNDocs", "nullDocs", "piDocs", "phiDocs", "SQRT12Docs", "SQRT2Docs", "tauDocs", "trueDocs", "versionDocs", "derivativeDocs", "lsolveDocs", "lsolveAllDocs", "lupDocs", "lusolveDocs", "leafCountDocs", "polynomialRootDocs", "resolveDocs", "simplifyDocs", "simplifyConstantDocs", "simplifyCoreDocs", "symbolicEqualDocs", "rationalizeDocs", "sluDocs", "usolveDocs", "usolveAllDocs", "qrDocs", "absDocs", "addDocs", "cbrtDocs", "ceilDocs", "cubeDocs", "divideDocs", "dotDivideDocs", "dotMultiplyDocs", "dotPowDocs", "expDocs", "expmDocs", "expm1Docs", "fixDocs", "floorDocs", "gcdDocs", "hypotDocs", "lcmDocs", "logDocs", "log2Docs", "log1pDocs", "log10Docs", "modDocs", "multiplyDocs", "normDocs", "nthRootDocs", "nthRootsDocs", "powDocs", "roundDocs", "signDocs", "sqrtDocs", "sqrtmDocs", "squareDocs", "subtractDocs", "unaryMinusDocs", "unaryPlusDocs", "xgcdDocs", "invmodDocs", "bitAndDocs", "bitNotDocs", "bitOrDocs", "bitXorDocs", "leftShiftDocs", "rightArithShiftDocs", "rightLogShiftDocs", "bellNumbersDocs", "catalanDocs", "compositionDocs", "stirlingS2Docs", "configDocs", "importDocs", "typedDocs", "argDocs", "conjDocs", "reDocs", "imDocs", "evaluateDocs", "helpDocs", "distanceDocs", "intersectDocs", "andDocs", "notDocs", "orDocs", "xorDocs", "concatDocs", "countDocs", "crossDocs", "columnDocs", "ctransposeDocs", "detDocs", "diagDocs", "diffDocs", "dotDocs", "getMatrixDataTypeDocs", "identityDocs", "filterDocs", "flattenDocs", "forEachDocs", "invDocs", "pinvDocs", "eigsDocs", "kronDocs", "matrixFromFunctionDocs", "matrixFromRowsDocs", "matrixFromColumnsDocs", "mapDocs", "onesDocs", "partitionSelectDocs", "rangeDocs", "resizeDocs", "reshapeDocs", "rotateDocs", "rotationMatrixDocs", "rowDocs", "sizeDocs", "sortDocs", "squeezeDocs", "subsetDocs", "traceDocs", "transposeDocs", "zerosDocs", "fftDocs", "ifftDocs", "sylvesterDocs", "schurDocs", "lyapDocs", "solveODEDocs", "combinationsDocs", "combinationsWithRepDocs", "factorialDocs", "gammaDocs", "kldivergenceDocs", "lgammaDocs", "multinomialDocs", "permutationsDocs", "pickRandomDocs", "randomDocs", "randomIntDocs", "compareDocs", "compareNaturalDocs", "compareTextDocs", "deepEqualDocs", "equalDocs", "equalTextDocs", "largerDocs", "largerEqDocs", "smallerDocs", "smallerEqDocs", "unequalDocs", "setCartesianDocs", "setDifferenceDocs", "setDistinctDocs", "setIntersectDocs", "setIsSubsetDocs", "setMultiplicityDocs", "setPowersetDocs", "setSizeDocs", "setSymDifferenceDocs", "setUnionDocs", "zpk2tfDocs", "freqzDocs", "erfDocs", "zetaDocs", "cumSumDocs", "madDocs", "maxDocs", "meanDocs", "medianDocs", "minDocs", "modeDocs", "prodDocs", "quantileSeqDocs", "stdDocs", "sumDocs", "varianceDocs", "corrDocs", "acosDocs", "acoshDocs", "acotDocs", "acothDocs", "acscDocs", "acschDocs", "asecDocs", "asechDocs", "asinDocs", "asinhDocs", "atanDocs", "atanhDocs", "atan2Docs", "cosDocs", "coshDocs", "cotDocs", "cothDocs", "cscDocs", "cschDocs", "secDocs", "sechDocs", "sinDocs", "sinhDocs", "tanDocs", "tanhDocs", "toDocs", "cloneDocs", "formatDocs", "binDocs", "octDocs", "hexDocs", "isNaNDocs", "isIntegerDocs", "isNegativeDocs", "isNumericDocs", "hasNumericValueDocs", "isPositiveDocs", "isPrimeDocs", "isZeroDocs", "printDocs", "typeOfDocs", "numericDocs", "name", "dependencies", "createHelp", "factory", "_ref", "typed", "mathWithTransform", "Help", "search", "prop", "searchName", "hasOwnProperty", "doc", "getSafeProperty", "embeddedDocs", "searchText", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createChain", "factory", "_ref", "typed", "Chain", "value", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDet", "factory", "_ref", "typed", "matrix", "subtractScalar", "multiply", "divideScalar", "isZero", "unaryMinus", "x", "clone", "size", "isMatrix", "format", "rows", "cols", "_det", "negated", "rowIndices", "_", "i", "k", "k_", "_k", "piv", "piv_", "i_", "j", "det", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createInv", "factory", "_ref", "typed", "matrix", "divideScalar", "addScalar", "multiply", "unaryMinus", "det", "identity", "abs", "x", "size", "isMatrix", "arraySize", "format", "rows", "cols", "_inv", "mat", "r", "s", "f", "value", "temp", "d", "A", "B", "c", "ABig", "rBig", "Ac", "Bc", "Ar", "Br", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPinv", "factory", "_ref", "typed", "matrix", "inv", "deepEqual", "equal", "dotDivide", "dot", "ctranspose", "divideScalar", "multiply", "add", "Complex", "x", "size", "isMatrix", "arraySize", "_isZeros", "rows", "cols", "err", "_pinv", "format", "clone", "mat", "C", "F", "_rankFact", "Cpinv", "Fpinv", "_rref", "M", "lead", "r", "i", "_isZero", "val", "j", "_i", "_j", "rref", "_", "arr", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "createComplexEigs", "_ref", "addScalar", "subtract", "flatten", "multiply", "multiplyScalar", "divideScalar", "sqrt", "abs", "bignumber", "diag", "size", "reshape", "inv", "qr", "usolve", "usolveAll", "equal", "complex", "larger", "smaller", "matrixFromColumns", "dot", "complexEigs", "arr", "N", "prec", "type", "findVectors", "R", "balance", "reduceToHessenberg", "values", "C", "iterateUntilTriangular", "eigenvectors", "findEigenvectors", "big", "cplx", "realzero", "one", "realone", "radix", "radixSq", "Rdiag", "last", "i", "colNorm", "rowNorm", "j", "f", "c", "rowDivRadix", "rowMulRadix", "condition", "g", "_j", "zero", "maxIndex", "max", "el", "tmp1", "_j2", "tmp2", "tmp3", "_j3", "n", "k", "_k", "_k2", "A", "clone", "lambdas", "Sdiag", "Qtotal", "Qpartial", "lastConvergenceBefore", "Q", "_i", "inflateMatrix", "_i2", "ll", "eigenvalues2x2", "jordanBase2x2", "_i3", "a", "b", "err", "blockDiag", "Cinv", "U", "uniqueValues", "multiplicities", "lambda", "indexOf", "vectors", "len", "E", "_loop", "_i4", "S", "solutions", "approxVec", "inverseIterate", "correction", "v", "d", "trA", "detA", "x", "y", "l1", "l2", "na", "nd", "_i5", "M", "I", "sub", "_i6", "fn", "orthog", "largeNum", "randomOrthogonalVector", "norm", "orthogonalComplement", "normalize", "_", "vectorShape", "w", "init_dirname", "init_buffer", "init_process", "createRealSymmetric", "_ref", "config", "addScalar", "subtract", "abs", "atan", "cos", "sin", "multiplyScalar", "inv", "bignumber", "multiply", "add", "main", "arr", "N", "prec", "type", "computeVectors", "diag", "diagBig", "x", "precision", "e0", "psi", "Sij", "i", "Vab", "getAij", "_i", "j", "getTheta", "x1", "Sij1", "Ei", "_i2", "sorting", "clone", "getAijBig", "_i3", "getThetaBig", "x1Big", "Sij1Big", "_i4", "aii", "ajj", "aij", "denom", "theta", "c", "s", "Ski", "Skj", "k", "_k", "_k2", "Hij", "c2", "s2", "Aki", "Akj", "csHij", "Aii", "Ajj", "_k3", "_k4", "Mij", "maxMij", "maxIJ", "E", "S", "values", "vecs", "minID", "minE", "_k5", "eigenvectors", "vector", "name", "dependencies", "createEigs", "factory", "_ref", "config", "typed", "matrix", "addScalar", "subtract", "equal", "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", "doRealSymmetric", "createRealSymmetric", "doComplexEigs", "createComplexEigs", "x", "doEigs", "prec", "opts", "mat", "useOpts", "_extends", "_opts$precision", "computeVectors", "result", "computeValuesAndVectors", "_ref2", "value", "vector", "arr", "asize", "format", "N", "isReal", "coerceReal", "isSymmetric", "_type", "coerceTypes", "type", "i", "j", "hasNumber", "hasBig", "hasComplex", "el", "isNumber", "isFraction", "isBigNumber", "isComplex", "typeOf", "_i", "_j", "_i2", "_j2", "_i3", "_j3", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createExpm", "factory", "_ref", "typed", "abs", "add", "identity", "inv", "multiply", "A", "size", "format", "n", "eps", "infNorm", "infinityNorm", "params", "findParams", "q", "j", "Apos", "N", "D", "factor", "AposToI", "alternate", "i", "R", "_i", "isSparseMatrix", "rowSum", "maxSearchSize", "k", "errorEstimate", "qfac", "twoqfac", "_i2", "twoqp1fac", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSqrtm", "factory", "_ref", "typed", "abs", "add", "multiply", "map", "sqrt", "subtract", "inv", "size", "max", "identity", "_maxIterations", "_tolerance", "_denmanBeavers", "A", "error", "iterations", "Y", "Z", "Yk", "isMatrix", "arraySize", "format", "rows", "cols", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSylvester", "factory", "_ref", "typed", "schur", "matrixFromColumns", "matrix", "multiply", "range", "concat", "transpose", "index", "subset", "add", "subtract", "identity", "lusolve", "abs", "_sylvester", "A", "B", "C", "n", "m", "sA", "F", "U", "sB", "G", "V", "D", "all", "y", "hc", "a", "b", "vc", "k", "RHS", "j", "gkk", "gmk", "gkm", "gmm", "LHS", "yAux", "_RHS", "_j", "_gkk", "_LHS", "Y", "X", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSchur", "factory", "_ref", "typed", "matrix", "identity", "multiply", "qr", "norm", "subtract", "X", "r", "_schur", "n", "A", "U", "k", "A0", "QR", "Q", "R", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLyap", "factory", "_ref", "typed", "matrix", "sylvester", "multiply", "transpose", "A", "Q", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDivide", "factory", "_ref", "typed", "matrix", "multiply", "equalScalar", "divideScalar", "inv", "matAlgo11xS0s", "createMatAlgo11xS0s", "matAlgo14xDs", "createMatAlgo14xDs", "extend", "x", "y", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDistance", "factory", "_ref", "typed", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "deepEqual", "sqrt", "abs", "x", "y", "z", "_2d", "xCoeff", "yCoeff", "constant", "_distancePointLine2D", "_objectToArray", "_3d", "_parametricLine", "_distancePointLine3D", "_containsOnlyNumbers", "_euclideanDistance", "arr", "_pairwise", "_distancePairwise", "_isNumber", "a", "isBigNumber", "o", "keys", "i", "aI", "b", "c", "num", "den", "x0", "y0", "z0", "vectorSize", "result", "diff", "pointA", "pointB", "j", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIntersect", "factory", "_ref", "typed", "config", "abs", "add", "addScalar", "matrix", "multiply", "multiplyScalar", "divideScalar", "subtract", "smaller", "equalScalar", "flatten", "isZero", "isNumeric", "_AAA", "_AAAA", "x", "y", "plane", "arr", "w", "z", "_coerceArr", "_3d", "_4d", "_intersectLinePlane", "_2d", "_intersect2d", "_intersect3d", "el", "p1a", "p1b", "p2a", "p2b", "o1", "o2", "d1", "d2", "det", "d20o11", "d21o10", "d20o21", "d21o20", "t", "_intersect3dHelper", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "add1", "add2", "add3", "x1", "y1", "z1", "x2", "y2", "z2", "x3", "y3", "z3", "x4", "y4", "z4", "d1343", "d4321", "d1321", "d4343", "d2121", "numerator", "denominator", "ta", "tb", "pax", "pay", "paz", "pbx", "pby", "pbz", "x1x", "x2x", "y1y", "y2y", "z1z", "z2z", "px", "py", "pz", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSum", "factory", "_ref", "typed", "config", "add", "numeric", "_sum", "_nsumDim", "args", "containsCollections", "array", "sum", "deepForEach", "value", "err", "improveErrorMessage", "safeNumberType", "dim", "reduce", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCumSum", "factory", "_ref", "typed", "add", "unaryPlus", "_cumsum", "matrix", "_ncumSumDim", "dim", "args", "containsCollections", "array", "_cumsummap", "err", "improveErrorMessage", "sums", "i", "size", "arraySize", "IndexError", "_cumsumDimensional", "mat", "ret", "tran", "initialValue", "_switch", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMean", "factory", "_ref", "typed", "add", "divide", "_mean", "_nmeanDim", "args", "containsCollections", "array", "dim", "sum", "reduce", "arraySize", "err", "improveErrorMessage", "num", "deepForEach", "value", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMedian", "factory", "_ref", "typed", "add", "divide", "compare", "partitionSelect", "_median", "array", "flatten", "num", "mid", "right", "left", "i", "middle2", "m", "middle", "err", "improveErrorMessage", "value", "dim", "args", "containsCollections", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMad", "factory", "_ref", "typed", "abs", "map", "median", "subtract", "_mad", "args", "array", "flatten", "med", "value", "err", "improveErrorMessage", "init_dirname", "init_buffer", "init_process", "DEFAULT_NORMALIZATION", "name", "dependencies", "createVariance", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "apply", "isNaN", "array", "_var", "dim", "_varDim", "args", "normalization", "sum", "num", "deepForEach", "value", "err", "improveErrorMessage", "mean", "diff", "zero", "isBigNumber", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createQuantileSeq", "factory", "_ref", "typed", "bignumber", "add", "subtract", "divide", "multiply", "partitionSelect", "compare", "isInteger", "smaller", "smallerEq", "larger", "apply", "createApply", "data", "p", "_quantileSeqProbNumber", "prob", "dim", "_quantileSeqDim", "sorted", "_quantileSeqProbCollection", "fn", "x", "probOrN", "probArr", "dataArr", "isNumber", "_quantileSeq", "nPlusOne", "i", "probOrNArr", "array", "flat", "flatten", "len", "index", "integerPart", "fracPart", "left", "right", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createStd", "factory", "_ref", "typed", "map", "sqrt", "variance", "_std", "args", "array", "normalization", "v", "isCollection", "err", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCorr", "factory", "_ref", "typed", "matrix", "sqrt", "sum", "add", "subtract", "multiply", "pow", "divide", "A", "B", "_corr", "res", "correlations", "i", "correlation", "n", "sumX", "sumY", "sumXY", "acc", "x", "index", "sumXSquare", "sumYSquare", "y", "numerator", "denominator", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCombinations", "factory", "_ref", "typed", "combinationsNumber", "k", "BigNumber", "result", "i", "nMinusk", "one", "isPositiveInteger", "n", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCombinationsWithRep", "factory", "_ref", "typed", "k", "isInteger", "_prodrange", "product", "prodrange", "BigNumber", "result", "i", "one", "nMinusOne", "isPositiveInteger", "n", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createGamma", "factory", "_ref", "typed", "config", "multiplyScalar", "pow", "_BigNumber", "Complex", "gammaComplex", "n", "gammaNumber", "_t", "r", "x", "gammaP", "i", "gammaPval", "t", "gammaG", "twoPiSqrt", "tpow", "expt", "bigFactorial", "precision", "Big", "p", "prod", "sum", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLgamma", "factory", "_ref", "Complex", "typed", "SMALL_RE", "SMALL_IM", "coeffs", "lgammaNumber", "lgammaComplex", "n", "TWOPI", "LOGPI", "REFLECTION", "lgammaStirling", "tmp", "copysign", "a", "b", "lgammaRecurrence", "z", "leftPart", "lnSqrt2PI", "rz", "rzz", "r", "s", "i", "rightPart", "signflips", "sb", "shiftprod", "nsb", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFactorial", "factory", "_ref", "typed", "gamma", "n", "self", "deepMap", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createKldivergence", "factory", "_ref", "typed", "matrix", "divide", "sum", "multiply", "map", "dotDivide", "log", "isNumeric", "q", "p", "_kldiv", "plength", "qlength", "sumq", "sump", "qnorm", "pnorm", "result", "x", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMultinomial", "factory", "_ref", "typed", "add", "divide", "multiply", "factorial", "isInteger", "isPositive", "a", "sum", "denom", "deepForEach", "ai", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPermutations", "factory", "_ref", "typed", "factorial", "n", "k", "isInteger", "product", "result", "i", "isPositiveInteger", "one", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "import_seedrandom", "singletonRandom", "seedrandom", "createRng", "randomSeed", "random", "setSeed", "seed", "rng", "name", "dependencies", "createPickRandom", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "possibles", "_pickRandom", "options", "number", "weights", "_ref2", "elementWise", "single", "createMatrix", "isMatrix", "flatten", "totalWeights", "i", "len", "isNumber", "length", "result", "pick", "randKey", "_i", "_len", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "randomMatrix", "size", "random", "data", "i", "length", "_i", "_length", "name", "dependencies", "createRandom", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "_random", "max", "min", "size", "_randomMatrix", "res", "randomMatrix", "isMatrix", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRandomInt", "factory", "_ref", "typed", "config", "on", "rng", "createRng", "curr", "prev", "_randomInt", "max", "min", "size", "_randomIntMatrix", "res", "randomMatrix", "isMatrix", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createStirlingS2", "factory", "_ref", "typed", "addScalar", "subtractScalar", "multiplyScalar", "divideScalar", "pow", "factorial", "combinations", "isNegative", "isInteger", "number", "bignumber", "larger", "smallCache", "bigCache", "n", "k", "big", "isNumber", "cache", "make", "nn", "nk", "m", "row", "prev", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBellNumbers", "factory", "_ref", "typed", "addScalar", "isNegative", "isInteger", "stirlingS2", "n", "result", "i", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCatalan", "factory", "_ref", "typed", "addScalar", "divideScalar", "multiplyScalar", "combinations", "isNegative", "isInteger", "n", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createComposition", "factory", "_ref", "typed", "addScalar", "combinations", "isPositive", "isNegative", "isInteger", "larger", "n", "k", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createLeafCount", "factory", "_ref", "parse", "typed", "countLeaves", "node", "count", "n", "expr", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "isNumericNode", "x", "isConstantNode", "isOperatorNode", "isConstantExpression", "isFunctionNode", "isParenthesisNode", "init_dirname", "init_buffer", "init_process", "ownKeys", "r", "t", "o", "_objectSpread", "_defineProperty", "name", "dependencies", "createUtil", "factory", "_ref", "FunctionNode", "OperatorNode", "SymbolNode", "T", "F", "defaultName", "defaultContext", "realContext", "positiveContext", "hasProperty", "nodeOrName", "property", "context", "isOperatorNode", "isFunctionNode", "isParenthesisNode", "hasOwnProperty", "properties", "_properties", "_properties2", "isCommutative", "node", "isAssociative", "mergeContext", "primary", "secondary", "merged", "prop", "flatten", "allChildren", "i", "op", "children", "findChildren", "child", "unflattenr", "makeNode", "createMakeNodeFunction", "l", "curnode", "unflattenl", "args", "err", "name", "dependencies", "createSimplify", "factory", "_ref", "config", "typed", "parse", "add", "subtract", "multiply", "divide", "pow", "isZero", "equal", "resolve", "simplifyConstant", "simplifyCore", "fraction", "bignumber", "mathWithTransform", "matrix", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "hasProperty", "isCommutative", "isAssociative", "mergeContext", "flatten", "unflattenr", "unflattenl", "createMakeNodeFunction", "defaultContext", "realContext", "positiveContext", "createUtil", "createMap", "simplify", "_simplify", "expr", "scope", "options", "removeParens", "node", "path", "parent", "isParenthesisNode", "SUPPORTED_CONSTANTS", "_canonicalizeRule", "ruleObject", "context", "newRule", "lr", "prop", "nonCommutative", "leftExpandsym", "_getExpandPlaceholderSymbol", "makeNode", "expandsym", "_buildRules", "rules", "ruleSet", "i", "rule", "ruleType", "_lastsym", "createEmptyMap", "debug", "res", "visited", "str", "laststr", "rulestr", "applyRule", "newstr", "mapRule", "nodes", "resNodes", "newNode", "symbol", "property", "mergedContext", "newArgs", "newContent", "newItems", "newObj", "newIndex", "newDims", "changed", "newProps", "repl", "matches", "_ruleMatch", "implicit", "hasOwnProperty", "getSplits", "right", "rightArgs", "_i", "left", "mergeMatch", "match1", "match2", "key", "_exactMatch", "_key", "combineChildMatches", "list1", "list2", "merged", "i1", "i2", "mergeChildMatches", "childMatches", "sets", "uniqueSets", "unique", "s", "isSplit", "childMatch", "leftMatch", "rightMatch", "splits", "splitMatches", "_i2", "matchSet", "isConstantNode", "isSymbolNode", "isNumericNode", "isConstantExpression", "p", "q", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSimplifyConstant", "factory", "_ref", "typed", "config", "mathWithTransform", "matrix", "fraction", "bignumber", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "SymbolNode", "isCommutative", "isAssociative", "allChildren", "createMakeNodeFunction", "createUtil", "simplifyConstant", "node", "_ensureNode", "foldFraction", "expr", "options", "_removeFractions", "thing", "isFraction", "isMatrix", "_eval", "fnname", "args", "_toNumber", "_toNode", "_fractionToNode", "n", "unaryMinusNode", "s", "m", "e", "isNode", "_exactFraction", "exactFractions", "f", "fractionsLimit", "numericType", "safeNumberType", "noBignumber", "noFraction", "vn", "_foldAccessor", "obj", "index", "isIndexNode", "isArrayNode", "remainingDims", "isConstantNode", "first", "second", "tryItems", "fromItems", "item", "isObjectNode", "key", "foldOp", "fn", "makeNode", "reduction", "sofar", "next", "last", "newtree", "operatorFunctions", "arg", "sz", "section", "_args", "res", "isOperatorNode", "consts", "vars", "i", "foldItems", "foldProps", "prop", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSimplifyCore", "factory", "_ref", "typed", "parse", "equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "node0", "node1", "nodeT", "nodeF", "isAlwaysBoolean", "node", "isOperatorNode", "hasProperty", "isCommutative", "createUtil", "_simplifyCore", "nodeToSimplify", "options", "context", "isFunctionNode", "simpChild", "childCount", "c", "op", "getOperator", "last", "seclast", "n", "a0", "finish", "_a", "a1", "isConstantNode", "a", "isArrayNode", "isAccessorNode", "isIndexNode", "isObjectNode", "newProps", "prop", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createResolve", "factory", "_ref", "typed", "parse", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "_resolve", "node", "scope", "within", "isSymbolNode", "variables", "value", "isNode", "nextWithin", "isOperatorNode", "args", "arg", "isParenthesisNode", "isFunctionNode", "_args", "child", "n", "createMap", "self", "A", "selfAM", "selfMM", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSymbolicEqual", "factory", "_ref", "parse", "simplify", "typed", "OperatorNode", "_symbolicEqual", "e1", "e2", "options", "diff", "simplified", "isConstantNode", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDerivative", "factory", "_ref", "typed", "config", "parse", "simplify", "equal", "isZero", "numeric", "ConstantNode", "FunctionNode", "OperatorNode", "ParenthesisNode", "SymbolNode", "plainDerivative", "expr", "variable", "options", "constNodes", "constTag", "res", "_derivative", "derivative", "deriv", "_derivTex", "x", "isConstantNode", "typeOf", "order", "d", "node", "varName", "isConst", "i", "createConstantNode", "arg0", "arg1", "div", "negative", "funcDerivative", "op", "func", "chainDerivative", "arg", "constantTerms", "nonConstantTerms", "nonConstantNode", "newArgs", "argOuter", "argInner", "_arg", "_arg2", "powMinusOne", "value", "valueType", "safeNumberType", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRationalize", "factory", "_ref", "config", "typed", "equal", "isZero", "add", "subtract", "multiply", "divide", "pow", "parse", "simplifyConstant", "simplifyCore", "simplify", "fraction", "bignumber", "mathWithTransform", "matrix", "AccessorNode", "ArrayNode", "ConstantNode", "FunctionNode", "IndexNode", "ObjectNode", "OperatorNode", "SymbolNode", "ParenthesisNode", "_rationalize", "expr", "scope", "detailed", "setRules", "rulesRationalize", "polyRet", "polynomial", "nVars", "noExactFractions", "withExactFractions", "expandPower", "sBefore", "rules", "eDistrDiv", "redoInic", "s", "coefficients", "retRationalize", "polyToCanonical", "extended", "variables", "node", "oper", "recPoly", "retFunc", "tp", "isInteger", "i", "_name", "pos", "oldRules", "rulesFirst", "rulesDistrDiv", "rulesSucDiv", "parent", "indParent", "internal", "does", "val", "nEsqTopo", "nDirTopo", "o", "maxExpo", "varname", "recurPol", "first", "no", "n1", "op", "n2", "n3", "noPai", "_i", "valor", "_i2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createZpk2tf", "factory", "_ref", "typed", "add", "multiply", "Complex", "number", "z", "p", "k", "_zpk2tf", "el", "num", "den", "i", "zero", "_multiply", "_i", "pole", "_i2", "b", "c", "j", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createFreqz", "factory", "_ref", "typed", "add", "multiply", "Complex", "divide", "matrix", "b", "a", "w", "createBins", "_freqz", "w2", "_w", "h", "num", "den", "i", "sumNum", "sumDen", "j", "_j", "_i", "n", "bins", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createReviver", "factory", "_ref", "classes", "key", "value", "constructor", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createReplacer", "factory", "key", "value", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "version", "createTrue", "factory", "createFalse", "createNull", "createInfinity", "recreateFactory", "_ref", "config", "BigNumber", "createNaN", "_ref2", "createPi", "_ref3", "createBigNumberPi", "pi", "createTau", "_ref4", "createBigNumberTau", "tau", "createE", "_ref5", "createBigNumberE", "e", "createPhi", "_ref6", "createBigNumberPhi", "phi", "createLN2", "_ref7", "createLN10", "_ref8", "createLOG2E", "_ref9", "createLOG10E", "_ref10", "createSQRT1_2", "_ref11", "createSQRT2", "_ref12", "createI", "_ref13", "Complex", "createUppercasePi", "_ref14", "createUppercaseE", "_ref15", "createVersion", "version", "name", "dependencies", "create", "init_dirname", "init_buffer", "init_process", "createSpeedOfLight", "unitFactory", "createGravitationConstant", "createPlanckConstant", "createReducedPlanckConstant", "createMagneticConstant", "createElectricConstant", "createVacuumImpedance", "createCoulomb", "createElementaryCharge", "createBohrMagneton", "createConductanceQuantum", "createInverseConductanceQuantum", "createMagneticFluxQuantum", "createNuclearMagneton", "createKlitzing", "createBohrRadius", "unitFactory", "createClassicalElectronRadius", "createElectronMass", "createFermiCoupling", "createFineStructure", "numberFactory", "createHartreeEnergy", "createProtonMass", "createDeuteronMass", "createNeutronMass", "createQuantumOfCirculation", "createRydberg", "createThomsonCrossSection", "createWeakMixingAngle", "createEfimovFactor", "createAtomicMass", "createAvogadro", "createBoltzmann", "createFaraday", "createFirstRadiation", "createLoschmidt", "createGasConstant", "createMolarPlanckConstant", "createMolarVolume", "createSackurTetrode", "createSecondRadiation", "createStefanBoltzmann", "createWienDisplacement", "createMolarMass", "createMolarMassC12", "createGravity", "createPlanckLength", "createPlanckMass", "createPlanckTime", "createPlanckCharge", "createPlanckTemperature", "name", "valueStr", "unitStr", "dependencies", "factory", "_ref", "config", "Unit", "BigNumber", "value", "unit", "_ref2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createApplyTransform", "factory", "_ref", "typed", "isInteger", "apply", "createApply", "args", "dim", "isNumber", "isBigNumber", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createColumnTransform", "factory", "_ref", "typed", "Index", "matrix", "range", "column", "createColumn", "args", "lastIndex", "last", "isNumber", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "compileInlineExpression", "expression", "math", "scope", "symbol", "node", "isSymbolNode", "name", "argsScope", "subScope", "PartitionedMap", "eq", "x", "name", "dependencies", "createFilterTransform", "factory", "_ref", "typed", "filterTransform", "args", "math", "scope", "x", "callback", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "filter", "_filter", "test", "filterRegExp", "value", "index", "array", "applyCallback", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createForEachTransform", "factory", "_ref", "typed", "forEachTransform", "args", "math", "scope", "x", "callback", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "_forEach", "array", "recurse", "value", "index", "forEach", "child", "i", "applyCallback", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createIndexTransform", "factory", "_ref", "Index", "getMatrixDataType", "args", "i", "ii", "arg", "isRange", "v", "isArray", "isMatrix", "isNumber", "isBigNumber", "res", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMapTransform", "factory", "_ref", "typed", "mapTransform", "args", "math", "scope", "x", "callback", "isSymbolNode", "isFunctionAssignmentNode", "compileInlineExpression", "map", "_map", "array", "orig", "recurse", "value", "index", "child", "i", "applyCallback", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "lastDimToZeroBase", "args", "isCollection", "dim", "isNumber", "isBigNumber", "name", "dependencies", "createMaxTransform", "factory", "_ref", "typed", "config", "numeric", "larger", "max", "createMax", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMeanTransform", "factory", "_ref", "typed", "add", "divide", "mean", "createMean", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createMinTransform", "factory", "_ref", "typed", "config", "numeric", "smaller", "min", "createMin", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRangeTransform", "factory", "_ref", "typed", "config", "matrix", "bignumber", "smaller", "smallerEq", "larger", "largerEq", "add", "isPositive", "range", "createRange", "args", "lastIndex", "last", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createRowTransform", "factory", "_ref", "typed", "Index", "matrix", "range", "row", "createRow", "args", "lastIndex", "last", "isNumber", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSubsetTransform", "factory", "_ref", "typed", "matrix", "zeros", "add", "subset", "createSubset", "args", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createConcatTransform", "factory", "_ref", "typed", "matrix", "isInteger", "concat", "createConcat", "args", "lastIndex", "last", "isNumber", "isBigNumber", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createDiffTransform", "factory", "_ref", "typed", "matrix", "subtract", "number", "bignumber", "diff", "createDiff", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createStdTransform", "factory", "_ref", "typed", "map", "sqrt", "variance", "std", "createStd", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createSumTransform", "factory", "_ref", "typed", "config", "add", "numeric", "sum", "createSum", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createQuantileSeqTransform", "factory", "_ref", "typed", "bignumber", "add", "subtract", "divide", "multiply", "partitionSelect", "compare", "isInteger", "smaller", "smallerEq", "larger", "quantileSeq", "createQuantileSeq", "arr", "prob", "dim", "dimToZeroBase", "sorted", "data", "lastDimToZeroBase", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createCumSumTransform", "factory", "_ref", "typed", "add", "unaryPlus", "cumsum", "createCumSum", "args", "isCollection", "dim", "isNumber", "isBigNumber", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createVarianceTransform", "factory", "_ref", "typed", "add", "subtract", "multiply", "divide", "apply", "isNaN", "variance", "createVariance", "args", "lastDimToZeroBase", "err", "errorTransform", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createPrintTransform", "factory", "_ref", "typed", "matrix", "zeros", "add", "print", "createPrint", "template", "values", "_convertTemplateToZeroBasedIndex", "options", "printTemplate", "x", "parts", "result", "part", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createAndTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "and", "createAnd", "andTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createOrTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "or", "createOr", "orTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBitAndTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "zeros", "not", "concat", "bitAnd", "createBitAnd", "bitAndTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "init_dirname", "init_buffer", "init_process", "name", "dependencies", "createBitOrTransform", "factory", "_ref", "typed", "matrix", "equalScalar", "DenseMatrix", "concat", "bitOr", "createBitOr", "bitOrTransform", "args", "math", "scope", "condition1", "isCollection", "condition2", "init_dirname", "init_buffer", "init_process", "init_dirname", "init_buffer", "init_process", "all", "factoriesAny_exports", "init_dirname", "init_buffer", "init_process", "import_typed_function", "init_dirname", "init_buffer", "init_process", "import_tiny_emitter", "mixin", "obj", "emitter", "Emitter", "init_dirname", "init_buffer", "init_process", "importFactory", "typed", "load", "math", "importedFactories", "mathImport", "functions", "options", "num", "ArgumentsError", "flattenImports", "flatValues", "value", "name", "item", "_name", "hasOwnProperty", "isFactory", "flatName", "isTransformFunctionFactory", "_importFactory", "isSupportedType", "_import", "_wrap", "hasTypedFunctionSignature", "_importTransform", "allowedInExpressions", "_deleteTransform", "fn", "wrapper", "args", "i", "len", "arg", "factory", "namespace", "existingTransform", "existing", "resolver", "dependencies", "stripOptionalNotation", "dependency", "instance", "lazy", "factoryAllowedInExpressions", "object", "isUnit", "isComplex", "isBigNumber", "isFraction", "isMatrix", "unsafe", "create", "factories", "config", "configInternal", "_extends", "DEFAULT_CONFIG", "math", "mixin", "isNumber", "isComplex", "isBigNumber", "isBigInt", "isFraction", "isUnit", "isString", "isArray", "isMatrix", "isCollection", "isDenseMatrix", "isSparseMatrix", "isRange", "isIndex", "isBoolean", "isResultSet", "isHelp", "isFunction", "isDate", "isRegExp", "isObject", "isNull", "isUndefined", "isAccessorNode", "isArrayNode", "isAssignmentNode", "isBlockNode", "isConditionalNode", "isConstantNode", "isFunctionAssignmentNode", "isFunctionNode", "isIndexNode", "isNode", "isObjectNode", "isOperatorNode", "isParenthesisNode", "isRangeNode", "isRelationalNode", "isSymbolNode", "isChain", "configFactory", "legacyFactories", "legacyInstances", "load", "factory", "isFactory", "firstProperty", "isLegacyFactory", "index", "instance", "importedFactories", "lazyTyped", "_len", "args", "_key", "typedFunction", "internalImport", "importFactory", "deepFlatten", "ArgumentsError", "DimensionError", "IndexError", "esm_exports", "__export", "ABS", "ACCRINT", "ACCRINTM", "ACOS", "ACOSH", "ACOT", "ACOTH", "AGGREGATE", "AMORDEGRC", "AMORLINC", "AND", "ARABIC", "ASC", "ASIN", "ASINH", "ATAN", "ATAN2", "ATANH", "AVEDEV", "AVERAGE", "AVERAGEA", "AVERAGEIF", "AVERAGEIFS", "BAHTTEXT", "BASE", "BESSELI", "BESSELJ", "BESSELK", "BESSELY", "BETA", "BETADIST", "BETAINV", "BIN2DEC", "BIN2HEX", "BIN2OCT", "BINOM", "BINOMDIST", "BITAND", "BITLSHIFT", "BITOR", "BITRSHIFT", "BITXOR", "CEILING", "CEILINGMATH", "CEILINGPRECISE", "CELL", "CHAR", "CHIDIST", "CHIDISTRT", "CHIINV", "CHIINVRT", "CHISQ", "CHITEST", "CHOOSE", "CLEAN", "CODE", "COLUMN", "COLUMNS", "COMBIN", "COMBINA", "COMPLEX", "CONCAT", "CONCATENATE", "CONFIDENCE", "CONVERT", "CORREL", "COS", "COSH", "COT", "COTH", "COUNT", "COUNTA", "COUNTBLANK", "COUNTIF", "COUNTIFS", "COUPDAYBS", "COUPDAYS", "COUPDAYSNC", "COUPNCD", "COUPNUM", "COUPPCD", "COVAR", "COVARIANCE", "COVARIANCEP", "COVARIANCES", "CRITBINOM", "CSC", "CSCH", "CUMIPMT", "CUMPRINC", "DATE", "DATEDIF", "DATEVALUE", "DAVERAGE", "DAY", "DAYS", "DAYS360", "DB", "DBCS", "DCOUNT", "DCOUNTA", "DDB", "DEC2BIN", "DEC2HEX", "DEC2OCT", "DECIMAL", "DEGREES", "DELTA", "DEVSQ", "DGET", "DISC", "DMAX", "DMIN", "DOLLAR", "DOLLARDE", "DOLLARFR", "DPRODUCT", "DSTDEV", "DSTDEVP", "DSUM", "DURATION", "DVAR", "DVARP", "EDATE", "EFFECT", "EOMONTH", "ERF", "ERFC", "ERFCPRECISE", "ERFPRECISE", "ERROR", "EVEN", "EXACT", "EXP", "EXPON", "EXPONDIST", "F", "FACT", "FACTDOUBLE", "FALSE", "FDIST", "FDISTRT", "FIND", "FINV", "FINVRT", "FISHER", "FISHERINV", "FIXED", "FLOOR", "FLOORMATH", "FLOORPRECISE", "FORECAST", "FREQUENCY", "FTEST", "FV", "FVSCHEDULE", "GAMMA", "GAMMADIST", "GAMMAINV", "GAMMALN", "GAMMALNPRECISE", "GAUSS", "GCD", "GEOMEAN", "GESTEP", "GROWTH", "HARMEAN", "HEX2BIN", "HEX2DEC", "HEX2OCT", "HLOOKUP", "HOUR", "HYPGEOM", "HYPGEOMDIST", "IF", "IFERROR", "IFNA", "IFS", "IMABS", "IMAGINARY", "IMARGUMENT", "IMCONJUGATE", "IMCOS", "IMCOSH", "IMCOT", "IMCSC", "IMCSCH", "IMDIV", "IMEXP", "IMLN", "IMLOG10", "IMLOG2", "IMPOWER", "IMPRODUCT", "IMREAL", "IMSEC", "IMSECH", "IMSIN", "IMSINH", "IMSQRT", "IMSUB", "IMSUM", "IMTAN", "INDEX", "INFO", "INT", "INTERCEPT", "INTRATE", "IPMT", "IRR", "ISBLANK", "ISERR", "ISERROR", "ISEVEN", "ISFORMULA", "ISLOGICAL", "ISNA", "ISNONTEXT", "ISNUMBER", "ISO", "ISODD", "ISOWEEKNUM", "ISPMT", "ISREF", "ISTEXT", "KURT", "LARGE", "LCM", "LEFT", "LEN", "LINEST", "LN", "LOG", "LOG10", "LOGEST", "LOGINV", "LOGNORM", "LOGNORMDIST", "LOGNORMINV", "LOOKUP", "LOWER", "MATCH", "MAX", "MAXA", "MAXIFS", "MDURATION", "MEDIAN", "MID", "MIN", "MINA", "MINIFS", "MINUTE", "MIRR", "MMULT", "MOD", "MODE", "MODEMULT", "MODESNGL", "MONTH", "MROUND", "MULTINOMIAL", "MUNIT", "N", "NA", "NEGBINOM", "NEGBINOMDIST", "NETWORKDAYS", "NETWORKDAYSINTL", "NOMINAL", "NORM", "NORMDIST", "NORMINV", "NORMSDIST", "NORMSINV", "NOT", "NOW", "NPER", "NPV", "NUMBERVALUE", "OCT2BIN", "OCT2DEC", "OCT2HEX", "ODD", "ODDFPRICE", "ODDFYIELD", "ODDLPRICE", "ODDLYIELD", "OR", "PDURATION", "PEARSON", "PERCENTILE", "PERCENTILEEXC", "PERCENTILEINC", "PERCENTRANK", "PERCENTRANKEXC", "PERCENTRANKINC", "PERMUT", "PERMUTATIONA", "PHI", "PI", "PMT", "POISSON", "POISSONDIST", "POWER", "PPMT", "PRICE", "PRICEDISC", "PRICEMAT", "PROB", "PRODUCT", "PRONETIC", "PROPER", "PV", "QUARTILE", "QUARTILEEXC", "QUARTILEINC", "QUOTIENT", "RADIANS", "RAND", "RANDBETWEEN", "RANK", "RANKAVG", "RANKEQ", "RATE", "RECEIVED", "REPLACE", "REPT", "RIGHT", "ROMAN", "ROUND", "ROUNDDOWN", "ROUNDUP", "ROW", "ROWS", "RRI", "RSQ", "SEARCH", "SEC", "SECH", "SECOND", "SERIESSUM", "SHEET", "SHEETS", "SIGN", "SIN", "SINH", "SKEW", "SKEWP", "SLN", "SLOPE", "SMALL", "SORT", "SQRT", "SQRTPI", "STANDARDIZE", "STDEV", "STDEVA", "STDEVP", "STDEVPA", "STDEVS", "STEYX", "SUBSTITUTE", "SUBTOTAL", "SUM", "SUMIF", "SUMIFS", "SUMPRODUCT", "SUMSQ", "SUMX2MY2", "SUMX2PY2", "SUMXMY2", "SWITCH", "SYD", "T", "TAN", "TANH", "TBILLEQ", "TBILLPRICE", "TBILLYIELD", "TDIST", "TDISTRT", "TEXT", "TEXTJOIN", "TIME", "TIMEVALUE", "TINV", "TODAY", "TRANSPOSE", "TREND", "TRIM", "TRIMMEAN", "TRUE", "TRUNC", "TTEST", "TYPE", "UNICHAR", "UNICODE", "UNIQUE", "UPPER", "VALUE", "VAR", "VARA", "VARP", "VARPA", "VARS", "VDB", "VLOOKUP", "WEEKDAY", "WEEKNUM", "WEIBULL", "WEIBULLDIST", "WORKDAY", "WORKDAYINTL", "XIRR", "XNPV", "XOR", "YEAR", "YEARFRAC", "YIELD", "YIELDDISC", "YIELDMAT", "Z", "ZTEST", "utils", "init_dirname", "init_buffer", "init_process", "import_jstat", "import_bessel", "nil", "div0", "value", "ref", "name", "num", "na", "error", "data", "errors", "defaultOperator", "validSymbols", "_TOKEN_TYPE_OPERATOR", "_TOKEN_TYPE_LITERAL", "SUPPORTED_TOKENS", "TOKEN_TYPE_OPERATOR", "TOKEN_TYPE_LITERAL", "createToken", "type", "castValueToCorrectType", "tokenizeExpression", "expression", "expressionLength", "tokens", "cursorIndex", "processedValue", "processedSymbol", "char", "analyzeTokens", "literalValue", "analyzedTokens", "i", "token", "computeExpression", "values", "operator", "evaluate", "result", "parse", "compute", "argsToArray", "args", "arrayEach", "array", "iteratee", "index", "length", "arrayValuesToNumbers", "arr", "n", "el", "number", "parseNumber", "fillMatrix", "matrix", "fill_value", "a", "j", "longestArrayIndex", "acc", "longestArrayLength", "flatten", "argument", "isArrayLike", "isFlat", "flattenShallow", "b", "aIsArray", "bIsArray", "initial", "idx", "rest", "transpose", "col", "row", "findField", "database", "title", "anyError", "anyIsError", "cleanFloat", "numbers", "serialNumberToDate", "serial", "utc_value", "date_info", "fractional_day", "total_seconds", "seconds", "hours", "minutes", "days", "month", "parseBool", "bool", "up", "parseDate", "date", "d", "parseDateArray", "len", "parsed", "string", "parseNumberArray", "parseString", "anyIsString", "applyCriteria", "range", "criterias", "criteriaLength", "isMetCondition", "valueToTest", "criteria", "isWildcard", "computedResult", "tokenizedCriteria", "isDefined", "arg", "error_val", "value$1", "reference", "jStat", "lookup_value", "table_array", "row_index_num", "range_lookup", "row_num", "column_num", "someError", "isOneDimensionRange", "result_array", "isNumberLookup", "lookup_array", "match_type", "indexValue", "lookupValueStr", "sort_index", "sort_order", "by_col", "sortArray", "hasElement", "element", "col_index_num", "exactMatchOnly", "lookupValue", "rowValue", "SQRT2PI", "flatArgumentsDefined", "sum", "count", "average_range", "flatAverageRangeDefined", "average_count", "average", "x", "alpha", "beta", "cumulative", "probability", "number_s", "trials", "probability_s", "number_s2", "deg_freedom", "actual_range", "expected_range", "tmp", "dof", "xsqr", "Pi", "ChiSq", "p", "k", "t", "standard_dev", "size", "array1", "array2", "flatArguments", "blanks", "matches", "results", "mean1", "mean2", "mean", "lambda", "deg_freedom1", "deg_freedom2", "sumOfSquares", "x1", "x2", "sum1", "sum2", "y", "e2y", "known_ys", "known_xs", "xmean", "ymean", "den", "data_array", "bins_array", "r", "z", "known_y", "known_x", "new_x", "use_const", "avg_x", "avg_y", "avg_xy", "avg_xx", "new_y", "sample_s", "number_sample", "population_s", "number_pop", "pdf", "M", "cdf", "sigma", "m", "maxItems", "max", "currentItem", "number_f", "den1", "den2", "l", "fl", "significance", "uniques", "power", "match", "number_chosen", "x_range", "prob_range", "lower_limit", "upper_limit", "sorted", "quart", "order", "sort", "m2", "m3", "v", "lft", "T$1", "mean_x", "mean_y", "s_x", "s_y", "new_xs", "linest", "percent", "trim", "function_num", "options", "ref1", "ref2", "text", "x_num", "y_num", "anyError$1", "radix", "min_length", "mode", "precision", "e2", "angle", "MEMOIZED_FACT", "r0", "ri", "o", "base", "_", "divisor", "modulus", "multiple", "dimension", "temp", "numerator", "denominator", "bottom", "top", "digits", "key", "roman", "num_digits", "coefficients", "inner_result", "sum_range", "sumValue", "arrays", "product", "_i", "_ij", "_ij_arg", "_i_arg", "array_x", "array_y", "ADD", "num1", "num2", "DIVIDE", "dividend", "EQ", "value1", "value2", "GT", "GTE", "LT", "LTE", "MINUS", "MULTIPLY", "factor1", "factor2", "NE", "POW", "exponent", "symbols", "d1900", "WEEK_STARTS", "WEEK_TYPES", "WEEKEND_TYPES", "year", "day", "start_date", "end_date", "unit", "start_date_year", "start_date_month", "start_date_day", "end_date_year", "end_date_month", "end_date_day", "date_text", "serial_number", "startOfDay", "newDate", "method", "sm", "em", "sd", "ed", "smd", "emd", "months", "storedDay", "targetMonth", "daysInTargetMonth", "targetYear", "yearStart", "holidays", "weekend", "isMask", "maskDays", "maskIndex", "maskRegex", "total", "dec", "holiday", "hour", "minute", "second", "time_text", "return_type", "week_start", "jan", "inc", "h", "sign", "isLeapYear", "daysBetween", "basis", "sy", "ey", "feb29Between", "date1", "date2", "year1", "mar1year1", "year2", "mar1year2", "ylength", "years", "addOn", "re", "trueFound", "falseFound", "decimals", "formattedNumber", "text1", "text2", "find_text", "within_text", "start_num", "found_index", "no_commas", "factor", "parts", "num_chars", "begin", "end", "decimal_separator", "group_separator", "txt", "old_text", "new_text", "number_times", "foundAt", "instance_num", "format_text", "currencySymbol", "isPercent", "decimalPlaces", "noCommas", "delimiter", "ignore_empty", "flatArgs", "textToJoin", "chunks", "item", "output", "isValidBinaryNumber", "bessel", "stringified", "places", "number1", "number2", "shift_amount", "real_num", "i_num", "suffix", "from_unit", "to_unit", "units", "binary_prefixes", "unit_prefixes", "from", "to", "base_from_unit", "base_to_unit", "from_multiplier", "to_multiplier", "alt", "from_binary_prefix", "from_unit_prefix", "to_binary_prefix", "to_unit_prefix", "step", "negative", "decimal", "inumber", "plus", "minus", "last", "inumber1", "inumber2", "c", "unit1", "unit2", "e", "s", "compact", "findResultIndex", "maxCriteriaLength", "currentCriteriaResult", "hasMatchingCriteria", "criteriaField", "field", "resultIndexes", "targetFields", "targetValues", "maxValue", "minValue", "validDate", "ensureDate", "lastCoupDateBeforeSettlement", "settlement", "maturity", "frequency", "validateFrequency", "validateBasis", "issue", "first_interest", "rate", "par", "nextDate", "numOfDays", "nper", "pv", "start_period", "end_period", "payment", "interest", "principal", "cost", "salvage", "life", "period", "current", "ceiling", "pr", "redemption", "basisVal", "diff", "fractional_dollar", "fraction", "decimal_dollar", "nominal_rate", "npery", "term", "schedule", "future", "per", "fv", "guess", "irrResult", "dates", "irrResultDeriv", "frac", "positive", "resultRate", "epsMax", "newRate", "epsRate", "resultValue", "contLoop", "finance_rate", "reinvest_rate", "payments", "incomes", "effect_rate", "pmt", "discount", "iterMax", "f", "dy", "df", "logical_test", "value_if_true", "value_if_false", "value_if_error", "value_if_na", "logical", "targetValue", "argc", "switchCount", "switchSatisfied", "hasDefaultClause", "defaultClause", "math", "create", "all", "factory", "esm_exports", "nowFormat", "nowDayFormat", "todayFormat", "todayDayFormat", "calculate", "app", "cm", "answers", "answerCopy", "avgs", "totals", "subtotals", "dateTime", "DateTime", "$", "cmLine", "cmLineNo", "lineNo", "answer", "line", "checkLocale", "match", "evaluate", "answerCopyInit", "formatAnswer", "plotAns", "error", "pages", "store", "page", "dateTimeReg", "lineDate", "lineDateRight", "locale", "lineDateNow", "lineDateToday", "lineDateTime", "rightOfDate", "durHrs", "pcntOfReg", "pcntOfValReg", "stripAnswer", "separator", "a", "b", "digits", "import_uikit", "import_codemirror", "import_javascript", "import_dialog", "import_placeholder", "import_closebrackets", "import_matchbrackets", "import_show_hint", "import_jump_to_line", "import_search", "import_searchcursor", "cm", "CodeMirror", "$", "udOptions", "udfInput", "uduInput", "stream", "cmStream", "app", "math", "esm_exports", "val", "par", "numaraHints", "scopeList", "scope", "f", "editor", "cmCursor", "cmCursorLine", "start", "end", "curStr", "curWord", "curWordRegex", "text", "b", "calculate", "line", "cmLineNo", "activeLine", "ttPos", "el", "funcs", "$all", "obj", "UIkit", "udfs", "udus", "u", "currencies", "c", "currency", "currencyName", "units", "constants", "vars", "v", "varTooltip", "formatAnswer", "lineNos", "ln", "scopeTooltip", "s", "excel", "x", "pages", "store", "page", "inputContext", "index", "cm", "line", "answer", "$", "isEmpty", "isLine", "isSelection", "isMultiLine", "hasAnswer", "outputContext", "event", "textboxContext", "copyLine", "notify", "copyAnswer", "withLines", "copiedText", "copyAllLines", "copyAllAnswers", "copiedOutputs", "copyAll", "copiedCalc", "isElectron", "udfInput", "uduInput", "$all", "el", "init_dirname", "init_buffer", "init_process", "math", "getRates", "url", "$", "response", "rates", "dups", "app", "currency", "store", "cm", "calculate", "error", "notify", "init_dirname", "init_buffer", "init_process", "createElement", "tag", "attrs", "children", "element", "name", "child", "childElement", "createElement$1", "getAttrs", "element", "attrs", "attr", "getClassNames", "combineClassNames", "arrayOfClassnames", "classItem", "value", "index", "self", "toPascalCase", "string", "g0", "g1", "g2", "replaceElement", "nameAttr", "icons", "iconName", "ComponentName", "iconNode", "elementAttrs", "tag", "iconAttributes", "children", "iconAttrs", "classNames", "svgElement", "createElement$1", "defaultAttributes", "ArrowUpDown", "defaultAttributes", "Braces", "defaultAttributes", "CircleAlert", "defaultAttributes", "Circle", "defaultAttributes", "Copy", "defaultAttributes", "CornerDownRight", "defaultAttributes", "Dot", "defaultAttributes", "Download", "defaultAttributes", "EllipsisVertical", "defaultAttributes", "Eraser", "defaultAttributes", "Info", "defaultAttributes", "ListRestart", "defaultAttributes", "PanelLeftClose", "defaultAttributes", "PanelLeft", "defaultAttributes", "Plus", "defaultAttributes", "Printer", "defaultAttributes", "Scaling", "defaultAttributes", "Settings", "defaultAttributes", "Trash", "defaultAttributes", "UndoDot", "defaultAttributes", "Upload", "defaultAttributes", "createIcons", "icons", "nameAttr", "attrs", "elementsToReplace", "element", "replaceElement", "deprecatedElements", "iconList", "CircleAlert", "ArrowUpDown", "Braces", "Circle", "Copy", "CornerDownRight", "Dot", "Download", "EllipsisVertical", "Eraser", "Info", "ListRestart", "PanelLeft", "PanelLeftClose", "Plus", "Printer", "Scaling", "Settings", "Trash", "UndoDot", "Upload", "generateIcons", "createIcons", "init_dirname", "init_buffer", "init_process", "name", "productName", "description", "version", "author", "homepage", "import_function_plot", "plot", "$", "app", "f", "math", "domain", "xDomain", "yDomain", "functionPlot", "store", "fileName", "productName", "preface", "svgData", "svgBlob", "downloadLink", "init_dirname", "init_buffer", "init_process", "import_deep_diff", "checkDefaults", "$", "DeepDiff", "app", "settings", "bigNumberWarning", "localeWarning", "checkLocale", "checkMods", "key", "checkSchema", "d", "store", "$all", "item", "span", "icon", "generateIcons", "locales", "matrixTypes", "numericOutputs", "notations", "l", "n", "m", "el", "checkSize", "appTheme", "isElectron", "udfuTheme", "udfInput", "uduInput", "elements", "cm", "math", "calculate", "getRates", "confirm", "showError", "init_dirname", "init_buffer", "init_process", "import_uikit", "migrateSaved", "saved", "store", "pages", "id", "val", "getPageName", "pageNo", "regex", "pageNos", "page", "a", "b", "max", "i", "lastPage", "populatePages", "defaultPage", "$", "pageListItem", "app", "DateTime", "event", "loadPage", "UIkit", "renamePage", "deletePage", "duplicatePage", "generateIcons", "pageId", "cursor", "cm", "pageName", "newPage", "isImport", "p", "notify", "confirm", "showModal", "rename", "dupPageId", "dupPage", "dupPageData", "dupPageName", "sortPages", "by", "sortedPages", "pageOrder", "orderedPages", "$all", "el", "deleteAllPages", "newPageDialog", "isElectron", "data", "msg", "error", "init_dirname", "init_buffer", "init_process", "applyUdfu", "input", "type", "resolve", "reject", "UDFunc", "f", "app", "store", "error", "$", "udfInput", "showError", "uduInput", "import_uikit", "import_mousetrap", "init_dirname", "init_buffer", "init_process", "Mousetrap", "_globalCallbacks", "_originalStopCallback", "e", "element", "combo", "sequence", "self", "keys", "callback", "action", "i", "description", "$", "DateTime", "author", "isElectron", "version", "homepage", "settings", "isMac", "name", "event", "isMax", "toggleMinMax", "generateIcons", "app", "getRates", "store", "lastPage", "loadPage", "defaultPage", "migrateSaved", "applyUdfu", "populatePages", "cm", "calculate", "copyAll", "showModal", "notify", "func", "plot", "error", "showError", "sels", "resizeDelay", "isResizing", "panel", "divider", "dividerTooltip", "offset", "iWidth", "inputWidth", "UIkit", "udf", "udu", "udfInput", "uduInput", "pageOrder", "getPageName", "windowResizeDelay", "checkSize", "inputScroll", "outputScroll", "inputPanel", "outputPanel", "traps", "button", "command", "Mousetrap", "$all", "checkUpdates", "printArea", "line", "lineNo", "input", "answer", "row"] }